node-appwrite 2.5.1 → 4.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 (40) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +6 -6
  3. package/docs/examples/database/create-boolean-attribute.md +20 -0
  4. package/docs/examples/database/create-collection.md +1 -1
  5. package/docs/examples/database/create-document.md +1 -1
  6. package/docs/examples/database/create-email-attribute.md +20 -0
  7. package/docs/examples/database/create-enum-attribute.md +20 -0
  8. package/docs/examples/database/create-float-attribute.md +20 -0
  9. package/docs/examples/database/create-index.md +20 -0
  10. package/docs/examples/database/create-integer-attribute.md +20 -0
  11. package/docs/examples/database/create-ip-attribute.md +20 -0
  12. package/docs/examples/database/create-string-attribute.md +20 -0
  13. package/docs/examples/database/create-url-attribute.md +20 -0
  14. package/docs/examples/database/delete-attribute.md +20 -0
  15. package/docs/examples/database/delete-index.md +20 -0
  16. package/docs/examples/database/get-attribute.md +20 -0
  17. package/docs/examples/database/get-index.md +20 -0
  18. package/docs/examples/database/list-attributes.md +20 -0
  19. package/docs/examples/database/list-indexes.md +20 -0
  20. package/docs/examples/database/update-collection.md +1 -1
  21. package/docs/examples/functions/create.md +1 -1
  22. package/docs/examples/{health/get-queue-tasks.md → functions/list-runtimes.md} +2 -2
  23. package/docs/examples/health/{get-anti-virus.md → get-antivirus.md} +1 -1
  24. package/docs/examples/storage/create-file.md +1 -1
  25. package/docs/examples/teams/create.md +1 -1
  26. package/docs/examples/teams/get-membership.md +20 -0
  27. package/docs/examples/users/create.md +1 -1
  28. package/docs/examples/users/update-status.md +1 -1
  29. package/index.d.ts +1667 -246
  30. package/index.js +3 -1
  31. package/lib/client.js +3 -3
  32. package/lib/query.js +36 -0
  33. package/lib/services/account.js +19 -6
  34. package/lib/services/database.js +706 -47
  35. package/lib/services/functions.js +63 -12
  36. package/lib/services/health.js +4 -22
  37. package/lib/services/storage.js +21 -2
  38. package/lib/services/teams.js +89 -30
  39. package/lib/services/users.js +37 -7
  40. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,4 +1,1294 @@
1
1
  declare module "node-appwrite" {
2
+ export namespace Models {
3
+ /**
4
+ * Collections List
5
+ */
6
+ export type CollectionList = {
7
+ /**
8
+ * Total number of items available on the server.
9
+ */
10
+ sum: number;
11
+ /**
12
+ * List of collections.
13
+ */
14
+ collections: Collection[];
15
+ }
16
+ /**
17
+ * Indexes List
18
+ */
19
+ export type IndexList = {
20
+ /**
21
+ * Total number of items available on the server.
22
+ */
23
+ sum: number;
24
+ /**
25
+ * List of indexes.
26
+ */
27
+ indexes: Index[];
28
+ }
29
+ /**
30
+ * Documents List
31
+ */
32
+ export type DocumentList<Document extends Models.Document> = {
33
+ /**
34
+ * Total number of items available on the server.
35
+ */
36
+ sum: number;
37
+ /**
38
+ * List of documents.
39
+ */
40
+ documents: Document[];
41
+ }
42
+ /**
43
+ * Users List
44
+ */
45
+ export type UserList<Preferences extends Models.Preferences> = {
46
+ /**
47
+ * Total number of items available on the server.
48
+ */
49
+ sum: number;
50
+ /**
51
+ * List of users.
52
+ */
53
+ users: User<Preferences>[];
54
+ }
55
+ /**
56
+ * Sessions List
57
+ */
58
+ export type SessionList = {
59
+ /**
60
+ * Total number of items available on the server.
61
+ */
62
+ sum: number;
63
+ /**
64
+ * List of sessions.
65
+ */
66
+ sessions: Session[];
67
+ }
68
+ /**
69
+ * Logs List
70
+ */
71
+ export type LogList = {
72
+ /**
73
+ * Total number of items available on the server.
74
+ */
75
+ sum: number;
76
+ /**
77
+ * List of logs.
78
+ */
79
+ logs: Log[];
80
+ }
81
+ /**
82
+ * Files List
83
+ */
84
+ export type FileList = {
85
+ /**
86
+ * Total number of items available on the server.
87
+ */
88
+ sum: number;
89
+ /**
90
+ * List of files.
91
+ */
92
+ files: File[];
93
+ }
94
+ /**
95
+ * Teams List
96
+ */
97
+ export type TeamList = {
98
+ /**
99
+ * Total number of items available on the server.
100
+ */
101
+ sum: number;
102
+ /**
103
+ * List of teams.
104
+ */
105
+ teams: Team[];
106
+ }
107
+ /**
108
+ * Memberships List
109
+ */
110
+ export type MembershipList = {
111
+ /**
112
+ * Total number of items available on the server.
113
+ */
114
+ sum: number;
115
+ /**
116
+ * List of memberships.
117
+ */
118
+ memberships: Membership[];
119
+ }
120
+ /**
121
+ * Functions List
122
+ */
123
+ export type FunctionList = {
124
+ /**
125
+ * Total number of items available on the server.
126
+ */
127
+ sum: number;
128
+ /**
129
+ * List of functions.
130
+ */
131
+ functions: Function[];
132
+ }
133
+ /**
134
+ * Runtimes List
135
+ */
136
+ export type RuntimeList = {
137
+ /**
138
+ * Total number of items available on the server.
139
+ */
140
+ sum: number;
141
+ /**
142
+ * List of runtimes.
143
+ */
144
+ runtimes: Runtime[];
145
+ }
146
+ /**
147
+ * Tags List
148
+ */
149
+ export type TagList = {
150
+ /**
151
+ * Total number of items available on the server.
152
+ */
153
+ sum: number;
154
+ /**
155
+ * List of tags.
156
+ */
157
+ tags: Tag[];
158
+ }
159
+ /**
160
+ * Executions List
161
+ */
162
+ export type ExecutionList = {
163
+ /**
164
+ * Total number of items available on the server.
165
+ */
166
+ sum: number;
167
+ /**
168
+ * List of executions.
169
+ */
170
+ executions: Execution[];
171
+ }
172
+ /**
173
+ * Countries List
174
+ */
175
+ export type CountryList = {
176
+ /**
177
+ * Total number of items available on the server.
178
+ */
179
+ sum: number;
180
+ /**
181
+ * List of countries.
182
+ */
183
+ countries: Country[];
184
+ }
185
+ /**
186
+ * Continents List
187
+ */
188
+ export type ContinentList = {
189
+ /**
190
+ * Total number of items available on the server.
191
+ */
192
+ sum: number;
193
+ /**
194
+ * List of continents.
195
+ */
196
+ continents: Continent[];
197
+ }
198
+ /**
199
+ * Languages List
200
+ */
201
+ export type LanguageList = {
202
+ /**
203
+ * Total number of items available on the server.
204
+ */
205
+ sum: number;
206
+ /**
207
+ * List of languages.
208
+ */
209
+ languages: Language[];
210
+ }
211
+ /**
212
+ * Currencies List
213
+ */
214
+ export type CurrencyList = {
215
+ /**
216
+ * Total number of items available on the server.
217
+ */
218
+ sum: number;
219
+ /**
220
+ * List of currencies.
221
+ */
222
+ currencies: Currency[];
223
+ }
224
+ /**
225
+ * Phones List
226
+ */
227
+ export type PhoneList = {
228
+ /**
229
+ * Total number of items available on the server.
230
+ */
231
+ sum: number;
232
+ /**
233
+ * List of phones.
234
+ */
235
+ phones: Phone[];
236
+ }
237
+ /**
238
+ * Collection
239
+ */
240
+ export type Collection = {
241
+ /**
242
+ * Collection ID.
243
+ */
244
+ $id: string;
245
+ /**
246
+ * Collection read permissions.
247
+ */
248
+ $read: string[];
249
+ /**
250
+ * Collection write permissions.
251
+ */
252
+ $write: string[];
253
+ /**
254
+ * Collection name.
255
+ */
256
+ name: string;
257
+ /**
258
+ * Collection enabled.
259
+ */
260
+ enabled: boolean;
261
+ /**
262
+ * Collection permission model. Possible values: `document` or `collection`
263
+ */
264
+ permission: string;
265
+ /**
266
+ * Collection attributes.
267
+ */
268
+ attributes: string[];
269
+ /**
270
+ * Collection indexes.
271
+ */
272
+ indexes: Index[];
273
+ }
274
+ /**
275
+ * Attributes List
276
+ */
277
+ export type AttributeList = {
278
+ /**
279
+ * Total sum of items in the list.
280
+ */
281
+ sum: number;
282
+ /**
283
+ * List of attributes.
284
+ */
285
+ attributes: string[];
286
+ }
287
+ /**
288
+ * AttributeString
289
+ */
290
+ export type AttributeString = {
291
+ /**
292
+ * Attribute Key.
293
+ */
294
+ key: string;
295
+ /**
296
+ * Attribute type.
297
+ */
298
+ type: string;
299
+ /**
300
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
301
+ */
302
+ status: string;
303
+ /**
304
+ * Is attribute required?
305
+ */
306
+ required: boolean;
307
+ /**
308
+ * Is attribute an array?
309
+ */
310
+ array?: boolean;
311
+ /**
312
+ * Attribute size.
313
+ */
314
+ size: number;
315
+ /**
316
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
317
+ */
318
+ xdefault?: string;
319
+ }
320
+ /**
321
+ * AttributeInteger
322
+ */
323
+ export type AttributeInteger = {
324
+ /**
325
+ * Attribute Key.
326
+ */
327
+ key: string;
328
+ /**
329
+ * Attribute type.
330
+ */
331
+ type: string;
332
+ /**
333
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
334
+ */
335
+ status: string;
336
+ /**
337
+ * Is attribute required?
338
+ */
339
+ required: boolean;
340
+ /**
341
+ * Is attribute an array?
342
+ */
343
+ array?: boolean;
344
+ /**
345
+ * Minimum value to enforce for new documents.
346
+ */
347
+ min?: number;
348
+ /**
349
+ * Maximum value to enforce for new documents.
350
+ */
351
+ max?: number;
352
+ /**
353
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
354
+ */
355
+ xdefault?: number;
356
+ }
357
+ /**
358
+ * AttributeFloat
359
+ */
360
+ export type AttributeFloat = {
361
+ /**
362
+ * Attribute Key.
363
+ */
364
+ key: string;
365
+ /**
366
+ * Attribute type.
367
+ */
368
+ type: string;
369
+ /**
370
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
371
+ */
372
+ status: string;
373
+ /**
374
+ * Is attribute required?
375
+ */
376
+ required: boolean;
377
+ /**
378
+ * Is attribute an array?
379
+ */
380
+ array?: boolean;
381
+ /**
382
+ * Minimum value to enforce for new documents.
383
+ */
384
+ min?: number;
385
+ /**
386
+ * Maximum value to enforce for new documents.
387
+ */
388
+ max?: number;
389
+ /**
390
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
391
+ */
392
+ xdefault?: number;
393
+ }
394
+ /**
395
+ * AttributeBoolean
396
+ */
397
+ export type AttributeBoolean = {
398
+ /**
399
+ * Attribute Key.
400
+ */
401
+ key: string;
402
+ /**
403
+ * Attribute type.
404
+ */
405
+ type: string;
406
+ /**
407
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
408
+ */
409
+ status: string;
410
+ /**
411
+ * Is attribute required?
412
+ */
413
+ required: boolean;
414
+ /**
415
+ * Is attribute an array?
416
+ */
417
+ array?: boolean;
418
+ /**
419
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
420
+ */
421
+ xdefault?: boolean;
422
+ }
423
+ /**
424
+ * AttributeEmail
425
+ */
426
+ export type AttributeEmail = {
427
+ /**
428
+ * Attribute Key.
429
+ */
430
+ key: string;
431
+ /**
432
+ * Attribute type.
433
+ */
434
+ type: string;
435
+ /**
436
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
437
+ */
438
+ status: string;
439
+ /**
440
+ * Is attribute required?
441
+ */
442
+ required: boolean;
443
+ /**
444
+ * Is attribute an array?
445
+ */
446
+ array?: boolean;
447
+ /**
448
+ * String format.
449
+ */
450
+ format: string;
451
+ /**
452
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
453
+ */
454
+ xdefault?: string;
455
+ }
456
+ /**
457
+ * AttributeEnum
458
+ */
459
+ export type AttributeEnum = {
460
+ /**
461
+ * Attribute Key.
462
+ */
463
+ key: string;
464
+ /**
465
+ * Attribute type.
466
+ */
467
+ type: string;
468
+ /**
469
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
470
+ */
471
+ status: string;
472
+ /**
473
+ * Is attribute required?
474
+ */
475
+ required: boolean;
476
+ /**
477
+ * Is attribute an array?
478
+ */
479
+ array?: boolean;
480
+ /**
481
+ * Array of elements in enumerated type.
482
+ */
483
+ elements: string[];
484
+ /**
485
+ * String format.
486
+ */
487
+ format: string;
488
+ /**
489
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
490
+ */
491
+ xdefault?: string;
492
+ }
493
+ /**
494
+ * AttributeIP
495
+ */
496
+ export type AttributeIp = {
497
+ /**
498
+ * Attribute Key.
499
+ */
500
+ key: string;
501
+ /**
502
+ * Attribute type.
503
+ */
504
+ type: string;
505
+ /**
506
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
507
+ */
508
+ status: string;
509
+ /**
510
+ * Is attribute required?
511
+ */
512
+ required: boolean;
513
+ /**
514
+ * Is attribute an array?
515
+ */
516
+ array?: boolean;
517
+ /**
518
+ * String format.
519
+ */
520
+ format: string;
521
+ /**
522
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
523
+ */
524
+ xdefault?: string;
525
+ }
526
+ /**
527
+ * AttributeURL
528
+ */
529
+ export type AttributeUrl = {
530
+ /**
531
+ * Attribute Key.
532
+ */
533
+ key: string;
534
+ /**
535
+ * Attribute type.
536
+ */
537
+ type: string;
538
+ /**
539
+ * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
540
+ */
541
+ status: string;
542
+ /**
543
+ * Is attribute required?
544
+ */
545
+ required: boolean;
546
+ /**
547
+ * Is attribute an array?
548
+ */
549
+ array?: boolean;
550
+ /**
551
+ * String format.
552
+ */
553
+ format: string;
554
+ /**
555
+ * Default value for attribute when not provided. Cannot be set when attribute is required.
556
+ */
557
+ xdefault?: string;
558
+ }
559
+ /**
560
+ * Index
561
+ */
562
+ export type Index = {
563
+ /**
564
+ * Index Key.
565
+ */
566
+ key: string;
567
+ /**
568
+ * Index type.
569
+ */
570
+ type: string;
571
+ /**
572
+ * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
573
+ */
574
+ status: string;
575
+ /**
576
+ * Index attributes.
577
+ */
578
+ attributes: string[];
579
+ /**
580
+ * Index orders.
581
+ */
582
+ orders: string[];
583
+ }
584
+ /**
585
+ * Document
586
+ */
587
+ export type Document = {
588
+ /**
589
+ * Document ID.
590
+ */
591
+ $id: string;
592
+ /**
593
+ * Collection ID.
594
+ */
595
+ $collection: string;
596
+ /**
597
+ * Document read permissions.
598
+ */
599
+ $read: string[];
600
+ /**
601
+ * Document write permissions.
602
+ */
603
+ $write: string[];
604
+ }
605
+ /**
606
+ * Log
607
+ */
608
+ export type Log = {
609
+ /**
610
+ * Event name.
611
+ */
612
+ event: string;
613
+ /**
614
+ * User ID.
615
+ */
616
+ userId: string;
617
+ /**
618
+ * User Email.
619
+ */
620
+ userEmail: string;
621
+ /**
622
+ * User Name.
623
+ */
624
+ userName: string;
625
+ /**
626
+ * API mode when event triggered.
627
+ */
628
+ mode: string;
629
+ /**
630
+ * IP session in use when the session was created.
631
+ */
632
+ ip: string;
633
+ /**
634
+ * Log creation time in Unix timestamp.
635
+ */
636
+ time: number;
637
+ /**
638
+ * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
639
+ */
640
+ osCode: string;
641
+ /**
642
+ * Operating system name.
643
+ */
644
+ osName: string;
645
+ /**
646
+ * Operating system version.
647
+ */
648
+ osVersion: string;
649
+ /**
650
+ * Client type.
651
+ */
652
+ clientType: string;
653
+ /**
654
+ * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
655
+ */
656
+ clientCode: string;
657
+ /**
658
+ * Client name.
659
+ */
660
+ clientName: string;
661
+ /**
662
+ * Client version.
663
+ */
664
+ clientVersion: string;
665
+ /**
666
+ * Client engine name.
667
+ */
668
+ clientEngine: string;
669
+ /**
670
+ * Client engine name.
671
+ */
672
+ clientEngineVersion: string;
673
+ /**
674
+ * Device name.
675
+ */
676
+ deviceName: string;
677
+ /**
678
+ * Device brand name.
679
+ */
680
+ deviceBrand: string;
681
+ /**
682
+ * Device model name.
683
+ */
684
+ deviceModel: string;
685
+ /**
686
+ * Country two-character ISO 3166-1 alpha code.
687
+ */
688
+ countryCode: string;
689
+ /**
690
+ * Country name.
691
+ */
692
+ countryName: string;
693
+ }
694
+ /**
695
+ * User
696
+ */
697
+ export type User<Preferences extends Models.Preferences> = {
698
+ /**
699
+ * User ID.
700
+ */
701
+ $id: string;
702
+ /**
703
+ * User name.
704
+ */
705
+ name: string;
706
+ /**
707
+ * User registration date in Unix timestamp.
708
+ */
709
+ registration: number;
710
+ /**
711
+ * User status. Pass `true` for enabled and `false` for disabled.
712
+ */
713
+ status: boolean;
714
+ /**
715
+ * Unix timestamp of the most recent password update
716
+ */
717
+ passwordUpdate: number;
718
+ /**
719
+ * User email address.
720
+ */
721
+ email: string;
722
+ /**
723
+ * Email verification status.
724
+ */
725
+ emailVerification: boolean;
726
+ /**
727
+ * User preferences as a key-value object
728
+ */
729
+ prefs: Preferences;
730
+ }
731
+ /**
732
+ * Preferences
733
+ */
734
+ export type Preferences = {
735
+ }
736
+ /**
737
+ * Session
738
+ */
739
+ export type Session = {
740
+ /**
741
+ * Session ID.
742
+ */
743
+ $id: string;
744
+ /**
745
+ * User ID.
746
+ */
747
+ userId: string;
748
+ /**
749
+ * Session expiration date in Unix timestamp.
750
+ */
751
+ expire: number;
752
+ /**
753
+ * Session Provider.
754
+ */
755
+ provider: string;
756
+ /**
757
+ * Session Provider User ID.
758
+ */
759
+ providerUid: string;
760
+ /**
761
+ * Session Provider Token.
762
+ */
763
+ providerToken: string;
764
+ /**
765
+ * IP in use when the session was created.
766
+ */
767
+ ip: string;
768
+ /**
769
+ * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
770
+ */
771
+ osCode: string;
772
+ /**
773
+ * Operating system name.
774
+ */
775
+ osName: string;
776
+ /**
777
+ * Operating system version.
778
+ */
779
+ osVersion: string;
780
+ /**
781
+ * Client type.
782
+ */
783
+ clientType: string;
784
+ /**
785
+ * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
786
+ */
787
+ clientCode: string;
788
+ /**
789
+ * Client name.
790
+ */
791
+ clientName: string;
792
+ /**
793
+ * Client version.
794
+ */
795
+ clientVersion: string;
796
+ /**
797
+ * Client engine name.
798
+ */
799
+ clientEngine: string;
800
+ /**
801
+ * Client engine name.
802
+ */
803
+ clientEngineVersion: string;
804
+ /**
805
+ * Device name.
806
+ */
807
+ deviceName: string;
808
+ /**
809
+ * Device brand name.
810
+ */
811
+ deviceBrand: string;
812
+ /**
813
+ * Device model name.
814
+ */
815
+ deviceModel: string;
816
+ /**
817
+ * Country two-character ISO 3166-1 alpha code.
818
+ */
819
+ countryCode: string;
820
+ /**
821
+ * Country name.
822
+ */
823
+ countryName: string;
824
+ /**
825
+ * Returns true if this the current user session.
826
+ */
827
+ current: boolean;
828
+ }
829
+ /**
830
+ * Token
831
+ */
832
+ export type Token = {
833
+ /**
834
+ * Token ID.
835
+ */
836
+ $id: string;
837
+ /**
838
+ * User ID.
839
+ */
840
+ userId: string;
841
+ /**
842
+ * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
843
+ */
844
+ secret: string;
845
+ /**
846
+ * Token expiration date in Unix timestamp.
847
+ */
848
+ expire: number;
849
+ }
850
+ /**
851
+ * Locale
852
+ */
853
+ export type Locale = {
854
+ /**
855
+ * User IP address.
856
+ */
857
+ ip: string;
858
+ /**
859
+ * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format
860
+ */
861
+ countryCode: string;
862
+ /**
863
+ * Country name. This field support localization.
864
+ */
865
+ country: string;
866
+ /**
867
+ * Continent code. A two character continent code &quot;AF&quot; for Africa, &quot;AN&quot; for Antarctica, &quot;AS&quot; for Asia, &quot;EU&quot; for Europe, &quot;NA&quot; for North America, &quot;OC&quot; for Oceania, and &quot;SA&quot; for South America.
868
+ */
869
+ continentCode: string;
870
+ /**
871
+ * Continent name. This field support localization.
872
+ */
873
+ continent: string;
874
+ /**
875
+ * True if country is part of the Europian Union.
876
+ */
877
+ eu: boolean;
878
+ /**
879
+ * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format
880
+ */
881
+ currency: string;
882
+ }
883
+ /**
884
+ * File
885
+ */
886
+ export type File = {
887
+ /**
888
+ * File ID.
889
+ */
890
+ $id: string;
891
+ /**
892
+ * File read permissions.
893
+ */
894
+ $read: string[];
895
+ /**
896
+ * File write permissions.
897
+ */
898
+ $write: string[];
899
+ /**
900
+ * File name.
901
+ */
902
+ name: string;
903
+ /**
904
+ * File creation date in Unix timestamp.
905
+ */
906
+ dateCreated: number;
907
+ /**
908
+ * File MD5 signature.
909
+ */
910
+ signature: string;
911
+ /**
912
+ * File mime type.
913
+ */
914
+ mimeType: string;
915
+ /**
916
+ * File original size in bytes.
917
+ */
918
+ sizeOriginal: number;
919
+ }
920
+ /**
921
+ * Team
922
+ */
923
+ export type Team = {
924
+ /**
925
+ * Team ID.
926
+ */
927
+ $id: string;
928
+ /**
929
+ * Team name.
930
+ */
931
+ name: string;
932
+ /**
933
+ * Team creation date in Unix timestamp.
934
+ */
935
+ dateCreated: number;
936
+ /**
937
+ * Total sum of team members.
938
+ */
939
+ sum: number;
940
+ }
941
+ /**
942
+ * Membership
943
+ */
944
+ export type Membership = {
945
+ /**
946
+ * Membership ID.
947
+ */
948
+ $id: string;
949
+ /**
950
+ * User ID.
951
+ */
952
+ userId: string;
953
+ /**
954
+ * Team ID.
955
+ */
956
+ teamId: string;
957
+ /**
958
+ * User name.
959
+ */
960
+ name: string;
961
+ /**
962
+ * User email address.
963
+ */
964
+ email: string;
965
+ /**
966
+ * Date, the user has been invited to join the team in Unix timestamp.
967
+ */
968
+ invited: number;
969
+ /**
970
+ * Date, the user has accepted the invitation to join the team in Unix timestamp.
971
+ */
972
+ joined: number;
973
+ /**
974
+ * User confirmation status, true if the user has joined the team or false otherwise.
975
+ */
976
+ confirm: boolean;
977
+ /**
978
+ * User list of roles
979
+ */
980
+ roles: string[];
981
+ }
982
+ /**
983
+ * Function
984
+ */
985
+ export type Function = {
986
+ /**
987
+ * Function ID.
988
+ */
989
+ $id: string;
990
+ /**
991
+ * Execution permissions.
992
+ */
993
+ execute: string;
994
+ /**
995
+ * Function name.
996
+ */
997
+ name: string;
998
+ /**
999
+ * Function creation date in Unix timestamp.
1000
+ */
1001
+ dateCreated: number;
1002
+ /**
1003
+ * Function update date in Unix timestamp.
1004
+ */
1005
+ dateUpdated: number;
1006
+ /**
1007
+ * Function status. Possible values: `disabled`, `enabled`
1008
+ */
1009
+ status: string;
1010
+ /**
1011
+ * Function execution runtime.
1012
+ */
1013
+ runtime: string;
1014
+ /**
1015
+ * Function active tag ID.
1016
+ */
1017
+ tag: string;
1018
+ /**
1019
+ * Function environment variables.
1020
+ */
1021
+ vars: string;
1022
+ /**
1023
+ * Function trigger events.
1024
+ */
1025
+ events: string[];
1026
+ /**
1027
+ * Function execution schedult in CRON format.
1028
+ */
1029
+ schedule: string;
1030
+ /**
1031
+ * Function next scheduled execution date in Unix timestamp.
1032
+ */
1033
+ scheduleNext: number;
1034
+ /**
1035
+ * Function next scheduled execution date in Unix timestamp.
1036
+ */
1037
+ schedulePrevious: number;
1038
+ /**
1039
+ * Function execution timeout in seconds.
1040
+ */
1041
+ timeout: number;
1042
+ }
1043
+ /**
1044
+ * Runtime
1045
+ */
1046
+ export type Runtime = {
1047
+ /**
1048
+ * Runtime ID.
1049
+ */
1050
+ $id: string;
1051
+ /**
1052
+ * Runtime Name.
1053
+ */
1054
+ name: string;
1055
+ /**
1056
+ * Runtime version.
1057
+ */
1058
+ version: string;
1059
+ /**
1060
+ * Base Docker image used to build the runtime.
1061
+ */
1062
+ base: string;
1063
+ /**
1064
+ * Image name of Docker Hub.
1065
+ */
1066
+ image: string;
1067
+ /**
1068
+ * Name of the logo image.
1069
+ */
1070
+ logo: string;
1071
+ /**
1072
+ * List of supported architectures.
1073
+ */
1074
+ supports: string[];
1075
+ }
1076
+ /**
1077
+ * Tag
1078
+ */
1079
+ export type Tag = {
1080
+ /**
1081
+ * Tag ID.
1082
+ */
1083
+ $id: string;
1084
+ /**
1085
+ * Function ID.
1086
+ */
1087
+ functionId: string;
1088
+ /**
1089
+ * The tag creation date in Unix timestamp.
1090
+ */
1091
+ dateCreated: number;
1092
+ /**
1093
+ * The entrypoint command in use to execute the tag code.
1094
+ */
1095
+ command: string;
1096
+ /**
1097
+ * The code size in bytes.
1098
+ */
1099
+ size: string;
1100
+ }
1101
+ /**
1102
+ * Execution
1103
+ */
1104
+ export type Execution = {
1105
+ /**
1106
+ * Execution ID.
1107
+ */
1108
+ $id: string;
1109
+ /**
1110
+ * Execution read permissions.
1111
+ */
1112
+ $read: string[];
1113
+ /**
1114
+ * Function ID.
1115
+ */
1116
+ functionId: string;
1117
+ /**
1118
+ * The execution creation date in Unix timestamp.
1119
+ */
1120
+ dateCreated: number;
1121
+ /**
1122
+ * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
1123
+ */
1124
+ trigger: string;
1125
+ /**
1126
+ * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.
1127
+ */
1128
+ status: string;
1129
+ /**
1130
+ * The script exit code.
1131
+ */
1132
+ exitCode: number;
1133
+ /**
1134
+ * The script stdout output string. Logs the last 4,000 characters of the execution stdout output.
1135
+ */
1136
+ stdout: string;
1137
+ /**
1138
+ * The script stderr output string. Logs the last 4,000 characters of the execution stderr output
1139
+ */
1140
+ stderr: string;
1141
+ /**
1142
+ * The script execution time in seconds.
1143
+ */
1144
+ time: number;
1145
+ }
1146
+ /**
1147
+ * Country
1148
+ */
1149
+ export type Country = {
1150
+ /**
1151
+ * Country name.
1152
+ */
1153
+ name: string;
1154
+ /**
1155
+ * Country two-character ISO 3166-1 alpha code.
1156
+ */
1157
+ code: string;
1158
+ }
1159
+ /**
1160
+ * Continent
1161
+ */
1162
+ export type Continent = {
1163
+ /**
1164
+ * Continent name.
1165
+ */
1166
+ name: string;
1167
+ /**
1168
+ * Continent two letter code.
1169
+ */
1170
+ code: string;
1171
+ }
1172
+ /**
1173
+ * Language
1174
+ */
1175
+ export type Language = {
1176
+ /**
1177
+ * Language name.
1178
+ */
1179
+ name: string;
1180
+ /**
1181
+ * Language two-character ISO 639-1 codes.
1182
+ */
1183
+ code: string;
1184
+ /**
1185
+ * Language native name.
1186
+ */
1187
+ nativeName: string;
1188
+ }
1189
+ /**
1190
+ * Currency
1191
+ */
1192
+ export type Currency = {
1193
+ /**
1194
+ * Currency symbol.
1195
+ */
1196
+ symbol: string;
1197
+ /**
1198
+ * Currency name.
1199
+ */
1200
+ name: string;
1201
+ /**
1202
+ * Currency native symbol.
1203
+ */
1204
+ symbolNative: string;
1205
+ /**
1206
+ * Number of decimal digits.
1207
+ */
1208
+ decimalDigits: number;
1209
+ /**
1210
+ * Currency digit rounding.
1211
+ */
1212
+ rounding: number;
1213
+ /**
1214
+ * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.
1215
+ */
1216
+ code: string;
1217
+ /**
1218
+ * Currency plural name
1219
+ */
1220
+ namePlural: string;
1221
+ }
1222
+ /**
1223
+ * Phone
1224
+ */
1225
+ export type Phone = {
1226
+ /**
1227
+ * Phone code.
1228
+ */
1229
+ code: string;
1230
+ /**
1231
+ * Country two-character ISO 3166-1 alpha code.
1232
+ */
1233
+ countryCode: string;
1234
+ /**
1235
+ * Country name.
1236
+ */
1237
+ countryName: string;
1238
+ }
1239
+ /**
1240
+ * Health Antivirus
1241
+ */
1242
+ export type HealthAntivirus = {
1243
+ /**
1244
+ * Antivirus version.
1245
+ */
1246
+ version: string;
1247
+ /**
1248
+ * Antivirus status. Possible values can are: `disabled`, `offline`, `online`
1249
+ */
1250
+ status: string;
1251
+ }
1252
+ /**
1253
+ * Health Queue
1254
+ */
1255
+ export type HealthQueue = {
1256
+ /**
1257
+ * Amount of actions in the queue.
1258
+ */
1259
+ size: number;
1260
+ }
1261
+ /**
1262
+ * Health Status
1263
+ */
1264
+ export type HealthStatus = {
1265
+ /**
1266
+ * Duration in milliseconds how long the health check took.
1267
+ */
1268
+ ping: number;
1269
+ /**
1270
+ * Service status. Possible values can are: `pass`, `fail`
1271
+ */
1272
+ status: string;
1273
+ }
1274
+ /**
1275
+ * Health Time
1276
+ */
1277
+ export type HealthTime = {
1278
+ /**
1279
+ * Current unix timestamp on trustful remote server.
1280
+ */
1281
+ remoteTime: number;
1282
+ /**
1283
+ * Current unix timestamp of local server where Appwrite runs.
1284
+ */
1285
+ localTime: number;
1286
+ /**
1287
+ * Difference of unix remote and local timestamps in milliseconds.
1288
+ */
1289
+ diff: number;
1290
+ }
1291
+ }
2
1292
  export class Client {
3
1293
  /**
4
1294
  * Set endpoint.
@@ -73,7 +1363,6 @@ declare module "node-appwrite" {
73
1363
  }
74
1364
 
75
1365
  export class Account extends Service {
76
-
77
1366
  /**
78
1367
  * Get Account
79
1368
  *
@@ -82,8 +1371,7 @@ declare module "node-appwrite" {
82
1371
  * @throws {AppwriteException}
83
1372
  * @returns {Promise}
84
1373
  */
85
- get<T extends unknown>(): Promise<T>;
86
-
1374
+ get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
87
1375
  /**
88
1376
  * Delete Account
89
1377
  *
@@ -96,36 +1384,37 @@ declare module "node-appwrite" {
96
1384
  * @throws {AppwriteException}
97
1385
  * @returns {Promise}
98
1386
  */
99
- delete<T extends unknown>(): Promise<T>;
100
-
1387
+ delete(): Promise<Response>;
101
1388
  /**
102
1389
  * Update Account Email
103
1390
  *
104
1391
  * Update currently logged in user account email address. After changing user
105
- * address, user confirmation status is being reset and a new confirmation
106
- * mail is sent. For security measures, user password is required to complete
107
- * this request.
1392
+ * address, the user confirmation status will get reset. A new confirmation
1393
+ * email is not sent automatically however you can use the send confirmation
1394
+ * email endpoint again to send the confirmation email. For security measures,
1395
+ * user password is required to complete this request.
108
1396
  * This endpoint can also be used to convert an anonymous account to a normal
109
1397
  * one, by passing an email address and a new password.
1398
+ *
110
1399
  *
111
1400
  * @param {string} email
112
1401
  * @param {string} password
113
1402
  * @throws {AppwriteException}
114
1403
  * @returns {Promise}
115
1404
  */
116
- updateEmail<T extends unknown>(email: string, password: string): Promise<T>;
117
-
1405
+ updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
118
1406
  /**
119
1407
  * Get Account Logs
120
1408
  *
121
1409
  * Get currently logged in user list of latest security activity logs. Each
122
1410
  * log returns user IP address, location and date and time of log.
123
1411
  *
1412
+ * @param {number} limit
1413
+ * @param {number} offset
124
1414
  * @throws {AppwriteException}
125
1415
  * @returns {Promise}
126
1416
  */
127
- getLogs<T extends unknown>(): Promise<T>;
128
-
1417
+ getLogs(limit?: number, offset?: number): Promise<Models.LogList>;
129
1418
  /**
130
1419
  * Update Account Name
131
1420
  *
@@ -135,8 +1424,7 @@ declare module "node-appwrite" {
135
1424
  * @throws {AppwriteException}
136
1425
  * @returns {Promise}
137
1426
  */
138
- updateName<T extends unknown>(name: string): Promise<T>;
139
-
1427
+ updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
140
1428
  /**
141
1429
  * Update Account Password
142
1430
  *
@@ -149,8 +1437,7 @@ declare module "node-appwrite" {
149
1437
  * @throws {AppwriteException}
150
1438
  * @returns {Promise}
151
1439
  */
152
- updatePassword<T extends unknown>(password: string, oldPassword?: string): Promise<T>;
153
-
1440
+ updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
154
1441
  /**
155
1442
  * Get Account Preferences
156
1443
  *
@@ -159,20 +1446,19 @@ declare module "node-appwrite" {
159
1446
  * @throws {AppwriteException}
160
1447
  * @returns {Promise}
161
1448
  */
162
- getPrefs<T extends unknown>(): Promise<T>;
163
-
1449
+ getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
164
1450
  /**
165
1451
  * Update Account Preferences
166
1452
  *
167
- * Update currently logged in user account preferences. You can pass only the
168
- * specific settings you wish to update.
1453
+ * Update currently logged in user account preferences. The object you pass is
1454
+ * stored as is, and replaces any previous value. The maximum allowed prefs
1455
+ * size is 64kB and throws error if exceeded.
169
1456
  *
170
1457
  * @param {object} prefs
171
1458
  * @throws {AppwriteException}
172
1459
  * @returns {Promise}
173
1460
  */
174
- updatePrefs<T extends unknown>(prefs: object): Promise<T>;
175
-
1461
+ updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.User<Preferences>>;
176
1462
  /**
177
1463
  * Create Password Recovery
178
1464
  *
@@ -190,8 +1476,7 @@ declare module "node-appwrite" {
190
1476
  * @throws {AppwriteException}
191
1477
  * @returns {Promise}
192
1478
  */
193
- createRecovery<T extends unknown>(email: string, url: string): Promise<T>;
194
-
1479
+ createRecovery(email: string, url: string): Promise<Models.Token>;
195
1480
  /**
196
1481
  * Create Password Recovery (confirmation)
197
1482
  *
@@ -212,8 +1497,7 @@ declare module "node-appwrite" {
212
1497
  * @throws {AppwriteException}
213
1498
  * @returns {Promise}
214
1499
  */
215
- updateRecovery<T extends unknown>(userId: string, secret: string, password: string, passwordAgain: string): Promise<T>;
216
-
1500
+ updateRecovery(userId: string, secret: string, password: string, passwordAgain: string): Promise<Models.Token>;
217
1501
  /**
218
1502
  * Get Account Sessions
219
1503
  *
@@ -223,8 +1507,7 @@ declare module "node-appwrite" {
223
1507
  * @throws {AppwriteException}
224
1508
  * @returns {Promise}
225
1509
  */
226
- getSessions<T extends unknown>(): Promise<T>;
227
-
1510
+ getSessions(): Promise<Models.SessionList>;
228
1511
  /**
229
1512
  * Delete All Account Sessions
230
1513
  *
@@ -234,8 +1517,7 @@ declare module "node-appwrite" {
234
1517
  * @throws {AppwriteException}
235
1518
  * @returns {Promise}
236
1519
  */
237
- deleteSessions<T extends unknown>(): Promise<T>;
238
-
1520
+ deleteSessions(): Promise<Response>;
239
1521
  /**
240
1522
  * Get Session By ID
241
1523
  *
@@ -246,8 +1528,7 @@ declare module "node-appwrite" {
246
1528
  * @throws {AppwriteException}
247
1529
  * @returns {Promise}
248
1530
  */
249
- getSession<T extends unknown>(sessionId: string): Promise<T>;
250
-
1531
+ getSession(sessionId: string): Promise<Models.Session>;
251
1532
  /**
252
1533
  * Delete Account Session
253
1534
  *
@@ -259,8 +1540,7 @@ declare module "node-appwrite" {
259
1540
  * @throws {AppwriteException}
260
1541
  * @returns {Promise}
261
1542
  */
262
- deleteSession<T extends unknown>(sessionId: string): Promise<T>;
263
-
1543
+ deleteSession(sessionId: string): Promise<Response>;
264
1544
  /**
265
1545
  * Create Email Verification
266
1546
  *
@@ -284,8 +1564,7 @@ declare module "node-appwrite" {
284
1564
  * @throws {AppwriteException}
285
1565
  * @returns {Promise}
286
1566
  */
287
- createVerification<T extends unknown>(url: string): Promise<T>;
288
-
1567
+ createVerification(url: string): Promise<Models.Token>;
289
1568
  /**
290
1569
  * Create Email Verification (confirmation)
291
1570
  *
@@ -299,10 +1578,9 @@ declare module "node-appwrite" {
299
1578
  * @throws {AppwriteException}
300
1579
  * @returns {Promise}
301
1580
  */
302
- updateVerification<T extends unknown>(userId: string, secret: string): Promise<T>;
1581
+ updateVerification(userId: string, secret: string): Promise<Models.Token>;
303
1582
  }
304
1583
  export class Avatars extends Service {
305
-
306
1584
  /**
307
1585
  * Get Browser Icon
308
1586
  *
@@ -319,7 +1597,6 @@ declare module "node-appwrite" {
319
1597
  * @returns {Promise}
320
1598
  */
321
1599
  getBrowser(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
322
-
323
1600
  /**
324
1601
  * Get Credit Card Icon
325
1602
  *
@@ -335,7 +1612,6 @@ declare module "node-appwrite" {
335
1612
  * @returns {Promise}
336
1613
  */
337
1614
  getCreditCard(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
338
-
339
1615
  /**
340
1616
  * Get Favicon
341
1617
  *
@@ -348,7 +1624,6 @@ declare module "node-appwrite" {
348
1624
  * @returns {Promise}
349
1625
  */
350
1626
  getFavicon(url: string): Promise<Buffer>;
351
-
352
1627
  /**
353
1628
  * Get Country Flag
354
1629
  *
@@ -364,7 +1639,6 @@ declare module "node-appwrite" {
364
1639
  * @returns {Promise}
365
1640
  */
366
1641
  getFlag(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
367
-
368
1642
  /**
369
1643
  * Get Image from URL
370
1644
  *
@@ -380,7 +1654,6 @@ declare module "node-appwrite" {
380
1654
  * @returns {Promise}
381
1655
  */
382
1656
  getImage(url: string, width?: number, height?: number): Promise<Buffer>;
383
-
384
1657
  /**
385
1658
  * Get User Initials
386
1659
  *
@@ -404,7 +1677,6 @@ declare module "node-appwrite" {
404
1677
  * @returns {Promise}
405
1678
  */
406
1679
  getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): Promise<Buffer>;
407
-
408
1680
  /**
409
1681
  * Get QR Code
410
1682
  *
@@ -421,7 +1693,6 @@ declare module "node-appwrite" {
421
1693
  getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
422
1694
  }
423
1695
  export class Database extends Service {
424
-
425
1696
  /**
426
1697
  * List Collections
427
1698
  *
@@ -433,26 +1704,27 @@ declare module "node-appwrite" {
433
1704
  * @param {string} search
434
1705
  * @param {number} limit
435
1706
  * @param {number} offset
1707
+ * @param {string} cursor
1708
+ * @param {string} cursorDirection
436
1709
  * @param {string} orderType
437
1710
  * @throws {AppwriteException}
438
1711
  * @returns {Promise}
439
1712
  */
440
- listCollections<T extends unknown>(search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
441
-
1713
+ listCollections(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList>;
442
1714
  /**
443
1715
  * Create Collection
444
1716
  *
445
1717
  * Create a new Collection.
446
1718
  *
1719
+ * @param {string} collectionId
447
1720
  * @param {string} name
1721
+ * @param {string} permission
448
1722
  * @param {string[]} read
449
1723
  * @param {string[]} write
450
- * @param {string[]} rules
451
1724
  * @throws {AppwriteException}
452
1725
  * @returns {Promise}
453
1726
  */
454
- createCollection<T extends unknown>(name: string, read: string[], write: string[], rules: string[]): Promise<T>;
455
-
1727
+ createCollection(collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection>;
456
1728
  /**
457
1729
  * Get Collection
458
1730
  *
@@ -463,8 +1735,7 @@ declare module "node-appwrite" {
463
1735
  * @throws {AppwriteException}
464
1736
  * @returns {Promise}
465
1737
  */
466
- getCollection<T extends unknown>(collectionId: string): Promise<T>;
467
-
1738
+ getCollection(collectionId: string): Promise<Models.Collection>;
468
1739
  /**
469
1740
  * Update Collection
470
1741
  *
@@ -472,14 +1743,14 @@ declare module "node-appwrite" {
472
1743
  *
473
1744
  * @param {string} collectionId
474
1745
  * @param {string} name
1746
+ * @param {string} permission
475
1747
  * @param {string[]} read
476
1748
  * @param {string[]} write
477
- * @param {string[]} rules
1749
+ * @param {boolean} enabled
478
1750
  * @throws {AppwriteException}
479
1751
  * @returns {Promise}
480
1752
  */
481
- updateCollection<T extends unknown>(collectionId: string, name: string, read?: string[], write?: string[], rules?: string[]): Promise<T>;
482
-
1753
+ updateCollection(collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection>;
483
1754
  /**
484
1755
  * Delete Collection
485
1756
  *
@@ -490,8 +1761,158 @@ declare module "node-appwrite" {
490
1761
  * @throws {AppwriteException}
491
1762
  * @returns {Promise}
492
1763
  */
493
- deleteCollection<T extends unknown>(collectionId: string): Promise<T>;
494
-
1764
+ deleteCollection(collectionId: string): Promise<Response>;
1765
+ /**
1766
+ * List Attributes
1767
+ *
1768
+ * @param {string} collectionId
1769
+ * @throws {AppwriteException}
1770
+ * @returns {Promise}
1771
+ */
1772
+ listAttributes(collectionId: string): Promise<Models.AttributeList>;
1773
+ /**
1774
+ * Create Boolean Attribute
1775
+ *
1776
+ * Create a boolean attribute.
1777
+ *
1778
+ *
1779
+ * @param {string} collectionId
1780
+ * @param {string} key
1781
+ * @param {boolean} required
1782
+ * @param {boolean} default
1783
+ * @param {boolean} array
1784
+ * @throws {AppwriteException}
1785
+ * @returns {Promise}
1786
+ */
1787
+ createBooleanAttribute(collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>;
1788
+ /**
1789
+ * Create Email Attribute
1790
+ *
1791
+ * Create an email attribute.
1792
+ *
1793
+ *
1794
+ * @param {string} collectionId
1795
+ * @param {string} key
1796
+ * @param {boolean} required
1797
+ * @param {string} default
1798
+ * @param {boolean} array
1799
+ * @throws {AppwriteException}
1800
+ * @returns {Promise}
1801
+ */
1802
+ createEmailAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
1803
+ /**
1804
+ * Create Enum Attribute
1805
+ *
1806
+ * @param {string} collectionId
1807
+ * @param {string} key
1808
+ * @param {string[]} elements
1809
+ * @param {boolean} required
1810
+ * @param {string} default
1811
+ * @param {boolean} array
1812
+ * @throws {AppwriteException}
1813
+ * @returns {Promise}
1814
+ */
1815
+ createEnumAttribute(collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
1816
+ /**
1817
+ * Create Float Attribute
1818
+ *
1819
+ * Create a float attribute. Optionally, minimum and maximum values can be
1820
+ * provided.
1821
+ *
1822
+ *
1823
+ * @param {string} collectionId
1824
+ * @param {string} key
1825
+ * @param {boolean} required
1826
+ * @param {string} min
1827
+ * @param {string} max
1828
+ * @param {string} default
1829
+ * @param {boolean} array
1830
+ * @throws {AppwriteException}
1831
+ * @returns {Promise}
1832
+ */
1833
+ createFloatAttribute(collectionId: string, key: string, required: boolean, min?: string, max?: string, xdefault?: string, array?: boolean): Promise<Models.AttributeFloat>;
1834
+ /**
1835
+ * Create Integer Attribute
1836
+ *
1837
+ * Create an integer attribute. Optionally, minimum and maximum values can be
1838
+ * provided.
1839
+ *
1840
+ *
1841
+ * @param {string} collectionId
1842
+ * @param {string} key
1843
+ * @param {boolean} required
1844
+ * @param {number} min
1845
+ * @param {number} max
1846
+ * @param {number} default
1847
+ * @param {boolean} array
1848
+ * @throws {AppwriteException}
1849
+ * @returns {Promise}
1850
+ */
1851
+ createIntegerAttribute(collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
1852
+ /**
1853
+ * Create IP Address Attribute
1854
+ *
1855
+ * Create IP address attribute.
1856
+ *
1857
+ *
1858
+ * @param {string} collectionId
1859
+ * @param {string} key
1860
+ * @param {boolean} required
1861
+ * @param {string} default
1862
+ * @param {boolean} array
1863
+ * @throws {AppwriteException}
1864
+ * @returns {Promise}
1865
+ */
1866
+ createIpAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
1867
+ /**
1868
+ * Create String Attribute
1869
+ *
1870
+ * Create a string attribute.
1871
+ *
1872
+ *
1873
+ * @param {string} collectionId
1874
+ * @param {string} key
1875
+ * @param {number} size
1876
+ * @param {boolean} required
1877
+ * @param {string} default
1878
+ * @param {boolean} array
1879
+ * @throws {AppwriteException}
1880
+ * @returns {Promise}
1881
+ */
1882
+ createStringAttribute(collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeString>;
1883
+ /**
1884
+ * Create URL Attribute
1885
+ *
1886
+ * Create a URL attribute.
1887
+ *
1888
+ *
1889
+ * @param {string} collectionId
1890
+ * @param {string} key
1891
+ * @param {boolean} required
1892
+ * @param {string} default
1893
+ * @param {boolean} array
1894
+ * @throws {AppwriteException}
1895
+ * @returns {Promise}
1896
+ */
1897
+ createUrlAttribute(collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
1898
+ /**
1899
+ * Get Attribute
1900
+ *
1901
+ * @param {string} collectionId
1902
+ * @param {string} key
1903
+ * @throws {AppwriteException}
1904
+ * @returns {Promise}
1905
+ */
1906
+ getAttribute(collectionId: string, key: string): Promise<Response>;
1907
+ /**
1908
+ * Delete Attribute
1909
+ *
1910
+ * @param {string} collectionId
1911
+ * @param {string} key
1912
+ * @throws {AppwriteException}
1913
+ * @returns {Promise}
1914
+ */
1915
+ deleteAttribute(collectionId: string, key: string): Promise<Response>;
495
1916
  /**
496
1917
  * List Documents
497
1918
  *
@@ -501,18 +1922,17 @@ declare module "node-appwrite" {
501
1922
  * modes](/docs/admin).
502
1923
  *
503
1924
  * @param {string} collectionId
504
- * @param {string[]} filters
1925
+ * @param {string[]} queries
505
1926
  * @param {number} limit
506
1927
  * @param {number} offset
507
- * @param {string} orderField
508
- * @param {string} orderType
509
- * @param {string} orderCast
510
- * @param {string} search
1928
+ * @param {string} cursor
1929
+ * @param {string} cursorDirection
1930
+ * @param {string[]} orderAttributes
1931
+ * @param {string[]} orderTypes
511
1932
  * @throws {AppwriteException}
512
1933
  * @returns {Promise}
513
1934
  */
514
- listDocuments<T extends unknown>(collectionId: string, filters?: string[], limit?: number, offset?: number, orderField?: string, orderType?: string, orderCast?: string, search?: string): Promise<T>;
515
-
1935
+ 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>>;
516
1936
  /**
517
1937
  * Create Document
518
1938
  *
@@ -522,17 +1942,14 @@ declare module "node-appwrite" {
522
1942
  * directly from your database console.
523
1943
  *
524
1944
  * @param {string} collectionId
1945
+ * @param {string} documentId
525
1946
  * @param {object} data
526
1947
  * @param {string[]} read
527
1948
  * @param {string[]} write
528
- * @param {string} parentDocument
529
- * @param {string} parentProperty
530
- * @param {string} parentPropertyType
531
1949
  * @throws {AppwriteException}
532
1950
  * @returns {Promise}
533
1951
  */
534
- createDocument<T extends unknown>(collectionId: string, data: object, read?: string[], write?: string[], parentDocument?: string, parentProperty?: string, parentPropertyType?: string): Promise<T>;
535
-
1952
+ createDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
536
1953
  /**
537
1954
  * Get Document
538
1955
  *
@@ -544,8 +1961,7 @@ declare module "node-appwrite" {
544
1961
  * @throws {AppwriteException}
545
1962
  * @returns {Promise}
546
1963
  */
547
- getDocument<T extends unknown>(collectionId: string, documentId: string): Promise<T>;
548
-
1964
+ getDocument<Document extends Models.Document>(collectionId: string, documentId: string): Promise<Document>;
549
1965
  /**
550
1966
  * Update Document
551
1967
  *
@@ -560,8 +1976,7 @@ declare module "node-appwrite" {
560
1976
  * @throws {AppwriteException}
561
1977
  * @returns {Promise}
562
1978
  */
563
- updateDocument<T extends unknown>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<T>;
564
-
1979
+ updateDocument<Document extends Models.Document>(collectionId: string, documentId: string, data: object, read?: string[], write?: string[]): Promise<Document>;
565
1980
  /**
566
1981
  * Delete Document
567
1982
  *
@@ -574,10 +1989,47 @@ declare module "node-appwrite" {
574
1989
  * @throws {AppwriteException}
575
1990
  * @returns {Promise}
576
1991
  */
577
- deleteDocument<T extends unknown>(collectionId: string, documentId: string): Promise<T>;
1992
+ deleteDocument(collectionId: string, documentId: string): Promise<Response>;
1993
+ /**
1994
+ * List Indexes
1995
+ *
1996
+ * @param {string} collectionId
1997
+ * @throws {AppwriteException}
1998
+ * @returns {Promise}
1999
+ */
2000
+ listIndexes(collectionId: string): Promise<Models.IndexList>;
2001
+ /**
2002
+ * Create Index
2003
+ *
2004
+ * @param {string} collectionId
2005
+ * @param {string} key
2006
+ * @param {string} type
2007
+ * @param {string[]} attributes
2008
+ * @param {string[]} orders
2009
+ * @throws {AppwriteException}
2010
+ * @returns {Promise}
2011
+ */
2012
+ createIndex(collectionId: string, key: string, type: string, attributes: string[], orders?: string[]): Promise<Models.Index>;
2013
+ /**
2014
+ * Get Index
2015
+ *
2016
+ * @param {string} collectionId
2017
+ * @param {string} key
2018
+ * @throws {AppwriteException}
2019
+ * @returns {Promise}
2020
+ */
2021
+ getIndex(collectionId: string, key: string): Promise<Models.Index>;
2022
+ /**
2023
+ * Delete Index
2024
+ *
2025
+ * @param {string} collectionId
2026
+ * @param {string} key
2027
+ * @throws {AppwriteException}
2028
+ * @returns {Promise}
2029
+ */
2030
+ deleteIndex(collectionId: string, key: string): Promise<Response>;
578
2031
  }
579
2032
  export class Functions extends Service {
580
-
581
2033
  /**
582
2034
  * List Functions
583
2035
  *
@@ -587,12 +2039,13 @@ declare module "node-appwrite" {
587
2039
  * @param {string} search
588
2040
  * @param {number} limit
589
2041
  * @param {number} offset
2042
+ * @param {string} cursor
2043
+ * @param {string} cursorDirection
590
2044
  * @param {string} orderType
591
2045
  * @throws {AppwriteException}
592
2046
  * @returns {Promise}
593
2047
  */
594
- list<T extends unknown>(search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
595
-
2048
+ list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FunctionList>;
596
2049
  /**
597
2050
  * Create Function
598
2051
  *
@@ -600,6 +2053,7 @@ declare module "node-appwrite" {
600
2053
  * [permissions](/docs/permissions) to allow different project users or team
601
2054
  * with access to execute the function using the client API.
602
2055
  *
2056
+ * @param {string} functionId
603
2057
  * @param {string} name
604
2058
  * @param {string[]} execute
605
2059
  * @param {string} runtime
@@ -610,8 +2064,16 @@ declare module "node-appwrite" {
610
2064
  * @throws {AppwriteException}
611
2065
  * @returns {Promise}
612
2066
  */
613
- create<T extends unknown>(name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<T>;
614
-
2067
+ create(functionId: string, name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>;
2068
+ /**
2069
+ * List the currently active function runtimes.
2070
+ *
2071
+ * Get a list of all runtimes that are currently active in your project.
2072
+ *
2073
+ * @throws {AppwriteException}
2074
+ * @returns {Promise}
2075
+ */
2076
+ listRuntimes(): Promise<Models.RuntimeList>;
615
2077
  /**
616
2078
  * Get Function
617
2079
  *
@@ -621,8 +2083,7 @@ declare module "node-appwrite" {
621
2083
  * @throws {AppwriteException}
622
2084
  * @returns {Promise}
623
2085
  */
624
- get<T extends unknown>(functionId: string): Promise<T>;
625
-
2086
+ get(functionId: string): Promise<Models.Function>;
626
2087
  /**
627
2088
  * Update Function
628
2089
  *
@@ -638,8 +2099,7 @@ declare module "node-appwrite" {
638
2099
  * @throws {AppwriteException}
639
2100
  * @returns {Promise}
640
2101
  */
641
- update<T extends unknown>(functionId: string, name: string, execute: string[], vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<T>;
642
-
2102
+ update(functionId: string, name: string, execute: string[], vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>;
643
2103
  /**
644
2104
  * Delete Function
645
2105
  *
@@ -649,8 +2109,7 @@ declare module "node-appwrite" {
649
2109
  * @throws {AppwriteException}
650
2110
  * @returns {Promise}
651
2111
  */
652
- delete<T extends unknown>(functionId: string): Promise<T>;
653
-
2112
+ delete(functionId: string): Promise<Response>;
654
2113
  /**
655
2114
  * List Executions
656
2115
  *
@@ -660,15 +2119,15 @@ declare module "node-appwrite" {
660
2119
  * different API modes](/docs/admin).
661
2120
  *
662
2121
  * @param {string} functionId
663
- * @param {string} search
664
2122
  * @param {number} limit
665
2123
  * @param {number} offset
666
- * @param {string} orderType
2124
+ * @param {string} search
2125
+ * @param {string} cursor
2126
+ * @param {string} cursorDirection
667
2127
  * @throws {AppwriteException}
668
2128
  * @returns {Promise}
669
2129
  */
670
- listExecutions<T extends unknown>(functionId: string, search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
671
-
2130
+ listExecutions(functionId: string, limit?: number, offset?: number, search?: string, cursor?: string, cursorDirection?: string): Promise<Models.ExecutionList>;
672
2131
  /**
673
2132
  * Create Execution
674
2133
  *
@@ -682,8 +2141,7 @@ declare module "node-appwrite" {
682
2141
  * @throws {AppwriteException}
683
2142
  * @returns {Promise}
684
2143
  */
685
- createExecution<T extends unknown>(functionId: string, data?: string): Promise<T>;
686
-
2144
+ createExecution(functionId: string, data?: string): Promise<Models.Execution>;
687
2145
  /**
688
2146
  * Get Execution
689
2147
  *
@@ -694,8 +2152,7 @@ declare module "node-appwrite" {
694
2152
  * @throws {AppwriteException}
695
2153
  * @returns {Promise}
696
2154
  */
697
- getExecution<T extends unknown>(functionId: string, executionId: string): Promise<T>;
698
-
2155
+ getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
699
2156
  /**
700
2157
  * Update Function Tag
701
2158
  *
@@ -708,8 +2165,7 @@ declare module "node-appwrite" {
708
2165
  * @throws {AppwriteException}
709
2166
  * @returns {Promise}
710
2167
  */
711
- updateTag<T extends unknown>(functionId: string, tag: string): Promise<T>;
712
-
2168
+ updateTag(functionId: string, tag: string): Promise<Models.Function>;
713
2169
  /**
714
2170
  * List Tags
715
2171
  *
@@ -720,12 +2176,13 @@ declare module "node-appwrite" {
720
2176
  * @param {string} search
721
2177
  * @param {number} limit
722
2178
  * @param {number} offset
2179
+ * @param {string} cursor
2180
+ * @param {string} cursorDirection
723
2181
  * @param {string} orderType
724
2182
  * @throws {AppwriteException}
725
2183
  * @returns {Promise}
726
2184
  */
727
- listTags<T extends unknown>(functionId: string, search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
728
-
2185
+ listTags(functionId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.TagList>;
729
2186
  /**
730
2187
  * Create Tag
731
2188
  *
@@ -746,8 +2203,7 @@ declare module "node-appwrite" {
746
2203
  * @throws {AppwriteException}
747
2204
  * @returns {Promise}
748
2205
  */
749
- createTag<T extends unknown>(functionId: string, command: string, code: File): Promise<T>;
750
-
2206
+ createTag(functionId: string, command: string, code: File): Promise<Models.Tag>;
751
2207
  /**
752
2208
  * Get Tag
753
2209
  *
@@ -758,8 +2214,7 @@ declare module "node-appwrite" {
758
2214
  * @throws {AppwriteException}
759
2215
  * @returns {Promise}
760
2216
  */
761
- getTag<T extends unknown>(functionId: string, tagId: string): Promise<T>;
762
-
2217
+ getTag(functionId: string, tagId: string): Promise<Models.Tag>;
763
2218
  /**
764
2219
  * Delete Tag
765
2220
  *
@@ -770,10 +2225,9 @@ declare module "node-appwrite" {
770
2225
  * @throws {AppwriteException}
771
2226
  * @returns {Promise}
772
2227
  */
773
- deleteTag<T extends unknown>(functionId: string, tagId: string): Promise<T>;
2228
+ deleteTag(functionId: string, tagId: string): Promise<Response>;
774
2229
  }
775
2230
  export class Health extends Service {
776
-
777
2231
  /**
778
2232
  * Get HTTP
779
2233
  *
@@ -782,18 +2236,16 @@ declare module "node-appwrite" {
782
2236
  * @throws {AppwriteException}
783
2237
  * @returns {Promise}
784
2238
  */
785
- get<T extends unknown>(): Promise<T>;
786
-
2239
+ get(): Promise<Models.HealthStatus>;
787
2240
  /**
788
- * Get Anti virus
2241
+ * Get Antivirus
789
2242
  *
790
- * Check the Appwrite Anti Virus server is up and connection is successful.
2243
+ * Check the Appwrite Antivirus server is up and connection is successful.
791
2244
  *
792
2245
  * @throws {AppwriteException}
793
2246
  * @returns {Promise}
794
2247
  */
795
- getAntiVirus<T extends unknown>(): Promise<T>;
796
-
2248
+ getAntivirus(): Promise<Models.HealthAntivirus>;
797
2249
  /**
798
2250
  * Get Cache
799
2251
  *
@@ -803,8 +2255,7 @@ declare module "node-appwrite" {
803
2255
  * @throws {AppwriteException}
804
2256
  * @returns {Promise}
805
2257
  */
806
- getCache<T extends unknown>(): Promise<T>;
807
-
2258
+ getCache(): Promise<Models.HealthStatus>;
808
2259
  /**
809
2260
  * Get DB
810
2261
  *
@@ -813,10 +2264,9 @@ declare module "node-appwrite" {
813
2264
  * @throws {AppwriteException}
814
2265
  * @returns {Promise}
815
2266
  */
816
- getDB<T extends unknown>(): Promise<T>;
817
-
2267
+ getDB(): Promise<Models.HealthStatus>;
818
2268
  /**
819
- * Get Certificate Queue
2269
+ * Get Certificates Queue
820
2270
  *
821
2271
  * Get the number of certificates that are waiting to be issued against
822
2272
  * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
@@ -825,16 +2275,14 @@ declare module "node-appwrite" {
825
2275
  * @throws {AppwriteException}
826
2276
  * @returns {Promise}
827
2277
  */
828
- getQueueCertificates<T extends unknown>(): Promise<T>;
829
-
2278
+ getQueueCertificates(): Promise<Models.HealthQueue>;
830
2279
  /**
831
2280
  * Get Functions Queue
832
2281
  *
833
2282
  * @throws {AppwriteException}
834
2283
  * @returns {Promise}
835
2284
  */
836
- getQueueFunctions<T extends unknown>(): Promise<T>;
837
-
2285
+ getQueueFunctions(): Promise<Models.HealthQueue>;
838
2286
  /**
839
2287
  * Get Logs Queue
840
2288
  *
@@ -844,19 +2292,7 @@ declare module "node-appwrite" {
844
2292
  * @throws {AppwriteException}
845
2293
  * @returns {Promise}
846
2294
  */
847
- getQueueLogs<T extends unknown>(): Promise<T>;
848
-
849
- /**
850
- * Get Tasks Queue
851
- *
852
- * Get the number of tasks that are waiting to be processed in the Appwrite
853
- * internal queue server.
854
- *
855
- * @throws {AppwriteException}
856
- * @returns {Promise}
857
- */
858
- getQueueTasks<T extends unknown>(): Promise<T>;
859
-
2295
+ getQueueLogs(): Promise<Models.HealthQueue>;
860
2296
  /**
861
2297
  * Get Usage Queue
862
2298
  *
@@ -866,8 +2302,7 @@ declare module "node-appwrite" {
866
2302
  * @throws {AppwriteException}
867
2303
  * @returns {Promise}
868
2304
  */
869
- getQueueUsage<T extends unknown>(): Promise<T>;
870
-
2305
+ getQueueUsage(): Promise<Models.HealthQueue>;
871
2306
  /**
872
2307
  * Get Webhooks Queue
873
2308
  *
@@ -877,8 +2312,7 @@ declare module "node-appwrite" {
877
2312
  * @throws {AppwriteException}
878
2313
  * @returns {Promise}
879
2314
  */
880
- getQueueWebhooks<T extends unknown>(): Promise<T>;
881
-
2315
+ getQueueWebhooks(): Promise<Models.HealthQueue>;
882
2316
  /**
883
2317
  * Get Local Storage
884
2318
  *
@@ -887,8 +2321,7 @@ declare module "node-appwrite" {
887
2321
  * @throws {AppwriteException}
888
2322
  * @returns {Promise}
889
2323
  */
890
- getStorageLocal<T extends unknown>(): Promise<T>;
891
-
2324
+ getStorageLocal(): Promise<Models.HealthStatus>;
892
2325
  /**
893
2326
  * Get Time
894
2327
  *
@@ -903,10 +2336,9 @@ declare module "node-appwrite" {
903
2336
  * @throws {AppwriteException}
904
2337
  * @returns {Promise}
905
2338
  */
906
- getTime<T extends unknown>(): Promise<T>;
2339
+ getTime(): Promise<Models.HealthTime>;
907
2340
  }
908
2341
  export class Locale extends Service {
909
-
910
2342
  /**
911
2343
  * Get User Locale
912
2344
  *
@@ -920,8 +2352,7 @@ declare module "node-appwrite" {
920
2352
  * @throws {AppwriteException}
921
2353
  * @returns {Promise}
922
2354
  */
923
- get<T extends unknown>(): Promise<T>;
924
-
2355
+ get(): Promise<Models.Locale>;
925
2356
  /**
926
2357
  * List Continents
927
2358
  *
@@ -931,8 +2362,7 @@ declare module "node-appwrite" {
931
2362
  * @throws {AppwriteException}
932
2363
  * @returns {Promise}
933
2364
  */
934
- getContinents<T extends unknown>(): Promise<T>;
935
-
2365
+ getContinents(): Promise<Models.ContinentList>;
936
2366
  /**
937
2367
  * List Countries
938
2368
  *
@@ -942,8 +2372,7 @@ declare module "node-appwrite" {
942
2372
  * @throws {AppwriteException}
943
2373
  * @returns {Promise}
944
2374
  */
945
- getCountries<T extends unknown>(): Promise<T>;
946
-
2375
+ getCountries(): Promise<Models.CountryList>;
947
2376
  /**
948
2377
  * List EU Countries
949
2378
  *
@@ -953,8 +2382,7 @@ declare module "node-appwrite" {
953
2382
  * @throws {AppwriteException}
954
2383
  * @returns {Promise}
955
2384
  */
956
- getCountriesEU<T extends unknown>(): Promise<T>;
957
-
2385
+ getCountriesEU(): Promise<Models.CountryList>;
958
2386
  /**
959
2387
  * List Countries Phone Codes
960
2388
  *
@@ -964,8 +2392,7 @@ declare module "node-appwrite" {
964
2392
  * @throws {AppwriteException}
965
2393
  * @returns {Promise}
966
2394
  */
967
- getCountriesPhones<T extends unknown>(): Promise<T>;
968
-
2395
+ getCountriesPhones(): Promise<Models.PhoneList>;
969
2396
  /**
970
2397
  * List Currencies
971
2398
  *
@@ -976,8 +2403,7 @@ declare module "node-appwrite" {
976
2403
  * @throws {AppwriteException}
977
2404
  * @returns {Promise}
978
2405
  */
979
- getCurrencies<T extends unknown>(): Promise<T>;
980
-
2406
+ getCurrencies(): Promise<Models.CurrencyList>;
981
2407
  /**
982
2408
  * List Languages
983
2409
  *
@@ -987,10 +2413,9 @@ declare module "node-appwrite" {
987
2413
  * @throws {AppwriteException}
988
2414
  * @returns {Promise}
989
2415
  */
990
- getLanguages<T extends unknown>(): Promise<T>;
2416
+ getLanguages(): Promise<Models.LanguageList>;
991
2417
  }
992
2418
  export class Storage extends Service {
993
-
994
2419
  /**
995
2420
  * List Files
996
2421
  *
@@ -1001,12 +2426,13 @@ declare module "node-appwrite" {
1001
2426
  * @param {string} search
1002
2427
  * @param {number} limit
1003
2428
  * @param {number} offset
2429
+ * @param {string} cursor
2430
+ * @param {string} cursorDirection
1004
2431
  * @param {string} orderType
1005
2432
  * @throws {AppwriteException}
1006
2433
  * @returns {Promise}
1007
2434
  */
1008
- listFiles<T extends unknown>(search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
1009
-
2435
+ listFiles(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FileList>;
1010
2436
  /**
1011
2437
  * Create File
1012
2438
  *
@@ -1014,14 +2440,14 @@ declare module "node-appwrite" {
1014
2440
  * assigned to read and write access unless he has passed custom values for
1015
2441
  * read and write arguments.
1016
2442
  *
2443
+ * @param {string} fileId
1017
2444
  * @param {File} file
1018
2445
  * @param {string[]} read
1019
2446
  * @param {string[]} write
1020
2447
  * @throws {AppwriteException}
1021
2448
  * @returns {Promise}
1022
2449
  */
1023
- createFile<T extends unknown>(file: File, read?: string[], write?: string[]): Promise<T>;
1024
-
2450
+ createFile(fileId: string, file: File, read?: string[], write?: string[]): Promise<Models.File>;
1025
2451
  /**
1026
2452
  * Get File
1027
2453
  *
@@ -1032,8 +2458,7 @@ declare module "node-appwrite" {
1032
2458
  * @throws {AppwriteException}
1033
2459
  * @returns {Promise}
1034
2460
  */
1035
- getFile<T extends unknown>(fileId: string): Promise<T>;
1036
-
2461
+ getFile(fileId: string): Promise<Models.File>;
1037
2462
  /**
1038
2463
  * Update File
1039
2464
  *
@@ -1046,8 +2471,7 @@ declare module "node-appwrite" {
1046
2471
  * @throws {AppwriteException}
1047
2472
  * @returns {Promise}
1048
2473
  */
1049
- updateFile<T extends unknown>(fileId: string, read: string[], write: string[]): Promise<T>;
1050
-
2474
+ updateFile(fileId: string, read: string[], write: string[]): Promise<Models.File>;
1051
2475
  /**
1052
2476
  * Delete File
1053
2477
  *
@@ -1058,8 +2482,7 @@ declare module "node-appwrite" {
1058
2482
  * @throws {AppwriteException}
1059
2483
  * @returns {Promise}
1060
2484
  */
1061
- deleteFile<T extends unknown>(fileId: string): Promise<T>;
1062
-
2485
+ deleteFile(fileId: string): Promise<Response>;
1063
2486
  /**
1064
2487
  * Get File for Download
1065
2488
  *
@@ -1072,7 +2495,6 @@ declare module "node-appwrite" {
1072
2495
  * @returns {Promise}
1073
2496
  */
1074
2497
  getFileDownload(fileId: string): Promise<Buffer>;
1075
-
1076
2498
  /**
1077
2499
  * Get File Preview
1078
2500
  *
@@ -1097,7 +2519,6 @@ declare module "node-appwrite" {
1097
2519
  * @returns {Promise}
1098
2520
  */
1099
2521
  getFilePreview(fileId: string, width?: number, height?: number, gravity?: string, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: string): Promise<Buffer>;
1100
-
1101
2522
  /**
1102
2523
  * Get File for View
1103
2524
  *
@@ -1112,111 +2533,107 @@ declare module "node-appwrite" {
1112
2533
  getFileView(fileId: string): Promise<Buffer>;
1113
2534
  }
1114
2535
  export class Teams extends Service {
1115
-
1116
2536
  /**
1117
2537
  * List Teams
1118
2538
  *
1119
- * Get a list of all the current user teams. You can use the query params to
1120
- * filter your results. On admin mode, this endpoint will return a list of all
1121
- * of the project's teams. [Learn more about different API
1122
- * modes](/docs/admin).
2539
+ * Get a list of all the teams in which the current user is a member. You can
2540
+ * use the parameters to filter your results.
2541
+ *
2542
+ * In admin mode, this endpoint returns a list of all the teams in the current
2543
+ * project. [Learn more about different API modes](/docs/admin).
1123
2544
  *
1124
2545
  * @param {string} search
1125
2546
  * @param {number} limit
1126
2547
  * @param {number} offset
2548
+ * @param {string} cursor
2549
+ * @param {string} cursorDirection
1127
2550
  * @param {string} orderType
1128
2551
  * @throws {AppwriteException}
1129
2552
  * @returns {Promise}
1130
2553
  */
1131
- list<T extends unknown>(search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
1132
-
2554
+ list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.TeamList>;
1133
2555
  /**
1134
2556
  * Create Team
1135
2557
  *
1136
2558
  * Create a new team. The user who creates the team will automatically be
1137
- * assigned as the owner of the team. The team owner can invite new members,
1138
- * who will be able add new owners and update or delete the team from your
1139
- * project.
2559
+ * assigned as the owner of the team. Only the users with the owner role can
2560
+ * invite new members, add new owners and delete or update the team.
1140
2561
  *
2562
+ * @param {string} teamId
1141
2563
  * @param {string} name
1142
2564
  * @param {string[]} roles
1143
2565
  * @throws {AppwriteException}
1144
2566
  * @returns {Promise}
1145
2567
  */
1146
- create<T extends unknown>(name: string, roles?: string[]): Promise<T>;
1147
-
2568
+ create(teamId: string, name: string, roles?: string[]): Promise<Models.Team>;
1148
2569
  /**
1149
2570
  * Get Team
1150
2571
  *
1151
- * Get a team by its unique ID. All team members have read access for this
1152
- * resource.
2572
+ * Get a team by its ID. All team members have read access for this resource.
1153
2573
  *
1154
2574
  * @param {string} teamId
1155
2575
  * @throws {AppwriteException}
1156
2576
  * @returns {Promise}
1157
2577
  */
1158
- get<T extends unknown>(teamId: string): Promise<T>;
1159
-
2578
+ get(teamId: string): Promise<Models.Team>;
1160
2579
  /**
1161
2580
  * Update Team
1162
2581
  *
1163
- * Update a team by its unique ID. Only team owners have write access for this
1164
- * resource.
2582
+ * Update a team using its ID. Only members with the owner role can update the
2583
+ * team.
1165
2584
  *
1166
2585
  * @param {string} teamId
1167
2586
  * @param {string} name
1168
2587
  * @throws {AppwriteException}
1169
2588
  * @returns {Promise}
1170
2589
  */
1171
- update<T extends unknown>(teamId: string, name: string): Promise<T>;
1172
-
2590
+ update(teamId: string, name: string): Promise<Models.Team>;
1173
2591
  /**
1174
2592
  * Delete Team
1175
2593
  *
1176
- * Delete a team by its unique ID. Only team owners have write access for this
1177
- * resource.
2594
+ * Delete a team using its ID. Only team members with the owner role can
2595
+ * delete the team.
1178
2596
  *
1179
2597
  * @param {string} teamId
1180
2598
  * @throws {AppwriteException}
1181
2599
  * @returns {Promise}
1182
2600
  */
1183
- delete<T extends unknown>(teamId: string): Promise<T>;
1184
-
2601
+ delete(teamId: string): Promise<Response>;
1185
2602
  /**
1186
2603
  * Get Team Memberships
1187
2604
  *
1188
- * Get a team members by the team unique ID. All team members have read access
1189
- * for this list of resources.
2605
+ * Use this endpoint to list a team's members using the team's ID. All team
2606
+ * members have read access to this endpoint.
1190
2607
  *
1191
2608
  * @param {string} teamId
1192
2609
  * @param {string} search
1193
2610
  * @param {number} limit
1194
2611
  * @param {number} offset
2612
+ * @param {string} cursor
2613
+ * @param {string} cursorDirection
1195
2614
  * @param {string} orderType
1196
2615
  * @throws {AppwriteException}
1197
2616
  * @returns {Promise}
1198
2617
  */
1199
- getMemberships<T extends unknown>(teamId: string, search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
1200
-
2618
+ getMemberships(teamId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.MembershipList>;
1201
2619
  /**
1202
2620
  * Create Team Membership
1203
2621
  *
1204
- * Use this endpoint to invite a new member to join your team. If initiated
1205
- * from Client SDK, an email with a link to join the team will be sent to the
1206
- * new member's email address if the member doesn't exist in the project it
1207
- * will be created automatically. If initiated from server side SDKs, new
1208
- * member will automatically be added to the team.
2622
+ * Invite a new member to join your team. If initiated from the client SDK, an
2623
+ * email with a link to join the team will be sent to the member's email
2624
+ * address and an account will be created for them should they not be signed
2625
+ * up already. If initiated from server-side SDKs, the new member will
2626
+ * automatically be added to the team.
1209
2627
  *
1210
- * Use the 'URL' parameter to redirect the user from the invitation email back
2628
+ * Use the 'url' parameter to redirect the user from the invitation email back
1211
2629
  * to your app. When the user is redirected, use the [Update Team Membership
1212
2630
  * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
1213
- * the user to accept the invitation to the team. While calling from side
1214
- * SDKs the redirect url can be empty string.
2631
+ * the user to accept the invitation to the team.
1215
2632
  *
1216
- * Please note that in order to avoid a [Redirect
1217
- * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
2633
+ * Please note that to avoid a [Redirect
2634
+ * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
1218
2635
  * the only valid redirect URL's are the once from domains you have set when
1219
- * added your platforms in the console interface.
2636
+ * adding your platforms in the console interface.
1220
2637
  *
1221
2638
  * @param {string} teamId
1222
2639
  * @param {string} email
@@ -1226,19 +2643,33 @@ declare module "node-appwrite" {
1226
2643
  * @throws {AppwriteException}
1227
2644
  * @returns {Promise}
1228
2645
  */
1229
- createMembership<T extends unknown>(teamId: string, email: string, roles: string[], url: string, name?: string): Promise<T>;
1230
-
2646
+ createMembership(teamId: string, email: string, roles: string[], url: string, name?: string): Promise<Models.Membership>;
2647
+ /**
2648
+ * Get Team Membership
2649
+ *
2650
+ * Get a team member by the membership unique id. All team members have read
2651
+ * access for this resource.
2652
+ *
2653
+ * @param {string} teamId
2654
+ * @param {string} membershipId
2655
+ * @throws {AppwriteException}
2656
+ * @returns {Promise}
2657
+ */
2658
+ getMembership(teamId: string, membershipId: string): Promise<Models.MembershipList>;
1231
2659
  /**
1232
2660
  * Update Membership Roles
1233
2661
  *
2662
+ * Modify the roles of a team member. Only team members with the owner role
2663
+ * have access to this endpoint. Learn more about [roles and
2664
+ * permissions](/docs/permissions).
2665
+ *
1234
2666
  * @param {string} teamId
1235
2667
  * @param {string} membershipId
1236
2668
  * @param {string[]} roles
1237
2669
  * @throws {AppwriteException}
1238
2670
  * @returns {Promise}
1239
2671
  */
1240
- updateMembershipRoles<T extends unknown>(teamId: string, membershipId: string, roles: string[]): Promise<T>;
1241
-
2672
+ updateMembershipRoles(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
1242
2673
  /**
1243
2674
  * Delete Team Membership
1244
2675
  *
@@ -1251,13 +2682,12 @@ declare module "node-appwrite" {
1251
2682
  * @throws {AppwriteException}
1252
2683
  * @returns {Promise}
1253
2684
  */
1254
- deleteMembership<T extends unknown>(teamId: string, membershipId: string): Promise<T>;
1255
-
2685
+ deleteMembership(teamId: string, membershipId: string): Promise<Response>;
1256
2686
  /**
1257
2687
  * Update Team Membership Status
1258
2688
  *
1259
2689
  * Use this endpoint to allow a user to accept an invitation to join a team
1260
- * after being redirected back to your app from the invitation email recieved
2690
+ * after being redirected back to your app from the invitation email received
1261
2691
  * by the user.
1262
2692
  *
1263
2693
  * @param {string} teamId
@@ -1267,10 +2697,9 @@ declare module "node-appwrite" {
1267
2697
  * @throws {AppwriteException}
1268
2698
  * @returns {Promise}
1269
2699
  */
1270
- updateMembershipStatus<T extends unknown>(teamId: string, membershipId: string, userId: string, secret: string): Promise<T>;
2700
+ updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
1271
2701
  }
1272
2702
  export class Users extends Service {
1273
-
1274
2703
  /**
1275
2704
  * List Users
1276
2705
  *
@@ -1280,25 +2709,26 @@ declare module "node-appwrite" {
1280
2709
  * @param {string} search
1281
2710
  * @param {number} limit
1282
2711
  * @param {number} offset
2712
+ * @param {string} cursor
2713
+ * @param {string} cursorDirection
1283
2714
  * @param {string} orderType
1284
2715
  * @throws {AppwriteException}
1285
2716
  * @returns {Promise}
1286
2717
  */
1287
- list<T extends unknown>(search?: string, limit?: number, offset?: number, orderType?: string): Promise<T>;
1288
-
2718
+ list<Preferences extends Models.Preferences>(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.UserList<Preferences>>;
1289
2719
  /**
1290
2720
  * Create User
1291
2721
  *
1292
2722
  * Create a new user.
1293
2723
  *
2724
+ * @param {string} userId
1294
2725
  * @param {string} email
1295
2726
  * @param {string} password
1296
2727
  * @param {string} name
1297
2728
  * @throws {AppwriteException}
1298
2729
  * @returns {Promise}
1299
2730
  */
1300
- create<T extends unknown>(email: string, password: string, name?: string): Promise<T>;
1301
-
2731
+ create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
1302
2732
  /**
1303
2733
  * Get User
1304
2734
  *
@@ -1308,8 +2738,7 @@ declare module "node-appwrite" {
1308
2738
  * @throws {AppwriteException}
1309
2739
  * @returns {Promise}
1310
2740
  */
1311
- get<T extends unknown>(userId: string): Promise<T>;
1312
-
2741
+ get<Preferences extends Models.Preferences>(userId: string): Promise<Models.User<Preferences>>;
1313
2742
  /**
1314
2743
  * Delete User
1315
2744
  *
@@ -1319,8 +2748,7 @@ declare module "node-appwrite" {
1319
2748
  * @throws {AppwriteException}
1320
2749
  * @returns {Promise}
1321
2750
  */
1322
- delete<T extends unknown>(userId: string): Promise<T>;
1323
-
2751
+ delete(userId: string): Promise<Response>;
1324
2752
  /**
1325
2753
  * Update Email
1326
2754
  *
@@ -1331,19 +2759,19 @@ declare module "node-appwrite" {
1331
2759
  * @throws {AppwriteException}
1332
2760
  * @returns {Promise}
1333
2761
  */
1334
- updateEmail<T extends unknown>(userId: string, email: string): Promise<T>;
1335
-
2762
+ updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
1336
2763
  /**
1337
2764
  * Get User Logs
1338
2765
  *
1339
- * Get a user activity logs list by its unique ID.
2766
+ * Get the user activity logs list by its unique ID.
1340
2767
  *
1341
2768
  * @param {string} userId
2769
+ * @param {number} limit
2770
+ * @param {number} offset
1342
2771
  * @throws {AppwriteException}
1343
2772
  * @returns {Promise}
1344
2773
  */
1345
- getLogs<T extends unknown>(userId: string): Promise<T>;
1346
-
2774
+ getLogs(userId: string, limit?: number, offset?: number): Promise<Models.LogList>;
1347
2775
  /**
1348
2776
  * Update Name
1349
2777
  *
@@ -1354,8 +2782,7 @@ declare module "node-appwrite" {
1354
2782
  * @throws {AppwriteException}
1355
2783
  * @returns {Promise}
1356
2784
  */
1357
- updateName<T extends unknown>(userId: string, name: string): Promise<T>;
1358
-
2785
+ updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
1359
2786
  /**
1360
2787
  * Update Password
1361
2788
  *
@@ -1366,8 +2793,7 @@ declare module "node-appwrite" {
1366
2793
  * @throws {AppwriteException}
1367
2794
  * @returns {Promise}
1368
2795
  */
1369
- updatePassword<T extends unknown>(userId: string, password: string): Promise<T>;
1370
-
2796
+ updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
1371
2797
  /**
1372
2798
  * Get User Preferences
1373
2799
  *
@@ -1377,21 +2803,20 @@ declare module "node-appwrite" {
1377
2803
  * @throws {AppwriteException}
1378
2804
  * @returns {Promise}
1379
2805
  */
1380
- getPrefs<T extends unknown>(userId: string): Promise<T>;
1381
-
2806
+ getPrefs<Preferences extends Models.Preferences>(userId: string): Promise<Preferences>;
1382
2807
  /**
1383
2808
  * Update User Preferences
1384
2809
  *
1385
- * Update the user preferences by its unique ID. You can pass only the
1386
- * specific settings you wish to update.
2810
+ * Update the user preferences by its unique ID. The object you pass is stored
2811
+ * as is, and replaces any previous value. The maximum allowed prefs size is
2812
+ * 64kB and throws error if exceeded.
1387
2813
  *
1388
2814
  * @param {string} userId
1389
2815
  * @param {object} prefs
1390
2816
  * @throws {AppwriteException}
1391
2817
  * @returns {Promise}
1392
2818
  */
1393
- updatePrefs<T extends unknown>(userId: string, prefs: object): Promise<T>;
1394
-
2819
+ updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences>;
1395
2820
  /**
1396
2821
  * Get User Sessions
1397
2822
  *
@@ -1401,8 +2826,7 @@ declare module "node-appwrite" {
1401
2826
  * @throws {AppwriteException}
1402
2827
  * @returns {Promise}
1403
2828
  */
1404
- getSessions<T extends unknown>(userId: string): Promise<T>;
1405
-
2829
+ getSessions(userId: string): Promise<Models.SessionList>;
1406
2830
  /**
1407
2831
  * Delete User Sessions
1408
2832
  *
@@ -1412,8 +2836,7 @@ declare module "node-appwrite" {
1412
2836
  * @throws {AppwriteException}
1413
2837
  * @returns {Promise}
1414
2838
  */
1415
- deleteSessions<T extends unknown>(userId: string): Promise<T>;
1416
-
2839
+ deleteSessions(userId: string): Promise<Response>;
1417
2840
  /**
1418
2841
  * Delete User Session
1419
2842
  *
@@ -1424,20 +2847,18 @@ declare module "node-appwrite" {
1424
2847
  * @throws {AppwriteException}
1425
2848
  * @returns {Promise}
1426
2849
  */
1427
- deleteSession<T extends unknown>(userId: string, sessionId: string): Promise<T>;
1428
-
2850
+ deleteSession(userId: string, sessionId: string): Promise<Response>;
1429
2851
  /**
1430
2852
  * Update User Status
1431
2853
  *
1432
2854
  * Update the user status by its unique ID.
1433
2855
  *
1434
2856
  * @param {string} userId
1435
- * @param {number} status
2857
+ * @param {boolean} status
1436
2858
  * @throws {AppwriteException}
1437
2859
  * @returns {Promise}
1438
2860
  */
1439
- updateStatus<T extends unknown>(userId: string, status: number): Promise<T>;
1440
-
2861
+ updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
1441
2862
  /**
1442
2863
  * Update Email Verification
1443
2864
  *
@@ -1448,6 +2869,6 @@ declare module "node-appwrite" {
1448
2869
  * @throws {AppwriteException}
1449
2870
  * @returns {Promise}
1450
2871
  */
1451
- updateVerification<T extends unknown>(userId: string, emailVerification: boolean): Promise<T>;
2872
+ updateVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
1452
2873
  }
1453
2874
  }