@tangle-network/agent-integrations 0.53.35 → 0.53.36

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 (48) hide show
  1. package/dist/catalog.d.ts +2 -2
  2. package/dist/catalog.js +8 -8
  3. package/dist/{chunk-2IU335WP.js → chunk-2E7CMFKX.js} +3 -2
  4. package/dist/{chunk-2IU335WP.js.map → chunk-2E7CMFKX.js.map} +1 -1
  5. package/dist/{chunk-XGL345YX.js → chunk-2F2JVX3Z.js} +2 -2
  6. package/dist/{chunk-JXFPIZ3O.js → chunk-DUWZMKEF.js} +18 -4
  7. package/dist/chunk-DUWZMKEF.js.map +1 -0
  8. package/dist/{chunk-FK4ENHCP.js → chunk-FY7B3I5G.js} +2 -2
  9. package/dist/{chunk-N4KK3J7U.js → chunk-GLOAH446.js} +1273 -1254
  10. package/dist/{chunk-N4KK3J7U.js.map → chunk-GLOAH446.js.map} +1 -1
  11. package/dist/{chunk-ANWNXGVV.js → chunk-NCOHYY6P.js} +2 -2
  12. package/dist/{chunk-BVHX2E5X.js → chunk-X5H5ARIO.js} +47 -11
  13. package/dist/chunk-X5H5ARIO.js.map +1 -0
  14. package/dist/{chunk-GGKD2W6H.js → chunk-ZZUBL7KY.js} +4 -2
  15. package/dist/chunk-ZZUBL7KY.js.map +1 -0
  16. package/dist/connect/index.d.ts +2 -2
  17. package/dist/connect/index.js +2 -2
  18. package/dist/connectors/adapters/index.d.ts +2 -2
  19. package/dist/connectors/adapters/index.js +2 -2
  20. package/dist/connectors/index.d.ts +4 -3
  21. package/dist/connectors/index.js +3 -3
  22. package/dist/{consumer-DV3XEumb.d.ts → consumer-Ctva6_kb.d.ts} +1 -1
  23. package/dist/consumer.d.ts +3 -3
  24. package/dist/consumer.js +2 -2
  25. package/dist/{core-types-qkW_zZDB.d.ts → core-types-BcaDdvFi.d.ts} +1 -1
  26. package/dist/coverage-catalog.d.ts +2 -2
  27. package/dist/{importers-B7sdp2Ke.d.ts → importers-C1N3P60U.d.ts} +1 -1
  28. package/dist/index.d.ts +8 -8
  29. package/dist/index.js +8 -8
  30. package/dist/mcp.d.ts +3 -3
  31. package/dist/mcp.js +8 -8
  32. package/dist/middleware/index.d.ts +2 -2
  33. package/dist/middleware/index.js +2 -2
  34. package/dist/registry.d.ts +2 -2
  35. package/dist/registry.js +8 -8
  36. package/dist/runtime.d.ts +2 -2
  37. package/dist/runtime.js +8 -8
  38. package/dist/specs.d.ts +6 -2
  39. package/dist/specs.js +4 -4
  40. package/dist/{tangle-id-uvHTbgCw.d.ts → tangle-id-r1uPd9QH.d.ts} +1 -1
  41. package/dist/{types-C1rgdXiP.d.ts → types-ooBfkUOy.d.ts} +10 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-BVHX2E5X.js.map +0 -1
  44. package/dist/chunk-GGKD2W6H.js.map +0 -1
  45. package/dist/chunk-JXFPIZ3O.js.map +0 -1
  46. /package/dist/{chunk-XGL345YX.js.map → chunk-2F2JVX3Z.js.map} +0 -0
  47. /package/dist/{chunk-FK4ENHCP.js.map → chunk-FY7B3I5G.js.map} +0 -0
  48. /package/dist/{chunk-ANWNXGVV.js.map → chunk-NCOHYY6P.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TangleIdentityUnreachableError,
3
3
  createTangleIdentityClient
4
- } from "./chunk-JXFPIZ3O.js";
4
+ } from "./chunk-DUWZMKEF.js";
5
5
 
6
6
  // src/middleware/index.ts
7
7
  async function requireTangleAuth(request, opts = {}) {
@@ -126,4 +126,4 @@ export {
126
126
  honoTangleAuthMiddleware,
127
127
  expressTangleAuthMiddleware
128
128
  };
129
- //# sourceMappingURL=chunk-ANWNXGVV.js.map
129
+ //# sourceMappingURL=chunk-NCOHYY6P.js.map
@@ -7,11 +7,11 @@ import {
7
7
  canonicalIntegrationKind,
8
8
  integrationSpecToConnector,
9
9
  listIntegrationSpecs
10
- } from "./chunk-GGKD2W6H.js";
10
+ } from "./chunk-ZZUBL7KY.js";
11
11
  import {
12
12
  CONNECTOR_ADAPTER_FACTORIES,
13
13
  adapters_exports
14
- } from "./chunk-N4KK3J7U.js";
14
+ } from "./chunk-GLOAH446.js";
15
15
 
16
16
  // src/activepieces-catalog.ts
17
17
  import { readFileSync } from "fs";
@@ -246,6 +246,7 @@ function createConnectorAdapterProvider(options) {
246
246
  "auth_not_supported"
247
247
  );
248
248
  }
249
+ resolveTokenClientAuthMethod(auth.tokenClientAuthMethod, request.connectorId);
249
250
  if (!options.resolveOAuthClient) {
250
251
  throw new IntegrationError(
251
252
  `OAuth client resolver missing on adapter provider; cannot start auth for ${request.connectorId}.`,
@@ -307,6 +308,10 @@ function createConnectorAdapterProvider(options) {
307
308
  "auth_not_supported"
308
309
  );
309
310
  }
311
+ const tokenClientAuthMethod = resolveTokenClientAuthMethod(
312
+ auth.tokenClientAuthMethod,
313
+ request.connectorId
314
+ );
310
315
  if (!request.code) {
311
316
  throw new IntegrationError(
312
317
  `Authorization code missing on completeAuth for ${request.connectorId}.`,
@@ -335,10 +340,21 @@ function createConnectorAdapterProvider(options) {
335
340
  const body = new URLSearchParams({
336
341
  grant_type: "authorization_code",
337
342
  code: request.code,
338
- client_id: client.clientId,
339
- client_secret: client.clientSecret,
340
343
  redirect_uri: request.redirectUri
341
344
  });
345
+ const headers = {
346
+ "content-type": "application/x-www-form-urlencoded",
347
+ accept: "application/json"
348
+ };
349
+ const redactionValues = [request.code, client.clientId, client.clientSecret];
350
+ if (tokenClientAuthMethod === "client_secret_post") {
351
+ body.set("client_id", client.clientId);
352
+ body.set("client_secret", client.clientSecret);
353
+ } else {
354
+ const authorization = `Basic ${base64Encode(`${client.clientId}:${client.clientSecret}`)}`;
355
+ headers.authorization = authorization;
356
+ redactionValues.push(authorization);
357
+ }
342
358
  const tokenUrl = resolveOAuthUrlTemplate(
343
359
  auth.tokenUrl,
344
360
  request.metadata,
@@ -348,16 +364,13 @@ function createConnectorAdapterProvider(options) {
348
364
  try {
349
365
  res = await fetchImpl(tokenUrl, {
350
366
  method: "POST",
351
- headers: {
352
- "content-type": "application/x-www-form-urlencoded",
353
- accept: "application/json"
354
- },
367
+ headers,
355
368
  body
356
369
  });
357
370
  } catch (cause) {
358
371
  const detail = redactSensitiveText(
359
372
  cause?.message ?? "unknown",
360
- [request.code, client.clientId, client.clientSecret]
373
+ redactionValues
361
374
  );
362
375
  throw new IntegrationError(
363
376
  `OAuth token exchange transport error for ${request.connectorId}: ${detail}`,
@@ -368,7 +381,7 @@ function createConnectorAdapterProvider(options) {
368
381
  const text = await res.text().catch(() => "");
369
382
  const detail = redactSensitiveText(
370
383
  `${res.status} ${res.statusText} \u2014 ${text.slice(0, 200)}`,
371
- [request.code, client.clientId, client.clientSecret]
384
+ redactionValues
372
385
  );
373
386
  throw new IntegrationError(
374
387
  `OAuth token exchange failed for ${request.connectorId}: ${detail}`,
@@ -557,6 +570,29 @@ function oauthManifestAuth(auth) {
557
570
  if (auth.kind !== "one_of") return void 0;
558
571
  return auth.options.find((option) => option.kind === "oauth2");
559
572
  }
573
+ function resolveTokenClientAuthMethod(value, connectorId) {
574
+ if (value === void 0 || value === "client_secret_post") {
575
+ return "client_secret_post";
576
+ }
577
+ if (value === "client_secret_basic") return value;
578
+ throw new IntegrationError(
579
+ `Connector ${connectorId} has an unsupported OAuth token client authentication method.`,
580
+ "config_missing"
581
+ );
582
+ }
583
+ function base64Encode(value) {
584
+ const btoa2 = globalThis.btoa;
585
+ if (typeof btoa2 !== "function") {
586
+ throw new IntegrationError(
587
+ "OAuth client_secret_basic requires a base64 encoder in this runtime.",
588
+ "config_missing"
589
+ );
590
+ }
591
+ const bytes = new TextEncoder().encode(value);
592
+ let binary = "";
593
+ for (const byte of bytes) binary += String.fromCharCode(byte);
594
+ return btoa2(binary);
595
+ }
560
596
  function redactSensitiveText(text, secrets) {
561
597
  return secrets.filter((secret) => secret.length > 0).reduce(
562
598
  (redacted, secret) => redacted.split(secret).join("[REDACTED]"),
@@ -4395,4 +4431,4 @@ export {
4395
4431
  signCapability,
4396
4432
  verifyCapabilityToken
4397
4433
  };
4398
- //# sourceMappingURL=chunk-BVHX2E5X.js.map
4434
+ //# sourceMappingURL=chunk-X5H5ARIO.js.map