@scalar/api-client 2.37.0 → 2.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +87 -78
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +5 -5
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +30 -0
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/response-cache.js +12 -0
- 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 +83 -80
- 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 +65 -61
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +3 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +42 -32
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +4 -7
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +27 -7
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
- 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 +23 -21
- 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 +19 -14
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +72 -66
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +24 -22
- package/dist/v2/features/app/app-events.js +2 -2
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts +1 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +3 -3
- package/dist/v2/features/collection/components/Form.vue.d.ts +1 -0
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Form.vue.js +23 -23
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +5 -4
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/components/Section.vue.js +10 -10
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +11 -11
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, ref as h, watch as y, createBlock as r, openBlock as s } from "vue";
|
|
2
2
|
import v from "./RequestTable.vue.js";
|
|
3
|
-
import { getFormBodyRows as
|
|
3
|
+
import { getFormBodyRows as w } from "../helpers/get-form-body-rows.js";
|
|
4
4
|
import { useFileDialog as F } from "../../../../hooks/useFileDialog.js";
|
|
5
|
-
const
|
|
5
|
+
const C = /* @__PURE__ */ R({
|
|
6
6
|
__name: "RequestBodyForm",
|
|
7
7
|
props: {
|
|
8
8
|
example: {},
|
|
9
|
+
bodySchema: {},
|
|
9
10
|
selectedContentType: {},
|
|
10
11
|
environment: {}
|
|
11
12
|
},
|
|
12
13
|
emits: ["update:formValue"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
() =>
|
|
17
|
-
(t) => {
|
|
18
|
-
e.value =
|
|
14
|
+
setup(o, { emit: d }) {
|
|
15
|
+
const c = d, e = h([]);
|
|
16
|
+
y(
|
|
17
|
+
() => [o.example, o.bodySchema, o.selectedContentType],
|
|
18
|
+
([a, t, n]) => {
|
|
19
|
+
e.value = w(a, n, t);
|
|
19
20
|
},
|
|
20
21
|
{ immediate: !0 }
|
|
21
22
|
);
|
|
22
|
-
const
|
|
23
|
-
|
|
23
|
+
const u = (a) => {
|
|
24
|
+
c(
|
|
25
|
+
"update:formValue",
|
|
26
|
+
a.map((t) => ({
|
|
27
|
+
name: t.name,
|
|
28
|
+
value: t.value,
|
|
29
|
+
isDisabled: t.isDisabled ?? !1
|
|
30
|
+
}))
|
|
31
|
+
);
|
|
32
|
+
}, m = (a, t) => {
|
|
33
|
+
if (a >= e.value.length) {
|
|
24
34
|
e.value = [
|
|
25
35
|
...e.value,
|
|
26
|
-
{ name: "", value: "", ...
|
|
27
|
-
], u(
|
|
36
|
+
{ name: "", value: "", ...t, isDisabled: !1 }
|
|
37
|
+
], u(e.value);
|
|
28
38
|
return;
|
|
29
39
|
}
|
|
30
40
|
e.value = e.value.map(
|
|
31
|
-
(n, l) => l ===
|
|
32
|
-
), u(
|
|
33
|
-
},
|
|
41
|
+
(n, l) => l === a ? { ...n, ...t } : n
|
|
42
|
+
), u(e.value);
|
|
43
|
+
}, i = (a) => {
|
|
34
44
|
e.value = e.value.filter(
|
|
35
|
-
(
|
|
36
|
-
), u(
|
|
37
|
-
}, p = (
|
|
38
|
-
const { open:
|
|
45
|
+
(t, n) => n !== a
|
|
46
|
+
), u(e.value);
|
|
47
|
+
}, p = (a) => {
|
|
48
|
+
const { open: t } = F({
|
|
39
49
|
onChange: (n) => {
|
|
40
50
|
const l = n?.[0];
|
|
41
51
|
if (l) {
|
|
42
|
-
const
|
|
43
|
-
m(
|
|
44
|
-
name:
|
|
52
|
+
const f = e.value[a];
|
|
53
|
+
m(a, {
|
|
54
|
+
name: f?.name || l.name,
|
|
45
55
|
value: l
|
|
46
56
|
});
|
|
47
57
|
}
|
|
@@ -49,26 +59,26 @@ const D = /* @__PURE__ */ f({
|
|
|
49
59
|
multiple: !1,
|
|
50
60
|
accept: "*/*"
|
|
51
61
|
});
|
|
52
|
-
|
|
62
|
+
t();
|
|
53
63
|
};
|
|
54
|
-
return (
|
|
64
|
+
return (a, t) => o.selectedContentType === "multipart/form-data" ? (s(), r(v, {
|
|
55
65
|
key: 0,
|
|
56
66
|
data: e.value,
|
|
57
|
-
environment:
|
|
67
|
+
environment: o.environment,
|
|
58
68
|
showUploadButton: "",
|
|
59
|
-
onDeleteRow:
|
|
60
|
-
onRemoveFile:
|
|
69
|
+
onDeleteRow: i,
|
|
70
|
+
onRemoveFile: t[0] || (t[0] = (n) => m(n, { value: void 0 })),
|
|
61
71
|
onUploadFile: p,
|
|
62
72
|
onUpsertRow: m
|
|
63
|
-
}, null, 8, ["data", "environment"])) : (s(),
|
|
73
|
+
}, null, 8, ["data", "environment"])) : (s(), r(v, {
|
|
64
74
|
key: 1,
|
|
65
75
|
data: e.value,
|
|
66
|
-
environment:
|
|
67
|
-
onDeleteRow:
|
|
76
|
+
environment: o.environment,
|
|
77
|
+
onDeleteRow: i,
|
|
68
78
|
onUpsertRow: m
|
|
69
79
|
}, null, 8, ["data", "environment"]));
|
|
70
80
|
}
|
|
71
81
|
});
|
|
72
82
|
export {
|
|
73
|
-
|
|
83
|
+
C as default
|
|
74
84
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
|
|
2
2
|
import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isElectron as y } from "../../../../libs/electron.js";
|
|
4
|
-
const l = "2.
|
|
4
|
+
const l = "2.38.1", T = "application/json", C = "*/*", a = (n, s, o) => ({
|
|
5
5
|
name: n,
|
|
6
6
|
defaultValue: s,
|
|
7
7
|
isOverridden: o.has(n.toLowerCase())
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { ExampleObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: any;
|
|
6
|
-
isDisabled: boolean;
|
|
7
|
-
}[];
|
|
1
|
+
import type { ExampleObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
import type { TableRow } from '../../../../v2/blocks/request-block/components/RequestTableRow.vue.js';
|
|
3
|
+
/** Build the table rows for the form data, optionally enriched with schema (e.g. enum) per property */
|
|
4
|
+
export declare const getFormBodyRows: (example: ExampleObject | undefined | null, contentType: string, formBodySchema?: SchemaObject) => TableRow[];
|
|
8
5
|
//# sourceMappingURL=get-form-body-rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-form-body-rows.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-form-body-rows.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAG/G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAA;AAExF,uGAAuG;AACvG,eAAO,MAAM,eAAe,GAC1B,SAAS,aAAa,GAAG,SAAS,GAAG,IAAI,EACzC,aAAa,MAAM,EACnB,iBAAiB,YAAY,KAC5B,QAAQ,EAqDV,CAAA"}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { isObject as f } from "@scalar/helpers/object/is-object";
|
|
2
|
+
import { objectEntries as d } from "@scalar/helpers/object/object-entries";
|
|
3
|
+
import { resolve as b } from "@scalar/workspace-store/resolve";
|
|
4
|
+
import { isObjectSchema as p } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
5
|
+
const S = (i, c, n) => {
|
|
6
|
+
if (!i?.value || c !== "multipart/form-data" && c !== "application/x-www-form-urlencoded")
|
|
7
|
+
return [];
|
|
8
|
+
const s = n && p(n) ? n : void 0, v = s ? new Set(s.required ?? []) : void 0, u = ({
|
|
9
|
+
name: r,
|
|
10
|
+
value: o,
|
|
11
|
+
isDisabled: e = !1
|
|
12
|
+
}) => {
|
|
13
|
+
const t = { name: r, value: o, isDisabled: e };
|
|
14
|
+
if (!s || !r)
|
|
15
|
+
return t;
|
|
16
|
+
const a = b.schema(s.properties?.[r]);
|
|
17
|
+
return t.schema = a, t.description = a?.description, t.isRequired = v?.has(r), t.isDisabled = e, t;
|
|
18
|
+
};
|
|
19
|
+
return Array.isArray(i.value) ? i.value.map((r) => {
|
|
20
|
+
if (f(r)) {
|
|
21
|
+
const o = String(r.name), e = r.value instanceof File ? r.value : String(r.value), t = !!r.isDisabled;
|
|
22
|
+
return u({ name: o, value: e, isDisabled: t });
|
|
23
|
+
}
|
|
24
|
+
return { name: "", value: r, isDisabled: !1 };
|
|
25
|
+
}) : typeof i.value == "object" && i.value ? d(i.value).map(([r, o]) => u({ name: String(r), value: o })) : [];
|
|
26
|
+
};
|
|
7
27
|
export {
|
|
8
|
-
|
|
28
|
+
S as getFormBodyRows
|
|
9
29
|
};
|
|
@@ -10,6 +10,8 @@ type __VLS_Props = {
|
|
|
10
10
|
eventBus: WorkspaceEventBus;
|
|
11
11
|
/** Allows adding authentication which is not in the document */
|
|
12
12
|
createAnySecurityScheme?: boolean;
|
|
13
|
+
/** Whether the authentication disclosure should start expanded */
|
|
14
|
+
defaultOpen?: boolean;
|
|
13
15
|
/** Creates a static disclosure that cannot be collapsed */
|
|
14
16
|
isStatic?: boolean;
|
|
15
17
|
meta: AuthMeta;
|
|
@@ -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":"AA2TA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAC1G,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gEAAgE;IAChE,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,qBAAqB,CAAA;IACtC,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC9C,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AA+eF,QAAA,MAAM,YAAY;;cA9cqB,IAAI;cAAQ,MAAM;;;;oPAidvD,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, useId as $, ref as v, computed as S, createBlock as
|
|
1
|
+
import { defineComponent as U, useId as $, ref as v, computed as S, createBlock as p, openBlock as c, unref as s, withCtx as r, createVNode as m, createCommentVNode as x, createElementBlock as f, Fragment as b, createElementVNode as u, createTextVNode as g, toDisplayString as y, withModifiers as q, normalizeClass as M } from "vue";
|
|
2
2
|
import { useModal as N, ScalarComboboxMultiselect as T, ScalarButton as j, ScalarListboxCheckbox as z, ScalarIconButton as E } from "@scalar/components";
|
|
3
3
|
import { ScalarIconCaretDown as L, ScalarIconTrash as P } from "@scalar/icons";
|
|
4
4
|
import { getResolvedRef as F } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
@@ -14,6 +14,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
14
14
|
environment: {},
|
|
15
15
|
eventBus: {},
|
|
16
16
|
createAnySecurityScheme: { type: Boolean, default: !1 },
|
|
17
|
+
defaultOpen: { type: Boolean, default: !0 },
|
|
17
18
|
isStatic: { type: Boolean, default: !1 },
|
|
18
19
|
meta: {},
|
|
19
20
|
proxyUrl: {},
|
|
@@ -24,7 +25,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
24
25
|
title: {}
|
|
25
26
|
},
|
|
26
27
|
setup(e, { expose: A }) {
|
|
27
|
-
const k = $(),
|
|
28
|
+
const k = $(), O = v(null), B = v(!1), d = N(), o = v(null), h = S(() => {
|
|
28
29
|
if (!e.securityRequirements?.length)
|
|
29
30
|
return null;
|
|
30
31
|
const l = J(e.securityRequirements);
|
|
@@ -32,7 +33,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
32
33
|
icon: l ? "Unlock" : "Lock",
|
|
33
34
|
text: l ? "Optional" : "Required"
|
|
34
35
|
};
|
|
35
|
-
}),
|
|
36
|
+
}), C = S(
|
|
36
37
|
() => K(
|
|
37
38
|
e.securityRequirements ?? [],
|
|
38
39
|
e.securitySchemes ?? {},
|
|
@@ -54,7 +55,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
54
55
|
}) : [] : [];
|
|
55
56
|
}) : [];
|
|
56
57
|
}), D = (l) => {
|
|
57
|
-
B.value && l.stopPropagation(),
|
|
58
|
+
B.value && l.stopPropagation(), O.value?.$el.click();
|
|
58
59
|
}, I = (l) => {
|
|
59
60
|
const t = l.filter((a) => a.payload === void 0).map((a) => G(a.value, { depth: 2 })), n = l.filter((a) => a.payload !== void 0).map((a) => ({
|
|
60
61
|
name: a.label,
|
|
@@ -75,9 +76,10 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
75
76
|
return A({
|
|
76
77
|
authIndicator: h,
|
|
77
78
|
selectedSchemeOptions: i,
|
|
78
|
-
schemeOptions:
|
|
79
|
-
}), (l, t) => (c(),
|
|
79
|
+
schemeOptions: C
|
|
80
|
+
}), (l, t) => (c(), p(s(Y), {
|
|
80
81
|
class: "group/params relative",
|
|
82
|
+
defaultOpen: e.defaultOpen,
|
|
81
83
|
isStatic: e.isStatic,
|
|
82
84
|
itemCount: i.value.length,
|
|
83
85
|
"onUpdate:modelValue": t[1] || (t[1] = (n) => B.value = n)
|
|
@@ -87,13 +89,13 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
87
89
|
id: s(k),
|
|
88
90
|
class: "inline-flex items-center gap-0.5 leading-[20px]"
|
|
89
91
|
}, [
|
|
90
|
-
u("span", null,
|
|
91
|
-
h.value ? (c(),
|
|
92
|
+
u("span", null, y(e.title), 1),
|
|
93
|
+
h.value ? (c(), f("span", {
|
|
92
94
|
key: 0,
|
|
93
95
|
class: M(["text-c-3 hover:bg-b-3 hover:text-c-1 -my-0.5 -mr-1 cursor-pointer rounded px-1 py-0.5 leading-[normal] font-normal", { "text-c-1": h.value.text === "Required" }]),
|
|
94
96
|
"data-testid": "auth-indicator",
|
|
95
97
|
onClick: D
|
|
96
|
-
},
|
|
98
|
+
}, y(h.value.text), 3)) : x("", !0)
|
|
97
99
|
], 8, Z)
|
|
98
100
|
]),
|
|
99
101
|
actions: r(() => [
|
|
@@ -101,7 +103,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
101
103
|
class: "w-72 text-xs",
|
|
102
104
|
modelValue: i.value,
|
|
103
105
|
multiple: "",
|
|
104
|
-
options:
|
|
106
|
+
options: C.value,
|
|
105
107
|
placement: "bottom-end",
|
|
106
108
|
teleport: "",
|
|
107
109
|
onDelete: R,
|
|
@@ -112,32 +114,32 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
112
114
|
multiselect: "",
|
|
113
115
|
selected: a
|
|
114
116
|
}, null, 8, ["selected"]),
|
|
115
|
-
u("div", _,
|
|
116
|
-
n.isDeletable ? (c(),
|
|
117
|
+
u("div", _, y(n.label), 1),
|
|
118
|
+
n.isDeletable ? (c(), p(s(E), {
|
|
117
119
|
key: 0,
|
|
118
120
|
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
119
121
|
icon: s(P),
|
|
120
122
|
label: `Delete ${n.label}`,
|
|
121
123
|
size: "xs",
|
|
122
124
|
onClick: q((V) => R(n), ["stop"])
|
|
123
|
-
}, null, 8, ["icon", "label", "onClick"])) :
|
|
125
|
+
}, null, 8, ["icon", "label", "onClick"])) : x("", !0)
|
|
124
126
|
]),
|
|
125
127
|
default: r(() => [
|
|
126
128
|
m(s(j), {
|
|
127
129
|
ref_key: "comboboxButtonRef",
|
|
128
|
-
ref:
|
|
130
|
+
ref: O,
|
|
129
131
|
"aria-describedby": s(k),
|
|
130
132
|
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",
|
|
131
133
|
variant: "ghost"
|
|
132
134
|
}, {
|
|
133
135
|
default: r(() => [
|
|
134
|
-
i.value.length === 1 ? (c(),
|
|
136
|
+
i.value.length === 1 ? (c(), f(b, { key: 0 }, [
|
|
135
137
|
t[2] || (t[2] = u("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
|
|
136
|
-
g(" " +
|
|
137
|
-
], 64)) : i.value.length > 1 ? (c(),
|
|
138
|
+
g(" " + y(i.value[0]?.label), 1)
|
|
139
|
+
], 64)) : i.value.length > 1 ? (c(), f(b, { key: 1 }, [
|
|
138
140
|
t[3] || (t[3] = g(" Multiple ", -1)),
|
|
139
141
|
t[4] || (t[4] = u("span", { class: "sr-only" }, "Auth Types Selected", -1))
|
|
140
|
-
], 64)) : (c(),
|
|
142
|
+
], 64)) : (c(), f(b, { key: 2 }, [
|
|
141
143
|
t[5] || (t[5] = u("span", { class: "sr-only" }, "Select", -1)),
|
|
142
144
|
t[6] || (t[6] = g(" Auth Type ", -1))
|
|
143
145
|
], 64)),
|
|
@@ -164,17 +166,17 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
164
166
|
selectedSchemeOptions: i.value,
|
|
165
167
|
server: e.server
|
|
166
168
|
}, null, 8, ["activeAuthIndex", "environment", "eventBus", "isStatic", "meta", "proxyUrl", "securitySchemes", "selectedSchemeOptions", "server"]),
|
|
167
|
-
o.value ? (c(),
|
|
169
|
+
o.value ? (c(), p(H, {
|
|
168
170
|
key: 0,
|
|
169
171
|
label: o.value.label,
|
|
170
172
|
scheme: o.value,
|
|
171
173
|
state: s(d),
|
|
172
174
|
onClose: t[0] || (t[0] = (n) => s(d).hide()),
|
|
173
175
|
onDelete: w
|
|
174
|
-
}, null, 8, ["label", "scheme", "state"])) :
|
|
176
|
+
}, null, 8, ["label", "scheme", "state"])) : x("", !0)
|
|
175
177
|
]),
|
|
176
178
|
_: 1
|
|
177
|
-
}, 8, ["isStatic", "itemCount"]));
|
|
179
|
+
}, 8, ["defaultOpen", "isStatic", "itemCount"]));
|
|
178
180
|
}
|
|
179
181
|
});
|
|
180
182
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAiaA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,8DAA8D,CAAA;AAOrE,OAAO,KAAK,EAIV,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,6DAA6D,CAAA;AAIpE,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,kBAAkB;IAClB,KAAK,EAAE,sBAAsB,CAAA;IAC7B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,sBAAsB,CAAA;IAClC,sBAAsB;IACtB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,sBAAsB;IACtB,MAAM,EAAE,0BAA0B,CAAA;IAClC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AA4wBF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { pkceOptions as
|
|
1
|
+
import { defineComponent as I, computed as C, ref as L, watch as O, createElementBlock as k, openBlock as m, Fragment as p, createVNode as r, unref as o, withCtx as l, createTextVNode as u, createElementVNode as S, createBlock as v, createCommentVNode as f } from "vue";
|
|
2
|
+
import { useLoadingState as P, ScalarButton as V } from "@scalar/components";
|
|
3
|
+
import { pkceOptions as R } from "@scalar/oas-utils/entities/spec";
|
|
4
4
|
import { useToasts as F } from "@scalar/use-toasts";
|
|
5
5
|
import { getEnvironmentVariables as A } from "../../operation-block/helpers/get-environment-variables.js";
|
|
6
6
|
import E from "./OAuthScopesInput.vue.js";
|
|
@@ -8,7 +8,7 @@ import E from "./OAuthScopesInput.vue.js";
|
|
|
8
8
|
import { authorizeOauth2 as N } from "../helpers/oauth.js";
|
|
9
9
|
import c from "./RequestAuthDataTableInput.vue.js";
|
|
10
10
|
import i from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
-
const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { class: "flex h-8 w-full items-center justify-end border-t" }, J = /* @__PURE__ */
|
|
11
|
+
const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { class: "flex h-8 w-full items-center justify-end border-t" }, J = /* @__PURE__ */ I({
|
|
12
12
|
__name: "OAuth2",
|
|
13
13
|
props: {
|
|
14
14
|
environment: {},
|
|
@@ -23,7 +23,7 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
23
23
|
},
|
|
24
24
|
emits: ["update:selectedScopes"],
|
|
25
25
|
setup(t, { emit: T }) {
|
|
26
|
-
const g = T, x =
|
|
26
|
+
const g = T, x = P(), { toast: B } = F(), n = C(() => t.flows[t.type]), w = C(
|
|
27
27
|
() => t.selectedScopes.filter((s) => s in (n.value.scopes ?? {}))
|
|
28
28
|
), y = (s) => {
|
|
29
29
|
if (t.scheme.type === "openIdConnect")
|
|
@@ -45,8 +45,8 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
45
45
|
name: t.name
|
|
46
46
|
}), b = () => t.eventBus.emit("auth:clear:security-scheme-secrets", {
|
|
47
47
|
name: t.name
|
|
48
|
-
}), U =
|
|
49
|
-
|
|
48
|
+
}), U = L(!1);
|
|
49
|
+
O(
|
|
50
50
|
() => n.value["x-scalar-secret-redirect-uri"],
|
|
51
51
|
(s) => {
|
|
52
52
|
U.value || s || typeof window > "u" || !("x-scalar-secret-redirect-uri" in n.value) || (U.value = !0, d({
|
|
@@ -55,7 +55,7 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
55
55
|
},
|
|
56
56
|
{ immediate: !0 }
|
|
57
57
|
);
|
|
58
|
-
const
|
|
58
|
+
const h = async () => {
|
|
59
59
|
if (x.isLoading)
|
|
60
60
|
return;
|
|
61
61
|
x.start();
|
|
@@ -71,9 +71,14 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
71
71
|
"x-scalar-secret-token": e.accessToken,
|
|
72
72
|
...e.refreshToken ? { "x-scalar-secret-refresh-token": e.refreshToken } : {}
|
|
73
73
|
}) : (console.error(s), B(s?.message ?? "Failed to authorize", "error"));
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
}, z = (s) => {
|
|
75
|
+
const e = s === "body" ? "body" : "header";
|
|
76
|
+
t.scheme.type !== "openIdConnect" && y({
|
|
77
|
+
"x-scalar-credentials-location": e
|
|
78
|
+
}), d({
|
|
79
|
+
"x-scalar-credentials-location": e
|
|
80
|
+
});
|
|
81
|
+
};
|
|
77
82
|
return (s, e) => n.value["x-scalar-secret-token"] ? (m(), k(p, { key: 0 }, [
|
|
78
83
|
r(o(i), null, {
|
|
79
84
|
default: l(() => [
|
|
@@ -240,7 +245,7 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
240
245
|
"x-usePkce" in n.value ? (m(), v(o(i), { key: 3 }, {
|
|
241
246
|
default: l(() => [
|
|
242
247
|
r(c, {
|
|
243
|
-
enum: o(
|
|
248
|
+
enum: o(R),
|
|
244
249
|
environment: t.environment,
|
|
245
250
|
modelValue: n.value["x-usePkce"],
|
|
246
251
|
readOnly: "",
|
|
@@ -264,7 +269,7 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
264
269
|
modelValue: n.value["x-scalar-credentials-location"] || "header",
|
|
265
270
|
placeholder: "header",
|
|
266
271
|
readOnly: "",
|
|
267
|
-
"onUpdate:modelValue": e[10] || (e[10] = (a) =>
|
|
272
|
+
"onUpdate:modelValue": e[10] || (e[10] = (a) => z(a))
|
|
268
273
|
}, {
|
|
269
274
|
default: l(() => [...e[22] || (e[22] = [
|
|
270
275
|
u(" Credentials Location ", -1)
|
|
@@ -306,7 +311,7 @@ const j = { class: "flex h-8 items-center justify-end gap-2 border-t" }, Q = { c
|
|
|
306
311
|
loader: o(x),
|
|
307
312
|
size: "sm",
|
|
308
313
|
variant: "outlined",
|
|
309
|
-
onClick:
|
|
314
|
+
onClick: h
|
|
310
315
|
}, {
|
|
311
316
|
default: l(() => [...e[24] || (e[24] = [
|
|
312
317
|
u(" Authorize ", -1)
|
package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;
|
|
1
|
+
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAyKjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BAuDF,CAAA"}
|