@scalar/api-client 2.22.0 → 2.22.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 +56 -0
- package/dist/hooks/useClientConfig.d.ts +6 -3
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +23 -29
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +45 -43
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +0 -6
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue2.js +50 -63
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +0 -3
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +55 -53
- package/dist/v2/features/app/App.vue.d.ts +3 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +46 -43
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +33 -28
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -127
- package/dist/v2/features/app/index.d.ts +3 -0
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +17 -11
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +6 -6
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +2 -2
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +60 -56
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/features/search/hooks/use-search-index.d.ts +3 -7
- package/dist/v2/features/search/hooks/use-search-index.d.ts.map +1 -1
- package/dist/v2/features/search/hooks/use-search-index.js +12 -18
- package/dist/v2/features/search/index.d.ts +1 -2
- package/dist/v2/features/search/index.d.ts.map +1 -1
- package/dist/v2/features/search/index.js +2 -4
- package/dist/v2/features/search/types.d.ts +1 -1
- package/dist/v2/features/search/types.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +54 -52
- package/package.json +19 -19
- package/dist/v2/features/search/components/SearchButton.vue.d.ts +0 -12
- package/dist/v2/features/search/components/SearchButton.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchButton.vue.js +0 -71
- package/dist/v2/features/search/components/SearchButton.vue2.js +0 -4
- package/dist/v2/features/search/components/SearchModal.vue.d.ts +0 -11
- package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchModal.vue.js +0 -7
- package/dist/v2/features/search/components/SearchModal.vue2.js +0 -102
- package/dist/v2/features/search/components/SearchResult.vue.d.ts +0 -10
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchResult.vue.js +0 -80
- package/dist/v2/features/search/components/SearchResult.vue2.js +0 -4
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { useAppState as
|
|
2
|
-
import {
|
|
3
|
-
import { default as
|
|
1
|
+
import { useAppState as a } from "./app-state.js";
|
|
2
|
+
import { default as p } from "./components/CreateWorkspaceModal.vue.js";
|
|
3
|
+
import { default as f } from "../command-palette/components/CommandActionForm.vue.js";
|
|
4
|
+
import { default as n } from "../command-palette/components/CommandActionInput.vue.js";
|
|
5
|
+
import { baseClientActions as u, baseRoutes as d, useCommandPaletteState as i } from "../command-palette/hooks/use-command-palette-state.js";
|
|
6
|
+
import { default as x } from "./App.vue.js";
|
|
4
7
|
/* empty css */
|
|
5
|
-
import { createApiClientApp as
|
|
8
|
+
import { createApiClientApp as c, createAppRouter as b } from "./helpers/create-api-client-app.js";
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
x as ClientApp,
|
|
11
|
+
f as CommandActionForm,
|
|
12
|
+
n as CommandActionInput,
|
|
13
|
+
p as CreateWorkspaceModal,
|
|
14
|
+
u as baseClientActions,
|
|
15
|
+
d as baseRoutes,
|
|
16
|
+
c as createApiClientApp,
|
|
17
|
+
b as createAppRouter,
|
|
18
|
+
a as useAppState,
|
|
19
|
+
i as useCommandPaletteState
|
|
14
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"AA0WA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAIV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAWvC,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,mCAAmC,CAAA;AAG1C;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBAscC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TheCommandPalette.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2fe57517"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as
|
|
1
|
+
import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as D, withDirectives as Q, toDisplayString as B, vShow as A, normalizeClass as F, resolveDynamicComponent as O, mergeProps as G, nextTick as H } from "vue";
|
|
2
2
|
import { Dialog as U, DialogPanel as W, DialogTitle as $ } from "@headlessui/vue";
|
|
3
3
|
import { ScalarIconMagnifyingGlass as j, ScalarIconCaretLeft as q } from "@scalar/icons";
|
|
4
4
|
import { useRouter as J } from "vue-router";
|
|
@@ -58,7 +58,7 @@ const Y = {
|
|
|
58
58
|
eventBus: e.eventBus,
|
|
59
59
|
...e.paletteState.activeCommandProps.value
|
|
60
60
|
})), N = (t) => {
|
|
61
|
-
t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
|
|
61
|
+
t?.event && t.event.preventDefault(), t && "action" in t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
|
|
62
62
|
};
|
|
63
63
|
return R(() => e.eventBus.on("ui:open:command-palette", N)), X(() => e.eventBus.off("ui:open:command-palette", N)), (t, a) => (l(), v(r(U), {
|
|
64
64
|
open: e.paletteState.isOpen.value,
|
|
@@ -113,13 +113,13 @@ const Y = {
|
|
|
113
113
|
]
|
|
114
114
|
}, null, 40, ee)
|
|
115
115
|
]),
|
|
116
|
-
(l(!0), s(h, null,
|
|
116
|
+
(l(!0), s(h, null, D(e.paletteState.filteredCommands.value, (n) => (l(), s(h, {
|
|
117
117
|
key: n.label || "100"
|
|
118
118
|
}, [
|
|
119
|
-
Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" },
|
|
119
|
+
Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, B(n.label), 513), [
|
|
120
120
|
[A, n.commands.length > 0]
|
|
121
121
|
]),
|
|
122
|
-
(l(!0), s(h, null,
|
|
122
|
+
(l(!0), s(h, null, D(n.commands, (o) => (l(), s("button", {
|
|
123
123
|
id: o.id,
|
|
124
124
|
key: o.id,
|
|
125
125
|
class: F(["commandmenu-item hover:bg-b-2 flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left text-sm", {
|
|
@@ -134,7 +134,7 @@ const Y = {
|
|
|
134
134
|
size: "md",
|
|
135
135
|
thickness: "1.5"
|
|
136
136
|
})) : S("", !0),
|
|
137
|
-
I(" " +
|
|
137
|
+
I(" " + B(o.name), 1)
|
|
138
138
|
], 10, te))), 128))
|
|
139
139
|
], 64))), 128)),
|
|
140
140
|
e.paletteState.filteredCommands.value.flatMap((n) => n.commands).length ? S("", !0) : (l(), s("div", ne, " No commands found "))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScalarIconComponent } from '@scalar/icons/types';
|
|
2
2
|
import type { CommandPalettePayload } from '@scalar/workspace-store/events';
|
|
3
|
-
import { type Component, type ComputedRef, type Ref, type ShallowRef } from 'vue';
|
|
3
|
+
import { type Component, type ComputedRef, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
|
|
4
4
|
import type { RouteLocationRaw } from 'vue-router';
|
|
5
5
|
/**
|
|
6
6
|
* Command IDs that map to UI components (folder and hidden-folder types)
|
|
@@ -100,7 +100,7 @@ export type CommandPaletteState = {
|
|
|
100
100
|
* // Close and reset
|
|
101
101
|
* palette.close()
|
|
102
102
|
*/
|
|
103
|
-
export declare const useCommandPaletteState: (actions?: CommandPaletteAction[]
|
|
103
|
+
export declare const useCommandPaletteState: (actions?: MaybeRefOrGetter<CommandPaletteAction[]>, routes?: MaybeRefOrGetter<CommandPaletteRoute[]>) => CommandPaletteState;
|
|
104
104
|
/**
|
|
105
105
|
* The base naviation routes used in the command palette.
|
|
106
106
|
* This object can be extended and passed to the useCommandPaletteState hook to add custom routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,
|
|
1
|
+
{"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CA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61 +1,65 @@
|
|
|
1
|
-
import { useModal as
|
|
2
|
-
import { ScalarIconArrowSquareIn as
|
|
3
|
-
import
|
|
4
|
-
import { ref as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useModal as k } from "@scalar/components";
|
|
2
|
+
import { ScalarIconArrowSquareIn as y, ScalarIconPackage as _, ScalarIconFolder as P, ScalarIconArrowUpRight as A, ScalarIconPuzzlePiece as R, ScalarIconBracketsCurly as b, ScalarIconCookie as q, ScalarIconSlidersHorizontal as L } from "@scalar/icons";
|
|
3
|
+
import d from "fuse.js";
|
|
4
|
+
import { ref as p, shallowRef as $, computed as o, toValue as a } from "vue";
|
|
5
|
+
import x from "../components/CommandPaletteDocument.vue.js";
|
|
6
|
+
import z from "../components/CommandPaletteExample.vue.js";
|
|
7
|
+
import F from "../components/CommandPaletteImport.vue.js";
|
|
8
|
+
import U from "../components/CommandPaletteImportCurl.vue.js";
|
|
9
|
+
import E from "../components/CommandPaletteRequest.vue.js";
|
|
10
|
+
import O from "../components/CommandPaletteTag.vue.js";
|
|
11
|
+
const W = (m = B, l = Q) => {
|
|
12
|
+
const c = k(), n = p(""), s = $(null), i = p(null), f = o(() => c.open), v = o(
|
|
13
|
+
() => new d(a(m), {
|
|
14
|
+
keys: ["name"],
|
|
15
|
+
threshold: 0.1
|
|
16
|
+
})
|
|
17
|
+
), C = o(
|
|
18
|
+
() => new d(a(l), {
|
|
19
|
+
keys: ["name"],
|
|
20
|
+
threshold: 0.1
|
|
21
|
+
})
|
|
22
|
+
), S = o(() => {
|
|
19
23
|
const e = n.value.toLowerCase().trim();
|
|
20
|
-
return (e ?
|
|
21
|
-
}),
|
|
24
|
+
return (e ? v.value.search(e).map((t) => t.item) : a(m)).filter((t) => !t.hidden);
|
|
25
|
+
}), w = o(() => {
|
|
22
26
|
const e = n.value.toLowerCase().trim();
|
|
23
|
-
return e ?
|
|
24
|
-
}),
|
|
25
|
-
e && (
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
27
|
+
return e ? C.value.search(e).map((r) => r.item) : a(l);
|
|
28
|
+
}), g = (e, ...r) => {
|
|
29
|
+
e && (s.value = a(m).find((t) => t.id === e) ?? null, i.value = r[0] ?? null), c.show();
|
|
30
|
+
}, h = () => {
|
|
31
|
+
c.hide(), u();
|
|
32
|
+
}, I = (e) => {
|
|
29
33
|
n.value = e;
|
|
30
|
-
},
|
|
31
|
-
n.value = "",
|
|
34
|
+
}, u = () => {
|
|
35
|
+
n.value = "", s.value = null, i.value = null;
|
|
32
36
|
};
|
|
33
37
|
return {
|
|
34
|
-
isOpen:
|
|
35
|
-
activeCommand:
|
|
36
|
-
activeCommandProps:
|
|
38
|
+
isOpen: f,
|
|
39
|
+
activeCommand: s,
|
|
40
|
+
activeCommandProps: i,
|
|
37
41
|
filterQuery: n,
|
|
38
|
-
filteredCommands:
|
|
42
|
+
filteredCommands: o(() => [
|
|
39
43
|
{
|
|
40
44
|
label: "",
|
|
41
|
-
commands:
|
|
45
|
+
commands: S.value
|
|
42
46
|
},
|
|
43
47
|
{
|
|
44
48
|
label: "Pages",
|
|
45
|
-
commands:
|
|
49
|
+
commands: w.value
|
|
46
50
|
}
|
|
47
51
|
]),
|
|
48
|
-
open:
|
|
49
|
-
close:
|
|
50
|
-
setFilterQuery:
|
|
51
|
-
reset:
|
|
52
|
+
open: g,
|
|
53
|
+
close: h,
|
|
54
|
+
setFilterQuery: I,
|
|
55
|
+
reset: u
|
|
52
56
|
};
|
|
53
|
-
},
|
|
57
|
+
}, Q = [
|
|
54
58
|
{
|
|
55
59
|
type: "route",
|
|
56
60
|
id: "environment",
|
|
57
61
|
name: "Environment",
|
|
58
|
-
icon:
|
|
62
|
+
icon: b,
|
|
59
63
|
to: {
|
|
60
64
|
name: "workspace.environment"
|
|
61
65
|
}
|
|
@@ -73,51 +77,51 @@ const V = (a = Q, i = O) => {
|
|
|
73
77
|
type: "route",
|
|
74
78
|
id: "settings",
|
|
75
79
|
name: "Settings",
|
|
76
|
-
icon:
|
|
80
|
+
icon: L,
|
|
77
81
|
to: {
|
|
78
82
|
name: "workspace.settings"
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
|
-
],
|
|
85
|
+
], B = [
|
|
82
86
|
{
|
|
83
87
|
id: "import-from-openapi-swagger-postman-curl",
|
|
84
88
|
name: "Import from OpenAPI/Swagger/Postman/cURL",
|
|
85
|
-
component:
|
|
86
|
-
icon:
|
|
89
|
+
component: F,
|
|
90
|
+
icon: y
|
|
87
91
|
},
|
|
88
92
|
{
|
|
89
93
|
id: "create-document",
|
|
90
94
|
name: "Create Document",
|
|
91
|
-
component:
|
|
92
|
-
icon:
|
|
95
|
+
component: x,
|
|
96
|
+
icon: _
|
|
93
97
|
},
|
|
94
98
|
{
|
|
95
99
|
id: "add-tag",
|
|
96
100
|
name: "Add Tag",
|
|
97
|
-
component:
|
|
98
|
-
icon:
|
|
101
|
+
component: O,
|
|
102
|
+
icon: P
|
|
99
103
|
},
|
|
100
104
|
{
|
|
101
105
|
id: "create-request",
|
|
102
106
|
name: "Create Request",
|
|
103
|
-
component:
|
|
104
|
-
icon:
|
|
107
|
+
component: E,
|
|
108
|
+
icon: A
|
|
105
109
|
},
|
|
106
110
|
{
|
|
107
111
|
id: "add-example",
|
|
108
112
|
name: "Add Example",
|
|
109
|
-
component:
|
|
110
|
-
icon:
|
|
113
|
+
component: z,
|
|
114
|
+
icon: R
|
|
111
115
|
},
|
|
112
116
|
{
|
|
113
117
|
id: "import-curl-command",
|
|
114
118
|
name: "Import cURL Command",
|
|
115
119
|
hidden: !0,
|
|
116
|
-
component:
|
|
120
|
+
component: U
|
|
117
121
|
}
|
|
118
122
|
];
|
|
119
123
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
B as baseClientActions,
|
|
125
|
+
Q as baseRoutes,
|
|
126
|
+
W as useCommandPaletteState
|
|
123
127
|
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
import { type MaybeRefOrGetter } from 'vue';
|
|
3
|
-
import type { FuseData } from '../types';
|
|
4
3
|
/**
|
|
5
|
-
* Creates the search index from
|
|
4
|
+
* Creates the search index from multiple OpenAPI documents
|
|
6
5
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
results: import("vue").ComputedRef<
|
|
9
|
-
item: FuseData;
|
|
10
|
-
refIndex: number;
|
|
11
|
-
}[]>;
|
|
6
|
+
export declare const useSearchIndex: (documents: MaybeRefOrGetter<OpenApiDocument[]>) => {
|
|
7
|
+
results: import("vue").ComputedRef<import("@scalar/workspace-store/schemas/navigation").TraversedEntry[] | null>;
|
|
12
8
|
query: import("vue").Ref<string, string>;
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=use-search-index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/hooks/use-search-index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-search-index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/hooks/use-search-index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,KAAK,CAAA;AAOnE;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,gBAAgB,CAAC,eAAe,EAAE,CAAC;;;CAiC5E,CAAA"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { computed as n, toValue as
|
|
2
|
-
import { createFuseInstance as
|
|
3
|
-
import { createSearchIndex as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}), e = a("");
|
|
1
|
+
import { computed as n, toValue as o, ref as c } from "vue";
|
|
2
|
+
import { createFuseInstance as a } from "../helpers/create-fuse-instance.js";
|
|
3
|
+
import { createSearchIndex as l } from "../helpers/create-search-index.js";
|
|
4
|
+
const i = 25, h = (s) => {
|
|
5
|
+
const u = n(() => {
|
|
6
|
+
const t = a();
|
|
7
|
+
return t.setCollection(l(o(s))), t;
|
|
8
|
+
}), e = c("");
|
|
10
9
|
return {
|
|
11
|
-
results: n(() => e.value.length !== 0 ?
|
|
12
|
-
limit:
|
|
13
|
-
})
|
|
14
|
-
(c, u) => ({
|
|
15
|
-
item: c,
|
|
16
|
-
refIndex: u
|
|
17
|
-
})
|
|
18
|
-
)),
|
|
10
|
+
results: n(() => e.value.length !== 0 ? u.value.search(e.value, {
|
|
11
|
+
limit: i
|
|
12
|
+
}).flatMap((r) => r.item.entry.type !== "operation" ? [] : r.item.entry) : null),
|
|
19
13
|
query: e
|
|
20
14
|
};
|
|
21
|
-
}
|
|
15
|
+
};
|
|
22
16
|
export {
|
|
23
17
|
h as useSearchIndex
|
|
24
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { default as t } from "./components/SearchModal.vue.js";
|
|
1
|
+
import { useSearchIndex as o } from "./hooks/use-search-index.js";
|
|
3
2
|
export {
|
|
4
|
-
o as
|
|
5
|
-
t as SearchModal
|
|
3
|
+
o as useSearchIndex
|
|
6
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF,KAAK,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,CAAA;AAEhD,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,aAAa,GAAG,QAAQ,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,WAAW,GAAG,QAAQ,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,KAAK,OAAO,GAAG,QAAQ,GAAG;IACxB,IAAI,EAAE,KAAK,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
|
2
2
|
const r = {
|
|
3
3
|
Enter: { event: "operation:send:request:hotkey", modifiers: ["default"] },
|
|
4
4
|
b: { event: "ui:toggle:sidebar", modifiers: ["default"] },
|
|
5
|
-
|
|
5
|
+
k: { event: "ui:open:command-palette", modifiers: ["default"] },
|
|
6
6
|
l: { event: "ui:focus:address-bar", modifiers: ["default"] }
|
|
7
7
|
}, n = {
|
|
8
8
|
web: 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.22.
|
|
36
|
+
}, v = "2.22.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", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AA8BD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAU,UAAU,MAAM,EAAE,UAAU,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAkB3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,UAAU;AAChB,wEAAwE;AACxE,cAAc,MAAM;AACpB,kCAAkC;AAClC,WAAW,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA0K/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,eAAe,EACrB,QAAQ,MAAM,EACd,2BAIG;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,YAAK,EACN,cAAc,MAAM,GAAG,SAAS,KAC/B,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA2F/B,CAAA"}
|
|
@@ -1,113 +1,115 @@
|
|
|
1
|
+
import { isRelativePath as U } from "@scalar/helpers/url/is-relative-path";
|
|
1
2
|
import { makeUrlAbsolute as x } from "@scalar/helpers/url/make-url-absolute";
|
|
2
|
-
import { shouldUseProxy as
|
|
3
|
-
import { encode as
|
|
4
|
-
const
|
|
3
|
+
import { shouldUseProxy as f } from "@scalar/helpers/url/redirect-to-proxy";
|
|
4
|
+
import { encode as A, fromUint8Array as k } from "js-base64";
|
|
5
|
+
const w = (e) => {
|
|
6
|
+
const a = e?.url;
|
|
7
|
+
return a ? U(a) ? typeof window > "u" ? {} : { basePath: a } : { baseUrl: a } : {};
|
|
8
|
+
}, b = () => {
|
|
5
9
|
const e = new Uint8Array(32);
|
|
6
|
-
return crypto.getRandomValues(e),
|
|
7
|
-
},
|
|
8
|
-
if (
|
|
10
|
+
return crypto.getRandomValues(e), k(e, !0);
|
|
11
|
+
}, E = async (e, a) => {
|
|
12
|
+
if (a === "plain")
|
|
9
13
|
return e;
|
|
10
14
|
if (typeof crypto?.subtle?.digest != "function")
|
|
11
15
|
return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), e;
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
16
|
+
const c = new TextEncoder().encode(e), o = await crypto.subtle.digest("SHA-256", c);
|
|
17
|
+
return k(new Uint8Array(o), !0);
|
|
18
|
+
}, $ = async (e, a, u) => {
|
|
15
19
|
try {
|
|
16
20
|
if (!e)
|
|
17
21
|
return [new Error("Flow not found"), null];
|
|
18
|
-
const
|
|
22
|
+
const c = e.selectedScopes.join(" ");
|
|
19
23
|
if (e.type === "clientCredentials" || e.type === "password")
|
|
20
|
-
return
|
|
24
|
+
return S(
|
|
21
25
|
e,
|
|
22
|
-
|
|
26
|
+
c,
|
|
23
27
|
{
|
|
24
28
|
proxyUrl: u
|
|
25
29
|
},
|
|
26
|
-
|
|
30
|
+
a
|
|
27
31
|
);
|
|
28
|
-
const o = (Math.random() + 1).toString(36).substring(2, 10), _ = x(e.authorizationUrl,
|
|
29
|
-
baseUrl: c?.url
|
|
30
|
-
}), t = new URL(_);
|
|
32
|
+
const o = (Math.random() + 1).toString(36).substring(2, 10), _ = x(e.authorizationUrl, w(a)), t = new URL(_);
|
|
31
33
|
let y = null;
|
|
32
34
|
if (e.type === "implicit")
|
|
33
35
|
t.searchParams.set("response_type", "token");
|
|
34
36
|
else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
|
|
35
|
-
const r =
|
|
37
|
+
const r = b(), s = await E(r, e["x-usePkce"]);
|
|
36
38
|
y = {
|
|
37
39
|
codeVerifier: r,
|
|
38
|
-
codeChallenge:
|
|
40
|
+
codeChallenge: s,
|
|
39
41
|
codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
40
|
-
}, t.searchParams.set("code_challenge",
|
|
42
|
+
}, t.searchParams.set("code_challenge", s), t.searchParams.set("code_challenge_method", y.codeChallengeMethod);
|
|
41
43
|
}
|
|
42
44
|
if (e["x-scalar-redirect-uri"].startsWith("/")) {
|
|
43
|
-
const r =
|
|
44
|
-
t.searchParams.set("redirect_uri",
|
|
45
|
+
const r = a?.url || window.location.origin + window.location.pathname, s = x(e["x-scalar-redirect-uri"], { baseUrl: r });
|
|
46
|
+
t.searchParams.set("redirect_uri", s);
|
|
45
47
|
} else
|
|
46
48
|
t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
|
|
47
49
|
e["x-scalar-security-query"] && Object.keys(e["x-scalar-security-query"]).forEach((r) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
}), t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", o),
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
-
let h = null,
|
|
50
|
+
const s = e["x-scalar-security-query"]?.[r];
|
|
51
|
+
s && t.searchParams.set(r, s);
|
|
52
|
+
}), t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", o), c && t.searchParams.set("scope", c);
|
|
53
|
+
const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
54
|
+
return n ? new Promise((r) => {
|
|
55
|
+
const s = setInterval(() => {
|
|
56
|
+
let h = null, d = null, l = null, m = null;
|
|
55
57
|
try {
|
|
56
|
-
const i = new URL(
|
|
57
|
-
h = i.get(P),
|
|
58
|
-
const g = new URLSearchParams(
|
|
59
|
-
h ||= g.get(P),
|
|
58
|
+
const i = new URL(n.location.href).searchParams, P = e["x-tokenName"] || "access_token";
|
|
59
|
+
h = i.get(P), d = i.get("code"), l = i.get("error"), m = i.get("error_description");
|
|
60
|
+
const g = new URLSearchParams(n.location.href.split("#")[1]);
|
|
61
|
+
h ||= g.get(P), d ||= g.get("code"), l ||= g.get("error"), m ||= g.get("error_description");
|
|
60
62
|
} catch {
|
|
61
63
|
}
|
|
62
|
-
if (
|
|
63
|
-
if (clearInterval(
|
|
64
|
-
r([new Error(`OAuth error: ${
|
|
64
|
+
if (n.closed || h || d || l)
|
|
65
|
+
if (clearInterval(s), n.close(), l)
|
|
66
|
+
r([new Error(`OAuth error: ${l}${m ? ` (${m})` : ""}`), null]);
|
|
65
67
|
else if (h) {
|
|
66
|
-
const i =
|
|
68
|
+
const i = n.location.href.match(/state=([^&]*)/)?.[1];
|
|
67
69
|
r(i === o ? [null, h] : [new Error("State mismatch"), null]);
|
|
68
|
-
} else
|
|
70
|
+
} else d ? new URL(n.location.href).searchParams.get("state") === o ? S(
|
|
69
71
|
e,
|
|
70
|
-
|
|
72
|
+
c,
|
|
71
73
|
{
|
|
72
|
-
code:
|
|
74
|
+
code: d,
|
|
73
75
|
pkce: y,
|
|
74
76
|
proxyUrl: u
|
|
75
77
|
},
|
|
76
|
-
|
|
77
|
-
).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(
|
|
78
|
+
a
|
|
79
|
+
).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(s), r([new Error("Window was closed without granting authorization"), null]));
|
|
78
80
|
}, 200);
|
|
79
81
|
}) : [new Error("Failed to open auth window"), null];
|
|
80
82
|
} catch {
|
|
81
83
|
return [new Error("Failed to authorize oauth2 flow"), null];
|
|
82
84
|
}
|
|
83
|
-
},
|
|
85
|
+
}, S = async (e, a, {
|
|
84
86
|
code: u,
|
|
85
|
-
pkce:
|
|
87
|
+
pkce: c,
|
|
86
88
|
proxyUrl: o
|
|
87
89
|
} = {}, _) => {
|
|
88
90
|
if (!e)
|
|
89
91
|
return [new Error("OAuth2 flow was not defined"), null];
|
|
90
92
|
const t = new URLSearchParams();
|
|
91
|
-
t.set("client_id", e["x-scalar-client-id"]),
|
|
92
|
-
|
|
93
|
+
t.set("client_id", e["x-scalar-client-id"]), a && (e.type === "clientCredentials" || e.type === "password") && t.set("scope", a), e.clientSecret && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "body") && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), u ? (t.set("code", u), t.set("grant_type", "authorization_code"), c && t.set("code_verifier", c.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials"), e["x-scalar-security-body"] && Object.entries(e["x-scalar-security-body"]).forEach(([p, n]) => {
|
|
94
|
+
n && t.set(p, n);
|
|
93
95
|
});
|
|
94
96
|
try {
|
|
95
97
|
const p = {
|
|
96
98
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
97
99
|
};
|
|
98
|
-
e.clientSecret && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "header") && (p.Authorization = `Basic ${
|
|
99
|
-
const r = x(e.tokenUrl,
|
|
100
|
+
e.clientSecret && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "header") && (p.Authorization = `Basic ${A(`${e["x-scalar-client-id"]}:${e.clientSecret}`)}`);
|
|
101
|
+
const r = x(e.tokenUrl, w(_)), s = f(o, r) ? `${o}?${new URLSearchParams([["scalar_url", r]]).toString()}` : r, d = await (await fetch(s, {
|
|
100
102
|
method: "POST",
|
|
101
103
|
headers: p,
|
|
102
104
|
body: t
|
|
103
|
-
})).json(),
|
|
104
|
-
return [null, l
|
|
105
|
+
})).json(), l = e["x-tokenName"] || "access_token";
|
|
106
|
+
return [null, d[l]];
|
|
105
107
|
} catch {
|
|
106
108
|
return [new Error("Failed to get an access token. Please check your credentials."), null];
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
$ as authorizeOauth2,
|
|
113
|
+
S as authorizeServers,
|
|
114
|
+
E as generateCodeChallenge
|
|
113
115
|
};
|