@reventlessdev/reventless-aws 3.0.0-alpha.370 → 3.0.0-alpha.372
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 +18 -0
- package/package.json +12 -11
- package/run-clear-pending-creates.mjs +3 -0
- package/scripts/ClearPendingCreates.res +142 -0
- package/scripts/ClearPendingCreates.res.mjs +187 -0
- package/scripts/DeployApp.res +19 -1
- package/scripts/DeployApp.res.mjs +18 -2
- package/scripts/DeployManifest.res +7 -1
- package/scripts/DeployManifest.res.mjs +7 -3
- package/src/Platform.res +31 -11
- package/src/Platform.res.mjs +24 -2
- package/src/Platform_ProvidedGroups.res +97 -0
- package/src/Platform_ProvidedGroups.res.mjs +103 -0
- package/tests/BakeManifestTest.res +15 -2
- package/tests/BakeManifestTest.res.mjs +8 -3
- package/tests/ClearPendingCreatesTest.res +93 -0
- package/tests/ClearPendingCreatesTest.res.mjs +99 -0
- package/tests/DeployAppTest.res +11 -0
- package/tests/DeployAppTest.res.mjs +22 -1
- package/tests/Platform_ProvidedGroupsTest.res +52 -0
- package/tests/Platform_ProvidedGroupsTest.res.mjs +98 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Platform_ProvidedGroups$ReventlessAws from "../src/Platform_ProvidedGroups.res.mjs";
|
|
4
|
+
|
|
5
|
+
function group(name) {
|
|
6
|
+
return {
|
|
7
|
+
GroupName: name
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
globalThis.describe("Platform_ProvidedGroups.listAll", () => {
|
|
12
|
+
globalThis.test("follows NextToken until the last page", async () => {
|
|
13
|
+
let seen = [];
|
|
14
|
+
let send = async input => {
|
|
15
|
+
seen.push(input.NextToken);
|
|
16
|
+
let match = input.NextToken;
|
|
17
|
+
if (match !== undefined) {
|
|
18
|
+
return {
|
|
19
|
+
Groups: [{
|
|
20
|
+
GroupName: "Merchandiser"
|
|
21
|
+
}]
|
|
22
|
+
};
|
|
23
|
+
} else {
|
|
24
|
+
return {
|
|
25
|
+
Groups: [
|
|
26
|
+
{
|
|
27
|
+
GroupName: "Admin"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
GroupName: "Shopper"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
NextToken: "p2"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
let groups = await Platform_ProvidedGroups$ReventlessAws.listAll(send, "p1");
|
|
38
|
+
globalThis.expect([
|
|
39
|
+
groups,
|
|
40
|
+
seen
|
|
41
|
+
]).toEqual([
|
|
42
|
+
[
|
|
43
|
+
"Admin",
|
|
44
|
+
"Shopper",
|
|
45
|
+
"Merchandiser"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
undefined,
|
|
49
|
+
"p2"
|
|
50
|
+
]
|
|
51
|
+
]);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
globalThis.describe("Platform_ProvidedGroups.poolFromExports", () => {
|
|
56
|
+
let from = pairs => {
|
|
57
|
+
let $$exports = Object.fromEntries(pairs);
|
|
58
|
+
return Platform_ProvidedGroups$ReventlessAws.poolFromExports(key => $$exports[key]);
|
|
59
|
+
};
|
|
60
|
+
globalThis.test("reads the pool id and region", () => {
|
|
61
|
+
globalThis.expect(from([
|
|
62
|
+
[
|
|
63
|
+
"identityProviderId",
|
|
64
|
+
"p1"
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"identityProviderRegion",
|
|
68
|
+
"eu-west-1"
|
|
69
|
+
]
|
|
70
|
+
])).toEqual({
|
|
71
|
+
id: "p1",
|
|
72
|
+
region: "eu-west-1"
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
globalThis.test("reads them nested under default, as an ESM platform exports them", () => {
|
|
76
|
+
globalThis.expect(from([[
|
|
77
|
+
"default",
|
|
78
|
+
Object.fromEntries([[
|
|
79
|
+
"cognitoUserPoolId",
|
|
80
|
+
"p-old"
|
|
81
|
+
]])
|
|
82
|
+
]])).toEqual({
|
|
83
|
+
id: "p-old",
|
|
84
|
+
region: undefined
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
globalThis.test("no pool id is no pool to list", () => {
|
|
88
|
+
globalThis.expect(from([])).toEqual(undefined);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
let Cognito;
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
Cognito,
|
|
96
|
+
group,
|
|
97
|
+
}
|
|
98
|
+
/* Not a pure module */
|