@scalar/api-client 2.2.22 → 2.2.24
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 +22 -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 +69 -70
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +42 -38
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
- package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +22 -19
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +57 -49
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +71 -64
- package/dist/layouts/App/ApiClientApp.vue.js +4 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
- package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
- package/dist/libs/create-client.d.ts +10 -10
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +42 -36
- package/dist/libs/extractAttachmentFilename.d.ts +3 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +7 -7
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +18 -18
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +2 -2
- package/dist/libs/parse-curl.js +39 -36
- package/dist/store/active-entities.d.ts +4 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +88 -86
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +29 -29
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +27 -23
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +94 -77
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +27 -27
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +18 -18
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +35 -33
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -9
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +39 -37
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +94 -89
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +118 -116
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +149 -144
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +37 -31
- package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +147 -130
- package/dist/views/Request/types/sidebar-item.d.ts +4 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +38 -35
- package/dist/views/Servers/Servers.vue2.js +38 -35
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue2.js +15 -15
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
- package/package.json +8 -8
|
@@ -27,10 +27,10 @@ const ae = ({
|
|
|
27
27
|
}), S = Y({ ...a, router: u });
|
|
28
28
|
if (localStorage.getItem(D.WORKSPACE) && !p) {
|
|
29
29
|
const e = {};
|
|
30
|
-
let
|
|
30
|
+
let r = 0, t = 0, s = "";
|
|
31
31
|
for (s in localStorage)
|
|
32
|
-
Object.prototype.hasOwnProperty.call(localStorage, s) && (
|
|
33
|
-
e.Total = (
|
|
32
|
+
Object.prototype.hasOwnProperty.call(localStorage, s) && (t = (localStorage[s].length + s.length) * 2, r += t, e[s] = (t / 1024).toFixed(2) + " KB");
|
|
33
|
+
e.Total = (r / 1024).toFixed(2) + " KB", console.table(e), W(a);
|
|
34
34
|
} else if (!p || !o.spec)
|
|
35
35
|
a.workspaceMutators.add({
|
|
36
36
|
uid: "default",
|
|
@@ -72,11 +72,12 @@ const ae = ({
|
|
|
72
72
|
};
|
|
73
73
|
_ && f();
|
|
74
74
|
const y = async (e) => {
|
|
75
|
-
|
|
75
|
+
var r, t;
|
|
76
|
+
e != null && e.url ? await w(e.url, ((r = n.value) == null ? void 0 : r.uid) ?? "", {
|
|
76
77
|
proxyUrl: o == null ? void 0 : o.proxyUrl,
|
|
77
78
|
setCollectionSecurity: !0,
|
|
78
79
|
...o
|
|
79
|
-
}) : e != null && e.content ? await E(e == null ? void 0 : e.content, n.value.uid, {
|
|
80
|
+
}) : e != null && e.content ? await E(e == null ? void 0 : e.content, ((t = n.value) == null ? void 0 : t.uid) ?? "", {
|
|
80
81
|
setCollectionSecurity: !0,
|
|
81
82
|
...o
|
|
82
83
|
}) : console.error(
|
|
@@ -94,29 +95,34 @@ const ae = ({
|
|
|
94
95
|
*
|
|
95
96
|
* Deletes the current store before importing again for now, in the future will Diff
|
|
96
97
|
*/
|
|
97
|
-
updateConfig(e,
|
|
98
|
-
t
|
|
98
|
+
updateConfig(e, r = !0) {
|
|
99
|
+
var t;
|
|
100
|
+
r ? Object.assign(o ?? {}, e) : z(o ?? {}, e), e.spec && (a.collectionMutators.reset(), a.requestMutators.reset(), a.requestExampleMutators.reset(), a.securitySchemeMutators.reset(), a.serverMutators.reset(), a.tagMutators.reset(), L.edit(
|
|
101
|
+
((t = n.value) == null ? void 0 : t.uid) ?? "",
|
|
102
|
+
"collections",
|
|
103
|
+
[]
|
|
104
|
+
), y(e.spec));
|
|
99
105
|
},
|
|
100
106
|
/** Update the currently selected server via URL */
|
|
101
107
|
updateServer: (e) => {
|
|
102
|
-
var
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
(
|
|
108
|
+
var t;
|
|
109
|
+
const r = Object.values(h).find((s) => s.url === e);
|
|
110
|
+
r && m.value && C.edit(
|
|
111
|
+
(t = m.value) == null ? void 0 : t.uid,
|
|
106
112
|
"selectedServerUid",
|
|
107
|
-
|
|
113
|
+
r.uid
|
|
108
114
|
);
|
|
109
115
|
},
|
|
110
116
|
/** Update the currently selected server via URL */
|
|
111
117
|
onUpdateServer: (e) => {
|
|
112
118
|
X(
|
|
113
119
|
() => {
|
|
114
|
-
var
|
|
115
|
-
return (
|
|
120
|
+
var r;
|
|
121
|
+
return (r = m.value) == null ? void 0 : r.selectedServerUid;
|
|
116
122
|
},
|
|
117
|
-
(
|
|
118
|
-
const
|
|
119
|
-
|
|
123
|
+
(r) => {
|
|
124
|
+
const t = Object.values(h).find((s) => s.uid === r);
|
|
125
|
+
t != null && t.url && e(t.url);
|
|
120
126
|
}
|
|
121
127
|
);
|
|
122
128
|
},
|
|
@@ -125,43 +131,43 @@ const ae = ({
|
|
|
125
131
|
*/
|
|
126
132
|
updateAuth: ({
|
|
127
133
|
nameKey: e,
|
|
128
|
-
propertyKey:
|
|
129
|
-
value:
|
|
134
|
+
propertyKey: r,
|
|
135
|
+
value: t
|
|
130
136
|
}) => {
|
|
131
137
|
const c = Object.values(I).find((i) => i.nameKey === e);
|
|
132
|
-
c && j.edit(c.uid,
|
|
138
|
+
c && j.edit(c.uid, r, t);
|
|
133
139
|
},
|
|
134
140
|
/** Route to a method + path */
|
|
135
141
|
route: (e) => {
|
|
136
|
-
const
|
|
137
|
-
({ path:
|
|
142
|
+
const r = Object.values(d).find(
|
|
143
|
+
({ path: t, method: s }) => t === e.path && s.toUpperCase() === e.method.toUpperCase()
|
|
138
144
|
);
|
|
139
|
-
|
|
145
|
+
r && u.push({
|
|
140
146
|
name: "request",
|
|
141
147
|
params: {
|
|
142
148
|
workspace: "default",
|
|
143
|
-
request:
|
|
149
|
+
request: r.uid
|
|
144
150
|
}
|
|
145
151
|
});
|
|
146
152
|
},
|
|
147
153
|
/** Open the API client modal and optionally route to a request */
|
|
148
154
|
open: (e) => {
|
|
149
155
|
if (e) {
|
|
150
|
-
const
|
|
151
|
-
({ path:
|
|
156
|
+
const r = Object.values(d).find(
|
|
157
|
+
({ path: t, method: s }) => e ? (
|
|
152
158
|
// The given operation
|
|
153
|
-
|
|
159
|
+
t === e.path && s.toUpperCase() === e.method.toUpperCase()
|
|
154
160
|
) : (
|
|
155
161
|
// Or the first request
|
|
156
162
|
!0
|
|
157
163
|
)
|
|
158
164
|
);
|
|
159
|
-
|
|
165
|
+
r && u.push({
|
|
160
166
|
name: "request",
|
|
161
167
|
query: e._source ? { source: e._source } : void 0,
|
|
162
168
|
params: {
|
|
163
169
|
workspace: "default",
|
|
164
|
-
request:
|
|
170
|
+
request: r.uid
|
|
165
171
|
}
|
|
166
172
|
});
|
|
167
173
|
}
|
|
@@ -174,16 +180,16 @@ const ae = ({
|
|
|
174
180
|
/* The workspace store */
|
|
175
181
|
store: a,
|
|
176
182
|
/** Update the currently selected example */
|
|
177
|
-
updateExample: (e,
|
|
183
|
+
updateExample: (e, r) => {
|
|
178
184
|
var i, O, x, A;
|
|
179
|
-
if (!e || !
|
|
180
|
-
const
|
|
181
|
-
({ operationId: B, path: P }) => B ===
|
|
185
|
+
if (!e || !r) return;
|
|
186
|
+
const t = Object.values(d).find(
|
|
187
|
+
({ operationId: B, path: P }) => B === r || P === r
|
|
182
188
|
);
|
|
183
|
-
if (!
|
|
184
|
-
const s = Object.keys(((i =
|
|
189
|
+
if (!t) return;
|
|
190
|
+
const s = Object.keys(((i = t.requestBody) == null ? void 0 : i.content) || {})[0] || "application/json", c = (A = (x = (O = t.requestBody) == null ? void 0 : O.content) == null ? void 0 : x[s]) == null ? void 0 : A.examples[e];
|
|
185
191
|
c && T.edit(
|
|
186
|
-
|
|
192
|
+
t.examples[0] ?? "",
|
|
187
193
|
"body.raw.value",
|
|
188
194
|
H(c.value)
|
|
189
195
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractAttachmentFilename.d.ts","sourceRoot":"","sources":["../../src/libs/extractAttachmentFilename.ts"],"names":[],"mappings":"AAQA,wBAAgB,eAAe,CAAC,kBAAkB,EAAE,MAAM,UAezD"}
|
|
1
|
+
{"version":3,"file":"extractAttachmentFilename.d.ts","sourceRoot":"","sources":["../../src/libs/extractAttachmentFilename.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,EAAE,MAAM,UAezD"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r = (e) => {
|
|
2
2
|
try {
|
|
3
3
|
return decodeURIComponent(e);
|
|
4
4
|
} catch {
|
|
5
5
|
return e;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
let
|
|
8
|
+
function o(e) {
|
|
9
|
+
let n = "";
|
|
10
10
|
if (e) {
|
|
11
|
-
const
|
|
11
|
+
const t = e.match(
|
|
12
12
|
/filename\s*=\s*"?([^";]+)"?/
|
|
13
13
|
);
|
|
14
|
-
|
|
14
|
+
typeof (t == null ? void 0 : t[1]) == "string" && (n = r(t[1].trim()));
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return n;
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
o as extractFilename
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/libs/importers/curl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACxB,MAAM,iCAAiC,CAAA;AAExC,oCAAoC;AACpC,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,aAAa,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvB,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE;YACP,CAAC,WAAW,EAAE,MAAM,GAAG;gBACrB,MAAM,EAAE;oBACN,IAAI,EAAE,MAAM,CAAA;oBACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;wBAAE,IAAI,EAAE,MAAM,CAAA;qBAAE,CAAC,CAAA;iBAC7C,CAAA;gBACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;aAChC,CAAA;SACF,CAAA;KACF,CAAA;IACD,UAAU,EAAE,uBAAuB,EAAE,CAAA;CACtC,CAAA;
|
|
1
|
+
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/libs/importers/curl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACxB,MAAM,iCAAiC,CAAA;AAExC,oCAAoC;AACpC,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,aAAa,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvB,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE;YACP,CAAC,WAAW,EAAE,MAAM,GAAG;gBACrB,MAAM,EAAE;oBACN,IAAI,EAAE,MAAM,CAAA;oBACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;wBAAE,IAAI,EAAE,MAAM,CAAA;qBAAE,CAAC,CAAA;iBAC7C,CAAA;gBACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;aAChC,CAAA;SACF,CAAA;KACF,CAAA;IACD,UAAU,EAAE,uBAAuB,EAAE,CAAA;CACtC,CAAA;AAoBD,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,CA4DxE"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { parseCurlCommand as l } from "../parse-curl.js";
|
|
2
|
-
function h(
|
|
2
|
+
function h(o) {
|
|
3
3
|
try {
|
|
4
|
-
return JSON.parse(
|
|
4
|
+
return JSON.parse(o);
|
|
5
5
|
} catch {
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
const [
|
|
9
|
-
|
|
10
|
-
}),
|
|
6
|
+
const s = {};
|
|
7
|
+
return o.split("&").forEach((a) => {
|
|
8
|
+
const [r, e] = a.split("=");
|
|
9
|
+
r && e && (s[decodeURIComponent(r)] = decodeURIComponent(e));
|
|
10
|
+
}), s;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function C(
|
|
14
|
-
const
|
|
13
|
+
function C(o) {
|
|
14
|
+
const s = l(o), {
|
|
15
15
|
method: a = "get",
|
|
16
|
-
url:
|
|
16
|
+
url: r,
|
|
17
17
|
body: e = "",
|
|
18
18
|
headers: p = {},
|
|
19
19
|
servers: i,
|
|
20
20
|
queryParameters: m = []
|
|
21
|
-
} =
|
|
22
|
-
...Array.isArray(m) ? m.map(({ key:
|
|
23
|
-
name:
|
|
21
|
+
} = s, y = new URL(r).pathname, d = e != null && e.includes("=") && !e.startsWith("{") ? "application/x-www-form-urlencoded" : p["Content-Type"] || "application/json", c = e ? h(e) : {}, u = [
|
|
22
|
+
...Array.isArray(m) ? m.map(({ key: n, value: t }) => ({
|
|
23
|
+
name: n,
|
|
24
24
|
in: "query",
|
|
25
25
|
schema: { type: typeof t, examples: [t] }
|
|
26
26
|
})) : [],
|
|
27
|
-
...Object.entries(p || {}).map(([
|
|
28
|
-
name:
|
|
27
|
+
...Object.entries(p || {}).map(([n, t]) => ({
|
|
28
|
+
name: n,
|
|
29
29
|
in: "header",
|
|
30
30
|
schema: { type: typeof t },
|
|
31
31
|
example: t
|
|
@@ -33,7 +33,7 @@ function C(n) {
|
|
|
33
33
|
];
|
|
34
34
|
return {
|
|
35
35
|
method: a,
|
|
36
|
-
url:
|
|
36
|
+
url: r,
|
|
37
37
|
path: y,
|
|
38
38
|
headers: p,
|
|
39
39
|
servers: i,
|
|
@@ -44,8 +44,8 @@ function C(n) {
|
|
|
44
44
|
schema: {
|
|
45
45
|
type: "object",
|
|
46
46
|
properties: Object.fromEntries(
|
|
47
|
-
Object.entries(c).map(([
|
|
48
|
-
|
|
47
|
+
Object.entries(c).map(([n, t]) => [
|
|
48
|
+
n,
|
|
49
49
|
{ type: typeof t }
|
|
50
50
|
])
|
|
51
51
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-headers.d.ts","sourceRoot":"","sources":["../../src/libs/normalize-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,aACjB,OAAO,mCAEhB,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalize-headers.d.ts","sourceRoot":"","sources":["../../src/libs/normalize-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,aACjB,OAAO,mCAEhB,MAAM,CAAC,MAAM,EAAE,MAAM,CAuEvB,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,eAAe,QAAS,MAAM,WAM7B,CAAA"}
|
|
@@ -17,11 +17,11 @@ const f = (a, t = !1) => {
|
|
|
17
17
|
const s = /^x-scalar-original-/i;
|
|
18
18
|
if (s.test(e)) {
|
|
19
19
|
const n = e.replace(s, "");
|
|
20
|
-
o[n] = o[e], delete o[e];
|
|
20
|
+
o[e] && (o[n] = o[e], delete o[e]);
|
|
21
21
|
}
|
|
22
22
|
}), Object.keys(o).forEach((e) => {
|
|
23
23
|
const s = d(e);
|
|
24
|
-
e !== s && (o[s] = o[e], delete o[e]);
|
|
24
|
+
e !== s && o[e] && (o[s] = o[e], delete o[e]);
|
|
25
25
|
}), Object.fromEntries(
|
|
26
26
|
Object.entries(o).sort(([e], [s]) => e.localeCompare(s))
|
|
27
27
|
);
|
package/dist/libs/parse-curl.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { parse as h } from "shell-quote";
|
|
2
|
-
function P(
|
|
3
|
-
const t = h(
|
|
4
|
-
let
|
|
5
|
-
for (;
|
|
6
|
-
if (typeof
|
|
7
|
-
if (
|
|
2
|
+
function P(a) {
|
|
3
|
+
const t = h(a).map((i) => typeof i == "object" && "op" in i && i.op === "glob" ? i.pattern.trim() : typeof i == "string" ? i.trim() : i).filter((i) => i !== ""), e = { url: "" }, n = t[Symbol.iterator]();
|
|
4
|
+
let r = n.next().value;
|
|
5
|
+
for (; r; ) {
|
|
6
|
+
if (typeof r == "object" && "op" in r) {
|
|
7
|
+
if (r.op === "&") {
|
|
8
8
|
const i = n.next().value;
|
|
9
9
|
if (typeof i == "string") {
|
|
10
|
-
const o =
|
|
11
|
-
(s, { key:
|
|
10
|
+
const o = f(`?${i}`).reduce(
|
|
11
|
+
(s, { key: c, value: m }) => (s[c] = m, s),
|
|
12
12
|
{}
|
|
13
13
|
);
|
|
14
14
|
e.queryParameters = {
|
|
@@ -17,55 +17,58 @@ function P(r) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
r = n.next().value;
|
|
21
21
|
continue;
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (r === "-X" || r === "--request")
|
|
24
24
|
l(n, e);
|
|
25
|
-
else if (
|
|
25
|
+
else if (r === "--url")
|
|
26
26
|
d(n, e);
|
|
27
|
-
else if (
|
|
27
|
+
else if (r === "-H" || r === "--header")
|
|
28
28
|
u(n, e);
|
|
29
|
-
else if (
|
|
29
|
+
else if (r === "--data" || r === "-d" || r === "--data-raw" || r === "--data-urlencode" || r === "--data-binary" || r === "--data-ascii") {
|
|
30
30
|
const i = n.next().value;
|
|
31
31
|
typeof i == "string" && (e.body = i);
|
|
32
|
-
} else typeof
|
|
33
|
-
|
|
32
|
+
} else typeof r == "string" && !e.url && (r.startsWith("http") || r.startsWith("www.")) ? d([r][Symbol.iterator](), e) : r === "-P" ? y(n, e) : typeof r == "string" && r.toLowerCase().includes("content-type") ? v(r, e) : r === "-u" || r === "--user" ? x(n, e) : (r === "-b" || r === "--cookie") && b(n, e);
|
|
33
|
+
r = n.next().value;
|
|
34
34
|
}
|
|
35
35
|
return e;
|
|
36
36
|
}
|
|
37
|
-
function l(
|
|
38
|
-
t.method =
|
|
37
|
+
function l(a, t) {
|
|
38
|
+
t.method = a.next().value.toLowerCase();
|
|
39
39
|
}
|
|
40
|
-
function d(
|
|
41
|
-
const e = new URL(
|
|
42
|
-
t.servers = [e.origin], t.path = e.pathname !== "/" ? e.pathname : "", t.url = t.servers[0] + t.path, t.queryParameters =
|
|
40
|
+
function d(a, t) {
|
|
41
|
+
const e = new URL(a.next().value.replace(/['"]/g, ""));
|
|
42
|
+
t.servers = [e.origin], t.path = e.pathname !== "/" ? e.pathname : "", t.url = t.servers[0] + t.path, t.queryParameters = f(e.search);
|
|
43
43
|
}
|
|
44
|
-
function u(
|
|
45
|
-
const e =
|
|
44
|
+
function u(a, t) {
|
|
45
|
+
const e = a.next().value.replace(/['"]/g, "").split(/:(.*)/);
|
|
46
46
|
t.headers = t.headers || {}, e[1] !== void 0 ? t.headers[e[0].trim()] = e[1].trim() : t.headers[e[0].trim()] = "";
|
|
47
47
|
}
|
|
48
|
-
function y(
|
|
49
|
-
const e =
|
|
48
|
+
function y(a, t) {
|
|
49
|
+
const e = a.next().value.replace(/['"]/g, "").split("=");
|
|
50
50
|
t.pathVariables = t.pathVariables || {}, e[1] !== void 0 ? t.pathVariables[e[0].trim()] = e[1].trim() : t.pathVariables[e[0].trim()] = "";
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const t =
|
|
54
|
-
return t !== -1 &&
|
|
55
|
-
const [
|
|
56
|
-
|
|
52
|
+
function f(a) {
|
|
53
|
+
const t = a.indexOf("?"), e = [];
|
|
54
|
+
return t !== -1 && a.substring(t + 1).split("&").forEach((i) => {
|
|
55
|
+
const [p, o] = i.split("=");
|
|
56
|
+
if (p) {
|
|
57
|
+
const s = decodeURIComponent(p.trim()), c = o ? decodeURIComponent(o.trim()) : "";
|
|
58
|
+
e.push({ key: s, value: c });
|
|
59
|
+
}
|
|
57
60
|
}), e;
|
|
58
61
|
}
|
|
59
|
-
function v(
|
|
60
|
-
const e =
|
|
61
|
-
t.headers = t.headers || {}, e[1] !== void 0 ? t.headers[e[0].trim()] = e[1].trim() : t.headers[e[0].trim()] = "";
|
|
62
|
+
function v(a, t) {
|
|
63
|
+
const e = a.replace(/['"]/g, "").split(/:(.+)/);
|
|
64
|
+
t.headers = t.headers || {}, e[0] && (e[1] !== void 0 ? t.headers[e[0].trim()] = e[1].trim() : t.headers[e[0].trim()] = "");
|
|
62
65
|
}
|
|
63
|
-
function x(
|
|
64
|
-
const e =
|
|
66
|
+
function x(a, t) {
|
|
67
|
+
const e = a.next().value.split(":");
|
|
65
68
|
t.headers = t.headers || {}, t.headers.Authorization = e[1];
|
|
66
69
|
}
|
|
67
|
-
function b(
|
|
68
|
-
const e =
|
|
70
|
+
function b(a, t) {
|
|
71
|
+
const e = a.next().value;
|
|
69
72
|
t.headers = t.headers || {}, t.headers.Cookie = e;
|
|
70
73
|
}
|
|
71
74
|
export {
|
|
@@ -242,7 +242,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
242
242
|
variables?: Record<string, Omit<import("@scalar/openapi-types").OpenAPIV3_1.ServerVariableObject, "enum"> & {
|
|
243
243
|
enum?: [string, ...string[]];
|
|
244
244
|
}> | undefined;
|
|
245
|
-
}>;
|
|
245
|
+
} | undefined>;
|
|
246
246
|
activeWorkspace: import("vue").ComputedRef<{
|
|
247
247
|
uid: string;
|
|
248
248
|
name: string;
|
|
@@ -260,7 +260,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
260
260
|
}>> | undefined;
|
|
261
261
|
} | undefined;
|
|
262
262
|
proxyUrl?: string | undefined;
|
|
263
|
-
}>;
|
|
263
|
+
} | undefined>;
|
|
264
264
|
activeWorkspaceCollections: import("vue").ComputedRef<{
|
|
265
265
|
type: "collection";
|
|
266
266
|
uid: string;
|
|
@@ -316,14 +316,14 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
316
316
|
documentUrl?: string | undefined;
|
|
317
317
|
integration?: string | null | undefined;
|
|
318
318
|
}[]>;
|
|
319
|
-
activeWorkspaceServers: import("vue").ComputedRef<{
|
|
319
|
+
activeWorkspaceServers: import("vue").ComputedRef<({
|
|
320
320
|
uid: string;
|
|
321
321
|
url: string;
|
|
322
322
|
description?: string | undefined;
|
|
323
323
|
variables?: Record<string, Omit<import("@scalar/openapi-types").OpenAPIV3_1.ServerVariableObject, "enum"> & {
|
|
324
324
|
enum?: [string, ...string[]];
|
|
325
325
|
}> | undefined;
|
|
326
|
-
}[]>;
|
|
326
|
+
} | undefined)[]>;
|
|
327
327
|
activeEnvVariables: import("vue").ComputedRef<EnvVariable[]>;
|
|
328
328
|
activeWorkspaceRequests: import("vue").ComputedRef<string[]>;
|
|
329
329
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-entities.d.ts","sourceRoot":"","sources":["../../src/store/active-entities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wC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