@constructive-io/s3-streamer 2.17.3 → 2.17.4

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/esm/s3.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import { S3Client } from '@aws-sdk/client-s3';
2
2
  export default function getS3(opts) {
3
- // Use explicit provider if set, otherwise fall back to checking minioEndpoint for backwards compatibility
4
- const isMinio = opts.provider === 'minio' || (opts.provider === undefined && Boolean(opts.minioEndpoint));
5
3
  const awsConfig = {
6
4
  region: opts.awsRegion,
7
5
  ...(opts.awsAccessKey && opts.awsSecretKey
@@ -12,9 +10,9 @@ export default function getS3(opts) {
12
10
  },
13
11
  }
14
12
  : {}),
15
- ...(isMinio && opts.minioEndpoint
13
+ ...(opts.endpoint
16
14
  ? {
17
- endpoint: opts.minioEndpoint,
15
+ endpoint: opts.endpoint,
18
16
  forcePathStyle: true,
19
17
  }
20
18
  : {}),
package/esm/streamer.js CHANGED
@@ -4,12 +4,12 @@ import { upload as streamUpload, uploadWithContentType as streamUploadWithConten
4
4
  export class Streamer {
5
5
  s3;
6
6
  defaultBucket;
7
- constructor({ awsRegion, awsSecretKey, awsAccessKey, minioEndpoint, provider, defaultBucket }) {
7
+ constructor({ awsRegion, awsSecretKey, awsAccessKey, endpoint, provider, defaultBucket }) {
8
8
  this.s3 = getS3({
9
9
  awsRegion,
10
10
  awsSecretKey,
11
11
  awsAccessKey,
12
- minioEndpoint,
12
+ endpoint,
13
13
  provider
14
14
  });
15
15
  this.defaultBucket = defaultBucket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/s3-streamer",
3
- "version": "2.17.3",
3
+ "version": "2.17.4",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "stream files to s3",
6
6
  "main": "index.js",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@constructive-io/s3-utils": "^2.10.2",
33
- "@pgpmjs/env": "^2.16.3",
33
+ "@pgpmjs/env": "^2.17.0",
34
34
  "glob": "^13.0.6",
35
35
  "makage": "^0.3.0"
36
36
  },
@@ -38,7 +38,7 @@
38
38
  "@aws-sdk/client-s3": "^3.1009.0",
39
39
  "@aws-sdk/lib-storage": "^3.1009.0",
40
40
  "@constructive-io/content-type-stream": "^2.11.2",
41
- "@pgpmjs/types": "^2.20.3"
41
+ "@pgpmjs/types": "^2.21.0"
42
42
  },
43
43
  "keywords": [
44
44
  "s3",
@@ -48,5 +48,5 @@
48
48
  "minio",
49
49
  "constructive"
50
50
  ],
51
- "gitHead": "d0d8f5ca5828ad3efba5f607bc699a8d520e4603"
51
+ "gitHead": "fe60f7b81252eea53dce227bb581d5ae2ef0ec36"
52
52
  }
package/s3.d.ts CHANGED
@@ -4,7 +4,7 @@ interface S3Options {
4
4
  awsAccessKey: string;
5
5
  awsSecretKey: string;
6
6
  awsRegion: string;
7
- minioEndpoint?: string;
7
+ endpoint?: string;
8
8
  provider?: BucketProvider;
9
9
  }
10
10
  export default function getS3(opts: S3Options): S3Client;
package/s3.js CHANGED
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = getS3;
4
4
  const client_s3_1 = require("@aws-sdk/client-s3");
5
5
  function getS3(opts) {
6
- // Use explicit provider if set, otherwise fall back to checking minioEndpoint for backwards compatibility
7
- const isMinio = opts.provider === 'minio' || (opts.provider === undefined && Boolean(opts.minioEndpoint));
8
6
  const awsConfig = {
9
7
  region: opts.awsRegion,
10
8
  ...(opts.awsAccessKey && opts.awsSecretKey
@@ -15,9 +13,9 @@ function getS3(opts) {
15
13
  },
16
14
  }
17
15
  : {}),
18
- ...(isMinio && opts.minioEndpoint
16
+ ...(opts.endpoint
19
17
  ? {
20
- endpoint: opts.minioEndpoint,
18
+ endpoint: opts.endpoint,
21
19
  forcePathStyle: true,
22
20
  }
23
21
  : {}),
package/streamer.d.ts CHANGED
@@ -6,7 +6,7 @@ interface StreamerOptions {
6
6
  awsRegion: string;
7
7
  awsSecretKey: string;
8
8
  awsAccessKey: string;
9
- minioEndpoint?: string;
9
+ endpoint?: string;
10
10
  provider?: BucketProvider;
11
11
  defaultBucket: string;
12
12
  }
@@ -29,7 +29,7 @@ interface UploadWithContentTypeParams {
29
29
  export declare class Streamer {
30
30
  private s3;
31
31
  private defaultBucket?;
32
- constructor({ awsRegion, awsSecretKey, awsAccessKey, minioEndpoint, provider, defaultBucket }: StreamerOptions);
32
+ constructor({ awsRegion, awsSecretKey, awsAccessKey, endpoint, provider, defaultBucket }: StreamerOptions);
33
33
  upload({ readStream, filename, key, bucket }: UploadParams): Promise<AsyncUploadResult>;
34
34
  uploadWithContentType({ readStream, contentType, key, bucket, magic, }: UploadWithContentTypeParams): Promise<AsyncUploadResult>;
35
35
  detectContentType({ readStream, filename, peekBytes, }: {
package/streamer.js CHANGED
@@ -10,12 +10,12 @@ const utils_1 = require("./utils");
10
10
  class Streamer {
11
11
  s3;
12
12
  defaultBucket;
13
- constructor({ awsRegion, awsSecretKey, awsAccessKey, minioEndpoint, provider, defaultBucket }) {
13
+ constructor({ awsRegion, awsSecretKey, awsAccessKey, endpoint, provider, defaultBucket }) {
14
14
  this.s3 = (0, s3_1.default)({
15
15
  awsRegion,
16
16
  awsSecretKey,
17
17
  awsAccessKey,
18
- minioEndpoint,
18
+ endpoint,
19
19
  provider
20
20
  });
21
21
  this.defaultBucket = defaultBucket;