@powerlines/schema 0.11.28 → 0.11.37
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/bundle.cjs +34 -20
- package/dist/bundle.d.cts +3 -3
- package/dist/bundle.d.cts.map +1 -1
- package/dist/bundle.d.mts +3 -3
- package/dist/bundle.d.mts.map +1 -1
- package/dist/bundle.mjs +35 -21
- package/dist/bundle.mjs.map +1 -1
- package/dist/codegen.cjs +55 -8
- package/dist/codegen.d.cts +12 -6
- package/dist/codegen.d.cts.map +1 -1
- package/dist/codegen.d.mts +12 -6
- package/dist/codegen.d.mts.map +1 -1
- package/dist/codegen.mjs +52 -8
- package/dist/codegen.mjs.map +1 -1
- package/dist/constants.cjs +42 -0
- package/dist/constants.d.cts +15 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +15 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +39 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/extract.cjs +144 -95
- package/dist/extract.d.cts +34 -69
- package/dist/extract.d.cts.map +1 -1
- package/dist/extract.d.mts +34 -69
- package/dist/extract.d.mts.map +1 -1
- package/dist/extract.mjs +144 -95
- package/dist/extract.mjs.map +1 -1
- package/dist/helpers.cjs +87 -0
- package/dist/helpers.d.cts +48 -0
- package/dist/helpers.d.cts.map +1 -0
- package/dist/helpers.d.mts +48 -0
- package/dist/helpers.d.mts.map +1 -0
- package/dist/helpers.mjs +84 -0
- package/dist/helpers.mjs.map +1 -0
- package/dist/index.cjs +29 -5
- package/dist/index.d.cts +8 -5
- package/dist/index.d.mts +8 -5
- package/dist/index.mjs +7 -4
- package/dist/metadata.cjs +80 -0
- package/dist/metadata.d.cts +52 -0
- package/dist/metadata.d.cts.map +1 -0
- package/dist/metadata.d.mts +52 -0
- package/dist/metadata.d.mts.map +1 -0
- package/dist/metadata.mjs +76 -0
- package/dist/metadata.mjs.map +1 -0
- package/dist/persistence.cjs +75 -0
- package/dist/persistence.d.cts +47 -0
- package/dist/persistence.d.cts.map +1 -0
- package/dist/persistence.d.mts +47 -0
- package/dist/persistence.d.mts.map +1 -0
- package/dist/persistence.mjs +71 -0
- package/dist/persistence.mjs.map +1 -0
- package/dist/reflection.cjs +292 -299
- package/dist/reflection.d.cts +3 -16
- package/dist/reflection.d.cts.map +1 -1
- package/dist/reflection.d.mts +3 -16
- package/dist/reflection.d.mts.map +1 -1
- package/dist/reflection.mjs +291 -299
- package/dist/reflection.mjs.map +1 -1
- package/dist/resolve.cjs +7 -7
- package/dist/resolve.mjs +7 -7
- package/dist/resolve.mjs.map +1 -1
- package/dist/type-checks.cjs +126 -25
- package/dist/type-checks.d.cts +45 -23
- package/dist/type-checks.d.cts.map +1 -1
- package/dist/type-checks.d.mts +45 -23
- package/dist/type-checks.d.mts.map +1 -1
- package/dist/type-checks.mjs +125 -25
- package/dist/type-checks.mjs.map +1 -1
- package/dist/types.d.cts +237 -95
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +237 -95
- package/dist/types.d.mts.map +1 -1
- package/package.json +24 -8
- package/dist/jtd.cjs +0 -385
- package/dist/jtd.d.cts +0 -15
- package/dist/jtd.d.cts.map +0 -1
- package/dist/jtd.d.mts +0 -15
- package/dist/jtd.d.mts.map +0 -1
- package/dist/jtd.mjs +0 -384
- package/dist/jtd.mjs.map +0 -1
package/dist/reflection.d.cts
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonSchema } from "./types.cjs";
|
|
2
2
|
import { Type } from "@powerlines/deepkit/vendor/type";
|
|
3
3
|
|
|
4
4
|
//#region src/reflection.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* Converts a Deepkit type reflection into a JSON
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* Some TypeScript constructs have no direct JTD equivalent and are handled with the closest available form:
|
|
10
|
-
*
|
|
11
|
-
* - `null` and `undefined` become the empty JTD form with `nullable: true`.
|
|
12
|
-
* - Unions of primitives that cannot be expressed as a JTD enum collapse to the empty form (which validates any value).
|
|
13
|
-
* - String/number/bigint literal unions are emitted as a JTD enum (non-string members are stringified, as JTD requires string enum members).
|
|
14
|
-
* - Tuples are emitted as a JTD elements form whose element schema is the single tuple member type, or the empty schema for mixed tuples.
|
|
15
|
-
* - `Date` is emitted as `{ type: "timestamp" }`.
|
|
16
|
-
* - Discriminated unions of object literals (a shared string-literal tag property) are emitted as a JTD discriminator form.
|
|
17
|
-
*
|
|
18
|
-
* @param reflection - The Deepkit type reflection to convert.
|
|
19
|
-
* @returns The corresponding JTD form, or `undefined` if the type cannot be represented.
|
|
6
|
+
* Converts a Deepkit type reflection into a JSON Schema (draft-07) fragment.
|
|
20
7
|
*/
|
|
21
|
-
declare function reflectionToJsonSchema<
|
|
8
|
+
declare function reflectionToJsonSchema<T = unknown>(reflection: Type): JsonSchema<T> | undefined;
|
|
22
9
|
//#endregion
|
|
23
10
|
export { reflectionToJsonSchema };
|
|
24
11
|
//# sourceMappingURL=reflection.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflection.d.cts","names":[],"sources":["../src/reflection.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"reflection.d.cts","names":[],"sources":["../src/reflection.ts"],"mappings":";;;;;;AAsJA;iBAAgB,sBAAA,aAAA,CACd,UAAA,EAAY,IAAA,GACX,UAAA,CAAW,CAAA"}
|
package/dist/reflection.d.mts
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonSchema } from "./types.mjs";
|
|
2
2
|
import { Type } from "@powerlines/deepkit/vendor/type";
|
|
3
3
|
|
|
4
4
|
//#region src/reflection.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* Converts a Deepkit type reflection into a JSON
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* Some TypeScript constructs have no direct JTD equivalent and are handled with the closest available form:
|
|
10
|
-
*
|
|
11
|
-
* - `null` and `undefined` become the empty JTD form with `nullable: true`.
|
|
12
|
-
* - Unions of primitives that cannot be expressed as a JTD enum collapse to the empty form (which validates any value).
|
|
13
|
-
* - String/number/bigint literal unions are emitted as a JTD enum (non-string members are stringified, as JTD requires string enum members).
|
|
14
|
-
* - Tuples are emitted as a JTD elements form whose element schema is the single tuple member type, or the empty schema for mixed tuples.
|
|
15
|
-
* - `Date` is emitted as `{ type: "timestamp" }`.
|
|
16
|
-
* - Discriminated unions of object literals (a shared string-literal tag property) are emitted as a JTD discriminator form.
|
|
17
|
-
*
|
|
18
|
-
* @param reflection - The Deepkit type reflection to convert.
|
|
19
|
-
* @returns The corresponding JTD form, or `undefined` if the type cannot be represented.
|
|
6
|
+
* Converts a Deepkit type reflection into a JSON Schema (draft-07) fragment.
|
|
20
7
|
*/
|
|
21
|
-
declare function reflectionToJsonSchema<
|
|
8
|
+
declare function reflectionToJsonSchema<T = unknown>(reflection: Type): JsonSchema<T> | undefined;
|
|
22
9
|
//#endregion
|
|
23
10
|
export { reflectionToJsonSchema };
|
|
24
11
|
//# sourceMappingURL=reflection.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflection.d.mts","names":[],"sources":["../src/reflection.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"reflection.d.mts","names":[],"sources":["../src/reflection.ts"],"mappings":";;;;;;AAsJA;iBAAgB,sBAAA,aAAA,CACd,UAAA,EAAY,IAAA,GACX,UAAA,CAAW,CAAA"}
|