@appwrite.io/console 0.3.0 → 0.4.1

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 (54) hide show
  1. package/.github/workflows/publish.yml +2 -2
  2. package/README.md +3 -3
  3. package/dist/cjs/sdk.js +1354 -1197
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +1354 -1197
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +1354 -1197
  8. package/docs/examples/functions/create.md +1 -1
  9. package/docs/examples/functions/update.md +1 -1
  10. package/docs/examples/{projects/get-usage.md → health/get-queue-builds.md} +3 -3
  11. package/docs/examples/{account/create-with-invite-code.md → health/get-queue-databases.md} +3 -3
  12. package/docs/examples/health/get-queue-deletes.md +18 -0
  13. package/docs/examples/health/get-queue-mails.md +18 -0
  14. package/docs/examples/health/get-queue-messaging.md +18 -0
  15. package/docs/examples/health/get-queue-migrations.md +18 -0
  16. package/docs/examples/project/get-usage.md +1 -1
  17. package/docs/examples/teams/create-membership.md +1 -1
  18. package/package.json +3 -2
  19. package/src/client.ts +1 -1
  20. package/src/models.ts +147 -279
  21. package/src/query.ts +1 -1
  22. package/src/role.ts +72 -6
  23. package/src/services/account.ts +154 -204
  24. package/src/services/assistant.ts +3 -3
  25. package/src/services/avatars.ts +32 -31
  26. package/src/services/console.ts +4 -4
  27. package/src/services/databases.ts +195 -195
  28. package/src/services/functions.ts +117 -126
  29. package/src/services/graphql.ts +8 -8
  30. package/src/services/health.ts +219 -50
  31. package/src/services/locale.ts +31 -31
  32. package/src/services/migrations.ts +48 -48
  33. package/src/services/project.ts +40 -22
  34. package/src/services/projects.ts +143 -170
  35. package/src/services/proxy.ts +15 -15
  36. package/src/services/storage.ts +74 -84
  37. package/src/services/teams.ts +62 -66
  38. package/src/services/users.ts +132 -135
  39. package/src/services/vcs.ts +27 -27
  40. package/types/models.d.ts +147 -279
  41. package/types/role.d.ts +62 -0
  42. package/types/services/account.d.ts +61 -70
  43. package/types/services/avatars.d.ts +11 -10
  44. package/types/services/console.d.ts +1 -1
  45. package/types/services/databases.d.ts +51 -51
  46. package/types/services/functions.d.ts +32 -27
  47. package/types/services/graphql.d.ts +2 -2
  48. package/types/services/health.d.ts +85 -14
  49. package/types/services/locale.d.ts +7 -7
  50. package/types/services/project.d.ts +4 -2
  51. package/types/services/projects.d.ts +26 -36
  52. package/types/services/storage.d.ts +13 -13
  53. package/types/services/teams.d.ts +20 -20
  54. package/types/services/users.d.ts +45 -44
@@ -23,14 +23,14 @@ export class Assistant extends Service {
23
23
  throw new AppwriteException('Missing required parameter: "prompt"');
24
24
  }
25
25
 
26
- let path = '/console/assistant';
27
- let payload: Payload = {};
26
+ const apiPath = '/console/assistant';
27
+ const payload: Payload = {};
28
28
 
29
29
  if (typeof prompt !== 'undefined') {
30
30
  payload['prompt'] = prompt;
31
31
  }
32
32
 
33
- const uri = new URL(this.client.config.endpoint + path);
33
+ const uri = new URL(this.client.config.endpoint + apiPath);
34
34
  return await this.client.call('post', uri, {
35
35
  'content-type': 'application/json',
36
36
  }, payload);
@@ -11,12 +11,13 @@ export class Avatars extends Service {
11
11
  }
12
12
 
13
13
  /**
14
- * Get Browser Icon
14
+ * Get browser icon
15
15
  *
16
16
  * You can use this endpoint to show different browser icons to your users.
17
17
  * The code argument receives the browser code as it appears in your user [GET
18
- * /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
19
- * width, height and quality arguments to change the output settings.
18
+ * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
19
+ * endpoint. Use width, height and quality arguments to change the output
20
+ * settings.
20
21
  *
21
22
  * When one dimension is specified and the other is 0, the image is scaled
22
23
  * with preserved aspect ratio. If both dimensions are 0, the API provides an
@@ -35,8 +36,8 @@ export class Avatars extends Service {
35
36
  throw new AppwriteException('Missing required parameter: "code"');
36
37
  }
37
38
 
38
- let path = '/avatars/browsers/{code}'.replace('{code}', code);
39
- let payload: Payload = {};
39
+ const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
40
+ const payload: Payload = {};
40
41
 
41
42
  if (typeof width !== 'undefined') {
42
43
  payload['width'] = width;
@@ -50,7 +51,7 @@ export class Avatars extends Service {
50
51
  payload['quality'] = quality;
51
52
  }
52
53
 
53
- const uri = new URL(this.client.config.endpoint + path);
54
+ const uri = new URL(this.client.config.endpoint + apiPath);
54
55
  payload['project'] = this.client.config.project;
55
56
 
56
57
 
@@ -61,7 +62,7 @@ export class Avatars extends Service {
61
62
  }
62
63
 
63
64
  /**
64
- * Get Credit Card Icon
65
+ * Get credit card icon
65
66
  *
66
67
  * The credit card endpoint will return you the icon of the credit card
67
68
  * provider you need. Use width, height and quality arguments to change the
@@ -85,8 +86,8 @@ export class Avatars extends Service {
85
86
  throw new AppwriteException('Missing required parameter: "code"');
86
87
  }
87
88
 
88
- let path = '/avatars/credit-cards/{code}'.replace('{code}', code);
89
- let payload: Payload = {};
89
+ const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
90
+ const payload: Payload = {};
90
91
 
91
92
  if (typeof width !== 'undefined') {
92
93
  payload['width'] = width;
@@ -100,7 +101,7 @@ export class Avatars extends Service {
100
101
  payload['quality'] = quality;
101
102
  }
102
103
 
103
- const uri = new URL(this.client.config.endpoint + path);
104
+ const uri = new URL(this.client.config.endpoint + apiPath);
104
105
  payload['project'] = this.client.config.project;
105
106
 
106
107
 
@@ -111,7 +112,7 @@ export class Avatars extends Service {
111
112
  }
112
113
 
113
114
  /**
114
- * Get Favicon
115
+ * Get favicon
115
116
  *
116
117
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
117
118
  * website URL.
@@ -126,14 +127,14 @@ export class Avatars extends Service {
126
127
  throw new AppwriteException('Missing required parameter: "url"');
127
128
  }
128
129
 
129
- let path = '/avatars/favicon';
130
- let payload: Payload = {};
130
+ const apiPath = '/avatars/favicon';
131
+ const payload: Payload = {};
131
132
 
132
133
  if (typeof url !== 'undefined') {
133
134
  payload['url'] = url;
134
135
  }
135
136
 
136
- const uri = new URL(this.client.config.endpoint + path);
137
+ const uri = new URL(this.client.config.endpoint + apiPath);
137
138
  payload['project'] = this.client.config.project;
138
139
 
139
140
 
@@ -144,12 +145,12 @@ export class Avatars extends Service {
144
145
  }
145
146
 
146
147
  /**
147
- * Get Country Flag
148
+ * Get country flag
148
149
  *
149
150
  * You can use this endpoint to show different country flags icons to your
150
151
  * users. The code argument receives the 2 letter country code. Use width,
151
152
  * height and quality arguments to change the output settings. Country codes
152
- * follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.
153
+ * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
153
154
  *
154
155
  * When one dimension is specified and the other is 0, the image is scaled
155
156
  * with preserved aspect ratio. If both dimensions are 0, the API provides an
@@ -169,8 +170,8 @@ export class Avatars extends Service {
169
170
  throw new AppwriteException('Missing required parameter: "code"');
170
171
  }
171
172
 
172
- let path = '/avatars/flags/{code}'.replace('{code}', code);
173
- let payload: Payload = {};
173
+ const apiPath = '/avatars/flags/{code}'.replace('{code}', code);
174
+ const payload: Payload = {};
174
175
 
175
176
  if (typeof width !== 'undefined') {
176
177
  payload['width'] = width;
@@ -184,7 +185,7 @@ export class Avatars extends Service {
184
185
  payload['quality'] = quality;
185
186
  }
186
187
 
187
- const uri = new URL(this.client.config.endpoint + path);
188
+ const uri = new URL(this.client.config.endpoint + apiPath);
188
189
  payload['project'] = this.client.config.project;
189
190
 
190
191
 
@@ -195,7 +196,7 @@ export class Avatars extends Service {
195
196
  }
196
197
 
197
198
  /**
198
- * Get Image from URL
199
+ * Get image from URL
199
200
  *
200
201
  * Use this endpoint to fetch a remote image URL and crop it to any image size
201
202
  * you want. This endpoint is very useful if you need to crop and display
@@ -219,8 +220,8 @@ export class Avatars extends Service {
219
220
  throw new AppwriteException('Missing required parameter: "url"');
220
221
  }
221
222
 
222
- let path = '/avatars/image';
223
- let payload: Payload = {};
223
+ const apiPath = '/avatars/image';
224
+ const payload: Payload = {};
224
225
 
225
226
  if (typeof url !== 'undefined') {
226
227
  payload['url'] = url;
@@ -234,7 +235,7 @@ export class Avatars extends Service {
234
235
  payload['height'] = height;
235
236
  }
236
237
 
237
- const uri = new URL(this.client.config.endpoint + path);
238
+ const uri = new URL(this.client.config.endpoint + apiPath);
238
239
  payload['project'] = this.client.config.project;
239
240
 
240
241
 
@@ -245,7 +246,7 @@ export class Avatars extends Service {
245
246
  }
246
247
 
247
248
  /**
248
- * Get User Initials
249
+ * Get user initials
249
250
  *
250
251
  * Use this endpoint to show your user initials avatar icon on your website or
251
252
  * app. By default, this route will try to print your logged-in user name or
@@ -272,8 +273,8 @@ export class Avatars extends Service {
272
273
  * @returns {URL}
273
274
  */
274
275
  getInitials(name?: string, width?: number, height?: number, background?: string): URL {
275
- let path = '/avatars/initials';
276
- let payload: Payload = {};
276
+ const apiPath = '/avatars/initials';
277
+ const payload: Payload = {};
277
278
 
278
279
  if (typeof name !== 'undefined') {
279
280
  payload['name'] = name;
@@ -291,7 +292,7 @@ export class Avatars extends Service {
291
292
  payload['background'] = background;
292
293
  }
293
294
 
294
- const uri = new URL(this.client.config.endpoint + path);
295
+ const uri = new URL(this.client.config.endpoint + apiPath);
295
296
  payload['project'] = this.client.config.project;
296
297
 
297
298
 
@@ -302,7 +303,7 @@ export class Avatars extends Service {
302
303
  }
303
304
 
304
305
  /**
305
- * Get QR Code
306
+ * Get QR code
306
307
  *
307
308
  * Converts a given plain text to a QR code image. You can use the query
308
309
  * parameters to change the size and style of the resulting image.
@@ -320,8 +321,8 @@ export class Avatars extends Service {
320
321
  throw new AppwriteException('Missing required parameter: "text"');
321
322
  }
322
323
 
323
- let path = '/avatars/qr';
324
- let payload: Payload = {};
324
+ const apiPath = '/avatars/qr';
325
+ const payload: Payload = {};
325
326
 
326
327
  if (typeof text !== 'undefined') {
327
328
  payload['text'] = text;
@@ -339,7 +340,7 @@ export class Avatars extends Service {
339
340
  payload['download'] = download;
340
341
  }
341
342
 
342
- const uri = new URL(this.client.config.endpoint + path);
343
+ const uri = new URL(this.client.config.endpoint + apiPath);
343
344
  payload['project'] = this.client.config.project;
344
345
 
345
346
 
@@ -11,7 +11,7 @@ export class Console extends Service {
11
11
  }
12
12
 
13
13
  /**
14
- * Get Variables
14
+ * Get variables
15
15
  *
16
16
  * Get all Environment Variables that are relevant for the console.
17
17
  *
@@ -19,10 +19,10 @@ export class Console extends Service {
19
19
  * @returns {Promise}
20
20
  */
21
21
  async variables(): Promise<Models.ConsoleVariables> {
22
- let path = '/console/variables';
23
- let payload: Payload = {};
22
+ const apiPath = '/console/variables';
23
+ const payload: Payload = {};
24
24
 
25
- const uri = new URL(this.client.config.endpoint + path);
25
+ const uri = new URL(this.client.config.endpoint + apiPath);
26
26
  return await this.client.call('get', uri, {
27
27
  'content-type': 'application/json',
28
28
  }, payload);