event-store-adapter-js 2.2.158 → 2.2.160-snapshot.1
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.ja.md +1 -1
- package/README.md +1 -1
- package/biome.json +3 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/default-serializer.js +2 -2
- package/package.json +4 -3
- package/src/index.ts +1 -1
- package/src/internal/default-serializer.ts +2 -2
- package/src/internal/event-store-for-dynamodb.test.ts +2 -2
- package/src/internal/event-store-for-dynamodb.ts +1 -1
- package/src/internal/test/user-account-event.ts +2 -2
- package/src/internal/test/user-account-id.ts +1 -1
- package/src/internal/test/user-account-repository.test.ts +2 -2
- package/src/internal/test/user-account.ts +2 -2
- package/src/types.ts +7 -7
package/README.ja.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# event-store-adapter-js
|
|
2
2
|
|
|
3
|
-
[](https://github.com/j5ik2o/event-store-adapter-js/actions/workflows/ci.yml)
|
|
3
|
+
[](https://github.com/j5ik2o/event-store-adapter-js/actions/workflows/ci.yml)
|
|
4
4
|
[](https://badge.fury.io/js/event-store-adapter-js)
|
|
5
5
|
[](https://renovatebot.com)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# event-store-adapter-js
|
|
2
2
|
|
|
3
|
-
[](https://github.com/j5ik2o/event-store-adapter-js/actions/workflows/ci.yml)
|
|
3
|
+
[](https://github.com/j5ik2o/event-store-adapter-js/actions/workflows/ci.yml)
|
|
4
4
|
[](https://badge.fury.io/js/event-store-adapter-js)
|
|
5
5
|
[](https://renovatebot.com)
|
|
6
6
|
[](https://opensource.org/licenses/apache-2-0)
|
package/biome.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/
|
|
3
|
-
"organizeImports":
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
|
|
3
|
+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
|
|
6
4
|
"files": {
|
|
7
|
-
"
|
|
5
|
+
"includes": ["**/*.ts"]
|
|
8
6
|
},
|
|
9
7
|
"vcs": {
|
|
10
8
|
"enabled": true,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
17
|
__exportStar(require("./event-store"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -6,7 +6,7 @@ class JsonEventSerializer {
|
|
|
6
6
|
this.encoder = new TextEncoder();
|
|
7
7
|
this.decoder = new TextDecoder();
|
|
8
8
|
}
|
|
9
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
9
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
10
10
|
deserialize(bytes, converter) {
|
|
11
11
|
const jsonString = this.decoder.decode(bytes);
|
|
12
12
|
const json = JSON.parse(jsonString);
|
|
@@ -26,7 +26,7 @@ class JsonSnapshotSerializer {
|
|
|
26
26
|
this.encoder = new TextEncoder();
|
|
27
27
|
this.decoder = new TextDecoder();
|
|
28
28
|
}
|
|
29
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
30
30
|
deserialize(bytes, converter) {
|
|
31
31
|
const jsonString = this.decoder.decode(bytes);
|
|
32
32
|
const obj = JSON.parse(jsonString);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "event-store-adapter-js",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.160-snapshot.1",
|
|
4
4
|
"description": "This library is designed to turn DynamoDB into an Event Store for Event Sourcing.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"build": "tsc && rm -f dist/internal/*.test.d.ts && rm -f dist/internal/*.test.js && rm -fr dist/internal/test",
|
|
9
9
|
"test": "jest --no-cache",
|
|
10
10
|
"lint": "biome check",
|
|
11
|
-
"
|
|
11
|
+
"fmt": "biome format",
|
|
12
|
+
"fix": "biome check --write",
|
|
12
13
|
"clean": "rimraf ./dist"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"author": "Junichi Kato <j5ik2o@gmail.com>",
|
|
28
29
|
"license": "MIT",
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@biomejs/biome": "2.
|
|
31
|
+
"@biomejs/biome": "2.3.2",
|
|
31
32
|
"@types/jest": "^30.0.0",
|
|
32
33
|
"@types/node": "^22.0.0",
|
|
33
34
|
"@types/winston": "^2.4.4",
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ class JsonEventSerializer<AID extends AggregateId, E extends Event<AID>>
|
|
|
12
12
|
private encoder = new TextEncoder();
|
|
13
13
|
private decoder = new TextDecoder();
|
|
14
14
|
|
|
15
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
15
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
16
16
|
deserialize(bytes: Uint8Array, converter: (json: any) => E): E {
|
|
17
17
|
const jsonString = this.decoder.decode(bytes);
|
|
18
18
|
const json = JSON.parse(jsonString);
|
|
@@ -35,7 +35,7 @@ class JsonSnapshotSerializer<
|
|
|
35
35
|
{
|
|
36
36
|
private encoder = new TextEncoder();
|
|
37
37
|
private decoder = new TextDecoder();
|
|
38
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
38
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
39
39
|
deserialize(bytes: Uint8Array, converter: (json: any) => A): A {
|
|
40
40
|
const jsonString = this.decoder.decode(bytes);
|
|
41
41
|
const obj = JSON.parse(jsonString);
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
createJournalTable,
|
|
14
14
|
createSnapshotTable,
|
|
15
15
|
} from "./test/dynamodb-utils";
|
|
16
|
-
import {
|
|
16
|
+
import { convertJSONToUserAccount, UserAccount } from "./test/user-account";
|
|
17
17
|
import {
|
|
18
|
-
type UserAccountEvent,
|
|
19
18
|
convertJSONtoUserAccountEvent,
|
|
19
|
+
type UserAccountEvent,
|
|
20
20
|
} from "./test/user-account-event";
|
|
21
21
|
import { UserAccountId } from "./test/user-account-id";
|
|
22
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Event } from "../../types";
|
|
2
2
|
import {
|
|
3
|
-
type UserAccountId,
|
|
4
3
|
convertJSONToUserAccountId,
|
|
4
|
+
type UserAccountId,
|
|
5
5
|
} from "./user-account-id";
|
|
6
6
|
|
|
7
7
|
interface UserAccountEvent extends Event<UserAccountId> {}
|
|
@@ -31,7 +31,7 @@ class UserAccountRenamed implements UserAccountEvent {
|
|
|
31
31
|
) {}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
34
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
35
35
|
function convertJSONtoUserAccountEvent(json: any): UserAccountEvent {
|
|
36
36
|
const aggregateId = convertJSONToUserAccountId(json.data.aggregateId);
|
|
37
37
|
switch (json.type) {
|
|
@@ -9,7 +9,7 @@ class UserAccountId implements AggregateId {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
12
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
13
13
|
function convertJSONToUserAccountId(json: any): UserAccountId {
|
|
14
14
|
return new UserAccountId(json.value);
|
|
15
15
|
}
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
createJournalTable,
|
|
14
14
|
createSnapshotTable,
|
|
15
15
|
} from "./dynamodb-utils";
|
|
16
|
-
import {
|
|
16
|
+
import { convertJSONToUserAccount, UserAccount } from "./user-account";
|
|
17
17
|
import {
|
|
18
|
-
type UserAccountEvent,
|
|
19
18
|
convertJSONtoUserAccountEvent,
|
|
19
|
+
type UserAccountEvent,
|
|
20
20
|
} from "./user-account-event";
|
|
21
21
|
import { UserAccountId } from "./user-account-id";
|
|
22
22
|
import { UserAccountRepository } from "./user-account-repository";
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
UserAccountRenamed,
|
|
7
7
|
} from "./user-account-event";
|
|
8
8
|
import {
|
|
9
|
-
type UserAccountId,
|
|
10
9
|
convertJSONToUserAccountId,
|
|
10
|
+
type UserAccountId,
|
|
11
11
|
} from "./user-account-id";
|
|
12
12
|
|
|
13
13
|
class UserAccount implements Aggregate<UserAccount, UserAccountId> {
|
|
@@ -95,7 +95,7 @@ class UserAccount implements Aggregate<UserAccount, UserAccountId> {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
98
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
99
99
|
function convertJSONToUserAccount(json: any): UserAccount {
|
|
100
100
|
const id = convertJSONToUserAccountId(json.data.id);
|
|
101
101
|
return new UserAccount(
|
package/src/types.ts
CHANGED
|
@@ -33,7 +33,7 @@ interface KeyResolver<AID extends AggregateId> {
|
|
|
33
33
|
|
|
34
34
|
interface EventSerializer<AID extends AggregateId, E extends Event<AID>> {
|
|
35
35
|
serialize(event: E): Uint8Array;
|
|
36
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
36
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
37
37
|
deserialize(bytes: Uint8Array, converter: (json: any) => E): E;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -42,20 +42,20 @@ interface SnapshotSerializer<
|
|
|
42
42
|
A extends Aggregate<A, AID>,
|
|
43
43
|
> {
|
|
44
44
|
serialize(aggregate: A): Uint8Array;
|
|
45
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
45
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON deserialization requires dynamic typing
|
|
46
46
|
deserialize(bytes: Uint8Array, converter: (json: any) => A): A;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export interface Logger {
|
|
50
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
50
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger accepts any content type
|
|
51
51
|
trace?: (...content: any[]) => void;
|
|
52
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
52
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger accepts any content type
|
|
53
53
|
debug: (...content: any[]) => void;
|
|
54
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
54
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger accepts any content type
|
|
55
55
|
info: (...content: any[]) => void;
|
|
56
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
56
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger accepts any content type
|
|
57
57
|
warn: (...content: any[]) => void;
|
|
58
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
58
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger accepts any content type
|
|
59
59
|
error: (...content: any[]) => void;
|
|
60
60
|
}
|
|
61
61
|
|