@contractspec/example.integration-hub 2.9.1 → 3.1.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 +2 -1
- package/dist/connection/connection.enum.d.ts +8 -0
- package/dist/connection/connection.enum.js +18 -1
- package/dist/connection/connection.operation.d.ts +48 -0
- package/dist/connection/connection.operation.js +25 -2
- package/dist/connection/connection.presentation.js +25 -2
- package/dist/connection/connection.schema.d.ts +32 -0
- package/dist/connection/connection.schema.js +25 -2
- package/dist/connection/index.js +25 -2
- package/dist/handlers/index.js +47 -1
- package/dist/handlers/integration.handlers.d.ts +35 -0
- package/dist/handlers/integration.handlers.js +47 -1
- package/dist/index.js +80 -7
- package/dist/mcp-example.d.ts +3 -1
- package/dist/mcp-example.js +8 -4
- package/dist/node/connection/connection.enum.js +18 -1
- package/dist/node/connection/connection.operation.js +25 -2
- package/dist/node/connection/connection.presentation.js +25 -2
- package/dist/node/connection/connection.schema.js +25 -2
- package/dist/node/connection/index.js +25 -2
- package/dist/node/handlers/index.js +47 -1
- package/dist/node/handlers/integration.handlers.js +47 -1
- package/dist/node/index.js +80 -7
- package/dist/node/mcp-example.js +8 -4
- package/dist/node/run-mcp.js +8 -4
- package/dist/run-mcp.js +8 -4
- package/package.json +9 -9
package/dist/run-mcp.js
CHANGED
|
@@ -11,6 +11,7 @@ var DEFAULT_STDIO_ARGS = [
|
|
|
11
11
|
];
|
|
12
12
|
async function runIntegrationHubMcpExampleFromEnv() {
|
|
13
13
|
const mode = resolveMode();
|
|
14
|
+
const transport = resolveTransport();
|
|
14
15
|
const config = buildMcpConfigFromEnv();
|
|
15
16
|
const toolset = await createMcpToolsets([config], {
|
|
16
17
|
onNameCollision: "error"
|
|
@@ -21,8 +22,10 @@ async function runIntegrationHubMcpExampleFromEnv() {
|
|
|
21
22
|
mode,
|
|
22
23
|
server: {
|
|
23
24
|
name: config.name,
|
|
24
|
-
transport
|
|
25
|
+
transport
|
|
25
26
|
},
|
|
27
|
+
authMethod: process.env.CONTRACTSPEC_INTEGRATION_HUB_MCP_AUTH_METHOD,
|
|
28
|
+
apiVersion: process.env.CONTRACTSPEC_INTEGRATION_HUB_MCP_API_VERSION,
|
|
26
29
|
tools: toolNames
|
|
27
30
|
};
|
|
28
31
|
if (mode === "call") {
|
|
@@ -64,9 +67,10 @@ function buildMcpConfigFromEnv() {
|
|
|
64
67
|
}
|
|
65
68
|
const accessToken = process.env.CONTRACTSPEC_INTEGRATION_HUB_MCP_ACCESS_TOKEN;
|
|
66
69
|
const accessTokenEnvVar = process.env.CONTRACTSPEC_INTEGRATION_HUB_MCP_ACCESS_TOKEN_ENV;
|
|
70
|
+
const mcpTransport = transport === "webhook" || transport === "http" ? "http" : "sse";
|
|
67
71
|
return {
|
|
68
72
|
name,
|
|
69
|
-
transport,
|
|
73
|
+
transport: mcpTransport,
|
|
70
74
|
url: requireEnv("CONTRACTSPEC_INTEGRATION_HUB_MCP_URL"),
|
|
71
75
|
headers: parseStringRecordEnv("CONTRACTSPEC_INTEGRATION_HUB_MCP_HEADERS_JSON"),
|
|
72
76
|
accessToken,
|
|
@@ -83,10 +87,10 @@ function resolveMode() {
|
|
|
83
87
|
}
|
|
84
88
|
function resolveTransport() {
|
|
85
89
|
const rawTransport = process.env.CONTRACTSPEC_INTEGRATION_HUB_MCP_TRANSPORT?.toLowerCase() ?? "stdio";
|
|
86
|
-
if (rawTransport === "stdio" || rawTransport === "http" || rawTransport === "sse") {
|
|
90
|
+
if (rawTransport === "stdio" || rawTransport === "http" || rawTransport === "sse" || rawTransport === "webhook") {
|
|
87
91
|
return rawTransport;
|
|
88
92
|
}
|
|
89
|
-
throw new Error(`Unsupported CONTRACTSPEC_INTEGRATION_HUB_MCP_TRANSPORT: ${rawTransport}. Use "stdio", "http", or "
|
|
93
|
+
throw new Error(`Unsupported CONTRACTSPEC_INTEGRATION_HUB_MCP_TRANSPORT: ${rawTransport}. Use "stdio", "http", "sse", or "webhook".`);
|
|
90
94
|
}
|
|
91
95
|
function parseStringArrayEnv(key, fallback) {
|
|
92
96
|
const raw = process.env[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.integration-hub",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Integration Hub example with sync engine and field mappings for ContractSpec",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"typecheck": "tsc --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contractspec/lib.ai-agent": "
|
|
25
|
-
"@contractspec/lib.schema": "
|
|
26
|
-
"@contractspec/lib.contracts-spec": "
|
|
27
|
-
"@contractspec/lib.example-shared-ui": "
|
|
28
|
-
"@contractspec/lib.design-system": "
|
|
29
|
-
"@contractspec/lib.runtime-sandbox": "1.
|
|
24
|
+
"@contractspec/lib.ai-agent": "3.1.1",
|
|
25
|
+
"@contractspec/lib.schema": "3.1.0",
|
|
26
|
+
"@contractspec/lib.contracts-spec": "3.1.1",
|
|
27
|
+
"@contractspec/lib.example-shared-ui": "3.1.1",
|
|
28
|
+
"@contractspec/lib.design-system": "3.1.1",
|
|
29
|
+
"@contractspec/lib.runtime-sandbox": "2.1.0",
|
|
30
30
|
"react": "19.2.4",
|
|
31
31
|
"react-dom": "19.2.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@contractspec/tool.typescript": "
|
|
34
|
+
"@contractspec/tool.typescript": "3.1.0",
|
|
35
35
|
"typescript": "^5.9.3",
|
|
36
36
|
"@types/react": "^19.2.14",
|
|
37
37
|
"@types/react-dom": "^19.2.2",
|
|
38
|
-
"@contractspec/tool.bun": "
|
|
38
|
+
"@contractspec/tool.bun": "3.1.0"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|