@appwrite.io/console 1.4.5 → 1.4.7
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 +217 -18
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +218 -19
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +217 -18
- package/docs/examples/health/get-queue-usage-count.md +13 -0
- package/docs/examples/messaging/create-push.md +8 -5
- package/docs/examples/messaging/update-push.md +5 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/message-priority.ts +4 -0
- package/src/index.ts +1 -0
- package/src/models.ts +31 -7
- package/src/services/account.ts +19 -2
- package/src/services/assistant.ts +1 -0
- package/src/services/backups.ts +14 -2
- package/src/services/console.ts +8 -2
- package/src/services/databases.ts +3 -0
- package/src/services/functions.ts +4 -0
- package/src/services/health.ts +31 -0
- package/src/services/messaging.ts +29 -10
- package/src/services/migrations.ts +12 -0
- package/src/services/organizations.ts +30 -2
- package/src/services/project.ts +1 -0
- package/src/services/projects.ts +48 -2
- package/src/services/proxy.ts +1 -0
- package/src/services/storage.ts +4 -0
- package/src/services/users.ts +4 -2
- package/src/services/vcs.ts +13 -0
- package/types/enums/message-priority.d.ts +4 -0
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +31 -7
- package/types/services/account.d.ts +19 -2
- package/types/services/assistant.d.ts +1 -0
- package/types/services/backups.d.ts +14 -2
- package/types/services/console.d.ts +8 -2
- package/types/services/databases.d.ts +3 -0
- package/types/services/functions.d.ts +4 -0
- package/types/services/health.d.ts +12 -0
- package/types/services/messaging.d.ts +11 -4
- package/types/services/migrations.d.ts +12 -0
- package/types/services/organizations.d.ts +30 -2
- package/types/services/project.d.ts +1 -0
- package/types/services/projects.d.ts +48 -2
- package/types/services/proxy.d.ts +1 -0
- package/types/services/storage.d.ts +4 -0
- package/types/services/users.d.ts +4 -2
- package/types/services/vcs.d.ts +13 -0
|
@@ -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 {
|
|
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
|
|
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
|
|
471
|
+
* Update an SMS message by its unique ID.
|
|
453
472
|
|
|
454
473
|
*
|
|
455
474
|
* @param {string} messageId
|
|
@@ -12,6 +12,7 @@ export class Migrations {
|
|
|
12
12
|
/**
|
|
13
13
|
* List migrations
|
|
14
14
|
*
|
|
15
|
+
* List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.
|
|
15
16
|
*
|
|
16
17
|
* @param {string[]} queries
|
|
17
18
|
* @param {string} search
|
|
@@ -44,6 +45,7 @@ export class Migrations {
|
|
|
44
45
|
/**
|
|
45
46
|
* Migrate Appwrite data
|
|
46
47
|
*
|
|
48
|
+
* Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project.
|
|
47
49
|
*
|
|
48
50
|
* @param {string[]} resources
|
|
49
51
|
* @param {string} endpoint
|
|
@@ -96,6 +98,7 @@ export class Migrations {
|
|
|
96
98
|
/**
|
|
97
99
|
* Generate a report on Appwrite data
|
|
98
100
|
*
|
|
101
|
+
* Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
|
|
99
102
|
*
|
|
100
103
|
* @param {string[]} resources
|
|
101
104
|
* @param {string} endpoint
|
|
@@ -148,6 +151,7 @@ export class Migrations {
|
|
|
148
151
|
/**
|
|
149
152
|
* Migrate Firebase data
|
|
150
153
|
*
|
|
154
|
+
* Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project.
|
|
151
155
|
*
|
|
152
156
|
* @param {string[]} resources
|
|
153
157
|
* @param {string} serviceAccount
|
|
@@ -186,6 +190,7 @@ export class Migrations {
|
|
|
186
190
|
/**
|
|
187
191
|
* Generate a report on Firebase data
|
|
188
192
|
*
|
|
193
|
+
* Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
|
|
189
194
|
*
|
|
190
195
|
* @param {string[]} resources
|
|
191
196
|
* @param {string} serviceAccount
|
|
@@ -224,6 +229,7 @@ export class Migrations {
|
|
|
224
229
|
/**
|
|
225
230
|
* Migrate NHost data
|
|
226
231
|
*
|
|
232
|
+
* Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project.
|
|
227
233
|
*
|
|
228
234
|
* @param {string[]} resources
|
|
229
235
|
* @param {string} subdomain
|
|
@@ -301,6 +307,7 @@ export class Migrations {
|
|
|
301
307
|
/**
|
|
302
308
|
* Generate a report on NHost Data
|
|
303
309
|
*
|
|
310
|
+
* Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
|
|
304
311
|
*
|
|
305
312
|
* @param {string[]} resources
|
|
306
313
|
* @param {string} subdomain
|
|
@@ -378,6 +385,7 @@ export class Migrations {
|
|
|
378
385
|
/**
|
|
379
386
|
* Migrate Supabase data
|
|
380
387
|
*
|
|
388
|
+
* Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project.
|
|
381
389
|
*
|
|
382
390
|
* @param {string[]} resources
|
|
383
391
|
* @param {string} endpoint
|
|
@@ -448,6 +456,7 @@ export class Migrations {
|
|
|
448
456
|
/**
|
|
449
457
|
* Generate a report on Supabase Data
|
|
450
458
|
*
|
|
459
|
+
* Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
|
|
451
460
|
*
|
|
452
461
|
* @param {string[]} resources
|
|
453
462
|
* @param {string} endpoint
|
|
@@ -518,6 +527,7 @@ export class Migrations {
|
|
|
518
527
|
/**
|
|
519
528
|
* Get migration
|
|
520
529
|
*
|
|
530
|
+
* Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process.
|
|
521
531
|
*
|
|
522
532
|
* @param {string} migrationId
|
|
523
533
|
* @throws {AppwriteException}
|
|
@@ -546,6 +556,7 @@ export class Migrations {
|
|
|
546
556
|
/**
|
|
547
557
|
* Retry migration
|
|
548
558
|
*
|
|
559
|
+
* Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.
|
|
549
560
|
*
|
|
550
561
|
* @param {string} migrationId
|
|
551
562
|
* @throws {AppwriteException}
|
|
@@ -574,6 +585,7 @@ export class Migrations {
|
|
|
574
585
|
/**
|
|
575
586
|
* Delete migration
|
|
576
587
|
*
|
|
588
|
+
* Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history.
|
|
577
589
|
*
|
|
578
590
|
* @param {string} migrationId
|
|
579
591
|
* @throws {AppwriteException}
|
|
@@ -46,7 +46,8 @@ export class Organizations {
|
|
|
46
46
|
/**
|
|
47
47
|
* Create Organization
|
|
48
48
|
*
|
|
49
|
-
* Create a new
|
|
49
|
+
* Create a new organization.
|
|
50
|
+
|
|
50
51
|
*
|
|
51
52
|
* @param {string} organizationId
|
|
52
53
|
* @param {string} name
|
|
@@ -100,7 +101,7 @@ export class Organizations {
|
|
|
100
101
|
/**
|
|
101
102
|
* Delete team
|
|
102
103
|
*
|
|
103
|
-
* Delete
|
|
104
|
+
* Delete an organization.
|
|
104
105
|
*
|
|
105
106
|
* @param {string} organizationId
|
|
106
107
|
* @throws {AppwriteException}
|
|
@@ -129,6 +130,7 @@ export class Organizations {
|
|
|
129
130
|
/**
|
|
130
131
|
* List aggregations
|
|
131
132
|
*
|
|
133
|
+
* Get a list of all aggregations for an organization.
|
|
132
134
|
*
|
|
133
135
|
* @param {string} organizationId
|
|
134
136
|
* @param {string[]} queries
|
|
@@ -161,6 +163,7 @@ export class Organizations {
|
|
|
161
163
|
/**
|
|
162
164
|
* Get invoice
|
|
163
165
|
*
|
|
166
|
+
* Get a specific aggregation using it's aggregation ID.
|
|
164
167
|
*
|
|
165
168
|
* @param {string} organizationId
|
|
166
169
|
* @param {string} aggregationId
|
|
@@ -193,6 +196,7 @@ export class Organizations {
|
|
|
193
196
|
/**
|
|
194
197
|
* Set team's billing address
|
|
195
198
|
*
|
|
199
|
+
* Set a billing address for an organization.
|
|
196
200
|
*
|
|
197
201
|
* @param {string} organizationId
|
|
198
202
|
* @param {string} billingAddressId
|
|
@@ -228,6 +232,7 @@ export class Organizations {
|
|
|
228
232
|
/**
|
|
229
233
|
* Delete team's billing address
|
|
230
234
|
*
|
|
235
|
+
* Delete a team's billing address.
|
|
231
236
|
*
|
|
232
237
|
* @param {string} organizationId
|
|
233
238
|
* @throws {AppwriteException}
|
|
@@ -256,6 +261,7 @@ export class Organizations {
|
|
|
256
261
|
/**
|
|
257
262
|
* Get billing address
|
|
258
263
|
*
|
|
264
|
+
* Get a billing address using it's ID.
|
|
259
265
|
*
|
|
260
266
|
* @param {string} organizationId
|
|
261
267
|
* @param {string} billingAddressId
|
|
@@ -288,6 +294,7 @@ export class Organizations {
|
|
|
288
294
|
/**
|
|
289
295
|
* Set team's billing email
|
|
290
296
|
*
|
|
297
|
+
* Set the current billing email for the organization.
|
|
291
298
|
*
|
|
292
299
|
* @param {string} organizationId
|
|
293
300
|
* @param {string} billingEmail
|
|
@@ -323,6 +330,7 @@ export class Organizations {
|
|
|
323
330
|
/**
|
|
324
331
|
* Update organization budget
|
|
325
332
|
*
|
|
333
|
+
* Update the budget limit for an organization.
|
|
326
334
|
*
|
|
327
335
|
* @param {string} organizationId
|
|
328
336
|
* @param {number} budget
|
|
@@ -362,6 +370,8 @@ export class Organizations {
|
|
|
362
370
|
/**
|
|
363
371
|
* List credits
|
|
364
372
|
*
|
|
373
|
+
* List all credits for an organization.
|
|
374
|
+
|
|
365
375
|
*
|
|
366
376
|
* @param {string} organizationId
|
|
367
377
|
* @param {string[]} queries
|
|
@@ -394,6 +404,7 @@ export class Organizations {
|
|
|
394
404
|
/**
|
|
395
405
|
* Add credits from coupon
|
|
396
406
|
*
|
|
407
|
+
* Add credit to an organization using a coupon.
|
|
397
408
|
*
|
|
398
409
|
* @param {string} organizationId
|
|
399
410
|
* @param {string} couponId
|
|
@@ -429,6 +440,7 @@ export class Organizations {
|
|
|
429
440
|
/**
|
|
430
441
|
* Get credit details
|
|
431
442
|
*
|
|
443
|
+
* Get credit details.
|
|
432
444
|
*
|
|
433
445
|
* @param {string} organizationId
|
|
434
446
|
* @param {string} creditId
|
|
@@ -461,6 +473,7 @@ export class Organizations {
|
|
|
461
473
|
/**
|
|
462
474
|
* List invoices
|
|
463
475
|
*
|
|
476
|
+
* List all invoices for an organization.
|
|
464
477
|
*
|
|
465
478
|
* @param {string} organizationId
|
|
466
479
|
* @param {string[]} queries
|
|
@@ -493,6 +506,7 @@ export class Organizations {
|
|
|
493
506
|
/**
|
|
494
507
|
* Get invoice
|
|
495
508
|
*
|
|
509
|
+
* Get an invoice by its unique ID.
|
|
496
510
|
*
|
|
497
511
|
* @param {string} organizationId
|
|
498
512
|
* @param {string} invoiceId
|
|
@@ -525,6 +539,7 @@ export class Organizations {
|
|
|
525
539
|
/**
|
|
526
540
|
* Download invoice in PDF
|
|
527
541
|
*
|
|
542
|
+
* Download invoice in PDF
|
|
528
543
|
*
|
|
529
544
|
* @param {string} organizationId
|
|
530
545
|
* @param {string} invoiceId
|
|
@@ -557,6 +572,7 @@ export class Organizations {
|
|
|
557
572
|
/**
|
|
558
573
|
* Initiate payment for failed invoice to pay live from console
|
|
559
574
|
*
|
|
575
|
+
* Initiate payment for failed invoice to pay live from console
|
|
560
576
|
*
|
|
561
577
|
* @param {string} organizationId
|
|
562
578
|
* @param {string} invoiceId
|
|
@@ -596,6 +612,7 @@ export class Organizations {
|
|
|
596
612
|
/**
|
|
597
613
|
* View invoice in PDF
|
|
598
614
|
*
|
|
615
|
+
* View invoice in PDF
|
|
599
616
|
*
|
|
600
617
|
* @param {string} organizationId
|
|
601
618
|
* @param {string} invoiceId
|
|
@@ -628,6 +645,7 @@ export class Organizations {
|
|
|
628
645
|
/**
|
|
629
646
|
* Set team's payment method
|
|
630
647
|
*
|
|
648
|
+
* Set a organization's default payment method.
|
|
631
649
|
*
|
|
632
650
|
* @param {string} organizationId
|
|
633
651
|
* @param {string} paymentMethodId
|
|
@@ -663,6 +681,7 @@ export class Organizations {
|
|
|
663
681
|
/**
|
|
664
682
|
* Delete team's default payment method
|
|
665
683
|
*
|
|
684
|
+
* Delete the default payment method for an organization.
|
|
666
685
|
*
|
|
667
686
|
* @param {string} organizationId
|
|
668
687
|
* @throws {AppwriteException}
|
|
@@ -691,6 +710,8 @@ export class Organizations {
|
|
|
691
710
|
/**
|
|
692
711
|
* Set team's backup payment method
|
|
693
712
|
*
|
|
713
|
+
* Set an organization's backup payment method.
|
|
714
|
+
|
|
694
715
|
*
|
|
695
716
|
* @param {string} organizationId
|
|
696
717
|
* @param {string} paymentMethodId
|
|
@@ -726,6 +747,7 @@ export class Organizations {
|
|
|
726
747
|
/**
|
|
727
748
|
* Delete team's backup payment method
|
|
728
749
|
*
|
|
750
|
+
* Delete a backup payment method for an organization.
|
|
729
751
|
*
|
|
730
752
|
* @param {string} organizationId
|
|
731
753
|
* @throws {AppwriteException}
|
|
@@ -754,6 +776,7 @@ export class Organizations {
|
|
|
754
776
|
/**
|
|
755
777
|
* Get payment method
|
|
756
778
|
*
|
|
779
|
+
* Get an organization's payment method using it's payment method ID.
|
|
757
780
|
*
|
|
758
781
|
* @param {string} organizationId
|
|
759
782
|
* @param {string} paymentMethodId
|
|
@@ -786,6 +809,7 @@ export class Organizations {
|
|
|
786
809
|
/**
|
|
787
810
|
* Get organization billing plan details
|
|
788
811
|
*
|
|
812
|
+
* Get the details of the current billing plan for an organization.
|
|
789
813
|
*
|
|
790
814
|
* @param {string} organizationId
|
|
791
815
|
* @throws {AppwriteException}
|
|
@@ -814,6 +838,7 @@ export class Organizations {
|
|
|
814
838
|
/**
|
|
815
839
|
* Update organization billing plan
|
|
816
840
|
*
|
|
841
|
+
* Update the billing plan for an organization.
|
|
817
842
|
*
|
|
818
843
|
* @param {string} organizationId
|
|
819
844
|
* @param {BillingPlan} billingPlan
|
|
@@ -857,6 +882,7 @@ export class Organizations {
|
|
|
857
882
|
/**
|
|
858
883
|
* Get Scopes
|
|
859
884
|
*
|
|
885
|
+
* Get Scopes
|
|
860
886
|
*
|
|
861
887
|
* @param {string} organizationId
|
|
862
888
|
* @throws {AppwriteException}
|
|
@@ -885,6 +911,7 @@ export class Organizations {
|
|
|
885
911
|
/**
|
|
886
912
|
* Set team's tax Id
|
|
887
913
|
*
|
|
914
|
+
* Set an organization's billing tax ID.
|
|
888
915
|
*
|
|
889
916
|
* @param {string} organizationId
|
|
890
917
|
* @param {string} taxId
|
|
@@ -920,6 +947,7 @@ export class Organizations {
|
|
|
920
947
|
/**
|
|
921
948
|
* Get team's usage data
|
|
922
949
|
*
|
|
950
|
+
* Get the usage data for an organization.
|
|
923
951
|
*
|
|
924
952
|
* @param {string} organizationId
|
|
925
953
|
* @param {string} startDate
|
package/src/services/project.ts
CHANGED
|
@@ -13,6 +13,7 @@ export class Project {
|
|
|
13
13
|
/**
|
|
14
14
|
* Get project usage stats
|
|
15
15
|
*
|
|
16
|
+
* Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.
|
|
16
17
|
*
|
|
17
18
|
* @param {string} startDate
|
|
18
19
|
* @param {string} endDate
|