@tangle-network/agent-integrations 0.26.0 → 0.27.0

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 (38) hide show
  1. package/dist/bin/tangle-catalog-runtime.js +5 -2
  2. package/dist/bin/tangle-catalog-runtime.js.map +1 -1
  3. package/dist/catalog.d.ts +4 -1
  4. package/dist/catalog.js +5 -2
  5. package/dist/chunk-ATYHZXLL.js +457 -0
  6. package/dist/chunk-ATYHZXLL.js.map +1 -0
  7. package/dist/{chunk-ALCIWTIR.js → chunk-ICSBYCE2.js} +27 -1
  8. package/dist/chunk-ICSBYCE2.js.map +1 -0
  9. package/dist/{chunk-GA4VTE3U.js → chunk-JU25UDN2.js} +5 -58
  10. package/dist/chunk-JU25UDN2.js.map +1 -0
  11. package/dist/chunk-P24T3MLM.js +106 -0
  12. package/dist/chunk-P24T3MLM.js.map +1 -0
  13. package/dist/chunk-SVQ4PHDZ.js +129 -0
  14. package/dist/chunk-SVQ4PHDZ.js.map +1 -0
  15. package/dist/connect/index.d.ts +112 -0
  16. package/dist/connect/index.js +14 -0
  17. package/dist/connect/index.js.map +1 -0
  18. package/dist/connectors/adapters/index.d.ts +593 -1
  19. package/dist/connectors/adapters/index.js +15 -1
  20. package/dist/connectors/index.d.ts +2 -1
  21. package/dist/connectors/index.js +19 -5
  22. package/dist/index.d.ts +5 -2
  23. package/dist/index.js +42 -6
  24. package/dist/middleware/index.d.ts +137 -0
  25. package/dist/middleware/index.js +14 -0
  26. package/dist/middleware/index.js.map +1 -0
  27. package/dist/registry.d.ts +28 -2
  28. package/dist/registry.js +5 -2
  29. package/dist/runtime.d.ts +4 -1
  30. package/dist/runtime.js +5 -2
  31. package/dist/specs.d.ts +4 -1
  32. package/dist/tangle-catalog-runtime.d.ts +4 -1
  33. package/dist/tangle-catalog-runtime.js +5 -2
  34. package/dist/tangle-id-CTU4kGId.d.ts +553 -0
  35. package/package.json +11 -1
  36. package/dist/chunk-ALCIWTIR.js.map +0 -1
  37. package/dist/chunk-GA4VTE3U.js.map +0 -1
  38. package/dist/index-D4D4CEKX.d.ts +0 -976
@@ -1292,6 +1292,31 @@ function toTrigger2(connector, trigger2, connection) {
1292
1292
  connectionId: connection?.id
1293
1293
  };
1294
1294
  }
1295
+ function filterDiscoveryByWorkspaceScopes(discovery, workspaceScopes, opts = {}) {
1296
+ if (workspaceScopes.length === 0 && !opts.denyByDefault) return discovery;
1297
+ const granted = new Set(workspaceScopes);
1298
+ const hasWildcard = granted.has("tangle:*");
1299
+ function allowed(connectorId, scopes) {
1300
+ if (hasWildcard) return true;
1301
+ if (granted.has(`${connectorId}:*`)) return true;
1302
+ for (const scope of scopes) {
1303
+ if (!granted.has(scope)) return false;
1304
+ }
1305
+ return true;
1306
+ }
1307
+ const capabilities = discovery.capabilities.filter((cap) => allowed(cap.connectorId, cap.scopes));
1308
+ const triggers = discovery.triggers.filter((t) => allowed(t.connectorId, t.scopes));
1309
+ const countsByConnector = {};
1310
+ for (const cap of capabilities) {
1311
+ countsByConnector[cap.connectorId] = (countsByConnector[cap.connectorId] ?? 0) + 1;
1312
+ }
1313
+ return {
1314
+ capabilities,
1315
+ triggers,
1316
+ countsByConnector,
1317
+ unreachableConnectors: discovery.unreachableConnectors
1318
+ };
1319
+ }
1295
1320
 
1296
1321
  // src/events.ts
1297
1322
  var InMemoryIntegrationEventStore = class {
@@ -4468,6 +4493,7 @@ export {
4468
4493
  createCredentialBackedAdapterProvider,
4469
4494
  revokeConnection,
4470
4495
  discoverWorkspaceCapabilities,
4496
+ filterDiscoveryByWorkspaceScopes,
4471
4497
  InMemoryIntegrationEventStore,
4472
4498
  receiveIntegrationWebhook,
4473
4499
  storedEventToTriggerEvent,
@@ -4526,4 +4552,4 @@ export {
4526
4552
  signCapability,
4527
4553
  verifyCapabilityToken
4528
4554
  };
4529
- //# sourceMappingURL=chunk-ALCIWTIR.js.map
4555
+ //# sourceMappingURL=chunk-ICSBYCE2.js.map