@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.
Files changed (116) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +2 -2
  9. package/resources/audiences.d.mts +19 -39
  10. package/resources/audiences.d.mts.map +1 -1
  11. package/resources/audiences.d.ts +19 -39
  12. package/resources/audiences.d.ts.map +1 -1
  13. package/resources/index.d.mts +3 -3
  14. package/resources/index.d.mts.map +1 -1
  15. package/resources/index.d.ts +3 -3
  16. package/resources/index.d.ts.map +1 -1
  17. package/resources/index.js.map +1 -1
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/messages/batch.d.mts +15 -252
  20. package/resources/messages/batch.d.mts.map +1 -1
  21. package/resources/messages/batch.d.ts +15 -252
  22. package/resources/messages/batch.d.ts.map +1 -1
  23. package/resources/messages/batch.js +4 -3
  24. package/resources/messages/batch.js.map +1 -1
  25. package/resources/messages/batch.mjs +4 -3
  26. package/resources/messages/batch.mjs.map +1 -1
  27. package/resources/messages/index.d.mts +2 -2
  28. package/resources/messages/index.d.mts.map +1 -1
  29. package/resources/messages/index.d.ts +2 -2
  30. package/resources/messages/index.d.ts.map +1 -1
  31. package/resources/messages/index.js.map +1 -1
  32. package/resources/messages/index.mjs.map +1 -1
  33. package/resources/messages/messages.d.mts +215 -188
  34. package/resources/messages/messages.d.mts.map +1 -1
  35. package/resources/messages/messages.d.ts +215 -188
  36. package/resources/messages/messages.d.ts.map +1 -1
  37. package/resources/messages/messages.js +1 -1
  38. package/resources/messages/messages.js.map +1 -1
  39. package/resources/messages/messages.mjs +1 -1
  40. package/resources/messages/messages.mjs.map +1 -1
  41. package/resources/objects/objects.d.mts +5 -2
  42. package/resources/objects/objects.d.mts.map +1 -1
  43. package/resources/objects/objects.d.ts +5 -2
  44. package/resources/objects/objects.d.ts.map +1 -1
  45. package/resources/objects/objects.js.map +1 -1
  46. package/resources/objects/objects.mjs.map +1 -1
  47. package/resources/recipients/channel-data.d.mts +4 -0
  48. package/resources/recipients/channel-data.d.mts.map +1 -1
  49. package/resources/recipients/channel-data.d.ts +4 -0
  50. package/resources/recipients/channel-data.d.ts.map +1 -1
  51. package/resources/recipients/preferences.d.mts +9 -4
  52. package/resources/recipients/preferences.d.mts.map +1 -1
  53. package/resources/recipients/preferences.d.ts +9 -4
  54. package/resources/recipients/preferences.d.ts.map +1 -1
  55. package/resources/recipients/preferences.js.map +1 -1
  56. package/resources/recipients/preferences.mjs.map +1 -1
  57. package/resources/users/bulk.d.mts +4 -2
  58. package/resources/users/bulk.d.mts.map +1 -1
  59. package/resources/users/bulk.d.ts +4 -2
  60. package/resources/users/bulk.d.ts.map +1 -1
  61. package/resources/users/feeds.d.mts +1 -58
  62. package/resources/users/feeds.d.mts.map +1 -1
  63. package/resources/users/feeds.d.ts +1 -58
  64. package/resources/users/feeds.d.ts.map +1 -1
  65. package/resources/users/guides.d.mts +190 -108
  66. package/resources/users/guides.d.mts.map +1 -1
  67. package/resources/users/guides.d.ts +190 -108
  68. package/resources/users/guides.d.ts.map +1 -1
  69. package/resources/users/guides.js +55 -43
  70. package/resources/users/guides.js.map +1 -1
  71. package/resources/users/guides.mjs +55 -43
  72. package/resources/users/guides.mjs.map +1 -1
  73. package/resources/users/index.d.mts +3 -2
  74. package/resources/users/index.d.mts.map +1 -1
  75. package/resources/users/index.d.ts +3 -2
  76. package/resources/users/index.d.ts.map +1 -1
  77. package/resources/users/index.js +3 -1
  78. package/resources/users/index.js.map +1 -1
  79. package/resources/users/index.mjs +1 -0
  80. package/resources/users/index.mjs.map +1 -1
  81. package/resources/users/preference-center.d.mts +175 -0
  82. package/resources/users/preference-center.d.mts.map +1 -0
  83. package/resources/users/preference-center.d.ts +175 -0
  84. package/resources/users/preference-center.d.ts.map +1 -0
  85. package/resources/users/preference-center.js +41 -0
  86. package/resources/users/preference-center.js.map +1 -0
  87. package/resources/users/preference-center.mjs +37 -0
  88. package/resources/users/preference-center.mjs.map +1 -0
  89. package/resources/users/users.d.mts +47 -5
  90. package/resources/users/users.d.mts.map +1 -1
  91. package/resources/users/users.d.ts +47 -5
  92. package/resources/users/users.d.ts.map +1 -1
  93. package/resources/users/users.js +4 -0
  94. package/resources/users/users.js.map +1 -1
  95. package/resources/users/users.mjs +4 -0
  96. package/resources/users/users.mjs.map +1 -1
  97. package/src/client.ts +16 -2
  98. package/src/resources/audiences.ts +21 -42
  99. package/src/resources/index.ts +8 -1
  100. package/src/resources/messages/batch.ts +16 -294
  101. package/src/resources/messages/index.ts +5 -1
  102. package/src/resources/messages/messages.ts +252 -218
  103. package/src/resources/objects/objects.ts +5 -2
  104. package/src/resources/recipients/channel-data.ts +5 -0
  105. package/src/resources/recipients/preferences.ts +9 -4
  106. package/src/resources/users/bulk.ts +4 -2
  107. package/src/resources/users/feeds.ts +1 -70
  108. package/src/resources/users/guides.ts +228 -120
  109. package/src/resources/users/index.ts +15 -3
  110. package/src/resources/users/preference-center.ts +224 -0
  111. package/src/resources/users/users.ts +78 -8
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. 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 response = await client.messages.getContent(
92
+ * const messageContents = await client.messages.getContent(
90
93
  * 'message_id',
91
94
  * );
92
95
  * ```
93
96
  */
94
- getContent(messageID: string, options?: RequestOptions): APIPromise<MessageGetContentResponse> {
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
- * Recipient contact information captured at email send time. Null for non-email
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
- * Recipient contact information captured at email send time. Null for non-email
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 email address the message was delivered to
565
+ * The chat channel the message was delivered to (chat channels)
546
566
  */
547
- email?: string;
567
+ channel_id?: string | null;
548
568
 
549
569
  /**
550
- * The recipient name at send time
570
+ * The email address the message was delivered to (email channels)
551
571
  */
552
- name?: string | null;
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 body content that was received with the response.
575
+ * The recipient name at send time (email channels)
639
576
  */
640
- body?: string | { [key: string]: unknown };
577
+ name?: string | null;
641
578
 
642
579
  /**
643
- * The headers that were received with the response.
580
+ * The chat user the message was direct-messaged to (chat channels)
644
581
  */
645
- headers?: { [key: string]: unknown } | null;
582
+ user_id?: string | null;
646
583
 
647
584
  /**
648
- * The HTTP status code of the response.
585
+ * Whether the chat message was delivered via an incoming webhook
649
586
  */
650
- status?: number;
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 MessageGetContentResponse {
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
- | MessageGetContentResponse.MessageEmailContent
721
- | MessageGetContentResponse.MessageSMSContent
722
- | MessageGetContentResponse.MessagePushContent
723
- | MessageGetContentResponse.MessageChatContent
724
- | MessageGetContentResponse.MessageInAppFeedContent;
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 MessageGetContentResponse {
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
- export namespace MessageInAppFeedContent {
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
- * A block in a message in an app feed.
854
+ * The body content that was sent with the request.
928
855
  */
929
- export interface MessageInAppFeedContentBlock {
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
- * The name of the block in a message in an app feed.
937
- */
938
- name: string;
858
+ /**
859
+ * The headers that were sent with the request.
860
+ */
861
+ headers?: { [key: string]: unknown } | null;
939
862
 
940
- /**
941
- * The rendered HTML version of the content.
942
- */
943
- rendered: string;
863
+ /**
864
+ * The host to which the request was sent.
865
+ */
866
+ host?: string;
944
867
 
945
- /**
946
- * The type of block in a message in an app feed.
947
- */
948
- type: 'markdown' | 'text';
949
- }
868
+ /**
869
+ * The HTTP method used for the request.
870
+ */
871
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
950
872
 
951
873
  /**
952
- * A button set block in a message in an app feed.
874
+ * The path of the URL that was requested.
953
875
  */
954
- export interface MessageInAppFeedButtonSetBlock {
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
- * The name of the button set in a message in an app feed.
962
- */
963
- name: string;
878
+ /**
879
+ * The query string of the URL that was requested.
880
+ */
881
+ query?: string | null;
882
+ }
964
883
 
965
- /**
966
- * The type of block in a message in an app feed.
967
- */
968
- type: 'button_set';
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
- export namespace MessageInAppFeedButtonSetBlock {
972
- /**
973
- * A button in an in app feed message.
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
- * The label of the button.
983
- */
984
- label: string;
898
+ /**
899
+ * The HTTP status code of the response.
900
+ */
901
+ status?: number;
902
+ }
903
+ }
985
904
 
986
- /**
987
- * The name of the button.
988
- */
989
- name: string;
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 MessageGetContentResponse as MessageGetContentResponse,
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
@@ -403,6 +403,11 @@ export namespace SlackChannelData {
403
403
  */
404
404
  channel_id?: string | null;
405
405
 
406
+ /**
407
+ * Slack channel name.
408
+ */
409
+ channel_name?: string | null;
410
+
406
411
  /**
407
412
  * A Slack user ID from the Slack provider.
408
413
  */
@@ -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