@syncbridge/kafka 0.4.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/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Copyright (c) 2025 Panates (Panates Teknoloji Yatirim A.S.). All rights reserved.
2
+
3
+ This software and associated documentation files (the "Software") are
4
+ the proprietary property of Panates and are protected by copyright laws
5
+ and international copyright treaties.
6
+
7
+ Unauthorized copying, distribution, modification, reverse engineering,
8
+ or use of this software, in whole or in part, is strictly prohibited
9
+ without the express written permission of Panates.
10
+
11
+ This Software is provided solely for use in accordance with the terms
12
+ of a valid license agreement. Any unauthorized use may result in
13
+ civil and/or criminal penalties.
14
+
15
+ For licensing inquiries, please contact: info@panates.com
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # SyncBridge ICU Connectors
@@ -0,0 +1,28 @@
1
+ import { ComponentBase } from '@syncbridge/common';
2
+ import { TcpClientComponent } from '@syncbridge/net';
3
+ import { Kafka } from 'kafkajs';
4
+ import { KafkaRetryVariables, KafkaSaslVariables, KafkaVariables } from './kafka.variables.js';
5
+ /**
6
+ * Kafka component
7
+ */
8
+ export declare class KafkaBaseComponent<TEvents extends KafkaBaseComponent.Events = KafkaBaseComponent.Events> extends ComponentBase<TEvents> {
9
+ kafka: Kafka;
10
+ values: KafkaVariables;
11
+ protected _init(): Promise<void>;
12
+ }
13
+ /**
14
+ * @namespace
15
+ */
16
+ export declare namespace KafkaBaseComponent {
17
+ interface Events extends ComponentBase.Events {
18
+ message: [msg: any];
19
+ }
20
+ const Variables: typeof KafkaVariables;
21
+ type Variables = KafkaVariables;
22
+ const SaslVariables: typeof KafkaSaslVariables;
23
+ type SaslVariables = KafkaSaslVariables;
24
+ const RetryVariables: typeof KafkaRetryVariables;
25
+ type RetryVariables = KafkaRetryVariables;
26
+ const TlsVariables: typeof import("packages-ext/net/build/components/tcp-client.variables.js").TcpClientTlsVariables;
27
+ type TlsVariables = TcpClientComponent.TlsVariables;
28
+ }
@@ -0,0 +1,54 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Component, ComponentBase } from '@syncbridge/common';
3
+ import { TcpClientComponent } from '@syncbridge/net';
4
+ import { Kafka } from 'kafkajs';
5
+ import { panatesAuthor } from '../constants.js';
6
+ import { KafkaRetryVariables, KafkaSaslVariables, KafkaVariables, } from './kafka.variables.js';
7
+ /**
8
+ * Kafka component
9
+ */
10
+ let KafkaBaseComponent = class KafkaBaseComponent extends ComponentBase {
11
+ async _init() {
12
+ this.kafka = new Kafka({
13
+ brokers: this.values.brokers,
14
+ clientId: this.values.clientId,
15
+ connectionTimeout: this.values.connectTimeout,
16
+ authenticationTimeout: this.values.authenticationTimeout,
17
+ reauthenticationThreshold: this.values.reauthenticationThreshold,
18
+ requestTimeout: this.values.requestTimeout,
19
+ enforceRequestTimeout: this.values.enforceRequestTimeout,
20
+ retry: this.values.retry,
21
+ ssl: this.values.tsl,
22
+ sasl: {
23
+ mechanism: this.values.sasl?.mechanism,
24
+ username: this.values.sasl?.username,
25
+ password: this.values.sasl?.password,
26
+ authorizationIdentity: this.values.sasl?.awsAuthorizationIdentity,
27
+ accessKeyId: this.values.sasl?.awsAccessKeyId,
28
+ secretAccessKey: this.values.sasl?.awsSecretAccessKey,
29
+ sessionToken: this.values.sasl?.awsSessionToken,
30
+ },
31
+ });
32
+ }
33
+ };
34
+ __decorate([
35
+ Component.UseVariables(),
36
+ __metadata("design:type", KafkaVariables)
37
+ ], KafkaBaseComponent.prototype, "values", void 0);
38
+ KafkaBaseComponent = __decorate([
39
+ Component({
40
+ abstract: true,
41
+ tags: ['consumer'],
42
+ author: panatesAuthor,
43
+ })
44
+ ], KafkaBaseComponent);
45
+ export { KafkaBaseComponent };
46
+ /**
47
+ * @namespace
48
+ */
49
+ (function (KafkaBaseComponent) {
50
+ KafkaBaseComponent.Variables = KafkaVariables;
51
+ KafkaBaseComponent.SaslVariables = KafkaSaslVariables;
52
+ KafkaBaseComponent.RetryVariables = KafkaRetryVariables;
53
+ KafkaBaseComponent.TlsVariables = TcpClientComponent.TlsVariables;
54
+ })(KafkaBaseComponent || (KafkaBaseComponent = {}));
@@ -0,0 +1,33 @@
1
+ import { TcpClientComponent } from '@syncbridge/net';
2
+ import { Consumer } from 'kafkajs';
3
+ import { KafkaRetryVariables, KafkaSaslVariables } from './kafka.variables.js';
4
+ import { KafkaBaseComponent } from './kafka-base.component.js';
5
+ import { KafkaConsumerVariables } from './kafka-consumer.variables.js';
6
+ /**
7
+ * KafkaConsumer component
8
+ */
9
+ export declare class KafkaConsumerComponent<TEvents extends KafkaConsumerComponent.Events = KafkaConsumerComponent.Events> extends KafkaBaseComponent<TEvents> {
10
+ protected _stopping?: boolean;
11
+ consumer: Consumer;
12
+ values: KafkaConsumerVariables;
13
+ protected _init(): Promise<void>;
14
+ protected _start(abortSignal: AbortSignal): Promise<void>;
15
+ protected _stop(): Promise<void>;
16
+ protected _onMessage(payload: any): Promise<void>;
17
+ }
18
+ /**
19
+ * @namespace
20
+ */
21
+ export declare namespace KafkaConsumerComponent {
22
+ interface Events extends KafkaBaseComponent.Events {
23
+ message: [msg: any];
24
+ }
25
+ const Variables: typeof KafkaConsumerVariables;
26
+ type Variables = KafkaConsumerVariables;
27
+ const SaslVariables: typeof KafkaSaslVariables;
28
+ type SaslVariables = KafkaSaslVariables;
29
+ const RetryVariables: typeof KafkaRetryVariables;
30
+ type RetryVariables = KafkaRetryVariables;
31
+ const TlsVariables: typeof import("packages-ext/net/build/components/tcp-client.variables.js").TcpClientTlsVariables;
32
+ type TlsVariables = TcpClientComponent.TlsVariables;
33
+ }
@@ -0,0 +1,92 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Component, ServiceStatus } from '@syncbridge/common';
3
+ import { TcpClientComponent } from '@syncbridge/net';
4
+ import { noOp, panatesAuthor } from '../constants.js';
5
+ import { KafkaRetryVariables, KafkaSaslVariables } from './kafka.variables.js';
6
+ import { KafkaBaseComponent } from './kafka-base.component.js';
7
+ import { KafkaConsumerVariables } from './kafka-consumer.variables.js';
8
+ /**
9
+ * KafkaConsumer component
10
+ */
11
+ let KafkaConsumerComponent = class KafkaConsumerComponent extends KafkaBaseComponent {
12
+ _stopping;
13
+ async _init() {
14
+ await super._init();
15
+ this.consumer = this.kafka.consumer({
16
+ groupId: this.values.groupId,
17
+ });
18
+ this.consumer.on(this.consumer.events.CONNECT, () => {
19
+ this.emit('status-change', ServiceStatus.started);
20
+ this.emit('connect');
21
+ });
22
+ this.consumer.on(this.consumer.events.CRASH, event => {
23
+ this.emit('status-change', ServiceStatus.unhealthy, event.payload?.error);
24
+ });
25
+ this.consumer.on(this.consumer.events.DISCONNECT, () => {
26
+ if (!this._stopping) {
27
+ this.emit('status-change', ServiceStatus.unhealthy, new Error('Kafka consumer disconnected'));
28
+ }
29
+ this.emit('disconnect');
30
+ });
31
+ }
32
+ async _start(abortSignal) {
33
+ await super._start(abortSignal);
34
+ this.consumer
35
+ .connect()
36
+ .then(async () => {
37
+ await this.consumer
38
+ .subscribe({
39
+ topics: this.values.topics,
40
+ fromBeginning: this.values.fromBeginning,
41
+ })
42
+ .catch(async (e) => {
43
+ this.emit('error', e);
44
+ await this.consumer.disconnect().catch(noOp);
45
+ this.emit('status-change', ServiceStatus.unhealthy, e);
46
+ });
47
+ await this.consumer
48
+ .run({
49
+ eachMessage: async (payload) => {
50
+ return this._onMessage(payload);
51
+ },
52
+ })
53
+ .catch(async (e) => {
54
+ this.emit('error', e);
55
+ await this.consumer.disconnect().catch(noOp);
56
+ this.emit('status-change', ServiceStatus.unhealthy, e);
57
+ });
58
+ })
59
+ .catch(noOp);
60
+ }
61
+ async _stop() {
62
+ this._stopping = true;
63
+ await this.consumer.disconnect();
64
+ return super._stop();
65
+ }
66
+ async _onMessage(payload) {
67
+ this.emit('message', payload);
68
+ }
69
+ };
70
+ __decorate([
71
+ Component.UseVariables(),
72
+ __metadata("design:type", KafkaConsumerVariables)
73
+ ], KafkaConsumerComponent.prototype, "values", void 0);
74
+ KafkaConsumerComponent = __decorate([
75
+ Component({
76
+ className: 'KafkaConsumer',
77
+ displayName: 'Kafka Consumer',
78
+ description: 'Kafka consumer component',
79
+ author: panatesAuthor,
80
+ tags: ['consumer'],
81
+ })
82
+ ], KafkaConsumerComponent);
83
+ export { KafkaConsumerComponent };
84
+ /**
85
+ * @namespace
86
+ */
87
+ (function (KafkaConsumerComponent) {
88
+ KafkaConsumerComponent.Variables = KafkaConsumerVariables;
89
+ KafkaConsumerComponent.SaslVariables = KafkaSaslVariables;
90
+ KafkaConsumerComponent.RetryVariables = KafkaRetryVariables;
91
+ KafkaConsumerComponent.TlsVariables = TcpClientComponent.TlsVariables;
92
+ })(KafkaConsumerComponent || (KafkaConsumerComponent = {}));
@@ -0,0 +1,9 @@
1
+ import { KafkaBaseComponent } from './kafka-base.component.js';
2
+ /**
3
+ * Variables
4
+ */
5
+ export declare class KafkaConsumerVariables extends KafkaBaseComponent.Variables {
6
+ groupId: string;
7
+ topics: string[];
8
+ fromBeginning: boolean;
9
+ }
@@ -0,0 +1,33 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { DefineVariable, VariableType } from '@syncbridge/common';
3
+ import { KafkaBaseComponent } from './kafka-base.component.js';
4
+ /**
5
+ * Variables
6
+ */
7
+ export class KafkaConsumerVariables extends KafkaBaseComponent.Variables {
8
+ }
9
+ __decorate([
10
+ DefineVariable({
11
+ label: 'Group id',
12
+ description: 'A unique string that identifies the consumer group this consumer belongs to',
13
+ required: true,
14
+ }),
15
+ __metadata("design:type", String)
16
+ ], KafkaConsumerVariables.prototype, "groupId", void 0);
17
+ __decorate([
18
+ DefineVariable({
19
+ label: 'Topics',
20
+ description: 'Topics to subscribe to',
21
+ type: VariableType.String,
22
+ required: true,
23
+ }),
24
+ __metadata("design:type", Array)
25
+ ], KafkaConsumerVariables.prototype, "topics", void 0);
26
+ __decorate([
27
+ DefineVariable({
28
+ label: 'From beginning',
29
+ description: 'Start consuming from the beginning of the topic',
30
+ default: false,
31
+ }),
32
+ __metadata("design:type", Boolean)
33
+ ], KafkaConsumerVariables.prototype, "fromBeginning", void 0);
@@ -0,0 +1,34 @@
1
+ import { TcpClientComponent } from '@syncbridge/net';
2
+ import { Producer, ProducerBatch, ProducerRecord, RecordMetadata } from 'kafkajs';
3
+ import { KafkaRetryVariables, KafkaSaslVariables } from './kafka.variables.js';
4
+ import { KafkaBaseComponent } from './kafka-base.component.js';
5
+ import { KafkaProducerVariables } from './kafka-producer.variables.js';
6
+ /**
7
+ * KafkaProducer component
8
+ */
9
+ export declare class KafkaProducerComponent<TEvents extends KafkaProducerComponent.Events = KafkaProducerComponent.Events> extends KafkaBaseComponent<TEvents> {
10
+ protected _stopping?: boolean;
11
+ producer: Producer;
12
+ values: KafkaProducerVariables;
13
+ protected _init(): Promise<void>;
14
+ protected _start(abortSignal: AbortSignal): Promise<void>;
15
+ protected _stop(): Promise<void>;
16
+ send(record: ProducerRecord): Promise<RecordMetadata[]>;
17
+ sendBatch(batch: ProducerBatch): Promise<RecordMetadata[]>;
18
+ }
19
+ /**
20
+ * @namespace
21
+ */
22
+ export declare namespace KafkaProducerComponent {
23
+ interface Events extends KafkaBaseComponent.Events {
24
+ message: [msg: any];
25
+ }
26
+ const Variables: typeof KafkaProducerVariables;
27
+ type Variables = KafkaProducerVariables;
28
+ const SaslVariables: typeof KafkaSaslVariables;
29
+ type SaslVariables = KafkaSaslVariables;
30
+ const RetryVariables: typeof KafkaRetryVariables;
31
+ type RetryVariables = KafkaRetryVariables;
32
+ const TlsVariables: typeof import("packages-ext/net/build/components/tcp-client.variables.js").TcpClientTlsVariables;
33
+ type TlsVariables = TcpClientComponent.TlsVariables;
34
+ }
@@ -0,0 +1,67 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Component, ServiceStatus } from '@syncbridge/common';
3
+ import { TcpClientComponent } from '@syncbridge/net';
4
+ import { noOp, panatesAuthor } from '../constants.js';
5
+ import { KafkaRetryVariables, KafkaSaslVariables } from './kafka.variables.js';
6
+ import { KafkaBaseComponent } from './kafka-base.component.js';
7
+ import { KafkaProducerVariables } from './kafka-producer.variables.js';
8
+ /**
9
+ * KafkaProducer component
10
+ */
11
+ let KafkaProducerComponent = class KafkaProducerComponent extends KafkaBaseComponent {
12
+ _stopping;
13
+ async _init() {
14
+ await super._init();
15
+ this.producer = this.kafka.producer({
16
+ allowAutoTopicCreation: this.values.allowAutoTopicCreation,
17
+ });
18
+ this.producer.on(this.producer.events.CONNECT, () => {
19
+ this.emit('status-change', ServiceStatus.started);
20
+ this.emit('connect');
21
+ });
22
+ this.producer.on(this.producer.events.DISCONNECT, () => {
23
+ if (!this._stopping) {
24
+ this.emit('status-change', ServiceStatus.unhealthy, new Error('Kafka producer disconnected'));
25
+ }
26
+ this.emit('disconnect');
27
+ });
28
+ }
29
+ async _start(abortSignal) {
30
+ await super._start(abortSignal);
31
+ this.producer.connect().catch(noOp);
32
+ }
33
+ async _stop() {
34
+ this._stopping = true;
35
+ await this.producer.disconnect();
36
+ return super._stop();
37
+ }
38
+ async send(record) {
39
+ return this.producer.send(record);
40
+ }
41
+ async sendBatch(batch) {
42
+ return this.producer.sendBatch(batch);
43
+ }
44
+ };
45
+ __decorate([
46
+ Component.UseVariables(),
47
+ __metadata("design:type", KafkaProducerVariables)
48
+ ], KafkaProducerComponent.prototype, "values", void 0);
49
+ KafkaProducerComponent = __decorate([
50
+ Component({
51
+ className: 'KafkaProducer',
52
+ displayName: 'Kafka Producer',
53
+ description: 'Kafka producer component',
54
+ author: panatesAuthor,
55
+ tags: ['producer'],
56
+ })
57
+ ], KafkaProducerComponent);
58
+ export { KafkaProducerComponent };
59
+ /**
60
+ * @namespace
61
+ */
62
+ (function (KafkaProducerComponent) {
63
+ KafkaProducerComponent.Variables = KafkaProducerVariables;
64
+ KafkaProducerComponent.SaslVariables = KafkaSaslVariables;
65
+ KafkaProducerComponent.RetryVariables = KafkaRetryVariables;
66
+ KafkaProducerComponent.TlsVariables = TcpClientComponent.TlsVariables;
67
+ })(KafkaProducerComponent || (KafkaProducerComponent = {}));
@@ -0,0 +1,7 @@
1
+ import { KafkaBaseComponent } from './kafka-base.component.js';
2
+ /**
3
+ * Variables
4
+ */
5
+ export declare class KafkaProducerVariables extends KafkaBaseComponent.Variables {
6
+ allowAutoTopicCreation: boolean;
7
+ }
@@ -0,0 +1,15 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { DefineVariable } from '@syncbridge/common';
3
+ import { KafkaBaseComponent } from './kafka-base.component.js';
4
+ /**
5
+ * Variables
6
+ */
7
+ export class KafkaProducerVariables extends KafkaBaseComponent.Variables {
8
+ }
9
+ __decorate([
10
+ DefineVariable({
11
+ label: 'AutoTopic Creation',
12
+ description: 'Allow topic creation when querying metadata for non-existent topics',
13
+ }),
14
+ __metadata("design:type", Boolean)
15
+ ], KafkaProducerVariables.prototype, "allowAutoTopicCreation", void 0);
@@ -0,0 +1,41 @@
1
+ import { TcpClientComponent } from '@syncbridge/net';
2
+ /**
3
+ * Retry variables
4
+ */
5
+ export declare class KafkaRetryVariables {
6
+ strategy: 'fibonacci' | 'exponential';
7
+ initialDelay: number;
8
+ maxDelay: number;
9
+ maxRetryTime: number;
10
+ initialRetryTime: number;
11
+ factor: number;
12
+ multiplier: number;
13
+ retries: number;
14
+ }
15
+ /**
16
+ * SASL variables
17
+ */
18
+ export declare class KafkaSaslVariables {
19
+ mechanism: string;
20
+ username?: string;
21
+ password?: string;
22
+ awsAuthorizationIdentity?: string;
23
+ awsAccessKeyId?: string;
24
+ awsSecretAccessKey?: string;
25
+ awsSessionToken?: string;
26
+ }
27
+ /**
28
+ * Variables
29
+ */
30
+ export declare class KafkaVariables {
31
+ brokers: string[];
32
+ clientId?: string;
33
+ connectTimeout: number;
34
+ authenticationTimeout: number;
35
+ reauthenticationThreshold: number;
36
+ requestTimeout: number;
37
+ enforceRequestTimeout: boolean;
38
+ retry: KafkaRetryVariables;
39
+ sasl: KafkaSaslVariables;
40
+ tsl: TcpClientComponent.TlsVariables;
41
+ }
@@ -0,0 +1,222 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { DefineVariable, VariableType } from '@syncbridge/common';
3
+ import { TcpClientComponent } from '@syncbridge/net';
4
+ /**
5
+ * Retry variables
6
+ */
7
+ export class KafkaRetryVariables {
8
+ }
9
+ __decorate([
10
+ DefineVariable({
11
+ type: VariableType.Enum,
12
+ description: 'Reconnection strategy',
13
+ enumValues: ['fibonacci', 'exponential'],
14
+ default: 'fibonacci',
15
+ }),
16
+ __metadata("design:type", String)
17
+ ], KafkaRetryVariables.prototype, "strategy", void 0);
18
+ __decorate([
19
+ DefineVariable({
20
+ label: 'Initial delay',
21
+ description: 'Initial delay in milliseconds',
22
+ default: 2000,
23
+ }),
24
+ __metadata("design:type", Number)
25
+ ], KafkaRetryVariables.prototype, "initialDelay", void 0);
26
+ __decorate([
27
+ DefineVariable({
28
+ label: 'Maximum delay',
29
+ description: 'Maximum delay in milliseconds',
30
+ default: 10000,
31
+ }),
32
+ __metadata("design:type", Number)
33
+ ], KafkaRetryVariables.prototype, "maxDelay", void 0);
34
+ __decorate([
35
+ DefineVariable({
36
+ label: 'Max Retry Time',
37
+ description: 'Maximum wait time for a retry in milliseconds',
38
+ default: 30000,
39
+ }),
40
+ __metadata("design:type", Number)
41
+ ], KafkaRetryVariables.prototype, "maxRetryTime", void 0);
42
+ __decorate([
43
+ DefineVariable({
44
+ label: 'Initial Retry Time',
45
+ description: 'Initial value used to calculate the retry in milliseconds ' +
46
+ '(This is still randomized following the randomization factor)',
47
+ default: 300,
48
+ }),
49
+ __metadata("design:type", Number)
50
+ ], KafkaRetryVariables.prototype, "initialRetryTime", void 0);
51
+ __decorate([
52
+ DefineVariable({
53
+ label: 'Factor',
54
+ description: 'Randomization factor',
55
+ default: 0.2,
56
+ }),
57
+ __metadata("design:type", Number)
58
+ ], KafkaRetryVariables.prototype, "factor", void 0);
59
+ __decorate([
60
+ DefineVariable({
61
+ label: 'Multiplier',
62
+ description: 'Exponential factor',
63
+ default: 2,
64
+ }),
65
+ __metadata("design:type", Number)
66
+ ], KafkaRetryVariables.prototype, "multiplier", void 0);
67
+ __decorate([
68
+ DefineVariable({
69
+ label: 'Retries',
70
+ description: 'Max number of retries per call',
71
+ default: 5,
72
+ }),
73
+ __metadata("design:type", Number)
74
+ ], KafkaRetryVariables.prototype, "retries", void 0);
75
+ /**
76
+ * SASL variables
77
+ */
78
+ export class KafkaSaslVariables {
79
+ }
80
+ __decorate([
81
+ DefineVariable({
82
+ label: 'Mechanism',
83
+ description: 'SASL mechanism',
84
+ type: VariableType.Enum,
85
+ enumValues: ['plain', 'scram-sha-256', 'scram-sha-512', 'aws'],
86
+ required: true,
87
+ default: 'plain',
88
+ }),
89
+ __metadata("design:type", String)
90
+ ], KafkaSaslVariables.prototype, "mechanism", void 0);
91
+ __decorate([
92
+ DefineVariable({
93
+ label: 'Username',
94
+ description: 'Username. Available for "plain", "scram-sha-256" and "scram-sha-512" mechanisms"',
95
+ }),
96
+ __metadata("design:type", String)
97
+ ], KafkaSaslVariables.prototype, "username", void 0);
98
+ __decorate([
99
+ DefineVariable({
100
+ label: 'Password',
101
+ description: 'Username. Available for "plain", "scram-sha-256" and "scram-sha-512" mechanisms"',
102
+ type: VariableType.Secret,
103
+ }),
104
+ __metadata("design:type", String)
105
+ ], KafkaSaslVariables.prototype, "password", void 0);
106
+ __decorate([
107
+ DefineVariable({
108
+ label: 'AWS Authorization Identity',
109
+ description: 'AWS Authorization Identity. Available for "aws" mechanism',
110
+ type: VariableType.Secret,
111
+ }),
112
+ __metadata("design:type", String)
113
+ ], KafkaSaslVariables.prototype, "awsAuthorizationIdentity", void 0);
114
+ __decorate([
115
+ DefineVariable({
116
+ label: 'AWS Access Key Id',
117
+ description: 'AWS Access Key Id. Available for "aws" mechanism',
118
+ type: VariableType.Secret,
119
+ }),
120
+ __metadata("design:type", String)
121
+ ], KafkaSaslVariables.prototype, "awsAccessKeyId", void 0);
122
+ __decorate([
123
+ DefineVariable({
124
+ label: 'AWS Secret Access Key',
125
+ description: 'AWS Secret Access Key. Available for "aws" mechanism',
126
+ type: VariableType.Secret,
127
+ }),
128
+ __metadata("design:type", String)
129
+ ], KafkaSaslVariables.prototype, "awsSecretAccessKey", void 0);
130
+ __decorate([
131
+ DefineVariable({
132
+ label: 'AWS Session Token',
133
+ description: 'AWS Session Token. Available for "aws" mechanism',
134
+ type: VariableType.Secret,
135
+ }),
136
+ __metadata("design:type", String)
137
+ ], KafkaSaslVariables.prototype, "awsSessionToken", void 0);
138
+ /**
139
+ * Variables
140
+ */
141
+ export class KafkaVariables {
142
+ }
143
+ __decorate([
144
+ DefineVariable({
145
+ label: 'Brokers',
146
+ description: 'The client must be configured with at least one broker. ' +
147
+ 'The brokers on the list are considered seed brokers and are only used to bootstrap the client and load initial metadata.',
148
+ type: VariableType.String,
149
+ isArray: true,
150
+ required: true,
151
+ }),
152
+ __metadata("design:type", Array)
153
+ ], KafkaVariables.prototype, "brokers", void 0);
154
+ __decorate([
155
+ DefineVariable({
156
+ label: 'Client id',
157
+ description: 'A logical identifier of an application. Can be used by brokers to apply ' +
158
+ 'quotas or trace requests to a specific application',
159
+ }),
160
+ __metadata("design:type", String)
161
+ ], KafkaVariables.prototype, "clientId", void 0);
162
+ __decorate([
163
+ DefineVariable({
164
+ label: 'Connect timeout',
165
+ description: 'Time in milliseconds to wait for a successful connection',
166
+ default: 10000,
167
+ }),
168
+ __metadata("design:type", Number)
169
+ ], KafkaVariables.prototype, "connectTimeout", void 0);
170
+ __decorate([
171
+ DefineVariable({
172
+ label: 'Authentication timeout',
173
+ description: 'Timeout in ms for authentication requests',
174
+ default: 10000,
175
+ }),
176
+ __metadata("design:type", Number)
177
+ ], KafkaVariables.prototype, "authenticationTimeout", void 0);
178
+ __decorate([
179
+ DefineVariable({
180
+ label: 'Reauthentication threshold',
181
+ description: 'Threshold in milliseconds to reauthenticate',
182
+ default: 10000,
183
+ }),
184
+ __metadata("design:type", Number)
185
+ ], KafkaVariables.prototype, "reauthenticationThreshold", void 0);
186
+ __decorate([
187
+ DefineVariable({
188
+ label: 'Request timeout',
189
+ description: 'Time in milliseconds to wait for a successful request',
190
+ default: 30000,
191
+ }),
192
+ __metadata("design:type", Number)
193
+ ], KafkaVariables.prototype, "requestTimeout", void 0);
194
+ __decorate([
195
+ DefineVariable({
196
+ label: 'Enforce request timeout',
197
+ description: 'Determines if the request timeout should be enforced',
198
+ default: true,
199
+ }),
200
+ __metadata("design:type", Boolean)
201
+ ], KafkaVariables.prototype, "enforceRequestTimeout", void 0);
202
+ __decorate([
203
+ DefineVariable({
204
+ label: 'Retry',
205
+ description: 'Retry options',
206
+ }),
207
+ __metadata("design:type", KafkaRetryVariables)
208
+ ], KafkaVariables.prototype, "retry", void 0);
209
+ __decorate([
210
+ DefineVariable({
211
+ label: 'SASL',
212
+ description: 'SASL authenticate options',
213
+ }),
214
+ __metadata("design:type", KafkaSaslVariables)
215
+ ], KafkaVariables.prototype, "sasl", void 0);
216
+ __decorate([
217
+ DefineVariable({
218
+ label: 'TSL',
219
+ description: 'TSL options',
220
+ }),
221
+ __metadata("design:type", TcpClientComponent.TlsVariables)
222
+ ], KafkaVariables.prototype, "tsl", void 0);
@@ -0,0 +1,3 @@
1
+ export * from './components/kafka-base.component.js';
2
+ export * from './components/kafka-consumer.component.js';
3
+ export * from './components/kafka-producer.component.js';
package/components.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './components/kafka-base.component.js';
2
+ export * from './components/kafka-consumer.component.js';
3
+ export * from './components/kafka-producer.component.js';
package/constants.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { AuthorMetadata } from '@syncbridge/common';
2
+ export declare const version = "1";
3
+ export declare const noOp: () => undefined;
4
+ export declare const panatesAuthor: AuthorMetadata;
package/constants.js ADDED
@@ -0,0 +1,7 @@
1
+ export const version = '0.4.1';
2
+ export const noOp = () => undefined;
3
+ export const panatesAuthor = {
4
+ name: 'Panates Technology AS',
5
+ email: 'info@panates.com',
6
+ url: 'https://www.panates.com',
7
+ };
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import * as components from './components.js';
2
+ export { components };
3
+ export * from './components.js';
4
+ declare const cfg: import("@syncbridge/common").IExtensionPackage;
5
+ export default cfg;
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import { makeExtensionPackage } from '@syncbridge/common';
2
+ import * as components from './components.js';
3
+ export { components };
4
+ export * from './components.js';
5
+ const cfg = makeExtensionPackage({
6
+ processors: [],
7
+ components: Object.values(components),
8
+ });
9
+ export default cfg;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@syncbridge/kafka",
3
+ "version": "0.4.1",
4
+ "description": "SyncBridge Kafka connection components",
5
+ "author": "Panates Inc",
6
+ "license": "UNLICENSED",
7
+ "dependencies": {
8
+ "ansi-colors": "^4.1.3",
9
+ "kafkajs": "^2.2.4",
10
+ "node-events-async": "^1.5.0",
11
+ "oracledb": "^6.10.0"
12
+ },
13
+ "peerDependencies": {
14
+ "@syncbridge/common": "^0.4.1",
15
+ "@syncbridge/builtins": "^0.4.1",
16
+ "@syncbridge/net": "^0.4.1",
17
+ "@sqb/builder": ">=4.19.6 <5",
18
+ "@sqb/connect": ">=4.19.6 <5"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./index.js"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "type": "module",
28
+ "module": "./index.js",
29
+ "types": "./index.d.ts",
30
+ "engines": {
31
+ "node": ">=20.0"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }