@appwrite.io/console 1.3.2 → 1.4.1
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 +39 -11
- package/types/services/console.d.ts +1 -1
- package/types/services/organizations.d.ts +14 -4
|
@@ -18,9 +18,9 @@ export class Organizations {
|
|
|
18
18
|
* @param {string[]} queries
|
|
19
19
|
* @param {string} search
|
|
20
20
|
* @throws {AppwriteException}
|
|
21
|
-
* @returns {Promise<Models.
|
|
21
|
+
* @returns {Promise<Models.OrganizationList<Preferences>>}
|
|
22
22
|
*/
|
|
23
|
-
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.
|
|
23
|
+
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.OrganizationList<Preferences>> {
|
|
24
24
|
const apiPath = '/organizations';
|
|
25
25
|
const payload: Payload = {};
|
|
26
26
|
if (typeof queries !== 'undefined') {
|
|
@@ -165,9 +165,9 @@ export class Organizations {
|
|
|
165
165
|
* @param {string} organizationId
|
|
166
166
|
* @param {string} aggregationId
|
|
167
167
|
* @throws {AppwriteException}
|
|
168
|
-
* @returns {Promise<Models.
|
|
168
|
+
* @returns {Promise<Models.AggregationTeam>}
|
|
169
169
|
*/
|
|
170
|
-
async getAggregation(organizationId: string, aggregationId: string): Promise<Models.
|
|
170
|
+
async getAggregation(organizationId: string, aggregationId: string): Promise<Models.AggregationTeam> {
|
|
171
171
|
if (typeof organizationId === 'undefined') {
|
|
172
172
|
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
173
173
|
}
|
|
@@ -359,6 +359,38 @@ export class Organizations {
|
|
|
359
359
|
payload
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* List credits
|
|
364
|
+
*
|
|
365
|
+
*
|
|
366
|
+
* @param {string} organizationId
|
|
367
|
+
* @param {string[]} queries
|
|
368
|
+
* @throws {AppwriteException}
|
|
369
|
+
* @returns {Promise<Models.CreditList>}
|
|
370
|
+
*/
|
|
371
|
+
async listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList> {
|
|
372
|
+
if (typeof organizationId === 'undefined') {
|
|
373
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
374
|
+
}
|
|
375
|
+
const apiPath = '/organizations/{organizationId}/credits'.replace('{organizationId}', organizationId);
|
|
376
|
+
const payload: Payload = {};
|
|
377
|
+
if (typeof queries !== 'undefined') {
|
|
378
|
+
payload['queries'] = queries;
|
|
379
|
+
}
|
|
380
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
381
|
+
|
|
382
|
+
const apiHeaders: { [header: string]: string } = {
|
|
383
|
+
'content-type': 'application/json',
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
return await this.client.call(
|
|
388
|
+
'get',
|
|
389
|
+
uri,
|
|
390
|
+
apiHeaders,
|
|
391
|
+
payload
|
|
392
|
+
);
|
|
393
|
+
}
|
|
362
394
|
/**
|
|
363
395
|
* Add credits from coupon
|
|
364
396
|
*
|
package/types/models.d.ts
CHANGED
|
@@ -4366,7 +4366,7 @@ export declare namespace Models {
|
|
|
4366
4366
|
/**
|
|
4367
4367
|
* Additional resources
|
|
4368
4368
|
*/
|
|
4369
|
-
addons: AdditionalResource
|
|
4369
|
+
addons: AdditionalResource;
|
|
4370
4370
|
/**
|
|
4371
4371
|
* Custom SMTP
|
|
4372
4372
|
*/
|
|
@@ -4810,6 +4810,14 @@ export declare namespace Models {
|
|
|
4810
4810
|
* Name of the owner
|
|
4811
4811
|
*/
|
|
4812
4812
|
name: string;
|
|
4813
|
+
/**
|
|
4814
|
+
* Mandate ID of the payment method
|
|
4815
|
+
*/
|
|
4816
|
+
mandateId: string;
|
|
4817
|
+
/**
|
|
4818
|
+
* Country of the payment method
|
|
4819
|
+
*/
|
|
4820
|
+
country: string;
|
|
4813
4821
|
/**
|
|
4814
4822
|
* Last payment error associated with the payment method.
|
|
4815
4823
|
*/
|
|
@@ -5143,6 +5151,19 @@ export declare namespace Models {
|
|
|
5143
5151
|
*/
|
|
5144
5152
|
invoices: Invoice[];
|
|
5145
5153
|
};
|
|
5154
|
+
/**
|
|
5155
|
+
* Billing address list
|
|
5156
|
+
*/
|
|
5157
|
+
type BillingAddressList = {
|
|
5158
|
+
/**
|
|
5159
|
+
* Total number of billingAddresses documents that matched your query.
|
|
5160
|
+
*/
|
|
5161
|
+
total: number;
|
|
5162
|
+
/**
|
|
5163
|
+
* List of billingAddresses.
|
|
5164
|
+
*/
|
|
5165
|
+
billingAddresses: BillingAddress[];
|
|
5166
|
+
};
|
|
5146
5167
|
/**
|
|
5147
5168
|
* Billing plan list
|
|
5148
5169
|
*/
|
|
@@ -5156,6 +5177,19 @@ export declare namespace Models {
|
|
|
5156
5177
|
*/
|
|
5157
5178
|
plans: BillingPlan[];
|
|
5158
5179
|
};
|
|
5180
|
+
/**
|
|
5181
|
+
* Organizations List
|
|
5182
|
+
*/
|
|
5183
|
+
type OrganizationList<Preferences extends Models.Preferences> = {
|
|
5184
|
+
/**
|
|
5185
|
+
* Total number of teams documents that matched your query.
|
|
5186
|
+
*/
|
|
5187
|
+
total: number;
|
|
5188
|
+
/**
|
|
5189
|
+
* List of teams.
|
|
5190
|
+
*/
|
|
5191
|
+
teams: Organization<Preferences>[];
|
|
5192
|
+
};
|
|
5159
5193
|
/**
|
|
5160
5194
|
* Payment Methods List
|
|
5161
5195
|
*/
|
|
@@ -43,9 +43,23 @@ export declare class Account {
|
|
|
43
43
|
*
|
|
44
44
|
* @param {string[]} queries
|
|
45
45
|
* @throws {AppwriteException}
|
|
46
|
+
* @returns {Promise<Models.BillingAddressList>}
|
|
47
|
+
*/
|
|
48
|
+
listBillingAddresses(queries?: string[]): Promise<Models.BillingAddressList>;
|
|
49
|
+
/**
|
|
50
|
+
* Create new billing address
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* @param {string} country
|
|
54
|
+
* @param {string} streetAddress
|
|
55
|
+
* @param {string} city
|
|
56
|
+
* @param {string} state
|
|
57
|
+
* @param {string} postalCode
|
|
58
|
+
* @param {string} addressLine2
|
|
59
|
+
* @throws {AppwriteException}
|
|
46
60
|
* @returns {Promise<Models.BillingAddress>}
|
|
47
61
|
*/
|
|
48
|
-
|
|
62
|
+
createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
|
|
49
63
|
/**
|
|
50
64
|
* Get billing address
|
|
51
65
|
*
|
|
@@ -55,6 +69,30 @@ export declare class Account {
|
|
|
55
69
|
* @returns {Promise<Models.BillingAddress>}
|
|
56
70
|
*/
|
|
57
71
|
getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress>;
|
|
72
|
+
/**
|
|
73
|
+
* Update billing address
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
* @param {string} billingAddressId
|
|
77
|
+
* @param {string} country
|
|
78
|
+
* @param {string} streetAddress
|
|
79
|
+
* @param {string} city
|
|
80
|
+
* @param {string} state
|
|
81
|
+
* @param {string} postalCode
|
|
82
|
+
* @param {string} addressLine2
|
|
83
|
+
* @throws {AppwriteException}
|
|
84
|
+
* @returns {Promise<Models.BillingAddress>}
|
|
85
|
+
*/
|
|
86
|
+
updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
|
|
87
|
+
/**
|
|
88
|
+
* Delete billing address
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* @param {string} billingAddressId
|
|
92
|
+
* @throws {AppwriteException}
|
|
93
|
+
* @returns {Promise<{}>}
|
|
94
|
+
*/
|
|
95
|
+
deleteBillingAddress(billingAddressId: string): Promise<{}>;
|
|
58
96
|
/**
|
|
59
97
|
* Update email
|
|
60
98
|
*
|
|
@@ -620,14 +658,4 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
620
658
|
* @returns {Promise<Models.Token>}
|
|
621
659
|
*/
|
|
622
660
|
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
623
|
-
/**
|
|
624
|
-
* List credits
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
* @param {string} organizationId
|
|
628
|
-
* @param {string[]} queries
|
|
629
|
-
* @throws {AppwriteException}
|
|
630
|
-
* @returns {Promise<Models.CreditList>}
|
|
631
|
-
*/
|
|
632
|
-
listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList>;
|
|
633
661
|
}
|
|
@@ -12,9 +12,9 @@ export declare class Organizations {
|
|
|
12
12
|
* @param {string[]} queries
|
|
13
13
|
* @param {string} search
|
|
14
14
|
* @throws {AppwriteException}
|
|
15
|
-
* @returns {Promise<Models.
|
|
15
|
+
* @returns {Promise<Models.OrganizationList<Preferences>>}
|
|
16
16
|
*/
|
|
17
|
-
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.
|
|
17
|
+
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.OrganizationList<Preferences>>;
|
|
18
18
|
/**
|
|
19
19
|
* Create Organization
|
|
20
20
|
*
|
|
@@ -56,9 +56,9 @@ export declare class Organizations {
|
|
|
56
56
|
* @param {string} organizationId
|
|
57
57
|
* @param {string} aggregationId
|
|
58
58
|
* @throws {AppwriteException}
|
|
59
|
-
* @returns {Promise<Models.
|
|
59
|
+
* @returns {Promise<Models.AggregationTeam>}
|
|
60
60
|
*/
|
|
61
|
-
getAggregation(organizationId: string, aggregationId: string): Promise<Models.
|
|
61
|
+
getAggregation(organizationId: string, aggregationId: string): Promise<Models.AggregationTeam>;
|
|
62
62
|
/**
|
|
63
63
|
* Set team's billing address
|
|
64
64
|
*
|
|
@@ -109,6 +109,16 @@ export declare class Organizations {
|
|
|
109
109
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
110
110
|
*/
|
|
111
111
|
updateBudget<Preferences extends Models.Preferences>(organizationId: string, budget: number, alerts?: number[]): Promise<Models.Organization<Preferences>>;
|
|
112
|
+
/**
|
|
113
|
+
* List credits
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* @param {string} organizationId
|
|
117
|
+
* @param {string[]} queries
|
|
118
|
+
* @throws {AppwriteException}
|
|
119
|
+
* @returns {Promise<Models.CreditList>}
|
|
120
|
+
*/
|
|
121
|
+
listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList>;
|
|
112
122
|
/**
|
|
113
123
|
* Add credits from coupon
|
|
114
124
|
*
|