@uipath/project-executor 1.200.0-preview.120 → 1.201.0-preview.123
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.js +57 -8
- package/dist/src/index.d.ts +2 -0
- package/dist/src/models/run-options.d.ts +13 -7
- package/package.json +34 -38
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// src/models/run-options.ts
|
|
2
2
|
var RunTarget;
|
|
3
3
|
((RunTarget2) => {
|
|
4
|
-
RunTarget2["Online"] = "Online";
|
|
5
4
|
RunTarget2["Local"] = "Local";
|
|
6
5
|
})(RunTarget ||= {});
|
|
7
6
|
// src/models/run-status.ts
|
|
@@ -92,17 +91,23 @@ class RunResult {
|
|
|
92
91
|
return Object.assign(new RunResult("Faulted" /* Faulted */, errorCode, message), init);
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
|
-
// src/services/executor-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
// src/services/executor-tool-import.ts
|
|
95
|
+
async function importExecutorToolModule(specifier) {
|
|
96
|
+
try {
|
|
97
|
+
return { module: await import(specifier) };
|
|
98
|
+
} catch (error) {
|
|
99
|
+
return {
|
|
100
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
101
105
|
// src/services/executor-tool-module.ts
|
|
102
106
|
var EXECUTOR_FACTORY_EXPORT = "createExecutorFactory";
|
|
103
107
|
function isExecutorFactoryModule(module) {
|
|
104
108
|
return typeof module === "object" && module !== null && typeof module[EXECUTOR_FACTORY_EXPORT] === "function";
|
|
105
109
|
}
|
|
110
|
+
|
|
106
111
|
// src/services/executors-factory-repository.ts
|
|
107
112
|
class ExecutorsFactoryRepository {
|
|
108
113
|
factoryMap = new Map;
|
|
@@ -145,6 +150,46 @@ if (!_global[REGISTRY_KEY]) {
|
|
|
145
150
|
_global[REGISTRY_KEY] = new ExecutorsFactoryRepository;
|
|
146
151
|
}
|
|
147
152
|
var executorsFactoryRepository = _global[REGISTRY_KEY];
|
|
153
|
+
|
|
154
|
+
// src/services/executor-factory-provider.ts
|
|
155
|
+
var PROVIDER_KEY = Symbol.for("@uipath/project-executor/executorFactoryProvider");
|
|
156
|
+
var _global2 = globalThis;
|
|
157
|
+
function setExecutorFactoryProvider(provider) {
|
|
158
|
+
_global2[PROVIDER_KEY] = provider;
|
|
159
|
+
}
|
|
160
|
+
function clearExecutorFactoryProvider() {
|
|
161
|
+
_global2[PROVIDER_KEY] = undefined;
|
|
162
|
+
}
|
|
163
|
+
function registerExecutorFactoryFromModule(module, source) {
|
|
164
|
+
if (!isExecutorFactoryModule(module)) {
|
|
165
|
+
throw new Error(`${source} does not export ${EXECUTOR_FACTORY_EXPORT}().`);
|
|
166
|
+
}
|
|
167
|
+
const factory = module.createExecutorFactory();
|
|
168
|
+
executorsFactoryRepository.registerProjectExecutorFactory(factory);
|
|
169
|
+
return factory;
|
|
170
|
+
}
|
|
171
|
+
async function ensureExecutorFactory(verb, packageName) {
|
|
172
|
+
const provider = _global2[PROVIDER_KEY];
|
|
173
|
+
if (provider) {
|
|
174
|
+
await provider(verb);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (!packageName) {
|
|
178
|
+
throw new Error(`Running this project type needs the executor factory for '${verb}', and no package provides it.`);
|
|
179
|
+
}
|
|
180
|
+
const specifier = `${packageName}/executor-tool`;
|
|
181
|
+
const { module, error } = await importExecutorToolModule(specifier);
|
|
182
|
+
if (error) {
|
|
183
|
+
throw new Error(`Running this project type needs '${packageName}'. Install it.`, { cause: error });
|
|
184
|
+
}
|
|
185
|
+
registerExecutorFactoryFromModule(module, specifier);
|
|
186
|
+
}
|
|
187
|
+
// src/services/executor-logger.ts
|
|
188
|
+
var noopExecutorLogger = {
|
|
189
|
+
info: () => {},
|
|
190
|
+
warn: () => {},
|
|
191
|
+
error: () => {}
|
|
192
|
+
};
|
|
148
193
|
// src/services/project-executor.ts
|
|
149
194
|
class ProjectExecutor {
|
|
150
195
|
fileSystem;
|
|
@@ -233,11 +278,15 @@ function messageOf(error) {
|
|
|
233
278
|
return error instanceof Error ? error.message : String(error);
|
|
234
279
|
}
|
|
235
280
|
export {
|
|
281
|
+
setExecutorFactoryProvider,
|
|
282
|
+
registerExecutorFactoryFromModule,
|
|
236
283
|
noopExecutorLogger,
|
|
237
284
|
mapRunStatus,
|
|
238
285
|
isTerminalRunStatus,
|
|
239
286
|
isExecutorFactoryModule,
|
|
240
287
|
executorsFactoryRepository,
|
|
288
|
+
ensureExecutorFactory,
|
|
289
|
+
clearExecutorFactoryProvider,
|
|
241
290
|
TERMINAL_RUN_STATUSES,
|
|
242
291
|
RunTarget,
|
|
243
292
|
RunStatus,
|
|
@@ -249,4 +298,4 @@ export {
|
|
|
249
298
|
EXECUTOR_FACTORY_EXPORT
|
|
250
299
|
};
|
|
251
300
|
|
|
252
|
-
//# debugId=
|
|
301
|
+
//# debugId=18288E109C30117964756E2164756E21
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type { RunStep } from "./models/run-result";
|
|
|
5
5
|
export { RunErrorCode, RunResult } from "./models/run-result";
|
|
6
6
|
export { isTerminalRunStatus, mapRunStatus, RunStatus, TERMINAL_RUN_STATUSES, } from "./models/run-status";
|
|
7
7
|
export type { IProjectExecutorFactory } from "./services/executor-factory";
|
|
8
|
+
export type { ExecutorFactoryProvider } from "./services/executor-factory-provider";
|
|
9
|
+
export { clearExecutorFactoryProvider, ensureExecutorFactory, registerExecutorFactoryFromModule, setExecutorFactoryProvider, } from "./services/executor-factory-provider";
|
|
8
10
|
export type { IExecutorLogger } from "./services/executor-logger";
|
|
9
11
|
export { noopExecutorLogger } from "./services/executor-logger";
|
|
10
12
|
export type { ExecutorFactoryModule } from "./services/executor-tool-module";
|
|
@@ -2,15 +2,21 @@ import type { ProjectType } from "./project-type";
|
|
|
2
2
|
import type { RunStep } from "./run-result";
|
|
3
3
|
import type { RunStatus } from "./run-status";
|
|
4
4
|
/**
|
|
5
|
-
* Where the run executes.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Where the run executes.
|
|
6
|
+
*
|
|
7
|
+
* Legacy, and on its way out. Where a project runs is not a caller's choice but
|
|
8
|
+
* a fact about the project type — RPA drives the Studio on this machine, a
|
|
9
|
+
* low-code agent starts a serverless job because that is the only runtime that
|
|
10
|
+
* executes `agent.json` — so no caller has anything to decide here and
|
|
11
|
+
* `uip solution run` offers no flag for it.
|
|
12
|
+
*
|
|
13
|
+
* The field survives because the published RPA executor validates it, so callers
|
|
14
|
+
* still pass `Local` and it still means something to exactly one implementation.
|
|
15
|
+
* A newer executor ignores it. It becomes optional once no shipped executor
|
|
16
|
+
* checks it.
|
|
9
17
|
*/
|
|
10
18
|
export declare enum RunTarget {
|
|
11
|
-
/**
|
|
12
|
-
Online = "Online",
|
|
13
|
-
/** Local execution on the developer machine. Not implemented yet. */
|
|
19
|
+
/** Local execution on the developer machine. */
|
|
14
20
|
Local = "Local"
|
|
15
21
|
}
|
|
16
22
|
/** Auth/tenant coordinates a project type needs to reach the backends. */
|
package/package.json
CHANGED
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@types/node": "^25.5.2",
|
|
37
|
-
"typescript": "^6.0.2"
|
|
38
|
-
},
|
|
39
|
-
"gitHead": "173ad4b4930bd3e17a493b32e9f1c3c616ea1c10"
|
|
2
|
+
"name": "@uipath/project-executor",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "1.201.0-preview.123",
|
|
5
|
+
"description": "Common run contract implemented by every UiPath project type - the shared ProjectExecutor interface behind 'uip solution run'.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/UiPath/cli.git",
|
|
9
|
+
"directory": "packages/executor/project-executor"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"registry": "https://registry.npmjs.org/"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"uipath",
|
|
16
|
+
"executor",
|
|
17
|
+
"run",
|
|
18
|
+
"solution"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/src/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/src/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@uipath/filesystem": "1.201.0"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "0b5e086775b5974d9df45fc98f96f868bb3dda61"
|
|
40
36
|
}
|