@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
@@ -1,127 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { ClosedEnum } from "../../types/enums.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- /**
12
- * Unit of the digest
13
- */
14
- export const Unit = {
15
- Seconds: "seconds",
16
- Minutes: "minutes",
17
- Hours: "hours",
18
- Days: "days",
19
- Weeks: "weeks",
20
- Months: "months",
21
- } as const;
22
- /**
23
- * Unit of the digest
24
- */
25
- export type Unit = ClosedEnum<typeof Unit>;
26
-
27
- export type DigestWithEventsDto = {
28
- /**
29
- * Optional key for the digest
30
- */
31
- digestKey?: string | undefined;
32
- /**
33
- * Amount for the digest
34
- */
35
- amount?: number | undefined;
36
- /**
37
- * Unit of the digest
38
- */
39
- unit?: Unit | undefined;
40
- /**
41
- * Optional array of events associated with the digest, represented as key-value pairs
42
- */
43
- events?: Array<{ [k: string]: any }> | undefined;
44
- };
45
-
46
- /** @internal */
47
- export const Unit$inboundSchema: z.ZodNativeEnum<typeof Unit> = z.nativeEnum(
48
- Unit,
49
- );
50
-
51
- /** @internal */
52
- export const Unit$outboundSchema: z.ZodNativeEnum<typeof Unit> =
53
- Unit$inboundSchema;
54
-
55
- /**
56
- * @internal
57
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
58
- */
59
- export namespace Unit$ {
60
- /** @deprecated use `Unit$inboundSchema` instead. */
61
- export const inboundSchema = Unit$inboundSchema;
62
- /** @deprecated use `Unit$outboundSchema` instead. */
63
- export const outboundSchema = Unit$outboundSchema;
64
- }
65
-
66
- /** @internal */
67
- export const DigestWithEventsDto$inboundSchema: z.ZodType<
68
- DigestWithEventsDto,
69
- z.ZodTypeDef,
70
- unknown
71
- > = z.object({
72
- digestKey: z.string().optional(),
73
- amount: z.number().optional(),
74
- unit: Unit$inboundSchema.optional(),
75
- events: z.array(z.record(z.any())).optional(),
76
- });
77
-
78
- /** @internal */
79
- export type DigestWithEventsDto$Outbound = {
80
- digestKey?: string | undefined;
81
- amount?: number | undefined;
82
- unit?: string | undefined;
83
- events?: Array<{ [k: string]: any }> | undefined;
84
- };
85
-
86
- /** @internal */
87
- export const DigestWithEventsDto$outboundSchema: z.ZodType<
88
- DigestWithEventsDto$Outbound,
89
- z.ZodTypeDef,
90
- DigestWithEventsDto
91
- > = z.object({
92
- digestKey: z.string().optional(),
93
- amount: z.number().optional(),
94
- unit: Unit$outboundSchema.optional(),
95
- events: z.array(z.record(z.any())).optional(),
96
- });
97
-
98
- /**
99
- * @internal
100
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
- */
102
- export namespace DigestWithEventsDto$ {
103
- /** @deprecated use `DigestWithEventsDto$inboundSchema` instead. */
104
- export const inboundSchema = DigestWithEventsDto$inboundSchema;
105
- /** @deprecated use `DigestWithEventsDto$outboundSchema` instead. */
106
- export const outboundSchema = DigestWithEventsDto$outboundSchema;
107
- /** @deprecated use `DigestWithEventsDto$Outbound` instead. */
108
- export type Outbound = DigestWithEventsDto$Outbound;
109
- }
110
-
111
- export function digestWithEventsDtoToJSON(
112
- digestWithEventsDto: DigestWithEventsDto,
113
- ): string {
114
- return JSON.stringify(
115
- DigestWithEventsDto$outboundSchema.parse(digestWithEventsDto),
116
- );
117
- }
118
-
119
- export function digestWithEventsDtoFromJSON(
120
- jsonString: string,
121
- ): SafeParseResult<DigestWithEventsDto, SDKValidationError> {
122
- return safeParse(
123
- jsonString,
124
- (x) => DigestWithEventsDto$inboundSchema.parse(JSON.parse(x)),
125
- `Failed to parse 'DigestWithEventsDto' from JSON`,
126
- );
127
- }
@@ -1,341 +0,0 @@
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
- NotificationStepVariant,
42
- NotificationStepVariant$inboundSchema,
43
- NotificationStepVariant$Outbound,
44
- NotificationStepVariant$outboundSchema,
45
- } from "./notificationstepvariant.js";
46
- import {
47
- StepFilterDto,
48
- StepFilterDto$inboundSchema,
49
- StepFilterDto$Outbound,
50
- StepFilterDto$outboundSchema,
51
- } from "./stepfilterdto.js";
52
-
53
- export type ParentId = {};
54
-
55
- export type Metadata =
56
- | DelayScheduledMetadata
57
- | DelayRegularMetadata
58
- | DigestTimedMetadata
59
- | DigestRegularMetadata;
60
-
61
- export type ReplyCallback = {};
62
-
63
- export type NotificationStep = {
64
- id?: string | undefined;
65
- uuid?: string | undefined;
66
- name?: string | undefined;
67
- templateId?: string | undefined;
68
- active?: boolean | undefined;
69
- shouldStopOnFail?: boolean | undefined;
70
- template?: MessageTemplate | undefined;
71
- filters?: Array<StepFilterDto> | undefined;
72
- parentId?: ParentId | undefined;
73
- metadata?:
74
- | DelayScheduledMetadata
75
- | DelayRegularMetadata
76
- | DigestTimedMetadata
77
- | DigestRegularMetadata
78
- | undefined;
79
- replyCallback?: ReplyCallback | undefined;
80
- variants?: NotificationStepVariant | undefined;
81
- };
82
-
83
- /** @internal */
84
- export const ParentId$inboundSchema: z.ZodType<
85
- ParentId,
86
- z.ZodTypeDef,
87
- unknown
88
- > = z.object({});
89
-
90
- /** @internal */
91
- export type ParentId$Outbound = {};
92
-
93
- /** @internal */
94
- export const ParentId$outboundSchema: z.ZodType<
95
- ParentId$Outbound,
96
- z.ZodTypeDef,
97
- ParentId
98
- > = z.object({});
99
-
100
- /**
101
- * @internal
102
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
103
- */
104
- export namespace ParentId$ {
105
- /** @deprecated use `ParentId$inboundSchema` instead. */
106
- export const inboundSchema = ParentId$inboundSchema;
107
- /** @deprecated use `ParentId$outboundSchema` instead. */
108
- export const outboundSchema = ParentId$outboundSchema;
109
- /** @deprecated use `ParentId$Outbound` instead. */
110
- export type Outbound = ParentId$Outbound;
111
- }
112
-
113
- export function parentIdToJSON(parentId: ParentId): string {
114
- return JSON.stringify(ParentId$outboundSchema.parse(parentId));
115
- }
116
-
117
- export function parentIdFromJSON(
118
- jsonString: string,
119
- ): SafeParseResult<ParentId, SDKValidationError> {
120
- return safeParse(
121
- jsonString,
122
- (x) => ParentId$inboundSchema.parse(JSON.parse(x)),
123
- `Failed to parse 'ParentId' from JSON`,
124
- );
125
- }
126
-
127
- /** @internal */
128
- export const Metadata$inboundSchema: z.ZodType<
129
- Metadata,
130
- z.ZodTypeDef,
131
- unknown
132
- > = z.union([
133
- DelayScheduledMetadata$inboundSchema,
134
- DelayRegularMetadata$inboundSchema,
135
- DigestTimedMetadata$inboundSchema,
136
- DigestRegularMetadata$inboundSchema,
137
- ]);
138
-
139
- /** @internal */
140
- export type Metadata$Outbound =
141
- | DelayScheduledMetadata$Outbound
142
- | DelayRegularMetadata$Outbound
143
- | DigestTimedMetadata$Outbound
144
- | DigestRegularMetadata$Outbound;
145
-
146
- /** @internal */
147
- export const Metadata$outboundSchema: z.ZodType<
148
- Metadata$Outbound,
149
- z.ZodTypeDef,
150
- Metadata
151
- > = z.union([
152
- DelayScheduledMetadata$outboundSchema,
153
- DelayRegularMetadata$outboundSchema,
154
- DigestTimedMetadata$outboundSchema,
155
- DigestRegularMetadata$outboundSchema,
156
- ]);
157
-
158
- /**
159
- * @internal
160
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
161
- */
162
- export namespace Metadata$ {
163
- /** @deprecated use `Metadata$inboundSchema` instead. */
164
- export const inboundSchema = Metadata$inboundSchema;
165
- /** @deprecated use `Metadata$outboundSchema` instead. */
166
- export const outboundSchema = Metadata$outboundSchema;
167
- /** @deprecated use `Metadata$Outbound` instead. */
168
- export type Outbound = Metadata$Outbound;
169
- }
170
-
171
- export function metadataToJSON(metadata: Metadata): string {
172
- return JSON.stringify(Metadata$outboundSchema.parse(metadata));
173
- }
174
-
175
- export function metadataFromJSON(
176
- jsonString: string,
177
- ): SafeParseResult<Metadata, SDKValidationError> {
178
- return safeParse(
179
- jsonString,
180
- (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
181
- `Failed to parse 'Metadata' from JSON`,
182
- );
183
- }
184
-
185
- /** @internal */
186
- export const ReplyCallback$inboundSchema: z.ZodType<
187
- ReplyCallback,
188
- z.ZodTypeDef,
189
- unknown
190
- > = z.object({});
191
-
192
- /** @internal */
193
- export type ReplyCallback$Outbound = {};
194
-
195
- /** @internal */
196
- export const ReplyCallback$outboundSchema: z.ZodType<
197
- ReplyCallback$Outbound,
198
- z.ZodTypeDef,
199
- ReplyCallback
200
- > = z.object({});
201
-
202
- /**
203
- * @internal
204
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
205
- */
206
- export namespace ReplyCallback$ {
207
- /** @deprecated use `ReplyCallback$inboundSchema` instead. */
208
- export const inboundSchema = ReplyCallback$inboundSchema;
209
- /** @deprecated use `ReplyCallback$outboundSchema` instead. */
210
- export const outboundSchema = ReplyCallback$outboundSchema;
211
- /** @deprecated use `ReplyCallback$Outbound` instead. */
212
- export type Outbound = ReplyCallback$Outbound;
213
- }
214
-
215
- export function replyCallbackToJSON(replyCallback: ReplyCallback): string {
216
- return JSON.stringify(ReplyCallback$outboundSchema.parse(replyCallback));
217
- }
218
-
219
- export function replyCallbackFromJSON(
220
- jsonString: string,
221
- ): SafeParseResult<ReplyCallback, SDKValidationError> {
222
- return safeParse(
223
- jsonString,
224
- (x) => ReplyCallback$inboundSchema.parse(JSON.parse(x)),
225
- `Failed to parse 'ReplyCallback' from JSON`,
226
- );
227
- }
228
-
229
- /** @internal */
230
- export const NotificationStep$inboundSchema: z.ZodType<
231
- NotificationStep,
232
- z.ZodTypeDef,
233
- unknown
234
- > = z.object({
235
- _id: z.string().optional(),
236
- uuid: z.string().optional(),
237
- name: z.string().optional(),
238
- _templateId: z.string().optional(),
239
- active: z.boolean().optional(),
240
- shouldStopOnFail: z.boolean().optional(),
241
- template: MessageTemplate$inboundSchema.optional(),
242
- filters: z.array(StepFilterDto$inboundSchema).optional(),
243
- _parentId: z.lazy(() => ParentId$inboundSchema).optional(),
244
- metadata: z.union([
245
- DelayScheduledMetadata$inboundSchema,
246
- DelayRegularMetadata$inboundSchema,
247
- DigestTimedMetadata$inboundSchema,
248
- DigestRegularMetadata$inboundSchema,
249
- ]).optional(),
250
- replyCallback: z.lazy(() => ReplyCallback$inboundSchema).optional(),
251
- variants: NotificationStepVariant$inboundSchema.optional(),
252
- }).transform((v) => {
253
- return remap$(v, {
254
- "_id": "id",
255
- "_templateId": "templateId",
256
- "_parentId": "parentId",
257
- });
258
- });
259
-
260
- /** @internal */
261
- export type NotificationStep$Outbound = {
262
- _id?: string | undefined;
263
- uuid?: string | undefined;
264
- name?: string | undefined;
265
- _templateId?: string | undefined;
266
- active?: boolean | undefined;
267
- shouldStopOnFail?: boolean | undefined;
268
- template?: MessageTemplate$Outbound | undefined;
269
- filters?: Array<StepFilterDto$Outbound> | undefined;
270
- _parentId?: ParentId$Outbound | undefined;
271
- metadata?:
272
- | DelayScheduledMetadata$Outbound
273
- | DelayRegularMetadata$Outbound
274
- | DigestTimedMetadata$Outbound
275
- | DigestRegularMetadata$Outbound
276
- | undefined;
277
- replyCallback?: ReplyCallback$Outbound | undefined;
278
- variants?: NotificationStepVariant$Outbound | undefined;
279
- };
280
-
281
- /** @internal */
282
- export const NotificationStep$outboundSchema: z.ZodType<
283
- NotificationStep$Outbound,
284
- z.ZodTypeDef,
285
- NotificationStep
286
- > = z.object({
287
- id: z.string().optional(),
288
- uuid: z.string().optional(),
289
- name: z.string().optional(),
290
- templateId: z.string().optional(),
291
- active: z.boolean().optional(),
292
- shouldStopOnFail: z.boolean().optional(),
293
- template: MessageTemplate$outboundSchema.optional(),
294
- filters: z.array(StepFilterDto$outboundSchema).optional(),
295
- parentId: z.lazy(() => ParentId$outboundSchema).optional(),
296
- metadata: z.union([
297
- DelayScheduledMetadata$outboundSchema,
298
- DelayRegularMetadata$outboundSchema,
299
- DigestTimedMetadata$outboundSchema,
300
- DigestRegularMetadata$outboundSchema,
301
- ]).optional(),
302
- replyCallback: z.lazy(() => ReplyCallback$outboundSchema).optional(),
303
- variants: NotificationStepVariant$outboundSchema.optional(),
304
- }).transform((v) => {
305
- return remap$(v, {
306
- id: "_id",
307
- templateId: "_templateId",
308
- parentId: "_parentId",
309
- });
310
- });
311
-
312
- /**
313
- * @internal
314
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
315
- */
316
- export namespace NotificationStep$ {
317
- /** @deprecated use `NotificationStep$inboundSchema` instead. */
318
- export const inboundSchema = NotificationStep$inboundSchema;
319
- /** @deprecated use `NotificationStep$outboundSchema` instead. */
320
- export const outboundSchema = NotificationStep$outboundSchema;
321
- /** @deprecated use `NotificationStep$Outbound` instead. */
322
- export type Outbound = NotificationStep$Outbound;
323
- }
324
-
325
- export function notificationStepToJSON(
326
- notificationStep: NotificationStep,
327
- ): string {
328
- return JSON.stringify(
329
- NotificationStep$outboundSchema.parse(notificationStep),
330
- );
331
- }
332
-
333
- export function notificationStepFromJSON(
334
- jsonString: string,
335
- ): SafeParseResult<NotificationStep, SDKValidationError> {
336
- return safeParse(
337
- jsonString,
338
- (x) => NotificationStep$inboundSchema.parse(JSON.parse(x)),
339
- `Failed to parse 'NotificationStep' from JSON`,
340
- );
341
- }