@scalar/api-client 2.1.47 → 2.1.49
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 +31 -0
- package/dist/assets/keycap.ascii.js +25 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +6 -6
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/codeVariableWidget.js +12 -12
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +13 -13
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts +1 -3
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +11 -11
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/requests.d.ts +40 -0
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +65 -55
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +24 -29
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +71 -71
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +23 -23
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +18 -18
- package/dist/views/Request/RequestSidebar.vue.d.ts +2 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +169 -133
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +181 -155
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -0
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +155 -96
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +26 -21
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +5 -97
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +97 -2
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +74 -34
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +15 -15
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 49ccdee: refactor: updates regexHelpers
|
|
8
|
+
- 45342e3: style(api-client): add import button and command k ascii art in empty state
|
|
9
|
+
- d0c93f5: feat: adds clear drafts action to draft collection
|
|
10
|
+
- 8b54fac: fix(api-client): overflow scroll mobile on api client
|
|
11
|
+
- Updated dependencies [49ccdee]
|
|
12
|
+
- Updated dependencies [0a34402]
|
|
13
|
+
- @scalar/oas-utils@0.2.75
|
|
14
|
+
- @scalar/components@0.12.69
|
|
15
|
+
- @scalar/use-codemirror@0.11.36
|
|
16
|
+
|
|
17
|
+
## 2.1.48
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- b5c1982: style(api-client): fix a handful of z-index and flex breakpoint issues
|
|
22
|
+
- ac55d0f: chore: add time logging for the workspace store
|
|
23
|
+
- 0c07766: fix: sets selection style properly"
|
|
24
|
+
- bdb48b0: fix: remove useTemplateRef
|
|
25
|
+
- Updated dependencies [b5c1982]
|
|
26
|
+
- Updated dependencies [ac55d0f]
|
|
27
|
+
- Updated dependencies [0c07766]
|
|
28
|
+
- Updated dependencies [7f1bd17]
|
|
29
|
+
- @scalar/components@0.12.68
|
|
30
|
+
- @scalar/oas-utils@0.2.74
|
|
31
|
+
- @scalar/use-codemirror@0.11.35
|
|
32
|
+
- @scalar/themes@0.9.48
|
|
33
|
+
|
|
3
34
|
## 2.1.47
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const n = ` .:=+++++=================-
|
|
2
|
+
.--#* :.
|
|
3
|
+
.-:-** -.
|
|
4
|
+
.:-::-+* =:
|
|
5
|
+
.:-:::-=# ::
|
|
6
|
+
.-:::----** ..
|
|
7
|
+
.-:::::---=# ..
|
|
8
|
+
:-::::::----** ..
|
|
9
|
+
.:-::::::::----*= ..
|
|
10
|
+
.-::::::::------+- ..
|
|
11
|
+
..::::::::-------= ..
|
|
12
|
+
.:::::----------++ ..
|
|
13
|
+
.:::----------+**+*++*+*++*+++*++++++++++:.
|
|
14
|
+
------------+*+=-=======================.
|
|
15
|
+
.----------+*+=========================:.
|
|
16
|
+
:--------+*+=-========================.
|
|
17
|
+
.=------+*+=-========================:.
|
|
18
|
+
.=----+*+=-------=================+-.
|
|
19
|
+
.----+*+=----------================.
|
|
20
|
+
.:=-+*+=----------=-==============-
|
|
21
|
+
.-+*+=----------------===========.
|
|
22
|
+
.-+=------------------====-====:.`;
|
|
23
|
+
export {
|
|
24
|
+
n as default
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AAkxBA,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AddressBar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5e1d7a10"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
d as default
|
|
7
7
|
};
|
|
@@ -27,9 +27,9 @@ const ee = {
|
|
|
27
27
|
requestMutators: m,
|
|
28
28
|
requestHistory: R,
|
|
29
29
|
events: d
|
|
30
|
-
} = Z(), v = u(R[0]), p = u(null),
|
|
30
|
+
} = Z(), v = u(R[0]), p = u(null), x = F();
|
|
31
31
|
G(
|
|
32
|
-
j() ?
|
|
32
|
+
j() ? x.meta_enter : x.ctrl_enter,
|
|
33
33
|
() => d.executeRequest.emit()
|
|
34
34
|
);
|
|
35
35
|
const k = (e) => {
|
|
@@ -44,15 +44,15 @@ const ee = {
|
|
|
44
44
|
!l.value || !e || k(e);
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
const r = u(100),
|
|
47
|
+
const r = u(100), h = u(0), s = u(!1), i = u();
|
|
48
48
|
function q() {
|
|
49
|
-
s.value ? r.value -= (r.value - 15) / 60 : r.value -=
|
|
49
|
+
s.value ? r.value -= (r.value - 15) / 60 : r.value -= h.value / 20, r.value <= 0 && (clearInterval(i.value), i.value = void 0, r.value = 100, s.value = !1);
|
|
50
50
|
}
|
|
51
51
|
function B() {
|
|
52
52
|
i.value || (s.value = !0, i.value = setInterval(q, 20));
|
|
53
53
|
}
|
|
54
54
|
function S() {
|
|
55
|
-
|
|
55
|
+
h.value = r.value, s.value = !1;
|
|
56
56
|
}
|
|
57
57
|
function E() {
|
|
58
58
|
clearInterval(i.value), i.value = void 0, r.value = 100, s.value = !1;
|
|
@@ -87,7 +87,7 @@ const ee = {
|
|
|
87
87
|
default: w(({ open: f }) => [
|
|
88
88
|
o("div", {
|
|
89
89
|
class: y([
|
|
90
|
-
"addressbar-bg-states text-xxs relative flex w-full
|
|
90
|
+
"addressbar-bg-states text-xxs relative flex w-full xl:min-w-[720px] xl:max-w-[720px] lg:min-w-[580px] lg:max-w-[580px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
|
|
91
91
|
{ "border-transparent overflow-visible rounded-b-none": f }
|
|
92
92
|
])
|
|
93
93
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA4cO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAiBb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;;;kBApBX,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;gBAjBZ,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;gBAEV,OAAO;;qBAmZM,GAAG;kBACN,GAAG;;AA1a9B,wBAweC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b4428c61"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -2,11 +2,11 @@ var m = Object.defineProperty;
|
|
|
2
2
|
var v = (n, t, e) => t in n ? m(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var l = (n, t, e) => v(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { ScalarButton as h, ScalarIcon as f, ScalarTooltip as b } from "@scalar/components";
|
|
5
|
-
import {
|
|
5
|
+
import { REGEX as g } from "@scalar/oas-utils/helpers";
|
|
6
6
|
import { ViewPlugin as E, RangeSetBuilder as y, Decoration as x, EditorView as w, WidgetType as N } from "@scalar/use-codemirror";
|
|
7
|
-
import { defineComponent as C, h as o, createApp as
|
|
8
|
-
import { parseEnvVariables as
|
|
9
|
-
const
|
|
7
|
+
import { defineComponent as C, h as o, createApp as R } from "vue";
|
|
8
|
+
import { parseEnvVariables as S } from "../../libs/environment-parser.js";
|
|
9
|
+
const V = (n) => n.value ? n.value.color : "#8E8E8E";
|
|
10
10
|
class d extends N {
|
|
11
11
|
constructor(e, a, i, s) {
|
|
12
12
|
super();
|
|
@@ -22,9 +22,9 @@ class d extends N {
|
|
|
22
22
|
const a = C({
|
|
23
23
|
props: { variableName: { type: String, default: null } },
|
|
24
24
|
render: () => {
|
|
25
|
-
const i =
|
|
25
|
+
const i = S(this.activeEnvVariables.value).find(
|
|
26
26
|
(c) => c.key === this.variableName
|
|
27
|
-
), s = i && this.activeEnvironment.value ?
|
|
27
|
+
), s = i && this.activeEnvironment.value ? V(this.activeEnvironment) : "#8E8E8E";
|
|
28
28
|
e.style.setProperty("--tw-bg-base", s), e.style.opacity = i != null && i.value ? "1" : "0.5";
|
|
29
29
|
const r = i != null && i.value ? o("div", { class: "p-2" }, i.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
|
|
30
30
|
o("span", { class: "p-2 opacity-25" }, "No value"),
|
|
@@ -74,7 +74,7 @@ class d extends N {
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
return this.app =
|
|
77
|
+
return this.app = R(a, { variableName: this.variableName }), this.app.mount(e), e;
|
|
78
78
|
}
|
|
79
79
|
destroy() {
|
|
80
80
|
this.app && this.app.unmount();
|
|
@@ -86,7 +86,7 @@ class d extends N {
|
|
|
86
86
|
return !1;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
const
|
|
89
|
+
const I = (n) => E.fromClass(
|
|
90
90
|
class {
|
|
91
91
|
constructor(t) {
|
|
92
92
|
l(this, "decorations");
|
|
@@ -100,7 +100,7 @@ const T = (n) => E.fromClass(
|
|
|
100
100
|
for (const { from: a, to: i } of t.visibleRanges) {
|
|
101
101
|
const s = t.state.doc.sliceString(a, i);
|
|
102
102
|
let r;
|
|
103
|
-
for (; (r = g.exec(s)) !== null; ) {
|
|
103
|
+
for (; (r = g.VARIABLES.exec(s)) !== null; ) {
|
|
104
104
|
const c = a + r.index, p = c + r[0].length, u = r[1];
|
|
105
105
|
e.add(
|
|
106
106
|
c,
|
|
@@ -123,7 +123,7 @@ const T = (n) => E.fromClass(
|
|
|
123
123
|
{
|
|
124
124
|
decorations: (t) => t.decorations
|
|
125
125
|
}
|
|
126
|
-
),
|
|
126
|
+
), T = w.domEventHandlers({
|
|
127
127
|
keydown(n, t) {
|
|
128
128
|
if (n.key === "Backspace") {
|
|
129
129
|
const { state: e } = t, { from: a, to: i } = e.selection.main;
|
|
@@ -142,6 +142,6 @@ const T = (n) => E.fromClass(
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
T as backspaceCommand,
|
|
146
|
+
I as pillPlugin
|
|
147
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;IAC/B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAQF,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;IAC/B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAQF,iBAAS,cAAc;WAqDT,OAAO,IAA6B;;yBATrB,GAAG;yBACH,GAAG;;;;EAa/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -10,7 +10,7 @@ const i = {
|
|
|
10
10
|
},
|
|
11
11
|
setup(p) {
|
|
12
12
|
return (o, u) => (e(), l("div", {
|
|
13
|
-
class: s(["border-1/2 rounded bg-b-1
|
|
13
|
+
class: s(["border-1/2 rounded bg-b-1", o.scroll ? "overflow-x-auto custom-scroll" : "overflow-visible"])
|
|
14
14
|
}, [
|
|
15
15
|
n("table", {
|
|
16
16
|
class: s(["grid auto-rows-auto min-h-8 mb-0", { "min-w-full w-max": o.scroll }]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAgEA,KAAK,WAAW,GAAG;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAkBJ,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAgEA,KAAK,WAAW,GAAG;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAkBJ,iBAAS,cAAc;WAyIT,OAAO,IAA6B;;;;YAVtB,GAAG;;;YACD,GAAG;;;YACH,GAAG;;;;EAahC;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;iBAhLH,OAAO;eACT,MAAM;6EAuLpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as c, openBlock as
|
|
2
|
-
import { Disclosure as m, DisclosureButton as h, DisclosurePanel as
|
|
3
|
-
import { ScalarIcon as
|
|
1
|
+
import { defineComponent as c, openBlock as s, createBlock as d, unref as o, withCtx as n, createElementVNode as r, createVNode as i, renderSlot as l, createElementBlock as u, toDisplayString as p, createCommentVNode as a, mergeProps as f } from "vue";
|
|
2
|
+
import { Disclosure as m, DisclosureButton as h, DisclosurePanel as x } from "@headlessui/vue";
|
|
3
|
+
import { ScalarIcon as b } from "@scalar/components";
|
|
4
4
|
const g = { class: "flex items-center" }, v = { class: "flex flex-1 items-center gap-1.5 text-c-1" }, _ = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "bg-b-2 text-c-2 text-3xs inline-flex h-4 w-4 items-center justify-center rounded-full font-semibold"
|
|
@@ -14,16 +14,16 @@ const g = { class: "flex items-center" }, v = { class: "flex flex-1 items-center
|
|
|
14
14
|
itemCount: { default: 0 }
|
|
15
15
|
},
|
|
16
16
|
setup(y) {
|
|
17
|
-
return (e, k) => (
|
|
17
|
+
return (e, k) => (s(), d(o(m), {
|
|
18
18
|
as: "div",
|
|
19
|
-
class: "focus-within:bg-b-2 ui-not-open:hover:bg-b-2 focus-within:text-c-1 text-c-2 rounded request-item ui-not-open:bg-transparent ui-open:
|
|
19
|
+
class: "focus-within:bg-b-2 ui-not-open:hover:bg-b-2 focus-within:text-c-1 text-c-2 rounded request-item ui-not-open:bg-transparent ui-open:[&:not(:last-child)]:mb-2.5 ui-not-open:mb-[0.5px]",
|
|
20
20
|
defaultOpen: e.defaultOpen
|
|
21
21
|
}, {
|
|
22
|
-
default:
|
|
22
|
+
default: n(({ open: t }) => [
|
|
23
23
|
r("div", g, [
|
|
24
|
-
i(o(h), { class: "group hover:text-c-1 flex flex-1 items-center gap-2.5 overflow-hidden py-1.5 text-sm font-medium px-
|
|
25
|
-
default:
|
|
26
|
-
i(o(
|
|
24
|
+
i(o(h), { class: "group hover:text-c-1 flex flex-1 items-center gap-2.5 overflow-hidden py-1.5 text-sm font-medium px-2.5 outline-none" }, {
|
|
25
|
+
default: n(() => [
|
|
26
|
+
i(o(b), {
|
|
27
27
|
class: "text-c-3 group-hover:text-c-1 group-focus-visible:outline ui-open:rotate-90 ui-not-open:rotate-0 rounded-[1px] outline-offset-2",
|
|
28
28
|
icon: "ChevronRight",
|
|
29
29
|
size: "sm",
|
|
@@ -31,17 +31,17 @@ const g = { class: "flex items-center" }, v = { class: "flex flex-1 items-center
|
|
|
31
31
|
}),
|
|
32
32
|
r("div", v, [
|
|
33
33
|
l(e.$slots, "title", { open: t }),
|
|
34
|
-
!t && e.itemCount ? (
|
|
34
|
+
!t && e.itemCount ? (s(), u("span", _, p(e.itemCount), 1)) : a("", !0)
|
|
35
35
|
])
|
|
36
36
|
]),
|
|
37
37
|
_: 2
|
|
38
38
|
}, 1024),
|
|
39
|
-
e.$slots.actions ? (
|
|
39
|
+
e.$slots.actions ? (s(), u("div", C, [
|
|
40
40
|
l(e.$slots, "actions", { open: t })
|
|
41
41
|
])) : a("", !0)
|
|
42
42
|
]),
|
|
43
|
-
i(o(
|
|
44
|
-
default:
|
|
43
|
+
i(o(x), f(e.$attrs, { class: "h-full max-h-fit rounded-b diclosure-panel" }), {
|
|
44
|
+
default: n(() => [
|
|
45
45
|
l(e.$slots, "default", { open: t })
|
|
46
46
|
]),
|
|
47
47
|
_: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AAmBA,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AAmBA,iBAAS,cAAc;WA+DT,OAAO,IAA6B;;uBATvB,GAAG;yBACD,GAAG;;;;EAa/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,uRAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openBlock as o, createElementBlock as l, createElementVNode as n, renderSlot as t } from "vue";
|
|
2
2
|
import s from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
const r = {}, c = { class: "flex h-full xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1" }, i = { class: "min-h-12 xl:min-h-header flex items-center border-b-1/2 px-3.5 py-1.5 md:px-4 md:py-2 xl:px-6 xl:pr-5 text-sm font-medium sticky top-0 bg-b-1 xl:rounded-none" };
|
|
4
|
-
function m(e,
|
|
3
|
+
const r = {}, c = { class: "flex xl:h-full xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1" }, i = { class: "min-h-12 xl:min-h-header flex items-center border-b-1/2 px-3.5 py-1.5 md:px-4 md:py-2 xl:px-6 xl:pr-5 text-sm font-medium sticky top-0 bg-b-1 xl:rounded-none z-1" };
|
|
4
|
+
function m(e, x) {
|
|
5
5
|
return o(), l("section", c, [
|
|
6
6
|
n("div", i, [
|
|
7
7
|
t(e.$slots, "title")
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {
|
|
2
|
-
client: HTMLDivElement;
|
|
3
|
-
}, HTMLDivElement>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
4
2
|
export default _default;
|
|
5
3
|
//# sourceMappingURL=ApiClientModal.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":";AA0YA,wBAMG"}
|
|
@@ -2,7 +2,7 @@ import o from "./ApiClientModal.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ab9fa596"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as p,
|
|
1
|
+
import { defineComponent as p, ref as f, useId as v, watch as y, onBeforeMount as w, onMounted as h, onBeforeUnmount as _, withDirectives as k, openBlock as C, createElementBlock as E, createElementVNode as l, unref as t, createVNode as K, vShow as F } from "vue";
|
|
2
2
|
import { addScalarClassesToHeadless as M } from "@scalar/components";
|
|
3
|
-
import { useFocusTrap as
|
|
4
|
-
import { RouterView as
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
import { handleHotKeyDown as
|
|
3
|
+
import { useFocusTrap as x } from "@vueuse/integrations/useFocusTrap";
|
|
4
|
+
import { RouterView as B } from "vue-router";
|
|
5
|
+
import { useWorkspace as P } from "../../store/store.js";
|
|
6
|
+
import { handleHotKeyDown as T } from "../../libs/hot-keys.js";
|
|
7
7
|
const b = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overlay" }, S = ["id"], N = /* @__PURE__ */ p({
|
|
8
8
|
__name: "ApiClientModal",
|
|
9
9
|
setup(V) {
|
|
10
|
-
const { activeWorkspace: d, modalState: o, events: a } =
|
|
10
|
+
const { activeWorkspace: d, modalState: o, events: a } = P(), n = f(null), r = v(), { activate: m, deactivate: u } = x(n, {
|
|
11
11
|
allowOutsideClick: !0,
|
|
12
12
|
initialFocus: () => n.value,
|
|
13
|
-
fallbackFocus: `#${
|
|
14
|
-
}),
|
|
13
|
+
fallbackFocus: `#${r}`
|
|
14
|
+
}), s = (e) => T(e, a.hotKeys, d.value.hotKeyConfig);
|
|
15
15
|
y(
|
|
16
16
|
() => o.open,
|
|
17
17
|
(e) => {
|
|
18
|
-
e ? (window.addEventListener("keydown",
|
|
18
|
+
e ? (window.addEventListener("keydown", s), document.documentElement.style.overflow = "hidden", m()) : (window.removeEventListener("keydown", s), document.documentElement.style.removeProperty("overflow"), u());
|
|
19
19
|
}
|
|
20
20
|
), w(() => M());
|
|
21
21
|
const c = (e) => (e == null ? void 0 : e.closeModal) && o.open && o.hide();
|
|
@@ -24,7 +24,7 @@ const b = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overl
|
|
|
24
24
|
}), (e, i) => k((C(), E("div", b, [
|
|
25
25
|
l("div", D, [
|
|
26
26
|
l("div", {
|
|
27
|
-
id: t(
|
|
27
|
+
id: t(r),
|
|
28
28
|
ref_key: "client",
|
|
29
29
|
ref: n,
|
|
30
30
|
"aria-label": "API Client",
|
|
@@ -33,7 +33,7 @@ const b = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overl
|
|
|
33
33
|
role: "dialog",
|
|
34
34
|
tabindex: "0"
|
|
35
35
|
}, [
|
|
36
|
-
K(t(
|
|
36
|
+
K(t(B), { key: "$route.fullPath" })
|
|
37
37
|
], 8, S),
|
|
38
38
|
l("div", {
|
|
39
39
|
class: "scalar-app-exit -z-1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/store/import-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,QAAQ,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,u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kBAAkB,EAAE,aAAa,CAAC,GACxC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,KACtC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,SAxDlC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBACrB,MAAM,YACX,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA4Eiqb,CAAC;;;;;;uBAAqK,CAAC;mBAAqC,CAAC;0BAA4C,CAAC;mBAAqC,CAAC;oBAAoB,CAAC;mBAAqC,CAAC;qBAAuC,CAAC;;mBAA4D,CAAC;;0BAAoD,CAAC;mBAAqC,CAAC;;;;;;;mBAtBvpc,CAAC,CAAC,CAAC;EAqBtE"}
|
package/dist/store/requests.d.ts
CHANGED
|
@@ -389,5 +389,45 @@ export declare function findRequestParentsFactory({ collections, tags, }: {
|
|
|
389
389
|
collections: Record<string, Collection>;
|
|
390
390
|
tags: Record<string, Tag>;
|
|
391
391
|
}): (r: Request) => string[];
|
|
392
|
+
/** First draft request" */
|
|
393
|
+
export declare function createInitialRequest(): {
|
|
394
|
+
request: {
|
|
395
|
+
path: string;
|
|
396
|
+
type: "request";
|
|
397
|
+
uid: string;
|
|
398
|
+
selectedSecuritySchemeUids: string[];
|
|
399
|
+
selectedServerUid: string;
|
|
400
|
+
servers: string[];
|
|
401
|
+
examples: string[];
|
|
402
|
+
method: "options" | "delete" | "get" | "connect" | "head" | "patch" | "post" | "put" | "trace";
|
|
403
|
+
description?: string | undefined;
|
|
404
|
+
summary?: string | undefined;
|
|
405
|
+
externalDocs?: {
|
|
406
|
+
url: string;
|
|
407
|
+
description?: string | undefined;
|
|
408
|
+
} | undefined;
|
|
409
|
+
security?: Record<string, string[]>[] | undefined;
|
|
410
|
+
tags?: string[] | undefined;
|
|
411
|
+
deprecated?: boolean | undefined;
|
|
412
|
+
operationId?: string | undefined;
|
|
413
|
+
parameters?: {
|
|
414
|
+
required: boolean;
|
|
415
|
+
name: string;
|
|
416
|
+
in: "path" | "query" | "header" | "cookie";
|
|
417
|
+
deprecated: boolean;
|
|
418
|
+
description?: string | undefined;
|
|
419
|
+
schema?: unknown;
|
|
420
|
+
content?: unknown;
|
|
421
|
+
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
422
|
+
example?: unknown;
|
|
423
|
+
examples?: Record<string, {
|
|
424
|
+
value?: unknown;
|
|
425
|
+
summary?: string | undefined;
|
|
426
|
+
}> | undefined;
|
|
427
|
+
}[] | undefined;
|
|
428
|
+
requestBody?: any;
|
|
429
|
+
responses?: Record<string, any> | undefined;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
392
432
|
export {};
|
|
393
433
|
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/store/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,GAAG,EAGT,MAAM,iCAAiC,CAAA;AAKxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,OAAO;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/store/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,GAAG,EAGT,MAAM,iCAAiC,CAAA;AAKxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,wDAAwD;AACxD,wBAAgB,mBA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ist/store/requests.js
CHANGED
|
@@ -1,107 +1,117 @@
|
|
|
1
|
-
import { requestSchema as
|
|
1
|
+
import { requestSchema as x, createExampleFromRequest as y } from "@scalar/oas-utils/entities/spec";
|
|
2
2
|
import { LS_KEYS as F, schemaModel as T, iterateTitle as A } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { mutationFactory as D } from "@scalar/object-utils/mutator-record";
|
|
4
|
-
import { reactive as
|
|
5
|
-
function
|
|
6
|
-
const s =
|
|
4
|
+
import { reactive as E } from "vue";
|
|
5
|
+
function j(m) {
|
|
6
|
+
const s = E({}), h = D(
|
|
7
7
|
s,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
E({}),
|
|
9
|
+
m && F.REQUEST
|
|
10
10
|
);
|
|
11
11
|
return {
|
|
12
12
|
requests: s,
|
|
13
13
|
requestMutators: h
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
requestExamples:
|
|
16
|
+
function v({
|
|
17
|
+
requestExamples: m,
|
|
18
18
|
requestExampleMutators: s,
|
|
19
19
|
requestMutators: h,
|
|
20
|
-
collectionMutators:
|
|
21
|
-
collections:
|
|
20
|
+
collectionMutators: f,
|
|
21
|
+
collections: r,
|
|
22
22
|
tags: u,
|
|
23
23
|
tagMutators: q
|
|
24
24
|
}, R) {
|
|
25
25
|
return {
|
|
26
|
-
addRequest: (
|
|
27
|
-
var
|
|
28
|
-
const e = T(
|
|
29
|
-
if (!e) return console.error("INVALID REQUEST DATA",
|
|
30
|
-
const
|
|
26
|
+
addRequest: (t, a) => {
|
|
27
|
+
var l;
|
|
28
|
+
const e = T(t, x, !1);
|
|
29
|
+
if (!e) return console.error("INVALID REQUEST DATA", t);
|
|
30
|
+
const o = r[a], i = y(
|
|
31
31
|
e,
|
|
32
32
|
A(
|
|
33
33
|
(e.summary ?? "Example") + " #1",
|
|
34
|
-
(
|
|
34
|
+
(c) => e.examples.some((p) => c === m[p].name)
|
|
35
35
|
)
|
|
36
36
|
);
|
|
37
|
-
return e.examples.push(i.uid), h.add(e), s.add(i),
|
|
38
|
-
...
|
|
37
|
+
return e.examples.push(i.uid), h.add(e), s.add(i), f.edit(a, "requests", [
|
|
38
|
+
...o.requests,
|
|
39
39
|
e.uid
|
|
40
|
-
]), (
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
...u[
|
|
40
|
+
]), (l = e.tags) != null && l.length ? e.tags.forEach((c) => {
|
|
41
|
+
const p = o.tags.find((S) => u[S].name === c);
|
|
42
|
+
p ? q.edit(p, "children", [
|
|
43
|
+
...u[p].children,
|
|
44
44
|
e.uid
|
|
45
|
-
]) : R({ name:
|
|
46
|
-
}) :
|
|
47
|
-
...
|
|
45
|
+
]) : R({ name: c, children: [e.uid] }, a);
|
|
46
|
+
}) : f.edit(a, "children", [
|
|
47
|
+
...o.children,
|
|
48
48
|
e.uid
|
|
49
49
|
]), e;
|
|
50
50
|
},
|
|
51
|
-
deleteRequest: (
|
|
52
|
-
var
|
|
53
|
-
const e =
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
deleteRequest: (t, a) => {
|
|
52
|
+
var o;
|
|
53
|
+
const e = r[a];
|
|
54
|
+
t.examples.forEach((i) => s.delete(i)), f.edit(
|
|
55
|
+
a,
|
|
56
56
|
"requests",
|
|
57
|
-
e.requests.filter((i) => i !==
|
|
58
|
-
),
|
|
59
|
-
|
|
57
|
+
e.requests.filter((i) => i !== t.uid)
|
|
58
|
+
), f.edit(
|
|
59
|
+
a,
|
|
60
60
|
"children",
|
|
61
|
-
e.children.filter((i) => i !==
|
|
62
|
-
), (
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
e.children.filter((i) => i !== t.uid)
|
|
62
|
+
), (o = t.tags) == null || o.forEach((i) => {
|
|
63
|
+
const l = e.tags.find((c) => u[c].name === i);
|
|
64
|
+
l && q.edit(
|
|
65
|
+
l,
|
|
66
66
|
"children",
|
|
67
|
-
u[
|
|
67
|
+
u[l].children.filter((c) => c !== t.uid)
|
|
68
68
|
);
|
|
69
|
-
}), h.delete(
|
|
69
|
+
}), h.delete(t.uid);
|
|
70
70
|
},
|
|
71
|
-
findRequestParents:
|
|
71
|
+
findRequestParents: I({ collections: r, tags: u })
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
collections:
|
|
74
|
+
function I({
|
|
75
|
+
collections: m,
|
|
76
76
|
tags: s
|
|
77
77
|
}) {
|
|
78
|
-
function h(
|
|
79
|
-
const
|
|
78
|
+
function h(f) {
|
|
79
|
+
const r = Object.values(m).find(
|
|
80
80
|
(n) => {
|
|
81
81
|
var d;
|
|
82
|
-
return (d = n.requests) == null ? void 0 : d.includes(
|
|
82
|
+
return (d = n.requests) == null ? void 0 : d.includes(f.uid);
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
if (!
|
|
85
|
+
if (!r) return [];
|
|
86
86
|
const u = Object.keys(s).reduce(
|
|
87
87
|
(n, d) => (n[d] = [], n),
|
|
88
|
-
{ [
|
|
88
|
+
{ [r == null ? void 0 : r.uid]: [] }
|
|
89
89
|
);
|
|
90
90
|
function q(n, d) {
|
|
91
|
-
d.forEach((
|
|
92
|
-
s[
|
|
91
|
+
d.forEach((t) => u[t].push(...n.children)), n.children.forEach((t) => {
|
|
92
|
+
s[t] && q(s[t], [...d, t]);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
q(
|
|
95
|
+
q(r, [r.uid]);
|
|
96
96
|
const R = /* @__PURE__ */ new Set();
|
|
97
97
|
return Object.entries(u).forEach(([n, d]) => {
|
|
98
|
-
d.includes(
|
|
98
|
+
d.includes(f.uid) && R.add(n);
|
|
99
99
|
}), [...R];
|
|
100
100
|
}
|
|
101
101
|
return h;
|
|
102
102
|
}
|
|
103
|
+
function C() {
|
|
104
|
+
return { request: x.parse({
|
|
105
|
+
method: "get",
|
|
106
|
+
parameters: [],
|
|
107
|
+
path: "",
|
|
108
|
+
summary: "My First Request",
|
|
109
|
+
examples: []
|
|
110
|
+
}) };
|
|
111
|
+
}
|
|
103
112
|
export {
|
|
104
|
-
C as
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
C as createInitialRequest,
|
|
114
|
+
j as createStoreRequests,
|
|
115
|
+
v as extendedRequestDataFactory,
|
|
116
|
+
I as findRequestParentsFactory
|
|
107
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/store/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/store/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAKzD,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,sCAAsC,CAAA;AAO7C,4CAA4C;AAC5C,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,OAAO;;;;;;;;;;;;;mBAsE+7L,CAAC;;yBAAq4B,CAAC;;;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;;;;;;;;uBAAv4B,CAAC;;6BAAq4B,CAAC;;;;;;;;;EAzDn4N;AAED,oDAAoD;AACpD,wBAAgB,4BAA4B,CAAC,EAC3C,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,GACvB,EAAE,YAAY;6BACkB,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;mBA+C08L,CAAC;;yBAAq4B,CAAC;;;;;2BAbp2N,MAAM;EAYrC"}
|