@contractspec/example.integration-hub 3.8.9 → 3.8.10
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/connection/connection.enum.js +1 -29
- package/dist/connection/connection.operation.js +1 -124
- package/dist/connection/connection.presentation.js +1 -125
- package/dist/connection/connection.schema.js +1 -71
- package/dist/connection/index.js +1 -127
- package/dist/docs/index.js +5 -49
- package/dist/docs/integration-hub.docblock.js +5 -49
- package/dist/events.js +1 -211
- package/dist/example.js +1 -42
- package/dist/handlers/index.js +5 -292
- package/dist/handlers/integration.handlers.js +5 -292
- package/dist/index.js +8 -2355
- package/dist/integration/index.js +1 -92
- package/dist/integration/integration.enum.js +1 -12
- package/dist/integration/integration.operations.js +1 -89
- package/dist/integration/integration.presentation.js +1 -120
- package/dist/integration/integration.schema.js +1 -42
- package/dist/integration-hub.capability.js +1 -43
- package/dist/integration-hub.feature.js +1 -330
- package/dist/mcp-example.js +1 -154
- package/dist/node/connection/connection.enum.js +1 -29
- package/dist/node/connection/connection.operation.js +1 -124
- package/dist/node/connection/connection.presentation.js +1 -125
- package/dist/node/connection/connection.schema.js +1 -71
- package/dist/node/connection/index.js +1 -127
- package/dist/node/docs/index.js +5 -49
- package/dist/node/docs/integration-hub.docblock.js +5 -49
- package/dist/node/events.js +1 -211
- package/dist/node/example.js +1 -42
- package/dist/node/handlers/index.js +5 -292
- package/dist/node/handlers/integration.handlers.js +5 -292
- package/dist/node/index.js +8 -2355
- package/dist/node/integration/index.js +1 -92
- package/dist/node/integration/integration.enum.js +1 -12
- package/dist/node/integration/integration.operations.js +1 -89
- package/dist/node/integration/integration.presentation.js +1 -120
- package/dist/node/integration/integration.schema.js +1 -42
- package/dist/node/integration-hub.capability.js +1 -43
- package/dist/node/integration-hub.feature.js +1 -330
- package/dist/node/mcp-example.js +1 -154
- package/dist/node/run-mcp.js +1 -159
- package/dist/node/seeders/index.js +6 -60
- package/dist/node/sync/index.js +1 -332
- package/dist/node/sync/sync.enum.js +1 -26
- package/dist/node/sync/sync.operations.js +1 -321
- package/dist/node/sync/sync.presentation.js +1 -301
- package/dist/node/sync/sync.schema.js +1 -154
- package/dist/node/sync-engine/index.js +1 -186
- package/dist/node/tests/operations.test-spec.js +1 -85
- package/dist/node/ui/IntegrationDashboard.js +1 -886
- package/dist/node/ui/IntegrationDashboard.visualizations.js +1 -250
- package/dist/node/ui/IntegrationHubChat.js +1 -34
- package/dist/node/ui/hooks/index.js +1 -57
- package/dist/node/ui/hooks/useIntegrationData.js +1 -54
- package/dist/node/ui/index.js +4 -1173
- package/dist/node/ui/renderers/index.js +4 -484
- package/dist/node/ui/renderers/integration.markdown.js +4 -484
- package/dist/node/ui/tables/ConnectionsTable.js +1 -211
- package/dist/node/ui/tables/IntegrationTables.js +1 -361
- package/dist/node/ui/tables/SyncConfigsTable.js +1 -230
- package/dist/node/ui/tables/integration-table.shared.js +1 -84
- package/dist/node/visualizations/catalog.js +1 -137
- package/dist/node/visualizations/index.js +1 -211
- package/dist/node/visualizations/selectors.js +1 -204
- package/dist/run-mcp.js +1 -159
- package/dist/seeders/index.js +6 -60
- package/dist/sync/index.js +1 -332
- package/dist/sync/sync.enum.js +1 -26
- package/dist/sync/sync.operations.js +1 -321
- package/dist/sync/sync.presentation.js +1 -301
- package/dist/sync/sync.schema.js +1 -154
- package/dist/sync-engine/index.js +1 -186
- package/dist/tests/operations.test-spec.js +1 -85
- package/dist/ui/IntegrationDashboard.js +1 -886
- package/dist/ui/IntegrationDashboard.visualizations.js +1 -250
- package/dist/ui/IntegrationHubChat.js +1 -34
- package/dist/ui/hooks/index.js +1 -57
- package/dist/ui/hooks/useIntegrationData.js +1 -54
- package/dist/ui/index.js +4 -1173
- package/dist/ui/renderers/index.js +4 -484
- package/dist/ui/renderers/integration.markdown.js +4 -484
- package/dist/ui/tables/ConnectionsTable.js +1 -211
- package/dist/ui/tables/IntegrationTables.js +1 -361
- package/dist/ui/tables/SyncConfigsTable.js +1 -230
- package/dist/ui/tables/integration-table.shared.js +1 -84
- package/dist/visualizations/catalog.js +1 -137
- package/dist/visualizations/index.js +1 -211
- package/dist/visualizations/selectors.js +1 -204
- package/package.json +11 -11
|
@@ -1,231 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { Button } from "@contractspec/lib.design-system";
|
|
4
|
-
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
5
|
-
import { HStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
6
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
7
|
-
"use client";
|
|
8
|
-
var STATUS_VARIANTS = {
|
|
9
|
-
ACTIVE: "default",
|
|
10
|
-
CONNECTED: "default",
|
|
11
|
-
SUCCESS: "default",
|
|
12
|
-
PENDING: "secondary",
|
|
13
|
-
PAUSED: "secondary",
|
|
14
|
-
ERROR: "destructive",
|
|
15
|
-
DISCONNECTED: "outline"
|
|
16
|
-
};
|
|
17
|
-
function formatDateTime(value) {
|
|
18
|
-
return value ? value.toLocaleString() : "Never";
|
|
19
|
-
}
|
|
20
|
-
function formatJson(value) {
|
|
21
|
-
return value ? JSON.stringify(value, null, 2) : "No configuration";
|
|
22
|
-
}
|
|
23
|
-
function StatusBadge({ status }) {
|
|
24
|
-
return /* @__PURE__ */ jsxDEV(Badge, {
|
|
25
|
-
variant: STATUS_VARIANTS[status] ?? "outline",
|
|
26
|
-
children: status
|
|
27
|
-
}, undefined, false, undefined, this);
|
|
28
|
-
}
|
|
29
|
-
function IntegrationTableToolbar({
|
|
30
|
-
controller,
|
|
31
|
-
label,
|
|
32
|
-
toggleColumnId,
|
|
33
|
-
toggleVisibleLabel,
|
|
34
|
-
toggleHiddenLabel,
|
|
35
|
-
pinColumnId,
|
|
36
|
-
pinLabel,
|
|
37
|
-
resizeColumnId,
|
|
38
|
-
resizeLabel
|
|
39
|
-
}) {
|
|
40
|
-
const firstRow = controller.rows[0];
|
|
41
|
-
const toggleColumn = controller.columns.find((column) => column.id === toggleColumnId);
|
|
42
|
-
const pinColumn = controller.columns.find((column) => column.id === pinColumnId);
|
|
43
|
-
const resizeColumn = controller.columns.find((column) => column.id === resizeColumnId);
|
|
44
|
-
const pinTarget = pinColumn?.pinState === "left" ? false : "left";
|
|
45
|
-
return /* @__PURE__ */ jsxDEV(HStack, {
|
|
46
|
-
gap: "sm",
|
|
47
|
-
className: "flex-wrap",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsxDEV(Badge, {
|
|
50
|
-
variant: "outline",
|
|
51
|
-
children: label
|
|
52
|
-
}, undefined, false, undefined, this),
|
|
53
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
54
|
-
variant: "outline",
|
|
55
|
-
size: "sm",
|
|
56
|
-
onPress: () => firstRow?.toggleExpanded?.(!firstRow?.isExpanded),
|
|
57
|
-
children: "Expand First Row"
|
|
58
|
-
}, undefined, false, undefined, this),
|
|
59
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
60
|
-
variant: "outline",
|
|
61
|
-
size: "sm",
|
|
62
|
-
onPress: () => toggleColumn?.toggleVisibility?.(!toggleColumn?.visible),
|
|
63
|
-
children: toggleColumn?.visible ? toggleVisibleLabel : toggleHiddenLabel
|
|
64
|
-
}, undefined, false, undefined, this),
|
|
65
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
66
|
-
variant: "outline",
|
|
67
|
-
size: "sm",
|
|
68
|
-
onPress: () => pinColumn?.pin?.(pinTarget),
|
|
69
|
-
children: pinColumn?.pinState === "left" ? `Unpin ${pinLabel}` : `Pin ${pinLabel}`
|
|
70
|
-
}, undefined, false, undefined, this),
|
|
71
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
72
|
-
variant: "outline",
|
|
73
|
-
size: "sm",
|
|
74
|
-
onPress: () => resizeColumn?.resizeBy?.(40),
|
|
75
|
-
children: resizeLabel
|
|
76
|
-
}, undefined, false, undefined, this)
|
|
77
|
-
]
|
|
78
|
-
}, undefined, true, undefined, this);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// src/ui/tables/SyncConfigsTable.tsx
|
|
82
|
-
import { DataTable } from "@contractspec/lib.design-system";
|
|
83
|
-
import { useContractTable } from "@contractspec/lib.presentation-runtime-react";
|
|
84
|
-
import { VStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
85
|
-
import { Text } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
86
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
87
|
-
"use client";
|
|
88
|
-
function SyncConfigsTable({
|
|
89
|
-
syncConfigs
|
|
90
|
-
}) {
|
|
91
|
-
const controller = useContractTable({
|
|
92
|
-
data: syncConfigs,
|
|
93
|
-
columns: [
|
|
94
|
-
{
|
|
95
|
-
id: "sync",
|
|
96
|
-
header: "Sync Config",
|
|
97
|
-
label: "Sync Config",
|
|
98
|
-
accessor: (sync) => sync.name,
|
|
99
|
-
cell: ({ item }) => /* @__PURE__ */ jsxDEV2(VStack, {
|
|
100
|
-
gap: "xs",
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
103
|
-
className: "font-medium text-sm",
|
|
104
|
-
children: item.name
|
|
105
|
-
}, undefined, false, undefined, this),
|
|
106
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
107
|
-
className: "text-muted-foreground text-xs",
|
|
108
|
-
children: [
|
|
109
|
-
item.sourceEntity,
|
|
110
|
-
" \u2192 ",
|
|
111
|
-
item.targetEntity
|
|
112
|
-
]
|
|
113
|
-
}, undefined, true, undefined, this)
|
|
114
|
-
]
|
|
115
|
-
}, undefined, true, undefined, this),
|
|
116
|
-
size: 260,
|
|
117
|
-
minSize: 200,
|
|
118
|
-
canSort: true,
|
|
119
|
-
canPin: true,
|
|
120
|
-
canResize: true
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
id: "frequency",
|
|
124
|
-
header: "Frequency",
|
|
125
|
-
label: "Frequency",
|
|
126
|
-
accessorKey: "frequency",
|
|
127
|
-
size: 160,
|
|
128
|
-
canSort: true,
|
|
129
|
-
canHide: true,
|
|
130
|
-
canResize: true
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: "status",
|
|
134
|
-
header: "Status",
|
|
135
|
-
label: "Status",
|
|
136
|
-
accessorKey: "status",
|
|
137
|
-
cell: ({ value }) => /* @__PURE__ */ jsxDEV2(StatusBadge, {
|
|
138
|
-
status: String(value)
|
|
139
|
-
}, undefined, false, undefined, this),
|
|
140
|
-
size: 150,
|
|
141
|
-
canSort: true,
|
|
142
|
-
canPin: true,
|
|
143
|
-
canResize: true
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: "recordsSynced",
|
|
147
|
-
header: "Records",
|
|
148
|
-
label: "Records",
|
|
149
|
-
accessorKey: "recordsSynced",
|
|
150
|
-
align: "right",
|
|
151
|
-
size: 140,
|
|
152
|
-
canSort: true,
|
|
153
|
-
canResize: true
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: "lastRunAt",
|
|
157
|
-
header: "Last Run",
|
|
158
|
-
label: "Last Run",
|
|
159
|
-
accessor: (sync) => sync.lastRunAt?.getTime() ?? 0,
|
|
160
|
-
cell: ({ item }) => formatDateTime(item.lastRunAt),
|
|
161
|
-
size: 200,
|
|
162
|
-
canSort: true,
|
|
163
|
-
canHide: true,
|
|
164
|
-
canResize: true
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
initialState: {
|
|
168
|
-
pagination: { pageIndex: 0, pageSize: 3 },
|
|
169
|
-
columnVisibility: { lastRunAt: false },
|
|
170
|
-
columnPinning: { left: ["sync"], right: [] }
|
|
171
|
-
},
|
|
172
|
-
renderExpandedContent: (sync) => /* @__PURE__ */ jsxDEV2(VStack, {
|
|
173
|
-
gap: "sm",
|
|
174
|
-
className: "py-2",
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
177
|
-
className: "text-muted-foreground text-sm",
|
|
178
|
-
children: [
|
|
179
|
-
"Connection ",
|
|
180
|
-
sync.connectionId
|
|
181
|
-
]
|
|
182
|
-
}, undefined, true, undefined, this),
|
|
183
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
184
|
-
className: "text-muted-foreground text-sm",
|
|
185
|
-
children: [
|
|
186
|
-
"Last run: ",
|
|
187
|
-
formatDateTime(sync.lastRunAt)
|
|
188
|
-
]
|
|
189
|
-
}, undefined, true, undefined, this),
|
|
190
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
191
|
-
className: "text-muted-foreground text-sm",
|
|
192
|
-
children: [
|
|
193
|
-
"Last status: ",
|
|
194
|
-
sync.lastRunStatus ?? "No runs recorded"
|
|
195
|
-
]
|
|
196
|
-
}, undefined, true, undefined, this),
|
|
197
|
-
/* @__PURE__ */ jsxDEV2(Text, {
|
|
198
|
-
className: "text-muted-foreground text-sm",
|
|
199
|
-
children: [
|
|
200
|
-
"Updated ",
|
|
201
|
-
sync.updatedAt.toLocaleString()
|
|
202
|
-
]
|
|
203
|
-
}, undefined, true, undefined, this)
|
|
204
|
-
]
|
|
205
|
-
}, undefined, true, undefined, this),
|
|
206
|
-
getCanExpand: () => true
|
|
207
|
-
});
|
|
208
|
-
return /* @__PURE__ */ jsxDEV2(DataTable, {
|
|
209
|
-
controller,
|
|
210
|
-
title: "Sync Configs",
|
|
211
|
-
description: "Shared table primitives applied to sync monitoring without changing the surrounding dashboard layout.",
|
|
212
|
-
toolbar: /* @__PURE__ */ jsxDEV2(IntegrationTableToolbar, {
|
|
213
|
-
controller,
|
|
214
|
-
label: `${syncConfigs.length} syncs`,
|
|
215
|
-
toggleColumnId: "lastRunAt",
|
|
216
|
-
toggleVisibleLabel: "Hide Last Run",
|
|
217
|
-
toggleHiddenLabel: "Show Last Run",
|
|
218
|
-
pinColumnId: "status",
|
|
219
|
-
pinLabel: "Status",
|
|
220
|
-
resizeColumnId: "sync",
|
|
221
|
-
resizeLabel: "Widen Sync"
|
|
222
|
-
}, undefined, false, undefined, this),
|
|
223
|
-
emptyState: /* @__PURE__ */ jsxDEV2("div", {
|
|
224
|
-
className: "rounded-md border border-dashed p-8 text-center text-muted-foreground text-sm",
|
|
225
|
-
children: "No sync configurations found"
|
|
226
|
-
}, undefined, false, undefined, this)
|
|
227
|
-
}, undefined, false, undefined, this);
|
|
228
|
-
}
|
|
229
|
-
export {
|
|
230
|
-
SyncConfigsTable
|
|
231
|
-
};
|
|
2
|
+
import{Button as P}from"@contractspec/lib.design-system";import{Badge as $}from"@contractspec/lib.ui-kit-web/ui/badge";import{HStack as V}from"@contractspec/lib.ui-kit-web/ui/stack";import{jsx as G,jsxs as B}from"react/jsx-runtime";var k={ACTIVE:"default",CONNECTED:"default",SUCCESS:"default",PENDING:"secondary",PAUSED:"secondary",ERROR:"destructive",DISCONNECTED:"outline"};function X(E){return E?E.toLocaleString():"Never"}function p(E){return E?JSON.stringify(E,null,2):"No configuration"}function h({status:E}){return G($,{variant:k[E]??"outline",children:E})}function N({controller:E,label:O,toggleColumnId:q,toggleVisibleLabel:_,toggleHiddenLabel:A,pinColumnId:D,pinLabel:Y,resizeColumnId:H,resizeLabel:R}){let Z=E.rows[0],Q=E.columns.find((K)=>K.id===q),W=E.columns.find((K)=>K.id===D),w=E.columns.find((K)=>K.id===H),z=W?.pinState==="left"?!1:"left";return B(V,{gap:"sm",className:"flex-wrap",children:[G($,{variant:"outline",children:O}),G(P,{variant:"outline",size:"sm",onPress:()=>Z?.toggleExpanded?.(!Z?.isExpanded),children:"Expand First Row"}),G(P,{variant:"outline",size:"sm",onPress:()=>Q?.toggleVisibility?.(!Q?.visible),children:Q?.visible?_:A}),G(P,{variant:"outline",size:"sm",onPress:()=>W?.pin?.(z),children:W?.pinState==="left"?`Unpin ${Y}`:`Pin ${Y}`}),G(P,{variant:"outline",size:"sm",onPress:()=>w?.resizeBy?.(40),children:R})]})}import{DataTable as S}from"@contractspec/lib.design-system";import{useContractTable as f}from"@contractspec/lib.presentation-runtime-react";import{VStack as U}from"@contractspec/lib.ui-kit-web/ui/stack";import{Text as J}from"@contractspec/lib.ui-kit-web/ui/text";import{jsx as M,jsxs as F}from"react/jsx-runtime";function x({syncConfigs:E}){let O=f({data:E,columns:[{id:"sync",header:"Sync Config",label:"Sync Config",accessor:(q)=>q.name,cell:({item:q})=>F(U,{gap:"xs",children:[M(J,{className:"font-medium text-sm",children:q.name}),F(J,{className:"text-muted-foreground text-xs",children:[q.sourceEntity," \u2192 ",q.targetEntity]})]}),size:260,minSize:200,canSort:!0,canPin:!0,canResize:!0},{id:"frequency",header:"Frequency",label:"Frequency",accessorKey:"frequency",size:160,canSort:!0,canHide:!0,canResize:!0},{id:"status",header:"Status",label:"Status",accessorKey:"status",cell:({value:q})=>M(h,{status:String(q)}),size:150,canSort:!0,canPin:!0,canResize:!0},{id:"recordsSynced",header:"Records",label:"Records",accessorKey:"recordsSynced",align:"right",size:140,canSort:!0,canResize:!0},{id:"lastRunAt",header:"Last Run",label:"Last Run",accessor:(q)=>q.lastRunAt?.getTime()??0,cell:({item:q})=>X(q.lastRunAt),size:200,canSort:!0,canHide:!0,canResize:!0}],initialState:{pagination:{pageIndex:0,pageSize:3},columnVisibility:{lastRunAt:!1},columnPinning:{left:["sync"],right:[]}},renderExpandedContent:(q)=>F(U,{gap:"sm",className:"py-2",children:[F(J,{className:"text-muted-foreground text-sm",children:["Connection ",q.connectionId]}),F(J,{className:"text-muted-foreground text-sm",children:["Last run: ",X(q.lastRunAt)]}),F(J,{className:"text-muted-foreground text-sm",children:["Last status: ",q.lastRunStatus??"No runs recorded"]}),F(J,{className:"text-muted-foreground text-sm",children:["Updated ",q.updatedAt.toLocaleString()]})]}),getCanExpand:()=>!0});return M(S,{controller:O,title:"Sync Configs",description:"Shared table primitives applied to sync monitoring without changing the surrounding dashboard layout.",toolbar:M(N,{controller:O,label:`${E.length} syncs`,toggleColumnId:"lastRunAt",toggleVisibleLabel:"Hide Last Run",toggleHiddenLabel:"Show Last Run",pinColumnId:"status",pinLabel:"Status",resizeColumnId:"sync",resizeLabel:"Widen Sync"}),emptyState:M("div",{className:"rounded-md border border-dashed p-8 text-center text-muted-foreground text-sm",children:"No sync configurations found"})})}export{x as SyncConfigsTable};
|
|
@@ -1,85 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { Button } from "@contractspec/lib.design-system";
|
|
4
|
-
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
5
|
-
import { HStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
6
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
7
|
-
"use client";
|
|
8
|
-
var STATUS_VARIANTS = {
|
|
9
|
-
ACTIVE: "default",
|
|
10
|
-
CONNECTED: "default",
|
|
11
|
-
SUCCESS: "default",
|
|
12
|
-
PENDING: "secondary",
|
|
13
|
-
PAUSED: "secondary",
|
|
14
|
-
ERROR: "destructive",
|
|
15
|
-
DISCONNECTED: "outline"
|
|
16
|
-
};
|
|
17
|
-
function formatDateTime(value) {
|
|
18
|
-
return value ? value.toLocaleString() : "Never";
|
|
19
|
-
}
|
|
20
|
-
function formatJson(value) {
|
|
21
|
-
return value ? JSON.stringify(value, null, 2) : "No configuration";
|
|
22
|
-
}
|
|
23
|
-
function StatusBadge({ status }) {
|
|
24
|
-
return /* @__PURE__ */ jsxDEV(Badge, {
|
|
25
|
-
variant: STATUS_VARIANTS[status] ?? "outline",
|
|
26
|
-
children: status
|
|
27
|
-
}, undefined, false, undefined, this);
|
|
28
|
-
}
|
|
29
|
-
function IntegrationTableToolbar({
|
|
30
|
-
controller,
|
|
31
|
-
label,
|
|
32
|
-
toggleColumnId,
|
|
33
|
-
toggleVisibleLabel,
|
|
34
|
-
toggleHiddenLabel,
|
|
35
|
-
pinColumnId,
|
|
36
|
-
pinLabel,
|
|
37
|
-
resizeColumnId,
|
|
38
|
-
resizeLabel
|
|
39
|
-
}) {
|
|
40
|
-
const firstRow = controller.rows[0];
|
|
41
|
-
const toggleColumn = controller.columns.find((column) => column.id === toggleColumnId);
|
|
42
|
-
const pinColumn = controller.columns.find((column) => column.id === pinColumnId);
|
|
43
|
-
const resizeColumn = controller.columns.find((column) => column.id === resizeColumnId);
|
|
44
|
-
const pinTarget = pinColumn?.pinState === "left" ? false : "left";
|
|
45
|
-
return /* @__PURE__ */ jsxDEV(HStack, {
|
|
46
|
-
gap: "sm",
|
|
47
|
-
className: "flex-wrap",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsxDEV(Badge, {
|
|
50
|
-
variant: "outline",
|
|
51
|
-
children: label
|
|
52
|
-
}, undefined, false, undefined, this),
|
|
53
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
54
|
-
variant: "outline",
|
|
55
|
-
size: "sm",
|
|
56
|
-
onPress: () => firstRow?.toggleExpanded?.(!firstRow?.isExpanded),
|
|
57
|
-
children: "Expand First Row"
|
|
58
|
-
}, undefined, false, undefined, this),
|
|
59
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
60
|
-
variant: "outline",
|
|
61
|
-
size: "sm",
|
|
62
|
-
onPress: () => toggleColumn?.toggleVisibility?.(!toggleColumn?.visible),
|
|
63
|
-
children: toggleColumn?.visible ? toggleVisibleLabel : toggleHiddenLabel
|
|
64
|
-
}, undefined, false, undefined, this),
|
|
65
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
66
|
-
variant: "outline",
|
|
67
|
-
size: "sm",
|
|
68
|
-
onPress: () => pinColumn?.pin?.(pinTarget),
|
|
69
|
-
children: pinColumn?.pinState === "left" ? `Unpin ${pinLabel}` : `Pin ${pinLabel}`
|
|
70
|
-
}, undefined, false, undefined, this),
|
|
71
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
72
|
-
variant: "outline",
|
|
73
|
-
size: "sm",
|
|
74
|
-
onPress: () => resizeColumn?.resizeBy?.(40),
|
|
75
|
-
children: resizeLabel
|
|
76
|
-
}, undefined, false, undefined, this)
|
|
77
|
-
]
|
|
78
|
-
}, undefined, true, undefined, this);
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
formatJson,
|
|
82
|
-
formatDateTime,
|
|
83
|
-
StatusBadge,
|
|
84
|
-
IntegrationTableToolbar
|
|
85
|
-
};
|
|
2
|
+
import{Button as D}from"@contractspec/lib.design-system";import{Badge as K}from"@contractspec/lib.ui-kit-web/ui/badge";import{HStack as N}from"@contractspec/lib.ui-kit-web/ui/stack";import{jsx as q,jsxs as _}from"react/jsx-runtime";var U={ACTIVE:"default",CONNECTED:"default",SUCCESS:"default",PENDING:"secondary",PAUSED:"secondary",ERROR:"destructive",DISCONNECTED:"outline"};function A(h){return h?h.toLocaleString():"Never"}function H(h){return h?JSON.stringify(h,null,2):"No configuration"}function R({status:h}){return q(K,{variant:U[h]??"outline",children:h})}function V({controller:h,label:M,toggleColumnId:O,toggleVisibleLabel:P,toggleHiddenLabel:Q,pinColumnId:W,pinLabel:G,resizeColumnId:X,resizeLabel:Y}){let J=h.rows[0],E=h.columns.find((y)=>y.id===O),F=h.columns.find((y)=>y.id===W),Z=h.columns.find((y)=>y.id===X),$=F?.pinState==="left"?!1:"left";return _(N,{gap:"sm",className:"flex-wrap",children:[q(K,{variant:"outline",children:M}),q(D,{variant:"outline",size:"sm",onPress:()=>J?.toggleExpanded?.(!J?.isExpanded),children:"Expand First Row"}),q(D,{variant:"outline",size:"sm",onPress:()=>E?.toggleVisibility?.(!E?.visible),children:E?.visible?P:Q}),q(D,{variant:"outline",size:"sm",onPress:()=>F?.pin?.($),children:F?.pinState==="left"?`Unpin ${G}`:`Pin ${G}`}),q(D,{variant:"outline",size:"sm",onPress:()=>Z?.resizeBy?.(40),children:Y})]})}export{H as formatJson,A as formatDateTime,R as StatusBadge,V as IntegrationTableToolbar};
|
|
@@ -1,138 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
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
|
-
export {
|
|
131
|
-
IntegrationVisualizationSpecs,
|
|
132
|
-
IntegrationVisualizationRegistry,
|
|
133
|
-
IntegrationVisualizationRefs,
|
|
134
|
-
IntegrationTypeVisualization,
|
|
135
|
-
HealthySyncMetricVisualization,
|
|
136
|
-
ConnectionStatusVisualization,
|
|
137
|
-
AttentionSyncMetricVisualization
|
|
138
|
-
};
|
|
2
|
+
import{defineVisualization as b,VisualizationRegistry as v}from"@contractspec/lib.contracts-spec/visualizations";var w={key:"integration.list",version:"1.0.0"},x={key:"integration.connection.list",version:"1.0.0"},m={key:"integration.syncConfig.list",version:"1.0.0"},j={version:"1.0.0",domain:"integration",stability:"experimental",owners:["@example.integration-hub"],tags:["integration","visualization","sync"]},B=b({meta:{...j,key:"integration-hub.visualization.integration-types",title:"Integration Types",description:"Distribution of configured integration categories.",goal:"Show where integration coverage is concentrated.",context:"Integration overview."},source:{primary:w,resultPath:"data"},visualization:{kind:"pie",nameDimension:"type",valueMeasure:"count",dimensions:[{key:"type",label:"Type",dataPath:"type",type:"category"}],measures:[{key:"count",label:"Count",dataPath:"count",format:"number"}],table:{caption:"Integration counts by type."}}}),D=b({meta:{...j,key:"integration-hub.visualization.connection-status",title:"Connection Status",description:"Status distribution across configured connections.",goal:"Highlight connection health and instability.",context:"Connection monitoring."},source:{primary:x,resultPath:"data"},visualization:{kind:"cartesian",variant:"bar",xDimension:"status",yMeasures:["count"],dimensions:[{key:"status",label:"Status",dataPath:"status",type:"category"}],measures:[{key:"count",label:"Connections",dataPath:"count",format:"number",color:"#1d4ed8"}],table:{caption:"Connection counts by status."}}}),J=b({meta:{...j,key:"integration-hub.visualization.sync-healthy",title:"Healthy Syncs",description:"Sync configurations currently healthy or recently successful.",goal:"Summarize healthy synchronization capacity.",context:"Sync-state comparison."},source:{primary:m,resultPath:"data"},visualization:{kind:"metric",measure:"value",measures:[{key:"value",label:"Syncs",dataPath:"value",format:"number"}],table:{caption:"Healthy sync count."}}}),K=b({meta:{...j,key:"integration-hub.visualization.sync-attention",title:"Attention Needed",description:"Sync configurations paused, failing, or otherwise needing review.",goal:"Summarize syncs needing action.",context:"Sync-state comparison."},source:{primary:m,resultPath:"data"},visualization:{kind:"metric",measure:"value",measures:[{key:"value",label:"Syncs",dataPath:"value",format:"number"}],table:{caption:"Syncs requiring attention."}}}),q=[B,D,J,K],Q=new v([...q]),U=q.map((k)=>({key:k.meta.key,version:k.meta.version}));export{q as IntegrationVisualizationSpecs,Q as IntegrationVisualizationRegistry,U as IntegrationVisualizationRefs,B as IntegrationTypeVisualization,J as HealthySyncMetricVisualization,D as ConnectionStatusVisualization,K as AttentionSyncMetricVisualization};
|