node-appwrite 7.0.3 → 8.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 (82) hide show
  1. package/.travis.yml +12 -3
  2. package/LICENSE +1 -1
  3. package/README.md +5 -5
  4. package/docs/examples/account/list-logs.md +20 -0
  5. package/docs/examples/account/list-sessions.md +20 -0
  6. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  7. package/docs/examples/databases/create-collection.md +2 -2
  8. package/docs/examples/databases/create-datetime-attribute.md +20 -0
  9. package/docs/examples/databases/create-document.md +2 -2
  10. package/docs/examples/databases/create-email-attribute.md +2 -2
  11. package/docs/examples/databases/create-enum-attribute.md +2 -2
  12. package/docs/examples/databases/create-float-attribute.md +2 -2
  13. package/docs/examples/databases/create-index.md +2 -2
  14. package/docs/examples/databases/create-integer-attribute.md +2 -2
  15. package/docs/examples/databases/create-ip-attribute.md +2 -2
  16. package/docs/examples/databases/create-string-attribute.md +2 -2
  17. package/docs/examples/databases/create-url-attribute.md +2 -2
  18. package/docs/examples/databases/create.md +2 -2
  19. package/docs/examples/databases/delete-attribute.md +2 -2
  20. package/docs/examples/databases/delete-collection.md +2 -2
  21. package/docs/examples/databases/delete-document.md +2 -2
  22. package/docs/examples/databases/delete-index.md +2 -2
  23. package/docs/examples/databases/delete.md +2 -2
  24. package/docs/examples/databases/get-attribute.md +2 -2
  25. package/docs/examples/databases/get-collection.md +2 -2
  26. package/docs/examples/databases/get-document.md +2 -2
  27. package/docs/examples/databases/get-index.md +2 -2
  28. package/docs/examples/databases/get.md +2 -2
  29. package/docs/examples/databases/list-attributes.md +2 -2
  30. package/docs/examples/databases/list-collections.md +2 -2
  31. package/docs/examples/databases/list-documents.md +2 -2
  32. package/docs/examples/databases/list-indexes.md +2 -2
  33. package/docs/examples/databases/list.md +1 -1
  34. package/docs/examples/databases/update-collection.md +2 -2
  35. package/docs/examples/databases/update-document.md +2 -2
  36. package/docs/examples/databases/update.md +2 -2
  37. package/docs/examples/functions/create-deployment.md +1 -1
  38. package/docs/examples/functions/create-variable.md +20 -0
  39. package/docs/examples/functions/create.md +1 -1
  40. package/docs/examples/functions/delete-variable.md +20 -0
  41. package/docs/examples/functions/get-variable.md +20 -0
  42. package/docs/examples/functions/list-variables.md +20 -0
  43. package/docs/examples/functions/update-variable.md +20 -0
  44. package/docs/examples/functions/update.md +1 -1
  45. package/docs/examples/locale/list-continents.md +20 -0
  46. package/docs/examples/locale/list-countries-e-u.md +20 -0
  47. package/docs/examples/locale/list-countries-phones.md +20 -0
  48. package/docs/examples/locale/list-countries.md +20 -0
  49. package/docs/examples/locale/list-currencies.md +20 -0
  50. package/docs/examples/locale/list-languages.md +20 -0
  51. package/docs/examples/storage/create-bucket.md +1 -1
  52. package/docs/examples/storage/create-file.md +1 -1
  53. package/docs/examples/storage/update-bucket.md +1 -1
  54. package/docs/examples/teams/list-memberships.md +20 -0
  55. package/docs/examples/users/create-argon2user.md +20 -0
  56. package/docs/examples/users/create-bcrypt-user.md +20 -0
  57. package/docs/examples/users/create-m-d5user.md +20 -0
  58. package/docs/examples/users/create-p-h-pass-user.md +20 -0
  59. package/docs/examples/users/create-s-h-a-user.md +20 -0
  60. package/docs/examples/users/create-scrypt-modified-user.md +20 -0
  61. package/docs/examples/users/create-scrypt-user.md +20 -0
  62. package/docs/examples/users/create.md +1 -1
  63. package/docs/examples/users/list-logs.md +20 -0
  64. package/docs/examples/users/list-memberships.md +20 -0
  65. package/docs/examples/users/list-sessions.md +20 -0
  66. package/index.d.ts +736 -280
  67. package/index.js +6 -0
  68. package/lib/client.js +5 -2
  69. package/lib/id.js +12 -0
  70. package/lib/permission.js +24 -0
  71. package/lib/query.js +30 -12
  72. package/lib/role.js +34 -0
  73. package/lib/services/account.js +46 -45
  74. package/lib/services/avatars.js +22 -20
  75. package/lib/services/databases.js +385 -243
  76. package/lib/services/functions.js +219 -109
  77. package/lib/services/health.js +7 -1
  78. package/lib/services/locale.js +13 -7
  79. package/lib/services/storage.js +78 -129
  80. package/lib/services/teams.js +40 -74
  81. package/lib/services/users.js +487 -68
  82. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -261,6 +261,19 @@ declare module "node-appwrite" {
261
261
  phones: Phone[];
262
262
  }
263
263
  /**
264
+ * Variables List
265
+ */
266
+ export type VariableList = {
267
+ /**
268
+ * Total number of variables documents that matched your query.
269
+ */
270
+ total: number;
271
+ /**
272
+ * List of variables.
273
+ */
274
+ variables: Variable[];
275
+ }
276
+ /**
264
277
  * Database
265
278
  */
266
279
  export type Database = {
@@ -272,6 +285,14 @@ declare module "node-appwrite" {
272
285
  * Database name.
273
286
  */
274
287
  name: string;
288
+ /**
289
+ * Database creation date in ISO 8601 format.
290
+ */
291
+ $createdAt: string;
292
+ /**
293
+ * Database update date in ISO 8601 format.
294
+ */
295
+ $updatedAt: string;
275
296
  }
276
297
  /**
277
298
  * Collection
@@ -282,21 +303,17 @@ declare module "node-appwrite" {
282
303
  */
283
304
  $id: string;
284
305
  /**
285
- * Collection creation date in Unix timestamp.
306
+ * Collection creation date in ISO 8601 format.
286
307
  */
287
- $createdAt: number;
308
+ $createdAt: string;
288
309
  /**
289
- * Collection update date in Unix timestamp.
310
+ * Collection update date in ISO 8601 format.
290
311
  */
291
- $updatedAt: number;
312
+ $updatedAt: string;
292
313
  /**
293
- * Collection read permissions.
314
+ * Collection permissions. [Learn more about permissions](/docs/permissions).
294
315
  */
295
- $read: string[];
296
- /**
297
- * Collection write permissions.
298
- */
299
- $write: string[];
316
+ $permissions: string[];
300
317
  /**
301
318
  * Database ID.
302
319
  */
@@ -310,9 +327,9 @@ declare module "node-appwrite" {
310
327
  */
311
328
  enabled: boolean;
312
329
  /**
313
- * Collection permission model. Possible values: `document` or `collection`
330
+ * Whether document-level permissions are enabled. [Learn more about permissions](/docs/permissions).
314
331
  */
315
- permission: string;
332
+ documentSecurity: boolean;
316
333
  /**
317
334
  * Collection attributes.
318
335
  */
@@ -608,6 +625,39 @@ declare module "node-appwrite" {
608
625
  xdefault?: string;
609
626
  }
610
627
  /**
628
+ * AttributeDatetime
629
+ */
630
+ export type AttributeDatetime = {
631
+ /**
632
+ * Attribute Key.
633
+ */
634
+ key: string;
635
+ /**
636
+ * Attribute type.
637
+ */
638
+ type: string;
639
+ /**
640
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
641
+ */
642
+ status: string;
643
+ /**
644
+ * Is attribute required?
645
+ */
646
+ required: boolean;
647
+ /**
648
+ * Is attribute an array?
649
+ */
650
+ array?: boolean;
651
+ /**
652
+ * ISO 8601 format.
653
+ */
654
+ format: string;
655
+ /**
656
+ * Default value for attribute when not provided. Only null is optional
657
+ */
658
+ xdefault?: string;
659
+ }
660
+ /**
611
661
  * Index
612
662
  */
613
663
  export type Index = {
@@ -630,7 +680,7 @@ declare module "node-appwrite" {
630
680
  /**
631
681
  * Index orders.
632
682
  */
633
- orders: string[];
683
+ orders?: string[];
634
684
  }
635
685
  /**
636
686
  * Document
@@ -643,23 +693,23 @@ declare module "node-appwrite" {
643
693
  /**
644
694
  * Collection ID.
645
695
  */
646
- $collection: string;
696
+ $collectionId: string;
647
697
  /**
648
- * Document creation date in Unix timestamp.
698
+ * Database ID.
649
699
  */
650
- $createdAt: number;
700
+ $databaseId: string;
651
701
  /**
652
- * Document update date in Unix timestamp.
702
+ * Document creation date in ISO 8601 format.
653
703
  */
654
- $updatedAt: number;
704
+ $createdAt: string;
655
705
  /**
656
- * Document read permissions.
706
+ * Document update date in ISO 8601 format.
657
707
  */
658
- $read: string[];
708
+ $updatedAt: string;
659
709
  /**
660
- * Document write permissions.
710
+ * Document permissions. [Learn more about permissions](/docs/permissions).
661
711
  */
662
- $write: string[];
712
+ $permissions: string[];
663
713
  }
664
714
  /**
665
715
  * Log
@@ -690,9 +740,9 @@ declare module "node-appwrite" {
690
740
  */
691
741
  ip: string;
692
742
  /**
693
- * Log creation time in Unix timestamp.
743
+ * Log creation date in ISO 8601 format.
694
744
  */
695
- time: number;
745
+ time: string;
696
746
  /**
697
747
  * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
698
748
  */
@@ -759,29 +809,169 @@ declare module "node-appwrite" {
759
809
  */
760
810
  $id: string;
761
811
  /**
762
- * User creation date in Unix timestamp.
812
+ * User creation date in ISO 8601 format.
763
813
  */
764
- $createdAt: number;
814
+ $createdAt: string;
765
815
  /**
766
- * User update date in Unix timestamp.
816
+ * User update date in ISO 8601 format.
767
817
  */
768
- $updatedAt: number;
818
+ $updatedAt: string;
769
819
  /**
770
820
  * User name.
771
821
  */
772
822
  name: string;
773
823
  /**
774
- * User registration date in Unix timestamp.
824
+ * Hashed user password.
825
+ */
826
+ password: string;
827
+ /**
828
+ * Password hashing algorithm.
829
+ */
830
+ hash: string;
831
+ /**
832
+ * Password hashing algorithm configuration.
833
+ */
834
+ hashOptions: object;
835
+ /**
836
+ * User registration date in ISO 8601 format.
775
837
  */
776
- registration: number;
838
+ registration: string;
777
839
  /**
778
840
  * User status. Pass `true` for enabled and `false` for disabled.
779
841
  */
780
842
  status: boolean;
781
843
  /**
782
- * Unix timestamp of the most recent password update
844
+ * Password update time in ISO 8601 format.
783
845
  */
784
- passwordUpdate: number;
846
+ passwordUpdate: string;
847
+ /**
848
+ * User email address.
849
+ */
850
+ email: string;
851
+ /**
852
+ * User phone number in E.164 format.
853
+ */
854
+ phone: string;
855
+ /**
856
+ * Email verification status.
857
+ */
858
+ emailVerification: boolean;
859
+ /**
860
+ * Phone verification status.
861
+ */
862
+ phoneVerification: boolean;
863
+ /**
864
+ * User preferences as a key-value object
865
+ */
866
+ prefs: Preferences;
867
+ }
868
+ /**
869
+ * AlgoMD5
870
+ */
871
+ export type AlgoMd5 = {
872
+ }
873
+ /**
874
+ * AlgoSHA
875
+ */
876
+ export type AlgoSha = {
877
+ }
878
+ /**
879
+ * AlgoPHPass
880
+ */
881
+ export type AlgoPhpass = {
882
+ }
883
+ /**
884
+ * AlgoBcrypt
885
+ */
886
+ export type AlgoBcrypt = {
887
+ }
888
+ /**
889
+ * AlgoScrypt
890
+ */
891
+ export type AlgoScrypt = {
892
+ /**
893
+ * CPU complexity of computed hash.
894
+ */
895
+ costCpu: number;
896
+ /**
897
+ * Memory complexity of computed hash.
898
+ */
899
+ costMemory: number;
900
+ /**
901
+ * Parallelization of computed hash.
902
+ */
903
+ costParallel: number;
904
+ /**
905
+ * Length used to compute hash.
906
+ */
907
+ length: number;
908
+ }
909
+ /**
910
+ * AlgoScryptModified
911
+ */
912
+ export type AlgoScryptModified = {
913
+ /**
914
+ * Salt used to compute hash.
915
+ */
916
+ salt: string;
917
+ /**
918
+ * Separator used to compute hash.
919
+ */
920
+ saltSeparator: string;
921
+ /**
922
+ * Key used to compute hash.
923
+ */
924
+ signerKey: string;
925
+ }
926
+ /**
927
+ * AlgoArgon2
928
+ */
929
+ export type AlgoArgon2 = {
930
+ /**
931
+ * Memory used to compute hash.
932
+ */
933
+ memoryCost: number;
934
+ /**
935
+ * Amount of time consumed to compute hash
936
+ */
937
+ timeCost: number;
938
+ /**
939
+ * Number of threads used to compute hash.
940
+ */
941
+ threads: number;
942
+ }
943
+ /**
944
+ * Account
945
+ */
946
+ export type Account<Preferences extends Models.Preferences> = {
947
+ /**
948
+ * User ID.
949
+ */
950
+ $id: string;
951
+ /**
952
+ * User creation date in ISO 8601 format.
953
+ */
954
+ $createdAt: string;
955
+ /**
956
+ * User update date in ISO 8601 format.
957
+ */
958
+ $updatedAt: string;
959
+ /**
960
+ * User name.
961
+ */
962
+ name: string;
963
+ /**
964
+ * User registration date in ISO 8601 format.
965
+ */
966
+ registration: string;
967
+ /**
968
+ * User status. Pass `true` for enabled and `false` for disabled.
969
+ */
970
+ status: boolean;
971
+ /**
972
+ * Password update time in ISO 8601 format.
973
+ */
974
+ passwordUpdate: string;
785
975
  /**
786
976
  * User email address.
787
977
  */
@@ -817,17 +1007,17 @@ declare module "node-appwrite" {
817
1007
  */
818
1008
  $id: string;
819
1009
  /**
820
- * Session creation date in Unix timestamp.
1010
+ * Session creation date in ISO 8601 format.
821
1011
  */
822
- $createdAt: number;
1012
+ $createdAt: string;
823
1013
  /**
824
1014
  * User ID.
825
1015
  */
826
1016
  userId: string;
827
1017
  /**
828
- * Session expiration date in Unix timestamp.
1018
+ * Session expiration date in ISO 8601 format.
829
1019
  */
830
- expire: number;
1020
+ expire: string;
831
1021
  /**
832
1022
  * Session Provider.
833
1023
  */
@@ -841,9 +1031,9 @@ declare module "node-appwrite" {
841
1031
  */
842
1032
  providerAccessToken: string;
843
1033
  /**
844
- * Date, the Unix timestamp of when the access token expires.
1034
+ * The date of when the access token expires in ISO 8601 format.
845
1035
  */
846
- providerAccessTokenExpiry: number;
1036
+ providerAccessTokenExpiry: string;
847
1037
  /**
848
1038
  * Session Provider Refresh Token.
849
1039
  */
@@ -922,9 +1112,9 @@ declare module "node-appwrite" {
922
1112
  */
923
1113
  $id: string;
924
1114
  /**
925
- * Token creation date in Unix timestamp.
1115
+ * Token creation date in ISO 8601 format.
926
1116
  */
927
- $createdAt: number;
1117
+ $createdAt: string;
928
1118
  /**
929
1119
  * User ID.
930
1120
  */
@@ -934,9 +1124,9 @@ declare module "node-appwrite" {
934
1124
  */
935
1125
  secret: string;
936
1126
  /**
937
- * Token expiration date in Unix timestamp.
1127
+ * Token expiration date in ISO 8601 format.
938
1128
  */
939
- expire: number;
1129
+ expire: string;
940
1130
  }
941
1131
  /**
942
1132
  * Locale
@@ -984,21 +1174,17 @@ declare module "node-appwrite" {
984
1174
  */
985
1175
  bucketId: string;
986
1176
  /**
987
- * File creation date in Unix timestamp.
988
- */
989
- $createdAt: number;
990
- /**
991
- * File update date in Unix timestamp.
1177
+ * File creation date in ISO 8601 format.
992
1178
  */
993
- $updatedAt: number;
1179
+ $createdAt: string;
994
1180
  /**
995
- * File read permissions.
1181
+ * File update date in ISO 8601 format.
996
1182
  */
997
- $read: string[];
1183
+ $updatedAt: string;
998
1184
  /**
999
- * File write permissions.
1185
+ * File permissions. [Learn more about permissions](/docs/permissions).
1000
1186
  */
1001
- $write: string[];
1187
+ $permissions: string[];
1002
1188
  /**
1003
1189
  * File name.
1004
1190
  */
@@ -1033,25 +1219,21 @@ declare module "node-appwrite" {
1033
1219
  */
1034
1220
  $id: string;
1035
1221
  /**
1036
- * Bucket creation date in Unix timestamp.
1222
+ * Bucket creation time in ISO 8601 format.
1037
1223
  */
1038
- $createdAt: number;
1224
+ $createdAt: string;
1039
1225
  /**
1040
- * Bucket update date in Unix timestamp.
1226
+ * Bucket update date in ISO 8601 format.
1041
1227
  */
1042
- $updatedAt: number;
1228
+ $updatedAt: string;
1043
1229
  /**
1044
- * File read permissions.
1230
+ * Bucket permissions. [Learn more about permissions](/docs/permissions).
1045
1231
  */
1046
- $read: string[];
1232
+ $permissions: string[];
1047
1233
  /**
1048
- * File write permissions.
1234
+ * Whether file-level security is enabled. [Learn more about permissions](/docs/permissions).
1049
1235
  */
1050
- $write: string[];
1051
- /**
1052
- * Bucket permission model. Possible values: `bucket` or `file`
1053
- */
1054
- permission: string;
1236
+ fileSecurity: boolean;
1055
1237
  /**
1056
1238
  * Bucket name.
1057
1239
  */
@@ -1069,6 +1251,10 @@ declare module "node-appwrite" {
1069
1251
  */
1070
1252
  allowedFileExtensions: string[];
1071
1253
  /**
1254
+ * Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
1255
+ */
1256
+ compression: string;
1257
+ /**
1072
1258
  * Bucket is encrypted.
1073
1259
  */
1074
1260
  encryption: boolean;
@@ -1086,13 +1272,13 @@ declare module "node-appwrite" {
1086
1272
  */
1087
1273
  $id: string;
1088
1274
  /**
1089
- * Team creation date in Unix timestamp.
1275
+ * Team creation date in ISO 8601 format.
1090
1276
  */
1091
- $createdAt: number;
1277
+ $createdAt: string;
1092
1278
  /**
1093
- * Team update date in Unix timestamp.
1279
+ * Team update date in ISO 8601 format.
1094
1280
  */
1095
- $updatedAt: number;
1281
+ $updatedAt: string;
1096
1282
  /**
1097
1283
  * Team name.
1098
1284
  */
@@ -1111,13 +1297,13 @@ declare module "node-appwrite" {
1111
1297
  */
1112
1298
  $id: string;
1113
1299
  /**
1114
- * Membership creation date in Unix timestamp.
1300
+ * Membership creation date in ISO 8601 format.
1115
1301
  */
1116
- $createdAt: number;
1302
+ $createdAt: string;
1117
1303
  /**
1118
- * Membership update date in Unix timestamp.
1304
+ * Membership update date in ISO 8601 format.
1119
1305
  */
1120
- $updatedAt: number;
1306
+ $updatedAt: string;
1121
1307
  /**
1122
1308
  * User ID.
1123
1309
  */
@@ -1139,13 +1325,13 @@ declare module "node-appwrite" {
1139
1325
  */
1140
1326
  teamName: string;
1141
1327
  /**
1142
- * Date, the user has been invited to join the team in Unix timestamp.
1328
+ * Date, the user has been invited to join the team in ISO 8601 format.
1143
1329
  */
1144
- invited: number;
1330
+ invited: string;
1145
1331
  /**
1146
- * Date, the user has accepted the invitation to join the team in Unix timestamp.
1332
+ * Date, the user has accepted the invitation to join the team in ISO 8601 format.
1147
1333
  */
1148
- joined: number;
1334
+ joined: string;
1149
1335
  /**
1150
1336
  * User confirmation status, true if the user has joined the team or false otherwise.
1151
1337
  */
@@ -1164,13 +1350,13 @@ declare module "node-appwrite" {
1164
1350
  */
1165
1351
  $id: string;
1166
1352
  /**
1167
- * Function creation date in Unix timestamp.
1353
+ * Function creation date in ISO 8601 format.
1168
1354
  */
1169
- $createdAt: number;
1355
+ $createdAt: string;
1170
1356
  /**
1171
- * Function update date in Unix timestamp.
1357
+ * Function update date in ISO 8601 format.
1172
1358
  */
1173
- $updatedAt: number;
1359
+ $updatedAt: string;
1174
1360
  /**
1175
1361
  * Execution permissions.
1176
1362
  */
@@ -1180,9 +1366,9 @@ declare module "node-appwrite" {
1180
1366
  */
1181
1367
  name: string;
1182
1368
  /**
1183
- * Function status. Possible values: `disabled`, `enabled`
1369
+ * Function enabled.
1184
1370
  */
1185
- status: string;
1371
+ enabled: boolean;
1186
1372
  /**
1187
1373
  * Function execution runtime.
1188
1374
  */
@@ -1192,9 +1378,9 @@ declare module "node-appwrite" {
1192
1378
  */
1193
1379
  deployment: string;
1194
1380
  /**
1195
- * Function environment variables.
1381
+ * Function variables.
1196
1382
  */
1197
- vars: object;
1383
+ vars: Variable[];
1198
1384
  /**
1199
1385
  * Function trigger events.
1200
1386
  */
@@ -1204,13 +1390,13 @@ declare module "node-appwrite" {
1204
1390
  */
1205
1391
  schedule: string;
1206
1392
  /**
1207
- * Function next scheduled execution date in Unix timestamp.
1393
+ * Function&#039;s next scheduled execution time in ISO 8601 format.
1208
1394
  */
1209
- scheduleNext: number;
1395
+ scheduleNext: string;
1210
1396
  /**
1211
- * Function next scheduled execution date in Unix timestamp.
1397
+ * Function&#039;s previous scheduled execution time in ISO 8601 format.
1212
1398
  */
1213
- schedulePrevious: number;
1399
+ schedulePrevious: string;
1214
1400
  /**
1215
1401
  * Function execution timeout in seconds.
1216
1402
  */
@@ -1258,13 +1444,13 @@ declare module "node-appwrite" {
1258
1444
  */
1259
1445
  $id: string;
1260
1446
  /**
1261
- * Deployment creation date in Unix timestamp.
1447
+ * Deployment creation date in ISO 8601 format.
1262
1448
  */
1263
- $createdAt: number;
1449
+ $createdAt: string;
1264
1450
  /**
1265
- * Deployment update date in Unix timestamp.
1451
+ * Deployment update date in ISO 8601 format.
1266
1452
  */
1267
- $updatedAt: number;
1453
+ $updatedAt: string;
1268
1454
  /**
1269
1455
  * Resource ID.
1270
1456
  */
@@ -1290,7 +1476,7 @@ declare module "node-appwrite" {
1290
1476
  */
1291
1477
  activate: boolean;
1292
1478
  /**
1293
- * The deployment status.
1479
+ * The deployment status. Possible values are &quot;processing&quot;, &quot;building&quot;, &quot;pending&quot;, &quot;ready&quot;, and &quot;failed&quot;.
1294
1480
  */
1295
1481
  status: string;
1296
1482
  /**
@@ -1311,17 +1497,17 @@ declare module "node-appwrite" {
1311
1497
  */
1312
1498
  $id: string;
1313
1499
  /**
1314
- * Execution creation date in Unix timestamp.
1500
+ * Execution creation date in ISO 8601 format.
1315
1501
  */
1316
- $createdAt: number;
1502
+ $createdAt: string;
1317
1503
  /**
1318
- * Execution update date in Unix timestamp.
1504
+ * Execution upate date in ISO 8601 format.
1319
1505
  */
1320
- $updatedAt: number;
1506
+ $updatedAt: string;
1321
1507
  /**
1322
- * Execution read permissions.
1508
+ * Execution roles.
1323
1509
  */
1324
- $read: string[];
1510
+ $permissions: string[];
1325
1511
  /**
1326
1512
  * Function ID.
1327
1513
  */
@@ -1343,13 +1529,46 @@ declare module "node-appwrite" {
1343
1529
  */
1344
1530
  response: string;
1345
1531
  /**
1346
- * The script stderr output string. Logs the last 4,000 characters of the execution stderr output
1532
+ * 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.
1533
+ */
1534
+ stdout: string;
1535
+ /**
1536
+ * 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.
1347
1537
  */
1348
1538
  stderr: string;
1349
1539
  /**
1350
- * The script execution time in seconds.
1540
+ * The script execution duration in seconds.
1351
1541
  */
1352
- time: number;
1542
+ duration: number;
1543
+ }
1544
+ /**
1545
+ * Variable
1546
+ */
1547
+ export type Variable = {
1548
+ /**
1549
+ * Variable ID.
1550
+ */
1551
+ $id: string;
1552
+ /**
1553
+ * Variable creation date in ISO 8601 format.
1554
+ */
1555
+ $createdAt: string;
1556
+ /**
1557
+ * Variable creation date in ISO 8601 format.
1558
+ */
1559
+ $updatedAt: string;
1560
+ /**
1561
+ * Variable key.
1562
+ */
1563
+ key: string;
1564
+ /**
1565
+ * Variable value.
1566
+ */
1567
+ value: string;
1568
+ /**
1569
+ * Function ID.
1570
+ */
1571
+ functionId: string;
1353
1572
  }
1354
1573
  /**
1355
1574
  * Country
@@ -1591,17 +1810,29 @@ declare module "node-appwrite" {
1591
1810
 
1592
1811
  static notEqual(attribute: string, value: QueryTypes): string;
1593
1812
 
1594
- static lesser(attribute: string, value: QueryTypes): string;
1813
+ static lessThan(attribute: string, value: QueryTypes): string;
1595
1814
 
1596
- static lesserEqual(attribute: string, value: QueryTypes): string;
1815
+ static lessThanEqual(attribute: string, value: QueryTypes): string;
1597
1816
 
1598
- static greater(attribute: string, value: QueryTypes): string;
1817
+ static greaterThan(attribute: string, value: QueryTypes): string;
1599
1818
 
1600
- static greaterEqual(attribute: string, value: QueryTypes): string;
1819
+ static greaterThanEqual(attribute: string, value: QueryTypes): string;
1601
1820
 
1602
1821
  static search(attribute: string, value: string): string;
1603
1822
 
1604
- private static addQuery(attribute: string, oper: string, value: QueryTypes): string;
1823
+ static orderDesc(attribute: string): string;
1824
+
1825
+ static orderAsc(attribute: string): string;
1826
+
1827
+ static cursorAfter(documentId: string): string;
1828
+
1829
+ static cursorBefore(documentId: string): string;
1830
+
1831
+ static limit(value: number): string;
1832
+
1833
+ static offset = (value: number): string;
1834
+
1835
+ private static addQuery(attribute: string, method: string, value: QueryTypes): string;
1605
1836
 
1606
1837
  private static parseValues(value: QueryTypes): string;
1607
1838
  }
@@ -1617,7 +1848,7 @@ declare module "node-appwrite" {
1617
1848
  * @throws {AppwriteException}
1618
1849
  * @returns {Promise}
1619
1850
  */
1620
- get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
1851
+ get<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
1621
1852
  /**
1622
1853
  * Update Account Email
1623
1854
  *
@@ -1635,19 +1866,18 @@ declare module "node-appwrite" {
1635
1866
  * @throws {AppwriteException}
1636
1867
  * @returns {Promise}
1637
1868
  */
1638
- updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
1869
+ updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.Account<Preferences>>;
1639
1870
  /**
1640
- * Get Account Logs
1871
+ * List Account Logs
1641
1872
  *
1642
1873
  * Get currently logged in user list of latest security activity logs. Each
1643
1874
  * log returns user IP address, location and date and time of log.
1644
1875
  *
1645
- * @param {number} limit
1646
- * @param {number} offset
1876
+ * @param {string[]} queries
1647
1877
  * @throws {AppwriteException}
1648
1878
  * @returns {Promise}
1649
1879
  */
1650
- getLogs(limit?: number, offset?: number): Promise<Models.LogList>;
1880
+ listLogs(queries?: string[]): Promise<Models.LogList>;
1651
1881
  /**
1652
1882
  * Update Account Name
1653
1883
  *
@@ -1657,7 +1887,7 @@ declare module "node-appwrite" {
1657
1887
  * @throws {AppwriteException}
1658
1888
  * @returns {Promise}
1659
1889
  */
1660
- updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
1890
+ updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.Account<Preferences>>;
1661
1891
  /**
1662
1892
  * Update Account Password
1663
1893
  *
@@ -1670,7 +1900,7 @@ declare module "node-appwrite" {
1670
1900
  * @throws {AppwriteException}
1671
1901
  * @returns {Promise}
1672
1902
  */
1673
- updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
1903
+ updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>>;
1674
1904
  /**
1675
1905
  * Update Account Phone
1676
1906
  *
@@ -1680,12 +1910,12 @@ declare module "node-appwrite" {
1680
1910
  * /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)
1681
1911
  * endpoint to send a confirmation SMS.
1682
1912
  *
1683
- * @param {string} number
1913
+ * @param {string} phone
1684
1914
  * @param {string} password
1685
1915
  * @throws {AppwriteException}
1686
1916
  * @returns {Promise}
1687
1917
  */
1688
- updatePhone<Preferences extends Models.Preferences>(number: string, password: string): Promise<Models.User<Preferences>>;
1918
+ updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.Account<Preferences>>;
1689
1919
  /**
1690
1920
  * Get Account Preferences
1691
1921
  *
@@ -1706,7 +1936,7 @@ declare module "node-appwrite" {
1706
1936
  * @throws {AppwriteException}
1707
1937
  * @returns {Promise}
1708
1938
  */
1709
- updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.User<Preferences>>;
1939
+ updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.Account<Preferences>>;
1710
1940
  /**
1711
1941
  * Create Password Recovery
1712
1942
  *
@@ -1747,7 +1977,7 @@ declare module "node-appwrite" {
1747
1977
  */
1748
1978
  updateRecovery(userId: string, secret: string, password: string, passwordAgain: string): Promise<Models.Token>;
1749
1979
  /**
1750
- * Get Account Sessions
1980
+ * List Account Sessions
1751
1981
  *
1752
1982
  * Get currently logged in user list of active sessions across different
1753
1983
  * devices.
@@ -1755,7 +1985,7 @@ declare module "node-appwrite" {
1755
1985
  * @throws {AppwriteException}
1756
1986
  * @returns {Promise}
1757
1987
  */
1758
- getSessions(): Promise<Models.SessionList>;
1988
+ listSessions(): Promise<Models.SessionList>;
1759
1989
  /**
1760
1990
  * Delete All Account Sessions
1761
1991
  *
@@ -1812,7 +2042,7 @@ declare module "node-appwrite" {
1812
2042
  * @throws {AppwriteException}
1813
2043
  * @returns {Promise}
1814
2044
  */
1815
- updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
2045
+ updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>;
1816
2046
  /**
1817
2047
  * Create Email Verification
1818
2048
  *
@@ -1942,7 +2172,8 @@ declare module "node-appwrite" {
1942
2172
  *
1943
2173
  * You can use this endpoint to show different country flags icons to your
1944
2174
  * users. The code argument receives the 2 letter country code. Use width,
1945
- * height and quality arguments to change the output settings.
2175
+ * height and quality arguments to change the output settings. Country codes
2176
+ * follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.
1946
2177
  *
1947
2178
  * When one dimension is specified and the other is 0, the image is scaled
1948
2179
  * with preserved aspect ratio. If both dimensions are 0, the API provides an
@@ -2002,12 +2233,11 @@ declare module "node-appwrite" {
2002
2233
  * @param {string} name
2003
2234
  * @param {number} width
2004
2235
  * @param {number} height
2005
- * @param {string} color
2006
2236
  * @param {string} background
2007
2237
  * @throws {AppwriteException}
2008
2238
  * @returns {Promise}
2009
2239
  */
2010
- getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): Promise<Buffer>;
2240
+ getInitials(name?: string, width?: number, height?: number, background?: string): Promise<Buffer>;
2011
2241
  /**
2012
2242
  * Get QR Code
2013
2243
  *
@@ -2025,131 +2255,150 @@ declare module "node-appwrite" {
2025
2255
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
2026
2256
  }
2027
2257
  export class Databases extends Service {
2028
- constructor(client: Client, databaseId: string);
2258
+ constructor(client: Client);
2029
2259
 
2030
- /**
2031
- * Get databaseId.
2032
- *
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
2260
  /**
2046
2261
  * List Databases
2047
2262
  *
2263
+ * Get a list of all databases from the current Appwrite project. You can use
2264
+ * the search parameter to filter your results.
2265
+ *
2266
+ * @param {string[]} queries
2048
2267
  * @param {string} search
2049
- * @param {number} limit
2050
- * @param {number} offset
2051
- * @param {string} cursor
2052
- * @param {string} cursorDirection
2053
- * @param {string} orderType
2054
2268
  * @throws {AppwriteException}
2055
2269
  * @returns {Promise}
2056
2270
  */
2057
- list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DatabaseList>;
2271
+ list(queries?: string[], search?: string): Promise<Models.DatabaseList>;
2058
2272
  /**
2059
2273
  * Create Database
2060
2274
  *
2275
+ * Create a new Database.
2276
+ *
2277
+ *
2278
+ * @param {string} databaseId
2061
2279
  * @param {string} name
2062
2280
  * @throws {AppwriteException}
2063
2281
  * @returns {Promise}
2064
2282
  */
2065
- create(name: string): Promise<Models.Database>;
2283
+ create(databaseId: string, name: string): Promise<Models.Database>;
2066
2284
  /**
2067
2285
  * Get Database
2068
2286
  *
2287
+ * Get a database by its unique ID. This endpoint response returns a JSON
2288
+ * object with the database metadata.
2289
+ *
2290
+ * @param {string} databaseId
2069
2291
  * @throws {AppwriteException}
2070
2292
  * @returns {Promise}
2071
2293
  */
2072
- get(): Promise<Models.Collection>;
2294
+ get(databaseId: string): Promise<Models.Database>;
2073
2295
  /**
2074
2296
  * Update Database
2075
2297
  *
2298
+ * Update a database by its unique ID.
2299
+ *
2300
+ * @param {string} databaseId
2076
2301
  * @param {string} name
2077
2302
  * @throws {AppwriteException}
2078
2303
  * @returns {Promise}
2079
2304
  */
2080
- update(name: string): Promise<Models.Collection>;
2305
+ update(databaseId: string, name: string): Promise<Models.Database>;
2081
2306
  /**
2082
2307
  * Delete Database
2083
2308
  *
2309
+ * Delete a database by its unique ID. Only API keys with with databases.write
2310
+ * scope can delete a database.
2311
+ *
2312
+ * @param {string} databaseId
2084
2313
  * @throws {AppwriteException}
2085
2314
  * @returns {Promise}
2086
2315
  */
2087
- delete(): Promise<Response>;
2316
+ delete(databaseId: string): Promise<Response>;
2088
2317
  /**
2089
2318
  * List Collections
2090
2319
  *
2320
+ * Get a list of all collections that belong to the provided databaseId. You
2321
+ * can use the search parameter to filter your results.
2322
+ *
2323
+ * @param {string} databaseId
2324
+ * @param {string[]} queries
2091
2325
  * @param {string} search
2092
- * @param {number} limit
2093
- * @param {number} offset
2094
- * @param {string} cursor
2095
- * @param {string} cursorDirection
2096
- * @param {string} orderType
2097
2326
  * @throws {AppwriteException}
2098
2327
  * @returns {Promise}
2099
2328
  */
2100
- listCollections(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList>;
2329
+ listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList>;
2101
2330
  /**
2102
2331
  * Create Collection
2103
2332
  *
2333
+ * Create a new Collection. Before using this route, you should create a new
2334
+ * database resource using either a [server
2335
+ * integration](/docs/server/databases#databasesCreateCollection) API or
2336
+ * directly from your database console.
2337
+ *
2338
+ * @param {string} databaseId
2104
2339
  * @param {string} collectionId
2105
2340
  * @param {string} name
2106
- * @param {string} permission
2107
- * @param {string[]} read
2108
- * @param {string[]} write
2341
+ * @param {string[]} permissions
2342
+ * @param {boolean} documentSecurity
2109
2343
  * @throws {AppwriteException}
2110
2344
  * @returns {Promise}
2111
2345
  */
2112
- createCollection(collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection>;
2346
+ createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean): Promise<Models.Collection>;
2113
2347
  /**
2114
2348
  * Get Collection
2115
2349
  *
2350
+ * Get a collection by its unique ID. This endpoint response returns a JSON
2351
+ * object with the collection metadata.
2352
+ *
2353
+ * @param {string} databaseId
2116
2354
  * @param {string} collectionId
2117
2355
  * @throws {AppwriteException}
2118
2356
  * @returns {Promise}
2119
2357
  */
2120
- getCollection(collectionId: string): Promise<Models.Collection>;
2358
+ getCollection(databaseId: string, collectionId: string): Promise<Models.Collection>;
2121
2359
  /**
2122
2360
  * Update Collection
2123
2361
  *
2362
+ * Update a collection by its unique ID.
2363
+ *
2364
+ * @param {string} databaseId
2124
2365
  * @param {string} collectionId
2125
2366
  * @param {string} name
2126
- * @param {string} permission
2127
- * @param {string[]} read
2128
- * @param {string[]} write
2367
+ * @param {string[]} permissions
2368
+ * @param {boolean} documentSecurity
2129
2369
  * @param {boolean} enabled
2130
2370
  * @throws {AppwriteException}
2131
2371
  * @returns {Promise}
2132
2372
  */
2133
- updateCollection(collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection>;
2373
+ updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
2134
2374
  /**
2135
2375
  * Delete Collection
2136
2376
  *
2377
+ * Delete a collection by its unique ID. Only users with write permissions
2378
+ * have access to delete this resource.
2379
+ *
2380
+ * @param {string} databaseId
2137
2381
  * @param {string} collectionId
2138
2382
  * @throws {AppwriteException}
2139
2383
  * @returns {Promise}
2140
2384
  */
2141
- deleteCollection(collectionId: string): Promise<Response>;
2385
+ deleteCollection(databaseId: string, collectionId: string): Promise<Response>;
2142
2386
  /**
2143
2387
  * List Attributes
2144
2388
  *
2389
+ * @param {string} databaseId
2145
2390
  * @param {string} collectionId
2146
2391
  * @throws {AppwriteException}
2147
2392
  * @returns {Promise}
2148
2393
  */
2149
- listAttributes(collectionId: string): Promise<Models.AttributeList>;
2394
+ listAttributes(databaseId: string, collectionId: string): Promise<Models.AttributeList>;
2150
2395
  /**
2151
2396
  * Create Boolean Attribute
2152
2397
  *
2398
+ * Create a boolean attribute.
2399
+ *
2400
+ *
2401
+ * @param {string} databaseId
2153
2402
  * @param {string} collectionId
2154
2403
  * @param {string} key
2155
2404
  * @param {boolean} required
@@ -2158,10 +2407,27 @@ declare module "node-appwrite" {
2158
2407
  * @throws {AppwriteException}
2159
2408
  * @returns {Promise}
2160
2409
  */
2161
- createBooleanAttribute(collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
2410
+ createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
2411
+ /**
2412
+ * Create DateTime Attribute
2413
+ *
2414
+ * @param {string} databaseId
2415
+ * @param {string} collectionId
2416
+ * @param {string} key
2417
+ * @param {boolean} required
2418
+ * @param {string} default
2419
+ * @param {boolean} array
2420
+ * @throws {AppwriteException}
2421
+ * @returns {Promise}
2422
+ */
2423
+ createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime>;
2162
2424
  /**
2163
2425
  * Create Email Attribute
2164
2426
  *
2427
+ * Create an email attribute.
2428
+ *
2429
+ *
2430
+ * @param {string} databaseId
2165
2431
  * @param {string} collectionId
2166
2432
  * @param {string} key
2167
2433
  * @param {boolean} required
@@ -2170,10 +2436,11 @@ declare module "node-appwrite" {
2170
2436
  * @throws {AppwriteException}
2171
2437
  * @returns {Promise}
2172
2438
  */
2173
- createEmailAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
2439
+ createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
2174
2440
  /**
2175
2441
  * Create Enum Attribute
2176
2442
  *
2443
+ * @param {string} databaseId
2177
2444
  * @param {string} collectionId
2178
2445
  * @param {string} key
2179
2446
  * @param {string[]} elements
@@ -2183,10 +2450,15 @@ declare module "node-appwrite" {
2183
2450
  * @throws {AppwriteException}
2184
2451
  * @returns {Promise}
2185
2452
  */
2186
- createEnumAttribute(collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
2453
+ createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
2187
2454
  /**
2188
2455
  * Create Float Attribute
2189
2456
  *
2457
+ * Create a float attribute. Optionally, minimum and maximum values can be
2458
+ * provided.
2459
+ *
2460
+ *
2461
+ * @param {string} databaseId
2190
2462
  * @param {string} collectionId
2191
2463
  * @param {string} key
2192
2464
  * @param {boolean} required
@@ -2197,10 +2469,15 @@ declare module "node-appwrite" {
2197
2469
  * @throws {AppwriteException}
2198
2470
  * @returns {Promise}
2199
2471
  */
2200
- createFloatAttribute(collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
2472
+ createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
2201
2473
  /**
2202
2474
  * Create Integer Attribute
2203
2475
  *
2476
+ * Create an integer attribute. Optionally, minimum and maximum values can be
2477
+ * provided.
2478
+ *
2479
+ *
2480
+ * @param {string} databaseId
2204
2481
  * @param {string} collectionId
2205
2482
  * @param {string} key
2206
2483
  * @param {boolean} required
@@ -2211,10 +2488,14 @@ declare module "node-appwrite" {
2211
2488
  * @throws {AppwriteException}
2212
2489
  * @returns {Promise}
2213
2490
  */
2214
- createIntegerAttribute(collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
2491
+ createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
2215
2492
  /**
2216
2493
  * Create IP Address Attribute
2217
2494
  *
2495
+ * Create IP address attribute.
2496
+ *
2497
+ *
2498
+ * @param {string} databaseId
2218
2499
  * @param {string} collectionId
2219
2500
  * @param {string} key
2220
2501
  * @param {boolean} required
@@ -2223,10 +2504,14 @@ declare module "node-appwrite" {
2223
2504
  * @throws {AppwriteException}
2224
2505
  * @returns {Promise}
2225
2506
  */
2226
- createIpAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
2507
+ createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
2227
2508
  /**
2228
2509
  * Create String Attribute
2229
2510
  *
2511
+ * Create a string attribute.
2512
+ *
2513
+ *
2514
+ * @param {string} databaseId
2230
2515
  * @param {string} collectionId
2231
2516
  * @param {string} key
2232
2517
  * @param {number} size
@@ -2236,10 +2521,14 @@ declare module "node-appwrite" {
2236
2521
  * @throws {AppwriteException}
2237
2522
  * @returns {Promise}
2238
2523
  */
2239
- createStringAttribute(collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
2524
+ createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
2240
2525
  /**
2241
2526
  * Create URL Attribute
2242
2527
  *
2528
+ * Create a URL attribute.
2529
+ *
2530
+ *
2531
+ * @param {string} databaseId
2243
2532
  * @param {string} collectionId
2244
2533
  * @param {string} key
2245
2534
  * @param {boolean} required
@@ -2248,93 +2537,112 @@ declare module "node-appwrite" {
2248
2537
  * @throws {AppwriteException}
2249
2538
  * @returns {Promise}
2250
2539
  */
2251
- createUrlAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
2540
+ createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
2252
2541
  /**
2253
2542
  * Get Attribute
2254
2543
  *
2544
+ * @param {string} databaseId
2255
2545
  * @param {string} collectionId
2256
2546
  * @param {string} key
2257
2547
  * @throws {AppwriteException}
2258
2548
  * @returns {Promise}
2259
2549
  */
2260
- getAttribute(collectionId: string, key: string): Promise<Response>;
2550
+ getAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
2261
2551
  /**
2262
2552
  * Delete Attribute
2263
2553
  *
2554
+ * @param {string} databaseId
2264
2555
  * @param {string} collectionId
2265
2556
  * @param {string} key
2266
2557
  * @throws {AppwriteException}
2267
2558
  * @returns {Promise}
2268
2559
  */
2269
- deleteAttribute(collectionId: string, key: string): Promise<Response>;
2560
+ deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<Response>;
2270
2561
  /**
2271
2562
  * List Documents
2272
2563
  *
2564
+ * Get a list of all the user's documents in a given collection. You can use
2565
+ * the query params to filter your results. On admin mode, this endpoint will
2566
+ * return a list of all of documents belonging to the provided collectionId.
2567
+ * [Learn more about different API modes](/docs/admin).
2568
+ *
2569
+ * @param {string} databaseId
2273
2570
  * @param {string} collectionId
2274
2571
  * @param {string[]} queries
2275
- * @param {number} limit
2276
- * @param {number} offset
2277
- * @param {string} cursor
2278
- * @param {string} cursorDirection
2279
- * @param {string[]} orderAttributes
2280
- * @param {string[]} orderTypes
2281
2572
  * @throws {AppwriteException}
2282
2573
  * @returns {Promise}
2283
2574
  */
2284
- 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>>;
2575
+ listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
2285
2576
  /**
2286
2577
  * Create Document
2287
2578
  *
2579
+ * Create a new Document. Before using this route, you should create a new
2580
+ * collection resource using either a [server
2581
+ * integration](/docs/server/databases#databasesCreateCollection) API or
2582
+ * directly from your database console.
2583
+ *
2584
+ * @param {string} databaseId
2288
2585
  * @param {string} collectionId
2289
2586
  * @param {string} documentId
2290
2587
  * @param {object} data
2291
- * @param {string[]} read
2292
- * @param {string[]} write
2588
+ * @param {string[]} permissions
2293
2589
  * @throws {AppwriteException}
2294
2590
  * @returns {Promise}
2295
2591
  */
2296
- createDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
2592
+ createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
2297
2593
  /**
2298
2594
  * Get Document
2299
2595
  *
2596
+ * Get a document by its unique ID. This endpoint response returns a JSON
2597
+ * object with the document data.
2598
+ *
2599
+ * @param {string} databaseId
2300
2600
  * @param {string} collectionId
2301
2601
  * @param {string} documentId
2302
2602
  * @throws {AppwriteException}
2303
2603
  * @returns {Promise}
2304
2604
  */
2305
- getDocument<Document extends Models.Document>(collectionId: string, documentId: string): Promise<Document>;
2605
+ getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string): Promise<Document>;
2306
2606
  /**
2307
2607
  * Update Document
2308
2608
  *
2609
+ * Update a document by its unique ID. Using the patch method you can pass
2610
+ * only specific fields that will get updated.
2611
+ *
2612
+ * @param {string} databaseId
2309
2613
  * @param {string} collectionId
2310
2614
  * @param {string} documentId
2311
2615
  * @param {object} data
2312
- * @param {string[]} read
2313
- * @param {string[]} write
2616
+ * @param {string[]} permissions
2314
2617
  * @throws {AppwriteException}
2315
2618
  * @returns {Promise}
2316
2619
  */
2317
- updateDocument<Document extends Models.Document>(collectionId: string, documentId: string, data?: object, read?: string[], write?: string[]): Promise<Document>;
2620
+ updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document>;
2318
2621
  /**
2319
2622
  * Delete Document
2320
2623
  *
2624
+ * Delete a document by its unique ID.
2625
+ *
2626
+ * @param {string} databaseId
2321
2627
  * @param {string} collectionId
2322
2628
  * @param {string} documentId
2323
2629
  * @throws {AppwriteException}
2324
2630
  * @returns {Promise}
2325
2631
  */
2326
- deleteDocument(collectionId: string, documentId: string): Promise<Response>;
2632
+ deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<Response>;
2327
2633
  /**
2328
2634
  * List Indexes
2329
2635
  *
2636
+ * @param {string} databaseId
2330
2637
  * @param {string} collectionId
2331
2638
  * @throws {AppwriteException}
2332
2639
  * @returns {Promise}
2333
2640
  */
2334
- listIndexes(collectionId: string): Promise<Models.IndexList>;
2641
+ listIndexes(databaseId: string, collectionId: string): Promise<Models.IndexList>;
2335
2642
  /**
2336
2643
  * Create Index
2337
2644
  *
2645
+ * @param {string} databaseId
2338
2646
  * @param {string} collectionId
2339
2647
  * @param {string} key
2340
2648
  * @param {string} type
@@ -2343,25 +2651,27 @@ declare module "node-appwrite" {
2343
2651
  * @throws {AppwriteException}
2344
2652
  * @returns {Promise}
2345
2653
  */
2346
- createIndex(collectionId: string, key: string, type: string, attributes: string[], orders?: string[]): Promise<Models.Index>;
2654
+ createIndex(databaseId: string, collectionId: string, key: string, type: string, attributes: string[], orders?: string[]): Promise<Models.Index>;
2347
2655
  /**
2348
2656
  * Get Index
2349
2657
  *
2658
+ * @param {string} databaseId
2350
2659
  * @param {string} collectionId
2351
2660
  * @param {string} key
2352
2661
  * @throws {AppwriteException}
2353
2662
  * @returns {Promise}
2354
2663
  */
2355
- getIndex(collectionId: string, key: string): Promise<Models.Index>;
2664
+ getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index>;
2356
2665
  /**
2357
2666
  * Delete Index
2358
2667
  *
2668
+ * @param {string} databaseId
2359
2669
  * @param {string} collectionId
2360
2670
  * @param {string} key
2361
2671
  * @throws {AppwriteException}
2362
2672
  * @returns {Promise}
2363
2673
  */
2364
- deleteIndex(collectionId: string, key: string): Promise<Response>;
2674
+ deleteIndex(databaseId: string, collectionId: string, key: string): Promise<Response>;
2365
2675
  }
2366
2676
  export class Functions extends Service {
2367
2677
  constructor(client: Client);
@@ -2372,16 +2682,12 @@ declare module "node-appwrite" {
2372
2682
  * Get a list of all the project's functions. You can use the query params to
2373
2683
  * filter your results.
2374
2684
  *
2685
+ * @param {string[]} queries
2375
2686
  * @param {string} search
2376
- * @param {number} limit
2377
- * @param {number} offset
2378
- * @param {string} cursor
2379
- * @param {string} cursorDirection
2380
- * @param {string} orderType
2381
2687
  * @throws {AppwriteException}
2382
2688
  * @returns {Promise}
2383
2689
  */
2384
- list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FunctionList>;
2690
+ list(queries?: string[], search?: string): Promise<Models.FunctionList>;
2385
2691
  /**
2386
2692
  * Create Function
2387
2693
  *
@@ -2393,14 +2699,14 @@ declare module "node-appwrite" {
2393
2699
  * @param {string} name
2394
2700
  * @param {string[]} execute
2395
2701
  * @param {string} runtime
2396
- * @param {object} vars
2397
2702
  * @param {string[]} events
2398
2703
  * @param {string} schedule
2399
2704
  * @param {number} timeout
2705
+ * @param {boolean} enabled
2400
2706
  * @throws {AppwriteException}
2401
2707
  * @returns {Promise}
2402
2708
  */
2403
- create(functionId: string, name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>;
2709
+ create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
2404
2710
  /**
2405
2711
  * List runtimes
2406
2712
  *
@@ -2428,14 +2734,14 @@ declare module "node-appwrite" {
2428
2734
  * @param {string} functionId
2429
2735
  * @param {string} name
2430
2736
  * @param {string[]} execute
2431
- * @param {object} vars
2432
2737
  * @param {string[]} events
2433
2738
  * @param {string} schedule
2434
2739
  * @param {number} timeout
2740
+ * @param {boolean} enabled
2435
2741
  * @throws {AppwriteException}
2436
2742
  * @returns {Promise}
2437
2743
  */
2438
- update(functionId: string, name: string, execute: string[], vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>;
2744
+ update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>;
2439
2745
  /**
2440
2746
  * Delete Function
2441
2747
  *
@@ -2453,16 +2759,12 @@ declare module "node-appwrite" {
2453
2759
  * params to filter your results.
2454
2760
  *
2455
2761
  * @param {string} functionId
2762
+ * @param {string[]} queries
2456
2763
  * @param {string} search
2457
- * @param {number} limit
2458
- * @param {number} offset
2459
- * @param {string} cursor
2460
- * @param {string} cursorDirection
2461
- * @param {string} orderType
2462
2764
  * @throws {AppwriteException}
2463
2765
  * @returns {Promise}
2464
2766
  */
2465
- listDeployments(functionId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DeploymentList>;
2767
+ listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>;
2466
2768
  /**
2467
2769
  * Create Deployment
2468
2770
  *
@@ -2495,7 +2797,7 @@ declare module "node-appwrite" {
2495
2797
  * @throws {AppwriteException}
2496
2798
  * @returns {Promise}
2497
2799
  */
2498
- getDeployment(functionId: string, deploymentId: string): Promise<Models.DeploymentList>;
2800
+ getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
2499
2801
  /**
2500
2802
  * Update Function Deployment
2501
2803
  *
@@ -2539,15 +2841,12 @@ declare module "node-appwrite" {
2539
2841
  * different API modes](/docs/admin).
2540
2842
  *
2541
2843
  * @param {string} functionId
2542
- * @param {number} limit
2543
- * @param {number} offset
2844
+ * @param {string[]} queries
2544
2845
  * @param {string} search
2545
- * @param {string} cursor
2546
- * @param {string} cursorDirection
2547
2846
  * @throws {AppwriteException}
2548
2847
  * @returns {Promise}
2549
2848
  */
2550
- listExecutions(functionId: string, limit?: number, offset?: number, search?: string, cursor?: string, cursorDirection?: string): Promise<Models.ExecutionList>;
2849
+ listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList>;
2551
2850
  /**
2552
2851
  * Create Execution
2553
2852
  *
@@ -2574,6 +2873,64 @@ declare module "node-appwrite" {
2574
2873
  * @returns {Promise}
2575
2874
  */
2576
2875
  getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
2876
+ /**
2877
+ * List Variables
2878
+ *
2879
+ * Get a list of all variables of a specific function.
2880
+ *
2881
+ * @param {string} functionId
2882
+ * @throws {AppwriteException}
2883
+ * @returns {Promise}
2884
+ */
2885
+ listVariables(functionId: string): Promise<Models.VariableList>;
2886
+ /**
2887
+ * Create Variable
2888
+ *
2889
+ * Create a new function variable. These variables can be accessed within
2890
+ * function in the `env` object under the request variable.
2891
+ *
2892
+ * @param {string} functionId
2893
+ * @param {string} key
2894
+ * @param {string} value
2895
+ * @throws {AppwriteException}
2896
+ * @returns {Promise}
2897
+ */
2898
+ createVariable(functionId: string, key: string, value: string): Promise<Models.Variable>;
2899
+ /**
2900
+ * Get Variable
2901
+ *
2902
+ * Get a variable by its unique ID.
2903
+ *
2904
+ * @param {string} functionId
2905
+ * @param {string} variableId
2906
+ * @throws {AppwriteException}
2907
+ * @returns {Promise}
2908
+ */
2909
+ getVariable(functionId: string, variableId: string): Promise<Models.Variable>;
2910
+ /**
2911
+ * Update Variable
2912
+ *
2913
+ * Update variable by its unique ID.
2914
+ *
2915
+ * @param {string} functionId
2916
+ * @param {string} variableId
2917
+ * @param {string} key
2918
+ * @param {string} value
2919
+ * @throws {AppwriteException}
2920
+ * @returns {Promise}
2921
+ */
2922
+ updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise<Models.Variable>;
2923
+ /**
2924
+ * Delete Variable
2925
+ *
2926
+ * Delete a variable by its unique ID.
2927
+ *
2928
+ * @param {string} functionId
2929
+ * @param {string} variableId
2930
+ * @throws {AppwriteException}
2931
+ * @returns {Promise}
2932
+ */
2933
+ deleteVariable(functionId: string, variableId: string): Promise<Response>;
2577
2934
  }
2578
2935
  export class Health extends Service {
2579
2936
  constructor(client: Client);
@@ -2704,7 +3061,7 @@ declare module "node-appwrite" {
2704
3061
  * @throws {AppwriteException}
2705
3062
  * @returns {Promise}
2706
3063
  */
2707
- getContinents(): Promise<Models.ContinentList>;
3064
+ listContinents(): Promise<Models.ContinentList>;
2708
3065
  /**
2709
3066
  * List Countries
2710
3067
  *
@@ -2714,7 +3071,7 @@ declare module "node-appwrite" {
2714
3071
  * @throws {AppwriteException}
2715
3072
  * @returns {Promise}
2716
3073
  */
2717
- getCountries(): Promise<Models.CountryList>;
3074
+ listCountries(): Promise<Models.CountryList>;
2718
3075
  /**
2719
3076
  * List EU Countries
2720
3077
  *
@@ -2724,7 +3081,7 @@ declare module "node-appwrite" {
2724
3081
  * @throws {AppwriteException}
2725
3082
  * @returns {Promise}
2726
3083
  */
2727
- getCountriesEU(): Promise<Models.CountryList>;
3084
+ listCountriesEU(): Promise<Models.CountryList>;
2728
3085
  /**
2729
3086
  * List Countries Phone Codes
2730
3087
  *
@@ -2734,7 +3091,7 @@ declare module "node-appwrite" {
2734
3091
  * @throws {AppwriteException}
2735
3092
  * @returns {Promise}
2736
3093
  */
2737
- getCountriesPhones(): Promise<Models.PhoneList>;
3094
+ listCountriesPhones(): Promise<Models.PhoneList>;
2738
3095
  /**
2739
3096
  * List Currencies
2740
3097
  *
@@ -2745,7 +3102,7 @@ declare module "node-appwrite" {
2745
3102
  * @throws {AppwriteException}
2746
3103
  * @returns {Promise}
2747
3104
  */
2748
- getCurrencies(): Promise<Models.CurrencyList>;
3105
+ listCurrencies(): Promise<Models.CurrencyList>;
2749
3106
  /**
2750
3107
  * List Languages
2751
3108
  *
@@ -2755,7 +3112,7 @@ declare module "node-appwrite" {
2755
3112
  * @throws {AppwriteException}
2756
3113
  * @returns {Promise}
2757
3114
  */
2758
- getLanguages(): Promise<Models.LanguageList>;
3115
+ listLanguages(): Promise<Models.LanguageList>;
2759
3116
  }
2760
3117
  export class Storage extends Service {
2761
3118
  constructor(client: Client);
@@ -2766,16 +3123,12 @@ declare module "node-appwrite" {
2766
3123
  * Get a list of all the storage buckets. You can use the query params to
2767
3124
  * filter your results.
2768
3125
  *
3126
+ * @param {string[]} queries
2769
3127
  * @param {string} search
2770
- * @param {number} limit
2771
- * @param {number} offset
2772
- * @param {string} cursor
2773
- * @param {string} cursorDirection
2774
- * @param {string} orderType
2775
3128
  * @throws {AppwriteException}
2776
3129
  * @returns {Promise}
2777
3130
  */
2778
- listBuckets(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.BucketList>;
3131
+ listBuckets(queries?: string[], search?: string): Promise<Models.BucketList>;
2779
3132
  /**
2780
3133
  * Create bucket
2781
3134
  *
@@ -2783,18 +3136,18 @@ declare module "node-appwrite" {
2783
3136
  *
2784
3137
  * @param {string} bucketId
2785
3138
  * @param {string} name
2786
- * @param {string} permission
2787
- * @param {string[]} read
2788
- * @param {string[]} write
3139
+ * @param {string[]} permissions
3140
+ * @param {boolean} fileSecurity
2789
3141
  * @param {boolean} enabled
2790
3142
  * @param {number} maximumFileSize
2791
3143
  * @param {string[]} allowedFileExtensions
3144
+ * @param {string} compression
2792
3145
  * @param {boolean} encryption
2793
3146
  * @param {boolean} antivirus
2794
3147
  * @throws {AppwriteException}
2795
3148
  * @returns {Promise}
2796
3149
  */
2797
- createBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
3150
+ createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
2798
3151
  /**
2799
3152
  * Get Bucket
2800
3153
  *
@@ -2813,18 +3166,18 @@ declare module "node-appwrite" {
2813
3166
  *
2814
3167
  * @param {string} bucketId
2815
3168
  * @param {string} name
2816
- * @param {string} permission
2817
- * @param {string[]} read
2818
- * @param {string[]} write
3169
+ * @param {string[]} permissions
3170
+ * @param {boolean} fileSecurity
2819
3171
  * @param {boolean} enabled
2820
3172
  * @param {number} maximumFileSize
2821
3173
  * @param {string[]} allowedFileExtensions
3174
+ * @param {string} compression
2822
3175
  * @param {boolean} encryption
2823
3176
  * @param {boolean} antivirus
2824
3177
  * @throws {AppwriteException}
2825
3178
  * @returns {Promise}
2826
3179
  */
2827
- updateBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
3180
+ updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
2828
3181
  /**
2829
3182
  * Delete Bucket
2830
3183
  *
@@ -2843,23 +3196,19 @@ declare module "node-appwrite" {
2843
3196
  * project's files. [Learn more about different API modes](/docs/admin).
2844
3197
  *
2845
3198
  * @param {string} bucketId
3199
+ * @param {string[]} queries
2846
3200
  * @param {string} search
2847
- * @param {number} limit
2848
- * @param {number} offset
2849
- * @param {string} cursor
2850
- * @param {string} cursorDirection
2851
- * @param {string} orderType
2852
3201
  * @throws {AppwriteException}
2853
3202
  * @returns {Promise}
2854
3203
  */
2855
- listFiles(bucketId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FileList>;
3204
+ listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
2856
3205
  /**
2857
3206
  * Create File
2858
3207
  *
2859
3208
  * Create a new file. Before using this route, you should create a new bucket
2860
3209
  * resource using either a [server
2861
- * integration](/docs/server/database#storageCreateBucket) API or directly
2862
- * from your Appwrite console.
3210
+ * integration](/docs/server/storage#storageCreateBucket) API or directly from
3211
+ * your Appwrite console.
2863
3212
  *
2864
3213
  * Larger files should be uploaded using multiple requests with the
2865
3214
  * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
@@ -2878,12 +3227,11 @@ declare module "node-appwrite" {
2878
3227
  * @param {string} bucketId
2879
3228
  * @param {string} fileId
2880
3229
  * @param {InputFile} file
2881
- * @param {string[]} read
2882
- * @param {string[]} write
3230
+ * @param {string[]} permissions
2883
3231
  * @throws {AppwriteException}
2884
3232
  * @returns {Promise}
2885
3233
  */
2886
- createFile(bucketId: string, fileId: string, file: InputFile, read?: string[], write?: string[]): Promise<Models.File>;
3234
+ createFile(bucketId: string, fileId: string, file: InputFile, permissions?: string[]): Promise<Models.File>;
2887
3235
  /**
2888
3236
  * Get File
2889
3237
  *
@@ -2904,12 +3252,11 @@ declare module "node-appwrite" {
2904
3252
  *
2905
3253
  * @param {string} bucketId
2906
3254
  * @param {string} fileId
2907
- * @param {string[]} read
2908
- * @param {string[]} write
3255
+ * @param {string[]} permissions
2909
3256
  * @throws {AppwriteException}
2910
3257
  * @returns {Promise}
2911
3258
  */
2912
- updateFile(bucketId: string, fileId: string, read?: string[], write?: string[]): Promise<Models.File>;
3259
+ updateFile(bucketId: string, fileId: string, permissions?: string[]): Promise<Models.File>;
2913
3260
  /**
2914
3261
  * Delete File
2915
3262
  *
@@ -2987,16 +3334,12 @@ declare module "node-appwrite" {
2987
3334
  * In admin mode, this endpoint returns a list of all the teams in the current
2988
3335
  * project. [Learn more about different API modes](/docs/admin).
2989
3336
  *
3337
+ * @param {string[]} queries
2990
3338
  * @param {string} search
2991
- * @param {number} limit
2992
- * @param {number} offset
2993
- * @param {string} cursor
2994
- * @param {string} cursorDirection
2995
- * @param {string} orderType
2996
3339
  * @throws {AppwriteException}
2997
3340
  * @returns {Promise}
2998
3341
  */
2999
- list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.TeamList>;
3342
+ list(queries?: string[], search?: string): Promise<Models.TeamList>;
3000
3343
  /**
3001
3344
  * Create Team
3002
3345
  *
@@ -3045,22 +3388,18 @@ declare module "node-appwrite" {
3045
3388
  */
3046
3389
  delete(teamId: string): Promise<Response>;
3047
3390
  /**
3048
- * Get Team Memberships
3391
+ * List Team Memberships
3049
3392
  *
3050
3393
  * Use this endpoint to list a team's members using the team's ID. All team
3051
3394
  * members have read access to this endpoint.
3052
3395
  *
3053
3396
  * @param {string} teamId
3397
+ * @param {string[]} queries
3054
3398
  * @param {string} search
3055
- * @param {number} limit
3056
- * @param {number} offset
3057
- * @param {string} cursor
3058
- * @param {string} cursorDirection
3059
- * @param {string} orderType
3060
3399
  * @throws {AppwriteException}
3061
3400
  * @returns {Promise}
3062
3401
  */
3063
- getMemberships(teamId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.MembershipList>;
3402
+ listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList>;
3064
3403
  /**
3065
3404
  * Create Team Membership
3066
3405
  *
@@ -3157,16 +3496,12 @@ declare module "node-appwrite" {
3157
3496
  * Get a list of all the project's users. You can use the query params to
3158
3497
  * filter your results.
3159
3498
  *
3499
+ * @param {string[]} queries
3160
3500
  * @param {string} search
3161
- * @param {number} limit
3162
- * @param {number} offset
3163
- * @param {string} cursor
3164
- * @param {string} cursorDirection
3165
- * @param {string} orderType
3166
3501
  * @throws {AppwriteException}
3167
3502
  * @returns {Promise}
3168
3503
  */
3169
- list<Preferences extends Models.Preferences>(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.UserList<Preferences>>;
3504
+ list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>>;
3170
3505
  /**
3171
3506
  * Create User
3172
3507
  *
@@ -3174,12 +3509,134 @@ declare module "node-appwrite" {
3174
3509
  *
3175
3510
  * @param {string} userId
3176
3511
  * @param {string} email
3512
+ * @param {string} phone
3177
3513
  * @param {string} password
3178
3514
  * @param {string} name
3179
3515
  * @throws {AppwriteException}
3180
3516
  * @returns {Promise}
3181
3517
  */
3182
- create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
3518
+ create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
3519
+ /**
3520
+ * Create User with Argon2 Password
3521
+ *
3522
+ * Create a new user. Password provided must be hashed with the
3523
+ * [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST
3524
+ * /users](/docs/server/users#usersCreate) endpoint to create users with a
3525
+ * plain text password.
3526
+ *
3527
+ * @param {string} userId
3528
+ * @param {string} email
3529
+ * @param {string} password
3530
+ * @param {string} name
3531
+ * @throws {AppwriteException}
3532
+ * @returns {Promise}
3533
+ */
3534
+ createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
3535
+ /**
3536
+ * Create User with Bcrypt Password
3537
+ *
3538
+ * Create a new user. Password provided must be hashed with the
3539
+ * [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST
3540
+ * /users](/docs/server/users#usersCreate) endpoint to create users with a
3541
+ * plain text password.
3542
+ *
3543
+ * @param {string} userId
3544
+ * @param {string} email
3545
+ * @param {string} password
3546
+ * @param {string} name
3547
+ * @throws {AppwriteException}
3548
+ * @returns {Promise}
3549
+ */
3550
+ createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
3551
+ /**
3552
+ * Create User with MD5 Password
3553
+ *
3554
+ * Create a new user. Password provided must be hashed with the
3555
+ * [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST
3556
+ * /users](/docs/server/users#usersCreate) endpoint to create users with a
3557
+ * plain text password.
3558
+ *
3559
+ * @param {string} userId
3560
+ * @param {string} email
3561
+ * @param {string} password
3562
+ * @param {string} name
3563
+ * @throws {AppwriteException}
3564
+ * @returns {Promise}
3565
+ */
3566
+ createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
3567
+ /**
3568
+ * Create User with PHPass Password
3569
+ *
3570
+ * Create a new user. Password provided must be hashed with the
3571
+ * [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST
3572
+ * /users](/docs/server/users#usersCreate) endpoint to create users with a
3573
+ * plain text password.
3574
+ *
3575
+ * @param {string} userId
3576
+ * @param {string} email
3577
+ * @param {string} password
3578
+ * @param {string} name
3579
+ * @throws {AppwriteException}
3580
+ * @returns {Promise}
3581
+ */
3582
+ createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
3583
+ /**
3584
+ * Create User with Scrypt Password
3585
+ *
3586
+ * Create a new user. Password provided must be hashed with the
3587
+ * [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST
3588
+ * /users](/docs/server/users#usersCreate) endpoint to create users with a
3589
+ * plain text password.
3590
+ *
3591
+ * @param {string} userId
3592
+ * @param {string} email
3593
+ * @param {string} password
3594
+ * @param {string} passwordSalt
3595
+ * @param {number} passwordCpu
3596
+ * @param {number} passwordMemory
3597
+ * @param {number} passwordParallel
3598
+ * @param {number} passwordLength
3599
+ * @param {string} name
3600
+ * @throws {AppwriteException}
3601
+ * @returns {Promise}
3602
+ */
3603
+ createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>;
3604
+ /**
3605
+ * Create User with Scrypt Modified Password
3606
+ *
3607
+ * Create a new user. Password provided must be hashed with the [Scrypt
3608
+ * Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc)
3609
+ * algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint
3610
+ * to create users with a plain text password.
3611
+ *
3612
+ * @param {string} userId
3613
+ * @param {string} email
3614
+ * @param {string} password
3615
+ * @param {string} passwordSalt
3616
+ * @param {string} passwordSaltSeparator
3617
+ * @param {string} passwordSignerKey
3618
+ * @param {string} name
3619
+ * @throws {AppwriteException}
3620
+ * @returns {Promise}
3621
+ */
3622
+ createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>;
3623
+ /**
3624
+ * Create User with SHA Password
3625
+ *
3626
+ * Create a new user. Password provided must be hashed with the
3627
+ * [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use
3628
+ * the [POST /users](/docs/server/users#usersCreate) endpoint to create users
3629
+ * with a plain text password.
3630
+ *
3631
+ * @param {string} userId
3632
+ * @param {string} email
3633
+ * @param {string} password
3634
+ * @param {string} passwordVersion
3635
+ * @param {string} name
3636
+ * @throws {AppwriteException}
3637
+ * @returns {Promise}
3638
+ */
3639
+ createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: string, name?: string): Promise<Models.User<Preferences>>;
3183
3640
  /**
3184
3641
  * Get User
3185
3642
  *
@@ -3216,19 +3673,18 @@ declare module "node-appwrite" {
3216
3673
  */
3217
3674
  updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
3218
3675
  /**
3219
- * Get User Logs
3676
+ * List User Logs
3220
3677
  *
3221
3678
  * Get the user activity logs list by its unique ID.
3222
3679
  *
3223
3680
  * @param {string} userId
3224
- * @param {number} limit
3225
- * @param {number} offset
3681
+ * @param {string[]} queries
3226
3682
  * @throws {AppwriteException}
3227
3683
  * @returns {Promise}
3228
3684
  */
3229
- getLogs(userId: string, limit?: number, offset?: number): Promise<Models.LogList>;
3685
+ listLogs(userId: string, queries?: string[]): Promise<Models.LogList>;
3230
3686
  /**
3231
- * Get User Memberships
3687
+ * List User Memberships
3232
3688
  *
3233
3689
  * Get the user membership list by its unique ID.
3234
3690
  *
@@ -3236,7 +3692,7 @@ declare module "node-appwrite" {
3236
3692
  * @throws {AppwriteException}
3237
3693
  * @returns {Promise}
3238
3694
  */
3239
- getMemberships(userId: string): Promise<Models.MembershipList>;
3695
+ listMemberships(userId: string): Promise<Models.MembershipList>;
3240
3696
  /**
3241
3697
  * Update Name
3242
3698
  *
@@ -3294,7 +3750,7 @@ declare module "node-appwrite" {
3294
3750
  */
3295
3751
  updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences>;
3296
3752
  /**
3297
- * Get User Sessions
3753
+ * List User Sessions
3298
3754
  *
3299
3755
  * Get the user sessions list by its unique ID.
3300
3756
  *
@@ -3302,7 +3758,7 @@ declare module "node-appwrite" {
3302
3758
  * @throws {AppwriteException}
3303
3759
  * @returns {Promise}
3304
3760
  */
3305
- getSessions(userId: string): Promise<Models.SessionList>;
3761
+ listSessions(userId: string): Promise<Models.SessionList>;
3306
3762
  /**
3307
3763
  * Delete User Sessions
3308
3764
  *