@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 +0,0 @@
1
- {"version":3,"file":"integration.enum.js","names":[],"sources":["../../src/integration/integration.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Integration status enum.\n */\nexport const IntegrationStatusEnum = defineEnum('IntegrationStatus', [\n 'DRAFT',\n 'ACTIVE',\n 'PAUSED',\n 'ERROR',\n 'ARCHIVED',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,wBAAwB,WAAW,qBAAqB;CACnE;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.operations.js","names":[],"sources":["../../src/integration/integration.operations.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts/operations';\nimport {\n CreateIntegrationInputModel,\n IntegrationModel,\n} from './integration.schema';\n\n/**\n * Create a new integration.\n */\nexport const CreateIntegrationContract = defineCommand({\n meta: {\n key: 'integration.create',\n version: '1.0.0',\n stability: 'stable',\n owners: ['@example.integration-hub'],\n tags: ['integration', 'create'],\n description: 'Create a new integration.',\n goal: 'Allow users to set up integrations with external systems.',\n context: 'Integration setup.',\n },\n io: { input: CreateIntegrationInputModel, output: IntegrationModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'integration.created',\n version: '1.0.0',\n when: 'Integration created',\n payload: IntegrationModel,\n },\n ],\n audit: ['integration.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-integration-happy-path',\n given: ['User is admin'],\n when: ['User defines new integration type'],\n then: [\n 'Integration definition is created',\n 'IntegrationCreated event is emitted',\n ],\n },\n ],\n examples: [\n {\n key: 'create-slack',\n input: { name: 'Slack', category: 'communication', authType: 'oauth2' },\n output: { id: 'slack', status: 'active' },\n },\n ],\n },\n});\n"],"mappings":";;;;;;;AASA,MAAa,4BAA4B,cAAc;CACrD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,2BAA2B;EACpC,MAAM,CAAC,eAAe,SAAS;EAC/B,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAA6B,QAAQ;EAAkB;CACpE,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,sBAAsB;EAC/B;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,gBAAgB;GACxB,MAAM,CAAC,oCAAoC;GAC3C,MAAM,CACJ,qCACA,sCACD;GACF,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,MAAM;IAAS,UAAU;IAAiB,UAAU;IAAU;GACvE,QAAQ;IAAE,IAAI;IAAS,QAAQ;IAAU;GAC1C,CACF;EACF;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.presentation.js","names":[],"sources":["../../src/integration/integration.presentation.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport { IntegrationModel } from './integration.schema';\n\nexport const IntegrationListPresentation = definePresentation({\n meta: {\n key: 'integration.list',\n version: '1.0.0',\n title: 'Integration List',\n description: 'List of available integrations',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Show users available integrations they can connect to.',\n context: 'The marketplace of integrations within the hub.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'IntegrationList',\n props: IntegrationModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.enabled'],\n },\n});\n\nexport const IntegrationDetailPresentation = definePresentation({\n meta: {\n key: 'integration.detail',\n version: '1.0.0',\n title: 'Integration Details',\n description: 'Detailed view of an integration',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Show capabilities and documentation for a specific integration.',\n context: 'Integration showcase and support page.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'IntegrationDetail',\n props: IntegrationModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.enabled'],\n },\n});\n\nexport const IntegrationHealthPresentation = definePresentation({\n meta: {\n key: 'integration.health',\n version: '1.0.0',\n title: 'Integration Health',\n description: 'Integration health monitoring dashboard',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'health', 'monitoring'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitor connectivity and error rates for active integrations.',\n context: 'Operations dashboard for integration hub health.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'IntegrationHealth',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.monitoring.enabled'],\n },\n});\n"],"mappings":";;;;AAGA,MAAa,8BAA8B,mBAAmB;CAC5D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,OAAO;EAC7B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,sBAAsB,EAC/B;CACF,CAAC;AAEF,MAAa,gCAAgC,mBAAmB;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,SAAS;EAC/B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,sBAAsB,EAC/B;CACF,CAAC;AAEF,MAAa,gCAAgC,mBAAmB;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAU;GAAa;EAC7C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,iCAAiC,EAC1C;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.schema.js","names":[],"sources":["../../src/integration/integration.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { IntegrationStatusEnum } from './integration.enum';\n\n/**\n * An integration with an external system.\n */\nexport const IntegrationModel = defineSchemaModel({\n name: 'IntegrationModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: IntegrationStatusEnum, isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating an integration.\n */\nexport const CreateIntegrationInputModel = defineSchemaModel({\n name: 'CreateIntegrationInput',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n config: { type: ScalarTypeEnum.JSON(), isOptional: true },\n featureFlagKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,mBAAmB,kBAAkB;CAChD,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,QAAQ;GAAE,MAAM;GAAuB,YAAY;GAAO;EAC1D,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,8BAA8B,kBAAkB;CAC3D,MAAM;CACN,QAAQ;EACN,MAAM;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAClE,MAAM;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAClE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,UAAU;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EACzD,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACF;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-hub.capability.js","names":[],"sources":["../src/integration-hub.capability.ts"],"sourcesContent":["import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nexport const IntegrationCapability = defineCapability({\n meta: {\n key: 'integration',\n version: '1.0.0',\n kind: 'integration',\n stability: StabilityEnum.Experimental,\n description: 'Third-party integration connections',\n owners: ['platform.core'],\n tags: ['integration', 'connections'],\n },\n});\n\nexport const SyncCapability = defineCapability({\n meta: {\n key: 'sync',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Data synchronization between systems',\n owners: ['platform.core'],\n tags: ['sync', 'data'],\n },\n});\n\nexport const EtlCapability = defineCapability({\n meta: {\n key: 'etl',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Extract, transform, load data pipelines',\n owners: ['platform.core'],\n tags: ['etl', 'data', 'pipeline'],\n },\n});\n"],"mappings":";;;AAEA,MAAa,wBAAwB,iBAAiB,EACpD,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM,CAAC,eAAe,cAAc;CACrC,EACF,CAAC;AAEF,MAAa,iBAAiB,iBAAiB,EAC7C,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM,CAAC,QAAQ,OAAO;CACvB,EACF,CAAC;AAEF,MAAa,gBAAgB,iBAAiB,EAC5C,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM;EAAC;EAAO;EAAQ;EAAW;CAClC,EACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-hub.feature.js","names":[],"sources":["../src/integration-hub.feature.ts"],"sourcesContent":["/**\n * Integration Hub Feature Module Specification\n */\nimport { defineFeature } from '@contractspec/lib.contracts';\n\nexport const IntegrationHubFeature = defineFeature({\n meta: {\n key: 'integration-hub',\n version: '1.0.0',\n title: 'Integration Hub',\n description:\n 'Connect and sync data with external systems through configurable integrations',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'etl', 'connectors'],\n stability: 'experimental',\n },\n\n operations: [\n { key: 'integration.create', version: '1.0.0' },\n { key: 'integration.connection.create', version: '1.0.0' },\n { key: 'integration.syncConfig.create', version: '1.0.0' },\n { key: 'integration.fieldMapping.add', version: '1.0.0' },\n { key: 'integration.sync.trigger', version: '1.0.0' },\n { key: 'integration.syncRun.list', version: '1.0.0' },\n ],\n\n events: [\n { key: 'integration.created', version: '1.0.0' },\n { key: 'integration.connection.created', version: '1.0.0' },\n { key: 'integration.connection.statusChanged', version: '1.0.0' },\n { key: 'integration.syncConfig.created', version: '1.0.0' },\n { key: 'integration.sync.started', version: '1.0.0' },\n { key: 'integration.sync.completed', version: '1.0.0' },\n { key: 'integration.sync.failed', version: '1.0.0' },\n { key: 'integration.record.synced', version: '1.0.0' },\n { key: 'integration.fieldMapping.added', version: '1.0.0' },\n ],\n\n presentations: [\n { key: 'integration.list', version: '1.0.0' },\n { key: 'integration.detail', version: '1.0.0' },\n { key: 'integration.connection.list', version: '1.0.0' },\n { key: 'integration.connection.setup', version: '1.0.0' },\n { key: 'integration.syncConfig.list', version: '1.0.0' },\n { key: 'integration.syncConfig.editor', version: '1.0.0' },\n { key: 'integration.fieldMapping.editor', version: '1.0.0' },\n { key: 'integration.syncRun.viewList', version: '1.0.0' },\n { key: 'integration.syncRun.detail', version: '1.0.0' },\n { key: 'integration.health', version: '1.0.0' },\n { key: 'integration.sync.activity', version: '1.0.0' },\n ],\n\n opToPresentation: [\n {\n op: { key: 'integration.syncConfig.create', version: '1.0.0' },\n pres: { key: 'integration.syncConfig.editor', version: '1.0.0' },\n },\n {\n op: { key: 'integration.fieldMapping.add', version: '1.0.0' },\n pres: { key: 'integration.fieldMapping.editor', version: '1.0.0' },\n },\n {\n op: { key: 'integration.syncRun.list', version: '1.0.0' },\n pres: { key: 'integration.syncRun.viewList', version: '1.0.0' },\n },\n ],\n\n presentationsTargets: [\n {\n key: 'integration.list',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.detail',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncConfig.list',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncConfig.editor',\n version: '1.0.0',\n targets: ['react'],\n },\n {\n key: 'integration.fieldMapping.editor',\n version: '1.0.0',\n targets: ['react'],\n },\n {\n key: 'integration.syncRun.viewList',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncRun.detail',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n ],\n\n capabilities: {\n requires: [\n { key: 'identity', version: '1.0.0' },\n { key: 'audit-trail', version: '1.0.0' },\n { key: 'feature-flags', version: '1.0.0' },\n { key: 'jobs', version: '1.0.0' },\n { key: 'files', version: '1.0.0' },\n ],\n provides: [\n { key: 'integration', version: '1.0.0' },\n { key: 'sync', version: '1.0.0' },\n { key: 'etl', version: '1.0.0' },\n ],\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,wBAAwB,cAAc;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAO;GAAa;EAClD,WAAW;EACZ;CAED,YAAY;EACV;GAAE,KAAK;GAAsB,SAAS;GAAS;EAC/C;GAAE,KAAK;GAAiC,SAAS;GAAS;EAC1D;GAAE,KAAK;GAAiC,SAAS;GAAS;EAC1D;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACrD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACtD;CAED,QAAQ;EACN;GAAE,KAAK;GAAuB,SAAS;GAAS;EAChD;GAAE,KAAK;GAAkC,SAAS;GAAS;EAC3D;GAAE,KAAK;GAAwC,SAAS;GAAS;EACjE;GAAE,KAAK;GAAkC,SAAS;GAAS;EAC3D;GAAE,KAAK;GAA4B,SAAS;GAAS;EACrD;GAAE,KAAK;GAA8B,SAAS;GAAS;EACvD;GAAE,KAAK;GAA2B,SAAS;GAAS;EACpD;GAAE,KAAK;GAA6B,SAAS;GAAS;EACtD;GAAE,KAAK;GAAkC,SAAS;GAAS;EAC5D;CAED,eAAe;EACb;GAAE,KAAK;GAAoB,SAAS;GAAS;EAC7C;GAAE,KAAK;GAAsB,SAAS;GAAS;EAC/C;GAAE,KAAK;GAA+B,SAAS;GAAS;EACxD;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;G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ACD,UAAU;GACR;IAAE,KAAK;IAAe,SAAS;IAAS;GACxC;IAAE,KAAK;IAAQ,SAAS;IAAS;GACjC;IAAE,KAAK;IAAO,SAAS;IAAS;GACjC;EACF;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":["import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';\n\nexport async function seedIntegrationHub(params: {\n projectId: string;\n db: DatabasePort;\n}) {\n const { projectId, db } = params;\n\n const existing = await db.query(\n `SELECT COUNT(*) as count FROM integration WHERE \"projectId\" = $1`,\n [projectId]\n );\n if ((existing.rows[0]?.count as number) > 0) return;\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_1',\n projectId,\n 'org_demo',\n 'Salesforce',\n 'Salesforce CRM integration',\n 'CRM',\n 'ACTIVE',\n ]\n );\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_2',\n projectId,\n 'org_demo',\n 'Meeting Recorder',\n 'Meeting recorder transcripts and metadata',\n 'DATA',\n 'ACTIVE',\n ]\n );\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_3',\n projectId,\n 'org_demo',\n 'Gradium Voice',\n 'Gradium low-latency text-to-speech integration',\n 'COMMUNICATION',\n 'ACTIVE',\n ]\n );\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_4',\n projectId,\n 'org_demo',\n 'Fal Chatterbox Voice',\n 'Fal Chatterbox text-to-speech integration',\n 'COMMUNICATION',\n 'ACTIVE',\n ]\n );\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_5',\n projectId,\n 'org_demo',\n 'PostHog Analytics',\n 'Product analytics and event capture',\n 'ANALYTICS',\n 'ACTIVE',\n ]\n );\n}\n"],"mappings":";AAEA,eAAsB,mBAAmB,QAGtC;CACD,MAAM,EAAE,WAAW,OAAO;AAM1B,MAJiB,MAAM,GAAG,MACxB,oEACA,CAAC,UAAU,CACZ,EACa,KAAK,IAAI,QAAmB,EAAG;AAE7C,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.enum.js","names":[],"sources":["../../src/sync/sync.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Sync direction enum.\n */\nexport const SyncDirectionEnum = defineEnum('SyncDirection', [\n 'INBOUND',\n 'OUTBOUND',\n 'BIDIRECTIONAL',\n]);\n\n/**\n * Sync status enum.\n */\nexport const SyncStatusEnum = defineEnum('SyncStatus', [\n 'PENDING',\n 'RUNNING',\n 'COMPLETED',\n 'FAILED',\n 'CANCELLED',\n]);\n\n/**\n * Mapping type enum.\n */\nexport const MappingTypeEnum = defineEnum('MappingType', [\n 'DIRECT',\n 'TRANSFORM',\n 'LOOKUP',\n 'CONSTANT',\n 'COMPUTED',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,WAAW,iBAAiB;CAC3D;CACA;CACA;CACD,CAAC;;;;AAKF,MAAa,iBAAiB,WAAW,cAAc;CACrD;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,MAAa,kBAAkB,WAAW,eAAe;CACvD;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.operations.js","names":[],"sources":["../../src/sync/sync.operations.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport {\n SyncConfigModel,\n SyncRunModel,\n FieldMappingModel,\n CreateSyncConfigInputModel,\n AddFieldMappingInputModel,\n TriggerSyncInputModel,\n ListSyncRunsInputModel,\n ListSyncRunsOutputModel,\n} from './sync.schema';\n\nconst OWNERS = ['@example.integration-hub'] as const;\n\n/**\n * Create a sync configuration.\n */\nexport const CreateSyncConfigContract = defineCommand({\n meta: {\n key: 'integration.syncConfig.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['integration', 'sync', 'config', 'create'],\n description: 'Create a sync configuration.',\n goal: 'Define how data should be synchronized.',\n context: 'Sync setup.',\n },\n io: { input: CreateSyncConfigInputModel, output: SyncConfigModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'integration.syncConfig.created',\n version: '1.0.0',\n when: 'Sync config created',\n payload: SyncConfigModel,\n },\n ],\n audit: ['integration.syncConfig.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-sync-happy-path',\n given: ['User is authenticated'],\n when: ['User creates sync config'],\n then: ['Sync config is created', 'SyncConfigCreated event is emitted'],\n },\n ],\n examples: [\n {\n key: 'create-contact-sync',\n input: {\n name: 'Contacts Sync',\n sourceConnectionId: 'conn-1',\n targetConnectionId: 'conn-2',\n },\n output: { id: 'sync-123', status: 'active' },\n },\n ],\n },\n});\n\n/**\n * Add a field mapping to a sync config.\n */\nexport const AddFieldMappingContract = defineCommand({\n meta: {\n key: 'integration.fieldMapping.add',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['integration', 'mapping', 'field'],\n description: 'Add a field mapping to a sync config.',\n goal: 'Map fields between systems.',\n context: 'Mapping configuration.',\n },\n io: { input: AddFieldMappingInputModel, output: FieldMappingModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'integration.fieldMapping.added',\n version: '1.0.0',\n when: 'Mapping added',\n payload: FieldMappingModel,\n },\n ],\n },\n acceptance: {\n scenarios: [\n {\n key: 'add-mapping-happy-path',\n given: ['Sync config exists'],\n when: ['User adds field mapping'],\n then: ['Mapping is added', 'FieldMappingAdded event is emitted'],\n },\n ],\n examples: [\n {\n key: 'map-email',\n input: {\n syncConfigId: 'sync-123',\n sourceField: 'email',\n targetField: 'user_email',\n },\n output: { id: 'map-456', type: 'string' },\n },\n ],\n },\n});\n\n/**\n * Trigger a manual sync.\n */\nexport const TriggerSyncContract = defineCommand({\n meta: {\n key: 'integration.sync.trigger',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['integration', 'sync', 'trigger'],\n description: 'Trigger a manual sync.',\n goal: 'Start data synchronization.',\n context: 'Manual sync or webhook trigger.',\n },\n io: { input: TriggerSyncInputModel, output: SyncRunModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'integration.sync.started',\n version: '1.0.0',\n when: 'Sync starts',\n payload: SyncRunModel,\n },\n ],\n audit: ['integration.sync.triggered'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'trigger-sync-happy-path',\n given: ['Sync config exists'],\n when: ['User triggers sync'],\n then: ['Sync run starts', 'SyncStarted event is emitted'],\n },\n ],\n examples: [\n {\n key: 'manual-trigger',\n input: { syncConfigId: 'sync-123' },\n output: { id: 'run-789', status: 'pending' },\n },\n ],\n },\n});\n\n/**\n * List sync run history.\n */\nexport const ListSyncRunsContract = defineQuery({\n meta: {\n key: 'integration.syncRun.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['integration', 'sync', 'run', 'list'],\n description: 'List sync run history.',\n goal: 'View sync history and status.',\n context: 'Sync monitoring.',\n },\n io: { input: ListSyncRunsInputModel, output: ListSyncRunsOutputModel },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'list-runs-happy-path',\n given: ['User has access to syncs'],\n when: ['User lists sync runs'],\n then: ['List of runs is returned'],\n },\n ],\n examples: [\n {\n key: 'list-recent',\n input: { limit: 10 },\n output: { items: [], total: 50 },\n },\n ],\n },\n});\n"],"mappings":";;;;AAeA,MAAM,SAAS,CAAC,2BAA2B;;;;AAK3C,MAAa,2BAA2B,cAAc;CACpD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAe;GAAQ;GAAU;GAAS;EACjD,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAA4B,QAAQ;EAAiB;CAClE,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,iCAAiC;EAC1C;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,wBAAwB;GAChC,MAAM,CAAC,2BAA2B;GAClC,MAAM,CAAC,0BAA0B,qCAAqC;GACvE,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,MAAM;IACN,oBAAoB;IACpB,oBAAoB;IACrB;GACD,QAAQ;IAAE,IAAI;IAAY,QAAQ;IAAU;GAC7C,CACF;EACF;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAe;GAAW;GAAQ;EACzC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;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EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAwB,QAAQ;EAAyB;CACtE,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,2BAA2B;GACnC,MAAM,CAAC,uBAAuB;GAC9B,MAAM,CAAC,2BAA2B;GACnC,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO,EAAE,OAAO,IAAI;GACpB,QAAQ;IAAE,OAAO,EAAE;IAAE,OAAO;IAAI;GACjC,CACF;EACF;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.presentation.js","names":[],"sources":["../../src/sync/sync.presentation.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport {\n FieldMappingModel,\n SyncConfigModel,\n SyncRunModel,\n} from './sync.schema';\n\nexport const SyncConfigListPresentation = definePresentation({\n meta: {\n key: 'integration.syncConfig.list',\n version: '1.0.0',\n title: 'Sync Config List',\n description: 'List of sync configurations',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'config', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Show users their current sync configurations.',\n context: 'Management view for data synchronization.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncConfigList',\n props: SyncConfigModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncConfigEditorPresentation = definePresentation({\n meta: {\n key: 'integration.syncConfig.editor',\n version: '1.0.0',\n title: 'Sync Config Editor',\n description: 'Editor for sync configuration settings',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'config', 'editor'],\n stability: StabilityEnum.Experimental,\n goal: 'Allow users to configure schedule, filters, and settings for a sync.',\n context: 'Configuration interface for sync jobs.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncConfigEditor',\n props: SyncConfigModel,\n },\n targets: ['react'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const FieldMappingEditorPresentation = definePresentation({\n meta: {\n key: 'integration.fieldMapping.editor',\n version: '1.0.0',\n title: 'Field Mapping Editor',\n description: 'Visual field mapping editor',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'field-mapping', 'editor'],\n stability: StabilityEnum.Experimental,\n goal: 'Allow users to map source fields to target fields visually.',\n context: 'Schema mapping tool for data consistency.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'FieldMappingEditor',\n props: FieldMappingModel,\n },\n targets: ['react'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncRunListPresentation = definePresentation({\n meta: {\n key: 'integration.syncRun.viewList',\n version: '1.0.0',\n title: 'Sync Run History',\n description: 'History of sync runs',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'runs', 'history'],\n stability: StabilityEnum.Experimental,\n goal: 'Provide a historical log of all sync attempts and their results.',\n context: 'Audit and troubleshooting view for sync jobs.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncRunList',\n props: SyncRunModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncRunDetailPresentation = definePresentation({\n meta: {\n key: 'integration.syncRun.detail',\n version: '1.0.0',\n title: 'Sync Run Details',\n description: 'Detailed view of a sync run with logs',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'run', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Show granular details and logs for a specific sync run.',\n context: 'Detailed troubleshooting view.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncRunDetail',\n props: SyncRunModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncActivityPresentation = definePresentation({\n meta: {\n key: 'integration.sync.activity',\n version: '1.0.0',\n title: 'Sync Activity Monitor',\n description: 'Real-time sync activity monitor',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'activity', 'realtime'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitor live data flow and sync performance.',\n context: 'Real-time operations monitor.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncActivity',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n"],"mappings":";;;;AAOA,MAAa,6BAA6B,mBAAmB;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAU;GAAO;EAC/C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC;AAEF,MAAa,+BAA+B,mBAAmB;CAC7D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAU;GAAS;EACjD,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC;AAEF,MAAa,iCAAiC,mBAAmB;CAC/D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAiB;GAAS;EAChD,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX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src/sync/sync.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport {\n SyncDirectionEnum,\n SyncStatusEnum,\n MappingTypeEnum,\n} from './sync.enum';\n\n/**\n * A field mapping configuration.\n */\nexport const FieldMappingModel = defineSchemaModel({\n name: 'FieldMappingModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mappingType: { type: MappingTypeEnum, isOptional: false },\n transformExpression: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n/**\n * A sync configuration.\n */\nexport const SyncConfigModel = defineSchemaModel({\n name: 'SyncConfigModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true },\n },\n});\n\n/**\n * A sync run.\n */\nexport const SyncRunModel = defineSchemaModel({\n name: 'SyncRunModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: SyncStatusEnum, isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n recordsProcessed: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a sync config.\n */\nexport const CreateSyncConfigInputModel = defineSchemaModel({\n name: 'CreateSyncConfigInput',\n fields: {\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for adding a field mapping.\n */\nexport const AddFieldMappingInputModel = defineSchemaModel({\n name: 'AddFieldMappingInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n mappingType: { type: MappingTypeEnum, isOptional: false },\n transformExpression: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },\n constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\n/**\n * Input for triggering a sync.\n */\nexport const TriggerSyncInputModel = defineSchemaModel({\n name: 'TriggerSyncInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: true },\n fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n});\n\n/**\n * Input for listing sync runs.\n */\nexport const ListSyncRunsInputModel = defineSchemaModel({\n name: 'ListSyncRunsInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: SyncStatusEnum, isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing sync runs.\n */\nexport const ListSyncRunsOutputModel = defineSchemaModel({\n name: 'ListSyncRunsOutput',\n fields: {\n runs: { type: SyncRunModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AAUA,MAAa,oBAAoB,kBAAkB;CACjD,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,aAAa;GAAE,MAAM;GAAiB,YAAY;GAAO;EACzD,qBAAqB;GACnB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,YAAY;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;E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AAY;GAAM;EAChE,YAAY;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAM;EAChE,cAAc;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAChE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,WAAW;GAAE,MAAM;GAAmB,YAAY;GAAM;EACxD,UAAU;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAM;EAC/D;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,QAAQ;GAAE,MAAM;GAAgB,YAAY;GAAM;EAClD,OAAO;GACL,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACD,QAAQ;GACN,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACF;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,QAAQ;EACN,MAAM;GAAE,MAAM;GAAc,SAAS;GAAM,YAAY;GAAO;EAC9D,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAClE;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/sync-engine/index.ts"],"sourcesContent":["/**\n * Sync Engine\n *\n * Core sync logic for the Integration Hub.\n */\n\n// ============ Types ============\n\nexport interface FieldMapping {\n sourceField: string;\n targetField: string;\n mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';\n transformExpression?: string;\n lookupConfig?: LookupConfig;\n constantValue?: unknown;\n isRequired: boolean;\n defaultValue?: unknown;\n}\n\nexport interface LookupConfig {\n sourceObject: string;\n lookupField: string;\n returnField: string;\n}\n\nexport interface SyncConfig {\n id: string;\n direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';\n sourceObject: string;\n targetObject: string;\n fieldMappings: FieldMapping[];\n createNew: boolean;\n updateExisting: boolean;\n deleteRemoved: boolean;\n sourceFilter?: Record<string, unknown>;\n}\n\nexport interface SyncContext {\n runId: string;\n config: SyncConfig;\n connection: {\n id: string;\n authType: string;\n credentials?: Record<string, unknown>;\n };\n}\n\nexport interface SyncResult {\n success: boolean;\n recordsProcessed: number;\n recordsCreated: number;\n recordsUpdated: number;\n recordsDeleted: number;\n recordsFailed: number;\n recordsSkipped: number;\n errors: SyncError[];\n}\n\nexport interface SyncError {\n recordId?: string;\n field?: string;\n message: string;\n code: string;\n}\n\nexport interface SourceRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\nexport interface TargetRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\n// ============ Sync Engine Interface ============\n\nexport interface ISyncEngine {\n /**\n * Execute a sync operation.\n */\n sync(context: SyncContext): Promise<SyncResult>;\n\n /**\n * Transform a source record to target format.\n */\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n context: SyncContext\n ): TargetRecord;\n\n /**\n * Validate a transformed record.\n */\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] };\n}\n\n// ============ Field Transformer ============\n\nexport interface IFieldTransformer {\n transform(value: unknown, expression: string): unknown;\n}\n\nexport class BasicFieldTransformer implements IFieldTransformer {\n transform(value: unknown, expression: string): unknown {\n // Simple expression evaluation\n // In production, use a proper expression language\n try {\n if (expression.startsWith('uppercase')) {\n return typeof value === 'string' ? value.toUpperCase() : value;\n }\n if (expression.startsWith('lowercase')) {\n return typeof value === 'string' ? value.toLowerCase() : value;\n }\n if (expression.startsWith('trim')) {\n return typeof value === 'string' ? value.trim() : value;\n }\n if (expression.startsWith('default:')) {\n const defaultVal = expression.replace('default:', '');\n return value ?? JSON.parse(defaultVal);\n }\n if (expression.startsWith('concat:')) {\n const separator = expression.replace('concat:', '') || ' ';\n if (Array.isArray(value)) {\n return value.join(separator);\n }\n return value;\n }\n if (expression.startsWith('split:')) {\n const separator = expression.replace('split:', '') || ',';\n if (typeof value === 'string') {\n return value.split(separator);\n }\n return value;\n }\n if (expression.startsWith('number')) {\n return Number(value);\n }\n if (expression.startsWith('boolean')) {\n return Boolean(value);\n }\n if (expression.startsWith('string')) {\n return String(value);\n }\n\n // Return as-is if no transformation matches\n return value;\n } catch {\n return value;\n }\n }\n}\n\n// ============ Basic Sync Engine ============\n\nexport class BasicSyncEngine implements ISyncEngine {\n private transformer: IFieldTransformer;\n\n constructor(transformer?: IFieldTransformer) {\n this.transformer = transformer ?? new BasicFieldTransformer();\n }\n\n async sync(_context: SyncContext): Promise<SyncResult> {\n const result: SyncResult = {\n success: true,\n recordsProcessed: 0,\n recordsCreated: 0,\n recordsUpdated: 0,\n recordsDeleted: 0,\n recordsFailed: 0,\n recordsSkipped: 0,\n errors: [],\n };\n\n // In a real implementation, this would:\n // 1. Fetch records from source\n // 2. Transform each record\n // 3. Validate each record\n // 4. Upsert to target\n // 5. Track sync records for deduplication\n\n return result;\n }\n\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n _context: SyncContext\n ): TargetRecord {\n const targetData: Record<string, unknown> = {};\n\n for (const mapping of mappings) {\n let value: unknown;\n let sourceValue: unknown;\n\n switch (mapping.mappingType) {\n case 'DIRECT':\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'TRANSFORM':\n sourceValue = this.getNestedValue(\n sourceRecord.data,\n mapping.sourceField\n );\n value = mapping.transformExpression\n ? this.transformer.transform(\n sourceValue,\n mapping.transformExpression\n )\n : sourceValue;\n break;\n\n case 'CONSTANT':\n value = mapping.constantValue;\n break;\n\n case 'LOOKUP':\n // In production, this would fetch from a lookup table\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'COMPUTED':\n // In production, this would evaluate a computed expression\n value = mapping.transformExpression\n ? this.evaluateComputed(\n sourceRecord.data,\n mapping.transformExpression\n )\n : null;\n break;\n\n default:\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n }\n\n // Apply default value if needed\n if (value === undefined || value === null) {\n value = mapping.defaultValue;\n }\n\n // Set the target field\n this.setNestedValue(targetData, mapping.targetField, value);\n }\n\n return {\n id: sourceRecord.id,\n data: targetData,\n };\n }\n\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] } {\n const errors: SyncError[] = [];\n\n for (const mapping of mappings) {\n if (mapping.isRequired) {\n const value = this.getNestedValue(record.data, mapping.targetField);\n if (value === undefined || value === null) {\n errors.push({\n recordId: record.id,\n field: mapping.targetField,\n message: `Required field ${mapping.targetField} is missing`,\n code: 'REQUIRED_FIELD_MISSING',\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n }\n\n private getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n }\n\n private setNestedValue(\n obj: Record<string, unknown>,\n path: string,\n value: unknown\n ): void {\n const parts = path.split('.');\n let current = obj;\n\n for (let i = 0; i < parts.length - 1; i++) {\n const part = parts[i];\n if (part === undefined) continue;\n if (!(part in current)) {\n current[part] = {};\n }\n current = current[part] as Record<string, unknown>;\n }\n\n const lastPart = parts[parts.length - 1];\n if (lastPart !== undefined) {\n current[lastPart] = value;\n }\n }\n\n private evaluateComputed(\n data: Record<string, unknown>,\n expression: string\n ): unknown {\n // Simple computed field evaluation\n // In production, use a proper expression evaluator\n try {\n // Support simple field references like ${field.path}\n const result = expression.replace(/\\$\\{([^}]+)\\}/g, (_, path) => {\n const value = this.getNestedValue(data, path);\n return String(value ?? '');\n });\n return result;\n } catch {\n return null;\n }\n }\n}\n\n// ============ Factory ============\n\nexport function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine {\n return new BasicSyncEngine(transformer);\n}\n\n// ============ Checksum Utilities ============\n\nexport function computeChecksum(data: Record<string, unknown>): string {\n // Simple checksum based on JSON serialization\n // In production, use a proper hash function\n const str = JSON.stringify(data, Object.keys(data).sort());\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return hash.toString(16);\n}\n\nexport function hasChanges(\n sourceChecksum: string | undefined,\n targetChecksum: string | undefined\n): boolean {\n if (!sourceChecksum || !targetChecksum) {\n return true;\n }\n return sourceChecksum !== targetChecksum;\n}\n"],"mappings":";AA6GA,IAAa,wBAAb,MAAgE;CAC9D,UAAU,OAAgB,YAA6B;AAGrD,MAAI;AACF,OAAI,WAAW,WAAW,YAAY,CACpC,QAAO,OAAO,UAAU,WAAW,MAAM,aAAa,GAAG;AAE3D,OAAI,WAAW,WAAW,YAAY,CACpC,QAAO,OAAO,UAAU,WAAW,MAAM,aAAa,GAAG;AAE3D,OAAI,WAAW,WAAW,OAAO,CAC/B,QAAO,OAAO,UAAU,WAAW,MAAM,MAAM,GAAG;AAEpD,OAAI,WAAW,WAAW,WAAW,EAAE;IACrC,MAAM,aAAa,WAAW,QAAQ,YAAY,GAAG;AACrD,WAAO,SAAS,KAAK,MAAM,WAAW;;AAExC,OAAI,WAAW,WAAW,UAAU,EAAE;IACpC,MAAM,YAAY,WAAW,QAAQ,WAAW,GAAG,IAAI;AACvD,QAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,UAAU;AAE9B,WAAO;;AAET,OAAI,WAAW,WAAW,SAAS,EAAE;IACnC,MAAM,YAAY,WAAW,QAAQ,UAAU,GAAG,IAAI;AACtD,QAAI,OAAO,UAAU,SACnB,QAAO,MAAM,MAAM,UAAU;AAE/B,WAAO;;AAET,OAAI,WAAW,WAAW,SAAS,CACjC,QAA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ACnC,MAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,UAAQ,QAAQ,KAAK,OAAO;AAC5B,SAAO,OAAO;;AAEhB,QAAO,KAAK,SAAS,GAAG;;AAG1B,SAAgB,WACd,gBACA,gBACS;AACT,KAAI,CAAC,kBAAkB,CAAC,eACtB,QAAO;AAET,QAAO,mBAAmB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"operations.test-spec.js","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":["import { defineTestSpec } from '@contractspec/lib.contracts';\n\nexport const SyncConfigCreateTest = defineTestSpec({\n meta: {\n key: 'integration.syncConfig.create.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for creating sync config',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.syncConfig.create', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.syncConfig.create' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.syncConfig.create' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const FieldMappingAddTest = defineTestSpec({\n meta: {\n key: 'integration.fieldMapping.add.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for adding field mapping',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.fieldMapping.add', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.fieldMapping.add' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.fieldMapping.add' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const SyncRunListTest = defineTestSpec({\n meta: {\n key: 'integration.syncRun.list.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for listing sync runs',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.syncRun.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.syncRun.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.syncRun.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n"],"mappings":";;;AAEA,MAAa,uBAAuB,eAAe;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,2BAA2B;EACpC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAAiC,SAAS;GAAS;EACtE;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,iCAAiC,EAAE;EAC7D,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,iCAAiC,EAAE;EAC7D,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC;AAEF,MAAa,sBAAsB,eAAe;CAChD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,2BAA2B;EACpC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAAgC,SAAS;GAAS;EACrE;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,gCAAgC,EAAE;EAC5D,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,gCAAgC,EAAE;EAC5D,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC;AAEF,MAAa,kBAAkB,eAAe;CAC5C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,2BAA2B;EACpC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAA4B,SAAS;GAAS;EACjE;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,4BAA4B,EAAE;EACxD,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,4BAA4B,EAAE;EACxD,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IntegrationDashboard.js","names":[],"sources":["../../src/ui/IntegrationDashboard.tsx"],"sourcesContent":["'use client';\n\n/**\n * Integration Hub Dashboard\n *\n * Interactive dashboard for the integration-hub template.\n * Displays integrations, connections, and sync configurations.\n */\nimport { useState } from 'react';\nimport {\n Button,\n ErrorState,\n LoaderBlock,\n StatCard,\n StatCardGroup,\n} from '@contractspec/lib.design-system';\nimport { useIntegrationData } from './hooks/useIntegrationData';\n\ntype Tab = 'integrations' | 'connections' | 'syncs';\n\nconst STATUS_COLORS: Record<string, string> = {\n ACTIVE:\n 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400',\n INACTIVE: 'bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400',\n CONNECTED:\n 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400',\n DISCONNECTED:\n 'bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400',\n PENDING:\n 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400',\n ERROR: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400',\n PAUSED:\n 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400',\n};\n\nconst TYPE_ICONS: Record<string, string> = {\n CRM: '📊',\n MARKETING: '📣',\n PAYMENT: '💳',\n COMMUNICATION: '💬',\n DATA: '🗄️',\n CUSTOM: '⚙️',\n};\n\nexport function IntegrationDashboard() {\n const [activeTab, setActiveTab] = useState<Tab>('integrations');\n const {\n integrations,\n connections,\n syncConfigs,\n loading,\n error,\n stats,\n refetch,\n } = useIntegrationData();\n\n const tabs: { id: Tab; label: string; icon: string }[] = [\n { id: 'integrations', label: 'Integrations', icon: '🔌' },\n { id: 'connections', label: 'Connections', icon: '🔗' },\n { id: 'syncs', label: 'Sync Configs', icon: '🔄' },\n ];\n\n if (loading) {\n return <LoaderBlock label=\"Loading Integrations...\" />;\n }\n\n if (error) {\n return (\n <ErrorState\n title=\"Failed to load Integrations\"\n description={error.message}\n onRetry={refetch}\n retryLabel=\"Retry\"\n />\n );\n }\n\n return (\n <div className=\"space-y-6\">\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-2xl font-bold\">Integration Hub</h2>\n <Button onClick={() => alert('Add integration modal')}>\n <span className=\"mr-2\">+</span> Add Integration\n </Button>\n </div>\n\n {/* Stats Row */}\n <StatCardGroup>\n <StatCard\n label=\"Integrations\"\n value={stats.totalIntegrations}\n hint={`${stats.activeIntegrations} active`}\n />\n <StatCard\n label=\"Connections\"\n value={stats.totalConnections}\n hint={`${stats.connectedCount} connected`}\n />\n <StatCard\n label=\"Syncs\"\n value={stats.totalSyncs}\n hint={`${stats.activeSyncs} active`}\n />\n </StatCardGroup>\n\n {/* Navigation Tabs */}\n <nav className=\"bg-muted flex gap-1 rounded-lg p-1\" role=\"tablist\">\n {tabs.map((tab) => (\n <Button\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={activeTab === tab.id}\n onClick={() => setActiveTab(tab.id)}\n className={`flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors ${\n activeTab === tab.id\n ? 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n }`}\n >\n <span>{tab.icon}</span>\n {tab.label}\n </Button>\n ))}\n </nav>\n\n {/* Tab Content */}\n <div className=\"min-h-[400px]\" role=\"tabpanel\">\n {activeTab === 'integrations' && (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {integrations.map((integration) => (\n <div\n key={integration.id}\n className=\"border-border bg-card hover:bg-muted/50 cursor-pointer rounded-lg border p-4 transition-colors\"\n >\n <div className=\"mb-3 flex items-center gap-3\">\n <span className=\"text-2xl\">\n {TYPE_ICONS[integration.type] ?? '⚙️'}\n </span>\n <div>\n <h3 className=\"font-medium\">{integration.name}</h3>\n <p className=\"text-muted-foreground text-sm\">\n {integration.type}\n </p>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <span\n className={`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[integration.status] ?? ''}`}\n >\n {integration.status}\n </span>\n <span className=\"text-muted-foreground text-xs\">\n {integration.createdAt.toLocaleDateString()}\n </span>\n </div>\n </div>\n ))}\n {integrations.length === 0 && (\n <div className=\"text-muted-foreground col-span-full flex h-64 items-center justify-center\">\n No integrations configured\n </div>\n )}\n </div>\n )}\n\n {activeTab === 'connections' && (\n <div className=\"border-border rounded-lg border\">\n <table className=\"w-full\">\n <thead className=\"border-border bg-muted/30 border-b\">\n <tr>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Connection\n </th>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Status\n </th>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Last Sync\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-border divide-y\">\n {connections.map((conn) => (\n <tr key={conn.id} className=\"hover:bg-muted/50\">\n <td className=\"px-4 py-3\">\n <div className=\"font-medium\">{conn.name}</div>\n </td>\n <td className=\"px-4 py-3\">\n <span\n className={`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[conn.status] ?? ''}`}\n >\n {conn.status}\n </span>\n </td>\n <td className=\"text-muted-foreground px-4 py-3 text-sm\">\n {conn.lastSyncAt?.toLocaleString() ?? 'Never'}\n </td>\n </tr>\n ))}\n {connections.length === 0 && (\n <tr>\n <td\n colSpan={3}\n className=\"text-muted-foreground px-4 py-8 text-center\"\n >\n No connections found\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n )}\n\n {activeTab === 'syncs' && (\n <div className=\"border-border rounded-lg border\">\n <table className=\"w-full\">\n <thead className=\"border-border bg-muted/30 border-b\">\n <tr>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Sync Config\n </th>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Frequency\n </th>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Status\n </th>\n <th className=\"px-4 py-3 text-left text-sm font-medium\">\n Records\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-border divide-y\">\n {syncConfigs.map((sync) => (\n <tr key={sync.id} className=\"hover:bg-muted/50\">\n <td className=\"px-4 py-3\">\n <div className=\"font-medium\">{sync.name}</div>\n <div className=\"text-muted-foreground text-sm\">\n {sync.sourceEntity} → {sync.targetEntity}\n </div>\n </td>\n <td className=\"px-4 py-3 text-sm\">{sync.frequency}</td>\n <td className=\"px-4 py-3\">\n <span\n className={`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[sync.status] ?? ''}`}\n >\n {sync.status}\n </span>\n </td>\n <td className=\"text-muted-foreground px-4 py-3 text-sm\">\n {sync.recordsSynced.toLocaleString()}\n </td>\n </tr>\n ))}\n {syncConfigs.length === 0 && (\n <tr>\n <td\n colSpan={4}\n className=\"text-muted-foreground px-4 py-8 text-center\"\n >\n No sync configurations found\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,gBAAwC;CAC5C,QACE;CACF,UAAU;CACV,WACE;CACF,cACE;CACF,SACE;CACF,OAAO;CACP,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ACb,oBAAC;MAAI,WAAU;gBACb,qBAAC;OAAM,WAAU;kBACf,oBAAC;QAAM,WAAU;kBACf,qBAAC;SACC,oBAAC;UAAG,WAAU;oBAA0C;WAEnD;SACL,oBAAC;UAAG,WAAU;oBAA0C;WAEnD;SACL,oBAAC;UAAG,WAAU;oBAA0C;WAEnD;SACL,oBAAC;UAAG,WAAU;oBAA0C;WAEnD;YACF;SACC,EACR,qBAAC;QAAM,WAAU;mBACd,YAAY,KAAK,SAChB,qBAAC;SAAiB,WAAU;;UAC1B,qBAAC;WAAG,WAAU;sBACZ,oBAAC;YAAI,WAAU;sBAAe,KAAK;aAAW,EAC9C,qBAAC;YAAI,WAAU;;aACZ,KAAK;aAAa;aAAI,KAAK;;aACxB;YACH;UACL,oBAAC;WAAG,WAAU;qBAAqB,KAAK;YAAe;UACvD,oBAAC;WAAG,WAAU;qBACZ,oBAAC;YACC,WAAW,4DAA4D,cAAc,KAAK,WAAW;sBAEpG,KAAK;aACD;YACJ;UACL,oBAAC;WAAG,WAAU;qBACX,KAAK,cAAc,gBAAgB;YACjC;;WAjBE,KAAK,GAkBT,CACL,EACD,YAAY,WAAW,KACtB,oBAAC,kBACC,oBAAC;SACC,SAAS;SACT,WAAU;mBACX;UAEI,GACF;SAED;QACF;OACJ;;KAEJ;;GACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIntegrationData.js","names":[],"sources":["../../../src/ui/hooks/useIntegrationData.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useState } from 'react';\nimport type {\n Connection,\n Integration,\n IntegrationHandlers,\n SyncConfig,\n} from '../../handlers/integration.handlers';\nimport { useTemplateRuntime } from '@contractspec/lib.example-shared-ui';\n\nexport interface IntegrationStats {\n totalIntegrations: number;\n activeIntegrations: number;\n totalConnections: number;\n connectedCount: number;\n totalSyncs: number;\n activeSyncs: number;\n}\n\nexport function useIntegrationData(projectId = 'local-project') {\n const { handlers } = useTemplateRuntime<{\n integration: IntegrationHandlers;\n }>();\n const integration = handlers.integration;\n const [integrations, setIntegrations] = useState<Integration[]>([]);\n const [connections, setConnections] = useState<Connection[]>([]);\n const [syncConfigs, setSyncConfigs] = useState<SyncConfig[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n try {\n setLoading(true);\n setError(null);\n\n const [integResult, connResult, syncResult] = await Promise.all([\n integration.listIntegrations({ projectId, limit: 100 }),\n integration.listConnections({ limit: 100 }),\n integration.listSyncConfigs({ limit: 100 }),\n ]);\n\n setIntegrations(integResult.integrations);\n setConnections(connResult.connections);\n setSyncConfigs(syncResult.configs);\n } catch (err) {\n setError(\n err instanceof Error ? err : new Error('Failed to load integrations')\n );\n } finally {\n setLoading(false);\n }\n }, [integration, projectId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n const stats: IntegrationStats = {\n totalIntegrations: integrations.length,\n activeIntegrations: integrations.filter((i) => i.status === 'ACTIVE')\n .length,\n totalConnections: connections.length,\n connectedCount: connections.filter((c) => c.status === 'CONNECTED').length,\n totalSyncs: syncConfigs.length,\n activeSyncs: syncConfigs.filter((s) => s.status === 'ACTIVE').length,\n };\n\n return {\n integrations,\n connections,\n syncConfigs,\n loading,\n error,\n stats,\n refetch: fetchData,\n };\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,mBAAmB,YAAY,iBAAiB;CAC9D,MAAM,EAAE,aAAa,oBAEjB;CACJ,MAAM,cAAc,SAAS;CAC7B,MAAM,CAAC,cAAc,mBAAmB,SAAwB,EAAE,CAAC;CACnE,MAAM,CAAC,aAAa,kBAAkB,SAAuB,EAAE,CAAC;CAChE,MAAM,CAAC,aAAa,kBAAkB,SAAuB,EAAE,CAAC;CAChE,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,OAAO,YAAY,SAAuB,KAAK;CAEtD,MAAM,YAAY,YAAY,YAAY;AACxC,MAAI;AACF,cAAW,KAAK;AAChB,YAAS,KAAK;GAEd,MAAM,CAAC,aAAa,YAAY,cAAc,MAAM,QAAQ,IAAI;IAC9D,YAAY,iBAAiB;KAAE;KAAW,OAAO;KAAK,CAAC;IACvD,YAAY,gBAAgB,EAAE,OAAO,KAAK,CAAC;IAC3C,YAAY,gBAAgB,EAAE,OAAO,KAAK,CAAC;IAC5C,CAAC;AAEF,mBAAgB,YAAY,aAAa;AACzC,kBAAe,WAAW,YAAY;AACtC,kBAAe,WAAW,QAAQ;WAC3B,KAAK;AACZ,YACE,eAAe,QAAQ,sBAAM,IAAI,MAAM,8BAA8B,CACtE;YACO;AACR,cAAW,MAAM;;IAElB,CAAC,aAAa,UAAU,CAAC;AAE5B,iBAAgB;AACd,aAAW;IACV,CAAC,UAAU,CAAC;AAYf,QAAO;EACL;EACA;EACA;EACA;EACA;EACA,OAhB8B;GAC9B,mBAAmB,aAAa;GAChC,oBAAoB,aAAa,QAAQ,MAAM,EAAE,WAAW,SAAS,CAClE;GACH,kBAAkB,YAAY;GAC9B,gBAAgB,YAAY,QAAQ,MAAM,EAAE,WAAW,YAAY,CAAC;GACpE,YAAY,YAAY;GACxB,aAAa,YAAY,QAAQ,MAAM,EAAE,WAAW,SAAS,CAAC;GAC/D;EASC,SAAS;EACV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.markdown.js","names":[],"sources":["../../../src/ui/renderers/integration.markdown.ts"],"sourcesContent":["/**\n * Markdown renderers for Integration Hub presentations\n */\nimport type { PresentationRenderer } from '@contractspec/lib.contracts';\n\n// Mock data for integration rendering\nconst mockIntegrations = [\n {\n id: 'int-1',\n name: 'Salesforce',\n type: 'CRM',\n status: 'ACTIVE',\n connectionCount: 3,\n },\n {\n id: 'int-2',\n name: 'HubSpot',\n type: 'MARKETING',\n status: 'ACTIVE',\n connectionCount: 2,\n },\n {\n id: 'int-3',\n name: 'Stripe',\n type: 'PAYMENT',\n status: 'ACTIVE',\n connectionCount: 1,\n },\n {\n id: 'int-4',\n name: 'Slack',\n type: 'COMMUNICATION',\n status: 'INACTIVE',\n connectionCount: 0,\n },\n {\n id: 'int-5',\n name: 'Google Sheets',\n type: 'DATA',\n status: 'ACTIVE',\n connectionCount: 5,\n },\n {\n id: 'int-6',\n name: 'PostHog',\n type: 'ANALYTICS',\n status: 'ACTIVE',\n connectionCount: 1,\n },\n];\n\nconst mockConnections = [\n {\n id: 'conn-1',\n integrationId: 'int-1',\n name: 'Production Salesforce',\n status: 'CONNECTED',\n lastSyncAt: '2024-01-16T10:00:00Z',\n },\n {\n id: 'conn-2',\n integrationId: 'int-1',\n name: 'Sandbox Salesforce',\n status: 'CONNECTED',\n lastSyncAt: '2024-01-15T14:00:00Z',\n },\n {\n id: 'conn-3',\n integrationId: 'int-2',\n name: 'Marketing HubSpot',\n status: 'CONNECTED',\n lastSyncAt: '2024-01-16T08:00:00Z',\n },\n {\n id: 'conn-4',\n integrationId: 'int-3',\n name: 'Stripe Live',\n status: 'CONNECTED',\n lastSyncAt: '2024-01-16T12:00:00Z',\n },\n {\n id: 'conn-5',\n integrationId: 'int-5',\n name: 'Analytics Sheet',\n status: 'ERROR',\n lastSyncAt: '2024-01-14T09:00:00Z',\n error: 'Authentication expired',\n },\n {\n id: 'conn-6',\n integrationId: 'int-6',\n name: 'PostHog Workspace',\n status: 'CONNECTED',\n lastSyncAt: '2024-01-16T11:45:00Z',\n },\n];\n\nconst mockSyncConfigs = [\n {\n id: 'sync-1',\n connectionId: 'conn-1',\n name: 'Contacts Sync',\n frequency: 'HOURLY',\n lastRunAt: '2024-01-16T10:00:00Z',\n status: 'SUCCESS',\n recordsSynced: 1250,\n },\n {\n id: 'sync-2',\n connectionId: 'conn-1',\n name: 'Opportunities Sync',\n frequency: 'DAILY',\n lastRunAt: '2024-01-16T00:00:00Z',\n status: 'SUCCESS',\n recordsSynced: 340,\n },\n {\n id: 'sync-3',\n connectionId: 'conn-3',\n name: 'Orders Sync',\n frequency: 'REALTIME',\n lastRunAt: '2024-01-16T12:30:00Z',\n status: 'SUCCESS',\n recordsSynced: 89,\n },\n {\n id: 'sync-4',\n connectionId: 'conn-5',\n name: 'Metrics Export',\n frequency: 'DAILY',\n lastRunAt: '2024-01-14T09:00:00Z',\n status: 'FAILED',\n recordsSynced: 0,\n },\n];\n\n/**\n * Markdown renderer for Integration Dashboard\n */\nexport const integrationDashboardMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc) => {\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'IntegrationDashboard'\n ) {\n throw new Error(\n 'integrationDashboardMarkdownRenderer: not IntegrationDashboard'\n );\n }\n\n const integrations = mockIntegrations;\n const connections = mockConnections;\n const syncs = mockSyncConfigs;\n\n // Calculate stats\n const activeIntegrations = integrations.filter(\n (i) => i.status === 'ACTIVE'\n );\n const connectedConnections = connections.filter(\n (c) => c.status === 'CONNECTED'\n );\n const errorConnections = connections.filter((c) => c.status === 'ERROR');\n const successfulSyncs = syncs.filter((s) => s.status === 'SUCCESS');\n const totalRecordsSynced = successfulSyncs.reduce(\n (sum, s) => sum + s.recordsSynced,\n 0\n );\n\n const lines: string[] = [\n '# Integration Hub',\n '',\n '> Connect and sync data with external services',\n '',\n '## Overview',\n '',\n '| Metric | Value |',\n '|--------|-------|',\n `| Active Integrations | ${activeIntegrations.length} |`,\n `| Connected Services | ${connectedConnections.length} |`,\n `| Error Connections | ${errorConnections.length} |`,\n `| Sync Configs | ${syncs.length} |`,\n `| Records Synced (24h) | ${totalRecordsSynced.toLocaleString()} |`,\n '',\n '## Integrations',\n '',\n '| Name | Type | Connections | Status |',\n '|------|------|-------------|--------|',\n ];\n\n for (const integration of integrations) {\n const statusIcon = integration.status === 'ACTIVE' ? '🟢' : '⚫';\n lines.push(\n `| ${integration.name} | ${integration.type} | ${integration.connectionCount} | ${statusIcon} ${integration.status} |`\n );\n }\n\n lines.push('');\n lines.push('## Recent Sync Activity');\n lines.push('');\n lines.push('| Sync | Frequency | Last Run | Records | Status |');\n lines.push('|------|-----------|----------|---------|--------|');\n\n for (const sync of syncs) {\n const lastRun = new Date(sync.lastRunAt).toLocaleString();\n const statusIcon = sync.status === 'SUCCESS' ? '✅' : '❌';\n lines.push(\n `| ${sync.name} | ${sync.frequency} | ${lastRun} | ${sync.recordsSynced} | ${statusIcon} ${sync.status} |`\n );\n }\n\n if (errorConnections.length > 0) {\n lines.push('');\n lines.push('## ⚠️ Connections with Errors');\n lines.push('');\n for (const conn of errorConnections) {\n const integration = integrations.find(\n (i) => i.id === conn.integrationId\n );\n lines.push(\n `- **${conn.name}** (${integration?.name ?? 'Unknown'}): ${(conn as { error?: string }).error ?? 'Unknown error'}`\n );\n }\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for Connection List\n */\nexport const connectionListMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc) => {\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'ConnectionList'\n ) {\n throw new Error('connectionListMarkdownRenderer: not ConnectionList');\n }\n\n const connections = mockConnections;\n const integrations = mockIntegrations;\n\n const lines: string[] = [\n '# Connections',\n '',\n '> Manage connections to external services',\n '',\n ];\n\n // Group by integration\n for (const integration of integrations) {\n const intConnections = connections.filter(\n (c) => c.integrationId === integration.id\n );\n\n if (intConnections.length === 0) continue;\n\n lines.push(`## ${integration.name}`);\n lines.push('');\n lines.push('| Connection | Status | Last Sync |');\n lines.push('|------------|--------|-----------|');\n\n for (const conn of intConnections) {\n const lastSync = new Date(conn.lastSyncAt).toLocaleString();\n const statusIcon =\n conn.status === 'CONNECTED'\n ? '🟢'\n : conn.status === 'ERROR'\n ? '🔴'\n : '⚫';\n lines.push(\n `| ${conn.name} | ${statusIcon} ${conn.status} | ${lastSync} |`\n );\n }\n\n lines.push('');\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for Sync Config\n */\nexport const syncConfigMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc) => {\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'SyncConfigEditor'\n ) {\n throw new Error('syncConfigMarkdownRenderer: not SyncConfigEditor');\n }\n\n const syncs = mockSyncConfigs;\n const connections = mockConnections;\n\n const lines: string[] = [\n '# Sync Configurations',\n '',\n '> Configure automated data synchronization',\n '',\n ];\n\n for (const sync of syncs) {\n const connection = connections.find((c) => c.id === sync.connectionId);\n const statusIcon = sync.status === 'SUCCESS' ? '✅' : '❌';\n\n lines.push(`## ${sync.name}`);\n lines.push('');\n lines.push(`**Connection:** ${connection?.name ?? 'Unknown'}`);\n lines.push(`**Frequency:** ${sync.frequency}`);\n lines.push(`**Status:** ${statusIcon} ${sync.status}`);\n lines.push(`**Last Run:** ${new Date(sync.lastRunAt).toLocaleString()}`);\n lines.push(`**Records Synced:** ${sync.recordsSynced.toLocaleString()}`);\n lines.push('');\n }\n\n lines.push('## Frequency Options');\n lines.push('');\n lines.push('- **REALTIME**: Sync on every change');\n lines.push('- **HOURLY**: Sync every hour');\n lines.push('- **DAILY**: Sync once per day');\n lines.push('- **WEEKLY**: Sync once per week');\n lines.push('- **MANUAL**: Sync only when triggered');\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n"],"mappings":";AAMA,MAAM,mBAAmB;CACvB;EACE,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,iBAAiB;EAClB;CACD;EACE,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,iBAAiB;EAClB;CACD;EACE,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,iBAAiB;EAClB;CACD;EACE,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,iBAAiB;EAClB;CACD;EACE,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,iB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