@reventlessdev/reventless-aws 3.0.0-alpha.308 → 3.0.0-alpha.310
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 +23 -0
- package/package.json +11 -11
- package/src/Platform.res +1 -1
- package/src/Platform.res.mjs +3 -3
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +1 -1
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs +2 -2
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res +1 -1
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res.mjs +6 -5
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +1 -1
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res.mjs +3 -3
- package/src/adapter/Mcp/MCP_Lambda.res +2 -2
- package/src/adapter/Mcp/MCP_Lambda.res.mjs +4 -4
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +1 -1
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res.mjs +3 -3
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +1 -1
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res.mjs +3 -3
- package/src/adapter/Postgres/PgConnection.res.mjs +7 -7
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +2 -2
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res.mjs +4 -4
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res +1 -1
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res.mjs +6 -5
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +3 -1
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +1 -1
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res.mjs +3 -3
- package/src/adapter/Runtime/HeartbeatEntryPoint.res +1 -1
- package/src/adapter/Runtime/HeartbeatEntryPoint.res.mjs +2 -2
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +11 -1
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +1 -1
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +1 -1
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res.mjs +3 -3
- package/src/util/Util_DeadLetterQueue.res +10 -5
- package/src/util/Util_DeadLetterQueue.res.mjs +4 -1
- package/src/util/Util_DynamoDb.res +7 -2
- package/src/util/Util_DynamoDb.res.mjs +2 -2
- package/src/util/Util_LambdaLogging.res +28 -0
- package/src/util/Util_LambdaLogging.res.mjs +15 -0
- package/tests/AppSync_AdapterTest.res.mjs +13 -13
- package/tests/AutomationSliceEntryPoint_OpsTest.res.mjs +5 -5
- package/tests/EpInboundTestSlice.res.mjs +6 -6
- package/tests/PgChangeFeedRelay_IntegrationTest.res +1 -1
- package/tests/PgChangeFeedRelay_IntegrationTest.res.mjs +2 -2
- package/tests/PgChangeFeedRelay_RuntimeTest.res +2 -2
- package/tests/PgChangeFeedRelay_RuntimeTest.res.mjs +3 -3
- package/tests/PgPipeline_IntegrationTest.res +1 -1
- package/tests/PgPipeline_IntegrationTest.res.mjs +8 -7
- package/tests/StateViewSliceEntryPoint_OpsTest.res.mjs +3 -3
- package/tests/Util_DynamoDbTest.res +44 -0
- package/tests/Util_DynamoDbTest.res.mjs +54 -0
- package/tests/Util_LambdaLoggingTest.res +27 -0
- package/tests/Util_LambdaLoggingTest.res.mjs +9 -0
- package/tests/integration/AggTestAggregate.res.mjs +6 -6
- package/tests/integration/EpCompositeSlice.res.mjs +17 -17
- package/tests/integration/EpTestSlice.res.mjs +6 -6
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +1 -1
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res.mjs +4 -4
- package/tests/integration/SvsTestSlice.res.mjs +9 -9
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
|
|
5
|
-
let commandSchema =
|
|
5
|
+
let commandSchema = Sury.$schema(s => ({
|
|
6
6
|
TAG: "Add",
|
|
7
|
-
name: s.m(
|
|
7
|
+
name: s.m(Sury.string)
|
|
8
8
|
}));
|
|
9
9
|
|
|
10
|
-
let eventSchema =
|
|
10
|
+
let eventSchema = Sury.$schema(s => ({
|
|
11
11
|
TAG: "Added",
|
|
12
|
-
name: s.m(
|
|
12
|
+
name: s.m(Sury.string)
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
let errorSchema =
|
|
15
|
+
let errorSchema = Sury.literal("AlreadyExists");
|
|
16
16
|
|
|
17
17
|
function commandAuthorization(param) {
|
|
18
18
|
return "AllowAnonymous";
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
5
5
|
|
|
6
|
-
let consumedEventSchema =
|
|
7
|
-
|
|
6
|
+
let consumedEventSchema = Sury.union([
|
|
7
|
+
Sury.$schema(s => ({
|
|
8
8
|
TAG: "ResourceAdded",
|
|
9
|
-
environment: s.m(
|
|
10
|
-
resourceName: s.m(
|
|
9
|
+
environment: s.m(Sury.string),
|
|
10
|
+
resourceName: s.m(Sury.string)
|
|
11
11
|
})),
|
|
12
|
-
|
|
12
|
+
Sury.$schema(s => ({
|
|
13
13
|
TAG: "ResourceTouched",
|
|
14
|
-
environment: s.m(
|
|
15
|
-
resourceName: s.m(
|
|
14
|
+
environment: s.m(Sury.string),
|
|
15
|
+
resourceName: s.m(Sury.string)
|
|
16
16
|
}))
|
|
17
17
|
]);
|
|
18
18
|
|
|
19
|
-
let commandSchema =
|
|
20
|
-
|
|
19
|
+
let commandSchema = Sury.union([
|
|
20
|
+
Sury.$schema(s => ({
|
|
21
21
|
TAG: "AddResource",
|
|
22
22
|
environment: s.m(DcbTag$Reventless.compositePartitionMember(0, "/")),
|
|
23
23
|
resourceName: s.m(DcbTag$Reventless.compositePartitionMember(1, "/"))
|
|
24
24
|
})),
|
|
25
|
-
|
|
25
|
+
Sury.$schema(s => ({
|
|
26
26
|
TAG: "TouchResource",
|
|
27
27
|
environment: s.m(DcbTag$Reventless.compositePartitionMember(0, "/")),
|
|
28
28
|
resourceName: s.m(DcbTag$Reventless.compositePartitionMember(1, "/"))
|
|
29
29
|
}))
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
|
-
let errorSchema =
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let errorSchema = Sury.union([
|
|
33
|
+
Sury.literal("AlreadyAdded"),
|
|
34
|
+
Sury.literal("NotFound")
|
|
35
35
|
]);
|
|
36
36
|
|
|
37
|
-
let eventSchema =
|
|
38
|
-
|
|
37
|
+
let eventSchema = Sury.union([
|
|
38
|
+
Sury.$schema(s => ({
|
|
39
39
|
TAG: "ResourceAdded",
|
|
40
40
|
environment: s.m(DcbTag$Reventless.compositePartitionMember(0, "/")),
|
|
41
41
|
resourceName: s.m(DcbTag$Reventless.compositePartitionMember(1, "/"))
|
|
42
42
|
})),
|
|
43
|
-
|
|
43
|
+
Sury.$schema(s => ({
|
|
44
44
|
TAG: "ResourceTouched",
|
|
45
45
|
environment: s.m(DcbTag$Reventless.compositePartitionMember(0, "/")),
|
|
46
46
|
resourceName: s.m(DcbTag$Reventless.compositePartitionMember(1, "/"))
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
5
5
|
|
|
6
|
-
let consumedEventSchema =
|
|
6
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
7
7
|
TAG: "WidgetAdded",
|
|
8
|
-
widgetId: s.m(
|
|
8
|
+
widgetId: s.m(Sury.string)
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
|
-
let commandSchema =
|
|
11
|
+
let commandSchema = Sury.$schema(s => ({
|
|
12
12
|
TAG: "AddWidget",
|
|
13
13
|
widgetId: s.m(DcbTag$Reventless.partition)
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
|
-
let errorSchema =
|
|
16
|
+
let errorSchema = Sury.literal("AlreadyAdded");
|
|
17
17
|
|
|
18
|
-
let eventSchema =
|
|
18
|
+
let eventSchema = Sury.$schema(s => ({
|
|
19
19
|
TAG: "WidgetAdded",
|
|
20
20
|
widgetId: s.m(DcbTag$Reventless.partition)
|
|
21
21
|
}));
|
|
@@ -106,7 +106,7 @@ let runOneEvent: (string, JSON.t) => promise<unit> = %raw(`
|
|
|
106
106
|
// calls `parseJsonOrThrow(eventJson, consumedEventSchema)`, so we produce the
|
|
107
107
|
// JSON via the same schema to guarantee a faithful round-trip.
|
|
108
108
|
let encodeEvent = (event): JSON.t =>
|
|
109
|
-
event->
|
|
109
|
+
event->Reventless.Util_Sury.toJson(SvsTestSlice.consumedEventSchema)
|
|
110
110
|
|
|
111
111
|
describe("StateViewSliceEntryPoint integration", () => {
|
|
112
112
|
testAsync(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as S from "sury/src/S.res.mjs";
|
|
4
3
|
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
5
4
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
6
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
7
6
|
import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
|
|
7
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
8
8
|
import * as ClientDynamodb from "@aws-sdk/client-dynamodb";
|
|
9
9
|
import * as SvsTestSlice$ReventlessAws from "./SvsTestSlice.res.mjs";
|
|
10
10
|
import * as DcbIntegrationHarness$ReventlessAws from "./DcbIntegrationHarness.res.mjs";
|
|
@@ -111,19 +111,19 @@ let runOneEvent = (async (tableName, eventJson) => {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
function encodeEvent(event) {
|
|
114
|
-
return
|
|
114
|
+
return Util_Sury$Reventless.toJson(event, SvsTestSlice$ReventlessAws.consumedEventSchema);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
globalThis.describe("StateViewSliceEntryPoint integration", () => {
|
|
118
118
|
globalThis.test("UpdateMultiState on an @subId view slice persists a row per product (was silent no-op)", async () => {
|
|
119
119
|
let table = await createViewTable("SvsIt_" + Date.now().toString());
|
|
120
|
-
await runOneEvent(table.name,
|
|
120
|
+
await runOneEvent(table.name, Util_Sury$Reventless.toJson({
|
|
121
121
|
TAG: "ItemAddedToCart",
|
|
122
122
|
cartId: "cart-1",
|
|
123
123
|
productId: "prod-a",
|
|
124
124
|
qty: 2
|
|
125
125
|
}, SvsTestSlice$ReventlessAws.consumedEventSchema));
|
|
126
|
-
await runOneEvent(table.name,
|
|
126
|
+
await runOneEvent(table.name, Util_Sury$Reventless.toJson({
|
|
127
127
|
TAG: "ItemAddedToCart",
|
|
128
128
|
cartId: "cart-1",
|
|
129
129
|
productId: "prod-b",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
|
|
5
|
-
let consumedEventSchema =
|
|
5
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
6
6
|
TAG: "ItemAddedToCart",
|
|
7
|
-
cartId: s.m(
|
|
8
|
-
productId: s.m(
|
|
9
|
-
qty: s.m(
|
|
7
|
+
cartId: s.m(Sury.string),
|
|
8
|
+
productId: s.m(Sury.string),
|
|
9
|
+
qty: s.m(Sury.int)
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
let stateSchema =
|
|
13
|
-
cartId: s.m(
|
|
14
|
-
productId: s.m(
|
|
15
|
-
qty: s.m(
|
|
12
|
+
let stateSchema = Sury.$schema(s => ({
|
|
13
|
+
cartId: s.m(Sury.string),
|
|
14
|
+
productId: s.m(Sury.string),
|
|
15
|
+
qty: s.m(Sury.int)
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
18
|
let subIdConfig = {
|