@powerlines/schema 0.11.1 → 0.11.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.
Files changed (62) hide show
  1. package/README.md +36 -22
  2. package/dist/bundle.d.cts +2 -2
  3. package/dist/bundle.d.cts.map +1 -1
  4. package/dist/bundle.d.mts +2 -2
  5. package/dist/bundle.d.mts.map +1 -1
  6. package/dist/bundle.mjs.map +1 -1
  7. package/dist/codegen.cjs +27 -0
  8. package/dist/codegen.d.cts +15 -0
  9. package/dist/codegen.d.cts.map +1 -0
  10. package/dist/codegen.d.mts +15 -0
  11. package/dist/codegen.d.mts.map +1 -0
  12. package/dist/codegen.mjs +24 -0
  13. package/dist/codegen.mjs.map +1 -0
  14. package/dist/extract.cjs +201 -52
  15. package/dist/extract.d.cts +81 -16
  16. package/dist/extract.d.cts.map +1 -1
  17. package/dist/extract.d.mts +81 -16
  18. package/dist/extract.d.mts.map +1 -1
  19. package/dist/extract.mjs +199 -55
  20. package/dist/extract.mjs.map +1 -1
  21. package/dist/index.cjs +15 -3
  22. package/dist/index.d.cts +7 -5
  23. package/dist/index.d.mts +7 -5
  24. package/dist/index.mjs +6 -4
  25. package/dist/jtd.cjs +385 -0
  26. package/dist/jtd.d.cts +15 -0
  27. package/dist/jtd.d.cts.map +1 -0
  28. package/dist/jtd.d.mts +15 -0
  29. package/dist/jtd.d.mts.map +1 -0
  30. package/dist/jtd.mjs +384 -0
  31. package/dist/jtd.mjs.map +1 -0
  32. package/dist/reflection.cjs +321 -100
  33. package/dist/reflection.d.cts +16 -13
  34. package/dist/reflection.d.cts.map +1 -1
  35. package/dist/reflection.d.mts +16 -13
  36. package/dist/reflection.d.mts.map +1 -1
  37. package/dist/reflection.mjs +323 -101
  38. package/dist/reflection.mjs.map +1 -1
  39. package/dist/resolve.d.cts +5 -5
  40. package/dist/resolve.d.cts.map +1 -1
  41. package/dist/resolve.d.mts +5 -5
  42. package/dist/resolve.d.mts.map +1 -1
  43. package/dist/resolve.mjs.map +1 -1
  44. package/dist/type-checks.cjs +76 -0
  45. package/dist/type-checks.d.cts +43 -0
  46. package/dist/type-checks.d.cts.map +1 -0
  47. package/dist/type-checks.d.mts +43 -0
  48. package/dist/type-checks.d.mts.map +1 -0
  49. package/dist/type-checks.mjs +71 -0
  50. package/dist/type-checks.mjs.map +1 -0
  51. package/dist/types.d.cts +166 -24
  52. package/dist/types.d.cts.map +1 -1
  53. package/dist/types.d.mts +166 -24
  54. package/dist/types.d.mts.map +1 -1
  55. package/package.json +25 -19
  56. package/dist/is-schema-definition.cjs +0 -18
  57. package/dist/is-schema-definition.d.cts +0 -13
  58. package/dist/is-schema-definition.d.cts.map +0 -1
  59. package/dist/is-schema-definition.d.mts +0 -13
  60. package/dist/is-schema-definition.d.mts.map +0 -1
  61. package/dist/is-schema-definition.mjs +0 -17
  62. package/dist/is-schema-definition.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { BundleOptions } from "./bundle.mjs";
2
- import { PluginContext } from "@powerlines/core";
2
+ import { TypeDefinitionReference } from "./types.mjs";
3
+ import { PluginContext, UnresolvedContext } from "@powerlines/core";
3
4
  import { Type } from "@powerlines/deepkit/vendor/type";
4
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
5
5
 
6
6
  //#region src/resolve.d.ts
7
7
  /**
@@ -12,7 +12,7 @@ import { TypeDefinitionParameter } from "@stryke/types/configuration";
12
12
  * @param overrides - Optional overrides for the ESBuild configuration.
13
13
  * @returns A promise that resolves to the compiled module.
14
14
  */
15
- declare function resolveModule<TResult, TContext extends PluginContext = PluginContext>(context: TContext, type: TypeDefinitionParameter, overrides?: BundleOptions): Promise<TResult>;
15
+ declare function resolveModule<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, type: TypeDefinitionReference, overrides?: BundleOptions): Promise<TResult>;
16
16
  /**
17
17
  * Compiles a type definition to a module and returns the specified export from the module.
18
18
  *
@@ -21,7 +21,7 @@ declare function resolveModule<TResult, TContext extends PluginContext = PluginC
21
21
  * @param options - Optional overrides for the ESBuild configuration.
22
22
  * @returns A promise that resolves to the compiled module.
23
23
  */
24
- declare function resolve<TResult, TContext extends PluginContext = PluginContext>(context: TContext, input: TypeDefinitionParameter, options?: BundleOptions): Promise<TResult>;
24
+ declare function resolve<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, input: TypeDefinitionReference, options?: BundleOptions): Promise<TResult>;
25
25
  /**
26
26
  * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.
27
27
  *
@@ -30,7 +30,7 @@ declare function resolve<TResult, TContext extends PluginContext = PluginContext
30
30
  * @param options - Optional overrides for the ESBuild configuration.
31
31
  * @returns A promise that resolves to the Deepkit Type reflection.
32
32
  */
33
- declare function resolveReflection<TContext extends PluginContext = PluginContext>(context: TContext, input: TypeDefinitionParameter, options?: BundleOptions): Promise<Type>;
33
+ declare function resolveReflection<TContext extends PluginContext = PluginContext>(context: TContext, input: TypeDefinitionReference, options?: BundleOptions): Promise<Type>;
34
34
  //#endregion
35
35
  export { resolve, resolveModule, resolveReflection };
36
36
  //# sourceMappingURL=resolve.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.mts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAuCA;;;;;;iBAAsB,aAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBAyEW,OAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,uBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,OAAA;;;;;;;;;iBAiDW,iBAAA,kBACH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,uBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,IAAA"}
1
+ {"version":3,"file":"resolve.d.mts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAqCA;;;;;;iBAAsB,aAAA,2BAEH,iBAAA,GAAoB,iBAAA,CAAA,CAErC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBAyEW,OAAA,2BAEH,iBAAA,GAAoB,iBAAA,CAAA,CAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,uBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,OAAA;;;;;;;;;iBAiDW,iBAAA,kBACH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,uBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.mjs","names":[],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { findFileDotExtension } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { bundle, BundleOptions } from \"./bundle\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n type: TypeDefinitionParameter,\n overrides?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle<TContext>(\n context,\n typeDefinition.file,\n overrides\n );\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: TypeDefinitionParameter,\n options?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(input)) {\n typeDefinition = parseTypeDefinition(input) as TypeDefinition;\n } else {\n typeDefinition = input;\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n typeDefinition,\n options\n );\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n typeDefinition.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n typeDefinition.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: TypeDefinitionParameter,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n })\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuCA,eAAsB,cAIpB,SACA,MACA,WACkB;C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AkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,SACD,CAAC,KACA,KACD,CAAC,kEAET;AAGH,QAAO;;;;;;;;;;AAWT,eAAsB,kBAGpB,SACA,OACA,SACe;AACf,QAAO,QACL,MAAM,QACJ,SACA,OACA,KAAK,SAAS,EACZ,SAAS,CACP,cAAc,SAAS;EACrB,YAAY;EACZ,OAAO;EACR,CAAC,CACH,EACF,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"resolve.mjs","names":[],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginContext, UnresolvedContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { findFileDotExtension } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { TypeDefinition } from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { bundle, BundleOptions } from \"./bundle\";\nimport { TypeDefinitionReference } from \"./types\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n type: TypeDefinitionReference,\n overrides?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle<TContext>(\n context,\n typeDefinition.file,\n overrides\n );\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: TypeDefinitionReference,\n options?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(input)) {\n typeDefinition = parseTypeDefinition(input) as TypeDefinition;\n } else {\n typeDefinition = input;\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n typeDefinition,\n options\n );\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n typeDefinition.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n typeDefinition.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: TypeDefinitionReference,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n })\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,eAAsB,cAIpB,SACA,MACA,WACkB;CAClB,IAAI;AACJ,KAAI,YAAY,KAAK,CACnB,kBAAiB,oBAAoB,KAAK;KAE1C,kBAAiB;CAGnB,MAAM,SAAS,MAAM,OACnB,SACA,eAAe,MACf,UACD;CAED,IAAI;AACJ,KAAI;AACF,aAAW,MAAM,QAAQ,SAAS,WAAW,OAAO,MAAM;GACxD,UAAU,OAAO;GACjB,KAAK,qBAAqB,OAAO,KAAK;GACvC,CAAC;UACK,OAAO;AACd,MACE,YAAa,MAAgB,QAAQ,IACrC,IAA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.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_type_checks = require("@stryke/type-checks");
4
+ let _stryke_json_schema = require("@stryke/json/schema");
5
+
6
+ //#region src/type-checks.ts
7
+ /**
8
+ * Type guard to check if a given input is a [JSON Type Definition (JTD) schema object](https://tools.ietf.org/html/rfc8927). This function verifies that the input is a non-null object, contains a `jtd` property that is set to `true`, and has a `schema` property that is a JSON Schema (draft-07) object. If all these conditions are met, the function returns `true`, indicating that the input is a valid JTD schema; otherwise, it returns `false`.
9
+ *
10
+ * @param input - The input to check for being a [JTD schema](https://tools.ietf.org/html/rfc8927).
11
+ * @returns `true` if the input is a [JTD schema](https://tools.ietf.org/html/rfc8927), otherwise `false`.
12
+ */
13
+ function isJTDSchema(input) {
14
+ return (0, _stryke_json_schema.isJsonSchemaObjectType)(input) && "jtd" in input && input.jtd === true;
15
+ }
16
+ /**
17
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedSchema | Schema} object. This function verifies that the input is a non-null object whose optional metadata properties (`id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`) - when present - match the shapes declared by `untyped`'s [`Schema`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface.
18
+ *
19
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) schema.
20
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) schema, otherwise `false`.
21
+ */
22
+ function isUntypedSchema(input) {
23
+ if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
24
+ const schema = input;
25
+ if ("id" in schema && !(0, _stryke_type_checks.isSetString)(schema.id)) return false;
26
+ if ("title" in schema && !(0, _stryke_type_checks.isSetString)(schema.title)) return false;
27
+ if ("description" in schema && !(0, _stryke_type_checks.isSetString)(schema.description)) return false;
28
+ if ("$schema" in schema && !(0, _stryke_type_checks.isSetString)(schema.$schema)) return false;
29
+ if ("tsType" in schema && !(0, _stryke_type_checks.isSetString)(schema.tsType)) return false;
30
+ if ("markdownType" in schema && !(0, _stryke_type_checks.isSetString)(schema.markdownType)) return false;
31
+ if ("type" in schema && !(0, _stryke_type_checks.isSetString)(schema.type) && !Array.isArray(schema.type)) return false;
32
+ if ("required" in schema && !Array.isArray(schema.required)) return false;
33
+ if ("tags" in schema && !Array.isArray(schema.tags)) return false;
34
+ if ("args" in schema && !Array.isArray(schema.args)) return false;
35
+ if ("properties" in schema && !(0, _stryke_type_checks.isSetObject)(schema.properties)) return false;
36
+ if ("resolve" in schema && !(0, _stryke_type_checks.isFunction)(schema.resolve)) return false;
37
+ return true;
38
+ }
39
+ /**
40
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedInputObject | InputObject}. This function verifies that the input is a non-null object and that any `untyped`-reserved `$`-prefixed properties have the expected shape: `$schema` (when present) must satisfy {@link isUntypedSchema} and `$resolve` (when present) must be a function. See `untyped`'s [`InputObject`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface for the canonical definition.
41
+ *
42
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) input object.
43
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) input object, otherwise `false`.
44
+ */
45
+ function isUntypedInput(input) {
46
+ if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
47
+ const inputObject = input;
48
+ if ("$schema" in inputObject && !isUntypedSchema(inputObject.$schema)) return false;
49
+ if ("$resolve" in inputObject && !(0, _stryke_type_checks.isFunction)(inputObject.$resolve)) return false;
50
+ return true;
51
+ }
52
+ /**
53
+ * Type guard to check if a given input is a {@link Schema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link Schema}; otherwise, it returns `false`.
54
+ *
55
+ * @param input - The input to check for being a {@link Schema}.
56
+ * @returns `true` if the input is a {@link Schema}, otherwise `false`.
57
+ */
58
+ function isSchema(input) {
59
+ return (0, _stryke_type_checks.isSetObject)(input) && "schema" in input && isJTDSchema(input.schema) && "input" in input && (0, _stryke_type_checks.isSetObject)(input.input) && "variant" in input && (0, _stryke_type_checks.isSetString)(input.variant);
60
+ }
61
+ /**
62
+ * Type guard to check if a given input is a {@link ExtractedSchema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link ExtractedSchema}; otherwise, it returns `false`.
63
+ *
64
+ * @param input - The input to check for being a {@link ExtractedSchema}.
65
+ * @returns `true` if the input is a {@link ExtractedSchema}, otherwise `false`.
66
+ */
67
+ function isExtractedSchema(input) {
68
+ return isSchema(input) && "source" in input && (0, _stryke_type_checks.isSetObject)(input.source) && "schema" in input.source && isJTDSchema(input.source.schema) && "variant" in input.source && (0, _stryke_type_checks.isSetString)(input.source.variant);
69
+ }
70
+
71
+ //#endregion
72
+ exports.isExtractedSchema = isExtractedSchema;
73
+ exports.isJTDSchema = isJTDSchema;
74
+ exports.isSchema = isSchema;
75
+ exports.isUntypedInput = isUntypedInput;
76
+ exports.isUntypedSchema = isUntypedSchema;
@@ -0,0 +1,43 @@
1
+ import { ExtractedSchema, Schema as Schema$1, SchemaMetadata } from "./types.cjs";
2
+ import { InputObject, Schema } from "untyped";
3
+ import { JTDSchemaType } from "ajv/dist/types/jtd-schema.js";
4
+
5
+ //#region src/type-checks.d.ts
6
+ /**
7
+ * Type guard to check if a given input is a [JSON Type Definition (JTD) schema object](https://tools.ietf.org/html/rfc8927). This function verifies that the input is a non-null object, contains a `jtd` property that is set to `true`, and has a `schema` property that is a JSON Schema (draft-07) object. If all these conditions are met, the function returns `true`, indicating that the input is a valid JTD schema; otherwise, it returns `false`.
8
+ *
9
+ * @param input - The input to check for being a [JTD schema](https://tools.ietf.org/html/rfc8927).
10
+ * @returns `true` if the input is a [JTD schema](https://tools.ietf.org/html/rfc8927), otherwise `false`.
11
+ */
12
+ declare function isJTDSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is JTDSchemaType<TMetadata>;
13
+ /**
14
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedSchema | Schema} object. This function verifies that the input is a non-null object whose optional metadata properties (`id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`) - when present - match the shapes declared by `untyped`'s [`Schema`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface.
15
+ *
16
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) schema.
17
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) schema, otherwise `false`.
18
+ */
19
+ declare function isUntypedSchema(input: unknown): input is Schema;
20
+ /**
21
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedInputObject | InputObject}. This function verifies that the input is a non-null object and that any `untyped`-reserved `$`-prefixed properties have the expected shape: `$schema` (when present) must satisfy {@link isUntypedSchema} and `$resolve` (when present) must be a function. See `untyped`'s [`InputObject`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface for the canonical definition.
22
+ *
23
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) input object.
24
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) input object, otherwise `false`.
25
+ */
26
+ declare function isUntypedInput(input: unknown): input is InputObject;
27
+ /**
28
+ * Type guard to check if a given input is a {@link Schema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link Schema}; otherwise, it returns `false`.
29
+ *
30
+ * @param input - The input to check for being a {@link Schema}.
31
+ * @returns `true` if the input is a {@link Schema}, otherwise `false`.
32
+ */
33
+ declare function isSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is Schema$1<TMetadata>;
34
+ /**
35
+ * Type guard to check if a given input is a {@link ExtractedSchema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link ExtractedSchema}; otherwise, it returns `false`.
36
+ *
37
+ * @param input - The input to check for being a {@link ExtractedSchema}.
38
+ * @returns `true` if the input is a {@link ExtractedSchema}, otherwise `false`.
39
+ */
40
+ declare function isExtractedSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is ExtractedSchema<TMetadata>;
41
+ //#endregion
42
+ export { isExtractedSchema, isJTDSchema, isSchema, isUntypedInput, isUntypedSchema };
43
+ //# sourceMappingURL=type-checks.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-checks.d.cts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;AAiCA;;;;iBAAgB,WAAA,mBAA8B,cAAA,GAAiB,cAAA,CAAA,CAC7D,KAAA,YACC,KAAA,IAAS,aAAA,CAAc,SAAA;;;;;;;iBAUV,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,MAAA;;;;;;;iBAwD1C,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,WAAA;;;;;;;iBAsBzC,QAAA,mBAA2B,cAAA,GAAiB,cAAA,CAAA,CAC1D,KAAA,YACC,KAAA,IAAS,QAAA,CAAO,SAAA;;AAxBnB;;;;;iBA0CgB,iBAAA,mBACI,cAAA,GAAiB,cAAA,CAAA,CACnC,KAAA,YAAiB,KAAA,IAAS,eAAA,CAAgB,SAAA"}
@@ -0,0 +1,43 @@
1
+ import { ExtractedSchema, Schema as Schema$1, SchemaMetadata } from "./types.mjs";
2
+ import { InputObject, Schema } from "untyped";
3
+ import { JTDSchemaType } from "ajv/dist/types/jtd-schema.js";
4
+
5
+ //#region src/type-checks.d.ts
6
+ /**
7
+ * Type guard to check if a given input is a [JSON Type Definition (JTD) schema object](https://tools.ietf.org/html/rfc8927). This function verifies that the input is a non-null object, contains a `jtd` property that is set to `true`, and has a `schema` property that is a JSON Schema (draft-07) object. If all these conditions are met, the function returns `true`, indicating that the input is a valid JTD schema; otherwise, it returns `false`.
8
+ *
9
+ * @param input - The input to check for being a [JTD schema](https://tools.ietf.org/html/rfc8927).
10
+ * @returns `true` if the input is a [JTD schema](https://tools.ietf.org/html/rfc8927), otherwise `false`.
11
+ */
12
+ declare function isJTDSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is JTDSchemaType<TMetadata>;
13
+ /**
14
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedSchema | Schema} object. This function verifies that the input is a non-null object whose optional metadata properties (`id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`) - when present - match the shapes declared by `untyped`'s [`Schema`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface.
15
+ *
16
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) schema.
17
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) schema, otherwise `false`.
18
+ */
19
+ declare function isUntypedSchema(input: unknown): input is Schema;
20
+ /**
21
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedInputObject | InputObject}. This function verifies that the input is a non-null object and that any `untyped`-reserved `$`-prefixed properties have the expected shape: `$schema` (when present) must satisfy {@link isUntypedSchema} and `$resolve` (when present) must be a function. See `untyped`'s [`InputObject`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface for the canonical definition.
22
+ *
23
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) input object.
24
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) input object, otherwise `false`.
25
+ */
26
+ declare function isUntypedInput(input: unknown): input is InputObject;
27
+ /**
28
+ * Type guard to check if a given input is a {@link Schema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link Schema}; otherwise, it returns `false`.
29
+ *
30
+ * @param input - The input to check for being a {@link Schema}.
31
+ * @returns `true` if the input is a {@link Schema}, otherwise `false`.
32
+ */
33
+ declare function isSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is Schema$1<TMetadata>;
34
+ /**
35
+ * Type guard to check if a given input is a {@link ExtractedSchema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link ExtractedSchema}; otherwise, it returns `false`.
36
+ *
37
+ * @param input - The input to check for being a {@link ExtractedSchema}.
38
+ * @returns `true` if the input is a {@link ExtractedSchema}, otherwise `false`.
39
+ */
40
+ declare function isExtractedSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(input: unknown): input is ExtractedSchema<TMetadata>;
41
+ //#endregion
42
+ export { isExtractedSchema, isJTDSchema, isSchema, isUntypedInput, isUntypedSchema };
43
+ //# sourceMappingURL=type-checks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-checks.d.mts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;AAiCA;;;;iBAAgB,WAAA,mBAA8B,cAAA,GAAiB,cAAA,CAAA,CAC7D,KAAA,YACC,KAAA,IAAS,aAAA,CAAc,SAAA;;;;;;;iBAUV,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,MAAA;;;;;;;iBAwD1C,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,WAAA;;;;;;;iBAsBzC,QAAA,mBAA2B,cAAA,GAAiB,cAAA,CAAA,CAC1D,KAAA,YACC,KAAA,IAAS,QAAA,CAAO,SAAA;;AAxBnB;;;;;iBA0CgB,iBAAA,mBACI,cAAA,GAAiB,cAAA,CAAA,CACnC,KAAA,YAAiB,KAAA,IAAS,eAAA,CAAgB,SAAA"}
@@ -0,0 +1,71 @@
1
+ import { isFunction, isSetObject, isSetString } from "@stryke/type-checks";
2
+ import { isJsonSchemaObjectType } from "@stryke/json/schema";
3
+
4
+ //#region src/type-checks.ts
5
+ /**
6
+ * Type guard to check if a given input is a [JSON Type Definition (JTD) schema object](https://tools.ietf.org/html/rfc8927). This function verifies that the input is a non-null object, contains a `jtd` property that is set to `true`, and has a `schema` property that is a JSON Schema (draft-07) object. If all these conditions are met, the function returns `true`, indicating that the input is a valid JTD schema; otherwise, it returns `false`.
7
+ *
8
+ * @param input - The input to check for being a [JTD schema](https://tools.ietf.org/html/rfc8927).
9
+ * @returns `true` if the input is a [JTD schema](https://tools.ietf.org/html/rfc8927), otherwise `false`.
10
+ */
11
+ function isJTDSchema(input) {
12
+ return isJsonSchemaObjectType(input) && "jtd" in input && input.jtd === true;
13
+ }
14
+ /**
15
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedSchema | Schema} object. This function verifies that the input is a non-null object whose optional metadata properties (`id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`) - when present - match the shapes declared by `untyped`'s [`Schema`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface.
16
+ *
17
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) schema.
18
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) schema, otherwise `false`.
19
+ */
20
+ function isUntypedSchema(input) {
21
+ if (!isSetObject(input)) return false;
22
+ const schema = input;
23
+ if ("id" in schema && !isSetString(schema.id)) return false;
24
+ if ("title" in schema && !isSetString(schema.title)) return false;
25
+ if ("description" in schema && !isSetString(schema.description)) return false;
26
+ if ("$schema" in schema && !isSetString(schema.$schema)) return false;
27
+ if ("tsType" in schema && !isSetString(schema.tsType)) return false;
28
+ if ("markdownType" in schema && !isSetString(schema.markdownType)) return false;
29
+ if ("type" in schema && !isSetString(schema.type) && !Array.isArray(schema.type)) return false;
30
+ if ("required" in schema && !Array.isArray(schema.required)) return false;
31
+ if ("tags" in schema && !Array.isArray(schema.tags)) return false;
32
+ if ("args" in schema && !Array.isArray(schema.args)) return false;
33
+ if ("properties" in schema && !isSetObject(schema.properties)) return false;
34
+ if ("resolve" in schema && !isFunction(schema.resolve)) return false;
35
+ return true;
36
+ }
37
+ /**
38
+ * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedInputObject | InputObject}. This function verifies that the input is a non-null object and that any `untyped`-reserved `$`-prefixed properties have the expected shape: `$schema` (when present) must satisfy {@link isUntypedSchema} and `$resolve` (when present) must be a function. See `untyped`'s [`InputObject`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface for the canonical definition.
39
+ *
40
+ * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) input object.
41
+ * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) input object, otherwise `false`.
42
+ */
43
+ function isUntypedInput(input) {
44
+ if (!isSetObject(input)) return false;
45
+ const inputObject = input;
46
+ if ("$schema" in inputObject && !isUntypedSchema(inputObject.$schema)) return false;
47
+ if ("$resolve" in inputObject && !isFunction(inputObject.$resolve)) return false;
48
+ return true;
49
+ }
50
+ /**
51
+ * Type guard to check if a given input is a {@link Schema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link Schema}; otherwise, it returns `false`.
52
+ *
53
+ * @param input - The input to check for being a {@link Schema}.
54
+ * @returns `true` if the input is a {@link Schema}, otherwise `false`.
55
+ */
56
+ function isSchema(input) {
57
+ return isSetObject(input) && "schema" in input && isJTDSchema(input.schema) && "input" in input && isSetObject(input.input) && "variant" in input && isSetString(input.variant);
58
+ }
59
+ /**
60
+ * Type guard to check if a given input is a {@link ExtractedSchema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants ("json-schema", "standard-schema", "zod3", or "reflection"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link ExtractedSchema}; otherwise, it returns `false`.
61
+ *
62
+ * @param input - The input to check for being a {@link ExtractedSchema}.
63
+ * @returns `true` if the input is a {@link ExtractedSchema}, otherwise `false`.
64
+ */
65
+ function isExtractedSchema(input) {
66
+ return isSchema(input) && "source" in input && isSetObject(input.source) && "schema" in input.source && isJTDSchema(input.source.schema) && "variant" in input.source && isSetString(input.source.variant);
67
+ }
68
+
69
+ //#endregion
70
+ export { isExtractedSchema, isJTDSchema, isSchema, isUntypedInput, isUntypedSchema };
71
+ //# sourceMappingURL=type-checks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-checks.mjs","names":[],"sources":["../src/type-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isJsonSchemaObjectType } from \"@stryke/json/schema\";\nimport { isFunction, isSetObject, isSetString } from \"@stryke/type-checks\";\nimport { JTDSchemaType } from \"ajv/dist/types/jtd-schema\";\nimport {\n InputObject as UntypedInputObject,\n Schema as UntypedSchema\n} from \"untyped\";\nimport { ExtractedSchema, Schema, SchemaMetadata } from \"./types\";\n\n/**\n * Type guard to check if a given input is a [JSON Type Definition (JTD) schema object](https://tools.ietf.org/html/rfc8927). This function verifies that the input is a non-null object, contains a `jtd` property that is set to `true`, and has a `schema` property that is a JSON Schema (draft-07) object. If all these conditions are met, the function returns `true`, indicating that the input is a valid JTD schema; otherwise, it returns `false`.\n *\n * @param input - The input to check for being a [JTD schema](https://tools.ietf.org/html/rfc8927).\n * @returns `true` if the input is a [JTD schema](https://tools.ietf.org/html/rfc8927), otherwise `false`.\n */\nexport function isJTDSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(\n input: unknown\n): input is JTDSchemaType<TMetadata> {\n return isJsonSchemaObjectType(input) && \"jtd\" in input && input.jtd === true;\n}\n\n/**\n * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedSchema | Schema} object. This function verifies that the input is a non-null object whose optional metadata properties (`id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`) - when present - match the shapes declared by `untyped`'s [`Schema`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface.\n *\n * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) schema.\n * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) schema, otherwise `false`.\n */\nexport function isUntypedSchema(input: unknown): input is UntypedSchema {\n if (!isSetObject(input)) {\n return false;\n }\n\n const schema = input as Record<string, unknown>;\n if (\"id\" in schema && !isSetString(schema.id)) {\n return false;\n }\n if (\"title\" in schema && !isSetString(schema.title)) {\n return false;\n }\n if (\"description\" in schema && !isSetString(schema.description)) {\n return false;\n }\n if (\"$schema\" in schema && !isSetString(schema.$schema)) {\n return false;\n }\n if (\"tsType\" in schema && !isSetString(schema.tsType)) {\n return false;\n }\n if (\"markdownType\" in schema && !isSetString(schema.markdownType)) {\n return false;\n }\n if (\n \"type\" in schema &&\n !isSetString(schema.type) &&\n !Array.isArray(schema.type)\n ) {\n return false;\n }\n if (\"required\" in schema && !Array.isArray(schema.required)) {\n return false;\n }\n if (\"tags\" in schema && !Array.isArray(schema.tags)) {\n return false;\n }\n if (\"args\" in schema && !Array.isArray(schema.args)) {\n return false;\n }\n if (\"properties\" in schema && !isSetObject(schema.properties)) {\n return false;\n }\n if (\"resolve\" in schema && !isFunction(schema.resolve)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Type guard to check if a given input is an [untyped](https://github.com/unjs/untyped) {@link UntypedInputObject | InputObject}. This function verifies that the input is a non-null object and that any `untyped`-reserved `$`-prefixed properties have the expected shape: `$schema` (when present) must satisfy {@link isUntypedSchema} and `$resolve` (when present) must be a function. See `untyped`'s [`InputObject`](https://github.com/unjs/untyped/blob/main/src/types.ts) interface for the canonical definition.\n *\n * @param input - The input to check for being an [untyped](https://github.com/unjs/untyped) input object.\n * @returns `true` if the input is an [untyped](https://github.com/unjs/untyped) input object, otherwise `false`.\n */\nexport function isUntypedInput(input: unknown): input is UntypedInputObject {\n if (!isSetObject(input)) {\n return false;\n }\n\n const inputObject = input as Record<string, unknown>;\n if (\"$schema\" in inputObject && !isUntypedSchema(inputObject.$schema)) {\n return false;\n }\n if (\"$resolve\" in inputObject && !isFunction(inputObject.$resolve)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Type guard to check if a given input is a {@link Schema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants (\"json-schema\", \"standard-schema\", \"zod3\", or \"reflection\"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link Schema}; otherwise, it returns `false`.\n *\n * @param input - The input to check for being a {@link Schema}.\n * @returns `true` if the input is a {@link Schema}, otherwise `false`.\n */\nexport function isSchema<TMetadata extends SchemaMetadata = SchemaMetadata>(\n input: unknown\n): input is Schema<TMetadata> {\n return (\n isSetObject(input) &&\n \"schema\" in input &&\n isJTDSchema(input.schema) &&\n \"input\" in input &&\n isSetObject(input.input) &&\n \"variant\" in input &&\n isSetString(input.variant)\n );\n}\n\n/**\n * Type guard to check if a given input is a {@link ExtractedSchema} object. This function verifies that the input is a non-null object, contains a `schema` property that is a JSON Schema (draft-07) object, contains an `input` property that is a non-null object, and has a `variant` property that is one of the allowed schema variants (\"json-schema\", \"standard-schema\", \"zod3\", or \"reflection\"). If all these conditions are met, the function returns `true`, indicating that the input is a valid {@link ExtractedSchema}; otherwise, it returns `false`.\n *\n * @param input - The input to check for being a {@link ExtractedSchema}.\n * @returns `true` if the input is a {@link ExtractedSchema}, otherwise `false`.\n */\nexport function isExtractedSchema<\n TMetadata extends SchemaMetadata = SchemaMetadata\n>(input: unknown): input is ExtractedSchema<TMetadata> {\n return (\n isSchema<TMetadata>(input) &&\n \"source\" in input &&\n isSetObject(input.source) &&\n \"schema\" in input.source &&\n isJTDSchema(input.source.schema) &&\n \"variant\" in input.source &&\n isSetString(input.source.variant)\n );\n}\n"],"mappings":";;;;;;;;;;AAiCA,SAAgB,YACd,OACmC;AACnC,QAAO,uBAAuB,MAAM,IAAI,SAAS,SAAS,MAAM,QAAQ;;;;;;;;AAS1E,SAAgB,gBAAgB,OAAwC;AACtE,KAAI,CAAC,YAAY,MAAM,CACrB,QAAO;CAGT,MAAM,SAAS;AACf,KAAI,QAAQ,UAAU,CAAC,YAAY,OAAO,GAAG,CAC3C,QAAO;AAET,KAAI,WAAW,UAAU,CAAC,YAAY,OAAO,MAAM,CACjD,QAAO;AAET,KAAI,iBAAiB,UAAU,CAAC,YAAY,OAAO,YAAY,CAC7D,QAAO;AAET,KAAI,aAAa,UAAU,CAAC,YAAY,OAAO,QAAQ,CACrD,QAAO;AAET,KAAI,YAAY,UAAU,CAAC,YAAY,OAAO,OAAO,CACnD,QAAO;AAET,KAAI,kBAAkB,UAAU,CAAC,YAAY,OAAO,aAAa,CAC/D,QAAO;AAET,KACE,UAAU,UACV,CAAC,YAAY,OAAO,KAAK,IACzB,CAAC,MAAM,QAAQ,OAAO,KAAK,CAE3B,QAAO;AAET,KAAI,cAAc,UAAU,CAAC,MAAM,QAAQ,OAAO,SAAS,CACzD,QAAO;AAET,KAAI,UAAU,UAAU,CAAC,MAAM,QAAQ,OAAO,KAAK,CACjD,QAAO;AAET,KAAI,UAAU,UAAU,CAAC,MAAM,QAAQ,OAAO,KAAK,CACjD,QAAO;AAET,KAAI,gBAAgB,UAAU,CAAC,YAAY,OAAO,WAAW,CAC3D,QAAO;AAET,KAAI,aAAa,UAAU,CAAC,WAAW,OAAO,QAAQ,CACpD,QAAO;AAGT,QAAO;;;;;;;;AAST,SAAgB,eAAe,OAA6C;AAC1E,KAAI,CAAC,YAAY,MAAM,CACrB,QAAO;CAGT,MAAM,cAAc;AACpB,KAAI,aAAa,eAAe,CAAC,gBAAgB,YAAY,QAAQ,CACnE,QAAO;AAET,KAAI,cAAc,eAAe,CAAC,WAAW,YAAY,SAAS,CAChE,QAAO;AAGT,QAAO;;;;;;;;AAST,SAAgB,SACd,OAC4B;AAC5B,QACE,YAAY,MAAM,IAClB,YAAY,SACZ,YAAY,MAAM,OAAO,IACzB,WAAW,SACX,YAAY,MAAM,MAAM,IACxB,aAAa,SACb,YAAY,MAAM,QAAQ;;;;;;;;AAU9B,SAAgB,kBAEd,OAAqD;AACrD,QACE,SAAoB,MAAM,IAC1B,YAAY,SACZ,YAAY,MAAM,OAAO,IACzB,YAAY,MAAM,UAClB,YAAY,MAAM,OAAO,OAAO,IAChC,aAAa,MAAM,UACnB,YAAY,MAAM,OAAO,QAAQ"}
package/dist/types.d.cts CHANGED
@@ -1,39 +1,181 @@
1
1
  import { Type } from "@powerlines/deepkit/vendor/type";
2
- import { JsonSchema7Type } from "@stryke/json";
3
2
  import { StandardJSONSchemaV1 } from "@standard-schema/spec";
4
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
3
+ import { JsonSchemaType } from "@stryke/json/types";
4
+ import { TypeDefinition } from "@stryke/types/configuration";
5
+ import { InputObject, Schema as Schema$1 } from "untyped";
5
6
  import * as z3 from "zod/v3";
6
7
 
7
8
  //#region src/types.d.ts
8
- type SchemaDefinitionVariant = "json-schema" | "standard-schema" | "zod3" | "reflection";
9
- interface SchemaDefinitionBase {
10
- schema: JsonSchema7Type;
11
- variant: SchemaDefinitionVariant;
12
- input: SchemaDefinitionInput;
13
- }
14
- interface SchemaDefinitionJsonSchema extends SchemaDefinitionBase {
15
- schema: JsonSchema7Type;
9
+ type UntypedInputObject = InputObject;
10
+ type UntypedSchema = Schema$1;
11
+ /**
12
+ * The set of numeric `type` strings supported by JSON Type Definition (RFC 8927).
13
+ */
14
+ type JTDNumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
15
+ /**
16
+ * The set of string `type` strings supported by JSON Type Definition (RFC 8927).
17
+ */
18
+ type JTDStringType = "string" | "timestamp";
19
+ /**
20
+ * The set of `type` strings supported by JSON Type Definition (RFC 8927).
21
+ */
22
+ type JTDType = JTDNumberType | JTDStringType | "boolean";
23
+ interface JsonSchemaLike {
24
+ type?: string | string[];
25
+ format?: string;
26
+ enum?: unknown[];
27
+ const?: unknown;
28
+ items?: JsonSchemaLike | JsonSchemaLike[];
29
+ properties?: Record<string, JsonSchemaLike>;
30
+ patternProperties?: Record<string, JsonSchemaLike>;
31
+ additionalProperties?: boolean | JsonSchemaLike;
32
+ required?: string[];
33
+ anyOf?: JsonSchemaLike[];
34
+ oneOf?: JsonSchemaLike[];
35
+ allOf?: JsonSchemaLike[];
36
+ $ref?: string;
37
+ description?: string;
38
+ title?: string;
39
+ default?: unknown;
40
+ examples?: unknown[];
41
+ minimum?: number;
42
+ maximum?: number;
43
+ exclusiveMinimum?: number | boolean;
44
+ exclusiveMaximum?: number | boolean;
45
+ nullable?: boolean;
46
+ definitions?: Record<string, JsonSchemaLike>;
47
+ $defs?: Record<string, JsonSchemaLike>;
48
+ discriminator?: {
49
+ propertyName?: string;
50
+ } | string;
51
+ [key: string]: unknown;
52
+ }
53
+ interface SchemaMetadata {
54
+ /**
55
+ * A title for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
56
+ */
57
+ title?: string;
58
+ /**
59
+ * A description for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable explanation or summary of the schema's purpose and usage. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
60
+ */
61
+ description?: string;
62
+ /**
63
+ * A default value for the schema, which can be used by validation libraries or other tools that support this feature. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
64
+ */
65
+ default?: unknown;
66
+ /**
67
+ * An array of example values that conform to the schema. This property can be used to provide sample data for documentation purposes or to assist developers in understanding the expected structure and content of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
68
+ */
69
+ examples?: unknown[];
70
+ /**
71
+ * A table name for the schema, which can be used by documentation tools or other libraries that support this feature to provide a human-readable name or description for the schema. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the schema when used in conjunction with compatible tools.
72
+ */
73
+ table?: string;
74
+ /**
75
+ * An indicator specifying if the field should be marked as hidden or not.
76
+ */
77
+ isHidden?: boolean;
78
+ /**
79
+ * An indicator specifying if the field should be ignored or not.
80
+ */
81
+ isIgnored?: boolean;
82
+ /**
83
+ * An indicator specifying if the field is internal or not.
84
+ *
85
+ * @internal
86
+ */
87
+ isInternal?: boolean;
88
+ /**
89
+ * An indicator specifying if the field should only be populated at runtime or not.
90
+ */
91
+ isRuntime?: boolean;
92
+ /**
93
+ * An indicator specifying if the field is read-only or not. This property can be used to indicate that a field should not be modified after it has been set, which can be useful for documentation purposes or to assist developers in understanding the expected behavior of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
94
+ */
95
+ isReadonly?: boolean;
96
+ /**
97
+ * An indicator specifying if the field is a primary key or not. This property can be used to indicate that a field serves as a unique identifier for records in a dataset, which can be useful for documentation purposes or to assist developers in understanding the expected structure and behavior of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
98
+ */
99
+ isPrimaryKey?: boolean;
100
+ /**
101
+ * An array of strings or an alias reference to indicate that the field is an alias for one or more other fields. This property can be used to provide alternative names or references for a field, which can be useful for documentation purposes or to assist developers in understanding the expected structure and content of the data that the schema represents. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
102
+ */
103
+ alias?: string[];
104
+ /**
105
+ * Schemas that are unioned together to form a single schema. This property can be used to represent complex data structures that can conform to multiple different schemas. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
106
+ */
107
+ union?: JsonSchemaLike[];
108
+ [key: string]: unknown | undefined;
109
+ }
110
+ type JTDSchemaType<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> = ({
111
+ ref: string;
112
+ } | {
113
+ type: JTDType;
114
+ } | {
115
+ enum: string[];
116
+ } | {
117
+ elements: JTDSchemaType<TMetadata>;
118
+ } | {
119
+ values: JTDSchemaType<TMetadata>;
120
+ } | {
121
+ properties: Record<string, JTDSchemaType<TMetadata>>;
122
+ optionalProperties?: Record<string, JTDSchemaType<TMetadata>>;
123
+ additionalProperties?: boolean;
124
+ } | {
125
+ properties?: Record<string, JTDSchemaType<TMetadata>>;
126
+ optionalProperties: Record<string, JTDSchemaType<TMetadata>>;
127
+ additionalProperties?: boolean;
128
+ } | {
129
+ discriminator: string;
130
+ mapping: Record<string, JTDSchemaType<TMetadata>>;
131
+ } | {}) & {
132
+ nullable?: boolean;
133
+ metadata?: TMetadata;
134
+ definitions?: Record<string, JTDSchemaType<TMetadata>>;
135
+ };
136
+ type SchemaSourceVariant = "standard-schema" | "jtd-schema" | "json-schema" | "zod3" | "untyped" | "reflection";
137
+ type SchemaInputVariant = SchemaSourceVariant | "type-definition";
138
+ type SchemaSourceInput<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> = StandardJSONSchemaV1 | JTDSchemaType<TMetadata> | JsonSchemaType | z3.ZodTypeAny | UntypedInputObject | UntypedSchema | Type;
139
+ type TypeDefinitionReference = TypeDefinition | string;
140
+ type SchemaInput = SchemaSourceInput | Schema | TypeDefinitionReference;
141
+ interface Schema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> {
142
+ hash: string;
143
+ variant: SchemaInputVariant;
144
+ schema: JTDSchemaType<TMetadata>;
145
+ }
146
+ interface BaseSchemaSource {
147
+ hash: string;
148
+ variant: SchemaSourceVariant;
149
+ schema: SchemaSourceInput;
150
+ }
151
+ interface JTDSchemaSchemaSource<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends BaseSchemaSource {
152
+ variant: "jtd-schema";
153
+ schema: JTDSchemaType<TMetadata>;
154
+ }
155
+ interface JsonSchemaSchemaSource extends BaseSchemaSource {
16
156
  variant: "json-schema";
17
- input: JsonSchema7Type;
157
+ schema: JsonSchemaType;
18
158
  }
19
- interface SchemaDefinitionStandardSchema extends SchemaDefinitionBase {
20
- schema: JsonSchema7Type;
159
+ interface StandardSchemaSchemaSource extends BaseSchemaSource {
21
160
  variant: "standard-schema";
22
- input: StandardJSONSchemaV1;
161
+ schema: StandardJSONSchemaV1;
23
162
  }
24
- interface SchemaDefinitionZod3 extends SchemaDefinitionBase {
25
- schema: JsonSchema7Type;
163
+ interface Zod3SchemaSource extends BaseSchemaSource {
26
164
  variant: "zod3";
27
- input: z3.ZodTypeAny;
165
+ schema: z3.ZodTypeAny;
28
166
  }
29
- interface SchemaDefinitionReflection extends SchemaDefinitionBase {
30
- schema: JsonSchema7Type;
167
+ interface ReflectionSchemaSource extends BaseSchemaSource {
31
168
  variant: "reflection";
32
- input: Type;
169
+ schema: Type;
170
+ }
171
+ interface UntypedSchemaSource extends BaseSchemaSource {
172
+ variant: "untyped";
173
+ schema: UntypedInputObject | UntypedSchema;
174
+ }
175
+ type SchemaSource = JsonSchemaSchemaSource | JTDSchemaSchemaSource | StandardSchemaSchemaSource | Zod3SchemaSource | UntypedSchemaSource | ReflectionSchemaSource;
176
+ interface ExtractedSchema<TMetadata extends Partial<SchemaMetadata> = Partial<SchemaMetadata>> extends Schema<TMetadata> {
177
+ source: SchemaSource;
33
178
  }
34
- type SchemaDefinition = SchemaDefinitionJsonSchema | SchemaDefinitionStandardSchema | SchemaDefinitionZod3 | SchemaDefinitionReflection;
35
- type SchemaDefinitionInput = SchemaDefinition | JsonSchema7Type | StandardJSONSchemaV1 | z3.ZodTypeAny | Type;
36
- type SchemaDefinitionParameter = SchemaDefinitionInput | TypeDefinitionParameter;
37
179
  //#endregion
38
- export { SchemaDefinition, SchemaDefinitionBase, SchemaDefinitionInput, SchemaDefinitionJsonSchema, SchemaDefinitionParameter, SchemaDefinitionReflection, SchemaDefinitionStandardSchema, SchemaDefinitionVariant, SchemaDefinitionZod3 };
180
+ export { BaseSchemaSource, ExtractedSchema, JTDNumberType, JTDSchemaSchemaSource, JTDSchemaType, JTDStringType, JTDType, JsonSchemaLike, JsonSchemaSchemaSource, ReflectionSchemaSource, Schema, SchemaInput, SchemaInputVariant, SchemaMetadata, SchemaSource, SchemaSourceInput, SchemaSourceVariant, StandardSchemaSchemaSource, TypeDefinitionReference, UntypedInputObject, UntypedSchema, UntypedSchemaSource, Zod3SchemaSource };
39
181
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;KAwBY,uBAAA;AAAA,UAMK,oBAAA;EACf,MAAA,EAAQ,eAAA;EACR,OAAA,EAAS,uBAAA;EACT,KAAA,EAAO,qBAAA;AAAA;AAAA,UAGQ,0BAAA,SAAmC,oBAAA;EAClD,MAAA,EAAQ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