@ntegral/nestjs-s3
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,2 +5,3 @@ "use strict"; | ||
const S3 = require("aws-sdk/clients/s3"); | ||
const https = require("https"); | ||
function createS3Client(options) { | ||
@@ -13,2 +14,11 @@ AWS.config.update({ | ||
}); | ||
if (options.maxSockets) { | ||
AWS.config.update({ | ||
httpOptions: { | ||
agent: new https.Agent({ | ||
maxSockets: options.maxSockets | ||
}) | ||
} | ||
}); | ||
} | ||
let version = options.apiVersion === undefined ? '2006-03-01' : options.apiVersion; | ||
@@ -15,0 +25,0 @@ let params = { |
@@ -8,2 +8,3 @@ import { ModuleMetadata, Type } from "@nestjs/common/interfaces"; | ||
apiVersion?: string; | ||
maxSockets?: number; | ||
} | ||
@@ -10,0 +11,0 @@ export interface S3ConfigOptionsFactory { |
import { S3ConfigOptions } from "../interfaces/s3-options.interface"; | ||
import * as AWS from 'aws-sdk/global'; | ||
import * as S3 from 'aws-sdk/clients/s3'; | ||
import * as https from 'https'; | ||
@@ -12,2 +13,11 @@ export function createS3Client(options: S3ConfigOptions): S3 { | ||
}); | ||
if (options.maxSockets) { | ||
AWS.config.update({ | ||
httpOptions: { | ||
agent: new https.Agent({ | ||
maxSockets: options.maxSockets | ||
}) | ||
} | ||
}); | ||
} | ||
let version = options.apiVersion === undefined ? '2006-03-01' : options.apiVersion; | ||
@@ -14,0 +24,0 @@ let params: S3.ClientConfiguration = { |
@@ -8,3 +8,4 @@ import { ModuleMetadata, Type } from "@nestjs/common/interfaces"; | ||
sessionToken?: string; | ||
apiVersion?: string | ||
apiVersion?: string; | ||
maxSockets?: number; | ||
} | ||
@@ -11,0 +12,0 @@ |
@@ -10,3 +10,3 @@ { | ||
"name": "@ntegral/nestjs-s3", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Provides an injectable s3 client to provide s3 storage access from nestjs modules", | ||
@@ -13,0 +13,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
160354
1145
1