@appwrite.io/console 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +45 -6
  3. package/README.md +82 -2
  4. package/dist/cjs/sdk.js +246 -193
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +246 -193
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +246 -193
  9. package/docs/examples/databases/create-document.md +1 -3
  10. package/docs/examples/databases/create-documents.md +1 -1
  11. package/docs/examples/functions/create-execution.md +1 -1
  12. package/docs/examples/organizations/get-available-credits.md +13 -0
  13. package/docs/examples/organizations/update-projects.md +14 -0
  14. package/docs/examples/vcs/get-repository-contents.md +2 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +1 -1
  17. package/src/models.ts +241 -9
  18. package/src/services/account.ts +97 -36
  19. package/src/services/avatars.ts +26 -20
  20. package/src/services/backups.ts +11 -0
  21. package/src/services/console.ts +8 -1
  22. package/src/services/databases.ts +97 -33
  23. package/src/services/domains.ts +111 -69
  24. package/src/services/functions.ts +37 -8
  25. package/src/services/graphql.ts +1 -0
  26. package/src/services/health.ts +26 -1
  27. package/src/services/locale.ts +9 -2
  28. package/src/services/messaging.ts +53 -8
  29. package/src/services/migrations.ts +12 -0
  30. package/src/services/organizations.ts +106 -16
  31. package/src/services/project.ts +5 -0
  32. package/src/services/projects.ts +50 -0
  33. package/src/services/proxy.ts +7 -0
  34. package/src/services/sites.ts +32 -4
  35. package/src/services/storage.ts +23 -9
  36. package/src/services/teams.ts +30 -17
  37. package/src/services/tokens.ts +4 -0
  38. package/src/services/users.ts +69 -27
  39. package/src/services/vcs.ts +16 -4
  40. package/types/models.d.ts +228 -192
  41. package/types/services/account.d.ts +36 -36
  42. package/types/services/avatars.d.ts +20 -20
  43. package/types/services/console.d.ts +1 -1
  44. package/types/services/databases.d.ts +43 -33
  45. package/types/services/domains.d.ts +69 -69
  46. package/types/services/functions.d.ts +8 -8
  47. package/types/services/health.d.ts +1 -1
  48. package/types/services/locale.d.ts +2 -2
  49. package/types/services/messaging.d.ts +8 -8
  50. package/types/services/organizations.d.ts +33 -16
  51. package/types/services/sites.d.ts +4 -4
  52. package/types/services/storage.d.ts +9 -9
  53. package/types/services/teams.d.ts +17 -17
  54. package/types/services/users.d.ts +27 -27
  55. package/types/services/vcs.d.ts +4 -4
@@ -43,6 +43,7 @@ export class Functions {
43
43
  payload
44
44
  );
45
45
  }
46
+
46
47
  /**
47
48
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
48
49
  *
@@ -146,6 +147,7 @@ export class Functions {
146
147
  payload
147
148
  );
148
149
  }
150
+
149
151
  /**
150
152
  * Get a list of all runtimes that are currently active on your instance.
151
153
  *
@@ -167,6 +169,7 @@ export class Functions {
167
169
  payload
168
170
  );
169
171
  }
172
+
170
173
  /**
171
174
  * List allowed function specifications for this instance.
172
175
  *
@@ -188,6 +191,7 @@ export class Functions {
188
191
  payload
189
192
  );
190
193
  }
194
+
191
195
  /**
192
196
  * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
193
197
  *
@@ -225,6 +229,7 @@ export class Functions {
225
229
  payload
226
230
  );
227
231
  }
232
+
228
233
  /**
229
234
  * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
230
235
  *
@@ -250,6 +255,7 @@ export class Functions {
250
255
  payload
251
256
  );
252
257
  }
258
+
253
259
  /**
254
260
  * Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
255
261
  *
@@ -275,6 +281,7 @@ export class Functions {
275
281
  payload
276
282
  );
277
283
  }
284
+
278
285
  /**
279
286
  * Get a function by its unique ID.
280
287
  *
@@ -300,6 +307,7 @@ export class Functions {
300
307
  payload
301
308
  );
302
309
  }
310
+
303
311
  /**
304
312
  * Update function by its unique ID.
305
313
  *
@@ -397,6 +405,7 @@ export class Functions {
397
405
  payload
398
406
  );
399
407
  }
408
+
400
409
  /**
401
410
  * Delete a function by its unique ID.
402
411
  *
@@ -423,6 +432,7 @@ export class Functions {
423
432
  payload
424
433
  );
425
434
  }
435
+
426
436
  /**
427
437
  * Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
428
438
  *
@@ -456,6 +466,7 @@ export class Functions {
456
466
  payload
457
467
  );
458
468
  }
469
+
459
470
  /**
460
471
  * Get a list of all the function's code deployments. You can use the query params to filter your results.
461
472
  *
@@ -489,12 +500,13 @@ export class Functions {
489
500
  payload
490
501
  );
491
502
  }
503
+
492
504
  /**
493
505
  * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
494
-
495
- This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
496
-
497
- Use the "command" param to set the entrypoint used to execute your code.
506
+ *
507
+ * This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
508
+ *
509
+ * Use the "command" param to set the entrypoint used to execute your code.
498
510
  *
499
511
  * @param {string} functionId
500
512
  * @param {File} code
@@ -542,6 +554,7 @@ Use the "command" param to set the entrypoint used to execute your cod
542
554
  onProgress
543
555
  );
544
556
  }
557
+
545
558
  /**
546
559
  * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
547
560
  *
@@ -579,10 +592,11 @@ Use the "command" param to set the entrypoint used to execute your cod
579
592
  payload
580
593
  );
581
594
  }
595
+
582
596
  /**
583
597
  * Create a deployment based on a template.
584
-
585
- Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
598
+ *
599
+ * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
586
600
  *
587
601
  * @param {string} functionId
588
602
  * @param {string} repository
@@ -639,10 +653,11 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
639
653
  payload
640
654
  );
641
655
  }
656
+
642
657
  /**
643
658
  * Create a deployment when a function is connected to VCS.
644
-
645
- This endpoint lets you create deployment from a branch, commit, or a tag.
659
+ *
660
+ * This endpoint lets you create deployment from a branch, commit, or a tag.
646
661
  *
647
662
  * @param {string} functionId
648
663
  * @param {VCSDeploymentType} type
@@ -685,6 +700,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
685
700
  payload
686
701
  );
687
702
  }
703
+
688
704
  /**
689
705
  * Get a function deployment by its unique ID.
690
706
  *
@@ -714,6 +730,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
714
730
  payload
715
731
  );
716
732
  }
733
+
717
734
  /**
718
735
  * Delete a code deployment by its unique ID.
719
736
  *
@@ -744,6 +761,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
744
761
  payload
745
762
  );
746
763
  }
764
+
747
765
  /**
748
766
  * Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
749
767
  *
@@ -778,6 +796,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
778
796
 
779
797
  return uri.toString();
780
798
  }
799
+
781
800
  /**
782
801
  * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
783
802
  *
@@ -808,6 +827,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
808
827
  payload
809
828
  );
810
829
  }
830
+
811
831
  /**
812
832
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
813
833
  *
@@ -837,6 +857,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
837
857
  payload
838
858
  );
839
859
  }
860
+
840
861
  /**
841
862
  * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
842
863
  *
@@ -887,6 +908,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
887
908
  payload
888
909
  );
889
910
  }
911
+
890
912
  /**
891
913
  * Get a function execution log by its unique ID.
892
914
  *
@@ -916,6 +938,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
916
938
  payload
917
939
  );
918
940
  }
941
+
919
942
  /**
920
943
  * Delete a function execution by its unique ID.
921
944
  *
@@ -946,6 +969,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
946
969
  payload
947
970
  );
948
971
  }
972
+
949
973
  /**
950
974
  * Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
951
975
  *
@@ -975,6 +999,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
975
999
  payload
976
1000
  );
977
1001
  }
1002
+
978
1003
  /**
979
1004
  * Get a list of all variables of a specific function.
980
1005
  *
@@ -1000,6 +1025,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1000
1025
  payload
1001
1026
  );
1002
1027
  }
1028
+
1003
1029
  /**
1004
1030
  * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
1005
1031
  *
@@ -1044,6 +1070,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1044
1070
  payload
1045
1071
  );
1046
1072
  }
1073
+
1047
1074
  /**
1048
1075
  * Get a variable by its unique ID.
1049
1076
  *
@@ -1073,6 +1100,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1073
1100
  payload
1074
1101
  );
1075
1102
  }
1103
+
1076
1104
  /**
1077
1105
  * Update variable by its unique ID.
1078
1106
  *
@@ -1118,6 +1146,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1118
1146
  payload
1119
1147
  );
1120
1148
  }
1149
+
1121
1150
  /**
1122
1151
  * Delete a variable by its unique ID.
1123
1152
  *
@@ -39,6 +39,7 @@ export class Graphql {
39
39
  payload
40
40
  );
41
41
  }
42
+
42
43
  /**
43
44
  * Execute a GraphQL mutation.
44
45
  *
@@ -31,6 +31,7 @@ export class Health {
31
31
  payload
32
32
  );
33
33
  }
34
+
34
35
  /**
35
36
  * Check the Appwrite Antivirus server is up and connection is successful.
36
37
  *
@@ -52,6 +53,7 @@ export class Health {
52
53
  payload
53
54
  );
54
55
  }
56
+
55
57
  /**
56
58
  * Check the Appwrite in-memory cache servers are up and connection is successful.
57
59
  *
@@ -73,6 +75,7 @@ export class Health {
73
75
  payload
74
76
  );
75
77
  }
78
+
76
79
  /**
77
80
  * Get the SSL certificate for a domain
78
81
  *
@@ -98,6 +101,7 @@ export class Health {
98
101
  payload
99
102
  );
100
103
  }
104
+
101
105
  /**
102
106
  * Check the Appwrite database servers are up and connection is successful.
103
107
  *
@@ -119,6 +123,7 @@ export class Health {
119
123
  payload
120
124
  );
121
125
  }
126
+
122
127
  /**
123
128
  * Check the Appwrite pub-sub servers are up and connection is successful.
124
129
  *
@@ -140,6 +145,7 @@ export class Health {
140
145
  payload
141
146
  );
142
147
  }
148
+
143
149
  /**
144
150
  * Get billing project aggregation queue
145
151
  *
@@ -165,6 +171,7 @@ export class Health {
165
171
  payload
166
172
  );
167
173
  }
174
+
168
175
  /**
169
176
  * Get billing team aggregation queue
170
177
  *
@@ -190,6 +197,7 @@ export class Health {
190
197
  payload
191
198
  );
192
199
  }
200
+
193
201
  /**
194
202
  * Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
195
203
  *
@@ -215,6 +223,7 @@ export class Health {
215
223
  payload
216
224
  );
217
225
  }
226
+
218
227
  /**
219
228
  * Get the priority builds queue size.
220
229
  *
@@ -240,6 +249,7 @@ export class Health {
240
249
  payload
241
250
  );
242
251
  }
252
+
243
253
  /**
244
254
  * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
245
255
  *
@@ -265,6 +275,7 @@ export class Health {
265
275
  payload
266
276
  );
267
277
  }
278
+
268
279
  /**
269
280
  * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
270
281
  *
@@ -294,6 +305,7 @@ export class Health {
294
305
  payload
295
306
  );
296
307
  }
308
+
297
309
  /**
298
310
  * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
299
311
  *
@@ -319,9 +331,10 @@ export class Health {
319
331
  payload
320
332
  );
321
333
  }
334
+
322
335
  /**
323
336
  * Returns the amount of failed jobs in a given queue.
324
-
337
+ *
325
338
  *
326
339
  * @param {Name} name
327
340
  * @param {number} threshold
@@ -349,6 +362,7 @@ export class Health {
349
362
  payload
350
363
  );
351
364
  }
365
+
352
366
  /**
353
367
  * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
354
368
  *
@@ -374,6 +388,7 @@ export class Health {
374
388
  payload
375
389
  );
376
390
  }
391
+
377
392
  /**
378
393
  * Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
379
394
  *
@@ -399,6 +414,7 @@ export class Health {
399
414
  payload
400
415
  );
401
416
  }
417
+
402
418
  /**
403
419
  * Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
404
420
  *
@@ -424,6 +440,7 @@ export class Health {
424
440
  payload
425
441
  );
426
442
  }
443
+
427
444
  /**
428
445
  * Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
429
446
  *
@@ -449,6 +466,7 @@ export class Health {
449
466
  payload
450
467
  );
451
468
  }
469
+
452
470
  /**
453
471
  * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
454
472
  *
@@ -474,6 +492,7 @@ export class Health {
474
492
  payload
475
493
  );
476
494
  }
495
+
477
496
  /**
478
497
  * Get region manager queue
479
498
  *
@@ -499,6 +518,7 @@ export class Health {
499
518
  payload
500
519
  );
501
520
  }
521
+
502
522
  /**
503
523
  * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
504
524
  *
@@ -524,6 +544,7 @@ export class Health {
524
544
  payload
525
545
  );
526
546
  }
547
+
527
548
  /**
528
549
  * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
529
550
  *
@@ -549,6 +570,7 @@ export class Health {
549
570
  payload
550
571
  );
551
572
  }
573
+
552
574
  /**
553
575
  * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
554
576
  *
@@ -574,6 +596,7 @@ export class Health {
574
596
  payload
575
597
  );
576
598
  }
599
+
577
600
  /**
578
601
  * Check the Appwrite storage device is up and connection is successful.
579
602
  *
@@ -595,6 +618,7 @@ export class Health {
595
618
  payload
596
619
  );
597
620
  }
621
+
598
622
  /**
599
623
  * Check the Appwrite local storage device is up and connection is successful.
600
624
  *
@@ -616,6 +640,7 @@ export class Health {
616
640
  payload
617
641
  );
618
642
  }
643
+
619
644
  /**
620
645
  * Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
621
646
  *
@@ -11,8 +11,8 @@ export class Locale {
11
11
 
12
12
  /**
13
13
  * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
14
-
15
- ([IP Geolocation by DB-IP](https://db-ip.com))
14
+ *
15
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
16
16
  *
17
17
  * @throws {AppwriteException}
18
18
  * @returns {Promise<Models.Locale>}
@@ -32,6 +32,7 @@ export class Locale {
32
32
  payload
33
33
  );
34
34
  }
35
+
35
36
  /**
36
37
  * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
37
38
  *
@@ -53,6 +54,7 @@ export class Locale {
53
54
  payload
54
55
  );
55
56
  }
57
+
56
58
  /**
57
59
  * List of all continents. You can use the locale header to get the data in a supported language.
58
60
  *
@@ -74,6 +76,7 @@ export class Locale {
74
76
  payload
75
77
  );
76
78
  }
79
+
77
80
  /**
78
81
  * List of all countries. You can use the locale header to get the data in a supported language.
79
82
  *
@@ -95,6 +98,7 @@ export class Locale {
95
98
  payload
96
99
  );
97
100
  }
101
+
98
102
  /**
99
103
  * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
100
104
  *
@@ -116,6 +120,7 @@ export class Locale {
116
120
  payload
117
121
  );
118
122
  }
123
+
119
124
  /**
120
125
  * List of all countries phone codes. You can use the locale header to get the data in a supported language.
121
126
  *
@@ -137,6 +142,7 @@ export class Locale {
137
142
  payload
138
143
  );
139
144
  }
145
+
140
146
  /**
141
147
  * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
142
148
  *
@@ -158,6 +164,7 @@ export class Locale {
158
164
  payload
159
165
  );
160
166
  }
167
+
161
168
  /**
162
169
  * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
163
170
  *