@forumone/throughline-integrations 0.2.3 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @forumone/throughline-integrations
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9f39ace: Enforce API-key scopes, which until now were only a label
8
+
9
+ The API-keys collection has always had a required `scopes` field, the README has always told you to mint keys with `--scopes publishing.execute`, and the scheduled-publish factory documents that its key "must carry `publishing.execute` scope". Nothing read the field. Every key could do whatever its linked user could, whatever it said on the label.
10
+
11
+ A tool may now declare `requiredScope`, and the handler holds callers to it: the tool is hidden from `tools/list` and refused on a direct call unless the key names that scope. Hidden as well as refused, because an agent shown a tool it will be turned away from will try it, fail, and report the tool as broken when what is narrow is the key.
12
+
13
+ The consequential tools are annotated — `publish`, `unpublish`, `schedule_publish`, `rollback` (`publishing.execute`); `request_approval` (`approvals.request`); `respond_to_approval` (`approvals.decide`); the three form writers (`forms.manage`); `trigger_sync` and `test_integration` (`integrations.trigger`). Reads are left unscoped, which is the right default for a read.
14
+
15
+ **This narrows existing keys.** A key minted with one scope could previously call every tool on every server and now cannot. That is the point, but it will change what an existing MCP client can do — check the scopes on your keys before upgrading. A key carrying no scopes at all passes nothing scoped: absent is read as none, not as everything.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [40839b5]
20
+ - Updated dependencies [9f39ace]
21
+ - Updated dependencies [f138b3d]
22
+ - Updated dependencies [6fac789]
23
+ - @forumone/throughline-core@0.4.0
24
+ - @forumone/throughline-plugin-contract@0.3.0
25
+
3
26
  ## 0.2.3
4
27
 
5
28
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"test-integration.d.ts","sourceRoot":"","sources":["../../src/tools/test-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAGzD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,mBAAmB,CAAA;CAC9B;AAED,QAAA,MAAM,WAAW;;;;;;EAEf,CAAA;AAEF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,mBAAmB,GACxB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAgDvC"}
1
+ {"version":3,"file":"test-integration.d.ts","sourceRoot":"","sources":["../../src/tools/test-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAGzD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,mBAAmB,CAAA;CAC9B;AAED,QAAA,MAAM,WAAW;;;;;;EAEf,CAAA;AAEF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,mBAAmB,GACxB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAiDvC"}
@@ -6,6 +6,7 @@ const inputSchema = z.object({
6
6
  export function createTestIntegrationTool(deps) {
7
7
  return {
8
8
  name: 'test_integration',
9
+ requiredScope: 'integrations.trigger',
9
10
  description: "Calls the integration's healthcheck. Use to answer 'is the integration reachable / configured correctly?'. Doesn't fire any system events; the test is local to the integration's healthcheck.",
10
11
  inputSchema,
11
12
  handler: async (input, ctx) => {
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AE,MAAM,CAAC,OAAO,IAAI,IAAI;aAChC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"trigger-sync.d.ts","sourceRoot":"","sources":["../../src/tools/trigger-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAG9E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,WAAW;;;;;;;;;EAQf,CAAA;AAEF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,GACpB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAmDvC"}
1
+ {"version":3,"file":"trigger-sync.d.ts","sourceRoot":"","sources":["../../src/tools/trigger-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAG9E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,WAAW;;;;;;;;;EAQf,CAAA;AAEF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,GACpB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAoDvC"}
@@ -12,6 +12,7 @@ const inputSchema = z.object({
12
12
  export function createTriggerSyncTool(deps) {
13
13
  return {
14
14
  name: 'trigger_sync',
15
+ requiredScope: 'integrations.trigger',
15
16
  description: 'Manually triggers an integration to send a test payload. Useful for verifying connectivity after a config change or after the integration has been failing. Admin-only because triggering an external POST is a write-side action.',
16
17
  inputSchema,
17
18
  handler: async (input, ctx) => {
@@ -1 +1 @@
1
- {"version":3,"file":"trigger-sync.js","sourceRoot":"","sources":["../../src/tools/trigger-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAQjE,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,CAAC,4DAA4D,CAAC;IACzE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,2DAA2D,CAAC;CACzE,CAAC,CAAA;AAEF,MAAM,UAAU,qBAAqB,CACnC,IAAqB;IAErB,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,oOAAoO;QACtO,WAAW;QACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YAC5B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,cAAc,CAAC,gDAAgD,CAAC,CAAA;YACzE,CAAC;YAED,IAAI,GAAG,GAAmC,IAAI,CAAA;YAC9C,IAAI,CAAC;gBACH,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;oBACjC,UAAU,EAAE,IAAI,CAAC,cAAc;oBAC/B,EAAE,EAAE,KAAK,CAAC,aAAa;iBACxB,CAAC,CAAmC,CAAA;YACvC,CAAC;YAAC,MAAM,CAAC;gBACP,GAAG,GAAG,IAAI,CAAA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AAE,eAAe;oBAC9B,UAAU,EAAE,KAAK,CAAC,aAAa;oBAC/B,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI;oBACjC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;iBAC7B;aACF,CAAC,CAAA;YAEF,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,SAAS,EAAE;oBACT,UAAU,EAAE,KAAK,CAAC,aAAa;oBAC/B,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACjC,IAAI,EAAE,eAAe;iBACtB;gBACD,OAAO,EAAE,8BAA8B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,uFAAuF;aAClJ,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forumone/throughline-integrations",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Plugin architecture for connecting Throughline-powered Payload sites to external systems. Ships the Integration contract, registry, collection, MCP tools, and a generic outbound-webhook integration as the first concrete example.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "zod": "^3.23.0",
45
- "@forumone/throughline-core": "0.3.0",
46
- "@forumone/throughline-plugin-contract": "0.2.1"
45
+ "@forumone/throughline-core": "0.4.0",
46
+ "@forumone/throughline-plugin-contract": "0.3.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^20.17.0",