react-native-appwrite 0.10.1 → 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.
@@ -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"');
@@ -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"');
@@ -22,8 +22,8 @@ export class Databases extends Service {
22
22
  * @param {string[]} queries
23
23
  * @throws {AppwriteException}
24
24
  * @returns {Promise}
25
- */
26
- listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
25
+ */
26
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
27
27
  if (typeof databaseId === 'undefined') {
28
28
  throw new AppwriteException('Missing required parameter: "databaseId"');
29
29
  }
@@ -57,8 +57,8 @@ export class Databases extends Service {
57
57
  * @param {string[]} permissions
58
58
  * @throws {AppwriteException}
59
59
  * @returns {Promise}
60
- */
61
- createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
60
+ */
61
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
62
62
  if (typeof databaseId === 'undefined') {
63
63
  throw new AppwriteException('Missing required parameter: "databaseId"');
64
64
  }
@@ -106,8 +106,8 @@ export class Databases extends Service {
106
106
  * @param {string[]} queries
107
107
  * @throws {AppwriteException}
108
108
  * @returns {Promise}
109
- */
110
- getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
109
+ */
110
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
111
111
  if (typeof databaseId === 'undefined') {
112
112
  throw new AppwriteException('Missing required parameter: "databaseId"');
113
113
  }
@@ -149,8 +149,8 @@ export class Databases extends Service {
149
149
  * @param {string[]} permissions
150
150
  * @throws {AppwriteException}
151
151
  * @returns {Promise}
152
- */
153
- upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
152
+ */
153
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
154
154
  if (typeof databaseId === 'undefined') {
155
155
  throw new AppwriteException('Missing required parameter: "databaseId"');
156
156
  }
@@ -195,8 +195,8 @@ export class Databases extends Service {
195
195
  * @param {string[]} permissions
196
196
  * @throws {AppwriteException}
197
197
  * @returns {Promise}
198
- */
199
- updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
198
+ */
199
+ updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
200
200
  if (typeof databaseId === 'undefined') {
201
201
  throw new AppwriteException('Missing required parameter: "databaseId"');
202
202
  }
@@ -234,7 +234,7 @@ export class Databases extends Service {
234
234
  * @param {string} documentId
235
235
  * @throws {AppwriteException}
236
236
  * @returns {Promise}
237
- */
237
+ */
238
238
  deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
239
239
  if (typeof databaseId === 'undefined') {
240
240
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -256,4 +256,96 @@ export class Databases extends Service {
256
256
  'content-type': 'application/json',
257
257
  }, payload);
258
258
  }
259
+
260
+ /**
261
+ * Decrement a specific attribute of a document by a given value.
262
+ *
263
+ * @param {string} databaseId
264
+ * @param {string} collectionId
265
+ * @param {string} documentId
266
+ * @param {string} attribute
267
+ * @param {number} value
268
+ * @param {number} min
269
+ * @throws {AppwriteException}
270
+ * @returns {Promise}
271
+ */
272
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document> {
273
+ if (typeof databaseId === 'undefined') {
274
+ throw new AppwriteException('Missing required parameter: "databaseId"');
275
+ }
276
+
277
+ if (typeof collectionId === 'undefined') {
278
+ throw new AppwriteException('Missing required parameter: "collectionId"');
279
+ }
280
+
281
+ if (typeof documentId === 'undefined') {
282
+ throw new AppwriteException('Missing required parameter: "documentId"');
283
+ }
284
+
285
+ if (typeof attribute === 'undefined') {
286
+ throw new AppwriteException('Missing required parameter: "attribute"');
287
+ }
288
+
289
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
290
+ const payload: Payload = {};
291
+
292
+ if (typeof value !== 'undefined') {
293
+ payload['value'] = value;
294
+ }
295
+
296
+ if (typeof min !== 'undefined') {
297
+ payload['min'] = min;
298
+ }
299
+
300
+ const uri = new URL(this.client.config.endpoint + apiPath);
301
+ return this.client.call('patch', uri, {
302
+ 'content-type': 'application/json',
303
+ }, payload);
304
+ }
305
+
306
+ /**
307
+ * Increment a specific attribute of a document by a given value.
308
+ *
309
+ * @param {string} databaseId
310
+ * @param {string} collectionId
311
+ * @param {string} documentId
312
+ * @param {string} attribute
313
+ * @param {number} value
314
+ * @param {number} max
315
+ * @throws {AppwriteException}
316
+ * @returns {Promise}
317
+ */
318
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document> {
319
+ if (typeof databaseId === 'undefined') {
320
+ throw new AppwriteException('Missing required parameter: "databaseId"');
321
+ }
322
+
323
+ if (typeof collectionId === 'undefined') {
324
+ throw new AppwriteException('Missing required parameter: "collectionId"');
325
+ }
326
+
327
+ if (typeof documentId === 'undefined') {
328
+ throw new AppwriteException('Missing required parameter: "documentId"');
329
+ }
330
+
331
+ if (typeof attribute === 'undefined') {
332
+ throw new AppwriteException('Missing required parameter: "attribute"');
333
+ }
334
+
335
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
336
+ const payload: Payload = {};
337
+
338
+ if (typeof value !== 'undefined') {
339
+ payload['value'] = value;
340
+ }
341
+
342
+ if (typeof max !== 'undefined') {
343
+ payload['max'] = max;
344
+ }
345
+
346
+ const uri = new URL(this.client.config.endpoint + apiPath);
347
+ return this.client.call('patch', uri, {
348
+ 'content-type': 'application/json',
349
+ }, payload);
350
+ }
259
351
  };