@forklaunch/implementation-worker-kafka 1.0.27 → 1.0.28
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/lib/consumers/index.d.ts +2 -23
- package/lib/consumers/index.d.ts.map +1 -0
- package/lib/consumers/{index.d.mts → kafkaWorker.consumer.d.ts} +5 -7
- package/lib/consumers/kafkaWorker.consumer.d.ts.map +1 -0
- package/lib/domain/schemas/index.d.ts +2 -24
- package/lib/domain/schemas/index.d.ts.map +1 -0
- package/lib/domain/schemas/index.js +18 -7
- package/lib/domain/schemas/index.mjs +18 -7
- package/lib/domain/schemas/kafka.schema.d.ts +18 -0
- package/lib/domain/schemas/kafka.schema.d.ts.map +1 -0
- package/lib/domain/schemas/typebox/kafkaWorker.schema.d.ts +9 -0
- package/lib/domain/schemas/typebox/kafkaWorker.schema.d.ts.map +1 -0
- package/lib/domain/schemas/zod/kafkaWorker.schema.d.ts +9 -0
- package/lib/domain/schemas/zod/kafkaWorker.schema.d.ts.map +1 -0
- package/lib/domain/types/index.d.ts +2 -10
- package/lib/domain/types/index.d.ts.map +1 -0
- package/lib/domain/types/{index.d.mts → kafkaWorker.types.d.ts} +2 -3
- package/lib/domain/types/kafkaWorker.types.d.ts.map +1 -0
- package/lib/producers/index.d.ts +2 -13
- package/lib/producers/index.d.ts.map +1 -0
- package/lib/producers/{index.d.mts → kafkaWorker.producer.d.ts} +3 -5
- package/lib/producers/kafkaWorker.producer.d.ts.map +1 -0
- package/package.json +38 -11
- package/lib/domain/schemas/index.d.mts +0 -24
package/lib/consumers/index.d.ts
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { WorkerEventEntity, WorkerProcessFunction, WorkerFailureHandler } from '@forklaunch/interfaces-worker/types';
|
|
4
|
-
import { KafkaWorkerOptions } from '../domain/types/index.js';
|
|
5
|
-
|
|
6
|
-
declare class KafkaWorkerConsumer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> implements WorkerConsumer<EventEntity> {
|
|
7
|
-
private kafka;
|
|
8
|
-
private producer;
|
|
9
|
-
private consumer;
|
|
10
|
-
private processedMessages;
|
|
11
|
-
protected readonly queueName: string;
|
|
12
|
-
protected readonly options: Options;
|
|
13
|
-
protected readonly processEventsFunction: WorkerProcessFunction<EventEntity>;
|
|
14
|
-
protected readonly failureHandler: WorkerFailureHandler<EventEntity>;
|
|
15
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
16
|
-
constructor(queueName: string, options: Options, processEventsFunction: WorkerProcessFunction<EventEntity>, failureHandler: WorkerFailureHandler<EventEntity>, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>);
|
|
17
|
-
private setupConsumer;
|
|
18
|
-
peekEvents(): Promise<EventEntity[]>;
|
|
19
|
-
start(): Promise<void>;
|
|
20
|
-
close(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { KafkaWorkerConsumer };
|
|
1
|
+
export * from './kafkaWorker.consumer';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../consumers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MetricsDefinition, OpenTelemetryCollector } from '@forklaunch/core/http';
|
|
2
2
|
import { WorkerConsumer } from '@forklaunch/interfaces-worker/interfaces';
|
|
3
|
-
import { WorkerEventEntity,
|
|
4
|
-
import { KafkaWorkerOptions } from '../domain/types/
|
|
5
|
-
|
|
6
|
-
declare class KafkaWorkerConsumer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> implements WorkerConsumer<EventEntity> {
|
|
3
|
+
import { WorkerEventEntity, WorkerFailureHandler, WorkerProcessFunction } from '@forklaunch/interfaces-worker/types';
|
|
4
|
+
import { KafkaWorkerOptions } from '../domain/types/kafkaWorker.types';
|
|
5
|
+
export declare class KafkaWorkerConsumer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> implements WorkerConsumer<EventEntity> {
|
|
7
6
|
private kafka;
|
|
8
7
|
private producer;
|
|
9
8
|
private consumer;
|
|
@@ -19,5 +18,4 @@ declare class KafkaWorkerConsumer<EventEntity extends WorkerEventEntity, Options
|
|
|
19
18
|
start(): Promise<void>;
|
|
20
19
|
close(): Promise<void>;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
export { KafkaWorkerConsumer };
|
|
21
|
+
//# sourceMappingURL=kafkaWorker.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaWorker.consumer.d.ts","sourceRoot":"","sources":["../../consumers/kafkaWorker.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,qBAAa,mBAAmB,CAC9B,WAAW,SAAS,iBAAiB,EACrC,OAAO,SAAS,kBAAkB,CAClC,YAAW,cAAc,CAAC,WAAW,CAAC;IAEtC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IACrC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IACpC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC7E,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACrE,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAErF,YACE,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,qBAAqB,CAAC,WAAW,CAAC,EACzD,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACjD,sBAAsB,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,EAgBlE;YAEa,aAAa;IA4DrB,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CA0EzC;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAkC3B;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3B;CACF"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
4
|
-
import * as _forklaunch_validator from '@forklaunch/validator';
|
|
5
|
-
|
|
6
|
-
declare const KafkaWorkerSchemas: <SchemaValidator extends _forklaunch_validator.AnySchemaValidator>(options: Record<string, unknown> & {
|
|
7
|
-
validator: SchemaValidator;
|
|
8
|
-
}) => _forklaunch_internal.SchemasByValidator<SchemaValidator, (options: Record<string, unknown>) => {
|
|
9
|
-
brokers: _sinclair_typebox.TArray<_sinclair_typebox.TString>;
|
|
10
|
-
clientId: _sinclair_typebox.TString;
|
|
11
|
-
groupId: _sinclair_typebox.TString;
|
|
12
|
-
retries: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
13
|
-
interval: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
14
|
-
peekCount: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
15
|
-
}, (options: Record<string, unknown>) => {
|
|
16
|
-
brokers: zod_v3.ZodArray<zod_v3.ZodString, "many">;
|
|
17
|
-
clientId: zod_v3.ZodString;
|
|
18
|
-
groupId: zod_v3.ZodString;
|
|
19
|
-
retries: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
20
|
-
interval: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
21
|
-
peekCount: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
22
|
-
}>;
|
|
23
|
-
|
|
24
|
-
export { KafkaWorkerSchemas };
|
|
1
|
+
export * from './kafka.schema';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../domain/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(schemas_exports);
|
|
|
28
28
|
// domain/schemas/kafka.schema.ts
|
|
29
29
|
var import_internal = require("@forklaunch/internal");
|
|
30
30
|
|
|
31
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
31
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
32
32
|
var typebox_exports = {};
|
|
33
33
|
__export(typebox_exports, {
|
|
34
34
|
SchemaValidator: () => SchemaValidator,
|
|
@@ -68,7 +68,7 @@ __export(typebox_exports, {
|
|
|
68
68
|
});
|
|
69
69
|
__reExport(typebox_exports, require("@sinclair/typebox"));
|
|
70
70
|
|
|
71
|
-
// ../../../node_modules/.pnpm/@forklaunch+common@1.2.
|
|
71
|
+
// ../../../node_modules/.pnpm/@forklaunch+common@1.2.20/node_modules/@forklaunch/common/lib/index.mjs
|
|
72
72
|
function deepCloneWithoutUndefined(obj, seen = /* @__PURE__ */ new WeakMap()) {
|
|
73
73
|
if (obj === null || obj === void 0) {
|
|
74
74
|
return obj;
|
|
@@ -149,7 +149,7 @@ var InMemoryBlob = class extends Blob {
|
|
|
149
149
|
content;
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
152
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
153
153
|
var import_typebox = require("@sinclair/typebox");
|
|
154
154
|
var import_compiler = require("@sinclair/typebox/compiler");
|
|
155
155
|
var import_errors = require("@sinclair/typebox/errors");
|
|
@@ -737,10 +737,10 @@ var KafkaWorkerOptionsSchema = {
|
|
|
737
737
|
peekCount: number
|
|
738
738
|
};
|
|
739
739
|
|
|
740
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
740
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
741
741
|
var import_v3 = require("zod/v3");
|
|
742
742
|
|
|
743
|
-
// ../../../node_modules/.pnpm/ts-deepmerge@
|
|
743
|
+
// ../../../node_modules/.pnpm/ts-deepmerge@8.0.0/node_modules/ts-deepmerge/esm/index.js
|
|
744
744
|
var isObject = (obj) => {
|
|
745
745
|
if (typeof obj === "object" && obj !== null) {
|
|
746
746
|
if (typeof Object.getPrototypeOf === "function") {
|
|
@@ -751,6 +751,17 @@ var isObject = (obj) => {
|
|
|
751
751
|
}
|
|
752
752
|
return false;
|
|
753
753
|
};
|
|
754
|
+
var UNSAFE_KEYS = /* @__PURE__ */ new Set([
|
|
755
|
+
"__proto__",
|
|
756
|
+
"constructor",
|
|
757
|
+
"prototype",
|
|
758
|
+
"toString",
|
|
759
|
+
"valueOf",
|
|
760
|
+
"hasOwnProperty",
|
|
761
|
+
"isPrototypeOf",
|
|
762
|
+
"propertyIsEnumerable",
|
|
763
|
+
"toLocaleString"
|
|
764
|
+
]);
|
|
754
765
|
var merge = (...objects) => objects.reduce((result, current) => {
|
|
755
766
|
if (current === void 0) {
|
|
756
767
|
return result;
|
|
@@ -759,7 +770,7 @@ var merge = (...objects) => objects.reduce((result, current) => {
|
|
|
759
770
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
760
771
|
}
|
|
761
772
|
Object.keys(current).forEach((key) => {
|
|
762
|
-
if (
|
|
773
|
+
if (UNSAFE_KEYS.has(key)) {
|
|
763
774
|
return;
|
|
764
775
|
}
|
|
765
776
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
@@ -787,7 +798,7 @@ merge.withOptions = (options, ...objects) => {
|
|
|
787
798
|
return result;
|
|
788
799
|
};
|
|
789
800
|
|
|
790
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
801
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
791
802
|
var import_v32 = require("zod/v3");
|
|
792
803
|
function extendApi(schema, schemaObject = {}) {
|
|
793
804
|
const This = schema.constructor;
|
|
@@ -19,7 +19,7 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
// domain/schemas/kafka.schema.ts
|
|
20
20
|
import { serviceSchemaResolver } from "@forklaunch/internal";
|
|
21
21
|
|
|
22
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
22
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
23
23
|
var typebox_exports = {};
|
|
24
24
|
__export(typebox_exports, {
|
|
25
25
|
SchemaValidator: () => SchemaValidator,
|
|
@@ -60,7 +60,7 @@ __export(typebox_exports, {
|
|
|
60
60
|
__reExport(typebox_exports, typebox_star);
|
|
61
61
|
import * as typebox_star from "@sinclair/typebox";
|
|
62
62
|
|
|
63
|
-
// ../../../node_modules/.pnpm/@forklaunch+common@1.2.
|
|
63
|
+
// ../../../node_modules/.pnpm/@forklaunch+common@1.2.20/node_modules/@forklaunch/common/lib/index.mjs
|
|
64
64
|
function deepCloneWithoutUndefined(obj, seen = /* @__PURE__ */ new WeakMap()) {
|
|
65
65
|
if (obj === null || obj === void 0) {
|
|
66
66
|
return obj;
|
|
@@ -141,7 +141,7 @@ var InMemoryBlob = class extends Blob {
|
|
|
141
141
|
content;
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
144
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
145
145
|
import {
|
|
146
146
|
FormatRegistry,
|
|
147
147
|
Kind,
|
|
@@ -739,13 +739,13 @@ var KafkaWorkerOptionsSchema = {
|
|
|
739
739
|
peekCount: number
|
|
740
740
|
};
|
|
741
741
|
|
|
742
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
742
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
743
743
|
import {
|
|
744
744
|
z as z2,
|
|
745
745
|
ZodType
|
|
746
746
|
} from "zod/v3";
|
|
747
747
|
|
|
748
|
-
// ../../../node_modules/.pnpm/ts-deepmerge@
|
|
748
|
+
// ../../../node_modules/.pnpm/ts-deepmerge@8.0.0/node_modules/ts-deepmerge/esm/index.js
|
|
749
749
|
var isObject = (obj) => {
|
|
750
750
|
if (typeof obj === "object" && obj !== null) {
|
|
751
751
|
if (typeof Object.getPrototypeOf === "function") {
|
|
@@ -756,6 +756,17 @@ var isObject = (obj) => {
|
|
|
756
756
|
}
|
|
757
757
|
return false;
|
|
758
758
|
};
|
|
759
|
+
var UNSAFE_KEYS = /* @__PURE__ */ new Set([
|
|
760
|
+
"__proto__",
|
|
761
|
+
"constructor",
|
|
762
|
+
"prototype",
|
|
763
|
+
"toString",
|
|
764
|
+
"valueOf",
|
|
765
|
+
"hasOwnProperty",
|
|
766
|
+
"isPrototypeOf",
|
|
767
|
+
"propertyIsEnumerable",
|
|
768
|
+
"toLocaleString"
|
|
769
|
+
]);
|
|
759
770
|
var merge = (...objects) => objects.reduce((result, current) => {
|
|
760
771
|
if (current === void 0) {
|
|
761
772
|
return result;
|
|
@@ -764,7 +775,7 @@ var merge = (...objects) => objects.reduce((result, current) => {
|
|
|
764
775
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
765
776
|
}
|
|
766
777
|
Object.keys(current).forEach((key) => {
|
|
767
|
-
if (
|
|
778
|
+
if (UNSAFE_KEYS.has(key)) {
|
|
768
779
|
return;
|
|
769
780
|
}
|
|
770
781
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
@@ -792,7 +803,7 @@ merge.withOptions = (options, ...objects) => {
|
|
|
792
803
|
return result;
|
|
793
804
|
};
|
|
794
805
|
|
|
795
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.
|
|
806
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@1.2.20/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
796
807
|
import { z } from "zod/v3";
|
|
797
808
|
function extendApi(schema, schemaObject = {}) {
|
|
798
809
|
const This = schema.constructor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const KafkaWorkerSchemas: <SchemaValidator extends import("@forklaunch/validator").AnySchemaValidator>(options: Record<string, unknown> & {
|
|
2
|
+
validator: SchemaValidator;
|
|
3
|
+
}) => import("@forklaunch/internal").SchemasByValidator<SchemaValidator, (options: Record<string, unknown>) => {
|
|
4
|
+
brokers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
5
|
+
clientId: import("@sinclair/typebox").TString;
|
|
6
|
+
groupId: import("@sinclair/typebox").TString;
|
|
7
|
+
retries: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
8
|
+
interval: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
9
|
+
peekCount: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
10
|
+
}, (options: Record<string, unknown>) => {
|
|
11
|
+
brokers: import("zod/v3").ZodArray<import("zod/v3").ZodString, "many">;
|
|
12
|
+
clientId: import("zod/v3").ZodString;
|
|
13
|
+
groupId: import("zod/v3").ZodString;
|
|
14
|
+
retries: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
15
|
+
interval: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
16
|
+
peekCount: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=kafka.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafka.schema.d.ts","sourceRoot":"","sources":["../../../domain/schemas/kafka.schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;EAG9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const KafkaWorkerOptionsSchema: {
|
|
2
|
+
brokers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
3
|
+
clientId: import("@sinclair/typebox").TString;
|
|
4
|
+
groupId: import("@sinclair/typebox").TString;
|
|
5
|
+
retries: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
6
|
+
interval: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
7
|
+
peekCount: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TDate]>, number>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=kafkaWorker.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaWorker.schema.d.ts","sourceRoot":"","sources":["../../../../domain/schemas/typebox/kafkaWorker.schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;IACnC,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const KafkaWorkerOptionsSchema: {
|
|
2
|
+
brokers: import("zod/v3").ZodArray<import("zod/v3").ZodString, "many">;
|
|
3
|
+
clientId: import("zod/v3").ZodString;
|
|
4
|
+
groupId: import("zod/v3").ZodString;
|
|
5
|
+
retries: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
6
|
+
interval: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
7
|
+
peekCount: import("zod/v3").ZodEffects<import("zod/v3").ZodNumber, number, unknown>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=kafkaWorker.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaWorker.schema.d.ts","sourceRoot":"","sources":["../../../../domain/schemas/zod/kafkaWorker.schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;IACnC,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,SAAS;CACV,CAAC"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
clientId: string;
|
|
4
|
-
groupId: string;
|
|
5
|
-
retries: number;
|
|
6
|
-
interval: number;
|
|
7
|
-
peekCount: number;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type { KafkaWorkerOptions };
|
|
1
|
+
export * from './kafkaWorker.types';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../domain/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type KafkaWorkerOptions = {
|
|
1
|
+
export type KafkaWorkerOptions = {
|
|
2
2
|
brokers: string[];
|
|
3
3
|
clientId: string;
|
|
4
4
|
groupId: string;
|
|
@@ -6,5 +6,4 @@ type KafkaWorkerOptions = {
|
|
|
6
6
|
interval: number;
|
|
7
7
|
peekCount: number;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
export type { KafkaWorkerOptions };
|
|
9
|
+
//# sourceMappingURL=kafkaWorker.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaWorker.types.d.ts","sourceRoot":"","sources":["../../../domain/types/kafkaWorker.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
package/lib/producers/index.d.ts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare class KafkaWorkerProducer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> {
|
|
5
|
-
private producer;
|
|
6
|
-
private readonly queueName;
|
|
7
|
-
private readonly options;
|
|
8
|
-
constructor(queueName: string, options: Options);
|
|
9
|
-
enqueueJob(event: EventEntity): Promise<void>;
|
|
10
|
-
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { KafkaWorkerProducer };
|
|
1
|
+
export * from './kafkaWorker.producer';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../producers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WorkerEventEntity } from '@forklaunch/interfaces-worker/types';
|
|
2
|
-
import { KafkaWorkerOptions } from '../domain/types/
|
|
3
|
-
|
|
4
|
-
declare class KafkaWorkerProducer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> {
|
|
2
|
+
import { KafkaWorkerOptions } from '../domain/types/kafkaWorker.types';
|
|
3
|
+
export declare class KafkaWorkerProducer<EventEntity extends WorkerEventEntity, Options extends KafkaWorkerOptions> {
|
|
5
4
|
private producer;
|
|
6
5
|
private readonly queueName;
|
|
7
6
|
private readonly options;
|
|
@@ -9,5 +8,4 @@ declare class KafkaWorkerProducer<EventEntity extends WorkerEventEntity, Options
|
|
|
9
8
|
enqueueJob(event: EventEntity): Promise<void>;
|
|
10
9
|
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
export { KafkaWorkerProducer };
|
|
11
|
+
//# sourceMappingURL=kafkaWorker.producer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaWorker.producer.d.ts","sourceRoot":"","sources":["../../producers/kafkaWorker.producer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,qBAAa,mBAAmB,CAC9B,WAAW,SAAS,iBAAiB,EACrC,OAAO,SAAS,kBAAkB;IAElC,OAAO,CAAC,QAAQ,CAAC;IACjB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,YAAY,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAS9C;IAEK,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlD;IAEK,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAK3D;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/implementation-worker-kafka",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "Kafka implementation for forklaunch workers",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -36,29 +36,56 @@
|
|
|
36
36
|
"import": "./lib/domain/types/index.mjs",
|
|
37
37
|
"require": "./lib/domain/types/index.js",
|
|
38
38
|
"default": "./lib/domain/types/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./consumers/*": {
|
|
41
|
+
"types": "./lib/consumers/*.d.ts",
|
|
42
|
+
"import": "./lib/consumers/*.mjs",
|
|
43
|
+
"require": "./lib/consumers/*.js",
|
|
44
|
+
"default": "./lib/consumers/*.js"
|
|
45
|
+
},
|
|
46
|
+
"./producers/*": {
|
|
47
|
+
"types": "./lib/producers/*.d.ts",
|
|
48
|
+
"import": "./lib/producers/*.mjs",
|
|
49
|
+
"require": "./lib/producers/*.js",
|
|
50
|
+
"default": "./lib/producers/*.js"
|
|
51
|
+
},
|
|
52
|
+
"./schemas/*": {
|
|
53
|
+
"types": "./lib/domain/schemas/*.d.ts",
|
|
54
|
+
"import": "./lib/domain/schemas/*.mjs",
|
|
55
|
+
"require": "./lib/domain/schemas/*.js",
|
|
56
|
+
"default": "./lib/domain/schemas/*.js"
|
|
57
|
+
},
|
|
58
|
+
"./types/*": {
|
|
59
|
+
"types": "./lib/domain/types/*.d.ts",
|
|
60
|
+
"import": "./lib/domain/types/*.mjs",
|
|
61
|
+
"require": "./lib/domain/types/*.js",
|
|
62
|
+
"default": "./lib/domain/types/*.js"
|
|
39
63
|
}
|
|
40
64
|
},
|
|
41
65
|
"files": [
|
|
42
66
|
"lib/**"
|
|
43
67
|
],
|
|
44
68
|
"dependencies": {
|
|
45
|
-
"@forklaunch/core": "^1.5.
|
|
46
|
-
"@forklaunch/internal": "^1.2.
|
|
47
|
-
"@sinclair/typebox": "^0.34.
|
|
69
|
+
"@forklaunch/core": "^1.5.6",
|
|
70
|
+
"@forklaunch/internal": "^1.2.20",
|
|
71
|
+
"@sinclair/typebox": "^0.34.52",
|
|
48
72
|
"kafkajs": "^2.2.4",
|
|
49
73
|
"zod": "^4.4.3",
|
|
50
|
-
"@forklaunch/interfaces-worker": "1.0.
|
|
74
|
+
"@forklaunch/interfaces-worker": "1.0.26"
|
|
51
75
|
},
|
|
52
76
|
"devDependencies": {
|
|
53
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
77
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
54
78
|
"depcheck": "^1.4.7",
|
|
55
|
-
"eslint": "^10.
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"typedoc": "^0.28.
|
|
58
|
-
"typescript-eslint": "^8.
|
|
79
|
+
"eslint": "^10.8.0",
|
|
80
|
+
"prettier": "^3.9.6",
|
|
81
|
+
"typedoc": "^0.28.20",
|
|
82
|
+
"typescript-eslint": "^8.65.0"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public"
|
|
59
86
|
},
|
|
60
87
|
"scripts": {
|
|
61
|
-
"build": "tsgo --noEmit && tsup producers/index.ts consumers/index.ts domain/schemas/index.ts domain/types/index.ts --format cjs,esm --no-splitting --
|
|
88
|
+
"build": "tsgo --noEmit && tsup producers/index.ts consumers/index.ts domain/schemas/index.ts domain/types/index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --out-dir lib --clean && tsgo -p tsconfig.build.json --emitDeclarationOnly && if [ -f eject-package.bash ]; then pnpm package:eject; fi",
|
|
62
89
|
"clean": "rm -rf lib pnpm.lock.yaml node_modules",
|
|
63
90
|
"docs": "typedoc --out docs *",
|
|
64
91
|
"format": "prettier --ignore-path=.prettierignore --config .prettierrc '**/*.{ts,tsx,json}' --write",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _forklaunch_internal from '@forklaunch/internal';
|
|
2
|
-
import * as zod_v3 from 'zod/v3';
|
|
3
|
-
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
4
|
-
import * as _forklaunch_validator from '@forklaunch/validator';
|
|
5
|
-
|
|
6
|
-
declare const KafkaWorkerSchemas: <SchemaValidator extends _forklaunch_validator.AnySchemaValidator>(options: Record<string, unknown> & {
|
|
7
|
-
validator: SchemaValidator;
|
|
8
|
-
}) => _forklaunch_internal.SchemasByValidator<SchemaValidator, (options: Record<string, unknown>) => {
|
|
9
|
-
brokers: _sinclair_typebox.TArray<_sinclair_typebox.TString>;
|
|
10
|
-
clientId: _sinclair_typebox.TString;
|
|
11
|
-
groupId: _sinclair_typebox.TString;
|
|
12
|
-
retries: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
13
|
-
interval: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
14
|
-
peekCount: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
|
|
15
|
-
}, (options: Record<string, unknown>) => {
|
|
16
|
-
brokers: zod_v3.ZodArray<zod_v3.ZodString, "many">;
|
|
17
|
-
clientId: zod_v3.ZodString;
|
|
18
|
-
groupId: zod_v3.ZodString;
|
|
19
|
-
retries: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
20
|
-
interval: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
21
|
-
peekCount: zod_v3.ZodEffects<zod_v3.ZodNumber, number, unknown>;
|
|
22
|
-
}>;
|
|
23
|
-
|
|
24
|
-
export { KafkaWorkerSchemas };
|