@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
|
@@ -1,270 +1,274 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/ui/renderers/integration.markdown.ts
|
|
3
|
+
var mockIntegrations = [
|
|
4
|
+
{
|
|
5
|
+
id: "int-1",
|
|
6
|
+
name: "Salesforce",
|
|
7
|
+
type: "CRM",
|
|
8
|
+
status: "ACTIVE",
|
|
9
|
+
connectionCount: 3
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "int-2",
|
|
13
|
+
name: "HubSpot",
|
|
14
|
+
type: "MARKETING",
|
|
15
|
+
status: "ACTIVE",
|
|
16
|
+
connectionCount: 2
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "int-3",
|
|
20
|
+
name: "Stripe",
|
|
21
|
+
type: "PAYMENT",
|
|
22
|
+
status: "ACTIVE",
|
|
23
|
+
connectionCount: 1
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "int-4",
|
|
27
|
+
name: "Slack",
|
|
28
|
+
type: "COMMUNICATION",
|
|
29
|
+
status: "INACTIVE",
|
|
30
|
+
connectionCount: 0
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "int-5",
|
|
34
|
+
name: "Google Sheets",
|
|
35
|
+
type: "DATA",
|
|
36
|
+
status: "ACTIVE",
|
|
37
|
+
connectionCount: 5
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "int-6",
|
|
41
|
+
name: "PostHog",
|
|
42
|
+
type: "ANALYTICS",
|
|
43
|
+
status: "ACTIVE",
|
|
44
|
+
connectionCount: 1
|
|
45
|
+
}
|
|
45
46
|
];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
47
|
+
var mockConnections = [
|
|
48
|
+
{
|
|
49
|
+
id: "conn-1",
|
|
50
|
+
integrationId: "int-1",
|
|
51
|
+
name: "Production Salesforce",
|
|
52
|
+
status: "CONNECTED",
|
|
53
|
+
lastSyncAt: "2024-01-16T10:00:00Z"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "conn-2",
|
|
57
|
+
integrationId: "int-1",
|
|
58
|
+
name: "Sandbox Salesforce",
|
|
59
|
+
status: "CONNECTED",
|
|
60
|
+
lastSyncAt: "2024-01-15T14:00:00Z"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "conn-3",
|
|
64
|
+
integrationId: "int-2",
|
|
65
|
+
name: "Marketing HubSpot",
|
|
66
|
+
status: "CONNECTED",
|
|
67
|
+
lastSyncAt: "2024-01-16T08:00:00Z"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "conn-4",
|
|
71
|
+
integrationId: "int-3",
|
|
72
|
+
name: "Stripe Live",
|
|
73
|
+
status: "CONNECTED",
|
|
74
|
+
lastSyncAt: "2024-01-16T12:00:00Z"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "conn-5",
|
|
78
|
+
integrationId: "int-5",
|
|
79
|
+
name: "Analytics Sheet",
|
|
80
|
+
status: "ERROR",
|
|
81
|
+
lastSyncAt: "2024-01-14T09:00:00Z",
|
|
82
|
+
error: "Authentication expired"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "conn-6",
|
|
86
|
+
integrationId: "int-6",
|
|
87
|
+
name: "PostHog Workspace",
|
|
88
|
+
status: "CONNECTED",
|
|
89
|
+
lastSyncAt: "2024-01-16T11:45:00Z"
|
|
90
|
+
}
|
|
90
91
|
];
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
92
|
+
var mockSyncConfigs = [
|
|
93
|
+
{
|
|
94
|
+
id: "sync-1",
|
|
95
|
+
connectionId: "conn-1",
|
|
96
|
+
name: "Contacts Sync",
|
|
97
|
+
frequency: "HOURLY",
|
|
98
|
+
lastRunAt: "2024-01-16T10:00:00Z",
|
|
99
|
+
status: "SUCCESS",
|
|
100
|
+
recordsSynced: 1250
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "sync-2",
|
|
104
|
+
connectionId: "conn-1",
|
|
105
|
+
name: "Opportunities Sync",
|
|
106
|
+
frequency: "DAILY",
|
|
107
|
+
lastRunAt: "2024-01-16T00:00:00Z",
|
|
108
|
+
status: "SUCCESS",
|
|
109
|
+
recordsSynced: 340
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "sync-3",
|
|
113
|
+
connectionId: "conn-3",
|
|
114
|
+
name: "Orders Sync",
|
|
115
|
+
frequency: "REALTIME",
|
|
116
|
+
lastRunAt: "2024-01-16T12:30:00Z",
|
|
117
|
+
status: "SUCCESS",
|
|
118
|
+
recordsSynced: 89
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "sync-4",
|
|
122
|
+
connectionId: "conn-5",
|
|
123
|
+
name: "Metrics Export",
|
|
124
|
+
frequency: "DAILY",
|
|
125
|
+
lastRunAt: "2024-01-14T09:00:00Z",
|
|
126
|
+
status: "FAILED",
|
|
127
|
+
recordsSynced: 0
|
|
128
|
+
}
|
|
128
129
|
];
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
130
|
+
var integrationDashboardMarkdownRenderer = {
|
|
131
|
+
target: "markdown",
|
|
132
|
+
render: async (desc) => {
|
|
133
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "IntegrationDashboard") {
|
|
134
|
+
throw new Error("integrationDashboardMarkdownRenderer: not IntegrationDashboard");
|
|
135
|
+
}
|
|
136
|
+
const integrations = mockIntegrations;
|
|
137
|
+
const connections = mockConnections;
|
|
138
|
+
const syncs = mockSyncConfigs;
|
|
139
|
+
const activeIntegrations = integrations.filter((i) => i.status === "ACTIVE");
|
|
140
|
+
const connectedConnections = connections.filter((c) => c.status === "CONNECTED");
|
|
141
|
+
const errorConnections = connections.filter((c) => c.status === "ERROR");
|
|
142
|
+
const successfulSyncs = syncs.filter((s) => s.status === "SUCCESS");
|
|
143
|
+
const totalRecordsSynced = successfulSyncs.reduce((sum, s) => sum + s.recordsSynced, 0);
|
|
144
|
+
const lines = [
|
|
145
|
+
"# Integration Hub",
|
|
146
|
+
"",
|
|
147
|
+
"> Connect and sync data with external services",
|
|
148
|
+
"",
|
|
149
|
+
"## Overview",
|
|
150
|
+
"",
|
|
151
|
+
"| Metric | Value |",
|
|
152
|
+
"|--------|-------|",
|
|
153
|
+
`| Active Integrations | ${activeIntegrations.length} |`,
|
|
154
|
+
`| Connected Services | ${connectedConnections.length} |`,
|
|
155
|
+
`| Error Connections | ${errorConnections.length} |`,
|
|
156
|
+
`| Sync Configs | ${syncs.length} |`,
|
|
157
|
+
`| Records Synced (24h) | ${totalRecordsSynced.toLocaleString()} |`,
|
|
158
|
+
"",
|
|
159
|
+
"## Integrations",
|
|
160
|
+
"",
|
|
161
|
+
"| Name | Type | Connections | Status |",
|
|
162
|
+
"|------|------|-------------|--------|"
|
|
163
|
+
];
|
|
164
|
+
for (const integration of integrations) {
|
|
165
|
+
const statusIcon = integration.status === "ACTIVE" ? "\uD83D\uDFE2" : "\u26AB";
|
|
166
|
+
lines.push(`| ${integration.name} | ${integration.type} | ${integration.connectionCount} | ${statusIcon} ${integration.status} |`);
|
|
167
|
+
}
|
|
168
|
+
lines.push("");
|
|
169
|
+
lines.push("## Recent Sync Activity");
|
|
170
|
+
lines.push("");
|
|
171
|
+
lines.push("| Sync | Frequency | Last Run | Records | Status |");
|
|
172
|
+
lines.push("|------|-----------|----------|---------|--------|");
|
|
173
|
+
for (const sync of syncs) {
|
|
174
|
+
const lastRun = new Date(sync.lastRunAt).toLocaleString();
|
|
175
|
+
const statusIcon = sync.status === "SUCCESS" ? "\u2705" : "\u274C";
|
|
176
|
+
lines.push(`| ${sync.name} | ${sync.frequency} | ${lastRun} | ${sync.recordsSynced} | ${statusIcon} ${sync.status} |`);
|
|
177
|
+
}
|
|
178
|
+
if (errorConnections.length > 0) {
|
|
179
|
+
lines.push("");
|
|
180
|
+
lines.push("## \u26A0\uFE0F Connections with Errors");
|
|
181
|
+
lines.push("");
|
|
182
|
+
for (const conn of errorConnections) {
|
|
183
|
+
const integration = integrations.find((i) => i.id === conn.integrationId);
|
|
184
|
+
lines.push(`- **${conn.name}** (${integration?.name ?? "Unknown"}): ${conn.error ?? "Unknown error"}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
mimeType: "text/markdown",
|
|
189
|
+
body: lines.join(`
|
|
190
|
+
`)
|
|
191
|
+
};
|
|
192
|
+
}
|
|
191
193
|
};
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
194
|
+
var connectionListMarkdownRenderer = {
|
|
195
|
+
target: "markdown",
|
|
196
|
+
render: async (desc) => {
|
|
197
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "ConnectionList") {
|
|
198
|
+
throw new Error("connectionListMarkdownRenderer: not ConnectionList");
|
|
199
|
+
}
|
|
200
|
+
const connections = mockConnections;
|
|
201
|
+
const integrations = mockIntegrations;
|
|
202
|
+
const lines = [
|
|
203
|
+
"# Connections",
|
|
204
|
+
"",
|
|
205
|
+
"> Manage connections to external services",
|
|
206
|
+
""
|
|
207
|
+
];
|
|
208
|
+
for (const integration of integrations) {
|
|
209
|
+
const intConnections = connections.filter((c) => c.integrationId === integration.id);
|
|
210
|
+
if (intConnections.length === 0)
|
|
211
|
+
continue;
|
|
212
|
+
lines.push(`## ${integration.name}`);
|
|
213
|
+
lines.push("");
|
|
214
|
+
lines.push("| Connection | Status | Last Sync |");
|
|
215
|
+
lines.push("|------------|--------|-----------|");
|
|
216
|
+
for (const conn of intConnections) {
|
|
217
|
+
const lastSync = new Date(conn.lastSyncAt).toLocaleString();
|
|
218
|
+
const statusIcon = conn.status === "CONNECTED" ? "\uD83D\uDFE2" : conn.status === "ERROR" ? "\uD83D\uDD34" : "\u26AB";
|
|
219
|
+
lines.push(`| ${conn.name} | ${statusIcon} ${conn.status} | ${lastSync} |`);
|
|
220
|
+
}
|
|
221
|
+
lines.push("");
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
mimeType: "text/markdown",
|
|
225
|
+
body: lines.join(`
|
|
226
|
+
`)
|
|
227
|
+
};
|
|
228
|
+
}
|
|
226
229
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
230
|
+
var syncConfigMarkdownRenderer = {
|
|
231
|
+
target: "markdown",
|
|
232
|
+
render: async (desc) => {
|
|
233
|
+
if (desc.source.type !== "component" || desc.source.componentKey !== "SyncConfigEditor") {
|
|
234
|
+
throw new Error("syncConfigMarkdownRenderer: not SyncConfigEditor");
|
|
235
|
+
}
|
|
236
|
+
const syncs = mockSyncConfigs;
|
|
237
|
+
const connections = mockConnections;
|
|
238
|
+
const lines = [
|
|
239
|
+
"# Sync Configurations",
|
|
240
|
+
"",
|
|
241
|
+
"> Configure automated data synchronization",
|
|
242
|
+
""
|
|
243
|
+
];
|
|
244
|
+
for (const sync of syncs) {
|
|
245
|
+
const connection = connections.find((c) => c.id === sync.connectionId);
|
|
246
|
+
const statusIcon = sync.status === "SUCCESS" ? "\u2705" : "\u274C";
|
|
247
|
+
lines.push(`## ${sync.name}`);
|
|
248
|
+
lines.push("");
|
|
249
|
+
lines.push(`**Connection:** ${connection?.name ?? "Unknown"}`);
|
|
250
|
+
lines.push(`**Frequency:** ${sync.frequency}`);
|
|
251
|
+
lines.push(`**Status:** ${statusIcon} ${sync.status}`);
|
|
252
|
+
lines.push(`**Last Run:** ${new Date(sync.lastRunAt).toLocaleString()}`);
|
|
253
|
+
lines.push(`**Records Synced:** ${sync.recordsSynced.toLocaleString()}`);
|
|
254
|
+
lines.push("");
|
|
255
|
+
}
|
|
256
|
+
lines.push("## Frequency Options");
|
|
257
|
+
lines.push("");
|
|
258
|
+
lines.push("- **REALTIME**: Sync on every change");
|
|
259
|
+
lines.push("- **HOURLY**: Sync every hour");
|
|
260
|
+
lines.push("- **DAILY**: Sync once per day");
|
|
261
|
+
lines.push("- **WEEKLY**: Sync once per week");
|
|
262
|
+
lines.push("- **MANUAL**: Sync only when triggered");
|
|
263
|
+
return {
|
|
264
|
+
mimeType: "text/markdown",
|
|
265
|
+
body: lines.join(`
|
|
266
|
+
`)
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
export {
|
|
271
|
+
syncConfigMarkdownRenderer,
|
|
272
|
+
integrationDashboardMarkdownRenderer,
|
|
273
|
+
connectionListMarkdownRenderer
|
|
266
274
|
};
|
|
267
|
-
|
|
268
|
-
//#endregion
|
|
269
|
-
export { connectionListMarkdownRenderer, integrationDashboardMarkdownRenderer, syncConfigMarkdownRenderer };
|
|
270
|
-
//# sourceMappingURL=integration.markdown.js.map
|