@testsmith/api-spector 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/chunks/{broker-client-D0wYVblb.js → broker-client-5IyCTx40.js} +1 -1
- package/out/main/chunks/{handle-BY_jaVBT.js → handle-DRmKOL-s.js} +1 -0
- package/out/main/chunks/{import-DR_r1DUP.js → import-B5T5wDu7.js} +2 -2
- package/out/main/chunks/{request-exec-DHxjokyP.js → request-exec-CwJ8_OKC.js} +1 -1
- package/out/main/chunks/{soap-handler-CkoLJHoI.js → soap-handler-DTfFnzNY.js} +2 -2
- package/out/main/contract.js +3 -3
- package/out/main/flow.js +3 -3
- package/out/main/index.js +37 -5
- package/out/main/lib.js +2 -2
- package/out/main/runner.js +3 -3
- package/out/main/wsdl.js +3 -3
- package/out/preload/index.js +2 -0
- package/out/renderer/assets/{GraphQLEditor-CWJMEqny.js → GraphQLEditor-CDLI1OHR.js} +1 -1
- package/out/renderer/assets/{SoapEditor-C01AJQ38.js → SoapEditor-CSUFJk7c.js} +1 -1
- package/out/renderer/assets/{index-CUCX3V01.js → index-8bbf24uI.js} +33 -5
- package/out/renderer/index.html +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ const promises = require("node:fs/promises");
|
|
|
3
3
|
const path = require("node:path");
|
|
4
4
|
const crypto = require("node:crypto");
|
|
5
5
|
const undici = require("undici");
|
|
6
|
-
const requestExec = require("./request-exec-
|
|
6
|
+
const requestExec = require("./request-exec-CwJ8_OKC.js");
|
|
7
7
|
const Ajv = require("ajv");
|
|
8
8
|
const jsYaml = require("js-yaml");
|
|
9
9
|
require("node:http");
|
|
@@ -73,6 +73,7 @@ const IPC = {
|
|
|
73
73
|
// ─── Import ────────────────────────────────────────────────────────────────
|
|
74
74
|
import: {
|
|
75
75
|
postman: "import:postman",
|
|
76
|
+
postmanEnvironment: "import:postman-environment",
|
|
76
77
|
openapi: "import:openapi",
|
|
77
78
|
openapiUrl: "import:openapi-url",
|
|
78
79
|
insomnia: "import:insomnia",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uuid = require("uuid");
|
|
4
|
-
const soapHandler = require("./soap-handler-
|
|
5
|
-
require("./handle-
|
|
4
|
+
const soapHandler = require("./soap-handler-DTfFnzNY.js");
|
|
5
|
+
require("./handle-DRmKOL-s.js");
|
|
6
6
|
require("node:https");
|
|
7
7
|
require("node:http");
|
|
8
8
|
require("@xmldom/xmldom");
|
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
const undici = require("undici");
|
|
25
25
|
const promises$1 = require("fs/promises");
|
|
26
26
|
const nodeTls = require("tls");
|
|
27
|
-
const handle = require("./handle-
|
|
27
|
+
const handle = require("./handle-DRmKOL-s.js");
|
|
28
28
|
const fs = require("node:fs");
|
|
29
29
|
const os = require("node:os");
|
|
30
30
|
const path = require("node:path");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const handle = require("./handle-
|
|
2
|
+
const handle = require("./handle-DRmKOL-s.js");
|
|
3
3
|
const https = require("node:https");
|
|
4
4
|
const http = require("node:http");
|
|
5
5
|
const xmldom = require("@xmldom/xmldom");
|
|
@@ -313,7 +313,7 @@ function registerSoapHandlers(ipc) {
|
|
|
313
313
|
handle.handleIpc(ipc, handle.IPC.wsdl.import, async (_event, opts) => {
|
|
314
314
|
const { validateWsdlImport } = await Promise.resolve().then(() => require("./ipc-validate-sqUFqRmE.js"));
|
|
315
315
|
validateWsdlImport(opts);
|
|
316
|
-
const { importWsdl } = await Promise.resolve().then(() => require("./import-
|
|
316
|
+
const { importWsdl } = await Promise.resolve().then(() => require("./import-B5T5wDu7.js"));
|
|
317
317
|
const wsdlText = opts.xml ?? (opts.url ? await fetchUrl(opts.url) : "");
|
|
318
318
|
if (!wsdlText) throw new Error("wsdl:import requires either `url` or `xml`");
|
|
319
319
|
return importWsdl(wsdlText, { name: opts.name, existingMockPorts: opts.existingMockPorts });
|
package/out/main/contract.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const brokerClient = require("./chunks/broker-client-
|
|
5
|
+
const brokerClient = require("./chunks/broker-client-5IyCTx40.js");
|
|
6
6
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
7
7
|
const crypto = require("node:crypto");
|
|
8
8
|
const undici = require("undici");
|
|
@@ -11,10 +11,10 @@ const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
|
11
11
|
const node_child_process = require("node:child_process");
|
|
12
12
|
const jsYaml = require("js-yaml");
|
|
13
13
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
14
|
-
require("./chunks/request-exec-
|
|
14
|
+
require("./chunks/request-exec-CwJ8_OKC.js");
|
|
15
15
|
require("fs/promises");
|
|
16
16
|
require("tls");
|
|
17
|
-
require("./chunks/handle-
|
|
17
|
+
require("./chunks/handle-DRmKOL-s.js");
|
|
18
18
|
require("node:fs");
|
|
19
19
|
require("dayjs");
|
|
20
20
|
require("node:vm");
|
package/out/main/flow.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const requestExec = require("./chunks/request-exec-
|
|
5
|
+
const requestExec = require("./chunks/request-exec-CwJ8_OKC.js");
|
|
6
6
|
const requestCollection = require("./chunks/request-collection-KGPuvN7o.js");
|
|
7
7
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
8
8
|
const flowEngine = require("./chunks/flow-engine-BVzjz4lJ.js");
|
|
@@ -10,7 +10,7 @@ const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
|
10
10
|
require("undici");
|
|
11
11
|
require("fs/promises");
|
|
12
12
|
require("tls");
|
|
13
|
-
require("./chunks/handle-
|
|
13
|
+
require("./chunks/handle-DRmKOL-s.js");
|
|
14
14
|
require("node:fs");
|
|
15
15
|
require("node:os");
|
|
16
16
|
require("node:crypto");
|
|
@@ -265,7 +265,7 @@ async function main() {
|
|
|
265
265
|
const envName = args.environment ?? args.env;
|
|
266
266
|
const env = environments.selectEnvironment(workspace, environments$1, envName);
|
|
267
267
|
const verbose = Boolean(args.verbose);
|
|
268
|
-
const version = `v${"0.7.
|
|
268
|
+
const version = `v${"0.7.6"}`;
|
|
269
269
|
console.log("");
|
|
270
270
|
console.log(cliCommon.color(" API Flow Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
|
|
271
271
|
console.log(cliCommon.color(` Flow: ${flow.name}`, cliCommon.C.gray));
|
package/out/main/index.js
CHANGED
|
@@ -22,14 +22,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
const electron = require("electron");
|
|
25
|
-
const handle = require("./chunks/handle-
|
|
25
|
+
const handle = require("./chunks/handle-DRmKOL-s.js");
|
|
26
26
|
const path = require("node:path");
|
|
27
27
|
const fs = require("node:fs");
|
|
28
28
|
const promises = require("node:fs/promises");
|
|
29
29
|
const crypto = require("node:crypto");
|
|
30
30
|
const JSZip = require("jszip");
|
|
31
31
|
const dataFiles = require("./chunks/data-files-BYqhsoPe.js");
|
|
32
|
-
const requestExec = require("./chunks/request-exec-
|
|
32
|
+
const requestExec = require("./chunks/request-exec-CwJ8_OKC.js");
|
|
33
33
|
const ipcValidate = require("./chunks/ipc-validate-sqUFqRmE.js");
|
|
34
34
|
const uuid = require("uuid");
|
|
35
35
|
const jsYaml = require("js-yaml");
|
|
@@ -42,9 +42,9 @@ const WebSocket = require("ws");
|
|
|
42
42
|
const os = require("node:os");
|
|
43
43
|
const grpc = require("@grpc/grpc-js");
|
|
44
44
|
const protoLoader = require("@grpc/proto-loader");
|
|
45
|
-
const soapHandler = require("./chunks/soap-handler-
|
|
45
|
+
const soapHandler = require("./chunks/soap-handler-DTfFnzNY.js");
|
|
46
46
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
47
|
-
const brokerClient = require("./chunks/broker-client-
|
|
47
|
+
const brokerClient = require("./chunks/broker-client-5IyCTx40.js");
|
|
48
48
|
const simpleGit = require("simple-git");
|
|
49
49
|
const recorder = require("./chunks/recorder-BkO8G_mB.js");
|
|
50
50
|
const electronUpdater = require("electron-updater");
|
|
@@ -1299,6 +1299,29 @@ async function importPostman(filePath) {
|
|
|
1299
1299
|
requests
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
+
async function importPostmanEnvironment(filePath) {
|
|
1303
|
+
const raw = await promises.readFile(filePath, "utf8");
|
|
1304
|
+
let data;
|
|
1305
|
+
try {
|
|
1306
|
+
data = JSON.parse(raw);
|
|
1307
|
+
} catch {
|
|
1308
|
+
throw new Error("Not valid JSON — pick a Postman environment export file.");
|
|
1309
|
+
}
|
|
1310
|
+
if (!Array.isArray(data.values) || data._postman_variable_scope === "collection") {
|
|
1311
|
+
throw new Error('Not a Postman environment file (no "values" array found).');
|
|
1312
|
+
}
|
|
1313
|
+
const variables = data.values.filter((v) => !!v && typeof v.key === "string" && v.key.length > 0).map((v) => ({
|
|
1314
|
+
key: v.key,
|
|
1315
|
+
value: v.value == null ? "" : String(v.value),
|
|
1316
|
+
enabled: v.enabled !== false
|
|
1317
|
+
}));
|
|
1318
|
+
return {
|
|
1319
|
+
version: "1.0",
|
|
1320
|
+
id: uuid.v4(),
|
|
1321
|
+
name: data.name && String(data.name).trim() || "Imported Environment",
|
|
1322
|
+
variables
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1302
1325
|
async function loadSpec(filePath) {
|
|
1303
1326
|
const raw = await promises.readFile(filePath, "utf8");
|
|
1304
1327
|
if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) {
|
|
@@ -2041,6 +2064,15 @@ function registerImportHandlers(ipc) {
|
|
|
2041
2064
|
if (result.canceled || !result.filePaths[0]) return null;
|
|
2042
2065
|
return importPostman(result.filePaths[0]);
|
|
2043
2066
|
});
|
|
2067
|
+
handle.handleIpc(ipc, handle.IPC.import.postmanEnvironment, async () => {
|
|
2068
|
+
const result = await electron.dialog.showOpenDialog({
|
|
2069
|
+
title: "Import Postman Environment",
|
|
2070
|
+
filters: [{ name: "JSON", extensions: ["json"] }],
|
|
2071
|
+
properties: ["openFile"]
|
|
2072
|
+
});
|
|
2073
|
+
if (result.canceled || !result.filePaths[0]) return null;
|
|
2074
|
+
return importPostmanEnvironment(result.filePaths[0]);
|
|
2075
|
+
});
|
|
2044
2076
|
handle.handleIpc(ipc, handle.IPC.import.openapi, async () => {
|
|
2045
2077
|
const result = await electron.dialog.showOpenDialog({
|
|
2046
2078
|
title: "Import OpenAPI Definition",
|
|
@@ -6110,7 +6142,7 @@ function isNewer(a, b) {
|
|
|
6110
6142
|
return a2 > b2;
|
|
6111
6143
|
}
|
|
6112
6144
|
async function checkForUpdate() {
|
|
6113
|
-
const current = "0.7.
|
|
6145
|
+
const current = "0.7.6";
|
|
6114
6146
|
try {
|
|
6115
6147
|
const res = await fetch(REGISTRY_URL, { signal: AbortSignal.timeout(4e3) });
|
|
6116
6148
|
if (!res.ok) return null;
|
package/out/main/lib.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const mockServer = require("./chunks/mock-server-C4kTFkod.js");
|
|
4
|
-
const requestExec = require("./chunks/request-exec-
|
|
4
|
+
const requestExec = require("./chunks/request-exec-CwJ8_OKC.js");
|
|
5
5
|
const flowEngine = require("./chunks/flow-engine-BVzjz4lJ.js");
|
|
6
6
|
require("node:http");
|
|
7
7
|
require("node:crypto");
|
|
@@ -11,7 +11,7 @@ require("@xmldom/xmldom");
|
|
|
11
11
|
require("undici");
|
|
12
12
|
require("fs/promises");
|
|
13
13
|
require("tls");
|
|
14
|
-
require("./chunks/handle-
|
|
14
|
+
require("./chunks/handle-DRmKOL-s.js");
|
|
15
15
|
require("node:fs");
|
|
16
16
|
require("node:os");
|
|
17
17
|
require("node:path");
|
package/out/main/runner.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const requestExec = require("./chunks/request-exec-
|
|
5
|
+
const requestExec = require("./chunks/request-exec-CwJ8_OKC.js");
|
|
6
6
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
7
7
|
const requestCollection = require("./chunks/request-collection-KGPuvN7o.js");
|
|
8
8
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
@@ -10,7 +10,7 @@ const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
|
10
10
|
require("undici");
|
|
11
11
|
require("fs/promises");
|
|
12
12
|
require("tls");
|
|
13
|
-
require("./chunks/handle-
|
|
13
|
+
require("./chunks/handle-DRmKOL-s.js");
|
|
14
14
|
require("node:fs");
|
|
15
15
|
require("node:os");
|
|
16
16
|
require("node:crypto");
|
|
@@ -495,7 +495,7 @@ async function main() {
|
|
|
495
495
|
} else if (!envName && workspace.settings?.defaultEnvironment && !env) {
|
|
496
496
|
console.warn(cliCommon.color(`Warning: default environment "${workspace.settings.defaultEnvironment}" not found. Running without environment.`, cliCommon.C.yellow));
|
|
497
497
|
}
|
|
498
|
-
const version = `v${"0.7.
|
|
498
|
+
const version = `v${"0.7.6"}`;
|
|
499
499
|
console.log("");
|
|
500
500
|
console.log(cliCommon.color(" API Test Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
|
|
501
501
|
console.log(cliCommon.color(` Workspace: ${wsPath}`, cliCommon.C.gray));
|
package/out/main/wsdl.js
CHANGED
|
@@ -4,10 +4,10 @@ const promises = require("node:fs/promises");
|
|
|
4
4
|
const path = require("node:path");
|
|
5
5
|
const https = require("node:https");
|
|
6
6
|
const http = require("node:http");
|
|
7
|
-
const soapHandler = require("./chunks/soap-handler-
|
|
8
|
-
const _import = require("./chunks/import-
|
|
7
|
+
const soapHandler = require("./chunks/soap-handler-DTfFnzNY.js");
|
|
8
|
+
const _import = require("./chunks/import-B5T5wDu7.js");
|
|
9
9
|
const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
10
|
-
require("./chunks/handle-
|
|
10
|
+
require("./chunks/handle-DRmKOL-s.js");
|
|
11
11
|
require("@xmldom/xmldom");
|
|
12
12
|
require("uuid");
|
|
13
13
|
require("./chunks/data-files-BYqhsoPe.js");
|
package/out/preload/index.js
CHANGED
|
@@ -74,6 +74,7 @@ const IPC = {
|
|
|
74
74
|
// ─── Import ────────────────────────────────────────────────────────────────
|
|
75
75
|
import: {
|
|
76
76
|
postman: "import:postman",
|
|
77
|
+
postmanEnvironment: "import:postman-environment",
|
|
77
78
|
openapi: "import:openapi",
|
|
78
79
|
openapiUrl: "import:openapi-url",
|
|
79
80
|
insomnia: "import:insomnia",
|
|
@@ -308,6 +309,7 @@ const api = {
|
|
|
308
309
|
},
|
|
309
310
|
// ─── Import ────────────────────────────────────────────────────────────────
|
|
310
311
|
importPostman: () => electron.ipcRenderer.invoke(IPC.import.postman),
|
|
312
|
+
importPostmanEnvironment: () => electron.ipcRenderer.invoke(IPC.import.postmanEnvironment),
|
|
311
313
|
importOpenApi: () => electron.ipcRenderer.invoke(IPC.import.openapi),
|
|
312
314
|
importOpenApiFromUrl: (url) => electron.ipcRenderer.invoke(IPC.import.openapiUrl, url),
|
|
313
315
|
importInsomnia: () => electron.ipcRenderer.invoke(IPC.import.insomnia),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as linter, E as EditorView, L as LanguageSupport, e as LRLanguage, s as styleTags, i as indentNodeProp, f as delimitedIndent, m as foldNodeProp, n as foldInside, S as StateField, p as LRParser, q as StateEffect, u as tags, r as reactExports, j as jsxRuntimeExports, c as ReactCodeMirror, o as oneDark, b as json } from "./codemirror-F6m3Hm1M.js";
|
|
2
|
-
import { u as useT, a as useStore, b as useActiveEnvironment } from "./index-
|
|
2
|
+
import { u as useT, a as useStore, b as useActiveEnvironment } from "./index-8bbf24uI.js";
|
|
3
3
|
import "./ajv-2MAg6kGF.js";
|
|
4
4
|
function devAssert(condition, message) {
|
|
5
5
|
const booleanCondition = Boolean(condition);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports, c as ReactCodeMirror, o as oneDark, x as xml } from "./codemirror-F6m3Hm1M.js";
|
|
2
|
-
import { u as useT, c as btnPrimaryCls, d as commentKeymap } from "./index-
|
|
2
|
+
import { u as useT, c as btnPrimaryCls, d as commentKeymap } from "./index-8bbf24uI.js";
|
|
3
3
|
import "./ajv-2MAg6kGF.js";
|
|
4
4
|
const SOAP_11_CONTENT_TYPE = "text/xml; charset=utf-8";
|
|
5
5
|
const SOAP_12_CONTENT_TYPE = "application/soap+xml; charset=utf-8";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphQLEditor-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphQLEditor-CDLI1OHR.js","./codemirror-F6m3Hm1M.js","./ajv-2MAg6kGF.js","./SoapEditor-CSUFJk7c.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { r as reactExports, g as getDefaultExportFromCjs, R as React$4, a as autocompletion, h as hoverTooltip, j as jsxRuntimeExports, k as keymap, t as toggleComment, x as xml, b as json, c as ReactCodeMirror, o as oneDark, d as javascript } from "./codemirror-F6m3Hm1M.js";
|
|
3
3
|
import { A as Ajv } from "./ajv-2MAg6kGF.js";
|
|
4
4
|
var client = { exports: {} };
|
|
@@ -27876,8 +27876,8 @@ function jsonWithComments() {
|
|
|
27876
27876
|
function xmlWithComments() {
|
|
27877
27877
|
return [xml(), commentKeymap];
|
|
27878
27878
|
}
|
|
27879
|
-
const GraphQLEditor = reactExports.lazy(() => __vitePreload(() => import("./GraphQLEditor-
|
|
27880
|
-
const SoapEditor = reactExports.lazy(() => __vitePreload(() => import("./SoapEditor-
|
|
27879
|
+
const GraphQLEditor = reactExports.lazy(() => __vitePreload(() => import("./GraphQLEditor-CDLI1OHR.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m) => ({ default: m.GraphQLEditor })));
|
|
27880
|
+
const SoapEditor = reactExports.lazy(() => __vitePreload(() => import("./SoapEditor-CSUFJk7c.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m) => ({ default: m.SoapEditor })));
|
|
27881
27881
|
function BodyTab({ request: request2, onChange }) {
|
|
27882
27882
|
const t = useT();
|
|
27883
27883
|
const editorFallback = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-xs text-surface-500", children: t("Loading editor…") });
|
|
@@ -33249,7 +33249,7 @@ function WelcomeScreen() {
|
|
|
33249
33249
|
)
|
|
33250
33250
|
] }),
|
|
33251
33251
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-surface-400 text-sm max-w-sm", children: t("Local-first API testing with Robot Framework & Playwright code generation. Secrets stay on your machine.") }),
|
|
33252
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] mt-3", style: { color: "var(--text-muted)" }, children: t("version :version", { version: "0.7.
|
|
33252
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] mt-3", style: { color: "var(--text-muted)" }, children: t("version :version", { version: "0.7.6" }) })
|
|
33253
33253
|
] }),
|
|
33254
33254
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 w-64", children: [
|
|
33255
33255
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -35308,6 +35308,7 @@ function parseCurl(command) {
|
|
|
35308
35308
|
const { electron: electron$f } = window;
|
|
35309
35309
|
const OPTIONS = [
|
|
35310
35310
|
{ id: "postman", label: "Postman", description: "Collection v2.1 JSON" },
|
|
35311
|
+
{ id: "postman-env", label: "Postman Env", description: "Environment export JSON" },
|
|
35311
35312
|
{ id: "openapi", label: "OpenAPI", description: "JSON or YAML (v3.x)", supportsUrl: true },
|
|
35312
35313
|
{ id: "insomnia", label: "Insomnia", description: "Export v4 JSON" },
|
|
35313
35314
|
{ id: "bruno", label: "Bruno", description: "bruno.json collection file" },
|
|
@@ -35380,6 +35381,15 @@ function ImportModal({ onImport, onClose }) {
|
|
|
35380
35381
|
setLoading(true);
|
|
35381
35382
|
setError(null);
|
|
35382
35383
|
try {
|
|
35384
|
+
if (opt.id === "postman-env") {
|
|
35385
|
+
const env2 = await electron$f.importPostmanEnvironment();
|
|
35386
|
+
if (env2) {
|
|
35387
|
+
await persistImportedEnvironment(env2);
|
|
35388
|
+
onImport(null);
|
|
35389
|
+
onClose();
|
|
35390
|
+
}
|
|
35391
|
+
return;
|
|
35392
|
+
}
|
|
35383
35393
|
let col = null;
|
|
35384
35394
|
if (opt.id === "postman") col = await electron$f.importPostman();
|
|
35385
35395
|
if (opt.id === "openapi") col = await electron$f.importOpenApi();
|
|
@@ -35529,6 +35539,24 @@ function ImportModal({ onImport, onClose }) {
|
|
|
35529
35539
|
setLoading(false);
|
|
35530
35540
|
}
|
|
35531
35541
|
}
|
|
35542
|
+
async function persistImportedEnvironment(env2) {
|
|
35543
|
+
const state = useStore$1.getState();
|
|
35544
|
+
const existingNames = Object.values(state.environments).map((e) => e.data.name);
|
|
35545
|
+
const finalName = uniqueEnvName(env2.name || t("Imported Environment"), existingNames);
|
|
35546
|
+
const finalEnv = { ...env2, name: finalName };
|
|
35547
|
+
const relPath = envRelPath(finalName, finalEnv.id);
|
|
35548
|
+
await electron$f.saveEnvironment(relPath, finalEnv);
|
|
35549
|
+
useStore$1.setState((s) => {
|
|
35550
|
+
s.environments[finalEnv.id] = { relPath, data: finalEnv };
|
|
35551
|
+
if (!s.activeEnvironmentId) s.activeEnvironmentId = finalEnv.id;
|
|
35552
|
+
if (s.workspace && !s.workspace.environments.includes(relPath)) {
|
|
35553
|
+
s.workspace.environments = [...s.workspace.environments, relPath];
|
|
35554
|
+
}
|
|
35555
|
+
return s;
|
|
35556
|
+
});
|
|
35557
|
+
const ws = useStore$1.getState().workspace;
|
|
35558
|
+
if (ws) await electron$f.saveWorkspace(ws);
|
|
35559
|
+
}
|
|
35532
35560
|
async function persistBaseUrlVariable(name, value2) {
|
|
35533
35561
|
const state = useStore$1.getState();
|
|
35534
35562
|
if (envTarget === "__new__") {
|
|
@@ -52874,7 +52902,7 @@ function App() {
|
|
|
52874
52902
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "#6aa3c8" }, children: "Spector" }),
|
|
52875
52903
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-2 text-[10px] font-normal opacity-50", children: [
|
|
52876
52904
|
"v",
|
|
52877
|
-
"0.7.
|
|
52905
|
+
"0.7.6"
|
|
52878
52906
|
] }),
|
|
52879
52907
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mx-2 opacity-30", children: "·" }),
|
|
52880
52908
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
package/out/renderer/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>API Spector</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-8bbf24uI.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/codemirror-F6m3Hm1M.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="./assets/ajv-2MAg6kGF.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./assets/index-CYArpqm5.css">
|