@appwrite.io/console 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +45 -6
- package/README.md +82 -2
- package/dist/cjs/sdk.js +532 -200
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +533 -201
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +532 -200
- package/docs/examples/databases/create-document.md +1 -3
- package/docs/examples/databases/create-documents.md +1 -1
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/docs/examples/databases/upsert-documents.md +1 -1
- package/docs/examples/domains/create-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/create-record-a.md +1 -1
- package/docs/examples/domains/create-record-alias.md +1 -1
- package/docs/examples/domains/create-record-c-a-a.md +1 -1
- package/docs/examples/domains/create-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/create-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/create-record-m-x.md +1 -1
- package/docs/examples/domains/create-record-n-s.md +1 -1
- package/docs/examples/domains/create-record-s-r-v.md +1 -1
- package/docs/examples/domains/create-record-t-x-t.md +1 -1
- package/docs/examples/domains/update-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/update-record-a.md +1 -1
- package/docs/examples/domains/update-record-alias.md +1 -1
- package/docs/examples/domains/update-record-c-a-a.md +1 -1
- package/docs/examples/domains/update-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/update-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/update-record-m-x.md +1 -1
- package/docs/examples/domains/update-record-n-s.md +1 -1
- package/docs/examples/domains/update-record-s-r-v.md +1 -1
- package/docs/examples/domains/update-record-t-x-t.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/health/{get-queue-stats-usage-dump.md → get-queue-billing-project-aggregation.md} +2 -2
- package/docs/examples/health/{get-queue-billing-aggregation.md → get-queue-billing-team-aggregation.md} +1 -1
- package/docs/examples/organizations/cancel-downgrade.md +13 -0
- package/docs/examples/organizations/estimation-create-organization.md +16 -0
- package/docs/examples/organizations/estimation-delete-organization.md +13 -0
- package/docs/examples/organizations/estimation-update-plan.md +16 -0
- package/docs/examples/organizations/get-available-credits.md +13 -0
- package/docs/examples/organizations/get-usage.md +1 -1
- package/docs/examples/organizations/update-projects.md +14 -0
- package/docs/examples/organizations/validate-payment.md +14 -0
- package/docs/examples/proxy/create-redirect-rule.md +4 -2
- package/docs/examples/vcs/get-repository-contents.md +2 -1
- package/package.json +1 -1
- package/src/client.ts +5 -4
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/image-format.ts +1 -0
- package/src/enums/proxy-resource-type.ts +4 -0
- package/src/enums/runtime.ts +2 -0
- package/src/index.ts +1 -0
- package/src/models.ts +513 -11
- package/src/services/account.ts +97 -36
- package/src/services/avatars.ts +26 -20
- package/src/services/backups.ts +11 -0
- package/src/services/console.ts +8 -1
- package/src/services/databases.ts +190 -31
- package/src/services/domains.ts +111 -69
- package/src/services/functions.ts +37 -8
- package/src/services/graphql.ts +1 -0
- package/src/services/health.ts +54 -4
- package/src/services/locale.ts +9 -2
- package/src/services/messaging.ts +53 -8
- package/src/services/migrations.ts +12 -0
- package/src/services/organizations.ts +301 -14
- package/src/services/project.ts +5 -0
- package/src/services/projects.ts +50 -0
- package/src/services/proxy.ts +23 -1
- package/src/services/sites.ts +32 -4
- package/src/services/storage.ts +23 -9
- package/src/services/teams.ts +30 -17
- package/src/services/tokens.ts +4 -0
- package/src/services/users.ts +69 -27
- package/src/services/vcs.ts +16 -4
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/image-format.d.ts +2 -1
- package/types/enums/proxy-resource-type.d.ts +4 -0
- package/types/enums/runtime.d.ts +3 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +494 -188
- package/types/services/account.d.ts +36 -36
- package/types/services/avatars.d.ts +20 -20
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +67 -31
- package/types/services/domains.d.ts +69 -69
- package/types/services/functions.d.ts +8 -8
- package/types/services/health.d.ts +11 -3
- package/types/services/locale.d.ts +2 -2
- package/types/services/messaging.d.ts +8 -8
- package/types/services/organizations.d.ts +88 -14
- package/types/services/proxy.d.ts +4 -1
- package/types/services/sites.d.ts +4 -4
- package/types/services/storage.d.ts +9 -9
- package/types/services/teams.d.ts +17 -17
- package/types/services/users.d.ts +27 -27
- package/types/services/vcs.d.ts +4 -4
- package/docs/examples/functions/create-build.md +0 -15
- package/docs/examples/functions/get-function-usage.md +0 -14
- package/docs/examples/functions/update-deployment-build.md +0 -14
- package/docs/examples/functions/update-deployment.md +0 -14
- package/docs/examples/proxy/create-rule.md +0 -15
- package/src/enums/resource-type.ts +0 -4
- package/types/enums/resource-type.d.ts +0 -4
|
@@ -12,7 +12,7 @@ export declare class Account {
|
|
|
12
12
|
* @throws {AppwriteException}
|
|
13
13
|
* @returns {Promise<Models.User<Preferences>>}
|
|
14
14
|
*/
|
|
15
|
-
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
|
|
15
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
|
|
16
16
|
/**
|
|
17
17
|
* 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).
|
|
18
18
|
*
|
|
@@ -23,7 +23,7 @@ export declare class Account {
|
|
|
23
23
|
* @throws {AppwriteException}
|
|
24
24
|
* @returns {Promise<Models.User<Preferences>>}
|
|
25
25
|
*/
|
|
26
|
-
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
26
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
27
27
|
/**
|
|
28
28
|
* Delete the currently logged in user.
|
|
29
29
|
*
|
|
@@ -92,15 +92,15 @@ export declare class Account {
|
|
|
92
92
|
getCoupon(couponId: string): Promise<Models.Coupon>;
|
|
93
93
|
/**
|
|
94
94
|
* 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.
|
|
95
|
-
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
96
|
-
|
|
95
|
+
* This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
96
|
+
*
|
|
97
97
|
*
|
|
98
98
|
* @param {string} email
|
|
99
99
|
* @param {string} password
|
|
100
100
|
* @throws {AppwriteException}
|
|
101
101
|
* @returns {Promise<Models.User<Preferences>>}
|
|
102
102
|
*/
|
|
103
|
-
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
|
|
103
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>>;
|
|
104
104
|
/**
|
|
105
105
|
* Get the list of identities for the currently logged in user.
|
|
106
106
|
*
|
|
@@ -147,7 +147,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
147
147
|
* @throws {AppwriteException}
|
|
148
148
|
* @returns {Promise<Models.User<Preferences>>}
|
|
149
149
|
*/
|
|
150
|
-
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
|
|
150
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>>;
|
|
151
151
|
/**
|
|
152
152
|
* 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.
|
|
153
153
|
*
|
|
@@ -164,7 +164,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
164
164
|
* @throws {AppwriteException}
|
|
165
165
|
* @returns {Promise<Models.User<Preferences>>}
|
|
166
166
|
*/
|
|
167
|
-
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
|
|
167
|
+
updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
|
|
168
168
|
/**
|
|
169
169
|
* Delete an authenticator for a user by ID.
|
|
170
170
|
*
|
|
@@ -225,7 +225,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
225
225
|
* @throws {AppwriteException}
|
|
226
226
|
* @returns {Promise<Models.User<Preferences>>}
|
|
227
227
|
*/
|
|
228
|
-
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
|
|
228
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>>;
|
|
229
229
|
/**
|
|
230
230
|
* 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.
|
|
231
231
|
*
|
|
@@ -234,7 +234,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
234
234
|
* @throws {AppwriteException}
|
|
235
235
|
* @returns {Promise<Models.User<Preferences>>}
|
|
236
236
|
*/
|
|
237
|
-
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
|
|
237
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
|
|
238
238
|
/**
|
|
239
239
|
* List payment methods for this account.
|
|
240
240
|
*
|
|
@@ -302,14 +302,14 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
302
302
|
* @throws {AppwriteException}
|
|
303
303
|
* @returns {Promise<Models.User<Preferences>>}
|
|
304
304
|
*/
|
|
305
|
-
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
|
|
305
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
|
|
306
306
|
/**
|
|
307
307
|
* Get the preferences as a key-value object for the currently logged in user.
|
|
308
308
|
*
|
|
309
309
|
* @throws {AppwriteException}
|
|
310
310
|
* @returns {Promise<Preferences>}
|
|
311
311
|
*/
|
|
312
|
-
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
|
|
312
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences>;
|
|
313
313
|
/**
|
|
314
314
|
* 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.
|
|
315
315
|
*
|
|
@@ -317,7 +317,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
317
317
|
* @throws {AppwriteException}
|
|
318
318
|
* @returns {Promise<Models.User<Preferences>>}
|
|
319
319
|
*/
|
|
320
|
-
updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
|
|
320
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
|
|
321
321
|
/**
|
|
322
322
|
* 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.
|
|
323
323
|
*
|
|
@@ -329,8 +329,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
329
329
|
createRecovery(email: string, url: string): Promise<Models.Token>;
|
|
330
330
|
/**
|
|
331
331
|
* 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.
|
|
332
|
-
|
|
333
|
-
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.
|
|
332
|
+
*
|
|
333
|
+
* 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.
|
|
334
334
|
*
|
|
335
335
|
* @param {string} userId
|
|
336
336
|
* @param {string} secret
|
|
@@ -362,8 +362,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
362
362
|
createAnonymousSession(): Promise<Models.Session>;
|
|
363
363
|
/**
|
|
364
364
|
* 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.
|
|
365
|
-
|
|
366
|
-
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).
|
|
365
|
+
*
|
|
366
|
+
* 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).
|
|
367
367
|
*
|
|
368
368
|
* @param {string} email
|
|
369
369
|
* @param {string} password
|
|
@@ -382,11 +382,11 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
382
382
|
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
|
|
383
383
|
/**
|
|
384
384
|
* 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.
|
|
385
|
-
|
|
386
|
-
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.
|
|
387
|
-
|
|
388
|
-
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).
|
|
389
|
-
|
|
385
|
+
*
|
|
386
|
+
* 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.
|
|
387
|
+
*
|
|
388
|
+
* 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).
|
|
389
|
+
*
|
|
390
390
|
*
|
|
391
391
|
* @param {OAuthProvider} provider
|
|
392
392
|
* @param {string} success
|
|
@@ -444,7 +444,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
444
444
|
* @throws {AppwriteException}
|
|
445
445
|
* @returns {Promise<Models.User<Preferences>>}
|
|
446
446
|
*/
|
|
447
|
-
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
|
|
447
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
|
|
448
448
|
/**
|
|
449
449
|
* 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.
|
|
450
450
|
*
|
|
@@ -474,8 +474,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
474
474
|
deletePushTarget(targetId: string): Promise<{}>;
|
|
475
475
|
/**
|
|
476
476
|
* 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.
|
|
477
|
-
|
|
478
|
-
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).
|
|
477
|
+
*
|
|
478
|
+
* 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).
|
|
479
479
|
*
|
|
480
480
|
* @param {string} userId
|
|
481
481
|
* @param {string} email
|
|
@@ -486,9 +486,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
486
486
|
createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
|
|
487
487
|
/**
|
|
488
488
|
* 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.
|
|
489
|
-
|
|
490
|
-
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).
|
|
491
|
-
|
|
489
|
+
*
|
|
490
|
+
* 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).
|
|
491
|
+
*
|
|
492
492
|
*
|
|
493
493
|
* @param {string} userId
|
|
494
494
|
* @param {string} email
|
|
@@ -500,10 +500,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
500
500
|
createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
|
|
501
501
|
/**
|
|
502
502
|
* 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.
|
|
503
|
-
|
|
504
|
-
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.
|
|
505
|
-
|
|
506
|
-
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).
|
|
503
|
+
*
|
|
504
|
+
* 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.
|
|
505
|
+
*
|
|
506
|
+
* 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).
|
|
507
507
|
*
|
|
508
508
|
* @param {OAuthProvider} provider
|
|
509
509
|
* @param {string} success
|
|
@@ -515,8 +515,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
515
515
|
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string;
|
|
516
516
|
/**
|
|
517
517
|
* 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.
|
|
518
|
-
|
|
519
|
-
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).
|
|
518
|
+
*
|
|
519
|
+
* 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).
|
|
520
520
|
*
|
|
521
521
|
* @param {string} userId
|
|
522
522
|
* @param {string} phone
|
|
@@ -526,9 +526,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
526
526
|
createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
|
|
527
527
|
/**
|
|
528
528
|
* 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.
|
|
529
|
-
|
|
530
|
-
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.
|
|
531
|
-
|
|
529
|
+
*
|
|
530
|
+
* 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.
|
|
531
|
+
*
|
|
532
532
|
*
|
|
533
533
|
* @param {string} url
|
|
534
534
|
* @throws {AppwriteException}
|
|
@@ -7,8 +7,8 @@ export declare class Avatars {
|
|
|
7
7
|
constructor(client: Client);
|
|
8
8
|
/**
|
|
9
9
|
* 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.
|
|
10
|
-
|
|
11
|
-
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.
|
|
10
|
+
*
|
|
11
|
+
* 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.
|
|
12
12
|
*
|
|
13
13
|
* @param {Browser} code
|
|
14
14
|
* @param {number} width
|
|
@@ -20,9 +20,9 @@ When one dimension is specified and the other is 0, the image is scaled with pre
|
|
|
20
20
|
getBrowser(code: Browser, width?: number, height?: number, quality?: number): string;
|
|
21
21
|
/**
|
|
22
22
|
* 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.
|
|
23
|
-
|
|
24
|
-
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.
|
|
25
|
-
|
|
23
|
+
*
|
|
24
|
+
* 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.
|
|
25
|
+
*
|
|
26
26
|
*
|
|
27
27
|
* @param {CreditCard} code
|
|
28
28
|
* @param {number} width
|
|
@@ -34,8 +34,8 @@ When one dimension is specified and the other is 0, the image is scaled with pre
|
|
|
34
34
|
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): string;
|
|
35
35
|
/**
|
|
36
36
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
|
37
|
-
|
|
38
|
-
This endpoint does not follow HTTP redirects.
|
|
37
|
+
*
|
|
38
|
+
* This endpoint does not follow HTTP redirects.
|
|
39
39
|
*
|
|
40
40
|
* @param {string} url
|
|
41
41
|
* @throws {AppwriteException}
|
|
@@ -44,9 +44,9 @@ This endpoint does not follow HTTP redirects.
|
|
|
44
44
|
getFavicon(url: string): string;
|
|
45
45
|
/**
|
|
46
46
|
* 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.
|
|
47
|
-
|
|
48
|
-
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.
|
|
49
|
-
|
|
47
|
+
*
|
|
48
|
+
* 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.
|
|
49
|
+
*
|
|
50
50
|
*
|
|
51
51
|
* @param {Flag} code
|
|
52
52
|
* @param {number} width
|
|
@@ -58,10 +58,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
|
|
|
58
58
|
getFlag(code: Flag, width?: number, height?: number, quality?: number): string;
|
|
59
59
|
/**
|
|
60
60
|
* 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.
|
|
61
|
-
|
|
62
|
-
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.
|
|
63
|
-
|
|
64
|
-
This endpoint does not follow HTTP redirects.
|
|
61
|
+
*
|
|
62
|
+
* 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.
|
|
63
|
+
*
|
|
64
|
+
* This endpoint does not follow HTTP redirects.
|
|
65
65
|
*
|
|
66
66
|
* @param {string} url
|
|
67
67
|
* @param {number} width
|
|
@@ -72,11 +72,11 @@ This endpoint does not follow HTTP redirects.
|
|
|
72
72
|
getImage(url: string, width?: number, height?: number): string;
|
|
73
73
|
/**
|
|
74
74
|
* 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.
|
|
75
|
-
|
|
76
|
-
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.
|
|
77
|
-
|
|
78
|
-
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.
|
|
79
|
-
|
|
75
|
+
*
|
|
76
|
+
* 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.
|
|
77
|
+
*
|
|
78
|
+
* 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.
|
|
79
|
+
*
|
|
80
80
|
*
|
|
81
81
|
* @param {string} name
|
|
82
82
|
* @param {number} width
|
|
@@ -88,7 +88,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre
|
|
|
88
88
|
getInitials(name?: string, width?: number, height?: number, background?: string): string;
|
|
89
89
|
/**
|
|
90
90
|
* 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.
|
|
91
|
-
|
|
91
|
+
*
|
|
92
92
|
*
|
|
93
93
|
* @param {string} text
|
|
94
94
|
* @param {number} size
|
|
@@ -34,7 +34,7 @@ export declare class Console {
|
|
|
34
34
|
* @throws {AppwriteException}
|
|
35
35
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
36
36
|
*/
|
|
37
|
-
createProgramMembership<Preferences extends Models.Preferences>(programId: string): Promise<Models.Organization<Preferences>>;
|
|
37
|
+
createProgramMembership<Preferences extends Models.Preferences = Models.DefaultPreferences>(programId: string): Promise<Models.Organization<Preferences>>;
|
|
38
38
|
/**
|
|
39
39
|
* Get all available regions for the console.
|
|
40
40
|
*
|
|
@@ -18,7 +18,7 @@ export declare class Databases {
|
|
|
18
18
|
list(queries?: string[], search?: string): Promise<Models.DatabaseList>;
|
|
19
19
|
/**
|
|
20
20
|
* Create a new Database.
|
|
21
|
-
|
|
21
|
+
*
|
|
22
22
|
*
|
|
23
23
|
* @param {string} databaseId
|
|
24
24
|
* @param {string} name
|
|
@@ -127,7 +127,7 @@ export declare class Databases {
|
|
|
127
127
|
listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList>;
|
|
128
128
|
/**
|
|
129
129
|
* Create a boolean attribute.
|
|
130
|
-
|
|
130
|
+
*
|
|
131
131
|
*
|
|
132
132
|
* @param {string} databaseId
|
|
133
133
|
* @param {string} collectionId
|
|
@@ -180,7 +180,7 @@ export declare class Databases {
|
|
|
180
180
|
updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime>;
|
|
181
181
|
/**
|
|
182
182
|
* Create an email attribute.
|
|
183
|
-
|
|
183
|
+
*
|
|
184
184
|
*
|
|
185
185
|
* @param {string} databaseId
|
|
186
186
|
* @param {string} collectionId
|
|
@@ -194,7 +194,7 @@ export declare class Databases {
|
|
|
194
194
|
createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
|
|
195
195
|
/**
|
|
196
196
|
* Update an email attribute. Changing the `default` value will not update already existing documents.
|
|
197
|
-
|
|
197
|
+
*
|
|
198
198
|
*
|
|
199
199
|
* @param {string} databaseId
|
|
200
200
|
* @param {string} collectionId
|
|
@@ -208,7 +208,7 @@ export declare class Databases {
|
|
|
208
208
|
updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail>;
|
|
209
209
|
/**
|
|
210
210
|
* Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
|
|
211
|
-
|
|
211
|
+
*
|
|
212
212
|
*
|
|
213
213
|
* @param {string} databaseId
|
|
214
214
|
* @param {string} collectionId
|
|
@@ -223,7 +223,7 @@ export declare class Databases {
|
|
|
223
223
|
createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
|
|
224
224
|
/**
|
|
225
225
|
* Update an enum attribute. Changing the `default` value will not update already existing documents.
|
|
226
|
-
|
|
226
|
+
*
|
|
227
227
|
*
|
|
228
228
|
* @param {string} databaseId
|
|
229
229
|
* @param {string} collectionId
|
|
@@ -238,7 +238,7 @@ export declare class Databases {
|
|
|
238
238
|
updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum>;
|
|
239
239
|
/**
|
|
240
240
|
* Create a float attribute. Optionally, minimum and maximum values can be provided.
|
|
241
|
-
|
|
241
|
+
*
|
|
242
242
|
*
|
|
243
243
|
* @param {string} databaseId
|
|
244
244
|
* @param {string} collectionId
|
|
@@ -254,7 +254,7 @@ export declare class Databases {
|
|
|
254
254
|
createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
|
|
255
255
|
/**
|
|
256
256
|
* Update a float attribute. Changing the `default` value will not update already existing documents.
|
|
257
|
-
|
|
257
|
+
*
|
|
258
258
|
*
|
|
259
259
|
* @param {string} databaseId
|
|
260
260
|
* @param {string} collectionId
|
|
@@ -270,7 +270,7 @@ export declare class Databases {
|
|
|
270
270
|
updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat>;
|
|
271
271
|
/**
|
|
272
272
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
273
|
-
|
|
273
|
+
*
|
|
274
274
|
*
|
|
275
275
|
* @param {string} databaseId
|
|
276
276
|
* @param {string} collectionId
|
|
@@ -286,7 +286,7 @@ export declare class Databases {
|
|
|
286
286
|
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
|
|
287
287
|
/**
|
|
288
288
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
289
|
-
|
|
289
|
+
*
|
|
290
290
|
*
|
|
291
291
|
* @param {string} databaseId
|
|
292
292
|
* @param {string} collectionId
|
|
@@ -302,7 +302,7 @@ export declare class Databases {
|
|
|
302
302
|
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
|
|
303
303
|
/**
|
|
304
304
|
* Create IP address attribute.
|
|
305
|
-
|
|
305
|
+
*
|
|
306
306
|
*
|
|
307
307
|
* @param {string} databaseId
|
|
308
308
|
* @param {string} collectionId
|
|
@@ -316,7 +316,7 @@ export declare class Databases {
|
|
|
316
316
|
createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
|
|
317
317
|
/**
|
|
318
318
|
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
319
|
-
|
|
319
|
+
*
|
|
320
320
|
*
|
|
321
321
|
* @param {string} databaseId
|
|
322
322
|
* @param {string} collectionId
|
|
@@ -330,7 +330,7 @@ export declare class Databases {
|
|
|
330
330
|
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp>;
|
|
331
331
|
/**
|
|
332
332
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
333
|
-
|
|
333
|
+
*
|
|
334
334
|
*
|
|
335
335
|
* @param {string} databaseId
|
|
336
336
|
* @param {string} collectionId
|
|
@@ -346,7 +346,7 @@ export declare class Databases {
|
|
|
346
346
|
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
|
|
347
347
|
/**
|
|
348
348
|
* Create a string attribute.
|
|
349
|
-
|
|
349
|
+
*
|
|
350
350
|
*
|
|
351
351
|
* @param {string} databaseId
|
|
352
352
|
* @param {string} collectionId
|
|
@@ -362,7 +362,7 @@ export declare class Databases {
|
|
|
362
362
|
createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
|
|
363
363
|
/**
|
|
364
364
|
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
365
|
-
|
|
365
|
+
*
|
|
366
366
|
*
|
|
367
367
|
* @param {string} databaseId
|
|
368
368
|
* @param {string} collectionId
|
|
@@ -377,7 +377,7 @@ export declare class Databases {
|
|
|
377
377
|
updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
|
|
378
378
|
/**
|
|
379
379
|
* Create a URL attribute.
|
|
380
|
-
|
|
380
|
+
*
|
|
381
381
|
*
|
|
382
382
|
* @param {string} databaseId
|
|
383
383
|
* @param {string} collectionId
|
|
@@ -391,7 +391,7 @@ export declare class Databases {
|
|
|
391
391
|
createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
|
|
392
392
|
/**
|
|
393
393
|
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
394
|
-
|
|
394
|
+
*
|
|
395
395
|
*
|
|
396
396
|
* @param {string} databaseId
|
|
397
397
|
* @param {string} collectionId
|
|
@@ -425,7 +425,7 @@ export declare class Databases {
|
|
|
425
425
|
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
|
|
426
426
|
/**
|
|
427
427
|
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
428
|
-
|
|
428
|
+
*
|
|
429
429
|
*
|
|
430
430
|
* @param {string} databaseId
|
|
431
431
|
* @param {string} collectionId
|
|
@@ -445,20 +445,22 @@ export declare class Databases {
|
|
|
445
445
|
* @throws {AppwriteException}
|
|
446
446
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
447
447
|
*/
|
|
448
|
-
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
448
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
449
449
|
/**
|
|
450
450
|
* 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.
|
|
451
451
|
*
|
|
452
452
|
* @param {string} databaseId
|
|
453
453
|
* @param {string} collectionId
|
|
454
454
|
* @param {string} documentId
|
|
455
|
-
* @param {Omit<Document, keyof Models.Document>} data
|
|
455
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data
|
|
456
456
|
* @param {string[]} permissions
|
|
457
457
|
* @throws {AppwriteException}
|
|
458
458
|
* @returns {Promise<Document>}
|
|
459
459
|
*/
|
|
460
|
-
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
|
|
460
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
|
|
461
461
|
/**
|
|
462
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
463
|
+
*
|
|
462
464
|
* Create new Documents. 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.
|
|
463
465
|
*
|
|
464
466
|
* @param {string} databaseId
|
|
@@ -467,10 +469,12 @@ export declare class Databases {
|
|
|
467
469
|
* @throws {AppwriteException}
|
|
468
470
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
469
471
|
*/
|
|
470
|
-
createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
472
|
+
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
471
473
|
/**
|
|
474
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
475
|
+
*
|
|
472
476
|
* Create or update Documents. 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.
|
|
473
|
-
|
|
477
|
+
*
|
|
474
478
|
*
|
|
475
479
|
* @param {string} databaseId
|
|
476
480
|
* @param {string} collectionId
|
|
@@ -478,8 +482,10 @@ export declare class Databases {
|
|
|
478
482
|
* @throws {AppwriteException}
|
|
479
483
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
480
484
|
*/
|
|
481
|
-
upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents
|
|
485
|
+
upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
482
486
|
/**
|
|
487
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
488
|
+
*
|
|
483
489
|
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
|
|
484
490
|
*
|
|
485
491
|
* @param {string} databaseId
|
|
@@ -489,8 +495,10 @@ export declare class Databases {
|
|
|
489
495
|
* @throws {AppwriteException}
|
|
490
496
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
491
497
|
*/
|
|
492
|
-
updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
498
|
+
updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
493
499
|
/**
|
|
500
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
501
|
+
*
|
|
494
502
|
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
495
503
|
*
|
|
496
504
|
* @param {string} databaseId
|
|
@@ -499,7 +507,7 @@ export declare class Databases {
|
|
|
499
507
|
* @throws {AppwriteException}
|
|
500
508
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
501
509
|
*/
|
|
502
|
-
deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
510
|
+
deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
503
511
|
/**
|
|
504
512
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
505
513
|
*
|
|
@@ -510,8 +518,10 @@ export declare class Databases {
|
|
|
510
518
|
* @throws {AppwriteException}
|
|
511
519
|
* @returns {Promise<Document>}
|
|
512
520
|
*/
|
|
513
|
-
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
521
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
514
522
|
/**
|
|
523
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
524
|
+
*
|
|
515
525
|
* Create or update a 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.
|
|
516
526
|
*
|
|
517
527
|
* @param {string} databaseId
|
|
@@ -522,19 +532,19 @@ export declare class Databases {
|
|
|
522
532
|
* @throws {AppwriteException}
|
|
523
533
|
* @returns {Promise<Document>}
|
|
524
534
|
*/
|
|
525
|
-
upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
535
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
526
536
|
/**
|
|
527
537
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
528
538
|
*
|
|
529
539
|
* @param {string} databaseId
|
|
530
540
|
* @param {string} collectionId
|
|
531
541
|
* @param {string} documentId
|
|
532
|
-
* @param {Partial<Omit<Document, keyof Models.Document>>} data
|
|
542
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data
|
|
533
543
|
* @param {string[]} permissions
|
|
534
544
|
* @throws {AppwriteException}
|
|
535
545
|
* @returns {Promise<Document>}
|
|
536
546
|
*/
|
|
537
|
-
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
|
|
547
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
|
|
538
548
|
/**
|
|
539
549
|
* Delete a document by its unique ID.
|
|
540
550
|
*
|
|
@@ -556,6 +566,32 @@ export declare class Databases {
|
|
|
556
566
|
* @returns {Promise<Models.LogList>}
|
|
557
567
|
*/
|
|
558
568
|
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList>;
|
|
569
|
+
/**
|
|
570
|
+
* Decrement a specific attribute of a document by a given value.
|
|
571
|
+
*
|
|
572
|
+
* @param {string} databaseId
|
|
573
|
+
* @param {string} collectionId
|
|
574
|
+
* @param {string} documentId
|
|
575
|
+
* @param {string} attribute
|
|
576
|
+
* @param {number} value
|
|
577
|
+
* @param {number} min
|
|
578
|
+
* @throws {AppwriteException}
|
|
579
|
+
* @returns {Promise<Document>}
|
|
580
|
+
*/
|
|
581
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
|
|
582
|
+
/**
|
|
583
|
+
* Increment a specific attribute of a document by a given value.
|
|
584
|
+
*
|
|
585
|
+
* @param {string} databaseId
|
|
586
|
+
* @param {string} collectionId
|
|
587
|
+
* @param {string} documentId
|
|
588
|
+
* @param {string} attribute
|
|
589
|
+
* @param {number} value
|
|
590
|
+
* @param {number} max
|
|
591
|
+
* @throws {AppwriteException}
|
|
592
|
+
* @returns {Promise<Document>}
|
|
593
|
+
*/
|
|
594
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
|
|
559
595
|
/**
|
|
560
596
|
* List indexes in the collection.
|
|
561
597
|
*
|
|
@@ -568,7 +604,7 @@ export declare class Databases {
|
|
|
568
604
|
listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
|
|
569
605
|
/**
|
|
570
606
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
571
|
-
Attributes can be `key`, `fulltext`, and `unique`.
|
|
607
|
+
* Attributes can be `key`, `fulltext`, and `unique`.
|
|
572
608
|
*
|
|
573
609
|
* @param {string} databaseId
|
|
574
610
|
* @param {string} collectionId
|