@ripplo/testing 0.3.10 → 0.4.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.
package/dist/assert.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-Do4o4Y_c.js';
1
+ import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-B7YljrTz.js';
2
2
  import { Variable, StaticStringRef, VariableRef } from './control.js';
3
3
  import { U as UnlabeledStep } from './step-De52hTLd.js';
4
4
  import { CheckLocator, AnyLocator } from './locators.js';
5
- import 'zod';
6
5
  import '@ripplo/spec';
7
6
 
8
7
  type StringOrVariable = string | Variable<string>;
package/dist/assert.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readObserverBudget,
3
3
  readObserverName
4
- } from "./chunk-D7DRM7AG.js";
4
+ } from "./chunk-SBZJDJP4.js";
5
5
  import {
6
6
  toSpecLocator,
7
7
  toStringValueRef
@@ -1,4 +1,4 @@
1
- import { O as ObserverHandle, P as Precondition, l as PreconditionData, j as TestDefinition, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, f as ObserverContext, h as ObserverOutcome, S as SetupContext, m as TestValue, T as TeardownContext, n as UserDslConfig } from './types-Do4o4Y_c.js';
1
+ import { O as ObserverHandle, P as Precondition, k as PreconditionData, i as TestDefinition, f as ObserverDefinition, j as PreconditionDefinition, U as UnimplementedItems, e as ObserverContext, g as ObserverOutcome, S as SetupContext, l as TestValue, T as TeardownContext } from './types-B7YljrTz.js';
2
2
  import { ObserverBudget } from '@ripplo/spec';
3
3
  import { S as Step } from './step-De52hTLd.js';
4
4
 
@@ -106,11 +106,9 @@ interface RipploRegistries<P extends PreconditionRegistry, O extends ObserverReg
106
106
  readonly tests: ReadonlyArray<TestDefinition>;
107
107
  }
108
108
  interface RipploInstance<P extends PreconditionRegistry = PreconditionRegistry, O extends ObserverRegistry = ObserverRegistry> {
109
- readonly config: DslConfig;
110
109
  readonly observers: O;
111
110
  readonly preconditions: P;
112
111
  readonly tests: ReadonlyArray<TestDefinition>;
113
- readonly getConfig: () => DslConfig;
114
112
  readonly getObservers: () => ReadonlyArray<ObserverDefinition>;
115
113
  readonly getPreconditions: () => ReadonlyArray<PreconditionDefinition>;
116
114
  readonly getTests: () => ReadonlyArray<TestDefinition>;
@@ -146,6 +144,6 @@ declare function test(id: string, options?: TestOptions): TestNeedsName;
146
144
  * `.ripplo/ripplo.lock`) and by `createEngine` on the server, where
147
145
  * TypeScript exhaustiveness-checks that every handle has exactly one impl.
148
146
  */
149
- declare function createRipplo<P extends PreconditionRegistry, O extends ObserverRegistry>(rawConfig: UserDslConfig, registries: RipploRegistries<P, O>): RipploInstance<P, O>;
147
+ declare function createRipplo<P extends PreconditionRegistry, O extends ObserverRegistry>(registries: RipploRegistries<P, O>): RipploInstance<P, O>;
150
148
 
151
149
  export { type CoverageRegistry as C, type ObserverImplFn as O, type PreconditionImpl as P, type ResolveDeps as R, type ObserverRegistry as a, type PreconditionRecord as b, type PreconditionRegistry as c, type RipploBuilder as d, type RipploInstance as e, type RipploRegistries as f, createRipplo as g, observer as o, precondition as p, test as t };
@@ -25,7 +25,7 @@ function compile(ripplo) {
25
25
  };
26
26
  });
27
27
  const tests = testDefs.map((def) => compileTest(def, preconditionDefs));
28
- return { config: ripplo.getConfig(), observers, preconditions, tests };
28
+ return { observers, preconditions, tests };
29
29
  }
30
30
  function validateUniqueIds(defs) {
31
31
  const seen = /* @__PURE__ */ new Map();
@@ -1,5 +1,4 @@
1
1
  // src/types.ts
2
- import { z } from "zod";
3
2
  var DEFAULT_WATCH_PATHS = [
4
3
  "**/src/**",
5
4
  "**/app/**",
@@ -60,17 +59,6 @@ var DEFAULT_IGNORE_PATHS = [
60
59
  "**/prisma/migrations/**",
61
60
  "**/scripts/**"
62
61
  ];
63
- var dslConfigSchema = z.object({
64
- appUrl: z.string(),
65
- engineUrl: z.string(),
66
- ignorePaths: z.array(z.string()).optional(),
67
- projectId: z.string(),
68
- watchPaths: z.array(z.string()).optional(),
69
- webhookSecret: z.string()
70
- });
71
- var userDslConfigSchema = dslConfigSchema.extend({
72
- webhookSecret: z.string().optional()
73
- });
74
62
  function readTestValue(value) {
75
63
  return value.value;
76
64
  }
@@ -109,7 +97,6 @@ function makeObserverHandle({
109
97
  export {
110
98
  DEFAULT_WATCH_PATHS,
111
99
  DEFAULT_IGNORE_PATHS,
112
- userDslConfigSchema,
113
100
  readTestValue,
114
101
  createTestValue,
115
102
  readPreconditionName,
@@ -1,6 +1,15 @@
1
1
  // src/adapters/shared.ts
2
2
  import { Webhook, WebhookVerificationError } from "standardwebhooks";
3
3
  import { z } from "zod";
4
+ function readAdapterWebhookSecret() {
5
+ const value = process.env.RIPPLO_WEBHOOK_SECRET;
6
+ if (value == null || value.length === 0) {
7
+ throw new Error(
8
+ "ripplo: RIPPLO_WEBHOOK_SECRET is not set. The adapter needs it to verify precondition calls. Run `ripplo init` to generate one, or unset `enabled` to disable the adapter."
9
+ );
10
+ }
11
+ return value;
12
+ }
4
13
  var batchRequestSchema = z.object({
5
14
  preconditions: z.array(z.string().min(1))
6
15
  });
@@ -75,6 +84,7 @@ function buildSetCookieHeader(cookie) {
75
84
  }
76
85
 
77
86
  export {
87
+ readAdapterWebhookSecret,
78
88
  batchRequestSchema,
79
89
  teardownRequestSchema,
80
90
  observerRequestSchema,
@@ -1,11 +1,9 @@
1
1
  import { Observer, Precondition, WorkflowSpec } from '@ripplo/spec';
2
- import { d as RipploBuilder } from './builder-CkyzxH7O.js';
3
- import { e as DslConfig } from './types-Do4o4Y_c.js';
2
+ import { d as RipploBuilder } from './builder-0oT23S0W.js';
3
+ import './types-B7YljrTz.js';
4
4
  import './step-De52hTLd.js';
5
- import 'zod';
6
5
 
7
6
  interface CompileResult {
8
- readonly config: DslConfig;
9
7
  readonly observers: Record<string, Observer>;
10
8
  readonly preconditions: Record<string, Precondition>;
11
9
  readonly tests: ReadonlyArray<CompiledTest>;
package/dist/compiler.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compile
3
- } from "./chunk-5AGV4KQA.js";
3
+ } from "./chunk-GWSEDWEF.js";
4
4
  import "./chunk-MGATMMCZ.js";
5
5
  import "./chunk-4MGIQFAJ.js";
6
6
  export {
package/dist/elysia.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Elysia } from 'elysia';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/elysia.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import "./chunk-4MGIQFAJ.js";
10
11
 
11
12
  // src/adapters/elysia.ts
@@ -18,7 +19,7 @@ function build({ enabled, engine }) {
18
19
  if (!enabled) {
19
20
  return app.put("/execute-preconditions", () => notFoundResponse()).put("/execute-observer", () => notFoundResponse()).put("/teardown-preconditions", () => notFoundResponse());
20
21
  }
21
- const webhookSecret = engine.getConfig().webhookSecret;
22
+ const webhookSecret = readAdapterWebhookSecret();
22
23
  return app.put("/execute-preconditions", async ({ request }) => {
23
24
  const gate = await verifyAndReadBody(request, webhookSecret);
24
25
  if ("response" in gate) {
@@ -1,5 +1,5 @@
1
- import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-CkyzxH7O.js';
2
- import { h as ObserverOutcome, C as CookieEntry, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-Do4o4Y_c.js';
1
+ import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-0oT23S0W.js';
2
+ import { g as ObserverOutcome, C as CookieEntry, f as ObserverDefinition, j as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-B7YljrTz.js';
3
3
 
4
4
  interface EngineResult {
5
5
  readonly cookies: ReadonlyArray<CookieEntry>;
@@ -20,7 +20,6 @@ interface ObserverExecutionResult {
20
20
  interface RipploEngine {
21
21
  readonly executeObserver: (name: string, params: Record<string, string>) => Promise<ObserverExecutionResult>;
22
22
  readonly executePreconditions: (names: ReadonlyArray<string>, options?: ExecuteBatchOptions) => Promise<EngineResult>;
23
- readonly getConfig: () => DslConfig;
24
23
  readonly getObservers: () => ReadonlyArray<ObserverDefinition>;
25
24
  readonly getPreconditions: () => ReadonlyArray<PreconditionDefinition>;
26
25
  readonly getUnimplemented: () => UnimplementedItems;
package/dist/express.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Router } from 'express';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/express.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  batchRequestSchema,
3
3
  observerRequestSchema,
4
+ readAdapterWebhookSecret,
4
5
  serializeCookie,
5
6
  teardownRequestSchema,
6
7
  verifyWebhookSignature
7
- } from "./chunk-TO3T2D2Y.js";
8
+ } from "./chunk-UFHSNW4E.js";
8
9
  import "./chunk-4MGIQFAJ.js";
9
10
 
10
11
  // src/adapters/express.ts
@@ -14,13 +15,9 @@ function createExpressHandler({ enabled, engine }) {
14
15
  if (!enabled) {
15
16
  return router;
16
17
  }
17
- const webhookSecret = engine.getConfig().webhookSecret;
18
+ const webhookSecret = readAdapterWebhookSecret();
18
19
  router.use(json());
19
20
  router.use((req, res, next) => {
20
- if (webhookSecret.length === 0) {
21
- res.status(403).json({ error: "Webhook secret not configured" });
22
- return;
23
- }
24
21
  const payload = JSON.stringify(req.body);
25
22
  const headers = extractWebhookHeaders(req);
26
23
  if (!verifyWebhookSignature(payload, headers, webhookSecret)) {
package/dist/fastify.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { FastifyInstance } from 'fastify';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/fastify.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import "./chunk-4MGIQFAJ.js";
10
11
 
11
12
  // src/adapters/fastify.ts
@@ -17,12 +18,9 @@ function registerFastifyHandler({
17
18
  return async () => {
18
19
  };
19
20
  }
20
- const webhookSecret = engine.getConfig().webhookSecret;
21
+ const webhookSecret = readAdapterWebhookSecret();
21
22
  return async (fastify) => {
22
23
  fastify.addHook("preHandler", async (req, reply) => {
23
- if (webhookSecret.length === 0) {
24
- return reply.code(403).send({ error: "Webhook secret not configured" });
25
- }
26
24
  const payload = JSON.stringify(req.body);
27
25
  const headers = {
28
26
  "webhook-id": extractHeader(req, "webhook-id"),
package/dist/hono.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Hono } from 'hono';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/hono.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import "./chunk-4MGIQFAJ.js";
10
11
 
11
12
  // src/adapters/hono.ts
@@ -15,7 +16,7 @@ function createHonoHandler({ enabled, engine }) {
15
16
  if (!enabled) {
16
17
  return app;
17
18
  }
18
- const webhookSecret = engine.getConfig().webhookSecret;
19
+ const webhookSecret = readAdapterWebhookSecret();
19
20
  app.use("*", createWebhookMiddleware(webhookSecret));
20
21
  app.put("/execute-preconditions", async (c) => {
21
22
  const body = tryParseJson(c.get("rawBody"));
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- export { C as CoverageRegistry, O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-CkyzxH7O.js';
1
+ export { C as CoverageRegistry, O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-0oT23S0W.js';
2
2
  import { CompileResult } from './compiler.js';
3
3
  export { CompiledTest, compile } from './compiler.js';
4
- export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionImplFor, R as RipploEngine, c as createEngine, n as notImplemented } from './engine-CRq3Az6b.js';
5
- import { C as CookieEntry } from './types-Do4o4Y_c.js';
6
- export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as DslConfig, f as ObserverContext, g as ObserverDefinition, O as ObserverHandle, a as ObserverInput, h as ObserverOutcome, P as Precondition, i as PreconditionDeps, S as SetupContext, T as TeardownContext, j as TestDefinition } from './types-Do4o4Y_c.js';
4
+ export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionImplFor, R as RipploEngine, c as createEngine, n as notImplemented } from './engine-BdKDGBYw.js';
5
+ import { C as CookieEntry } from './types-B7YljrTz.js';
6
+ export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as ObserverContext, f as ObserverDefinition, O as ObserverHandle, a as ObserverInput, g as ObserverOutcome, P as Precondition, h as PreconditionDeps, S as SetupContext, T as TeardownContext, i as TestDefinition } from './types-B7YljrTz.js';
7
7
  export { D as DslNodeInput } from './step-De52hTLd.js';
8
8
  import '@ripplo/spec';
9
- import 'zod';
10
9
 
11
10
  interface LintDiagnostic {
12
11
  readonly message: string;
package/dist/index.js CHANGED
@@ -10,18 +10,17 @@ import {
10
10
  readPreconditionDependsOn,
11
11
  readPreconditionDescription,
12
12
  readPreconditionName,
13
- readTestValue,
14
- userDslConfigSchema
15
- } from "./chunk-D7DRM7AG.js";
13
+ readTestValue
14
+ } from "./chunk-SBZJDJP4.js";
16
15
  import {
17
16
  compile
18
- } from "./chunk-5AGV4KQA.js";
17
+ } from "./chunk-GWSEDWEF.js";
19
18
  import "./chunk-MGATMMCZ.js";
20
19
  import {
21
20
  buildSetCookieHeader,
22
21
  serializeCookie,
23
22
  verifyWebhookSignature
24
- } from "./chunk-TO3T2D2Y.js";
23
+ } from "./chunk-UFHSNW4E.js";
25
24
  import "./chunk-4MGIQFAJ.js";
26
25
 
27
26
  // src/observer.ts
@@ -63,26 +62,16 @@ function test(id, options) {
63
62
  validateTestId(id);
64
63
  return buildTestName(id, options?.uiOnly);
65
64
  }
66
- function createRipplo(rawConfig, registries) {
67
- const parsed = userDslConfigSchema.parse(rawConfig);
68
- const webhookSecret = parsed.webhookSecret ?? process.env["RIPPLO_WEBHOOK_SECRET"] ?? "";
69
- if (webhookSecret.length === 0) {
70
- throw new Error(
71
- "RIPPLO_WEBHOOK_SECRET is required. Set it in .ripplo/.env or pass webhookSecret to createRipplo()."
72
- );
73
- }
74
- const config = { ...parsed, webhookSecret };
65
+ function createRipplo(registries) {
75
66
  const { observers, preconditions, tests } = registries;
76
67
  validateUniqueNames(preconditions, observers, tests);
77
68
  const preconditionDefs = Object.values(preconditions).map((p) => stubPreconditionDef(p));
78
69
  const observerDefs = Object.values(observers).map((o) => stubObserverDef(o));
79
70
  const testDefs = [...tests];
80
71
  return {
81
- config,
82
72
  observers,
83
73
  preconditions,
84
74
  tests: testDefs,
85
- getConfig: () => config,
86
75
  getObservers: () => observerDefs,
87
76
  getPreconditions: () => preconditionDefs,
88
77
  getTests: () => testDefs,
@@ -777,7 +766,6 @@ function createEngine(ripplo, impls) {
777
766
  return {
778
767
  executeObserver: (name, params) => executeObserver(observersByName, name, params),
779
768
  executePreconditions: (names, options) => executePreconditions({ defsByName: preconditionsByName, names, options }),
780
- getConfig: () => ripplo.getConfig(),
781
769
  getObservers: () => observerDefs,
782
770
  getPreconditions: () => preconditionDefs,
783
771
  getUnimplemented: () => ({
package/dist/koa.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Middleware } from 'koa';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/koa.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import "./chunk-4MGIQFAJ.js";
10
11
 
11
12
  // src/adapters/koa.ts
@@ -15,7 +16,7 @@ function createKoaHandler({ enabled, engine }) {
15
16
  await next();
16
17
  };
17
18
  }
18
- const webhookSecret = engine.getConfig().webhookSecret;
19
+ const webhookSecret = readAdapterWebhookSecret();
19
20
  return async (ctx, next) => {
20
21
  if (ctx.method !== "PUT") {
21
22
  await next();
@@ -26,11 +27,6 @@ function createKoaHandler({ enabled, engine }) {
26
27
  await next();
27
28
  return;
28
29
  }
29
- if (webhookSecret.length === 0) {
30
- ctx.status = 403;
31
- ctx.body = { error: "Webhook secret not configured" };
32
- return;
33
- }
34
30
  const body = await readBody(ctx);
35
31
  const headers = {
36
32
  "webhook-id": headerString(ctx.get("webhook-id")),
@@ -1,8 +1,8 @@
1
1
  import { Codec } from '@ripplo/spec';
2
2
  import { z } from 'zod';
3
3
  import { CompileResult } from './compiler.js';
4
- import './builder-CkyzxH7O.js';
5
- import './types-Do4o4Y_c.js';
4
+ import './builder-0oT23S0W.js';
5
+ import './types-B7YljrTz.js';
6
6
  import './step-De52hTLd.js';
7
7
 
8
8
  declare const LOCKFILE_RELATIVE_PATH = ".ripplo/ripplo.lock";
package/dist/nestjs.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { DynamicModule } from '@nestjs/common';
2
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
3
- import './builder-CkyzxH7O.js';
4
- import './types-Do4o4Y_c.js';
5
- import 'zod';
2
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
3
+ import './builder-0oT23S0W.js';
4
+ import './types-B7YljrTz.js';
6
5
  import './step-De52hTLd.js';
7
6
  import '@ripplo/spec';
8
7
 
package/dist/nestjs.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import {
10
11
  __decorateClass,
11
12
  __decorateParam
@@ -118,7 +119,7 @@ function guard(req, res, opts) {
118
119
  res.status(404).json({ error: "Not found" });
119
120
  return false;
120
121
  }
121
- const webhookSecret = opts.engine.getConfig().webhookSecret;
122
+ const webhookSecret = readAdapterWebhookSecret();
122
123
  if (webhookSecret.length === 0) {
123
124
  res.status(403).json({ error: "Webhook secret not configured" });
124
125
  return false;
package/dist/nextjs.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { R as RipploEngine } from './engine-CRq3Az6b.js';
2
- import './builder-CkyzxH7O.js';
3
- import './types-Do4o4Y_c.js';
4
- import 'zod';
1
+ import { R as RipploEngine } from './engine-BdKDGBYw.js';
2
+ import './builder-0oT23S0W.js';
3
+ import './types-B7YljrTz.js';
5
4
  import './step-De52hTLd.js';
6
5
  import '@ripplo/spec';
7
6
 
package/dist/nextjs.js CHANGED
@@ -2,10 +2,11 @@ import {
2
2
  batchRequestSchema,
3
3
  buildSetCookieHeader,
4
4
  observerRequestSchema,
5
+ readAdapterWebhookSecret,
5
6
  serializeCookie,
6
7
  teardownRequestSchema,
7
8
  verifyWebhookSignature
8
- } from "./chunk-TO3T2D2Y.js";
9
+ } from "./chunk-UFHSNW4E.js";
9
10
  import "./chunk-4MGIQFAJ.js";
10
11
 
11
12
  // src/adapters/nextjs.ts
@@ -13,7 +14,7 @@ function createNextHandler({ enabled, engine }) {
13
14
  if (!enabled) {
14
15
  return async () => jsonResponse({ error: "Not found" }, 404);
15
16
  }
16
- const webhookSecret = engine.getConfig().webhookSecret;
17
+ const webhookSecret = readAdapterWebhookSecret();
17
18
  return async function handler(req) {
18
19
  const action = lastPathSegment(req.url);
19
20
  if (action !== "execute-preconditions" && action !== "teardown-preconditions" && action !== "execute-observer") {
@@ -1,26 +1,7 @@
1
- import { z } from 'zod';
2
1
  import { S as Step } from './step-De52hTLd.js';
3
2
 
4
3
  declare const DEFAULT_WATCH_PATHS: ReadonlyArray<string>;
5
4
  declare const DEFAULT_IGNORE_PATHS: ReadonlyArray<string>;
6
- declare const dslConfigSchema: z.ZodObject<{
7
- appUrl: z.ZodString;
8
- engineUrl: z.ZodString;
9
- ignorePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
- projectId: z.ZodString;
11
- watchPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
- webhookSecret: z.ZodString;
13
- }, z.core.$strip>;
14
- type DslConfig = z.infer<typeof dslConfigSchema>;
15
- declare const userDslConfigSchema: z.ZodObject<{
16
- appUrl: z.ZodString;
17
- engineUrl: z.ZodString;
18
- ignorePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- projectId: z.ZodString;
20
- watchPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
- webhookSecret: z.ZodOptional<z.ZodString>;
22
- }, z.core.$strip>;
23
- type UserDslConfig = z.infer<typeof userDslConfigSchema>;
24
5
  interface CookieOptions {
25
6
  readonly domain: string | undefined;
26
7
  readonly expires: number | undefined;
@@ -122,4 +103,4 @@ interface ObserverDefinition {
122
103
  readonly run: (ctx: ObserverContext, params: Record<string, string>) => Promise<ObserverOutcome>;
123
104
  }
124
105
 
125
- export { type CookieEntry as C, DEFAULT_IGNORE_PATHS as D, type ObserverHandle as O, type Precondition as P, type SetupContext as S, type TeardownContext as T, type UnimplementedItems as U, type ObserverInput as a, type ObserverBudgetTier as b, type CookieOptions as c, DEFAULT_WATCH_PATHS as d, type DslConfig as e, type ObserverContext as f, type ObserverDefinition as g, type ObserverOutcome as h, type PreconditionDeps as i, type TestDefinition as j, type PreconditionDefinition as k, type PreconditionData as l, type TestValue as m, type UserDslConfig as n };
106
+ export { type CookieEntry as C, DEFAULT_IGNORE_PATHS as D, type ObserverHandle as O, type Precondition as P, type SetupContext as S, type TeardownContext as T, type UnimplementedItems as U, type ObserverInput as a, type ObserverBudgetTier as b, type CookieOptions as c, DEFAULT_WATCH_PATHS as d, type ObserverContext as e, type ObserverDefinition as f, type ObserverOutcome as g, type PreconditionDeps as h, type TestDefinition as i, type PreconditionDefinition as j, type PreconditionData as k, type TestValue as l };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ripplo/testing",
3
3
  "description": "TypeScript DSL for defining and running Ripplo e2e workflow tests",
4
- "version": "0.3.10",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"