@testsmith/api-spector 0.8.7 → 0.8.8

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.
@@ -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-BI4sXJop.js");
6
+ const requestExec = require("./request-exec-s7k-oRi2.js");
7
7
  const Ajv = require("ajv");
8
8
  const jsYaml = require("js-yaml");
9
9
  require("node:http");
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- const requestExec = require("./request-exec-BI4sXJop.js");
2
+ const requestExec = require("./request-exec-s7k-oRi2.js");
3
3
  const grpc = require("@grpc/grpc-js");
4
4
  const protoLoader = require("@grpc/proto-loader");
5
5
  const fs = require("node:fs");
6
6
  const os = require("node:os");
7
7
  const path = require("node:path");
8
8
  const flowEngine = require("./flow-engine-BxwjEy37.js");
9
- const requestCollection = require("./request-collection-gkOYlWml.js");
9
+ const requestCollection = require("./request-collection-zRRUfg0X.js");
10
10
  function _interopNamespaceDefault(e) {
11
11
  const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
12
  if (e) {
@@ -391,7 +391,7 @@ function createGrpcInvoker(cfg) {
391
391
  }
392
392
  async function buildFlowDeps(payload) {
393
393
  const envVars = payload.resolvedEnvVars ?? await requestExec.buildEnvVars(payload.environment ?? null);
394
- const globals = { ...payload.globals, ...requestExec.getGlobals() };
394
+ const globals = { ...payload.globals, ...requestCollection.getGlobals() };
395
395
  const dispatcher = await requestExec.buildDispatcher(payload.proxy, payload.tls);
396
396
  const flow = flowEngine.normalizeFlow(payload.flow);
397
397
  const flows = (payload.flows ?? []).map(flowEngine.normalizeFlow);
@@ -509,7 +509,7 @@ async function runPerfPlan(payload, onProgress) {
509
509
  if (!payload.collection) throw new Error("No collection selected for this plan");
510
510
  const collection = payload.collection;
511
511
  const envVars = payload.resolvedEnvVars ?? await requestExec.buildEnvVars(payload.environment ?? null);
512
- const globals = { ...payload.globals, ...requestExec.getGlobals() };
512
+ const globals = { ...payload.globals, ...requestCollection.getGlobals() };
513
513
  const dispatcher = await requestExec.buildDispatcher(payload.proxy, payload.tls);
514
514
  const items = requestCollection.buildRunPlan(collection, plan.target.folderId ?? null, []);
515
515
  if (items.length === 0) throw new Error("This collection or folder has no requests to run");
@@ -1,5 +1,32 @@
1
1
  "use strict";
2
+ const promises = require("node:fs/promises");
3
+ const path = require("node:path");
2
4
  require("uuid");
5
+ let globals = {};
6
+ let currentDir = null;
7
+ function globalsPath(dir) {
8
+ return path.join(dir, "globals.json");
9
+ }
10
+ async function loadGlobals(workspaceDir) {
11
+ currentDir = workspaceDir;
12
+ try {
13
+ const raw = await promises.readFile(globalsPath(workspaceDir), "utf8");
14
+ globals = JSON.parse(raw);
15
+ } catch {
16
+ globals = {};
17
+ }
18
+ return { ...globals };
19
+ }
20
+ async function persistGlobals() {
21
+ if (!currentDir) return;
22
+ await promises.writeFile(globalsPath(currentDir), JSON.stringify(globals, null, 2), "utf8");
23
+ }
24
+ function getGlobals() {
25
+ return { ...globals };
26
+ }
27
+ function setGlobals(next) {
28
+ globals = { ...next };
29
+ }
3
30
  function orderedChildren(folder) {
4
31
  const reqSet = new Set(folder.requestIds);
5
32
  const folderSet = new Set(folder.folders.map((f) => f.id));
@@ -131,8 +158,8 @@ function buildFolderPlan(folder, requests, collectionVars, filterTags, scopeId,
131
158
  function folderPathTo(root, requestId) {
132
159
  if (root.requestIds.includes(requestId)) return [root];
133
160
  for (const sub of root.folders) {
134
- const path = folderPathTo(sub, requestId);
135
- if (path.length > 0) return [root, ...path];
161
+ const path2 = folderPathTo(sub, requestId);
162
+ if (path2.length > 0) return [root, ...path2];
136
163
  }
137
164
  return [];
138
165
  }
@@ -184,8 +211,8 @@ function authIsConfigured(auth) {
184
211
  function resolveInheritedAuthAndHeaders(requestId, collection) {
185
212
  let inheritedAuth = collection.auth && collection.auth.type !== "none" ? collection.auth : null;
186
213
  let inheritedHeaders = collection.headers?.filter((h) => h.enabled && h.key) ?? [];
187
- const path = folderPathTo(collection.rootFolder, requestId);
188
- for (const folder of path) {
214
+ const path2 = folderPathTo(collection.rootFolder, requestId);
215
+ for (const folder of path2) {
189
216
  if (folder.auth && folder.auth.type !== "none") inheritedAuth = folder.auth;
190
217
  if (folder.headers?.length) {
191
218
  inheritedHeaders = [...inheritedHeaders, ...folder.headers.filter((h) => h.enabled && h.key)];
@@ -324,4 +351,8 @@ exports.buildRunPlan = buildRunPlan;
324
351
  exports.expandFolderDataSets = expandFolderDataSets;
325
352
  exports.expandRunPlanWithData = expandRunPlanWithData;
326
353
  exports.getAllApplicableHooks = getAllApplicableHooks;
354
+ exports.getGlobals = getGlobals;
355
+ exports.loadGlobals = loadGlobals;
356
+ exports.persistGlobals = persistGlobals;
327
357
  exports.resolveInheritedAuthAndHeaders = resolveInheritedAuthAndHeaders;
358
+ exports.setGlobals = setGlobals;
@@ -59,34 +59,6 @@ function _interopNamespaceDefault(e) {
59
59
  const nodeTls__namespace = /* @__PURE__ */ _interopNamespaceDefault(nodeTls);
60
60
  const crypto__namespace = /* @__PURE__ */ _interopNamespaceDefault(crypto);
61
61
  const vm__namespace = /* @__PURE__ */ _interopNamespaceDefault(vm);
62
- let globals = {};
63
- let currentDir = null;
64
- function globalsPath(dir) {
65
- return path.join(dir, "globals.json");
66
- }
67
- async function loadGlobals(workspaceDir) {
68
- currentDir = workspaceDir;
69
- try {
70
- const raw = await promises.readFile(globalsPath(workspaceDir), "utf8");
71
- globals = JSON.parse(raw);
72
- } catch {
73
- globals = {};
74
- }
75
- return { ...globals };
76
- }
77
- async function persistGlobals() {
78
- if (!currentDir) return;
79
- await promises.writeFile(globalsPath(currentDir), JSON.stringify(globals, null, 2), "utf8");
80
- }
81
- function getGlobals() {
82
- return { ...globals };
83
- }
84
- function setGlobals(next) {
85
- globals = { ...next };
86
- }
87
- function patchGlobals(patch) {
88
- globals = { ...globals, ...patch };
89
- }
90
62
  const providers = /* @__PURE__ */ new Map();
91
63
  function registerSecretProvider(provider) {
92
64
  providers.set(provider.scheme.toLowerCase(), provider);
@@ -932,9 +904,9 @@ async function resolveInlineSecretRefs(text) {
932
904
  }));
933
905
  return out;
934
906
  }
935
- function mergeVars(envVars, collectionVars, globals2, localVars = {}, dynamicVars = {}, folderVars = {}) {
907
+ function mergeVars(envVars, collectionVars, globals, localVars = {}, dynamicVars = {}, folderVars = {}) {
936
908
  const out = {};
937
- for (const src of [dynamicVars, globals2, collectionVars, envVars, folderVars, localVars]) {
909
+ for (const src of [dynamicVars, globals, envVars, collectionVars, folderVars, localVars]) {
938
910
  for (const [k, v] of Object.entries(src ?? {})) {
939
911
  if (v == null) continue;
940
912
  out[k] = v;
@@ -1117,7 +1089,7 @@ class AssertionError extends Error {
1117
1089
  }
1118
1090
  }
1119
1091
  function buildAt(ctx, testResults, consoleOutput) {
1120
- const { envVars, collectionVars, globals: globals2, localVars, piiMaskPatterns = [] } = ctx;
1092
+ const { envVars, collectionVars, globals, localVars, piiMaskPatterns = [] } = ctx;
1121
1093
  const folderVars = ctx.folderVars ?? {};
1122
1094
  const isSensitiveKey = (key) => piiMaskPatterns.some((p) => key.toLowerCase().includes(p.toLowerCase()));
1123
1095
  function makeVarScope(store, scopeName) {
@@ -1139,12 +1111,16 @@ function buildAt(ctx, testResults, consoleOutput) {
1139
1111
  const sp = {
1140
1112
  // Variable scopes
1141
1113
  variables: makeVarScope(localVars, "variables"),
1114
+ // Request-scoped set/get. Request variables live in the local tier at run
1115
+ // time, so this shares the local store: values apply for the current run (and
1116
+ // the in-memory session) but are never written back to the saved collection.
1117
+ request: makeVarScope(localVars, "request"),
1142
1118
  environment: makeVarScope(envVars, "environment"),
1143
1119
  collectionVariables: makeVarScope(collectionVars, "collectionVariables"),
1144
1120
  folder: makeVarScope(folderVars, "folder"),
1145
- globals: makeVarScope(globals2, "globals"),
1121
+ globals: makeVarScope(globals, "globals"),
1146
1122
  // Convenience: get/set across all scopes (local wins)
1147
- variables_get: (key) => localVars[key] ?? envVars[key] ?? folderVars[key] ?? collectionVars[key] ?? globals2[key] ?? null,
1123
+ variables_get: (key) => localVars[key] ?? envVars[key] ?? folderVars[key] ?? collectionVars[key] ?? globals[key] ?? null,
1148
1124
  variables_set: (key, value) => {
1149
1125
  localVars[key] = String(value);
1150
1126
  },
@@ -2683,7 +2659,7 @@ async function resolveInlineSecrets(req) {
2683
2659
  return resolveInlineSecretRefs(haystack);
2684
2660
  }
2685
2661
  async function executeRunnerRequest(opts) {
2686
- const { req, collectionVars, envVars, globals: globals2, dispatcher, piiMaskPatterns, proxy, tls, onScriptOutput } = opts;
2662
+ const { req, collectionVars, envVars, globals, dispatcher, piiMaskPatterns, proxy, tls, onScriptOutput } = opts;
2687
2663
  let { localVars } = opts;
2688
2664
  const folderVars = opts.folderVars ?? {};
2689
2665
  applyRequestDefaults(req);
@@ -2699,12 +2675,12 @@ async function executeRunnerRequest(opts) {
2699
2675
  localVars = { ...req.variables, ...localVars };
2700
2676
  }
2701
2677
  if (localVars && Object.keys(localVars).length > 0) {
2702
- localVars = resolveDataRow(localVars, mergeVars(envVars, collectionVars, globals2, {}, dynamicVars, folderVars));
2678
+ localVars = resolveDataRow(localVars, mergeVars(envVars, collectionVars, globals, {}, dynamicVars, folderVars));
2703
2679
  }
2704
- let vars = mergeVars(envVars, collectionVars, globals2, localVars, dynamicVars, folderVars);
2680
+ let vars = mergeVars(envVars, collectionVars, globals, localVars, dynamicVars, folderVars);
2705
2681
  let updatedEnvVars = { ...envVars };
2706
2682
  let updatedCollectionVars = { ...collectionVars };
2707
- let updatedGlobals = { ...globals2 };
2683
+ let updatedGlobals = { ...globals };
2708
2684
  let updatedFolderVars = { ...folderVars };
2709
2685
  let preScriptError;
2710
2686
  if (req.protocol === "mqtt") {
@@ -2726,7 +2702,7 @@ async function executeRunnerRequest(opts) {
2726
2702
  script: m.testScript ?? "",
2727
2703
  envVars,
2728
2704
  collectionVars,
2729
- globals: globals2,
2705
+ globals,
2730
2706
  localVars
2731
2707
  });
2732
2708
  const status = testRes.error ? "error" : testRes.testResults.length === 0 ? "skipped" : testRes.testResults.every((t) => t.passed) ? "passed" : "failed";
@@ -2759,7 +2735,7 @@ async function executeRunnerRequest(opts) {
2759
2735
  script: req.websocket?.testScript ?? "",
2760
2736
  envVars,
2761
2737
  collectionVars,
2762
- globals: globals2,
2738
+ globals,
2763
2739
  localVars
2764
2740
  }) : await runSocketIoTest({
2765
2741
  url: interpolate(req.url, vars),
@@ -2772,7 +2748,7 @@ async function executeRunnerRequest(opts) {
2772
2748
  script: req.socketio?.testScript ?? "",
2773
2749
  envVars,
2774
2750
  collectionVars,
2775
- globals: globals2,
2751
+ globals,
2776
2752
  localVars
2777
2753
  });
2778
2754
  const status = testRes.error ? "error" : testRes.testResults.length === 0 ? "skipped" : testRes.testResults.every((t) => t.passed) ? "passed" : "failed";
@@ -2815,7 +2791,7 @@ async function executeRunnerRequest(opts) {
2815
2791
  const r = await runScript(interpolate(req.preRequestScript, vars), {
2816
2792
  envVars: { ...envVars },
2817
2793
  collectionVars: { ...collectionVars },
2818
- globals: { ...globals2 },
2794
+ globals: { ...globals },
2819
2795
  localVars: { ...localVars },
2820
2796
  folderVars: { ...updatedFolderVars },
2821
2797
  piiMaskPatterns
@@ -2826,8 +2802,6 @@ async function executeRunnerRequest(opts) {
2826
2802
  updatedCollectionVars = r.updatedCollectionVars;
2827
2803
  updatedGlobals = r.updatedGlobals;
2828
2804
  updatedFolderVars = r.updatedFolderVars;
2829
- patchGlobals(r.updatedGlobals);
2830
- await persistGlobals();
2831
2805
  onScriptOutput?.("pre", r.consoleOutput, r.error);
2832
2806
  vars = mergeVars(updatedEnvVars, updatedCollectionVars, updatedGlobals, localVars, dynamicVars, updatedFolderVars);
2833
2807
  if (Object.keys(inlineSecrets).length) vars = { ...vars, ...inlineSecrets };
@@ -2870,8 +2844,6 @@ async function executeRunnerRequest(opts) {
2870
2844
  updatedGlobals = r.updatedGlobals;
2871
2845
  updatedFolderVars = r.updatedFolderVars;
2872
2846
  localVars = r.updatedLocalVars;
2873
- patchGlobals(r.updatedGlobals);
2874
- await persistGlobals();
2875
2847
  onScriptOutput?.("post", r.consoleOutput, r.error);
2876
2848
  }
2877
2849
  if (opts.expectStatus && opts.expectStatus.length > 0) {
@@ -2988,18 +2960,14 @@ exports.deriveRunStatus = deriveRunStatus;
2988
2960
  exports.evaluateExpression = evaluateExpression;
2989
2961
  exports.executeRunnerRequest = executeRunnerRequest;
2990
2962
  exports.fetchOAuth2Token = fetchOAuth2Token;
2991
- exports.getGlobals = getGlobals;
2992
2963
  exports.getSecret = getSecret;
2993
2964
  exports.hasSecretScheme = hasSecretScheme;
2994
2965
  exports.initSecretStore = initSecretStore;
2995
2966
  exports.interpolate = interpolate;
2996
- exports.loadGlobals = loadGlobals;
2997
2967
  exports.maskHeaders = maskHeaders;
2998
2968
  exports.maskPii = maskPii;
2999
2969
  exports.mergeVars = mergeVars;
3000
- exports.patchGlobals = patchGlobals;
3001
2970
  exports.performHttpExchange = performHttpExchange;
3002
- exports.persistGlobals = persistGlobals;
3003
2971
  exports.rebaseUrl = rebaseUrl;
3004
2972
  exports.registerSecretHandlers = registerSecretHandlers;
3005
2973
  exports.registerSecretProvider = registerSecretProvider;
@@ -3012,7 +2980,6 @@ exports.runMqttTest = runMqttTest;
3012
2980
  exports.runScript = runScript;
3013
2981
  exports.runSocketIoTest = runSocketIoTest;
3014
2982
  exports.runWsTest = runWsTest;
3015
- exports.setGlobals = setGlobals;
3016
2983
  exports.setSecretsConfig = setSecretsConfig;
3017
2984
  exports.stripJsonComments = stripJsonComments;
3018
2985
  exports.syntheticHttpFailure = syntheticHttpFailure;
@@ -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-Bp9YId3a.js");
5
+ const brokerClient = require("./chunks/broker-client-Bmt4seb8.js");
6
6
  const escape = require("./chunks/escape-DDVAlOvZ.js");
7
7
  const crypto = require("node:crypto");
8
8
  const undici = require("undici");
@@ -11,7 +11,7 @@ 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-BI4sXJop.js");
14
+ require("./chunks/request-exec-s7k-oRi2.js");
15
15
  require("fs/promises");
16
16
  require("tls");
17
17
  require("./chunks/handle-_4XMUlwm.js");
package/out/main/flow.js CHANGED
@@ -2,8 +2,8 @@
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-BI4sXJop.js");
6
- const requestCollection = require("./chunks/request-collection-gkOYlWml.js");
5
+ const requestExec = require("./chunks/request-exec-s7k-oRi2.js");
6
+ const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
7
7
  const environments = require("./chunks/environments-iM3SUM-4.js");
8
8
  const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
9
9
  const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
@@ -232,7 +232,7 @@ async function main() {
232
232
  console.error(cliCommon.color(`Error: could not read workspace: ${wsPath}`, cliCommon.C.red));
233
233
  process.exit(1);
234
234
  }
235
- await requestExec.loadGlobals(wsDir);
235
+ await requestCollection.loadGlobals(wsDir);
236
236
  requestExec.setSecretsConfig(workspace.settings?.secrets);
237
237
  const flows = (await cliCommon.loadFlows(
238
238
  workspace,
@@ -268,7 +268,7 @@ async function main() {
268
268
  const envName = args.environment ?? args.env;
269
269
  const env = environments.selectEnvironment(workspace, environments$1, envName);
270
270
  const verbose = Boolean(args.verbose);
271
- const version = `v${"0.8.7"}`;
271
+ const version = `v${"0.8.8"}`;
272
272
  console.log("");
273
273
  console.log(cliCommon.color(" API Flow Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
274
274
  console.log(cliCommon.color(` Flow: ${flow.name}`, cliCommon.C.gray));
@@ -276,7 +276,7 @@ async function main() {
276
276
  console.log(cliCommon.color(` Environment: ${env?.name ?? "(none)"}`, cliCommon.C.gray));
277
277
  console.log("");
278
278
  const envVars = await requestExec.buildEnvVars(env);
279
- const globals = requestExec.getGlobals();
279
+ const globals = requestCollection.getGlobals();
280
280
  const dispatcher = await requestExec.buildDispatcher(workspace.settings?.proxy, workspace.settings?.tls);
281
281
  const piiMaskPatterns = workspace.settings?.piiMaskPatterns ?? [];
282
282
  const colById = new Map(collections.map((c) => [c.id, c]));
package/out/main/index.js CHANGED
@@ -4,23 +4,23 @@ const handle = require("./chunks/handle-_4XMUlwm.js");
4
4
  const path = require("node:path");
5
5
  const fs = require("node:fs");
6
6
  const registerHandlers = require("./register-handlers.js");
7
- const requestExec = require("./chunks/request-exec-BI4sXJop.js");
7
+ const requestExec = require("./chunks/request-exec-s7k-oRi2.js");
8
8
  const electronUpdater = require("electron-updater");
9
9
  const mockServer = require("./chunks/mock-server-C4kTFkod.js");
10
10
  require("node:fs/promises");
11
11
  require("node:crypto");
12
12
  require("jszip");
13
13
  require("./chunks/data-files-BYqhsoPe.js");
14
+ require("./chunks/request-collection-zRRUfg0X.js");
15
+ require("uuid");
14
16
  require("./chunks/ipc-validate-sqUFqRmE.js");
15
17
  require("ajv");
16
- require("uuid");
17
18
  require("js-yaml");
18
19
  require("undici");
19
20
  require("./chunks/soap-handler-BF5ii0UV.js");
20
21
  require("node:https");
21
22
  require("node:http");
22
23
  require("@xmldom/xmldom");
23
- require("./chunks/request-collection-gkOYlWml.js");
24
24
  require("./chunks/run-concurrent-468tH0AX.js");
25
25
  require("./chunks/flow-engine-BxwjEy37.js");
26
26
  require("ws");
@@ -31,7 +31,7 @@ require("node:os");
31
31
  require("@grpc/grpc-js");
32
32
  require("@grpc/proto-loader");
33
33
  require("./chunks/escape-DDVAlOvZ.js");
34
- require("./chunks/broker-client-Bp9YId3a.js");
34
+ require("./chunks/broker-client-Bmt4seb8.js");
35
35
  require("simple-git");
36
36
  require("./chunks/recorder-BkO8G_mB.js");
37
37
  require("fs/promises");
@@ -50,7 +50,7 @@ function isNewer(a, b) {
50
50
  return a2 > b2;
51
51
  }
52
52
  async function checkForUpdate() {
53
- const current = "0.8.7";
53
+ const current = "0.8.8";
54
54
  try {
55
55
  const res = await fetch(REGISTRY_URL, { signal: AbortSignal.timeout(4e3) });
56
56
  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-BI4sXJop.js");
4
+ const requestExec = require("./chunks/request-exec-s7k-oRi2.js");
5
5
  const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
6
6
  require("node:http");
7
7
  require("node:crypto");
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
- const perfRun = require("./chunks/perf-run-Dcb-A4Ln.js");
3
- const requestExec = require("./chunks/request-exec-BI4sXJop.js");
2
+ const perfRun = require("./chunks/perf-run-wfdvpJev.js");
3
+ const requestExec = require("./chunks/request-exec-s7k-oRi2.js");
4
4
  require("@grpc/grpc-js");
5
5
  require("@grpc/proto-loader");
6
6
  require("node:fs");
7
7
  require("node:os");
8
8
  require("node:path");
9
9
  require("./chunks/flow-engine-BxwjEy37.js");
10
- require("./chunks/request-collection-gkOYlWml.js");
10
+ require("./chunks/request-collection-zRRUfg0X.js");
11
+ require("node:fs/promises");
11
12
  require("uuid");
12
13
  require("undici");
13
14
  require("fs/promises");
14
15
  require("tls");
15
16
  require("./chunks/handle-_4XMUlwm.js");
16
17
  require("node:crypto");
17
- require("node:fs/promises");
18
18
  require("dayjs");
19
19
  require("node:vm");
20
20
  require("tv4");
package/out/main/perf.js CHANGED
@@ -2,10 +2,11 @@
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-BI4sXJop.js");
5
+ const requestExec = require("./chunks/request-exec-s7k-oRi2.js");
6
+ const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
6
7
  const environments = require("./chunks/environments-iM3SUM-4.js");
7
8
  const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
8
- const perfRun = require("./chunks/perf-run-Dcb-A4Ln.js");
9
+ const perfRun = require("./chunks/perf-run-wfdvpJev.js");
9
10
  const perfReport = require("./chunks/perf-report-ChaO3K0w.js");
10
11
  const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
11
12
  require("undici");
@@ -25,10 +26,9 @@ require("ws");
25
26
  require("socket.io-client");
26
27
  require("node:http");
27
28
  require("ajv");
29
+ require("uuid");
28
30
  require("@grpc/grpc-js");
29
31
  require("@grpc/proto-loader");
30
- require("./chunks/request-collection-gkOYlWml.js");
31
- require("uuid");
32
32
  require("./chunks/data-files-BYqhsoPe.js");
33
33
  function parseDurationSec(s) {
34
34
  if (s == null) return void 0;
@@ -117,7 +117,7 @@ async function main() {
117
117
  console.error(cliCommon.color(`Error: could not read workspace: ${wsPath}`, cliCommon.C.red));
118
118
  process.exit(1);
119
119
  }
120
- await requestExec.loadGlobals(wsDir);
120
+ await requestCollection.loadGlobals(wsDir);
121
121
  requestExec.setSecretsConfig(workspace.settings?.secrets);
122
122
  const plans = workspace.perfPlans ?? [];
123
123
  if (sub === "list") {
@@ -149,7 +149,7 @@ async function main() {
149
149
  const env = environments.selectEnvironment(workspace, environments$1, args.environment ?? args.env);
150
150
  const flowsAll = (await cliCommon.loadFlows(workspace, wsDir, () => {
151
151
  })).map(flowEngine.normalizeFlow);
152
- const globals = requestExec.getGlobals();
152
+ const globals = requestCollection.getGlobals();
153
153
  const payload = { plan, environment: env ?? null, globals, proxy: workspace.settings?.proxy, tls: workspace.settings?.tls };
154
154
  let targetLabel = "";
155
155
  if (plan.target.kind === "request") {
@@ -191,7 +191,7 @@ async function main() {
191
191
  targetLabel = `flow: ${flow.name}`;
192
192
  }
193
193
  const load = perfRun.deriveLoad(plan);
194
- const version = `v${"0.8.7"}`;
194
+ const version = `v${"0.8.8"}`;
195
195
  console.log("");
196
196
  console.log(cliCommon.color(" API Performance" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
197
197
  console.log(cliCommon.color(` Plan: ${plan.name}`, cliCommon.C.gray));