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
package/src/services/account.ts
CHANGED
|
@@ -21,8 +21,8 @@ export class Account extends Service {
|
|
|
21
21
|
*
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
25
|
-
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
24
|
+
*/
|
|
25
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>> {
|
|
26
26
|
const apiPath = '/account';
|
|
27
27
|
const payload: Payload = {};
|
|
28
28
|
|
|
@@ -46,8 +46,8 @@ export class Account extends Service {
|
|
|
46
46
|
* @param {string} name
|
|
47
47
|
* @throws {AppwriteException}
|
|
48
48
|
* @returns {Promise}
|
|
49
|
-
|
|
50
|
-
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
49
|
+
*/
|
|
50
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
51
51
|
if (typeof userId === 'undefined') {
|
|
52
52
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
53
53
|
}
|
|
@@ -99,8 +99,8 @@ export class Account extends Service {
|
|
|
99
99
|
* @param {string} password
|
|
100
100
|
* @throws {AppwriteException}
|
|
101
101
|
* @returns {Promise}
|
|
102
|
-
|
|
103
|
-
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>> {
|
|
102
|
+
*/
|
|
103
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>> {
|
|
104
104
|
if (typeof email === 'undefined') {
|
|
105
105
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
106
106
|
}
|
|
@@ -132,7 +132,7 @@ export class Account extends Service {
|
|
|
132
132
|
* @param {string[]} queries
|
|
133
133
|
* @throws {AppwriteException}
|
|
134
134
|
* @returns {Promise}
|
|
135
|
-
|
|
135
|
+
*/
|
|
136
136
|
listIdentities(queries?: string[]): Promise<Models.IdentityList> {
|
|
137
137
|
const apiPath = '/account/identities';
|
|
138
138
|
const payload: Payload = {};
|
|
@@ -152,7 +152,7 @@ export class Account extends Service {
|
|
|
152
152
|
* @param {string} identityId
|
|
153
153
|
* @throws {AppwriteException}
|
|
154
154
|
* @returns {Promise}
|
|
155
|
-
|
|
155
|
+
*/
|
|
156
156
|
deleteIdentity(identityId: string): Promise<{}> {
|
|
157
157
|
if (typeof identityId === 'undefined') {
|
|
158
158
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
@@ -176,7 +176,7 @@ export class Account extends Service {
|
|
|
176
176
|
*
|
|
177
177
|
* @throws {AppwriteException}
|
|
178
178
|
* @returns {Promise}
|
|
179
|
-
|
|
179
|
+
*/
|
|
180
180
|
createJWT(): Promise<Models.Jwt> {
|
|
181
181
|
const apiPath = '/account/jwts';
|
|
182
182
|
const payload: Payload = {};
|
|
@@ -194,7 +194,7 @@ export class Account extends Service {
|
|
|
194
194
|
* @param {string[]} queries
|
|
195
195
|
* @throws {AppwriteException}
|
|
196
196
|
* @returns {Promise}
|
|
197
|
-
|
|
197
|
+
*/
|
|
198
198
|
listLogs(queries?: string[]): Promise<Models.LogList> {
|
|
199
199
|
const apiPath = '/account/logs';
|
|
200
200
|
const payload: Payload = {};
|
|
@@ -214,8 +214,8 @@ export class Account extends Service {
|
|
|
214
214
|
* @param {boolean} mfa
|
|
215
215
|
* @throws {AppwriteException}
|
|
216
216
|
* @returns {Promise}
|
|
217
|
-
|
|
218
|
-
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>> {
|
|
217
|
+
*/
|
|
218
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>> {
|
|
219
219
|
if (typeof mfa === 'undefined') {
|
|
220
220
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
221
221
|
}
|
|
@@ -242,7 +242,7 @@ export class Account extends Service {
|
|
|
242
242
|
* @param {AuthenticatorType} type
|
|
243
243
|
* @throws {AppwriteException}
|
|
244
244
|
* @returns {Promise}
|
|
245
|
-
|
|
245
|
+
*/
|
|
246
246
|
createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> {
|
|
247
247
|
if (typeof type === 'undefined') {
|
|
248
248
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
@@ -266,8 +266,8 @@ export class Account extends Service {
|
|
|
266
266
|
* @param {string} otp
|
|
267
267
|
* @throws {AppwriteException}
|
|
268
268
|
* @returns {Promise}
|
|
269
|
-
|
|
270
|
-
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
269
|
+
*/
|
|
270
|
+
updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
271
271
|
if (typeof type === 'undefined') {
|
|
272
272
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
273
273
|
}
|
|
@@ -295,7 +295,7 @@ export class Account extends Service {
|
|
|
295
295
|
* @param {AuthenticatorType} type
|
|
296
296
|
* @throws {AppwriteException}
|
|
297
297
|
* @returns {Promise}
|
|
298
|
-
|
|
298
|
+
*/
|
|
299
299
|
deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
|
|
300
300
|
if (typeof type === 'undefined') {
|
|
301
301
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
@@ -318,7 +318,7 @@ export class Account extends Service {
|
|
|
318
318
|
* @param {AuthenticationFactor} factor
|
|
319
319
|
* @throws {AppwriteException}
|
|
320
320
|
* @returns {Promise}
|
|
321
|
-
|
|
321
|
+
*/
|
|
322
322
|
createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
|
|
323
323
|
if (typeof factor === 'undefined') {
|
|
324
324
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
@@ -348,7 +348,7 @@ export class Account extends Service {
|
|
|
348
348
|
* @param {string} otp
|
|
349
349
|
* @throws {AppwriteException}
|
|
350
350
|
* @returns {Promise}
|
|
351
|
-
|
|
351
|
+
*/
|
|
352
352
|
updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> {
|
|
353
353
|
if (typeof challengeId === 'undefined') {
|
|
354
354
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
@@ -380,7 +380,7 @@ export class Account extends Service {
|
|
|
380
380
|
*
|
|
381
381
|
* @throws {AppwriteException}
|
|
382
382
|
* @returns {Promise}
|
|
383
|
-
|
|
383
|
+
*/
|
|
384
384
|
listMfaFactors(): Promise<Models.MfaFactors> {
|
|
385
385
|
const apiPath = '/account/mfa/factors';
|
|
386
386
|
const payload: Payload = {};
|
|
@@ -398,7 +398,7 @@ export class Account extends Service {
|
|
|
398
398
|
*
|
|
399
399
|
* @throws {AppwriteException}
|
|
400
400
|
* @returns {Promise}
|
|
401
|
-
|
|
401
|
+
*/
|
|
402
402
|
getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
403
403
|
const apiPath = '/account/mfa/recovery-codes';
|
|
404
404
|
const payload: Payload = {};
|
|
@@ -417,7 +417,7 @@ export class Account extends Service {
|
|
|
417
417
|
*
|
|
418
418
|
* @throws {AppwriteException}
|
|
419
419
|
* @returns {Promise}
|
|
420
|
-
|
|
420
|
+
*/
|
|
421
421
|
createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
422
422
|
const apiPath = '/account/mfa/recovery-codes';
|
|
423
423
|
const payload: Payload = {};
|
|
@@ -436,7 +436,7 @@ export class Account extends Service {
|
|
|
436
436
|
*
|
|
437
437
|
* @throws {AppwriteException}
|
|
438
438
|
* @returns {Promise}
|
|
439
|
-
|
|
439
|
+
*/
|
|
440
440
|
updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
441
441
|
const apiPath = '/account/mfa/recovery-codes';
|
|
442
442
|
const payload: Payload = {};
|
|
@@ -453,8 +453,8 @@ export class Account extends Service {
|
|
|
453
453
|
* @param {string} name
|
|
454
454
|
* @throws {AppwriteException}
|
|
455
455
|
* @returns {Promise}
|
|
456
|
-
|
|
457
|
-
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>> {
|
|
456
|
+
*/
|
|
457
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>> {
|
|
458
458
|
if (typeof name === 'undefined') {
|
|
459
459
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
460
460
|
}
|
|
@@ -481,8 +481,8 @@ export class Account extends Service {
|
|
|
481
481
|
* @param {string} oldPassword
|
|
482
482
|
* @throws {AppwriteException}
|
|
483
483
|
* @returns {Promise}
|
|
484
|
-
|
|
485
|
-
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> {
|
|
484
|
+
*/
|
|
485
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> {
|
|
486
486
|
if (typeof password === 'undefined') {
|
|
487
487
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
488
488
|
}
|
|
@@ -515,8 +515,8 @@ export class Account extends Service {
|
|
|
515
515
|
* @param {string} password
|
|
516
516
|
* @throws {AppwriteException}
|
|
517
517
|
* @returns {Promise}
|
|
518
|
-
|
|
519
|
-
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>> {
|
|
518
|
+
*/
|
|
519
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>> {
|
|
520
520
|
if (typeof phone === 'undefined') {
|
|
521
521
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
522
522
|
}
|
|
@@ -547,8 +547,8 @@ export class Account extends Service {
|
|
|
547
547
|
*
|
|
548
548
|
* @throws {AppwriteException}
|
|
549
549
|
* @returns {Promise}
|
|
550
|
-
|
|
551
|
-
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences> {
|
|
550
|
+
*/
|
|
551
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences> {
|
|
552
552
|
const apiPath = '/account/prefs';
|
|
553
553
|
const payload: Payload = {};
|
|
554
554
|
|
|
@@ -565,8 +565,8 @@ export class Account extends Service {
|
|
|
565
565
|
* @param {object} prefs
|
|
566
566
|
* @throws {AppwriteException}
|
|
567
567
|
* @returns {Promise}
|
|
568
|
-
|
|
569
|
-
updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.User<Preferences>> {
|
|
568
|
+
*/
|
|
569
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: object): Promise<Models.User<Preferences>> {
|
|
570
570
|
if (typeof prefs === 'undefined') {
|
|
571
571
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
572
572
|
}
|
|
@@ -598,7 +598,7 @@ export class Account extends Service {
|
|
|
598
598
|
* @param {string} url
|
|
599
599
|
* @throws {AppwriteException}
|
|
600
600
|
* @returns {Promise}
|
|
601
|
-
|
|
601
|
+
*/
|
|
602
602
|
createRecovery(email: string, url: string): Promise<Models.Token> {
|
|
603
603
|
if (typeof email === 'undefined') {
|
|
604
604
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -642,7 +642,7 @@ export class Account extends Service {
|
|
|
642
642
|
* @param {string} password
|
|
643
643
|
* @throws {AppwriteException}
|
|
644
644
|
* @returns {Promise}
|
|
645
|
-
|
|
645
|
+
*/
|
|
646
646
|
updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token> {
|
|
647
647
|
if (typeof userId === 'undefined') {
|
|
648
648
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -683,7 +683,7 @@ export class Account extends Service {
|
|
|
683
683
|
*
|
|
684
684
|
* @throws {AppwriteException}
|
|
685
685
|
* @returns {Promise}
|
|
686
|
-
|
|
686
|
+
*/
|
|
687
687
|
listSessions(): Promise<Models.SessionList> {
|
|
688
688
|
const apiPath = '/account/sessions';
|
|
689
689
|
const payload: Payload = {};
|
|
@@ -699,7 +699,7 @@ export class Account extends Service {
|
|
|
699
699
|
*
|
|
700
700
|
* @throws {AppwriteException}
|
|
701
701
|
* @returns {Promise}
|
|
702
|
-
|
|
702
|
+
*/
|
|
703
703
|
deleteSessions(): Promise<{}> {
|
|
704
704
|
const apiPath = '/account/sessions';
|
|
705
705
|
const payload: Payload = {};
|
|
@@ -721,7 +721,7 @@ export class Account extends Service {
|
|
|
721
721
|
*
|
|
722
722
|
* @throws {AppwriteException}
|
|
723
723
|
* @returns {Promise}
|
|
724
|
-
|
|
724
|
+
*/
|
|
725
725
|
createAnonymousSession(): Promise<Models.Session> {
|
|
726
726
|
const apiPath = '/account/sessions/anonymous';
|
|
727
727
|
const payload: Payload = {};
|
|
@@ -744,7 +744,7 @@ export class Account extends Service {
|
|
|
744
744
|
* @param {string} password
|
|
745
745
|
* @throws {AppwriteException}
|
|
746
746
|
* @returns {Promise}
|
|
747
|
-
|
|
747
|
+
*/
|
|
748
748
|
createEmailPasswordSession(email: string, password: string): Promise<Models.Session> {
|
|
749
749
|
if (typeof email === 'undefined') {
|
|
750
750
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -780,7 +780,7 @@ export class Account extends Service {
|
|
|
780
780
|
* @param {string} secret
|
|
781
781
|
* @throws {AppwriteException}
|
|
782
782
|
* @returns {Promise}
|
|
783
|
-
|
|
783
|
+
*/
|
|
784
784
|
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session> {
|
|
785
785
|
if (typeof userId === 'undefined') {
|
|
786
786
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -831,7 +831,7 @@ export class Account extends Service {
|
|
|
831
831
|
* @param {string[]} scopes
|
|
832
832
|
* @throws {AppwriteException}
|
|
833
833
|
* @returns {void|string}
|
|
834
|
-
|
|
834
|
+
*/
|
|
835
835
|
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL {
|
|
836
836
|
if (typeof provider === 'undefined') {
|
|
837
837
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
@@ -871,7 +871,7 @@ export class Account extends Service {
|
|
|
871
871
|
* @param {string} secret
|
|
872
872
|
* @throws {AppwriteException}
|
|
873
873
|
* @returns {Promise}
|
|
874
|
-
|
|
874
|
+
*/
|
|
875
875
|
updatePhoneSession(userId: string, secret: string): Promise<Models.Session> {
|
|
876
876
|
if (typeof userId === 'undefined') {
|
|
877
877
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -907,7 +907,7 @@ export class Account extends Service {
|
|
|
907
907
|
* @param {string} secret
|
|
908
908
|
* @throws {AppwriteException}
|
|
909
909
|
* @returns {Promise}
|
|
910
|
-
|
|
910
|
+
*/
|
|
911
911
|
createSession(userId: string, secret: string): Promise<Models.Session> {
|
|
912
912
|
if (typeof userId === 'undefined') {
|
|
913
913
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -941,7 +941,7 @@ export class Account extends Service {
|
|
|
941
941
|
* @param {string} sessionId
|
|
942
942
|
* @throws {AppwriteException}
|
|
943
943
|
* @returns {Promise}
|
|
944
|
-
|
|
944
|
+
*/
|
|
945
945
|
getSession(sessionId: string): Promise<Models.Session> {
|
|
946
946
|
if (typeof sessionId === 'undefined') {
|
|
947
947
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -963,7 +963,7 @@ export class Account extends Service {
|
|
|
963
963
|
* @param {string} sessionId
|
|
964
964
|
* @throws {AppwriteException}
|
|
965
965
|
* @returns {Promise}
|
|
966
|
-
|
|
966
|
+
*/
|
|
967
967
|
updateSession(sessionId: string): Promise<Models.Session> {
|
|
968
968
|
if (typeof sessionId === 'undefined') {
|
|
969
969
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -988,7 +988,7 @@ export class Account extends Service {
|
|
|
988
988
|
* @param {string} sessionId
|
|
989
989
|
* @throws {AppwriteException}
|
|
990
990
|
* @returns {Promise}
|
|
991
|
-
|
|
991
|
+
*/
|
|
992
992
|
deleteSession(sessionId: string): Promise<{}> {
|
|
993
993
|
if (typeof sessionId === 'undefined') {
|
|
994
994
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -1010,8 +1010,8 @@ export class Account extends Service {
|
|
|
1010
1010
|
*
|
|
1011
1011
|
* @throws {AppwriteException}
|
|
1012
1012
|
* @returns {Promise}
|
|
1013
|
-
|
|
1014
|
-
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
1013
|
+
*/
|
|
1014
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>> {
|
|
1015
1015
|
const apiPath = '/account/status';
|
|
1016
1016
|
const payload: Payload = {};
|
|
1017
1017
|
|
|
@@ -1033,7 +1033,7 @@ export class Account extends Service {
|
|
|
1033
1033
|
* @param {string} providerId
|
|
1034
1034
|
* @throws {AppwriteException}
|
|
1035
1035
|
* @returns {Promise}
|
|
1036
|
-
|
|
1036
|
+
*/
|
|
1037
1037
|
createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target> {
|
|
1038
1038
|
if (typeof targetId === 'undefined') {
|
|
1039
1039
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1075,7 +1075,7 @@ export class Account extends Service {
|
|
|
1075
1075
|
* @param {string} identifier
|
|
1076
1076
|
* @throws {AppwriteException}
|
|
1077
1077
|
* @returns {Promise}
|
|
1078
|
-
|
|
1078
|
+
*/
|
|
1079
1079
|
updatePushTarget(targetId: string, identifier: string): Promise<Models.Target> {
|
|
1080
1080
|
if (typeof targetId === 'undefined') {
|
|
1081
1081
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1106,7 +1106,7 @@ export class Account extends Service {
|
|
|
1106
1106
|
* @param {string} targetId
|
|
1107
1107
|
* @throws {AppwriteException}
|
|
1108
1108
|
* @returns {Promise}
|
|
1109
|
-
|
|
1109
|
+
*/
|
|
1110
1110
|
deletePushTarget(targetId: string): Promise<{}> {
|
|
1111
1111
|
if (typeof targetId === 'undefined') {
|
|
1112
1112
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1138,7 +1138,7 @@ export class Account extends Service {
|
|
|
1138
1138
|
* @param {boolean} phrase
|
|
1139
1139
|
* @throws {AppwriteException}
|
|
1140
1140
|
* @returns {Promise}
|
|
1141
|
-
|
|
1141
|
+
*/
|
|
1142
1142
|
createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token> {
|
|
1143
1143
|
if (typeof userId === 'undefined') {
|
|
1144
1144
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1191,7 +1191,7 @@ export class Account extends Service {
|
|
|
1191
1191
|
* @param {boolean} phrase
|
|
1192
1192
|
* @throws {AppwriteException}
|
|
1193
1193
|
* @returns {Promise}
|
|
1194
|
-
|
|
1194
|
+
*/
|
|
1195
1195
|
createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token> {
|
|
1196
1196
|
if (typeof userId === 'undefined') {
|
|
1197
1197
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1248,7 +1248,7 @@ export class Account extends Service {
|
|
|
1248
1248
|
* @param {string[]} scopes
|
|
1249
1249
|
* @throws {AppwriteException}
|
|
1250
1250
|
* @returns {void|string}
|
|
1251
|
-
|
|
1251
|
+
*/
|
|
1252
1252
|
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL {
|
|
1253
1253
|
if (typeof provider === 'undefined') {
|
|
1254
1254
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
@@ -1295,7 +1295,7 @@ export class Account extends Service {
|
|
|
1295
1295
|
* @param {string} phone
|
|
1296
1296
|
* @throws {AppwriteException}
|
|
1297
1297
|
* @returns {Promise}
|
|
1298
|
-
|
|
1298
|
+
*/
|
|
1299
1299
|
createPhoneToken(userId: string, phone: string): Promise<Models.Token> {
|
|
1300
1300
|
if (typeof userId === 'undefined') {
|
|
1301
1301
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1342,7 +1342,7 @@ export class Account extends Service {
|
|
|
1342
1342
|
* @param {string} url
|
|
1343
1343
|
* @throws {AppwriteException}
|
|
1344
1344
|
* @returns {Promise}
|
|
1345
|
-
|
|
1345
|
+
*/
|
|
1346
1346
|
createVerification(url: string): Promise<Models.Token> {
|
|
1347
1347
|
if (typeof url === 'undefined') {
|
|
1348
1348
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -1371,7 +1371,7 @@ export class Account extends Service {
|
|
|
1371
1371
|
* @param {string} secret
|
|
1372
1372
|
* @throws {AppwriteException}
|
|
1373
1373
|
* @returns {Promise}
|
|
1374
|
-
|
|
1374
|
+
*/
|
|
1375
1375
|
updateVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
1376
1376
|
if (typeof userId === 'undefined') {
|
|
1377
1377
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1410,7 +1410,7 @@ export class Account extends Service {
|
|
|
1410
1410
|
*
|
|
1411
1411
|
* @throws {AppwriteException}
|
|
1412
1412
|
* @returns {Promise}
|
|
1413
|
-
|
|
1413
|
+
*/
|
|
1414
1414
|
createPhoneVerification(): Promise<Models.Token> {
|
|
1415
1415
|
const apiPath = '/account/verification/phone';
|
|
1416
1416
|
const payload: Payload = {};
|
|
@@ -1431,7 +1431,7 @@ export class Account extends Service {
|
|
|
1431
1431
|
* @param {string} secret
|
|
1432
1432
|
* @throws {AppwriteException}
|
|
1433
1433
|
* @returns {Promise}
|
|
1434
|
-
|
|
1434
|
+
*/
|
|
1435
1435
|
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
1436
1436
|
if (typeof userId === 'undefined') {
|
|
1437
1437
|
throw new AppwriteException('Missing required parameter: "userId"');
|
package/src/services/avatars.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class Avatars extends Service {
|
|
|
34
34
|
* @param {number} quality
|
|
35
35
|
* @throws {AppwriteException}
|
|
36
36
|
* @returns {ArrayBuffer}
|
|
37
|
-
|
|
37
|
+
*/
|
|
38
38
|
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer> {
|
|
39
39
|
if (typeof code === 'undefined') {
|
|
40
40
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -83,7 +83,7 @@ export class Avatars extends Service {
|
|
|
83
83
|
* @param {number} quality
|
|
84
84
|
* @throws {AppwriteException}
|
|
85
85
|
* @returns {ArrayBuffer}
|
|
86
|
-
|
|
86
|
+
*/
|
|
87
87
|
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer> {
|
|
88
88
|
if (typeof code === 'undefined') {
|
|
89
89
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -124,7 +124,7 @@ export class Avatars extends Service {
|
|
|
124
124
|
* @param {string} url
|
|
125
125
|
* @throws {AppwriteException}
|
|
126
126
|
* @returns {ArrayBuffer}
|
|
127
|
-
|
|
127
|
+
*/
|
|
128
128
|
getFavicon(url: string): Promise<ArrayBuffer> {
|
|
129
129
|
if (typeof url === 'undefined') {
|
|
130
130
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -166,7 +166,7 @@ export class Avatars extends Service {
|
|
|
166
166
|
* @param {number} quality
|
|
167
167
|
* @throws {AppwriteException}
|
|
168
168
|
* @returns {ArrayBuffer}
|
|
169
|
-
|
|
169
|
+
*/
|
|
170
170
|
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer> {
|
|
171
171
|
if (typeof code === 'undefined') {
|
|
172
172
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -216,7 +216,7 @@ export class Avatars extends Service {
|
|
|
216
216
|
* @param {number} height
|
|
217
217
|
* @throws {AppwriteException}
|
|
218
218
|
* @returns {ArrayBuffer}
|
|
219
|
-
|
|
219
|
+
*/
|
|
220
220
|
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer> {
|
|
221
221
|
if (typeof url === 'undefined') {
|
|
222
222
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -272,7 +272,7 @@ export class Avatars extends Service {
|
|
|
272
272
|
* @param {string} background
|
|
273
273
|
* @throws {AppwriteException}
|
|
274
274
|
* @returns {ArrayBuffer}
|
|
275
|
-
|
|
275
|
+
*/
|
|
276
276
|
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer> {
|
|
277
277
|
const apiPath = '/avatars/initials';
|
|
278
278
|
const payload: Payload = {};
|
|
@@ -315,7 +315,7 @@ export class Avatars extends Service {
|
|
|
315
315
|
* @param {boolean} download
|
|
316
316
|
* @throws {AppwriteException}
|
|
317
317
|
* @returns {ArrayBuffer}
|
|
318
|
-
|
|
318
|
+
*/
|
|
319
319
|
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer> {
|
|
320
320
|
if (typeof text === 'undefined') {
|
|
321
321
|
throw new AppwriteException('Missing required parameter: "text"');
|
|
@@ -387,6 +387,11 @@ export class Avatars extends Service {
|
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
390
|
+
payload['project'] = this.client.config.project;
|
|
391
|
+
|
|
392
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
393
|
+
uri.searchParams.append(key, value);
|
|
394
|
+
}
|
|
390
395
|
|
|
391
396
|
return uri;
|
|
392
397
|
}
|
|
@@ -426,6 +431,11 @@ export class Avatars extends Service {
|
|
|
426
431
|
}
|
|
427
432
|
|
|
428
433
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
434
|
+
payload['project'] = this.client.config.project;
|
|
435
|
+
|
|
436
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
437
|
+
uri.searchParams.append(key, value);
|
|
438
|
+
}
|
|
429
439
|
|
|
430
440
|
return uri;
|
|
431
441
|
}
|
|
@@ -449,6 +459,11 @@ export class Avatars extends Service {
|
|
|
449
459
|
}
|
|
450
460
|
|
|
451
461
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
462
|
+
payload['project'] = this.client.config.project;
|
|
463
|
+
|
|
464
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
465
|
+
uri.searchParams.append(key, value);
|
|
466
|
+
}
|
|
452
467
|
|
|
453
468
|
return uri;
|
|
454
469
|
}
|
|
@@ -489,6 +504,11 @@ export class Avatars extends Service {
|
|
|
489
504
|
}
|
|
490
505
|
|
|
491
506
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
507
|
+
payload['project'] = this.client.config.project;
|
|
508
|
+
|
|
509
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
510
|
+
uri.searchParams.append(key, value);
|
|
511
|
+
}
|
|
492
512
|
|
|
493
513
|
return uri;
|
|
494
514
|
}
|
|
@@ -529,6 +549,11 @@ export class Avatars extends Service {
|
|
|
529
549
|
}
|
|
530
550
|
|
|
531
551
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
552
|
+
payload['project'] = this.client.config.project;
|
|
553
|
+
|
|
554
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
555
|
+
uri.searchParams.append(key, value);
|
|
556
|
+
}
|
|
532
557
|
|
|
533
558
|
return uri;
|
|
534
559
|
}
|
|
@@ -579,6 +604,11 @@ export class Avatars extends Service {
|
|
|
579
604
|
}
|
|
580
605
|
|
|
581
606
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
607
|
+
payload['project'] = this.client.config.project;
|
|
608
|
+
|
|
609
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
610
|
+
uri.searchParams.append(key, value);
|
|
611
|
+
}
|
|
582
612
|
|
|
583
613
|
return uri;
|
|
584
614
|
}
|
|
@@ -616,6 +646,11 @@ export class Avatars extends Service {
|
|
|
616
646
|
}
|
|
617
647
|
|
|
618
648
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
649
|
+
payload['project'] = this.client.config.project;
|
|
650
|
+
|
|
651
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
652
|
+
uri.searchParams.append(key, value);
|
|
653
|
+
}
|
|
619
654
|
|
|
620
655
|
return uri;
|
|
621
656
|
}
|