@appwrite.io/console 1.5.0 → 1.5.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/README.md +1 -1
- package/dist/cjs/sdk.js +474 -97
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +474 -97
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +474 -97
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
- package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
- package/docs/examples/organizations/create.md +5 -1
- package/docs/examples/organizations/update-plan.md +5 -1
- package/package.json +1 -1
- package/src/client.ts +5 -3
- package/src/enums/credit-card.ts +1 -0
- package/src/enums/name.ts +3 -2
- package/src/enums/runtime.ts +3 -0
- package/src/models.ts +134 -1
- package/src/services/account.ts +122 -0
- package/src/services/assistant.ts +2 -0
- package/src/services/avatars.ts +7 -42
- package/src/services/backups.ts +24 -0
- package/src/services/console.ts +14 -0
- package/src/services/databases.ts +101 -16
- package/src/services/functions.ts +55 -6
- package/src/services/graphql.ts +4 -0
- package/src/services/health.ts +59 -34
- package/src/services/locale.ts +16 -0
- package/src/services/messaging.ts +95 -3
- package/src/services/migrations.ts +24 -0
- package/src/services/organizations.ts +90 -2
- package/src/services/project.ts +12 -0
- package/src/services/projects.ts +92 -0
- package/src/services/proxy.ts +10 -0
- package/src/services/storage.ts +27 -18
- package/src/services/teams.ts +28 -0
- package/src/services/users.ts +86 -0
- package/src/services/vcs.ts +20 -0
- package/types/enums/credit-card.d.ts +2 -1
- package/types/enums/name.d.ts +3 -2
- package/types/enums/runtime.d.ts +3 -0
- package/types/models.d.ts +134 -1
- package/types/services/databases.d.ts +5 -4
- package/types/services/health.d.ts +7 -16
- package/types/services/messaging.d.ts +3 -3
- package/types/services/organizations.d.ts +10 -2
- package/docs/examples/health/get-queue.md +0 -11
package/types/models.d.ts
CHANGED
|
@@ -3135,6 +3135,14 @@ export declare namespace Models {
|
|
|
3135
3135
|
* Total aggregated number of total databases storage in bytes.
|
|
3136
3136
|
*/
|
|
3137
3137
|
storageTotal: number;
|
|
3138
|
+
/**
|
|
3139
|
+
* Total number of databases reads.
|
|
3140
|
+
*/
|
|
3141
|
+
databasesReadsTotal: number;
|
|
3142
|
+
/**
|
|
3143
|
+
* Total number of databases writes.
|
|
3144
|
+
*/
|
|
3145
|
+
databasesWritesTotal: number;
|
|
3138
3146
|
/**
|
|
3139
3147
|
* Aggregated number of databases per period.
|
|
3140
3148
|
*/
|
|
@@ -3151,6 +3159,14 @@ export declare namespace Models {
|
|
|
3151
3159
|
* An array of the aggregated number of databases storage in bytes per period.
|
|
3152
3160
|
*/
|
|
3153
3161
|
storage: Metric[];
|
|
3162
|
+
/**
|
|
3163
|
+
* An array of aggregated number of database reads.
|
|
3164
|
+
*/
|
|
3165
|
+
databasesReads: Metric[];
|
|
3166
|
+
/**
|
|
3167
|
+
* An array of aggregated number of database writes.
|
|
3168
|
+
*/
|
|
3169
|
+
databasesWrites: Metric[];
|
|
3154
3170
|
};
|
|
3155
3171
|
/**
|
|
3156
3172
|
* UsageDatabase
|
|
@@ -3172,6 +3188,14 @@ export declare namespace Models {
|
|
|
3172
3188
|
* Total aggregated number of total storage used in bytes.
|
|
3173
3189
|
*/
|
|
3174
3190
|
storageTotal: number;
|
|
3191
|
+
/**
|
|
3192
|
+
* Total number of databases reads.
|
|
3193
|
+
*/
|
|
3194
|
+
databaseReadsTotal: number;
|
|
3195
|
+
/**
|
|
3196
|
+
* Total number of databases writes.
|
|
3197
|
+
*/
|
|
3198
|
+
databaseWritesTotal: number;
|
|
3175
3199
|
/**
|
|
3176
3200
|
* Aggregated number of collections per period.
|
|
3177
3201
|
*/
|
|
@@ -3184,6 +3208,14 @@ export declare namespace Models {
|
|
|
3184
3208
|
* Aggregated storage used in bytes per period.
|
|
3185
3209
|
*/
|
|
3186
3210
|
storage: Metric[];
|
|
3211
|
+
/**
|
|
3212
|
+
* An array of aggregated number of database reads.
|
|
3213
|
+
*/
|
|
3214
|
+
databaseReads: Metric[];
|
|
3215
|
+
/**
|
|
3216
|
+
* An array of aggregated number of database writes.
|
|
3217
|
+
*/
|
|
3218
|
+
databaseWrites: Metric[];
|
|
3187
3219
|
};
|
|
3188
3220
|
/**
|
|
3189
3221
|
* UsageCollection
|
|
@@ -3284,6 +3316,14 @@ export declare namespace Models {
|
|
|
3284
3316
|
* Aggregated number of bucket storage files (in bytes) per period.
|
|
3285
3317
|
*/
|
|
3286
3318
|
storage: Metric[];
|
|
3319
|
+
/**
|
|
3320
|
+
* Aggregated number of files transformations per period.
|
|
3321
|
+
*/
|
|
3322
|
+
imageTransformations: Metric[];
|
|
3323
|
+
/**
|
|
3324
|
+
* Total aggregated number of files transformations.
|
|
3325
|
+
*/
|
|
3326
|
+
imageTransformationsTotal: number;
|
|
3287
3327
|
};
|
|
3288
3328
|
/**
|
|
3289
3329
|
* UsageFunctions
|
|
@@ -3507,6 +3547,14 @@ export declare namespace Models {
|
|
|
3507
3547
|
* Total aggregated number of function builds mbSeconds.
|
|
3508
3548
|
*/
|
|
3509
3549
|
buildsMbSecondsTotal: number;
|
|
3550
|
+
/**
|
|
3551
|
+
* Total number of databases reads.
|
|
3552
|
+
*/
|
|
3553
|
+
databasesReadsTotal: number;
|
|
3554
|
+
/**
|
|
3555
|
+
* Total number of databases writes.
|
|
3556
|
+
*/
|
|
3557
|
+
databasesWritesTotal: number;
|
|
3510
3558
|
/**
|
|
3511
3559
|
* Aggregated number of requests per period.
|
|
3512
3560
|
*/
|
|
@@ -3559,6 +3607,22 @@ export declare namespace Models {
|
|
|
3559
3607
|
* Aggregated breakdown in totals of phone auth by country.
|
|
3560
3608
|
*/
|
|
3561
3609
|
authPhoneCountryBreakdown: MetricBreakdown[];
|
|
3610
|
+
/**
|
|
3611
|
+
* An array of aggregated number of database reads.
|
|
3612
|
+
*/
|
|
3613
|
+
databasesReads: Metric[];
|
|
3614
|
+
/**
|
|
3615
|
+
* An array of aggregated number of database writes.
|
|
3616
|
+
*/
|
|
3617
|
+
databasesWrites: Metric[];
|
|
3618
|
+
/**
|
|
3619
|
+
* An array of aggregated number of image transformations.
|
|
3620
|
+
*/
|
|
3621
|
+
imageTransformations: Metric[];
|
|
3622
|
+
/**
|
|
3623
|
+
* Total aggregated number of image transformations.
|
|
3624
|
+
*/
|
|
3625
|
+
imageTransformationsTotal: number;
|
|
3562
3626
|
};
|
|
3563
3627
|
/**
|
|
3564
3628
|
* Headers
|
|
@@ -4206,6 +4270,10 @@ export declare namespace Models {
|
|
|
4206
4270
|
* Additional realtime usage cost
|
|
4207
4271
|
*/
|
|
4208
4272
|
additionalRealtimeAmount: number;
|
|
4273
|
+
/**
|
|
4274
|
+
* Billing plan
|
|
4275
|
+
*/
|
|
4276
|
+
plan: string;
|
|
4209
4277
|
/**
|
|
4210
4278
|
* Aggregated amount
|
|
4211
4279
|
*/
|
|
@@ -4309,6 +4377,10 @@ export declare namespace Models {
|
|
|
4309
4377
|
* Plan name
|
|
4310
4378
|
*/
|
|
4311
4379
|
name: string;
|
|
4380
|
+
/**
|
|
4381
|
+
* Plan description
|
|
4382
|
+
*/
|
|
4383
|
+
desc: string;
|
|
4312
4384
|
/**
|
|
4313
4385
|
* Plan order
|
|
4314
4386
|
*/
|
|
@@ -4329,6 +4401,10 @@ export declare namespace Models {
|
|
|
4329
4401
|
* Storage
|
|
4330
4402
|
*/
|
|
4331
4403
|
storage: number;
|
|
4404
|
+
/**
|
|
4405
|
+
* Image Transformations
|
|
4406
|
+
*/
|
|
4407
|
+
imageTransformations: number;
|
|
4332
4408
|
/**
|
|
4333
4409
|
* Members
|
|
4334
4410
|
*/
|
|
@@ -4380,7 +4456,11 @@ export declare namespace Models {
|
|
|
4380
4456
|
/**
|
|
4381
4457
|
* Additional resources
|
|
4382
4458
|
*/
|
|
4383
|
-
|
|
4459
|
+
usage: AdditionalResource[];
|
|
4460
|
+
/**
|
|
4461
|
+
* Addons
|
|
4462
|
+
*/
|
|
4463
|
+
addons: BillingPlanAddon[];
|
|
4384
4464
|
/**
|
|
4385
4465
|
* Custom SMTP
|
|
4386
4466
|
*/
|
|
@@ -4417,6 +4497,10 @@ export declare namespace Models {
|
|
|
4417
4497
|
* Does plan support mock numbers
|
|
4418
4498
|
*/
|
|
4419
4499
|
supportsMockNumbers: boolean;
|
|
4500
|
+
/**
|
|
4501
|
+
* Does plan support credit
|
|
4502
|
+
*/
|
|
4503
|
+
supportsCredits: boolean;
|
|
4420
4504
|
/**
|
|
4421
4505
|
* Does plan support backup policies.
|
|
4422
4506
|
*/
|
|
@@ -4426,6 +4510,35 @@ export declare namespace Models {
|
|
|
4426
4510
|
*/
|
|
4427
4511
|
backupPolicies: number;
|
|
4428
4512
|
};
|
|
4513
|
+
/**
|
|
4514
|
+
* BillingPlanAddon
|
|
4515
|
+
*/
|
|
4516
|
+
type BillingPlanAddon = {
|
|
4517
|
+
/**
|
|
4518
|
+
* Is the addon supported in the plan?
|
|
4519
|
+
*/
|
|
4520
|
+
supported: boolean;
|
|
4521
|
+
/**
|
|
4522
|
+
* Addon limit
|
|
4523
|
+
*/
|
|
4524
|
+
limit: number;
|
|
4525
|
+
/**
|
|
4526
|
+
* Addon type
|
|
4527
|
+
*/
|
|
4528
|
+
type: string;
|
|
4529
|
+
/**
|
|
4530
|
+
* Price currency
|
|
4531
|
+
*/
|
|
4532
|
+
currency: string;
|
|
4533
|
+
/**
|
|
4534
|
+
* Price
|
|
4535
|
+
*/
|
|
4536
|
+
price: number;
|
|
4537
|
+
/**
|
|
4538
|
+
* Resource value
|
|
4539
|
+
*/
|
|
4540
|
+
value: number;
|
|
4541
|
+
};
|
|
4429
4542
|
/**
|
|
4430
4543
|
* Campaign
|
|
4431
4544
|
*/
|
|
@@ -4739,6 +4852,10 @@ export declare namespace Models {
|
|
|
4739
4852
|
* Current active aggregation id.
|
|
4740
4853
|
*/
|
|
4741
4854
|
billingAggregationId: string;
|
|
4855
|
+
/**
|
|
4856
|
+
* Current active aggregation id.
|
|
4857
|
+
*/
|
|
4858
|
+
billingInvoiceId: string;
|
|
4742
4859
|
/**
|
|
4743
4860
|
* Default payment method.
|
|
4744
4861
|
*/
|
|
@@ -4751,6 +4868,14 @@ export declare namespace Models {
|
|
|
4751
4868
|
* Backup payment method.
|
|
4752
4869
|
*/
|
|
4753
4870
|
backupPaymentMethodId: string;
|
|
4871
|
+
/**
|
|
4872
|
+
* Team status.
|
|
4873
|
+
*/
|
|
4874
|
+
status: string;
|
|
4875
|
+
/**
|
|
4876
|
+
* Remarks on team status.
|
|
4877
|
+
*/
|
|
4878
|
+
remarks: string;
|
|
4754
4879
|
/**
|
|
4755
4880
|
* Organization agreements
|
|
4756
4881
|
*/
|
|
@@ -5050,6 +5175,14 @@ export declare namespace Models {
|
|
|
5050
5175
|
* Aggregated stats for database writes.
|
|
5051
5176
|
*/
|
|
5052
5177
|
databasesWrites: Metric[];
|
|
5178
|
+
/**
|
|
5179
|
+
* Aggregated stats for file transformations.
|
|
5180
|
+
*/
|
|
5181
|
+
imageTransformations: Metric[];
|
|
5182
|
+
/**
|
|
5183
|
+
* Aggregated stats for total file transformations.
|
|
5184
|
+
*/
|
|
5185
|
+
imageTransformationsTotal: number;
|
|
5053
5186
|
/**
|
|
5054
5187
|
* Aggregated stats for total users.
|
|
5055
5188
|
*/
|
|
@@ -304,14 +304,14 @@ export declare class Databases {
|
|
|
304
304
|
* @param {string} collectionId
|
|
305
305
|
* @param {string} key
|
|
306
306
|
* @param {boolean} required
|
|
307
|
+
* @param {number} xdefault
|
|
307
308
|
* @param {number} min
|
|
308
309
|
* @param {number} max
|
|
309
|
-
* @param {number} xdefault
|
|
310
310
|
* @param {string} newKey
|
|
311
311
|
* @throws {AppwriteException}
|
|
312
312
|
* @returns {Promise<Models.AttributeFloat>}
|
|
313
313
|
*/
|
|
314
|
-
updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean,
|
|
314
|
+
updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat>;
|
|
315
315
|
/**
|
|
316
316
|
* Create integer attribute
|
|
317
317
|
*
|
|
@@ -340,14 +340,14 @@ export declare class Databases {
|
|
|
340
340
|
* @param {string} collectionId
|
|
341
341
|
* @param {string} key
|
|
342
342
|
* @param {boolean} required
|
|
343
|
+
* @param {number} xdefault
|
|
343
344
|
* @param {number} min
|
|
344
345
|
* @param {number} max
|
|
345
|
-
* @param {number} xdefault
|
|
346
346
|
* @param {string} newKey
|
|
347
347
|
* @throws {AppwriteException}
|
|
348
348
|
* @returns {Promise<Models.AttributeInteger>}
|
|
349
349
|
*/
|
|
350
|
-
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean,
|
|
350
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
|
|
351
351
|
/**
|
|
352
352
|
* Create IP address attribute
|
|
353
353
|
*
|
|
@@ -520,6 +520,7 @@ export declare class Databases {
|
|
|
520
520
|
* Create document
|
|
521
521
|
*
|
|
522
522
|
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
523
|
+
|
|
523
524
|
*
|
|
524
525
|
* @param {string} databaseId
|
|
525
526
|
* @param {string} collectionId
|
|
@@ -59,15 +59,6 @@ export declare class Health {
|
|
|
59
59
|
* @returns {Promise<Models.HealthStatus>}
|
|
60
60
|
*/
|
|
61
61
|
getPubSub(): Promise<Models.HealthStatus>;
|
|
62
|
-
/**
|
|
63
|
-
* Get queue
|
|
64
|
-
*
|
|
65
|
-
* Check the Appwrite queue messaging servers are up and connection is successful.
|
|
66
|
-
*
|
|
67
|
-
* @throws {AppwriteException}
|
|
68
|
-
* @returns {Promise<Models.HealthStatus>}
|
|
69
|
-
*/
|
|
70
|
-
getQueue(): Promise<Models.HealthStatus>;
|
|
71
62
|
/**
|
|
72
63
|
* Get billing aggregation queue
|
|
73
64
|
*
|
|
@@ -192,25 +183,25 @@ export declare class Health {
|
|
|
192
183
|
*/
|
|
193
184
|
getQueueMigrations(threshold?: number): Promise<Models.HealthQueue>;
|
|
194
185
|
/**
|
|
195
|
-
* Get
|
|
186
|
+
* Get stats resources queue
|
|
196
187
|
*
|
|
197
|
-
* Get the number of metrics that are waiting to be processed in the Appwrite
|
|
188
|
+
* Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
|
|
198
189
|
*
|
|
199
190
|
* @param {number} threshold
|
|
200
191
|
* @throws {AppwriteException}
|
|
201
192
|
* @returns {Promise<Models.HealthQueue>}
|
|
202
193
|
*/
|
|
203
|
-
|
|
194
|
+
getQueueStatsResources(threshold?: number): Promise<Models.HealthQueue>;
|
|
204
195
|
/**
|
|
205
|
-
* Get usage
|
|
196
|
+
* Get stats usage queue
|
|
206
197
|
*
|
|
207
|
-
* Get the
|
|
198
|
+
* Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
|
|
208
199
|
*
|
|
209
200
|
* @param {number} threshold
|
|
210
201
|
* @throws {AppwriteException}
|
|
211
202
|
* @returns {Promise<Models.HealthQueue>}
|
|
212
203
|
*/
|
|
213
|
-
|
|
204
|
+
getQueueUsage(threshold?: number): Promise<Models.HealthQueue>;
|
|
214
205
|
/**
|
|
215
206
|
* Get usage dump queue
|
|
216
207
|
*
|
|
@@ -220,7 +211,7 @@ export declare class Health {
|
|
|
220
211
|
* @throws {AppwriteException}
|
|
221
212
|
* @returns {Promise<Models.HealthQueue>}
|
|
222
213
|
*/
|
|
223
|
-
|
|
214
|
+
getQueueStatsUsageDump(threshold?: number): Promise<Models.HealthQueue>;
|
|
224
215
|
/**
|
|
225
216
|
* Get webhooks queue
|
|
226
217
|
*
|
|
@@ -40,7 +40,7 @@ export declare class Messaging {
|
|
|
40
40
|
/**
|
|
41
41
|
* Update email
|
|
42
42
|
*
|
|
43
|
-
* Update an email message by its unique ID.
|
|
43
|
+
* Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
44
44
|
|
|
45
45
|
*
|
|
46
46
|
* @param {string} messageId
|
|
@@ -90,7 +90,7 @@ export declare class Messaging {
|
|
|
90
90
|
/**
|
|
91
91
|
* Update push notification
|
|
92
92
|
*
|
|
93
|
-
* Update a push notification by its unique ID.
|
|
93
|
+
* Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
94
94
|
|
|
95
95
|
*
|
|
96
96
|
* @param {string} messageId
|
|
@@ -135,7 +135,7 @@ export declare class Messaging {
|
|
|
135
135
|
/**
|
|
136
136
|
* Update SMS
|
|
137
137
|
*
|
|
138
|
-
* Update an SMS message by its unique ID.
|
|
138
|
+
* Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
139
139
|
|
|
140
140
|
*
|
|
141
141
|
* @param {string} messageId
|
|
@@ -26,10 +26,14 @@ export declare class Organizations {
|
|
|
26
26
|
* @param {BillingPlan} billingPlan
|
|
27
27
|
* @param {string} paymentMethodId
|
|
28
28
|
* @param {string} billingAddressId
|
|
29
|
+
* @param {string[]} invites
|
|
30
|
+
* @param {string} couponId
|
|
31
|
+
* @param {string} taxId
|
|
32
|
+
* @param {number} budget
|
|
29
33
|
* @throws {AppwriteException}
|
|
30
34
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
31
35
|
*/
|
|
32
|
-
create<Preferences extends Models.Preferences>(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise<Models.Organization<Preferences>>;
|
|
36
|
+
create<Preferences extends Models.Preferences>(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>>;
|
|
33
37
|
/**
|
|
34
38
|
* Delete team
|
|
35
39
|
*
|
|
@@ -280,10 +284,14 @@ export declare class Organizations {
|
|
|
280
284
|
* @param {BillingPlan} billingPlan
|
|
281
285
|
* @param {string} paymentMethodId
|
|
282
286
|
* @param {string} billingAddressId
|
|
287
|
+
* @param {string[]} invites
|
|
288
|
+
* @param {string} couponId
|
|
289
|
+
* @param {string} taxId
|
|
290
|
+
* @param {number} budget
|
|
283
291
|
* @throws {AppwriteException}
|
|
284
292
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
285
293
|
*/
|
|
286
|
-
updatePlan<Preferences extends Models.Preferences>(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise<Models.Organization<Preferences>>;
|
|
294
|
+
updatePlan<Preferences extends Models.Preferences>(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>>;
|
|
287
295
|
/**
|
|
288
296
|
* Get Scopes
|
|
289
297
|
*
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Client, Health } from "@appwrite.io/console";
|
|
2
|
-
|
|
3
|
-
const client = new Client()
|
|
4
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
|
-
|
|
7
|
-
const health = new Health(client);
|
|
8
|
-
|
|
9
|
-
const result = await health.getQueue();
|
|
10
|
-
|
|
11
|
-
console.log(result);
|