@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.
Files changed (183) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/server/chunks/nitro/nitro.mjs +1790 -20812
  3. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  4. package/.output/server/chunks/routes/api/health.get.mjs +16 -14
  5. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  6. package/.output/server/index.mjs +16 -14
  7. package/.output/server/index.mjs.map +1 -1
  8. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/constants.js +18 -0
  9. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/permessage-deflate.js +514 -0
  10. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/sender.js +602 -0
  11. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/stream.js +159 -0
  12. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket-server.js +540 -0
  13. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket.js +1388 -0
  14. package/.output/server/node_modules/.nitro/ws@8.18.0/package.json +69 -0
  15. package/.output/server/node_modules/.nitro/ws@8.18.0/wrapper.mjs +8 -0
  16. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/buffer-util.js +131 -0
  17. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/event-target.js +292 -0
  18. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/extension.js +203 -0
  19. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/limiter.js +55 -0
  20. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/receiver.js +706 -0
  21. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/subprotocol.js +62 -0
  22. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/validation.js +152 -0
  23. package/.output/server/node_modules/@clack/core/dist/index.mjs +11 -0
  24. package/.output/server/node_modules/@clack/core/package.json +60 -0
  25. package/.output/server/node_modules/@clack/prompts/dist/index.mjs +137 -0
  26. package/.output/server/node_modules/@clack/prompts/package.json +65 -0
  27. package/.output/server/node_modules/@kubb/ast/dist/chunk--u3MIqq1.js +8 -0
  28. package/.output/server/node_modules/@kubb/ast/dist/index.js +423 -0
  29. package/.output/server/node_modules/@kubb/ast/package.json +70 -0
  30. package/.output/server/node_modules/@kubb/core/dist/chunk--u3MIqq1.js +8 -0
  31. package/.output/server/node_modules/@kubb/core/dist/hooks.js +23 -0
  32. package/.output/server/node_modules/@kubb/core/dist/index.js +2311 -0
  33. package/.output/server/node_modules/@kubb/core/package.json +109 -0
  34. package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-O_arW02_.js +17 -0
  35. package/.output/server/node_modules/@kubb/fabric-core/dist/defaultParser-iCpMSYCp.js +15 -0
  36. package/.output/server/node_modules/@kubb/fabric-core/dist/getRelativePath-NAm_Y-vp.js +55 -0
  37. package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +653 -0
  38. package/.output/server/node_modules/@kubb/fabric-core/dist/onProcessExit-Cput7j2c.js +742 -0
  39. package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +101 -0
  40. package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +17 -0
  41. package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +375 -0
  42. package/.output/server/node_modules/@kubb/fabric-core/package.json +111 -0
  43. package/.output/server/node_modules/@kubb/oas/dist/chunk--u3MIqq1.js +8 -0
  44. package/.output/server/node_modules/@kubb/oas/dist/index.js +918 -0
  45. package/.output/server/node_modules/@kubb/oas/package.json +94 -0
  46. package/.output/server/node_modules/@kubb/plugin-client/dist/StaticClassClient-bCe7RG_w.js +636 -0
  47. package/.output/server/node_modules/@kubb/plugin-client/dist/chunk--u3MIqq1.js +8 -0
  48. package/.output/server/node_modules/@kubb/plugin-client/dist/components.js +2 -0
  49. package/.output/server/node_modules/@kubb/plugin-client/dist/generators-BffddRNu.js +723 -0
  50. package/.output/server/node_modules/@kubb/plugin-client/dist/index.js +124 -0
  51. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/axios.source.js +6 -0
  52. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/fetch.source.js +6 -0
  53. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/config.source.js +6 -0
  54. package/.output/server/node_modules/@kubb/plugin-client/package.json +153 -0
  55. package/.output/server/node_modules/@kubb/plugin-cypress/dist/chunk--u3MIqq1.js +8 -0
  56. package/.output/server/node_modules/@kubb/plugin-cypress/dist/components-BK_6GU4v.js +257 -0
  57. package/.output/server/node_modules/@kubb/plugin-cypress/dist/generators-D5YFtyyC.js +71 -0
  58. package/.output/server/node_modules/@kubb/plugin-cypress/dist/index.js +79 -0
  59. package/.output/server/node_modules/@kubb/plugin-cypress/package.json +108 -0
  60. package/.output/server/node_modules/@kubb/plugin-faker/dist/chunk--u3MIqq1.js +8 -0
  61. package/.output/server/node_modules/@kubb/plugin-faker/dist/components-BkBIov4R.js +419 -0
  62. package/.output/server/node_modules/@kubb/plugin-faker/dist/fakerGenerator-BztogaeO.js +200 -0
  63. package/.output/server/node_modules/@kubb/plugin-faker/dist/index.js +141 -0
  64. package/.output/server/node_modules/@kubb/plugin-faker/package.json +103 -0
  65. package/.output/server/node_modules/@kubb/plugin-mcp/dist/Server-H3SwqhwF.js +178 -0
  66. package/.output/server/node_modules/@kubb/plugin-mcp/dist/chunk--u3MIqq1.js +8 -0
  67. package/.output/server/node_modules/@kubb/plugin-mcp/dist/generators-BqkMrcs9.js +274 -0
  68. package/.output/server/node_modules/@kubb/plugin-mcp/dist/index.js +122 -0
  69. package/.output/server/node_modules/@kubb/plugin-mcp/package.json +107 -0
  70. package/.output/server/node_modules/@kubb/plugin-msw/dist/chunk--u3MIqq1.js +8 -0
  71. package/.output/server/node_modules/@kubb/plugin-msw/dist/components-DgtTZkWX.js +277 -0
  72. package/.output/server/node_modules/@kubb/plugin-msw/dist/generators-C34kqa1L.js +161 -0
  73. package/.output/server/node_modules/@kubb/plugin-msw/dist/index.js +84 -0
  74. package/.output/server/node_modules/@kubb/plugin-msw/package.json +109 -0
  75. package/.output/server/node_modules/@kubb/plugin-oas/dist/SchemaMapper-CqMkO2T1.js +58 -0
  76. package/.output/server/node_modules/@kubb/plugin-oas/dist/chunk--u3MIqq1.js +8 -0
  77. package/.output/server/node_modules/@kubb/plugin-oas/dist/generators-D7C3CXsN.js +79 -0
  78. package/.output/server/node_modules/@kubb/plugin-oas/dist/generators.js +2 -0
  79. package/.output/server/node_modules/@kubb/plugin-oas/dist/getFooter-Pw3tLCiV.js +112 -0
  80. package/.output/server/node_modules/@kubb/plugin-oas/dist/hooks.js +200 -0
  81. package/.output/server/node_modules/@kubb/plugin-oas/dist/index.js +408 -0
  82. package/.output/server/node_modules/@kubb/plugin-oas/dist/requestBody-pRavthCw.js +1336 -0
  83. package/.output/server/node_modules/@kubb/plugin-oas/dist/utils.js +268 -0
  84. package/.output/server/node_modules/@kubb/plugin-oas/package.json +122 -0
  85. package/.output/server/node_modules/@kubb/plugin-react-query/dist/chunk--u3MIqq1.js +8 -0
  86. package/.output/server/node_modules/@kubb/plugin-react-query/dist/components-CpyHYGOw.js +1520 -0
  87. package/.output/server/node_modules/@kubb/plugin-react-query/dist/generators-CpiBv5eE.js +1427 -0
  88. package/.output/server/node_modules/@kubb/plugin-react-query/dist/index.js +166 -0
  89. package/.output/server/node_modules/@kubb/plugin-react-query/package.json +112 -0
  90. package/.output/server/node_modules/@kubb/plugin-redoc/dist/chunk--u3MIqq1.js +8 -0
  91. package/.output/server/node_modules/@kubb/plugin-redoc/dist/index.js +65 -0
  92. package/.output/server/node_modules/@kubb/plugin-redoc/package.json +85 -0
  93. package/.output/server/node_modules/@kubb/plugin-redoc/static/redoc.hbs +22 -0
  94. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/chunk--u3MIqq1.js +8 -0
  95. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/components-BhStIi1M.js +665 -0
  96. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/generators-CQClzsST.js +415 -0
  97. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/index.js +145 -0
  98. package/.output/server/node_modules/@kubb/plugin-solid-query/package.json +113 -0
  99. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/chunk--u3MIqq1.js +8 -0
  100. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/components-DntKBsnB.js +666 -0
  101. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/generators-BtTsGGrM.js +414 -0
  102. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/index.js +145 -0
  103. package/.output/server/node_modules/@kubb/plugin-svelte-query/package.json +113 -0
  104. package/.output/server/node_modules/@kubb/plugin-swr/dist/chunk--u3MIqq1.js +8 -0
  105. package/.output/server/node_modules/@kubb/plugin-swr/dist/components-DRDGvgXG.js +702 -0
  106. package/.output/server/node_modules/@kubb/plugin-swr/dist/generators-ClWZJ-YG.js +399 -0
  107. package/.output/server/node_modules/@kubb/plugin-swr/dist/index.js +144 -0
  108. package/.output/server/node_modules/@kubb/plugin-swr/package.json +115 -0
  109. package/.output/server/node_modules/@kubb/plugin-ts/dist/chunk--u3MIqq1.js +8 -0
  110. package/.output/server/node_modules/@kubb/plugin-ts/dist/components-C7fu-sK1.js +723 -0
  111. package/.output/server/node_modules/@kubb/plugin-ts/dist/index.js +2 -0
  112. package/.output/server/node_modules/@kubb/plugin-ts/dist/plugin-CYC-FGXe.js +479 -0
  113. package/.output/server/node_modules/@kubb/plugin-ts/package.json +105 -0
  114. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/chunk--u3MIqq1.js +8 -0
  115. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/components-_AMBl0g-.js +1029 -0
  116. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/generators-Zb1s5Wmb.js +661 -0
  117. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/index.js +157 -0
  118. package/.output/server/node_modules/@kubb/plugin-vue-query/package.json +114 -0
  119. package/.output/server/node_modules/@kubb/plugin-zod/dist/chunk--u3MIqq1.js +8 -0
  120. package/.output/server/node_modules/@kubb/plugin-zod/dist/components-eECfXVou.js +842 -0
  121. package/.output/server/node_modules/@kubb/plugin-zod/dist/generators-D1R6NNf2.js +290 -0
  122. package/.output/server/node_modules/@kubb/plugin-zod/dist/index.js +175 -0
  123. package/.output/server/node_modules/@kubb/plugin-zod/dist/templates/ToZod.source.js +6 -0
  124. package/.output/server/node_modules/@kubb/plugin-zod/package.json +112 -0
  125. package/.output/server/node_modules/@kubb/react-fabric/dist/chunk-BGCRLu6H.js +38 -0
  126. package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +525 -0
  127. package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-Bl0DfUmV.js +1448 -0
  128. package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +12 -0
  129. package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -0
  130. package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -0
  131. package/.output/server/node_modules/@kubb/react-fabric/dist/reactPlugin-QQPrjNuQ.js +17813 -0
  132. package/.output/server/node_modules/@kubb/react-fabric/package.json +143 -0
  133. package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +11 -1
  134. package/.output/server/node_modules/@redocly/config/package.json +1 -1
  135. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +25 -10
  136. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +32 -29
  137. package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +5 -0
  138. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
  139. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +47 -38
  140. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
  141. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +45 -41
  142. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +3 -1
  143. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +41 -55
  144. package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +28 -16
  145. package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
  146. package/.output/server/node_modules/buffer-from/index.js +72 -0
  147. package/.output/server/node_modules/buffer-from/package.json +19 -0
  148. package/.output/server/node_modules/fast-string-truncated-width/dist/index.js +171 -0
  149. package/.output/server/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
  150. package/.output/server/node_modules/fast-string-truncated-width/package.json +35 -0
  151. package/.output/server/node_modules/fast-string-width/dist/index.js +14 -0
  152. package/.output/server/node_modules/fast-string-width/package.json +34 -0
  153. package/.output/server/node_modules/fast-wrap-ansi/lib/main.js +216 -0
  154. package/.output/server/node_modules/fast-wrap-ansi/package.json +51 -0
  155. package/.output/server/node_modules/p-limit/index.js +127 -0
  156. package/.output/server/node_modules/p-limit/package.json +58 -0
  157. package/.output/server/node_modules/react-devtools-core/dist/backend.js +18302 -0
  158. package/.output/server/node_modules/react-devtools-core/package.json +38 -0
  159. package/.output/server/node_modules/sisteransi/package.json +34 -0
  160. package/.output/server/node_modules/sisteransi/src/index.js +58 -0
  161. package/.output/server/node_modules/source-map-support/package.json +31 -0
  162. package/.output/server/node_modules/source-map-support/source-map-support.js +625 -0
  163. package/.output/server/node_modules/typescript/lib/typescript.js +200276 -0
  164. package/.output/server/node_modules/typescript/package.json +120 -0
  165. package/.output/server/node_modules/yocto-queue/index.js +90 -0
  166. package/.output/server/node_modules/yocto-queue/package.json +48 -0
  167. package/.output/server/package.json +35 -4
  168. package/package.json +20 -20
  169. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/buffer-util.js +0 -0
  170. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/event-target.js +0 -0
  171. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/extension.js +0 -0
  172. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/limiter.js +0 -0
  173. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/receiver.js +0 -0
  174. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/subprotocol.js +0 -0
  175. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/validation.js +0 -0
  176. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/constants.js +0 -0
  177. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/permessage-deflate.js +0 -0
  178. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/sender.js +0 -0
  179. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/stream.js +0 -0
  180. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket-server.js +0 -0
  181. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket.js +0 -0
  182. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/package.json +0 -0
  183. /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, banner: exports.bannersConfigSchema }),
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
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/config",
3
- "version": "0.46.1",
3
+ "version": "0.48.0",
4
4
  "license": "MIT",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -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
- visitor.DiscriminatorMapping = {
177
- leave(mapping, ctx) {
178
- for (const name of Object.keys(mapping)) {
179
- const $ref = mapping[name];
180
- const resolved = ctx.resolve({ $ref });
181
- if (!resolved.location || resolved.node === undefined) {
182
- reportUnresolvedRef(resolved, ctx.report, ctx.location.child(name));
183
- return;
184
- }
185
- const componentType = mapTypeToComponent('Schema', version);
186
- mapping[name] = saveComponent(componentType, resolved, ctx);
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
- let name = '';
227
- const refParts = pointer.slice(2).split('/').filter(isTruthy); // slice(2) removes "#/"
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, // always the last one
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(location, componentType, name) {
5
- components.set(location.absolutePointer, {
6
- usedIn: components.get(location.absolutePointer)?.usedIn ?? [],
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 removeUnusedComponents(root, removedPaths) {
12
- const removedLengthStart = removedPaths.length;
13
- for (const [path, { usedIn, name, componentType }] of components) {
14
- const used = usedIn.some((location) => !removedPaths.some((removed) =>
15
- // Check if the current location's absolute pointer starts with the 'removed' path
16
- // and either its length matches exactly with 'removed' or the character after the 'removed' path is a '/'
17
- location.absolutePointer.startsWith(removed) &&
18
- (location.absolutePointer.length === removed.length ||
19
- location.absolutePointer[removed.length] === '/')));
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
- removedPaths.push(path);
34
+ removedKeys.add(key);
22
35
  delete root[componentType][name];
23
- components.delete(path);
36
+ components.delete(key);
24
37
  if (isEmptyObject(root[componentType])) {
25
38
  delete root[componentType];
26
39
  }
27
40
  }
28
41
  }
29
- return removedPaths.length > removedLengthStart
30
- ? removeUnusedComponents(root, removedPaths)
31
- : removedPaths.length;
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, resolve, key }) {
48
+ leave(ref, { location, type, key }) {
36
49
  if (['Schema', 'Parameter', 'Response', 'SecurityScheme'].includes(type.name)) {
37
- const resolvedRef = resolve(ref);
38
- if (!resolvedRef.location)
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 componentLevelLocalPointer = localPointer.split('/').slice(0, 3).join('/');
44
- const pointer = `${fileLocation}#${componentLevelLocalPointer}`;
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(location);
56
+ registered.usedIn.push(sourcePointer);
48
57
  }
49
58
  else {
50
- components.set(pointer, {
51
- usedIn: [location],
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, { location, key }) {
74
+ Schema(schema, { key }) {
66
75
  if (!schema.allOf) {
67
- registerComponent(location, 'definitions', key.toString());
76
+ registerComponent('definitions', key.toString());
68
77
  }
69
78
  },
70
79
  },
71
80
  NamedParameters: {
72
- Parameter(_parameter, { location, key }) {
73
- registerComponent(location, 'parameters', key.toString());
81
+ Parameter(_parameter, { key }) {
82
+ registerComponent('parameters', key.toString());
74
83
  },
75
84
  },
76
85
  NamedResponses: {
77
- Response(_response, { location, key }) {
78
- registerComponent(location, 'responses', key.toString());
86
+ Response(_response, { key }) {
87
+ registerComponent('responses', key.toString());
79
88
  },
80
89
  },
81
90
  NamedSecuritySchemes: {
82
- SecurityScheme(_securityScheme, { location, key }) {
83
- registerComponent(location, 'securityDefinitions', key.toString());
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, // always the last one
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(location, componentType, name) {
6
- components.set(location.absolutePointer, {
7
- usedIn: components.get(location.absolutePointer)?.usedIn ?? [],
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, removedPaths) {
13
- const removedLengthStart = removedPaths.length;
14
- for (const [path, { usedIn, name, componentType }] of components) {
15
- const used = usedIn.some((location) => !removedPaths.some((removed) => location.absolutePointer.startsWith(removed) &&
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
- removedPaths.push(path);
30
+ removedKeys.add(key);
23
31
  const componentChild = root.components[componentType];
24
32
  delete componentChild[name];
25
- components.delete(path);
33
+ components.delete(key);
26
34
  if (isEmptyObject(componentChild)) {
27
35
  delete root.components[componentType];
28
36
  }
29
37
  }
30
38
  }
31
- return removedPaths.length > removedLengthStart
32
- ? removeUnusedComponents(root, removedPaths)
33
- : removedPaths.length;
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, resolve, key }) {
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 resolvedRef = resolve(ref);
48
- if (!resolvedRef.location)
55
+ const targetPointer = getComponentKey(ref.$ref);
56
+ if (!targetPointer)
49
57
  return;
50
- const [fileLocation, localPointer] = resolvedRef.location.absolutePointer.split('#', 2);
51
- if (!localPointer)
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(location);
61
+ registered.usedIn.push(sourcePointer);
58
62
  }
59
63
  else {
60
- components.set(pointer, {
61
- usedIn: [location],
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, { location, key }) {
82
+ Schema(schema, { key }) {
79
83
  if (!schema.allOf) {
80
- registerComponent(location, 'schemas', key.toString());
84
+ registerComponent('schemas', key.toString());
81
85
  }
82
86
  },
83
87
  },
84
88
  NamedParameters: {
85
- Parameter(_parameter, { location, key }) {
86
- registerComponent(location, 'parameters', key.toString());
89
+ Parameter(_parameter, { key }) {
90
+ registerComponent('parameters', key.toString());
87
91
  },
88
92
  },
89
93
  NamedResponses: {
90
- Response(_response, { location, key }) {
91
- registerComponent(location, 'responses', key.toString());
94
+ Response(_response, { key }) {
95
+ registerComponent('responses', key.toString());
92
96
  },
93
97
  },
94
98
  NamedExamples: {
95
- Example(_example, { location, key }) {
96
- registerComponent(location, 'examples', key.toString());
99
+ Example(_example, { key }) {
100
+ registerComponent('examples', key.toString());
97
101
  },
98
102
  },
99
103
  NamedRequestBodies: {
100
- RequestBody(_requestBody, { location, key }) {
101
- registerComponent(location, 'requestBodies', key.toString());
104
+ RequestBody(_requestBody, { key }) {
105
+ registerComponent('requestBodies', key.toString());
102
106
  },
103
107
  },
104
108
  NamedHeaders: {
105
- Header(_header, { location, key }) {
106
- registerComponent(location, 'headers', key.toString());
109
+ Header(_header, { key }) {
110
+ registerComponent('headers', key.toString());
107
111
  },
108
112
  },
109
113
  NamedMediaTypes: {
110
- MediaTypesMap(_mediaTypesMap, { location, key }) {
111
- registerComponent(location, 'mediaTypes', key.toString());
114
+ MediaTypesMap(_mediaTypesMap, { key }) {
115
+ registerComponent('mediaTypes', key.toString());
112
116
  },
113
117
  },
114
118
  };
@@ -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))