4
4
5
5
import * as z from "zod" ;
6
6
import { remap as remap$ } from "../../lib/primitives.js" ;
7
- import {
8
- collectExtraKeys as collectExtraKeys$ ,
9
- safeParse ,
10
- } from "../../lib/schemas.js" ;
7
+ import { safeParse } from "../../lib/schemas.js" ;
11
8
import { Result as SafeParseResult } from "../../types/fp.js" ;
12
9
import { SDKValidationError } from "../errors/sdkvalidationerror.js" ;
13
10
import {
@@ -35,6 +32,34 @@ import {
35
32
TopicPayloadDto$outboundSchema ,
36
33
} from "./topicpayloaddto.js" ;
37
34
35
+ /**
36
+ * Override the email provider specific configurations for the entire workflow
37
+ *
38
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
39
+ */
40
+ export type Email = { } ;
41
+
42
+ /**
43
+ * Override the push provider specific configurations for the entire workflow
44
+ *
45
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
46
+ */
47
+ export type Push = { } ;
48
+
49
+ /**
50
+ * Override the sms provider specific configurations for the entire workflow
51
+ *
52
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
53
+ */
54
+ export type Sms = { } ;
55
+
56
+ /**
57
+ * Override the chat provider specific configurations for the entire workflow
58
+ *
59
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
60
+ */
61
+ export type Chat = { } ;
62
+
38
63
/**
39
64
* This could be used to override provider specific configurations
40
65
*/
@@ -47,7 +72,36 @@ export type Overrides = {
47
72
* Overrides the provider configuration for the entire workflow and all steps
48
73
*/
49
74
providers ?: { [ k : string ] : { [ k : string ] : any } } | undefined ;
50
- additionalProperties ?: { [ k : string ] : { [ k : string ] : any } } ;
75
+ /**
76
+ * Override the email provider specific configurations for the entire workflow
77
+ *
78
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
79
+ */
80
+ email ?: Email | undefined ;
81
+ /**
82
+ * Override the push provider specific configurations for the entire workflow
83
+ *
84
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
85
+ */
86
+ push ?: Push | undefined ;
87
+ /**
88
+ * Override the sms provider specific configurations for the entire workflow
89
+ *
90
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
91
+ */
92
+ sms ?: Sms | undefined ;
93
+ /**
94
+ * Override the chat provider specific configurations for the entire workflow
95
+ *
96
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
97
+ */
98
+ chat ?: Chat | undefined ;
99
+ /**
100
+ * Override the layout identifier for the entire workflow
101
+ *
102
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
103
+ */
104
+ layoutIdentifier ?: string | undefined ;
51
105
} ;
52
106
53
107
export type One = TopicPayloadDto | SubscriberPayloadDto | string ;
@@ -122,25 +176,185 @@ export type TriggerEventRequestDto = {
122
176
tenant ?: TenantPayloadDto | string | undefined ;
123
177
} ;
124
178
179
+ /** @internal */
180
+ export const Email$inboundSchema : z . ZodType < Email , z . ZodTypeDef , unknown > = z
181
+ . object ( { } ) ;
182
+
183
+ /** @internal */
184
+ export type Email$Outbound = { } ;
185
+
186
+ /** @internal */
187
+ export const Email$outboundSchema : z . ZodType <
188
+ Email$Outbound ,
189
+ z . ZodTypeDef ,
190
+ Email
191
+ > = z . object ( { } ) ;
192
+
193
+ /**
194
+ * @internal
195
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
196
+ */
197
+ export namespace Email$ {
198
+ /** @deprecated use `Email$inboundSchema` instead. */
199
+ export const inboundSchema = Email$inboundSchema ;
200
+ /** @deprecated use `Email$outboundSchema` instead. */
201
+ export const outboundSchema = Email$outboundSchema ;
202
+ /** @deprecated use `Email$Outbound` instead. */
203
+ export type Outbound = Email$Outbound ;
204
+ }
205
+
206
+ export function emailToJSON ( email : Email ) : string {
207
+ return JSON . stringify ( Email$outboundSchema . parse ( email ) ) ;
208
+ }
209
+
210
+ export function emailFromJSON (
211
+ jsonString : string ,
212
+ ) : SafeParseResult < Email , SDKValidationError > {
213
+ return safeParse (
214
+ jsonString ,
215
+ ( x ) => Email$inboundSchema . parse ( JSON . parse ( x ) ) ,
216
+ `Failed to parse 'Email' from JSON` ,
217
+ ) ;
218
+ }
219
+
220
+ /** @internal */
221
+ export const Push$inboundSchema : z . ZodType < Push , z . ZodTypeDef , unknown > = z
222
+ . object ( { } ) ;
223
+
224
+ /** @internal */
225
+ export type Push$Outbound = { } ;
226
+
227
+ /** @internal */
228
+ export const Push$outboundSchema : z . ZodType < Push$Outbound , z . ZodTypeDef , Push > =
229
+ z . object ( { } ) ;
230
+
231
+ /**
232
+ * @internal
233
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
234
+ */
235
+ export namespace Push$ {
236
+ /** @deprecated use `Push$inboundSchema` instead. */
237
+ export const inboundSchema = Push$inboundSchema ;
238
+ /** @deprecated use `Push$outboundSchema` instead. */
239
+ export const outboundSchema = Push$outboundSchema ;
240
+ /** @deprecated use `Push$Outbound` instead. */
241
+ export type Outbound = Push$Outbound ;
242
+ }
243
+
244
+ export function pushToJSON ( push : Push ) : string {
245
+ return JSON . stringify ( Push$outboundSchema . parse ( push ) ) ;
246
+ }
247
+
248
+ export function pushFromJSON (
249
+ jsonString : string ,
250
+ ) : SafeParseResult < Push , SDKValidationError > {
251
+ return safeParse (
252
+ jsonString ,
253
+ ( x ) => Push$inboundSchema . parse ( JSON . parse ( x ) ) ,
254
+ `Failed to parse 'Push' from JSON` ,
255
+ ) ;
256
+ }
257
+
258
+ /** @internal */
259
+ export const Sms$inboundSchema : z . ZodType < Sms , z . ZodTypeDef , unknown > = z
260
+ . object ( { } ) ;
261
+
262
+ /** @internal */
263
+ export type Sms$Outbound = { } ;
264
+
265
+ /** @internal */
266
+ export const Sms$outboundSchema : z . ZodType < Sms$Outbound , z . ZodTypeDef , Sms > = z
267
+ . object ( { } ) ;
268
+
269
+ /**
270
+ * @internal
271
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
272
+ */
273
+ export namespace Sms$ {
274
+ /** @deprecated use `Sms$inboundSchema` instead. */
275
+ export const inboundSchema = Sms$inboundSchema ;
276
+ /** @deprecated use `Sms$outboundSchema` instead. */
277
+ export const outboundSchema = Sms$outboundSchema ;
278
+ /** @deprecated use `Sms$Outbound` instead. */
279
+ export type Outbound = Sms$Outbound ;
280
+ }
281
+
282
+ export function smsToJSON ( sms : Sms ) : string {
283
+ return JSON . stringify ( Sms$outboundSchema . parse ( sms ) ) ;
284
+ }
285
+
286
+ export function smsFromJSON (
287
+ jsonString : string ,
288
+ ) : SafeParseResult < Sms , SDKValidationError > {
289
+ return safeParse (
290
+ jsonString ,
291
+ ( x ) => Sms$inboundSchema . parse ( JSON . parse ( x ) ) ,
292
+ `Failed to parse 'Sms' from JSON` ,
293
+ ) ;
294
+ }
295
+
296
+ /** @internal */
297
+ export const Chat$inboundSchema : z . ZodType < Chat , z . ZodTypeDef , unknown > = z
298
+ . object ( { } ) ;
299
+
300
+ /** @internal */
301
+ export type Chat$Outbound = { } ;
302
+
303
+ /** @internal */
304
+ export const Chat$outboundSchema : z . ZodType < Chat$Outbound , z . ZodTypeDef , Chat > =
305
+ z . object ( { } ) ;
306
+
307
+ /**
308
+ * @internal
309
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
310
+ */
311
+ export namespace Chat$ {
312
+ /** @deprecated use `Chat$inboundSchema` instead. */
313
+ export const inboundSchema = Chat$inboundSchema ;
314
+ /** @deprecated use `Chat$outboundSchema` instead. */
315
+ export const outboundSchema = Chat$outboundSchema ;
316
+ /** @deprecated use `Chat$Outbound` instead. */
317
+ export type Outbound = Chat$Outbound ;
318
+ }
319
+
320
+ export function chatToJSON ( chat : Chat ) : string {
321
+ return JSON . stringify ( Chat$outboundSchema . parse ( chat ) ) ;
322
+ }
323
+
324
+ export function chatFromJSON (
325
+ jsonString : string ,
326
+ ) : SafeParseResult < Chat , SDKValidationError > {
327
+ return safeParse (
328
+ jsonString ,
329
+ ( x ) => Chat$inboundSchema . parse ( JSON . parse ( x ) ) ,
330
+ `Failed to parse 'Chat' from JSON` ,
331
+ ) ;
332
+ }
333
+
125
334
/** @internal */
126
335
export const Overrides$inboundSchema : z . ZodType <
127
336
Overrides ,
128
337
z . ZodTypeDef ,
129
338
unknown
130
- > = collectExtraKeys$ (
131
- z . object ( {
132
- steps : z . record ( StepsOverrides$inboundSchema ) . optional ( ) ,
133
- providers : z . record ( z . record ( z . any ( ) ) ) . optional ( ) ,
134
- } ) . catchall ( z . record ( z . any ( ) ) ) ,
135
- "additionalProperties" ,
136
- true ,
137
- ) ;
339
+ > = z . object ( {
340
+ steps : z . record ( StepsOverrides$inboundSchema ) . optional ( ) ,
341
+ providers : z . record ( z . record ( z . any ( ) ) ) . optional ( ) ,
342
+ email : z . lazy ( ( ) => Email$inboundSchema ) . optional ( ) ,
343
+ push : z . lazy ( ( ) => Push$inboundSchema ) . optional ( ) ,
344
+ sms : z . lazy ( ( ) => Sms$inboundSchema ) . optional ( ) ,
345
+ chat : z . lazy ( ( ) => Chat$inboundSchema ) . optional ( ) ,
346
+ layoutIdentifier : z . string ( ) . optional ( ) ,
347
+ } ) ;
138
348
139
349
/** @internal */
140
350
export type Overrides$Outbound = {
141
351
steps ?: { [ k : string ] : StepsOverrides$Outbound } | undefined ;
142
352
providers ?: { [ k : string ] : { [ k : string ] : any } } | undefined ;
143
- [ additionalProperties : string ] : unknown ;
353
+ email ?: Email$Outbound | undefined ;
354
+ push ?: Push$Outbound | undefined ;
355
+ sms ?: Sms$Outbound | undefined ;
356
+ chat ?: Chat$Outbound | undefined ;
357
+ layoutIdentifier ?: string | undefined ;
144
358
} ;
145
359
146
360
/** @internal */
@@ -151,14 +365,11 @@ export const Overrides$outboundSchema: z.ZodType<
151
365
> = z . object ( {
152
366
steps : z . record ( StepsOverrides$outboundSchema ) . optional ( ) ,
153
367
providers : z . record ( z . record ( z . any ( ) ) ) . optional ( ) ,
154
- additionalProperties : z . record ( z . record ( z . any ( ) ) ) ,
155
- } ) . transform ( ( v ) => {
156
- return {
157
- ...v . additionalProperties ,
158
- ...remap$ ( v , {
159
- additionalProperties : null ,
160
- } ) ,
161
- } ;
368
+ email : z . lazy ( ( ) => Email$outboundSchema ) . optional ( ) ,
369
+ push : z . lazy ( ( ) => Push$outboundSchema ) . optional ( ) ,
370
+ sms : z . lazy ( ( ) => Sms$outboundSchema ) . optional ( ) ,
371
+ chat : z . lazy ( ( ) => Chat$outboundSchema ) . optional ( ) ,
372
+ layoutIdentifier : z . string ( ) . optional ( ) ,
162
373
} ) ;
163
374
164
375
/**
0 commit comments