From 8485e38c33ed46f82e3c0ae2f2613e89f4c8149b Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 29 May 2025 11:27:35 +0200 Subject: [PATCH 1/2] fix: domain screens --- .../domain-[domain]/addPresetModal.svelte | 18 ++++++++++++------ .../domain-[domain]/domainMetrics.svelte | 7 ++++++- .../domains/domain-[domain]/store.ts | 6 +++--- .../domains/domain-[domain]/table.svelte | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte index 5305ee2b72..566c919b9a 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte @@ -20,17 +20,23 @@ async function fetchPreset() { switch (selectedPreset.toLowerCase()) { case 'zoho': - return await sdk.forConsole.domains.getPresetZoho(page.params.domain); + records = await sdk.forConsole.domains.getPresetZoho(page.params.domain); + return records; case 'mailgun': - return await sdk.forConsole.domains.getPresetMailgun(page.params.domain); + records = await sdk.forConsole.domains.getPresetMailgun(page.params.domain); + return records; case 'outlook': - return await sdk.forConsole.domains.getPresetOutlook(page.params.domain); + records = await sdk.forConsole.domains.getPresetOutlook(page.params.domain); + return records; case 'proton mail': - return await sdk.forConsole.domains.getPresetProtonMail(page.params.domain); + records = await sdk.forConsole.domains.getPresetProtonMail(page.params.domain); + return records; case 'icloud': - return await sdk.forConsole.domains.getPresetICloud(page.params.domain); + records = await sdk.forConsole.domains.getPresetICloud(page.params.domain); + return records; case 'google workspace': - return await sdk.forConsole.domains.getPresetGoogleWorkspace(page.params.domain); + records = await sdk.forConsole.domains.getPresetGoogleWorkspace(page.params.domain); + return records; } } diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte index 7743e790cb..fbde9ac6b8 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte @@ -27,7 +27,12 @@ description: 'Expiry date' }, { - value: domain?.autoRenewal ? 'On' : 'Off', + value: + domain?.registrar?.toLocaleLowerCase() === 'appwrite' + ? domain?.autoRenewal + ? 'On' + : 'Off' + : '-', description: 'Auto renewal' }, { diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts index cba5cf5ae1..85493f0720 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts @@ -5,13 +5,13 @@ import { derived, writable } from 'svelte/store'; export const domain = derived(page, ($page) => $page.data.domain as Domain); export const columns = writable([ - { id: 'name', title: 'Name', type: 'string', width: 150 }, + { id: 'name', title: 'Name', type: 'string', width: { min: 150 } }, { id: 'type', title: 'Type', type: 'string', width: 125 }, { id: 'value', title: 'Value', type: 'string', width: 250 }, { id: 'ttl', title: 'TTL', type: 'integer', width: 100 }, { id: 'priority', title: 'Priority', type: 'integer', width: 80, hide: true }, - { id: 'comment', title: 'Comment', type: 'string', width: 200, hide: true }, - { id: '$createdAt', title: 'Created', type: 'datetime' } + { id: 'comment', title: 'Comment', type: 'string', width: { min: 180 } }, + { id: '$createdAt', title: 'Created', type: 'datetime', width: { min: 120 } } ]); export const recordTypes = [ diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index fa6f59d805..47c023ec7c 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -73,7 +73,7 @@ {record?.priority ?? '-'} {:else if column.id === 'comment'} - + {record?.comment ?? '-'} {:else if column.id === '$createdAt'} From eedc976c0f9246acc84baab154936638b5386162 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 29 May 2025 12:27:31 +0200 Subject: [PATCH 2/2] fix: use correct sdk, update imports, delte old code --- src/lib/helpers/domains.ts | 30 +- src/lib/pages/domains/create.svelte | 50 - src/lib/pages/domains/delete.svelte | 51 - src/lib/pages/domains/index.svelte | 186 -- src/lib/pages/domains/index.ts | 2 - .../pages/domains/wizard/cnameTable.svelte | 38 - src/lib/pages/domains/wizard/retry.svelte | 92 - src/lib/pages/domains/wizard/step1.svelte | 83 - src/lib/pages/domains/wizard/step2.svelte | 54 - src/lib/pages/domains/wizard/store.ts | 6 - src/lib/sdk/domains.ts | 1981 ----------------- src/lib/stores/sdk.ts | 4 +- .../domains/+page.svelte | 8 +- .../domains/add-domain/+page.svelte | 4 +- .../domains/deleteDomainModal.svelte | 4 +- .../domain-[domain]/addPresetModal.svelte | 4 +- .../domain-[domain]/deleteRecordModal.svelte | 4 +- .../domain-[domain]/domainMetrics.svelte | 7 +- .../settings/changeOrganization.svelte | 4 +- .../settings/deleteDomain.svelte | 4 +- .../domains/domain-[domain]/store.ts | 4 +- .../domains/domain-[domain]/table.svelte | 4 +- .../domain-[domain]/updateRecordModal.svelte | 4 +- .../domains/recordsCard.svelte | 4 +- .../domains/retryDomainModal.svelte | 4 +- .../add-domain/verify-[domain]/+page.ts | 4 +- .../add-domain/verify-[domain]/+page.ts | 4 +- .../add-domain/verify-[domain]/+page.ts | 4 +- 28 files changed, 53 insertions(+), 2595 deletions(-) delete mode 100644 src/lib/pages/domains/create.svelte delete mode 100644 src/lib/pages/domains/delete.svelte delete mode 100644 src/lib/pages/domains/index.svelte delete mode 100644 src/lib/pages/domains/index.ts delete mode 100644 src/lib/pages/domains/wizard/cnameTable.svelte delete mode 100644 src/lib/pages/domains/wizard/retry.svelte delete mode 100644 src/lib/pages/domains/wizard/step1.svelte delete mode 100644 src/lib/pages/domains/wizard/step2.svelte delete mode 100644 src/lib/pages/domains/wizard/store.ts delete mode 100644 src/lib/sdk/domains.ts diff --git a/src/lib/helpers/domains.ts b/src/lib/helpers/domains.ts index cb5283e35d..7d11aa59d5 100644 --- a/src/lib/helpers/domains.ts +++ b/src/lib/helpers/domains.ts @@ -1,7 +1,7 @@ -import type { DnsRecord } from '$lib/sdk/domains'; import { sdk } from '$lib/stores/sdk'; +import type { Models } from '@appwrite.io/console'; -export async function createRecord(record: Partial, domainId: string) { +export async function createRecord(record: Partial, domainId: string) { switch (record.type) { case 'A': return await sdk.forConsole.domains.createRecordA( @@ -40,8 +40,8 @@ export async function createRecord(record: Partial, domainId: string) return await sdk.forConsole.domains.createRecordTXT( domainId, record.name, - record.value, record.ttl, + record.value, record?.comment || undefined ); case 'NS': @@ -91,16 +91,16 @@ export async function createRecord(record: Partial, domainId: string) } export type ParsedRecords = { - A: Partial[]; - AAAA: Partial[]; - CNAME: Partial[]; - MX: Partial[]; - TXT: Partial[]; - NS: Partial[]; - SRV: Partial[]; - CAA: Partial[]; - PTR: Partial[]; - HTTPS: Partial[]; - ALIAS: Partial[]; - [key: string]: Partial[]; + A: Partial[]; + AAAA: Partial[]; + CNAME: Partial[]; + MX: Partial[]; + TXT: Partial[]; + NS: Partial[]; + SRV: Partial[]; + CAA: Partial[]; + PTR: Partial[]; + HTTPS: Partial[]; + ALIAS: Partial[]; + [key: string]: Partial[]; }; diff --git a/src/lib/pages/domains/create.svelte b/src/lib/pages/domains/create.svelte deleted file mode 100644 index d2fed1030e..0000000000 --- a/src/lib/pages/domains/create.svelte +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/lib/pages/domains/delete.svelte b/src/lib/pages/domains/delete.svelte deleted file mode 100644 index b4b6ee4393..0000000000 --- a/src/lib/pages/domains/delete.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - -

Are you sure you want to delete {selectedDomain?.domain}?

-

You will no longer be able to {getCorrectMessage()} by visiting this domain.

-
diff --git a/src/lib/pages/domains/index.svelte b/src/lib/pages/domains/index.svelte deleted file mode 100644 index 7db4005068..0000000000 --- a/src/lib/pages/domains/index.svelte +++ /dev/null @@ -1,186 +0,0 @@ - - -{#if $canWriteRules} - - - - - - - - -{/if} -{#if rules.total} - - - Name - Verification status - Certificate status - - - {#each rules.rules as domain} - - - - - {domain.domain} - - - - - {#if domain.status === 'created'} - - - - - openRetry(domain)}> - Retry - - - {:else} - - - - {/if} - - - {#if domain.status === 'unverified'} - - - - - openRetry(domain)}> - Retry - - - {:else if domain.status === 'verified'} - - - - - {#if domain.renewAt} - - Auto-renewal: {toLocaleDate(domain.renewAt)} - - {/if} - - {:else} - - - - {/if} - - - - - - {#if domain.status !== 'verified'} - openRetry(domain)}> - {domain.status === 'unverified' - ? 'Retry generation' - : 'Retry verification'} - - {/if} - { - selectedDomain = domain; - showDelete = true; - }}> - Delete - - - - - - {/each} - -{:else} - -{/if} - - - - (retryError = e.detail)} /> - - - - diff --git a/src/lib/pages/domains/index.ts b/src/lib/pages/domains/index.ts deleted file mode 100644 index 1ae888ef8b..0000000000 --- a/src/lib/pages/domains/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ProxyRulesPage } from './index.svelte'; -export { default as Retry } from './wizard/retry.svelte'; diff --git a/src/lib/pages/domains/wizard/cnameTable.svelte b/src/lib/pages/domains/wizard/cnameTable.svelte deleted file mode 100644 index 72bf72543d..0000000000 --- a/src/lib/pages/domains/wizard/cnameTable.svelte +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Type - Name - Value - - - - CNAME - {cnameValue} - - {target} - - - - - - diff --git a/src/lib/pages/domains/wizard/retry.svelte b/src/lib/pages/domains/wizard/retry.svelte deleted file mode 100644 index b5461ecf6a..0000000000 --- a/src/lib/pages/domains/wizard/retry.svelte +++ /dev/null @@ -1,92 +0,0 @@ - - -{#if domain.status === 'created'} - - - {#if showTitle} - {domain.domain} - {/if} - - - Verification failed - - - - - In order to continue, set the following record on your DNS provider. DNS records may take up - to 48 hours to propagate. Please retry over the next 48 hours, but if verification still - fails, please contact support. - - -{:else if domain.status === 'unverified'} -
- -

Generation failed

- -
- - In order to continue, set the following record on your DNS provider. DNS records may take up - to 48 hours to propagate. Please retry over the next 48 hours, but if verification still - fails, please contact support. - - {#if domain?.logs} - - {/if} -{/if} diff --git a/src/lib/pages/domains/wizard/step1.svelte b/src/lib/pages/domains/wizard/step1.svelte deleted file mode 100644 index 3f4e01f747..0000000000 --- a/src/lib/pages/domains/wizard/step1.svelte +++ /dev/null @@ -1,83 +0,0 @@ - - - - Domain - - Use your self-owned domain as the endpoint of your Appwrite API. Learn more. - - - - - {#if error} -
-

- You can find a list of domain providers and their DNS setting documentation here. If your domain provider isn't listed, please contact us, and we'll include their - settings as well. -

-
- {/if} - {#if isSelfHosted && !isDomainsEnabled} - - To add a domain to a locally hosted Appwrite project, you must first configure your - server domain. - - - - - {/if} -
diff --git a/src/lib/pages/domains/wizard/step2.svelte b/src/lib/pages/domains/wizard/step2.svelte deleted file mode 100644 index 2d1b20fcce..0000000000 --- a/src/lib/pages/domains/wizard/step2.svelte +++ /dev/null @@ -1,54 +0,0 @@ - - - - {$domain.domain} - -
- {#if $domain.status === 'created'} - - {:else} -
- -

Domain verified

-
- {/if} - -
- {#if $domain.status === 'verifying'} -
-
-

Generating certificate

- {:else if $domain.status === 'verified'} - -

Certificate generated

- {:else} - -

- Certificate generation will begin after domain verification -

- {/if} -
-
-
-
diff --git a/src/lib/pages/domains/wizard/store.ts b/src/lib/pages/domains/wizard/store.ts deleted file mode 100644 index 96e3caff2b..0000000000 --- a/src/lib/pages/domains/wizard/store.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Models } from '@appwrite.io/console'; -import { writable } from 'svelte/store'; -import type { Dependencies } from '$lib/constants'; - -export const domain = writable>({ $id: '', domain: '' }); -export const dependencyStore = writable(); diff --git a/src/lib/sdk/domains.ts b/src/lib/sdk/domains.ts deleted file mode 100644 index 8890934385..0000000000 --- a/src/lib/sdk/domains.ts +++ /dev/null @@ -1,1981 +0,0 @@ -import { AppwriteException, Client, type Payload } from '@appwrite.io/console'; - -/** - * Domain - */ -export type Domain = { - /** - * Domain ID. - */ - $id: string; - /** - * Domain creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Domain update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Domain name. - */ - domain: string; - /** - * Domain registrar (e.g. "appwrite" or "third_party"). - */ - registrar: string; - /** - * Nameservers setting. "Appwrite" or empty string. - */ - nameservers: string; - /** - * Domain expiry date in ISO 8601 format. - */ - expiry: string; - /** - * Domain renewal date in ISO 8601 format. - */ - renewal: string; - /** - * If set to true, the domain will automatically renew. - */ - autoRenewal: boolean; - /** - * Renewal price (in USD). - */ - renewalPrice: number; - /** - * Team ID. - */ - teamId: string; -}; -/** - * DNSRecord - */ -export type DnsRecord = { - /** - * DNS Record ID. - */ - $id: string; - /** - * DNS Record creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * DNS Record update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * DNS record type (e.g. A, CNAME, MX). - */ - type: string; - /** - * Record name or subdomain. - */ - name: string; - /** - * Value of the record (IP address, domain, etc.). - */ - value: string; - /** - * Time to live (in seconds). - */ - ttl: number; - /** - * Record priority (commonly used for MX). - */ - priority: number; - /** - * Whether this record is locked (read-only). - */ - lock: boolean; - /** - * Record weight (used for SRV records). - */ - weight: number; - /** - * Target port (used for SRV records). - */ - port: number; - /** - * Comment for the DNS record. - */ - comment: string; -}; - -export type DomainsList = { - /** - * Total number of domains documents that matched your query. - */ - total: number; - /** - * List of domains. - */ - domains: Domain[]; -}; -/** - * DNS records list - */ -export type DnsRecordsList = { - /** - * Total number of dnsRecords documents that matched your query. - */ - total: number; - /** - * List of dnsRecords. - */ - dnsRecords: DnsRecord[]; -}; - -export class Domains { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * List domains - * - * - * @param {string[]} queries - * @param {string} search - * @throws {AppwriteException} - * @returns {Promise} - */ - async list(queries?: string[], search?: string): Promise { - const apiPath = '/domains'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create a new domain. - * - * - * @param {string} teamId - * @param {string} domain - * @throws {AppwriteException} - * @returns {Promise} - */ - async create(teamId: string, domain: string): Promise { - if (typeof teamId === 'undefined') { - throw new AppwriteException('Missing required parameter: "teamId"'); - } - if (typeof domain === 'undefined') { - throw new AppwriteException('Missing required parameter: "domain"'); - } - const apiPath = '/domains'; - const payload: Payload = {}; - if (typeof teamId !== 'undefined') { - payload['teamId'] = teamId; - } - if (typeof domain !== 'undefined') { - payload['domain'] = domain; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get a single domain by its unique ID. - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async get(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Delete a domain by its unique ID. - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - async delete(domainId: string): Promise<{}> { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('delete', uri, apiHeaders, payload); - } - /** - * Verify which NS records are used and update the domain accordingly. - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateNameservers(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/nameservers'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('patch', uri, apiHeaders, payload); - } - /** - * Get Google Workspace preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetGoogleWorkspace(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/google-workspace'.replace( - '{domainId}', - domainId - ); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create Google Workspace preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetGoogleWorkspace(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/google-workspace'.replace( - '{domainId}', - domainId - ); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get iCloud preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetICloud(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/icloud'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create iCloud preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetICloud(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/icloud'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get Mailgun preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetMailgun(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/mailgun'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create Mailgun preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetMailgun(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/mailgun'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get Outlook preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetOutlook(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/outlook'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create Outlook preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetOutlook(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/outlook'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get ProtonMail preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetProtonMail(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/proton-mail'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create ProtonMail preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetProtonMail(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/proton-mail'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Get Zoho preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getPresetZoho(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/zoho'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create Zoho Mail preset (Records) - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createPresetZoho(domainId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/presets/zoho'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * List DNS records for a given domain. - * - * - * @param {string} domainId - * @param {string[]} queries - * @param {string} search - * @throws {AppwriteException} - * @returns {Promise} - */ - async listRecords( - domainId: string, - queries?: string[], - search?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/records'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Create a new A record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordA( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/a'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing A record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordA( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/a/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new AAAA record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordAAAA( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/aaaa'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing AAAA record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordAAAA( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/aaaa/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new ALIAS record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordAlias( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/alias'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing ALIAS record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordAlias( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/alias/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new CAA record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordCAA( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/caa'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing CAA record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordCAA( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/caa/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new CNAME record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordCNAME( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/cname'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing CNAME record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordCNAME( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/cname/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new HTTPS record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordHTTPS( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/https'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing HTTPS record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordHTTPS( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/https/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new MX record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {number} priority - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordMX( - domainId: string, - name: string, - value: string, - ttl: number, - priority: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - if (typeof priority === 'undefined') { - throw new AppwriteException('Missing required parameter: "priority"'); - } - const apiPath = '/domains/{domainId}/records/mx'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof priority !== 'undefined') { - payload['priority'] = priority; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing MX record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {number} priority - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordMX( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - priority: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - if (typeof priority === 'undefined') { - throw new AppwriteException('Missing required parameter: "priority"'); - } - const apiPath = '/domains/{domainId}/records/mx/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof priority !== 'undefined') { - payload['priority'] = priority; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new NS record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordNS( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/ns'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing NS record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordNS( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/ns/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new SRV record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {number} priority - * @param {number} weight - * @param {number} port - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordSRV( - domainId: string, - name: string, - value: string, - ttl: number, - priority: number, - weight: number, - port: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - if (typeof priority === 'undefined') { - throw new AppwriteException('Missing required parameter: "priority"'); - } - if (typeof weight === 'undefined') { - throw new AppwriteException('Missing required parameter: "weight"'); - } - if (typeof port === 'undefined') { - throw new AppwriteException('Missing required parameter: "port"'); - } - const apiPath = '/domains/{domainId}/records/srv'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof priority !== 'undefined') { - payload['priority'] = priority; - } - if (typeof weight !== 'undefined') { - payload['weight'] = weight; - } - if (typeof port !== 'undefined') { - payload['port'] = port; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing SRV record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {number} priority - * @param {number} weight - * @param {number} port - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordSRV( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - priority: number, - weight: number, - port: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - if (typeof priority === 'undefined') { - throw new AppwriteException('Missing required parameter: "priority"'); - } - if (typeof weight === 'undefined') { - throw new AppwriteException('Missing required parameter: "weight"'); - } - if (typeof port === 'undefined') { - throw new AppwriteException('Missing required parameter: "port"'); - } - const apiPath = '/domains/{domainId}/records/srv/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof priority !== 'undefined') { - payload['priority'] = priority; - } - if (typeof weight !== 'undefined') { - payload['weight'] = weight; - } - if (typeof port !== 'undefined') { - payload['port'] = port; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Create a new TXT record for the given domain. - * - * - * @param {string} domainId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async createRecordTXT( - domainId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/txt'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('post', uri, apiHeaders, payload); - } - /** - * Update an existing TXT record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @param {string} name - * @param {string} value - * @param {number} ttl - * @param {string} comment - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateRecordTXT( - domainId: string, - recordId: string, - name: string, - value: string, - ttl: number, - comment?: string - ): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof value === 'undefined') { - throw new AppwriteException('Missing required parameter: "value"'); - } - if (typeof ttl === 'undefined') { - throw new AppwriteException('Missing required parameter: "ttl"'); - } - const apiPath = '/domains/{domainId}/records/txt/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - if (typeof comment !== 'undefined') { - payload['comment'] = comment; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } - /** - * Get a single DNS record for a given domain by record ID. - * - * - * @param {string} domainId - * @param {string} recordId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getRecord(domainId: string, recordId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - const apiPath = '/domains/{domainId}/records/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Delete a DNS record for the given domain. - * - * - * @param {string} domainId - * @param {string} recordId - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - async deleteRecord(domainId: string, recordId: string): Promise<{}> { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof recordId === 'undefined') { - throw new AppwriteException('Missing required parameter: "recordId"'); - } - const apiPath = '/domains/{domainId}/records/{recordId}' - .replace('{domainId}', domainId) - .replace('{recordId}', recordId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('delete', uri, apiHeaders, payload); - } - /** - * Update domain team. - * - * - * @param {string} domainId - * @param {string} teamId - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateTeam(domainId: string, teamId: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof teamId === 'undefined') { - throw new AppwriteException('Missing required parameter: "teamId"'); - } - const apiPath = '/domains/{domainId}/team'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof teamId !== 'undefined') { - payload['teamId'] = teamId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('patch', uri, apiHeaders, payload); - } - /** - * Retrieve the DNS zone file for the given domain. - * - * - * @param {string} domainId - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - async getZone(domainId: string): Promise<{}> { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - const apiPath = '/domains/{domainId}/zone'.replace('{domainId}', domainId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('get', uri, apiHeaders, payload); - } - /** - * Update the DNS zone for the given domain using the provided zone file content. All parsed records are imported and then the main domain document is returned. - * - * - * @param {string} domainId - * @param {string} content - * @throws {AppwriteException} - * @returns {Promise} - */ - async updateZone(domainId: string, content: string): Promise { - if (typeof domainId === 'undefined') { - throw new AppwriteException('Missing required parameter: "domainId"'); - } - if (typeof content === 'undefined') { - throw new AppwriteException('Missing required parameter: "content"'); - } - const apiPath = '/domains/{domainId}/zone'.replace('{domainId}', domainId); - const payload: Payload = {}; - if (typeof content !== 'undefined') { - payload['content'] = content; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json' - }; - - payload['project'] = this.client.config.project; - - return await this.client.call('put', uri, apiHeaders, payload); - } -} diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index 00acfef722..a5e1e7fa21 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -20,11 +20,11 @@ import { Users, Vcs, Sites, - Tokens + Tokens, + Domains } from '@appwrite.io/console'; import { Billing } from '../sdk/billing'; import { Backups } from '../sdk/backups'; -import { Domains } from '$lib/sdk/domains'; import { Sources } from '$lib/sdk/sources'; import { REGION_FRA, diff --git a/src/routes/(console)/organization-[organization]/domains/+page.svelte b/src/routes/(console)/organization-[organization]/domains/+page.svelte index 621126cee8..e970be7f60 100644 --- a/src/routes/(console)/organization-[organization]/domains/+page.svelte +++ b/src/routes/(console)/organization-[organization]/domains/+page.svelte @@ -29,18 +29,18 @@ import { queries } from '$lib/components/filters'; import SearchQuery from '$lib/components/searchQuery.svelte'; import { app } from '$lib/stores/app'; - import type { Domain } from '$lib/sdk/domains'; import { Click, trackEvent } from '$lib/actions/analytics'; import { columns } from './store'; import { View } from '$lib/helpers/load'; + import type { Models } from '@appwrite.io/console'; export let data; let showDelete = false; let showRetry = false; - let selectedDomain: Domain = null; + let selectedDomain: Models.Domain = null; - const isDomainVerified = (domain: Domain) => { + const isDomainVerified = (domain: Models.Domain) => { return domain.nameservers.toLocaleLowerCase() === 'appwrite'; }; @@ -103,7 +103,7 @@ {:else if column.id === 'nameservers'} {domain.nameservers || '-'} {:else if column.id === 'expiry_date'} - {domain?.expiry ? toLocaleDateTime(domain.expiry) : '-'} + {domain?.expire ? toLocaleDateTime(domain.expire) : '-'} {:else if column.id === 'renewal'} {domain?.renewal ? toLocaleDateTime(domain.renewal) : '-'} {:else if column.id === 'auto_renewal'} diff --git a/src/routes/(console)/organization-[organization]/domains/add-domain/+page.svelte b/src/routes/(console)/organization-[organization]/domains/add-domain/+page.svelte index f03fb30d69..9e0903a611 100644 --- a/src/routes/(console)/organization-[organization]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/organization-[organization]/domains/add-domain/+page.svelte @@ -10,12 +10,12 @@ import RecordsCard from '../recordsCard.svelte'; import { afterNavigate, invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; - import type { Domain } from '$lib/sdk/domains'; + import type { Models } from '@appwrite.io/console'; let backPage = `${base}/organization-${page.params.organization}/domains`; let domainName = ''; - let domain: Domain; + let domain: Models.Domain; async function addDomain() { try { diff --git a/src/routes/(console)/organization-[organization]/domains/deleteDomainModal.svelte b/src/routes/(console)/organization-[organization]/domains/deleteDomainModal.svelte index b30ec8bf18..53a0794f78 100644 --- a/src/routes/(console)/organization-[organization]/domains/deleteDomainModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/deleteDomainModal.svelte @@ -5,12 +5,12 @@ import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { Dependencies } from '$lib/constants'; import { Confirm } from '$lib/components'; - import type { Domain } from '$lib/sdk/domains'; import { base } from '$app/paths'; import { page } from '$app/state'; + import type { Models } from '@appwrite.io/console'; export let show = false; - export let selectedDomain: Domain; + export let selectedDomain: Models.Domain; let error = ''; let domainsList = `${base}/organization-${page.params.organization}/domains`; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte index 566c919b9a..3b2e535223 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/addPresetModal.svelte @@ -7,15 +7,15 @@ import { capitalize } from '$lib/helpers/string'; import { sdk } from '$lib/stores/sdk'; import { page } from '$app/state'; - import type { DnsRecordsList } from '$lib/sdk/domains'; import { presets } from './store'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { createRecord } from '$lib/helpers/domains'; + import type { Models } from '@appwrite.io/console'; export let show = false; export let selectedPreset: (typeof presets)[number]; - let records: DnsRecordsList; + let records: Models.DnsRecordsList; let error = ''; async function fetchPreset() { switch (selectedPreset.toLowerCase()) { diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/deleteRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/deleteRecordModal.svelte index e2ab20c382..01b4577f52 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/deleteRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/deleteRecordModal.svelte @@ -6,10 +6,10 @@ import { Dependencies } from '$lib/constants'; import { Confirm } from '$lib/components'; import { page } from '$app/state'; - import type { DnsRecord } from '$lib/sdk/domains'; + import type { Models } from '@appwrite.io/console'; export let show = false; - export let selectedRecord: DnsRecord; + export let selectedRecord: Models.DnsRecord; let error = ''; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte index fbde9ac6b8..7d4a152a58 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/domainMetrics.svelte @@ -1,11 +1,12 @@ diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts index 85493f0720..b3a5d2b2cf 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts @@ -1,9 +1,9 @@ import { page } from '$app/stores'; import type { Column } from '$lib/helpers/types'; -import type { Domain } from '$lib/sdk/domains'; +import type { Models } from '@appwrite.io/console'; import { derived, writable } from 'svelte/store'; -export const domain = derived(page, ($page) => $page.data.domain as Domain); +export const domain = derived(page, ($page) => $page.data.domain as Models.Domain); export const columns = writable([ { id: 'name', title: 'Name', type: 'string', width: { min: 150 } }, { id: 'type', title: 'Type', type: 'string', width: 125 }, diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index 47c023ec7c..ab30b24b39 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -20,15 +20,15 @@ import { columns } from './store'; import DeleteRecordModal from './deleteRecordModal.svelte'; import EditRecordModal from './updateRecordModal.svelte'; - import type { DnsRecord } from '$lib/sdk/domains'; import DualTimeView from '$lib/components/dualTimeView.svelte'; import type { PageData } from './$types'; + import type { Models } from '@appwrite.io/console'; export let data: PageData; let showEdit = false; let showDelete = false; - let selectedRecord: DnsRecord = null; + let selectedRecord: Models.DnsRecord = null; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index a559d79be7..9155339ca8 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -13,15 +13,15 @@ import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; import { symmetricDifference } from '$lib/helpers/array'; import { deepClone } from '$lib/helpers/object'; - import type { DnsRecord } from '$lib/sdk/domains'; import { sdk } from '$lib/stores/sdk'; import { page } from '$app/state'; import { recordTypes } from './store'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; + import type { Models } from '@appwrite.io/console'; export let show = false; - export let selectedRecord: DnsRecord; + export let selectedRecord: Models.DnsRecord; let record = deepClone(selectedRecord); let error = ''; diff --git a/src/routes/(console)/organization-[organization]/domains/recordsCard.svelte b/src/routes/(console)/organization-[organization]/domains/recordsCard.svelte index 68d02d3fb7..0b6f45a311 100644 --- a/src/routes/(console)/organization-[organization]/domains/recordsCard.svelte +++ b/src/routes/(console)/organization-[organization]/domains/recordsCard.svelte @@ -1,7 +1,6 @@