@kubb/agent 5.0.0-alpha.34 → 5.0.0-alpha.36
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1790 -20812
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +16 -14
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +16 -14
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/constants.js +18 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/permessage-deflate.js +514 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/sender.js +602 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/stream.js +159 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket-server.js +540 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket.js +1388 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/package.json +69 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/wrapper.mjs +8 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/event-target.js +292 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/extension.js +203 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/limiter.js +55 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/receiver.js +706 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/validation.js +152 -0
- package/.output/server/node_modules/@clack/core/dist/index.mjs +11 -0
- package/.output/server/node_modules/@clack/core/package.json +60 -0
- package/.output/server/node_modules/@clack/prompts/dist/index.mjs +137 -0
- package/.output/server/node_modules/@clack/prompts/package.json +65 -0
- package/.output/server/node_modules/@kubb/ast/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/ast/dist/index.js +423 -0
- package/.output/server/node_modules/@kubb/ast/package.json +70 -0
- package/.output/server/node_modules/@kubb/core/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/core/dist/hooks.js +23 -0
- package/.output/server/node_modules/@kubb/core/dist/index.js +2311 -0
- package/.output/server/node_modules/@kubb/core/package.json +109 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-O_arW02_.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/defaultParser-iCpMSYCp.js +15 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/getRelativePath-NAm_Y-vp.js +55 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +653 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/onProcessExit-Cput7j2c.js +742 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +101 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +375 -0
- package/.output/server/node_modules/@kubb/fabric-core/package.json +111 -0
- package/.output/server/node_modules/@kubb/oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/oas/dist/index.js +918 -0
- package/.output/server/node_modules/@kubb/oas/package.json +94 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/StaticClassClient-bCe7RG_w.js +636 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/components.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/generators-BffddRNu.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/index.js +124 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/axios.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/fetch.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/config.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/package.json +153 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/components-BK_6GU4v.js +257 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/generators-D5YFtyyC.js +71 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/index.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/package.json +108 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/components-BkBIov4R.js +419 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/fakerGenerator-BztogaeO.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/index.js +141 -0
- package/.output/server/node_modules/@kubb/plugin-faker/package.json +103 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/Server-H3SwqhwF.js +178 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/generators-BqkMrcs9.js +274 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/index.js +122 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/package.json +107 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/components-DgtTZkWX.js +277 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/generators-C34kqa1L.js +161 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/index.js +84 -0
- package/.output/server/node_modules/@kubb/plugin-msw/package.json +109 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/SchemaMapper-CqMkO2T1.js +58 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators-D7C3CXsN.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/getFooter-Pw3tLCiV.js +112 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/hooks.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/index.js +408 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/requestBody-pRavthCw.js +1336 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/utils.js +268 -0
- package/.output/server/node_modules/@kubb/plugin-oas/package.json +122 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/components-CpyHYGOw.js +1520 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/generators-CpiBv5eE.js +1427 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/index.js +166 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/package.json +112 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/index.js +65 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/package.json +85 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/static/redoc.hbs +22 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/components-BhStIi1M.js +665 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/generators-CQClzsST.js +415 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/components-DntKBsnB.js +666 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/generators-BtTsGGrM.js +414 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/components-DRDGvgXG.js +702 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/generators-ClWZJ-YG.js +399 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/index.js +144 -0
- package/.output/server/node_modules/@kubb/plugin-swr/package.json +115 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/components-C7fu-sK1.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/index.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/plugin-CYC-FGXe.js +479 -0
- package/.output/server/node_modules/@kubb/plugin-ts/package.json +105 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/components-_AMBl0g-.js +1029 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/generators-Zb1s5Wmb.js +661 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/index.js +157 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/package.json +114 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/components-eECfXVou.js +842 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/generators-D1R6NNf2.js +290 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/index.js +175 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/templates/ToZod.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-zod/package.json +112 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/chunk-BGCRLu6H.js +38 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +525 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-Bl0DfUmV.js +1448 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +12 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/reactPlugin-QQPrjNuQ.js +17813 -0
- package/.output/server/node_modules/@kubb/react-fabric/package.json +143 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +11 -1
- package/.output/server/node_modules/@redocly/config/package.json +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +25 -10
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +32 -29
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +47 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +45 -41
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +3 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +41 -55
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +28 -16
- package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
- package/.output/server/node_modules/buffer-from/index.js +72 -0
- package/.output/server/node_modules/buffer-from/package.json +19 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/index.js +171 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
- package/.output/server/node_modules/fast-string-truncated-width/package.json +35 -0
- package/.output/server/node_modules/fast-string-width/dist/index.js +14 -0
- package/.output/server/node_modules/fast-string-width/package.json +34 -0
- package/.output/server/node_modules/fast-wrap-ansi/lib/main.js +216 -0
- package/.output/server/node_modules/fast-wrap-ansi/package.json +51 -0
- package/.output/server/node_modules/p-limit/index.js +127 -0
- package/.output/server/node_modules/p-limit/package.json +58 -0
- package/.output/server/node_modules/react-devtools-core/dist/backend.js +18302 -0
- package/.output/server/node_modules/react-devtools-core/package.json +38 -0
- package/.output/server/node_modules/sisteransi/package.json +34 -0
- package/.output/server/node_modules/sisteransi/src/index.js +58 -0
- package/.output/server/node_modules/source-map-support/package.json +31 -0
- package/.output/server/node_modules/source-map-support/source-map-support.js +625 -0
- package/.output/server/node_modules/typescript/lib/typescript.js +200276 -0
- package/.output/server/node_modules/typescript/package.json +120 -0
- package/.output/server/node_modules/yocto-queue/index.js +90 -0
- package/.output/server/node_modules/yocto-queue/package.json +48 -0
- package/.output/server/package.json +35 -4
- package/package.json +20 -20
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/buffer-util.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/event-target.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/extension.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/limiter.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/receiver.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/subprotocol.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/validation.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/permessage-deflate.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/sender.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/stream.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket-server.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/package.json +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/wrapper.mjs +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kubb/react-fabric",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "React integration for Kubb's fabric - JSX runtime and component-based code generation with React reconciler for building type-safe generators",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"jsx",
|
|
8
|
+
"jsx-runtime",
|
|
9
|
+
"react-reconciler",
|
|
10
|
+
"component-generation",
|
|
11
|
+
"codegen",
|
|
12
|
+
"code-generator",
|
|
13
|
+
"typescript",
|
|
14
|
+
"file-generation",
|
|
15
|
+
"plugin-system",
|
|
16
|
+
"plugins",
|
|
17
|
+
"fabric",
|
|
18
|
+
"kubb"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/kubb-labs/fabric.git",
|
|
23
|
+
"directory": "packages/react-fabric"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "stijnvanhulle",
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"./dist/globals.js",
|
|
29
|
+
"./dist/globals.cjs"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"require": "./dist/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./globals": {
|
|
38
|
+
"import": "./dist/globals.js",
|
|
39
|
+
"require": "./dist/globals.cjs"
|
|
40
|
+
},
|
|
41
|
+
"./jsx-dev-runtime": {
|
|
42
|
+
"import": "./dist/jsx-dev-runtime.js",
|
|
43
|
+
"require": "./dist/jsx-dev-runtime.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./jsx-runtime": {
|
|
46
|
+
"import": "./dist/jsx-runtime.js",
|
|
47
|
+
"require": "./dist/jsx-runtime.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./parsers": {
|
|
50
|
+
"import": "./dist/parsers.js",
|
|
51
|
+
"require": "./dist/parsers.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./plugins": {
|
|
54
|
+
"import": "./dist/plugins.js",
|
|
55
|
+
"require": "./dist/plugins.cjs"
|
|
56
|
+
},
|
|
57
|
+
"./types": {
|
|
58
|
+
"import": "./dist/types.js",
|
|
59
|
+
"require": "./dist/types.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
"main": "./dist/index.cjs",
|
|
64
|
+
"module": "./dist/index.js",
|
|
65
|
+
"types": "./dist/index.d.ts",
|
|
66
|
+
"typesVersions": {
|
|
67
|
+
"*": {
|
|
68
|
+
"globals": [
|
|
69
|
+
"./dist/globals.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"jsx-dev-runtime": [
|
|
72
|
+
"./dist/jsx-runtime.d.ts"
|
|
73
|
+
],
|
|
74
|
+
"jsx-runtime": [
|
|
75
|
+
"./dist/jsx-runtime.d.ts"
|
|
76
|
+
],
|
|
77
|
+
"parsers": [
|
|
78
|
+
"./dist/parsers.d.ts"
|
|
79
|
+
],
|
|
80
|
+
"plugins": [
|
|
81
|
+
"./dist/plugins.d.ts"
|
|
82
|
+
],
|
|
83
|
+
"types": [
|
|
84
|
+
"./dist/types.d.ts"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"src",
|
|
90
|
+
"dist",
|
|
91
|
+
"*.d.ts",
|
|
92
|
+
"*.d.cts",
|
|
93
|
+
"!*.map",
|
|
94
|
+
"!/**/**.test.**",
|
|
95
|
+
"!/**/__tests__/**",
|
|
96
|
+
"!/**/__snapshots__/**"
|
|
97
|
+
],
|
|
98
|
+
"size-limit": [
|
|
99
|
+
{
|
|
100
|
+
"path": "./dist/*.js",
|
|
101
|
+
"limit": "510 KiB",
|
|
102
|
+
"gzip": true
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"react-devtools-core": "6.1.5",
|
|
107
|
+
"remeda": "^2.33.6",
|
|
108
|
+
"ws": "8.18.0",
|
|
109
|
+
"@kubb/fabric-core": "0.14.0"
|
|
110
|
+
},
|
|
111
|
+
"devDependencies": {
|
|
112
|
+
"@types/react": "^19.2.14",
|
|
113
|
+
"@types/react-reconciler": "0.32.0",
|
|
114
|
+
"@types/ws": "^8.18.1",
|
|
115
|
+
"react": "19.2.3",
|
|
116
|
+
"react-reconciler": "0.33.0"
|
|
117
|
+
},
|
|
118
|
+
"engines": {
|
|
119
|
+
"node": ">=20"
|
|
120
|
+
},
|
|
121
|
+
"publishConfig": {
|
|
122
|
+
"access": "public",
|
|
123
|
+
"registry": "https://registry.npmjs.org/"
|
|
124
|
+
},
|
|
125
|
+
"inlinedDependencies": {
|
|
126
|
+
"react": "19.2.3",
|
|
127
|
+
"react-reconciler": "0.33.0",
|
|
128
|
+
"scheduler": "0.27.0"
|
|
129
|
+
},
|
|
130
|
+
"scripts": {
|
|
131
|
+
"build": "tsdown && size-limit",
|
|
132
|
+
"clean": "node -e \"require('fs').rmSync('./dist', {recursive:true,force:true})\"",
|
|
133
|
+
"lint": "pnpm biome lint .",
|
|
134
|
+
"lint:fix": "pnpm biome lint --fix --unsafe .",
|
|
135
|
+
"release": "pnpm publish --no-git-check",
|
|
136
|
+
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check -tag canary",
|
|
137
|
+
"start": "tsdown --watch ./src",
|
|
138
|
+
"start:devtools": "npx react-devtools",
|
|
139
|
+
"test": "vitest --passWithNoTests",
|
|
140
|
+
"test:devtools": "node ./dist/runner.cjs",
|
|
141
|
+
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -121,6 +121,7 @@ exports.rbacScopeItemsSchema = {
|
|
|
121
121
|
exports.bannerConfigSchema = {
|
|
122
122
|
type: 'object',
|
|
123
123
|
properties: {
|
|
124
|
+
trackingId: { type: 'string' },
|
|
124
125
|
content: { type: 'string' },
|
|
125
126
|
dismissible: { type: 'boolean', default: false },
|
|
126
127
|
target: { type: 'string' },
|
|
@@ -563,7 +564,16 @@ exports.redoclyConfigSchema = {
|
|
|
563
564
|
/**
|
|
564
565
|
* @deprecated Should use `scorecardClassic` instead
|
|
565
566
|
*/
|
|
566
|
-
scorecard: ex_theme_config_schemas_1.scorecardConfigSchema, scorecardClassic: ex_theme_config_schemas_1.scorecardConfigSchema, scorecards: scorecards_config_schema_1.scorecardsConfigSchema, mcp: mcpConfigSchema,
|
|
567
|
+
scorecard: ex_theme_config_schemas_1.scorecardConfigSchema, scorecardClassic: ex_theme_config_schemas_1.scorecardConfigSchema, scorecards: scorecards_config_schema_1.scorecardsConfigSchema, mcp: mcpConfigSchema, corsProxy: {
|
|
568
|
+
type: 'object',
|
|
569
|
+
properties: {
|
|
570
|
+
allowedTargets: {
|
|
571
|
+
type: 'array',
|
|
572
|
+
items: { type: 'string' },
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
additionalProperties: false,
|
|
576
|
+
}, banner: exports.bannersConfigSchema }),
|
|
567
577
|
default: { redirects: {}, seo: exports.seoConfigSchema.default },
|
|
568
578
|
additionalProperties: true,
|
|
569
579
|
};
|
|
@@ -22,15 +22,6 @@ export async function bundleDocument(opts) {
|
|
|
22
22
|
refTypes: new Map(),
|
|
23
23
|
visitorsData: {},
|
|
24
24
|
};
|
|
25
|
-
if (removeUnusedComponents && !decorators.some((d) => d.ruleId === 'remove-unused-components')) {
|
|
26
|
-
decorators.push({
|
|
27
|
-
severity: 'error',
|
|
28
|
-
ruleId: 'remove-unused-components',
|
|
29
|
-
visitor: specMajorVersion === 'oas2'
|
|
30
|
-
? RemoveUnusedComponentsOas2({})
|
|
31
|
-
: RemoveUnusedComponentsOas3({}),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
25
|
let resolvedRefMap = await resolveDocument({
|
|
35
26
|
rootDocument: document,
|
|
36
27
|
rootType: normalizedTypes.Root,
|
|
@@ -64,7 +55,7 @@ export async function bundleDocument(opts) {
|
|
|
64
55
|
componentRenamingConflicts,
|
|
65
56
|
}),
|
|
66
57
|
},
|
|
67
|
-
...decorators,
|
|
58
|
+
...decorators.filter((decorator) => decorator.ruleId !== 'remove-unused-components'),
|
|
68
59
|
], normalizedTypes);
|
|
69
60
|
walkDocument({
|
|
70
61
|
document,
|
|
@@ -73,6 +64,30 @@ export async function bundleDocument(opts) {
|
|
|
73
64
|
resolvedRefMap,
|
|
74
65
|
ctx,
|
|
75
66
|
});
|
|
67
|
+
if (removeUnusedComponents ||
|
|
68
|
+
config.getDecoratorSettings('remove-unused-components', specVersion).severity !== 'off') {
|
|
69
|
+
const postBundleRefMap = await resolveDocument({
|
|
70
|
+
rootDocument: document,
|
|
71
|
+
rootType: normalizedTypes.Root,
|
|
72
|
+
externalRefResolver,
|
|
73
|
+
});
|
|
74
|
+
const postBundleVisitors = normalizeVisitors([
|
|
75
|
+
{
|
|
76
|
+
severity: 'error',
|
|
77
|
+
ruleId: 'remove-unused-components',
|
|
78
|
+
visitor: specMajorVersion === 'oas2'
|
|
79
|
+
? RemoveUnusedComponentsOas2({})
|
|
80
|
+
: RemoveUnusedComponentsOas3({}),
|
|
81
|
+
},
|
|
82
|
+
], normalizedTypes);
|
|
83
|
+
walkDocument({
|
|
84
|
+
document,
|
|
85
|
+
rootType: normalizedTypes.Root,
|
|
86
|
+
normalizedVisitors: postBundleVisitors,
|
|
87
|
+
resolvedRefMap: postBundleRefMap,
|
|
88
|
+
ctx,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
76
91
|
return {
|
|
77
92
|
bundle: document,
|
|
78
93
|
problems: ctx.problems.map((problem) => config.addProblemToIgnore(problem)),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { isAbsoluteUrl, replaceRef, isExternalValue, isRef, refBaseName, } from '../ref-utils.js';
|
|
1
|
+
import { isAbsoluteUrl, replaceRef, isExternalValue, isRef, pointerBaseName, refBaseName, isMappingRef, } from '../ref-utils.js';
|
|
2
2
|
import { reportUnresolvedRef } from '../rules/common/no-unresolved-refs.js';
|
|
3
3
|
import { dequal } from '../utils/dequal.js';
|
|
4
|
-
import { isTruthy } from '../utils/is-truthy.js';
|
|
5
4
|
import { makeRefId } from '../utils/make-ref-id.js';
|
|
6
5
|
export function mapTypeToComponent(typeName, version) {
|
|
7
6
|
switch (version) {
|
|
@@ -173,18 +172,35 @@ export function makeBundleVisitor({ version, dereference, rootDocument, resolved
|
|
|
173
172
|
},
|
|
174
173
|
};
|
|
175
174
|
if (version === 'oas3') {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
const componentType = mapTypeToComponent('Schema', version);
|
|
176
|
+
visitor.Discriminator = {
|
|
177
|
+
leave(discriminator, ctx) {
|
|
178
|
+
if (typeof discriminator.defaultMapping !== 'string' ||
|
|
179
|
+
!isMappingRef(discriminator.defaultMapping)) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const resolved = ctx.resolve({ $ref: discriminator.defaultMapping });
|
|
183
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
184
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location.child('defaultMapping'));
|
|
185
|
+
return;
|
|
187
186
|
}
|
|
187
|
+
discriminator.defaultMapping = saveComponent(componentType, resolved, ctx);
|
|
188
|
+
},
|
|
189
|
+
DiscriminatorMapping: {
|
|
190
|
+
leave(mapping, ctx) {
|
|
191
|
+
for (const name of Object.keys(mapping)) {
|
|
192
|
+
const $ref = mapping[name];
|
|
193
|
+
if (!isMappingRef($ref)) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const resolved = ctx.resolve({ $ref });
|
|
197
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
198
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location.child(name));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
mapping[name] = saveComponent(componentType, resolved, ctx);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
188
204
|
},
|
|
189
205
|
};
|
|
190
206
|
}
|
|
@@ -221,29 +237,16 @@ export function makeBundleVisitor({ version, dereference, rootDocument, resolved
|
|
|
221
237
|
return dequal(node, target.node);
|
|
222
238
|
}
|
|
223
239
|
function getComponentName(target, componentType, ctx) {
|
|
224
|
-
const [fileRef, pointer] = [target.location.source.absoluteRef, target.location.pointer];
|
|
225
240
|
const componentsGroup = components[componentType];
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
while (refParts.length > 0) {
|
|
229
|
-
name = refParts.pop() + (name ? `-${name}` : '');
|
|
230
|
-
if (!componentsGroup ||
|
|
231
|
-
!componentsGroup[name] ||
|
|
232
|
-
isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
233
|
-
return name;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
name = refBaseName(fileRef) + (name ? `_${name}` : '');
|
|
237
|
-
if (!componentsGroup[name] || isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
238
|
-
return name;
|
|
239
|
-
}
|
|
241
|
+
const [fileRef, pointer] = [target.location.source.absoluteRef, target.location.pointer];
|
|
242
|
+
let name = pointerBaseName(pointer) || refBaseName(fileRef);
|
|
240
243
|
const prevName = name;
|
|
241
244
|
let serialId = 2;
|
|
242
245
|
while (componentsGroup[name] && !isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
243
246
|
name = `${prevName}-${serialId}`;
|
|
244
247
|
serialId++;
|
|
245
248
|
}
|
|
246
|
-
if (!componentsGroup[name]) {
|
|
249
|
+
if (!componentsGroup[name] && prevName !== name) {
|
|
247
250
|
ctx.report({
|
|
248
251
|
message: `Two schemas are referenced with the same name but different content. Renamed ${prevName} to ${name}.`,
|
|
249
252
|
location: ctx.location,
|
|
@@ -104,6 +104,11 @@ export class Config {
|
|
|
104
104
|
ignore: this.ignore,
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
+
clearIgnoreForRef(ref) {
|
|
108
|
+
const dir = this.configPath ? path.dirname(this.configPath) : process.cwd();
|
|
109
|
+
const absRef = isAbsoluteUrl(ref) ? ref : path.resolve(dir, ref);
|
|
110
|
+
delete this.ignore[absRef];
|
|
111
|
+
}
|
|
107
112
|
saveIgnore() {
|
|
108
113
|
const dir = this.configPath ? path.dirname(this.configPath) : process.cwd();
|
|
109
114
|
const ignoreFile = path.join(dir, IGNORE_FILE);
|
|
@@ -14,6 +14,6 @@ export const decorators = {
|
|
|
14
14
|
'remove-x-internal': RemoveXInternal,
|
|
15
15
|
'filter-in': FilterIn,
|
|
16
16
|
'filter-out': FilterOut,
|
|
17
|
-
'remove-unused-components': RemoveUnusedComponents,
|
|
17
|
+
'remove-unused-components': RemoveUnusedComponents,
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,54 +1,63 @@
|
|
|
1
|
+
import { parseRef } from '../../ref-utils.js';
|
|
1
2
|
import { isEmptyObject } from '../../utils/is-empty-object.js';
|
|
3
|
+
const OAS2_COMPONENT_TYPES = [
|
|
4
|
+
'definitions',
|
|
5
|
+
'parameters',
|
|
6
|
+
'responses',
|
|
7
|
+
'securityDefinitions',
|
|
8
|
+
];
|
|
2
9
|
export const RemoveUnusedComponents = () => {
|
|
3
10
|
const components = new Map();
|
|
4
|
-
function registerComponent(
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
function registerComponent(componentType, name) {
|
|
12
|
+
const key = `${componentType}/${name}`;
|
|
13
|
+
components.set(key, {
|
|
14
|
+
usedIn: components.get(key)?.usedIn ?? [],
|
|
7
15
|
componentType,
|
|
8
16
|
name,
|
|
9
17
|
});
|
|
10
18
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
function getComponentKey(pointer) {
|
|
20
|
+
if (!pointer.startsWith('#/'))
|
|
21
|
+
return;
|
|
22
|
+
const [type, name] = parseRef(pointer).pointer;
|
|
23
|
+
if (!type || !name)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (!OAS2_COMPONENT_TYPES.includes(type))
|
|
26
|
+
return undefined;
|
|
27
|
+
return `${type}/${name}`;
|
|
28
|
+
}
|
|
29
|
+
function removeUnusedComponents(root, removedKeys = new Set()) {
|
|
30
|
+
const removedCountBefore = removedKeys.size;
|
|
31
|
+
for (const [key, { usedIn, name, componentType }] of components) {
|
|
32
|
+
const used = usedIn.some((sourceKey) => sourceKey !== key && !removedKeys.has(sourceKey));
|
|
20
33
|
if (!used && componentType) {
|
|
21
|
-
|
|
34
|
+
removedKeys.add(key);
|
|
22
35
|
delete root[componentType][name];
|
|
23
|
-
components.delete(
|
|
36
|
+
components.delete(key);
|
|
24
37
|
if (isEmptyObject(root[componentType])) {
|
|
25
38
|
delete root[componentType];
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
}
|
|
29
|
-
return
|
|
30
|
-
? removeUnusedComponents(root,
|
|
31
|
-
:
|
|
42
|
+
return removedKeys.size > removedCountBefore
|
|
43
|
+
? removeUnusedComponents(root, removedKeys)
|
|
44
|
+
: removedKeys.size;
|
|
32
45
|
}
|
|
33
46
|
return {
|
|
34
47
|
ref: {
|
|
35
|
-
leave(ref, { location, type,
|
|
48
|
+
leave(ref, { location, type, key }) {
|
|
36
49
|
if (['Schema', 'Parameter', 'Response', 'SecurityScheme'].includes(type.name)) {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
return;
|
|
40
|
-
const [fileLocation, localPointer] = resolvedRef.location.absolutePointer.split('#', 2);
|
|
41
|
-
if (!localPointer)
|
|
50
|
+
const targetPointer = getComponentKey(ref.$ref);
|
|
51
|
+
if (!targetPointer)
|
|
42
52
|
return;
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const registered = components.get(pointer);
|
|
53
|
+
const sourcePointer = getComponentKey(location.pointer) ?? location.pointer;
|
|
54
|
+
const registered = components.get(targetPointer);
|
|
46
55
|
if (registered) {
|
|
47
|
-
registered.usedIn.push(
|
|
56
|
+
registered.usedIn.push(sourcePointer);
|
|
48
57
|
}
|
|
49
58
|
else {
|
|
50
|
-
components.set(
|
|
51
|
-
usedIn: [
|
|
59
|
+
components.set(targetPointer, {
|
|
60
|
+
usedIn: [sourcePointer],
|
|
52
61
|
name: key.toString(),
|
|
53
62
|
});
|
|
54
63
|
}
|
|
@@ -58,29 +67,29 @@ export const RemoveUnusedComponents = () => {
|
|
|
58
67
|
Root: {
|
|
59
68
|
leave(root, ctx) {
|
|
60
69
|
const data = ctx.getVisitorData();
|
|
61
|
-
data.removedCount = removeUnusedComponents(root
|
|
70
|
+
data.removedCount = removeUnusedComponents(root);
|
|
62
71
|
},
|
|
63
72
|
},
|
|
64
73
|
NamedSchemas: {
|
|
65
|
-
Schema(schema, {
|
|
74
|
+
Schema(schema, { key }) {
|
|
66
75
|
if (!schema.allOf) {
|
|
67
|
-
registerComponent(
|
|
76
|
+
registerComponent('definitions', key.toString());
|
|
68
77
|
}
|
|
69
78
|
},
|
|
70
79
|
},
|
|
71
80
|
NamedParameters: {
|
|
72
|
-
Parameter(_parameter, {
|
|
73
|
-
registerComponent(
|
|
81
|
+
Parameter(_parameter, { key }) {
|
|
82
|
+
registerComponent('parameters', key.toString());
|
|
74
83
|
},
|
|
75
84
|
},
|
|
76
85
|
NamedResponses: {
|
|
77
|
-
Response(_response, {
|
|
78
|
-
registerComponent(
|
|
86
|
+
Response(_response, { key }) {
|
|
87
|
+
registerComponent('responses', key.toString());
|
|
79
88
|
},
|
|
80
89
|
},
|
|
81
90
|
NamedSecuritySchemes: {
|
|
82
|
-
SecurityScheme(_securityScheme, {
|
|
83
|
-
registerComponent(
|
|
91
|
+
SecurityScheme(_securityScheme, { key }) {
|
|
92
|
+
registerComponent('securityDefinitions', key.toString());
|
|
84
93
|
},
|
|
85
94
|
},
|
|
86
95
|
};
|
|
@@ -16,6 +16,6 @@ export const decorators = {
|
|
|
16
16
|
'filter-in': FilterIn,
|
|
17
17
|
'filter-out': FilterOut,
|
|
18
18
|
'media-type-examples-override': MediaTypeExamplesOverride,
|
|
19
|
-
'remove-unused-components': RemoveUnusedComponents,
|
|
19
|
+
'remove-unused-components': RemoveUnusedComponents,
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
+
import { parseRef } from '../../ref-utils.js';
|
|
1
2
|
import { isEmptyObject } from '../../utils/is-empty-object.js';
|
|
2
3
|
import { hasComponent } from '../../utils/oas-has-component.js';
|
|
4
|
+
function getComponentKey(pointer) {
|
|
5
|
+
if (!pointer.startsWith('#/components/'))
|
|
6
|
+
return;
|
|
7
|
+
const [_component, type, name] = parseRef(pointer).pointer;
|
|
8
|
+
if (!type || !name)
|
|
9
|
+
return;
|
|
10
|
+
return `${type}/${name}`;
|
|
11
|
+
}
|
|
3
12
|
export const RemoveUnusedComponents = () => {
|
|
4
13
|
const components = new Map();
|
|
5
|
-
function registerComponent(
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
function registerComponent(componentType, name) {
|
|
15
|
+
const key = `${componentType}/${name}`;
|
|
16
|
+
components.set(key, {
|
|
17
|
+
usedIn: components.get(key)?.usedIn ?? [],
|
|
8
18
|
componentType,
|
|
9
19
|
name,
|
|
10
20
|
});
|
|
11
21
|
}
|
|
12
|
-
function removeUnusedComponents(root,
|
|
13
|
-
const
|
|
14
|
-
for (const [
|
|
15
|
-
const used = usedIn.some((
|
|
16
|
-
(location.absolutePointer.length === removed.length ||
|
|
17
|
-
location.absolutePointer[removed.length] === '/')));
|
|
22
|
+
function removeUnusedComponents(root, removedKeys = new Set()) {
|
|
23
|
+
const removedCountBefore = removedKeys.size;
|
|
24
|
+
for (const [key, { usedIn, name, componentType }] of components) {
|
|
25
|
+
const used = usedIn.some((sourceKey) => sourceKey !== key && !removedKeys.has(sourceKey));
|
|
18
26
|
if (!used &&
|
|
19
27
|
componentType &&
|
|
20
28
|
root.components &&
|
|
21
29
|
hasComponent(root.components, componentType)) {
|
|
22
|
-
|
|
30
|
+
removedKeys.add(key);
|
|
23
31
|
const componentChild = root.components[componentType];
|
|
24
32
|
delete componentChild[name];
|
|
25
|
-
components.delete(
|
|
33
|
+
components.delete(key);
|
|
26
34
|
if (isEmptyObject(componentChild)) {
|
|
27
35
|
delete root.components[componentType];
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
|
-
return
|
|
32
|
-
? removeUnusedComponents(root,
|
|
33
|
-
:
|
|
39
|
+
return removedKeys.size > removedCountBefore
|
|
40
|
+
? removeUnusedComponents(root, removedKeys)
|
|
41
|
+
: removedKeys.size;
|
|
34
42
|
}
|
|
35
43
|
return {
|
|
36
44
|
ref: {
|
|
37
|
-
leave(ref, { location, type,
|
|
45
|
+
leave(ref, { location, type, key }) {
|
|
38
46
|
if ([
|
|
39
47
|
'Schema',
|
|
40
48
|
'Header',
|
|
@@ -44,21 +52,17 @@ export const RemoveUnusedComponents = () => {
|
|
|
44
52
|
'RequestBody',
|
|
45
53
|
'MediaTypesMap',
|
|
46
54
|
].includes(type.name)) {
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
55
|
+
const targetPointer = getComponentKey(ref.$ref);
|
|
56
|
+
if (!targetPointer)
|
|
49
57
|
return;
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
return;
|
|
53
|
-
const componentLevelLocalPointer = localPointer.split('/').slice(0, 4).join('/');
|
|
54
|
-
const pointer = `${fileLocation}#${componentLevelLocalPointer}`;
|
|
55
|
-
const registered = components.get(pointer);
|
|
58
|
+
const sourcePointer = getComponentKey(location.pointer) ?? location.pointer;
|
|
59
|
+
const registered = components.get(targetPointer);
|
|
56
60
|
if (registered) {
|
|
57
|
-
registered.usedIn.push(
|
|
61
|
+
registered.usedIn.push(sourcePointer);
|
|
58
62
|
}
|
|
59
63
|
else {
|
|
60
|
-
components.set(
|
|
61
|
-
usedIn: [
|
|
64
|
+
components.set(targetPointer, {
|
|
65
|
+
usedIn: [sourcePointer],
|
|
62
66
|
name: key.toString(),
|
|
63
67
|
});
|
|
64
68
|
}
|
|
@@ -68,47 +72,47 @@ export const RemoveUnusedComponents = () => {
|
|
|
68
72
|
Root: {
|
|
69
73
|
leave(root, ctx) {
|
|
70
74
|
const data = ctx.getVisitorData();
|
|
71
|
-
data.removedCount = removeUnusedComponents(root
|
|
75
|
+
data.removedCount = removeUnusedComponents(root);
|
|
72
76
|
if (isEmptyObject(root.components)) {
|
|
73
77
|
delete root.components;
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
80
|
},
|
|
77
81
|
NamedSchemas: {
|
|
78
|
-
Schema(schema, {
|
|
82
|
+
Schema(schema, { key }) {
|
|
79
83
|
if (!schema.allOf) {
|
|
80
|
-
registerComponent(
|
|
84
|
+
registerComponent('schemas', key.toString());
|
|
81
85
|
}
|
|
82
86
|
},
|
|
83
87
|
},
|
|
84
88
|
NamedParameters: {
|
|
85
|
-
Parameter(_parameter, {
|
|
86
|
-
registerComponent(
|
|
89
|
+
Parameter(_parameter, { key }) {
|
|
90
|
+
registerComponent('parameters', key.toString());
|
|
87
91
|
},
|
|
88
92
|
},
|
|
89
93
|
NamedResponses: {
|
|
90
|
-
Response(_response, {
|
|
91
|
-
registerComponent(
|
|
94
|
+
Response(_response, { key }) {
|
|
95
|
+
registerComponent('responses', key.toString());
|
|
92
96
|
},
|
|
93
97
|
},
|
|
94
98
|
NamedExamples: {
|
|
95
|
-
Example(_example, {
|
|
96
|
-
registerComponent(
|
|
99
|
+
Example(_example, { key }) {
|
|
100
|
+
registerComponent('examples', key.toString());
|
|
97
101
|
},
|
|
98
102
|
},
|
|
99
103
|
NamedRequestBodies: {
|
|
100
|
-
RequestBody(_requestBody, {
|
|
101
|
-
registerComponent(
|
|
104
|
+
RequestBody(_requestBody, { key }) {
|
|
105
|
+
registerComponent('requestBodies', key.toString());
|
|
102
106
|
},
|
|
103
107
|
},
|
|
104
108
|
NamedHeaders: {
|
|
105
|
-
Header(_header, {
|
|
106
|
-
registerComponent(
|
|
109
|
+
Header(_header, { key }) {
|
|
110
|
+
registerComponent('headers', key.toString());
|
|
107
111
|
},
|
|
108
112
|
},
|
|
109
113
|
NamedMediaTypes: {
|
|
110
|
-
MediaTypesMap(_mediaTypesMap, {
|
|
111
|
-
registerComponent(
|
|
114
|
+
MediaTypesMap(_mediaTypesMap, { key }) {
|
|
115
|
+
registerComponent('mediaTypes', key.toString());
|
|
112
116
|
},
|
|
113
117
|
},
|
|
114
118
|
};
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { isPathParameter } from '../../utils/is-path-parameter.js';
|
|
2
2
|
import { splitCamelCaseIntoWords } from '../../utils/split-camel-case-into-words.js';
|
|
3
3
|
const httpMethods = ['get', 'head', 'post', 'put', 'patch', 'delete', 'options', 'trace'];
|
|
4
|
-
export const NoHttpVerbsInPaths = ({ splitIntoWords }) => {
|
|
4
|
+
export const NoHttpVerbsInPaths = ({ splitIntoWords, excludedPaths }) => {
|
|
5
5
|
return {
|
|
6
6
|
PathItem(_path, { key, report, location }) {
|
|
7
7
|
const pathKey = key.toString();
|
|
8
8
|
if (!pathKey.startsWith('/'))
|
|
9
9
|
return;
|
|
10
|
+
if (excludedPaths?.some((excludedPath) => pathKey === excludedPath))
|
|
11
|
+
return;
|
|
10
12
|
const pathSegments = pathKey.split('/');
|
|
11
13
|
for (const pathSegment of pathSegments) {
|
|
12
14
|
if (!pathSegment || isPathParameter(pathSegment))
|