@klarna/nest-lambda-microservice 0.6.0 → 0.7.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ClientProxy, ReadPacket, WritePacket } from '@nestjs/microservices';
|
|
2
|
-
import { PacketId } from '@nestjs/microservices/interfaces/packet.interface';
|
|
1
|
+
import { ClientProxy, PacketId, ReadPacket, WritePacket } from '@nestjs/microservices';
|
|
3
2
|
import { Context } from 'aws-lambda';
|
|
4
3
|
import type { LambdaMicroserviceOptions, OutgoingRequest } from '../interfaces';
|
|
5
4
|
import { EventMapper } from '../lambda';
|
|
@@ -18,4 +17,5 @@ export declare class LambdaMicroserviceClient extends ClientProxy {
|
|
|
18
17
|
protected assignPacketId(packet: ReadPacket): ReadPacket & PacketId;
|
|
19
18
|
protected dispatchEvent<T>(_packet: ReadPacket): Promise<T>;
|
|
20
19
|
protected createResponseCallback(): (incomingResponse: WritePacket) => Promise<void>;
|
|
20
|
+
unwrap<T>(): T;
|
|
21
21
|
}
|
|
@@ -98,5 +98,12 @@ class LambdaMicroserviceClient extends microservices_1.ClientProxy {
|
|
|
98
98
|
callbackFn({ err, response });
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
unwrap() {
|
|
102
|
+
if (!this.isConnected) {
|
|
103
|
+
throw new Error('Not initialized. Please call the "connect" method first.');
|
|
104
|
+
}
|
|
105
|
+
// @ts-expect-error nest client proxy unwrap has a wrong typing
|
|
106
|
+
return this.broker;
|
|
107
|
+
}
|
|
101
108
|
}
|
|
102
109
|
exports.LambdaMicroserviceClient = LambdaMicroserviceClient;
|
|
@@ -23,4 +23,6 @@ export declare class LambdaMicroserviceServer extends Server implements CustomTr
|
|
|
23
23
|
protected trySerializeIncomingRequest(incomingRequest: IncomingRequest): string;
|
|
24
24
|
getHandlerByPattern(messagePattern: unknown): MessageHandler | null;
|
|
25
25
|
performPatternMatch(handlerPatternPart: unknown, messagePatternPart: unknown, isPartialObjectMatchAllowed?: boolean): boolean;
|
|
26
|
+
on<EventKey, EventCallback>(event: EventKey, callback: EventCallback): any;
|
|
27
|
+
unwrap<T>(): T;
|
|
26
28
|
}
|
|
@@ -140,5 +140,12 @@ class LambdaMicroserviceServer extends microservices_1.Server {
|
|
|
140
140
|
}
|
|
141
141
|
return false;
|
|
142
142
|
}
|
|
143
|
+
on(event, callback) {
|
|
144
|
+
throw new Error('Method is not supported for Lambda Microservice client');
|
|
145
|
+
}
|
|
146
|
+
unwrap() {
|
|
147
|
+
// @ts-expect-error nest client proxy unwrap has a wrong typing
|
|
148
|
+
return this.broker;
|
|
149
|
+
}
|
|
143
150
|
}
|
|
144
151
|
exports.LambdaMicroserviceServer = LambdaMicroserviceServer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarna/nest-lambda-microservice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "NestJS based microservice for writing applications that run on AWS Lambda",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,34 +23,34 @@
|
|
|
23
23
|
"prettier:fix": "prettier --write 'src/**/*.ts'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nestjs/common": "
|
|
27
|
-
"@nestjs/core": "
|
|
28
|
-
"@nestjs/microservices": "
|
|
26
|
+
"@nestjs/common": "11.0.10",
|
|
27
|
+
"@nestjs/core": "11.0.10",
|
|
28
|
+
"@nestjs/microservices": "11.0.10",
|
|
29
29
|
"reflect-metadata": "0.2.2",
|
|
30
|
-
"rxjs": "7.8.
|
|
31
|
-
"uuid": "
|
|
30
|
+
"rxjs": "7.8.2",
|
|
31
|
+
"uuid": "11.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@eslint/js": "^9.
|
|
34
|
+
"@eslint/js": "^9.21.0",
|
|
35
35
|
"@jest/globals": "29.7.0",
|
|
36
|
-
"@nestjs/testing": "
|
|
36
|
+
"@nestjs/testing": "11.0.10",
|
|
37
37
|
"@tsconfig/node20": "20.1.4",
|
|
38
|
-
"@types/aws-lambda": "8.10.
|
|
39
|
-
"@types/node": "
|
|
38
|
+
"@types/aws-lambda": "8.10.147",
|
|
39
|
+
"@types/node": "22.13.5",
|
|
40
40
|
"@types/uuid": "10.0.0",
|
|
41
41
|
"class-transformer": "0.5.1",
|
|
42
42
|
"class-validator": "0.14.1",
|
|
43
|
-
"eslint": "9.
|
|
44
|
-
"eslint-config-prettier": "
|
|
45
|
-
"eslint-plugin-jest": "28.
|
|
46
|
-
"eslint-plugin-n": "^17.
|
|
47
|
-
"eslint-plugin-prettier": "5.2.
|
|
43
|
+
"eslint": "9.21.0",
|
|
44
|
+
"eslint-config-prettier": "10.0.1",
|
|
45
|
+
"eslint-plugin-jest": "28.11.0",
|
|
46
|
+
"eslint-plugin-n": "^17.15.1",
|
|
47
|
+
"eslint-plugin-prettier": "5.2.3",
|
|
48
48
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
49
49
|
"jest": "29.7.0",
|
|
50
|
-
"prettier": "3.
|
|
51
|
-
"ts-jest": "29.2.
|
|
52
|
-
"typescript": "5.
|
|
53
|
-
"typescript-eslint": "^8.
|
|
50
|
+
"prettier": "3.5.2",
|
|
51
|
+
"ts-jest": "29.2.6",
|
|
52
|
+
"typescript": "5.7.3",
|
|
53
|
+
"typescript-eslint": "^8.25.0"
|
|
54
54
|
},
|
|
55
55
|
"volta": {
|
|
56
56
|
"node": "20.17.0"
|