zudoku 0.40.1 → 0.41.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.
Files changed (132) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +155 -0
  2. package/dist/app/ZuploBuildConfig.js +29 -0
  3. package/dist/app/ZuploBuildConfig.js.map +1 -0
  4. package/dist/app/env.d.ts +33 -0
  5. package/dist/app/env.js +29 -0
  6. package/dist/app/env.js.map +1 -0
  7. package/dist/app/main.js +7 -4
  8. package/dist/app/main.js.map +1 -1
  9. package/dist/cli/cli.js +12 -1
  10. package/dist/cli/cli.js.map +1 -1
  11. package/dist/cli/common/machine-id/lib.js +1 -0
  12. package/dist/cli/common/machine-id/lib.js.map +1 -1
  13. package/dist/config/loader.js +0 -3
  14. package/dist/config/loader.js.map +1 -1
  15. package/dist/config/validators/common.d.ts +17 -11
  16. package/dist/config/validators/common.js +1 -1
  17. package/dist/config/validators/common.js.map +1 -1
  18. package/dist/config/validators/validate.d.ts +7 -5
  19. package/dist/lib/authentication/providers/openid.d.ts +3 -1
  20. package/dist/lib/authentication/providers/openid.js +17 -11
  21. package/dist/lib/authentication/providers/openid.js.map +1 -1
  22. package/dist/lib/components/BuildCheck.d.ts +4 -0
  23. package/dist/lib/components/BuildCheck.js +22 -0
  24. package/dist/lib/components/BuildCheck.js.map +1 -0
  25. package/dist/lib/components/Search.js +1 -1
  26. package/dist/lib/components/Search.js.map +1 -1
  27. package/dist/lib/components/Zudoku.js +1 -3
  28. package/dist/lib/components/Zudoku.js.map +1 -1
  29. package/dist/lib/components/context/ViewportAnchorContext.js +8 -9
  30. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  31. package/dist/lib/components/index.d.ts +4 -0
  32. package/dist/lib/components/index.js +2 -0
  33. package/dist/lib/components/index.js.map +1 -1
  34. package/dist/lib/components/navigation/PoweredByZudoku.js +2 -1
  35. package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -1
  36. package/dist/lib/components/navigation/ZuploLogo.d.ts +3 -0
  37. package/dist/lib/components/navigation/ZuploLogo.js +4 -0
  38. package/dist/lib/components/navigation/ZuploLogo.js.map +1 -0
  39. package/dist/lib/oas/parser/index.d.ts +1 -1
  40. package/dist/lib/oas/parser/index.js +3 -2
  41. package/dist/lib/oas/parser/index.js.map +1 -1
  42. package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
  43. package/dist/lib/plugins/openapi/OperationList.js +6 -4
  44. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  45. package/dist/lib/plugins/openapi/util/getRoutes.js +20 -13
  46. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  47. package/dist/lib/util/ensureArray.d.ts +1 -0
  48. package/dist/lib/util/ensureArray.js +2 -0
  49. package/dist/lib/util/ensureArray.js.map +1 -0
  50. package/dist/vite/api/SchemaManager.d.ts +36 -0
  51. package/dist/vite/api/SchemaManager.js +120 -0
  52. package/dist/vite/api/SchemaManager.js.map +1 -0
  53. package/dist/vite/api/SchemaManager.test.d.ts +1 -0
  54. package/dist/vite/api/SchemaManager.test.js +106 -0
  55. package/dist/vite/api/SchemaManager.test.js.map +1 -0
  56. package/dist/vite/config.js +5 -1
  57. package/dist/vite/config.js.map +1 -1
  58. package/dist/vite/plugin-api.js +38 -110
  59. package/dist/vite/plugin-api.js.map +1 -1
  60. package/dist/vite/plugin-sidebar.d.ts +3 -1
  61. package/dist/vite/plugin-sidebar.js +8 -2
  62. package/dist/vite/plugin-sidebar.js.map +1 -1
  63. package/dist/zuplo/with-zuplo-processors.js +1 -1
  64. package/dist/zuplo/with-zuplo-processors.js.map +1 -1
  65. package/dist/zuplo/with-zuplo.d.ts +3 -0
  66. package/dist/zuplo/with-zuplo.js +6 -9
  67. package/dist/zuplo/with-zuplo.js.map +1 -1
  68. package/lib/{Markdown-C5h6bxbE.js → Markdown-DqDbGCj2.js} +314 -315
  69. package/lib/{Markdown-C5h6bxbE.js.map → Markdown-DqDbGCj2.js.map} +1 -1
  70. package/lib/{MdxPage-B66ht0D_.js → MdxPage-B7MyVLV5.js} +5 -5
  71. package/lib/{MdxPage-B66ht0D_.js.map → MdxPage-B7MyVLV5.js.map} +1 -1
  72. package/lib/{OasProvider-BKPF0Pbt.js → OasProvider-DY8kA-9x.js} +2 -2
  73. package/lib/{OasProvider-BKPF0Pbt.js.map → OasProvider-DY8kA-9x.js.map} +1 -1
  74. package/lib/{OperationList-0bhBU7ME.js → OperationList-BNneqYos.js} +798 -794
  75. package/lib/{OperationList-0bhBU7ME.js.map → OperationList-BNneqYos.js.map} +1 -1
  76. package/lib/{Pagination-Bt1czAiJ.js → Pagination-9TA5cwCh.js} +2 -2
  77. package/lib/{Pagination-Bt1czAiJ.js.map → Pagination-9TA5cwCh.js.map} +1 -1
  78. package/lib/{SchemaList-CsTIT1pi.js → SchemaList-CbFxph_p.js} +5 -5
  79. package/lib/{SchemaList-CsTIT1pi.js.map → SchemaList-CbFxph_p.js.map} +1 -1
  80. package/lib/{SchemaView-DCSWtnYr.js → SchemaView-DwlVvFfp.js} +2 -2
  81. package/lib/{SchemaView-DCSWtnYr.js.map → SchemaView-DwlVvFfp.js.map} +1 -1
  82. package/lib/{SlotletProvider-VUmTNmLZ.js → SlotletProvider-p4XaFFOh.js} +2 -2
  83. package/lib/{SlotletProvider-VUmTNmLZ.js.map → SlotletProvider-p4XaFFOh.js.map} +1 -1
  84. package/lib/{Toc-BK39DQvI.js → Toc-BVdRaIC0.js} +2 -2
  85. package/lib/{Toc-BK39DQvI.js.map → Toc-BVdRaIC0.js.map} +1 -1
  86. package/lib/{createServer-DLN7APz_.js → createServer-D_5UkLtY.js} +1459 -1485
  87. package/lib/createServer-D_5UkLtY.js.map +1 -0
  88. package/lib/{index-tpbiZmWp.js → index-BPmAnNGI.js} +686 -648
  89. package/lib/index-BPmAnNGI.js.map +1 -0
  90. package/lib/index-BpThvE5R.js +66 -0
  91. package/lib/index-BpThvE5R.js.map +1 -0
  92. package/lib/{index-Ba_X7EnR.js → index-pAogBEk7.js} +255 -249
  93. package/lib/{index-Ba_X7EnR.js.map → index-pAogBEk7.js.map} +1 -1
  94. package/lib/index-ueM1dihS.js +247 -0
  95. package/lib/index-ueM1dihS.js.map +1 -0
  96. package/lib/{index-DcHeSvkE.js → public-api-CrAQFYc4.js} +651 -684
  97. package/lib/public-api-CrAQFYc4.js.map +1 -0
  98. package/lib/zudoku.auth-openid.js +144 -138
  99. package/lib/zudoku.auth-openid.js.map +1 -1
  100. package/lib/zudoku.components.js +23 -22
  101. package/lib/zudoku.plugin-api-catalog.js +2 -2
  102. package/lib/zudoku.plugin-api-keys.js +1 -1
  103. package/lib/zudoku.plugin-custom-pages.js +1 -1
  104. package/lib/zudoku.plugin-markdown.js +1 -1
  105. package/lib/zudoku.plugin-openapi.js +1 -1
  106. package/package.json +2 -2
  107. package/src/app/ZuploBuildConfig.ts +33 -0
  108. package/src/app/env.ts +35 -0
  109. package/src/app/main.tsx +12 -1
  110. package/src/lib/authentication/providers/openid.tsx +23 -12
  111. package/src/lib/components/BuildCheck.tsx +60 -0
  112. package/src/lib/components/Search.tsx +1 -1
  113. package/src/lib/components/Zudoku.tsx +1 -3
  114. package/src/lib/components/context/ViewportAnchorContext.tsx +8 -15
  115. package/src/lib/components/index.ts +2 -0
  116. package/src/lib/components/navigation/PoweredByZudoku.tsx +8 -3
  117. package/src/lib/components/navigation/ZuploLogo.tsx +14 -0
  118. package/src/lib/oas/parser/index.ts +4 -2
  119. package/src/lib/plugins/openapi/OperationList.tsx +15 -3
  120. package/src/lib/plugins/openapi/util/getRoutes.tsx +21 -13
  121. package/src/lib/util/ensureArray.ts +3 -0
  122. package/client.d.ts +0 -8
  123. package/dist/lib/oas/parser/upgrade/index.d.ts +0 -9
  124. package/dist/lib/oas/parser/upgrade/index.js +0 -90
  125. package/dist/lib/oas/parser/upgrade/index.js.map +0 -1
  126. package/dist/zuplo/env.d.ts +0 -7
  127. package/dist/zuplo/env.js +0 -12
  128. package/dist/zuplo/env.js.map +0 -1
  129. package/lib/createServer-DLN7APz_.js.map +0 -1
  130. package/lib/index-DcHeSvkE.js.map +0 -1
  131. package/lib/index-tpbiZmWp.js.map +0 -1
  132. package/src/lib/oas/parser/upgrade/index.ts +0 -103
@@ -0,0 +1,247 @@
1
+ import { q as h } from "./public-api-CrAQFYc4.js";
2
+ function j(n) {
3
+ return n == null ? void 0 : n.find((e) => e.isEntrypoint);
4
+ }
5
+ function p(n, e, t = []) {
6
+ const i = {};
7
+ for (const [f, s] of Object.entries(n)) {
8
+ const o = [...t, f];
9
+ Array.isArray(s) ? i[f] = s.map((c, r) => typeof c == "object" && !Array.isArray(c) && c !== null ? p(c, e, [...o, r.toString()]) : c) : typeof s == "object" && !Array.isArray(s) && s !== null ? i[f] = p(s, e, o) : i[f] = s;
10
+ }
11
+ return e(i, t);
12
+ }
13
+ function x(n) {
14
+ const e = [];
15
+ return !n || typeof n != "object" ? e : (p(n, (t) => (t.$ref && typeof t.$ref == "string" && !t.$ref.startsWith("#") && e.push(t.$ref.split("#")[0]), t)), [...new Set(e)]);
16
+ }
17
+ function b(n) {
18
+ return typeof n < "u" && Array.isArray(n) && n.length > 0 && n.some((e) => e.isEntrypoint === !0);
19
+ }
20
+ function O(n) {
21
+ if (n === null)
22
+ return {};
23
+ if (typeof n == "string") {
24
+ if (n.trim() === "")
25
+ return {};
26
+ try {
27
+ return JSON.parse(n);
28
+ } catch {
29
+ return h(n, {
30
+ maxAliasCount: 1e4
31
+ });
32
+ }
33
+ }
34
+ return b(n), n;
35
+ }
36
+ function q(n, e = {}) {
37
+ if (b(n))
38
+ return n;
39
+ const t = O(n);
40
+ return [
41
+ {
42
+ isEntrypoint: !0,
43
+ specification: t,
44
+ filename: null,
45
+ dir: "./",
46
+ references: x(t),
47
+ ...e
48
+ }
49
+ ];
50
+ }
51
+ function w(n) {
52
+ let e = n;
53
+ if (e !== null && typeof e.openapi == "string" && e.openapi.startsWith("3.0"))
54
+ e.openapi = "3.1.1";
55
+ else
56
+ return e;
57
+ return e = p(e, (t) => (t.type !== "undefined" && t.nullable === !0 && (t.type = [t.type, "null"], delete t.nullable), t)), e = p(e, (t) => (t.exclusiveMinimum === !0 ? (t.exclusiveMinimum = t.minimum, delete t.minimum) : t.exclusiveMinimum === !1 && delete t.exclusiveMinimum, t.exclusiveMaximum === !0 ? (t.exclusiveMaximum = t.maximum, delete t.maximum) : t.exclusiveMaximum === !1 && delete t.exclusiveMaximum, t)), e = p(e, (t, i) => (t.example !== void 0 && (P(i) ? t.examples = [t.example] : t.examples = {
58
+ default: {
59
+ value: t.example
60
+ }
61
+ }, delete t.example), t)), e = p(e, (t, i) => {
62
+ if (t.type === "object" && t.properties !== void 0 && i.slice(0, -1).some((o, c) => o === "content" && i[c + 1] === "multipart/form-data")) {
63
+ const o = Object.entries(t.properties);
64
+ for (const [c, r] of o)
65
+ typeof r == "object" && r.type === "string" && r.format === "binary" && (r.contentMediaType = "application/octet-stream", delete r.format);
66
+ }
67
+ return t;
68
+ }), e = p(e, (t, i) => i.includes("content") && i.includes("application/octet-stream") ? {} : t.type === "string" && t.format === "binary" ? {
69
+ type: "string",
70
+ contentMediaType: "application/octet-stream"
71
+ } : t), e = p(e, (t) => t.type === "string" && t.format === "base64" ? {
72
+ type: "string",
73
+ contentEncoding: "base64"
74
+ } : t), e = p(e, (t, i) => t.type === "string" && t.format === "byte" ? {
75
+ type: "string",
76
+ contentEncoding: "base64",
77
+ contentMediaType: i.slice(0, -1).find((o, c) => i[c - 1] === "content")
78
+ } : t), e;
79
+ }
80
+ function P(n) {
81
+ return [
82
+ ["components", "schemas"],
83
+ "properties",
84
+ "items",
85
+ "allOf",
86
+ "anyOf",
87
+ "oneOf",
88
+ "not",
89
+ "additionalProperties"
90
+ ].some((t) => Array.isArray(t) ? t.every((i, f) => n[f] === i) : n.includes(t)) || n.includes("schema") || n.some((t) => t.endsWith("Schema"));
91
+ }
92
+ function M(n) {
93
+ var t, i, f;
94
+ let e = n;
95
+ if (e !== null && typeof e.swagger == "string" && ((t = e.swagger) != null && t.startsWith("2.0")))
96
+ e.openapi = "3.0.4", delete e.swagger;
97
+ else
98
+ return e;
99
+ if (e.host) {
100
+ const s = Array.isArray(e.schemes) && ((i = e.schemes) != null && i.length) ? e.schemes : ["http"];
101
+ e.servers = s.map((o) => ({
102
+ url: `${o}://${e.host}${e.basePath ?? ""}`
103
+ })), delete e.basePath, delete e.schemes, delete e.host;
104
+ } else e.basePath && (e.servers = [{ url: e.basePath }], delete e.basePath);
105
+ if (e.definitions && (e.components = Object.assign({}, e.components, {
106
+ schemas: e.definitions
107
+ }), delete e.definitions, e = p(e, (s) => {
108
+ var o;
109
+ return (o = s.$ref) != null && o.startsWith("#/definitions/") && (s.$ref = s.$ref.replace(/^#\/definitions\//, "#/components/schemas/")), s;
110
+ })), e = p(e, (s) => (s.type === "file" && (s.type = "string", s.format = "binary"), s)), typeof e.paths == "object") {
111
+ for (const s in e.paths)
112
+ if (Object.hasOwn(e.paths, s)) {
113
+ const o = e.paths[s];
114
+ for (const c in o)
115
+ if (Object.hasOwn(o, c)) {
116
+ const r = o[c];
117
+ if (r.parameters) {
118
+ const l = structuredClone(r.parameters.find((u) => u.in === "body") ?? {});
119
+ if (l && Object.keys(l).length) {
120
+ delete l.name, delete l.in;
121
+ const u = e.consumes ?? r.consumes ?? ["application/json"];
122
+ typeof r.requestBody != "object" && (r.requestBody = {}), typeof r.requestBody.content != "object" && (r.requestBody.content = {});
123
+ const { schema: m, ...d } = l;
124
+ r.requestBody = {
125
+ ...r.requestBody,
126
+ ...d
127
+ };
128
+ for (const g of u)
129
+ r.requestBody.content[g] = {
130
+ schema: m
131
+ };
132
+ }
133
+ r.parameters = r.parameters.filter((u) => u.in !== "body"), delete r.consumes;
134
+ const a = r.parameters.filter((u) => u.in === "formData");
135
+ if (a.length > 0) {
136
+ typeof r.requestBody != "object" && (r.requestBody = {}), typeof r.requestBody.content != "object" && (r.requestBody.content = {}), r.requestBody.content["application/x-www-form-urlencoded"] = {
137
+ schema: {
138
+ type: "object",
139
+ properties: {},
140
+ required: []
141
+ // Initialize required array
142
+ }
143
+ };
144
+ for (const u of a)
145
+ r.requestBody.content["application/x-www-form-urlencoded"].schema.properties[u.name] = {
146
+ type: u.type,
147
+ description: u.description
148
+ }, u.required && r.requestBody.content["application/x-www-form-urlencoded"].schema.required.push(u.name);
149
+ r.parameters = r.parameters.filter((u) => u.in !== "formData");
150
+ }
151
+ r.parameters = r.parameters.map((u) => y(u));
152
+ }
153
+ if (r.responses) {
154
+ for (const l in r.responses)
155
+ if (Object.hasOwn(r.responses, l)) {
156
+ const a = r.responses[l];
157
+ if (a.headers && (a.headers = Object.entries(a.headers).reduce((u, [m, d]) => ({
158
+ [m]: y(d),
159
+ ...u
160
+ }), {})), a.schema) {
161
+ const u = e.produces ?? r.produces ?? ["application/json"];
162
+ typeof a.content != "object" && (a.content = {});
163
+ for (const m of u)
164
+ a.content[m] = {
165
+ schema: a.schema
166
+ };
167
+ delete a.schema;
168
+ }
169
+ }
170
+ }
171
+ delete r.produces, ((f = r.parameters) == null ? void 0 : f.length) === 0 && delete r.parameters;
172
+ }
173
+ }
174
+ }
175
+ if (e.securityDefinitions) {
176
+ typeof e.components != "object" && (e.components = {}), e.components = e.components, Object.assign(e.components, { securitySchemes: {} });
177
+ for (const [s, o] of Object.entries(e.securityDefinitions))
178
+ if (typeof o == "object")
179
+ if ("type" in o && o.type === "oauth2") {
180
+ const { flow: c, authorizationUrl: r, tokenUrl: l, scopes: a } = o;
181
+ Object.assign(e.components.securitySchemes, {
182
+ [s]: {
183
+ type: "oauth2",
184
+ flows: {
185
+ [c]: Object.assign({}, r && { authorizationUrl: r }, l && { tokenUrl: l }, a && { scopes: a })
186
+ }
187
+ }
188
+ });
189
+ } else "type" in o && o.type === "basic" ? Object.assign(e.components.securitySchemes, {
190
+ [s]: {
191
+ type: "http",
192
+ scheme: "basic"
193
+ }
194
+ }) : Object.assign(e.components.securitySchemes, {
195
+ [s]: o
196
+ });
197
+ delete e.securityDefinitions;
198
+ }
199
+ return e;
200
+ }
201
+ function B(n) {
202
+ return [
203
+ "type",
204
+ "format",
205
+ "items",
206
+ "maximum",
207
+ "exclusiveMaximum",
208
+ "minimum",
209
+ "exclusiveMinimum",
210
+ "maxLength",
211
+ "minLength",
212
+ "pattern",
213
+ "maxItems",
214
+ "minItems",
215
+ "uniqueItems",
216
+ "enum",
217
+ "multipleOf"
218
+ ].reduce((t, i) => (Object.hasOwn(n, i) && (t[i] = n[i], delete n[i]), t), {});
219
+ }
220
+ function y(n) {
221
+ return delete n.collectionFormat, delete n.default, {
222
+ schema: B(n),
223
+ ...n
224
+ };
225
+ }
226
+ function S(n) {
227
+ return n ? {
228
+ specification: [M, w].reduce((i, f) => f(i), j(q(n)).specification),
229
+ // TODO: Make dynamic
230
+ version: "3.1"
231
+ } : {
232
+ specification: null,
233
+ version: "3.1"
234
+ };
235
+ }
236
+ export {
237
+ j as getEntrypoint,
238
+ x as getListOfReferences,
239
+ b as isFilesystem,
240
+ P as isSchemaPath,
241
+ O as normalize,
242
+ p as traverse,
243
+ S as upgrade,
244
+ w as upgradeFromThreeToThreeOne,
245
+ M as upgradeFromTwoToThree
246
+ };
247
+ //# sourceMappingURL=index-ueM1dihS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ueM1dihS.js","sources":["../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/getEntrypoint.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/traverse.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/getListOfReferences.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/isFilesystem.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/normalize.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/makeFilesystem.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/upgradeFromThreeToThreeOne.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/upgradeFromTwoToThree.js","../../../node_modules/.pnpm/@scalar+openapi-parser@0.10.14/node_modules/@scalar/openapi-parser/dist/utils/upgrade.js"],"sourcesContent":["/**\n * Return just the entrypoint of the filesystem.\n */\nfunction getEntrypoint(filesystem) {\n return filesystem?.find((file) => file.isEntrypoint);\n}\n\nexport { getEntrypoint };\n","/**\n * Recursively traverses the specification and applies the transform function to each node.\n */\nfunction traverse(specification, transform, path = []) {\n const result = {};\n for (const [key, value] of Object.entries(specification)) {\n const currentPath = [...path, key];\n if (Array.isArray(value)) {\n result[key] = value.map((item, index) => {\n if (typeof item === 'object' && !Array.isArray(item) && item !== null) {\n return traverse(item, transform, [...currentPath, index.toString()]);\n }\n return item;\n });\n }\n else if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n result[key] = traverse(value, transform, currentPath);\n }\n else {\n result[key] = value;\n }\n }\n return transform(result, path);\n}\n\nexport { traverse };\n","import { traverse } from './traverse.js';\n\n/**\n * Walks through the specification and returns all references as an array.\n *\n * Warning: Doesn’t return internal references.\n */\nfunction getListOfReferences(specification) {\n const references = [];\n // Make sure we’re dealing with an object\n if (!specification || typeof specification !== 'object') {\n return references;\n }\n // Traverse the specification and collect all references\n traverse(specification, (value) => {\n if (value.$ref && typeof value.$ref === 'string' && !value.$ref.startsWith('#')) {\n references.push(value.$ref.split('#')[0]);\n }\n return value;\n });\n // Remove duplicates\n return [...new Set(references)];\n}\n\nexport { getListOfReferences };\n","/**\n * Check if the value is a filesystem\n */\nfunction isFilesystem(value) {\n return (typeof value !== 'undefined' &&\n Array.isArray(value) &&\n value.length > 0 &&\n value.some((file) => file.isEntrypoint === true));\n}\n\nexport { isFilesystem };\n","import { parse } from 'yaml';\nimport { isFilesystem } from './isFilesystem.js';\n\n/**\n * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.\n *\n * Doesn’t modify the object if it’s a `Filesystem` (multiple files) already.\n */\nfunction normalize(specification) {\n if (specification === null) {\n return {};\n }\n if (typeof specification === 'string') {\n if (specification.trim() === '') {\n return {};\n }\n try {\n return JSON.parse(specification);\n }\n catch (_error) {\n return parse(specification, {\n maxAliasCount: 10000,\n });\n }\n }\n if (isFilesystem(specification)) {\n return specification;\n }\n return specification;\n}\n\nexport { normalize };\n","import { getListOfReferences } from './getListOfReferences.js';\nimport { isFilesystem } from './isFilesystem.js';\nimport { normalize } from './normalize.js';\n\nfunction makeFilesystem(value, overwrites = {}) {\n // Keep as is\n if (isFilesystem(value)) {\n return value;\n }\n // Make an object\n const specification = normalize(value);\n // Create fake filesystem\n return [\n {\n isEntrypoint: true,\n specification,\n filename: null,\n dir: './',\n references: getListOfReferences(specification),\n ...overwrites,\n },\n ];\n}\n\nexport { makeFilesystem };\n","import { traverse } from './traverse.js';\n\n/**\n * Upgrade from OpenAPI 3.0.x to 3.1.1\n *\n * https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n */\nfunction upgradeFromThreeToThreeOne(originalSpecification) {\n let specification = originalSpecification;\n // Version\n if (specification !== null && typeof specification.openapi === 'string' && specification.openapi.startsWith('3.0')) {\n specification.openapi = '3.1.1';\n }\n else {\n // Skip if it’s something else than 3.0.x\n return specification;\n }\n // Nullable types\n specification = traverse(specification, (schema) => {\n if (schema.type !== 'undefined' && schema.nullable === true) {\n schema.type = [schema.type, 'null'];\n delete schema.nullable;\n }\n return schema;\n });\n // exclusiveMinimum and exclusiveMaximum\n specification = traverse(specification, (schema) => {\n if (schema.exclusiveMinimum === true) {\n schema.exclusiveMinimum = schema.minimum;\n delete schema.minimum;\n }\n else if (schema.exclusiveMinimum === false) {\n delete schema.exclusiveMinimum;\n }\n if (schema.exclusiveMaximum === true) {\n schema.exclusiveMaximum = schema.maximum;\n delete schema.maximum;\n }\n else if (schema.exclusiveMaximum === false) {\n delete schema.exclusiveMaximum;\n }\n return schema;\n });\n // Use examples not example\n specification = traverse(specification, (schema, path) => {\n if (schema.example !== undefined) {\n // Arrays in schemas\n if (isSchemaPath(path)) {\n schema.examples = [schema.example];\n }\n // Objects everywhere else\n else {\n schema.examples = {\n default: {\n value: schema.example,\n },\n };\n }\n delete schema.example;\n }\n return schema;\n });\n // Multipart file uploads with a binary file\n specification = traverse(specification, (schema, path) => {\n if (schema.type === 'object' && schema.properties !== undefined) {\n // Check if this is a multipart request body schema\n const parentPath = path.slice(0, -1);\n const isMultipart = parentPath.some((segment, index) => {\n return segment === 'content' && path[index + 1] === 'multipart/form-data';\n });\n if (isMultipart) {\n // Types\n const entries = Object.entries(schema.properties);\n for (const [_, value] of entries) {\n if (typeof value === 'object' && value.type === 'string' && value.format === 'binary') {\n value.contentMediaType = 'application/octet-stream';\n delete value.format;\n }\n }\n }\n }\n return schema;\n });\n // Uploading a binary file in a POST request\n specification = traverse(specification, (schema, path) => {\n if (path.includes('content') && path.includes('application/octet-stream')) {\n return {};\n }\n if (schema.type === 'string' && schema.format === 'binary') {\n return {\n type: 'string',\n contentMediaType: 'application/octet-stream',\n };\n }\n return schema;\n });\n // Uploading an image with base64 encoding\n specification = traverse(specification, (schema) => {\n if (schema.type === 'string' && schema.format === 'base64') {\n return {\n type: 'string',\n contentEncoding: 'base64',\n };\n }\n return schema;\n });\n specification = traverse(specification, (schema, path) => {\n if (schema.type === 'string' && schema.format === 'byte') {\n const parentPath = path.slice(0, -1);\n const contentMediaType = parentPath.find((_, index) => path[index - 1] === 'content');\n return {\n type: 'string',\n contentEncoding: 'base64',\n contentMediaType,\n };\n }\n return schema;\n });\n // Declaring $schema Dialects to protect against change\n // if (typeof specification.$schema === 'undefined') {\n // specification.$schema = 'http://json-schema.org/draft-07/schema#'\n // }\n return specification;\n}\n/** Determine if the current path is within a schema */\nfunction isSchemaPath(path) {\n const schemaLocations = [\n ['components', 'schemas'],\n 'properties',\n 'items',\n 'allOf',\n 'anyOf',\n 'oneOf',\n 'not',\n 'additionalProperties',\n ];\n return (schemaLocations.some((location) => {\n if (Array.isArray(location)) {\n return location.every((segment, index) => path[index] === segment);\n }\n return path.includes(location);\n }) ||\n path.includes('schema') ||\n path.some((segment) => segment.endsWith('Schema')));\n}\n\nexport { isSchemaPath, upgradeFromThreeToThreeOne };\n","import { traverse } from './traverse.js';\n\n/**\n * Upgrade Swagger 2.0 to OpenAPI 3.0\n *\n * https://swagger.io/blog/news/whats-new-in-openapi-3-0/\n */\nfunction upgradeFromTwoToThree(originalSpecification) {\n let specification = originalSpecification;\n // Version\n if (specification !== null && typeof specification.swagger === 'string' && specification.swagger?.startsWith('2.0')) {\n specification.openapi = '3.0.4';\n delete specification.swagger;\n }\n else {\n // Skip if it’s something else than 3.0.x\n return specification;\n }\n // Servers\n if (specification.host) {\n const schemes = Array.isArray(specification.schemes) && specification.schemes?.length ? specification.schemes : ['http'];\n specification.servers = schemes.map((scheme) => ({\n url: `${scheme}://${specification.host}${specification.basePath ?? ''}`,\n }));\n delete specification.basePath;\n delete specification.schemes;\n delete specification.host;\n }\n else if (specification.basePath) {\n specification.servers = [{ url: specification.basePath }];\n delete specification.basePath;\n }\n // Schemas\n if (specification.definitions) {\n specification.components = Object.assign({}, specification.components, {\n schemas: specification.definitions,\n });\n delete specification.definitions;\n // Rewrite $refs to definitions\n specification = traverse(specification, (schema) => {\n if (schema.$ref?.startsWith('#/definitions/')) {\n schema.$ref = schema.$ref.replace(/^#\\/definitions\\//, '#/components/schemas/');\n }\n return schema;\n });\n }\n specification = traverse(specification, (schema) => {\n if (schema.type === 'file') {\n schema.type = 'string';\n schema.format = 'binary';\n }\n return schema;\n });\n // Paths\n if (typeof specification.paths === 'object') {\n for (const path in specification.paths) {\n if (Object.hasOwn(specification.paths, path)) {\n const pathItem = specification.paths[path];\n for (const method in pathItem) {\n if (Object.hasOwn(pathItem, method)) {\n const operationItem = pathItem[method];\n // Request bodies\n if (operationItem.parameters) {\n const bodyParameter = structuredClone(operationItem.parameters.find((parameter) => parameter.in === 'body') ?? {});\n if (bodyParameter && Object.keys(bodyParameter).length) {\n delete bodyParameter.name;\n delete bodyParameter.in;\n const consumes = specification.consumes ?? operationItem.consumes ?? ['application/json'];\n if (typeof operationItem.requestBody !== 'object') {\n operationItem.requestBody = {};\n }\n if (typeof operationItem.requestBody.content !== 'object') {\n operationItem.requestBody.content = {};\n }\n const { schema, ...requestBody } = bodyParameter;\n operationItem.requestBody = {\n ...operationItem.requestBody,\n ...requestBody,\n };\n for (const type of consumes) {\n operationItem.requestBody.content[type] = {\n schema: schema,\n };\n }\n }\n // Delete body parameter\n operationItem.parameters = operationItem.parameters.filter((parameter) => parameter.in !== 'body');\n delete operationItem.consumes;\n // formData parameters\n const formDataParameters = operationItem.parameters.filter((parameter) => parameter.in === 'formData');\n if (formDataParameters.length > 0) {\n if (typeof operationItem.requestBody !== 'object') {\n operationItem.requestBody = {};\n }\n if (typeof operationItem.requestBody.content !== 'object') {\n operationItem.requestBody.content = {};\n }\n operationItem.requestBody.content['application/x-www-form-urlencoded'] = {\n schema: {\n type: 'object',\n properties: {},\n required: [], // Initialize required array\n },\n };\n for (const param of formDataParameters) {\n operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.properties[param.name] =\n {\n type: param.type,\n description: param.description,\n };\n // Add to required array if param is required\n if (param.required) {\n operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.required.push(param.name);\n }\n }\n // Remove formData parameters from the parameters array\n operationItem.parameters = operationItem.parameters.filter((parameter) => parameter.in !== 'formData');\n }\n operationItem.parameters = operationItem.parameters.map((parameter) => transformParameterObject(parameter));\n }\n // Responses\n if (operationItem.responses) {\n for (const response in operationItem.responses) {\n if (Object.hasOwn(operationItem.responses, response)) {\n const responseItem = operationItem.responses[response];\n if (responseItem.headers) {\n responseItem.headers = Object.entries(responseItem.headers).reduce((acc, [name, header]) => {\n return {\n [name]: transformParameterObject(header),\n ...acc,\n };\n }, {});\n }\n if (responseItem.schema) {\n const produces = specification.produces ?? operationItem.produces ?? ['application/json'];\n if (typeof responseItem.content !== 'object') {\n responseItem.content = {};\n }\n for (const type of produces) {\n responseItem.content[type] = {\n schema: responseItem.schema,\n };\n }\n delete responseItem.schema;\n }\n }\n }\n }\n delete operationItem.produces;\n // Delete empty parameters\n if (operationItem.parameters?.length === 0) {\n delete operationItem.parameters;\n }\n }\n }\n }\n }\n }\n // Upgrade securityDefinitions\n if (specification.securityDefinitions) {\n if (typeof specification.components !== 'object') {\n specification.components = {};\n }\n // Assert that components is of type OpenAPIV3.ComponentsObject\n specification.components = specification.components;\n Object.assign(specification.components, { securitySchemes: {} });\n for (const [key, securityScheme] of Object.entries(specification.securityDefinitions)) {\n if (typeof securityScheme === 'object') {\n if ('type' in securityScheme && securityScheme.type === 'oauth2') {\n const { flow, authorizationUrl, tokenUrl, scopes } = securityScheme;\n // Assert that securitySchemes is of type OpenAPIV3.SecuritySchemeObject\n Object.assign(specification.components.securitySchemes, {\n [key]: {\n type: 'oauth2',\n flows: {\n [flow]: Object.assign({}, authorizationUrl && { authorizationUrl }, tokenUrl && { tokenUrl }, scopes && { scopes }),\n },\n },\n });\n }\n else if ('type' in securityScheme && securityScheme.type === 'basic') {\n Object.assign(specification.components.securitySchemes, {\n [key]: {\n type: 'http',\n scheme: 'basic',\n },\n });\n }\n else {\n Object.assign(specification.components.securitySchemes, {\n [key]: securityScheme,\n });\n }\n }\n }\n delete specification.securityDefinitions;\n }\n return specification;\n}\nfunction transformItemsObject(obj) {\n const schemaProperties = [\n 'type',\n 'format',\n 'items',\n 'maximum',\n 'exclusiveMaximum',\n 'minimum',\n 'exclusiveMinimum',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'maxItems',\n 'minItems',\n 'uniqueItems',\n 'enum',\n 'multipleOf',\n ];\n return schemaProperties.reduce((acc, property) => {\n if (Object.hasOwn(obj, property)) {\n acc[property] = obj[property];\n delete obj[property];\n }\n return acc;\n }, {});\n}\nfunction transformParameterObject(parameter) {\n delete parameter.collectionFormat;\n delete parameter.default;\n return {\n schema: transformItemsObject(parameter),\n ...parameter,\n };\n}\n\nexport { upgradeFromTwoToThree };\n","import { getEntrypoint } from './getEntrypoint.js';\nimport { makeFilesystem } from './makeFilesystem.js';\nimport { upgradeFromThreeToThreeOne } from './upgradeFromThreeToThreeOne.js';\nimport { upgradeFromTwoToThree } from './upgradeFromTwoToThree.js';\n\n/**\n * Upgrade specification to OpenAPI 3.1.0\n */\nfunction upgrade(value) {\n if (!value) {\n return {\n specification: null,\n version: '3.1',\n };\n }\n const upgraders = [upgradeFromTwoToThree, upgradeFromThreeToThreeOne];\n // TODO: Run upgrade over the whole filesystem\n const result = upgraders.reduce((currentSpecification, upgrader) => upgrader(currentSpecification), getEntrypoint(makeFilesystem(value)).specification);\n return {\n specification: result,\n // TODO: Make dynamic\n version: '3.1',\n };\n}\n\nexport { upgrade };\n"],"names":["getEntrypoint","filesystem","file","traverse","specification","transform","path","result","key","value","currentPath","item","index","getListOfReferences","references","isFilesystem","normalize","parse","makeFilesystem","overwrites","upgradeFromThreeToThreeOne","originalSpecification","schema","isSchemaPath","segment","entries","_","location","upgradeFromTwoToThree","_a","schemes","_b","scheme","pathItem","method","operationItem","bodyParameter","parameter","consumes","requestBody","type","formDataParameters","param","transformParameterObject","response","responseItem","acc","name","header","produces","_c","securityScheme","flow","authorizationUrl","tokenUrl","scopes","transformItemsObject","obj","property","upgrade","currentSpecification","upgrader"],"mappings":";AAGA,SAASA,EAAcC,GAAY;AAC/B,SAAOA,KAAA,gBAAAA,EAAY,KAAK,CAACC,MAASA,EAAK;AAC3C;ACFA,SAASC,EAASC,GAAeC,GAAWC,IAAO,CAAA,GAAI;AACnD,QAAMC,IAAS,CAAE;AACjB,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQL,CAAa,GAAG;AACtD,UAAMM,IAAc,CAAC,GAAGJ,G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