@reventlessdev/reventless-aws 3.0.0-alpha.167 → 3.0.0-alpha.169
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/CHANGELOG.md +16 -0
- package/package.json +7 -7
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +8 -3
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res.mjs +9 -3
- package/src/components/ReadModel_Builder_NoResolver.res +1 -0
- package/src/components/ReadModel_Builder_NoResolver.res.mjs +1 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res +1 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res.mjs +1 -0
- package/src/components/ReadModel_Builder_PerReadModel.res +1 -0
- package/src/components/ReadModel_Builder_PerReadModel.res.mjs +1 -0
- package/src/components/ReadModel_Builder_Single.res +1 -0
- package/src/components/ReadModel_Builder_Single.res.mjs +1 -0
- package/src/components/ReadModel_Builder_Single_Stream.res +1 -0
- package/src/components/ReadModel_Builder_Single_Stream.res.mjs +1 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +2 -1
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res.mjs +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.169 (2026-07-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-aws
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 3.0.0-alpha.168 (2026-06-29)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-aws
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 3.0.0-alpha.167 (2026-06-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @reventlessdev/reventless-aws
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-aws",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.169",
|
|
4
4
|
"description": "AWS adapters for Reventless",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"sury": "11.0.0-alpha.4",
|
|
10
10
|
"uuid": "^13.0.0",
|
|
11
11
|
"@reventlessdev/rescript-aws-sdk": "2.2.0-alpha.20",
|
|
12
|
-
"@reventlessdev/rescript-
|
|
12
|
+
"@reventlessdev/rescript-effect": "0.1.0-alpha.24",
|
|
13
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.5",
|
|
13
14
|
"@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.44",
|
|
14
|
-
"@reventlessdev/rescript-effect": "0.1.0-alpha.23",
|
|
15
15
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.14",
|
|
16
16
|
"@reventlessdev/rescript-uuid": "1.1.0-alpha.13",
|
|
17
|
-
"@reventlessdev/reventless-
|
|
18
|
-
"@reventlessdev/reventless-
|
|
19
|
-
"@reventlessdev/reventless-
|
|
20
|
-
"@reventlessdev/reventless-
|
|
17
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.83",
|
|
18
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.136",
|
|
19
|
+
"@reventlessdev/reventless-interop": "3.0.0-alpha.22",
|
|
20
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.63"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"rescript": "^12.3.0",
|
|
@@ -40,7 +40,9 @@ let appendWithCondition = (tableName, jsons) => {
|
|
|
40
40
|
if count > 100 {
|
|
41
41
|
Effect.succeed(
|
|
42
42
|
Error(
|
|
43
|
-
|
|
43
|
+
ReventlessCore.EventLog.StorageFailure(
|
|
44
|
+
`EventLog.append: max 100 events per command, got ${count->Int.toString}`,
|
|
45
|
+
),
|
|
44
46
|
),
|
|
45
47
|
)
|
|
46
48
|
} else if count == 1 {
|
|
@@ -58,10 +60,13 @@ let append = table =>
|
|
|
58
60
|
appendWithCondition(table.name, jsons)
|
|
59
61
|
->Effect.catchAll(err =>
|
|
60
62
|
switch err {
|
|
61
|
-
| DynamoDb_Error.StaleState(_) =>
|
|
63
|
+
| DynamoDb_Error.StaleState(_) =>
|
|
64
|
+
Effect.succeed(Error(ReventlessCore.EventLog.Conflict))
|
|
62
65
|
| _ =>
|
|
63
66
|
let msg = DynamoDb_Error.message(err)
|
|
64
|
-
Effect.succeed(
|
|
67
|
+
Effect.succeed(
|
|
68
|
+
Error(ReventlessCore.EventLog.StorageFailure(`DynamoDB conditional append failed: ${msg}`)),
|
|
69
|
+
)
|
|
65
70
|
}
|
|
66
71
|
)
|
|
67
72
|
->Effect.runPromise
|
|
@@ -51,7 +51,10 @@ function appendWithCondition(tableName, jsons) {
|
|
|
51
51
|
if (count > 100) {
|
|
52
52
|
return Effect$1.succeed({
|
|
53
53
|
TAG: "Error",
|
|
54
|
-
_0:
|
|
54
|
+
_0: {
|
|
55
|
+
TAG: "StorageFailure",
|
|
56
|
+
_0: `EventLog.append: max 100 events per command, got ` + count.toString()
|
|
57
|
+
}
|
|
55
58
|
});
|
|
56
59
|
} else if (count === 1) {
|
|
57
60
|
return Effect$1.map(Effect.tryPromise(DynamoDb_Error$ReventlessAws.classify, () => putItemConditional(tableName, jsons[0])), param => ({
|
|
@@ -69,7 +72,7 @@ function append(table) {
|
|
|
69
72
|
case "StaleState" :
|
|
70
73
|
return Effect$1.succeed({
|
|
71
74
|
TAG: "Error",
|
|
72
|
-
_0: "
|
|
75
|
+
_0: "Conflict"
|
|
73
76
|
});
|
|
74
77
|
case "Transient" :
|
|
75
78
|
case "Permanent" :
|
|
@@ -78,7 +81,10 @@ function append(table) {
|
|
|
78
81
|
let msg = DynamoDb_Error$ReventlessAws.message(err);
|
|
79
82
|
return Effect$1.succeed({
|
|
80
83
|
TAG: "Error",
|
|
81
|
-
_0:
|
|
84
|
+
_0: {
|
|
85
|
+
TAG: "StorageFailure",
|
|
86
|
+
_0: `DynamoDB conditional append failed: ` + msg
|
|
87
|
+
}
|
|
82
88
|
});
|
|
83
89
|
}));
|
|
84
90
|
}
|
|
@@ -17,9 +17,10 @@ describe("Runtime.append", () => {
|
|
|
17
17
|
let jsons = Array.fromInitializer(~length=101, mkJson)
|
|
18
18
|
let result = await Runtime.append(table)(0, "test-id", jsons)
|
|
19
19
|
switch result {
|
|
20
|
-
| Error(msg) =>
|
|
20
|
+
| Error(ReventlessCore.EventLog.StorageFailure(msg)) =>
|
|
21
21
|
expect(msg->String.includes("max 100 events per command"))->toBe(true)
|
|
22
22
|
expect(msg->String.includes("101"))->toBe(true)
|
|
23
|
+
| Error(Conflict) => expect("expected StorageFailure, got Conflict")->toBe("")
|
|
23
24
|
| Ok(_) => expect("expected Error, got Ok")->toBe("")
|
|
24
25
|
}
|
|
25
26
|
})
|
|
@@ -27,8 +27,13 @@ globalThis.describe("Runtime.append", () => {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
let msg = result._0;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (typeof msg !== "object") {
|
|
31
|
+
globalThis.expect("expected StorageFailure, got Conflict").toBe("");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let msg$1 = msg._0;
|
|
35
|
+
globalThis.expect(msg$1.includes("max 100 events per command")).toBe(true);
|
|
36
|
+
globalThis.expect(msg$1.includes("101")).toBe(true);
|
|
32
37
|
});
|
|
33
38
|
});
|
|
34
39
|
|