@trycourier/courier 6.2.1 → 6.2.3

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 (147) hide show
  1. package/Client.d.ts +71 -10
  2. package/Client.js +72 -11
  3. package/api/client/requests/SendMessageRequest.d.ts +71 -10
  4. package/api/resources/audiences/client/Client.js +5 -5
  5. package/api/resources/auditEvents/client/Client.js +2 -2
  6. package/api/resources/authTokens/client/Client.js +1 -1
  7. package/api/resources/automations/client/Client.js +2 -2
  8. package/api/resources/brands/client/Client.d.ts +38 -4
  9. package/api/resources/brands/client/Client.js +43 -9
  10. package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
  11. package/api/resources/bulk/client/Client.d.ts +91 -3
  12. package/api/resources/bulk/client/Client.js +96 -8
  13. package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +70 -1
  14. package/api/resources/inbound/client/Client.js +1 -1
  15. package/api/resources/lists/client/Client.d.ts +8 -96
  16. package/api/resources/lists/client/Client.js +18 -106
  17. package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
  18. package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
  19. package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
  20. package/api/resources/messages/client/Client.js +6 -6
  21. package/api/resources/notifications/client/Client.d.ts +2 -1
  22. package/api/resources/notifications/client/Client.js +12 -8
  23. package/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -1
  24. package/api/resources/notifications/types/Notification.d.ts +1 -0
  25. package/api/resources/profiles/client/Client.d.ts +7 -1
  26. package/api/resources/profiles/client/Client.js +14 -8
  27. package/api/resources/profiles/types/Pagerduty.d.ts +9 -0
  28. package/api/resources/profiles/types/UserProfile.d.ts +1 -1
  29. package/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +4 -0
  30. package/api/resources/profiles/types/WebhookAuthMode.d.ts +9 -0
  31. package/api/resources/profiles/types/WebhookAuthMode.js +11 -0
  32. package/api/resources/profiles/types/WebhookAuthentication.d.ts +14 -0
  33. package/api/resources/profiles/types/WebhookAuthentication.js +5 -0
  34. package/api/resources/profiles/types/WebhookMethod.d.ts +8 -0
  35. package/api/resources/profiles/types/WebhookMethod.js +10 -0
  36. package/api/resources/profiles/types/WebhookProfile.d.ts +16 -0
  37. package/api/resources/profiles/types/WebhookProfile.js +5 -0
  38. package/api/resources/profiles/types/WebhookProfileType.d.ts +8 -0
  39. package/api/resources/profiles/types/WebhookProfileType.js +10 -0
  40. package/api/resources/profiles/types/index.d.ts +7 -0
  41. package/api/resources/profiles/types/index.js +7 -0
  42. package/api/resources/send/types/BaseMessage.d.ts +1 -0
  43. package/api/resources/send/types/Channel.d.ts +1 -1
  44. package/api/resources/send/types/MessagePreferences.d.ts +7 -0
  45. package/api/resources/send/types/MessagePreferences.js +5 -0
  46. package/api/resources/send/types/PagerdutyRecipient.d.ts +7 -0
  47. package/api/resources/send/types/PagerdutyRecipient.js +5 -0
  48. package/api/resources/send/types/Recipient.d.ts +1 -1
  49. package/api/resources/send/types/WebhookRecipient.d.ts +7 -0
  50. package/api/resources/send/types/WebhookRecipient.js +5 -0
  51. package/api/resources/send/types/index.d.ts +3 -2
  52. package/api/resources/send/types/index.js +3 -2
  53. package/api/resources/templates/client/Client.js +1 -1
  54. package/api/resources/tenants/client/Client.d.ts +6 -1
  55. package/api/resources/tenants/client/Client.js +13 -8
  56. package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
  57. package/api/resources/translations/client/Client.js +2 -2
  58. package/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
  59. package/api/resources/users/resources/preferences/client/Client.js +43 -8
  60. package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
  61. package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
  62. package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
  63. package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
  64. package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
  65. package/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
  66. package/api/resources/users/resources/tenants/client/Client.js +5 -5
  67. package/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
  68. package/api/resources/users/resources/tokens/client/Client.js +11 -7
  69. package/dist/Client.d.ts +71 -10
  70. package/dist/Client.js +72 -11
  71. package/dist/api/client/requests/SendMessageRequest.d.ts +71 -10
  72. package/dist/api/resources/audiences/client/Client.js +5 -5
  73. package/dist/api/resources/auditEvents/client/Client.js +2 -2
  74. package/dist/api/resources/authTokens/client/Client.js +1 -1
  75. package/dist/api/resources/automations/client/Client.js +2 -2
  76. package/dist/api/resources/brands/client/Client.d.ts +38 -4
  77. package/dist/api/resources/brands/client/Client.js +43 -9
  78. package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
  79. package/dist/api/resources/bulk/client/Client.d.ts +91 -3
  80. package/dist/api/resources/bulk/client/Client.js +96 -8
  81. package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +70 -1
  82. package/dist/api/resources/inbound/client/Client.js +1 -1
  83. package/dist/api/resources/lists/client/Client.d.ts +8 -96
  84. package/dist/api/resources/lists/client/Client.js +18 -106
  85. package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
  86. package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
  87. package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
  88. package/dist/api/resources/messages/client/Client.js +6 -6
  89. package/dist/api/resources/notifications/client/Client.d.ts +2 -1
  90. package/dist/api/resources/notifications/client/Client.js +12 -8
  91. package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -1
  92. package/dist/api/resources/notifications/types/Notification.d.ts +1 -0
  93. package/dist/api/resources/profiles/client/Client.d.ts +7 -1
  94. package/dist/api/resources/profiles/client/Client.js +14 -8
  95. package/dist/api/resources/profiles/types/Pagerduty.d.ts +9 -0
  96. package/dist/api/resources/profiles/types/Pagerduty.js +5 -0
  97. package/dist/api/resources/profiles/types/UserProfile.d.ts +1 -1
  98. package/dist/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +4 -0
  99. package/dist/api/resources/profiles/types/UserProfileFirebaseToken.js +5 -0
  100. package/dist/api/resources/profiles/types/WebhookAuthMode.d.ts +9 -0
  101. package/dist/api/resources/profiles/types/WebhookAuthMode.js +11 -0
  102. package/dist/api/resources/profiles/types/WebhookAuthentication.d.ts +14 -0
  103. package/dist/api/resources/profiles/types/WebhookAuthentication.js +5 -0
  104. package/dist/api/resources/profiles/types/WebhookMethod.d.ts +8 -0
  105. package/dist/api/resources/profiles/types/WebhookMethod.js +10 -0
  106. package/dist/api/resources/profiles/types/WebhookProfile.d.ts +16 -0
  107. package/dist/api/resources/profiles/types/WebhookProfile.js +5 -0
  108. package/dist/api/resources/profiles/types/WebhookProfileType.d.ts +8 -0
  109. package/dist/api/resources/profiles/types/WebhookProfileType.js +10 -0
  110. package/dist/api/resources/profiles/types/index.d.ts +7 -0
  111. package/dist/api/resources/profiles/types/index.js +7 -0
  112. package/dist/api/resources/send/types/BaseMessage.d.ts +1 -0
  113. package/dist/api/resources/send/types/Channel.d.ts +1 -1
  114. package/dist/api/resources/send/types/MessagePreferences.d.ts +7 -0
  115. package/dist/api/resources/send/types/MessagePreferences.js +5 -0
  116. package/dist/api/resources/send/types/PagerdutyRecipient.d.ts +7 -0
  117. package/dist/api/resources/send/types/PagerdutyRecipient.js +5 -0
  118. package/dist/api/resources/send/types/Recipient.d.ts +1 -1
  119. package/dist/api/resources/send/types/WebhookRecipient.d.ts +7 -0
  120. package/dist/api/resources/send/types/WebhookRecipient.js +5 -0
  121. package/dist/api/resources/send/types/index.d.ts +3 -2
  122. package/dist/api/resources/send/types/index.js +3 -2
  123. package/dist/api/resources/templates/client/Client.js +1 -1
  124. package/dist/api/resources/tenants/client/Client.d.ts +6 -1
  125. package/dist/api/resources/tenants/client/Client.js +13 -8
  126. package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
  127. package/dist/api/resources/translations/client/Client.js +2 -2
  128. package/dist/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
  129. package/dist/api/resources/users/resources/preferences/client/Client.js +43 -8
  130. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
  131. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
  132. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
  133. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
  134. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
  135. package/dist/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
  136. package/dist/api/resources/users/resources/tenants/client/Client.js +5 -5
  137. package/dist/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
  138. package/dist/api/resources/users/resources/tokens/client/Client.js +11 -7
  139. package/package.json +1 -1
  140. package/api/resources/send/types/MessageChannelEmailOverride.d.ts +0 -16
  141. package/api/resources/send/types/Override.d.ts +0 -8
  142. package/api/resources/send/types/Override.js +0 -10
  143. package/dist/api/resources/send/types/MessageChannelEmailOverride.d.ts +0 -16
  144. package/dist/api/resources/send/types/Override.d.ts +0 -8
  145. package/dist/api/resources/send/types/Override.js +0 -10
  146. /package/api/resources/{send/types/MessageChannelEmailOverride.js → profiles/types/Pagerduty.js} +0 -0
  147. /package/{dist/api/resources/send/types/MessageChannelEmailOverride.js → api/resources/profiles/types/UserProfileFirebaseToken.js} +0 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type WebhookMethod = "POST" | "PUT";
5
+ export declare const WebhookMethod: {
6
+ readonly Post: "POST";
7
+ readonly Put: "PUT";
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebhookMethod = void 0;
7
+ exports.WebhookMethod = {
8
+ Post: "POST",
9
+ Put: "PUT",
10
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Courier from "../../../index";
5
+ export interface WebhookProfile {
6
+ /** The URL to send the webhook request to. */
7
+ url: string;
8
+ /** The HTTP method to use for the webhook request. Defaults to POST if not specified. */
9
+ method?: Courier.WebhookMethod;
10
+ /** Custom headers to include in the webhook request. */
11
+ headers?: Record<string, string>;
12
+ /** Authentication configuration for the webhook request. */
13
+ authentication?: Courier.WebhookAuthentication;
14
+ /** Specifies what profile information is included in the request payload. Defaults to 'limited' if not specified. */
15
+ profile?: Courier.WebhookProfileType;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type WebhookProfileType = "limited" | "expanded";
5
+ export declare const WebhookProfileType: {
6
+ readonly Limited: "limited";
7
+ readonly Expanded: "expanded";
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebhookProfileType = void 0;
7
+ exports.WebhookProfileType = {
8
+ Limited: "limited",
9
+ Expanded: "expanded",
10
+ };
@@ -1,5 +1,6 @@
1
1
  export * from "./Address";
2
2
  export * from "./UserProfile";
3
+ export * from "./UserProfileFirebaseToken";
3
4
  export * from "./AirshipProfile";
4
5
  export * from "./AirshipProfileAudience";
5
6
  export * from "./DeviceType";
@@ -14,6 +15,7 @@ export * from "./MultipleTokens";
14
15
  export * from "./Intercom";
15
16
  export * from "./IntercomRecipient";
16
17
  export * from "./Slack";
18
+ export * from "./Pagerduty";
17
19
  export * from "./SlackBaseProperties";
18
20
  export * from "./SendToSlackChannel";
19
21
  export * from "./SendToSlackEmail";
@@ -35,3 +37,8 @@ export * from "./SubscribeToListsResponse";
35
37
  export * from "./DeleteListSubscriptionResponse";
36
38
  export * from "./GetListSubscriptionsList";
37
39
  export * from "./GetListSubscriptionsResponse";
40
+ export * from "./WebhookProfile";
41
+ export * from "./WebhookMethod";
42
+ export * from "./WebhookAuthentication";
43
+ export * from "./WebhookAuthMode";
44
+ export * from "./WebhookProfileType";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Address"), exports);
18
18
  __exportStar(require("./UserProfile"), exports);
19
+ __exportStar(require("./UserProfileFirebaseToken"), exports);
19
20
  __exportStar(require("./AirshipProfile"), exports);
20
21
  __exportStar(require("./AirshipProfileAudience"), exports);
21
22
  __exportStar(require("./DeviceType"), exports);
@@ -30,6 +31,7 @@ __exportStar(require("./MultipleTokens"), exports);
30
31
  __exportStar(require("./Intercom"), exports);
31
32
  __exportStar(require("./IntercomRecipient"), exports);
32
33
  __exportStar(require("./Slack"), exports);
34
+ __exportStar(require("./Pagerduty"), exports);
33
35
  __exportStar(require("./SlackBaseProperties"), exports);
34
36
  __exportStar(require("./SendToSlackChannel"), exports);
35
37
  __exportStar(require("./SendToSlackEmail"), exports);
@@ -51,3 +53,8 @@ __exportStar(require("./SubscribeToListsResponse"), exports);
51
53
  __exportStar(require("./DeleteListSubscriptionResponse"), exports);
52
54
  __exportStar(require("./GetListSubscriptionsList"), exports);
53
55
  __exportStar(require("./GetListSubscriptionsResponse"), exports);
56
+ __exportStar(require("./WebhookProfile"), exports);
57
+ __exportStar(require("./WebhookMethod"), exports);
58
+ __exportStar(require("./WebhookAuthentication"), exports);
59
+ __exportStar(require("./WebhookAuthMode"), exports);
60
+ __exportStar(require("./WebhookProfileType"), exports);
@@ -15,6 +15,7 @@ export interface BaseMessage {
15
15
  context?: Courier.MessageContext;
16
16
  /** Metadata such as utm tracking attached with the notification through this channel. */
17
17
  metadata?: Courier.MessageMetadata;
18
+ preferences?: Courier.MessagePreferences;
18
19
  /** An object whose keys are valid provider identifiers which map to an object. */
19
20
  providers?: Courier.MessageProviders;
20
21
  routing?: Courier.Routing;
@@ -27,6 +27,6 @@ export interface Channel {
27
27
  if?: string;
28
28
  timeouts?: Courier.Timeouts;
29
29
  /** Channel specific overrides. */
30
- override?: Courier.Override;
30
+ override?: Record<string, any>;
31
31
  metadata?: Courier.ChannelMetadata;
32
32
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MessagePreferences {
5
+ /** The ID of the subscription topic you want to apply to the message. If this is a templated message, it will override the subscription topic if already associated */
6
+ subscription_topic_id: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Courier from "../../../index";
5
+ export interface PagerdutyRecipient {
6
+ pagerduty: Courier.Pagerduty;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Courier from "../../../index";
5
- export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient | Courier.RecipientData;
5
+ export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient | Courier.RecipientData | Courier.PagerdutyRecipient | Courier.WebhookRecipient;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Courier from "../../../index";
5
+ export interface WebhookRecipient {
6
+ webhook: Courier.WebhookProfile;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,8 @@ export * from "./BaseMessageSendTo";
5
5
  export * from "./BaseMessage";
6
6
  export * from "./MessageRecipient";
7
7
  export * from "./Recipient";
8
+ export * from "./WebhookRecipient";
9
+ export * from "./PagerdutyRecipient";
8
10
  export * from "./SlackRecipient";
9
11
  export * from "./MsTeamsRecipient";
10
12
  export * from "./AudienceRecipient";
@@ -33,8 +35,6 @@ export * from "./Timeout";
33
35
  export * from "./Criteria";
34
36
  export * from "./RoutingMethod";
35
37
  export * from "./Timeouts";
36
- export * from "./Override";
37
- export * from "./MessageChannelEmailOverride";
38
38
  export * from "./Attachment";
39
39
  export * from "./MessageMetadata";
40
40
  export * from "./Utm";
@@ -80,6 +80,7 @@ export * from "./Preferences";
80
80
  export * from "./RoutingStrategyProvider";
81
81
  export * from "./Metadata";
82
82
  export * from "./RoutingStrategyChannel";
83
+ export * from "./MessagePreferences";
83
84
  export * from "./MessageProviders";
84
85
  export * from "./MessageProvidersType";
85
86
  export * from "./RoutingChannel";
@@ -21,6 +21,8 @@ __exportStar(require("./BaseMessageSendTo"), exports);
21
21
  __exportStar(require("./BaseMessage"), exports);
22
22
  __exportStar(require("./MessageRecipient"), exports);
23
23
  __exportStar(require("./Recipient"), exports);
24
+ __exportStar(require("./WebhookRecipient"), exports);
25
+ __exportStar(require("./PagerdutyRecipient"), exports);
24
26
  __exportStar(require("./SlackRecipient"), exports);
25
27
  __exportStar(require("./MsTeamsRecipient"), exports);
26
28
  __exportStar(require("./AudienceRecipient"), exports);
@@ -49,8 +51,6 @@ __exportStar(require("./Timeout"), exports);
49
51
  __exportStar(require("./Criteria"), exports);
50
52
  __exportStar(require("./RoutingMethod"), exports);
51
53
  __exportStar(require("./Timeouts"), exports);
52
- __exportStar(require("./Override"), exports);
53
- __exportStar(require("./MessageChannelEmailOverride"), exports);
54
54
  __exportStar(require("./Attachment"), exports);
55
55
  __exportStar(require("./MessageMetadata"), exports);
56
56
  __exportStar(require("./Utm"), exports);
@@ -96,6 +96,7 @@ __exportStar(require("./Preferences"), exports);
96
96
  __exportStar(require("./RoutingStrategyProvider"), exports);
97
97
  __exportStar(require("./Metadata"), exports);
98
98
  __exportStar(require("./RoutingStrategyChannel"), exports);
99
+ __exportStar(require("./MessagePreferences"), exports);
99
100
  __exportStar(require("./MessageProviders"), exports);
100
101
  __exportStar(require("./MessageProvidersType"), exports);
101
102
  __exportStar(require("./RoutingChannel"), exports);
@@ -73,7 +73,7 @@ class Templates {
73
73
  Authorization: yield this._getAuthorizationHeader(),
74
74
  "X-Fern-Language": "JavaScript",
75
75
  "X-Fern-SDK-Name": "@trycourier/courier",
76
- "X-Fern-SDK-Version": "v6.2.1",
76
+ "X-Fern-SDK-Version": "v6.2.3",
77
77
  "X-Fern-Runtime": core.RUNTIME.type,
78
78
  "X-Fern-Runtime-Version": core.RUNTIME.version,
79
79
  },
@@ -30,7 +30,12 @@ export declare class Tenants {
30
30
  * name: "string",
31
31
  * parent_tenant_id: "string",
32
32
  * default_preferences: {
33
- * items: [{}]
33
+ * items: [{
34
+ * id: "string",
35
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
36
+ * has_custom_routing: undefined,
37
+ * custom_routing: undefined
38
+ * }]
34
39
  * },
35
40
  * properties: {
36
41
  * "string": {
@@ -60,7 +60,12 @@ class Tenants {
60
60
  * name: "string",
61
61
  * parent_tenant_id: "string",
62
62
  * default_preferences: {
63
- * items: [{}]
63
+ * items: [{
64
+ * id: "string",
65
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
66
+ * has_custom_routing: undefined,
67
+ * custom_routing: undefined
68
+ * }]
64
69
  * },
65
70
  * properties: {
66
71
  * "string": {
@@ -85,7 +90,7 @@ class Tenants {
85
90
  Authorization: yield this._getAuthorizationHeader(),
86
91
  "X-Fern-Language": "JavaScript",
87
92
  "X-Fern-SDK-Name": "@trycourier/courier",
88
- "X-Fern-SDK-Version": "v6.2.1",
93
+ "X-Fern-SDK-Version": "v6.2.3",
89
94
  "X-Fern-Runtime": core.RUNTIME.type,
90
95
  "X-Fern-Runtime-Version": core.RUNTIME.version,
91
96
  },
@@ -142,7 +147,7 @@ class Tenants {
142
147
  Authorization: yield this._getAuthorizationHeader(),
143
148
  "X-Fern-Language": "JavaScript",
144
149
  "X-Fern-SDK-Name": "@trycourier/courier",
145
- "X-Fern-SDK-Version": "v6.2.1",
150
+ "X-Fern-SDK-Version": "v6.2.3",
146
151
  "X-Fern-Runtime": core.RUNTIME.type,
147
152
  "X-Fern-Runtime-Version": core.RUNTIME.version,
148
153
  },
@@ -211,7 +216,7 @@ class Tenants {
211
216
  Authorization: yield this._getAuthorizationHeader(),
212
217
  "X-Fern-Language": "JavaScript",
213
218
  "X-Fern-SDK-Name": "@trycourier/courier",
214
- "X-Fern-SDK-Version": "v6.2.1",
219
+ "X-Fern-SDK-Version": "v6.2.3",
215
220
  "X-Fern-Runtime": core.RUNTIME.type,
216
221
  "X-Fern-Runtime-Version": core.RUNTIME.version,
217
222
  },
@@ -261,7 +266,7 @@ class Tenants {
261
266
  Authorization: yield this._getAuthorizationHeader(),
262
267
  "X-Fern-Language": "JavaScript",
263
268
  "X-Fern-SDK-Name": "@trycourier/courier",
264
- "X-Fern-SDK-Version": "v6.2.1",
269
+ "X-Fern-SDK-Version": "v6.2.3",
265
270
  "X-Fern-Runtime": core.RUNTIME.type,
266
271
  "X-Fern-Runtime-Version": core.RUNTIME.version,
267
272
  },
@@ -324,7 +329,7 @@ class Tenants {
324
329
  Authorization: yield this._getAuthorizationHeader(),
325
330
  "X-Fern-Language": "JavaScript",
326
331
  "X-Fern-SDK-Name": "@trycourier/courier",
327
- "X-Fern-SDK-Version": "v6.2.1",
332
+ "X-Fern-SDK-Version": "v6.2.3",
328
333
  "X-Fern-Runtime": core.RUNTIME.type,
329
334
  "X-Fern-Runtime-Version": core.RUNTIME.version,
330
335
  },
@@ -385,7 +390,7 @@ class Tenants {
385
390
  Authorization: yield this._getAuthorizationHeader(),
386
391
  "X-Fern-Language": "JavaScript",
387
392
  "X-Fern-SDK-Name": "@trycourier/courier",
388
- "X-Fern-SDK-Version": "v6.2.1",
393
+ "X-Fern-SDK-Version": "v6.2.3",
389
394
  "X-Fern-Runtime": core.RUNTIME.type,
390
395
  "X-Fern-Runtime-Version": core.RUNTIME.version,
391
396
  },
@@ -436,7 +441,7 @@ class Tenants {
436
441
  Authorization: yield this._getAuthorizationHeader(),
437
442
  "X-Fern-Language": "JavaScript",
438
443
  "X-Fern-SDK-Name": "@trycourier/courier",
439
- "X-Fern-SDK-Version": "v6.2.1",
444
+ "X-Fern-SDK-Version": "v6.2.3",
440
445
  "X-Fern-Runtime": core.RUNTIME.type,
441
446
  "X-Fern-Runtime-Version": core.RUNTIME.version,
442
447
  },
@@ -8,7 +8,12 @@ import * as Courier from "../../../../index";
8
8
  * name: "string",
9
9
  * parent_tenant_id: "string",
10
10
  * default_preferences: {
11
- * items: [{}]
11
+ * items: [{
12
+ * id: "string",
13
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
14
+ * has_custom_routing: undefined,
15
+ * custom_routing: undefined
16
+ * }]
12
17
  * },
13
18
  * properties: {
14
19
  * "string": {
@@ -70,7 +70,7 @@ class Translations {
70
70
  Authorization: yield this._getAuthorizationHeader(),
71
71
  "X-Fern-Language": "JavaScript",
72
72
  "X-Fern-SDK-Name": "@trycourier/courier",
73
- "X-Fern-SDK-Version": "v6.2.1",
73
+ "X-Fern-SDK-Version": "v6.2.3",
74
74
  "X-Fern-Runtime": core.RUNTIME.type,
75
75
  "X-Fern-Runtime-Version": core.RUNTIME.version,
76
76
  },
@@ -130,7 +130,7 @@ class Translations {
130
130
  Authorization: yield this._getAuthorizationHeader(),
131
131
  "X-Fern-Language": "JavaScript",
132
132
  "X-Fern-SDK-Name": "@trycourier/courier",
133
- "X-Fern-SDK-Version": "v6.2.1",
133
+ "X-Fern-SDK-Version": "v6.2.3",
134
134
  "X-Fern-Runtime": core.RUNTIME.type,
135
135
  "X-Fern-Runtime-Version": core.RUNTIME.version,
136
136
  },
@@ -22,27 +22,33 @@ export declare class Preferences {
22
22
  * Fetch all user preferences.
23
23
  *
24
24
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
25
+ * @param {Courier.users.UserPreferencesParams} request
25
26
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
26
27
  *
27
28
  * @throws {@link Courier.BadRequestError}
28
29
  *
29
30
  * @example
30
- * await courier.users.preferences.list("string")
31
+ * await courier.users.preferences.list("string", {
32
+ * tenant_id: "string"
33
+ * })
31
34
  */
32
- list(userId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
35
+ list(userId: string, request?: Courier.users.UserPreferencesParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
33
36
  /**
34
37
  * Fetch user preferences for a specific subscription topic.
35
38
  *
36
39
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
37
40
  * @param {string} topicId - A unique identifier associated with a subscription topic.
41
+ * @param {Courier.users.UserPreferencesTopicParams} request
38
42
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
39
43
  *
40
44
  * @throws {@link Courier.NotFoundError}
41
45
  *
42
46
  * @example
43
- * await courier.users.preferences.get("string", "string")
47
+ * await courier.users.preferences.get("string", "string", {
48
+ * tenant_id: "string"
49
+ * })
44
50
  */
45
- get(userId: string, topicId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
51
+ get(userId: string, topicId: string, request?: Courier.users.UserPreferencesTopicParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
46
52
  /**
47
53
  * Update or Create user preferences for a specific subscription topic.
48
54
  *
@@ -34,6 +34,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  step((generator = generator.apply(thisArg, _arguments || [])).next());
35
35
  });
36
36
  };
37
+ var __rest = (this && this.__rest) || function (s, e) {
38
+ var t = {};
39
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
+ t[p] = s[p];
41
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
+ t[p[i]] = s[p[i]];
45
+ }
46
+ return t;
47
+ };
37
48
  var __importDefault = (this && this.__importDefault) || function (mod) {
38
49
  return (mod && mod.__esModule) ? mod : { "default": mod };
39
50
  };
@@ -52,16 +63,24 @@ class Preferences {
52
63
  * Fetch all user preferences.
53
64
  *
54
65
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
66
+ * @param {Courier.users.UserPreferencesParams} request
55
67
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
56
68
  *
57
69
  * @throws {@link Courier.BadRequestError}
58
70
  *
59
71
  * @example
60
- * await courier.users.preferences.list("string")
72
+ * await courier.users.preferences.list("string", {
73
+ * tenant_id: "string"
74
+ * })
61
75
  */
62
- list(userId, requestOptions) {
76
+ list(userId, request = {}, requestOptions) {
63
77
  var _a, _b;
64
78
  return __awaiter(this, void 0, void 0, function* () {
79
+ const { tenant_id: tenantId } = request;
80
+ const _queryParams = {};
81
+ if (tenantId != null) {
82
+ _queryParams["tenant_id"] = tenantId;
83
+ }
65
84
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
66
85
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences`),
67
86
  method: "GET",
@@ -69,11 +88,12 @@ class Preferences {
69
88
  Authorization: yield this._getAuthorizationHeader(),
70
89
  "X-Fern-Language": "JavaScript",
71
90
  "X-Fern-SDK-Name": "@trycourier/courier",
72
- "X-Fern-SDK-Version": "v6.2.1",
91
+ "X-Fern-SDK-Version": "v6.2.3",
73
92
  "X-Fern-Runtime": core.RUNTIME.type,
74
93
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
94
  },
76
95
  contentType: "application/json",
96
+ queryParameters: _queryParams,
77
97
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
78
98
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
79
99
  });
@@ -111,16 +131,24 @@ class Preferences {
111
131
  *
112
132
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
113
133
  * @param {string} topicId - A unique identifier associated with a subscription topic.
134
+ * @param {Courier.users.UserPreferencesTopicParams} request
114
135
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
115
136
  *
116
137
  * @throws {@link Courier.NotFoundError}
117
138
  *
118
139
  * @example
119
- * await courier.users.preferences.get("string", "string")
140
+ * await courier.users.preferences.get("string", "string", {
141
+ * tenant_id: "string"
142
+ * })
120
143
  */
121
- get(userId, topicId, requestOptions) {
144
+ get(userId, topicId, request = {}, requestOptions) {
122
145
  var _a, _b;
123
146
  return __awaiter(this, void 0, void 0, function* () {
147
+ const { tenant_id: tenantId } = request;
148
+ const _queryParams = {};
149
+ if (tenantId != null) {
150
+ _queryParams["tenant_id"] = tenantId;
151
+ }
124
152
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
125
153
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
126
154
  method: "GET",
@@ -128,11 +156,12 @@ class Preferences {
128
156
  Authorization: yield this._getAuthorizationHeader(),
129
157
  "X-Fern-Language": "JavaScript",
130
158
  "X-Fern-SDK-Name": "@trycourier/courier",
131
- "X-Fern-SDK-Version": "v6.2.1",
159
+ "X-Fern-SDK-Version": "v6.2.3",
132
160
  "X-Fern-Runtime": core.RUNTIME.type,
133
161
  "X-Fern-Runtime-Version": core.RUNTIME.version,
134
162
  },
135
163
  contentType: "application/json",
164
+ queryParameters: _queryParams,
136
165
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
137
166
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
138
167
  });
@@ -187,6 +216,11 @@ class Preferences {
187
216
  update(userId, topicId, request, requestOptions) {
188
217
  var _a, _b;
189
218
  return __awaiter(this, void 0, void 0, function* () {
219
+ const { tenant_id: tenantId } = request, _body = __rest(request, ["tenant_id"]);
220
+ const _queryParams = {};
221
+ if (tenantId != null) {
222
+ _queryParams["tenant_id"] = tenantId;
223
+ }
190
224
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
191
225
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
192
226
  method: "PUT",
@@ -194,12 +228,13 @@ class Preferences {
194
228
  Authorization: yield this._getAuthorizationHeader(),
195
229
  "X-Fern-Language": "JavaScript",
196
230
  "X-Fern-SDK-Name": "@trycourier/courier",
197
- "X-Fern-SDK-Version": "v6.2.1",
231
+ "X-Fern-SDK-Version": "v6.2.3",
198
232
  "X-Fern-Runtime": core.RUNTIME.type,
199
233
  "X-Fern-Runtime-Version": core.RUNTIME.version,
200
234
  },
201
235
  contentType: "application/json",
202
- body: request,
236
+ queryParameters: _queryParams,
237
+ body: _body,
203
238
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
204
239
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
205
240
  });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "string"
8
+ * }
9
+ */
10
+ export interface UserPreferencesParams {
11
+ /**
12
+ * Query the preferences of a user for this specific tenant context.
13
+ */
14
+ tenant_id?: string;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "string"
8
+ * }
9
+ */
10
+ export interface UserPreferencesTopicParams {
11
+ /**
12
+ * Query the preferences of a user for this specific tenant context.
13
+ */
14
+ tenant_id?: string;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,5 +13,9 @@ import * as Courier from "../../../../../../index";
13
13
  * }
14
14
  */
15
15
  export interface UserPreferencesUpdateParams {
16
+ /**
17
+ * Update the preferences of a user for this specific tenant context.
18
+ */
19
+ tenant_id?: string;
16
20
  topic: Courier.users.TopicPreferenceUpdate;
17
21
  }
@@ -1 +1,3 @@
1
+ export { type UserPreferencesParams } from "./UserPreferencesParams";
2
+ export { type UserPreferencesTopicParams } from "./UserPreferencesTopicParams";
1
3
  export { type UserPreferencesUpdateParams } from "./UserPreferencesUpdateParams";