@testsmith/api-spector-agent 0.7.9 → 0.8.1

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.
Files changed (2) hide show
  1. package/dist/index.cjs +16 -13
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -74309,6 +74309,20 @@ function buildUrl(baseUrl, params, vars) {
74309
74309
  const qs = queryRows.map((p6) => `${encodeURIComponent(interpolate(p6.key, vars))}=${encodeURIComponent(interpolate(p6.value, vars))}`).join("&");
74310
74310
  return url2 + sep + qs;
74311
74311
  }
74312
+ async function resolveInlineSecretRefs(text) {
74313
+ const refs = /* @__PURE__ */ new Set();
74314
+ for (const m6 of text.matchAll(/\{\{\s*([^}]+?)\s*\}\}/g)) {
74315
+ const inner = m6[1].trim();
74316
+ if (hasSecretScheme(inner)) refs.add(inner);
74317
+ }
74318
+ if (refs.size === 0) return {};
74319
+ const out = {};
74320
+ await Promise.all([...refs].map(async (ref) => {
74321
+ const value2 = await resolveExternalSecret(ref);
74322
+ if (value2 !== null) out[ref] = value2;
74323
+ }));
74324
+ return out;
74325
+ }
74312
74326
  function mergeVars(envVars, collectionVars, globals2, localVars = {}, dynamicVars = {}, folderVars = {}) {
74313
74327
  const out = {};
74314
74328
  for (const src of [dynamicVars, globals2, collectionVars, folderVars, envVars, localVars]) {
@@ -80926,18 +80940,7 @@ async function resolveInlineSecrets(req) {
80926
80940
  req.preRequestScript ?? "",
80927
80941
  req.postRequestScript ?? ""
80928
80942
  ].join("\n");
80929
- const refs = /* @__PURE__ */ new Set();
80930
- for (const m6 of haystack.matchAll(/\{\{\s*([^}]+?)\s*\}\}/g)) {
80931
- const inner = m6[1].trim();
80932
- if (hasSecretScheme(inner)) refs.add(inner);
80933
- }
80934
- if (refs.size === 0) return {};
80935
- const out = {};
80936
- await Promise.all([...refs].map(async (ref) => {
80937
- const value2 = await resolveExternalSecret(ref);
80938
- if (value2 !== null) out[ref] = value2;
80939
- }));
80940
- return out;
80943
+ return resolveInlineSecretRefs(haystack);
80941
80944
  }
80942
80945
  async function executeRunnerRequest(opts) {
80943
80946
  const { req, collectionVars, envVars, globals: globals2, dispatcher, piiMaskPatterns, proxy, tls, onScriptOutput } = opts;
@@ -81361,7 +81364,7 @@ var APP_URL = (process.env.APP_URL || "").replace(/\/+$/, "");
81361
81364
  var AGENT_TOKEN = process.env.AGENT_TOKEN || "";
81362
81365
  var RUNTIME_TOKEN = process.env.RUNTIME_TOKEN || "";
81363
81366
  var POLL_MS = Number(process.env.POLL_INTERVAL_MS || 5e3);
81364
- var VERSION = true ? "0.7.9" : "";
81367
+ var VERSION = true ? "0.8.1" : "";
81365
81368
  var authHeaders = AGENT_TOKEN ? { Authorization: `Bearer ${AGENT_TOKEN}` } : RUNTIME_TOKEN ? { "X-Runtime-Token": RUNTIME_TOKEN } : {};
81366
81369
  async function postResult(m6, fields) {
81367
81370
  await fetch(`${APP_URL}/api/monitor-runtime/${m6.id}/result`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testsmith/api-spector-agent",
3
- "version": "0.7.9",
3
+ "version": "0.8.1",
4
4
  "description": "API Spector private runner: monitor internal/local APIs the cloud cannot reach, with no inbound connections.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://api-spector.dev",