@pattern-stack/codegen 0.7.5 → 0.7.6
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/dist/runtime/base-classes/index.d.ts +2 -0
- package/dist/runtime/base-classes/index.js +345 -18
- package/dist/runtime/base-classes/index.js.map +1 -1
- package/dist/runtime/base-classes/junction-sync-repository.d.ts +87 -0
- package/dist/runtime/base-classes/junction-sync-repository.js +362 -0
- package/dist/runtime/base-classes/junction-sync-repository.js.map +1 -0
- package/dist/runtime/base-classes/sync-upsert-config.d.ts +58 -0
- package/dist/runtime/base-classes/sync-upsert-config.js +1 -0
- package/dist/runtime/base-classes/sync-upsert-config.js.map +1 -0
- package/dist/runtime/base-classes/synced-entity-repository.d.ts +68 -6
- package/dist/runtime/base-classes/synced-entity-repository.js +173 -7
- package/dist/runtime/base-classes/synced-entity-repository.js.map +1 -1
- package/dist/runtime/subsystems/sync/execute-sync.use-case.js +19 -1
- package/dist/runtime/subsystems/sync/execute-sync.use-case.js.map +1 -1
- package/dist/runtime/subsystems/sync/index.js +19 -1
- package/dist/runtime/subsystems/sync/index.js.map +1 -1
- package/dist/runtime/subsystems/sync/sync-sink.protocol.d.ts +6 -0
- package/dist/src/cli/index.js +24 -2
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.js +21 -2
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/runtime/base-classes/index.ts +9 -0
- package/runtime/base-classes/junction-sync-repository.ts +284 -0
- package/runtime/base-classes/sync-upsert-config.ts +58 -0
- package/runtime/base-classes/synced-entity-repository.ts +263 -9
- package/runtime/subsystems/sync/execute-sync.use-case.ts +25 -1
- package/runtime/subsystems/sync/sync-sink.protocol.ts +7 -0
- package/src/patterns/library/synced.pattern.ts +2 -1
- package/templates/_shared/generated-banner.mjs +74 -0
- package/templates/broadcast/new/backend-interface.ejs.t +1 -0
- package/templates/broadcast/new/bridge-listener.ejs.t +1 -0
- package/templates/broadcast/new/channel.ejs.t +1 -0
- package/templates/broadcast/new/index.ejs.t +1 -0
- package/templates/broadcast/new/memory-backend.ejs.t +1 -0
- package/templates/broadcast/new/module.ejs.t +1 -0
- package/templates/broadcast/new/prompt.js +13 -0
- package/templates/broadcast/new/websocket-backend.ejs.t +1 -0
- package/templates/entity/new/backend/application/commands/create.ejs.t +1 -0
- package/templates/entity/new/backend/application/commands/delete.ejs.t +1 -0
- package/templates/entity/new/backend/application/commands/grouped-index.ejs.t +1 -0
- package/templates/entity/new/backend/application/commands/index.ejs.t +1 -0
- package/templates/entity/new/backend/application/commands/update.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/declarative-queries.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/get-by-id.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/grouped-index.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/index.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/list.ejs.t +1 -0
- package/templates/entity/new/backend/application/queries/relationships.queries.ejs.t +1 -0
- package/templates/entity/new/backend/application/schemas/dto.ejs.t +1 -0
- package/templates/entity/new/backend/database/repository.ejs.t +1 -0
- package/templates/entity/new/backend/database/schema.ejs.t +1 -0
- package/templates/entity/new/backend/domain/entity.ejs.t +1 -0
- package/templates/entity/new/backend/domain/grouped-index.ejs.t +1 -0
- package/templates/entity/new/backend/domain/index.ejs.t +1 -0
- package/templates/entity/new/backend/domain/repository-interface.ejs.t +1 -0
- package/templates/entity/new/backend/modules/core/module.ejs.t +1 -0
- package/templates/entity/new/backend/modules/core/sync-source.ejs.t +1 -0
- package/templates/entity/new/backend/modules/core/sync-source.providers.ejs.t +1 -0
- package/templates/entity/new/backend/modules/trpc/module.ejs.t +1 -0
- package/templates/entity/new/backend/presentation/controller.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/controller.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/dto/create.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/dto/output.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/dto/update.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/entity.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/index.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/module.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/prompt-extension.js +148 -0
- package/templates/entity/new/clean-lite-ps/repository.ejs.t +92 -1
- package/templates/entity/new/clean-lite-ps/search-controller.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/service.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/create.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/declarative-queries.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/delete.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/find-by-id-with-fields.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/find-by-id.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/list-with-fields.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/list.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/search.ejs.t +1 -0
- package/templates/entity/new/clean-lite-ps/use-cases/update.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/collection.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/combined.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/fields.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/hooks.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/index.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/mutation-hooks.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/mutations.ejs.t +1 -0
- package/templates/entity/new/frontend/entity/types.ejs.t +1 -0
- package/templates/entity/new/frontend/store/hooks.ejs.t +1 -0
- package/templates/entity/new/frontend/unified-entity.ejs.t +1 -0
- package/templates/entity/new/prompt.js +19 -0
- package/templates/junction/new/entity.ejs.t +1 -0
- package/templates/junction/new/index.ejs.t +1 -0
- package/templates/junction/new/module.ejs.t +1 -0
- package/templates/junction/new/prompt.js +83 -0
- package/templates/junction/new/repository.ejs.t +44 -3
- package/templates/junction/new/service.ejs.t +1 -0
- package/templates/relationship/new/controller.ejs.t +1 -0
- package/templates/relationship/new/dto/create.ejs.t +1 -0
- package/templates/relationship/new/dto/output.ejs.t +1 -0
- package/templates/relationship/new/dto/update.ejs.t +1 -0
- package/templates/relationship/new/entity.ejs.t +1 -0
- package/templates/relationship/new/index.ejs.t +1 -0
- package/templates/relationship/new/module.ejs.t +1 -0
- package/templates/relationship/new/prompt.js +14 -0
- package/templates/relationship/new/repository.ejs.t +1 -0
- package/templates/relationship/new/service.ejs.t +1 -0
- package/templates/relationship/new/use-cases/declarative-queries.ejs.t +1 -0
- package/templates/relationship/new/use-cases/find-by-id.ejs.t +1 -0
- package/templates/relationship/new/use-cases/list.ejs.t +1 -0
- package/templates/subsystem/auth/auth-oauth-state.schema.ejs.t +1 -0
- package/templates/subsystem/auth/prompt.js +8 -0
- package/templates/subsystem/events/domain-events.schema.ejs.t +1 -0
- package/templates/subsystem/events/prompt.js +8 -0
- package/templates/subsystem/jobs/job-orchestration.schema.ejs.t +1 -0
- package/templates/subsystem/jobs/prompt.js +8 -0
- package/templates/subsystem/sync/prompt.js +8 -0
- package/templates/subsystem/sync/sync-audit.schema.ejs.t +1 -0
|
@@ -45,6 +45,12 @@ interface ISyncSink<TCanonical> {
|
|
|
45
45
|
softDeleteByExternalId(userId: string, externalId: string): Promise<{
|
|
46
46
|
id: string;
|
|
47
47
|
} | null>;
|
|
48
|
+
/**
|
|
49
|
+
* When true, the orchestrator does NOT short-circuit on a `noop` diff — it
|
|
50
|
+
* still calls upsertByExternalId so the sink can reproject side data (e.g.
|
|
51
|
+
* EAV field_values) the differ doesn't see. Default false.
|
|
52
|
+
*/
|
|
53
|
+
readonly reprojectsOnNoop?: boolean;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
export type { ISyncSink };
|
package/dist/src/cli/index.js
CHANGED
|
@@ -1709,11 +1709,29 @@ var ExecuteSyncUseCase = class {
|
|
|
1709
1709
|
change.providerChangedFields
|
|
1710
1710
|
);
|
|
1711
1711
|
if (diff === "noop") {
|
|
1712
|
+
if (!this.sink.reprojectsOnNoop) {
|
|
1713
|
+
await this.recorder.recordItem({
|
|
1714
|
+
syncRunId: runId,
|
|
1715
|
+
entityType: input.subscription.domain,
|
|
1716
|
+
externalId: change.externalId,
|
|
1717
|
+
localId: null,
|
|
1718
|
+
operation: "noop",
|
|
1719
|
+
status: "success",
|
|
1720
|
+
changedFields: {},
|
|
1721
|
+
tenantId: input.tenantId
|
|
1722
|
+
});
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
const { id: noopLocalId } = await this.sink.upsertByExternalId(
|
|
1726
|
+
input.userId,
|
|
1727
|
+
change.record,
|
|
1728
|
+
input.provider
|
|
1729
|
+
);
|
|
1712
1730
|
await this.recorder.recordItem({
|
|
1713
1731
|
syncRunId: runId,
|
|
1714
1732
|
entityType: input.subscription.domain,
|
|
1715
1733
|
externalId: change.externalId,
|
|
1716
|
-
localId:
|
|
1734
|
+
localId: noopLocalId,
|
|
1717
1735
|
operation: "noop",
|
|
1718
1736
|
status: "success",
|
|
1719
1737
|
changedFields: {},
|
|
@@ -5459,7 +5477,8 @@ var SyncedPattern = definePattern({
|
|
|
5459
5477
|
serviceImport: "@shared/base-classes/synced-entity-service",
|
|
5460
5478
|
repositoryInheritedMethods: [
|
|
5461
5479
|
"findById, findByIds, list, count, exists, create, update, delete, upsertMany",
|
|
5462
|
-
"findByExternalId, findAllByUserId, findVisibleByUserId,
|
|
5480
|
+
"findByExternalId, findManyByExternalIds, findAllByUserId, findVisibleByUserId",
|
|
5481
|
+
"syncUpsertOne, findByExternalIdProjected, softDeleteByExternalId, syncUpsert"
|
|
5463
5482
|
],
|
|
5464
5483
|
serviceInheritedMethods: [
|
|
5465
5484
|
"findById, findByIds, list, count, exists, create, update, delete",
|
|
@@ -10086,6 +10105,9 @@ var VENDORED_RUNTIME_FILES = [
|
|
|
10086
10105
|
{ runtime: "base-classes/base-service.ts", target: "src/shared/base-classes/base-service.ts" },
|
|
10087
10106
|
{ runtime: "base-classes/synced-entity-repository.ts", target: "src/shared/base-classes/synced-entity-repository.ts" },
|
|
10088
10107
|
{ runtime: "base-classes/synced-entity-service.ts", target: "src/shared/base-classes/synced-entity-service.ts" },
|
|
10108
|
+
// Inbound-sync write surface (#374) — deps of synced/junction repos
|
|
10109
|
+
{ runtime: "base-classes/sync-upsert-config.ts", target: "src/shared/base-classes/sync-upsert-config.ts" },
|
|
10110
|
+
{ runtime: "base-classes/junction-sync-repository.ts", target: "src/shared/base-classes/junction-sync-repository.ts" },
|
|
10089
10111
|
{ runtime: "base-classes/activity-entity-repository.ts", target: "src/shared/base-classes/activity-entity-repository.ts" },
|
|
10090
10112
|
{ runtime: "base-classes/activity-entity-service.ts", target: "src/shared/base-classes/activity-entity-service.ts" },
|
|
10091
10113
|
{ runtime: "base-classes/metadata-entity-repository.ts", target: "src/shared/base-classes/metadata-entity-repository.ts" },
|