@turbofy-ai/app-runtime 0.0.23 → 0.0.24

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.
package/dist/src/dsl.d.ts CHANGED
@@ -1798,6 +1798,20 @@ declare const webhookConfigSchema: z.ZodObject<{
1798
1798
  z.ZodObject<{
1799
1799
  type: z.ZodLiteral<"stripe">;
1800
1800
  secretId: z.ZodString;
1801
+ }, z.core.$strict>,
1802
+ z.ZodObject<{
1803
+ type: z.ZodLiteral<"payload-checksum">;
1804
+ secretId: z.ZodString;
1805
+ checksumField: z.ZodString;
1806
+ fields: z.ZodArray<z.ZodString>;
1807
+ secretPosition: z.ZodOptional<z.ZodEnum<{
1808
+ append: "append";
1809
+ prepend: "prepend";
1810
+ }>>;
1811
+ secretTransform: z.ZodOptional<z.ZodEnum<{
1812
+ reverse: "reverse";
1813
+ none: "none";
1814
+ }>>;
1801
1815
  }, z.core.$strict>
1802
1816
  ], "type">;
1803
1817
  bodyFormat: z.ZodOptional<z.ZodEnum<{
package/dist/src/dsl.js CHANGED
@@ -16162,6 +16162,7 @@ function hasScheduleExpression(config2) {
16162
16162
  // ../declarations/src/flows/webhook.ts
16163
16163
  var secretId = external_exports.string().regex(/^[A-Za-z0-9_-]{1,128}$/);
16164
16164
  var headerName = external_exports.string().regex(/^[a-z0-9-]{1,64}$/);
16165
+ var jsonPath = external_exports.string().regex(/^[A-Za-z0-9_-]{1,64}(\.[A-Za-z0-9_-]{1,64}){0,9}$/);
16165
16166
  var webhookConfigSchema = external_exports.object({
16166
16167
  verification: external_exports.discriminatedUnion("type", [
16167
16168
  external_exports.object({ type: external_exports.literal("bearer"), secretId }).strict(),
@@ -16171,7 +16172,22 @@ var webhookConfigSchema = external_exports.object({
16171
16172
  header: headerName,
16172
16173
  prefix: external_exports.string().max(32).optional()
16173
16174
  }).strict(),
16174
- external_exports.object({ type: external_exports.literal("stripe"), secretId }).strict()
16175
+ external_exports.object({ type: external_exports.literal("stripe"), secretId }).strict(),
16176
+ external_exports.object({
16177
+ type: external_exports.literal("payload-checksum"),
16178
+ secretId,
16179
+ /** Dot path of the checksum inside the JSON body, e.g. "event.checksum". */
16180
+ checksumField: jsonPath,
16181
+ /**
16182
+ * Dot paths concatenated in order. A missing or null field fails
16183
+ * verification unless the path ends with "?", which skips it.
16184
+ */
16185
+ fields: external_exports.array(
16186
+ external_exports.string().regex(/^[A-Za-z0-9_-]{1,64}(\.[A-Za-z0-9_-]{1,64}){0,9}\??$/)
16187
+ ).min(1).max(20),
16188
+ secretPosition: external_exports.enum(["append", "prepend"]).optional(),
16189
+ secretTransform: external_exports.enum(["none", "reverse"]).optional()
16190
+ }).strict()
16175
16191
  ]),
16176
16192
  bodyFormat: external_exports.enum(["json", "text"]).optional(),
16177
16193
  forwardHeaders: external_exports.array(headerName).max(20).optional()
@@ -16197,6 +16213,21 @@ var webhookConfigSchema = external_exports.object({
16197
16213
  message: "Stripe requires JSON"
16198
16214
  });
16199
16215
  }
16216
+ if (config2.verification.type === "payload-checksum") {
16217
+ if (config2.bodyFormat === "text") {
16218
+ ctx.addIssue({
16219
+ code: "custom",
16220
+ message: "Payload checksum requires JSON"
16221
+ });
16222
+ }
16223
+ const { checksumField, fields: fields2 } = config2.verification;
16224
+ if (fields2.some((field2) => field2.replace(/\?$/, "") === checksumField)) {
16225
+ ctx.addIssue({
16226
+ code: "custom",
16227
+ message: "The checksum field cannot be part of the signed fields"
16228
+ });
16229
+ }
16230
+ }
16200
16231
  });
16201
16232
 
16202
16233
  // ../declarations/src/flows/branch.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbofy-ai/app-runtime",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {