@appwrite.io/console 2.1.0 → 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.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/sdk.js +153 -22
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +150 -23
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +3910 -22
  8. package/docs/examples/domains/list-suggestions.md +18 -0
  9. package/docs/examples/health/get-queue-audits.md +13 -0
  10. package/docs/examples/organizations/create.md +2 -2
  11. package/docs/examples/organizations/estimation-create-organization.md +2 -2
  12. package/docs/examples/organizations/estimation-update-plan.md +2 -2
  13. package/docs/examples/organizations/update-plan.md +2 -2
  14. package/docs/examples/projects/update-labels.md +14 -0
  15. package/package.json +7 -1
  16. package/rollup.config.js +40 -24
  17. package/src/client.ts +20 -10
  18. package/src/enums/billing-plan.ts +17 -0
  19. package/src/enums/filter-type.ts +4 -0
  20. package/src/enums/name.ts +1 -0
  21. package/src/enums/o-auth-provider.ts +0 -2
  22. package/src/index.ts +2 -0
  23. package/src/models.ts +129 -59
  24. package/src/query.ts +14 -11
  25. package/src/services/databases.ts +30 -30
  26. package/src/services/domains.ts +91 -0
  27. package/src/services/health.ts +55 -6
  28. package/src/services/organizations.ts +37 -36
  29. package/src/services/projects.ts +65 -2
  30. package/src/services/storage.ts +4 -4
  31. package/src/services/tables-db.ts +30 -30
  32. package/types/client.d.ts +8 -1
  33. package/types/enums/billing-plan.d.ts +17 -0
  34. package/types/enums/filter-type.d.ts +4 -0
  35. package/types/enums/name.d.ts +1 -0
  36. package/types/enums/o-auth-provider.d.ts +0 -2
  37. package/types/index.d.ts +2 -0
  38. package/types/models.d.ts +126 -59
  39. package/types/query.d.ts +8 -8
  40. package/types/services/databases.d.ts +20 -20
  41. package/types/services/domains.d.ts +35 -0
  42. package/types/services/health.d.ts +23 -6
  43. package/types/services/organizations.d.ts +17 -16
  44. package/types/services/projects.d.ts +24 -2
  45. package/types/services/storage.d.ts +4 -4
  46. package/types/services/tables-db.d.ts +20 -20
@@ -61,9 +61,9 @@ export class Health {
61
61
  * Check the Appwrite in-memory cache servers are up and connection is successful.
62
62
  *
63
63
  * @throws {AppwriteException}
64
- * @returns {Promise<Models.HealthStatus>}
64
+ * @returns {Promise<Models.HealthStatusList>}
65
65
  */
66
- getCache(): Promise<Models.HealthStatus> {
66
+ getCache(): Promise<Models.HealthStatusList> {
67
67
 
68
68
  const apiPath = '/health/cache';
69
69
  const payload: Payload = {};
@@ -135,9 +135,9 @@ export class Health {
135
135
  * Check the Appwrite database servers are up and connection is successful.
136
136
  *
137
137
  * @throws {AppwriteException}
138
- * @returns {Promise<Models.HealthStatus>}
138
+ * @returns {Promise<Models.HealthStatusList>}
139
139
  */
140
- getDB(): Promise<Models.HealthStatus> {
140
+ getDB(): Promise<Models.HealthStatusList> {
141
141
 
142
142
  const apiPath = '/health/db';
143
143
  const payload: Payload = {};
@@ -158,9 +158,9 @@ export class Health {
158
158
  * Check the Appwrite pub-sub servers are up and connection is successful.
159
159
  *
160
160
  * @throws {AppwriteException}
161
- * @returns {Promise<Models.HealthStatus>}
161
+ * @returns {Promise<Models.HealthStatusList>}
162
162
  */
163
- getPubSub(): Promise<Models.HealthStatus> {
163
+ getPubSub(): Promise<Models.HealthStatusList> {
164
164
 
165
165
  const apiPath = '/health/pubsub';
166
166
  const payload: Payload = {};
@@ -177,6 +177,55 @@ export class Health {
177
177
  );
178
178
  }
179
179
 
180
+ /**
181
+ *
182
+ * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
183
+ * @throws {AppwriteException}
184
+ * @returns {Promise<Models.HealthQueue>}
185
+ */
186
+ getQueueAudits(params?: { threshold?: number }): Promise<Models.HealthQueue>;
187
+ /**
188
+ *
189
+ * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
190
+ * @throws {AppwriteException}
191
+ * @returns {Promise<Models.HealthQueue>}
192
+ * @deprecated Use the object parameter style method for a better developer experience.
193
+ */
194
+ getQueueAudits(threshold?: number): Promise<Models.HealthQueue>;
195
+ getQueueAudits(
196
+ paramsOrFirst?: { threshold?: number } | number
197
+ ): Promise<Models.HealthQueue> {
198
+ let params: { threshold?: number };
199
+
200
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
201
+ params = (paramsOrFirst || {}) as { threshold?: number };
202
+ } else {
203
+ params = {
204
+ threshold: paramsOrFirst as number
205
+ };
206
+ }
207
+
208
+ const threshold = params.threshold;
209
+
210
+
211
+ const apiPath = '/health/queue/audits';
212
+ const payload: Payload = {};
213
+ if (typeof threshold !== 'undefined') {
214
+ payload['threshold'] = threshold;
215
+ }
216
+ const uri = new URL(this.client.config.endpoint + apiPath);
217
+
218
+ const apiHeaders: { [header: string]: string } = {
219
+ }
220
+
221
+ return this.client.call(
222
+ 'get',
223
+ uri,
224
+ apiHeaders,
225
+ payload
226
+ );
227
+ }
228
+
180
229
  /**
181
230
  * Get billing project aggregation queue.
182
231
  *
@@ -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,7 +77,7 @@ 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 {string} params.billingPlan - Organization billing plan chosen
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
@@ -87,14 +88,14 @@ export class Organizations {
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform }): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>;
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 {string} billingPlan - Organization billing plan chosen
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
@@ -106,20 +107,20 @@ export class Organizations {
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>;
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform } | string,
112
- ...rest: [(string)?, (string)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (number)?, (Platform)?]
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform };
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number, platform?: Platform };
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 string,
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[],
@@ -200,7 +201,7 @@ export class Organizations {
200
201
  /**
201
202
  * Get estimation for creating an organization.
202
203
  *
203
- * @param {string} params.billingPlan - Organization billing plan chosen
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: string, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform }): Promise<Models.Estimation>;
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 {string} billingPlan - Organization billing plan chosen
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: string, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform): Promise<Models.Estimation>;
225
+ estimationCreateOrganization(billingPlan: BillingPlan, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform): Promise<Models.Estimation>;
225
226
  estimationCreateOrganization(
226
- paramsOrFirst: { billingPlan: string, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform } | string,
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: string, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform };
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: string, paymentMethodId?: string, invites?: string[], couponId?: string, platform?: Platform };
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 string,
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,
@@ -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 {string} params.billingPlan - Organization billing plan chosen
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: string, invites?: string[], couponId?: string }): Promise<Models.EstimationUpdatePlan>;
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 {string} billingPlan - Organization billing plan chosen
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: string, invites?: string[], couponId?: string): Promise<Models.EstimationUpdatePlan>;
1084
+ estimationUpdatePlan(organizationId: string, billingPlan: BillingPlan, invites?: string[], couponId?: string): Promise<Models.EstimationUpdatePlan>;
1084
1085
  estimationUpdatePlan(
1085
- paramsOrFirst: { organizationId: string, billingPlan: string, invites?: string[], couponId?: string } | string,
1086
- ...rest: [(string)?, (string[])?, (string)?]
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: string, invites?: string[], couponId?: string };
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: string, invites?: string[], couponId?: string };
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 string,
1096
+ billingPlan: rest[0] as BillingPlan,
1096
1097
  invites: rest[1] as string[],
1097
1098
  couponId: rest[2] as string
1098
1099
  };
@@ -1942,7 +1943,7 @@ 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 {string} params.billingPlan - Organization billing plan chosen
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
@@ -1952,12 +1953,12 @@ export class Organizations {
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number }): Promise<Models.Organization<Preferences>>;
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 {string} billingPlan - Organization billing plan chosen
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
@@ -1968,19 +1969,19 @@ export class Organizations {
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>>;
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number } | string,
1974
- ...rest: [(string)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (number)?]
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number };
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: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number };
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 string,
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[],
@@ -25,7 +25,7 @@ export class Projects {
25
25
  /**
26
26
  * Get a list of all projects. You can use the query params to filter your results.
27
27
  *
28
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId
28
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search
29
29
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
30
30
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
31
31
  * @throws {AppwriteException}
@@ -35,7 +35,7 @@ export class Projects {
35
35
  /**
36
36
  * Get a list of all projects. You can use the query params to filter your results.
37
37
  *
38
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId
38
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search
39
39
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
40
40
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
41
41
  * @throws {AppwriteException}
@@ -2203,6 +2203,69 @@ export class Projects {
2203
2203
  );
2204
2204
  }
2205
2205
 
2206
+ /**
2207
+ * Update the project labels by its unique ID. Labels can be used to easily filter projects in an organization.
2208
+ *
2209
+ * @param {string} params.projectId - Project unique ID.
2210
+ * @param {string[]} params.labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
2211
+ * @throws {AppwriteException}
2212
+ * @returns {Promise<Models.Project>}
2213
+ */
2214
+ updateLabels(params: { projectId: string, labels: string[] }): Promise<Models.Project>;
2215
+ /**
2216
+ * Update the project labels by its unique ID. Labels can be used to easily filter projects in an organization.
2217
+ *
2218
+ * @param {string} projectId - Project unique ID.
2219
+ * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
2220
+ * @throws {AppwriteException}
2221
+ * @returns {Promise<Models.Project>}
2222
+ * @deprecated Use the object parameter style method for a better developer experience.
2223
+ */
2224
+ updateLabels(projectId: string, labels: string[]): Promise<Models.Project>;
2225
+ updateLabels(
2226
+ paramsOrFirst: { projectId: string, labels: string[] } | string,
2227
+ ...rest: [(string[])?]
2228
+ ): Promise<Models.Project> {
2229
+ let params: { projectId: string, labels: string[] };
2230
+
2231
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2232
+ params = (paramsOrFirst || {}) as { projectId: string, labels: string[] };
2233
+ } else {
2234
+ params = {
2235
+ projectId: paramsOrFirst as string,
2236
+ labels: rest[0] as string[]
2237
+ };
2238
+ }
2239
+
2240
+ const projectId = params.projectId;
2241
+ const labels = params.labels;
2242
+
2243
+ if (typeof projectId === 'undefined') {
2244
+ throw new AppwriteException('Missing required parameter: "projectId"');
2245
+ }
2246
+ if (typeof labels === 'undefined') {
2247
+ throw new AppwriteException('Missing required parameter: "labels"');
2248
+ }
2249
+
2250
+ const apiPath = '/projects/{projectId}/labels'.replace('{projectId}', projectId);
2251
+ const payload: Payload = {};
2252
+ if (typeof labels !== 'undefined') {
2253
+ payload['labels'] = labels;
2254
+ }
2255
+ const uri = new URL(this.client.config.endpoint + apiPath);
2256
+
2257
+ const apiHeaders: { [header: string]: string } = {
2258
+ 'content-type': 'application/json',
2259
+ }
2260
+
2261
+ return this.client.call(
2262
+ 'put',
2263
+ uri,
2264
+ apiHeaders,
2265
+ payload
2266
+ );
2267
+ }
2268
+
2206
2269
  /**
2207
2270
  * Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers.
2208
2271
  *
@@ -90,7 +90,7 @@ export class Storage {
90
90
  * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
91
91
  * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB.
92
92
  * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
93
- * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
93
+ * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
94
94
  * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
95
95
  * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
96
96
  * @param {boolean} params.transformations - Are image transformations enabled?
@@ -108,7 +108,7 @@ export class Storage {
108
108
  * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
109
109
  * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB.
110
110
  * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
111
- * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
111
+ * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
112
112
  * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
113
113
  * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
114
114
  * @param {boolean} transformations - Are image transformations enabled?
@@ -270,7 +270,7 @@ export class Storage {
270
270
  * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
271
271
  * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB.
272
272
  * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
273
- * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
273
+ * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
274
274
  * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
275
275
  * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
276
276
  * @param {boolean} params.transformations - Are image transformations enabled?
@@ -288,7 +288,7 @@ export class Storage {
288
288
  * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
289
289
  * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB.
290
290
  * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
291
- * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
291
+ * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
292
292
  * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
293
293
  * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
294
294
  * @param {boolean} transformations - Are image transformations enabled?
@@ -2184,14 +2184,14 @@ export class TablesDB {
2184
2184
  * @param {string} params.tableId - Table ID.
2185
2185
  * @param {string} params.key - Column Key.
2186
2186
  * @param {boolean} params.required - Is column required?
2187
- * @param {number} params.min - Minimum value
2188
- * @param {number} params.max - Maximum value
2189
- * @param {number} params.xdefault - Default value. Cannot be set when column is required.
2187
+ * @param {number | bigint} params.min - Minimum value
2188
+ * @param {number | bigint} params.max - Maximum value
2189
+ * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required.
2190
2190
  * @param {boolean} params.array - Is column an array?
2191
2191
  * @throws {AppwriteException}
2192
2192
  * @returns {Promise<Models.ColumnInteger>}
2193
2193
  */
2194
- createIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise<Models.ColumnInteger>;
2194
+ createIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise<Models.ColumnInteger>;
2195
2195
  /**
2196
2196
  * Create an integer column. Optionally, minimum and maximum values can be provided.
2197
2197
  *
@@ -2200,32 +2200,32 @@ export class TablesDB {
2200
2200
  * @param {string} tableId - Table ID.
2201
2201
  * @param {string} key - Column Key.
2202
2202
  * @param {boolean} required - Is column required?
2203
- * @param {number} min - Minimum value
2204
- * @param {number} max - Maximum value
2205
- * @param {number} xdefault - Default value. Cannot be set when column is required.
2203
+ * @param {number | bigint} min - Minimum value
2204
+ * @param {number | bigint} max - Maximum value
2205
+ * @param {number | bigint} xdefault - Default value. Cannot be set when column is required.
2206
2206
  * @param {boolean} array - Is column an array?
2207
2207
  * @throws {AppwriteException}
2208
2208
  * @returns {Promise<Models.ColumnInteger>}
2209
2209
  * @deprecated Use the object parameter style method for a better developer experience.
2210
2210
  */
2211
- createIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.ColumnInteger>;
2211
+ createIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise<Models.ColumnInteger>;
2212
2212
  createIntegerColumn(
2213
- paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string,
2214
- ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?]
2213
+ paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string,
2214
+ ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?]
2215
2215
  ): Promise<Models.ColumnInteger> {
2216
- let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean };
2216
+ let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean };
2217
2217
 
2218
2218
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2219
- params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean };
2219
+ params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean };
2220
2220
  } else {
2221
2221
  params = {
2222
2222
  databaseId: paramsOrFirst as string,
2223
2223
  tableId: rest[0] as string,
2224
2224
  key: rest[1] as string,
2225
2225
  required: rest[2] as boolean,
2226
- min: rest[3] as number,
2227
- max: rest[4] as number,
2228
- xdefault: rest[5] as number,
2226
+ min: rest[3] as number | bigint,
2227
+ max: rest[4] as number | bigint,
2228
+ xdefault: rest[5] as number | bigint,
2229
2229
  array: rest[6] as boolean
2230
2230
  };
2231
2231
  }
@@ -2294,14 +2294,14 @@ export class TablesDB {
2294
2294
  * @param {string} params.tableId - Table ID.
2295
2295
  * @param {string} params.key - Column Key.
2296
2296
  * @param {boolean} params.required - Is column required?
2297
- * @param {number} params.xdefault - Default value. Cannot be set when column is required.
2298
- * @param {number} params.min - Minimum value
2299
- * @param {number} params.max - Maximum value
2297
+ * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required.
2298
+ * @param {number | bigint} params.min - Minimum value
2299
+ * @param {number | bigint} params.max - Maximum value
2300
2300
  * @param {string} params.newKey - New Column Key.
2301
2301
  * @throws {AppwriteException}
2302
2302
  * @returns {Promise<Models.ColumnInteger>}
2303
2303
  */
2304
- updateIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise<Models.ColumnInteger>;
2304
+ updateIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise<Models.ColumnInteger>;
2305
2305
  /**
2306
2306
  * Update an integer column. Changing the `default` value will not update already existing rows.
2307
2307
  *
@@ -2310,32 +2310,32 @@ export class TablesDB {
2310
2310
  * @param {string} tableId - Table ID.
2311
2311
  * @param {string} key - Column Key.
2312
2312
  * @param {boolean} required - Is column required?
2313
- * @param {number} xdefault - Default value. Cannot be set when column is required.
2314
- * @param {number} min - Minimum value
2315
- * @param {number} max - Maximum value
2313
+ * @param {number | bigint} xdefault - Default value. Cannot be set when column is required.
2314
+ * @param {number | bigint} min - Minimum value
2315
+ * @param {number | bigint} max - Maximum value
2316
2316
  * @param {string} newKey - New Column Key.
2317
2317
  * @throws {AppwriteException}
2318
2318
  * @returns {Promise<Models.ColumnInteger>}
2319
2319
  * @deprecated Use the object parameter style method for a better developer experience.
2320
2320
  */
2321
- updateIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.ColumnInteger>;
2321
+ updateIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise<Models.ColumnInteger>;
2322
2322
  updateIntegerColumn(
2323
- paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string,
2324
- ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?]
2323
+ paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string,
2324
+ ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?]
2325
2325
  ): Promise<Models.ColumnInteger> {
2326
- let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string };
2326
+ let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string };
2327
2327
 
2328
2328
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2329
- params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string };
2329
+ params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string };
2330
2330
  } else {
2331
2331
  params = {
2332
2332
  databaseId: paramsOrFirst as string,
2333
2333
  tableId: rest[0] as string,
2334
2334
  key: rest[1] as string,
2335
2335
  required: rest[2] as boolean,
2336
- xdefault: rest[3] as number,
2337
- min: rest[4] as number,
2338
- max: rest[5] as number,
2336
+ xdefault: rest[3] as number | bigint,
2337
+ min: rest[4] as number | bigint,
2338
+ max: rest[5] as number | bigint,
2339
2339
  newKey: rest[6] as string
2340
2340
  };
2341
2341
  }
package/types/client.d.ts CHANGED
@@ -95,8 +95,15 @@ declare class Client {
95
95
  config: {
96
96
  endpoint: string;
97
97
  endpointRealtime: string;
98
+ project: string;
99
+ key: string;
100
+ jwt: string;
101
+ locale: string;
102
+ mode: string;
103
+ cookie: string;
104
+ platform: string;
98
105
  selfSigned: boolean;
99
- [key: string]: string | boolean | undefined;
106
+ session?: string;
100
107
  };
101
108
  /**
102
109
  * Custom headers for API requests.
@@ -0,0 +1,17 @@
1
+ export declare enum BillingPlan {
2
+ Tier0 = "tier-0",
3
+ Tier1 = "tier-1",
4
+ Tier2 = "tier-2",
5
+ Imaginetier0 = "imagine-tier-0",
6
+ Imaginetier1 = "imagine-tier-1",
7
+ Imaginetier150 = "imagine-tier-1-50",
8
+ Imaginetier1100 = "imagine-tier-1-100",
9
+ Imaginetier1200 = "imagine-tier-1-200",
10
+ Imaginetier1290 = "imagine-tier-1-290",
11
+ Imaginetier1480 = "imagine-tier-1-480",
12
+ Imaginetier1700 = "imagine-tier-1-700",
13
+ Imaginetier1900 = "imagine-tier-1-900",
14
+ Imaginetier11100 = "imagine-tier-1-1100",
15
+ Imaginetier11650 = "imagine-tier-1-1650",
16
+ Imaginetier12200 = "imagine-tier-1-2200"
17
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum FilterType {
2
+ Premium = "premium",
3
+ Suggestion = "suggestion"
4
+ }
@@ -9,6 +9,7 @@ export declare enum Name {
9
9
  V1webhooks = "v1-webhooks",
10
10
  V1certificates = "v1-certificates",
11
11
  V1builds = "v1-builds",
12
+ V1screenshots = "v1-screenshots",
12
13
  V1messaging = "v1-messaging",
13
14
  V1migrations = "v1-migrations"
14
15
  }
@@ -38,8 +38,6 @@ export declare enum OAuthProvider {
38
38
  Yandex = "yandex",
39
39
  Zoho = "zoho",
40
40
  Zoom = "zoom",
41
- Mock = "mock",
42
- Mockunverified = "mock-unverified",
43
41
  GithubImagine = "githubImagine",
44
42
  GoogleImagine = "googleImagine"
45
43
  }
package/types/index.d.ts CHANGED
@@ -52,6 +52,7 @@ export { UsageRange } from './enums/usage-range';
52
52
  export { RelationshipType } from './enums/relationship-type';
53
53
  export { RelationMutate } from './enums/relation-mutate';
54
54
  export { IndexType } from './enums/index-type';
55
+ export { FilterType } from './enums/filter-type';
55
56
  export { Runtime } from './enums/runtime';
56
57
  export { TemplateReferenceType } from './enums/template-reference-type';
57
58
  export { VCSReferenceType } from './enums/vcs-reference-type';
@@ -60,6 +61,7 @@ export { ExecutionMethod } from './enums/execution-method';
60
61
  export { Name } from './enums/name';
61
62
  export { MessagePriority } from './enums/message-priority';
62
63
  export { SmtpEncryption } from './enums/smtp-encryption';
64
+ export { BillingPlan } from './enums/billing-plan';
63
65
  export { ProjectUsageRange } from './enums/project-usage-range';
64
66
  export { Region } from './enums/region';
65
67
  export { Api } from './enums/api';