@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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +241 -55
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +241 -55
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +241 -55
  7. package/docs/examples/account/create-email-token.md +18 -0
  8. package/docs/examples/account/create-push-target.md +18 -0
  9. package/docs/examples/account/delete.md +18 -0
  10. package/docs/examples/account/update-push-target.md +1 -0
  11. package/docs/examples/messaging/{create-apns-provider.md → create-a-p-n-s-provider.md} +1 -1
  12. package/docs/examples/messaging/create-email.md +18 -0
  13. package/docs/examples/messaging/{create-fcm-provider.md → create-f-c-m-provider.md} +1 -1
  14. package/docs/examples/messaging/create-push.md +18 -0
  15. package/docs/examples/messaging/{create-s-m-s-message.md → create-s-m-s.md} +1 -1
  16. package/docs/examples/messaging/{update-fcm-provider.md → list-targets.md} +1 -1
  17. package/docs/examples/messaging/{update-apns-provider.md → update-a-p-n-s-provider.md} +1 -1
  18. package/docs/examples/messaging/update-f-c-m-provider.md +18 -0
  19. package/docs/examples/project/get-usage.md +1 -1
  20. package/docs/examples/projects/{update-smtp-configuration.md → create-smtp-test.md} +1 -1
  21. package/docs/examples/projects/create-webhook.md +1 -1
  22. package/docs/examples/projects/{get-usage.md → update-smtp.md} +1 -1
  23. package/docs/examples/projects/update-webhook.md +1 -1
  24. package/package.json +1 -1
  25. package/src/client.ts +1 -1
  26. package/src/models.ts +208 -182
  27. package/src/services/account.ts +115 -8
  28. package/src/services/functions.ts +1 -1
  29. package/src/services/messaging.ts +36 -7
  30. package/src/services/project.ts +22 -4
  31. package/src/services/projects.ts +97 -31
  32. package/src/services/storage.ts +1 -1
  33. package/src/services/users.ts +1 -6
  34. package/types/models.d.ts +208 -182
  35. package/types/services/account.d.ts +48 -8
  36. package/types/services/functions.d.ts +1 -1
  37. package/types/services/messaging.d.ts +19 -7
  38. package/types/services/project.d.ts +4 -2
  39. package/types/services/projects.d.ts +24 -14
  40. package/types/services/storage.d.ts +1 -1
  41. package/types/services/users.d.ts +1 -2
  42. package/docs/examples/messaging/create-email-message.md +0 -18
  43. package/docs/examples/messaging/create-push-message.md +0 -18
package/dist/iife/sdk.js CHANGED
@@ -102,7 +102,7 @@
102
102
  'x-sdk-name': 'Console',
103
103
  'x-sdk-platform': 'console',
104
104
  'x-sdk-language': 'web',
105
- 'x-sdk-version': '0.6.0-rc.7',
105
+ 'x-sdk-version': '0.6.0-rc.8',
106
106
  'X-Appwrite-Response-Format': '1.4.0',
107
107
  };
108
108
  this.realtime = {
@@ -506,6 +506,24 @@
506
506
  }, payload);
507
507
  });
508
508
  }
509
+ /**
510
+ * Delete account
511
+ *
512
+ * Delete the currently logged in user.
513
+ *
514
+ * @throws {AppwriteException}
515
+ * @returns {Promise}
516
+ */
517
+ delete() {
518
+ return __awaiter(this, void 0, void 0, function* () {
519
+ const apiPath = '/account';
520
+ const payload = {};
521
+ const uri = new URL(this.client.config.endpoint + apiPath);
522
+ return yield this.client.call('delete', uri, {
523
+ 'content-type': 'application/json',
524
+ }, payload);
525
+ });
526
+ }
509
527
  /**
510
528
  * Update email
511
529
  *
@@ -1281,11 +1299,10 @@
1281
1299
  });
1282
1300
  }
1283
1301
  /**
1284
- * Update OAuth session (refresh tokens)
1302
+ * Update (or renew) a session
1285
1303
  *
1286
- * Access tokens have limited lifespan and expire to mitigate security risks.
1287
- * If session was created using an OAuth provider, this route can be used to
1288
- * "refresh" the access token.
1304
+ * Extend session's expiry to increase it's lifespan. Extending a session is
1305
+ * useful when session length is short such as 5 minutes.
1289
1306
  *
1290
1307
  * @param {string} sessionId
1291
1308
  * @throws {AppwriteException}
@@ -1350,6 +1367,41 @@
1350
1367
  }, payload);
1351
1368
  });
1352
1369
  }
1370
+ /**
1371
+ * Create Account's push target
1372
+ *
1373
+ *
1374
+ * @param {string} targetId
1375
+ * @param {string} identifier
1376
+ * @param {string} providerId
1377
+ * @throws {AppwriteException}
1378
+ * @returns {Promise}
1379
+ */
1380
+ createPushTarget(targetId, identifier, providerId) {
1381
+ return __awaiter(this, void 0, void 0, function* () {
1382
+ if (typeof targetId === 'undefined') {
1383
+ throw new AppwriteException('Missing required parameter: "targetId"');
1384
+ }
1385
+ if (typeof identifier === 'undefined') {
1386
+ throw new AppwriteException('Missing required parameter: "identifier"');
1387
+ }
1388
+ const apiPath = '/account/targets/push';
1389
+ const payload = {};
1390
+ if (typeof targetId !== 'undefined') {
1391
+ payload['targetId'] = targetId;
1392
+ }
1393
+ if (typeof identifier !== 'undefined') {
1394
+ payload['identifier'] = identifier;
1395
+ }
1396
+ if (typeof providerId !== 'undefined') {
1397
+ payload['providerId'] = providerId;
1398
+ }
1399
+ const uri = new URL(this.client.config.endpoint + apiPath);
1400
+ return yield this.client.call('post', uri, {
1401
+ 'content-type': 'application/json',
1402
+ }, payload);
1403
+ });
1404
+ }
1353
1405
  /**
1354
1406
  * Update Account's push target
1355
1407
  *
@@ -1378,6 +1430,51 @@
1378
1430
  }, payload);
1379
1431
  });
1380
1432
  }
1433
+ /**
1434
+ * Create email token (OTP)
1435
+ *
1436
+ * Sends the user an email with a secret key for creating a session. If the
1437
+ * provided user ID has not be registered, a new user will be created. Use the
1438
+ * returned user ID and secret and submit a request to the [POST
1439
+ * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
1440
+ * endpoint to complete the login process. The secret sent to the user's email
1441
+ * is valid for 15 minutes.
1442
+ *
1443
+ * A user is limited to 10 active sessions at a time by default. [Learn more
1444
+ * about session
1445
+ * limits](https://appwrite.io/docs/authentication-security#limits).
1446
+ *
1447
+ * @param {string} userId
1448
+ * @param {string} email
1449
+ * @param {boolean} securityPhrase
1450
+ * @throws {AppwriteException}
1451
+ * @returns {Promise}
1452
+ */
1453
+ createEmailToken(userId, email, securityPhrase) {
1454
+ return __awaiter(this, void 0, void 0, function* () {
1455
+ if (typeof userId === 'undefined') {
1456
+ throw new AppwriteException('Missing required parameter: "userId"');
1457
+ }
1458
+ if (typeof email === 'undefined') {
1459
+ throw new AppwriteException('Missing required parameter: "email"');
1460
+ }
1461
+ const apiPath = '/account/tokens/email';
1462
+ const payload = {};
1463
+ if (typeof userId !== 'undefined') {
1464
+ payload['userId'] = userId;
1465
+ }
1466
+ if (typeof email !== 'undefined') {
1467
+ payload['email'] = email;
1468
+ }
1469
+ if (typeof securityPhrase !== 'undefined') {
1470
+ payload['securityPhrase'] = securityPhrase;
1471
+ }
1472
+ const uri = new URL(this.client.config.endpoint + apiPath);
1473
+ return yield this.client.call('post', uri, {
1474
+ 'content-type': 'application/json',
1475
+ }, payload);
1476
+ });
1477
+ }
1381
1478
  /**
1382
1479
  * Create magic URL token
1383
1480
  *
@@ -1386,8 +1483,8 @@
1386
1483
  * the user clicks the link in the email, the user is redirected back to the
1387
1484
  * URL you provided with the secret key and userId values attached to the URL
1388
1485
  * query string. Use the query string parameters to submit a request to the
1389
- * [PUT
1390
- * /account/sessions/magic-url](https://appwrite.io/docs/references/cloud/client-web/account#updateMagicURLSession)
1486
+ * [POST
1487
+ * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
1391
1488
  * endpoint to complete the login process. The link sent to the user's email
1392
1489
  * address is valid for 1 hour. If you are on a mobile device you can leave
1393
1490
  * the URL parameter empty, so that the login completion will be handled by
@@ -1438,8 +1535,8 @@
1438
1535
  *
1439
1536
  * Sends the user an SMS with a secret key for creating a session. If the
1440
1537
  * provided user ID has not be registered, a new user will be created. Use the
1441
- * returned user ID and secret and submit a request to the [PUT
1442
- * /account/sessions/phone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneSession)
1538
+ * returned user ID and secret and submit a request to the [POST
1539
+ * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
1443
1540
  * endpoint to complete the login process. The secret sent to the user's phone
1444
1541
  * is valid for 15 minutes.
1445
1542
  *
@@ -5366,7 +5463,7 @@
5366
5463
  * @throws {AppwriteException}
5367
5464
  * @returns {Promise}
5368
5465
  */
5369
- createEmailMessage(messageId, subject, content, topics, users, targets, cc, bcc, description, status, html, scheduledAt) {
5466
+ createEmail(messageId, subject, content, topics, users, targets, cc, bcc, description, status, html, scheduledAt) {
5370
5467
  return __awaiter(this, void 0, void 0, function* () {
5371
5468
  if (typeof messageId === 'undefined') {
5372
5469
  throw new AppwriteException('Missing required parameter: "messageId"');
@@ -5509,7 +5606,7 @@
5509
5606
  * @throws {AppwriteException}
5510
5607
  * @returns {Promise}
5511
5608
  */
5512
- createPushMessage(messageId, title, body, topics, users, targets, description, data, action, icon, sound, color, tag, badge, status, scheduledAt) {
5609
+ createPush(messageId, title, body, topics, users, targets, description, data, action, icon, sound, color, tag, badge, status, scheduledAt) {
5513
5610
  return __awaiter(this, void 0, void 0, function* () {
5514
5611
  if (typeof messageId === 'undefined') {
5515
5612
  throw new AppwriteException('Missing required parameter: "messageId"');
@@ -5672,7 +5769,7 @@
5672
5769
  * @throws {AppwriteException}
5673
5770
  * @returns {Promise}
5674
5771
  */
5675
- createSMSMessage(messageId, content, topics, users, targets, description, status, scheduledAt) {
5772
+ createSMS(messageId, content, topics, users, targets, description, status, scheduledAt) {
5676
5773
  return __awaiter(this, void 0, void 0, function* () {
5677
5774
  if (typeof messageId === 'undefined') {
5678
5775
  throw new AppwriteException('Missing required parameter: "messageId"');
@@ -5807,6 +5904,33 @@
5807
5904
  }, payload);
5808
5905
  });
5809
5906
  }
5907
+ /**
5908
+ * List message targets
5909
+ *
5910
+ * List the targets associated with a message as set via the targets
5911
+ * attribute.
5912
+ *
5913
+ * @param {string} messageId
5914
+ * @param {string} queries
5915
+ * @throws {AppwriteException}
5916
+ * @returns {Promise}
5917
+ */
5918
+ listTargets(messageId, queries) {
5919
+ return __awaiter(this, void 0, void 0, function* () {
5920
+ if (typeof messageId === 'undefined') {
5921
+ throw new AppwriteException('Missing required parameter: "messageId"');
5922
+ }
5923
+ const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
5924
+ const payload = {};
5925
+ if (typeof queries !== 'undefined') {
5926
+ payload['queries'] = queries;
5927
+ }
5928
+ const uri = new URL(this.client.config.endpoint + apiPath);
5929
+ return yield this.client.call('get', uri, {
5930
+ 'content-type': 'application/json',
5931
+ }, payload);
5932
+ });
5933
+ }
5810
5934
  /**
5811
5935
  * List providers
5812
5936
  *
@@ -5846,7 +5970,7 @@
5846
5970
  * @throws {AppwriteException}
5847
5971
  * @returns {Promise}
5848
5972
  */
5849
- createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId, enabled) {
5973
+ createAPNSProvider(providerId, name, authKey, authKeyId, teamId, bundleId, enabled) {
5850
5974
  return __awaiter(this, void 0, void 0, function* () {
5851
5975
  if (typeof providerId === 'undefined') {
5852
5976
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -5897,7 +6021,7 @@
5897
6021
  * @throws {AppwriteException}
5898
6022
  * @returns {Promise}
5899
6023
  */
5900
- updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId) {
6024
+ updateAPNSProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId) {
5901
6025
  return __awaiter(this, void 0, void 0, function* () {
5902
6026
  if (typeof providerId === 'undefined') {
5903
6027
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -5939,7 +6063,7 @@
5939
6063
  * @throws {AppwriteException}
5940
6064
  * @returns {Promise}
5941
6065
  */
5942
- createFcmProvider(providerId, name, serviceAccountJSON, enabled) {
6066
+ createFCMProvider(providerId, name, serviceAccountJSON, enabled) {
5943
6067
  return __awaiter(this, void 0, void 0, function* () {
5944
6068
  if (typeof providerId === 'undefined') {
5945
6069
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -5978,7 +6102,7 @@
5978
6102
  * @throws {AppwriteException}
5979
6103
  * @returns {Promise}
5980
6104
  */
5981
- updateFcmProvider(providerId, name, enabled, serviceAccountJSON) {
6105
+ updateFCMProvider(providerId, name, enabled, serviceAccountJSON) {
5982
6106
  return __awaiter(this, void 0, void 0, function* () {
5983
6107
  if (typeof providerId === 'undefined') {
5984
6108
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -7644,16 +7768,30 @@
7644
7768
  * Get usage stats for a project
7645
7769
  *
7646
7770
  *
7647
- * @param {string} range
7771
+ * @param {string} startDate
7772
+ * @param {string} endDate
7773
+ * @param {string} period
7648
7774
  * @throws {AppwriteException}
7649
7775
  * @returns {Promise}
7650
7776
  */
7651
- getUsage(range) {
7777
+ getUsage(startDate, endDate, period) {
7652
7778
  return __awaiter(this, void 0, void 0, function* () {
7779
+ if (typeof startDate === 'undefined') {
7780
+ throw new AppwriteException('Missing required parameter: "startDate"');
7781
+ }
7782
+ if (typeof endDate === 'undefined') {
7783
+ throw new AppwriteException('Missing required parameter: "endDate"');
7784
+ }
7653
7785
  const apiPath = '/project/usage';
7654
7786
  const payload = {};
7655
- if (typeof range !== 'undefined') {
7656
- payload['range'] = range;
7787
+ if (typeof startDate !== 'undefined') {
7788
+ payload['startDate'] = startDate;
7789
+ }
7790
+ if (typeof endDate !== 'undefined') {
7791
+ payload['endDate'] = endDate;
7792
+ }
7793
+ if (typeof period !== 'undefined') {
7794
+ payload['period'] = period;
7657
7795
  }
7658
7796
  const uri = new URL(this.client.config.endpoint + apiPath);
7659
7797
  return yield this.client.call('get', uri, {
@@ -8653,7 +8791,7 @@
8653
8791
  });
8654
8792
  }
8655
8793
  /**
8656
- * Update SMTP configuration
8794
+ * Update SMTP
8657
8795
  *
8658
8796
  *
8659
8797
  * @param {string} projectId
@@ -8669,7 +8807,7 @@
8669
8807
  * @throws {AppwriteException}
8670
8808
  * @returns {Promise}
8671
8809
  */
8672
- updateSmtpConfiguration(projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure) {
8810
+ updateSmtp(projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure) {
8673
8811
  return __awaiter(this, void 0, void 0, function* () {
8674
8812
  if (typeof projectId === 'undefined') {
8675
8813
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -8712,6 +8850,75 @@
8712
8850
  }, payload);
8713
8851
  });
8714
8852
  }
8853
+ /**
8854
+ * Create SMTP test
8855
+ *
8856
+ *
8857
+ * @param {string} projectId
8858
+ * @param {string[]} emails
8859
+ * @param {string} senderName
8860
+ * @param {string} senderEmail
8861
+ * @param {string} host
8862
+ * @param {string} replyTo
8863
+ * @param {number} port
8864
+ * @param {string} username
8865
+ * @param {string} password
8866
+ * @param {string} secure
8867
+ * @throws {AppwriteException}
8868
+ * @returns {Promise}
8869
+ */
8870
+ createSmtpTest(projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure) {
8871
+ return __awaiter(this, void 0, void 0, function* () {
8872
+ if (typeof projectId === 'undefined') {
8873
+ throw new AppwriteException('Missing required parameter: "projectId"');
8874
+ }
8875
+ if (typeof emails === 'undefined') {
8876
+ throw new AppwriteException('Missing required parameter: "emails"');
8877
+ }
8878
+ if (typeof senderName === 'undefined') {
8879
+ throw new AppwriteException('Missing required parameter: "senderName"');
8880
+ }
8881
+ if (typeof senderEmail === 'undefined') {
8882
+ throw new AppwriteException('Missing required parameter: "senderEmail"');
8883
+ }
8884
+ if (typeof host === 'undefined') {
8885
+ throw new AppwriteException('Missing required parameter: "host"');
8886
+ }
8887
+ const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
8888
+ const payload = {};
8889
+ if (typeof emails !== 'undefined') {
8890
+ payload['emails'] = emails;
8891
+ }
8892
+ if (typeof senderName !== 'undefined') {
8893
+ payload['senderName'] = senderName;
8894
+ }
8895
+ if (typeof senderEmail !== 'undefined') {
8896
+ payload['senderEmail'] = senderEmail;
8897
+ }
8898
+ if (typeof replyTo !== 'undefined') {
8899
+ payload['replyTo'] = replyTo;
8900
+ }
8901
+ if (typeof host !== 'undefined') {
8902
+ payload['host'] = host;
8903
+ }
8904
+ if (typeof port !== 'undefined') {
8905
+ payload['port'] = port;
8906
+ }
8907
+ if (typeof username !== 'undefined') {
8908
+ payload['username'] = username;
8909
+ }
8910
+ if (typeof password !== 'undefined') {
8911
+ payload['password'] = password;
8912
+ }
8913
+ if (typeof secure !== 'undefined') {
8914
+ payload['secure'] = secure;
8915
+ }
8916
+ const uri = new URL(this.client.config.endpoint + apiPath);
8917
+ return yield this.client.call('post', uri, {
8918
+ 'content-type': 'application/json',
8919
+ }, payload);
8920
+ });
8921
+ }
8715
8922
  /**
8716
8923
  * Update Project Team
8717
8924
  *
@@ -8947,31 +9154,6 @@
8947
9154
  }, payload);
8948
9155
  });
8949
9156
  }
8950
- /**
8951
- * Get usage stats for a project
8952
- *
8953
- *
8954
- * @param {string} projectId
8955
- * @param {string} range
8956
- * @throws {AppwriteException}
8957
- * @returns {Promise}
8958
- */
8959
- getUsage(projectId, range) {
8960
- return __awaiter(this, void 0, void 0, function* () {
8961
- if (typeof projectId === 'undefined') {
8962
- throw new AppwriteException('Missing required parameter: "projectId"');
8963
- }
8964
- const apiPath = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
8965
- const payload = {};
8966
- if (typeof range !== 'undefined') {
8967
- payload['range'] = range;
8968
- }
8969
- const uri = new URL(this.client.config.endpoint + apiPath);
8970
- return yield this.client.call('get', uri, {
8971
- 'content-type': 'application/json',
8972
- }, payload);
8973
- });
8974
- }
8975
9157
  /**
8976
9158
  * List webhooks
8977
9159
  *
@@ -9002,12 +9184,13 @@
9002
9184
  * @param {string[]} events
9003
9185
  * @param {string} url
9004
9186
  * @param {boolean} security
9187
+ * @param {boolean} enabled
9005
9188
  * @param {string} httpUser
9006
9189
  * @param {string} httpPass
9007
9190
  * @throws {AppwriteException}
9008
9191
  * @returns {Promise}
9009
9192
  */
9010
- createWebhook(projectId, name, events, url, security, httpUser, httpPass) {
9193
+ createWebhook(projectId, name, events, url, security, enabled, httpUser, httpPass) {
9011
9194
  return __awaiter(this, void 0, void 0, function* () {
9012
9195
  if (typeof projectId === 'undefined') {
9013
9196
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -9029,6 +9212,9 @@
9029
9212
  if (typeof name !== 'undefined') {
9030
9213
  payload['name'] = name;
9031
9214
  }
9215
+ if (typeof enabled !== 'undefined') {
9216
+ payload['enabled'] = enabled;
9217
+ }
9032
9218
  if (typeof events !== 'undefined') {
9033
9219
  payload['events'] = events;
9034
9220
  }
@@ -9085,12 +9271,13 @@
9085
9271
  * @param {string[]} events
9086
9272
  * @param {string} url
9087
9273
  * @param {boolean} security
9274
+ * @param {boolean} enabled
9088
9275
  * @param {string} httpUser
9089
9276
  * @param {string} httpPass
9090
9277
  * @throws {AppwriteException}
9091
9278
  * @returns {Promise}
9092
9279
  */
9093
- updateWebhook(projectId, webhookId, name, events, url, security, httpUser, httpPass) {
9280
+ updateWebhook(projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass) {
9094
9281
  return __awaiter(this, void 0, void 0, function* () {
9095
9282
  if (typeof projectId === 'undefined') {
9096
9283
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -9115,6 +9302,9 @@
9115
9302
  if (typeof name !== 'undefined') {
9116
9303
  payload['name'] = name;
9117
9304
  }
9305
+ if (typeof enabled !== 'undefined') {
9306
+ payload['enabled'] = enabled;
9307
+ }
9118
9308
  if (typeof events !== 'undefined') {
9119
9309
  payload['events'] = events;
9120
9310
  }
@@ -9892,7 +10082,7 @@
9892
10082
  });
9893
10083
  }
9894
10084
  /**
9895
- * Get usage stats for a storage bucket
10085
+ * Get usage stats for storage bucket
9896
10086
  *
9897
10087
  *
9898
10088
  * @param {string} bucketId
@@ -10889,20 +11079,16 @@
10889
11079
  *
10890
11080
  *
10891
11081
  * @param {string} range
10892
- * @param {string} provider
10893
11082
  * @throws {AppwriteException}
10894
11083
  * @returns {Promise}
10895
11084
  */
10896
- getUsage(range, provider) {
11085
+ getUsage(range) {
10897
11086
  return __awaiter(this, void 0, void 0, function* () {
10898
11087
  const apiPath = '/users/usage';
10899
11088
  const payload = {};
10900
11089
  if (typeof range !== 'undefined') {
10901
11090
  payload['range'] = range;
10902
11091
  }
10903
- if (typeof provider !== 'undefined') {
10904
- payload['provider'] = provider;
10905
- }
10906
11092
  const uri = new URL(this.client.config.endpoint + apiPath);
10907
11093
  return yield this.client.call('get', uri, {
10908
11094
  'content-type': 'application/json',
@@ -0,0 +1,18 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const account = new Account(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = account.createEmailToken('[USER_ID]', 'email@example.com');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const account = new Account(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = account.createPushTarget('[TARGET_ID]', '[IDENTIFIER]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -0,0 +1,18 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const account = new Account(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = account.delete();
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -6,6 +6,7 @@ const account = new Account(client);
6
6
 
7
7
  client
8
8
  .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
9
10
  ;
10
11
 
11
12
  const promise = account.updatePushTarget('[TARGET_ID]', '[IDENTIFIER]');
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = messaging.createApnsProvider('[PROVIDER_ID]', '[NAME]');
12
+ const promise = messaging.createAPNSProvider('[PROVIDER_ID]', '[NAME]');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.createEmail('[MESSAGE_ID]', '[SUBJECT]', '[CONTENT]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = messaging.createFcmProvider('[PROVIDER_ID]', '[NAME]');
12
+ const promise = messaging.createFCMProvider('[PROVIDER_ID]', '[NAME]');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.createPush('[MESSAGE_ID]', '[TITLE]', '[BODY]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = messaging.createSMSMessage('[MESSAGE_ID]', '[CONTENT]');
12
+ const promise = messaging.createSMS('[MESSAGE_ID]', '[CONTENT]');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = messaging.updateFcmProvider('[PROVIDER_ID]');
12
+ const promise = messaging.listTargets('[MESSAGE_ID]');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = messaging.updateApnsProvider('[PROVIDER_ID]');
12
+ const promise = messaging.updateAPNSProvider('[PROVIDER_ID]');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
@@ -0,0 +1,18 @@
1
+ import { Client, Messaging } from "@appwrite.io/console";
2
+
3
+ const client = new Client();
4
+
5
+ const messaging = new Messaging(client);
6
+
7
+ client
8
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9
+ .setProject('5df5acd0d48c2') // Your project ID
10
+ ;
11
+
12
+ const promise = messaging.updateFCMProvider('[PROVIDER_ID]');
13
+
14
+ promise.then(function (response) {
15
+ console.log(response); // Success
16
+ }, function (error) {
17
+ console.log(error); // Failure
18
+ });