From 3bd563daaf54ca270b6d8a582d02fe7447a6edab Mon Sep 17 00:00:00 2001 From: ChiragAgg5k Date: Thu, 27 Feb 2025 04:30:48 +0000 Subject: [PATCH 1/3] chore: regenerate sdks --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- src/services/account.ts | 186 +++++++++++++++++++------------------- src/services/avatars.ts | 35 ++----- 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 | 35 +++---- src/services/teams.ts | 52 +++++------ 12 files changed, 181 insertions(+), 213 deletions(-) diff --git a/README.md b/README.md index 86f5dcd..314cfe7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite"; 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/package.json b/package.json index 9f9caa0..6d17ef8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "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": "17.0.0", + "version": "17.0.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 70ced88..9a786ee 100644 --- a/src/client.ts +++ b/src/client.ts @@ -315,7 +315,7 @@ class Client { 'x-sdk-name': 'Web', 'x-sdk-platform': 'client', 'x-sdk-language': 'web', - 'x-sdk-version': '17.0.0', + 'x-sdk-version': '17.0.1', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/services/account.ts b/src/services/account.ts index a922dbc..b77cbf8 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -13,8 +13,6 @@ export class Account { } /** - * Get account - * * Get the currently logged in user. * * @throws {AppwriteException} @@ -29,6 +27,8 @@ export class Account { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -38,8 +38,6 @@ export class Account { ); } /** - * 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 [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). * * @param {string} userId @@ -79,6 +77,8 @@ export class Account { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -88,8 +88,6 @@ export class Account { ); } /** - * 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 email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. @@ -120,6 +118,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -129,8 +129,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * List identities - * * Get the list of identities for the currently logged in user. * * @param {string[]} queries @@ -149,6 +147,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -158,8 +158,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Delete identity - * * Delete an identity by its unique ID. * * @param {string} identityId @@ -178,6 +176,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -187,8 +187,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 from its creation and will be invalid if the user will logout in that time frame. * * @throws {AppwriteException} @@ -203,6 +201,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -212,8 +212,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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. * * @param {string[]} queries @@ -232,6 +230,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -241,8 +241,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Update MFA - * * Enable or disable MFA on an account. * * @param {boolean} mfa @@ -264,6 +262,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -273,8 +273,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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) method. * * @param {AuthenticatorType} type @@ -293,6 +291,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -302,8 +302,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Verify authenticator - * * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * * @param {AuthenticatorType} type @@ -329,6 +327,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -338,8 +338,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Delete authenticator - * * Delete an authenticator for a user by ID. * * @param {AuthenticatorType} type @@ -358,6 +356,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -367,8 +367,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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. * * @param {AuthenticationFactor} factor @@ -390,6 +388,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -399,8 +399,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @param {string} challengeId @@ -429,6 +427,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -438,8 +438,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * List factors - * * List the factors available on the account to be used as a MFA challange. * * @throws {AppwriteException} @@ -454,6 +452,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -463,8 +463,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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) method. An OTP challenge is required to read recovery codes. * * @throws {AppwriteException} @@ -479,6 +477,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -488,8 +488,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @throws {AppwriteException} @@ -504,6 +502,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -513,8 +513,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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) method. An OTP challenge is required to regenreate recovery codes. * * @throws {AppwriteException} @@ -529,6 +527,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -538,8 +538,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Update name - * * Update currently logged in user account name. * * @param {string} name @@ -561,6 +559,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -570,8 +570,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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. * * @param {string} password @@ -597,6 +595,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -606,8 +606,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * * @param {string} phone @@ -636,6 +634,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -645,8 +645,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * Get account preferences - * * Get the preferences as a key-value object for the currently logged in user. * * @throws {AppwriteException} @@ -661,6 +659,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -670,8 +670,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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. * * @param {Partial} prefs @@ -693,6 +691,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -702,8 +702,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. * * @param {string} email @@ -732,6 +730,8 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -741,8 +741,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, ); } /** - * 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 /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. @@ -780,6 +778,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -789,8 +789,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * List sessions - * * Get the list of active sessions across different devices for the currently logged in user. * * @throws {AppwriteException} @@ -805,6 +803,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -814,8 +814,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * Delete sessions - * * Delete all sessions from the user account and remove any sessions cookies from the end client. * * @throws {AppwriteException} @@ -830,6 +828,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -839,8 +839,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * 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 need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). * * @throws {AppwriteException} @@ -855,6 +853,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -864,8 +864,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * 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. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). @@ -896,6 +894,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -905,8 +905,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @param {string} userId @@ -935,6 +933,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -944,8 +944,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 back to your app when login is completed. If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. @@ -982,6 +980,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } @@ -994,8 +993,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about } } /** - * 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 @@ -1024,6 +1021,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -1033,8 +1032,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @param {string} userId @@ -1063,6 +1060,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1072,8 +1071,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @param {string} sessionId @@ -1092,6 +1089,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -1101,8 +1100,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @param {string} sessionId @@ -1121,6 +1118,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -1130,8 +1129,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. * * @param {string} sessionId @@ -1150,6 +1147,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -1159,8 +1158,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @throws {AppwriteException} @@ -1175,6 +1172,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -1184,8 +1183,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. * * @param {string} targetId @@ -1218,6 +1215,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1227,8 +1226,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. If you change the provider ID, notifications will be sent through the new messaging provider instead. * * @param {string} targetId @@ -1254,6 +1251,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -1263,8 +1262,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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. * * @param {string} targetId @@ -1283,6 +1280,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -1292,8 +1291,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). @@ -1328,6 +1325,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1337,8 +1336,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). @@ -1378,6 +1375,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1387,8 +1386,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 back to your app when login is completed. If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. @@ -1424,6 +1421,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } @@ -1436,8 +1434,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about } } /** - * 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 /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). @@ -1468,6 +1464,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1477,8 +1475,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about ); } /** - * 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 have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. @@ -1503,6 +1499,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1512,8 +1510,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * 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 200 status code. * * @param {string} userId @@ -1542,6 +1538,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -1551,8 +1549,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * 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 [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. * * @throws {AppwriteException} @@ -1567,6 +1563,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -1576,8 +1574,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ ); } /** - * 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 status code. * * @param {string} userId @@ -1606,6 +1602,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', diff --git a/src/services/avatars.ts b/src/services/avatars.ts index f5fbc63..fc1c4cb 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -13,8 +13,6 @@ export class Avatars { } /** - * 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) endpoint. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. @@ -48,17 +46,14 @@ When one dimension is specified and the other is 0, the image is scaled with pre } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. @@ -93,17 +88,14 @@ When one dimension is specified and the other is 0, the image is scaled with pre } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * Get favicon - * * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. This endpoint does not follow HTTP redirects. @@ -128,17 +120,14 @@ This endpoint does not follow HTTP redirects. } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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 follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. @@ -173,17 +162,14 @@ When one dimension is specified and the other is 0, the image is scaled with pre } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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 image is properly served using a TLS protocol. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. @@ -218,17 +204,14 @@ This endpoint does not follow HTTP redirects. } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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' parameter. If no name is given and no user is logged, an empty avatar will be returned. You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. @@ -265,17 +248,14 @@ When one dimension is specified and the other is 0, the image is scaled with pre } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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. * @@ -311,12 +291,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } } diff --git a/src/services/databases.ts b/src/services/databases.ts index 51ac5f1..875b6d0 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -10,8 +10,6 @@ export class Databases { } /** - * 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. * * @param {string} databaseId @@ -38,6 +36,8 @@ export class Databases { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -47,8 +47,6 @@ export class Databases { ); } /** - * 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) API or directly from your database console. * * @param {string} databaseId @@ -89,6 +87,8 @@ export class Databases { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -98,8 +98,6 @@ export class Databases { ); } /** - * Get document - * * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * * @param {string} databaseId @@ -130,6 +128,8 @@ export class Databases { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -139,8 +139,6 @@ export class Databases { ); } /** - * Update document - * * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. * * @param {string} databaseId @@ -175,6 +173,8 @@ export class Databases { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -184,8 +184,6 @@ export class Databases { ); } /** - * Delete document - * * Delete a document by its unique ID. * * @param {string} databaseId @@ -212,6 +210,8 @@ export class Databases { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', diff --git a/src/services/functions.ts b/src/services/functions.ts index 99b1df7..ede77f1 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -11,8 +11,6 @@ export class Functions { } /** - * List executions - * * Get a list of all the current user function execution logs. You can use the query params to filter your results. * * @param {string} functionId @@ -39,6 +37,8 @@ export class Functions { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -48,8 +48,6 @@ export class Functions { ); } /** - * 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 function execution process will start asynchronously. * * @param {string} functionId @@ -92,6 +90,8 @@ export class Functions { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -101,8 +101,6 @@ export class Functions { ); } /** - * Get execution - * * Get a function execution log by its unique ID. * * @param {string} functionId @@ -125,6 +123,8 @@ export class Functions { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', diff --git a/src/services/graphql.ts b/src/services/graphql.ts index e8b27ec..2938a88 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -10,8 +10,6 @@ export class Graphql { } /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param {object} query @@ -34,6 +32,8 @@ export class Graphql { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -43,8 +43,6 @@ export class Graphql { ); } /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param {object} query @@ -67,6 +65,8 @@ export class Graphql { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', diff --git a/src/services/locale.ts b/src/services/locale.ts index ad02a6c..27aa2cd 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -10,8 +10,6 @@ export class Locale { } /** - * 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 supported language. ([IP Geolocation by DB-IP](https://db-ip.com)) @@ -28,6 +26,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -37,8 +37,6 @@ export class Locale { ); } /** - * List locale codes - * * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * * @throws {AppwriteException} @@ -53,6 +51,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -62,8 +62,6 @@ export class Locale { ); } /** - * List continents - * * List of all continents. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} @@ -78,6 +76,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -87,8 +87,6 @@ export class Locale { ); } /** - * List countries - * * List of all countries. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} @@ -103,6 +101,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -112,8 +112,6 @@ export class Locale { ); } /** - * 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. * * @throws {AppwriteException} @@ -128,6 +126,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -137,8 +137,6 @@ export class Locale { ); } /** - * List countries phone codes - * * List of all countries phone codes. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} @@ -153,6 +151,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -162,8 +162,6 @@ export class Locale { ); } /** - * 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. * * @throws {AppwriteException} @@ -178,6 +176,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -187,8 +187,6 @@ export class Locale { ); } /** - * List languages - * * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. * * @throws {AppwriteException} @@ -203,6 +201,8 @@ export class Locale { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 8562a2f..5ae51f4 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -10,8 +10,6 @@ export class Messaging { } /** - * Create subscriber - * * Create a new subscriber. * * @param {string} topicId @@ -44,6 +42,8 @@ export class Messaging { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -53,8 +53,6 @@ export class Messaging { ); } /** - * Delete subscriber - * * Delete a subscriber by its unique ID. * * @param {string} topicId @@ -77,6 +75,8 @@ export class Messaging { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', diff --git a/src/services/storage.ts b/src/services/storage.ts index a76a508..5153fc0 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -12,8 +12,6 @@ export class Storage { } /** - * List files - * * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} bucketId @@ -40,6 +38,8 @@ export class Storage { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -49,8 +49,6 @@ export class Storage { ); } /** - * 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) API or directly from your Appwrite console. Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. @@ -94,6 +92,8 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'multipart/form-data', } + payload['project'] = this.client.config.project; + return await this.client.chunkedUpload( 'post', @@ -104,8 +104,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk ); } /** - * Get file - * * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. * * @param {string} bucketId @@ -128,6 +126,8 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -137,8 +137,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk ); } /** - * Update file - * * Update a file by its unique ID. Only users with write permissions have access to update this resource. * * @param {string} bucketId @@ -169,6 +167,8 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -178,8 +178,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk ); } /** - * Delete file - * * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. * * @param {string} bucketId @@ -202,6 +200,8 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -211,8 +211,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk ); } /** - * 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. * * @param {string} bucketId @@ -236,17 +234,14 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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 string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * * @param {string} bucketId @@ -314,17 +309,14 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } /** - * 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. * * @param {string} bucketId @@ -348,12 +340,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk } payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - payload['project'] = this.client.config.project; - return uri.toString(); } } diff --git a/src/services/teams.ts b/src/services/teams.ts index ffbdcab..591b335 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -10,8 +10,6 @@ export class Teams { } /** - * 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. * * @param {string[]} queries @@ -34,6 +32,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -43,8 +43,6 @@ export class Teams { ); } /** - * 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. * * @param {string} teamId @@ -77,6 +75,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -86,8 +86,6 @@ export class Teams { ); } /** - * Get team - * * Get a team by its ID. All team members have read access for this resource. * * @param {string} teamId @@ -106,6 +104,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -115,8 +115,6 @@ export class Teams { ); } /** - * Update name - * * Update the team's name by its unique ID. * * @param {string} teamId @@ -142,6 +140,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', @@ -151,8 +151,6 @@ export class Teams { ); } /** - * Delete team - * * Delete a team using its ID. Only team members with the owner role can delete the team. * * @param {string} teamId @@ -171,6 +169,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -180,8 +180,6 @@ export class Teams { ); } /** - * 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. * * @param {string} teamId @@ -208,6 +206,8 @@ export class Teams { 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -217,8 +217,6 @@ export class Teams { ); } /** - * 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 team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. @@ -271,6 +269,8 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'post', @@ -280,8 +280,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee ); } /** - * 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. * * @param {string} teamId @@ -304,6 +302,8 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -313,8 +313,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee ); } /** - * 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). * @@ -345,6 +343,8 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -354,8 +354,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee ); } /** - * 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. * * @param {string} teamId @@ -378,6 +376,8 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'delete', @@ -387,8 +387,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee ); } /** - * 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. If the request is successful, a session for the user is automatically created. @@ -428,6 +426,8 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'patch', @@ -437,8 +437,6 @@ If the request is successful, a session for the user is automatically created. ); } /** - * 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). * * @param {string} teamId @@ -457,6 +455,8 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'get', @@ -466,8 +466,6 @@ If the request is successful, a session for the user is automatically created. ); } /** - * 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. * * @param {string} teamId @@ -493,6 +491,8 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + return await this.client.call( 'put', From 065fdf03c63e5fccbc5fc38877100f71553b07ff Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Mar 2025 04:10:46 +0000 Subject: [PATCH 2/3] chore: regenerate sdk --- src/client.ts | 7 ++- 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 | 10 ++--- src/services/teams.ts | 26 +++++------ 9 files changed, 88 insertions(+), 85 deletions(-) diff --git a/src/client.ts b/src/client.ts index 9a786ee..b93d845 100644 --- a/src/client.ts +++ b/src/client.ts @@ -704,6 +704,7 @@ class Client { const { uri, options } = this.prepareRequest(method, url, headers, params); let data: any = null; + let text: string = ''; const response = await fetch(uri, options); @@ -714,16 +715,18 @@ class Client { if (response.headers.get('content-type')?.includes('application/json')) { data = await response.json(); + text = JSON.stringify(data); } else if (responseType === 'arrayBuffer') { data = await response.arrayBuffer(); } else { + text = await response.text(); 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 b77cbf8..60c9cc3 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -30,7 +30,7 @@ export class Account { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -80,7 +80,7 @@ export class Account { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -121,7 +121,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -150,7 +150,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -179,7 +179,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -204,7 +204,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -233,7 +233,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -265,7 +265,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -294,7 +294,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -330,7 +330,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -359,7 +359,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -391,7 +391,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -430,7 +430,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -455,7 +455,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -480,7 +480,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -505,7 +505,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -530,7 +530,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -562,7 +562,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -598,7 +598,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -637,7 +637,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -662,7 +662,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -694,7 +694,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -733,7 +733,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -781,7 +781,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -806,7 +806,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -831,7 +831,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -856,7 +856,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -897,7 +897,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -936,7 +936,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -1024,7 +1024,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -1063,7 +1063,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1092,7 +1092,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -1121,7 +1121,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -1150,7 +1150,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -1175,7 +1175,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -1218,7 +1218,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1254,7 +1254,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -1283,7 +1283,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -1328,7 +1328,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1378,7 +1378,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1467,7 +1467,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1502,7 +1502,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1541,7 +1541,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -1566,7 +1566,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -1605,7 +1605,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, diff --git a/src/services/databases.ts b/src/services/databases.ts index 875b6d0..f0632b8 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -39,7 +39,7 @@ export class Databases { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -90,7 +90,7 @@ export class Databases { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -131,7 +131,7 @@ export class Databases { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -176,7 +176,7 @@ export class Databases { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -213,7 +213,7 @@ export class Databases { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, diff --git a/src/services/functions.ts b/src/services/functions.ts index ede77f1..df6d48a 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -40,7 +40,7 @@ export class Functions { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -93,7 +93,7 @@ export class Functions { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -126,7 +126,7 @@ export class Functions { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 2938a88..0cb9396 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -35,7 +35,7 @@ export class Graphql { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -68,7 +68,7 @@ export class Graphql { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, diff --git a/src/services/locale.ts b/src/services/locale.ts index 27aa2cd..ebe98aa 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -29,7 +29,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -54,7 +54,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -79,7 +79,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -104,7 +104,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -129,7 +129,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -154,7 +154,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -179,7 +179,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -204,7 +204,7 @@ export class Locale { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 5ae51f4..603c8ef 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -45,7 +45,7 @@ export class Messaging { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -78,7 +78,7 @@ export class Messaging { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, diff --git a/src/services/storage.ts b/src/services/storage.ts index 5153fc0..a70c189 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -41,7 +41,7 @@ export class Storage { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -95,7 +95,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk payload['project'] = this.client.config.project; - return await this.client.chunkedUpload( + return this.client.chunkedUpload( 'post', uri, apiHeaders, @@ -129,7 +129,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -170,7 +170,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -203,7 +203,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, diff --git a/src/services/teams.ts b/src/services/teams.ts index 591b335..fd333b9 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -35,7 +35,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -78,7 +78,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -107,7 +107,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -143,7 +143,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, @@ -172,7 +172,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -209,7 +209,7 @@ export class Teams { payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -272,7 +272,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'post', uri, apiHeaders, @@ -305,7 +305,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -346,7 +346,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -379,7 +379,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'delete', uri, apiHeaders, @@ -429,7 +429,7 @@ If the request is successful, a session for the user is automatically created. payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'patch', uri, apiHeaders, @@ -458,7 +458,7 @@ If the request is successful, a session for the user is automatically created. payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'get', uri, apiHeaders, @@ -494,7 +494,7 @@ If the request is successful, a session for the user is automatically created. payload['project'] = this.client.config.project; - return await this.client.call( + return this.client.call( 'put', uri, apiHeaders, From d6f2f304970f6972394444feeb94b172d2f034f4 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 11 Mar 2025 05:39:27 +0000 Subject: [PATCH 3/3] chore: regenerate sdk --- src/services/account.ts | 237 ++++++++------------------------------ src/services/avatars.ts | 14 +-- src/services/databases.ts | 25 +--- src/services/functions.ts | 15 +-- src/services/graphql.ts | 10 +- src/services/locale.ts | 40 ++----- src/services/messaging.ts | 10 +- src/services/storage.ts | 31 ++--- src/services/teams.ts | 65 +++-------- 9 files changed, 99 insertions(+), 348 deletions(-) diff --git a/src/services/account.ts b/src/services/account.ts index 60c9cc3..2a435bb 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -18,7 +18,7 @@ export class Account { * @throws {AppwriteException} * @returns {Promise>} */ - async get(): Promise> { + get(): Promise> { const apiPath = '/account'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -27,9 +27,6 @@ export class Account { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -47,7 +44,7 @@ export class Account { * @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"'); } @@ -77,9 +74,6 @@ export class Account { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -97,7 +91,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -118,9 +112,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -135,7 +126,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async listIdentities(queries?: string[]): Promise { + listIdentities(queries?: string[]): Promise { const apiPath = '/account/identities'; const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -147,9 +138,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -164,7 +152,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise<{}>} */ - async deleteIdentity(identityId: string): Promise<{}> { + deleteIdentity(identityId: string): Promise<{}> { if (typeof identityId === 'undefined') { throw new AppwriteException('Missing required parameter: "identityId"'); } @@ -176,9 +164,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -192,7 +177,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async createJWT(): Promise { + createJWT(): Promise { const apiPath = '/account/jwts'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -201,9 +186,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -218,7 +200,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async listLogs(queries?: string[]): Promise { + listLogs(queries?: string[]): Promise { const apiPath = '/account/logs'; const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -230,9 +212,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -247,7 +226,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise>} */ - async updateMFA(mfa: boolean): Promise> { + updateMFA(mfa: boolean): Promise> { if (typeof mfa === 'undefined') { throw new AppwriteException('Missing required parameter: "mfa"'); } @@ -262,9 +241,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -279,7 +255,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async createMfaAuthenticator(type: AuthenticatorType): Promise { + createMfaAuthenticator(type: AuthenticatorType): Promise { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } @@ -291,9 +267,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -309,7 +282,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -327,9 +300,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -344,7 +314,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise<{}>} */ - async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { + deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } @@ -356,9 +326,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -373,7 +340,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async createMfaChallenge(factor: AuthenticationFactor): Promise { + createMfaChallenge(factor: AuthenticationFactor): Promise { if (typeof factor === 'undefined') { throw new AppwriteException('Missing required parameter: "factor"'); } @@ -388,9 +355,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -406,7 +370,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -427,9 +391,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -443,7 +404,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async listMfaFactors(): Promise { + listMfaFactors(): Promise { const apiPath = '/account/mfa/factors'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -452,9 +413,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -468,7 +426,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async getMfaRecoveryCodes(): Promise { + getMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -477,9 +435,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -493,7 +448,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async createMfaRecoveryCodes(): Promise { + createMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -502,9 +457,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -518,7 +470,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async updateMfaRecoveryCodes(): Promise { + updateMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -527,9 +479,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -544,7 +493,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise>} */ - async updateName(name: string): Promise> { + updateName(name: string): Promise> { if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } @@ -559,9 +508,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -577,7 +523,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -595,9 +541,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -613,7 +556,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -634,9 +577,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -650,7 +590,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise} */ - async getPrefs(): Promise { + getPrefs(): Promise { const apiPath = '/account/prefs'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -659,9 +599,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -676,7 +613,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @throws {AppwriteException} * @returns {Promise>} */ - async updatePrefs(prefs: Partial): Promise> { + updatePrefs(prefs: Partial): Promise> { if (typeof prefs === 'undefined') { throw new AppwriteException('Missing required parameter: "prefs"'); } @@ -691,9 +628,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -709,7 +643,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, * @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"'); } @@ -730,9 +664,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -751,7 +682,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @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"'); } @@ -778,9 +709,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -794,7 +722,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @throws {AppwriteException} * @returns {Promise} */ - async listSessions(): Promise { + listSessions(): Promise { const apiPath = '/account/sessions'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -803,9 +731,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -819,7 +744,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @throws {AppwriteException} * @returns {Promise<{}>} */ - async deleteSessions(): Promise<{}> { + deleteSessions(): Promise<{}> { const apiPath = '/account/sessions'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -828,9 +753,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -844,7 +766,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @throws {AppwriteException} * @returns {Promise} */ - async createAnonymousSession(): Promise { + createAnonymousSession(): Promise { const apiPath = '/account/sessions/anonymous'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -853,9 +775,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -873,7 +792,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -894,9 +813,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -912,7 +828,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -933,9 +849,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -956,9 +869,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @param {string} failure * @param {string[]} scopes * @throws {AppwriteException} - * @returns {Promise} + * @returns {void | string} */ - async createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise { + createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string { if (typeof provider === 'undefined') { throw new AppwriteException('Missing required parameter: "provider"'); } @@ -984,7 +897,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + if (typeof window !== 'undefined' && window?.location) { window.location.href = uri.toString(); return; @@ -1000,7 +913,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1021,9 +934,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -1039,7 +949,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1060,9 +970,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1077,7 +984,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @throws {AppwriteException} * @returns {Promise} */ - async getSession(sessionId: string): Promise { + getSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -1089,9 +996,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -1106,7 +1010,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @throws {AppwriteException} * @returns {Promise} */ - async updateSession(sessionId: string): Promise { + updateSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -1118,9 +1022,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -1135,7 +1036,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @throws {AppwriteException} * @returns {Promise<{}>} */ - async deleteSession(sessionId: string): Promise<{}> { + deleteSession(sessionId: string): Promise<{}> { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } @@ -1147,9 +1048,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -1163,7 +1061,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @throws {AppwriteException} * @returns {Promise>} */ - async updateStatus(): Promise> { + updateStatus(): Promise> { const apiPath = '/account/status'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1172,9 +1070,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -1191,7 +1086,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1215,9 +1110,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1233,7 +1125,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1251,9 +1143,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -1268,7 +1157,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @throws {AppwriteException} * @returns {Promise<{}>} */ - async deletePushTarget(targetId: string): Promise<{}> { + deletePushTarget(targetId: string): Promise<{}> { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } @@ -1280,9 +1169,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -1301,7 +1187,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1325,9 +1211,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1348,7 +1231,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1375,9 +1258,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1397,9 +1277,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @param {string} failure * @param {string[]} scopes * @throws {AppwriteException} - * @returns {Promise} + * @returns {void | string} */ - async createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise { + createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string { if (typeof provider === 'undefined') { throw new AppwriteException('Missing required parameter: "provider"'); } @@ -1425,7 +1305,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + if (typeof window !== 'undefined' && window?.location) { window.location.href = uri.toString(); return; @@ -1443,7 +1323,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about * @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"'); } @@ -1464,9 +1344,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1484,7 +1361,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @throws {AppwriteException} * @returns {Promise} */ - async createVerification(url: string): Promise { + createVerification(url: string): Promise { if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } @@ -1499,9 +1376,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1517,7 +1391,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @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"'); } @@ -1538,9 +1412,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -1554,7 +1425,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @throws {AppwriteException} * @returns {Promise} */ - async createPhoneVerification(): Promise { + createPhoneVerification(): Promise { const apiPath = '/account/verification/phone'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1563,9 +1434,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -1581,7 +1449,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ * @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"'); } @@ -1602,9 +1470,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, diff --git a/src/services/avatars.ts b/src/services/avatars.ts index fc1c4cb..3d48964 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -50,7 +50,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -92,7 +92,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -124,7 +124,7 @@ This endpoint does not follow HTTP redirects. for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -166,7 +166,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -208,7 +208,7 @@ This endpoint does not follow HTTP redirects. for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -252,7 +252,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -295,7 +295,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } } diff --git a/src/services/databases.ts b/src/services/databases.ts index f0632b8..aea2689 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -18,7 +18,7 @@ export class Databases { * @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"'); } @@ -36,9 +36,6 @@ export class Databases { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -57,7 +54,7 @@ export class Databases { * @throws {AppwriteException} * @returns {Promise} */ - async createDocument(databaseId: string, collectionId: string, documentId: string, data: Omit, permissions?: string[]): Promise { + createDocument(databaseId: string, collectionId: string, documentId: string, data: Omit, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -87,9 +84,6 @@ export class Databases { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -107,7 +101,7 @@ export class Databases { * @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"'); } @@ -128,9 +122,6 @@ export class Databases { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -149,7 +140,7 @@ export class Databases { * @throws {AppwriteException} * @returns {Promise} */ - async updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Partial>, permissions?: string[]): Promise { + updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Partial>, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -173,9 +164,6 @@ export class Databases { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -192,7 +180,7 @@ export class Databases { * @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"'); } @@ -210,9 +198,6 @@ export class Databases { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, diff --git a/src/services/functions.ts b/src/services/functions.ts index df6d48a..6468e12 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -19,7 +19,7 @@ export class Functions { * @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"'); } @@ -37,9 +37,6 @@ export class Functions { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -60,7 +57,7 @@ export class Functions { * @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"'); } @@ -90,9 +87,6 @@ export class Functions { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -108,7 +102,7 @@ export class Functions { * @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"'); } @@ -123,9 +117,6 @@ export class Functions { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 0cb9396..13bff01 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -16,7 +16,7 @@ export class Graphql { * @throws {AppwriteException} * @returns {Promise<{}>} */ - async query(query: object): Promise<{}> { + query(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } @@ -32,9 +32,6 @@ export class Graphql { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -49,7 +46,7 @@ export class Graphql { * @throws {AppwriteException} * @returns {Promise<{}>} */ - async mutation(query: object): Promise<{}> { + mutation(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } @@ -65,9 +62,6 @@ export class Graphql { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, diff --git a/src/services/locale.ts b/src/services/locale.ts index ebe98aa..8dcd5ea 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -17,7 +17,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async get(): Promise { + get(): Promise { const apiPath = '/locale'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -26,9 +26,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -42,7 +39,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listCodes(): Promise { + listCodes(): Promise { const apiPath = '/locale/codes'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -51,9 +48,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -67,7 +61,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listContinents(): Promise { + listContinents(): Promise { const apiPath = '/locale/continents'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -76,9 +70,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -92,7 +83,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listCountries(): Promise { + listCountries(): Promise { const apiPath = '/locale/countries'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -101,9 +92,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -117,7 +105,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listCountriesEU(): Promise { + listCountriesEU(): Promise { const apiPath = '/locale/countries/eu'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -126,9 +114,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -142,7 +127,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listCountriesPhones(): Promise { + listCountriesPhones(): Promise { const apiPath = '/locale/countries/phones'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -151,9 +136,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -167,7 +149,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listCurrencies(): Promise { + listCurrencies(): Promise { const apiPath = '/locale/currencies'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -176,9 +158,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -192,7 +171,7 @@ export class Locale { * @throws {AppwriteException} * @returns {Promise} */ - async listLanguages(): Promise { + listLanguages(): Promise { const apiPath = '/locale/languages'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -201,9 +180,6 @@ export class Locale { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 603c8ef..a438c89 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -18,7 +18,7 @@ export class Messaging { * @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"'); } @@ -42,9 +42,6 @@ export class Messaging { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -60,7 +57,7 @@ export class Messaging { * @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"'); } @@ -75,9 +72,6 @@ export class Messaging { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, diff --git a/src/services/storage.ts b/src/services/storage.ts index a70c189..00791d7 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -20,7 +20,7 @@ export class Storage { * @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"'); } @@ -38,9 +38,6 @@ export class Storage { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -65,7 +62,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * @throws {AppwriteException} * @returns {Promise} */ - async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise { + createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -92,9 +89,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'multipart/form-data', } - payload['project'] = this.client.config.project; - - return this.client.chunkedUpload( 'post', uri, @@ -111,7 +105,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * @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"'); } @@ -126,9 +120,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -146,7 +137,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * @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"'); } @@ -167,9 +158,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -185,7 +173,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * @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"'); } @@ -200,9 +188,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -238,7 +223,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -313,7 +298,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } /** @@ -344,7 +329,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - + return uri.toString(); } } diff --git a/src/services/teams.ts b/src/services/teams.ts index fd333b9..4622f33 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -17,7 +17,7 @@ export class Teams { * @throws {AppwriteException} * @returns {Promise>} */ - async list(queries?: string[], search?: string): Promise> { + list(queries?: string[], search?: string): Promise> { const apiPath = '/teams'; const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -32,9 +32,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -51,7 +48,7 @@ export class Teams { * @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"'); } @@ -75,9 +72,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -92,7 +86,7 @@ export class Teams { * @throws {AppwriteException} * @returns {Promise>} */ - async get(teamId: string): Promise> { + get(teamId: string): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -104,9 +98,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -122,7 +113,7 @@ export class Teams { * @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,9 +131,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri, @@ -157,7 +145,7 @@ export class Teams { * @throws {AppwriteException} * @returns {Promise<{}>} */ - async delete(teamId: string): Promise<{}> { + delete(teamId: string): Promise<{}> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -169,9 +157,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -188,7 +173,7 @@ export class Teams { * @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"'); } @@ -206,9 +191,6 @@ export class Teams { 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -236,7 +218,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee * @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"'); } @@ -269,9 +251,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'post', uri, @@ -287,7 +266,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee * @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,9 +281,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -322,7 +298,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee * @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"'); } @@ -343,9 +319,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -361,7 +334,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee * @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"'); } @@ -376,9 +349,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'delete', uri, @@ -399,7 +369,7 @@ If the request is successful, a session for the user is automatically created. * @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"'); } @@ -426,9 +396,6 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'patch', uri, @@ -443,7 +410,7 @@ If the request is successful, a session for the user is automatically created. * @throws {AppwriteException} * @returns {Promise} */ - async getPrefs(teamId: string): Promise { + getPrefs(teamId: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -455,9 +422,6 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'get', uri, @@ -473,7 +437,7 @@ If the request is successful, a session for the user is automatically created. * @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"'); } @@ -491,9 +455,6 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } - payload['project'] = this.client.config.project; - - return this.client.call( 'put', uri,