@schemic/core 0.1.0-alpha.1 → 0.1.0-alpha.2
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/lib/authoring.js +2 -0
- package/lib/authoring.js.map +1 -1
- package/lib/{config-TIiKDd9t.d.ts → config-v3H_2lwA.d.ts} +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/{driver-Dh5hLKHm.d.ts → driver-BTaJ2ryZ.d.ts} +2 -2
- package/lib/driver.d.ts +2 -2
- package/lib/index.d.ts +3 -3
- package/lib/testing.d.ts +2 -2
- package/package.json +1 -1
package/lib/authoring.js
CHANGED
|
@@ -6,6 +6,8 @@ var SFieldBase = class {
|
|
|
6
6
|
this.schema = schema;
|
|
7
7
|
this.native = native;
|
|
8
8
|
}
|
|
9
|
+
schema;
|
|
10
|
+
native;
|
|
9
11
|
// --- Field-level codec (raw, on `this.schema`): `decode` reads (wire -> app), `encode` writes
|
|
10
12
|
// (app -> wire). Create-shaping is a table concept, so these are NOT create-shaped. ---
|
|
11
13
|
/** Decode a DB value to its app type (wire -> app). */
|
package/lib/authoring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/authoring.ts"],"sourcesContent":["// The NEUTRAL, dialect-agnostic AUTHORING BASE (docs/AUTHORING-SPLIT.md — \"base builder in core\").\n// Each driver package builds its `s.*` on this: `class <D>Field extends SFieldBase<S, Flags, <D>Meta>`\n// adds the dialect's native authoring (`$`-methods) and its `$<driver>(type, codec)` escape hatch for\n// types not representable on the wire; the base provides the Zod codec, the Zod wrappers, the full\n// `z.*` passthrough, and the `rebuild`/`blank` seam that carries native metadata through a chain.\n//\n// It references NOTHING dialect-specific — it's generic over the per-dialect native-metadata slot `N`.\n// It is also Zod-CLEAN: app-side behaviour delegates to the inner Zod schema (`z.decode`/`z.encode`/\n// the wrappers) via Zod's public API, with side-channel metadata kept on WeakMaps — never patching\n// Zod internals.\n\nimport * as z from \"zod\";\n\n// `SFieldBase` is INVARIANT in its native-metadata slot `N` (the protected `rebuild(native: N)` makes\n// N contravariant while `native`/`blank` make it covariant). So a dialect field — `SField` with\n// `N = SurrealMeta` — is NOT assignable to a fixed `N = unknown`, which would make `AnyField` reject\n// real dialect fields (e.g. `.or(s.int())`). At THIS cross-dialect boundary `N` is honestly \"any\n// dialect's metadata\": erase it to `any` (bivariant) so every driver's field is an `AnyField`. The\n// concrete `N` is preserved everywhere it matters — each driver's own field type keeps `N = <D>Meta`.\n\n/** Any field of ANY dialect — the base type the helpers + wrappers accept. */\n// biome-ignore lint/suspicious/noExplicitAny: cross-dialect erasure of the invariant native slot N.\nexport type AnyField = SFieldBase<z.ZodType, string, any>;\n\n/** The Zod schema a field (or a raw Zod schema) carries. */\nexport type SchemaOf<F> =\n // biome-ignore lint/suspicious/noExplicitAny: match a field of any dialect (N is invariant).\n F extends SFieldBase<infer S, string, any>\n ? S\n : F extends z.ZodType\n ? F\n : never;\n\n/** The `Flags` channel a field carries (driver `$`-methods brand it; widens to `string` for `Shape`). */\nexport type FlagsOf<F> =\n // biome-ignore lint/suspicious/noExplicitAny: match a field of any dialect (N is invariant).\n F extends SFieldBase<z.ZodType, infer Fl, any> ? Fl : never;\n\n/** The schema one wrapper down — what `unwrap()` returns. */\nexport type InnerOf<S extends z.ZodType> =\n S extends z.ZodOptional<infer I extends z.ZodType>\n ? I\n : S extends z.ZodNullable<infer I extends z.ZodType>\n ? I\n : S extends z.ZodDefault<infer I extends z.ZodType>\n ? I\n : S extends z.ZodPrefault<infer I extends z.ZodType>\n ? I\n : S extends z.ZodCatch<infer I extends z.ZodType>\n ? I\n : S extends z.ZodReadonly<infer I extends z.ZodType>\n ? I\n : S extends z.ZodArray<infer I extends z.ZodType>\n ? I\n : S;\n\n/**\n * Maps an object schema (built via a driver's `s.object`) to its original field shape, so nested\n * fields keep their authoring metadata through generation. Kept on the schema, not the field, so it\n * composes through `array()`/`optional()`/nesting.\n */\nexport const objectFieldsRegistry = new WeakMap<\n z.ZodType,\n Record<string, AnyField>\n>();\n\n/**\n * The PORTABLE, dialect-agnostic field base. Holds the Zod schema, an opaque per-dialect `native`\n * metadata slot, the field-level codecs, and the app-land Zod wrappers (which carry `native` forward\n * via the `rebuild` hook so a chain keeps its concrete dialect type). Each dialect subclasses it to\n * add native authoring (`$`-methods) and re-type the wrappers so a chain stays its own field type.\n */\nexport abstract class SFieldBase<\n S extends z.ZodType = z.ZodType,\n Flags extends string = never,\n N = unknown,\n> {\n constructor(\n readonly schema: S,\n readonly native: N,\n ) {}\n\n /** Rebuild a sibling field of the SAME dialect with a new schema/flags. Each dialect overrides it. */\n protected abstract rebuild<S2 extends z.ZodType, F2 extends string>(\n schema: S2,\n native: N,\n ): SFieldBase<S2, F2, N>;\n /** A fresh, empty native-metadata bag (for wrappers like `or`/`and` that reset it). */\n protected abstract blank(): N;\n\n // --- Field-level codec (raw, on `this.schema`): `decode` reads (wire -> app), `encode` writes\n // (app -> wire). Create-shaping is a table concept, so these are NOT create-shaped. ---\n /** Decode a DB value to its app type (wire -> app). */\n decode(value: unknown): z.output<S> {\n return z.decode(this.schema, value as never);\n }\n /** Encode an app value to its DB wire type (app -> wire). */\n encode(value: z.output<S>): z.input<S> {\n return z.encode(this.schema, value);\n }\n decodeAsync(value: unknown): Promise<z.output<S>> {\n return z.decodeAsync(this.schema, value as never);\n }\n encodeAsync(value: z.output<S>): Promise<z.input<S>> {\n return z.encodeAsync(this.schema, value);\n }\n safeDecode(value: unknown) {\n return z.safeDecode(this.schema, value as never);\n }\n safeEncode(value: z.output<S>) {\n return z.safeEncode(this.schema, value);\n }\n safeDecodeAsync(value: unknown) {\n return z.safeDecodeAsync(this.schema, value as never);\n }\n safeEncodeAsync(value: z.output<S>) {\n return z.safeEncodeAsync(this.schema, value);\n }\n // Deprecated Zod-style aliases — `parse` runs the DECODE direction (wire -> app).\n /** @deprecated `parse` decodes a value (wire -> app). Use {@link decode}. */\n parse(value: unknown): z.output<S> {\n return this.decode(value);\n }\n /** @deprecated Use {@link safeDecode}. */\n safeParse(value: unknown) {\n return this.safeDecode(value);\n }\n /** @deprecated Use {@link decodeAsync}. */\n parseAsync(value: unknown): Promise<z.output<S>> {\n return this.decodeAsync(value);\n }\n /** @deprecated Use {@link safeDecodeAsync}. */\n safeParseAsync(value: unknown) {\n return this.safeDecodeAsync(value);\n }\n\n // Zod wrappers — delegate to the inner schema, carry native metadata + flags forward.\n optional(): SFieldBase<z.ZodOptional<S>, Flags, N> {\n return this.rebuild(this.schema.optional(), this.native);\n }\n nullable(): SFieldBase<z.ZodNullable<S>, Flags, N> {\n return this.rebuild(this.schema.nullable(), this.native);\n }\n default(value: z.input<S>): SFieldBase<z.ZodDefault<S>, Flags, N> {\n return this.rebuild(this.schema.default(value as never), this.native);\n }\n /** Zod prefault: fill an absent value with `value`, then validate it (unlike `.default`). */\n prefault(value: z.input<S>): SFieldBase<z.ZodPrefault<S>, Flags, N> {\n return this.rebuild(z.prefault(this.schema, value as never), this.native);\n }\n /** Zod catch: fall back to `value` when parsing fails. */\n catch(value: z.output<S>): SFieldBase<z.ZodCatch<S>, Flags, N> {\n return this.rebuild(this.schema.catch(value as never), this.native);\n }\n array(): SFieldBase<z.ZodArray<S>, Flags, N> {\n return this.rebuild(z.array(this.schema), this.native);\n }\n nullish(): SFieldBase<z.ZodOptional<z.ZodNullable<S>>, Flags, N> {\n return this.rebuild(this.schema.nullish(), this.native);\n }\n /** Zod union — `a.or(b)` accepts either. Mirrors Zod's `.or()`. */\n or<F extends AnyField | z.ZodType>(\n other: F,\n ): SFieldBase<z.ZodUnion<[S, SchemaOf<F>]>, never, N> {\n return this.rebuild<z.ZodUnion<[S, SchemaOf<F>]>, never>(\n z.union([this.schema, toZod(other)]) as z.ZodUnion<[S, SchemaOf<F>]>,\n this.blank(),\n );\n }\n /** Zod intersection — `a.and(b)`. Mirrors Zod's `.and()`. */\n and<F extends AnyField | z.ZodType>(\n other: F,\n ): SFieldBase<z.ZodIntersection<S, SchemaOf<F>>, never, N> {\n return this.rebuild<z.ZodIntersection<S, SchemaOf<F>>, never>(\n z.intersection(this.schema, toZod(other) as SchemaOf<F>),\n this.blank(),\n );\n }\n\n // --- Native Zod passthrough (drop-in for `z.*`): app-side validation / transform / metadata,\n // delegated to the inner schema. The dialect-DDL side stays under the driver's `$`-methods. ---\n refine(\n check: (arg: z.output<S>) => unknown,\n params?: string | z.core.$ZodCustomParams,\n ): this {\n return this.rebuild(\n this.schema.refine(check, params) as S,\n this.native,\n ) as unknown as this;\n }\n superRefine(\n refinement: (\n arg: z.output<S>,\n ctx: z.core.$RefinementCtx<z.output<S>>,\n ) => void,\n ): this {\n return this.rebuild(\n this.schema.superRefine(refinement) as S,\n this.native,\n ) as unknown as this;\n }\n check(\n ...checks: (z.core.CheckFn<z.output<S>> | z.core.$ZodCheck<z.output<S>>)[]\n ): this {\n return this.rebuild(\n this.schema.check(...checks) as S,\n this.native,\n ) as unknown as this;\n }\n overwrite(fn: (x: z.output<S>) => z.output<S>): this {\n return this.rebuild(\n this.schema.overwrite(fn) as S,\n this.native,\n ) as unknown as this;\n }\n brand<B extends PropertyKey = PropertyKey>(value?: B): this {\n return this.rebuild(\n this.schema.brand(value) as unknown as S,\n this.native,\n ) as unknown as this;\n }\n /** Zod's app-side metadata (JSON-schema/docs) — distinct from a driver's `$comment()`. */\n describe(description: string): this {\n return this.rebuild(\n this.schema.describe(description) as S,\n this.native,\n ) as unknown as this;\n }\n meta(data: z.core.GlobalMeta): this {\n return this.rebuild(\n this.schema.meta(data) as S,\n this.native,\n ) as unknown as this;\n }\n /** Zod's app-side readonly (TS-immutable output) — distinct from a driver's `$readonly()`. */\n readonly(): SFieldBase<z.ZodReadonly<S>, Flags, N> {\n return this.rebuild(this.schema.readonly(), this.native);\n }\n /** Zod transform — changes the decoded `App<>` value; the stored (wire) type is unchanged. */\n transform<NewOut>(\n fn: (arg: z.output<S>, ctx: z.core.$RefinementCtx<z.output<S>>) => NewOut,\n ): SFieldBase<\n z.ZodPipe<S, z.ZodTransform<Awaited<NewOut>, z.output<S>>>,\n Flags,\n N\n > {\n return this.rebuild(this.schema.transform(fn), this.native);\n }\n /** Zod pipe — feed this field's output into `target`; the stored (wire) type stays `this`. */\n pipe<T extends z.core.$ZodType<unknown, z.output<S>>>(\n target: T,\n ): SFieldBase<z.ZodPipe<S, T>, Flags, N> {\n return this.rebuild(\n this.schema.pipe(target) as z.ZodPipe<S, T>,\n this.native,\n );\n }\n /** Peel one wrapper (optional/nullable/default/prefault/catch/readonly/array) off the field. */\n unwrap(): SFieldBase<InnerOf<S>, Flags, N> {\n const def = this.schema._zod.def as {\n innerType?: z.ZodType;\n element?: z.ZodType;\n };\n const inner = def.innerType ?? def.element ?? this.schema;\n return this.rebuild(inner, this.native) as unknown as SFieldBase<\n InnerOf<S>,\n Flags,\n N\n >;\n }\n\n /** Object-only: allow arbitrary extra keys — `FLEXIBLE` in DDL. Mirrors Zod's `.loose()`. */\n loose(): this {\n return this.objectMode(\"loose\");\n }\n /** Object-only: reject unknown keys — the default. Mirrors Zod's `.strict()`. */\n strict(): this {\n return this.objectMode(\"strict\");\n }\n /** Alias for {@link loose} — a `FLEXIBLE` object accepting arbitrary keys. */\n flexible(): this {\n return this.loose();\n }\n private objectMode(mode: \"loose\" | \"strict\"): this {\n const obj = this.schema as unknown as {\n loose?: () => z.ZodType;\n strict?: () => z.ZodType;\n };\n if (typeof obj.loose !== \"function\" || typeof obj.strict !== \"function\") {\n return this; // not an object schema — no-op\n }\n const next = (mode === \"loose\"\n ? obj.loose()\n : obj.strict()) as unknown as S;\n // Carry the nested-field registry forward so DDL/create-shaping still see the subfields.\n const fields = objectFieldsRegistry.get(this.schema);\n if (fields) objectFieldsRegistry.set(next, fields);\n return this.rebuild(next, this.native) as unknown as this;\n }\n}\n\n/** Unwrap a field to its Zod schema (raw Zod schemas pass through). */\nexport const toZod = (v: AnyField | z.ZodType): z.ZodType =>\n v instanceof SFieldBase ? v.schema : v;\n"],"mappings":";AAWA,YAAY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AACvE,aAAO;AAAA,IACT;AACA,UAAM,OAAQ,SAAS,UACnB,IAAI,MAAM,IACV,IAAI,OAAO;AAEf,UAAM,SAAS,qBAAqB,IAAI,KAAK,MAAM;AACnD,QAAI,OAAQ,sBAAqB,IAAI,MAAM,MAAM;AACjD,WAAO,KAAK,QAAQ,MAAM,KAAK,MAAM;AAAA,EACvC;AACF;AAGO,IAAM,QAAQ,CAAC,MACpB,aAAa,aAAa,EAAE,SAAS;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/authoring.ts"],"sourcesContent":["// The NEUTRAL, dialect-agnostic AUTHORING BASE (docs/AUTHORING-SPLIT.md — \"base builder in core\").\n// Each driver package builds its `s.*` on this: `class <D>Field extends SFieldBase<S, Flags, <D>Meta>`\n// adds the dialect's native authoring (`$`-methods) and its `$<driver>(type, codec)` escape hatch for\n// types not representable on the wire; the base provides the Zod codec, the Zod wrappers, the full\n// `z.*` passthrough, and the `rebuild`/`blank` seam that carries native metadata through a chain.\n//\n// It references NOTHING dialect-specific — it's generic over the per-dialect native-metadata slot `N`.\n// It is also Zod-CLEAN: app-side behaviour delegates to the inner Zod schema (`z.decode`/`z.encode`/\n// the wrappers) via Zod's public API, with side-channel metadata kept on WeakMaps — never patching\n// Zod internals.\n\nimport * as z from \"zod\";\n\n// `SFieldBase` is INVARIANT in its native-metadata slot `N` (the protected `rebuild(native: N)` makes\n// N contravariant while `native`/`blank` make it covariant). So a dialect field — `SField` with\n// `N = SurrealMeta` — is NOT assignable to a fixed `N = unknown`, which would make `AnyField` reject\n// real dialect fields (e.g. `.or(s.int())`). At THIS cross-dialect boundary `N` is honestly \"any\n// dialect's metadata\": erase it to `any` (bivariant) so every driver's field is an `AnyField`. The\n// concrete `N` is preserved everywhere it matters — each driver's own field type keeps `N = <D>Meta`.\n\n/** Any field of ANY dialect — the base type the helpers + wrappers accept. */\n// biome-ignore lint/suspicious/noExplicitAny: cross-dialect erasure of the invariant native slot N.\nexport type AnyField = SFieldBase<z.ZodType, string, any>;\n\n/** The Zod schema a field (or a raw Zod schema) carries. */\nexport type SchemaOf<F> =\n // biome-ignore lint/suspicious/noExplicitAny: match a field of any dialect (N is invariant).\n F extends SFieldBase<infer S, string, any>\n ? S\n : F extends z.ZodType\n ? F\n : never;\n\n/** The `Flags` channel a field carries (driver `$`-methods brand it; widens to `string` for `Shape`). */\nexport type FlagsOf<F> =\n // biome-ignore lint/suspicious/noExplicitAny: match a field of any dialect (N is invariant).\n F extends SFieldBase<z.ZodType, infer Fl, any> ? Fl : never;\n\n/** The schema one wrapper down — what `unwrap()` returns. */\nexport type InnerOf<S extends z.ZodType> =\n S extends z.ZodOptional<infer I extends z.ZodType>\n ? I\n : S extends z.ZodNullable<infer I extends z.ZodType>\n ? I\n : S extends z.ZodDefault<infer I extends z.ZodType>\n ? I\n : S extends z.ZodPrefault<infer I extends z.ZodType>\n ? I\n : S extends z.ZodCatch<infer I extends z.ZodType>\n ? I\n : S extends z.ZodReadonly<infer I extends z.ZodType>\n ? I\n : S extends z.ZodArray<infer I extends z.ZodType>\n ? I\n : S;\n\n/**\n * Maps an object schema (built via a driver's `s.object`) to its original field shape, so nested\n * fields keep their authoring metadata through generation. Kept on the schema, not the field, so it\n * composes through `array()`/`optional()`/nesting.\n */\nexport const objectFieldsRegistry = new WeakMap<\n z.ZodType,\n Record<string, AnyField>\n>();\n\n/**\n * The PORTABLE, dialect-agnostic field base. Holds the Zod schema, an opaque per-dialect `native`\n * metadata slot, the field-level codecs, and the app-land Zod wrappers (which carry `native` forward\n * via the `rebuild` hook so a chain keeps its concrete dialect type). Each dialect subclasses it to\n * add native authoring (`$`-methods) and re-type the wrappers so a chain stays its own field type.\n */\nexport abstract class SFieldBase<\n S extends z.ZodType = z.ZodType,\n Flags extends string = never,\n N = unknown,\n> {\n constructor(\n readonly schema: S,\n readonly native: N,\n ) {}\n\n /** Rebuild a sibling field of the SAME dialect with a new schema/flags. Each dialect overrides it. */\n protected abstract rebuild<S2 extends z.ZodType, F2 extends string>(\n schema: S2,\n native: N,\n ): SFieldBase<S2, F2, N>;\n /** A fresh, empty native-metadata bag (for wrappers like `or`/`and` that reset it). */\n protected abstract blank(): N;\n\n // --- Field-level codec (raw, on `this.schema`): `decode` reads (wire -> app), `encode` writes\n // (app -> wire). Create-shaping is a table concept, so these are NOT create-shaped. ---\n /** Decode a DB value to its app type (wire -> app). */\n decode(value: unknown): z.output<S> {\n return z.decode(this.schema, value as never);\n }\n /** Encode an app value to its DB wire type (app -> wire). */\n encode(value: z.output<S>): z.input<S> {\n return z.encode(this.schema, value);\n }\n decodeAsync(value: unknown): Promise<z.output<S>> {\n return z.decodeAsync(this.schema, value as never);\n }\n encodeAsync(value: z.output<S>): Promise<z.input<S>> {\n return z.encodeAsync(this.schema, value);\n }\n safeDecode(value: unknown) {\n return z.safeDecode(this.schema, value as never);\n }\n safeEncode(value: z.output<S>) {\n return z.safeEncode(this.schema, value);\n }\n safeDecodeAsync(value: unknown) {\n return z.safeDecodeAsync(this.schema, value as never);\n }\n safeEncodeAsync(value: z.output<S>) {\n return z.safeEncodeAsync(this.schema, value);\n }\n // Deprecated Zod-style aliases — `parse` runs the DECODE direction (wire -> app).\n /** @deprecated `parse` decodes a value (wire -> app). Use {@link decode}. */\n parse(value: unknown): z.output<S> {\n return this.decode(value);\n }\n /** @deprecated Use {@link safeDecode}. */\n safeParse(value: unknown) {\n return this.safeDecode(value);\n }\n /** @deprecated Use {@link decodeAsync}. */\n parseAsync(value: unknown): Promise<z.output<S>> {\n return this.decodeAsync(value);\n }\n /** @deprecated Use {@link safeDecodeAsync}. */\n safeParseAsync(value: unknown) {\n return this.safeDecodeAsync(value);\n }\n\n // Zod wrappers — delegate to the inner schema, carry native metadata + flags forward.\n optional(): SFieldBase<z.ZodOptional<S>, Flags, N> {\n return this.rebuild(this.schema.optional(), this.native);\n }\n nullable(): SFieldBase<z.ZodNullable<S>, Flags, N> {\n return this.rebuild(this.schema.nullable(), this.native);\n }\n default(value: z.input<S>): SFieldBase<z.ZodDefault<S>, Flags, N> {\n return this.rebuild(this.schema.default(value as never), this.native);\n }\n /** Zod prefault: fill an absent value with `value`, then validate it (unlike `.default`). */\n prefault(value: z.input<S>): SFieldBase<z.ZodPrefault<S>, Flags, N> {\n return this.rebuild(z.prefault(this.schema, value as never), this.native);\n }\n /** Zod catch: fall back to `value` when parsing fails. */\n catch(value: z.output<S>): SFieldBase<z.ZodCatch<S>, Flags, N> {\n return this.rebuild(this.schema.catch(value as never), this.native);\n }\n array(): SFieldBase<z.ZodArray<S>, Flags, N> {\n return this.rebuild(z.array(this.schema), this.native);\n }\n nullish(): SFieldBase<z.ZodOptional<z.ZodNullable<S>>, Flags, N> {\n return this.rebuild(this.schema.nullish(), this.native);\n }\n /** Zod union — `a.or(b)` accepts either. Mirrors Zod's `.or()`. */\n or<F extends AnyField | z.ZodType>(\n other: F,\n ): SFieldBase<z.ZodUnion<[S, SchemaOf<F>]>, never, N> {\n return this.rebuild<z.ZodUnion<[S, SchemaOf<F>]>, never>(\n z.union([this.schema, toZod(other)]) as z.ZodUnion<[S, SchemaOf<F>]>,\n this.blank(),\n );\n }\n /** Zod intersection — `a.and(b)`. Mirrors Zod's `.and()`. */\n and<F extends AnyField | z.ZodType>(\n other: F,\n ): SFieldBase<z.ZodIntersection<S, SchemaOf<F>>, never, N> {\n return this.rebuild<z.ZodIntersection<S, SchemaOf<F>>, never>(\n z.intersection(this.schema, toZod(other) as SchemaOf<F>),\n this.blank(),\n );\n }\n\n // --- Native Zod passthrough (drop-in for `z.*`): app-side validation / transform / metadata,\n // delegated to the inner schema. The dialect-DDL side stays under the driver's `$`-methods. ---\n refine(\n check: (arg: z.output<S>) => unknown,\n params?: string | z.core.$ZodCustomParams,\n ): this {\n return this.rebuild(\n this.schema.refine(check, params) as S,\n this.native,\n ) as unknown as this;\n }\n superRefine(\n refinement: (\n arg: z.output<S>,\n ctx: z.core.$RefinementCtx<z.output<S>>,\n ) => void,\n ): this {\n return this.rebuild(\n this.schema.superRefine(refinement) as S,\n this.native,\n ) as unknown as this;\n }\n check(\n ...checks: (z.core.CheckFn<z.output<S>> | z.core.$ZodCheck<z.output<S>>)[]\n ): this {\n return this.rebuild(\n this.schema.check(...checks) as S,\n this.native,\n ) as unknown as this;\n }\n overwrite(fn: (x: z.output<S>) => z.output<S>): this {\n return this.rebuild(\n this.schema.overwrite(fn) as S,\n this.native,\n ) as unknown as this;\n }\n brand<B extends PropertyKey = PropertyKey>(value?: B): this {\n return this.rebuild(\n this.schema.brand(value) as unknown as S,\n this.native,\n ) as unknown as this;\n }\n /** Zod's app-side metadata (JSON-schema/docs) — distinct from a driver's `$comment()`. */\n describe(description: string): this {\n return this.rebuild(\n this.schema.describe(description) as S,\n this.native,\n ) as unknown as this;\n }\n meta(data: z.core.GlobalMeta): this {\n return this.rebuild(\n this.schema.meta(data) as S,\n this.native,\n ) as unknown as this;\n }\n /** Zod's app-side readonly (TS-immutable output) — distinct from a driver's `$readonly()`. */\n readonly(): SFieldBase<z.ZodReadonly<S>, Flags, N> {\n return this.rebuild(this.schema.readonly(), this.native);\n }\n /** Zod transform — changes the decoded `App<>` value; the stored (wire) type is unchanged. */\n transform<NewOut>(\n fn: (arg: z.output<S>, ctx: z.core.$RefinementCtx<z.output<S>>) => NewOut,\n ): SFieldBase<\n z.ZodPipe<S, z.ZodTransform<Awaited<NewOut>, z.output<S>>>,\n Flags,\n N\n > {\n return this.rebuild(this.schema.transform(fn), this.native);\n }\n /** Zod pipe — feed this field's output into `target`; the stored (wire) type stays `this`. */\n pipe<T extends z.core.$ZodType<unknown, z.output<S>>>(\n target: T,\n ): SFieldBase<z.ZodPipe<S, T>, Flags, N> {\n return this.rebuild(\n this.schema.pipe(target) as z.ZodPipe<S, T>,\n this.native,\n );\n }\n /** Peel one wrapper (optional/nullable/default/prefault/catch/readonly/array) off the field. */\n unwrap(): SFieldBase<InnerOf<S>, Flags, N> {\n const def = this.schema._zod.def as {\n innerType?: z.ZodType;\n element?: z.ZodType;\n };\n const inner = def.innerType ?? def.element ?? this.schema;\n return this.rebuild(inner, this.native) as unknown as SFieldBase<\n InnerOf<S>,\n Flags,\n N\n >;\n }\n\n /** Object-only: allow arbitrary extra keys — `FLEXIBLE` in DDL. Mirrors Zod's `.loose()`. */\n loose(): this {\n return this.objectMode(\"loose\");\n }\n /** Object-only: reject unknown keys — the default. Mirrors Zod's `.strict()`. */\n strict(): this {\n return this.objectMode(\"strict\");\n }\n /** Alias for {@link loose} — a `FLEXIBLE` object accepting arbitrary keys. */\n flexible(): this {\n return this.loose();\n }\n private objectMode(mode: \"loose\" | \"strict\"): this {\n const obj = this.schema as unknown as {\n loose?: () => z.ZodType;\n strict?: () => z.ZodType;\n };\n if (typeof obj.loose !== \"function\" || typeof obj.strict !== \"function\") {\n return this; // not an object schema — no-op\n }\n const next = (mode === \"loose\"\n ? obj.loose()\n : obj.strict()) as unknown as S;\n // Carry the nested-field registry forward so DDL/create-shaping still see the subfields.\n const fields = objectFieldsRegistry.get(this.schema);\n if (fields) objectFieldsRegistry.set(next, fields);\n return this.rebuild(next, this.native) as unknown as this;\n }\n}\n\n/** Unwrap a field to its Zod schema (raw Zod schemas pass through). */\nexport const toZod = (v: AnyField | z.ZodType): z.ZodType =>\n v instanceof SFieldBase ? v.schema : v;\n"],"mappings":";AAWA,YAAY,OAAO;AAkDZ,IAAM,uBAAuB,oBAAI,QAGtC;AAQK,IAAe,aAAf,MAIL;AAAA,EACA,YACW,QACA,QACT;AAFS;AACA;AAAA,EACR;AAAA,EAFQ;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAcX,OAAO,OAA6B;AAClC,WAAS,SAAO,KAAK,QAAQ,KAAc;AAAA,EAC7C;AAAA;AAAA,EAEA,OAAO,OAAgC;AACrC,WAAS,SAAO,KAAK,QAAQ,KAAK;AAAA,EACpC;AAAA,EACA,YAAY,OAAsC;AAChD,WAAS,cAAY,KAAK,QAAQ,KAAc;AAAA,EAClD;AAAA,EACA,YAAY,OAAyC;AACnD,WAAS,cAAY,KAAK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AAAA,IACP;AAAA,EACF;AAAA;AAAA,EAEA,WAAmD;AACjD,WAAO,KAAK,QAAQ,KAAK,OAAO,SAAS,GAAG,KAAK,MAAM;AAAA,EACzD;AAAA;AAAA,EAEA,UACE,IAKA;AACA,WAAO,KAAK,QAAQ,KAAK,OAAO,UAAU,EAAE,GAAG,KAAK,MAAM;AAAA,EAC5D;AAAA;AAAA,EAEA,KACE,QACuC;AACvC,WAAO,KAAK;AAAA,MACV,KAAK,OAAO,KAAK,MAAM;AAAA,MACvB,KAAK;AAAA,IACP;AAAA,EACF;AAAA;AAAA,EAEA,SAA2C;AACzC,UAAM,MAAM,KAAK,OAAO,KAAK;AAI7B,UAAM,QAAQ,IAAI,aAAa,IAAI,WAAW,KAAK;AACnD,WAAO,KAAK,QAAQ,OAAO,KAAK,MAAM;AAAA,EAKxC;AAAA;AAAA,EAGA,QAAc;AACZ,WAAO,KAAK,WAAW,OAAO;AAAA,EAChC;AAAA;AAAA,EAEA,SAAe;AACb,WAAO,KAAK,WAAW,QAAQ;AAAA,EACjC;AAAA;AAAA,EAEA,WAAiB;AACf,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EACQ,WAAW,MAAgC;AACjD,UAAM,MAAM,KAAK;AAIjB,QAAI,OAAO,IAAI,UAAU,cAAc,OAAO,IAAI,WAAW,YAAY;AACvE,aAAO;AAAA,IACT;AACA,UAAM,OAAQ,SAAS,UACnB,IAAI,MAAM,IACV,IAAI,OAAO;AAEf,UAAM,SAAS,qBAAqB,IAAI,KAAK,MAAM;AACnD,QAAI,OAAQ,sBAAqB,IAAI,MAAM,MAAM;AACjD,WAAO,KAAK,QAAQ,MAAM,KAAK,MAAM;AAAA,EACvC;AACF;AAGO,IAAM,QAAQ,CAAC,MACpB,aAAa,aAAa,EAAE,SAAS;","names":[]}
|
|
@@ -94,4 +94,4 @@ interface SchemicConfig {
|
|
|
94
94
|
/** Identity helper that types a `schemic.config.ts` default export. */
|
|
95
95
|
declare function defineConfig(config: SchemicConfig): SchemicConfig;
|
|
96
96
|
|
|
97
|
-
export { type ConnectionConfigBase as C, type ResolveContext as R, type SchemicConfig as S, type ConnectionEntry as a, type ConnectionInput as b,
|
|
97
|
+
export { type ConnectionConfigBase as C, type ResolveContext as R, type SchemicConfig as S, type ConnectionEntry as a, type ConnectionInput as b, type ResolvedConnectionHandle as c, connectionEntry as d, defineConfig as e, isConnectionEntry as i };
|
package/lib/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as SchemicConfig, e as defineConfig } from './config-
|
|
1
|
+
export { S as SchemicConfig, e as defineConfig } from './config-v3H_2lwA.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as jiti from 'jiti';
|
|
2
|
-
import { S as SchemicConfig, C as ConnectionConfigBase } from './config-
|
|
2
|
+
import { S as SchemicConfig, C as ConnectionConfigBase } from './config-v3H_2lwA.js';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -733,4 +733,4 @@ declare function getDriver(name: string): Driver<unknown>;
|
|
|
733
733
|
/** All registered driver names (for help text / config validation). */
|
|
734
734
|
declare function driverNames(): string[];
|
|
735
735
|
|
|
736
|
-
export {
|
|
736
|
+
export { listMigrations as $, type Authored as A, buildKindDiff as B, type ConnectionOverrides as C, type Driver as D, EMPTY_STORED as E, type Filter as F, checksum as G, driverNames as H, emitKinds as I, filterKinds as J, type KindDisplay as K, type LocalOnly as L, type MergeOptions as M, formatDiff as N, type OrderNode as O, type PortableObject as P, formatItems as Q, type Ref as R, type ShadowCapability as S, formatPatch as T, getDriver as U, inCat as V, intersectKinds as W, introspectKinds as X, isEmptyDiff as Y, kindFlags as Z, lineDiff as _, type AuthoredDef as a, loadConfig as a0, loadProject as a1, lowerSchema as a2, makeJiti as a3, mergeStored as a4, mergeUnits as a5, orderObjects as a6, parseFilter as a7, passesFilter as a8, planKinds as a9, readSnapshot as aa, registerDriver as ab, resolveConnectionConfig as ac, slug as ad, snapshotKinds as ae, snapshotObjects as af, summarizeKinds as ag, timestamp as ah, tokenDiff as ai, unifiedDiff as aj, writeSnapshot as ak, type ApplyOptions as b, type Definable as c, type Diff as d, type DiffItem as e, type EmitOptions as f, type FilterOpts as g, type KindEngine as h, type KindPlan as i, KindRegistry as j, type KindSnapshot as k, type KindSpec as l, type MergeResult as m, type Migration as n, type MigrationDirection as o, type MigrationRecord as p, type MigrationStore as q, type PullFilePlan as r, type PullPlan as s, type RenderedUnit as t, type ResolvedConfig as u, type ResolvedDisplay as v, type Statement as w, type StoredSnapshot as x, actionLabel as y, applyPull as z };
|
package/lib/driver.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { C as ConnectionConfigBase, a as ConnectionEntry, b as ConnectionInput, R as ResolveContext,
|
|
1
|
+
export { b as ApplyOptions, A as Authored, a as AuthoredDef, C as ConnectionOverrides, c as Definable, d as Diff, e as DiffItem, D as Driver, f as EmitOptions, h as KindEngine, i as KindPlan, j as KindRegistry, k as KindSnapshot, l as KindSpec, o as MigrationDirection, p as MigrationRecord, q as MigrationStore, O as OrderNode, P as PortableObject, R as Ref, u as ResolvedConfig, S as ShadowCapability, w as Statement, B as buildKindDiff, H as driverNames, I as emitKinds, U as getDriver, X as introspectKinds, a2 as lowerSchema, a6 as orderObjects, a9 as planKinds, ab as registerDriver, ae as snapshotKinds, af as snapshotObjects } from './driver-BTaJ2ryZ.js';
|
|
2
|
+
export { C as ConnectionConfigBase, a as ConnectionEntry, b as ConnectionInput, R as ResolveContext, d as connectionEntry } from './config-v3H_2lwA.js';
|
|
3
3
|
import 'jiti';
|
|
4
4
|
import 'commander';
|
|
5
5
|
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as Authored, a as AuthoredDef } from './driver-
|
|
2
|
-
export {
|
|
3
|
-
export { C as ConnectionConfigBase, a as ConnectionEntry, b as ConnectionInput, R as ResolveContext,
|
|
1
|
+
import { A as Authored, a as AuthoredDef } from './driver-BTaJ2ryZ.js';
|
|
2
|
+
export { b as ApplyOptions, C as ConnectionOverrides, c as Definable, d as Diff, e as DiffItem, D as Driver, E as EMPTY_STORED, f as EmitOptions, F as Filter, g as FilterOpts, K as KindDisplay, h as KindEngine, i as KindPlan, j as KindRegistry, k as KindSnapshot, l as KindSpec, L as LocalOnly, M as MergeOptions, m as MergeResult, n as Migration, o as MigrationDirection, p as MigrationRecord, q as MigrationStore, O as OrderNode, P as PortableObject, r as PullFilePlan, s as PullPlan, R as Ref, t as RenderedUnit, u as ResolvedConfig, v as ResolvedDisplay, S as ShadowCapability, w as Statement, x as StoredSnapshot, y as actionLabel, z as applyPull, B as buildKindDiff, G as checksum, H as driverNames, I as emitKinds, J as filterKinds, N as formatDiff, Q as formatItems, T as formatPatch, U as getDriver, V as inCat, W as intersectKinds, X as introspectKinds, Y as isEmptyDiff, Z as kindFlags, _ as lineDiff, $ as listMigrations, a0 as loadConfig, a1 as loadProject, a2 as lowerSchema, a3 as makeJiti, a4 as mergeStored, a5 as mergeUnits, a6 as orderObjects, a7 as parseFilter, a8 as passesFilter, a9 as planKinds, aa as readSnapshot, ab as registerDriver, ac as resolveConnectionConfig, ad as slug, ae as snapshotKinds, af as snapshotObjects, ag as summarizeKinds, ah as timestamp, ai as tokenDiff, aj as unifiedDiff, ak as writeSnapshot } from './driver-BTaJ2ryZ.js';
|
|
3
|
+
export { C as ConnectionConfigBase, a as ConnectionEntry, b as ConnectionInput, R as ResolveContext, c as ResolvedConnectionHandle, d as connectionEntry, i as isConnectionEntry } from './config-v3H_2lwA.js';
|
|
4
4
|
export { PortableField, PortablePermissions, PortableType, ScalarName, array, literal, nullable, option, record, scalar, union } from './driver.js';
|
|
5
5
|
import 'jiti';
|
|
6
6
|
import 'commander';
|
package/lib/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as Driver } from './driver-
|
|
1
|
+
import { D as Driver } from './driver-BTaJ2ryZ.js';
|
|
2
2
|
import 'jiti';
|
|
3
|
-
import './config-
|
|
3
|
+
import './config-v3H_2lwA.js';
|
|
4
4
|
import 'commander';
|
|
5
5
|
|
|
6
6
|
/** The driver's authoring namespace (`s`) — a bag of field builders. Loosely typed (cross-driver). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schemic/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "The dialect-neutral engine for Schemic — Driver contract, portable schema IR, and the migration/diff/snapshot engine.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vertio Solutions",
|