sourcey 3.4.8 → 3.4.10
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.
|
@@ -23,7 +23,7 @@ function statusColorClass(code) {
|
|
|
23
23
|
export function ResponsesCopy({ responses }) {
|
|
24
24
|
if (!responses.length)
|
|
25
25
|
return null;
|
|
26
|
-
return (_jsx("div", { class: "params-list", children: responses.map((r) => (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header font-mono text-sm", children: [_jsx("span", { class: `px-1.5 py-0.5 rounded-md text-xs font-bold ${statusColorClass(r.statusCode)}`, children: r.statusCode }), _jsx("span", { class: "font-medium text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: httpStatusText(r.statusCode) }), r.content && (_jsx("span", { class: "param-type", children: renderResponseType(r) }))] }), r.description && (_jsx("div", { class: "param-description", children: _jsx(Markdown, { content: r.description }) }))] }, r.statusCode))) }));
|
|
26
|
+
return (_jsx("div", { class: "params-list", children: responses.map((r) => (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header font-mono text-sm", children: [_jsx("span", { class: `px-1.5 py-0.5 rounded-md text-xs font-bold ${statusColorClass(r.statusCode)}`, children: r.statusCode }), _jsx("span", { class: "font-medium text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: httpStatusText(r.statusCode) }), r.content && (_jsx("span", { class: "param-type", children: renderResponseType(r) }))] }), r.description && (_jsx("div", { class: "param-description", children: _jsx(Markdown, { content: r.description, class: "prose-sm" }) }))] }, r.statusCode))) }));
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Response examples with status code tabs on the code block card.
|
|
@@ -15,7 +15,7 @@ export function SecurityCopy({ security }) {
|
|
|
15
15
|
return null;
|
|
16
16
|
return (_jsxs("div", { class: "mt-6", children: [_jsx(SectionLabel, { children: "Authorization" }), _jsx("div", { children: security.map((req, i) => (_jsx("div", { class: "params-list", children: Object.entries(req).map(([name, scopes]) => {
|
|
17
17
|
const scheme = spec.securitySchemes[name];
|
|
18
|
-
return (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), scheme && (_jsx("span", { class: "param-type", children: _jsxs("span", { class: "json-property-type", children: [scheme.type, scheme.scheme && ` (${scheme.scheme})`, scheme.in && ` in ${scheme.in}`] }) }))] }), (scheme?.description || scopes.length > 0) && (_jsxs("div", { class: "param-description", children: [scheme?.description && _jsx(Markdown, { content: scheme.description }), scopes.length > 0 && (_jsxs("p", { class: "mt-1", children: ["Scopes: ", _jsx("code", { class: "text-xs font-medium", children: scopes.join(", ") })] }))] }))] }, name));
|
|
18
|
+
return (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), scheme && (_jsx("span", { class: "param-type", children: _jsxs("span", { class: "json-property-type", children: [scheme.type, scheme.scheme && ` (${scheme.scheme})`, scheme.in && ` in ${scheme.in}`] }) }))] }), (scheme?.description || scopes.length > 0) && (_jsxs("div", { class: "param-description", children: [scheme?.description && _jsx(Markdown, { content: scheme.description, class: "prose-sm" }), scopes.length > 0 && (_jsxs("p", { class: "mt-1", children: ["Scopes: ", _jsx("code", { class: "text-xs font-medium", children: scopes.join(", ") })] }))] }))] }, name));
|
|
19
19
|
}) }, i))) })] }));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -26,5 +26,5 @@ export function SecurityDefinitions() {
|
|
|
26
26
|
const schemes = Object.entries(spec.securitySchemes);
|
|
27
27
|
if (!schemes.length)
|
|
28
28
|
return null;
|
|
29
|
-
return (_jsxs("div", { id: "authentication", class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": "authentication", children: [_jsx("h2", { class: "text-xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))] mb-4", children: "Authentication" }), _jsx("div", { class: "params-list", children: schemes.map(([name, scheme]) => (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), _jsx("span", { class: "param-type", children: _jsx("span", { class: "json-property-type", children: scheme.type }) })] }), _jsxs("div", { class: "param-description", children: [scheme.description && _jsx(Markdown, { content: scheme.description }), scheme.type === "apiKey" && (_jsxs("p", { class: "mt-1", children: ["API Key: ", _jsx("code", { class: "text-xs font-medium", children: scheme.name }), " in ", scheme.in] })), scheme.type === "http" && (_jsxs("p", { class: "mt-1", children: ["Scheme: ", scheme.scheme, scheme.bearerFormat && ` (${scheme.bearerFormat})`] })), scheme.type === "oauth2" && scheme.flows && (_jsx("div", { class: "mt-2 space-y-4", children: Object.entries(scheme.flows).map(([flowType, flow]) => (_jsxs("div", { children: [_jsx("strong", { class: "text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: flowType }), _jsxs("dl", { class: "mt-2 text-sm", children: [flow?.authorizationUrl && (_jsxs(_Fragment, { children: [_jsx("dt", { class: "text-[rgb(var(--color-gray-500))] mt-2", children: "Authorization URL" }), _jsx("dd", { children: _jsx("code", { class: "text-xs", children: flow.authorizationUrl }) })] })), flow?.tokenUrl && (_jsxs(_Fragment, { children: [_jsx("dt", { class: "text-[rgb(var(--color-gray-500))] mt-2", children: "Token URL" }), _jsx("dd", { children: _jsx("code", { class: "text-xs", children: flow.tokenUrl }) })] }))] }), flow?.scopes && Object.keys(flow.scopes).length > 0 && (_jsxs("div", { class: "mt-3", children: [_jsx("span", { class: "text-sm text-[rgb(var(--color-gray-500))]", children: "Scopes" }), _jsx("ul", { class: "mt-1 space-y-1", children: Object.entries(flow.scopes).map(([s, desc]) => (_jsxs("li", { class: "text-sm", children: [_jsx("code", { class: "text-xs font-medium text-[rgb(var(--color-gray-800))] dark:text-[rgb(var(--color-gray-200))]", children: s }), _jsxs("span", { class: "text-[rgb(var(--color-gray-500))] ml-2", children: ["\u2014 ", desc] })] }, s))) })] }))] }, flowType))) })), scheme.type === "openIdConnect" && scheme.openIdConnectUrl && (_jsxs("p", { class: "mt-1", children: ["OpenID Connect:", " ", _jsx("a", { href: scheme.openIdConnectUrl, class: "text-[rgb(var(--color-primary-ink))] dark:text-[rgb(var(--color-primary-light))]", children: scheme.openIdConnectUrl })] }))] })] }, name))) })] }));
|
|
29
|
+
return (_jsxs("div", { id: "authentication", class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": "authentication", children: [_jsx("h2", { class: "text-xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))] mb-4", children: "Authentication" }), _jsx("div", { class: "params-list", children: schemes.map(([name, scheme]) => (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), _jsx("span", { class: "param-type", children: _jsx("span", { class: "json-property-type", children: scheme.type }) })] }), _jsxs("div", { class: "param-description", children: [scheme.description && _jsx(Markdown, { content: scheme.description, class: "prose-sm" }), scheme.type === "apiKey" && (_jsxs("p", { class: "mt-1", children: ["API Key: ", _jsx("code", { class: "text-xs font-medium", children: scheme.name }), " in ", scheme.in] })), scheme.type === "http" && (_jsxs("p", { class: "mt-1", children: ["Scheme: ", scheme.scheme, scheme.bearerFormat && ` (${scheme.bearerFormat})`] })), scheme.type === "oauth2" && scheme.flows && (_jsx("div", { class: "mt-2 space-y-4", children: Object.entries(scheme.flows).map(([flowType, flow]) => (_jsxs("div", { children: [_jsx("strong", { class: "text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: flowType }), _jsxs("dl", { class: "mt-2 text-sm", children: [flow?.authorizationUrl && (_jsxs(_Fragment, { children: [_jsx("dt", { class: "text-[rgb(var(--color-gray-500))] mt-2", children: "Authorization URL" }), _jsx("dd", { children: _jsx("code", { class: "text-xs", children: flow.authorizationUrl }) })] })), flow?.tokenUrl && (_jsxs(_Fragment, { children: [_jsx("dt", { class: "text-[rgb(var(--color-gray-500))] mt-2", children: "Token URL" }), _jsx("dd", { children: _jsx("code", { class: "text-xs", children: flow.tokenUrl }) })] }))] }), flow?.scopes && Object.keys(flow.scopes).length > 0 && (_jsxs("div", { class: "mt-3", children: [_jsx("span", { class: "text-sm text-[rgb(var(--color-gray-500))]", children: "Scopes" }), _jsx("ul", { class: "mt-1 space-y-1", children: Object.entries(flow.scopes).map(([s, desc]) => (_jsxs("li", { class: "text-sm", children: [_jsx("code", { class: "text-xs font-medium text-[rgb(var(--color-gray-800))] dark:text-[rgb(var(--color-gray-200))]", children: s }), _jsxs("span", { class: "text-[rgb(var(--color-gray-500))] ml-2", children: ["\u2014 ", desc] })] }, s))) })] }))] }, flowType))) })), scheme.type === "openIdConnect" && scheme.openIdConnectUrl && (_jsxs("p", { class: "mt-1", children: ["OpenID Connect:", " ", _jsx("a", { href: scheme.openIdConnectUrl, class: "text-[rgb(var(--color-primary-ink))] dark:text-[rgb(var(--color-primary-light))]", children: scheme.openIdConnectUrl })] }))] })] }, name))) })] }));
|
|
30
30
|
}
|
|
@@ -24,12 +24,12 @@ export function SchemaView({ schema, requiredFields, depth = 0, maxDepth = MAX_D
|
|
|
24
24
|
// Object with properties
|
|
25
25
|
if (schema.properties) {
|
|
26
26
|
const required = new Set(schema.required ?? requiredFields ?? []);
|
|
27
|
-
return (_jsxs("div", { children: [schema.description && (_jsx("div", { class: "schema-description", children: _jsx(Markdown, { content: schema.description }) })), _jsx("div", { class: "params-list", children: Object.entries(schema.properties).map(([name, prop]) => (_jsx(PropertyRow, { name: name, schema: prop, required: required.has(name), depth: depth, maxDepth: maxDepth }, name))) }), schema.additionalProperties &&
|
|
27
|
+
return (_jsxs("div", { children: [depth === 0 && schema.description && (_jsx("div", { class: "schema-description", children: _jsx(Markdown, { content: schema.description }) })), _jsx("div", { class: "params-list", children: Object.entries(schema.properties).map(([name, prop]) => (_jsx(PropertyRow, { name: name, schema: prop, required: required.has(name), depth: depth, maxDepth: maxDepth }, name))) }), schema.additionalProperties &&
|
|
28
28
|
typeof schema.additionalProperties !== "boolean" && (_jsx("div", { class: "param-item", children: _jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: "[key: string]" }), _jsx("span", { class: "param-type", children: _jsx(SchemaDatatype, { schema: schema.additionalProperties }) })] }) }))] }));
|
|
29
29
|
}
|
|
30
30
|
// Array
|
|
31
31
|
if (schema.type === "array" && schema.items) {
|
|
32
|
-
return (_jsxs("div", { children: [schema.description && (_jsx("div", { class: "schema-description", children: _jsx(Markdown, { content: schema.description }) })), _jsx("div", { class: "schema-array-info", children: _jsx(SchemaDatatype, { schema: schema }) }), schema.items.properties && (_jsxs("details", { class: "schema-expandable", children: [_jsxs("summary", { class: "schema-expandable-toggle", children: [_jsx("svg", { class: "schema-expandable-icon", viewBox: "0 0 256 512", width: "8", height: "8", children: _jsx("path", { fill: "currentColor", d: "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z" }) }), "Show child attributes"] }), _jsx("div", { class: "schema-expandable-content", children: _jsx(SchemaView, { schema: schema.items, depth: depth + 1, maxDepth: maxDepth }) })] }))] }));
|
|
32
|
+
return (_jsxs("div", { children: [depth === 0 && schema.description && (_jsx("div", { class: "schema-description", children: _jsx(Markdown, { content: schema.description }) })), _jsx("div", { class: "schema-array-info", children: _jsx(SchemaDatatype, { schema: schema }) }), schema.items.properties && (_jsxs("details", { class: "schema-expandable", children: [_jsxs("summary", { class: "schema-expandable-toggle", children: [_jsx("svg", { class: "schema-expandable-icon", viewBox: "0 0 256 512", width: "8", height: "8", children: _jsx("path", { fill: "currentColor", d: "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z" }) }), "Show child attributes"] }), _jsx("div", { class: "schema-expandable-content", children: _jsx(SchemaView, { schema: schema.items, depth: depth + 1, maxDepth: maxDepth }) })] }))] }));
|
|
33
33
|
}
|
|
34
34
|
// Simple type
|
|
35
35
|
return (_jsxs("div", { children: [schema.description && (_jsx("div", { class: "schema-description", children: _jsx(Markdown, { content: schema.description }) })), _jsx(SchemaDatatype, { schema: schema })] }));
|
|
@@ -39,5 +39,5 @@ function PropertyRow({ name, schema, required, depth, maxDepth, }) {
|
|
|
39
39
|
(schema.type === "array" &&
|
|
40
40
|
schema.items &&
|
|
41
41
|
(schema.items.properties || schema.items.allOf || schema.items.oneOf || schema.items.anyOf));
|
|
42
|
-
return (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), _jsx("span", { class: "param-type", children: _jsx(SchemaDatatype, { schema: schema }) }), required && _jsx(RequiredBadge, {}), schema.readOnly && _jsx(ReadOnlyBadge, {}), schema.writeOnly && _jsx(Badge, { children: "write only" }), schema.deprecated && _jsx(DeprecatedBadge, {})] }), schema.description && (_jsx("div", { class: "param-description", children: _jsx(Markdown, { content: schema.description }) })), hasInner && (_jsxs("details", { class: "schema-expandable", children: [_jsxs("summary", { class: "schema-expandable-toggle", children: [_jsx("svg", { class: "schema-expandable-icon", viewBox: "0 0 256 512", width: "8", height: "8", children: _jsx("path", { fill: "currentColor", d: "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z" }) }), "Show child attributes"] }), _jsx("div", { class: "schema-expandable-content", children: _jsx(SchemaView, { schema: schema.type === "array" && schema.items ? schema.items : schema, depth: depth + 1, maxDepth: maxDepth }) })] }))] }));
|
|
42
|
+
return (_jsxs("div", { class: "param-item", children: [_jsxs("div", { class: "param-header", children: [_jsx("code", { class: "param-name", children: name }), _jsx("span", { class: "param-type", children: _jsx(SchemaDatatype, { schema: schema }) }), required && _jsx(RequiredBadge, {}), schema.readOnly && _jsx(ReadOnlyBadge, {}), schema.writeOnly && _jsx(Badge, { children: "write only" }), schema.deprecated && _jsx(DeprecatedBadge, {})] }), schema.description && (_jsx("div", { class: "param-description", children: _jsx(Markdown, { content: schema.description, class: "prose-sm" }) })), hasInner && (_jsxs("details", { class: "schema-expandable", children: [_jsxs("summary", { class: "schema-expandable-toggle", children: [_jsx("svg", { class: "schema-expandable-icon", viewBox: "0 0 256 512", width: "8", height: "8", children: _jsx("path", { fill: "currentColor", d: "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z" }) }), "Show child attributes"] }), _jsx("div", { class: "schema-expandable-content", children: _jsx(SchemaView, { schema: schema.type === "array" && schema.items ? schema.items : schema, depth: depth + 1, maxDepth: maxDepth }) })] }))] }));
|
|
43
43
|
}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE;QACP,OAAO,C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oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAsBD,wBAAsB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAwBtE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAiB/D;AAMD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA0BzG;AAsLD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO5C"}
|
package/dist/config.js
CHANGED
|
@@ -90,6 +90,9 @@ export async function resolveConfigFromRaw(raw, configDir) {
|
|
|
90
90
|
},
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
+
function isUrl(source) {
|
|
94
|
+
return source.startsWith("http://") || source.startsWith("https://");
|
|
95
|
+
}
|
|
93
96
|
const VALID_PRESETS = ["default", "minimal", "api-first"];
|
|
94
97
|
function resolveTheme(raw, configDir) {
|
|
95
98
|
const preset = raw.theme?.preset ?? "default";
|
|
@@ -145,14 +148,24 @@ async function resolveTabs(tabs, configDir) {
|
|
|
145
148
|
throw new Error(`Tab "${tab.tab}" needs one of "openapi", "groups", "doxygen", or "mcp"`);
|
|
146
149
|
}
|
|
147
150
|
if (tab.openapi) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
if (isUrl(tab.openapi)) {
|
|
152
|
+
resolved.push({ label: tab.tab, slug, openapi: tab.openapi });
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const absPath = resolve(configDir, tab.openapi);
|
|
156
|
+
await assertExists(absPath, `OpenAPI spec "${tab.openapi}" in tab "${tab.tab}"`);
|
|
157
|
+
resolved.push({ label: tab.tab, slug, openapi: absPath });
|
|
158
|
+
}
|
|
151
159
|
}
|
|
152
160
|
else if (tab.mcp) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
161
|
+
if (isUrl(tab.mcp)) {
|
|
162
|
+
resolved.push({ label: tab.tab, slug, mcp: tab.mcp });
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const absPath = resolve(configDir, tab.mcp);
|
|
166
|
+
await assertExists(absPath, `MCP spec "${tab.mcp}" in tab "${tab.tab}"`);
|
|
167
|
+
resolved.push({ label: tab.tab, slug, mcp: absPath });
|
|
168
|
+
}
|
|
156
169
|
}
|
|
157
170
|
else if (tab.doxygen) {
|
|
158
171
|
const absXml = resolve(configDir, tab.doxygen.xml);
|