@deepseek-ai/schemastery 3.18.2 → 3.18.4
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/README.md +4 -0
- package/lib/index.cjs +40 -1
- package/lib/index.mjs +41 -2
- package/lib/types/index.d.ts +43 -32
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +93 -33
package/README.md
CHANGED
|
@@ -387,3 +387,7 @@ const schema2 = new Schema(JSON.parse(JSON.stringify(schema1)))
|
|
|
387
387
|
|
|
388
388
|
Schemastery also exposes the Standard Schema `~standard` property, so compatible
|
|
389
389
|
tools can validate values without depending on Schemastery-specific APIs.
|
|
390
|
+
|
|
391
|
+
## Volatile configuration
|
|
392
|
+
|
|
393
|
+
`.volatile()` preserves a field's schema type and metadata while parsing its value into a stable reference read with `.get()`. Defaults remain ordinary data; absent optional fields return references containing `undefined`. `simplify()` unwraps references for persistence. See the [configuration guide](../../docs/cordis-tutorial/05-config.md#volatile-fields) for supported placements and Cordis update semantics.
|
package/lib/index.cjs
CHANGED
|
@@ -175,6 +175,7 @@ Schema.prototype.pattern = function pattern(regexp) {
|
|
|
175
175
|
return schema;
|
|
176
176
|
};
|
|
177
177
|
Schema.prototype.simplify = function simplify(value) {
|
|
178
|
+
if ((0, _deepseek_ai_cosmokit.isVolatile)(value)) value = value.get();
|
|
178
179
|
if ((0, _deepseek_ai_cosmokit.deepEqual)(value, this.meta.default, this.type === "dict")) return null;
|
|
179
180
|
if ((0, _deepseek_ai_cosmokit.isNullable)(value)) return value;
|
|
180
181
|
if (this.type === "object" || this.type === "dict") {
|
|
@@ -231,12 +232,49 @@ for (const key of [
|
|
|
231
232
|
};
|
|
232
233
|
return schema;
|
|
233
234
|
} });
|
|
235
|
+
Schema.prototype.volatile = function volatile() {
|
|
236
|
+
if (this.meta.volatile) throw new TypeError("volatile schema is already wrapped");
|
|
237
|
+
return this.extra("volatile", true);
|
|
238
|
+
};
|
|
234
239
|
const resolvers = {};
|
|
240
|
+
const checkedVolatile = Symbol("checked-volatile-schema");
|
|
241
|
+
function validateVolatileSchema(schema, path = [], blocked = false, seen = /* @__PURE__ */ new Map()) {
|
|
242
|
+
const states = seen.get(schema) ?? /* @__PURE__ */ new Set();
|
|
243
|
+
if (states.has(blocked)) return;
|
|
244
|
+
states.add(blocked);
|
|
245
|
+
seen.set(schema, states);
|
|
246
|
+
if (schema.meta?.volatile && blocked) throw new ValidationError("volatile fields require a fixed object path without an enclosing volatile field", { path });
|
|
247
|
+
const nested = blocked || !!schema.meta?.volatile;
|
|
248
|
+
if (schema.dict) for (const [key, child] of Object.entries(schema.dict)) validateVolatileSchema(child, [...path, key], nested, seen);
|
|
249
|
+
if (schema.sKey) validateVolatileSchema(schema.sKey, [...path, "<key>"], true, seen);
|
|
250
|
+
if (schema.inner && (schema.type !== "lazy" || schema.inner[kSchema])) validateVolatileSchema(schema.inner, [...path, "*"], true, seen);
|
|
251
|
+
if (schema.list) for (let index = 0; index < schema.list.length; index++) validateVolatileSchema(schema.list[index], [...path, String(index)], true, seen);
|
|
252
|
+
}
|
|
235
253
|
Schema.extend = function extend(type, resolve) {
|
|
236
254
|
resolvers[type] = resolve;
|
|
237
255
|
};
|
|
238
256
|
Schema.resolve = function resolve(data, schema, options = {}, strict = false) {
|
|
239
257
|
if (!schema) return [data];
|
|
258
|
+
if (!options[checkedVolatile]) {
|
|
259
|
+
validateVolatileSchema(schema, options.path);
|
|
260
|
+
options = {
|
|
261
|
+
...options,
|
|
262
|
+
[checkedVolatile]: true
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
if (schema.meta?.volatile) {
|
|
266
|
+
const inner = Schema(schema);
|
|
267
|
+
inner.meta = {
|
|
268
|
+
...schema.meta,
|
|
269
|
+
volatile: false
|
|
270
|
+
};
|
|
271
|
+
const [value, adapted] = Schema.resolve(data, inner, options, strict);
|
|
272
|
+
try {
|
|
273
|
+
return [(0, _deepseek_ai_cosmokit.createVolatile)(value), adapted];
|
|
274
|
+
} catch (error) {
|
|
275
|
+
throw new ValidationError(error instanceof Error ? error.message : String(error), options);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
240
278
|
if (options.ignore?.(data, schema)) return [data];
|
|
241
279
|
if ((0, _deepseek_ai_cosmokit.isNullable)(data) && schema.type !== "lazy") {
|
|
242
280
|
if (schema.meta.required) throw new ValidationError(`missing required value`, options);
|
|
@@ -339,6 +377,7 @@ Schema.extend("lazy", (data, schema, options, strict) => {
|
|
|
339
377
|
...schema.meta,
|
|
340
378
|
...schema.inner.meta
|
|
341
379
|
};
|
|
380
|
+
validateVolatileSchema(schema.inner, options.path, true);
|
|
342
381
|
}
|
|
343
382
|
return Schema.resolve(data, schema.inner, options, strict);
|
|
344
383
|
});
|
|
@@ -438,7 +477,7 @@ function property(data, key, schema, options) {
|
|
|
438
477
|
} catch (e) {
|
|
439
478
|
if (!options?.autofix) throw e;
|
|
440
479
|
delete data[key];
|
|
441
|
-
return schema.meta.default;
|
|
480
|
+
return schema.meta.volatile ? (0, _deepseek_ai_cosmokit.createVolatile)(schema.meta.default) : schema.meta.default;
|
|
442
481
|
}
|
|
443
482
|
}
|
|
444
483
|
Schema.extend("array", (data, { inner, meta }, options) => {
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Binary, clone, deepEqual, filterKeys, isNullable, isPlainObject, pick, valueMap } from "@deepseek-ai/cosmokit";
|
|
1
|
+
import { Binary, clone, createVolatile, deepEqual, filterKeys, isNullable, isPlainObject, isVolatile, pick, valueMap } from "@deepseek-ai/cosmokit";
|
|
2
2
|
//#region lib/types/index.js
|
|
3
3
|
const kSchema = Symbol.for("schemastery");
|
|
4
4
|
const kValidationError = Symbol.for("ValidationError");
|
|
@@ -175,6 +175,7 @@ Schema.prototype.pattern = function pattern(regexp) {
|
|
|
175
175
|
return schema;
|
|
176
176
|
};
|
|
177
177
|
Schema.prototype.simplify = function simplify(value) {
|
|
178
|
+
if (isVolatile(value)) value = value.get();
|
|
178
179
|
if (deepEqual(value, this.meta.default, this.type === "dict")) return null;
|
|
179
180
|
if (isNullable(value)) return value;
|
|
180
181
|
if (this.type === "object" || this.type === "dict") {
|
|
@@ -231,12 +232,49 @@ for (const key of [
|
|
|
231
232
|
};
|
|
232
233
|
return schema;
|
|
233
234
|
} });
|
|
235
|
+
Schema.prototype.volatile = function volatile() {
|
|
236
|
+
if (this.meta.volatile) throw new TypeError("volatile schema is already wrapped");
|
|
237
|
+
return this.extra("volatile", true);
|
|
238
|
+
};
|
|
234
239
|
const resolvers = {};
|
|
240
|
+
const checkedVolatile = Symbol("checked-volatile-schema");
|
|
241
|
+
function validateVolatileSchema(schema, path = [], blocked = false, seen = /* @__PURE__ */ new Map()) {
|
|
242
|
+
const states = seen.get(schema) ?? /* @__PURE__ */ new Set();
|
|
243
|
+
if (states.has(blocked)) return;
|
|
244
|
+
states.add(blocked);
|
|
245
|
+
seen.set(schema, states);
|
|
246
|
+
if (schema.meta?.volatile && blocked) throw new ValidationError("volatile fields require a fixed object path without an enclosing volatile field", { path });
|
|
247
|
+
const nested = blocked || !!schema.meta?.volatile;
|
|
248
|
+
if (schema.dict) for (const [key, child] of Object.entries(schema.dict)) validateVolatileSchema(child, [...path, key], nested, seen);
|
|
249
|
+
if (schema.sKey) validateVolatileSchema(schema.sKey, [...path, "<key>"], true, seen);
|
|
250
|
+
if (schema.inner && (schema.type !== "lazy" || schema.inner[kSchema])) validateVolatileSchema(schema.inner, [...path, "*"], true, seen);
|
|
251
|
+
if (schema.list) for (let index = 0; index < schema.list.length; index++) validateVolatileSchema(schema.list[index], [...path, String(index)], true, seen);
|
|
252
|
+
}
|
|
235
253
|
Schema.extend = function extend(type, resolve) {
|
|
236
254
|
resolvers[type] = resolve;
|
|
237
255
|
};
|
|
238
256
|
Schema.resolve = function resolve(data, schema, options = {}, strict = false) {
|
|
239
257
|
if (!schema) return [data];
|
|
258
|
+
if (!options[checkedVolatile]) {
|
|
259
|
+
validateVolatileSchema(schema, options.path);
|
|
260
|
+
options = {
|
|
261
|
+
...options,
|
|
262
|
+
[checkedVolatile]: true
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
if (schema.meta?.volatile) {
|
|
266
|
+
const inner = Schema(schema);
|
|
267
|
+
inner.meta = {
|
|
268
|
+
...schema.meta,
|
|
269
|
+
volatile: false
|
|
270
|
+
};
|
|
271
|
+
const [value, adapted] = Schema.resolve(data, inner, options, strict);
|
|
272
|
+
try {
|
|
273
|
+
return [createVolatile(value), adapted];
|
|
274
|
+
} catch (error) {
|
|
275
|
+
throw new ValidationError(error instanceof Error ? error.message : String(error), options);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
240
278
|
if (options.ignore?.(data, schema)) return [data];
|
|
241
279
|
if (isNullable(data) && schema.type !== "lazy") {
|
|
242
280
|
if (schema.meta.required) throw new ValidationError(`missing required value`, options);
|
|
@@ -339,6 +377,7 @@ Schema.extend("lazy", (data, schema, options, strict) => {
|
|
|
339
377
|
...schema.meta,
|
|
340
378
|
...schema.inner.meta
|
|
341
379
|
};
|
|
380
|
+
validateVolatileSchema(schema.inner, options.path, true);
|
|
342
381
|
}
|
|
343
382
|
return Schema.resolve(data, schema.inner, options, strict);
|
|
344
383
|
});
|
|
@@ -438,7 +477,7 @@ function property(data, key, schema, options) {
|
|
|
438
477
|
} catch (e) {
|
|
439
478
|
if (!options?.autofix) throw e;
|
|
440
479
|
delete data[key];
|
|
441
|
-
return schema.meta.default;
|
|
480
|
+
return schema.meta.volatile ? createVolatile(schema.meta.default) : schema.meta.default;
|
|
442
481
|
}
|
|
443
482
|
}
|
|
444
483
|
Schema.extend("array", (data, { inner, meta }, options) => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Binary, type Dict } from '@deepseek-ai/cosmokit';
|
|
2
|
+
import { type Volatile } from '@deepseek-ai/cosmokit';
|
|
2
3
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
4
|
declare const kSchema: unique symbol;
|
|
4
5
|
declare global {
|
|
5
6
|
namespace Schemastery {
|
|
6
7
|
/** Convert primitive constructors, constants, and existing schemas into a schema type. */
|
|
7
|
-
type From<X> = X extends string | number | boolean ? Schema<X> : X extends Schema ? X : X extends typeof String ? Schema<string> : X extends typeof Number ? Schema<number> : X extends typeof Boolean ? Schema<boolean> : X extends typeof Function ? Schema<Function, (...args: any[]) => any> : X extends Constructor<infer S> ? Schema<S> : never;
|
|
8
|
-
type TypeS1<X> = X extends Schema<infer S,
|
|
9
|
-
type Inverse<X> = X extends Schema<
|
|
8
|
+
type From<X> = X extends string | number | boolean ? Schema<X> : X extends Schema<any, any, SchemaMode> ? X : X extends typeof String ? Schema<string> : X extends typeof Number ? Schema<number> : X extends typeof Boolean ? Schema<boolean> : X extends typeof Function ? Schema<Function, (...args: any[]) => any> : X extends Constructor<infer S> ? Schema<S> : never;
|
|
9
|
+
type TypeS1<X> = X extends Schema<infer S, infer _T, infer _M> ? S : never;
|
|
10
|
+
type Inverse<X> = X extends Schema<infer _S, infer T, infer M> ? (arg: SchemaOutput<T, M>) => void : never;
|
|
10
11
|
/** Input type accepted by a schema-like value. */
|
|
11
12
|
type TypeS<X> = TypeS1<From<X>>;
|
|
12
13
|
/** Output type returned by a schema-like value after validation. */
|
|
@@ -14,7 +15,7 @@ declare global {
|
|
|
14
15
|
/** Resolver callback used by custom schema types registered with `Schema.extend()`. */
|
|
15
16
|
type Resolve = (data: any, schema: Schema, options: Options, strict?: boolean) => [any, any?];
|
|
16
17
|
/** Input type accepted by one schema in an intersection. */
|
|
17
|
-
type IntersectS<X> = From<X> extends Schema<infer S,
|
|
18
|
+
type IntersectS<X> = From<X> extends Schema<infer S, infer _T, infer _M> ? S : never;
|
|
18
19
|
/** Output type returned by one schema in an intersection. */
|
|
19
20
|
type IntersectT<X> = Inverse<From<X>> extends ((arg: infer T) => void) ? T : never;
|
|
20
21
|
type TupleS<X extends readonly any[]> = X extends readonly [infer L, ...infer R] ? [TypeS<L>?, ...TupleS<R>] : any[];
|
|
@@ -73,8 +74,8 @@ declare global {
|
|
|
73
74
|
dict<X, Y extends Schema<any, string> = Schema<string>>(inner: X, sKey?: Y): Schema<Dict<TypeS<X>, TypeS<Y>>, Dict<TypeT<X>, TypeT<Y>>>;
|
|
74
75
|
/** Accept tuple arrays where each index matches the corresponding schema. */
|
|
75
76
|
tuple<const X extends readonly any[]>(list: X): Schema<TupleS<X>, TupleT<X>>;
|
|
76
|
-
/** Accept plain objects
|
|
77
|
-
object<X extends Dict>(dict: X): Schema<ObjectS<X
|
|
77
|
+
/** Accept plain objects; infer fields from the dictionary, not the enclosing schema's output type. */
|
|
78
|
+
object<X extends Dict>(dict: X): Schema<ObjectS<NoInfer<X>>, ObjectT<NoInfer<X>>>;
|
|
78
79
|
/** Accept values matching at least one schema in `list`. */
|
|
79
80
|
union<const X>(list: readonly X[]): Schema<TypeS<X>, TypeT<X>>;
|
|
80
81
|
/** Accept values matching every schema in `list`, merging object outputs. */
|
|
@@ -82,7 +83,7 @@ declare global {
|
|
|
82
83
|
/** Validate with `inner`, then convert the result with `callback`. */
|
|
83
84
|
transform<X, T>(inner: X, callback: (value: TypeS<X>, options: Schemastery.Options) => T, preserve?: boolean): Schema<TypeS<X>, T>;
|
|
84
85
|
/** Defer construction of a recursive schema until validation or serialization. */
|
|
85
|
-
lazy<X extends Schema
|
|
86
|
+
lazy<X extends Schema<any, any, SchemaMode>>(callback: () => X): X;
|
|
86
87
|
ValidationError: typeof ValidationError;
|
|
87
88
|
}
|
|
88
89
|
/** Runtime validation options shared by all schema calls. */
|
|
@@ -98,6 +99,8 @@ declare global {
|
|
|
98
99
|
interface Meta<T = any> {
|
|
99
100
|
default?: T extends {} ? Partial<T> : T;
|
|
100
101
|
required?: boolean;
|
|
102
|
+
/** Parse this node as a stable config reference; its type and UI metadata remain unchanged. */
|
|
103
|
+
volatile?: boolean;
|
|
101
104
|
disabled?: boolean;
|
|
102
105
|
collapse?: boolean;
|
|
103
106
|
badges?: {
|
|
@@ -121,9 +124,9 @@ declare global {
|
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
/** Callable schema instance that validates input and returns normalized output. */
|
|
124
|
-
interface Schemastery<S = any, T = S> {
|
|
125
|
-
(data?: S | null, options?: Schemastery.Options): T
|
|
126
|
-
new (data?: S | null, options?: Schemastery.Options): T
|
|
127
|
+
interface Schemastery<S = any, T = S, Mode extends SchemaMode = 'plain'> {
|
|
128
|
+
(data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
|
|
129
|
+
new (data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
|
|
127
130
|
[kSchema]: true;
|
|
128
131
|
uid: number;
|
|
129
132
|
meta: Schemastery.Meta<T>;
|
|
@@ -143,49 +146,54 @@ declare global {
|
|
|
143
146
|
/** Format this schema as a compact TypeScript-like type string. */
|
|
144
147
|
toString(inline?: boolean): string;
|
|
145
148
|
/** Serialize this schema, preserving shared and recursive references. */
|
|
146
|
-
toJSON(): Schema<S, T>;
|
|
149
|
+
toJSON(): Schema<S, T, Mode>;
|
|
147
150
|
/** Mark nullable input as invalid unless a default supplies a fallback. */
|
|
148
|
-
required(value?:
|
|
151
|
+
required<R extends boolean = true>(value?: R): Schema<S, T, SetRequired<Mode, R>>;
|
|
152
|
+
/**
|
|
153
|
+
* Parse this config field as a stable reference containing immutable data.
|
|
154
|
+
* @returns a schema whose output supports get(), including when the field is absent.
|
|
155
|
+
*/
|
|
156
|
+
volatile(): Schema<NoInfer<S>, NoInfer<T>, Mode extends 'defined' | 'volatile-defined' ? 'volatile-defined' : 'volatile'>;
|
|
149
157
|
/** Hide this schema node from UI renderers. */
|
|
150
|
-
hidden(value?: boolean): Schema<S, T>;
|
|
158
|
+
hidden(value?: boolean): Schema<S, T, Mode>;
|
|
151
159
|
/** Return the default value instead of throwing when validation fails. */
|
|
152
|
-
loose(value?: boolean): Schema<S, T>;
|
|
160
|
+
loose(value?: boolean): Schema<S, T, Mode>;
|
|
153
161
|
/** Attach a renderer role and optional role-specific metadata. */
|
|
154
|
-
role(text: string, extra?: any): Schema<S, T>;
|
|
162
|
+
role(text: string, extra?: any): Schema<S, T, Mode>;
|
|
155
163
|
/** Attach an external documentation link. */
|
|
156
|
-
link(link: string): Schema<S, T>;
|
|
164
|
+
link(link: string): Schema<S, T, Mode>;
|
|
157
165
|
/** Set the fallback value used for nullable input. */
|
|
158
|
-
default(value: T): Schema<S, T
|
|
166
|
+
default(value: T | NoInfer<Partial<S>>): Schema<S, T, SetRequired<Mode, true>>;
|
|
159
167
|
/** Attach an auxiliary comment for documentation or form UIs. */
|
|
160
|
-
comment(text: string): Schema<S, T>;
|
|
168
|
+
comment(text: string): Schema<S, T, Mode>;
|
|
161
169
|
/** Attach a localized or plain description for documentation or form UIs. */
|
|
162
|
-
description(text: string): Schema<S, T>;
|
|
170
|
+
description(text: string): Schema<S, T, Mode>;
|
|
163
171
|
/** Mark this schema node as disabled for form UIs. */
|
|
164
|
-
disabled(value?: boolean): Schema<S, T>;
|
|
172
|
+
disabled(value?: boolean): Schema<S, T, Mode>;
|
|
165
173
|
/** Request collapsed rendering for nested form UIs. */
|
|
166
|
-
collapse(value?: boolean): Schema<S, T>;
|
|
174
|
+
collapse(value?: boolean): Schema<S, T, Mode>;
|
|
167
175
|
/** Add a deprecated badge to this schema node. */
|
|
168
|
-
deprecated(): Schema<S, T>;
|
|
176
|
+
deprecated(): Schema<S, T, Mode>;
|
|
169
177
|
/** Add an experimental badge to this schema node. */
|
|
170
|
-
experimental(): Schema<S, T>;
|
|
178
|
+
experimental(): Schema<S, T, Mode>;
|
|
171
179
|
/** Require strings to match a regular expression. */
|
|
172
|
-
pattern(regexp: RegExp): Schema<S, T>;
|
|
180
|
+
pattern(regexp: RegExp): Schema<S, T, Mode>;
|
|
173
181
|
/** Set an inclusive maximum for numbers or collection lengths. */
|
|
174
|
-
max(value: number): Schema<S, T>;
|
|
182
|
+
max(value: number): Schema<S, T, Mode>;
|
|
175
183
|
/** Set an inclusive minimum for numbers or collection lengths. */
|
|
176
|
-
min(value: number): Schema<S, T>;
|
|
184
|
+
min(value: number): Schema<S, T, Mode>;
|
|
177
185
|
/** Set the numeric increment constraint. */
|
|
178
|
-
step(value: number): Schema<S, T>;
|
|
186
|
+
step(value: number): Schema<S, T, Mode>;
|
|
179
187
|
/** Add or replace an object property schema. */
|
|
180
|
-
set(key: string, value: Schema): Schema<S, T>;
|
|
188
|
+
set(key: string, value: Schema): Schema<S, T, Mode>;
|
|
181
189
|
/** Append a tuple, union, or intersection member schema. */
|
|
182
|
-
push(value: Schema): Schema<S, T>;
|
|
190
|
+
push(value: Schema): Schema<S, T, Mode>;
|
|
183
191
|
/** Remove values equal to schema defaults from normalized output. */
|
|
184
192
|
simplify(value?: any): any;
|
|
185
193
|
/** Return a schema clone with descriptions merged from locale messages. */
|
|
186
|
-
i18n(messages: Dict): Schema<S, T>;
|
|
194
|
+
i18n(messages: Dict): Schema<S, T, Mode>;
|
|
187
195
|
/** Attach arbitrary metadata consumed by form renderers and downstream tools. */
|
|
188
|
-
extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T>;
|
|
196
|
+
extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T, Mode>;
|
|
189
197
|
}
|
|
190
198
|
}
|
|
191
199
|
declare class ValidationError extends TypeError {
|
|
@@ -194,7 +202,10 @@ declare class ValidationError extends TypeError {
|
|
|
194
202
|
constructor(message: string, options: Schemastery.Options);
|
|
195
203
|
static is(error: any): error is ValidationError;
|
|
196
204
|
}
|
|
197
|
-
type
|
|
205
|
+
type SchemaMode = 'plain' | 'defined' | 'volatile' | 'volatile-defined';
|
|
206
|
+
type SchemaOutput<T, M extends SchemaMode> = M extends 'volatile' ? Volatile<T | undefined> : M extends 'volatile-defined' ? Volatile<T> : T;
|
|
207
|
+
type SetRequired<M extends SchemaMode, R extends boolean> = M extends 'volatile' | 'volatile-defined' ? R extends true ? 'volatile-defined' : 'volatile' : R extends true ? 'defined' : 'plain';
|
|
208
|
+
type Schema<S = any, T = S, Mode extends SchemaMode = 'plain'> = Schemastery<S, T, Mode>;
|
|
198
209
|
declare const Schema: Schemastery.Static;
|
|
199
210
|
export default Schema;
|
|
200
211
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2E,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAClI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,QAAA,MAAM,OAAO,eAA4B,CAAA;AAGzC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW,CAAC;QACpB,0FAA0F;QAC1F,KAAY,IAAI,CAAC,CAAC,IACd,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,GAC/C,CAAC,SAAS,MAAM,GAAG,CAAC,GACpB,CAAC,SAAS,OAAO,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GACxC,CAAC,SAAS,OAAO,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GACxC,CAAC,SAAS,OAAO,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAC1C,CAAC,SAAS,OAAO,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GACrE,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAC1C,KAAK,CAAA;QAET,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QA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"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@standard-schema/spec": "^1.1.0",
|
|
37
|
-
"@deepseek-ai/cosmokit": "
|
|
37
|
+
"@deepseek-ai/cosmokit": "~1.8.5"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Binary, clone, deepEqual, filterKeys, isNullable, isPlainObject, pick, valueMap, type Dict } from '@deepseek-ai/cosmokit'
|
|
2
|
+
import { createVolatile, isVolatile, type Volatile } from '@deepseek-ai/cosmokit'
|
|
2
3
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
3
4
|
|
|
4
5
|
const kSchema = Symbol.for('schemastery')
|
|
@@ -9,7 +10,7 @@ declare global {
|
|
|
9
10
|
/** Convert primitive constructors, constants, and existing schemas into a schema type. */
|
|
10
11
|
export type From<X> =
|
|
11
12
|
| X extends string | number | boolean ? Schema<X>
|
|
12
|
-
: X extends Schema ? X
|
|
13
|
+
: X extends Schema<any, any, SchemaMode> ? X
|
|
13
14
|
: X extends typeof String ? Schema<string>
|
|
14
15
|
: X extends typeof Number ? Schema<number>
|
|
15
16
|
: X extends typeof Boolean ? Schema<boolean>
|
|
@@ -17,8 +18,8 @@ declare global {
|
|
|
17
18
|
: X extends Constructor<infer S> ? Schema<S>
|
|
18
19
|
: never
|
|
19
20
|
|
|
20
|
-
type TypeS1<X> = X extends Schema<infer S,
|
|
21
|
-
type Inverse<X> = X extends Schema<
|
|
21
|
+
type TypeS1<X> = X extends Schema<infer S, infer _T, infer _M> ? S : never
|
|
22
|
+
type Inverse<X> = X extends Schema<infer _S, infer T, infer M> ? (arg: SchemaOutput<T, M>) => void : never
|
|
22
23
|
|
|
23
24
|
/** Input type accepted by a schema-like value. */
|
|
24
25
|
export type TypeS<X> = TypeS1<From<X>>
|
|
@@ -28,7 +29,7 @@ declare global {
|
|
|
28
29
|
export type Resolve = (data: any, schema: Schema, options: Options, strict?: boolean) => [any, any?]
|
|
29
30
|
|
|
30
31
|
/** Input type accepted by one schema in an intersection. */
|
|
31
|
-
export type IntersectS<X> = From<X> extends Schema<infer S,
|
|
32
|
+
export type IntersectS<X> = From<X> extends Schema<infer S, infer _T, infer _M> ? S : never
|
|
32
33
|
/** Output type returned by one schema in an intersection. */
|
|
33
34
|
export type IntersectT<X> = Inverse<From<X>> extends ((arg: infer T) => void) ? T : never
|
|
34
35
|
|
|
@@ -85,8 +86,8 @@ declare global {
|
|
|
85
86
|
dict<X, Y extends Schema<any, string> = Schema<string>>(inner: X, sKey?: Y): Schema<Dict<TypeS<X>, TypeS<Y>>, Dict<TypeT<X>, TypeT<Y>>>
|
|
86
87
|
/** Accept tuple arrays where each index matches the corresponding schema. */
|
|
87
88
|
tuple<const X extends readonly any[]>(list: X): Schema<TupleS<X>, TupleT<X>>
|
|
88
|
-
/** Accept plain objects
|
|
89
|
-
object<X extends Dict>(dict: X): Schema<ObjectS<X
|
|
89
|
+
/** Accept plain objects; infer fields from the dictionary, not the enclosing schema's output type. */
|
|
90
|
+
object<X extends Dict>(dict: X): Schema<ObjectS<NoInfer<X>>, ObjectT<NoInfer<X>>>
|
|
90
91
|
/** Accept values matching at least one schema in `list`. */
|
|
91
92
|
union<const X>(list: readonly X[]): Schema<TypeS<X>, TypeT<X>>
|
|
92
93
|
/** Accept values matching every schema in `list`, merging object outputs. */
|
|
@@ -94,7 +95,7 @@ declare global {
|
|
|
94
95
|
/** Validate with `inner`, then convert the result with `callback`. */
|
|
95
96
|
transform<X, T>(inner: X, callback: (value: TypeS<X>, options: Schemastery.Options) => T, preserve?: boolean): Schema<TypeS<X>, T>
|
|
96
97
|
/** Defer construction of a recursive schema until validation or serialization. */
|
|
97
|
-
lazy<X extends Schema
|
|
98
|
+
lazy<X extends Schema<any, any, SchemaMode>>(callback: () => X): X
|
|
98
99
|
ValidationError: typeof ValidationError
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -112,6 +113,8 @@ declare global {
|
|
|
112
113
|
export interface Meta<T = any> {
|
|
113
114
|
default?: T extends {} ? Partial<T> : T
|
|
114
115
|
required?: boolean
|
|
116
|
+
/** Parse this node as a stable config reference; its type and UI metadata remain unchanged. */
|
|
117
|
+
volatile?: boolean
|
|
115
118
|
disabled?: boolean
|
|
116
119
|
collapse?: boolean
|
|
117
120
|
badges?: { text: string; type: string }[]
|
|
@@ -130,9 +133,9 @@ declare global {
|
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
/** Callable schema instance that validates input and returns normalized output. */
|
|
133
|
-
interface Schemastery<S = any, T = S> {
|
|
134
|
-
(data?: S | null, options?: Schemastery.Options): T
|
|
135
|
-
new (data?: S | null, options?: Schemastery.Options): T
|
|
136
|
+
interface Schemastery<S = any, T = S, Mode extends SchemaMode = 'plain'> {
|
|
137
|
+
(data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>
|
|
138
|
+
new (data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>
|
|
136
139
|
[kSchema]: true
|
|
137
140
|
uid: number
|
|
138
141
|
meta: Schemastery.Meta<T>
|
|
@@ -152,49 +155,54 @@ declare global {
|
|
|
152
155
|
/** Format this schema as a compact TypeScript-like type string. */
|
|
153
156
|
toString(inline?: boolean): string
|
|
154
157
|
/** Serialize this schema, preserving shared and recursive references. */
|
|
155
|
-
toJSON(): Schema<S, T>
|
|
158
|
+
toJSON(): Schema<S, T, Mode>
|
|
156
159
|
/** Mark nullable input as invalid unless a default supplies a fallback. */
|
|
157
|
-
required(value?:
|
|
160
|
+
required<R extends boolean = true>(value?: R): Schema<S, T, SetRequired<Mode, R>>
|
|
161
|
+
/**
|
|
162
|
+
* Parse this config field as a stable reference containing immutable data.
|
|
163
|
+
* @returns a schema whose output supports get(), including when the field is absent.
|
|
164
|
+
*/
|
|
165
|
+
volatile(): Schema<NoInfer<S>, NoInfer<T>, Mode extends 'defined' | 'volatile-defined' ? 'volatile-defined' : 'volatile'>
|
|
158
166
|
/** Hide this schema node from UI renderers. */
|
|
159
|
-
hidden(value?: boolean): Schema<S, T>
|
|
167
|
+
hidden(value?: boolean): Schema<S, T, Mode>
|
|
160
168
|
/** Return the default value instead of throwing when validation fails. */
|
|
161
|
-
loose(value?: boolean): Schema<S, T>
|
|
169
|
+
loose(value?: boolean): Schema<S, T, Mode>
|
|
162
170
|
/** Attach a renderer role and optional role-specific metadata. */
|
|
163
|
-
role(text: string, extra?: any): Schema<S, T>
|
|
171
|
+
role(text: string, extra?: any): Schema<S, T, Mode>
|
|
164
172
|
/** Attach an external documentation link. */
|
|
165
|
-
link(link: string): Schema<S, T>
|
|
173
|
+
link(link: string): Schema<S, T, Mode>
|
|
166
174
|
/** Set the fallback value used for nullable input. */
|
|
167
|
-
default(value: T): Schema<S, T
|
|
175
|
+
default(value: T | NoInfer<Partial<S>>): Schema<S, T, SetRequired<Mode, true>>
|
|
168
176
|
/** Attach an auxiliary comment for documentation or form UIs. */
|
|
169
|
-
comment(text: string): Schema<S, T>
|
|
177
|
+
comment(text: string): Schema<S, T, Mode>
|
|
170
178
|
/** Attach a localized or plain description for documentation or form UIs. */
|
|
171
|
-
description(text: string): Schema<S, T>
|
|
179
|
+
description(text: string): Schema<S, T, Mode>
|
|
172
180
|
/** Mark this schema node as disabled for form UIs. */
|
|
173
|
-
disabled(value?: boolean): Schema<S, T>
|
|
181
|
+
disabled(value?: boolean): Schema<S, T, Mode>
|
|
174
182
|
/** Request collapsed rendering for nested form UIs. */
|
|
175
|
-
collapse(value?: boolean): Schema<S, T>
|
|
183
|
+
collapse(value?: boolean): Schema<S, T, Mode>
|
|
176
184
|
/** Add a deprecated badge to this schema node. */
|
|
177
|
-
deprecated(): Schema<S, T>
|
|
185
|
+
deprecated(): Schema<S, T, Mode>
|
|
178
186
|
/** Add an experimental badge to this schema node. */
|
|
179
|
-
experimental(): Schema<S, T>
|
|
187
|
+
experimental(): Schema<S, T, Mode>
|
|
180
188
|
/** Require strings to match a regular expression. */
|
|
181
|
-
pattern(regexp: RegExp): Schema<S, T>
|
|
189
|
+
pattern(regexp: RegExp): Schema<S, T, Mode>
|
|
182
190
|
/** Set an inclusive maximum for numbers or collection lengths. */
|
|
183
|
-
max(value: number): Schema<S, T>
|
|
191
|
+
max(value: number): Schema<S, T, Mode>
|
|
184
192
|
/** Set an inclusive minimum for numbers or collection lengths. */
|
|
185
|
-
min(value: number): Schema<S, T>
|
|
193
|
+
min(value: number): Schema<S, T, Mode>
|
|
186
194
|
/** Set the numeric increment constraint. */
|
|
187
|
-
step(value: number): Schema<S, T>
|
|
195
|
+
step(value: number): Schema<S, T, Mode>
|
|
188
196
|
/** Add or replace an object property schema. */
|
|
189
|
-
set(key: string, value: Schema): Schema<S, T>
|
|
197
|
+
set(key: string, value: Schema): Schema<S, T, Mode>
|
|
190
198
|
/** Append a tuple, union, or intersection member schema. */
|
|
191
|
-
push(value: Schema): Schema<S, T>
|
|
199
|
+
push(value: Schema): Schema<S, T, Mode>
|
|
192
200
|
/** Remove values equal to schema defaults from normalized output. */
|
|
193
201
|
simplify(value?: any): any
|
|
194
202
|
/** Return a schema clone with descriptions merged from locale messages. */
|
|
195
|
-
i18n(messages: Dict): Schema<S, T>
|
|
203
|
+
i18n(messages: Dict): Schema<S, T, Mode>
|
|
196
204
|
/** Attach arbitrary metadata consumed by form renderers and downstream tools. */
|
|
197
|
-
extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T>
|
|
205
|
+
extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T, Mode>
|
|
198
206
|
}
|
|
199
207
|
}
|
|
200
208
|
|
|
@@ -234,7 +242,14 @@ Object.defineProperty(ValidationError.prototype, kValidationError, {
|
|
|
234
242
|
value: true,
|
|
235
243
|
})
|
|
236
244
|
|
|
237
|
-
type
|
|
245
|
+
type SchemaMode = 'plain' | 'defined' | 'volatile' | 'volatile-defined'
|
|
246
|
+
type SchemaOutput<T, M extends SchemaMode> = M extends 'volatile' ? Volatile<T | undefined>
|
|
247
|
+
: M extends 'volatile-defined' ? Volatile<T> : T
|
|
248
|
+
type SetRequired<M extends SchemaMode, R extends boolean> = M extends 'volatile' | 'volatile-defined'
|
|
249
|
+
? R extends true ? 'volatile-defined' : 'volatile'
|
|
250
|
+
: R extends true ? 'defined' : 'plain'
|
|
251
|
+
|
|
252
|
+
type Schema<S = any, T = S, Mode extends SchemaMode = 'plain'> = Schemastery<S, T, Mode>
|
|
238
253
|
|
|
239
254
|
const Schema = function (options: Schema) {
|
|
240
255
|
const schema = function (data: any, options: Schemastery.Options = {}) {
|
|
@@ -405,6 +420,7 @@ Schema.prototype.pattern = function pattern(regexp) {
|
|
|
405
420
|
}
|
|
406
421
|
|
|
407
422
|
Schema.prototype.simplify = function simplify(this: Schema, value) {
|
|
423
|
+
if (isVolatile(value)) value = value.get()
|
|
408
424
|
if (deepEqual(value, this.meta.default, this.type === 'dict')) return null
|
|
409
425
|
if (isNullable(value)) return value
|
|
410
426
|
if (this.type === 'object' || this.type === 'dict') {
|
|
@@ -461,7 +477,36 @@ for (const key of ['default', 'link', 'comment', 'description', 'max', 'min', 's
|
|
|
461
477
|
})
|
|
462
478
|
}
|
|
463
479
|
|
|
480
|
+
Schema.prototype.volatile = function volatile() {
|
|
481
|
+
if (this.meta.volatile) throw new TypeError('volatile schema is already wrapped')
|
|
482
|
+
return this.extra('volatile', true)
|
|
483
|
+
}
|
|
484
|
+
|
|
464
485
|
const resolvers: Dict<Schemastery.Resolve> = {}
|
|
486
|
+
const checkedVolatile = Symbol('checked-volatile-schema')
|
|
487
|
+
|
|
488
|
+
function validateVolatileSchema(schema: Schema, path: (keyof any)[] = [], blocked = false, seen = new Map<Schema, Set<boolean>>()) {
|
|
489
|
+
const states = seen.get(schema) ?? new Set<boolean>()
|
|
490
|
+
if (states.has(blocked)) return
|
|
491
|
+
states.add(blocked)
|
|
492
|
+
seen.set(schema, states)
|
|
493
|
+
if (schema.meta?.volatile && blocked) {
|
|
494
|
+
throw new ValidationError('volatile fields require a fixed object path without an enclosing volatile field', { path })
|
|
495
|
+
}
|
|
496
|
+
const nested = blocked || !!schema.meta?.volatile
|
|
497
|
+
if (schema.dict) {
|
|
498
|
+
for (const [key, child] of Object.entries(schema.dict)) validateVolatileSchema(child, [...path, key], nested, seen)
|
|
499
|
+
}
|
|
500
|
+
if (schema.sKey) validateVolatileSchema(schema.sKey, [...path, '<key>'], true, seen)
|
|
501
|
+
if (schema.inner && (schema.type !== 'lazy' || schema.inner[kSchema])) {
|
|
502
|
+
validateVolatileSchema(schema.inner, [...path, '*'], true, seen)
|
|
503
|
+
}
|
|
504
|
+
if (schema.list) {
|
|
505
|
+
for (let index = 0; index < schema.list.length; index++) {
|
|
506
|
+
validateVolatileSchema(schema.list[index]!, [...path, String(index)], true, seen)
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
465
510
|
|
|
466
511
|
Schema.extend = function extend(type, resolve) {
|
|
467
512
|
resolvers[type] = resolve
|
|
@@ -469,6 +514,20 @@ Schema.extend = function extend(type, resolve) {
|
|
|
469
514
|
|
|
470
515
|
Schema.resolve = function resolve(data, schema, options = {}, strict = false) {
|
|
471
516
|
if (!schema) return [data]
|
|
517
|
+
if (!(options as Schemastery.Options & { [checkedVolatile]?: boolean })[checkedVolatile]) {
|
|
518
|
+
validateVolatileSchema(schema, options.path)
|
|
519
|
+
options = { ...options, [checkedVolatile]: true } as Schemastery.Options
|
|
520
|
+
}
|
|
521
|
+
if (schema.meta?.volatile) {
|
|
522
|
+
const inner = Schema(schema)
|
|
523
|
+
inner.meta = { ...schema.meta, volatile: false }
|
|
524
|
+
const [value, adapted] = Schema.resolve(data, inner, options, strict)
|
|
525
|
+
try {
|
|
526
|
+
return [createVolatile(value), adapted]
|
|
527
|
+
} catch (error) {
|
|
528
|
+
throw new ValidationError(error instanceof Error ? error.message : String(error), options)
|
|
529
|
+
}
|
|
530
|
+
}
|
|
472
531
|
if (options.ignore?.(data, schema)) return [data]
|
|
473
532
|
|
|
474
533
|
if (isNullable(data) && schema.type !== 'lazy') {
|
|
@@ -582,6 +641,7 @@ Schema.extend('lazy', (data, schema, options, strict) => {
|
|
|
582
641
|
if (!schema.inner![kSchema]) {
|
|
583
642
|
schema.inner = schema.builder!()
|
|
584
643
|
schema.inner!.meta = { ...schema.meta, ...schema.inner!.meta }
|
|
644
|
+
validateVolatileSchema(schema.inner!, options.path, true)
|
|
585
645
|
}
|
|
586
646
|
return Schema.resolve(data, schema.inner!, options, strict)
|
|
587
647
|
})
|
|
@@ -706,7 +766,7 @@ function property(data: any, key: keyof any, schema: Schema, options: Schemaster
|
|
|
706
766
|
} catch (e) {
|
|
707
767
|
if (!options?.autofix) throw e
|
|
708
768
|
delete data[key]
|
|
709
|
-
return schema.meta.default
|
|
769
|
+
return schema.meta.volatile ? createVolatile(schema.meta.default) : schema.meta.default
|
|
710
770
|
}
|
|
711
771
|
}
|
|
712
772
|
|