@travetto/model-s3 4.0.6 → 4.0.8

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 +4 -4
  2. package/src/service.ts +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-s3",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "description": "S3 backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "s3",
@@ -27,11 +27,11 @@
27
27
  "dependencies": {
28
28
  "@aws-sdk/client-s3": "^3.525.0",
29
29
  "@aws-sdk/credential-provider-ini": "^3.525.0",
30
- "@travetto/config": "^4.0.6",
31
- "@travetto/model": "^4.0.6"
30
+ "@travetto/config": "^4.0.7",
31
+ "@travetto/model": "^4.0.7"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/command": "^4.0.5"
34
+ "@travetto/command": "^4.0.6"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@travetto/command": {
package/src/service.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { Readable } from 'node:stream';
2
+ import { Agent } from 'node:https';
2
3
 
3
4
  import { S3, CompletedPart, type CreateMultipartUploadRequest } from '@aws-sdk/client-s3';
4
5
  import type { MetadataBearer } from '@aws-sdk/types';
6
+ import { NodeHttpHandler } from '@smithy/node-http-handler';
5
7
 
6
8
  import {
7
9
  ModelCrudSupport, ModelStreamSupport, ModelStorageSupport, StreamMeta,
@@ -163,7 +165,17 @@ export class S3ModelService implements ModelCrudSupport, ModelStreamSupport, Mod
163
165
  }
164
166
 
165
167
  async postConstruct(): Promise<void> {
166
- this.client = new S3(this.config.config);
168
+ this.client = new S3({
169
+ ...this.config.config,
170
+ ...('requestHandler' in this.config.config ? {
171
+ requestHandler: new NodeHttpHandler({
172
+ ...this.config.config.requestHandler,
173
+ ...('httpsAgent' in this.config.config.requestHandler! ? {
174
+ httpsAgent: new Agent({ ...this.config.config.requestHandler?.httpsAgent ?? {} }),
175
+ } : {})
176
+ }),
177
+ } : {})
178
+ });
167
179
  ModelStorageUtil.registerModelChangeListener(this);
168
180
  }
169
181