@voltro/testing 0.69.1 → 0.71.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/CHANGELOG.md +1369 -111
- package/dist/dialect.js +642 -363
- package/dist/index.d.ts +25 -0
- package/dist/index.js +178 -156
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { Layer } from 'effect';
|
|
|
15
15
|
import { ParseResult } from 'effect';
|
|
16
16
|
import { ProcedureDescriptor } from '@voltro/protocol';
|
|
17
17
|
import { PublicApiDescriptor } from '@voltro/protocol/rest';
|
|
18
|
+
import { PublicApiProfileConfig } from '@voltro/protocol';
|
|
19
|
+
import { PublicApiSpec } from '@voltro/protocol';
|
|
18
20
|
import { RelationsSpec } from '@voltro/database';
|
|
19
21
|
import { RestRouteDescriptor } from '@voltro/protocol/rest';
|
|
20
22
|
import { RestServeBindings } from '@voltro/protocol/rest';
|
|
@@ -344,6 +346,9 @@ export declare interface MakeTestAppOptions {
|
|
|
344
346
|
/** HTTP idempotency binding — the same `{ store, header, ttlMs }` the serve
|
|
345
347
|
* path builds from `app.config.ts`'s `idempotency` field. */
|
|
346
348
|
readonly idempotency?: RestServeBindings['idempotency'];
|
|
349
|
+
/** The api's `publicApi:` config — the REST profile the projections speak,
|
|
350
|
+
* the same object `app.config.ts` declares. Absent → `'rpc'`. */
|
|
351
|
+
readonly publicApiProfile?: PublicApiProfileConfig;
|
|
347
352
|
}
|
|
348
353
|
|
|
349
354
|
export declare const makeTestContext: <RowFilterCtx = unknown>(options?: MakeTestContextOptions<RowFilterCtx>) => TestContext;
|
|
@@ -417,6 +422,15 @@ export declare interface MakeTestContextOptions<RowFilterCtx = unknown> {
|
|
|
417
422
|
* test harness never runs the real boot gate. Merged OVER `process.env`
|
|
418
423
|
* (these win). Default: just the ambient `process.env`. */
|
|
419
424
|
readonly env?: Record<string, string | undefined>;
|
|
425
|
+
/**
|
|
426
|
+
* The key for `.encrypted()` columns under test. Registers the field cipher
|
|
427
|
+
* the boot would derive from `VOLTRO_FIELD_ENCRYPTION_KEY`, so a handler that
|
|
428
|
+
* writes such a column runs here instead of failing with "no field cipher is
|
|
429
|
+
* registered". Process-global like the boot's (`setFieldCipher`), and left
|
|
430
|
+
* alone when omitted — `env` alone does NOT do this: the harness runs no boot
|
|
431
|
+
* gate, and the gate is what turns the variable into a cipher.
|
|
432
|
+
*/
|
|
433
|
+
readonly fieldEncryptionKey?: string;
|
|
420
434
|
/**
|
|
421
435
|
* Plugins whose rpc interceptors (`interceptMutation` / `interceptQuery` /
|
|
422
436
|
* `interceptAction`) wrap every `invoke` on this context — the same list an
|
|
@@ -491,6 +505,8 @@ export declare interface MakeWorkflowRunnerOptions {
|
|
|
491
505
|
readonly workflows?: ReadonlyArray<WorkflowEntry>;
|
|
492
506
|
}
|
|
493
507
|
|
|
508
|
+
export declare const markRestInvocation: (ctx: TestContext, publicApi: PublicApiSpec) => void;
|
|
509
|
+
|
|
494
510
|
/** Minimal AI mock surface. The full `mockAi({...})` helper is owned by
|
|
495
511
|
* the AI package (plan 05); typed here as an optional injected interface
|
|
496
512
|
* so `@voltro/testing` carries no hard `@voltro/ai` dependency. */
|
|
@@ -601,6 +617,11 @@ export declare const outboxNudgesOf: (ctx: TestContext) => ReadonlyArray<string>
|
|
|
601
617
|
|
|
602
618
|
export { ParseResult }
|
|
603
619
|
|
|
620
|
+
/** The plugins a context was built with — for the REST harness, which hands
|
|
621
|
+
* their cross-cutting errors to the `publicApi` projection the way both boot
|
|
622
|
+
* paths do. */
|
|
623
|
+
export declare const pluginsOf: (ctx: TestContext) => ReadonlyArray<VoltroPlugin>;
|
|
624
|
+
|
|
604
625
|
/** Any procedure executor: takes the DECODED input + a context, returns a
|
|
605
626
|
* result — sync, `Promise`, or `Effect`. Mirrors the `(input, ctx) => …` shape
|
|
606
627
|
* a real query / mutation / action handler has, INCLUDING the Effect form: the
|
|
@@ -669,6 +690,10 @@ export declare const reportEngineVersion: (label: string, probe: () => Promise<s
|
|
|
669
690
|
*/
|
|
670
691
|
export declare const resetAfterCommit: (ctx: TestContext) => void;
|
|
671
692
|
|
|
693
|
+
export declare const restInvocationOf: (ctx: TestContext) => {
|
|
694
|
+
readonly publicApi: PublicApiSpec;
|
|
695
|
+
} | undefined;
|
|
696
|
+
|
|
672
697
|
export { Row }
|
|
673
698
|
|
|
674
699
|
/**
|