@trycourier/courier 6.6.1-alpha0 → 6.7.0-alpha2

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 (196) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +11 -11
  3. package/client.d.mts +23 -14
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +23 -14
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -2
  9. package/client.mjs.map +1 -1
  10. package/internal/to-file.d.mts +1 -1
  11. package/internal/to-file.d.ts +1 -1
  12. package/internal/to-file.js +1 -1
  13. package/internal/to-file.mjs +1 -1
  14. package/internal/tslib.js +6 -6
  15. package/package.json +1 -1
  16. package/resources/audiences.d.mts +27 -46
  17. package/resources/audiences.d.mts.map +1 -1
  18. package/resources/audiences.d.ts +27 -46
  19. package/resources/audiences.d.ts.map +1 -1
  20. package/resources/audit-events.d.mts +3 -7
  21. package/resources/audit-events.d.mts.map +1 -1
  22. package/resources/audit-events.d.ts +3 -7
  23. package/resources/audit-events.d.ts.map +1 -1
  24. package/resources/auth.d.mts +2 -2
  25. package/resources/auth.d.mts.map +1 -1
  26. package/resources/auth.d.ts +2 -2
  27. package/resources/auth.d.ts.map +1 -1
  28. package/resources/automations/automations.d.mts +2 -253
  29. package/resources/automations/automations.d.mts.map +1 -1
  30. package/resources/automations/automations.d.ts +2 -253
  31. package/resources/automations/automations.d.ts.map +1 -1
  32. package/resources/automations/automations.js +0 -42
  33. package/resources/automations/automations.js.map +1 -1
  34. package/resources/automations/automations.mjs +0 -42
  35. package/resources/automations/automations.mjs.map +1 -1
  36. package/resources/automations/index.d.mts +2 -2
  37. package/resources/automations/index.d.mts.map +1 -1
  38. package/resources/automations/index.d.ts +2 -2
  39. package/resources/automations/index.d.ts.map +1 -1
  40. package/resources/automations/index.js.map +1 -1
  41. package/resources/automations/index.mjs +1 -1
  42. package/resources/automations/index.mjs.map +1 -1
  43. package/resources/automations/invoke.d.mts +124 -9
  44. package/resources/automations/invoke.d.mts.map +1 -1
  45. package/resources/automations/invoke.d.ts +124 -9
  46. package/resources/automations/invoke.d.ts.map +1 -1
  47. package/resources/automations/invoke.js +45 -0
  48. package/resources/automations/invoke.js.map +1 -1
  49. package/resources/automations/invoke.mjs +45 -0
  50. package/resources/automations/invoke.mjs.map +1 -1
  51. package/resources/brands.d.mts +74 -50
  52. package/resources/brands.d.mts.map +1 -1
  53. package/resources/brands.d.ts +74 -50
  54. package/resources/brands.d.ts.map +1 -1
  55. package/resources/brands.js.map +1 -1
  56. package/resources/brands.mjs.map +1 -1
  57. package/resources/bulk.d.mts +38 -89
  58. package/resources/bulk.d.mts.map +1 -1
  59. package/resources/bulk.d.ts +38 -89
  60. package/resources/bulk.d.ts.map +1 -1
  61. package/resources/inbound.d.mts +1 -1
  62. package/resources/inbound.d.ts +1 -1
  63. package/resources/index.d.mts +8 -7
  64. package/resources/index.d.mts.map +1 -1
  65. package/resources/index.d.ts +8 -7
  66. package/resources/index.d.ts.map +1 -1
  67. package/resources/index.js +2 -0
  68. package/resources/index.js.map +1 -1
  69. package/resources/index.mjs +2 -1
  70. package/resources/index.mjs.map +1 -1
  71. package/resources/lists/index.d.mts +2 -2
  72. package/resources/lists/index.d.mts.map +1 -1
  73. package/resources/lists/index.d.ts +2 -2
  74. package/resources/lists/index.d.ts.map +1 -1
  75. package/resources/lists/index.js.map +1 -1
  76. package/resources/lists/index.mjs +1 -1
  77. package/resources/lists/index.mjs.map +1 -1
  78. package/resources/lists/lists.d.mts +9 -7
  79. package/resources/lists/lists.d.mts.map +1 -1
  80. package/resources/lists/lists.d.ts +9 -7
  81. package/resources/lists/lists.d.ts.map +1 -1
  82. package/resources/lists/lists.js +7 -2
  83. package/resources/lists/lists.js.map +1 -1
  84. package/resources/lists/lists.mjs +7 -2
  85. package/resources/lists/lists.mjs.map +1 -1
  86. package/resources/lists/subscriptions.d.mts +9 -34
  87. package/resources/lists/subscriptions.d.mts.map +1 -1
  88. package/resources/lists/subscriptions.d.ts +9 -34
  89. package/resources/lists/subscriptions.d.ts.map +1 -1
  90. package/resources/messages.d.mts +6 -6
  91. package/resources/messages.d.mts.map +1 -1
  92. package/resources/messages.d.ts +6 -6
  93. package/resources/messages.d.ts.map +1 -1
  94. package/resources/messages.js +1 -1
  95. package/resources/messages.js.map +1 -1
  96. package/resources/messages.mjs +1 -1
  97. package/resources/messages.mjs.map +1 -1
  98. package/resources/notifications/index.d.mts +1 -1
  99. package/resources/notifications/index.d.mts.map +1 -1
  100. package/resources/notifications/index.d.ts +1 -1
  101. package/resources/notifications/index.d.ts.map +1 -1
  102. package/resources/notifications/index.js.map +1 -1
  103. package/resources/notifications/index.mjs.map +1 -1
  104. package/resources/notifications/notifications.d.mts +3 -8
  105. package/resources/notifications/notifications.d.mts.map +1 -1
  106. package/resources/notifications/notifications.d.ts +3 -8
  107. package/resources/notifications/notifications.d.ts.map +1 -1
  108. package/resources/notifications/notifications.js.map +1 -1
  109. package/resources/notifications/notifications.mjs.map +1 -1
  110. package/resources/send.d.mts +245 -701
  111. package/resources/send.d.mts.map +1 -1
  112. package/resources/send.d.ts +245 -701
  113. package/resources/send.d.ts.map +1 -1
  114. package/resources/send.js +12 -1
  115. package/resources/send.js.map +1 -1
  116. package/resources/send.mjs +12 -1
  117. package/resources/send.mjs.map +1 -1
  118. package/resources/shared.d.mts +42 -0
  119. package/resources/shared.d.mts.map +1 -0
  120. package/resources/shared.d.ts +42 -0
  121. package/resources/shared.d.ts.map +1 -0
  122. package/resources/shared.js +4 -0
  123. package/resources/shared.js.map +1 -0
  124. package/resources/shared.mjs +3 -0
  125. package/resources/shared.mjs.map +1 -0
  126. package/resources/tenants/index.d.mts +1 -0
  127. package/resources/tenants/index.d.mts.map +1 -1
  128. package/resources/tenants/index.d.ts +1 -0
  129. package/resources/tenants/index.d.ts.map +1 -1
  130. package/resources/tenants/index.js +3 -1
  131. package/resources/tenants/index.js.map +1 -1
  132. package/resources/tenants/index.mjs +1 -0
  133. package/resources/tenants/index.mjs.map +1 -1
  134. package/resources/tenants/templates.d.mts +122 -0
  135. package/resources/tenants/templates.d.mts.map +1 -0
  136. package/resources/tenants/templates.d.ts +122 -0
  137. package/resources/tenants/templates.d.ts.map +1 -0
  138. package/resources/tenants/templates.js +38 -0
  139. package/resources/tenants/templates.js.map +1 -0
  140. package/resources/tenants/templates.mjs +34 -0
  141. package/resources/tenants/templates.mjs.map +1 -0
  142. package/resources/tenants/tenants.d.mts +4 -0
  143. package/resources/tenants/tenants.d.mts.map +1 -1
  144. package/resources/tenants/tenants.d.ts +4 -0
  145. package/resources/tenants/tenants.d.ts.map +1 -1
  146. package/resources/tenants/tenants.js +4 -0
  147. package/resources/tenants/tenants.js.map +1 -1
  148. package/resources/tenants/tenants.mjs +4 -0
  149. package/resources/tenants/tenants.mjs.map +1 -1
  150. package/resources/users/index.d.mts +1 -1
  151. package/resources/users/index.d.mts.map +1 -1
  152. package/resources/users/index.d.ts +1 -1
  153. package/resources/users/index.d.ts.map +1 -1
  154. package/resources/users/tokens.d.mts +22 -23
  155. package/resources/users/tokens.d.mts.map +1 -1
  156. package/resources/users/tokens.d.ts +22 -23
  157. package/resources/users/tokens.d.ts.map +1 -1
  158. package/resources/users/tokens.js +14 -15
  159. package/resources/users/tokens.js.map +1 -1
  160. package/resources/users/tokens.mjs +14 -15
  161. package/resources/users/tokens.mjs.map +1 -1
  162. package/resources/users/users.d.mts +2 -2
  163. package/resources/users/users.d.mts.map +1 -1
  164. package/resources/users/users.d.ts +2 -2
  165. package/resources/users/users.d.ts.map +1 -1
  166. package/src/client.ts +48 -38
  167. package/src/internal/to-file.ts +1 -1
  168. package/src/resources/audiences.ts +43 -82
  169. package/src/resources/audit-events.ts +5 -11
  170. package/src/resources/auth.ts +2 -16
  171. package/src/resources/automations/automations.ts +4 -340
  172. package/src/resources/automations/index.ts +3 -8
  173. package/src/resources/automations/invoke.ts +163 -13
  174. package/src/resources/brands.ts +117 -51
  175. package/src/resources/bulk.ts +31 -104
  176. package/src/resources/inbound.ts +1 -1
  177. package/src/resources/index.ts +17 -19
  178. package/src/resources/lists/index.ts +9 -1
  179. package/src/resources/lists/lists.ts +15 -5
  180. package/src/resources/lists/subscriptions.ts +12 -45
  181. package/src/resources/messages.ts +8 -5
  182. package/src/resources/notifications/index.ts +0 -2
  183. package/src/resources/notifications/notifications.ts +2 -12
  184. package/src/resources/send.ts +249 -853
  185. package/src/resources/shared.ts +61 -0
  186. package/src/resources/tenants/index.ts +8 -0
  187. package/src/resources/tenants/templates.ts +165 -0
  188. package/src/resources/tenants/tenants.ts +21 -0
  189. package/src/resources/users/index.ts +2 -2
  190. package/src/resources/users/tokens.ts +33 -34
  191. package/src/resources/users/users.ts +4 -4
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/version.mjs +1 -1
@@ -1,6 +1,7 @@
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 BrandsAPI from './brands';
4
5
  import * as AudiencesAPI from './audiences';
5
6
  import { APIPromise } from '../core/api-promise';
6
7
  import { buildHeaders } from '../internal/headers';
@@ -51,80 +52,137 @@ export class Brands extends APIResource {
51
52
  }
52
53
 
53
54
  export interface Brand {
54
- /**
55
- * The date/time of when the brand was created. Represented in milliseconds since
56
- * Unix epoch.
57
- */
55
+ id: string;
56
+
58
57
  created: number;
59
58
 
60
- /**
61
- * Brand name
62
- */
63
59
  name: string;
64
60
 
65
- /**
66
- * The date/time of when the brand was published. Represented in milliseconds since
67
- * Unix epoch.
68
- */
69
- published: number;
70
-
71
- settings: BrandSettings;
72
-
73
- /**
74
- * The date/time of when the brand was updated. Represented in milliseconds since
75
- * Unix epoch.
76
- */
77
61
  updated: number;
78
62
 
79
- /**
80
- * The version identifier for the brand
81
- */
82
- version: string;
63
+ published?: number | null;
83
64
 
84
- /**
85
- * Brand Identifier
86
- */
87
- id?: string | null;
65
+ settings?: BrandSettings | null;
88
66
 
89
67
  snippets?: BrandSnippets | null;
68
+
69
+ version?: string | null;
70
+ }
71
+
72
+ export interface BrandColors {
73
+ primary?: string;
74
+
75
+ secondary?: string;
76
+
77
+ [k: string]: string | undefined;
90
78
  }
91
79
 
92
80
  export interface BrandSettings {
93
- colors?: BrandSettings.Colors | null;
81
+ colors?: BrandColors | null;
94
82
 
95
- email?: BrandSettings.Email | null;
83
+ email?: BrandSettingsEmail | null;
96
84
 
97
- inapp?: unknown;
85
+ inapp?: BrandSettingsInApp | null;
98
86
  }
99
87
 
100
- export namespace BrandSettings {
101
- export interface Colors {
102
- primary?: string | null;
88
+ export interface BrandSettingsEmail {
89
+ footer?: EmailFooter | null;
103
90
 
104
- secondary?: string | null;
91
+ head?: EmailHead | null;
105
92
 
106
- tertiary?: string | null;
107
- }
93
+ header?: EmailHeader | null;
94
+
95
+ templateOverride?: BrandSettingsEmail.TemplateOverride | null;
96
+ }
97
+
98
+ export namespace BrandSettingsEmail {
99
+ export interface TemplateOverride extends BrandsAPI.BrandTemplate {
100
+ mjml: BrandsAPI.BrandTemplate;
108
101
 
109
- export interface Email {
110
- footer: unknown;
102
+ footerBackgroundColor?: string | null;
111
103
 
112
- header: unknown;
104
+ footerFullWidth?: boolean | null;
113
105
  }
114
106
  }
115
107
 
108
+ export interface BrandSettingsInApp {
109
+ colors: BrandColors;
110
+
111
+ icons: Icons;
112
+
113
+ widgetBackground: WidgetBackground;
114
+
115
+ borderRadius?: string | null;
116
+
117
+ disableMessageIcon?: boolean | null;
118
+
119
+ fontFamily?: string | null;
120
+
121
+ placement?: 'top' | 'bottom' | 'left' | 'right' | null;
122
+ }
123
+
124
+ export interface BrandSnippet {
125
+ name: string;
126
+
127
+ value: string;
128
+ }
129
+
116
130
  export interface BrandSnippets {
117
- items: Array<BrandSnippets.Item>;
131
+ items?: Array<BrandSnippet> | null;
118
132
  }
119
133
 
120
- export namespace BrandSnippets {
121
- export interface Item {
122
- format: 'handlebars';
134
+ export interface BrandTemplate {
135
+ enabled: boolean;
123
136
 
124
- name: string;
137
+ backgroundColor?: string | null;
125
138
 
126
- value: string;
127
- }
139
+ blocksBackgroundColor?: string | null;
140
+
141
+ footer?: string | null;
142
+
143
+ head?: string | null;
144
+
145
+ header?: string | null;
146
+
147
+ width?: string | null;
148
+ }
149
+
150
+ export interface EmailFooter {
151
+ content?: string | null;
152
+
153
+ inheritDefault?: boolean | null;
154
+ }
155
+
156
+ export interface EmailHead {
157
+ inheritDefault: boolean;
158
+
159
+ content?: string | null;
160
+ }
161
+
162
+ export interface EmailHeader {
163
+ logo: Logo;
164
+
165
+ barColor?: string | null;
166
+
167
+ inheritDefault?: boolean | null;
168
+ }
169
+
170
+ export interface Icons {
171
+ bell?: string | null;
172
+
173
+ message?: string | null;
174
+ }
175
+
176
+ export interface Logo {
177
+ href?: string | null;
178
+
179
+ image?: string | null;
180
+ }
181
+
182
+ export interface WidgetBackground {
183
+ bottomColor?: string | null;
184
+
185
+ topColor?: string | null;
128
186
  }
129
187
 
130
188
  export interface BrandListResponse {
@@ -134,15 +192,12 @@ export interface BrandListResponse {
134
192
  }
135
193
 
136
194
  export interface BrandCreateParams {
137
- /**
138
- * The name of the brand.
139
- */
140
195
  name: string;
141
196
 
142
- settings: BrandSettings;
143
-
144
197
  id?: string | null;
145
198
 
199
+ settings?: BrandSettings | null;
200
+
146
201
  snippets?: BrandSnippets | null;
147
202
  }
148
203
 
@@ -167,8 +222,19 @@ export interface BrandListParams {
167
222
  export declare namespace Brands {
168
223
  export {
169
224
  type Brand as Brand,
225
+ type BrandColors as BrandColors,
170
226
  type BrandSettings as BrandSettings,
227
+ type BrandSettingsEmail as BrandSettingsEmail,
228
+ type BrandSettingsInApp as BrandSettingsInApp,
229
+ type BrandSnippet as BrandSnippet,
171
230
  type BrandSnippets as BrandSnippets,
231
+ type BrandTemplate as BrandTemplate,
232
+ type EmailFooter as EmailFooter,
233
+ type EmailHead as EmailHead,
234
+ type EmailHeader as EmailHeader,
235
+ type Icons as Icons,
236
+ type Logo as Logo,
237
+ type WidgetBackground as WidgetBackground,
172
238
  type BrandListResponse as BrandListResponse,
173
239
  type BrandCreateParams as BrandCreateParams,
174
240
  type BrandUpdateParams as BrandUpdateParams,
@@ -4,9 +4,9 @@ import { APIResource } from '../core/resource';
4
4
  import * as BulkAPI from './bulk';
5
5
  import * as AudiencesAPI from './audiences';
6
6
  import * as SendAPI from './send';
7
+ import * as Shared from './shared';
7
8
  import * as SubscriptionsAPI from './lists/subscriptions';
8
- import * as PreferencesAPI from './users/preferences';
9
- import * as ItemsAPI from './tenants/default-preferences/items';
9
+ import * as TemplatesAPI from './tenants/templates';
10
10
  import { APIPromise } from '../core/api-promise';
11
11
  import { buildHeaders } from '../internal/headers';
12
12
  import { RequestOptions } from '../internal/request-options';
@@ -60,64 +60,40 @@ export class Bulk extends APIResource {
60
60
  }
61
61
  }
62
62
 
63
- export interface InboundBulkMessage {
64
- /**
65
- * A unique identifier that represents the brand that should be used for rendering
66
- * the notification.
67
- */
68
- brand?: string | null;
63
+ export type InboundBulkMessage =
64
+ | InboundBulkMessage.InboundBulkTemplateMessage
65
+ | InboundBulkMessage.InboundBulkContentMessage;
69
66
 
70
- /**
71
- * JSON that includes any data you want to pass to a message template. The data
72
- * will populate the corresponding template variables.
73
- */
74
- data?: { [key: string]: unknown } | null;
67
+ export namespace InboundBulkMessage {
68
+ export interface InboundBulkTemplateMessage {
69
+ template: string;
75
70
 
76
- event?: string | null;
71
+ brand?: string | null;
77
72
 
78
- locale?: { [key: string]: unknown } | null;
73
+ data?: { [key: string]: unknown } | null;
79
74
 
80
- /**
81
- * Describes the content of the message in a way that will work for email, push,
82
- * chat, or any channel.
83
- */
84
- message?:
85
- | InboundBulkMessage.InboundBulkTemplateMessage
86
- | InboundBulkMessage.InboundBulkContentMessage
87
- | null;
75
+ event?: string | null;
88
76
 
89
- /**
90
- * JSON that is merged into the request sent by Courier to the provider to override
91
- * properties or to gain access to features in the provider API that are not
92
- * natively supported by Courier.
93
- */
94
- override?: unknown;
95
- }
77
+ locale?: { [key: string]: { [key: string]: unknown } } | null;
96
78
 
97
- export namespace InboundBulkMessage {
98
- /**
99
- * Describes the content of the message in a way that will work for email, push,
100
- * chat, or any channel.
101
- */
102
- export interface InboundBulkTemplateMessage extends SendAPI.BaseMessage {
103
- /**
104
- * The id of the notification template to be rendered and sent to the recipient(s).
105
- * This field or the content field must be supplied.
106
- */
107
- template: string;
79
+ override?: { [key: string]: unknown } | null;
108
80
  }
109
81
 
110
- /**
111
- * A template for a type of message that can be sent more than once. For example,
112
- * you might create an "Appointment Reminder" Notification or “Reset Password”
113
- * Notifications.
114
- */
115
- export interface InboundBulkContentMessage extends SendAPI.BaseMessage {
82
+ export interface InboundBulkContentMessage {
116
83
  /**
117
- * Describes the content of the message in a way that will work for email, push,
118
- * chat, or any channel. Either this or template must be specified.
84
+ * Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
119
85
  */
120
- content: SendAPI.Content;
86
+ content: Shared.ElementalContentSugar | TemplatesAPI.ElementalContent;
87
+
88
+ brand?: string | null;
89
+
90
+ data?: { [key: string]: unknown } | null;
91
+
92
+ event?: string | null;
93
+
94
+ locale?: { [key: string]: { [key: string]: unknown } } | null;
95
+
96
+ override?: { [key: string]: unknown } | null;
121
97
  }
122
98
  }
123
99
 
@@ -135,12 +111,12 @@ export interface InboundBulkMessageUser {
135
111
 
136
112
  export interface UserRecipient {
137
113
  /**
138
- * Use `tenant_id` instad.
114
+ * Use `tenant_id` instead.
139
115
  */
140
116
  account_id?: string | null;
141
117
 
142
118
  /**
143
- * Context information such as tenant_id to send the notification with.
119
+ * Context such as tenant_id to send the notification with.
144
120
  */
145
121
  context?: SendAPI.MessageContext | null;
146
122
 
@@ -158,10 +134,7 @@ export interface UserRecipient {
158
134
  preferences?: UserRecipient.Preferences | null;
159
135
 
160
136
  /**
161
- * An id of a tenant,
162
- * [see tenants api docs](https://www.courier.com/docs/reference/tenants). Will
163
- * load brand, default preferences and any other base context data associated with
164
- * this tenant.
137
+ * Tenant id. Will load brand, default preferences and base context data.
165
138
  */
166
139
  tenant_id?: string | null;
167
140
 
@@ -170,58 +143,12 @@ export interface UserRecipient {
170
143
 
171
144
  export namespace UserRecipient {
172
145
  export interface Preferences {
173
- notifications: { [key: string]: Preferences.Notifications };
146
+ notifications: { [key: string]: Shared.Preference };
174
147
 
175
- categories?: { [key: string]: Preferences.Categories } | null;
148
+ categories?: { [key: string]: Shared.Preference } | null;
176
149
 
177
150
  templateId?: string | null;
178
151
  }
179
-
180
- export namespace Preferences {
181
- export interface Notifications {
182
- status: PreferencesAPI.PreferenceStatus;
183
-
184
- channel_preferences?: Array<Notifications.ChannelPreference> | null;
185
-
186
- rules?: Array<Notifications.Rule> | null;
187
-
188
- source?: 'subscription' | 'list' | 'recipient' | null;
189
- }
190
-
191
- export namespace Notifications {
192
- export interface ChannelPreference {
193
- channel: ItemsAPI.ChannelClassification;
194
- }
195
-
196
- export interface Rule {
197
- until: string;
198
-
199
- start?: string | null;
200
- }
201
- }
202
-
203
- export interface Categories {
204
- status: PreferencesAPI.PreferenceStatus;
205
-
206
- channel_preferences?: Array<Categories.ChannelPreference> | null;
207
-
208
- rules?: Array<Categories.Rule> | null;
209
-
210
- source?: 'subscription' | 'list' | 'recipient' | null;
211
- }
212
-
213
- export namespace Categories {
214
- export interface ChannelPreference {
215
- channel: ItemsAPI.ChannelClassification;
216
- }
217
-
218
- export interface Rule {
219
- until: string;
220
-
221
- start?: string | null;
222
- }
223
- }
224
- }
225
152
  }
226
153
 
227
154
  export interface BulkCreateJobResponse {
@@ -54,7 +54,7 @@ export interface InboundTrackEventParams {
54
54
  type: 'track';
55
55
 
56
56
  /**
57
- * The user id associated with the track
57
+ * The user id associatiated with the track
58
58
  */
59
59
  userId?: string | null;
60
60
  }
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export * from './shared';
3
4
  export {
4
5
  Audiences,
5
6
  type Audience,
6
7
  type Filter,
7
8
  type FilterConfig,
8
- type NestedFilterConfig,
9
9
  type Paging,
10
10
  type AudienceUpdateResponse,
11
11
  type AudienceListResponse,
@@ -21,16 +21,23 @@ export {
21
21
  type AuditEventListParams,
22
22
  } from './audit-events';
23
23
  export { Auth, type AuthIssueTokenResponse, type AuthIssueTokenParams } from './auth';
24
- export {
25
- Automations,
26
- type AutomationInvokeAdHocParams,
27
- type AutomationInvokeByTemplateParams,
28
- } from './automations/automations';
24
+ export { Automations } from './automations/automations';
29
25
  export {
30
26
  Brands,
31
27
  type Brand,
28
+ type BrandColors,
32
29
  type BrandSettings,
30
+ type BrandSettingsEmail,
31
+ type BrandSettingsInApp,
32
+ type BrandSnippet,
33
33
  type BrandSnippets,
34
+ type BrandTemplate,
35
+ type EmailFooter,
36
+ type EmailHead,
37
+ type EmailHeader,
38
+ type Icons,
39
+ type Logo,
40
+ type WidgetBackground,
34
41
  type BrandListResponse,
35
42
  type BrandCreateParams,
36
43
  type BrandUpdateParams,
@@ -55,21 +62,20 @@ export {
55
62
  type ListListResponse,
56
63
  type ListUpdateParams,
57
64
  type ListListParams,
65
+ type ListRestoreParams,
58
66
  } from './lists/lists';
59
67
  export {
60
68
  Messages,
61
69
  type MessageDetails,
62
70
  type MessageRetrieveResponse,
63
71
  type MessageListResponse,
64
- type MessageGetContentResponse,
72
+ type MessageContentResponse,
65
73
  type MessageHistoryResponse,
66
74
  type MessageListParams,
67
75
  type MessageHistoryParams,
68
76
  } from './messages';
69
77
  export {
70
78
  Notifications,
71
- type MessageRouting,
72
- type MessageRoutingChannel,
73
79
  type NotificationGetContent,
74
80
  type NotificationListResponse,
75
81
  type NotificationListParams,
@@ -86,21 +92,13 @@ export {
86
92
  export { Requests } from './requests';
87
93
  export {
88
94
  Send,
89
- type BaseMessage,
90
- type BaseMessageSendTo,
91
- type Content,
92
95
  type ElementalChannelNode,
93
- type ElementalGroupNode,
94
96
  type ElementalNode,
95
- type Message,
96
97
  type MessageContext,
97
- type MsTeamsBaseProperties,
98
98
  type Recipient,
99
- type RoutingMethod,
100
- type SlackBaseProperties,
101
99
  type Utm,
102
- type SendSendMessageResponse,
103
- type SendSendMessageParams,
100
+ type SendMessageResponse,
101
+ type SendMessageParams,
104
102
  } from './send';
105
103
  export {
106
104
  Tenants,
@@ -1,8 +1,16 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Lists, type List, type ListListResponse, type ListUpdateParams, type ListListParams } from './lists';
3
+ export {
4
+ Lists,
5
+ type List,
6
+ type ListListResponse,
7
+ type ListUpdateParams,
8
+ type ListListParams,
9
+ type ListRestoreParams,
10
+ } from './lists';
4
11
  export {
5
12
  Subscriptions,
13
+ type NotificationPreferenceDetails,
6
14
  type PutSubscriptionsRecipient,
7
15
  type RecipientPreferences,
8
16
  type SubscriptionListResponse,
@@ -4,6 +4,7 @@ import { APIResource } from '../../core/resource';
4
4
  import * as AudiencesAPI from '../audiences';
5
5
  import * as SubscriptionsAPI from './subscriptions';
6
6
  import {
7
+ NotificationPreferenceDetails,
7
8
  PutSubscriptionsRecipient,
8
9
  RecipientPreferences,
9
10
  SubscriptionAddParams,
@@ -32,8 +33,12 @@ export class Lists extends APIResource {
32
33
  /**
33
34
  * Create or replace an existing list with the supplied values.
34
35
  */
35
- update(listID: string, body: ListUpdateParams, options?: RequestOptions): APIPromise<List> {
36
- return this._client.put(path`/lists/${listID}`, { body, ...options });
36
+ update(listID: string, body: ListUpdateParams, options?: RequestOptions): APIPromise<void> {
37
+ return this._client.put(path`/lists/${listID}`, {
38
+ body,
39
+ ...options,
40
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
41
+ });
37
42
  }
38
43
 
39
44
  /**
@@ -59,8 +64,9 @@ export class Lists extends APIResource {
59
64
  /**
60
65
  * Restore a previously deleted list.
61
66
  */
62
- restore(listID: string, options?: RequestOptions): APIPromise<void> {
67
+ restore(listID: string, body: ListRestoreParams, options?: RequestOptions): APIPromise<void> {
63
68
  return this._client.put(path`/lists/${listID}/restore`, {
69
+ body,
64
70
  ...options,
65
71
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
66
72
  });
@@ -72,9 +78,9 @@ export interface List {
72
78
 
73
79
  name: string;
74
80
 
75
- created?: number | null;
81
+ created?: string | null;
76
82
 
77
- updated?: number | null;
83
+ updated?: string | null;
78
84
  }
79
85
 
80
86
  export interface ListListResponse {
@@ -104,6 +110,8 @@ export interface ListListParams {
104
110
  pattern?: string | null;
105
111
  }
106
112
 
113
+ export interface ListRestoreParams {}
114
+
107
115
  Lists.Subscriptions = Subscriptions;
108
116
 
109
117
  export declare namespace Lists {
@@ -112,10 +120,12 @@ export declare namespace Lists {
112
120
  type ListListResponse as ListListResponse,
113
121
  type ListUpdateParams as ListUpdateParams,
114
122
  type ListListParams as ListListParams,
123
+ type ListRestoreParams as ListRestoreParams,
115
124
  };
116
125
 
117
126
  export {
118
127
  Subscriptions as Subscriptions,
128
+ type NotificationPreferenceDetails as NotificationPreferenceDetails,
119
129
  type PutSubscriptionsRecipient as PutSubscriptionsRecipient,
120
130
  type RecipientPreferences as RecipientPreferences,
121
131
  type SubscriptionListResponse as SubscriptionListResponse,
@@ -3,8 +3,8 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as SubscriptionsAPI from './subscriptions';
5
5
  import * as AudiencesAPI from '../audiences';
6
+ import * as Shared from '../shared';
6
7
  import * as PreferencesAPI from '../users/preferences';
7
- import * as ItemsAPI from '../tenants/default-preferences/items';
8
8
  import { APIPromise } from '../../core/api-promise';
9
9
  import { buildHeaders } from '../../internal/headers';
10
10
  import { RequestOptions } from '../../internal/request-options';
@@ -79,6 +79,14 @@ export class Subscriptions extends APIResource {
79
79
  }
80
80
  }
81
81
 
82
+ export interface NotificationPreferenceDetails {
83
+ status: PreferencesAPI.PreferenceStatus;
84
+
85
+ channel_preferences?: Array<Shared.ChannelPreference> | null;
86
+
87
+ rules?: Array<Shared.Rule> | null;
88
+ }
89
+
82
90
  export interface PutSubscriptionsRecipient {
83
91
  recipientId: string;
84
92
 
@@ -86,51 +94,9 @@ export interface PutSubscriptionsRecipient {
86
94
  }
87
95
 
88
96
  export interface RecipientPreferences {
89
- categories?: { [key: string]: RecipientPreferences.Categories } | null;
90
-
91
- notifications?: { [key: string]: RecipientPreferences.Notifications } | null;
92
- }
93
-
94
- export namespace RecipientPreferences {
95
- export interface Categories {
96
- status: PreferencesAPI.PreferenceStatus;
97
-
98
- channel_preferences?: Array<Categories.ChannelPreference> | null;
99
-
100
- rules?: Array<Categories.Rule> | null;
101
- }
102
-
103
- export namespace Categories {
104
- export interface ChannelPreference {
105
- channel: ItemsAPI.ChannelClassification;
106
- }
97
+ categories?: { [key: string]: NotificationPreferenceDetails } | null;
107
98
 
108
- export interface Rule {
109
- until: string;
110
-
111
- start?: string | null;
112
- }
113
- }
114
-
115
- export interface Notifications {
116
- status: PreferencesAPI.PreferenceStatus;
117
-
118
- channel_preferences?: Array<Notifications.ChannelPreference> | null;
119
-
120
- rules?: Array<Notifications.Rule> | null;
121
- }
122
-
123
- export namespace Notifications {
124
- export interface ChannelPreference {
125
- channel: ItemsAPI.ChannelClassification;
126
- }
127
-
128
- export interface Rule {
129
- until: string;
130
-
131
- start?: string | null;
132
- }
133
- }
99
+ notifications?: { [key: string]: NotificationPreferenceDetails } | null;
134
100
  }
135
101
 
136
102
  export interface SubscriptionListResponse {
@@ -185,6 +151,7 @@ export interface SubscriptionUnsubscribeUserParams {
185
151
 
186
152
  export declare namespace Subscriptions {
187
153
  export {
154
+ type NotificationPreferenceDetails as NotificationPreferenceDetails,
188
155
  type PutSubscriptionsRecipient as PutSubscriptionsRecipient,
189
156
  type RecipientPreferences as RecipientPreferences,
190
157
  type SubscriptionListResponse as SubscriptionListResponse,