@knocklabs/node 1.33.0 → 1.35.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.
- package/CHANGELOG.md +59 -0
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/audiences.d.mts +19 -39
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +19 -39
- package/resources/audiences.d.ts.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/batch.d.mts +15 -252
- package/resources/messages/batch.d.mts.map +1 -1
- package/resources/messages/batch.d.ts +15 -252
- package/resources/messages/batch.d.ts.map +1 -1
- package/resources/messages/batch.js +4 -3
- package/resources/messages/batch.js.map +1 -1
- package/resources/messages/batch.mjs +4 -3
- package/resources/messages/batch.mjs.map +1 -1
- package/resources/messages/index.d.mts +2 -2
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +2 -2
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +215 -188
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +215 -188
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/objects/objects.d.mts +5 -2
- package/resources/objects/objects.d.mts.map +1 -1
- package/resources/objects/objects.d.ts +5 -2
- package/resources/objects/objects.d.ts.map +1 -1
- package/resources/objects/objects.js.map +1 -1
- package/resources/objects/objects.mjs.map +1 -1
- package/resources/recipients/channel-data.d.mts +4 -0
- package/resources/recipients/channel-data.d.mts.map +1 -1
- package/resources/recipients/channel-data.d.ts +4 -0
- package/resources/recipients/channel-data.d.ts.map +1 -1
- package/resources/recipients/preferences.d.mts +9 -4
- package/resources/recipients/preferences.d.mts.map +1 -1
- package/resources/recipients/preferences.d.ts +9 -4
- package/resources/recipients/preferences.d.ts.map +1 -1
- package/resources/recipients/preferences.js.map +1 -1
- package/resources/recipients/preferences.mjs.map +1 -1
- package/resources/users/bulk.d.mts +4 -2
- package/resources/users/bulk.d.mts.map +1 -1
- package/resources/users/bulk.d.ts +4 -2
- package/resources/users/bulk.d.ts.map +1 -1
- package/resources/users/feeds.d.mts +1 -58
- package/resources/users/feeds.d.mts.map +1 -1
- package/resources/users/feeds.d.ts +1 -58
- package/resources/users/feeds.d.ts.map +1 -1
- package/resources/users/guides.d.mts +190 -108
- package/resources/users/guides.d.mts.map +1 -1
- package/resources/users/guides.d.ts +190 -108
- package/resources/users/guides.d.ts.map +1 -1
- package/resources/users/guides.js +55 -43
- package/resources/users/guides.js.map +1 -1
- package/resources/users/guides.mjs +55 -43
- package/resources/users/guides.mjs.map +1 -1
- package/resources/users/index.d.mts +3 -2
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +3 -2
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js +3 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs +1 -0
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preference-center.d.mts +175 -0
- package/resources/users/preference-center.d.mts.map +1 -0
- package/resources/users/preference-center.d.ts +175 -0
- package/resources/users/preference-center.d.ts.map +1 -0
- package/resources/users/preference-center.js +41 -0
- package/resources/users/preference-center.js.map +1 -0
- package/resources/users/preference-center.mjs +37 -0
- package/resources/users/preference-center.mjs.map +1 -0
- package/resources/users/users.d.mts +47 -5
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +47 -5
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js +4 -0
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs +4 -0
- package/resources/users/users.mjs.map +1 -1
- package/src/client.ts +16 -2
- package/src/resources/audiences.ts +21 -42
- package/src/resources/index.ts +8 -1
- package/src/resources/messages/batch.ts +16 -294
- package/src/resources/messages/index.ts +5 -1
- package/src/resources/messages/messages.ts +252 -218
- package/src/resources/objects/objects.ts +5 -2
- package/src/resources/recipients/channel-data.ts +5 -0
- package/src/resources/recipients/preferences.ts +9 -4
- package/src/resources/users/bulk.ts +4 -2
- package/src/resources/users/feeds.ts +1 -70
- package/src/resources/users/guides.ts +228 -120
- package/src/resources/users/index.ts +15 -3
- package/src/resources/users/preference-center.ts +224 -0
- package/src/resources/users/users.ts +78 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as MessagesAPI from './messages';
|
|
5
|
+
import * as Shared from '../shared';
|
|
4
6
|
import * as BatchAPI from './batch';
|
|
5
7
|
import {
|
|
6
8
|
Batch,
|
|
@@ -18,6 +20,7 @@ import {
|
|
|
18
20
|
BatchMarkAsUnreadResponse,
|
|
19
21
|
BatchMarkAsUnseenParams,
|
|
20
22
|
BatchMarkAsUnseenResponse,
|
|
23
|
+
BatchMessagesStatusRequest,
|
|
21
24
|
BatchUnarchiveParams,
|
|
22
25
|
BatchUnarchiveResponse,
|
|
23
26
|
} from './batch';
|
|
@@ -86,12 +89,12 @@ export class Messages extends APIResource {
|
|
|
86
89
|
*
|
|
87
90
|
* @example
|
|
88
91
|
* ```ts
|
|
89
|
-
* const
|
|
92
|
+
* const messageContents = await client.messages.getContent(
|
|
90
93
|
* 'message_id',
|
|
91
94
|
* );
|
|
92
95
|
* ```
|
|
93
96
|
*/
|
|
94
|
-
getContent(messageID: string, options?: RequestOptions): APIPromise<
|
|
97
|
+
getContent(messageID: string, options?: RequestOptions): APIPromise<MessageContents> {
|
|
95
98
|
return this._client.get(path`/v1/messages/${messageID}/content`, options);
|
|
96
99
|
}
|
|
97
100
|
|
|
@@ -321,6 +324,21 @@ export interface Activity {
|
|
|
321
324
|
updated_at?: string;
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
/**
|
|
328
|
+
* A paginated list of messages.
|
|
329
|
+
*/
|
|
330
|
+
export interface ListMessagesResponse {
|
|
331
|
+
/**
|
|
332
|
+
* A list of messages.
|
|
333
|
+
*/
|
|
334
|
+
items: Array<Message>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Pagination information for a list of resources.
|
|
338
|
+
*/
|
|
339
|
+
page_info: Shared.PageInfo;
|
|
340
|
+
}
|
|
341
|
+
|
|
324
342
|
/**
|
|
325
343
|
* Represents a single message that was generated by a workflow for a given
|
|
326
344
|
* channel.
|
|
@@ -424,8 +442,9 @@ export interface Message {
|
|
|
424
442
|
read_at?: string | null;
|
|
425
443
|
|
|
426
444
|
/**
|
|
427
|
-
*
|
|
428
|
-
* channels
|
|
445
|
+
* The destination the message was delivered to, captured at send time. Email
|
|
446
|
+
* channels carry `email`/`name`; chat channels carry the destination `channel_id`
|
|
447
|
+
* or `user_id`, or `via_incoming_webhook`. Null when no snapshot was captured.
|
|
429
448
|
*/
|
|
430
449
|
recipient_snapshot?: Message.RecipientSnapshot | null;
|
|
431
450
|
|
|
@@ -537,177 +556,42 @@ export namespace Message {
|
|
|
537
556
|
}
|
|
538
557
|
|
|
539
558
|
/**
|
|
540
|
-
*
|
|
541
|
-
* channels
|
|
559
|
+
* The destination the message was delivered to, captured at send time. Email
|
|
560
|
+
* channels carry `email`/`name`; chat channels carry the destination `channel_id`
|
|
561
|
+
* or `user_id`, or `via_incoming_webhook`. Null when no snapshot was captured.
|
|
542
562
|
*/
|
|
543
563
|
export interface RecipientSnapshot {
|
|
544
564
|
/**
|
|
545
|
-
* The
|
|
565
|
+
* The chat channel the message was delivered to (chat channels)
|
|
546
566
|
*/
|
|
547
|
-
|
|
567
|
+
channel_id?: string | null;
|
|
548
568
|
|
|
549
569
|
/**
|
|
550
|
-
* The
|
|
570
|
+
* The email address the message was delivered to (email channels)
|
|
551
571
|
*/
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* A message delivery log contains a `request` from Knock to a downstream provider
|
|
558
|
-
* and the `response` that was returned.
|
|
559
|
-
*/
|
|
560
|
-
export interface MessageDeliveryLog {
|
|
561
|
-
/**
|
|
562
|
-
* The unique identifier for the message delivery log.
|
|
563
|
-
*/
|
|
564
|
-
id: string;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* The typename of the schema.
|
|
568
|
-
*/
|
|
569
|
-
__typename: string;
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
* The ID of the environment in which the message delivery occurred.
|
|
573
|
-
*/
|
|
574
|
-
environment_id: string;
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* Timestamp when the message delivery log was created.
|
|
578
|
-
*/
|
|
579
|
-
inserted_at: string;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* A message delivery log request.
|
|
583
|
-
*/
|
|
584
|
-
request: MessageDeliveryLog.Request;
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* A message delivery log response.
|
|
588
|
-
*/
|
|
589
|
-
response: MessageDeliveryLog.Response;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* The name of the service that processed the delivery.
|
|
593
|
-
*/
|
|
594
|
-
service_name: string;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
export namespace MessageDeliveryLog {
|
|
598
|
-
/**
|
|
599
|
-
* A message delivery log request.
|
|
600
|
-
*/
|
|
601
|
-
export interface Request {
|
|
602
|
-
/**
|
|
603
|
-
* The body content that was sent with the request.
|
|
604
|
-
*/
|
|
605
|
-
body?: string | { [key: string]: unknown };
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* The headers that were sent with the request.
|
|
609
|
-
*/
|
|
610
|
-
headers?: { [key: string]: unknown } | null;
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* The host to which the request was sent.
|
|
614
|
-
*/
|
|
615
|
-
host?: string;
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* The HTTP method used for the request.
|
|
619
|
-
*/
|
|
620
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
621
|
-
|
|
622
|
-
/**
|
|
623
|
-
* The path of the URL that was requested.
|
|
624
|
-
*/
|
|
625
|
-
path?: string;
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* The query string of the URL that was requested.
|
|
629
|
-
*/
|
|
630
|
-
query?: string | null;
|
|
631
|
-
}
|
|
572
|
+
email?: string | null;
|
|
632
573
|
|
|
633
|
-
/**
|
|
634
|
-
* A message delivery log response.
|
|
635
|
-
*/
|
|
636
|
-
export interface Response {
|
|
637
574
|
/**
|
|
638
|
-
* The
|
|
575
|
+
* The recipient name at send time (email channels)
|
|
639
576
|
*/
|
|
640
|
-
|
|
577
|
+
name?: string | null;
|
|
641
578
|
|
|
642
579
|
/**
|
|
643
|
-
* The
|
|
580
|
+
* The chat user the message was direct-messaged to (chat channels)
|
|
644
581
|
*/
|
|
645
|
-
|
|
582
|
+
user_id?: string | null;
|
|
646
583
|
|
|
647
584
|
/**
|
|
648
|
-
*
|
|
585
|
+
* Whether the chat message was delivered via an incoming webhook
|
|
649
586
|
*/
|
|
650
|
-
|
|
587
|
+
via_incoming_webhook?: boolean | null;
|
|
651
588
|
}
|
|
652
589
|
}
|
|
653
590
|
|
|
654
|
-
/**
|
|
655
|
-
* A message event. Occurs when a message
|
|
656
|
-
* [delivery or engagement status](/send-notifications/message-statuses) changes.
|
|
657
|
-
*/
|
|
658
|
-
export interface MessageEvent {
|
|
659
|
-
/**
|
|
660
|
-
* The unique identifier for the message event.
|
|
661
|
-
*/
|
|
662
|
-
id: string;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* The typename of the schema.
|
|
666
|
-
*/
|
|
667
|
-
__typename: string;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Timestamp when the event was created.
|
|
671
|
-
*/
|
|
672
|
-
inserted_at: string;
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* A reference to a recipient, either a user identifier (string) or an object
|
|
676
|
-
* reference (ID, collection).
|
|
677
|
-
*/
|
|
678
|
-
recipient: RecipientsAPI.RecipientReference;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* The type of event that occurred.
|
|
682
|
-
*/
|
|
683
|
-
type:
|
|
684
|
-
| 'message.read'
|
|
685
|
-
| 'message.sent'
|
|
686
|
-
| 'message.seen'
|
|
687
|
-
| 'message.created'
|
|
688
|
-
| 'message.queued'
|
|
689
|
-
| 'message.delivered'
|
|
690
|
-
| 'message.bounced'
|
|
691
|
-
| 'message.undelivered'
|
|
692
|
-
| 'message.not_sent'
|
|
693
|
-
| 'message.delivery_attempted'
|
|
694
|
-
| 'message.archived'
|
|
695
|
-
| 'message.link_clicked'
|
|
696
|
-
| 'message.interacted'
|
|
697
|
-
| 'message.unseen'
|
|
698
|
-
| 'message.unread'
|
|
699
|
-
| 'message.unarchived';
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* The data associated with the message event. Only present for some event types.
|
|
703
|
-
*/
|
|
704
|
-
data?: { [key: string]: unknown } | null;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
591
|
/**
|
|
708
592
|
* The content of a message.
|
|
709
593
|
*/
|
|
710
|
-
export interface
|
|
594
|
+
export interface MessageContents {
|
|
711
595
|
/**
|
|
712
596
|
* The typename of the schema.
|
|
713
597
|
*/
|
|
@@ -717,11 +601,11 @@ export interface MessageGetContentResponse {
|
|
|
717
601
|
* Content data specific to the channel type.
|
|
718
602
|
*/
|
|
719
603
|
data:
|
|
720
|
-
|
|
|
721
|
-
|
|
|
722
|
-
|
|
|
723
|
-
|
|
|
724
|
-
|
|
|
604
|
+
| MessageContents.MessageEmailContent
|
|
605
|
+
| MessageContents.MessageSMSContent
|
|
606
|
+
| MessageContents.MessagePushContent
|
|
607
|
+
| MessageContents.MessageChatContent
|
|
608
|
+
| MessageContents.MessageInAppFeedContent;
|
|
725
609
|
|
|
726
610
|
/**
|
|
727
611
|
* Timestamp when the message content was created.
|
|
@@ -734,7 +618,7 @@ export interface MessageGetContentResponse {
|
|
|
734
618
|
message_id: string;
|
|
735
619
|
}
|
|
736
620
|
|
|
737
|
-
export namespace
|
|
621
|
+
export namespace MessageContents {
|
|
738
622
|
/**
|
|
739
623
|
* The content of an email message.
|
|
740
624
|
*/
|
|
@@ -916,82 +800,228 @@ export namespace MessageGetContentResponse {
|
|
|
916
800
|
/**
|
|
917
801
|
* The blocks of the message in an app feed.
|
|
918
802
|
*/
|
|
919
|
-
blocks: Array<
|
|
920
|
-
| MessageInAppFeedContent.MessageInAppFeedContentBlock
|
|
921
|
-
| MessageInAppFeedContent.MessageInAppFeedButtonSetBlock
|
|
922
|
-
>;
|
|
803
|
+
blocks: Array<MessagesAPI.MessageInAppFeedContentBlock | MessagesAPI.MessageInAppFeedButtonSetBlock>;
|
|
923
804
|
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* A message delivery log contains a `request` from Knock to a downstream provider
|
|
809
|
+
* and the `response` that was returned.
|
|
810
|
+
*/
|
|
811
|
+
export interface MessageDeliveryLog {
|
|
812
|
+
/**
|
|
813
|
+
* The unique identifier for the message delivery log.
|
|
814
|
+
*/
|
|
815
|
+
id: string;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* The typename of the schema.
|
|
819
|
+
*/
|
|
820
|
+
__typename: string;
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* The ID of the environment in which the message delivery occurred.
|
|
824
|
+
*/
|
|
825
|
+
environment_id: string;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Timestamp when the message delivery log was created.
|
|
829
|
+
*/
|
|
830
|
+
inserted_at: string;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* A message delivery log request.
|
|
834
|
+
*/
|
|
835
|
+
request: MessageDeliveryLog.Request;
|
|
924
836
|
|
|
925
|
-
|
|
837
|
+
/**
|
|
838
|
+
* A message delivery log response.
|
|
839
|
+
*/
|
|
840
|
+
response: MessageDeliveryLog.Response;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* The name of the service that processed the delivery.
|
|
844
|
+
*/
|
|
845
|
+
service_name: string;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export namespace MessageDeliveryLog {
|
|
849
|
+
/**
|
|
850
|
+
* A message delivery log request.
|
|
851
|
+
*/
|
|
852
|
+
export interface Request {
|
|
926
853
|
/**
|
|
927
|
-
*
|
|
854
|
+
* The body content that was sent with the request.
|
|
928
855
|
*/
|
|
929
|
-
|
|
930
|
-
/**
|
|
931
|
-
* The content of the block in a message in an app feed.
|
|
932
|
-
*/
|
|
933
|
-
content: string;
|
|
856
|
+
body?: string | { [key: string]: unknown };
|
|
934
857
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
858
|
+
/**
|
|
859
|
+
* The headers that were sent with the request.
|
|
860
|
+
*/
|
|
861
|
+
headers?: { [key: string]: unknown } | null;
|
|
939
862
|
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
863
|
+
/**
|
|
864
|
+
* The host to which the request was sent.
|
|
865
|
+
*/
|
|
866
|
+
host?: string;
|
|
944
867
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
868
|
+
/**
|
|
869
|
+
* The HTTP method used for the request.
|
|
870
|
+
*/
|
|
871
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
950
872
|
|
|
951
873
|
/**
|
|
952
|
-
*
|
|
874
|
+
* The path of the URL that was requested.
|
|
953
875
|
*/
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* A list of buttons in an in app feed message.
|
|
957
|
-
*/
|
|
958
|
-
buttons: Array<MessageInAppFeedButtonSetBlock.Button>;
|
|
876
|
+
path?: string;
|
|
959
877
|
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
878
|
+
/**
|
|
879
|
+
* The query string of the URL that was requested.
|
|
880
|
+
*/
|
|
881
|
+
query?: string | null;
|
|
882
|
+
}
|
|
964
883
|
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
884
|
+
/**
|
|
885
|
+
* A message delivery log response.
|
|
886
|
+
*/
|
|
887
|
+
export interface Response {
|
|
888
|
+
/**
|
|
889
|
+
* The body content that was received with the response.
|
|
890
|
+
*/
|
|
891
|
+
body?: string | { [key: string]: unknown };
|
|
970
892
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
export interface Button {
|
|
976
|
-
/**
|
|
977
|
-
* The action to take when the button is clicked.
|
|
978
|
-
*/
|
|
979
|
-
action: string;
|
|
893
|
+
/**
|
|
894
|
+
* The headers that were received with the response.
|
|
895
|
+
*/
|
|
896
|
+
headers?: { [key: string]: unknown } | null;
|
|
980
897
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
898
|
+
/**
|
|
899
|
+
* The HTTP status code of the response.
|
|
900
|
+
*/
|
|
901
|
+
status?: number;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
985
904
|
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
905
|
+
/**
|
|
906
|
+
* A message event. Occurs when a message
|
|
907
|
+
* [delivery or engagement status](/send-notifications/message-statuses) changes.
|
|
908
|
+
*/
|
|
909
|
+
export interface MessageEvent {
|
|
910
|
+
/**
|
|
911
|
+
* The unique identifier for the message event.
|
|
912
|
+
*/
|
|
913
|
+
id: string;
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* The typename of the schema.
|
|
917
|
+
*/
|
|
918
|
+
__typename: string;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Timestamp when the event was created.
|
|
922
|
+
*/
|
|
923
|
+
inserted_at: string;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* A reference to a recipient, either a user identifier (string) or an object
|
|
927
|
+
* reference (ID, collection).
|
|
928
|
+
*/
|
|
929
|
+
recipient: RecipientsAPI.RecipientReference;
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* The type of event that occurred.
|
|
933
|
+
*/
|
|
934
|
+
type:
|
|
935
|
+
| 'message.read'
|
|
936
|
+
| 'message.sent'
|
|
937
|
+
| 'message.seen'
|
|
938
|
+
| 'message.created'
|
|
939
|
+
| 'message.queued'
|
|
940
|
+
| 'message.delivered'
|
|
941
|
+
| 'message.delivery_attempted'
|
|
942
|
+
| 'message.undelivered'
|
|
943
|
+
| 'message.bounced'
|
|
944
|
+
| 'message.not_sent'
|
|
945
|
+
| 'message.archived'
|
|
946
|
+
| 'message.link_clicked'
|
|
947
|
+
| 'message.interacted'
|
|
948
|
+
| 'message.unread'
|
|
949
|
+
| 'message.unseen'
|
|
950
|
+
| 'message.unarchived';
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* The data associated with the message event. Only present for some event types.
|
|
954
|
+
*/
|
|
955
|
+
data?: { [key: string]: unknown } | null;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* A button set block in a message in an app feed.
|
|
960
|
+
*/
|
|
961
|
+
export interface MessageInAppFeedButtonSetBlock {
|
|
962
|
+
/**
|
|
963
|
+
* A list of buttons in an in app feed message.
|
|
964
|
+
*/
|
|
965
|
+
buttons: Array<MessageInAppFeedButtonSetBlock.Button>;
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* The name of the button set in a message in an app feed.
|
|
969
|
+
*/
|
|
970
|
+
name: string;
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* The type of block in a message in an app feed.
|
|
974
|
+
*/
|
|
975
|
+
type: 'button_set';
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
export namespace MessageInAppFeedButtonSetBlock {
|
|
979
|
+
/**
|
|
980
|
+
* A button in an in app feed message.
|
|
981
|
+
*/
|
|
982
|
+
export interface Button {
|
|
983
|
+
/**
|
|
984
|
+
* The action to take when the button is clicked.
|
|
985
|
+
*/
|
|
986
|
+
action: string;
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* The label of the button.
|
|
990
|
+
*/
|
|
991
|
+
label: string;
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* The name of the button.
|
|
995
|
+
*/
|
|
996
|
+
name: string;
|
|
992
997
|
}
|
|
993
998
|
}
|
|
994
999
|
|
|
1000
|
+
/**
|
|
1001
|
+
* A block in a message in an app feed.
|
|
1002
|
+
*/
|
|
1003
|
+
export interface MessageInAppFeedContentBlock {
|
|
1004
|
+
/**
|
|
1005
|
+
* The content of the block in a message in an app feed.
|
|
1006
|
+
*/
|
|
1007
|
+
content: string;
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* The name of the block in a message in an app feed.
|
|
1011
|
+
*/
|
|
1012
|
+
name: string;
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* The rendered HTML version of the content.
|
|
1016
|
+
*/
|
|
1017
|
+
rendered: string;
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* The type of block in a message in an app feed.
|
|
1021
|
+
*/
|
|
1022
|
+
type: 'markdown' | 'text';
|
|
1023
|
+
}
|
|
1024
|
+
|
|
995
1025
|
export interface MessageListParams extends ItemsCursorParams {
|
|
996
1026
|
/**
|
|
997
1027
|
* Limits the results to items with the corresponding channel ID.
|
|
@@ -1101,10 +1131,13 @@ Messages.Batch = Batch;
|
|
|
1101
1131
|
export declare namespace Messages {
|
|
1102
1132
|
export {
|
|
1103
1133
|
type Activity as Activity,
|
|
1134
|
+
type ListMessagesResponse as ListMessagesResponse,
|
|
1104
1135
|
type Message as Message,
|
|
1136
|
+
type MessageContents as MessageContents,
|
|
1105
1137
|
type MessageDeliveryLog as MessageDeliveryLog,
|
|
1106
1138
|
type MessageEvent as MessageEvent,
|
|
1107
|
-
type
|
|
1139
|
+
type MessageInAppFeedButtonSetBlock as MessageInAppFeedButtonSetBlock,
|
|
1140
|
+
type MessageInAppFeedContentBlock as MessageInAppFeedContentBlock,
|
|
1108
1141
|
type MessagesItemsCursor as MessagesItemsCursor,
|
|
1109
1142
|
type ActivitiesItemsCursor as ActivitiesItemsCursor,
|
|
1110
1143
|
type MessageDeliveryLogsItemsCursor as MessageDeliveryLogsItemsCursor,
|
|
@@ -1118,6 +1151,7 @@ export declare namespace Messages {
|
|
|
1118
1151
|
|
|
1119
1152
|
export {
|
|
1120
1153
|
Batch as Batch,
|
|
1154
|
+
type BatchMessagesStatusRequest as BatchMessagesStatusRequest,
|
|
1121
1155
|
type BatchArchiveResponse as BatchArchiveResponse,
|
|
1122
1156
|
type BatchGetContentResponse as BatchGetContentResponse,
|
|
1123
1157
|
type BatchMarkAsInteractedResponse as BatchMarkAsInteractedResponse,
|
|
@@ -19,6 +19,7 @@ import * as SubscriptionsAPI from '../recipients/subscriptions';
|
|
|
19
19
|
import { SubscriptionsEntriesCursor } from '../recipients/subscriptions';
|
|
20
20
|
import * as SchedulesAPI from '../schedules/schedules';
|
|
21
21
|
import { SchedulesEntriesCursor } from '../schedules/schedules';
|
|
22
|
+
import * as UsersAPI from '../users/users';
|
|
22
23
|
import { APIPromise } from '../../core/api-promise';
|
|
23
24
|
import {
|
|
24
25
|
EntriesCursor,
|
|
@@ -787,9 +788,11 @@ export interface ObjectSetPreferencesParams {
|
|
|
787
788
|
|
|
788
789
|
/**
|
|
789
790
|
* Whether the recipient is subscribed to commercial communications. When false,
|
|
790
|
-
* the recipient will not receive commercial workflow notifications.
|
|
791
|
+
* the recipient will not receive commercial workflow notifications. Can also be
|
|
792
|
+
* set to a settings object with conditions that are evaluated at notification send
|
|
793
|
+
* time.
|
|
791
794
|
*/
|
|
792
|
-
commercial_subscribed?: boolean | null;
|
|
795
|
+
commercial_subscribed?: boolean | UsersAPI.PreferenceSetCommercialSubscribedSetting | null;
|
|
793
796
|
|
|
794
797
|
/**
|
|
795
798
|
* An object where the key is the workflow key and the values are the preference
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as PreferencesAPI from './preferences';
|
|
5
5
|
import * as Shared from '../shared';
|
|
6
|
+
import * as UsersAPI from '../users/users';
|
|
6
7
|
|
|
7
8
|
export class Preferences extends APIResource {}
|
|
8
9
|
|
|
@@ -41,9 +42,11 @@ export interface PreferenceSet {
|
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Whether the recipient is subscribed to commercial communications. When false,
|
|
44
|
-
* the recipient will not receive commercial workflow notifications.
|
|
45
|
+
* the recipient will not receive commercial workflow notifications. Can also be
|
|
46
|
+
* set to a settings object with conditions that are evaluated at notification send
|
|
47
|
+
* time.
|
|
45
48
|
*/
|
|
46
|
-
commercial_subscribed?: boolean | null;
|
|
49
|
+
commercial_subscribed?: boolean | UsersAPI.PreferenceSetCommercialSubscribedSetting | null;
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* An object where the key is the workflow key and the values are the preference
|
|
@@ -183,9 +186,11 @@ export interface PreferenceSetRequest {
|
|
|
183
186
|
|
|
184
187
|
/**
|
|
185
188
|
* Whether the recipient is subscribed to commercial communications. When false,
|
|
186
|
-
* the recipient will not receive commercial workflow notifications.
|
|
189
|
+
* the recipient will not receive commercial workflow notifications. Can also be
|
|
190
|
+
* set to a settings object with conditions that are evaluated at notification send
|
|
191
|
+
* time.
|
|
187
192
|
*/
|
|
188
|
-
commercial_subscribed?: boolean | null;
|
|
193
|
+
commercial_subscribed?: boolean | UsersAPI.PreferenceSetCommercialSubscribedSetting | null;
|
|
189
194
|
|
|
190
195
|
/**
|
|
191
196
|
* An object where the key is the workflow key and the values are the preference
|
|
@@ -154,9 +154,11 @@ export namespace BulkSetPreferencesParams {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Whether the recipient is subscribed to commercial communications. When false,
|
|
157
|
-
* the recipient will not receive commercial workflow notifications.
|
|
157
|
+
* the recipient will not receive commercial workflow notifications. Can also be
|
|
158
|
+
* set to a settings object with conditions that are evaluated at notification send
|
|
159
|
+
* time.
|
|
158
160
|
*/
|
|
159
|
-
commercial_subscribed?: boolean | null;
|
|
161
|
+
commercial_subscribed?: boolean | UsersAPI.PreferenceSetCommercialSubscribedSetting | null;
|
|
160
162
|
|
|
161
163
|
/**
|
|
162
164
|
* An object where the key is the workflow key and the values are the preference
|