diff --git a/src/lib/sdk/domains.ts b/src/lib/sdk/domains.ts new file mode 100644 index 000000000..889093438 --- /dev/null +++ b/src/lib/sdk/domains.ts @@ -0,0 +1,1981 @@ +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 6aaef310d..c545e0683 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -24,6 +24,7 @@ import { } 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'; export function getApiEndpoint(): string { @@ -83,7 +84,8 @@ export const sdk = { console: new Console(clientConsole), assistant: new Assistant(clientConsole), billing: new Billing(clientConsole), - sources: new Sources(clientConsole) + sources: new Sources(clientConsole), + domains: new Domains(clientConsole) }, get forProject() { const projectId = getProjectId(); diff --git a/src/routes/(console)/project-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte b/src/routes/(console)/project-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte index 35fe55c34..dac1e48b7 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte @@ -15,12 +15,13 @@ import Details from '../../details.svelte'; import ProductionBranch from '../../productionBranch.svelte'; import Aside from '../../aside.svelte'; - import { BuildRuntime, ConsoleResourceType, Framework, ID, Type } from '@appwrite.io/console'; + import { BuildRuntime, Framework, ID, Type } from '@appwrite.io/console'; import type { Models } from '@appwrite.io/console'; import { onMount } from 'svelte'; import Configuration from '../../configuration.svelte'; - import Domain from '../../domain.svelte'; + // import Domain from '../../domain.svelte'; import { consoleVariables } from '$routes/(console)/store'; + import { buildVerboseDomain } from '../../store'; export let data; let showExitModal = false; @@ -40,44 +41,16 @@ let variables: Partial[] = []; let silentMode = false; let domain = id; - let domainIsValid = true; + // let domainIsValid = true; onMount(async () => { installation.set(data.installation); repository.set(data.repository); name = data.repository.name; - // Format repository name by removing spaces and slashes - const formattedRepoName = data.repository.name.replace(/[\s\/]/g, '-'); - const formattedOrgName = data.repository.organization.replace(/[\s\/]/g, '-'); - - domain = formattedRepoName; - const isFirstDomainAvailable = !(await checkDomain(domain)); - - // If first option is not available, try repo-org - if (!isFirstDomainAvailable) { - domain = `${formattedRepoName}-${formattedOrgName}`; - const isSecondDomainAvailable = !(await checkDomain(domain)); - - // If second option is not available, use repo-org-uniqueID - if (!isSecondDomainAvailable) { - domain = `${formattedRepoName}-${formattedOrgName}-${ID.unique()}`; - } - } + // domain = await buildVerboseDomain(data.repository.name, data.repository.organization, id); }); - async function checkDomain(domain: string) { - try { - await sdk.forConsole.console.getResource( - `${domain}.${$consoleVariables._APP_DOMAIN_SITES}`, - ConsoleResourceType.Rules - ); - return true; - } catch { - return false; - } - } - async function loadBranches() { const { branches } = await sdk.forProject.vcs.listRepositoryBranches( data.installation.$id, @@ -94,76 +67,81 @@ } async function create() { - if (!domainIsValid) { + // if (!domainIsValid) { + // addNotification({ + // type: 'error', + // message: 'Please enter a valid domain' + // }); + // return; + // } else {} + + try { + domain = await buildVerboseDomain( + data.repository.name, + data.repository.organization, + id + ); + const fr = Object.values(Framework).find((f) => f === framework.key); + const buildRuntime = Object.values(BuildRuntime).find( + (f) => f === framework.buildRuntime + ); + let site = await sdk.forProject.sites.create( + id || ID.unique(), + name, + fr, + buildRuntime, + undefined, + undefined, + installCommand, + buildCommand, + outputDirectory, + framework.adapters[Object.keys(framework.adapters)[0]].key, //TODO: fix this + data.installation.$id, + null, + data.repository.id, + branch, + silentMode, + rootDir + ); + + // Add domain + await sdk.forProject.proxy.createSiteRule( + `${domain}.${$consoleVariables._APP_DOMAIN_SITES}`, + site.$id + ); + + //Add variables + const promises = variables.map((variable) => + sdk.forProject.sites.createVariable( + site.$id, + variable.key, + variable.value, + variable?.secret ?? false + ) + ); + await Promise.all(promises); + + const deployment = await sdk.forProject.sites.createVcsDeployment( + site.$id, + Type.Branch, + branch, + true + ); + + trackEvent(Submit.SiteCreate, { + source: 'repository', + framework: framework.key + }); + + await goto( + `${base}/project-${$page.params.project}/sites/create-site/deploying?site=${site.$id}&deployment=${deployment.$id}` + ); + } catch (e) { addNotification({ type: 'error', - message: 'Please enter a valid domain' + message: e.message }); - return; - } else { - try { - const fr = Object.values(Framework).find((f) => f === framework.key); - const buildRuntime = Object.values(BuildRuntime).find( - (f) => f === framework.buildRuntime - ); - let site = await sdk.forProject.sites.create( - id || ID.unique(), - name, - fr, - buildRuntime, - undefined, - undefined, - installCommand, - buildCommand, - outputDirectory, - framework.adapters[Object.keys(framework.adapters)[0]].key, //TODO: fix this - data.installation.$id, - null, - data.repository.id, - branch, - silentMode, - rootDir - ); - - // Add domain - await sdk.forProject.proxy.createSiteRule( - `${domain}.${$consoleVariables._APP_DOMAIN_SITES}`, - site.$id - ); - - //Add variables - const promises = variables.map((variable) => - sdk.forProject.sites.createVariable( - site.$id, - variable.key, - variable.value, - variable?.secret ?? false - ) - ); - await Promise.all(promises); - - const deployment = await sdk.forProject.sites.createVcsDeployment( - site.$id, - Type.Branch, - branch, - true - ); - - trackEvent(Submit.SiteCreate, { - source: 'repository', - framework: framework.key - }); - - await goto( - `${base}/project-${$page.params.project}/sites/create-site/deploying?site=${site.$id}&deployment=${deployment.$id}` - ); - } catch (e) { - addNotification({ - type: 'error', - message: e.message - }); - trackError(e, Submit.SiteCreate); - } + trackError(e, Submit.SiteCreate); } } @@ -227,7 +205,7 @@ bind:variables frameworks={data.frameworks.frameworks} /> - + diff --git a/src/routes/(console)/project-[project]/sites/create-site/store.ts b/src/routes/(console)/project-[project]/sites/create-site/store.ts new file mode 100644 index 000000000..ed6cac36a --- /dev/null +++ b/src/routes/(console)/project-[project]/sites/create-site/store.ts @@ -0,0 +1,38 @@ +import { sdk } from '$lib/stores/sdk'; +import { consoleVariables } from '$routes/(console)/store'; +import { ConsoleResourceType, ID } from '@appwrite.io/console'; +import { get } from 'svelte/store'; + +function toURLSafe(s: string) { + return s.replace(/[^a-zA-Z0-9-]/g, '-'); +} + +export async function checkDomain(domain: string) { + try { + await sdk.forConsole.console.getResource( + `${domain}.${get(consoleVariables)._APP_DOMAIN_SITES}`, + ConsoleResourceType.Rules + ); + return true; + } catch { + return false; + } +} + +export async function buildVerboseDomain(name: string, specifier: string, unique?: string) { + const safeName = toURLSafe(name).toLowerCase(); + const safeSpecifier = toURLSafe(specifier).toLowerCase(); + const safeUnique = unique ? toURLSafe(unique).toLowerCase() : ID.unique(); + let domain = `${safeName}`; + if (await checkDomain(domain)) { + return domain; + } + domain = `${safeName}-${safeSpecifier}`; + if (await checkDomain(domain)) { + return domain; + } + domain = `${safeName}-${safeSpecifier}-${safeUnique}`; + if (await checkDomain(domain)) { + return domain; + } +} diff --git a/src/routes/(console)/project-[project]/sites/create-site/templates/template-[template]/+page.svelte b/src/routes/(console)/project-[project]/sites/create-site/templates/template-[template]/+page.svelte index bdd91363a..5e8c84ef3 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/templates/template-[template]/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/templates/template-[template]/+page.svelte @@ -27,11 +27,13 @@ import Configuration from './configuration.svelte'; import Aside from '../../aside.svelte'; import { Adapter, BuildRuntime, Framework, ID } from '@appwrite.io/console'; - import Domain from '../../domain.svelte'; + // import Domain from '../../domain.svelte'; import { NewRepository, Repositories, RepositoryBehaviour } from '$lib/components/git'; import { getFrameworkIcon } from '../../../store'; import { app, iconPath } from '$lib/stores/app'; import { consoleVariables } from '$routes/(console)/store'; + import { project } from '$routes/(console)/project-[project]/store'; + import { buildVerboseDomain } from '../../store'; export let data; @@ -45,7 +47,7 @@ let name = data.template.name; let id = ID.unique(); let domain = id; - let domainIsValid = true; + // let domainIsValid = true; let framework = data?.template?.frameworks[0]; let branch = 'main'; let rootDir = './'; @@ -59,7 +61,7 @@ let variables = []; let silentMode = false; - onMount(() => { + onMount(async () => { if (!$installation?.$id) { $installation = data.installations.installations[0]; } @@ -111,14 +113,18 @@ message: 'Please select a repository' }); return; - } else if (!domainIsValid) { - addNotification({ - type: 'error', - message: 'Please enter a valid domain' - }); - return; - } else { + } + // else if (!domainIsValid) { + // addNotification({ + // type: 'error', + // message: 'Please enter a valid domain' + // }); + // return; + // } + else { try { + domain = await buildVerboseDomain(data.template.name, $project.name, id); + const fr = Object.values(Framework).find((f) => f === framework.key); const buildRuntime = Object.values(BuildRuntime).find( (f) => f === framework.buildRuntime @@ -242,7 +248,7 @@ {#if data.template.variables?.length} {/if} - + {:else} {@const options = data.template.frameworks.map((framework) => { @@ -324,7 +330,7 @@ {#if data.template.variables?.length} {/if} - + {/if} {/if} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte index 03993a46b..82620709c 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte @@ -4,7 +4,6 @@ import { EmptySearch, PaginationWithLimit } from '$lib/components/index.js'; import { Button } from '$lib/elements/forms'; import Link from '$lib/elements/link.svelte'; - import { toLocaleDateTime } from '$lib/helpers/date'; import Container from '$lib/layout/container.svelte'; import { protocol } from '$routes/(console)/store.js'; import type { Models } from '@appwrite.io/console'; @@ -17,7 +16,6 @@ } from '@appwrite.io/pink-icons-svelte'; import { ActionMenu, - Badge, Card, Empty, Icon, @@ -30,6 +28,7 @@ import { queries } from '$lib/components/filters'; import SearchQuery from '$lib/components/searchQuery.svelte'; import { app } from '$lib/stores/app'; + import { RuleType } from '$lib/stores/sdk'; export let data; @@ -38,12 +37,6 @@ let selectedDomain: Models.ProxyRule = null; $: console.log(data.domains); - - // TODO: replace status once backend is fixed - // created - Verification Failed - // verified - Verification OK , Certificate OK - // verifying - Verifiacitok OK - // unverified - Verificaiton OK , Certificate Failed @@ -60,38 +53,32 @@ Domain - Updated + Redirect to + Production branch {#each data.domains.rules as domain} - + - - - - {domain.domain} - - - - {#if domain.status === 'created'} - - {:else if domain.status === 'veryfing'} - - {/if} - + + + {domain.domain} + + + + + + {domain.type === RuleType.REDIRECT ? (domain?.value ?? '-') : 'No redirect'} + + + {domain.automation.includes('branch') + ? domain.automation.split('branch=')[1] + : '-'} - {toLocaleDateTime(domain.$updatedAt)} @@ -135,7 +122,7 @@ - + {/each} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.ts b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.ts index a5706b1a9..dc6f0cff0 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.ts +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.ts @@ -23,7 +23,7 @@ export const load = async ({ params, depends, url, route }) => { search, domains: await sdk.forProject.proxy.listRules( [ - Query.equal('type', RuleType.DEPLOYMENT), + Query.equal('type', [RuleType.DEPLOYMENT, RuleType.REDIRECT]), Query.equal('automation', `site=${params.site}`), Query.limit(limit), Query.offset(offset), diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.svelte index 036ecfb06..9284ee0cd 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.svelte @@ -2,8 +2,7 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import Card from '$lib/components/card.svelte'; - import { Button, Form } from '$lib/elements/forms'; - import { InputDomain } from '$lib/elements/forms/index.js'; + import { Button, Form, InputSelect } from '$lib/elements/forms'; import { Wizard } from '$lib/layout'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; @@ -14,27 +13,90 @@ Fieldset, Layout, Typography, - Spinner + Spinner, + Input } from '@appwrite.io/pink-svelte'; import RecordsCard from '../recordsCard.svelte'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; + import { sortBranches } from '$lib/stores/vcs'; + import { organization } from '$lib/stores/organization'; + import { consoleVariables } from '$routes/(console)/store'; + import InputDomain from '$lib/elements/forms/inputDomain.svelte'; const backPage = `${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains`; + export let data; let domain = ''; let domainData: Models.ProxyRule; + let redirect = null; + let statusCode = null; + + let branch = null; + + const domainsOptions = data.domains.rules.map((domain) => ({ + label: domain.domain, + value: domain.domain + })); + + const statusCodeOptions = [ + { + label: '301 Moved permanently', + value: 301 + }, + { + label: '302 Found', + value: 302 + }, + { + label: '303 See other', + value: 303 + }, + { + label: '307 Temporary redirect', + value: 307 + }, + { + label: '308 Permanent redirect', + value: 308 + } + ]; + async function addDomain() { - try { - domainData = await sdk.forProject.proxy.createSiteRule(domain, $page.params.site); - console.log(domainData); - invalidate(Dependencies.SITES_DOMAINS); - } catch (error) { - addNotification({ - type: 'error', - message: error.message - }); + const isNewDomain = data.domains.rules.findIndex((rule) => rule.domain === domain) === -1; + const isSubDomain = domain.endsWith(`.${$consoleVariables._APP_DOMAIN_SITES}`); + if (redirect) { + try { + if (isNewDomain && !isSubDomain) { + await sdk.forConsole.domains.create($organization.$id, domain); + } + domainData = await sdk.forProject.proxy.createRedirectRule(domain, redirect); + invalidate(Dependencies.SITES_DOMAINS); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } + } else { + try { + if (isNewDomain && !isSubDomain) { + await sdk.forConsole.domains.create($organization.$id, domain); + } + domainData = await sdk.forProject.proxy.createSiteRule( + domain, + $page.params.site, + branch + ); + console.log(domainData); + invalidate(Dependencies.SITES_DOMAINS); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } } } @@ -61,6 +123,8 @@ }); } } + + $: console.log($consoleVariables); @@ -98,13 +162,55 @@
- --> + + + {#if redirect} + + {/if} + + {#if data.branches.total} + {@const sortedBranches = sortBranches(data.branches.branches)} + {@const options = sortedBranches.map((branch) => ({ + label: branch.name, + value: branch.name + }))} + + {/if} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.ts b/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.ts new file mode 100644 index 000000000..f1a438415 --- /dev/null +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/add-domain/+page.ts @@ -0,0 +1,18 @@ +import { Query } from '@appwrite.io/console'; +import { sdk } from '$lib/stores/sdk'; +import { RuleType } from '$lib/stores/sdk'; + +export const load = async ({ parent }) => { + const { site } = await parent(); + + return { + domains: await sdk.forProject.proxy.listRules([Query.equal('type', RuleType.DEPLOYMENT)]), + branches: + site?.installationId && site?.providerRepositoryId + ? await sdk.forProject.vcs.listRepositoryBranches( + site.installationId, + site.providerRepositoryId + ) + : undefined + }; +}; diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+layout.ts b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+layout.ts deleted file mode 100644 index a4c4adb92..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+layout.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Breadcrumbs from './breadcrumbs.svelte'; -import Header from './header.svelte'; -import { Dependencies } from '$lib/constants'; - -export const load = async ({ depends }) => { - depends(Dependencies.SITE); - return { - header: Header, - breadcrumbs: Breadcrumbs - }; -}; diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.svelte deleted file mode 100644 index 8c69d5683..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - - - Settings - - - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.ts b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.ts deleted file mode 100644 index 3d53850a0..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/+page.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { sdk } from '$lib/stores/sdk'; -import { Dependencies } from '$lib/constants'; - -export const load = async ({ params, depends }) => { - depends(Dependencies.SITES_DOMAINS); - - return { - domain: await sdk.forProject.proxy.getRule(params.domain) - }; -}; diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/SSLCertificates.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/SSLCertificates.svelte deleted file mode 100644 index 3095b04b7..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/SSLCertificates.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - - SSL certificates - SSL certificates secure your site with HTTPS, protecting data and boosting trust. Appwrite renews - your SSL certificates automatically. - - - - Domain - Expiration date - Renewal - Created - - - {#each domain.logs as log} - - {JSON.stringify(domain)} - - {/each} - - - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/breadcrumbs.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/breadcrumbs.svelte deleted file mode 100644 index 004dc9cef..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/breadcrumbs.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/deleteDomain.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/deleteDomain.svelte deleted file mode 100644 index 27ec9d275..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/deleteDomain.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - - Delete domain - Deleting this domain will remove the domain from all associated projects. - - - -
{domain.domain}
-
-

Last updated: {toLocaleDateTime(domain.$updatedAt)}

-
-
- - - - -
- - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/domainDetails.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/domainDetails.svelte deleted file mode 100644 index 02ea0efc7..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/domainDetails.svelte +++ /dev/null @@ -1,58 +0,0 @@ - - - - SSL certificates - SSL certificates secure your site with HTTPS, protecting data and boosting trust. Appwrite renews - your SSL certificates automatically. - - - - - - Domain - - - - - {domain.domain} - - - - - - - - Registrar - - MISSING BACKEND DATA - - - - - - Expiry date - - - {toLocaleDate(domain.renewAt)} - - - - Activity - - {toLocaleDate(domain.$updatedAt)} - - - - - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/header.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/header.svelte deleted file mode 100644 index 1df1c20cc..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/header.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - {$domain.domain} - - {$domain.$id} - - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/store.ts b/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/store.ts deleted file mode 100644 index 0d63bad20..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/domain-[domain]/store.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { page } from '$app/stores'; -import type { Models } from '@appwrite.io/console'; -import { derived } from 'svelte/store'; - -export const domain = derived(page, ($page) => $page.data.domain as Models.ProxyRule); diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/logs/delete.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/logs/delete.svelte deleted file mode 100644 index 7108353bd..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/logs/delete.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - -

Are you sure you want to delete this execution?

- - - - -