kafka-crab-js 0.7.0 → 0.8.1
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/Cargo.toml +1 -1
- package/index.d.ts +8 -8
- package/package.json +10 -10
package/Cargo.toml
CHANGED
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export enum ConsumerResult {
|
|
7
7
|
Ok = 'Ok',
|
|
8
8
|
Retry = 'Retry'
|
|
9
9
|
}
|
|
@@ -26,7 +26,7 @@ export interface RetryStrategy {
|
|
|
26
26
|
offset?: OffsetModel
|
|
27
27
|
configuration?: Record<string, string>
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export enum CommitMode {
|
|
30
30
|
Sync = 0,
|
|
31
31
|
Async = 1
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@ export interface ConsumerConfiguration {
|
|
|
37
37
|
configuration?: Record<string, string>
|
|
38
38
|
fecthMetadataTimeout?: number
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export enum PartitionPosition {
|
|
41
41
|
Beginning = 'Beginning',
|
|
42
42
|
End = 'End',
|
|
43
43
|
Stored = 'Stored'
|
|
@@ -55,7 +55,7 @@ export interface TopicPartitionConfig {
|
|
|
55
55
|
allOffsets?: OffsetModel
|
|
56
56
|
partitionOffset?: Array<PartitionOffset>
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export enum SecurityProtocol {
|
|
59
59
|
Plaintext = 'Plaintext',
|
|
60
60
|
Ssl = 'Ssl',
|
|
61
61
|
SaslPlaintext = 'SaslPlaintext',
|
|
@@ -109,23 +109,23 @@ export interface KafkaCrabError {
|
|
|
109
109
|
code: number
|
|
110
110
|
message: string
|
|
111
111
|
}
|
|
112
|
-
export class KafkaConsumer {
|
|
112
|
+
export declare class KafkaConsumer {
|
|
113
113
|
startConsumer(callback: (error: Error | undefined, result: Payload) => Promise<ConsumerResult | undefined>): Promise<void>
|
|
114
114
|
}
|
|
115
|
-
export class KafkaStreamConsumer {
|
|
115
|
+
export declare class KafkaStreamConsumer {
|
|
116
116
|
subscribe(topicConfigs: string | Array<TopicPartitionConfig>): Promise<void>
|
|
117
117
|
unsubscribe(): void
|
|
118
118
|
seek(topic: string, partition: number, offsetModel: OffsetModel, timeout?: number | undefined | null): void
|
|
119
119
|
recv(): Promise<Message>
|
|
120
120
|
commit(topic: string, partition: number, offset: number, commit: CommitMode): void
|
|
121
121
|
}
|
|
122
|
-
export class KafkaClient {
|
|
122
|
+
export declare class KafkaClient {
|
|
123
123
|
readonly kafkaConfiguration: KafkaConfiguration
|
|
124
124
|
constructor(kafkaConfiguration: KafkaConfiguration)
|
|
125
125
|
createProducer(producerConfiguration: ProducerConfiguration): KafkaProducer
|
|
126
126
|
createConsumer(consumerConfiguration: KafkaConsumerConfiguration): KafkaConsumer
|
|
127
127
|
createStreamConsumer(consumerConfiguration: ConsumerConfiguration): KafkaStreamConsumer
|
|
128
128
|
}
|
|
129
|
-
export class KafkaProducer {
|
|
129
|
+
export declare class KafkaProducer {
|
|
130
130
|
send(producerRecord: ProducerRecord): Promise<Array<RecordMetadata>>
|
|
131
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kafka-crab-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@faker-js/faker": "^8.4.1",
|
|
33
|
-
"@napi-rs/cli": "^2.18.
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"ava": "^6.1.
|
|
33
|
+
"@napi-rs/cli": "^2.18.4",
|
|
34
|
+
"@types/node": "^22.4.1",
|
|
35
|
+
"ava": "^6.1.3",
|
|
36
36
|
"nanoid": "^5.0.7",
|
|
37
37
|
"typescript": "^5.4.5",
|
|
38
|
-
"xo": "^0.
|
|
38
|
+
"xo": "^0.59.3"
|
|
39
39
|
},
|
|
40
40
|
"ava": {
|
|
41
41
|
"timeout": "3m"
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"artifacts": "napi artifacts",
|
|
55
|
-
"build": "napi build --platform --release",
|
|
55
|
+
"build": "napi build --no-const-enum --platform --release",
|
|
56
56
|
"build:debug": "napi build --platform",
|
|
57
57
|
"prepublishOnly": "napi prepublish -t npm",
|
|
58
58
|
"test": "ava",
|
|
59
59
|
"universal": "napi universal",
|
|
60
60
|
"version": "napi version"
|
|
61
61
|
},
|
|
62
|
-
"packageManager": "pnpm@9.
|
|
62
|
+
"packageManager": "pnpm@9.7.1",
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"kafka-crab-js-darwin-arm64": "0.
|
|
65
|
-
"kafka-crab-js-darwin-x64": "0.
|
|
66
|
-
"kafka-crab-js-linux-x64-gnu": "0.
|
|
64
|
+
"kafka-crab-js-darwin-arm64": "0.8.1",
|
|
65
|
+
"kafka-crab-js-darwin-x64": "0.8.1",
|
|
66
|
+
"kafka-crab-js-linux-x64-gnu": "0.8.1"
|
|
67
67
|
}
|
|
68
68
|
}
|