@appwrite.io/console 0.4.2 → 0.6.0-rc.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 (83) hide show
  1. package/.github/workflows/publish.yml +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/cjs/sdk.js +2115 -109
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +2115 -110
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +2115 -109
  9. package/docs/examples/account/add-authenticator.md +18 -0
  10. package/docs/examples/account/create-challenge.md +18 -0
  11. package/docs/examples/account/list-providers.md +18 -0
  12. package/docs/examples/account/update-challenge.md +18 -0
  13. package/docs/examples/account/update-m-f-a.md +18 -0
  14. package/docs/examples/account/update-recovery.md +1 -1
  15. package/docs/examples/account/verify-authenticator.md +18 -0
  16. package/docs/examples/messaging/create-apns-provider.md +18 -0
  17. package/docs/examples/messaging/create-email-message.md +18 -0
  18. package/docs/examples/messaging/create-fcm-provider.md +18 -0
  19. package/docs/examples/messaging/create-mailgun-provider.md +18 -0
  20. package/docs/examples/messaging/create-msg91provider.md +18 -0
  21. package/docs/examples/messaging/create-push-message.md +18 -0
  22. package/docs/examples/messaging/create-s-m-s-message.md +18 -0
  23. package/docs/examples/messaging/create-sendgrid-provider.md +18 -0
  24. package/docs/examples/messaging/create-subscriber.md +18 -0
  25. package/docs/examples/messaging/create-telesign-provider.md +18 -0
  26. package/docs/examples/messaging/create-textmagic-provider.md +18 -0
  27. package/docs/examples/messaging/create-topic.md +18 -0
  28. package/docs/examples/messaging/create-twilio-provider.md +18 -0
  29. package/docs/examples/messaging/create-vonage-provider.md +18 -0
  30. package/docs/examples/messaging/delete-provider.md +18 -0
  31. package/docs/examples/messaging/delete-subscriber.md +18 -0
  32. package/docs/examples/messaging/delete-topic.md +18 -0
  33. package/docs/examples/messaging/get-message.md +18 -0
  34. package/docs/examples/messaging/get-provider.md +18 -0
  35. package/docs/examples/messaging/get-subscriber.md +18 -0
  36. package/docs/examples/messaging/get-topic.md +18 -0
  37. package/docs/examples/messaging/list-message-logs.md +18 -0
  38. package/docs/examples/messaging/list-messages.md +18 -0
  39. package/docs/examples/messaging/list-provider-logs.md +18 -0
  40. package/docs/examples/messaging/list-providers.md +18 -0
  41. package/docs/examples/messaging/list-subscriber-logs.md +18 -0
  42. package/docs/examples/messaging/list-subscribers.md +18 -0
  43. package/docs/examples/messaging/list-topic-logs.md +18 -0
  44. package/docs/examples/messaging/list-topics.md +18 -0
  45. package/docs/examples/messaging/update-apns-provider.md +18 -0
  46. package/docs/examples/messaging/update-email.md +18 -0
  47. package/docs/examples/messaging/update-fcm-provider.md +18 -0
  48. package/docs/examples/messaging/update-mailgun-provider.md +18 -0
  49. package/docs/examples/messaging/update-msg91provider.md +18 -0
  50. package/docs/examples/messaging/update-push-notification.md +18 -0
  51. package/docs/examples/messaging/update-s-m-s.md +18 -0
  52. package/docs/examples/messaging/update-sendgrid-provider.md +18 -0
  53. package/docs/examples/messaging/update-telesign-provider.md +18 -0
  54. package/docs/examples/messaging/update-textmagic-provider.md +18 -0
  55. package/docs/examples/messaging/update-topic.md +18 -0
  56. package/docs/examples/messaging/update-twilio-provider.md +18 -0
  57. package/docs/examples/messaging/update-vonage-provider.md +18 -0
  58. package/docs/examples/project/get-usage.md +1 -1
  59. package/docs/examples/projects/get-usage.md +18 -0
  60. package/docs/examples/projects/update-auth-mfa-factors.md +18 -0
  61. package/docs/examples/users/create-target.md +18 -0
  62. package/docs/examples/users/delete-target.md +18 -0
  63. package/docs/examples/users/get-target.md +18 -0
  64. package/docs/examples/users/list-targets.md +18 -0
  65. package/docs/examples/users/update-target.md +18 -0
  66. package/package.json +1 -1
  67. package/src/client.ts +1 -1
  68. package/src/index.ts +1 -0
  69. package/src/models.ts +547 -151
  70. package/src/services/account.ts +158 -0
  71. package/src/services/messaging.ts +1901 -0
  72. package/src/services/project.ts +4 -22
  73. package/src/services/projects.ts +58 -0
  74. package/src/services/storage.ts +1 -1
  75. package/src/services/users.ts +188 -1
  76. package/types/index.d.ts +1 -0
  77. package/types/models.d.ts +547 -151
  78. package/types/services/account.d.ts +56 -0
  79. package/types/services/messaging.d.ts +553 -0
  80. package/types/services/project.d.ts +2 -4
  81. package/types/services/projects.d.ts +20 -0
  82. package/types/services/storage.d.ts +1 -1
  83. package/types/services/users.d.ts +59 -1
package/dist/iife/sdk.js CHANGED
@@ -102,7 +102,7 @@
102
102
  'x-sdk-name': 'Console',
103
103
  'x-sdk-platform': 'console',
104
104
  'x-sdk-language': 'web',
105
- 'x-sdk-version': '0.4.2',
105
+ 'x-sdk-version': '0.6.0-rc.1',
106
106
  'X-Appwrite-Response-Format': '1.4.0',
107
107
  };
108
108
  this.realtime = {
@@ -634,6 +634,152 @@
634
634
  }, payload);
635
635
  });
636
636
  }
637
+ /**
638
+ * Update MFA
639
+ *
640
+ *
641
+ * @param {boolean} mfa
642
+ * @throws {AppwriteException}
643
+ * @returns {Promise}
644
+ */
645
+ updateMFA(mfa) {
646
+ return __awaiter(this, void 0, void 0, function* () {
647
+ if (typeof mfa === 'undefined') {
648
+ throw new AppwriteException('Missing required parameter: "mfa"');
649
+ }
650
+ const apiPath = '/account/mfa';
651
+ const payload = {};
652
+ if (typeof mfa !== 'undefined') {
653
+ payload['mfa'] = mfa;
654
+ }
655
+ const uri = new URL(this.client.config.endpoint + apiPath);
656
+ return yield this.client.call('patch', uri, {
657
+ 'content-type': 'application/json',
658
+ }, payload);
659
+ });
660
+ }
661
+ /**
662
+ * Create MFA Challenge
663
+ *
664
+ *
665
+ * @param {string} provider
666
+ * @throws {AppwriteException}
667
+ * @returns {Promise}
668
+ */
669
+ createChallenge(provider) {
670
+ return __awaiter(this, void 0, void 0, function* () {
671
+ if (typeof provider === 'undefined') {
672
+ throw new AppwriteException('Missing required parameter: "provider"');
673
+ }
674
+ const apiPath = '/account/mfa/challenge';
675
+ const payload = {};
676
+ if (typeof provider !== 'undefined') {
677
+ payload['provider'] = provider;
678
+ }
679
+ const uri = new URL(this.client.config.endpoint + apiPath);
680
+ return yield this.client.call('post', uri, {
681
+ 'content-type': 'application/json',
682
+ }, payload);
683
+ });
684
+ }
685
+ /**
686
+ * Create MFA Challenge (confirmation)
687
+ *
688
+ *
689
+ * @param {string} challengeId
690
+ * @param {string} otp
691
+ * @throws {AppwriteException}
692
+ * @returns {Promise}
693
+ */
694
+ updateChallenge(challengeId, otp) {
695
+ return __awaiter(this, void 0, void 0, function* () {
696
+ if (typeof challengeId === 'undefined') {
697
+ throw new AppwriteException('Missing required parameter: "challengeId"');
698
+ }
699
+ if (typeof otp === 'undefined') {
700
+ throw new AppwriteException('Missing required parameter: "otp"');
701
+ }
702
+ const apiPath = '/account/mfa/challenge';
703
+ const payload = {};
704
+ if (typeof challengeId !== 'undefined') {
705
+ payload['challengeId'] = challengeId;
706
+ }
707
+ if (typeof otp !== 'undefined') {
708
+ payload['otp'] = otp;
709
+ }
710
+ const uri = new URL(this.client.config.endpoint + apiPath);
711
+ return yield this.client.call('put', uri, {
712
+ 'content-type': 'application/json',
713
+ }, payload);
714
+ });
715
+ }
716
+ /**
717
+ * List Providers
718
+ *
719
+ * Get the currently logged in user.
720
+ *
721
+ * @throws {AppwriteException}
722
+ * @returns {Promise}
723
+ */
724
+ listProviders() {
725
+ return __awaiter(this, void 0, void 0, function* () {
726
+ const apiPath = '/account/mfa/providers';
727
+ const payload = {};
728
+ const uri = new URL(this.client.config.endpoint + apiPath);
729
+ return yield this.client.call('get', uri, {
730
+ 'content-type': 'application/json',
731
+ }, payload);
732
+ });
733
+ }
734
+ /**
735
+ * Add Authenticator
736
+ *
737
+ *
738
+ * @param {string} provider
739
+ * @throws {AppwriteException}
740
+ * @returns {Promise}
741
+ */
742
+ addAuthenticator(provider) {
743
+ return __awaiter(this, void 0, void 0, function* () {
744
+ if (typeof provider === 'undefined') {
745
+ throw new AppwriteException('Missing required parameter: "provider"');
746
+ }
747
+ const apiPath = '/account/mfa/{provider}'.replace('{provider}', provider);
748
+ const payload = {};
749
+ const uri = new URL(this.client.config.endpoint + apiPath);
750
+ return yield this.client.call('post', uri, {
751
+ 'content-type': 'application/json',
752
+ }, payload);
753
+ });
754
+ }
755
+ /**
756
+ * Verify Authenticator
757
+ *
758
+ *
759
+ * @param {string} provider
760
+ * @param {string} otp
761
+ * @throws {AppwriteException}
762
+ * @returns {Promise}
763
+ */
764
+ verifyAuthenticator(provider, otp) {
765
+ return __awaiter(this, void 0, void 0, function* () {
766
+ if (typeof provider === 'undefined') {
767
+ throw new AppwriteException('Missing required parameter: "provider"');
768
+ }
769
+ if (typeof otp === 'undefined') {
770
+ throw new AppwriteException('Missing required parameter: "otp"');
771
+ }
772
+ const apiPath = '/account/mfa/{provider}'.replace('{provider}', provider);
773
+ const payload = {};
774
+ if (typeof otp !== 'undefined') {
775
+ payload['otp'] = otp;
776
+ }
777
+ const uri = new URL(this.client.config.endpoint + apiPath);
778
+ return yield this.client.call('put', uri, {
779
+ 'content-type': 'application/json',
780
+ }, payload);
781
+ });
782
+ }
637
783
  /**
638
784
  * Update name
639
785
  *
@@ -5125,12 +5271,12 @@
5125
5271
  }
5126
5272
  }
5127
5273
 
5128
- class Migrations extends Service {
5274
+ class Messaging extends Service {
5129
5275
  constructor(client) {
5130
5276
  super(client);
5131
5277
  }
5132
5278
  /**
5133
- * List Migrations
5279
+ * List messages
5134
5280
  *
5135
5281
  *
5136
5282
  * @param {string} queries
@@ -5138,9 +5284,9 @@
5138
5284
  * @throws {AppwriteException}
5139
5285
  * @returns {Promise}
5140
5286
  */
5141
- list(queries, search) {
5287
+ listMessages(queries, search) {
5142
5288
  return __awaiter(this, void 0, void 0, function* () {
5143
- const apiPath = '/migrations';
5289
+ const apiPath = '/messaging/messages';
5144
5290
  const payload = {};
5145
5291
  if (typeof queries !== 'undefined') {
5146
5292
  payload['queries'] = queries;
@@ -5155,43 +5301,64 @@
5155
5301
  });
5156
5302
  }
5157
5303
  /**
5158
- * Migrate Appwrite Data
5304
+ * Create an email.
5159
5305
  *
5160
5306
  *
5161
- * @param {string[]} resources
5162
- * @param {string} endpoint
5163
- * @param {string} projectId
5164
- * @param {string} apiKey
5307
+ * @param {string} messageId
5308
+ * @param {string} subject
5309
+ * @param {string} content
5310
+ * @param {string[]} topics
5311
+ * @param {string[]} users
5312
+ * @param {string[]} targets
5313
+ * @param {string} description
5314
+ * @param {string} status
5315
+ * @param {boolean} html
5316
+ * @param {string} scheduledAt
5165
5317
  * @throws {AppwriteException}
5166
5318
  * @returns {Promise}
5167
5319
  */
5168
- createAppwriteMigration(resources, endpoint, projectId, apiKey) {
5320
+ createEmailMessage(messageId, subject, content, topics, users, targets, description, status, html, scheduledAt) {
5169
5321
  return __awaiter(this, void 0, void 0, function* () {
5170
- if (typeof resources === 'undefined') {
5171
- throw new AppwriteException('Missing required parameter: "resources"');
5172
- }
5173
- if (typeof endpoint === 'undefined') {
5174
- throw new AppwriteException('Missing required parameter: "endpoint"');
5322
+ if (typeof messageId === 'undefined') {
5323
+ throw new AppwriteException('Missing required parameter: "messageId"');
5175
5324
  }
5176
- if (typeof projectId === 'undefined') {
5177
- throw new AppwriteException('Missing required parameter: "projectId"');
5325
+ if (typeof subject === 'undefined') {
5326
+ throw new AppwriteException('Missing required parameter: "subject"');
5178
5327
  }
5179
- if (typeof apiKey === 'undefined') {
5180
- throw new AppwriteException('Missing required parameter: "apiKey"');
5328
+ if (typeof content === 'undefined') {
5329
+ throw new AppwriteException('Missing required parameter: "content"');
5181
5330
  }
5182
- const apiPath = '/migrations/appwrite';
5331
+ const apiPath = '/messaging/messages/email';
5183
5332
  const payload = {};
5184
- if (typeof resources !== 'undefined') {
5185
- payload['resources'] = resources;
5333
+ if (typeof messageId !== 'undefined') {
5334
+ payload['messageId'] = messageId;
5186
5335
  }
5187
- if (typeof endpoint !== 'undefined') {
5188
- payload['endpoint'] = endpoint;
5336
+ if (typeof subject !== 'undefined') {
5337
+ payload['subject'] = subject;
5189
5338
  }
5190
- if (typeof projectId !== 'undefined') {
5191
- payload['projectId'] = projectId;
5339
+ if (typeof content !== 'undefined') {
5340
+ payload['content'] = content;
5192
5341
  }
5193
- if (typeof apiKey !== 'undefined') {
5194
- payload['apiKey'] = apiKey;
5342
+ if (typeof topics !== 'undefined') {
5343
+ payload['topics'] = topics;
5344
+ }
5345
+ if (typeof users !== 'undefined') {
5346
+ payload['users'] = users;
5347
+ }
5348
+ if (typeof targets !== 'undefined') {
5349
+ payload['targets'] = targets;
5350
+ }
5351
+ if (typeof description !== 'undefined') {
5352
+ payload['description'] = description;
5353
+ }
5354
+ if (typeof status !== 'undefined') {
5355
+ payload['status'] = status;
5356
+ }
5357
+ if (typeof html !== 'undefined') {
5358
+ payload['html'] = html;
5359
+ }
5360
+ if (typeof scheduledAt !== 'undefined') {
5361
+ payload['scheduledAt'] = scheduledAt;
5195
5362
  }
5196
5363
  const uri = new URL(this.client.config.endpoint + apiPath);
5197
5364
  return yield this.client.call('post', uri, {
@@ -5200,74 +5367,145 @@
5200
5367
  });
5201
5368
  }
5202
5369
  /**
5203
- * Generate a report on Appwrite Data
5370
+ * Update an email.
5204
5371
  *
5205
5372
  *
5206
- * @param {string[]} resources
5207
- * @param {string} endpoint
5208
- * @param {string} projectID
5209
- * @param {string} key
5373
+ * @param {string} messageId
5374
+ * @param {string[]} topics
5375
+ * @param {string[]} users
5376
+ * @param {string[]} targets
5377
+ * @param {string} subject
5378
+ * @param {string} description
5379
+ * @param {string} content
5380
+ * @param {string} status
5381
+ * @param {boolean} html
5382
+ * @param {string} scheduledAt
5210
5383
  * @throws {AppwriteException}
5211
5384
  * @returns {Promise}
5212
5385
  */
5213
- getAppwriteReport(resources, endpoint, projectID, key) {
5386
+ updateEmail(messageId, topics, users, targets, subject, description, content, status, html, scheduledAt) {
5214
5387
  return __awaiter(this, void 0, void 0, function* () {
5215
- if (typeof resources === 'undefined') {
5216
- throw new AppwriteException('Missing required parameter: "resources"');
5388
+ if (typeof messageId === 'undefined') {
5389
+ throw new AppwriteException('Missing required parameter: "messageId"');
5217
5390
  }
5218
- if (typeof endpoint === 'undefined') {
5219
- throw new AppwriteException('Missing required parameter: "endpoint"');
5391
+ const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
5392
+ const payload = {};
5393
+ if (typeof topics !== 'undefined') {
5394
+ payload['topics'] = topics;
5220
5395
  }
5221
- if (typeof projectID === 'undefined') {
5222
- throw new AppwriteException('Missing required parameter: "projectID"');
5396
+ if (typeof users !== 'undefined') {
5397
+ payload['users'] = users;
5223
5398
  }
5224
- if (typeof key === 'undefined') {
5225
- throw new AppwriteException('Missing required parameter: "key"');
5399
+ if (typeof targets !== 'undefined') {
5400
+ payload['targets'] = targets;
5226
5401
  }
5227
- const apiPath = '/migrations/appwrite/report';
5228
- const payload = {};
5229
- if (typeof resources !== 'undefined') {
5230
- payload['resources'] = resources;
5402
+ if (typeof subject !== 'undefined') {
5403
+ payload['subject'] = subject;
5231
5404
  }
5232
- if (typeof endpoint !== 'undefined') {
5233
- payload['endpoint'] = endpoint;
5405
+ if (typeof description !== 'undefined') {
5406
+ payload['description'] = description;
5234
5407
  }
5235
- if (typeof projectID !== 'undefined') {
5236
- payload['projectID'] = projectID;
5408
+ if (typeof content !== 'undefined') {
5409
+ payload['content'] = content;
5237
5410
  }
5238
- if (typeof key !== 'undefined') {
5239
- payload['key'] = key;
5411
+ if (typeof status !== 'undefined') {
5412
+ payload['status'] = status;
5413
+ }
5414
+ if (typeof html !== 'undefined') {
5415
+ payload['html'] = html;
5416
+ }
5417
+ if (typeof scheduledAt !== 'undefined') {
5418
+ payload['scheduledAt'] = scheduledAt;
5240
5419
  }
5241
5420
  const uri = new URL(this.client.config.endpoint + apiPath);
5242
- return yield this.client.call('get', uri, {
5421
+ return yield this.client.call('patch', uri, {
5243
5422
  'content-type': 'application/json',
5244
5423
  }, payload);
5245
5424
  });
5246
5425
  }
5247
5426
  /**
5248
- * Migrate Firebase Data (Service Account)
5427
+ * Create a push notification.
5249
5428
  *
5250
5429
  *
5251
- * @param {string[]} resources
5252
- * @param {string} serviceAccount
5430
+ * @param {string} messageId
5431
+ * @param {string} title
5432
+ * @param {string} body
5433
+ * @param {string[]} topics
5434
+ * @param {string[]} users
5435
+ * @param {string[]} targets
5436
+ * @param {string} description
5437
+ * @param {object} data
5438
+ * @param {string} action
5439
+ * @param {string} icon
5440
+ * @param {string} sound
5441
+ * @param {string} color
5442
+ * @param {string} tag
5443
+ * @param {string} badge
5444
+ * @param {string} status
5445
+ * @param {string} scheduledAt
5253
5446
  * @throws {AppwriteException}
5254
5447
  * @returns {Promise}
5255
5448
  */
5256
- createFirebaseMigration(resources, serviceAccount) {
5449
+ createPushMessage(messageId, title, body, topics, users, targets, description, data, action, icon, sound, color, tag, badge, status, scheduledAt) {
5257
5450
  return __awaiter(this, void 0, void 0, function* () {
5258
- if (typeof resources === 'undefined') {
5259
- throw new AppwriteException('Missing required parameter: "resources"');
5451
+ if (typeof messageId === 'undefined') {
5452
+ throw new AppwriteException('Missing required parameter: "messageId"');
5260
5453
  }
5261
- if (typeof serviceAccount === 'undefined') {
5262
- throw new AppwriteException('Missing required parameter: "serviceAccount"');
5454
+ if (typeof title === 'undefined') {
5455
+ throw new AppwriteException('Missing required parameter: "title"');
5263
5456
  }
5264
- const apiPath = '/migrations/firebase';
5457
+ if (typeof body === 'undefined') {
5458
+ throw new AppwriteException('Missing required parameter: "body"');
5459
+ }
5460
+ const apiPath = '/messaging/messages/push';
5265
5461
  const payload = {};
5266
- if (typeof resources !== 'undefined') {
5267
- payload['resources'] = resources;
5462
+ if (typeof messageId !== 'undefined') {
5463
+ payload['messageId'] = messageId;
5268
5464
  }
5269
- if (typeof serviceAccount !== 'undefined') {
5270
- payload['serviceAccount'] = serviceAccount;
5465
+ if (typeof title !== 'undefined') {
5466
+ payload['title'] = title;
5467
+ }
5468
+ if (typeof body !== 'undefined') {
5469
+ payload['body'] = body;
5470
+ }
5471
+ if (typeof topics !== 'undefined') {
5472
+ payload['topics'] = topics;
5473
+ }
5474
+ if (typeof users !== 'undefined') {
5475
+ payload['users'] = users;
5476
+ }
5477
+ if (typeof targets !== 'undefined') {
5478
+ payload['targets'] = targets;
5479
+ }
5480
+ if (typeof description !== 'undefined') {
5481
+ payload['description'] = description;
5482
+ }
5483
+ if (typeof data !== 'undefined') {
5484
+ payload['data'] = data;
5485
+ }
5486
+ if (typeof action !== 'undefined') {
5487
+ payload['action'] = action;
5488
+ }
5489
+ if (typeof icon !== 'undefined') {
5490
+ payload['icon'] = icon;
5491
+ }
5492
+ if (typeof sound !== 'undefined') {
5493
+ payload['sound'] = sound;
5494
+ }
5495
+ if (typeof color !== 'undefined') {
5496
+ payload['color'] = color;
5497
+ }
5498
+ if (typeof tag !== 'undefined') {
5499
+ payload['tag'] = tag;
5500
+ }
5501
+ if (typeof badge !== 'undefined') {
5502
+ payload['badge'] = badge;
5503
+ }
5504
+ if (typeof status !== 'undefined') {
5505
+ payload['status'] = status;
5506
+ }
5507
+ if (typeof scheduledAt !== 'undefined') {
5508
+ payload['scheduledAt'] = scheduledAt;
5271
5509
  }
5272
5510
  const uri = new URL(this.client.config.endpoint + apiPath);
5273
5511
  return yield this.client.call('post', uri, {
@@ -5276,35 +5514,1597 @@
5276
5514
  });
5277
5515
  }
5278
5516
  /**
5279
- * Revoke Appwrite's authorization to access Firebase Projects
5517
+ * Update a push notification.
5280
5518
  *
5281
5519
  *
5520
+ * @param {string} messageId
5521
+ * @param {string[]} topics
5522
+ * @param {string[]} users
5523
+ * @param {string[]} targets
5524
+ * @param {string} description
5525
+ * @param {string} title
5526
+ * @param {string} body
5527
+ * @param {object} data
5528
+ * @param {string} action
5529
+ * @param {string} icon
5530
+ * @param {string} sound
5531
+ * @param {string} color
5532
+ * @param {string} tag
5533
+ * @param {string} badge
5534
+ * @param {string} status
5535
+ * @param {string} scheduledAt
5282
5536
  * @throws {AppwriteException}
5283
5537
  * @returns {Promise}
5284
5538
  */
5285
- deleteFirebaseAuth() {
5539
+ updatePushNotification(messageId, topics, users, targets, description, title, body, data, action, icon, sound, color, tag, badge, status, scheduledAt) {
5286
5540
  return __awaiter(this, void 0, void 0, function* () {
5287
- const apiPath = '/migrations/firebase/deauthorize';
5541
+ if (typeof messageId === 'undefined') {
5542
+ throw new AppwriteException('Missing required parameter: "messageId"');
5543
+ }
5544
+ const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
5288
5545
  const payload = {};
5289
- const uri = new URL(this.client.config.endpoint + apiPath);
5290
- return yield this.client.call('get', uri, {
5291
- 'content-type': 'application/json',
5292
- }, payload);
5293
- });
5294
- }
5295
- /**
5296
- * Migrate Firebase Data (OAuth)
5297
- *
5298
- *
5299
- * @param {string[]} resources
5300
- * @param {string} projectId
5301
- * @throws {AppwriteException}
5302
- * @returns {Promise}
5303
- */
5304
- createFirebaseOAuthMigration(resources, projectId) {
5305
- return __awaiter(this, void 0, void 0, function* () {
5306
- if (typeof resources === 'undefined') {
5307
- throw new AppwriteException('Missing required parameter: "resources"');
5546
+ if (typeof topics !== 'undefined') {
5547
+ payload['topics'] = topics;
5548
+ }
5549
+ if (typeof users !== 'undefined') {
5550
+ payload['users'] = users;
5551
+ }
5552
+ if (typeof targets !== 'undefined') {
5553
+ payload['targets'] = targets;
5554
+ }
5555
+ if (typeof description !== 'undefined') {
5556
+ payload['description'] = description;
5557
+ }
5558
+ if (typeof title !== 'undefined') {
5559
+ payload['title'] = title;
5560
+ }
5561
+ if (typeof body !== 'undefined') {
5562
+ payload['body'] = body;
5563
+ }
5564
+ if (typeof data !== 'undefined') {
5565
+ payload['data'] = data;
5566
+ }
5567
+ if (typeof action !== 'undefined') {
5568
+ payload['action'] = action;
5569
+ }
5570
+ if (typeof icon !== 'undefined') {
5571
+ payload['icon'] = icon;
5572
+ }
5573
+ if (typeof sound !== 'undefined') {
5574
+ payload['sound'] = sound;
5575
+ }
5576
+ if (typeof color !== 'undefined') {
5577
+ payload['color'] = color;
5578
+ }
5579
+ if (typeof tag !== 'undefined') {
5580
+ payload['tag'] = tag;
5581
+ }
5582
+ if (typeof badge !== 'undefined') {
5583
+ payload['badge'] = badge;
5584
+ }
5585
+ if (typeof status !== 'undefined') {
5586
+ payload['status'] = status;
5587
+ }
5588
+ if (typeof scheduledAt !== 'undefined') {
5589
+ payload['scheduledAt'] = scheduledAt;
5590
+ }
5591
+ const uri = new URL(this.client.config.endpoint + apiPath);
5592
+ return yield this.client.call('patch', uri, {
5593
+ 'content-type': 'application/json',
5594
+ }, payload);
5595
+ });
5596
+ }
5597
+ /**
5598
+ * Create an SMS.
5599
+ *
5600
+ *
5601
+ * @param {string} messageId
5602
+ * @param {string} content
5603
+ * @param {string[]} topics
5604
+ * @param {string[]} users
5605
+ * @param {string[]} targets
5606
+ * @param {string} description
5607
+ * @param {string} status
5608
+ * @param {string} scheduledAt
5609
+ * @throws {AppwriteException}
5610
+ * @returns {Promise}
5611
+ */
5612
+ createSMSMessage(messageId, content, topics, users, targets, description, status, scheduledAt) {
5613
+ return __awaiter(this, void 0, void 0, function* () {
5614
+ if (typeof messageId === 'undefined') {
5615
+ throw new AppwriteException('Missing required parameter: "messageId"');
5616
+ }
5617
+ if (typeof content === 'undefined') {
5618
+ throw new AppwriteException('Missing required parameter: "content"');
5619
+ }
5620
+ const apiPath = '/messaging/messages/sms';
5621
+ const payload = {};
5622
+ if (typeof messageId !== 'undefined') {
5623
+ payload['messageId'] = messageId;
5624
+ }
5625
+ if (typeof content !== 'undefined') {
5626
+ payload['content'] = content;
5627
+ }
5628
+ if (typeof topics !== 'undefined') {
5629
+ payload['topics'] = topics;
5630
+ }
5631
+ if (typeof users !== 'undefined') {
5632
+ payload['users'] = users;
5633
+ }
5634
+ if (typeof targets !== 'undefined') {
5635
+ payload['targets'] = targets;
5636
+ }
5637
+ if (typeof description !== 'undefined') {
5638
+ payload['description'] = description;
5639
+ }
5640
+ if (typeof status !== 'undefined') {
5641
+ payload['status'] = status;
5642
+ }
5643
+ if (typeof scheduledAt !== 'undefined') {
5644
+ payload['scheduledAt'] = scheduledAt;
5645
+ }
5646
+ const uri = new URL(this.client.config.endpoint + apiPath);
5647
+ return yield this.client.call('post', uri, {
5648
+ 'content-type': 'application/json',
5649
+ }, payload);
5650
+ });
5651
+ }
5652
+ /**
5653
+ * Update an SMS.
5654
+ *
5655
+ *
5656
+ * @param {string} messageId
5657
+ * @param {string[]} topics
5658
+ * @param {string[]} users
5659
+ * @param {string[]} targets
5660
+ * @param {string} description
5661
+ * @param {string} content
5662
+ * @param {string} status
5663
+ * @param {string} scheduledAt
5664
+ * @throws {AppwriteException}
5665
+ * @returns {Promise}
5666
+ */
5667
+ updateSMS(messageId, topics, users, targets, description, content, status, scheduledAt) {
5668
+ return __awaiter(this, void 0, void 0, function* () {
5669
+ if (typeof messageId === 'undefined') {
5670
+ throw new AppwriteException('Missing required parameter: "messageId"');
5671
+ }
5672
+ const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
5673
+ const payload = {};
5674
+ if (typeof topics !== 'undefined') {
5675
+ payload['topics'] = topics;
5676
+ }
5677
+ if (typeof users !== 'undefined') {
5678
+ payload['users'] = users;
5679
+ }
5680
+ if (typeof targets !== 'undefined') {
5681
+ payload['targets'] = targets;
5682
+ }
5683
+ if (typeof description !== 'undefined') {
5684
+ payload['description'] = description;
5685
+ }
5686
+ if (typeof content !== 'undefined') {
5687
+ payload['content'] = content;
5688
+ }
5689
+ if (typeof status !== 'undefined') {
5690
+ payload['status'] = status;
5691
+ }
5692
+ if (typeof scheduledAt !== 'undefined') {
5693
+ payload['scheduledAt'] = scheduledAt;
5694
+ }
5695
+ const uri = new URL(this.client.config.endpoint + apiPath);
5696
+ return yield this.client.call('patch', uri, {
5697
+ 'content-type': 'application/json',
5698
+ }, payload);
5699
+ });
5700
+ }
5701
+ /**
5702
+ * Get a message
5703
+ *
5704
+ *
5705
+ * @param {string} messageId
5706
+ * @throws {AppwriteException}
5707
+ * @returns {Promise}
5708
+ */
5709
+ getMessage(messageId) {
5710
+ return __awaiter(this, void 0, void 0, function* () {
5711
+ if (typeof messageId === 'undefined') {
5712
+ throw new AppwriteException('Missing required parameter: "messageId"');
5713
+ }
5714
+ const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
5715
+ const payload = {};
5716
+ const uri = new URL(this.client.config.endpoint + apiPath);
5717
+ return yield this.client.call('get', uri, {
5718
+ 'content-type': 'application/json',
5719
+ }, payload);
5720
+ });
5721
+ }
5722
+ /**
5723
+ * List message logs
5724
+ *
5725
+ *
5726
+ * @param {string} messageId
5727
+ * @param {string[]} queries
5728
+ * @throws {AppwriteException}
5729
+ * @returns {Promise}
5730
+ */
5731
+ listMessageLogs(messageId, queries) {
5732
+ return __awaiter(this, void 0, void 0, function* () {
5733
+ if (typeof messageId === 'undefined') {
5734
+ throw new AppwriteException('Missing required parameter: "messageId"');
5735
+ }
5736
+ const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
5737
+ const payload = {};
5738
+ if (typeof queries !== 'undefined') {
5739
+ payload['queries'] = queries;
5740
+ }
5741
+ const uri = new URL(this.client.config.endpoint + apiPath);
5742
+ return yield this.client.call('get', uri, {
5743
+ 'content-type': 'application/json',
5744
+ }, payload);
5745
+ });
5746
+ }
5747
+ /**
5748
+ * List providers
5749
+ *
5750
+ *
5751
+ * @param {string} queries
5752
+ * @param {string} search
5753
+ * @throws {AppwriteException}
5754
+ * @returns {Promise}
5755
+ */
5756
+ listProviders(queries, search) {
5757
+ return __awaiter(this, void 0, void 0, function* () {
5758
+ const apiPath = '/messaging/providers';
5759
+ const payload = {};
5760
+ if (typeof queries !== 'undefined') {
5761
+ payload['queries'] = queries;
5762
+ }
5763
+ if (typeof search !== 'undefined') {
5764
+ payload['search'] = search;
5765
+ }
5766
+ const uri = new URL(this.client.config.endpoint + apiPath);
5767
+ return yield this.client.call('get', uri, {
5768
+ 'content-type': 'application/json',
5769
+ }, payload);
5770
+ });
5771
+ }
5772
+ /**
5773
+ * Create APNS provider
5774
+ *
5775
+ *
5776
+ * @param {string} providerId
5777
+ * @param {string} name
5778
+ * @param {string} authKey
5779
+ * @param {string} authKeyId
5780
+ * @param {string} teamId
5781
+ * @param {string} bundleId
5782
+ * @param {string} endpoint
5783
+ * @param {boolean} enabled
5784
+ * @throws {AppwriteException}
5785
+ * @returns {Promise}
5786
+ */
5787
+ createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId, endpoint, enabled) {
5788
+ return __awaiter(this, void 0, void 0, function* () {
5789
+ if (typeof providerId === 'undefined') {
5790
+ throw new AppwriteException('Missing required parameter: "providerId"');
5791
+ }
5792
+ if (typeof name === 'undefined') {
5793
+ throw new AppwriteException('Missing required parameter: "name"');
5794
+ }
5795
+ const apiPath = '/messaging/providers/apns';
5796
+ const payload = {};
5797
+ if (typeof providerId !== 'undefined') {
5798
+ payload['providerId'] = providerId;
5799
+ }
5800
+ if (typeof name !== 'undefined') {
5801
+ payload['name'] = name;
5802
+ }
5803
+ if (typeof authKey !== 'undefined') {
5804
+ payload['authKey'] = authKey;
5805
+ }
5806
+ if (typeof authKeyId !== 'undefined') {
5807
+ payload['authKeyId'] = authKeyId;
5808
+ }
5809
+ if (typeof teamId !== 'undefined') {
5810
+ payload['teamId'] = teamId;
5811
+ }
5812
+ if (typeof bundleId !== 'undefined') {
5813
+ payload['bundleId'] = bundleId;
5814
+ }
5815
+ if (typeof endpoint !== 'undefined') {
5816
+ payload['endpoint'] = endpoint;
5817
+ }
5818
+ if (typeof enabled !== 'undefined') {
5819
+ payload['enabled'] = enabled;
5820
+ }
5821
+ const uri = new URL(this.client.config.endpoint + apiPath);
5822
+ return yield this.client.call('post', uri, {
5823
+ 'content-type': 'application/json',
5824
+ }, payload);
5825
+ });
5826
+ }
5827
+ /**
5828
+ * Update APNS provider
5829
+ *
5830
+ *
5831
+ * @param {string} providerId
5832
+ * @param {string} name
5833
+ * @param {boolean} enabled
5834
+ * @param {string} authKey
5835
+ * @param {string} authKeyId
5836
+ * @param {string} teamId
5837
+ * @param {string} bundleId
5838
+ * @param {string} endpoint
5839
+ * @throws {AppwriteException}
5840
+ * @returns {Promise}
5841
+ */
5842
+ updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId, endpoint) {
5843
+ return __awaiter(this, void 0, void 0, function* () {
5844
+ if (typeof providerId === 'undefined') {
5845
+ throw new AppwriteException('Missing required parameter: "providerId"');
5846
+ }
5847
+ const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
5848
+ const payload = {};
5849
+ if (typeof name !== 'undefined') {
5850
+ payload['name'] = name;
5851
+ }
5852
+ if (typeof enabled !== 'undefined') {
5853
+ payload['enabled'] = enabled;
5854
+ }
5855
+ if (typeof authKey !== 'undefined') {
5856
+ payload['authKey'] = authKey;
5857
+ }
5858
+ if (typeof authKeyId !== 'undefined') {
5859
+ payload['authKeyId'] = authKeyId;
5860
+ }
5861
+ if (typeof teamId !== 'undefined') {
5862
+ payload['teamId'] = teamId;
5863
+ }
5864
+ if (typeof bundleId !== 'undefined') {
5865
+ payload['bundleId'] = bundleId;
5866
+ }
5867
+ if (typeof endpoint !== 'undefined') {
5868
+ payload['endpoint'] = endpoint;
5869
+ }
5870
+ const uri = new URL(this.client.config.endpoint + apiPath);
5871
+ return yield this.client.call('patch', uri, {
5872
+ 'content-type': 'application/json',
5873
+ }, payload);
5874
+ });
5875
+ }
5876
+ /**
5877
+ * Create FCM provider
5878
+ *
5879
+ *
5880
+ * @param {string} providerId
5881
+ * @param {string} name
5882
+ * @param {string} serverKey
5883
+ * @param {boolean} enabled
5884
+ * @throws {AppwriteException}
5885
+ * @returns {Promise}
5886
+ */
5887
+ createFcmProvider(providerId, name, serverKey, enabled) {
5888
+ return __awaiter(this, void 0, void 0, function* () {
5889
+ if (typeof providerId === 'undefined') {
5890
+ throw new AppwriteException('Missing required parameter: "providerId"');
5891
+ }
5892
+ if (typeof name === 'undefined') {
5893
+ throw new AppwriteException('Missing required parameter: "name"');
5894
+ }
5895
+ const apiPath = '/messaging/providers/fcm';
5896
+ const payload = {};
5897
+ if (typeof providerId !== 'undefined') {
5898
+ payload['providerId'] = providerId;
5899
+ }
5900
+ if (typeof name !== 'undefined') {
5901
+ payload['name'] = name;
5902
+ }
5903
+ if (typeof serverKey !== 'undefined') {
5904
+ payload['serverKey'] = serverKey;
5905
+ }
5906
+ if (typeof enabled !== 'undefined') {
5907
+ payload['enabled'] = enabled;
5908
+ }
5909
+ const uri = new URL(this.client.config.endpoint + apiPath);
5910
+ return yield this.client.call('post', uri, {
5911
+ 'content-type': 'application/json',
5912
+ }, payload);
5913
+ });
5914
+ }
5915
+ /**
5916
+ * Update FCM provider
5917
+ *
5918
+ *
5919
+ * @param {string} providerId
5920
+ * @param {string} name
5921
+ * @param {boolean} enabled
5922
+ * @param {string} serverKey
5923
+ * @throws {AppwriteException}
5924
+ * @returns {Promise}
5925
+ */
5926
+ updateFcmProvider(providerId, name, enabled, serverKey) {
5927
+ return __awaiter(this, void 0, void 0, function* () {
5928
+ if (typeof providerId === 'undefined') {
5929
+ throw new AppwriteException('Missing required parameter: "providerId"');
5930
+ }
5931
+ const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
5932
+ const payload = {};
5933
+ if (typeof name !== 'undefined') {
5934
+ payload['name'] = name;
5935
+ }
5936
+ if (typeof enabled !== 'undefined') {
5937
+ payload['enabled'] = enabled;
5938
+ }
5939
+ if (typeof serverKey !== 'undefined') {
5940
+ payload['serverKey'] = serverKey;
5941
+ }
5942
+ const uri = new URL(this.client.config.endpoint + apiPath);
5943
+ return yield this.client.call('patch', uri, {
5944
+ 'content-type': 'application/json',
5945
+ }, payload);
5946
+ });
5947
+ }
5948
+ /**
5949
+ * Create Mailgun provider
5950
+ *
5951
+ *
5952
+ * @param {string} providerId
5953
+ * @param {string} name
5954
+ * @param {string} from
5955
+ * @param {string} apiKey
5956
+ * @param {string} domain
5957
+ * @param {boolean} isEuRegion
5958
+ * @param {boolean} enabled
5959
+ * @throws {AppwriteException}
5960
+ * @returns {Promise}
5961
+ */
5962
+ createMailgunProvider(providerId, name, from, apiKey, domain, isEuRegion, enabled) {
5963
+ return __awaiter(this, void 0, void 0, function* () {
5964
+ if (typeof providerId === 'undefined') {
5965
+ throw new AppwriteException('Missing required parameter: "providerId"');
5966
+ }
5967
+ if (typeof name === 'undefined') {
5968
+ throw new AppwriteException('Missing required parameter: "name"');
5969
+ }
5970
+ const apiPath = '/messaging/providers/mailgun';
5971
+ const payload = {};
5972
+ if (typeof providerId !== 'undefined') {
5973
+ payload['providerId'] = providerId;
5974
+ }
5975
+ if (typeof name !== 'undefined') {
5976
+ payload['name'] = name;
5977
+ }
5978
+ if (typeof from !== 'undefined') {
5979
+ payload['from'] = from;
5980
+ }
5981
+ if (typeof apiKey !== 'undefined') {
5982
+ payload['apiKey'] = apiKey;
5983
+ }
5984
+ if (typeof domain !== 'undefined') {
5985
+ payload['domain'] = domain;
5986
+ }
5987
+ if (typeof isEuRegion !== 'undefined') {
5988
+ payload['isEuRegion'] = isEuRegion;
5989
+ }
5990
+ if (typeof enabled !== 'undefined') {
5991
+ payload['enabled'] = enabled;
5992
+ }
5993
+ const uri = new URL(this.client.config.endpoint + apiPath);
5994
+ return yield this.client.call('post', uri, {
5995
+ 'content-type': 'application/json',
5996
+ }, payload);
5997
+ });
5998
+ }
5999
+ /**
6000
+ * Update Mailgun provider
6001
+ *
6002
+ *
6003
+ * @param {string} providerId
6004
+ * @param {string} name
6005
+ * @param {boolean} enabled
6006
+ * @param {boolean} isEuRegion
6007
+ * @param {string} from
6008
+ * @param {string} apiKey
6009
+ * @param {string} domain
6010
+ * @throws {AppwriteException}
6011
+ * @returns {Promise}
6012
+ */
6013
+ updateMailgunProvider(providerId, name, enabled, isEuRegion, from, apiKey, domain) {
6014
+ return __awaiter(this, void 0, void 0, function* () {
6015
+ if (typeof providerId === 'undefined') {
6016
+ throw new AppwriteException('Missing required parameter: "providerId"');
6017
+ }
6018
+ const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
6019
+ const payload = {};
6020
+ if (typeof name !== 'undefined') {
6021
+ payload['name'] = name;
6022
+ }
6023
+ if (typeof enabled !== 'undefined') {
6024
+ payload['enabled'] = enabled;
6025
+ }
6026
+ if (typeof isEuRegion !== 'undefined') {
6027
+ payload['isEuRegion'] = isEuRegion;
6028
+ }
6029
+ if (typeof from !== 'undefined') {
6030
+ payload['from'] = from;
6031
+ }
6032
+ if (typeof apiKey !== 'undefined') {
6033
+ payload['apiKey'] = apiKey;
6034
+ }
6035
+ if (typeof domain !== 'undefined') {
6036
+ payload['domain'] = domain;
6037
+ }
6038
+ const uri = new URL(this.client.config.endpoint + apiPath);
6039
+ return yield this.client.call('patch', uri, {
6040
+ 'content-type': 'application/json',
6041
+ }, payload);
6042
+ });
6043
+ }
6044
+ /**
6045
+ * Create Msg91 provider
6046
+ *
6047
+ *
6048
+ * @param {string} providerId
6049
+ * @param {string} name
6050
+ * @param {string} from
6051
+ * @param {string} senderId
6052
+ * @param {string} authKey
6053
+ * @param {boolean} enabled
6054
+ * @throws {AppwriteException}
6055
+ * @returns {Promise}
6056
+ */
6057
+ createMsg91Provider(providerId, name, from, senderId, authKey, enabled) {
6058
+ return __awaiter(this, void 0, void 0, function* () {
6059
+ if (typeof providerId === 'undefined') {
6060
+ throw new AppwriteException('Missing required parameter: "providerId"');
6061
+ }
6062
+ if (typeof name === 'undefined') {
6063
+ throw new AppwriteException('Missing required parameter: "name"');
6064
+ }
6065
+ const apiPath = '/messaging/providers/msg91';
6066
+ const payload = {};
6067
+ if (typeof providerId !== 'undefined') {
6068
+ payload['providerId'] = providerId;
6069
+ }
6070
+ if (typeof name !== 'undefined') {
6071
+ payload['name'] = name;
6072
+ }
6073
+ if (typeof from !== 'undefined') {
6074
+ payload['from'] = from;
6075
+ }
6076
+ if (typeof senderId !== 'undefined') {
6077
+ payload['senderId'] = senderId;
6078
+ }
6079
+ if (typeof authKey !== 'undefined') {
6080
+ payload['authKey'] = authKey;
6081
+ }
6082
+ if (typeof enabled !== 'undefined') {
6083
+ payload['enabled'] = enabled;
6084
+ }
6085
+ const uri = new URL(this.client.config.endpoint + apiPath);
6086
+ return yield this.client.call('post', uri, {
6087
+ 'content-type': 'application/json',
6088
+ }, payload);
6089
+ });
6090
+ }
6091
+ /**
6092
+ * Update Msg91 provider
6093
+ *
6094
+ *
6095
+ * @param {string} providerId
6096
+ * @param {string} name
6097
+ * @param {boolean} enabled
6098
+ * @param {string} senderId
6099
+ * @param {string} authKey
6100
+ * @param {string} from
6101
+ * @throws {AppwriteException}
6102
+ * @returns {Promise}
6103
+ */
6104
+ updateMsg91Provider(providerId, name, enabled, senderId, authKey, from) {
6105
+ return __awaiter(this, void 0, void 0, function* () {
6106
+ if (typeof providerId === 'undefined') {
6107
+ throw new AppwriteException('Missing required parameter: "providerId"');
6108
+ }
6109
+ const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
6110
+ const payload = {};
6111
+ if (typeof name !== 'undefined') {
6112
+ payload['name'] = name;
6113
+ }
6114
+ if (typeof enabled !== 'undefined') {
6115
+ payload['enabled'] = enabled;
6116
+ }
6117
+ if (typeof senderId !== 'undefined') {
6118
+ payload['senderId'] = senderId;
6119
+ }
6120
+ if (typeof authKey !== 'undefined') {
6121
+ payload['authKey'] = authKey;
6122
+ }
6123
+ if (typeof from !== 'undefined') {
6124
+ payload['from'] = from;
6125
+ }
6126
+ const uri = new URL(this.client.config.endpoint + apiPath);
6127
+ return yield this.client.call('patch', uri, {
6128
+ 'content-type': 'application/json',
6129
+ }, payload);
6130
+ });
6131
+ }
6132
+ /**
6133
+ * Create Sendgrid provider
6134
+ *
6135
+ *
6136
+ * @param {string} providerId
6137
+ * @param {string} name
6138
+ * @param {string} from
6139
+ * @param {string} apiKey
6140
+ * @param {boolean} enabled
6141
+ * @throws {AppwriteException}
6142
+ * @returns {Promise}
6143
+ */
6144
+ createSendgridProvider(providerId, name, from, apiKey, enabled) {
6145
+ return __awaiter(this, void 0, void 0, function* () {
6146
+ if (typeof providerId === 'undefined') {
6147
+ throw new AppwriteException('Missing required parameter: "providerId"');
6148
+ }
6149
+ if (typeof name === 'undefined') {
6150
+ throw new AppwriteException('Missing required parameter: "name"');
6151
+ }
6152
+ const apiPath = '/messaging/providers/sendgrid';
6153
+ const payload = {};
6154
+ if (typeof providerId !== 'undefined') {
6155
+ payload['providerId'] = providerId;
6156
+ }
6157
+ if (typeof name !== 'undefined') {
6158
+ payload['name'] = name;
6159
+ }
6160
+ if (typeof from !== 'undefined') {
6161
+ payload['from'] = from;
6162
+ }
6163
+ if (typeof apiKey !== 'undefined') {
6164
+ payload['apiKey'] = apiKey;
6165
+ }
6166
+ if (typeof enabled !== 'undefined') {
6167
+ payload['enabled'] = enabled;
6168
+ }
6169
+ const uri = new URL(this.client.config.endpoint + apiPath);
6170
+ return yield this.client.call('post', uri, {
6171
+ 'content-type': 'application/json',
6172
+ }, payload);
6173
+ });
6174
+ }
6175
+ /**
6176
+ * Update Sendgrid provider
6177
+ *
6178
+ *
6179
+ * @param {string} providerId
6180
+ * @param {string} name
6181
+ * @param {boolean} enabled
6182
+ * @param {string} apiKey
6183
+ * @param {string} from
6184
+ * @throws {AppwriteException}
6185
+ * @returns {Promise}
6186
+ */
6187
+ updateSendgridProvider(providerId, name, enabled, apiKey, from) {
6188
+ return __awaiter(this, void 0, void 0, function* () {
6189
+ if (typeof providerId === 'undefined') {
6190
+ throw new AppwriteException('Missing required parameter: "providerId"');
6191
+ }
6192
+ const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
6193
+ const payload = {};
6194
+ if (typeof name !== 'undefined') {
6195
+ payload['name'] = name;
6196
+ }
6197
+ if (typeof enabled !== 'undefined') {
6198
+ payload['enabled'] = enabled;
6199
+ }
6200
+ if (typeof apiKey !== 'undefined') {
6201
+ payload['apiKey'] = apiKey;
6202
+ }
6203
+ if (typeof from !== 'undefined') {
6204
+ payload['from'] = from;
6205
+ }
6206
+ const uri = new URL(this.client.config.endpoint + apiPath);
6207
+ return yield this.client.call('patch', uri, {
6208
+ 'content-type': 'application/json',
6209
+ }, payload);
6210
+ });
6211
+ }
6212
+ /**
6213
+ * Create Telesign provider
6214
+ *
6215
+ *
6216
+ * @param {string} providerId
6217
+ * @param {string} name
6218
+ * @param {string} from
6219
+ * @param {string} username
6220
+ * @param {string} password
6221
+ * @param {boolean} enabled
6222
+ * @throws {AppwriteException}
6223
+ * @returns {Promise}
6224
+ */
6225
+ createTelesignProvider(providerId, name, from, username, password, enabled) {
6226
+ return __awaiter(this, void 0, void 0, function* () {
6227
+ if (typeof providerId === 'undefined') {
6228
+ throw new AppwriteException('Missing required parameter: "providerId"');
6229
+ }
6230
+ if (typeof name === 'undefined') {
6231
+ throw new AppwriteException('Missing required parameter: "name"');
6232
+ }
6233
+ const apiPath = '/messaging/providers/telesign';
6234
+ const payload = {};
6235
+ if (typeof providerId !== 'undefined') {
6236
+ payload['providerId'] = providerId;
6237
+ }
6238
+ if (typeof name !== 'undefined') {
6239
+ payload['name'] = name;
6240
+ }
6241
+ if (typeof from !== 'undefined') {
6242
+ payload['from'] = from;
6243
+ }
6244
+ if (typeof username !== 'undefined') {
6245
+ payload['username'] = username;
6246
+ }
6247
+ if (typeof password !== 'undefined') {
6248
+ payload['password'] = password;
6249
+ }
6250
+ if (typeof enabled !== 'undefined') {
6251
+ payload['enabled'] = enabled;
6252
+ }
6253
+ const uri = new URL(this.client.config.endpoint + apiPath);
6254
+ return yield this.client.call('post', uri, {
6255
+ 'content-type': 'application/json',
6256
+ }, payload);
6257
+ });
6258
+ }
6259
+ /**
6260
+ * Update Telesign provider
6261
+ *
6262
+ *
6263
+ * @param {string} providerId
6264
+ * @param {string} name
6265
+ * @param {boolean} enabled
6266
+ * @param {string} username
6267
+ * @param {string} password
6268
+ * @param {string} from
6269
+ * @throws {AppwriteException}
6270
+ * @returns {Promise}
6271
+ */
6272
+ updateTelesignProvider(providerId, name, enabled, username, password, from) {
6273
+ return __awaiter(this, void 0, void 0, function* () {
6274
+ if (typeof providerId === 'undefined') {
6275
+ throw new AppwriteException('Missing required parameter: "providerId"');
6276
+ }
6277
+ const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
6278
+ const payload = {};
6279
+ if (typeof name !== 'undefined') {
6280
+ payload['name'] = name;
6281
+ }
6282
+ if (typeof enabled !== 'undefined') {
6283
+ payload['enabled'] = enabled;
6284
+ }
6285
+ if (typeof username !== 'undefined') {
6286
+ payload['username'] = username;
6287
+ }
6288
+ if (typeof password !== 'undefined') {
6289
+ payload['password'] = password;
6290
+ }
6291
+ if (typeof from !== 'undefined') {
6292
+ payload['from'] = from;
6293
+ }
6294
+ const uri = new URL(this.client.config.endpoint + apiPath);
6295
+ return yield this.client.call('patch', uri, {
6296
+ 'content-type': 'application/json',
6297
+ }, payload);
6298
+ });
6299
+ }
6300
+ /**
6301
+ * Create Textmagic provider
6302
+ *
6303
+ *
6304
+ * @param {string} providerId
6305
+ * @param {string} name
6306
+ * @param {string} from
6307
+ * @param {string} username
6308
+ * @param {string} apiKey
6309
+ * @param {boolean} enabled
6310
+ * @throws {AppwriteException}
6311
+ * @returns {Promise}
6312
+ */
6313
+ createTextmagicProvider(providerId, name, from, username, apiKey, enabled) {
6314
+ return __awaiter(this, void 0, void 0, function* () {
6315
+ if (typeof providerId === 'undefined') {
6316
+ throw new AppwriteException('Missing required parameter: "providerId"');
6317
+ }
6318
+ if (typeof name === 'undefined') {
6319
+ throw new AppwriteException('Missing required parameter: "name"');
6320
+ }
6321
+ const apiPath = '/messaging/providers/textmagic';
6322
+ const payload = {};
6323
+ if (typeof providerId !== 'undefined') {
6324
+ payload['providerId'] = providerId;
6325
+ }
6326
+ if (typeof name !== 'undefined') {
6327
+ payload['name'] = name;
6328
+ }
6329
+ if (typeof from !== 'undefined') {
6330
+ payload['from'] = from;
6331
+ }
6332
+ if (typeof username !== 'undefined') {
6333
+ payload['username'] = username;
6334
+ }
6335
+ if (typeof apiKey !== 'undefined') {
6336
+ payload['apiKey'] = apiKey;
6337
+ }
6338
+ if (typeof enabled !== 'undefined') {
6339
+ payload['enabled'] = enabled;
6340
+ }
6341
+ const uri = new URL(this.client.config.endpoint + apiPath);
6342
+ return yield this.client.call('post', uri, {
6343
+ 'content-type': 'application/json',
6344
+ }, payload);
6345
+ });
6346
+ }
6347
+ /**
6348
+ * Update Textmagic provider
6349
+ *
6350
+ *
6351
+ * @param {string} providerId
6352
+ * @param {string} name
6353
+ * @param {boolean} enabled
6354
+ * @param {string} username
6355
+ * @param {string} apiKey
6356
+ * @param {string} from
6357
+ * @throws {AppwriteException}
6358
+ * @returns {Promise}
6359
+ */
6360
+ updateTextmagicProvider(providerId, name, enabled, username, apiKey, from) {
6361
+ return __awaiter(this, void 0, void 0, function* () {
6362
+ if (typeof providerId === 'undefined') {
6363
+ throw new AppwriteException('Missing required parameter: "providerId"');
6364
+ }
6365
+ const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
6366
+ const payload = {};
6367
+ if (typeof name !== 'undefined') {
6368
+ payload['name'] = name;
6369
+ }
6370
+ if (typeof enabled !== 'undefined') {
6371
+ payload['enabled'] = enabled;
6372
+ }
6373
+ if (typeof username !== 'undefined') {
6374
+ payload['username'] = username;
6375
+ }
6376
+ if (typeof apiKey !== 'undefined') {
6377
+ payload['apiKey'] = apiKey;
6378
+ }
6379
+ if (typeof from !== 'undefined') {
6380
+ payload['from'] = from;
6381
+ }
6382
+ const uri = new URL(this.client.config.endpoint + apiPath);
6383
+ return yield this.client.call('patch', uri, {
6384
+ 'content-type': 'application/json',
6385
+ }, payload);
6386
+ });
6387
+ }
6388
+ /**
6389
+ * Create Twilio provider
6390
+ *
6391
+ *
6392
+ * @param {string} providerId
6393
+ * @param {string} name
6394
+ * @param {string} from
6395
+ * @param {string} accountSid
6396
+ * @param {string} authToken
6397
+ * @param {boolean} enabled
6398
+ * @throws {AppwriteException}
6399
+ * @returns {Promise}
6400
+ */
6401
+ createTwilioProvider(providerId, name, from, accountSid, authToken, enabled) {
6402
+ return __awaiter(this, void 0, void 0, function* () {
6403
+ if (typeof providerId === 'undefined') {
6404
+ throw new AppwriteException('Missing required parameter: "providerId"');
6405
+ }
6406
+ if (typeof name === 'undefined') {
6407
+ throw new AppwriteException('Missing required parameter: "name"');
6408
+ }
6409
+ const apiPath = '/messaging/providers/twilio';
6410
+ const payload = {};
6411
+ if (typeof providerId !== 'undefined') {
6412
+ payload['providerId'] = providerId;
6413
+ }
6414
+ if (typeof name !== 'undefined') {
6415
+ payload['name'] = name;
6416
+ }
6417
+ if (typeof from !== 'undefined') {
6418
+ payload['from'] = from;
6419
+ }
6420
+ if (typeof accountSid !== 'undefined') {
6421
+ payload['accountSid'] = accountSid;
6422
+ }
6423
+ if (typeof authToken !== 'undefined') {
6424
+ payload['authToken'] = authToken;
6425
+ }
6426
+ if (typeof enabled !== 'undefined') {
6427
+ payload['enabled'] = enabled;
6428
+ }
6429
+ const uri = new URL(this.client.config.endpoint + apiPath);
6430
+ return yield this.client.call('post', uri, {
6431
+ 'content-type': 'application/json',
6432
+ }, payload);
6433
+ });
6434
+ }
6435
+ /**
6436
+ * Update Twilio provider
6437
+ *
6438
+ *
6439
+ * @param {string} providerId
6440
+ * @param {string} name
6441
+ * @param {boolean} enabled
6442
+ * @param {string} accountSid
6443
+ * @param {string} authToken
6444
+ * @param {string} from
6445
+ * @throws {AppwriteException}
6446
+ * @returns {Promise}
6447
+ */
6448
+ updateTwilioProvider(providerId, name, enabled, accountSid, authToken, from) {
6449
+ return __awaiter(this, void 0, void 0, function* () {
6450
+ if (typeof providerId === 'undefined') {
6451
+ throw new AppwriteException('Missing required parameter: "providerId"');
6452
+ }
6453
+ const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
6454
+ const payload = {};
6455
+ if (typeof name !== 'undefined') {
6456
+ payload['name'] = name;
6457
+ }
6458
+ if (typeof enabled !== 'undefined') {
6459
+ payload['enabled'] = enabled;
6460
+ }
6461
+ if (typeof accountSid !== 'undefined') {
6462
+ payload['accountSid'] = accountSid;
6463
+ }
6464
+ if (typeof authToken !== 'undefined') {
6465
+ payload['authToken'] = authToken;
6466
+ }
6467
+ if (typeof from !== 'undefined') {
6468
+ payload['from'] = from;
6469
+ }
6470
+ const uri = new URL(this.client.config.endpoint + apiPath);
6471
+ return yield this.client.call('patch', uri, {
6472
+ 'content-type': 'application/json',
6473
+ }, payload);
6474
+ });
6475
+ }
6476
+ /**
6477
+ * Create Vonage provider
6478
+ *
6479
+ *
6480
+ * @param {string} providerId
6481
+ * @param {string} name
6482
+ * @param {string} from
6483
+ * @param {string} apiKey
6484
+ * @param {string} apiSecret
6485
+ * @param {boolean} enabled
6486
+ * @throws {AppwriteException}
6487
+ * @returns {Promise}
6488
+ */
6489
+ createVonageProvider(providerId, name, from, apiKey, apiSecret, enabled) {
6490
+ return __awaiter(this, void 0, void 0, function* () {
6491
+ if (typeof providerId === 'undefined') {
6492
+ throw new AppwriteException('Missing required parameter: "providerId"');
6493
+ }
6494
+ if (typeof name === 'undefined') {
6495
+ throw new AppwriteException('Missing required parameter: "name"');
6496
+ }
6497
+ const apiPath = '/messaging/providers/vonage';
6498
+ const payload = {};
6499
+ if (typeof providerId !== 'undefined') {
6500
+ payload['providerId'] = providerId;
6501
+ }
6502
+ if (typeof name !== 'undefined') {
6503
+ payload['name'] = name;
6504
+ }
6505
+ if (typeof from !== 'undefined') {
6506
+ payload['from'] = from;
6507
+ }
6508
+ if (typeof apiKey !== 'undefined') {
6509
+ payload['apiKey'] = apiKey;
6510
+ }
6511
+ if (typeof apiSecret !== 'undefined') {
6512
+ payload['apiSecret'] = apiSecret;
6513
+ }
6514
+ if (typeof enabled !== 'undefined') {
6515
+ payload['enabled'] = enabled;
6516
+ }
6517
+ const uri = new URL(this.client.config.endpoint + apiPath);
6518
+ return yield this.client.call('post', uri, {
6519
+ 'content-type': 'application/json',
6520
+ }, payload);
6521
+ });
6522
+ }
6523
+ /**
6524
+ * Update Vonage provider
6525
+ *
6526
+ *
6527
+ * @param {string} providerId
6528
+ * @param {string} name
6529
+ * @param {boolean} enabled
6530
+ * @param {string} apiKey
6531
+ * @param {string} apiSecret
6532
+ * @param {string} from
6533
+ * @throws {AppwriteException}
6534
+ * @returns {Promise}
6535
+ */
6536
+ updateVonageProvider(providerId, name, enabled, apiKey, apiSecret, from) {
6537
+ return __awaiter(this, void 0, void 0, function* () {
6538
+ if (typeof providerId === 'undefined') {
6539
+ throw new AppwriteException('Missing required parameter: "providerId"');
6540
+ }
6541
+ const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
6542
+ const payload = {};
6543
+ if (typeof name !== 'undefined') {
6544
+ payload['name'] = name;
6545
+ }
6546
+ if (typeof enabled !== 'undefined') {
6547
+ payload['enabled'] = enabled;
6548
+ }
6549
+ if (typeof apiKey !== 'undefined') {
6550
+ payload['apiKey'] = apiKey;
6551
+ }
6552
+ if (typeof apiSecret !== 'undefined') {
6553
+ payload['apiSecret'] = apiSecret;
6554
+ }
6555
+ if (typeof from !== 'undefined') {
6556
+ payload['from'] = from;
6557
+ }
6558
+ const uri = new URL(this.client.config.endpoint + apiPath);
6559
+ return yield this.client.call('patch', uri, {
6560
+ 'content-type': 'application/json',
6561
+ }, payload);
6562
+ });
6563
+ }
6564
+ /**
6565
+ * Get provider
6566
+ *
6567
+ *
6568
+ * @param {string} providerId
6569
+ * @throws {AppwriteException}
6570
+ * @returns {Promise}
6571
+ */
6572
+ getProvider(providerId) {
6573
+ return __awaiter(this, void 0, void 0, function* () {
6574
+ if (typeof providerId === 'undefined') {
6575
+ throw new AppwriteException('Missing required parameter: "providerId"');
6576
+ }
6577
+ const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
6578
+ const payload = {};
6579
+ const uri = new URL(this.client.config.endpoint + apiPath);
6580
+ return yield this.client.call('get', uri, {
6581
+ 'content-type': 'application/json',
6582
+ }, payload);
6583
+ });
6584
+ }
6585
+ /**
6586
+ * Delete provider
6587
+ *
6588
+ *
6589
+ * @param {string} providerId
6590
+ * @throws {AppwriteException}
6591
+ * @returns {Promise}
6592
+ */
6593
+ deleteProvider(providerId) {
6594
+ return __awaiter(this, void 0, void 0, function* () {
6595
+ if (typeof providerId === 'undefined') {
6596
+ throw new AppwriteException('Missing required parameter: "providerId"');
6597
+ }
6598
+ const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
6599
+ const payload = {};
6600
+ const uri = new URL(this.client.config.endpoint + apiPath);
6601
+ return yield this.client.call('delete', uri, {
6602
+ 'content-type': 'application/json',
6603
+ }, payload);
6604
+ });
6605
+ }
6606
+ /**
6607
+ * List provider logs
6608
+ *
6609
+ *
6610
+ * @param {string} providerId
6611
+ * @param {string[]} queries
6612
+ * @throws {AppwriteException}
6613
+ * @returns {Promise}
6614
+ */
6615
+ listProviderLogs(providerId, queries) {
6616
+ return __awaiter(this, void 0, void 0, function* () {
6617
+ if (typeof providerId === 'undefined') {
6618
+ throw new AppwriteException('Missing required parameter: "providerId"');
6619
+ }
6620
+ const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
6621
+ const payload = {};
6622
+ if (typeof queries !== 'undefined') {
6623
+ payload['queries'] = queries;
6624
+ }
6625
+ const uri = new URL(this.client.config.endpoint + apiPath);
6626
+ return yield this.client.call('get', uri, {
6627
+ 'content-type': 'application/json',
6628
+ }, payload);
6629
+ });
6630
+ }
6631
+ /**
6632
+ * List subscriber logs
6633
+ *
6634
+ *
6635
+ * @param {string} subscriberId
6636
+ * @param {string[]} queries
6637
+ * @throws {AppwriteException}
6638
+ * @returns {Promise}
6639
+ */
6640
+ listSubscriberLogs(subscriberId, queries) {
6641
+ return __awaiter(this, void 0, void 0, function* () {
6642
+ if (typeof subscriberId === 'undefined') {
6643
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
6644
+ }
6645
+ const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
6646
+ const payload = {};
6647
+ if (typeof queries !== 'undefined') {
6648
+ payload['queries'] = queries;
6649
+ }
6650
+ const uri = new URL(this.client.config.endpoint + apiPath);
6651
+ return yield this.client.call('get', uri, {
6652
+ 'content-type': 'application/json',
6653
+ }, payload);
6654
+ });
6655
+ }
6656
+ /**
6657
+ * List topics.
6658
+ *
6659
+ *
6660
+ * @param {string} queries
6661
+ * @param {string} search
6662
+ * @throws {AppwriteException}
6663
+ * @returns {Promise}
6664
+ */
6665
+ listTopics(queries, search) {
6666
+ return __awaiter(this, void 0, void 0, function* () {
6667
+ const apiPath = '/messaging/topics';
6668
+ const payload = {};
6669
+ if (typeof queries !== 'undefined') {
6670
+ payload['queries'] = queries;
6671
+ }
6672
+ if (typeof search !== 'undefined') {
6673
+ payload['search'] = search;
6674
+ }
6675
+ const uri = new URL(this.client.config.endpoint + apiPath);
6676
+ return yield this.client.call('get', uri, {
6677
+ 'content-type': 'application/json',
6678
+ }, payload);
6679
+ });
6680
+ }
6681
+ /**
6682
+ * Create a topic.
6683
+ *
6684
+ *
6685
+ * @param {string} topicId
6686
+ * @param {string} name
6687
+ * @param {string} description
6688
+ * @throws {AppwriteException}
6689
+ * @returns {Promise}
6690
+ */
6691
+ createTopic(topicId, name, description) {
6692
+ return __awaiter(this, void 0, void 0, function* () {
6693
+ if (typeof topicId === 'undefined') {
6694
+ throw new AppwriteException('Missing required parameter: "topicId"');
6695
+ }
6696
+ if (typeof name === 'undefined') {
6697
+ throw new AppwriteException('Missing required parameter: "name"');
6698
+ }
6699
+ const apiPath = '/messaging/topics';
6700
+ const payload = {};
6701
+ if (typeof topicId !== 'undefined') {
6702
+ payload['topicId'] = topicId;
6703
+ }
6704
+ if (typeof name !== 'undefined') {
6705
+ payload['name'] = name;
6706
+ }
6707
+ if (typeof description !== 'undefined') {
6708
+ payload['description'] = description;
6709
+ }
6710
+ const uri = new URL(this.client.config.endpoint + apiPath);
6711
+ return yield this.client.call('post', uri, {
6712
+ 'content-type': 'application/json',
6713
+ }, payload);
6714
+ });
6715
+ }
6716
+ /**
6717
+ * Get a topic.
6718
+ *
6719
+ *
6720
+ * @param {string} topicId
6721
+ * @throws {AppwriteException}
6722
+ * @returns {Promise}
6723
+ */
6724
+ getTopic(topicId) {
6725
+ return __awaiter(this, void 0, void 0, function* () {
6726
+ if (typeof topicId === 'undefined') {
6727
+ throw new AppwriteException('Missing required parameter: "topicId"');
6728
+ }
6729
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
6730
+ const payload = {};
6731
+ const uri = new URL(this.client.config.endpoint + apiPath);
6732
+ return yield this.client.call('get', uri, {
6733
+ 'content-type': 'application/json',
6734
+ }, payload);
6735
+ });
6736
+ }
6737
+ /**
6738
+ * Update a topic.
6739
+ *
6740
+ *
6741
+ * @param {string} topicId
6742
+ * @param {string} name
6743
+ * @param {string} description
6744
+ * @throws {AppwriteException}
6745
+ * @returns {Promise}
6746
+ */
6747
+ updateTopic(topicId, name, description) {
6748
+ return __awaiter(this, void 0, void 0, function* () {
6749
+ if (typeof topicId === 'undefined') {
6750
+ throw new AppwriteException('Missing required parameter: "topicId"');
6751
+ }
6752
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
6753
+ const payload = {};
6754
+ if (typeof name !== 'undefined') {
6755
+ payload['name'] = name;
6756
+ }
6757
+ if (typeof description !== 'undefined') {
6758
+ payload['description'] = description;
6759
+ }
6760
+ const uri = new URL(this.client.config.endpoint + apiPath);
6761
+ return yield this.client.call('patch', uri, {
6762
+ 'content-type': 'application/json',
6763
+ }, payload);
6764
+ });
6765
+ }
6766
+ /**
6767
+ * Delete a topic.
6768
+ *
6769
+ *
6770
+ * @param {string} topicId
6771
+ * @throws {AppwriteException}
6772
+ * @returns {Promise}
6773
+ */
6774
+ deleteTopic(topicId) {
6775
+ return __awaiter(this, void 0, void 0, function* () {
6776
+ if (typeof topicId === 'undefined') {
6777
+ throw new AppwriteException('Missing required parameter: "topicId"');
6778
+ }
6779
+ const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
6780
+ const payload = {};
6781
+ const uri = new URL(this.client.config.endpoint + apiPath);
6782
+ return yield this.client.call('delete', uri, {
6783
+ 'content-type': 'application/json',
6784
+ }, payload);
6785
+ });
6786
+ }
6787
+ /**
6788
+ * List topic logs
6789
+ *
6790
+ *
6791
+ * @param {string} topicId
6792
+ * @param {string[]} queries
6793
+ * @throws {AppwriteException}
6794
+ * @returns {Promise}
6795
+ */
6796
+ listTopicLogs(topicId, queries) {
6797
+ return __awaiter(this, void 0, void 0, function* () {
6798
+ if (typeof topicId === 'undefined') {
6799
+ throw new AppwriteException('Missing required parameter: "topicId"');
6800
+ }
6801
+ const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
6802
+ const payload = {};
6803
+ if (typeof queries !== 'undefined') {
6804
+ payload['queries'] = queries;
6805
+ }
6806
+ const uri = new URL(this.client.config.endpoint + apiPath);
6807
+ return yield this.client.call('get', uri, {
6808
+ 'content-type': 'application/json',
6809
+ }, payload);
6810
+ });
6811
+ }
6812
+ /**
6813
+ * List subscribers.
6814
+ *
6815
+ *
6816
+ * @param {string} topicId
6817
+ * @param {string} queries
6818
+ * @param {string} search
6819
+ * @throws {AppwriteException}
6820
+ * @returns {Promise}
6821
+ */
6822
+ listSubscribers(topicId, queries, search) {
6823
+ return __awaiter(this, void 0, void 0, function* () {
6824
+ if (typeof topicId === 'undefined') {
6825
+ throw new AppwriteException('Missing required parameter: "topicId"');
6826
+ }
6827
+ const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
6828
+ const payload = {};
6829
+ if (typeof queries !== 'undefined') {
6830
+ payload['queries'] = queries;
6831
+ }
6832
+ if (typeof search !== 'undefined') {
6833
+ payload['search'] = search;
6834
+ }
6835
+ const uri = new URL(this.client.config.endpoint + apiPath);
6836
+ return yield this.client.call('get', uri, {
6837
+ 'content-type': 'application/json',
6838
+ }, payload);
6839
+ });
6840
+ }
6841
+ /**
6842
+ * Create a subscriber.
6843
+ *
6844
+ *
6845
+ * @param {string} topicId
6846
+ * @param {string} subscriberId
6847
+ * @param {string} targetId
6848
+ * @throws {AppwriteException}
6849
+ * @returns {Promise}
6850
+ */
6851
+ createSubscriber(topicId, subscriberId, targetId) {
6852
+ return __awaiter(this, void 0, void 0, function* () {
6853
+ if (typeof topicId === 'undefined') {
6854
+ throw new AppwriteException('Missing required parameter: "topicId"');
6855
+ }
6856
+ if (typeof subscriberId === 'undefined') {
6857
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
6858
+ }
6859
+ if (typeof targetId === 'undefined') {
6860
+ throw new AppwriteException('Missing required parameter: "targetId"');
6861
+ }
6862
+ const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
6863
+ const payload = {};
6864
+ if (typeof subscriberId !== 'undefined') {
6865
+ payload['subscriberId'] = subscriberId;
6866
+ }
6867
+ if (typeof targetId !== 'undefined') {
6868
+ payload['targetId'] = targetId;
6869
+ }
6870
+ const uri = new URL(this.client.config.endpoint + apiPath);
6871
+ return yield this.client.call('post', uri, {
6872
+ 'content-type': 'application/json',
6873
+ }, payload);
6874
+ });
6875
+ }
6876
+ /**
6877
+ * Get a subscriber.
6878
+ *
6879
+ *
6880
+ * @param {string} topicId
6881
+ * @param {string} subscriberId
6882
+ * @throws {AppwriteException}
6883
+ * @returns {Promise}
6884
+ */
6885
+ getSubscriber(topicId, subscriberId) {
6886
+ return __awaiter(this, void 0, void 0, function* () {
6887
+ if (typeof topicId === 'undefined') {
6888
+ throw new AppwriteException('Missing required parameter: "topicId"');
6889
+ }
6890
+ if (typeof subscriberId === 'undefined') {
6891
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
6892
+ }
6893
+ const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
6894
+ const payload = {};
6895
+ const uri = new URL(this.client.config.endpoint + apiPath);
6896
+ return yield this.client.call('get', uri, {
6897
+ 'content-type': 'application/json',
6898
+ }, payload);
6899
+ });
6900
+ }
6901
+ /**
6902
+ * Delete a subscriber.
6903
+ *
6904
+ *
6905
+ * @param {string} topicId
6906
+ * @param {string} subscriberId
6907
+ * @throws {AppwriteException}
6908
+ * @returns {Promise}
6909
+ */
6910
+ deleteSubscriber(topicId, subscriberId) {
6911
+ return __awaiter(this, void 0, void 0, function* () {
6912
+ if (typeof topicId === 'undefined') {
6913
+ throw new AppwriteException('Missing required parameter: "topicId"');
6914
+ }
6915
+ if (typeof subscriberId === 'undefined') {
6916
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
6917
+ }
6918
+ const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
6919
+ const payload = {};
6920
+ const uri = new URL(this.client.config.endpoint + apiPath);
6921
+ return yield this.client.call('delete', uri, {
6922
+ 'content-type': 'application/json',
6923
+ }, payload);
6924
+ });
6925
+ }
6926
+ }
6927
+
6928
+ class Migrations extends Service {
6929
+ constructor(client) {
6930
+ super(client);
6931
+ }
6932
+ /**
6933
+ * List Migrations
6934
+ *
6935
+ *
6936
+ * @param {string} queries
6937
+ * @param {string} search
6938
+ * @throws {AppwriteException}
6939
+ * @returns {Promise}
6940
+ */
6941
+ list(queries, search) {
6942
+ return __awaiter(this, void 0, void 0, function* () {
6943
+ const apiPath = '/migrations';
6944
+ const payload = {};
6945
+ if (typeof queries !== 'undefined') {
6946
+ payload['queries'] = queries;
6947
+ }
6948
+ if (typeof search !== 'undefined') {
6949
+ payload['search'] = search;
6950
+ }
6951
+ const uri = new URL(this.client.config.endpoint + apiPath);
6952
+ return yield this.client.call('get', uri, {
6953
+ 'content-type': 'application/json',
6954
+ }, payload);
6955
+ });
6956
+ }
6957
+ /**
6958
+ * Migrate Appwrite Data
6959
+ *
6960
+ *
6961
+ * @param {string[]} resources
6962
+ * @param {string} endpoint
6963
+ * @param {string} projectId
6964
+ * @param {string} apiKey
6965
+ * @throws {AppwriteException}
6966
+ * @returns {Promise}
6967
+ */
6968
+ createAppwriteMigration(resources, endpoint, projectId, apiKey) {
6969
+ return __awaiter(this, void 0, void 0, function* () {
6970
+ if (typeof resources === 'undefined') {
6971
+ throw new AppwriteException('Missing required parameter: "resources"');
6972
+ }
6973
+ if (typeof endpoint === 'undefined') {
6974
+ throw new AppwriteException('Missing required parameter: "endpoint"');
6975
+ }
6976
+ if (typeof projectId === 'undefined') {
6977
+ throw new AppwriteException('Missing required parameter: "projectId"');
6978
+ }
6979
+ if (typeof apiKey === 'undefined') {
6980
+ throw new AppwriteException('Missing required parameter: "apiKey"');
6981
+ }
6982
+ const apiPath = '/migrations/appwrite';
6983
+ const payload = {};
6984
+ if (typeof resources !== 'undefined') {
6985
+ payload['resources'] = resources;
6986
+ }
6987
+ if (typeof endpoint !== 'undefined') {
6988
+ payload['endpoint'] = endpoint;
6989
+ }
6990
+ if (typeof projectId !== 'undefined') {
6991
+ payload['projectId'] = projectId;
6992
+ }
6993
+ if (typeof apiKey !== 'undefined') {
6994
+ payload['apiKey'] = apiKey;
6995
+ }
6996
+ const uri = new URL(this.client.config.endpoint + apiPath);
6997
+ return yield this.client.call('post', uri, {
6998
+ 'content-type': 'application/json',
6999
+ }, payload);
7000
+ });
7001
+ }
7002
+ /**
7003
+ * Generate a report on Appwrite Data
7004
+ *
7005
+ *
7006
+ * @param {string[]} resources
7007
+ * @param {string} endpoint
7008
+ * @param {string} projectID
7009
+ * @param {string} key
7010
+ * @throws {AppwriteException}
7011
+ * @returns {Promise}
7012
+ */
7013
+ getAppwriteReport(resources, endpoint, projectID, key) {
7014
+ return __awaiter(this, void 0, void 0, function* () {
7015
+ if (typeof resources === 'undefined') {
7016
+ throw new AppwriteException('Missing required parameter: "resources"');
7017
+ }
7018
+ if (typeof endpoint === 'undefined') {
7019
+ throw new AppwriteException('Missing required parameter: "endpoint"');
7020
+ }
7021
+ if (typeof projectID === 'undefined') {
7022
+ throw new AppwriteException('Missing required parameter: "projectID"');
7023
+ }
7024
+ if (typeof key === 'undefined') {
7025
+ throw new AppwriteException('Missing required parameter: "key"');
7026
+ }
7027
+ const apiPath = '/migrations/appwrite/report';
7028
+ const payload = {};
7029
+ if (typeof resources !== 'undefined') {
7030
+ payload['resources'] = resources;
7031
+ }
7032
+ if (typeof endpoint !== 'undefined') {
7033
+ payload['endpoint'] = endpoint;
7034
+ }
7035
+ if (typeof projectID !== 'undefined') {
7036
+ payload['projectID'] = projectID;
7037
+ }
7038
+ if (typeof key !== 'undefined') {
7039
+ payload['key'] = key;
7040
+ }
7041
+ const uri = new URL(this.client.config.endpoint + apiPath);
7042
+ return yield this.client.call('get', uri, {
7043
+ 'content-type': 'application/json',
7044
+ }, payload);
7045
+ });
7046
+ }
7047
+ /**
7048
+ * Migrate Firebase Data (Service Account)
7049
+ *
7050
+ *
7051
+ * @param {string[]} resources
7052
+ * @param {string} serviceAccount
7053
+ * @throws {AppwriteException}
7054
+ * @returns {Promise}
7055
+ */
7056
+ createFirebaseMigration(resources, serviceAccount) {
7057
+ return __awaiter(this, void 0, void 0, function* () {
7058
+ if (typeof resources === 'undefined') {
7059
+ throw new AppwriteException('Missing required parameter: "resources"');
7060
+ }
7061
+ if (typeof serviceAccount === 'undefined') {
7062
+ throw new AppwriteException('Missing required parameter: "serviceAccount"');
7063
+ }
7064
+ const apiPath = '/migrations/firebase';
7065
+ const payload = {};
7066
+ if (typeof resources !== 'undefined') {
7067
+ payload['resources'] = resources;
7068
+ }
7069
+ if (typeof serviceAccount !== 'undefined') {
7070
+ payload['serviceAccount'] = serviceAccount;
7071
+ }
7072
+ const uri = new URL(this.client.config.endpoint + apiPath);
7073
+ return yield this.client.call('post', uri, {
7074
+ 'content-type': 'application/json',
7075
+ }, payload);
7076
+ });
7077
+ }
7078
+ /**
7079
+ * Revoke Appwrite's authorization to access Firebase Projects
7080
+ *
7081
+ *
7082
+ * @throws {AppwriteException}
7083
+ * @returns {Promise}
7084
+ */
7085
+ deleteFirebaseAuth() {
7086
+ return __awaiter(this, void 0, void 0, function* () {
7087
+ const apiPath = '/migrations/firebase/deauthorize';
7088
+ const payload = {};
7089
+ const uri = new URL(this.client.config.endpoint + apiPath);
7090
+ return yield this.client.call('get', uri, {
7091
+ 'content-type': 'application/json',
7092
+ }, payload);
7093
+ });
7094
+ }
7095
+ /**
7096
+ * Migrate Firebase Data (OAuth)
7097
+ *
7098
+ *
7099
+ * @param {string[]} resources
7100
+ * @param {string} projectId
7101
+ * @throws {AppwriteException}
7102
+ * @returns {Promise}
7103
+ */
7104
+ createFirebaseOAuthMigration(resources, projectId) {
7105
+ return __awaiter(this, void 0, void 0, function* () {
7106
+ if (typeof resources === 'undefined') {
7107
+ throw new AppwriteException('Missing required parameter: "resources"');
5308
7108
  }
5309
7109
  if (typeof projectId === 'undefined') {
5310
7110
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -5741,30 +7541,16 @@
5741
7541
  * Get usage stats for a project
5742
7542
  *
5743
7543
  *
5744
- * @param {string} startDate
5745
- * @param {string} endDate
5746
- * @param {string} period
7544
+ * @param {string} range
5747
7545
  * @throws {AppwriteException}
5748
7546
  * @returns {Promise}
5749
7547
  */
5750
- getUsage(startDate, endDate, period) {
7548
+ getUsage(range) {
5751
7549
  return __awaiter(this, void 0, void 0, function* () {
5752
- if (typeof startDate === 'undefined') {
5753
- throw new AppwriteException('Missing required parameter: "startDate"');
5754
- }
5755
- if (typeof endDate === 'undefined') {
5756
- throw new AppwriteException('Missing required parameter: "endDate"');
5757
- }
5758
7550
  const apiPath = '/project/usage';
5759
7551
  const payload = {};
5760
- if (typeof startDate !== 'undefined') {
5761
- payload['startDate'] = startDate;
5762
- }
5763
- if (typeof endDate !== 'undefined') {
5764
- payload['endDate'] = endDate;
5765
- }
5766
- if (typeof period !== 'undefined') {
5767
- payload['period'] = period;
7552
+ if (typeof range !== 'undefined') {
7553
+ payload['range'] = range;
5768
7554
  }
5769
7555
  const uri = new URL(this.client.config.endpoint + apiPath);
5770
7556
  return yield this.client.call('get', uri, {
@@ -6201,6 +7987,34 @@
6201
7987
  }, payload);
6202
7988
  });
6203
7989
  }
7990
+ /**
7991
+ * Update Project user minimum sessions factors
7992
+ *
7993
+ *
7994
+ * @param {string} projectId
7995
+ * @param {number} factors
7996
+ * @throws {AppwriteException}
7997
+ * @returns {Promise}
7998
+ */
7999
+ updateAuthMfaFactors(projectId, factors) {
8000
+ return __awaiter(this, void 0, void 0, function* () {
8001
+ if (typeof projectId === 'undefined') {
8002
+ throw new AppwriteException('Missing required parameter: "projectId"');
8003
+ }
8004
+ if (typeof factors === 'undefined') {
8005
+ throw new AppwriteException('Missing required parameter: "factors"');
8006
+ }
8007
+ const apiPath = '/projects/{projectId}/auth/mfa/factors'.replace('{projectId}', projectId);
8008
+ const payload = {};
8009
+ if (typeof factors !== 'undefined') {
8010
+ payload['factors'] = factors;
8011
+ }
8012
+ const uri = new URL(this.client.config.endpoint + apiPath);
8013
+ return yield this.client.call('patch', uri, {
8014
+ 'content-type': 'application/json',
8015
+ }, payload);
8016
+ });
8017
+ }
6204
8018
  /**
6205
8019
  * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password
6206
8020
  *
@@ -7030,6 +8844,31 @@
7030
8844
  }, payload);
7031
8845
  });
7032
8846
  }
8847
+ /**
8848
+ * Get usage stats for a project
8849
+ *
8850
+ *
8851
+ * @param {string} projectId
8852
+ * @param {string} range
8853
+ * @throws {AppwriteException}
8854
+ * @returns {Promise}
8855
+ */
8856
+ getUsage(projectId, range) {
8857
+ return __awaiter(this, void 0, void 0, function* () {
8858
+ if (typeof projectId === 'undefined') {
8859
+ throw new AppwriteException('Missing required parameter: "projectId"');
8860
+ }
8861
+ const apiPath = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
8862
+ const payload = {};
8863
+ if (typeof range !== 'undefined') {
8864
+ payload['range'] = range;
8865
+ }
8866
+ const uri = new URL(this.client.config.endpoint + apiPath);
8867
+ return yield this.client.call('get', uri, {
8868
+ 'content-type': 'application/json',
8869
+ }, payload);
8870
+ });
8871
+ }
7033
8872
  /**
7034
8873
  * List webhooks
7035
8874
  *
@@ -7950,7 +9789,7 @@
7950
9789
  });
7951
9790
  }
7952
9791
  /**
7953
- * Get usage stats for storage bucket
9792
+ * Get usage stats for a storage bucket
7954
9793
  *
7955
9794
  *
7956
9795
  * @param {string} bucketId
@@ -8947,16 +10786,20 @@
8947
10786
  *
8948
10787
  *
8949
10788
  * @param {string} range
10789
+ * @param {string} provider
8950
10790
  * @throws {AppwriteException}
8951
10791
  * @returns {Promise}
8952
10792
  */
8953
- getUsage(range) {
10793
+ getUsage(range, provider) {
8954
10794
  return __awaiter(this, void 0, void 0, function* () {
8955
10795
  const apiPath = '/users/usage';
8956
10796
  const payload = {};
8957
10797
  if (typeof range !== 'undefined') {
8958
10798
  payload['range'] = range;
8959
10799
  }
10800
+ if (typeof provider !== 'undefined') {
10801
+ payload['provider'] = provider;
10802
+ }
8960
10803
  const uri = new URL(this.client.config.endpoint + apiPath);
8961
10804
  return yield this.client.call('get', uri, {
8962
10805
  'content-type': 'application/json',
@@ -9363,6 +11206,168 @@
9363
11206
  }, payload);
9364
11207
  });
9365
11208
  }
11209
+ /**
11210
+ * List User Targets
11211
+ *
11212
+ *
11213
+ * @param {string} userId
11214
+ * @param {string} queries
11215
+ * @throws {AppwriteException}
11216
+ * @returns {Promise}
11217
+ */
11218
+ listTargets(userId, queries) {
11219
+ return __awaiter(this, void 0, void 0, function* () {
11220
+ if (typeof userId === 'undefined') {
11221
+ throw new AppwriteException('Missing required parameter: "userId"');
11222
+ }
11223
+ const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
11224
+ const payload = {};
11225
+ if (typeof queries !== 'undefined') {
11226
+ payload['queries'] = queries;
11227
+ }
11228
+ const uri = new URL(this.client.config.endpoint + apiPath);
11229
+ return yield this.client.call('get', uri, {
11230
+ 'content-type': 'application/json',
11231
+ }, payload);
11232
+ });
11233
+ }
11234
+ /**
11235
+ * Create User Target
11236
+ *
11237
+ *
11238
+ * @param {string} userId
11239
+ * @param {string} targetId
11240
+ * @param {string} providerType
11241
+ * @param {string} identifier
11242
+ * @param {string} providerId
11243
+ * @param {string} name
11244
+ * @throws {AppwriteException}
11245
+ * @returns {Promise}
11246
+ */
11247
+ createTarget(userId, targetId, providerType, identifier, providerId, name) {
11248
+ return __awaiter(this, void 0, void 0, function* () {
11249
+ if (typeof userId === 'undefined') {
11250
+ throw new AppwriteException('Missing required parameter: "userId"');
11251
+ }
11252
+ if (typeof targetId === 'undefined') {
11253
+ throw new AppwriteException('Missing required parameter: "targetId"');
11254
+ }
11255
+ if (typeof providerType === 'undefined') {
11256
+ throw new AppwriteException('Missing required parameter: "providerType"');
11257
+ }
11258
+ if (typeof identifier === 'undefined') {
11259
+ throw new AppwriteException('Missing required parameter: "identifier"');
11260
+ }
11261
+ const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
11262
+ const payload = {};
11263
+ if (typeof targetId !== 'undefined') {
11264
+ payload['targetId'] = targetId;
11265
+ }
11266
+ if (typeof providerType !== 'undefined') {
11267
+ payload['providerType'] = providerType;
11268
+ }
11269
+ if (typeof identifier !== 'undefined') {
11270
+ payload['identifier'] = identifier;
11271
+ }
11272
+ if (typeof providerId !== 'undefined') {
11273
+ payload['providerId'] = providerId;
11274
+ }
11275
+ if (typeof name !== 'undefined') {
11276
+ payload['name'] = name;
11277
+ }
11278
+ const uri = new URL(this.client.config.endpoint + apiPath);
11279
+ return yield this.client.call('post', uri, {
11280
+ 'content-type': 'application/json',
11281
+ }, payload);
11282
+ });
11283
+ }
11284
+ /**
11285
+ * Get User Target
11286
+ *
11287
+ *
11288
+ * @param {string} userId
11289
+ * @param {string} targetId
11290
+ * @throws {AppwriteException}
11291
+ * @returns {Promise}
11292
+ */
11293
+ getTarget(userId, targetId) {
11294
+ return __awaiter(this, void 0, void 0, function* () {
11295
+ if (typeof userId === 'undefined') {
11296
+ throw new AppwriteException('Missing required parameter: "userId"');
11297
+ }
11298
+ if (typeof targetId === 'undefined') {
11299
+ throw new AppwriteException('Missing required parameter: "targetId"');
11300
+ }
11301
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
11302
+ const payload = {};
11303
+ const uri = new URL(this.client.config.endpoint + apiPath);
11304
+ return yield this.client.call('get', uri, {
11305
+ 'content-type': 'application/json',
11306
+ }, payload);
11307
+ });
11308
+ }
11309
+ /**
11310
+ * Update User target
11311
+ *
11312
+ *
11313
+ * @param {string} userId
11314
+ * @param {string} targetId
11315
+ * @param {string} identifier
11316
+ * @param {string} providerId
11317
+ * @param {string} name
11318
+ * @throws {AppwriteException}
11319
+ * @returns {Promise}
11320
+ */
11321
+ updateTarget(userId, targetId, identifier, providerId, name) {
11322
+ return __awaiter(this, void 0, void 0, function* () {
11323
+ if (typeof userId === 'undefined') {
11324
+ throw new AppwriteException('Missing required parameter: "userId"');
11325
+ }
11326
+ if (typeof targetId === 'undefined') {
11327
+ throw new AppwriteException('Missing required parameter: "targetId"');
11328
+ }
11329
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
11330
+ const payload = {};
11331
+ if (typeof identifier !== 'undefined') {
11332
+ payload['identifier'] = identifier;
11333
+ }
11334
+ if (typeof providerId !== 'undefined') {
11335
+ payload['providerId'] = providerId;
11336
+ }
11337
+ if (typeof name !== 'undefined') {
11338
+ payload['name'] = name;
11339
+ }
11340
+ const uri = new URL(this.client.config.endpoint + apiPath);
11341
+ return yield this.client.call('patch', uri, {
11342
+ 'content-type': 'application/json',
11343
+ }, payload);
11344
+ });
11345
+ }
11346
+ /**
11347
+ * Delete user target
11348
+ *
11349
+ *
11350
+ * @param {string} userId
11351
+ * @param {string} targetId
11352
+ * @throws {AppwriteException}
11353
+ * @returns {Promise}
11354
+ */
11355
+ deleteTarget(userId, targetId) {
11356
+ return __awaiter(this, void 0, void 0, function* () {
11357
+ if (typeof userId === 'undefined') {
11358
+ throw new AppwriteException('Missing required parameter: "userId"');
11359
+ }
11360
+ if (typeof targetId === 'undefined') {
11361
+ throw new AppwriteException('Missing required parameter: "targetId"');
11362
+ }
11363
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
11364
+ const payload = {};
11365
+ const uri = new URL(this.client.config.endpoint + apiPath);
11366
+ return yield this.client.call('delete', uri, {
11367
+ 'content-type': 'application/json',
11368
+ }, payload);
11369
+ });
11370
+ }
9366
11371
  /**
9367
11372
  * Update email verification
9368
11373
  *
@@ -9800,6 +11805,7 @@
9800
11805
  exports.Health = Health;
9801
11806
  exports.ID = ID;
9802
11807
  exports.Locale = Locale;
11808
+ exports.Messaging = Messaging;
9803
11809
  exports.Migrations = Migrations;
9804
11810
  exports.Permission = Permission;
9805
11811
  exports.Project = Project;