From 73994c66aeb45b71b53da262842fadaed6a5d61e Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 05:14:22 +0000 Subject: [PATCH 1/3] chore: regenerate sdk --- package.json | 2 +- src/client.ts | 7 +- src/services/account.ts | 184 ++++++++++---------------------------- src/services/avatars.ts | 14 --- src/services/databases.ts | 20 ++--- src/services/functions.ts | 12 +-- src/services/graphql.ts | 8 +- src/services/locale.ts | 32 ++----- src/services/messaging.ts | 8 +- src/services/storage.ts | 26 ++---- src/services/teams.ts | 52 +++-------- 11 files changed, 88 insertions(+), 277 deletions(-) diff --git a/package.json b/package.json index d1df893b..92471a22 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-appwrite", "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.7.0", + "version": "0.6.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 66e57aa9..f518b523 100644 --- a/src/client.ts +++ b/src/client.ts @@ -114,7 +114,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.7.0', + 'x-sdk-version': '0.6.0', 'X-Appwrite-Response-Format': '1.6.0', }; @@ -453,6 +453,7 @@ class Client { try { let data = null; const response = await fetch(url.toString(), options); + const text = await response.text() const warnings = response.headers.get('x-appwrite-warning'); if (warnings) { @@ -463,12 +464,12 @@ class Client { data = await response.json(); } else { data = { - message: await response.text() + message: text }; } if (400 <= response.status) { - throw new AppwriteException(data?.message, response.status, data?.type, data); + throw new AppwriteException(data?.message, response.status, data?.type, text); } const cookieFallback = response.headers.get('X-Fallback-Cookies'); diff --git a/src/services/account.ts b/src/services/account.ts index 14740891..70c3dbc1 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -17,8 +17,6 @@ export class Account extends Service { } /** - * Get account - * * Get the currently logged in user. * * @throws {AppwriteException} @@ -29,14 +27,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create account - * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use * the @@ -85,14 +81,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Update email - * * Update currently logged in user account email address. After changing user * address, the user confirmation status will get reset. A new confirmation * email is not sent automatically however you can use the send confirmation @@ -128,14 +122,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * List identities - * * Get the list of identities for the currently logged in user. * * @param {string[]} queries @@ -151,14 +143,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete identity - * * Delete an identity by its unique ID. * * @param {string} identityId @@ -174,14 +164,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Create JWT - * * Use this endpoint to create a JSON Web Token. You can use the resulting JWT * to authenticate on behalf of the current user when working with the * Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes @@ -196,14 +184,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * List logs - * * Get the list of latest security activity logs for the currently logged in * user. Each log returns user IP address, location and date and time of log. * @@ -220,14 +206,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update MFA - * * Enable or disable MFA on an account. * * @param {boolean} mfa @@ -247,14 +231,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Create 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#updateMfaAuthenticator) @@ -273,14 +255,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Verify authenticator - * * Verify an authenticator app after adding it using the [add * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) * method. @@ -307,14 +287,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete authenticator - * * Delete an authenticator for a user by ID. * * @param {AuthenticatorType} type @@ -330,14 +308,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Create MFA challenge - * * Begin the process of MFA verification after sign-in. Finish the flow with * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) * method. @@ -359,14 +335,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create MFA challenge (confirmation) - * * Complete the MFA challenge by providing the one-time password. Finish the * process of MFA verification by providing the one-time password. To begin * the flow, use @@ -399,14 +373,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * List factors - * * List the factors available on the account to be used as a MFA challange. * * @throws {AppwriteException} @@ -417,14 +389,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Get MFA recovery codes - * * Get recovery codes that can be used as backup for MFA flow. Before getting * codes, they must be generated using * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) @@ -438,14 +408,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create MFA recovery codes - * * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their * authehticator. Recovery codes can be used as a MFA verification type in @@ -460,14 +428,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Regenerate MFA recovery codes - * * Regenerate recovery codes that can be used as backup for MFA flow. Before * regenerating codes, they must be first generated using * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) @@ -481,14 +447,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Update name - * * Update currently logged in user account name. * * @param {string} name @@ -508,14 +472,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Update password - * * Update currently logged in user password. For validation, user is required * to pass in the new password, and the old password. For users created with * OAuth, Team Invites and Magic URL, oldPassword is optional. @@ -542,14 +504,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Update phone - * * Update the currently logged in user's phone number. After updating the * phone number, the phone verification status will be reset. A confirmation * SMS is not sent automatically, however you can use the [POST @@ -582,14 +542,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Get account preferences - * * Get the preferences as a key-value object for the currently logged in user. * * @throws {AppwriteException} @@ -600,14 +558,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update preferences - * * Update currently logged in user account preferences. The object you pass is * stored as is, and replaces any previous value. The maximum allowed prefs * size is 64kB and throws error if exceeded. @@ -629,14 +585,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Create password recovery - * * Sends the user an email with a temporary secret key for password reset. * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values @@ -672,14 +626,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create password recovery (confirmation) - * * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST @@ -726,14 +678,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * List sessions - * * Get the list of active sessions across different devices for the currently * logged in user. * @@ -745,14 +695,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete sessions - * * Delete all sessions from the user account and remove any sessions cookies * from the end client. * @@ -764,14 +712,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Create anonymous session - * * Use this endpoint to allow a new user to register an anonymous account in * your project. This route will also create a new session for the user. To * allow the new user to convert an anonymous account to a normal account, you @@ -788,14 +734,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create email password session - * * Allow the user to login into their account by providing a valid email and * password combination. This route will create a new session for the user. * @@ -829,14 +773,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * 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 * flows initiated by token creation. For example, magic URL and phone login. @@ -867,14 +809,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Create OAuth2 session - * * Allow the user to login to their account using the OAuth2 provider of their * choice. Each OAuth2 provider should be enabled from the Appwrite console * first. Use the success and failure arguments to provide a redirect URL's @@ -930,8 +870,6 @@ 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. @@ -962,14 +900,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Create 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. @@ -1000,14 +936,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Get session - * * Use this endpoint to get a logged in user's session using a Session ID. * Inputting 'current' will return the current session being used. * @@ -1024,14 +958,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update session - * * Use this endpoint to extend a session's length. Extending a session is * useful when session expiry is short. If the session was created using an * OAuth provider, this endpoint refreshes the access token from the provider. @@ -1049,14 +981,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete session - * * Logout the user. Use 'current' as the session ID to logout on this device, * use a session ID to logout on another device. If you're looking to logout * the user on all devices, use [Delete @@ -1076,14 +1006,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Update status - * * Block the currently logged in user account. Behind the scene, the user * record is not deleted but permanently blocked from any access. To * completely delete a user, use the Users API instead. @@ -1096,14 +1024,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Create push target - * * Use this endpoint to register a device for push notifications. Provide a * target ID (custom or generated using ID.unique()), a device identifier * (usually a device token), and optionally specify which provider should send @@ -1141,14 +1067,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Update push target - * * Update the currently logged in user's push notification target. You can * modify the target's identifier (device token) and provider ID (token, * email, phone etc.). The target must exist and belong to the current user. @@ -1177,14 +1101,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete push target - * * Delete a push notification target for the currently logged in user. After * deletion, the device will no longer receive push notifications. The target * must exist and belong to the current user. @@ -1202,14 +1124,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Create email token (OTP) - * * Sends the user an email with a secret key for creating a session. If the * provided user ID has not be registered, a new user will be created. Use the * returned user ID and secret and submit a request to the [POST @@ -1252,14 +1172,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create magic URL token - * * Sends the user an email with a secret key for creating a session. If the * provided user ID has not been registered, a new user will be created. When * the user clicks the link in the email, the user is redirected back to the @@ -1311,14 +1229,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create OAuth2 token - * * Allow the user to login to their account using the OAuth2 provider of their * choice. Each OAuth2 provider should be enabled from the Appwrite console * first. Use the success and failure arguments to provide a redirect URL's @@ -1372,8 +1288,6 @@ export class Account extends Service { } /** - * Create phone token - * * Sends the user an SMS with a secret key for creating a session. If the * provided user ID has not be registered, a new user will be created. Use the * returned user ID and secret and submit a request to the [POST @@ -1411,14 +1325,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create email verification - * * Use this endpoint to send a verification message to your user email address * to confirm they are the valid owners of that address. Both the **userId** * and **secret** arguments will be passed as query parameters to the URL you @@ -1452,14 +1364,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Create email verification (confirmation) - * * Use this endpoint to complete the user email verification process. Use both * the **userId** and **secret** parameters that were attached to your app URL * to verify the user email ownership. If confirmed this route will return a @@ -1491,14 +1401,12 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Create phone verification - * * Use this endpoint to send a verification SMS to the currently logged in * user. This endpoint is meant for use after updating a user's phone number * using the @@ -1516,14 +1424,12 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Update phone verification (confirmation) - * * Use this endpoint to complete the user phone verification process. Use the * **userId** and **secret** that were sent to your user's phone number to * verify the user email ownership. If confirmed this route will return a 200 @@ -1555,7 +1461,7 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } diff --git a/src/services/avatars.ts b/src/services/avatars.ts index acd80ed6..1d640843 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -17,8 +17,6 @@ export class Avatars extends Service { } /** - * Get browser icon - * * You can use this endpoint to show different browser icons to your users. * The code argument receives the browser code as it appears in your user [GET * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) @@ -68,8 +66,6 @@ export class Avatars extends Service { } /** - * Get credit card icon - * * The credit card endpoint will return you the icon of the credit card * provider you need. Use width, height and quality arguments to change the * output settings. @@ -118,8 +114,6 @@ export class Avatars extends Service { } /** - * Get favicon - * * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote * website URL. * @@ -152,8 +146,6 @@ export class Avatars extends Service { } /** - * Get country flag - * * You can use this endpoint to show different country flags icons to your * users. The code argument receives the 2 letter country code. Use width, * height and quality arguments to change the output settings. Country codes @@ -203,8 +195,6 @@ export class Avatars extends Service { } /** - * Get image from URL - * * Use this endpoint to fetch a remote image URL and crop it to any image size * you want. This endpoint is very useful if you need to crop and display * remote images in your app or in case you want to make sure a 3rd party @@ -254,8 +244,6 @@ export class Avatars extends Service { } /** - * Get user initials - * * Use this endpoint to show your user initials avatar icon on your website or * app. By default, this route will try to print your logged-in user name or * email initials. You can also overwrite the user name if you pass the 'name' @@ -311,8 +299,6 @@ export class Avatars extends Service { } /** - * Get QR code - * * Converts a given plain text to a QR code image. You can use the query * parameters to change the size and style of the resulting image. * diff --git a/src/services/databases.ts b/src/services/databases.ts index eb36315c..7ea3e513 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -14,8 +14,6 @@ export class Databases extends Service { } /** - * List documents - * * Get a list of all the user's documents in a given collection. You can use * the query params to filter your results. * @@ -42,14 +40,12 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create document - * * Create a new Document. Before using this route, you should create a new * collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) @@ -96,14 +92,12 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Get document - * * Get a document by its unique ID. This endpoint response returns a JSON * object with the document data. * @@ -135,14 +129,12 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update document - * * Update a document by its unique ID. Using the patch method you can pass * only specific fields that will get updated. * @@ -179,14 +171,12 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete document - * * Delete a document by its unique ID. * * @param {string} databaseId @@ -212,7 +202,7 @@ export class Databases extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } diff --git a/src/services/functions.ts b/src/services/functions.ts index e015aea6..b8c0a646 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -15,8 +15,6 @@ export class Functions extends Service { } /** - * List executions - * * Get a list of all the current user function execution logs. You can use the * query params to filter your results. * @@ -43,14 +41,12 @@ export class Functions extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create execution - * * Trigger a function execution. The returned object will return you the * current execution status. You can ping the `Get Execution` endpoint to get * updates on the current execution status. Once this endpoint is called, your @@ -99,14 +95,12 @@ export class Functions extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Get execution - * * Get a function execution log by its unique ID. * * @param {string} functionId @@ -127,7 +121,7 @@ export class Functions extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 8b1f2b85..ebe66570 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -14,8 +14,6 @@ export class Graphql extends Service { } /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param {object} query @@ -35,15 +33,13 @@ export class Graphql extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'x-sdk-graphql': 'true', 'content-type': 'application/json', }, payload); } /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param {object} query @@ -63,7 +59,7 @@ export class Graphql extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'x-sdk-graphql': 'true', 'content-type': 'application/json', }, payload); diff --git a/src/services/locale.ts b/src/services/locale.ts index 7850948d..ba86b06a 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -14,8 +14,6 @@ export class Locale extends Service { } /** - * Get user locale - * * Get the current user location based on IP. Returns an object with user * country code, country name, continent name, continent code, ip address and * suggested currency. You can use the locale header to get the data in a @@ -31,14 +29,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List locale codes - * * List of all locale codes in [ISO * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * @@ -50,14 +46,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List continents - * * List of all continents. You can use the locale header to get the data in a * supported language. * @@ -69,14 +63,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List countries - * * List of all countries. You can use the locale header to get the data in a * supported language. * @@ -88,14 +80,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List EU countries - * * List of all countries that are currently members of the EU. You can use the * locale header to get the data in a supported language. * @@ -107,14 +97,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List countries phone codes - * * List of all countries phone codes. You can use the locale header to get the * data in a supported language. * @@ -126,14 +114,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List currencies - * * List of all currencies, including currency symbol, name, plural, and * decimal digits for all major and minor currencies. You can use the locale * header to get the data in a supported language. @@ -146,14 +132,12 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * List languages - * * List of all languages classified by ISO 639-1 including 2-letter code, name * in English, and name in the respective language. * @@ -165,7 +149,7 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 26ceb317..8de17145 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -14,8 +14,6 @@ export class Messaging extends Service { } /** - * Create subscriber - * * Create a new subscriber. * * @param {string} topicId @@ -49,14 +47,12 @@ export class Messaging extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete subscriber - * * Delete a subscriber by its unique ID. * * @param {string} topicId @@ -77,7 +73,7 @@ export class Messaging extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } diff --git a/src/services/storage.ts b/src/services/storage.ts index 6661387b..c932ae4c 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -16,8 +16,6 @@ export class Storage extends Service { } /** - * List files - * * Get a list of all the user files. You can use the query params to filter * your results. * @@ -44,14 +42,12 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create file - * * Create a new file. Before using this route, you should create a new bucket * resource using either a [server * integration](https://appwrite.io/docs/server/storage#storageCreateBucket) @@ -111,7 +107,7 @@ export class Storage extends Service { const size = file.size; if (size <= Service.CHUNK_SIZE) { - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'multipart/form-data', }, payload); } @@ -167,8 +163,6 @@ export class Storage extends Service { } /** - * Get file - * * Get a file by its unique ID. This endpoint response returns a JSON object * with the file metadata. * @@ -190,14 +184,12 @@ export class Storage extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update file - * * Update a file by its unique ID. Only users with write permissions have * access to update this resource. * @@ -229,14 +221,12 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete file - * * Delete a file by its unique ID. Only users with write permissions have * access to delete this resource. * @@ -258,14 +248,12 @@ export class Storage extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Get file for download - * * Get a file content by its unique ID. The endpoint response return with a * 'Content-Disposition: attachment' header that tells the browser to start * downloading the file to user downloads directory. @@ -298,8 +286,6 @@ export class Storage extends Service { } /** - * Get file preview - * * Get a file preview image. Currently, this method supports preview for image * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, * and spreadsheets, will return the file icon image. You can also pass query @@ -389,8 +375,6 @@ export class Storage extends Service { } /** - * Get file for view - * * Get a file content by its unique ID. This endpoint is similar to the * download method but returns with no 'Content-Disposition: attachment' * header. diff --git a/src/services/teams.ts b/src/services/teams.ts index 61917206..111445f0 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -14,8 +14,6 @@ export class Teams extends Service { } /** - * List teams - * * Get a list of all the teams in which the current user is a member. You can * use the parameters to filter your results. * @@ -37,14 +35,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create team - * * Create a new team. The user who creates the team will automatically be * assigned as the owner of the team. Only the users with the owner role can * invite new members, add new owners and delete or update the team. @@ -80,14 +76,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Get team - * * Get a team by its ID. All team members have read access for this resource. * * @param {string} teamId @@ -103,14 +97,12 @@ export class Teams extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update name - * * Update the team's name by its unique ID. * * @param {string} teamId @@ -135,14 +127,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete team - * * Delete a team using its ID. Only team members with the owner role can * delete the team. * @@ -159,14 +149,12 @@ export class Teams extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * List team memberships - * * Use this endpoint to list a team's members using the team's ID. All team * members have read access to this endpoint. Hide sensitive attributes from * the response by toggling membership privacy in the Console. @@ -194,14 +182,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Create team membership - * * Invite a new member to join your team. Provide an ID for existing users, or * invite unregistered users using an email or phone number. If initiated from * a Client SDK, Appwrite will send an email or sms with a link to join the @@ -271,14 +257,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return this.client.call('post', uri, { 'content-type': 'application/json', }, payload); } /** - * Get team membership - * * Get a team member by the membership unique id. All team members have read * access for this resource. Hide sensitive attributes from the response by * toggling membership privacy in the Console. @@ -301,14 +285,12 @@ export class Teams extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update membership - * * Modify the roles of a team member. Only team members with the owner role * have access to this endpoint. Learn more about [roles and * permissions](https://appwrite.io/docs/permissions). @@ -341,14 +323,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Delete team membership - * * This endpoint allows a user to leave a team or for a team owner to delete * the membership of any other team member. You can also use this endpoint to * delete a user membership even if it is not accepted. @@ -371,14 +351,12 @@ export class Teams extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + return this.client.call('delete', uri, { 'content-type': 'application/json', }, payload); } /** - * Update team membership status - * * Use this endpoint to allow a user to accept an invitation to join a team * after being redirected back to your app from the invitation email received * by the user. @@ -423,14 +401,12 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + return this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } /** - * Get team preferences - * * Get the team's shared preferences by its unique ID. If a preference doesn't * need to be shared by all team members, prefer storing them in [user * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). @@ -448,14 +424,12 @@ export class Teams extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + return this.client.call('get', uri, { 'content-type': 'application/json', }, payload); } /** - * Update preferences - * * Update the team's preferences by its unique ID. The object you pass is * stored as is and replaces any previous value. The maximum allowed prefs * size is 64kB and throws an error if exceeded. @@ -482,7 +456,7 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + return this.client.call('put', uri, { 'content-type': 'application/json', }, payload); } From b0c805b8cbcdc315e2bc88c7816b6a0ed5f6f343 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 05:16:39 +0000 Subject: [PATCH 2/3] chore: fix version --- package.json | 2 +- src/client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 92471a22..20295c3a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-appwrite", "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", + "version": "0.7.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index f518b523..0a2d8ae0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -114,7 +114,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.6.0', + 'x-sdk-version': '0.7.1', 'X-Appwrite-Response-Format': '1.6.0', }; From a0226bda3df56680ba6decc5a9c8e9860bcdf504 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Mar 2025 08:58:34 +0000 Subject: [PATCH 3/3] fix: unnecessary async signatures --- src/services/account.ts | 90 +++++++++++++++++++-------------------- src/services/databases.ts | 10 ++--- src/services/functions.ts | 6 +-- src/services/graphql.ts | 4 +- src/services/locale.ts | 16 +++---- src/services/messaging.ts | 4 +- src/services/storage.ts | 8 ++-- src/services/teams.ts | 26 +++++------ 8 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/services/account.ts b/src/services/account.ts index 70c3dbc1..7c4927d5 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -22,7 +22,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async get(): Promise> { + get(): Promise> { const apiPath = '/account'; const payload: Payload = {}; @@ -48,7 +48,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async create(userId: string, email: string, password: string, name?: string): Promise> { + create(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -101,7 +101,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateEmail(email: string, password: string): Promise> { + updateEmail(email: string, password: string): Promise> { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } @@ -134,7 +134,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listIdentities(queries?: string[]): Promise { + listIdentities(queries?: string[]): Promise { const apiPath = '/account/identities'; const payload: Payload = {}; @@ -155,7 +155,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteIdentity(identityId: string): Promise<{}> { + deleteIdentity(identityId: string): Promise<{}> { if (typeof identityId === 'undefined') { throw new AppwriteException('Missing required parameter: "identityId"'); } @@ -179,7 +179,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createJWT(): Promise { + createJWT(): Promise { const apiPath = '/account/jwts'; const payload: Payload = {}; @@ -197,7 +197,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listLogs(queries?: string[]): Promise { + listLogs(queries?: string[]): Promise { const apiPath = '/account/logs'; const payload: Payload = {}; @@ -218,7 +218,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMFA(mfa: boolean): Promise> { + updateMFA(mfa: boolean): Promise> { if (typeof mfa === 'undefined') { throw new AppwriteException('Missing required parameter: "mfa"'); } @@ -246,7 +246,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createMfaAuthenticator(type: AuthenticatorType): Promise { + createMfaAuthenticator(type: AuthenticatorType): Promise { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } @@ -270,7 +270,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMfaAuthenticator(type: AuthenticatorType, otp: string): Promise> { + updateMfaAuthenticator(type: AuthenticatorType, otp: string): Promise> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } @@ -299,7 +299,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { + deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } @@ -322,7 +322,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createMfaChallenge(factor: AuthenticationFactor): Promise { + createMfaChallenge(factor: AuthenticationFactor): Promise { if (typeof factor === 'undefined') { throw new AppwriteException('Missing required parameter: "factor"'); } @@ -352,7 +352,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMfaChallenge(challengeId: string, otp: string): Promise { + updateMfaChallenge(challengeId: string, otp: string): Promise { if (typeof challengeId === 'undefined') { throw new AppwriteException('Missing required parameter: "challengeId"'); } @@ -384,7 +384,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listMfaFactors(): Promise { + listMfaFactors(): Promise { const apiPath = '/account/mfa/factors'; const payload: Payload = {}; @@ -403,7 +403,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getMfaRecoveryCodes(): Promise { + getMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; @@ -423,7 +423,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createMfaRecoveryCodes(): Promise { + createMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; @@ -442,7 +442,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMfaRecoveryCodes(): Promise { + updateMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; @@ -459,7 +459,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateName(name: string): Promise> { + updateName(name: string): Promise> { if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } @@ -487,7 +487,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePassword(password: string, oldPassword?: string): Promise> { + updatePassword(password: string, oldPassword?: string): Promise> { if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } @@ -521,7 +521,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePhone(phone: string, password: string): Promise> { + updatePhone(phone: string, password: string): Promise> { if (typeof phone === 'undefined') { throw new AppwriteException('Missing required parameter: "phone"'); } @@ -553,7 +553,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getPrefs(): Promise { + getPrefs(): Promise { const apiPath = '/account/prefs'; const payload: Payload = {}; @@ -572,7 +572,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePrefs(prefs: object): Promise> { + updatePrefs(prefs: object): Promise> { if (typeof prefs === 'undefined') { throw new AppwriteException('Missing required parameter: "prefs"'); } @@ -605,7 +605,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createRecovery(email: string, url: string): Promise { + createRecovery(email: string, url: string): Promise { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } @@ -649,7 +649,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateRecovery(userId: string, secret: string, password: string): Promise { + updateRecovery(userId: string, secret: string, password: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -690,7 +690,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listSessions(): Promise { + listSessions(): Promise { const apiPath = '/account/sessions'; const payload: Payload = {}; @@ -707,7 +707,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteSessions(): Promise<{}> { + deleteSessions(): Promise<{}> { const apiPath = '/account/sessions'; const payload: Payload = {}; @@ -729,7 +729,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createAnonymousSession(): Promise { + createAnonymousSession(): Promise { const apiPath = '/account/sessions/anonymous'; const payload: Payload = {}; @@ -752,7 +752,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createEmailPasswordSession(email: string, password: string): Promise { + createEmailPasswordSession(email: string, password: string): Promise { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } @@ -788,7 +788,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMagicURLSession(userId: string, secret: string): Promise { + updateMagicURLSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -879,7 +879,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePhoneSession(userId: string, secret: string): Promise { + updatePhoneSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -915,7 +915,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createSession(userId: string, secret: string): Promise { + createSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -949,7 +949,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getSession(sessionId: string): Promise { + getSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -972,7 +972,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateSession(sessionId: string): Promise { + updateSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -997,7 +997,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteSession(sessionId: string): Promise<{}> { + deleteSession(sessionId: string): Promise<{}> { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -1019,7 +1019,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateStatus(): Promise> { + updateStatus(): Promise> { const apiPath = '/account/status'; const payload: Payload = {}; @@ -1042,7 +1042,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createPushTarget(targetId: string, identifier: string, providerId?: string): Promise { + createPushTarget(targetId: string, identifier: string, providerId?: string): Promise { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } @@ -1084,7 +1084,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePushTarget(targetId: string, identifier: string): Promise { + updatePushTarget(targetId: string, identifier: string): Promise { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } @@ -1115,7 +1115,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deletePushTarget(targetId: string): Promise<{}> { + deletePushTarget(targetId: string): Promise<{}> { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } @@ -1147,7 +1147,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createEmailToken(userId: string, email: string, phrase?: boolean): Promise { + createEmailToken(userId: string, email: string, phrase?: boolean): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1200,7 +1200,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise { + createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1304,7 +1304,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createPhoneToken(userId: string, phone: string): Promise { + createPhoneToken(userId: string, phone: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1351,7 +1351,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createVerification(url: string): Promise { + createVerification(url: string): Promise { if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } @@ -1380,7 +1380,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateVerification(userId: string, secret: string): Promise { + updateVerification(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1419,7 +1419,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createPhoneVerification(): Promise { + createPhoneVerification(): Promise { const apiPath = '/account/verification/phone'; const payload: Payload = {}; @@ -1440,7 +1440,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePhoneVerification(userId: string, secret: string): Promise { + updatePhoneVerification(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } diff --git a/src/services/databases.ts b/src/services/databases.ts index 7ea3e513..7882d8ca 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -23,7 +23,7 @@ export class Databases extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listDocuments(databaseId: string, collectionId: string, queries?: string[]): Promise> { + listDocuments(databaseId: string, collectionId: string, queries?: string[]): Promise> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -59,7 +59,7 @@ export class Databases extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createDocument(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise { + createDocument(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -108,7 +108,7 @@ export class Databases extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise { + getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -146,7 +146,7 @@ export class Databases extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateDocument(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise { + updateDocument(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -185,7 +185,7 @@ export class Databases extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> { + deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } diff --git a/src/services/functions.ts b/src/services/functions.ts index b8c0a646..89aa791a 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -24,7 +24,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listExecutions(functionId: string, queries?: string[], search?: string): Promise { + listExecutions(functionId: string, queries?: string[], search?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -62,7 +62,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise { + createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -108,7 +108,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getExecution(functionId: string, executionId: string): Promise { + getExecution(functionId: string, executionId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } diff --git a/src/services/graphql.ts b/src/services/graphql.ts index ebe66570..a24adaa4 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -20,7 +20,7 @@ export class Graphql extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async query(query: object): Promise<{}> { + query(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } @@ -46,7 +46,7 @@ export class Graphql extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async mutation(query: object): Promise<{}> { + mutation(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } diff --git a/src/services/locale.ts b/src/services/locale.ts index ba86b06a..6a99b833 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -24,7 +24,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async get(): Promise { + get(): Promise { const apiPath = '/locale'; const payload: Payload = {}; @@ -41,7 +41,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listCodes(): Promise { + listCodes(): Promise { const apiPath = '/locale/codes'; const payload: Payload = {}; @@ -58,7 +58,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listContinents(): Promise { + listContinents(): Promise { const apiPath = '/locale/continents'; const payload: Payload = {}; @@ -75,7 +75,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listCountries(): Promise { + listCountries(): Promise { const apiPath = '/locale/countries'; const payload: Payload = {}; @@ -92,7 +92,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listCountriesEU(): Promise { + listCountriesEU(): Promise { const apiPath = '/locale/countries/eu'; const payload: Payload = {}; @@ -109,7 +109,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listCountriesPhones(): Promise { + listCountriesPhones(): Promise { const apiPath = '/locale/countries/phones'; const payload: Payload = {}; @@ -127,7 +127,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listCurrencies(): Promise { + listCurrencies(): Promise { const apiPath = '/locale/currencies'; const payload: Payload = {}; @@ -144,7 +144,7 @@ export class Locale extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listLanguages(): Promise { + listLanguages(): Promise { const apiPath = '/locale/languages'; const payload: Payload = {}; diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 8de17145..6e33b9ab 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -22,7 +22,7 @@ export class Messaging extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise { + createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } @@ -60,7 +60,7 @@ export class Messaging extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> { + deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } diff --git a/src/services/storage.ts b/src/services/storage.ts index c932ae4c..5101f7d8 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -25,7 +25,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listFiles(bucketId: string, queries?: string[], search?: string): Promise { + listFiles(bucketId: string, queries?: string[], search?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -171,7 +171,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getFile(bucketId: string, fileId: string): Promise { + getFile(bucketId: string, fileId: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -200,7 +200,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise { + updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -235,7 +235,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteFile(bucketId: string, fileId: string): Promise<{}> { + deleteFile(bucketId: string, fileId: string): Promise<{}> { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } diff --git a/src/services/teams.ts b/src/services/teams.ts index 111445f0..8eb69e1f 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -22,7 +22,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async list(queries?: string[], search?: string): Promise> { + list(queries?: string[], search?: string): Promise> { const apiPath = '/teams'; const payload: Payload = {}; @@ -51,7 +51,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async create(teamId: string, name: string, roles?: string[]): Promise> { + create(teamId: string, name: string, roles?: string[]): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -88,7 +88,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async get(teamId: string): Promise> { + get(teamId: string): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -110,7 +110,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateName(teamId: string, name: string): Promise> { + updateName(teamId: string, name: string): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -140,7 +140,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async delete(teamId: string): Promise<{}> { + delete(teamId: string): Promise<{}> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -165,7 +165,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async listMemberships(teamId: string, queries?: string[], search?: string): Promise { + listMemberships(teamId: string, queries?: string[], search?: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -220,7 +220,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise { + createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -272,7 +272,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getMembership(teamId: string, membershipId: string): Promise { + getMembership(teamId: string, membershipId: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -302,7 +302,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise { + updateMembership(teamId: string, membershipId: string, roles: string[]): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -338,7 +338,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async deleteMembership(teamId: string, membershipId: string): Promise<{}> { + deleteMembership(teamId: string, membershipId: string): Promise<{}> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -372,7 +372,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise { + updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -415,7 +415,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async getPrefs(teamId: string): Promise { + getPrefs(teamId: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -439,7 +439,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async updatePrefs(teamId: string, prefs: object): Promise { + updatePrefs(teamId: string, prefs: object): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); }