@platformatic/kafka 1.3.0 → 1.4.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.
@@ -54,6 +54,9 @@ export class Base extends EventEmitter {
54
54
  this[kApis] = [];
55
55
  // Validate options
56
56
  this[kOptions] = Object.assign({}, defaultBaseOptions, options);
57
+ if (typeof this[kOptions].retries === 'boolean') {
58
+ this[kOptions].retries = this[kOptions].retries ? Number.POSITIVE_INFINITY : 0;
59
+ }
57
60
  this[kValidateOptions](this[kOptions], baseOptionsValidator, '/options');
58
61
  this[kClientId] = options.clientId;
59
62
  // Initialize bootstrap brokers
@@ -58,8 +58,13 @@ export declare const baseOptionsSchema: {
58
58
  minimum: number;
59
59
  };
60
60
  retries: {
61
- type: string;
62
- minimum: number;
61
+ oneOf: ({
62
+ type: string;
63
+ minimum: number;
64
+ } | {
65
+ type: string;
66
+ minimum?: undefined;
67
+ })[];
63
68
  };
64
69
  retryDelay: {
65
70
  type: string;
@@ -29,7 +29,7 @@ export const baseOptionsSchema = {
29
29
  },
30
30
  timeout: { type: 'number', minimum: 0 },
31
31
  connectTimeout: { type: 'number', minimum: 0 },
32
- retries: { type: 'number', minimum: 0 },
32
+ retries: { oneOf: [{ type: 'number', minimum: 0 }, { type: 'boolean' }] },
33
33
  retryDelay: { type: 'number', minimum: 0 },
34
34
  maxInflights: { type: 'number', minimum: 0 },
35
35
  tls: { type: 'object', additionalProperties: true }, // No validation as they come from Node.js
@@ -25,7 +25,7 @@ export interface BaseOptions extends ConnectionOptions {
25
25
  clientId: string;
26
26
  bootstrapBrokers: Broker[] | string[];
27
27
  timeout?: number;
28
- retries?: number;
28
+ retries?: number | boolean;
29
29
  retryDelay?: number;
30
30
  metadataMaxAge?: number;
31
31
  autocreateTopics?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/kafka",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Modern and performant client for Apache Kafka",
5
5
  "homepage": "https://github.com/platformatic/kafka",
6
6
  "author": "Platformatic Inc. <oss@platformatic.dev> (https://platformatic.dev)",
@@ -43,7 +43,7 @@
43
43
  "@types/node": "^22.13.5",
44
44
  "@types/semver": "^7.7.0",
45
45
  "c8": "^10.1.3",
46
- "cleaner-spec-reporter": "^0.4.0",
46
+ "cleaner-spec-reporter": "^0.5.0",
47
47
  "cronometro": "^5.3.0",
48
48
  "eslint": "^9.21.0",
49
49
  "hwp": "^0.4.1",