@fullstackhouse/open-mercato-data-sync-durable 0.1.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 (175) hide show
  1. package/README.md +86 -0
  2. package/dist/engine/durable-run.js +130 -0
  3. package/dist/engine/durable-run.js.map +7 -0
  4. package/dist/index.js +5 -0
  5. package/dist/index.js.map +7 -0
  6. package/dist/kinds/data-sync-run.js +57 -0
  7. package/dist/kinds/data-sync-run.js.map +7 -0
  8. package/dist/mirror-version.js +5 -0
  9. package/dist/mirror-version.js.map +7 -0
  10. package/dist/mirror.manifest.json +65 -0
  11. package/dist/modules/data_sync/acl.js +8 -0
  12. package/dist/modules/data_sync/acl.js.map +7 -0
  13. package/dist/modules/data_sync/api/mappings/[id]/route.js +17 -0
  14. package/dist/modules/data_sync/api/mappings/[id]/route.js.map +7 -0
  15. package/dist/modules/data_sync/api/mappings/route.js +15 -0
  16. package/dist/modules/data_sync/api/mappings/route.js.map +7 -0
  17. package/dist/modules/data_sync/api/options.js +13 -0
  18. package/dist/modules/data_sync/api/options.js.map +7 -0
  19. package/dist/modules/data_sync/api/run.js +59 -0
  20. package/dist/modules/data_sync/api/run.js.map +7 -0
  21. package/dist/modules/data_sync/api/runs/[id]/cancel.js +13 -0
  22. package/dist/modules/data_sync/api/runs/[id]/cancel.js.map +7 -0
  23. package/dist/modules/data_sync/api/runs/[id]/retry.js +13 -0
  24. package/dist/modules/data_sync/api/runs/[id]/retry.js.map +7 -0
  25. package/dist/modules/data_sync/api/runs/[id]/route.js +13 -0
  26. package/dist/modules/data_sync/api/runs/[id]/route.js.map +7 -0
  27. package/dist/modules/data_sync/api/runs.js +13 -0
  28. package/dist/modules/data_sync/api/runs.js.map +7 -0
  29. package/dist/modules/data_sync/api/schedules/[id]/route.js +17 -0
  30. package/dist/modules/data_sync/api/schedules/[id]/route.js.map +7 -0
  31. package/dist/modules/data_sync/api/schedules/route.js +15 -0
  32. package/dist/modules/data_sync/api/schedules/route.js.map +7 -0
  33. package/dist/modules/data_sync/api/schedules/serialize.js +6 -0
  34. package/dist/modules/data_sync/api/schedules/serialize.js.map +7 -0
  35. package/dist/modules/data_sync/api/validate.js +13 -0
  36. package/dist/modules/data_sync/api/validate.js.map +7 -0
  37. package/dist/modules/data_sync/backend/data-sync/page.js +7 -0
  38. package/dist/modules/data_sync/backend/data-sync/page.js.map +7 -0
  39. package/dist/modules/data_sync/backend/data-sync/page.meta.js +6 -0
  40. package/dist/modules/data_sync/backend/data-sync/page.meta.js.map +7 -0
  41. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +7 -0
  42. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +7 -0
  43. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.meta.js +6 -0
  44. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.meta.js.map +7 -0
  45. package/dist/modules/data_sync/components/IntegrationScheduleTab.js +9 -0
  46. package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +7 -0
  47. package/dist/modules/data_sync/components/RunParameterFields.js +13 -0
  48. package/dist/modules/data_sync/components/RunParameterFields.js.map +7 -0
  49. package/dist/modules/data_sync/data/entities.js +9 -0
  50. package/dist/modules/data_sync/data/entities.js.map +7 -0
  51. package/dist/modules/data_sync/data/validators.js +12 -0
  52. package/dist/modules/data_sync/data/validators.js.map +7 -0
  53. package/dist/modules/data_sync/di.js +33 -0
  54. package/dist/modules/data_sync/di.js.map +7 -0
  55. package/dist/modules/data_sync/events.js +9 -0
  56. package/dist/modules/data_sync/events.js.map +7 -0
  57. package/dist/modules/data_sync/extension-points.js +8 -0
  58. package/dist/modules/data_sync/extension-points.js.map +7 -0
  59. package/dist/modules/data_sync/i18n/de.json +135 -0
  60. package/dist/modules/data_sync/i18n/en.json +135 -0
  61. package/dist/modules/data_sync/i18n/es.json +135 -0
  62. package/dist/modules/data_sync/i18n/ko.json +135 -0
  63. package/dist/modules/data_sync/i18n/pl.json +135 -0
  64. package/dist/modules/data_sync/index.js +6 -0
  65. package/dist/modules/data_sync/index.js.map +7 -0
  66. package/dist/modules/data_sync/lib/abandoned-run.js +6 -0
  67. package/dist/modules/data_sync/lib/abandoned-run.js.map +7 -0
  68. package/dist/modules/data_sync/lib/adapter-registry.js +10 -0
  69. package/dist/modules/data_sync/lib/adapter-registry.js.map +7 -0
  70. package/dist/modules/data_sync/lib/adapter.js +2 -0
  71. package/dist/modules/data_sync/lib/adapter.js.map +7 -0
  72. package/dist/modules/data_sync/lib/adopt-on-delivery.js +35 -0
  73. package/dist/modules/data_sync/lib/adopt-on-delivery.js.map +7 -0
  74. package/dist/modules/data_sync/lib/batch-stream.js +6 -0
  75. package/dist/modules/data_sync/lib/batch-stream.js.map +7 -0
  76. package/dist/modules/data_sync/lib/id-mapping.js +6 -0
  77. package/dist/modules/data_sync/lib/id-mapping.js.map +7 -0
  78. package/dist/modules/data_sync/lib/queue-policy.js +11 -0
  79. package/dist/modules/data_sync/lib/queue-policy.js.map +7 -0
  80. package/dist/modules/data_sync/lib/queue.js +6 -0
  81. package/dist/modules/data_sync/lib/queue.js.map +7 -0
  82. package/dist/modules/data_sync/lib/run-parameters.js +8 -0
  83. package/dist/modules/data_sync/lib/run-parameters.js.map +7 -0
  84. package/dist/modules/data_sync/lib/start-cursor.js +8 -0
  85. package/dist/modules/data_sync/lib/start-cursor.js.map +7 -0
  86. package/dist/modules/data_sync/lib/start-run.js +51 -0
  87. package/dist/modules/data_sync/lib/start-run.js.map +7 -0
  88. package/dist/modules/data_sync/lib/sync-engine.js +6 -0
  89. package/dist/modules/data_sync/lib/sync-engine.js.map +7 -0
  90. package/dist/modules/data_sync/lib/sync-run-service.js +7 -0
  91. package/dist/modules/data_sync/lib/sync-run-service.js.map +7 -0
  92. package/dist/modules/data_sync/lib/sync-schedule-service.js +6 -0
  93. package/dist/modules/data_sync/lib/sync-schedule-service.js.map +7 -0
  94. package/dist/modules/data_sync/lib/syncRunStatus.js +9 -0
  95. package/dist/modules/data_sync/lib/syncRunStatus.js.map +7 -0
  96. package/dist/modules/data_sync/lib/version-guard.js +14 -0
  97. package/dist/modules/data_sync/lib/version-guard.js.map +7 -0
  98. package/dist/modules/data_sync/migrations/Migration20260304113737.js +6 -0
  99. package/dist/modules/data_sync/migrations/Migration20260304113737.js.map +7 -0
  100. package/dist/modules/data_sync/migrations/Migration20260810120000.js +6 -0
  101. package/dist/modules/data_sync/migrations/Migration20260810120000.js.map +7 -0
  102. package/dist/modules/data_sync/setup.js +8 -0
  103. package/dist/modules/data_sync/setup.js.map +7 -0
  104. package/dist/modules/data_sync/workers/sync-export.js +19 -0
  105. package/dist/modules/data_sync/workers/sync-export.js.map +7 -0
  106. package/dist/modules/data_sync/workers/sync-import.js +19 -0
  107. package/dist/modules/data_sync/workers/sync-import.js.map +7 -0
  108. package/dist/modules/data_sync/workers/sync-scheduled.js +8 -0
  109. package/dist/modules/data_sync/workers/sync-scheduled.js.map +7 -0
  110. package/generated/entities/sync_cursor/index.ts +8 -0
  111. package/generated/entities/sync_mapping/index.ts +8 -0
  112. package/generated/entities/sync_run/index.ts +22 -0
  113. package/generated/entities/sync_schedule/index.ts +16 -0
  114. package/generated/entities.ids.generated.ts +13 -0
  115. package/package.json +135 -0
  116. package/src/compat/mirror-shape.test.ts +106 -0
  117. package/src/compat/seams.test.ts +97 -0
  118. package/src/engine/durable-run.ts +231 -0
  119. package/src/index.ts +4 -0
  120. package/src/kinds/data-sync-run.ts +104 -0
  121. package/src/mirror-version.ts +3 -0
  122. package/src/mirror.manifest.json +65 -0
  123. package/src/modules/data_sync/__integration__/TC-DSD-001.spec.ts +80 -0
  124. package/src/modules/data_sync/acl.ts +5 -0
  125. package/src/modules/data_sync/api/mappings/[id]/route.ts +12 -0
  126. package/src/modules/data_sync/api/mappings/route.ts +11 -0
  127. package/src/modules/data_sync/api/options.ts +10 -0
  128. package/src/modules/data_sync/api/run.ts +103 -0
  129. package/src/modules/data_sync/api/runs/[id]/cancel.ts +10 -0
  130. package/src/modules/data_sync/api/runs/[id]/retry.ts +10 -0
  131. package/src/modules/data_sync/api/runs/[id]/route.ts +10 -0
  132. package/src/modules/data_sync/api/runs.ts +10 -0
  133. package/src/modules/data_sync/api/schedules/[id]/route.ts +12 -0
  134. package/src/modules/data_sync/api/schedules/route.ts +11 -0
  135. package/src/modules/data_sync/api/schedules/serialize.ts +4 -0
  136. package/src/modules/data_sync/api/validate.ts +10 -0
  137. package/src/modules/data_sync/backend/data-sync/page.meta.ts +4 -0
  138. package/src/modules/data_sync/backend/data-sync/page.tsx +5 -0
  139. package/src/modules/data_sync/backend/data-sync/runs/[id]/page.meta.ts +4 -0
  140. package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +5 -0
  141. package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +6 -0
  142. package/src/modules/data_sync/components/RunParameterFields.tsx +5 -0
  143. package/src/modules/data_sync/data/entities.ts +4 -0
  144. package/src/modules/data_sync/data/validators.ts +4 -0
  145. package/src/modules/data_sync/di.ts +57 -0
  146. package/src/modules/data_sync/events.ts +5 -0
  147. package/src/modules/data_sync/extension-points.ts +5 -0
  148. package/src/modules/data_sync/i18n/de.json +135 -0
  149. package/src/modules/data_sync/i18n/en.json +135 -0
  150. package/src/modules/data_sync/i18n/es.json +135 -0
  151. package/src/modules/data_sync/i18n/ko.json +135 -0
  152. package/src/modules/data_sync/i18n/pl.json +135 -0
  153. package/src/modules/data_sync/index.ts +4 -0
  154. package/src/modules/data_sync/lib/adapter-registry.ts +4 -0
  155. package/src/modules/data_sync/lib/adapter.ts +3 -0
  156. package/src/modules/data_sync/lib/adopt-on-delivery.ts +69 -0
  157. package/src/modules/data_sync/lib/batch-stream.ts +4 -0
  158. package/src/modules/data_sync/lib/id-mapping.ts +4 -0
  159. package/src/modules/data_sync/lib/queue-policy.ts +4 -0
  160. package/src/modules/data_sync/lib/queue.ts +4 -0
  161. package/src/modules/data_sync/lib/run-parameters.ts +4 -0
  162. package/src/modules/data_sync/lib/start-cursor.ts +4 -0
  163. package/src/modules/data_sync/lib/start-run.ts +106 -0
  164. package/src/modules/data_sync/lib/sync-engine.ts +4 -0
  165. package/src/modules/data_sync/lib/sync-run-service.ts +4 -0
  166. package/src/modules/data_sync/lib/sync-schedule-service.ts +4 -0
  167. package/src/modules/data_sync/lib/syncRunStatus.ts +4 -0
  168. package/src/modules/data_sync/lib/version-guard.ts +27 -0
  169. package/src/modules/data_sync/migrations/.snapshot-open-mercato.json +1013 -0
  170. package/src/modules/data_sync/migrations/Migration20260304113737.ts +4 -0
  171. package/src/modules/data_sync/migrations/Migration20260810120000.ts +4 -0
  172. package/src/modules/data_sync/setup.ts +5 -0
  173. package/src/modules/data_sync/workers/sync-export.ts +20 -0
  174. package/src/modules/data_sync/workers/sync-import.ts +20 -0
  175. package/src/modules/data_sync/workers/sync-scheduled.ts +5 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/adapter.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/adapter.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/adapter'\n"],
5
+ "mappings": "AAEA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,35 @@
1
+ import { createLogger } from "@open-mercato/shared/lib/logger";
2
+ import { EXPORT_KIND, IMPORT_KIND, syncIdempotencyKey, syncLockKey } from "../../../kinds/data-sync-run.js";
3
+ const logger = createLogger("data_sync").child({ component: "adopt-on-delivery" });
4
+ function adoptOnDelivery(direction) {
5
+ return async function handle(job, ctx) {
6
+ const { runId, batchSize, scope } = job.payload;
7
+ const durable = ctx.resolve("durableWorkService");
8
+ const runService = ctx.resolve("dataSyncRunService");
9
+ const run = await runService.getRun(runId, scope);
10
+ if (!run) {
11
+ logger.warn("Ignoring a delivery for a run that no longer exists", { runId });
12
+ return;
13
+ }
14
+ if (run.status === "completed" || run.status === "failed" || run.status === "cancelled") {
15
+ logger.warn("Ignoring a delivery for a run that already finished", { runId, status: run.status });
16
+ return;
17
+ }
18
+ await durable.startAndEnqueue(
19
+ {
20
+ kind: direction === "import" ? IMPORT_KIND : EXPORT_KIND,
21
+ input: { runId, batchSize: batchSize ?? 100, direction },
22
+ lockKey: syncLockKey(run.integrationId, run.entityType, run.direction),
23
+ idempotencyKey: syncIdempotencyKey(runId),
24
+ subject: { type: "data_sync.run", id: runId },
25
+ createdBy: scope.userId ?? null
26
+ },
27
+ { tenantId: scope.tenantId, organizationId: scope.organizationId }
28
+ );
29
+ logger.info("Adopted a core-path sync run as durable work", { runId, direction });
30
+ };
31
+ }
32
+ export {
33
+ adoptOnDelivery
34
+ };
35
+ //# sourceMappingURL=adopt-on-delivery.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/adopt-on-delivery.ts"],
4
+ "sourcesContent": ["// What happens when a run arrives on core's queue rather than through the durable start path.\n//\n// `sync_excel`, `sync_akeneo`'s first import, the scheduler, and anything else that imports\n// core's `startDataSyncRun` directly still enqueue a plain queue message. Core's own worker is\n// no longer registered \u2014 ours has its id \u2014 so without this those runs would simply never start.\n//\n// Rather than running them non-durably, the delivery is *adopted*: a durable job is created for\n// the run it names and the queue message ends there. The run then gets the same lease, the same\n// resumable slices and the same repair loop as one started durably. A caller that never heard\n// of this package gets the guarantees anyway.\n\nimport type { JobContext, QueuedJob } from '@open-mercato/queue'\nimport type { DurableWorkService } from '@fullstackhouse/open-mercato-durable-work'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nimport { EXPORT_KIND, IMPORT_KIND, syncIdempotencyKey, syncLockKey } from '../../../kinds/data-sync-run'\n\nconst logger = createLogger('data_sync').child({ component: 'adopt-on-delivery' })\n\ntype SyncJobPayload = {\n runId: string\n batchSize: number\n scope: { organizationId: string; tenantId: string; userId?: string | null }\n}\n\ntype HandlerContext = JobContext & { resolve: <T = unknown>(name: string) => T }\n\ntype RunRow = {\n id: string\n integrationId: string\n entityType: string\n direction: string\n status: string\n}\n\nexport function adoptOnDelivery(direction: 'import' | 'export') {\n return async function handle(job: QueuedJob<SyncJobPayload>, ctx: HandlerContext): Promise<void> {\n const { runId, batchSize, scope } = job.payload\n const durable = ctx.resolve<DurableWorkService>('durableWorkService')\n const runService = ctx.resolve<{ getRun(id: string, scope: unknown): Promise<RunRow | null> }>('dataSyncRunService')\n\n const run = await runService.getRun(runId, scope)\n if (!run) {\n logger.warn('Ignoring a delivery for a run that no longer exists', { runId })\n return\n }\n if (run.status === 'completed' || run.status === 'failed' || run.status === 'cancelled') {\n logger.warn('Ignoring a delivery for a run that already finished', { runId, status: run.status })\n return\n }\n\n // Idempotent by the run id, so a redelivery of the same queue message adopts once. The\n // lock key is the same one the durable start path uses, so a run that is already being\n // driven refuses this rather than being driven twice.\n await durable.startAndEnqueue(\n {\n kind: direction === 'import' ? IMPORT_KIND : EXPORT_KIND,\n input: { runId, batchSize: batchSize ?? 100, direction },\n lockKey: syncLockKey(run.integrationId, run.entityType, run.direction),\n idempotencyKey: syncIdempotencyKey(runId),\n subject: { type: 'data_sync.run', id: runId },\n createdBy: scope.userId ?? null,\n },\n { tenantId: scope.tenantId, organizationId: scope.organizationId },\n )\n\n logger.info('Adopted a core-path sync run as durable work', { runId, direction })\n }\n}\n"],
5
+ "mappings": "AAaA,SAAS,oBAAoB;AAE7B,SAAS,aAAa,aAAa,oBAAoB,mBAAmB;AAE1E,MAAM,SAAS,aAAa,WAAW,EAAE,MAAM,EAAE,WAAW,oBAAoB,CAAC;AAkB1E,SAAS,gBAAgB,WAAgC;AAC9D,SAAO,eAAe,OAAO,KAAgC,KAAoC;AAC/F,UAAM,EAAE,OAAO,WAAW,MAAM,IAAI,IAAI;AACxC,UAAM,UAAU,IAAI,QAA4B,oBAAoB;AACpE,UAAM,aAAa,IAAI,QAAwE,oBAAoB;AAEnH,UAAM,MAAM,MAAM,WAAW,OAAO,OAAO,KAAK;AAChD,QAAI,CAAC,KAAK;AACR,aAAO,KAAK,uDAAuD,EAAE,MAAM,CAAC;AAC5E;AAAA,IACF;AACA,QAAI,IAAI,WAAW,eAAe,IAAI,WAAW,YAAY,IAAI,WAAW,aAAa;AACvF,aAAO,KAAK,uDAAuD,EAAE,OAAO,QAAQ,IAAI,OAAO,CAAC;AAChG;AAAA,IACF;AAKA,UAAM,QAAQ;AAAA,MACZ;AAAA,QACE,MAAM,cAAc,WAAW,cAAc;AAAA,QAC7C,OAAO,EAAE,OAAO,WAAW,aAAa,KAAK,UAAU;AAAA,QACvD,SAAS,YAAY,IAAI,eAAe,IAAI,YAAY,IAAI,SAAS;AAAA,QACrE,gBAAgB,mBAAmB,KAAK;AAAA,QACxC,SAAS,EAAE,MAAM,iBAAiB,IAAI,MAAM;AAAA,QAC5C,WAAW,MAAM,UAAU;AAAA,MAC7B;AAAA,MACA,EAAE,UAAU,MAAM,UAAU,gBAAgB,MAAM,eAAe;AAAA,IACnE;AAEA,WAAO,KAAK,gDAAgD,EAAE,OAAO,UAAU,CAAC;AAAA,EAClF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/batch-stream";
2
+ import { forEachBatch } from "@open-mercato/core/modules/data_sync/lib/batch-stream";
3
+ export {
4
+ forEachBatch
5
+ };
6
+ //# sourceMappingURL=batch-stream.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/batch-stream.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/batch-stream.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/batch-stream'\nexport { forEachBatch } from '@open-mercato/core/modules/data_sync/lib/batch-stream'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/id-mapping";
2
+ import { createExternalIdMappingService } from "@open-mercato/core/modules/data_sync/lib/id-mapping";
3
+ export {
4
+ createExternalIdMappingService
5
+ };
6
+ //# sourceMappingURL=id-mapping.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/id-mapping.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/id-mapping.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/id-mapping'\nexport { createExternalIdMappingService } from '@open-mercato/core/modules/data_sync/lib/id-mapping'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,sCAAsC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/queue-policy";
2
+ import { DATA_SYNC_EXPORT_QUEUE, DATA_SYNC_IMPORT_QUEUE, DATA_SYNC_LOCK_DURATION_MS, DATA_SYNC_MAX_STALLED_COUNT, DATA_SYNC_QUEUE_ATTEMPTS, DATA_SYNC_RESUMABLE_QUEUES } from "@open-mercato/core/modules/data_sync/lib/queue-policy";
3
+ export {
4
+ DATA_SYNC_EXPORT_QUEUE,
5
+ DATA_SYNC_IMPORT_QUEUE,
6
+ DATA_SYNC_LOCK_DURATION_MS,
7
+ DATA_SYNC_MAX_STALLED_COUNT,
8
+ DATA_SYNC_QUEUE_ATTEMPTS,
9
+ DATA_SYNC_RESUMABLE_QUEUES
10
+ };
11
+ //# sourceMappingURL=queue-policy.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/queue-policy.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/queue-policy.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/queue-policy'\nexport { DATA_SYNC_EXPORT_QUEUE, DATA_SYNC_IMPORT_QUEUE, DATA_SYNC_LOCK_DURATION_MS, DATA_SYNC_MAX_STALLED_COUNT, DATA_SYNC_QUEUE_ATTEMPTS, DATA_SYNC_RESUMABLE_QUEUES } from '@open-mercato/core/modules/data_sync/lib/queue-policy'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,wBAAwB,wBAAwB,4BAA4B,6BAA6B,0BAA0B,kCAAkC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/queue";
2
+ import { getSyncQueue } from "@open-mercato/core/modules/data_sync/lib/queue";
3
+ export {
4
+ getSyncQueue
5
+ };
6
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/queue.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/queue.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/queue'\nexport { getSyncQueue } from '@open-mercato/core/modules/data_sync/lib/queue'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/run-parameters";
2
+ import { getApplicableRunParameters, isReservedRunParameterKey, normalizeRunParameters } from "@open-mercato/core/modules/data_sync/lib/run-parameters";
3
+ export {
4
+ getApplicableRunParameters,
5
+ isReservedRunParameterKey,
6
+ normalizeRunParameters
7
+ };
8
+ //# sourceMappingURL=run-parameters.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/run-parameters.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/run-parameters.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/run-parameters'\nexport { getApplicableRunParameters, isReservedRunParameterKey, normalizeRunParameters } from '@open-mercato/core/modules/data_sync/lib/run-parameters'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,4BAA4B,2BAA2B,8BAA8B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/start-cursor";
2
+ import { persistsSharedCursor, resolveAdapterForIntegration, resolveStartCursor } from "@open-mercato/core/modules/data_sync/lib/start-cursor";
3
+ export {
4
+ persistsSharedCursor,
5
+ resolveAdapterForIntegration,
6
+ resolveStartCursor
7
+ };
8
+ //# sourceMappingURL=start-cursor.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/start-cursor.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/start-cursor.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/start-cursor'\nexport { persistsSharedCursor, resolveAdapterForIntegration, resolveStartCursor } from '@open-mercato/core/modules/data_sync/lib/start-cursor'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,sBAAsB,8BAA8B,0BAA0B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,51 @@
1
+ import { IMPORT_KIND, EXPORT_KIND, syncIdempotencyKey, syncLockKey } from "../../../kinds/data-sync-run.js";
2
+ async function startDataSyncRun(params) {
3
+ const { syncRunService, progressService, durableWorkService, scope, input } = params;
4
+ const progressJob = await progressService.createJob(
5
+ {
6
+ jobType: input.progressJob?.jobType ?? `data_sync:${input.direction}`,
7
+ name: input.progressJob?.name ?? `Data sync ${input.integrationId} \u2014 ${input.entityType}`,
8
+ description: input.progressJob?.description ?? `${input.entityType} ${input.direction}`,
9
+ cancellable: true,
10
+ meta: {
11
+ integrationId: input.integrationId,
12
+ entityType: input.entityType,
13
+ direction: input.direction,
14
+ ...input.progressJob?.meta ?? {}
15
+ }
16
+ },
17
+ { tenantId: scope.tenantId, organizationId: scope.organizationId, userId: scope.userId }
18
+ );
19
+ const run = await syncRunService.createRun(
20
+ {
21
+ integrationId: input.integrationId,
22
+ entityType: input.entityType,
23
+ direction: input.direction,
24
+ cursor: input.cursor ?? null,
25
+ triggeredBy: input.triggeredBy ?? scope.userId ?? null,
26
+ parameters: input.parameters ?? null,
27
+ progressJobId: progressJob.id
28
+ },
29
+ { organizationId: scope.organizationId, tenantId: scope.tenantId }
30
+ );
31
+ await durableWorkService.startAndEnqueue(
32
+ {
33
+ kind: input.direction === "import" ? IMPORT_KIND : EXPORT_KIND,
34
+ input: { runId: run.id, batchSize: input.batchSize ?? 100, direction: input.direction },
35
+ // One live run per integration, entity and direction. Two imports of the same entity
36
+ // would interleave over a single cursor and silently lose rows.
37
+ lockKey: syncLockKey(input.integrationId, input.entityType, input.direction),
38
+ // Makes a retried start return the job that already exists instead of a second one.
39
+ idempotencyKey: syncIdempotencyKey(run.id),
40
+ subject: { type: "data_sync.run", id: run.id },
41
+ progressJobId: progressJob.id,
42
+ createdBy: scope.userId ?? null
43
+ },
44
+ { tenantId: scope.tenantId, organizationId: scope.organizationId }
45
+ );
46
+ return { run, progressJob };
47
+ }
48
+ export {
49
+ startDataSyncRun
50
+ };
51
+ //# sourceMappingURL=start-run.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/start-run.ts"],
4
+ "sourcesContent": ["// The durable start path.\n//\n// Same signature and same return shape as core's `startDataSyncRun`, so every caller \u2014 the run\n// route, `sync_excel`, `sync_akeneo`'s first import \u2014 keeps working untouched. What changes is\n// what gets created: a durable job instead of a queue message, in the same transaction as the\n// run row where the transport allows it.\n\nimport type { DurableWorkService } from '@fullstackhouse/open-mercato-durable-work'\n\nimport { IMPORT_KIND, EXPORT_KIND, syncIdempotencyKey, syncLockKey } from '../../../kinds/data-sync-run'\n\nexport type {\n DataSyncStartScope,\n StartDataSyncRunInput,\n} from '@open-mercato/core/modules/data_sync/lib/start-run'\n\ntype StartScope = { organizationId: string; tenantId: string; userId?: string | null }\n\ntype StartInput = {\n integrationId: string\n entityType: string\n direction: 'import' | 'export'\n cursor?: string | null\n triggeredBy?: string | null\n batchSize?: number\n parameters?: Record<string, unknown> | null\n createProgressJob?: boolean\n progressJob?: {\n jobType?: string\n name?: string\n description?: string\n cancellable?: boolean\n meta?: Record<string, unknown>\n }\n}\n\ntype ProgressServiceLike = {\n createJob(input: Record<string, unknown>, ctx: Record<string, unknown>): Promise<{ id: string }>\n}\n\ntype SyncRunServiceLike = {\n createRun(input: Record<string, unknown>, scope: Record<string, unknown>): Promise<{ id: string }>\n}\n\nexport async function startDataSyncRun(params: {\n syncRunService: SyncRunServiceLike\n progressService: ProgressServiceLike\n durableWorkService: DurableWorkService\n scope: StartScope\n input: StartInput\n}) {\n const { syncRunService, progressService, durableWorkService, scope, input } = params\n\n // Always created, never optional as it is in core.\n //\n // Core consults the progress row's cancellation flag once per batch, and that check is what\n // gives a slice its hand-back point. A run without a progress job has no batch boundary to\n // stop at, so it could only be interrupted between whole runs \u2014 which for a multi-day\n // backfill is the same as not being interruptible. See docs/adr/0004.\n const progressJob = await progressService.createJob(\n {\n jobType: input.progressJob?.jobType ?? `data_sync:${input.direction}`,\n name: input.progressJob?.name ?? `Data sync ${input.integrationId} \u2014 ${input.entityType}`,\n description: input.progressJob?.description ?? `${input.entityType} ${input.direction}`,\n cancellable: true,\n meta: {\n integrationId: input.integrationId,\n entityType: input.entityType,\n direction: input.direction,\n ...(input.progressJob?.meta ?? {}),\n },\n },\n { tenantId: scope.tenantId, organizationId: scope.organizationId, userId: scope.userId },\n )\n\n const run = await syncRunService.createRun(\n {\n integrationId: input.integrationId,\n entityType: input.entityType,\n direction: input.direction,\n cursor: input.cursor ?? null,\n triggeredBy: input.triggeredBy ?? scope.userId ?? null,\n parameters: input.parameters ?? null,\n progressJobId: progressJob.id,\n },\n { organizationId: scope.organizationId, tenantId: scope.tenantId },\n )\n\n await durableWorkService.startAndEnqueue(\n {\n kind: input.direction === 'import' ? IMPORT_KIND : EXPORT_KIND,\n input: { runId: run.id, batchSize: input.batchSize ?? 100, direction: input.direction },\n // One live run per integration, entity and direction. Two imports of the same entity\n // would interleave over a single cursor and silently lose rows.\n lockKey: syncLockKey(input.integrationId, input.entityType, input.direction),\n // Makes a retried start return the job that already exists instead of a second one.\n idempotencyKey: syncIdempotencyKey(run.id),\n subject: { type: 'data_sync.run', id: run.id },\n progressJobId: progressJob.id,\n createdBy: scope.userId ?? null,\n },\n { tenantId: scope.tenantId, organizationId: scope.organizationId },\n )\n\n return { run, progressJob }\n}\n"],
5
+ "mappings": "AASA,SAAS,aAAa,aAAa,oBAAoB,mBAAmB;AAmC1E,eAAsB,iBAAiB,QAMpC;AACD,QAAM,EAAE,gBAAgB,iBAAiB,oBAAoB,OAAO,MAAM,IAAI;AAQ9E,QAAM,cAAc,MAAM,gBAAgB;AAAA,IACxC;AAAA,MACE,SAAS,MAAM,aAAa,WAAW,aAAa,MAAM,SAAS;AAAA,MACnE,MAAM,MAAM,aAAa,QAAQ,aAAa,MAAM,aAAa,WAAM,MAAM,UAAU;AAAA,MACvF,aAAa,MAAM,aAAa,eAAe,GAAG,MAAM,UAAU,IAAI,MAAM,SAAS;AAAA,MACrF,aAAa;AAAA,MACb,MAAM;AAAA,QACJ,eAAe,MAAM;AAAA,QACrB,YAAY,MAAM;AAAA,QAClB,WAAW,MAAM;AAAA,QACjB,GAAI,MAAM,aAAa,QAAQ,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,IACA,EAAE,UAAU,MAAM,UAAU,gBAAgB,MAAM,gBAAgB,QAAQ,MAAM,OAAO;AAAA,EACzF;AAEA,QAAM,MAAM,MAAM,eAAe;AAAA,IAC/B;AAAA,MACE,eAAe,MAAM;AAAA,MACrB,YAAY,MAAM;AAAA,MAClB,WAAW,MAAM;AAAA,MACjB,QAAQ,MAAM,UAAU;AAAA,MACxB,aAAa,MAAM,eAAe,MAAM,UAAU;AAAA,MAClD,YAAY,MAAM,cAAc;AAAA,MAChC,eAAe,YAAY;AAAA,IAC7B;AAAA,IACA,EAAE,gBAAgB,MAAM,gBAAgB,UAAU,MAAM,SAAS;AAAA,EACnE;AAEA,QAAM,mBAAmB;AAAA,IACvB;AAAA,MACE,MAAM,MAAM,cAAc,WAAW,cAAc;AAAA,MACnD,OAAO,EAAE,OAAO,IAAI,IAAI,WAAW,MAAM,aAAa,KAAK,WAAW,MAAM,UAAU;AAAA;AAAA;AAAA,MAGtF,SAAS,YAAY,MAAM,eAAe,MAAM,YAAY,MAAM,SAAS;AAAA;AAAA,MAE3E,gBAAgB,mBAAmB,IAAI,EAAE;AAAA,MACzC,SAAS,EAAE,MAAM,iBAAiB,IAAI,IAAI,GAAG;AAAA,MAC7C,eAAe,YAAY;AAAA,MAC3B,WAAW,MAAM,UAAU;AAAA,IAC7B;AAAA,IACA,EAAE,UAAU,MAAM,UAAU,gBAAgB,MAAM,eAAe;AAAA,EACnE;AAEA,SAAO,EAAE,KAAK,YAAY;AAC5B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/sync-engine";
2
+ import { createSyncEngine } from "@open-mercato/core/modules/data_sync/lib/sync-engine";
3
+ export {
4
+ createSyncEngine
5
+ };
6
+ //# sourceMappingURL=sync-engine.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/sync-engine.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/sync-engine.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/sync-engine'\nexport { createSyncEngine } from '@open-mercato/core/modules/data_sync/lib/sync-engine'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,wBAAwB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/sync-run-service";
2
+ import { SyncRunOwnershipConflictError, createSyncRunService } from "@open-mercato/core/modules/data_sync/lib/sync-run-service";
3
+ export {
4
+ SyncRunOwnershipConflictError,
5
+ createSyncRunService
6
+ };
7
+ //# sourceMappingURL=sync-run-service.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/sync-run-service.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/sync-run-service.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/sync-run-service'\nexport { SyncRunOwnershipConflictError, createSyncRunService } from '@open-mercato/core/modules/data_sync/lib/sync-run-service'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,+BAA+B,4BAA4B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/sync-schedule-service";
2
+ import { createSyncScheduleService } from "@open-mercato/core/modules/data_sync/lib/sync-schedule-service";
3
+ export {
4
+ createSyncScheduleService
5
+ };
6
+ //# sourceMappingURL=sync-schedule-service.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/sync-schedule-service.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/sync-schedule-service.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/sync-schedule-service'\nexport { createSyncScheduleService } from '@open-mercato/core/modules/data_sync/lib/sync-schedule-service'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,iCAAiC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ export * from "@open-mercato/core/modules/data_sync/lib/syncRunStatus";
2
+ import { getSyncRunStatusVariant, getSyncSummaryVariant, syncRunStatusVariants, syncSummaryVariants } from "@open-mercato/core/modules/data_sync/lib/syncRunStatus";
3
+ export {
4
+ getSyncRunStatusVariant,
5
+ getSyncSummaryVariant,
6
+ syncRunStatusVariants,
7
+ syncSummaryVariants
8
+ };
9
+ //# sourceMappingURL=syncRunStatus.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/syncRunStatus.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (lib/syncRunStatus.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/lib/syncRunStatus'\nexport { getSyncRunStatusVariant, getSyncSummaryVariant, syncRunStatusVariants, syncSummaryVariants } from '@open-mercato/core/modules/data_sync/lib/syncRunStatus'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,yBAAyB,uBAAuB,uBAAuB,2BAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ class SeamBrokenError extends Error {
2
+ constructor(runId, detail) {
3
+ super(
4
+ `@fullstackhouse/open-mercato-data-sync-durable could not take over run ${runId}: ${detail}. This package decorates @open-mercato/core's data_sync engine and one of the contracts it relies on has changed. Install the package line matching the installed core minor, or report the change \u2014 see docs/adr/0004.`
5
+ );
6
+ this.runId = runId;
7
+ this.durableErrorClass = "terminal";
8
+ this.name = "SeamBrokenError";
9
+ }
10
+ }
11
+ export {
12
+ SeamBrokenError
13
+ };
14
+ //# sourceMappingURL=version-guard.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/lib/version-guard.ts"],
4
+ "sourcesContent": ["// What happens if core's engine stops behaving the way the adopter decorates it.\n//\n// An earlier version of this compared version strings by walking up from `require.resolve` to\n// find core's manifest. That was wrong twice over: bundlers cannot statically resolve a\n// computed `require`, so it broke the app build outright \u2014 and a version string is not the\n// thing worth checking. The install-time guard is the peer range (`>=0.7.0 <0.8.0`), which the\n// package manager enforces; the build-time guard is `gen:mirror --check` and the seam probe in\n// `src/compat`, which read core's actual source.\n//\n// What is left for runtime is the case none of those catch: core still installs, still builds,\n// still passes the probes, but a decorated method has stopped doing what the adopter relies on.\n// The signature of that is specific enough to detect, and detecting it matters, because the\n// failure it produces is silent \u2014 a run that reports success while its domain row says\n// something else.\n\n/** Thrown when core finalized a run itself instead of letting the adopter record it. */\nexport class SeamBrokenError extends Error {\n readonly durableErrorClass = 'terminal' as const\n constructor(readonly runId: string, detail: string) {\n super(\n `@fullstackhouse/open-mercato-data-sync-durable could not take over run ${runId}: ${detail}. ` +\n `This package decorates @open-mercato/core's data_sync engine and one of the contracts it relies on has changed. ` +\n `Install the package line matching the installed core minor, or report the change \u2014 see docs/adr/0004.`,\n )\n this.name = 'SeamBrokenError'\n }\n}\n"],
5
+ "mappings": "AAgBO,MAAM,wBAAwB,MAAM;AAAA,EAEzC,YAAqB,OAAe,QAAgB;AAClD;AAAA,MACE,0EAA0E,KAAK,KAAK,MAAM;AAAA,IAG5F;AALmB;AADrB,SAAS,oBAAoB;AAO3B,SAAK,OAAO;AAAA,EACd;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/migrations/Migration20260304113737";
2
+ import { Migration20260304113737 } from "@open-mercato/core/modules/data_sync/migrations/Migration20260304113737";
3
+ export {
4
+ Migration20260304113737
5
+ };
6
+ //# sourceMappingURL=Migration20260304113737.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/migrations/Migration20260304113737.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (migrations/Migration20260304113737.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/migrations/Migration20260304113737'\nexport { Migration20260304113737 } from '@open-mercato/core/modules/data_sync/migrations/Migration20260304113737'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from "@open-mercato/core/modules/data_sync/migrations/Migration20260810120000";
2
+ import { Migration20260810120000 } from "@open-mercato/core/modules/data_sync/migrations/Migration20260810120000";
3
+ export {
4
+ Migration20260810120000
5
+ };
6
+ //# sourceMappingURL=Migration20260810120000.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/migrations/Migration20260810120000.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (migrations/Migration20260810120000.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/migrations/Migration20260810120000'\nexport { Migration20260810120000 } from '@open-mercato/core/modules/data_sync/migrations/Migration20260810120000'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from "@open-mercato/core/modules/data_sync/setup";
2
+ import { default as default2 } from "@open-mercato/core/modules/data_sync/setup";
3
+ import { setup } from "@open-mercato/core/modules/data_sync/setup";
4
+ export {
5
+ default2 as default,
6
+ setup
7
+ };
8
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/modules/data_sync/setup.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (setup.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/setup'\nexport { default } from '@open-mercato/core/modules/data_sync/setup'\nexport { setup } from '@open-mercato/core/modules/data_sync/setup'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,WAAAA,gBAAe;AACxB,SAAS,aAAa;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ DATA_SYNC_EXPORT_QUEUE,
3
+ DATA_SYNC_LOCK_DURATION_MS,
4
+ DATA_SYNC_MAX_STALLED_COUNT
5
+ } from "@open-mercato/core/modules/data_sync/lib/queue-policy";
6
+ import { adoptOnDelivery } from "../lib/adopt-on-delivery.js";
7
+ const metadata = {
8
+ queue: DATA_SYNC_EXPORT_QUEUE,
9
+ id: "data-sync:export",
10
+ concurrency: 5,
11
+ lockDuration: DATA_SYNC_LOCK_DURATION_MS,
12
+ maxStalledCount: DATA_SYNC_MAX_STALLED_COUNT
13
+ };
14
+ var sync_export_default = adoptOnDelivery("export");
15
+ export {
16
+ sync_export_default as default,
17
+ metadata
18
+ };
19
+ //# sourceMappingURL=sync-export.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/workers/sync-export.ts"],
4
+ "sourcesContent": ["import type { WorkerMeta } from '@open-mercato/queue'\nimport {\n DATA_SYNC_EXPORT_QUEUE,\n DATA_SYNC_LOCK_DURATION_MS,\n DATA_SYNC_MAX_STALLED_COUNT,\n} from '@open-mercato/core/modules/data_sync/lib/queue-policy'\n\nimport { adoptOnDelivery } from '../lib/adopt-on-delivery'\n\n// Registered under core's worker id, on core's queue, so a message enqueued by anything still\n// using core's start path arrives here instead of at core's worker.\nexport const metadata: WorkerMeta = {\n queue: DATA_SYNC_EXPORT_QUEUE,\n id: 'data-sync:export',\n concurrency: 5,\n lockDuration: DATA_SYNC_LOCK_DURATION_MS,\n maxStalledCount: DATA_SYNC_MAX_STALLED_COUNT,\n}\n\nexport default adoptOnDelivery('export')\n"],
5
+ "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,uBAAuB;AAIzB,MAAM,WAAuB;AAAA,EAClC,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,IAAO,sBAAQ,gBAAgB,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ DATA_SYNC_IMPORT_QUEUE,
3
+ DATA_SYNC_LOCK_DURATION_MS,
4
+ DATA_SYNC_MAX_STALLED_COUNT
5
+ } from "@open-mercato/core/modules/data_sync/lib/queue-policy";
6
+ import { adoptOnDelivery } from "../lib/adopt-on-delivery.js";
7
+ const metadata = {
8
+ queue: DATA_SYNC_IMPORT_QUEUE,
9
+ id: "data-sync:import",
10
+ concurrency: 5,
11
+ lockDuration: DATA_SYNC_LOCK_DURATION_MS,
12
+ maxStalledCount: DATA_SYNC_MAX_STALLED_COUNT
13
+ };
14
+ var sync_import_default = adoptOnDelivery("import");
15
+ export {
16
+ sync_import_default as default,
17
+ metadata
18
+ };
19
+ //# sourceMappingURL=sync-import.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/workers/sync-import.ts"],
4
+ "sourcesContent": ["import type { WorkerMeta } from '@open-mercato/queue'\nimport {\n DATA_SYNC_IMPORT_QUEUE,\n DATA_SYNC_LOCK_DURATION_MS,\n DATA_SYNC_MAX_STALLED_COUNT,\n} from '@open-mercato/core/modules/data_sync/lib/queue-policy'\n\nimport { adoptOnDelivery } from '../lib/adopt-on-delivery'\n\n// Registered under core's worker id, on core's queue, so a message enqueued by anything still\n// using core's start path arrives here instead of at core's worker.\nexport const metadata: WorkerMeta = {\n queue: DATA_SYNC_IMPORT_QUEUE,\n id: 'data-sync:import',\n concurrency: 5,\n lockDuration: DATA_SYNC_LOCK_DURATION_MS,\n maxStalledCount: DATA_SYNC_MAX_STALLED_COUNT,\n}\n\nexport default adoptOnDelivery('import')\n"],
5
+ "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,uBAAuB;AAIzB,MAAM,WAAuB;AAAA,EAClC,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,IAAO,sBAAQ,gBAAgB,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from "@open-mercato/core/modules/data_sync/workers/sync-scheduled";
2
+ import { default as default2 } from "@open-mercato/core/modules/data_sync/workers/sync-scheduled";
3
+ import { metadata } from "@open-mercato/core/modules/data_sync/workers/sync-scheduled";
4
+ export {
5
+ default2 as default,
6
+ metadata
7
+ };
8
+ //# sourceMappingURL=sync-scheduled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/data_sync/workers/sync-scheduled.ts"],
4
+ "sourcesContent": ["// GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (workers/sync-scheduled.ts). Do not edit.\n// This package mirrors core's data_sync module file-for-file; see docs/adr/0006-drop-in-data-sync.md.\nexport * from '@open-mercato/core/modules/data_sync/workers/sync-scheduled'\nexport { default } from '@open-mercato/core/modules/data_sync/workers/sync-scheduled'\nexport { metadata } from '@open-mercato/core/modules/data_sync/workers/sync-scheduled'\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,WAAAA,gBAAe;AACxB,SAAS,gBAAgB;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,8 @@
1
+ export const id = "id";
2
+ export const integration_id = "integration_id";
3
+ export const entity_type = "entity_type";
4
+ export const direction = "direction";
5
+ export const cursor = "cursor";
6
+ export const organization_id = "organization_id";
7
+ export const tenant_id = "tenant_id";
8
+ export const updated_at = "updated_at";
@@ -0,0 +1,8 @@
1
+ export const id = "id";
2
+ export const integration_id = "integration_id";
3
+ export const entity_type = "entity_type";
4
+ export const mapping = "mapping";
5
+ export const organization_id = "organization_id";
6
+ export const tenant_id = "tenant_id";
7
+ export const created_at = "created_at";
8
+ export const updated_at = "updated_at";
@@ -0,0 +1,22 @@
1
+ export const id = "id";
2
+ export const integration_id = "integration_id";
3
+ export const entity_type = "entity_type";
4
+ export const direction = "direction";
5
+ export const status = "status";
6
+ export const cursor = "cursor";
7
+ export const initial_cursor = "initial_cursor";
8
+ export const created_count = "created_count";
9
+ export const updated_count = "updated_count";
10
+ export const skipped_count = "skipped_count";
11
+ export const failed_count = "failed_count";
12
+ export const batches_completed = "batches_completed";
13
+ export const last_error = "last_error";
14
+ export const progress_job_id = "progress_job_id";
15
+ export const job_id = "job_id";
16
+ export const triggered_by = "triggered_by";
17
+ export const parameters = "parameters";
18
+ export const organization_id = "organization_id";
19
+ export const tenant_id = "tenant_id";
20
+ export const created_at = "created_at";
21
+ export const updated_at = "updated_at";
22
+ export const deleted_at = "deleted_at";
@@ -0,0 +1,16 @@
1
+ export const id = "id";
2
+ export const integration_id = "integration_id";
3
+ export const entity_type = "entity_type";
4
+ export const direction = "direction";
5
+ export const schedule_type = "schedule_type";
6
+ export const schedule_value = "schedule_value";
7
+ export const timezone = "timezone";
8
+ export const full_sync = "full_sync";
9
+ export const is_enabled = "is_enabled";
10
+ export const scheduled_job_id = "scheduled_job_id";
11
+ export const last_run_at = "last_run_at";
12
+ export const organization_id = "organization_id";
13
+ export const tenant_id = "tenant_id";
14
+ export const created_at = "created_at";
15
+ export const updated_at = "updated_at";
16
+ export const deleted_at = "deleted_at";
@@ -0,0 +1,13 @@
1
+ // GENERATED by scripts/gen-mirror.mjs from @open-mercato/core@0.7.0 (data/entities.ts). Do not edit.
2
+ // Read by the Open Mercato CLI for a package-backed module whose entities file is a re-export stub.
3
+ export const M = {
4
+ "data_sync": "data_sync"
5
+ } as const
6
+ export const E = {
7
+ "data_sync": {
8
+ "sync_run": "data_sync:sync_run",
9
+ "sync_cursor": "data_sync:sync_cursor",
10
+ "sync_mapping": "data_sync:sync_mapping",
11
+ "sync_schedule": "data_sync:sync_schedule"
12
+ }
13
+ } as const