@kubb/plugin-oas 3.0.0-alpha.0 → 3.0.0-alpha.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/dist/{OperationGenerator-CrCcKl3S.d.cts → OperationGenerator-CeM_9pxW.d.cts} +1 -1
- package/dist/{OperationGenerator-B0RLFu4P.d.ts → OperationGenerator-DhUhvRJE.d.ts} +1 -1
- package/dist/{chunk-K4GEQ3C2.cjs → chunk-CJXRFYEF.cjs} +21 -21
- package/dist/{chunk-K4GEQ3C2.cjs.map → chunk-CJXRFYEF.cjs.map} +1 -1
- package/dist/{chunk-UKUEVTRB.cjs → chunk-DRLYORTT.cjs} +23 -23
- package/dist/{chunk-UKUEVTRB.cjs.map → chunk-DRLYORTT.cjs.map} +1 -1
- package/dist/{chunk-ZZ7ZC4TT.js → chunk-K6KUETAI.js} +2 -2
- package/dist/{chunk-QSM6A5QX.js → chunk-LEACSHKT.js} +3 -3
- package/dist/{chunk-J7IF3KA3.cjs → chunk-P42X362U.cjs} +3 -3
- package/dist/chunk-P42X362U.cjs.map +1 -0
- package/dist/{chunk-3UN2S6P2.cjs → chunk-QLJIL3U5.cjs} +3 -3
- package/dist/{chunk-3UN2S6P2.cjs.map → chunk-QLJIL3U5.cjs.map} +1 -1
- package/dist/{chunk-Y272OQMW.js → chunk-UB552H4J.js} +3 -3
- package/dist/chunk-UB552H4J.js.map +1 -0
- package/dist/{chunk-GUPCIAYT.js → chunk-Y4V7HHX7.js} +2 -2
- package/dist/components.cjs +5 -5
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +3 -3
- package/dist/hooks.cjs +13 -13
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +3 -3
- package/dist/index.cjs +20 -20
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{types-BP45TdiW.d.ts → types-Dte3MA6H.d.cts} +0 -5
- package/dist/{types-BP45TdiW.d.cts → types-Dte3MA6H.d.ts} +0 -5
- package/dist/utils.cjs +8 -8
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +2 -2
- package/package.json +11 -11
- package/src/types.ts +0 -6
- package/dist/chunk-J7IF3KA3.cjs.map +0 -1
- package/dist/chunk-Y272OQMW.js.map +0 -1
- /package/dist/{chunk-ZZ7ZC4TT.js.map → chunk-K6KUETAI.js.map} +0 -0
- /package/dist/{chunk-QSM6A5QX.js.map → chunk-LEACSHKT.js.map} +0 -0
- /package/dist/{chunk-GUPCIAYT.js.map → chunk-Y4V7HHX7.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getSchemaFactory,
|
|
6
6
|
getSchemas,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UB552H4J.js";
|
|
9
9
|
|
|
10
10
|
// src/SchemaMapper.ts
|
|
11
11
|
init_esm_shims();
|
|
@@ -695,4 +695,4 @@ export {
|
|
|
695
695
|
isKeyword,
|
|
696
696
|
SchemaGenerator
|
|
697
697
|
};
|
|
698
|
-
//# sourceMappingURL=chunk-
|
|
698
|
+
//# sourceMappingURL=chunk-K6KUETAI.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SchemaGenerator,
|
|
3
3
|
schemaKeywords
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K6KUETAI.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__toESM,
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UB552H4J.js";
|
|
10
10
|
|
|
11
11
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
|
|
12
12
|
var require_react_production_min = __commonJS({
|
|
@@ -3262,4 +3262,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
3262
3262
|
* LICENSE file in the root directory of this source tree.
|
|
3263
3263
|
*)
|
|
3264
3264
|
*/
|
|
3265
|
-
//# sourceMappingURL=chunk-
|
|
3265
|
+
//# sourceMappingURL=chunk-LEACSHKT.js.map
|
|
@@ -35,9 +35,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
35
35
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
36
36
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.
|
|
38
|
+
// ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js
|
|
39
39
|
var init_cjs_shims = __esm({
|
|
40
|
-
"../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.
|
|
40
|
+
"../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js"() {
|
|
41
41
|
"use strict";
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -98,4 +98,4 @@ function getSchemaFactory(oas) {
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod; exports.init_cjs_shims = init_cjs_shims; exports.getSchemas = getSchemas; exports.getSchemaFactory = getSchemaFactory;
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-P42X362U.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-P42X362U.cjs","../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"names":[],"mappings":"AAAA,ilBAAI,SAAS,EAAE,MAAM,CAAC,MAAM;AAC5B,IAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,iBAAiB,EAAE,MAAM,CAAC,wBAAwB;AACtD,IAAI,kBAAkB,EAAE,MAAM,CAAC,mBAAmB;AAClD,IAAI,aAAa,EAAE,MAAM,CAAC,cAAc;AACxC,IAAI,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc;AAClD,IAAI,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG;AAC3B,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC;AACtB,CAAC;AACD,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,MAAM,CAAC,EAAE;AAC3C,EAAE,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;AACrE,CAAC;AACD,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,SAAS,CAAC,EAAE;AACnD,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,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,QAAA,GAAW,CAAC,OAAA,CAAQ,IAAI,CAAA,EAAG;AACrC,QAAA,MAAM,iBAAA,EAAmB,MAAA,CAAO,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAA,CAAE,CAAC,EAAA,GAAK,kBAAA;AAC5D,QAAA,OAAA,CAAQ,IAAI,EAAA,kBAAI,OAAA,qBAAQ,OAAA,4BAAA,CAAU,YAAA,GAAe,gBAAgB,CAAA,6BAAG,QAAA;AAAA,MACtE;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO,OAAA;AACT;AF+BA;AACA;AG5EA,cAAA,CAAA,CAAA;AAAA,gCAAsC;AAuB/B,SAAS,gBAAA,CAAmD,GAAA,EAA6D;AAC9H,EAAA,OAAO,CAAC,MAAA,EAAA,GAA0B;AAChC,IAAA,MAAM,QAAA,EAAU,wCAAA,GAAsB,CAAI,GAAG,EAAA,EAAI,MAAA,EAAQ,KAAA;AAEzD,IAAA,OAAO;AAAA,MACL,MAAA;AAAA,MACA;AAAA,IACF,CAAA;AAAA,EACF,CAAA;AACF;AHwDA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,4UAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-P42X362U.cjs","sourcesContent":[null,"// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","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,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
|
|
4
4
|
|
|
5
5
|
// src/utils/parseFromConfig.ts
|
|
6
|
-
|
|
6
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
var _path = require('path');
|
|
8
8
|
var _utils = require('@kubb/core/utils');
|
|
9
9
|
var _parser = require('@kubb/oas/parser');
|
|
@@ -32,4 +32,4 @@ function parseFromConfig(config, options = {}, oasClass = _oas.Oas) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
exports.parseFromConfig = parseFromConfig;
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-QLJIL3U5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-QLJIL3U5.cjs","../src/utils/parseFromConfig.ts"],"names":["api"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,8CAAA,CAAA;AAAA,4BAAwB;AAExB,yCAAwB;AAExB,0CAA0C;AAG1C,gCAAmC;AACnC,mFAAiB;AAEV,SAAS,eAAA,CAAgB,MAAA,EAAgB,QAAA,EAAyB,CAAC,CAAA,EAAG,SAAA,EAAuB,QAAA,EAAmB;AACrH,EAAA,GAAA,CAAI,OAAA,GAAU,MAAA,CAAO,KAAA,EAAO;AAC1B,IAAA,GAAA,CAAI,OAAO,MAAA,CAAO,KAAA,CAAM,KAAA,IAAS,QAAA,EAAU;AACzC,MAAA,MAAMA,KAAAA,EAA4B,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,KAAA,CAAM,IAAI,CAAC,CAAA;AAC9E,MAAA,OAAO,2BAAA,IAAMA,EAAK,OAAA,EAAS,QAAQ,CAAA;AAAA,IACrC;AAEA,IAAA,IAAI;AACF,MAAA,MAAMA,KAAAA,EAAc,cAAA,CAAK,KAAA,CAAM,MAAA,CAAO,KAAA,CAAM,IAAc,CAAA;AAE1D,MAAA,OAAO,2BAAA,IAAMA,EAAK,OAAA,EAAS,QAAQ,CAAA;AAAA,IACrC,EAAA,MAAA,CAAS,CAAA,EAAG;AAAA,IAEZ;AAEA,IAAA,MAAM,IAAA,EAA4B,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,KAAA,CAAM,IAAI,CAAC,CAAA;AAE9E,IAAA,OAAO,2BAAA,GAAM,EAAK,OAAA,EAAS,QAAQ,CAAA;AAAA,EACrC;AAEA,EAAA,GAAA,CAAI,IAAI,mBAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,IAAI,CAAA,CAAE,KAAA,EAAO;AACxC,IAAA,OAAO,2BAAA,MAAM,CAAO,KAAA,CAAM,IAAA,EAAM,OAAA,EAAS,QAAQ,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,2BAAA,2BAAM,MAAQ,CAAO,IAAA,EAAM,MAAA,CAAO,KAAA,CAAM,IAAI,CAAA,EAAG,OAAA,EAAS,QAAQ,CAAA;AACzE;ADLA;AACA;AACE;AACF,0CAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-QLJIL3U5.cjs","sourcesContent":[null,"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"]}
|
|
@@ -35,9 +35,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
35
35
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
36
36
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.
|
|
38
|
+
// ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js
|
|
39
39
|
var init_esm_shims = __esm({
|
|
40
|
-
"../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.
|
|
40
|
+
"../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js"() {
|
|
41
41
|
"use strict";
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -98,4 +98,4 @@ export {
|
|
|
98
98
|
getSchemas,
|
|
99
99
|
getSchemaFactory
|
|
100
100
|
};
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-UB552H4J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","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,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAUO,SAAS,WAAW,EAAE,KAAK,aAAa,WAAW,CAAC,WAAW,iBAAiB,WAAW,EAAE,GAA2D;AAC7J,QAAM,aAAa,IAAI,cAAc,EAAE;AAEvC,MAAI,UAAiD,CAAC;AAEtD,MAAI,SAAS,SAAS,SAAS,GAAG;AAChC,cAAU;AAAA,MACR,GAAG;AAAA,MACH,GAAK,YAAY,WAAqD,CAAC;AAAA,IACzE;AAAA,EACF;AAEA,QAAM,gBAAgB,YAAY,iBAAiB,CAAC;AACpD,MAAI,SAAS,SAAS,WAAW,GAAG;AAClC,UAAM,YAAY,YAAY,aAAa,CAAC;AAE5C,WAAO,QAAQ,SAAS,EAAE,QAAQ,CAAC,CAAC,MAAM,QAAQ,MAAyC;AACzF,UAAI,SAAS,WAAW,CAAC,QAAQ,IAAI,GAAG;AACtC,cAAM,mBAAmB,OAAO,KAAK,SAAS,OAAO,EAAE,CAAC,KAAK;AAC7D,gBAAQ,IAAI,IAAI,SAAS,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACvE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MAAI,SAAS,SAAS,eAAe,GAAG;AACtC,WAAO,QAAQ,aAAa,EAAE,QAAQ,CAAC,CAAC,MAAM,OAAO,MAA4C;AAC/F,UAAI,QAAQ,WAAW,CAAC,QAAQ,IAAI,GAAG;AACrC,cAAM,mBAAmB,OAAO,KAAK,QAAQ,OAAO,EAAE,CAAC,KAAK;AAC5D,gBAAQ,IAAI,IAAI,QAAQ,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACtE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;;;AC5CA;AAAA,SAAS,6BAA6B;AAuB/B,SAAS,iBAAmD,KAA6D;AAC9H,SAAO,CAAC,WAA0B;AAChC,UAAM,UAAU,sBAAsB,IAAI,GAAG,IAAI,QAAQ;AAEzD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UB552H4J.js";
|
|
4
4
|
|
|
5
5
|
// src/utils/parseFromConfig.ts
|
|
6
6
|
init_esm_shims();
|
|
@@ -32,4 +32,4 @@ function parseFromConfig(config, options = {}, oasClass = Oas) {
|
|
|
32
32
|
export {
|
|
33
33
|
parseFromConfig
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-Y4V7HHX7.js.map
|
package/dist/components.cjs
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkDRLYORTTcjs = require('./chunk-DRLYORTT.cjs');
|
|
6
|
+
require('./chunk-CJXRFYEF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
|
|
10
10
|
|
|
11
11
|
// src/components/index.ts
|
|
12
|
-
|
|
12
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.Oas =
|
|
17
|
+
exports.Oas = _chunkDRLYORTTcjs.Oas; exports.Operation = _chunkDRLYORTTcjs.Operation; exports.Schema = _chunkDRLYORTTcjs.Schema;
|
|
18
18
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.d.cts
CHANGED
|
@@ -2,11 +2,11 @@ import { S as Schema } from './Schema-an5hOrjZ.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';
|
|
5
|
-
import { a as OperationGenerator } from './OperationGenerator-
|
|
5
|
+
import { a as OperationGenerator } from './OperationGenerator-CeM_9pxW.cjs';
|
|
6
6
|
import '@kubb/fs/types';
|
|
7
7
|
import './SchemaMapper-CsBQ6eEx.cjs';
|
|
8
8
|
import '@kubb/core';
|
|
9
|
-
import './types-
|
|
9
|
+
import './types-Dte3MA6H.cjs';
|
|
10
10
|
import '@kubb/oas/parser';
|
|
11
11
|
|
|
12
12
|
type Props$1 = {
|
package/dist/components.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { S as Schema } from './Schema-DefwBJMc.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';
|
|
5
|
-
import { a as OperationGenerator } from './OperationGenerator-
|
|
5
|
+
import { a as OperationGenerator } from './OperationGenerator-DhUhvRJE.js';
|
|
6
6
|
import '@kubb/fs/types';
|
|
7
7
|
import './SchemaMapper-CsBQ6eEx.js';
|
|
8
8
|
import '@kubb/core';
|
|
9
|
-
import './types-
|
|
9
|
+
import './types-Dte3MA6H.js';
|
|
10
10
|
import '@kubb/oas/parser';
|
|
11
11
|
|
|
12
12
|
type Props$1 = {
|
package/dist/components.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Oas,
|
|
3
3
|
Operation,
|
|
4
4
|
Schema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-LEACSHKT.js";
|
|
6
|
+
import "./chunk-K6KUETAI.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UB552H4J.js";
|
|
10
10
|
|
|
11
11
|
// src/components/index.ts
|
|
12
12
|
init_esm_shims();
|
package/dist/hooks.cjs
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkDRLYORTTcjs = require('./chunk-DRLYORTT.cjs');
|
|
6
|
+
require('./chunk-CJXRFYEF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
|
|
10
10
|
|
|
11
11
|
// src/hooks/index.ts
|
|
12
|
-
|
|
12
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
13
13
|
|
|
14
14
|
// src/hooks/useOas.ts
|
|
15
|
-
|
|
15
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
16
16
|
var _react = require('@kubb/react');
|
|
17
17
|
function useOas() {
|
|
18
|
-
const { oas } = _react.useContext.call(void 0,
|
|
18
|
+
const { oas } = _react.useContext.call(void 0, _chunkDRLYORTTcjs.Oas.Context);
|
|
19
19
|
if (!oas) {
|
|
20
20
|
throw new Error("Oas is not defined");
|
|
21
21
|
}
|
|
@@ -23,10 +23,10 @@ function useOas() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// src/hooks/useOperation.ts
|
|
26
|
-
|
|
26
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
27
27
|
|
|
28
28
|
function useOperation() {
|
|
29
|
-
const { operation } = _react.useContext.call(void 0,
|
|
29
|
+
const { operation } = _react.useContext.call(void 0, _chunkDRLYORTTcjs.Operation.Context);
|
|
30
30
|
if (!operation) {
|
|
31
31
|
throw new Error("Operation is not defined");
|
|
32
32
|
}
|
|
@@ -34,11 +34,11 @@ function useOperation() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/hooks/useOperationManager.ts
|
|
37
|
-
|
|
37
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
38
38
|
|
|
39
39
|
function useOperationManager() {
|
|
40
40
|
const { plugin, pluginManager } = _react.useApp.call(void 0, );
|
|
41
|
-
const { generator } = _react.useContext.call(void 0,
|
|
41
|
+
const { generator } = _react.useContext.call(void 0, _chunkDRLYORTTcjs.Oas.Context);
|
|
42
42
|
if (!generator) {
|
|
43
43
|
throw new Error(`'generator' is not defined`);
|
|
44
44
|
}
|
|
@@ -139,10 +139,10 @@ function useOperationManager() {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// src/hooks/useOperations.ts
|
|
142
|
-
|
|
142
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
143
143
|
|
|
144
144
|
function useOperations({ method, path } = {}) {
|
|
145
|
-
const { operations } = _react.useContext.call(void 0,
|
|
145
|
+
const { operations } = _react.useContext.call(void 0, _chunkDRLYORTTcjs.Oas.Context);
|
|
146
146
|
if (!operations) {
|
|
147
147
|
throw new Error("Operations is not defined");
|
|
148
148
|
}
|
|
@@ -161,5 +161,5 @@ function useOperations({ method, path } = {}) {
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema =
|
|
164
|
+
exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkDRLYORTTcjs.useSchema;
|
|
165
165
|
//# sourceMappingURL=hooks.cjs.map
|
package/dist/hooks.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
|
-
import { f as OperationSchemas } from './types-
|
|
4
|
+
import { f as OperationSchemas } from './types-Dte3MA6H.cjs';
|
|
5
5
|
import { a as SchemaContextProps } from './Schema-an5hOrjZ.cjs';
|
|
6
6
|
import '@kubb/oas/parser';
|
|
7
7
|
import 'react';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
|
-
import { f as OperationSchemas } from './types-
|
|
4
|
+
import { f as OperationSchemas } from './types-Dte3MA6H.js';
|
|
5
5
|
import { a as SchemaContextProps } from './Schema-DefwBJMc.js';
|
|
6
6
|
import '@kubb/oas/parser';
|
|
7
7
|
import 'react';
|
package/dist/hooks.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Oas,
|
|
3
3
|
Operation,
|
|
4
4
|
useSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-LEACSHKT.js";
|
|
6
|
+
import "./chunk-K6KUETAI.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UB552H4J.js";
|
|
10
10
|
|
|
11
11
|
// src/hooks/index.ts
|
|
12
12
|
init_esm_shims();
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQLJIL3U5cjs = require('./chunk-QLJIL3U5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkCJXRFYEFcjs = require('./chunk-CJXRFYEF.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -13,13 +13,13 @@ var _chunkK4GEQ3C2cjs = require('./chunk-K4GEQ3C2.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
|
-
|
|
19
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
|
|
21
21
|
// src/plugin.ts
|
|
22
|
-
|
|
22
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
23
23
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
24
|
var _core = require('@kubb/core');
|
|
25
25
|
var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
|
|
@@ -36,7 +36,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
36
36
|
} = options;
|
|
37
37
|
const getOas = async ({ config, logger, formatOptions }) => {
|
|
38
38
|
try {
|
|
39
|
-
const oas = await
|
|
39
|
+
const oas = await _chunkQLJIL3U5cjs.parseFromConfig.call(void 0, config, formatOptions, oasClass);
|
|
40
40
|
if (validate) {
|
|
41
41
|
await oas.valdiate();
|
|
42
42
|
}
|
|
@@ -44,7 +44,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
44
44
|
} catch (e) {
|
|
45
45
|
const error = e;
|
|
46
46
|
logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
|
|
47
|
-
return
|
|
47
|
+
return _chunkQLJIL3U5cjs.parseFromConfig.call(void 0, config, {}, oasClass);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
return {
|
|
@@ -58,7 +58,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
58
58
|
},
|
|
59
59
|
async getSchemas({ includes } = {}) {
|
|
60
60
|
const oas = await this.getOas();
|
|
61
|
-
return
|
|
61
|
+
return _chunkP42X362Ucjs.getSchemas.call(void 0, { oas, contentType, includes });
|
|
62
62
|
},
|
|
63
63
|
async getBaseURL() {
|
|
64
64
|
const oasInstance = await this.getOas();
|
|
@@ -97,7 +97,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
await oas.dereference();
|
|
100
|
-
const schemas =
|
|
100
|
+
const schemas = _chunkP42X362Ucjs.getSchemas.call(void 0, { oas, contentType });
|
|
101
101
|
const mapSchema = async ([name, schema]) => {
|
|
102
102
|
const resolvedPath = this.resolvePath({
|
|
103
103
|
baseName: `${name}.json`,
|
|
@@ -127,21 +127,21 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
// src/OperationGenerator.ts
|
|
130
|
-
|
|
130
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
var _operationsByMethod, _OperationGenerator_instances, getOptions_fn, isExcluded_fn, isIncluded_fn, methods_get;
|
|
134
134
|
var OperationGenerator = class extends _core.Generator {
|
|
135
135
|
constructor() {
|
|
136
136
|
super(...arguments);
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
_chunkP42X362Ucjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
|
|
138
|
+
_chunkP42X362Ucjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
|
|
139
139
|
}
|
|
140
140
|
get operationsByMethod() {
|
|
141
|
-
return
|
|
141
|
+
return _chunkP42X362Ucjs.__privateGet.call(void 0, this, _operationsByMethod);
|
|
142
142
|
}
|
|
143
143
|
set operationsByMethod(paths) {
|
|
144
|
-
|
|
144
|
+
_chunkP42X362Ucjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
|
|
145
145
|
}
|
|
146
146
|
getSchemas(operation, { forStatusCode, resolveName = (name) => name } = {}) {
|
|
147
147
|
const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
|
|
@@ -224,9 +224,9 @@ var OperationGenerator = class extends _core.Generator {
|
|
|
224
224
|
const methods = Object.keys(method);
|
|
225
225
|
methods.forEach((method2) => {
|
|
226
226
|
const operation = oas.operation(path2, method2);
|
|
227
|
-
if (operation &&
|
|
228
|
-
const isExcluded =
|
|
229
|
-
const isIncluded = this.context.include ?
|
|
227
|
+
if (operation && _chunkP42X362Ucjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
|
|
228
|
+
const isExcluded = _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
|
|
229
|
+
const isIncluded = this.context.include ? _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
|
|
230
230
|
if (isIncluded && !isExcluded) {
|
|
231
231
|
if (!acc[path2]) {
|
|
232
232
|
acc[path2] = {};
|
|
@@ -247,8 +247,8 @@ var OperationGenerator = class extends _core.Generator {
|
|
|
247
247
|
const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
|
|
248
248
|
methods.forEach((method) => {
|
|
249
249
|
const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
|
|
250
|
-
const options =
|
|
251
|
-
const promiseMethod = _optionalChain([
|
|
250
|
+
const options = _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
|
|
251
|
+
const promiseMethod = _optionalChain([_chunkP42X362Ucjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
|
|
252
252
|
...this.options,
|
|
253
253
|
...options
|
|
254
254
|
})]);
|
|
@@ -403,5 +403,5 @@ var src_default = definePluginDefault;
|
|
|
403
403
|
|
|
404
404
|
|
|
405
405
|
|
|
406
|
-
exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator =
|
|
406
|
+
exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkCJXRFYEFcjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkCJXRFYEFcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkCJXRFYEFcjs.schemaKeywords;
|
|
407
407
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _kubb_core from '@kubb/core';
|
|
2
2
|
import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
|
|
3
|
-
import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-
|
|
4
|
-
export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-
|
|
5
|
-
export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-
|
|
3
|
+
import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-Dte3MA6H.cjs';
|
|
4
|
+
export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-Dte3MA6H.cjs';
|
|
5
|
+
export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-CeM_9pxW.cjs';
|
|
6
6
|
import * as KubbFile from '@kubb/fs/types';
|
|
7
7
|
import { SchemaObject, Oas, contentType } from '@kubb/oas';
|
|
8
8
|
import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _kubb_core from '@kubb/core';
|
|
2
2
|
import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
|
|
3
|
-
import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-
|
|
4
|
-
export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-
|
|
5
|
-
export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-
|
|
3
|
+
import { O as Options, P as PluginOas, a as OperationSchema, R as Refs, b as Override } from './types-Dte3MA6H.js';
|
|
4
|
+
export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as OperationsByMethod, d as Ref, c as ResolvePathOptions, e as Resolver } from './types-Dte3MA6H.js';
|
|
5
|
+
export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-DhUhvRJE.js';
|
|
6
6
|
import * as KubbFile from '@kubb/fs/types';
|
|
7
7
|
import { SchemaObject, Oas, contentType } from '@kubb/oas';
|
|
8
8
|
import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.js';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFromConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4V7HHX7.js";
|
|
4
4
|
import {
|
|
5
5
|
SchemaGenerator,
|
|
6
6
|
isKeyword,
|
|
7
7
|
schemaKeywords
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-K6KUETAI.js";
|
|
9
9
|
import {
|
|
10
10
|
__privateAdd,
|
|
11
11
|
__privateGet,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__privateSet,
|
|
14
14
|
getSchemas,
|
|
15
15
|
init_esm_shims
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UB552H4J.js";
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
19
|
init_esm_shims();
|
|
@@ -139,10 +139,5 @@ type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaN
|
|
|
139
139
|
options: Partial<TOptions>;
|
|
140
140
|
};
|
|
141
141
|
type PluginOas = PluginFactoryOptions<'plugin-oas', Options, Options, API, never>;
|
|
142
|
-
declare module '@kubb/core' {
|
|
143
|
-
interface _Register {
|
|
144
|
-
['@kubb/plugin-oas']: PluginOas;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
142
|
|
|
148
143
|
export { type API as A, type Exclude as E, type GetSchemasProps as G, type Include as I, type Options as O, type PluginOas as P, type Refs as R, type OperationSchema as a, type Override as b, type ResolvePathOptions as c, type Ref as d, type Resolver as e, type OperationSchemas as f, type OperationsByMethod as g, getSchemas as h };
|
|
@@ -139,10 +139,5 @@ type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaN
|
|
|
139
139
|
options: Partial<TOptions>;
|
|
140
140
|
};
|
|
141
141
|
type PluginOas = PluginFactoryOptions<'plugin-oas', Options, Options, API, never>;
|
|
142
|
-
declare module '@kubb/core' {
|
|
143
|
-
interface _Register {
|
|
144
|
-
['@kubb/plugin-oas']: PluginOas;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
142
|
|
|
148
143
|
export { type API as A, type Exclude as E, type GetSchemasProps as G, type Include as I, type Options as O, type PluginOas as P, type Refs as R, type OperationSchema as a, type Override as b, type ResolvePathOptions as c, type Ref as d, type Resolver as e, type OperationSchemas as f, type OperationsByMethod as g, getSchemas as h };
|
package/dist/utils.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQLJIL3U5cjs = require('./chunk-QLJIL3U5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
|
|
9
9
|
|
|
10
10
|
// src/utils/index.ts
|
|
11
|
-
|
|
11
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
|
|
13
13
|
// src/utils/getComments.ts
|
|
14
|
-
|
|
14
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
15
15
|
var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
|
|
16
16
|
var _utils = require('@kubb/core/utils');
|
|
17
17
|
function getComments(operation) {
|
|
@@ -24,7 +24,7 @@ function getComments(operation) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/utils/getGroupedByTagFiles.ts
|
|
27
|
-
|
|
27
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
28
28
|
var _path = require('path');
|
|
29
29
|
var _core = require('@kubb/core');
|
|
30
30
|
|
|
@@ -69,7 +69,7 @@ async function getGroupedByTagFiles({ logger, files, plugin, template, exportAs,
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// src/utils/getParams.ts
|
|
72
|
-
|
|
72
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
73
73
|
var _oas = require('@kubb/oas');
|
|
74
74
|
|
|
75
75
|
function getASTParams(operationSchema, {
|
|
@@ -104,7 +104,7 @@ function getPathParams(operationSchema, options = {}) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/utils/refSorter.ts
|
|
107
|
-
|
|
107
|
+
_chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
|
|
108
108
|
function refsSorter(a, b) {
|
|
109
109
|
if (_optionalChain([Object, 'access', _10 => _10.keys, 'call', _11 => _11(a.import.refs), 'optionalAccess', _12 => _12.length]) < _optionalChain([Object, 'access', _13 => _13.keys, 'call', _14 => _14(b.import.refs), 'optionalAccess', _15 => _15.length])) {
|
|
110
110
|
return -1;
|
|
@@ -123,5 +123,5 @@ function refsSorter(a, b) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory =
|
|
126
|
+
exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkP42X362Ucjs.getSchemaFactory; exports.getSchemas = _chunkP42X362Ucjs.getSchemas; exports.parseFromConfig = _chunkQLJIL3U5cjs.parseFromConfig; exports.refsSorter = refsSorter;
|
|
127
127
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ import { Logger } from '@kubb/core/logger';
|
|
|
4
4
|
import * as KubbFile from '@kubb/fs/types';
|
|
5
5
|
import { FunctionParamsAST } from '@kubb/core/utils';
|
|
6
6
|
import { Params } from '@kubb/react';
|
|
7
|
-
import { a as OperationSchema, R as Refs } from './types-
|
|
8
|
-
export { G as GetSchemasProps, h as getSchemas } from './types-
|
|
7
|
+
import { a as OperationSchema, R as Refs } from './types-Dte3MA6H.cjs';
|
|
8
|
+
export { G as GetSchemasProps, h as getSchemas } from './types-Dte3MA6H.cjs';
|
|
9
9
|
import { FormatOptions } from '@kubb/oas/parser';
|
|
10
10
|
|
|
11
11
|
declare function getComments(operation: Operation): string[];
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { Logger } from '@kubb/core/logger';
|
|
|
4
4
|
import * as KubbFile from '@kubb/fs/types';
|
|
5
5
|
import { FunctionParamsAST } from '@kubb/core/utils';
|
|
6
6
|
import { Params } from '@kubb/react';
|
|
7
|
-
import { a as OperationSchema, R as Refs } from './types-
|
|
8
|
-
export { G as GetSchemasProps, h as getSchemas } from './types-
|
|
7
|
+
import { a as OperationSchema, R as Refs } from './types-Dte3MA6H.js';
|
|
8
|
+
export { G as GetSchemasProps, h as getSchemas } from './types-Dte3MA6H.js';
|
|
9
9
|
import { FormatOptions } from '@kubb/oas/parser';
|
|
10
10
|
|
|
11
11
|
declare function getComments(operation: Operation): string[];
|