@appwrite.io/console 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/sdk.js CHANGED
@@ -102,7 +102,7 @@ class Client {
102
102
  'x-sdk-name': 'Console',
103
103
  'x-sdk-platform': 'console',
104
104
  'x-sdk-language': 'web',
105
- 'x-sdk-version': '0.1.1',
105
+ 'x-sdk-version': '0.2.0',
106
106
  'X-Appwrite-Response-Format': '1.0.0',
107
107
  };
108
108
  this.realtime = {
@@ -544,6 +544,58 @@ class Account extends Service {
544
544
  }, payload);
545
545
  });
546
546
  }
547
+ /**
548
+ * Create account using an invite code
549
+ *
550
+ * Use this endpoint to allow a new user to register a new account in your
551
+ * project. After the user registration completes successfully, you can use
552
+ * the [/account/verfication](/docs/client/account#accountCreateVerification)
553
+ * route to start verifying the user email address. To allow the new user to
554
+ * login to their new account, you need to create a new [account
555
+ * session](/docs/client/account#accountCreateSession).
556
+ *
557
+ * @param {string} userId
558
+ * @param {string} email
559
+ * @param {string} password
560
+ * @param {string} name
561
+ * @param {string} code
562
+ * @throws {AppwriteException}
563
+ * @returns {Promise}
564
+ */
565
+ createWithInviteCode(userId, email, password, name, code) {
566
+ return __awaiter(this, void 0, void 0, function* () {
567
+ if (typeof userId === 'undefined') {
568
+ throw new AppwriteException('Missing required parameter: "userId"');
569
+ }
570
+ if (typeof email === 'undefined') {
571
+ throw new AppwriteException('Missing required parameter: "email"');
572
+ }
573
+ if (typeof password === 'undefined') {
574
+ throw new AppwriteException('Missing required parameter: "password"');
575
+ }
576
+ let path = '/account/invite';
577
+ let payload = {};
578
+ if (typeof userId !== 'undefined') {
579
+ payload['userId'] = userId;
580
+ }
581
+ if (typeof email !== 'undefined') {
582
+ payload['email'] = email;
583
+ }
584
+ if (typeof password !== 'undefined') {
585
+ payload['password'] = password;
586
+ }
587
+ if (typeof name !== 'undefined') {
588
+ payload['name'] = name;
589
+ }
590
+ if (typeof code !== 'undefined') {
591
+ payload['code'] = code;
592
+ }
593
+ const uri = new URL(this.client.config.endpoint + path);
594
+ return yield this.client.call('post', uri, {
595
+ 'content-type': 'application/json',
596
+ }, payload);
597
+ });
598
+ }
547
599
  /**
548
600
  * Create JWT
549
601
  *
@@ -4382,7 +4434,7 @@ class Health extends Service {
4382
4434
  /**
4383
4435
  * Get Cache
4384
4436
  *
4385
- * Check the Appwrite in-memory cache server is up and connection is
4437
+ * Check the Appwrite in-memory cache servers are up and connection is
4386
4438
  * successful.
4387
4439
  *
4388
4440
  * @throws {AppwriteException}
@@ -4401,7 +4453,7 @@ class Health extends Service {
4401
4453
  /**
4402
4454
  * Get DB
4403
4455
  *
4404
- * Check the Appwrite database server is up and connection is successful.
4456
+ * Check the Appwrite database servers are up and connection is successful.
4405
4457
  *
4406
4458
  * @throws {AppwriteException}
4407
4459
  * @returns {Promise}
@@ -4416,6 +4468,43 @@ class Health extends Service {
4416
4468
  }, payload);
4417
4469
  });
4418
4470
  }
4471
+ /**
4472
+ * Get PubSub
4473
+ *
4474
+ * Check the Appwrite pub-sub servers are up and connection is successful.
4475
+ *
4476
+ * @throws {AppwriteException}
4477
+ * @returns {Promise}
4478
+ */
4479
+ getPubSub() {
4480
+ return __awaiter(this, void 0, void 0, function* () {
4481
+ let path = '/health/pubsub';
4482
+ let payload = {};
4483
+ const uri = new URL(this.client.config.endpoint + path);
4484
+ return yield this.client.call('get', uri, {
4485
+ 'content-type': 'application/json',
4486
+ }, payload);
4487
+ });
4488
+ }
4489
+ /**
4490
+ * Get Queue
4491
+ *
4492
+ * Check the Appwrite queue messaging servers are up and connection is
4493
+ * successful.
4494
+ *
4495
+ * @throws {AppwriteException}
4496
+ * @returns {Promise}
4497
+ */
4498
+ getQueue() {
4499
+ return __awaiter(this, void 0, void 0, function* () {
4500
+ let path = '/health/queue';
4501
+ let payload = {};
4502
+ const uri = new URL(this.client.config.endpoint + path);
4503
+ return yield this.client.call('get', uri, {
4504
+ 'content-type': 'application/json',
4505
+ }, payload);
4506
+ });
4507
+ }
4419
4508
  /**
4420
4509
  * Get Certificates Queue
4421
4510
  *
@@ -4679,6 +4768,33 @@ class Locale extends Service {
4679
4768
  }
4680
4769
  }
4681
4770
 
4771
+ class Project extends Service {
4772
+ constructor(client) {
4773
+ super(client);
4774
+ }
4775
+ /**
4776
+ * Get usage stats for a project
4777
+ *
4778
+ *
4779
+ * @param {string} range
4780
+ * @throws {AppwriteException}
4781
+ * @returns {Promise}
4782
+ */
4783
+ getUsage(range) {
4784
+ return __awaiter(this, void 0, void 0, function* () {
4785
+ let path = '/project/usage';
4786
+ let payload = {};
4787
+ if (typeof range !== 'undefined') {
4788
+ payload['range'] = range;
4789
+ }
4790
+ const uri = new URL(this.client.config.endpoint + path);
4791
+ return yield this.client.call('get', uri, {
4792
+ 'content-type': 'application/json',
4793
+ }, payload);
4794
+ });
4795
+ }
4796
+ }
4797
+
4682
4798
  class Projects extends Service {
4683
4799
  constructor(client) {
4684
4800
  super(client);
@@ -5585,31 +5701,6 @@ class Projects extends Service {
5585
5701
  }, payload);
5586
5702
  });
5587
5703
  }
5588
- /**
5589
- * Get usage stats for a project
5590
- *
5591
- *
5592
- * @param {string} projectId
5593
- * @param {string} range
5594
- * @throws {AppwriteException}
5595
- * @returns {Promise}
5596
- */
5597
- getUsage(projectId, range) {
5598
- return __awaiter(this, void 0, void 0, function* () {
5599
- if (typeof projectId === 'undefined') {
5600
- throw new AppwriteException('Missing required parameter: "projectId"');
5601
- }
5602
- let path = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
5603
- let payload = {};
5604
- if (typeof range !== 'undefined') {
5605
- payload['range'] = range;
5606
- }
5607
- const uri = new URL(this.client.config.endpoint + path);
5608
- return yield this.client.call('get', uri, {
5609
- 'content-type': 'application/json',
5610
- }, payload);
5611
- });
5612
- }
5613
5704
  /**
5614
5705
  * List Webhooks
5615
5706
  *
@@ -6397,7 +6488,7 @@ class Storage extends Service {
6397
6488
  });
6398
6489
  }
6399
6490
  /**
6400
- * Get usage stats for a storage bucket
6491
+ * Get usage stats for storage bucket
6401
6492
  *
6402
6493
  *
6403
6494
  * @param {string} bucketId
@@ -7347,20 +7438,16 @@ class Users extends Service {
7347
7438
  *
7348
7439
  *
7349
7440
  * @param {string} range
7350
- * @param {string} provider
7351
7441
  * @throws {AppwriteException}
7352
7442
  * @returns {Promise}
7353
7443
  */
7354
- getUsage(range, provider) {
7444
+ getUsage(range) {
7355
7445
  return __awaiter(this, void 0, void 0, function* () {
7356
7446
  let path = '/users/usage';
7357
7447
  let payload = {};
7358
7448
  if (typeof range !== 'undefined') {
7359
7449
  payload['range'] = range;
7360
7450
  }
7361
- if (typeof provider !== 'undefined') {
7362
- payload['provider'] = provider;
7363
- }
7364
7451
  const uri = new URL(this.client.config.endpoint + path);
7365
7452
  return yield this.client.call('get', uri, {
7366
7453
  'content-type': 'application/json',
@@ -7849,5 +7936,5 @@ class ID {
7849
7936
  }
7850
7937
  }
7851
7938
 
7852
- export { Account, AppwriteException, Avatars, Client, Console, Databases, Functions, Graphql, Health, ID, Locale, Permission, Projects, Query, Role, Storage, Teams, Users };
7939
+ export { Account, AppwriteException, Avatars, Client, Console, Databases, Functions, Graphql, Health, ID, Locale, Permission, Project, Projects, Query, Role, Storage, Teams, Users };
7853
7940
  //# sourceMappingURL=sdk.js.map