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