@appwrite.io/console 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +45 -6
  3. package/README.md +82 -2
  4. package/dist/cjs/sdk.js +246 -193
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +246 -193
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +246 -193
  9. package/docs/examples/databases/create-document.md +1 -3
  10. package/docs/examples/databases/create-documents.md +1 -1
  11. package/docs/examples/functions/create-execution.md +1 -1
  12. package/docs/examples/organizations/get-available-credits.md +13 -0
  13. package/docs/examples/organizations/update-projects.md +14 -0
  14. package/docs/examples/vcs/get-repository-contents.md +2 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +1 -1
  17. package/src/models.ts +241 -9
  18. package/src/services/account.ts +97 -36
  19. package/src/services/avatars.ts +26 -20
  20. package/src/services/backups.ts +11 -0
  21. package/src/services/console.ts +8 -1
  22. package/src/services/databases.ts +97 -33
  23. package/src/services/domains.ts +111 -69
  24. package/src/services/functions.ts +37 -8
  25. package/src/services/graphql.ts +1 -0
  26. package/src/services/health.ts +26 -1
  27. package/src/services/locale.ts +9 -2
  28. package/src/services/messaging.ts +53 -8
  29. package/src/services/migrations.ts +12 -0
  30. package/src/services/organizations.ts +106 -16
  31. package/src/services/project.ts +5 -0
  32. package/src/services/projects.ts +50 -0
  33. package/src/services/proxy.ts +7 -0
  34. package/src/services/sites.ts +32 -4
  35. package/src/services/storage.ts +23 -9
  36. package/src/services/teams.ts +30 -17
  37. package/src/services/tokens.ts +4 -0
  38. package/src/services/users.ts +69 -27
  39. package/src/services/vcs.ts +16 -4
  40. package/types/models.d.ts +228 -192
  41. package/types/services/account.d.ts +36 -36
  42. package/types/services/avatars.d.ts +20 -20
  43. package/types/services/console.d.ts +1 -1
  44. package/types/services/databases.d.ts +43 -33
  45. package/types/services/domains.d.ts +69 -69
  46. package/types/services/functions.d.ts +8 -8
  47. package/types/services/health.d.ts +1 -1
  48. package/types/services/locale.d.ts +2 -2
  49. package/types/services/messaging.d.ts +8 -8
  50. package/types/services/organizations.d.ts +33 -16
  51. package/types/services/sites.d.ts +4 -4
  52. package/types/services/storage.d.ts +9 -9
  53. package/types/services/teams.d.ts +17 -17
  54. package/types/services/users.d.ts +27 -27
  55. package/types/services/vcs.d.ts +4 -4
@@ -21,7 +21,7 @@ export class Users {
21
21
  * @throws {AppwriteException}
22
22
  * @returns {Promise<Models.UserList<Preferences>>}
23
23
  */
24
- list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> {
24
+ list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> {
25
25
  const apiPath = '/users';
26
26
  const payload: Payload = {};
27
27
  if (typeof queries !== 'undefined') {
@@ -42,6 +42,7 @@ export class Users {
42
42
  payload
43
43
  );
44
44
  }
45
+
45
46
  /**
46
47
  * Create a new user.
47
48
  *
@@ -53,7 +54,7 @@ export class Users {
53
54
  * @throws {AppwriteException}
54
55
  * @returns {Promise<Models.User<Preferences>>}
55
56
  */
56
- create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>> {
57
+ create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>> {
57
58
  if (typeof userId === 'undefined') {
58
59
  throw new AppwriteException('Missing required parameter: "userId"');
59
60
  }
@@ -87,6 +88,7 @@ export class Users {
87
88
  payload
88
89
  );
89
90
  }
91
+
90
92
  /**
91
93
  * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
92
94
  *
@@ -97,7 +99,7 @@ export class Users {
97
99
  * @throws {AppwriteException}
98
100
  * @returns {Promise<Models.User<Preferences>>}
99
101
  */
100
- createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
102
+ createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
101
103
  if (typeof userId === 'undefined') {
102
104
  throw new AppwriteException('Missing required parameter: "userId"');
103
105
  }
@@ -134,6 +136,7 @@ export class Users {
134
136
  payload
135
137
  );
136
138
  }
139
+
137
140
  /**
138
141
  * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
139
142
  *
@@ -144,7 +147,7 @@ export class Users {
144
147
  * @throws {AppwriteException}
145
148
  * @returns {Promise<Models.User<Preferences>>}
146
149
  */
147
- createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
150
+ createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
148
151
  if (typeof userId === 'undefined') {
149
152
  throw new AppwriteException('Missing required parameter: "userId"');
150
153
  }
@@ -181,6 +184,7 @@ export class Users {
181
184
  payload
182
185
  );
183
186
  }
187
+
184
188
  /**
185
189
  * Get identities for all users.
186
190
  *
@@ -210,6 +214,7 @@ export class Users {
210
214
  payload
211
215
  );
212
216
  }
217
+
213
218
  /**
214
219
  * Delete an identity by its unique ID.
215
220
  *
@@ -236,6 +241,7 @@ export class Users {
236
241
  payload
237
242
  );
238
243
  }
244
+
239
245
  /**
240
246
  * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
241
247
  *
@@ -246,7 +252,7 @@ export class Users {
246
252
  * @throws {AppwriteException}
247
253
  * @returns {Promise<Models.User<Preferences>>}
248
254
  */
249
- createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
255
+ createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
250
256
  if (typeof userId === 'undefined') {
251
257
  throw new AppwriteException('Missing required parameter: "userId"');
252
258
  }
@@ -283,6 +289,7 @@ export class Users {
283
289
  payload
284
290
  );
285
291
  }
292
+
286
293
  /**
287
294
  * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
288
295
  *
@@ -293,7 +300,7 @@ export class Users {
293
300
  * @throws {AppwriteException}
294
301
  * @returns {Promise<Models.User<Preferences>>}
295
302
  */
296
- createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
303
+ createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
297
304
  if (typeof userId === 'undefined') {
298
305
  throw new AppwriteException('Missing required parameter: "userId"');
299
306
  }
@@ -330,6 +337,7 @@ export class Users {
330
337
  payload
331
338
  );
332
339
  }
340
+
333
341
  /**
334
342
  * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
335
343
  *
@@ -345,7 +353,7 @@ export class Users {
345
353
  * @throws {AppwriteException}
346
354
  * @returns {Promise<Models.User<Preferences>>}
347
355
  */
348
- createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>> {
356
+ createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>> {
349
357
  if (typeof userId === 'undefined') {
350
358
  throw new AppwriteException('Missing required parameter: "userId"');
351
359
  }
@@ -412,6 +420,7 @@ export class Users {
412
420
  payload
413
421
  );
414
422
  }
423
+
415
424
  /**
416
425
  * Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
417
426
  *
@@ -425,7 +434,7 @@ export class Users {
425
434
  * @throws {AppwriteException}
426
435
  * @returns {Promise<Models.User<Preferences>>}
427
436
  */
428
- createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>> {
437
+ createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>> {
429
438
  if (typeof userId === 'undefined') {
430
439
  throw new AppwriteException('Missing required parameter: "userId"');
431
440
  }
@@ -480,6 +489,7 @@ export class Users {
480
489
  payload
481
490
  );
482
491
  }
492
+
483
493
  /**
484
494
  * Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
485
495
  *
@@ -491,7 +501,7 @@ export class Users {
491
501
  * @throws {AppwriteException}
492
502
  * @returns {Promise<Models.User<Preferences>>}
493
503
  */
494
- createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>> {
504
+ createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>> {
495
505
  if (typeof userId === 'undefined') {
496
506
  throw new AppwriteException('Missing required parameter: "userId"');
497
507
  }
@@ -531,9 +541,10 @@ export class Users {
531
541
  payload
532
542
  );
533
543
  }
544
+
534
545
  /**
535
546
  * Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
536
-
547
+ *
537
548
  *
538
549
  * @param {UserUsageRange} range
539
550
  * @throws {AppwriteException}
@@ -557,6 +568,7 @@ export class Users {
557
568
  payload
558
569
  );
559
570
  }
571
+
560
572
  /**
561
573
  * Get a user by its unique ID.
562
574
  *
@@ -564,7 +576,7 @@ export class Users {
564
576
  * @throws {AppwriteException}
565
577
  * @returns {Promise<Models.User<Preferences>>}
566
578
  */
567
- get<Preferences extends Models.Preferences>(userId: string): Promise<Models.User<Preferences>> {
579
+ get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences>> {
568
580
  if (typeof userId === 'undefined') {
569
581
  throw new AppwriteException('Missing required parameter: "userId"');
570
582
  }
@@ -582,6 +594,7 @@ export class Users {
582
594
  payload
583
595
  );
584
596
  }
597
+
585
598
  /**
586
599
  * Delete a user by its unique ID, thereby releasing it&#039;s ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
587
600
  *
@@ -608,6 +621,7 @@ export class Users {
608
621
  payload
609
622
  );
610
623
  }
624
+
611
625
  /**
612
626
  * Update the user email by its unique ID.
613
627
  *
@@ -616,7 +630,7 @@ export class Users {
616
630
  * @throws {AppwriteException}
617
631
  * @returns {Promise<Models.User<Preferences>>}
618
632
  */
619
- updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>> {
633
+ updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>> {
620
634
  if (typeof userId === 'undefined') {
621
635
  throw new AppwriteException('Missing required parameter: "userId"');
622
636
  }
@@ -641,6 +655,7 @@ export class Users {
641
655
  payload
642
656
  );
643
657
  }
658
+
644
659
  /**
645
660
  * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
646
661
  *
@@ -675,17 +690,18 @@ export class Users {
675
690
  payload
676
691
  );
677
692
  }
693
+
678
694
  /**
679
695
  * Update the user labels by its unique ID.
680
-
681
- Labels can be used to grant access to resources. While teams are a way for user&#039;s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
696
+ *
697
+ * Labels can be used to grant access to resources. While teams are a way for user&#039;s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
682
698
  *
683
699
  * @param {string} userId
684
700
  * @param {string[]} labels
685
701
  * @throws {AppwriteException}
686
702
  * @returns {Promise<Models.User<Preferences>>}
687
703
  */
688
- updateLabels<Preferences extends Models.Preferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>> {
704
+ updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>> {
689
705
  if (typeof userId === 'undefined') {
690
706
  throw new AppwriteException('Missing required parameter: "userId"');
691
707
  }
@@ -710,6 +726,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
710
726
  payload
711
727
  );
712
728
  }
729
+
713
730
  /**
714
731
  * Get the user activity logs list by its unique ID.
715
732
  *
@@ -739,6 +756,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
739
756
  payload
740
757
  );
741
758
  }
759
+
742
760
  /**
743
761
  * Get the user membership list by its unique ID.
744
762
  *
@@ -772,6 +790,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
772
790
  payload
773
791
  );
774
792
  }
793
+
775
794
  /**
776
795
  * Enable or disable MFA on a user account.
777
796
  *
@@ -780,7 +799,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
780
799
  * @throws {AppwriteException}
781
800
  * @returns {Promise<Models.User<Preferences>>}
782
801
  */
783
- updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> {
802
+ updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> {
784
803
  if (typeof userId === 'undefined') {
785
804
  throw new AppwriteException('Missing required parameter: "userId"');
786
805
  }
@@ -805,6 +824,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
805
824
  payload
806
825
  );
807
826
  }
827
+
808
828
  /**
809
829
  * Delete an authenticator app.
810
830
  *
@@ -835,6 +855,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
835
855
  payload
836
856
  );
837
857
  }
858
+
838
859
  /**
839
860
  * List the factors available on the account to be used as a MFA challange.
840
861
  *
@@ -860,6 +881,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
860
881
  payload
861
882
  );
862
883
  }
884
+
863
885
  /**
864
886
  * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
865
887
  *
@@ -885,6 +907,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
885
907
  payload
886
908
  );
887
909
  }
910
+
888
911
  /**
889
912
  * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
890
913
  *
@@ -911,6 +934,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
911
934
  payload
912
935
  );
913
936
  }
937
+
914
938
  /**
915
939
  * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
916
940
  *
@@ -937,6 +961,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
937
961
  payload
938
962
  );
939
963
  }
964
+
940
965
  /**
941
966
  * Update the user name by its unique ID.
942
967
  *
@@ -945,7 +970,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
945
970
  * @throws {AppwriteException}
946
971
  * @returns {Promise<Models.User<Preferences>>}
947
972
  */
948
- updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences>> {
973
+ updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences>> {
949
974
  if (typeof userId === 'undefined') {
950
975
  throw new AppwriteException('Missing required parameter: "userId"');
951
976
  }
@@ -970,6 +995,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
970
995
  payload
971
996
  );
972
997
  }
998
+
973
999
  /**
974
1000
  * Update the user password by its unique ID.
975
1001
  *
@@ -978,7 +1004,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
978
1004
  * @throws {AppwriteException}
979
1005
  * @returns {Promise<Models.User<Preferences>>}
980
1006
  */
981
- updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>> {
1007
+ updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences>> {
982
1008
  if (typeof userId === 'undefined') {
983
1009
  throw new AppwriteException('Missing required parameter: "userId"');
984
1010
  }
@@ -1003,6 +1029,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1003
1029
  payload
1004
1030
  );
1005
1031
  }
1032
+
1006
1033
  /**
1007
1034
  * Update the user phone by its unique ID.
1008
1035
  *
@@ -1011,7 +1038,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1011
1038
  * @throws {AppwriteException}
1012
1039
  * @returns {Promise<Models.User<Preferences>>}
1013
1040
  */
1014
- updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>> {
1041
+ updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences>> {
1015
1042
  if (typeof userId === 'undefined') {
1016
1043
  throw new AppwriteException('Missing required parameter: "userId"');
1017
1044
  }
@@ -1036,6 +1063,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1036
1063
  payload
1037
1064
  );
1038
1065
  }
1066
+
1039
1067
  /**
1040
1068
  * Get the user preferences by its unique ID.
1041
1069
  *
@@ -1043,7 +1071,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1043
1071
  * @throws {AppwriteException}
1044
1072
  * @returns {Promise<Preferences>}
1045
1073
  */
1046
- getPrefs<Preferences extends Models.Preferences>(userId: string): Promise<Preferences> {
1074
+ getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences> {
1047
1075
  if (typeof userId === 'undefined') {
1048
1076
  throw new AppwriteException('Missing required parameter: "userId"');
1049
1077
  }
@@ -1061,6 +1089,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1061
1089
  payload
1062
1090
  );
1063
1091
  }
1092
+
1064
1093
  /**
1065
1094
  * Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
1066
1095
  *
@@ -1069,7 +1098,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1069
1098
  * @throws {AppwriteException}
1070
1099
  * @returns {Promise<Preferences>}
1071
1100
  */
1072
- updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences> {
1101
+ updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences> {
1073
1102
  if (typeof userId === 'undefined') {
1074
1103
  throw new AppwriteException('Missing required parameter: "userId"');
1075
1104
  }
@@ -1094,6 +1123,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
1094
1123
  payload
1095
1124
  );
1096
1125
  }
1126
+
1097
1127
  /**
1098
1128
  * Get the user sessions list by its unique ID.
1099
1129
  *
@@ -1119,10 +1149,11 @@ Labels can be used to grant access to resources. While teams are a way for user&
1119
1149
  payload
1120
1150
  );
1121
1151
  }
1152
+
1122
1153
  /**
1123
1154
  * Creates a session for a user. Returns an immediately usable session object.
1124
-
1125
- If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
1155
+ *
1156
+ * If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
1126
1157
  *
1127
1158
  * @param {string} userId
1128
1159
  * @throws {AppwriteException}
@@ -1147,6 +1178,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1147
1178
  payload
1148
1179
  );
1149
1180
  }
1181
+
1150
1182
  /**
1151
1183
  * Delete all user&#039;s sessions by using the user&#039;s unique ID.
1152
1184
  *
@@ -1173,6 +1205,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1173
1205
  payload
1174
1206
  );
1175
1207
  }
1208
+
1176
1209
  /**
1177
1210
  * Delete a user sessions by its unique ID.
1178
1211
  *
@@ -1203,6 +1236,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1203
1236
  payload
1204
1237
  );
1205
1238
  }
1239
+
1206
1240
  /**
1207
1241
  * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user&#039;s ID reserved.
1208
1242
  *
@@ -1211,7 +1245,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1211
1245
  * @throws {AppwriteException}
1212
1246
  * @returns {Promise<Models.User<Preferences>>}
1213
1247
  */
1214
- updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences>> {
1248
+ updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences>> {
1215
1249
  if (typeof userId === 'undefined') {
1216
1250
  throw new AppwriteException('Missing required parameter: "userId"');
1217
1251
  }
@@ -1236,6 +1270,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1236
1270
  payload
1237
1271
  );
1238
1272
  }
1273
+
1239
1274
  /**
1240
1275
  * List the messaging targets that are associated with a user.
1241
1276
  *
@@ -1265,6 +1300,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1265
1300
  payload
1266
1301
  );
1267
1302
  }
1303
+
1268
1304
  /**
1269
1305
  * Create a messaging target.
1270
1306
  *
@@ -1320,6 +1356,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1320
1356
  payload
1321
1357
  );
1322
1358
  }
1359
+
1323
1360
  /**
1324
1361
  * Get a user&#039;s push notification target by ID.
1325
1362
  *
@@ -1349,6 +1386,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1349
1386
  payload
1350
1387
  );
1351
1388
  }
1389
+
1352
1390
  /**
1353
1391
  * Update a messaging target.
1354
1392
  *
@@ -1391,6 +1429,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1391
1429
  payload
1392
1430
  );
1393
1431
  }
1432
+
1394
1433
  /**
1395
1434
  * Delete a messaging target.
1396
1435
  *
@@ -1421,9 +1460,10 @@ If you want to generate a token for a custom authentication flow, use the [POST
1421
1460
  payload
1422
1461
  );
1423
1462
  }
1463
+
1424
1464
  /**
1425
1465
  * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
1426
-
1466
+ *
1427
1467
  *
1428
1468
  * @param {string} userId
1429
1469
  * @param {number} length
@@ -1456,6 +1496,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1456
1496
  payload
1457
1497
  );
1458
1498
  }
1499
+
1459
1500
  /**
1460
1501
  * Update the user email verification status by its unique ID.
1461
1502
  *
@@ -1464,7 +1505,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1464
1505
  * @throws {AppwriteException}
1465
1506
  * @returns {Promise<Models.User<Preferences>>}
1466
1507
  */
1467
- updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>> {
1508
+ updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>> {
1468
1509
  if (typeof userId === 'undefined') {
1469
1510
  throw new AppwriteException('Missing required parameter: "userId"');
1470
1511
  }
@@ -1489,6 +1530,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1489
1530
  payload
1490
1531
  );
1491
1532
  }
1533
+
1492
1534
  /**
1493
1535
  * Update the user phone verification status by its unique ID.
1494
1536
  *
@@ -1497,7 +1539,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
1497
1539
  * @throws {AppwriteException}
1498
1540
  * @returns {Promise<Models.User<Preferences>>}
1499
1541
  */
1500
- updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>> {
1542
+ updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>> {
1501
1543
  if (typeof userId === 'undefined') {
1502
1544
  throw new AppwriteException('Missing required parameter: "userId"');
1503
1545
  }
@@ -54,6 +54,7 @@ export class Vcs {
54
54
  payload
55
55
  );
56
56
  }
57
+
57
58
  /**
58
59
  * Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository&#039;s runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.
59
60
  *
@@ -90,6 +91,7 @@ export class Vcs {
90
91
  payload
91
92
  );
92
93
  }
94
+
93
95
  /**
94
96
  * Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.
95
97
  *
@@ -130,6 +132,7 @@ export class Vcs {
130
132
  payload
131
133
  );
132
134
  }
135
+
133
136
  /**
134
137
  * Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.
135
138
  *
@@ -159,9 +162,10 @@ export class Vcs {
159
162
  payload
160
163
  );
161
164
  }
165
+
162
166
  /**
163
167
  * Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.
164
-
168
+ *
165
169
  *
166
170
  * @param {string} installationId
167
171
  * @param {string} providerRepositoryId
@@ -189,17 +193,18 @@ export class Vcs {
189
193
  payload
190
194
  );
191
195
  }
196
+
192
197
  /**
193
198
  * Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.
194
-
195
199
  *
196
200
  * @param {string} installationId
197
201
  * @param {string} providerRepositoryId
198
202
  * @param {string} providerRootDirectory
203
+ * @param {string} providerReference
199
204
  * @throws {AppwriteException}
200
205
  * @returns {Promise<Models.VcsContentList>}
201
206
  */
202
- getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise<Models.VcsContentList> {
207
+ getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string, providerReference?: string): Promise<Models.VcsContentList> {
203
208
  if (typeof installationId === 'undefined') {
204
209
  throw new AppwriteException('Missing required parameter: "installationId"');
205
210
  }
@@ -211,6 +216,9 @@ export class Vcs {
211
216
  if (typeof providerRootDirectory !== 'undefined') {
212
217
  payload['providerRootDirectory'] = providerRootDirectory;
213
218
  }
219
+ if (typeof providerReference !== 'undefined') {
220
+ payload['providerReference'] = providerReference;
221
+ }
214
222
  const uri = new URL(this.client.config.endpoint + apiPath);
215
223
 
216
224
  const apiHeaders: { [header: string]: string } = {
@@ -223,6 +231,7 @@ export class Vcs {
223
231
  payload
224
232
  );
225
233
  }
234
+
226
235
  /**
227
236
  * Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.
228
237
  *
@@ -260,9 +269,10 @@ export class Vcs {
260
269
  payload
261
270
  );
262
271
  }
272
+
263
273
  /**
264
274
  * List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.
265
-
275
+ *
266
276
  *
267
277
  * @param {string[]} queries
268
278
  * @param {string} search
@@ -290,6 +300,7 @@ export class Vcs {
290
300
  payload
291
301
  );
292
302
  }
303
+
293
304
  /**
294
305
  * Get a VCS installation by its unique ID. This endpoint returns the installation&#039;s details including its provider, organization, and configuration.
295
306
  *
@@ -315,6 +326,7 @@ export class Vcs {
315
326
  payload
316
327
  );
317
328
  }
329
+
318
330
  /**
319
331
  * Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.
320
332
  *