kafka-crab-js 1.2.1 → 1.3.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export type { ConsumerConfiguration, KafkaConfiguration, KafkaCrabError, KafkaEvent, KafkaEventPayload, Message, MessageProducer, OffsetModel, PartitionOffset, ProducerConfiguration, ProducerRecord, RecordMetadata, RetryStrategy, TopicPartition, TopicPartitionConfig, } from './js-binding';
2
- export { CommitMode, KafkaClientConfig, KafkaConsumer, KafkaProducer, PartitionPosition, SecurityProtocol, } from './js-binding';
2
+ export { CommitMode, KafkaClientConfig, KafkaConsumer, KafkaEventName, KafkaProducer, PartitionPosition, SecurityProtocol, } from './js-binding';
3
3
  export { KafkaClient } from './kafka-client';
4
4
  export { KafkaStreamReadable } from './kafka-stream-readable';
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KafkaStreamReadable = exports.KafkaClient = exports.SecurityProtocol = exports.PartitionPosition = exports.KafkaProducer = exports.KafkaConsumer = exports.KafkaClientConfig = exports.CommitMode = void 0;
3
+ exports.KafkaStreamReadable = exports.KafkaClient = exports.SecurityProtocol = exports.PartitionPosition = exports.KafkaProducer = exports.KafkaEventName = exports.KafkaConsumer = exports.KafkaClientConfig = exports.CommitMode = void 0;
4
4
  var js_binding_1 = require("./js-binding");
5
5
  Object.defineProperty(exports, "CommitMode", { enumerable: true, get: function () { return js_binding_1.CommitMode; } });
6
6
  Object.defineProperty(exports, "KafkaClientConfig", { enumerable: true, get: function () { return js_binding_1.KafkaClientConfig; } });
7
7
  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; } });
8
9
  Object.defineProperty(exports, "KafkaProducer", { enumerable: true, get: function () { return js_binding_1.KafkaProducer; } });
9
10
  Object.defineProperty(exports, "PartitionPosition", { enumerable: true, get: function () { return js_binding_1.PartitionPosition; } });
10
11
  Object.defineProperty(exports, "SecurityProtocol", { enumerable: true, get: function () { return js_binding_1.SecurityProtocol; } });
package/js-binding.d.ts CHANGED
@@ -8,8 +8,13 @@ export interface KafkaEventPayload {
8
8
  tpl: Array<TopicPartition>
9
9
  error?: string
10
10
  }
11
+ export enum KafkaEventName {
12
+ PreRebalance = 'PreRebalance',
13
+ PostRebalance = 'PostRebalance',
14
+ CommitCallback = 'CommitCallback'
15
+ }
11
16
  export interface KafkaEvent {
12
- name: string
17
+ name: KafkaEventName
13
18
  payload: KafkaEventPayload
14
19
  }
15
20
  export interface RetryStrategy {
@@ -107,7 +112,7 @@ export declare class KafkaConsumer {
107
112
  pause(): void
108
113
  resume(): void
109
114
  unsubscribe(): void
110
- shutdownConsumer(): Promise<void>
115
+ disconnect(): Promise<void>
111
116
  seek(topic: string, partition: number, offsetModel: OffsetModel, timeout?: number | undefined | null): void
112
117
  assignment(): Array<TopicPartition>
113
118
  recv(): Promise<Message | null>
package/js-binding.js CHANGED
@@ -310,8 +310,9 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { KafkaConsumer, CommitMode, PartitionPosition, SecurityProtocol, KafkaClientConfig, KafkaProducer } = nativeBinding
313
+ const { KafkaEventName, KafkaConsumer, CommitMode, PartitionPosition, SecurityProtocol, KafkaClientConfig, KafkaProducer } = nativeBinding
314
314
 
315
+ module.exports.KafkaEventName = KafkaEventName
315
316
  module.exports.KafkaConsumer = KafkaConsumer
316
317
  module.exports.CommitMode = CommitMode
317
318
  module.exports.PartitionPosition = PartitionPosition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kafka-crab-js",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "module": "commonjs",
@@ -46,7 +46,7 @@
46
46
  "ava": "6.2.0",
47
47
  "dprint": "^0.48.0",
48
48
  "nanoid": "5.0.9",
49
- "typescript": "5.7.2",
49
+ "typescript": "5.7.3",
50
50
  "copyfiles": "^2.4.1",
51
51
  "@types/copyfiles": "^2.4.4",
52
52
  "rimraf": "^6.0.1"
@@ -67,8 +67,8 @@
67
67
  },
68
68
  "packageManager": "pnpm@9.15.3",
69
69
  "optionalDependencies": {
70
- "kafka-crab-js-darwin-arm64": "1.2.1",
71
- "kafka-crab-js-darwin-x64": "1.2.1",
72
- "kafka-crab-js-linux-x64-gnu": "1.2.1"
70
+ "kafka-crab-js-darwin-arm64": "1.3.0",
71
+ "kafka-crab-js-darwin-x64": "1.3.0",
72
+ "kafka-crab-js-linux-x64-gnu": "1.3.0"
73
73
  }
74
74
  }