@appwrite.io/console 1.4.6 → 1.5.0

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 (51) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +218 -18
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +219 -19
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +218 -18
  7. package/docs/examples/health/get-queue-usage-count.md +13 -0
  8. package/docs/examples/messaging/create-push.md +8 -5
  9. package/docs/examples/messaging/update-push.md +5 -2
  10. package/package.json +1 -1
  11. package/src/client.ts +1 -1
  12. package/src/enums/image-format.ts +1 -0
  13. package/src/enums/message-priority.ts +4 -0
  14. package/src/index.ts +1 -0
  15. package/src/models.ts +16 -0
  16. package/src/services/account.ts +19 -2
  17. package/src/services/assistant.ts +1 -0
  18. package/src/services/backups.ts +14 -2
  19. package/src/services/console.ts +8 -2
  20. package/src/services/databases.ts +3 -0
  21. package/src/services/functions.ts +4 -0
  22. package/src/services/health.ts +31 -0
  23. package/src/services/messaging.ts +29 -10
  24. package/src/services/migrations.ts +12 -0
  25. package/src/services/organizations.ts +30 -2
  26. package/src/services/project.ts +1 -0
  27. package/src/services/projects.ts +48 -2
  28. package/src/services/proxy.ts +1 -0
  29. package/src/services/storage.ts +4 -0
  30. package/src/services/users.ts +4 -2
  31. package/src/services/vcs.ts +13 -0
  32. package/types/enums/image-format.d.ts +1 -0
  33. package/types/enums/message-priority.d.ts +4 -0
  34. package/types/index.d.ts +1 -0
  35. package/types/models.d.ts +16 -0
  36. package/types/services/account.d.ts +19 -2
  37. package/types/services/assistant.d.ts +1 -0
  38. package/types/services/backups.d.ts +14 -2
  39. package/types/services/console.d.ts +8 -2
  40. package/types/services/databases.d.ts +3 -0
  41. package/types/services/functions.d.ts +4 -0
  42. package/types/services/health.d.ts +12 -0
  43. package/types/services/messaging.d.ts +11 -4
  44. package/types/services/migrations.d.ts +12 -0
  45. package/types/services/organizations.d.ts +30 -2
  46. package/types/services/project.d.ts +1 -0
  47. package/types/services/projects.d.ts +48 -2
  48. package/types/services/proxy.d.ts +1 -0
  49. package/types/services/storage.d.ts +4 -0
  50. package/types/services/users.d.ts +4 -2
  51. package/types/services/vcs.d.ts +13 -0
@@ -0,0 +1,13 @@
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.getQueueUsageCount(
10
+ null // threshold (optional)
11
+ );
12
+
13
+ console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Messaging } from "@appwrite.io/console";
1
+ import { Client, Messaging, MessagePriority } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,8 +8,8 @@ const messaging = new Messaging(client);
8
8
 
9
9
  const result = await messaging.createPush(
10
10
  '<MESSAGE_ID>', // messageId
11
- '<TITLE>', // title
12
- '<BODY>', // body
11
+ '<TITLE>', // title (optional)
12
+ '<BODY>', // body (optional)
13
13
  [], // topics (optional)
14
14
  [], // users (optional)
15
15
  [], // targets (optional)
@@ -20,9 +20,12 @@ const result = await messaging.createPush(
20
20
  '<SOUND>', // sound (optional)
21
21
  '<COLOR>', // color (optional)
22
22
  '<TAG>', // tag (optional)
23
- '<BADGE>', // badge (optional)
23
+ null, // badge (optional)
24
24
  false, // draft (optional)
25
- '' // scheduledAt (optional)
25
+ '', // scheduledAt (optional)
26
+ false, // contentAvailable (optional)
27
+ false, // critical (optional)
28
+ MessagePriority.Normal // priority (optional)
26
29
  );
27
30
 
28
31
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Messaging } from "@appwrite.io/console";
1
+ import { Client, Messaging, MessagePriority } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -22,7 +22,10 @@ const result = await messaging.updatePush(
22
22
  '<TAG>', // tag (optional)
23
23
  null, // badge (optional)
24
24
  false, // draft (optional)
25
- '' // scheduledAt (optional)
25
+ '', // scheduledAt (optional)
26
+ false, // contentAvailable (optional)
27
+ false, // critical (optional)
28
+ MessagePriority.Normal // priority (optional)
26
29
  );
27
30
 
28
31
  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.4.6",
5
+ "version": "1.5.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -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.4.6',
319
+ 'x-sdk-version': '1.5.0',
320
320
  'X-Appwrite-Response-Format': '1.6.0',
321
321
  };
322
322
 
@@ -4,5 +4,6 @@ export enum ImageFormat {
4
4
  Gif = 'gif',
5
5
  Png = 'png',
6
6
  Webp = 'webp',
7
+ Heic = 'heic',
7
8
  Avif = 'avif',
8
9
  }
@@ -0,0 +1,4 @@
1
+ export enum MessagePriority {
2
+ Normal = 'normal',
3
+ High = 'high',
4
+ }
package/src/index.ts CHANGED
@@ -45,6 +45,7 @@ export { Runtime } from './enums/runtime';
45
45
  export { FunctionUsageRange } from './enums/function-usage-range';
46
46
  export { ExecutionMethod } from './enums/execution-method';
47
47
  export { Name } from './enums/name';
48
+ export { MessagePriority } from './enums/message-priority';
48
49
  export { SmtpEncryption } from './enums/smtp-encryption';
49
50
  export { BillingPlan } from './enums/billing-plan';
50
51
  export { ProjectUsageRange } from './enums/project-usage-range';
package/src/models.ts CHANGED
@@ -5042,6 +5042,14 @@ export namespace Models {
5042
5042
  * Aggregated stats for function executions.
5043
5043
  */
5044
5044
  executions: Metric[];
5045
+ /**
5046
+ * Aggregated stats for database reads.
5047
+ */
5048
+ databasesReads: Metric[];
5049
+ /**
5050
+ * Aggregated stats for database writes.
5051
+ */
5052
+ databasesWrites: Metric[];
5045
5053
  /**
5046
5054
  * Aggregated stats for total users.
5047
5055
  */
@@ -5074,6 +5082,14 @@ export namespace Models {
5074
5082
  * Aggregated stats for total databases storage.
5075
5083
  */
5076
5084
  databasesStorageTotal: number;
5085
+ /**
5086
+ * Aggregated stats for total databases storage reads.
5087
+ */
5088
+ databasesReadsTotal: number;
5089
+ /**
5090
+ * Aggregated stats for total databases storage writes.
5091
+ */
5092
+ databasesWritesTotal: number;
5077
5093
  /**
5078
5094
  * Aggregated stats for total backups storage.
5079
5095
  */
@@ -115,6 +115,7 @@ export class Account {
115
115
  /**
116
116
  * List billing addresses
117
117
  *
118
+ * List all billing addresses for a user.
118
119
  *
119
120
  * @param {string[]} queries
120
121
  * @throws {AppwriteException}
@@ -143,6 +144,7 @@ export class Account {
143
144
  /**
144
145
  * Create new billing address
145
146
  *
147
+ * Add a new billing address to a user&#039;s account.
146
148
  *
147
149
  * @param {string} country
148
150
  * @param {string} streetAddress
@@ -203,6 +205,7 @@ export class Account {
203
205
  /**
204
206
  * Get billing address
205
207
  *
208
+ * Get a specific billing address for a user using it&#039;s ID.
206
209
  *
207
210
  * @param {string} billingAddressId
208
211
  * @throws {AppwriteException}
@@ -231,6 +234,7 @@ export class Account {
231
234
  /**
232
235
  * Update billing address
233
236
  *
237
+ * Update a specific billing address using it&#039;s ID.
234
238
  *
235
239
  * @param {string} billingAddressId
236
240
  * @param {string} country
@@ -295,6 +299,7 @@ export class Account {
295
299
  /**
296
300
  * Delete billing address
297
301
  *
302
+ * Delete a specific billing address using it&#039;s ID.
298
303
  *
299
304
  * @param {string} billingAddressId
300
305
  * @throws {AppwriteException}
@@ -323,6 +328,7 @@ export class Account {
323
328
  /**
324
329
  * Get coupon details
325
330
  *
331
+ * Get coupon details for an account.
326
332
  *
327
333
  * @param {string} couponId
328
334
  * @throws {AppwriteException}
@@ -450,6 +456,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
450
456
  /**
451
457
  * List invoices
452
458
  *
459
+ * List all invoices tied to an account.
453
460
  *
454
461
  * @param {string[]} queries
455
462
  * @throws {AppwriteException}
@@ -695,9 +702,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
695
702
  * @param {string} challengeId
696
703
  * @param {string} otp
697
704
  * @throws {AppwriteException}
698
- * @returns {Promise<{}>}
705
+ * @returns {Promise<Models.Session>}
699
706
  */
700
- async updateMfaChallenge(challengeId: string, otp: string): Promise<{}> {
707
+ async updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> {
701
708
  if (typeof challengeId === 'undefined') {
702
709
  throw new AppwriteException('Missing required parameter: "challengeId"');
703
710
  }
@@ -897,6 +904,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
897
904
  /**
898
905
  * List payment methods
899
906
  *
907
+ * List payment methods for this account.
900
908
  *
901
909
  * @param {string[]} queries
902
910
  * @throws {AppwriteException}
@@ -925,6 +933,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
925
933
  /**
926
934
  * Create new payment method
927
935
  *
936
+ * Create a new payment method for the current user account.
928
937
  *
929
938
  * @throws {AppwriteException}
930
939
  * @returns {Promise<Models.PaymentMethod>}
@@ -949,6 +958,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
949
958
  /**
950
959
  * Get payment method
951
960
  *
961
+ * Get a specific payment method for the user.
952
962
  *
953
963
  * @param {string} paymentMethodId
954
964
  * @throws {AppwriteException}
@@ -977,6 +987,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
977
987
  /**
978
988
  * Update payment method
979
989
  *
990
+ * Update a new payment method for the current user account.
980
991
  *
981
992
  * @param {string} paymentMethodId
982
993
  * @param {number} expiryMonth
@@ -1019,6 +1030,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
1019
1030
  /**
1020
1031
  * Delete payment method
1021
1032
  *
1033
+ * Delete a specific payment method from a user&#039;s account.
1022
1034
  *
1023
1035
  * @param {string} paymentMethodId
1024
1036
  * @throws {AppwriteException}
@@ -1047,6 +1059,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
1047
1059
  /**
1048
1060
  * Update payment method provider id
1049
1061
  *
1062
+ * Update payment method provider.
1050
1063
  *
1051
1064
  * @param {string} paymentMethodId
1052
1065
  * @param {string} providerMethodId
@@ -1089,6 +1102,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
1089
1102
  /**
1090
1103
  * Update payment method with new setup with mandates for indian cards
1091
1104
  *
1105
+ * Update payment method mandate options.
1092
1106
  *
1093
1107
  * @param {string} paymentMethodId
1094
1108
  * @throws {AppwriteException}
@@ -1695,6 +1709,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
1695
1709
  /**
1696
1710
  * Create push target
1697
1711
  *
1712
+ * Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.
1698
1713
  *
1699
1714
  * @param {string} targetId
1700
1715
  * @param {string} identifier
@@ -1737,6 +1752,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
1737
1752
  /**
1738
1753
  * Update push target
1739
1754
  *
1755
+ * Update the currently logged in user&#039;s push notification target. You can modify the target&#039;s identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
1740
1756
  *
1741
1757
  * @param {string} targetId
1742
1758
  * @param {string} identifier
@@ -1772,6 +1788,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
1772
1788
  /**
1773
1789
  * Delete push target
1774
1790
  *
1791
+ * Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
1775
1792
  *
1776
1793
  * @param {string} targetId
1777
1794
  * @throws {AppwriteException}
@@ -12,6 +12,7 @@ export class Assistant {
12
12
  /**
13
13
  * Ask query
14
14
  *
15
+ * Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite&#039;s AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
15
16
  *
16
17
  * @param {string} prompt
17
18
  * @throws {AppwriteException}
@@ -12,6 +12,7 @@ export class Backups {
12
12
  /**
13
13
  * List archives
14
14
  *
15
+ * List all archives for a project.
15
16
  *
16
17
  * @param {string[]} queries
17
18
  * @throws {AppwriteException}
@@ -40,6 +41,7 @@ export class Backups {
40
41
  /**
41
42
  * Create archive
42
43
  *
44
+ * Create a new archive asynchronously for a project.
43
45
  *
44
46
  * @param {string[]} services
45
47
  * @param {string} resourceId
@@ -75,6 +77,7 @@ export class Backups {
75
77
  /**
76
78
  * Get backup archive
77
79
  *
80
+ * Get a backup archive using it&#039;s ID.
78
81
  *
79
82
  * @param {string} archiveId
80
83
  * @throws {AppwriteException}
@@ -103,6 +106,7 @@ export class Backups {
103
106
  /**
104
107
  * Delete archive
105
108
  *
109
+ * Delete an existing archive for a project.
106
110
  *
107
111
  * @param {string} archiveId
108
112
  * @throws {AppwriteException}
@@ -131,6 +135,7 @@ export class Backups {
131
135
  /**
132
136
  * List backup policies
133
137
  *
138
+ * List all policies for a project.
134
139
  *
135
140
  * @param {string[]} queries
136
141
  * @throws {AppwriteException}
@@ -159,6 +164,7 @@ export class Backups {
159
164
  /**
160
165
  * Create backup policy
161
166
  *
167
+ * Create a new backup policy.
162
168
  *
163
169
  * @param {string} policyId
164
170
  * @param {string[]} services
@@ -223,6 +229,7 @@ export class Backups {
223
229
  /**
224
230
  * Get backup policy
225
231
  *
232
+ * Get a backup policy using it&#039;s ID.
226
233
  *
227
234
  * @param {string} policyId
228
235
  * @throws {AppwriteException}
@@ -251,6 +258,7 @@ export class Backups {
251
258
  /**
252
259
  * Update backup policy
253
260
  *
261
+ * Update an existing policy using it&#039;s ID.
254
262
  *
255
263
  * @param {string} policyId
256
264
  * @param {string} name
@@ -295,6 +303,7 @@ export class Backups {
295
303
  /**
296
304
  * Delete backup policy
297
305
  *
306
+ * Delete a policy using it&#039;s ID.
298
307
  *
299
308
  * @param {string} policyId
300
309
  * @throws {AppwriteException}
@@ -323,6 +332,7 @@ export class Backups {
323
332
  /**
324
333
  * Create restoration
325
334
  *
335
+ * Create and trigger a new restoration for a backup on a project.
326
336
  *
327
337
  * @param {string} archiveId
328
338
  * @param {string[]} services
@@ -369,6 +379,7 @@ export class Backups {
369
379
  /**
370
380
  * List restorations
371
381
  *
382
+ * List all backup restorations for a project.
372
383
  *
373
384
  * @param {string[]} queries
374
385
  * @throws {AppwriteException}
@@ -397,12 +408,13 @@ export class Backups {
397
408
  /**
398
409
  * Get backup restoration
399
410
  *
411
+ * Get the current status of a backup restoration.
400
412
  *
401
413
  * @param {string} restorationId
402
414
  * @throws {AppwriteException}
403
- * @returns {Promise<Models.BackupArchive>}
415
+ * @returns {Promise<Models.BackupRestoration>}
404
416
  */
405
- async getRestoration(restorationId: string): Promise<Models.BackupArchive> {
417
+ async getRestoration(restorationId: string): Promise<Models.BackupRestoration> {
406
418
  if (typeof restorationId === 'undefined') {
407
419
  throw new AppwriteException('Missing required parameter: "restorationId"');
408
420
  }
@@ -12,6 +12,7 @@ export class Console {
12
12
  /**
13
13
  * Get campaign details
14
14
  *
15
+ * Recieve the details of a compaign using it&#039;s ID.
15
16
  *
16
17
  * @param {string} campaignId
17
18
  * @throws {AppwriteException}
@@ -40,6 +41,7 @@ export class Console {
40
41
  /**
41
42
  * Get coupon details
42
43
  *
44
+ * Get the details of a coupon using it&#039;s coupon ID.
43
45
  *
44
46
  * @param {string} couponId
45
47
  * @throws {AppwriteException}
@@ -68,6 +70,7 @@ export class Console {
68
70
  /**
69
71
  * Get plans
70
72
  *
73
+ * Return a list of all available plans.
71
74
  *
72
75
  * @throws {AppwriteException}
73
76
  * @returns {Promise<Models.BillingPlanList>}
@@ -92,12 +95,13 @@ export class Console {
92
95
  /**
93
96
  * Create program membership
94
97
  *
98
+ * Create a new membership for an account to a program.
95
99
  *
96
100
  * @param {string} programId
97
101
  * @throws {AppwriteException}
98
- * @returns {Promise<{}>}
102
+ * @returns {Promise<Models.Organization<Preferences>>}
99
103
  */
100
- async createProgramMembership(programId: string): Promise<{}> {
104
+ async createProgramMembership<Preferences extends Models.Preferences>(programId: string): Promise<Models.Organization<Preferences>> {
101
105
  if (typeof programId === 'undefined') {
102
106
  throw new AppwriteException('Missing required parameter: "programId"');
103
107
  }
@@ -120,6 +124,7 @@ export class Console {
120
124
  /**
121
125
  * Get Regions
122
126
  *
127
+ * Get all available regions for the console.
123
128
  *
124
129
  * @throws {AppwriteException}
125
130
  * @returns {Promise<Models.ConsoleRegionList>}
@@ -144,6 +149,7 @@ export class Console {
144
149
  /**
145
150
  * Create source
146
151
  *
152
+ * Create a new source.
147
153
  *
148
154
  * @param {string} ref
149
155
  * @param {string} referrer
@@ -93,6 +93,7 @@ export class Databases {
93
93
  /**
94
94
  * Get databases usage stats
95
95
  *
96
+ * Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
96
97
  *
97
98
  * @param {DatabaseUsageRange} range
98
99
  * @throws {AppwriteException}
@@ -2187,6 +2188,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2187
2188
  /**
2188
2189
  * Get collection usage stats
2189
2190
  *
2191
+ * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2190
2192
  *
2191
2193
  * @param {string} databaseId
2192
2194
  * @param {string} collectionId
@@ -2256,6 +2258,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2256
2258
  /**
2257
2259
  * Get database usage stats
2258
2260
  *
2261
+ * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2259
2262
  *
2260
2263
  * @param {string} databaseId
2261
2264
  * @param {DatabaseUsageRange} range
@@ -291,6 +291,7 @@ export class Functions {
291
291
  /**
292
292
  * Get functions usage
293
293
  *
294
+ * Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
294
295
  *
295
296
  * @param {FunctionUsageRange} range
296
297
  * @throws {AppwriteException}
@@ -669,6 +670,7 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
669
670
  /**
670
671
  * Rebuild deployment
671
672
  *
673
+ * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment&#039;s code will be preserved and used for the new build.
672
674
  *
673
675
  * @param {string} functionId
674
676
  * @param {string} deploymentId
@@ -705,6 +707,7 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
705
707
  /**
706
708
  * Cancel deployment
707
709
  *
710
+ * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn&#039;t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status &#039;ready&#039;) or failed. The response includes the final build status and details.
708
711
  *
709
712
  * @param {string} functionId
710
713
  * @param {string} deploymentId
@@ -932,6 +935,7 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
932
935
  /**
933
936
  * Get function usage
934
937
  *
938
+ * Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.
935
939
  *
936
940
  * @param {string} functionId
937
941
  * @param {FunctionUsageRange} range
@@ -192,6 +192,7 @@ export class Health {
192
192
  /**
193
193
  * Get billing aggregation queue
194
194
  *
195
+ * Get billing aggregation queue
195
196
  *
196
197
  * @param {number} threshold
197
198
  * @throws {AppwriteException}
@@ -249,6 +250,7 @@ export class Health {
249
250
  /**
250
251
  * Get billing aggregation queue
251
252
  *
253
+ * Get the priority builds queue size.
252
254
  *
253
255
  * @param {number} threshold
254
256
  * @throws {AppwriteException}
@@ -566,6 +568,35 @@ export class Health {
566
568
  }
567
569
 
568
570
 
571
+ return await this.client.call(
572
+ 'get',
573
+ uri,
574
+ apiHeaders,
575
+ payload
576
+ );
577
+ }
578
+ /**
579
+ * Get usage count aggregation queue
580
+ *
581
+ * Get the usage count aggregation queue.
582
+ *
583
+ * @param {number} threshold
584
+ * @throws {AppwriteException}
585
+ * @returns {Promise<Models.HealthQueue>}
586
+ */
587
+ async getQueueUsageCount(threshold?: number): Promise<Models.HealthQueue> {
588
+ const apiPath = '/health/queue/usage-count';
589
+ const payload: Payload = {};
590
+ if (typeof threshold !== 'undefined') {
591
+ payload['threshold'] = threshold;
592
+ }
593
+ const uri = new URL(this.client.config.endpoint + apiPath);
594
+
595
+ const apiHeaders: { [header: string]: string } = {
596
+ 'content-type': 'application/json',
597
+ }
598
+
599
+
569
600
  return await this.client.call(
570
601
  'get',
571
602
  uri,
@@ -1,6 +1,7 @@
1
1
  import { Service } from '../service';
2
2
  import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
3
  import type { Models } from '../models';
4
+ import { MessagePriority } from '../enums/message-priority';
4
5
  import { SmtpEncryption } from '../enums/smtp-encryption';
5
6
 
6
7
  export class Messaging {
@@ -217,22 +218,19 @@ export class Messaging {
217
218
  * @param {string} sound
218
219
  * @param {string} color
219
220
  * @param {string} tag
220
- * @param {string} badge
221
+ * @param {number} badge
221
222
  * @param {boolean} draft
222
223
  * @param {string} scheduledAt
224
+ * @param {boolean} contentAvailable
225
+ * @param {boolean} critical
226
+ * @param {MessagePriority} priority
223
227
  * @throws {AppwriteException}
224
228
  * @returns {Promise<Models.Message>}
225
229
  */
226
- async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
230
+ async createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message> {
227
231
  if (typeof messageId === 'undefined') {
228
232
  throw new AppwriteException('Missing required parameter: "messageId"');
229
233
  }
230
- if (typeof title === 'undefined') {
231
- throw new AppwriteException('Missing required parameter: "title"');
232
- }
233
- if (typeof body === 'undefined') {
234
- throw new AppwriteException('Missing required parameter: "body"');
235
- }
236
234
  const apiPath = '/messaging/messages/push';
237
235
  const payload: Payload = {};
238
236
  if (typeof messageId !== 'undefined') {
@@ -283,6 +281,15 @@ export class Messaging {
283
281
  if (typeof scheduledAt !== 'undefined') {
284
282
  payload['scheduledAt'] = scheduledAt;
285
283
  }
284
+ if (typeof contentAvailable !== 'undefined') {
285
+ payload['contentAvailable'] = contentAvailable;
286
+ }
287
+ if (typeof critical !== 'undefined') {
288
+ payload['critical'] = critical;
289
+ }
290
+ if (typeof priority !== 'undefined') {
291
+ payload['priority'] = priority;
292
+ }
286
293
  const uri = new URL(this.client.config.endpoint + apiPath);
287
294
 
288
295
  const apiHeaders: { [header: string]: string } = {
@@ -319,10 +326,13 @@ export class Messaging {
319
326
  * @param {number} badge
320
327
  * @param {boolean} draft
321
328
  * @param {string} scheduledAt
329
+ * @param {boolean} contentAvailable
330
+ * @param {boolean} critical
331
+ * @param {MessagePriority} priority
322
332
  * @throws {AppwriteException}
323
333
  * @returns {Promise<Models.Message>}
324
334
  */
325
- async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
335
+ async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message> {
326
336
  if (typeof messageId === 'undefined') {
327
337
  throw new AppwriteException('Missing required parameter: "messageId"');
328
338
  }
@@ -373,6 +383,15 @@ export class Messaging {
373
383
  if (typeof scheduledAt !== 'undefined') {
374
384
  payload['scheduledAt'] = scheduledAt;
375
385
  }
386
+ if (typeof contentAvailable !== 'undefined') {
387
+ payload['contentAvailable'] = contentAvailable;
388
+ }
389
+ if (typeof critical !== 'undefined') {
390
+ payload['critical'] = critical;
391
+ }
392
+ if (typeof priority !== 'undefined') {
393
+ payload['priority'] = priority;
394
+ }
376
395
  const uri = new URL(this.client.config.endpoint + apiPath);
377
396
 
378
397
  const apiHeaders: { [header: string]: string } = {
@@ -449,7 +468,7 @@ export class Messaging {
449
468
  /**
450
469
  * Update SMS
451
470
  *
452
- * Update an email message by its unique ID.
471
+ * Update an SMS message by its unique ID.
453
472
 
454
473
  *
455
474
  * @param {string} messageId