@novu/api 3.14.0 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +7 -3
  2. package/funcs/environmentsDiff.d.ts +19 -0
  3. package/funcs/environmentsDiff.d.ts.map +1 -0
  4. package/funcs/environmentsDiff.js +156 -0
  5. package/funcs/environmentsDiff.js.map +1 -0
  6. package/funcs/environmentsPublish.d.ts +19 -0
  7. package/funcs/environmentsPublish.d.ts.map +1 -0
  8. package/funcs/environmentsPublish.js +156 -0
  9. package/funcs/environmentsPublish.js.map +1 -0
  10. package/funcs/translationsMasterUpload.js +7 -0
  11. package/funcs/translationsMasterUpload.js.map +1 -1
  12. package/funcs/translationsUpload.js +8 -1
  13. package/funcs/translationsUpload.js.map +1 -1
  14. package/jsr.json +1 -1
  15. package/lib/config.d.ts +4 -4
  16. package/lib/config.js +4 -4
  17. package/lib/matchers.d.ts.map +1 -1
  18. package/lib/matchers.js +0 -1
  19. package/lib/matchers.js.map +1 -1
  20. package/lib/security.d.ts.map +1 -1
  21. package/lib/security.js +1 -2
  22. package/lib/security.js.map +1 -1
  23. package/models/components/chatstepresponsedto.d.ts +4 -0
  24. package/models/components/chatstepresponsedto.d.ts.map +1 -1
  25. package/models/components/chatstepresponsedto.js +1 -0
  26. package/models/components/chatstepresponsedto.js.map +1 -1
  27. package/models/components/customstepresponsedto.d.ts +4 -0
  28. package/models/components/customstepresponsedto.d.ts.map +1 -1
  29. package/models/components/customstepresponsedto.js +1 -0
  30. package/models/components/customstepresponsedto.js.map +1 -1
  31. package/models/components/delaystepresponsedto.d.ts +4 -0
  32. package/models/components/delaystepresponsedto.d.ts.map +1 -1
  33. package/models/components/delaystepresponsedto.js +1 -0
  34. package/models/components/delaystepresponsedto.js.map +1 -1
  35. package/models/components/dependencyreasonenum.d.ts +16 -0
  36. package/models/components/dependencyreasonenum.d.ts.map +1 -0
  37. package/models/components/dependencyreasonenum.js +50 -0
  38. package/models/components/dependencyreasonenum.js.map +1 -0
  39. package/models/components/diffactionenum.d.ts +19 -0
  40. package/models/components/diffactionenum.d.ts.map +1 -0
  41. package/models/components/diffactionenum.js +53 -0
  42. package/models/components/diffactionenum.js.map +1 -0
  43. package/models/components/diffenvironmentrequestdto.d.ts +15 -0
  44. package/models/components/diffenvironmentrequestdto.d.ts.map +1 -0
  45. package/models/components/diffenvironmentrequestdto.js +49 -0
  46. package/models/components/diffenvironmentrequestdto.js.map +1 -0
  47. package/models/components/diffenvironmentresponsedto.d.ts +27 -0
  48. package/models/components/diffenvironmentresponsedto.d.ts.map +1 -0
  49. package/models/components/diffenvironmentresponsedto.js +55 -0
  50. package/models/components/diffenvironmentresponsedto.js.map +1 -0
  51. package/models/components/diffsummarydto.d.ts +25 -0
  52. package/models/components/diffsummarydto.d.ts.map +1 -0
  53. package/models/components/diffsummarydto.js +53 -0
  54. package/models/components/diffsummarydto.js.map +1 -0
  55. package/models/components/digeststepresponsedto.d.ts +4 -0
  56. package/models/components/digeststepresponsedto.d.ts.map +1 -1
  57. package/models/components/digeststepresponsedto.js +1 -0
  58. package/models/components/digeststepresponsedto.js.map +1 -1
  59. package/models/components/emailcontroldto.d.ts +20 -0
  60. package/models/components/emailcontroldto.d.ts.map +1 -1
  61. package/models/components/emailcontroldto.js +14 -1
  62. package/models/components/emailcontroldto.js.map +1 -1
  63. package/models/components/emailstepresponsedto.d.ts +21 -0
  64. package/models/components/emailstepresponsedto.d.ts.map +1 -1
  65. package/models/components/emailstepresponsedto.js +12 -1
  66. package/models/components/emailstepresponsedto.js.map +1 -1
  67. package/models/components/environmentdiffsummarydto.d.ts +21 -0
  68. package/models/components/environmentdiffsummarydto.d.ts.map +1 -0
  69. package/models/components/environmentdiffsummarydto.js +52 -0
  70. package/models/components/environmentdiffsummarydto.js.map +1 -0
  71. package/models/components/failedworkflowdto.d.ts +30 -0
  72. package/models/components/failedworkflowdto.d.ts.map +1 -0
  73. package/models/components/failedworkflowdto.js +55 -0
  74. package/models/components/failedworkflowdto.js.map +1 -0
  75. package/models/components/inappstepresponsedto.d.ts +4 -0
  76. package/models/components/inappstepresponsedto.d.ts.map +1 -1
  77. package/models/components/inappstepresponsedto.js +1 -0
  78. package/models/components/inappstepresponsedto.js.map +1 -1
  79. package/models/components/index.d.ts +18 -0
  80. package/models/components/index.d.ts.map +1 -1
  81. package/models/components/index.js +18 -0
  82. package/models/components/index.js.map +1 -1
  83. package/models/components/publishenvironmentrequestdto.d.ts +26 -0
  84. package/models/components/publishenvironmentrequestdto.d.ts.map +1 -0
  85. package/models/components/publishenvironmentrequestdto.js +52 -0
  86. package/models/components/publishenvironmentrequestdto.js.map +1 -0
  87. package/models/components/publishenvironmentresponsedto.d.ts +19 -0
  88. package/models/components/publishenvironmentresponsedto.d.ts.map +1 -0
  89. package/models/components/publishenvironmentresponsedto.js +53 -0
  90. package/models/components/publishenvironmentresponsedto.js.map +1 -0
  91. package/models/components/publishsummarydto.d.ts +25 -0
  92. package/models/components/publishsummarydto.d.ts.map +1 -0
  93. package/models/components/publishsummarydto.js +53 -0
  94. package/models/components/publishsummarydto.js.map +1 -0
  95. package/models/components/pushstepresponsedto.d.ts +4 -0
  96. package/models/components/pushstepresponsedto.d.ts.map +1 -1
  97. package/models/components/pushstepresponsedto.js +1 -0
  98. package/models/components/pushstepresponsedto.js.map +1 -1
  99. package/models/components/resourcedependencydto.d.ts +31 -0
  100. package/models/components/resourcedependencydto.d.ts.map +1 -0
  101. package/models/components/resourcedependencydto.js +56 -0
  102. package/models/components/resourcedependencydto.js.map +1 -0
  103. package/models/components/resourcediffdto.d.ts +159 -0
  104. package/models/components/resourcediffdto.d.ts.map +1 -0
  105. package/models/components/resourcediffdto.js +123 -0
  106. package/models/components/resourcediffdto.js.map +1 -0
  107. package/models/components/resourcediffresultdto.d.ts +133 -0
  108. package/models/components/resourcediffresultdto.d.ts.map +1 -0
  109. package/models/components/resourcediffresultdto.js +114 -0
  110. package/models/components/resourcediffresultdto.js.map +1 -0
  111. package/models/components/resourcetopublishdto.d.ts +21 -0
  112. package/models/components/resourcetopublishdto.d.ts.map +1 -0
  113. package/models/components/resourcetopublishdto.js +51 -0
  114. package/models/components/resourcetopublishdto.js.map +1 -0
  115. package/models/components/resourcetypeenum.d.ts +2 -0
  116. package/models/components/resourcetypeenum.d.ts.map +1 -1
  117. package/models/components/resourcetypeenum.js +3 -1
  118. package/models/components/resourcetypeenum.js.map +1 -1
  119. package/models/components/skippedworkflowdto.d.ts +26 -0
  120. package/models/components/skippedworkflowdto.d.ts.map +1 -0
  121. package/models/components/skippedworkflowdto.js +54 -0
  122. package/models/components/skippedworkflowdto.js.map +1 -0
  123. package/models/components/smsstepresponsedto.d.ts +4 -0
  124. package/models/components/smsstepresponsedto.d.ts.map +1 -1
  125. package/models/components/smsstepresponsedto.js +1 -0
  126. package/models/components/smsstepresponsedto.js.map +1 -1
  127. package/models/components/stepresponsedto.d.ts +4 -0
  128. package/models/components/stepresponsedto.d.ts.map +1 -1
  129. package/models/components/stepresponsedto.js +1 -0
  130. package/models/components/stepresponsedto.js.map +1 -1
  131. package/models/components/syncactionenum.d.ts +18 -0
  132. package/models/components/syncactionenum.d.ts.map +1 -0
  133. package/models/components/syncactionenum.js +52 -0
  134. package/models/components/syncactionenum.js.map +1 -0
  135. package/models/components/syncedworkflowdto.d.ts +27 -0
  136. package/models/components/syncedworkflowdto.d.ts.map +1 -0
  137. package/models/components/syncedworkflowdto.js +55 -0
  138. package/models/components/syncedworkflowdto.js.map +1 -0
  139. package/models/components/syncresultdto.d.ts +33 -0
  140. package/models/components/syncresultdto.d.ts.map +1 -0
  141. package/models/components/syncresultdto.js +58 -0
  142. package/models/components/syncresultdto.js.map +1 -0
  143. package/models/components/throttlestepresponsedto.d.ts +4 -0
  144. package/models/components/throttlestepresponsedto.d.ts.map +1 -1
  145. package/models/components/throttlestepresponsedto.js +1 -0
  146. package/models/components/throttlestepresponsedto.js.map +1 -1
  147. package/models/components/uicomponentenum.d.ts +4 -3
  148. package/models/components/uicomponentenum.d.ts.map +1 -1
  149. package/models/components/uicomponentenum.js +3 -2
  150. package/models/components/uicomponentenum.js.map +1 -1
  151. package/models/components/workflowcreationsourceenum.d.ts +1 -0
  152. package/models/components/workflowcreationsourceenum.d.ts.map +1 -1
  153. package/models/components/workflowcreationsourceenum.js +1 -0
  154. package/models/components/workflowcreationsourceenum.js.map +1 -1
  155. package/models/operations/environmentscontrollerdiffenvironment.d.ts +37 -0
  156. package/models/operations/environmentscontrollerdiffenvironment.d.ts.map +1 -0
  157. package/models/operations/environmentscontrollerdiffenvironment.js +73 -0
  158. package/models/operations/environmentscontrollerdiffenvironment.js.map +1 -0
  159. package/models/operations/environmentscontrollerpublishenvironment.d.ts +37 -0
  160. package/models/operations/environmentscontrollerpublishenvironment.d.ts.map +1 -0
  161. package/models/operations/environmentscontrollerpublishenvironment.js +73 -0
  162. package/models/operations/environmentscontrollerpublishenvironment.js.map +1 -0
  163. package/models/operations/index.d.ts +2 -0
  164. package/models/operations/index.d.ts.map +1 -1
  165. package/models/operations/index.js +2 -0
  166. package/models/operations/index.js.map +1 -1
  167. package/package.json +1 -1
  168. package/sdk/environments.d.ts +14 -0
  169. package/sdk/environments.d.ts.map +1 -1
  170. package/sdk/environments.js +20 -0
  171. package/sdk/environments.js.map +1 -1
  172. package/src/funcs/environmentsDiff.ts +243 -0
  173. package/src/funcs/environmentsPublish.ts +243 -0
  174. package/src/funcs/translationsMasterUpload.ts +12 -0
  175. package/src/funcs/translationsUpload.ts +12 -1
  176. package/src/lib/config.ts +4 -4
  177. package/src/lib/matchers.ts +3 -2
  178. package/src/lib/security.ts +1 -2
  179. package/src/models/components/chatstepresponsedto.ts +5 -0
  180. package/src/models/components/customstepresponsedto.ts +5 -0
  181. package/src/models/components/delaystepresponsedto.ts +5 -0
  182. package/src/models/components/dependencyreasonenum.ts +23 -0
  183. package/src/models/components/diffactionenum.ts +26 -0
  184. package/src/models/components/diffenvironmentrequestdto.ts +34 -0
  185. package/src/models/components/diffenvironmentresponsedto.ts +57 -0
  186. package/src/models/components/diffsummarydto.ts +49 -0
  187. package/src/models/components/digeststepresponsedto.ts +5 -0
  188. package/src/models/components/emailcontroldto.ts +26 -0
  189. package/src/models/components/emailstepresponsedto.ts +31 -0
  190. package/src/models/components/environmentdiffsummarydto.ts +44 -0
  191. package/src/models/components/failedworkflowdto.ts +58 -0
  192. package/src/models/components/inappstepresponsedto.ts +5 -0
  193. package/src/models/components/index.ts +18 -0
  194. package/src/models/components/publishenvironmentrequestdto.ts +53 -0
  195. package/src/models/components/publishenvironmentresponsedto.ts +44 -0
  196. package/src/models/components/publishsummarydto.ts +49 -0
  197. package/src/models/components/pushstepresponsedto.ts +5 -0
  198. package/src/models/components/resourcedependencydto.ts +62 -0
  199. package/src/models/components/resourcediffdto.ts +305 -0
  200. package/src/models/components/resourcediffresultdto.ts +277 -0
  201. package/src/models/components/resourcetopublishdto.ts +44 -0
  202. package/src/models/components/resourcetypeenum.ts +4 -0
  203. package/src/models/components/skippedworkflowdto.ts +53 -0
  204. package/src/models/components/smsstepresponsedto.ts +5 -0
  205. package/src/models/components/stepresponsedto.ts +5 -0
  206. package/src/models/components/syncactionenum.ts +25 -0
  207. package/src/models/components/syncedworkflowdto.ts +57 -0
  208. package/src/models/components/syncresultdto.ts +70 -0
  209. package/src/models/components/throttlestepresponsedto.ts +5 -0
  210. package/src/models/components/uicomponentenum.ts +9 -5
  211. package/src/models/components/workflowcreationsourceenum.ts +1 -0
  212. package/src/models/operations/environmentscontrollerdiffenvironment.ts +98 -0
  213. package/src/models/operations/environmentscontrollerpublishenvironment.ts +99 -0
  214. package/src/models/operations/index.ts +2 -0
  215. package/src/sdk/environments.ts +44 -0
  216. package/_speakeasy/.github/action-inputs-config.json +0 -53
  217. package/_speakeasy/.github/action-security-config.json +0 -88
  218. package/codeSamples.json +0 -1772
  219. package/examples/package-lock.json +0 -610
  220. package/examples/package.json +0 -18
  221. package/sources/code-samples.json +0 -2105
  222. package/sources/json-development.json +0 -55438
  223. package/sources/openapi.sdk.json +0 -13193
  224. package/tsconfig.json +0 -40
@@ -0,0 +1,243 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { NovuCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { NovuError } from "../models/errors/novuerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Publish resources to target environment
31
+ *
32
+ * @remarks
33
+ * Publishes all workflows and resources from the source environment to the target environment. Optionally specify specific resources to publish or use dryRun mode to preview changes.
34
+ */
35
+ export function environmentsPublish(
36
+ client: NovuCore,
37
+ publishEnvironmentRequestDto: components.PublishEnvironmentRequestDto,
38
+ targetEnvironmentId: string,
39
+ idempotencyKey?: string | undefined,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ operations.EnvironmentsControllerPublishEnvironmentResponse,
44
+ | errors.ErrorDto
45
+ | errors.ValidationErrorDto
46
+ | NovuError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ publishEnvironmentRequestDto,
59
+ targetEnvironmentId,
60
+ idempotencyKey,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: NovuCore,
67
+ publishEnvironmentRequestDto: components.PublishEnvironmentRequestDto,
68
+ targetEnvironmentId: string,
69
+ idempotencyKey?: string | undefined,
70
+ options?: RequestOptions,
71
+ ): Promise<
72
+ [
73
+ Result<
74
+ operations.EnvironmentsControllerPublishEnvironmentResponse,
75
+ | errors.ErrorDto
76
+ | errors.ValidationErrorDto
77
+ | NovuError
78
+ | ResponseValidationError
79
+ | ConnectionError
80
+ | RequestAbortedError
81
+ | RequestTimeoutError
82
+ | InvalidRequestError
83
+ | UnexpectedClientError
84
+ | SDKValidationError
85
+ >,
86
+ APICall,
87
+ ]
88
+ > {
89
+ const input: operations.EnvironmentsControllerPublishEnvironmentRequest = {
90
+ publishEnvironmentRequestDto: publishEnvironmentRequestDto,
91
+ targetEnvironmentId: targetEnvironmentId,
92
+ idempotencyKey: idempotencyKey,
93
+ };
94
+
95
+ const parsed = safeParse(
96
+ input,
97
+ (value) =>
98
+ operations.EnvironmentsControllerPublishEnvironmentRequest$outboundSchema
99
+ .parse(value),
100
+ "Input validation failed",
101
+ );
102
+ if (!parsed.ok) {
103
+ return [parsed, { status: "invalid" }];
104
+ }
105
+ const payload = parsed.value;
106
+ const body = encodeJSON("body", payload.PublishEnvironmentRequestDto, {
107
+ explode: true,
108
+ });
109
+
110
+ const pathParams = {
111
+ targetEnvironmentId: encodeSimple(
112
+ "targetEnvironmentId",
113
+ payload.targetEnvironmentId,
114
+ { explode: false, charEncoding: "percent" },
115
+ ),
116
+ };
117
+
118
+ const path = pathToFunc("/v2/environments/{targetEnvironmentId}/publish")(
119
+ pathParams,
120
+ );
121
+
122
+ const headers = new Headers(compactMap({
123
+ "Content-Type": "application/json",
124
+ Accept: "application/json",
125
+ "idempotency-key": encodeSimple(
126
+ "idempotency-key",
127
+ payload["idempotency-key"],
128
+ { explode: false, charEncoding: "none" },
129
+ ),
130
+ }));
131
+
132
+ const secConfig = await extractSecurity(client._options.secretKey);
133
+ const securityInput = secConfig == null ? {} : { secretKey: secConfig };
134
+ const requestSecurity = resolveGlobalSecurity(securityInput);
135
+
136
+ const context = {
137
+ options: client._options,
138
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
139
+ operationID: "EnvironmentsController_publishEnvironment",
140
+ oAuth2Scopes: null,
141
+
142
+ resolvedSecurity: requestSecurity,
143
+
144
+ securitySource: client._options.secretKey,
145
+ retryConfig: options?.retries
146
+ || client._options.retryConfig
147
+ || {
148
+ strategy: "backoff",
149
+ backoff: {
150
+ initialInterval: 1000,
151
+ maxInterval: 30000,
152
+ exponent: 1.5,
153
+ maxElapsedTime: 3600000,
154
+ },
155
+ retryConnectionErrors: true,
156
+ }
157
+ || { strategy: "none" },
158
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
159
+ };
160
+
161
+ const requestRes = client._createRequest(context, {
162
+ security: requestSecurity,
163
+ method: "POST",
164
+ baseURL: options?.serverURL,
165
+ path: path,
166
+ headers: headers,
167
+ body: body,
168
+ userAgent: client._options.userAgent,
169
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
170
+ }, options);
171
+ if (!requestRes.ok) {
172
+ return [requestRes, { status: "invalid" }];
173
+ }
174
+ const req = requestRes.value;
175
+
176
+ const doResult = await client._do(req, {
177
+ context,
178
+ errorCodes: [
179
+ "400",
180
+ "401",
181
+ "403",
182
+ "404",
183
+ "405",
184
+ "409",
185
+ "413",
186
+ "414",
187
+ "415",
188
+ "422",
189
+ "429",
190
+ "4XX",
191
+ "500",
192
+ "503",
193
+ "5XX",
194
+ ],
195
+ retryConfig: context.retryConfig,
196
+ retryCodes: context.retryCodes,
197
+ });
198
+ if (!doResult.ok) {
199
+ return [doResult, { status: "request-error", request: req }];
200
+ }
201
+ const response = doResult.value;
202
+
203
+ const responseFields = {
204
+ HttpMeta: { Response: response, Request: req },
205
+ };
206
+
207
+ const [result] = await M.match<
208
+ operations.EnvironmentsControllerPublishEnvironmentResponse,
209
+ | errors.ErrorDto
210
+ | errors.ValidationErrorDto
211
+ | NovuError
212
+ | ResponseValidationError
213
+ | ConnectionError
214
+ | RequestAbortedError
215
+ | RequestTimeoutError
216
+ | InvalidRequestError
217
+ | UnexpectedClientError
218
+ | SDKValidationError
219
+ >(
220
+ M.json(
221
+ 200,
222
+ operations.EnvironmentsControllerPublishEnvironmentResponse$inboundSchema,
223
+ { hdrs: true, key: "Result" },
224
+ ),
225
+ M.jsonErr(414, errors.ErrorDto$inboundSchema),
226
+ M.jsonErr(
227
+ [400, 401, 403, 404, 405, 409, 413, 415],
228
+ errors.ErrorDto$inboundSchema,
229
+ { hdrs: true },
230
+ ),
231
+ M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
232
+ M.fail(429),
233
+ M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
234
+ M.fail(503),
235
+ M.fail("4XX"),
236
+ M.fail("5XX"),
237
+ )(response, req, { extraFields: responseFields });
238
+ if (!result.ok) {
239
+ return [result, { status: "complete", request: req, response }];
240
+ }
241
+
242
+ return [result, { status: "complete", request: req, response }];
243
+ }
@@ -117,6 +117,18 @@ async function $do(
117
117
  || "application/octet-stream";
118
118
  const blob = new Blob([buffer], { type: contentType });
119
119
  appendForm(body, "file", blob, payload.RequestBody.file.fileName);
120
+ } else if (payload.RequestBody.file.content instanceof Uint8Array) {
121
+ const contentType =
122
+ getContentTypeFromFileName(payload.RequestBody.file.fileName)
123
+ || "application/octet-stream";
124
+ appendForm(
125
+ body,
126
+ "file",
127
+ new Blob([new Uint8Array(payload.RequestBody.file.content).buffer], {
128
+ type: contentType,
129
+ }),
130
+ payload.RequestBody.file.fileName,
131
+ );
120
132
  } else {
121
133
  const contentType =
122
134
  getContentTypeFromFileName(payload.RequestBody.file.fileName)
@@ -105,7 +105,7 @@ async function $do(
105
105
  const payload = parsed.value;
106
106
  const body = new FormData();
107
107
 
108
- for (const fileItem of payload.RequestBody.files) {
108
+ for (const fileItem of payload.RequestBody.files ?? []) {
109
109
  if (isBlobLike(fileItem)) {
110
110
  appendForm(body, "files[]", fileItem);
111
111
  } else if (isReadableStream(fileItem.content)) {
@@ -114,6 +114,17 @@ async function $do(
114
114
  || "application/octet-stream";
115
115
  const blob = new Blob([buffer], { type: contentType });
116
116
  appendForm(body, "files[]", blob, fileItem.fileName);
117
+ } else if (fileItem.content instanceof Uint8Array) {
118
+ const contentType = getContentTypeFromFileName(fileItem.fileName)
119
+ || "application/octet-stream";
120
+ appendForm(
121
+ body,
122
+ "files[]",
123
+ new Blob([new Uint8Array(fileItem.content).buffer], {
124
+ type: contentType,
125
+ }),
126
+ fileItem.fileName,
127
+ );
117
128
  } else {
118
129
  const contentType = getContentTypeFromFileName(fileItem.fileName)
119
130
  || "application/octet-stream";
package/src/lib/config.ts CHANGED
@@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
58
58
 
59
59
  export const SDK_METADATA = {
60
60
  language: "typescript",
61
- openapiDocVersion: "3.13.0",
62
- sdkVersion: "3.14.0",
63
- genVersion: "2.836.5",
64
- userAgent: "speakeasy-sdk/typescript 3.14.0 2.836.5 3.13.0 @novu/api",
61
+ openapiDocVersion: "3.14.0",
62
+ sdkVersion: "3.14.1",
63
+ genVersion: "2.849.8",
64
+ userAgent: "speakeasy-sdk/typescript 3.14.1 2.849.8 3.14.0 @novu/api",
65
65
  } as const;
@@ -248,8 +248,9 @@ export function match<T, E>(
248
248
  raw = body;
249
249
  break;
250
250
  default:
251
- encoding satisfies never;
252
- throw new Error(`Unsupported response type: ${encoding}`);
251
+ throw new Error(
252
+ `Unsupported response type: ${encoding satisfies never}`,
253
+ );
253
254
  }
254
255
 
255
256
  if (matcher.enc === "fail") {
@@ -197,8 +197,7 @@ export function resolveSecurity(
197
197
  applyBearer(state, spec);
198
198
  break;
199
199
  default:
200
- spec satisfies never;
201
- throw SecurityError.unrecognizedType(type);
200
+ throw SecurityError.unrecognizedType((spec satisfies never, type));
202
201
  }
203
202
  });
204
203
 
@@ -84,6 +84,10 @@ export type ChatStepResponseDto = {
84
84
  * Issues associated with the step
85
85
  */
86
86
  issues?: StepIssuesDto | undefined;
87
+ /**
88
+ * Hash identifying the deployed Cloudflare Worker for this step
89
+ */
90
+ stepResolverHash?: string | undefined;
87
91
  };
88
92
 
89
93
  /** @internal */
@@ -129,6 +133,7 @@ export const ChatStepResponseDto$inboundSchema: z.ZodType<
129
133
  workflowId: z.string(),
130
134
  workflowDatabaseId: z.string(),
131
135
  issues: StepIssuesDto$inboundSchema.optional(),
136
+ stepResolverHash: z.string().optional(),
132
137
  }).transform((v) => {
133
138
  return remap$(v, {
134
139
  "_id": "id",
@@ -80,6 +80,10 @@ export type CustomStepResponseDto = {
80
80
  * Issues associated with the step
81
81
  */
82
82
  issues?: StepIssuesDto | undefined;
83
+ /**
84
+ * Hash identifying the deployed Cloudflare Worker for this step
85
+ */
86
+ stepResolverHash?: string | undefined;
83
87
  };
84
88
 
85
89
  /** @internal */
@@ -125,6 +129,7 @@ export const CustomStepResponseDto$inboundSchema: z.ZodType<
125
129
  workflowId: z.string(),
126
130
  workflowDatabaseId: z.string(),
127
131
  issues: StepIssuesDto$inboundSchema.optional(),
132
+ stepResolverHash: z.string().optional(),
128
133
  }).transform((v) => {
129
134
  return remap$(v, {
130
135
  "_id": "id",
@@ -129,6 +129,10 @@ export type DelayStepResponseDto = {
129
129
  * Issues associated with the step
130
130
  */
131
131
  issues?: StepIssuesDto | undefined;
132
+ /**
133
+ * Hash identifying the deployed Cloudflare Worker for this step
134
+ */
135
+ stepResolverHash?: string | undefined;
132
136
  };
133
137
 
134
138
  /** @internal */
@@ -187,6 +191,7 @@ export const DelayStepResponseDto$inboundSchema: z.ZodType<
187
191
  workflowId: z.string(),
188
192
  workflowDatabaseId: z.string(),
189
193
  issues: StepIssuesDto$inboundSchema.optional(),
194
+ stepResolverHash: z.string().optional(),
190
195
  }).transform((v) => {
191
196
  return remap$(v, {
192
197
  "_id": "id",
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Reason for the dependency
10
+ */
11
+ export const DependencyReasonEnum = {
12
+ LayoutRequiredForWorkflow: "LAYOUT_REQUIRED_FOR_WORKFLOW",
13
+ LayoutExistsInTarget: "LAYOUT_EXISTS_IN_TARGET",
14
+ } as const;
15
+ /**
16
+ * Reason for the dependency
17
+ */
18
+ export type DependencyReasonEnum = ClosedEnum<typeof DependencyReasonEnum>;
19
+
20
+ /** @internal */
21
+ export const DependencyReasonEnum$inboundSchema: z.ZodNativeEnum<
22
+ typeof DependencyReasonEnum
23
+ > = z.nativeEnum(DependencyReasonEnum);
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Type of change
10
+ */
11
+ export const DiffActionEnum = {
12
+ Added: "added",
13
+ Modified: "modified",
14
+ Deleted: "deleted",
15
+ Unchanged: "unchanged",
16
+ Moved: "moved",
17
+ } as const;
18
+ /**
19
+ * Type of change
20
+ */
21
+ export type DiffActionEnum = ClosedEnum<typeof DiffActionEnum>;
22
+
23
+ /** @internal */
24
+ export const DiffActionEnum$inboundSchema: z.ZodNativeEnum<
25
+ typeof DiffActionEnum
26
+ > = z.nativeEnum(DiffActionEnum);
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type DiffEnvironmentRequestDto = {
8
+ /**
9
+ * Source environment ID to compare from. Defaults to the Development environment if not provided.
10
+ */
11
+ sourceEnvironmentId?: string | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export type DiffEnvironmentRequestDto$Outbound = {
16
+ sourceEnvironmentId?: string | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const DiffEnvironmentRequestDto$outboundSchema: z.ZodType<
21
+ DiffEnvironmentRequestDto$Outbound,
22
+ z.ZodTypeDef,
23
+ DiffEnvironmentRequestDto
24
+ > = z.object({
25
+ sourceEnvironmentId: z.string().optional(),
26
+ });
27
+
28
+ export function diffEnvironmentRequestDtoToJSON(
29
+ diffEnvironmentRequestDto: DiffEnvironmentRequestDto,
30
+ ): string {
31
+ return JSON.stringify(
32
+ DiffEnvironmentRequestDto$outboundSchema.parse(diffEnvironmentRequestDto),
33
+ );
34
+ }
@@ -0,0 +1,57 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ EnvironmentDiffSummaryDto,
11
+ EnvironmentDiffSummaryDto$inboundSchema,
12
+ } from "./environmentdiffsummarydto.js";
13
+ import {
14
+ ResourceDiffResultDto,
15
+ ResourceDiffResultDto$inboundSchema,
16
+ } from "./resourcediffresultdto.js";
17
+
18
+ export type DiffEnvironmentResponseDto = {
19
+ /**
20
+ * Source environment ID
21
+ */
22
+ sourceEnvironmentId: string;
23
+ /**
24
+ * Target environment ID
25
+ */
26
+ targetEnvironmentId: string;
27
+ /**
28
+ * Diff resources by resource type
29
+ */
30
+ resources: Array<ResourceDiffResultDto>;
31
+ /**
32
+ * Overall summary
33
+ */
34
+ summary: EnvironmentDiffSummaryDto;
35
+ };
36
+
37
+ /** @internal */
38
+ export const DiffEnvironmentResponseDto$inboundSchema: z.ZodType<
39
+ DiffEnvironmentResponseDto,
40
+ z.ZodTypeDef,
41
+ unknown
42
+ > = z.object({
43
+ sourceEnvironmentId: z.string(),
44
+ targetEnvironmentId: z.string(),
45
+ resources: z.array(ResourceDiffResultDto$inboundSchema),
46
+ summary: EnvironmentDiffSummaryDto$inboundSchema,
47
+ });
48
+
49
+ export function diffEnvironmentResponseDtoFromJSON(
50
+ jsonString: string,
51
+ ): SafeParseResult<DiffEnvironmentResponseDto, SDKValidationError> {
52
+ return safeParse(
53
+ jsonString,
54
+ (x) => DiffEnvironmentResponseDto$inboundSchema.parse(JSON.parse(x)),
55
+ `Failed to parse 'DiffEnvironmentResponseDto' from JSON`,
56
+ );
57
+ }
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type DiffSummaryDto = {
11
+ /**
12
+ * Number of added resources (workflows and steps)
13
+ */
14
+ added: number;
15
+ /**
16
+ * Number of modified resources (workflows and steps)
17
+ */
18
+ modified: number;
19
+ /**
20
+ * Number of deleted resources (workflows and steps)
21
+ */
22
+ deleted: number;
23
+ /**
24
+ * Number of unchanged resources (workflows and steps)
25
+ */
26
+ unchanged: number;
27
+ };
28
+
29
+ /** @internal */
30
+ export const DiffSummaryDto$inboundSchema: z.ZodType<
31
+ DiffSummaryDto,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ added: z.number(),
36
+ modified: z.number(),
37
+ deleted: z.number(),
38
+ unchanged: z.number(),
39
+ });
40
+
41
+ export function diffSummaryDtoFromJSON(
42
+ jsonString: string,
43
+ ): SafeParseResult<DiffSummaryDto, SDKValidationError> {
44
+ return safeParse(
45
+ jsonString,
46
+ (x) => DiffSummaryDto$inboundSchema.parse(JSON.parse(x)),
47
+ `Failed to parse 'DiffSummaryDto' from JSON`,
48
+ );
49
+ }
@@ -141,6 +141,10 @@ export type DigestStepResponseDto = {
141
141
  * Issues associated with the step
142
142
  */
143
143
  issues?: StepIssuesDto | undefined;
144
+ /**
145
+ * Hash identifying the deployed Cloudflare Worker for this step
146
+ */
147
+ stepResolverHash?: string | undefined;
144
148
  };
145
149
 
146
150
  /** @internal */
@@ -202,6 +206,7 @@ export const DigestStepResponseDto$inboundSchema: z.ZodType<
202
206
  workflowId: z.string(),
203
207
  workflowDatabaseId: z.string(),
204
208
  issues: StepIssuesDto$inboundSchema.optional(),
209
+ stepResolverHash: z.string().optional(),
205
210
  }).transform((v) => {
206
211
  return remap$(v, {
207
212
  "_id": "id",
@@ -22,6 +22,18 @@ export type EmailControlDtoEditorType = ClosedEnum<
22
22
  typeof EmailControlDtoEditorType
23
23
  >;
24
24
 
25
+ /**
26
+ * Type of renderer to use (raw HTML or React Email step resolver)
27
+ */
28
+ export const RendererType = {
29
+ Html: "html",
30
+ ReactEmail: "react-email",
31
+ } as const;
32
+ /**
33
+ * Type of renderer to use (raw HTML or React Email step resolver)
34
+ */
35
+ export type RendererType = ClosedEnum<typeof RendererType>;
36
+
25
37
  export type EmailControlDto = {
26
38
  /**
27
39
  * 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.
@@ -39,6 +51,10 @@ export type EmailControlDto = {
39
51
  * Type of editor to use for the body.
40
52
  */
41
53
  editorType?: EmailControlDtoEditorType | undefined;
54
+ /**
55
+ * Type of renderer to use (raw HTML or React Email step resolver)
56
+ */
57
+ rendererType?: RendererType | undefined;
42
58
  /**
43
59
  * Disable sanitization of the output.
44
60
  */
@@ -58,6 +74,13 @@ export const EmailControlDtoEditorType$outboundSchema: z.ZodNativeEnum<
58
74
  typeof EmailControlDtoEditorType
59
75
  > = EmailControlDtoEditorType$inboundSchema;
60
76
 
77
+ /** @internal */
78
+ export const RendererType$inboundSchema: z.ZodNativeEnum<typeof RendererType> =
79
+ z.nativeEnum(RendererType);
80
+ /** @internal */
81
+ export const RendererType$outboundSchema: z.ZodNativeEnum<typeof RendererType> =
82
+ RendererType$inboundSchema;
83
+
61
84
  /** @internal */
62
85
  export const EmailControlDto$inboundSchema: z.ZodType<
63
86
  EmailControlDto,
@@ -68,6 +91,7 @@ export const EmailControlDto$inboundSchema: z.ZodType<
68
91
  subject: z.string(),
69
92
  body: z.string().default(""),
70
93
  editorType: EmailControlDtoEditorType$inboundSchema.default("block"),
94
+ rendererType: RendererType$inboundSchema.default("html"),
71
95
  disableOutputSanitization: z.boolean().default(false),
72
96
  layoutId: z.nullable(z.string()).optional(),
73
97
  });
@@ -77,6 +101,7 @@ export type EmailControlDto$Outbound = {
77
101
  subject: string;
78
102
  body: string;
79
103
  editorType: string;
104
+ rendererType: string;
80
105
  disableOutputSanitization: boolean;
81
106
  layoutId?: string | null | undefined;
82
107
  };
@@ -91,6 +116,7 @@ export const EmailControlDto$outboundSchema: z.ZodType<
91
116
  subject: z.string(),
92
117
  body: z.string().default(""),
93
118
  editorType: EmailControlDtoEditorType$outboundSchema.default("block"),
119
+ rendererType: RendererType$outboundSchema.default("html"),
94
120
  disableOutputSanitization: z.boolean().default(false),
95
121
  layoutId: z.nullable(z.string()).optional(),
96
122
  });