kafka-crab-js 1.3.0 → 1.4.0-beta
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/README.md +29 -1
- package/index.js +1 -5
- package/js-binding.d.ts +99 -89
- package/js-binding.js +351 -289
- package/kafka-client.js +2 -1
- package/kafka-stream-readable.d.ts +4 -0
- package/kafka-stream-readable.js +6 -0
- package/package.json +27 -26
package/README.md
CHANGED
|
@@ -8,6 +8,34 @@ A lightweight, flexible, and reliable Kafka client for JavaScript/TypeScript. It
|
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What's New in Version 1.4.x
|
|
14
|
+
|
|
15
|
+
### Major Updates:
|
|
16
|
+
1. **Enums Replaced by Unions**:
|
|
17
|
+
- Removed enums such as `KafkaEventName`, `PartitionPosition`, `CommitMode`, and `SecurityProtocol`.
|
|
18
|
+
- These enums were replaced with union types for better flexibility and usability.
|
|
19
|
+
|
|
20
|
+
2. **Improved TypeScript Definitions**:
|
|
21
|
+
- Enhanced TypeScript definitions for better clarity and usability:
|
|
22
|
+
- Changes in `KafkaClientConfig`, `KafkaConsumer`, and `KafkaProducer`.
|
|
23
|
+
|
|
24
|
+
3. **CI/CD Enhancements**:
|
|
25
|
+
- Updated GitHub Actions workflow:
|
|
26
|
+
- Added matrix builds for better coverage across platforms (e.g., `x86_64`, `aarch64` on Linux and macOS).
|
|
27
|
+
|
|
28
|
+
4. **Updated Dependencies**:
|
|
29
|
+
- Upgraded dependencies to their latest versions for improved performance and security.
|
|
30
|
+
|
|
31
|
+
5. **New Tests and Examples**:
|
|
32
|
+
- Added new integration tests and examples for Kafka to ensure reliability.
|
|
33
|
+
|
|
34
|
+
6. **Enhanced Documentation**:
|
|
35
|
+
- Comprehensive API reference and usage examples added to the `docs/wiki` directory.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
11
39
|
## Features
|
|
12
40
|
|
|
13
41
|
- 🦀 Simple and intuitive API
|
|
@@ -360,4 +388,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
360
388
|
|
|
361
389
|
[](https://www.rust-lang.org/)
|
|
362
390
|
|
|
363
|
-
</div>
|
|
391
|
+
</div>
|
package/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KafkaStreamReadable = exports.KafkaClient = exports.
|
|
3
|
+
exports.KafkaStreamReadable = exports.KafkaClient = exports.KafkaProducer = exports.KafkaConsumer = exports.KafkaClientConfig = void 0;
|
|
4
4
|
var js_binding_1 = require("./js-binding");
|
|
5
|
-
Object.defineProperty(exports, "CommitMode", { enumerable: true, get: function () { return js_binding_1.CommitMode; } });
|
|
6
5
|
Object.defineProperty(exports, "KafkaClientConfig", { enumerable: true, get: function () { return js_binding_1.KafkaClientConfig; } });
|
|
7
6
|
Object.defineProperty(exports, "KafkaConsumer", { enumerable: true, get: function () { return js_binding_1.KafkaConsumer; } });
|
|
8
|
-
Object.defineProperty(exports, "KafkaEventName", { enumerable: true, get: function () { return js_binding_1.KafkaEventName; } });
|
|
9
7
|
Object.defineProperty(exports, "KafkaProducer", { enumerable: true, get: function () { return js_binding_1.KafkaProducer; } });
|
|
10
|
-
Object.defineProperty(exports, "PartitionPosition", { enumerable: true, get: function () { return js_binding_1.PartitionPosition; } });
|
|
11
|
-
Object.defineProperty(exports, "SecurityProtocol", { enumerable: true, get: function () { return js_binding_1.SecurityProtocol; } });
|
|
12
8
|
var kafka_client_1 = require("./kafka-client");
|
|
13
9
|
Object.defineProperty(exports, "KafkaClient", { enumerable: true, get: function () { return kafka_client_1.KafkaClient; } });
|
|
14
10
|
var kafka_stream_readable_1 = require("./kafka-stream-readable");
|
package/js-binding.d.ts
CHANGED
|
@@ -1,70 +1,42 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
1
|
/* auto-generated by NAPI-RS */
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export enum KafkaEventName {
|
|
12
|
-
PreRebalance = 'PreRebalance',
|
|
13
|
-
PostRebalance = 'PostRebalance',
|
|
14
|
-
CommitCallback = 'CommitCallback'
|
|
15
|
-
}
|
|
16
|
-
export interface KafkaEvent {
|
|
17
|
-
name: KafkaEventName
|
|
18
|
-
payload: KafkaEventPayload
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export declare class KafkaClientConfig {
|
|
4
|
+
constructor(kafkaConfiguration: KafkaConfiguration)
|
|
5
|
+
get configuration(): KafkaConfiguration
|
|
6
|
+
createProducer(producerConfiguration: ProducerConfiguration): KafkaProducer
|
|
7
|
+
createConsumer(consumerConfiguration: ConsumerConfiguration): KafkaConsumer
|
|
19
8
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
|
|
10
|
+
export declare class KafkaConsumer {
|
|
11
|
+
onEvents(callback: (error: Error | undefined, event: KafkaEvent) => void): void
|
|
12
|
+
subscribe(topicConfigs: string | Array<TopicPartitionConfig>): Promise<void>
|
|
13
|
+
pause(): void
|
|
14
|
+
resume(): void
|
|
15
|
+
unsubscribe(): void
|
|
16
|
+
disconnect(): Promise<void>
|
|
17
|
+
seek(topic: string, partition: number, offsetModel: OffsetModel, timeout?: number | undefined | null): void
|
|
18
|
+
assignment(): Array<TopicPartition>
|
|
19
|
+
recv(): Promise<Message | null>
|
|
20
|
+
commit(topic: string, partition: number, offset: number, commit: CommitMode): void
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
|
|
23
|
+
export declare class KafkaProducer {
|
|
24
|
+
inFlightCount(): number
|
|
25
|
+
flush(): Promise<Array<RecordMetadata>>
|
|
26
|
+
send(producerRecord: ProducerRecord): Promise<Array<RecordMetadata>>
|
|
31
27
|
}
|
|
28
|
+
|
|
29
|
+
export type CommitMode = 'Sync'|
|
|
30
|
+
'Async';
|
|
31
|
+
|
|
32
32
|
export interface ConsumerConfiguration {
|
|
33
33
|
groupId: string
|
|
34
34
|
createTopic?: boolean
|
|
35
35
|
enableAutoCommit?: boolean
|
|
36
36
|
configuration?: Record<string, string>
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
export enum PartitionPosition {
|
|
40
|
-
Beginning = 'Beginning',
|
|
41
|
-
End = 'End',
|
|
42
|
-
Stored = 'Stored',
|
|
43
|
-
Invalid = 'Invalid'
|
|
44
|
-
}
|
|
45
|
-
export interface OffsetModel {
|
|
46
|
-
offset?: number
|
|
47
|
-
position?: PartitionPosition
|
|
48
|
-
}
|
|
49
|
-
export interface PartitionOffset {
|
|
50
|
-
partition: number
|
|
51
|
-
offset: OffsetModel
|
|
52
|
-
}
|
|
53
|
-
export interface TopicPartitionConfig {
|
|
54
|
-
topic: string
|
|
55
|
-
allOffsets?: OffsetModel
|
|
56
|
-
partitionOffset?: Array<PartitionOffset>
|
|
57
|
-
}
|
|
58
|
-
export interface TopicPartition {
|
|
59
|
-
topic: string
|
|
60
|
-
partitionOffset: Array<PartitionOffset>
|
|
61
|
-
}
|
|
62
|
-
export enum SecurityProtocol {
|
|
63
|
-
Plaintext = 'Plaintext',
|
|
64
|
-
Ssl = 'Ssl',
|
|
65
|
-
SaslPlaintext = 'SaslPlaintext',
|
|
66
|
-
SaslSsl = 'SaslSsl'
|
|
37
|
+
fetchMetadataTimeout?: number
|
|
67
38
|
}
|
|
39
|
+
|
|
68
40
|
export interface KafkaConfiguration {
|
|
69
41
|
brokers: string
|
|
70
42
|
clientId: string
|
|
@@ -73,6 +45,27 @@ export interface KafkaConfiguration {
|
|
|
73
45
|
logLevel?: string
|
|
74
46
|
brokerAddressFamily?: string
|
|
75
47
|
}
|
|
48
|
+
|
|
49
|
+
export interface KafkaCrabError {
|
|
50
|
+
code: number
|
|
51
|
+
message: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface KafkaEvent {
|
|
55
|
+
name: KafkaEventName
|
|
56
|
+
payload: KafkaEventPayload
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type KafkaEventName = 'PreRebalance'|
|
|
60
|
+
'PostRebalance'|
|
|
61
|
+
'CommitCallback';
|
|
62
|
+
|
|
63
|
+
export interface KafkaEventPayload {
|
|
64
|
+
action?: string
|
|
65
|
+
tpl: Array<TopicPartition>
|
|
66
|
+
error?: string
|
|
67
|
+
}
|
|
68
|
+
|
|
76
69
|
export interface Message {
|
|
77
70
|
payload: Buffer
|
|
78
71
|
key?: Buffer
|
|
@@ -81,51 +74,68 @@ export interface Message {
|
|
|
81
74
|
partition: number
|
|
82
75
|
offset: number
|
|
83
76
|
}
|
|
84
|
-
|
|
85
|
-
topic: string
|
|
86
|
-
partition: number
|
|
87
|
-
offset: number
|
|
88
|
-
error?: KafkaCrabError
|
|
89
|
-
}
|
|
77
|
+
|
|
90
78
|
export interface MessageProducer {
|
|
91
79
|
payload: Buffer
|
|
92
80
|
key?: Buffer
|
|
93
81
|
headers?: Record<string, Buffer>
|
|
94
82
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
83
|
+
|
|
84
|
+
export interface OffsetModel {
|
|
85
|
+
offset?: number
|
|
86
|
+
position?: PartitionPosition
|
|
98
87
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
|
|
89
|
+
export interface PartitionOffset {
|
|
90
|
+
partition: number
|
|
91
|
+
offset: OffsetModel
|
|
102
92
|
}
|
|
93
|
+
|
|
94
|
+
export type PartitionPosition = 'Beginning'|
|
|
95
|
+
'End'|
|
|
96
|
+
'Stored'|
|
|
97
|
+
'Invalid';
|
|
98
|
+
|
|
103
99
|
export interface ProducerConfiguration {
|
|
104
100
|
queueTimeout?: number
|
|
105
101
|
thrownOnError?: boolean
|
|
106
102
|
autoFlush?: boolean
|
|
107
103
|
configuration?: Record<string, string>
|
|
108
104
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
resume(): void
|
|
114
|
-
unsubscribe(): void
|
|
115
|
-
disconnect(): Promise<void>
|
|
116
|
-
seek(topic: string, partition: number, offsetModel: OffsetModel, timeout?: number | undefined | null): void
|
|
117
|
-
assignment(): Array<TopicPartition>
|
|
118
|
-
recv(): Promise<Message | null>
|
|
119
|
-
commit(topic: string, partition: number, offset: number, commit: CommitMode): void
|
|
105
|
+
|
|
106
|
+
export interface ProducerRecord {
|
|
107
|
+
topic: string
|
|
108
|
+
messages: Array<MessageProducer>
|
|
120
109
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
|
|
111
|
+
export interface RecordMetadata {
|
|
112
|
+
topic: string
|
|
113
|
+
partition: number
|
|
114
|
+
offset: number
|
|
115
|
+
error?: KafkaCrabError
|
|
126
116
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
117
|
+
|
|
118
|
+
export interface RetryStrategy {
|
|
119
|
+
retries: number
|
|
120
|
+
retryTopic?: string
|
|
121
|
+
dqlTopic?: string
|
|
122
|
+
pauseConsumerDuration?: number
|
|
123
|
+
offset?: OffsetModel
|
|
124
|
+
configuration?: Record<string, string>
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type SecurityProtocol = 'Plaintext'|
|
|
128
|
+
'Ssl'|
|
|
129
|
+
'SaslPlaintext'|
|
|
130
|
+
'SaslSsl';
|
|
131
|
+
|
|
132
|
+
export interface TopicPartition {
|
|
133
|
+
topic: string
|
|
134
|
+
partitionOffset: Array<PartitionOffset>
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface TopicPartitionConfig {
|
|
138
|
+
topic: string
|
|
139
|
+
allOffsets?: OffsetModel
|
|
140
|
+
partitionOffset?: Array<PartitionOffset>
|
|
131
141
|
}
|
package/js-binding.js
CHANGED
|
@@ -1,321 +1,383 @@
|
|
|
1
|
-
|
|
1
|
+
// prettier-ignore
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// @ts-nocheck
|
|
5
4
|
/* auto-generated by NAPI-RS */
|
|
6
5
|
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const { platform, arch } = process
|
|
6
|
+
const { createRequire } = require('node:module')
|
|
7
|
+
require = createRequire(__filename)
|
|
11
8
|
|
|
9
|
+
const { readFileSync } = require('node:fs')
|
|
12
10
|
let nativeBinding = null
|
|
13
|
-
|
|
14
|
-
let loadError = null
|
|
11
|
+
const loadErrors = []
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
13
|
+
const isMusl = () => {
|
|
14
|
+
let musl = false
|
|
15
|
+
if (process.platform === 'linux') {
|
|
16
|
+
musl = isMuslFromFilesystem()
|
|
17
|
+
if (musl === null) {
|
|
18
|
+
musl = isMuslFromReport()
|
|
19
|
+
}
|
|
20
|
+
if (musl === null) {
|
|
21
|
+
musl = isMuslFromChildProcess()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return musl
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
|
|
28
|
+
|
|
29
|
+
const isMuslFromFilesystem = () => {
|
|
30
|
+
try {
|
|
31
|
+
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
|
|
32
|
+
} catch {
|
|
33
|
+
return null
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const isMuslFromReport = () => {
|
|
38
|
+
let report = null
|
|
39
|
+
if (typeof process.report?.getReport === 'function') {
|
|
40
|
+
process.report.excludeNetwork = true
|
|
41
|
+
report = process.report.getReport()
|
|
42
|
+
}
|
|
43
|
+
if (!report) {
|
|
44
|
+
return null
|
|
45
|
+
}
|
|
46
|
+
if (report.header && report.header.glibcVersionRuntime) {
|
|
47
|
+
return false
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
50
|
+
if (report.sharedObjects.some(isFileMusl)) {
|
|
23
51
|
return true
|
|
24
52
|
}
|
|
25
|
-
} else {
|
|
26
|
-
const { glibcVersionRuntime } = process.report.getReport().header
|
|
27
|
-
return !glibcVersionRuntime
|
|
28
53
|
}
|
|
54
|
+
return false
|
|
29
55
|
}
|
|
30
56
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
const isMuslFromChildProcess = () => {
|
|
58
|
+
try {
|
|
59
|
+
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
|
|
60
|
+
} catch (e) {
|
|
61
|
+
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
62
|
+
return false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function requireNative() {
|
|
67
|
+
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
68
|
+
try {
|
|
69
|
+
nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
70
|
+
} catch (err) {
|
|
71
|
+
loadErrors.push(err);
|
|
72
|
+
}
|
|
73
|
+
} else if (process.platform === 'android') {
|
|
74
|
+
if (process.arch === 'arm64') {
|
|
75
|
+
try {
|
|
76
|
+
return require('./kafka-crab-js.android-arm64.node')
|
|
77
|
+
} catch (e) {
|
|
78
|
+
loadErrors.push(e)
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
return require('kafka-crab-js-android-arm64')
|
|
82
|
+
} catch (e) {
|
|
83
|
+
loadErrors.push(e)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
} else if (process.arch === 'arm') {
|
|
87
|
+
try {
|
|
88
|
+
return require('./kafka-crab-js.android-arm-eabi.node')
|
|
89
|
+
} catch (e) {
|
|
90
|
+
loadErrors.push(e)
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
return require('kafka-crab-js-android-arm-eabi')
|
|
94
|
+
} catch (e) {
|
|
95
|
+
loadErrors.push(e)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
} else {
|
|
99
|
+
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
|
100
|
+
}
|
|
101
|
+
} else if (process.platform === 'win32') {
|
|
102
|
+
if (process.arch === 'x64') {
|
|
103
|
+
try {
|
|
104
|
+
return require('./kafka-crab-js.win32-x64-msvc.node')
|
|
105
|
+
} catch (e) {
|
|
106
|
+
loadErrors.push(e)
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
return require('kafka-crab-js-win32-x64-msvc')
|
|
110
|
+
} catch (e) {
|
|
111
|
+
loadErrors.push(e)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
} else if (process.arch === 'ia32') {
|
|
115
|
+
try {
|
|
116
|
+
return require('./kafka-crab-js.win32-ia32-msvc.node')
|
|
117
|
+
} catch (e) {
|
|
118
|
+
loadErrors.push(e)
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
return require('kafka-crab-js-win32-ia32-msvc')
|
|
122
|
+
} catch (e) {
|
|
123
|
+
loadErrors.push(e)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
} else if (process.arch === 'arm64') {
|
|
127
|
+
try {
|
|
128
|
+
return require('./kafka-crab-js.win32-arm64-msvc.node')
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadErrors.push(e)
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
return require('kafka-crab-js-win32-arm64-msvc')
|
|
134
|
+
} catch (e) {
|
|
135
|
+
loadErrors.push(e)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
} else {
|
|
139
|
+
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
|
140
|
+
}
|
|
141
|
+
} else if (process.platform === 'darwin') {
|
|
142
|
+
try {
|
|
143
|
+
return require('./kafka-crab-js.darwin-universal.node')
|
|
144
|
+
} catch (e) {
|
|
145
|
+
loadErrors.push(e)
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
return require('kafka-crab-js-darwin-universal')
|
|
149
|
+
} catch (e) {
|
|
150
|
+
loadErrors.push(e)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (process.arch === 'x64') {
|
|
154
|
+
try {
|
|
155
|
+
return require('./kafka-crab-js.darwin-x64.node')
|
|
156
|
+
} catch (e) {
|
|
157
|
+
loadErrors.push(e)
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
return require('kafka-crab-js-darwin-x64')
|
|
161
|
+
} catch (e) {
|
|
162
|
+
loadErrors.push(e)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
} else if (process.arch === 'arm64') {
|
|
166
|
+
try {
|
|
167
|
+
return require('./kafka-crab-js.darwin-arm64.node')
|
|
168
|
+
} catch (e) {
|
|
169
|
+
loadErrors.push(e)
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
return require('kafka-crab-js-darwin-arm64')
|
|
173
|
+
} catch (e) {
|
|
174
|
+
loadErrors.push(e)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
} else {
|
|
178
|
+
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
179
|
+
}
|
|
180
|
+
} else if (process.platform === 'freebsd') {
|
|
181
|
+
if (process.arch === 'x64') {
|
|
182
|
+
try {
|
|
183
|
+
return require('./kafka-crab-js.freebsd-x64.node')
|
|
184
|
+
} catch (e) {
|
|
185
|
+
loadErrors.push(e)
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
return require('kafka-crab-js-freebsd-x64')
|
|
189
|
+
} catch (e) {
|
|
190
|
+
loadErrors.push(e)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
} else if (process.arch === 'arm64') {
|
|
194
|
+
try {
|
|
195
|
+
return require('./kafka-crab-js.freebsd-arm64.node')
|
|
196
|
+
} catch (e) {
|
|
197
|
+
loadErrors.push(e)
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
return require('kafka-crab-js-freebsd-arm64')
|
|
201
|
+
} catch (e) {
|
|
202
|
+
loadErrors.push(e)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
} else {
|
|
206
|
+
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
|
207
|
+
}
|
|
208
|
+
} else if (process.platform === 'linux') {
|
|
209
|
+
if (process.arch === 'x64') {
|
|
210
|
+
if (isMusl()) {
|
|
36
211
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
212
|
+
return require('./kafka-crab-js.linux-x64-musl.node')
|
|
213
|
+
} catch (e) {
|
|
214
|
+
loadErrors.push(e)
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
return require('kafka-crab-js-linux-x64-musl')
|
|
218
|
+
} catch (e) {
|
|
219
|
+
loadErrors.push(e)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
} else {
|
|
48
223
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
case 'win32':
|
|
63
|
-
switch (arch) {
|
|
64
|
-
case 'x64':
|
|
65
|
-
localFileExisted = existsSync(
|
|
66
|
-
join(__dirname, 'kafka-crab-js.win32-x64-msvc.node')
|
|
67
|
-
)
|
|
224
|
+
return require('./kafka-crab-js.linux-x64-gnu.node')
|
|
225
|
+
} catch (e) {
|
|
226
|
+
loadErrors.push(e)
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
return require('kafka-crab-js-linux-x64-gnu')
|
|
230
|
+
} catch (e) {
|
|
231
|
+
loadErrors.push(e)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
} else if (process.arch === 'arm64') {
|
|
236
|
+
if (isMusl()) {
|
|
68
237
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
join(__dirname, 'kafka-crab-js.win32-ia32-msvc.node')
|
|
81
|
-
)
|
|
238
|
+
return require('./kafka-crab-js.linux-arm64-musl.node')
|
|
239
|
+
} catch (e) {
|
|
240
|
+
loadErrors.push(e)
|
|
241
|
+
}
|
|
242
|
+
try {
|
|
243
|
+
return require('kafka-crab-js-linux-arm64-musl')
|
|
244
|
+
} catch (e) {
|
|
245
|
+
loadErrors.push(e)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
} else {
|
|
82
249
|
try {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
250
|
+
return require('./kafka-crab-js.linux-arm64-gnu.node')
|
|
251
|
+
} catch (e) {
|
|
252
|
+
loadErrors.push(e)
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
return require('kafka-crab-js-linux-arm64-gnu')
|
|
256
|
+
} catch (e) {
|
|
257
|
+
loadErrors.push(e)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
}
|
|
261
|
+
} else if (process.arch === 'arm') {
|
|
262
|
+
if (isMusl()) {
|
|
96
263
|
try {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
108
|
-
}
|
|
109
|
-
break
|
|
110
|
-
case 'darwin':
|
|
111
|
-
localFileExisted = existsSync(join(__dirname, 'kafka-crab-js.darwin-universal.node'))
|
|
112
|
-
try {
|
|
113
|
-
if (localFileExisted) {
|
|
114
|
-
nativeBinding = require('./kafka-crab-js.darwin-universal.node')
|
|
264
|
+
return require('./kafka-crab-js.linux-arm-musleabihf.node')
|
|
265
|
+
} catch (e) {
|
|
266
|
+
loadErrors.push(e)
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
return require('kafka-crab-js-linux-arm-musleabihf')
|
|
270
|
+
} catch (e) {
|
|
271
|
+
loadErrors.push(e)
|
|
272
|
+
}
|
|
273
|
+
|
|
115
274
|
} else {
|
|
116
|
-
|
|
275
|
+
try {
|
|
276
|
+
return require('./kafka-crab-js.linux-arm-gnueabihf.node')
|
|
277
|
+
} catch (e) {
|
|
278
|
+
loadErrors.push(e)
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
return require('kafka-crab-js-linux-arm-gnueabihf')
|
|
282
|
+
} catch (e) {
|
|
283
|
+
loadErrors.push(e)
|
|
117
284
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
localFileExisted = existsSync(join(__dirname, 'kafka-crab-js.darwin-x64.node'))
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
} else if (process.arch === 'riscv64') {
|
|
288
|
+
if (isMusl()) {
|
|
123
289
|
try {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
join(__dirname, 'kafka-crab-js.darwin-arm64.node')
|
|
136
|
-
)
|
|
290
|
+
return require('./kafka-crab-js.linux-riscv64-musl.node')
|
|
291
|
+
} catch (e) {
|
|
292
|
+
loadErrors.push(e)
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
return require('kafka-crab-js-linux-riscv64-musl')
|
|
296
|
+
} catch (e) {
|
|
297
|
+
loadErrors.push(e)
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
} else {
|
|
137
301
|
try {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
302
|
+
return require('./kafka-crab-js.linux-riscv64-gnu.node')
|
|
303
|
+
} catch (e) {
|
|
304
|
+
loadErrors.push(e)
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
return require('kafka-crab-js-linux-riscv64-gnu')
|
|
308
|
+
} catch (e) {
|
|
309
|
+
loadErrors.push(e)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
} else if (process.arch === 'ppc64') {
|
|
314
|
+
try {
|
|
315
|
+
return require('./kafka-crab-js.linux-ppc64-gnu.node')
|
|
316
|
+
} catch (e) {
|
|
317
|
+
loadErrors.push(e)
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
return require('kafka-crab-js-linux-ppc64-gnu')
|
|
321
|
+
} catch (e) {
|
|
322
|
+
loadErrors.push(e)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
} else if (process.arch === 's390x') {
|
|
326
|
+
try {
|
|
327
|
+
return require('./kafka-crab-js.linux-s390x-gnu.node')
|
|
328
|
+
} catch (e) {
|
|
329
|
+
loadErrors.push(e)
|
|
330
|
+
}
|
|
331
|
+
try {
|
|
332
|
+
return require('kafka-crab-js-linux-s390x-gnu')
|
|
333
|
+
} catch (e) {
|
|
334
|
+
loadErrors.push(e)
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
} else {
|
|
338
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
|
149
339
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
340
|
+
} else {
|
|
341
|
+
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
nativeBinding = requireNative()
|
|
346
|
+
|
|
347
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
348
|
+
try {
|
|
349
|
+
nativeBinding = require('./kafka-crab-js.wasi.cjs')
|
|
350
|
+
} catch (err) {
|
|
351
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
352
|
+
loadErrors.push(err)
|
|
154
353
|
}
|
|
155
|
-
|
|
354
|
+
}
|
|
355
|
+
if (!nativeBinding) {
|
|
156
356
|
try {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
357
|
+
nativeBinding = require('kafka-crab-js-wasm32-wasi')
|
|
358
|
+
} catch (err) {
|
|
359
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
360
|
+
loadErrors.push(err)
|
|
161
361
|
}
|
|
162
|
-
} catch (e) {
|
|
163
|
-
loadError = e
|
|
164
|
-
}
|
|
165
|
-
break
|
|
166
|
-
case 'linux':
|
|
167
|
-
switch (arch) {
|
|
168
|
-
case 'x64':
|
|
169
|
-
if (isMusl()) {
|
|
170
|
-
localFileExisted = existsSync(
|
|
171
|
-
join(__dirname, 'kafka-crab-js.linux-x64-musl.node')
|
|
172
|
-
)
|
|
173
|
-
try {
|
|
174
|
-
if (localFileExisted) {
|
|
175
|
-
nativeBinding = require('./kafka-crab-js.linux-x64-musl.node')
|
|
176
|
-
} else {
|
|
177
|
-
nativeBinding = require('kafka-crab-js-linux-x64-musl')
|
|
178
|
-
}
|
|
179
|
-
} catch (e) {
|
|
180
|
-
loadError = e
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
localFileExisted = existsSync(
|
|
184
|
-
join(__dirname, 'kafka-crab-js.linux-x64-gnu.node')
|
|
185
|
-
)
|
|
186
|
-
try {
|
|
187
|
-
if (localFileExisted) {
|
|
188
|
-
nativeBinding = require('./kafka-crab-js.linux-x64-gnu.node')
|
|
189
|
-
} else {
|
|
190
|
-
nativeBinding = require('kafka-crab-js-linux-x64-gnu')
|
|
191
|
-
}
|
|
192
|
-
} catch (e) {
|
|
193
|
-
loadError = e
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
break
|
|
197
|
-
case 'arm64':
|
|
198
|
-
if (isMusl()) {
|
|
199
|
-
localFileExisted = existsSync(
|
|
200
|
-
join(__dirname, 'kafka-crab-js.linux-arm64-musl.node')
|
|
201
|
-
)
|
|
202
|
-
try {
|
|
203
|
-
if (localFileExisted) {
|
|
204
|
-
nativeBinding = require('./kafka-crab-js.linux-arm64-musl.node')
|
|
205
|
-
} else {
|
|
206
|
-
nativeBinding = require('kafka-crab-js-linux-arm64-musl')
|
|
207
|
-
}
|
|
208
|
-
} catch (e) {
|
|
209
|
-
loadError = e
|
|
210
|
-
}
|
|
211
|
-
} else {
|
|
212
|
-
localFileExisted = existsSync(
|
|
213
|
-
join(__dirname, 'kafka-crab-js.linux-arm64-gnu.node')
|
|
214
|
-
)
|
|
215
|
-
try {
|
|
216
|
-
if (localFileExisted) {
|
|
217
|
-
nativeBinding = require('./kafka-crab-js.linux-arm64-gnu.node')
|
|
218
|
-
} else {
|
|
219
|
-
nativeBinding = require('kafka-crab-js-linux-arm64-gnu')
|
|
220
|
-
}
|
|
221
|
-
} catch (e) {
|
|
222
|
-
loadError = e
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
break
|
|
226
|
-
case 'arm':
|
|
227
|
-
if (isMusl()) {
|
|
228
|
-
localFileExisted = existsSync(
|
|
229
|
-
join(__dirname, 'kafka-crab-js.linux-arm-musleabihf.node')
|
|
230
|
-
)
|
|
231
|
-
try {
|
|
232
|
-
if (localFileExisted) {
|
|
233
|
-
nativeBinding = require('./kafka-crab-js.linux-arm-musleabihf.node')
|
|
234
|
-
} else {
|
|
235
|
-
nativeBinding = require('kafka-crab-js-linux-arm-musleabihf')
|
|
236
|
-
}
|
|
237
|
-
} catch (e) {
|
|
238
|
-
loadError = e
|
|
239
|
-
}
|
|
240
|
-
} else {
|
|
241
|
-
localFileExisted = existsSync(
|
|
242
|
-
join(__dirname, 'kafka-crab-js.linux-arm-gnueabihf.node')
|
|
243
|
-
)
|
|
244
|
-
try {
|
|
245
|
-
if (localFileExisted) {
|
|
246
|
-
nativeBinding = require('./kafka-crab-js.linux-arm-gnueabihf.node')
|
|
247
|
-
} else {
|
|
248
|
-
nativeBinding = require('kafka-crab-js-linux-arm-gnueabihf')
|
|
249
|
-
}
|
|
250
|
-
} catch (e) {
|
|
251
|
-
loadError = e
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
break
|
|
255
|
-
case 'riscv64':
|
|
256
|
-
if (isMusl()) {
|
|
257
|
-
localFileExisted = existsSync(
|
|
258
|
-
join(__dirname, 'kafka-crab-js.linux-riscv64-musl.node')
|
|
259
|
-
)
|
|
260
|
-
try {
|
|
261
|
-
if (localFileExisted) {
|
|
262
|
-
nativeBinding = require('./kafka-crab-js.linux-riscv64-musl.node')
|
|
263
|
-
} else {
|
|
264
|
-
nativeBinding = require('kafka-crab-js-linux-riscv64-musl')
|
|
265
|
-
}
|
|
266
|
-
} catch (e) {
|
|
267
|
-
loadError = e
|
|
268
|
-
}
|
|
269
|
-
} else {
|
|
270
|
-
localFileExisted = existsSync(
|
|
271
|
-
join(__dirname, 'kafka-crab-js.linux-riscv64-gnu.node')
|
|
272
|
-
)
|
|
273
|
-
try {
|
|
274
|
-
if (localFileExisted) {
|
|
275
|
-
nativeBinding = require('./kafka-crab-js.linux-riscv64-gnu.node')
|
|
276
|
-
} else {
|
|
277
|
-
nativeBinding = require('kafka-crab-js-linux-riscv64-gnu')
|
|
278
|
-
}
|
|
279
|
-
} catch (e) {
|
|
280
|
-
loadError = e
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
break
|
|
284
|
-
case 's390x':
|
|
285
|
-
localFileExisted = existsSync(
|
|
286
|
-
join(__dirname, 'kafka-crab-js.linux-s390x-gnu.node')
|
|
287
|
-
)
|
|
288
|
-
try {
|
|
289
|
-
if (localFileExisted) {
|
|
290
|
-
nativeBinding = require('./kafka-crab-js.linux-s390x-gnu.node')
|
|
291
|
-
} else {
|
|
292
|
-
nativeBinding = require('kafka-crab-js-linux-s390x-gnu')
|
|
293
|
-
}
|
|
294
|
-
} catch (e) {
|
|
295
|
-
loadError = e
|
|
296
|
-
}
|
|
297
|
-
break
|
|
298
|
-
default:
|
|
299
|
-
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
300
362
|
}
|
|
301
|
-
|
|
302
|
-
default:
|
|
303
|
-
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
363
|
+
}
|
|
304
364
|
}
|
|
305
365
|
|
|
306
366
|
if (!nativeBinding) {
|
|
307
|
-
if (
|
|
308
|
-
|
|
367
|
+
if (loadErrors.length > 0) {
|
|
368
|
+
// TODO Link to documentation with potential fixes
|
|
369
|
+
// - The package owner could build/publish bindings for this arch
|
|
370
|
+
// - The user may need to bundle the correct files
|
|
371
|
+
// - The user may need to re-install node_modules to get new packages
|
|
372
|
+
throw new Error('Failed to load native binding', { cause: loadErrors })
|
|
309
373
|
}
|
|
310
374
|
throw new Error(`Failed to load native binding`)
|
|
311
375
|
}
|
|
312
376
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
module.exports.
|
|
316
|
-
module.exports.
|
|
317
|
-
module.exports.
|
|
318
|
-
module.exports.PartitionPosition = PartitionPosition
|
|
319
|
-
module.exports.SecurityProtocol = SecurityProtocol
|
|
320
|
-
module.exports.KafkaClientConfig = KafkaClientConfig
|
|
321
|
-
module.exports.KafkaProducer = KafkaProducer
|
|
377
|
+
module.exports.KafkaClientConfig = nativeBinding.KafkaClientConfig
|
|
378
|
+
module.exports.KafkaConsumer = nativeBinding.KafkaConsumer
|
|
379
|
+
module.exports.KafkaProducer = nativeBinding.KafkaProducer
|
|
380
|
+
module.exports.CommitMode = nativeBinding.CommitMode
|
|
381
|
+
module.exports.KafkaEventName = nativeBinding.KafkaEventName
|
|
382
|
+
module.exports.PartitionPosition = nativeBinding.PartitionPosition
|
|
383
|
+
module.exports.SecurityProtocol = nativeBinding.SecurityProtocol
|
package/kafka-client.js
CHANGED
|
@@ -42,7 +42,8 @@ class KafkaClient {
|
|
|
42
42
|
* @throws {Error} If the configuration is invalid
|
|
43
43
|
*/
|
|
44
44
|
createStreamConsumer(consumerConfiguration) {
|
|
45
|
-
|
|
45
|
+
const consumer = this.kafkaClientConfig.createConsumer(consumerConfiguration);
|
|
46
|
+
return new kafka_stream_readable_1.KafkaStreamReadable(consumer);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
exports.KafkaClient = KafkaClient;
|
|
@@ -21,6 +21,10 @@ export declare class KafkaStreamReadable extends Readable {
|
|
|
21
21
|
* Unsubscribe from topics
|
|
22
22
|
*/
|
|
23
23
|
unsubscribe(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Disconnects the Kafka consumer
|
|
26
|
+
*/
|
|
27
|
+
disconnect(): Promise<void>;
|
|
24
28
|
/**
|
|
25
29
|
* Returns the raw Kafka consumer
|
|
26
30
|
* @returns {KafkaConsumer} The Kafka consumer instance
|
package/kafka-stream-readable.js
CHANGED
|
@@ -39,6 +39,12 @@ class KafkaStreamReadable extends stream_1.Readable {
|
|
|
39
39
|
unsubscribe() {
|
|
40
40
|
this.kafkaConsumer.unsubscribe();
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Disconnects the Kafka consumer
|
|
44
|
+
*/
|
|
45
|
+
async disconnect() {
|
|
46
|
+
await this.kafkaConsumer.disconnect();
|
|
47
|
+
}
|
|
42
48
|
/**
|
|
43
49
|
* Returns the raw Kafka consumer
|
|
44
50
|
* @returns {KafkaConsumer} The Kafka consumer instance
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kafka-crab-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-beta",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"module": "commonjs",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"js-binding.d.ts"
|
|
16
16
|
],
|
|
17
17
|
"napi": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
"binaryName": "kafka-crab-js",
|
|
19
|
+
"targets": [
|
|
20
|
+
"x86_64-apple-darwin",
|
|
21
|
+
"aarch64-apple-darwin",
|
|
22
|
+
"x86_64-unknown-linux-gnu",
|
|
23
|
+
"x86_64-unknown-linux-musl",
|
|
24
|
+
"aarch64-unknown-linux-gnu",
|
|
25
|
+
"aarch64-unknown-linux-musl"
|
|
26
|
+
]
|
|
27
27
|
},
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"keywords": [
|
|
@@ -40,35 +40,36 @@
|
|
|
40
40
|
"url": "https://github.com/inaiat/kafka-crab-js.git"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@faker-js/faker": "9.
|
|
44
|
-
"@napi-rs/cli": "^
|
|
45
|
-
"@types/node": "22.
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"typescript": "5.7.3",
|
|
43
|
+
"@faker-js/faker": "^9.7.0",
|
|
44
|
+
"@napi-rs/cli": "^3.0.0-alpha.78",
|
|
45
|
+
"@types/node": "^22.15.3",
|
|
46
|
+
"dprint": "^0.49.1",
|
|
47
|
+
"nanoid": "^5.1",
|
|
48
|
+
"typescript": "^5.8.3",
|
|
50
49
|
"copyfiles": "^2.4.1",
|
|
51
50
|
"@types/copyfiles": "^2.4.4",
|
|
52
51
|
"rimraf": "^6.0.1"
|
|
53
52
|
},
|
|
54
|
-
"ava": {
|
|
55
|
-
"timeout": "3m"
|
|
56
|
-
},
|
|
57
53
|
"scripts": {
|
|
58
54
|
"artifacts": "napi artifacts",
|
|
59
55
|
"build": "napi build --js js-src/js-binding.js --dts js-src/js-binding.d.ts --no-const-enum --platform --release",
|
|
60
56
|
"postbuild": "rimraf dist && tsc && copyfiles -f js-src/js-binding.d.ts js-src/js-binding.js ./dist/*.js ./dist/*.d.ts .",
|
|
61
57
|
"build:debug": "napi build --platform",
|
|
62
58
|
"prepublishOnly": "napi prepublish -t npm",
|
|
63
|
-
"test": "
|
|
59
|
+
"test": "node --test __test__/*.test.*",
|
|
60
|
+
"test:integration": "node --test __test__/integration/*.test.*",
|
|
64
61
|
"universal": "napi universal",
|
|
65
62
|
"version": "napi version",
|
|
66
|
-
"fmt": "dprint fmt"
|
|
63
|
+
"fmt": "dprint fmt",
|
|
64
|
+
"lint": "true"
|
|
67
65
|
},
|
|
68
|
-
"packageManager": "pnpm@
|
|
66
|
+
"packageManager": "pnpm@10.10.0",
|
|
69
67
|
"optionalDependencies": {
|
|
70
|
-
"kafka-crab-js-darwin-
|
|
71
|
-
"kafka-crab-js-darwin-
|
|
72
|
-
"kafka-crab-js-linux-x64-gnu": "1.
|
|
68
|
+
"kafka-crab-js-darwin-x64": "1.4.0-beta",
|
|
69
|
+
"kafka-crab-js-darwin-arm64": "1.4.0-beta",
|
|
70
|
+
"kafka-crab-js-linux-x64-gnu": "1.4.0-beta",
|
|
71
|
+
"kafka-crab-js-linux-x64-musl": "1.4.0-beta",
|
|
72
|
+
"kafka-crab-js-linux-arm64-gnu": "1.4.0-beta",
|
|
73
|
+
"kafka-crab-js-linux-arm64-musl": "1.4.0-beta"
|
|
73
74
|
}
|
|
74
75
|
}
|