node-appwrite 8.2.0 → 10.0.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 (185) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/docs/examples/account/create-phone-verification.md +1 -1
  4. package/docs/examples/account/create-recovery.md +1 -1
  5. package/docs/examples/account/create-verification.md +1 -1
  6. package/docs/examples/account/delete-identity.md +20 -0
  7. package/docs/examples/account/delete-session.md +1 -1
  8. package/docs/examples/account/delete-sessions.md +1 -1
  9. package/docs/examples/account/get-prefs.md +1 -1
  10. package/docs/examples/account/get-session.md +1 -1
  11. package/docs/examples/account/get.md +1 -1
  12. package/docs/examples/account/list-identities.md +20 -0
  13. package/docs/examples/account/list-logs.md +1 -1
  14. package/docs/examples/account/list-sessions.md +1 -1
  15. package/docs/examples/account/update-email.md +1 -1
  16. package/docs/examples/account/update-name.md +1 -1
  17. package/docs/examples/account/update-password.md +2 -2
  18. package/docs/examples/account/update-phone-verification.md +1 -1
  19. package/docs/examples/account/update-phone.md +1 -1
  20. package/docs/examples/account/update-prefs.md +1 -1
  21. package/docs/examples/account/update-recovery.md +1 -1
  22. package/docs/examples/account/update-session.md +1 -1
  23. package/docs/examples/account/update-status.md +1 -1
  24. package/docs/examples/account/update-verification.md +1 -1
  25. package/docs/examples/avatars/get-browser.md +1 -1
  26. package/docs/examples/avatars/get-credit-card.md +1 -1
  27. package/docs/examples/avatars/get-favicon.md +1 -1
  28. package/docs/examples/avatars/get-flag.md +1 -1
  29. package/docs/examples/avatars/get-image.md +1 -1
  30. package/docs/examples/avatars/get-initials.md +1 -1
  31. package/docs/examples/avatars/get-q-r.md +1 -1
  32. package/docs/examples/databases/create-boolean-attribute.md +1 -1
  33. package/docs/examples/databases/create-collection.md +1 -1
  34. package/docs/examples/databases/create-datetime-attribute.md +1 -1
  35. package/docs/examples/databases/create-document.md +1 -1
  36. package/docs/examples/databases/create-email-attribute.md +1 -1
  37. package/docs/examples/databases/create-enum-attribute.md +1 -1
  38. package/docs/examples/databases/create-float-attribute.md +1 -1
  39. package/docs/examples/databases/create-index.md +1 -1
  40. package/docs/examples/databases/create-integer-attribute.md +1 -1
  41. package/docs/examples/databases/create-ip-attribute.md +1 -1
  42. package/docs/examples/databases/create-relationship-attribute.md +20 -0
  43. package/docs/examples/databases/create-string-attribute.md +1 -1
  44. package/docs/examples/databases/create-url-attribute.md +1 -1
  45. package/docs/examples/databases/create.md +1 -1
  46. package/docs/examples/databases/delete-attribute.md +1 -1
  47. package/docs/examples/databases/delete-collection.md +1 -1
  48. package/docs/examples/databases/delete-document.md +1 -1
  49. package/docs/examples/databases/delete-index.md +1 -1
  50. package/docs/examples/databases/delete.md +1 -1
  51. package/docs/examples/databases/get-attribute.md +1 -1
  52. package/docs/examples/databases/get-collection.md +1 -1
  53. package/docs/examples/databases/get-document.md +1 -1
  54. package/docs/examples/databases/get-index.md +1 -1
  55. package/docs/examples/databases/get.md +1 -1
  56. package/docs/examples/databases/list-attributes.md +1 -1
  57. package/docs/examples/databases/list-collections.md +1 -1
  58. package/docs/examples/databases/list-documents.md +1 -1
  59. package/docs/examples/databases/list-indexes.md +1 -1
  60. package/docs/examples/databases/list.md +1 -1
  61. package/docs/examples/databases/update-boolean-attribute.md +20 -0
  62. package/docs/examples/databases/update-collection.md +1 -1
  63. package/docs/examples/databases/update-datetime-attribute.md +20 -0
  64. package/docs/examples/databases/update-document.md +1 -1
  65. package/docs/examples/databases/update-email-attribute.md +20 -0
  66. package/docs/examples/databases/update-enum-attribute.md +20 -0
  67. package/docs/examples/databases/update-float-attribute.md +20 -0
  68. package/docs/examples/databases/update-integer-attribute.md +20 -0
  69. package/docs/examples/databases/update-ip-attribute.md +20 -0
  70. package/docs/examples/databases/update-relationship-attribute.md +20 -0
  71. package/docs/examples/databases/update-string-attribute.md +20 -0
  72. package/docs/examples/databases/update-url-attribute.md +20 -0
  73. package/docs/examples/databases/update.md +1 -1
  74. package/docs/examples/functions/create-build.md +1 -1
  75. package/docs/examples/functions/create-deployment.md +2 -2
  76. package/docs/examples/functions/create-execution.md +1 -1
  77. package/docs/examples/functions/create-variable.md +1 -1
  78. package/docs/examples/functions/create.md +2 -2
  79. package/docs/examples/functions/delete-deployment.md +1 -1
  80. package/docs/examples/functions/delete-variable.md +1 -1
  81. package/docs/examples/functions/delete.md +1 -1
  82. package/docs/examples/functions/download-deployment.md +20 -0
  83. package/docs/examples/functions/get-deployment.md +1 -1
  84. package/docs/examples/functions/get-execution.md +1 -1
  85. package/docs/examples/functions/get-variable.md +1 -1
  86. package/docs/examples/functions/get.md +1 -1
  87. package/docs/examples/functions/list-deployments.md +1 -1
  88. package/docs/examples/functions/list-executions.md +1 -1
  89. package/docs/examples/functions/list-runtimes.md +1 -1
  90. package/docs/examples/functions/list-variables.md +1 -1
  91. package/docs/examples/functions/list.md +1 -1
  92. package/docs/examples/functions/update-deployment.md +1 -1
  93. package/docs/examples/functions/update-variable.md +1 -1
  94. package/docs/examples/functions/update.md +2 -2
  95. package/docs/examples/graphql/mutation.md +1 -1
  96. package/docs/examples/graphql/query.md +1 -1
  97. package/docs/examples/health/get-antivirus.md +1 -1
  98. package/docs/examples/health/get-cache.md +1 -1
  99. package/docs/examples/health/get-d-b.md +1 -1
  100. package/docs/examples/health/get-pub-sub.md +20 -0
  101. package/docs/examples/health/get-queue-certificates.md +1 -1
  102. package/docs/examples/health/get-queue-functions.md +1 -1
  103. package/docs/examples/health/get-queue-logs.md +1 -1
  104. package/docs/examples/health/get-queue-webhooks.md +1 -1
  105. package/docs/examples/health/get-queue.md +20 -0
  106. package/docs/examples/health/get-storage-local.md +1 -1
  107. package/docs/examples/health/get-time.md +1 -1
  108. package/docs/examples/health/get.md +1 -1
  109. package/docs/examples/locale/get.md +1 -1
  110. package/docs/examples/locale/list-codes.md +20 -0
  111. package/docs/examples/locale/list-continents.md +1 -1
  112. package/docs/examples/locale/list-countries-e-u.md +1 -1
  113. package/docs/examples/locale/list-countries-phones.md +1 -1
  114. package/docs/examples/locale/list-countries.md +1 -1
  115. package/docs/examples/locale/list-currencies.md +1 -1
  116. package/docs/examples/locale/list-languages.md +1 -1
  117. package/docs/examples/storage/create-bucket.md +1 -1
  118. package/docs/examples/storage/create-file.md +1 -1
  119. package/docs/examples/storage/delete-bucket.md +1 -1
  120. package/docs/examples/storage/delete-file.md +1 -1
  121. package/docs/examples/storage/get-bucket.md +1 -1
  122. package/docs/examples/storage/get-file-download.md +1 -1
  123. package/docs/examples/storage/get-file-preview.md +1 -1
  124. package/docs/examples/storage/get-file-view.md +1 -1
  125. package/docs/examples/storage/get-file.md +1 -1
  126. package/docs/examples/storage/list-buckets.md +1 -1
  127. package/docs/examples/storage/list-files.md +1 -1
  128. package/docs/examples/storage/update-bucket.md +1 -1
  129. package/docs/examples/storage/update-file.md +1 -1
  130. package/docs/examples/teams/create-membership.md +2 -2
  131. package/docs/examples/teams/create.md +1 -1
  132. package/docs/examples/teams/delete-membership.md +1 -1
  133. package/docs/examples/teams/delete.md +1 -1
  134. package/docs/examples/teams/get-membership.md +1 -1
  135. package/docs/examples/teams/get-prefs.md +20 -0
  136. package/docs/examples/teams/get.md +1 -1
  137. package/docs/examples/teams/list-memberships.md +1 -1
  138. package/docs/examples/teams/list.md +1 -1
  139. package/docs/examples/teams/update-membership-status.md +1 -1
  140. package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +2 -2
  141. package/docs/examples/teams/{update.md → update-name.md} +2 -2
  142. package/docs/examples/teams/update-prefs.md +20 -0
  143. package/docs/examples/users/create-argon2user.md +1 -1
  144. package/docs/examples/users/create-bcrypt-user.md +1 -1
  145. package/docs/examples/users/create-m-d5user.md +1 -1
  146. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  147. package/docs/examples/users/create-s-h-a-user.md +1 -1
  148. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  149. package/docs/examples/users/create-scrypt-user.md +1 -1
  150. package/docs/examples/users/create.md +1 -1
  151. package/docs/examples/users/delete-identity.md +20 -0
  152. package/docs/examples/users/delete-session.md +1 -1
  153. package/docs/examples/users/delete-sessions.md +1 -1
  154. package/docs/examples/users/delete.md +1 -1
  155. package/docs/examples/users/get-prefs.md +1 -1
  156. package/docs/examples/users/get.md +1 -1
  157. package/docs/examples/users/list-identities.md +20 -0
  158. package/docs/examples/users/list-logs.md +1 -1
  159. package/docs/examples/users/list-memberships.md +1 -1
  160. package/docs/examples/users/list-sessions.md +1 -1
  161. package/docs/examples/users/list.md +1 -1
  162. package/docs/examples/users/update-email-verification.md +1 -1
  163. package/docs/examples/users/update-email.md +1 -1
  164. package/docs/examples/users/update-labels.md +20 -0
  165. package/docs/examples/users/update-name.md +1 -1
  166. package/docs/examples/users/update-password.md +2 -2
  167. package/docs/examples/users/update-phone-verification.md +1 -1
  168. package/docs/examples/users/update-phone.md +1 -1
  169. package/docs/examples/users/update-prefs.md +1 -1
  170. package/docs/examples/users/update-status.md +1 -1
  171. package/index.d.ts +767 -165
  172. package/lib/client.js +5 -2
  173. package/lib/inputFile.js +6 -8
  174. package/lib/query.js +18 -0
  175. package/lib/services/account.js +94 -50
  176. package/lib/services/avatars.js +14 -14
  177. package/lib/services/databases.js +826 -180
  178. package/lib/services/functions.js +254 -101
  179. package/lib/services/graphql.js +4 -4
  180. package/lib/services/health.js +57 -22
  181. package/lib/services/locale.js +32 -14
  182. package/lib/services/storage.js +76 -63
  183. package/lib/services/teams.js +112 -43
  184. package/lib/services/users.js +135 -50
  185. package/package.json +6 -4
package/index.d.ts CHANGED
@@ -79,6 +79,19 @@ declare module "node-appwrite" {
79
79
  sessions: Session[];
80
80
  }
81
81
  /**
82
+ * Identities List
83
+ */
84
+ export type IdentityList = {
85
+ /**
86
+ * Total number of identities documents that matched your query.
87
+ */
88
+ total: number;
89
+ /**
90
+ * List of identities.
91
+ */
92
+ identities: Identity[];
93
+ }
94
+ /**
82
95
  * Logs List
83
96
  */
84
97
  export type LogList = {
@@ -120,7 +133,7 @@ declare module "node-appwrite" {
120
133
  /**
121
134
  * Teams List
122
135
  */
123
- export type TeamList = {
136
+ export type TeamList<Preferences extends Models.Preferences> = {
124
137
  /**
125
138
  * Total number of teams documents that matched your query.
126
139
  */
@@ -128,7 +141,7 @@ declare module "node-appwrite" {
128
141
  /**
129
142
  * List of teams.
130
143
  */
131
- teams: Team[];
144
+ teams: Team<Preferences>[];
132
145
  }
133
146
  /**
134
147
  * Memberships List
@@ -274,6 +287,19 @@ declare module "node-appwrite" {
274
287
  variables: Variable[];
275
288
  }
276
289
  /**
290
+ * Locale codes list
291
+ */
292
+ export type LocaleCodeList = {
293
+ /**
294
+ * Total number of localeCodes documents that matched your query.
295
+ */
296
+ total: number;
297
+ /**
298
+ * List of localeCodes.
299
+ */
300
+ localeCodes: LocaleCode[];
301
+ }
302
+ /**
277
303
  * Database
278
304
  */
279
305
  export type Database = {
@@ -293,6 +319,10 @@ declare module "node-appwrite" {
293
319
  * Database update date in ISO 8601 format.
294
320
  */
295
321
  $updatedAt: string;
322
+ /**
323
+ * If database is enabled. Can be &#039;enabled&#039; or &#039;disabled&#039;. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
324
+ */
325
+ enabled: boolean;
296
326
  }
297
327
  /**
298
328
  * Collection
@@ -323,7 +353,7 @@ declare module "node-appwrite" {
323
353
  */
324
354
  name: string;
325
355
  /**
326
- * Collection enabled.
356
+ * Collection enabled. Can be &#039;enabled&#039; or &#039;disabled&#039;. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.
327
357
  */
328
358
  enabled: boolean;
329
359
  /**
@@ -369,6 +399,10 @@ declare module "node-appwrite" {
369
399
  */
370
400
  status: string;
371
401
  /**
402
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
403
+ */
404
+ error: string;
405
+ /**
372
406
  * Is attribute required?
373
407
  */
374
408
  required: boolean;
@@ -402,6 +436,10 @@ declare module "node-appwrite" {
402
436
  */
403
437
  status: string;
404
438
  /**
439
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
440
+ */
441
+ error: string;
442
+ /**
405
443
  * Is attribute required?
406
444
  */
407
445
  required: boolean;
@@ -439,6 +477,10 @@ declare module "node-appwrite" {
439
477
  */
440
478
  status: string;
441
479
  /**
480
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
481
+ */
482
+ error: string;
483
+ /**
442
484
  * Is attribute required?
443
485
  */
444
486
  required: boolean;
@@ -476,6 +518,10 @@ declare module "node-appwrite" {
476
518
  */
477
519
  status: string;
478
520
  /**
521
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
522
+ */
523
+ error: string;
524
+ /**
479
525
  * Is attribute required?
480
526
  */
481
527
  required: boolean;
@@ -505,6 +551,10 @@ declare module "node-appwrite" {
505
551
  */
506
552
  status: string;
507
553
  /**
554
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
555
+ */
556
+ error: string;
557
+ /**
508
558
  * Is attribute required?
509
559
  */
510
560
  required: boolean;
@@ -538,6 +588,10 @@ declare module "node-appwrite" {
538
588
  */
539
589
  status: string;
540
590
  /**
591
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
592
+ */
593
+ error: string;
594
+ /**
541
595
  * Is attribute required?
542
596
  */
543
597
  required: boolean;
@@ -575,6 +629,10 @@ declare module "node-appwrite" {
575
629
  */
576
630
  status: string;
577
631
  /**
632
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
633
+ */
634
+ error: string;
635
+ /**
578
636
  * Is attribute required?
579
637
  */
580
638
  required: boolean;
@@ -608,6 +666,10 @@ declare module "node-appwrite" {
608
666
  */
609
667
  status: string;
610
668
  /**
669
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
670
+ */
671
+ error: string;
672
+ /**
611
673
  * Is attribute required?
612
674
  */
613
675
  required: boolean;
@@ -641,6 +703,10 @@ declare module "node-appwrite" {
641
703
  */
642
704
  status: string;
643
705
  /**
706
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
707
+ */
708
+ error: string;
709
+ /**
644
710
  * Is attribute required?
645
711
  */
646
712
  required: boolean;
@@ -658,6 +724,59 @@ declare module "node-appwrite" {
658
724
  xdefault?: string;
659
725
  }
660
726
  /**
727
+ * AttributeRelationship
728
+ */
729
+ export type AttributeRelationship = {
730
+ /**
731
+ * Attribute Key.
732
+ */
733
+ key: string;
734
+ /**
735
+ * Attribute type.
736
+ */
737
+ type: string;
738
+ /**
739
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
740
+ */
741
+ status: string;
742
+ /**
743
+ * Error message. Displays error generated on failure of creating or deleting an attribute.
744
+ */
745
+ error: string;
746
+ /**
747
+ * Is attribute required?
748
+ */
749
+ required: boolean;
750
+ /**
751
+ * Is attribute an array?
752
+ */
753
+ array?: boolean;
754
+ /**
755
+ * The ID of the related collection.
756
+ */
757
+ relatedCollection: string;
758
+ /**
759
+ * The type of the relationship.
760
+ */
761
+ relationType: string;
762
+ /**
763
+ * Is the relationship two-way?
764
+ */
765
+ twoWay: boolean;
766
+ /**
767
+ * The key of the two-way relationship.
768
+ */
769
+ twoWayKey: string;
770
+ /**
771
+ * How deleting the parent document will propagate to child documents.
772
+ */
773
+ onDelete: string;
774
+ /**
775
+ * Whether this is the parent or child side of the relationship
776
+ */
777
+ side: string;
778
+ }
779
+ /**
661
780
  * Index
662
781
  */
663
782
  export type Index = {
@@ -674,6 +793,10 @@ declare module "node-appwrite" {
674
793
  */
675
794
  status: string;
676
795
  /**
796
+ * Error message. Displays error generated on failure of creating or deleting an index.
797
+ */
798
+ error: string;
799
+ /**
677
800
  * Index attributes.
678
801
  */
679
802
  attributes: string[];
@@ -823,15 +946,15 @@ declare module "node-appwrite" {
823
946
  /**
824
947
  * Hashed user password.
825
948
  */
826
- password: string;
949
+ password?: string;
827
950
  /**
828
951
  * Password hashing algorithm.
829
952
  */
830
- hash: string;
953
+ hash?: string;
831
954
  /**
832
955
  * Password hashing algorithm configuration.
833
956
  */
834
- hashOptions: object;
957
+ hashOptions?: object;
835
958
  /**
836
959
  * User registration date in ISO 8601 format.
837
960
  */
@@ -841,6 +964,10 @@ declare module "node-appwrite" {
841
964
  */
842
965
  status: boolean;
843
966
  /**
967
+ * Labels for the user.
968
+ */
969
+ labels: string[];
970
+ /**
844
971
  * Password update time in ISO 8601 format.
845
972
  */
846
973
  passwordUpdate: string;
@@ -864,6 +991,10 @@ declare module "node-appwrite" {
864
991
  * User preferences as a key-value object
865
992
  */
866
993
  prefs: Preferences;
994
+ /**
995
+ * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
996
+ */
997
+ accessedAt: string;
867
998
  }
868
999
  /**
869
1000
  * AlgoMD5
@@ -969,59 +1100,6 @@ declare module "node-appwrite" {
969
1100
  threads: number;
970
1101
  }
971
1102
  /**
972
- * Account
973
- */
974
- export type Account<Preferences extends Models.Preferences> = {
975
- /**
976
- * User ID.
977
- */
978
- $id: string;
979
- /**
980
- * User creation date in ISO 8601 format.
981
- */
982
- $createdAt: string;
983
- /**
984
- * User update date in ISO 8601 format.
985
- */
986
- $updatedAt: string;
987
- /**
988
- * User name.
989
- */
990
- name: string;
991
- /**
992
- * User registration date in ISO 8601 format.
993
- */
994
- registration: string;
995
- /**
996
- * User status. Pass `true` for enabled and `false` for disabled.
997
- */
998
- status: boolean;
999
- /**
1000
- * Password update time in ISO 8601 format.
1001
- */
1002
- passwordUpdate: string;
1003
- /**
1004
- * User email address.
1005
- */
1006
- email: string;
1007
- /**
1008
- * User phone number in E.164 format.
1009
- */
1010
- phone: string;
1011
- /**
1012
- * Email verification status.
1013
- */
1014
- emailVerification: boolean;
1015
- /**
1016
- * Phone verification status.
1017
- */
1018
- phoneVerification: boolean;
1019
- /**
1020
- * User preferences as a key-value object
1021
- */
1022
- prefs: Preferences;
1023
- }
1024
- /**
1025
1103
  * Preferences
1026
1104
  */
1027
1105
  export type Preferences = {
@@ -1132,6 +1210,51 @@ declare module "node-appwrite" {
1132
1210
  current: boolean;
1133
1211
  }
1134
1212
  /**
1213
+ * Identity
1214
+ */
1215
+ export type Identity = {
1216
+ /**
1217
+ * Identity ID.
1218
+ */
1219
+ $id: string;
1220
+ /**
1221
+ * Identity creation date in ISO 8601 format.
1222
+ */
1223
+ $createdAt: string;
1224
+ /**
1225
+ * Identity update date in ISO 8601 format.
1226
+ */
1227
+ $updatedAt: string;
1228
+ /**
1229
+ * User ID.
1230
+ */
1231
+ userId: string;
1232
+ /**
1233
+ * Identity Provider.
1234
+ */
1235
+ provider: string;
1236
+ /**
1237
+ * ID of the User in the Identity Provider.
1238
+ */
1239
+ providerUid: string;
1240
+ /**
1241
+ * Email of the User in the Identity Provider.
1242
+ */
1243
+ providerEmail: string;
1244
+ /**
1245
+ * Identity Provider Access Token.
1246
+ */
1247
+ providerAccessToken: string;
1248
+ /**
1249
+ * The date of when the access token expires in ISO 8601 format.
1250
+ */
1251
+ providerAccessTokenExpiry: string;
1252
+ /**
1253
+ * Identity Provider Refresh Token.
1254
+ */
1255
+ providerRefreshToken: string;
1256
+ }
1257
+ /**
1135
1258
  * Token
1136
1259
  */
1137
1260
  export type Token = {
@@ -1181,7 +1304,7 @@ declare module "node-appwrite" {
1181
1304
  */
1182
1305
  continent: string;
1183
1306
  /**
1184
- * True if country is part of the Europian Union.
1307
+ * True if country is part of the European Union.
1185
1308
  */
1186
1309
  eu: boolean;
1187
1310
  /**
@@ -1190,6 +1313,19 @@ declare module "node-appwrite" {
1190
1313
  currency: string;
1191
1314
  }
1192
1315
  /**
1316
+ * LocaleCode
1317
+ */
1318
+ export type LocaleCode = {
1319
+ /**
1320
+ * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
1321
+ */
1322
+ code: string;
1323
+ /**
1324
+ * Locale name
1325
+ */
1326
+ name: string;
1327
+ }
1328
+ /**
1193
1329
  * File
1194
1330
  */
1195
1331
  export type File = {
@@ -1294,7 +1430,7 @@ declare module "node-appwrite" {
1294
1430
  /**
1295
1431
  * Team
1296
1432
  */
1297
- export type Team = {
1433
+ export type Team<Preferences extends Models.Preferences> = {
1298
1434
  /**
1299
1435
  * Team ID.
1300
1436
  */
@@ -1315,6 +1451,10 @@ declare module "node-appwrite" {
1315
1451
  * Total number of team members.
1316
1452
  */
1317
1453
  total: number;
1454
+ /**
1455
+ * Team preferences as a key-value object
1456
+ */
1457
+ prefs: Preferences;
1318
1458
  }
1319
1459
  /**
1320
1460
  * Membership
@@ -1398,6 +1538,14 @@ declare module "node-appwrite" {
1398
1538
  */
1399
1539
  enabled: boolean;
1400
1540
  /**
1541
+ * Is the function deployed with the latest configuration? This is set to false if you&#039;ve changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
1542
+ */
1543
+ live: boolean;
1544
+ /**
1545
+ * Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
1546
+ */
1547
+ logging: boolean;
1548
+ /**
1401
1549
  * Function execution runtime.
1402
1550
  */
1403
1551
  runtime: string;
@@ -1418,17 +1566,41 @@ declare module "node-appwrite" {
1418
1566
  */
1419
1567
  schedule: string;
1420
1568
  /**
1421
- * Function&#039;s next scheduled execution time in ISO 8601 format.
1569
+ * Function execution timeout in seconds.
1570
+ */
1571
+ timeout: number;
1572
+ /**
1573
+ * The entrypoint file used to execute the deployment.
1422
1574
  */
1423
- scheduleNext: string;
1575
+ entrypoint: string;
1424
1576
  /**
1425
- * Function&#039;s previous scheduled execution time in ISO 8601 format.
1577
+ * The build command used to build the deployment.
1426
1578
  */
1427
- schedulePrevious: string;
1579
+ commands: string;
1428
1580
  /**
1429
- * Function execution timeout in seconds.
1581
+ * Version of Open Runtimes used for the function.
1430
1582
  */
1431
- timeout: number;
1583
+ version: string;
1584
+ /**
1585
+ * Function VCS (Version Control System) installation id.
1586
+ */
1587
+ installationId: string;
1588
+ /**
1589
+ * VCS (Version Control System) Repository ID
1590
+ */
1591
+ providerRepositoryId: string;
1592
+ /**
1593
+ * VCS (Version Control System) branch name
1594
+ */
1595
+ providerBranch: string;
1596
+ /**
1597
+ * Path to function in VCS (Version Control System) repository
1598
+ */
1599
+ providerRootDirectory: string;
1600
+ /**
1601
+ * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
1602
+ */
1603
+ providerSilentMode: boolean;
1432
1604
  }
1433
1605
  /**
1434
1606
  * Runtime
@@ -1480,6 +1652,10 @@ declare module "node-appwrite" {
1480
1652
  */
1481
1653
  $updatedAt: string;
1482
1654
  /**
1655
+ * Type of deployment.
1656
+ */
1657
+ type: string;
1658
+ /**
1483
1659
  * Resource ID.
1484
1660
  */
1485
1661
  resourceId: string;
@@ -1504,21 +1680,57 @@ declare module "node-appwrite" {
1504
1680
  */
1505
1681
  activate: boolean;
1506
1682
  /**
1507
- * The deployment status. Possible values are &quot;processing&quot;, &quot;building&quot;, &quot;pending&quot;, &quot;ready&quot;, and &quot;failed&quot;.
1683
+ * The deployment status. Possible values are &quot;processing&quot;, &quot;building&quot;, &quot;waiting&quot;, &quot;ready&quot;, and &quot;failed&quot;.
1508
1684
  */
1509
1685
  status: string;
1510
1686
  /**
1511
- * The build stdout.
1512
- */
1513
- buildStdout: string;
1514
- /**
1515
- * The build stderr.
1687
+ * The build logs.
1516
1688
  */
1517
- buildStderr: string;
1689
+ buildLogs: string;
1518
1690
  /**
1519
1691
  * The current build time in seconds.
1520
1692
  */
1521
1693
  buildTime: number;
1694
+ /**
1695
+ * The name of the vcs provider repository
1696
+ */
1697
+ providerRepositoryName: string;
1698
+ /**
1699
+ * The name of the vcs provider repository owner
1700
+ */
1701
+ providerRepositoryOwner: string;
1702
+ /**
1703
+ * The url of the vcs provider repository
1704
+ */
1705
+ providerRepositoryUrl: string;
1706
+ /**
1707
+ * The branch of the vcs repository
1708
+ */
1709
+ providerBranch: string;
1710
+ /**
1711
+ * The commit hash of the vcs commit
1712
+ */
1713
+ providerCommitHash: string;
1714
+ /**
1715
+ * The url of vcs commit author
1716
+ */
1717
+ providerCommitAuthorUrl: string;
1718
+ /**
1719
+ * The name of vcs commit author
1720
+ */
1721
+ providerCommitAuthor: string;
1722
+ /**
1723
+ * The commit message
1724
+ */
1725
+ providerCommitMessage: string;
1726
+ /**
1727
+ * The url of the vcs commit
1728
+ */
1729
+ providerCommitUrl: string;
1730
+ /**
1731
+ * The branch of the vcs repository
1732
+ */
1733
+ providerBranchUrl: string;
1522
1734
  }
1523
1735
  /**
1524
1736
  * Execution
@@ -1553,23 +1765,39 @@ declare module "node-appwrite" {
1553
1765
  */
1554
1766
  status: string;
1555
1767
  /**
1556
- * The script status code.
1768
+ * HTTP request method type.
1769
+ */
1770
+ requestMethod: string;
1771
+ /**
1772
+ * HTTP request path and query.
1773
+ */
1774
+ requestPath: string;
1775
+ /**
1776
+ * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
1777
+ */
1778
+ requestHeaders: Headers[];
1779
+ /**
1780
+ * HTTP response status code.
1781
+ */
1782
+ responseStatusCode: number;
1783
+ /**
1784
+ * HTTP response body. This will return empty unless execution is created as synchronous.
1557
1785
  */
1558
- statusCode: number;
1786
+ responseBody: string;
1559
1787
  /**
1560
- * The script response output string. Logs the last 4,000 characters of the execution response output.
1788
+ * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
1561
1789
  */
1562
- response: string;
1790
+ responseHeaders: Headers[];
1563
1791
  /**
1564
- * The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
1792
+ * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
1565
1793
  */
1566
- stdout: string;
1794
+ logs: string;
1567
1795
  /**
1568
- * The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
1796
+ * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
1569
1797
  */
1570
- stderr: string;
1798
+ errors: string;
1571
1799
  /**
1572
- * The script execution duration in seconds.
1800
+ * Function execution duration in seconds.
1573
1801
  */
1574
1802
  duration: number;
1575
1803
  }
@@ -1598,9 +1826,13 @@ declare module "node-appwrite" {
1598
1826
  */
1599
1827
  value: string;
1600
1828
  /**
1601
- * Function ID.
1829
+ * Service to which the variable belongs. Possible values are &quot;project&quot;, &quot;function&quot;
1602
1830
  */
1603
- functionId: string;
1831
+ resourceType: string;
1832
+ /**
1833
+ * ID of resource to which the variable belongs. If resourceType is &quot;project&quot;, it is empty. If resourceType is &quot;function&quot;, it is ID of the function.
1834
+ */
1835
+ resourceId: string;
1604
1836
  }
1605
1837
  /**
1606
1838
  * Country
@@ -1721,6 +1953,10 @@ declare module "node-appwrite" {
1721
1953
  * Health Status
1722
1954
  */
1723
1955
  export type HealthStatus = {
1956
+ /**
1957
+ * Name of the service.
1958
+ */
1959
+ name: string;
1724
1960
  /**
1725
1961
  * Duration in milliseconds how long the health check took.
1726
1962
  */
@@ -1747,6 +1983,19 @@ declare module "node-appwrite" {
1747
1983
  */
1748
1984
  diff: number;
1749
1985
  }
1986
+ /**
1987
+ * Headers
1988
+ */
1989
+ export type Headers = {
1990
+ /**
1991
+ * Header name.
1992
+ */
1993
+ name: string;
1994
+ /**
1995
+ * Header value.
1996
+ */
1997
+ value: string;
1998
+ }
1750
1999
  }
1751
2000
  export class Client {
1752
2001
  /**
@@ -1826,11 +2075,13 @@ declare module "node-appwrite" {
1826
2075
 
1827
2076
  static fromBuffer(buffer: Buffer, filename: string): InputFile;
1828
2077
 
1829
- static fromBlob(blob: Blob, filename: string): InputFile;
2078
+ static fromBlob(blob: Blob, filename: string): Promise<InputFile>;
1830
2079
 
1831
- static fromStream(stream: any, filename: string, size: number): InputFile;
2080
+ static fromStream(stream: NodeJS.ReadableStream, filename: string, size: number): InputFile;
1832
2081
 
1833
2082
  static fromPlainText(content: string, filename: string): InputFile;
2083
+
2084
+ constructor(stream: NodeJS.ReadableStream, filename: string, size: number);
1834
2085
  }
1835
2086
 
1836
2087
  type QueryTypesSingle = string | number | boolean;
@@ -1850,6 +2101,18 @@ declare module "node-appwrite" {
1850
2101
 
1851
2102
  static greaterThanEqual(attribute: string, value: QueryTypes): string;
1852
2103
 
2104
+ static isNull(attribute: string): string;
2105
+
2106
+ static isNotNull(attribute: string): string;
2107
+
2108
+ static between<T extends string | number>(attribute: string, start: T, end: T): string;
2109
+
2110
+ static startsWith(attribute: string, value: string): string;
2111
+
2112
+ static endsWith(attribute: string, value: string): string;
2113
+
2114
+ static select(attributes: string[]): string;
2115
+
1853
2116
  static search(attribute: string, value: string): string;
1854
2117
 
1855
2118
  static orderDesc(attribute: string): string;
@@ -1897,12 +2160,12 @@ declare module "node-appwrite" {
1897
2160
  /**
1898
2161
  * Get Account
1899
2162
  *
1900
- * Get currently logged in user data as JSON object.
2163
+ * Get the currently logged in user.
1901
2164
  *
1902
2165
  * @throws {AppwriteException}
1903
2166
  * @returns {Promise}
1904
2167
  */
1905
- get<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
2168
+ get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
1906
2169
  /**
1907
2170
  * Update Email
1908
2171
  *
@@ -1920,12 +2183,32 @@ declare module "node-appwrite" {
1920
2183
  * @throws {AppwriteException}
1921
2184
  * @returns {Promise}
1922
2185
  */
1923
- updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.Account<Preferences>>;
2186
+ updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
2187
+ /**
2188
+ * List Identities
2189
+ *
2190
+ * Get the list of identities for the currently logged in user.
2191
+ *
2192
+ * @param {string} queries
2193
+ * @throws {AppwriteException}
2194
+ * @returns {Promise}
2195
+ */
2196
+ listIdentities(queries?: string): Promise<Models.IdentityList>;
2197
+ /**
2198
+ * Delete Identity
2199
+ *
2200
+ * Delete an identity by its unique ID.
2201
+ *
2202
+ * @param {string} identityId
2203
+ * @throws {AppwriteException}
2204
+ * @returns {Promise}
2205
+ */
2206
+ deleteIdentity(identityId: string): Promise<string>;
1924
2207
  /**
1925
2208
  * List Logs
1926
2209
  *
1927
- * Get currently logged in user list of latest security activity logs. Each
1928
- * log returns user IP address, location and date and time of log.
2210
+ * Get the list of latest security activity logs for the currently logged in
2211
+ * user. Each log returns user IP address, location and date and time of log.
1929
2212
  *
1930
2213
  * @param {string[]} queries
1931
2214
  * @throws {AppwriteException}
@@ -1941,7 +2224,7 @@ declare module "node-appwrite" {
1941
2224
  * @throws {AppwriteException}
1942
2225
  * @returns {Promise}
1943
2226
  */
1944
- updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.Account<Preferences>>;
2227
+ updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
1945
2228
  /**
1946
2229
  * Update Password
1947
2230
  *
@@ -1954,7 +2237,7 @@ declare module "node-appwrite" {
1954
2237
  * @throws {AppwriteException}
1955
2238
  * @returns {Promise}
1956
2239
  */
1957
- updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>>;
2240
+ updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
1958
2241
  /**
1959
2242
  * Update Phone
1960
2243
  *
@@ -1969,11 +2252,11 @@ declare module "node-appwrite" {
1969
2252
  * @throws {AppwriteException}
1970
2253
  * @returns {Promise}
1971
2254
  */
1972
- updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.Account<Preferences>>;
2255
+ updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
1973
2256
  /**
1974
2257
  * Get Account Preferences
1975
2258
  *
1976
- * Get currently logged in user preferences as a key-value object.
2259
+ * Get the preferences as a key-value object for the currently logged in user.
1977
2260
  *
1978
2261
  * @throws {AppwriteException}
1979
2262
  * @returns {Promise}
@@ -1990,7 +2273,7 @@ declare module "node-appwrite" {
1990
2273
  * @throws {AppwriteException}
1991
2274
  * @returns {Promise}
1992
2275
  */
1993
- updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.Account<Preferences>>;
2276
+ updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.User<Preferences>>;
1994
2277
  /**
1995
2278
  * Create Password Recovery
1996
2279
  *
@@ -2033,8 +2316,8 @@ declare module "node-appwrite" {
2033
2316
  /**
2034
2317
  * List Sessions
2035
2318
  *
2036
- * Get currently logged in user list of active sessions across different
2037
- * devices.
2319
+ * Get the list of active sessions across different devices for the currently
2320
+ * logged in user.
2038
2321
  *
2039
2322
  * @throws {AppwriteException}
2040
2323
  * @returns {Promise}
@@ -2049,7 +2332,7 @@ declare module "node-appwrite" {
2049
2332
  * @throws {AppwriteException}
2050
2333
  * @returns {Promise}
2051
2334
  */
2052
- deleteSessions(): Promise<Response>;
2335
+ deleteSessions(): Promise<string>;
2053
2336
  /**
2054
2337
  * Get Session
2055
2338
  *
@@ -2076,16 +2359,16 @@ declare module "node-appwrite" {
2076
2359
  /**
2077
2360
  * Delete Session
2078
2361
  *
2079
- * Use this endpoint to log out the currently logged in user from all their
2080
- * account sessions across all of their different devices. When using the
2081
- * Session ID argument, only the unique session ID provided is deleted.
2082
- *
2362
+ * Logout the user. Use 'current' as the session ID to logout on this device,
2363
+ * use a session ID to logout on another device. If you're looking to logout
2364
+ * the user on all devices, use [Delete
2365
+ * Sessions](/docs/client/account#accountDeleteSessions) instead.
2083
2366
  *
2084
2367
  * @param {string} sessionId
2085
2368
  * @throws {AppwriteException}
2086
2369
  * @returns {Promise}
2087
2370
  */
2088
- deleteSession(sessionId: string): Promise<Response>;
2371
+ deleteSession(sessionId: string): Promise<string>;
2089
2372
  /**
2090
2373
  * Update Status
2091
2374
  *
@@ -2096,7 +2379,7 @@ declare module "node-appwrite" {
2096
2379
  * @throws {AppwriteException}
2097
2380
  * @returns {Promise}
2098
2381
  */
2099
- updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
2382
+ updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
2100
2383
  /**
2101
2384
  * Create Email Verification
2102
2385
  *
@@ -2331,10 +2614,11 @@ declare module "node-appwrite" {
2331
2614
  *
2332
2615
  * @param {string} databaseId
2333
2616
  * @param {string} name
2617
+ * @param {boolean} enabled
2334
2618
  * @throws {AppwriteException}
2335
2619
  * @returns {Promise}
2336
2620
  */
2337
- create(databaseId: string, name: string): Promise<Models.Database>;
2621
+ create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
2338
2622
  /**
2339
2623
  * Get Database
2340
2624
  *
@@ -2353,10 +2637,11 @@ declare module "node-appwrite" {
2353
2637
  *
2354
2638
  * @param {string} databaseId
2355
2639
  * @param {string} name
2640
+ * @param {boolean} enabled
2356
2641
  * @throws {AppwriteException}
2357
2642
  * @returns {Promise}
2358
2643
  */
2359
- update(databaseId: string, name: string): Promise<Models.Database>;
2644
+ update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
2360
2645
  /**
2361
2646
  * Delete Database
2362
2647
  *
@@ -2367,7 +2652,7 @@ declare module "node-appwrite" {
2367
2652
  * @throws {AppwriteException}
2368
2653
  * @returns {Promise}
2369
2654
  */
2370
- delete(databaseId: string): Promise<Response>;
2655
+ delete(databaseId: string): Promise<string>;
2371
2656
  /**
2372
2657
  * List Collections
2373
2658
  *
@@ -2394,10 +2679,11 @@ declare module "node-appwrite" {
2394
2679
  * @param {string} name
2395
2680
  * @param {string[]} permissions
2396
2681
  * @param {boolean} documentSecurity
2682
+ * @param {boolean} enabled
2397
2683
  * @throws {AppwriteException}
2398
2684
  * @returns {Promise}
2399
2685
  */
2400
- createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean): Promise<Models.Collection>;
2686
+ createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
2401
2687
  /**
2402
2688
  * Get Collection
2403
2689
  *
@@ -2436,16 +2722,17 @@ declare module "node-appwrite" {
2436
2722
  * @throws {AppwriteException}
2437
2723
  * @returns {Promise}
2438
2724
  */
2439
- deleteCollection(databaseId: string, collectionId: string): Promise<Response>;
2725
+ deleteCollection(databaseId: string, collectionId: string): Promise<string>;
2440
2726
  /**
2441
2727
  * List Attributes
2442
2728
  *
2443
2729
  * @param {string} databaseId
2444
2730
  * @param {string} collectionId
2731
+ * @param {string[]} queries
2445
2732
  * @throws {AppwriteException}
2446
2733
  * @returns {Promise}
2447
2734
  */
2448
- listAttributes(databaseId: string, collectionId: string): Promise<Models.AttributeList>;
2735
+ listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList>;
2449
2736
  /**
2450
2737
  * Create Boolean Attribute
2451
2738
  *
@@ -2462,6 +2749,18 @@ declare module "node-appwrite" {
2462
2749
  * @returns {Promise}
2463
2750
  */
2464
2751
  createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
2752
+ /**
2753
+ * Update Boolean Attribute
2754
+ *
2755
+ * @param {string} databaseId
2756
+ * @param {string} collectionId
2757
+ * @param {string} key
2758
+ * @param {boolean} required
2759
+ * @param {boolean} default
2760
+ * @throws {AppwriteException}
2761
+ * @returns {Promise}
2762
+ */
2763
+ updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean): Promise<Models.AttributeBoolean>;
2465
2764
  /**
2466
2765
  * Create DateTime Attribute
2467
2766
  *
@@ -2475,6 +2774,18 @@ declare module "node-appwrite" {
2475
2774
  * @returns {Promise}
2476
2775
  */
2477
2776
  createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime>;
2777
+ /**
2778
+ * Update DateTime Attribute
2779
+ *
2780
+ * @param {string} databaseId
2781
+ * @param {string} collectionId
2782
+ * @param {string} key
2783
+ * @param {boolean} required
2784
+ * @param {string} default
2785
+ * @throws {AppwriteException}
2786
+ * @returns {Promise}
2787
+ */
2788
+ updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeDatetime>;
2478
2789
  /**
2479
2790
  * Create Email Attribute
2480
2791
  *
@@ -2491,6 +2802,22 @@ declare module "node-appwrite" {
2491
2802
  * @returns {Promise}
2492
2803
  */
2493
2804
  createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
2805
+ /**
2806
+ * Update Email Attribute
2807
+ *
2808
+ * Update an email attribute. Changing the `default` value will not update
2809
+ * already existing documents.
2810
+ *
2811
+ *
2812
+ * @param {string} databaseId
2813
+ * @param {string} collectionId
2814
+ * @param {string} key
2815
+ * @param {boolean} required
2816
+ * @param {string} default
2817
+ * @throws {AppwriteException}
2818
+ * @returns {Promise}
2819
+ */
2820
+ updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeEmail>;
2494
2821
  /**
2495
2822
  * Create Enum Attribute
2496
2823
  *
@@ -2505,6 +2832,23 @@ declare module "node-appwrite" {
2505
2832
  * @returns {Promise}
2506
2833
  */
2507
2834
  createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
2835
+ /**
2836
+ * Update Enum Attribute
2837
+ *
2838
+ * Update an enum attribute. Changing the `default` value will not update
2839
+ * already existing documents.
2840
+ *
2841
+ *
2842
+ * @param {string} databaseId
2843
+ * @param {string} collectionId
2844
+ * @param {string} key
2845
+ * @param {string[]} elements
2846
+ * @param {boolean} required
2847
+ * @param {string} default
2848
+ * @throws {AppwriteException}
2849
+ * @returns {Promise}
2850
+ */
2851
+ updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string): Promise<Models.AttributeEnum>;
2508
2852
  /**
2509
2853
  * Create Float Attribute
2510
2854
  *
@@ -2524,6 +2868,24 @@ declare module "node-appwrite" {
2524
2868
  * @returns {Promise}
2525
2869
  */
2526
2870
  createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
2871
+ /**
2872
+ * Update Float Attribute
2873
+ *
2874
+ * Update a float attribute. Changing the `default` value will not update
2875
+ * already existing documents.
2876
+ *
2877
+ *
2878
+ * @param {string} databaseId
2879
+ * @param {string} collectionId
2880
+ * @param {string} key
2881
+ * @param {boolean} required
2882
+ * @param {number} min
2883
+ * @param {number} max
2884
+ * @param {number} default
2885
+ * @throws {AppwriteException}
2886
+ * @returns {Promise}
2887
+ */
2888
+ updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeFloat>;
2527
2889
  /**
2528
2890
  * Create Integer Attribute
2529
2891
  *
@@ -2543,6 +2905,24 @@ declare module "node-appwrite" {
2543
2905
  * @returns {Promise}
2544
2906
  */
2545
2907
  createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
2908
+ /**
2909
+ * Update Integer Attribute
2910
+ *
2911
+ * Update an integer attribute. Changing the `default` value will not update
2912
+ * already existing documents.
2913
+ *
2914
+ *
2915
+ * @param {string} databaseId
2916
+ * @param {string} collectionId
2917
+ * @param {string} key
2918
+ * @param {boolean} required
2919
+ * @param {number} min
2920
+ * @param {number} max
2921
+ * @param {number} default
2922
+ * @throws {AppwriteException}
2923
+ * @returns {Promise}
2924
+ */
2925
+ updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeInteger>;
2546
2926
  /**
2547
2927
  * Create IP Address Attribute
2548
2928
  *
@@ -2559,6 +2939,41 @@ declare module "node-appwrite" {
2559
2939
  * @returns {Promise}
2560
2940
  */
2561
2941
  createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
2942
+ /**
2943
+ * Update IP Address Attribute
2944
+ *
2945
+ * Update an ip attribute. Changing the `default` value will not update
2946
+ * already existing documents.
2947
+ *
2948
+ *
2949
+ * @param {string} databaseId
2950
+ * @param {string} collectionId
2951
+ * @param {string} key
2952
+ * @param {boolean} required
2953
+ * @param {string} default
2954
+ * @throws {AppwriteException}
2955
+ * @returns {Promise}
2956
+ */
2957
+ updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeIp>;
2958
+ /**
2959
+ * Create Relationship Attribute
2960
+ *
2961
+ * Create relationship attribute. [Learn more about relationship
2962
+ * attributes](/docs/databases-relationships#relationship-attributes).
2963
+ *
2964
+ *
2965
+ * @param {string} databaseId
2966
+ * @param {string} collectionId
2967
+ * @param {string} relatedCollectionId
2968
+ * @param {string} type
2969
+ * @param {boolean} twoWay
2970
+ * @param {string} key
2971
+ * @param {string} twoWayKey
2972
+ * @param {string} onDelete
2973
+ * @throws {AppwriteException}
2974
+ * @returns {Promise}
2975
+ */
2976
+ createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: string, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: string): Promise<Models.AttributeRelationship>;
2562
2977
  /**
2563
2978
  * Create String Attribute
2564
2979
  *
@@ -2572,10 +2987,27 @@ declare module "node-appwrite" {
2572
2987
  * @param {boolean} required
2573
2988
  * @param {string} default
2574
2989
  * @param {boolean} array
2990
+ * @param {boolean} encrypt
2991
+ * @throws {AppwriteException}
2992
+ * @returns {Promise}
2993
+ */
2994
+ createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
2995
+ /**
2996
+ * Update String Attribute
2997
+ *
2998
+ * Update a string attribute. Changing the `default` value will not update
2999
+ * already existing documents.
3000
+ *
3001
+ *
3002
+ * @param {string} databaseId
3003
+ * @param {string} collectionId
3004
+ * @param {string} key
3005
+ * @param {boolean} required
3006
+ * @param {string} default
2575
3007
  * @throws {AppwriteException}
2576
3008
  * @returns {Promise}
2577
3009
  */
2578
- createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
3010
+ updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeString>;
2579
3011
  /**
2580
3012
  * Create URL Attribute
2581
3013
  *
@@ -2592,6 +3024,22 @@ declare module "node-appwrite" {
2592
3024
  * @returns {Promise}
2593
3025
  */
2594
3026
  createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
3027
+ /**
3028
+ * Update URL Attribute
3029
+ *
3030
+ * Update an url attribute. Changing the `default` value will not update
3031
+ * already existing documents.
3032
+ *
3033
+ *
3034
+ * @param {string} databaseId
3035
+ * @param {string} collectionId
3036
+ * @param {string} key
3037
+ * @param {boolean} required
3038
+ * @param {string} default
3039
+ * @throws {AppwriteException}
3040
+ * @returns {Promise}
3041
+ */
3042
+ updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeUrl>;
2595
3043
  /**
2596
3044
  * Get Attribute
2597
3045
  *
@@ -2601,7 +3049,7 @@ declare module "node-appwrite" {
2601
3049
  * @throws {AppwriteException}
2602
3050
  * @returns {Promise}
2603
3051
  */
2604
- getAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
3052
+ getAttribute(databaseId: string, collectionId: string, key: string): Promise<any>;
2605
3053
  /**
2606
3054
  * Delete Attribute
2607
3055
  *
@@ -2611,7 +3059,22 @@ declare module "node-appwrite" {
2611
3059
  * @throws {AppwriteException}
2612
3060
  * @returns {Promise}
2613
3061
  */
2614
- deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
3062
+ deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<string>;
3063
+ /**
3064
+ * Update Relationship Attribute
3065
+ *
3066
+ * Update relationship attribute. [Learn more about relationship
3067
+ * attributes](/docs/databases-relationships#relationship-attributes).
3068
+ *
3069
+ *
3070
+ * @param {string} databaseId
3071
+ * @param {string} collectionId
3072
+ * @param {string} key
3073
+ * @param {string} onDelete
3074
+ * @throws {AppwriteException}
3075
+ * @returns {Promise}
3076
+ */
3077
+ updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: string): Promise<Models.AttributeRelationship>;
2615
3078
  /**
2616
3079
  * List Documents
2617
3080
  *
@@ -2651,10 +3114,11 @@ declare module "node-appwrite" {
2651
3114
  * @param {string} databaseId
2652
3115
  * @param {string} collectionId
2653
3116
  * @param {string} documentId
3117
+ * @param {string[]} queries
2654
3118
  * @throws {AppwriteException}
2655
3119
  * @returns {Promise}
2656
3120
  */
2657
- getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string): Promise<Document>;
3121
+ getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
2658
3122
  /**
2659
3123
  * Update Document
2660
3124
  *
@@ -2681,16 +3145,17 @@ declare module "node-appwrite" {
2681
3145
  * @throws {AppwriteException}
2682
3146
  * @returns {Promise}
2683
3147
  */
2684
- deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<Response>;
3148
+ deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<string>;
2685
3149
  /**
2686
3150
  * List Indexes
2687
3151
  *
2688
3152
  * @param {string} databaseId
2689
3153
  * @param {string} collectionId
3154
+ * @param {string[]} queries
2690
3155
  * @throws {AppwriteException}
2691
3156
  * @returns {Promise}
2692
3157
  */
2693
- listIndexes(databaseId: string, collectionId: string): Promise<Models.IndexList>;
3158
+ listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
2694
3159
  /**
2695
3160
  * Create Index
2696
3161
  *
@@ -2723,7 +3188,7 @@ declare module "node-appwrite" {
2723
3188
  * @throws {AppwriteException}
2724
3189
  * @returns {Promise}
2725
3190
  */
2726
- deleteIndex(databaseId: string, collectionId: string, key: string): Promise<Response>;
3191
+ deleteIndex(databaseId: string, collectionId: string, key: string): Promise<string>;
2727
3192
  }
2728
3193
  export class Functions extends Service {
2729
3194
  constructor(client: Client);
@@ -2749,16 +3214,28 @@ declare module "node-appwrite" {
2749
3214
  *
2750
3215
  * @param {string} functionId
2751
3216
  * @param {string} name
2752
- * @param {string[]} execute
2753
3217
  * @param {string} runtime
3218
+ * @param {string[]} execute
2754
3219
  * @param {string[]} events
2755
3220
  * @param {string} schedule
2756
3221
  * @param {number} timeout
2757
3222
  * @param {boolean} enabled
3223
+ * @param {boolean} logging
3224
+ * @param {string} entrypoint
3225
+ * @param {string} commands
3226
+ * @param {string} installationId
3227
+ * @param {string} providerRepositoryId
3228
+ * @param {string} providerBranch
3229
+ * @param {boolean} providerSilentMode
3230
+ * @param {string} providerRootDirectory
3231
+ * @param {string} templateRepository
3232
+ * @param {string} templateOwner
3233
+ * @param {string} templateRootDirectory
3234
+ * @param {string} templateBranch
2758
3235
  * @throws {AppwriteException}
2759
3236
  * @returns {Promise}
2760
3237
  */
2761
- create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
3238
+ create(functionId: string, name: string, runtime: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string): Promise<Models.Function>;
2762
3239
  /**
2763
3240
  * List runtimes
2764
3241
  *
@@ -2785,15 +3262,24 @@ declare module "node-appwrite" {
2785
3262
  *
2786
3263
  * @param {string} functionId
2787
3264
  * @param {string} name
3265
+ * @param {string} runtime
2788
3266
  * @param {string[]} execute
2789
3267
  * @param {string[]} events
2790
3268
  * @param {string} schedule
2791
3269
  * @param {number} timeout
2792
3270
  * @param {boolean} enabled
3271
+ * @param {boolean} logging
3272
+ * @param {string} entrypoint
3273
+ * @param {string} commands
3274
+ * @param {string} installationId
3275
+ * @param {string} providerRepositoryId
3276
+ * @param {string} providerBranch
3277
+ * @param {boolean} providerSilentMode
3278
+ * @param {string} providerRootDirectory
2793
3279
  * @throws {AppwriteException}
2794
3280
  * @returns {Promise}
2795
3281
  */
2796
- update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
3282
+ update(functionId: string, name: string, runtime: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise<Models.Function>;
2797
3283
  /**
2798
3284
  * Delete Function
2799
3285
  *
@@ -2803,7 +3289,7 @@ declare module "node-appwrite" {
2803
3289
  * @throws {AppwriteException}
2804
3290
  * @returns {Promise}
2805
3291
  */
2806
- delete(functionId: string): Promise<Response>;
3292
+ delete(functionId: string): Promise<string>;
2807
3293
  /**
2808
3294
  * List Deployments
2809
3295
  *
@@ -2829,16 +3315,17 @@ declare module "node-appwrite" {
2829
3315
  * learn more about code packaging in the [Appwrite Cloud Functions
2830
3316
  * tutorial](/docs/functions).
2831
3317
  *
2832
- * Use the "command" param to set the entry point used to execute your code.
3318
+ * Use the "command" param to set the entrypoint used to execute your code.
2833
3319
  *
2834
3320
  * @param {string} functionId
2835
- * @param {string} entrypoint
2836
3321
  * @param {InputFile} code
2837
3322
  * @param {boolean} activate
3323
+ * @param {string} entrypoint
3324
+ * @param {string} commands
2838
3325
  * @throws {AppwriteException}
2839
3326
  * @returns {Promise}
2840
3327
  */
2841
- createDeployment(functionId: string, entrypoint: string, code: InputFile, activate: boolean): Promise<Models.Deployment>;
3328
+ createDeployment(functionId: string, code: InputFile, activate: boolean, entrypoint?: string, commands?: string): Promise<Models.Deployment>;
2842
3329
  /**
2843
3330
  * Get Deployment
2844
3331
  *
@@ -2873,17 +3360,29 @@ declare module "node-appwrite" {
2873
3360
  * @throws {AppwriteException}
2874
3361
  * @returns {Promise}
2875
3362
  */
2876
- deleteDeployment(functionId: string, deploymentId: string): Promise<Response>;
3363
+ deleteDeployment(functionId: string, deploymentId: string): Promise<string>;
2877
3364
  /**
2878
3365
  * Create Build
2879
3366
  *
3367
+ * Create a new build for an Appwrite Function deployment. This endpoint can
3368
+ * be used to retry a failed build.
3369
+ *
2880
3370
  * @param {string} functionId
2881
3371
  * @param {string} deploymentId
2882
3372
  * @param {string} buildId
2883
3373
  * @throws {AppwriteException}
2884
3374
  * @returns {Promise}
2885
3375
  */
2886
- createBuild(functionId: string, deploymentId: string, buildId: string): Promise<Response>;
3376
+ createBuild(functionId: string, deploymentId: string, buildId: string): Promise<any>;
3377
+ /**
3378
+ * Download Deployment
3379
+ *
3380
+ * @param {string} functionId
3381
+ * @param {string} deploymentId
3382
+ * @throws {AppwriteException}
3383
+ * @returns {Promise}
3384
+ */
3385
+ downloadDeployment(functionId: string, deploymentId: string): Promise<Buffer>;
2887
3386
  /**
2888
3387
  * List Executions
2889
3388
  *
@@ -2906,12 +3405,15 @@ declare module "node-appwrite" {
2906
3405
  * function execution process will start asynchronously.
2907
3406
  *
2908
3407
  * @param {string} functionId
2909
- * @param {string} data
3408
+ * @param {string} body
2910
3409
  * @param {boolean} async
3410
+ * @param {string} path
3411
+ * @param {string} method
3412
+ * @param {object} headers
2911
3413
  * @throws {AppwriteException}
2912
3414
  * @returns {Promise}
2913
3415
  */
2914
- createExecution(functionId: string, data?: string, async?: boolean): Promise<Models.Execution>;
3416
+ createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: string, headers?: object): Promise<Models.Execution>;
2915
3417
  /**
2916
3418
  * Get Execution
2917
3419
  *
@@ -2936,8 +3438,8 @@ declare module "node-appwrite" {
2936
3438
  /**
2937
3439
  * Create Variable
2938
3440
  *
2939
- * Create a new function variable. These variables can be accessed within
2940
- * function in the `env` object under the request variable.
3441
+ * Create a new function environment variable. These variables can be accessed
3442
+ * in the function at runtime as environment variables.
2941
3443
  *
2942
3444
  * @param {string} functionId
2943
3445
  * @param {string} key
@@ -2980,7 +3482,7 @@ declare module "node-appwrite" {
2980
3482
  * @throws {AppwriteException}
2981
3483
  * @returns {Promise}
2982
3484
  */
2983
- deleteVariable(functionId: string, variableId: string): Promise<Response>;
3485
+ deleteVariable(functionId: string, variableId: string): Promise<string>;
2984
3486
  }
2985
3487
  export class Graphql extends Service {
2986
3488
  constructor(client: Client);
@@ -2994,7 +3496,7 @@ declare module "node-appwrite" {
2994
3496
  * @throws {AppwriteException}
2995
3497
  * @returns {Promise}
2996
3498
  */
2997
- query(query: object): Promise<Response>;
3499
+ query(query: object): Promise<any>;
2998
3500
  /**
2999
3501
  * GraphQL Endpoint
3000
3502
  *
@@ -3004,7 +3506,7 @@ declare module "node-appwrite" {
3004
3506
  * @throws {AppwriteException}
3005
3507
  * @returns {Promise}
3006
3508
  */
3007
- mutation(query: object): Promise<Response>;
3509
+ mutation(query: object): Promise<any>;
3008
3510
  }
3009
3511
  export class Health extends Service {
3010
3512
  constructor(client: Client);
@@ -3030,7 +3532,7 @@ declare module "node-appwrite" {
3030
3532
  /**
3031
3533
  * Get Cache
3032
3534
  *
3033
- * Check the Appwrite in-memory cache server is up and connection is
3535
+ * Check the Appwrite in-memory cache servers are up and connection is
3034
3536
  * successful.
3035
3537
  *
3036
3538
  * @throws {AppwriteException}
@@ -3040,12 +3542,31 @@ declare module "node-appwrite" {
3040
3542
  /**
3041
3543
  * Get DB
3042
3544
  *
3043
- * Check the Appwrite database server is up and connection is successful.
3545
+ * Check the Appwrite database servers are up and connection is successful.
3044
3546
  *
3045
3547
  * @throws {AppwriteException}
3046
3548
  * @returns {Promise}
3047
3549
  */
3048
3550
  getDB(): Promise<Models.HealthStatus>;
3551
+ /**
3552
+ * Get PubSub
3553
+ *
3554
+ * Check the Appwrite pub-sub servers are up and connection is successful.
3555
+ *
3556
+ * @throws {AppwriteException}
3557
+ * @returns {Promise}
3558
+ */
3559
+ getPubSub(): Promise<Models.HealthStatus>;
3560
+ /**
3561
+ * Get Queue
3562
+ *
3563
+ * Check the Appwrite queue messaging servers are up and connection is
3564
+ * successful.
3565
+ *
3566
+ * @throws {AppwriteException}
3567
+ * @returns {Promise}
3568
+ */
3569
+ getQueue(): Promise<Models.HealthStatus>;
3049
3570
  /**
3050
3571
  * Get Certificates Queue
3051
3572
  *
@@ -3126,6 +3647,16 @@ declare module "node-appwrite" {
3126
3647
  * @returns {Promise}
3127
3648
  */
3128
3649
  get(): Promise<Models.Locale>;
3650
+ /**
3651
+ * List Locale Codes
3652
+ *
3653
+ * List of all locale codes in [ISO
3654
+ * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
3655
+ *
3656
+ * @throws {AppwriteException}
3657
+ * @returns {Promise}
3658
+ */
3659
+ listCodes(): Promise<Models.LocaleCodeList>;
3129
3660
  /**
3130
3661
  * List Continents
3131
3662
  *
@@ -3261,7 +3792,7 @@ declare module "node-appwrite" {
3261
3792
  * @throws {AppwriteException}
3262
3793
  * @returns {Promise}
3263
3794
  */
3264
- deleteBucket(bucketId: string): Promise<Response>;
3795
+ deleteBucket(bucketId: string): Promise<string>;
3265
3796
  /**
3266
3797
  * List Files
3267
3798
  *
@@ -3325,11 +3856,12 @@ declare module "node-appwrite" {
3325
3856
  *
3326
3857
  * @param {string} bucketId
3327
3858
  * @param {string} fileId
3859
+ * @param {string} name
3328
3860
  * @param {string[]} permissions
3329
3861
  * @throws {AppwriteException}
3330
3862
  * @returns {Promise}
3331
3863
  */
3332
- updateFile(bucketId: string, fileId: string, permissions?: string[]): Promise<Models.File>;
3864
+ updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
3333
3865
  /**
3334
3866
  * Delete File
3335
3867
  *
@@ -3341,7 +3873,7 @@ declare module "node-appwrite" {
3341
3873
  * @throws {AppwriteException}
3342
3874
  * @returns {Promise}
3343
3875
  */
3344
- deleteFile(bucketId: string, fileId: string): Promise<Response>;
3876
+ deleteFile(bucketId: string, fileId: string): Promise<string>;
3345
3877
  /**
3346
3878
  * Get File for Download
3347
3879
  *
@@ -3409,7 +3941,7 @@ declare module "node-appwrite" {
3409
3941
  * @throws {AppwriteException}
3410
3942
  * @returns {Promise}
3411
3943
  */
3412
- list(queries?: string[], search?: string): Promise<Models.TeamList>;
3944
+ list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>>;
3413
3945
  /**
3414
3946
  * Create Team
3415
3947
  *
@@ -3423,7 +3955,7 @@ declare module "node-appwrite" {
3423
3955
  * @throws {AppwriteException}
3424
3956
  * @returns {Promise}
3425
3957
  */
3426
- create(teamId: string, name: string, roles?: string[]): Promise<Models.Team>;
3958
+ create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
3427
3959
  /**
3428
3960
  * Get Team
3429
3961
  *
@@ -3433,19 +3965,18 @@ declare module "node-appwrite" {
3433
3965
  * @throws {AppwriteException}
3434
3966
  * @returns {Promise}
3435
3967
  */
3436
- get(teamId: string): Promise<Models.Team>;
3968
+ get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>>;
3437
3969
  /**
3438
- * Update Team
3970
+ * Update Name
3439
3971
  *
3440
- * Update a team using its ID. Only members with the owner role can update the
3441
- * team.
3972
+ * Update the team's name by its unique ID.
3442
3973
  *
3443
3974
  * @param {string} teamId
3444
3975
  * @param {string} name
3445
3976
  * @throws {AppwriteException}
3446
3977
  * @returns {Promise}
3447
3978
  */
3448
- update(teamId: string, name: string): Promise<Models.Team>;
3979
+ updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
3449
3980
  /**
3450
3981
  * Delete Team
3451
3982
  *
@@ -3456,7 +3987,7 @@ declare module "node-appwrite" {
3456
3987
  * @throws {AppwriteException}
3457
3988
  * @returns {Promise}
3458
3989
  */
3459
- delete(teamId: string): Promise<Response>;
3990
+ delete(teamId: string): Promise<string>;
3460
3991
  /**
3461
3992
  * List Team Memberships
3462
3993
  *
@@ -3473,31 +4004,39 @@ declare module "node-appwrite" {
3473
4004
  /**
3474
4005
  * Create Team Membership
3475
4006
  *
3476
- * Invite a new member to join your team. If initiated from the client SDK, an
3477
- * email with a link to join the team will be sent to the member's email
3478
- * address and an account will be created for them should they not be signed
3479
- * up already. If initiated from server-side SDKs, the new member will
3480
- * automatically be added to the team.
4007
+ * Invite a new member to join your team. Provide an ID for existing users, or
4008
+ * invite unregistered users using an email or phone number. If initiated from
4009
+ * a Client SDK, Appwrite will send an email or sms with a link to join the
4010
+ * team to the invited user, and an account will be created for them if one
4011
+ * doesn't exist. If initiated from a Server SDK, the new member will be added
4012
+ * automatically to the team.
3481
4013
  *
3482
- * Use the 'url' parameter to redirect the user from the invitation email back
3483
- * to your app. When the user is redirected, use the [Update Team Membership
4014
+ * You only need to provide one of a user ID, email, or phone number. Appwrite
4015
+ * will prioritize accepting the user ID > email > phone number if you provide
4016
+ * more than one of these parameters.
4017
+ *
4018
+ * Use the `url` parameter to redirect the user from the invitation email to
4019
+ * your app. After the user is redirected, use the [Update Team Membership
3484
4020
  * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
3485
4021
  * the user to accept the invitation to the team.
3486
4022
  *
3487
4023
  * Please note that to avoid a [Redirect
3488
4024
  * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
3489
- * the only valid redirect URL's are the once from domains you have set when
3490
- * adding your platforms in the console interface.
4025
+ * Appwrite will accept the only redirect URLs under the domains you have
4026
+ * added as a platform on the Appwrite Console.
4027
+ *
3491
4028
  *
3492
4029
  * @param {string} teamId
3493
- * @param {string} email
3494
4030
  * @param {string[]} roles
3495
4031
  * @param {string} url
4032
+ * @param {string} email
4033
+ * @param {string} userId
4034
+ * @param {string} phone
3496
4035
  * @param {string} name
3497
4036
  * @throws {AppwriteException}
3498
4037
  * @returns {Promise}
3499
4038
  */
3500
- createMembership(teamId: string, email: string, roles: string[], url: string, name?: string): Promise<Models.Membership>;
4039
+ createMembership(teamId: string, roles: string[], url: string, email?: string, userId?: string, phone?: string, name?: string): Promise<Models.Membership>;
3501
4040
  /**
3502
4041
  * Get Team Membership
3503
4042
  *
@@ -3511,11 +4050,12 @@ declare module "node-appwrite" {
3511
4050
  */
3512
4051
  getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
3513
4052
  /**
3514
- * Update Membership Roles
4053
+ * Update Membership
3515
4054
  *
3516
4055
  * Modify the roles of a team member. Only team members with the owner role
3517
4056
  * have access to this endpoint. Learn more about [roles and
3518
4057
  * permissions](/docs/permissions).
4058
+ *
3519
4059
  *
3520
4060
  * @param {string} teamId
3521
4061
  * @param {string} membershipId
@@ -3523,7 +4063,7 @@ declare module "node-appwrite" {
3523
4063
  * @throws {AppwriteException}
3524
4064
  * @returns {Promise}
3525
4065
  */
3526
- updateMembershipRoles(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
4066
+ updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
3527
4067
  /**
3528
4068
  * Delete Team Membership
3529
4069
  *
@@ -3536,7 +4076,7 @@ declare module "node-appwrite" {
3536
4076
  * @throws {AppwriteException}
3537
4077
  * @returns {Promise}
3538
4078
  */
3539
- deleteMembership(teamId: string, membershipId: string): Promise<Response>;
4079
+ deleteMembership(teamId: string, membershipId: string): Promise<string>;
3540
4080
  /**
3541
4081
  * Update Team Membership Status
3542
4082
  *
@@ -3556,6 +4096,31 @@ declare module "node-appwrite" {
3556
4096
  * @returns {Promise}
3557
4097
  */
3558
4098
  updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
4099
+ /**
4100
+ * Get Team Preferences
4101
+ *
4102
+ * Get the team's shared preferences by its unique ID. If a preference doesn't
4103
+ * need to be shared by all team members, prefer storing them in [user
4104
+ * preferences](/docs/client/account#accountGetPrefs).
4105
+ *
4106
+ * @param {string} teamId
4107
+ * @throws {AppwriteException}
4108
+ * @returns {Promise}
4109
+ */
4110
+ getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences>;
4111
+ /**
4112
+ * Update Preferences
4113
+ *
4114
+ * Update the team's preferences by its unique ID. The object you pass is
4115
+ * stored as is and replaces any previous value. The maximum allowed prefs
4116
+ * size is 64kB and throws an error if exceeded.
4117
+ *
4118
+ * @param {string} teamId
4119
+ * @param {object} prefs
4120
+ * @throws {AppwriteException}
4121
+ * @returns {Promise}
4122
+ */
4123
+ updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences>;
3559
4124
  }
3560
4125
  export class Users extends Service {
3561
4126
  constructor(client: Client);
@@ -3618,6 +4183,27 @@ declare module "node-appwrite" {
3618
4183
  * @returns {Promise}
3619
4184
  */
3620
4185
  createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
4186
+ /**
4187
+ * List Identities
4188
+ *
4189
+ * Get identities for all users.
4190
+ *
4191
+ * @param {string} queries
4192
+ * @param {string} search
4193
+ * @throws {AppwriteException}
4194
+ * @returns {Promise}
4195
+ */
4196
+ listIdentities(queries?: string, search?: string): Promise<Models.IdentityList>;
4197
+ /**
4198
+ * Delete Identity
4199
+ *
4200
+ * Delete an identity by its unique ID.
4201
+ *
4202
+ * @param {string} identityId
4203
+ * @throws {AppwriteException}
4204
+ * @returns {Promise}
4205
+ */
4206
+ deleteIdentity(identityId: string): Promise<string>;
3621
4207
  /**
3622
4208
  * Create User with MD5 Password
3623
4209
  *
@@ -3730,7 +4316,7 @@ declare module "node-appwrite" {
3730
4316
  * @throws {AppwriteException}
3731
4317
  * @returns {Promise}
3732
4318
  */
3733
- delete(userId: string): Promise<Response>;
4319
+ delete(userId: string): Promise<string>;
3734
4320
  /**
3735
4321
  * Update Email
3736
4322
  *
@@ -3742,6 +4328,22 @@ declare module "node-appwrite" {
3742
4328
  * @returns {Promise}
3743
4329
  */
3744
4330
  updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
4331
+ /**
4332
+ * Update User Labels
4333
+ *
4334
+ * Update the user labels by its unique ID.
4335
+ *
4336
+ * Labels can be used to grant access to resources. While teams are a way for
4337
+ * user's to share access to a resource, labels can be defined by the
4338
+ * developer to grant access without an invitation. See the [Permissions
4339
+ * docs](/docs/permissions) for more info.
4340
+ *
4341
+ * @param {string} userId
4342
+ * @param {string[]} labels
4343
+ * @throws {AppwriteException}
4344
+ * @returns {Promise}
4345
+ */
4346
+ updateLabels<Preferences extends Models.Preferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
3745
4347
  /**
3746
4348
  * List User Logs
3747
4349
  *
@@ -3838,7 +4440,7 @@ declare module "node-appwrite" {
3838
4440
  * @throws {AppwriteException}
3839
4441
  * @returns {Promise}
3840
4442
  */
3841
- deleteSessions(userId: string): Promise<Response>;
4443
+ deleteSessions(userId: string): Promise<string>;
3842
4444
  /**
3843
4445
  * Delete User Session
3844
4446
  *
@@ -3849,7 +4451,7 @@ declare module "node-appwrite" {
3849
4451
  * @throws {AppwriteException}
3850
4452
  * @returns {Promise}
3851
4453
  */
3852
- deleteSession(userId: string, sessionId: string): Promise<Response>;
4454
+ deleteSession(userId: string, sessionId: string): Promise<string>;
3853
4455
  /**
3854
4456
  * Update User Status
3855
4457
  *