@appwrite.io/console 2.1.1 → 2.1.2
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +99 -7
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +100 -8
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +99 -7
- package/docs/examples/domains/list-suggestions.md +18 -0
- package/docs/examples/health/get-queue-audits.md +13 -0
- package/docs/examples/organizations/create.md +2 -2
- package/docs/examples/organizations/estimation-create-organization.md +2 -2
- package/docs/examples/organizations/estimation-update-plan.md +2 -2
- package/docs/examples/organizations/update-plan.md +2 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/billing-plan.ts +17 -0
- package/src/enums/filter-type.ts +4 -0
- package/src/enums/name.ts +1 -0
- package/src/enums/o-auth-provider.ts +0 -2
- package/src/index.ts +2 -0
- package/src/models.ts +437 -375
- package/src/services/account.ts +20 -20
- package/src/services/avatars.ts +117 -117
- package/src/services/backups.ts +18 -18
- package/src/services/console.ts +24 -24
- package/src/services/databases.ts +89 -89
- package/src/services/domains.ts +295 -204
- package/src/services/functions.ts +30 -30
- package/src/services/health.ts +201 -152
- package/src/services/messaging.ts +54 -54
- package/src/services/migrations.ts +36 -36
- package/src/services/organizations.ts +67 -66
- package/src/services/projects.ts +81 -81
- package/src/services/sites.ts +30 -30
- package/src/services/storage.ts +45 -45
- package/src/services/tables-db.ts +89 -89
- package/src/services/users.ts +39 -39
- package/types/enums/billing-plan.d.ts +17 -0
- package/types/enums/filter-type.d.ts +4 -0
- package/types/enums/name.d.ts +1 -0
- package/types/enums/o-auth-provider.d.ts +0 -2
- package/types/index.d.ts +2 -0
- package/types/models.d.ts +434 -375
- package/types/services/account.d.ts +11 -11
- package/types/services/avatars.d.ts +82 -82
- package/types/services/backups.d.ts +8 -8
- package/types/services/console.d.ts +14 -14
- package/types/services/databases.d.ts +50 -50
- package/types/services/domains.d.ts +139 -104
- package/types/services/functions.d.ts +15 -15
- package/types/services/health.d.ts +95 -78
- package/types/services/messaging.d.ts +24 -24
- package/types/services/migrations.d.ts +16 -16
- package/types/services/organizations.d.ts +37 -36
- package/types/services/projects.d.ts +36 -36
- package/types/services/sites.d.ts +15 -15
- package/types/services/storage.d.ts +30 -30
- package/types/services/tables-db.d.ts +50 -50
- package/types/services/users.d.ts +24 -24
|
@@ -2,6 +2,7 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
|
|
5
|
+
import { BillingPlan } from '../enums/billing-plan';
|
|
5
6
|
import { Platform } from '../enums/platform';
|
|
6
7
|
|
|
7
8
|
export class Organizations {
|
|
@@ -76,56 +77,56 @@ export class Organizations {
|
|
|
76
77
|
*
|
|
77
78
|
* @param {string} params.organizationId - Organization ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
78
79
|
* @param {string} params.name - Organization name. Max length: 128 chars.
|
|
79
|
-
* @param {
|
|
80
|
+
* @param {BillingPlan} params.billingPlan - Organization billing plan chosen
|
|
80
81
|
* @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
81
82
|
* @param {string} params.billingAddressId - Unique ID of billing address
|
|
82
83
|
* @param {string[]} params.invites - Additional member invites
|
|
83
84
|
* @param {string} params.couponId - Coupon id
|
|
84
85
|
* @param {string} params.taxId - Tax Id associated to billing.
|
|
85
|
-
* @param {number
|
|
86
|
+
* @param {number} params.budget - Budget limit for additional usage set for the organization
|
|
86
87
|
* @param {Platform} params.platform - Platform type
|
|
87
88
|
* @throws {AppwriteException}
|
|
88
89
|
* @returns {Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>}
|
|
89
90
|
*/
|
|
90
|
-
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, name: string, billingPlan:
|
|
91
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform }): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>;
|
|
91
92
|
/**
|
|
92
93
|
* Create a new organization.
|
|
93
94
|
*
|
|
94
95
|
*
|
|
95
96
|
* @param {string} organizationId - Organization ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
96
97
|
* @param {string} name - Organization name. Max length: 128 chars.
|
|
97
|
-
* @param {
|
|
98
|
+
* @param {BillingPlan} billingPlan - Organization billing plan chosen
|
|
98
99
|
* @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
99
100
|
* @param {string} billingAddressId - Unique ID of billing address
|
|
100
101
|
* @param {string[]} invites - Additional member invites
|
|
101
102
|
* @param {string} couponId - Coupon id
|
|
102
103
|
* @param {string} taxId - Tax Id associated to billing.
|
|
103
|
-
* @param {number
|
|
104
|
+
* @param {number} budget - Budget limit for additional usage set for the organization
|
|
104
105
|
* @param {Platform} platform - Platform type
|
|
105
106
|
* @throws {AppwriteException}
|
|
106
107
|
* @returns {Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>}
|
|
107
108
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
108
109
|
*/
|
|
109
|
-
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, name: string, billingPlan:
|
|
110
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>;
|
|
110
111
|
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
111
|
-
paramsOrFirst: { organizationId: string, name: string, billingPlan:
|
|
112
|
-
...rest: [(string)?, (
|
|
112
|
+
paramsOrFirst: { organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform } | string,
|
|
113
|
+
...rest: [(string)?, (BillingPlan)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (number)?, (Platform)?]
|
|
113
114
|
): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication> {
|
|
114
|
-
let params: { organizationId: string, name: string, billingPlan:
|
|
115
|
+
let params: { organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform };
|
|
115
116
|
|
|
116
117
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
117
|
-
params = (paramsOrFirst || {}) as { organizationId: string, name: string, billingPlan:
|
|
118
|
+
params = (paramsOrFirst || {}) as { organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform };
|
|
118
119
|
} else {
|
|
119
120
|
params = {
|
|
120
121
|
organizationId: paramsOrFirst as string,
|
|
121
122
|
name: rest[0] as string,
|
|
122
|
-
billingPlan: rest[1] as
|
|
123
|
+
billingPlan: rest[1] as BillingPlan,
|
|
123
124
|
paymentMethodId: rest[2] as string,
|
|
124
125
|
billingAddressId: rest[3] as string,
|
|
125
126
|
invites: rest[4] as string[],
|
|
126
127
|
couponId: rest[5] as string,
|
|
127
128
|
taxId: rest[6] as string,
|
|
128
|
-
budget: rest[7] as number
|
|
129
|
+
budget: rest[7] as number,
|
|
129
130
|
platform: rest[8] as Platform
|
|
130
131
|
};
|
|
131
132
|
}
|
|
@@ -200,7 +201,7 @@ export class Organizations {
|
|
|
200
201
|
/**
|
|
201
202
|
* Get estimation for creating an organization.
|
|
202
203
|
*
|
|
203
|
-
* @param {
|
|
204
|
+
* @param {BillingPlan} params.billingPlan - Organization billing plan chosen
|
|
204
205
|
* @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
205
206
|
* @param {string[]} params.invites - Additional member invites
|
|
206
207
|
* @param {string} params.couponId - Coupon id
|
|
@@ -208,11 +209,11 @@ export class Organizations {
|
|
|
208
209
|
* @throws {AppwriteException}
|
|
209
210
|
* @returns {Promise<Models.Estimation>}
|
|
210
211
|
*/
|
|
211
|
-
estimationCreateOrganization(params: { billingPlan:
|
|
212
|
+
estimationCreateOrganization(params: { billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform }): Promise<Models.Estimation>;
|
|
212
213
|
/**
|
|
213
214
|
* Get estimation for creating an organization.
|
|
214
215
|
*
|
|
215
|
-
* @param {
|
|
216
|
+
* @param {BillingPlan} billingPlan - Organization billing plan chosen
|
|
216
217
|
* @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
217
218
|
* @param {string[]} invites - Additional member invites
|
|
218
219
|
* @param {string} couponId - Coupon id
|
|
@@ -221,18 +222,18 @@ export class Organizations {
|
|
|
221
222
|
* @returns {Promise<Models.Estimation>}
|
|
222
223
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
223
224
|
*/
|
|
224
|
-
estimationCreateOrganization(billingPlan:
|
|
225
|
+
estimationCreateOrganization(billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform): Promise<Models.Estimation>;
|
|
225
226
|
estimationCreateOrganization(
|
|
226
|
-
paramsOrFirst: { billingPlan:
|
|
227
|
+
paramsOrFirst: { billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform } | BillingPlan,
|
|
227
228
|
...rest: [(string)?, (string[])?, (string)?, (Platform)?]
|
|
228
229
|
): Promise<Models.Estimation> {
|
|
229
|
-
let params: { billingPlan:
|
|
230
|
+
let params: { billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform };
|
|
230
231
|
|
|
231
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
232
|
-
params = (paramsOrFirst || {}) as { billingPlan:
|
|
232
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'billingPlan' in paramsOrFirst)) {
|
|
233
|
+
params = (paramsOrFirst || {}) as { billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform };
|
|
233
234
|
} else {
|
|
234
235
|
params = {
|
|
235
|
-
billingPlan: paramsOrFirst as
|
|
236
|
+
billingPlan: paramsOrFirst as BillingPlan,
|
|
236
237
|
paymentMethodId: rest[0] as string,
|
|
237
238
|
invites: rest[1] as string[],
|
|
238
239
|
couponId: rest[2] as string,
|
|
@@ -397,38 +398,38 @@ export class Organizations {
|
|
|
397
398
|
*
|
|
398
399
|
* @param {string} params.organizationId - Organization ID
|
|
399
400
|
* @param {string} params.aggregationId - Invoice unique ID
|
|
400
|
-
* @param {number
|
|
401
|
-
* @param {number
|
|
401
|
+
* @param {number} params.limit - Maximum number of project aggregations to return in response. By default will return maximum 5 results. Maximum of 10 results allowed per request.
|
|
402
|
+
* @param {number} params.offset - Offset value. The default value is 0. Use this param to manage pagination.
|
|
402
403
|
* @throws {AppwriteException}
|
|
403
404
|
* @returns {Promise<Models.AggregationTeam>}
|
|
404
405
|
*/
|
|
405
|
-
getAggregation(params: { organizationId: string, aggregationId: string, limit?: number
|
|
406
|
+
getAggregation(params: { organizationId: string, aggregationId: string, limit?: number, offset?: number }): Promise<Models.AggregationTeam>;
|
|
406
407
|
/**
|
|
407
408
|
* Get a specific aggregation using it's aggregation ID.
|
|
408
409
|
*
|
|
409
410
|
* @param {string} organizationId - Organization ID
|
|
410
411
|
* @param {string} aggregationId - Invoice unique ID
|
|
411
|
-
* @param {number
|
|
412
|
-
* @param {number
|
|
412
|
+
* @param {number} limit - Maximum number of project aggregations to return in response. By default will return maximum 5 results. Maximum of 10 results allowed per request.
|
|
413
|
+
* @param {number} offset - Offset value. The default value is 0. Use this param to manage pagination.
|
|
413
414
|
* @throws {AppwriteException}
|
|
414
415
|
* @returns {Promise<Models.AggregationTeam>}
|
|
415
416
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
416
417
|
*/
|
|
417
|
-
getAggregation(organizationId: string, aggregationId: string, limit?: number
|
|
418
|
+
getAggregation(organizationId: string, aggregationId: string, limit?: number, offset?: number): Promise<Models.AggregationTeam>;
|
|
418
419
|
getAggregation(
|
|
419
|
-
paramsOrFirst: { organizationId: string, aggregationId: string, limit?: number
|
|
420
|
-
...rest: [(string)?, (number
|
|
420
|
+
paramsOrFirst: { organizationId: string, aggregationId: string, limit?: number, offset?: number } | string,
|
|
421
|
+
...rest: [(string)?, (number)?, (number)?]
|
|
421
422
|
): Promise<Models.AggregationTeam> {
|
|
422
|
-
let params: { organizationId: string, aggregationId: string, limit?: number
|
|
423
|
+
let params: { organizationId: string, aggregationId: string, limit?: number, offset?: number };
|
|
423
424
|
|
|
424
425
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
425
|
-
params = (paramsOrFirst || {}) as { organizationId: string, aggregationId: string, limit?: number
|
|
426
|
+
params = (paramsOrFirst || {}) as { organizationId: string, aggregationId: string, limit?: number, offset?: number };
|
|
426
427
|
} else {
|
|
427
428
|
params = {
|
|
428
429
|
organizationId: paramsOrFirst as string,
|
|
429
430
|
aggregationId: rest[0] as string,
|
|
430
|
-
limit: rest[1] as number
|
|
431
|
-
offset: rest[2] as number
|
|
431
|
+
limit: rest[1] as number,
|
|
432
|
+
offset: rest[2] as number
|
|
432
433
|
};
|
|
433
434
|
}
|
|
434
435
|
|
|
@@ -706,36 +707,36 @@ export class Organizations {
|
|
|
706
707
|
* Update the budget limit for an organization.
|
|
707
708
|
*
|
|
708
709
|
* @param {string} params.organizationId - Organization Unique ID
|
|
709
|
-
* @param {number
|
|
710
|
-
* @param {number
|
|
710
|
+
* @param {number} params.budget - Budget limit for additional usage set for the organization
|
|
711
|
+
* @param {number[]} params.alerts - Budget alert limit percentage
|
|
711
712
|
* @throws {AppwriteException}
|
|
712
713
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
713
714
|
*/
|
|
714
|
-
updateBudget<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, budget?: number
|
|
715
|
+
updateBudget<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, budget?: number, alerts?: number[] }): Promise<Models.Organization<Preferences>>;
|
|
715
716
|
/**
|
|
716
717
|
* Update the budget limit for an organization.
|
|
717
718
|
*
|
|
718
719
|
* @param {string} organizationId - Organization Unique ID
|
|
719
|
-
* @param {number
|
|
720
|
-
* @param {number
|
|
720
|
+
* @param {number} budget - Budget limit for additional usage set for the organization
|
|
721
|
+
* @param {number[]} alerts - Budget alert limit percentage
|
|
721
722
|
* @throws {AppwriteException}
|
|
722
723
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
723
724
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
724
725
|
*/
|
|
725
|
-
updateBudget<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, budget?: number
|
|
726
|
+
updateBudget<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, budget?: number, alerts?: number[]): Promise<Models.Organization<Preferences>>;
|
|
726
727
|
updateBudget<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
727
|
-
paramsOrFirst: { organizationId: string, budget?: number
|
|
728
|
-
...rest: [(number
|
|
728
|
+
paramsOrFirst: { organizationId: string, budget?: number, alerts?: number[] } | string,
|
|
729
|
+
...rest: [(number)?, (number[])?]
|
|
729
730
|
): Promise<Models.Organization<Preferences>> {
|
|
730
|
-
let params: { organizationId: string, budget?: number
|
|
731
|
+
let params: { organizationId: string, budget?: number, alerts?: number[] };
|
|
731
732
|
|
|
732
733
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
733
|
-
params = (paramsOrFirst || {}) as { organizationId: string, budget?: number
|
|
734
|
+
params = (paramsOrFirst || {}) as { organizationId: string, budget?: number, alerts?: number[] };
|
|
734
735
|
} else {
|
|
735
736
|
params = {
|
|
736
737
|
organizationId: paramsOrFirst as string,
|
|
737
|
-
budget: rest[0] as number
|
|
738
|
-
alerts: rest[1] as number
|
|
738
|
+
budget: rest[0] as number,
|
|
739
|
+
alerts: rest[1] as number[]
|
|
739
740
|
};
|
|
740
741
|
}
|
|
741
742
|
|
|
@@ -1062,37 +1063,37 @@ export class Organizations {
|
|
|
1062
1063
|
* Get estimation for updating the organization plan.
|
|
1063
1064
|
*
|
|
1064
1065
|
* @param {string} params.organizationId - Organization ID
|
|
1065
|
-
* @param {
|
|
1066
|
+
* @param {BillingPlan} params.billingPlan - Organization billing plan chosen
|
|
1066
1067
|
* @param {string[]} params.invites - Additional member invites
|
|
1067
1068
|
* @param {string} params.couponId - Coupon id
|
|
1068
1069
|
* @throws {AppwriteException}
|
|
1069
1070
|
* @returns {Promise<Models.EstimationUpdatePlan>}
|
|
1070
1071
|
*/
|
|
1071
|
-
estimationUpdatePlan(params: { organizationId: string, billingPlan:
|
|
1072
|
+
estimationUpdatePlan(params: { organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string }): Promise<Models.EstimationUpdatePlan>;
|
|
1072
1073
|
/**
|
|
1073
1074
|
* Get estimation for updating the organization plan.
|
|
1074
1075
|
*
|
|
1075
1076
|
* @param {string} organizationId - Organization ID
|
|
1076
|
-
* @param {
|
|
1077
|
+
* @param {BillingPlan} billingPlan - Organization billing plan chosen
|
|
1077
1078
|
* @param {string[]} invites - Additional member invites
|
|
1078
1079
|
* @param {string} couponId - Coupon id
|
|
1079
1080
|
* @throws {AppwriteException}
|
|
1080
1081
|
* @returns {Promise<Models.EstimationUpdatePlan>}
|
|
1081
1082
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1082
1083
|
*/
|
|
1083
|
-
estimationUpdatePlan(organizationId: string, billingPlan:
|
|
1084
|
+
estimationUpdatePlan(organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string): Promise<Models.EstimationUpdatePlan>;
|
|
1084
1085
|
estimationUpdatePlan(
|
|
1085
|
-
paramsOrFirst: { organizationId: string, billingPlan:
|
|
1086
|
-
...rest: [(
|
|
1086
|
+
paramsOrFirst: { organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string } | string,
|
|
1087
|
+
...rest: [(BillingPlan)?, (string[])?, (string)?]
|
|
1087
1088
|
): Promise<Models.EstimationUpdatePlan> {
|
|
1088
|
-
let params: { organizationId: string, billingPlan:
|
|
1089
|
+
let params: { organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string };
|
|
1089
1090
|
|
|
1090
1091
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1091
|
-
params = (paramsOrFirst || {}) as { organizationId: string, billingPlan:
|
|
1092
|
+
params = (paramsOrFirst || {}) as { organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string };
|
|
1092
1093
|
} else {
|
|
1093
1094
|
params = {
|
|
1094
1095
|
organizationId: paramsOrFirst as string,
|
|
1095
|
-
billingPlan: rest[0] as
|
|
1096
|
+
billingPlan: rest[0] as BillingPlan,
|
|
1096
1097
|
invites: rest[1] as string[],
|
|
1097
1098
|
couponId: rest[2] as string
|
|
1098
1099
|
};
|
|
@@ -1942,51 +1943,51 @@ export class Organizations {
|
|
|
1942
1943
|
* Update the billing plan for an organization.
|
|
1943
1944
|
*
|
|
1944
1945
|
* @param {string} params.organizationId - Organization Unique ID
|
|
1945
|
-
* @param {
|
|
1946
|
+
* @param {BillingPlan} params.billingPlan - Organization billing plan chosen
|
|
1946
1947
|
* @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
1947
1948
|
* @param {string} params.billingAddressId - Unique ID of billing address
|
|
1948
1949
|
* @param {string[]} params.invites - Additional member invites
|
|
1949
1950
|
* @param {string} params.couponId - Coupon id
|
|
1950
1951
|
* @param {string} params.taxId - Tax Id associated to billing.
|
|
1951
|
-
* @param {number
|
|
1952
|
+
* @param {number} params.budget - Budget limit for additional usage set for the organization
|
|
1952
1953
|
* @throws {AppwriteException}
|
|
1953
1954
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
1954
1955
|
*/
|
|
1955
|
-
updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, billingPlan:
|
|
1956
|
+
updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number }): Promise<Models.Organization<Preferences>>;
|
|
1956
1957
|
/**
|
|
1957
1958
|
* Update the billing plan for an organization.
|
|
1958
1959
|
*
|
|
1959
1960
|
* @param {string} organizationId - Organization Unique ID
|
|
1960
|
-
* @param {
|
|
1961
|
+
* @param {BillingPlan} billingPlan - Organization billing plan chosen
|
|
1961
1962
|
* @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set.
|
|
1962
1963
|
* @param {string} billingAddressId - Unique ID of billing address
|
|
1963
1964
|
* @param {string[]} invites - Additional member invites
|
|
1964
1965
|
* @param {string} couponId - Coupon id
|
|
1965
1966
|
* @param {string} taxId - Tax Id associated to billing.
|
|
1966
|
-
* @param {number
|
|
1967
|
+
* @param {number} budget - Budget limit for additional usage set for the organization
|
|
1967
1968
|
* @throws {AppwriteException}
|
|
1968
1969
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
1969
1970
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1970
1971
|
*/
|
|
1971
|
-
updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, billingPlan:
|
|
1972
|
+
updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>>;
|
|
1972
1973
|
updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1973
|
-
paramsOrFirst: { organizationId: string, billingPlan:
|
|
1974
|
-
...rest: [(
|
|
1974
|
+
paramsOrFirst: { organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number } | string,
|
|
1975
|
+
...rest: [(BillingPlan)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (number)?]
|
|
1975
1976
|
): Promise<Models.Organization<Preferences>> {
|
|
1976
|
-
let params: { organizationId: string, billingPlan:
|
|
1977
|
+
let params: { organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number };
|
|
1977
1978
|
|
|
1978
1979
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1979
|
-
params = (paramsOrFirst || {}) as { organizationId: string, billingPlan:
|
|
1980
|
+
params = (paramsOrFirst || {}) as { organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number };
|
|
1980
1981
|
} else {
|
|
1981
1982
|
params = {
|
|
1982
1983
|
organizationId: paramsOrFirst as string,
|
|
1983
|
-
billingPlan: rest[0] as
|
|
1984
|
+
billingPlan: rest[0] as BillingPlan,
|
|
1984
1985
|
paymentMethodId: rest[1] as string,
|
|
1985
1986
|
billingAddressId: rest[2] as string,
|
|
1986
1987
|
invites: rest[3] as string[],
|
|
1987
1988
|
couponId: rest[4] as string,
|
|
1988
1989
|
taxId: rest[5] as string,
|
|
1989
|
-
budget: rest[6] as number
|
|
1990
|
+
budget: rest[6] as number
|
|
1990
1991
|
};
|
|
1991
1992
|
}
|
|
1992
1993
|
|