@appwrite.io/console 0.6.0-rc.7 → 0.6.0-rc.8
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 +241 -55
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +241 -55
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +241 -55
- package/docs/examples/account/create-email-token.md +18 -0
- package/docs/examples/account/create-push-target.md +18 -0
- package/docs/examples/account/delete.md +18 -0
- package/docs/examples/account/update-push-target.md +1 -0
- package/docs/examples/messaging/{create-apns-provider.md → create-a-p-n-s-provider.md} +1 -1
- package/docs/examples/messaging/create-email.md +18 -0
- package/docs/examples/messaging/{create-fcm-provider.md → create-f-c-m-provider.md} +1 -1
- package/docs/examples/messaging/create-push.md +18 -0
- package/docs/examples/messaging/{create-s-m-s-message.md → create-s-m-s.md} +1 -1
- package/docs/examples/messaging/{update-fcm-provider.md → list-targets.md} +1 -1
- package/docs/examples/messaging/{update-apns-provider.md → update-a-p-n-s-provider.md} +1 -1
- package/docs/examples/messaging/update-f-c-m-provider.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/projects/{update-smtp-configuration.md → create-smtp-test.md} +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/{get-usage.md → update-smtp.md} +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +208 -182
- package/src/services/account.ts +115 -8
- package/src/services/functions.ts +1 -1
- package/src/services/messaging.ts +36 -7
- package/src/services/project.ts +22 -4
- package/src/services/projects.ts +97 -31
- package/src/services/storage.ts +1 -1
- package/src/services/users.ts +1 -6
- package/types/models.d.ts +208 -182
- package/types/services/account.d.ts +48 -8
- package/types/services/functions.d.ts +1 -1
- package/types/services/messaging.d.ts +19 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +24 -14
- package/types/services/storage.d.ts +1 -1
- package/types/services/users.d.ts +1 -2
- package/docs/examples/messaging/create-email-message.md +0 -18
- package/docs/examples/messaging/create-push-message.md +0 -18
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
|
|
|
33
33
|
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
|
-
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.6.0-rc.
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.6.0-rc.8"></script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
|
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.6.0-rc.
|
|
107
|
+
'x-sdk-version': '0.6.0-rc.8',
|
|
108
108
|
'X-Appwrite-Response-Format': '1.4.0',
|
|
109
109
|
};
|
|
110
110
|
this.realtime = {
|
|
@@ -508,6 +508,24 @@ 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
|
+
}
|
|
511
529
|
/**
|
|
512
530
|
* Update email
|
|
513
531
|
*
|
|
@@ -1283,11 +1301,10 @@ class Account extends Service {
|
|
|
1283
1301
|
});
|
|
1284
1302
|
}
|
|
1285
1303
|
/**
|
|
1286
|
-
* Update
|
|
1304
|
+
* Update (or renew) a session
|
|
1287
1305
|
*
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
1290
|
-
* "refresh" the access token.
|
|
1306
|
+
* Extend session's expiry to increase it's lifespan. Extending a session is
|
|
1307
|
+
* useful when session length is short such as 5 minutes.
|
|
1291
1308
|
*
|
|
1292
1309
|
* @param {string} sessionId
|
|
1293
1310
|
* @throws {AppwriteException}
|
|
@@ -1352,6 +1369,41 @@ class Account extends Service {
|
|
|
1352
1369
|
}, payload);
|
|
1353
1370
|
});
|
|
1354
1371
|
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Create Account's push target
|
|
1374
|
+
*
|
|
1375
|
+
*
|
|
1376
|
+
* @param {string} targetId
|
|
1377
|
+
* @param {string} identifier
|
|
1378
|
+
* @param {string} providerId
|
|
1379
|
+
* @throws {AppwriteException}
|
|
1380
|
+
* @returns {Promise}
|
|
1381
|
+
*/
|
|
1382
|
+
createPushTarget(targetId, identifier, providerId) {
|
|
1383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1384
|
+
if (typeof targetId === 'undefined') {
|
|
1385
|
+
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1386
|
+
}
|
|
1387
|
+
if (typeof identifier === 'undefined') {
|
|
1388
|
+
throw new AppwriteException('Missing required parameter: "identifier"');
|
|
1389
|
+
}
|
|
1390
|
+
const apiPath = '/account/targets/push';
|
|
1391
|
+
const payload = {};
|
|
1392
|
+
if (typeof targetId !== 'undefined') {
|
|
1393
|
+
payload['targetId'] = targetId;
|
|
1394
|
+
}
|
|
1395
|
+
if (typeof identifier !== 'undefined') {
|
|
1396
|
+
payload['identifier'] = identifier;
|
|
1397
|
+
}
|
|
1398
|
+
if (typeof providerId !== 'undefined') {
|
|
1399
|
+
payload['providerId'] = providerId;
|
|
1400
|
+
}
|
|
1401
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1402
|
+
return yield this.client.call('post', uri, {
|
|
1403
|
+
'content-type': 'application/json',
|
|
1404
|
+
}, payload);
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1355
1407
|
/**
|
|
1356
1408
|
* Update Account's push target
|
|
1357
1409
|
*
|
|
@@ -1380,6 +1432,51 @@ class Account extends Service {
|
|
|
1380
1432
|
}, payload);
|
|
1381
1433
|
});
|
|
1382
1434
|
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Create email token (OTP)
|
|
1437
|
+
*
|
|
1438
|
+
* Sends the user an email with a secret key for creating a session. If the
|
|
1439
|
+
* provided user ID has not be registered, a new user will be created. Use the
|
|
1440
|
+
* returned user ID and secret and submit a request to the [POST
|
|
1441
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1442
|
+
* endpoint to complete the login process. The secret sent to the user's email
|
|
1443
|
+
* is valid for 15 minutes.
|
|
1444
|
+
*
|
|
1445
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1446
|
+
* about session
|
|
1447
|
+
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1448
|
+
*
|
|
1449
|
+
* @param {string} userId
|
|
1450
|
+
* @param {string} email
|
|
1451
|
+
* @param {boolean} securityPhrase
|
|
1452
|
+
* @throws {AppwriteException}
|
|
1453
|
+
* @returns {Promise}
|
|
1454
|
+
*/
|
|
1455
|
+
createEmailToken(userId, email, securityPhrase) {
|
|
1456
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1457
|
+
if (typeof userId === 'undefined') {
|
|
1458
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1459
|
+
}
|
|
1460
|
+
if (typeof email === 'undefined') {
|
|
1461
|
+
throw new AppwriteException('Missing required parameter: "email"');
|
|
1462
|
+
}
|
|
1463
|
+
const apiPath = '/account/tokens/email';
|
|
1464
|
+
const payload = {};
|
|
1465
|
+
if (typeof userId !== 'undefined') {
|
|
1466
|
+
payload['userId'] = userId;
|
|
1467
|
+
}
|
|
1468
|
+
if (typeof email !== 'undefined') {
|
|
1469
|
+
payload['email'] = email;
|
|
1470
|
+
}
|
|
1471
|
+
if (typeof securityPhrase !== 'undefined') {
|
|
1472
|
+
payload['securityPhrase'] = securityPhrase;
|
|
1473
|
+
}
|
|
1474
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1475
|
+
return yield this.client.call('post', uri, {
|
|
1476
|
+
'content-type': 'application/json',
|
|
1477
|
+
}, payload);
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1383
1480
|
/**
|
|
1384
1481
|
* Create magic URL token
|
|
1385
1482
|
*
|
|
@@ -1388,8 +1485,8 @@ class Account extends Service {
|
|
|
1388
1485
|
* the user clicks the link in the email, the user is redirected back to the
|
|
1389
1486
|
* URL you provided with the secret key and userId values attached to the URL
|
|
1390
1487
|
* query string. Use the query string parameters to submit a request to the
|
|
1391
|
-
* [
|
|
1392
|
-
* /account/sessions/
|
|
1488
|
+
* [POST
|
|
1489
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1393
1490
|
* endpoint to complete the login process. The link sent to the user's email
|
|
1394
1491
|
* address is valid for 1 hour. If you are on a mobile device you can leave
|
|
1395
1492
|
* the URL parameter empty, so that the login completion will be handled by
|
|
@@ -1440,8 +1537,8 @@ class Account extends Service {
|
|
|
1440
1537
|
*
|
|
1441
1538
|
* Sends the user an SMS with a secret key for creating a session. If the
|
|
1442
1539
|
* provided user ID has not be registered, a new user will be created. Use the
|
|
1443
|
-
* returned user ID and secret and submit a request to the [
|
|
1444
|
-
* /account/sessions/
|
|
1540
|
+
* returned user ID and secret and submit a request to the [POST
|
|
1541
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1445
1542
|
* endpoint to complete the login process. The secret sent to the user's phone
|
|
1446
1543
|
* is valid for 15 minutes.
|
|
1447
1544
|
*
|
|
@@ -5368,7 +5465,7 @@ class Messaging extends Service {
|
|
|
5368
5465
|
* @throws {AppwriteException}
|
|
5369
5466
|
* @returns {Promise}
|
|
5370
5467
|
*/
|
|
5371
|
-
|
|
5468
|
+
createEmail(messageId, subject, content, topics, users, targets, cc, bcc, description, status, html, scheduledAt) {
|
|
5372
5469
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5373
5470
|
if (typeof messageId === 'undefined') {
|
|
5374
5471
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5511,7 +5608,7 @@ class Messaging extends Service {
|
|
|
5511
5608
|
* @throws {AppwriteException}
|
|
5512
5609
|
* @returns {Promise}
|
|
5513
5610
|
*/
|
|
5514
|
-
|
|
5611
|
+
createPush(messageId, title, body, topics, users, targets, description, data, action, icon, sound, color, tag, badge, status, scheduledAt) {
|
|
5515
5612
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5516
5613
|
if (typeof messageId === 'undefined') {
|
|
5517
5614
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5674,7 +5771,7 @@ class Messaging extends Service {
|
|
|
5674
5771
|
* @throws {AppwriteException}
|
|
5675
5772
|
* @returns {Promise}
|
|
5676
5773
|
*/
|
|
5677
|
-
|
|
5774
|
+
createSMS(messageId, content, topics, users, targets, description, status, scheduledAt) {
|
|
5678
5775
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5679
5776
|
if (typeof messageId === 'undefined') {
|
|
5680
5777
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5809,6 +5906,33 @@ class Messaging extends Service {
|
|
|
5809
5906
|
}, payload);
|
|
5810
5907
|
});
|
|
5811
5908
|
}
|
|
5909
|
+
/**
|
|
5910
|
+
* List message targets
|
|
5911
|
+
*
|
|
5912
|
+
* List the targets associated with a message as set via the targets
|
|
5913
|
+
* attribute.
|
|
5914
|
+
*
|
|
5915
|
+
* @param {string} messageId
|
|
5916
|
+
* @param {string} queries
|
|
5917
|
+
* @throws {AppwriteException}
|
|
5918
|
+
* @returns {Promise}
|
|
5919
|
+
*/
|
|
5920
|
+
listTargets(messageId, queries) {
|
|
5921
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5922
|
+
if (typeof messageId === 'undefined') {
|
|
5923
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
5924
|
+
}
|
|
5925
|
+
const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
5926
|
+
const payload = {};
|
|
5927
|
+
if (typeof queries !== 'undefined') {
|
|
5928
|
+
payload['queries'] = queries;
|
|
5929
|
+
}
|
|
5930
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5931
|
+
return yield this.client.call('get', uri, {
|
|
5932
|
+
'content-type': 'application/json',
|
|
5933
|
+
}, payload);
|
|
5934
|
+
});
|
|
5935
|
+
}
|
|
5812
5936
|
/**
|
|
5813
5937
|
* List providers
|
|
5814
5938
|
*
|
|
@@ -5848,7 +5972,7 @@ class Messaging extends Service {
|
|
|
5848
5972
|
* @throws {AppwriteException}
|
|
5849
5973
|
* @returns {Promise}
|
|
5850
5974
|
*/
|
|
5851
|
-
|
|
5975
|
+
createAPNSProvider(providerId, name, authKey, authKeyId, teamId, bundleId, enabled) {
|
|
5852
5976
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5853
5977
|
if (typeof providerId === 'undefined') {
|
|
5854
5978
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5899,7 +6023,7 @@ class Messaging extends Service {
|
|
|
5899
6023
|
* @throws {AppwriteException}
|
|
5900
6024
|
* @returns {Promise}
|
|
5901
6025
|
*/
|
|
5902
|
-
|
|
6026
|
+
updateAPNSProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId) {
|
|
5903
6027
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5904
6028
|
if (typeof providerId === 'undefined') {
|
|
5905
6029
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5941,7 +6065,7 @@ class Messaging extends Service {
|
|
|
5941
6065
|
* @throws {AppwriteException}
|
|
5942
6066
|
* @returns {Promise}
|
|
5943
6067
|
*/
|
|
5944
|
-
|
|
6068
|
+
createFCMProvider(providerId, name, serviceAccountJSON, enabled) {
|
|
5945
6069
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5946
6070
|
if (typeof providerId === 'undefined') {
|
|
5947
6071
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -5980,7 +6104,7 @@ class Messaging extends Service {
|
|
|
5980
6104
|
* @throws {AppwriteException}
|
|
5981
6105
|
* @returns {Promise}
|
|
5982
6106
|
*/
|
|
5983
|
-
|
|
6107
|
+
updateFCMProvider(providerId, name, enabled, serviceAccountJSON) {
|
|
5984
6108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5985
6109
|
if (typeof providerId === 'undefined') {
|
|
5986
6110
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -7646,16 +7770,30 @@ class Project extends Service {
|
|
|
7646
7770
|
* Get usage stats for a project
|
|
7647
7771
|
*
|
|
7648
7772
|
*
|
|
7649
|
-
* @param {string}
|
|
7773
|
+
* @param {string} startDate
|
|
7774
|
+
* @param {string} endDate
|
|
7775
|
+
* @param {string} period
|
|
7650
7776
|
* @throws {AppwriteException}
|
|
7651
7777
|
* @returns {Promise}
|
|
7652
7778
|
*/
|
|
7653
|
-
getUsage(
|
|
7779
|
+
getUsage(startDate, endDate, period) {
|
|
7654
7780
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7781
|
+
if (typeof startDate === 'undefined') {
|
|
7782
|
+
throw new AppwriteException('Missing required parameter: "startDate"');
|
|
7783
|
+
}
|
|
7784
|
+
if (typeof endDate === 'undefined') {
|
|
7785
|
+
throw new AppwriteException('Missing required parameter: "endDate"');
|
|
7786
|
+
}
|
|
7655
7787
|
const apiPath = '/project/usage';
|
|
7656
7788
|
const payload = {};
|
|
7657
|
-
if (typeof
|
|
7658
|
-
payload['
|
|
7789
|
+
if (typeof startDate !== 'undefined') {
|
|
7790
|
+
payload['startDate'] = startDate;
|
|
7791
|
+
}
|
|
7792
|
+
if (typeof endDate !== 'undefined') {
|
|
7793
|
+
payload['endDate'] = endDate;
|
|
7794
|
+
}
|
|
7795
|
+
if (typeof period !== 'undefined') {
|
|
7796
|
+
payload['period'] = period;
|
|
7659
7797
|
}
|
|
7660
7798
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7661
7799
|
return yield this.client.call('get', uri, {
|
|
@@ -8655,7 +8793,7 @@ class Projects extends Service {
|
|
|
8655
8793
|
});
|
|
8656
8794
|
}
|
|
8657
8795
|
/**
|
|
8658
|
-
* Update SMTP
|
|
8796
|
+
* Update SMTP
|
|
8659
8797
|
*
|
|
8660
8798
|
*
|
|
8661
8799
|
* @param {string} projectId
|
|
@@ -8671,7 +8809,7 @@ class Projects extends Service {
|
|
|
8671
8809
|
* @throws {AppwriteException}
|
|
8672
8810
|
* @returns {Promise}
|
|
8673
8811
|
*/
|
|
8674
|
-
|
|
8812
|
+
updateSmtp(projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure) {
|
|
8675
8813
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8676
8814
|
if (typeof projectId === 'undefined') {
|
|
8677
8815
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -8714,6 +8852,75 @@ class Projects extends Service {
|
|
|
8714
8852
|
}, payload);
|
|
8715
8853
|
});
|
|
8716
8854
|
}
|
|
8855
|
+
/**
|
|
8856
|
+
* Create SMTP test
|
|
8857
|
+
*
|
|
8858
|
+
*
|
|
8859
|
+
* @param {string} projectId
|
|
8860
|
+
* @param {string[]} emails
|
|
8861
|
+
* @param {string} senderName
|
|
8862
|
+
* @param {string} senderEmail
|
|
8863
|
+
* @param {string} host
|
|
8864
|
+
* @param {string} replyTo
|
|
8865
|
+
* @param {number} port
|
|
8866
|
+
* @param {string} username
|
|
8867
|
+
* @param {string} password
|
|
8868
|
+
* @param {string} secure
|
|
8869
|
+
* @throws {AppwriteException}
|
|
8870
|
+
* @returns {Promise}
|
|
8871
|
+
*/
|
|
8872
|
+
createSmtpTest(projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure) {
|
|
8873
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8874
|
+
if (typeof projectId === 'undefined') {
|
|
8875
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
8876
|
+
}
|
|
8877
|
+
if (typeof emails === 'undefined') {
|
|
8878
|
+
throw new AppwriteException('Missing required parameter: "emails"');
|
|
8879
|
+
}
|
|
8880
|
+
if (typeof senderName === 'undefined') {
|
|
8881
|
+
throw new AppwriteException('Missing required parameter: "senderName"');
|
|
8882
|
+
}
|
|
8883
|
+
if (typeof senderEmail === 'undefined') {
|
|
8884
|
+
throw new AppwriteException('Missing required parameter: "senderEmail"');
|
|
8885
|
+
}
|
|
8886
|
+
if (typeof host === 'undefined') {
|
|
8887
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
8888
|
+
}
|
|
8889
|
+
const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
|
|
8890
|
+
const payload = {};
|
|
8891
|
+
if (typeof emails !== 'undefined') {
|
|
8892
|
+
payload['emails'] = emails;
|
|
8893
|
+
}
|
|
8894
|
+
if (typeof senderName !== 'undefined') {
|
|
8895
|
+
payload['senderName'] = senderName;
|
|
8896
|
+
}
|
|
8897
|
+
if (typeof senderEmail !== 'undefined') {
|
|
8898
|
+
payload['senderEmail'] = senderEmail;
|
|
8899
|
+
}
|
|
8900
|
+
if (typeof replyTo !== 'undefined') {
|
|
8901
|
+
payload['replyTo'] = replyTo;
|
|
8902
|
+
}
|
|
8903
|
+
if (typeof host !== 'undefined') {
|
|
8904
|
+
payload['host'] = host;
|
|
8905
|
+
}
|
|
8906
|
+
if (typeof port !== 'undefined') {
|
|
8907
|
+
payload['port'] = port;
|
|
8908
|
+
}
|
|
8909
|
+
if (typeof username !== 'undefined') {
|
|
8910
|
+
payload['username'] = username;
|
|
8911
|
+
}
|
|
8912
|
+
if (typeof password !== 'undefined') {
|
|
8913
|
+
payload['password'] = password;
|
|
8914
|
+
}
|
|
8915
|
+
if (typeof secure !== 'undefined') {
|
|
8916
|
+
payload['secure'] = secure;
|
|
8917
|
+
}
|
|
8918
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8919
|
+
return yield this.client.call('post', uri, {
|
|
8920
|
+
'content-type': 'application/json',
|
|
8921
|
+
}, payload);
|
|
8922
|
+
});
|
|
8923
|
+
}
|
|
8717
8924
|
/**
|
|
8718
8925
|
* Update Project Team
|
|
8719
8926
|
*
|
|
@@ -8949,31 +9156,6 @@ class Projects extends Service {
|
|
|
8949
9156
|
}, payload);
|
|
8950
9157
|
});
|
|
8951
9158
|
}
|
|
8952
|
-
/**
|
|
8953
|
-
* Get usage stats for a project
|
|
8954
|
-
*
|
|
8955
|
-
*
|
|
8956
|
-
* @param {string} projectId
|
|
8957
|
-
* @param {string} range
|
|
8958
|
-
* @throws {AppwriteException}
|
|
8959
|
-
* @returns {Promise}
|
|
8960
|
-
*/
|
|
8961
|
-
getUsage(projectId, range) {
|
|
8962
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
8963
|
-
if (typeof projectId === 'undefined') {
|
|
8964
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
8965
|
-
}
|
|
8966
|
-
const apiPath = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
|
|
8967
|
-
const payload = {};
|
|
8968
|
-
if (typeof range !== 'undefined') {
|
|
8969
|
-
payload['range'] = range;
|
|
8970
|
-
}
|
|
8971
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8972
|
-
return yield this.client.call('get', uri, {
|
|
8973
|
-
'content-type': 'application/json',
|
|
8974
|
-
}, payload);
|
|
8975
|
-
});
|
|
8976
|
-
}
|
|
8977
9159
|
/**
|
|
8978
9160
|
* List webhooks
|
|
8979
9161
|
*
|
|
@@ -9004,12 +9186,13 @@ class Projects extends Service {
|
|
|
9004
9186
|
* @param {string[]} events
|
|
9005
9187
|
* @param {string} url
|
|
9006
9188
|
* @param {boolean} security
|
|
9189
|
+
* @param {boolean} enabled
|
|
9007
9190
|
* @param {string} httpUser
|
|
9008
9191
|
* @param {string} httpPass
|
|
9009
9192
|
* @throws {AppwriteException}
|
|
9010
9193
|
* @returns {Promise}
|
|
9011
9194
|
*/
|
|
9012
|
-
createWebhook(projectId, name, events, url, security, httpUser, httpPass) {
|
|
9195
|
+
createWebhook(projectId, name, events, url, security, enabled, httpUser, httpPass) {
|
|
9013
9196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9014
9197
|
if (typeof projectId === 'undefined') {
|
|
9015
9198
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -9031,6 +9214,9 @@ class Projects extends Service {
|
|
|
9031
9214
|
if (typeof name !== 'undefined') {
|
|
9032
9215
|
payload['name'] = name;
|
|
9033
9216
|
}
|
|
9217
|
+
if (typeof enabled !== 'undefined') {
|
|
9218
|
+
payload['enabled'] = enabled;
|
|
9219
|
+
}
|
|
9034
9220
|
if (typeof events !== 'undefined') {
|
|
9035
9221
|
payload['events'] = events;
|
|
9036
9222
|
}
|
|
@@ -9087,12 +9273,13 @@ class Projects extends Service {
|
|
|
9087
9273
|
* @param {string[]} events
|
|
9088
9274
|
* @param {string} url
|
|
9089
9275
|
* @param {boolean} security
|
|
9276
|
+
* @param {boolean} enabled
|
|
9090
9277
|
* @param {string} httpUser
|
|
9091
9278
|
* @param {string} httpPass
|
|
9092
9279
|
* @throws {AppwriteException}
|
|
9093
9280
|
* @returns {Promise}
|
|
9094
9281
|
*/
|
|
9095
|
-
updateWebhook(projectId, webhookId, name, events, url, security, httpUser, httpPass) {
|
|
9282
|
+
updateWebhook(projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass) {
|
|
9096
9283
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9097
9284
|
if (typeof projectId === 'undefined') {
|
|
9098
9285
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -9117,6 +9304,9 @@ class Projects extends Service {
|
|
|
9117
9304
|
if (typeof name !== 'undefined') {
|
|
9118
9305
|
payload['name'] = name;
|
|
9119
9306
|
}
|
|
9307
|
+
if (typeof enabled !== 'undefined') {
|
|
9308
|
+
payload['enabled'] = enabled;
|
|
9309
|
+
}
|
|
9120
9310
|
if (typeof events !== 'undefined') {
|
|
9121
9311
|
payload['events'] = events;
|
|
9122
9312
|
}
|
|
@@ -9894,7 +10084,7 @@ class Storage extends Service {
|
|
|
9894
10084
|
});
|
|
9895
10085
|
}
|
|
9896
10086
|
/**
|
|
9897
|
-
* Get usage stats for
|
|
10087
|
+
* Get usage stats for storage bucket
|
|
9898
10088
|
*
|
|
9899
10089
|
*
|
|
9900
10090
|
* @param {string} bucketId
|
|
@@ -10891,20 +11081,16 @@ class Users extends Service {
|
|
|
10891
11081
|
*
|
|
10892
11082
|
*
|
|
10893
11083
|
* @param {string} range
|
|
10894
|
-
* @param {string} provider
|
|
10895
11084
|
* @throws {AppwriteException}
|
|
10896
11085
|
* @returns {Promise}
|
|
10897
11086
|
*/
|
|
10898
|
-
getUsage(range
|
|
11087
|
+
getUsage(range) {
|
|
10899
11088
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10900
11089
|
const apiPath = '/users/usage';
|
|
10901
11090
|
const payload = {};
|
|
10902
11091
|
if (typeof range !== 'undefined') {
|
|
10903
11092
|
payload['range'] = range;
|
|
10904
11093
|
}
|
|
10905
|
-
if (typeof provider !== 'undefined') {
|
|
10906
|
-
payload['provider'] = provider;
|
|
10907
|
-
}
|
|
10908
11094
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10909
11095
|
return yield this.client.call('get', uri, {
|
|
10910
11096
|
'content-type': 'application/json',
|