@testsmith/api-spector-agent 0.9.13 → 0.9.15

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 +11 -23
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -73422,8 +73422,7 @@ var StreamFramer = class {
73422
73422
  this.carry += text.replaceAll(/\r\n?/g, "\n");
73423
73423
  return this.mode === "sse" ? this.drainSse() : this.drainNdjson();
73424
73424
  }
73425
- /** Emit whatever remains once the stream closes (a last line/block with no
73426
- * trailing delimiter). */
73425
+ /** Emit a last line/block that had no trailing delimiter when the stream closed. */
73427
73426
  flush() {
73428
73427
  const rest = this.carry;
73429
73428
  this.carry = "";
@@ -73746,7 +73745,7 @@ async function vaultFetch(conn, path, init = {}) {
73746
73745
  const res = await fetch(`${conn.address}/v1/${path}`, {
73747
73746
  ...init,
73748
73747
  headers,
73749
- // undici honours `dispatcher`; the field is not in the DOM RequestInit type.
73748
+ // undici honours `dispatcher`; not in the DOM RequestInit type.
73750
73749
  ...dispatcher ? { dispatcher } : {}
73751
73750
  });
73752
73751
  if (!res.ok) {
@@ -76375,9 +76374,8 @@ function buildAt(ctx, testResults, consoleOutput) {
76375
76374
  const sp = {
76376
76375
  // Variable scopes
76377
76376
  variables: makeVarScope(localVars, "variables"),
76378
- // Request-scoped set/get. Request variables live in the local tier at run
76379
- // time, so this shares the local store: values apply for the current run (and
76380
- // the in-memory session) but are never written back to the saved collection.
76377
+ // Request-scoped set/get. Request vars share the local store at run time: they
76378
+ // apply for the current run but are never written back to the saved collection.
76381
76379
  request: makeVarScope(localVars, "request"),
76382
76380
  environment: makeVarScope(envVars, "environment"),
76383
76381
  collectionVariables: makeVarScope(collectionVars, "collectionVariables"),
@@ -76406,18 +76404,8 @@ function buildAt(ctx, testResults, consoleOutput) {
76406
76404
  expect: (value2) => makeAsserter(value2, false),
76407
76405
  // JSONPath query: sp.jsonPath(data, '$.store.book[?(@.price < 10)].title')
76408
76406
  jsonPath: (data, expr) => JSONPath({ path: expr, json: data }),
76409
- /**
76410
- * Generate a TOTP code from a base32-encoded secret.
76411
- *
76412
- * Usage in scripts:
76413
- * const code = sp.totp("JBSWY3DPEHPK3PXP");
76414
- * sp.environment.set("otp", code);
76415
- *
76416
- * Options (all optional):
76417
- * digits — code length (default 6)
76418
- * period — time step in seconds (default 30)
76419
- * algorithm — "sha1" | "sha256" | "sha512" (default "sha1")
76420
- */
76407
+ /** TOTP code from a base32 secret. Options: digits (6), period secs (30),
76408
+ * algorithm "sha1"|"sha256"|"sha512" ("sha1"). */
76421
76409
  totp: (secret, options) => {
76422
76410
  const digits = options?.digits ?? 6;
76423
76411
  const period = options?.period ?? 30;
@@ -81474,7 +81462,7 @@ var BLOCK_SPECS = {
81474
81462
  inputs: IN,
81475
81463
  outputs: () => []
81476
81464
  },
81477
- // ── Action ──────────────────────────────────────────────────────────────
81465
+ // Action
81478
81466
  request: {
81479
81467
  type: "request",
81480
81468
  category: "action",
@@ -81491,7 +81479,7 @@ var BLOCK_SPECS = {
81491
81479
  inputs: IN,
81492
81480
  outputs: OUT
81493
81481
  },
81494
- // ── Logic ───────────────────────────────────────────────────────────────
81482
+ // Logic
81495
81483
  if: {
81496
81484
  type: "if",
81497
81485
  category: "logic",
@@ -81572,7 +81560,7 @@ var BLOCK_SPECS = {
81572
81560
  outputs: () => [{ id: "branch", label: "branch" }, { id: "done", label: "done" }],
81573
81561
  defaultConfig: { copies: 1 }
81574
81562
  },
81575
- // ── Looping ─────────────────────────────────────────────────────────────
81563
+ // Looping
81576
81564
  forEach: {
81577
81565
  type: "forEach",
81578
81566
  category: "looping",
@@ -81600,7 +81588,7 @@ var BLOCK_SPECS = {
81600
81588
  outputs: OUT,
81601
81589
  defaultConfig: { intoVar: "results" }
81602
81590
  },
81603
- // ── Visualize ───────────────────────────────────────────────────────────
81591
+ // Visualize
81604
81592
  display: {
81605
81593
  type: "display",
81606
81594
  category: "visualize",
@@ -81632,7 +81620,7 @@ var APP_URL = (process.env.APP_URL || "").replace(/\/+$/, "");
81632
81620
  var AGENT_TOKEN = process.env.AGENT_TOKEN || "";
81633
81621
  var RUNTIME_TOKEN = process.env.RUNTIME_TOKEN || "";
81634
81622
  var POLL_MS = Number(process.env.POLL_INTERVAL_MS || 5e3);
81635
- var VERSION = true ? "0.9.13" : "";
81623
+ var VERSION = true ? "0.9.15" : "";
81636
81624
  var authHeaders = AGENT_TOKEN ? { Authorization: `Bearer ${AGENT_TOKEN}` } : RUNTIME_TOKEN ? { "X-Runtime-Token": RUNTIME_TOKEN } : {};
81637
81625
  async function postResult(m6, fields) {
81638
81626
  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.9.13",
3
+ "version": "0.9.15",
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",