@easyrpa/sheduler 1.0.3 → 1.0.5
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/dist/index.d.ts +2 -5
- package/dist/index.js +3 -9
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { type WorkerOptions } from "node:worker_threads";
|
|
|
3
3
|
import { CollectionType } from "@easyrpa/script-creator";
|
|
4
4
|
export interface ISheduler {
|
|
5
5
|
pathJobs: string;
|
|
6
|
-
collections: CollectionType[];
|
|
7
6
|
runJobs(jobsOptions: JobOptionsType[]): Promise<string[] | undefined>;
|
|
8
7
|
runJob(jobOptions: JobOptionsType): Promise<string | undefined>;
|
|
9
8
|
stopJob(jobOptions: JobOptionsType): Promise<string | undefined>;
|
|
@@ -28,12 +27,10 @@ export declare class Sheduler implements ISheduler {
|
|
|
28
27
|
_sheduler: Bree;
|
|
29
28
|
_encriptKey: string;
|
|
30
29
|
_pythonPath: string;
|
|
31
|
-
_collections: CollectionType[];
|
|
32
30
|
_onWorkerCreated?: (id: string) => void | Promise<void>;
|
|
33
31
|
_onWorkerDeleted?: (id: string) => void | Promise<void>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
set collections(cols: CollectionType[]);
|
|
32
|
+
handleGetCollections: () => Promise<CollectionType[]>;
|
|
33
|
+
constructor(config: ShedulerConfig, handleGetCollections: () => Promise<CollectionType[]>);
|
|
37
34
|
prepareJobsDirectory(): Promise<void>;
|
|
38
35
|
createJobsDirectory(): Promise<void>;
|
|
39
36
|
clearJobsDirectory(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import fsPromises from "fs/promises";
|
|
|
6
6
|
import { AES, enc } from "crypto-ts";
|
|
7
7
|
import { ScriptCreator } from "@easyrpa/script-creator";
|
|
8
8
|
export class Sheduler {
|
|
9
|
-
constructor(config,
|
|
9
|
+
constructor(config, handleGetCollections) {
|
|
10
10
|
this._logger = config.logger;
|
|
11
11
|
this._encriptKey = config.encriptKey;
|
|
12
12
|
this._pythonPath = config.pythonPath;
|
|
@@ -28,16 +28,10 @@ export class Sheduler {
|
|
|
28
28
|
this.pathJobs = config.pathJobs;
|
|
29
29
|
this._onWorkerCreated = config.onWorkerCreated;
|
|
30
30
|
this._onWorkerDeleted = config.onWorkerDeleted;
|
|
31
|
-
this.
|
|
31
|
+
this.handleGetCollections = handleGetCollections;
|
|
32
32
|
this.prepareJobsDirectory();
|
|
33
33
|
this.addWorkerListeners();
|
|
34
34
|
}
|
|
35
|
-
get collections() {
|
|
36
|
-
return this._collections;
|
|
37
|
-
}
|
|
38
|
-
set collections(cols) {
|
|
39
|
-
this._collections = cols;
|
|
40
|
-
}
|
|
41
35
|
//Подготовка директории со скриптами задач
|
|
42
36
|
async prepareJobsDirectory() {
|
|
43
37
|
//Проверка наличия директории с задачами
|
|
@@ -68,7 +62,7 @@ export class Sheduler {
|
|
|
68
62
|
const decryptedData = AES.decrypt(jobOptions.flow.content, this._encriptKey);
|
|
69
63
|
const dataFlow = JSON.parse(decryptedData.toString(enc.Utf8));
|
|
70
64
|
// создаем python скрипт для схемы
|
|
71
|
-
const scriptCreator = new ScriptCreator(this.
|
|
65
|
+
const scriptCreator = new ScriptCreator(this.handleGetCollections);
|
|
72
66
|
const scriptPath = await scriptCreator.createScript(path.join(this.pathJobs, jobOptions._id), dataFlow.nodes, dataFlow.edges);
|
|
73
67
|
return scriptPath;
|
|
74
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyrpa/sheduler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Sheduler for easy rpa",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@breejs/ts-worker": "^2.0.0",
|
|
29
|
-
"@easyrpa/script-creator": "^1.0.
|
|
29
|
+
"@easyrpa/script-creator": "^1.0.9",
|
|
30
30
|
"bree": "^9.2.9",
|
|
31
31
|
"crypto-ts": "^1.0.2"
|
|
32
32
|
},
|