@peacom/core 2.0.96 → 2.0.97
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/package.json
CHANGED
@@ -5,6 +5,8 @@ exports.s3 = exports.S3_ACL_OPTIONS = exports.S3_FOLDERS = exports.S3_INFO = exp
|
|
5
5
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
6
6
|
const model_1 = require("@peacom/model");
|
7
7
|
const process = require("process");
|
8
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
9
|
+
const https_proxy_agent_1 = require("https-proxy-agent");
|
8
10
|
exports.S3_OPTION = {
|
9
11
|
accessKeyId: process.env['S3_ACCESS_KEY'] || '',
|
10
12
|
secretAccessKey: process.env['S3_SECRET_KEY'] || '',
|
@@ -14,6 +16,7 @@ exports.S3_OPTION = {
|
|
14
16
|
auth: process.env['S3_AUTH'] || "",
|
15
17
|
forcePathStyle: process.env['S3_PATH_STYLE'] !== '1',
|
16
18
|
acl: process.env['S3_ACL'] || 0,
|
19
|
+
proxy: process.env['S3_PROXY'] || '',
|
17
20
|
};
|
18
21
|
exports.S3_INFO = {
|
19
22
|
BUCKET: process.env['S3_BUCKET'] || ''
|
@@ -38,6 +41,11 @@ const getS3ByOption = () => {
|
|
38
41
|
if (exports.S3_OPTION.accessKeyId && exports.S3_OPTION.secretAccessKey) {
|
39
42
|
s3Options.credentials = { accessKeyId: exports.S3_OPTION.accessKeyId, secretAccessKey: exports.S3_OPTION.secretAccessKey };
|
40
43
|
}
|
44
|
+
if (exports.S3_OPTION.proxy) {
|
45
|
+
s3Options.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
46
|
+
httpsAgent: new https_proxy_agent_1.HttpsProxyAgent(exports.S3_OPTION.proxy)
|
47
|
+
});
|
48
|
+
}
|
41
49
|
return new client_s3_1.S3(s3Options);
|
42
50
|
};
|
43
51
|
exports.s3 = getS3ByOption();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/core/src/lib/service/storage/aws/constants.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,kDAAqC;AACrC,yCAAsC;AACtC,mCAAmC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/core/src/lib/service/storage/aws/constants.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,kDAAqC;AACrC,yCAAsC;AACtC,mCAAmC;AACnC,iEAA4D;AAC5D,yDAAoD;AAGvC,QAAA,SAAS,GAAG;IACvB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;IAC/C,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;IACnD,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE;IACtC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE;IACtC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;IAClC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,GAAG;IACpD,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;CACrC,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE;CACvC,CAAA;AAEY,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEW,QAAA,cAAc,GAAG;IAC5B,CAAC,kBAAU,CAAC,QAAQ,CAAC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