@reventlessdev/reventless-aws 3.0.0-alpha.248 → 3.0.0-alpha.249

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +13 -12
  3. package/rescript.json +1 -0
  4. package/src/adapter/Api/AppSyncEventsSigner_Ops.res +11 -29
  5. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +2 -3
  6. package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +1 -2
  7. package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +2 -3
  8. package/src/adapter/Geocoder/Geocoder_AwsLocation_Ops.res +1 -2
  9. package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +1 -2
  10. package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +5 -7
  11. package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -2
  12. package/src/adapter/Runtime/HeartbeatEntryPoint.res +3 -4
  13. package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +1 -2
  14. package/src/adapter/Runtime/PgMigrationEntryPoint.res +1 -2
  15. package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +3 -4
  16. package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +2 -3
  17. package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +4 -5
  18. package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +2 -3
  19. package/src/adapter/Upload/Upload_Presign_S3_Ops.res +2 -5
  20. package/src/components/Api/AppSync_Adapter.res +1 -6
  21. package/src/util/Util_Bundle.res +24 -50
  22. package/src/util/Util_Bundle.res.mjs +20 -20
  23. package/src/util/Util_LocalConfig.res +7 -14
  24. package/src/util/Util_LocalConfig.res.mjs +8 -8
  25. package/src/util/Util_SQS_Runtime.res +1 -5
  26. package/src/util/Util_StaticBundle.res +12 -29
  27. package/src/util/Util_StaticBundle.res.mjs +11 -11
  28. package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -2
  29. package/tests/PgChangeFeedRelay_IntegrationTest.res +1 -2
  30. package/tests/PgMigrationEntryPoint_IntegrationTest.res +1 -2
  31. package/tests/PgPipeline_IntegrationTest.res +1 -2
  32. package/tests/TaskBucketEntryPoint_OpsTest.res +2 -3
  33. package/tests/Util_BundleResolveTest.res +12 -18
  34. package/tests/Util_BundleResolveTest.res.mjs +8 -8
  35. package/tests/Util_StaticBundleTest.res +28 -35
  36. package/tests/Util_StaticBundleTest.res.mjs +31 -31
@@ -1,17 +1,17 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Fs from "fs";
4
- import * as Os from "os";
5
- import * as Path from "path";
3
+ import * as Nodefs from "node:fs";
4
+ import * as Nodeos from "node:os";
5
+ import * as Nodepath from "node:path";
6
6
  import * as Util_Bundle$ReventlessAws from "../src/util/Util_Bundle.res.mjs";
7
7
 
8
8
  function makeProject(pkgName) {
9
- let project = Fs.realpathSync(Fs.mkdtempSync(Path.join(Os.tmpdir(), "pulumi-project-")));
10
- let pkgDir = Path.join(Path.join(project, "node_modules"), pkgName);
11
- Fs.mkdirSync(pkgDir, {
9
+ let project = Nodefs.realpathSync(Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "pulumi-project-")));
10
+ let pkgDir = Nodepath.join(Nodepath.join(project, "node_modules"), pkgName);
11
+ Nodefs.mkdirSync(pkgDir, {
12
12
  recursive: true
13
13
  });
14
- Fs.writeFileSync(Path.join(pkgDir, "package.json"), `{"name":"` + pkgName + `","version":"9.9.9"}`);
14
+ Nodefs.writeFileSync(Nodepath.join(pkgDir, "package.json"), `{"name":"","version":"9.9.9"}`, "utf8");
15
15
  return [
16
16
  project,
17
17
  pkgDir
@@ -31,7 +31,7 @@ globalThis.describe("Util_Bundle.resolvePackageRoot", () => {
31
31
  });
32
32
  globalThis.afterAll(() => {
33
33
  process.chdir(originalCwd);
34
- Fs.rmSync(project, {
34
+ Nodefs.rmSync(project, {
35
35
  recursive: true,
36
36
  force: true
37
37
  });
@@ -1,22 +1,15 @@
1
1
  open JestGlobals
2
2
 
3
- @module("fs") external mkdtempSync: string => string = "mkdtempSync"
4
- @module("fs") external mkdirSync: (string, {"recursive": bool}) => unit = "mkdirSync"
5
- @module("fs") external writeFileSync: (string, string) => unit = "writeFileSync"
6
- @module("fs") external rmSync: (string, {"recursive": bool, "force": bool}) => unit = "rmSync"
7
- @module("path") external join2: (string, string) => string = "join"
8
- @module("os") external tmpdir: unit => string = "tmpdir"
9
-
10
3
  let makeFixture = (): string => {
11
- let base = mkdtempSync(join2(tmpdir(), "static-bundle-"))
12
- writeFileSync(join2(base, "index.html"), "<html></html>")
13
- writeFileSync(join2(base, "app.js"), "console.log('x')")
14
- writeFileSync(join2(base, "app.css"), "body{color:red}")
15
- writeFileSync(join2(base, ".DS_Store"), "ignored")
16
- let assets = join2(base, "assets")
17
- mkdirSync(assets, {"recursive": true})
18
- writeFileSync(join2(assets, "logo.svg"), "<svg/>")
19
- writeFileSync(join2(assets, "favicon.ico"), "ico")
4
+ let base = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
5
+ NodeFs.writeFileSync(NodePath.join([base, "index.html"]), "<html></html>")
6
+ NodeFs.writeFileSync(NodePath.join([base, "app.js"]), "console.log('x')")
7
+ NodeFs.writeFileSync(NodePath.join([base, "app.css"]), "body{color:red}")
8
+ NodeFs.writeFileSync(NodePath.join([base, ".DS_Store"]), "ignored")
9
+ let assets = NodePath.join([base, "assets"])
10
+ NodeFs.mkdirSync(assets, {recursive: true})
11
+ NodeFs.writeFileSync(NodePath.join([assets, "logo.svg"]), "<svg/>")
12
+ NodeFs.writeFileSync(NodePath.join([assets, "favicon.ico"]), "ico")
20
13
  base
21
14
  }
22
15
 
@@ -86,14 +79,14 @@ describe("Util_StaticBundle.walk", () => {
86
79
  "assets/logo.svg",
87
80
  "index.html",
88
81
  ])
89
- rmSync(dir, {"recursive": true, "force": true})
82
+ NodeFs.rmSync(dir, {recursive: true, force: true})
90
83
  })
91
84
 
92
85
  testSync("computes a non-empty content hash for each entry", () => {
93
86
  let dir = makeFixture()
94
87
  let entries = Util_StaticBundle.walk(dir)
95
88
  entries->Array.forEach(e => expect(e.contentHash->String.length > 0)->toBe(true))
96
- rmSync(dir, {"recursive": true, "force": true})
89
+ NodeFs.rmSync(dir, {recursive: true, force: true})
97
90
  })
98
91
 
99
92
  testSync("identical contents produce identical hashes", () => {
@@ -102,29 +95,29 @@ describe("Util_StaticBundle.walk", () => {
102
95
  let indexEntry =
103
96
  entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
104
97
  let indexHash = indexEntry.contentHash
105
- let dir2 = mkdtempSync(join2(tmpdir(), "static-bundle-"))
106
- writeFileSync(join2(dir2, "index.html"), "<html></html>")
98
+ let dir2 = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
99
+ NodeFs.writeFileSync(NodePath.join([dir2, "index.html"]), "<html></html>")
107
100
  let entries2 = Util_StaticBundle.walk(dir2)
108
101
  let indexHash2 = (entries2->Array.getUnsafe(0)).contentHash
109
102
  expect(indexHash)->toBe(indexHash2)
110
- rmSync(dir, {"recursive": true, "force": true})
111
- rmSync(dir2, {"recursive": true, "force": true})
103
+ NodeFs.rmSync(dir, {recursive: true, force: true})
104
+ NodeFs.rmSync(dir2, {recursive: true, force: true})
112
105
  })
113
106
 
114
107
  testSync("different contents produce different hashes", () => {
115
- let dirA = mkdtempSync(join2(tmpdir(), "static-bundle-"))
116
- writeFileSync(join2(dirA, "f.txt"), "AAA")
117
- let dirB = mkdtempSync(join2(tmpdir(), "static-bundle-"))
118
- writeFileSync(join2(dirB, "f.txt"), "BBB")
108
+ let dirA = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
109
+ NodeFs.writeFileSync(NodePath.join([dirA, "f.txt"]), "AAA")
110
+ let dirB = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
111
+ NodeFs.writeFileSync(NodePath.join([dirB, "f.txt"]), "BBB")
119
112
  let hashA = (Util_StaticBundle.walk(dirA)->Array.getUnsafe(0)).contentHash
120
113
  let hashB = (Util_StaticBundle.walk(dirB)->Array.getUnsafe(0)).contentHash
121
114
  expect(hashA == hashB)->toBe(false)
122
- rmSync(dirA, {"recursive": true, "force": true})
123
- rmSync(dirB, {"recursive": true, "force": true})
115
+ NodeFs.rmSync(dirA, {recursive: true, force: true})
116
+ NodeFs.rmSync(dirB, {recursive: true, force: true})
124
117
  })
125
118
 
126
119
  testSync("throws when assetsDir does not exist", () => {
127
- let missing = join2(tmpdir(), "static-bundle-does-not-exist-xyz123")
120
+ let missing = NodePath.join([NodeOs.tmpdir(), "static-bundle-does-not-exist-xyz123"])
128
121
  let threw = try {
129
122
  let _ = Util_StaticBundle.walk(missing)
130
123
  false
@@ -137,9 +130,9 @@ describe("Util_StaticBundle.walk", () => {
137
130
 
138
131
  describe("Util_StaticBundle.readJsonFileVerbatim", () => {
139
132
  let writeTmp = (contents: string): string => {
140
- let dir = mkdtempSync(join2(tmpdir(), "ui-hints-"))
141
- let path = join2(dir, "ui-hints.json")
142
- writeFileSync(path, contents)
133
+ let dir = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "ui-hints-"]))
134
+ let path = NodePath.join([dir, "ui-hints.json"])
135
+ NodeFs.writeFileSync(path, contents)
143
136
  path
144
137
  }
145
138
 
@@ -148,7 +141,7 @@ describe("Util_StaticBundle.readJsonFileVerbatim", () => {
148
141
  let raw = "{\n \"dashboards\": [ ] \n}\n"
149
142
  let path = writeTmp(raw)
150
143
  expect(Util_StaticBundle.readJsonFileVerbatim(~path, ~label="test"))->toBe(raw)
151
- rmSync(path, {"recursive": true, "force": true})
144
+ NodeFs.rmSync(path, {recursive: true, force: true})
152
145
  })
153
146
 
154
147
  testSync("throws on malformed JSON", () => {
@@ -160,11 +153,11 @@ describe("Util_StaticBundle.readJsonFileVerbatim", () => {
160
153
  | _ => true
161
154
  }
162
155
  expect(threw)->toBe(true)
163
- rmSync(path, {"recursive": true, "force": true})
156
+ NodeFs.rmSync(path, {recursive: true, force: true})
164
157
  })
165
158
 
166
159
  testSync("throws when the file does not exist", () => {
167
- let missing = join2(tmpdir(), "ui-hints-missing-xyz123.json")
160
+ let missing = NodePath.join([NodeOs.tmpdir(), "ui-hints-missing-xyz123.json"])
168
161
  let threw = try {
169
162
  let _ = Util_StaticBundle.readJsonFileVerbatim(~path=missing, ~label="test")
170
163
  false
@@ -1,23 +1,23 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Fs from "fs";
4
- import * as Os from "os";
5
- import * as Path from "path";
3
+ import * as Nodefs from "node:fs";
4
+ import * as Nodeos from "node:os";
5
+ import * as Nodepath from "node:path";
6
6
  import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
7
7
  import * as Util_StaticBundle$ReventlessAws from "../src/util/Util_StaticBundle.res.mjs";
8
8
 
9
9
  function makeFixture() {
10
- let base = Fs.mkdtempSync(Path.join(Os.tmpdir(), "static-bundle-"));
11
- Fs.writeFileSync(Path.join(base, "index.html"), "<html></html>");
12
- Fs.writeFileSync(Path.join(base, "app.js"), "console.log('x')");
13
- Fs.writeFileSync(Path.join(base, "app.css"), "body{color:red}");
14
- Fs.writeFileSync(Path.join(base, ".DS_Store"), "ignored");
15
- let assets = Path.join(base, "assets");
16
- Fs.mkdirSync(assets, {
10
+ let base = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
11
+ Nodefs.writeFileSync(Nodepath.join(base, "index.html"), "<html></html>", "utf8");
12
+ Nodefs.writeFileSync(Nodepath.join(base, "app.js"), "console.log('x')", "utf8");
13
+ Nodefs.writeFileSync(Nodepath.join(base, "app.css"), "body{color:red}", "utf8");
14
+ Nodefs.writeFileSync(Nodepath.join(base, ".DS_Store"), "ignored", "utf8");
15
+ let assets = Nodepath.join(base, "assets");
16
+ Nodefs.mkdirSync(assets, {
17
17
  recursive: true
18
18
  });
19
- Fs.writeFileSync(Path.join(assets, "logo.svg"), "<svg/>");
20
- Fs.writeFileSync(Path.join(assets, "favicon.ico"), "ico");
19
+ Nodefs.writeFileSync(Nodepath.join(assets, "logo.svg"), "<svg/>", "utf8");
20
+ Nodefs.writeFileSync(Nodepath.join(assets, "favicon.ico"), "ico", "utf8");
21
21
  return base;
22
22
  }
23
23
 
@@ -78,7 +78,7 @@ globalThis.describe("Util_StaticBundle.walk", () => {
78
78
  "assets/logo.svg",
79
79
  "index.html"
80
80
  ]);
81
- Fs.rmSync(dir, {
81
+ Nodefs.rmSync(dir, {
82
82
  recursive: true,
83
83
  force: true
84
84
  });
@@ -89,7 +89,7 @@ globalThis.describe("Util_StaticBundle.walk", () => {
89
89
  entries.forEach(e => {
90
90
  globalThis.expect(e.contentHash.length > 0).toBe(true);
91
91
  });
92
- Fs.rmSync(dir, {
92
+ Nodefs.rmSync(dir, {
93
93
  recursive: true,
94
94
  force: true
95
95
  });
@@ -99,39 +99,39 @@ globalThis.describe("Util_StaticBundle.walk", () => {
99
99
  let entries = Util_StaticBundle$ReventlessAws.walk(dir);
100
100
  let indexEntry = entries.find(e => e.relativePath === "index.html");
101
101
  let indexHash = indexEntry.contentHash;
102
- let dir2 = Fs.mkdtempSync(Path.join(Os.tmpdir(), "static-bundle-"));
103
- Fs.writeFileSync(Path.join(dir2, "index.html"), "<html></html>");
102
+ let dir2 = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
103
+ Nodefs.writeFileSync(Nodepath.join(dir2, "index.html"), "<html></html>", "utf8");
104
104
  let entries2 = Util_StaticBundle$ReventlessAws.walk(dir2);
105
105
  let indexHash2 = entries2[0].contentHash;
106
106
  globalThis.expect(indexHash).toBe(indexHash2);
107
- Fs.rmSync(dir, {
107
+ Nodefs.rmSync(dir, {
108
108
  recursive: true,
109
109
  force: true
110
110
  });
111
- Fs.rmSync(dir2, {
111
+ Nodefs.rmSync(dir2, {
112
112
  recursive: true,
113
113
  force: true
114
114
  });
115
115
  });
116
116
  globalThis.test("different contents produce different hashes", () => {
117
- let dirA = Fs.mkdtempSync(Path.join(Os.tmpdir(), "static-bundle-"));
118
- Fs.writeFileSync(Path.join(dirA, "f.txt"), "AAA");
119
- let dirB = Fs.mkdtempSync(Path.join(Os.tmpdir(), "static-bundle-"));
120
- Fs.writeFileSync(Path.join(dirB, "f.txt"), "BBB");
117
+ let dirA = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
118
+ Nodefs.writeFileSync(Nodepath.join(dirA, "f.txt"), "AAA", "utf8");
119
+ let dirB = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "static-bundle-"));
120
+ Nodefs.writeFileSync(Nodepath.join(dirB, "f.txt"), "BBB", "utf8");
121
121
  let hashA = Util_StaticBundle$ReventlessAws.walk(dirA)[0].contentHash;
122
122
  let hashB = Util_StaticBundle$ReventlessAws.walk(dirB)[0].contentHash;
123
123
  globalThis.expect(hashA === hashB).toBe(false);
124
- Fs.rmSync(dirA, {
124
+ Nodefs.rmSync(dirA, {
125
125
  recursive: true,
126
126
  force: true
127
127
  });
128
- Fs.rmSync(dirB, {
128
+ Nodefs.rmSync(dirB, {
129
129
  recursive: true,
130
130
  force: true
131
131
  });
132
132
  });
133
133
  globalThis.test("throws when assetsDir does not exist", () => {
134
- let missing = Path.join(Os.tmpdir(), "static-bundle-does-not-exist-xyz123");
134
+ let missing = Nodepath.join(Nodeos.tmpdir(), "static-bundle-does-not-exist-xyz123");
135
135
  let threw;
136
136
  try {
137
137
  Util_StaticBundle$ReventlessAws.walk(missing);
@@ -145,16 +145,16 @@ globalThis.describe("Util_StaticBundle.walk", () => {
145
145
 
146
146
  globalThis.describe("Util_StaticBundle.readJsonFileVerbatim", () => {
147
147
  let writeTmp = contents => {
148
- let dir = Fs.mkdtempSync(Path.join(Os.tmpdir(), "ui-hints-"));
149
- let path = Path.join(dir, "ui-hints.json");
150
- Fs.writeFileSync(path, contents);
148
+ let dir = Nodefs.mkdtempSync(Nodepath.join(Nodeos.tmpdir(), "ui-hints-"));
149
+ let path = Nodepath.join(dir, "ui-hints.json");
150
+ Nodefs.writeFileSync(path, contents, "utf8");
151
151
  return path;
152
152
  };
153
153
  globalThis.test("returns the file's exact bytes for valid JSON (verbatim, not re-serialised)", () => {
154
154
  let raw = "{\n \"dashboards\": [ ] \n}\n";
155
155
  let path = writeTmp(raw);
156
156
  globalThis.expect(Util_StaticBundle$ReventlessAws.readJsonFileVerbatim(path, "test")).toBe(raw);
157
- Fs.rmSync(path, {
157
+ Nodefs.rmSync(path, {
158
158
  recursive: true,
159
159
  force: true
160
160
  });
@@ -169,13 +169,13 @@ globalThis.describe("Util_StaticBundle.readJsonFileVerbatim", () => {
169
169
  threw = true;
170
170
  }
171
171
  globalThis.expect(threw).toBe(true);
172
- Fs.rmSync(path, {
172
+ Nodefs.rmSync(path, {
173
173
  recursive: true,
174
174
  force: true
175
175
  });
176
176
  });
177
177
  globalThis.test("throws when the file does not exist", () => {
178
- let missing = Path.join(Os.tmpdir(), "ui-hints-missing-xyz123.json");
178
+ let missing = Nodepath.join(Nodeos.tmpdir(), "ui-hints-missing-xyz123.json");
179
179
  let threw;
180
180
  try {
181
181
  Util_StaticBundle$ReventlessAws.readJsonFileVerbatim(missing, "test");