react-native-appwrite 0.10.0 → 0.11.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 +12 -1
- package/dist/cjs/sdk.js +333 -97
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +333 -97
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/databases/create-document.md +1 -3
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/image-format.ts +1 -0
- package/src/models.ts +79 -6
- package/src/services/account.ts +58 -58
- package/src/services/avatars.ts +42 -7
- package/src/services/databases.ts +107 -11
- package/src/services/functions.ts +3 -3
- package/src/services/graphql.ts +2 -2
- package/src/services/locale.ts +8 -8
- package/src/services/messaging.ts +2 -2
- package/src/services/storage.ts +23 -8
- package/src/services/teams.ts +19 -19
- package/types/enums/image-format.d.ts +2 -1
- package/types/models.d.ts +68 -47
- package/types/services/account.d.ts +58 -58
- package/types/services/avatars.d.ts +7 -7
- package/types/services/databases.d.ts +41 -11
- package/types/services/functions.d.ts +3 -3
- package/types/services/graphql.d.ts +2 -2
- package/types/services/locale.d.ts +8 -8
- package/types/services/messaging.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/types/services/teams.d.ts +19 -19
|
@@ -11,8 +11,8 @@ export declare class Account extends Service {
|
|
|
11
11
|
*
|
|
12
12
|
* @throws {AppwriteException}
|
|
13
13
|
* @returns {Promise}
|
|
14
|
-
|
|
15
|
-
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
|
|
14
|
+
*/
|
|
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
|
|
18
18
|
* project. After the user registration completes successfully, you can use
|
|
@@ -28,8 +28,8 @@ export declare class Account extends Service {
|
|
|
28
28
|
* @param {string} name
|
|
29
29
|
* @throws {AppwriteException}
|
|
30
30
|
* @returns {Promise}
|
|
31
|
-
|
|
32
|
-
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
31
|
+
*/
|
|
32
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
33
33
|
/**
|
|
34
34
|
* Update currently logged in user account email address. After changing user
|
|
35
35
|
* address, the user confirmation status will get reset. A new confirmation
|
|
@@ -44,15 +44,15 @@ export declare class Account extends Service {
|
|
|
44
44
|
* @param {string} password
|
|
45
45
|
* @throws {AppwriteException}
|
|
46
46
|
* @returns {Promise}
|
|
47
|
-
|
|
48
|
-
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
|
|
47
|
+
*/
|
|
48
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>>;
|
|
49
49
|
/**
|
|
50
50
|
* Get the list of identities for the currently logged in user.
|
|
51
51
|
*
|
|
52
52
|
* @param {string[]} queries
|
|
53
53
|
* @throws {AppwriteException}
|
|
54
54
|
* @returns {Promise}
|
|
55
|
-
|
|
55
|
+
*/
|
|
56
56
|
listIdentities(queries?: string[]): Promise<Models.IdentityList>;
|
|
57
57
|
/**
|
|
58
58
|
* Delete an identity by its unique ID.
|
|
@@ -60,7 +60,7 @@ export declare class Account extends Service {
|
|
|
60
60
|
* @param {string} identityId
|
|
61
61
|
* @throws {AppwriteException}
|
|
62
62
|
* @returns {Promise}
|
|
63
|
-
|
|
63
|
+
*/
|
|
64
64
|
deleteIdentity(identityId: string): Promise<{}>;
|
|
65
65
|
/**
|
|
66
66
|
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
@@ -71,7 +71,7 @@ export declare class Account extends Service {
|
|
|
71
71
|
*
|
|
72
72
|
* @throws {AppwriteException}
|
|
73
73
|
* @returns {Promise}
|
|
74
|
-
|
|
74
|
+
*/
|
|
75
75
|
createJWT(): Promise<Models.Jwt>;
|
|
76
76
|
/**
|
|
77
77
|
* Get the list of latest security activity logs for the currently logged in
|
|
@@ -80,7 +80,7 @@ export declare class Account extends Service {
|
|
|
80
80
|
* @param {string[]} queries
|
|
81
81
|
* @throws {AppwriteException}
|
|
82
82
|
* @returns {Promise}
|
|
83
|
-
|
|
83
|
+
*/
|
|
84
84
|
listLogs(queries?: string[]): Promise<Models.LogList>;
|
|
85
85
|
/**
|
|
86
86
|
* Enable or disable MFA on an account.
|
|
@@ -88,8 +88,8 @@ export declare class Account extends Service {
|
|
|
88
88
|
* @param {boolean} mfa
|
|
89
89
|
* @throws {AppwriteException}
|
|
90
90
|
* @returns {Promise}
|
|
91
|
-
|
|
92
|
-
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
|
|
91
|
+
*/
|
|
92
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>>;
|
|
93
93
|
/**
|
|
94
94
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
95
95
|
* authenticator using the [verify
|
|
@@ -99,7 +99,7 @@ export declare class Account extends Service {
|
|
|
99
99
|
* @param {AuthenticatorType} type
|
|
100
100
|
* @throws {AppwriteException}
|
|
101
101
|
* @returns {Promise}
|
|
102
|
-
|
|
102
|
+
*/
|
|
103
103
|
createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
|
|
104
104
|
/**
|
|
105
105
|
* Verify an authenticator app after adding it using the [add
|
|
@@ -110,15 +110,15 @@ export declare class Account extends Service {
|
|
|
110
110
|
* @param {string} otp
|
|
111
111
|
* @throws {AppwriteException}
|
|
112
112
|
* @returns {Promise}
|
|
113
|
-
|
|
114
|
-
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
|
|
113
|
+
*/
|
|
114
|
+
updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
|
|
115
115
|
/**
|
|
116
116
|
* Delete an authenticator for a user by ID.
|
|
117
117
|
*
|
|
118
118
|
* @param {AuthenticatorType} type
|
|
119
119
|
* @throws {AppwriteException}
|
|
120
120
|
* @returns {Promise}
|
|
121
|
-
|
|
121
|
+
*/
|
|
122
122
|
deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>;
|
|
123
123
|
/**
|
|
124
124
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
@@ -128,7 +128,7 @@ export declare class Account extends Service {
|
|
|
128
128
|
* @param {AuthenticationFactor} factor
|
|
129
129
|
* @throws {AppwriteException}
|
|
130
130
|
* @returns {Promise}
|
|
131
|
-
|
|
131
|
+
*/
|
|
132
132
|
createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
|
|
133
133
|
/**
|
|
134
134
|
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
@@ -141,14 +141,14 @@ export declare class Account extends Service {
|
|
|
141
141
|
* @param {string} otp
|
|
142
142
|
* @throws {AppwriteException}
|
|
143
143
|
* @returns {Promise}
|
|
144
|
-
|
|
144
|
+
*/
|
|
145
145
|
updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session>;
|
|
146
146
|
/**
|
|
147
147
|
* List the factors available on the account to be used as a MFA challange.
|
|
148
148
|
*
|
|
149
149
|
* @throws {AppwriteException}
|
|
150
150
|
* @returns {Promise}
|
|
151
|
-
|
|
151
|
+
*/
|
|
152
152
|
listMfaFactors(): Promise<Models.MfaFactors>;
|
|
153
153
|
/**
|
|
154
154
|
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
@@ -158,7 +158,7 @@ export declare class Account extends Service {
|
|
|
158
158
|
*
|
|
159
159
|
* @throws {AppwriteException}
|
|
160
160
|
* @returns {Promise}
|
|
161
|
-
|
|
161
|
+
*/
|
|
162
162
|
getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
|
|
163
163
|
/**
|
|
164
164
|
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
@@ -169,7 +169,7 @@ export declare class Account extends Service {
|
|
|
169
169
|
*
|
|
170
170
|
* @throws {AppwriteException}
|
|
171
171
|
* @returns {Promise}
|
|
172
|
-
|
|
172
|
+
*/
|
|
173
173
|
createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
|
|
174
174
|
/**
|
|
175
175
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
@@ -179,7 +179,7 @@ export declare class Account extends Service {
|
|
|
179
179
|
*
|
|
180
180
|
* @throws {AppwriteException}
|
|
181
181
|
* @returns {Promise}
|
|
182
|
-
|
|
182
|
+
*/
|
|
183
183
|
updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
|
|
184
184
|
/**
|
|
185
185
|
* Update currently logged in user account name.
|
|
@@ -187,8 +187,8 @@ export declare class Account extends Service {
|
|
|
187
187
|
* @param {string} name
|
|
188
188
|
* @throws {AppwriteException}
|
|
189
189
|
* @returns {Promise}
|
|
190
|
-
|
|
191
|
-
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
|
|
190
|
+
*/
|
|
191
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>>;
|
|
192
192
|
/**
|
|
193
193
|
* Update currently logged in user password. For validation, user is required
|
|
194
194
|
* to pass in the new password, and the old password. For users created with
|
|
@@ -198,8 +198,8 @@ export declare class Account extends Service {
|
|
|
198
198
|
* @param {string} oldPassword
|
|
199
199
|
* @throws {AppwriteException}
|
|
200
200
|
* @returns {Promise}
|
|
201
|
-
|
|
202
|
-
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
|
|
201
|
+
*/
|
|
202
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
|
|
203
203
|
/**
|
|
204
204
|
* Update the currently logged in user's phone number. After updating the
|
|
205
205
|
* phone number, the phone verification status will be reset. A confirmation
|
|
@@ -211,15 +211,15 @@ export declare class Account extends Service {
|
|
|
211
211
|
* @param {string} password
|
|
212
212
|
* @throws {AppwriteException}
|
|
213
213
|
* @returns {Promise}
|
|
214
|
-
|
|
215
|
-
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
|
|
214
|
+
*/
|
|
215
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
|
|
216
216
|
/**
|
|
217
217
|
* Get the preferences as a key-value object for the currently logged in user.
|
|
218
218
|
*
|
|
219
219
|
* @throws {AppwriteException}
|
|
220
220
|
* @returns {Promise}
|
|
221
|
-
|
|
222
|
-
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
|
|
221
|
+
*/
|
|
222
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences>;
|
|
223
223
|
/**
|
|
224
224
|
* Update currently logged in user account preferences. The object you pass is
|
|
225
225
|
* stored as is, and replaces any previous value. The maximum allowed prefs
|
|
@@ -228,8 +228,8 @@ export declare class Account extends Service {
|
|
|
228
228
|
* @param {object} prefs
|
|
229
229
|
* @throws {AppwriteException}
|
|
230
230
|
* @returns {Promise}
|
|
231
|
-
|
|
232
|
-
updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.User<Preferences>>;
|
|
231
|
+
*/
|
|
232
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: object): Promise<Models.User<Preferences>>;
|
|
233
233
|
/**
|
|
234
234
|
* Sends the user an email with a temporary secret key for password reset.
|
|
235
235
|
* When the user clicks the confirmation link he is redirected back to your
|
|
@@ -244,7 +244,7 @@ export declare class Account extends Service {
|
|
|
244
244
|
* @param {string} url
|
|
245
245
|
* @throws {AppwriteException}
|
|
246
246
|
* @returns {Promise}
|
|
247
|
-
|
|
247
|
+
*/
|
|
248
248
|
createRecovery(email: string, url: string): Promise<Models.Token>;
|
|
249
249
|
/**
|
|
250
250
|
* Use this endpoint to complete the user account password reset. Both the
|
|
@@ -263,7 +263,7 @@ export declare class Account extends Service {
|
|
|
263
263
|
* @param {string} password
|
|
264
264
|
* @throws {AppwriteException}
|
|
265
265
|
* @returns {Promise}
|
|
266
|
-
|
|
266
|
+
*/
|
|
267
267
|
updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token>;
|
|
268
268
|
/**
|
|
269
269
|
* Get the list of active sessions across different devices for the currently
|
|
@@ -271,7 +271,7 @@ export declare class Account extends Service {
|
|
|
271
271
|
*
|
|
272
272
|
* @throws {AppwriteException}
|
|
273
273
|
* @returns {Promise}
|
|
274
|
-
|
|
274
|
+
*/
|
|
275
275
|
listSessions(): Promise<Models.SessionList>;
|
|
276
276
|
/**
|
|
277
277
|
* Delete all sessions from the user account and remove any sessions cookies
|
|
@@ -279,7 +279,7 @@ export declare class Account extends Service {
|
|
|
279
279
|
*
|
|
280
280
|
* @throws {AppwriteException}
|
|
281
281
|
* @returns {Promise}
|
|
282
|
-
|
|
282
|
+
*/
|
|
283
283
|
deleteSessions(): Promise<{}>;
|
|
284
284
|
/**
|
|
285
285
|
* Use this endpoint to allow a new user to register an anonymous account in
|
|
@@ -292,7 +292,7 @@ export declare class Account extends Service {
|
|
|
292
292
|
*
|
|
293
293
|
* @throws {AppwriteException}
|
|
294
294
|
* @returns {Promise}
|
|
295
|
-
|
|
295
|
+
*/
|
|
296
296
|
createAnonymousSession(): Promise<Models.Session>;
|
|
297
297
|
/**
|
|
298
298
|
* Allow the user to login into their account by providing a valid email and
|
|
@@ -306,7 +306,7 @@ export declare class Account extends Service {
|
|
|
306
306
|
* @param {string} password
|
|
307
307
|
* @throws {AppwriteException}
|
|
308
308
|
* @returns {Promise}
|
|
309
|
-
|
|
309
|
+
*/
|
|
310
310
|
createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
|
|
311
311
|
/**
|
|
312
312
|
* Use this endpoint to create a session from token. Provide the **userId**
|
|
@@ -317,7 +317,7 @@ export declare class Account extends Service {
|
|
|
317
317
|
* @param {string} secret
|
|
318
318
|
* @throws {AppwriteException}
|
|
319
319
|
* @returns {Promise}
|
|
320
|
-
|
|
320
|
+
*/
|
|
321
321
|
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
|
|
322
322
|
/**
|
|
323
323
|
* Allow the user to login to their account using the OAuth2 provider of their
|
|
@@ -343,7 +343,7 @@ export declare class Account extends Service {
|
|
|
343
343
|
* @param {string[]} scopes
|
|
344
344
|
* @throws {AppwriteException}
|
|
345
345
|
* @returns {void|string}
|
|
346
|
-
|
|
346
|
+
*/
|
|
347
347
|
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL;
|
|
348
348
|
/**
|
|
349
349
|
* Use this endpoint to create a session from token. Provide the **userId**
|
|
@@ -354,7 +354,7 @@ export declare class Account extends Service {
|
|
|
354
354
|
* @param {string} secret
|
|
355
355
|
* @throws {AppwriteException}
|
|
356
356
|
* @returns {Promise}
|
|
357
|
-
|
|
357
|
+
*/
|
|
358
358
|
updatePhoneSession(userId: string, secret: string): Promise<Models.Session>;
|
|
359
359
|
/**
|
|
360
360
|
* Use this endpoint to create a session from token. Provide the **userId**
|
|
@@ -365,7 +365,7 @@ export declare class Account extends Service {
|
|
|
365
365
|
* @param {string} secret
|
|
366
366
|
* @throws {AppwriteException}
|
|
367
367
|
* @returns {Promise}
|
|
368
|
-
|
|
368
|
+
*/
|
|
369
369
|
createSession(userId: string, secret: string): Promise<Models.Session>;
|
|
370
370
|
/**
|
|
371
371
|
* Use this endpoint to get a logged in user's session using a Session ID.
|
|
@@ -374,7 +374,7 @@ export declare class Account extends Service {
|
|
|
374
374
|
* @param {string} sessionId
|
|
375
375
|
* @throws {AppwriteException}
|
|
376
376
|
* @returns {Promise}
|
|
377
|
-
|
|
377
|
+
*/
|
|
378
378
|
getSession(sessionId: string): Promise<Models.Session>;
|
|
379
379
|
/**
|
|
380
380
|
* Use this endpoint to extend a session's length. Extending a session is
|
|
@@ -384,7 +384,7 @@ export declare class Account extends Service {
|
|
|
384
384
|
* @param {string} sessionId
|
|
385
385
|
* @throws {AppwriteException}
|
|
386
386
|
* @returns {Promise}
|
|
387
|
-
|
|
387
|
+
*/
|
|
388
388
|
updateSession(sessionId: string): Promise<Models.Session>;
|
|
389
389
|
/**
|
|
390
390
|
* Logout the user. Use 'current' as the session ID to logout on this device,
|
|
@@ -396,7 +396,7 @@ export declare class Account extends Service {
|
|
|
396
396
|
* @param {string} sessionId
|
|
397
397
|
* @throws {AppwriteException}
|
|
398
398
|
* @returns {Promise}
|
|
399
|
-
|
|
399
|
+
*/
|
|
400
400
|
deleteSession(sessionId: string): Promise<{}>;
|
|
401
401
|
/**
|
|
402
402
|
* Block the currently logged in user account. Behind the scene, the user
|
|
@@ -405,8 +405,8 @@ export declare class Account extends Service {
|
|
|
405
405
|
*
|
|
406
406
|
* @throws {AppwriteException}
|
|
407
407
|
* @returns {Promise}
|
|
408
|
-
|
|
409
|
-
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
|
|
408
|
+
*/
|
|
409
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
|
|
410
410
|
/**
|
|
411
411
|
* Use this endpoint to register a device for push notifications. Provide a
|
|
412
412
|
* target ID (custom or generated using ID.unique()), a device identifier
|
|
@@ -419,7 +419,7 @@ export declare class Account extends Service {
|
|
|
419
419
|
* @param {string} providerId
|
|
420
420
|
* @throws {AppwriteException}
|
|
421
421
|
* @returns {Promise}
|
|
422
|
-
|
|
422
|
+
*/
|
|
423
423
|
createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target>;
|
|
424
424
|
/**
|
|
425
425
|
* Update the currently logged in user's push notification target. You can
|
|
@@ -432,7 +432,7 @@ export declare class Account extends Service {
|
|
|
432
432
|
* @param {string} identifier
|
|
433
433
|
* @throws {AppwriteException}
|
|
434
434
|
* @returns {Promise}
|
|
435
|
-
|
|
435
|
+
*/
|
|
436
436
|
updatePushTarget(targetId: string, identifier: string): Promise<Models.Target>;
|
|
437
437
|
/**
|
|
438
438
|
* Delete a push notification target for the currently logged in user. After
|
|
@@ -442,7 +442,7 @@ export declare class Account extends Service {
|
|
|
442
442
|
* @param {string} targetId
|
|
443
443
|
* @throws {AppwriteException}
|
|
444
444
|
* @returns {Promise}
|
|
445
|
-
|
|
445
|
+
*/
|
|
446
446
|
deletePushTarget(targetId: string): Promise<{}>;
|
|
447
447
|
/**
|
|
448
448
|
* Sends the user an email with a secret key for creating a session. If the
|
|
@@ -461,7 +461,7 @@ export declare class Account extends Service {
|
|
|
461
461
|
* @param {boolean} phrase
|
|
462
462
|
* @throws {AppwriteException}
|
|
463
463
|
* @returns {Promise}
|
|
464
|
-
|
|
464
|
+
*/
|
|
465
465
|
createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
|
|
466
466
|
/**
|
|
467
467
|
* Sends the user an email with a secret key for creating a session. If the
|
|
@@ -485,7 +485,7 @@ export declare class Account extends Service {
|
|
|
485
485
|
* @param {boolean} phrase
|
|
486
486
|
* @throws {AppwriteException}
|
|
487
487
|
* @returns {Promise}
|
|
488
|
-
|
|
488
|
+
*/
|
|
489
489
|
createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
|
|
490
490
|
/**
|
|
491
491
|
* Allow the user to login to their account using the OAuth2 provider of their
|
|
@@ -509,7 +509,7 @@ export declare class Account extends Service {
|
|
|
509
509
|
* @param {string[]} scopes
|
|
510
510
|
* @throws {AppwriteException}
|
|
511
511
|
* @returns {void|string}
|
|
512
|
-
|
|
512
|
+
*/
|
|
513
513
|
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL;
|
|
514
514
|
/**
|
|
515
515
|
* Sends the user an SMS with a secret key for creating a session. If the
|
|
@@ -527,7 +527,7 @@ export declare class Account extends Service {
|
|
|
527
527
|
* @param {string} phone
|
|
528
528
|
* @throws {AppwriteException}
|
|
529
529
|
* @returns {Promise}
|
|
530
|
-
|
|
530
|
+
*/
|
|
531
531
|
createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
|
|
532
532
|
/**
|
|
533
533
|
* Use this endpoint to send a verification message to your user email address
|
|
@@ -549,7 +549,7 @@ export declare class Account extends Service {
|
|
|
549
549
|
* @param {string} url
|
|
550
550
|
* @throws {AppwriteException}
|
|
551
551
|
* @returns {Promise}
|
|
552
|
-
|
|
552
|
+
*/
|
|
553
553
|
createVerification(url: string): Promise<Models.Token>;
|
|
554
554
|
/**
|
|
555
555
|
* Use this endpoint to complete the user email verification process. Use both
|
|
@@ -561,7 +561,7 @@ export declare class Account extends Service {
|
|
|
561
561
|
* @param {string} secret
|
|
562
562
|
* @throws {AppwriteException}
|
|
563
563
|
* @returns {Promise}
|
|
564
|
-
|
|
564
|
+
*/
|
|
565
565
|
updateVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
566
566
|
/**
|
|
567
567
|
* Use this endpoint to send a verification SMS to the currently logged in
|
|
@@ -575,7 +575,7 @@ export declare class Account extends Service {
|
|
|
575
575
|
*
|
|
576
576
|
* @throws {AppwriteException}
|
|
577
577
|
* @returns {Promise}
|
|
578
|
-
|
|
578
|
+
*/
|
|
579
579
|
createPhoneVerification(): Promise<Models.Token>;
|
|
580
580
|
/**
|
|
581
581
|
* Use this endpoint to complete the user phone verification process. Use the
|
|
@@ -587,6 +587,6 @@ export declare class Account extends Service {
|
|
|
587
587
|
* @param {string} secret
|
|
588
588
|
* @throws {AppwriteException}
|
|
589
589
|
* @returns {Promise}
|
|
590
|
-
|
|
590
|
+
*/
|
|
591
591
|
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
592
592
|
}
|
|
@@ -23,7 +23,7 @@ export declare class Avatars extends Service {
|
|
|
23
23
|
* @param {number} quality
|
|
24
24
|
* @throws {AppwriteException}
|
|
25
25
|
* @returns {ArrayBuffer}
|
|
26
|
-
|
|
26
|
+
*/
|
|
27
27
|
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
28
28
|
/**
|
|
29
29
|
* The credit card endpoint will return you the icon of the credit card
|
|
@@ -42,7 +42,7 @@ export declare class Avatars extends Service {
|
|
|
42
42
|
* @param {number} quality
|
|
43
43
|
* @throws {AppwriteException}
|
|
44
44
|
* @returns {ArrayBuffer}
|
|
45
|
-
|
|
45
|
+
*/
|
|
46
46
|
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
47
47
|
/**
|
|
48
48
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
@@ -53,7 +53,7 @@ export declare class Avatars extends Service {
|
|
|
53
53
|
* @param {string} url
|
|
54
54
|
* @throws {AppwriteException}
|
|
55
55
|
* @returns {ArrayBuffer}
|
|
56
|
-
|
|
56
|
+
*/
|
|
57
57
|
getFavicon(url: string): Promise<ArrayBuffer>;
|
|
58
58
|
/**
|
|
59
59
|
* You can use this endpoint to show different country flags icons to your
|
|
@@ -73,7 +73,7 @@ export declare class Avatars extends Service {
|
|
|
73
73
|
* @param {number} quality
|
|
74
74
|
* @throws {AppwriteException}
|
|
75
75
|
* @returns {ArrayBuffer}
|
|
76
|
-
|
|
76
|
+
*/
|
|
77
77
|
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
78
78
|
/**
|
|
79
79
|
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
@@ -93,7 +93,7 @@ export declare class Avatars extends Service {
|
|
|
93
93
|
* @param {number} height
|
|
94
94
|
* @throws {AppwriteException}
|
|
95
95
|
* @returns {ArrayBuffer}
|
|
96
|
-
|
|
96
|
+
*/
|
|
97
97
|
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
|
|
98
98
|
/**
|
|
99
99
|
* Use this endpoint to show your user initials avatar icon on your website or
|
|
@@ -119,7 +119,7 @@ export declare class Avatars extends Service {
|
|
|
119
119
|
* @param {string} background
|
|
120
120
|
* @throws {AppwriteException}
|
|
121
121
|
* @returns {ArrayBuffer}
|
|
122
|
-
|
|
122
|
+
*/
|
|
123
123
|
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
|
|
124
124
|
/**
|
|
125
125
|
* Converts a given plain text to a QR code image. You can use the query
|
|
@@ -132,7 +132,7 @@ export declare class Avatars extends Service {
|
|
|
132
132
|
* @param {boolean} download
|
|
133
133
|
* @throws {AppwriteException}
|
|
134
134
|
* @returns {ArrayBuffer}
|
|
135
|
-
|
|
135
|
+
*/
|
|
136
136
|
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
|
|
137
137
|
/**
|
|
138
138
|
* You can use this endpoint to show different browser icons to your users.
|
|
@@ -12,8 +12,8 @@ export declare class Databases extends Service {
|
|
|
12
12
|
* @param {string[]} queries
|
|
13
13
|
* @throws {AppwriteException}
|
|
14
14
|
* @returns {Promise}
|
|
15
|
-
|
|
16
|
-
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
15
|
+
*/
|
|
16
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
17
17
|
/**
|
|
18
18
|
* Create a new Document. Before using this route, you should create a new
|
|
19
19
|
* collection resource using either a [server
|
|
@@ -27,8 +27,8 @@ export declare class Databases extends Service {
|
|
|
27
27
|
* @param {string[]} permissions
|
|
28
28
|
* @throws {AppwriteException}
|
|
29
29
|
* @returns {Promise}
|
|
30
|
-
|
|
31
|
-
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
30
|
+
*/
|
|
31
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
32
32
|
/**
|
|
33
33
|
* Get a document by its unique ID. This endpoint response returns a JSON
|
|
34
34
|
* object with the document data.
|
|
@@ -39,9 +39,13 @@ export declare class Databases extends Service {
|
|
|
39
39
|
* @param {string[]} queries
|
|
40
40
|
* @throws {AppwriteException}
|
|
41
41
|
* @returns {Promise}
|
|
42
|
-
|
|
43
|
-
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
42
|
+
*/
|
|
43
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
44
44
|
/**
|
|
45
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not
|
|
46
|
+
* yet officially supported. It may be subject to breaking changes or removal
|
|
47
|
+
* in future versions.
|
|
48
|
+
*
|
|
45
49
|
* Create or update a Document. Before using this route, you should create a
|
|
46
50
|
* new collection resource using either a [server
|
|
47
51
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
@@ -54,8 +58,8 @@ export declare class Databases extends Service {
|
|
|
54
58
|
* @param {string[]} permissions
|
|
55
59
|
* @throws {AppwriteException}
|
|
56
60
|
* @returns {Promise}
|
|
57
|
-
|
|
58
|
-
upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
61
|
+
*/
|
|
62
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
|
|
59
63
|
/**
|
|
60
64
|
* Update a document by its unique ID. Using the patch method you can pass
|
|
61
65
|
* only specific fields that will get updated.
|
|
@@ -67,8 +71,8 @@ export declare class Databases extends Service {
|
|
|
67
71
|
* @param {string[]} permissions
|
|
68
72
|
* @throws {AppwriteException}
|
|
69
73
|
* @returns {Promise}
|
|
70
|
-
|
|
71
|
-
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document>;
|
|
74
|
+
*/
|
|
75
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document>;
|
|
72
76
|
/**
|
|
73
77
|
* Delete a document by its unique ID.
|
|
74
78
|
*
|
|
@@ -77,6 +81,32 @@ export declare class Databases extends Service {
|
|
|
77
81
|
* @param {string} documentId
|
|
78
82
|
* @throws {AppwriteException}
|
|
79
83
|
* @returns {Promise}
|
|
80
|
-
|
|
84
|
+
*/
|
|
81
85
|
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
|
|
86
|
+
/**
|
|
87
|
+
* Decrement a specific attribute of a document by a given value.
|
|
88
|
+
*
|
|
89
|
+
* @param {string} databaseId
|
|
90
|
+
* @param {string} collectionId
|
|
91
|
+
* @param {string} documentId
|
|
92
|
+
* @param {string} attribute
|
|
93
|
+
* @param {number} value
|
|
94
|
+
* @param {number} min
|
|
95
|
+
* @throws {AppwriteException}
|
|
96
|
+
* @returns {Promise}
|
|
97
|
+
*/
|
|
98
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
|
|
99
|
+
/**
|
|
100
|
+
* Increment a specific attribute of a document by a given value.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} databaseId
|
|
103
|
+
* @param {string} collectionId
|
|
104
|
+
* @param {string} documentId
|
|
105
|
+
* @param {string} attribute
|
|
106
|
+
* @param {number} value
|
|
107
|
+
* @param {number} max
|
|
108
|
+
* @throws {AppwriteException}
|
|
109
|
+
* @returns {Promise}
|
|
110
|
+
*/
|
|
111
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
|
|
82
112
|
}
|
|
@@ -12,7 +12,7 @@ export declare class Functions extends Service {
|
|
|
12
12
|
* @param {string[]} queries
|
|
13
13
|
* @throws {AppwriteException}
|
|
14
14
|
* @returns {Promise}
|
|
15
|
-
|
|
15
|
+
*/
|
|
16
16
|
listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
|
|
17
17
|
/**
|
|
18
18
|
* Trigger a function execution. The returned object will return you the
|
|
@@ -29,7 +29,7 @@ export declare class Functions extends Service {
|
|
|
29
29
|
* @param {string} scheduledAt
|
|
30
30
|
* @throws {AppwriteException}
|
|
31
31
|
* @returns {Promise}
|
|
32
|
-
|
|
32
|
+
*/
|
|
33
33
|
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
|
34
34
|
/**
|
|
35
35
|
* Get a function execution log by its unique ID.
|
|
@@ -38,6 +38,6 @@ export declare class Functions extends Service {
|
|
|
38
38
|
* @param {string} executionId
|
|
39
39
|
* @throws {AppwriteException}
|
|
40
40
|
* @returns {Promise}
|
|
41
|
-
|
|
41
|
+
*/
|
|
42
42
|
getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
|
43
43
|
}
|
|
@@ -8,7 +8,7 @@ export declare class Graphql extends Service {
|
|
|
8
8
|
* @param {object} query
|
|
9
9
|
* @throws {AppwriteException}
|
|
10
10
|
* @returns {Promise}
|
|
11
|
-
|
|
11
|
+
*/
|
|
12
12
|
query(query: object): Promise<{}>;
|
|
13
13
|
/**
|
|
14
14
|
* Execute a GraphQL mutation.
|
|
@@ -16,6 +16,6 @@ export declare class Graphql extends Service {
|
|
|
16
16
|
* @param {object} query
|
|
17
17
|
* @throws {AppwriteException}
|
|
18
18
|
* @returns {Promise}
|
|
19
|
-
|
|
19
|
+
*/
|
|
20
20
|
mutation(query: object): Promise<{}>;
|
|
21
21
|
}
|