@reventlessdev/reventless-aws 3.0.0-alpha.309 → 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
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.310 (2026-08-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **aws:** normalize the null a table without a sort key resolves to ([8fb15ac](https://github.com/ReventlessDev/reventless-core/commit/8fb15ac066679b6799f4287c2c8d332e2367f599))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 3.0.0-alpha.309 (2026-08-18)
|
|
7
14
|
|
|
8
15
|
* feat(core)!: tell the Monitoring seam where a unit's logs live ([6cbd595](https://github.com/ReventlessDev/reventless-core/commit/6cbd595e2474fce3f87b7720a332e82583899bae))
|
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.310",
|
|
4
4
|
"description": "AWS adapters for Reventless",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"sury": "11.0.0-rc.1",
|
|
14
14
|
"uuid": "^13.0.0",
|
|
15
15
|
"@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.12",
|
|
16
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
16
17
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
17
18
|
"@reventlessdev/rescript-node": "2.0.0-alpha.8",
|
|
18
|
-
"@reventlessdev/rescript-
|
|
19
|
-
"@reventlessdev/rescript-pulumi-aws": "3.0.0-alpha.0",
|
|
19
|
+
"@reventlessdev/rescript-pulumi-aws": "3.0.0-alpha.1",
|
|
20
20
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
|
|
21
21
|
"@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
|
|
22
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.240",
|
|
22
23
|
"@reventlessdev/reventless-infra": "3.0.0-alpha.146",
|
|
24
|
+
"@reventlessdev/reventless-postgres": "3.0.0-alpha.104",
|
|
23
25
|
"@reventlessdev/reventless-interop": "3.0.0-alpha.32",
|
|
24
|
-
"@reventlessdev/reventless-
|
|
25
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.118",
|
|
26
|
-
"@reventlessdev/reventless-postgres": "3.0.0-alpha.104"
|
|
26
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.118"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"rescript": "12.3.0",
|
|
@@ -7,7 +7,12 @@ let log = ReventlessCore.Logger.fromEnv()
|
|
|
7
7
|
let toResourceInfo: table => Pulumi.Output.t<ReventlessInfra.Adapter.resourceInfo> = ({hashKey, rangeKey}) =>
|
|
8
8
|
(hashKey, rangeKey)
|
|
9
9
|
->Pulumi.Output.all2
|
|
10
|
-
->Pulumi.Output.apply(((hashKey, rangeKey)) => ReventlessInfra.Adapter.StorageKeys({
|
|
10
|
+
->Pulumi.Output.apply(((hashKey, rangeKey)) => ReventlessInfra.Adapter.StorageKeys({
|
|
11
|
+
partitionKey: hashKey,
|
|
12
|
+
// Normalize here: a null reaching the plugin-structure export fails sury's
|
|
13
|
+
// encode-side validation, which expects `option`'s undefined.
|
|
14
|
+
sortKey: rangeKey->Nullable.toOption,
|
|
15
|
+
}))
|
|
11
16
|
|
|
12
17
|
let toResolvedTableOutput = ({name, id, arn, hashKey, rangeKey}) =>
|
|
13
18
|
(name, id, arn, hashKey, rangeKey)
|
|
@@ -17,7 +22,7 @@ let toResolvedTableOutput = ({name, id, arn, hashKey, rangeKey}) =>
|
|
|
17
22
|
name,
|
|
18
23
|
arn,
|
|
19
24
|
hashKey,
|
|
20
|
-
rangeKey: ?(rangeKey->Option.map(
|
|
25
|
+
rangeKey: ?(rangeKey->Nullable.toOption->Option.map(Nullable.make)),
|
|
21
26
|
})
|
|
22
27
|
|
|
23
28
|
let toResource = (~tags=?, {id, name, arn} as table) =>
|
|
@@ -24,7 +24,7 @@ function toResourceInfo(param) {
|
|
|
24
24
|
]).apply(param => ({
|
|
25
25
|
TAG: "StorageKeys",
|
|
26
26
|
partitionKey: param[0],
|
|
27
|
-
sortKey: param[1]
|
|
27
|
+
sortKey: Primitive_option.fromNullable(param[1])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ function toResolvedTableOutput(param) {
|
|
|
40
40
|
name: param[0],
|
|
41
41
|
arn: param[2],
|
|
42
42
|
hashKey: param[3],
|
|
43
|
-
rangeKey: Stdlib_Option.map(param[4],
|
|
43
|
+
rangeKey: Stdlib_Option.map(Primitive_option.fromNullable(param[4]), prim => prim)
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
open JestGlobals
|
|
2
|
+
|
|
3
|
+
// Guards the null a table without a sort key resolves to.
|
|
4
|
+
//
|
|
5
|
+
// Pulumi resolves an absent `rangeKey` to `null`, and ReScript's `option` reads
|
|
6
|
+
// None as undefined — so the null travelled into `resourceInfo` unconverted and
|
|
7
|
+
// the plugin-structure export threw `Expected string | undefined, received null`
|
|
8
|
+
// out of sury's encode-side validation, failing the deploy after it had already
|
|
9
|
+
// applied part of the stack.
|
|
10
|
+
|
|
11
|
+
let resolve = (output: Pulumi.Output.t<'a>): promise<'a> =>
|
|
12
|
+
Promise.make((resolve, _) => {
|
|
13
|
+
let _ = output->Pulumi.Output.apply(value => resolve(value))
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
let table = (~rangeKey): PulumiAws.DynamoDb.Table.t => {
|
|
17
|
+
arn: "arn:aws:dynamodb:eu-west-1:123456789012:table/UiFragments-abc123"->Pulumi.Output.make,
|
|
18
|
+
name: "UiFragments-abc123"->Pulumi.Output.make,
|
|
19
|
+
id: "UiFragments-abc123"->Pulumi.Output.make,
|
|
20
|
+
hashKey: "id"->Pulumi.Output.make,
|
|
21
|
+
rangeKey: rangeKey->Pulumi.Output.make,
|
|
22
|
+
streamEnabled: None->Pulumi.Output.make,
|
|
23
|
+
streamArn: ""->Pulumi.Output.make,
|
|
24
|
+
streamLabel: ""->Pulumi.Output.make,
|
|
25
|
+
ttl: {PulumiAws.DynamoDb.Table.attributeName: ""}->Pulumi.Output.make,
|
|
26
|
+
pointInTimeRecovery: {PulumiAws.DynamoDb.Table.enabled: true}->Pulumi.Output.make,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe("Util_DynamoDb.toResourceInfo", () => {
|
|
30
|
+
test("reads a table without a sort key as None", async () => {
|
|
31
|
+
let resourceInfo = await table(~rangeKey=Nullable.null)->Util_DynamoDb.toResourceInfo->resolve
|
|
32
|
+
expect(resourceInfo)->toEqual(
|
|
33
|
+
ReventlessInfra.Adapter.StorageKeys({partitionKey: "id", sortKey: None}),
|
|
34
|
+
)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test("carries a sort key when the table has one", async () => {
|
|
38
|
+
let resourceInfo =
|
|
39
|
+
await table(~rangeKey=Nullable.make("seq"))->Util_DynamoDb.toResourceInfo->resolve
|
|
40
|
+
expect(resourceInfo)->toEqual(
|
|
41
|
+
ReventlessInfra.Adapter.StorageKeys({partitionKey: "id", sortKey: Some("seq")}),
|
|
42
|
+
)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
4
|
+
import * as Util_DynamoDb$ReventlessAws from "../src/util/Util_DynamoDb.res.mjs";
|
|
5
|
+
|
|
6
|
+
function resolve(output) {
|
|
7
|
+
return new Promise((resolve, param) => {
|
|
8
|
+
output.apply(value => resolve(value));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function table(rangeKey) {
|
|
13
|
+
return {
|
|
14
|
+
arn: Pulumi.output("arn:aws:dynamodb:eu-west-1:123456789012:table/UiFragments-abc123"),
|
|
15
|
+
name: Pulumi.output("UiFragments-abc123"),
|
|
16
|
+
id: Pulumi.output("UiFragments-abc123"),
|
|
17
|
+
hashKey: Pulumi.output("id"),
|
|
18
|
+
rangeKey: Pulumi.output(rangeKey),
|
|
19
|
+
streamEnabled: Pulumi.output(undefined),
|
|
20
|
+
streamArn: Pulumi.output(""),
|
|
21
|
+
streamLabel: Pulumi.output(""),
|
|
22
|
+
ttl: Pulumi.output({
|
|
23
|
+
attributeName: ""
|
|
24
|
+
}),
|
|
25
|
+
pointInTimeRecovery: Pulumi.output({
|
|
26
|
+
enabled: true
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
globalThis.describe("Util_DynamoDb.toResourceInfo", () => {
|
|
32
|
+
globalThis.test("reads a table without a sort key as None", async () => {
|
|
33
|
+
let resourceInfo = await resolve(Util_DynamoDb$ReventlessAws.toResourceInfo(table(null)));
|
|
34
|
+
globalThis.expect(resourceInfo).toEqual({
|
|
35
|
+
TAG: "StorageKeys",
|
|
36
|
+
partitionKey: "id",
|
|
37
|
+
sortKey: undefined
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
globalThis.test("carries a sort key when the table has one", async () => {
|
|
41
|
+
let resourceInfo = await resolve(Util_DynamoDb$ReventlessAws.toResourceInfo(table("seq")));
|
|
42
|
+
globalThis.expect(resourceInfo).toEqual({
|
|
43
|
+
TAG: "StorageKeys",
|
|
44
|
+
partitionKey: "id",
|
|
45
|
+
sortKey: "seq"
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
resolve,
|
|
52
|
+
table,
|
|
53
|
+
}
|
|
54
|
+
/* Not a pure module */
|