@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
@@ -14,8 +14,8 @@ export class Avatars {
14
14
 
15
15
  /**
16
16
  * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
17
-
18
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
17
+ *
18
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
19
19
  *
20
20
  * @param {Browser} code
21
21
  * @param {number} width
@@ -52,11 +52,12 @@ When one dimension is specified and the other is 0, the image is scaled with pre
52
52
 
53
53
  return uri.toString();
54
54
  }
55
+
55
56
  /**
56
57
  * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
57
-
58
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
59
-
58
+ *
59
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
60
+ *
60
61
  *
61
62
  * @param {CreditCard} code
62
63
  * @param {number} width
@@ -93,10 +94,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre
93
94
 
94
95
  return uri.toString();
95
96
  }
97
+
96
98
  /**
97
99
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
98
-
99
- This endpoint does not follow HTTP redirects.
100
+ *
101
+ * This endpoint does not follow HTTP redirects.
100
102
  *
101
103
  * @param {string} url
102
104
  * @throws {AppwriteException}
@@ -124,11 +126,12 @@ This endpoint does not follow HTTP redirects.
124
126
 
125
127
  return uri.toString();
126
128
  }
129
+
127
130
  /**
128
131
  * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
129
-
130
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
131
-
132
+ *
133
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
134
+ *
132
135
  *
133
136
  * @param {Flag} code
134
137
  * @param {number} width
@@ -165,12 +168,13 @@ When one dimension is specified and the other is 0, the image is scaled with pre
165
168
 
166
169
  return uri.toString();
167
170
  }
171
+
168
172
  /**
169
173
  * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
170
-
171
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
172
-
173
- This endpoint does not follow HTTP redirects.
174
+ *
175
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
176
+ *
177
+ * This endpoint does not follow HTTP redirects.
174
178
  *
175
179
  * @param {string} url
176
180
  * @param {number} width
@@ -206,13 +210,14 @@ This endpoint does not follow HTTP redirects.
206
210
 
207
211
  return uri.toString();
208
212
  }
213
+
209
214
  /**
210
215
  * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
211
-
212
- You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
213
-
214
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
215
-
216
+ *
217
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
218
+ *
219
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
220
+ *
216
221
  *
217
222
  * @param {string} name
218
223
  * @param {number} width
@@ -249,9 +254,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
249
254
 
250
255
  return uri.toString();
251
256
  }
257
+
252
258
  /**
253
259
  * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
254
-
260
+ *
255
261
  *
256
262
  * @param {string} text
257
263
  * @param {number} size
@@ -34,6 +34,7 @@ export class Backups {
34
34
  payload
35
35
  );
36
36
  }
37
+
37
38
  /**
38
39
  * Create a new archive asynchronously for a project.
39
40
  *
@@ -67,6 +68,7 @@ export class Backups {
67
68
  payload
68
69
  );
69
70
  }
71
+
70
72
  /**
71
73
  * Get a backup archive using it's ID.
72
74
  *
@@ -92,6 +94,7 @@ export class Backups {
92
94
  payload
93
95
  );
94
96
  }
97
+
95
98
  /**
96
99
  * Delete an existing archive for a project.
97
100
  *
@@ -118,6 +121,7 @@ export class Backups {
118
121
  payload
119
122
  );
120
123
  }
124
+
121
125
  /**
122
126
  * List all policies for a project.
123
127
  *
@@ -143,6 +147,7 @@ export class Backups {
143
147
  payload
144
148
  );
145
149
  }
150
+
146
151
  /**
147
152
  * Create a new backup policy.
148
153
  *
@@ -205,6 +210,7 @@ export class Backups {
205
210
  payload
206
211
  );
207
212
  }
213
+
208
214
  /**
209
215
  * Get a backup policy using it's ID.
210
216
  *
@@ -230,6 +236,7 @@ export class Backups {
230
236
  payload
231
237
  );
232
238
  }
239
+
233
240
  /**
234
241
  * Update an existing policy using it's ID.
235
242
  *
@@ -272,6 +279,7 @@ export class Backups {
272
279
  payload
273
280
  );
274
281
  }
282
+
275
283
  /**
276
284
  * Delete a policy using it's ID.
277
285
  *
@@ -298,6 +306,7 @@ export class Backups {
298
306
  payload
299
307
  );
300
308
  }
309
+
301
310
  /**
302
311
  * Create and trigger a new restoration for a backup on a project.
303
312
  *
@@ -342,6 +351,7 @@ export class Backups {
342
351
  payload
343
352
  );
344
353
  }
354
+
345
355
  /**
346
356
  * List all backup restorations for a project.
347
357
  *
@@ -367,6 +377,7 @@ export class Backups {
367
377
  payload
368
378
  );
369
379
  }
380
+
370
381
  /**
371
382
  * Get the current status of a backup restoration.
372
383
  *
@@ -35,6 +35,7 @@ export class Console {
35
35
  payload
36
36
  );
37
37
  }
38
+
38
39
  /**
39
40
  * Get the details of a coupon using it's coupon ID.
40
41
  *
@@ -60,6 +61,7 @@ export class Console {
60
61
  payload
61
62
  );
62
63
  }
64
+
63
65
  /**
64
66
  * Return a list of all available plans.
65
67
  *
@@ -81,6 +83,7 @@ export class Console {
81
83
  payload
82
84
  );
83
85
  }
86
+
84
87
  /**
85
88
  * Create a new membership for an account to a program.
86
89
  *
@@ -88,7 +91,7 @@ export class Console {
88
91
  * @throws {AppwriteException}
89
92
  * @returns {Promise<Models.Organization<Preferences>>}
90
93
  */
91
- createProgramMembership<Preferences extends Models.Preferences>(programId: string): Promise<Models.Organization<Preferences>> {
94
+ createProgramMembership<Preferences extends Models.Preferences = Models.DefaultPreferences>(programId: string): Promise<Models.Organization<Preferences>> {
92
95
  if (typeof programId === 'undefined') {
93
96
  throw new AppwriteException('Missing required parameter: "programId"');
94
97
  }
@@ -107,6 +110,7 @@ export class Console {
107
110
  payload
108
111
  );
109
112
  }
113
+
110
114
  /**
111
115
  * Get all available regions for the console.
112
116
  *
@@ -128,6 +132,7 @@ export class Console {
128
132
  payload
129
133
  );
130
134
  }
135
+
131
136
  /**
132
137
  * Check if a resource ID is available.
133
138
  *
@@ -163,6 +168,7 @@ export class Console {
163
168
  payload
164
169
  );
165
170
  }
171
+
166
172
  /**
167
173
  * Create a new source.
168
174
  *
@@ -205,6 +211,7 @@ export class Console {
205
211
  payload
206
212
  );
207
213
  }
214
+
208
215
  /**
209
216
  * Get all Environment Variables that are relevant for the console.
210
217
  *