@contractspec/example.integration-hub 1.57.0 → 1.58.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/dist/browser/connection/connection.enum.js +12 -0
- package/dist/browser/connection/connection.operation.js +101 -0
- package/dist/browser/connection/connection.presentation.js +99 -0
- package/dist/browser/connection/connection.schema.js +48 -0
- package/dist/browser/connection/index.js +104 -0
- package/dist/browser/docs/index.js +104 -0
- package/dist/browser/docs/integration-hub.docblock.js +104 -0
- package/dist/browser/events.js +211 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +246 -0
- package/dist/browser/handlers/integration.handlers.js +246 -0
- package/dist/browser/index.js +1595 -0
- package/dist/browser/integration/index.js +92 -0
- package/dist/browser/integration/integration.enum.js +12 -0
- package/dist/browser/integration/integration.operations.js +89 -0
- package/dist/browser/integration/integration.presentation.js +117 -0
- package/dist/browser/integration/integration.schema.js +42 -0
- package/dist/browser/integration-hub.capability.js +40 -0
- package/dist/browser/integration-hub.feature.js +114 -0
- package/dist/browser/seeders/index.js +60 -0
- package/dist/browser/sync/index.js +332 -0
- package/dist/browser/sync/sync.enum.js +26 -0
- package/dist/browser/sync/sync.operations.js +321 -0
- package/dist/browser/sync/sync.presentation.js +298 -0
- package/dist/browser/sync/sync.schema.js +154 -0
- package/dist/browser/sync-engine/index.js +186 -0
- package/dist/browser/tests/operations.test-spec.js +85 -0
- package/dist/browser/ui/IntegrationDashboard.js +369 -0
- package/dist/browser/ui/hooks/index.js +57 -0
- package/dist/browser/ui/hooks/useIntegrationData.js +54 -0
- package/dist/browser/ui/index.js +644 -0
- package/dist/browser/ui/renderers/index.js +273 -0
- package/dist/browser/ui/renderers/integration.markdown.js +273 -0
- package/dist/connection/connection.enum.d.ts +1 -6
- package/dist/connection/connection.enum.d.ts.map +1 -1
- package/dist/connection/connection.enum.js +11 -15
- package/dist/connection/connection.operation.d.ts +78 -84
- package/dist/connection/connection.operation.d.ts.map +1 -1
- package/dist/connection/connection.operation.js +99 -60
- package/dist/connection/connection.presentation.d.ts +2 -7
- package/dist/connection/connection.presentation.d.ts.map +1 -1
- package/dist/connection/connection.presentation.js +96 -56
- package/dist/connection/connection.schema.d.ts +54 -59
- package/dist/connection/connection.schema.d.ts.map +1 -1
- package/dist/connection/connection.schema.js +46 -73
- package/dist/connection/index.d.ts +7 -4
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +104 -4
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +105 -1
- package/dist/docs/integration-hub.docblock.d.ts +2 -1
- package/dist/docs/integration-hub.docblock.d.ts.map +1 -0
- package/dist/docs/integration-hub.docblock.js +45 -56
- package/dist/events.d.ts +137 -143
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +210 -287
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +41 -55
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +247 -3
- package/dist/handlers/integration.handlers.d.ts +114 -113
- package/dist/handlers/integration.handlers.d.ts.map +1 -1
- package/dist/handlers/integration.handlers.js +232 -267
- package/dist/index.d.ts +12 -19
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1596 -20
- package/dist/integration/index.d.ts +7 -4
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +92 -4
- package/dist/integration/integration.enum.d.ts +1 -6
- package/dist/integration/integration.enum.d.ts.map +1 -1
- package/dist/integration/integration.enum.js +11 -15
- package/dist/integration/integration.operations.d.ts +74 -80
- package/dist/integration/integration.operations.d.ts.map +1 -1
- package/dist/integration/integration.operations.js +87 -54
- package/dist/integration/integration.presentation.d.ts +3 -8
- package/dist/integration/integration.presentation.d.ts.map +1 -1
- package/dist/integration/integration.presentation.js +114 -73
- package/dist/integration/integration.schema.d.ts +54 -59
- package/dist/integration/integration.schema.d.ts.map +1 -1
- package/dist/integration/integration.schema.js +40 -73
- package/dist/integration-hub.capability.d.ts +3 -8
- package/dist/integration-hub.capability.d.ts.map +1 -1
- package/dist/integration-hub.capability.js +41 -38
- package/dist/integration-hub.feature.d.ts +1 -6
- package/dist/integration-hub.feature.d.ts.map +1 -1
- package/dist/integration-hub.feature.js +113 -242
- package/dist/node/connection/connection.enum.js +12 -0
- package/dist/node/connection/connection.operation.js +101 -0
- package/dist/node/connection/connection.presentation.js +99 -0
- package/dist/node/connection/connection.schema.js +48 -0
- package/dist/node/connection/index.js +104 -0
- package/dist/node/docs/index.js +104 -0
- package/dist/node/docs/integration-hub.docblock.js +104 -0
- package/dist/node/events.js +211 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +246 -0
- package/dist/node/handlers/integration.handlers.js +246 -0
- package/dist/node/index.js +1595 -0
- package/dist/node/integration/index.js +92 -0
- package/dist/node/integration/integration.enum.js +12 -0
- package/dist/node/integration/integration.operations.js +89 -0
- package/dist/node/integration/integration.presentation.js +117 -0
- package/dist/node/integration/integration.schema.js +42 -0
- package/dist/node/integration-hub.capability.js +40 -0
- package/dist/node/integration-hub.feature.js +114 -0
- package/dist/node/seeders/index.js +60 -0
- package/dist/node/sync/index.js +332 -0
- package/dist/node/sync/sync.enum.js +26 -0
- package/dist/node/sync/sync.operations.js +321 -0
- package/dist/node/sync/sync.presentation.js +298 -0
- package/dist/node/sync/sync.schema.js +154 -0
- package/dist/node/sync-engine/index.js +186 -0
- package/dist/node/tests/operations.test-spec.js +85 -0
- package/dist/node/ui/IntegrationDashboard.js +369 -0
- package/dist/node/ui/hooks/index.js +57 -0
- package/dist/node/ui/hooks/useIntegrationData.js +54 -0
- package/dist/node/ui/index.js +644 -0
- package/dist/node/ui/renderers/index.js +273 -0
- package/dist/node/ui/renderers/integration.markdown.js +273 -0
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +54 -52
- package/dist/sync/index.d.ts +7 -4
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +332 -4
- package/dist/sync/sync.enum.d.ts +3 -8
- package/dist/sync/sync.enum.d.ts.map +1 -1
- package/dist/sync/sync.enum.js +23 -31
- package/dist/sync/sync.operations.d.ts +413 -419
- package/dist/sync/sync.operations.d.ts.map +1 -1
- package/dist/sync/sync.operations.js +316 -197
- package/dist/sync/sync.presentation.d.ts +6 -11
- package/dist/sync/sync.presentation.d.ts.map +1 -1
- package/dist/sync/sync.presentation.js +291 -160
- package/dist/sync/sync.schema.d.ts +317 -322
- package/dist/sync/sync.schema.d.ts.map +1 -1
- package/dist/sync/sync.schema.js +146 -295
- package/dist/sync-engine/index.d.ts +88 -91
- package/dist/sync-engine/index.d.ts.map +1 -1
- package/dist/sync-engine/index.js +181 -142
- package/dist/tests/operations.test-spec.d.ts +3 -8
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +82 -90
- package/dist/ui/IntegrationDashboard.d.ts +1 -6
- package/dist/ui/IntegrationDashboard.d.ts.map +1 -1
- package/dist/ui/IntegrationDashboard.js +365 -261
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +57 -4
- package/dist/ui/hooks/useIntegrationData.d.ts +16 -20
- package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -1
- package/dist/ui/hooks/useIntegrationData.js +51 -55
- package/dist/ui/index.d.ts +7 -6
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +644 -5
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +274 -3
- package/dist/ui/renderers/integration.markdown.d.ts +13 -14
- package/dist/ui/renderers/integration.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/integration.markdown.js +268 -264
- package/package.json +360 -71
- package/dist/connection/connection.enum.js.map +0 -1
- package/dist/connection/connection.operation.js.map +0 -1
- package/dist/connection/connection.presentation.js.map +0 -1
- package/dist/connection/connection.schema.js.map +0 -1
- package/dist/docs/integration-hub.docblock.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/integration.handlers.js.map +0 -1
- package/dist/integration/integration.enum.js.map +0 -1
- package/dist/integration/integration.operations.js.map +0 -1
- package/dist/integration/integration.presentation.js.map +0 -1
- package/dist/integration/integration.schema.js.map +0 -1
- package/dist/integration-hub.capability.js.map +0 -1
- package/dist/integration-hub.feature.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/sync/sync.enum.js.map +0 -1
- package/dist/sync/sync.operations.js.map +0 -1
- package/dist/sync/sync.presentation.js.map +0 -1
- package/dist/sync/sync.schema.js.map +0 -1
- package/dist/sync-engine/index.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/IntegrationDashboard.js.map +0 -1
- package/dist/ui/hooks/useIntegrationData.js.map +0 -1
- package/dist/ui/renderers/integration.markdown.js.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// src/integration/integration.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"PAUSED",
|
|
7
|
+
"ERROR",
|
|
8
|
+
"ARCHIVED"
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
// src/integration/integration.schema.ts
|
|
12
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
+
var IntegrationModel = defineSchemaModel({
|
|
14
|
+
name: "IntegrationModel",
|
|
15
|
+
fields: {
|
|
16
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
22
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
26
|
+
name: "CreateIntegrationInput",
|
|
27
|
+
fields: {
|
|
28
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
29
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
31
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
32
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
33
|
+
featureFlagKey: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// src/integration/integration.operations.ts
|
|
41
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
42
|
+
var CreateIntegrationContract = defineCommand({
|
|
43
|
+
meta: {
|
|
44
|
+
key: "integration.create",
|
|
45
|
+
version: "1.0.0",
|
|
46
|
+
stability: "stable",
|
|
47
|
+
owners: ["@example.integration-hub"],
|
|
48
|
+
tags: ["integration", "create"],
|
|
49
|
+
description: "Create a new integration.",
|
|
50
|
+
goal: "Allow users to set up integrations with external systems.",
|
|
51
|
+
context: "Integration setup."
|
|
52
|
+
},
|
|
53
|
+
io: { input: CreateIntegrationInputModel, output: IntegrationModel },
|
|
54
|
+
policy: { auth: "user" },
|
|
55
|
+
sideEffects: {
|
|
56
|
+
emits: [
|
|
57
|
+
{
|
|
58
|
+
key: "integration.created",
|
|
59
|
+
version: "1.0.0",
|
|
60
|
+
when: "Integration created",
|
|
61
|
+
payload: IntegrationModel
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
audit: ["integration.created"]
|
|
65
|
+
},
|
|
66
|
+
acceptance: {
|
|
67
|
+
scenarios: [
|
|
68
|
+
{
|
|
69
|
+
key: "create-integration-happy-path",
|
|
70
|
+
given: ["User is admin"],
|
|
71
|
+
when: ["User defines new integration type"],
|
|
72
|
+
then: [
|
|
73
|
+
"Integration definition is created",
|
|
74
|
+
"IntegrationCreated event is emitted"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
examples: [
|
|
79
|
+
{
|
|
80
|
+
key: "create-slack",
|
|
81
|
+
input: { name: "Slack", category: "communication", authType: "oauth2" },
|
|
82
|
+
output: { id: "slack", status: "active" }
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
IntegrationStatusEnum,
|
|
89
|
+
IntegrationModel,
|
|
90
|
+
CreateIntegrationInputModel,
|
|
91
|
+
CreateIntegrationContract
|
|
92
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/integration/integration.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"PAUSED",
|
|
7
|
+
"ERROR",
|
|
8
|
+
"ARCHIVED"
|
|
9
|
+
]);
|
|
10
|
+
export {
|
|
11
|
+
IntegrationStatusEnum
|
|
12
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/integration/integration.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"PAUSED",
|
|
7
|
+
"ERROR",
|
|
8
|
+
"ARCHIVED"
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
// src/integration/integration.schema.ts
|
|
12
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
+
var IntegrationModel = defineSchemaModel({
|
|
14
|
+
name: "IntegrationModel",
|
|
15
|
+
fields: {
|
|
16
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
22
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
26
|
+
name: "CreateIntegrationInput",
|
|
27
|
+
fields: {
|
|
28
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
29
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
31
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
32
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
33
|
+
featureFlagKey: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// src/integration/integration.operations.ts
|
|
41
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
42
|
+
var CreateIntegrationContract = defineCommand({
|
|
43
|
+
meta: {
|
|
44
|
+
key: "integration.create",
|
|
45
|
+
version: "1.0.0",
|
|
46
|
+
stability: "stable",
|
|
47
|
+
owners: ["@example.integration-hub"],
|
|
48
|
+
tags: ["integration", "create"],
|
|
49
|
+
description: "Create a new integration.",
|
|
50
|
+
goal: "Allow users to set up integrations with external systems.",
|
|
51
|
+
context: "Integration setup."
|
|
52
|
+
},
|
|
53
|
+
io: { input: CreateIntegrationInputModel, output: IntegrationModel },
|
|
54
|
+
policy: { auth: "user" },
|
|
55
|
+
sideEffects: {
|
|
56
|
+
emits: [
|
|
57
|
+
{
|
|
58
|
+
key: "integration.created",
|
|
59
|
+
version: "1.0.0",
|
|
60
|
+
when: "Integration created",
|
|
61
|
+
payload: IntegrationModel
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
audit: ["integration.created"]
|
|
65
|
+
},
|
|
66
|
+
acceptance: {
|
|
67
|
+
scenarios: [
|
|
68
|
+
{
|
|
69
|
+
key: "create-integration-happy-path",
|
|
70
|
+
given: ["User is admin"],
|
|
71
|
+
when: ["User defines new integration type"],
|
|
72
|
+
then: [
|
|
73
|
+
"Integration definition is created",
|
|
74
|
+
"IntegrationCreated event is emitted"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
examples: [
|
|
79
|
+
{
|
|
80
|
+
key: "create-slack",
|
|
81
|
+
input: { name: "Slack", category: "communication", authType: "oauth2" },
|
|
82
|
+
output: { id: "slack", status: "active" }
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
CreateIntegrationContract
|
|
89
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/integration/integration.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"PAUSED",
|
|
7
|
+
"ERROR",
|
|
8
|
+
"ARCHIVED"
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
// src/integration/integration.schema.ts
|
|
12
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
+
var IntegrationModel = defineSchemaModel({
|
|
14
|
+
name: "IntegrationModel",
|
|
15
|
+
fields: {
|
|
16
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
22
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
26
|
+
name: "CreateIntegrationInput",
|
|
27
|
+
fields: {
|
|
28
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
29
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
31
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
32
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
33
|
+
featureFlagKey: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// src/integration/integration.presentation.ts
|
|
41
|
+
import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
|
|
42
|
+
var IntegrationListPresentation = definePresentation({
|
|
43
|
+
meta: {
|
|
44
|
+
key: "integration.list",
|
|
45
|
+
version: "1.0.0",
|
|
46
|
+
title: "Integration List",
|
|
47
|
+
description: "List of available integrations",
|
|
48
|
+
domain: "integration",
|
|
49
|
+
owners: ["@integration-team"],
|
|
50
|
+
tags: ["integration", "list"],
|
|
51
|
+
stability: StabilityEnum.Experimental,
|
|
52
|
+
goal: "Show users available integrations they can connect to.",
|
|
53
|
+
context: "The marketplace of integrations within the hub."
|
|
54
|
+
},
|
|
55
|
+
source: {
|
|
56
|
+
type: "component",
|
|
57
|
+
framework: "react",
|
|
58
|
+
componentKey: "IntegrationList",
|
|
59
|
+
props: IntegrationModel
|
|
60
|
+
},
|
|
61
|
+
targets: ["react", "markdown"],
|
|
62
|
+
policy: {
|
|
63
|
+
flags: ["integration.enabled"]
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var IntegrationDetailPresentation = definePresentation({
|
|
67
|
+
meta: {
|
|
68
|
+
key: "integration.detail",
|
|
69
|
+
version: "1.0.0",
|
|
70
|
+
title: "Integration Details",
|
|
71
|
+
description: "Detailed view of an integration",
|
|
72
|
+
domain: "integration",
|
|
73
|
+
owners: ["@integration-team"],
|
|
74
|
+
tags: ["integration", "detail"],
|
|
75
|
+
stability: StabilityEnum.Experimental,
|
|
76
|
+
goal: "Show capabilities and documentation for a specific integration.",
|
|
77
|
+
context: "Integration showcase and support page."
|
|
78
|
+
},
|
|
79
|
+
source: {
|
|
80
|
+
type: "component",
|
|
81
|
+
framework: "react",
|
|
82
|
+
componentKey: "IntegrationDetail",
|
|
83
|
+
props: IntegrationModel
|
|
84
|
+
},
|
|
85
|
+
targets: ["react", "markdown"],
|
|
86
|
+
policy: {
|
|
87
|
+
flags: ["integration.enabled"]
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
var IntegrationHealthPresentation = definePresentation({
|
|
91
|
+
meta: {
|
|
92
|
+
key: "integration.health",
|
|
93
|
+
version: "1.0.0",
|
|
94
|
+
title: "Integration Health",
|
|
95
|
+
description: "Integration health monitoring dashboard",
|
|
96
|
+
domain: "integration",
|
|
97
|
+
owners: ["@integration-team"],
|
|
98
|
+
tags: ["integration", "health", "monitoring"],
|
|
99
|
+
stability: StabilityEnum.Experimental,
|
|
100
|
+
goal: "Monitor connectivity and error rates for active integrations.",
|
|
101
|
+
context: "Operations dashboard for integration hub health."
|
|
102
|
+
},
|
|
103
|
+
source: {
|
|
104
|
+
type: "component",
|
|
105
|
+
framework: "react",
|
|
106
|
+
componentKey: "IntegrationHealth"
|
|
107
|
+
},
|
|
108
|
+
targets: ["react", "markdown"],
|
|
109
|
+
policy: {
|
|
110
|
+
flags: ["integration.monitoring.enabled"]
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export {
|
|
114
|
+
IntegrationListPresentation,
|
|
115
|
+
IntegrationHealthPresentation,
|
|
116
|
+
IntegrationDetailPresentation
|
|
117
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/integration/integration.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
4
|
+
"DRAFT",
|
|
5
|
+
"ACTIVE",
|
|
6
|
+
"PAUSED",
|
|
7
|
+
"ERROR",
|
|
8
|
+
"ARCHIVED"
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
// src/integration/integration.schema.ts
|
|
12
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
+
var IntegrationModel = defineSchemaModel({
|
|
14
|
+
name: "IntegrationModel",
|
|
15
|
+
fields: {
|
|
16
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
22
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
26
|
+
name: "CreateIntegrationInput",
|
|
27
|
+
fields: {
|
|
28
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
29
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
31
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
32
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
33
|
+
featureFlagKey: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
IntegrationModel,
|
|
41
|
+
CreateIntegrationInputModel
|
|
42
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/integration-hub.capability.ts
|
|
2
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var IntegrationCapability = defineCapability({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "integration",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "integration",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "Third-party integration connections",
|
|
10
|
+
owners: ["platform.core"],
|
|
11
|
+
tags: ["integration", "connections"]
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var SyncCapability = defineCapability({
|
|
15
|
+
meta: {
|
|
16
|
+
key: "sync",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
kind: "api",
|
|
19
|
+
stability: StabilityEnum.Experimental,
|
|
20
|
+
description: "Data synchronization between systems",
|
|
21
|
+
owners: ["platform.core"],
|
|
22
|
+
tags: ["sync", "data"]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var EtlCapability = defineCapability({
|
|
26
|
+
meta: {
|
|
27
|
+
key: "etl",
|
|
28
|
+
version: "1.0.0",
|
|
29
|
+
kind: "api",
|
|
30
|
+
stability: StabilityEnum.Experimental,
|
|
31
|
+
description: "Extract, transform, load data pipelines",
|
|
32
|
+
owners: ["platform.core"],
|
|
33
|
+
tags: ["etl", "data", "pipeline"]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
SyncCapability,
|
|
38
|
+
IntegrationCapability,
|
|
39
|
+
EtlCapability
|
|
40
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// src/integration-hub.feature.ts
|
|
2
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
3
|
+
var IntegrationHubFeature = defineFeature({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "integration-hub",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Integration Hub",
|
|
8
|
+
description: "Connect and sync data with external systems through configurable integrations",
|
|
9
|
+
domain: "integration",
|
|
10
|
+
owners: ["@integration-team"],
|
|
11
|
+
tags: ["integration", "sync", "etl", "connectors"],
|
|
12
|
+
stability: "experimental"
|
|
13
|
+
},
|
|
14
|
+
operations: [
|
|
15
|
+
{ key: "integration.create", version: "1.0.0" },
|
|
16
|
+
{ key: "integration.connection.create", version: "1.0.0" },
|
|
17
|
+
{ key: "integration.syncConfig.create", version: "1.0.0" },
|
|
18
|
+
{ key: "integration.fieldMapping.add", version: "1.0.0" },
|
|
19
|
+
{ key: "integration.sync.trigger", version: "1.0.0" },
|
|
20
|
+
{ key: "integration.syncRun.list", version: "1.0.0" }
|
|
21
|
+
],
|
|
22
|
+
events: [
|
|
23
|
+
{ key: "integration.created", version: "1.0.0" },
|
|
24
|
+
{ key: "integration.connection.created", version: "1.0.0" },
|
|
25
|
+
{ key: "integration.connection.statusChanged", version: "1.0.0" },
|
|
26
|
+
{ key: "integration.syncConfig.created", version: "1.0.0" },
|
|
27
|
+
{ key: "integration.sync.started", version: "1.0.0" },
|
|
28
|
+
{ key: "integration.sync.completed", version: "1.0.0" },
|
|
29
|
+
{ key: "integration.sync.failed", version: "1.0.0" },
|
|
30
|
+
{ key: "integration.record.synced", version: "1.0.0" },
|
|
31
|
+
{ key: "integration.fieldMapping.added", version: "1.0.0" }
|
|
32
|
+
],
|
|
33
|
+
presentations: [
|
|
34
|
+
{ key: "integration.list", version: "1.0.0" },
|
|
35
|
+
{ key: "integration.detail", version: "1.0.0" },
|
|
36
|
+
{ key: "integration.connection.list", version: "1.0.0" },
|
|
37
|
+
{ key: "integration.connection.setup", version: "1.0.0" },
|
|
38
|
+
{ key: "integration.syncConfig.list", version: "1.0.0" },
|
|
39
|
+
{ key: "integration.syncConfig.editor", version: "1.0.0" },
|
|
40
|
+
{ key: "integration.fieldMapping.editor", version: "1.0.0" },
|
|
41
|
+
{ key: "integration.syncRun.viewList", version: "1.0.0" },
|
|
42
|
+
{ key: "integration.syncRun.detail", version: "1.0.0" },
|
|
43
|
+
{ key: "integration.health", version: "1.0.0" },
|
|
44
|
+
{ key: "integration.sync.activity", version: "1.0.0" }
|
|
45
|
+
],
|
|
46
|
+
opToPresentation: [
|
|
47
|
+
{
|
|
48
|
+
op: { key: "integration.syncConfig.create", version: "1.0.0" },
|
|
49
|
+
pres: { key: "integration.syncConfig.editor", version: "1.0.0" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
op: { key: "integration.fieldMapping.add", version: "1.0.0" },
|
|
53
|
+
pres: { key: "integration.fieldMapping.editor", version: "1.0.0" }
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
op: { key: "integration.syncRun.list", version: "1.0.0" },
|
|
57
|
+
pres: { key: "integration.syncRun.viewList", version: "1.0.0" }
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
presentationsTargets: [
|
|
61
|
+
{
|
|
62
|
+
key: "integration.list",
|
|
63
|
+
version: "1.0.0",
|
|
64
|
+
targets: ["react", "markdown"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "integration.detail",
|
|
68
|
+
version: "1.0.0",
|
|
69
|
+
targets: ["react", "markdown"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: "integration.syncConfig.list",
|
|
73
|
+
version: "1.0.0",
|
|
74
|
+
targets: ["react", "markdown"]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: "integration.syncConfig.editor",
|
|
78
|
+
version: "1.0.0",
|
|
79
|
+
targets: ["react"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: "integration.fieldMapping.editor",
|
|
83
|
+
version: "1.0.0",
|
|
84
|
+
targets: ["react"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: "integration.syncRun.viewList",
|
|
88
|
+
version: "1.0.0",
|
|
89
|
+
targets: ["react", "markdown"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: "integration.syncRun.detail",
|
|
93
|
+
version: "1.0.0",
|
|
94
|
+
targets: ["react", "markdown"]
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
capabilities: {
|
|
98
|
+
requires: [
|
|
99
|
+
{ key: "identity", version: "1.0.0" },
|
|
100
|
+
{ key: "audit-trail", version: "1.0.0" },
|
|
101
|
+
{ key: "feature-flags", version: "1.0.0" },
|
|
102
|
+
{ key: "jobs", version: "1.0.0" },
|
|
103
|
+
{ key: "files", version: "1.0.0" }
|
|
104
|
+
],
|
|
105
|
+
provides: [
|
|
106
|
+
{ key: "integration", version: "1.0.0" },
|
|
107
|
+
{ key: "sync", version: "1.0.0" },
|
|
108
|
+
{ key: "etl", version: "1.0.0" }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
IntegrationHubFeature
|
|
114
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/seeders/index.ts
|
|
2
|
+
async function seedIntegrationHub(params) {
|
|
3
|
+
const { projectId, db } = params;
|
|
4
|
+
const existing = await db.query(`SELECT COUNT(*) as count FROM integration WHERE "projectId" = $1`, [projectId]);
|
|
5
|
+
if (existing.rows[0]?.count > 0)
|
|
6
|
+
return;
|
|
7
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
8
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
9
|
+
"int_1",
|
|
10
|
+
projectId,
|
|
11
|
+
"org_demo",
|
|
12
|
+
"Salesforce",
|
|
13
|
+
"Salesforce CRM integration",
|
|
14
|
+
"CRM",
|
|
15
|
+
"ACTIVE"
|
|
16
|
+
]);
|
|
17
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
18
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
19
|
+
"int_2",
|
|
20
|
+
projectId,
|
|
21
|
+
"org_demo",
|
|
22
|
+
"Meeting Recorder",
|
|
23
|
+
"Meeting recorder transcripts and metadata",
|
|
24
|
+
"DATA",
|
|
25
|
+
"ACTIVE"
|
|
26
|
+
]);
|
|
27
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
28
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
29
|
+
"int_3",
|
|
30
|
+
projectId,
|
|
31
|
+
"org_demo",
|
|
32
|
+
"Gradium Voice",
|
|
33
|
+
"Gradium low-latency text-to-speech integration",
|
|
34
|
+
"COMMUNICATION",
|
|
35
|
+
"ACTIVE"
|
|
36
|
+
]);
|
|
37
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
38
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
39
|
+
"int_4",
|
|
40
|
+
projectId,
|
|
41
|
+
"org_demo",
|
|
42
|
+
"Fal Chatterbox Voice",
|
|
43
|
+
"Fal Chatterbox text-to-speech integration",
|
|
44
|
+
"COMMUNICATION",
|
|
45
|
+
"ACTIVE"
|
|
46
|
+
]);
|
|
47
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
48
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
49
|
+
"int_5",
|
|
50
|
+
projectId,
|
|
51
|
+
"org_demo",
|
|
52
|
+
"PostHog Analytics",
|
|
53
|
+
"Product analytics and event capture",
|
|
54
|
+
"ANALYTICS",
|
|
55
|
+
"ACTIVE"
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
seedIntegrationHub
|
|
60
|
+
};
|