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