@appwrite.io/console 0.6.0-rc.13 → 0.6.0-rc.14

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 (36) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +128 -68
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +129 -69
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +128 -68
  7. package/docs/examples/account/update-phone-session.md +14 -0
  8. package/docs/examples/messaging/create-email.md +2 -2
  9. package/docs/examples/messaging/create-push.md +2 -2
  10. package/docs/examples/messaging/create-sms.md +2 -2
  11. package/docs/examples/messaging/update-email.md +2 -2
  12. package/docs/examples/messaging/update-push.md +2 -2
  13. package/docs/examples/messaging/update-sms.md +2 -2
  14. package/docs/examples/users/delete-authenticator.md +1 -2
  15. package/package.json +1 -1
  16. package/src/client.ts +1 -1
  17. package/src/enums/index-type.ts +0 -1
  18. package/src/index.ts +0 -1
  19. package/src/services/account.ts +54 -5
  20. package/src/services/databases.ts +20 -3
  21. package/src/services/health.ts +2 -0
  22. package/src/services/messaging.ts +42 -40
  23. package/src/services/project.ts +1 -1
  24. package/src/services/storage.ts +2 -2
  25. package/src/services/users.ts +10 -11
  26. package/types/enums/index-type.d.ts +1 -2
  27. package/types/index.d.ts +0 -1
  28. package/types/services/account.d.ts +29 -5
  29. package/types/services/databases.d.ts +20 -3
  30. package/types/services/health.d.ts +2 -0
  31. package/types/services/messaging.d.ts +30 -28
  32. package/types/services/project.d.ts +1 -1
  33. package/types/services/storage.d.ts +2 -2
  34. package/types/services/users.d.ts +10 -3
  35. package/src/enums/message-status.ts +0 -5
  36. package/types/enums/message-status.d.ts +0 -5
@@ -1,7 +1,6 @@
1
1
  import { Service } from '../service';
2
2
  import { Client } from '../client';
3
3
  import type { Models } from '../models';
4
- import { MessageStatus } from '../enums/message-status';
5
4
  import { SmtpEncryption } from '../enums/smtp-encryption';
6
5
  export declare class Messaging extends Service {
7
6
  constructor(client: Client);
@@ -17,7 +16,7 @@ export declare class Messaging extends Service {
17
16
  */
18
17
  listMessages(queries?: string[], search?: string): Promise<Models.MessageList>;
19
18
  /**
20
- * Create an email
19
+ * Create email
21
20
  *
22
21
  * Create a new email message.
23
22
  *
@@ -30,15 +29,15 @@ export declare class Messaging extends Service {
30
29
  * @param {string[]} cc
31
30
  * @param {string[]} bcc
32
31
  * @param {string[]} attachments
33
- * @param {MessageStatus} status
32
+ * @param {boolean} draft
34
33
  * @param {boolean} html
35
34
  * @param {string} scheduledAt
36
35
  * @throws {AppwriteException}
37
36
  * @returns {Promise}
38
37
  */
39
- createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], status?: MessageStatus, html?: boolean, scheduledAt?: string): Promise<Models.Message>;
38
+ createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise<Models.Message>;
40
39
  /**
41
- * Update an email
40
+ * Update email
42
41
  *
43
42
  * Update an email message by its unique ID.
44
43
  *
@@ -49,7 +48,7 @@ export declare class Messaging extends Service {
49
48
  * @param {string[]} targets
50
49
  * @param {string} subject
51
50
  * @param {string} content
52
- * @param {MessageStatus} status
51
+ * @param {boolean} draft
53
52
  * @param {boolean} html
54
53
  * @param {string[]} cc
55
54
  * @param {string[]} bcc
@@ -57,9 +56,9 @@ export declare class Messaging extends Service {
57
56
  * @throws {AppwriteException}
58
57
  * @returns {Promise}
59
58
  */
60
- updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, status?: MessageStatus, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise<Models.Message>;
59
+ updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise<Models.Message>;
61
60
  /**
62
- * Create a push notification
61
+ * Create push notification
63
62
  *
64
63
  * Create a new push notification.
65
64
  *
@@ -77,14 +76,14 @@ export declare class Messaging extends Service {
77
76
  * @param {string} color
78
77
  * @param {string} tag
79
78
  * @param {string} badge
80
- * @param {MessageStatus} status
79
+ * @param {boolean} draft
81
80
  * @param {string} scheduledAt
82
81
  * @throws {AppwriteException}
83
82
  * @returns {Promise}
84
83
  */
85
- 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, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message>;
84
+ 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>;
86
85
  /**
87
- * Update a push notification
86
+ * Update push notification
88
87
  *
89
88
  * Update a push notification by its unique ID.
90
89
  *
@@ -103,14 +102,14 @@ export declare class Messaging extends Service {
103
102
  * @param {string} color
104
103
  * @param {string} tag
105
104
  * @param {number} badge
106
- * @param {MessageStatus} status
105
+ * @param {boolean} draft
107
106
  * @param {string} scheduledAt
108
107
  * @throws {AppwriteException}
109
108
  * @returns {Promise}
110
109
  */
111
- 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, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message>;
110
+ 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>;
112
111
  /**
113
- * Create an SMS
112
+ * Create SMS
114
113
  *
115
114
  * Create a new SMS message.
116
115
  *
@@ -119,14 +118,14 @@ export declare class Messaging extends Service {
119
118
  * @param {string[]} topics
120
119
  * @param {string[]} users
121
120
  * @param {string[]} targets
122
- * @param {MessageStatus} status
121
+ * @param {boolean} draft
123
122
  * @param {string} scheduledAt
124
123
  * @throws {AppwriteException}
125
124
  * @returns {Promise}
126
125
  */
127
- createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], status?: MessageStatus, scheduledAt?: string): Promise<Models.Message>;
126
+ createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
128
127
  /**
129
- * Update an SMS
128
+ * Update SMS
130
129
  *
131
130
  * Update an email message by its unique ID.
132
131
  *
@@ -136,14 +135,14 @@ export declare class Messaging extends Service {
136
135
  * @param {string[]} users
137
136
  * @param {string[]} targets
138
137
  * @param {string} content
139
- * @param {MessageStatus} status
138
+ * @param {boolean} draft
140
139
  * @param {string} scheduledAt
141
140
  * @throws {AppwriteException}
142
141
  * @returns {Promise}
143
142
  */
144
- updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message>;
143
+ updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
145
144
  /**
146
- * Get a message
145
+ * Get message
147
146
  *
148
147
  * Get a message by its unique ID.
149
148
  *
@@ -154,8 +153,10 @@ export declare class Messaging extends Service {
154
153
  */
155
154
  getMessage(messageId: string): Promise<Models.Message>;
156
155
  /**
157
- * Delete a message
156
+ * Delete message
158
157
  *
158
+ * Delete a message. If the message is not a draft or scheduled, but has been
159
+ * sent, this will not recall the message.
159
160
  *
160
161
  * @param {string} messageId
161
162
  * @throws {AppwriteException}
@@ -326,6 +327,7 @@ export declare class Messaging extends Service {
326
327
  /**
327
328
  * Create Sendgrid provider
328
329
  *
330
+ * Create a new Sendgrid provider.
329
331
  *
330
332
  * @param {string} providerId
331
333
  * @param {string} name
@@ -577,7 +579,7 @@ export declare class Messaging extends Service {
577
579
  */
578
580
  listTopics(queries?: string[], search?: string): Promise<Models.TopicList>;
579
581
  /**
580
- * Create a topic
582
+ * Create topic
581
583
  *
582
584
  * Create a new topic.
583
585
  *
@@ -589,7 +591,7 @@ export declare class Messaging extends Service {
589
591
  */
590
592
  createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic>;
591
593
  /**
592
- * Get a topic
594
+ * Get topic
593
595
  *
594
596
  * Get a topic by its unique ID.
595
597
  *
@@ -600,7 +602,7 @@ export declare class Messaging extends Service {
600
602
  */
601
603
  getTopic(topicId: string): Promise<Models.Topic>;
602
604
  /**
603
- * Update a topic
605
+ * Update topic
604
606
  *
605
607
  * Update a topic by its unique ID.
606
608
  *
@@ -613,7 +615,7 @@ export declare class Messaging extends Service {
613
615
  */
614
616
  updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic>;
615
617
  /**
616
- * Delete a topic
618
+ * Delete topic
617
619
  *
618
620
  * Delete a topic by its unique ID.
619
621
  *
@@ -646,7 +648,7 @@ export declare class Messaging extends Service {
646
648
  */
647
649
  listSubscribers(topicId: string, queries?: string[], search?: string): Promise<Models.SubscriberList>;
648
650
  /**
649
- * Create a subscriber
651
+ * Create subscriber
650
652
  *
651
653
  * Create a new subscriber.
652
654
  *
@@ -658,7 +660,7 @@ export declare class Messaging extends Service {
658
660
  */
659
661
  createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
660
662
  /**
661
- * Get a subscriber
663
+ * Get subscriber
662
664
  *
663
665
  * Get a subscriber by its unique ID.
664
666
  *
@@ -670,7 +672,7 @@ export declare class Messaging extends Service {
670
672
  */
671
673
  getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber>;
672
674
  /**
673
- * Delete a subscriber
675
+ * Delete subscriber
674
676
  *
675
677
  * Delete a subscriber by its unique ID.
676
678
  *
@@ -5,7 +5,7 @@ import { ProjectUsageRange } from '../enums/project-usage-range';
5
5
  export declare class Project extends Service {
6
6
  constructor(client: Client);
7
7
  /**
8
- * Get usage stats for a project
8
+ * Get project usage stats
9
9
  *
10
10
  *
11
11
  * @param {string} startDate
@@ -213,7 +213,7 @@ export declare class Storage extends Service {
213
213
  */
214
214
  getFileView(bucketId: string, fileId: string): URL;
215
215
  /**
216
- * Get usage stats for storage
216
+ * Get storage usage stats
217
217
  *
218
218
  *
219
219
  * @param {StorageUsageRange} range
@@ -222,7 +222,7 @@ export declare class Storage extends Service {
222
222
  */
223
223
  getUsage(range?: StorageUsageRange): Promise<Models.UsageStorage>;
224
224
  /**
225
- * Get usage stats for storage bucket
225
+ * Get bucket usage stats
226
226
  *
227
227
  *
228
228
  * @param {string} bucketId
@@ -177,7 +177,7 @@ export declare class Users extends Service {
177
177
  */
178
178
  createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
179
179
  /**
180
- * Get usage stats for the users API
180
+ * Get users usage stats
181
181
  *
182
182
  *
183
183
  * @param {UserUsageRange} range
@@ -261,6 +261,7 @@ export declare class Users extends Service {
261
261
  /**
262
262
  * Update MFA
263
263
  *
264
+ * Enable or disable MFA on a user account.
264
265
  *
265
266
  * @param {string} userId
266
267
  * @param {boolean} mfa
@@ -271,6 +272,7 @@ export declare class Users extends Service {
271
272
  /**
272
273
  * List Factors
273
274
  *
275
+ * List the factors available on the account to be used as a MFA challange.
274
276
  *
275
277
  * @param {string} userId
276
278
  * @throws {AppwriteException}
@@ -280,14 +282,14 @@ export declare class Users extends Service {
280
282
  /**
281
283
  * Delete Authenticator
282
284
  *
285
+ * Delete an authenticator app.
283
286
  *
284
287
  * @param {string} userId
285
288
  * @param {AuthenticatorType} type
286
- * @param {string} otp
287
289
  * @throws {AppwriteException}
288
290
  * @returns {Promise}
289
291
  */
290
- deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
292
+ deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: AuthenticatorType): Promise<Models.User<Preferences>>;
291
293
  /**
292
294
  * Update name
293
295
  *
@@ -405,6 +407,7 @@ export declare class Users extends Service {
405
407
  /**
406
408
  * List User Targets
407
409
  *
410
+ * List the messaging targets that are associated with a user.
408
411
  *
409
412
  * @param {string} userId
410
413
  * @param {string[]} queries
@@ -415,6 +418,7 @@ export declare class Users extends Service {
415
418
  /**
416
419
  * Create User Target
417
420
  *
421
+ * Create a messaging target.
418
422
  *
419
423
  * @param {string} userId
420
424
  * @param {string} targetId
@@ -429,6 +433,7 @@ export declare class Users extends Service {
429
433
  /**
430
434
  * Get User Target
431
435
  *
436
+ * Get a user's push notification target by ID.
432
437
  *
433
438
  * @param {string} userId
434
439
  * @param {string} targetId
@@ -439,6 +444,7 @@ export declare class Users extends Service {
439
444
  /**
440
445
  * Update User target
441
446
  *
447
+ * Update a messaging target.
442
448
  *
443
449
  * @param {string} userId
444
450
  * @param {string} targetId
@@ -452,6 +458,7 @@ export declare class Users extends Service {
452
458
  /**
453
459
  * Delete user target
454
460
  *
461
+ * Delete a messaging target.
455
462
  *
456
463
  * @param {string} userId
457
464
  * @param {string} targetId
@@ -1,5 +0,0 @@
1
- export enum MessageStatus {
2
- Draft = 'draft',
3
- Scheduled = 'scheduled',
4
- Processing = 'processing',
5
- }
@@ -1,5 +0,0 @@
1
- export declare enum MessageStatus {
2
- Draft = "draft",
3
- Scheduled = "scheduled",
4
- Processing = "processing"
5
- }