node-appwrite 5.1.0 → 7.0.1

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 (148) hide show
  1. package/README.md +2 -2
  2. package/docs/examples/account/create-phone-verification.md +20 -0
  3. package/docs/examples/account/create-recovery.md +3 -3
  4. package/docs/examples/account/create-verification.md +3 -3
  5. package/docs/examples/account/delete-session.md +3 -3
  6. package/docs/examples/account/delete-sessions.md +3 -3
  7. package/docs/examples/account/get-logs.md +3 -3
  8. package/docs/examples/account/get-prefs.md +3 -3
  9. package/docs/examples/account/get-session.md +3 -3
  10. package/docs/examples/account/get-sessions.md +3 -3
  11. package/docs/examples/account/get.md +3 -3
  12. package/docs/examples/account/update-email.md +3 -3
  13. package/docs/examples/account/update-name.md +3 -3
  14. package/docs/examples/account/update-password.md +3 -3
  15. package/docs/examples/account/update-phone-verification.md +20 -0
  16. package/docs/examples/{database/create-ip-attribute.md → account/update-phone.md} +4 -4
  17. package/docs/examples/account/update-prefs.md +3 -3
  18. package/docs/examples/account/update-recovery.md +3 -3
  19. package/docs/examples/account/update-session.md +3 -3
  20. package/docs/examples/account/{delete.md → update-status.md} +3 -3
  21. package/docs/examples/account/update-verification.md +3 -3
  22. package/docs/examples/avatars/get-browser.md +3 -3
  23. package/docs/examples/avatars/get-credit-card.md +3 -3
  24. package/docs/examples/avatars/get-favicon.md +3 -3
  25. package/docs/examples/avatars/get-flag.md +3 -3
  26. package/docs/examples/avatars/get-image.md +3 -3
  27. package/docs/examples/avatars/get-initials.md +3 -3
  28. package/docs/examples/avatars/get-q-r.md +3 -3
  29. package/docs/examples/databases/create-boolean-attribute.md +20 -0
  30. package/docs/examples/{database → databases}/create-collection.md +3 -3
  31. package/docs/examples/databases/create-document.md +20 -0
  32. package/docs/examples/databases/create-email-attribute.md +20 -0
  33. package/docs/examples/databases/create-enum-attribute.md +20 -0
  34. package/docs/examples/{database → databases}/create-float-attribute.md +3 -3
  35. package/docs/examples/{database → databases}/create-index.md +3 -3
  36. package/docs/examples/{database → databases}/create-integer-attribute.md +3 -3
  37. package/docs/examples/{database/create-email-attribute.md → databases/create-ip-attribute.md} +3 -3
  38. package/docs/examples/{database → databases}/create-string-attribute.md +3 -3
  39. package/docs/examples/{database → databases}/create-url-attribute.md +3 -3
  40. package/docs/examples/{database/delete-attribute.md → databases/create.md} +3 -3
  41. package/docs/examples/databases/delete-attribute.md +20 -0
  42. package/docs/examples/databases/delete-collection.md +20 -0
  43. package/docs/examples/databases/delete-document.md +20 -0
  44. package/docs/examples/{database/create-document.md → databases/delete-index.md} +3 -3
  45. package/docs/examples/{database/delete-index.md → databases/delete.md} +3 -3
  46. package/docs/examples/databases/get-attribute.md +20 -0
  47. package/docs/examples/{database → databases}/get-collection.md +3 -3
  48. package/docs/examples/{database/delete-document.md → databases/get-document.md} +3 -3
  49. package/docs/examples/{database/create-boolean-attribute.md → databases/get-index.md} +3 -3
  50. package/docs/examples/{database/get-index.md → databases/get.md} +3 -3
  51. package/docs/examples/{database → databases}/list-attributes.md +3 -3
  52. package/docs/examples/databases/list-collections.md +20 -0
  53. package/docs/examples/{database/create-enum-attribute.md → databases/list-documents.md} +3 -3
  54. package/docs/examples/{database → databases}/list-indexes.md +3 -3
  55. package/docs/examples/{database/list-documents.md → databases/list.md} +3 -3
  56. package/docs/examples/{database → databases}/update-collection.md +3 -3
  57. package/docs/examples/{database → databases}/update-document.md +3 -3
  58. package/docs/examples/databases/update.md +20 -0
  59. package/docs/examples/functions/create-deployment.md +3 -3
  60. package/docs/examples/functions/create-execution.md +3 -3
  61. package/docs/examples/functions/create.md +3 -3
  62. package/docs/examples/functions/delete-deployment.md +3 -3
  63. package/docs/examples/functions/delete.md +3 -3
  64. package/docs/examples/functions/get-deployment.md +3 -3
  65. package/docs/examples/functions/get-execution.md +3 -3
  66. package/docs/examples/functions/get.md +3 -3
  67. package/docs/examples/functions/list-deployments.md +3 -3
  68. package/docs/examples/functions/list-executions.md +3 -3
  69. package/docs/examples/functions/list-runtimes.md +3 -3
  70. package/docs/examples/functions/list.md +3 -3
  71. package/docs/examples/functions/retry-build.md +3 -3
  72. package/docs/examples/functions/update-deployment.md +3 -3
  73. package/docs/examples/functions/update.md +3 -3
  74. package/docs/examples/health/get-antivirus.md +3 -3
  75. package/docs/examples/health/get-cache.md +3 -3
  76. package/docs/examples/health/get-d-b.md +3 -3
  77. package/docs/examples/health/get-queue-certificates.md +3 -3
  78. package/docs/examples/health/get-queue-functions.md +3 -3
  79. package/docs/examples/health/get-queue-logs.md +3 -3
  80. package/docs/examples/health/get-queue-webhooks.md +3 -3
  81. package/docs/examples/health/get-storage-local.md +3 -3
  82. package/docs/examples/health/get-time.md +3 -3
  83. package/docs/examples/health/get.md +3 -3
  84. package/docs/examples/locale/get-continents.md +3 -3
  85. package/docs/examples/locale/get-countries-e-u.md +3 -3
  86. package/docs/examples/locale/get-countries-phones.md +3 -3
  87. package/docs/examples/locale/get-countries.md +3 -3
  88. package/docs/examples/locale/get-currencies.md +3 -3
  89. package/docs/examples/locale/get-languages.md +3 -3
  90. package/docs/examples/locale/get.md +3 -3
  91. package/docs/examples/storage/create-bucket.md +3 -3
  92. package/docs/examples/storage/create-file.md +3 -3
  93. package/docs/examples/storage/delete-bucket.md +3 -3
  94. package/docs/examples/storage/delete-file.md +3 -3
  95. package/docs/examples/storage/get-bucket.md +3 -3
  96. package/docs/examples/storage/get-file-download.md +3 -3
  97. package/docs/examples/storage/get-file-preview.md +3 -3
  98. package/docs/examples/storage/get-file-view.md +3 -3
  99. package/docs/examples/storage/get-file.md +3 -3
  100. package/docs/examples/storage/list-buckets.md +3 -3
  101. package/docs/examples/storage/list-files.md +3 -3
  102. package/docs/examples/storage/update-bucket.md +3 -3
  103. package/docs/examples/storage/update-file.md +3 -3
  104. package/docs/examples/teams/create-membership.md +3 -3
  105. package/docs/examples/teams/create.md +3 -3
  106. package/docs/examples/teams/delete-membership.md +3 -3
  107. package/docs/examples/teams/delete.md +3 -3
  108. package/docs/examples/teams/get-membership.md +3 -3
  109. package/docs/examples/teams/get-memberships.md +3 -3
  110. package/docs/examples/teams/get.md +3 -3
  111. package/docs/examples/teams/list.md +3 -3
  112. package/docs/examples/teams/update-membership-roles.md +3 -3
  113. package/docs/examples/teams/update-membership-status.md +3 -3
  114. package/docs/examples/teams/update.md +3 -3
  115. package/docs/examples/users/create.md +3 -3
  116. package/docs/examples/users/delete-session.md +3 -3
  117. package/docs/examples/users/delete-sessions.md +3 -3
  118. package/docs/examples/users/delete.md +3 -3
  119. package/docs/examples/users/get-logs.md +3 -3
  120. package/docs/examples/{database/list-collections.md → users/get-memberships.md} +3 -3
  121. package/docs/examples/users/get-prefs.md +3 -3
  122. package/docs/examples/users/get-sessions.md +3 -3
  123. package/docs/examples/users/get.md +3 -3
  124. package/docs/examples/users/list.md +3 -3
  125. package/docs/examples/{database/delete-collection.md → users/update-email-verification.md} +3 -3
  126. package/docs/examples/users/update-email.md +3 -3
  127. package/docs/examples/users/update-name.md +3 -3
  128. package/docs/examples/users/update-password.md +3 -3
  129. package/docs/examples/{database/get-attribute.md → users/update-phone-verification.md} +3 -3
  130. package/docs/examples/{health/get-queue-usage.md → users/update-phone.md} +3 -3
  131. package/docs/examples/users/update-prefs.md +3 -3
  132. package/docs/examples/users/update-status.md +3 -3
  133. package/index.d.ts +375 -161
  134. package/index.js +4 -2
  135. package/lib/client.js +9 -3
  136. package/lib/inputFile.js +47 -0
  137. package/lib/services/account.js +127 -24
  138. package/lib/services/avatars.js +35 -3
  139. package/lib/services/{database.js → databases.js} +183 -89
  140. package/lib/services/functions.js +100 -42
  141. package/lib/services/health.js +2 -18
  142. package/lib/services/locale.js +2 -0
  143. package/lib/services/storage.js +108 -50
  144. package/lib/services/teams.js +2 -0
  145. package/lib/services/users.js +94 -3
  146. package/package.json +2 -2
  147. package/docs/examples/database/get-document.md +0 -20
  148. package/docs/examples/users/update-verification.md +0 -20
package/index.d.ts CHANGED
@@ -27,6 +27,19 @@ declare module "node-appwrite" {
27
27
  collections: Collection[];
28
28
  }
29
29
  /**
30
+ * Databases List
31
+ */
32
+ export type DatabaseList = {
33
+ /**
34
+ * Total number of databases documents that matched your query.
35
+ */
36
+ total: number;
37
+ /**
38
+ * List of databases.
39
+ */
40
+ databases: Database[];
41
+ }
42
+ /**
30
43
  * Indexes List
31
44
  */
32
45
  export type IndexList = {
@@ -248,6 +261,19 @@ declare module "node-appwrite" {
248
261
  phones: Phone[];
249
262
  }
250
263
  /**
264
+ * Database
265
+ */
266
+ export type Database = {
267
+ /**
268
+ * Database ID.
269
+ */
270
+ $id: string;
271
+ /**
272
+ * Database name.
273
+ */
274
+ name: string;
275
+ }
276
+ /**
251
277
  * Collection
252
278
  */
253
279
  export type Collection = {
@@ -256,6 +282,14 @@ declare module "node-appwrite" {
256
282
  */
257
283
  $id: string;
258
284
  /**
285
+ * Collection creation date in Unix timestamp.
286
+ */
287
+ $createdAt: number;
288
+ /**
289
+ * Collection update date in Unix timestamp.
290
+ */
291
+ $updatedAt: number;
292
+ /**
259
293
  * Collection read permissions.
260
294
  */
261
295
  $read: string[];
@@ -264,6 +298,10 @@ declare module "node-appwrite" {
264
298
  */
265
299
  $write: string[];
266
300
  /**
301
+ * Database ID.
302
+ */
303
+ databaseId: string;
304
+ /**
267
305
  * Collection name.
268
306
  */
269
307
  name: string;
@@ -607,6 +645,14 @@ declare module "node-appwrite" {
607
645
  */
608
646
  $collection: string;
609
647
  /**
648
+ * Document creation date in Unix timestamp.
649
+ */
650
+ $createdAt: number;
651
+ /**
652
+ * Document update date in Unix timestamp.
653
+ */
654
+ $updatedAt: number;
655
+ /**
610
656
  * Document read permissions.
611
657
  */
612
658
  $read: string[];
@@ -713,6 +759,14 @@ declare module "node-appwrite" {
713
759
  */
714
760
  $id: string;
715
761
  /**
762
+ * User creation date in Unix timestamp.
763
+ */
764
+ $createdAt: number;
765
+ /**
766
+ * User update date in Unix timestamp.
767
+ */
768
+ $updatedAt: number;
769
+ /**
716
770
  * User name.
717
771
  */
718
772
  name: string;
@@ -733,10 +787,18 @@ declare module "node-appwrite" {
733
787
  */
734
788
  email: string;
735
789
  /**
790
+ * User phone number in E.164 format.
791
+ */
792
+ phone: string;
793
+ /**
736
794
  * Email verification status.
737
795
  */
738
796
  emailVerification: boolean;
739
797
  /**
798
+ * Phone verification status.
799
+ */
800
+ phoneVerification: boolean;
801
+ /**
740
802
  * User preferences as a key-value object
741
803
  */
742
804
  prefs: Preferences;
@@ -755,6 +817,10 @@ declare module "node-appwrite" {
755
817
  */
756
818
  $id: string;
757
819
  /**
820
+ * Session creation date in Unix timestamp.
821
+ */
822
+ $createdAt: number;
823
+ /**
758
824
  * User ID.
759
825
  */
760
826
  userId: string;
@@ -856,6 +922,10 @@ declare module "node-appwrite" {
856
922
  */
857
923
  $id: string;
858
924
  /**
925
+ * Token creation date in Unix timestamp.
926
+ */
927
+ $createdAt: number;
928
+ /**
859
929
  * User ID.
860
930
  */
861
931
  userId: string;
@@ -914,6 +984,14 @@ declare module "node-appwrite" {
914
984
  */
915
985
  bucketId: string;
916
986
  /**
987
+ * File creation date in Unix timestamp.
988
+ */
989
+ $createdAt: number;
990
+ /**
991
+ * File update date in Unix timestamp.
992
+ */
993
+ $updatedAt: number;
994
+ /**
917
995
  * File read permissions.
918
996
  */
919
997
  $read: string[];
@@ -926,10 +1004,6 @@ declare module "node-appwrite" {
926
1004
  */
927
1005
  name: string;
928
1006
  /**
929
- * File creation date in Unix timestamp.
930
- */
931
- dateCreated: number;
932
- /**
933
1007
  * File MD5 signature.
934
1008
  */
935
1009
  signature: string;
@@ -959,6 +1033,14 @@ declare module "node-appwrite" {
959
1033
  */
960
1034
  $id: string;
961
1035
  /**
1036
+ * Bucket creation date in Unix timestamp.
1037
+ */
1038
+ $createdAt: number;
1039
+ /**
1040
+ * Bucket update date in Unix timestamp.
1041
+ */
1042
+ $updatedAt: number;
1043
+ /**
962
1044
  * File read permissions.
963
1045
  */
964
1046
  $read: string[];
@@ -971,14 +1053,6 @@ declare module "node-appwrite" {
971
1053
  */
972
1054
  permission: string;
973
1055
  /**
974
- * Bucket creation date in Unix timestamp.
975
- */
976
- dateCreated: number;
977
- /**
978
- * Bucket update date in Unix timestamp.
979
- */
980
- dateUpdated: number;
981
- /**
982
1056
  * Bucket name.
983
1057
  */
984
1058
  name: string;
@@ -1012,13 +1086,17 @@ declare module "node-appwrite" {
1012
1086
  */
1013
1087
  $id: string;
1014
1088
  /**
1015
- * Team name.
1089
+ * Team creation date in Unix timestamp.
1016
1090
  */
1017
- name: string;
1091
+ $createdAt: number;
1018
1092
  /**
1019
- * Team creation date in Unix timestamp.
1093
+ * Team update date in Unix timestamp.
1094
+ */
1095
+ $updatedAt: number;
1096
+ /**
1097
+ * Team name.
1020
1098
  */
1021
- dateCreated: number;
1099
+ name: string;
1022
1100
  /**
1023
1101
  * Total number of team members.
1024
1102
  */
@@ -1033,21 +1111,33 @@ declare module "node-appwrite" {
1033
1111
  */
1034
1112
  $id: string;
1035
1113
  /**
1036
- * User ID.
1114
+ * Membership creation date in Unix timestamp.
1037
1115
  */
1038
- userId: string;
1116
+ $createdAt: number;
1039
1117
  /**
1040
- * Team ID.
1118
+ * Membership update date in Unix timestamp.
1041
1119
  */
1042
- teamId: string;
1120
+ $updatedAt: number;
1121
+ /**
1122
+ * User ID.
1123
+ */
1124
+ userId: string;
1043
1125
  /**
1044
1126
  * User name.
1045
1127
  */
1046
- name: string;
1128
+ userName: string;
1047
1129
  /**
1048
1130
  * User email address.
1049
1131
  */
1050
- email: string;
1132
+ userEmail: string;
1133
+ /**
1134
+ * Team ID.
1135
+ */
1136
+ teamId: string;
1137
+ /**
1138
+ * Team name.
1139
+ */
1140
+ teamName: string;
1051
1141
  /**
1052
1142
  * Date, the user has been invited to join the team in Unix timestamp.
1053
1143
  */
@@ -1074,21 +1164,21 @@ declare module "node-appwrite" {
1074
1164
  */
1075
1165
  $id: string;
1076
1166
  /**
1077
- * Execution permissions.
1167
+ * Function creation date in Unix timestamp.
1078
1168
  */
1079
- execute: string[];
1169
+ $createdAt: number;
1080
1170
  /**
1081
- * Function name.
1171
+ * Function update date in Unix timestamp.
1082
1172
  */
1083
- name: string;
1173
+ $updatedAt: number;
1084
1174
  /**
1085
- * Function creation date in Unix timestamp.
1175
+ * Execution permissions.
1086
1176
  */
1087
- dateCreated: number;
1177
+ execute: string[];
1088
1178
  /**
1089
- * Function update date in Unix timestamp.
1179
+ * Function name.
1090
1180
  */
1091
- dateUpdated: number;
1181
+ name: string;
1092
1182
  /**
1093
1183
  * Function status. Possible values: `disabled`, `enabled`
1094
1184
  */
@@ -1168,6 +1258,14 @@ declare module "node-appwrite" {
1168
1258
  */
1169
1259
  $id: string;
1170
1260
  /**
1261
+ * Deployment creation date in Unix timestamp.
1262
+ */
1263
+ $createdAt: number;
1264
+ /**
1265
+ * Deployment update date in Unix timestamp.
1266
+ */
1267
+ $updatedAt: number;
1268
+ /**
1171
1269
  * Resource ID.
1172
1270
  */
1173
1271
  resourceId: string;
@@ -1176,10 +1274,6 @@ declare module "node-appwrite" {
1176
1274
  */
1177
1275
  resourceType: string;
1178
1276
  /**
1179
- * The deployment creation date in Unix timestamp.
1180
- */
1181
- dateCreated: number;
1182
- /**
1183
1277
  * The entrypoint file to use to execute the deployment code.
1184
1278
  */
1185
1279
  entrypoint: string;
@@ -1217,6 +1311,14 @@ declare module "node-appwrite" {
1217
1311
  */
1218
1312
  $id: string;
1219
1313
  /**
1314
+ * Execution creation date in Unix timestamp.
1315
+ */
1316
+ $createdAt: number;
1317
+ /**
1318
+ * Execution update date in Unix timestamp.
1319
+ */
1320
+ $updatedAt: number;
1321
+ /**
1220
1322
  * Execution read permissions.
1221
1323
  */
1222
1324
  $read: string[];
@@ -1225,10 +1327,6 @@ declare module "node-appwrite" {
1225
1327
  */
1226
1328
  functionId: string;
1227
1329
  /**
1228
- * The execution creation date in Unix timestamp.
1229
- */
1230
- dateCreated: number;
1231
- /**
1232
1330
  * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
1233
1331
  */
1234
1332
  trigger: string;
@@ -1241,9 +1339,9 @@ declare module "node-appwrite" {
1241
1339
  */
1242
1340
  statusCode: number;
1243
1341
  /**
1244
- * The script stdout output string. Logs the last 4,000 characters of the execution stdout output.
1342
+ * The script response output string. Logs the last 4,000 characters of the execution response output.
1245
1343
  */
1246
- stdout: string;
1344
+ response: string;
1247
1345
  /**
1248
1346
  * The script stderr output string. Logs the last 4,000 characters of the execution stderr output
1249
1347
  */
@@ -1506,19 +1604,6 @@ declare module "node-appwrite" {
1506
1604
  * @returns {Promise}
1507
1605
  */
1508
1606
  get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
1509
- /**
1510
- * Delete Account
1511
- *
1512
- * Delete a currently logged in user account. Behind the scene, the user
1513
- * record is not deleted but permanently blocked from any access. This is done
1514
- * to avoid deleted accounts being overtaken by new users with the same email
1515
- * address. Any user-related resources like documents or storage files should
1516
- * be deleted separately.
1517
- *
1518
- * @throws {AppwriteException}
1519
- * @returns {Promise}
1520
- */
1521
- delete(): Promise<Response>;
1522
1607
  /**
1523
1608
  * Update Account Email
1524
1609
  *
@@ -1564,7 +1649,7 @@ declare module "node-appwrite" {
1564
1649
  *
1565
1650
  * Update currently logged in user password. For validation, user is required
1566
1651
  * to pass in the new password, and the old password. For users created with
1567
- * OAuth and Team Invites, oldPassword is optional.
1652
+ * OAuth, Team Invites and Magic URL, oldPassword is optional.
1568
1653
  *
1569
1654
  * @param {string} password
1570
1655
  * @param {string} oldPassword
@@ -1572,6 +1657,20 @@ declare module "node-appwrite" {
1572
1657
  * @returns {Promise}
1573
1658
  */
1574
1659
  updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
1660
+ /**
1661
+ * Update Account Phone
1662
+ *
1663
+ * Update currently logged in user account phone number. After changing phone
1664
+ * number, the user confirmation status will get reset. A new confirmation SMS
1665
+ * is not sent automatically however you can use the phone confirmation
1666
+ * endpoint again to send the confirmation SMS.
1667
+ *
1668
+ * @param {string} number
1669
+ * @param {string} password
1670
+ * @throws {AppwriteException}
1671
+ * @returns {Promise}
1672
+ */
1673
+ updatePhone<Preferences extends Models.Preferences>(number: string, password: string): Promise<Models.User<Preferences>>;
1575
1674
  /**
1576
1675
  * Get Account Preferences
1577
1676
  *
@@ -1666,6 +1765,10 @@ declare module "node-appwrite" {
1666
1765
  /**
1667
1766
  * Update Session (Refresh Tokens)
1668
1767
  *
1768
+ * Access tokens have limited lifespan and expire to mitigate security risks.
1769
+ * If session was created using an OAuth provider, this route can be used to
1770
+ * "refresh" the access token.
1771
+ *
1669
1772
  * @param {string} sessionId
1670
1773
  * @throws {AppwriteException}
1671
1774
  * @returns {Promise}
@@ -1684,6 +1787,17 @@ declare module "node-appwrite" {
1684
1787
  * @returns {Promise}
1685
1788
  */
1686
1789
  deleteSession(sessionId: string): Promise<Response>;
1790
+ /**
1791
+ * Update Account Status
1792
+ *
1793
+ * Block the currently logged in user account. Behind the scene, the user
1794
+ * record is not deleted but permanently blocked from any access. To
1795
+ * completely delete a user, use the Users API instead.
1796
+ *
1797
+ * @throws {AppwriteException}
1798
+ * @returns {Promise}
1799
+ */
1800
+ updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
1687
1801
  /**
1688
1802
  * Create Email Verification
1689
1803
  *
@@ -1694,8 +1808,8 @@ declare module "node-appwrite" {
1694
1808
  * should redirect the user back to your app and allow you to complete the
1695
1809
  * verification process by verifying both the **userId** and **secret**
1696
1810
  * parameters. Learn more about how to [complete the verification
1697
- * process](/docs/client/account#accountUpdateVerification). The verification
1698
- * link sent to the user's email address is valid for 7 days.
1811
+ * process](/docs/client/account#accountUpdateEmailVerification). The
1812
+ * verification link sent to the user's email address is valid for 7 days.
1699
1813
  *
1700
1814
  * Please note that in order to avoid a [Redirect
1701
1815
  * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
@@ -1722,15 +1836,49 @@ declare module "node-appwrite" {
1722
1836
  * @returns {Promise}
1723
1837
  */
1724
1838
  updateVerification(userId: string, secret: string): Promise<Models.Token>;
1839
+ /**
1840
+ * Create Phone Verification
1841
+ *
1842
+ * Use this endpoint to send a verification message to your user's phone
1843
+ * number to confirm they are the valid owners of that address. The provided
1844
+ * secret should allow you to complete the verification process by verifying
1845
+ * both the **userId** and **secret** parameters. Learn more about how to
1846
+ * [complete the verification
1847
+ * process](/docs/client/account#accountUpdatePhoneVerification). The
1848
+ * verification link sent to the user's phone number is valid for 15 minutes.
1849
+ *
1850
+ * @throws {AppwriteException}
1851
+ * @returns {Promise}
1852
+ */
1853
+ createPhoneVerification(): Promise<Models.Token>;
1854
+ /**
1855
+ * Create Phone Verification (confirmation)
1856
+ *
1857
+ * Use this endpoint to complete the user phone verification process. Use the
1858
+ * **userId** and **secret** that were sent to your user's phone number to
1859
+ * verify the user email ownership. If confirmed this route will return a 200
1860
+ * status code.
1861
+ *
1862
+ * @param {string} userId
1863
+ * @param {string} secret
1864
+ * @throws {AppwriteException}
1865
+ * @returns {Promise}
1866
+ */
1867
+ updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
1725
1868
  }
1726
1869
  export class Avatars extends Service {
1727
1870
  /**
1728
1871
  * Get Browser Icon
1729
1872
  *
1730
1873
  * You can use this endpoint to show different browser icons to your users.
1731
- * The code argument receives the browser code as it appears in your user
1732
- * /account/sessions endpoint. Use width, height and quality arguments to
1733
- * change the output settings.
1874
+ * The code argument receives the browser code as it appears in your user [GET
1875
+ * /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
1876
+ * width, height and quality arguments to change the output settings.
1877
+ *
1878
+ * When one dimension is specified and the other is 0, the image is scaled
1879
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
1880
+ * image at source quality. If dimensions are not specified, the default size
1881
+ * of image returned is 100x100px.
1734
1882
  *
1735
1883
  * @param {string} code
1736
1884
  * @param {number} width
@@ -1746,6 +1894,12 @@ declare module "node-appwrite" {
1746
1894
  * The credit card endpoint will return you the icon of the credit card
1747
1895
  * provider you need. Use width, height and quality arguments to change the
1748
1896
  * output settings.
1897
+ *
1898
+ * When one dimension is specified and the other is 0, the image is scaled
1899
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
1900
+ * image at source quality. If dimensions are not specified, the default size
1901
+ * of image returned is 100x100px.
1902
+ *
1749
1903
  *
1750
1904
  * @param {string} code
1751
1905
  * @param {number} width
@@ -1773,6 +1927,12 @@ declare module "node-appwrite" {
1773
1927
  * You can use this endpoint to show different country flags icons to your
1774
1928
  * users. The code argument receives the 2 letter country code. Use width,
1775
1929
  * height and quality arguments to change the output settings.
1930
+ *
1931
+ * When one dimension is specified and the other is 0, the image is scaled
1932
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
1933
+ * image at source quality. If dimensions are not specified, the default size
1934
+ * of image returned is 100x100px.
1935
+ *
1776
1936
  *
1777
1937
  * @param {string} code
1778
1938
  * @param {number} width
@@ -1789,6 +1949,12 @@ declare module "node-appwrite" {
1789
1949
  * you want. This endpoint is very useful if you need to crop and display
1790
1950
  * remote images in your app or in case you want to make sure a 3rd party
1791
1951
  * image is properly served using a TLS protocol.
1952
+ *
1953
+ * When one dimension is specified and the other is 0, the image is scaled
1954
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
1955
+ * image at source quality. If dimensions are not specified, the default size
1956
+ * of image returned is 400x400px.
1957
+ *
1792
1958
  *
1793
1959
  * @param {string} url
1794
1960
  * @param {number} width
@@ -1810,6 +1976,12 @@ declare module "node-appwrite" {
1810
1976
  * default, a random theme will be selected. The random theme will persist for
1811
1977
  * the user's initials when reloading the same theme will always return for
1812
1978
  * the same initials.
1979
+ *
1980
+ * When one dimension is specified and the other is 0, the image is scaled
1981
+ * with preserved aspect ratio. If both dimensions are 0, the API provides an
1982
+ * image at source quality. If dimensions are not specified, the default size
1983
+ * of image returned is 100x100px.
1984
+ *
1813
1985
  *
1814
1986
  * @param {string} name
1815
1987
  * @param {number} width
@@ -1825,6 +1997,7 @@ declare module "node-appwrite" {
1825
1997
  *
1826
1998
  * Converts a given plain text to a QR code image. You can use the query
1827
1999
  * parameters to change the size and style of the resulting image.
2000
+ *
1828
2001
  *
1829
2002
  * @param {string} text
1830
2003
  * @param {number} size
@@ -1835,15 +2008,58 @@ declare module "node-appwrite" {
1835
2008
  */
1836
2009
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
1837
2010
  }
1838
- export class Database extends Service {
2011
+ export class Databases extends Service {
1839
2012
  /**
1840
- * List Collections
2013
+ * List Databases
2014
+ *
2015
+ * @param {string} search
2016
+ * @param {number} limit
2017
+ * @param {number} offset
2018
+ * @param {string} cursor
2019
+ * @param {string} cursorDirection
2020
+ * @param {string} orderType
2021
+ * @throws {AppwriteException}
2022
+ * @returns {Promise}
2023
+ */
2024
+ list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DatabaseList>;
2025
+ /**
2026
+ * Create Database
1841
2027
  *
1842
- * Get a list of all the user collections. You can use the query params to
1843
- * filter your results. On admin mode, this endpoint will return a list of all
1844
- * of the project's collections. [Learn more about different API
1845
- * modes](/docs/admin).
2028
+ * @param {string} databaseId
2029
+ * @param {string} name
2030
+ * @throws {AppwriteException}
2031
+ * @returns {Promise}
2032
+ */
2033
+ create(databaseId: string, name: string): Promise<Models.Database>;
2034
+ /**
2035
+ * Get Database
1846
2036
  *
2037
+ * @param {string} databaseId
2038
+ * @throws {AppwriteException}
2039
+ * @returns {Promise}
2040
+ */
2041
+ get(databaseId: string): Promise<Models.Collection>;
2042
+ /**
2043
+ * Update Database
2044
+ *
2045
+ * @param {string} databaseId
2046
+ * @param {string} name
2047
+ * @throws {AppwriteException}
2048
+ * @returns {Promise}
2049
+ */
2050
+ update(databaseId: string, name: string): Promise<Models.Collection>;
2051
+ /**
2052
+ * Delete Database
2053
+ *
2054
+ * @param {string} databaseId
2055
+ * @throws {AppwriteException}
2056
+ * @returns {Promise}
2057
+ */
2058
+ delete(databaseId: string): Promise<Response>;
2059
+ /**
2060
+ * List Collections
2061
+ *
2062
+ * @param {string} databaseId
1847
2063
  * @param {string} search
1848
2064
  * @param {number} limit
1849
2065
  * @param {number} offset
@@ -1853,12 +2069,11 @@ declare module "node-appwrite" {
1853
2069
  * @throws {AppwriteException}
1854
2070
  * @returns {Promise}
1855
2071
  */
1856
- listCollections(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList>;
2072
+ listCollections(databaseId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList>;
1857
2073
  /**
1858
2074
  * Create Collection
1859
2075
  *
1860
- * Create a new Collection.
1861
- *
2076
+ * @param {string} databaseId
1862
2077
  * @param {string} collectionId
1863
2078
  * @param {string} name
1864
2079
  * @param {string} permission
@@ -1867,23 +2082,20 @@ declare module "node-appwrite" {
1867
2082
  * @throws {AppwriteException}
1868
2083
  * @returns {Promise}
1869
2084
  */
1870
- createCollection(collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection>;
2085
+ createCollection(databaseId: string, collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection>;
1871
2086
  /**
1872
2087
  * Get Collection
1873
2088
  *
1874
- * Get a collection by its unique ID. This endpoint response returns a JSON
1875
- * object with the collection metadata.
1876
- *
2089
+ * @param {string} databaseId
1877
2090
  * @param {string} collectionId
1878
2091
  * @throws {AppwriteException}
1879
2092
  * @returns {Promise}
1880
2093
  */
1881
- getCollection(collectionId: string): Promise<Models.Collection>;
2094
+ getCollection(databaseId: string, collectionId: string): Promise<Models.Collection>;
1882
2095
  /**
1883
2096
  * Update Collection
1884
2097
  *
1885
- * Update a collection by its unique ID.
1886
- *
2098
+ * @param {string} databaseId
1887
2099
  * @param {string} collectionId
1888
2100
  * @param {string} name
1889
2101
  * @param {string} permission
@@ -1893,32 +2105,29 @@ declare module "node-appwrite" {
1893
2105
  * @throws {AppwriteException}
1894
2106
  * @returns {Promise}
1895
2107
  */
1896
- updateCollection(collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection>;
2108
+ updateCollection(databaseId: string, collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection>;
1897
2109
  /**
1898
2110
  * Delete Collection
1899
2111
  *
1900
- * Delete a collection by its unique ID. Only users with write permissions
1901
- * have access to delete this resource.
1902
- *
2112
+ * @param {string} databaseId
1903
2113
  * @param {string} collectionId
1904
2114
  * @throws {AppwriteException}
1905
2115
  * @returns {Promise}
1906
2116
  */
1907
- deleteCollection(collectionId: string): Promise<Response>;
2117
+ deleteCollection(databaseId: string, collectionId: string): Promise<Response>;
1908
2118
  /**
1909
2119
  * List Attributes
1910
2120
  *
2121
+ * @param {string} databaseId
1911
2122
  * @param {string} collectionId
1912
2123
  * @throws {AppwriteException}
1913
2124
  * @returns {Promise}
1914
2125
  */
1915
- listAttributes(collectionId: string): Promise<Models.AttributeList>;
2126
+ listAttributes(databaseId: string, collectionId: string): Promise<Models.AttributeList>;
1916
2127
  /**
1917
2128
  * Create Boolean Attribute
1918
2129
  *
1919
- * Create a boolean attribute.
1920
- *
1921
- *
2130
+ * @param {string} databaseId
1922
2131
  * @param {string} collectionId
1923
2132
  * @param {string} key
1924
2133
  * @param {boolean} required
@@ -1927,13 +2136,11 @@ declare module "node-appwrite" {
1927
2136
  * @throws {AppwriteException}
1928
2137
  * @returns {Promise}
1929
2138
  */
1930
- createBooleanAttribute(collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
2139
+ createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
1931
2140
  /**
1932
2141
  * Create Email Attribute
1933
2142
  *
1934
- * Create an email attribute.
1935
- *
1936
- *
2143
+ * @param {string} databaseId
1937
2144
  * @param {string} collectionId
1938
2145
  * @param {string} key
1939
2146
  * @param {boolean} required
@@ -1942,10 +2149,11 @@ declare module "node-appwrite" {
1942
2149
  * @throws {AppwriteException}
1943
2150
  * @returns {Promise}
1944
2151
  */
1945
- createEmailAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
2152
+ createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
1946
2153
  /**
1947
2154
  * Create Enum Attribute
1948
2155
  *
2156
+ * @param {string} databaseId
1949
2157
  * @param {string} collectionId
1950
2158
  * @param {string} key
1951
2159
  * @param {string[]} elements
@@ -1955,14 +2163,11 @@ declare module "node-appwrite" {
1955
2163
  * @throws {AppwriteException}
1956
2164
  * @returns {Promise}
1957
2165
  */
1958
- createEnumAttribute(collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
2166
+ createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
1959
2167
  /**
1960
2168
  * Create Float Attribute
1961
2169
  *
1962
- * Create a float attribute. Optionally, minimum and maximum values can be
1963
- * provided.
1964
- *
1965
- *
2170
+ * @param {string} databaseId
1966
2171
  * @param {string} collectionId
1967
2172
  * @param {string} key
1968
2173
  * @param {boolean} required
@@ -1973,14 +2178,11 @@ declare module "node-appwrite" {
1973
2178
  * @throws {AppwriteException}
1974
2179
  * @returns {Promise}
1975
2180
  */
1976
- createFloatAttribute(collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
2181
+ createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
1977
2182
  /**
1978
2183
  * Create Integer Attribute
1979
2184
  *
1980
- * Create an integer attribute. Optionally, minimum and maximum values can be
1981
- * provided.
1982
- *
1983
- *
2185
+ * @param {string} databaseId
1984
2186
  * @param {string} collectionId
1985
2187
  * @param {string} key
1986
2188
  * @param {boolean} required
@@ -1991,13 +2193,11 @@ declare module "node-appwrite" {
1991
2193
  * @throws {AppwriteException}
1992
2194
  * @returns {Promise}
1993
2195
  */
1994
- createIntegerAttribute(collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
2196
+ createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
1995
2197
  /**
1996
2198
  * Create IP Address Attribute
1997
2199
  *
1998
- * Create IP address attribute.
1999
- *
2000
- *
2200
+ * @param {string} databaseId
2001
2201
  * @param {string} collectionId
2002
2202
  * @param {string} key
2003
2203
  * @param {boolean} required
@@ -2006,13 +2206,11 @@ declare module "node-appwrite" {
2006
2206
  * @throws {AppwriteException}
2007
2207
  * @returns {Promise}
2008
2208
  */
2009
- createIpAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
2209
+ createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
2010
2210
  /**
2011
2211
  * Create String Attribute
2012
2212
  *
2013
- * Create a string attribute.
2014
- *
2015
- *
2213
+ * @param {string} databaseId
2016
2214
  * @param {string} collectionId
2017
2215
  * @param {string} key
2018
2216
  * @param {number} size
@@ -2022,13 +2220,11 @@ declare module "node-appwrite" {
2022
2220
  * @throws {AppwriteException}
2023
2221
  * @returns {Promise}
2024
2222
  */
2025
- createStringAttribute(collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
2223
+ createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
2026
2224
  /**
2027
2225
  * Create URL Attribute
2028
2226
  *
2029
- * Create a URL attribute.
2030
- *
2031
- *
2227
+ * @param {string} databaseId
2032
2228
  * @param {string} collectionId
2033
2229
  * @param {string} key
2034
2230
  * @param {boolean} required
@@ -2037,33 +2233,31 @@ declare module "node-appwrite" {
2037
2233
  * @throws {AppwriteException}
2038
2234
  * @returns {Promise}
2039
2235
  */
2040
- createUrlAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
2236
+ createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
2041
2237
  /**
2042
2238
  * Get Attribute
2043
2239
  *
2240
+ * @param {string} databaseId
2044
2241
  * @param {string} collectionId
2045
2242
  * @param {string} key
2046
2243
  * @throws {AppwriteException}
2047
2244
  * @returns {Promise}
2048
2245
  */
2049
- getAttribute(collectionId: string, key: string): Promise<Response>;
2246
+ getAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
2050
2247
  /**
2051
2248
  * Delete Attribute
2052
2249
  *
2250
+ * @param {string} databaseId
2053
2251
  * @param {string} collectionId
2054
2252
  * @param {string} key
2055
2253
  * @throws {AppwriteException}
2056
2254
  * @returns {Promise}
2057
2255
  */
2058
- deleteAttribute(collectionId: string, key: string): Promise<Response>;
2256
+ deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
2059
2257
  /**
2060
2258
  * List Documents
2061
2259
  *
2062
- * Get a list of all the user documents. You can use the query params to
2063
- * filter your results. On admin mode, this endpoint will return a list of all
2064
- * of the project's documents. [Learn more about different API
2065
- * modes](/docs/admin).
2066
- *
2260
+ * @param {string} databaseId
2067
2261
  * @param {string} collectionId
2068
2262
  * @param {string[]} queries
2069
2263
  * @param {number} limit
@@ -2075,15 +2269,11 @@ declare module "node-appwrite" {
2075
2269
  * @throws {AppwriteException}
2076
2270
  * @returns {Promise}
2077
2271
  */
2078
- listDocuments<Document extends Models.Document>(collectionId: string, queries?: string[], limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderAttributes?: string[], orderTypes?: string[]): Promise<Models.DocumentList<Document>>;
2272
+ listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[], limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderAttributes?: string[], orderTypes?: string[]): Promise<Models.DocumentList<Document>>;
2079
2273
  /**
2080
2274
  * Create Document
2081
2275
  *
2082
- * Create a new Document. Before using this route, you should create a new
2083
- * collection resource using either a [server
2084
- * integration](/docs/server/database#databaseCreateCollection) API or
2085
- * directly from your database console.
2086
- *
2276
+ * @param {string} databaseId
2087
2277
  * @param {string} collectionId
2088
2278
  * @param {string} documentId
2089
2279
  * @param {object} data
@@ -2092,25 +2282,21 @@ declare module "node-appwrite" {
2092
2282
  * @throws {AppwriteException}
2093
2283
  * @returns {Promise}
2094
2284
  */
2095
- createDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
2285
+ createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
2096
2286
  /**
2097
2287
  * Get Document
2098
2288
  *
2099
- * Get a document by its unique ID. This endpoint response returns a JSON
2100
- * object with the document data.
2101
- *
2289
+ * @param {string} databaseId
2102
2290
  * @param {string} collectionId
2103
2291
  * @param {string} documentId
2104
2292
  * @throws {AppwriteException}
2105
2293
  * @returns {Promise}
2106
2294
  */
2107
- getDocument<Document extends Models.Document>(collectionId: string, documentId: string): Promise<Document>;
2295
+ getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string): Promise<Document>;
2108
2296
  /**
2109
2297
  * Update Document
2110
2298
  *
2111
- * Update a document by its unique ID. Using the patch method you can pass
2112
- * only specific fields that will get updated.
2113
- *
2299
+ * @param {string} databaseId
2114
2300
  * @param {string} collectionId
2115
2301
  * @param {string} documentId
2116
2302
  * @param {object} data
@@ -2119,31 +2305,30 @@ declare module "node-appwrite" {
2119
2305
  * @throws {AppwriteException}
2120
2306
  * @returns {Promise}
2121
2307
  */
2122
- updateDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
2308
+ updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, read?: string[], write?: string[]): Promise<Document>;
2123
2309
  /**
2124
2310
  * Delete Document
2125
2311
  *
2126
- * Delete a document by its unique ID. This endpoint deletes only the parent
2127
- * documents, its attributes and relations to other documents. Child documents
2128
- * **will not** be deleted.
2129
- *
2312
+ * @param {string} databaseId
2130
2313
  * @param {string} collectionId
2131
2314
  * @param {string} documentId
2132
2315
  * @throws {AppwriteException}
2133
2316
  * @returns {Promise}
2134
2317
  */
2135
- deleteDocument(collectionId: string, documentId: string): Promise<Response>;
2318
+ deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<Response>;
2136
2319
  /**
2137
2320
  * List Indexes
2138
2321
  *
2322
+ * @param {string} databaseId
2139
2323
  * @param {string} collectionId
2140
2324
  * @throws {AppwriteException}
2141
2325
  * @returns {Promise}
2142
2326
  */
2143
- listIndexes(collectionId: string): Promise<Models.IndexList>;
2327
+ listIndexes(databaseId: string, collectionId: string): Promise<Models.IndexList>;
2144
2328
  /**
2145
2329
  * Create Index
2146
2330
  *
2331
+ * @param {string} databaseId
2147
2332
  * @param {string} collectionId
2148
2333
  * @param {string} key
2149
2334
  * @param {string} type
@@ -2152,25 +2337,27 @@ declare module "node-appwrite" {
2152
2337
  * @throws {AppwriteException}
2153
2338
  * @returns {Promise}
2154
2339
  */
2155
- createIndex(collectionId: string, key: string, type: string, attributes: string[], orders?: string[]): Promise<Models.Index>;
2340
+ createIndex(databaseId: string, collectionId: string, key: string, type: string, attributes: string[], orders?: string[]): Promise<Models.Index>;
2156
2341
  /**
2157
2342
  * Get Index
2158
2343
  *
2344
+ * @param {string} databaseId
2159
2345
  * @param {string} collectionId
2160
2346
  * @param {string} key
2161
2347
  * @throws {AppwriteException}
2162
2348
  * @returns {Promise}
2163
2349
  */
2164
- getIndex(collectionId: string, key: string): Promise<Models.Index>;
2350
+ getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index>;
2165
2351
  /**
2166
2352
  * Delete Index
2167
2353
  *
2354
+ * @param {string} databaseId
2168
2355
  * @param {string} collectionId
2169
2356
  * @param {string} key
2170
2357
  * @throws {AppwriteException}
2171
2358
  * @returns {Promise}
2172
2359
  */
2173
- deleteIndex(collectionId: string, key: string): Promise<Response>;
2360
+ deleteIndex(databaseId: string, collectionId: string, key: string): Promise<Response>;
2174
2361
  }
2175
2362
  export class Functions extends Service {
2176
2363
  /**
@@ -2209,7 +2396,7 @@ declare module "node-appwrite" {
2209
2396
  */
2210
2397
  create(functionId: string, name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>;
2211
2398
  /**
2212
- * List the currently active function runtimes.
2399
+ * List runtimes
2213
2400
  *
2214
2401
  * Get a list of all runtimes that are currently active on your instance.
2215
2402
  *
@@ -2286,12 +2473,12 @@ declare module "node-appwrite" {
2286
2473
  *
2287
2474
  * @param {string} functionId
2288
2475
  * @param {string} entrypoint
2289
- * @param {string} code
2476
+ * @param {InputFile} code
2290
2477
  * @param {boolean} activate
2291
2478
  * @throws {AppwriteException}
2292
2479
  * @returns {Promise}
2293
2480
  */
2294
- createDeployment(functionId: string, entrypoint: string, code: string, activate: boolean): Promise<Models.Deployment>;
2481
+ createDeployment(functionId: string, entrypoint: string, code: InputFile, activate: boolean): Promise<Models.Deployment>;
2295
2482
  /**
2296
2483
  * Get Deployment
2297
2484
  *
@@ -2448,16 +2635,6 @@ declare module "node-appwrite" {
2448
2635
  * @returns {Promise}
2449
2636
  */
2450
2637
  getQueueLogs(): Promise<Models.HealthQueue>;
2451
- /**
2452
- * Get Usage Queue
2453
- *
2454
- * Get the number of usage stats that are waiting to be processed in the
2455
- * Appwrite internal queue server.
2456
- *
2457
- * @throws {AppwriteException}
2458
- * @returns {Promise}
2459
- */
2460
- getQueueUsage(): Promise<Models.HealthQueue>;
2461
2638
  /**
2462
2639
  * Get Webhooks Queue
2463
2640
  *
@@ -2688,13 +2865,13 @@ declare module "node-appwrite" {
2688
2865
  *
2689
2866
  * @param {string} bucketId
2690
2867
  * @param {string} fileId
2691
- * @param {string} file
2868
+ * @param {InputFile} file
2692
2869
  * @param {string[]} read
2693
2870
  * @param {string[]} write
2694
2871
  * @throws {AppwriteException}
2695
2872
  * @returns {Promise}
2696
2873
  */
2697
- createFile(bucketId: string, fileId: string, file: string, read?: string[], write?: string[]): Promise<Models.File>;
2874
+ createFile(bucketId: string, fileId: string, file: InputFile, read?: string[], write?: string[]): Promise<Models.File>;
2698
2875
  /**
2699
2876
  * Get File
2700
2877
  *
@@ -3000,7 +3177,11 @@ declare module "node-appwrite" {
3000
3177
  /**
3001
3178
  * Delete User
3002
3179
  *
3003
- * Delete a user by its unique ID.
3180
+ * Delete a user by its unique ID, thereby releasing it's ID. Since ID is
3181
+ * released and can be reused, all user-related resources like documents or
3182
+ * storage files should be deleted before user deletion. If you want to keep
3183
+ * ID reserved, use the [updateStatus](/docs/server/users#usersUpdateStatus)
3184
+ * endpoint instead.
3004
3185
  *
3005
3186
  * @param {string} userId
3006
3187
  * @throws {AppwriteException}
@@ -3030,6 +3211,16 @@ declare module "node-appwrite" {
3030
3211
  * @returns {Promise}
3031
3212
  */
3032
3213
  getLogs(userId: string, limit?: number, offset?: number): Promise<Models.LogList>;
3214
+ /**
3215
+ * Get User Memberships
3216
+ *
3217
+ * Get the user membership list by its unique ID.
3218
+ *
3219
+ * @param {string} userId
3220
+ * @throws {AppwriteException}
3221
+ * @returns {Promise}
3222
+ */
3223
+ getMemberships(userId: string): Promise<Models.MembershipList>;
3033
3224
  /**
3034
3225
  * Update Name
3035
3226
  *
@@ -3052,6 +3243,17 @@ declare module "node-appwrite" {
3052
3243
  * @returns {Promise}
3053
3244
  */
3054
3245
  updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
3246
+ /**
3247
+ * Update Phone
3248
+ *
3249
+ * Update the user phone by its unique ID.
3250
+ *
3251
+ * @param {string} userId
3252
+ * @param {string} number
3253
+ * @throws {AppwriteException}
3254
+ * @returns {Promise}
3255
+ */
3256
+ updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
3055
3257
  /**
3056
3258
  * Get User Preferences
3057
3259
  *
@@ -3109,7 +3311,8 @@ declare module "node-appwrite" {
3109
3311
  /**
3110
3312
  * Update User Status
3111
3313
  *
3112
- * Update the user status by its unique ID.
3314
+ * Update the user status by its unique ID. Use this endpoint as an
3315
+ * alternative to deleting a user if you want to keep user's ID reserved.
3113
3316
  *
3114
3317
  * @param {string} userId
3115
3318
  * @param {boolean} status
@@ -3127,6 +3330,17 @@ declare module "node-appwrite" {
3127
3330
  * @throws {AppwriteException}
3128
3331
  * @returns {Promise}
3129
3332
  */
3130
- updateVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
3333
+ updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
3334
+ /**
3335
+ * Update Phone Verification
3336
+ *
3337
+ * Update the user phone verification status by its unique ID.
3338
+ *
3339
+ * @param {string} userId
3340
+ * @param {boolean} phoneVerification
3341
+ * @throws {AppwriteException}
3342
+ * @returns {Promise}
3343
+ */
3344
+ updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
3131
3345
  }
3132
3346
  }