From 5079b8701e4816e556b4c61e8f422677119b4a23 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Feb 2024 20:33:59 +1300 Subject: [PATCH] Release candidate for 1.5.x --- README.md | 2 +- docs/examples/account/update-phone-session.md | 14 ++++ docs/examples/messaging/create-email.md | 4 +- docs/examples/messaging/create-push.md | 4 +- docs/examples/messaging/create-sms.md | 4 +- docs/examples/messaging/update-email.md | 4 +- docs/examples/messaging/update-push.md | 4 +- docs/examples/messaging/update-sms.md | 4 +- docs/examples/users/delete-authenticator.md | 3 +- package.json | 2 +- src/client.ts | 2 +- src/enums/index-type.ts | 1 - src/enums/message-status.ts | 5 -- src/index.ts | 1 - src/services/account.ts | 59 +++++++++++-- src/services/databases.ts | 23 +++++- src/services/health.ts | 2 + src/services/messaging.ts | 82 ++++++++++--------- src/services/project.ts | 2 +- src/services/storage.ts | 4 +- src/services/users.ts | 21 +++-- 21 files changed, 161 insertions(+), 86 deletions(-) create mode 100644 docs/examples/account/update-phone-session.md delete mode 100644 src/enums/message-status.ts diff --git a/README.md b/README.md index bdebf1b..e67dc73 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md new file mode 100644 index 0000000..c08b992 --- /dev/null +++ b/docs/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index af79ef6..7d1b118 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -16,7 +16,7 @@ const result = await messaging.createEmail( [], // cc (optional) [], // bcc (optional) [], // attachments (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) false, // html (optional) '' // scheduledAt (optional) ); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 8de70d9..dcb8654 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -21,7 +21,7 @@ const result = await messaging.createPush( '', // color (optional) '', // tag (optional) '', // badge (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 3eba217..91393f6 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -12,7 +12,7 @@ const result = await messaging.createSms( [], // topics (optional) [], // users (optional) [], // targets (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index be66d8d..443912f 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -13,7 +13,7 @@ const result = await messaging.updateEmail( [], // targets (optional) '', // subject (optional) '', // content (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) false, // html (optional) [], // cc (optional) [], // bcc (optional) diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 61668ad..e6ec29c 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -21,7 +21,7 @@ const result = await messaging.updatePush( '', // color (optional) '', // tag (optional) null, // badge (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index c4deb45..058ed8a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,4 +1,4 @@ -import { Client, Messaging, MessageStatus } from "@appwrite.io/console"; +import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -12,7 +12,7 @@ const result = await messaging.updateSms( [], // users (optional) [], // targets (optional) '', // content (optional) - MessageStatus.Draft, // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); diff --git a/docs/examples/users/delete-authenticator.md b/docs/examples/users/delete-authenticator.md index 276c05a..572b1c6 100644 --- a/docs/examples/users/delete-authenticator.md +++ b/docs/examples/users/delete-authenticator.md @@ -8,8 +8,7 @@ const users = new Users(client); const result = await users.deleteAuthenticator( '', // userId - AuthenticatorType.Totp, // type - '' // otp + AuthenticatorType.Totp // type ); console.log(response); diff --git a/package.json b/package.json index 77cd5f8..c5bc274 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.6.0-rc.13", + "version": "0.6.0-rc.14", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 098d4b8..62e684d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -104,7 +104,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.6.0-rc.13', + 'x-sdk-version': '0.6.0-rc.14', 'X-Appwrite-Response-Format': '1.5.0', }; diff --git a/src/enums/index-type.ts b/src/enums/index-type.ts index e5b5bba..3017b1a 100644 --- a/src/enums/index-type.ts +++ b/src/enums/index-type.ts @@ -2,5 +2,4 @@ export enum IndexType { Key = 'key', Fulltext = 'fulltext', Unique = 'unique', - Spatial = 'spatial', } \ No newline at end of file diff --git a/src/enums/message-status.ts b/src/enums/message-status.ts deleted file mode 100644 index eebd5a4..0000000 --- a/src/enums/message-status.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum MessageStatus { - Draft = 'draft', - Scheduled = 'scheduled', - Processing = 'processing', -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4877fdb..d5ec123 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,7 +36,6 @@ export { Runtime } from './enums/runtime'; export { FunctionUsageRange } from './enums/function-usage-range'; export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; -export { MessageStatus } from './enums/message-status'; export { SmtpEncryption } from './enums/smtp-encryption'; export { ProjectUsageRange } from './enums/project-usage-range'; export { Region } from './enums/region'; diff --git a/src/services/account.ts b/src/services/account.ts index 8144fa4..749e717 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -243,6 +243,7 @@ export class Account extends Service { /** * Update MFA * + * Enable or disable MFA on an account. * * @param {boolean} mfa * @throws {AppwriteException} @@ -295,6 +296,7 @@ export class Account extends Service { /** * Create MFA Challenge (confirmation) * + * Complete the MFA challenge by providing the one-time password. * * @param {string} challengeId * @param {string} otp @@ -330,6 +332,7 @@ export class Account extends Service { /** * List Factors * + * List the factors available on the account to be used as a MFA challange. * * @throws {AppwriteException} * @returns {Promise} @@ -347,6 +350,10 @@ export class Account extends Service { /** * Add Authenticator * + * Add an authenticator app to be used as an MFA factor. Verify the + * authenticator using the [verify + * authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator) + * method. * * @param {AuthenticatorType} type * @throws {AppwriteException} @@ -369,6 +376,9 @@ export class Account extends Service { /** * Verify Authenticator * + * Verify an authenticator app after adding it using the [add + * authenticator](/docs/references/cloud/client-web/account#addAuthenticator) + * method. * * @param {AuthenticatorType} type * @param {string} otp @@ -400,6 +410,7 @@ export class Account extends Service { /** * Delete Authenticator * + * Delete an authenticator for a user by ID. * * @param {AuthenticatorType} type * @param {string} otp @@ -777,7 +788,7 @@ export class Account extends Service { } /** - * Create session (deprecated) + * Update magic URL session * * Use this endpoint to create a session from token. Provide the **userId** * and **secret** parameters from the successful response of authentication @@ -875,6 +886,44 @@ export class Account extends Service { } } + /** + * Update phone session + * + * Use this endpoint to create a session from token. Provide the **userId** + * and **secret** parameters from the successful response of authentication + * flows initiated by token creation. For example, magic URL and phone login. + * + * @param {string} userId + * @param {string} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + async updatePhoneSession(userId: string, secret: string): Promise { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + if (typeof secret === 'undefined') { + throw new AppwriteException('Missing required parameter: "secret"'); + } + + const apiPath = '/account/sessions/phone'; + const payload: Payload = {}; + + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('put', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Create session * @@ -938,7 +987,7 @@ export class Account extends Service { } /** - * Update (or renew) a session + * Update (or renew) session * * Extend session's expiry to increase it's lifespan. Extending a session is * useful when session length is short such as 5 minutes. @@ -1009,7 +1058,7 @@ export class Account extends Service { } /** - * Create a push target + * Create push target * * * @param {string} targetId @@ -1049,7 +1098,7 @@ export class Account extends Service { } /** - * Update a push target + * Update push target * * * @param {string} targetId @@ -1080,7 +1129,7 @@ export class Account extends Service { } /** - * Delete a push target + * Delete push target * * * @param {string} targetId diff --git a/src/services/databases.ts b/src/services/databases.ts index 1817e18..01ddb78 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -86,7 +86,7 @@ export class Databases extends Service { } /** - * Get usage stats for the database + * Get databases usage stats * * * @param {DatabaseUsageRange} range @@ -398,6 +398,7 @@ export class Databases extends Service { /** * List attributes * + * List attributes in the collection. * * @param {string} databaseId * @param {string} collectionId @@ -487,6 +488,8 @@ export class Databases extends Service { /** * Update boolean attribute * + * Update a boolean attribute. Changing the `default` value will not update + * already existing documents. * * @param {string} databaseId * @param {string} collectionId @@ -537,6 +540,7 @@ export class Databases extends Service { /** * Create datetime attribute * + * Create a date time attribute according to the ISO 8601 standard. * * @param {string} databaseId * @param {string} collectionId @@ -592,6 +596,8 @@ export class Databases extends Service { /** * Update dateTime attribute * + * Update a date time attribute. Changing the `default` value will not update + * already existing documents. * * @param {string} databaseId * @param {string} collectionId @@ -752,6 +758,9 @@ export class Databases extends Service { /** * Create enum attribute * + * Create an enumeration attribute. The `elements` param acts as a white-list + * of accepted values for this attribute. + * * * @param {string} databaseId * @param {string} collectionId @@ -1568,6 +1577,7 @@ export class Databases extends Service { /** * Get attribute * + * Get attribute by ID. * * @param {string} databaseId * @param {string} collectionId @@ -1600,6 +1610,7 @@ export class Databases extends Service { /** * Delete attribute * + * Deletes an attribute. * * @param {string} databaseId * @param {string} collectionId @@ -1914,6 +1925,7 @@ export class Databases extends Service { /** * List indexes * + * List indexes in the collection. * * @param {string} databaseId * @param {string} collectionId @@ -1946,6 +1958,9 @@ export class Databases extends Service { /** * Create index * + * Creates an index on the attributes listed. Your index should include all + * the attributes you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. * * @param {string} databaseId * @param {string} collectionId @@ -2005,6 +2020,7 @@ export class Databases extends Service { /** * Get index * + * Get index by ID. * * @param {string} databaseId * @param {string} collectionId @@ -2037,6 +2053,7 @@ export class Databases extends Service { /** * Delete index * + * Delete an index. * * @param {string} databaseId * @param {string} collectionId @@ -2100,7 +2117,7 @@ export class Databases extends Service { } /** - * Get usage stats for a collection + * Get collection usage stats * * * @param {string} databaseId @@ -2160,7 +2177,7 @@ export class Databases extends Service { } /** - * Get usage stats for the database + * Get database usage stats * * * @param {string} databaseId diff --git a/src/services/health.ts b/src/services/health.ts index f9571f6..2e9eaf2 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -278,6 +278,8 @@ export class Health extends Service { /** * Get functions queue * + * Get the number of function executions that are waiting to be processed in + * the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} diff --git a/src/services/messaging.ts b/src/services/messaging.ts index c4f4f14..eebae83 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -2,7 +2,6 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; import type { UploadProgress, Payload } from '../client'; -import { MessageStatus } from '../enums/message-status'; import { SmtpEncryption } from '../enums/smtp-encryption'; export class Messaging extends Service { @@ -41,7 +40,7 @@ export class Messaging extends Service { } /** - * Create an email + * Create email * * Create a new email message. * @@ -54,13 +53,13 @@ export class Messaging extends Service { * @param {string[]} cc * @param {string[]} bcc * @param {string[]} attachments - * @param {MessageStatus} status + * @param {boolean} draft * @param {boolean} html * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], status?: MessageStatus, html?: boolean, scheduledAt?: string): Promise { + async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -112,8 +111,8 @@ export class Messaging extends Service { payload['attachments'] = attachments; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof html !== 'undefined') { @@ -131,7 +130,7 @@ export class Messaging extends Service { } /** - * Update an email + * Update email * * Update an email message by its unique ID. * @@ -142,7 +141,7 @@ export class Messaging extends Service { * @param {string[]} targets * @param {string} subject * @param {string} content - * @param {MessageStatus} status + * @param {boolean} draft * @param {boolean} html * @param {string[]} cc * @param {string[]} bcc @@ -150,7 +149,7 @@ export class Messaging extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, status?: MessageStatus, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise { + async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -178,8 +177,8 @@ export class Messaging extends Service { payload['content'] = content; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof html !== 'undefined') { @@ -205,7 +204,7 @@ export class Messaging extends Service { } /** - * Create a push notification + * Create push notification * * Create a new push notification. * @@ -223,12 +222,12 @@ export class Messaging extends Service { * @param {string} color * @param {string} tag * @param {string} badge - * @param {MessageStatus} status + * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, status?: MessageStatus, scheduledAt?: string): Promise { + async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -300,8 +299,8 @@ export class Messaging extends Service { payload['badge'] = badge; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof scheduledAt !== 'undefined') { @@ -315,7 +314,7 @@ export class Messaging extends Service { } /** - * Update a push notification + * Update push notification * * Update a push notification by its unique ID. * @@ -334,12 +333,12 @@ export class Messaging extends Service { * @param {string} color * @param {string} tag * @param {number} badge - * @param {MessageStatus} status + * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, status?: MessageStatus, scheduledAt?: string): Promise { + async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -399,8 +398,8 @@ export class Messaging extends Service { payload['badge'] = badge; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof scheduledAt !== 'undefined') { @@ -414,7 +413,7 @@ export class Messaging extends Service { } /** - * Create an SMS + * Create SMS * * Create a new SMS message. * @@ -423,12 +422,12 @@ export class Messaging extends Service { * @param {string[]} topics * @param {string[]} users * @param {string[]} targets - * @param {MessageStatus} status + * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], status?: MessageStatus, scheduledAt?: string): Promise { + async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -460,8 +459,8 @@ export class Messaging extends Service { payload['targets'] = targets; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof scheduledAt !== 'undefined') { @@ -475,7 +474,7 @@ export class Messaging extends Service { } /** - * Update an SMS + * Update SMS * * Update an email message by its unique ID. * @@ -485,12 +484,12 @@ export class Messaging extends Service { * @param {string[]} users * @param {string[]} targets * @param {string} content - * @param {MessageStatus} status + * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, status?: MessageStatus, scheduledAt?: string): Promise { + async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } @@ -514,8 +513,8 @@ export class Messaging extends Service { payload['content'] = content; } - if (typeof status !== 'undefined') { - payload['status'] = status; + if (typeof draft !== 'undefined') { + payload['draft'] = draft; } if (typeof scheduledAt !== 'undefined') { @@ -529,7 +528,7 @@ export class Messaging extends Service { } /** - * Get a message + * Get message * * Get a message by its unique ID. * @@ -553,8 +552,10 @@ export class Messaging extends Service { } /** - * Delete a message + * Delete message * + * Delete a message. If the message is not a draft or scheduled, but has been + * sent, this will not recall the message. * * @param {string} messageId * @throws {AppwriteException} @@ -1117,6 +1118,7 @@ export class Messaging extends Service { /** * Create Sendgrid provider * + * Create a new Sendgrid provider. * * @param {string} providerId * @param {string} name @@ -1973,7 +1975,7 @@ export class Messaging extends Service { } /** - * Create a topic + * Create topic * * Create a new topic. * @@ -2014,7 +2016,7 @@ export class Messaging extends Service { } /** - * Get a topic + * Get topic * * Get a topic by its unique ID. * @@ -2038,7 +2040,7 @@ export class Messaging extends Service { } /** - * Update a topic + * Update topic * * Update a topic by its unique ID. * @@ -2072,7 +2074,7 @@ export class Messaging extends Service { } /** - * Delete a topic + * Delete topic * * Delete a topic by its unique ID. * @@ -2156,7 +2158,7 @@ export class Messaging extends Service { } /** - * Create a subscriber + * Create subscriber * * Create a new subscriber. * @@ -2197,7 +2199,7 @@ export class Messaging extends Service { } /** - * Get a subscriber + * Get subscriber * * Get a subscriber by its unique ID. * @@ -2226,7 +2228,7 @@ export class Messaging extends Service { } /** - * Delete a subscriber + * Delete subscriber * * Delete a subscriber by its unique ID. * diff --git a/src/services/project.ts b/src/services/project.ts index 1bc2952..c3e1262 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -12,7 +12,7 @@ export class Project extends Service { } /** - * Get usage stats for a project + * Get project usage stats * * * @param {string} startDate diff --git a/src/services/storage.ts b/src/services/storage.ts index 4440d1c..696da13 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -640,7 +640,7 @@ export class Storage extends Service { } /** - * Get usage stats for storage + * Get storage usage stats * * * @param {StorageUsageRange} range @@ -662,7 +662,7 @@ export class Storage extends Service { } /** - * Get usage stats for storage bucket + * Get bucket usage stats * * * @param {string} bucketId diff --git a/src/services/users.ts b/src/services/users.ts index b5ab9a3..380ae72 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -591,7 +591,7 @@ export class Users extends Service { } /** - * Get usage stats for the users API + * Get users usage stats * * * @param {UserUsageRange} range @@ -786,6 +786,7 @@ export class Users extends Service { /** * Update MFA * + * Enable or disable MFA on a user account. * * @param {string} userId * @param {boolean} mfa @@ -817,6 +818,7 @@ export class Users extends Service { /** * List Factors * + * List the factors available on the account to be used as a MFA challange. * * @param {string} userId * @throws {AppwriteException} @@ -839,14 +841,14 @@ export class Users extends Service { /** * Delete Authenticator * + * Delete an authenticator app. * * @param {string} userId * @param {AuthenticatorType} type - * @param {string} otp * @throws {AppwriteException} * @returns {Promise} */ - async deleteAuthenticator(userId: string, type: AuthenticatorType, otp: string): Promise> { + async deleteAuthenticator(userId: string, type: AuthenticatorType): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -855,17 +857,9 @@ export class Users extends Service { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof otp === 'undefined') { - throw new AppwriteException('Missing required parameter: "otp"'); - } - const apiPath = '/users/{userId}/mfa/{type}'.replace('{userId}', userId).replace('{type}', type); const payload: Payload = {}; - if (typeof otp !== 'undefined') { - payload['otp'] = otp; - } - const uri = new URL(this.client.config.endpoint + apiPath); return await this.client.call('delete', uri, { 'content-type': 'application/json', @@ -1163,6 +1157,7 @@ export class Users extends Service { /** * List User Targets * + * List the messaging targets that are associated with a user. * * @param {string} userId * @param {string[]} queries @@ -1190,6 +1185,7 @@ export class Users extends Service { /** * Create User Target * + * Create a messaging target. * * @param {string} userId * @param {string} targetId @@ -1249,6 +1245,7 @@ export class Users extends Service { /** * Get User Target * + * Get a user's push notification target by ID. * * @param {string} userId * @param {string} targetId @@ -1276,6 +1273,7 @@ export class Users extends Service { /** * Update User target * + * Update a messaging target. * * @param {string} userId * @param {string} targetId @@ -1318,6 +1316,7 @@ export class Users extends Service { /** * Delete user target * + * Delete a messaging target. * * @param {string} userId * @param {string} targetId