@pattern-stack/codegen 0.10.1 → 0.11.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 +62 -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 +7 -7
- package/dist/runtime/subsystems/index.js +51 -51
- 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/{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 +28 -0
- package/dist/runtime/subsystems/{sync → integration}/index.js +171 -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 +47 -0
- package/dist/runtime/subsystems/integration/integration.tokens.js +18 -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 +262 -269
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.d.ts +22 -22
- package/dist/src/index.js +191 -191
- 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 +1 -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 +11 -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/{sync/execute-sync.use-case.ts → integration/execute-integration.use-case.ts} +40 -40
- package/runtime/subsystems/{sync → integration}/index.ts +47 -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 +49 -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/backend/modules/core/{sync-source.providers.ejs.t → integration-source.providers.ejs.t} +2 -2
- package/templates/entity/new/clean-lite-ps/entity.ejs.t +1 -1
- package/templates/entity/new/clean-lite-ps/module.ejs.t +1 -1
- package/templates/entity/new/clean-lite-ps/prompt-extension.js +33 -33
- 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/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
|
@@ -2,21 +2,21 @@ import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
|
2
2
|
import { InferSelectModel } from 'drizzle-orm';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Direction of a
|
|
5
|
+
* Direction of a integration run relative to local state.
|
|
6
6
|
*
|
|
7
7
|
* - `inbound` — external → local (the common case: SFDC poll → local DB).
|
|
8
8
|
* - `outbound` — local → external (writeback; deferred per epic but the
|
|
9
9
|
* column shape is reserved so future writeback runs share the audit log).
|
|
10
10
|
*/
|
|
11
|
-
declare const
|
|
11
|
+
declare const integrationRunDirectionEnum: drizzle_orm_pg_core.PgEnum<["inbound", "outbound"]>;
|
|
12
12
|
/**
|
|
13
13
|
* How the run detected upstream changes. Maps 1:1 to the `Change.source`
|
|
14
|
-
* provenance on inbound runs; `manual` captures operator-triggered re-
|
|
14
|
+
* provenance on inbound runs; `manual` captures operator-triggered re-integrations
|
|
15
15
|
* and `writeback` captures outbound runs.
|
|
16
16
|
*/
|
|
17
|
-
declare const
|
|
17
|
+
declare const integrationRunActionEnum: drizzle_orm_pg_core.PgEnum<["poll", "cdc", "webhook", "manual", "writeback"]>;
|
|
18
18
|
/**
|
|
19
|
-
* Lifecycle status of a
|
|
19
|
+
* Lifecycle status of a integration run.
|
|
20
20
|
*
|
|
21
21
|
* - `running` — in-flight; recorder has started but not completed.
|
|
22
22
|
* - `success` — completed with at least one change processed.
|
|
@@ -24,23 +24,23 @@ declare const syncRunActionEnum: drizzle_orm_pg_core.PgEnum<["poll", "cdc", "web
|
|
|
24
24
|
* - `failed` — errored before completion; `error` column carries the
|
|
25
25
|
* message. `records_processed` may be non-zero (partial progress).
|
|
26
26
|
*/
|
|
27
|
-
declare const
|
|
27
|
+
declare const integrationRunStatusEnum: drizzle_orm_pg_core.PgEnum<["running", "success", "no_changes", "failed"]>;
|
|
28
28
|
/**
|
|
29
29
|
* Operation applied per record. Mirrors `Change<T>.operation` from SYNC-2,
|
|
30
30
|
* plus the recorder's own `'noop'` for changes that matched existing state.
|
|
31
31
|
*/
|
|
32
|
-
declare const
|
|
32
|
+
declare const integrationRunItemOperationEnum: drizzle_orm_pg_core.PgEnum<["created", "updated", "deleted", "noop"]>;
|
|
33
33
|
/**
|
|
34
34
|
* Per-record status within a run. `skipped` captures loopback-detected echoes
|
|
35
35
|
* of the local system's own writes (see `ILoopbackFingerprintStore` in the
|
|
36
36
|
* epic), which record the external_id but intentionally do not touch local
|
|
37
37
|
* state.
|
|
38
38
|
*/
|
|
39
|
-
declare const
|
|
39
|
+
declare const integrationRunItemStatusEnum: drizzle_orm_pg_core.PgEnum<["success", "failed", "skipped"]>;
|
|
40
40
|
/**
|
|
41
41
|
* One cursor owner per (integration, adapter, domain, external_ref).
|
|
42
42
|
*
|
|
43
|
-
* - `
|
|
43
|
+
* - `connection_id` — opaque id of the connected account/instance. E.g.
|
|
44
44
|
* the SFDC org id for polling strategies, the GitHub installation id
|
|
45
45
|
* for webhook strategies.
|
|
46
46
|
* - `adapter` — short adapter label, e.g. `'salesforce'`, `'hubspot'`.
|
|
@@ -54,13 +54,13 @@ declare const syncRunItemStatusEnum: drizzle_orm_pg_core.PgEnum<["success", "fai
|
|
|
54
54
|
* `{ systemModstamp }`, cdc: `{ replayId }`, webhook: `{ ts }`). Overwritten
|
|
55
55
|
* by `ICursorStore.put(id, cursor)`.
|
|
56
56
|
*/
|
|
57
|
-
declare const
|
|
58
|
-
name: "
|
|
57
|
+
declare const integrationSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
58
|
+
name: "integration_subscriptions";
|
|
59
59
|
schema: undefined;
|
|
60
60
|
columns: {
|
|
61
61
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
62
62
|
name: "id";
|
|
63
|
-
tableName: "
|
|
63
|
+
tableName: "integration_subscriptions";
|
|
64
64
|
dataType: "string";
|
|
65
65
|
columnType: "PgUUID";
|
|
66
66
|
data: string;
|
|
@@ -75,9 +75,9 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
75
75
|
identity: undefined;
|
|
76
76
|
generated: undefined;
|
|
77
77
|
}, {}, {}>;
|
|
78
|
-
|
|
79
|
-
name: "
|
|
80
|
-
tableName: "
|
|
78
|
+
connectionId: drizzle_orm_pg_core.PgColumn<{
|
|
79
|
+
name: "connection_id";
|
|
80
|
+
tableName: "integration_subscriptions";
|
|
81
81
|
dataType: "string";
|
|
82
82
|
columnType: "PgText";
|
|
83
83
|
data: string;
|
|
@@ -94,7 +94,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
94
94
|
}, {}, {}>;
|
|
95
95
|
adapter: drizzle_orm_pg_core.PgColumn<{
|
|
96
96
|
name: "adapter";
|
|
97
|
-
tableName: "
|
|
97
|
+
tableName: "integration_subscriptions";
|
|
98
98
|
dataType: "string";
|
|
99
99
|
columnType: "PgText";
|
|
100
100
|
data: string;
|
|
@@ -111,7 +111,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
111
111
|
}, {}, {}>;
|
|
112
112
|
domain: drizzle_orm_pg_core.PgColumn<{
|
|
113
113
|
name: "domain";
|
|
114
|
-
tableName: "
|
|
114
|
+
tableName: "integration_subscriptions";
|
|
115
115
|
dataType: "string";
|
|
116
116
|
columnType: "PgText";
|
|
117
117
|
data: string;
|
|
@@ -128,7 +128,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
128
128
|
}, {}, {}>;
|
|
129
129
|
externalRef: drizzle_orm_pg_core.PgColumn<{
|
|
130
130
|
name: "external_ref";
|
|
131
|
-
tableName: "
|
|
131
|
+
tableName: "integration_subscriptions";
|
|
132
132
|
dataType: "string";
|
|
133
133
|
columnType: "PgText";
|
|
134
134
|
data: string;
|
|
@@ -145,7 +145,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
145
145
|
}, {}, {}>;
|
|
146
146
|
enabled: drizzle_orm_pg_core.PgColumn<{
|
|
147
147
|
name: "enabled";
|
|
148
|
-
tableName: "
|
|
148
|
+
tableName: "integration_subscriptions";
|
|
149
149
|
dataType: "boolean";
|
|
150
150
|
columnType: "PgBoolean";
|
|
151
151
|
data: boolean;
|
|
@@ -162,7 +162,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
162
162
|
}, {}, {}>;
|
|
163
163
|
config: drizzle_orm_pg_core.PgColumn<{
|
|
164
164
|
name: "config";
|
|
165
|
-
tableName: "
|
|
165
|
+
tableName: "integration_subscriptions";
|
|
166
166
|
dataType: "json";
|
|
167
167
|
columnType: "PgJsonb";
|
|
168
168
|
data: Record<string, unknown>;
|
|
@@ -181,7 +181,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
181
181
|
}>;
|
|
182
182
|
cursor: drizzle_orm_pg_core.PgColumn<{
|
|
183
183
|
name: "cursor";
|
|
184
|
-
tableName: "
|
|
184
|
+
tableName: "integration_subscriptions";
|
|
185
185
|
dataType: "json";
|
|
186
186
|
columnType: "PgJsonb";
|
|
187
187
|
data: unknown;
|
|
@@ -198,9 +198,9 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
198
198
|
}, {}, {
|
|
199
199
|
$type: unknown;
|
|
200
200
|
}>;
|
|
201
|
-
|
|
202
|
-
name: "
|
|
203
|
-
tableName: "
|
|
201
|
+
lastIntegrationAt: drizzle_orm_pg_core.PgColumn<{
|
|
202
|
+
name: "last_integration_at";
|
|
203
|
+
tableName: "integration_subscriptions";
|
|
204
204
|
dataType: "date";
|
|
205
205
|
columnType: "PgTimestamp";
|
|
206
206
|
data: Date;
|
|
@@ -217,7 +217,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
217
217
|
}, {}, {}>;
|
|
218
218
|
tenantId: drizzle_orm_pg_core.PgColumn<{
|
|
219
219
|
name: "tenant_id";
|
|
220
|
-
tableName: "
|
|
220
|
+
tableName: "integration_subscriptions";
|
|
221
221
|
dataType: "string";
|
|
222
222
|
columnType: "PgText";
|
|
223
223
|
data: string;
|
|
@@ -234,7 +234,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
234
234
|
}, {}, {}>;
|
|
235
235
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
236
236
|
name: "created_at";
|
|
237
|
-
tableName: "
|
|
237
|
+
tableName: "integration_subscriptions";
|
|
238
238
|
dataType: "date";
|
|
239
239
|
columnType: "PgTimestamp";
|
|
240
240
|
data: Date;
|
|
@@ -251,7 +251,7 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
251
251
|
}, {}, {}>;
|
|
252
252
|
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
253
253
|
name: "updated_at";
|
|
254
|
-
tableName: "
|
|
254
|
+
tableName: "integration_subscriptions";
|
|
255
255
|
dataType: "date";
|
|
256
256
|
columnType: "PgTimestamp";
|
|
257
257
|
data: Date;
|
|
@@ -269,9 +269,9 @@ declare const syncSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
269
269
|
};
|
|
270
270
|
dialect: "pg";
|
|
271
271
|
}>;
|
|
272
|
-
type
|
|
272
|
+
type IntegrationSubscriptionRow = InferSelectModel<typeof integrationSubscriptions>;
|
|
273
273
|
/**
|
|
274
|
-
* One row per invocation of `
|
|
274
|
+
* One row per invocation of `ExecuteIntegrationUseCase`. `started_at` is set when
|
|
275
275
|
* the recorder opens the run; `completed_at`, `status`, `records_*`,
|
|
276
276
|
* `cursor_after`, and `duration_ms` are filled on completion.
|
|
277
277
|
*
|
|
@@ -280,13 +280,13 @@ type SyncSubscriptionRow = InferSelectModel<typeof syncSubscriptions>;
|
|
|
280
280
|
* about exactly what window was scanned without cross-referencing another
|
|
281
281
|
* table.
|
|
282
282
|
*/
|
|
283
|
-
declare const
|
|
284
|
-
name: "
|
|
283
|
+
declare const integrationRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
284
|
+
name: "integration_runs";
|
|
285
285
|
schema: undefined;
|
|
286
286
|
columns: {
|
|
287
287
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
288
288
|
name: "id";
|
|
289
|
-
tableName: "
|
|
289
|
+
tableName: "integration_runs";
|
|
290
290
|
dataType: "string";
|
|
291
291
|
columnType: "PgUUID";
|
|
292
292
|
data: string;
|
|
@@ -303,7 +303,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
303
303
|
}, {}, {}>;
|
|
304
304
|
subscriptionId: drizzle_orm_pg_core.PgColumn<{
|
|
305
305
|
name: "subscription_id";
|
|
306
|
-
tableName: "
|
|
306
|
+
tableName: "integration_runs";
|
|
307
307
|
dataType: "string";
|
|
308
308
|
columnType: "PgUUID";
|
|
309
309
|
data: string;
|
|
@@ -320,7 +320,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
320
320
|
}, {}, {}>;
|
|
321
321
|
direction: drizzle_orm_pg_core.PgColumn<{
|
|
322
322
|
name: "direction";
|
|
323
|
-
tableName: "
|
|
323
|
+
tableName: "integration_runs";
|
|
324
324
|
dataType: "string";
|
|
325
325
|
columnType: "PgEnumColumn";
|
|
326
326
|
data: "inbound" | "outbound";
|
|
@@ -337,7 +337,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
337
337
|
}, {}, {}>;
|
|
338
338
|
action: drizzle_orm_pg_core.PgColumn<{
|
|
339
339
|
name: "action";
|
|
340
|
-
tableName: "
|
|
340
|
+
tableName: "integration_runs";
|
|
341
341
|
dataType: "string";
|
|
342
342
|
columnType: "PgEnumColumn";
|
|
343
343
|
data: "poll" | "cdc" | "webhook" | "manual" | "writeback";
|
|
@@ -354,7 +354,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
354
354
|
}, {}, {}>;
|
|
355
355
|
status: drizzle_orm_pg_core.PgColumn<{
|
|
356
356
|
name: "status";
|
|
357
|
-
tableName: "
|
|
357
|
+
tableName: "integration_runs";
|
|
358
358
|
dataType: "string";
|
|
359
359
|
columnType: "PgEnumColumn";
|
|
360
360
|
data: "success" | "failed" | "no_changes" | "running";
|
|
@@ -371,7 +371,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
371
371
|
}, {}, {}>;
|
|
372
372
|
recordsFound: drizzle_orm_pg_core.PgColumn<{
|
|
373
373
|
name: "records_found";
|
|
374
|
-
tableName: "
|
|
374
|
+
tableName: "integration_runs";
|
|
375
375
|
dataType: "number";
|
|
376
376
|
columnType: "PgInteger";
|
|
377
377
|
data: number;
|
|
@@ -388,7 +388,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
388
388
|
}, {}, {}>;
|
|
389
389
|
recordsProcessed: drizzle_orm_pg_core.PgColumn<{
|
|
390
390
|
name: "records_processed";
|
|
391
|
-
tableName: "
|
|
391
|
+
tableName: "integration_runs";
|
|
392
392
|
dataType: "number";
|
|
393
393
|
columnType: "PgInteger";
|
|
394
394
|
data: number;
|
|
@@ -405,7 +405,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
405
405
|
}, {}, {}>;
|
|
406
406
|
cursorBefore: drizzle_orm_pg_core.PgColumn<{
|
|
407
407
|
name: "cursor_before";
|
|
408
|
-
tableName: "
|
|
408
|
+
tableName: "integration_runs";
|
|
409
409
|
dataType: "json";
|
|
410
410
|
columnType: "PgJsonb";
|
|
411
411
|
data: unknown;
|
|
@@ -424,7 +424,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
424
424
|
}>;
|
|
425
425
|
cursorAfter: drizzle_orm_pg_core.PgColumn<{
|
|
426
426
|
name: "cursor_after";
|
|
427
|
-
tableName: "
|
|
427
|
+
tableName: "integration_runs";
|
|
428
428
|
dataType: "json";
|
|
429
429
|
columnType: "PgJsonb";
|
|
430
430
|
data: unknown;
|
|
@@ -443,7 +443,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
443
443
|
}>;
|
|
444
444
|
durationMs: drizzle_orm_pg_core.PgColumn<{
|
|
445
445
|
name: "duration_ms";
|
|
446
|
-
tableName: "
|
|
446
|
+
tableName: "integration_runs";
|
|
447
447
|
dataType: "number";
|
|
448
448
|
columnType: "PgInteger";
|
|
449
449
|
data: number;
|
|
@@ -460,7 +460,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
460
460
|
}, {}, {}>;
|
|
461
461
|
error: drizzle_orm_pg_core.PgColumn<{
|
|
462
462
|
name: "error";
|
|
463
|
-
tableName: "
|
|
463
|
+
tableName: "integration_runs";
|
|
464
464
|
dataType: "string";
|
|
465
465
|
columnType: "PgText";
|
|
466
466
|
data: string;
|
|
@@ -477,7 +477,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
477
477
|
}, {}, {}>;
|
|
478
478
|
startedAt: drizzle_orm_pg_core.PgColumn<{
|
|
479
479
|
name: "started_at";
|
|
480
|
-
tableName: "
|
|
480
|
+
tableName: "integration_runs";
|
|
481
481
|
dataType: "date";
|
|
482
482
|
columnType: "PgTimestamp";
|
|
483
483
|
data: Date;
|
|
@@ -494,7 +494,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
494
494
|
}, {}, {}>;
|
|
495
495
|
completedAt: drizzle_orm_pg_core.PgColumn<{
|
|
496
496
|
name: "completed_at";
|
|
497
|
-
tableName: "
|
|
497
|
+
tableName: "integration_runs";
|
|
498
498
|
dataType: "date";
|
|
499
499
|
columnType: "PgTimestamp";
|
|
500
500
|
data: Date;
|
|
@@ -511,7 +511,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
511
511
|
}, {}, {}>;
|
|
512
512
|
tenantId: drizzle_orm_pg_core.PgColumn<{
|
|
513
513
|
name: "tenant_id";
|
|
514
|
-
tableName: "
|
|
514
|
+
tableName: "integration_runs";
|
|
515
515
|
dataType: "string";
|
|
516
516
|
columnType: "PgText";
|
|
517
517
|
data: string;
|
|
@@ -529,7 +529,7 @@ declare const syncRuns: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
529
529
|
};
|
|
530
530
|
dialect: "pg";
|
|
531
531
|
}>;
|
|
532
|
-
type
|
|
532
|
+
type IntegrationRunRow = InferSelectModel<typeof integrationRuns>;
|
|
533
533
|
/**
|
|
534
534
|
* One row per upstream change processed within a run. Captures the canonical
|
|
535
535
|
* decision the orchestrator made (`operation` + `status`), the structured
|
|
@@ -545,13 +545,13 @@ type SyncRunRow = InferSelectModel<typeof syncRuns>;
|
|
|
545
545
|
* `"Pinnacle opportunity"`) so run-log UIs don't need to re-hydrate the
|
|
546
546
|
* canonical record.
|
|
547
547
|
*/
|
|
548
|
-
declare const
|
|
549
|
-
name: "
|
|
548
|
+
declare const integrationRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
549
|
+
name: "integration_run_items";
|
|
550
550
|
schema: undefined;
|
|
551
551
|
columns: {
|
|
552
552
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
553
553
|
name: "id";
|
|
554
|
-
tableName: "
|
|
554
|
+
tableName: "integration_run_items";
|
|
555
555
|
dataType: "string";
|
|
556
556
|
columnType: "PgUUID";
|
|
557
557
|
data: string;
|
|
@@ -566,9 +566,9 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
566
566
|
identity: undefined;
|
|
567
567
|
generated: undefined;
|
|
568
568
|
}, {}, {}>;
|
|
569
|
-
|
|
570
|
-
name: "
|
|
571
|
-
tableName: "
|
|
569
|
+
integrationRunId: drizzle_orm_pg_core.PgColumn<{
|
|
570
|
+
name: "integration_run_id";
|
|
571
|
+
tableName: "integration_run_items";
|
|
572
572
|
dataType: "string";
|
|
573
573
|
columnType: "PgUUID";
|
|
574
574
|
data: string;
|
|
@@ -585,7 +585,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
585
585
|
}, {}, {}>;
|
|
586
586
|
entityType: drizzle_orm_pg_core.PgColumn<{
|
|
587
587
|
name: "entity_type";
|
|
588
|
-
tableName: "
|
|
588
|
+
tableName: "integration_run_items";
|
|
589
589
|
dataType: "string";
|
|
590
590
|
columnType: "PgText";
|
|
591
591
|
data: string;
|
|
@@ -602,7 +602,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
602
602
|
}, {}, {}>;
|
|
603
603
|
externalId: drizzle_orm_pg_core.PgColumn<{
|
|
604
604
|
name: "external_id";
|
|
605
|
-
tableName: "
|
|
605
|
+
tableName: "integration_run_items";
|
|
606
606
|
dataType: "string";
|
|
607
607
|
columnType: "PgText";
|
|
608
608
|
data: string;
|
|
@@ -619,7 +619,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
619
619
|
}, {}, {}>;
|
|
620
620
|
localId: drizzle_orm_pg_core.PgColumn<{
|
|
621
621
|
name: "local_id";
|
|
622
|
-
tableName: "
|
|
622
|
+
tableName: "integration_run_items";
|
|
623
623
|
dataType: "string";
|
|
624
624
|
columnType: "PgText";
|
|
625
625
|
data: string;
|
|
@@ -636,7 +636,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
636
636
|
}, {}, {}>;
|
|
637
637
|
operation: drizzle_orm_pg_core.PgColumn<{
|
|
638
638
|
name: "operation";
|
|
639
|
-
tableName: "
|
|
639
|
+
tableName: "integration_run_items";
|
|
640
640
|
dataType: "string";
|
|
641
641
|
columnType: "PgEnumColumn";
|
|
642
642
|
data: "created" | "updated" | "deleted" | "noop";
|
|
@@ -653,7 +653,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
653
653
|
}, {}, {}>;
|
|
654
654
|
status: drizzle_orm_pg_core.PgColumn<{
|
|
655
655
|
name: "status";
|
|
656
|
-
tableName: "
|
|
656
|
+
tableName: "integration_run_items";
|
|
657
657
|
dataType: "string";
|
|
658
658
|
columnType: "PgEnumColumn";
|
|
659
659
|
data: "success" | "failed" | "skipped";
|
|
@@ -670,7 +670,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
670
670
|
}, {}, {}>;
|
|
671
671
|
changedFields: drizzle_orm_pg_core.PgColumn<{
|
|
672
672
|
name: "changed_fields";
|
|
673
|
-
tableName: "
|
|
673
|
+
tableName: "integration_run_items";
|
|
674
674
|
dataType: "json";
|
|
675
675
|
columnType: "PgJsonb";
|
|
676
676
|
data: Record<string, {
|
|
@@ -695,7 +695,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
695
695
|
}>;
|
|
696
696
|
title: drizzle_orm_pg_core.PgColumn<{
|
|
697
697
|
name: "title";
|
|
698
|
-
tableName: "
|
|
698
|
+
tableName: "integration_run_items";
|
|
699
699
|
dataType: "string";
|
|
700
700
|
columnType: "PgText";
|
|
701
701
|
data: string;
|
|
@@ -712,7 +712,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
712
712
|
}, {}, {}>;
|
|
713
713
|
error: drizzle_orm_pg_core.PgColumn<{
|
|
714
714
|
name: "error";
|
|
715
|
-
tableName: "
|
|
715
|
+
tableName: "integration_run_items";
|
|
716
716
|
dataType: "string";
|
|
717
717
|
columnType: "PgText";
|
|
718
718
|
data: string;
|
|
@@ -729,7 +729,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
729
729
|
}, {}, {}>;
|
|
730
730
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
731
731
|
name: "created_at";
|
|
732
|
-
tableName: "
|
|
732
|
+
tableName: "integration_run_items";
|
|
733
733
|
dataType: "date";
|
|
734
734
|
columnType: "PgTimestamp";
|
|
735
735
|
data: Date;
|
|
@@ -746,7 +746,7 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
746
746
|
}, {}, {}>;
|
|
747
747
|
tenantId: drizzle_orm_pg_core.PgColumn<{
|
|
748
748
|
name: "tenant_id";
|
|
749
|
-
tableName: "
|
|
749
|
+
tableName: "integration_run_items";
|
|
750
750
|
dataType: "string";
|
|
751
751
|
columnType: "PgText";
|
|
752
752
|
data: string;
|
|
@@ -764,6 +764,6 @@ declare const syncRunItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
764
764
|
};
|
|
765
765
|
dialect: "pg";
|
|
766
766
|
}>;
|
|
767
|
-
type
|
|
767
|
+
type IntegrationRunItemRow = InferSelectModel<typeof integrationRunItems>;
|
|
768
768
|
|
|
769
|
-
export { type
|
|
769
|
+
export { type IntegrationRunItemRow, type IntegrationRunRow, type IntegrationSubscriptionRow, integrationRunActionEnum, integrationRunDirectionEnum, integrationRunItemOperationEnum, integrationRunItemStatusEnum, integrationRunItems, integrationRunStatusEnum, integrationRuns, integrationSubscriptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// runtime/subsystems/
|
|
1
|
+
// runtime/subsystems/integration/integration-audit.schema.ts
|
|
2
2
|
import {
|
|
3
3
|
pgEnum,
|
|
4
4
|
pgTable,
|
|
@@ -11,39 +11,39 @@ import {
|
|
|
11
11
|
index,
|
|
12
12
|
uniqueIndex
|
|
13
13
|
} from "drizzle-orm/pg-core";
|
|
14
|
-
var
|
|
14
|
+
var integrationRunDirectionEnum = pgEnum("integration_run_direction", [
|
|
15
15
|
"inbound",
|
|
16
16
|
"outbound"
|
|
17
17
|
]);
|
|
18
|
-
var
|
|
18
|
+
var integrationRunActionEnum = pgEnum("integration_run_action", [
|
|
19
19
|
"poll",
|
|
20
20
|
"cdc",
|
|
21
21
|
"webhook",
|
|
22
22
|
"manual",
|
|
23
23
|
"writeback"
|
|
24
24
|
]);
|
|
25
|
-
var
|
|
25
|
+
var integrationRunStatusEnum = pgEnum("integration_run_status", [
|
|
26
26
|
"running",
|
|
27
27
|
"success",
|
|
28
28
|
"no_changes",
|
|
29
29
|
"failed"
|
|
30
30
|
]);
|
|
31
|
-
var
|
|
31
|
+
var integrationRunItemOperationEnum = pgEnum("integration_run_item_operation", [
|
|
32
32
|
"created",
|
|
33
33
|
"updated",
|
|
34
34
|
"deleted",
|
|
35
35
|
"noop"
|
|
36
36
|
]);
|
|
37
|
-
var
|
|
37
|
+
var integrationRunItemStatusEnum = pgEnum("integration_run_item_status", [
|
|
38
38
|
"success",
|
|
39
39
|
"failed",
|
|
40
40
|
"skipped"
|
|
41
41
|
]);
|
|
42
|
-
var
|
|
43
|
-
"
|
|
42
|
+
var integrationSubscriptions = pgTable(
|
|
43
|
+
"integration_subscriptions",
|
|
44
44
|
{
|
|
45
45
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
46
|
-
|
|
46
|
+
connectionId: text("connection_id").notNull(),
|
|
47
47
|
adapter: text("adapter").notNull(),
|
|
48
48
|
domain: text("domain").notNull(),
|
|
49
49
|
externalRef: text("external_ref"),
|
|
@@ -58,8 +58,8 @@ var syncSubscriptions = pgTable(
|
|
|
58
58
|
* successful run advances it.
|
|
59
59
|
*/
|
|
60
60
|
cursor: jsonb("cursor").$type(),
|
|
61
|
-
|
|
62
|
-
/** Runtime-enforced when `
|
|
61
|
+
lastIntegrationAt: timestamp("last_integration_at", { withTimezone: true }),
|
|
62
|
+
/** Runtime-enforced when `INTEGRATION_MULTI_TENANT` is true; see SYNC-6. */
|
|
63
63
|
tenantId: text("tenant_id"),
|
|
64
64
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
65
65
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
@@ -68,31 +68,31 @@ var syncSubscriptions = pgTable(
|
|
|
68
68
|
/**
|
|
69
69
|
* Composite uniqueness per the epic shape. `external_ref` is nullable;
|
|
70
70
|
* Postgres treats NULLs as distinct in a UNIQUE constraint, which means
|
|
71
|
-
* two rows with the same `(
|
|
71
|
+
* two rows with the same `(connection_id, adapter, domain)` and NULL
|
|
72
72
|
* external_ref are allowed. That's intentional — a subscription with
|
|
73
73
|
* NULL external_ref covers the full domain, and duplicates there would
|
|
74
74
|
* be a consumer-layer modeling issue, not a schema concern.
|
|
75
75
|
*/
|
|
76
|
-
|
|
77
|
-
t.
|
|
76
|
+
uqIntegrationSubscriptionTuple: uniqueIndex("uq_integration_subscriptions_tuple").on(
|
|
77
|
+
t.connectionId,
|
|
78
78
|
t.adapter,
|
|
79
79
|
t.domain,
|
|
80
80
|
t.externalRef
|
|
81
81
|
),
|
|
82
82
|
/** Scheduling query: list enabled subscriptions ordered by staleness. */
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
).on(t.enabled, t.
|
|
83
|
+
idxIntegrationSubscriptionsEnabledLastIntegration: index(
|
|
84
|
+
"idx_integration_subscriptions_enabled_last_integration"
|
|
85
|
+
).on(t.enabled, t.lastIntegrationAt)
|
|
86
86
|
})
|
|
87
87
|
);
|
|
88
|
-
var
|
|
89
|
-
"
|
|
88
|
+
var integrationRuns = pgTable(
|
|
89
|
+
"integration_runs",
|
|
90
90
|
{
|
|
91
91
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
92
|
-
subscriptionId: uuid("subscription_id").notNull().references(() =>
|
|
93
|
-
direction:
|
|
94
|
-
action:
|
|
95
|
-
status:
|
|
92
|
+
subscriptionId: uuid("subscription_id").notNull().references(() => integrationSubscriptions.id, { onDelete: "cascade" }),
|
|
93
|
+
direction: integrationRunDirectionEnum("direction").notNull(),
|
|
94
|
+
action: integrationRunActionEnum("action").notNull(),
|
|
95
|
+
status: integrationRunStatusEnum("status").notNull().default("running"),
|
|
96
96
|
recordsFound: integer("records_found").notNull().default(0),
|
|
97
97
|
recordsProcessed: integer("records_processed").notNull().default(0),
|
|
98
98
|
cursorBefore: jsonb("cursor_before").$type(),
|
|
@@ -101,31 +101,31 @@ var syncRuns = pgTable(
|
|
|
101
101
|
error: text("error"),
|
|
102
102
|
startedAt: timestamp("started_at", { withTimezone: true }).notNull().defaultNow(),
|
|
103
103
|
completedAt: timestamp("completed_at", { withTimezone: true }),
|
|
104
|
-
/** Runtime-enforced when `
|
|
104
|
+
/** Runtime-enforced when `INTEGRATION_MULTI_TENANT` is true; see SYNC-6. */
|
|
105
105
|
tenantId: text("tenant_id")
|
|
106
106
|
},
|
|
107
107
|
(t) => ({
|
|
108
108
|
/** Timeline read: "most recent runs for this subscription". */
|
|
109
|
-
|
|
110
|
-
"
|
|
109
|
+
idxIntegrationRunsSubscriptionStartedAt: index(
|
|
110
|
+
"idx_integration_runs_subscription_started_at"
|
|
111
111
|
).on(t.subscriptionId, t.startedAt),
|
|
112
112
|
/** Stale-run sweeper: "runs that started > N minutes ago and are still running". */
|
|
113
|
-
|
|
113
|
+
idxIntegrationRunsStatusStartedAt: index("idx_integration_runs_status_started_at").on(
|
|
114
114
|
t.status,
|
|
115
115
|
t.startedAt
|
|
116
116
|
)
|
|
117
117
|
})
|
|
118
118
|
);
|
|
119
|
-
var
|
|
120
|
-
"
|
|
119
|
+
var integrationRunItems = pgTable(
|
|
120
|
+
"integration_run_items",
|
|
121
121
|
{
|
|
122
122
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
123
|
-
|
|
123
|
+
integrationRunId: uuid("integration_run_id").notNull().references(() => integrationRuns.id, { onDelete: "cascade" }),
|
|
124
124
|
entityType: text("entity_type").notNull(),
|
|
125
125
|
externalId: text("external_id").notNull(),
|
|
126
126
|
localId: text("local_id"),
|
|
127
|
-
operation:
|
|
128
|
-
status:
|
|
127
|
+
operation: integrationRunItemOperationEnum("operation").notNull(),
|
|
128
|
+
status: integrationRunItemStatusEnum("status").notNull(),
|
|
129
129
|
/**
|
|
130
130
|
* Structured per-field diff — ADR-0003 shape enforced by
|
|
131
131
|
* `FieldDiffSchema.parse` at the recorder service layer.
|
|
@@ -139,29 +139,29 @@ var syncRunItems = pgTable(
|
|
|
139
139
|
title: text("title"),
|
|
140
140
|
error: text("error"),
|
|
141
141
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
142
|
-
/** Runtime-enforced when `
|
|
142
|
+
/** Runtime-enforced when `INTEGRATION_MULTI_TENANT` is true; see SYNC-6. */
|
|
143
143
|
tenantId: text("tenant_id")
|
|
144
144
|
},
|
|
145
145
|
(t) => ({
|
|
146
146
|
/** Ordered timeline within a run. */
|
|
147
|
-
|
|
148
|
-
t.
|
|
147
|
+
idxIntegrationRunItemsRunCreatedAt: index("idx_integration_run_items_run_created_at").on(
|
|
148
|
+
t.integrationRunId,
|
|
149
149
|
t.createdAt
|
|
150
150
|
),
|
|
151
|
-
/** Per-record history: "every
|
|
152
|
-
|
|
153
|
-
"
|
|
151
|
+
/** Per-record history: "every integration that touched opportunity/$extId". */
|
|
152
|
+
idxIntegrationRunItemsEntityExternal: index(
|
|
153
|
+
"idx_integration_run_items_entity_external"
|
|
154
154
|
).on(t.entityType, t.externalId)
|
|
155
155
|
})
|
|
156
156
|
);
|
|
157
157
|
export {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
integrationRunActionEnum,
|
|
159
|
+
integrationRunDirectionEnum,
|
|
160
|
+
integrationRunItemOperationEnum,
|
|
161
|
+
integrationRunItemStatusEnum,
|
|
162
|
+
integrationRunItems,
|
|
163
|
+
integrationRunStatusEnum,
|
|
164
|
+
integrationRuns,
|
|
165
|
+
integrationSubscriptions
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=
|
|
167
|
+
//# sourceMappingURL=integration-audit.schema.js.map
|