@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.
@@ -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 */