@kubb/plugin-oas 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +13 -4
- package/dist/OperationGenerator-CHXolL0o.d.cts +553 -0
- package/dist/OperationGenerator-CHXolL0o.d.ts +553 -0
- package/dist/Schema-Ch0dHkM5.d.ts +22 -0
- package/dist/Schema-ClNodlyP.d.cts +22 -0
- package/dist/chunk-6UWOTOZJ.cjs +92 -0
- package/dist/chunk-6UWOTOZJ.cjs.map +1 -0
- package/dist/chunk-AZKUU24F.js +700 -0
- package/dist/chunk-AZKUU24F.js.map +1 -0
- package/dist/chunk-DFQJ57GH.js +45 -0
- package/dist/chunk-DFQJ57GH.js.map +1 -0
- package/dist/chunk-GF26SDHQ.js +28 -0
- package/dist/chunk-GF26SDHQ.js.map +1 -0
- package/dist/chunk-HP5WAFBU.cjs +48 -0
- package/dist/chunk-HP5WAFBU.cjs.map +1 -0
- package/dist/chunk-JNGUNN72.cjs +708 -0
- package/dist/chunk-JNGUNN72.cjs.map +1 -0
- package/dist/chunk-PADR76WZ.cjs +4 -0
- package/dist/chunk-PADR76WZ.cjs.map +1 -0
- package/dist/chunk-R47XMJ32.js +3 -0
- package/dist/chunk-R47XMJ32.js.map +1 -0
- package/dist/{chunk-Y4V7HHX7.js → chunk-THGCWF2O.js} +8 -13
- package/dist/{chunk-Y4V7HHX7.js.map → chunk-THGCWF2O.js.map} +1 -1
- package/dist/chunk-TRA5BTWI.js +88 -0
- package/dist/chunk-TRA5BTWI.js.map +1 -0
- package/dist/chunk-UO57DZPV.cjs +36 -0
- package/dist/chunk-UO57DZPV.cjs.map +1 -0
- package/dist/chunk-ZWHQ54JM.cjs +32 -0
- package/dist/chunk-ZWHQ54JM.cjs.map +1 -0
- package/dist/components.cjs +20 -17
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +12 -8
- package/dist/components.d.ts +12 -8
- package/dist/components.js +3 -17
- 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 +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +5 -0
- package/dist/generators.js.map +1 -0
- package/dist/hooks.cjs +101 -57
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +40 -8
- package/dist/hooks.d.ts +40 -8
- package/dist/hooks.js +90 -53
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +283 -261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -77
- package/dist/index.d.ts +6 -77
- package/dist/index.js +235 -240
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +32 -87
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +7 -41
- package/dist/utils.d.ts +7 -41
- package/dist/utils.js +8 -86
- package/dist/utils.js.map +1 -1
- package/package.json +20 -14
- package/src/OperationGenerator.ts +75 -43
- package/src/SchemaGenerator.ts +44 -18
- package/src/SchemaMapper.ts +1 -1
- package/src/components/Oas.tsx +9 -3
- package/src/components/Operation.tsx +1 -1
- package/src/components/Schema.tsx +2 -102
- package/src/generator.tsx +133 -0
- 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 +76 -28
- package/src/hooks/useSchemaManager.ts +77 -0
- package/src/index.ts +3 -9
- package/src/plugin.ts +64 -47
- package/src/types.ts +23 -12
- package/src/utils/getParams.ts +2 -2
- package/src/utils/index.ts +2 -2
- package/dist/OperationGenerator-CeM_9pxW.d.cts +0 -60
- package/dist/OperationGenerator-DhUhvRJE.d.ts +0 -60
- package/dist/Schema-DefwBJMc.d.ts +0 -35
- package/dist/Schema-an5hOrjZ.d.cts +0 -35
- package/dist/SchemaMapper-CsBQ6eEx.d.cts +0 -248
- package/dist/SchemaMapper-CsBQ6eEx.d.ts +0 -248
- package/dist/chunk-CJXRFYEF.cjs +0 -698
- package/dist/chunk-CJXRFYEF.cjs.map +0 -1
- package/dist/chunk-DRLYORTT.cjs +0 -3265
- package/dist/chunk-DRLYORTT.cjs.map +0 -1
- package/dist/chunk-K6KUETAI.js +0 -698
- package/dist/chunk-K6KUETAI.js.map +0 -1
- package/dist/chunk-LEACSHKT.js +0 -3265
- package/dist/chunk-LEACSHKT.js.map +0 -1
- package/dist/chunk-P42X362U.cjs +0 -101
- package/dist/chunk-P42X362U.cjs.map +0 -1
- package/dist/chunk-QLJIL3U5.cjs +0 -35
- package/dist/chunk-QLJIL3U5.cjs.map +0 -1
- package/dist/chunk-UB552H4J.js +0 -101
- package/dist/chunk-UB552H4J.js.map +0 -1
- package/dist/types-Dte3MA6H.d.cts +0 -143
- package/dist/types-Dte3MA6H.d.ts +0 -143
- package/src/utils/getGroupedByTagFiles.ts +0 -82
- package/src/utils/refSorter.ts +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SchemaMapper.ts","../src/SchemaGenerator.ts"],"names":["BaseGenerator","uniqueWith","isDeepEqual","getUniqueName","getSchemaFactory","transformers","_schema","nullable","isReference","pascalCase","name","isNumber","min","max","getSchemas"],"mappings":";;;;;;;;;;;;;;AA+EO,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,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AAAA,OACJ,CAAA,CAAA;AAED,MAAA,IAAI,gBAAkB,EAAA;AACpB,QAAA,GAAA,CAAI,KAAK,gBAAgB,CAAA,CAAA;AAAA,OAC3B;AAEA,MAAY,UAAA,EAAA,OAAA,CAAQ,CAAC,SAAc,KAAA;AACjC,QAAA,MAAM,OAAO,IAAK,CAAA,KAAA,CAAM,EAAE,MAAQ,EAAA,KAAA,EAAO,MAAY,CAAA,CAAA;AAErD,QAAM,MAAA,OAAA,GAAU,UAAU,MAAS,GAAA;AAAA,UACjC,QAAU,EAAA,IAAA;AAAA,UACV,MAAQ,EAAA;AAAA,YACN,IAAA;AAAA,YACA,KAAA;AAAA,YACA,IAAA;AAAA,WACF;AAAA,UACA,OAAS,EAAA;AAAA,YACP,GAAG,IAAK,CAAA,OAAA;AAAA,YACR,GAAG,OAAA;AAAA,WACL;AAAA,SACM,CAAA,CAAA;AAER,QAAA,IAAI,OAAS,EAAA;AACX,UAAA,GAAA,CAAI,KAAK,OAAO,CAAA,CAAA;AAAA,SAClB;AAAA,OACD,CAAA,CAAA;AAED,MAAO,OAAA,GAAA,CAAA;AAAA,KACT,EAAG,EAAqC,CAAA,CAAA;AAExC,IAAA,MAAM,KAAQ,GAAA,MAAM,OAAQ,CAAA,GAAA,CAAI,QAAQ,CAAA,CAAA;AAGxC,IAAA,OAAO,KAAM,CAAA,IAAA,EAAO,CAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAAA,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-JNGUNN72.cjs","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 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'\n value?: string | number\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number'\n value?: string | number\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\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\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 (isReference(schema)) {\n return [\n ...this.#getRefAlias(schema),\n nullable && { keyword: schemaKeywords.nullable },\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 return [...this.parse({ schema: schemaWithoutOneOf, name, parentName }), union, ...baseItems]\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 (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 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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-PADR76WZ.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-R47XMJ32.js"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { URLPath } from '@kubb/core/utils';
|
|
3
|
+
import { parse } from '@kubb/oas/parser';
|
|
4
|
+
import { Oas } from '@kubb/oas';
|
|
5
|
+
import yaml from '@stoplight/yaml';
|
|
4
6
|
|
|
5
7
|
// src/utils/parseFromConfig.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
import { resolve } from "path";
|
|
8
|
-
import { URLPath } from "@kubb/core/utils";
|
|
9
|
-
import { parse } from "@kubb/oas/parser";
|
|
10
|
-
import { Oas } from "@kubb/oas";
|
|
11
|
-
import yaml from "@stoplight/yaml";
|
|
12
8
|
function parseFromConfig(config, options = {}, oasClass = Oas) {
|
|
13
9
|
if ("data" in config.input) {
|
|
14
10
|
if (typeof config.input.data === "object") {
|
|
@@ -29,7 +25,6 @@ function parseFromConfig(config, options = {}, oasClass = Oas) {
|
|
|
29
25
|
return parse(resolve(config.root, config.input.path), options, oasClass);
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=chunk-Y4V7HHX7.js.map
|
|
28
|
+
export { parseFromConfig };
|
|
29
|
+
//# sourceMappingURL=chunk-THGCWF2O.js.map
|
|
30
|
+
//# sourceMappingURL=chunk-THGCWF2O.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { URLPath } from '@kubb/core/utils'\n\nimport { type FormatOptions, parse } from '@kubb/oas/parser'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, options: FormatOptions = {}, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, options, oasClass)\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, options, oasClass)\n } catch (e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, options, oasClass)\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, options, oasClass)\n }\n\n return parse(resolve(config.root, config.input.path), options, oasClass)\n}\n"]
|
|
1
|
+
{"version":3,"sources":["../src/utils/parseFromConfig.ts"],"names":["api"],"mappings":";;;;;;;AAUO,SA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FormatOptions, parse } from '@kubb/oas/parser'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, options: FormatOptions = {}, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, options, oasClass)\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, options, oasClass)\n } catch (e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, options, oasClass)\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, options, oasClass)\n }\n\n return parse(resolve(config.root, config.input.path), options, oasClass)\n}\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Oas } from './chunk-GF26SDHQ.js';
|
|
2
|
+
import { camelCase } from '@kubb/core/transformers';
|
|
3
|
+
import { createRoot, App } from '@kubb/react';
|
|
4
|
+
import { jsx } from '@kubb/react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function createGenerator(parseOptions) {
|
|
7
|
+
return parseOptions;
|
|
8
|
+
}
|
|
9
|
+
function createReactGenerator(parseOptions) {
|
|
10
|
+
return {
|
|
11
|
+
...parseOptions,
|
|
12
|
+
async operations({ instance, options, operations, operationsByMethod }) {
|
|
13
|
+
if (!parseOptions.Operations) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const { pluginManager, oas, plugin, mode } = instance.context;
|
|
17
|
+
const root = createRoot({
|
|
18
|
+
logger: pluginManager.logger
|
|
19
|
+
});
|
|
20
|
+
const Component = parseOptions.Operations.bind(this);
|
|
21
|
+
root.render(
|
|
22
|
+
/* @__PURE__ */ jsx(App, { pluginManager, plugin, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations, generator: instance, children: /* @__PURE__ */ jsx(Component, { operations, instance, operationsByMethod, options }) }) })
|
|
23
|
+
);
|
|
24
|
+
return root.files;
|
|
25
|
+
},
|
|
26
|
+
async operation({ instance, operation, options }) {
|
|
27
|
+
if (!parseOptions.Operation) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const { pluginManager, oas, plugin, mode } = instance.context;
|
|
31
|
+
const root = createRoot({
|
|
32
|
+
logger: pluginManager.logger
|
|
33
|
+
});
|
|
34
|
+
const Component = parseOptions.Operation.bind(this);
|
|
35
|
+
root.render(
|
|
36
|
+
/* @__PURE__ */ jsx(App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations: [operation], generator: instance, children: /* @__PURE__ */ jsx(Oas.Operation, { operation, children: /* @__PURE__ */ jsx(Component, { operation, options, instance }) }) }) })
|
|
37
|
+
);
|
|
38
|
+
return root.files;
|
|
39
|
+
},
|
|
40
|
+
async schema({ instance, schema, options }) {
|
|
41
|
+
if (!parseOptions.Schema) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const { pluginManager, oas, plugin, mode } = instance.context;
|
|
45
|
+
const root = createRoot({
|
|
46
|
+
logger: pluginManager.logger
|
|
47
|
+
});
|
|
48
|
+
const Component = parseOptions.Schema.bind(this);
|
|
49
|
+
root.render(
|
|
50
|
+
/* @__PURE__ */ jsx(App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ jsx(Oas, { oas, children: /* @__PURE__ */ jsx(Oas.Schema, { name: schema.name, value: schema.value, tree: schema.tree, children: /* @__PURE__ */ jsx(Component, { schema, options, instance }) }) }) })
|
|
51
|
+
);
|
|
52
|
+
return root.files;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/generators/jsonGenerator.ts
|
|
58
|
+
var jsonGenerator = createGenerator({
|
|
59
|
+
name: "plugin-oas",
|
|
60
|
+
async schema({ schema, instance }) {
|
|
61
|
+
const { pluginManager, plugin } = instance.context;
|
|
62
|
+
const file = pluginManager.getFile({
|
|
63
|
+
name: camelCase(schema.name),
|
|
64
|
+
extName: ".json",
|
|
65
|
+
mode: "split",
|
|
66
|
+
pluginKey: plugin.key
|
|
67
|
+
});
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
...file,
|
|
71
|
+
sources: [
|
|
72
|
+
{
|
|
73
|
+
name: camelCase(schema.name),
|
|
74
|
+
isExportable: false,
|
|
75
|
+
isIndexable: false,
|
|
76
|
+
value: JSON.stringify(schema.value)
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
banner: plugin.options.output?.banner,
|
|
80
|
+
format: plugin.options.output?.footer
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export { createGenerator, createReactGenerator, jsonGenerator };
|
|
87
|
+
//# sourceMappingURL=chunk-TRA5BTWI.js.map
|
|
88
|
+
//# sourceMappingURL=chunk-TRA5BTWI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generator.tsx","../src/generators/jsonGenerator.ts"],"names":[],"mappings":";;;;;AA2CO,SAAS,gBAAuD,YAA+D,EAAA;AACpI,EAAO,OAAA,YAAA,CAAA;AACT,CAAA;AAaO,SAAS,qBAA4D,YAAoE,EAAA;AAC9I,EAAO,OAAA;AAAA,IACL,GAAG,YAAA;AAAA,IACH,MAAM,UAAW,CAAA,EAAE,UAAU,OAAS,EAAA,UAAA,EAAY,oBAAsB,EAAA;AACtE,MAAI,IAAA,CAAC,aAAa,UAAY,EAAA;AAC5B,QAAA,OAAO,EAAC,CAAA;AAAA,OACV;AAEA,MAAA,MAAM,EAAE,aAAe,EAAA,GAAA,EAAK,MAAQ,EAAA,IAAA,KAAS,QAAS,CAAA,OAAA,CAAA;AACtD,MAAA,MAAM,OAAO,UAAW,CAAA;AAAA,QACtB,QAA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YAAA;AAAA,EACN,MAAM,MAAA,CAAO,EAAE,MAAA,EAAQ,UAAY,EAAA;AACjC,IAAA,MAAM,EAAE,aAAA,EAAe,MAAO,EAAA,GAAI,QAAS,CAAA,OAAA,CAAA;AAC3C,IAAM,MAAA,IAAA,GAAO,cAAc,OAAQ,CAAA;AAAA,MACjC,IAAA,EAAM,SAAU,CAAA,MAAA,CAAO,IAAI,CAAA;AAAA,MAC3B,OAAS,EAAA,OAAA;AAAA,MACT,IAAM,EAAA,OAAA;AAAA,MACN,WAAW,MAAO,CAAA,GAAA;AAAA,KACnB,CAAA,CAAA;AAED,IAAO,OAAA;AAAA,MACL;AAAA,QACE,GAAG,IAAA;AAAA,QACH,OAAS,EAAA;AAAA,UACP;AAAA,YACE,IAAA,EAAM,SAAU,CAAA,MAAA,CAAO,IAAI,CAAA;AAAA,YAC3B,YAAc,EAAA,KAAA;AAAA,YACd,WAAa,EAAA,KAAA;AAAA,YACb,KAAO,EAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,KAAK,CAAA;AAAA,WACpC;AAAA,SACF;AAAA,QACA,MAAA,EAAQ,MAAO,CAAA,OAAA,CAAQ,MAAQ,EAAA,MAAA;AAAA,QAC/B,MAAA,EAAQ,MAAO,CAAA,OAAA,CAAQ,MAAQ,EAAA,MAAA;AAAA,OACjC;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC","file":"chunk-TRA5BTWI.js","sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type * as KubbFile from '@kubb/fs/types'\nimport type { Operation, SchemaObject } from '@kubb/oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\nimport type { KubbNode } from '@kubb/react/types'\nimport type { OperationGenerator } from './OperationGenerator.ts'\nimport type { SchemaGenerator, SchemaGeneratorOptions } from './SchemaGenerator.ts'\nimport type { Schema } from './SchemaMapper.ts'\nimport type { OperationsByMethod } from './types.ts'\n\ntype OperationsProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operations: Array<Operation>\n operationsByMethod: OperationsByMethod\n}\n\ntype OperationProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operation: Operation\n}\n\ntype SchemaProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>\n schema: {\n name: string\n tree: Array<Schema>\n value: SchemaObject\n }\n options: TOptions['resolvedOptions']\n}\n\nexport type GeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(parseOptions: GeneratorOptions<TOptions>): Generator<TOptions> {\n return parseOptions\n}\n\nexport type ReactGeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n Operations?: (this: ReactGeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => KubbNode\n Operation?: (this: ReactGeneratorOptions<TOptions>, props: OperationProps<TOptions>) => KubbNode\n Schema?: (this: ReactGeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => KubbNode\n /**\n * Combine all react nodes and only render ones(to string or render)\n */\n render?: () => any\n}\n\nexport function createReactGenerator<TOptions extends PluginFactoryOptions>(parseOptions: ReactGeneratorOptions<TOptions>): Generator<TOptions> {\n return {\n ...parseOptions,\n async operations({ instance, options, operations, operationsByMethod }) {\n if (!parseOptions.Operations) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const Component = parseOptions.Operations.bind(this)\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={instance}>\n <Component operations={operations} instance={instance} operationsByMethod={operationsByMethod} options={options} />\n </Oas>\n </App>,\n )\n\n return root.files\n },\n async operation({ instance, operation, options }) {\n if (!parseOptions.Operation) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const Component = parseOptions.Operation.bind(this)\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={instance}>\n <Oas.Operation operation={operation}>\n <Component operation={operation} options={options} instance={instance} />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n },\n async schema({ instance, schema, options }) {\n if (!parseOptions.Schema) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const Component = parseOptions.Schema.bind(this)\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas}>\n <Oas.Schema name={schema.name} value={schema.value} tree={schema.tree}>\n <Component schema={schema} options={options} instance={instance} />\n </Oas.Schema>\n </Oas>\n </App>,\n )\n\n return root.files\n },\n }\n}\n","import { camelCase } from '@kubb/core/transformers'\nimport { createGenerator } from '../generator.tsx'\nimport type { PluginOas } from '../types.ts'\n\nexport const jsonGenerator = createGenerator<PluginOas>({\n name: 'plugin-oas',\n async schema({ schema, instance }) {\n const { pluginManager, plugin } = instance.context\n const file = pluginManager.getFile({\n name: camelCase(schema.name),\n extName: '.json',\n mode: 'split',\n pluginKey: plugin.key,\n })\n\n return [\n {\n ...file,\n sources: [\n {\n name: camelCase(schema.name),\n isExportable: false,\n isIndexable: false,\n value: JSON.stringify(schema.value),\n },\n ],\n banner: plugin.options.output?.banner,\n format: plugin.options.output?.footer,\n },\n ]\n },\n})\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var utils = require('@kubb/core/utils');
|
|
5
|
+
var parser = require('@kubb/oas/parser');
|
|
6
|
+
var oas = require('@kubb/oas');
|
|
7
|
+
var yaml = require('@stoplight/yaml');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var yaml__default = /*#__PURE__*/_interopDefault(yaml);
|
|
12
|
+
|
|
13
|
+
// src/utils/parseFromConfig.ts
|
|
14
|
+
function parseFromConfig(config, options = {}, oasClass = oas.Oas) {
|
|
15
|
+
if ("data" in config.input) {
|
|
16
|
+
if (typeof config.input.data === "object") {
|
|
17
|
+
const api2 = JSON.parse(JSON.stringify(config.input.data));
|
|
18
|
+
return parser.parse(api2, options, oasClass);
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const api2 = yaml__default.default.parse(config.input.data);
|
|
22
|
+
return parser.parse(api2, options, oasClass);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
}
|
|
25
|
+
const api = JSON.parse(JSON.stringify(config.input.data));
|
|
26
|
+
return parser.parse(api, options, oasClass);
|
|
27
|
+
}
|
|
28
|
+
if (new utils.URLPath(config.input.path).isURL) {
|
|
29
|
+
return parser.parse(config.input.path, options, oasClass);
|
|
30
|
+
}
|
|
31
|
+
return parser.parse(path.resolve(config.root, config.input.path), options, oasClass);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.parseFromConfig = parseFromConfig;
|
|
35
|
+
//# sourceMappingURL=chunk-UO57DZPV.cjs.map
|
|
36
|
+
//# sourceMappingURL=chunk-UO57DZPV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/parseFromConfig.ts"],"names":["Oas","api","parse","yaml","URLPath","resolve"],"mappings":";;;;;;;;;;;;;A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@kubb/core/utils'\n\nimport { type FormatOptions, parse } from '@kubb/oas/parser'\n\nimport type { Config } from '@kubb/core'\nimport { Oas, type OasTypes } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, options: FormatOptions = {}, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, options, oasClass)\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, options, oasClass)\n } catch (e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, options, oasClass)\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, options, oasClass)\n }\n\n return parse(resolve(config.root, config.input.path), options, oasClass)\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,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
18
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,12 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-ClNodlyP.cjs';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
|
-
import { KubbNode } from '@kubb/react';
|
|
5
|
-
import {
|
|
6
|
-
import '@kubb/fs/types';
|
|
7
|
-
import './SchemaMapper-CsBQ6eEx.cjs';
|
|
4
|
+
import { KubbNode } from '@kubb/react/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-CHXolL0o.cjs';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
7
|
+
import '@kubb/fs/types';
|
|
10
8
|
import '@kubb/oas/parser';
|
|
11
9
|
|
|
12
10
|
type Props$1 = {
|
|
@@ -24,13 +22,19 @@ declare namespace Operation {
|
|
|
24
22
|
type Props = {
|
|
25
23
|
oas: Oas$1;
|
|
26
24
|
operations?: Operation$1[];
|
|
27
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
generator?: Omit<OperationGenerator, 'build'>;
|
|
28
29
|
children?: KubbNode;
|
|
29
30
|
};
|
|
30
31
|
type OasContextProps = {
|
|
31
32
|
oas?: Oas$1;
|
|
32
33
|
operations?: Operation$1[];
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
generator?: Omit<OperationGenerator, 'build'>;
|
|
34
38
|
};
|
|
35
39
|
declare function Oas({ oas, children, operations, generator }: Props): KubbNode;
|
|
36
40
|
declare namespace Oas {
|
package/dist/components.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-Ch0dHkM5.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
|
-
import { KubbNode } from '@kubb/react';
|
|
5
|
-
import {
|
|
6
|
-
import '@kubb/fs/types';
|
|
7
|
-
import './SchemaMapper-CsBQ6eEx.js';
|
|
4
|
+
import { KubbNode } from '@kubb/react/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-CHXolL0o.js';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
7
|
+
import '@kubb/fs/types';
|
|
10
8
|
import '@kubb/oas/parser';
|
|
11
9
|
|
|
12
10
|
type Props$1 = {
|
|
@@ -24,13 +22,19 @@ declare namespace Operation {
|
|
|
24
22
|
type Props = {
|
|
25
23
|
oas: Oas$1;
|
|
26
24
|
operations?: Operation$1[];
|
|
27
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
generator?: Omit<OperationGenerator, 'build'>;
|
|
28
29
|
children?: KubbNode;
|
|
29
30
|
};
|
|
30
31
|
type OasContextProps = {
|
|
31
32
|
oas?: Oas$1;
|
|
32
33
|
operations?: Operation$1[];
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
generator?: Omit<OperationGenerator, 'build'>;
|
|
34
38
|
};
|
|
35
39
|
declare function Oas({ oas, children, operations, generator }: Props): KubbNode;
|
|
36
40
|
declare namespace Oas {
|
package/dist/components.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Schema
|
|
5
|
-
} from "./chunk-LEACSHKT.js";
|
|
6
|
-
import "./chunk-K6KUETAI.js";
|
|
7
|
-
import {
|
|
8
|
-
init_esm_shims
|
|
9
|
-
} from "./chunk-UB552H4J.js";
|
|
10
|
-
|
|
11
|
-
// src/components/index.ts
|
|
12
|
-
init_esm_shims();
|
|
13
|
-
export {
|
|
14
|
-
Oas,
|
|
15
|
-
Operation,
|
|
16
|
-
Schema
|
|
17
|
-
};
|
|
1
|
+
import './chunk-R47XMJ32.js';
|
|
2
|
+
export { Oas, Operation, Schema } from './chunk-GF26SDHQ.js';
|
|
3
|
+
//# sourceMappingURL=components.js.map
|
|
18
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 chunk6UWOTOZJ_cjs = require('./chunk-6UWOTOZJ.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 chunk6UWOTOZJ_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,10 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-CHXolL0o.cjs';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
import '@kubb/oas/parser';
|
|
7
|
+
|
|
8
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
9
|
+
|
|
10
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-CHXolL0o.js';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
import '@kubb/oas/parser';
|
|
7
|
+
|
|
8
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
9
|
+
|
|
10
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|