@contractspec/example.integration-hub 3.7.6 → 3.8.2
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 +73 -183
- package/dist/connection/index.d.ts +1 -1
- package/dist/docs/index.js +2 -1
- package/dist/docs/integration-hub.docblock.js +2 -1
- package/dist/events.js +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1243 -749
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration-hub.feature.js +202 -0
- package/dist/node/docs/index.js +2 -1
- package/dist/node/docs/integration-hub.docblock.js +2 -1
- package/dist/node/events.js +1 -1
- package/dist/node/index.js +1243 -749
- package/dist/node/integration-hub.feature.js +202 -0
- package/dist/node/ui/IntegrationDashboard.js +654 -180
- package/dist/node/ui/IntegrationDashboard.visualizations.js +250 -0
- package/dist/node/ui/hooks/index.js +1 -1
- package/dist/node/ui/hooks/useIntegrationData.js +1 -1
- package/dist/node/ui/index.js +970 -485
- package/dist/node/ui/renderers/index.js +216 -5
- package/dist/node/ui/renderers/integration.markdown.js +216 -5
- package/dist/node/ui/tables/ConnectionsTable.js +211 -0
- package/dist/node/ui/tables/IntegrationTables.js +361 -0
- package/dist/node/ui/tables/SyncConfigsTable.js +230 -0
- package/dist/node/ui/tables/integration-table.shared.js +84 -0
- package/dist/node/visualizations/catalog.js +137 -0
- package/dist/node/visualizations/index.js +211 -0
- package/dist/node/visualizations/selectors.js +204 -0
- package/dist/sync/index.d.ts +3 -3
- package/dist/ui/IntegrationDashboard.js +654 -180
- package/dist/ui/IntegrationDashboard.visualizations.d.ts +6 -0
- package/dist/ui/IntegrationDashboard.visualizations.js +251 -0
- package/dist/ui/hooks/index.d.ts +1 -1
- package/dist/ui/hooks/index.js +1 -1
- package/dist/ui/hooks/useIntegrationData.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +970 -485
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +216 -5
- package/dist/ui/renderers/integration.markdown.js +216 -5
- package/dist/ui/tables/ConnectionsTable.d.ts +4 -0
- package/dist/ui/tables/ConnectionsTable.js +212 -0
- package/dist/ui/tables/IntegrationTables.d.ts +2 -0
- package/dist/ui/tables/IntegrationTables.js +362 -0
- package/dist/ui/tables/IntegrationTables.smoke.test.d.ts +1 -0
- package/dist/ui/tables/SyncConfigsTable.d.ts +4 -0
- package/dist/ui/tables/SyncConfigsTable.js +231 -0
- package/dist/ui/tables/integration-table.shared.d.ts +18 -0
- package/dist/ui/tables/integration-table.shared.js +85 -0
- package/dist/visualizations/catalog.d.ts +11 -0
- package/dist/visualizations/catalog.js +138 -0
- package/dist/visualizations/index.d.ts +2 -0
- package/dist/visualizations/index.js +212 -0
- package/dist/visualizations/selectors.d.ts +10 -0
- package/dist/visualizations/selectors.js +205 -0
- package/dist/visualizations/selectors.test.d.ts +1 -0
- package/package.json +110 -12
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Integration domain - Integration management.
|
|
3
3
|
*/
|
|
4
4
|
export { IntegrationStatusEnum } from './integration.enum';
|
|
5
|
-
export { IntegrationModel, CreateIntegrationInputModel, } from './integration.schema';
|
|
6
5
|
export { CreateIntegrationContract } from './integration.operations';
|
|
6
|
+
export { CreateIntegrationInputModel, IntegrationModel, } from './integration.schema';
|
|
@@ -1,4 +1,205 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
// src/visualizations/catalog.ts
|
|
3
|
+
import {
|
|
4
|
+
defineVisualization,
|
|
5
|
+
VisualizationRegistry
|
|
6
|
+
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
7
|
+
var INTEGRATION_LIST_REF = {
|
|
8
|
+
key: "integration.list",
|
|
9
|
+
version: "1.0.0"
|
|
10
|
+
};
|
|
11
|
+
var CONNECTION_LIST_REF = {
|
|
12
|
+
key: "integration.connection.list",
|
|
13
|
+
version: "1.0.0"
|
|
14
|
+
};
|
|
15
|
+
var SYNC_CONFIG_REF = {
|
|
16
|
+
key: "integration.syncConfig.list",
|
|
17
|
+
version: "1.0.0"
|
|
18
|
+
};
|
|
19
|
+
var META = {
|
|
20
|
+
version: "1.0.0",
|
|
21
|
+
domain: "integration",
|
|
22
|
+
stability: "experimental",
|
|
23
|
+
owners: ["@example.integration-hub"],
|
|
24
|
+
tags: ["integration", "visualization", "sync"]
|
|
25
|
+
};
|
|
26
|
+
var IntegrationTypeVisualization = defineVisualization({
|
|
27
|
+
meta: {
|
|
28
|
+
...META,
|
|
29
|
+
key: "integration-hub.visualization.integration-types",
|
|
30
|
+
title: "Integration Types",
|
|
31
|
+
description: "Distribution of configured integration categories.",
|
|
32
|
+
goal: "Show where integration coverage is concentrated.",
|
|
33
|
+
context: "Integration overview."
|
|
34
|
+
},
|
|
35
|
+
source: { primary: INTEGRATION_LIST_REF, resultPath: "data" },
|
|
36
|
+
visualization: {
|
|
37
|
+
kind: "pie",
|
|
38
|
+
nameDimension: "type",
|
|
39
|
+
valueMeasure: "count",
|
|
40
|
+
dimensions: [
|
|
41
|
+
{ key: "type", label: "Type", dataPath: "type", type: "category" }
|
|
42
|
+
],
|
|
43
|
+
measures: [
|
|
44
|
+
{ key: "count", label: "Count", dataPath: "count", format: "number" }
|
|
45
|
+
],
|
|
46
|
+
table: { caption: "Integration counts by type." }
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var ConnectionStatusVisualization = defineVisualization({
|
|
50
|
+
meta: {
|
|
51
|
+
...META,
|
|
52
|
+
key: "integration-hub.visualization.connection-status",
|
|
53
|
+
title: "Connection Status",
|
|
54
|
+
description: "Status distribution across configured connections.",
|
|
55
|
+
goal: "Highlight connection health and instability.",
|
|
56
|
+
context: "Connection monitoring."
|
|
57
|
+
},
|
|
58
|
+
source: { primary: CONNECTION_LIST_REF, resultPath: "data" },
|
|
59
|
+
visualization: {
|
|
60
|
+
kind: "cartesian",
|
|
61
|
+
variant: "bar",
|
|
62
|
+
xDimension: "status",
|
|
63
|
+
yMeasures: ["count"],
|
|
64
|
+
dimensions: [
|
|
65
|
+
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
66
|
+
],
|
|
67
|
+
measures: [
|
|
68
|
+
{
|
|
69
|
+
key: "count",
|
|
70
|
+
label: "Connections",
|
|
71
|
+
dataPath: "count",
|
|
72
|
+
format: "number",
|
|
73
|
+
color: "#1d4ed8"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
table: { caption: "Connection counts by status." }
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var HealthySyncMetricVisualization = defineVisualization({
|
|
80
|
+
meta: {
|
|
81
|
+
...META,
|
|
82
|
+
key: "integration-hub.visualization.sync-healthy",
|
|
83
|
+
title: "Healthy Syncs",
|
|
84
|
+
description: "Sync configurations currently healthy or recently successful.",
|
|
85
|
+
goal: "Summarize healthy synchronization capacity.",
|
|
86
|
+
context: "Sync-state comparison."
|
|
87
|
+
},
|
|
88
|
+
source: { primary: SYNC_CONFIG_REF, resultPath: "data" },
|
|
89
|
+
visualization: {
|
|
90
|
+
kind: "metric",
|
|
91
|
+
measure: "value",
|
|
92
|
+
measures: [
|
|
93
|
+
{ key: "value", label: "Syncs", dataPath: "value", format: "number" }
|
|
94
|
+
],
|
|
95
|
+
table: { caption: "Healthy sync count." }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var AttentionSyncMetricVisualization = defineVisualization({
|
|
99
|
+
meta: {
|
|
100
|
+
...META,
|
|
101
|
+
key: "integration-hub.visualization.sync-attention",
|
|
102
|
+
title: "Attention Needed",
|
|
103
|
+
description: "Sync configurations paused, failing, or otherwise needing review.",
|
|
104
|
+
goal: "Summarize syncs needing action.",
|
|
105
|
+
context: "Sync-state comparison."
|
|
106
|
+
},
|
|
107
|
+
source: { primary: SYNC_CONFIG_REF, resultPath: "data" },
|
|
108
|
+
visualization: {
|
|
109
|
+
kind: "metric",
|
|
110
|
+
measure: "value",
|
|
111
|
+
measures: [
|
|
112
|
+
{ key: "value", label: "Syncs", dataPath: "value", format: "number" }
|
|
113
|
+
],
|
|
114
|
+
table: { caption: "Syncs requiring attention." }
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
var IntegrationVisualizationSpecs = [
|
|
118
|
+
IntegrationTypeVisualization,
|
|
119
|
+
ConnectionStatusVisualization,
|
|
120
|
+
HealthySyncMetricVisualization,
|
|
121
|
+
AttentionSyncMetricVisualization
|
|
122
|
+
];
|
|
123
|
+
var IntegrationVisualizationRegistry = new VisualizationRegistry([
|
|
124
|
+
...IntegrationVisualizationSpecs
|
|
125
|
+
]);
|
|
126
|
+
var IntegrationVisualizationRefs = IntegrationVisualizationSpecs.map((spec) => ({
|
|
127
|
+
key: spec.meta.key,
|
|
128
|
+
version: spec.meta.version
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
// src/visualizations/selectors.ts
|
|
132
|
+
function isHealthySync(status) {
|
|
133
|
+
return status === "ACTIVE" || status === "SUCCESS";
|
|
134
|
+
}
|
|
135
|
+
function createIntegrationVisualizationSections(integrations, connections, syncConfigs) {
|
|
136
|
+
const integrationTypes = new Map;
|
|
137
|
+
const connectionStatuses = new Map;
|
|
138
|
+
let healthySyncs = 0;
|
|
139
|
+
let attentionSyncs = 0;
|
|
140
|
+
for (const integration of integrations) {
|
|
141
|
+
integrationTypes.set(integration.type, (integrationTypes.get(integration.type) ?? 0) + 1);
|
|
142
|
+
}
|
|
143
|
+
for (const connection of connections) {
|
|
144
|
+
connectionStatuses.set(connection.status, (connectionStatuses.get(connection.status) ?? 0) + 1);
|
|
145
|
+
}
|
|
146
|
+
for (const syncConfig of syncConfigs) {
|
|
147
|
+
if (isHealthySync(syncConfig.status)) {
|
|
148
|
+
healthySyncs += 1;
|
|
149
|
+
} else {
|
|
150
|
+
attentionSyncs += 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const primaryItems = [
|
|
154
|
+
{
|
|
155
|
+
key: "integration-types",
|
|
156
|
+
spec: IntegrationTypeVisualization,
|
|
157
|
+
data: {
|
|
158
|
+
data: Array.from(integrationTypes.entries()).map(([type, count]) => ({
|
|
159
|
+
type,
|
|
160
|
+
count
|
|
161
|
+
}))
|
|
162
|
+
},
|
|
163
|
+
title: "Integration Types",
|
|
164
|
+
description: "Configured integrations grouped by category.",
|
|
165
|
+
height: 260
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: "connection-status",
|
|
169
|
+
spec: ConnectionStatusVisualization,
|
|
170
|
+
data: {
|
|
171
|
+
data: Array.from(connectionStatuses.entries()).map(([status, count]) => ({
|
|
172
|
+
status,
|
|
173
|
+
count
|
|
174
|
+
}))
|
|
175
|
+
},
|
|
176
|
+
title: "Connection Status",
|
|
177
|
+
description: "Operational health across current connections."
|
|
178
|
+
}
|
|
179
|
+
];
|
|
180
|
+
const comparisonItems = [
|
|
181
|
+
{
|
|
182
|
+
key: "healthy-syncs",
|
|
183
|
+
spec: HealthySyncMetricVisualization,
|
|
184
|
+
data: { data: [{ value: healthySyncs }] },
|
|
185
|
+
title: "Healthy Syncs",
|
|
186
|
+
description: "Active or recently successful sync configurations.",
|
|
187
|
+
height: 200
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "attention-syncs",
|
|
191
|
+
spec: AttentionSyncMetricVisualization,
|
|
192
|
+
data: { data: [{ value: attentionSyncs }] },
|
|
193
|
+
title: "Attention Needed",
|
|
194
|
+
description: "Paused, failed, or degraded sync configurations.",
|
|
195
|
+
height: 200
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
return {
|
|
199
|
+
primaryItems,
|
|
200
|
+
comparisonItems
|
|
201
|
+
};
|
|
202
|
+
}
|
|
2
203
|
// src/integration-hub.feature.ts
|
|
3
204
|
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
4
205
|
var IntegrationHubFeature = defineFeature({
|
|
@@ -95,6 +296,7 @@ var IntegrationHubFeature = defineFeature({
|
|
|
95
296
|
targets: ["react", "markdown"]
|
|
96
297
|
}
|
|
97
298
|
],
|
|
299
|
+
visualizations: IntegrationVisualizationRefs,
|
|
98
300
|
capabilities: {
|
|
99
301
|
requires: [
|
|
100
302
|
{ key: "identity", version: "1.0.0" },
|
package/dist/node/docs/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var integrationHubDocBlocks = [
|
|
|
26
26
|
|
|
27
27
|
## UI / Presentations
|
|
28
28
|
|
|
29
|
-
- Dashboard, integration list, connection detail, sync config editor.
|
|
29
|
+
- Dashboard, integration list, connection detail, sync config editor, and shared ContractSpec tables for connections/sync configs.
|
|
30
30
|
- Templates registered as \`integration-hub\` in Template Registry.
|
|
31
31
|
|
|
32
32
|
## Notes
|
|
@@ -34,6 +34,7 @@ var integrationHubDocBlocks = [
|
|
|
34
34
|
- Providers remain agnostic; keep mappings declarative for safe regeneration.
|
|
35
35
|
- Seed data includes voice integrations for \`ai-voice.gradium\` and \`ai-voice.fal\`.
|
|
36
36
|
- Feature flags can gate specific providers; metering can track sync volume.
|
|
37
|
+
- The dashboard tables demonstrate client-mode sorting, pagination, visibility, pinning, resizing, and row expansion on the shared table stack.
|
|
37
38
|
`
|
|
38
39
|
},
|
|
39
40
|
{
|
|
@@ -26,7 +26,7 @@ var integrationHubDocBlocks = [
|
|
|
26
26
|
|
|
27
27
|
## UI / Presentations
|
|
28
28
|
|
|
29
|
-
- Dashboard, integration list, connection detail, sync config editor.
|
|
29
|
+
- Dashboard, integration list, connection detail, sync config editor, and shared ContractSpec tables for connections/sync configs.
|
|
30
30
|
- Templates registered as \`integration-hub\` in Template Registry.
|
|
31
31
|
|
|
32
32
|
## Notes
|
|
@@ -34,6 +34,7 @@ var integrationHubDocBlocks = [
|
|
|
34
34
|
- Providers remain agnostic; keep mappings declarative for safe regeneration.
|
|
35
35
|
- Seed data includes voice integrations for \`ai-voice.gradium\` and \`ai-voice.fal\`.
|
|
36
36
|
- Feature flags can gate specific providers; metering can track sync volume.
|
|
37
|
+
- The dashboard tables demonstrate client-mode sorting, pagination, visibility, pinning, resizing, and row expansion on the shared table stack.
|
|
37
38
|
`
|
|
38
39
|
},
|
|
39
40
|
{
|
package/dist/node/events.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/events.ts
|
|
2
2
|
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
import {
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
4
|
var IntegrationCreatedPayload = defineSchemaModel({
|
|
5
5
|
name: "IntegrationCreatedPayload",
|
|
6
6
|
description: "Payload when an integration is created",
|