@trycourier/courier 7.2.0 → 7.7.1

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 (175) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/LICENSE +1 -1
  3. package/README.md +34 -345
  4. package/client.d.mts +50 -9
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +50 -9
  7. package/client.d.ts.map +1 -1
  8. package/client.js +17 -4
  9. package/client.js.map +1 -1
  10. package/client.mjs +18 -5
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/utils/query.d.mts +2 -0
  19. package/internal/utils/query.d.mts.map +1 -0
  20. package/internal/utils/query.d.ts +2 -0
  21. package/internal/utils/query.d.ts.map +1 -0
  22. package/internal/utils/query.js +10 -0
  23. package/internal/utils/query.js.map +1 -0
  24. package/internal/utils/query.mjs +6 -0
  25. package/internal/utils/query.mjs.map +1 -0
  26. package/internal/utils.d.mts +1 -0
  27. package/internal/utils.d.ts +1 -0
  28. package/internal/utils.js +1 -0
  29. package/internal/utils.js.map +1 -1
  30. package/internal/utils.mjs +1 -0
  31. package/package.json +1 -1
  32. package/resources/audiences.d.mts +11 -33
  33. package/resources/audiences.d.mts.map +1 -1
  34. package/resources/audiences.d.ts +11 -33
  35. package/resources/audiences.d.ts.map +1 -1
  36. package/resources/automations/automations.d.mts +54 -1
  37. package/resources/automations/automations.d.mts.map +1 -1
  38. package/resources/automations/automations.d.ts +54 -1
  39. package/resources/automations/automations.d.ts.map +1 -1
  40. package/resources/automations/automations.js +12 -0
  41. package/resources/automations/automations.js.map +1 -1
  42. package/resources/automations/automations.mjs +12 -0
  43. package/resources/automations/automations.mjs.map +1 -1
  44. package/resources/automations/index.d.mts +1 -1
  45. package/resources/automations/index.d.mts.map +1 -1
  46. package/resources/automations/index.d.ts +1 -1
  47. package/resources/automations/index.d.ts.map +1 -1
  48. package/resources/automations/index.js.map +1 -1
  49. package/resources/automations/index.mjs +1 -1
  50. package/resources/automations/index.mjs.map +1 -1
  51. package/resources/bulk.d.mts +80 -39
  52. package/resources/bulk.d.mts.map +1 -1
  53. package/resources/bulk.d.ts +80 -39
  54. package/resources/bulk.d.ts.map +1 -1
  55. package/resources/bulk.js +12 -2
  56. package/resources/bulk.js.map +1 -1
  57. package/resources/bulk.mjs +12 -2
  58. package/resources/bulk.mjs.map +1 -1
  59. package/resources/inbound.d.mts +1 -1
  60. package/resources/inbound.d.ts +1 -1
  61. package/resources/index.d.mts +3 -3
  62. package/resources/index.d.mts.map +1 -1
  63. package/resources/index.d.ts +3 -3
  64. package/resources/index.d.ts.map +1 -1
  65. package/resources/index.js.map +1 -1
  66. package/resources/index.mjs +1 -1
  67. package/resources/index.mjs.map +1 -1
  68. package/resources/lists/subscriptions.d.mts +1 -1
  69. package/resources/lists/subscriptions.d.ts +1 -1
  70. package/resources/notifications/checks.d.mts +2 -2
  71. package/resources/notifications/checks.d.ts +2 -2
  72. package/resources/send.d.mts +8 -2
  73. package/resources/send.d.mts.map +1 -1
  74. package/resources/send.d.ts +8 -2
  75. package/resources/send.d.ts.map +1 -1
  76. package/resources/send.js +1 -1
  77. package/resources/send.mjs +1 -1
  78. package/resources/shared.d.mts +301 -49
  79. package/resources/shared.d.mts.map +1 -1
  80. package/resources/shared.d.ts +301 -49
  81. package/resources/shared.d.ts.map +1 -1
  82. package/resources/tenants/index.d.mts +2 -2
  83. package/resources/tenants/index.d.mts.map +1 -1
  84. package/resources/tenants/index.d.ts +2 -2
  85. package/resources/tenants/index.d.ts.map +1 -1
  86. package/resources/tenants/index.js +2 -2
  87. package/resources/tenants/index.js.map +1 -1
  88. package/resources/tenants/index.mjs +1 -1
  89. package/resources/tenants/index.mjs.map +1 -1
  90. package/resources/tenants/preferences/items.d.mts +2 -2
  91. package/resources/tenants/preferences/items.d.ts +2 -2
  92. package/resources/tenants/templates/index.d.mts +3 -0
  93. package/resources/tenants/templates/index.d.mts.map +1 -0
  94. package/resources/tenants/templates/index.d.ts +3 -0
  95. package/resources/tenants/templates/index.d.ts.map +1 -0
  96. package/resources/tenants/templates/index.js +9 -0
  97. package/resources/tenants/templates/index.js.map +1 -0
  98. package/resources/tenants/templates/index.mjs +4 -0
  99. package/resources/tenants/templates/index.mjs.map +1 -0
  100. package/resources/tenants/templates/templates.d.mts +159 -0
  101. package/resources/tenants/templates/templates.d.mts.map +1 -0
  102. package/resources/tenants/templates/templates.d.ts +159 -0
  103. package/resources/tenants/templates/templates.d.ts.map +1 -0
  104. package/resources/tenants/templates/templates.js +91 -0
  105. package/resources/tenants/templates/templates.js.map +1 -0
  106. package/resources/tenants/templates/templates.mjs +86 -0
  107. package/resources/tenants/templates/templates.mjs.map +1 -0
  108. package/resources/tenants/templates/versions.d.mts +39 -0
  109. package/resources/tenants/templates/versions.d.mts.map +1 -0
  110. package/resources/tenants/templates/versions.d.ts +39 -0
  111. package/resources/tenants/templates/versions.d.ts.map +1 -0
  112. package/resources/tenants/templates/versions.js +32 -0
  113. package/resources/tenants/templates/versions.js.map +1 -0
  114. package/resources/tenants/templates/versions.mjs +28 -0
  115. package/resources/tenants/templates/versions.mjs.map +1 -0
  116. package/resources/tenants/templates.d.mts +1 -90
  117. package/resources/tenants/templates.d.mts.map +1 -1
  118. package/resources/tenants/templates.d.ts +1 -90
  119. package/resources/tenants/templates.d.ts.map +1 -1
  120. package/resources/tenants/templates.js +2 -34
  121. package/resources/tenants/templates.js.map +1 -1
  122. package/resources/tenants/templates.mjs +1 -32
  123. package/resources/tenants/templates.mjs.map +1 -1
  124. package/resources/tenants/tenants.d.mts +147 -5
  125. package/resources/tenants/tenants.d.mts.map +1 -1
  126. package/resources/tenants/tenants.d.ts +147 -5
  127. package/resources/tenants/tenants.d.ts.map +1 -1
  128. package/resources/tenants/tenants.js +2 -2
  129. package/resources/tenants/tenants.js.map +1 -1
  130. package/resources/tenants/tenants.mjs +2 -2
  131. package/resources/tenants/tenants.mjs.map +1 -1
  132. package/resources/translations.d.mts +1 -1
  133. package/resources/translations.d.ts +1 -1
  134. package/resources/users/preferences.d.mts +1 -1
  135. package/resources/users/preferences.d.ts +1 -1
  136. package/resources/users/tenants.d.mts +1 -1
  137. package/resources/users/tenants.d.ts +1 -1
  138. package/resources/users/tokens.d.mts +7 -12
  139. package/resources/users/tokens.d.mts.map +1 -1
  140. package/resources/users/tokens.d.ts +7 -12
  141. package/resources/users/tokens.d.ts.map +1 -1
  142. package/resources/users/tokens.js +3 -6
  143. package/resources/users/tokens.js.map +1 -1
  144. package/resources/users/tokens.mjs +3 -6
  145. package/resources/users/tokens.mjs.map +1 -1
  146. package/src/client.ts +88 -15
  147. package/src/internal/parse.ts +6 -0
  148. package/src/internal/utils/query.ts +7 -0
  149. package/src/internal/utils.ts +1 -0
  150. package/src/resources/audiences.ts +11 -69
  151. package/src/resources/automations/automations.ts +74 -1
  152. package/src/resources/automations/index.ts +7 -1
  153. package/src/resources/bulk.ts +71 -32
  154. package/src/resources/inbound.ts +1 -1
  155. package/src/resources/index.ts +12 -3
  156. package/src/resources/lists/subscriptions.ts +1 -1
  157. package/src/resources/notifications/checks.ts +2 -2
  158. package/src/resources/send.ts +28 -2
  159. package/src/resources/shared.ts +402 -46
  160. package/src/resources/tenants/index.ts +8 -1
  161. package/src/resources/tenants/preferences/items.ts +2 -2
  162. package/src/resources/tenants/templates/index.ts +11 -0
  163. package/src/resources/tenants/templates/templates.ts +222 -0
  164. package/src/resources/tenants/templates/versions.ts +55 -0
  165. package/src/resources/tenants/templates.ts +1 -122
  166. package/src/resources/tenants/tenants.ts +179 -3
  167. package/src/resources/translations.ts +1 -1
  168. package/src/resources/users/preferences.ts +1 -1
  169. package/src/resources/users/tenants.ts +1 -1
  170. package/src/resources/users/tokens.ts +8 -14
  171. package/src/version.ts +1 -1
  172. package/version.d.mts +1 -1
  173. package/version.d.ts +1 -1
  174. package/version.js +1 -1
  175. package/version.mjs +1 -1
@@ -0,0 +1,222 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as Shared from '../../shared';
5
+ import * as TenantsAPI from '../tenants';
6
+ import * as VersionsAPI from './versions';
7
+ import { VersionRetrieveParams, Versions } from './versions';
8
+ import { APIPromise } from '../../../core/api-promise';
9
+ import { RequestOptions } from '../../../internal/request-options';
10
+ import { path } from '../../../internal/utils/path';
11
+
12
+ export class Templates extends APIResource {
13
+ versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
14
+
15
+ /**
16
+ * Get a Template in Tenant
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const baseTemplateTenantAssociation =
21
+ * await client.tenants.templates.retrieve('template_id', {
22
+ * tenant_id: 'tenant_id',
23
+ * });
24
+ * ```
25
+ */
26
+ retrieve(
27
+ templateID: string,
28
+ params: TemplateRetrieveParams,
29
+ options?: RequestOptions,
30
+ ): APIPromise<TenantsAPI.BaseTemplateTenantAssociation> {
31
+ const { tenant_id } = params;
32
+ return this._client.get(path`/tenants/${tenant_id}/templates/${templateID}`, options);
33
+ }
34
+
35
+ /**
36
+ * List Templates in Tenant
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const templates = await client.tenants.templates.list(
41
+ * 'tenant_id',
42
+ * );
43
+ * ```
44
+ */
45
+ list(
46
+ tenantID: string,
47
+ query: TemplateListParams | null | undefined = {},
48
+ options?: RequestOptions,
49
+ ): APIPromise<TemplateListResponse> {
50
+ return this._client.get(path`/tenants/${tenantID}/templates`, { query, ...options });
51
+ }
52
+
53
+ /**
54
+ * Publishes a specific version of a notification template for a tenant.
55
+ *
56
+ * The template must already exist in the tenant's notification map. If no version
57
+ * is specified, defaults to publishing the "latest" version.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const postTenantTemplatePublishResponse =
62
+ * await client.tenants.templates.publish('template_id', {
63
+ * tenant_id: 'tenant_id',
64
+ * });
65
+ * ```
66
+ */
67
+ publish(
68
+ templateID: string,
69
+ params: TemplatePublishParams,
70
+ options?: RequestOptions,
71
+ ): APIPromise<TenantsAPI.PostTenantTemplatePublishResponse> {
72
+ const { tenant_id, ...body } = params;
73
+ return this._client.post(path`/tenants/${tenant_id}/templates/${templateID}/publish`, {
74
+ body,
75
+ ...options,
76
+ });
77
+ }
78
+
79
+ /**
80
+ * Creates or updates a notification template for a tenant.
81
+ *
82
+ * If the template already exists for the tenant, it will be updated (200).
83
+ * Otherwise, a new template is created (201).
84
+ *
85
+ * Optionally publishes the template immediately if the `published` flag is set to
86
+ * true.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const putTenantTemplateResponse =
91
+ * await client.tenants.templates.replace('template_id', {
92
+ * tenant_id: 'tenant_id',
93
+ * template: {
94
+ * content: { elements: [{}], version: 'version' },
95
+ * },
96
+ * });
97
+ * ```
98
+ */
99
+ replace(
100
+ templateID: string,
101
+ params: TemplateReplaceParams,
102
+ options?: RequestOptions,
103
+ ): APIPromise<TenantsAPI.PutTenantTemplateResponse> {
104
+ const { tenant_id, ...body } = params;
105
+ return this._client.put(path`/tenants/${tenant_id}/templates/${templateID}`, { body, ...options });
106
+ }
107
+ }
108
+
109
+ export interface TemplateListResponse {
110
+ /**
111
+ * Set to true when there are more pages that can be retrieved.
112
+ */
113
+ has_more: boolean;
114
+
115
+ /**
116
+ * Always set to `list`. Represents the type of this object.
117
+ */
118
+ type: 'list';
119
+
120
+ /**
121
+ * A url that may be used to generate these results.
122
+ */
123
+ url: string;
124
+
125
+ /**
126
+ * A pointer to the next page of results. Defined only when `has_more` is set to
127
+ * true
128
+ */
129
+ cursor?: string | null;
130
+
131
+ items?: Array<TemplateListResponse.Item> | null;
132
+
133
+ /**
134
+ * A url that may be used to generate fetch the next set of results. Defined only
135
+ * when `has_more` is set to true
136
+ */
137
+ next_url?: string | null;
138
+ }
139
+
140
+ export namespace TemplateListResponse {
141
+ export interface Item extends TenantsAPI.BaseTemplateTenantAssociation {
142
+ /**
143
+ * The template's data containing it's routing configs
144
+ */
145
+ data: Item.Data;
146
+ }
147
+
148
+ export namespace Item {
149
+ /**
150
+ * The template's data containing it's routing configs
151
+ */
152
+ export interface Data {
153
+ routing: Shared.MessageRouting;
154
+ }
155
+ }
156
+ }
157
+
158
+ export interface TemplateRetrieveParams {
159
+ /**
160
+ * Id of the tenant for which to retrieve the template.
161
+ */
162
+ tenant_id: string;
163
+ }
164
+
165
+ export interface TemplateListParams {
166
+ /**
167
+ * Continue the pagination with the next cursor
168
+ */
169
+ cursor?: string | null;
170
+
171
+ /**
172
+ * The number of templates to return (defaults to 20, maximum value of 100)
173
+ */
174
+ limit?: number | null;
175
+ }
176
+
177
+ export interface TemplatePublishParams {
178
+ /**
179
+ * Path param: Id of the tenant that owns the template.
180
+ */
181
+ tenant_id: string;
182
+
183
+ /**
184
+ * Body param: The version of the template to publish (e.g., "v1", "v2", "latest").
185
+ * If not provided, defaults to "latest".
186
+ */
187
+ version?: string;
188
+ }
189
+
190
+ export interface TemplateReplaceParams {
191
+ /**
192
+ * Path param: Id of the tenant for which to create or update the template.
193
+ */
194
+ tenant_id: string;
195
+
196
+ /**
197
+ * Body param: Template configuration for creating or updating a tenant
198
+ * notification template
199
+ */
200
+ template: TenantsAPI.TenantTemplateInput;
201
+
202
+ /**
203
+ * Body param: Whether to publish the template immediately after saving. When true,
204
+ * the template becomes the active/published version. When false (default), the
205
+ * template is saved as a draft.
206
+ */
207
+ published?: boolean;
208
+ }
209
+
210
+ Templates.Versions = Versions;
211
+
212
+ export declare namespace Templates {
213
+ export {
214
+ type TemplateListResponse as TemplateListResponse,
215
+ type TemplateRetrieveParams as TemplateRetrieveParams,
216
+ type TemplateListParams as TemplateListParams,
217
+ type TemplatePublishParams as TemplatePublishParams,
218
+ type TemplateReplaceParams as TemplateReplaceParams,
219
+ };
220
+
221
+ export { Versions as Versions, type VersionRetrieveParams as VersionRetrieveParams };
222
+ }
@@ -0,0 +1,55 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as TenantsAPI from '../tenants';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
8
+
9
+ export class Versions extends APIResource {
10
+ /**
11
+ * Fetches a specific version of a tenant template.
12
+ *
13
+ * Supports the following version formats:
14
+ *
15
+ * - `latest` - The most recent version of the template
16
+ * - `published` - The currently published version
17
+ * - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const baseTemplateTenantAssociation =
22
+ * await client.tenants.templates.versions.retrieve(
23
+ * 'version',
24
+ * { tenant_id: 'tenant_id', template_id: 'template_id' },
25
+ * );
26
+ * ```
27
+ */
28
+ retrieve(
29
+ version: string,
30
+ params: VersionRetrieveParams,
31
+ options?: RequestOptions,
32
+ ): APIPromise<TenantsAPI.BaseTemplateTenantAssociation> {
33
+ const { tenant_id, template_id } = params;
34
+ return this._client.get(
35
+ path`/tenants/${tenant_id}/templates/${template_id}/versions/${version}`,
36
+ options,
37
+ );
38
+ }
39
+ }
40
+
41
+ export interface VersionRetrieveParams {
42
+ /**
43
+ * Id of the tenant for which to retrieve the template.
44
+ */
45
+ tenant_id: string;
46
+
47
+ /**
48
+ * Id of the template to be retrieved.
49
+ */
50
+ template_id: string;
51
+ }
52
+
53
+ export declare namespace Versions {
54
+ export { type VersionRetrieveParams as VersionRetrieveParams };
55
+ }
@@ -1,124 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../core/resource';
4
- import * as Shared from '../shared';
5
- import * as TenantsAPI from './tenants';
6
- import { APIPromise } from '../../core/api-promise';
7
- import { RequestOptions } from '../../internal/request-options';
8
- import { path } from '../../internal/utils/path';
9
-
10
- export class Templates extends APIResource {
11
- /**
12
- * Get a Template in Tenant
13
- *
14
- * @example
15
- * ```ts
16
- * const baseTemplateTenantAssociation =
17
- * await client.tenants.templates.retrieve('template_id', {
18
- * tenant_id: 'tenant_id',
19
- * });
20
- * ```
21
- */
22
- retrieve(
23
- templateID: string,
24
- params: TemplateRetrieveParams,
25
- options?: RequestOptions,
26
- ): APIPromise<TenantsAPI.BaseTemplateTenantAssociation> {
27
- const { tenant_id } = params;
28
- return this._client.get(path`/tenants/${tenant_id}/templates/${templateID}`, options);
29
- }
30
-
31
- /**
32
- * List Templates in Tenant
33
- *
34
- * @example
35
- * ```ts
36
- * const templates = await client.tenants.templates.list(
37
- * 'tenant_id',
38
- * );
39
- * ```
40
- */
41
- list(
42
- tenantID: string,
43
- query: TemplateListParams | null | undefined = {},
44
- options?: RequestOptions,
45
- ): APIPromise<TemplateListResponse> {
46
- return this._client.get(path`/tenants/${tenantID}/templates`, { query, ...options });
47
- }
48
- }
49
-
50
- export interface TemplateListResponse {
51
- /**
52
- * Set to true when there are more pages that can be retrieved.
53
- */
54
- has_more: boolean;
55
-
56
- /**
57
- * Always set to `list`. Represents the type of this object.
58
- */
59
- type: 'list';
60
-
61
- /**
62
- * A url that may be used to generate these results.
63
- */
64
- url: string;
65
-
66
- /**
67
- * A pointer to the next page of results. Defined only when `has_more` is set to
68
- * true
69
- */
70
- cursor?: string | null;
71
-
72
- items?: Array<TemplateListResponse.Item> | null;
73
-
74
- /**
75
- * A url that may be used to generate fetch the next set of results. Defined only
76
- * when `has_more` is set to true
77
- */
78
- next_url?: string | null;
79
- }
80
-
81
- export namespace TemplateListResponse {
82
- export interface Item extends TenantsAPI.BaseTemplateTenantAssociation {
83
- /**
84
- * The template's data containing it's routing configs
85
- */
86
- data: Item.Data;
87
- }
88
-
89
- export namespace Item {
90
- /**
91
- * The template's data containing it's routing configs
92
- */
93
- export interface Data {
94
- routing: Shared.MessageRouting;
95
- }
96
- }
97
- }
98
-
99
- export interface TemplateRetrieveParams {
100
- /**
101
- * Id of the tenant for which to retrieve the template.
102
- */
103
- tenant_id: string;
104
- }
105
-
106
- export interface TemplateListParams {
107
- /**
108
- * Continue the pagination with the next cursor
109
- */
110
- cursor?: string | null;
111
-
112
- /**
113
- * The number of templates to return (defaults to 20, maximum value of 100)
114
- */
115
- limit?: number | null;
116
- }
117
-
118
- export declare namespace Templates {
119
- export {
120
- type TemplateListResponse as TemplateListResponse,
121
- type TemplateRetrieveParams as TemplateRetrieveParams,
122
- type TemplateListParams as TemplateListParams,
123
- };
124
- }
3
+ export * from './templates/index';
@@ -3,10 +3,17 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as TenantsAPI from './tenants';
5
5
  import * as Shared from '../shared';
6
- import * as TemplatesAPI from './templates';
7
- import { TemplateListParams, TemplateListResponse, TemplateRetrieveParams, Templates } from './templates';
8
6
  import * as PreferencesAPI from './preferences/preferences';
9
7
  import { Preferences } from './preferences/preferences';
8
+ import * as TemplatesAPI from './templates/templates';
9
+ import {
10
+ TemplateListParams,
11
+ TemplateListResponse,
12
+ TemplatePublishParams,
13
+ TemplateReplaceParams,
14
+ TemplateRetrieveParams,
15
+ Templates,
16
+ } from './templates/templates';
10
17
  import { APIPromise } from '../../core/api-promise';
11
18
  import { buildHeaders } from '../../internal/headers';
12
19
  import { RequestOptions } from '../../internal/request-options';
@@ -131,6 +138,75 @@ export namespace DefaultPreferences {
131
138
  }
132
139
  }
133
140
 
141
+ /**
142
+ * Request body for publishing a tenant template version
143
+ */
144
+ export interface PostTenantTemplatePublishRequest {
145
+ /**
146
+ * The version of the template to publish (e.g., "v1", "v2", "latest"). If not
147
+ * provided, defaults to "latest".
148
+ */
149
+ version?: string;
150
+ }
151
+
152
+ /**
153
+ * Response from publishing a tenant template
154
+ */
155
+ export interface PostTenantTemplatePublishResponse {
156
+ /**
157
+ * The template ID
158
+ */
159
+ id: string;
160
+
161
+ /**
162
+ * The timestamp when the template was published
163
+ */
164
+ published_at: string;
165
+
166
+ /**
167
+ * The published version of the template
168
+ */
169
+ version: string;
170
+ }
171
+
172
+ /**
173
+ * Request body for creating or updating a tenant notification template
174
+ */
175
+ export interface PutTenantTemplateRequest {
176
+ /**
177
+ * Template configuration for creating or updating a tenant notification template
178
+ */
179
+ template: TenantTemplateInput;
180
+
181
+ /**
182
+ * Whether to publish the template immediately after saving. When true, the
183
+ * template becomes the active/published version. When false (default), the
184
+ * template is saved as a draft.
185
+ */
186
+ published?: boolean;
187
+ }
188
+
189
+ /**
190
+ * Response from creating or updating a tenant notification template
191
+ */
192
+ export interface PutTenantTemplateResponse {
193
+ /**
194
+ * The template ID
195
+ */
196
+ id: string;
197
+
198
+ /**
199
+ * The version of the saved template
200
+ */
201
+ version: string;
202
+
203
+ /**
204
+ * The timestamp when the template was published. Only present if the template was
205
+ * published as part of this request.
206
+ */
207
+ published_at?: string | null;
208
+ }
209
+
134
210
  export interface SubscriptionTopicNew {
135
211
  status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
136
212
 
@@ -141,7 +217,7 @@ export interface SubscriptionTopicNew {
141
217
 
142
218
  /**
143
219
  * Override channel routing with custom preferences. This will override any
144
- * template prefernces that are set, but a user can still customize their
220
+ * template preferences that are set, but a user can still customize their
145
221
  * preferences
146
222
  */
147
223
  has_custom_routing?: boolean | null;
@@ -205,6 +281,99 @@ export interface TenantAssociation {
205
281
  user_id?: string | null;
206
282
  }
207
283
 
284
+ /**
285
+ * Template configuration for creating or updating a tenant notification template
286
+ */
287
+ export interface TenantTemplateInput {
288
+ /**
289
+ * Template content configuration including blocks, elements, and message structure
290
+ */
291
+ content: Shared.ElementalContent;
292
+
293
+ /**
294
+ * Channel-specific delivery configuration (email, SMS, push, etc.)
295
+ */
296
+ channels?: { [key: string]: TenantTemplateInput.Channels };
297
+
298
+ /**
299
+ * Provider-specific delivery configuration for routing to specific email/SMS
300
+ * providers
301
+ */
302
+ providers?: { [key: string]: TenantTemplateInput.Providers };
303
+
304
+ /**
305
+ * Message routing configuration for multi-channel delivery strategies
306
+ */
307
+ routing?: Shared.MessageRouting;
308
+ }
309
+
310
+ export namespace TenantTemplateInput {
311
+ export interface Channels {
312
+ /**
313
+ * Brand id used for rendering.
314
+ */
315
+ brand_id?: string | null;
316
+
317
+ /**
318
+ * JS conditional with access to data/profile.
319
+ */
320
+ if?: string | null;
321
+
322
+ metadata?: Channels.Metadata | null;
323
+
324
+ /**
325
+ * Channel specific overrides.
326
+ */
327
+ override?: { [key: string]: unknown } | null;
328
+
329
+ /**
330
+ * Providers enabled for this channel.
331
+ */
332
+ providers?: Array<string> | null;
333
+
334
+ /**
335
+ * Defaults to `single`.
336
+ */
337
+ routing_method?: 'all' | 'single' | null;
338
+
339
+ timeouts?: Channels.Timeouts | null;
340
+ }
341
+
342
+ export namespace Channels {
343
+ export interface Metadata {
344
+ utm?: Shared.Utm | null;
345
+ }
346
+
347
+ export interface Timeouts {
348
+ channel?: number | null;
349
+
350
+ provider?: number | null;
351
+ }
352
+ }
353
+
354
+ export interface Providers {
355
+ /**
356
+ * JS conditional with access to data/profile.
357
+ */
358
+ if?: string | null;
359
+
360
+ metadata?: Providers.Metadata | null;
361
+
362
+ /**
363
+ * Provider-specific overrides.
364
+ */
365
+ override?: { [key: string]: unknown } | null;
366
+
367
+ timeouts?: number | null;
368
+ }
369
+
370
+ export namespace Providers {
371
+ export interface Metadata {
372
+ utm?: Shared.Utm | null;
373
+ }
374
+ }
375
+ }
376
+
208
377
  export interface TenantListResponse {
209
378
  /**
210
379
  * Set to true when there are more pages that can be retrieved.
@@ -339,9 +508,14 @@ export declare namespace Tenants {
339
508
  export {
340
509
  type BaseTemplateTenantAssociation as BaseTemplateTenantAssociation,
341
510
  type DefaultPreferences as DefaultPreferences,
511
+ type PostTenantTemplatePublishRequest as PostTenantTemplatePublishRequest,
512
+ type PostTenantTemplatePublishResponse as PostTenantTemplatePublishResponse,
513
+ type PutTenantTemplateRequest as PutTenantTemplateRequest,
514
+ type PutTenantTemplateResponse as PutTenantTemplateResponse,
342
515
  type SubscriptionTopicNew as SubscriptionTopicNew,
343
516
  type Tenant as Tenant,
344
517
  type TenantAssociation as TenantAssociation,
518
+ type TenantTemplateInput as TenantTemplateInput,
345
519
  type TenantListResponse as TenantListResponse,
346
520
  type TenantListUsersResponse as TenantListUsersResponse,
347
521
  type TenantUpdateParams as TenantUpdateParams,
@@ -356,5 +530,7 @@ export declare namespace Tenants {
356
530
  type TemplateListResponse as TemplateListResponse,
357
531
  type TemplateRetrieveParams as TemplateRetrieveParams,
358
532
  type TemplateListParams as TemplateListParams,
533
+ type TemplatePublishParams as TemplatePublishParams,
534
+ type TemplateReplaceParams as TemplateReplaceParams,
359
535
  };
360
536
  }
@@ -46,7 +46,7 @@ export interface TranslationUpdateParams {
46
46
  domain: string;
47
47
 
48
48
  /**
49
- * Body param:
49
+ * Body param
50
50
  */
51
51
  body: string;
52
52
  }
@@ -143,7 +143,7 @@ export interface PreferenceUpdateOrCreateTopicParams {
143
143
  user_id: string;
144
144
 
145
145
  /**
146
- * Body param:
146
+ * Body param
147
147
  */
148
148
  topic: PreferenceUpdateOrCreateTopicParams.Topic;
149
149
 
@@ -158,7 +158,7 @@ export interface TenantAddSingleParams {
158
158
  user_id: string;
159
159
 
160
160
  /**
161
- * Body param:
161
+ * Body param
162
162
  */
163
163
  profile?: { [key: string]: unknown } | null;
164
164
  }