@scalar/agent-chat 0.2.5 → 0.2.6
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/dist/components/ContextItem.vue.d.ts.map +1 -1
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
- package/dist/components/Selector.vue.d.ts +24 -0
- package/dist/components/Selector.vue.d.ts.map +1 -0
- package/dist/components/Selector.vue.js +67 -0
- package/dist/components/Selector.vue2.js +4 -0
- package/dist/components/ServerSelector.vue.d.ts +22 -0
- package/dist/components/ServerSelector.vue.d.ts.map +1 -0
- package/dist/components/ServerSelector.vue.js +57 -0
- package/dist/components/ServerSelector.vue2.js +4 -0
- package/dist/components/UploadSection.vue.d.ts.map +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +47 -40
- package/dist/package.json +1 -2
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/registry/add-documents-to-store.js +24 -23
- package/dist/style.css +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +49 -45
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +2 -2
- package/dist/views/Settings/DocSettings.vue2.js +27 -22
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/package.json +7 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/ContextItem.vue"],"names":[],"mappings":"AAoEA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/ContextItem.vue"],"names":[],"mappings":"AAoEA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AA4BxC,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAmB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/RequestPreview.vue"],"names":[],"mappings":"AAuQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,IAAI,CAAA;AAarC,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAA;IACxE,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,KAAK,EACD,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,UAAU,CAAA;CACf,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/RequestPreview.vue"],"names":[],"mappings":"AAuQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,IAAI,CAAA;AAarC,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAA;IACxE,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,KAAK,EACD,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,UAAU,CAAA;CACf,CAAC;;AAiWF,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyPreview.vue"],"names":[],"mappings":"AA8EA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAGjF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B,CAAC;;
|
|
1
|
+
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyPreview.vue"],"names":[],"mappings":"AA8EA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAGjF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B,CAAC;;AA4IF,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyToggle.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;CAC/B,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"ResponseBodyToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyToggle.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;CAC/B,CAAC;;;;;;AAsEF,wBAOG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The selected server URL */
|
|
4
|
+
selectedServer: ServerObject | null;
|
|
5
|
+
/** Available servers */
|
|
6
|
+
servers: ServerObject[];
|
|
7
|
+
/** The id of the target to use for the popover (e.g. address bar) */
|
|
8
|
+
target: string;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
11
|
+
servers: ServerObject[];
|
|
12
|
+
serverUrlWithoutTrailingSlash: import("vue").ComputedRef<string>;
|
|
13
|
+
serverOptions: import("vue").ComputedRef<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}[]>;
|
|
17
|
+
selectedServer: ServerObject | null;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
+
"update:modelValue": (value: string) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=Selector.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../src/components/Selector.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,KAAK,WAAW,GAAG;IACjB,8BAA8B;IAC9B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;;;;;;AA6LF,wBAQG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as g, computed as s, createBlock as S, createElementBlock as w, openBlock as u, unref as n, withCtx as i, createVNode as d, createElementVNode as a, toDisplayString as c } from "vue";
|
|
2
|
+
import { ScalarListbox as b, ScalarButton as h } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as y } from "@scalar/icons";
|
|
4
|
+
const V = { class: "overflow-x-auto" }, k = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "text-c-1 flex h-auto w-full items-center gap-0.75 rounded-b-lg px-3 py-1.5 text-base leading-[20px] whitespace-nowrap"
|
|
7
|
+
}, B = { class: "overflow-x-auto" }, E = /* @__PURE__ */ g({
|
|
8
|
+
__name: "Selector",
|
|
9
|
+
props: {
|
|
10
|
+
selectedServer: {},
|
|
11
|
+
servers: {},
|
|
12
|
+
target: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(e, { expose: p, emit: m }) {
|
|
16
|
+
const v = m, o = s(
|
|
17
|
+
() => e.servers.map((r) => ({
|
|
18
|
+
id: r.url,
|
|
19
|
+
label: r.url
|
|
20
|
+
}))
|
|
21
|
+
), l = s(
|
|
22
|
+
() => e.selectedServer?.url?.replace(/\/$/, "") || ""
|
|
23
|
+
), f = s(
|
|
24
|
+
() => o.value.find((r) => r.id === e.selectedServer?.url)
|
|
25
|
+
);
|
|
26
|
+
return p({
|
|
27
|
+
servers: e.servers,
|
|
28
|
+
serverUrlWithoutTrailingSlash: l,
|
|
29
|
+
serverOptions: o,
|
|
30
|
+
selectedServer: e.selectedServer
|
|
31
|
+
}), (r, t) => o.value.length > 1 ? (u(), S(n(b), {
|
|
32
|
+
key: 0,
|
|
33
|
+
ref: "elem",
|
|
34
|
+
class: "group",
|
|
35
|
+
modelValue: f.value,
|
|
36
|
+
options: o.value,
|
|
37
|
+
placement: "bottom-start",
|
|
38
|
+
resize: "",
|
|
39
|
+
target: e.target,
|
|
40
|
+
"onUpdate:modelValue": t[0] || (t[0] = (x) => v("update:modelValue", x.id))
|
|
41
|
+
}, {
|
|
42
|
+
default: i(() => [
|
|
43
|
+
d(n(h), {
|
|
44
|
+
class: "bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-lg px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1",
|
|
45
|
+
variant: "ghost"
|
|
46
|
+
}, {
|
|
47
|
+
default: i(() => [
|
|
48
|
+
t[1] || (t[1] = a("span", { class: "sr-only" }, "Server:", -1)),
|
|
49
|
+
a("span", V, c(l.value || "Select a server"), 1),
|
|
50
|
+
d(n(y), {
|
|
51
|
+
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
52
|
+
weight: "bold"
|
|
53
|
+
})
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
})
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["modelValue", "options", "target"])) : (u(), w("div", k, [
|
|
60
|
+
t[2] || (t[2] = a("span", { class: "sr-only" }, "Server:", -1)),
|
|
61
|
+
a("span", B, c(l.value), 1)
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
E as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
type SelectorProps = {
|
|
4
|
+
/** The event bus to use for emitting events */
|
|
5
|
+
eventBus: WorkspaceEventBus;
|
|
6
|
+
/** The selected server */
|
|
7
|
+
selectedServer: ServerObject | null;
|
|
8
|
+
/** Available servers */
|
|
9
|
+
servers: ServerObject[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ServerSelector
|
|
13
|
+
*
|
|
14
|
+
* Core component for rendering a server selector block.
|
|
15
|
+
* Handles server selection and emits a 'server:update:selected' event when the selected server changes.
|
|
16
|
+
*
|
|
17
|
+
* @event server:update:selected - Emitted when the selected server changes
|
|
18
|
+
* @event server:update:variables - Emitted when a server variable changes
|
|
19
|
+
*/
|
|
20
|
+
declare const _default: import("vue").DefineComponent<SelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=ServerSelector.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/ServerSelector.vue"],"names":[],"mappings":"AA4FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;;AACH,wBAsJC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as g, createBlock as c, createCommentVNode as o, normalizeClass as x, unref as l } from "vue";
|
|
2
|
+
import { ServerVariablesForm as k } from "@scalar/api-client/components/Server";
|
|
3
|
+
import { ScalarMarkdown as B } from "@scalar/components";
|
|
4
|
+
import V from "./Selector.vue.js";
|
|
5
|
+
const y = ["id"], C = {}, I = /* @__PURE__ */ m({
|
|
6
|
+
...C,
|
|
7
|
+
__name: "ServerSelector",
|
|
8
|
+
props: {
|
|
9
|
+
eventBus: {},
|
|
10
|
+
selectedServer: {},
|
|
11
|
+
servers: {}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
const s = b(), v = (r) => {
|
|
15
|
+
e.eventBus.emit("server:update:selected", {
|
|
16
|
+
url: e.selectedServer?.url === r ? "" : r
|
|
17
|
+
});
|
|
18
|
+
}, i = (r, t) => {
|
|
19
|
+
const a = e.servers.findIndex((u) => u.url === e.selectedServer?.url);
|
|
20
|
+
a !== -1 && e.eventBus.emit("server:update:variables", {
|
|
21
|
+
index: a,
|
|
22
|
+
key: r,
|
|
23
|
+
value: t
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return (r, t) => (d(), S(f, null, [
|
|
27
|
+
t[0] || (t[0] = n("label", { class: "bg-b-2 flex h-8 items-center rounded-t-lg border border-b-0 px-3 py-2.5 font-medium" }, " Server ", -1)),
|
|
28
|
+
n("div", {
|
|
29
|
+
id: l(s),
|
|
30
|
+
class: x(["border", {
|
|
31
|
+
"rounded-b-lg": !e.selectedServer?.description && !e.selectedServer?.variables
|
|
32
|
+
}])
|
|
33
|
+
}, [
|
|
34
|
+
e.servers.length ? (d(), c(V, {
|
|
35
|
+
key: 0,
|
|
36
|
+
selectedServer: e.selectedServer,
|
|
37
|
+
servers: e.servers,
|
|
38
|
+
target: l(s),
|
|
39
|
+
"onUpdate:modelValue": v
|
|
40
|
+
}, null, 8, ["selectedServer", "servers", "target"])) : o("", !0)
|
|
41
|
+
], 10, y),
|
|
42
|
+
g(l(k), {
|
|
43
|
+
layout: "reference",
|
|
44
|
+
variables: e.selectedServer?.variables,
|
|
45
|
+
"onUpdate:variable": i
|
|
46
|
+
}, null, 8, ["variables"]),
|
|
47
|
+
e.selectedServer?.description ? (d(), c(l(B), {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "text-c-3 rounded-b-lg border border-t-0 px-3 py-1.5",
|
|
50
|
+
value: e.selectedServer.description
|
|
51
|
+
}, null, 8, ["value"])) : o("", !0)
|
|
52
|
+
], 64));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
I as default
|
|
57
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/UploadSection.vue"],"names":[],"mappings":"AA0GA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAE7E,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAC;;
|
|
1
|
+
{"version":3,"file":"UploadSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/UploadSection.vue"],"names":[],"mappings":"AA0GA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAE7E,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAC;;AAiJF,wBAMG"}
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAMpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;A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AC/B,KAAG,IAuCH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI;IACnE,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,CAAC,CAAA;CACV,CAAA;AAED,eAAO,MAAM,eAAe;;CAElB,CAAA;AAEV,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAK/F"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,115 +1,122 @@
|
|
|
1
1
|
import { getSelectedServer as E } from "@scalar/api-client/v2/features/operation";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { getServers as O } from "@scalar/api-client/v2/helpers";
|
|
3
|
+
import { isObject as l } from "@scalar/helpers/object/is-object";
|
|
4
|
+
import { REFERENCE_LS_KEYS as d, safeLocalStorage as I } from "@scalar/helpers/object/local-storage";
|
|
5
|
+
import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
6
|
import { coerceValue as f } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
6
|
-
import { XScalarSelectedSecuritySchema as
|
|
7
|
-
function
|
|
7
|
+
import { XScalarSelectedSecuritySchema as b, SecuritySchemesSchema as v } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
|
|
8
|
+
function D(e) {
|
|
8
9
|
return Object.values(e.paths ?? {}).flatMap((s) => Object.values(s ?? {}));
|
|
9
10
|
}
|
|
10
11
|
function j(e) {
|
|
11
12
|
const c = (e["x-scalar-selected-security"]?.selectedSchemes ?? []).flatMap((r) => Object.keys(r)), t = e.components?.securitySchemes;
|
|
12
13
|
return t ? c.reduce((r, n) => {
|
|
13
14
|
const o = t[n];
|
|
14
|
-
return o && r.push(
|
|
15
|
+
return o && r.push(u(o)), r;
|
|
15
16
|
}, []) : [];
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function T(e) {
|
|
18
19
|
return Object.fromEntries(
|
|
19
|
-
Object.entries(e.workspace.documents).map(([s, c]) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
Object.entries(e.workspace.documents).map(([s, c]) => {
|
|
21
|
+
const t = O(c.servers, {
|
|
22
|
+
documentUrl: c?.["x-scalar-original-source-url"]
|
|
23
|
+
});
|
|
24
|
+
return [
|
|
25
|
+
s,
|
|
26
|
+
{
|
|
27
|
+
activeServer: E(c, t),
|
|
28
|
+
securitySchemes: j(c)
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
})
|
|
26
32
|
);
|
|
27
33
|
}
|
|
28
|
-
const
|
|
34
|
+
const m = I(), y = () => {
|
|
29
35
|
const e = d.AUTH_SCHEMES, s = d.SELECTED_AUTH_SCHEMES, c = (t, r) => `${r}-${((o) => o === "schemas" ? e : s)(t)}`;
|
|
30
36
|
return {
|
|
31
37
|
/**
|
|
32
38
|
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
33
39
|
*/
|
|
34
40
|
getSchemas: (t) => {
|
|
35
|
-
const r = JSON.parse(
|
|
36
|
-
return f(
|
|
41
|
+
const r = JSON.parse(m.getItem(c("schemas", t)) ?? "{}");
|
|
42
|
+
return f(v, r);
|
|
37
43
|
},
|
|
38
44
|
/**
|
|
39
45
|
* Stores the authentication schemes in local storage.
|
|
40
46
|
* @param value The SecuritySchemes object to stringify and store.
|
|
41
47
|
*/
|
|
42
48
|
setSchemas: (t, r) => {
|
|
43
|
-
|
|
49
|
+
m.setItem(c("schemas", t), JSON.stringify(r));
|
|
44
50
|
},
|
|
45
51
|
/**
|
|
46
52
|
* Retrieves and coerces the selected authentication schemes stored in local storage.
|
|
47
53
|
*/
|
|
48
54
|
getSelectedSchemes: (t) => {
|
|
49
|
-
const r = JSON.parse(
|
|
50
|
-
return f(
|
|
55
|
+
const r = JSON.parse(m.getItem(c("selectedSchemes", t)) ?? "{}");
|
|
56
|
+
return f(b, r);
|
|
51
57
|
},
|
|
52
58
|
/**
|
|
53
59
|
* Stores the user's selected authentication schemes in local storage.
|
|
54
60
|
* @param value The XScalarSelectedSecurity object to stringify and store.
|
|
55
61
|
*/
|
|
56
62
|
setSelectedSchemes: (t, r) => {
|
|
57
|
-
|
|
63
|
+
m.setItem(c("selectedSchemes", t), JSON.stringify(r));
|
|
58
64
|
}
|
|
59
65
|
};
|
|
60
66
|
}, p = (e, s) => {
|
|
61
|
-
if (!(!
|
|
67
|
+
if (!(!l(e) || !l(s)))
|
|
62
68
|
for (const [c, t] of Object.entries(s)) {
|
|
63
69
|
if (typeof t != "object") {
|
|
64
70
|
e[c] = t;
|
|
65
71
|
continue;
|
|
66
72
|
}
|
|
67
|
-
p(
|
|
73
|
+
p(u(e[c]), t);
|
|
68
74
|
}
|
|
69
|
-
}, x = (e, s) => Object.keys(e).every((c) => s.has(c)),
|
|
75
|
+
}, x = (e, s) => Object.keys(e).every((c) => s.has(c)), A = (e, s) => e >= s ? s - 1 : e, L = ({
|
|
70
76
|
documentName: e,
|
|
71
77
|
workspaceStore: s
|
|
72
78
|
}) => {
|
|
73
79
|
const c = y().getSchemas(e), t = s.workspace.documents[e];
|
|
74
|
-
if (!t)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
if (!t)
|
|
81
|
+
return;
|
|
82
|
+
const n = y().getSelectedSchemes(e), o = new Set(Object.keys(t.components?.securitySchemes ?? {})), a = n["x-scalar-selected-security"]?.selectedSchemes?.filter((S) => x(S, o));
|
|
83
|
+
if (!t["x-scalar-selected-security"] && a && a.length > 0) {
|
|
84
|
+
const S = n["x-scalar-selected-security"]?.selectedIndex, i = A(S ?? 0, a.length);
|
|
78
85
|
t["x-scalar-selected-security"] = {
|
|
79
86
|
selectedIndex: i,
|
|
80
|
-
selectedSchemes:
|
|
87
|
+
selectedSchemes: a
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
90
|
const g = t.components?.securitySchemes ?? {};
|
|
84
91
|
for (const [S, i] of Object.entries(c)) {
|
|
85
|
-
const
|
|
86
|
-
|
|
92
|
+
const h = u(g[S]);
|
|
93
|
+
l(h) && p(h, i);
|
|
87
94
|
}
|
|
88
95
|
};
|
|
89
|
-
function
|
|
96
|
+
function N(e) {
|
|
90
97
|
try {
|
|
91
98
|
return JSON.parse(e);
|
|
92
99
|
} catch {
|
|
93
100
|
return;
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
|
-
const
|
|
103
|
+
const w = {
|
|
97
104
|
LIMIT_REACHED: "LIMIT_REACHED"
|
|
98
105
|
};
|
|
99
|
-
function
|
|
106
|
+
function F(e, s) {
|
|
100
107
|
return {
|
|
101
108
|
code: e,
|
|
102
109
|
detail: s
|
|
103
110
|
};
|
|
104
111
|
}
|
|
105
112
|
export {
|
|
106
|
-
|
|
113
|
+
w as AgentErrorCodes,
|
|
107
114
|
y as authStorage,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
T as createDocumentSettings,
|
|
116
|
+
F as createError,
|
|
117
|
+
D as getOperations,
|
|
111
118
|
j as getSecurityFromDocument,
|
|
112
119
|
p as mergeSecrets,
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
L as restoreAuthSecretsFromStorage,
|
|
121
|
+
N as safeParseJson
|
|
115
122
|
};
|
package/dist/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "git+https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/agent-chat"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.2.
|
|
13
|
+
"version": "0.2.6",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"@ai-sdk/vue": "catalog:*",
|
|
53
53
|
"@modelcontextprotocol/sdk": "catalog:*",
|
|
54
54
|
"@scalar/api-client": "workspace:*",
|
|
55
|
-
"@scalar/api-reference": "workspace:*",
|
|
56
55
|
"@scalar/components": "workspace:*",
|
|
57
56
|
"@scalar/helpers": "workspace:*",
|
|
58
57
|
"@scalar/icons": "workspace:*",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D,wBAAsB,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,GACf,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;IACrC,cAAc,EAAE,cAAc,CAAA;IAC9B,MAAM,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,MAAM,CAAA;CAC7B;;;;;;;eAqCA"}
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bundle as p } from "@scalar/json-magic/bundle";
|
|
1
|
+
import { bundle as f } from "@scalar/json-magic/bundle";
|
|
3
2
|
import { fetchUrls as l } from "@scalar/json-magic/bundle/plugins/browser";
|
|
4
|
-
import { api as
|
|
3
|
+
import { api as p } from "../api.js";
|
|
5
4
|
import { restoreAuthSecretsFromStorage as D } from "../helpers.js";
|
|
6
5
|
import { createDocumentName as h } from "./create-document-name.js";
|
|
7
|
-
async function
|
|
6
|
+
async function R({
|
|
8
7
|
namespace: t,
|
|
9
|
-
slug:
|
|
10
|
-
workspaceStore:
|
|
8
|
+
slug: e,
|
|
9
|
+
workspaceStore: o,
|
|
11
10
|
registryDocuments: m,
|
|
12
11
|
registryUrl: n,
|
|
13
|
-
baseUrl:
|
|
14
|
-
config:
|
|
15
|
-
getAccessToken:
|
|
12
|
+
baseUrl: u,
|
|
13
|
+
config: c,
|
|
14
|
+
getAccessToken: i
|
|
16
15
|
}) {
|
|
17
|
-
const
|
|
18
|
-
baseUrl:
|
|
19
|
-
getAccessToken:
|
|
16
|
+
const a = await p({
|
|
17
|
+
baseUrl: u,
|
|
18
|
+
getAccessToken: i
|
|
20
19
|
}).getDocument({
|
|
21
20
|
namespace: t,
|
|
22
|
-
slug:
|
|
21
|
+
slug: e
|
|
23
22
|
});
|
|
24
|
-
if (!
|
|
23
|
+
if (!a.success)
|
|
25
24
|
return;
|
|
26
|
-
m.value.push(
|
|
27
|
-
const
|
|
25
|
+
m.value.push(a.data);
|
|
26
|
+
const s = new URL(`/@${t}/apis/${e}/latest`, n), d = await f(s.toString(), {
|
|
28
27
|
plugins: [l()],
|
|
29
28
|
treeShake: !1
|
|
30
|
-
}),
|
|
31
|
-
return await
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
}), r = h(t, e);
|
|
30
|
+
return await o.addDocument(
|
|
31
|
+
{
|
|
32
|
+
name: r,
|
|
33
|
+
document: d
|
|
34
|
+
},
|
|
35
|
+
c
|
|
36
|
+
), o.update("x-scalar-active-document", r), D({ documentName: r, workspaceStore: o }), a.data;
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
+
R as loadDocument
|
|
39
40
|
};
|