@flowrunner/cli 0.1.15 → 0.1.16
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/ai-docs/instructions/service-code-format/02-zod-types.md +59 -15
- package/ai-docs/instructions/service-code-format/16-gotchas.md +4 -0
- package/dist/cli.js +57 -8
- package/dist/cli.js.map +2 -2
- package/dist/index.js +56 -7
- package/dist/index.js.map +2 -2
- package/dist/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +9 -4
- package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +12 -0
- package/package.json +1 -1
- package/runtime/index.js +56 -7
- package/runtime/index.js.map +2 -2
- package/runtime/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +9 -4
- package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +12 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type AnyZod } from './introspect';
|
|
2
2
|
export type AbsencePolicy = 'as-received' | 'undefined' | 'null' | 'required';
|
|
3
|
+
export interface Absence {
|
|
4
|
+
absence: AbsencePolicy;
|
|
5
|
+
absorbsBlank: boolean;
|
|
6
|
+
keepsEmpty: boolean;
|
|
7
|
+
blankIsValue: boolean;
|
|
8
|
+
}
|
|
3
9
|
export interface FieldPlan {
|
|
4
10
|
name: string;
|
|
5
11
|
schema: AnyZod;
|
|
@@ -16,6 +22,8 @@ export interface FieldPlan {
|
|
|
16
22
|
isUnion: boolean;
|
|
17
23
|
absence: AbsencePolicy;
|
|
18
24
|
absorbsBlank: boolean;
|
|
25
|
+
keepsEmpty: boolean;
|
|
26
|
+
blankIsValue: boolean;
|
|
19
27
|
/**
|
|
20
28
|
* True for a `z.date()` whose value must reach the handler UNCHANGED — validated through a converted copy,
|
|
21
29
|
* handed over as the host sent it. False for `z.coerce.date()`, which the author asked to convert.
|
|
@@ -26,8 +34,5 @@ export interface FieldPlan {
|
|
|
26
34
|
restoresDates: boolean;
|
|
27
35
|
}
|
|
28
36
|
/** The absent forms a schema accepts, at any depth. Same question `planField` asks for a top-level field. */
|
|
29
|
-
export declare function absenceOf(schema: AnyZod | undefined):
|
|
30
|
-
absence: AbsencePolicy;
|
|
31
|
-
absorbsBlank: boolean;
|
|
32
|
-
};
|
|
37
|
+
export declare function absenceOf(schema: AnyZod | undefined): Absence;
|
|
33
38
|
export declare function planField(name: string, schema: AnyZod): FieldPlan;
|
|
@@ -83,6 +83,18 @@ declare module 'zod' {
|
|
|
83
83
|
/** @deprecated Inverted and renamed — see `labels`. Throws, so the change cannot pass silently. */
|
|
84
84
|
map(mapping: Record<string, unknown>): never;
|
|
85
85
|
}
|
|
86
|
+
interface ZodUnknown {
|
|
87
|
+
/**
|
|
88
|
+
* Mark the field required — the same as zod's `.nonoptional()`. `z.unknown()` is optional unless marked;
|
|
89
|
+
* `z.unknown().required()` takes any value (text, number, boolean, `null`, an object, a list, a date) but
|
|
90
|
+
* refuses a missing one.
|
|
91
|
+
*/
|
|
92
|
+
required(): this;
|
|
93
|
+
}
|
|
94
|
+
interface ZodAny {
|
|
95
|
+
/** Mark the field required — see `ZodUnknown.required`. */
|
|
96
|
+
required(): this;
|
|
97
|
+
}
|
|
86
98
|
}
|
|
87
99
|
declare function text(): baseZod.ZodString;
|
|
88
100
|
/**
|