@appwrite.io/console 1.5.0 → 1.5.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 (47) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +474 -97
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +474 -97
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +474 -97
  7. package/docs/examples/databases/update-float-attribute.md +2 -2
  8. package/docs/examples/databases/update-integer-attribute.md +2 -2
  9. package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
  10. package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
  11. package/docs/examples/organizations/create.md +5 -1
  12. package/docs/examples/organizations/update-plan.md +5 -1
  13. package/package.json +1 -1
  14. package/src/client.ts +5 -3
  15. package/src/enums/credit-card.ts +1 -0
  16. package/src/enums/name.ts +3 -2
  17. package/src/enums/runtime.ts +3 -0
  18. package/src/models.ts +134 -1
  19. package/src/services/account.ts +122 -0
  20. package/src/services/assistant.ts +2 -0
  21. package/src/services/avatars.ts +7 -42
  22. package/src/services/backups.ts +24 -0
  23. package/src/services/console.ts +14 -0
  24. package/src/services/databases.ts +101 -16
  25. package/src/services/functions.ts +55 -6
  26. package/src/services/graphql.ts +4 -0
  27. package/src/services/health.ts +59 -34
  28. package/src/services/locale.ts +16 -0
  29. package/src/services/messaging.ts +95 -3
  30. package/src/services/migrations.ts +24 -0
  31. package/src/services/organizations.ts +90 -2
  32. package/src/services/project.ts +12 -0
  33. package/src/services/projects.ts +92 -0
  34. package/src/services/proxy.ts +10 -0
  35. package/src/services/storage.ts +27 -18
  36. package/src/services/teams.ts +28 -0
  37. package/src/services/users.ts +86 -0
  38. package/src/services/vcs.ts +20 -0
  39. package/types/enums/credit-card.d.ts +2 -1
  40. package/types/enums/name.d.ts +3 -2
  41. package/types/enums/runtime.d.ts +3 -0
  42. package/types/models.d.ts +134 -1
  43. package/types/services/databases.d.ts +5 -4
  44. package/types/services/health.d.ts +7 -16
  45. package/types/services/messaging.d.ts +3 -3
  46. package/types/services/organizations.d.ts +10 -2
  47. package/docs/examples/health/get-queue.md +0 -11
@@ -37,6 +37,8 @@ export class Functions {
37
37
  'content-type': 'application/json',
38
38
  }
39
39
 
40
+ payload['project'] = this.client.config.project;
41
+
40
42
 
41
43
  return await this.client.call(
42
44
  'get',
@@ -159,6 +161,8 @@ export class Functions {
159
161
  'content-type': 'application/json',
160
162
  }
161
163
 
164
+ payload['project'] = this.client.config.project;
165
+
162
166
 
163
167
  return await this.client.call(
164
168
  'post',
@@ -184,6 +188,8 @@ export class Functions {
184
188
  'content-type': 'application/json',
185
189
  }
186
190
 
191
+ payload['project'] = this.client.config.project;
192
+
187
193
 
188
194
  return await this.client.call(
189
195
  'get',
@@ -210,6 +216,8 @@ export class Functions {
210
216
  'content-type': 'application/json',
211
217
  }
212
218
 
219
+ payload['project'] = this.client.config.project;
220
+
213
221
 
214
222
  return await this.client.call(
215
223
  'get',
@@ -251,6 +259,8 @@ export class Functions {
251
259
  'content-type': 'application/json',
252
260
  }
253
261
 
262
+ payload['project'] = this.client.config.project;
263
+
254
264
 
255
265
  return await this.client.call(
256
266
  'get',
@@ -280,6 +290,8 @@ export class Functions {
280
290
  'content-type': 'application/json',
281
291
  }
282
292
 
293
+ payload['project'] = this.client.config.project;
294
+
283
295
 
284
296
  return await this.client.call(
285
297
  'get',
@@ -309,6 +321,8 @@ export class Functions {
309
321
  'content-type': 'application/json',
310
322
  }
311
323
 
324
+ payload['project'] = this.client.config.project;
325
+
312
326
 
313
327
  return await this.client.call(
314
328
  'get',
@@ -338,6 +352,8 @@ export class Functions {
338
352
  'content-type': 'application/json',
339
353
  }
340
354
 
355
+ payload['project'] = this.client.config.project;
356
+
341
357
 
342
358
  return await this.client.call(
343
359
  'get',
@@ -438,6 +454,8 @@ export class Functions {
438
454
  'content-type': 'application/json',
439
455
  }
440
456
 
457
+ payload['project'] = this.client.config.project;
458
+
441
459
 
442
460
  return await this.client.call(
443
461
  'put',
@@ -467,6 +485,8 @@ export class Functions {
467
485
  'content-type': 'application/json',
468
486
  }
469
487
 
488
+ payload['project'] = this.client.config.project;
489
+
470
490
 
471
491
  return await this.client.call(
472
492
  'delete',
@@ -504,6 +524,8 @@ export class Functions {
504
524
  'content-type': 'application/json',
505
525
  }
506
526
 
527
+ payload['project'] = this.client.config.project;
528
+
507
529
 
508
530
  return await this.client.call(
509
531
  'get',
@@ -559,6 +581,8 @@ Use the "command" param to set the entrypoint used to execute your cod
559
581
  'content-type': 'multipart/form-data',
560
582
  }
561
583
 
584
+ payload['project'] = this.client.config.project;
585
+
562
586
 
563
587
  return await this.client.chunkedUpload(
564
588
  'post',
@@ -593,6 +617,8 @@ Use the "command" param to set the entrypoint used to execute your cod
593
617
  'content-type': 'application/json',
594
618
  }
595
619
 
620
+ payload['project'] = this.client.config.project;
621
+
596
622
 
597
623
  return await this.client.call(
598
624
  'get',
@@ -626,6 +652,8 @@ Use the "command" param to set the entrypoint used to execute your cod
626
652
  'content-type': 'application/json',
627
653
  }
628
654
 
655
+ payload['project'] = this.client.config.project;
656
+
629
657
 
630
658
  return await this.client.call(
631
659
  'patch',
@@ -659,6 +687,8 @@ Use the "command" param to set the entrypoint used to execute your cod
659
687
  'content-type': 'application/json',
660
688
  }
661
689
 
690
+ payload['project'] = this.client.config.project;
691
+
662
692
 
663
693
  return await this.client.call(
664
694
  'delete',
@@ -696,6 +726,8 @@ Use the "command" param to set the entrypoint used to execute your cod
696
726
  'content-type': 'application/json',
697
727
  }
698
728
 
729
+ payload['project'] = this.client.config.project;
730
+
699
731
 
700
732
  return await this.client.call(
701
733
  'post',
@@ -729,6 +761,8 @@ Use the "command" param to set the entrypoint used to execute your cod
729
761
  'content-type': 'application/json',
730
762
  }
731
763
 
764
+ payload['project'] = this.client.config.project;
765
+
732
766
 
733
767
  return await this.client.call(
734
768
  'patch',
@@ -763,13 +797,8 @@ Use the "command" param to set the entrypoint used to execute your cod
763
797
  }
764
798
 
765
799
  payload['project'] = this.client.config.project;
766
- for (const [key, value] of Object.entries(Service.flatten(payload))) {
767
- uri.searchParams.append(key, value);
768
- }
769
800
 
770
- payload['project'] = this.client.config.project;
771
-
772
- for (const [key, value] of Object.entries(Client.flatten(payload))) {
801
+ for (const [key, value] of Object.entries(Service.flatten(payload))) {
773
802
  uri.searchParams.append(key, value);
774
803
  }
775
804
 
@@ -804,6 +833,8 @@ Use the "command" param to set the entrypoint used to execute your cod
804
833
  'content-type': 'application/json',
805
834
  }
806
835
 
836
+ payload['project'] = this.client.config.project;
837
+
807
838
 
808
839
  return await this.client.call(
809
840
  'get',
@@ -857,6 +888,8 @@ Use the "command" param to set the entrypoint used to execute your cod
857
888
  'content-type': 'application/json',
858
889
  }
859
890
 
891
+ payload['project'] = this.client.config.project;
892
+
860
893
 
861
894
  return await this.client.call(
862
895
  'post',
@@ -890,6 +923,8 @@ Use the "command" param to set the entrypoint used to execute your cod
890
923
  'content-type': 'application/json',
891
924
  }
892
925
 
926
+ payload['project'] = this.client.config.project;
927
+
893
928
 
894
929
  return await this.client.call(
895
930
  'get',
@@ -924,6 +959,8 @@ Use the "command" param to set the entrypoint used to execute your cod
924
959
  'content-type': 'application/json',
925
960
  }
926
961
 
962
+ payload['project'] = this.client.config.project;
963
+
927
964
 
928
965
  return await this.client.call(
929
966
  'delete',
@@ -957,6 +994,8 @@ Use the "command" param to set the entrypoint used to execute your cod
957
994
  'content-type': 'application/json',
958
995
  }
959
996
 
997
+ payload['project'] = this.client.config.project;
998
+
960
999
 
961
1000
  return await this.client.call(
962
1001
  'get',
@@ -986,6 +1025,8 @@ Use the "command" param to set the entrypoint used to execute your cod
986
1025
  'content-type': 'application/json',
987
1026
  }
988
1027
 
1028
+ payload['project'] = this.client.config.project;
1029
+
989
1030
 
990
1031
  return await this.client.call(
991
1032
  'get',
@@ -1029,6 +1070,8 @@ Use the "command" param to set the entrypoint used to execute your cod
1029
1070
  'content-type': 'application/json',
1030
1071
  }
1031
1072
 
1073
+ payload['project'] = this.client.config.project;
1074
+
1032
1075
 
1033
1076
  return await this.client.call(
1034
1077
  'post',
@@ -1062,6 +1105,8 @@ Use the "command" param to set the entrypoint used to execute your cod
1062
1105
  'content-type': 'application/json',
1063
1106
  }
1064
1107
 
1108
+ payload['project'] = this.client.config.project;
1109
+
1065
1110
 
1066
1111
  return await this.client.call(
1067
1112
  'get',
@@ -1106,6 +1151,8 @@ Use the "command" param to set the entrypoint used to execute your cod
1106
1151
  'content-type': 'application/json',
1107
1152
  }
1108
1153
 
1154
+ payload['project'] = this.client.config.project;
1155
+
1109
1156
 
1110
1157
  return await this.client.call(
1111
1158
  'put',
@@ -1139,6 +1186,8 @@ Use the "command" param to set the entrypoint used to execute your cod
1139
1186
  'content-type': 'application/json',
1140
1187
  }
1141
1188
 
1189
+ payload['project'] = this.client.config.project;
1190
+
1142
1191
 
1143
1192
  return await this.client.call(
1144
1193
  'delete',
@@ -34,6 +34,8 @@ export class Graphql {
34
34
  'content-type': 'application/json',
35
35
  }
36
36
 
37
+ payload['project'] = this.client.config.project;
38
+
37
39
 
38
40
  return await this.client.call(
39
41
  'post',
@@ -67,6 +69,8 @@ export class Graphql {
67
69
  'content-type': 'application/json',
68
70
  }
69
71
 
72
+ payload['project'] = this.client.config.project;
73
+
70
74
 
71
75
  return await this.client.call(
72
76
  'post',
@@ -27,6 +27,8 @@ export class Health {
27
27
  'content-type': 'application/json',
28
28
  }
29
29
 
30
+ payload['project'] = this.client.config.project;
31
+
30
32
 
31
33
  return await this.client.call(
32
34
  'get',
@@ -52,6 +54,8 @@ export class Health {
52
54
  'content-type': 'application/json',
53
55
  }
54
56
 
57
+ payload['project'] = this.client.config.project;
58
+
55
59
 
56
60
  return await this.client.call(
57
61
  'get',
@@ -77,6 +81,8 @@ export class Health {
77
81
  'content-type': 'application/json',
78
82
  }
79
83
 
84
+ payload['project'] = this.client.config.project;
85
+
80
86
 
81
87
  return await this.client.call(
82
88
  'get',
@@ -106,6 +112,8 @@ export class Health {
106
112
  'content-type': 'application/json',
107
113
  }
108
114
 
115
+ payload['project'] = this.client.config.project;
116
+
109
117
 
110
118
  return await this.client.call(
111
119
  'get',
@@ -131,6 +139,8 @@ export class Health {
131
139
  'content-type': 'application/json',
132
140
  }
133
141
 
142
+ payload['project'] = this.client.config.project;
143
+
134
144
 
135
145
  return await this.client.call(
136
146
  'get',
@@ -156,30 +166,7 @@ export class Health {
156
166
  'content-type': 'application/json',
157
167
  }
158
168
 
159
-
160
- return await this.client.call(
161
- 'get',
162
- uri,
163
- apiHeaders,
164
- payload
165
- );
166
- }
167
- /**
168
- * Get queue
169
- *
170
- * Check the Appwrite queue messaging servers are up and connection is successful.
171
- *
172
- * @throws {AppwriteException}
173
- * @returns {Promise<Models.HealthStatus>}
174
- */
175
- async getQueue(): Promise<Models.HealthStatus> {
176
- const apiPath = '/health/queue';
177
- const payload: Payload = {};
178
- const uri = new URL(this.client.config.endpoint + apiPath);
179
-
180
- const apiHeaders: { [header: string]: string } = {
181
- 'content-type': 'application/json',
182
- }
169
+ payload['project'] = this.client.config.project;
183
170
 
184
171
 
185
172
  return await this.client.call(
@@ -210,6 +197,8 @@ export class Health {
210
197
  'content-type': 'application/json',
211
198
  }
212
199
 
200
+ payload['project'] = this.client.config.project;
201
+
213
202
 
214
203
  return await this.client.call(
215
204
  'get',
@@ -239,6 +228,8 @@ export class Health {
239
228
  'content-type': 'application/json',
240
229
  }
241
230
 
231
+ payload['project'] = this.client.config.project;
232
+
242
233
 
243
234
  return await this.client.call(
244
235
  'get',
@@ -268,6 +259,8 @@ export class Health {
268
259
  'content-type': 'application/json',
269
260
  }
270
261
 
262
+ payload['project'] = this.client.config.project;
263
+
271
264
 
272
265
  return await this.client.call(
273
266
  'get',
@@ -297,6 +290,8 @@ export class Health {
297
290
  'content-type': 'application/json',
298
291
  }
299
292
 
293
+ payload['project'] = this.client.config.project;
294
+
300
295
 
301
296
  return await this.client.call(
302
297
  'get',
@@ -330,6 +325,8 @@ export class Health {
330
325
  'content-type': 'application/json',
331
326
  }
332
327
 
328
+ payload['project'] = this.client.config.project;
329
+
333
330
 
334
331
  return await this.client.call(
335
332
  'get',
@@ -359,6 +356,8 @@ export class Health {
359
356
  'content-type': 'application/json',
360
357
  }
361
358
 
359
+ payload['project'] = this.client.config.project;
360
+
362
361
 
363
362
  return await this.client.call(
364
363
  'get',
@@ -393,6 +392,8 @@ export class Health {
393
392
  'content-type': 'application/json',
394
393
  }
395
394
 
395
+ payload['project'] = this.client.config.project;
396
+
396
397
 
397
398
  return await this.client.call(
398
399
  'get',
@@ -422,6 +423,8 @@ export class Health {
422
423
  'content-type': 'application/json',
423
424
  }
424
425
 
426
+ payload['project'] = this.client.config.project;
427
+
425
428
 
426
429
  return await this.client.call(
427
430
  'get',
@@ -451,6 +454,8 @@ export class Health {
451
454
  'content-type': 'application/json',
452
455
  }
453
456
 
457
+ payload['project'] = this.client.config.project;
458
+
454
459
 
455
460
  return await this.client.call(
456
461
  'get',
@@ -480,6 +485,8 @@ export class Health {
480
485
  'content-type': 'application/json',
481
486
  }
482
487
 
488
+ payload['project'] = this.client.config.project;
489
+
483
490
 
484
491
  return await this.client.call(
485
492
  'get',
@@ -509,6 +516,8 @@ export class Health {
509
516
  'content-type': 'application/json',
510
517
  }
511
518
 
519
+ payload['project'] = this.client.config.project;
520
+
512
521
 
513
522
  return await this.client.call(
514
523
  'get',
@@ -538,6 +547,8 @@ export class Health {
538
547
  'content-type': 'application/json',
539
548
  }
540
549
 
550
+ payload['project'] = this.client.config.project;
551
+
541
552
 
542
553
  return await this.client.call(
543
554
  'get',
@@ -547,16 +558,16 @@ export class Health {
547
558
  );
548
559
  }
549
560
  /**
550
- * Get usage queue
561
+ * Get stats resources queue
551
562
  *
552
- * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
563
+ * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
553
564
  *
554
565
  * @param {number} threshold
555
566
  * @throws {AppwriteException}
556
567
  * @returns {Promise<Models.HealthQueue>}
557
568
  */
558
- async getQueueUsage(threshold?: number): Promise<Models.HealthQueue> {
559
- const apiPath = '/health/queue/usage';
569
+ async getQueueStatsResources(threshold?: number): Promise<Models.HealthQueue> {
570
+ const apiPath = '/health/queue/stats-resources';
560
571
  const payload: Payload = {};
561
572
  if (typeof threshold !== 'undefined') {
562
573
  payload['threshold'] = threshold;
@@ -567,6 +578,8 @@ export class Health {
567
578
  'content-type': 'application/json',
568
579
  }
569
580
 
581
+ payload['project'] = this.client.config.project;
582
+
570
583
 
571
584
  return await this.client.call(
572
585
  'get',
@@ -576,16 +589,16 @@ export class Health {
576
589
  );
577
590
  }
578
591
  /**
579
- * Get usage count aggregation queue
592
+ * Get stats usage queue
580
593
  *
581
- * Get the usage count aggregation queue.
594
+ * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
582
595
  *
583
596
  * @param {number} threshold
584
597
  * @throws {AppwriteException}
585
598
  * @returns {Promise<Models.HealthQueue>}
586
599
  */
587
- async getQueueUsageCount(threshold?: number): Promise<Models.HealthQueue> {
588
- const apiPath = '/health/queue/usage-count';
600
+ async getQueueUsage(threshold?: number): Promise<Models.HealthQueue> {
601
+ const apiPath = '/health/queue/stats-usage';
589
602
  const payload: Payload = {};
590
603
  if (typeof threshold !== 'undefined') {
591
604
  payload['threshold'] = threshold;
@@ -596,6 +609,8 @@ export class Health {
596
609
  'content-type': 'application/json',
597
610
  }
598
611
 
612
+ payload['project'] = this.client.config.project;
613
+
599
614
 
600
615
  return await this.client.call(
601
616
  'get',
@@ -613,8 +628,8 @@ export class Health {
613
628
  * @throws {AppwriteException}
614
629
  * @returns {Promise<Models.HealthQueue>}
615
630
  */
616
- async getQueueUsageDump(threshold?: number): Promise<Models.HealthQueue> {
617
- const apiPath = '/health/queue/usage-dump';
631
+ async getQueueStatsUsageDump(threshold?: number): Promise<Models.HealthQueue> {
632
+ const apiPath = '/health/queue/stats-usage-dump';
618
633
  const payload: Payload = {};
619
634
  if (typeof threshold !== 'undefined') {
620
635
  payload['threshold'] = threshold;
@@ -625,6 +640,8 @@ export class Health {
625
640
  'content-type': 'application/json',
626
641
  }
627
642
 
643
+ payload['project'] = this.client.config.project;
644
+
628
645
 
629
646
  return await this.client.call(
630
647
  'get',
@@ -654,6 +671,8 @@ export class Health {
654
671
  'content-type': 'application/json',
655
672
  }
656
673
 
674
+ payload['project'] = this.client.config.project;
675
+
657
676
 
658
677
  return await this.client.call(
659
678
  'get',
@@ -679,6 +698,8 @@ export class Health {
679
698
  'content-type': 'application/json',
680
699
  }
681
700
 
701
+ payload['project'] = this.client.config.project;
702
+
682
703
 
683
704
  return await this.client.call(
684
705
  'get',
@@ -704,6 +725,8 @@ export class Health {
704
725
  'content-type': 'application/json',
705
726
  }
706
727
 
728
+ payload['project'] = this.client.config.project;
729
+
707
730
 
708
731
  return await this.client.call(
709
732
  'get',
@@ -729,6 +752,8 @@ export class Health {
729
752
  'content-type': 'application/json',
730
753
  }
731
754
 
755
+ payload['project'] = this.client.config.project;
756
+
732
757
 
733
758
  return await this.client.call(
734
759
  'get',
@@ -28,6 +28,8 @@ export class Locale {
28
28
  'content-type': 'application/json',
29
29
  }
30
30
 
31
+ payload['project'] = this.client.config.project;
32
+
31
33
 
32
34
  return await this.client.call(
33
35
  'get',
@@ -53,6 +55,8 @@ export class Locale {
53
55
  'content-type': 'application/json',
54
56
  }
55
57
 
58
+ payload['project'] = this.client.config.project;
59
+
56
60
 
57
61
  return await this.client.call(
58
62
  'get',
@@ -78,6 +82,8 @@ export class Locale {
78
82
  'content-type': 'application/json',
79
83
  }
80
84
 
85
+ payload['project'] = this.client.config.project;
86
+
81
87
 
82
88
  return await this.client.call(
83
89
  'get',
@@ -103,6 +109,8 @@ export class Locale {
103
109
  'content-type': 'application/json',
104
110
  }
105
111
 
112
+ payload['project'] = this.client.config.project;
113
+
106
114
 
107
115
  return await this.client.call(
108
116
  'get',
@@ -128,6 +136,8 @@ export class Locale {
128
136
  'content-type': 'application/json',
129
137
  }
130
138
 
139
+ payload['project'] = this.client.config.project;
140
+
131
141
 
132
142
  return await this.client.call(
133
143
  'get',
@@ -153,6 +163,8 @@ export class Locale {
153
163
  'content-type': 'application/json',
154
164
  }
155
165
 
166
+ payload['project'] = this.client.config.project;
167
+
156
168
 
157
169
  return await this.client.call(
158
170
  'get',
@@ -178,6 +190,8 @@ export class Locale {
178
190
  'content-type': 'application/json',
179
191
  }
180
192
 
193
+ payload['project'] = this.client.config.project;
194
+
181
195
 
182
196
  return await this.client.call(
183
197
  'get',
@@ -203,6 +217,8 @@ export class Locale {
203
217
  'content-type': 'application/json',
204
218
  }
205
219
 
220
+ payload['project'] = this.client.config.project;
221
+
206
222
 
207
223
  return await this.client.call(
208
224
  'get',