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