@novu/api 0.0.1-alpha.192 → 0.0.1-alpha.193

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 (144) hide show
  1. package/lib/config.d.ts +3 -3
  2. package/lib/config.js +3 -3
  3. package/models/components/activitynotificationexecutiondetailresponsedto.d.ts +4 -83
  4. package/models/components/activitynotificationexecutiondetailresponsedto.d.ts.map +1 -1
  5. package/models/components/activitynotificationexecutiondetailresponsedto.js +7 -56
  6. package/models/components/activitynotificationexecutiondetailresponsedto.js.map +1 -1
  7. package/models/components/activitynotificationjobresponsedto.d.ts +3 -3
  8. package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
  9. package/models/components/activitynotificationjobresponsedto.js +3 -3
  10. package/models/components/activitynotificationjobresponsedto.js.map +1 -1
  11. package/models/components/activitynotificationresponsedto.d.ts +112 -0
  12. package/models/components/activitynotificationresponsedto.d.ts.map +1 -1
  13. package/models/components/activitynotificationresponsedto.js +94 -1
  14. package/models/components/activitynotificationresponsedto.js.map +1 -1
  15. package/models/components/activitynotificationstepresponsedto.d.ts +139 -3
  16. package/models/components/activitynotificationstepresponsedto.d.ts.map +1 -1
  17. package/models/components/activitynotificationstepresponsedto.js +117 -4
  18. package/models/components/activitynotificationstepresponsedto.js.map +1 -1
  19. package/models/components/activitynotificationtemplateresponsedto.d.ts +3 -3
  20. package/models/components/activitynotificationtemplateresponsedto.d.ts.map +1 -1
  21. package/models/components/activitynotificationtemplateresponsedto.js +3 -3
  22. package/models/components/activitynotificationtemplateresponsedto.js.map +1 -1
  23. package/models/components/{builderfieldtype.d.ts → builderfieldtypeenum.d.ts} +8 -8
  24. package/models/components/builderfieldtypeenum.d.ts.map +1 -0
  25. package/models/components/{builderfieldtype.js → builderfieldtypeenum.js} +12 -12
  26. package/models/components/builderfieldtypeenum.js.map +1 -0
  27. package/models/components/{digestwitheventsdto.d.ts → digestmetadatadto.d.ts} +47 -14
  28. package/models/components/digestmetadatadto.d.ts.map +1 -0
  29. package/models/components/{digestwitheventsdto.js → digestmetadatadto.js} +32 -17
  30. package/models/components/digestmetadatadto.js.map +1 -0
  31. package/models/components/digesttimedconfigdto.d.ts +106 -0
  32. package/models/components/digesttimedconfigdto.d.ts.map +1 -0
  33. package/models/components/digesttimedconfigdto.js +99 -0
  34. package/models/components/digesttimedconfigdto.js.map +1 -0
  35. package/models/components/digesttypeenum.d.ts +37 -0
  36. package/models/components/digesttypeenum.d.ts.map +1 -0
  37. package/models/components/digesttypeenum.js +54 -0
  38. package/models/components/digesttypeenum.js.map +1 -0
  39. package/models/components/digestunitenum.d.ts +46 -0
  40. package/models/components/digestunitenum.d.ts.map +1 -0
  41. package/models/components/digestunitenum.js +57 -0
  42. package/models/components/digestunitenum.js.map +1 -0
  43. package/models/components/executiondetailssourceenum.d.ts +40 -0
  44. package/models/components/executiondetailssourceenum.d.ts.map +1 -0
  45. package/models/components/executiondetailssourceenum.js +55 -0
  46. package/models/components/executiondetailssourceenum.js.map +1 -0
  47. package/models/components/executiondetailsstatusenum.d.ts +46 -0
  48. package/models/components/executiondetailsstatusenum.d.ts.map +1 -0
  49. package/models/components/executiondetailsstatusenum.js +57 -0
  50. package/models/components/executiondetailsstatusenum.js.map +1 -0
  51. package/models/components/index.d.ts +14 -5
  52. package/models/components/index.d.ts.map +1 -1
  53. package/models/components/index.js +14 -5
  54. package/models/components/index.js.map +1 -1
  55. package/models/components/monthlytypeenum.d.ts +34 -0
  56. package/models/components/monthlytypeenum.d.ts.map +1 -0
  57. package/models/components/monthlytypeenum.js +53 -0
  58. package/models/components/monthlytypeenum.js.map +1 -0
  59. package/models/components/notificationstepdata.d.ts +113 -0
  60. package/models/components/notificationstepdata.d.ts.map +1 -0
  61. package/models/components/notificationstepdata.js +142 -0
  62. package/models/components/notificationstepdata.js.map +1 -0
  63. package/models/components/notificationstepdto.d.ts +116 -0
  64. package/models/components/notificationstepdto.d.ts.map +1 -0
  65. package/models/components/notificationstepdto.js +145 -0
  66. package/models/components/notificationstepdto.js.map +1 -0
  67. package/models/components/notificationtrigger.d.ts +8 -26
  68. package/models/components/notificationtrigger.d.ts.map +1 -1
  69. package/models/components/notificationtrigger.js +13 -16
  70. package/models/components/notificationtrigger.js.map +1 -1
  71. package/models/components/notificationtriggerdto.d.ts +77 -0
  72. package/models/components/notificationtriggerdto.d.ts.map +1 -0
  73. package/models/components/notificationtriggerdto.js +89 -0
  74. package/models/components/notificationtriggerdto.js.map +1 -0
  75. package/models/components/ordinalenum.d.ts +46 -0
  76. package/models/components/ordinalenum.d.ts.map +1 -0
  77. package/models/components/{stepfilter.js → ordinalenum.js} +23 -20
  78. package/models/components/ordinalenum.js.map +1 -0
  79. package/models/components/ordinalvalueenum.d.ts +58 -0
  80. package/models/components/ordinalvalueenum.d.ts.map +1 -0
  81. package/models/components/ordinalvalueenum.js +61 -0
  82. package/models/components/ordinalvalueenum.js.map +1 -0
  83. package/models/components/replycallback.d.ts +37 -0
  84. package/models/components/replycallback.d.ts.map +1 -0
  85. package/models/components/replycallback.js +61 -0
  86. package/models/components/replycallback.js.map +1 -0
  87. package/models/components/stepfilterdto.d.ts +2 -2
  88. package/models/components/stepfilterdto.d.ts.map +1 -1
  89. package/models/components/stepfilterdto.js +3 -3
  90. package/models/components/stepfilterdto.js.map +1 -1
  91. package/models/components/timedconfig.d.ts +8 -8
  92. package/models/components/timedconfig.d.ts.map +1 -1
  93. package/models/components/timedconfig.js +13 -14
  94. package/models/components/timedconfig.js.map +1 -1
  95. package/models/components/workflowresponse.d.ts +3 -3
  96. package/models/components/workflowresponse.d.ts.map +1 -1
  97. package/models/components/workflowresponse.js +3 -3
  98. package/models/components/workflowresponse.js.map +1 -1
  99. package/package.json +1 -1
  100. package/src/lib/config.ts +3 -3
  101. package/src/models/components/activitynotificationexecutiondetailresponsedto.ts +16 -81
  102. package/src/models/components/activitynotificationjobresponsedto.ts +9 -9
  103. package/src/models/components/activitynotificationresponsedto.ts +228 -0
  104. package/src/models/components/activitynotificationstepresponsedto.ts +294 -9
  105. package/src/models/components/activitynotificationtemplateresponsedto.ts +9 -9
  106. package/src/models/components/builderfieldtypeenum.ts +39 -0
  107. package/src/models/components/digestmetadatadto.ts +185 -0
  108. package/src/models/components/digesttimedconfigdto.ts +157 -0
  109. package/src/models/components/digesttypeenum.ts +40 -0
  110. package/src/models/components/digestunitenum.ts +43 -0
  111. package/src/models/components/executiondetailssourceenum.ts +43 -0
  112. package/src/models/components/executiondetailsstatusenum.ts +45 -0
  113. package/src/models/components/index.ts +14 -5
  114. package/src/models/components/monthlytypeenum.ts +39 -0
  115. package/src/models/components/notificationstepdata.ts +287 -0
  116. package/src/models/components/notificationstepdto.ts +297 -0
  117. package/src/models/components/notificationtrigger.ts +18 -33
  118. package/src/models/components/notificationtriggerdto.ts +130 -0
  119. package/src/models/components/ordinalenum.ts +41 -0
  120. package/src/models/components/ordinalvalueenum.ts +47 -0
  121. package/src/models/components/replycallback.ts +72 -0
  122. package/src/models/components/stepfilterdto.ts +7 -7
  123. package/src/models/components/timedconfig.ts +16 -14
  124. package/src/models/components/workflowresponse.ts +9 -9
  125. package/models/components/builderfieldtype.d.ts.map +0 -1
  126. package/models/components/builderfieldtype.js.map +0 -1
  127. package/models/components/digestwitheventsdto.d.ts.map +0 -1
  128. package/models/components/digestwitheventsdto.js.map +0 -1
  129. package/models/components/notificationstep.d.ts +0 -121
  130. package/models/components/notificationstep.d.ts.map +0 -1
  131. package/models/components/notificationstep.js +0 -190
  132. package/models/components/notificationstep.js.map +0 -1
  133. package/models/components/notificationstepvariant.d.ts +0 -118
  134. package/models/components/notificationstepvariant.d.ts.map +0 -1
  135. package/models/components/notificationstepvariant.js +0 -189
  136. package/models/components/notificationstepvariant.js.map +0 -1
  137. package/models/components/stepfilter.d.ts +0 -25
  138. package/models/components/stepfilter.d.ts.map +0 -1
  139. package/models/components/stepfilter.js.map +0 -1
  140. package/src/models/components/builderfieldtype.ts +0 -39
  141. package/src/models/components/digestwitheventsdto.ts +0 -127
  142. package/src/models/components/notificationstep.ts +0 -341
  143. package/src/models/components/notificationstepvariant.ts +0 -358
  144. package/src/models/components/stepfilter.ts +0 -54
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Type of monthly schedule
10
+ */
11
+ export const MonthlyTypeEnum = {
12
+ Each: "each",
13
+ On: "on",
14
+ } as const;
15
+ /**
16
+ * Type of monthly schedule
17
+ */
18
+ export type MonthlyTypeEnum = ClosedEnum<typeof MonthlyTypeEnum>;
19
+
20
+ /** @internal */
21
+ export const MonthlyTypeEnum$inboundSchema: z.ZodNativeEnum<
22
+ typeof MonthlyTypeEnum
23
+ > = z.nativeEnum(MonthlyTypeEnum);
24
+
25
+ /** @internal */
26
+ export const MonthlyTypeEnum$outboundSchema: z.ZodNativeEnum<
27
+ typeof MonthlyTypeEnum
28
+ > = MonthlyTypeEnum$inboundSchema;
29
+
30
+ /**
31
+ * @internal
32
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
33
+ */
34
+ export namespace MonthlyTypeEnum$ {
35
+ /** @deprecated use `MonthlyTypeEnum$inboundSchema` instead. */
36
+ export const inboundSchema = MonthlyTypeEnum$inboundSchema;
37
+ /** @deprecated use `MonthlyTypeEnum$outboundSchema` instead. */
38
+ export const outboundSchema = MonthlyTypeEnum$outboundSchema;
39
+ }
@@ -0,0 +1,287 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ DelayRegularMetadata,
12
+ DelayRegularMetadata$inboundSchema,
13
+ DelayRegularMetadata$Outbound,
14
+ DelayRegularMetadata$outboundSchema,
15
+ } from "./delayregularmetadata.js";
16
+ import {
17
+ DelayScheduledMetadata,
18
+ DelayScheduledMetadata$inboundSchema,
19
+ DelayScheduledMetadata$Outbound,
20
+ DelayScheduledMetadata$outboundSchema,
21
+ } from "./delayscheduledmetadata.js";
22
+ import {
23
+ DigestRegularMetadata,
24
+ DigestRegularMetadata$inboundSchema,
25
+ DigestRegularMetadata$Outbound,
26
+ DigestRegularMetadata$outboundSchema,
27
+ } from "./digestregularmetadata.js";
28
+ import {
29
+ DigestTimedMetadata,
30
+ DigestTimedMetadata$inboundSchema,
31
+ DigestTimedMetadata$Outbound,
32
+ DigestTimedMetadata$outboundSchema,
33
+ } from "./digesttimedmetadata.js";
34
+ import {
35
+ MessageTemplate,
36
+ MessageTemplate$inboundSchema,
37
+ MessageTemplate$Outbound,
38
+ MessageTemplate$outboundSchema,
39
+ } from "./messagetemplate.js";
40
+ import {
41
+ ReplyCallback,
42
+ ReplyCallback$inboundSchema,
43
+ ReplyCallback$Outbound,
44
+ ReplyCallback$outboundSchema,
45
+ } from "./replycallback.js";
46
+ import {
47
+ StepFilterDto,
48
+ StepFilterDto$inboundSchema,
49
+ StepFilterDto$Outbound,
50
+ StepFilterDto$outboundSchema,
51
+ } from "./stepfilterdto.js";
52
+
53
+ /**
54
+ * Metadata associated with the workflow step. Can vary based on the type of step.
55
+ */
56
+ export type NotificationStepDataMetadata =
57
+ | DelayScheduledMetadata
58
+ | DelayRegularMetadata
59
+ | DigestTimedMetadata
60
+ | DigestRegularMetadata;
61
+
62
+ export type NotificationStepData = {
63
+ /**
64
+ * Unique identifier for the notification step.
65
+ */
66
+ id?: string | undefined;
67
+ /**
68
+ * Universally unique identifier for the notification step.
69
+ */
70
+ uuid?: string | undefined;
71
+ /**
72
+ * Name of the notification step.
73
+ */
74
+ name?: string | undefined;
75
+ /**
76
+ * ID of the template associated with this notification step.
77
+ */
78
+ templateId?: string | undefined;
79
+ /**
80
+ * Indicates whether the notification step is active.
81
+ */
82
+ active?: boolean | undefined;
83
+ /**
84
+ * Determines if the process should stop on failure.
85
+ */
86
+ shouldStopOnFail?: boolean | undefined;
87
+ /**
88
+ * Message template used in this notification step.
89
+ */
90
+ template?: MessageTemplate | undefined;
91
+ /**
92
+ * Filters applied to this notification step.
93
+ */
94
+ filters?: Array<StepFilterDto> | undefined;
95
+ /**
96
+ * ID of the parent notification step, if applicable.
97
+ */
98
+ parentId?: string | undefined;
99
+ /**
100
+ * Metadata associated with the workflow step. Can vary based on the type of step.
101
+ */
102
+ metadata?:
103
+ | DelayScheduledMetadata
104
+ | DelayRegularMetadata
105
+ | DigestTimedMetadata
106
+ | DigestRegularMetadata
107
+ | undefined;
108
+ /**
109
+ * Callback information for replies, including whether it is active and the callback URL.
110
+ */
111
+ replyCallback?: ReplyCallback | undefined;
112
+ };
113
+
114
+ /** @internal */
115
+ export const NotificationStepDataMetadata$inboundSchema: z.ZodType<
116
+ NotificationStepDataMetadata,
117
+ z.ZodTypeDef,
118
+ unknown
119
+ > = z.union([
120
+ DelayScheduledMetadata$inboundSchema,
121
+ DelayRegularMetadata$inboundSchema,
122
+ DigestTimedMetadata$inboundSchema,
123
+ DigestRegularMetadata$inboundSchema,
124
+ ]);
125
+
126
+ /** @internal */
127
+ export type NotificationStepDataMetadata$Outbound =
128
+ | DelayScheduledMetadata$Outbound
129
+ | DelayRegularMetadata$Outbound
130
+ | DigestTimedMetadata$Outbound
131
+ | DigestRegularMetadata$Outbound;
132
+
133
+ /** @internal */
134
+ export const NotificationStepDataMetadata$outboundSchema: z.ZodType<
135
+ NotificationStepDataMetadata$Outbound,
136
+ z.ZodTypeDef,
137
+ NotificationStepDataMetadata
138
+ > = z.union([
139
+ DelayScheduledMetadata$outboundSchema,
140
+ DelayRegularMetadata$outboundSchema,
141
+ DigestTimedMetadata$outboundSchema,
142
+ DigestRegularMetadata$outboundSchema,
143
+ ]);
144
+
145
+ /**
146
+ * @internal
147
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
148
+ */
149
+ export namespace NotificationStepDataMetadata$ {
150
+ /** @deprecated use `NotificationStepDataMetadata$inboundSchema` instead. */
151
+ export const inboundSchema = NotificationStepDataMetadata$inboundSchema;
152
+ /** @deprecated use `NotificationStepDataMetadata$outboundSchema` instead. */
153
+ export const outboundSchema = NotificationStepDataMetadata$outboundSchema;
154
+ /** @deprecated use `NotificationStepDataMetadata$Outbound` instead. */
155
+ export type Outbound = NotificationStepDataMetadata$Outbound;
156
+ }
157
+
158
+ export function notificationStepDataMetadataToJSON(
159
+ notificationStepDataMetadata: NotificationStepDataMetadata,
160
+ ): string {
161
+ return JSON.stringify(
162
+ NotificationStepDataMetadata$outboundSchema.parse(
163
+ notificationStepDataMetadata,
164
+ ),
165
+ );
166
+ }
167
+
168
+ export function notificationStepDataMetadataFromJSON(
169
+ jsonString: string,
170
+ ): SafeParseResult<NotificationStepDataMetadata, SDKValidationError> {
171
+ return safeParse(
172
+ jsonString,
173
+ (x) => NotificationStepDataMetadata$inboundSchema.parse(JSON.parse(x)),
174
+ `Failed to parse 'NotificationStepDataMetadata' from JSON`,
175
+ );
176
+ }
177
+
178
+ /** @internal */
179
+ export const NotificationStepData$inboundSchema: z.ZodType<
180
+ NotificationStepData,
181
+ z.ZodTypeDef,
182
+ unknown
183
+ > = z.object({
184
+ _id: z.string().optional(),
185
+ uuid: z.string().optional(),
186
+ name: z.string().optional(),
187
+ _templateId: z.string().optional(),
188
+ active: z.boolean().optional(),
189
+ shouldStopOnFail: z.boolean().optional(),
190
+ template: MessageTemplate$inboundSchema.optional(),
191
+ filters: z.array(StepFilterDto$inboundSchema).optional(),
192
+ _parentId: z.string().optional(),
193
+ metadata: z.union([
194
+ DelayScheduledMetadata$inboundSchema,
195
+ DelayRegularMetadata$inboundSchema,
196
+ DigestTimedMetadata$inboundSchema,
197
+ DigestRegularMetadata$inboundSchema,
198
+ ]).optional(),
199
+ replyCallback: ReplyCallback$inboundSchema.optional(),
200
+ }).transform((v) => {
201
+ return remap$(v, {
202
+ "_id": "id",
203
+ "_templateId": "templateId",
204
+ "_parentId": "parentId",
205
+ });
206
+ });
207
+
208
+ /** @internal */
209
+ export type NotificationStepData$Outbound = {
210
+ _id?: string | undefined;
211
+ uuid?: string | undefined;
212
+ name?: string | undefined;
213
+ _templateId?: string | undefined;
214
+ active?: boolean | undefined;
215
+ shouldStopOnFail?: boolean | undefined;
216
+ template?: MessageTemplate$Outbound | undefined;
217
+ filters?: Array<StepFilterDto$Outbound> | undefined;
218
+ _parentId?: string | undefined;
219
+ metadata?:
220
+ | DelayScheduledMetadata$Outbound
221
+ | DelayRegularMetadata$Outbound
222
+ | DigestTimedMetadata$Outbound
223
+ | DigestRegularMetadata$Outbound
224
+ | undefined;
225
+ replyCallback?: ReplyCallback$Outbound | undefined;
226
+ };
227
+
228
+ /** @internal */
229
+ export const NotificationStepData$outboundSchema: z.ZodType<
230
+ NotificationStepData$Outbound,
231
+ z.ZodTypeDef,
232
+ NotificationStepData
233
+ > = z.object({
234
+ id: z.string().optional(),
235
+ uuid: z.string().optional(),
236
+ name: z.string().optional(),
237
+ templateId: z.string().optional(),
238
+ active: z.boolean().optional(),
239
+ shouldStopOnFail: z.boolean().optional(),
240
+ template: MessageTemplate$outboundSchema.optional(),
241
+ filters: z.array(StepFilterDto$outboundSchema).optional(),
242
+ parentId: z.string().optional(),
243
+ metadata: z.union([
244
+ DelayScheduledMetadata$outboundSchema,
245
+ DelayRegularMetadata$outboundSchema,
246
+ DigestTimedMetadata$outboundSchema,
247
+ DigestRegularMetadata$outboundSchema,
248
+ ]).optional(),
249
+ replyCallback: ReplyCallback$outboundSchema.optional(),
250
+ }).transform((v) => {
251
+ return remap$(v, {
252
+ id: "_id",
253
+ templateId: "_templateId",
254
+ parentId: "_parentId",
255
+ });
256
+ });
257
+
258
+ /**
259
+ * @internal
260
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
261
+ */
262
+ export namespace NotificationStepData$ {
263
+ /** @deprecated use `NotificationStepData$inboundSchema` instead. */
264
+ export const inboundSchema = NotificationStepData$inboundSchema;
265
+ /** @deprecated use `NotificationStepData$outboundSchema` instead. */
266
+ export const outboundSchema = NotificationStepData$outboundSchema;
267
+ /** @deprecated use `NotificationStepData$Outbound` instead. */
268
+ export type Outbound = NotificationStepData$Outbound;
269
+ }
270
+
271
+ export function notificationStepDataToJSON(
272
+ notificationStepData: NotificationStepData,
273
+ ): string {
274
+ return JSON.stringify(
275
+ NotificationStepData$outboundSchema.parse(notificationStepData),
276
+ );
277
+ }
278
+
279
+ export function notificationStepDataFromJSON(
280
+ jsonString: string,
281
+ ): SafeParseResult<NotificationStepData, SDKValidationError> {
282
+ return safeParse(
283
+ jsonString,
284
+ (x) => NotificationStepData$inboundSchema.parse(JSON.parse(x)),
285
+ `Failed to parse 'NotificationStepData' from JSON`,
286
+ );
287
+ }
@@ -0,0 +1,297 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ DelayRegularMetadata,
12
+ DelayRegularMetadata$inboundSchema,
13
+ DelayRegularMetadata$Outbound,
14
+ DelayRegularMetadata$outboundSchema,
15
+ } from "./delayregularmetadata.js";
16
+ import {
17
+ DelayScheduledMetadata,
18
+ DelayScheduledMetadata$inboundSchema,
19
+ DelayScheduledMetadata$Outbound,
20
+ DelayScheduledMetadata$outboundSchema,
21
+ } from "./delayscheduledmetadata.js";
22
+ import {
23
+ DigestRegularMetadata,
24
+ DigestRegularMetadata$inboundSchema,
25
+ DigestRegularMetadata$Outbound,
26
+ DigestRegularMetadata$outboundSchema,
27
+ } from "./digestregularmetadata.js";
28
+ import {
29
+ DigestTimedMetadata,
30
+ DigestTimedMetadata$inboundSchema,
31
+ DigestTimedMetadata$Outbound,
32
+ DigestTimedMetadata$outboundSchema,
33
+ } from "./digesttimedmetadata.js";
34
+ import {
35
+ MessageTemplate,
36
+ MessageTemplate$inboundSchema,
37
+ MessageTemplate$Outbound,
38
+ MessageTemplate$outboundSchema,
39
+ } from "./messagetemplate.js";
40
+ import {
41
+ NotificationStepData,
42
+ NotificationStepData$inboundSchema,
43
+ NotificationStepData$Outbound,
44
+ NotificationStepData$outboundSchema,
45
+ } from "./notificationstepdata.js";
46
+ import {
47
+ ReplyCallback,
48
+ ReplyCallback$inboundSchema,
49
+ ReplyCallback$Outbound,
50
+ ReplyCallback$outboundSchema,
51
+ } from "./replycallback.js";
52
+ import {
53
+ StepFilterDto,
54
+ StepFilterDto$inboundSchema,
55
+ StepFilterDto$Outbound,
56
+ StepFilterDto$outboundSchema,
57
+ } from "./stepfilterdto.js";
58
+
59
+ /**
60
+ * Metadata associated with the workflow step. Can vary based on the type of step.
61
+ */
62
+ export type NotificationStepDtoMetadata =
63
+ | DelayScheduledMetadata
64
+ | DelayRegularMetadata
65
+ | DigestTimedMetadata
66
+ | DigestRegularMetadata;
67
+
68
+ export type NotificationStepDto = {
69
+ /**
70
+ * Unique identifier for the notification step.
71
+ */
72
+ id?: string | undefined;
73
+ /**
74
+ * Universally unique identifier for the notification step.
75
+ */
76
+ uuid?: string | undefined;
77
+ /**
78
+ * Name of the notification step.
79
+ */
80
+ name?: string | undefined;
81
+ /**
82
+ * ID of the template associated with this notification step.
83
+ */
84
+ templateId?: string | undefined;
85
+ /**
86
+ * Indicates whether the notification step is active.
87
+ */
88
+ active?: boolean | undefined;
89
+ /**
90
+ * Determines if the process should stop on failure.
91
+ */
92
+ shouldStopOnFail?: boolean | undefined;
93
+ /**
94
+ * Message template used in this notification step.
95
+ */
96
+ template?: MessageTemplate | undefined;
97
+ /**
98
+ * Filters applied to this notification step.
99
+ */
100
+ filters?: Array<StepFilterDto> | undefined;
101
+ /**
102
+ * ID of the parent notification step, if applicable.
103
+ */
104
+ parentId?: string | undefined;
105
+ /**
106
+ * Metadata associated with the workflow step. Can vary based on the type of step.
107
+ */
108
+ metadata?:
109
+ | DelayScheduledMetadata
110
+ | DelayRegularMetadata
111
+ | DigestTimedMetadata
112
+ | DigestRegularMetadata
113
+ | undefined;
114
+ /**
115
+ * Callback information for replies, including whether it is active and the callback URL.
116
+ */
117
+ replyCallback?: ReplyCallback | undefined;
118
+ variants?: Array<NotificationStepData> | undefined;
119
+ };
120
+
121
+ /** @internal */
122
+ export const NotificationStepDtoMetadata$inboundSchema: z.ZodType<
123
+ NotificationStepDtoMetadata,
124
+ z.ZodTypeDef,
125
+ unknown
126
+ > = z.union([
127
+ DelayScheduledMetadata$inboundSchema,
128
+ DelayRegularMetadata$inboundSchema,
129
+ DigestTimedMetadata$inboundSchema,
130
+ DigestRegularMetadata$inboundSchema,
131
+ ]);
132
+
133
+ /** @internal */
134
+ export type NotificationStepDtoMetadata$Outbound =
135
+ | DelayScheduledMetadata$Outbound
136
+ | DelayRegularMetadata$Outbound
137
+ | DigestTimedMetadata$Outbound
138
+ | DigestRegularMetadata$Outbound;
139
+
140
+ /** @internal */
141
+ export const NotificationStepDtoMetadata$outboundSchema: z.ZodType<
142
+ NotificationStepDtoMetadata$Outbound,
143
+ z.ZodTypeDef,
144
+ NotificationStepDtoMetadata
145
+ > = z.union([
146
+ DelayScheduledMetadata$outboundSchema,
147
+ DelayRegularMetadata$outboundSchema,
148
+ DigestTimedMetadata$outboundSchema,
149
+ DigestRegularMetadata$outboundSchema,
150
+ ]);
151
+
152
+ /**
153
+ * @internal
154
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
155
+ */
156
+ export namespace NotificationStepDtoMetadata$ {
157
+ /** @deprecated use `NotificationStepDtoMetadata$inboundSchema` instead. */
158
+ export const inboundSchema = NotificationStepDtoMetadata$inboundSchema;
159
+ /** @deprecated use `NotificationStepDtoMetadata$outboundSchema` instead. */
160
+ export const outboundSchema = NotificationStepDtoMetadata$outboundSchema;
161
+ /** @deprecated use `NotificationStepDtoMetadata$Outbound` instead. */
162
+ export type Outbound = NotificationStepDtoMetadata$Outbound;
163
+ }
164
+
165
+ export function notificationStepDtoMetadataToJSON(
166
+ notificationStepDtoMetadata: NotificationStepDtoMetadata,
167
+ ): string {
168
+ return JSON.stringify(
169
+ NotificationStepDtoMetadata$outboundSchema.parse(
170
+ notificationStepDtoMetadata,
171
+ ),
172
+ );
173
+ }
174
+
175
+ export function notificationStepDtoMetadataFromJSON(
176
+ jsonString: string,
177
+ ): SafeParseResult<NotificationStepDtoMetadata, SDKValidationError> {
178
+ return safeParse(
179
+ jsonString,
180
+ (x) => NotificationStepDtoMetadata$inboundSchema.parse(JSON.parse(x)),
181
+ `Failed to parse 'NotificationStepDtoMetadata' from JSON`,
182
+ );
183
+ }
184
+
185
+ /** @internal */
186
+ export const NotificationStepDto$inboundSchema: z.ZodType<
187
+ NotificationStepDto,
188
+ z.ZodTypeDef,
189
+ unknown
190
+ > = z.object({
191
+ _id: z.string().optional(),
192
+ uuid: z.string().optional(),
193
+ name: z.string().optional(),
194
+ _templateId: z.string().optional(),
195
+ active: z.boolean().optional(),
196
+ shouldStopOnFail: z.boolean().optional(),
197
+ template: MessageTemplate$inboundSchema.optional(),
198
+ filters: z.array(StepFilterDto$inboundSchema).optional(),
199
+ _parentId: z.string().optional(),
200
+ metadata: z.union([
201
+ DelayScheduledMetadata$inboundSchema,
202
+ DelayRegularMetadata$inboundSchema,
203
+ DigestTimedMetadata$inboundSchema,
204
+ DigestRegularMetadata$inboundSchema,
205
+ ]).optional(),
206
+ replyCallback: ReplyCallback$inboundSchema.optional(),
207
+ variants: z.array(NotificationStepData$inboundSchema).optional(),
208
+ }).transform((v) => {
209
+ return remap$(v, {
210
+ "_id": "id",
211
+ "_templateId": "templateId",
212
+ "_parentId": "parentId",
213
+ });
214
+ });
215
+
216
+ /** @internal */
217
+ export type NotificationStepDto$Outbound = {
218
+ _id?: string | undefined;
219
+ uuid?: string | undefined;
220
+ name?: string | undefined;
221
+ _templateId?: string | undefined;
222
+ active?: boolean | undefined;
223
+ shouldStopOnFail?: boolean | undefined;
224
+ template?: MessageTemplate$Outbound | undefined;
225
+ filters?: Array<StepFilterDto$Outbound> | undefined;
226
+ _parentId?: string | undefined;
227
+ metadata?:
228
+ | DelayScheduledMetadata$Outbound
229
+ | DelayRegularMetadata$Outbound
230
+ | DigestTimedMetadata$Outbound
231
+ | DigestRegularMetadata$Outbound
232
+ | undefined;
233
+ replyCallback?: ReplyCallback$Outbound | undefined;
234
+ variants?: Array<NotificationStepData$Outbound> | undefined;
235
+ };
236
+
237
+ /** @internal */
238
+ export const NotificationStepDto$outboundSchema: z.ZodType<
239
+ NotificationStepDto$Outbound,
240
+ z.ZodTypeDef,
241
+ NotificationStepDto
242
+ > = z.object({
243
+ id: z.string().optional(),
244
+ uuid: z.string().optional(),
245
+ name: z.string().optional(),
246
+ templateId: z.string().optional(),
247
+ active: z.boolean().optional(),
248
+ shouldStopOnFail: z.boolean().optional(),
249
+ template: MessageTemplate$outboundSchema.optional(),
250
+ filters: z.array(StepFilterDto$outboundSchema).optional(),
251
+ parentId: z.string().optional(),
252
+ metadata: z.union([
253
+ DelayScheduledMetadata$outboundSchema,
254
+ DelayRegularMetadata$outboundSchema,
255
+ DigestTimedMetadata$outboundSchema,
256
+ DigestRegularMetadata$outboundSchema,
257
+ ]).optional(),
258
+ replyCallback: ReplyCallback$outboundSchema.optional(),
259
+ variants: z.array(NotificationStepData$outboundSchema).optional(),
260
+ }).transform((v) => {
261
+ return remap$(v, {
262
+ id: "_id",
263
+ templateId: "_templateId",
264
+ parentId: "_parentId",
265
+ });
266
+ });
267
+
268
+ /**
269
+ * @internal
270
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
271
+ */
272
+ export namespace NotificationStepDto$ {
273
+ /** @deprecated use `NotificationStepDto$inboundSchema` instead. */
274
+ export const inboundSchema = NotificationStepDto$inboundSchema;
275
+ /** @deprecated use `NotificationStepDto$outboundSchema` instead. */
276
+ export const outboundSchema = NotificationStepDto$outboundSchema;
277
+ /** @deprecated use `NotificationStepDto$Outbound` instead. */
278
+ export type Outbound = NotificationStepDto$Outbound;
279
+ }
280
+
281
+ export function notificationStepDtoToJSON(
282
+ notificationStepDto: NotificationStepDto,
283
+ ): string {
284
+ return JSON.stringify(
285
+ NotificationStepDto$outboundSchema.parse(notificationStepDto),
286
+ );
287
+ }
288
+
289
+ export function notificationStepDtoFromJSON(
290
+ jsonString: string,
291
+ ): SafeParseResult<NotificationStepDto, SDKValidationError> {
292
+ return safeParse(
293
+ jsonString,
294
+ (x) => NotificationStepDto$inboundSchema.parse(JSON.parse(x)),
295
+ `Failed to parse 'NotificationStepDto' from JSON`,
296
+ );
297
+ }
@@ -14,54 +14,39 @@ import {
14
14
  NotificationTriggerVariable$outboundSchema,
15
15
  } from "./notificationtriggervariable.js";
16
16
 
17
- /**
18
- * Type of the trigger
19
- */
20
- export const Type = {
17
+ export const NotificationTriggerType = {
21
18
  Event: "event",
22
19
  } as const;
23
- /**
24
- * Type of the trigger
25
- */
26
- export type Type = ClosedEnum<typeof Type>;
20
+ export type NotificationTriggerType = ClosedEnum<
21
+ typeof NotificationTriggerType
22
+ >;
27
23
 
28
24
  export type NotificationTrigger = {
29
- /**
30
- * Type of the trigger
31
- */
32
- type: Type;
33
- /**
34
- * Identifier of the trigger
35
- */
25
+ type: NotificationTriggerType;
36
26
  identifier: string;
37
- /**
38
- * Variables of the trigger
39
- */
40
27
  variables: Array<NotificationTriggerVariable>;
41
- /**
42
- * Subscriber variables of the trigger
43
- */
44
28
  subscriberVariables?: Array<NotificationTriggerVariable> | undefined;
45
29
  };
46
30
 
47
31
  /** @internal */
48
- export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
49
- Type,
50
- );
32
+ export const NotificationTriggerType$inboundSchema: z.ZodNativeEnum<
33
+ typeof NotificationTriggerType
34
+ > = z.nativeEnum(NotificationTriggerType);
51
35
 
52
36
  /** @internal */
53
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
54
- Type$inboundSchema;
37
+ export const NotificationTriggerType$outboundSchema: z.ZodNativeEnum<
38
+ typeof NotificationTriggerType
39
+ > = NotificationTriggerType$inboundSchema;
55
40
 
56
41
  /**
57
42
  * @internal
58
43
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
59
44
  */
60
- export namespace Type$ {
61
- /** @deprecated use `Type$inboundSchema` instead. */
62
- export const inboundSchema = Type$inboundSchema;
63
- /** @deprecated use `Type$outboundSchema` instead. */
64
- export const outboundSchema = Type$outboundSchema;
45
+ export namespace NotificationTriggerType$ {
46
+ /** @deprecated use `NotificationTriggerType$inboundSchema` instead. */
47
+ export const inboundSchema = NotificationTriggerType$inboundSchema;
48
+ /** @deprecated use `NotificationTriggerType$outboundSchema` instead. */
49
+ export const outboundSchema = NotificationTriggerType$outboundSchema;
65
50
  }
66
51
 
67
52
  /** @internal */
@@ -70,7 +55,7 @@ export const NotificationTrigger$inboundSchema: z.ZodType<
70
55
  z.ZodTypeDef,
71
56
  unknown
72
57
  > = z.object({
73
- type: Type$inboundSchema,
58
+ type: NotificationTriggerType$inboundSchema,
74
59
  identifier: z.string(),
75
60
  variables: z.array(NotificationTriggerVariable$inboundSchema),
76
61
  subscriberVariables: z.array(NotificationTriggerVariable$inboundSchema)
@@ -91,7 +76,7 @@ export const NotificationTrigger$outboundSchema: z.ZodType<
91
76
  z.ZodTypeDef,
92
77
  NotificationTrigger
93
78
  > = z.object({
94
- type: Type$outboundSchema,
79
+ type: NotificationTriggerType$outboundSchema,
95
80
  identifier: z.string(),
96
81
  variables: z.array(NotificationTriggerVariable$outboundSchema),
97
82
  subscriberVariables: z.array(NotificationTriggerVariable$outboundSchema)