@scalar/agent-chat 0.9.9 → 0.9.11
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/App.vue.d.ts +6 -6
- package/dist/api.d.ts +8 -8
- package/dist/client-tools/execute-request.d.ts +7 -7
- package/dist/components/ErrorMessage.vue.d.ts +1 -1
- package/dist/components/RequestPreview.vue.d.ts +1 -1
- package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/components/UploadSection.vue.d.ts +1 -1
- package/dist/entities/error/helpers.d.ts +1 -1
- package/dist/entities/index.d.ts +9 -9
- package/dist/entities/index.js +2 -23
- package/dist/entities/tools/execute-request.d.ts +1 -1
- package/dist/entities-NWeuOkBB.js +28 -0
- package/dist/entities-NWeuOkBB.js.map +1 -0
- package/dist/hooks/use-chat-approvals.d.ts +1 -1
- package/dist/hooks/use-search.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2064 -3
- package/dist/index.js.map +1 -0
- package/dist/package.json +3 -5
- package/dist/registry/add-documents-to-store.d.ts +5 -5
- package/dist/state/state.d.ts +7 -7
- package/dist/style.css +2 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
- package/package.json +15 -17
- package/dist/App.vue.js +0 -43
- package/dist/App.vue2.js +0 -4
- package/dist/Chat.vue.js +0 -55
- package/dist/Chat.vue2.js +0 -4
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/api.js +0 -99
- package/dist/client-tools/execute-request.js +0 -98
- package/dist/components/ActionsDropdown.vue.js +0 -7
- package/dist/components/ActionsDropdown.vue2.js +0 -50
- package/dist/components/ApprovalSection.vue.js +0 -7
- package/dist/components/ApprovalSection.vue2.js +0 -33
- package/dist/components/AuthenticationProvided.vue.js +0 -13
- package/dist/components/AuthenticationRequired.vue.js +0 -13
- package/dist/components/AutosendPaused.vue.js +0 -13
- package/dist/components/BuildingRequest.vue.js +0 -24
- package/dist/components/ContextItem.vue.js +0 -7
- package/dist/components/ContextItem.vue2.js +0 -19
- package/dist/components/ErrorMessage.vue.js +0 -7
- package/dist/components/ErrorMessage.vue2.js +0 -25
- package/dist/components/FreeMessagesInfoSection.vue.js +0 -7
- package/dist/components/FreeMessagesInfoSection.vue2.js +0 -51
- package/dist/components/LoadingMiniOpenAPIDoc.vue.js +0 -14
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js +0 -14
- package/dist/components/Logo.vue.js +0 -23
- package/dist/components/PaymentSection.vue.js +0 -7
- package/dist/components/PaymentSection.vue2.js +0 -30
- package/dist/components/RequestApproved.vue.js +0 -13
- package/dist/components/RequestFailed.vue.js +0 -24
- package/dist/components/RequestPreview.vue.js +0 -7
- package/dist/components/RequestPreview.vue2.js +0 -129
- package/dist/components/RequestRejected.vue.js +0 -22
- package/dist/components/RequestSuccess.vue.js +0 -13
- package/dist/components/ResponseBody/ResponseBody.vue.js +0 -41
- package/dist/components/ResponseBody/ResponseBody.vue2.js +0 -4
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +0 -14
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +0 -7
- package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +0 -65
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +0 -20
- package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +0 -4
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +0 -26
- package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +0 -4
- package/dist/components/ResponseBody/helpers/media-types.js +0 -129
- package/dist/components/ResponseBody/helpers/process-response-body.js +0 -33
- package/dist/components/SearchPopover.vue.js +0 -7
- package/dist/components/SearchPopover.vue2.js +0 -67
- package/dist/components/Selector.vue.js +0 -67
- package/dist/components/Selector.vue2.js +0 -4
- package/dist/components/SendingRequest.vue.js +0 -24
- package/dist/components/ServerSelector.vue.js +0 -63
- package/dist/components/ServerSelector.vue2.js +0 -4
- package/dist/components/UploadSection.vue.js +0 -7
- package/dist/components/UploadSection.vue2.js +0 -61
- package/dist/consts/urls.js +0 -10
- package/dist/entities/error/constants.js +0 -6
- package/dist/entities/error/helpers.js +0 -9
- package/dist/entities/prompt/constants.js +0 -4
- package/dist/entities/registry/document.js +0 -12
- package/dist/entities/tools/ask-for-authentication.js +0 -8
- package/dist/entities/tools/constants.js +0 -4
- package/dist/entities/tools/execute-request.js +0 -12
- package/dist/entities/tools/get-mini-openapi-spec.js +0 -8
- package/dist/entities/tools/get-openapi-spec-summary.js +0 -4
- package/dist/helpers.js +0 -67
- package/dist/hooks/use-agent-key-documents.js +0 -21
- package/dist/hooks/use-chat-approvals.js +0 -35
- package/dist/hooks/use-chat-error.js +0 -23
- package/dist/hooks/use-chat-pending-client-tool-parts.js +0 -12
- package/dist/hooks/use-chat-scroll.js +0 -16
- package/dist/hooks/use-curated-documents.js +0 -12
- package/dist/hooks/use-search.js +0 -21
- package/dist/hooks/use-signup-link.js +0 -12
- package/dist/hooks/use-term-and-conditions.js +0 -15
- package/dist/hooks/use-upload-tmp-document.js +0 -94
- package/dist/plugins/persistance.js +0 -23
- package/dist/registry/add-documents-to-store.js +0 -44
- package/dist/registry/create-document-name.js +0 -6
- package/dist/state/state.js +0 -200
- package/dist/views/Catalog/Catalog.vue.js +0 -8
- package/dist/views/Catalog/Catalog.vue2.js +0 -70
- package/dist/views/Chat/Chat.vue.js +0 -7
- package/dist/views/Chat/Chat.vue2.js +0 -78
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +0 -7
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +0 -91
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +0 -7
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +0 -24
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -7
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +0 -56
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +0 -26
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +0 -4
- package/dist/views/Chat/Messages/Text.vue.js +0 -16
- package/dist/views/Chat/Messages/Text.vue2.js +0 -4
- package/dist/views/Layout.vue.js +0 -7
- package/dist/views/Layout.vue2.js +0 -25
- package/dist/views/PromptForm.vue.js +0 -7
- package/dist/views/PromptForm.vue2.js +0 -254
- package/dist/views/Settings/Auth.vue.js +0 -67
- package/dist/views/Settings/Auth.vue2.js +0 -4
- package/dist/views/Settings/DocSettings.vue.js +0 -7
- package/dist/views/Settings/DocSettings.vue2.js +0 -49
- package/dist/views/Settings/Settings.vue.js +0 -8
- package/dist/views/Settings/Settings.vue2.js +0 -79
- package/dist/views/Start.vue.js +0 -7
- package/dist/views/Start.vue2.js +0 -43
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, useTemplateRef as K, computed as d, watch as w, createElementBlock as r, openBlock as o, createBlock as u, createCommentVNode as a, createElementVNode as n, unref as e, withModifiers as j, withDirectives as J, vModelText as O, Fragment as f, withCtx as h, createVNode as p, renderList as C, createTextVNode as T, toDisplayString as X } from "vue";
|
|
2
|
-
import { ScalarTooltip as Z, ScalarIconButton as P, ScalarLoading as G } from "@scalar/components";
|
|
3
|
-
import { ScalarIconPlus as I, ScalarIconX as Q, ScalarIconLockSimple as W, ScalarIconCheck as Y, ScalarIconArrowUp as ee } from "@scalar/icons";
|
|
4
|
-
import te from "../components/ActionsDropdown.vue.js";
|
|
5
|
-
import oe from "../components/ApprovalSection.vue.js";
|
|
6
|
-
import se from "../components/ErrorMessage.vue.js";
|
|
7
|
-
import le from "../components/FreeMessagesInfoSection.vue.js";
|
|
8
|
-
import ne from "../components/PaymentSection.vue.js";
|
|
9
|
-
import ae from "../components/SearchPopover.vue.js";
|
|
10
|
-
import re from "../components/UploadSection.vue.js";
|
|
11
|
-
import { AgentErrorCodes as D } from "../entities/error/constants.js";
|
|
12
|
-
import { MAX_PROMPT_SIZE as ie } from "../entities/prompt/constants.js";
|
|
13
|
-
import { useRequestApprovals as ue } from "../hooks/use-chat-approvals.js";
|
|
14
|
-
import { useChatError as ce } from "../hooks/use-chat-error.js";
|
|
15
|
-
import { useChatPendingClientToolParts as de } from "../hooks/use-chat-pending-client-tool-parts.js";
|
|
16
|
-
import { useUploadTmpDocument as pe } from "../hooks/use-upload-tmp-document.js";
|
|
17
|
-
import { useState as me } from "../state/state.js";
|
|
18
|
-
const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "inputActionsContainer" }, he = { class: "inputActionsLeft" }, ye = {
|
|
19
|
-
class: "addAPIButton",
|
|
20
|
-
type: "button"
|
|
21
|
-
}, Ae = {
|
|
22
|
-
class: "addAPIButton",
|
|
23
|
-
type: "button"
|
|
24
|
-
}, be = ["src"], ke = ["onClick"], _e = { class: "inputActionsRight" }, Se = { class: "sendCheckboxContinue" }, we = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "relative flex items-center gap-1.5"
|
|
27
|
-
}, Ce = {
|
|
28
|
-
class: "termsAgree",
|
|
29
|
-
for: "agentTermsAgree"
|
|
30
|
-
}, Te = {
|
|
31
|
-
key: 5,
|
|
32
|
-
class: "addMoreContext"
|
|
33
|
-
}, Pe = { class: "ml-auto flex items-center gap-1" }, Ie = ["onClick"], De = ["alt", "src"], Xe = /* @__PURE__ */ q({
|
|
34
|
-
__name: "PromptForm",
|
|
35
|
-
emits: ["submit", "uploadApi"],
|
|
36
|
-
setup(xe, { expose: x, emit: L }) {
|
|
37
|
-
const E = L;
|
|
38
|
-
x({ focusPrompt: z });
|
|
39
|
-
const c = K("agentPrompt"), t = me(), M = d(() => t.prompt.value.trim().length > 0), R = d(
|
|
40
|
-
() => t.prompt.value.trim().length > ie
|
|
41
|
-
), B = d(
|
|
42
|
-
() => t.chat.messages.length > 1 && !t.getAgentKey?.() && g?.value?.code !== D.LIMIT_REACHED
|
|
43
|
-
);
|
|
44
|
-
w(t.prompt, () => {
|
|
45
|
-
if (c?.value) {
|
|
46
|
-
if (!t.prompt.value.length) {
|
|
47
|
-
c.value.style.height = "0px";
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
c.value.style.height = "auto", c.value.style.height = c.value.scrollHeight + "px";
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function U(i) {
|
|
54
|
-
t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), _(), window.scrollTo(0, document.body.scrollHeight));
|
|
55
|
-
}
|
|
56
|
-
function z() {
|
|
57
|
-
c.value?.focus();
|
|
58
|
-
}
|
|
59
|
-
w(
|
|
60
|
-
() => t.chat.status,
|
|
61
|
-
(i) => {
|
|
62
|
-
(i === "ready" || i === "error") && c.value?.focus();
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
const { approvalRequiredParts: y, respondToRequestApprovals: A } = ue(), { pendingClientToolParts: $ } = de(), m = pe();
|
|
66
|
-
function V() {
|
|
67
|
-
t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && m.uploadTempDocument(t.getActiveDocumentJson(), !0);
|
|
68
|
-
}
|
|
69
|
-
const b = d(
|
|
70
|
-
() => Object.values(t.pendingDocuments).some(Boolean)
|
|
71
|
-
), k = d(() => {
|
|
72
|
-
const i = R.value, l = !M.value, s = y.value.length > 0, v = $.value.length > 0, S = t.mode === "preview", F = S && !t.terms.accepted.value, H = S && !!m.uploadState.value, N = b.value;
|
|
73
|
-
return i || l || s || v || F || H || N;
|
|
74
|
-
});
|
|
75
|
-
function _() {
|
|
76
|
-
k.value || E("submit");
|
|
77
|
-
}
|
|
78
|
-
const g = ce();
|
|
79
|
-
return (i, l) => (o(), r("div", ge, [
|
|
80
|
-
e(m).uploadState.value || b.value ? (o(), u(re, {
|
|
81
|
-
key: 0,
|
|
82
|
-
uploadState: e(m).uploadState.value ?? { type: "loading" }
|
|
83
|
-
}, null, 8, ["uploadState"])) : a("", !0),
|
|
84
|
-
e(g) ? (o(), u(se, {
|
|
85
|
-
key: 1,
|
|
86
|
-
error: e(g)
|
|
87
|
-
}, null, 8, ["error"])) : a("", !0),
|
|
88
|
-
e(y).length ? (o(), u(oe, {
|
|
89
|
-
key: 2,
|
|
90
|
-
onApprove: l[0] || (l[0] = (s) => e(A)(!0)),
|
|
91
|
-
onReject: l[1] || (l[1] = (s) => e(A)(!1))
|
|
92
|
-
})) : a("", !0),
|
|
93
|
-
e(g)?.code === e(D).LIMIT_REACHED ? (o(), u(ne, { key: 3 })) : a("", !0),
|
|
94
|
-
B.value ? (o(), u(le, { key: 4 })) : a("", !0),
|
|
95
|
-
n("form", {
|
|
96
|
-
class: "promptForm",
|
|
97
|
-
onSubmit: j(_, ["prevent"])
|
|
98
|
-
}, [
|
|
99
|
-
l[6] || (l[6] = n("label", {
|
|
100
|
-
class: "agentLabel",
|
|
101
|
-
for: "agentTextarea"
|
|
102
|
-
}, " Type a Request To get Started ", -1)),
|
|
103
|
-
J(n("textarea", {
|
|
104
|
-
id: "agentTextarea",
|
|
105
|
-
ref: "agentPrompt",
|
|
106
|
-
"onUpdate:modelValue": l[2] || (l[2] = (s) => e(t).prompt.value = s),
|
|
107
|
-
class: "prompt custom-scroll",
|
|
108
|
-
disabled: e(t).loading.value,
|
|
109
|
-
name: "prompt",
|
|
110
|
-
placeholder: "Ask me anything…",
|
|
111
|
-
onKeydown: U
|
|
112
|
-
}, null, 40, ve), [
|
|
113
|
-
[O, e(t).prompt.value]
|
|
114
|
-
]),
|
|
115
|
-
n("div", fe, [
|
|
116
|
-
n("div", he, [
|
|
117
|
-
e(t).hideAddApi ? a("", !0) : (o(), r(f, { key: 0 }, [
|
|
118
|
-
e(t).isLoggedIn?.value ? (o(), u(te, {
|
|
119
|
-
key: 1,
|
|
120
|
-
onUploadApi: l[3] || (l[3] = (s) => i.$emit("uploadApi"))
|
|
121
|
-
}, {
|
|
122
|
-
default: h(() => [
|
|
123
|
-
n("button", Ae, [
|
|
124
|
-
p(e(I), {
|
|
125
|
-
class: "size-4",
|
|
126
|
-
weight: "bold"
|
|
127
|
-
})
|
|
128
|
-
])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
})) : (o(), u(ae, { key: 0 }, {
|
|
132
|
-
default: h(() => [
|
|
133
|
-
n("button", ye, [
|
|
134
|
-
p(e(I), {
|
|
135
|
-
class: "size-4",
|
|
136
|
-
weight: "bold"
|
|
137
|
-
})
|
|
138
|
-
])
|
|
139
|
-
]),
|
|
140
|
-
_: 1
|
|
141
|
-
}))
|
|
142
|
-
], 64)),
|
|
143
|
-
(o(!0), r(f, null, C(e(t).registryDocuments.value, (s) => (o(), r("div", {
|
|
144
|
-
key: s.id,
|
|
145
|
-
class: "apiPill"
|
|
146
|
-
}, [
|
|
147
|
-
s.logoUrl ? (o(), r("img", {
|
|
148
|
-
key: 0,
|
|
149
|
-
class: "apiPillLogo",
|
|
150
|
-
src: s.logoUrl
|
|
151
|
-
}, null, 8, be)) : a("", !0),
|
|
152
|
-
T(" " + X(s.title) + " ", 1),
|
|
153
|
-
s.removable ? (o(), r("button", {
|
|
154
|
-
key: 1,
|
|
155
|
-
class: "apiPillRemove",
|
|
156
|
-
type: "button",
|
|
157
|
-
onClick: (v) => e(t).removeDocument(s)
|
|
158
|
-
}, [
|
|
159
|
-
p(e(Q), {
|
|
160
|
-
class: "size-4",
|
|
161
|
-
weight: "bold"
|
|
162
|
-
})
|
|
163
|
-
], 8, ke)) : a("", !0)
|
|
164
|
-
]))), 128))
|
|
165
|
-
]),
|
|
166
|
-
n("div", _e, [
|
|
167
|
-
e(t).loading.value ? a("", !0) : (o(), u(e(Z), {
|
|
168
|
-
key: 0,
|
|
169
|
-
content: "Settings"
|
|
170
|
-
}, {
|
|
171
|
-
default: h(() => [
|
|
172
|
-
p(e(P), {
|
|
173
|
-
class: "settingsButton h-7 w-7 p-1.5",
|
|
174
|
-
icon: e(W),
|
|
175
|
-
label: "Scalar",
|
|
176
|
-
size: "md",
|
|
177
|
-
weight: "bold",
|
|
178
|
-
onClick: l[4] || (l[4] = (s) => e(t).settingsModal.show())
|
|
179
|
-
}, null, 8, ["icon"])
|
|
180
|
-
]),
|
|
181
|
-
_: 1
|
|
182
|
-
})),
|
|
183
|
-
n("div", Se, [
|
|
184
|
-
!e(t).terms.accepted.value && e(t).mode === "preview" ? (o(), r("div", we, [
|
|
185
|
-
n("input", {
|
|
186
|
-
id: "agentTermsAgree",
|
|
187
|
-
class: "sr-only",
|
|
188
|
-
type: "checkbox",
|
|
189
|
-
onChange: V
|
|
190
|
-
}, null, 32),
|
|
191
|
-
n("label", Ce, [
|
|
192
|
-
p(e(Y), {
|
|
193
|
-
class: "termsAgreeIcon",
|
|
194
|
-
weight: "bold"
|
|
195
|
-
}),
|
|
196
|
-
l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
|
|
197
|
-
])
|
|
198
|
-
])) : a("", !0),
|
|
199
|
-
e(t).loading.value ? (o(), u(e(G), {
|
|
200
|
-
key: 2,
|
|
201
|
-
class: "loader h-7 w-7",
|
|
202
|
-
loader: {
|
|
203
|
-
isLoading: e(t).loading.value,
|
|
204
|
-
isValid: !1,
|
|
205
|
-
clear: async () => {
|
|
206
|
-
},
|
|
207
|
-
invalidate: async () => {
|
|
208
|
-
},
|
|
209
|
-
isInvalid: !1,
|
|
210
|
-
isActive: !1,
|
|
211
|
-
validate: async () => {
|
|
212
|
-
},
|
|
213
|
-
start: () => {
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
size: "2xl"
|
|
217
|
-
}, null, 8, ["loader"])) : (o(), u(e(P), {
|
|
218
|
-
key: 1,
|
|
219
|
-
class: "sendButton h-7 w-7 p-1.5",
|
|
220
|
-
disabled: k.value,
|
|
221
|
-
icon: e(ee),
|
|
222
|
-
label: "Scalar",
|
|
223
|
-
size: "md",
|
|
224
|
-
type: "submit",
|
|
225
|
-
weight: "bold"
|
|
226
|
-
}, null, 8, ["disabled", "icon"]))
|
|
227
|
-
])
|
|
228
|
-
])
|
|
229
|
-
])
|
|
230
|
-
], 32),
|
|
231
|
-
e(t).chat.messages.length <= 1 && !e(t).hideAddApi ? (o(), r("div", Te, [
|
|
232
|
-
l[7] || (l[7] = n("span", null, "Load additional APIs", -1)),
|
|
233
|
-
n("div", Pe, [
|
|
234
|
-
(o(!0), r(f, null, C(e(t).curatedDocuments.value, (s) => (o(), r("button", {
|
|
235
|
-
key: s.id,
|
|
236
|
-
class: "addAPIContext",
|
|
237
|
-
type: "button",
|
|
238
|
-
onClick: (v) => e(t).addDocument(s)
|
|
239
|
-
}, [
|
|
240
|
-
s.logoUrl ? (o(), r("img", {
|
|
241
|
-
key: 0,
|
|
242
|
-
alt: s.title,
|
|
243
|
-
class: "size-4",
|
|
244
|
-
src: s.logoUrl
|
|
245
|
-
}, null, 8, De)) : a("", !0)
|
|
246
|
-
], 8, Ie))), 128))
|
|
247
|
-
])
|
|
248
|
-
])) : a("", !0)
|
|
249
|
-
]));
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
export {
|
|
253
|
-
Xe as default
|
|
254
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { defineComponent as a, computed as t, shallowRef as l, watch as S, createElementBlock as d, openBlock as o, createBlock as h, createCommentVNode as y, unref as v } from "vue";
|
|
2
|
-
import { mergeSecurity as f, AuthSelector as R } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
|
|
3
|
-
import { getSecurityRequirements as g, getSelectedSecurity as k } from "@scalar/api-client/v2/features/operation";
|
|
4
|
-
import { useFocusWithin as x } from "@vueuse/core";
|
|
5
|
-
import { useState as A } from "../../state/state.js";
|
|
6
|
-
const N = /* @__PURE__ */ a({
|
|
7
|
-
__name: "Auth",
|
|
8
|
-
props: {
|
|
9
|
-
options: {},
|
|
10
|
-
name: {},
|
|
11
|
-
authStore: {},
|
|
12
|
-
document: {},
|
|
13
|
-
eventBus: {},
|
|
14
|
-
selectedServer: {},
|
|
15
|
-
environment: {}
|
|
16
|
-
},
|
|
17
|
-
setup(e) {
|
|
18
|
-
const { workspaceStore: i } = A(), c = t(
|
|
19
|
-
() => g(e.document?.security)
|
|
20
|
-
), s = t(
|
|
21
|
-
() => k(
|
|
22
|
-
e.authStore.getAuthSelectedSchemas({
|
|
23
|
-
type: "document",
|
|
24
|
-
documentName: e.name
|
|
25
|
-
}),
|
|
26
|
-
void 0,
|
|
27
|
-
c.value
|
|
28
|
-
)
|
|
29
|
-
), u = l(), { focused: m } = x(u), n = t(
|
|
30
|
-
() => f(
|
|
31
|
-
e.document?.components?.securitySchemes ?? {},
|
|
32
|
-
e.options.authentication?.securitySchemes,
|
|
33
|
-
e.authStore,
|
|
34
|
-
e.name
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
return S(m, (r) => {
|
|
38
|
-
r && i.update("x-scalar-active-document", e.name);
|
|
39
|
-
}), (r, B) => (o(), d("div", {
|
|
40
|
-
ref_key: "focusRef",
|
|
41
|
-
ref: u,
|
|
42
|
-
tabindex: "0"
|
|
43
|
-
}, [
|
|
44
|
-
Object.keys(n.value).length ? (o(), h(v(R), {
|
|
45
|
-
key: 0,
|
|
46
|
-
authStore: e.authStore,
|
|
47
|
-
documentSlug: e.name,
|
|
48
|
-
environment: e.environment,
|
|
49
|
-
eventBus: e.eventBus,
|
|
50
|
-
isReadOnly: "",
|
|
51
|
-
isStatic: "",
|
|
52
|
-
layout: "reference",
|
|
53
|
-
meta: { type: "document" },
|
|
54
|
-
persistAuth: e.options.persistAuth,
|
|
55
|
-
proxyUrl: e.options.proxyUrl ?? "",
|
|
56
|
-
securityRequirements: c.value,
|
|
57
|
-
securitySchemes: n.value,
|
|
58
|
-
selectedSecurity: s.value,
|
|
59
|
-
server: e.selectedServer,
|
|
60
|
-
title: "Authentication"
|
|
61
|
-
}, null, 8, ["authStore", "documentSlug", "environment", "eventBus", "persistAuth", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])) : y("", !0)
|
|
62
|
-
], 512));
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
export {
|
|
66
|
-
N as default
|
|
67
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { defineComponent as a, computed as n, createElementBlock as d, openBlock as S, createElementVNode as m, createVNode as u, unref as t } from "vue";
|
|
2
|
-
import { getSelectedServer as f } from "@scalar/api-client/v2/features/operation";
|
|
3
|
-
import { getActiveEnvironment as h, getServers as g } from "@scalar/api-client/v2/helpers";
|
|
4
|
-
import B from "../../components/ServerSelector.vue.js";
|
|
5
|
-
import { useState as x } from "../../state/state.js";
|
|
6
|
-
import y from "./Auth.vue.js";
|
|
7
|
-
const k = { class: "docSettings" }, C = /* @__PURE__ */ a({
|
|
8
|
-
__name: "DocSettings",
|
|
9
|
-
props: {
|
|
10
|
-
document: {},
|
|
11
|
-
name: {}
|
|
12
|
-
},
|
|
13
|
-
setup(e) {
|
|
14
|
-
const { workspaceStore: r, config: i, eventBus: c } = x(), l = n(
|
|
15
|
-
() => h(r, e.document)
|
|
16
|
-
), o = n(() => {
|
|
17
|
-
const s = g(e.document.servers, {
|
|
18
|
-
documentUrl: e.document["x-scalar-original-source-url"]
|
|
19
|
-
});
|
|
20
|
-
return f(s, e.document["x-scalar-selected-server"]);
|
|
21
|
-
}), v = n(
|
|
22
|
-
() => e.document.components?.securitySchemes ?? {}
|
|
23
|
-
);
|
|
24
|
-
return (s, p) => (S(), d("div", k, [
|
|
25
|
-
m("div", null, [
|
|
26
|
-
u(y, {
|
|
27
|
-
authStore: t(r).auth,
|
|
28
|
-
document: e.document,
|
|
29
|
-
environment: l.value,
|
|
30
|
-
eventBus: t(c),
|
|
31
|
-
name: e.name,
|
|
32
|
-
options: t(i),
|
|
33
|
-
securitySchemes: v.value,
|
|
34
|
-
selectedServer: o.value
|
|
35
|
-
}, null, 8, ["authStore", "document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
|
|
36
|
-
]),
|
|
37
|
-
m("div", null, [
|
|
38
|
-
u(B, {
|
|
39
|
-
eventBus: t(c),
|
|
40
|
-
selectedServer: o.value,
|
|
41
|
-
servers: e.document.servers ?? []
|
|
42
|
-
}, null, 8, ["eventBus", "selectedServer", "servers"])
|
|
43
|
-
])
|
|
44
|
-
]));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
C as default
|
|
49
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { defineComponent as k, createBlock as c, openBlock as r, unref as e, withCtx as S, createElementVNode as o, createVNode as d, createElementBlock as a, Fragment as _, renderList as h, createCommentVNode as y, normalizeClass as C, createTextVNode as m, toDisplayString as v, isRef as R } from "vue";
|
|
2
|
-
import { ScalarModal as x, ScalarColorModeToggle as U, ScalarTextInput as w } from "@scalar/components";
|
|
3
|
-
import { ScalarIconCaretDown as D, ScalarIconCaretRight as b } from "@scalar/icons";
|
|
4
|
-
import { URLS as p } from "../../consts/urls.js";
|
|
5
|
-
import { useState as O } from "../../state/state.js";
|
|
6
|
-
import L from "./DocSettings.vue.js";
|
|
7
|
-
const V = { class: "settingsHeading" }, N = { class: "documentList" }, P = ["onClick"], T = { key: 0 }, A = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "noDocuments"
|
|
10
|
-
}, E = { class: "proxyUrlContainer" }, I = ["href"], z = /* @__PURE__ */ k({
|
|
11
|
-
__name: "Settings",
|
|
12
|
-
props: {
|
|
13
|
-
modalState: {}
|
|
14
|
-
},
|
|
15
|
-
setup(f) {
|
|
16
|
-
const { workspaceStore: s, proxyUrlRaw: i } = O();
|
|
17
|
-
function g(u) {
|
|
18
|
-
s.update("x-scalar-active-document", u);
|
|
19
|
-
}
|
|
20
|
-
return (u, t) => (r(), c(e(x), {
|
|
21
|
-
class: "settingsModal",
|
|
22
|
-
state: f.modalState
|
|
23
|
-
}, {
|
|
24
|
-
default: S(() => [
|
|
25
|
-
o("div", V, [
|
|
26
|
-
t[1] || (t[1] = o("h1", null, "Settings", -1)),
|
|
27
|
-
d(e(U), { class: "colorToggle ml-auto" })
|
|
28
|
-
]),
|
|
29
|
-
o("div", N, [
|
|
30
|
-
Object.entries(e(s).workspace.documents).length ? (r(!0), a(_, { key: 0 }, h(Object.entries(
|
|
31
|
-
e(s).workspace.documents
|
|
32
|
-
), ([l, n]) => (r(), a("div", {
|
|
33
|
-
key: l,
|
|
34
|
-
class: "document"
|
|
35
|
-
}, [
|
|
36
|
-
o("button", {
|
|
37
|
-
class: C(["documentName", {
|
|
38
|
-
documentNameActive: e(s).workspace.activeDocument === n
|
|
39
|
-
}]),
|
|
40
|
-
type: "button",
|
|
41
|
-
onClick: (B) => g(l)
|
|
42
|
-
}, [
|
|
43
|
-
m(" @" + v(l) + " ", 1),
|
|
44
|
-
e(s).workspace.activeDocument === n ? (r(), c(e(D), { key: 0 })) : (r(), c(e(b), { key: 1 }))
|
|
45
|
-
], 10, P),
|
|
46
|
-
e(s).workspace.activeDocument === n ? (r(), a("div", T, [
|
|
47
|
-
d(L, {
|
|
48
|
-
document: n,
|
|
49
|
-
name: l
|
|
50
|
-
}, null, 8, ["document", "name"])
|
|
51
|
-
])) : y("", !0)
|
|
52
|
-
]))), 128)) : (r(), a("div", A, " There's no API definition loaded. Use the + button to load APIs. "))
|
|
53
|
-
]),
|
|
54
|
-
o("div", E, [
|
|
55
|
-
t[3] || (t[3] = o("label", { for: "proxyUrl" }, "CORS Proxy", -1)),
|
|
56
|
-
o("p", null, [
|
|
57
|
-
t[2] || (t[2] = m(" All requests will be sent through the specified proxy URL to help avoid CORS (Cross-Origin Resource Sharing) issues. ", -1)),
|
|
58
|
-
o("a", {
|
|
59
|
-
class: "underline",
|
|
60
|
-
href: e(p).PROXY_SOURCE_CODE,
|
|
61
|
-
target: "_blank"
|
|
62
|
-
}, " Read more ", 8, I)
|
|
63
|
-
]),
|
|
64
|
-
d(e(w), {
|
|
65
|
-
id: "proxyUrl",
|
|
66
|
-
modelValue: e(i),
|
|
67
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) => R(i) ? i.value = l : null),
|
|
68
|
-
label: "Proxy URL",
|
|
69
|
-
placeholder: e(p).DEFAULT_PROXY_URL
|
|
70
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
71
|
-
])
|
|
72
|
-
]),
|
|
73
|
-
_: 1
|
|
74
|
-
}, 8, ["state"]));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
export {
|
|
78
|
-
z as default
|
|
79
|
-
};
|
package/dist/views/Start.vue.js
DELETED
package/dist/views/Start.vue2.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, createElementBlock as r, openBlock as s, createVNode as i, createElementVNode as t, createTextVNode as o, unref as a, Fragment as m } from "vue";
|
|
2
|
-
import f from "../components/Logo.vue.js";
|
|
3
|
-
import { URLS as l } from "../consts/urls.js";
|
|
4
|
-
import { useState as c } from "../state/state.js";
|
|
5
|
-
import y from "./PromptForm.vue.js";
|
|
6
|
-
const _ = { class: "startContainer" }, S = { class: "disclaimerText" }, k = ["href"], A = ["href"], T = /* @__PURE__ */ g({
|
|
7
|
-
__name: "Start",
|
|
8
|
-
emits: ["submit", "uploadApi"],
|
|
9
|
-
setup(b, { emit: p }) {
|
|
10
|
-
const n = p, { mode: d } = c();
|
|
11
|
-
return (v, e) => (s(), r("div", _, [
|
|
12
|
-
i(f, { class: "agentLogo" }),
|
|
13
|
-
e[4] || (e[4] = t("h1", { class: "heading" }, "How can I help you today?", -1)),
|
|
14
|
-
i(y, {
|
|
15
|
-
ref: "promptFormField",
|
|
16
|
-
onSubmit: e[0] || (e[0] = (u) => n("submit")),
|
|
17
|
-
onUploadApi: e[1] || (e[1] = (u) => n("uploadApi"))
|
|
18
|
-
}, null, 512),
|
|
19
|
-
t("p", S, [
|
|
20
|
-
a(d) === "preview" ? (s(), r(m, { key: 0 }, [
|
|
21
|
-
o(" By messaging Agent Scalar your OpenAPI document will be temporarily uploaded to Scalar's servers. You must agree to our ")
|
|
22
|
-
], 64)) : (s(), r(m, { key: 1 }, [
|
|
23
|
-
o("By messaging Agent Scalar you agree to our ")
|
|
24
|
-
], 64)),
|
|
25
|
-
t("a", {
|
|
26
|
-
class: "disclaimerLink",
|
|
27
|
-
href: a(l).TERMS_AND_CONDITIONS,
|
|
28
|
-
target: "_blank"
|
|
29
|
-
}, "Terms", 8, k),
|
|
30
|
-
e[2] || (e[2] = o(" and ", -1)),
|
|
31
|
-
t("a", {
|
|
32
|
-
class: "disclaimerLink",
|
|
33
|
-
href: a(l).PRIVACY_POLICY,
|
|
34
|
-
target: "_blank"
|
|
35
|
-
}, "Privacy Policy", 8, A),
|
|
36
|
-
e[3] || (e[3] = o(". ", -1))
|
|
37
|
-
])
|
|
38
|
-
]));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
T as default
|
|
43
|
-
};
|