@kubb/plugin-oas 4.25.2 → 4.26.1

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 (33) hide show
  1. package/dist/{SchemaGenerator-Bd2FTvfs.js → SchemaGenerator-DvvSm2Jo.js} +7 -3
  2. package/dist/{SchemaGenerator-Bd2FTvfs.js.map → SchemaGenerator-DvvSm2Jo.js.map} +1 -1
  3. package/dist/{SchemaGenerator-CV4iH_wu.cjs → SchemaGenerator-h6nZX_kQ.cjs} +7 -3
  4. package/dist/{SchemaGenerator-CV4iH_wu.cjs.map → SchemaGenerator-h6nZX_kQ.cjs.map} +1 -1
  5. package/dist/{SchemaMapper-lyD0aSsg.d.cts → SchemaMapper-2uccmf8V.d.cts} +5 -1
  6. package/dist/{SchemaMapper-D-GETHNf.js → SchemaMapper-Bq_JVBfF.js} +2 -1
  7. package/dist/SchemaMapper-Bq_JVBfF.js.map +1 -0
  8. package/dist/{SchemaMapper-C5oYV1bw.d.ts → SchemaMapper-CyTgY0tH.d.ts} +5 -1
  9. package/dist/{SchemaMapper-CzH82C7C.cjs → SchemaMapper-dJ2rcxUX.cjs} +2 -1
  10. package/dist/SchemaMapper-dJ2rcxUX.cjs.map +1 -0
  11. package/dist/{createGenerator-CTDbdvjH.d.ts → createGenerator-BB4GI2qc.d.ts} +2 -2
  12. package/dist/{createGenerator-bompEaDT.d.cts → createGenerator-CPQwpMBe.d.cts} +2 -2
  13. package/dist/generators.d.cts +2 -2
  14. package/dist/generators.d.ts +2 -2
  15. package/dist/hooks.d.cts +2 -2
  16. package/dist/hooks.d.ts +2 -2
  17. package/dist/index.cjs +2 -2
  18. package/dist/index.d.cts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +2 -2
  21. package/dist/mocks.cjs +1 -1
  22. package/dist/mocks.d.cts +1 -1
  23. package/dist/mocks.d.ts +1 -1
  24. package/dist/mocks.js +1 -1
  25. package/dist/utils.cjs +2 -2
  26. package/dist/utils.d.cts +2 -2
  27. package/dist/utils.d.ts +2 -2
  28. package/dist/utils.js +2 -2
  29. package/package.json +3 -3
  30. package/src/SchemaGenerator.ts +6 -1
  31. package/src/SchemaMapper.ts +2 -0
  32. package/dist/SchemaMapper-CzH82C7C.cjs.map +0 -1
  33. package/dist/SchemaMapper-D-GETHNf.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-C1_xRkKa.cjs');
2
2
  const require_generators = require('./generators-DlQEksu_.cjs');
3
- const require_SchemaGenerator = require('./SchemaGenerator-CV4iH_wu.cjs');
4
- const require_SchemaMapper = require('./SchemaMapper-CzH82C7C.cjs');
3
+ const require_SchemaGenerator = require('./SchemaGenerator-h6nZX_kQ.cjs');
4
+ const require_SchemaMapper = require('./SchemaMapper-dJ2rcxUX.cjs');
5
5
  let _kubb_core = require("@kubb/core");
6
6
  let _kubb_core_transformers = require("@kubb/core/transformers");
7
7
  _kubb_core_transformers = require_chunk.__toESM(_kubb_core_transformers);
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, l as __name, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-lyD0aSsg.cjs";
2
- import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-bompEaDT.cjs";
1
+ import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, l as __name, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-2uccmf8V.cjs";
2
+ import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-CPQwpMBe.cjs";
3
3
  import * as _kubb_core0 from "@kubb/core";
4
4
  import { Config, Plugin, PluginFactoryOptions } from "@kubb/core";
5
5
  import { Operation, SchemaObject } from "@kubb/oas";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-CTDbdvjH.js";
3
- import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-C5oYV1bw.js";
2
+ import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-BB4GI2qc.js";
3
+ import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-CyTgY0tH.js";
4
4
  import * as _kubb_core0 from "@kubb/core";
5
5
  import { Config, Plugin, PluginFactoryOptions } from "@kubb/core";
6
6
  import { Operation, SchemaObject } from "@kubb/oas";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
2
  import { n as createReactGenerator$1, r as createGenerator$1, t as jsonGenerator } from "./generators-C86kmpzf.js";
3
- import { i as buildSchema, n as buildOperation, o as pLimit, r as buildOperations, t as SchemaGenerator } from "./SchemaGenerator-Bd2FTvfs.js";
4
- import { n as schemaKeywords, t as isKeyword } from "./SchemaMapper-D-GETHNf.js";
3
+ import { i as buildSchema, n as buildOperation, o as pLimit, r as buildOperations, t as SchemaGenerator } from "./SchemaGenerator-DvvSm2Jo.js";
4
+ import { n as schemaKeywords, t as isKeyword } from "./SchemaMapper-Bq_JVBfF.js";
5
5
  import { BaseGenerator, definePlugin, getMode } from "@kubb/core";
6
6
  import transformers, { camelCase } from "@kubb/core/transformers";
7
7
  import { parseFromConfig } from "@kubb/oas";
package/dist/mocks.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_SchemaMapper = require('./SchemaMapper-CzH82C7C.cjs');
1
+ const require_SchemaMapper = require('./SchemaMapper-dJ2rcxUX.cjs');
2
2
 
3
3
  //#region src/mocks/schemas.ts
4
4
  const basic = [
package/dist/mocks.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { l as __name, t as Schema } from "./SchemaMapper-lyD0aSsg.cjs";
1
+ import { l as __name, t as Schema } from "./SchemaMapper-2uccmf8V.cjs";
2
2
 
3
3
  //#region src/mocks/schemas.d.ts
4
4
  declare const schemas: {
package/dist/mocks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { t as Schema } from "./SchemaMapper-C5oYV1bw.js";
2
+ import { t as Schema } from "./SchemaMapper-CyTgY0tH.js";
3
3
 
4
4
  //#region src/mocks/schemas.d.ts
5
5
  declare const schemas: {
package/dist/mocks.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as schemaKeywords } from "./SchemaMapper-D-GETHNf.js";
1
+ import { n as schemaKeywords } from "./SchemaMapper-Bq_JVBfF.js";
2
2
 
3
3
  //#region src/mocks/schemas.ts
4
4
  const basic = [
package/dist/utils.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-C1_xRkKa.cjs');
2
- const require_SchemaGenerator = require('./SchemaGenerator-CV4iH_wu.cjs');
3
- const require_SchemaMapper = require('./SchemaMapper-CzH82C7C.cjs');
2
+ const require_SchemaGenerator = require('./SchemaGenerator-h6nZX_kQ.cjs');
3
+ const require_SchemaMapper = require('./SchemaMapper-dJ2rcxUX.cjs');
4
4
  const require_getFooter = require('./getFooter-C_dFbEs9.cjs');
5
5
  let _kubb_core_transformers = require("@kubb/core/transformers");
6
6
  _kubb_core_transformers = require_chunk.__toESM(_kubb_core_transformers);
package/dist/utils.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as __name, t as Schema } from "./SchemaMapper-lyD0aSsg.cjs";
2
- import { h as OperationSchema } from "./createGenerator-bompEaDT.cjs";
1
+ import { l as __name, t as Schema } from "./SchemaMapper-2uccmf8V.cjs";
2
+ import { h as OperationSchema } from "./createGenerator-CPQwpMBe.cjs";
3
3
  import { Config, Output } from "@kubb/core";
4
4
  import { KubbFile } from "@kubb/fabric-core/types";
5
5
  import { Oas, OasTypes, OpenAPIV3, OpenAPIV3_1, Operation, SchemaObject, contentType, isOptional } from "@kubb/oas";
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { h as OperationSchema } from "./createGenerator-CTDbdvjH.js";
3
- import { t as Schema } from "./SchemaMapper-C5oYV1bw.js";
2
+ import { h as OperationSchema } from "./createGenerator-BB4GI2qc.js";
3
+ import { t as Schema } from "./SchemaMapper-CyTgY0tH.js";
4
4
  import { Config, Output } from "@kubb/core";
5
5
  import { FunctionParamsAST } from "@kubb/core/utils";
6
6
  import { Oas, OasTypes, OpenAPIV3, OpenAPIV3_1, Operation, SchemaObject, contentType, isOptional } from "@kubb/oas";
package/dist/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as __name } from "./chunk-iVr_oF3V.js";
2
- import { a as getSchemaFactory, t as SchemaGenerator } from "./SchemaGenerator-Bd2FTvfs.js";
3
- import { n as schemaKeywords } from "./SchemaMapper-D-GETHNf.js";
2
+ import { a as getSchemaFactory, t as SchemaGenerator } from "./SchemaGenerator-DvvSm2Jo.js";
3
+ import { n as schemaKeywords } from "./SchemaMapper-Bq_JVBfF.js";
4
4
  import { n as getBanner, t as getFooter } from "./getFooter-flVUU6wg.js";
5
5
  import transformers, { camelCase, isValidVarName } from "@kubb/core/transformers";
6
6
  import { URLPath } from "@kubb/core/utils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-oas",
3
- "version": "4.25.2",
3
+ "version": "4.26.1",
4
4
  "description": "OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.",
5
5
  "keywords": [
6
6
  "openapi",
@@ -85,8 +85,8 @@
85
85
  "@kubb/react-fabric": "0.12.11",
86
86
  "p-limit": "^7.3.0",
87
87
  "remeda": "^2.33.6",
88
- "@kubb/core": "4.25.2",
89
- "@kubb/oas": "4.25.2"
88
+ "@kubb/core": "4.26.1",
89
+ "@kubb/oas": "4.26.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@kubb/react-fabric": "0.12.11"
@@ -1110,7 +1110,12 @@ export class SchemaGenerator<
1110
1110
  * see also https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.7
1111
1111
  */
1112
1112
  if (schemaObject.format) {
1113
- if (schemaObject.type === 'integer' && (schemaObject.format === 'int32' || schemaObject.format === 'int64')) {
1113
+ if (schemaObject.type === 'integer' && schemaObject.format === 'int64') {
1114
+ baseItems.unshift({ keyword: schemaKeywords.bigint })
1115
+ return baseItems
1116
+ }
1117
+
1118
+ if (schemaObject.type === 'integer' && schemaObject.format === 'int32') {
1114
1119
  baseItems.unshift({ keyword: schemaKeywords.integer })
1115
1120
  return baseItems
1116
1121
  }
@@ -72,6 +72,7 @@ export type SchemaKeywordMapper = {
72
72
  default: { keyword: 'default'; args: string | number | boolean }
73
73
  string: { keyword: 'string' }
74
74
  integer: { keyword: 'integer' }
75
+ bigint: { keyword: 'bigint' }
75
76
  number: { keyword: 'number' }
76
77
  max: { keyword: 'max'; args: number }
77
78
  min: { keyword: 'min'; args: number }
@@ -100,6 +101,7 @@ export const schemaKeywords = {
100
101
  unknown: 'unknown',
101
102
  number: 'number',
102
103
  integer: 'integer',
104
+ bigint: 'bigint',
103
105
  string: 'string',
104
106
  boolean: 'boolean',
105
107
  undefined: 'undefined',
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaMapper-CzH82C7C.cjs","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` is used.\n * When false a reference is used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this is equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaMapper-D-GETHNf.js","names":[],"sources":["../src/SchemaMapper.ts"],"sourcesContent":["import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { SchemaObject } from '@kubb/oas'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n patternProperties?: Record<string, Schema[]>\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.Path\n /**\n * When true `File.Import` is used.\n * When false a reference is used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }\n exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n exclusiveMinimum: 'exclusiveMinimum',\n exclusiveMaximum: 'exclusiveMaximum',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n schema: SchemaObject\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this is equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"],"mappings":";;;AAiGA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CAEN,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,KAAK;CACL,KAAK;CACL,kBAAkB;CAClB,kBAAkB;CAClB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,KAAK;CACL,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,OAAO;CACP,MAAM;CACN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,WAAW;CACZ;AA4BD,SAAgB,UAAiE,MAAS,SAAwD;AAChJ,QAAO,KAAK,YAAY"}