@knocklabs/node 1.34.0 → 1.36.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 +56 -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 +40 -0
  48. package/resources/recipients/channel-data.d.mts.map +1 -1
  49. package/resources/recipients/channel-data.d.ts +40 -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 +253 -218
  103. package/src/resources/objects/objects.ts +5 -2
  104. package/src/resources/recipients/channel-data.ts +47 -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
546
- */
547
- email?: string;
548
-
549
- /**
550
- * The recipient name at send time
551
- */
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.
565
+ * The chat channel the message was delivered to (chat channels)
619
566
  */
620
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
567
+ channel_id?: string | null;
621
568
 
622
569
  /**
623
- * The path of the URL that was requested.
570
+ * The email address the message was delivered to (email channels)
624
571
  */
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,229 @@ 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;
836
+
837
+ /**
838
+ * A message delivery log response.
839
+ */
840
+ response: MessageDeliveryLog.Response;
924
841
 
925
- export namespace MessageInAppFeedContent {
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.created'
936
+ | 'message.queued'
937
+ | 'message.sent'
938
+ | 'message.not_sent'
939
+ | 'message.delivered'
940
+ | 'message.delivery_attempted'
941
+ | 'message.undelivered'
942
+ | 'message.bounced'
943
+ | 'message.complaint'
944
+ | 'message.read'
945
+ | 'message.unread'
946
+ | 'message.seen'
947
+ | 'message.unseen'
948
+ | 'message.archived'
949
+ | 'message.unarchived'
950
+ | 'message.interacted'
951
+ | 'message.link_clicked';
952
+
953
+ /**
954
+ * The data associated with the message event. Only present for some event types.
955
+ */
956
+ data?: { [key: string]: unknown } | null;
957
+ }
958
+
959
+ /**
960
+ * A button set block in a message in an app feed.
961
+ */
962
+ export interface MessageInAppFeedButtonSetBlock {
963
+ /**
964
+ * A list of buttons in an in app feed message.
965
+ */
966
+ buttons: Array<MessageInAppFeedButtonSetBlock.Button>;
967
+
968
+ /**
969
+ * The name of the button set in a message in an app feed.
970
+ */
971
+ name: string;
972
+
973
+ /**
974
+ * The type of block in a message in an app feed.
975
+ */
976
+ type: 'button_set';
977
+ }
978
+
979
+ export namespace MessageInAppFeedButtonSetBlock {
980
+ /**
981
+ * A button in an in app feed message.
982
+ */
983
+ export interface Button {
984
+ /**
985
+ * The action to take when the button is clicked.
986
+ */
987
+ action: string;
988
+
989
+ /**
990
+ * The label of the button.
991
+ */
992
+ label: string;
993
+
994
+ /**
995
+ * The name of the button.
996
+ */
997
+ name: string;
992
998
  }
993
999
  }
994
1000
 
1001
+ /**
1002
+ * A block in a message in an app feed.
1003
+ */
1004
+ export interface MessageInAppFeedContentBlock {
1005
+ /**
1006
+ * The content of the block in a message in an app feed.
1007
+ */
1008
+ content: string;
1009
+
1010
+ /**
1011
+ * The name of the block in a message in an app feed.
1012
+ */
1013
+ name: string;
1014
+
1015
+ /**
1016
+ * The rendered HTML version of the content.
1017
+ */
1018
+ rendered: string;
1019
+
1020
+ /**
1021
+ * The type of block in a message in an app feed.
1022
+ */
1023
+ type: 'markdown' | 'text';
1024
+ }
1025
+
995
1026
  export interface MessageListParams extends ItemsCursorParams {
996
1027
  /**
997
1028
  * Limits the results to items with the corresponding channel ID.
@@ -1101,10 +1132,13 @@ Messages.Batch = Batch;
1101
1132
  export declare namespace Messages {
1102
1133
  export {
1103
1134
  type Activity as Activity,
1135
+ type ListMessagesResponse as ListMessagesResponse,
1104
1136
  type Message as Message,
1137
+ type MessageContents as MessageContents,
1105
1138
  type MessageDeliveryLog as MessageDeliveryLog,
1106
1139
  type MessageEvent as MessageEvent,
1107
- type MessageGetContentResponse as MessageGetContentResponse,
1140
+ type MessageInAppFeedButtonSetBlock as MessageInAppFeedButtonSetBlock,
1141
+ type MessageInAppFeedContentBlock as MessageInAppFeedContentBlock,
1108
1142
  type MessagesItemsCursor as MessagesItemsCursor,
1109
1143
  type ActivitiesItemsCursor as ActivitiesItemsCursor,
1110
1144
  type MessageDeliveryLogsItemsCursor as MessageDeliveryLogsItemsCursor,
@@ -1118,6 +1152,7 @@ export declare namespace Messages {
1118
1152
 
1119
1153
  export {
1120
1154
  Batch as Batch,
1155
+ type BatchMessagesStatusRequest as BatchMessagesStatusRequest,
1121
1156
  type BatchArchiveResponse as BatchArchiveResponse,
1122
1157
  type BatchGetContentResponse as BatchGetContentResponse,
1123
1158
  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
@@ -213,6 +213,13 @@ export namespace DiscordChannelData {
213
213
  * Discord channel ID.
214
214
  */
215
215
  channel_id: string;
216
+
217
+ /**
218
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
219
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
220
+ * this tenant, Knock prefers this connection over untagged connections.
221
+ */
222
+ knock_tenant_id?: string | null;
216
223
  }
217
224
 
218
225
  /**
@@ -223,6 +230,13 @@ export namespace DiscordChannelData {
223
230
  * Discord incoming webhook object.
224
231
  */
225
232
  incoming_webhook: DiscordIncomingWebhookConnection.IncomingWebhook;
233
+
234
+ /**
235
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
236
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
237
+ * this tenant, Knock prefers this connection over untagged connections.
238
+ */
239
+ knock_tenant_id?: string | null;
226
240
  }
227
241
 
228
242
  export namespace DiscordIncomingWebhookConnection {
@@ -275,6 +289,13 @@ export namespace MsTeamsChannelData {
275
289
  * Microsoft Teams token connection.
276
290
  */
277
291
  export interface MsTeamsTokenConnection {
292
+ /**
293
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
294
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
295
+ * this tenant, Knock prefers this connection over untagged connections.
296
+ */
297
+ knock_tenant_id?: string | null;
298
+
278
299
  /**
279
300
  * Microsoft Teams channel ID.
280
301
  */
@@ -304,6 +325,13 @@ export namespace MsTeamsChannelData {
304
325
  * Microsoft Teams incoming webhook.
305
326
  */
306
327
  incoming_webhook: MsTeamsIncomingWebhookConnection.IncomingWebhook;
328
+
329
+ /**
330
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
331
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
332
+ * this tenant, Knock prefers this connection over untagged connections.
333
+ */
334
+ knock_tenant_id?: string | null;
307
335
  }
308
336
 
309
337
  export namespace MsTeamsIncomingWebhookConnection {
@@ -403,6 +431,18 @@ export namespace SlackChannelData {
403
431
  */
404
432
  channel_id?: string | null;
405
433
 
434
+ /**
435
+ * Slack channel name.
436
+ */
437
+ channel_name?: string | null;
438
+
439
+ /**
440
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
441
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
442
+ * this tenant, Knock prefers this connection over untagged connections.
443
+ */
444
+ knock_tenant_id?: string | null;
445
+
406
446
  /**
407
447
  * A Slack user ID from the Slack provider.
408
448
  */
@@ -417,6 +457,13 @@ export namespace SlackChannelData {
417
457
  * A Slack connection incoming webhook.
418
458
  */
419
459
  incoming_webhook: SlackIncomingWebhookConnection.IncomingWebhook;
460
+
461
+ /**
462
+ * An optional Knock tenant ID (`knock_tenant_id`) that scopes this connection.
463
+ * Distinct from provider-specific tenant IDs. When a workflow is triggered with
464
+ * this tenant, Knock prefers this connection over untagged connections.
465
+ */
466
+ knock_tenant_id?: string | null;
420
467
  }
421
468
 
422
469
  export namespace SlackIncomingWebhookConnection {