@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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +474 -97
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +474 -97
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +474 -97
  7. package/docs/examples/databases/update-float-attribute.md +2 -2
  8. package/docs/examples/databases/update-integer-attribute.md +2 -2
  9. package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
  10. package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
  11. package/docs/examples/organizations/create.md +5 -1
  12. package/docs/examples/organizations/update-plan.md +5 -1
  13. package/package.json +1 -1
  14. package/src/client.ts +5 -3
  15. package/src/enums/credit-card.ts +1 -0
  16. package/src/enums/name.ts +3 -2
  17. package/src/enums/runtime.ts +3 -0
  18. package/src/models.ts +134 -1
  19. package/src/services/account.ts +122 -0
  20. package/src/services/assistant.ts +2 -0
  21. package/src/services/avatars.ts +7 -42
  22. package/src/services/backups.ts +24 -0
  23. package/src/services/console.ts +14 -0
  24. package/src/services/databases.ts +101 -16
  25. package/src/services/functions.ts +55 -6
  26. package/src/services/graphql.ts +4 -0
  27. package/src/services/health.ts +59 -34
  28. package/src/services/locale.ts +16 -0
  29. package/src/services/messaging.ts +95 -3
  30. package/src/services/migrations.ts +24 -0
  31. package/src/services/organizations.ts +90 -2
  32. package/src/services/project.ts +12 -0
  33. package/src/services/projects.ts +92 -0
  34. package/src/services/proxy.ts +10 -0
  35. package/src/services/storage.ts +27 -18
  36. package/src/services/teams.ts +28 -0
  37. package/src/services/users.ts +86 -0
  38. package/src/services/vcs.ts +20 -0
  39. package/types/enums/credit-card.d.ts +2 -1
  40. package/types/enums/name.d.ts +3 -2
  41. package/types/enums/runtime.d.ts +3 -0
  42. package/types/models.d.ts +134 -1
  43. package/types/services/databases.d.ts +5 -4
  44. package/types/services/health.d.ts +7 -16
  45. package/types/services/messaging.d.ts +3 -3
  46. package/types/services/organizations.d.ts +10 -2
  47. package/docs/examples/health/get-queue.md +0 -11
@@ -11,9 +11,9 @@ const result = await databases.updateFloatAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- null, // min
15
- null, // max
16
14
  null, // default
15
+ null, // min (optional)
16
+ null, // max (optional)
17
17
  '' // newKey (optional)
18
18
  );
19
19
 
@@ -11,9 +11,9 @@ const result = await databases.updateIntegerAttribute(
11
11
  '<COLLECTION_ID>', // collectionId
12
12
  '', // key
13
13
  false, // required
14
- null, // min
15
- null, // max
16
14
  null, // default
15
+ null, // min (optional)
16
+ null, // max (optional)
17
17
  '' // newKey (optional)
18
18
  );
19
19
 
@@ -6,7 +6,7 @@ const client = new Client()
6
6
 
7
7
  const health = new Health(client);
8
8
 
9
- const result = await health.getQueueUsageCount(
9
+ const result = await health.getQueueStatsResources(
10
10
  null // threshold (optional)
11
11
  );
12
12
 
@@ -6,7 +6,7 @@ const client = new Client()
6
6
 
7
7
  const health = new Health(client);
8
8
 
9
- const result = await health.getQueueUsageDump(
9
+ const result = await health.getQueueStatsUsageDump(
10
10
  null // threshold (optional)
11
11
  );
12
12
 
@@ -11,7 +11,11 @@ const result = await organizations.create(
11
11
  '<NAME>', // name
12
12
  .Tier0, // billingPlan
13
13
  '<PAYMENT_METHOD_ID>', // paymentMethodId (optional)
14
- '<BILLING_ADDRESS_ID>' // billingAddressId (optional)
14
+ '<BILLING_ADDRESS_ID>', // billingAddressId (optional)
15
+ [], // invites (optional)
16
+ '<COUPON_ID>', // couponId (optional)
17
+ '<TAX_ID>', // taxId (optional)
18
+ 0 // budget (optional)
15
19
  );
16
20
 
17
21
  console.log(result);
@@ -10,7 +10,11 @@ const result = await organizations.updatePlan(
10
10
  '<ORGANIZATION_ID>', // organizationId
11
11
  .Tier0, // billingPlan
12
12
  '<PAYMENT_METHOD_ID>', // paymentMethodId (optional)
13
- '<BILLING_ADDRESS_ID>' // billingAddressId (optional)
13
+ '<BILLING_ADDRESS_ID>', // billingAddressId (optional)
14
+ [], // invites (optional)
15
+ '<COUPON_ID>', // couponId (optional)
16
+ '<TAX_ID>', // taxId (optional)
17
+ 0 // budget (optional)
14
18
  );
15
19
 
16
20
  console.log(result);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.5.0",
5
+ "version": "1.5.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -19,14 +19,14 @@ type Headers = {
19
19
  */
20
20
  type RealtimeResponse = {
21
21
  /**
22
- * Type of the response: 'error', 'event', 'connected', 'pong', or 'response'.
22
+ * Type of the response: 'error', 'event', 'connected', 'response' or 'pong'.
23
23
  */
24
24
  type: 'error' | 'event' | 'connected' | 'response' | 'pong';
25
25
 
26
26
  /**
27
27
  * Data associated with the response based on the response type.
28
28
  */
29
- data: RealtimeResponseAuthenticated | RealtimeResponseConnected | RealtimeResponseError | RealtimeResponseEvent<unknown>;
29
+ data: RealtimeResponseAuthenticated | RealtimeResponseConnected | RealtimeResponseError | RealtimeResponseEvent<unknown> | undefined;
30
30
  }
31
31
 
32
32
  /**
@@ -316,7 +316,7 @@ class Client {
316
316
  'x-sdk-name': 'Console',
317
317
  'x-sdk-platform': 'console',
318
318
  'x-sdk-language': 'web',
319
- 'x-sdk-version': '1.5.0',
319
+ 'x-sdk-version': '1.5.2',
320
320
  'X-Appwrite-Response-Format': '1.6.0',
321
321
  };
322
322
 
@@ -544,6 +544,8 @@ class Client {
544
544
  })
545
545
  }
546
546
  break;
547
+ case 'pong':
548
+ break; // Handle pong response if needed
547
549
  case 'error':
548
550
  throw message.data;
549
551
  default:
@@ -15,4 +15,5 @@ export enum CreditCard {
15
15
  Visa = 'visa',
16
16
  MIR = 'mir',
17
17
  Maestro = 'maestro',
18
+ Rupay = 'rupay',
18
19
  }
package/src/enums/name.ts CHANGED
@@ -4,8 +4,9 @@ export enum Name {
4
4
  V1audits = 'v1-audits',
5
5
  V1mails = 'v1-mails',
6
6
  V1functions = 'v1-functions',
7
- V1usage = 'v1-usage',
8
- V1usagedump = 'v1-usage-dump',
7
+ V1statsresources = 'v1-stats-resources',
8
+ V1statsusage = 'v1-stats-usage',
9
+ V1statsusagedump = 'v1-stats-usage-dump',
9
10
  V1webhooks = 'v1-webhooks',
10
11
  V1certificates = 'v1-certificates',
11
12
  V1builds = 'v1-builds',
@@ -20,6 +20,9 @@ export enum Runtime {
20
20
  Python311 = 'python-3.11',
21
21
  Python312 = 'python-3.12',
22
22
  Pythonml311 = 'python-ml-3.11',
23
+ Deno121 = 'deno-1.21',
24
+ Deno124 = 'deno-1.24',
25
+ Deno135 = 'deno-1.35',
23
26
  Deno140 = 'deno-1.40',
24
27
  Deno146 = 'deno-1.46',
25
28
  Deno20 = 'deno-2.0',
package/src/models.ts CHANGED
@@ -3135,6 +3135,14 @@ export 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 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 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 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 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 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 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 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 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 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 namespace Models {
4380
4456
  /**
4381
4457
  * Additional resources
4382
4458
  */
4383
- addons: AdditionalResource;
4459
+ usage: AdditionalResource[];
4460
+ /**
4461
+ * Addons
4462
+ */
4463
+ addons: BillingPlanAddon[];
4384
4464
  /**
4385
4465
  * Custom SMTP
4386
4466
  */
@@ -4417,6 +4497,10 @@ export 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 namespace Models {
4426
4510
  */
4427
4511
  backupPolicies: number;
4428
4512
  }
4513
+ /**
4514
+ * BillingPlanAddon
4515
+ */
4516
+ export 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 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 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 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
  */