@unchainedshop/core-worker 2.11.3 → 2.12.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.
@@ -1,3 +1,4 @@
1
1
  import { mongodb } from '@unchainedshop/mongodb';
2
2
  import { Work } from '@unchainedshop/types/worker.js';
3
3
  export declare const WorkQueueCollection: (db: mongodb.Db) => Promise<mongodb.Collection<Work>>;
4
+ //# sourceMappingURL=WorkQueueCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkQueueCollection.d.ts","sourceRoot":"","sources":["../../src/db/WorkQueueCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAItD,eAAO,MAAM,mBAAmB,OAAc,OAAO,CAAC,EAAE,sCA8BvD,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import SimpleSchema from 'simpl-schema';
2
2
  export declare const WorkQueueSchema: SimpleSchema;
3
+ //# sourceMappingURL=WorkQueueSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkQueueSchema.d.ts","sourceRoot":"","sources":["../../src/db/WorkQueueSchema.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,eAAe,cAmB3B,CAAC"}
@@ -5,3 +5,4 @@ export declare enum WorkStatus {
5
5
  FAILED = "FAILED",
6
6
  DELETED = "DELETED"
7
7
  }
8
+ //# sourceMappingURL=WorkStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkStatus.d.ts","sourceRoot":"","sources":["../../src/director/WorkStatus.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB"}
@@ -1,2 +1,3 @@
1
1
  import { IWorkerAdapter } from '@unchainedshop/types/worker.js';
2
2
  export declare const WorkerAdapter: Omit<IWorkerAdapter<any, void>, 'key' | 'label' | 'type' | 'version'>;
3
+ //# sourceMappingURL=WorkerAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerAdapter.d.ts","sourceRoot":"","sources":["../../src/director/WorkerAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAU/F,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { IWorkerDirector } from '@unchainedshop/types/worker.js';
2
2
  export declare const DIRECTOR_MARKED_FAILED_ERROR = "DIRECTOR_MARKED_FAILED";
3
3
  export declare const WorkerDirector: IWorkerDirector;
4
+ //# sourceMappingURL=WorkerDirector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerDirector.d.ts","sourceRoot":"","sources":["../../src/director/WorkerDirector.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAQrE,eAAO,MAAM,cAAc,EAAE,eAwF5B,CAAC"}
@@ -6,3 +6,4 @@ export declare enum WorkerEventTypes {
6
6
  DELETED = "WORK_DELETED",
7
7
  RESCHEDULED = "WORK_RESCHEDULED"
8
8
  }
9
+ //# sourceMappingURL=WorkerEventTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerEventTypes.d.ts","sourceRoot":"","sources":["../../src/director/WorkerEventTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,KAAK,eAAe;IACpB,SAAS,mBAAmB;IAC5B,IAAI,cAAc;IAClB,QAAQ,kBAAkB;IAC1B,OAAO,iBAAiB;IACxB,WAAW,qBAAqB;CACjC"}
@@ -17,21 +17,21 @@ export declare const buildQuerySelector: ({ created, scheduled, types, status, w
17
17
  types?: Array<string>;
18
18
  }) => {
19
19
  [x: string]: any;
20
+ input?: mongodb.Condition<Record<string, any>>;
21
+ type?: mongodb.Condition<string>;
22
+ worker?: mongodb.Condition<string>;
20
23
  error?: any;
21
24
  timeout?: mongodb.Condition<number>;
25
+ result?: any;
26
+ started?: mongodb.Condition<Date>;
27
+ updated?: mongodb.Condition<Date>;
28
+ deleted?: mongodb.Condition<Date>;
29
+ originalWorkId?: mongodb.Condition<string>;
22
30
  priority?: mongodb.Condition<number>;
23
31
  retries?: mongodb.Condition<number>;
24
- type?: mongodb.Condition<string>;
25
- input?: mongodb.Condition<Record<string, any>>;
26
32
  finished?: mongodb.Condition<Date>;
27
- originalWorkId?: mongodb.Condition<string>;
28
- result?: any;
29
- started?: mongodb.Condition<Date>;
30
33
  success?: mongodb.Condition<boolean>;
31
- worker?: mongodb.Condition<string>;
32
34
  autoscheduled?: mongodb.Condition<boolean>;
33
- updated?: mongodb.Condition<Date>;
34
- deleted?: mongodb.Condition<Date>;
35
35
  _id?: mongodb.Condition<string>;
36
36
  $and?: mongodb.Filter<mongodb.WithId<Work>>[];
37
37
  $nor?: mongodb.Filter<mongodb.WithId<Work>>[];
@@ -44,7 +44,8 @@ export declare const buildQuerySelector: ({ created, scheduled, types, status, w
44
44
  };
45
45
  $where?: string | ((this: mongodb.WithId<Work>) => boolean);
46
46
  $comment?: string | mongodb.BSON.Document;
47
- scheduled?: mongodb.Condition<Date>;
48
47
  created?: mongodb.Condition<Date>;
48
+ scheduled?: mongodb.Condition<Date>;
49
49
  };
50
50
  export declare const configureWorkerModule: ({ db, options, }: ModuleInput<WorkerSettingsOptions>) => Promise<WorkerModule>;
51
+ //# sourceMappingURL=configureWorkerModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configureWorkerModule.d.ts","sourceRoot":"","sources":["../../src/module/configureWorkerModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAmB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAIL,OAAO,EACR,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAMvD,eAAO,MAAM,kBAAkB,wEAQ5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG;IACxB,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;IACvC,SAAS,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;IACzC,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;;;;;;;;;;;;;;;;;;;;;;;iBA2ci59O,CAAC;sBAAgC,CAAC;2BAAsC,CAAC;;;;;;CAtZ199O,CAAC;AASF,eAAO,MAAM,qBAAqB,qBAG/B,WAAW,CAAC,qBAAqB,CAAC,KAAG,OAAO,CAAC,YAAY,CAyY3D,CAAC"}
@@ -3,3 +3,4 @@ export interface FailedReschedulerParams {
3
3
  retryInput?: (workData: WorkData, priorInput: Record<string, any>) => Promise<Record<string, any> | null>;
4
4
  }
5
5
  export declare const FailedRescheduler: IScheduler<FailedReschedulerParams>;
6
+ //# sourceMappingURL=FailedRescheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FailedRescheduler.d.ts","sourceRoot":"","sources":["../../src/schedulers/FailedRescheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAK5E,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,CACX,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,uBAAuB,CAsDjE,CAAC"}
@@ -7,3 +7,4 @@ export { FailedRescheduler } from './schedulers/FailedRescheduler.js';
7
7
  export { BaseWorker } from './workers/BaseWorker.js';
8
8
  export { EventListenerWorker } from './workers/EventListenerWorker.js';
9
9
  export { IntervalWorker } from './workers/IntervalWorker.js';
10
+ //# sourceMappingURL=worker-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-index.d.ts","sourceRoot":"","sources":["../src/worker-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
@@ -5,3 +5,4 @@ interface WorkerParams {
5
5
  }
6
6
  export declare const BaseWorker: IWorker<WorkerParams>;
7
7
  export {};
8
+ //# sourceMappingURL=BaseWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseWorker.d.ts","sourceRoot":"","sources":["../../src/workers/BaseWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,gCAAgC,CAAC;AAKnE,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,YAAY,CAsF5C,CAAC"}
@@ -3,3 +3,4 @@ export interface EventListenerWorkerParams {
3
3
  workerId?: string;
4
4
  }
5
5
  export declare const EventListenerWorker: IWorker<EventListenerWorkerParams>;
6
+ //# sourceMappingURL=EventListenerWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventListenerWorker.d.ts","sourceRoot":"","sources":["../../src/workers/EventListenerWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAgBzD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,yBAAyB,CAyClE,CAAC"}
@@ -6,3 +6,4 @@ export interface IntervalWorkerParams {
6
6
  }
7
7
  export declare const scheduleToInterval: (scheduleRaw: WorkerSchedule | string) => number;
8
8
  export declare const IntervalWorker: IWorker<IntervalWorkerParams>;
9
+ //# sourceMappingURL=IntervalWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntervalWorker.d.ts","sourceRoot":"","sources":["../../src/workers/IntervalWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAMzE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;CACpC;AAMD,eAAO,MAAM,kBAAkB,gBAAiB,cAAc,GAAG,MAAM,WAMtE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,oBAAoB,CA+BxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-worker",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
4
4
  "main": "lib/worker-index.js",
5
5
  "exports": {
6
6
  ".": "./lib/worker-index.js",
@@ -32,15 +32,15 @@
32
32
  "homepage": "https://github.com/unchainedshop/unchained#readme",
33
33
  "dependencies": {
34
34
  "@breejs/later": "^4.2.0",
35
- "@unchainedshop/logger": "^2.11.3",
36
- "@unchainedshop/utils": "^2.11.3",
35
+ "@unchainedshop/logger": "^2.12.0",
36
+ "@unchainedshop/utils": "^2.12.0",
37
37
  "simpl-schema": "^3.4.6"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^20.14.9",
41
- "@unchainedshop/types": "^2.11.3",
41
+ "@unchainedshop/types": "^2.12.0",
42
42
  "jest": "^29.7.0",
43
43
  "ts-jest": "^29.1.5",
44
- "typescript": "^5.4.5"
44
+ "typescript": "^5.5.3"
45
45
  }
46
46
  }