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