@scalar/api-client 2.17.3 → 2.17.4
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 +40 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +15 -10
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +70 -55
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +12 -8
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +3 -5
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +31 -31
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +4 -6
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +20 -21
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +22 -16
- package/dist/v2/blocks/operation-block/helpers/send-request.js +26 -26
- package/dist/v2/blocks/operation-block/index.d.ts +1 -0
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +4 -2
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +9 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +81 -88
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -4
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +11 -9
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +3 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +59 -63
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +78 -74
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +3 -3
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +43 -42
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +96 -86
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +8 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +33 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +13 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +3 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +8 -2
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +25 -24
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +34 -33
- package/dist/v2/features/app/helpers/routes.d.ts +2 -0
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +29 -29
- package/dist/v2/features/collection/DocumentCollection.vue.js +4 -3
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +8 -7
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +7 -6
- package/dist/v2/features/collection/components/Cookies.vue.js +1 -0
- package/dist/v2/features/collection/components/Environment.vue.js +1 -0
- package/dist/v2/features/collection/components/Overview.vue2.js +8 -7
- package/dist/v2/features/collection/components/Servers.vue.js +25 -24
- package/dist/v2/features/collection/components/Settings.vue.js +8 -7
- package/dist/v2/features/modal/Modal.vue.d.ts +6 -0
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +66 -62
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +16 -16
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +36 -29
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +25 -12
- package/dist/v2/features/modal/index.d.ts +2 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/modal/index.js +3 -1
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +54 -62
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.js +2 -2
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -2
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.js +11 -11
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts +10 -0
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-selected-server.js +4 -0
- package/dist/v2/features/operation/index.d.ts +3 -0
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/operation/index.js +8 -2
- package/dist/v2/helpers/index.d.ts +3 -0
- package/dist/v2/helpers/index.d.ts.map +1 -0
- package/dist/v2/helpers/index.js +4 -0
- package/dist/v2/helpers/plugins.d.ts +7 -1
- package/dist/v2/helpers/plugins.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +22 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-workspace-client-modal-events.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/hooks/use-workspace-client-modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAuBvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,kFAO3C;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,EAAE,cAAc,CAAA;CAC/B,
|
|
1
|
+
{"version":3,"file":"use-workspace-client-modal-events.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/hooks/use-workspace-client-modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAuBvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,kFAO3C;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,EAAE,cAAc,CAAA;CAC/B,SAyFA,CAAA"}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
|
-
import { deleteSecurityScheme as d, updateSelectedAuthTab as i, updateSecurityScheme as u, updateSelectedScopes as
|
|
2
|
-
const
|
|
1
|
+
import { deleteSecurityScheme as d, updateSelectedAuthTab as i, updateSecurityScheme as u, updateSelectedScopes as n, updateSelectedSecuritySchemes as h, addServer as s, updateServer as c, deleteServer as v, updateServerVariables as m, updateSelectedServer as S, addOperationParameter as y, updateOperationParameter as w, deleteOperationParameter as R, deleteAllOperationParameters as q, updateOperationRequestBodyContentType as O, updateOperationRequestBodyExample as f, addOperationRequestBodyFormRow as x, updateOperationRequestBodyFormRow as g, deleteOperationRequestBodyFormRow as P, updateSelectedClient as k } from "@scalar/workspace-store/mutators";
|
|
2
|
+
const E = ({
|
|
3
3
|
eventBus: a,
|
|
4
4
|
document: r,
|
|
5
|
-
isSidebarOpen:
|
|
5
|
+
isSidebarOpen: l,
|
|
6
6
|
sidebarState: t,
|
|
7
|
-
modalState:
|
|
7
|
+
modalState: o,
|
|
8
8
|
workspaceStore: p
|
|
9
9
|
}) => {
|
|
10
|
-
a.on("scroll-to:nav-item", ({ id: e }) => t.handleSelectItem(e)), a.on("auth:delete:security-scheme", (e) => d(r.value, e)), a.on("auth:update:active-index", (e) => i(r.value, e)), a.on("auth:update:security-scheme", (e) => u(r.value, e)), a.on("auth:update:selected-scopes", (e) =>
|
|
10
|
+
a.on("scroll-to:nav-item", ({ id: e }) => t.handleSelectItem(e)), a.on("auth:delete:security-scheme", (e) => d(r.value, e)), a.on("auth:update:active-index", (e) => i(r.value, e)), a.on("auth:update:security-scheme", (e) => u(r.value, e)), a.on("auth:update:selected-scopes", (e) => n(r.value, e)), a.on(
|
|
11
11
|
"auth:update:selected-security-schemes",
|
|
12
|
-
async (e) => await
|
|
13
|
-
), a.on("server:add:server", () =>
|
|
12
|
+
async (e) => await h(r.value, e)
|
|
13
|
+
), a.on("server:add:server", () => s(r.value)), a.on("server:update:server", (e) => c(r.value, e)), a.on("server:delete:server", (e) => v(r.value, e)), a.on("server:update:variables", (e) => m(r.value, e)), a.on("server:update:selected", (e) => S(r.value, e)), a.on("operation:add:parameter", (e) => y(r.value, e)), a.on("operation:update:parameter", (e) => w(r.value, e)), a.on("operation:delete:parameter", (e) => R(r.value, e)), a.on("operation:delete-all:parameters", (e) => q(r.value, e)), a.on(
|
|
14
14
|
"operation:update:requestBody:contentType",
|
|
15
15
|
(e) => O(r.value, e)
|
|
16
16
|
), a.on("operation:update:requestBody:value", (e) => {
|
|
17
17
|
f(r.value, e);
|
|
18
18
|
}), a.on("operation:add:requestBody:formRow", (e) => {
|
|
19
|
-
|
|
19
|
+
x(r.value, e);
|
|
20
20
|
}), a.on(
|
|
21
21
|
"operation:update:requestBody:formRow",
|
|
22
|
-
(e) =>
|
|
22
|
+
(e) => g(r.value, e)
|
|
23
23
|
), a.on(
|
|
24
24
|
"operation:delete:requestBody:formRow",
|
|
25
|
-
(e) =>
|
|
26
|
-
), a.on("ui:toggle:sidebar", () =>
|
|
25
|
+
(e) => P(r.value, e)
|
|
26
|
+
), a.on("ui:toggle:sidebar", () => l.value = !l.value), a.on("ui:close:client-modal", () => o.hide()), a.on("ui:open:client-modal", (e) => {
|
|
27
|
+
if (!e) {
|
|
28
|
+
o.show();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
"id" in e && e.id ? t.handleSelectItem(e.id) : "method" in e && "path" in e && t.handleSelectItem(
|
|
32
|
+
t.getEntryByLocation({
|
|
33
|
+
document: r.value?.["x-scalar-navigation"]?.id ?? "",
|
|
34
|
+
path: e.path,
|
|
35
|
+
method: e.method,
|
|
36
|
+
example: e.exampleName
|
|
37
|
+
})?.id ?? ""
|
|
38
|
+
), o.show();
|
|
39
|
+
}), a.on("workspace:update:selected-client", (e) => k(p.workspace, e));
|
|
27
40
|
};
|
|
28
41
|
export {
|
|
29
|
-
|
|
42
|
+
E as useWorkspaceClientModalEvents
|
|
30
43
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { createApiClientModal } from './helpers/create-api-client-modal.js';
|
|
1
|
+
export { type ApiClientModal, createApiClientModal } from './helpers/create-api-client-modal.js';
|
|
2
|
+
export { useWorkspaceClientModalEvents } from './hooks/use-workspace-client-modal-events.js';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createApiClientModal as r } from "./helpers/create-api-client-modal.js";
|
|
2
|
+
import { useWorkspaceClientModalEvents as a } from "./hooks/use-workspace-client-modal-events.js";
|
|
2
3
|
export {
|
|
3
|
-
r as createApiClientModal
|
|
4
|
+
r as createApiClientModal,
|
|
5
|
+
a as useWorkspaceClientModalEvents
|
|
4
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA8JA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;AACH,wBAwNC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import x from "../../blocks/operation-block/OperationBlock.vue.js";
|
|
8
|
-
const N = {
|
|
1
|
+
import { defineComponent as i, computed as o, onMounted as d, watch as p, createBlock as h, createElementBlock as v, openBlock as n, unref as l, createElementVNode as y } from "vue";
|
|
2
|
+
import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { getOperationHeader as S } from "./helpers/get-operation-header.js";
|
|
4
|
+
import { getSelectedServer as k } from "./helpers/get-selected-server.js";
|
|
5
|
+
import g from "../../blocks/operation-block/OperationBlock.vue.js";
|
|
6
|
+
const w = {
|
|
9
7
|
key: 1,
|
|
10
8
|
class: "flex h-full w-full items-center justify-center"
|
|
11
|
-
},
|
|
12
|
-
...
|
|
9
|
+
}, B = {}, O = /* @__PURE__ */ i({
|
|
10
|
+
...B,
|
|
13
11
|
__name: "Operation",
|
|
14
12
|
props: {
|
|
15
13
|
documentSlug: {},
|
|
@@ -20,33 +18,30 @@ const N = {
|
|
|
20
18
|
method: {},
|
|
21
19
|
exampleName: {},
|
|
22
20
|
environment: {},
|
|
21
|
+
securitySchemes: {},
|
|
23
22
|
workspaceStore: {},
|
|
24
23
|
activeWorkspace: {},
|
|
25
24
|
plugins: {}
|
|
26
25
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
() =>
|
|
30
|
-
),
|
|
31
|
-
...
|
|
32
|
-
...
|
|
33
|
-
]),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
o,
|
|
42
|
-
(t) => {
|
|
43
|
-
t && e.path && e.method && !B({
|
|
44
|
-
operation: t,
|
|
26
|
+
setup(t) {
|
|
27
|
+
const r = o(
|
|
28
|
+
() => t.path && t.method ? f(t.document?.paths?.[t.path]?.[t.method]) ?? null : null
|
|
29
|
+
), s = o(() => [
|
|
30
|
+
...t.workspaceStore.workspace?.["x-scalar-cookies"] ?? [],
|
|
31
|
+
...t.document?.["x-scalar-cookies"] ?? []
|
|
32
|
+
]), u = o(() => k(t.document));
|
|
33
|
+
d(() => {
|
|
34
|
+
typeof t.document?.["x-scalar-selected-server"] > "u" && t.document?.servers?.[0]?.url && t.eventBus.emit("server:update:selected", { url: t.document.servers[0].url });
|
|
35
|
+
}), p(
|
|
36
|
+
r,
|
|
37
|
+
(e) => {
|
|
38
|
+
e && t.path && t.method && !S({
|
|
39
|
+
operation: e,
|
|
45
40
|
name: "Accept",
|
|
46
41
|
type: "header"
|
|
47
|
-
}) &&
|
|
42
|
+
}) && t.eventBus.emit("operation:add:parameter", {
|
|
48
43
|
type: "header",
|
|
49
|
-
meta: { method:
|
|
44
|
+
meta: { method: t.method, path: t.path, exampleKey: t.exampleName ?? "default" },
|
|
50
45
|
payload: {
|
|
51
46
|
key: "Accept",
|
|
52
47
|
value: "*/*",
|
|
@@ -56,44 +51,41 @@ const N = {
|
|
|
56
51
|
},
|
|
57
52
|
{ immediate: !0 }
|
|
58
53
|
);
|
|
59
|
-
const
|
|
60
|
-
() => C(e.document, o.value)
|
|
61
|
-
), c = a(
|
|
62
|
-
() => R(e.document, o.value, l.value)
|
|
63
|
-
), i = a(() => e.document?.["x-scalar-set-operation-security"] ? {
|
|
54
|
+
const m = o(() => t.document?.["x-scalar-set-operation-security"] ? {
|
|
64
55
|
type: "operation",
|
|
65
|
-
path:
|
|
66
|
-
method:
|
|
56
|
+
path: t.path ?? "",
|
|
57
|
+
method: t.method ?? "get"
|
|
67
58
|
} : {
|
|
68
59
|
type: "document"
|
|
69
|
-
}),
|
|
70
|
-
return (
|
|
60
|
+
}), c = "2.17.4";
|
|
61
|
+
return (e, a) => e.path && e.method && e.exampleName && r.value ? (n(), h(l(g), {
|
|
71
62
|
key: 0,
|
|
72
|
-
appVersion:
|
|
73
|
-
authMeta:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
appVersion: l(c),
|
|
64
|
+
authMeta: m.value,
|
|
65
|
+
documentSecurity: e.document?.security ?? [],
|
|
66
|
+
documentSelectedSecurity: e.document?.["x-scalar-selected-security"],
|
|
67
|
+
documentUrl: e.document?.["x-scalar-original-source-url"],
|
|
68
|
+
environment: e.environment,
|
|
69
|
+
eventBus: e.eventBus,
|
|
70
|
+
exampleKey: e.exampleName,
|
|
71
|
+
globalCookies: s.value,
|
|
79
72
|
history: [],
|
|
80
|
-
httpClients:
|
|
81
|
-
layout:
|
|
82
|
-
method:
|
|
83
|
-
operation:
|
|
84
|
-
path:
|
|
85
|
-
plugins:
|
|
86
|
-
proxyUrl:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
servers: t.document?.servers ?? [],
|
|
73
|
+
httpClients: e.workspaceStore.config["x-scalar-reference-config"]?.httpClients,
|
|
74
|
+
layout: e.layout,
|
|
75
|
+
method: e.method,
|
|
76
|
+
operation: r.value,
|
|
77
|
+
path: e.path,
|
|
78
|
+
plugins: e.plugins,
|
|
79
|
+
proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
|
|
80
|
+
securitySchemes: e.securitySchemes,
|
|
81
|
+
selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
|
|
82
|
+
server: u.value,
|
|
83
|
+
servers: e.document?.servers ?? [],
|
|
84
|
+
setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
|
|
93
85
|
totalPerformedRequests: 0,
|
|
94
|
-
"onUpdate:servers":
|
|
95
|
-
}, null, 8, ["appVersion", "authMeta", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "
|
|
96
|
-
|
|
86
|
+
"onUpdate:servers": a[0] || (a[0] = (C) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
|
|
87
|
+
}, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (n(), v("div", w, [...a[1] || (a[1] = [
|
|
88
|
+
y("span", { class: "text-c-3" }, "Select an operation to view details", -1)
|
|
97
89
|
])]));
|
|
98
90
|
}
|
|
99
91
|
});
|
|
@@ -8,5 +8,5 @@ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/stric
|
|
|
8
8
|
*
|
|
9
9
|
* Otherwise we generally go operation -> document security.
|
|
10
10
|
*/
|
|
11
|
-
export declare const getSecurityRequirements: (
|
|
11
|
+
export declare const getSecurityRequirements: (documentSecurity: OpenApiDocument["security"], operationSecurity?: OperationObject["security"]) => Partial<Record<string, string[]>>[];
|
|
12
12
|
//# sourceMappingURL=get-security-requirements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,kBAAkB,eAAe,CAAC,UAAU,CAAC,EAC7C,oBAAoB,eAAe,CAAC,UAAU,CAAC,wCAShD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = (n, s) => JSON.stringify(s) === "[{}]" && n?.length ? !!n.find((t) => JSON.stringify(t) === "{}") ? n : [...n, {}] : s ?? n ?? [];
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
f as getSecurityRequirements
|
|
4
4
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Get the selected security for an operation or document,
|
|
4
|
+
* Defaults to the first requirement if no selection is made and you pass in requirements
|
|
5
|
+
*/
|
|
6
|
+
export declare const getSelectedSecurity: (documentSelectedSecurity: OpenApiDocument["x-scalar-selected-security"], operationSelectedSecurity: OperationObject["x-scalar-selected-security"], securityRequirements?: NonNullable<OpenApiDocument["security"]>, setOperationSecurity?: boolean) => {
|
|
4
7
|
selectedIndex: number;
|
|
5
8
|
selectedSchemes: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject[];
|
|
6
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAIpH
|
|
1
|
+
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAIpH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,eAAe,CAAC,4BAA4B,CAAC,EACvE,2BAA2B,eAAe,CAAC,4BAA4B,CAAC,EACxE,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,EACnE,8BAA4B;;;CA6B7B,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { isAuthOptional as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
1
|
+
import { isAuthOptional as i } from "../../../blocks/scalar-auth-selector-block/helpers/is-auth-optional.js";
|
|
2
|
+
const c = (e, t, s = [], r = !1) => {
|
|
3
|
+
if (r) {
|
|
4
|
+
if (t)
|
|
5
|
+
return t;
|
|
6
|
+
} else if (e)
|
|
7
|
+
return e;
|
|
8
|
+
const f = i(s), n = s[0];
|
|
9
|
+
return f || !n ? {
|
|
10
10
|
selectedIndex: -1,
|
|
11
11
|
selectedSchemes: []
|
|
12
12
|
} : {
|
|
13
13
|
selectedIndex: 0,
|
|
14
|
-
selectedSchemes: [
|
|
14
|
+
selectedSchemes: [n]
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
c as getSelectedSecurity
|
|
19
19
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
2
|
+
/**
|
|
3
|
+
* Get the selected server for a document,
|
|
4
|
+
* we can later expand this to support operation/path servers as well
|
|
5
|
+
*
|
|
6
|
+
* If x-scalar-selected-server is undefined we select the first server (this means the user has not selected a server yet)
|
|
7
|
+
* If the user has un-selected a server it would be an empty string
|
|
8
|
+
*/
|
|
9
|
+
export declare const getSelectedServer: (document: WorkspaceDocument | null) => import("@scalar/workspace-store/schemas/v3.1/strict/server").ServerObject | null;
|
|
10
|
+
//# sourceMappingURL=get-selected-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-selected-server.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,iBAAiB,GAAG,IAAI,qFAQnE,CAAA"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
export { getSecurityRequirements } from './helpers/get-security-requirements.js';
|
|
2
|
+
export { getSelectedSecurity } from './helpers/get-selected-security.js';
|
|
3
|
+
export { getSelectedServer } from './helpers/get-selected-server.js';
|
|
1
4
|
export { default as Operation } from './Operation.vue.js';
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSecurityRequirements as t } from "./helpers/get-security-requirements.js";
|
|
2
|
+
import { getSelectedSecurity as f } from "./helpers/get-selected-security.js";
|
|
3
|
+
import { getSelectedServer as p } from "./helpers/get-selected-server.js";
|
|
4
|
+
import { default as c } from "./Operation.vue.js";
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
c as Operation,
|
|
7
|
+
t as getSecurityRequirements,
|
|
8
|
+
f as getSelectedSecurity,
|
|
9
|
+
p as getSelectedServer
|
|
4
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -2,7 +2,13 @@ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/stric
|
|
|
2
2
|
import type { Component } from 'vue';
|
|
3
3
|
/** A type representing the hooks that a client plugin can define */
|
|
4
4
|
export type ClientPluginHooks = {
|
|
5
|
-
beforeRequest: (payload:
|
|
5
|
+
beforeRequest: (payload: {
|
|
6
|
+
request: Request;
|
|
7
|
+
}) => {
|
|
8
|
+
request: Request;
|
|
9
|
+
} | Promise<{
|
|
10
|
+
request: Request;
|
|
11
|
+
}>;
|
|
6
12
|
responseReceived: (payload: {
|
|
7
13
|
response: Response;
|
|
8
14
|
request: Request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACtG,gBAAgB,EAAE,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,QAAQ,CAAA;QAClB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,KAAK,cAAc,GAAG;KACnB,CAAC,IAAI,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,SAAS,MAAM,cAAc,EAC9D,SAAS,cAAc,CAAC,CAAC,CAAC,EAC1B,UAAU,CAAC,EACX,SAAS,YAAY,EAAE,KACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAY3B,CAAA"}
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (o) => {
|
|
35
35
|
o?.createNew && g.name === "request" && d();
|
|
36
|
-
}, v = "2.17.
|
|
36
|
+
}, v = "2.17.4";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.17.
|
|
21
|
+
"version": "2.17.4",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -256,6 +256,11 @@
|
|
|
256
256
|
"types": "./dist/v2/features/settings/index.d.ts",
|
|
257
257
|
"default": "./dist/v2/features/settings/index.js"
|
|
258
258
|
},
|
|
259
|
+
"./v2/helpers": {
|
|
260
|
+
"import": "./dist/v2/helpers/index.js",
|
|
261
|
+
"types": "./dist/v2/helpers/index.d.ts",
|
|
262
|
+
"default": "./dist/v2/helpers/index.js"
|
|
263
|
+
},
|
|
259
264
|
"./views/Components/CodeSnippet": {
|
|
260
265
|
"import": "./dist/views/Components/CodeSnippet/index.js",
|
|
261
266
|
"types": "./dist/views/Components/CodeSnippet/index.d.ts",
|
|
@@ -322,25 +327,25 @@
|
|
|
322
327
|
"yaml": "^2.8.0",
|
|
323
328
|
"zod": "^4.1.11",
|
|
324
329
|
"@scalar/analytics-client": "1.0.1",
|
|
330
|
+
"@scalar/components": "0.16.15",
|
|
325
331
|
"@scalar/draggable": "0.3.0",
|
|
326
|
-
"@scalar/
|
|
327
|
-
"@scalar/helpers": "0.2.4",
|
|
332
|
+
"@scalar/helpers": "0.2.5",
|
|
328
333
|
"@scalar/icons": "0.5.2",
|
|
329
|
-
"@scalar/import": "0.4.
|
|
330
|
-
"@scalar/json-magic": "0.8.
|
|
331
|
-
"@scalar/oas-utils": "0.6.
|
|
332
|
-
"@scalar/
|
|
333
|
-
"@scalar/
|
|
334
|
+
"@scalar/import": "0.4.42",
|
|
335
|
+
"@scalar/json-magic": "0.8.9",
|
|
336
|
+
"@scalar/oas-utils": "0.6.13",
|
|
337
|
+
"@scalar/openapi-parser": "0.23.10",
|
|
338
|
+
"@scalar/object-utils": "1.2.19",
|
|
339
|
+
"@scalar/postman-to-openapi": "0.3.54",
|
|
340
|
+
"@scalar/sidebar": "0.7.5",
|
|
334
341
|
"@scalar/openapi-types": "0.5.3",
|
|
335
|
-
"@scalar/postman-to-openapi": "0.3.53",
|
|
336
|
-
"@scalar/sidebar": "0.7.4",
|
|
337
|
-
"@scalar/snippetz": "0.6.1",
|
|
338
342
|
"@scalar/themes": "0.13.26",
|
|
339
|
-
"@scalar/
|
|
340
|
-
"@scalar/use-codemirror": "0.13.
|
|
341
|
-
"@scalar/
|
|
343
|
+
"@scalar/snippetz": "0.6.2",
|
|
344
|
+
"@scalar/use-codemirror": "0.13.9",
|
|
345
|
+
"@scalar/use-hooks": "0.3.4",
|
|
346
|
+
"@scalar/types": "0.5.5",
|
|
342
347
|
"@scalar/use-toasts": "0.9.1",
|
|
343
|
-
"@scalar/
|
|
348
|
+
"@scalar/workspace-store": "0.24.3"
|
|
344
349
|
},
|
|
345
350
|
"devDependencies": {
|
|
346
351
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -355,8 +360,8 @@
|
|
|
355
360
|
"vite": "7.1.11",
|
|
356
361
|
"vite-svg-loader": "5.1.0",
|
|
357
362
|
"vitest": "3.2.4",
|
|
358
|
-
"@scalar/
|
|
359
|
-
"@scalar/
|
|
363
|
+
"@scalar/galaxy": "0.5.12",
|
|
364
|
+
"@scalar/build-tooling": "0.4.1"
|
|
360
365
|
},
|
|
361
366
|
"scripts": {
|
|
362
367
|
"build": "scalar-build-vite",
|