@uipath/project-packager 1.1.5 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js 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
- import { BrowserContextStorage, ConsoleTelemetryProvider, TelemetryService } from "@uipath/telemetry";
3
- 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."}}}}');
4
- const en = {
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
- signing: {
29
- errors: {
30
- dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
31
- },
32
- info: {
33
- dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
34
- }
35
- }
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
+ }
36
690
  }
691
+ }
37
692
  };
38
- 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."}}}}');
39
- 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."}}}}');
40
- 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."}}}}');
41
- 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."}}}}');
42
- 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."}}}}');
43
- 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."}}}}');
44
- 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."}}}}');
45
- 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."}}}}');
46
- 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."}}}}');
47
- 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."}}}}');
48
- 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."}}}}');
49
- 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."}}}}');
50
- 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
51
801
  I18nManager.registerTranslations("en", en);
52
- I18nManager.registerTranslations("de", de_namespaceObject);
53
- I18nManager.registerTranslations("es", es_namespaceObject);
54
- I18nManager.registerTranslations("es-MX", es_MX_namespaceObject);
55
- I18nManager.registerTranslations("fr", fr_namespaceObject);
56
- I18nManager.registerTranslations("ja", ja_namespaceObject);
57
- I18nManager.registerTranslations("ko", ko_namespaceObject);
58
- I18nManager.registerTranslations("pt", pt_namespaceObject);
59
- I18nManager.registerTranslations("pt-BR", pt_BR_namespaceObject);
60
- I18nManager.registerTranslations("ro", ro_namespaceObject);
61
- I18nManager.registerTranslations("ru", ru_namespaceObject);
62
- I18nManager.registerTranslations("tr", tr_namespaceObject);
63
- I18nManager.registerTranslations("zh-CN", zh_CN_namespaceObject);
64
- I18nManager.registerTranslations("zh-TW", zh_TW_namespaceObject);
65
- I18nManager.registerTranslations("zu", zu_namespaceObject);
66
- function _define_property(obj, key, value) {
67
- if (key in obj) Object.defineProperty(obj, key, {
68
- value: value,
69
- enumerable: true,
70
- configurable: true,
71
- writable: true
72
- });
73
- else obj[key] = value;
74
- 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
+ }
75
831
  }
76
- var packager_parameters_RulesConfigFileType = /*#__PURE__*/ function(RulesConfigFileType) {
77
- RulesConfigFileType["Default"] = "Default";
78
- RulesConfigFileType["AutomationOps"] = "AutomationOps";
79
- RulesConfigFileType["Studio"] = "Studio";
80
- return RulesConfigFileType;
81
- }({});
82
- class PackagerParameters {
83
- constructor(){
84
- _define_property(this, "inputPath", void 0);
85
- _define_property(this, "logLevel", LogLevel.Warn);
86
- _define_property(this, "outputPath", void 0);
87
- _define_property(this, "targetFramework", void 0);
88
- _define_property(this, "excludeConfiguredSources", false);
89
- _define_property(this, "nuGetSourcesConfigPath", void 0);
90
- _define_property(this, "detailedLogPath", void 0);
91
- _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;
92
849
  }
850
+ }
851
+ getContext() {
852
+ return this.contextStack.length > 0 ? this.contextStack[this.contextStack.length - 1] : undefined;
853
+ }
93
854
  }
94
- 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
+ }
95
942
  }
96
- function project_validate_options_define_property(obj, key, value) {
97
- if (key in obj) Object.defineProperty(obj, key, {
98
- value: value,
99
- enumerable: true,
100
- configurable: true,
101
- writable: true
102
- });
103
- else obj[key] = value;
104
- 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 {
105
967
  }
968
+
969
+ // src/models/project-validate-options.ts
106
970
  class ProjectValidateOptions extends ProjectRestoreOptions {
107
- constructor(...args){
108
- super(...args), project_validate_options_define_property(this, "validateOptions", {
109
- skipAnalyze: false,
110
- governanceFileType: packager_parameters_RulesConfigFileType.Default
111
- });
112
- }
971
+ validateOptions = {
972
+ skipAnalyze: false,
973
+ governanceFileType: "Default" /* Default */
974
+ };
113
975
  }
976
+
977
+ // src/models/project-build-options.ts
114
978
  class ProjectBuildOptions extends ProjectValidateOptions {
115
979
  }
116
- function project_pack_options_define_property(obj, key, value) {
117
- if (key in obj) Object.defineProperty(obj, key, {
118
- value: value,
119
- enumerable: true,
120
- configurable: true,
121
- writable: true
122
- });
123
- else obj[key] = value;
124
- return obj;
125
- }
980
+ // src/models/project-pack-options.ts
126
981
  class ProjectPackOptions extends ProjectBuildOptions {
127
- constructor(...args){
128
- 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);
129
- }
982
+ destinationPath;
983
+ package;
984
+ signingInfo;
985
+ packOptions;
130
986
  }
131
- function pack_service_define_property(obj, key, value) {
132
- if (key in obj) Object.defineProperty(obj, key, {
133
- value: value,
134
- enumerable: true,
135
- configurable: true,
136
- 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
137
1032
  });
138
- else obj[key] = value;
139
- 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
+ }
140
1078
  }
141
- class PackService {
142
- sanitizePackageId(packageId) {
143
- packageId = packageId.trim();
144
- packageId = packageId.replace(this.spacesDotRegex, ".");
145
- packageId = packageId.replace(this.dotDashRegex, "-");
146
- packageId = packageId.replace(this.disallowedCharsRegex, "_");
147
- if (packageId.length > this.MaxPackageIdLength) throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
148
- return packageId;
149
- }
150
- constructor(){
151
- pack_service_define_property(this, "disallowedCharsRegex", /[^\w.-]/g);
152
- pack_service_define_property(this, "spacesDotRegex", /[\s.]+/g);
153
- pack_service_define_property(this, "dotDashRegex", /\.*[-:]\.*/g);
154
- 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;
155
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
+ }
156
1214
  }
157
- function packager_parameters_validator_define_property(obj, key, value) {
158
- if (key in obj) Object.defineProperty(obj, key, {
159
- value: value,
160
- enumerable: true,
161
- configurable: true,
162
- writable: true
163
- });
164
- else obj[key] = value;
165
- 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
+ }
166
1231
  }
1232
+ // src/services/packager-parameters-validator.ts
1233
+ import {
1234
+ ToolErrorCodes,
1235
+ ToolResult,
1236
+ translate as translate2
1237
+ } from "@uipath/solutionpackager-tool-core";
167
1238
  class PackagerParametersValidator {
168
- async validateAsync(_options, _cancellationToken) {
169
- return ToolResult.success();
170
- }
171
- validateDestinationPath(destinationPath) {
172
- if (!destinationPath) {
173
- const error = translate.t("solutionpackager.validator.errors.destinationNotDefined");
174
- this.logger.error(error);
175
- return ToolResult.error(ToolErrorCodes.InternalError, error);
176
- }
177
- 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);
178
1253
  }
179
- async validateGovernanceOptions(validateOptions) {
180
- if (validateOptions.governanceFileType === packager_parameters_RulesConfigFileType.Default) {
181
- if (validateOptions.governanceFilePath) this.logger.warn(`Governance file path '${validateOptions.governanceFilePath}' will be ignored when governance file type is Default`);
182
- return ToolResult.success();
183
- }
184
- if (!validateOptions.governanceFilePath) {
185
- const error = translate.t("solutionpackager.validator.errors.governanceRequired");
186
- this.logger.error(error);
187
- return ToolResult.error(ToolErrorCodes.InternalError, error);
188
- }
189
- try {
190
- const stat = await this.fileSystem.stat(validateOptions.governanceFilePath);
191
- if (!stat) {
192
- const error = translate.t("solutionpackager.validator.errors.governanceFileInfo", {
193
- path: validateOptions.governanceFilePath
194
- });
195
- this.logger.error(error);
196
- return ToolResult.error(ToolErrorCodes.InternalError, error);
197
- }
198
- if (stat.isDirectory()) {
199
- const error = translate.t("solutionpackager.validator.errors.governanceInvalidFile", {
200
- path: validateOptions.governanceFilePath
201
- });
202
- this.logger.error(error);
203
- return ToolResult.error(ToolErrorCodes.InternalError, error);
204
- }
205
- } catch (error) {
206
- const errorMessage = error instanceof Error ? error.message : String(error);
207
- const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${errorMessage}`;
208
- this.logger.error(errorLog);
209
- return ToolResult.error(ToolErrorCodes.InternalError, errorLog);
210
- }
211
- this.logger.info(`Using Studio governance file: ${validateOptions.governanceFilePath}`);
212
- 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();
213
1262
  }
214
- constructor(logger, fileSystem){
215
- packager_parameters_validator_define_property(this, "logger", void 0);
216
- packager_parameters_validator_define_property(this, "fileSystem", void 0);
217
- this.logger = logger;
218
- 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);
219
1267
  }
220
- }
221
- class ProjectBuildOptionsValidator extends PackagerParametersValidator {
222
- async validateAsync(options, _cancellationToken) {
223
- 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);
224
1289
  }
1290
+ this.logger.info(`Using Studio governance file: ${validateOptions.governanceFilePath}`);
1291
+ return ToolResult.success();
1292
+ }
225
1293
  }
226
- function project_loader_define_property(obj, key, value) {
227
- if (key in obj) Object.defineProperty(obj, key, {
228
- value: value,
229
- enumerable: true,
230
- configurable: true,
231
- writable: true
232
- });
233
- else obj[key] = value;
234
- 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
+ }
235
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
+
236
1307
  class ProjectLoader {
237
- async loadProject(projectPath) {
238
- if (!projectPath) throw new Error(translate.t("solutionpackager.projectLoader.errors.pathRequired"));
239
- const projectFilePath = Path.join(projectPath, ProjectLoader.ProjectFileName);
240
- const projectFileExists = await this.fileSystem.exists(projectFilePath);
241
- if (projectFileExists) return await this.loadFromProjectFile(projectPath, projectFilePath);
242
- const webAppManifestPath = Path.join(projectPath, ProjectLoader.WebAppManifestFileName);
243
- const webAppManifestExists = await this.fileSystem.exists(webAppManifestPath);
244
- if (webAppManifestExists) return this.loadFromWebAppManifest(projectPath, webAppManifestPath);
245
- throw new Error(translate.t("solutionpackager.projectLoader.errors.noProjectFile", {
246
- projectFile: ProjectLoader.ProjectFileName,
247
- manifestFile: ProjectLoader.WebAppManifestFileName,
248
- path: projectPath
249
- }));
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"));
250
1317
  }
251
- async loadFromProjectFile(projectPath, projectFilePath) {
252
- const fileContent = await this.fileSystem.readFile(projectFilePath);
253
- if (!fileContent) throw new Error(translate.t("solutionpackager.projectLoader.errors.readFailed", {
254
- path: projectFilePath
255
- }));
256
- const json = "string" == typeof fileContent ? fileContent : new TextDecoder("utf-8").decode(fileContent);
257
- const projectData = JSON.parse(json);
258
- const projectType = projectData?.ProjectType || projectData?.type;
259
- if (!projectData || !projectType) throw new Error(translate.t("solutionpackager.projectLoader.errors.invalidProject", {
260
- path: projectFilePath
261
- }));
262
- return {
263
- type: projectType,
264
- name: projectData.Name || Path.basename(projectPath),
265
- projectPath,
266
- projectFilePath
267
- };
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);
268
1322
  }
269
- loadFromWebAppManifest(projectPath, webAppManifestPath) {
270
- const folderName = Path.basename(projectPath);
271
- return {
272
- type: ProjectTypes.AppV2,
273
- name: folderName,
274
- projectPath,
275
- projectFilePath: webAppManifestPath
276
- };
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);
277
1327
  }
278
- constructor(fileSystem){
279
- project_loader_define_property(this, "fileSystem", void 0);
280
- 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
+ }));
281
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
+ }
282
1365
  }
283
- project_loader_define_property(ProjectLoader, "ProjectFileName", "project.uiproj");
284
- project_loader_define_property(ProjectLoader, "WebAppManifestFileName", "webAppManifest.json");
285
- var telemetry_names_TelemetryNames = /*#__PURE__*/ function(TelemetryNames) {
286
- TelemetryNames["ProjectToolPack"] = "ProjectPackager.Tool.Pack";
287
- TelemetryNames["ProjectToolRestore"] = "ProjectPackager.Tool.Restore";
288
- TelemetryNames["ProjectToolValidate"] = "ProjectPackager.Tool.Validate";
289
- TelemetryNames["ProjectToolBuild"] = "ProjectPackager.Tool.Build";
290
- TelemetryNames["ProjectPackagerPack"] = "ProjectPackager.Pack";
291
- TelemetryNames["ProjectPackagerRestore"] = "ProjectPackager.Restore";
292
- TelemetryNames["ProjectPackagerValidate"] = "ProjectPackager.Validate";
293
- TelemetryNames["ProjectPackagerBuild"] = "ProjectPackager.Build";
294
- TelemetryNames["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
295
- return TelemetryNames;
296
- }({});
297
- function project_pack_options_builder_define_property(obj, key, value) {
298
- if (key in obj) Object.defineProperty(obj, key, {
299
- value: value,
300
- enumerable: true,
301
- configurable: true,
302
- writable: true
303
- });
304
- else obj[key] = value;
305
- return obj;
306
- }
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
307
1393
  class ProjectPackOptionsBuilder {
308
- async buildProjectPackOptions(parameters, project) {
309
- if (!parameters.outputPath) throw new Error("Output path is required for Pack command");
310
- await this.fileSystem.mkdir(parameters.outputPath);
311
- const packageId = parameters.package.id && "" !== parameters.package.id.trim() ? parameters.package.id : project.name;
312
- const packageInfo = {
313
- ...parameters.package,
314
- id: this.packService.sanitizePackageId(packageId)
315
- };
316
- return {
317
- projectPath: project.projectPath,
318
- excludeConfiguredSources: parameters.excludeConfiguredSources ?? false,
319
- nuGetSourcesConfigPath: parameters.nuGetSourcesConfigPath,
320
- logLevel: parameters.logLevel,
321
- skipAnalyze: parameters.validateOptions.skipAnalyze,
322
- skipValidate: false,
323
- detailedLogPath: parameters.detailedLogPath,
324
- policyFilePath: parameters.validateOptions.governanceFilePath,
325
- policyFileType: parameters.validateOptions.governanceFileType,
326
- outputPath: parameters.outputPath,
327
- outputType: void 0,
328
- projectType: project.type,
329
- package: packageInfo,
330
- skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
331
- includeSources: parameters.packOptions?.includeSources ?? false,
332
- splitPackages: parameters.packOptions?.splitPackages ?? false
333
- };
334
- }
335
- constructor(packService, fileSystem){
336
- project_pack_options_builder_define_property(this, "packService", void 0);
337
- project_pack_options_builder_define_property(this, "fileSystem", void 0);
338
- this.packService = packService;
339
- 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");
340
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
+ }
341
1429
  }
1430
+
1431
+ // src/services/project-pack-options-validator.ts
342
1432
  class ProjectPackOptionsValidator extends ProjectBuildOptionsValidator {
343
- async validateAsync(options, cancellationToken) {
344
- const destinationResult = this.validateDestinationPath(options.destinationPath);
345
- if (!destinationResult.isSuccess) return destinationResult;
346
- 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;
347
1437
  }
1438
+ return await super.validateAsync(options, cancellationToken);
1439
+ }
348
1440
  }
349
- function project_tool_executor_define_property(obj, key, value) {
350
- if (key in obj) Object.defineProperty(obj, key, {
351
- value: value,
352
- enumerable: true,
353
- configurable: true,
354
- writable: true
355
- });
356
- else obj[key] = value;
357
- return obj;
358
- }
1441
+
1442
+ // src/services/project-tool-executor.ts
1443
+ import {
1444
+ ToolErrorCodes as ToolErrorCodes2,
1445
+ ToolResult as ToolResult2
1446
+ } from "@uipath/solutionpackager-tool-core";
359
1447
  class ProjectToolExecutor {
360
- async restoreAsync(options, project, context, cancellationToken) {
361
- return await this.executeToolOperationAsync(project, context, (tool)=>this.telemetry.trackDependencyOperation(telemetry_names_TelemetryNames.ProjectToolRestore, project.Type, async ()=>tool.restoreAsync(options, cancellationToken), {
362
- projectId: project.Id,
363
- projectType: project.Type
364
- }));
365
- }
366
- async validateAsync(options, project, context, cancellationToken) {
367
- return await this.executeToolOperationAsync(project, context, (tool)=>this.telemetry.trackDependencyOperation(telemetry_names_TelemetryNames.ProjectToolValidate, project.Type, async ()=>tool.validateAsync(options, cancellationToken), {
368
- projectId: project.Id,
369
- projectType: project.Type
370
- }));
371
- }
372
- async buildAsync(options, project, context, cancellationToken) {
373
- return await this.executeToolOperationAsync(project, context, (tool)=>this.telemetry.trackDependencyOperation(telemetry_names_TelemetryNames.ProjectToolBuild, project.Type, async ()=>tool.buildAsync(options, cancellationToken), {
374
- projectId: project.Id,
375
- projectType: project.Type
376
- }));
377
- }
378
- async packAsync(options, project, context, signingInfo, cancellationToken) {
379
- return await this.executeToolOperationAsync(project, context, async (tool)=>{
380
- const result = await this.telemetry.trackDependencyOperation(telemetry_names_TelemetryNames.ProjectToolPack, project.Type, async ()=>await tool.packAsync(options, cancellationToken), {
381
- projectId: project.Id,
382
- projectType: project.Type
383
- });
384
- if (result.isSuccess && signingInfo?.certificatePath && result.packages.length > 0) {
385
- const signResult = await this.signPackagesAsync(result.packages, signingInfo);
386
- if (!signResult.isSuccess) return signResult;
387
- }
388
- return result;
389
- });
390
- }
391
- async executeToolOperationAsync(project, context, operation) {
392
- try {
393
- const tool = await this.toolsFactory.createProjectToolAsync(project, context);
394
- try {
395
- return await operation(tool);
396
- } finally{
397
- const disposeResult = tool.dispose();
398
- if (disposeResult instanceof Promise) await disposeResult;
399
- }
400
- } catch (error) {
401
- 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;
402
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));
403
1504
  }
404
- async signPackagesAsync(packages, signingInfo) {
405
- 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.");
406
- const certificatePath = signingInfo.certificatePath;
407
- const signResults = await Promise.all(packages.map((packagePath)=>this.packageSignService?.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer)));
408
- const failedResult = signResults.find((result)=>result && !result.isSuccess);
409
- if (failedResult) return failedResult;
410
- return ToolResult.success();
411
- }
412
- constructor(toolsFactory, telemetry, packageSignService){
413
- project_tool_executor_define_property(this, "toolsFactory", void 0);
414
- project_tool_executor_define_property(this, "telemetry", void 0);
415
- project_tool_executor_define_property(this, "packageSignService", void 0);
416
- this.toolsFactory = toolsFactory;
417
- this.telemetry = telemetry;
418
- 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.");
419
1509
  }
420
- }
421
- class ProjectValidateOptionsValidator extends PackagerParametersValidator {
422
- async validateAsync(options, _cancellationToken) {
423
- 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;
424
1515
  }
1516
+ return ToolResult2.success();
1517
+ }
425
1518
  }
426
- function tool_logger_define_property(obj, key, value) {
427
- if (key in obj) Object.defineProperty(obj, key, {
428
- value: value,
429
- enumerable: true,
430
- configurable: true,
431
- writable: true
432
- });
433
- else obj[key] = value;
434
- return obj;
435
- }
436
- let globalLogHandler = (logMessage)=>{
437
- const formattedMessage = logMessage.toFormattedString();
438
- switch(logMessage.logLevel){
439
- case LogLevel.Debug:
440
- console.debug(formattedMessage);
441
- break;
442
- case LogLevel.Info:
443
- console.info(formattedMessage);
444
- break;
445
- case LogLevel.Warn:
446
- console.warn(formattedMessage);
447
- break;
448
- case LogLevel.Error:
449
- console.error(formattedMessage);
450
- break;
451
- }
452
- };
453
- function setGlobalLogHandler(handler) {
454
- 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
+ }
455
1525
  }
456
- class ToolLogger {
457
- debug(message, options) {
458
- const logMessage = new LogMessage(message, LogLevel.Debug, {
459
- source: this.source,
460
- sourceTarget: this.sourceTarget,
461
- ...options
462
- });
463
- globalLogHandler(logMessage);
464
- }
465
- info(message, options) {
466
- const logMessage = new LogMessage(message, LogLevel.Info, {
467
- source: this.source,
468
- sourceTarget: this.sourceTarget,
469
- ...options
470
- });
471
- globalLogHandler(logMessage);
472
- }
473
- warn(message, options) {
474
- const logMessage = new LogMessage(message, LogLevel.Warn, {
475
- source: this.source,
476
- sourceTarget: this.sourceTarget,
477
- ...options
478
- });
479
- 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}`);
480
1545
  }
481
- error(message, options) {
482
- const logMessage = new LogMessage(message, LogLevel.Error, {
483
- source: this.source,
484
- sourceTarget: this.sourceTarget,
485
- ...options
486
- });
487
- 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;
488
1554
  }
489
- progress(message, options) {
490
- const logMessage = new LogMessage(message, LogLevel.Info, {
491
- source: this.source,
492
- sourceTarget: this.sourceTarget,
493
- ...options
494
- });
495
- 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;
496
1604
  }
497
- log(message, logLevel, options) {
498
- const logMessage = new LogMessage(message, logLevel, {
499
- source: this.source,
500
- sourceTarget: this.sourceTarget,
501
- ...options
502
- });
503
- 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
+ }
504
1614
  }
505
- logMessage(message) {
506
- 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;
507
1634
  }
508
- constructor(source, sourceTarget){
509
- tool_logger_define_property(this, "source", void 0);
510
- tool_logger_define_property(this, "sourceTarget", void 0);
511
- this.source = source;
512
- 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;
513
1655
  }
514
- }
515
- function tools_factory_define_property(obj, key, value) {
516
- if (key in obj) Object.defineProperty(obj, key, {
517
- value: value,
518
- enumerable: true,
519
- configurable: true,
520
- writable: true
521
- });
522
- else obj[key] = value;
523
- return obj;
524
- }
525
- class ToolsFactory {
526
- async createSolutionToolAsync(solutionName) {
527
- const logger = new ToolLogger("ResourceBuilder", solutionName);
528
- const factory = this.repository.getSolutionToolFactory();
529
- return await factory.createAsync(logger, this.fileSystem);
530
- }
531
- async createProjectToolAsync(project, context) {
532
- const sourceTarget = getSourceTarget();
533
- const logger = new ToolLogger(project.Type, sourceTarget);
534
- if (!project.ProjectPath) throw new Error(`Project path not set for project: ${project.Id}`);
535
- const factory = this.repository.getProjectToolFactory(project.Type);
536
- return await factory.createAsync(logger, this.fileSystem, context);
537
- function getSourceTarget() {
538
- const segments = project.ProjectRelativePath.split(/[/\\]/);
539
- if (segments.length > 1) return segments[0];
540
- 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;
541
1684
  }
542
- }
543
- constructor(repository, fileSystem){
544
- tools_factory_define_property(this, "repository", void 0);
545
- tools_factory_define_property(this, "fileSystem", void 0);
546
- this.repository = repository;
547
- this.fileSystem = fileSystem;
548
- }
549
- }
550
- function project_packager_define_property(obj, key, value) {
551
- if (key in obj) Object.defineProperty(obj, key, {
552
- value: value,
553
- enumerable: true,
554
- configurable: true,
555
- 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
+ }
556
1715
  });
557
- else obj[key] = value;
558
- return obj;
559
- }
560
- class ProjectPackager {
561
- async canPackProjectAsync(projectPath) {
562
- const project = await this.projectLoader.loadProject(projectPath);
563
- 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
+ }));
564
1723
  }
565
- async setupAsync(input, operationId) {
566
- this.telemetryService.setOperationId(operationId);
567
- await this.temporaryStorage.cleanup();
568
- if ("string" == typeof input) return input;
569
- const inputPath = await this.temporaryStorage.getTempSubfolderPathAsync("input");
570
- await this.zipService.extractAsync(input, inputPath);
571
- const entries = await this.fileSystem.readdir(inputPath);
572
- if (1 === entries.length) {
573
- const innerPath = Path.join(inputPath, entries[0]);
574
- const stat = await this.fileSystem.stat(innerPath);
575
- if (stat?.isDirectory()) return innerPath;
576
- }
577
- return inputPath;
578
- }
579
- async restoreProjectAsync(options, cancellationToken) {
580
- return await this.executeProjectOperationAsync(options, "Restore", telemetry_names_TelemetryNames.ProjectPackagerRestore, async (uiPathProject, loadedProject)=>{
581
- const restoreOptions = {
582
- projectPath: loadedProject.projectPath,
583
- excludeConfiguredSources: options.excludeConfiguredSources ?? false,
584
- nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
585
- logLevel: options.logLevel,
586
- outputPath: options.outputPath
587
- };
588
- return await this.projectExecutor.restoreAsync(restoreOptions, uiPathProject, void 0, cancellationToken);
589
- }, cancellationToken);
590
- }
591
- async validateProjectAsync(options, cancellationToken) {
592
- const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
593
- if (!validationResult.isSuccess) return validationResult;
594
- return await this.executeProjectOperationAsync(options, "Validate", telemetry_names_TelemetryNames.ProjectPackagerValidate, async (uiPathProject, loadedProject)=>{
595
- const validateOptions = {
596
- projectPath: loadedProject.projectPath,
597
- excludeConfiguredSources: options.excludeConfiguredSources ?? false,
598
- nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
599
- logLevel: options.logLevel,
600
- skipAnalyze: options.validateOptions.skipAnalyze,
601
- defaultSeverity: options.validateOptions.defaultSeverity,
602
- detailedLogPath: options.detailedLogPath,
603
- policyFilePath: options.validateOptions.governanceFilePath,
604
- policyFileType: options.validateOptions.governanceFileType
605
- };
606
- return await this.projectExecutor.validateAsync(validateOptions, uiPathProject, void 0, cancellationToken);
607
- }, cancellationToken);
608
- }
609
- async buildProjectAsync(options, cancellationToken) {
610
- const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
611
- if (!validationResult.isSuccess) return validationResult;
612
- return await this.executeProjectOperationAsync(options, "Build", telemetry_names_TelemetryNames.ProjectPackagerBuild, async (uiPathProject, loadedProject)=>{
613
- if (!options.outputPath) options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
614
- const buildOptions = {
615
- projectPath: loadedProject.projectPath,
616
- excludeConfiguredSources: options.excludeConfiguredSources ?? false,
617
- nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
618
- logLevel: options.logLevel,
619
- skipAnalyze: options.validateOptions.skipAnalyze,
620
- skipValidate: false,
621
- detailedLogPath: options.detailedLogPath,
622
- policyFilePath: options.validateOptions.governanceFilePath,
623
- policyFileType: options.validateOptions.governanceFileType,
624
- outputPath: options.outputPath,
625
- outputType: void 0,
626
- projectType: uiPathProject.Type
627
- };
628
- return await this.projectExecutor.buildAsync(buildOptions, uiPathProject, void 0, cancellationToken);
629
- }, cancellationToken);
630
- }
631
- async packProjectAsync(options, cancellationToken) {
632
- return await this.telemetryService.trackRequest(telemetry_names_TelemetryNames.ProjectPackagerPack, async ()=>{
633
- try {
634
- let result = await this.packOptionsValidator.validateAsync(options, cancellationToken);
635
- if (!result.isSuccess) return result;
636
- if (!options.outputPath) options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
637
- const loadedProject = await this.projectLoader.loadProject(options.inputPath);
638
- this.telemetryService.trackEvent(telemetry_names_TelemetryNames.ProjectPackagerProjectLoaded, {
639
- projectId: loadedProject.name
640
- });
641
- const projectPackOptions = await this.optionsBuilder.buildProjectPackOptions(options, loadedProject);
642
- const uiPathProject = {
643
- Type: loadedProject.type,
644
- ProjectRelativePath: Path.basename(loadedProject.projectFilePath),
645
- ProjectPath: loadedProject.projectPath,
646
- Id: loadedProject.name
647
- };
648
- result = await this.projectExecutor.packAsync(projectPackOptions, uiPathProject, void 0, options.signingInfo, cancellationToken);
649
- if (result.isSuccess && result.packages.length > 0) {
650
- const destinationPackages = await this.copyPackagesToDestination(result.packages, options.destinationPath, projectPackOptions.package);
651
- result = new ToolResult(ToolErrorCodes.Success, void 0, destinationPackages);
652
- }
653
- if (result.isSuccess) this.logger.info(`Project pack completed successfully. Packages: ${result.packages.join(", ")}`);
654
- else this.logger.error(`Project pack failed with error code ${result.errorCode}: ${result.message}`);
655
- return result;
656
- } catch (error) {
657
- const errorMessage = error instanceof Error ? error.message : String(error);
658
- this.logger.error(`Processing error: ${errorMessage}`);
659
- return ToolResult.error(ToolErrorCodes.InternalError, `Project pack failed: ${errorMessage}`);
660
- } finally{
661
- await this.temporaryStorage.cleanup();
662
- }
663
- });
1724
+ if (!result.packages || result.packages.length === 0) {
1725
+ return [];
664
1726
  }
665
- async getPackageStreamsAsync(result) {
666
- if (!result.isSuccess) throw new Error(translate.t("solutionpackager.packager.errors.failedToGetStreams", {
667
- errorCode: result.errorCode,
668
- 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
669
1733
  }));
670
- if (!result.packages || 0 === result.packages.length) return [];
671
- const packageStreams = [];
672
- for (const packagePath of result.packages){
673
- const data = await this.fileSystem.readFile(packagePath);
674
- if (!data) throw new Error(translate.t("solutionpackager.packager.errors.failedToReadPackage", {
675
- path: packagePath
676
- }));
677
- const name = packagePath.split(/[\\/]/).pop() || packagePath;
678
- packageStreams.push({
679
- name,
680
- data
681
- });
682
- }
683
- return packageStreams;
684
- }
685
- async executeProjectOperationAsync(options, operationName, telemetryName, operation, cancellationToken) {
686
- return await this.telemetryService.trackRequest(telemetryName, async ()=>{
687
- try {
688
- const loadedProject = await this.projectLoader.loadProject(options.inputPath);
689
- const uiPathProject = {
690
- Type: loadedProject.type,
691
- ProjectRelativePath: Path.basename(loadedProject.projectFilePath),
692
- ProjectPath: loadedProject.projectPath,
693
- Id: loadedProject.name
694
- };
695
- const operationResult = await operation(uiPathProject, loadedProject);
696
- if (operationResult.isSuccess) this.logger.info(`Project ${operationName.toLowerCase()} completed successfully.`);
697
- else this.logger.error(`Project ${operationName.toLowerCase()} failed with error code ${operationResult.errorCode}: ${operationResult.message}`);
698
- return operationResult;
699
- } catch (error) {
700
- const errorMessage = error instanceof Error ? error.message : String(error);
701
- this.logger.error(`Processing error: ${errorMessage}`);
702
- return ToolResult.error(ToolErrorCodes.InternalError, `Project ${operationName.toLowerCase()} failed: ${errorMessage}`);
703
- } finally{
704
- await this.temporaryStorage.cleanup();
705
- }
706
- });
1734
+ }
1735
+ const name = packagePath.split(/[\\/]/).pop() || packagePath;
1736
+ packageStreams.push({ name, data });
707
1737
  }
708
- async copyPackagesToDestination(packagePaths, destinationPath, packageInfo) {
709
- await this.fileSystem.mkdir(destinationPath);
710
- const destinationPackages = [];
711
- for (const packagePath of packagePaths){
712
- const stat = await this.fileSystem.stat(packagePath);
713
- if (stat?.isDirectory()) {
714
- const files = await this.fileSystem.readdir(packagePath);
715
- const nupkgFiles = files.filter((f)=>f.endsWith(".nupkg"));
716
- if (nupkgFiles.length > 0) for (const nupkgFile of nupkgFiles){
717
- const filePath = Path.join(packagePath, nupkgFile);
718
- const destPath = Path.join(destinationPath, nupkgFile);
719
- const data = await this.fileSystem.readFile(filePath);
720
- if (!data) throw new Error(translate.t("solutionpackager.packager.errors.failedToReadPackage", {
721
- path: filePath
722
- }));
723
- await this.fileSystem.writeFile(destPath, data);
724
- destinationPackages.push(destPath);
725
- }
726
- else {
727
- const nupkgFileName = `${packageInfo.id}.${packageInfo.version}.nupkg`;
728
- const destPath = Path.join(destinationPath, nupkgFileName);
729
- const packResult = await this.nugetPackager.packAsync(packagePath, packageInfo, destPath);
730
- destinationPackages.push(packResult.outputPath);
731
- }
732
- } else {
733
- const fileName = packagePath.split(/[\\/]/).pop() || packagePath;
734
- const destPath = Path.join(destinationPath, fileName);
735
- const data = await this.fileSystem.readFile(packagePath);
736
- if (!data) throw new Error(translate.t("solutionpackager.packager.errors.failedToReadPackage", {
737
- path: packagePath
738
- }));
739
- await this.fileSystem.writeFile(destPath, data);
740
- 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
+ }));
741
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
+ }));
742
1801
  }
743
- return destinationPackages;
744
- }
745
- constructor(fileSystem, telemetryService, packageSignService){
746
- project_packager_define_property(this, "fileSystem", void 0);
747
- project_packager_define_property(this, "telemetryService", void 0);
748
- project_packager_define_property(this, "packageSignService", void 0);
749
- project_packager_define_property(this, "repository", void 0);
750
- project_packager_define_property(this, "temporaryStorage", void 0);
751
- project_packager_define_property(this, "zipService", void 0);
752
- project_packager_define_property(this, "logger", void 0);
753
- project_packager_define_property(this, "optionsBuilder", void 0);
754
- project_packager_define_property(this, "toolsFactory", void 0);
755
- project_packager_define_property(this, "projectExecutor", void 0);
756
- project_packager_define_property(this, "projectLoader", void 0);
757
- project_packager_define_property(this, "validateOptionsValidator", void 0);
758
- project_packager_define_property(this, "buildOptionsValidator", void 0);
759
- project_packager_define_property(this, "packOptionsValidator", void 0);
760
- project_packager_define_property(this, "nugetPackager", void 0);
761
- this.fileSystem = fileSystem;
762
- this.telemetryService = telemetryService;
763
- this.packageSignService = packageSignService;
764
- this.repository = toolsFactoryRepository;
765
- this.temporaryStorage = new TemporaryStorageService(this.fileSystem);
766
- this.zipService = new ZipService(this.fileSystem);
767
- this.nugetPackager = new NugetPackager(this.fileSystem);
768
- this.logger = new ToolLogger("ProjectPackager", "PackProject");
769
- this.validateOptionsValidator = new ProjectValidateOptionsValidator(this.logger, this.fileSystem);
770
- this.buildOptionsValidator = new ProjectBuildOptionsValidator(this.logger, this.fileSystem);
771
- this.packOptionsValidator = new ProjectPackOptionsValidator(this.logger, this.fileSystem);
772
- const packService = new PackService();
773
- this.optionsBuilder = new ProjectPackOptionsBuilder(packService, this.fileSystem);
774
- this.toolsFactory = new ToolsFactory(this.repository, this.fileSystem);
775
- this.projectExecutor = new ProjectToolExecutor(this.toolsFactory, this.telemetryService, this.packageSignService);
776
- this.projectLoader = new ProjectLoader(this.fileSystem);
1802
+ await this.fileSystem.writeFile(destPath, data);
1803
+ destinationPackages.push(destPath);
1804
+ }
777
1805
  }
1806
+ return destinationPackages;
1807
+ }
778
1808
  }
779
- export { BrowserContextStorage, ConsoleTelemetryProvider, PackService, PackagerParameters, PackagerParametersValidator, ProjectBuildOptions, ProjectBuildOptionsValidator, ProjectLoader, ProjectPackOptions, ProjectPackager, ProjectRestoreOptions, ProjectToolExecutor, ProjectValidateOptions, ProjectValidateOptionsValidator, packager_parameters_RulesConfigFileType as RulesConfigFileType, telemetry_names_TelemetryNames as TelemetryNames, TelemetryService, ToolLogger, ToolsFactory, setGlobalLogHandler };
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
+ };