@kubb/plugin-oas 3.0.0-alpha.9 → 3.0.0-beta.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.
- package/README.md +14 -5
- package/dist/OperationGenerator-BgQeGRzk.d.cts +550 -0
- package/dist/OperationGenerator-BgQeGRzk.d.ts +550 -0
- package/dist/{Schema-B1vcPGiK.d.ts → Schema-1iM2I0dK.d.ts} +1 -12
- package/dist/{Schema-DoSFh7Qd.d.cts → Schema-5o-c5UOy.d.cts} +1 -12
- package/dist/chunk-ABOQ73FL.cjs +36 -0
- package/dist/chunk-ABOQ73FL.cjs.map +1 -0
- package/dist/chunk-BG77DP54.js +30 -0
- package/dist/chunk-BG77DP54.js.map +1 -0
- package/dist/chunk-GF26SDHQ.js +28 -0
- package/dist/chunk-GF26SDHQ.js.map +1 -0
- package/dist/chunk-PADR76WZ.cjs +4 -0
- package/dist/chunk-PADR76WZ.cjs.map +1 -0
- package/dist/chunk-QAFBZLJA.cjs +48 -0
- package/dist/chunk-QAFBZLJA.cjs.map +1 -0
- package/dist/chunk-QT6ZFRNJ.cjs +752 -0
- package/dist/chunk-QT6ZFRNJ.cjs.map +1 -0
- package/dist/chunk-QWO5NQGQ.js +88 -0
- package/dist/chunk-QWO5NQGQ.js.map +1 -0
- package/dist/chunk-R47XMJ32.js +3 -0
- package/dist/chunk-R47XMJ32.js.map +1 -0
- package/dist/chunk-SR63CBLH.cjs +92 -0
- package/dist/chunk-SR63CBLH.cjs.map +1 -0
- package/dist/chunk-V2JO6RHI.js +744 -0
- package/dist/chunk-V2JO6RHI.js.map +1 -0
- package/dist/chunk-XNCEFOE6.js +45 -0
- package/dist/chunk-XNCEFOE6.js.map +1 -0
- package/dist/chunk-ZWHQ54JM.cjs +32 -0
- package/dist/chunk-ZWHQ54JM.cjs.map +1 -0
- package/dist/components.cjs +20 -12
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +3 -6
- package/dist/components.d.ts +3 -6
- package/dist/components.js +3 -12
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +14 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +9 -0
- package/dist/generators.d.ts +9 -0
- package/dist/generators.js +5 -0
- package/dist/generators.js.map +1 -0
- package/dist/hooks.cjs +102 -57
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +41 -10
- package/dist/hooks.d.ts +41 -10
- package/dist/hooks.js +91 -53
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +134 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -5
- package/dist/index.d.ts +2 -5
- package/dist/index.js +68 -146
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +32 -45
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +4 -13
- package/dist/utils.d.ts +4 -13
- package/dist/utils.js +8 -44
- package/dist/utils.js.map +1 -1
- package/package.json +20 -14
- package/src/OperationGenerator.ts +11 -23
- package/src/SchemaGenerator.ts +68 -9
- package/src/SchemaMapper.ts +6 -4
- package/src/components/Schema.tsx +1 -99
- package/src/generator.tsx +22 -18
- package/src/generators/index.ts +1 -0
- package/src/generators/jsonGenerator.ts +32 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useOperationManager.ts +77 -30
- package/src/hooks/useSchemaManager.ts +77 -0
- package/src/plugin.ts +69 -56
- package/src/types.ts +24 -18
- package/src/utils/getParams.ts +1 -1
- package/src/utils/getSchemaFactory.ts +1 -1
- package/src/utils/index.ts +0 -1
- package/src/utils/parseFromConfig.ts +7 -7
- package/dist/OperationGenerator-By5WOmWB.d.ts +0 -165
- package/dist/OperationGenerator-Gd1X7wUz.d.cts +0 -165
- package/dist/SchemaMapper-sGcY1xL5.d.cts +0 -247
- package/dist/SchemaMapper-sGcY1xL5.d.ts +0 -247
- package/dist/chunk-75BIOXB7.cjs +0 -7
- package/dist/chunk-75BIOXB7.cjs.map +0 -1
- package/dist/chunk-IAUV3UKH.cjs +0 -3965
- package/dist/chunk-IAUV3UKH.cjs.map +0 -1
- package/dist/chunk-M347763D.js +0 -3965
- package/dist/chunk-M347763D.js.map +0 -1
- package/dist/chunk-N7EEVJA6.js +0 -35
- package/dist/chunk-N7EEVJA6.js.map +0 -1
- package/dist/chunk-NU4F7G47.cjs +0 -89
- package/dist/chunk-NU4F7G47.cjs.map +0 -1
- package/dist/chunk-O76YQFZB.cjs +0 -35
- package/dist/chunk-O76YQFZB.cjs.map +0 -1
- package/dist/chunk-SQ64ESS4.js +0 -7
- package/dist/chunk-SQ64ESS4.js.map +0 -1
- package/dist/chunk-SZDO532A.js +0 -89
- package/dist/chunk-SZDO532A.js.map +0 -1
- package/dist/types-CZTUCaE5.d.cts +0 -145
- package/dist/types-CZTUCaE5.d.ts +0 -145
- package/src/utils/refSorter.ts +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SchemaMapper.ts","../src/SchemaGenerator.ts"],"names":["_schema","nullable","name","min","max"],"mappings":";;;;;;;;AAgFO,IAAM,cAAiB,GAAA;AAAA,EAC5B,GAAK,EAAA,KAAA;AAAA,EACL,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,OAAS,EAAA,SAAA;AAAA,EACT,KAAO,EAAA,OAAA;AAAA,EACP,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,G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AA,GACpC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAA,CAAO,IAAc,EAAA,MAAA,EAAsB,OAAkD,EAAA;AACjG,IAAA,OAAO,EAAC,CAAA;AAAA,GACV;AACF","file":"chunk-V2JO6RHI.js","sourcesContent":["import type * as KubbFile from '@kubb/fs/types'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n strict?: boolean\n }\n }\n strict: { keyword: 'strict' }\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 } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number }\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: { name: string; path: KubbFile.OptionalPath }\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 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 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}\n\nexport const schemaKeywords = {\n any: 'any',\n strict: 'strict',\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 /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\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} 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 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","import { BaseGenerator, type FileMetaBase } from '@kubb/core'\nimport transformers, { pascalCase } from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\n\nimport { isReference } from '@kubb/oas'\nimport { isDeepEqual, isNumber, uniqueWith } from 'remeda'\nimport { isKeyword, schemaKeywords } from './SchemaMapper.ts'\nimport { getSchemaFactory } from './utils/getSchemaFactory.ts'\nimport { getSchemas } from './utils/getSchemas.ts'\n\nimport type { Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core'\nimport type * as KubbFile from '@kubb/fs/types'\n\nimport type { Oas, OpenAPIV3, SchemaObject, contentType } from '@kubb/oas'\nimport type { Schema, SchemaKeywordMapper } from './SchemaMapper.ts'\nimport type { Generator } from './generator.tsx'\nimport type { OperationSchema, Override, Refs } from './types.ts'\n\nexport type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never\n\nexport type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>\n\ntype Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {\n oas: Oas\n pluginManager: PluginManager\n /**\n * Current plugin\n */\n plugin: Plugin<TPluginOptions>\n mode: KubbFile.Mode\n include?: Array<'schemas' | 'responses' | 'requestBodies'>\n override: Array<Override<TOptions>> | undefined\n contentType?: contentType\n output?: string\n}\n\nexport type SchemaGeneratorOptions = {\n dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date'\n unknownType: 'any' | 'unknown'\n enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n enumSuffix?: string\n usedEnumNames?: Record<string, number>\n mapper?: Record<string, string>\n typed?: boolean\n transformers: {\n /**\n * Customize the names based on the type that is provided by the plugin.\n */\n name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n /**\n * Receive schema and name(propertName) and return FakerMeta array\n * TODO TODO add docs\n * @beta\n */\n schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined\n }\n}\n\nexport type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>\n\ntype SchemaProps = {\n schema?: SchemaObject\n name?: string\n parentName?: string\n}\n\nexport class SchemaGenerator<\n TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions,\n TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions,\n TFileMeta extends FileMetaBase = FileMetaBase,\n> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {\n // Collect the types of all referenced schemas, so we can export them later\n refs: Refs = {}\n\n // Keep track of already used type aliases\n #usedAliasNames: Record<string, number> = {}\n\n /**\n * Creates a type node from a given schema.\n * Delegates to getBaseTypeFromSchema internally and\n * optionally adds a union with null.\n */\n parse(props: SchemaProps): Schema[] {\n const options = this.#getOptions(props)\n\n const defaultSchemas = this.#parseSchemaObject(props)\n const schemas = options.transformers?.schema?.(props, defaultSchemas) || defaultSchemas || []\n\n return uniqueWith(schemas, isDeepEqual)\n }\n\n deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n return SchemaGenerator.deepSearch<T>(tree, keyword)\n }\n\n find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n return SchemaGenerator.find<T>(tree, keyword)\n }\n\n static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] {\n const foundItems: SchemaKeywordMapper[T][] = []\n\n tree?.forEach((schema) => {\n if (schema.keyword === keyword) {\n foundItems.push(schema as SchemaKeywordMapper[T])\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>(entrySchema, keyword))\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n })\n\n return foundItems\n }\n\n static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.object) {\n const subItem = schema as SchemaKeywordMapper['object']\n\n Object.values(subItem.args?.properties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>(entrySchema, keyword)\n }\n })\n\n Object.values(subItem.args?.additionalProperties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined = undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (schema.keyword === schemaKeywords.array) {\n const subItem = schema as SchemaKeywordMapper['array']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.and) {\n const subItem = schema as SchemaKeywordMapper['and']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.tuple) {\n const subItem = schema as SchemaKeywordMapper['tuple']\n\n subItem.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (schema.keyword === schemaKeywords.union) {\n const subItem = schema as SchemaKeywordMapper['union']\n\n subItem.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n #getUsedEnumNames(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n return options.usedEnumNames || {}\n }\n\n #getOptions({ name }: SchemaProps): Partial<TOptions> {\n const { override = [] } = this.context\n\n return {\n ...this.options,\n ...(override.find(({ pattern, type }) => {\n if (name && type === 'schemaName') {\n return !!name.match(pattern)\n }\n\n return false\n })?.options || {}),\n }\n }\n\n #getUnknownReturn(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.unknownType === 'any') {\n return schemaKeywords.any\n }\n\n return schemaKeywords.unknown\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #parseProperties({ schema, name }: SchemaProps): Schema[] {\n const properties = schema?.properties || {}\n const additionalProperties = schema?.additionalProperties\n const required = schema?.required\n\n const propertiesSchemas = Object.keys(properties)\n .map((propertyName) => {\n const validationFunctions: Schema[] = []\n const propertySchema = properties[propertyName] as SchemaObject\n\n const isRequired = Array.isArray(required) ? required?.includes(propertyName) : !!required\n const nullable = propertySchema.nullable ?? propertySchema['x-nullable'] ?? false\n\n validationFunctions.push(...this.parse({ schema: propertySchema, name: propertyName, parentName: name }))\n\n validationFunctions.push({\n keyword: schemaKeywords.name,\n args: propertyName,\n })\n\n if (!isRequired && nullable) {\n validationFunctions.push({ keyword: schemaKeywords.nullish })\n } else if (!isRequired) {\n validationFunctions.push({ keyword: schemaKeywords.optional })\n }\n\n return {\n [propertyName]: validationFunctions,\n }\n })\n .reduce((acc, curr) => ({ ...acc, ...curr }), {})\n let additionalPropertiesSchemas: Schema[] = []\n\n if (additionalProperties) {\n additionalPropertiesSchemas =\n additionalProperties === true || !Object.keys(additionalProperties).length\n ? [{ keyword: this.#getUnknownReturn({ schema, name }) }]\n : this.parse({ schema: additionalProperties as SchemaObject, parentName: name })\n }\n\n return [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: propertiesSchemas,\n additionalProperties: additionalPropertiesSchemas,\n },\n },\n ]\n }\n\n /**\n * Create a type alias for the schema referenced by the given ReferenceObject\n */\n #getRefAlias(obj: OpenAPIV3.ReferenceObject): Schema[] {\n const { $ref } = obj\n let ref = this.refs[$ref]\n\n const originalName = getUniqueName($ref.replace(/.+\\//, ''), this.#usedAliasNames)\n const propertyName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'function',\n })\n\n if (ref) {\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref.path },\n },\n ]\n }\n\n const fileName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'file',\n })\n const file = this.context.pluginManager.getFile({\n name: fileName,\n pluginKey: this.context.plugin.key,\n extname: '.ts',\n })\n\n ref = this.refs[$ref] = {\n propertyName,\n originalName,\n path: file.path,\n }\n\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, path: ref?.path },\n },\n ]\n }\n\n #getParsedSchemaObject(schema?: SchemaObject) {\n const parsedSchema = getSchemaFactory(this.context.oas)(schema)\n return parsedSchema\n }\n\n /**\n * This is the very core of the OpenAPI to TS conversion - it takes a\n * schema and returns the appropriate type.\n */\n #parseSchemaObject({ schema: _schema, name, parentName }: SchemaProps): Schema[] {\n const options = this.#getOptions({ schema: _schema, name })\n const unknownReturn = this.#getUnknownReturn({ schema: _schema, name })\n const { schema, version } = this.#getParsedSchemaObject(_schema)\n if (!schema) {\n return [{ keyword: unknownReturn }]\n }\n\n const baseItems: Schema[] = [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const nullable = schema.nullable ?? schema['x-nullable'] ?? false\n\n if (schema.default !== undefined && !Array.isArray(schema.default)) {\n if (typeof schema.default === 'string') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: transformers.stringify(schema.default),\n })\n } else if (typeof schema.default === 'boolean') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schema.default ?? false,\n })\n } else {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schema.default,\n })\n }\n }\n\n if (schema.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schema.description,\n })\n }\n\n if (schema.pattern) {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schema.pattern,\n })\n }\n\n if (max !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.max, args: max })\n }\n\n if (min !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.min, args: min })\n }\n\n if (nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (schema.type && Array.isArray(schema.type)) {\n const [_schema, nullable] = schema.type\n\n if (nullable === 'null') {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n }\n\n if (schema.readOnly) {\n baseItems.push({ keyword: schemaKeywords.readOnly })\n }\n\n if (schema.writeOnly) {\n baseItems.push({ keyword: schemaKeywords.writeOnly })\n }\n\n if (isReference(schema)) {\n return [\n ...this.#getRefAlias(schema),\n nullable && { keyword: schemaKeywords.nullable },\n schema.readOnly && { keyword: schemaKeywords.readOnly },\n schema.writeOnly && { keyword: schemaKeywords.writeOnly },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schema.type as any,\n format: schema.format,\n },\n },\n ].filter(Boolean)\n }\n\n if (schema.oneOf) {\n // union\n const schemaWithoutOneOf = { ...schema, oneOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.oneOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n if (schemaWithoutOneOf.properties) {\n const propertySchemas = this.parse({ schema: schemaWithoutOneOf, name, parentName })\n\n return [\n {\n ...union,\n args: union.args.map((arg) => {\n return {\n keyword: schemaKeywords.and,\n args: [arg, ...propertySchemas],\n }\n }),\n },\n ...baseItems,\n ]\n }\n\n return [union, ...baseItems]\n }\n\n if (schema.anyOf) {\n // union\n const schemaWithoutAnyOf = { ...schema, anyOf: undefined }\n\n const union: Schema = {\n keyword: schemaKeywords.union,\n args: schema.anyOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n })\n .map((item) => {\n if (isKeyword(item, schemaKeywords.object)) {\n return {\n ...item,\n args: {\n ...item.args,\n strict: true,\n },\n }\n }\n return item\n }),\n }\n if (schemaWithoutAnyOf.properties) {\n return [...this.parse({ schema: schemaWithoutAnyOf, name, parentName }), union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n if (schema.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schema, allOf: undefined }\n\n const and: Schema = {\n keyword: schemaKeywords.and,\n args: schema.allOf\n .map((item) => {\n return item && this.parse({ schema: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => {\n return item && item.keyword !== unknownReturn\n }),\n }\n\n if (schemaWithoutAllOf.properties) {\n return [\n {\n ...and,\n args: [...(and.args || []), ...this.parse({ schema: schemaWithoutAllOf, name, parentName })],\n },\n ...baseItems,\n ]\n }\n\n return [and, ...baseItems]\n }\n\n if (schema.enum) {\n const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schema, name }))\n const typeName = this.context.pluginManager.resolveName({\n name: enumName,\n pluginKey: this.context.plugin.key,\n type: 'type',\n })\n\n const nullableEnum = schema.enum.includes(null)\n if (nullableEnum) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n const filteredValues = schema.enum.filter((value) => value !== null)\n\n // x-enumNames has priority\n const extensionEnums = ['x-enumNames', 'x-enum-varnames']\n .filter((extensionKey) => extensionKey in schema)\n .map((extensionKey) => {\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name,\n typeName,\n asConst: false,\n items: [...new Set(schema[extensionKey as keyof typeof schema] as string[])].map((name: string | number, index) => ({\n name: transformers.stringify(name),\n value: schema.enum?.[index] as string | number,\n format: isNumber(schema.enum?.[index]) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter(\n (item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches,\n ),\n ]\n })\n\n if (schema.type === 'number' || schema.type === 'integer') {\n // we cannot use z.enum when enum type is number/integer\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'number',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'number',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (schema.type === 'boolean') {\n // we cannot use z.enum when enum type is boolean\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'boolean',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'boolean',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (extensionEnums.length > 0 && extensionEnums[0]) {\n return extensionEnums[0]\n }\n\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: false,\n items: [...new Set(filteredValues)].map((value: string) => ({\n name: transformers.stringify(value),\n value,\n format: isNumber(value) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if ('prefixItems' in schema) {\n const prefixItems = schema.prefixItems as SchemaObject[]\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n\n return [\n {\n keyword: schemaKeywords.tuple,\n args: {\n min,\n max,\n items: prefixItems\n .map((item) => {\n return this.parse({ schema: item, name, parentName })[0]\n })\n .filter(Boolean),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (version === '3.1' && 'const' in schema) {\n // const keyword takes precendence over the actual type.\n if (schema['const']) {\n return [\n {\n keyword: schemaKeywords.const,\n args: {\n name: schema['const'],\n format: typeof schema['const'] === 'number' ? 'number' : 'string',\n value: schema['const'],\n },\n },\n ...baseItems,\n ]\n }\n return [{ keyword: schemaKeywords.null }]\n }\n\n /**\n * > Structural validation alone may be insufficient to allow an application to correctly utilize certain values. The \"format\"\n * > annotation keyword is defined to allow schema authors to convey semantic information for a fixed subset of values which are\n * > accurately described by authoritative resources, be they RFCs or other external specifications.\n *\n * In other words: format is more specific than type alone, hence it should override the type value, if possible.\n *\n * see also https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.7\n */\n if (schema.format) {\n switch (schema.format) {\n case 'binary':\n baseItems.push({ keyword: schemaKeywords.blob })\n return baseItems\n case 'date-time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n if (options.dateType === 'stringOffset') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: true } })\n return baseItems\n }\n\n if (options.dateType === 'stringLocal') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { local: true } })\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: false } })\n\n return baseItems\n }\n break\n case 'date':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'uuid':\n baseItems.unshift({ keyword: schemaKeywords.uuid })\n break\n case 'email':\n case 'idn-email':\n baseItems.unshift({ keyword: schemaKeywords.email })\n break\n case 'uri':\n case 'ipv4':\n case 'ipv6':\n case 'uri-reference':\n case 'hostname':\n case 'idn-hostname':\n baseItems.unshift({ keyword: schemaKeywords.url })\n break\n // case 'duration':\n // case 'json-pointer':\n // case 'relative-json-pointer':\n default:\n // formats not yet implemented: ignore.\n break\n }\n }\n\n // type based logic\n if ('items' in schema || schema.type === ('array' as 'string')) {\n const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined\n const items = this.parse({ schema: 'items' in schema ? (schema.items as SchemaObject) : [], name, parentName })\n\n return [\n {\n keyword: schemaKeywords.array,\n args: {\n items,\n min,\n max,\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (schema.properties || schema.additionalProperties) {\n return [...this.#parseProperties({ schema, name }), ...baseItems]\n }\n\n if (schema.type) {\n if (Array.isArray(schema.type)) {\n // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n const [type] = schema.type as Array<OpenAPIV3.NonArraySchemaObjectType>\n\n return [\n ...this.parse({\n schema: {\n ...schema,\n type,\n },\n name,\n parentName,\n }),\n ...baseItems,\n ].filter(Boolean)\n }\n\n if (!['boolean', 'object', 'number', 'string', 'integer', 'null'].includes(schema.type)) {\n this.context.pluginManager.logger.emit('warning', `Schema type '${schema.type}' is not valid for schema ${parentName}.${name}`)\n }\n\n // 'string' | 'number' | 'integer' | 'boolean'\n return [{ keyword: schema.type }, ...baseItems]\n }\n\n return [{ keyword: unknownReturn }]\n }\n\n async build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>> {\n const { oas, contentType, include } = this.context\n\n oas.resolveDiscriminators()\n\n const schemas = getSchemas({ oas, contentType, includes: include })\n\n const promises = Object.entries(schemas).reduce((acc, [name, value]) => {\n if (!value) {\n return acc\n }\n\n const options = this.#getOptions({ name })\n const promiseOperation = this.schema.call(this, name, value, {\n ...this.options,\n ...options,\n })\n\n if (promiseOperation) {\n acc.push(promiseOperation)\n }\n\n generators?.forEach((generator) => {\n const tree = this.parse({ schema: value, name: name })\n\n const promise = generator.schema?.({\n instance: this,\n schema: {\n name,\n value,\n tree,\n },\n options: {\n ...this.options,\n ...options,\n },\n } as any) as Promise<Array<KubbFile.File<TFileMeta>>>\n\n if (promise) {\n acc.push(promise)\n }\n })\n\n return acc\n }, [] as SchemaMethodResult<TFileMeta>[])\n\n const files = await Promise.all(promises)\n\n // using .flat because schemaGenerator[method] can return an array of files or just one file\n return files.flat().filter(Boolean)\n }\n\n /**\n * Schema\n */\n async schema(name: string, object: SchemaObject, options: TOptions): SchemaMethodResult<TFileMeta> {\n return []\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isOpenApiV3_1Document } from '@kubb/oas';
|
|
2
|
+
|
|
3
|
+
// src/utils/getSchemas.ts
|
|
4
|
+
function getSchemas({ oas, contentType, includes = ["schemas", "requestBodies", "responses"] }) {
|
|
5
|
+
const components = oas.getDefinition().components;
|
|
6
|
+
let schemas = {};
|
|
7
|
+
if (includes.includes("schemas")) {
|
|
8
|
+
schemas = {
|
|
9
|
+
...schemas,
|
|
10
|
+
...components?.schemas || {}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const requestBodies = components?.requestBodies || {};
|
|
14
|
+
if (includes.includes("responses")) {
|
|
15
|
+
const responses = components?.responses || {};
|
|
16
|
+
Object.entries(responses).forEach(([name, response]) => {
|
|
17
|
+
if (response.content && !schemas[name]) {
|
|
18
|
+
const firstContentType = Object.keys(response.content)[0] || "application/json";
|
|
19
|
+
schemas[name] = response.content?.[contentType || firstContentType]?.schema;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (includes.includes("requestBodies")) {
|
|
24
|
+
Object.entries(requestBodies).forEach(([name, request]) => {
|
|
25
|
+
if (request.content && !schemas[name]) {
|
|
26
|
+
const firstContentType = Object.keys(request.content)[0] || "application/json";
|
|
27
|
+
schemas[name] = request.content?.[contentType || firstContentType]?.schema;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return schemas;
|
|
32
|
+
}
|
|
33
|
+
function getSchemaFactory(oas) {
|
|
34
|
+
return (schema) => {
|
|
35
|
+
const version = isOpenApiV3_1Document(oas.api) ? "3.1" : "3.0";
|
|
36
|
+
return {
|
|
37
|
+
schema: oas.dereferenceWithRef(schema),
|
|
38
|
+
version
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { getSchemaFactory, getSchemas };
|
|
44
|
+
//# sourceMappingURL=chunk-XNCEFOE6.js.map
|
|
45
|
+
//# sourceMappingURL=chunk-XNCEFOE6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"names":[],"mappings":";;;AAUO,SAAS,UAAA,CAAW,EAAE,GAAA,EAAK,WAAa,EAAA,QAAA,GAAW,CAAC,SAAW,EAAA,eAAA,EAAiB,WAAW,CAAA,EAA6D,EAAA;AAC7J,EAAM,MAAA,UAAA,GAAa,GAAI,CAAA,aAAA,EAAgB,CAAA,UAAA,CAAA;AAEvC,EAAA,IAAI,UAAiD,EAAC,CAAA;AAEtD,EAAI,IAAA,QAAA,CAAS,QAAS,CAAA,SAAS,CAAG,EAAA;AAChC,IAAU,OAAA,GAAA;AAAA,MACR,GAAG,OAAA;AAAA,MACH,GAAK,UAAY,EAAA,OAAA,IAAqD,EAAC;AAAA,KACzE,CAAA;AAAA,GACF;AAEA,EAAM,MAAA,aAAA,GAAgB,UAAY,EAAA,aAAA,IAAiB,EAAC,CAAA;AACpD,EAAI,IAAA,QAAA,CAAS,QAAS,CAAA,WAAW,CAAG,EAAA;AAClC,IAAM,MAAA,SAAA,GAAY,UAAY,EAAA,SAAA,IAAa,EAAC,CAAA;AAE5C,IAAO,MAA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,CAAmB,MAAM,CAAA;AAAA,MACrC,OAAA;AAAA,KACF,CAAA;AAAA,GACF,CAAA;AACF","file":"chunk-XNCEFOE6.js","sourcesContent":["import type { Oas, OasTypes, contentType } from '@kubb/oas'\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\nexport type GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n}\n\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'] }: GetSchemasProps): Record<string, OasTypes.SchemaObject> {\n const components = oas.getDefinition().components\n\n let schemas: Record<string, OasTypes.SchemaObject> = {}\n\n if (includes.includes('schemas')) {\n schemas = {\n ...schemas,\n ...((components?.schemas as Record<string, OasTypes.SchemaObject>) || {}),\n }\n }\n\n const requestBodies = components?.requestBodies || {}\n if (includes.includes('responses')) {\n const responses = components?.responses || {}\n\n Object.entries(responses).forEach(([name, response]: [string, OasTypes.ResponseObject]) => {\n if (response.content && !schemas[name]) {\n const firstContentType = Object.keys(response.content)[0] || 'application/json'\n schemas[name] = response.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n if (includes.includes('requestBodies')) {\n Object.entries(requestBodies).forEach(([name, request]: [string, OasTypes.RequestBodyObject]) => {\n if (request.content && !schemas[name]) {\n const firstContentType = Object.keys(request.content)[0] || 'application/json'\n schemas[name] = request.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n return schemas\n}\n","import { isOpenApiV3_1Document } from '@kubb/oas'\n\nimport type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schema?: (TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.0'\n }\n | {\n schema?: (TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.1'\n }\n\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema?: SchemaObject) => SchemaResult<TWithRef> {\n return (schema?: SchemaObject) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schema: oas.dereferenceWithRef(schema),\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@kubb/react');
|
|
4
|
+
var jsxRuntime = require('@kubb/react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
// src/components/Operation.tsx
|
|
7
|
+
var OperationContext = react.createContext({});
|
|
8
|
+
function Operation({ operation, children }) {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OperationContext.Provider, { value: { operation }, children });
|
|
10
|
+
}
|
|
11
|
+
Operation.Context = OperationContext;
|
|
12
|
+
var SchemaContext = react.createContext({
|
|
13
|
+
name: "unknown",
|
|
14
|
+
tree: []
|
|
15
|
+
});
|
|
16
|
+
function Schema({ name, value, tree = [], children }) {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SchemaContext.Provider, { value: { name, schema: value, tree }, children });
|
|
18
|
+
}
|
|
19
|
+
Schema.Context = SchemaContext;
|
|
20
|
+
var OasContext = react.createContext({});
|
|
21
|
+
function Oas({ oas, children, operations, generator }) {
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OasContext.Provider, { value: { oas, generator, operations }, children });
|
|
23
|
+
}
|
|
24
|
+
Oas.Context = OasContext;
|
|
25
|
+
Oas.Operation = Operation;
|
|
26
|
+
Oas.Schema = Schema;
|
|
27
|
+
|
|
28
|
+
exports.Oas = Oas;
|
|
29
|
+
exports.Operation = Operation;
|
|
30
|
+
exports.Schema = Schema;
|
|
31
|
+
//# sourceMappingURL=chunk-ZWHQ54JM.cjs.map
|
|
32
|
+
//# sourceMappingURL=chunk-ZWHQ54JM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Operation.tsx","../src/components/Schema.tsx","../src/components/Oas.tsx"],"names":["createContext","jsx"],"mappings":";;;;;;AAcA,IAAM,gBAAA,GAAmBA,mBAAqC,CAAA,EAAE,CAAA,CAAA;AAEzD,SAAS,SAAU,CAAA,EAAE,SAAW,EAAA,QAAA,EAA6B,EAAA;AAClE,EAAO,uBAAAC,cAAA,CAAC,iBAAiB,QAAjB,EAAA,EAA0B,OAAO,EAAE,SAAA,IAAc,QAAS,EAAA,CAAA,CAAA;AACpE,CAAA;AAEA,SAAA,CAAU,OAAU,GAAA,gBAAA,CAAA;ACDpB,IAAM,gBAAgBD,mBAAkC,CAAA;AAAA,EACtD,IAAM,EAAA,SAAA;AAAA,EACN,MAAM,EAAC;AACT,CAAC,CAAA,CAAA;AAEM,SAAS,MAAA,CAAO,EAAE,IAAM,EAAA,KAAA,EAAO,OAAO,EAAC,EAAG,UAA6B,EAAA;AAC5E,EAAA,uBAAOC,cAAAA,CAAC,aAAc,CAAA,QAAA,EAAd,EAAuB,KAAA,EAAO,EAAE,IAAA,EAAM,MAAQ,EAAA,KAAA,EAAO,IAAK,EAAA,EAAI,QAAS,EAAA,CAAA,CAAA;AACjF,CAAA;AAEA,MAAA,CAAO,OAAU,GAAA,aAAA,CAAA;ACAjB,IAAM,UAAA,GAAaD,mBAA+B,CAAA,EAAE,CAAA,CAAA;AAE7C,SAAS,IAAI,EAAE,GAAA,EAAK,QAAU,EAAA,UAAA,EAAY,WAA8B,EAAA;AAC7E,EAAO,uBAAAC,cAAC,CAAA,UAAA,CAAW,QAAX,EAAA,EAAoB,KAAO,EAAA,EAAE,GAAK,EAAA,SAAA,EAAW,UAAW,EAAA,EAAI,QAAS,EAAA,CAAA,CAAA;AAC/E,CAAA;AAEA,GAAA,CAAI,OAAU,GAAA,UAAA,CAAA;AACd,GAAA,CAAI,SAAY,GAAA,SAAA,CAAA;AAChB,GAAA,CAAI,MAAS,GAAA,MAAA","file":"chunk-ZWHQ54JM.cjs","sourcesContent":["import { createContext } from '@kubb/react'\n\nimport type { Operation as OperationType } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/types'\n\ntype Props = {\n operation: OperationType\n children?: KubbNode\n}\n\ntype OperationContextProps = {\n operation?: OperationType\n}\n\nconst OperationContext = createContext<OperationContextProps>({})\n\nexport function Operation({ operation, children }: Props): KubbNode {\n return <OperationContext.Provider value={{ operation }}>{children}</OperationContext.Provider>\n}\n\nOperation.Context = OperationContext\n","import { createContext } from '@kubb/react'\n\nimport type { SchemaObject } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/types'\nimport type { Schema as SchemaType } from '../SchemaMapper.ts'\n\nexport type SchemaContextProps = {\n name: string\n schema?: SchemaObject\n tree: Array<SchemaType>\n}\n\ntype Props = {\n name: string\n value?: SchemaObject\n tree?: Array<SchemaType>\n children?: KubbNode\n}\n\nconst SchemaContext = createContext<SchemaContextProps>({\n name: 'unknown',\n tree: [],\n})\n\nexport function Schema({ name, value, tree = [], children }: Props): KubbNode {\n return <SchemaContext.Provider value={{ name, schema: value, tree }}>{children}</SchemaContext.Provider>\n}\n\nSchema.Context = SchemaContext\n","import { createContext } from '@kubb/react'\n\nimport { Operation } from './Operation.tsx'\nimport { Schema } from './Schema.tsx'\n\nimport type { Oas as OasType, Operation as OperationType } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/types'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\n\ntype Props = {\n oas: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n children?: KubbNode\n}\n\ntype OasContextProps = {\n oas?: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n}\n\nconst OasContext = createContext<OasContextProps>({})\n\nexport function Oas({ oas, children, operations, generator }: Props): KubbNode {\n return <OasContext.Provider value={{ oas, generator, operations }}>{children}</OasContext.Provider>\n}\n\nOas.Context = OasContext\nOas.Operation = Operation\nOas.Schema = Schema\n"]}
|
package/dist/components.cjs
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('./chunk-PADR76WZ.cjs');
|
|
4
|
+
var chunkZWHQ54JM_cjs = require('./chunk-ZWHQ54JM.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Oas", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkZWHQ54JM_cjs.Oas; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Operation", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkZWHQ54JM_cjs.Operation; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "Schema", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkZWHQ54JM_cjs.Schema; }
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=components.cjs.map
|
|
13
21
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.cjs"}
|
package/dist/components.d.cts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-5o-c5UOy.cjs';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
|
-
import {
|
|
6
|
-
import './SchemaMapper-sGcY1xL5.cjs';
|
|
7
|
-
import '@kubb/fs/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-BgQeGRzk.cjs';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
10
|
-
import '@kubb/oas/parser';
|
|
7
|
+
import '@kubb/fs/types';
|
|
11
8
|
|
|
12
9
|
type Props$1 = {
|
|
13
10
|
operation: Operation$1;
|
package/dist/components.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-1iM2I0dK.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
|
-
import {
|
|
6
|
-
import './SchemaMapper-sGcY1xL5.js';
|
|
7
|
-
import '@kubb/fs/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-BgQeGRzk.js';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
10
|
-
import '@kubb/oas/parser';
|
|
7
|
+
import '@kubb/fs/types';
|
|
11
8
|
|
|
12
9
|
type Props$1 = {
|
|
13
10
|
operation: Operation$1;
|
package/dist/components.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Operation,
|
|
5
|
-
Schema
|
|
6
|
-
} from "./chunk-M347763D.js";
|
|
7
|
-
import "./chunk-SZDO532A.js";
|
|
8
|
-
export {
|
|
9
|
-
Oas,
|
|
10
|
-
Operation,
|
|
11
|
-
Schema
|
|
12
|
-
};
|
|
1
|
+
import './chunk-R47XMJ32.js';
|
|
2
|
+
export { Oas, Operation, Schema } from './chunk-GF26SDHQ.js';
|
|
3
|
+
//# sourceMappingURL=components.js.map
|
|
13
4
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkSR63CBLH_cjs = require('./chunk-SR63CBLH.cjs');
|
|
4
|
+
require('./chunk-PADR76WZ.cjs');
|
|
5
|
+
require('./chunk-ZWHQ54JM.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "jsonGenerator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkSR63CBLH_cjs.jsonGenerator; }
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=generators.cjs.map
|
|
14
|
+
//# sourceMappingURL=generators.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-BgQeGRzk.cjs';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
|
|
7
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
8
|
+
|
|
9
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-BgQeGRzk.js';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
|
|
7
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
8
|
+
|
|
9
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|
package/dist/hooks.cjs
CHANGED
|
@@ -1,59 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkQT6ZFRNJ_cjs = require('./chunk-QT6ZFRNJ.cjs');
|
|
4
|
+
require('./chunk-QAFBZLJA.cjs');
|
|
5
|
+
var chunkZWHQ54JM_cjs = require('./chunk-ZWHQ54JM.cjs');
|
|
6
|
+
var react = require('@kubb/react');
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
var _chunkIAUV3UKHcjs = require('./chunk-IAUV3UKH.cjs');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkNU4F7G47cjs = require('./chunk-NU4F7G47.cjs');
|
|
9
|
-
|
|
10
|
-
// src/hooks/index.ts
|
|
11
|
-
_chunkNU4F7G47cjs.init_cjs_shims.call(void 0, );
|
|
12
|
-
|
|
13
|
-
// src/hooks/useOas.ts
|
|
14
|
-
_chunkNU4F7G47cjs.init_cjs_shims.call(void 0, );
|
|
15
|
-
var _react = require('@kubb/react');
|
|
16
8
|
function useOas() {
|
|
17
|
-
const { oas } =
|
|
9
|
+
const { oas } = react.useContext(chunkZWHQ54JM_cjs.Oas.Context);
|
|
18
10
|
if (!oas) {
|
|
19
11
|
throw new Error("Oas is not defined");
|
|
20
12
|
}
|
|
21
13
|
return oas;
|
|
22
14
|
}
|
|
23
|
-
|
|
24
|
-
// src/hooks/useOperation.ts
|
|
25
|
-
_chunkNU4F7G47cjs.init_cjs_shims.call(void 0, );
|
|
26
|
-
|
|
27
15
|
function useOperation() {
|
|
28
|
-
const { operation } =
|
|
16
|
+
const { operation } = react.useContext(chunkZWHQ54JM_cjs.Operation.Context);
|
|
29
17
|
if (!operation) {
|
|
30
18
|
throw new Error("Operation is not defined");
|
|
31
19
|
}
|
|
32
20
|
return operation;
|
|
33
21
|
}
|
|
34
|
-
|
|
35
|
-
// src/hooks/useOperationManager.ts
|
|
36
|
-
_chunkNU4F7G47cjs.init_cjs_shims.call(void 0, );
|
|
37
|
-
|
|
38
22
|
function useOperationManager() {
|
|
39
|
-
const { plugin, pluginManager } =
|
|
40
|
-
const { generator } =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
const { plugin, pluginManager } = react.useApp();
|
|
24
|
+
const { generator } = react.useContext(chunkZWHQ54JM_cjs.Oas.Context);
|
|
25
|
+
const getName = (operation, { prefix = "", suffix = "", pluginKey = plugin.key, type }) => {
|
|
26
|
+
return pluginManager.resolveName({
|
|
27
|
+
name: `${prefix} ${operation.getOperationId()} ${suffix}`,
|
|
28
|
+
pluginKey,
|
|
29
|
+
type
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const getSchemas = (operation, params) => {
|
|
33
|
+
if (!generator) {
|
|
34
|
+
throw new Error(`'generator' is not defined`);
|
|
35
|
+
}
|
|
36
|
+
return generator.getSchemas(operation, {
|
|
37
|
+
resolveName: (name) => pluginManager.resolveName({
|
|
38
|
+
name,
|
|
39
|
+
pluginKey: params?.pluginKey,
|
|
40
|
+
type: params?.type
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const getSchemaName = (operation, key, { pluginKey = plugin.key, type } = {}) => {
|
|
45
|
+
const schemas = getSchemas(operation);
|
|
46
|
+
if (!schemas[key]?.name) {
|
|
47
|
+
throw new Error(`SchemaName not found for ${operation.getOperationId()}`);
|
|
48
|
+
}
|
|
45
49
|
return pluginManager.resolveName({
|
|
46
|
-
name:
|
|
50
|
+
name: schemas[key]?.name,
|
|
47
51
|
pluginKey,
|
|
48
52
|
type
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
|
-
const getFile = (operation, { pluginKey = plugin.key,
|
|
52
|
-
const
|
|
53
|
-
const name = getName(operation, { type: "file", pluginKey });
|
|
55
|
+
const getFile = (operation, { prefix, suffix, pluginKey = plugin.key, tag = operation.getTags().at(0)?.name, extname = ".ts" } = {}) => {
|
|
56
|
+
const name = getName(operation, { type: "file", pluginKey, prefix, suffix });
|
|
54
57
|
const file = pluginManager.getFile({
|
|
55
58
|
name,
|
|
56
|
-
|
|
59
|
+
extname,
|
|
57
60
|
pluginKey,
|
|
58
61
|
options: { type: "file", pluginKey, tag }
|
|
59
62
|
});
|
|
@@ -68,6 +71,9 @@ function useOperationManager() {
|
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
const groupSchemasByName = (operation, { pluginKey = plugin.key, type }) => {
|
|
74
|
+
if (!generator) {
|
|
75
|
+
throw new Error(`'generator' is not defined`);
|
|
76
|
+
}
|
|
71
77
|
const schemas = generator.getSchemas(operation);
|
|
72
78
|
const errors = (schemas.errors || []).reduce(
|
|
73
79
|
(prev, acc) => {
|
|
@@ -84,23 +90,23 @@ function useOperationManager() {
|
|
|
84
90
|
{}
|
|
85
91
|
);
|
|
86
92
|
return {
|
|
87
|
-
request:
|
|
93
|
+
request: schemas.request?.name ? pluginManager.resolveName({
|
|
88
94
|
name: schemas.request.name,
|
|
89
95
|
pluginKey,
|
|
90
96
|
type
|
|
91
97
|
}) : void 0,
|
|
92
98
|
parameters: {
|
|
93
|
-
path:
|
|
99
|
+
path: schemas.pathParams?.name ? pluginManager.resolveName({
|
|
94
100
|
name: schemas.pathParams.name,
|
|
95
101
|
pluginKey,
|
|
96
102
|
type
|
|
97
103
|
}) : void 0,
|
|
98
|
-
query:
|
|
104
|
+
query: schemas.queryParams?.name ? pluginManager.resolveName({
|
|
99
105
|
name: schemas.queryParams.name,
|
|
100
106
|
pluginKey,
|
|
101
107
|
type
|
|
102
108
|
}) : void 0,
|
|
103
|
-
header:
|
|
109
|
+
header: schemas.headerParams?.name ? pluginManager.resolveName({
|
|
104
110
|
name: schemas.headerParams.name,
|
|
105
111
|
pluginKey,
|
|
106
112
|
type
|
|
@@ -125,23 +131,13 @@ function useOperationManager() {
|
|
|
125
131
|
return {
|
|
126
132
|
getName,
|
|
127
133
|
getFile,
|
|
128
|
-
getSchemas
|
|
129
|
-
|
|
130
|
-
resolveName: (name) => pluginManager.resolveName({
|
|
131
|
-
name,
|
|
132
|
-
pluginKey: _optionalChain([params, 'optionalAccess', _14 => _14.pluginKey]),
|
|
133
|
-
type: _optionalChain([params, 'optionalAccess', _15 => _15.type])
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
134
|
+
getSchemas,
|
|
135
|
+
getSchemaName,
|
|
136
136
|
groupSchemasByName
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
// src/hooks/useOperations.ts
|
|
141
|
-
_chunkNU4F7G47cjs.init_cjs_shims.call(void 0, );
|
|
142
|
-
|
|
143
139
|
function useOperations({ method, path } = {}) {
|
|
144
|
-
const { operations } =
|
|
140
|
+
const { operations } = react.useContext(chunkZWHQ54JM_cjs.Oas.Context);
|
|
145
141
|
if (!operations) {
|
|
146
142
|
throw new Error("Operations is not defined");
|
|
147
143
|
}
|
|
@@ -154,11 +150,60 @@ function useOperations({ method, path } = {}) {
|
|
|
154
150
|
}
|
|
155
151
|
return items;
|
|
156
152
|
}
|
|
153
|
+
function useSchema() {
|
|
154
|
+
const props = react.useContext(chunkZWHQ54JM_cjs.Schema.Context);
|
|
155
|
+
return props;
|
|
156
|
+
}
|
|
157
|
+
function useSchemaManager() {
|
|
158
|
+
const { mode, plugin, pluginManager, fileManager } = react.useApp();
|
|
159
|
+
const getName = (name, { pluginKey = plugin.key, type }) => {
|
|
160
|
+
return pluginManager.resolveName({
|
|
161
|
+
name,
|
|
162
|
+
pluginKey,
|
|
163
|
+
type
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
const getFile = (name, { mode: mode2 = "split", pluginKey = plugin.key, extname = ".ts", tag } = {}) => {
|
|
167
|
+
const resolvedName = mode2 === "single" ? "" : getName(name, { type: "file", pluginKey });
|
|
168
|
+
const file = pluginManager.getFile({
|
|
169
|
+
name: resolvedName,
|
|
170
|
+
extname,
|
|
171
|
+
pluginKey,
|
|
172
|
+
options: { type: "file", pluginKey, tag }
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
...file,
|
|
176
|
+
meta: {
|
|
177
|
+
...file.meta,
|
|
178
|
+
name: resolvedName,
|
|
179
|
+
pluginKey
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
const getImports = (tree) => {
|
|
184
|
+
const refs = chunkQT6ZFRNJ_cjs.SchemaGenerator.deepSearch(tree, chunkQT6ZFRNJ_cjs.schemaKeywords.ref);
|
|
185
|
+
return refs?.map((item, i) => {
|
|
186
|
+
if (!item.args.path) {
|
|
187
|
+
return void 0;
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
name: [item.args.name],
|
|
191
|
+
path: item.args.path
|
|
192
|
+
};
|
|
193
|
+
}).filter(Boolean);
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
getName,
|
|
197
|
+
getFile,
|
|
198
|
+
getImports
|
|
199
|
+
};
|
|
200
|
+
}
|
|
157
201
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
exports.
|
|
202
|
+
exports.useOas = useOas;
|
|
203
|
+
exports.useOperation = useOperation;
|
|
204
|
+
exports.useOperationManager = useOperationManager;
|
|
205
|
+
exports.useOperations = useOperations;
|
|
206
|
+
exports.useSchema = useSchema;
|
|
207
|
+
exports.useSchemaManager = useSchemaManager;
|
|
208
|
+
//# sourceMappingURL=hooks.cjs.map
|
|
164
209
|
//# sourceMappingURL=hooks.cjs.map
|