@scalar/api-client 2.19.0 → 2.19.2
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 +46 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +12 -12
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +44 -47
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +4 -22
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +30 -28
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +10 -20
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +31 -40
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +4 -12
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +27 -44
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +0 -2
- 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 +19 -20
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +25 -14
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +65 -45
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +24 -27
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +7 -10
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -17
|
@@ -1,63 +1,46 @@
|
|
|
1
|
-
const
|
|
2
|
-
context:
|
|
3
|
-
defaultParameters:
|
|
4
|
-
globalParameters:
|
|
1
|
+
const d = (r, t, a, {
|
|
2
|
+
context: n,
|
|
3
|
+
defaultParameters: i = 0,
|
|
4
|
+
globalParameters: p = 0
|
|
5
5
|
}) => {
|
|
6
|
-
const
|
|
6
|
+
const o = i + p;
|
|
7
7
|
return {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type: i,
|
|
12
|
-
payload: {
|
|
13
|
-
name: e.name ?? "",
|
|
14
|
-
value: e.value ?? "",
|
|
15
|
-
isDisabled: !1
|
|
16
|
-
},
|
|
17
|
-
meta: a
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
debounceKey: `add:parameter-${i}-${e.index}`
|
|
21
|
-
}
|
|
22
|
-
),
|
|
23
|
-
delete: (e) => r.emit("operation:delete:parameter", {
|
|
24
|
-
type: i,
|
|
25
|
-
index: e.index - n,
|
|
8
|
+
delete: (e) => t.emit("operation:delete:parameter", {
|
|
9
|
+
type: r,
|
|
10
|
+
index: e.index - o,
|
|
26
11
|
meta: a
|
|
27
12
|
}),
|
|
28
|
-
deleteAll: () =>
|
|
29
|
-
type:
|
|
13
|
+
deleteAll: () => t.emit("operation:delete-all:parameters", {
|
|
14
|
+
type: r,
|
|
30
15
|
meta: a
|
|
31
16
|
}),
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
if (e
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
type:
|
|
38
|
-
in:
|
|
39
|
-
meta: { ...a, name:
|
|
40
|
-
payload: { isDisabled:
|
|
17
|
+
upsert: (e, l) => {
|
|
18
|
+
const s = n[e];
|
|
19
|
+
if (e < i + p) {
|
|
20
|
+
const m = e < i ? "default" : "global";
|
|
21
|
+
return t.emit("operation:update:extra-parameters", {
|
|
22
|
+
type: m,
|
|
23
|
+
in: r,
|
|
24
|
+
meta: { ...a, name: s?.name?.toLowerCase?.() ?? "NON_VALID" },
|
|
25
|
+
payload: { isDisabled: l.isDisabled ?? !1 }
|
|
41
26
|
});
|
|
42
27
|
}
|
|
43
|
-
if (e
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"operation:update:parameter",
|
|
28
|
+
if (e >= o)
|
|
29
|
+
return t.emit(
|
|
30
|
+
"operation:upsert:parameter",
|
|
47
31
|
{
|
|
48
|
-
type:
|
|
49
|
-
index: e
|
|
50
|
-
payload:
|
|
32
|
+
type: r,
|
|
33
|
+
index: e - o,
|
|
34
|
+
payload: l,
|
|
51
35
|
meta: a
|
|
52
36
|
},
|
|
53
37
|
{
|
|
54
|
-
debounceKey: `update:parameter-${
|
|
38
|
+
debounceKey: `update:parameter-${r}-${e - o}`
|
|
55
39
|
}
|
|
56
40
|
);
|
|
57
|
-
}
|
|
58
41
|
}
|
|
59
42
|
};
|
|
60
43
|
};
|
|
61
44
|
export {
|
|
62
|
-
|
|
45
|
+
d as createParameterHandlers
|
|
63
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
|
|
2
2
|
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isElectron as u } from "../../../../libs/electron.js";
|
|
4
|
-
const i = "2.19.
|
|
4
|
+
const i = "2.19.2", m = "application/json", h = "*/*", c = (r, t, a) => ({
|
|
5
5
|
name: r,
|
|
6
6
|
defaultValue: t,
|
|
7
7
|
isOverridden: a.has(r.toLowerCase())
|
|
@@ -6,8 +6,6 @@ import { type SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-sel
|
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
environment: XScalarEnvironment;
|
|
8
8
|
eventBus: WorkspaceEventBus;
|
|
9
|
-
/** Whether we can add or delete auth schemes */
|
|
10
|
-
isReadOnly?: boolean;
|
|
11
9
|
/** Creates a static disclosure that cannot be collapsed */
|
|
12
10
|
isStatic?: boolean;
|
|
13
11
|
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":"AAiTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,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,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,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,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA8BqC,IAAI;cAAQ,MAAM;;;;;AA6bzD,wBAOG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, useId as $, ref as
|
|
1
|
+
import { defineComponent as U, useId as $, ref as p, computed as x, createBlock as S, openBlock as c, unref as s, withCtx as r, createVNode as m, createCommentVNode as b, createElementBlock as v, Fragment as g, createElementVNode as u, createTextVNode as k, 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";
|
|
@@ -13,7 +13,6 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
13
13
|
props: {
|
|
14
14
|
environment: {},
|
|
15
15
|
eventBus: {},
|
|
16
|
-
isReadOnly: { type: Boolean, default: !1 },
|
|
17
16
|
isStatic: { type: Boolean, default: !1 },
|
|
18
17
|
meta: {},
|
|
19
18
|
proxyUrl: {},
|
|
@@ -24,7 +23,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
24
23
|
title: {}
|
|
25
24
|
},
|
|
26
25
|
setup(e, { expose: I }) {
|
|
27
|
-
const
|
|
26
|
+
const C = $(), B = p(null), O = p(!1), d = N(), o = p(null), h = x(() => {
|
|
28
27
|
if (!e.securityRequirements?.length)
|
|
29
28
|
return null;
|
|
30
29
|
const l = J(e.securityRequirements);
|
|
@@ -32,13 +31,13 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
32
31
|
icon: l ? "Unlock" : "Lock",
|
|
33
32
|
text: l ? "Optional" : "Required"
|
|
34
33
|
};
|
|
35
|
-
}), R =
|
|
34
|
+
}), R = x(
|
|
36
35
|
() => K(
|
|
37
36
|
e.securityRequirements ?? [],
|
|
38
37
|
e.securitySchemes ?? {},
|
|
39
|
-
e.
|
|
38
|
+
e.selectedSecurity?.selectedSchemes ?? []
|
|
40
39
|
)
|
|
41
|
-
), i =
|
|
40
|
+
), i = x(() => {
|
|
42
41
|
const l = e.selectedSecurity?.selectedSchemes;
|
|
43
42
|
return l?.length ? l.flatMap((t) => {
|
|
44
43
|
const n = Object.keys(t);
|
|
@@ -57,7 +56,7 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
57
56
|
}) : [];
|
|
58
57
|
}) : [];
|
|
59
58
|
}), w = (l) => {
|
|
60
|
-
|
|
59
|
+
O.value && l.stopPropagation(), B.value?.$el.click();
|
|
61
60
|
}, A = (l) => {
|
|
62
61
|
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) => ({
|
|
63
62
|
name: a.label,
|
|
@@ -83,20 +82,20 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
83
82
|
class: "group/params relative",
|
|
84
83
|
isStatic: e.isStatic,
|
|
85
84
|
itemCount: i.value.length,
|
|
86
|
-
"onUpdate:modelValue": t[1] || (t[1] = (n) =>
|
|
85
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => O.value = n)
|
|
87
86
|
}, {
|
|
88
87
|
title: r(() => [
|
|
89
88
|
u("div", {
|
|
90
|
-
id: s(
|
|
89
|
+
id: s(C),
|
|
91
90
|
class: "inline-flex items-center gap-0.5 leading-[20px]"
|
|
92
91
|
}, [
|
|
93
|
-
u("span", null,
|
|
94
|
-
h.value ? (c(),
|
|
92
|
+
u("span", null, y(e.title), 1),
|
|
93
|
+
h.value ? (c(), v("span", {
|
|
95
94
|
key: 0,
|
|
96
95
|
class: M(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": h.value.text === "Required" }]),
|
|
97
96
|
"data-testid": "auth-indicator",
|
|
98
97
|
onClick: w
|
|
99
|
-
},
|
|
98
|
+
}, y(h.value.text), 3)) : b("", !0)
|
|
100
99
|
], 8, Z)
|
|
101
100
|
]),
|
|
102
101
|
actions: r(() => [
|
|
@@ -115,8 +114,8 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
115
114
|
multiselect: "",
|
|
116
115
|
selected: a
|
|
117
116
|
}, null, 8, ["selected"]),
|
|
118
|
-
u("div", _,
|
|
119
|
-
n.isDeletable
|
|
117
|
+
u("div", _, y(n.label), 1),
|
|
118
|
+
n.isDeletable ? (c(), S(s(E), {
|
|
120
119
|
key: 0,
|
|
121
120
|
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
122
121
|
icon: s(P),
|
|
@@ -128,19 +127,19 @@ const Z = ["id"], _ = { class: "min-w-0 flex-1 truncate" }, ue = /* @__PURE__ */
|
|
|
128
127
|
default: r(() => [
|
|
129
128
|
m(s(j), {
|
|
130
129
|
ref_key: "comboboxButtonRef",
|
|
131
|
-
ref:
|
|
132
|
-
"aria-describedby": s(
|
|
130
|
+
ref: B,
|
|
131
|
+
"aria-describedby": s(C),
|
|
133
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",
|
|
134
133
|
variant: "ghost"
|
|
135
134
|
}, {
|
|
136
135
|
default: r(() => [
|
|
137
|
-
i.value.length === 1 ? (c(),
|
|
136
|
+
i.value.length === 1 ? (c(), v(g, { key: 0 }, [
|
|
138
137
|
t[2] || (t[2] = u("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
|
|
139
|
-
k(" " +
|
|
140
|
-
], 64)) : i.value.length > 1 ? (c(),
|
|
138
|
+
k(" " + y(i.value[0]?.label), 1)
|
|
139
|
+
], 64)) : i.value.length > 1 ? (c(), v(g, { key: 1 }, [
|
|
141
140
|
t[3] || (t[3] = k(" Multiple ", -1)),
|
|
142
141
|
t[4] || (t[4] = u("span", { class: "sr-only" }, "Auth Types Selected", -1))
|
|
143
|
-
], 64)) : (c(),
|
|
142
|
+
], 64)) : (c(), v(g, { key: 2 }, [
|
|
144
143
|
t[5] || (t[5] = u("span", { class: "sr-only" }, "Select", -1)),
|
|
145
144
|
t[6] || (t[6] = k(" Auth Type ", -1))
|
|
146
145
|
], 64)),
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { ComponentsObject, OpenApiDocument, SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/**
|
|
2
|
+
/** A single security scheme option used in the auth dropdown */
|
|
3
|
+
export type SecuritySchemeOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: SecurityRequirementObject;
|
|
7
|
+
isDeletable?: boolean;
|
|
8
|
+
payload?: SecuritySchemeObject;
|
|
9
|
+
};
|
|
10
|
+
/** A group of security scheme options used in the auth dropdown */
|
|
11
|
+
export type SecuritySchemeGroup = {
|
|
12
|
+
label: string;
|
|
13
|
+
options: SecuritySchemeOption[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Format a scheme object into a display object
|
|
17
|
+
*
|
|
18
|
+
* We also add a hash to the id to ensure it is unique across
|
|
19
|
+
* multiple requirements of the same scheme with different scopes
|
|
20
|
+
*/
|
|
3
21
|
export declare const formatScheme: ({ name, type, value, }: {
|
|
4
22
|
name: string;
|
|
5
23
|
type: SecuritySchemeObject["type"] | "complex";
|
|
@@ -8,28 +26,21 @@ export declare const formatScheme: ({ name, type, value, }: {
|
|
|
8
26
|
id: string;
|
|
9
27
|
label: string;
|
|
10
28
|
value: Partial<Record<string, string[]>>;
|
|
29
|
+
isDeletable: boolean;
|
|
11
30
|
};
|
|
12
31
|
/** Formats complex security schemes */
|
|
13
32
|
export declare const formatComplexScheme: (scheme: NonNullable<OpenApiDocument["security"]>[number]) => {
|
|
14
33
|
id: string;
|
|
15
34
|
label: string;
|
|
16
35
|
value: Partial<Record<string, string[]>>;
|
|
17
|
-
|
|
18
|
-
export type SecuritySchemeOption = {
|
|
19
|
-
id: string;
|
|
20
|
-
label: string;
|
|
21
|
-
value: SecurityRequirementObject;
|
|
22
|
-
isDeletable?: boolean;
|
|
23
|
-
payload?: SecuritySchemeObject;
|
|
24
|
-
};
|
|
25
|
-
export type SecuritySchemeGroup = {
|
|
26
|
-
label: string;
|
|
27
|
-
options: SecuritySchemeOption[];
|
|
36
|
+
isDeletable: boolean;
|
|
28
37
|
};
|
|
29
38
|
/**
|
|
30
39
|
* Generates the options for the security scheme combobox
|
|
31
40
|
*
|
|
32
|
-
*
|
|
41
|
+
* Contains either a flat list, or different groups of required, available, and add new
|
|
33
42
|
*/
|
|
34
|
-
export declare const getSecuritySchemeOptions: (security: NonNullable<OpenApiDocument["security"]>, securitySchemes: NonNullable<ComponentsObject["securitySchemes"]>,
|
|
43
|
+
export declare const getSecuritySchemeOptions: (security: NonNullable<OpenApiDocument["security"]>, securitySchemes: NonNullable<ComponentsObject["securitySchemes"]>,
|
|
44
|
+
/** We need to add the selected schemes if they do not already exist in the calculated options */
|
|
45
|
+
selectedSchemes: SecurityRequirementObject[]) => SecuritySchemeOption[] | SecuritySchemeGroup[];
|
|
35
46
|
//# sourceMappingURL=security-scheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAIrE,
|
|
1
|
+
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAIrE,gEAAgE;AAChE,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,yBAAyB,CAAA;IAChC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,wBAI1B;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAC9C,KAAK,EAAE,yBAAyB,CAAA;CACjC;;;;;CAKC,CAAA;AAEF,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;CAKxF,CAAA;AA6BJ;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,EAClD,iBAAiB,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AACjE,iGAAiG;AACjG,iBAAiB,yBAAyB,EAAE,KAC3C,oBAAoB,EAAE,GAAG,mBAAmB,EAsE9C,CAAA"}
|
|
@@ -1,52 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { authOptions as
|
|
4
|
-
const
|
|
1
|
+
import { generateHash as h } from "@scalar/helpers/string/generate-hash";
|
|
2
|
+
import { getResolvedRef as p } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { authOptions as b } from "./auth-options.js";
|
|
4
|
+
const m = ({
|
|
5
5
|
name: o,
|
|
6
|
-
type:
|
|
7
|
-
value:
|
|
6
|
+
type: i,
|
|
7
|
+
value: n
|
|
8
8
|
}) => ({
|
|
9
|
-
id:
|
|
10
|
-
label:
|
|
11
|
-
value:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const p = c(n[t[0]]);
|
|
25
|
-
return p ? l({ name: t[0], type: p.type, value: e }) : void 0;
|
|
26
|
-
}
|
|
27
|
-
}).filter(u), s = Object.keys(n).filter((e) => !r.some((t) => t.id === e)).map((e) => {
|
|
28
|
-
const t = c(n[e]);
|
|
29
|
-
if (t)
|
|
30
|
-
return l({ name: e, type: t.type, value: { [e]: [] } });
|
|
31
|
-
}).filter(u), a = [
|
|
32
|
-
{ label: "Required authentication", options: r },
|
|
33
|
-
{ label: "Available authentication", options: s }
|
|
34
|
-
];
|
|
35
|
-
return i ? r.length ? a : s : (a.push({
|
|
36
|
-
label: "Add new authentication",
|
|
37
|
-
options: Object.entries(d).map(([e, t]) => ({
|
|
38
|
-
id: `@unique/${e}`,
|
|
39
|
-
label: t.label,
|
|
40
|
-
value: { [e]: [] },
|
|
41
|
-
payload: t.payload,
|
|
42
|
-
// Disable deleting built-in options
|
|
43
|
-
isDeletable: !1
|
|
44
|
-
}))
|
|
45
|
-
}), a);
|
|
9
|
+
id: h(JSON.stringify(n)),
|
|
10
|
+
label: i === "openIdConnect" ? `${o} (coming soon)` : o,
|
|
11
|
+
value: n,
|
|
12
|
+
isDeletable: !0
|
|
13
|
+
}), y = (o) => m({
|
|
14
|
+
type: "complex",
|
|
15
|
+
name: Object.keys(o).join(" & "),
|
|
16
|
+
value: o
|
|
17
|
+
}), f = (o, i) => {
|
|
18
|
+
const n = Object.keys(o);
|
|
19
|
+
if (n.length > 1)
|
|
20
|
+
return y(o);
|
|
21
|
+
if (n[0]) {
|
|
22
|
+
const s = p(i[n[0]]);
|
|
23
|
+
return s ? m({ name: n[0], type: s.type, value: o }) : void 0;
|
|
46
24
|
}
|
|
25
|
+
}, v = (o, i, n) => {
|
|
26
|
+
const { requiredFormatted: s, requiredSchemeNames: u, existingIds: d } = o.reduce(
|
|
27
|
+
(e, t) => {
|
|
28
|
+
const a = f(t, i);
|
|
29
|
+
a && (e.requiredFormatted.push(a), e.existingIds.add(a.id));
|
|
30
|
+
for (const r of Object.keys(t))
|
|
31
|
+
e.requiredSchemeNames.add(r);
|
|
32
|
+
return e;
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
requiredFormatted: [],
|
|
36
|
+
requiredSchemeNames: /* @__PURE__ */ new Set(),
|
|
37
|
+
existingIds: /* @__PURE__ */ new Set()
|
|
38
|
+
}
|
|
39
|
+
), c = [];
|
|
40
|
+
for (const [e, t] of Object.entries(i)) {
|
|
41
|
+
if (u.has(e))
|
|
42
|
+
continue;
|
|
43
|
+
const a = p(t);
|
|
44
|
+
if (a) {
|
|
45
|
+
const r = m({ name: e, type: a.type, value: { [e]: [] } });
|
|
46
|
+
c.push(r), d.add(r.id);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
for (const e of n) {
|
|
50
|
+
const t = f(e, i);
|
|
51
|
+
t && !d.has(t.id) && (c.push(t), d.add(t.id));
|
|
52
|
+
}
|
|
53
|
+
const l = [
|
|
54
|
+
{ label: "Required authentication", options: s },
|
|
55
|
+
{ label: "Available authentication", options: c }
|
|
56
|
+
];
|
|
57
|
+
return l.push({
|
|
58
|
+
label: "Add new authentication",
|
|
59
|
+
options: Object.entries(b).map(([e, t]) => ({
|
|
60
|
+
id: e,
|
|
61
|
+
label: t.label,
|
|
62
|
+
value: { [e]: [] },
|
|
63
|
+
payload: t.payload,
|
|
64
|
+
isDeletable: !1
|
|
65
|
+
}))
|
|
66
|
+
}), l;
|
|
47
67
|
};
|
|
48
68
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
y as formatComplexScheme,
|
|
70
|
+
m as formatScheme,
|
|
51
71
|
v as getSecuritySchemeOptions
|
|
52
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAwB,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACnH,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAErF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,oBAAoB,EA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@@ -2,25 +2,25 @@ import { computed as E } from "vue";
|
|
|
2
2
|
import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
|
|
3
3
|
function g({
|
|
4
4
|
eventBus: n,
|
|
5
|
-
store:
|
|
5
|
+
store: l,
|
|
6
6
|
router: m,
|
|
7
7
|
rebuildSidebar: p,
|
|
8
|
-
navigateToCurrentTab:
|
|
8
|
+
navigateToCurrentTab: a,
|
|
9
9
|
onSelectSidebarItem: i,
|
|
10
10
|
onAfterExampleCreation: s,
|
|
11
|
-
onOpenCommandPalette:
|
|
11
|
+
onOpenCommandPalette: r,
|
|
12
12
|
onCopyTabUrl: f,
|
|
13
13
|
onToggleSidebar: x
|
|
14
14
|
}) {
|
|
15
15
|
const u = E(() => m.value?.currentRoute?.value), d = ({
|
|
16
16
|
documentName: e,
|
|
17
|
-
path:
|
|
17
|
+
path: t,
|
|
18
18
|
method: o,
|
|
19
19
|
exampleName: c
|
|
20
|
-
}) => !(e !== void 0 && e !== u.value?.params.documentSlug ||
|
|
20
|
+
}) => !(e !== void 0 && e !== u.value?.params.documentSlug || t !== void 0 && encodeURIComponent(t) !== u.value?.params.pathEncoded || o !== void 0 && o !== u.value?.params.method || c !== void 0 && c !== u.value?.params.exampleName);
|
|
21
21
|
h({
|
|
22
22
|
eventBus: n,
|
|
23
|
-
store:
|
|
23
|
+
store: l,
|
|
24
24
|
hooks: {
|
|
25
25
|
//------------------------------------------------------------------------------------
|
|
26
26
|
// Document Related Hooks
|
|
@@ -38,22 +38,19 @@ function g({
|
|
|
38
38
|
"operation:update:pathMethod": {
|
|
39
39
|
onBeforeExecute: (e) => ({
|
|
40
40
|
...e,
|
|
41
|
-
callback: async (
|
|
42
|
-
|
|
41
|
+
callback: async (t) => {
|
|
42
|
+
t === "success" && (await m.value?.replace({
|
|
43
43
|
name: "example",
|
|
44
44
|
params: {
|
|
45
45
|
method: e.payload.method,
|
|
46
46
|
pathEncoded: encodeURIComponent(e.payload.path),
|
|
47
47
|
exampleName: u.value?.params.exampleName
|
|
48
48
|
}
|
|
49
|
-
}), p(
|
|
49
|
+
}), p(l.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(t);
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
52
|
},
|
|
53
|
-
"operation:
|
|
54
|
-
onAfterExecute: (e) => s(e.meta)
|
|
55
|
-
},
|
|
56
|
-
"operation:update:parameter": {
|
|
53
|
+
"operation:upsert:parameter": {
|
|
57
54
|
onAfterExecute: (e) => s(e.meta)
|
|
58
55
|
},
|
|
59
56
|
"operation:update:extra-parameters": {
|
|
@@ -63,17 +60,17 @@ function g({
|
|
|
63
60
|
onAfterExecute: async (e) => {
|
|
64
61
|
p(e.documentName);
|
|
65
62
|
const {
|
|
66
|
-
documentName:
|
|
63
|
+
documentName: t,
|
|
67
64
|
meta: { path: o, method: c }
|
|
68
65
|
} = e;
|
|
69
66
|
d({
|
|
70
|
-
documentName:
|
|
67
|
+
documentName: t,
|
|
71
68
|
path: o,
|
|
72
69
|
method: c
|
|
73
70
|
}) && await m.value?.replace({
|
|
74
71
|
name: "document.overview",
|
|
75
72
|
params: {
|
|
76
|
-
documentSlug:
|
|
73
|
+
documentSlug: t
|
|
77
74
|
}
|
|
78
75
|
});
|
|
79
76
|
}
|
|
@@ -82,11 +79,11 @@ function g({
|
|
|
82
79
|
onAfterExecute: async (e) => {
|
|
83
80
|
p(e.documentName);
|
|
84
81
|
const {
|
|
85
|
-
documentName:
|
|
82
|
+
documentName: t,
|
|
86
83
|
meta: { path: o, method: c, exampleKey: v }
|
|
87
84
|
} = e;
|
|
88
85
|
d({
|
|
89
|
-
documentName:
|
|
86
|
+
documentName: t,
|
|
90
87
|
path: o,
|
|
91
88
|
method: c,
|
|
92
89
|
exampleName: v
|
|
@@ -95,7 +92,7 @@ function g({
|
|
|
95
92
|
params: {
|
|
96
93
|
pathEncoded: encodeURIComponent(o),
|
|
97
94
|
method: c,
|
|
98
|
-
documentSlug:
|
|
95
|
+
documentSlug: t,
|
|
99
96
|
exampleName: "default"
|
|
100
97
|
}
|
|
101
98
|
});
|
|
@@ -123,31 +120,31 @@ function g({
|
|
|
123
120
|
// Tabs Related Event Hooks
|
|
124
121
|
//------------------------------------------------------------------------------------
|
|
125
122
|
"tabs:add:tab": {
|
|
126
|
-
onAfterExecute:
|
|
123
|
+
onAfterExecute: a
|
|
127
124
|
},
|
|
128
125
|
"tabs:close:tab": {
|
|
129
|
-
onAfterExecute:
|
|
126
|
+
onAfterExecute: a
|
|
130
127
|
},
|
|
131
128
|
"tabs:focus:tab": {
|
|
132
|
-
onAfterExecute:
|
|
129
|
+
onAfterExecute: a
|
|
133
130
|
},
|
|
134
131
|
"tabs:focus:tab-last": {
|
|
135
|
-
onAfterExecute:
|
|
132
|
+
onAfterExecute: a
|
|
136
133
|
},
|
|
137
134
|
"tabs:navigate:previous": {
|
|
138
|
-
onAfterExecute:
|
|
135
|
+
onAfterExecute: a
|
|
139
136
|
},
|
|
140
137
|
"tabs:navigate:next": {
|
|
141
|
-
onAfterExecute:
|
|
138
|
+
onAfterExecute: a
|
|
142
139
|
},
|
|
143
140
|
"tabs:update:tabs": {
|
|
144
|
-
onAfterExecute:
|
|
141
|
+
onAfterExecute: a
|
|
145
142
|
}
|
|
146
143
|
}
|
|
147
144
|
}), n.on("scroll-to:nav-item", ({ id: e }) => i(e)), n.on("ui:toggle:sidebar", x), n.on(
|
|
148
145
|
"ui:open:command-palette",
|
|
149
146
|
(e) => {
|
|
150
|
-
e ?
|
|
147
|
+
e ? r(e.action, e.payload) : r();
|
|
151
148
|
}
|
|
152
149
|
), n.on("ui:route:page", ({ name: e }) => m.value?.push({ name: e })), n.on("tabs:copy:url", (e) => f(e.index));
|
|
153
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAA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AE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QA+OA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { generateClientMutators as i } from "@scalar/workspace-store/mutators";
|
|
2
|
-
import { computed as
|
|
3
|
-
const r = (a,
|
|
2
|
+
import { computed as p } from "vue";
|
|
3
|
+
const r = (a, c, t) => async (o) => {
|
|
4
4
|
const n = await t[a]?.onBeforeExecute?.(o) ?? o;
|
|
5
|
-
return await
|
|
5
|
+
return await c(n), await t[a]?.onAfterExecute?.(n), n;
|
|
6
6
|
};
|
|
7
7
|
function l({
|
|
8
8
|
eventBus: a,
|
|
9
|
-
store:
|
|
9
|
+
store: c,
|
|
10
10
|
hooks: t
|
|
11
11
|
}) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = p(() => i(c.value)), n = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
|
|
13
13
|
a.on(
|
|
14
14
|
"workspace:update:active-proxy",
|
|
15
15
|
(e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, t)(e)
|
|
@@ -122,11 +122,8 @@ function l({
|
|
|
122
122
|
"operation:delete:example",
|
|
123
123
|
(e) => r("operation:delete:example", o.value.active().operation.deleteOperationExample, t)(e)
|
|
124
124
|
), a.on(
|
|
125
|
-
"operation:
|
|
126
|
-
(e) => r("operation:
|
|
127
|
-
), a.on(
|
|
128
|
-
"operation:update:parameter",
|
|
129
|
-
(e) => r("operation:update:parameter", o.value.active().operation.updateOperationParameter, t)(e)
|
|
125
|
+
"operation:upsert:parameter",
|
|
126
|
+
(e) => r("operation:upsert:parameter", o.value.active().operation.upsertOperationParameter, t)(e)
|
|
130
127
|
), a.on(
|
|
131
128
|
"operation:update:extra-parameters",
|
|
132
129
|
(e) => r(
|
|
@@ -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 = (u) => {
|
|
35
35
|
u?.createNew && g.name === "request" && p();
|
|
36
|
-
}, v = "2.19.
|
|
36
|
+
}, v = "2.19.2";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|