@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
@@ -11,8 +11,6 @@ export class Organizations {
11
11
  }
12
12
 
13
13
  /**
14
- * List Orgnizations
15
- *
16
14
  * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
17
15
  *
18
16
  * @param {string[]} queries
@@ -20,7 +18,7 @@ export class Organizations {
20
18
  * @throws {AppwriteException}
21
19
  * @returns {Promise<Models.OrganizationList<Preferences>>}
22
20
  */
23
- async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.OrganizationList<Preferences>> {
21
+ list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.OrganizationList<Preferences>> {
24
22
  const apiPath = '/organizations';
25
23
  const payload: Payload = {};
26
24
  if (typeof queries !== 'undefined') {
@@ -35,10 +33,7 @@ export class Organizations {
35
33
  'content-type': 'application/json',
36
34
  }
37
35
 
38
- payload['project'] = this.client.config.project;
39
-
40
-
41
- return await this.client.call(
36
+ return this.client.call(
42
37
  'get',
43
38
  uri,
44
39
  apiHeaders,
@@ -46,8 +41,6 @@ export class Organizations {
46
41
  );
47
42
  }
48
43
  /**
49
- * Create Organization
50
- *
51
44
  * Create a new organization.
52
45
 
53
46
  *
@@ -56,10 +49,14 @@ export class Organizations {
56
49
  * @param {BillingPlan} billingPlan
57
50
  * @param {string} paymentMethodId
58
51
  * @param {string} billingAddressId
52
+ * @param {string[]} invites
53
+ * @param {string} couponId
54
+ * @param {string} taxId
55
+ * @param {number} budget
59
56
  * @throws {AppwriteException}
60
57
  * @returns {Promise<Models.Organization<Preferences>>}
61
58
  */
62
- async create<Preferences extends Models.Preferences>(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise<Models.Organization<Preferences>> {
59
+ create<Preferences extends Models.Preferences>(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>> {
63
60
  if (typeof organizationId === 'undefined') {
64
61
  throw new AppwriteException('Missing required parameter: "organizationId"');
65
62
  }
@@ -86,16 +83,25 @@ export class Organizations {
86
83
  if (typeof billingAddressId !== 'undefined') {
87
84
  payload['billingAddressId'] = billingAddressId;
88
85
  }
86
+ if (typeof invites !== 'undefined') {
87
+ payload['invites'] = invites;
88
+ }
89
+ if (typeof couponId !== 'undefined') {
90
+ payload['couponId'] = couponId;
91
+ }
92
+ if (typeof taxId !== 'undefined') {
93
+ payload['taxId'] = taxId;
94
+ }
95
+ if (typeof budget !== 'undefined') {
96
+ payload['budget'] = budget;
97
+ }
89
98
  const uri = new URL(this.client.config.endpoint + apiPath);
90
99
 
91
100
  const apiHeaders: { [header: string]: string } = {
92
101
  'content-type': 'application/json',
93
102
  }
94
103
 
95
- payload['project'] = this.client.config.project;
96
-
97
-
98
- return await this.client.call(
104
+ return this.client.call(
99
105
  'post',
100
106
  uri,
101
107
  apiHeaders,
@@ -103,15 +109,13 @@ export class Organizations {
103
109
  );
104
110
  }
105
111
  /**
106
- * Delete team
107
- *
108
112
  * Delete an organization.
109
113
  *
110
114
  * @param {string} organizationId
111
115
  * @throws {AppwriteException}
112
116
  * @returns {Promise<{}>}
113
117
  */
114
- async delete(organizationId: string): Promise<{}> {
118
+ delete(organizationId: string): Promise<{}> {
115
119
  if (typeof organizationId === 'undefined') {
116
120
  throw new AppwriteException('Missing required parameter: "organizationId"');
117
121
  }
@@ -123,10 +127,7 @@ export class Organizations {
123
127
  'content-type': 'application/json',
124
128
  }
125
129
 
126
- payload['project'] = this.client.config.project;
127
-
128
-
129
- return await this.client.call(
130
+ return this.client.call(
130
131
  'delete',
131
132
  uri,
132
133
  apiHeaders,
@@ -134,8 +135,6 @@ export class Organizations {
134
135
  );
135
136
  }
136
137
  /**
137
- * List aggregations
138
- *
139
138
  * Get a list of all aggregations for an organization.
140
139
  *
141
140
  * @param {string} organizationId
@@ -143,7 +142,7 @@ export class Organizations {
143
142
  * @throws {AppwriteException}
144
143
  * @returns {Promise<Models.AggregationTeamList>}
145
144
  */
146
- async listAggregations(organizationId: string, queries?: string[]): Promise<Models.AggregationTeamList> {
145
+ listAggregations(organizationId: string, queries?: string[]): Promise<Models.AggregationTeamList> {
147
146
  if (typeof organizationId === 'undefined') {
148
147
  throw new AppwriteException('Missing required parameter: "organizationId"');
149
148
  }
@@ -158,10 +157,7 @@ export class Organizations {
158
157
  'content-type': 'application/json',
159
158
  }
160
159
 
161
- payload['project'] = this.client.config.project;
162
-
163
-
164
- return await this.client.call(
160
+ return this.client.call(
165
161
  'get',
166
162
  uri,
167
163
  apiHeaders,
@@ -169,16 +165,14 @@ export class Organizations {
169
165
  );
170
166
  }
171
167
  /**
172
- * Get invoice
173
- *
174
168
  * Get a specific aggregation using it&#039;s aggregation ID.
175
169
  *
176
170
  * @param {string} organizationId
177
171
  * @param {string} aggregationId
178
172
  * @throws {AppwriteException}
179
- * @returns {Promise<Models.Invoice>}
173
+ * @returns {Promise<Models.AggregationTeam>}
180
174
  */
181
- async getAggregation(organizationId: string, aggregationId: string): Promise<Models.Invoice> {
175
+ getAggregation(organizationId: string, aggregationId: string): Promise<Models.AggregationTeam> {
182
176
  if (typeof organizationId === 'undefined') {
183
177
  throw new AppwriteException('Missing required parameter: "organizationId"');
184
178
  }
@@ -193,10 +187,7 @@ export class Organizations {
193
187
  'content-type': 'application/json',
194
188
  }
195
189
 
196
- payload['project'] = this.client.config.project;
197
-
198
-
199
- return await this.client.call(
190
+ return this.client.call(
200
191
  'get',
201
192
  uri,
202
193
  apiHeaders,
@@ -204,8 +195,6 @@ export class Organizations {
204
195
  );
205
196
  }
206
197
  /**
207
- * Set team&#039;s billing address
208
- *
209
198
  * Set a billing address for an organization.
210
199
  *
211
200
  * @param {string} organizationId
@@ -213,7 +202,7 @@ export class Organizations {
213
202
  * @throws {AppwriteException}
214
203
  * @returns {Promise<Models.Organization<Preferences>>}
215
204
  */
216
- async setBillingAddress<Preferences extends Models.Preferences>(organizationId: string, billingAddressId: string): Promise<Models.Organization<Preferences>> {
205
+ setBillingAddress<Preferences extends Models.Preferences>(organizationId: string, billingAddressId: string): Promise<Models.Organization<Preferences>> {
217
206
  if (typeof organizationId === 'undefined') {
218
207
  throw new AppwriteException('Missing required parameter: "organizationId"');
219
208
  }
@@ -231,10 +220,7 @@ export class Organizations {
231
220
  'content-type': 'application/json',
232
221
  }
233
222
 
234
- payload['project'] = this.client.config.project;
235
-
236
-
237
- return await this.client.call(
223
+ return this.client.call(
238
224
  'patch',
239
225
  uri,
240
226
  apiHeaders,
@@ -242,15 +228,13 @@ export class Organizations {
242
228
  );
243
229
  }
244
230
  /**
245
- * Delete team&#039;s billing address
246
- *
247
231
  * Delete a team&#039;s billing address.
248
232
  *
249
233
  * @param {string} organizationId
250
234
  * @throws {AppwriteException}
251
235
  * @returns {Promise<{}>}
252
236
  */
253
- async deleteBillingAddress(organizationId: string): Promise<{}> {
237
+ deleteBillingAddress(organizationId: string): Promise<{}> {
254
238
  if (typeof organizationId === 'undefined') {
255
239
  throw new AppwriteException('Missing required parameter: "organizationId"');
256
240
  }
@@ -262,10 +246,7 @@ export class Organizations {
262
246
  'content-type': 'application/json',
263
247
  }
264
248
 
265
- payload['project'] = this.client.config.project;
266
-
267
-
268
- return await this.client.call(
249
+ return this.client.call(
269
250
  'delete',
270
251
  uri,
271
252
  apiHeaders,
@@ -273,8 +254,6 @@ export class Organizations {
273
254
  );
274
255
  }
275
256
  /**
276
- * Get billing address
277
- *
278
257
  * Get a billing address using it&#039;s ID.
279
258
  *
280
259
  * @param {string} organizationId
@@ -282,7 +261,7 @@ export class Organizations {
282
261
  * @throws {AppwriteException}
283
262
  * @returns {Promise<Models.BillingAddress>}
284
263
  */
285
- async getBillingAddress(organizationId: string, billingAddressId: string): Promise<Models.BillingAddress> {
264
+ getBillingAddress(organizationId: string, billingAddressId: string): Promise<Models.BillingAddress> {
286
265
  if (typeof organizationId === 'undefined') {
287
266
  throw new AppwriteException('Missing required parameter: "organizationId"');
288
267
  }
@@ -297,10 +276,7 @@ export class Organizations {
297
276
  'content-type': 'application/json',
298
277
  }
299
278
 
300
- payload['project'] = this.client.config.project;
301
-
302
-
303
- return await this.client.call(
279
+ return this.client.call(
304
280
  'get',
305
281
  uri,
306
282
  apiHeaders,
@@ -308,8 +284,6 @@ export class Organizations {
308
284
  );
309
285
  }
310
286
  /**
311
- * Set team&#039;s billing email
312
- *
313
287
  * Set the current billing email for the organization.
314
288
  *
315
289
  * @param {string} organizationId
@@ -317,7 +291,7 @@ export class Organizations {
317
291
  * @throws {AppwriteException}
318
292
  * @returns {Promise<Models.Organization<Preferences>>}
319
293
  */
320
- async setBillingEmail<Preferences extends Models.Preferences>(organizationId: string, billingEmail: string): Promise<Models.Organization<Preferences>> {
294
+ setBillingEmail<Preferences extends Models.Preferences>(organizationId: string, billingEmail: string): Promise<Models.Organization<Preferences>> {
321
295
  if (typeof organizationId === 'undefined') {
322
296
  throw new AppwriteException('Missing required parameter: "organizationId"');
323
297
  }
@@ -335,10 +309,7 @@ export class Organizations {
335
309
  'content-type': 'application/json',
336
310
  }
337
311
 
338
- payload['project'] = this.client.config.project;
339
-
340
-
341
- return await this.client.call(
312
+ return this.client.call(
342
313
  'patch',
343
314
  uri,
344
315
  apiHeaders,
@@ -346,8 +317,6 @@ export class Organizations {
346
317
  );
347
318
  }
348
319
  /**
349
- * Update organization budget
350
- *
351
320
  * Update the budget limit for an organization.
352
321
  *
353
322
  * @param {string} organizationId
@@ -356,7 +325,7 @@ export class Organizations {
356
325
  * @throws {AppwriteException}
357
326
  * @returns {Promise<Models.Organization<Preferences>>}
358
327
  */
359
- async updateBudget<Preferences extends Models.Preferences>(organizationId: string, budget: number, alerts?: number[]): Promise<Models.Organization<Preferences>> {
328
+ updateBudget<Preferences extends Models.Preferences>(organizationId: string, budget?: number, alerts?: number[]): Promise<Models.Organization<Preferences>> {
360
329
  if (typeof organizationId === 'undefined') {
361
330
  throw new AppwriteException('Missing required parameter: "organizationId"');
362
331
  }
@@ -377,10 +346,7 @@ export class Organizations {
377
346
  'content-type': 'application/json',
378
347
  }
379
348
 
380
- payload['project'] = this.client.config.project;
381
-
382
-
383
- return await this.client.call(
349
+ return this.client.call(
384
350
  'patch',
385
351
  uri,
386
352
  apiHeaders,
@@ -388,8 +354,6 @@ export class Organizations {
388
354
  );
389
355
  }
390
356
  /**
391
- * List credits
392
- *
393
357
  * List all credits for an organization.
394
358
 
395
359
  *
@@ -398,7 +362,7 @@ export class Organizations {
398
362
  * @throws {AppwriteException}
399
363
  * @returns {Promise<Models.CreditList>}
400
364
  */
401
- async listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList> {
365
+ listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList> {
402
366
  if (typeof organizationId === 'undefined') {
403
367
  throw new AppwriteException('Missing required parameter: "organizationId"');
404
368
  }
@@ -413,10 +377,7 @@ export class Organizations {
413
377
  'content-type': 'application/json',
414
378
  }
415
379
 
416
- payload['project'] = this.client.config.project;
417
-
418
-
419
- return await this.client.call(
380
+ return this.client.call(
420
381
  'get',
421
382
  uri,
422
383
  apiHeaders,
@@ -424,8 +385,6 @@ export class Organizations {
424
385
  );
425
386
  }
426
387
  /**
427
- * Add credits from coupon
428
- *
429
388
  * Add credit to an organization using a coupon.
430
389
  *
431
390
  * @param {string} organizationId
@@ -433,7 +392,7 @@ export class Organizations {
433
392
  * @throws {AppwriteException}
434
393
  * @returns {Promise<Models.Credit>}
435
394
  */
436
- async addCredit(organizationId: string, couponId: string): Promise<Models.Credit> {
395
+ addCredit(organizationId: string, couponId: string): Promise<Models.Credit> {
437
396
  if (typeof organizationId === 'undefined') {
438
397
  throw new AppwriteException('Missing required parameter: "organizationId"');
439
398
  }
@@ -451,10 +410,7 @@ export class Organizations {
451
410
  'content-type': 'application/json',
452
411
  }
453
412
 
454
- payload['project'] = this.client.config.project;
455
-
456
-
457
- return await this.client.call(
413
+ return this.client.call(
458
414
  'post',
459
415
  uri,
460
416
  apiHeaders,
@@ -462,8 +418,6 @@ export class Organizations {
462
418
  );
463
419
  }
464
420
  /**
465
- * Get credit details
466
- *
467
421
  * Get credit details.
468
422
  *
469
423
  * @param {string} organizationId
@@ -471,7 +425,7 @@ export class Organizations {
471
425
  * @throws {AppwriteException}
472
426
  * @returns {Promise<Models.Credit>}
473
427
  */
474
- async getCredit(organizationId: string, creditId: string): Promise<Models.Credit> {
428
+ getCredit(organizationId: string, creditId: string): Promise<Models.Credit> {
475
429
  if (typeof organizationId === 'undefined') {
476
430
  throw new AppwriteException('Missing required parameter: "organizationId"');
477
431
  }
@@ -486,10 +440,7 @@ export class Organizations {
486
440
  'content-type': 'application/json',
487
441
  }
488
442
 
489
- payload['project'] = this.client.config.project;
490
-
491
-
492
- return await this.client.call(
443
+ return this.client.call(
493
444
  'get',
494
445
  uri,
495
446
  apiHeaders,
@@ -497,8 +448,6 @@ export class Organizations {
497
448
  );
498
449
  }
499
450
  /**
500
- * List invoices
501
- *
502
451
  * List all invoices for an organization.
503
452
  *
504
453
  * @param {string} organizationId
@@ -506,7 +455,7 @@ export class Organizations {
506
455
  * @throws {AppwriteException}
507
456
  * @returns {Promise<Models.InvoiceList>}
508
457
  */
509
- async listInvoices(organizationId: string, queries?: string[]): Promise<Models.InvoiceList> {
458
+ listInvoices(organizationId: string, queries?: string[]): Promise<Models.InvoiceList> {
510
459
  if (typeof organizationId === 'undefined') {
511
460
  throw new AppwriteException('Missing required parameter: "organizationId"');
512
461
  }
@@ -521,10 +470,7 @@ export class Organizations {
521
470
  'content-type': 'application/json',
522
471
  }
523
472
 
524
- payload['project'] = this.client.config.project;
525
-
526
-
527
- return await this.client.call(
473
+ return this.client.call(
528
474
  'get',
529
475
  uri,
530
476
  apiHeaders,
@@ -532,8 +478,6 @@ export class Organizations {
532
478
  );
533
479
  }
534
480
  /**
535
- * Get invoice
536
- *
537
481
  * Get an invoice by its unique ID.
538
482
  *
539
483
  * @param {string} organizationId
@@ -541,7 +485,7 @@ export class Organizations {
541
485
  * @throws {AppwriteException}
542
486
  * @returns {Promise<Models.Invoice>}
543
487
  */
544
- async getInvoice(organizationId: string, invoiceId: string): Promise<Models.Invoice> {
488
+ getInvoice(organizationId: string, invoiceId: string): Promise<Models.Invoice> {
545
489
  if (typeof organizationId === 'undefined') {
546
490
  throw new AppwriteException('Missing required parameter: "organizationId"');
547
491
  }
@@ -556,10 +500,7 @@ export class Organizations {
556
500
  'content-type': 'application/json',
557
501
  }
558
502
 
559
- payload['project'] = this.client.config.project;
560
-
561
-
562
- return await this.client.call(
503
+ return this.client.call(
563
504
  'get',
564
505
  uri,
565
506
  apiHeaders,
@@ -567,8 +508,6 @@ export class Organizations {
567
508
  );
568
509
  }
569
510
  /**
570
- * Download invoice in PDF
571
- *
572
511
  * Download invoice in PDF
573
512
  *
574
513
  * @param {string} organizationId
@@ -576,7 +515,7 @@ export class Organizations {
576
515
  * @throws {AppwriteException}
577
516
  * @returns {Promise<Models.PaymentMethod>}
578
517
  */
579
- async getInvoiceDownload(organizationId: string, invoiceId: string): Promise<Models.PaymentMethod> {
518
+ getInvoiceDownload(organizationId: string, invoiceId: string): Promise<Models.PaymentMethod> {
580
519
  if (typeof organizationId === 'undefined') {
581
520
  throw new AppwriteException('Missing required parameter: "organizationId"');
582
521
  }
@@ -591,10 +530,7 @@ export class Organizations {
591
530
  'content-type': 'application/json',
592
531
  }
593
532
 
594
- payload['project'] = this.client.config.project;
595
-
596
-
597
- return await this.client.call(
533
+ return this.client.call(
598
534
  'get',
599
535
  uri,
600
536
  apiHeaders,
@@ -602,8 +538,6 @@ export class Organizations {
602
538
  );
603
539
  }
604
540
  /**
605
- * Initiate payment for failed invoice to pay live from console
606
- *
607
541
  * Initiate payment for failed invoice to pay live from console
608
542
  *
609
543
  * @param {string} organizationId
@@ -612,7 +546,7 @@ export class Organizations {
612
546
  * @throws {AppwriteException}
613
547
  * @returns {Promise<Models.Invoice>}
614
548
  */
615
- async createInvoicePayment(organizationId: string, invoiceId: string, paymentMethodId: string): Promise<Models.Invoice> {
549
+ createInvoicePayment(organizationId: string, invoiceId: string, paymentMethodId: string): Promise<Models.Invoice> {
616
550
  if (typeof organizationId === 'undefined') {
617
551
  throw new AppwriteException('Missing required parameter: "organizationId"');
618
552
  }
@@ -633,10 +567,7 @@ export class Organizations {
633
567
  'content-type': 'application/json',
634
568
  }
635
569
 
636
- payload['project'] = this.client.config.project;
637
-
638
-
639
- return await this.client.call(
570
+ return this.client.call(
640
571
  'post',
641
572
  uri,
642
573
  apiHeaders,
@@ -644,8 +575,36 @@ export class Organizations {
644
575
  );
645
576
  }
646
577
  /**
647
- * View invoice in PDF
578
+ * Validates the payment linked with the invoice and updates the invoice status if the payment status is changed.
648
579
  *
580
+ * @param {string} organizationId
581
+ * @param {string} invoiceId
582
+ * @throws {AppwriteException}
583
+ * @returns {Promise<Models.Invoice>}
584
+ */
585
+ validateInvoice(organizationId: string, invoiceId: string): Promise<Models.Invoice> {
586
+ if (typeof organizationId === 'undefined') {
587
+ throw new AppwriteException('Missing required parameter: "organizationId"');
588
+ }
589
+ if (typeof invoiceId === 'undefined') {
590
+ throw new AppwriteException('Missing required parameter: "invoiceId"');
591
+ }
592
+ const apiPath = '/organizations/{organizationId}/invoices/{invoiceId}/status'.replace('{organizationId}', organizationId).replace('{invoiceId}', invoiceId);
593
+ const payload: Payload = {};
594
+ const uri = new URL(this.client.config.endpoint + apiPath);
595
+
596
+ const apiHeaders: { [header: string]: string } = {
597
+ 'content-type': 'application/json',
598
+ }
599
+
600
+ return this.client.call(
601
+ 'patch',
602
+ uri,
603
+ apiHeaders,
604
+ payload
605
+ );
606
+ }
607
+ /**
649
608
  * View invoice in PDF
650
609
  *
651
610
  * @param {string} organizationId
@@ -653,7 +612,7 @@ export class Organizations {
653
612
  * @throws {AppwriteException}
654
613
  * @returns {Promise<Models.PaymentMethod>}
655
614
  */
656
- async getInvoiceView(organizationId: string, invoiceId: string): Promise<Models.PaymentMethod> {
615
+ getInvoiceView(organizationId: string, invoiceId: string): Promise<Models.PaymentMethod> {
657
616
  if (typeof organizationId === 'undefined') {
658
617
  throw new AppwriteException('Missing required parameter: "organizationId"');
659
618
  }
@@ -668,10 +627,7 @@ export class Organizations {
668
627
  'content-type': 'application/json',
669
628
  }
670
629
 
671
- payload['project'] = this.client.config.project;
672
-
673
-
674
- return await this.client.call(
630
+ return this.client.call(
675
631
  'get',
676
632
  uri,
677
633
  apiHeaders,
@@ -679,8 +635,6 @@ export class Organizations {
679
635
  );
680
636
  }
681
637
  /**
682
- * Set team&#039;s payment method
683
- *
684
638
  * Set a organization&#039;s default payment method.
685
639
  *
686
640
  * @param {string} organizationId
@@ -688,7 +642,7 @@ export class Organizations {
688
642
  * @throws {AppwriteException}
689
643
  * @returns {Promise<Models.Organization<Preferences>>}
690
644
  */
691
- async setDefaultPaymentMethod<Preferences extends Models.Preferences>(organizationId: string, paymentMethodId: string): Promise<Models.Organization<Preferences>> {
645
+ setDefaultPaymentMethod<Preferences extends Models.Preferences>(organizationId: string, paymentMethodId: string): Promise<Models.Organization<Preferences>> {
692
646
  if (typeof organizationId === 'undefined') {
693
647
  throw new AppwriteException('Missing required parameter: "organizationId"');
694
648
  }
@@ -706,10 +660,7 @@ export class Organizations {
706
660
  'content-type': 'application/json',
707
661
  }
708
662
 
709
- payload['project'] = this.client.config.project;
710
-
711
-
712
- return await this.client.call(
663
+ return this.client.call(
713
664
  'patch',
714
665
  uri,
715
666
  apiHeaders,
@@ -717,15 +668,13 @@ export class Organizations {
717
668
  );
718
669
  }
719
670
  /**
720
- * Delete team&#039;s default payment method
721
- *
722
671
  * Delete the default payment method for an organization.
723
672
  *
724
673
  * @param {string} organizationId
725
674
  * @throws {AppwriteException}
726
675
  * @returns {Promise<Models.Organization<Preferences>>}
727
676
  */
728
- async deleteDefaultPaymentMethod<Preferences extends Models.Preferences>(organizationId: string): Promise<Models.Organization<Preferences>> {
677
+ deleteDefaultPaymentMethod<Preferences extends Models.Preferences>(organizationId: string): Promise<Models.Organization<Preferences>> {
729
678
  if (typeof organizationId === 'undefined') {
730
679
  throw new AppwriteException('Missing required parameter: "organizationId"');
731
680
  }
@@ -737,10 +686,7 @@ export class Organizations {
737
686
  'content-type': 'application/json',
738
687
  }
739
688
 
740
- payload['project'] = this.client.config.project;
741
-
742
-
743
- return await this.client.call(
689
+ return this.client.call(
744
690
  'delete',
745
691
  uri,
746
692
  apiHeaders,
@@ -748,8 +694,6 @@ export class Organizations {
748
694
  );
749
695
  }
750
696
  /**
751
- * Set team&#039;s backup payment method
752
- *
753
697
  * Set an organization&#039;s backup payment method.
754
698
 
755
699
  *
@@ -758,7 +702,7 @@ export class Organizations {
758
702
  * @throws {AppwriteException}
759
703
  * @returns {Promise<Models.Organization<Preferences>>}
760
704
  */
761
- async setBackupPaymentMethod<Preferences extends Models.Preferences>(organizationId: string, paymentMethodId: string): Promise<Models.Organization<Preferences>> {
705
+ setBackupPaymentMethod<Preferences extends Models.Preferences>(organizationId: string, paymentMethodId: string): Promise<Models.Organization<Preferences>> {
762
706
  if (typeof organizationId === 'undefined') {
763
707
  throw new AppwriteException('Missing required parameter: "organizationId"');
764
708
  }
@@ -776,10 +720,7 @@ export class Organizations {
776
720
  'content-type': 'application/json',
777
721
  }
778
722
 
779
- payload['project'] = this.client.config.project;
780
-
781
-
782
- return await this.client.call(
723
+ return this.client.call(
783
724
  'patch',
784
725
  uri,
785
726
  apiHeaders,
@@ -787,15 +728,13 @@ export class Organizations {
787
728
  );
788
729
  }
789
730
  /**
790
- * Delete team&#039;s backup payment method
791
- *
792
731
  * Delete a backup payment method for an organization.
793
732
  *
794
733
  * @param {string} organizationId
795
734
  * @throws {AppwriteException}
796
735
  * @returns {Promise<Models.Organization<Preferences>>}
797
736
  */
798
- async deleteBackupPaymentMethod<Preferences extends Models.Preferences>(organizationId: string): Promise<Models.Organization<Preferences>> {
737
+ deleteBackupPaymentMethod<Preferences extends Models.Preferences>(organizationId: string): Promise<Models.Organization<Preferences>> {
799
738
  if (typeof organizationId === 'undefined') {
800
739
  throw new AppwriteException('Missing required parameter: "organizationId"');
801
740
  }
@@ -807,10 +746,7 @@ export class Organizations {
807
746
  'content-type': 'application/json',
808
747
  }
809
748
 
810
- payload['project'] = this.client.config.project;
811
-
812
-
813
- return await this.client.call(
749
+ return this.client.call(
814
750
  'delete',
815
751
  uri,
816
752
  apiHeaders,
@@ -818,8 +754,6 @@ export class Organizations {
818
754
  );
819
755
  }
820
756
  /**
821
- * Get payment method
822
- *
823
757
  * Get an organization&#039;s payment method using it&#039;s payment method ID.
824
758
  *
825
759
  * @param {string} organizationId
@@ -827,7 +761,7 @@ export class Organizations {
827
761
  * @throws {AppwriteException}
828
762
  * @returns {Promise<Models.PaymentMethod>}
829
763
  */
830
- async getPaymentMethod(organizationId: string, paymentMethodId: string): Promise<Models.PaymentMethod> {
764
+ getPaymentMethod(organizationId: string, paymentMethodId: string): Promise<Models.PaymentMethod> {
831
765
  if (typeof organizationId === 'undefined') {
832
766
  throw new AppwriteException('Missing required parameter: "organizationId"');
833
767
  }
@@ -842,10 +776,7 @@ export class Organizations {
842
776
  'content-type': 'application/json',
843
777
  }
844
778
 
845
- payload['project'] = this.client.config.project;
846
-
847
-
848
- return await this.client.call(
779
+ return this.client.call(
849
780
  'get',
850
781
  uri,
851
782
  apiHeaders,
@@ -853,15 +784,13 @@ export class Organizations {
853
784
  );
854
785
  }
855
786
  /**
856
- * Get organization billing plan details
857
- *
858
787
  * Get the details of the current billing plan for an organization.
859
788
  *
860
789
  * @param {string} organizationId
861
790
  * @throws {AppwriteException}
862
791
  * @returns {Promise<Models.BillingPlan>}
863
792
  */
864
- async getPlan(organizationId: string): Promise<Models.BillingPlan> {
793
+ getPlan(organizationId: string): Promise<Models.BillingPlan> {
865
794
  if (typeof organizationId === 'undefined') {
866
795
  throw new AppwriteException('Missing required parameter: "organizationId"');
867
796
  }
@@ -873,10 +802,7 @@ export class Organizations {
873
802
  'content-type': 'application/json',
874
803
  }
875
804
 
876
- payload['project'] = this.client.config.project;
877
-
878
-
879
- return await this.client.call(
805
+ return this.client.call(
880
806
  'get',
881
807
  uri,
882
808
  apiHeaders,
@@ -884,18 +810,20 @@ export class Organizations {
884
810
  );
885
811
  }
886
812
  /**
887
- * Update organization billing plan
888
- *
889
813
  * Update the billing plan for an organization.
890
814
  *
891
815
  * @param {string} organizationId
892
816
  * @param {BillingPlan} billingPlan
893
817
  * @param {string} paymentMethodId
894
818
  * @param {string} billingAddressId
819
+ * @param {string[]} invites
820
+ * @param {string} couponId
821
+ * @param {string} taxId
822
+ * @param {number} budget
895
823
  * @throws {AppwriteException}
896
824
  * @returns {Promise<Models.Organization<Preferences>>}
897
825
  */
898
- async updatePlan<Preferences extends Models.Preferences>(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise<Models.Organization<Preferences>> {
826
+ updatePlan<Preferences extends Models.Preferences>(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>> {
899
827
  if (typeof organizationId === 'undefined') {
900
828
  throw new AppwriteException('Missing required parameter: "organizationId"');
901
829
  }
@@ -913,16 +841,25 @@ export class Organizations {
913
841
  if (typeof billingAddressId !== 'undefined') {
914
842
  payload['billingAddressId'] = billingAddressId;
915
843
  }
844
+ if (typeof invites !== 'undefined') {
845
+ payload['invites'] = invites;
846
+ }
847
+ if (typeof couponId !== 'undefined') {
848
+ payload['couponId'] = couponId;
849
+ }
850
+ if (typeof taxId !== 'undefined') {
851
+ payload['taxId'] = taxId;
852
+ }
853
+ if (typeof budget !== 'undefined') {
854
+ payload['budget'] = budget;
855
+ }
916
856
  const uri = new URL(this.client.config.endpoint + apiPath);
917
857
 
918
858
  const apiHeaders: { [header: string]: string } = {
919
859
  'content-type': 'application/json',
920
860
  }
921
861
 
922
- payload['project'] = this.client.config.project;
923
-
924
-
925
- return await this.client.call(
862
+ return this.client.call(
926
863
  'patch',
927
864
  uri,
928
865
  apiHeaders,
@@ -930,15 +867,13 @@ export class Organizations {
930
867
  );
931
868
  }
932
869
  /**
933
- * Get Scopes
934
- *
935
870
  * Get Scopes
936
871
  *
937
872
  * @param {string} organizationId
938
873
  * @throws {AppwriteException}
939
874
  * @returns {Promise<Models.Roles>}
940
875
  */
941
- async getScopes(organizationId: string): Promise<Models.Roles> {
876
+ getScopes(organizationId: string): Promise<Models.Roles> {
942
877
  if (typeof organizationId === 'undefined') {
943
878
  throw new AppwriteException('Missing required parameter: "organizationId"');
944
879
  }
@@ -950,10 +885,7 @@ export class Organizations {
950
885
  'content-type': 'application/json',
951
886
  }
952
887
 
953
- payload['project'] = this.client.config.project;
954
-
955
-
956
- return await this.client.call(
888
+ return this.client.call(
957
889
  'get',
958
890
  uri,
959
891
  apiHeaders,
@@ -961,8 +893,6 @@ export class Organizations {
961
893
  );
962
894
  }
963
895
  /**
964
- * Set team&#039;s tax Id
965
- *
966
896
  * Set an organization&#039;s billing tax ID.
967
897
  *
968
898
  * @param {string} organizationId
@@ -970,7 +900,7 @@ export class Organizations {
970
900
  * @throws {AppwriteException}
971
901
  * @returns {Promise<Models.Organization<Preferences>>}
972
902
  */
973
- async setBillingTaxId<Preferences extends Models.Preferences>(organizationId: string, taxId: string): Promise<Models.Organization<Preferences>> {
903
+ setBillingTaxId<Preferences extends Models.Preferences>(organizationId: string, taxId: string): Promise<Models.Organization<Preferences>> {
974
904
  if (typeof organizationId === 'undefined') {
975
905
  throw new AppwriteException('Missing required parameter: "organizationId"');
976
906
  }
@@ -988,10 +918,7 @@ export class Organizations {
988
918
  'content-type': 'application/json',
989
919
  }
990
920
 
991
- payload['project'] = this.client.config.project;
992
-
993
-
994
- return await this.client.call(
921
+ return this.client.call(
995
922
  'patch',
996
923
  uri,
997
924
  apiHeaders,
@@ -999,8 +926,6 @@ export class Organizations {
999
926
  );
1000
927
  }
1001
928
  /**
1002
- * Get team&#039;s usage data
1003
- *
1004
929
  * Get the usage data for an organization.
1005
930
  *
1006
931
  * @param {string} organizationId
@@ -1009,7 +934,7 @@ export class Organizations {
1009
934
  * @throws {AppwriteException}
1010
935
  * @returns {Promise<Models.UsageOrganization>}
1011
936
  */
1012
- async getUsage(organizationId: string, startDate?: string, endDate?: string): Promise<Models.UsageOrganization> {
937
+ getUsage(organizationId: string, startDate?: string, endDate?: string): Promise<Models.UsageOrganization> {
1013
938
  if (typeof organizationId === 'undefined') {
1014
939
  throw new AppwriteException('Missing required parameter: "organizationId"');
1015
940
  }
@@ -1027,10 +952,7 @@ export class Organizations {
1027
952
  'content-type': 'application/json',
1028
953
  }
1029
954
 
1030
- payload['project'] = this.client.config.project;
1031
-
1032
-
1033
- return await this.client.call(
955
+ return this.client.call(
1034
956
  'get',
1035
957
  uri,
1036
958
  apiHeaders,