@uipath/packager-tool-workflowcompiler-browser 0.0.29
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/i18n/index.d.ts +7 -0
- package/dist/i18n/locales/en.d.ts +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1104 -0
- package/dist/pack-result-processor.d.ts +17 -0
- package/dist/packager-hub-connection.d.ts +28 -0
- package/dist/project-bundle-executor.d.ts +26 -0
- package/dist/workflow-compiler-tool-factory.d.ts +12 -0
- package/dist/workflow-compiler-tool.d.ts +16 -0
- package/package.json +60 -0
- package/src/i18n/index.ts +45 -0
- package/src/i18n/locales/de.json +34 -0
- package/src/i18n/locales/en.ts +57 -0
- package/src/i18n/locales/es-MX.json +34 -0
- package/src/i18n/locales/es.json +34 -0
- package/src/i18n/locales/fr.json +34 -0
- package/src/i18n/locales/ja.json +34 -0
- package/src/i18n/locales/ko.json +34 -0
- package/src/i18n/locales/pt-BR.json +34 -0
- package/src/i18n/locales/pt.json +34 -0
- package/src/i18n/locales/ro.json +34 -0
- package/src/i18n/locales/ru.json +34 -0
- package/src/i18n/locales/tr.json +34 -0
- package/src/i18n/locales/zh-CN.json +34 -0
- package/src/i18n/locales/zh-TW.json +34 -0
- package/src/i18n/locales/zu.json +34 -0
- package/src/index.ts +7 -0
- package/src/pack-result-processor.ts +309 -0
- package/src/packager-hub-connection.ts +257 -0
- package/src/project-bundle-executor.ts +414 -0
- package/src/workflow-compiler-tool-factory.ts +47 -0
- package/src/workflow-compiler-tool.ts +72 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1104 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
|
|
4
|
+
// src/i18n/index.ts
|
|
5
|
+
import { I18nManager } from "@uipath/solutionpackager-tool-core";
|
|
6
|
+
// src/i18n/locales/de.json
|
|
7
|
+
var de_default = {
|
|
8
|
+
toolWorkflowCompilerBrowser: {
|
|
9
|
+
info: {
|
|
10
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
11
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
12
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
13
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
14
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
15
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
16
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
17
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
18
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
19
|
+
},
|
|
20
|
+
errors: {
|
|
21
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
22
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
23
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
24
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
25
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
26
|
+
noResultForProject: "No result for project",
|
|
27
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
28
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
29
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
30
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
31
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
32
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
33
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
34
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
35
|
+
noOutputForProject: "No output found for project {designId}",
|
|
36
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
37
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// src/i18n/locales/en.ts
|
|
43
|
+
var en = {
|
|
44
|
+
toolWorkflowCompilerBrowser: {
|
|
45
|
+
info: {
|
|
46
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
47
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
48
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
49
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
50
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
51
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
52
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
53
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
54
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
55
|
+
},
|
|
56
|
+
errors: {
|
|
57
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
58
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
59
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
60
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
61
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
62
|
+
noResultForProject: "No result for project",
|
|
63
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
64
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
65
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
66
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
67
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
68
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
69
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
70
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
71
|
+
noOutputForProject: "No output found for project {designId}",
|
|
72
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
73
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// src/i18n/locales/es.json
|
|
78
|
+
var es_default = {
|
|
79
|
+
toolWorkflowCompilerBrowser: {
|
|
80
|
+
info: {
|
|
81
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
82
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
83
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
84
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
85
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
86
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
87
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
88
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
89
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
90
|
+
},
|
|
91
|
+
errors: {
|
|
92
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
93
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
94
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
95
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
96
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
97
|
+
noResultForProject: "No result for project",
|
|
98
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
99
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
100
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
101
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
102
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
103
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
104
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
105
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
106
|
+
noOutputForProject: "No output found for project {designId}",
|
|
107
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
108
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
// src/i18n/locales/es-MX.json
|
|
113
|
+
var es_MX_default = {
|
|
114
|
+
toolWorkflowCompilerBrowser: {
|
|
115
|
+
info: {
|
|
116
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
117
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
118
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
119
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
120
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
121
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
122
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
123
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
124
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
125
|
+
},
|
|
126
|
+
errors: {
|
|
127
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
128
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
129
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
130
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
131
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
132
|
+
noResultForProject: "No result for project",
|
|
133
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
134
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
135
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
136
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
137
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
138
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
139
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
140
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
141
|
+
noOutputForProject: "No output found for project {designId}",
|
|
142
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
143
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
// src/i18n/locales/fr.json
|
|
148
|
+
var fr_default = {
|
|
149
|
+
toolWorkflowCompilerBrowser: {
|
|
150
|
+
info: {
|
|
151
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
152
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
153
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
154
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
155
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
156
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
157
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
158
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
159
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
160
|
+
},
|
|
161
|
+
errors: {
|
|
162
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
163
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
164
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
165
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
166
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
167
|
+
noResultForProject: "No result for project",
|
|
168
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
169
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
170
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
171
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
172
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
173
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
174
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
175
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
176
|
+
noOutputForProject: "No output found for project {designId}",
|
|
177
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
178
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
// src/i18n/locales/ja.json
|
|
183
|
+
var ja_default = {
|
|
184
|
+
toolWorkflowCompilerBrowser: {
|
|
185
|
+
info: {
|
|
186
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
187
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
188
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
189
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
190
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
191
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
192
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
193
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
194
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
195
|
+
},
|
|
196
|
+
errors: {
|
|
197
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
198
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
199
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
200
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
201
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
202
|
+
noResultForProject: "No result for project",
|
|
203
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
204
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
205
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
206
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
207
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
208
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
209
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
210
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
211
|
+
noOutputForProject: "No output found for project {designId}",
|
|
212
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
213
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
// src/i18n/locales/ko.json
|
|
218
|
+
var ko_default = {
|
|
219
|
+
toolWorkflowCompilerBrowser: {
|
|
220
|
+
info: {
|
|
221
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
222
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
223
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
224
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
225
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
226
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
227
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
228
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
229
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
230
|
+
},
|
|
231
|
+
errors: {
|
|
232
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
233
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
234
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
235
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
236
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
237
|
+
noResultForProject: "No result for project",
|
|
238
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
239
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
240
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
241
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
242
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
243
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
244
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
245
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
246
|
+
noOutputForProject: "No output found for project {designId}",
|
|
247
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
248
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
// src/i18n/locales/pt.json
|
|
253
|
+
var pt_default = {
|
|
254
|
+
toolWorkflowCompilerBrowser: {
|
|
255
|
+
info: {
|
|
256
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
257
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
258
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
259
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
260
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
261
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
262
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
263
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
264
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
265
|
+
},
|
|
266
|
+
errors: {
|
|
267
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
268
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
269
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
270
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
271
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
272
|
+
noResultForProject: "No result for project",
|
|
273
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
274
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
275
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
276
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
277
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
278
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
279
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
280
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
281
|
+
noOutputForProject: "No output found for project {designId}",
|
|
282
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
283
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
// src/i18n/locales/pt-BR.json
|
|
288
|
+
var pt_BR_default = {
|
|
289
|
+
toolWorkflowCompilerBrowser: {
|
|
290
|
+
info: {
|
|
291
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
292
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
293
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
294
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
295
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
296
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
297
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
298
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
299
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
300
|
+
},
|
|
301
|
+
errors: {
|
|
302
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
303
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
304
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
305
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
306
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
307
|
+
noResultForProject: "No result for project",
|
|
308
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
309
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
310
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
311
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
312
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
313
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
314
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
315
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
316
|
+
noOutputForProject: "No output found for project {designId}",
|
|
317
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
318
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
// src/i18n/locales/ro.json
|
|
323
|
+
var ro_default = {
|
|
324
|
+
toolWorkflowCompilerBrowser: {
|
|
325
|
+
info: {
|
|
326
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
327
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
328
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
329
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
330
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
331
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
332
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
333
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
334
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
335
|
+
},
|
|
336
|
+
errors: {
|
|
337
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
338
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
339
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
340
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
341
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
342
|
+
noResultForProject: "No result for project",
|
|
343
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
344
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
345
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
346
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
347
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
348
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
349
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
350
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
351
|
+
noOutputForProject: "No output found for project {designId}",
|
|
352
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
353
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
// src/i18n/locales/ru.json
|
|
358
|
+
var ru_default = {
|
|
359
|
+
toolWorkflowCompilerBrowser: {
|
|
360
|
+
info: {
|
|
361
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
362
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
363
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
364
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
365
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
366
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
367
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
368
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
369
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
370
|
+
},
|
|
371
|
+
errors: {
|
|
372
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
373
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
374
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
375
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
376
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
377
|
+
noResultForProject: "No result for project",
|
|
378
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
379
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
380
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
381
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
382
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
383
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
384
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
385
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
386
|
+
noOutputForProject: "No output found for project {designId}",
|
|
387
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
388
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
// src/i18n/locales/tr.json
|
|
393
|
+
var tr_default = {
|
|
394
|
+
toolWorkflowCompilerBrowser: {
|
|
395
|
+
info: {
|
|
396
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
397
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
398
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
399
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
400
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
401
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
402
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
403
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
404
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
405
|
+
},
|
|
406
|
+
errors: {
|
|
407
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
408
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
409
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
410
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
411
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
412
|
+
noResultForProject: "No result for project",
|
|
413
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
414
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
415
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
416
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
417
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
418
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
419
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
420
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
421
|
+
noOutputForProject: "No output found for project {designId}",
|
|
422
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
423
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
// src/i18n/locales/zh-CN.json
|
|
428
|
+
var zh_CN_default = {
|
|
429
|
+
toolWorkflowCompilerBrowser: {
|
|
430
|
+
info: {
|
|
431
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
432
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
433
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
434
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
435
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
436
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
437
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
438
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
439
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
440
|
+
},
|
|
441
|
+
errors: {
|
|
442
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
443
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
444
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
445
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
446
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
447
|
+
noResultForProject: "No result for project",
|
|
448
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
449
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
450
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
451
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
452
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
453
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
454
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
455
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
456
|
+
noOutputForProject: "No output found for project {designId}",
|
|
457
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
458
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
// src/i18n/locales/zh-TW.json
|
|
463
|
+
var zh_TW_default = {
|
|
464
|
+
toolWorkflowCompilerBrowser: {
|
|
465
|
+
info: {
|
|
466
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
467
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
468
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
469
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
470
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
471
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
472
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
473
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
474
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
475
|
+
},
|
|
476
|
+
errors: {
|
|
477
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
478
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
479
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
480
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
481
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
482
|
+
noResultForProject: "No result for project",
|
|
483
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
484
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
485
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
486
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
487
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
488
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
489
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
490
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
491
|
+
noOutputForProject: "No output found for project {designId}",
|
|
492
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
493
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
// src/i18n/locales/zu.json
|
|
498
|
+
var zu_default = {
|
|
499
|
+
toolWorkflowCompilerBrowser: {
|
|
500
|
+
info: {
|
|
501
|
+
startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
|
|
502
|
+
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
503
|
+
remoteAgentStartedExecution: "Remote agent started execution",
|
|
504
|
+
downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
|
|
505
|
+
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
506
|
+
distributingPackages: "Distributing packages for {count} project(s)",
|
|
507
|
+
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
508
|
+
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
509
|
+
copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
|
|
510
|
+
},
|
|
511
|
+
errors: {
|
|
512
|
+
missingConnectionInfo: "Missing connection info (cloudUrl, accessToken, or folderId)",
|
|
513
|
+
signalRConnectionFailed: "Failed to connect to SignalR hub",
|
|
514
|
+
hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
|
|
515
|
+
packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
|
|
516
|
+
packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
|
|
517
|
+
noResultForProject: "No result for project",
|
|
518
|
+
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
519
|
+
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
520
|
+
packAgentDisconnected: "Pack agent disconnected unexpectedly",
|
|
521
|
+
deleteBucketFailed: "Unable to delete temporary storage bucket on Orchestrator: {statusText}",
|
|
522
|
+
cleanupBucketFailed: "Unable to cleanup remote bucket {bucketId}: {message}",
|
|
523
|
+
getBucketUriFailed: "Failed to get bucket read URI ({status}): {errorText}",
|
|
524
|
+
downloadArchiveFailed: "Failed to download archive from bucket ({status}): {statusText}",
|
|
525
|
+
noMatchingProject: "No matching project found for path: {projectPath}",
|
|
526
|
+
noOutputForProject: "No output found for project {designId}",
|
|
527
|
+
distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
|
|
528
|
+
sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
// src/i18n/index.ts
|
|
534
|
+
I18nManager.registerTranslations("en", en);
|
|
535
|
+
I18nManager.registerTranslations("de", de_default);
|
|
536
|
+
I18nManager.registerTranslations("es", es_default);
|
|
537
|
+
I18nManager.registerTranslations("es-MX", es_MX_default);
|
|
538
|
+
I18nManager.registerTranslations("fr", fr_default);
|
|
539
|
+
I18nManager.registerTranslations("ja", ja_default);
|
|
540
|
+
I18nManager.registerTranslations("ko", ko_default);
|
|
541
|
+
I18nManager.registerTranslations("pt", pt_default);
|
|
542
|
+
I18nManager.registerTranslations("pt-BR", pt_BR_default);
|
|
543
|
+
I18nManager.registerTranslations("ro", ro_default);
|
|
544
|
+
I18nManager.registerTranslations("ru", ru_default);
|
|
545
|
+
I18nManager.registerTranslations("tr", tr_default);
|
|
546
|
+
I18nManager.registerTranslations("zh-CN", zh_CN_default);
|
|
547
|
+
I18nManager.registerTranslations("zh-TW", zh_TW_default);
|
|
548
|
+
I18nManager.registerTranslations("zu", zu_default);
|
|
549
|
+
|
|
550
|
+
// src/workflow-compiler-tool-factory.ts
|
|
551
|
+
import {
|
|
552
|
+
ProjectTypes
|
|
553
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
554
|
+
|
|
555
|
+
// src/project-bundle-executor.ts
|
|
556
|
+
import {
|
|
557
|
+
ToolResult as ToolResult2,
|
|
558
|
+
toRelativeUrl as toRelativeUrl2,
|
|
559
|
+
translate as translate3
|
|
560
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
561
|
+
|
|
562
|
+
// src/pack-result-processor.ts
|
|
563
|
+
import {
|
|
564
|
+
ToolErrorCodes,
|
|
565
|
+
ToolResult,
|
|
566
|
+
toRelativeUrl,
|
|
567
|
+
translate,
|
|
568
|
+
ZipService
|
|
569
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
570
|
+
|
|
571
|
+
class PackResultProcessor {
|
|
572
|
+
fileSystem;
|
|
573
|
+
logger;
|
|
574
|
+
zipService;
|
|
575
|
+
constructor(fileSystem, logger) {
|
|
576
|
+
this.fileSystem = fileSystem;
|
|
577
|
+
this.logger = logger;
|
|
578
|
+
this.zipService = new ZipService(fileSystem);
|
|
579
|
+
}
|
|
580
|
+
async processAsync(bucketId, projects, context) {
|
|
581
|
+
const connection = context.connection;
|
|
582
|
+
const results = new Map;
|
|
583
|
+
const tempDir = await this.fileSystem.getTempDir();
|
|
584
|
+
const extractPath = `${tempDir}/pack-result-${context.id}`;
|
|
585
|
+
try {
|
|
586
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.downloadingArchive", { bucketId }));
|
|
587
|
+
const zipData = await this.downloadArchiveAsync(bucketId, connection);
|
|
588
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.extractingArchive", { size: zipData.length, path: extractPath }));
|
|
589
|
+
await this.zipService.extractAsync(zipData, extractPath);
|
|
590
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.distributingPackages", { count: projects.size }));
|
|
591
|
+
await this.distributePackages(extractPath, projects, context, results);
|
|
592
|
+
} catch (error) {
|
|
593
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
594
|
+
for (const [projectPath] of projects) {
|
|
595
|
+
if (!results.has(projectPath)) {
|
|
596
|
+
results.set(projectPath, ToolResult.error("PackResultError", message));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
} finally {
|
|
600
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.cleaningUpTempDir", { path: extractPath }));
|
|
601
|
+
await this.fileSystem.rm(extractPath).catch(() => {});
|
|
602
|
+
await this.deleteBucketAsync(bucketId, connection);
|
|
603
|
+
}
|
|
604
|
+
return results;
|
|
605
|
+
}
|
|
606
|
+
async downloadArchiveAsync(bucketId, connection) {
|
|
607
|
+
const blobAccess = await this.getReadUriAsync(bucketId, connection);
|
|
608
|
+
return await this.downloadBlobAsync(blobAccess);
|
|
609
|
+
}
|
|
610
|
+
async deleteBucketAsync(bucketId, connection) {
|
|
611
|
+
try {
|
|
612
|
+
if (!bucketId) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const baseUrl = toRelativeUrl(connection.cloudUrl);
|
|
616
|
+
const url = `${baseUrl}/orchestrator_/odata/Buckets(${bucketId})`;
|
|
617
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.deletingBucket", {
|
|
618
|
+
bucketId
|
|
619
|
+
}));
|
|
620
|
+
const response = await fetch(url, {
|
|
621
|
+
method: "DELETE",
|
|
622
|
+
headers: {
|
|
623
|
+
Authorization: `Bearer ${connection.accessToken}`,
|
|
624
|
+
"X-UIPATH-OrganizationUnitId": connection.folderId ?? ""
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
if (!response.ok) {
|
|
628
|
+
throw new Error(translate.t("toolWorkflowCompilerBrowser.errors.deleteBucketFailed", { statusText: response.statusText }));
|
|
629
|
+
}
|
|
630
|
+
} catch (error) {
|
|
631
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
632
|
+
this.logger?.warn(translate.t("toolWorkflowCompilerBrowser.errors.cleanupBucketFailed", { bucketId, message }));
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
async getReadUriAsync(bucketId, connection) {
|
|
636
|
+
const baseUrl = toRelativeUrl(connection.cloudUrl);
|
|
637
|
+
const url = `${baseUrl}/orchestrator_/odata/Buckets(${bucketId})` + `/UiPath.Server.Configuration.OData.GetReadUri` + `?path=rpa-packages.zip&expiryInMinutes=0`;
|
|
638
|
+
const response = await fetch(url, {
|
|
639
|
+
method: "GET",
|
|
640
|
+
headers: {
|
|
641
|
+
Authorization: `Bearer ${connection.accessToken}`,
|
|
642
|
+
"X-UIPATH-OrganizationUnitId": connection.folderId ?? ""
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
if (!response.ok) {
|
|
646
|
+
const errorText = await response.text();
|
|
647
|
+
throw new Error(translate.t("toolWorkflowCompilerBrowser.errors.getBucketUriFailed", { status: response.status, errorText }));
|
|
648
|
+
}
|
|
649
|
+
return await response.json();
|
|
650
|
+
}
|
|
651
|
+
async downloadBlobAsync(blobAccess) {
|
|
652
|
+
const headers = {};
|
|
653
|
+
if (blobAccess.Headers) {
|
|
654
|
+
for (const [key, value] of Object.entries(blobAccess.Headers)) {
|
|
655
|
+
headers[key] = value;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
const response = await fetch(blobAccess.Uri, {
|
|
659
|
+
method: blobAccess.Verb || "GET",
|
|
660
|
+
headers
|
|
661
|
+
});
|
|
662
|
+
if (!response.ok) {
|
|
663
|
+
throw new Error(translate.t("toolWorkflowCompilerBrowser.errors.downloadArchiveFailed", {
|
|
664
|
+
status: response.status,
|
|
665
|
+
statusText: response.statusText
|
|
666
|
+
}));
|
|
667
|
+
}
|
|
668
|
+
const buffer = await response.arrayBuffer();
|
|
669
|
+
return new Uint8Array(buffer);
|
|
670
|
+
}
|
|
671
|
+
async distributePackages(extractPath, projects, context, results) {
|
|
672
|
+
for (const [projectPath, entry] of projects) {
|
|
673
|
+
const project = context.solution.Projects.find((p) => p.ProjectPath === projectPath);
|
|
674
|
+
if (!project) {
|
|
675
|
+
results.set(projectPath, ToolResult.error("PackResultError", translate.t("toolWorkflowCompilerBrowser.errors.noMatchingProject", { projectPath })));
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
const designId = project.Id;
|
|
679
|
+
const projectFilesDir = `${extractPath}/${designId}`;
|
|
680
|
+
const outputPath = entry.options.outputPath;
|
|
681
|
+
try {
|
|
682
|
+
const exists = await this.fileSystem.exists(projectFilesDir);
|
|
683
|
+
if (!exists) {
|
|
684
|
+
results.set(projectPath, ToolResult.error("PackResultError", translate.t("toolWorkflowCompilerBrowser.errors.noOutputForProject", { designId })));
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const files = await this.fileSystem.readdir(projectFilesDir);
|
|
688
|
+
const outputFiles = [];
|
|
689
|
+
await this.fileSystem.mkdir(outputPath);
|
|
690
|
+
this.logger?.info(translate.t("toolWorkflowCompilerBrowser.info.copyingFiles", {
|
|
691
|
+
count: files.length,
|
|
692
|
+
designId,
|
|
693
|
+
path: outputPath
|
|
694
|
+
}));
|
|
695
|
+
for (const fileName of files) {
|
|
696
|
+
const srcFile = `${projectFilesDir}/${fileName}`;
|
|
697
|
+
const destFile = `${outputPath}/${fileName}`;
|
|
698
|
+
const data = await this.fileSystem.readFile(srcFile);
|
|
699
|
+
if (data) {
|
|
700
|
+
await this.fileSystem.writeFile(destFile, data);
|
|
701
|
+
outputFiles.push(destFile);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
results.set(projectPath, new ToolResult(ToolErrorCodes.Success, undefined, outputFiles));
|
|
705
|
+
} catch (error) {
|
|
706
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
707
|
+
results.set(projectPath, ToolResult.error("PackResultError", translate.t("toolWorkflowCompilerBrowser.errors.distributePackagesFailed", { designId, message })));
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/packager-hub-connection.ts
|
|
714
|
+
import {
|
|
715
|
+
HttpTransportType,
|
|
716
|
+
HubConnectionBuilder,
|
|
717
|
+
HubConnectionState
|
|
718
|
+
} from "@microsoft/signalr";
|
|
719
|
+
import {
|
|
720
|
+
LogLevel,
|
|
721
|
+
LogMessage,
|
|
722
|
+
translate as translate2
|
|
723
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
724
|
+
function toLogLevel(level) {
|
|
725
|
+
switch (level) {
|
|
726
|
+
case "Debug":
|
|
727
|
+
return LogLevel.Debug;
|
|
728
|
+
case "Information":
|
|
729
|
+
return LogLevel.Info;
|
|
730
|
+
case "Warning":
|
|
731
|
+
return LogLevel.Warn;
|
|
732
|
+
case "Error":
|
|
733
|
+
return LogLevel.Error;
|
|
734
|
+
default:
|
|
735
|
+
return LogLevel.Info;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
class PackagerHubConnection {
|
|
739
|
+
logger;
|
|
740
|
+
hubConnection = null;
|
|
741
|
+
completionResolve = null;
|
|
742
|
+
completionReject = null;
|
|
743
|
+
constructor(logger) {
|
|
744
|
+
this.logger = logger;
|
|
745
|
+
}
|
|
746
|
+
async connectAsync(hubUrl, accessToken) {
|
|
747
|
+
try {
|
|
748
|
+
this.hubConnection = this.buildConnection(hubUrl, accessToken);
|
|
749
|
+
this.registerHandlers();
|
|
750
|
+
this.registerOnClose();
|
|
751
|
+
await this.hubConnection.start();
|
|
752
|
+
} catch (error) {
|
|
753
|
+
if (error instanceof Error && error.message.toLowerCase().includes("websocket")) {
|
|
754
|
+
this.hubConnection = this.buildConnection(hubUrl, accessToken, true);
|
|
755
|
+
this.registerHandlers();
|
|
756
|
+
this.registerOnClose();
|
|
757
|
+
await this.hubConnection.start();
|
|
758
|
+
} else {
|
|
759
|
+
throw error;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
buildConnection(hubUrl, accessToken, disableWs = false) {
|
|
764
|
+
return new HubConnectionBuilder().withUrl(hubUrl, {
|
|
765
|
+
accessTokenFactory: () => accessToken,
|
|
766
|
+
transport: disableWs ? HttpTransportType.ServerSentEvents | HttpTransportType.LongPolling : undefined
|
|
767
|
+
}).withAutomaticReconnect().build();
|
|
768
|
+
}
|
|
769
|
+
registerOnClose() {
|
|
770
|
+
this.hubConnection?.onclose((error) => {
|
|
771
|
+
this.logger?.info(`[PackagerHub] onclose fired. error=${error?.message ?? "none"}, hasReject=${!!this.completionReject}, hasResolve=${!!this.completionResolve}`);
|
|
772
|
+
if (this.completionReject) {
|
|
773
|
+
this.completionReject(error ?? new Error(translate2.t("toolWorkflowCompilerBrowser.errors.hubConnectionClosed")));
|
|
774
|
+
this.completionResolve = null;
|
|
775
|
+
this.completionReject = null;
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
waitForCompletionAsync() {
|
|
780
|
+
return new Promise((resolve, reject) => {
|
|
781
|
+
this.completionResolve = resolve;
|
|
782
|
+
this.completionReject = reject;
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
async disconnectAsync() {
|
|
786
|
+
if (this.hubConnection && this.hubConnection.state !== HubConnectionState.Disconnected) {
|
|
787
|
+
await this.hubConnection.stop();
|
|
788
|
+
}
|
|
789
|
+
this.hubConnection = null;
|
|
790
|
+
}
|
|
791
|
+
registerHandlers() {
|
|
792
|
+
if (!this.hubConnection)
|
|
793
|
+
return;
|
|
794
|
+
this.hubConnection.on("SetExecutionCompleted" /* SetExecutionCompleted */, (jsonCommand) => {
|
|
795
|
+
this.onExecutionCompleted(jsonCommand);
|
|
796
|
+
});
|
|
797
|
+
this.hubConnection.on("SetLogMessage" /* SetLogMessage */, (jsonCommand) => {
|
|
798
|
+
this.onLogMessage(jsonCommand);
|
|
799
|
+
});
|
|
800
|
+
this.hubConnection.on("SetExecutionStarted" /* SetExecutionStarted */, (_jsonCommand) => {
|
|
801
|
+
this.logger?.info(translate2.t("toolWorkflowCompilerBrowser.info.remoteAgentStartedExecution"));
|
|
802
|
+
});
|
|
803
|
+
this.hubConnection.on("PeerDisconnected" /* PeerDisconnected */, () => {
|
|
804
|
+
this.logger?.info(`[PackagerHub] PeerDisconnected received. hasReject=${!!this.completionReject}`);
|
|
805
|
+
if (this.completionReject) {
|
|
806
|
+
this.completionReject(new Error(translate2.t("toolWorkflowCompilerBrowser.errors.packAgentDisconnected")));
|
|
807
|
+
this.completionResolve = null;
|
|
808
|
+
this.completionReject = null;
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
onLogMessage(jsonCommand) {
|
|
813
|
+
if (!this.logger)
|
|
814
|
+
return;
|
|
815
|
+
const command = JSON.parse(jsonCommand);
|
|
816
|
+
const agentLog = command.Argument1;
|
|
817
|
+
const logLevel = toLogLevel(agentLog.LogLevel);
|
|
818
|
+
const logMessage = new LogMessage(agentLog.Message, logLevel, {
|
|
819
|
+
source: agentLog.Source,
|
|
820
|
+
sourceTarget: agentLog.SourceTarget,
|
|
821
|
+
progress: agentLog.Progress,
|
|
822
|
+
code: agentLog.Code,
|
|
823
|
+
filePath: agentLog.FilePath,
|
|
824
|
+
line: agentLog.Line,
|
|
825
|
+
id: agentLog.Id
|
|
826
|
+
});
|
|
827
|
+
this.logger.logMessage(logMessage);
|
|
828
|
+
}
|
|
829
|
+
onExecutionCompleted(jsonCommand) {
|
|
830
|
+
this.logger?.info(`[PackagerHub] onExecutionCompleted called. hasResolve=${!!this.completionResolve}, raw=${jsonCommand}`);
|
|
831
|
+
if (!this.completionResolve) {
|
|
832
|
+
this.logger?.warn(`[PackagerHub] onExecutionCompleted: completionResolve is null, ignoring result`);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
const command = JSON.parse(jsonCommand);
|
|
836
|
+
const jobResult = command.Argument1;
|
|
837
|
+
this.logger?.info(`[PackagerHub] onExecutionCompleted parsed: errorCode=${jobResult.ErrorCode}, status=${jobResult.Status}, message=${jobResult.Message}, bucketId=${jobResult.BucketId}`);
|
|
838
|
+
this.completionResolve({
|
|
839
|
+
errorCode: jobResult.ErrorCode,
|
|
840
|
+
status: jobResult.Status,
|
|
841
|
+
message: jobResult.Message,
|
|
842
|
+
bucketId: jobResult.BucketId
|
|
843
|
+
});
|
|
844
|
+
this.completionResolve = null;
|
|
845
|
+
this.completionReject = null;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// src/project-bundle-executor.ts
|
|
850
|
+
class ProjectBundleExecutor {
|
|
851
|
+
toolFactory;
|
|
852
|
+
fileSystem;
|
|
853
|
+
static SESSION_TIMEOUT_MS = 1800000;
|
|
854
|
+
sessions = new Map;
|
|
855
|
+
pendingSessionCreations = new Map;
|
|
856
|
+
constructor(toolFactory, fileSystem) {
|
|
857
|
+
this.toolFactory = toolFactory;
|
|
858
|
+
this.fileSystem = fileSystem;
|
|
859
|
+
}
|
|
860
|
+
async packAsync(options, context) {
|
|
861
|
+
const projectPath = options.projectPath;
|
|
862
|
+
context.logger?.info(`[BundleExecutor] packAsync called for project: ${projectPath}`);
|
|
863
|
+
const session = await this.getSessionAsync(context);
|
|
864
|
+
let resolve;
|
|
865
|
+
const promise = new Promise((r) => {
|
|
866
|
+
resolve = r;
|
|
867
|
+
});
|
|
868
|
+
session.projects.set(projectPath, { options, resolve });
|
|
869
|
+
const allReceived = session.projects.size === session.expectedCount;
|
|
870
|
+
context.logger?.info(`[BundleExecutor] session: ${session.projects.size}/${session.expectedCount} projects received. allReceived=${allReceived}`);
|
|
871
|
+
if (allReceived) {
|
|
872
|
+
clearTimeout(session.timeout);
|
|
873
|
+
await this.packOnAgentAsync(session, context);
|
|
874
|
+
this.sessions.delete(context.id);
|
|
875
|
+
}
|
|
876
|
+
return promise;
|
|
877
|
+
}
|
|
878
|
+
getSessionAsync(context) {
|
|
879
|
+
const existing = this.sessions.get(context.id);
|
|
880
|
+
if (existing) {
|
|
881
|
+
return Promise.resolve(existing);
|
|
882
|
+
}
|
|
883
|
+
let pending = this.pendingSessionCreations.get(context.id);
|
|
884
|
+
if (!pending) {
|
|
885
|
+
pending = this.createSessionAsync(context);
|
|
886
|
+
this.pendingSessionCreations.set(context.id, pending);
|
|
887
|
+
}
|
|
888
|
+
return pending;
|
|
889
|
+
}
|
|
890
|
+
async createSessionAsync(context) {
|
|
891
|
+
const expectedCount = this.countCompatibleProjects(context);
|
|
892
|
+
const session = {
|
|
893
|
+
expectedCount,
|
|
894
|
+
projects: new Map
|
|
895
|
+
};
|
|
896
|
+
session.timeout = setTimeout(() => {
|
|
897
|
+
if (session.projects.size < session.expectedCount) {
|
|
898
|
+
context.logger?.error(`[BundleExecutor] Session timed out after ${ProjectBundleExecutor.SESSION_TIMEOUT_MS}ms: ` + `received ${session.projects.size}/${session.expectedCount} projects`);
|
|
899
|
+
this.resolveAll(session, ToolResult2.error("SessionTimeoutError", translate3.t("toolWorkflowCompilerBrowser.errors.sessionTimeout", {
|
|
900
|
+
received: session.projects.size,
|
|
901
|
+
expected: session.expectedCount
|
|
902
|
+
})));
|
|
903
|
+
this.sessions.delete(context.id);
|
|
904
|
+
}
|
|
905
|
+
}, ProjectBundleExecutor.SESSION_TIMEOUT_MS);
|
|
906
|
+
this.sessions.set(context.id, session);
|
|
907
|
+
this.pendingSessionCreations.delete(context.id);
|
|
908
|
+
return session;
|
|
909
|
+
}
|
|
910
|
+
async packOnAgentAsync(session, context) {
|
|
911
|
+
const projectPaths = [...session.projects.keys()];
|
|
912
|
+
context.logger?.info(translate3.t("toolWorkflowCompilerBrowser.info.startingRemotePackAgent", {
|
|
913
|
+
count: session.expectedCount,
|
|
914
|
+
paths: projectPaths.join(", ")
|
|
915
|
+
}));
|
|
916
|
+
const connection = context.connection;
|
|
917
|
+
context.logger?.info(`[BundleExecutor] connection info: cloudUrl=${connection?.cloudUrl ?? "MISSING"}, hasToken=${!!connection?.accessToken}, folderId=${connection?.folderId ?? "MISSING"}`);
|
|
918
|
+
if (!connection?.cloudUrl || !connection.accessToken || !connection.folderId) {
|
|
919
|
+
this.resolveAll(session, ToolResult2.error("ConnectionError", translate3.t("toolWorkflowCompilerBrowser.errors.missingConnectionInfo")));
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
const sessionId = crypto.randomUUID();
|
|
923
|
+
const hubConnection = await this.connectToHubAsync(connection, sessionId, context.logger);
|
|
924
|
+
if (!hubConnection) {
|
|
925
|
+
this.resolveAll(session, ToolResult2.error("SignalRConnectionError", translate3.t("toolWorkflowCompilerBrowser.errors.signalRConnectionFailed")));
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
try {
|
|
929
|
+
context.logger?.info(`[BundleExecutor] Sending BeginSession...`);
|
|
930
|
+
await this.sendBeginSessionAsync(session, context, connection, sessionId);
|
|
931
|
+
context.logger?.info(`[BundleExecutor] BeginSession succeeded. Waiting for completion...`);
|
|
932
|
+
const result = await hubConnection.waitForCompletionAsync();
|
|
933
|
+
context.logger?.info(`[BundleExecutor] Got result: errorCode=${result.errorCode}, status=${result.status}, message=${result.message}, bucketId=${result.bucketId}`);
|
|
934
|
+
await this.handlePackResultAsync(result, session, context);
|
|
935
|
+
} catch (error) {
|
|
936
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
937
|
+
context.logger?.error(`[BundleExecutor] packOnAgentAsync caught error: ${message}`);
|
|
938
|
+
this.resolveAll(session, ToolResult2.error("PackAgentError", message));
|
|
939
|
+
} finally {
|
|
940
|
+
await hubConnection.disconnectAsync();
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
async connectToHubAsync(connection, sessionId, logger) {
|
|
944
|
+
const relativeBase = toRelativeUrl2(connection.cloudUrl);
|
|
945
|
+
const hubUrl = `${relativeBase}/orchestrator_/signalr/robotdebug?sessionId=${sessionId}`;
|
|
946
|
+
logger?.info(translate3.t("toolWorkflowCompilerBrowser.info.connectingToHub", {
|
|
947
|
+
url: hubUrl
|
|
948
|
+
}));
|
|
949
|
+
const hubConnection = new PackagerHubConnection(logger);
|
|
950
|
+
try {
|
|
951
|
+
await hubConnection.connectAsync(hubUrl, connection.accessToken);
|
|
952
|
+
return hubConnection;
|
|
953
|
+
} catch (error) {
|
|
954
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
955
|
+
logger?.error(translate3.t("toolWorkflowCompilerBrowser.errors.hubConnectionFailed", { url: hubUrl, message }));
|
|
956
|
+
return null;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
async handlePackResultAsync(result, session, context) {
|
|
960
|
+
if (result.errorCode !== 0 || result.status !== 0 /* Succeeded */) {
|
|
961
|
+
this.resolveAll(session, ToolResult2.error("PackAgentError", result.message ?? translate3.t("toolWorkflowCompilerBrowser.errors.packAgentFailed", {
|
|
962
|
+
status: result.status,
|
|
963
|
+
errorCode: result.errorCode
|
|
964
|
+
})));
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
if (result.bucketId == null) {
|
|
968
|
+
this.resolveAll(session, ToolResult2.error("PackAgentError", translate3.t("toolWorkflowCompilerBrowser.errors.packSucceededNoBucket")));
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
const resultProcessor = new PackResultProcessor(this.fileSystem, context.logger);
|
|
972
|
+
const perProjectResults = await resultProcessor.processAsync(result.bucketId, session.projects, context);
|
|
973
|
+
for (const [projectPath, entry] of session.projects) {
|
|
974
|
+
const projectResult = perProjectResults.get(projectPath);
|
|
975
|
+
entry.resolve(projectResult ?? ToolResult2.error("PackResultError", translate3.t("toolWorkflowCompilerBrowser.errors.noResultForProject")));
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
async sendBeginSessionAsync(session, context, connection, sessionId) {
|
|
979
|
+
const relativeBase = toRelativeUrl2(connection.cloudUrl);
|
|
980
|
+
const url = `${relativeBase}/orchestrator_/api/serverless/jobs`;
|
|
981
|
+
context.logger?.info(`[BundleExecutor] BeginSession URL: ${url}`);
|
|
982
|
+
const firstEntry = session.projects.values().next().value;
|
|
983
|
+
const pkg = firstEntry.options.package;
|
|
984
|
+
const opts = firstEntry.options;
|
|
985
|
+
const rpaProjects = [...session.projects.entries()].map(([projectPath, entry]) => {
|
|
986
|
+
const project = context.solution.Projects.find((p) => p.ProjectPath === projectPath);
|
|
987
|
+
return {
|
|
988
|
+
RelativePath: project?.ProjectRelativePath ?? "",
|
|
989
|
+
DesignId: project?.Id ?? "",
|
|
990
|
+
PackageId: entry.options.package.id
|
|
991
|
+
};
|
|
992
|
+
});
|
|
993
|
+
const executorInfo = JSON.stringify({
|
|
994
|
+
Command: "Pack",
|
|
995
|
+
SupportedProtocolVersions: ["2.0"],
|
|
996
|
+
ProjectId: "",
|
|
997
|
+
DownloadUrl: context.downloadUrl ?? "",
|
|
998
|
+
SessionId: sessionId,
|
|
999
|
+
ProfileKey: "StudioWeb",
|
|
1000
|
+
LicenseType: "Development",
|
|
1001
|
+
LogLevel: opts.logLevel ?? "Warning",
|
|
1002
|
+
Name: pkg.id,
|
|
1003
|
+
Configuration: context.configuration,
|
|
1004
|
+
Culture: "en-US",
|
|
1005
|
+
Version: pkg.version,
|
|
1006
|
+
Author: pkg.author ?? "",
|
|
1007
|
+
Description: pkg.description ?? "",
|
|
1008
|
+
SkipAnalyze: String(opts.skipAnalyze),
|
|
1009
|
+
SkipValidate: String(opts.skipValidate),
|
|
1010
|
+
TargetFramework: context.targetFramework,
|
|
1011
|
+
RpaProjects: rpaProjects,
|
|
1012
|
+
WorkflowCompilerVersion: context.workflowCompilerVersion ?? ""
|
|
1013
|
+
});
|
|
1014
|
+
const body = {
|
|
1015
|
+
source: "StudioWeb",
|
|
1016
|
+
targetFramework: context.targetFramework,
|
|
1017
|
+
jobType: "PublishStudioProject",
|
|
1018
|
+
inputArguments: executorInfo
|
|
1019
|
+
};
|
|
1020
|
+
const headers = {
|
|
1021
|
+
"Content-Type": "application/json",
|
|
1022
|
+
Authorization: `Bearer ${connection.accessToken}`,
|
|
1023
|
+
"X-UIPATH-OrganizationUnitId": connection.folderId ?? ""
|
|
1024
|
+
};
|
|
1025
|
+
if (connection.tenantId) {
|
|
1026
|
+
headers["x-uipath-tenantid"] = connection.tenantId;
|
|
1027
|
+
}
|
|
1028
|
+
const response = await fetch(url, {
|
|
1029
|
+
method: "POST",
|
|
1030
|
+
headers,
|
|
1031
|
+
body: JSON.stringify(body)
|
|
1032
|
+
});
|
|
1033
|
+
if (!response.ok) {
|
|
1034
|
+
const errorText = await response.text();
|
|
1035
|
+
throw new Error(translate3.t("toolWorkflowCompilerBrowser.errors.beginSessionFailed", { status: response.status, errorText }));
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
resolveAll(session, result) {
|
|
1039
|
+
for (const [, entry] of session.projects) {
|
|
1040
|
+
entry.resolve(result);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
countCompatibleProjects(context) {
|
|
1044
|
+
return context.solution.Projects.filter((p) => p.ProjectPath != null && this.toolFactory.supportedTypes.includes(p.Type)).length;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
// src/workflow-compiler-tool.ts
|
|
1049
|
+
import {
|
|
1050
|
+
ProjectTool,
|
|
1051
|
+
ToolResult as ToolResult3
|
|
1052
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
1053
|
+
|
|
1054
|
+
class WorkflowCompilerTool extends ProjectTool {
|
|
1055
|
+
bundleExecutor;
|
|
1056
|
+
context;
|
|
1057
|
+
constructor(fileSystem, logger, bundleExecutor, context) {
|
|
1058
|
+
super(fileSystem, logger);
|
|
1059
|
+
this.bundleExecutor = bundleExecutor;
|
|
1060
|
+
this.context = context;
|
|
1061
|
+
}
|
|
1062
|
+
async restoreAsync(_options, _cancellationToken) {
|
|
1063
|
+
this.logger.warn("Restore operation is not supported in browser environment");
|
|
1064
|
+
return ToolResult3.success();
|
|
1065
|
+
}
|
|
1066
|
+
async validateAsync(_options, _cancellationToken) {
|
|
1067
|
+
this.logger.warn("Validate operation is not supported in browser environment");
|
|
1068
|
+
return ToolResult3.success();
|
|
1069
|
+
}
|
|
1070
|
+
async buildAsync(_options, _cancellationToken) {
|
|
1071
|
+
this.logger.warn("Build operation is not supported in browser environment");
|
|
1072
|
+
return ToolResult3.success();
|
|
1073
|
+
}
|
|
1074
|
+
async packAsync(options, _cancellationToken) {
|
|
1075
|
+
if (!this.context) {
|
|
1076
|
+
this.logger.warn("Pack operation requires a project operation context");
|
|
1077
|
+
return ToolResult3.success();
|
|
1078
|
+
}
|
|
1079
|
+
return this.bundleExecutor.packAsync(options, this.context);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// src/workflow-compiler-tool-factory.ts
|
|
1084
|
+
class WorkflowCompilerToolFactory {
|
|
1085
|
+
bundleExecutor;
|
|
1086
|
+
supportedTypes = [
|
|
1087
|
+
ProjectTypes.Process,
|
|
1088
|
+
ProjectTypes.Library,
|
|
1089
|
+
ProjectTypes.Tests,
|
|
1090
|
+
ProjectTypes.WebApp
|
|
1091
|
+
];
|
|
1092
|
+
async createAsync(logger, fileSystem, context) {
|
|
1093
|
+
return new WorkflowCompilerTool(fileSystem, logger, this.getBundleExecutor(fileSystem), context);
|
|
1094
|
+
}
|
|
1095
|
+
getBundleExecutor(fileSystem) {
|
|
1096
|
+
if (!this.bundleExecutor) {
|
|
1097
|
+
this.bundleExecutor = new ProjectBundleExecutor(this, fileSystem);
|
|
1098
|
+
}
|
|
1099
|
+
return this.bundleExecutor;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
// src/index.ts
|
|
1104
|
+
toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory);
|