@novu/api 1.6.1-rc.0 → 1.7.0

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 (266) hide show
  1. package/README.md +14 -17
  2. package/bin/mcp-server.js +389 -236
  3. package/bin/mcp-server.js.map +62 -58
  4. package/docs/sdks/groups/README.md +23 -23
  5. package/docs/sdks/master/README.md +4 -4
  6. package/docs/sdks/preferences/README.md +136 -2
  7. package/docs/sdks/translations/README.md +11 -11
  8. package/examples/package-lock.json +1 -1
  9. package/funcs/translationsCreate.d.ts +2 -2
  10. package/funcs/translationsCreate.js +2 -2
  11. package/funcs/translationsDelete.d.ts +1 -1
  12. package/funcs/translationsDelete.js +1 -1
  13. package/funcs/translationsGroupsDelete.d.ts +1 -1
  14. package/funcs/translationsGroupsDelete.js +1 -1
  15. package/funcs/translationsGroupsRetrieve.d.ts +2 -2
  16. package/funcs/translationsGroupsRetrieve.js +2 -2
  17. package/funcs/translationsMasterImport.d.ts +1 -1
  18. package/funcs/translationsMasterImport.js +1 -1
  19. package/funcs/translationsMasterRetrieve.d.ts +2 -2
  20. package/funcs/translationsMasterRetrieve.js +2 -2
  21. package/funcs/translationsMasterUpload.d.ts +1 -1
  22. package/funcs/translationsMasterUpload.js +1 -1
  23. package/funcs/translationsRetrieve.d.ts +2 -2
  24. package/funcs/translationsRetrieve.js +2 -2
  25. package/funcs/translationsUpload.d.ts +1 -1
  26. package/funcs/translationsUpload.js +1 -1
  27. package/jsr.json +1 -1
  28. package/lib/config.d.ts +3 -3
  29. package/lib/config.js +3 -3
  30. package/lib/config.js.map +1 -1
  31. package/lib/url.js +1 -1
  32. package/lib/url.js.map +1 -1
  33. package/mcp-server/mcp-server.js +1 -1
  34. package/mcp-server/mcp-server.js.map +1 -1
  35. package/mcp-server/server.js +1 -1
  36. package/mcp-server/server.js.map +1 -1
  37. package/mcp-server/tools/translationsCreate.js +2 -2
  38. package/mcp-server/tools/translationsCreate.js.map +1 -1
  39. package/mcp-server/tools/translationsDelete.js +1 -1
  40. package/mcp-server/tools/translationsGroupsDelete.js +1 -1
  41. package/mcp-server/tools/translationsGroupsRetrieve.js +2 -2
  42. package/mcp-server/tools/translationsGroupsRetrieve.js.map +1 -1
  43. package/mcp-server/tools/translationsMasterImport.js +1 -1
  44. package/mcp-server/tools/translationsMasterImport.js.map +1 -1
  45. package/mcp-server/tools/translationsMasterRetrieve.js +2 -2
  46. package/mcp-server/tools/translationsMasterRetrieve.js.map +1 -1
  47. package/mcp-server/tools/translationsMasterUpload.js +1 -1
  48. package/mcp-server/tools/translationsMasterUpload.js.map +1 -1
  49. package/mcp-server/tools/translationsRetrieve.js +2 -2
  50. package/mcp-server/tools/translationsRetrieve.js.map +1 -1
  51. package/mcp-server/tools/translationsUpload.js +1 -1
  52. package/models/components/activitynotificationjobresponsedto.d.ts +8 -0
  53. package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
  54. package/models/components/activitynotificationjobresponsedto.js +3 -0
  55. package/models/components/activitynotificationjobresponsedto.js.map +1 -1
  56. package/models/components/activitynotificationresponsedto.d.ts +23 -78
  57. package/models/components/activitynotificationresponsedto.d.ts.map +1 -1
  58. package/models/components/activitynotificationresponsedto.js +9 -78
  59. package/models/components/activitynotificationresponsedto.js.map +1 -1
  60. package/models/components/chatstepresponsedto.d.ts +2 -26
  61. package/models/components/chatstepresponsedto.d.ts.map +1 -1
  62. package/models/components/chatstepresponsedto.js +3 -26
  63. package/models/components/chatstepresponsedto.js.map +1 -1
  64. package/models/components/constraintvalidation.d.ts +4 -4
  65. package/models/components/constraintvalidation.d.ts.map +1 -1
  66. package/models/components/constraintvalidation.js +4 -4
  67. package/models/components/constraintvalidation.js.map +1 -1
  68. package/models/components/createworkflowdto.d.ts +9 -0
  69. package/models/components/createworkflowdto.d.ts.map +1 -1
  70. package/models/components/createworkflowdto.js +13 -0
  71. package/models/components/createworkflowdto.js.map +1 -1
  72. package/models/components/customstepresponsedto.d.ts +2 -26
  73. package/models/components/customstepresponsedto.d.ts.map +1 -1
  74. package/models/components/customstepresponsedto.js +3 -26
  75. package/models/components/customstepresponsedto.js.map +1 -1
  76. package/models/components/delaystepresponsedto.d.ts +2 -26
  77. package/models/components/delaystepresponsedto.d.ts.map +1 -1
  78. package/models/components/delaystepresponsedto.js +3 -26
  79. package/models/components/delaystepresponsedto.js.map +1 -1
  80. package/models/components/digeststepresponsedto.d.ts +2 -26
  81. package/models/components/digeststepresponsedto.d.ts.map +1 -1
  82. package/models/components/digeststepresponsedto.js +3 -26
  83. package/models/components/digeststepresponsedto.js.map +1 -1
  84. package/models/components/emailstepresponsedto.d.ts +2 -26
  85. package/models/components/emailstepresponsedto.d.ts.map +1 -1
  86. package/models/components/emailstepresponsedto.js +3 -26
  87. package/models/components/emailstepresponsedto.js.map +1 -1
  88. package/models/components/inappstepresponsedto.d.ts +2 -26
  89. package/models/components/inappstepresponsedto.d.ts.map +1 -1
  90. package/models/components/inappstepresponsedto.js +3 -26
  91. package/models/components/inappstepresponsedto.js.map +1 -1
  92. package/models/components/index.d.ts +4 -0
  93. package/models/components/index.d.ts.map +1 -1
  94. package/models/components/index.js +4 -0
  95. package/models/components/index.js.map +1 -1
  96. package/models/components/layoutresponsedto.d.ts +4 -52
  97. package/models/components/layoutresponsedto.d.ts.map +1 -1
  98. package/models/components/layoutresponsedto.js +5 -52
  99. package/models/components/layoutresponsedto.js.map +1 -1
  100. package/models/components/listsubscribersresponsedto.d.ts +10 -0
  101. package/models/components/listsubscribersresponsedto.d.ts.map +1 -1
  102. package/models/components/listsubscribersresponsedto.js +4 -0
  103. package/models/components/listsubscribersresponsedto.js.map +1 -1
  104. package/models/components/listtopicsresponsedto.d.ts +10 -0
  105. package/models/components/listtopicsresponsedto.d.ts.map +1 -1
  106. package/models/components/listtopicsresponsedto.js +4 -0
  107. package/models/components/listtopicsresponsedto.js.map +1 -1
  108. package/models/components/listtopicsubscriptionsresponsedto.d.ts +10 -0
  109. package/models/components/listtopicsubscriptionsresponsedto.d.ts.map +1 -1
  110. package/models/components/listtopicsubscriptionsresponsedto.js +4 -0
  111. package/models/components/listtopicsubscriptionsresponsedto.js.map +1 -1
  112. package/models/components/patchsubscriberpreferencesdto.d.ts +8 -2
  113. package/models/components/patchsubscriberpreferencesdto.d.ts.map +1 -1
  114. package/models/components/patchsubscriberpreferencesdto.js +5 -2
  115. package/models/components/patchsubscriberpreferencesdto.js.map +1 -1
  116. package/models/components/payloadvalidationerrordto.d.ts +4 -4
  117. package/models/components/payloadvalidationerrordto.d.ts.map +1 -1
  118. package/models/components/payloadvalidationerrordto.js +4 -4
  119. package/models/components/payloadvalidationerrordto.js.map +1 -1
  120. package/models/components/pushstepresponsedto.d.ts +2 -26
  121. package/models/components/pushstepresponsedto.d.ts.map +1 -1
  122. package/models/components/pushstepresponsedto.js +3 -26
  123. package/models/components/pushstepresponsedto.js.map +1 -1
  124. package/models/components/smsstepresponsedto.d.ts +2 -26
  125. package/models/components/smsstepresponsedto.d.ts.map +1 -1
  126. package/models/components/smsstepresponsedto.js +3 -26
  127. package/models/components/smsstepresponsedto.js.map +1 -1
  128. package/models/components/steplistresponsedto.d.ts +2 -26
  129. package/models/components/steplistresponsedto.d.ts.map +1 -1
  130. package/models/components/steplistresponsedto.js +3 -26
  131. package/models/components/steplistresponsedto.js.map +1 -1
  132. package/models/components/stepresponsedto.d.ts +2 -26
  133. package/models/components/stepresponsedto.d.ts.map +1 -1
  134. package/models/components/stepresponsedto.js +3 -26
  135. package/models/components/stepresponsedto.js.map +1 -1
  136. package/models/components/steptypeenum.d.ts +3 -0
  137. package/models/components/steptypeenum.d.ts.map +1 -1
  138. package/models/components/steptypeenum.js +1 -0
  139. package/models/components/steptypeenum.js.map +1 -1
  140. package/models/components/throttlecontroldto.d.ts +132 -0
  141. package/models/components/throttlecontroldto.d.ts.map +1 -0
  142. package/models/components/throttlecontroldto.js +126 -0
  143. package/models/components/throttlecontroldto.js.map +1 -0
  144. package/models/components/throttlecontrolsmetadataresponsedto.d.ts +48 -0
  145. package/models/components/throttlecontrolsmetadataresponsedto.d.ts.map +1 -0
  146. package/models/components/throttlecontrolsmetadataresponsedto.js +75 -0
  147. package/models/components/throttlecontrolsmetadataresponsedto.js.map +1 -0
  148. package/models/components/throttlestepresponsedto.d.ts +230 -0
  149. package/models/components/throttlestepresponsedto.d.ts.map +1 -0
  150. package/models/components/throttlestepresponsedto.js +196 -0
  151. package/models/components/throttlestepresponsedto.js.map +1 -0
  152. package/models/components/throttlestepupsertdto.d.ts +81 -0
  153. package/models/components/throttlestepupsertdto.d.ts.map +1 -0
  154. package/models/components/throttlestepupsertdto.js +111 -0
  155. package/models/components/throttlestepupsertdto.js.map +1 -0
  156. package/models/components/triggereventrequestdto.d.ts +4 -4
  157. package/models/components/triggereventrequestdto.d.ts.map +1 -1
  158. package/models/components/triggereventrequestdto.js +4 -4
  159. package/models/components/triggereventrequestdto.js.map +1 -1
  160. package/models/components/triggereventtoallrequestdto.d.ts +4 -4
  161. package/models/components/triggereventtoallrequestdto.d.ts.map +1 -1
  162. package/models/components/triggereventtoallrequestdto.js +4 -4
  163. package/models/components/triggereventtoallrequestdto.js.map +1 -1
  164. package/models/components/uicomponentenum.d.ts +21 -0
  165. package/models/components/uicomponentenum.d.ts.map +1 -1
  166. package/models/components/uicomponentenum.js +7 -0
  167. package/models/components/uicomponentenum.js.map +1 -1
  168. package/models/components/uischemagroupenum.d.ts +3 -0
  169. package/models/components/uischemagroupenum.d.ts.map +1 -1
  170. package/models/components/uischemagroupenum.js +1 -0
  171. package/models/components/uischemagroupenum.js.map +1 -1
  172. package/models/components/workflowlistresponsedto.d.ts +4 -52
  173. package/models/components/workflowlistresponsedto.d.ts.map +1 -1
  174. package/models/components/workflowlistresponsedto.js +5 -51
  175. package/models/components/workflowlistresponsedto.js.map +1 -1
  176. package/models/components/workflowresponsedto.d.ts +15 -78
  177. package/models/components/workflowresponsedto.d.ts.map +1 -1
  178. package/models/components/workflowresponsedto.js +20 -78
  179. package/models/components/workflowresponsedto.js.map +1 -1
  180. package/models/errors/errordto.d.ts +4 -4
  181. package/models/errors/errordto.d.ts.map +1 -1
  182. package/models/errors/errordto.js +4 -4
  183. package/models/errors/errordto.js.map +1 -1
  184. package/models/errors/index.d.ts +1 -0
  185. package/models/errors/index.d.ts.map +1 -1
  186. package/models/errors/index.js +1 -0
  187. package/models/errors/index.js.map +1 -1
  188. package/models/errors/payloadvalidationexceptiondto.d.ts +4 -4
  189. package/models/errors/payloadvalidationexceptiondto.d.ts.map +1 -1
  190. package/models/errors/payloadvalidationexceptiondto.js +4 -4
  191. package/models/errors/payloadvalidationexceptiondto.js.map +1 -1
  192. package/models/errors/validationerrordto.d.ts +4 -4
  193. package/models/errors/validationerrordto.d.ts.map +1 -1
  194. package/models/errors/validationerrordto.js +4 -4
  195. package/models/errors/validationerrordto.js.map +1 -1
  196. package/models/operations/translationcontrolleruploadtranslationfiles.d.ts +1 -1
  197. package/package.json +1 -1
  198. package/sdk/groups.d.ts +3 -3
  199. package/sdk/groups.js +3 -3
  200. package/sdk/master.d.ts +4 -4
  201. package/sdk/master.js +4 -4
  202. package/sdk/translations.d.ts +6 -6
  203. package/sdk/translations.js +6 -6
  204. package/sources/json-development.json +335 -37
  205. package/src/funcs/translationsCreate.ts +2 -2
  206. package/src/funcs/translationsDelete.ts +1 -1
  207. package/src/funcs/translationsGroupsDelete.ts +1 -1
  208. package/src/funcs/translationsGroupsRetrieve.ts +2 -2
  209. package/src/funcs/translationsMasterImport.ts +1 -1
  210. package/src/funcs/translationsMasterRetrieve.ts +2 -2
  211. package/src/funcs/translationsMasterUpload.ts +1 -1
  212. package/src/funcs/translationsRetrieve.ts +2 -2
  213. package/src/funcs/translationsUpload.ts +1 -1
  214. package/src/lib/config.ts +3 -3
  215. package/src/lib/url.ts +1 -1
  216. package/src/mcp-server/mcp-server.ts +1 -1
  217. package/src/mcp-server/server.ts +1 -1
  218. package/src/mcp-server/tools/translationsCreate.ts +2 -2
  219. package/src/mcp-server/tools/translationsDelete.ts +1 -1
  220. package/src/mcp-server/tools/translationsGroupsDelete.ts +1 -1
  221. package/src/mcp-server/tools/translationsGroupsRetrieve.ts +2 -2
  222. package/src/mcp-server/tools/translationsMasterImport.ts +1 -1
  223. package/src/mcp-server/tools/translationsMasterRetrieve.ts +2 -2
  224. package/src/mcp-server/tools/translationsMasterUpload.ts +1 -1
  225. package/src/mcp-server/tools/translationsRetrieve.ts +2 -2
  226. package/src/mcp-server/tools/translationsUpload.ts +1 -1
  227. package/src/models/components/activitynotificationjobresponsedto.ts +8 -0
  228. package/src/models/components/activitynotificationresponsedto.ts +19 -178
  229. package/src/models/components/chatstepresponsedto.ts +4 -57
  230. package/src/models/components/constraintvalidation.ts +8 -8
  231. package/src/models/components/createworkflowdto.ts +30 -0
  232. package/src/models/components/customstepresponsedto.ts +4 -57
  233. package/src/models/components/delaystepresponsedto.ts +4 -57
  234. package/src/models/components/digeststepresponsedto.ts +4 -57
  235. package/src/models/components/emailstepresponsedto.ts +4 -57
  236. package/src/models/components/inappstepresponsedto.ts +4 -57
  237. package/src/models/components/index.ts +4 -0
  238. package/src/models/components/layoutresponsedto.ts +8 -100
  239. package/src/models/components/listsubscribersresponsedto.ts +14 -0
  240. package/src/models/components/listtopicsresponsedto.ts +14 -0
  241. package/src/models/components/listtopicsubscriptionsresponsedto.ts +14 -0
  242. package/src/models/components/patchsubscriberpreferencesdto.ts +17 -4
  243. package/src/models/components/payloadvalidationerrordto.ts +8 -8
  244. package/src/models/components/pushstepresponsedto.ts +4 -57
  245. package/src/models/components/smsstepresponsedto.ts +4 -57
  246. package/src/models/components/steplistresponsedto.ts +4 -57
  247. package/src/models/components/stepresponsedto.ts +4 -57
  248. package/src/models/components/steptypeenum.ts +1 -0
  249. package/src/models/components/throttlecontroldto.ts +179 -0
  250. package/src/models/components/throttlecontrolsmetadataresponsedto.ts +100 -0
  251. package/src/models/components/throttlestepresponsedto.ts +381 -0
  252. package/src/models/components/throttlestepupsertdto.ts +176 -0
  253. package/src/models/components/triggereventrequestdto.ts +8 -8
  254. package/src/models/components/triggereventtoallrequestdto.ts +9 -9
  255. package/src/models/components/uicomponentenum.ts +7 -0
  256. package/src/models/components/uischemagroupenum.ts +1 -0
  257. package/src/models/components/workflowlistresponsedto.ts +8 -141
  258. package/src/models/components/workflowresponsedto.ts +44 -194
  259. package/src/models/errors/errordto.ts +8 -8
  260. package/src/models/errors/index.ts +1 -0
  261. package/src/models/errors/payloadvalidationexceptiondto.ts +8 -8
  262. package/src/models/errors/validationerrordto.ts +8 -8
  263. package/src/models/operations/translationcontrolleruploadtranslationfiles.ts +1 -1
  264. package/src/sdk/groups.ts +3 -3
  265. package/src/sdk/master.ts +4 -4
  266. package/src/sdk/translations.ts +6 -6
@@ -0,0 +1,381 @@
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 {
8
+ collectExtraKeys as collectExtraKeys$,
9
+ safeParse,
10
+ } from "../../lib/schemas.js";
11
+ import { ClosedEnum } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+ import {
15
+ ResourceOriginEnum,
16
+ ResourceOriginEnum$inboundSchema,
17
+ ResourceOriginEnum$outboundSchema,
18
+ } from "./resourceoriginenum.js";
19
+ import {
20
+ StepIssuesDto,
21
+ StepIssuesDto$inboundSchema,
22
+ StepIssuesDto$Outbound,
23
+ StepIssuesDto$outboundSchema,
24
+ } from "./stepissuesdto.js";
25
+ import {
26
+ StepTypeEnum,
27
+ StepTypeEnum$inboundSchema,
28
+ StepTypeEnum$outboundSchema,
29
+ } from "./steptypeenum.js";
30
+ import {
31
+ ThrottleControlsMetadataResponseDto,
32
+ ThrottleControlsMetadataResponseDto$inboundSchema,
33
+ ThrottleControlsMetadataResponseDto$Outbound,
34
+ ThrottleControlsMetadataResponseDto$outboundSchema,
35
+ } from "./throttlecontrolsmetadataresponsedto.js";
36
+
37
+ /**
38
+ * The type of throttle window.
39
+ */
40
+ export const ThrottleStepResponseDtoType = {
41
+ Fixed: "fixed",
42
+ Dynamic: "dynamic",
43
+ } as const;
44
+ /**
45
+ * The type of throttle window.
46
+ */
47
+ export type ThrottleStepResponseDtoType = ClosedEnum<
48
+ typeof ThrottleStepResponseDtoType
49
+ >;
50
+
51
+ /**
52
+ * The unit of time for the throttle window (required for fixed type).
53
+ */
54
+ export const ThrottleStepResponseDtoUnit = {
55
+ Minutes: "minutes",
56
+ Hours: "hours",
57
+ Days: "days",
58
+ } as const;
59
+ /**
60
+ * The unit of time for the throttle window (required for fixed type).
61
+ */
62
+ export type ThrottleStepResponseDtoUnit = ClosedEnum<
63
+ typeof ThrottleStepResponseDtoUnit
64
+ >;
65
+
66
+ /**
67
+ * Control values for the throttle step
68
+ */
69
+ export type ThrottleStepResponseDtoControlValues = {
70
+ /**
71
+ * JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference.
72
+ */
73
+ skip?: { [k: string]: any } | undefined;
74
+ /**
75
+ * The type of throttle window.
76
+ */
77
+ type?: ThrottleStepResponseDtoType | undefined;
78
+ /**
79
+ * The amount of time for the throttle window (required for fixed type).
80
+ */
81
+ amount?: number | undefined;
82
+ /**
83
+ * The unit of time for the throttle window (required for fixed type).
84
+ */
85
+ unit?: ThrottleStepResponseDtoUnit | undefined;
86
+ /**
87
+ * Key path to retrieve dynamic window value (required for dynamic type).
88
+ */
89
+ dynamicKey?: string | undefined;
90
+ /**
91
+ * The maximum number of executions allowed within the window. Defaults to 1.
92
+ */
93
+ threshold?: number | undefined;
94
+ /**
95
+ * Optional key for grouping throttle rules. If not provided, defaults to workflow and subscriber combination.
96
+ */
97
+ throttleKey?: string | undefined;
98
+ additionalProperties?: { [k: string]: any };
99
+ };
100
+
101
+ export type ThrottleStepResponseDto = {
102
+ /**
103
+ * Controls metadata for the throttle step
104
+ */
105
+ controls: ThrottleControlsMetadataResponseDto;
106
+ /**
107
+ * Control values for the throttle step
108
+ */
109
+ controlValues?: ThrottleStepResponseDtoControlValues | undefined;
110
+ /**
111
+ * JSON Schema for variables, follows the JSON Schema standard
112
+ */
113
+ variables: { [k: string]: any };
114
+ /**
115
+ * Unique identifier of the step
116
+ */
117
+ stepId: string;
118
+ /**
119
+ * Database identifier of the step
120
+ */
121
+ id: string;
122
+ /**
123
+ * Name of the step
124
+ */
125
+ name: string;
126
+ /**
127
+ * Slug of the step
128
+ */
129
+ slug: string;
130
+ /**
131
+ * Type of the step
132
+ */
133
+ type: StepTypeEnum;
134
+ /**
135
+ * Origin of the layout
136
+ */
137
+ origin: ResourceOriginEnum;
138
+ /**
139
+ * Workflow identifier
140
+ */
141
+ workflowId: string;
142
+ /**
143
+ * Workflow database identifier
144
+ */
145
+ workflowDatabaseId: string;
146
+ /**
147
+ * Issues associated with the step
148
+ */
149
+ issues?: StepIssuesDto | undefined;
150
+ };
151
+
152
+ /** @internal */
153
+ export const ThrottleStepResponseDtoType$inboundSchema: z.ZodNativeEnum<
154
+ typeof ThrottleStepResponseDtoType
155
+ > = z.nativeEnum(ThrottleStepResponseDtoType);
156
+
157
+ /** @internal */
158
+ export const ThrottleStepResponseDtoType$outboundSchema: z.ZodNativeEnum<
159
+ typeof ThrottleStepResponseDtoType
160
+ > = ThrottleStepResponseDtoType$inboundSchema;
161
+
162
+ /**
163
+ * @internal
164
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
165
+ */
166
+ export namespace ThrottleStepResponseDtoType$ {
167
+ /** @deprecated use `ThrottleStepResponseDtoType$inboundSchema` instead. */
168
+ export const inboundSchema = ThrottleStepResponseDtoType$inboundSchema;
169
+ /** @deprecated use `ThrottleStepResponseDtoType$outboundSchema` instead. */
170
+ export const outboundSchema = ThrottleStepResponseDtoType$outboundSchema;
171
+ }
172
+
173
+ /** @internal */
174
+ export const ThrottleStepResponseDtoUnit$inboundSchema: z.ZodNativeEnum<
175
+ typeof ThrottleStepResponseDtoUnit
176
+ > = z.nativeEnum(ThrottleStepResponseDtoUnit);
177
+
178
+ /** @internal */
179
+ export const ThrottleStepResponseDtoUnit$outboundSchema: z.ZodNativeEnum<
180
+ typeof ThrottleStepResponseDtoUnit
181
+ > = ThrottleStepResponseDtoUnit$inboundSchema;
182
+
183
+ /**
184
+ * @internal
185
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
186
+ */
187
+ export namespace ThrottleStepResponseDtoUnit$ {
188
+ /** @deprecated use `ThrottleStepResponseDtoUnit$inboundSchema` instead. */
189
+ export const inboundSchema = ThrottleStepResponseDtoUnit$inboundSchema;
190
+ /** @deprecated use `ThrottleStepResponseDtoUnit$outboundSchema` instead. */
191
+ export const outboundSchema = ThrottleStepResponseDtoUnit$outboundSchema;
192
+ }
193
+
194
+ /** @internal */
195
+ export const ThrottleStepResponseDtoControlValues$inboundSchema: z.ZodType<
196
+ ThrottleStepResponseDtoControlValues,
197
+ z.ZodTypeDef,
198
+ unknown
199
+ > = collectExtraKeys$(
200
+ z.object({
201
+ skip: z.record(z.any()).optional(),
202
+ type: ThrottleStepResponseDtoType$inboundSchema.default("fixed"),
203
+ amount: z.number().optional(),
204
+ unit: ThrottleStepResponseDtoUnit$inboundSchema.optional(),
205
+ dynamicKey: z.string().optional(),
206
+ threshold: z.number().default(1),
207
+ throttleKey: z.string().optional(),
208
+ }).catchall(z.any()),
209
+ "additionalProperties",
210
+ true,
211
+ );
212
+
213
+ /** @internal */
214
+ export type ThrottleStepResponseDtoControlValues$Outbound = {
215
+ skip?: { [k: string]: any } | undefined;
216
+ type: string;
217
+ amount?: number | undefined;
218
+ unit?: string | undefined;
219
+ dynamicKey?: string | undefined;
220
+ threshold: number;
221
+ throttleKey?: string | undefined;
222
+ [additionalProperties: string]: unknown;
223
+ };
224
+
225
+ /** @internal */
226
+ export const ThrottleStepResponseDtoControlValues$outboundSchema: z.ZodType<
227
+ ThrottleStepResponseDtoControlValues$Outbound,
228
+ z.ZodTypeDef,
229
+ ThrottleStepResponseDtoControlValues
230
+ > = z.object({
231
+ skip: z.record(z.any()).optional(),
232
+ type: ThrottleStepResponseDtoType$outboundSchema.default("fixed"),
233
+ amount: z.number().optional(),
234
+ unit: ThrottleStepResponseDtoUnit$outboundSchema.optional(),
235
+ dynamicKey: z.string().optional(),
236
+ threshold: z.number().default(1),
237
+ throttleKey: z.string().optional(),
238
+ additionalProperties: z.record(z.any()),
239
+ }).transform((v) => {
240
+ return {
241
+ ...v.additionalProperties,
242
+ ...remap$(v, {
243
+ additionalProperties: null,
244
+ }),
245
+ };
246
+ });
247
+
248
+ /**
249
+ * @internal
250
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
251
+ */
252
+ export namespace ThrottleStepResponseDtoControlValues$ {
253
+ /** @deprecated use `ThrottleStepResponseDtoControlValues$inboundSchema` instead. */
254
+ export const inboundSchema =
255
+ ThrottleStepResponseDtoControlValues$inboundSchema;
256
+ /** @deprecated use `ThrottleStepResponseDtoControlValues$outboundSchema` instead. */
257
+ export const outboundSchema =
258
+ ThrottleStepResponseDtoControlValues$outboundSchema;
259
+ /** @deprecated use `ThrottleStepResponseDtoControlValues$Outbound` instead. */
260
+ export type Outbound = ThrottleStepResponseDtoControlValues$Outbound;
261
+ }
262
+
263
+ export function throttleStepResponseDtoControlValuesToJSON(
264
+ throttleStepResponseDtoControlValues: ThrottleStepResponseDtoControlValues,
265
+ ): string {
266
+ return JSON.stringify(
267
+ ThrottleStepResponseDtoControlValues$outboundSchema.parse(
268
+ throttleStepResponseDtoControlValues,
269
+ ),
270
+ );
271
+ }
272
+
273
+ export function throttleStepResponseDtoControlValuesFromJSON(
274
+ jsonString: string,
275
+ ): SafeParseResult<ThrottleStepResponseDtoControlValues, SDKValidationError> {
276
+ return safeParse(
277
+ jsonString,
278
+ (x) =>
279
+ ThrottleStepResponseDtoControlValues$inboundSchema.parse(JSON.parse(x)),
280
+ `Failed to parse 'ThrottleStepResponseDtoControlValues' from JSON`,
281
+ );
282
+ }
283
+
284
+ /** @internal */
285
+ export const ThrottleStepResponseDto$inboundSchema: z.ZodType<
286
+ ThrottleStepResponseDto,
287
+ z.ZodTypeDef,
288
+ unknown
289
+ > = z.object({
290
+ controls: ThrottleControlsMetadataResponseDto$inboundSchema,
291
+ controlValues: z.lazy(() =>
292
+ ThrottleStepResponseDtoControlValues$inboundSchema
293
+ ).optional(),
294
+ variables: z.record(z.any()),
295
+ stepId: z.string(),
296
+ _id: z.string(),
297
+ name: z.string(),
298
+ slug: z.string(),
299
+ type: StepTypeEnum$inboundSchema,
300
+ origin: ResourceOriginEnum$inboundSchema,
301
+ workflowId: z.string(),
302
+ workflowDatabaseId: z.string(),
303
+ issues: StepIssuesDto$inboundSchema.optional(),
304
+ }).transform((v) => {
305
+ return remap$(v, {
306
+ "_id": "id",
307
+ });
308
+ });
309
+
310
+ /** @internal */
311
+ export type ThrottleStepResponseDto$Outbound = {
312
+ controls: ThrottleControlsMetadataResponseDto$Outbound;
313
+ controlValues?: ThrottleStepResponseDtoControlValues$Outbound | undefined;
314
+ variables: { [k: string]: any };
315
+ stepId: string;
316
+ _id: string;
317
+ name: string;
318
+ slug: string;
319
+ type: string;
320
+ origin: string;
321
+ workflowId: string;
322
+ workflowDatabaseId: string;
323
+ issues?: StepIssuesDto$Outbound | undefined;
324
+ };
325
+
326
+ /** @internal */
327
+ export const ThrottleStepResponseDto$outboundSchema: z.ZodType<
328
+ ThrottleStepResponseDto$Outbound,
329
+ z.ZodTypeDef,
330
+ ThrottleStepResponseDto
331
+ > = z.object({
332
+ controls: ThrottleControlsMetadataResponseDto$outboundSchema,
333
+ controlValues: z.lazy(() =>
334
+ ThrottleStepResponseDtoControlValues$outboundSchema
335
+ ).optional(),
336
+ variables: z.record(z.any()),
337
+ stepId: z.string(),
338
+ id: z.string(),
339
+ name: z.string(),
340
+ slug: z.string(),
341
+ type: StepTypeEnum$outboundSchema,
342
+ origin: ResourceOriginEnum$outboundSchema,
343
+ workflowId: z.string(),
344
+ workflowDatabaseId: z.string(),
345
+ issues: StepIssuesDto$outboundSchema.optional(),
346
+ }).transform((v) => {
347
+ return remap$(v, {
348
+ id: "_id",
349
+ });
350
+ });
351
+
352
+ /**
353
+ * @internal
354
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
355
+ */
356
+ export namespace ThrottleStepResponseDto$ {
357
+ /** @deprecated use `ThrottleStepResponseDto$inboundSchema` instead. */
358
+ export const inboundSchema = ThrottleStepResponseDto$inboundSchema;
359
+ /** @deprecated use `ThrottleStepResponseDto$outboundSchema` instead. */
360
+ export const outboundSchema = ThrottleStepResponseDto$outboundSchema;
361
+ /** @deprecated use `ThrottleStepResponseDto$Outbound` instead. */
362
+ export type Outbound = ThrottleStepResponseDto$Outbound;
363
+ }
364
+
365
+ export function throttleStepResponseDtoToJSON(
366
+ throttleStepResponseDto: ThrottleStepResponseDto,
367
+ ): string {
368
+ return JSON.stringify(
369
+ ThrottleStepResponseDto$outboundSchema.parse(throttleStepResponseDto),
370
+ );
371
+ }
372
+
373
+ export function throttleStepResponseDtoFromJSON(
374
+ jsonString: string,
375
+ ): SafeParseResult<ThrottleStepResponseDto, SDKValidationError> {
376
+ return safeParse(
377
+ jsonString,
378
+ (x) => ThrottleStepResponseDto$inboundSchema.parse(JSON.parse(x)),
379
+ `Failed to parse 'ThrottleStepResponseDto' from JSON`,
380
+ );
381
+ }
@@ -0,0 +1,176 @@
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
+ StepTypeEnum,
12
+ StepTypeEnum$inboundSchema,
13
+ StepTypeEnum$outboundSchema,
14
+ } from "./steptypeenum.js";
15
+ import {
16
+ ThrottleControlDto,
17
+ ThrottleControlDto$inboundSchema,
18
+ ThrottleControlDto$Outbound,
19
+ ThrottleControlDto$outboundSchema,
20
+ } from "./throttlecontroldto.js";
21
+
22
+ /**
23
+ * Control values for the Throttle step.
24
+ */
25
+ export type ThrottleStepUpsertDtoControlValues = ThrottleControlDto | {
26
+ [k: string]: any;
27
+ };
28
+
29
+ export type ThrottleStepUpsertDto = {
30
+ /**
31
+ * Unique identifier of the step
32
+ */
33
+ id?: string | undefined;
34
+ /**
35
+ * Name of the step
36
+ */
37
+ name: string;
38
+ /**
39
+ * Type of the step
40
+ */
41
+ type: StepTypeEnum;
42
+ /**
43
+ * Control values for the Throttle step.
44
+ */
45
+ controlValues?: ThrottleControlDto | { [k: string]: any } | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const ThrottleStepUpsertDtoControlValues$inboundSchema: z.ZodType<
50
+ ThrottleStepUpsertDtoControlValues,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.union([ThrottleControlDto$inboundSchema, z.record(z.any())]);
54
+
55
+ /** @internal */
56
+ export type ThrottleStepUpsertDtoControlValues$Outbound =
57
+ | ThrottleControlDto$Outbound
58
+ | { [k: string]: any };
59
+
60
+ /** @internal */
61
+ export const ThrottleStepUpsertDtoControlValues$outboundSchema: z.ZodType<
62
+ ThrottleStepUpsertDtoControlValues$Outbound,
63
+ z.ZodTypeDef,
64
+ ThrottleStepUpsertDtoControlValues
65
+ > = z.union([ThrottleControlDto$outboundSchema, z.record(z.any())]);
66
+
67
+ /**
68
+ * @internal
69
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
70
+ */
71
+ export namespace ThrottleStepUpsertDtoControlValues$ {
72
+ /** @deprecated use `ThrottleStepUpsertDtoControlValues$inboundSchema` instead. */
73
+ export const inboundSchema = ThrottleStepUpsertDtoControlValues$inboundSchema;
74
+ /** @deprecated use `ThrottleStepUpsertDtoControlValues$outboundSchema` instead. */
75
+ export const outboundSchema =
76
+ ThrottleStepUpsertDtoControlValues$outboundSchema;
77
+ /** @deprecated use `ThrottleStepUpsertDtoControlValues$Outbound` instead. */
78
+ export type Outbound = ThrottleStepUpsertDtoControlValues$Outbound;
79
+ }
80
+
81
+ export function throttleStepUpsertDtoControlValuesToJSON(
82
+ throttleStepUpsertDtoControlValues: ThrottleStepUpsertDtoControlValues,
83
+ ): string {
84
+ return JSON.stringify(
85
+ ThrottleStepUpsertDtoControlValues$outboundSchema.parse(
86
+ throttleStepUpsertDtoControlValues,
87
+ ),
88
+ );
89
+ }
90
+
91
+ export function throttleStepUpsertDtoControlValuesFromJSON(
92
+ jsonString: string,
93
+ ): SafeParseResult<ThrottleStepUpsertDtoControlValues, SDKValidationError> {
94
+ return safeParse(
95
+ jsonString,
96
+ (x) =>
97
+ ThrottleStepUpsertDtoControlValues$inboundSchema.parse(JSON.parse(x)),
98
+ `Failed to parse 'ThrottleStepUpsertDtoControlValues' from JSON`,
99
+ );
100
+ }
101
+
102
+ /** @internal */
103
+ export const ThrottleStepUpsertDto$inboundSchema: z.ZodType<
104
+ ThrottleStepUpsertDto,
105
+ z.ZodTypeDef,
106
+ unknown
107
+ > = z.object({
108
+ _id: z.string().optional(),
109
+ name: z.string(),
110
+ type: StepTypeEnum$inboundSchema,
111
+ controlValues: z.union([ThrottleControlDto$inboundSchema, z.record(z.any())])
112
+ .optional(),
113
+ }).transform((v) => {
114
+ return remap$(v, {
115
+ "_id": "id",
116
+ });
117
+ });
118
+
119
+ /** @internal */
120
+ export type ThrottleStepUpsertDto$Outbound = {
121
+ _id?: string | undefined;
122
+ name: string;
123
+ type: string;
124
+ controlValues?:
125
+ | ThrottleControlDto$Outbound
126
+ | { [k: string]: any }
127
+ | undefined;
128
+ };
129
+
130
+ /** @internal */
131
+ export const ThrottleStepUpsertDto$outboundSchema: z.ZodType<
132
+ ThrottleStepUpsertDto$Outbound,
133
+ z.ZodTypeDef,
134
+ ThrottleStepUpsertDto
135
+ > = z.object({
136
+ id: z.string().optional(),
137
+ name: z.string(),
138
+ type: StepTypeEnum$outboundSchema,
139
+ controlValues: z.union([ThrottleControlDto$outboundSchema, z.record(z.any())])
140
+ .optional(),
141
+ }).transform((v) => {
142
+ return remap$(v, {
143
+ id: "_id",
144
+ });
145
+ });
146
+
147
+ /**
148
+ * @internal
149
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
150
+ */
151
+ export namespace ThrottleStepUpsertDto$ {
152
+ /** @deprecated use `ThrottleStepUpsertDto$inboundSchema` instead. */
153
+ export const inboundSchema = ThrottleStepUpsertDto$inboundSchema;
154
+ /** @deprecated use `ThrottleStepUpsertDto$outboundSchema` instead. */
155
+ export const outboundSchema = ThrottleStepUpsertDto$outboundSchema;
156
+ /** @deprecated use `ThrottleStepUpsertDto$Outbound` instead. */
157
+ export type Outbound = ThrottleStepUpsertDto$Outbound;
158
+ }
159
+
160
+ export function throttleStepUpsertDtoToJSON(
161
+ throttleStepUpsertDto: ThrottleStepUpsertDto,
162
+ ): string {
163
+ return JSON.stringify(
164
+ ThrottleStepUpsertDto$outboundSchema.parse(throttleStepUpsertDto),
165
+ );
166
+ }
167
+
168
+ export function throttleStepUpsertDtoFromJSON(
169
+ jsonString: string,
170
+ ): SafeParseResult<ThrottleStepUpsertDto, SDKValidationError> {
171
+ return safeParse(
172
+ jsonString,
173
+ (x) => ThrottleStepUpsertDto$inboundSchema.parse(JSON.parse(x)),
174
+ `Failed to parse 'ThrottleStepUpsertDto' from JSON`,
175
+ );
176
+ }
@@ -130,7 +130,7 @@ export type Actor = SubscriberPayloadDto | string;
130
130
  * @remarks
131
131
  * Existing tenants will be updated with the provided details.
132
132
  */
133
- export type Tenant = TenantPayloadDto | string;
133
+ export type Tenant = string | TenantPayloadDto;
134
134
 
135
135
  export type TriggerEventRequestDto = {
136
136
  /**
@@ -177,7 +177,7 @@ export type TriggerEventRequestDto = {
177
177
  * @remarks
178
178
  * Existing tenants will be updated with the provided details.
179
179
  */
180
- tenant?: TenantPayloadDto | string | undefined;
180
+ tenant?: string | TenantPayloadDto | undefined;
181
181
  };
182
182
 
183
183
  /** @internal */
@@ -460,17 +460,17 @@ export function actorFromJSON(
460
460
 
461
461
  /** @internal */
462
462
  export const Tenant$inboundSchema: z.ZodType<Tenant, z.ZodTypeDef, unknown> = z
463
- .union([TenantPayloadDto$inboundSchema, z.string()]);
463
+ .union([z.string(), TenantPayloadDto$inboundSchema]);
464
464
 
465
465
  /** @internal */
466
- export type Tenant$Outbound = TenantPayloadDto$Outbound | string;
466
+ export type Tenant$Outbound = string | TenantPayloadDto$Outbound;
467
467
 
468
468
  /** @internal */
469
469
  export const Tenant$outboundSchema: z.ZodType<
470
470
  Tenant$Outbound,
471
471
  z.ZodTypeDef,
472
472
  Tenant
473
- > = z.union([TenantPayloadDto$outboundSchema, z.string()]);
473
+ > = z.union([z.string(), TenantPayloadDto$outboundSchema]);
474
474
 
475
475
  /**
476
476
  * @internal
@@ -522,7 +522,7 @@ export const TriggerEventRequestDto$inboundSchema: z.ZodType<
522
522
  ]),
523
523
  transactionId: z.string().optional(),
524
524
  actor: z.union([SubscriberPayloadDto$inboundSchema, z.string()]).optional(),
525
- tenant: z.union([TenantPayloadDto$inboundSchema, z.string()]).optional(),
525
+ tenant: z.union([z.string(), TenantPayloadDto$inboundSchema]).optional(),
526
526
  }).transform((v) => {
527
527
  return remap$(v, {
528
528
  "name": "workflowId",
@@ -541,7 +541,7 @@ export type TriggerEventRequestDto$Outbound = {
541
541
  | string;
542
542
  transactionId?: string | undefined;
543
543
  actor?: SubscriberPayloadDto$Outbound | string | undefined;
544
- tenant?: TenantPayloadDto$Outbound | string | undefined;
544
+ tenant?: string | TenantPayloadDto$Outbound | undefined;
545
545
  };
546
546
 
547
547
  /** @internal */
@@ -567,7 +567,7 @@ export const TriggerEventRequestDto$outboundSchema: z.ZodType<
567
567
  ]),
568
568
  transactionId: z.string().optional(),
569
569
  actor: z.union([SubscriberPayloadDto$outboundSchema, z.string()]).optional(),
570
- tenant: z.union([TenantPayloadDto$outboundSchema, z.string()]).optional(),
570
+ tenant: z.union([z.string(), TenantPayloadDto$outboundSchema]).optional(),
571
571
  }).transform((v) => {
572
572
  return remap$(v, {
573
573
  workflowId: "name",
@@ -117,7 +117,7 @@ export type TriggerEventToAllRequestDtoActor = SubscriberPayloadDto | string;
117
117
  * @remarks
118
118
  * If a new tenant object is provided, we will create a new tenant.
119
119
  */
120
- export type TriggerEventToAllRequestDtoTenant = TenantPayloadDto | string;
120
+ export type TriggerEventToAllRequestDtoTenant = string | TenantPayloadDto;
121
121
 
122
122
  export type TriggerEventToAllRequestDto = {
123
123
  /**
@@ -153,7 +153,7 @@ export type TriggerEventToAllRequestDto = {
153
153
  * @remarks
154
154
  * If a new tenant object is provided, we will create a new tenant.
155
155
  */
156
- tenant?: TenantPayloadDto | string | undefined;
156
+ tenant?: string | TenantPayloadDto | undefined;
157
157
  };
158
158
 
159
159
  /** @internal */
@@ -370,19 +370,19 @@ export const TriggerEventToAllRequestDtoTenant$inboundSchema: z.ZodType<
370
370
  TriggerEventToAllRequestDtoTenant,
371
371
  z.ZodTypeDef,
372
372
  unknown
373
- > = z.union([TenantPayloadDto$inboundSchema, z.string()]);
373
+ > = z.union([z.string(), TenantPayloadDto$inboundSchema]);
374
374
 
375
375
  /** @internal */
376
376
  export type TriggerEventToAllRequestDtoTenant$Outbound =
377
- | TenantPayloadDto$Outbound
378
- | string;
377
+ | string
378
+ | TenantPayloadDto$Outbound;
379
379
 
380
380
  /** @internal */
381
381
  export const TriggerEventToAllRequestDtoTenant$outboundSchema: z.ZodType<
382
382
  TriggerEventToAllRequestDtoTenant$Outbound,
383
383
  z.ZodTypeDef,
384
384
  TriggerEventToAllRequestDtoTenant
385
- > = z.union([TenantPayloadDto$outboundSchema, z.string()]);
385
+ > = z.union([z.string(), TenantPayloadDto$outboundSchema]);
386
386
 
387
387
  /**
388
388
  * @internal
@@ -430,7 +430,7 @@ export const TriggerEventToAllRequestDto$inboundSchema: z.ZodType<
430
430
  .optional(),
431
431
  transactionId: z.string().optional(),
432
432
  actor: z.union([SubscriberPayloadDto$inboundSchema, z.string()]).optional(),
433
- tenant: z.union([TenantPayloadDto$inboundSchema, z.string()]).optional(),
433
+ tenant: z.union([z.string(), TenantPayloadDto$inboundSchema]).optional(),
434
434
  });
435
435
 
436
436
  /** @internal */
@@ -440,7 +440,7 @@ export type TriggerEventToAllRequestDto$Outbound = {
440
440
  overrides?: TriggerEventToAllRequestDtoOverrides$Outbound | undefined;
441
441
  transactionId?: string | undefined;
442
442
  actor?: SubscriberPayloadDto$Outbound | string | undefined;
443
- tenant?: TenantPayloadDto$Outbound | string | undefined;
443
+ tenant?: string | TenantPayloadDto$Outbound | undefined;
444
444
  };
445
445
 
446
446
  /** @internal */
@@ -455,7 +455,7 @@ export const TriggerEventToAllRequestDto$outboundSchema: z.ZodType<
455
455
  .optional(),
456
456
  transactionId: z.string().optional(),
457
457
  actor: z.union([SubscriberPayloadDto$outboundSchema, z.string()]).optional(),
458
- tenant: z.union([TenantPayloadDto$outboundSchema, z.string()]).optional(),
458
+ tenant: z.union([z.string(), TenantPayloadDto$outboundSchema]).optional(),
459
459
  });
460
460
 
461
461
  /**
@@ -29,6 +29,13 @@ export const UiComponentEnum = {
29
29
  DelayType: "DELAY_TYPE",
30
30
  DelayAmount: "DELAY_AMOUNT",
31
31
  DelayUnit: "DELAY_UNIT",
32
+ ThrottleType: "THROTTLE_TYPE",
33
+ ThrottleWindow: "THROTTLE_WINDOW",
34
+ ThrottleUnit: "THROTTLE_UNIT",
35
+ ThrottleDynamicKey: "THROTTLE_DYNAMIC_KEY",
36
+ ThrottleThreshold: "THROTTLE_THRESHOLD",
37
+ ThrottleKey: "THROTTLE_KEY",
38
+ ExtendToSchedule: "EXTEND_TO_SCHEDULE",
32
39
  SmsBody: "SMS_BODY",
33
40
  ChatBody: "CHAT_BODY",
34
41
  PushBody: "PUSH_BODY",