@scalar/openapi-to-markdown 0.5.44 → 1.0.0

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 (49) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +73 -34
  3. package/dist/create-markdown-from-openapi.d.ts +16 -15
  4. package/dist/create-markdown-from-openapi.d.ts.map +1 -1
  5. package/dist/create-markdown-from-openapi.js +35 -0
  6. package/dist/index.d.ts +4 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -600
  9. package/dist/load-document.d.ts +4 -0
  10. package/dist/load-document.d.ts.map +1 -0
  11. package/dist/load-document.js +151 -0
  12. package/dist/markdown-nodes.d.ts +25 -0
  13. package/dist/markdown-nodes.d.ts.map +1 -0
  14. package/dist/markdown-nodes.js +34 -0
  15. package/dist/parse-description.d.ts +6 -0
  16. package/dist/parse-description.d.ts.map +1 -0
  17. package/dist/parse-description.js +116 -0
  18. package/dist/parse-html-description.d.ts +4 -0
  19. package/dist/parse-html-description.d.ts.map +1 -0
  20. package/dist/parse-html-description.js +11 -0
  21. package/dist/render-document.d.ts +4 -0
  22. package/dist/render-document.d.ts.map +1 -0
  23. package/dist/render-document.js +112 -0
  24. package/dist/render-operation.d.ts +13 -0
  25. package/dist/render-operation.d.ts.map +1 -0
  26. package/dist/render-operation.js +89 -0
  27. package/dist/render-schema.d.ts +31 -0
  28. package/dist/render-schema.d.ts.map +1 -0
  29. package/dist/render-schema.js +98 -0
  30. package/dist/render-security.d.ts +6 -0
  31. package/dist/render-security.d.ts.map +1 -0
  32. package/dist/render-security.js +33 -0
  33. package/dist/select-document.d.ts +29 -0
  34. package/dist/select-document.d.ts.map +1 -0
  35. package/dist/select-document.js +312 -0
  36. package/package.json +16 -28
  37. package/dist/components/MarkdownReference.test.d.ts +0 -2
  38. package/dist/components/MarkdownReference.test.d.ts.map +0 -1
  39. package/dist/components/MarkdownReference.vue.d.ts +0 -9
  40. package/dist/components/MarkdownReference.vue.d.ts.map +0 -1
  41. package/dist/components/Schema.test.d.ts +0 -2
  42. package/dist/components/Schema.test.d.ts.map +0 -1
  43. package/dist/components/Schema.vue.d.ts +0 -9
  44. package/dist/components/Schema.vue.d.ts.map +0 -1
  45. package/dist/components/XmlOrJson.vue.d.ts +0 -8
  46. package/dist/components/XmlOrJson.vue.d.ts.map +0 -1
  47. package/dist/create-markdown-from-openapi.test.d.ts +0 -2
  48. package/dist/create-markdown-from-openapi.test.d.ts.map +0 -1
  49. package/dist/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,600 +1 @@
1
- import { isObject } from "@scalar/helpers/object/is-object";
2
- import { readFiles } from "@scalar/json-magic/bundle/plugins/node";
3
- import { normalize } from "@scalar/json-magic/helpers/normalize";
4
- import { createWorkspaceStore } from "@scalar/workspace-store/client";
5
- import { forEachPathItemOperation, getPathItemOperation, getResolvedPathItem } from "@scalar/workspace-store/helpers/for-each-path-item-operation";
6
- import { minify } from "html-minifier-terser";
7
- import rehypeParse from "rehype-parse";
8
- import rehypeRemark from "rehype-remark";
9
- import rehypeSanitize from "rehype-sanitize";
10
- import remarkGfm from "remark-gfm";
11
- import remarkStringify from "remark-stringify";
12
- import { unified } from "unified";
13
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSSRApp, createTextVNode, createVNode, defineComponent, openBlock, renderList, resolveComponent, toDisplayString, unref } from "vue";
14
- import { renderToString } from "vue/server-renderer";
15
- import { ScalarMarkdown } from "@scalar/components/markdown";
16
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
17
- import { getExampleFromSchema } from "@scalar/workspace-store/request-example";
18
- import { resolve } from "@scalar/workspace-store/resolve";
19
- import { json2xml } from "@scalar/helpers/file/json2xml";
20
- //#region src/components/Schema.vue?vue&type=script&setup=true&lang.ts
21
- var _hoisted_1$2 = { key: 0 };
22
- var _hoisted_2$2 = { key: 1 };
23
- var _hoisted_3$2 = { key: 0 };
24
- var _hoisted_4$2 = { key: 1 };
25
- var _hoisted_5$1 = { key: 2 };
26
- var _hoisted_6$1 = { key: 3 };
27
- var _hoisted_7$1 = { key: 4 };
28
- var _hoisted_8$1 = { key: 0 };
29
- var _hoisted_9$1 = { key: 0 };
30
- var _hoisted_10$1 = { key: 1 };
31
- var _hoisted_11$1 = { key: 2 };
32
- var _hoisted_12$1 = { key: 3 };
33
- var _hoisted_13$1 = { key: 1 };
34
- var _hoisted_14$1 = { key: 5 };
35
- var _hoisted_15$1 = { key: 0 };
36
- var _hoisted_16$1 = { key: 0 };
37
- var _hoisted_17$1 = { key: 1 };
38
- var _hoisted_18$1 = { key: 2 };
39
- var _hoisted_19$1 = { key: 6 };
40
- var _hoisted_20 = { key: 0 };
41
- var _hoisted_21 = { key: 1 };
42
- var _hoisted_22 = { key: 2 };
43
- var _hoisted_23 = { key: 3 };
44
- var MAX_DEPTH = 10;
45
- //#endregion
46
- //#region src/components/Schema.vue
47
- var Schema_default = /* @__PURE__ */ defineComponent({
48
- __name: "Schema",
49
- props: {
50
- schema: {},
51
- depth: { default: 0 }
52
- },
53
- setup(__props) {
54
- const resolvedSchema = resolve.schema(__props.schema);
55
- const resolveNestedSchema = (value) => resolve.schema(value);
56
- const asObject = (value) => value !== null && typeof value === "object" ? value : void 0;
57
- const getSchemaType = (value) => {
58
- const schemaType = asObject(value)?.type;
59
- if (typeof schemaType === "string") return schemaType;
60
- if (Array.isArray(schemaType) && schemaType.every((entry) => typeof entry === "string")) return schemaType;
61
- };
62
- const getSchemaArray = (value, key) => {
63
- const collection = asObject(value)?.[key];
64
- if (!Array.isArray(collection)) return;
65
- return collection.filter((entry) => entry !== null && typeof entry === "object");
66
- };
67
- const getSchemaNot = (value) => {
68
- const notSchema = asObject(value)?.not;
69
- return notSchema !== null && typeof notSchema === "object" ? notSchema : void 0;
70
- };
71
- const getSchemaProperties = (value) => {
72
- const properties = asObject(value)?.properties;
73
- if (!properties || typeof properties !== "object") return {};
74
- return Object.entries(properties).reduce((acc, [name, prop]) => {
75
- if (prop !== null && typeof prop === "object") acc[name] = prop;
76
- return acc;
77
- }, {});
78
- };
79
- const getSchemaRequired = (value) => {
80
- const required = asObject(value)?.required;
81
- if (!Array.isArray(required)) return [];
82
- return required.filter((item) => typeof item === "string");
83
- };
84
- const getSchemaItems = (value) => {
85
- const items = asObject(value)?.items;
86
- return items !== null && typeof items === "object" ? items : void 0;
87
- };
88
- const getSchemaFormat = (value) => typeof asObject(value)?.format === "string" ? asObject(value)?.format : void 0;
89
- const getSchemaEnum = (value) => {
90
- const enumValues = asObject(value)?.enum;
91
- return Array.isArray(enumValues) ? enumValues : void 0;
92
- };
93
- const getSchemaDefault = (value) => asObject(value)?.default;
94
- const getSchemaDescription = (value) => typeof asObject(value)?.description === "string" ? asObject(value)?.description : void 0;
95
- const getSchemaMinItems = (value) => typeof asObject(value)?.minItems === "number" ? asObject(value)?.minItems : void 0;
96
- const getSchemaMaxItems = (value) => typeof asObject(value)?.maxItems === "number" ? asObject(value)?.maxItems : void 0;
97
- const getSchemaUniqueItems = (value) => typeof asObject(value)?.uniqueItems === "boolean" ? asObject(value)?.uniqueItems : void 0;
98
- const getResolvedSchemaType = (value) => getSchemaType(resolveNestedSchema(value));
99
- const getResolvedSchemaFormat = (value) => getSchemaFormat(resolveNestedSchema(value));
100
- const getResolvedSchemaEnum = (value) => getSchemaEnum(resolveNestedSchema(value));
101
- const getResolvedSchemaDefault = (value) => getSchemaDefault(resolveNestedSchema(value));
102
- const getResolvedSchemaDescription = (value) => getSchemaDescription(resolveNestedSchema(value));
103
- const getResolvedSchemaProperties = (value) => getSchemaProperties(resolveNestedSchema(value));
104
- const getResolvedSchemaItems = (value) => getSchemaItems(resolveNestedSchema(value));
105
- const formatSchemaType = (value) => {
106
- const schemaType = getResolvedSchemaType(value);
107
- return Array.isArray(schemaType) ? schemaType.join(" | ") : schemaType || "object";
108
- };
109
- const formatEnumValues = (value) => value?.map((entry) => JSON.stringify(entry)).join(", ") || "";
110
- const sortProperties = (properties, required) => {
111
- const sorted = Object.entries(properties).sort(([a], [b]) => {
112
- const aRequired = required?.includes(a);
113
- const bRequired = required?.includes(b);
114
- if (aRequired && !bRequired) return -1;
115
- if (!aRequired && bRequired) return 1;
116
- return a.localeCompare(b);
117
- });
118
- return Object.fromEntries(sorted);
119
- };
120
- return (_ctx, _cache) => {
121
- const _component_Schema = resolveComponent("Schema", true);
122
- return __props.depth >= MAX_DEPTH ? (openBlock(), createElementBlock("section", _hoisted_1$2, [..._cache[0] || (_cache[0] = [createElementVNode("p", null, [createElementVNode("em", null, "[Circular Reference]")], -1)])])) : unref(resolvedSchema) ? (openBlock(), createElementBlock("section", _hoisted_2$2, [getSchemaArray(unref(resolvedSchema), "allOf") ? (openBlock(), createElementBlock("section", _hoisted_3$2, [_cache[1] || (_cache[1] = createElementVNode("header", null, [createElementVNode("strong", null, "All of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "allOf"), (subSchema, index) => {
123
- return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, {
124
- schema: subSchema,
125
- depth: __props.depth + 1
126
- }, null, 8, ["schema", "depth"])]);
127
- }), 128))])) : getSchemaArray(unref(resolvedSchema), "anyOf") ? (openBlock(), createElementBlock("section", _hoisted_4$2, [_cache[2] || (_cache[2] = createElementVNode("header", null, [createElementVNode("strong", null, "Any of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "anyOf"), (subSchema, index) => {
128
- return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, {
129
- schema: subSchema,
130
- depth: __props.depth + 1
131
- }, null, 8, ["schema", "depth"])]);
132
- }), 128))])) : getSchemaArray(unref(resolvedSchema), "oneOf") ? (openBlock(), createElementBlock("section", _hoisted_5$1, [_cache[3] || (_cache[3] = createElementVNode("header", null, [createElementVNode("strong", null, "One of:")], -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(getSchemaArray(unref(resolvedSchema), "oneOf"), (subSchema, index) => {
133
- return openBlock(), createElementBlock("section", { key: index }, [createVNode(_component_Schema, {
134
- schema: subSchema,
135
- depth: __props.depth + 1
136
- }, null, 8, ["schema", "depth"])]);
137
- }), 128))])) : getSchemaNot(unref(resolvedSchema)) ? (openBlock(), createElementBlock("section", _hoisted_6$1, [_cache[4] || (_cache[4] = createElementVNode("header", null, [createElementVNode("strong", null, "Not:")], -1)), createElementVNode("section", null, [createVNode(_component_Schema, {
138
- schema: getSchemaNot(unref(resolvedSchema)),
139
- depth: __props.depth + 1
140
- }, null, 8, ["schema", "depth"])])])) : getSchemaType(unref(resolvedSchema)) === "object" || Object.keys(getSchemaProperties(unref(resolvedSchema))).length ? (openBlock(), createElementBlock("section", _hoisted_7$1, [createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(sortProperties(getSchemaProperties(unref(resolvedSchema)), getSchemaRequired(unref(resolvedSchema))), (propSchema, propName) => {
141
- return openBlock(), createElementBlock("li", { key: propName }, [
142
- createElementVNode("strong", null, [createElementVNode("code", null, toDisplayString(propName), 1), getSchemaRequired(unref(resolvedSchema)).includes(propName) ? (openBlock(), createElementBlock("span", _hoisted_8$1, " (required) ")) : createCommentVNode("", true)]),
143
- createElementVNode("p", null, [
144
- createElementVNode("code", null, toDisplayString(formatSchemaType(propSchema)), 1),
145
- getResolvedSchemaFormat(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_9$1, [_cache[5] || (_cache[5] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(getResolvedSchemaFormat(propSchema)), 1)])) : createCommentVNode("", true),
146
- getResolvedSchemaEnum(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_10$1, [_cache[6] || (_cache[6] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(formatEnumValues(getResolvedSchemaEnum(propSchema))), 1)])) : createCommentVNode("", true),
147
- getResolvedSchemaDefault(propSchema) !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_11$1, [_cache[7] || (_cache[7] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(getResolvedSchemaDefault(propSchema))), 1)])) : createCommentVNode("", true),
148
- getResolvedSchemaDescription(propSchema) ? (openBlock(), createElementBlock("span", _hoisted_12$1, " — " + toDisplayString(getResolvedSchemaDescription(propSchema)), 1)) : createCommentVNode("", true)
149
- ]),
150
- getResolvedSchemaType(propSchema) === "object" || Object.keys(getResolvedSchemaProperties(propSchema)).length ? (openBlock(), createBlock(_component_Schema, {
151
- key: 0,
152
- schema: propSchema,
153
- depth: __props.depth + 1
154
- }, null, 8, ["schema", "depth"])) : createCommentVNode("", true),
155
- getResolvedSchemaType(propSchema) === "array" && getResolvedSchemaItems(propSchema) ? (openBlock(), createElementBlock("section", _hoisted_13$1, [_cache[8] || (_cache[8] = createElementVNode("header", null, [createElementVNode("strong", null, "Items:")], -1)), createVNode(_component_Schema, {
156
- schema: getResolvedSchemaItems(propSchema),
157
- depth: __props.depth + 1
158
- }, null, 8, ["schema", "depth"])])) : createCommentVNode("", true)
159
- ]);
160
- }), 128))])])) : getSchemaType(unref(resolvedSchema)) === "array" && getSchemaItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("section", _hoisted_14$1, [
161
- _cache[12] || (_cache[12] = createElementVNode("header", null, [createElementVNode("strong", null, "Array of:")], -1)),
162
- createElementVNode("section", null, [createVNode(_component_Schema, {
163
- schema: getSchemaItems(unref(resolvedSchema)),
164
- depth: __props.depth + 1
165
- }, null, 8, ["schema", "depth"])]),
166
- getSchemaMinItems(unref(resolvedSchema)) !== void 0 || getSchemaMaxItems(unref(resolvedSchema)) !== void 0 || getSchemaUniqueItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("ul", _hoisted_15$1, [
167
- getSchemaMinItems(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_16$1, [_cache[9] || (_cache[9] = createTextVNode(" Min items: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaMinItems(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
168
- getSchemaMaxItems(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("li", _hoisted_17$1, [_cache[10] || (_cache[10] = createTextVNode(" Max items: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaMaxItems(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
169
- getSchemaUniqueItems(unref(resolvedSchema)) ? (openBlock(), createElementBlock("li", _hoisted_18$1, [..._cache[11] || (_cache[11] = [createTextVNode(" Unique items: ", -1), createElementVNode("code", null, "true", -1)])])) : createCommentVNode("", true)
170
- ])) : createCommentVNode("", true)
171
- ])) : (openBlock(), createElementBlock("section", _hoisted_19$1, [createElementVNode("p", null, [
172
- createElementVNode("code", null, toDisplayString(getSchemaType(unref(resolvedSchema))), 1),
173
- getSchemaFormat(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_20, [_cache[13] || (_cache[13] = createTextVNode(", format: ", -1)), createElementVNode("code", null, toDisplayString(getSchemaFormat(unref(resolvedSchema))), 1)])) : createCommentVNode("", true),
174
- getSchemaEnum(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_21, [_cache[14] || (_cache[14] = createTextVNode(", possible values: ", -1)), createElementVNode("code", null, toDisplayString(formatEnumValues(getSchemaEnum(unref(resolvedSchema)))), 1)])) : createCommentVNode("", true),
175
- getSchemaDefault(unref(resolvedSchema)) !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_22, [_cache[15] || (_cache[15] = createTextVNode(", default: ", -1)), createElementVNode("code", null, toDisplayString(JSON.stringify(getSchemaDefault(unref(resolvedSchema)))), 1)])) : createCommentVNode("", true),
176
- getSchemaDescription(unref(resolvedSchema)) ? (openBlock(), createElementBlock("span", _hoisted_23, " — " + toDisplayString(getSchemaDescription(unref(resolvedSchema))), 1)) : createCommentVNode("", true)
177
- ])]))])) : createCommentVNode("", true);
178
- };
179
- }
180
- });
181
- //#endregion
182
- //#region src/components/XmlOrJson.vue?vue&type=script&setup=true&lang.ts
183
- var _hoisted_1$1 = { key: 0 };
184
- var _hoisted_2$1 = { class: "language-xml" };
185
- var _hoisted_3$1 = { key: 1 };
186
- var _hoisted_4$1 = { class: "language-json" };
187
- //#endregion
188
- //#region src/components/XmlOrJson.vue
189
- var XmlOrJson_default = /* @__PURE__ */ defineComponent({
190
- __name: "XmlOrJson",
191
- props: {
192
- xml: {
193
- type: Boolean,
194
- default: false
195
- },
196
- modelValue: {}
197
- },
198
- setup(__props) {
199
- const xmlContent = computed(() => json2xml(__props.modelValue));
200
- return (_ctx, _cache) => {
201
- return __props.xml ? (openBlock(), createElementBlock("pre", _hoisted_1$1, [createElementVNode("code", _hoisted_2$1, toDisplayString(xmlContent.value), 1)])) : (openBlock(), createElementBlock("pre", _hoisted_3$1, [createElementVNode("code", _hoisted_4$1, toDisplayString(JSON.stringify(__props.modelValue, null, 2)), 1)]));
202
- };
203
- }
204
- });
205
- //#endregion
206
- //#region src/components/MarkdownReference.vue?vue&type=script&setup=true&lang.ts
207
- var _hoisted_1 = { key: 1 };
208
- var _hoisted_2 = { key: 0 };
209
- var _hoisted_3 = { key: 1 };
210
- var _hoisted_4 = { key: 2 };
211
- var _hoisted_5 = { key: 0 };
212
- var _hoisted_6 = { key: 1 };
213
- var _hoisted_7 = { key: 0 };
214
- var _hoisted_8 = { key: 0 };
215
- var _hoisted_9 = { key: 1 };
216
- var _hoisted_10 = { key: 2 };
217
- var _hoisted_11 = { key: 3 };
218
- var _hoisted_12 = { key: 1 };
219
- var _hoisted_13 = { key: 2 };
220
- var _hoisted_14 = { key: 3 };
221
- var _hoisted_15 = { key: 2 };
222
- var _hoisted_16 = { key: 3 };
223
- var _hoisted_17 = { key: 0 };
224
- var _hoisted_18 = { key: 1 };
225
- var _hoisted_19 = { key: 4 };
226
- //#endregion
227
- //#region src/components/MarkdownReference.vue
228
- var MarkdownReference_default = /* @__PURE__ */ defineComponent({
229
- __name: "MarkdownReference",
230
- props: { content: {} },
231
- setup(__props) {
232
- const resolveRefAs = (reference) => {
233
- const resolved = getResolvedRef(reference);
234
- return resolved && typeof resolved === "object" ? resolved : null;
235
- };
236
- const resolveOperation = (operation) => resolveRefAs(operation);
237
- const resolveSchema = (schema) => resolveRefAs(schema);
238
- const resolveRequestBody = (body) => resolveRefAs(body);
239
- const resolveParameter = (parameter) => resolveRefAs(parameter);
240
- const resolveResponse = (response) => resolveRefAs(response);
241
- const toRequestBodyView = (body) => resolveRequestBody(body);
242
- const toParameterView = (parameter) => {
243
- const resolvedParameter = resolveParameter(parameter);
244
- if (!resolvedParameter) return null;
245
- return resolvedParameter;
246
- };
247
- const toResponseView = (response) => resolveResponse(response);
248
- const getParameterKey = (parameter) => `${parameter.in}:${parameter.name}`;
249
- const getParameters = (pathParameters, operationParameters) => {
250
- const parameters = /* @__PURE__ */ new Map();
251
- for (const parameterList of [pathParameters, operationParameters]) {
252
- if (!Array.isArray(parameterList)) continue;
253
- for (const parameter of parameterList) {
254
- const parameterView = toParameterView(parameter);
255
- if (parameterView) parameters.set(getParameterKey(parameterView), parameterView);
256
- }
257
- }
258
- return Array.from(parameters.values());
259
- };
260
- const operations = computed(() => {
261
- const paths = __props.content?.paths ?? {};
262
- const entries = [];
263
- for (const [path, pathItemRef] of Object.entries(paths)) {
264
- const resolvedPathItem = getResolvedPathItem(pathItemRef);
265
- forEachPathItemOperation(pathItemRef, (method, operation) => {
266
- const resolvedOperation = resolveOperation(operation);
267
- if (!resolvedOperation) return;
268
- const parameters = getParameters(resolvedPathItem?.parameters, resolvedOperation.parameters);
269
- const requestBody = toRequestBodyView(resolvedOperation.requestBody);
270
- const responses = Object.entries(resolvedOperation.responses ?? {}).flatMap(([statusCode, response]) => {
271
- const resolvedResponse = toResponseView(response);
272
- if (!resolvedResponse) return [];
273
- return [{
274
- statusCode,
275
- response: resolvedResponse
276
- }];
277
- });
278
- entries.push({
279
- path,
280
- method,
281
- operation: resolvedOperation,
282
- parameters,
283
- requestBody,
284
- responses
285
- });
286
- });
287
- }
288
- return entries;
289
- });
290
- const webhooks = computed(() => {
291
- const webhookItems = __props.content?.webhooks ?? {};
292
- const entries = [];
293
- for (const [name, pathItemRef] of Object.entries(webhookItems)) forEachPathItemOperation(pathItemRef, (method, operation) => {
294
- const resolvedOperation = resolveOperation(operation);
295
- if (!resolvedOperation) return;
296
- entries.push({
297
- name,
298
- method,
299
- operation: resolvedOperation
300
- });
301
- });
302
- return entries;
303
- });
304
- const componentSchemas = computed(() => {
305
- const schemas = __props.content?.components?.schemas ?? {};
306
- return Object.entries(schemas).flatMap(([name, schema]) => {
307
- const resolvedSchema = resolveSchema(schema);
308
- if (!resolvedSchema) return [];
309
- return [{
310
- name,
311
- schema: resolvedSchema
312
- }];
313
- });
314
- });
315
- const getSchemaView = (schema) => schema;
316
- return (_ctx, _cache) => {
317
- return openBlock(), createElementBlock("section", null, [
318
- createElementVNode("header", null, [createElementVNode("h1", null, toDisplayString(__props.content?.info?.title), 1), createElementVNode("ul", null, [createElementVNode("li", null, [
319
- _cache[0] || (_cache[0] = createElementVNode("strong", null, "OpenAPI Version:", -1)),
320
- _cache[1] || (_cache[1] = createTextVNode("\xA0", -1)),
321
- createElementVNode("code", null, toDisplayString(__props.content?.openapi), 1)
322
- ]), createElementVNode("li", null, [
323
- _cache[2] || (_cache[2] = createElementVNode("strong", null, "API Version:", -1)),
324
- _cache[3] || (_cache[3] = createTextVNode("\xA0", -1)),
325
- createElementVNode("code", null, toDisplayString(__props.content?.info?.version), 1)
326
- ])])]),
327
- __props.content?.info?.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
328
- key: 0,
329
- value: __props.content?.info?.description
330
- }, null, 8, ["value"])) : createCommentVNode("", true),
331
- __props.content?.servers?.length ? (openBlock(), createElementBlock("section", _hoisted_1, [_cache[10] || (_cache[10] = createElementVNode("h2", null, "Servers", -1)), createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.content.servers, (server) => {
332
- return openBlock(), createElementBlock("li", { key: server.url }, [
333
- _cache[8] || (_cache[8] = createElementVNode("strong", null, "URL:", -1)),
334
- _cache[9] || (_cache[9] = createTextVNode("\xA0", -1)),
335
- createElementVNode("code", null, toDisplayString(server.url), 1),
336
- createElementVNode("ul", null, [server.description ? (openBlock(), createElementBlock("li", _hoisted_2, [_cache[4] || (_cache[4] = createElementVNode("strong", null, "Description:", -1)), createTextVNode("\xA0" + toDisplayString(server.description), 1)])) : createCommentVNode("", true), server.variables && Object.keys(server.variables).length ? (openBlock(), createElementBlock("li", _hoisted_3, [_cache[7] || (_cache[7] = createElementVNode("strong", null, "Variables:", -1)), createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(server.variables, (variable, name) => {
337
- return openBlock(), createElementBlock("li", { key: name }, [
338
- createElementVNode("code", null, toDisplayString(name), 1),
339
- _cache[5] || (_cache[5] = createTextVNode(" (default: ", -1)),
340
- createElementVNode("code", null, toDisplayString(variable.default), 1),
341
- _cache[6] || (_cache[6] = createTextVNode(")", -1)),
342
- variable.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(": " + toDisplayString(variable.description), 1)], 64)) : createCommentVNode("", true)
343
- ]);
344
- }), 128))])])) : createCommentVNode("", true)])
345
- ]);
346
- }), 128))])])) : createCommentVNode("", true),
347
- operations.value.length ? (openBlock(), createElementBlock("section", _hoisted_4, [_cache[30] || (_cache[30] = createElementVNode("h2", null, "Operations", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(operations.value, (entry) => {
348
- return openBlock(), createElementBlock("section", { key: `${entry.method}:${entry.path}` }, [
349
- createElementVNode("header", null, [createElementVNode("h3", null, [entry.operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(entry.operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(entry.method.toString().toUpperCase()) + " " + toDisplayString(entry.path), 1)], 64)), entry.operation["x-scalar-stability"] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(" (" + toDisplayString(entry.operation["x-scalar-stability"]) + ") ", 1)], 64)) : entry.operation.deprecated ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(" ⚠️ Deprecated ")], 64)) : createCommentVNode("", true)])]),
350
- createElementVNode("ul", null, [
351
- createElementVNode("li", null, [
352
- _cache[11] || (_cache[11] = createElementVNode("strong", null, "Method:", -1)),
353
- _cache[12] || (_cache[12] = createTextVNode("\xA0", -1)),
354
- createElementVNode("code", null, toDisplayString(entry.method.toString().toUpperCase()), 1)
355
- ]),
356
- createElementVNode("li", null, [
357
- _cache[13] || (_cache[13] = createElementVNode("strong", null, "Path:", -1)),
358
- _cache[14] || (_cache[14] = createTextVNode("\xA0", -1)),
359
- createElementVNode("code", null, toDisplayString(entry.path), 1)
360
- ]),
361
- entry.operation.tags ? (openBlock(), createElementBlock("li", _hoisted_5, [_cache[15] || (_cache[15] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode("\xA0" + toDisplayString(entry.operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
362
- entry.operation["x-scalar-stability"] ? (openBlock(), createElementBlock("li", _hoisted_6, [_cache[16] || (_cache[16] = createElementVNode("strong", null, "Stability:", -1)), createTextVNode("\xA0" + toDisplayString(entry.operation["x-scalar-stability"]), 1)])) : createCommentVNode("", true)
363
- ]),
364
- createVNode(unref(ScalarMarkdown), { value: entry.operation.description }, null, 8, ["value"]),
365
- entry.parameters.length ? (openBlock(), createElementBlock("section", _hoisted_7, [_cache[25] || (_cache[25] = createElementVNode("h4", null, "Parameters", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.parameters, (parameter) => {
366
- return openBlock(), createElementBlock("section", { key: `${parameter.in}:${parameter.name}` }, [
367
- createElementVNode("h5", null, [
368
- createElementVNode("code", null, toDisplayString(parameter.name), 1),
369
- parameter.required ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" required")], 64)) : createCommentVNode("", true),
370
- parameter.deprecated ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" deprecated")], 64)) : createCommentVNode("", true)
371
- ]),
372
- createElementVNode("ul", null, [
373
- createElementVNode("li", null, [
374
- _cache[17] || (_cache[17] = createElementVNode("strong", null, "In:", -1)),
375
- _cache[18] || (_cache[18] = createTextVNode("\xA0", -1)),
376
- createElementVNode("code", null, toDisplayString(parameter.in), 1)
377
- ]),
378
- parameter.style ? (openBlock(), createElementBlock("li", _hoisted_8, [
379
- _cache[19] || (_cache[19] = createElementVNode("strong", null, "Style:", -1)),
380
- _cache[20] || (_cache[20] = createTextVNode("\xA0", -1)),
381
- createElementVNode("code", null, toDisplayString(parameter.style), 1)
382
- ])) : createCommentVNode("", true),
383
- typeof parameter.explode === "boolean" ? (openBlock(), createElementBlock("li", _hoisted_9, [
384
- _cache[21] || (_cache[21] = createElementVNode("strong", null, "Explode:", -1)),
385
- _cache[22] || (_cache[22] = createTextVNode("\xA0", -1)),
386
- createElementVNode("code", null, toDisplayString(parameter.explode), 1)
387
- ])) : createCommentVNode("", true),
388
- parameter.allowEmptyValue ? (openBlock(), createElementBlock("li", _hoisted_10, [..._cache[23] || (_cache[23] = [createElementVNode("strong", null, "Allow Empty Value:", -1), createTextVNode("\xA0true", -1)])])) : createCommentVNode("", true),
389
- parameter.allowReserved ? (openBlock(), createElementBlock("li", _hoisted_11, [..._cache[24] || (_cache[24] = [createElementVNode("strong", null, "Allow Reserved:", -1), createTextVNode("\xA0true", -1)])])) : createCommentVNode("", true)
390
- ]),
391
- parameter.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
392
- key: 0,
393
- value: parameter.description
394
- }, null, 8, ["value"])) : createCommentVNode("", true),
395
- resolveSchema(parameter.schema) ? (openBlock(), createBlock(Schema_default, {
396
- key: 1,
397
- schema: resolveSchema(parameter.schema)
398
- }, null, 8, ["schema"])) : createCommentVNode("", true),
399
- parameter.content ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(parameter.content, (parameterContent, mediaType) => {
400
- return openBlock(), createElementBlock(Fragment, { key: mediaType }, [createElementVNode("h6", null, "Content-Type: " + toDisplayString(mediaType), 1), resolveSchema(parameterContent.schema) ? (openBlock(), createBlock(Schema_default, {
401
- key: 0,
402
- schema: resolveSchema(parameterContent.schema)
403
- }, null, 8, ["schema"])) : createCommentVNode("", true)], 64);
404
- }), 128)) : createCommentVNode("", true)
405
- ]);
406
- }), 128))])) : createCommentVNode("", true),
407
- entry.requestBody?.content ? (openBlock(), createElementBlock("section", _hoisted_12, [_cache[27] || (_cache[27] = createElementVNode("h4", null, "Request Body", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.requestBody.content, (bodyContent, mediaType) => {
408
- return openBlock(), createElementBlock(Fragment, { key: mediaType }, [createElementVNode("h5", null, "Content-Type: " + toDisplayString(mediaType), 1), resolveSchema(bodyContent.schema) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
409
- createVNode(Schema_default, { schema: resolveSchema(bodyContent.schema) }, null, 8, ["schema"]),
410
- _cache[26] || (_cache[26] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
411
- createVNode(XmlOrJson_default, {
412
- modelValue: unref(getExampleFromSchema)(resolveSchema(bodyContent.schema), { xml: mediaType?.toString().includes("xml") }),
413
- xml: mediaType?.toString().includes("xml")
414
- }, null, 8, ["modelValue", "xml"])
415
- ], 64)) : createCommentVNode("", true)], 64);
416
- }), 128))])) : createCommentVNode("", true),
417
- entry.responses.length ? (openBlock(), createElementBlock("section", _hoisted_13, [_cache[29] || (_cache[29] = createElementVNode("h4", null, "Responses", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.responses, (entryResponse) => {
418
- return openBlock(), createElementBlock("section", { key: entryResponse.statusCode }, [createElementVNode("header", null, [createElementVNode("h5", null, [createTextVNode(" Status: " + toDisplayString(entryResponse.statusCode) + " ", 1), entryResponse.response.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(entryResponse.response.description), 1)], 64)) : createCommentVNode("", true)])]), entryResponse.response.content ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(entryResponse.response.content, (responseContent, mediaType) => {
419
- return openBlock(), createElementBlock("section", { key: mediaType }, [createElementVNode("h6", null, "Content-Type: " + toDisplayString(mediaType), 1), resolveSchema(responseContent.schema) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
420
- createVNode(Schema_default, { schema: resolveSchema(responseContent.schema) }, null, 8, ["schema"]),
421
- _cache[28] || (_cache[28] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
422
- createVNode(XmlOrJson_default, {
423
- modelValue: unref(getExampleFromSchema)(resolveSchema(responseContent.schema), { xml: mediaType?.toString().includes("xml") }),
424
- xml: mediaType?.toString().includes("xml")
425
- }, null, 8, ["modelValue", "xml"])
426
- ], 64)) : createCommentVNode("", true)]);
427
- }), 128)) : createCommentVNode("", true)]);
428
- }), 128))])) : createCommentVNode("", true)
429
- ]);
430
- }), 128))])) : createCommentVNode("", true),
431
- webhooks.value.length ? (openBlock(), createElementBlock("section", _hoisted_14, [_cache[35] || (_cache[35] = createElementVNode("h2", null, "Webhooks", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(webhooks.value, (webhook) => {
432
- return openBlock(), createElementBlock("section", { key: `${webhook.name}:${webhook.method}` }, [
433
- createElementVNode("header", null, [createElementVNode("h3", null, [webhook.operation.summary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(webhook.operation.summary), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(webhook.name), 1)], 64)), webhook.operation["x-scalar-stability"] ? (openBlock(), createElementBlock("span", _hoisted_15, "(" + toDisplayString(webhook.operation["x-scalar-stability"]) + ")", 1)) : webhook.operation.deprecated ? (openBlock(), createElementBlock("span", _hoisted_16, "⚠️ Deprecated")) : createCommentVNode("", true)])]),
434
- createElementVNode("ul", null, [
435
- createElementVNode("li", null, [_cache[31] || (_cache[31] = createElementVNode("strong", null, "Method:", -1)), createElementVNode("code", null, toDisplayString(webhook.method.toString().toUpperCase()), 1)]),
436
- createElementVNode("li", null, [_cache[32] || (_cache[32] = createElementVNode("strong", null, "Path:", -1)), createElementVNode("code", null, "/webhooks/" + toDisplayString(webhook.name), 1)]),
437
- webhook.operation.tags ? (openBlock(), createElementBlock("li", _hoisted_17, [_cache[33] || (_cache[33] = createElementVNode("strong", null, "Tags:", -1)), createTextVNode(" " + toDisplayString(webhook.operation.tags.join(", ")), 1)])) : createCommentVNode("", true),
438
- webhook.operation.deprecated ? (openBlock(), createElementBlock("li", _hoisted_18, [..._cache[34] || (_cache[34] = [createElementVNode("strong", null, "Deprecated", -1)])])) : createCommentVNode("", true)
439
- ]),
440
- createVNode(unref(ScalarMarkdown), { value: webhook.operation.description }, null, 8, ["value"])
441
- ]);
442
- }), 128))])) : createCommentVNode("", true),
443
- componentSchemas.value.length ? (openBlock(), createElementBlock("section", _hoisted_19, [_cache[38] || (_cache[38] = createElementVNode("h2", null, "Schemas", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(componentSchemas.value, (entry) => {
444
- return openBlock(), createElementBlock("section", { key: entry.name }, [
445
- createElementVNode("header", null, [createElementVNode("h3", null, toDisplayString(getSchemaView(entry.schema).title ?? entry.name), 1)]),
446
- createElementVNode("ul", null, [createElementVNode("li", null, [_cache[36] || (_cache[36] = createElementVNode("strong", null, "Type:", -1)), createElementVNode("code", null, toDisplayString(getSchemaView(entry.schema).type), 1)])]),
447
- getSchemaView(entry.schema).description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
448
- key: 0,
449
- value: getSchemaView(entry.schema).description
450
- }, null, 8, ["value"])) : createCommentVNode("", true),
451
- getSchemaView(entry.schema).type === "object" ? (openBlock(), createBlock(Schema_default, {
452
- key: 1,
453
- schema: entry.schema
454
- }, null, 8, ["schema"])) : createCommentVNode("", true),
455
- _cache[37] || (_cache[37] = createElementVNode("p", null, [createElementVNode("strong", null, "Example:")], -1)),
456
- getSchemaView(entry.schema).type === "object" ? (openBlock(), createBlock(XmlOrJson_default, {
457
- key: 2,
458
- modelValue: unref(getExampleFromSchema)(entry.schema)
459
- }, null, 8, ["modelValue"])) : createCommentVNode("", true)
460
- ]);
461
- }), 128))])) : createCommentVNode("", true)
462
- ]);
463
- };
464
- }
465
- });
466
- //#endregion
467
- //#region src/create-markdown-from-openapi.ts
468
- var HTTP_METHODS = [
469
- "get",
470
- "put",
471
- "post",
472
- "delete",
473
- "options",
474
- "head",
475
- "patch",
476
- "trace"
477
- ];
478
- var HTTP_METHOD_SET = new Set(HTTP_METHODS);
479
- var isHttpUrl = (value) => {
480
- try {
481
- const url = new URL(value);
482
- return url.protocol === "http:" || url.protocol === "https:";
483
- } catch {
484
- return false;
485
- }
486
- };
487
- var toWorkspaceInput = (input) => {
488
- if (typeof input !== "string") return { document: input };
489
- const normalized = normalize(input);
490
- if (isObject(normalized)) return { document: normalized };
491
- if (isHttpUrl(input)) return { url: input };
492
- return { path: input };
493
- };
494
- var normalizeHttpMethod = (method) => {
495
- const normalized = method.toLowerCase();
496
- if (HTTP_METHOD_SET.has(normalized)) return normalized;
497
- return null;
498
- };
499
- var normalizeJsonPointer = (pointer) => {
500
- if (pointer.startsWith("#/")) return pointer.slice(1);
501
- if (pointer.startsWith("/")) return pointer;
502
- throw new Error(`Invalid JSON pointer "${pointer}". JSON pointers must start with "#/"`);
503
- };
504
- var parseJsonPointer = (pointer) => normalizeJsonPointer(pointer).slice(1).split("/").map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~"));
505
- var getOperationSelectorFromPointer = (pointer) => {
506
- const segments = parseJsonPointer(pointer);
507
- if (segments.length !== 3 || segments[0] !== "paths") throw new Error(`JSON pointer "${pointer}" must target an operation object under "/paths/{path}/{method}"`);
508
- const path = segments[1];
509
- const method = segments[2];
510
- if (!path || !method) throw new Error(`JSON pointer "${pointer}" must target an operation object under "/paths/{path}/{method}"`);
511
- return {
512
- path,
513
- method
514
- };
515
- };
516
- var getPathEntries = (document) => {
517
- const paths = document.paths;
518
- if (!isObject(paths)) return [];
519
- return Object.entries(paths).flatMap(([path, pathItemRef]) => {
520
- const pathItem = getResolvedPathItem(pathItemRef);
521
- return pathItem ? [[path, pathItem]] : [];
522
- });
523
- };
524
- var filterPathItemToSingleOperation = (pathItem, selectedMethod) => Object.fromEntries(Object.entries(pathItem).filter(([key]) => {
525
- const method = normalizeHttpMethod(key);
526
- return !method || method === selectedMethod;
527
- }));
528
- var findOperationByPathAndMethod = (document, selector) => {
529
- const method = normalizeHttpMethod(selector.method);
530
- if (!method) throw new Error(`Invalid HTTP method "${selector.method}". Supported methods: ${HTTP_METHODS.join(", ")}`);
531
- const pathItemRef = document.paths?.[selector.path];
532
- if (!getPathItemOperation(pathItemRef, method)) throw new Error(`Operation not found for path "${selector.path}" and method "${method.toUpperCase()}"`);
533
- return {
534
- path: selector.path,
535
- method
536
- };
537
- };
538
- var findOperationsByOperationId = (document, operationId) => getPathEntries(document).flatMap(([path, pathItem]) => Object.entries(pathItem).flatMap(([methodKey, operation]) => {
539
- const method = normalizeHttpMethod(methodKey);
540
- if (!method || !isObject(operation)) return [];
541
- if (("operationId" in operation && typeof operation.operationId === "string" ? operation.operationId : void 0) !== operationId) return [];
542
- return [{
543
- path,
544
- method
545
- }];
546
- }));
547
- var resolveOperationMatch = (document, selector) => {
548
- if ("pointer" in selector) return findOperationByPathAndMethod(document, getOperationSelectorFromPointer(selector.pointer));
549
- if ("operationId" in selector) {
550
- const matches = findOperationsByOperationId(document, selector.operationId);
551
- if (!matches.length) throw new Error(`Operation with operationId "${selector.operationId}" was not found`);
552
- if (matches.length > 1) {
553
- const uniqueCandidates = matches.map(({ path, method }) => `"${method.toUpperCase()} ${path}"`);
554
- throw new Error(`Multiple operations found for operationId "${selector.operationId}". Use { path, method } instead. Matches: ${uniqueCandidates.join(", ")}`);
555
- }
556
- return matches[0];
557
- }
558
- return findOperationByPathAndMethod(document, selector);
559
- };
560
- var filterDocumentByOperation = (document, selector) => {
561
- const match = resolveOperationMatch(document, selector);
562
- const pathItem = getPathEntries(document).find(([path]) => path === match.path)?.[1];
563
- if (!pathItem) throw new Error(`Operation not found for path "${match.path}" and method "${match.method.toUpperCase()}"`);
564
- return {
565
- ...document,
566
- paths: { [match.path]: filterPathItemToSingleOperation(pathItem, match.method) }
567
- };
568
- };
569
- async function createHtmlFromOpenApi(input, options) {
570
- const workspaceStore = createWorkspaceStore({ fileLoader: readFiles() });
571
- const name = "openapi-to-markdown";
572
- if (!await workspaceStore.addDocument({
573
- name,
574
- ...toWorkspaceInput(input)
575
- })) throw new Error("Failed to load OpenAPI document");
576
- const content = workspaceStore.workspace.documents[name];
577
- if (!content) throw new Error("OpenAPI document could not be resolved");
578
- return minify(await renderToString(createSSRApp(MarkdownReference_default, { content: options?.operation && isObject(content) ? filterDocumentByOperation(content, options.operation) : content })), {
579
- removeComments: true,
580
- removeEmptyElements: true,
581
- collapseWhitespace: true,
582
- continueOnParseError: true,
583
- noNewlinesBeforeTagClose: true,
584
- preserveLineBreaks: true,
585
- removeEmptyAttributes: true,
586
- decodeEntities: true,
587
- useShortDoctype: true
588
- });
589
- }
590
- async function createMarkdownFromOpenApi(content, options) {
591
- return markdownFromHtml(await createHtmlFromOpenApi(content, options));
592
- }
593
- async function markdownFromHtml(html) {
594
- const file = await unified().use(rehypeParse, { fragment: true }).use(remarkGfm).use(rehypeSanitize).use(rehypeRemark).use(remarkStringify, { bullet: "-" }).process(html);
595
- return String(file);
596
- }
597
- //#endregion
598
- export { createHtmlFromOpenApi, createMarkdownFromOpenApi };
599
-
600
- //# sourceMappingURL=index.js.map
1
+ export { createHtmlFromOpenApi, createMarkdownFromOpenApi, createOpenApiMarkdownRenderer, } from './create-markdown-from-openapi.js';
@@ -0,0 +1,4 @@
1
+ import { type OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /** Coerce one plain document and keep references linked to shared targets. */
3
+ export declare const loadDocument: (input: OpenApiDocument | Record<string, unknown> | string) => Promise<OpenApiDocument>;
4
+ //# sourceMappingURL=load-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-document.d.ts","sourceRoot":"","sources":["../src/load-document.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,8DAA8D,CAAA;AAyErE,8EAA8E;AAC9E,eAAO,MAAM,YAAY,GACvB,OAAO,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,KACxD,OAAO,CAAC,eAAe,CAoFzB,CAAA"}