@digipair/skill-process 0.49.0 → 0.49.1
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/index.cjs.js +8 -6
- package/index.esm.js +8 -6
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -66,7 +66,7 @@ let ProcessService = class ProcessService {
|
|
|
66
66
|
const id = v4();
|
|
67
67
|
const abortController = new AbortController();
|
|
68
68
|
const time = Date.now();
|
|
69
|
-
this.
|
|
69
|
+
this.processList.push({
|
|
70
70
|
id,
|
|
71
71
|
time,
|
|
72
72
|
digipair,
|
|
@@ -80,12 +80,14 @@ let ProcessService = class ProcessService {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
remove(id) {
|
|
83
|
-
|
|
83
|
+
const process = this.processList.find((p)=>p.id === id);
|
|
84
|
+
process == null ? void 0 : process.abortController.abort();
|
|
85
|
+
this.processList = this.processList.filter((p)=>p.id !== id);
|
|
84
86
|
}
|
|
85
87
|
async stop(params, _pinsSettingsList, _context) {
|
|
86
88
|
var _process_res;
|
|
87
89
|
const { id } = params;
|
|
88
|
-
const process = this.
|
|
90
|
+
const process = this.processList.find((p)=>p.id === id);
|
|
89
91
|
if (!process) {
|
|
90
92
|
return false;
|
|
91
93
|
}
|
|
@@ -93,11 +95,11 @@ let ProcessService = class ProcessService {
|
|
|
93
95
|
(_process_res = process.res) == null ? void 0 : _process_res.status(503).send({
|
|
94
96
|
status: 'stopped'
|
|
95
97
|
});
|
|
96
|
-
this.
|
|
98
|
+
this.processList = this.processList.filter((p)=>p.id !== id);
|
|
97
99
|
return true;
|
|
98
100
|
}
|
|
99
101
|
async list(_params, _pinsSettingsList, _context) {
|
|
100
|
-
return this.
|
|
102
|
+
return this.processList.map((p)=>({
|
|
101
103
|
id: p.id,
|
|
102
104
|
digipair: p.digipair,
|
|
103
105
|
reasoning: p.reasoning,
|
|
@@ -105,7 +107,7 @@ let ProcessService = class ProcessService {
|
|
|
105
107
|
}));
|
|
106
108
|
}
|
|
107
109
|
constructor(){
|
|
108
|
-
this.
|
|
110
|
+
this.processList = [];
|
|
109
111
|
}
|
|
110
112
|
};
|
|
111
113
|
const instance = new ProcessService();
|
package/index.esm.js
CHANGED
|
@@ -62,7 +62,7 @@ let ProcessService = class ProcessService {
|
|
|
62
62
|
const id = v4();
|
|
63
63
|
const abortController = new AbortController();
|
|
64
64
|
const time = Date.now();
|
|
65
|
-
this.
|
|
65
|
+
this.processList.push({
|
|
66
66
|
id,
|
|
67
67
|
time,
|
|
68
68
|
digipair,
|
|
@@ -76,12 +76,14 @@ let ProcessService = class ProcessService {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
remove(id) {
|
|
79
|
-
|
|
79
|
+
const process = this.processList.find((p)=>p.id === id);
|
|
80
|
+
process == null ? void 0 : process.abortController.abort();
|
|
81
|
+
this.processList = this.processList.filter((p)=>p.id !== id);
|
|
80
82
|
}
|
|
81
83
|
async stop(params, _pinsSettingsList, _context) {
|
|
82
84
|
var _process_res;
|
|
83
85
|
const { id } = params;
|
|
84
|
-
const process = this.
|
|
86
|
+
const process = this.processList.find((p)=>p.id === id);
|
|
85
87
|
if (!process) {
|
|
86
88
|
return false;
|
|
87
89
|
}
|
|
@@ -89,11 +91,11 @@ let ProcessService = class ProcessService {
|
|
|
89
91
|
(_process_res = process.res) == null ? void 0 : _process_res.status(503).send({
|
|
90
92
|
status: 'stopped'
|
|
91
93
|
});
|
|
92
|
-
this.
|
|
94
|
+
this.processList = this.processList.filter((p)=>p.id !== id);
|
|
93
95
|
return true;
|
|
94
96
|
}
|
|
95
97
|
async list(_params, _pinsSettingsList, _context) {
|
|
96
|
-
return this.
|
|
98
|
+
return this.processList.map((p)=>({
|
|
97
99
|
id: p.id,
|
|
98
100
|
digipair: p.digipair,
|
|
99
101
|
reasoning: p.reasoning,
|
|
@@ -101,7 +103,7 @@ let ProcessService = class ProcessService {
|
|
|
101
103
|
}));
|
|
102
104
|
}
|
|
103
105
|
constructor(){
|
|
104
|
-
this.
|
|
106
|
+
this.processList = [];
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
const instance = new ProcessService();
|