@ddd-ts-kit/typeorm 0.8.0 → 0.10.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/README.md +20 -0
- package/dist/event-sourcing/create-type-orm-event-sourcing.d.ts +10 -0
- package/dist/event-sourcing/create-type-orm-event-sourcing.d.ts.map +1 -0
- package/dist/event-sourcing/create-type-orm-event-sourcing.js +24 -0
- package/dist/event-sourcing/create-type-orm-event-sourcing.js.map +1 -0
- package/dist/event-sourcing/event-store-entities.d.ts +10 -0
- package/dist/event-sourcing/event-store-entities.d.ts.map +1 -0
- package/dist/event-sourcing/event-store-entities.js +78 -0
- package/dist/event-sourcing/event-store-entities.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -488,6 +488,26 @@ column through the same query builder.
|
|
|
488
488
|
`(consumer, event_id)`. Run the consumer inside the unit of work: the mark then commits with
|
|
489
489
|
the effects of the handler, and disappears with them if it fails.
|
|
490
490
|
|
|
491
|
+
## Event store
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
const dataSource = new DataSource({ type: 'postgres', entities: [...eventStoreEntities({ schema: 'scheduling' })] });
|
|
495
|
+
|
|
496
|
+
const { events, snapshots, checkpoints, subjectKeys } = createTypeOrmEventSourcing(unitOfWork, { schema: 'scheduling' });
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
`eventStoreEntities` declares the tables as `EntitySchema`s, so `typeorm migration:generate`
|
|
500
|
+
creates them with the columns of `eventStoreTablesSql` of the kernel. The stores never load them
|
|
501
|
+
as entities. `createTypeOrmEventSourcing` refuses a data source that is not PostgreSQL.
|
|
502
|
+
|
|
503
|
+
Each statement runs on the executor of the context: an append joins the transaction of the
|
|
504
|
+
unit of work, so the stream and the outbox records its events publish commit together
|
|
505
|
+
(`eventStoreUnitOfWorkContract`). Appends take the head of the store, a row locked until their
|
|
506
|
+
transaction ends: positions are given in commit order, without gaps, and two appends never run
|
|
507
|
+
side by side, whatever their streams. PostgreSQL only. The stores are the ones of the kernel
|
|
508
|
+
(`PostgresEventStore` and its companions), held to `eventStoreContract` here; how an
|
|
509
|
+
event-sourced aggregate uses them: the README of `@ddd-ts-kit/kernel`, section "Event sourcing".
|
|
510
|
+
|
|
491
511
|
## Dialect coverage
|
|
492
512
|
|
|
493
513
|
What follows is about this package. The CLI generates for PostgreSQL only: `init --orm typeorm`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EventSourcingStores, type EventStoreTablesOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { TypeOrmContext } from '../unit-of-work/type-orm-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* The event store, the snapshots, the checkpoints and the keys of the data subjects on
|
|
5
|
+
* PostgreSQL, through the entity manager of the context, over the tables of
|
|
6
|
+
* `eventStoreEntities`. Every statement runs on that manager, so an append joins the
|
|
7
|
+
* transaction of the unit of work, with the outbox. Bind each one to its port.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTypeOrmEventSourcing(context: TypeOrmContext, options?: EventStoreTablesOptions): EventSourcingStores;
|
|
10
|
+
//# sourceMappingURL=create-type-orm-event-sourcing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-type-orm-event-sourcing.d.ts","sourceRoot":"","sources":["../../src/event-sourcing/create-type-orm-event-sourcing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,mBAAmB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,uBAA4B,GACpC,mBAAmB,CAYrB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { postgresEventSourcing } from '@ddd-ts-kit/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* The event store, the snapshots, the checkpoints and the keys of the data subjects on
|
|
4
|
+
* PostgreSQL, through the entity manager of the context, over the tables of
|
|
5
|
+
* `eventStoreEntities`. Every statement runs on that manager, so an append joins the
|
|
6
|
+
* transaction of the unit of work, with the outbox. Bind each one to its port.
|
|
7
|
+
*/
|
|
8
|
+
export function createTypeOrmEventSourcing(context, options = {}) {
|
|
9
|
+
return postgresEventSourcing(async (statement, parameters) => {
|
|
10
|
+
const manager = context.manager();
|
|
11
|
+
if (manager.dataSource.options.type !== 'postgres') {
|
|
12
|
+
throw new TypeError(`The event store of @ddd-ts-kit/typeorm runs on PostgreSQL, not on ${manager.dataSource.options.type}`);
|
|
13
|
+
}
|
|
14
|
+
return recordsOf(await manager.query(statement, [...parameters]));
|
|
15
|
+
}, options);
|
|
16
|
+
}
|
|
17
|
+
/** TypeORM answers an UPDATE or a DELETE on PostgreSQL as `[rows, count]`, anything else as the rows. */
|
|
18
|
+
function recordsOf(answered) {
|
|
19
|
+
const counted = Array.isArray(answered) && answered.length === 2 && typeof answered[1] === 'number';
|
|
20
|
+
const rows = counted ? answered[0] : answered;
|
|
21
|
+
const list = Array.isArray(rows) ? rows : [];
|
|
22
|
+
return list.filter((row) => typeof row === 'object' && row !== null);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=create-type-orm-event-sourcing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-type-orm-event-sourcing.js","sourceRoot":"","sources":["../../src/event-sourcing/create-type-orm-event-sourcing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA0D,MAAM,oBAAoB,CAAC;AAGnH;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAuB,EACvB,OAAO,GAA4B,EAAE;IAErC,OAAO,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE;QAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAElC,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACnD,MAAM,IAAI,SAAS,CACjB,qEAAqE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,CACvG,CAAC;QACJ,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC;AAED,yGAAyG;AACzG,SAAS,SAAS,CAAC,QAAiB;IAClC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;IACpG,MAAM,IAAI,GAAY,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvD,MAAM,IAAI,GAAuB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAA4C,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntitySchema } from 'typeorm';
|
|
2
|
+
import { type EventStoreTablesOptions } from '@ddd-ts-kit/kernel';
|
|
3
|
+
/**
|
|
4
|
+
* The tables of the event store as `EntitySchema`s, PostgreSQL only: add them to the `entities`
|
|
5
|
+
* of the data source and `typeorm migration:generate` creates them in a migration of the
|
|
6
|
+
* consuming project, with the columns of `eventStoreTablesSql` of the kernel. The stores never
|
|
7
|
+
* use them as entities: they run their own statements on these tables.
|
|
8
|
+
*/
|
|
9
|
+
export declare function eventStoreEntities(options?: EventStoreTablesOptions): EntitySchema[];
|
|
10
|
+
//# sourceMappingURL=event-store-entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-store-entities.d.ts","sourceRoot":"","sources":["../../src/event-sourcing/event-store-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,SAAS,CAAC;AACvE,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAatF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,uBAA4B,GAAG,YAAY,EAAE,CAExF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { EntitySchema } from 'typeorm';
|
|
2
|
+
import { EVENT_STORE_TABLES } from '@ddd-ts-kit/kernel';
|
|
3
|
+
import { INSTANT } from '../columns/instant.js';
|
|
4
|
+
import { RIGHT_NOW } from '../columns/right-now.js';
|
|
5
|
+
/**
|
|
6
|
+
* The tables of the event store as `EntitySchema`s, PostgreSQL only: add them to the `entities`
|
|
7
|
+
* of the data source and `typeorm migration:generate` creates them in a migration of the
|
|
8
|
+
* consuming project, with the columns of `eventStoreTablesSql` of the kernel. The stores never
|
|
9
|
+
* use them as entities: they run their own statements on these tables.
|
|
10
|
+
*/
|
|
11
|
+
export function eventStoreEntities(options = {}) {
|
|
12
|
+
return [HEAD, EVENTS, SNAPSHOTS, CHECKPOINTS, SUBJECT_KEYS].map((table) => entityOf(table, options));
|
|
13
|
+
}
|
|
14
|
+
function entityOf({ name, table, columns, uniques = [] }, { schema }) {
|
|
15
|
+
return new EntitySchema({
|
|
16
|
+
name: schema === undefined ? name : `${name}_${schema}`,
|
|
17
|
+
tableName: EVENT_STORE_TABLES[table],
|
|
18
|
+
...(schema === undefined ? {} : { schema }),
|
|
19
|
+
columns,
|
|
20
|
+
uniques: uniques.map((columnsOf) => ({ columns: columnsOf })),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const HEAD = {
|
|
24
|
+
name: 'StoredEventsHead',
|
|
25
|
+
table: 'head',
|
|
26
|
+
columns: { id: { type: 'smallint', primary: true }, position: { type: 'bigint' } },
|
|
27
|
+
};
|
|
28
|
+
const EVENTS = {
|
|
29
|
+
name: 'StoredEvent',
|
|
30
|
+
table: 'events',
|
|
31
|
+
columns: {
|
|
32
|
+
position: { type: 'bigint', primary: true },
|
|
33
|
+
stream: { type: 'text' },
|
|
34
|
+
version: { type: 'int' },
|
|
35
|
+
eventId: { name: 'event_id', type: 'text', unique: true },
|
|
36
|
+
type: { type: 'text' },
|
|
37
|
+
schemaVersion: { name: 'schema_version', type: 'int' },
|
|
38
|
+
data: { type: 'jsonb' },
|
|
39
|
+
metadata: { type: 'jsonb' },
|
|
40
|
+
occurredAt: instant('occurred_at'),
|
|
41
|
+
recordedAt: instant('recorded_at', true),
|
|
42
|
+
},
|
|
43
|
+
uniques: [['stream', 'version']],
|
|
44
|
+
};
|
|
45
|
+
const SNAPSHOTS = {
|
|
46
|
+
name: 'StreamSnapshot',
|
|
47
|
+
table: 'snapshots',
|
|
48
|
+
columns: {
|
|
49
|
+
stream: { type: 'text', primary: true },
|
|
50
|
+
version: { type: 'int' },
|
|
51
|
+
schemaVersion: { name: 'schema_version', type: 'int' },
|
|
52
|
+
data: { type: 'jsonb' },
|
|
53
|
+
takenAt: instant('taken_at', true),
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
const CHECKPOINTS = {
|
|
57
|
+
name: 'SubscriptionCheckpoint',
|
|
58
|
+
table: 'checkpoints',
|
|
59
|
+
columns: {
|
|
60
|
+
subscriber: { type: 'text', primary: true },
|
|
61
|
+
position: { type: 'bigint' },
|
|
62
|
+
updatedAt: instant('updated_at', true),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const SUBJECT_KEYS = {
|
|
66
|
+
name: 'SubjectKey',
|
|
67
|
+
table: 'subjectKeys',
|
|
68
|
+
columns: {
|
|
69
|
+
subject: { type: 'text', primary: true },
|
|
70
|
+
keyId: { name: 'key_id', type: 'text', unique: true },
|
|
71
|
+
material: { type: 'text' },
|
|
72
|
+
createdAt: instant('created_at', true),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
function instant(name, defaulted = false) {
|
|
76
|
+
return { ...INSTANT.postgres, name, ...(defaulted ? { default: RIGHT_NOW.postgres } : {}) };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=event-store-entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-store-entities.js","sourceRoot":"","sources":["../../src/event-sourcing/event-store-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAgC,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAWpD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAO,GAA4B,EAAE;IACtE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACvG,CAAC;AAED,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,EAAS,EAAE,EAAE,MAAM,EAA2B;IAClG,OAAO,IAAI,YAAY,CAAC;QACtB,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,EAAE;QACvD,SAAS,EAAE,kBAAkB,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,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC9F,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { CONCURRENCY_CONFLICT, ConcurrencyError, optimisticUpdate, schemaNameOf, type VersionStep, } from '@ddd-ts-kit/kernel';
|
|
2
2
|
export * from './unit-of-work/type-orm-context.js';
|
|
3
3
|
export * from './unit-of-work/create-type-orm-unit-of-work.js';
|
|
4
|
+
export * from './event-sourcing/create-type-orm-event-sourcing.js';
|
|
5
|
+
export * from './event-sourcing/event-store-entities.js';
|
|
4
6
|
export * from './outbox/entity-options.js';
|
|
5
7
|
export * from './outbox/outbox-row.js';
|
|
6
8
|
export * from './outbox/processed-event-row.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { CONCURRENCY_CONFLICT, ConcurrencyError, optimisticUpdate, schemaNameOf, } from '@ddd-ts-kit/kernel';
|
|
2
2
|
export * from './unit-of-work/type-orm-context.js';
|
|
3
3
|
export * from './unit-of-work/create-type-orm-unit-of-work.js';
|
|
4
|
+
export * from './event-sourcing/create-type-orm-event-sourcing.js';
|
|
5
|
+
export * from './event-sourcing/event-store-entities.js';
|
|
4
6
|
export * from './outbox/entity-options.js';
|
|
5
7
|
export * from './outbox/outbox-row.js';
|
|
6
8
|
export * from './outbox/processed-event-row.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAC5B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAC5B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/typeorm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeORM adapters for the kernel ports: unit of work, transactional outbox store, processed-event store.",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "TypeORM adapters for the kernel ports: unit of work, transactional outbox store, processed-event store, PostgreSQL event store.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ddd-ts-kit/kernel": "0.
|
|
30
|
-
"@ddd-ts-kit/events": "0.
|
|
29
|
+
"@ddd-ts-kit/kernel": "0.10.0",
|
|
30
|
+
"@ddd-ts-kit/events": "0.10.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"typeorm": "^1.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typeorm": "^1.1.2",
|
|
37
|
-
"@ddd-ts-kit/testing": "0.
|
|
37
|
+
"@ddd-ts-kit/testing": "0.10.0",
|
|
38
38
|
"pg": "^8.23.1",
|
|
39
39
|
"@types/pg": "^8.23.1",
|
|
40
40
|
"@electric-sql/pglite": "0.5.9",
|