@pattern-stack/codegen 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/README.md +5 -5
- package/consumer-skills/codegen/SKILL.md +2 -2
- package/consumer-skills/{sync → integration}/SKILL.md +29 -29
- package/consumer-skills/{sync → integration}/audit-and-detection.md +22 -22
- package/consumer-skills/{sync → integration}/change-sources-and-sinks.md +60 -60
- package/consumer-skills/subsystems/SKILL.md +8 -8
- package/consumer-skills/subsystems/wiring-and-order.md +7 -7
- package/dist/runtime/base-classes/index.d.ts +4 -4
- package/dist/runtime/base-classes/index.js +35 -35
- package/dist/runtime/base-classes/index.js.map +1 -1
- package/dist/runtime/base-classes/{synced-entity-repository.d.ts → integrated-entity-repository.d.ts} +15 -15
- package/dist/runtime/base-classes/{synced-entity-repository.js → integrated-entity-repository.js} +21 -21
- package/dist/runtime/base-classes/integrated-entity-repository.js.map +1 -0
- package/dist/runtime/base-classes/{synced-entity-service.d.ts → integrated-entity-service.d.ts} +6 -6
- package/dist/runtime/base-classes/{synced-entity-service.js → integrated-entity-service.js} +4 -4
- package/dist/runtime/base-classes/integrated-entity-service.js.map +1 -0
- package/dist/runtime/base-classes/{sync-upsert-config.d.ts → integration-upsert-config.d.ts} +13 -13
- package/dist/runtime/base-classes/integration-upsert-config.js +1 -0
- package/dist/runtime/base-classes/{junction-sync-repository.d.ts → junction-integration-repository.d.ts} +11 -11
- package/dist/runtime/base-classes/{junction-sync-repository.js → junction-integration-repository.js} +15 -15
- package/dist/runtime/base-classes/junction-integration-repository.js.map +1 -0
- package/dist/runtime/subsystems/auth/auth-oauth-state.schema.js.map +1 -1
- package/dist/runtime/subsystems/auth/auth.module.d.ts +4 -4
- package/dist/runtime/subsystems/auth/auth.module.js +3 -3
- package/dist/runtime/subsystems/auth/auth.module.js.map +1 -1
- package/dist/runtime/subsystems/auth/auth.tokens.d.ts +8 -8
- package/dist/runtime/subsystems/auth/auth.tokens.js +6 -6
- package/dist/runtime/subsystems/auth/auth.tokens.js.map +1 -1
- package/dist/runtime/subsystems/auth/backends/state-store.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/auth/controllers/auth.controller.d.ts +2 -2
- package/dist/runtime/subsystems/auth/controllers/auth.controller.js +3 -3
- package/dist/runtime/subsystems/auth/controllers/auth.controller.js.map +1 -1
- package/dist/runtime/subsystems/auth/index.d.ts +3 -3
- package/dist/runtime/subsystems/auth/index.js +40 -40
- package/dist/runtime/subsystems/auth/index.js.map +1 -1
- package/dist/runtime/subsystems/auth/middleware/requester-context.js.map +1 -1
- package/dist/runtime/subsystems/auth/protocols/auth-strategy.d.ts +3 -3
- package/dist/runtime/subsystems/auth/protocols/{integration-store.d.ts → connection-store.d.ts} +20 -20
- package/dist/runtime/subsystems/auth/protocols/connection-store.js +1 -0
- package/dist/runtime/subsystems/auth/protocols/provider-strategy.d.ts +3 -3
- package/dist/runtime/subsystems/auth/runtime/{integration-broken.error.d.ts → connection-broken.error.d.ts} +5 -5
- package/dist/runtime/subsystems/auth/runtime/connection-broken.error.js +19 -0
- package/dist/runtime/subsystems/auth/runtime/connection-broken.error.js.map +1 -0
- package/dist/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.d.ts +10 -10
- package/dist/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.js +28 -28
- package/dist/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.js.map +1 -1
- package/dist/runtime/subsystems/auth/runtime/with-auth-retry.d.ts +1 -1
- package/dist/runtime/subsystems/auth/runtime/with-auth-retry.js +3 -3
- package/dist/runtime/subsystems/auth/runtime/with-auth-retry.js.map +1 -1
- package/dist/runtime/subsystems/index.d.ts +11 -7
- package/dist/runtime/subsystems/index.js +1041 -67
- package/dist/runtime/subsystems/index.js.map +1 -1
- package/dist/runtime/subsystems/{sync → integration}/build-change-source.d.ts +3 -3
- package/dist/runtime/subsystems/{sync → integration}/build-change-source.js +3 -3
- package/dist/runtime/subsystems/integration/build-change-source.js.map +1 -0
- package/dist/runtime/subsystems/{sync → integration}/deep-equal.differ.d.ts +2 -2
- package/dist/runtime/subsystems/{sync → integration}/deep-equal.differ.js +1 -1
- package/dist/runtime/subsystems/integration/deep-equal.differ.js.map +1 -0
- package/dist/runtime/subsystems/{sync → integration}/detection-config.schema.d.ts +3 -3
- package/dist/runtime/subsystems/{sync → integration}/detection-config.schema.js +1 -1
- package/dist/runtime/subsystems/integration/detection-config.schema.js.map +1 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.d.ts +25 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js +34 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js.map +1 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.d.ts +53 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js +13 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js.map +1 -0
- package/dist/runtime/subsystems/{sync/execute-sync.use-case.d.ts → integration/execute-integration.use-case.d.ts} +13 -13
- package/dist/runtime/subsystems/{sync/execute-sync.use-case.js → integration/execute-integration.use-case.js} +30 -30
- package/dist/runtime/subsystems/integration/execute-integration.use-case.js.map +1 -0
- package/dist/runtime/subsystems/integration/index.d.ts +30 -0
- package/dist/runtime/subsystems/{sync → integration}/index.js +206 -171
- package/dist/runtime/subsystems/integration/index.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-audit.schema.d.ts → integration/integration-audit.schema.d.ts} +64 -64
- package/dist/runtime/subsystems/{sync/sync-audit.schema.js → integration/integration-audit.schema.js} +47 -47
- package/dist/runtime/subsystems/integration/integration-audit.schema.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-change-source.protocol.d.ts → integration/integration-change-source.protocol.d.ts} +10 -10
- package/dist/runtime/subsystems/integration/integration-change-source.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync-cursor-store.drizzle-backend.d.ts → integration/integration-cursor-store.drizzle-backend.d.ts} +1 -1
- package/dist/runtime/subsystems/{sync/sync-cursor-store.drizzle-backend.js → integration/integration-cursor-store.drizzle-backend.js} +65 -65
- package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-cursor-store.memory-backend.d.ts → integration/integration-cursor-store.memory-backend.d.ts} +6 -6
- package/dist/runtime/subsystems/{sync/sync-cursor-store.memory-backend.js → integration/integration-cursor-store.memory-backend.js} +5 -5
- package/dist/runtime/subsystems/integration/integration-cursor-store.memory-backend.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-cursor-store.protocol.d.ts → integration/integration-cursor-store.protocol.d.ts} +13 -13
- package/dist/runtime/subsystems/integration/integration-cursor-store.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync-errors.d.ts → integration/integration-errors.d.ts} +2 -2
- package/dist/runtime/subsystems/{sync/sync-errors.js → integration/integration-errors.js} +3 -3
- package/dist/runtime/subsystems/integration/integration-errors.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-field-diff.protocol.d.ts → integration/integration-field-diff.protocol.d.ts} +2 -2
- package/dist/runtime/subsystems/{sync/sync-field-diff.protocol.js → integration/integration-field-diff.protocol.js} +2 -2
- package/dist/runtime/subsystems/integration/integration-field-diff.protocol.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-loopback.protocol.d.ts → integration/integration-loopback.protocol.d.ts} +2 -2
- package/dist/runtime/subsystems/integration/integration-loopback.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync-middleware.protocol.d.ts → integration/integration-middleware.protocol.d.ts} +5 -5
- package/dist/runtime/subsystems/integration/integration-middleware.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync-run-recorder.drizzle-backend.d.ts → integration/integration-run-recorder.drizzle-backend.d.ts} +5 -5
- package/dist/runtime/subsystems/{sync/sync-run-recorder.drizzle-backend.js → integration/integration-run-recorder.drizzle-backend.js} +73 -73
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-run-recorder.memory-backend.d.ts → integration/integration-run-recorder.memory-backend.d.ts} +15 -15
- package/dist/runtime/subsystems/{sync/sync-run-recorder.memory-backend.js → integration/integration-run-recorder.memory-backend.js} +11 -11
- package/dist/runtime/subsystems/integration/integration-run-recorder.memory-backend.js.map +1 -0
- package/dist/runtime/subsystems/{sync/sync-run-recorder.protocol.d.ts → integration/integration-run-recorder.protocol.d.ts} +25 -25
- package/dist/runtime/subsystems/integration/integration-run-recorder.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync-sink.protocol.d.ts → integration/integration-sink.protocol.d.ts} +5 -5
- package/dist/runtime/subsystems/integration/integration-sink.protocol.js +1 -0
- package/dist/runtime/subsystems/{sync/sync.module.d.ts → integration/integration.module.d.ts} +24 -24
- package/dist/runtime/subsystems/{sync/sync.module.js → integration/integration.module.js} +132 -132
- package/dist/runtime/subsystems/integration/integration.module.js.map +1 -0
- package/dist/runtime/subsystems/integration/integration.tokens.d.ts +60 -0
- package/dist/runtime/subsystems/integration/integration.tokens.js +20 -0
- package/dist/runtime/subsystems/integration/integration.tokens.js.map +1 -0
- package/dist/runtime/subsystems/{sync → integration}/loopback.middleware.d.ts +5 -5
- package/dist/runtime/subsystems/{sync → integration}/loopback.middleware.js +1 -1
- package/dist/runtime/subsystems/integration/loopback.middleware.js.map +1 -0
- package/dist/runtime/subsystems/{sync → integration}/poll-change-source.d.ts +5 -5
- package/dist/runtime/subsystems/{sync → integration}/poll-change-source.js +1 -1
- package/dist/runtime/subsystems/integration/poll-change-source.js.map +1 -0
- package/dist/runtime/subsystems/{sync → integration}/webhook-change-source.d.ts +5 -5
- package/dist/runtime/subsystems/{sync → integration}/webhook-change-source.js +1 -1
- package/dist/runtime/subsystems/integration/webhook-change-source.js.map +1 -0
- package/dist/runtime/subsystems/jobs/job-worker.module.d.ts +1 -1
- package/dist/runtime/subsystems/observability/index.d.ts +4 -4
- package/dist/runtime/subsystems/observability/index.js +11 -11
- package/dist/runtime/subsystems/observability/index.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.module.d.ts +2 -2
- package/dist/runtime/subsystems/observability/observability.module.js +11 -11
- package/dist/runtime/subsystems/observability/observability.module.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.protocol.d.ts +11 -11
- package/dist/runtime/subsystems/observability/observability.service.d.ts +6 -6
- package/dist/runtime/subsystems/observability/observability.service.js +11 -11
- package/dist/runtime/subsystems/observability/observability.service.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.tokens.d.ts +1 -1
- package/dist/runtime/subsystems/observability/observability.tokens.js.map +1 -1
- package/dist/runtime/subsystems/observability/reporters/bridge-metrics.reporter.d.ts +3 -3
- package/dist/runtime/subsystems/observability/reporters/bridge-metrics.reporter.js.map +1 -1
- package/dist/runtime/subsystems/observability/reporters/index.d.ts +3 -3
- package/dist/runtime/subsystems/observability/reporters/index.js.map +1 -1
- package/dist/src/cli/index.js +1336 -376
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.d.ts +70 -22
- package/dist/src/index.js +290 -194
- package/dist/src/index.js.map +1 -1
- package/examples/auth-integrations/README.md +32 -32
- package/examples/auth-integrations/definitions/entities/{integration.yaml → connection.yaml} +10 -10
- package/examples/auth-integrations/runtime/{integrations/adapters/integration-grant-sink.adapter.ts → connections/adapters/connection-grant-sink.adapter.ts} +7 -7
- package/examples/auth-integrations/runtime/{integrations/adapters/integration-reader.adapter.ts → connections/adapters/connection-reader.adapter.ts} +10 -10
- package/examples/auth-integrations/runtime/{integrations/adapters/integration-token-writer.adapter.ts → connections/adapters/connection-token-writer.adapter.ts} +11 -11
- package/examples/auth-integrations/runtime/connections/connections-auth.module.ts +81 -0
- package/examples/auth-integrations/runtime/{integrations/facade/integrations.service.ts → connections/facade/connections.service.ts} +35 -35
- package/examples/auth-integrations/runtime/{integrations → connections}/oauth/use-cases/create-or-update-from-oauth-grant.use-case.ts +11 -11
- package/examples/auth-integrations/runtime/{integrations/oauth/use-cases/disconnect-integration.use-case.ts → connections/oauth/use-cases/disconnect-connection.use-case.ts} +6 -6
- package/examples/auth-integrations/runtime/connections/oauth/use-cases/list-user-connections.use-case.ts +21 -0
- package/examples/auth-integrations/runtime/connections/oauth/use-cases/mark-connection-requires-reauth.use-case.ts +21 -0
- package/package.json +9 -1
- package/runtime/base-classes/index.ts +8 -8
- package/runtime/base-classes/{synced-entity-repository.ts → integrated-entity-repository.ts} +36 -36
- package/runtime/base-classes/{synced-entity-service.ts → integrated-entity-service.ts} +6 -6
- package/runtime/base-classes/{sync-upsert-config.ts → integration-upsert-config.ts} +12 -12
- package/runtime/base-classes/{junction-sync-repository.ts → junction-integration-repository.ts} +28 -28
- package/runtime/subsystems/auth/auth-oauth-state.schema.ts +1 -1
- package/runtime/subsystems/auth/auth.module.ts +4 -4
- package/runtime/subsystems/auth/auth.tokens.ts +7 -7
- package/runtime/subsystems/auth/controllers/auth.controller.ts +7 -7
- package/runtime/subsystems/auth/index.ts +19 -19
- package/runtime/subsystems/auth/protocols/auth-strategy.ts +3 -3
- package/runtime/subsystems/auth/protocols/{integration-store.ts → connection-store.ts} +19 -19
- package/runtime/subsystems/auth/protocols/provider-strategy.ts +2 -2
- package/runtime/subsystems/auth/runtime/{integration-broken.error.ts → connection-broken.error.ts} +5 -5
- package/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.ts +35 -35
- package/runtime/subsystems/auth/runtime/with-auth-retry.ts +3 -3
- package/runtime/subsystems/index.ts +26 -11
- package/runtime/subsystems/{sync → integration}/build-change-source.ts +3 -3
- package/runtime/subsystems/{sync → integration}/deep-equal.differ.ts +7 -7
- package/runtime/subsystems/{sync → integration}/detection-config.schema.ts +3 -3
- package/runtime/subsystems/integration/entity-change-source-registry.memory.ts +40 -0
- package/runtime/subsystems/integration/entity-change-source-registry.protocol.ts +59 -0
- package/runtime/subsystems/{sync/execute-sync.use-case.ts → integration/execute-integration.use-case.ts} +40 -40
- package/runtime/subsystems/{sync → integration}/index.ts +56 -47
- package/runtime/subsystems/{sync/sync-audit.schema.ts → integration/integration-audit.schema.ts} +61 -61
- package/runtime/subsystems/{sync/sync-change-source.protocol.ts → integration/integration-change-source.protocol.ts} +9 -9
- package/runtime/subsystems/{sync/sync-cursor-store.drizzle-backend.ts → integration/integration-cursor-store.drizzle-backend.ts} +30 -30
- package/runtime/subsystems/{sync/sync-cursor-store.memory-backend.ts → integration/integration-cursor-store.memory-backend.ts} +9 -9
- package/runtime/subsystems/{sync/sync-cursor-store.protocol.ts → integration/integration-cursor-store.protocol.ts} +13 -13
- package/runtime/subsystems/{sync/sync-errors.ts → integration/integration-errors.ts} +3 -3
- package/runtime/subsystems/{sync/sync-field-diff.protocol.ts → integration/integration-field-diff.protocol.ts} +2 -2
- package/runtime/subsystems/{sync/sync-loopback.protocol.ts → integration/integration-loopback.protocol.ts} +2 -2
- package/runtime/subsystems/{sync/sync-middleware.protocol.ts → integration/integration-middleware.protocol.ts} +6 -6
- package/runtime/subsystems/{sync/sync-run-recorder.drizzle-backend.ts → integration/integration-run-recorder.drizzle-backend.ts} +39 -39
- package/runtime/subsystems/{sync/sync-run-recorder.memory-backend.ts → integration/integration-run-recorder.memory-backend.ts} +23 -23
- package/runtime/subsystems/{sync/sync-run-recorder.protocol.ts → integration/integration-run-recorder.protocol.ts} +25 -25
- package/runtime/subsystems/{sync/sync-sink.protocol.ts → integration/integration-sink.protocol.ts} +4 -4
- package/runtime/subsystems/{sync/sync.module.ts → integration/integration.module.ts} +48 -48
- package/runtime/subsystems/integration/integration.tokens.ts +63 -0
- package/runtime/subsystems/{sync → integration}/loopback.middleware.ts +5 -5
- package/runtime/subsystems/{sync → integration}/poll-change-source.ts +7 -7
- package/runtime/subsystems/{sync → integration}/webhook-change-source.ts +7 -7
- package/runtime/subsystems/observability/index.ts +1 -1
- package/runtime/subsystems/observability/observability.module.ts +2 -2
- package/runtime/subsystems/observability/observability.protocol.ts +11 -11
- package/runtime/subsystems/observability/observability.service.ts +13 -13
- package/runtime/subsystems/observability/observability.tokens.ts +1 -1
- package/src/patterns/library/index.ts +4 -4
- package/src/patterns/library/{synced.pattern.ts → integrated.pattern.ts} +12 -12
- package/src/patterns/library/junction.pattern.ts +1 -1
- package/src/patterns/pattern-definition.ts +3 -3
- package/templates/entity/new/backend/modules/core/{sync-source.ejs.t → integration-source.ejs.t} +6 -6
- package/templates/entity/new/clean-lite-ps/entity.ejs.t +12 -3
- package/templates/entity/new/clean-lite-ps/module.ejs.t +1 -1
- package/templates/entity/new/clean-lite-ps/prompt-extension.js +243 -60
- package/templates/entity/new/clean-lite-ps/repository.ejs.t +27 -27
- package/templates/entity/new/frontend/collections/collection.ejs.t +26 -1
- package/templates/entity/new/frontend/collections/collections-base.ejs.t +11 -0
- package/templates/entity/new/frontend/entity/combined.ejs.t +31 -1
- package/templates/entity/new/prompt.js +27 -15
- package/templates/junction/new/entity.ejs.t +1 -1
- package/templates/junction/new/prompt.js +24 -24
- package/templates/junction/new/repository.ejs.t +19 -19
- package/templates/subsystem/auth/auth-oauth-state.schema.ejs.t +2 -2
- package/templates/subsystem/auth-config/prompt.js +1 -1
- package/templates/subsystem/auth-integrations/app-module-hook.ejs.t +5 -5
- package/templates/subsystem/bridge/prompt.js +1 -1
- package/templates/subsystem/integration/integration-audit.schema.ejs.t +192 -0
- package/templates/subsystem/{sync → integration}/prompt.js +12 -12
- package/templates/subsystem/{sync-config/codegen-config-sync-block.ejs.t → integration-config/codegen-config-integration-block.ejs.t} +7 -7
- package/templates/subsystem/integration-config/prompt.js +22 -0
- package/templates/subsystem/jobs/worker.ejs.t +2 -2
- package/templates/subsystem/observability/main-hook.ejs.t +1 -1
- package/templates/subsystem/observability/prompt.js +1 -1
- package/templates/subsystem/openapi-config/prompt.js +1 -1
- package/dist/runtime/base-classes/junction-sync-repository.js.map +0 -1
- package/dist/runtime/base-classes/sync-upsert-config.js +0 -1
- package/dist/runtime/base-classes/synced-entity-repository.js.map +0 -1
- package/dist/runtime/base-classes/synced-entity-service.js.map +0 -1
- package/dist/runtime/subsystems/auth/protocols/integration-store.js +0 -1
- package/dist/runtime/subsystems/auth/runtime/integration-broken.error.js +0 -19
- package/dist/runtime/subsystems/auth/runtime/integration-broken.error.js.map +0 -1
- package/dist/runtime/subsystems/sync/build-change-source.js.map +0 -1
- package/dist/runtime/subsystems/sync/deep-equal.differ.js.map +0 -1
- package/dist/runtime/subsystems/sync/detection-config.schema.js.map +0 -1
- package/dist/runtime/subsystems/sync/execute-sync.use-case.js.map +0 -1
- package/dist/runtime/subsystems/sync/index.d.ts +0 -28
- package/dist/runtime/subsystems/sync/index.js.map +0 -1
- package/dist/runtime/subsystems/sync/loopback.middleware.js.map +0 -1
- package/dist/runtime/subsystems/sync/poll-change-source.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-audit.schema.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-change-source.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync-cursor-store.drizzle-backend.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-cursor-store.memory-backend.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-cursor-store.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync-errors.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-field-diff.protocol.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-loopback.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync-middleware.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync-run-recorder.drizzle-backend.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-run-recorder.memory-backend.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync-run-recorder.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync-sink.protocol.js +0 -1
- package/dist/runtime/subsystems/sync/sync.module.js.map +0 -1
- package/dist/runtime/subsystems/sync/sync.tokens.d.ts +0 -47
- package/dist/runtime/subsystems/sync/sync.tokens.js +0 -18
- package/dist/runtime/subsystems/sync/sync.tokens.js.map +0 -1
- package/dist/runtime/subsystems/sync/webhook-change-source.js.map +0 -1
- package/examples/auth-integrations/runtime/integrations/integrations-auth.module.ts +0 -81
- package/examples/auth-integrations/runtime/integrations/oauth/use-cases/list-user-integrations.use-case.ts +0 -21
- package/examples/auth-integrations/runtime/integrations/oauth/use-cases/mark-integration-requires-reauth.use-case.ts +0 -21
- package/runtime/subsystems/sync/sync.tokens.ts +0 -49
- package/templates/entity/new/backend/modules/core/sync-source.providers.ejs.t +0 -18
- package/templates/subsystem/sync/sync-audit.schema.ejs.t +0 -192
- package/templates/subsystem/sync-config/prompt.js +0 -22
- /package/dist/runtime/base-classes/{sync-upsert-config.js.map → integration-upsert-config.js.map} +0 -0
- /package/dist/runtime/subsystems/auth/protocols/{integration-store.js.map → connection-store.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-change-source.protocol.js.map → integration/integration-change-source.protocol.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-cursor-store.protocol.js.map → integration/integration-cursor-store.protocol.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-loopback.protocol.js.map → integration/integration-loopback.protocol.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-middleware.protocol.js.map → integration/integration-middleware.protocol.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-run-recorder.protocol.js.map → integration/integration-run-recorder.protocol.js.map} +0 -0
- /package/dist/runtime/subsystems/{sync/sync-sink.protocol.js.map → integration/integration-sink.protocol.js.map} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration subsystem — in-memory entity-change-source registry
|
|
3
|
+
*
|
|
4
|
+
* Default `IEntityChangeSourceRegistry` backed by a `Map<entityName, source>`.
|
|
5
|
+
* Track D's codegen-emitted aggregator folds per-provider adapter
|
|
6
|
+
* contributions into one of these and binds it under
|
|
7
|
+
* `ENTITY_CHANGE_SOURCE_REGISTRY` (RFC-0001 §3); tests and simple consumers
|
|
8
|
+
* construct it directly.
|
|
9
|
+
*
|
|
10
|
+
* See {@link ./entity-change-source-registry.protocol} for the contract and
|
|
11
|
+
* #336 for scope.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { IChangeSource } from './integration-change-source.protocol';
|
|
15
|
+
import {
|
|
16
|
+
type IEntityChangeSourceRegistry,
|
|
17
|
+
UnknownEntityError,
|
|
18
|
+
} from './entity-change-source-registry.protocol';
|
|
19
|
+
|
|
20
|
+
export class MemoryEntityChangeSourceRegistry
|
|
21
|
+
implements IEntityChangeSourceRegistry
|
|
22
|
+
{
|
|
23
|
+
constructor(private readonly sources: Map<string, IChangeSource<unknown>>) {}
|
|
24
|
+
|
|
25
|
+
get<T = unknown>(name: string): IChangeSource<T> {
|
|
26
|
+
const source = this.sources.get(name);
|
|
27
|
+
if (!source) {
|
|
28
|
+
throw new UnknownEntityError(name, [...this.sources.keys()]);
|
|
29
|
+
}
|
|
30
|
+
return source as IChangeSource<T>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
has(name: string): boolean {
|
|
34
|
+
return this.sources.has(name);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
entities(): readonly string[] {
|
|
38
|
+
return [...this.sources.keys()];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration subsystem — entity-keyed change-source registry (port)
|
|
3
|
+
*
|
|
4
|
+
* `IEntityChangeSourceRegistry` resolves an `IChangeSource<T>` by entity name.
|
|
5
|
+
* It generalizes today's per-entity DI tokens (`ACCOUNT_POLL_FETCH_REGISTRY`,
|
|
6
|
+
* `CONTACT_POLL_FETCH_REGISTRY`, …) into one entity-keyed registry, so the L3
|
|
7
|
+
* composing port (`<Surface>Port`, Track C C6) can be entity-agnostic at the
|
|
8
|
+
* type level instead of enumerating entities (epic #328 locked decision #5).
|
|
9
|
+
*
|
|
10
|
+
* This lives in L1 (the integration subsystem) rather than in a per-surface
|
|
11
|
+
* package because the same shape applies across surfaces — CRM (`account`,
|
|
12
|
+
* `contact`, `deal`), Mail (`email`, `thread`, `label`), Transcript
|
|
13
|
+
* (`transcript`, `speaker`, `utterance`), Meeting (`meeting`, `attendee`).
|
|
14
|
+
* Cross-surface plumbing belongs at L1 (epic #328 locked decision #6).
|
|
15
|
+
*
|
|
16
|
+
* Scope (Track C · C7): this is purely the L1 type + memory impl. Codegen does
|
|
17
|
+
* NOT yet emit this registry, and the existing per-entity tokens keep emitting
|
|
18
|
+
* unchanged — the retarget (and the per-entity-token deprecation) is Track D
|
|
19
|
+
* D3/D4 (RFC-0001 §3/§8).
|
|
20
|
+
*
|
|
21
|
+
* See #336 (this issue), #328 (parent epic), RFC-0001 §3 (the registry
|
|
22
|
+
* contract Track D emits the wiring for).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { IChangeSource } from './integration-change-source.protocol';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Entity-keyed resolver for change sources. The orchestrator (and the L3
|
|
29
|
+
* surface port) consume this, agnostic to whether a source came from a
|
|
30
|
+
* hand-written adapter or a configured `PollChangeSource<T>`.
|
|
31
|
+
*/
|
|
32
|
+
export interface IEntityChangeSourceRegistry {
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a change source for a given entity name.
|
|
35
|
+
* Throws {@link UnknownEntityError} if the entity isn't registered.
|
|
36
|
+
*/
|
|
37
|
+
get<T = unknown>(entityName: string): IChangeSource<T>;
|
|
38
|
+
|
|
39
|
+
/** True if the entity is registered. */
|
|
40
|
+
has(entityName: string): boolean;
|
|
41
|
+
|
|
42
|
+
/** List all entity names this registry serves. */
|
|
43
|
+
entities(): readonly string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Thrown by {@link IEntityChangeSourceRegistry.get} when no source is
|
|
48
|
+
* registered for the requested entity. The message enumerates the available
|
|
49
|
+
* entities so a misconfiguration (typo'd entity name, missing adapter
|
|
50
|
+
* contribution) is diagnosable from the error alone.
|
|
51
|
+
*/
|
|
52
|
+
export class UnknownEntityError extends Error {
|
|
53
|
+
constructor(entity: string, available: readonly string[]) {
|
|
54
|
+
super(
|
|
55
|
+
`No change source registered for entity '${entity}'. Available: ${available.join(', ')}`,
|
|
56
|
+
);
|
|
57
|
+
this.name = 'UnknownEntityError';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* ExecuteIntegrationUseCase — the generic integration orchestrator (SYNC-5).
|
|
3
3
|
*
|
|
4
4
|
* One class. Reused across every `(provider, detection-mode, canonical-entity)`
|
|
5
5
|
* tuple. Parameterized over `T` so canonical records stay typed end-to-end.
|
|
6
6
|
*
|
|
7
7
|
* Flow per run:
|
|
8
8
|
*
|
|
9
|
-
* 1. `recorder.startRun(...)` — opens a `
|
|
9
|
+
* 1. `recorder.startRun(...)` — opens a `integration_runs` row in 'running'.
|
|
10
10
|
* 2. for each change yielded by `source.listChanges(subscription, cursorBefore)`:
|
|
11
11
|
* a. differ.diff(existing, incoming) → 'noop' short-circuits to
|
|
12
12
|
* a noop audit row (no sink write).
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* ## Generics
|
|
34
34
|
*
|
|
35
35
|
* - `T` = canonical record shape from the adapter side. Same `T` flows
|
|
36
|
-
* through `IChangeSource<T>`, `IFieldDiffer<T>`, `
|
|
36
|
+
* through `IChangeSource<T>`, `IFieldDiffer<T>`, `IIntegrationSink<T>`.
|
|
37
37
|
*
|
|
38
38
|
* ## No CRM bleed
|
|
39
39
|
*
|
|
@@ -41,30 +41,30 @@
|
|
|
41
41
|
* is strictly provider-agnostic:
|
|
42
42
|
* - `entityType` is `string` throughout; no `'opportunity' | 'account' | ...`
|
|
43
43
|
* narrowing leaks into the use case
|
|
44
|
-
* - the upstream consumer's `
|
|
45
|
-
* `
|
|
44
|
+
* - the upstream consumer's `IntegrationRunRecorderService` class injection replaced with the
|
|
45
|
+
* `IIntegrationRunRecorder` protocol (backend lands in SYNC-4)
|
|
46
46
|
*/
|
|
47
47
|
import { Inject, Injectable, Logger, Optional } from '@nestjs/common';
|
|
48
|
-
import type { IChangeSource, Change } from './
|
|
49
|
-
import type { ICursorStore } from './
|
|
50
|
-
import type { IFieldDiffer, FieldDiff } from './
|
|
51
|
-
import type {
|
|
52
|
-
import type {
|
|
53
|
-
import { assertTenantId } from './
|
|
48
|
+
import type { IChangeSource, Change } from './integration-change-source.protocol';
|
|
49
|
+
import type { ICursorStore } from './integration-cursor-store.protocol';
|
|
50
|
+
import type { IFieldDiffer, FieldDiff } from './integration-field-diff.protocol';
|
|
51
|
+
import type { IIntegrationSink } from './integration-sink.protocol';
|
|
52
|
+
import type { IIntegrationRunRecorder } from './integration-run-recorder.protocol';
|
|
53
|
+
import { assertTenantId } from './integration-errors';
|
|
54
54
|
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} from './
|
|
55
|
+
INTEGRATION_CHANGE_SOURCE,
|
|
56
|
+
INTEGRATION_CURSOR_STORE,
|
|
57
|
+
INTEGRATION_FIELD_DIFFER,
|
|
58
|
+
INTEGRATION_MULTI_TENANT,
|
|
59
|
+
INTEGRATION_RUN_RECORDER,
|
|
60
|
+
INTEGRATION_SINK,
|
|
61
|
+
} from './integration.tokens';
|
|
62
62
|
|
|
63
63
|
// ============================================================================
|
|
64
64
|
// Inputs + result
|
|
65
65
|
// ============================================================================
|
|
66
66
|
|
|
67
|
-
export interface
|
|
67
|
+
export interface ExecuteIntegrationInput<T> {
|
|
68
68
|
/** The subscription whose cursor/identity frames this run. */
|
|
69
69
|
readonly subscription: {
|
|
70
70
|
readonly id: string;
|
|
@@ -77,19 +77,19 @@ export interface ExecuteSyncInput<T> {
|
|
|
77
77
|
readonly provider: string;
|
|
78
78
|
/** Run direction — almost always `'inbound'`. Reserved for writeback. */
|
|
79
79
|
readonly direction: 'inbound' | 'outbound';
|
|
80
|
-
/** Detection mode — maps 1:1 to `
|
|
80
|
+
/** Detection mode — maps 1:1 to `integration_runs.action`. */
|
|
81
81
|
readonly action: 'poll' | 'cdc' | 'webhook' | 'manual' | 'writeback';
|
|
82
82
|
/** Multi-tenant deployments pass the tenant id through. */
|
|
83
83
|
readonly tenantId?: string | null;
|
|
84
84
|
/**
|
|
85
85
|
* Optional override — inject a specific change source for this run when
|
|
86
86
|
* the DI-bound source is not the one to use (e.g. manual backfill with
|
|
87
|
-
* a custom cursor). Defaults to the DI-resolved `
|
|
87
|
+
* a custom cursor). Defaults to the DI-resolved `INTEGRATION_CHANGE_SOURCE`.
|
|
88
88
|
*/
|
|
89
89
|
readonly sourceOverride?: IChangeSource<T>;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export interface
|
|
92
|
+
export interface ExecuteIntegrationResult {
|
|
93
93
|
readonly runId: string;
|
|
94
94
|
readonly status: 'success' | 'no_changes' | 'failed';
|
|
95
95
|
readonly recordsFound: number;
|
|
@@ -102,25 +102,25 @@ export interface ExecuteSyncResult {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// ============================================================================
|
|
105
|
-
//
|
|
105
|
+
// ExecuteIntegrationUseCase
|
|
106
106
|
// ============================================================================
|
|
107
107
|
|
|
108
108
|
@Injectable()
|
|
109
|
-
export class
|
|
110
|
-
private readonly logger = new Logger(
|
|
109
|
+
export class ExecuteIntegrationUseCase<T extends Record<string, unknown>> {
|
|
110
|
+
private readonly logger = new Logger(ExecuteIntegrationUseCase.name);
|
|
111
111
|
|
|
112
112
|
constructor(
|
|
113
|
-
@Inject(
|
|
114
|
-
@Inject(
|
|
115
|
-
@Inject(
|
|
116
|
-
@Inject(
|
|
117
|
-
@Inject(
|
|
113
|
+
@Inject(INTEGRATION_CHANGE_SOURCE) private readonly source: IChangeSource<T>,
|
|
114
|
+
@Inject(INTEGRATION_CURSOR_STORE) private readonly cursors: ICursorStore,
|
|
115
|
+
@Inject(INTEGRATION_FIELD_DIFFER) private readonly differ: IFieldDiffer<T>,
|
|
116
|
+
@Inject(INTEGRATION_SINK) private readonly sink: IIntegrationSink<T>,
|
|
117
|
+
@Inject(INTEGRATION_RUN_RECORDER) private readonly recorder: IIntegrationRunRecorder,
|
|
118
118
|
@Optional()
|
|
119
|
-
@Inject(
|
|
119
|
+
@Inject(INTEGRATION_MULTI_TENANT)
|
|
120
120
|
private readonly multiTenant: boolean = false,
|
|
121
121
|
) {}
|
|
122
122
|
|
|
123
|
-
async execute(input:
|
|
123
|
+
async execute(input: ExecuteIntegrationInput<T>): Promise<ExecuteIntegrationResult> {
|
|
124
124
|
// Defense-in-depth tenancy guard — fire BEFORE startRun so a rejected
|
|
125
125
|
// input never leaves a dangling `status=running` row. Backends also
|
|
126
126
|
// enforce (SYNC-4), but failing fast at the orchestrator boundary is
|
|
@@ -163,10 +163,10 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
163
163
|
recordsFailed++;
|
|
164
164
|
const message = err instanceof Error ? err.message : String(err);
|
|
165
165
|
this.logger.warn(
|
|
166
|
-
`
|
|
166
|
+
`integration item failed: subscription=${input.subscription.id} externalId=${change.externalId}: ${message}`,
|
|
167
167
|
);
|
|
168
168
|
await this.recorder.recordItem({
|
|
169
|
-
|
|
169
|
+
integrationRunId: runId,
|
|
170
170
|
entityType: input.subscription.domain,
|
|
171
171
|
externalId: change.externalId,
|
|
172
172
|
operation: change.operation === 'deleted' ? 'deleted' : 'updated',
|
|
@@ -197,7 +197,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
197
197
|
status = 'failed';
|
|
198
198
|
runError = err instanceof Error ? err.message : String(err);
|
|
199
199
|
this.logger.error(
|
|
200
|
-
`
|
|
200
|
+
`integration source failed: subscription=${input.subscription.id}: ${runError}`,
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -244,7 +244,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
244
244
|
|
|
245
245
|
private async processChange(
|
|
246
246
|
runId: string,
|
|
247
|
-
input:
|
|
247
|
+
input: ExecuteIntegrationInput<T>,
|
|
248
248
|
change: Change<T>,
|
|
249
249
|
): Promise<void> {
|
|
250
250
|
// Deletion branch — no diff, no upsert; soft-delete via sink.
|
|
@@ -254,7 +254,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
254
254
|
change.externalId,
|
|
255
255
|
);
|
|
256
256
|
await this.recorder.recordItem({
|
|
257
|
-
|
|
257
|
+
integrationRunId: runId,
|
|
258
258
|
entityType: input.subscription.domain,
|
|
259
259
|
externalId: change.externalId,
|
|
260
260
|
localId: result?.id ?? null,
|
|
@@ -285,7 +285,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
285
285
|
// returned by the upsert. Sinks without the flag keep today's behavior.
|
|
286
286
|
if (!this.sink.reprojectsOnNoop) {
|
|
287
287
|
await this.recorder.recordItem({
|
|
288
|
-
|
|
288
|
+
integrationRunId: runId,
|
|
289
289
|
entityType: input.subscription.domain,
|
|
290
290
|
externalId: change.externalId,
|
|
291
291
|
localId: null,
|
|
@@ -303,7 +303,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
303
303
|
input.provider,
|
|
304
304
|
);
|
|
305
305
|
await this.recorder.recordItem({
|
|
306
|
-
|
|
306
|
+
integrationRunId: runId,
|
|
307
307
|
entityType: input.subscription.domain,
|
|
308
308
|
externalId: change.externalId,
|
|
309
309
|
localId: noopLocalId,
|
|
@@ -322,7 +322,7 @@ export class ExecuteSyncUseCase<T extends Record<string, unknown>> {
|
|
|
322
322
|
);
|
|
323
323
|
|
|
324
324
|
await this.recorder.recordItem({
|
|
325
|
-
|
|
325
|
+
integrationRunId: runId,
|
|
326
326
|
entityType: input.subscription.domain,
|
|
327
327
|
externalId: change.externalId,
|
|
328
328
|
localId,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Integration subsystem — public API
|
|
3
3
|
*
|
|
4
4
|
* Slices landed so far:
|
|
5
5
|
* - SYNC-2 — protocols + DI tokens (#134)
|
|
6
6
|
* - SYNC-1 — Drizzle audit-table schemas (#148)
|
|
7
7
|
* - SYNC-3 — MemoryCursorStore (#149)
|
|
8
|
-
* - SYNC-5 —
|
|
8
|
+
* - SYNC-5 — ExecuteIntegrationUseCase + DeepEqualDiffer + recorder/loopback protocols (#150)
|
|
9
9
|
* - SYNC-4 — Drizzle backends (#151)
|
|
10
|
-
* - SYNC-6 —
|
|
10
|
+
* - SYNC-6 — IntegrationModule + MemoryRunRecorder + multi-tenancy opt-in (this slice)
|
|
11
11
|
*
|
|
12
12
|
* Scaffold templates (SYNC-7) and docs/skills (SYNC-8) land in their own
|
|
13
13
|
* PRs. See epic #60.
|
|
@@ -18,31 +18,39 @@ export type {
|
|
|
18
18
|
Change,
|
|
19
19
|
ChangeSource,
|
|
20
20
|
IChangeSource,
|
|
21
|
-
|
|
22
|
-
} from './
|
|
21
|
+
IntegrationSubscriptionView,
|
|
22
|
+
} from './integration-change-source.protocol';
|
|
23
23
|
export type {
|
|
24
24
|
CursorSnapshot,
|
|
25
25
|
ICursorStore,
|
|
26
|
-
} from './
|
|
26
|
+
} from './integration-cursor-store.protocol';
|
|
27
27
|
export type {
|
|
28
28
|
DiffResult,
|
|
29
29
|
FieldDiff,
|
|
30
30
|
FieldDiffValue,
|
|
31
31
|
IFieldDiffer,
|
|
32
|
-
} from './
|
|
32
|
+
} from './integration-field-diff.protocol';
|
|
33
33
|
export {
|
|
34
34
|
FieldDiffSchema,
|
|
35
35
|
FieldDiffValueSchema,
|
|
36
|
-
} from './
|
|
37
|
-
export type {
|
|
36
|
+
} from './integration-field-diff.protocol';
|
|
37
|
+
export type { IIntegrationSink } from './integration-sink.protocol';
|
|
38
38
|
export type {
|
|
39
39
|
CompleteRunInput,
|
|
40
|
-
|
|
40
|
+
IIntegrationRunRecorder,
|
|
41
41
|
RecordItemInput,
|
|
42
42
|
StartRunInput,
|
|
43
|
-
|
|
44
|
-
} from './
|
|
45
|
-
export type { ILoopbackFingerprintStore } from './
|
|
43
|
+
IntegrationRunSummary,
|
|
44
|
+
} from './integration-run-recorder.protocol';
|
|
45
|
+
export type { ILoopbackFingerprintStore } from './integration-loopback.protocol';
|
|
46
|
+
|
|
47
|
+
// Entity-keyed change-source registry (C7, #336) — L1 protocol + memory impl.
|
|
48
|
+
// Generalizes per-entity `<ENTITY>_POLL_FETCH_REGISTRY` tokens into one
|
|
49
|
+
// entity-keyed registry so the L3 surface port (C6) is entity-agnostic. Codegen
|
|
50
|
+
// retarget to emit it is Track D D3/D4 (RFC-0001 §3).
|
|
51
|
+
export type { IEntityChangeSourceRegistry } from './entity-change-source-registry.protocol';
|
|
52
|
+
export { UnknownEntityError } from './entity-change-source-registry.protocol';
|
|
53
|
+
export { MemoryEntityChangeSourceRegistry } from './entity-change-source-registry.memory';
|
|
46
54
|
|
|
47
55
|
// DetectionConfig (#226-1) — Zod schema + inferred types; canonical source
|
|
48
56
|
// of filter/mapping shape consumed by primitives + codegen YAML validator
|
|
@@ -68,10 +76,10 @@ export type {
|
|
|
68
76
|
ChangeIterator,
|
|
69
77
|
ChangeMiddleware,
|
|
70
78
|
ComposeChangeMiddleware,
|
|
71
|
-
} from './
|
|
79
|
+
} from './integration-middleware.protocol';
|
|
72
80
|
|
|
73
81
|
// Loopback middleware factory (#226-5) — replaces the orchestrator's prior
|
|
74
|
-
// `@Optional()
|
|
82
|
+
// `@Optional() INTEGRATION_LOOPBACK_FINGERPRINT_STORE` branch. Consumers compose
|
|
75
83
|
// `createLoopbackMiddleware(store)` into their primitive's middleware chain.
|
|
76
84
|
export { createLoopbackMiddleware } from './loopback.middleware';
|
|
77
85
|
|
|
@@ -100,42 +108,43 @@ export { buildChangeSource } from './build-change-source';
|
|
|
100
108
|
|
|
101
109
|
// Tokens
|
|
102
110
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
ENTITY_CHANGE_SOURCE_REGISTRY,
|
|
112
|
+
INTEGRATION_CHANGE_SOURCE,
|
|
113
|
+
INTEGRATION_CURSOR_STORE,
|
|
114
|
+
INTEGRATION_FIELD_DIFFER,
|
|
115
|
+
INTEGRATION_MODULE_OPTIONS,
|
|
116
|
+
INTEGRATION_MULTI_TENANT,
|
|
117
|
+
INTEGRATION_RUN_RECORDER,
|
|
118
|
+
INTEGRATION_SINK,
|
|
119
|
+
} from './integration.tokens';
|
|
111
120
|
|
|
112
121
|
// Errors + shared guards
|
|
113
|
-
export { MissingTenantIdError, assertTenantId } from './
|
|
122
|
+
export { MissingTenantIdError, assertTenantId } from './integration-errors';
|
|
114
123
|
|
|
115
124
|
// Audit schemas (SYNC-1) — Drizzle pgTable declarations + row types + enums
|
|
116
125
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} from './
|
|
126
|
+
integrationSubscriptions,
|
|
127
|
+
integrationRuns,
|
|
128
|
+
integrationRunItems,
|
|
129
|
+
integrationRunDirectionEnum,
|
|
130
|
+
integrationRunActionEnum,
|
|
131
|
+
integrationRunStatusEnum,
|
|
132
|
+
integrationRunItemOperationEnum,
|
|
133
|
+
integrationRunItemStatusEnum,
|
|
134
|
+
} from './integration-audit.schema';
|
|
126
135
|
export type {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} from './
|
|
136
|
+
IntegrationSubscriptionRow,
|
|
137
|
+
IntegrationRunRow,
|
|
138
|
+
IntegrationRunItemRow,
|
|
139
|
+
} from './integration-audit.schema';
|
|
131
140
|
|
|
132
141
|
// Memory backends (SYNC-3, SYNC-6) — test doubles
|
|
133
|
-
export { MemoryCursorStore } from './
|
|
142
|
+
export { MemoryCursorStore } from './integration-cursor-store.memory-backend';
|
|
134
143
|
export {
|
|
135
144
|
MemoryRunRecorder,
|
|
136
145
|
type MemoryRunRecord,
|
|
137
|
-
type
|
|
138
|
-
} from './
|
|
146
|
+
type MemoryIntegrationSubscription,
|
|
147
|
+
} from './integration-run-recorder.memory-backend';
|
|
139
148
|
|
|
140
149
|
// Runtime (SYNC-5) — orchestrator + default differ
|
|
141
150
|
export {
|
|
@@ -143,14 +152,14 @@ export {
|
|
|
143
152
|
type DeepEqualDifferOptions,
|
|
144
153
|
} from './deep-equal.differ';
|
|
145
154
|
export {
|
|
146
|
-
|
|
147
|
-
type
|
|
148
|
-
type
|
|
149
|
-
} from './execute-
|
|
155
|
+
ExecuteIntegrationUseCase,
|
|
156
|
+
type ExecuteIntegrationInput,
|
|
157
|
+
type ExecuteIntegrationResult,
|
|
158
|
+
} from './execute-integration.use-case';
|
|
150
159
|
|
|
151
160
|
// Drizzle backends (SYNC-4)
|
|
152
|
-
export { PostgresCursorStore } from './
|
|
153
|
-
export {
|
|
161
|
+
export { PostgresCursorStore } from './integration-cursor-store.drizzle-backend';
|
|
162
|
+
export { DrizzleIntegrationRunRecorder } from './integration-run-recorder.drizzle-backend';
|
|
154
163
|
|
|
155
164
|
// Module (SYNC-6)
|
|
156
|
-
export {
|
|
165
|
+
export { IntegrationModule, type IntegrationModuleOptions } from './integration.module';
|