graphile-settings 4.21.8 → 4.22.0

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.
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Follows the same lazy-init pattern as upload-resolver.ts.
12
12
  */
13
- import { S3Client } from '@aws-sdk/client-s3';
13
+ import { createS3Client } from '@constructive-io/s3-utils';
14
14
  import { getEnvOptions } from '@constructive-io/graphql-env';
15
15
  import { Logger } from '@pgpmjs/logger';
16
16
  import { BucketProvisioner } from '@constructive-io/bucket-provisioner';
@@ -47,10 +47,12 @@ export function getPresignedUrlS3Config() {
47
47
  'Set CDN_BUCKET_NAME environment variable.');
48
48
  }
49
49
  log.info(`[presigned-url-resolver] Initializing: bucket=${bucketName} endpoint=${endpoint}`);
50
- const client = new S3Client({
50
+ const client = createS3Client({
51
+ provider: (cdn.provider || 'minio'),
51
52
  region: awsRegion,
52
- credentials: { accessKeyId: awsAccessKey, secretAccessKey: awsSecretKey },
53
- ...(endpoint ? { endpoint, forcePathStyle: true } : {}),
53
+ accessKeyId: awsAccessKey,
54
+ secretAccessKey: awsSecretKey,
55
+ ...(endpoint ? { endpoint } : {}),
54
56
  });
55
57
  s3Config = {
56
58
  client,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "4.21.8",
3
+ "version": "4.22.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -30,10 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@aws-sdk/client-s3": "^3.1009.0",
33
- "@constructive-io/bucket-provisioner": "^0.3.0",
33
+ "@constructive-io/bucket-provisioner": "^0.4.0",
34
34
  "@constructive-io/graphql-env": "^3.6.1",
35
35
  "@constructive-io/graphql-types": "^3.5.1",
36
- "@constructive-io/s3-streamer": "^2.18.0",
36
+ "@constructive-io/s3-streamer": "^2.19.0",
37
+ "@constructive-io/s3-utils": "^2.12.0",
37
38
  "@constructive-io/upload-names": "^2.11.0",
38
39
  "@dataplan/json": "1.0.0",
39
40
  "@dataplan/pg": "1.0.0",
@@ -45,13 +46,13 @@
45
46
  "express": "^5.2.1",
46
47
  "grafast": "1.0.0",
47
48
  "grafserv": "1.0.0",
48
- "graphile-bucket-provisioner-plugin": "0.4.0",
49
+ "graphile-bucket-provisioner-plugin": "0.4.1",
49
50
  "graphile-build": "5.0.0",
50
51
  "graphile-build-pg": "5.0.0",
51
52
  "graphile-config": "1.0.0",
52
53
  "graphile-connection-filter": "^1.5.4",
53
54
  "graphile-postgis": "^2.11.5",
54
- "graphile-presigned-url-plugin": "^0.6.3",
55
+ "graphile-presigned-url-plugin": "^0.6.4",
55
56
  "graphile-search": "^1.7.4",
56
57
  "graphile-sql-expression-validator": "^2.7.0",
57
58
  "graphile-upload-plugin": "^2.6.0",
@@ -84,5 +85,5 @@
84
85
  "constructive",
85
86
  "graphql"
86
87
  ],
87
- "gitHead": "a6424a875afd997535ca6b1636542a5158991003"
88
+ "gitHead": "434a578648cb04d3ed25e79a75c654f71573292f"
88
89
  }
@@ -16,7 +16,7 @@ exports.getPresignedUrlS3Config = getPresignedUrlS3Config;
16
16
  exports.createBucketNameResolver = createBucketNameResolver;
17
17
  exports.getAllowedOrigins = getAllowedOrigins;
18
18
  exports.createEnsureBucketProvisioned = createEnsureBucketProvisioned;
19
- const client_s3_1 = require("@aws-sdk/client-s3");
19
+ const s3_utils_1 = require("@constructive-io/s3-utils");
20
20
  const graphql_env_1 = require("@constructive-io/graphql-env");
21
21
  const logger_1 = require("@pgpmjs/logger");
22
22
  const bucket_provisioner_1 = require("@constructive-io/bucket-provisioner");
@@ -53,10 +53,12 @@ function getPresignedUrlS3Config() {
53
53
  'Set CDN_BUCKET_NAME environment variable.');
54
54
  }
55
55
  log.info(`[presigned-url-resolver] Initializing: bucket=${bucketName} endpoint=${endpoint}`);
56
- const client = new client_s3_1.S3Client({
56
+ const client = (0, s3_utils_1.createS3Client)({
57
+ provider: (cdn.provider || 'minio'),
57
58
  region: awsRegion,
58
- credentials: { accessKeyId: awsAccessKey, secretAccessKey: awsSecretKey },
59
- ...(endpoint ? { endpoint, forcePathStyle: true } : {}),
59
+ accessKeyId: awsAccessKey,
60
+ secretAccessKey: awsSecretKey,
61
+ ...(endpoint ? { endpoint } : {}),
60
62
  });
61
63
  s3Config = {
62
64
  client,