@testsmith/api-spector-agent 0.7.8 → 0.7.9
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/dist/index.cjs +7 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -74286,6 +74286,10 @@ function buildUrl(baseUrl, params, vars) {
|
|
|
74286
74286
|
templateTokens.add(String(name).trim());
|
|
74287
74287
|
return "";
|
|
74288
74288
|
});
|
|
74289
|
+
baseUrl.replaceAll(/\[([A-Za-z_]\w*)\]/g, (_m, name) => {
|
|
74290
|
+
templateTokens.add(String(name));
|
|
74291
|
+
return "";
|
|
74292
|
+
});
|
|
74289
74293
|
const enabled = (params ?? []).filter((p6) => p6.enabled && p6.key);
|
|
74290
74294
|
const pathRows = [];
|
|
74291
74295
|
const queryRows = [];
|
|
@@ -74298,7 +74302,8 @@ function buildUrl(baseUrl, params, vars) {
|
|
|
74298
74302
|
...vars,
|
|
74299
74303
|
...Object.fromEntries(pathRows.map((p6) => [p6.key, interpolate(p6.value, vars)]))
|
|
74300
74304
|
} : vars;
|
|
74301
|
-
|
|
74305
|
+
let url2 = interpolate(baseUrl, mergedVars);
|
|
74306
|
+
url2 = url2.replaceAll(/\[([A-Za-z_]\w*)\]/g, (m6, name) => name in mergedVars ? mergedVars[name] : m6);
|
|
74302
74307
|
if (!queryRows.length) return url2;
|
|
74303
74308
|
const sep = url2.includes("?") ? "&" : "?";
|
|
74304
74309
|
const qs = queryRows.map((p6) => `${encodeURIComponent(interpolate(p6.key, vars))}=${encodeURIComponent(interpolate(p6.value, vars))}`).join("&");
|
|
@@ -81356,7 +81361,7 @@ var APP_URL = (process.env.APP_URL || "").replace(/\/+$/, "");
|
|
|
81356
81361
|
var AGENT_TOKEN = process.env.AGENT_TOKEN || "";
|
|
81357
81362
|
var RUNTIME_TOKEN = process.env.RUNTIME_TOKEN || "";
|
|
81358
81363
|
var POLL_MS = Number(process.env.POLL_INTERVAL_MS || 5e3);
|
|
81359
|
-
var VERSION = true ? "0.7.
|
|
81364
|
+
var VERSION = true ? "0.7.9" : "";
|
|
81360
81365
|
var authHeaders = AGENT_TOKEN ? { Authorization: `Bearer ${AGENT_TOKEN}` } : RUNTIME_TOKEN ? { "X-Runtime-Token": RUNTIME_TOKEN } : {};
|
|
81361
81366
|
async function postResult(m6, fields) {
|
|
81362
81367
|
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.
|
|
3
|
+
"version": "0.7.9",
|
|
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",
|