@tangle-network/agent-integrations 0.40.0 → 0.40.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.
package/dist/catalog.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  parseIntegrationToolName,
8
8
  searchIntegrationTools,
9
9
  toMcpTools
10
- } from "./chunk-4GZU3PB5.js";
10
+ } from "./chunk-5QU3YCGR.js";
11
11
  import "./chunk-TC5OMANJ.js";
12
12
  import "./chunk-IKCXDQVP.js";
13
13
  import "./chunk-H4XYLS7T.js";
@@ -15,7 +15,7 @@ import "./chunk-FAFQZJPZ.js";
15
15
  import "./chunk-IA5GCKM6.js";
16
16
  import "./chunk-7P2LN4VT.js";
17
17
  import "./chunk-376UBTNB.js";
18
- import "./chunk-4TI3WXAD.js";
18
+ import "./chunk-JXXPAUCX.js";
19
19
  import "./chunk-2TW2QKGZ.js";
20
20
  import "./chunk-OMLQCESJ.js";
21
21
  import "./chunk-PZ5AY32C.js";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-IA5GCKM6.js";
9
9
  import {
10
10
  adapters_exports
11
- } from "./chunk-4TI3WXAD.js";
11
+ } from "./chunk-JXXPAUCX.js";
12
12
 
13
13
  // src/activepieces-catalog.ts
14
14
  import { readFileSync } from "fs";
@@ -4304,4 +4304,4 @@ export {
4304
4304
  signCapability,
4305
4305
  verifyCapabilityToken
4306
4306
  };
4307
- //# sourceMappingURL=chunk-4GZU3PB5.js.map
4307
+ //# sourceMappingURL=chunk-5QU3YCGR.js.map
@@ -2295,12 +2295,13 @@ function declarativeRestConnector(spec) {
2295
2295
  async test(source) {
2296
2296
  if (!spec.test) return { ok: true };
2297
2297
  try {
2298
- await executeRestRequest(spec, spec.test, {
2298
+ const response = await executeRestRequest(spec, spec.test, {
2299
2299
  source,
2300
2300
  capabilityName: "__test__",
2301
2301
  args: {},
2302
2302
  idempotencyKey: "test"
2303
2303
  });
2304
+ validateTestResponse(spec, spec.test, response.data);
2304
2305
  return { ok: true };
2305
2306
  } catch (error) {
2306
2307
  return { ok: false, reason: error instanceof Error ? error.message : "unknown error" };
@@ -2309,6 +2310,25 @@ function declarativeRestConnector(spec) {
2309
2310
  };
2310
2311
  return adapter;
2311
2312
  }
2313
+ function validateTestResponse(spec, test, data) {
2314
+ const expectations = Array.isArray(test.expectResponse) ? test.expectResponse : test.expectResponse ? [test.expectResponse] : [];
2315
+ for (const expectation of expectations) {
2316
+ const actual = readPathFromUnknown(data, expectation.path);
2317
+ if (!isJsonEqual(actual, expectation.equals)) {
2318
+ throw new Error(
2319
+ `${spec.displayName} test response expected ${expectation.path}=${formatValue(expectation.equals)}, got ${formatValue(actual)}`
2320
+ );
2321
+ }
2322
+ }
2323
+ }
2324
+ function isJsonEqual(left, right) {
2325
+ if (Object.is(left, right)) return true;
2326
+ return JSON.stringify(left) === JSON.stringify(right);
2327
+ }
2328
+ function formatValue(value) {
2329
+ if (value === void 0) return "undefined";
2330
+ return JSON.stringify(value);
2331
+ }
2312
2332
  function operationToCapability(op) {
2313
2333
  const base = {
2314
2334
  name: op.name,
@@ -2461,6 +2481,14 @@ function readPath(input, path) {
2461
2481
  return void 0;
2462
2482
  }, input);
2463
2483
  }
2484
+ function readPathFromUnknown(input, path) {
2485
+ return path.split(".").reduce((value, part) => {
2486
+ if (value && typeof value === "object" && part in value) {
2487
+ return value[part];
2488
+ }
2489
+ return void 0;
2490
+ }, input);
2491
+ }
2464
2492
  async function safeErrorText(res) {
2465
2493
  return await res.text().catch(() => res.statusText) || res.statusText;
2466
2494
  }
@@ -47997,7 +48025,11 @@ var apolloConnector = declarativeRestConnector({
47997
48025
  "content-type": "application/json",
47998
48026
  "cache-control": "no-cache"
47999
48027
  },
48000
- test: { method: "GET", path: "/api/v1/auth/health" },
48028
+ test: {
48029
+ method: "GET",
48030
+ path: "/api/v1/auth/health",
48031
+ expectResponse: { path: "is_logged_in", equals: true }
48032
+ },
48001
48033
  capabilities: [
48002
48034
  {
48003
48035
  name: "match.person",
@@ -119192,4 +119224,4 @@ export {
119192
119224
  pipedreamConnector,
119193
119225
  adapters_exports
119194
119226
  };
119195
- //# sourceMappingURL=chunk-4TI3WXAD.js.map
119227
+ //# sourceMappingURL=chunk-JXXPAUCX.js.map