@zodmire/core 0.1.1 → 0.1.2
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/mod.d.mts +37 -5
- package/mod.mjs +1579 -248
- package/package.json +2 -2
package/mod.d.mts
CHANGED
|
@@ -201,6 +201,10 @@ type ApplicationErrorDef = {
|
|
|
201
201
|
factoryName: string;
|
|
202
202
|
aggregateName: string;
|
|
203
203
|
};
|
|
204
|
+
type NormalizedGenerationCapability = {
|
|
205
|
+
status: "generated" | "runtime-throw" | "disabled";
|
|
206
|
+
reasons: string[];
|
|
207
|
+
};
|
|
204
208
|
type NormalizedAggregate = {
|
|
205
209
|
name: string;
|
|
206
210
|
fields: IntrospectedField[];
|
|
@@ -224,6 +228,7 @@ type NormalizedCommand = {
|
|
|
224
228
|
preconditions: string[];
|
|
225
229
|
emits: string[];
|
|
226
230
|
effects: CommandEffect[];
|
|
231
|
+
capability: NormalizedGenerationCapability;
|
|
227
232
|
};
|
|
228
233
|
type NormalizedComputedField = {
|
|
229
234
|
kind: "builtin";
|
|
@@ -264,6 +269,7 @@ type NormalizedFindByIdQuery = {
|
|
|
264
269
|
outputSchemaExportName: string;
|
|
265
270
|
readModelName?: string;
|
|
266
271
|
readSide: NormalizedQueryReadSide;
|
|
272
|
+
capability: NormalizedGenerationCapability;
|
|
267
273
|
};
|
|
268
274
|
type NormalizedListQuery = {
|
|
269
275
|
queryKind: "list";
|
|
@@ -287,6 +293,7 @@ type NormalizedListQuery = {
|
|
|
287
293
|
};
|
|
288
294
|
};
|
|
289
295
|
computedFields: Record<string, NormalizedComputedField>;
|
|
296
|
+
capability: NormalizedGenerationCapability;
|
|
290
297
|
};
|
|
291
298
|
type NormalizedQuery = NormalizedFindByIdQuery | NormalizedListQuery;
|
|
292
299
|
type NormalizedReadModel = {
|
|
@@ -320,6 +327,11 @@ type NormalizedProjection = {
|
|
|
320
327
|
};
|
|
321
328
|
subscription?: SchemaReadResult["projections"][number]["subscription"];
|
|
322
329
|
sources: NormalizedProjectionSource[];
|
|
330
|
+
capabilities: {
|
|
331
|
+
projector: NormalizedGenerationCapability;
|
|
332
|
+
writeModel: NormalizedGenerationCapability;
|
|
333
|
+
rebuild: NormalizedGenerationCapability;
|
|
334
|
+
};
|
|
323
335
|
};
|
|
324
336
|
type NormalizedDomainEvent = {
|
|
325
337
|
name: string;
|
|
@@ -446,6 +458,14 @@ type NormalizedWriteAcl = {
|
|
|
446
458
|
symbols: NormalizedAclSymbols;
|
|
447
459
|
};
|
|
448
460
|
type NormalizedCompositionAcl = NormalizedReadAcl | NormalizedWriteAcl;
|
|
461
|
+
type InfrastructureArchitecture = "logical-cqrs" | "physical-cqrs";
|
|
462
|
+
type InfrastructurePersistence = "postgres" | "mysql";
|
|
463
|
+
type InfrastructureOrm = "drizzle" | "mikroorm";
|
|
464
|
+
type NormalizedInfrastructureStrategy = {
|
|
465
|
+
architecture: InfrastructureArchitecture;
|
|
466
|
+
persistence: InfrastructurePersistence;
|
|
467
|
+
orm: InfrastructureOrm;
|
|
468
|
+
};
|
|
449
469
|
type NormalizedCompositionSpec = {
|
|
450
470
|
name: string;
|
|
451
471
|
contexts: Array<{
|
|
@@ -454,6 +474,7 @@ type NormalizedCompositionSpec = {
|
|
|
454
474
|
}>;
|
|
455
475
|
crossContextEvents: ResolvedCrossContextEvent[];
|
|
456
476
|
acls: NormalizedCompositionAcl[];
|
|
477
|
+
infrastructure: NormalizedInfrastructureStrategy;
|
|
457
478
|
materialization: {
|
|
458
479
|
targetRoot: string;
|
|
459
480
|
};
|
|
@@ -473,7 +494,10 @@ declare function collectOwnedValueObjects(aggregate: NormalizedAggregate, contex
|
|
|
473
494
|
declare function sliceContextIntoAggregateViews(contextSpec: ContextNormalizedSpec): AggregateNormalizedSpecView[];
|
|
474
495
|
//#endregion
|
|
475
496
|
//#region packages/core/orchestrator.d.ts
|
|
476
|
-
|
|
497
|
+
type ContextArtifactGenerationOptions = {
|
|
498
|
+
infrastructureStrategy?: NormalizedInfrastructureStrategy;
|
|
499
|
+
};
|
|
500
|
+
declare function generateContextArtifacts(contextSpec: ContextNormalizedSpec, options?: ContextArtifactGenerationOptions): GeneratedArtifact[];
|
|
477
501
|
//#endregion
|
|
478
502
|
//#region packages/core/spec_artifact.d.ts
|
|
479
503
|
declare const SPEC_ARTIFACT_SCHEMA_VERSION = 1;
|
|
@@ -721,6 +745,7 @@ declare function buildContextNormalizedSpecFromConfig(input: {
|
|
|
721
745
|
declare function buildV5ContextArtifacts(input: {
|
|
722
746
|
contextConfigPath: string;
|
|
723
747
|
codegenSupportPath: string;
|
|
748
|
+
infrastructureStrategy?: NormalizedInfrastructureStrategy;
|
|
724
749
|
}): Promise<GeneratedArtifact[]>;
|
|
725
750
|
declare function buildV5Artifacts(input: {
|
|
726
751
|
contextConfigPath: string;
|
|
@@ -729,7 +754,7 @@ declare function buildV5Artifacts(input: {
|
|
|
729
754
|
declare function buildCompositionArtifacts(compositionConfigPath: string, contextSpecs: ContextNormalizedSpec[]): Promise<GeneratedArtifact[]>;
|
|
730
755
|
//#endregion
|
|
731
756
|
//#region packages/core/generators/lib.d.ts
|
|
732
|
-
declare function buildV5LibArtifacts(): GeneratedArtifact[];
|
|
757
|
+
declare function buildV5LibArtifacts(infrastructureStrategy?: NormalizedInfrastructureStrategy): GeneratedArtifact[];
|
|
733
758
|
//#endregion
|
|
734
759
|
//#region packages/core/generators/shared_kernel.d.ts
|
|
735
760
|
declare function buildV5SharedKernelArtifacts(spec?: NormalizedSpec | ContextNormalizedSpec): GeneratedArtifact[];
|
|
@@ -748,12 +773,16 @@ declare function buildV5ApplicationArtifacts(spec: NormalizedSpec, options?: App
|
|
|
748
773
|
declare function buildV5ApplicationContextArtifacts(contextSpec: ContextNormalizedSpec): GeneratedArtifact[];
|
|
749
774
|
//#endregion
|
|
750
775
|
//#region packages/core/generators/infrastructure.d.ts
|
|
776
|
+
type InfrastructureContextGenerationOptions = {
|
|
777
|
+
infrastructureStrategy?: NormalizedInfrastructureStrategy;
|
|
778
|
+
};
|
|
751
779
|
type InfrastructureArtifactOptions = {
|
|
752
780
|
/** Skip context-wide artifacts (tables.ts) when generating per-aggregate. */skipContextWideArtifacts?: boolean;
|
|
781
|
+
infrastructureStrategy?: NormalizedInfrastructureStrategy;
|
|
753
782
|
};
|
|
754
783
|
declare function buildV5InfrastructureArtifacts(spec: NormalizedSpec, options?: InfrastructureArtifactOptions): GeneratedArtifact[];
|
|
755
784
|
declare function buildReadModelCompositionArtifacts(contextSpecs: ContextNormalizedSpec[]): GeneratedArtifact[];
|
|
756
|
-
declare function buildV5InfrastructureContextArtifacts(contextSpec: ContextNormalizedSpec): GeneratedArtifact[];
|
|
785
|
+
declare function buildV5InfrastructureContextArtifacts(contextSpec: ContextNormalizedSpec, options?: InfrastructureContextGenerationOptions): GeneratedArtifact[];
|
|
757
786
|
//#endregion
|
|
758
787
|
//#region packages/core/generators/projections.d.ts
|
|
759
788
|
declare function buildProjectionArtifacts(contextSpec: ContextNormalizedSpec): GeneratedArtifact[];
|
|
@@ -792,7 +821,7 @@ declare function buildCompositionRouterArtifacts(_compositionSpec: NormalizedCom
|
|
|
792
821
|
declare function buildCompositionSubscriptionArtifacts(compositionSpec: NormalizedCompositionSpec): GeneratedArtifact[];
|
|
793
822
|
//#endregion
|
|
794
823
|
//#region packages/core/generators/composition_outbox.d.ts
|
|
795
|
-
declare function buildCompositionOutboxArtifacts(): GeneratedArtifact[];
|
|
824
|
+
declare function buildCompositionOutboxArtifacts(infrastructureStrategy?: NormalizedInfrastructureStrategy): GeneratedArtifact[];
|
|
796
825
|
//#endregion
|
|
797
826
|
//#region packages/core/generators/composition_bus.d.ts
|
|
798
827
|
declare function buildCompositionBusArtifacts(): GeneratedArtifact[];
|
|
@@ -809,4 +838,7 @@ type CollisionSafeModulePathNames = {
|
|
|
809
838
|
declare function buildCollisionSafeModulePathNames(modulePaths: string[]): Map<string, CollisionSafeModulePathNames>;
|
|
810
839
|
declare function buildCompositionAclArtifacts(compositionSpec: NormalizedCompositionSpec): GeneratedArtifact[];
|
|
811
840
|
//#endregion
|
|
812
|
-
|
|
841
|
+
//#region packages/core/generators/composition_dependencies.d.ts
|
|
842
|
+
declare function buildCompositionDependencyManifestArtifacts(compositionSpec: NormalizedCompositionSpec): GeneratedArtifact[];
|
|
843
|
+
//#endregion
|
|
844
|
+
export { AggregateNormalizedSpecView, ApplicationArtifactOptions, ApplicationErrorDef, ArtifactOwnership, CollisionSafeModulePathNames, ContextArtifactGenerationOptions, ContextConfigLike, ContextNormalizedSpec, DiffBucket, DomainErrorDef, EntityVisitor, GENERATED_READ_SIDE_SCHEMA_LOGICAL_PATH, GeneratedArtifact, InfrastructureArchitecture, InfrastructureArtifactOptions, InfrastructureContextGenerationOptions, InfrastructureOrm, InfrastructurePersistence, IntrospectedField, MigrationPlan, MigrationResult, NormalizedAggregate, NormalizedAggregateWithChildren, NormalizedCommand, NormalizedCompositionAcl, NormalizedCompositionSpec, NormalizedComputedField, NormalizedDomainEvent, NormalizedEntity, NormalizedEntityWithChildren, NormalizedFindByIdQuery, NormalizedGenerationCapability, NormalizedInfrastructureStrategy, NormalizedListQuery, NormalizedProjection, NormalizedProjectionSource, NormalizedQuery, NormalizedQueryReadSide, NormalizedReadAcl, NormalizedReadModel, NormalizedSpec, NormalizedValueObject, NormalizedWriteAcl, OwnershipScope, PreparedVendoredFile, ResolvedContextInputs, ResolvedCrossContextEvent, ResolvedSubscription, RunMigrationOptions, SPEC_ARTIFACT_SCHEMA_VERSION, SPEC_DIFF_SCHEMA_VERSION, SchemaReadResult, SpecDiffArtifact, VENDORED_FILE_MANIFEST, VendoredFileEntry, applyOwnershipIfMissing, buildArtifactPath, buildCollisionSafeModulePathNames, buildCompositionAclArtifacts, buildCompositionArtifacts, buildCompositionBusArtifacts, buildCompositionContainerArtifacts, buildCompositionDependencyManifestArtifacts, buildCompositionOutboxArtifacts, buildCompositionRouterArtifacts, buildCompositionSpecDiff, buildCompositionSubscriptionArtifacts, buildCompositionTypeArtifacts, buildConsumerAclArtifacts, buildContextInputChecks, buildContextNormalizedSpec, buildContextNormalizedSpecFromConfig, buildContextSpecDiff, buildDrizzleConfig, buildFileArtifactTags, buildMaterializationManifestTags, buildMigrationResultTags, buildNormalizedCompositionSpec, buildNormalizedSpec, buildNormalizedSpecFromConfig, buildNormalizedSpecTags, buildProjectionArtifacts, buildReadModelCompositionArtifacts, buildSpecDiffTags, buildSummaryTags, buildV5ApplicationArtifacts, buildV5ApplicationContextArtifacts, buildV5Artifacts, buildV5ContextArtifacts, buildV5DomainArtifacts, buildV5InfrastructureArtifacts, buildV5InfrastructureContextArtifacts, buildV5LibArtifacts, buildV5PortArtifacts, buildV5PresentationArtifacts, buildV5RouteArtifacts, buildV5SharedKernelArtifacts, buildV5TestArtifacts, buildVendoredFileTags, camelCase, collectOwnedValueObjects, compositionSpecDiffDataName, contextArtifactOwnership, contextSpecDiffDataName, contractFileName, createGeneratedArtifact, discoverReferencedVos, ensureContextSupportFilesExist, filterPerContextArtifactsForComposition, flattenEntities, generateContextArtifacts, inferArtifactOwnership, inferCodegenSupportPathForContext, inferCodegenSupportPathFromSchemaFile, inferReconcileScopes, introspectObjectShape, introspectSchema, isRegisteredEntity, kebabCase, loadContextConfig, mergeGeneratedArtifacts, mergeSchemaReadResults, normalizeModulePath, parseConnectionString, parseDrizzleKitOutput, pascalCase, prepareAllVendoredFiles, prepareVendoredFile, readSchemaFile, repositoryPortFileName, repositoryPortTypeName, resolveAbsoluteContextInputs, resolveArtifactOwnership, resolveContextInputs, resolveFactoryPath, resolveGeneratedMigrationSchemaPath, resolveMethodContextInputsForCheck, resolveSchemaFilePathsForContext, resolveVoOwner, rewriteImports, runMigration, serializeCompositionSpec, serializeContextSpec, sharedArtifactOwnership, sliceArtifactOwnership, sliceContextIntoAggregateViews, snakeCase, snakeUpperCase, toImportURL, toUpperSnakeCase, unwrapFieldType, validateContextImports, walkEntityTree, withArtifactOwnership, wordsFromName };
|