@forumone/throughline-integrations 0.0.1 → 0.2.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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +94 -28
- package/dist/collection.d.ts +16 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +119 -0
- package/dist/collection.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/webhook/config-fields.d.ts +33 -0
- package/dist/integrations/webhook/config-fields.d.ts.map +1 -0
- package/dist/integrations/webhook/config-fields.js +54 -0
- package/dist/integrations/webhook/config-fields.js.map +1 -0
- package/dist/integrations/webhook/functions.d.ts +21 -0
- package/dist/integrations/webhook/functions.d.ts.map +1 -0
- package/dist/integrations/webhook/functions.js +124 -0
- package/dist/integrations/webhook/functions.js.map +1 -0
- package/dist/integrations/webhook/healthcheck.d.ts +10 -0
- package/dist/integrations/webhook/healthcheck.d.ts.map +1 -0
- package/dist/integrations/webhook/healthcheck.js +26 -0
- package/dist/integrations/webhook/healthcheck.js.map +1 -0
- package/dist/integrations/webhook/hmac.d.ts +11 -0
- package/dist/integrations/webhook/hmac.d.ts.map +1 -0
- package/dist/integrations/webhook/hmac.js +25 -0
- package/dist/integrations/webhook/hmac.js.map +1 -0
- package/dist/integrations/webhook/index.d.ts +6 -0
- package/dist/integrations/webhook/index.d.ts.map +1 -0
- package/dist/integrations/webhook/index.js +46 -0
- package/dist/integrations/webhook/index.js.map +1 -0
- package/dist/integrations/webhook/payload.d.ts +9 -0
- package/dist/integrations/webhook/payload.d.ts.map +1 -0
- package/dist/integrations/webhook/payload.js +19 -0
- package/dist/integrations/webhook/payload.js.map +1 -0
- package/dist/options.d.ts +22 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +8 -0
- package/dist/options.js.map +1 -0
- package/dist/plugin.d.ts +19 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +162 -0
- package/dist/plugin.js.map +1 -0
- package/dist/registry.d.ts +15 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +27 -0
- package/dist/registry.js.map +1 -0
- package/dist/tools/access.d.ts +7 -0
- package/dist/tools/access.d.ts.map +1 -0
- package/dist/tools/access.js +15 -0
- package/dist/tools/access.js.map +1 -0
- package/dist/tools/get-integration-status.d.ts +17 -0
- package/dist/tools/get-integration-status.d.ts.map +1 -0
- package/dist/tools/get-integration-status.js +41 -0
- package/dist/tools/get-integration-status.js.map +1 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-integration-types.d.ts +10 -0
- package/dist/tools/list-integration-types.d.ts.map +1 -0
- package/dist/tools/list-integration-types.js +22 -0
- package/dist/tools/list-integration-types.js.map +1 -0
- package/dist/tools/list-integrations.d.ts +20 -0
- package/dist/tools/list-integrations.d.ts.map +1 -0
- package/dist/tools/list-integrations.js +49 -0
- package/dist/tools/list-integrations.js.map +1 -0
- package/dist/tools/test-integration.d.ts +19 -0
- package/dist/tools/test-integration.d.ts.map +1 -0
- package/dist/tools/test-integration.js +50 -0
- package/dist/tools/test-integration.js.map +1 -0
- package/dist/tools/trigger-sync.d.ts +22 -0
- package/dist/tools/trigger-sync.d.ts.map +1 -0
- package/dist/tools/trigger-sync.js +60 -0
- package/dist/tools/trigger-sync.js.map +1 -0
- package/dist/types.d.ts +116 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +63 -7
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpToolDefinition } from '@forumone/throughline-plugin-contract';
|
|
3
|
+
import type { IntegrationRegistry } from '../registry.js';
|
|
4
|
+
export interface ListIntegrationTypesDeps {
|
|
5
|
+
registry: IntegrationRegistry;
|
|
6
|
+
}
|
|
7
|
+
declare const inputSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
8
|
+
export declare function createListIntegrationTypesTool(deps: ListIntegrationTypesDeps): McpToolDefinition<typeof inputSchema>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=list-integration-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-integration-types.d.ts","sourceRoot":"","sources":["../../src/tools/list-integration-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,mBAAmB,CAAA;CAC9B;AAED,QAAA,MAAM,WAAW,iDAAwB,CAAA;AAEzC,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,wBAAwB,GAC7B,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAmBvC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({}).strict();
|
|
3
|
+
export function createListIntegrationTypesTool(deps) {
|
|
4
|
+
return {
|
|
5
|
+
name: 'list_integration_types',
|
|
6
|
+
description: 'Lists the integration plugins available in this deployment. Use when answering "what kinds of integrations are supported here?" or before suggesting that someone add a new instance.',
|
|
7
|
+
inputSchema,
|
|
8
|
+
handler: async () => {
|
|
9
|
+
return {
|
|
10
|
+
types: deps.registry.list().map((integration) => ({
|
|
11
|
+
id: integration.id,
|
|
12
|
+
name: integration.name,
|
|
13
|
+
description: integration.description,
|
|
14
|
+
category: integration.category,
|
|
15
|
+
subscribesTo: integration.subscribes.map((s) => s.event),
|
|
16
|
+
hasHealthcheck: typeof integration.healthcheck === 'function',
|
|
17
|
+
})),
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=list-integration-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-integration-types.js","sourceRoot":"","sources":["../../src/tools/list-integration-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAA;AAEzC,MAAM,UAAU,8BAA8B,CAC5C,IAA8B;IAE9B,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EACT,uLAAuL;QACzL,WAAW;QACX,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;oBAChD,EAAE,EAAE,WAAW,CAAC,EAAE;oBAClB,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,WAAW,EAAE,WAAW,CAAC,WAAW;oBACpC,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;oBACxD,cAAc,EAAE,OAAO,WAAW,CAAC,WAAW,KAAK,UAAU;iBAC9D,CAAC,CAAC;aACJ,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Payload } from 'payload';
|
|
3
|
+
import type { McpToolDefinition } from '@forumone/throughline-plugin-contract';
|
|
4
|
+
export interface ListIntegrationsDeps {
|
|
5
|
+
payload: Payload;
|
|
6
|
+
collectionSlug: string;
|
|
7
|
+
}
|
|
8
|
+
declare const inputSchema: z.ZodObject<{
|
|
9
|
+
integrationType: z.ZodOptional<z.ZodString>;
|
|
10
|
+
onlyEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
integrationType?: string | undefined;
|
|
13
|
+
onlyEnabled?: boolean | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
integrationType?: string | undefined;
|
|
16
|
+
onlyEnabled?: boolean | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function createListIntegrationsTool(deps: ListIntegrationsDeps): McpToolDefinition<typeof inputSchema>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=list-integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-integrations.d.ts","sourceRoot":"","sources":["../../src/tools/list-integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAG9E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,QAAA,MAAM,WAAW;;;;;;;;;EASf,CAAA;AAEF,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,oBAAoB,GACzB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAqCvC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deniedEnvelope, isIntegrationsReader } from './access.js';
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
integrationType: z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('Filter to a specific integration type (e.g. "webhook").'),
|
|
8
|
+
onlyEnabled: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('If true, exclude disabled instances. Default: false.'),
|
|
12
|
+
});
|
|
13
|
+
export function createListIntegrationsTool(deps) {
|
|
14
|
+
return {
|
|
15
|
+
name: 'list_integrations',
|
|
16
|
+
description: 'Lists configured integration instances and their last-sync status. Use to answer "what connections are set up?" or "is the webhook to Slack still working?". Read-only.',
|
|
17
|
+
inputSchema,
|
|
18
|
+
handler: async (input, ctx) => {
|
|
19
|
+
if (!isIntegrationsReader(ctx)) {
|
|
20
|
+
return deniedEnvelope('Only admins and editors can list integrations.');
|
|
21
|
+
}
|
|
22
|
+
const conditions = [];
|
|
23
|
+
if (input.integrationType)
|
|
24
|
+
conditions.push({ integrationType: { equals: input.integrationType } });
|
|
25
|
+
if (input.onlyEnabled)
|
|
26
|
+
conditions.push({ enabled: { equals: true } });
|
|
27
|
+
const result = await deps.payload.find({
|
|
28
|
+
collection: deps.collectionSlug,
|
|
29
|
+
...(conditions.length > 0 ? { where: { and: conditions } } : {}),
|
|
30
|
+
sort: 'name',
|
|
31
|
+
limit: 100,
|
|
32
|
+
});
|
|
33
|
+
const docs = result.docs;
|
|
34
|
+
return {
|
|
35
|
+
total: result.totalDocs,
|
|
36
|
+
integrations: docs.map((doc) => ({
|
|
37
|
+
id: String(doc['id']),
|
|
38
|
+
name: String(doc['name']),
|
|
39
|
+
type: String(doc['integrationType']),
|
|
40
|
+
enabled: doc['enabled'] === true,
|
|
41
|
+
lastSyncAt: typeof doc['lastSyncAt'] === 'string' ? doc['lastSyncAt'] : null,
|
|
42
|
+
lastSyncStatus: typeof doc['lastSyncStatus'] === 'string' ? doc['lastSyncStatus'] : 'never-run',
|
|
43
|
+
lastError: typeof doc['lastError'] === 'string' ? doc['lastError'] : undefined,
|
|
44
|
+
})),
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=list-integrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-integrations.js","sourceRoot":"","sources":["../../src/tools/list-integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAOlE,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,WAAW,EAAE,CAAC;SACX,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,sDAAsD,CAAC;CACpE,CAAC,CAAA;AAEF,MAAM,UAAU,0BAA0B,CACxC,IAA0B;IAE1B,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,yKAAyK;QAC3K,WAAW;QACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YAC5B,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO,cAAc,CAAC,gDAAgD,CAAC,CAAA;YACzE,CAAC;YAED,MAAM,UAAU,GAAY,EAAE,CAAA;YAC9B,IAAI,KAAK,CAAC,eAAe;gBAAE,UAAU,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;YAClG,IAAI,KAAK,CAAC,WAAW;gBAAE,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;YAErE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBACrC,UAAU,EAAE,IAAI,CAAC,c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contract';
|
|
4
|
+
import type { IntegrationRegistry } from '../registry.js';
|
|
5
|
+
export interface TestIntegrationDeps {
|
|
6
|
+
payload: Payload;
|
|
7
|
+
collectionSlug: string;
|
|
8
|
+
registry: IntegrationRegistry;
|
|
9
|
+
}
|
|
10
|
+
declare const inputSchema: z.ZodObject<{
|
|
11
|
+
integrationId: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
integrationId: string;
|
|
14
|
+
}, {
|
|
15
|
+
integrationId: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function createTestIntegrationTool(deps: TestIntegrationDeps): McpToolDefinition<typeof inputSchema>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=test-integration.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deniedEnvelope, isIntegrationsReader } from './access.js';
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
integrationId: z.string().describe('The instance ID to test.'),
|
|
5
|
+
});
|
|
6
|
+
export function createTestIntegrationTool(deps) {
|
|
7
|
+
return {
|
|
8
|
+
name: 'test_integration',
|
|
9
|
+
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
|
+
inputSchema,
|
|
11
|
+
handler: async (input, ctx) => {
|
|
12
|
+
if (!isIntegrationsReader(ctx)) {
|
|
13
|
+
return deniedEnvelope('Only admins and editors can test integrations.');
|
|
14
|
+
}
|
|
15
|
+
let doc = null;
|
|
16
|
+
try {
|
|
17
|
+
doc = (await deps.payload.findByID({
|
|
18
|
+
collection: deps.collectionSlug,
|
|
19
|
+
id: input.integrationId,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
doc = null;
|
|
24
|
+
}
|
|
25
|
+
if (!doc)
|
|
26
|
+
return { error: `No integration instance with id "${input.integrationId}".` };
|
|
27
|
+
const integrationType = String(doc['integrationType']);
|
|
28
|
+
const integration = deps.registry.get(integrationType);
|
|
29
|
+
if (!integration) {
|
|
30
|
+
return { error: `Unknown integration type "${integrationType}".` };
|
|
31
|
+
}
|
|
32
|
+
if (!integration.healthcheck) {
|
|
33
|
+
return {
|
|
34
|
+
ok: null,
|
|
35
|
+
message: `${integration.name} does not implement a healthcheck.`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const config = (doc['config'] ?? {});
|
|
39
|
+
const result = await integration.healthcheck(config);
|
|
40
|
+
return {
|
|
41
|
+
instanceId: input.integrationId,
|
|
42
|
+
instanceName: String(doc['name']),
|
|
43
|
+
type: integrationType,
|
|
44
|
+
healthy: result.ok,
|
|
45
|
+
details: result.details ?? null,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=test-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-integration.js","sourceRoot":"","sources":["../../src/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,CAAC;YAED,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;gBAC7B,OAAO;oBACL,EAAE,EAAE,IAAI;oBACR,OAAO,EAAE,GAAG,WAAW,CAAC,IAAI,oCAAoC;iBACjE,CAAA;YACH,CAAC;YAED,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAA4B,CAAA;YAC/D,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;YAEpD,OAAO;gBACL,UAAU,EAAE,KAAK,CAAC,aAAa;gBAC/B,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjC,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,MAAM,CAAC,EAAE;gBAClB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;aAChC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Inngest } from 'inngest';
|
|
3
|
+
import type { Payload } from 'payload';
|
|
4
|
+
import type { McpToolDefinition } from '@forumone/throughline-plugin-contract';
|
|
5
|
+
export interface TriggerSyncDeps {
|
|
6
|
+
payload: Payload;
|
|
7
|
+
collectionSlug: string;
|
|
8
|
+
inngest: Inngest;
|
|
9
|
+
}
|
|
10
|
+
declare const inputSchema: z.ZodObject<{
|
|
11
|
+
integrationId: z.ZodString;
|
|
12
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
integrationId: string;
|
|
15
|
+
reason?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
integrationId: string;
|
|
18
|
+
reason?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function createTriggerSyncTool(deps: TriggerSyncDeps): McpToolDefinition<typeof inputSchema>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=trigger-sync.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deniedEnvelope, isIntegrationsAdmin } from './access.js';
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
integrationId: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe('The instance ID to sync. Use list_integrations to find it.'),
|
|
7
|
+
reason: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Why the sync was triggered. Recorded for the audit trail.'),
|
|
11
|
+
});
|
|
12
|
+
export function createTriggerSyncTool(deps) {
|
|
13
|
+
return {
|
|
14
|
+
name: 'trigger_sync',
|
|
15
|
+
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
|
+
inputSchema,
|
|
17
|
+
handler: async (input, ctx) => {
|
|
18
|
+
if (!isIntegrationsAdmin(ctx)) {
|
|
19
|
+
return deniedEnvelope('Only admins can manually trigger integrations.');
|
|
20
|
+
}
|
|
21
|
+
let doc = null;
|
|
22
|
+
try {
|
|
23
|
+
doc = (await deps.payload.findByID({
|
|
24
|
+
collection: deps.collectionSlug,
|
|
25
|
+
id: input.integrationId,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
doc = null;
|
|
30
|
+
}
|
|
31
|
+
if (!doc)
|
|
32
|
+
return { error: `No integration instance with id "${input.integrationId}".` };
|
|
33
|
+
if (doc['enabled'] !== true) {
|
|
34
|
+
return {
|
|
35
|
+
error: `Integration "${String(doc['name'])}" is disabled. Enable it in the admin before triggering.`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const integrationType = String(doc['integrationType']);
|
|
39
|
+
await deps.inngest.send({
|
|
40
|
+
name: 'integration/manual-sync',
|
|
41
|
+
data: {
|
|
42
|
+
integrationId: integrationType,
|
|
43
|
+
instanceId: input.integrationId,
|
|
44
|
+
triggeredBy: ctx.user?.id ?? null,
|
|
45
|
+
reason: input.reason ?? null,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
ok: true,
|
|
50
|
+
triggered: {
|
|
51
|
+
instanceId: input.integrationId,
|
|
52
|
+
instanceName: String(doc['name']),
|
|
53
|
+
type: integrationType,
|
|
54
|
+
},
|
|
55
|
+
message: `Triggered manual sync for "${String(doc['name'])}". Check list_integrations or get_integration_status in a few seconds for the result.`,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=trigger-sync.js.map
|
|
@@ -0,0 +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,GAA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I,EAAE;oBACJ,aAAa,EAAE,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/dist/types.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Field } from 'payload';
|
|
2
|
+
import type { Inngest, InngestFunction } from 'inngest';
|
|
3
|
+
import type { McpToolDefinition } from '@forumone/throughline-plugin-contract';
|
|
4
|
+
export type IntegrationCategory = 'crm' | 'marketing' | 'analytics' | 'webhook' | 'storage' | 'messaging' | 'other';
|
|
5
|
+
export type IntegrationSyncStatus = 'success' | 'partial' | 'failed' | 'never-run';
|
|
6
|
+
export interface IntegrationConfigValidation {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
reason?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IntegrationHealth {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
details?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The contract every integration module satisfies. Integrations are
|
|
16
|
+
* registered with the plugin and instantiated per-row via the Integrations
|
|
17
|
+
* collection. The contract is intentionally small: every future integration
|
|
18
|
+
* (Salesforce, Mailchimp, etc.) follows the same shape, so the productivity
|
|
19
|
+
* compounding is in keeping it stable.
|
|
20
|
+
*
|
|
21
|
+
* Integrations are events-in, events-out: they subscribe to system events
|
|
22
|
+
* (e.g. `content/page.published`) via Inngest functions returned by
|
|
23
|
+
* {@link Integration.createFunctions} and emit their own results events as
|
|
24
|
+
* needed. They never call other integrations directly.
|
|
25
|
+
*/
|
|
26
|
+
export interface Integration<Config = Record<string, unknown>> {
|
|
27
|
+
/** Unique slug. Used as the `integrationType` value in the collection. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Display name shown in the admin and `list_integration_types`. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** One-line description for the admin and the listing tool. */
|
|
32
|
+
description: string;
|
|
33
|
+
/** Category for organizational grouping. */
|
|
34
|
+
category: IntegrationCategory;
|
|
35
|
+
/**
|
|
36
|
+
* Payload field definitions shown in the admin under each instance's
|
|
37
|
+
* `config` group. Integration authors keep this small and obvious — Claude
|
|
38
|
+
* cannot edit these (admin-only access) so unhelpful labels become support
|
|
39
|
+
* tickets, not chatbot mistakes.
|
|
40
|
+
*/
|
|
41
|
+
configFields: Field[];
|
|
42
|
+
/**
|
|
43
|
+
* Validates a config object against this integration's requirements. Run
|
|
44
|
+
* by the collection's beforeChange hook so the Payload UI surfaces errors
|
|
45
|
+
* inline rather than failing at sync time.
|
|
46
|
+
*/
|
|
47
|
+
validateConfig: (config: Config) => Promise<IntegrationConfigValidation>;
|
|
48
|
+
/** Which system events this integration subscribes to. Documentation only. */
|
|
49
|
+
subscribes: Array<{
|
|
50
|
+
event: string;
|
|
51
|
+
purpose: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Factory for the Inngest functions this integration contributes. Called
|
|
55
|
+
* during plugin init; the returned functions are exposed via the registry
|
|
56
|
+
* so the client app's Inngest endpoint can serve them. See
|
|
57
|
+
* `docs/integrations-wiring.md`.
|
|
58
|
+
*/
|
|
59
|
+
createFunctions: (ctx: IntegrationContext) => InngestFunction.Any[];
|
|
60
|
+
/**
|
|
61
|
+
* Optional MCP tools the integration adds to the integrations server. Most
|
|
62
|
+
* integrations need only the five built-in tools; this is for cases where
|
|
63
|
+
* the integration needs its own purpose-built tool (e.g. Salesforce's
|
|
64
|
+
* "preview field mapping").
|
|
65
|
+
*/
|
|
66
|
+
mcpTools?: (ctx: IntegrationContext) => McpToolDefinition[];
|
|
67
|
+
/**
|
|
68
|
+
* Health check. Called by the `test_integration` MCP tool. Returns
|
|
69
|
+
* `{ ok: true }` for healthy or `{ ok: false, details }` for problems.
|
|
70
|
+
*/
|
|
71
|
+
healthcheck?: (config: Config) => Promise<IntegrationHealth>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Runtime context passed to integrations during initialization. Provides
|
|
75
|
+
* the framework's facilities (Inngest, audit) without coupling the
|
|
76
|
+
* integration to internal implementation details.
|
|
77
|
+
*/
|
|
78
|
+
export interface IntegrationContext {
|
|
79
|
+
inngest: Inngest;
|
|
80
|
+
integrationsCollectionSlug: string;
|
|
81
|
+
/** Loads all enabled instances of an integration by id. */
|
|
82
|
+
loadInstances: <Config = Record<string, unknown>>(integrationId: string) => Promise<Array<IntegrationInstanceLoaded<Config>>>;
|
|
83
|
+
/** Updates an instance's lastSyncAt / lastSyncStatus / lastError. */
|
|
84
|
+
updateStatus: (instanceId: string, status: IntegrationSyncStatus, error?: string) => Promise<void>;
|
|
85
|
+
/** Writes an audit event. Thin wrapper over core's audit writer. */
|
|
86
|
+
recordAudit: (event: IntegrationAuditEvent) => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export interface IntegrationInstanceLoaded<Config = Record<string, unknown>> {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
config: Config;
|
|
92
|
+
}
|
|
93
|
+
export interface IntegrationAuditEvent {
|
|
94
|
+
/** The integration's id (e.g. 'webhook'). Used as the audit `integrationId`. */
|
|
95
|
+
integrationId: string;
|
|
96
|
+
/** The instance's display name. Surfaces in audit summaries. */
|
|
97
|
+
instanceName: string;
|
|
98
|
+
action: 'integration.synced' | 'integration.failed';
|
|
99
|
+
summary: string;
|
|
100
|
+
errorMessage?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The shape of a single Integrations-collection row, as returned by Payload.
|
|
104
|
+
* Used by tests and by the helpers that read instances back out.
|
|
105
|
+
*/
|
|
106
|
+
export interface IntegrationInstance {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
integrationType: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
config: Record<string, unknown>;
|
|
112
|
+
lastSyncAt?: string;
|
|
113
|
+
lastSyncStatus?: IntegrationSyncStatus;
|
|
114
|
+
lastError?: string;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAE9E,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,WAAW,GACX,OAAO,CAAA;AAEX,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;AAElF,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAA;IACV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,CAAA;CAC7D;AAED,MAAM,WAAW,yBAAyB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAAA;IACnD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,10 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forumone/throughline-integrations",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"CHANGELOG.md"
|
|
18
|
+
],
|
|
5
19
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
"throughline",
|
|
21
|
+
"payload",
|
|
22
|
+
"mcp",
|
|
23
|
+
"integrations",
|
|
24
|
+
"webhook"
|
|
25
|
+
],
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/forumone/throughline.git",
|
|
30
|
+
"directory": "packages/integrations"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/forumone/throughline/tree/main/packages/integrations#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/forumone/throughline/issues"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"inngest": "^4.0.0",
|
|
41
|
+
"payload": "^3.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"zod": "^3.23.0",
|
|
45
|
+
"@forumone/throughline-core": "0.2.1",
|
|
46
|
+
"@forumone/throughline-plugin-contract": "0.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.17.0",
|
|
50
|
+
"eslint": "^9.15.0",
|
|
51
|
+
"inngest": "^4.2.0",
|
|
52
|
+
"payload": "^3.83.0",
|
|
53
|
+
"typescript": "^5.6.0",
|
|
54
|
+
"vitest": "^2.1.0",
|
|
55
|
+
"@forumone/throughline-eslint-config": "0.0.0",
|
|
56
|
+
"@forumone/throughline-tsconfig": "0.0.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsc -b",
|
|
60
|
+
"dev": "tsc -b -w",
|
|
61
|
+
"clean": "rm -rf dist .turbo *.tsbuildinfo",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"lint": "eslint src",
|
|
64
|
+
"test": "vitest run"
|
|
65
|
+
}
|
|
66
|
+
}
|