@appwrite.io/console 1.5.1 → 1.6.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 (66) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/sdk.js +7714 -9758
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +7714 -9758
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +7714 -9758
  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/docs/examples/organizations/validate-invoice.md +14 -0
  14. package/package.json +1 -1
  15. package/src/client.ts +21 -4
  16. package/src/enums/credit-card.ts +1 -0
  17. package/src/enums/name.ts +3 -2
  18. package/src/enums/o-auth-provider.ts +1 -0
  19. package/src/enums/runtime.ts +3 -0
  20. package/src/models.ts +202 -5
  21. package/src/services/account.ts +126 -430
  22. package/src/services/assistant.ts +2 -7
  23. package/src/services/avatars.ts +7 -21
  24. package/src/services/backups.ts +24 -84
  25. package/src/services/console.ts +14 -49
  26. package/src/services/databases.ts +99 -350
  27. package/src/services/functions.ts +55 -192
  28. package/src/services/graphql.ts +4 -14
  29. package/src/services/health.ts +55 -207
  30. package/src/services/locale.ts +16 -56
  31. package/src/services/messaging.ts +92 -322
  32. package/src/services/migrations.ts +24 -84
  33. package/src/services/organizations.ts +118 -196
  34. package/src/services/project.ts +12 -42
  35. package/src/services/projects.ts +92 -322
  36. package/src/services/proxy.ts +10 -35
  37. package/src/services/storage.ts +27 -93
  38. package/src/services/teams.ts +28 -98
  39. package/src/services/users.ts +86 -301
  40. package/src/services/vcs.ts +20 -70
  41. package/types/enums/credit-card.d.ts +2 -1
  42. package/types/enums/name.d.ts +3 -2
  43. package/types/enums/o-auth-provider.d.ts +1 -0
  44. package/types/enums/runtime.d.ts +3 -0
  45. package/types/models.d.ts +202 -5
  46. package/types/services/account.d.ts +4 -128
  47. package/types/services/assistant.d.ts +0 -2
  48. package/types/services/avatars.d.ts +0 -14
  49. package/types/services/backups.d.ts +0 -24
  50. package/types/services/console.d.ts +0 -14
  51. package/types/services/databases.d.ts +5 -100
  52. package/types/services/functions.d.ts +0 -56
  53. package/types/services/graphql.d.ts +0 -4
  54. package/types/services/health.d.ts +5 -64
  55. package/types/services/locale.d.ts +0 -16
  56. package/types/services/messaging.d.ts +0 -92
  57. package/types/services/migrations.d.ts +0 -24
  58. package/types/services/organizations.d.ts +21 -60
  59. package/types/services/project.d.ts +0 -12
  60. package/types/services/projects.d.ts +0 -92
  61. package/types/services/proxy.d.ts +0 -10
  62. package/types/services/storage.d.ts +0 -30
  63. package/types/services/teams.d.ts +0 -28
  64. package/types/services/users.d.ts +0 -86
  65. package/types/services/vcs.d.ts +0 -20
  66. package/docs/examples/health/get-queue.md +0 -11
@@ -10,15 +10,13 @@ export class Assistant {
10
10
  }
11
11
 
12
12
  /**
13
- * Ask query
14
- *
15
13
  * Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
16
14
  *
17
15
  * @param {string} prompt
18
16
  * @throws {AppwriteException}
19
17
  * @returns {Promise<{}>}
20
18
  */
21
- async chat(prompt: string): Promise<{}> {
19
+ chat(prompt: string): Promise<{}> {
22
20
  if (typeof prompt === 'undefined') {
23
21
  throw new AppwriteException('Missing required parameter: "prompt"');
24
22
  }
@@ -33,10 +31,7 @@ export class Assistant {
33
31
  'content-type': 'application/json',
34
32
  }
35
33
 
36
- payload['project'] = this.client.config.project;
37
-
38
-
39
- return await this.client.call(
34
+ return this.client.call(
40
35
  'post',
41
36
  uri,
42
37
  apiHeaders,
@@ -13,8 +13,6 @@ export class Avatars {
13
13
  }
14
14
 
15
15
  /**
16
- * Get browser icon
17
- *
18
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.
19
17
 
20
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.
@@ -52,12 +50,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
52
50
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
53
51
  uri.searchParams.append(key, value);
54
52
  }
55
-
53
+
56
54
  return uri.toString();
57
55
  }
58
56
  /**
59
- * Get credit card icon
60
- *
61
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.
62
58
 
63
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.
@@ -96,12 +92,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
96
92
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
97
93
  uri.searchParams.append(key, value);
98
94
  }
99
-
95
+
100
96
  return uri.toString();
101
97
  }
102
98
  /**
103
- * Get favicon
104
- *
105
99
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
106
100
 
107
101
  This endpoint does not follow HTTP redirects.
@@ -130,12 +124,10 @@ This endpoint does not follow HTTP redirects.
130
124
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
131
125
  uri.searchParams.append(key, value);
132
126
  }
133
-
127
+
134
128
  return uri.toString();
135
129
  }
136
130
  /**
137
- * Get country flag
138
- *
139
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.
140
132
 
141
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.
@@ -174,12 +166,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
174
166
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
175
167
  uri.searchParams.append(key, value);
176
168
  }
177
-
169
+
178
170
  return uri.toString();
179
171
  }
180
172
  /**
181
- * Get image from URL
182
- *
183
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.
184
174
 
185
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.
@@ -218,12 +208,10 @@ This endpoint does not follow HTTP redirects.
218
208
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
219
209
  uri.searchParams.append(key, value);
220
210
  }
221
-
211
+
222
212
  return uri.toString();
223
213
  }
224
214
  /**
225
- * Get user initials
226
- *
227
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 &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
228
216
 
229
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&#039;s initials when reloading the same theme will always return for the same initials.
@@ -264,12 +252,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
264
252
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
265
253
  uri.searchParams.append(key, value);
266
254
  }
267
-
255
+
268
256
  return uri.toString();
269
257
  }
270
258
  /**
271
- * Get QR code
272
- *
273
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.
274
260
 
275
261
  *
@@ -309,7 +295,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre
309
295
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
310
296
  uri.searchParams.append(key, value);
311
297
  }
312
-
298
+
313
299
  return uri.toString();
314
300
  }
315
301
  }
@@ -10,15 +10,13 @@ export class Backups {
10
10
  }
11
11
 
12
12
  /**
13
- * List archives
14
- *
15
13
  * List all archives for a project.
16
14
  *
17
15
  * @param {string[]} queries
18
16
  * @throws {AppwriteException}
19
17
  * @returns {Promise<Models.BackupArchiveList>}
20
18
  */
21
- async listArchives(queries?: string[]): Promise<Models.BackupArchiveList> {
19
+ listArchives(queries?: string[]): Promise<Models.BackupArchiveList> {
22
20
  const apiPath = '/backups/archives';
23
21
  const payload: Payload = {};
24
22
  if (typeof queries !== 'undefined') {
@@ -30,10 +28,7 @@ export class Backups {
30
28
  'content-type': 'application/json',
31
29
  }
32
30
 
33
- payload['project'] = this.client.config.project;
34
-
35
-
36
- return await this.client.call(
31
+ return this.client.call(
37
32
  'get',
38
33
  uri,
39
34
  apiHeaders,
@@ -41,8 +36,6 @@ export class Backups {
41
36
  );
42
37
  }
43
38
  /**
44
- * Create archive
45
- *
46
39
  * Create a new archive asynchronously for a project.
47
40
  *
48
41
  * @param {string[]} services
@@ -50,7 +43,7 @@ export class Backups {
50
43
  * @throws {AppwriteException}
51
44
  * @returns {Promise<Models.BackupArchive>}
52
45
  */
53
- async createArchive(services: string[], resourceId?: string): Promise<Models.BackupArchive> {
46
+ createArchive(services: string[], resourceId?: string): Promise<Models.BackupArchive> {
54
47
  if (typeof services === 'undefined') {
55
48
  throw new AppwriteException('Missing required parameter: "services"');
56
49
  }
@@ -68,10 +61,7 @@ export class Backups {
68
61
  'content-type': 'application/json',
69
62
  }
70
63
 
71
- payload['project'] = this.client.config.project;
72
-
73
-
74
- return await this.client.call(
64
+ return this.client.call(
75
65
  'post',
76
66
  uri,
77
67
  apiHeaders,
@@ -79,15 +69,13 @@ export class Backups {
79
69
  );
80
70
  }
81
71
  /**
82
- * Get backup archive
83
- *
84
72
  * Get a backup archive using it&#039;s ID.
85
73
  *
86
74
  * @param {string} archiveId
87
75
  * @throws {AppwriteException}
88
76
  * @returns {Promise<Models.BackupArchive>}
89
77
  */
90
- async getArchive(archiveId: string): Promise<Models.BackupArchive> {
78
+ getArchive(archiveId: string): Promise<Models.BackupArchive> {
91
79
  if (typeof archiveId === 'undefined') {
92
80
  throw new AppwriteException('Missing required parameter: "archiveId"');
93
81
  }
@@ -99,10 +87,7 @@ export class Backups {
99
87
  'content-type': 'application/json',
100
88
  }
101
89
 
102
- payload['project'] = this.client.config.project;
103
-
104
-
105
- return await this.client.call(
90
+ return this.client.call(
106
91
  'get',
107
92
  uri,
108
93
  apiHeaders,
@@ -110,15 +95,13 @@ export class Backups {
110
95
  );
111
96
  }
112
97
  /**
113
- * Delete archive
114
- *
115
98
  * Delete an existing archive for a project.
116
99
  *
117
100
  * @param {string} archiveId
118
101
  * @throws {AppwriteException}
119
102
  * @returns {Promise<{}>}
120
103
  */
121
- async deleteArchive(archiveId: string): Promise<{}> {
104
+ deleteArchive(archiveId: string): Promise<{}> {
122
105
  if (typeof archiveId === 'undefined') {
123
106
  throw new AppwriteException('Missing required parameter: "archiveId"');
124
107
  }
@@ -130,10 +113,7 @@ export class Backups {
130
113
  'content-type': 'application/json',
131
114
  }
132
115
 
133
- payload['project'] = this.client.config.project;
134
-
135
-
136
- return await this.client.call(
116
+ return this.client.call(
137
117
  'delete',
138
118
  uri,
139
119
  apiHeaders,
@@ -141,15 +121,13 @@ export class Backups {
141
121
  );
142
122
  }
143
123
  /**
144
- * List backup policies
145
- *
146
124
  * List all policies for a project.
147
125
  *
148
126
  * @param {string[]} queries
149
127
  * @throws {AppwriteException}
150
128
  * @returns {Promise<Models.BackupPolicyList>}
151
129
  */
152
- async listPolicies(queries?: string[]): Promise<Models.BackupPolicyList> {
130
+ listPolicies(queries?: string[]): Promise<Models.BackupPolicyList> {
153
131
  const apiPath = '/backups/policies';
154
132
  const payload: Payload = {};
155
133
  if (typeof queries !== 'undefined') {
@@ -161,10 +139,7 @@ export class Backups {
161
139
  'content-type': 'application/json',
162
140
  }
163
141
 
164
- payload['project'] = this.client.config.project;
165
-
166
-
167
- return await this.client.call(
142
+ return this.client.call(
168
143
  'get',
169
144
  uri,
170
145
  apiHeaders,
@@ -172,8 +147,6 @@ export class Backups {
172
147
  );
173
148
  }
174
149
  /**
175
- * Create backup policy
176
- *
177
150
  * Create a new backup policy.
178
151
  *
179
152
  * @param {string} policyId
@@ -186,7 +159,7 @@ export class Backups {
186
159
  * @throws {AppwriteException}
187
160
  * @returns {Promise<Models.BackupPolicy>}
188
161
  */
189
- async createPolicy(policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise<Models.BackupPolicy> {
162
+ createPolicy(policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise<Models.BackupPolicy> {
190
163
  if (typeof policyId === 'undefined') {
191
164
  throw new AppwriteException('Missing required parameter: "policyId"');
192
165
  }
@@ -228,10 +201,7 @@ export class Backups {
228
201
  'content-type': 'application/json',
229
202
  }
230
203
 
231
- payload['project'] = this.client.config.project;
232
-
233
-
234
- return await this.client.call(
204
+ return this.client.call(
235
205
  'post',
236
206
  uri,
237
207
  apiHeaders,
@@ -239,15 +209,13 @@ export class Backups {
239
209
  );
240
210
  }
241
211
  /**
242
- * Get backup policy
243
- *
244
212
  * Get a backup policy using it&#039;s ID.
245
213
  *
246
214
  * @param {string} policyId
247
215
  * @throws {AppwriteException}
248
216
  * @returns {Promise<Models.BackupPolicy>}
249
217
  */
250
- async getPolicy(policyId: string): Promise<Models.BackupPolicy> {
218
+ getPolicy(policyId: string): Promise<Models.BackupPolicy> {
251
219
  if (typeof policyId === 'undefined') {
252
220
  throw new AppwriteException('Missing required parameter: "policyId"');
253
221
  }
@@ -259,10 +227,7 @@ export class Backups {
259
227
  'content-type': 'application/json',
260
228
  }
261
229
 
262
- payload['project'] = this.client.config.project;
263
-
264
-
265
- return await this.client.call(
230
+ return this.client.call(
266
231
  'get',
267
232
  uri,
268
233
  apiHeaders,
@@ -270,8 +235,6 @@ export class Backups {
270
235
  );
271
236
  }
272
237
  /**
273
- * Update backup policy
274
- *
275
238
  * Update an existing policy using it&#039;s ID.
276
239
  *
277
240
  * @param {string} policyId
@@ -282,7 +245,7 @@ export class Backups {
282
245
  * @throws {AppwriteException}
283
246
  * @returns {Promise<Models.BackupPolicy>}
284
247
  */
285
- async updatePolicy(policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean): Promise<Models.BackupPolicy> {
248
+ updatePolicy(policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean): Promise<Models.BackupPolicy> {
286
249
  if (typeof policyId === 'undefined') {
287
250
  throw new AppwriteException('Missing required parameter: "policyId"');
288
251
  }
@@ -306,10 +269,7 @@ export class Backups {
306
269
  'content-type': 'application/json',
307
270
  }
308
271
 
309
- payload['project'] = this.client.config.project;
310
-
311
-
312
- return await this.client.call(
272
+ return this.client.call(
313
273
  'patch',
314
274
  uri,
315
275
  apiHeaders,
@@ -317,15 +277,13 @@ export class Backups {
317
277
  );
318
278
  }
319
279
  /**
320
- * Delete backup policy
321
- *
322
280
  * Delete a policy using it&#039;s ID.
323
281
  *
324
282
  * @param {string} policyId
325
283
  * @throws {AppwriteException}
326
284
  * @returns {Promise<{}>}
327
285
  */
328
- async deletePolicy(policyId: string): Promise<{}> {
286
+ deletePolicy(policyId: string): Promise<{}> {
329
287
  if (typeof policyId === 'undefined') {
330
288
  throw new AppwriteException('Missing required parameter: "policyId"');
331
289
  }
@@ -337,10 +295,7 @@ export class Backups {
337
295
  'content-type': 'application/json',
338
296
  }
339
297
 
340
- payload['project'] = this.client.config.project;
341
-
342
-
343
- return await this.client.call(
298
+ return this.client.call(
344
299
  'delete',
345
300
  uri,
346
301
  apiHeaders,
@@ -348,8 +303,6 @@ export class Backups {
348
303
  );
349
304
  }
350
305
  /**
351
- * Create restoration
352
- *
353
306
  * Create and trigger a new restoration for a backup on a project.
354
307
  *
355
308
  * @param {string} archiveId
@@ -359,7 +312,7 @@ export class Backups {
359
312
  * @throws {AppwriteException}
360
313
  * @returns {Promise<Models.BackupRestoration>}
361
314
  */
362
- async createRestoration(archiveId: string, services: string[], newResourceId?: string, newResourceName?: string): Promise<Models.BackupRestoration> {
315
+ createRestoration(archiveId: string, services: string[], newResourceId?: string, newResourceName?: string): Promise<Models.BackupRestoration> {
363
316
  if (typeof archiveId === 'undefined') {
364
317
  throw new AppwriteException('Missing required parameter: "archiveId"');
365
318
  }
@@ -386,10 +339,7 @@ export class Backups {
386
339
  'content-type': 'application/json',
387
340
  }
388
341
 
389
- payload['project'] = this.client.config.project;
390
-
391
-
392
- return await this.client.call(
342
+ return this.client.call(
393
343
  'post',
394
344
  uri,
395
345
  apiHeaders,
@@ -397,15 +347,13 @@ export class Backups {
397
347
  );
398
348
  }
399
349
  /**
400
- * List restorations
401
- *
402
350
  * List all backup restorations for a project.
403
351
  *
404
352
  * @param {string[]} queries
405
353
  * @throws {AppwriteException}
406
354
  * @returns {Promise<Models.BackupRestorationList>}
407
355
  */
408
- async listRestorations(queries?: string[]): Promise<Models.BackupRestorationList> {
356
+ listRestorations(queries?: string[]): Promise<Models.BackupRestorationList> {
409
357
  const apiPath = '/backups/restorations';
410
358
  const payload: Payload = {};
411
359
  if (typeof queries !== 'undefined') {
@@ -417,10 +365,7 @@ export class Backups {
417
365
  'content-type': 'application/json',
418
366
  }
419
367
 
420
- payload['project'] = this.client.config.project;
421
-
422
-
423
- return await this.client.call(
368
+ return this.client.call(
424
369
  'get',
425
370
  uri,
426
371
  apiHeaders,
@@ -428,15 +373,13 @@ export class Backups {
428
373
  );
429
374
  }
430
375
  /**
431
- * Get backup restoration
432
- *
433
376
  * Get the current status of a backup restoration.
434
377
  *
435
378
  * @param {string} restorationId
436
379
  * @throws {AppwriteException}
437
380
  * @returns {Promise<Models.BackupRestoration>}
438
381
  */
439
- async getRestoration(restorationId: string): Promise<Models.BackupRestoration> {
382
+ getRestoration(restorationId: string): Promise<Models.BackupRestoration> {
440
383
  if (typeof restorationId === 'undefined') {
441
384
  throw new AppwriteException('Missing required parameter: "restorationId"');
442
385
  }
@@ -448,10 +391,7 @@ export class Backups {
448
391
  'content-type': 'application/json',
449
392
  }
450
393
 
451
- payload['project'] = this.client.config.project;
452
-
453
-
454
- return await this.client.call(
394
+ return this.client.call(
455
395
  'get',
456
396
  uri,
457
397
  apiHeaders,
@@ -10,15 +10,13 @@ export class Console {
10
10
  }
11
11
 
12
12
  /**
13
- * Get campaign details
14
- *
15
13
  * Recieve the details of a compaign using it&#039;s ID.
16
14
  *
17
15
  * @param {string} campaignId
18
16
  * @throws {AppwriteException}
19
17
  * @returns {Promise<Models.Campaign>}
20
18
  */
21
- async getCampaign(campaignId: string): Promise<Models.Campaign> {
19
+ getCampaign(campaignId: string): Promise<Models.Campaign> {
22
20
  if (typeof campaignId === 'undefined') {
23
21
  throw new AppwriteException('Missing required parameter: "campaignId"');
24
22
  }
@@ -30,10 +28,7 @@ export class Console {
30
28
  'content-type': 'application/json',
31
29
  }
32
30
 
33
- payload['project'] = this.client.config.project;
34
-
35
-
36
- return await this.client.call(
31
+ return this.client.call(
37
32
  'get',
38
33
  uri,
39
34
  apiHeaders,
@@ -41,15 +36,13 @@ export class Console {
41
36
  );
42
37
  }
43
38
  /**
44
- * Get coupon details
45
- *
46
39
  * Get the details of a coupon using it&#039;s coupon ID.
47
40
  *
48
41
  * @param {string} couponId
49
42
  * @throws {AppwriteException}
50
43
  * @returns {Promise<Models.Coupon>}
51
44
  */
52
- async getCoupon(couponId: string): Promise<Models.Coupon> {
45
+ getCoupon(couponId: string): Promise<Models.Coupon> {
53
46
  if (typeof couponId === 'undefined') {
54
47
  throw new AppwriteException('Missing required parameter: "couponId"');
55
48
  }
@@ -61,10 +54,7 @@ export class Console {
61
54
  'content-type': 'application/json',
62
55
  }
63
56
 
64
- payload['project'] = this.client.config.project;
65
-
66
-
67
- return await this.client.call(
57
+ return this.client.call(
68
58
  'get',
69
59
  uri,
70
60
  apiHeaders,
@@ -72,14 +62,12 @@ export class Console {
72
62
  );
73
63
  }
74
64
  /**
75
- * Get plans
76
- *
77
65
  * Return a list of all available plans.
78
66
  *
79
67
  * @throws {AppwriteException}
80
68
  * @returns {Promise<Models.BillingPlanList>}
81
69
  */
82
- async plans(): Promise<Models.BillingPlanList> {
70
+ plans(): Promise<Models.BillingPlanList> {
83
71
  const apiPath = '/console/plans';
84
72
  const payload: Payload = {};
85
73
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -88,10 +76,7 @@ export class Console {
88
76
  'content-type': 'application/json',
89
77
  }
90
78
 
91
- payload['project'] = this.client.config.project;
92
-
93
-
94
- return await this.client.call(
79
+ return this.client.call(
95
80
  'get',
96
81
  uri,
97
82
  apiHeaders,
@@ -99,15 +84,13 @@ export class Console {
99
84
  );
100
85
  }
101
86
  /**
102
- * Create program membership
103
- *
104
87
  * Create a new membership for an account to a program.
105
88
  *
106
89
  * @param {string} programId
107
90
  * @throws {AppwriteException}
108
91
  * @returns {Promise<Models.Organization<Preferences>>}
109
92
  */
110
- async createProgramMembership<Preferences extends Models.Preferences>(programId: string): Promise<Models.Organization<Preferences>> {
93
+ createProgramMembership<Preferences extends Models.Preferences>(programId: string): Promise<Models.Organization<Preferences>> {
111
94
  if (typeof programId === 'undefined') {
112
95
  throw new AppwriteException('Missing required parameter: "programId"');
113
96
  }
@@ -119,10 +102,7 @@ export class Console {
119
102
  'content-type': 'application/json',
120
103
  }
121
104
 
122
- payload['project'] = this.client.config.project;
123
-
124
-
125
- return await this.client.call(
105
+ return this.client.call(
126
106
  'post',
127
107
  uri,
128
108
  apiHeaders,
@@ -130,14 +110,12 @@ export class Console {
130
110
  );
131
111
  }
132
112
  /**
133
- * Get Regions
134
- *
135
113
  * Get all available regions for the console.
136
114
  *
137
115
  * @throws {AppwriteException}
138
116
  * @returns {Promise<Models.ConsoleRegionList>}
139
117
  */
140
- async regions(): Promise<Models.ConsoleRegionList> {
118
+ regions(): Promise<Models.ConsoleRegionList> {
141
119
  const apiPath = '/console/regions';
142
120
  const payload: Payload = {};
143
121
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -146,10 +124,7 @@ export class Console {
146
124
  'content-type': 'application/json',
147
125
  }
148
126
 
149
- payload['project'] = this.client.config.project;
150
-
151
-
152
- return await this.client.call(
127
+ return this.client.call(
153
128
  'get',
154
129
  uri,
155
130
  apiHeaders,
@@ -157,8 +132,6 @@ export class Console {
157
132
  );
158
133
  }
159
134
  /**
160
- * Create source
161
- *
162
135
  * Create a new source.
163
136
  *
164
137
  * @param {string} ref
@@ -169,7 +142,7 @@ export class Console {
169
142
  * @throws {AppwriteException}
170
143
  * @returns {Promise<{}>}
171
144
  */
172
- async createSource(ref?: string, referrer?: string, utmSource?: string, utmCampaign?: string, utmMedium?: string): Promise<{}> {
145
+ createSource(ref?: string, referrer?: string, utmSource?: string, utmCampaign?: string, utmMedium?: string): Promise<{}> {
173
146
  const apiPath = '/console/sources';
174
147
  const payload: Payload = {};
175
148
  if (typeof ref !== 'undefined') {
@@ -193,10 +166,7 @@ export class Console {
193
166
  'content-type': 'application/json',
194
167
  }
195
168
 
196
- payload['project'] = this.client.config.project;
197
-
198
-
199
- return await this.client.call(
169
+ return this.client.call(
200
170
  'post',
201
171
  uri,
202
172
  apiHeaders,
@@ -204,14 +174,12 @@ export class Console {
204
174
  );
205
175
  }
206
176
  /**
207
- * Get variables
208
- *
209
177
  * Get all Environment Variables that are relevant for the console.
210
178
  *
211
179
  * @throws {AppwriteException}
212
180
  * @returns {Promise<Models.ConsoleVariables>}
213
181
  */
214
- async variables(): Promise<Models.ConsoleVariables> {
182
+ variables(): Promise<Models.ConsoleVariables> {
215
183
  const apiPath = '/console/variables';
216
184
  const payload: Payload = {};
217
185
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -220,10 +188,7 @@ export class Console {
220
188
  'content-type': 'application/json',
221
189
  }
222
190
 
223
- payload['project'] = this.client.config.project;
224
-
225
-
226
- return await this.client.call(
191
+ return this.client.call(
227
192
  'get',
228
193
  uri,
229
194
  apiHeaders,