@forklaunch/interfaces-worker 0.1.2 → 0.1.4
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/interfaces/index.d.ts +1 -1
- package/lib/interfaces/worker.consumer.interface.d.ts +3 -3
- package/lib/interfaces/worker.producer.interface.d.ts +3 -3
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/types/index.d.ts +1 -1
- package/lib/types/worker.consumer.types.d.ts +5 -9
- package/lib/types/workerEventEntity.types.d.ts +4 -4
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +1 -1
- package/lib/types/eventEntity.types.d.ts +0 -6
- package/lib/types/eventEntity.types.d.ts.map +0 -1
- package/lib/types/eventEntity.types.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface WorkerConsumer<T> {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
peekEvents: () => Promise<T[]>;
|
|
3
|
+
start: () => Promise<void>;
|
|
4
4
|
}
|
|
5
|
-
//# sourceMappingURL=worker.consumer.interface.d.ts.map
|
|
5
|
+
//# sourceMappingURL=worker.consumer.interface.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface WorkerProducer<T> {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
enqueueJob: (job: T) => Promise<void>;
|
|
3
|
+
enqueueBatchJobs: (jobs: T[]) => Promise<void>;
|
|
4
4
|
}
|
|
5
|
-
//# sourceMappingURL=worker.producer.interface.d.ts.map
|
|
5
|
+
//# sourceMappingURL=worker.producer.interface.d.ts.map
|
package/lib/jest.config.d.ts
CHANGED
package/lib/jest.config.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const jestConfig = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
18
|
};
|
|
19
19
|
export default jestConfig;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
export type WorkerProcessFailureResult<T> = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
value: T;
|
|
3
|
+
error: Error;
|
|
4
4
|
};
|
|
5
|
-
export type WorkerProcessFunction<T> = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type WorkerFailureHandler<T> = (
|
|
9
|
-
results: WorkerProcessFailureResult<T>[]
|
|
10
|
-
) => Promise<void>;
|
|
11
|
-
//# sourceMappingURL=worker.consumer.types.d.ts.map
|
|
5
|
+
export type WorkerProcessFunction<T> = (events: T[]) => Promise<WorkerProcessFailureResult<T>[]>;
|
|
6
|
+
export type WorkerFailureHandler<T> = (results: WorkerProcessFailureResult<T>[]) => Promise<void>;
|
|
7
|
+
//# sourceMappingURL=worker.consumer.types.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type WorkerEventEntity = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
id: string;
|
|
3
|
+
retryCount: number;
|
|
4
|
+
processed: boolean;
|
|
5
5
|
};
|
|
6
|
-
//# sourceMappingURL=workerEventEntity.types.d.ts.map
|
|
6
|
+
//# sourceMappingURL=workerEventEntity.types.d.ts.map
|
package/lib/vitest.config.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import("vite").UserConfig;
|
|
2
2
|
export default _default;
|
|
3
|
-
//# sourceMappingURL=vitest.config.d.ts.map
|
|
3
|
+
//# sourceMappingURL=vitest.config.d.ts.map
|
package/lib/vitest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventEntity.types.d.ts","sourceRoot":"","sources":["../../types/eventEntity.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|