@appwrite.io/console 1.3.2 → 1.4.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/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@1.3.2"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@1.4.0"></script>
37
37
  ```
38
38
 
39
39
 
package/dist/cjs/sdk.js CHANGED
@@ -280,7 +280,7 @@ class Client {
280
280
  'x-sdk-name': 'Console',
281
281
  'x-sdk-platform': 'console',
282
282
  'x-sdk-language': 'web',
283
- 'x-sdk-version': '1.3.2',
283
+ 'x-sdk-version': '1.4.0',
284
284
  'X-Appwrite-Response-Format': '1.6.0',
285
285
  };
286
286
  this.realtime = {
@@ -793,7 +793,7 @@ class Account {
793
793
  *
794
794
  * @param {string[]} queries
795
795
  * @throws {AppwriteException}
796
- * @returns {Promise<Models.BillingAddress>}
796
+ * @returns {Promise<Models.BillingAddressList>}
797
797
  */
798
798
  listBillingAddresses(queries) {
799
799
  return __awaiter(this, void 0, void 0, function* () {
@@ -809,6 +809,60 @@ class Account {
809
809
  return yield this.client.call('get', uri, apiHeaders, payload);
810
810
  });
811
811
  }
812
+ /**
813
+ * Create new billing address
814
+ *
815
+ *
816
+ * @param {string} country
817
+ * @param {string} streetAddress
818
+ * @param {string} city
819
+ * @param {string} state
820
+ * @param {string} postalCode
821
+ * @param {string} addressLine2
822
+ * @throws {AppwriteException}
823
+ * @returns {Promise<{}>}
824
+ */
825
+ createBillingAddress(country, streetAddress, city, state, postalCode, addressLine2) {
826
+ return __awaiter(this, void 0, void 0, function* () {
827
+ if (typeof country === 'undefined') {
828
+ throw new AppwriteException('Missing required parameter: "country"');
829
+ }
830
+ if (typeof streetAddress === 'undefined') {
831
+ throw new AppwriteException('Missing required parameter: "streetAddress"');
832
+ }
833
+ if (typeof city === 'undefined') {
834
+ throw new AppwriteException('Missing required parameter: "city"');
835
+ }
836
+ if (typeof state === 'undefined') {
837
+ throw new AppwriteException('Missing required parameter: "state"');
838
+ }
839
+ const apiPath = '/account/billing-addresses';
840
+ const payload = {};
841
+ if (typeof country !== 'undefined') {
842
+ payload['country'] = country;
843
+ }
844
+ if (typeof streetAddress !== 'undefined') {
845
+ payload['streetAddress'] = streetAddress;
846
+ }
847
+ if (typeof city !== 'undefined') {
848
+ payload['city'] = city;
849
+ }
850
+ if (typeof state !== 'undefined') {
851
+ payload['state'] = state;
852
+ }
853
+ if (typeof postalCode !== 'undefined') {
854
+ payload['postalCode'] = postalCode;
855
+ }
856
+ if (typeof addressLine2 !== 'undefined') {
857
+ payload['addressLine2'] = addressLine2;
858
+ }
859
+ const uri = new URL(this.client.config.endpoint + apiPath);
860
+ const apiHeaders = {
861
+ 'content-type': 'application/json',
862
+ };
863
+ return yield this.client.call('post', uri, apiHeaders, payload);
864
+ });
865
+ }
812
866
  /**
813
867
  * Get billing address
814
868
  *
@@ -831,6 +885,86 @@ class Account {
831
885
  return yield this.client.call('get', uri, apiHeaders, payload);
832
886
  });
833
887
  }
888
+ /**
889
+ * Update billing address
890
+ *
891
+ *
892
+ * @param {string} billingAddressId
893
+ * @param {string} country
894
+ * @param {string} streetAddress
895
+ * @param {string} city
896
+ * @param {string} state
897
+ * @param {string} postalCode
898
+ * @param {string} addressLine2
899
+ * @throws {AppwriteException}
900
+ * @returns {Promise<{}>}
901
+ */
902
+ updateBillingAddress(billingAddressId, country, streetAddress, city, state, postalCode, addressLine2) {
903
+ return __awaiter(this, void 0, void 0, function* () {
904
+ if (typeof billingAddressId === 'undefined') {
905
+ throw new AppwriteException('Missing required parameter: "billingAddressId"');
906
+ }
907
+ if (typeof country === 'undefined') {
908
+ throw new AppwriteException('Missing required parameter: "country"');
909
+ }
910
+ if (typeof streetAddress === 'undefined') {
911
+ throw new AppwriteException('Missing required parameter: "streetAddress"');
912
+ }
913
+ if (typeof city === 'undefined') {
914
+ throw new AppwriteException('Missing required parameter: "city"');
915
+ }
916
+ if (typeof state === 'undefined') {
917
+ throw new AppwriteException('Missing required parameter: "state"');
918
+ }
919
+ const apiPath = '/account/billing-addresses/{billingAddressId}'.replace('{billingAddressId}', billingAddressId);
920
+ const payload = {};
921
+ if (typeof country !== 'undefined') {
922
+ payload['country'] = country;
923
+ }
924
+ if (typeof streetAddress !== 'undefined') {
925
+ payload['streetAddress'] = streetAddress;
926
+ }
927
+ if (typeof city !== 'undefined') {
928
+ payload['city'] = city;
929
+ }
930
+ if (typeof state !== 'undefined') {
931
+ payload['state'] = state;
932
+ }
933
+ if (typeof postalCode !== 'undefined') {
934
+ payload['postalCode'] = postalCode;
935
+ }
936
+ if (typeof addressLine2 !== 'undefined') {
937
+ payload['addressLine2'] = addressLine2;
938
+ }
939
+ const uri = new URL(this.client.config.endpoint + apiPath);
940
+ const apiHeaders = {
941
+ 'content-type': 'application/json',
942
+ };
943
+ return yield this.client.call('put', uri, apiHeaders, payload);
944
+ });
945
+ }
946
+ /**
947
+ * Delete billing address
948
+ *
949
+ *
950
+ * @param {string} billingAddressId
951
+ * @throws {AppwriteException}
952
+ * @returns {Promise<{}>}
953
+ */
954
+ deleteBillingAddress(billingAddressId) {
955
+ return __awaiter(this, void 0, void 0, function* () {
956
+ if (typeof billingAddressId === 'undefined') {
957
+ throw new AppwriteException('Missing required parameter: "billingAddressId"');
958
+ }
959
+ const apiPath = '/account/billing-addresses/{billingAddressId}'.replace('{billingAddressId}', billingAddressId);
960
+ const payload = {};
961
+ const uri = new URL(this.client.config.endpoint + apiPath);
962
+ const apiHeaders = {
963
+ 'content-type': 'application/json',
964
+ };
965
+ return yield this.client.call('delete', uri, apiHeaders, payload);
966
+ });
967
+ }
834
968
  /**
835
969
  * Update email
836
970
  *
@@ -2291,32 +2425,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
2291
2425
  return yield this.client.call('put', uri, apiHeaders, payload);
2292
2426
  });
2293
2427
  }
2294
- /**
2295
- * List credits
2296
- *
2297
- *
2298
- * @param {string} organizationId
2299
- * @param {string[]} queries
2300
- * @throws {AppwriteException}
2301
- * @returns {Promise<Models.CreditList>}
2302
- */
2303
- listCredits(organizationId, queries) {
2304
- return __awaiter(this, void 0, void 0, function* () {
2305
- if (typeof organizationId === 'undefined') {
2306
- throw new AppwriteException('Missing required parameter: "organizationId"');
2307
- }
2308
- const apiPath = '/organizations/{organizationId}/credits'.replace('{organizationId}', organizationId);
2309
- const payload = {};
2310
- if (typeof queries !== 'undefined') {
2311
- payload['queries'] = queries;
2312
- }
2313
- const uri = new URL(this.client.config.endpoint + apiPath);
2314
- const apiHeaders = {
2315
- 'content-type': 'application/json',
2316
- };
2317
- return yield this.client.call('get', uri, apiHeaders, payload);
2318
- });
2319
- }
2320
2428
  }
2321
2429
 
2322
2430
  class Avatars {
@@ -3016,7 +3124,7 @@ class Console {
3016
3124
  * @throws {AppwriteException}
3017
3125
  * @returns {Promise<Models.Coupon>}
3018
3126
  */
3019
- getCopon(couponId) {
3127
+ getCoupon(couponId) {
3020
3128
  return __awaiter(this, void 0, void 0, function* () {
3021
3129
  if (typeof couponId === 'undefined') {
3022
3130
  throw new AppwriteException('Missing required parameter: "couponId"');
@@ -9500,7 +9608,7 @@ class Organizations {
9500
9608
  * @param {string[]} queries
9501
9609
  * @param {string} search
9502
9610
  * @throws {AppwriteException}
9503
- * @returns {Promise<Models.TeamList<Preferences>>}
9611
+ * @returns {Promise<Models.OrganizationList<Preferences>>}
9504
9612
  */
9505
9613
  list(queries, search) {
9506
9614
  return __awaiter(this, void 0, void 0, function* () {
@@ -9623,7 +9731,7 @@ class Organizations {
9623
9731
  * @param {string} organizationId
9624
9732
  * @param {string} aggregationId
9625
9733
  * @throws {AppwriteException}
9626
- * @returns {Promise<Models.Invoice>}
9734
+ * @returns {Promise<Models.AggregationTeam>}
9627
9735
  */
9628
9736
  getAggregation(organizationId, aggregationId) {
9629
9737
  return __awaiter(this, void 0, void 0, function* () {
@@ -9781,6 +9889,32 @@ class Organizations {
9781
9889
  return yield this.client.call('patch', uri, apiHeaders, payload);
9782
9890
  });
9783
9891
  }
9892
+ /**
9893
+ * List credits
9894
+ *
9895
+ *
9896
+ * @param {string} organizationId
9897
+ * @param {string[]} queries
9898
+ * @throws {AppwriteException}
9899
+ * @returns {Promise<Models.CreditList>}
9900
+ */
9901
+ listCredits(organizationId, queries) {
9902
+ return __awaiter(this, void 0, void 0, function* () {
9903
+ if (typeof organizationId === 'undefined') {
9904
+ throw new AppwriteException('Missing required parameter: "organizationId"');
9905
+ }
9906
+ const apiPath = '/organizations/{organizationId}/credits'.replace('{organizationId}', organizationId);
9907
+ const payload = {};
9908
+ if (typeof queries !== 'undefined') {
9909
+ payload['queries'] = queries;
9910
+ }
9911
+ const uri = new URL(this.client.config.endpoint + apiPath);
9912
+ const apiHeaders = {
9913
+ 'content-type': 'application/json',
9914
+ };
9915
+ return yield this.client.call('get', uri, apiHeaders, payload);
9916
+ });
9917
+ }
9784
9918
  /**
9785
9919
  * Add credits from coupon
9786
9920
  *