@teamkeel/functions-runtime 0.404.1 → 0.405.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/File.js +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/functions-runtime",
3
- "version": "0.404.1",
3
+ "version": "0.405.1",
4
4
  "description": "Internal package used by @teamkeel/sdk",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/File.js CHANGED
@@ -14,6 +14,14 @@ const s3Client = (() => {
14
14
  return null;
15
15
  }
16
16
 
17
+ if (!process.env.TEST_AWS_ENDPOINT) {
18
+ // If no test endpoint is provided then use the env's configuration
19
+ return new S3Client({
20
+ region: process.env.KEEL_REGION,
21
+ credentials: fromEnv(),
22
+ });
23
+ }
24
+
17
25
  // Set in integration tests to send all AWS API calls to a test server
18
26
  // for mocking
19
27
  const endpoint = process.env.TEST_AWS_ENDPOINT;
@@ -29,12 +37,12 @@ const s3Client = (() => {
29
37
  }
30
38
  : fromEnv(),
31
39
 
32
- // If a custom endpoint is set we need to use a custom resolver. Just settng the base endpoint isn't enough for S3 as it
40
+ // If a custom endpoint is set we need to use a custom resolver. Just setting the base endpoint isn't enough for S3 as it
33
41
  // as the default resolver uses the bucket name as a sub-domain, which likely won't work with the custom endpoint.
34
- // By impleenting a full resolver we can force it to be the endpoint we want.
42
+ // By implementing a full resolver we can force it to be the endpoint we want.
35
43
  endpointProvider: () => {
36
44
  return {
37
- url: URL.parse(endpoint),
45
+ url: new URL(endpoint),
38
46
  };
39
47
  },
40
48
  });