@scalar/api-reference 1.37.0 → 1.38.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.
- package/CHANGELOG.md +34 -0
- package/dist/browser/standalone.js +19983 -17826
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +2 -2
- package/dist/components/GettingStarted.vue2.js +22 -22
- package/dist/esm.d.ts +2 -2
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/useApiClient.d.ts +32 -32
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts +2 -2
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.d.ts +2 -2
- package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.js +38 -34
- package/dist/features/multiple-documents/DocumentSelector.vue.d.ts +2 -2
- package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts +4 -4
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.js +2 -2
- package/dist/index.js +1 -1
- package/dist/standalone/lib/html-api.d.ts +3 -3
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/register-globals.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +18 -19
- package/dist/v2/helpers/map-configuration.d.ts +2 -2
- package/package.json +16 -16
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyApiReferenceConfiguration, ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
1
|
+
import type { AnyApiReferenceConfiguration, ApiReferenceConfiguration, ApiReferenceConfigurationWithSource } from '@scalar/types/api-reference';
|
|
2
2
|
import type { OpenAPIV3_1 } from '@scalar/types/legacy';
|
|
3
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
4
|
export type { ApiReferenceConfiguration };
|
|
@@ -9,7 +9,7 @@ export type ReferenceProps = {
|
|
|
9
9
|
* Before the configuration is parsed, we can use the broader types.
|
|
10
10
|
*/
|
|
11
11
|
export type ReferenceLayoutProps = {
|
|
12
|
-
configuration: Partial<
|
|
12
|
+
configuration: Partial<ApiReferenceConfigurationWithSource>;
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
* The OpenAPI 3.1 document, but all $ref's are resolved already.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,YAAY,EAAE,yBAAyB,EAAE,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,OAAO,CAAC,mCAAmC,CAAC,CAAA;I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A;CACnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AA2YA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAsBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAuhBF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AuthSelector.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-780420ba"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as N, useId as M, ref as x, computed as y, useTemplateRef as K, createBlock as D, openBlock as u, unref as n, withCtx as c, createVNode as m, createElementVNode as a, createElementBlock as h, Fragment as k, createTextVNode as C, toDisplayString as v, createCommentVNode as L, withModifiers as z, normalizeClass as j } from "vue";
|
|
2
|
-
import { ViewLayoutCollapse as
|
|
3
|
-
import { useLayout as
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import { getSecurityRequirements as
|
|
2
|
+
import { ViewLayoutCollapse as Y } from "@scalar/api-client/components/ViewLayout";
|
|
3
|
+
import { useLayout as F } from "@scalar/api-client/hooks";
|
|
4
|
+
import { useWorkspace as H } from "@scalar/api-client/store";
|
|
5
|
+
import { getSecurityRequirements as J, formatComplexScheme as P, formatScheme as W, getSchemeOptions as G } from "@scalar/api-client/views/Request/libs";
|
|
6
6
|
import { useModal as Q, ScalarComboboxMultiselect as X, ScalarButton as Z, ScalarListboxCheckbox as _, ScalarIconButton as ee } from "@scalar/components";
|
|
7
7
|
import { safeLocalStorage as te, CLIENT_LS_KEYS as oe } from "@scalar/helpers/object/local-storage";
|
|
8
8
|
import { ScalarIconCaretDown as le, ScalarIconTrash as ne } from "@scalar/icons";
|
|
9
9
|
import { isDefined as re } from "@scalar/oas-utils/helpers";
|
|
10
|
-
import { emitCustomEvent as
|
|
10
|
+
import { emitCustomEvent as w } from "@scalar/workspace-store/events";
|
|
11
11
|
import ae from "./DeleteRequestAuthModal.vue.js";
|
|
12
12
|
import se from "./RequestAuthDataTable.vue.js";
|
|
13
|
-
const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1 truncate" },
|
|
13
|
+
const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1 truncate" }, we = /* @__PURE__ */ N({
|
|
14
14
|
__name: "AuthSelector",
|
|
15
15
|
props: {
|
|
16
16
|
collection: {},
|
|
@@ -25,10 +25,10 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
25
25
|
workspace: {}
|
|
26
26
|
},
|
|
27
27
|
setup(r) {
|
|
28
|
-
const { layout:
|
|
28
|
+
const { layout: A } = F(), { securitySchemes: p } = H(), R = M(), S = x(null), d = Q(), b = x(
|
|
29
29
|
null
|
|
30
30
|
), V = x(!1), q = y(() => {
|
|
31
|
-
const t =
|
|
31
|
+
const t = J(r.operation, r.collection);
|
|
32
32
|
return { filteredRequirements: t.filter((o) => Object.keys(o).length), requirements: t };
|
|
33
33
|
}), g = y(() => {
|
|
34
34
|
const { filteredRequirements: t, requirements: e } = q.value;
|
|
@@ -41,10 +41,10 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
41
41
|
}), s = y(
|
|
42
42
|
() => r.selectedSecuritySchemeUids.map((t) => {
|
|
43
43
|
if (Array.isArray(t))
|
|
44
|
-
return
|
|
44
|
+
return P(t, p);
|
|
45
45
|
const e = p[t ?? ""];
|
|
46
46
|
if (e)
|
|
47
|
-
return
|
|
47
|
+
return W(e);
|
|
48
48
|
}).filter(re)
|
|
49
49
|
);
|
|
50
50
|
function T(t) {
|
|
@@ -52,13 +52,13 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
52
52
|
const i = l.split(",");
|
|
53
53
|
return i.length > 1 ? i : l;
|
|
54
54
|
});
|
|
55
|
-
e?.payload && (
|
|
55
|
+
e?.payload && (w(f.value?.$el, "scalar-add-auth-option", {
|
|
56
56
|
payload: e.payload
|
|
57
57
|
}), e.payload.uid && o.push(e.payload.uid)), O(o);
|
|
58
58
|
}
|
|
59
59
|
const O = (t) => {
|
|
60
60
|
if (r.collection.useCollectionSecurity) {
|
|
61
|
-
if (
|
|
61
|
+
if (w(f.value?.$el, "scalar-select-security-schemes", {
|
|
62
62
|
uids: t
|
|
63
63
|
}), !r.persistAuth)
|
|
64
64
|
return;
|
|
@@ -67,7 +67,7 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
67
67
|
oe.SELECTED_SECURITY_SCHEMES,
|
|
68
68
|
JSON.stringify(e)
|
|
69
69
|
);
|
|
70
|
-
} else r.operation?.uid &&
|
|
70
|
+
} else r.operation?.uid && w(
|
|
71
71
|
f.value?.$el,
|
|
72
72
|
"scalar-select-operation-security-schemes",
|
|
73
73
|
{
|
|
@@ -92,12 +92,12 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
92
92
|
q.value.filteredRequirements,
|
|
93
93
|
r.collection?.securitySchemes ?? [],
|
|
94
94
|
p,
|
|
95
|
-
|
|
95
|
+
A === "modal" || r.layout === "reference"
|
|
96
96
|
)
|
|
97
97
|
), B = (t) => {
|
|
98
98
|
V.value && t.stopPropagation(), S.value?.$el.click();
|
|
99
99
|
}, f = K("wrapperRef");
|
|
100
|
-
return (t, e) => (u(), D(n(
|
|
100
|
+
return (t, e) => (u(), D(n(Y), {
|
|
101
101
|
ref_key: "wrapperRef",
|
|
102
102
|
ref: f,
|
|
103
103
|
class: "group/params relative",
|
|
@@ -136,7 +136,7 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
136
136
|
selected: l
|
|
137
137
|
}, null, 8, ["selected"]),
|
|
138
138
|
a("div", ce, v(o.label), 1),
|
|
139
|
-
o.isDeletable ?? (n(
|
|
139
|
+
o.isDeletable ?? (n(A) !== "modal" && t.layout !== "reference") ? (u(), D(n(ee), {
|
|
140
140
|
key: 0,
|
|
141
141
|
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
142
142
|
icon: n(ne),
|
|
@@ -150,8 +150,7 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
150
150
|
ref_key: "comboboxButtonRef",
|
|
151
151
|
ref: S,
|
|
152
152
|
"aria-describedby": n(R),
|
|
153
|
-
class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",
|
|
154
|
-
fullWidth: "",
|
|
153
|
+
class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",
|
|
155
154
|
variant: "ghost"
|
|
156
155
|
}, {
|
|
157
156
|
default: c(() => [
|
|
@@ -200,5 +199,5 @@ const ie = ["id"], ue = { class: "flex flex-1" }, ce = { class: "min-w-0 flex-1
|
|
|
200
199
|
}
|
|
201
200
|
});
|
|
202
201
|
export {
|
|
203
|
-
|
|
202
|
+
we as default
|
|
204
203
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
2
2
|
/**
|
|
3
|
-
* Maps a partial
|
|
3
|
+
* Maps a partial ApiReferenceConfigurationWithMultipleSources object to a DocumentConfiguration
|
|
4
4
|
* for use in the API Reference. This function transforms configuration options
|
|
5
5
|
* into the expected structure for the 'x-scalar-reference-config' property.
|
|
6
6
|
*
|
|
@@ -35,7 +35,7 @@ export declare const mapConfiguration: (config: Partial<ApiReferenceConfiguratio
|
|
|
35
35
|
};
|
|
36
36
|
settings: {
|
|
37
37
|
proxyUrl: string | undefined;
|
|
38
|
-
searchKey: "a" | "b" | "i" | "p" | "q" | "s" | "u" | "g" | "c" | "
|
|
38
|
+
searchKey: "a" | "b" | "i" | "p" | "q" | "s" | "u" | "g" | "c" | "d" | "e" | "f" | "h" | "j" | "k" | "l" | "m" | "n" | "o" | "r" | "t" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
39
39
|
baseServerUrl: string | undefined;
|
|
40
40
|
servers: any[] | undefined;
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.
|
|
23
|
+
"version": "1.38.0",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
},
|
|
@@ -56,27 +56,27 @@
|
|
|
56
56
|
"type-fest": "^4.41.0",
|
|
57
57
|
"vue": "^3.5.17",
|
|
58
58
|
"zod": "4.1.11",
|
|
59
|
-
"@scalar/api-client": "2.7.0",
|
|
60
|
-
"@scalar/helpers": "0.0.11",
|
|
61
|
-
"@scalar/components": "0.14.40",
|
|
62
|
-
"@scalar/icons": "0.4.7",
|
|
63
59
|
"@scalar/code-highlight": "0.2.0",
|
|
60
|
+
"@scalar/api-client": "2.8.0",
|
|
61
|
+
"@scalar/components": "0.15.0",
|
|
62
|
+
"@scalar/helpers": "0.0.11",
|
|
64
63
|
"@scalar/json-magic": "0.6.0",
|
|
65
|
-
"@scalar/oas-utils": "0.5.
|
|
64
|
+
"@scalar/oas-utils": "0.5.1",
|
|
65
|
+
"@scalar/icons": "0.4.7",
|
|
66
|
+
"@scalar/openapi-parser": "0.22.2",
|
|
66
67
|
"@scalar/object-utils": "1.2.7",
|
|
67
|
-
"@scalar/openapi-types": "0.4.
|
|
68
|
-
"@scalar/
|
|
69
|
-
"@scalar/
|
|
70
|
-
"@scalar/themes": "0.13.20",
|
|
71
|
-
"@scalar/types": "0.3.0",
|
|
72
|
-
"@scalar/openapi-upgrader": "0.1.1",
|
|
68
|
+
"@scalar/openapi-types": "0.4.1",
|
|
69
|
+
"@scalar/snippetz": "0.5.0",
|
|
70
|
+
"@scalar/themes": "0.13.21",
|
|
73
71
|
"@scalar/use-hooks": "0.2.5",
|
|
72
|
+
"@scalar/openapi-upgrader": "0.1.2",
|
|
73
|
+
"@scalar/types": "0.3.1",
|
|
74
74
|
"@scalar/use-toasts": "0.8.0",
|
|
75
|
-
"@scalar/workspace-store": "0.
|
|
75
|
+
"@scalar/workspace-store": "0.17.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@hono/node-server": "^1.11.0",
|
|
79
|
-
"@playwright/test": "1.
|
|
79
|
+
"@playwright/test": "1.56.0",
|
|
80
80
|
"@tailwindcss/vite": "^4.1.7",
|
|
81
81
|
"@types/react": "^19.1.8",
|
|
82
82
|
"@types/react-dom": "^19.1.6",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"vite-plugin-banner": "^0.7.1",
|
|
93
93
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
94
94
|
"vitest": "3.2.4",
|
|
95
|
+
"@scalar/core": "0.3.19",
|
|
95
96
|
"@scalar/build-tooling": "0.2.7",
|
|
96
|
-
"@scalar/core": "0.3.18",
|
|
97
97
|
"@scalar/galaxy": "0.5.8",
|
|
98
98
|
"@scalar/react-renderer": "0.2.1"
|
|
99
99
|
},
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"test:benchmark:compare": "vitest bench --compare test-results/test-benchmark.json",
|
|
116
116
|
"test:benchmark:save": "vitest bench --outputJson test-results/test-benchmark.json",
|
|
117
117
|
"test:e2e": "playwright test",
|
|
118
|
-
"test:e2e:playwright": "docker run --network=host -e PORT=5001 -p 5001:5001 scalarapi/playwright:1.
|
|
118
|
+
"test:e2e:playwright": "docker run --network=host -e PORT=5001 -p 5001:5001 scalarapi/playwright:1.56.0",
|
|
119
119
|
"test:e2e:report": "playwright show-report",
|
|
120
120
|
"test:e2e:snapshots": "PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:5001/ playwright test -c playwright.snapshots.config.ts",
|
|
121
121
|
"test:e2e:snapshots:ci": "playwright test -c playwright.snapshots.config.ts",
|