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