@pisell/common 0.0.60 → 0.0.61
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/es/script/aws/index.js +13 -1
- package/lib/script/aws/index.js +13 -1
- package/package.json +2 -1
package/es/script/aws/index.js
CHANGED
|
@@ -6,7 +6,9 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
6
6
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
7
7
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
8
|
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
|
9
|
+
import { NodeHttpHandler } from '@smithy/node-http-handler';
|
|
9
10
|
import fs from 'fs';
|
|
11
|
+
import { Agent } from 'https';
|
|
10
12
|
import mime from 'mime-types';
|
|
11
13
|
import path from 'path';
|
|
12
14
|
import { getServerConfig } from "../utils/index.js";
|
|
@@ -47,7 +49,17 @@ var init = /*#__PURE__*/function () {
|
|
|
47
49
|
credentials: {
|
|
48
50
|
accessKeyId: awsConfig.accessKeyId,
|
|
49
51
|
secretAccessKey: awsConfig.secretAccessKey
|
|
50
|
-
}
|
|
52
|
+
},
|
|
53
|
+
requestHandler: new NodeHttpHandler({
|
|
54
|
+
httpsAgent: new Agent({
|
|
55
|
+
maxSockets: 500,
|
|
56
|
+
// keepAlive is a default from AWS SDK. We want to preserve this for
|
|
57
|
+
// performance reasons.
|
|
58
|
+
keepAlive: true,
|
|
59
|
+
keepAliveMsecs: 1000
|
|
60
|
+
}),
|
|
61
|
+
socketTimeout: 5000
|
|
62
|
+
})
|
|
51
63
|
});
|
|
52
64
|
console.log('aws 初始化成功');
|
|
53
65
|
return _context.abrupt("return", serverConfig.aws);
|
package/lib/script/aws/index.js
CHANGED
|
@@ -34,7 +34,9 @@ __export(aws_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(aws_exports);
|
|
36
36
|
var import_client_s3 = require("@aws-sdk/client-s3");
|
|
37
|
+
var import_node_http_handler = require("@smithy/node-http-handler");
|
|
37
38
|
var import_fs = __toESM(require("fs"));
|
|
39
|
+
var import_https = require("https");
|
|
38
40
|
var import_mime_types = __toESM(require("mime-types"));
|
|
39
41
|
var import_path = __toESM(require("path"));
|
|
40
42
|
var import_utils = require("../utils/index.js");
|
|
@@ -53,7 +55,17 @@ var init = async () => {
|
|
|
53
55
|
credentials: {
|
|
54
56
|
accessKeyId: awsConfig.accessKeyId,
|
|
55
57
|
secretAccessKey: awsConfig.secretAccessKey
|
|
56
|
-
}
|
|
58
|
+
},
|
|
59
|
+
requestHandler: new import_node_http_handler.NodeHttpHandler({
|
|
60
|
+
httpsAgent: new import_https.Agent({
|
|
61
|
+
maxSockets: 500,
|
|
62
|
+
// keepAlive is a default from AWS SDK. We want to preserve this for
|
|
63
|
+
// performance reasons.
|
|
64
|
+
keepAlive: true,
|
|
65
|
+
keepAliveMsecs: 1e3
|
|
66
|
+
}),
|
|
67
|
+
socketTimeout: 5e3
|
|
68
|
+
})
|
|
57
69
|
});
|
|
58
70
|
console.log("aws 初始化成功");
|
|
59
71
|
return serverConfig.aws;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "A collection of reusable UI components for web development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@aws-sdk/client-s3": "^3.456.0",
|
|
62
|
+
"@smithy/node-http-handler": "^2.1.10",
|
|
62
63
|
"antd5": "npm:antd@^5.5.0",
|
|
63
64
|
"archiver": "^5.3.1",
|
|
64
65
|
"array-move": "^3.0.1",
|