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