@forklaunch/implementation-worker-redis 0.1.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/LICENSE +21 -0
- package/lib/__test__/schemaEquality.test.d.ts +2 -0
- package/lib/__test__/schemaEquality.test.d.ts.map +1 -0
- package/lib/__test__/schemaEquality.test.js +13 -0
- package/lib/consumers/index.d.ts +2 -0
- package/lib/consumers/index.d.ts.map +1 -0
- package/lib/consumers/index.js +1 -0
- package/lib/consumers/redisWorker.consumer.d.ts +17 -0
- package/lib/consumers/redisWorker.consumer.d.ts.map +1 -0
- package/lib/consumers/redisWorker.consumer.js +38 -0
- package/lib/eject/consumers/index.ts +1 -0
- package/lib/eject/consumers/redisWorker.consumer.ts +59 -0
- package/lib/eject/domain/schemas/index.ts +1 -0
- package/lib/eject/domain/schemas/redisWorker.schema.ts +7 -0
- package/lib/eject/producers/index.ts +0 -0
- package/lib/eject/producers/redisWorker.producer.ts +21 -0
- package/lib/eject/types/index.ts +1 -0
- package/lib/eject/types/redisWorker.types.ts +5 -0
- package/lib/jest.config.d.ts +4 -0
- package/lib/jest.config.d.ts.map +1 -0
- package/lib/jest.config.js +19 -0
- package/lib/producers/index.d.ts +2 -0
- package/lib/producers/index.d.ts.map +1 -0
- package/lib/producers/index.js +1 -0
- package/lib/producers/redisWorker.producer.d.ts +11 -0
- package/lib/producers/redisWorker.producer.d.ts.map +1 -0
- package/lib/producers/redisWorker.producer.js +15 -0
- package/lib/schemas/index.d.ts +2 -0
- package/lib/schemas/index.d.ts.map +1 -0
- package/lib/schemas/index.js +1 -0
- package/lib/schemas/redisWorker.schema.d.ts +12 -0
- package/lib/schemas/redisWorker.schema.d.ts.map +1 -0
- package/lib/schemas/redisWorker.schema.js +4 -0
- package/lib/schemas/typebox/redisWorker.schema.d.ts +6 -0
- package/lib/schemas/typebox/redisWorker.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/redisWorker.schema.js +6 -0
- package/lib/schemas/zod/redisWorker.schema.d.ts +6 -0
- package/lib/schemas/zod/redisWorker.schema.d.ts.map +1 -0
- package/lib/schemas/zod/redisWorker.schema.js +6 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/redisWorker.types.d.ts +6 -0
- package/lib/types/redisWorker.types.d.ts.map +1 -0
- package/lib/types/redisWorker.types.js +1 -0
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +7 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 forklaunch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaEquality.test.d.ts","sourceRoot":"","sources":["../../__test__/schemaEquality.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isTrue } from '@forklaunch/common';
|
|
2
|
+
import { testSchemaEquality } from '@forklaunch/core/test';
|
|
3
|
+
import { RedisWorkerOptionsSchema as TypeboxRedisWorkerOptionsSchema } from '../schemas/typebox/redisWorker.schema';
|
|
4
|
+
import { RedisWorkerOptionsSchema as ZodRedisWorkerOptionsSchema } from '../schemas/zod/redisWorker.schema';
|
|
5
|
+
describe('schema equality', () => {
|
|
6
|
+
it('should be equal for bullmq worker', () => {
|
|
7
|
+
expect(isTrue(testSchemaEquality(ZodRedisWorkerOptionsSchema, TypeboxRedisWorkerOptionsSchema, {
|
|
8
|
+
pageSize: 10,
|
|
9
|
+
retries: 1,
|
|
10
|
+
interval: 1000
|
|
11
|
+
}))).toBeTruthy();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../consumers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redisWorker.consumer';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TtlCache } from '@forklaunch/core/cache';
|
|
2
|
+
import { WorkerConsumer } from '@forklaunch/interfaces-worker/interfaces';
|
|
3
|
+
import { WorkerEventEntity, WorkerFailureHandler, WorkerProcessFunction } from '@forklaunch/interfaces-worker/types';
|
|
4
|
+
import { RedisWorkerOptions } from '../types/redisWorker.types';
|
|
5
|
+
export declare class RedisWorkerConsumer<EventEntity extends WorkerEventEntity> implements WorkerConsumer<EventEntity> {
|
|
6
|
+
protected readonly queueName: string;
|
|
7
|
+
protected readonly cache: TtlCache;
|
|
8
|
+
protected readonly options: RedisWorkerOptions;
|
|
9
|
+
protected readonly processEvents: WorkerProcessFunction<EventEntity>;
|
|
10
|
+
protected readonly failureHandler: WorkerFailureHandler<EventEntity>;
|
|
11
|
+
constructor(queueName: string, cache: TtlCache, options: RedisWorkerOptions, processEvents: WorkerProcessFunction<EventEntity>, failureHandler: WorkerFailureHandler<EventEntity>);
|
|
12
|
+
private retrieveEvents;
|
|
13
|
+
private updateEvents;
|
|
14
|
+
peekEvents(): Promise<EventEntity[]>;
|
|
15
|
+
start(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=redisWorker.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redisWorker.consumer.d.ts","sourceRoot":"","sources":["../../consumers/redisWorker.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,qBAAa,mBAAmB,CAAC,WAAW,SAAS,iBAAiB,CACpE,YAAW,cAAc,CAAC,WAAW,CAAC;IAGpC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM;IACpC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ;IAClC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IAC9C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC,WAAW,CAAC;IACpE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC;gBAJjD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,kBAAkB,EAC3B,aAAa,EAAE,qBAAqB,CAAC,WAAW,CAAC,EACjD,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC;YAGxD,cAAc;YAUd,YAAY;IAYpB,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAQpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ7B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export class RedisWorkerConsumer {
|
|
2
|
+
queueName;
|
|
3
|
+
cache;
|
|
4
|
+
options;
|
|
5
|
+
processEvents;
|
|
6
|
+
failureHandler;
|
|
7
|
+
constructor(queueName, cache, options, processEvents, failureHandler) {
|
|
8
|
+
this.queueName = queueName;
|
|
9
|
+
this.cache = cache;
|
|
10
|
+
this.options = options;
|
|
11
|
+
this.processEvents = processEvents;
|
|
12
|
+
this.failureHandler = failureHandler;
|
|
13
|
+
}
|
|
14
|
+
async retrieveEvents() {
|
|
15
|
+
const events = (await this.cache.dequeueBatchRecords(this.queueName, this.options.pageSize)).filter((event) => event != null);
|
|
16
|
+
return events;
|
|
17
|
+
}
|
|
18
|
+
async updateEvents(events) {
|
|
19
|
+
await this.cache.enqueueBatchRecords(this.queueName, events
|
|
20
|
+
.filter((event) => event != null && event.retryCount <= 3)
|
|
21
|
+
.map((event) => ({
|
|
22
|
+
...event,
|
|
23
|
+
retryCount: event.retryCount + 1
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
async peekEvents() {
|
|
27
|
+
const events = await this.cache.peekQueueRecords(this.queueName, this.options.pageSize);
|
|
28
|
+
return events;
|
|
29
|
+
}
|
|
30
|
+
async start() {
|
|
31
|
+
setInterval(async () => {
|
|
32
|
+
const events = await this.retrieveEvents();
|
|
33
|
+
const failedEvents = await this.processEvents(events);
|
|
34
|
+
await this.failureHandler(failedEvents);
|
|
35
|
+
await this.updateEvents(failedEvents.map((event) => event.value));
|
|
36
|
+
}, this.options.interval);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redisWorker.consumer';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { TtlCache } from '@forklaunch/core/cache';
|
|
2
|
+
import { WorkerConsumer } from '@forklaunch/interfaces-worker/interfaces';
|
|
3
|
+
import {
|
|
4
|
+
WorkerEventEntity,
|
|
5
|
+
WorkerFailureHandler,
|
|
6
|
+
WorkerProcessFunction
|
|
7
|
+
} from '@forklaunch/interfaces-worker/types';
|
|
8
|
+
import { RedisWorkerOptions } from '../types/redisWorker.types';
|
|
9
|
+
|
|
10
|
+
export class RedisWorkerConsumer<EventEntity extends WorkerEventEntity>
|
|
11
|
+
implements WorkerConsumer<EventEntity>
|
|
12
|
+
{
|
|
13
|
+
constructor(
|
|
14
|
+
protected readonly queueName: string,
|
|
15
|
+
protected readonly cache: TtlCache,
|
|
16
|
+
protected readonly options: RedisWorkerOptions,
|
|
17
|
+
protected readonly processEvents: WorkerProcessFunction<EventEntity>,
|
|
18
|
+
protected readonly failureHandler: WorkerFailureHandler<EventEntity>
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
private async retrieveEvents(): Promise<EventEntity[]> {
|
|
22
|
+
const events = (
|
|
23
|
+
await this.cache.dequeueBatchRecords<EventEntity>(
|
|
24
|
+
this.queueName,
|
|
25
|
+
this.options.pageSize
|
|
26
|
+
)
|
|
27
|
+
).filter((event) => event != null);
|
|
28
|
+
return events;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private async updateEvents(events: EventEntity[]): Promise<void> {
|
|
32
|
+
await this.cache.enqueueBatchRecords(
|
|
33
|
+
this.queueName,
|
|
34
|
+
events
|
|
35
|
+
.filter((event) => event != null && event.retryCount <= 3)
|
|
36
|
+
.map((event) => ({
|
|
37
|
+
...event,
|
|
38
|
+
retryCount: event.retryCount + 1
|
|
39
|
+
}))
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async peekEvents(): Promise<EventEntity[]> {
|
|
44
|
+
const events = await this.cache.peekQueueRecords<EventEntity>(
|
|
45
|
+
this.queueName,
|
|
46
|
+
this.options.pageSize
|
|
47
|
+
);
|
|
48
|
+
return events;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async start(): Promise<void> {
|
|
52
|
+
setInterval(async () => {
|
|
53
|
+
const events = await this.retrieveEvents();
|
|
54
|
+
const failedEvents = await this.processEvents(events);
|
|
55
|
+
await this.failureHandler(failedEvents);
|
|
56
|
+
await this.updateEvents(failedEvents.map((event) => event.value));
|
|
57
|
+
}, this.options.interval);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redisWorker.schema';
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TtlCache } from '@forklaunch/core/cache';
|
|
2
|
+
import { WorkerProducer } from '@forklaunch/interfaces-worker/interfaces';
|
|
3
|
+
import { WorkerEventEntity } from '@forklaunch/interfaces-worker/types';
|
|
4
|
+
|
|
5
|
+
export class RedisWorkerProducer<EventEntity extends WorkerEventEntity>
|
|
6
|
+
implements WorkerProducer<EventEntity>
|
|
7
|
+
{
|
|
8
|
+
constructor(
|
|
9
|
+
private readonly queueName: string,
|
|
10
|
+
private readonly cache: TtlCache
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async enqueueJob(event: EventEntity): Promise<void> {
|
|
14
|
+
await this.cache.enqueueRecord(this.queueName, event);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async enqueueBatchJobs(events: EventEntity[]): Promise<void> {
|
|
18
|
+
console.log('Enqueuing batch jobs', events);
|
|
19
|
+
await this.cache.enqueueBatchRecords(this.queueName, events);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redisWorker.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,oBAiBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const jestConfig = {
|
|
2
|
+
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
3
|
+
moduleNameMapper: {
|
|
4
|
+
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
5
|
+
},
|
|
6
|
+
transform: {
|
|
7
|
+
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
|
|
8
|
+
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
|
|
9
|
+
'^.+\\.[tj]sx?$': [
|
|
10
|
+
'ts-jest',
|
|
11
|
+
{
|
|
12
|
+
useESM: true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
'^.+\\.js$': 'babel-jest'
|
|
16
|
+
},
|
|
17
|
+
testPathIgnorePatterns: ['.*dist/', '.*node_modules/']
|
|
18
|
+
};
|
|
19
|
+
export default jestConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../producers/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TtlCache } from '@forklaunch/core/cache';
|
|
2
|
+
import { WorkerProducer } from '@forklaunch/interfaces-worker/interfaces';
|
|
3
|
+
import { WorkerEventEntity } from '@forklaunch/interfaces-worker/types';
|
|
4
|
+
export declare class RedisWorkerProducer<EventEntity extends WorkerEventEntity> implements WorkerProducer<EventEntity> {
|
|
5
|
+
private readonly queueName;
|
|
6
|
+
private readonly cache;
|
|
7
|
+
constructor(queueName: string, cache: TtlCache);
|
|
8
|
+
enqueueJob(event: EventEntity): Promise<void>;
|
|
9
|
+
enqueueBatchJobs(events: EventEntity[]): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=redisWorker.producer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redisWorker.producer.d.ts","sourceRoot":"","sources":["../../producers/redisWorker.producer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,qBAAa,mBAAmB,CAAC,WAAW,SAAS,iBAAiB,CACpE,YAAW,cAAc,CAAC,WAAW,CAAC;IAGpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,QAAQ;IAG5B,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class RedisWorkerProducer {
|
|
2
|
+
queueName;
|
|
3
|
+
cache;
|
|
4
|
+
constructor(queueName, cache) {
|
|
5
|
+
this.queueName = queueName;
|
|
6
|
+
this.cache = cache;
|
|
7
|
+
}
|
|
8
|
+
async enqueueJob(event) {
|
|
9
|
+
await this.cache.enqueueRecord(this.queueName, event);
|
|
10
|
+
}
|
|
11
|
+
async enqueueBatchJobs(events) {
|
|
12
|
+
console.log('Enqueuing batch jobs', events);
|
|
13
|
+
await this.cache.enqueueBatchRecords(this.queueName, events);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redisWorker.schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const RedisWorkerSchemas: <SchemaValidator extends import("@forklaunch/validator").AnySchemaValidator>(options: Record<string, unknown> & {
|
|
2
|
+
validator: SchemaValidator;
|
|
3
|
+
}) => import("@forklaunch/core/mappers").SchemasByValidator<SchemaValidator, (options: Record<string, unknown>) => {
|
|
4
|
+
pageSize: 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").TDate, import("@sinclair/typebox").TBigInt]>, number>;
|
|
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").TDate, import("@sinclair/typebox").TBigInt]>, 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").TDate, import("@sinclair/typebox").TBigInt]>, number>;
|
|
7
|
+
}, (options: Record<string, unknown>) => {
|
|
8
|
+
pageSize: import("zod").ZodNumber;
|
|
9
|
+
retries: import("zod").ZodNumber;
|
|
10
|
+
interval: import("zod").ZodNumber;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=redisWorker.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redisWorker.schema.d.ts","sourceRoot":"","sources":["../../schemas/redisWorker.schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;;;;EAG9B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { serviceSchemaResolver } from '@forklaunch/core/mappers';
|
|
2
|
+
import { RedisWorkerOptionsSchema as TypeBoxSchemas } from './typebox/redisWorker.schema';
|
|
3
|
+
import { RedisWorkerOptionsSchema as ZodSchemas } from './zod/redisWorker.schema';
|
|
4
|
+
export const RedisWorkerSchemas = serviceSchemaResolver(() => TypeBoxSchemas, () => ZodSchemas);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RedisWorkerOptionsSchema: {
|
|
2
|
+
pageSize: 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").TDate, import("@sinclair/typebox").TBigInt]>, number>;
|
|
3
|
+
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").TDate, import("@sinclair/typebox").TBigInt]>, number>;
|
|
4
|
+
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").TDate, import("@sinclair/typebox").TBigInt]>, number>;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=redisWorker.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redisWorker.schema.d.ts","sourceRoot":"","sources":["../../../schemas/typebox/redisWorker.schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redisWorker.schema.d.ts","sourceRoot":"","sources":["../../../schemas/zod/redisWorker.schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAC"}
|