@tangle-network/agent-integrations 0.39.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/README.md CHANGED
@@ -176,7 +176,7 @@ OAuth credentials.
176
176
  | `validateProviderPassthroughRequest` | Policy-gated provider-native HTTP escape hatch validation. |
177
177
  | `buildIntegrationToolCatalog` | Converts connector actions into agent/tool definitions. |
178
178
  | `discoverWorkspaceCapabilities` | Per-workspace capability discovery: scope-gated, MCP-shape tool descriptors for agent runtime binding. |
179
- | `WebhookRouter` (+ `stripeWebhookProvider`, `docusealWebhookProvider`, `slackWebhookProvider`, `gmailWebhookProvider`, `gdriveWebhookProvider`, `genericHmacWebhookProvider`) | Inbound webhook router: verify signature, parse, idempotency dedup, async deliver. |
179
+ | `WebhookRouter` (+ `stripeWebhookProvider`, `docusealWebhookProvider`, `slackWebhookProvider`, `gmailWebhookProvider`, `gdriveWebhookProvider`, `telegramWebhookProvider`, `hellosignWebhookProvider`, `genericHmacWebhookProvider`) | Inbound webhook router: verify signature, parse, idempotency dedup, async deliver. |
180
180
  | `searchIntegrationTools` | Intent search over normalized integration tools. |
181
181
  | `buildDefaultIntegrationRegistry` | Composes setup specs and vendored catalog metadata into one deduplicated connector registry. |
182
182
  | `composeIntegrationRegistry` | Merges arbitrary catalog sources with explicit aliases, precedence, support tiers, and conflict diagnostics. |
package/dist/catalog.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  parseIntegrationToolName,
8
8
  searchIntegrationTools,
9
9
  toMcpTools
10
- } from "./chunk-P3RWMLK3.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-6MUBOVI4.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-6MUBOVI4.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-P3RWMLK3.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
  }
@@ -37520,23 +37548,27 @@ function parseInboundBody(rawBody) {
37520
37548
  if (json && typeof json === "object") return json;
37521
37549
  } catch {
37522
37550
  }
37523
- const match = /(?:^|&)json=([^&]+)/.exec(rawBody);
37524
- if (match) {
37551
+ const formJson = new URLSearchParams(rawBody).get("json");
37552
+ if (formJson) {
37525
37553
  try {
37526
- return JSON.parse(decodeURIComponent(match[1]));
37554
+ return JSON.parse(formJson);
37527
37555
  } catch {
37528
37556
  return null;
37529
37557
  }
37530
37558
  }
37531
- const partMatch = /name="json"[^]*?\r?\n\r?\n([\s\S]*?)\r?\n--/m.exec(rawBody);
37532
- if (partMatch) {
37533
- try {
37534
- return JSON.parse(partMatch[1]);
37535
- } catch {
37536
- return null;
37537
- }
37559
+ const nameIdx = rawBody.indexOf('name="json"');
37560
+ if (nameIdx === -1) return null;
37561
+ const afterName = rawBody.slice(nameIdx);
37562
+ const sep = /\r?\n\r?\n/.exec(afterName);
37563
+ if (!sep) return null;
37564
+ const partBody = afterName.slice(sep.index + sep[0].length);
37565
+ const end = /\r?\n--/.exec(partBody);
37566
+ if (!end) return null;
37567
+ try {
37568
+ return JSON.parse(partBody.slice(0, end.index));
37569
+ } catch {
37570
+ return null;
37538
37571
  }
37539
- return null;
37540
37572
  }
37541
37573
  async function ensureFreshAccessToken7(creds, clientId, clientSecret, inv) {
37542
37574
  if (creds.kind !== "oauth2") {
@@ -47993,7 +48025,11 @@ var apolloConnector = declarativeRestConnector({
47993
48025
  "content-type": "application/json",
47994
48026
  "cache-control": "no-cache"
47995
48027
  },
47996
- 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
+ },
47997
48033
  capabilities: [
47998
48034
  {
47999
48035
  name: "match.person",
@@ -119188,4 +119224,4 @@ export {
119188
119224
  pipedreamConnector,
119189
119225
  adapters_exports
119190
119226
  };
119191
- //# sourceMappingURL=chunk-6MUBOVI4.js.map
119227
+ //# sourceMappingURL=chunk-JXXPAUCX.js.map