@opra/kafka 1.4.2 → 1.4.3
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/cjs/kafka-context.js +8 -0
- package/esm/kafka-context.js +8 -0
- package/package.json +3 -3
- package/types/kafka-context.d.ts +25 -17
package/cjs/kafka-context.js
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KafkaContext = void 0;
|
|
4
4
|
const core_1 = require("@opra/core");
|
|
5
|
+
/**
|
|
6
|
+
* KafkaContext class provides the context for handling Kafka messages.
|
|
7
|
+
* It extends the ExecutionContext and implements the AsyncEventEmitter.
|
|
8
|
+
*/
|
|
5
9
|
class KafkaContext extends core_1.ExecutionContext {
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
* @param init the context options
|
|
13
|
+
*/
|
|
6
14
|
constructor(init) {
|
|
7
15
|
super({
|
|
8
16
|
...init,
|
package/esm/kafka-context.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ExecutionContext } from '@opra/core';
|
|
2
|
+
/**
|
|
3
|
+
* KafkaContext class provides the context for handling Kafka messages.
|
|
4
|
+
* It extends the ExecutionContext and implements the AsyncEventEmitter.
|
|
5
|
+
*/
|
|
2
6
|
export class KafkaContext extends ExecutionContext {
|
|
7
|
+
/**
|
|
8
|
+
* Constructor
|
|
9
|
+
* @param init the context options
|
|
10
|
+
*/
|
|
3
11
|
constructor(init) {
|
|
4
12
|
super({
|
|
5
13
|
...init,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/kafka",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Opra Kafka package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@opra/common": "^1.4.
|
|
9
|
-
"@opra/core": "^1.4.
|
|
8
|
+
"@opra/common": "^1.4.3",
|
|
9
|
+
"@opra/core": "^1.4.3",
|
|
10
10
|
"node-events-async": "^1.0.0",
|
|
11
11
|
"tslib": "^2.8.1",
|
|
12
12
|
"valgen": "^5.12.0"
|
package/types/kafka-context.d.ts
CHANGED
|
@@ -3,23 +3,10 @@ import { ExecutionContext } from '@opra/core';
|
|
|
3
3
|
import type { KafkaMessage } from 'kafkajs';
|
|
4
4
|
import type { AsyncEventEmitter } from 'node-events-async';
|
|
5
5
|
import type { KafkaAdapter } from './kafka-adapter.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
controllerInstance?: any;
|
|
11
|
-
operation?: RpcOperation;
|
|
12
|
-
operationHandler?: Function;
|
|
13
|
-
topic: string;
|
|
14
|
-
partition: number;
|
|
15
|
-
key: any;
|
|
16
|
-
payload: any;
|
|
17
|
-
headers: Record<string, any>;
|
|
18
|
-
rawMessage: KafkaMessage;
|
|
19
|
-
heartbeat(): Promise<void>;
|
|
20
|
-
pause(): () => void;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
6
|
+
/**
|
|
7
|
+
* KafkaContext class provides the context for handling Kafka messages.
|
|
8
|
+
* It extends the ExecutionContext and implements the AsyncEventEmitter.
|
|
9
|
+
*/
|
|
23
10
|
export declare class KafkaContext extends ExecutionContext implements AsyncEventEmitter {
|
|
24
11
|
readonly protocol: OpraSchema.Transport;
|
|
25
12
|
readonly platform: string;
|
|
@@ -36,5 +23,26 @@ export declare class KafkaContext extends ExecutionContext implements AsyncEvent
|
|
|
36
23
|
readonly rawMessage: KafkaMessage;
|
|
37
24
|
readonly heartbeat: () => Promise<void>;
|
|
38
25
|
readonly pause: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Constructor
|
|
28
|
+
* @param init the context options
|
|
29
|
+
*/
|
|
39
30
|
constructor(init: KafkaContext.Initiator);
|
|
40
31
|
}
|
|
32
|
+
export declare namespace KafkaContext {
|
|
33
|
+
interface Initiator extends Omit<ExecutionContext.Initiator, 'document' | 'protocol' | 'documentNode'> {
|
|
34
|
+
adapter: KafkaAdapter;
|
|
35
|
+
controller?: RpcController;
|
|
36
|
+
controllerInstance?: any;
|
|
37
|
+
operation?: RpcOperation;
|
|
38
|
+
operationHandler?: Function;
|
|
39
|
+
topic: string;
|
|
40
|
+
partition: number;
|
|
41
|
+
key: any;
|
|
42
|
+
payload: any;
|
|
43
|
+
headers: Record<string, any>;
|
|
44
|
+
rawMessage: KafkaMessage;
|
|
45
|
+
heartbeat(): Promise<void>;
|
|
46
|
+
pause(): void;
|
|
47
|
+
}
|
|
48
|
+
}
|