@uipath/project-packager 1.1.5 → 1.1.10
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 +1770 -720
- package/dist/node.js +1776 -834
- package/dist/src/i18n/index.d.ts +1 -1
- package/dist/src/i18n/locales/en.d.ts +19 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/models/packager-parameters.d.ts +10 -0
- package/dist/src/services/governance-policy-service.d.ts +30 -0
- package/dist/src/services/project-packager.d.ts +1 -0
- package/dist/tests/governance-policy-service.test.d.ts +1 -0
- package/dist/tests/project-packager-e2e.test.d.ts +5 -5
- package/package.json +20 -19
- package/dist/index.js.map +0 -1
- package/dist/node.js.map +0 -1
package/dist/node.js
CHANGED
|
@@ -1,915 +1,1857 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
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
|
-
|
|
37
|
-
}
|
|
1
|
+
// src/i18n/index.ts
|
|
2
|
+
import { I18nManager } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
// src/i18n/locales/de.json
|
|
4
|
+
var de_default = {
|
|
5
|
+
solutionpackager: {
|
|
6
|
+
projectLoader: {
|
|
7
|
+
errors: {
|
|
8
|
+
pathRequired: "Project directory path is required",
|
|
9
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
10
|
+
readFailed: "Failed to read project file: {path}",
|
|
11
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
validator: {
|
|
15
|
+
errors: {
|
|
16
|
+
destinationNotDefined: "Destination path is not defined",
|
|
17
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
18
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
19
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
packager: {
|
|
23
|
+
errors: {
|
|
24
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
25
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
governance: {
|
|
29
|
+
info: {
|
|
30
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
31
|
+
saved: "Governance policy saved to {path}",
|
|
32
|
+
downloading: "Downloading governance policy from {url}",
|
|
33
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
34
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
35
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
36
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
37
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
38
|
+
},
|
|
39
|
+
errors: {
|
|
40
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
41
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
42
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
43
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
signing: {
|
|
47
|
+
errors: {
|
|
48
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
49
|
+
},
|
|
50
|
+
info: {
|
|
51
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
52
|
+
}
|
|
38
53
|
}
|
|
54
|
+
}
|
|
39
55
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
console.error(formattedMessage);
|
|
92
|
-
break;
|
|
56
|
+
|
|
57
|
+
// src/i18n/locales/en.ts
|
|
58
|
+
var en = {
|
|
59
|
+
solutionpackager: {
|
|
60
|
+
projectLoader: {
|
|
61
|
+
errors: {
|
|
62
|
+
pathRequired: "Project directory path is required",
|
|
63
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
64
|
+
readFailed: "Failed to read project file: {path}",
|
|
65
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
validator: {
|
|
69
|
+
errors: {
|
|
70
|
+
destinationNotDefined: "Destination path is not defined",
|
|
71
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
72
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
73
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
packager: {
|
|
77
|
+
errors: {
|
|
78
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
79
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
governance: {
|
|
83
|
+
info: {
|
|
84
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
85
|
+
saved: "Governance policy saved to {path}",
|
|
86
|
+
downloading: "Downloading governance policy from {url}",
|
|
87
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
88
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
89
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
90
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
91
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
92
|
+
},
|
|
93
|
+
errors: {
|
|
94
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
95
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
96
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
97
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
signing: {
|
|
101
|
+
errors: {
|
|
102
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
103
|
+
},
|
|
104
|
+
info: {
|
|
105
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
106
|
+
}
|
|
93
107
|
}
|
|
108
|
+
}
|
|
94
109
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
// src/i18n/locales/es.json
|
|
111
|
+
var es_default = {
|
|
112
|
+
solutionpackager: {
|
|
113
|
+
projectLoader: {
|
|
114
|
+
errors: {
|
|
115
|
+
pathRequired: "Project directory path is required",
|
|
116
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
117
|
+
readFailed: "Failed to read project file: {path}",
|
|
118
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
validator: {
|
|
122
|
+
errors: {
|
|
123
|
+
destinationNotDefined: "Destination path is not defined",
|
|
124
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
125
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
126
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
packager: {
|
|
130
|
+
errors: {
|
|
131
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
132
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
governance: {
|
|
136
|
+
info: {
|
|
137
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
138
|
+
saved: "Governance policy saved to {path}",
|
|
139
|
+
downloading: "Downloading governance policy from {url}",
|
|
140
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
141
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
142
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
143
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
144
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
145
|
+
},
|
|
146
|
+
errors: {
|
|
147
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
148
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
149
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
150
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
signing: {
|
|
154
|
+
errors: {
|
|
155
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
156
|
+
},
|
|
157
|
+
info: {
|
|
158
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
159
|
+
}
|
|
106
160
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
// src/i18n/locales/es-MX.json
|
|
164
|
+
var es_MX_default = {
|
|
165
|
+
solutionpackager: {
|
|
166
|
+
projectLoader: {
|
|
167
|
+
errors: {
|
|
168
|
+
pathRequired: "Project directory path is required",
|
|
169
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
170
|
+
readFailed: "Failed to read project file: {path}",
|
|
171
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
validator: {
|
|
175
|
+
errors: {
|
|
176
|
+
destinationNotDefined: "Destination path is not defined",
|
|
177
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
178
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
179
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
packager: {
|
|
183
|
+
errors: {
|
|
184
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
185
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
governance: {
|
|
189
|
+
info: {
|
|
190
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
191
|
+
saved: "Governance policy saved to {path}",
|
|
192
|
+
downloading: "Downloading governance policy from {url}",
|
|
193
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
194
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
195
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
196
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
197
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
198
|
+
},
|
|
199
|
+
errors: {
|
|
200
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
201
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
202
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
203
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
signing: {
|
|
207
|
+
errors: {
|
|
208
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
209
|
+
},
|
|
210
|
+
info: {
|
|
211
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
212
|
+
}
|
|
114
213
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
// src/i18n/locales/fr.json
|
|
217
|
+
var fr_default = {
|
|
218
|
+
solutionpackager: {
|
|
219
|
+
projectLoader: {
|
|
220
|
+
errors: {
|
|
221
|
+
pathRequired: "Project directory path is required",
|
|
222
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
223
|
+
readFailed: "Failed to read project file: {path}",
|
|
224
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
validator: {
|
|
228
|
+
errors: {
|
|
229
|
+
destinationNotDefined: "Destination path is not defined",
|
|
230
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
231
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
232
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
packager: {
|
|
236
|
+
errors: {
|
|
237
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
238
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
governance: {
|
|
242
|
+
info: {
|
|
243
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
244
|
+
saved: "Governance policy saved to {path}",
|
|
245
|
+
downloading: "Downloading governance policy from {url}",
|
|
246
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
247
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
248
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
249
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
250
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
251
|
+
},
|
|
252
|
+
errors: {
|
|
253
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
254
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
255
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
256
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
signing: {
|
|
260
|
+
errors: {
|
|
261
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
262
|
+
},
|
|
263
|
+
info: {
|
|
264
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
265
|
+
}
|
|
122
266
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
// src/i18n/locales/ja.json
|
|
270
|
+
var ja_default = {
|
|
271
|
+
solutionpackager: {
|
|
272
|
+
projectLoader: {
|
|
273
|
+
errors: {
|
|
274
|
+
pathRequired: "Project directory path is required",
|
|
275
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
276
|
+
readFailed: "Failed to read project file: {path}",
|
|
277
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
validator: {
|
|
281
|
+
errors: {
|
|
282
|
+
destinationNotDefined: "Destination path is not defined",
|
|
283
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
284
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
285
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
packager: {
|
|
289
|
+
errors: {
|
|
290
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
291
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
governance: {
|
|
295
|
+
info: {
|
|
296
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
297
|
+
saved: "Governance policy saved to {path}",
|
|
298
|
+
downloading: "Downloading governance policy from {url}",
|
|
299
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
300
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
301
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
302
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
303
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
304
|
+
},
|
|
305
|
+
errors: {
|
|
306
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
307
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
308
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
309
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
signing: {
|
|
313
|
+
errors: {
|
|
314
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
315
|
+
},
|
|
316
|
+
info: {
|
|
317
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
318
|
+
}
|
|
130
319
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
// src/i18n/locales/ko.json
|
|
323
|
+
var ko_default = {
|
|
324
|
+
solutionpackager: {
|
|
325
|
+
projectLoader: {
|
|
326
|
+
errors: {
|
|
327
|
+
pathRequired: "Project directory path is required",
|
|
328
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
329
|
+
readFailed: "Failed to read project file: {path}",
|
|
330
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
validator: {
|
|
334
|
+
errors: {
|
|
335
|
+
destinationNotDefined: "Destination path is not defined",
|
|
336
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
337
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
338
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
packager: {
|
|
342
|
+
errors: {
|
|
343
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
344
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
governance: {
|
|
348
|
+
info: {
|
|
349
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
350
|
+
saved: "Governance policy saved to {path}",
|
|
351
|
+
downloading: "Downloading governance policy from {url}",
|
|
352
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
353
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
354
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
355
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
356
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
357
|
+
},
|
|
358
|
+
errors: {
|
|
359
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
360
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
361
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
362
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
signing: {
|
|
366
|
+
errors: {
|
|
367
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
368
|
+
},
|
|
369
|
+
info: {
|
|
370
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
371
|
+
}
|
|
138
372
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
// src/i18n/locales/pt.json
|
|
376
|
+
var pt_default = {
|
|
377
|
+
solutionpackager: {
|
|
378
|
+
projectLoader: {
|
|
379
|
+
errors: {
|
|
380
|
+
pathRequired: "Project directory path is required",
|
|
381
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
382
|
+
readFailed: "Failed to read project file: {path}",
|
|
383
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
validator: {
|
|
387
|
+
errors: {
|
|
388
|
+
destinationNotDefined: "Destination path is not defined",
|
|
389
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
390
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
391
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
packager: {
|
|
395
|
+
errors: {
|
|
396
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
397
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
governance: {
|
|
401
|
+
info: {
|
|
402
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
403
|
+
saved: "Governance policy saved to {path}",
|
|
404
|
+
downloading: "Downloading governance policy from {url}",
|
|
405
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
406
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
407
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
408
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
409
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
410
|
+
},
|
|
411
|
+
errors: {
|
|
412
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
413
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
414
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
415
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
signing: {
|
|
419
|
+
errors: {
|
|
420
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
421
|
+
},
|
|
422
|
+
info: {
|
|
423
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
424
|
+
}
|
|
146
425
|
}
|
|
147
|
-
|
|
148
|
-
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
// src/i18n/locales/pt-BR.json
|
|
429
|
+
var pt_BR_default = {
|
|
430
|
+
solutionpackager: {
|
|
431
|
+
projectLoader: {
|
|
432
|
+
errors: {
|
|
433
|
+
pathRequired: "Project directory path is required",
|
|
434
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
435
|
+
readFailed: "Failed to read project file: {path}",
|
|
436
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
validator: {
|
|
440
|
+
errors: {
|
|
441
|
+
destinationNotDefined: "Destination path is not defined",
|
|
442
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
443
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
444
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
packager: {
|
|
448
|
+
errors: {
|
|
449
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
450
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
governance: {
|
|
454
|
+
info: {
|
|
455
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
456
|
+
saved: "Governance policy saved to {path}",
|
|
457
|
+
downloading: "Downloading governance policy from {url}",
|
|
458
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
459
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
460
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
461
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
462
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
463
|
+
},
|
|
464
|
+
errors: {
|
|
465
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
466
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
467
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
468
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
signing: {
|
|
472
|
+
errors: {
|
|
473
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
474
|
+
},
|
|
475
|
+
info: {
|
|
476
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
477
|
+
}
|
|
149
478
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
// src/i18n/locales/ro.json
|
|
482
|
+
var ro_default = {
|
|
483
|
+
solutionpackager: {
|
|
484
|
+
projectLoader: {
|
|
485
|
+
errors: {
|
|
486
|
+
pathRequired: "Project directory path is required",
|
|
487
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
488
|
+
readFailed: "Failed to read project file: {path}",
|
|
489
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
validator: {
|
|
493
|
+
errors: {
|
|
494
|
+
destinationNotDefined: "Destination path is not defined",
|
|
495
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
496
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
497
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
packager: {
|
|
501
|
+
errors: {
|
|
502
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
503
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
governance: {
|
|
507
|
+
info: {
|
|
508
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
509
|
+
saved: "Governance policy saved to {path}",
|
|
510
|
+
downloading: "Downloading governance policy from {url}",
|
|
511
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
512
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
513
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
514
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
515
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
516
|
+
},
|
|
517
|
+
errors: {
|
|
518
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
519
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
520
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
521
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
signing: {
|
|
525
|
+
errors: {
|
|
526
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
527
|
+
},
|
|
528
|
+
info: {
|
|
529
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
530
|
+
}
|
|
155
531
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
// src/i18n/locales/ru.json
|
|
535
|
+
var ru_default = {
|
|
536
|
+
solutionpackager: {
|
|
537
|
+
projectLoader: {
|
|
538
|
+
errors: {
|
|
539
|
+
pathRequired: "Project directory path is required",
|
|
540
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
541
|
+
readFailed: "Failed to read project file: {path}",
|
|
542
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
validator: {
|
|
546
|
+
errors: {
|
|
547
|
+
destinationNotDefined: "Destination path is not defined",
|
|
548
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
549
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
550
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
packager: {
|
|
554
|
+
errors: {
|
|
555
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
556
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
governance: {
|
|
560
|
+
info: {
|
|
561
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
562
|
+
saved: "Governance policy saved to {path}",
|
|
563
|
+
downloading: "Downloading governance policy from {url}",
|
|
564
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
565
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
566
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
567
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
568
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
569
|
+
},
|
|
570
|
+
errors: {
|
|
571
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
572
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
573
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
574
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
signing: {
|
|
578
|
+
errors: {
|
|
579
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
580
|
+
},
|
|
581
|
+
info: {
|
|
582
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
583
|
+
}
|
|
181
584
|
}
|
|
182
|
-
|
|
183
|
-
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
// src/i18n/locales/tr.json
|
|
588
|
+
var tr_default = {
|
|
589
|
+
solutionpackager: {
|
|
590
|
+
projectLoader: {
|
|
591
|
+
errors: {
|
|
592
|
+
pathRequired: "Project directory path is required",
|
|
593
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
594
|
+
readFailed: "Failed to read project file: {path}",
|
|
595
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
validator: {
|
|
599
|
+
errors: {
|
|
600
|
+
destinationNotDefined: "Destination path is not defined",
|
|
601
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
602
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
603
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
packager: {
|
|
607
|
+
errors: {
|
|
608
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
609
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
governance: {
|
|
613
|
+
info: {
|
|
614
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
615
|
+
saved: "Governance policy saved to {path}",
|
|
616
|
+
downloading: "Downloading governance policy from {url}",
|
|
617
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
618
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
619
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
620
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
621
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
622
|
+
},
|
|
623
|
+
errors: {
|
|
624
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
625
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
626
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
627
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
signing: {
|
|
631
|
+
errors: {
|
|
632
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
633
|
+
},
|
|
634
|
+
info: {
|
|
635
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
// src/i18n/locales/zh-CN.json
|
|
641
|
+
var zh_CN_default = {
|
|
642
|
+
solutionpackager: {
|
|
643
|
+
projectLoader: {
|
|
644
|
+
errors: {
|
|
645
|
+
pathRequired: "Project directory path is required",
|
|
646
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
647
|
+
readFailed: "Failed to read project file: {path}",
|
|
648
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
validator: {
|
|
652
|
+
errors: {
|
|
653
|
+
destinationNotDefined: "Destination path is not defined",
|
|
654
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
655
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
656
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
packager: {
|
|
660
|
+
errors: {
|
|
661
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
662
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
governance: {
|
|
666
|
+
info: {
|
|
667
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
668
|
+
saved: "Governance policy saved to {path}",
|
|
669
|
+
downloading: "Downloading governance policy from {url}",
|
|
670
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
671
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
672
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
673
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
674
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
675
|
+
},
|
|
676
|
+
errors: {
|
|
677
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
678
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
679
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
680
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
signing: {
|
|
684
|
+
errors: {
|
|
685
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
686
|
+
},
|
|
687
|
+
info: {
|
|
688
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
// src/i18n/locales/zh-TW.json
|
|
694
|
+
var zh_TW_default = {
|
|
695
|
+
solutionpackager: {
|
|
696
|
+
projectLoader: {
|
|
697
|
+
errors: {
|
|
698
|
+
pathRequired: "Project directory path is required",
|
|
699
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
700
|
+
readFailed: "Failed to read project file: {path}",
|
|
701
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
validator: {
|
|
705
|
+
errors: {
|
|
706
|
+
destinationNotDefined: "Destination path is not defined",
|
|
707
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
708
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
709
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
packager: {
|
|
713
|
+
errors: {
|
|
714
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
715
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
governance: {
|
|
719
|
+
info: {
|
|
720
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
721
|
+
saved: "Governance policy saved to {path}",
|
|
722
|
+
downloading: "Downloading governance policy from {url}",
|
|
723
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
724
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
725
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
726
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
727
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
728
|
+
},
|
|
729
|
+
errors: {
|
|
730
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
731
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
732
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
733
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
signing: {
|
|
737
|
+
errors: {
|
|
738
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
739
|
+
},
|
|
740
|
+
info: {
|
|
741
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
742
|
+
}
|
|
184
743
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
// src/i18n/locales/zu.json
|
|
747
|
+
var zu_default = {
|
|
748
|
+
solutionpackager: {
|
|
749
|
+
projectLoader: {
|
|
750
|
+
errors: {
|
|
751
|
+
pathRequired: "Project directory path is required",
|
|
752
|
+
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
753
|
+
readFailed: "Failed to read project file: {path}",
|
|
754
|
+
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
validator: {
|
|
758
|
+
errors: {
|
|
759
|
+
destinationNotDefined: "Destination path is not defined",
|
|
760
|
+
governanceRequired: "Governance file path is required when governance file type is not Default",
|
|
761
|
+
governanceFileInfo: "Unable to get file information: {path}",
|
|
762
|
+
governanceInvalidFile: "Governance file path is not a valid file: {path}"
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
packager: {
|
|
766
|
+
errors: {
|
|
767
|
+
failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
|
|
768
|
+
failedToReadPackage: "Failed to read package file: {path}"
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
governance: {
|
|
772
|
+
info: {
|
|
773
|
+
alreadyProvided: "Governance policy file already provided, skipping download.",
|
|
774
|
+
saved: "Governance policy saved to {path}",
|
|
775
|
+
downloading: "Downloading governance policy from {url}",
|
|
776
|
+
noPolicyFound: "No governance policy found for this configuration.",
|
|
777
|
+
responseNotJson: "Policy response is not JSON, treating as no policy.",
|
|
778
|
+
licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
|
|
779
|
+
licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
|
|
780
|
+
licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
|
|
781
|
+
},
|
|
782
|
+
errors: {
|
|
783
|
+
connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
|
|
784
|
+
failedToGetPolicy: "Failed to download governance policy: {content}",
|
|
785
|
+
failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
|
|
786
|
+
failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
signing: {
|
|
790
|
+
errors: {
|
|
791
|
+
dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
|
|
792
|
+
},
|
|
793
|
+
info: {
|
|
794
|
+
dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
|
|
795
|
+
}
|
|
188
796
|
}
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
// src/i18n/index.ts
|
|
801
|
+
I18nManager.registerTranslations("en", en);
|
|
802
|
+
I18nManager.registerTranslations("de", de_default);
|
|
803
|
+
I18nManager.registerTranslations("es", es_default);
|
|
804
|
+
I18nManager.registerTranslations("es-MX", es_MX_default);
|
|
805
|
+
I18nManager.registerTranslations("fr", fr_default);
|
|
806
|
+
I18nManager.registerTranslations("ja", ja_default);
|
|
807
|
+
I18nManager.registerTranslations("ko", ko_default);
|
|
808
|
+
I18nManager.registerTranslations("pt", pt_default);
|
|
809
|
+
I18nManager.registerTranslations("pt-BR", pt_BR_default);
|
|
810
|
+
I18nManager.registerTranslations("ro", ro_default);
|
|
811
|
+
I18nManager.registerTranslations("ru", ru_default);
|
|
812
|
+
I18nManager.registerTranslations("tr", tr_default);
|
|
813
|
+
I18nManager.registerTranslations("zh-CN", zh_CN_default);
|
|
814
|
+
I18nManager.registerTranslations("zh-TW", zh_TW_default);
|
|
815
|
+
I18nManager.registerTranslations("zu", zu_default);
|
|
816
|
+
|
|
817
|
+
// src/node.ts
|
|
818
|
+
import {
|
|
819
|
+
ConsoleTelemetryProvider as ConsoleTelemetryProvider2,
|
|
820
|
+
NodeContextStorage as NodeContextStorage2,
|
|
821
|
+
TelemetryService as TelemetryService2
|
|
822
|
+
} from "@uipath/telemetry/node";
|
|
823
|
+
|
|
824
|
+
// src/base-node-packager-factory.ts
|
|
825
|
+
import { execSync } from "node:child_process";
|
|
826
|
+
import { NodeFileSystem } from "@uipath/filesystem";
|
|
827
|
+
import { translate } from "@uipath/solutionpackager-tool-core";
|
|
828
|
+
import {
|
|
829
|
+
ConsoleTelemetryProvider,
|
|
830
|
+
NodeContextStorage,
|
|
831
|
+
TelemetryService
|
|
832
|
+
} from "@uipath/telemetry/node";
|
|
833
|
+
|
|
834
|
+
// src/services/tool-logger.ts
|
|
835
|
+
import {
|
|
836
|
+
LogLevel,
|
|
837
|
+
LogMessage
|
|
838
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
839
|
+
var globalLogHandler = (logMessage) => {
|
|
840
|
+
const formattedMessage = logMessage.toFormattedString();
|
|
841
|
+
switch (logMessage.logLevel) {
|
|
842
|
+
case LogLevel.Debug:
|
|
843
|
+
console.debug(formattedMessage);
|
|
844
|
+
break;
|
|
845
|
+
case LogLevel.Info:
|
|
846
|
+
console.info(formattedMessage);
|
|
847
|
+
break;
|
|
848
|
+
case LogLevel.Warn:
|
|
849
|
+
console.warn(formattedMessage);
|
|
850
|
+
break;
|
|
851
|
+
case LogLevel.Error:
|
|
852
|
+
console.error(formattedMessage);
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
function setGlobalLogHandler(handler) {
|
|
857
|
+
globalLogHandler = handler;
|
|
189
858
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
859
|
+
|
|
860
|
+
class ToolLogger {
|
|
861
|
+
source;
|
|
862
|
+
sourceTarget;
|
|
863
|
+
constructor(source, sourceTarget) {
|
|
864
|
+
this.source = source;
|
|
865
|
+
this.sourceTarget = sourceTarget;
|
|
866
|
+
}
|
|
867
|
+
debug(message, options) {
|
|
868
|
+
const logMessage = new LogMessage(message, LogLevel.Debug, {
|
|
869
|
+
source: this.source,
|
|
870
|
+
sourceTarget: this.sourceTarget,
|
|
871
|
+
...options
|
|
872
|
+
});
|
|
873
|
+
globalLogHandler(logMessage);
|
|
874
|
+
}
|
|
875
|
+
info(message, options) {
|
|
876
|
+
const logMessage = new LogMessage(message, LogLevel.Info, {
|
|
877
|
+
source: this.source,
|
|
878
|
+
sourceTarget: this.sourceTarget,
|
|
879
|
+
...options
|
|
880
|
+
});
|
|
881
|
+
globalLogHandler(logMessage);
|
|
882
|
+
}
|
|
883
|
+
warn(message, options) {
|
|
884
|
+
const logMessage = new LogMessage(message, LogLevel.Warn, {
|
|
885
|
+
source: this.source,
|
|
886
|
+
sourceTarget: this.sourceTarget,
|
|
887
|
+
...options
|
|
888
|
+
});
|
|
889
|
+
globalLogHandler(logMessage);
|
|
890
|
+
}
|
|
891
|
+
error(message, options) {
|
|
892
|
+
const logMessage = new LogMessage(message, LogLevel.Error, {
|
|
893
|
+
source: this.source,
|
|
894
|
+
sourceTarget: this.sourceTarget,
|
|
895
|
+
...options
|
|
896
|
+
});
|
|
897
|
+
globalLogHandler(logMessage);
|
|
898
|
+
}
|
|
899
|
+
progress(message, options) {
|
|
900
|
+
const logMessage = new LogMessage(message, LogLevel.Info, {
|
|
901
|
+
source: this.source,
|
|
902
|
+
sourceTarget: this.sourceTarget,
|
|
903
|
+
...options
|
|
196
904
|
});
|
|
197
|
-
|
|
198
|
-
|
|
905
|
+
globalLogHandler(logMessage);
|
|
906
|
+
}
|
|
907
|
+
log(message, logLevel, options) {
|
|
908
|
+
const logMessage = new LogMessage(message, logLevel, {
|
|
909
|
+
source: this.source,
|
|
910
|
+
sourceTarget: this.sourceTarget,
|
|
911
|
+
...options
|
|
912
|
+
});
|
|
913
|
+
globalLogHandler(logMessage);
|
|
914
|
+
}
|
|
915
|
+
logMessage(message) {
|
|
916
|
+
globalLogHandler(message);
|
|
917
|
+
}
|
|
199
918
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
919
|
+
|
|
920
|
+
// src/base-node-packager-factory.ts
|
|
921
|
+
class BaseNodePackagerFactory {
|
|
922
|
+
getOrCreateFileSystem(config) {
|
|
923
|
+
return config?.fileSystem ?? new NodeFileSystem;
|
|
924
|
+
}
|
|
925
|
+
getOrCreateTelemetryService(config) {
|
|
926
|
+
if (config?.telemetryService) {
|
|
927
|
+
return config.telemetryService;
|
|
928
|
+
}
|
|
929
|
+
const provider = new ConsoleTelemetryProvider;
|
|
930
|
+
const contextStorage = new NodeContextStorage;
|
|
931
|
+
return new TelemetryService(provider, contextStorage);
|
|
932
|
+
}
|
|
933
|
+
checkDotnetAvailability(logger) {
|
|
934
|
+
logger.info("Checking for dotnet CLI availability...");
|
|
935
|
+
try {
|
|
936
|
+
execSync("dotnet --version", {
|
|
937
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
938
|
+
});
|
|
939
|
+
logger.info("dotnet CLI is available.");
|
|
940
|
+
} catch {
|
|
941
|
+
logger.error("dotnet CLI is not available. Workflow compiler functionality and package signing will not be available.");
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
configureLogHandler(config) {
|
|
945
|
+
if (config?.logHandler) {
|
|
946
|
+
setGlobalLogHandler(config.logHandler);
|
|
216
947
|
}
|
|
948
|
+
}
|
|
949
|
+
configureLanguage(config) {
|
|
950
|
+
const language = config?.language ?? "en";
|
|
951
|
+
translate.setLocale(language);
|
|
952
|
+
}
|
|
217
953
|
}
|
|
218
|
-
|
|
954
|
+
// src/models/packager-parameters.ts
|
|
955
|
+
import {
|
|
956
|
+
LogLevel as LogLevel2
|
|
957
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
958
|
+
var RulesConfigFileType;
|
|
959
|
+
((RulesConfigFileType2) => {
|
|
960
|
+
RulesConfigFileType2["Default"] = "Default";
|
|
961
|
+
RulesConfigFileType2["AutomationOps"] = "AutomationOps";
|
|
962
|
+
RulesConfigFileType2["Studio"] = "Studio";
|
|
963
|
+
})(RulesConfigFileType ||= {});
|
|
964
|
+
|
|
965
|
+
class PackagerParameters {
|
|
966
|
+
inputPath;
|
|
967
|
+
logLevel = LogLevel2.Warn;
|
|
968
|
+
outputPath;
|
|
969
|
+
targetFramework;
|
|
970
|
+
excludeConfiguredSources = false;
|
|
971
|
+
nuGetSourcesConfigPath;
|
|
972
|
+
detailedLogPath;
|
|
973
|
+
connection;
|
|
974
|
+
workflowCompilerVersion;
|
|
219
975
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
value: value,
|
|
223
|
-
enumerable: true,
|
|
224
|
-
configurable: true,
|
|
225
|
-
writable: true
|
|
226
|
-
});
|
|
227
|
-
else obj[key] = value;
|
|
228
|
-
return obj;
|
|
976
|
+
// src/models/project-restore-options.ts
|
|
977
|
+
class ProjectRestoreOptions extends PackagerParameters {
|
|
229
978
|
}
|
|
979
|
+
|
|
980
|
+
// src/models/project-validate-options.ts
|
|
230
981
|
class ProjectValidateOptions extends ProjectRestoreOptions {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
});
|
|
236
|
-
}
|
|
982
|
+
validateOptions = {
|
|
983
|
+
skipAnalyze: false,
|
|
984
|
+
governanceFileType: "Default" /* Default */
|
|
985
|
+
};
|
|
237
986
|
}
|
|
987
|
+
|
|
988
|
+
// src/models/project-build-options.ts
|
|
238
989
|
class ProjectBuildOptions extends ProjectValidateOptions {
|
|
239
990
|
}
|
|
240
|
-
|
|
241
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
242
|
-
value: value,
|
|
243
|
-
enumerable: true,
|
|
244
|
-
configurable: true,
|
|
245
|
-
writable: true
|
|
246
|
-
});
|
|
247
|
-
else obj[key] = value;
|
|
248
|
-
return obj;
|
|
249
|
-
}
|
|
991
|
+
// src/models/project-pack-options.ts
|
|
250
992
|
class ProjectPackOptions extends ProjectBuildOptions {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
function package_sign_service_define_property(obj, key, value) {
|
|
256
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
257
|
-
value: value,
|
|
258
|
-
enumerable: true,
|
|
259
|
-
configurable: true,
|
|
260
|
-
writable: true
|
|
261
|
-
});
|
|
262
|
-
else obj[key] = value;
|
|
263
|
-
return obj;
|
|
993
|
+
destinationPath;
|
|
994
|
+
package;
|
|
995
|
+
signingInfo;
|
|
996
|
+
packOptions;
|
|
264
997
|
}
|
|
998
|
+
// src/services/package-sign-service.ts
|
|
999
|
+
import { execSync as execSync2, spawn } from "node:child_process";
|
|
1000
|
+
import {
|
|
1001
|
+
ToolErrorCodes,
|
|
1002
|
+
ToolResult,
|
|
1003
|
+
translate as translate2
|
|
1004
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
1005
|
+
|
|
265
1006
|
class NodePackageSignService {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
packagePath,
|
|
275
|
-
"--certificate-path",
|
|
276
|
-
certificatePath,
|
|
277
|
-
"--overwrite"
|
|
278
|
-
];
|
|
279
|
-
if (certificatePassword) args.push("--certificate-password", certificatePassword);
|
|
280
|
-
if (timestampServer) args.push("--timestamper", timestampServer);
|
|
281
|
-
return new Promise((resolve)=>{
|
|
282
|
-
const childProcess = spawn("dotnet", args, {
|
|
283
|
-
stdio: [
|
|
284
|
-
"ignore",
|
|
285
|
-
"pipe",
|
|
286
|
-
"pipe"
|
|
287
|
-
],
|
|
288
|
-
shell: false,
|
|
289
|
-
windowsHide: true
|
|
290
|
-
});
|
|
291
|
-
let stderr = "";
|
|
292
|
-
childProcess.stdout?.on("data", (data)=>{
|
|
293
|
-
this.logger.info(data.toString().trim());
|
|
294
|
-
});
|
|
295
|
-
childProcess.stderr?.on("data", (data)=>{
|
|
296
|
-
stderr += data.toString();
|
|
297
|
-
});
|
|
298
|
-
childProcess.on("error", (error)=>{
|
|
299
|
-
this.logger.error(`Failed to start dotnet process: ${error.message}`);
|
|
300
|
-
resolve(ToolResult.error(ToolErrorCodes.InternalError, `Failed to start dotnet process: ${error.message}`));
|
|
301
|
-
});
|
|
302
|
-
childProcess.on("exit", (code)=>{
|
|
303
|
-
if (0 === code) {
|
|
304
|
-
this.logger.info(`Successfully signed package: ${packagePath}`);
|
|
305
|
-
resolve(ToolResult.success());
|
|
306
|
-
} else {
|
|
307
|
-
const errorMessage = stderr.trim() || `dotnet nuget sign exited with code ${code}`;
|
|
308
|
-
this.logger.error(`Package signing failed: ${errorMessage}`);
|
|
309
|
-
resolve(ToolResult.error(ToolErrorCodes.InternalError, `Package signing failed: ${errorMessage}`));
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
});
|
|
1007
|
+
logger;
|
|
1008
|
+
constructor(logger) {
|
|
1009
|
+
this.logger = logger;
|
|
1010
|
+
}
|
|
1011
|
+
async signPackageAsync(packagePath, certificatePath, certificatePassword, timestampServer) {
|
|
1012
|
+
if (!this.checkAvailable()) {
|
|
1013
|
+
this.logger.error(translate2.t("solutionpackager.signing.info.dotnetNotAvailable"));
|
|
1014
|
+
return ToolResult.error(ToolErrorCodes.InternalError, translate2.t("solutionpackager.signing.errors.dotnetNotAvailable"));
|
|
313
1015
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
this.logger.info(`dotnet CLI found, version ${output.trim()}`);
|
|
325
|
-
return true;
|
|
326
|
-
} catch {
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
1016
|
+
const args = [
|
|
1017
|
+
"nuget",
|
|
1018
|
+
"sign",
|
|
1019
|
+
packagePath,
|
|
1020
|
+
"--certificate-path",
|
|
1021
|
+
certificatePath,
|
|
1022
|
+
"--overwrite"
|
|
1023
|
+
];
|
|
1024
|
+
if (certificatePassword) {
|
|
1025
|
+
args.push("--certificate-password", certificatePassword);
|
|
329
1026
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
this.logger = logger;
|
|
1027
|
+
if (timestampServer) {
|
|
1028
|
+
args.push("--timestamper", timestampServer);
|
|
333
1029
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1030
|
+
return new Promise((resolve) => {
|
|
1031
|
+
const childProcess = spawn("dotnet", args, {
|
|
1032
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1033
|
+
shell: false,
|
|
1034
|
+
windowsHide: true
|
|
1035
|
+
});
|
|
1036
|
+
let stderr = "";
|
|
1037
|
+
childProcess.stdout?.on("data", (data) => {
|
|
1038
|
+
this.logger.info(data.toString().trim());
|
|
1039
|
+
});
|
|
1040
|
+
childProcess.stderr?.on("data", (data) => {
|
|
1041
|
+
stderr += data.toString();
|
|
1042
|
+
});
|
|
1043
|
+
childProcess.on("error", (error) => {
|
|
1044
|
+
this.logger.error(`Failed to start dotnet process: ${error.message}`);
|
|
1045
|
+
resolve(ToolResult.error(ToolErrorCodes.InternalError, `Failed to start dotnet process: ${error.message}`));
|
|
1046
|
+
});
|
|
1047
|
+
childProcess.on("exit", (code) => {
|
|
1048
|
+
if (code === 0) {
|
|
1049
|
+
this.logger.info(`Successfully signed package: ${packagePath}`);
|
|
1050
|
+
resolve(ToolResult.success());
|
|
1051
|
+
} else {
|
|
1052
|
+
const errorMessage = stderr.trim() || `dotnet nuget sign exited with code ${code}`;
|
|
1053
|
+
this.logger.error(`Package signing failed: ${errorMessage}`);
|
|
1054
|
+
resolve(ToolResult.error(ToolErrorCodes.InternalError, `Package signing failed: ${errorMessage}`));
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
353
1057
|
});
|
|
354
|
-
|
|
355
|
-
|
|
1058
|
+
}
|
|
1059
|
+
checkAvailable() {
|
|
1060
|
+
try {
|
|
1061
|
+
const output = execSync2("dotnet nuget --version", {
|
|
1062
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
1063
|
+
encoding: "utf-8"
|
|
1064
|
+
});
|
|
1065
|
+
this.logger.info(`dotnet CLI found, version ${output.trim()}`);
|
|
1066
|
+
return true;
|
|
1067
|
+
} catch {
|
|
1068
|
+
return false;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
356
1071
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
1072
|
+
|
|
1073
|
+
// src/services/project-packager.ts
|
|
1074
|
+
import {
|
|
1075
|
+
toolsFactoryRepository as defaultToolsFactoryRepository,
|
|
1076
|
+
NugetPackager,
|
|
1077
|
+
Path as Path3,
|
|
1078
|
+
TemporaryStorageService,
|
|
1079
|
+
ToolErrorCodes as ToolErrorCodes4,
|
|
1080
|
+
ToolResult as ToolResult4,
|
|
1081
|
+
translate as translate6,
|
|
1082
|
+
ZipService
|
|
1083
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
1084
|
+
|
|
1085
|
+
// src/telemetry-names.ts
|
|
1086
|
+
var TelemetryNames;
|
|
1087
|
+
((TelemetryNames2) => {
|
|
1088
|
+
TelemetryNames2["ProjectToolPack"] = "ProjectPackager.Tool.Pack";
|
|
1089
|
+
TelemetryNames2["ProjectToolRestore"] = "ProjectPackager.Tool.Restore";
|
|
1090
|
+
TelemetryNames2["ProjectToolValidate"] = "ProjectPackager.Tool.Validate";
|
|
1091
|
+
TelemetryNames2["ProjectToolBuild"] = "ProjectPackager.Tool.Build";
|
|
1092
|
+
TelemetryNames2["ProjectPackagerPack"] = "ProjectPackager.Pack";
|
|
1093
|
+
TelemetryNames2["ProjectPackagerRestore"] = "ProjectPackager.Restore";
|
|
1094
|
+
TelemetryNames2["ProjectPackagerValidate"] = "ProjectPackager.Validate";
|
|
1095
|
+
TelemetryNames2["ProjectPackagerBuild"] = "ProjectPackager.Build";
|
|
1096
|
+
TelemetryNames2["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
|
|
1097
|
+
})(TelemetryNames ||= {});
|
|
1098
|
+
|
|
1099
|
+
// src/services/governance-policy-service.ts
|
|
1100
|
+
import {
|
|
1101
|
+
Path,
|
|
1102
|
+
toRelativeUrl,
|
|
1103
|
+
translate as translate3
|
|
1104
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
1105
|
+
var LICENSE_TYPES = {
|
|
1106
|
+
NoLicense: "NoLicense",
|
|
1107
|
+
Development: "Development",
|
|
1108
|
+
Attended: "Attended",
|
|
1109
|
+
Unattended: "Unattended",
|
|
1110
|
+
StudioX: "StudioX",
|
|
1111
|
+
StudioPro: "StudioPro",
|
|
1112
|
+
AutomationKit: "AutomationKit"
|
|
1113
|
+
};
|
|
1114
|
+
var DEFAULT_PROFILE_KEY = "StudioWeb";
|
|
1115
|
+
var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
|
|
1116
|
+
var GOVERNANCE_SUBFOLDER = "governance";
|
|
1117
|
+
var GOVERNANCE_FILE_NAME = "governance-policy.json";
|
|
1118
|
+
var errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
1119
|
+
var t = (key, params) => translate3.t(`solutionpackager.governance.${key}`, params);
|
|
1120
|
+
|
|
1121
|
+
class GovernancePolicyService {
|
|
1122
|
+
fileSystem;
|
|
1123
|
+
temporaryStorage;
|
|
1124
|
+
fetchFn;
|
|
1125
|
+
logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
|
|
1126
|
+
constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
|
|
1127
|
+
this.fileSystem = fileSystem;
|
|
1128
|
+
this.temporaryStorage = temporaryStorage;
|
|
1129
|
+
this.fetchFn = fetchFn;
|
|
1130
|
+
}
|
|
1131
|
+
async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken) {
|
|
1132
|
+
if (validateOptions.governanceFileType !== "AutomationOps" /* AutomationOps */) {
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
if (validateOptions.governanceFilePath) {
|
|
1136
|
+
this.logger.info(t("info.alreadyProvided"));
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
const cloudUrl = connectionInfo?.cloudUrl;
|
|
1140
|
+
const organizationId = connectionInfo?.organizationId;
|
|
1141
|
+
const tenantId = connectionInfo?.tenantId;
|
|
1142
|
+
const accessToken = connectionInfo?.accessToken;
|
|
1143
|
+
if (!cloudUrl || !organizationId || !tenantId || !accessToken) {
|
|
1144
|
+
this.logger.warn(t("errors.connectionIncomplete"));
|
|
1145
|
+
validateOptions.governanceFileType = "Default" /* Default */;
|
|
1146
|
+
return;
|
|
371
1147
|
}
|
|
1148
|
+
const profileKey = validateOptions.profileKey ?? DEFAULT_PROFILE_KEY;
|
|
1149
|
+
const orchestratorUrl = toRelativeUrl(cloudUrl);
|
|
1150
|
+
const licenseType = await this.resolveLicenseTypeAsync(profileKey, orchestratorUrl, accessToken, cancellationToken);
|
|
1151
|
+
const policy = await this.downloadPolicyAsync(organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken);
|
|
1152
|
+
if (!policy) {
|
|
1153
|
+
validateOptions.governanceFileType = "Default" /* Default */;
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
try {
|
|
1157
|
+
const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
|
|
1158
|
+
const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
|
|
1159
|
+
await this.fileSystem.writeFile(filePath, policy);
|
|
1160
|
+
this.logger.info(t("info.saved", { path: filePath }));
|
|
1161
|
+
validateOptions.governanceFilePath = filePath;
|
|
1162
|
+
} catch (error) {
|
|
1163
|
+
this.logger.warn(t("errors.failedToSave", {
|
|
1164
|
+
error: errorMessage(error)
|
|
1165
|
+
}));
|
|
1166
|
+
validateOptions.governanceFileType = "Default" /* Default */;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
async downloadPolicyAsync(organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken) {
|
|
1170
|
+
const policyUrl = `/${organizationId}/roboticsops_` + `/api/Policy/license/${licenseType}/product/${profileKey}/tenant/${tenantId}`;
|
|
1171
|
+
this.logger.info(t("info.downloading", { url: policyUrl }));
|
|
1172
|
+
try {
|
|
1173
|
+
const response = await this.fetchFn(policyUrl, {
|
|
1174
|
+
headers: {
|
|
1175
|
+
Authorization: `Bearer ${accessToken}`,
|
|
1176
|
+
AccountId: organizationId
|
|
1177
|
+
},
|
|
1178
|
+
signal: cancellationToken
|
|
1179
|
+
});
|
|
1180
|
+
if (response.status === 204 || response.status === 404) {
|
|
1181
|
+
this.logger.info(t("info.noPolicyFound"));
|
|
1182
|
+
return null;
|
|
1183
|
+
}
|
|
1184
|
+
if (!response.ok) {
|
|
1185
|
+
const body = await response.text();
|
|
1186
|
+
this.logger.warn(t("errors.failedToGetPolicy", { content: body }));
|
|
1187
|
+
return null;
|
|
1188
|
+
}
|
|
1189
|
+
const content = await response.text();
|
|
1190
|
+
if (!content?.trimStart().startsWith("{")) {
|
|
1191
|
+
this.logger.info(t("info.responseNotJson"));
|
|
1192
|
+
return null;
|
|
1193
|
+
}
|
|
1194
|
+
return content;
|
|
1195
|
+
} catch (error) {
|
|
1196
|
+
this.logger.warn(t("errors.failedToDownload", {
|
|
1197
|
+
error: errorMessage(error)
|
|
1198
|
+
}));
|
|
1199
|
+
return null;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
async resolveLicenseTypeAsync(profileKey, orchestratorUrl, accessToken, cancellationToken) {
|
|
1203
|
+
const isStudioWeb = profileKey === DEFAULT_PROFILE_KEY;
|
|
1204
|
+
const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
|
|
1205
|
+
try {
|
|
1206
|
+
const response = await this.fetchFn(`${orchestratorUrl}${ACQUIRE_LICENSE_PATH}`, {
|
|
1207
|
+
method: "POST",
|
|
1208
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
1209
|
+
signal: cancellationToken
|
|
1210
|
+
});
|
|
1211
|
+
if (!response.ok) {
|
|
1212
|
+
this.logger.info(t("info.licenseStatus", {
|
|
1213
|
+
status: response.status,
|
|
1214
|
+
fallback
|
|
1215
|
+
}));
|
|
1216
|
+
return fallback;
|
|
1217
|
+
}
|
|
1218
|
+
const { isLicensed, robotType } = await response.json();
|
|
1219
|
+
this.logger.info(t("info.licenseResponse", {
|
|
1220
|
+
isLicensed: String(isLicensed),
|
|
1221
|
+
robotType: String(robotType)
|
|
1222
|
+
}));
|
|
1223
|
+
if (!isLicensed || !robotType) {
|
|
1224
|
+
return fallback;
|
|
1225
|
+
}
|
|
1226
|
+
if (isStudioWeb) {
|
|
1227
|
+
return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
|
|
1228
|
+
}
|
|
1229
|
+
return robotType;
|
|
1230
|
+
} catch (error) {
|
|
1231
|
+
this.logger.info(t("info.licenseFailed", {
|
|
1232
|
+
error: errorMessage(error),
|
|
1233
|
+
fallback
|
|
1234
|
+
}));
|
|
1235
|
+
return fallback;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
372
1238
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
1239
|
+
|
|
1240
|
+
// src/services/pack-service.ts
|
|
1241
|
+
class PackService {
|
|
1242
|
+
disallowedCharsRegex = /[^\w.-]/g;
|
|
1243
|
+
spacesDotRegex = /[\s.]+/g;
|
|
1244
|
+
dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
|
|
1245
|
+
MaxPackageIdLength = 100;
|
|
1246
|
+
sanitizePackageId(packageId) {
|
|
1247
|
+
packageId = packageId.trim();
|
|
1248
|
+
packageId = packageId.replace(this.spacesDotRegex, ".");
|
|
1249
|
+
packageId = packageId.replace(this.dotDashRegex, "-");
|
|
1250
|
+
packageId = packageId.replace(this.disallowedCharsRegex, "_");
|
|
1251
|
+
if (packageId.length > this.MaxPackageIdLength) {
|
|
1252
|
+
throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
|
|
1253
|
+
}
|
|
1254
|
+
return packageId;
|
|
1255
|
+
}
|
|
382
1256
|
}
|
|
1257
|
+
|
|
1258
|
+
// src/services/packager-parameters-validator.ts
|
|
1259
|
+
import {
|
|
1260
|
+
ToolErrorCodes as ToolErrorCodes2,
|
|
1261
|
+
ToolResult as ToolResult2,
|
|
1262
|
+
translate as translate4
|
|
1263
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
383
1264
|
class PackagerParametersValidator {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
1265
|
+
logger;
|
|
1266
|
+
fileSystem;
|
|
1267
|
+
constructor(logger, fileSystem) {
|
|
1268
|
+
this.logger = logger;
|
|
1269
|
+
this.fileSystem = fileSystem;
|
|
1270
|
+
}
|
|
1271
|
+
async validateAsync(_options, _cancellationToken) {
|
|
1272
|
+
return ToolResult2.success();
|
|
1273
|
+
}
|
|
1274
|
+
validateDestinationPath(destinationPath) {
|
|
1275
|
+
if (!destinationPath) {
|
|
1276
|
+
const error = translate4.t("solutionpackager.validator.errors.destinationNotDefined");
|
|
1277
|
+
this.logger.error(error);
|
|
1278
|
+
return ToolResult2.error(ToolErrorCodes2.InternalError, error);
|
|
394
1279
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return ToolResult.error(ToolErrorCodes.InternalError, error);
|
|
404
|
-
}
|
|
405
|
-
try {
|
|
406
|
-
const stat = await this.fileSystem.stat(validateOptions.governanceFilePath);
|
|
407
|
-
if (!stat) {
|
|
408
|
-
const error = translate.t("solutionpackager.validator.errors.governanceFileInfo", {
|
|
409
|
-
path: validateOptions.governanceFilePath
|
|
410
|
-
});
|
|
411
|
-
this.logger.error(error);
|
|
412
|
-
return ToolResult.error(ToolErrorCodes.InternalError, error);
|
|
413
|
-
}
|
|
414
|
-
if (stat.isDirectory()) {
|
|
415
|
-
const error = translate.t("solutionpackager.validator.errors.governanceInvalidFile", {
|
|
416
|
-
path: validateOptions.governanceFilePath
|
|
417
|
-
});
|
|
418
|
-
this.logger.error(error);
|
|
419
|
-
return ToolResult.error(ToolErrorCodes.InternalError, error);
|
|
420
|
-
}
|
|
421
|
-
} catch (error) {
|
|
422
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
423
|
-
const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${errorMessage}`;
|
|
424
|
-
this.logger.error(errorLog);
|
|
425
|
-
return ToolResult.error(ToolErrorCodes.InternalError, errorLog);
|
|
426
|
-
}
|
|
427
|
-
this.logger.info(`Using Studio governance file: ${validateOptions.governanceFilePath}`);
|
|
428
|
-
return ToolResult.success();
|
|
1280
|
+
return ToolResult2.success();
|
|
1281
|
+
}
|
|
1282
|
+
async validateGovernanceOptions(validateOptions) {
|
|
1283
|
+
if (validateOptions.governanceFileType === "Default" /* Default */) {
|
|
1284
|
+
if (validateOptions.governanceFilePath) {
|
|
1285
|
+
this.logger.warn(`Governance file path '${validateOptions.governanceFilePath}' will be ignored when governance file type is Default`);
|
|
1286
|
+
}
|
|
1287
|
+
return ToolResult2.success();
|
|
429
1288
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
this.fileSystem = fileSystem;
|
|
1289
|
+
if (!validateOptions.governanceFilePath) {
|
|
1290
|
+
const error = translate4.t("solutionpackager.validator.errors.governanceRequired");
|
|
1291
|
+
this.logger.error(error);
|
|
1292
|
+
return ToolResult2.error(ToolErrorCodes2.InternalError, error);
|
|
435
1293
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
1294
|
+
try {
|
|
1295
|
+
const stat = await this.fileSystem.stat(validateOptions.governanceFilePath);
|
|
1296
|
+
if (!stat) {
|
|
1297
|
+
const error = translate4.t("solutionpackager.validator.errors.governanceFileInfo", {
|
|
1298
|
+
path: validateOptions.governanceFilePath
|
|
1299
|
+
});
|
|
1300
|
+
this.logger.error(error);
|
|
1301
|
+
return ToolResult2.error(ToolErrorCodes2.InternalError, error);
|
|
1302
|
+
}
|
|
1303
|
+
if (stat.isDirectory()) {
|
|
1304
|
+
const error = translate4.t("solutionpackager.validator.errors.governanceInvalidFile", {
|
|
1305
|
+
path: validateOptions.governanceFilePath
|
|
1306
|
+
});
|
|
1307
|
+
this.logger.error(error);
|
|
1308
|
+
return ToolResult2.error(ToolErrorCodes2.InternalError, error);
|
|
1309
|
+
}
|
|
1310
|
+
} catch (error) {
|
|
1311
|
+
const errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
1312
|
+
const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${errorMessage2}`;
|
|
1313
|
+
this.logger.error(errorLog);
|
|
1314
|
+
return ToolResult2.error(ToolErrorCodes2.InternalError, errorLog);
|
|
440
1315
|
}
|
|
1316
|
+
this.logger.info(`Using Studio governance file: ${validateOptions.governanceFilePath}`);
|
|
1317
|
+
return ToolResult2.success();
|
|
1318
|
+
}
|
|
441
1319
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
});
|
|
449
|
-
else obj[key] = value;
|
|
450
|
-
return obj;
|
|
1320
|
+
|
|
1321
|
+
// src/services/project-build-options-validator.ts
|
|
1322
|
+
class ProjectBuildOptionsValidator extends PackagerParametersValidator {
|
|
1323
|
+
async validateAsync(options, _cancellationToken) {
|
|
1324
|
+
return await this.validateGovernanceOptions(options.validateOptions);
|
|
1325
|
+
}
|
|
451
1326
|
}
|
|
1327
|
+
|
|
1328
|
+
// src/services/project-loader.ts
|
|
1329
|
+
import {
|
|
1330
|
+
Path as Path2,
|
|
1331
|
+
ProjectTypes,
|
|
1332
|
+
translate as translate5
|
|
1333
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
1334
|
+
|
|
452
1335
|
class ProjectLoader {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
projectFile: ProjectLoader.ProjectFileName,
|
|
463
|
-
manifestFile: ProjectLoader.WebAppManifestFileName,
|
|
464
|
-
path: projectPath
|
|
465
|
-
}));
|
|
1336
|
+
fileSystem;
|
|
1337
|
+
static ProjectFileName = "project.uiproj";
|
|
1338
|
+
static WebAppManifestFileName = "webAppManifest.json";
|
|
1339
|
+
constructor(fileSystem) {
|
|
1340
|
+
this.fileSystem = fileSystem;
|
|
1341
|
+
}
|
|
1342
|
+
async loadProject(projectPath) {
|
|
1343
|
+
if (!projectPath) {
|
|
1344
|
+
throw new Error(translate5.t("solutionpackager.projectLoader.errors.pathRequired"));
|
|
466
1345
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}));
|
|
472
|
-
const json = "string" == typeof fileContent ? fileContent : new TextDecoder("utf-8").decode(fileContent);
|
|
473
|
-
const projectData = JSON.parse(json);
|
|
474
|
-
const projectType = projectData?.ProjectType || projectData?.type;
|
|
475
|
-
if (!projectData || !projectType) throw new Error(translate.t("solutionpackager.projectLoader.errors.invalidProject", {
|
|
476
|
-
path: projectFilePath
|
|
477
|
-
}));
|
|
478
|
-
return {
|
|
479
|
-
type: projectType,
|
|
480
|
-
name: projectData.Name || Path.basename(projectPath),
|
|
481
|
-
projectPath,
|
|
482
|
-
projectFilePath
|
|
483
|
-
};
|
|
1346
|
+
const projectFilePath = Path2.join(projectPath, ProjectLoader.ProjectFileName);
|
|
1347
|
+
const projectFileExists = await this.fileSystem.exists(projectFilePath);
|
|
1348
|
+
if (projectFileExists) {
|
|
1349
|
+
return await this.loadFromProjectFile(projectPath, projectFilePath);
|
|
484
1350
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
name: folderName,
|
|
490
|
-
projectPath,
|
|
491
|
-
projectFilePath: webAppManifestPath
|
|
492
|
-
};
|
|
1351
|
+
const webAppManifestPath = Path2.join(projectPath, ProjectLoader.WebAppManifestFileName);
|
|
1352
|
+
const webAppManifestExists = await this.fileSystem.exists(webAppManifestPath);
|
|
1353
|
+
if (webAppManifestExists) {
|
|
1354
|
+
return this.loadFromWebAppManifest(projectPath, webAppManifestPath);
|
|
493
1355
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
1356
|
+
throw new Error(translate5.t("solutionpackager.projectLoader.errors.noProjectFile", {
|
|
1357
|
+
projectFile: ProjectLoader.ProjectFileName,
|
|
1358
|
+
manifestFile: ProjectLoader.WebAppManifestFileName,
|
|
1359
|
+
path: projectPath
|
|
1360
|
+
}));
|
|
1361
|
+
}
|
|
1362
|
+
async loadFromProjectFile(projectPath, projectFilePath) {
|
|
1363
|
+
const fileContent = await this.fileSystem.readFile(projectFilePath);
|
|
1364
|
+
if (!fileContent) {
|
|
1365
|
+
throw new Error(translate5.t("solutionpackager.projectLoader.errors.readFailed", {
|
|
1366
|
+
path: projectFilePath
|
|
1367
|
+
}));
|
|
497
1368
|
}
|
|
1369
|
+
const json = typeof fileContent === "string" ? fileContent : new TextDecoder("utf-8").decode(fileContent);
|
|
1370
|
+
const projectData = JSON.parse(json);
|
|
1371
|
+
const projectType = projectData?.ProjectType || projectData?.type;
|
|
1372
|
+
if (!projectData || !projectType) {
|
|
1373
|
+
throw new Error(translate5.t("solutionpackager.projectLoader.errors.invalidProject", {
|
|
1374
|
+
path: projectFilePath
|
|
1375
|
+
}));
|
|
1376
|
+
}
|
|
1377
|
+
return {
|
|
1378
|
+
type: projectType,
|
|
1379
|
+
name: projectData.Name || Path2.basename(projectPath),
|
|
1380
|
+
projectPath,
|
|
1381
|
+
projectFilePath
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
loadFromWebAppManifest(projectPath, webAppManifestPath) {
|
|
1385
|
+
const folderName = Path2.basename(projectPath);
|
|
1386
|
+
return {
|
|
1387
|
+
type: ProjectTypes.AppV2,
|
|
1388
|
+
name: folderName,
|
|
1389
|
+
projectPath,
|
|
1390
|
+
projectFilePath: webAppManifestPath
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
498
1393
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
function project_pack_options_builder_define_property(obj, key, value) {
|
|
502
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
503
|
-
value: value,
|
|
504
|
-
enumerable: true,
|
|
505
|
-
configurable: true,
|
|
506
|
-
writable: true
|
|
507
|
-
});
|
|
508
|
-
else obj[key] = value;
|
|
509
|
-
return obj;
|
|
510
|
-
}
|
|
1394
|
+
|
|
1395
|
+
// src/services/project-pack-options-builder.ts
|
|
511
1396
|
class ProjectPackOptionsBuilder {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
projectPath: project.projectPath,
|
|
522
|
-
excludeConfiguredSources: parameters.excludeConfiguredSources ?? false,
|
|
523
|
-
nuGetSourcesConfigPath: parameters.nuGetSourcesConfigPath,
|
|
524
|
-
logLevel: parameters.logLevel,
|
|
525
|
-
skipAnalyze: parameters.validateOptions.skipAnalyze,
|
|
526
|
-
skipValidate: false,
|
|
527
|
-
detailedLogPath: parameters.detailedLogPath,
|
|
528
|
-
policyFilePath: parameters.validateOptions.governanceFilePath,
|
|
529
|
-
policyFileType: parameters.validateOptions.governanceFileType,
|
|
530
|
-
outputPath: parameters.outputPath,
|
|
531
|
-
outputType: void 0,
|
|
532
|
-
projectType: project.type,
|
|
533
|
-
package: packageInfo,
|
|
534
|
-
skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
|
|
535
|
-
includeSources: parameters.packOptions?.includeSources ?? false,
|
|
536
|
-
splitPackages: parameters.packOptions?.splitPackages ?? false
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
constructor(packService, fileSystem){
|
|
540
|
-
project_pack_options_builder_define_property(this, "packService", void 0);
|
|
541
|
-
project_pack_options_builder_define_property(this, "fileSystem", void 0);
|
|
542
|
-
this.packService = packService;
|
|
543
|
-
this.fileSystem = fileSystem;
|
|
1397
|
+
packService;
|
|
1398
|
+
fileSystem;
|
|
1399
|
+
constructor(packService, fileSystem) {
|
|
1400
|
+
this.packService = packService;
|
|
1401
|
+
this.fileSystem = fileSystem;
|
|
1402
|
+
}
|
|
1403
|
+
async buildProjectPackOptions(parameters, project) {
|
|
1404
|
+
if (!parameters.outputPath) {
|
|
1405
|
+
throw new Error("Output path is required for Pack command");
|
|
544
1406
|
}
|
|
1407
|
+
await this.fileSystem.mkdir(parameters.outputPath);
|
|
1408
|
+
const packageId = !parameters.package.id || parameters.package.id.trim() === "" ? project.name : parameters.package.id;
|
|
1409
|
+
const packageInfo = {
|
|
1410
|
+
...parameters.package,
|
|
1411
|
+
id: this.packService.sanitizePackageId(packageId)
|
|
1412
|
+
};
|
|
1413
|
+
return {
|
|
1414
|
+
projectPath: project.projectPath,
|
|
1415
|
+
excludeConfiguredSources: parameters.excludeConfiguredSources ?? false,
|
|
1416
|
+
nuGetSourcesConfigPath: parameters.nuGetSourcesConfigPath,
|
|
1417
|
+
logLevel: parameters.logLevel,
|
|
1418
|
+
skipAnalyze: parameters.validateOptions.skipAnalyze,
|
|
1419
|
+
skipValidate: false,
|
|
1420
|
+
detailedLogPath: parameters.detailedLogPath,
|
|
1421
|
+
policyFilePath: parameters.validateOptions.governanceFilePath,
|
|
1422
|
+
policyFileType: parameters.validateOptions.governanceFileType,
|
|
1423
|
+
outputPath: parameters.outputPath,
|
|
1424
|
+
outputType: undefined,
|
|
1425
|
+
projectType: project.type,
|
|
1426
|
+
package: packageInfo,
|
|
1427
|
+
skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
|
|
1428
|
+
includeSources: parameters.packOptions?.includeSources ?? false,
|
|
1429
|
+
splitPackages: parameters.packOptions?.splitPackages ?? false
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
545
1432
|
}
|
|
1433
|
+
|
|
1434
|
+
// src/services/project-pack-options-validator.ts
|
|
546
1435
|
class ProjectPackOptionsValidator extends ProjectBuildOptionsValidator {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1436
|
+
async validateAsync(options, cancellationToken) {
|
|
1437
|
+
const destinationResult = this.validateDestinationPath(options.destinationPath);
|
|
1438
|
+
if (!destinationResult.isSuccess) {
|
|
1439
|
+
return destinationResult;
|
|
551
1440
|
}
|
|
1441
|
+
return await super.validateAsync(options, cancellationToken);
|
|
1442
|
+
}
|
|
552
1443
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
});
|
|
560
|
-
else obj[key] = value;
|
|
561
|
-
return obj;
|
|
562
|
-
}
|
|
1444
|
+
|
|
1445
|
+
// src/services/project-tool-executor.ts
|
|
1446
|
+
import {
|
|
1447
|
+
ToolErrorCodes as ToolErrorCodes3,
|
|
1448
|
+
ToolResult as ToolResult3
|
|
1449
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
563
1450
|
class ProjectToolExecutor {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (disposeResult instanceof Promise) await disposeResult;
|
|
603
|
-
}
|
|
604
|
-
} catch (error) {
|
|
605
|
-
return ToolResult.error(ToolErrorCodes.InternalError, error instanceof Error ? error.message : String(error));
|
|
1451
|
+
toolsFactory;
|
|
1452
|
+
telemetry;
|
|
1453
|
+
packageSignService;
|
|
1454
|
+
constructor(toolsFactory, telemetry, packageSignService) {
|
|
1455
|
+
this.toolsFactory = toolsFactory;
|
|
1456
|
+
this.telemetry = telemetry;
|
|
1457
|
+
this.packageSignService = packageSignService;
|
|
1458
|
+
}
|
|
1459
|
+
async restoreAsync(options, project, context, cancellationToken) {
|
|
1460
|
+
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Restore" /* ProjectToolRestore */, project.Type, async () => tool.restoreAsync(options, cancellationToken), {
|
|
1461
|
+
projectId: project.Id,
|
|
1462
|
+
projectType: project.Type
|
|
1463
|
+
}));
|
|
1464
|
+
}
|
|
1465
|
+
async validateAsync(options, project, context, cancellationToken) {
|
|
1466
|
+
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Validate" /* ProjectToolValidate */, project.Type, async () => tool.validateAsync(options, cancellationToken), {
|
|
1467
|
+
projectId: project.Id,
|
|
1468
|
+
projectType: project.Type
|
|
1469
|
+
}));
|
|
1470
|
+
}
|
|
1471
|
+
async buildAsync(options, project, context, cancellationToken) {
|
|
1472
|
+
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Build" /* ProjectToolBuild */, project.Type, async () => tool.buildAsync(options, cancellationToken), {
|
|
1473
|
+
projectId: project.Id,
|
|
1474
|
+
projectType: project.Type
|
|
1475
|
+
}));
|
|
1476
|
+
}
|
|
1477
|
+
async packAsync(options, project, context, signingInfo, cancellationToken) {
|
|
1478
|
+
return await this.executeToolOperationAsync(project, context, async (tool) => {
|
|
1479
|
+
const result = await this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Pack" /* ProjectToolPack */, project.Type, async () => {
|
|
1480
|
+
return await tool.packAsync(options, cancellationToken);
|
|
1481
|
+
}, {
|
|
1482
|
+
projectId: project.Id,
|
|
1483
|
+
projectType: project.Type
|
|
1484
|
+
});
|
|
1485
|
+
if (result.isSuccess && signingInfo?.certificatePath && result.packages.length > 0) {
|
|
1486
|
+
const signResult = await this.signPackagesAsync(result.packages, signingInfo);
|
|
1487
|
+
if (!signResult.isSuccess) {
|
|
1488
|
+
return signResult;
|
|
606
1489
|
}
|
|
1490
|
+
}
|
|
1491
|
+
return result;
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
async executeToolOperationAsync(project, context, operation) {
|
|
1495
|
+
try {
|
|
1496
|
+
const tool = await this.toolsFactory.createProjectToolAsync(project, context);
|
|
1497
|
+
try {
|
|
1498
|
+
return await operation(tool);
|
|
1499
|
+
} finally {
|
|
1500
|
+
const disposeResult = tool.dispose();
|
|
1501
|
+
if (disposeResult instanceof Promise) {
|
|
1502
|
+
await disposeResult;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
} catch (error) {
|
|
1506
|
+
return ToolResult3.error(ToolErrorCodes3.InternalError, error instanceof Error ? error.message : String(error));
|
|
607
1507
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
const failedResult = signResults.find((result)=>result && !result.isSuccess);
|
|
613
|
-
if (failedResult) return failedResult;
|
|
614
|
-
return ToolResult.success();
|
|
615
|
-
}
|
|
616
|
-
constructor(toolsFactory, telemetry, packageSignService){
|
|
617
|
-
project_tool_executor_define_property(this, "toolsFactory", void 0);
|
|
618
|
-
project_tool_executor_define_property(this, "telemetry", void 0);
|
|
619
|
-
project_tool_executor_define_property(this, "packageSignService", void 0);
|
|
620
|
-
this.toolsFactory = toolsFactory;
|
|
621
|
-
this.telemetry = telemetry;
|
|
622
|
-
this.packageSignService = packageSignService;
|
|
1508
|
+
}
|
|
1509
|
+
async signPackagesAsync(packages, signingInfo) {
|
|
1510
|
+
if (!this.packageSignService) {
|
|
1511
|
+
return ToolResult3.error(ToolErrorCodes3.InternalError, "Package signing is required but signing service is not available. Package signing requires dotnet CLI to be installed in Node.js environment.");
|
|
623
1512
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
1513
|
+
const certificatePath = signingInfo.certificatePath;
|
|
1514
|
+
const signResults = await Promise.all(packages.map((packagePath) => this.packageSignService?.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer)));
|
|
1515
|
+
const failedResult = signResults.find((result) => result && !result.isSuccess);
|
|
1516
|
+
if (failedResult) {
|
|
1517
|
+
return failedResult;
|
|
628
1518
|
}
|
|
1519
|
+
return ToolResult3.success();
|
|
1520
|
+
}
|
|
629
1521
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
});
|
|
637
|
-
else obj[key] = value;
|
|
638
|
-
return obj;
|
|
1522
|
+
|
|
1523
|
+
// src/services/project-validate-options-validator.ts
|
|
1524
|
+
class ProjectValidateOptionsValidator extends PackagerParametersValidator {
|
|
1525
|
+
async validateAsync(options, _cancellationToken) {
|
|
1526
|
+
return await this.validateGovernanceOptions(options.validateOptions);
|
|
1527
|
+
}
|
|
639
1528
|
}
|
|
1529
|
+
|
|
1530
|
+
// src/services/tools-factory.ts
|
|
640
1531
|
class ToolsFactory {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
1532
|
+
repository;
|
|
1533
|
+
fileSystem;
|
|
1534
|
+
constructor(repository, fileSystem) {
|
|
1535
|
+
this.repository = repository;
|
|
1536
|
+
this.fileSystem = fileSystem;
|
|
1537
|
+
}
|
|
1538
|
+
async createSolutionToolAsync(solutionName) {
|
|
1539
|
+
const logger = new ToolLogger("ResourceBuilder", solutionName);
|
|
1540
|
+
const factory = this.repository.getSolutionToolFactory();
|
|
1541
|
+
return await factory.createAsync(logger, this.fileSystem);
|
|
1542
|
+
}
|
|
1543
|
+
async createProjectToolAsync(project, context) {
|
|
1544
|
+
const sourceTarget = getSourceTarget();
|
|
1545
|
+
const logger = new ToolLogger(project.Type, sourceTarget);
|
|
1546
|
+
if (!project.ProjectPath) {
|
|
1547
|
+
throw new Error(`Project path not set for project: ${project.Id}`);
|
|
657
1548
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1549
|
+
const factory = this.repository.getProjectToolFactory(project.Type);
|
|
1550
|
+
return await factory.createAsync(logger, this.fileSystem, context);
|
|
1551
|
+
function getSourceTarget() {
|
|
1552
|
+
const segments = project.ProjectRelativePath.split(/[/\\]/);
|
|
1553
|
+
if (segments.length > 1) {
|
|
1554
|
+
return segments[0];
|
|
1555
|
+
}
|
|
1556
|
+
return project.Id;
|
|
663
1557
|
}
|
|
1558
|
+
}
|
|
664
1559
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
value: value,
|
|
668
|
-
enumerable: true,
|
|
669
|
-
configurable: true,
|
|
670
|
-
writable: true
|
|
671
|
-
});
|
|
672
|
-
else obj[key] = value;
|
|
673
|
-
return obj;
|
|
674
|
-
}
|
|
1560
|
+
|
|
1561
|
+
// src/services/project-packager.ts
|
|
675
1562
|
class ProjectPackager {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
1563
|
+
fileSystem;
|
|
1564
|
+
telemetryService;
|
|
1565
|
+
packageSignService;
|
|
1566
|
+
repository;
|
|
1567
|
+
temporaryStorage;
|
|
1568
|
+
zipService;
|
|
1569
|
+
logger;
|
|
1570
|
+
optionsBuilder;
|
|
1571
|
+
toolsFactory;
|
|
1572
|
+
projectExecutor;
|
|
1573
|
+
projectLoader;
|
|
1574
|
+
validateOptionsValidator;
|
|
1575
|
+
buildOptionsValidator;
|
|
1576
|
+
packOptionsValidator;
|
|
1577
|
+
nugetPackager;
|
|
1578
|
+
governancePolicyService;
|
|
1579
|
+
constructor(fileSystem, telemetryService, packageSignService) {
|
|
1580
|
+
this.fileSystem = fileSystem;
|
|
1581
|
+
this.telemetryService = telemetryService;
|
|
1582
|
+
this.packageSignService = packageSignService;
|
|
1583
|
+
this.repository = defaultToolsFactoryRepository;
|
|
1584
|
+
this.temporaryStorage = new TemporaryStorageService(this.fileSystem);
|
|
1585
|
+
this.zipService = new ZipService(this.fileSystem);
|
|
1586
|
+
this.nugetPackager = new NugetPackager(this.fileSystem);
|
|
1587
|
+
this.logger = new ToolLogger("ProjectPackager", "PackProject");
|
|
1588
|
+
this.validateOptionsValidator = new ProjectValidateOptionsValidator(this.logger, this.fileSystem);
|
|
1589
|
+
this.buildOptionsValidator = new ProjectBuildOptionsValidator(this.logger, this.fileSystem);
|
|
1590
|
+
this.packOptionsValidator = new ProjectPackOptionsValidator(this.logger, this.fileSystem);
|
|
1591
|
+
const packService = new PackService;
|
|
1592
|
+
this.optionsBuilder = new ProjectPackOptionsBuilder(packService, this.fileSystem);
|
|
1593
|
+
this.toolsFactory = new ToolsFactory(this.repository, this.fileSystem);
|
|
1594
|
+
this.projectExecutor = new ProjectToolExecutor(this.toolsFactory, this.telemetryService, this.packageSignService);
|
|
1595
|
+
this.projectLoader = new ProjectLoader(this.fileSystem);
|
|
1596
|
+
this.governancePolicyService = new GovernancePolicyService(this.fileSystem, this.temporaryStorage);
|
|
1597
|
+
}
|
|
1598
|
+
async canPackProjectAsync(projectPath) {
|
|
1599
|
+
const project = await this.projectLoader.loadProject(projectPath);
|
|
1600
|
+
return this.repository.canHandleProject(project.type);
|
|
1601
|
+
}
|
|
1602
|
+
async setupAsync(input, operationId) {
|
|
1603
|
+
this.telemetryService.setOperationId(operationId);
|
|
1604
|
+
await this.temporaryStorage.cleanup();
|
|
1605
|
+
if (typeof input === "string") {
|
|
1606
|
+
return input;
|
|
679
1607
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1608
|
+
const inputPath = await this.temporaryStorage.getTempSubfolderPathAsync("input");
|
|
1609
|
+
await this.zipService.extractAsync(input, inputPath);
|
|
1610
|
+
const entries = await this.fileSystem.readdir(inputPath);
|
|
1611
|
+
if (entries.length === 1) {
|
|
1612
|
+
const innerPath = Path3.join(inputPath, entries[0]);
|
|
1613
|
+
const stat = await this.fileSystem.stat(innerPath);
|
|
1614
|
+
if (stat?.isDirectory()) {
|
|
1615
|
+
return innerPath;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
return inputPath;
|
|
1619
|
+
}
|
|
1620
|
+
async restoreProjectAsync(options, cancellationToken) {
|
|
1621
|
+
return await this.executeProjectOperationAsync(options, "Restore", "ProjectPackager.Restore" /* ProjectPackagerRestore */, async (uiPathProject, loadedProject) => {
|
|
1622
|
+
const restoreOptions = {
|
|
1623
|
+
projectPath: loadedProject.projectPath,
|
|
1624
|
+
excludeConfiguredSources: options.excludeConfiguredSources ?? false,
|
|
1625
|
+
nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
|
|
1626
|
+
logLevel: options.logLevel,
|
|
1627
|
+
outputPath: options.outputPath
|
|
1628
|
+
};
|
|
1629
|
+
return await this.projectExecutor.restoreAsync(restoreOptions, uiPathProject, undefined, cancellationToken);
|
|
1630
|
+
}, cancellationToken);
|
|
1631
|
+
}
|
|
1632
|
+
async validateProjectAsync(options, cancellationToken) {
|
|
1633
|
+
await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
|
|
1634
|
+
const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
|
|
1635
|
+
if (!validationResult.isSuccess) {
|
|
1636
|
+
return validationResult;
|
|
1637
|
+
}
|
|
1638
|
+
return await this.executeProjectOperationAsync(options, "Validate", "ProjectPackager.Validate" /* ProjectPackagerValidate */, async (uiPathProject, loadedProject) => {
|
|
1639
|
+
const validateOptions = {
|
|
1640
|
+
projectPath: loadedProject.projectPath,
|
|
1641
|
+
excludeConfiguredSources: options.excludeConfiguredSources ?? false,
|
|
1642
|
+
nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
|
|
1643
|
+
logLevel: options.logLevel,
|
|
1644
|
+
skipAnalyze: options.validateOptions.skipAnalyze,
|
|
1645
|
+
defaultSeverity: options.validateOptions.defaultSeverity,
|
|
1646
|
+
detailedLogPath: options.detailedLogPath,
|
|
1647
|
+
policyFilePath: options.validateOptions.governanceFilePath,
|
|
1648
|
+
policyFileType: options.validateOptions.governanceFileType
|
|
1649
|
+
};
|
|
1650
|
+
return await this.projectExecutor.validateAsync(validateOptions, uiPathProject, undefined, cancellationToken);
|
|
1651
|
+
}, cancellationToken);
|
|
1652
|
+
}
|
|
1653
|
+
async buildProjectAsync(options, cancellationToken) {
|
|
1654
|
+
await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
|
|
1655
|
+
const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
|
|
1656
|
+
if (!validationResult.isSuccess) {
|
|
1657
|
+
return validationResult;
|
|
1658
|
+
}
|
|
1659
|
+
return await this.executeProjectOperationAsync(options, "Build", "ProjectPackager.Build" /* ProjectPackagerBuild */, async (uiPathProject, loadedProject) => {
|
|
1660
|
+
if (!options.outputPath) {
|
|
1661
|
+
options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
|
|
1662
|
+
}
|
|
1663
|
+
const buildOptions = {
|
|
1664
|
+
projectPath: loadedProject.projectPath,
|
|
1665
|
+
excludeConfiguredSources: options.excludeConfiguredSources ?? false,
|
|
1666
|
+
nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
|
|
1667
|
+
logLevel: options.logLevel,
|
|
1668
|
+
skipAnalyze: options.validateOptions.skipAnalyze,
|
|
1669
|
+
skipValidate: false,
|
|
1670
|
+
detailedLogPath: options.detailedLogPath,
|
|
1671
|
+
policyFilePath: options.validateOptions.governanceFilePath,
|
|
1672
|
+
policyFileType: options.validateOptions.governanceFileType,
|
|
1673
|
+
outputPath: options.outputPath,
|
|
1674
|
+
outputType: undefined,
|
|
1675
|
+
projectType: uiPathProject.Type
|
|
1676
|
+
};
|
|
1677
|
+
return await this.projectExecutor.buildAsync(buildOptions, uiPathProject, undefined, cancellationToken);
|
|
1678
|
+
}, cancellationToken);
|
|
1679
|
+
}
|
|
1680
|
+
async packProjectAsync(options, cancellationToken) {
|
|
1681
|
+
return await this.telemetryService.trackRequest("ProjectPackager.Pack" /* ProjectPackagerPack */, async () => {
|
|
1682
|
+
try {
|
|
1683
|
+
await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
|
|
1684
|
+
let result = await this.packOptionsValidator.validateAsync(options, cancellationToken);
|
|
1685
|
+
if (!result.isSuccess) {
|
|
1686
|
+
return result;
|
|
691
1687
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
logLevel: options.logLevel,
|
|
734
|
-
skipAnalyze: options.validateOptions.skipAnalyze,
|
|
735
|
-
skipValidate: false,
|
|
736
|
-
detailedLogPath: options.detailedLogPath,
|
|
737
|
-
policyFilePath: options.validateOptions.governanceFilePath,
|
|
738
|
-
policyFileType: options.validateOptions.governanceFileType,
|
|
739
|
-
outputPath: options.outputPath,
|
|
740
|
-
outputType: void 0,
|
|
741
|
-
projectType: uiPathProject.Type
|
|
742
|
-
};
|
|
743
|
-
return await this.projectExecutor.buildAsync(buildOptions, uiPathProject, void 0, cancellationToken);
|
|
744
|
-
}, cancellationToken);
|
|
745
|
-
}
|
|
746
|
-
async packProjectAsync(options, cancellationToken) {
|
|
747
|
-
return await this.telemetryService.trackRequest(telemetry_names_TelemetryNames.ProjectPackagerPack, async ()=>{
|
|
748
|
-
try {
|
|
749
|
-
let result = await this.packOptionsValidator.validateAsync(options, cancellationToken);
|
|
750
|
-
if (!result.isSuccess) return result;
|
|
751
|
-
if (!options.outputPath) options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
|
|
752
|
-
const loadedProject = await this.projectLoader.loadProject(options.inputPath);
|
|
753
|
-
this.telemetryService.trackEvent(telemetry_names_TelemetryNames.ProjectPackagerProjectLoaded, {
|
|
754
|
-
projectId: loadedProject.name
|
|
755
|
-
});
|
|
756
|
-
const projectPackOptions = await this.optionsBuilder.buildProjectPackOptions(options, loadedProject);
|
|
757
|
-
const uiPathProject = {
|
|
758
|
-
Type: loadedProject.type,
|
|
759
|
-
ProjectRelativePath: Path.basename(loadedProject.projectFilePath),
|
|
760
|
-
ProjectPath: loadedProject.projectPath,
|
|
761
|
-
Id: loadedProject.name
|
|
762
|
-
};
|
|
763
|
-
result = await this.projectExecutor.packAsync(projectPackOptions, uiPathProject, void 0, options.signingInfo, cancellationToken);
|
|
764
|
-
if (result.isSuccess && result.packages.length > 0) {
|
|
765
|
-
const destinationPackages = await this.copyPackagesToDestination(result.packages, options.destinationPath, projectPackOptions.package);
|
|
766
|
-
result = new ToolResult(ToolErrorCodes.Success, void 0, destinationPackages);
|
|
767
|
-
}
|
|
768
|
-
if (result.isSuccess) this.logger.info(`Project pack completed successfully. Packages: ${result.packages.join(", ")}`);
|
|
769
|
-
else this.logger.error(`Project pack failed with error code ${result.errorCode}: ${result.message}`);
|
|
770
|
-
return result;
|
|
771
|
-
} catch (error) {
|
|
772
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
773
|
-
this.logger.error(`Processing error: ${errorMessage}`);
|
|
774
|
-
return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage}`);
|
|
775
|
-
} finally{
|
|
776
|
-
await this.temporaryStorage.cleanup();
|
|
777
|
-
}
|
|
778
|
-
});
|
|
1688
|
+
if (!options.outputPath) {
|
|
1689
|
+
options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
|
|
1690
|
+
}
|
|
1691
|
+
const loadedProject = await this.projectLoader.loadProject(options.inputPath);
|
|
1692
|
+
this.telemetryService.trackEvent("ProjectPackager.ProjectLoaded" /* ProjectPackagerProjectLoaded */, { projectId: loadedProject.name });
|
|
1693
|
+
const projectPackOptions = await this.optionsBuilder.buildProjectPackOptions(options, loadedProject);
|
|
1694
|
+
const uiPathProject = {
|
|
1695
|
+
Type: loadedProject.type,
|
|
1696
|
+
ProjectRelativePath: Path3.basename(loadedProject.projectFilePath),
|
|
1697
|
+
ProjectPath: loadedProject.projectPath,
|
|
1698
|
+
Id: loadedProject.name
|
|
1699
|
+
};
|
|
1700
|
+
result = await this.projectExecutor.packAsync(projectPackOptions, uiPathProject, undefined, options.signingInfo, cancellationToken);
|
|
1701
|
+
if (result.isSuccess && result.packages.length > 0) {
|
|
1702
|
+
const destinationPackages = await this.copyPackagesToDestination(result.packages, options.destinationPath, projectPackOptions.package);
|
|
1703
|
+
result = new ToolResult4(ToolErrorCodes4.Success, undefined, destinationPackages);
|
|
1704
|
+
}
|
|
1705
|
+
if (result.isSuccess) {
|
|
1706
|
+
this.logger.info(`Project pack completed successfully. Packages: ${result.packages.join(", ")}`);
|
|
1707
|
+
} else {
|
|
1708
|
+
this.logger.error(`Project pack failed with error code ${result.errorCode}: ${result.message}`);
|
|
1709
|
+
}
|
|
1710
|
+
return result;
|
|
1711
|
+
} catch (error) {
|
|
1712
|
+
const errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
1713
|
+
this.logger.error(`Processing error: ${errorMessage2}`);
|
|
1714
|
+
return ToolResult4.error(ToolErrorCodes4.InternalError, `Project pack failed: ${errorMessage2}`);
|
|
1715
|
+
} finally {
|
|
1716
|
+
await this.temporaryStorage.cleanup();
|
|
1717
|
+
}
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
async getPackageStreamsAsync(result) {
|
|
1721
|
+
if (!result.isSuccess) {
|
|
1722
|
+
throw new Error(translate6.t("solutionpackager.packager.errors.failedToGetStreams", {
|
|
1723
|
+
errorCode: result.errorCode,
|
|
1724
|
+
message: result.message ?? ""
|
|
1725
|
+
}));
|
|
1726
|
+
}
|
|
1727
|
+
if (!result.packages || result.packages.length === 0) {
|
|
1728
|
+
return [];
|
|
779
1729
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
1730
|
+
const packageStreams = [];
|
|
1731
|
+
for (const packagePath of result.packages) {
|
|
1732
|
+
const data = await this.fileSystem.readFile(packagePath);
|
|
1733
|
+
if (!data) {
|
|
1734
|
+
throw new Error(translate6.t("solutionpackager.packager.errors.failedToReadPackage", {
|
|
1735
|
+
path: packagePath
|
|
784
1736
|
}));
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
const data = await this.fileSystem.readFile(packagePath);
|
|
789
|
-
if (!data) throw new Error(translate.t("solutionpackager.packager.errors.failedToReadPackage", {
|
|
790
|
-
path: packagePath
|
|
791
|
-
}));
|
|
792
|
-
const name = packagePath.split(/[\\/]/).pop() || packagePath;
|
|
793
|
-
packageStreams.push({
|
|
794
|
-
name,
|
|
795
|
-
data
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
return packageStreams;
|
|
799
|
-
}
|
|
800
|
-
async executeProjectOperationAsync(options, operationName, telemetryName, operation, cancellationToken) {
|
|
801
|
-
return await this.telemetryService.trackRequest(telemetryName, async ()=>{
|
|
802
|
-
try {
|
|
803
|
-
const loadedProject = await this.projectLoader.loadProject(options.inputPath);
|
|
804
|
-
const uiPathProject = {
|
|
805
|
-
Type: loadedProject.type,
|
|
806
|
-
ProjectRelativePath: Path.basename(loadedProject.projectFilePath),
|
|
807
|
-
ProjectPath: loadedProject.projectPath,
|
|
808
|
-
Id: loadedProject.name
|
|
809
|
-
};
|
|
810
|
-
const operationResult = await operation(uiPathProject, loadedProject);
|
|
811
|
-
if (operationResult.isSuccess) this.logger.info(`Project ${operationName.toLowerCase()} completed successfully.`);
|
|
812
|
-
else this.logger.error(`Project ${operationName.toLowerCase()} failed with error code ${operationResult.errorCode}: ${operationResult.message}`);
|
|
813
|
-
return operationResult;
|
|
814
|
-
} catch (error) {
|
|
815
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
816
|
-
this.logger.error(`Processing error: ${errorMessage}`);
|
|
817
|
-
return ToolResult.error(ToolErrorCodes.InternalError, `Project ${operationName.toLowerCase()} failed: ${errorMessage}`);
|
|
818
|
-
} finally{
|
|
819
|
-
await this.temporaryStorage.cleanup();
|
|
820
|
-
}
|
|
821
|
-
});
|
|
1737
|
+
}
|
|
1738
|
+
const name = packagePath.split(/[\\/]/).pop() || packagePath;
|
|
1739
|
+
packageStreams.push({ name, data });
|
|
822
1740
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1741
|
+
return packageStreams;
|
|
1742
|
+
}
|
|
1743
|
+
async executeProjectOperationAsync(options, operationName, telemetryName, operation, _cancellationToken) {
|
|
1744
|
+
return await this.telemetryService.trackRequest(telemetryName, async () => {
|
|
1745
|
+
try {
|
|
1746
|
+
const loadedProject = await this.projectLoader.loadProject(options.inputPath);
|
|
1747
|
+
const uiPathProject = {
|
|
1748
|
+
Type: loadedProject.type,
|
|
1749
|
+
ProjectRelativePath: Path3.basename(loadedProject.projectFilePath),
|
|
1750
|
+
ProjectPath: loadedProject.projectPath,
|
|
1751
|
+
Id: loadedProject.name
|
|
1752
|
+
};
|
|
1753
|
+
const operationResult = await operation(uiPathProject, loadedProject);
|
|
1754
|
+
if (operationResult.isSuccess) {
|
|
1755
|
+
this.logger.info(`Project ${operationName.toLowerCase()} completed successfully.`);
|
|
1756
|
+
} else {
|
|
1757
|
+
this.logger.error(`Project ${operationName.toLowerCase()} failed with error code ${operationResult.errorCode}: ${operationResult.message}`);
|
|
1758
|
+
}
|
|
1759
|
+
return operationResult;
|
|
1760
|
+
} catch (error) {
|
|
1761
|
+
const errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
1762
|
+
this.logger.error(`Processing error: ${errorMessage2}`);
|
|
1763
|
+
return ToolResult4.error(ToolErrorCodes4.InternalError, `Project ${operationName.toLowerCase()} failed: ${errorMessage2}`);
|
|
1764
|
+
} finally {
|
|
1765
|
+
await this.temporaryStorage.cleanup();
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
async copyPackagesToDestination(packagePaths, destinationPath, packageInfo) {
|
|
1770
|
+
await this.fileSystem.mkdir(destinationPath);
|
|
1771
|
+
const destinationPackages = [];
|
|
1772
|
+
for (const packagePath of packagePaths) {
|
|
1773
|
+
const stat = await this.fileSystem.stat(packagePath);
|
|
1774
|
+
if (stat?.isDirectory()) {
|
|
1775
|
+
const files = await this.fileSystem.readdir(packagePath);
|
|
1776
|
+
const nupkgFiles = files.filter((f) => f.endsWith(".nupkg"));
|
|
1777
|
+
if (nupkgFiles.length > 0) {
|
|
1778
|
+
for (const nupkgFile of nupkgFiles) {
|
|
1779
|
+
const filePath = Path3.join(packagePath, nupkgFile);
|
|
1780
|
+
const destPath = Path3.join(destinationPath, nupkgFile);
|
|
1781
|
+
const data = await this.fileSystem.readFile(filePath);
|
|
1782
|
+
if (!data) {
|
|
1783
|
+
throw new Error(translate6.t("solutionpackager.packager.errors.failedToReadPackage", {
|
|
1784
|
+
path: filePath
|
|
1785
|
+
}));
|
|
856
1786
|
}
|
|
1787
|
+
await this.fileSystem.writeFile(destPath, data);
|
|
1788
|
+
destinationPackages.push(destPath);
|
|
1789
|
+
}
|
|
1790
|
+
} else {
|
|
1791
|
+
const nupkgFileName = `${packageInfo.id}.${packageInfo.version}.nupkg`;
|
|
1792
|
+
const destPath = Path3.join(destinationPath, nupkgFileName);
|
|
1793
|
+
const packResult = await this.nugetPackager.packAsync(packagePath, packageInfo, destPath);
|
|
1794
|
+
destinationPackages.push(packResult.outputPath);
|
|
857
1795
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
project_packager_define_property(this, "projectExecutor", void 0);
|
|
871
|
-
project_packager_define_property(this, "projectLoader", void 0);
|
|
872
|
-
project_packager_define_property(this, "validateOptionsValidator", void 0);
|
|
873
|
-
project_packager_define_property(this, "buildOptionsValidator", void 0);
|
|
874
|
-
project_packager_define_property(this, "packOptionsValidator", void 0);
|
|
875
|
-
project_packager_define_property(this, "nugetPackager", void 0);
|
|
876
|
-
this.fileSystem = fileSystem;
|
|
877
|
-
this.telemetryService = telemetryService;
|
|
878
|
-
this.packageSignService = packageSignService;
|
|
879
|
-
this.repository = toolsFactoryRepository;
|
|
880
|
-
this.temporaryStorage = new TemporaryStorageService(this.fileSystem);
|
|
881
|
-
this.zipService = new ZipService(this.fileSystem);
|
|
882
|
-
this.nugetPackager = new NugetPackager(this.fileSystem);
|
|
883
|
-
this.logger = new ToolLogger("ProjectPackager", "PackProject");
|
|
884
|
-
this.validateOptionsValidator = new ProjectValidateOptionsValidator(this.logger, this.fileSystem);
|
|
885
|
-
this.buildOptionsValidator = new ProjectBuildOptionsValidator(this.logger, this.fileSystem);
|
|
886
|
-
this.packOptionsValidator = new ProjectPackOptionsValidator(this.logger, this.fileSystem);
|
|
887
|
-
const packService = new PackService();
|
|
888
|
-
this.optionsBuilder = new ProjectPackOptionsBuilder(packService, this.fileSystem);
|
|
889
|
-
this.toolsFactory = new ToolsFactory(this.repository, this.fileSystem);
|
|
890
|
-
this.projectExecutor = new ProjectToolExecutor(this.toolsFactory, this.telemetryService, this.packageSignService);
|
|
891
|
-
this.projectLoader = new ProjectLoader(this.fileSystem);
|
|
1796
|
+
} else {
|
|
1797
|
+
const fileName = packagePath.split(/[\\/]/).pop() || packagePath;
|
|
1798
|
+
const destPath = Path3.join(destinationPath, fileName);
|
|
1799
|
+
const data = await this.fileSystem.readFile(packagePath);
|
|
1800
|
+
if (!data) {
|
|
1801
|
+
throw new Error(translate6.t("solutionpackager.packager.errors.failedToReadPackage", {
|
|
1802
|
+
path: packagePath
|
|
1803
|
+
}));
|
|
1804
|
+
}
|
|
1805
|
+
await this.fileSystem.writeFile(destPath, data);
|
|
1806
|
+
destinationPackages.push(destPath);
|
|
1807
|
+
}
|
|
892
1808
|
}
|
|
1809
|
+
return destinationPackages;
|
|
1810
|
+
}
|
|
893
1811
|
}
|
|
1812
|
+
|
|
1813
|
+
// src/node-project-packager-factory.ts
|
|
894
1814
|
class NodeProjectPackagerFactory extends BaseNodePackagerFactory {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
1815
|
+
async createAsync(config) {
|
|
1816
|
+
const logger = new ToolLogger("ProjectPackagerFactory", "Create");
|
|
1817
|
+
this.configureLanguage(config);
|
|
1818
|
+
this.configureLogHandler(config);
|
|
1819
|
+
logger.info("Creating ProjectPackager instance...");
|
|
1820
|
+
const fileSystem = this.getOrCreateFileSystem(config);
|
|
1821
|
+
const telemetryService = this.getOrCreateTelemetryService(config);
|
|
1822
|
+
const packageSignService = new NodePackageSignService(logger);
|
|
1823
|
+
const projectPackager = new ProjectPackager(fileSystem, telemetryService, packageSignService);
|
|
1824
|
+
this.checkDotnetAvailability(logger);
|
|
1825
|
+
logger.info("ProjectPackager created successfully.");
|
|
1826
|
+
return projectPackager;
|
|
1827
|
+
}
|
|
908
1828
|
}
|
|
909
1829
|
async function createNodeProjectPackager(options) {
|
|
910
|
-
|
|
911
|
-
|
|
1830
|
+
const factory = new NodeProjectPackagerFactory;
|
|
1831
|
+
return factory.createAsync(options);
|
|
912
1832
|
}
|
|
913
|
-
export {
|
|
914
|
-
|
|
915
|
-
|
|
1833
|
+
export {
|
|
1834
|
+
setGlobalLogHandler,
|
|
1835
|
+
createNodeProjectPackager,
|
|
1836
|
+
ToolsFactory,
|
|
1837
|
+
ToolLogger,
|
|
1838
|
+
TelemetryService2 as TelemetryService,
|
|
1839
|
+
TelemetryNames,
|
|
1840
|
+
RulesConfigFileType,
|
|
1841
|
+
ProjectValidateOptionsValidator,
|
|
1842
|
+
ProjectValidateOptions,
|
|
1843
|
+
ProjectToolExecutor,
|
|
1844
|
+
ProjectRestoreOptions,
|
|
1845
|
+
ProjectPackager,
|
|
1846
|
+
ProjectPackOptions,
|
|
1847
|
+
ProjectLoader,
|
|
1848
|
+
ProjectBuildOptionsValidator,
|
|
1849
|
+
ProjectBuildOptions,
|
|
1850
|
+
PackagerParametersValidator,
|
|
1851
|
+
PackagerParameters,
|
|
1852
|
+
PackService,
|
|
1853
|
+
NodePackageSignService,
|
|
1854
|
+
NodeContextStorage2 as NodeContextStorage,
|
|
1855
|
+
ConsoleTelemetryProvider2 as ConsoleTelemetryProvider,
|
|
1856
|
+
BaseNodePackagerFactory
|
|
1857
|
+
};
|