node-appwrite 6.0.0 → 7.0.2

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/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/{database/create-boolean-attribute.md → databases/create-email-attribute.md} +3 -3
  33. package/docs/examples/databases/create-enum-attribute.md +20 -0
  34. package/docs/examples/databases/create-float-attribute.md +20 -0
  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-float-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-email-attribute.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-enum-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-document.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/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/get-attribute.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/delete-collection.md → users/update-phone-verification.md} +3 -3
  130. package/docs/examples/{database/list-collections.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 +288 -97
  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 +103 -2
  138. package/lib/services/avatars.js +2 -0
  139. package/lib/services/{database.js → databases.js} +183 -87
  140. package/lib/services/functions.js +99 -41
  141. package/lib/services/health.js +2 -0
  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 +65 -1
  146. package/package.json +1 -1
  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,6 +1111,14 @@ declare module "node-appwrite" {
1033
1111
  */
1034
1112
  $id: string;
1035
1113
  /**
1114
+ * Membership creation date in Unix timestamp.
1115
+ */
1116
+ $createdAt: number;
1117
+ /**
1118
+ * Membership update date in Unix timestamp.
1119
+ */
1120
+ $updatedAt: number;
1121
+ /**
1036
1122
  * User ID.
1037
1123
  */
1038
1124
  userId: string;
@@ -1078,21 +1164,21 @@ declare module "node-appwrite" {
1078
1164
  */
1079
1165
  $id: string;
1080
1166
  /**
1081
- * Execution permissions.
1167
+ * Function creation date in Unix timestamp.
1082
1168
  */
1083
- execute: string[];
1169
+ $createdAt: number;
1084
1170
  /**
1085
- * Function name.
1171
+ * Function update date in Unix timestamp.
1086
1172
  */
1087
- name: string;
1173
+ $updatedAt: number;
1088
1174
  /**
1089
- * Function creation date in Unix timestamp.
1175
+ * Execution permissions.
1090
1176
  */
1091
- dateCreated: number;
1177
+ execute: string[];
1092
1178
  /**
1093
- * Function update date in Unix timestamp.
1179
+ * Function name.
1094
1180
  */
1095
- dateUpdated: number;
1181
+ name: string;
1096
1182
  /**
1097
1183
  * Function status. Possible values: `disabled`, `enabled`
1098
1184
  */
@@ -1172,6 +1258,14 @@ declare module "node-appwrite" {
1172
1258
  */
1173
1259
  $id: string;
1174
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
+ /**
1175
1269
  * Resource ID.
1176
1270
  */
1177
1271
  resourceId: string;
@@ -1180,10 +1274,6 @@ declare module "node-appwrite" {
1180
1274
  */
1181
1275
  resourceType: string;
1182
1276
  /**
1183
- * The deployment creation date in Unix timestamp.
1184
- */
1185
- dateCreated: number;
1186
- /**
1187
1277
  * The entrypoint file to use to execute the deployment code.
1188
1278
  */
1189
1279
  entrypoint: string;
@@ -1221,6 +1311,14 @@ declare module "node-appwrite" {
1221
1311
  */
1222
1312
  $id: string;
1223
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
+ /**
1224
1322
  * Execution read permissions.
1225
1323
  */
1226
1324
  $read: string[];
@@ -1229,10 +1327,6 @@ declare module "node-appwrite" {
1229
1327
  */
1230
1328
  functionId: string;
1231
1329
  /**
1232
- * The execution creation date in Unix timestamp.
1233
- */
1234
- dateCreated: number;
1235
- /**
1236
1330
  * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
1237
1331
  */
1238
1332
  trigger: string;
@@ -1476,6 +1570,18 @@ declare module "node-appwrite" {
1476
1570
  constructor(client: Client);
1477
1571
  }
1478
1572
 
1573
+ export class InputFile {
1574
+ static fromPath(filePath: string, filename: string): InputFile;
1575
+
1576
+ static fromBuffer(buffer: Buffer, filename: string): InputFile;
1577
+
1578
+ static fromBlob(blob: Blob, filename: string): InputFile;
1579
+
1580
+ static fromStream(stream: any, filename: string, size: number): InputFile;
1581
+
1582
+ static fromPlainText(content: string, filename: string): InputFile;
1583
+ }
1584
+
1479
1585
  type QueryTypesSingle = string | number | boolean;
1480
1586
  type QueryTypesList = string[] | number[] | boolean[];
1481
1587
  type QueryTypes = QueryTypesSingle | QueryTypesList;
@@ -1501,6 +1607,8 @@ declare module "node-appwrite" {
1501
1607
  }
1502
1608
 
1503
1609
  export class Account extends Service {
1610
+ constructor(client: Client);
1611
+
1504
1612
  /**
1505
1613
  * Get Account
1506
1614
  *
@@ -1563,6 +1671,21 @@ declare module "node-appwrite" {
1563
1671
  * @returns {Promise}
1564
1672
  */
1565
1673
  updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
1674
+ /**
1675
+ * Update Account Phone
1676
+ *
1677
+ * Update the currently logged in user's phone number. After updating the
1678
+ * phone number, the phone verification status will be reset. A confirmation
1679
+ * SMS is not sent automatically, however you can use the [POST
1680
+ * /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)
1681
+ * endpoint to send a confirmation SMS.
1682
+ *
1683
+ * @param {string} number
1684
+ * @param {string} password
1685
+ * @throws {AppwriteException}
1686
+ * @returns {Promise}
1687
+ */
1688
+ updatePhone<Preferences extends Models.Preferences>(number: string, password: string): Promise<Models.User<Preferences>>;
1566
1689
  /**
1567
1690
  * Get Account Preferences
1568
1691
  *
@@ -1700,8 +1823,8 @@ declare module "node-appwrite" {
1700
1823
  * should redirect the user back to your app and allow you to complete the
1701
1824
  * verification process by verifying both the **userId** and **secret**
1702
1825
  * parameters. Learn more about how to [complete the verification
1703
- * process](/docs/client/account#accountUpdateVerification). The verification
1704
- * link sent to the user's email address is valid for 7 days.
1826
+ * process](/docs/client/account#accountUpdateEmailVerification). The
1827
+ * verification link sent to the user's email address is valid for 7 days.
1705
1828
  *
1706
1829
  * Please note that in order to avoid a [Redirect
1707
1830
  * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
@@ -1728,8 +1851,38 @@ declare module "node-appwrite" {
1728
1851
  * @returns {Promise}
1729
1852
  */
1730
1853
  updateVerification(userId: string, secret: string): Promise<Models.Token>;
1854
+ /**
1855
+ * Create Phone Verification
1856
+ *
1857
+ * Use this endpoint to send a verification SMS to the currently logged in
1858
+ * user. This endpoint is meant for use after updating a user's phone number
1859
+ * using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)
1860
+ * endpoint. Learn more about how to [complete the verification
1861
+ * process](/docs/client/account#accountUpdatePhoneVerification). The
1862
+ * verification code sent to the user's phone number is valid for 15 minutes.
1863
+ *
1864
+ * @throws {AppwriteException}
1865
+ * @returns {Promise}
1866
+ */
1867
+ createPhoneVerification(): Promise<Models.Token>;
1868
+ /**
1869
+ * Create Phone Verification (confirmation)
1870
+ *
1871
+ * Use this endpoint to complete the user phone verification process. Use the
1872
+ * **userId** and **secret** that were sent to your user's phone number to
1873
+ * verify the user email ownership. If confirmed this route will return a 200
1874
+ * status code.
1875
+ *
1876
+ * @param {string} userId
1877
+ * @param {string} secret
1878
+ * @throws {AppwriteException}
1879
+ * @returns {Promise}
1880
+ */
1881
+ updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
1731
1882
  }
1732
1883
  export class Avatars extends Service {
1884
+ constructor(client: Client);
1885
+
1733
1886
  /**
1734
1887
  * Get Browser Icon
1735
1888
  *
@@ -1871,14 +2024,69 @@ declare module "node-appwrite" {
1871
2024
  */
1872
2025
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
1873
2026
  }
1874
- export class Database extends Service {
2027
+ export class Databases extends Service {
2028
+ constructor(client: Client, databaseId: string);
2029
+
1875
2030
  /**
1876
- * List Collections
2031
+ * Get databaseId.
1877
2032
  *
1878
- * Get a list of all the user collections. You can use the query params to
1879
- * filter your results. On admin mode, this endpoint will return a list of all
1880
- * of the project's collections. [Learn more about different API
1881
- * modes](/docs/admin).
2033
+ * @returns {string}
2034
+ */
2035
+ getDatabaseId(): string;
2036
+
2037
+ /**
2038
+ * Set databaseId.
2039
+ *
2040
+ * @param {string} databaseId
2041
+ * @returns {void}
2042
+ */
2043
+ setDatabaseId(databaseId: string): void;
2044
+
2045
+ /**
2046
+ * List Databases
2047
+ *
2048
+ * @param {string} search
2049
+ * @param {number} limit
2050
+ * @param {number} offset
2051
+ * @param {string} cursor
2052
+ * @param {string} cursorDirection
2053
+ * @param {string} orderType
2054
+ * @throws {AppwriteException}
2055
+ * @returns {Promise}
2056
+ */
2057
+ list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DatabaseList>;
2058
+ /**
2059
+ * Create Database
2060
+ *
2061
+ * @param {string} name
2062
+ * @throws {AppwriteException}
2063
+ * @returns {Promise}
2064
+ */
2065
+ create(name: string): Promise<Models.Database>;
2066
+ /**
2067
+ * Get Database
2068
+ *
2069
+ * @throws {AppwriteException}
2070
+ * @returns {Promise}
2071
+ */
2072
+ get(): Promise<Models.Collection>;
2073
+ /**
2074
+ * Update Database
2075
+ *
2076
+ * @param {string} name
2077
+ * @throws {AppwriteException}
2078
+ * @returns {Promise}
2079
+ */
2080
+ update(name: string): Promise<Models.Collection>;
2081
+ /**
2082
+ * Delete Database
2083
+ *
2084
+ * @throws {AppwriteException}
2085
+ * @returns {Promise}
2086
+ */
2087
+ delete(): Promise<Response>;
2088
+ /**
2089
+ * List Collections
1882
2090
  *
1883
2091
  * @param {string} search
1884
2092
  * @param {number} limit
@@ -1893,8 +2101,6 @@ declare module "node-appwrite" {
1893
2101
  /**
1894
2102
  * Create Collection
1895
2103
  *
1896
- * Create a new Collection.
1897
- *
1898
2104
  * @param {string} collectionId
1899
2105
  * @param {string} name
1900
2106
  * @param {string} permission
@@ -1907,9 +2113,6 @@ declare module "node-appwrite" {
1907
2113
  /**
1908
2114
  * Get Collection
1909
2115
  *
1910
- * Get a collection by its unique ID. This endpoint response returns a JSON
1911
- * object with the collection metadata.
1912
- *
1913
2116
  * @param {string} collectionId
1914
2117
  * @throws {AppwriteException}
1915
2118
  * @returns {Promise}
@@ -1918,8 +2121,6 @@ declare module "node-appwrite" {
1918
2121
  /**
1919
2122
  * Update Collection
1920
2123
  *
1921
- * Update a collection by its unique ID.
1922
- *
1923
2124
  * @param {string} collectionId
1924
2125
  * @param {string} name
1925
2126
  * @param {string} permission
@@ -1933,9 +2134,6 @@ declare module "node-appwrite" {
1933
2134
  /**
1934
2135
  * Delete Collection
1935
2136
  *
1936
- * Delete a collection by its unique ID. Only users with write permissions
1937
- * have access to delete this resource.
1938
- *
1939
2137
  * @param {string} collectionId
1940
2138
  * @throws {AppwriteException}
1941
2139
  * @returns {Promise}
@@ -1952,9 +2150,6 @@ declare module "node-appwrite" {
1952
2150
  /**
1953
2151
  * Create Boolean Attribute
1954
2152
  *
1955
- * Create a boolean attribute.
1956
- *
1957
- *
1958
2153
  * @param {string} collectionId
1959
2154
  * @param {string} key
1960
2155
  * @param {boolean} required
@@ -1967,9 +2162,6 @@ declare module "node-appwrite" {
1967
2162
  /**
1968
2163
  * Create Email Attribute
1969
2164
  *
1970
- * Create an email attribute.
1971
- *
1972
- *
1973
2165
  * @param {string} collectionId
1974
2166
  * @param {string} key
1975
2167
  * @param {boolean} required
@@ -1995,10 +2187,6 @@ declare module "node-appwrite" {
1995
2187
  /**
1996
2188
  * Create Float Attribute
1997
2189
  *
1998
- * Create a float attribute. Optionally, minimum and maximum values can be
1999
- * provided.
2000
- *
2001
- *
2002
2190
  * @param {string} collectionId
2003
2191
  * @param {string} key
2004
2192
  * @param {boolean} required
@@ -2013,10 +2201,6 @@ declare module "node-appwrite" {
2013
2201
  /**
2014
2202
  * Create Integer Attribute
2015
2203
  *
2016
- * Create an integer attribute. Optionally, minimum and maximum values can be
2017
- * provided.
2018
- *
2019
- *
2020
2204
  * @param {string} collectionId
2021
2205
  * @param {string} key
2022
2206
  * @param {boolean} required
@@ -2031,9 +2215,6 @@ declare module "node-appwrite" {
2031
2215
  /**
2032
2216
  * Create IP Address Attribute
2033
2217
  *
2034
- * Create IP address attribute.
2035
- *
2036
- *
2037
2218
  * @param {string} collectionId
2038
2219
  * @param {string} key
2039
2220
  * @param {boolean} required
@@ -2046,9 +2227,6 @@ declare module "node-appwrite" {
2046
2227
  /**
2047
2228
  * Create String Attribute
2048
2229
  *
2049
- * Create a string attribute.
2050
- *
2051
- *
2052
2230
  * @param {string} collectionId
2053
2231
  * @param {string} key
2054
2232
  * @param {number} size
@@ -2062,9 +2240,6 @@ declare module "node-appwrite" {
2062
2240
  /**
2063
2241
  * Create URL Attribute
2064
2242
  *
2065
- * Create a URL attribute.
2066
- *
2067
- *
2068
2243
  * @param {string} collectionId
2069
2244
  * @param {string} key
2070
2245
  * @param {boolean} required
@@ -2095,11 +2270,6 @@ declare module "node-appwrite" {
2095
2270
  /**
2096
2271
  * List Documents
2097
2272
  *
2098
- * Get a list of all the user documents. You can use the query params to
2099
- * filter your results. On admin mode, this endpoint will return a list of all
2100
- * of the project's documents. [Learn more about different API
2101
- * modes](/docs/admin).
2102
- *
2103
2273
  * @param {string} collectionId
2104
2274
  * @param {string[]} queries
2105
2275
  * @param {number} limit
@@ -2115,11 +2285,6 @@ declare module "node-appwrite" {
2115
2285
  /**
2116
2286
  * Create Document
2117
2287
  *
2118
- * Create a new Document. Before using this route, you should create a new
2119
- * collection resource using either a [server
2120
- * integration](/docs/server/database#databaseCreateCollection) API or
2121
- * directly from your database console.
2122
- *
2123
2288
  * @param {string} collectionId
2124
2289
  * @param {string} documentId
2125
2290
  * @param {object} data
@@ -2132,9 +2297,6 @@ declare module "node-appwrite" {
2132
2297
  /**
2133
2298
  * Get Document
2134
2299
  *
2135
- * Get a document by its unique ID. This endpoint response returns a JSON
2136
- * object with the document data.
2137
- *
2138
2300
  * @param {string} collectionId
2139
2301
  * @param {string} documentId
2140
2302
  * @throws {AppwriteException}
@@ -2144,9 +2306,6 @@ declare module "node-appwrite" {
2144
2306
  /**
2145
2307
  * Update Document
2146
2308
  *
2147
- * Update a document by its unique ID. Using the patch method you can pass
2148
- * only specific fields that will get updated.
2149
- *
2150
2309
  * @param {string} collectionId
2151
2310
  * @param {string} documentId
2152
2311
  * @param {object} data
@@ -2155,12 +2314,10 @@ declare module "node-appwrite" {
2155
2314
  * @throws {AppwriteException}
2156
2315
  * @returns {Promise}
2157
2316
  */
2158
- updateDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
2317
+ updateDocument<Document extends Models.Document>(collectionId: string, documentId: string, data?: object, read?: string[], write?: string[]): Promise<Document>;
2159
2318
  /**
2160
2319
  * Delete Document
2161
2320
  *
2162
- * Delete a document by its unique ID.
2163
- *
2164
2321
  * @param {string} collectionId
2165
2322
  * @param {string} documentId
2166
2323
  * @throws {AppwriteException}
@@ -2207,6 +2364,8 @@ declare module "node-appwrite" {
2207
2364
  deleteIndex(collectionId: string, key: string): Promise<Response>;
2208
2365
  }
2209
2366
  export class Functions extends Service {
2367
+ constructor(client: Client);
2368
+
2210
2369
  /**
2211
2370
  * List Functions
2212
2371
  *
@@ -2320,12 +2479,12 @@ declare module "node-appwrite" {
2320
2479
  *
2321
2480
  * @param {string} functionId
2322
2481
  * @param {string} entrypoint
2323
- * @param {string} code
2482
+ * @param {InputFile} code
2324
2483
  * @param {boolean} activate
2325
2484
  * @throws {AppwriteException}
2326
2485
  * @returns {Promise}
2327
2486
  */
2328
- createDeployment(functionId: string, entrypoint: string, code: string, activate: boolean): Promise<Models.Deployment>;
2487
+ createDeployment(functionId: string, entrypoint: string, code: InputFile, activate: boolean): Promise<Models.Deployment>;
2329
2488
  /**
2330
2489
  * Get Deployment
2331
2490
  *
@@ -2417,6 +2576,8 @@ declare module "node-appwrite" {
2417
2576
  getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
2418
2577
  }
2419
2578
  export class Health extends Service {
2579
+ constructor(client: Client);
2580
+
2420
2581
  /**
2421
2582
  * Get HTTP
2422
2583
  *
@@ -2518,6 +2679,8 @@ declare module "node-appwrite" {
2518
2679
  getTime(): Promise<Models.HealthTime>;
2519
2680
  }
2520
2681
  export class Locale extends Service {
2682
+ constructor(client: Client);
2683
+
2521
2684
  /**
2522
2685
  * Get User Locale
2523
2686
  *
@@ -2595,6 +2758,8 @@ declare module "node-appwrite" {
2595
2758
  getLanguages(): Promise<Models.LanguageList>;
2596
2759
  }
2597
2760
  export class Storage extends Service {
2761
+ constructor(client: Client);
2762
+
2598
2763
  /**
2599
2764
  * List buckets
2600
2765
  *
@@ -2712,13 +2877,13 @@ declare module "node-appwrite" {
2712
2877
  *
2713
2878
  * @param {string} bucketId
2714
2879
  * @param {string} fileId
2715
- * @param {string} file
2880
+ * @param {InputFile} file
2716
2881
  * @param {string[]} read
2717
2882
  * @param {string[]} write
2718
2883
  * @throws {AppwriteException}
2719
2884
  * @returns {Promise}
2720
2885
  */
2721
- createFile(bucketId: string, fileId: string, file: string, read?: string[], write?: string[]): Promise<Models.File>;
2886
+ createFile(bucketId: string, fileId: string, file: InputFile, read?: string[], write?: string[]): Promise<Models.File>;
2722
2887
  /**
2723
2888
  * Get File
2724
2889
  *
@@ -2811,6 +2976,8 @@ declare module "node-appwrite" {
2811
2976
  getFileView(bucketId: string, fileId: string): Promise<Buffer>;
2812
2977
  }
2813
2978
  export class Teams extends Service {
2979
+ constructor(client: Client);
2980
+
2814
2981
  /**
2815
2982
  * List Teams
2816
2983
  *
@@ -2982,6 +3149,8 @@ declare module "node-appwrite" {
2982
3149
  updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
2983
3150
  }
2984
3151
  export class Users extends Service {
3152
+ constructor(client: Client);
3153
+
2985
3154
  /**
2986
3155
  * List Users
2987
3156
  *
@@ -3090,6 +3259,17 @@ declare module "node-appwrite" {
3090
3259
  * @returns {Promise}
3091
3260
  */
3092
3261
  updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
3262
+ /**
3263
+ * Update Phone
3264
+ *
3265
+ * Update the user phone by its unique ID.
3266
+ *
3267
+ * @param {string} userId
3268
+ * @param {string} number
3269
+ * @throws {AppwriteException}
3270
+ * @returns {Promise}
3271
+ */
3272
+ updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
3093
3273
  /**
3094
3274
  * Get User Preferences
3095
3275
  *
@@ -3166,6 +3346,17 @@ declare module "node-appwrite" {
3166
3346
  * @throws {AppwriteException}
3167
3347
  * @returns {Promise}
3168
3348
  */
3169
- updateVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
3349
+ updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
3350
+ /**
3351
+ * Update Phone Verification
3352
+ *
3353
+ * Update the user phone verification status by its unique ID.
3354
+ *
3355
+ * @param {string} userId
3356
+ * @param {boolean} phoneVerification
3357
+ * @throws {AppwriteException}
3358
+ * @returns {Promise}
3359
+ */
3360
+ updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
3170
3361
  }
3171
3362
  }