@uipath/project-packager 1.1.5 → 1.1.15

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,1894 @@
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
+ }
36
107
  }
108
+ }
37
109
  };
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."}}}}');
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
+ }
690
+ }
691
+ }
692
+ };
693
+ // src/i18n/locales/zh-TW.json
694
+ var zh_TW_default = {
695
+ solutionpackager: {
696
+ projectLoader: {
697
+ errors: {
698
+ pathRequired: "Project directory path is required",
699
+ noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
700
+ readFailed: "Failed to read project file: {path}",
701
+ invalidProject: "Invalid project file: {path}. Missing ProjectType field."
702
+ }
703
+ },
704
+ validator: {
705
+ errors: {
706
+ destinationNotDefined: "Destination path is not defined",
707
+ governanceRequired: "Governance file path is required when governance file type is not Default",
708
+ governanceFileInfo: "Unable to get file information: {path}",
709
+ governanceInvalidFile: "Governance file path is not a valid file: {path}"
710
+ }
711
+ },
712
+ packager: {
713
+ errors: {
714
+ failedToGetStreams: "Cannot get package streams from failed result. Error code: {errorCode}, message: {message}",
715
+ failedToReadPackage: "Failed to read package file: {path}"
716
+ }
717
+ },
718
+ governance: {
719
+ info: {
720
+ alreadyProvided: "Governance policy file already provided, skipping download.",
721
+ saved: "Governance policy saved to {path}",
722
+ downloading: "Downloading governance policy from {url}",
723
+ noPolicyFound: "No governance policy found for this configuration.",
724
+ responseNotJson: "Policy response is not JSON, treating as no policy.",
725
+ licenseStatus: "AcquireLicense returned {status}, using {fallback}.",
726
+ licenseResponse: "AcquireLicense: isLicensed={isLicensed}, robotType={robotType}",
727
+ licenseFailed: "AcquireLicense failed: {error}. Using {fallback}."
728
+ },
729
+ errors: {
730
+ connectionIncomplete: "Connection info incomplete, falling back to Default governance.",
731
+ failedToGetPolicy: "Failed to download governance policy: {content}",
732
+ failedToSave: "Failed to save governance policy: {error}. Falling back to Default governance.",
733
+ failedToDownload: "Failed to download governance policy: {error}. Falling back to Default governance."
734
+ }
735
+ },
736
+ signing: {
737
+ errors: {
738
+ dotnetNotAvailable: "dotnet CLI is not available. Package signing requires dotnet CLI to be installed."
739
+ },
740
+ info: {
741
+ dotnetNotAvailable: "dotnet CLI is not available. Cannot sign package."
742
+ }
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
+ // ../../common/dist/telemetry/index.js
818
+ class BrowserContextStorage {
819
+ contextStack = [];
820
+ run(context, fn) {
821
+ this.contextStack.push(context);
822
+ try {
823
+ const result = fn();
824
+ if (result !== null && typeof result === "object" && typeof result.then === "function") {
825
+ return result.finally(() => {
826
+ this.contextStack.pop();
827
+ });
828
+ }
829
+ this.contextStack.pop();
830
+ return result;
831
+ } catch (error) {
832
+ this.contextStack.pop();
833
+ throw error;
834
+ }
835
+ }
836
+ getContext() {
837
+ return this.contextStack.length > 0 ? this.contextStack[this.contextStack.length - 1] : undefined;
838
+ }
75
839
  }
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);
840
+
841
+ class ConsoleTelemetryProvider {
842
+ async trackEvent(eventName, _properties) {
843
+ console.debug(`[Telemetry] Event: ${eventName}`);
844
+ }
845
+ async trackException(error, _properties) {
846
+ console.error(`[Telemetry] Exception: ${error.message}`);
847
+ }
848
+ async trackRequest(name, duration, success, _properties) {
849
+ console.debug(`[Telemetry] Request: ${name} (${duration}ms, ${success ? "ok" : "fail"})`);
850
+ }
851
+ async trackDependency(name, type, duration, success, _properties) {
852
+ console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
853
+ }
854
+ }
855
+ var SENSITIVE_NAME_TOKENS = new Set([
856
+ "token",
857
+ "tokens",
858
+ "secret",
859
+ "secrets",
860
+ "password",
861
+ "passwords",
862
+ "pwd",
863
+ "credential",
864
+ "credentials",
865
+ "auth",
866
+ "authentication",
867
+ "authorization",
868
+ "authority",
869
+ "cert",
870
+ "certificate",
871
+ "certificates"
872
+ ]);
873
+ var SENSITIVE_KEY_PREFIXES = new Set([
874
+ "api",
875
+ "access",
876
+ "client",
877
+ "private",
878
+ "public",
879
+ "signing",
880
+ "encryption",
881
+ "session",
882
+ "master",
883
+ "shared",
884
+ "root",
885
+ "ssh",
886
+ "rsa",
887
+ "aes",
888
+ "hmac",
889
+ "oauth"
890
+ ]);
891
+ class TelemetryService {
892
+ telemetryProvider;
893
+ contextStorage;
894
+ operationId;
895
+ defaultProperties;
896
+ constructor(telemetryProvider, contextStorage) {
897
+ this.telemetryProvider = telemetryProvider;
898
+ this.contextStorage = contextStorage;
899
+ }
900
+ setOperationId(operationId) {
901
+ this.operationId = operationId;
902
+ }
903
+ setProvider(provider) {
904
+ this.telemetryProvider = provider;
905
+ }
906
+ setDefaultProperties(properties) {
907
+ this.defaultProperties = properties;
908
+ }
909
+ trackEvent(name, properties) {
910
+ const context = this.getCurrentContext();
911
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
912
+ this.telemetryProvider.trackEvent(name, enrichedProperties);
913
+ }
914
+ trackException(error, properties) {
915
+ const context = this.getCurrentContext();
916
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
917
+ this.telemetryProvider.trackException(error, enrichedProperties);
918
+ }
919
+ async trackRequest(name, fn, properties) {
920
+ const context = {
921
+ operationId: this.operationId ?? this.generateId(),
922
+ id: this.generateId()
923
+ };
924
+ const startTime = performance.now();
925
+ try {
926
+ const result = await this.contextStorage.run(context, fn);
927
+ const durationMs = performance.now() - startTime;
928
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
929
+ await this.telemetryProvider.trackRequest(name, durationMs, true, enrichedProperties);
930
+ return result;
931
+ } catch (error) {
932
+ const durationMs = performance.now() - startTime;
933
+ const err = error instanceof Error ? error : new Error(String(error));
934
+ const enrichedProperties = this.enrichPropertiesWithContext({ ...properties, errorMessage: err.message }, context);
935
+ await this.telemetryProvider.trackRequest(name, durationMs, false, enrichedProperties);
936
+ throw error;
937
+ }
938
+ }
939
+ async trackDependencyOperation(name, type, fn, properties) {
940
+ const parentContext = this.getCurrentContext();
941
+ if (!parentContext) {
942
+ throw new Error("trackDependencyOperation must be called within a trackRequest block.");
92
943
  }
944
+ const childContext = {
945
+ operationId: parentContext.operationId,
946
+ parentId: parentContext.id,
947
+ id: this.generateId()
948
+ };
949
+ const startTime = performance.now();
950
+ try {
951
+ const result = await this.contextStorage.run(childContext, fn);
952
+ const durationMs = performance.now() - startTime;
953
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, childContext);
954
+ await this.telemetryProvider.trackDependency(name, type, durationMs, true, enrichedProperties);
955
+ return result;
956
+ } catch (error) {
957
+ const durationMs = performance.now() - startTime;
958
+ const err = error instanceof Error ? error : new Error(String(error));
959
+ const enrichedProperties = this.enrichPropertiesWithContext({ ...properties, errorMessage: err.message }, childContext);
960
+ await this.telemetryProvider.trackDependency(name, type, durationMs, false, enrichedProperties);
961
+ throw error;
962
+ }
963
+ }
964
+ getCurrentContext() {
965
+ return this.contextStorage.getContext();
966
+ }
967
+ enrichPropertiesWithContext(properties, context) {
968
+ return {
969
+ ...this.defaultProperties,
970
+ ...properties,
971
+ ...context
972
+ };
973
+ }
974
+ generateId() {
975
+ return crypto.randomUUID().replaceAll("-", "");
976
+ }
93
977
  }
94
- class ProjectRestoreOptions extends PackagerParameters {
978
+ // src/models/packager-parameters.ts
979
+ import {
980
+ LogLevel
981
+ } from "@uipath/solutionpackager-tool-core";
982
+ var RulesConfigFileType;
983
+ ((RulesConfigFileType2) => {
984
+ RulesConfigFileType2["Default"] = "Default";
985
+ RulesConfigFileType2["AutomationOps"] = "AutomationOps";
986
+ RulesConfigFileType2["Studio"] = "Studio";
987
+ })(RulesConfigFileType ||= {});
988
+
989
+ class PackagerParameters {
990
+ inputPath;
991
+ downloadUrl;
992
+ logLevel = LogLevel.Warn;
993
+ outputPath;
994
+ targetFramework;
995
+ excludeConfiguredSources = false;
996
+ nuGetSourcesConfigPath;
997
+ detailedLogPath;
998
+ connection;
999
+ workflowCompilerVersion;
95
1000
  }
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;
1001
+ // src/models/project-restore-options.ts
1002
+ class ProjectRestoreOptions extends PackagerParameters {
105
1003
  }
1004
+
1005
+ // src/models/project-validate-options.ts
106
1006
  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
- }
1007
+ validateOptions = {
1008
+ skipAnalyze: false,
1009
+ skipValidate: false,
1010
+ governanceFileType: "Default" /* Default */
1011
+ };
113
1012
  }
1013
+
1014
+ // src/models/project-build-options.ts
114
1015
  class ProjectBuildOptions extends ProjectValidateOptions {
115
1016
  }
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
- }
1017
+ // src/models/project-pack-options.ts
126
1018
  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
- }
1019
+ destinationPath;
1020
+ package;
1021
+ signingInfo;
1022
+ packOptions;
130
1023
  }
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
1024
+ // src/services/governance-policy-service.ts
1025
+ import {
1026
+ Path,
1027
+ toRelativeUrl,
1028
+ translate
1029
+ } from "@uipath/solutionpackager-tool-core";
1030
+
1031
+ // src/services/tool-logger.ts
1032
+ import {
1033
+ LogLevel as LogLevel2,
1034
+ LogMessage
1035
+ } from "@uipath/solutionpackager-tool-core";
1036
+ var globalLogHandler = (logMessage) => {
1037
+ const formattedMessage = logMessage.toFormattedString();
1038
+ switch (logMessage.logLevel) {
1039
+ case LogLevel2.Debug:
1040
+ console.debug(formattedMessage);
1041
+ break;
1042
+ case LogLevel2.Info:
1043
+ console.info(formattedMessage);
1044
+ break;
1045
+ case LogLevel2.Warn:
1046
+ console.warn(formattedMessage);
1047
+ break;
1048
+ case LogLevel2.Error:
1049
+ console.error(formattedMessage);
1050
+ break;
1051
+ }
1052
+ };
1053
+ function setGlobalLogHandler(handler) {
1054
+ globalLogHandler = handler;
1055
+ }
1056
+
1057
+ class ToolLogger {
1058
+ source;
1059
+ sourceTarget;
1060
+ constructor(source, sourceTarget) {
1061
+ this.source = source;
1062
+ this.sourceTarget = sourceTarget;
1063
+ }
1064
+ debug(message, options) {
1065
+ const logMessage = new LogMessage(message, LogLevel2.Debug, {
1066
+ source: this.source,
1067
+ sourceTarget: this.sourceTarget,
1068
+ ...options
1069
+ });
1070
+ globalLogHandler(logMessage);
1071
+ }
1072
+ info(message, options) {
1073
+ const logMessage = new LogMessage(message, LogLevel2.Info, {
1074
+ source: this.source,
1075
+ sourceTarget: this.sourceTarget,
1076
+ ...options
1077
+ });
1078
+ globalLogHandler(logMessage);
1079
+ }
1080
+ warn(message, options) {
1081
+ const logMessage = new LogMessage(message, LogLevel2.Warn, {
1082
+ source: this.source,
1083
+ sourceTarget: this.sourceTarget,
1084
+ ...options
1085
+ });
1086
+ globalLogHandler(logMessage);
1087
+ }
1088
+ error(message, options) {
1089
+ const logMessage = new LogMessage(message, LogLevel2.Error, {
1090
+ source: this.source,
1091
+ sourceTarget: this.sourceTarget,
1092
+ ...options
1093
+ });
1094
+ globalLogHandler(logMessage);
1095
+ }
1096
+ progress(message, options) {
1097
+ const logMessage = new LogMessage(message, LogLevel2.Info, {
1098
+ source: this.source,
1099
+ sourceTarget: this.sourceTarget,
1100
+ ...options
1101
+ });
1102
+ globalLogHandler(logMessage);
1103
+ }
1104
+ log(message, logLevel, options) {
1105
+ const logMessage = new LogMessage(message, logLevel, {
1106
+ source: this.source,
1107
+ sourceTarget: this.sourceTarget,
1108
+ ...options
137
1109
  });
138
- else obj[key] = value;
139
- return obj;
1110
+ globalLogHandler(logMessage);
1111
+ }
1112
+ logMessage(message) {
1113
+ globalLogHandler(message);
1114
+ }
140
1115
  }
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);
1116
+
1117
+ // src/services/governance-policy-service.ts
1118
+ var LICENSE_TYPES = {
1119
+ NoLicense: "NoLicense",
1120
+ Development: "Development",
1121
+ Attended: "Attended",
1122
+ Unattended: "Unattended",
1123
+ StudioX: "StudioX",
1124
+ StudioPro: "StudioPro",
1125
+ AutomationKit: "AutomationKit"
1126
+ };
1127
+ var DEFAULT_PROFILE_KEY = "StudioWeb";
1128
+ var ACQUIRE_LICENSE_PATH = "/orchestrator_/api/StudioWeb/AcquireLicense";
1129
+ var GOVERNANCE_SUBFOLDER = "governance";
1130
+ var GOVERNANCE_FILE_NAME = "governance-policy.json";
1131
+ var errorMessage = (error) => error instanceof Error ? error.message : String(error);
1132
+ var t = (key, params) => translate.t(`solutionpackager.governance.${key}`, params);
1133
+
1134
+ class GovernancePolicyService {
1135
+ fileSystem;
1136
+ temporaryStorage;
1137
+ fetchFn;
1138
+ logger = new ToolLogger("GovernancePolicyService", "ResolvePolicy");
1139
+ constructor(fileSystem, temporaryStorage, fetchFn = fetch.bind(globalThis)) {
1140
+ this.fileSystem = fileSystem;
1141
+ this.temporaryStorage = temporaryStorage;
1142
+ this.fetchFn = fetchFn;
1143
+ }
1144
+ async resolveGovernancePolicyAsync(validateOptions, connectionInfo, cancellationToken) {
1145
+ if (validateOptions.governanceFileType !== "AutomationOps" /* AutomationOps */) {
1146
+ return;
1147
+ }
1148
+ if (validateOptions.governanceFilePath) {
1149
+ this.logger.info(t("info.alreadyProvided"));
1150
+ return;
155
1151
  }
1152
+ const cloudUrl = connectionInfo?.cloudUrl;
1153
+ const organizationId = connectionInfo?.organizationId;
1154
+ const tenantId = connectionInfo?.tenantId;
1155
+ const accessToken = connectionInfo?.accessToken;
1156
+ if (!cloudUrl || !organizationId || !tenantId || !accessToken) {
1157
+ this.logger.warn(t("errors.connectionIncomplete"));
1158
+ validateOptions.governanceFileType = "Default" /* Default */;
1159
+ return;
1160
+ }
1161
+ const profileKey = validateOptions.profileKey ?? DEFAULT_PROFILE_KEY;
1162
+ const orchestratorUrl = toRelativeUrl(cloudUrl);
1163
+ const licenseType = await this.resolveLicenseTypeAsync(profileKey, orchestratorUrl, accessToken, cancellationToken);
1164
+ const policy = await this.downloadPolicyAsync(organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken);
1165
+ if (!policy) {
1166
+ validateOptions.governanceFileType = "Default" /* Default */;
1167
+ return;
1168
+ }
1169
+ try {
1170
+ const dir = await this.temporaryStorage.getTempSubfolderPathAsync(GOVERNANCE_SUBFOLDER);
1171
+ const filePath = Path.join(dir, GOVERNANCE_FILE_NAME);
1172
+ await this.fileSystem.writeFile(filePath, policy);
1173
+ this.logger.info(t("info.saved", { path: filePath }));
1174
+ validateOptions.governanceFilePath = filePath;
1175
+ } catch (error) {
1176
+ this.logger.warn(t("errors.failedToSave", {
1177
+ error: errorMessage(error)
1178
+ }));
1179
+ validateOptions.governanceFileType = "Default" /* Default */;
1180
+ }
1181
+ }
1182
+ async downloadPolicyAsync(organizationId, tenantId, accessToken, licenseType, profileKey, cancellationToken) {
1183
+ const policyUrl = `/${organizationId}/roboticsops_` + `/api/Policy/license/${licenseType}/product/${profileKey}/tenant/${tenantId}`;
1184
+ this.logger.info(t("info.downloading", { url: policyUrl }));
1185
+ try {
1186
+ const response = await this.fetchFn(policyUrl, {
1187
+ headers: {
1188
+ Authorization: `Bearer ${accessToken}`,
1189
+ AccountId: organizationId
1190
+ },
1191
+ signal: cancellationToken
1192
+ });
1193
+ if (response.status === 204 || response.status === 404) {
1194
+ this.logger.info(t("info.noPolicyFound"));
1195
+ return null;
1196
+ }
1197
+ if (!response.ok) {
1198
+ const body = await response.text();
1199
+ this.logger.warn(t("errors.failedToGetPolicy", { content: body }));
1200
+ return null;
1201
+ }
1202
+ const content = await response.text();
1203
+ if (!content?.trimStart().startsWith("{")) {
1204
+ this.logger.info(t("info.responseNotJson"));
1205
+ return null;
1206
+ }
1207
+ return content;
1208
+ } catch (error) {
1209
+ this.logger.warn(t("errors.failedToDownload", {
1210
+ error: errorMessage(error)
1211
+ }));
1212
+ return null;
1213
+ }
1214
+ }
1215
+ async resolveLicenseTypeAsync(profileKey, orchestratorUrl, accessToken, cancellationToken) {
1216
+ const isStudioWeb = profileKey === DEFAULT_PROFILE_KEY;
1217
+ const fallback = isStudioWeb ? LICENSE_TYPES.NoLicense : LICENSE_TYPES.Development;
1218
+ try {
1219
+ const response = await this.fetchFn(`${orchestratorUrl}${ACQUIRE_LICENSE_PATH}`, {
1220
+ method: "POST",
1221
+ headers: { Authorization: `Bearer ${accessToken}` },
1222
+ signal: cancellationToken
1223
+ });
1224
+ if (!response.ok) {
1225
+ this.logger.info(t("info.licenseStatus", {
1226
+ status: response.status,
1227
+ fallback
1228
+ }));
1229
+ return fallback;
1230
+ }
1231
+ const { isLicensed, robotType } = await response.json();
1232
+ this.logger.info(t("info.licenseResponse", {
1233
+ isLicensed: String(isLicensed),
1234
+ robotType: String(robotType)
1235
+ }));
1236
+ if (!isLicensed || !robotType) {
1237
+ return fallback;
1238
+ }
1239
+ if (isStudioWeb) {
1240
+ return robotType === LICENSE_TYPES.AutomationKit ? LICENSE_TYPES.AutomationKit : LICENSE_TYPES.NoLicense;
1241
+ }
1242
+ return robotType;
1243
+ } catch (error) {
1244
+ this.logger.info(t("info.licenseFailed", {
1245
+ error: errorMessage(error),
1246
+ fallback
1247
+ }));
1248
+ return fallback;
1249
+ }
1250
+ }
156
1251
  }
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;
1252
+ // src/services/pack-service.ts
1253
+ class PackService {
1254
+ disallowedCharsRegex = /[^\w.-]/g;
1255
+ spacesDotRegex = /[\s.]+/g;
1256
+ dotDashRegex = /\.{0,10}[-:]\.{0,10}/g;
1257
+ MaxPackageIdLength = 100;
1258
+ sanitizePackageId(packageId) {
1259
+ packageId = packageId.trim();
1260
+ packageId = packageId.replace(this.spacesDotRegex, ".");
1261
+ packageId = packageId.replace(this.dotDashRegex, "-");
1262
+ packageId = packageId.replace(this.disallowedCharsRegex, "_");
1263
+ if (packageId.length > this.MaxPackageIdLength) {
1264
+ throw new Error(`Package id ${packageId} exceeds the characters limit of ${this.MaxPackageIdLength}`);
1265
+ }
1266
+ return packageId;
1267
+ }
166
1268
  }
1269
+ // src/services/packager-parameters-validator.ts
1270
+ import {
1271
+ ToolErrorCodes,
1272
+ ToolResult,
1273
+ translate as translate2
1274
+ } from "@uipath/solutionpackager-tool-core";
167
1275
  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();
1276
+ logger;
1277
+ fileSystem;
1278
+ constructor(logger, fileSystem) {
1279
+ this.logger = logger;
1280
+ this.fileSystem = fileSystem;
1281
+ }
1282
+ async validateAsync(_options, _cancellationToken) {
1283
+ return ToolResult.success();
1284
+ }
1285
+ validateDestinationPath(destinationPath) {
1286
+ if (!destinationPath) {
1287
+ const error = translate2.t("solutionpackager.validator.errors.destinationNotDefined");
1288
+ this.logger.error(error);
1289
+ return ToolResult.error(ToolErrorCodes.InternalError, error);
178
1290
  }
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();
1291
+ return ToolResult.success();
1292
+ }
1293
+ async validateGovernanceOptions(validateOptions) {
1294
+ if (validateOptions.governanceFileType === "Default" /* Default */) {
1295
+ if (validateOptions.governanceFilePath) {
1296
+ this.logger.warn(`Governance file path '${validateOptions.governanceFilePath}' will be ignored when governance file type is Default`);
1297
+ }
1298
+ return ToolResult.success();
213
1299
  }
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;
1300
+ if (!validateOptions.governanceFilePath) {
1301
+ const error = translate2.t("solutionpackager.validator.errors.governanceRequired");
1302
+ this.logger.error(error);
1303
+ return ToolResult.error(ToolErrorCodes.InternalError, error);
219
1304
  }
220
- }
221
- class ProjectBuildOptionsValidator extends PackagerParametersValidator {
222
- async validateAsync(options, _cancellationToken) {
223
- return await this.validateGovernanceOptions(options.validateOptions);
1305
+ try {
1306
+ const stat = await this.fileSystem.stat(validateOptions.governanceFilePath);
1307
+ if (!stat) {
1308
+ const error = translate2.t("solutionpackager.validator.errors.governanceFileInfo", {
1309
+ path: validateOptions.governanceFilePath
1310
+ });
1311
+ this.logger.error(error);
1312
+ return ToolResult.error(ToolErrorCodes.InternalError, error);
1313
+ }
1314
+ if (stat.isDirectory()) {
1315
+ const error = translate2.t("solutionpackager.validator.errors.governanceInvalidFile", {
1316
+ path: validateOptions.governanceFilePath
1317
+ });
1318
+ this.logger.error(error);
1319
+ return ToolResult.error(ToolErrorCodes.InternalError, error);
1320
+ }
1321
+ } catch (error) {
1322
+ const errorMessage2 = error instanceof Error ? error.message : String(error);
1323
+ const errorLog = `Governance file not found or inaccessible: ${validateOptions.governanceFilePath}. Error: ${errorMessage2}`;
1324
+ this.logger.error(errorLog);
1325
+ return ToolResult.error(ToolErrorCodes.InternalError, errorLog);
224
1326
  }
1327
+ this.logger.info(`Using Studio governance file: ${validateOptions.governanceFilePath}`);
1328
+ return ToolResult.success();
1329
+ }
225
1330
  }
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;
1331
+ // src/services/project-build-options-validator.ts
1332
+ class ProjectBuildOptionsValidator extends PackagerParametersValidator {
1333
+ async validateAsync(options, _cancellationToken) {
1334
+ return await this.validateGovernanceOptions(options.validateOptions);
1335
+ }
235
1336
  }
1337
+ // src/services/project-loader.ts
1338
+ import {
1339
+ Path as Path2,
1340
+ ProjectTypes,
1341
+ translate as translate3
1342
+ } from "@uipath/solutionpackager-tool-core";
1343
+
236
1344
  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
- }));
1345
+ fileSystem;
1346
+ static ProjectFileName = "project.uiproj";
1347
+ static WebAppManifestFileName = "webAppManifest.json";
1348
+ constructor(fileSystem) {
1349
+ this.fileSystem = fileSystem;
1350
+ }
1351
+ async loadProject(projectPath) {
1352
+ if (!projectPath) {
1353
+ throw new Error(translate3.t("solutionpackager.projectLoader.errors.pathRequired"));
250
1354
  }
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
- };
1355
+ const projectFilePath = Path2.join(projectPath, ProjectLoader.ProjectFileName);
1356
+ const projectFileExists = await this.fileSystem.exists(projectFilePath);
1357
+ if (projectFileExists) {
1358
+ return await this.loadFromProjectFile(projectPath, projectFilePath);
268
1359
  }
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
- };
1360
+ const webAppManifestPath = Path2.join(projectPath, ProjectLoader.WebAppManifestFileName);
1361
+ const webAppManifestExists = await this.fileSystem.exists(webAppManifestPath);
1362
+ if (webAppManifestExists) {
1363
+ return this.loadFromWebAppManifest(projectPath, webAppManifestPath);
277
1364
  }
278
- constructor(fileSystem){
279
- project_loader_define_property(this, "fileSystem", void 0);
280
- this.fileSystem = fileSystem;
1365
+ throw new Error(translate3.t("solutionpackager.projectLoader.errors.noProjectFile", {
1366
+ projectFile: ProjectLoader.ProjectFileName,
1367
+ manifestFile: ProjectLoader.WebAppManifestFileName,
1368
+ path: projectPath
1369
+ }));
1370
+ }
1371
+ async loadFromProjectFile(projectPath, projectFilePath) {
1372
+ const fileContent = await this.fileSystem.readFile(projectFilePath);
1373
+ if (!fileContent) {
1374
+ throw new Error(translate3.t("solutionpackager.projectLoader.errors.readFailed", {
1375
+ path: projectFilePath
1376
+ }));
281
1377
  }
1378
+ const json = typeof fileContent === "string" ? fileContent : new TextDecoder("utf-8").decode(fileContent);
1379
+ const projectData = JSON.parse(json);
1380
+ const projectType = projectData?.ProjectType || projectData?.type;
1381
+ if (!projectData || !projectType) {
1382
+ throw new Error(translate3.t("solutionpackager.projectLoader.errors.invalidProject", {
1383
+ path: projectFilePath
1384
+ }));
1385
+ }
1386
+ return {
1387
+ type: projectType,
1388
+ name: projectData.Name || Path2.basename(projectPath),
1389
+ projectPath,
1390
+ projectFilePath
1391
+ };
1392
+ }
1393
+ loadFromWebAppManifest(projectPath, webAppManifestPath) {
1394
+ const folderName = Path2.basename(projectPath);
1395
+ return {
1396
+ type: ProjectTypes.AppV2,
1397
+ name: folderName,
1398
+ projectPath,
1399
+ projectFilePath: webAppManifestPath
1400
+ };
1401
+ }
282
1402
  }
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
- }
1403
+ // src/services/project-packager.ts
1404
+ import {
1405
+ toolsFactoryRepository as defaultToolsFactoryRepository,
1406
+ NugetPackager,
1407
+ Path as Path3,
1408
+ TargetFramework,
1409
+ TemporaryStorageService,
1410
+ ToolErrorCodes as ToolErrorCodes3,
1411
+ ToolResult as ToolResult3,
1412
+ translate as translate4,
1413
+ ZipService
1414
+ } from "@uipath/solutionpackager-tool-core";
1415
+
1416
+ // src/telemetry-names.ts
1417
+ var TelemetryNames;
1418
+ ((TelemetryNames2) => {
1419
+ TelemetryNames2["ProjectToolPack"] = "ProjectPackager.Tool.Pack";
1420
+ TelemetryNames2["ProjectToolRestore"] = "ProjectPackager.Tool.Restore";
1421
+ TelemetryNames2["ProjectToolValidate"] = "ProjectPackager.Tool.Validate";
1422
+ TelemetryNames2["ProjectToolBuild"] = "ProjectPackager.Tool.Build";
1423
+ TelemetryNames2["ProjectPackagerPack"] = "ProjectPackager.Pack";
1424
+ TelemetryNames2["ProjectPackagerRestore"] = "ProjectPackager.Restore";
1425
+ TelemetryNames2["ProjectPackagerValidate"] = "ProjectPackager.Validate";
1426
+ TelemetryNames2["ProjectPackagerBuild"] = "ProjectPackager.Build";
1427
+ TelemetryNames2["ProjectPackagerProjectLoaded"] = "ProjectPackager.ProjectLoaded";
1428
+ })(TelemetryNames ||= {});
1429
+
1430
+ // src/services/project-pack-options-builder.ts
307
1431
  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;
1432
+ packService;
1433
+ fileSystem;
1434
+ constructor(packService, fileSystem) {
1435
+ this.packService = packService;
1436
+ this.fileSystem = fileSystem;
1437
+ }
1438
+ async buildProjectPackOptions(parameters, project) {
1439
+ if (!parameters.outputPath) {
1440
+ throw new Error("Output path is required for Pack command");
340
1441
  }
1442
+ await this.fileSystem.mkdir(parameters.outputPath);
1443
+ const packageId = !parameters.package.id || parameters.package.id.trim() === "" ? project.name : parameters.package.id;
1444
+ const packageInfo = {
1445
+ ...parameters.package,
1446
+ id: this.packService.sanitizePackageId(packageId)
1447
+ };
1448
+ return {
1449
+ projectPath: project.projectPath,
1450
+ excludeConfiguredSources: parameters.excludeConfiguredSources ?? false,
1451
+ nuGetSourcesConfigPath: parameters.nuGetSourcesConfigPath,
1452
+ logLevel: parameters.logLevel,
1453
+ skipAnalyze: parameters.validateOptions.skipAnalyze,
1454
+ skipValidate: parameters.validateOptions.skipValidate,
1455
+ detailedLogPath: parameters.detailedLogPath,
1456
+ policyFilePath: parameters.validateOptions.governanceFilePath,
1457
+ policyFileType: parameters.validateOptions.governanceFileType,
1458
+ outputPath: parameters.outputPath,
1459
+ outputType: undefined,
1460
+ projectType: project.type,
1461
+ package: packageInfo,
1462
+ skipDependencyOptimization: parameters.packOptions?.skipDependencyOptimization ?? false,
1463
+ includeSources: parameters.packOptions?.includeSources ?? false,
1464
+ splitPackages: parameters.packOptions?.splitPackages ?? false
1465
+ };
1466
+ }
341
1467
  }
1468
+
1469
+ // src/services/project-pack-options-validator.ts
342
1470
  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);
1471
+ async validateAsync(options, cancellationToken) {
1472
+ const destinationResult = this.validateDestinationPath(options.destinationPath);
1473
+ if (!destinationResult.isSuccess) {
1474
+ return destinationResult;
347
1475
  }
1476
+ return await super.validateAsync(options, cancellationToken);
1477
+ }
348
1478
  }
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
- }
1479
+
1480
+ // src/services/project-tool-executor.ts
1481
+ import {
1482
+ ToolErrorCodes as ToolErrorCodes2,
1483
+ ToolResult as ToolResult2
1484
+ } from "@uipath/solutionpackager-tool-core";
359
1485
  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));
1486
+ toolsFactory;
1487
+ telemetry;
1488
+ packageSignService;
1489
+ constructor(toolsFactory, telemetry, packageSignService) {
1490
+ this.toolsFactory = toolsFactory;
1491
+ this.telemetry = telemetry;
1492
+ this.packageSignService = packageSignService;
1493
+ }
1494
+ async restoreAsync(options, project, context, cancellationToken) {
1495
+ return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Restore" /* ProjectToolRestore */, project.Type, async () => tool.restoreAsync(options, cancellationToken), {
1496
+ projectId: project.Id,
1497
+ projectType: project.Type
1498
+ }));
1499
+ }
1500
+ async validateAsync(options, project, context, cancellationToken) {
1501
+ return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Validate" /* ProjectToolValidate */, project.Type, async () => tool.validateAsync(options, cancellationToken), {
1502
+ projectId: project.Id,
1503
+ projectType: project.Type
1504
+ }));
1505
+ }
1506
+ async buildAsync(options, project, context, cancellationToken) {
1507
+ return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Build" /* ProjectToolBuild */, project.Type, async () => tool.buildAsync(options, cancellationToken), {
1508
+ projectId: project.Id,
1509
+ projectType: project.Type
1510
+ }));
1511
+ }
1512
+ async packAsync(options, project, context, signingInfo, cancellationToken) {
1513
+ return await this.executeToolOperationAsync(project, context, async (tool) => {
1514
+ const result = await this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Pack" /* ProjectToolPack */, project.Type, async () => {
1515
+ return await tool.packAsync(options, cancellationToken);
1516
+ }, {
1517
+ projectId: project.Id,
1518
+ projectType: project.Type
1519
+ });
1520
+ if (result.isSuccess && signingInfo?.certificatePath && result.packages.length > 0) {
1521
+ const signResult = await this.signPackagesAsync(result.packages, signingInfo);
1522
+ if (!signResult.isSuccess) {
1523
+ return signResult;
1524
+ }
1525
+ }
1526
+ return result;
1527
+ });
1528
+ }
1529
+ async executeToolOperationAsync(project, context, operation) {
1530
+ try {
1531
+ const tool = await this.toolsFactory.createProjectToolAsync(project, context);
1532
+ try {
1533
+ return await operation(tool);
1534
+ } finally {
1535
+ const disposeResult = tool.dispose();
1536
+ if (disposeResult instanceof Promise) {
1537
+ await disposeResult;
402
1538
  }
1539
+ }
1540
+ } catch (error) {
1541
+ return ToolResult2.error(ToolErrorCodes2.InternalError, error instanceof Error ? error.message : String(error));
403
1542
  }
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;
1543
+ }
1544
+ async signPackagesAsync(packages, signingInfo) {
1545
+ if (!this.packageSignService) {
1546
+ 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
1547
  }
420
- }
421
- class ProjectValidateOptionsValidator extends PackagerParametersValidator {
422
- async validateAsync(options, _cancellationToken) {
423
- return await this.validateGovernanceOptions(options.validateOptions);
1548
+ const certificatePath = signingInfo.certificatePath;
1549
+ const signResults = await Promise.all(packages.map((packagePath) => this.packageSignService?.signPackageAsync(packagePath, certificatePath, signingInfo.certificatePassword, signingInfo.timestampServer)));
1550
+ const failedResult = signResults.find((result) => result && !result.isSuccess);
1551
+ if (failedResult) {
1552
+ return failedResult;
424
1553
  }
1554
+ return ToolResult2.success();
1555
+ }
425
1556
  }
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;
1557
+
1558
+ // src/services/project-validate-options-validator.ts
1559
+ class ProjectValidateOptionsValidator extends PackagerParametersValidator {
1560
+ async validateAsync(options, _cancellationToken) {
1561
+ return await this.validateGovernanceOptions(options.validateOptions);
1562
+ }
455
1563
  }
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);
1564
+
1565
+ // src/services/tools-factory.ts
1566
+ class ToolsFactory {
1567
+ repository;
1568
+ fileSystem;
1569
+ constructor(repository, fileSystem) {
1570
+ this.repository = repository;
1571
+ this.fileSystem = fileSystem;
1572
+ }
1573
+ async createSolutionToolAsync(solutionName) {
1574
+ const logger = new ToolLogger("ResourceBuilder", solutionName);
1575
+ const factory = this.repository.getSolutionToolFactory();
1576
+ return await factory.createAsync(logger, this.fileSystem);
1577
+ }
1578
+ async createProjectToolAsync(project, context) {
1579
+ const sourceTarget = getSourceTarget();
1580
+ const logger = new ToolLogger(project.Type, sourceTarget);
1581
+ if (!project.ProjectPath) {
1582
+ throw new Error(`Project path not set for project: ${project.Id}`);
480
1583
  }
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);
1584
+ const factory = this.repository.getProjectToolFactory(project.Type);
1585
+ return await factory.createAsync(logger, this.fileSystem, context);
1586
+ function getSourceTarget() {
1587
+ const segments = project.ProjectRelativePath.split(/[/\\]/);
1588
+ if (segments.length > 1) {
1589
+ return segments[0];
1590
+ }
1591
+ return project.Id;
488
1592
  }
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);
1593
+ }
1594
+ }
1595
+
1596
+ // src/services/project-packager.ts
1597
+ class ProjectPackager {
1598
+ fileSystem;
1599
+ telemetryService;
1600
+ packageSignService;
1601
+ repository;
1602
+ temporaryStorage;
1603
+ zipService;
1604
+ logger;
1605
+ optionsBuilder;
1606
+ toolsFactory;
1607
+ projectExecutor;
1608
+ projectLoader;
1609
+ validateOptionsValidator;
1610
+ buildOptionsValidator;
1611
+ packOptionsValidator;
1612
+ nugetPackager;
1613
+ governancePolicyService;
1614
+ constructor(fileSystem, telemetryService, packageSignService) {
1615
+ this.fileSystem = fileSystem;
1616
+ this.telemetryService = telemetryService;
1617
+ this.packageSignService = packageSignService;
1618
+ this.repository = defaultToolsFactoryRepository;
1619
+ this.temporaryStorage = new TemporaryStorageService(this.fileSystem);
1620
+ this.zipService = new ZipService(this.fileSystem);
1621
+ this.nugetPackager = new NugetPackager(this.fileSystem);
1622
+ this.logger = new ToolLogger("ProjectPackager", "PackProject");
1623
+ this.validateOptionsValidator = new ProjectValidateOptionsValidator(this.logger, this.fileSystem);
1624
+ this.buildOptionsValidator = new ProjectBuildOptionsValidator(this.logger, this.fileSystem);
1625
+ this.packOptionsValidator = new ProjectPackOptionsValidator(this.logger, this.fileSystem);
1626
+ const packService = new PackService;
1627
+ this.optionsBuilder = new ProjectPackOptionsBuilder(packService, this.fileSystem);
1628
+ this.toolsFactory = new ToolsFactory(this.repository, this.fileSystem);
1629
+ this.projectExecutor = new ProjectToolExecutor(this.toolsFactory, this.telemetryService, this.packageSignService);
1630
+ this.projectLoader = new ProjectLoader(this.fileSystem);
1631
+ this.governancePolicyService = new GovernancePolicyService(this.fileSystem, this.temporaryStorage);
1632
+ }
1633
+ async canPackProjectAsync(projectPath) {
1634
+ const project = await this.projectLoader.loadProject(projectPath);
1635
+ return this.repository.canHandleProject(project.type);
1636
+ }
1637
+ async setupAsync(input, operationId) {
1638
+ this.telemetryService.setOperationId(operationId);
1639
+ await this.temporaryStorage.cleanup();
1640
+ if (typeof input === "string") {
1641
+ return input;
496
1642
  }
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);
1643
+ const inputPath = await this.temporaryStorage.getTempSubfolderPathAsync("input");
1644
+ await this.zipService.extractAsync(input, inputPath);
1645
+ const entries = await this.fileSystem.readdir(inputPath);
1646
+ if (entries.length === 1) {
1647
+ const innerPath = Path3.join(inputPath, entries[0]);
1648
+ const stat = await this.fileSystem.stat(innerPath);
1649
+ if (stat?.isDirectory()) {
1650
+ return innerPath;
1651
+ }
504
1652
  }
505
- logMessage(message) {
506
- globalLogHandler(message);
1653
+ return inputPath;
1654
+ }
1655
+ async restoreProjectAsync(options, cancellationToken) {
1656
+ return await this.executeProjectOperationAsync(options, "Restore", "ProjectPackager.Restore" /* ProjectPackagerRestore */, async (uiPathProject, loadedProject) => {
1657
+ const restoreOptions = {
1658
+ projectPath: loadedProject.projectPath,
1659
+ excludeConfiguredSources: options.excludeConfiguredSources ?? false,
1660
+ nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
1661
+ logLevel: options.logLevel,
1662
+ outputPath: options.outputPath
1663
+ };
1664
+ return await this.projectExecutor.restoreAsync(restoreOptions, uiPathProject, undefined, cancellationToken);
1665
+ }, cancellationToken);
1666
+ }
1667
+ async validateProjectAsync(options, cancellationToken) {
1668
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
1669
+ const validationResult = await this.validateOptionsValidator.validateAsync(options, cancellationToken);
1670
+ if (!validationResult.isSuccess) {
1671
+ return validationResult;
507
1672
  }
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;
1673
+ return await this.executeProjectOperationAsync(options, "Validate", "ProjectPackager.Validate" /* ProjectPackagerValidate */, async (uiPathProject, loadedProject) => {
1674
+ const validateOptions = {
1675
+ projectPath: loadedProject.projectPath,
1676
+ excludeConfiguredSources: options.excludeConfiguredSources ?? false,
1677
+ nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
1678
+ logLevel: options.logLevel,
1679
+ skipAnalyze: options.validateOptions.skipAnalyze,
1680
+ skipValidate: options.validateOptions.skipValidate,
1681
+ defaultSeverity: options.validateOptions.defaultSeverity,
1682
+ detailedLogPath: options.detailedLogPath,
1683
+ policyFilePath: options.validateOptions.governanceFilePath,
1684
+ policyFileType: options.validateOptions.governanceFileType
1685
+ };
1686
+ const context = this.createOperationContext(options, uiPathProject);
1687
+ return await this.projectExecutor.validateAsync(validateOptions, uiPathProject, context, cancellationToken);
1688
+ }, cancellationToken);
1689
+ }
1690
+ async buildProjectAsync(options, cancellationToken) {
1691
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
1692
+ const validationResult = await this.buildOptionsValidator.validateAsync(options, cancellationToken);
1693
+ if (!validationResult.isSuccess) {
1694
+ return validationResult;
513
1695
  }
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;
1696
+ return await this.executeProjectOperationAsync(options, "Build", "ProjectPackager.Build" /* ProjectPackagerBuild */, async (uiPathProject, loadedProject) => {
1697
+ if (!options.outputPath) {
1698
+ options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
1699
+ }
1700
+ const buildOptions = {
1701
+ projectPath: loadedProject.projectPath,
1702
+ excludeConfiguredSources: options.excludeConfiguredSources ?? false,
1703
+ nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
1704
+ logLevel: options.logLevel,
1705
+ skipAnalyze: options.validateOptions.skipAnalyze,
1706
+ skipValidate: options.validateOptions.skipValidate,
1707
+ detailedLogPath: options.detailedLogPath,
1708
+ policyFilePath: options.validateOptions.governanceFilePath,
1709
+ policyFileType: options.validateOptions.governanceFileType,
1710
+ outputPath: options.outputPath,
1711
+ outputType: undefined,
1712
+ projectType: uiPathProject.Type
1713
+ };
1714
+ return await this.projectExecutor.buildAsync(buildOptions, uiPathProject, undefined, cancellationToken);
1715
+ }, cancellationToken);
1716
+ }
1717
+ async packProjectAsync(options, cancellationToken) {
1718
+ return await this.telemetryService.trackRequest("ProjectPackager.Pack" /* ProjectPackagerPack */, async () => {
1719
+ try {
1720
+ await this.governancePolicyService.resolveGovernancePolicyAsync(options.validateOptions, options.connection, cancellationToken);
1721
+ let result = await this.packOptionsValidator.validateAsync(options, cancellationToken);
1722
+ if (!result.isSuccess) {
1723
+ return result;
541
1724
  }
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
1725
+ if (!options.outputPath) {
1726
+ options.outputPath = await this.temporaryStorage.getTempSubfolderPathAsync("output");
1727
+ }
1728
+ const loadedProject = await this.projectLoader.loadProject(options.inputPath);
1729
+ this.telemetryService.trackEvent("ProjectPackager.ProjectLoaded" /* ProjectPackagerProjectLoaded */, { projectId: loadedProject.name });
1730
+ const projectPackOptions = await this.optionsBuilder.buildProjectPackOptions(options, loadedProject);
1731
+ const uiPathProject = {
1732
+ Type: loadedProject.type,
1733
+ ProjectRelativePath: Path3.basename(loadedProject.projectFilePath),
1734
+ ProjectPath: loadedProject.projectPath,
1735
+ Id: loadedProject.name
1736
+ };
1737
+ const context = this.createOperationContext(options, uiPathProject);
1738
+ result = await this.projectExecutor.packAsync(projectPackOptions, uiPathProject, context, options.signingInfo, cancellationToken);
1739
+ if (result.isSuccess && result.packages.length > 0) {
1740
+ const destinationPackages = await this.copyPackagesToDestination(result.packages, options.destinationPath, projectPackOptions.package);
1741
+ result = new ToolResult3(ToolErrorCodes3.Success, undefined, destinationPackages);
1742
+ }
1743
+ if (result.isSuccess) {
1744
+ this.logger.info(`Project pack completed successfully. Packages: ${result.packages.join(", ")}`);
1745
+ } else {
1746
+ this.logger.error(`Project pack failed with error code ${result.errorCode}: ${result.message}`);
1747
+ }
1748
+ return result;
1749
+ } catch (error) {
1750
+ const errorMessage2 = error instanceof Error ? error.message : String(error);
1751
+ this.logger.error(`Processing error: ${errorMessage2}`);
1752
+ return ToolResult3.error(ToolErrorCodes3.InternalError, `Project pack failed: ${errorMessage2}`);
1753
+ } finally {
1754
+ await this.temporaryStorage.cleanup();
1755
+ }
556
1756
  });
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);
1757
+ }
1758
+ async getPackageStreamsAsync(result) {
1759
+ if (!result.isSuccess) {
1760
+ throw new Error(translate4.t("solutionpackager.packager.errors.failedToGetStreams", {
1761
+ errorCode: result.errorCode,
1762
+ message: result.message ?? ""
1763
+ }));
564
1764
  }
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
- });
1765
+ if (!result.packages || result.packages.length === 0) {
1766
+ return [];
664
1767
  }
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 ?? ""
1768
+ const packageStreams = [];
1769
+ for (const packagePath of result.packages) {
1770
+ const data = await this.fileSystem.readFile(packagePath);
1771
+ if (!data) {
1772
+ throw new Error(translate4.t("solutionpackager.packager.errors.failedToReadPackage", {
1773
+ path: packagePath
669
1774
  }));
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
- });
1775
+ }
1776
+ const name = packagePath.split(/[\\/]/).pop() || packagePath;
1777
+ packageStreams.push({ name, data });
1778
+ }
1779
+ return packageStreams;
1780
+ }
1781
+ async executeProjectOperationAsync(options, operationName, telemetryName, operation, _cancellationToken) {
1782
+ return await this.telemetryService.trackRequest(telemetryName, async () => {
1783
+ try {
1784
+ const loadedProject = await this.projectLoader.loadProject(options.inputPath);
1785
+ const uiPathProject = {
1786
+ Type: loadedProject.type,
1787
+ ProjectRelativePath: Path3.basename(loadedProject.projectFilePath),
1788
+ ProjectPath: loadedProject.projectPath,
1789
+ Id: loadedProject.name
1790
+ };
1791
+ const operationResult = await operation(uiPathProject, loadedProject);
1792
+ if (operationResult.isSuccess) {
1793
+ this.logger.info(`Project ${operationName.toLowerCase()} completed successfully.`);
1794
+ } else {
1795
+ this.logger.error(`Project ${operationName.toLowerCase()} failed with error code ${operationResult.errorCode}: ${operationResult.message}`);
682
1796
  }
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
- });
1797
+ return operationResult;
1798
+ } catch (error) {
1799
+ const errorMessage2 = error instanceof Error ? error.message : String(error);
1800
+ this.logger.error(`Processing error: ${errorMessage2}`);
1801
+ return ToolResult3.error(ToolErrorCodes3.InternalError, `Project ${operationName.toLowerCase()} failed: ${errorMessage2}`);
1802
+ } finally {
1803
+ await this.temporaryStorage.cleanup();
1804
+ }
1805
+ });
1806
+ }
1807
+ createOperationContext(options, uiPathProject) {
1808
+ return {
1809
+ id: crypto.randomUUID(),
1810
+ projects: [uiPathProject],
1811
+ downloadUrl: options.downloadUrl,
1812
+ targetFramework: options.targetFramework ?? TargetFramework.Portable,
1813
+ connection: options.connection,
1814
+ logger: this.logger,
1815
+ workflowCompilerVersion: options.workflowCompilerVersion
1816
+ };
1817
+ }
1818
+ async findNupkgInParentDir(packagePath) {
1819
+ const dirName = Path3.basename(packagePath);
1820
+ const parentDir = Path3.dirname(packagePath);
1821
+ const parentFiles = await this.fileSystem.readdir(parentDir);
1822
+ const matchingFiles = parentFiles.filter((f) => f.endsWith(".nupkg") && f.startsWith(`${dirName}.`));
1823
+ return { dir: parentDir, files: matchingFiles };
1824
+ }
1825
+ async copyFileToDestination(sourcePath, destinationPath) {
1826
+ const fileName = Path3.basename(sourcePath);
1827
+ const destPath = Path3.join(destinationPath, fileName);
1828
+ const data = await this.fileSystem.readFile(sourcePath);
1829
+ if (!data) {
1830
+ throw new Error(translate4.t("solutionpackager.packager.errors.failedToReadPackage", { path: sourcePath }));
707
1831
  }
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);
1832
+ await this.fileSystem.writeFile(destPath, data);
1833
+ return destPath;
1834
+ }
1835
+ async copyPackagesToDestination(packagePaths, destinationPath, packageInfo) {
1836
+ await this.fileSystem.mkdir(destinationPath);
1837
+ const destinationPackages = [];
1838
+ for (const packagePath of packagePaths) {
1839
+ const stat = await this.fileSystem.stat(packagePath);
1840
+ if (stat?.isDirectory()) {
1841
+ const files = await this.fileSystem.readdir(packagePath);
1842
+ const nupkgFiles = files.filter((f) => f.endsWith(".nupkg"));
1843
+ if (nupkgFiles.length > 0) {
1844
+ for (const nupkgFile of nupkgFiles) {
1845
+ const filePath = Path3.join(packagePath, nupkgFile);
1846
+ const dest = await this.copyFileToDestination(filePath, destinationPath);
1847
+ destinationPackages.push(dest);
1848
+ }
1849
+ } else {
1850
+ const parent = await this.findNupkgInParentDir(packagePath);
1851
+ if (parent.files.length > 0) {
1852
+ for (const nupkgFile of parent.files) {
1853
+ const filePath = Path3.join(parent.dir, nupkgFile);
1854
+ const dest = await this.copyFileToDestination(filePath, destinationPath);
1855
+ destinationPackages.push(dest);
741
1856
  }
1857
+ } else {
1858
+ const nupkgFileName = `${packageInfo.id}.${packageInfo.version}.nupkg`;
1859
+ const destPath = Path3.join(destinationPath, nupkgFileName);
1860
+ const packResult = await this.nugetPackager.packAsync(packagePath, packageInfo, destPath);
1861
+ destinationPackages.push(packResult.outputPath);
1862
+ }
742
1863
  }
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);
1864
+ } else {
1865
+ const dest = await this.copyFileToDestination(packagePath, destinationPath);
1866
+ destinationPackages.push(dest);
1867
+ }
777
1868
  }
1869
+ return destinationPackages;
1870
+ }
778
1871
  }
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
1872
+ export {
1873
+ setGlobalLogHandler,
1874
+ ToolsFactory,
1875
+ ToolLogger,
1876
+ TelemetryService,
1877
+ TelemetryNames,
1878
+ RulesConfigFileType,
1879
+ ProjectValidateOptionsValidator,
1880
+ ProjectValidateOptions,
1881
+ ProjectToolExecutor,
1882
+ ProjectRestoreOptions,
1883
+ ProjectPackager,
1884
+ ProjectPackOptions,
1885
+ ProjectLoader,
1886
+ ProjectBuildOptionsValidator,
1887
+ ProjectBuildOptions,
1888
+ PackagerParametersValidator,
1889
+ PackagerParameters,
1890
+ PackService,
1891
+ GovernancePolicyService,
1892
+ ConsoleTelemetryProvider,
1893
+ BrowserContextStorage
1894
+ };