mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added TypeScript mappings for cqrs-domain. * Added tests. * Removed package.json to prevent build errors on DefinitelyTyped CI server. * Fixed build errors. * Fixed lots of lint findings. * remove declare module
33 lines
593 B
TypeScript
33 lines
593 B
TypeScript
import createDomain = require("cqrs-domain");
|
|
|
|
const domain = createDomain({
|
|
domainPath: "/domain",
|
|
eventStore: {
|
|
type: "mongodb",
|
|
dbName: "db1"
|
|
}
|
|
});
|
|
|
|
domain.defineCommand({
|
|
id: "id",
|
|
name: "command",
|
|
aggregateId: "aggregate.id",
|
|
aggregate: "aggregate.name",
|
|
payload: "payload",
|
|
revision: "revision"
|
|
});
|
|
|
|
domain.defineEvent({
|
|
correlationId: "commandId",
|
|
id: "id",
|
|
name: "event",
|
|
context: "context.name",
|
|
aggregateId: "aggregate.id",
|
|
aggregate: 'aggregate.name',
|
|
payload: "payload",
|
|
revision: "revision",
|
|
version: "version",
|
|
meta: "meta",
|
|
commitStamp: "occurredAt"
|
|
});
|