lesgo 2.1.11 → 3.0.0
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/dist/middlewares/httpResponseMiddleware.js +3 -3
- package/dist/services/JWTService/sign.js +5 -2
- package/dist/services/S3Service/getObject.d.ts +0 -1
- package/dist/services/S3Service/putObject.d.ts +0 -1
- package/dist/utils/cache/redis/getClient.d.ts +1 -1
- package/dist/utils/s3/getObject.d.ts +1 -2
- package/dist/utils/s3/putObject.d.ts +0 -1
- package/package.json +2 -2
|
@@ -89,7 +89,7 @@ const httpResponseMiddleware = (opts = {}) => {
|
|
|
89
89
|
});
|
|
90
90
|
const httpResponseMiddlewareOnError = request =>
|
|
91
91
|
__awaiter(void 0, void 0, void 0, function* () {
|
|
92
|
-
var
|
|
92
|
+
var _a;
|
|
93
93
|
const error = request.error;
|
|
94
94
|
if (error.extra && error.extra.statusCode) {
|
|
95
95
|
delete error.extra.statusCode;
|
|
@@ -98,9 +98,9 @@ const httpResponseMiddleware = (opts = {}) => {
|
|
|
98
98
|
statusCode: error.statusCode || 500,
|
|
99
99
|
headers: Object.assign(
|
|
100
100
|
Object.assign({}, options.headers),
|
|
101
|
-
(
|
|
101
|
+
(_a = request.response) === null || _a === void 0
|
|
102
102
|
? void 0
|
|
103
|
-
:
|
|
103
|
+
: _a.headers
|
|
104
104
|
),
|
|
105
105
|
body: Object.assign(
|
|
106
106
|
{
|
|
@@ -3,6 +3,7 @@ import { jwt as jwtConfig } from '../../config';
|
|
|
3
3
|
import { generateUid } from '../../utils';
|
|
4
4
|
import getJwtSecret from './getJwtSecret';
|
|
5
5
|
const sign = (payload, secret, opts) => {
|
|
6
|
+
var _a;
|
|
6
7
|
const jwtSecret = getJwtSecret({
|
|
7
8
|
secret,
|
|
8
9
|
keyid: opts === null || opts === void 0 ? void 0 : opts.keyid,
|
|
@@ -12,8 +13,10 @@ const sign = (payload, secret, opts) => {
|
|
|
12
13
|
(opts === null || opts === void 0 ? void 0 : opts.algorithm) ||
|
|
13
14
|
jwtConfig.algorithm,
|
|
14
15
|
expiresIn:
|
|
15
|
-
(opts === null || opts === void 0 ? void 0 : opts.expiresIn)
|
|
16
|
-
|
|
16
|
+
(_a = opts === null || opts === void 0 ? void 0 : opts.expiresIn) !==
|
|
17
|
+
null && _a !== void 0
|
|
18
|
+
? _a
|
|
19
|
+
: jwtConfig.expiresIn,
|
|
17
20
|
issuer:
|
|
18
21
|
(opts === null || opts === void 0 ? void 0 : opts.issuer) ||
|
|
19
22
|
jwtConfig.issuer,
|
|
@@ -26,5 +26,5 @@ import { ClientOptions } from '../../../types/aws';
|
|
|
26
26
|
* await client.set(key, value);
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
declare const getClient: (clientOpts?: ClientOptions) => Promise<import("ioredis
|
|
29
|
+
declare const getClient: (clientOpts?: ClientOptions) => Promise<import("ioredis").Cluster>;
|
|
30
30
|
export default getClient;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { GetObjectOptions } from '../../services/S3Service/getObject';
|
|
3
2
|
import { ClientOptions } from '../../types/aws';
|
|
4
3
|
/**
|
|
@@ -9,5 +8,5 @@ import { ClientOptions } from '../../types/aws';
|
|
|
9
8
|
* @param clientOpts - Optional client options for the S3 client.
|
|
10
9
|
* @returns A Promise that resolves to the body of the retrieved object.
|
|
11
10
|
*/
|
|
12
|
-
declare const getObject: (key: string, opts?: GetObjectOptions, clientOpts?: ClientOptions) => Promise<Buffer
|
|
11
|
+
declare const getObject: (key: string, opts?: GetObjectOptions, clientOpts?: ClientOptions) => Promise<Buffer<ArrayBufferLike>>;
|
|
13
12
|
export default getObject;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { PutObjectOptions } from '../../services/S3Service/putObject';
|
|
3
2
|
import { ClientOptions } from '../../types/aws';
|
|
4
3
|
declare const putObject: (key: string, file: Buffer | Uint8Array | Blob | string, opts?: PutObjectOptions, clientOpts?: ClientOptions) => Promise<import("@aws-sdk/client-s3").PutObjectCommandOutput>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lesgo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Core framework for lesgo node.js serverless framework.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
},
|
|
178
178
|
"engineStrict": true,
|
|
179
179
|
"engines": {
|
|
180
|
-
"node": ">=
|
|
180
|
+
"node": ">=20.17.0"
|
|
181
181
|
},
|
|
182
182
|
"peerDependencies": {
|
|
183
183
|
"serverless": "^3.0.0"
|