@uipath/function-tool 1.203.0-preview.203 → 1.204.0-preview.206
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/README.md +41 -3
- package/dist/index-hkrczw69.js +157 -0
- package/dist/index-pv66qwr4.js +961 -0
- package/dist/{index-1veg2sb3.js → index-z9tda729.js} +345 -209
- package/dist/{index-t0pqjb4h.js → packager-tool-4r3qztwy.js} +23 -84
- package/dist/{packager-tool-9331shqx.js → packager-tool-5s8z8be9.js} +589 -69
- package/dist/packager-tool.js +186 -1083
- package/dist/tool.js +176 -72
- package/package.json +2 -2
package/dist/packager-tool.js
CHANGED
|
@@ -4,908 +4,17 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
__require
|
|
6
6
|
} from "./packager-tool-1de529jm.js";
|
|
7
|
-
// ../packager/packager-core/src/i18n/types.ts
|
|
8
|
-
function isPluralForm(value) {
|
|
9
|
-
return typeof value === "object" && value !== null && "other" in value;
|
|
10
|
-
}
|
|
11
|
-
function selectPluralForm(forms, count) {
|
|
12
|
-
if (count === 0 && forms.zero !== undefined) {
|
|
13
|
-
return forms.zero;
|
|
14
|
-
}
|
|
15
|
-
if (count === 1 && forms.one !== undefined) {
|
|
16
|
-
return forms.one;
|
|
17
|
-
}
|
|
18
|
-
if (count === 2 && forms.two !== undefined) {
|
|
19
|
-
return forms.two;
|
|
20
|
-
}
|
|
21
|
-
if (forms.few !== undefined) {
|
|
22
|
-
const mod10 = count % 10;
|
|
23
|
-
const mod100 = count % 100;
|
|
24
|
-
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
25
|
-
return forms.few;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (forms.many !== undefined) {
|
|
29
|
-
const mod10 = count % 10;
|
|
30
|
-
const mod100 = count % 100;
|
|
31
|
-
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
32
|
-
return forms.many;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return forms.other;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ../packager/packager-core/src/i18n/i18n-manager.ts
|
|
39
|
-
class I18nManager {
|
|
40
|
-
static translations = {};
|
|
41
|
-
static currentLocale = "en";
|
|
42
|
-
static fallbackLocale = "en";
|
|
43
|
-
static registerTranslations(locale, catalog) {
|
|
44
|
-
if (!I18nManager.translations[locale]) {
|
|
45
|
-
I18nManager.translations[locale] = {};
|
|
46
|
-
}
|
|
47
|
-
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
48
|
-
}
|
|
49
|
-
static setLocale(locale) {
|
|
50
|
-
const normalized = I18nManager.normalizeLocale(locale);
|
|
51
|
-
if (I18nManager.translations[normalized]) {
|
|
52
|
-
I18nManager.currentLocale = normalized;
|
|
53
|
-
return normalized;
|
|
54
|
-
}
|
|
55
|
-
const baseLocale = normalized.split("-")[0];
|
|
56
|
-
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
57
|
-
I18nManager.currentLocale = baseLocale;
|
|
58
|
-
return baseLocale;
|
|
59
|
-
}
|
|
60
|
-
return I18nManager.currentLocale;
|
|
61
|
-
}
|
|
62
|
-
static getLocale() {
|
|
63
|
-
return I18nManager.currentLocale;
|
|
64
|
-
}
|
|
65
|
-
static setFallbackLocale(locale) {
|
|
66
|
-
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
67
|
-
}
|
|
68
|
-
static t(key, params, locale) {
|
|
69
|
-
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
70
|
-
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
71
|
-
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
72
|
-
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
73
|
-
}
|
|
74
|
-
if (value === undefined) {
|
|
75
|
-
return key;
|
|
76
|
-
}
|
|
77
|
-
if (isPluralForm(value) && params && "count" in params) {
|
|
78
|
-
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
79
|
-
value = selectPluralForm(value, count);
|
|
80
|
-
} else if (isPluralForm(value)) {
|
|
81
|
-
value = value.other;
|
|
82
|
-
}
|
|
83
|
-
if (typeof value !== "string") {
|
|
84
|
-
return key;
|
|
85
|
-
}
|
|
86
|
-
return params ? I18nManager.interpolate(value, params) : value;
|
|
87
|
-
}
|
|
88
|
-
static has(key, locale) {
|
|
89
|
-
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
90
|
-
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
91
|
-
if (value !== undefined) {
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
95
|
-
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
static getAvailableLocales() {
|
|
100
|
-
return Object.keys(I18nManager.translations);
|
|
101
|
-
}
|
|
102
|
-
static clearTranslations() {
|
|
103
|
-
I18nManager.translations = {};
|
|
104
|
-
I18nManager.currentLocale = "en";
|
|
105
|
-
}
|
|
106
|
-
static getTranslationValue(key, locale) {
|
|
107
|
-
const catalog = I18nManager.translations[locale];
|
|
108
|
-
if (!catalog) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const keys = key.split(".");
|
|
112
|
-
let value = catalog;
|
|
113
|
-
for (const k of keys) {
|
|
114
|
-
if (value && typeof value === "object" && k in value) {
|
|
115
|
-
value = value[k];
|
|
116
|
-
} else {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return value;
|
|
121
|
-
}
|
|
122
|
-
static interpolate(template, params) {
|
|
123
|
-
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
124
|
-
const value = params[key];
|
|
125
|
-
return value !== undefined ? String(value) : `{${key}}`;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
static normalizeLocale(locale) {
|
|
129
|
-
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
130
|
-
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
131
|
-
if (specialLocales.includes(normalized)) {
|
|
132
|
-
return normalized;
|
|
133
|
-
}
|
|
134
|
-
return normalized.split("-")[0];
|
|
135
|
-
}
|
|
136
|
-
static deepMerge(target, source) {
|
|
137
|
-
const result = { ...target };
|
|
138
|
-
for (const key of Object.keys(source)) {
|
|
139
|
-
const sourceValue = source[key];
|
|
140
|
-
const targetValue = result[key];
|
|
141
|
-
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
142
|
-
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
143
|
-
} else {
|
|
144
|
-
result[key] = sourceValue;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return result;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// ../packager/packager-core/src/i18n/locales/de.ts
|
|
152
|
-
var de = {
|
|
153
|
-
toolCore: {
|
|
154
|
-
errors: {
|
|
155
|
-
internal: "Internal error: {message}",
|
|
156
|
-
fileNotFound: "File not found: {path}",
|
|
157
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
158
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
159
|
-
directoryNotFound: "Directory not found: {path}",
|
|
160
|
-
invalidPath: "{path} is not a valid path",
|
|
161
|
-
operationCanceled: "Operation was canceled",
|
|
162
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
163
|
-
},
|
|
164
|
-
progress: {
|
|
165
|
-
copying: "Copying files...",
|
|
166
|
-
building: "Building project...",
|
|
167
|
-
packaging: "Creating package...",
|
|
168
|
-
validating: "Validating...",
|
|
169
|
-
analyzing: "Analyzing...",
|
|
170
|
-
restoring: "Restoring dependencies..."
|
|
171
|
-
},
|
|
172
|
-
validation: {
|
|
173
|
-
requiredField: "{field} is required",
|
|
174
|
-
invalidValue: "Invalid value for {field}",
|
|
175
|
-
pathNotFound: "Path not found: {path}",
|
|
176
|
-
fileRequired: "File is required: {path}",
|
|
177
|
-
directoryRequired: "Directory is required: {path}"
|
|
178
|
-
},
|
|
179
|
-
warnings: {
|
|
180
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
181
|
-
},
|
|
182
|
-
info: {
|
|
183
|
-
operationComplete: "Operation completed successfully",
|
|
184
|
-
filesProcessed: {
|
|
185
|
-
zero: "No files processed",
|
|
186
|
-
one: "{count} file processed",
|
|
187
|
-
other: "{count} files processed"
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
// ../packager/packager-core/src/i18n/locales/en.ts
|
|
194
|
-
var en = {
|
|
195
|
-
toolCore: {
|
|
196
|
-
errors: {
|
|
197
|
-
internal: "Internal error: {message}",
|
|
198
|
-
fileNotFound: "File not found: {path}",
|
|
199
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
200
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
201
|
-
directoryNotFound: "Directory not found: {path}",
|
|
202
|
-
invalidPath: "{path} is not a valid path",
|
|
203
|
-
operationCanceled: "Operation was canceled",
|
|
204
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
205
|
-
},
|
|
206
|
-
progress: {
|
|
207
|
-
copying: "Copying files...",
|
|
208
|
-
building: "Building project...",
|
|
209
|
-
packaging: "Creating package...",
|
|
210
|
-
validating: "Validating...",
|
|
211
|
-
analyzing: "Analyzing...",
|
|
212
|
-
restoring: "Restoring dependencies..."
|
|
213
|
-
},
|
|
214
|
-
validation: {
|
|
215
|
-
requiredField: "{field} is required",
|
|
216
|
-
invalidValue: "Invalid value for {field}",
|
|
217
|
-
pathNotFound: "Path not found: {path}",
|
|
218
|
-
fileRequired: "File is required: {path}",
|
|
219
|
-
directoryRequired: "Directory is required: {path}"
|
|
220
|
-
},
|
|
221
|
-
warnings: {
|
|
222
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
223
|
-
},
|
|
224
|
-
info: {
|
|
225
|
-
operationComplete: "Operation completed successfully",
|
|
226
|
-
filesProcessed: {
|
|
227
|
-
zero: "No files processed",
|
|
228
|
-
one: "{count} file processed",
|
|
229
|
-
other: "{count} files processed"
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// ../packager/packager-core/src/i18n/locales/es.ts
|
|
236
|
-
var es = {
|
|
237
|
-
toolCore: {
|
|
238
|
-
errors: {
|
|
239
|
-
internal: "Internal error: {message}",
|
|
240
|
-
fileNotFound: "File not found: {path}",
|
|
241
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
242
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
243
|
-
directoryNotFound: "Directory not found: {path}",
|
|
244
|
-
invalidPath: "{path} is not a valid path",
|
|
245
|
-
operationCanceled: "Operation was canceled",
|
|
246
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
247
|
-
},
|
|
248
|
-
progress: {
|
|
249
|
-
copying: "Copying files...",
|
|
250
|
-
building: "Building project...",
|
|
251
|
-
packaging: "Creating package...",
|
|
252
|
-
validating: "Validating...",
|
|
253
|
-
analyzing: "Analyzing...",
|
|
254
|
-
restoring: "Restoring dependencies..."
|
|
255
|
-
},
|
|
256
|
-
validation: {
|
|
257
|
-
requiredField: "{field} is required",
|
|
258
|
-
invalidValue: "Invalid value for {field}",
|
|
259
|
-
pathNotFound: "Path not found: {path}",
|
|
260
|
-
fileRequired: "File is required: {path}",
|
|
261
|
-
directoryRequired: "Directory is required: {path}"
|
|
262
|
-
},
|
|
263
|
-
warnings: {
|
|
264
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
265
|
-
},
|
|
266
|
-
info: {
|
|
267
|
-
operationComplete: "Operation completed successfully",
|
|
268
|
-
filesProcessed: {
|
|
269
|
-
zero: "No files processed",
|
|
270
|
-
one: "{count} file processed",
|
|
271
|
-
other: "{count} files processed"
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
// ../packager/packager-core/src/i18n/locales/es-MX.ts
|
|
278
|
-
var es_MX = {
|
|
279
|
-
toolCore: {
|
|
280
|
-
errors: {
|
|
281
|
-
internal: "Internal error: {message}",
|
|
282
|
-
fileNotFound: "File not found: {path}",
|
|
283
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
284
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
285
|
-
directoryNotFound: "Directory not found: {path}",
|
|
286
|
-
invalidPath: "{path} is not a valid path",
|
|
287
|
-
operationCanceled: "Operation was canceled",
|
|
288
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
289
|
-
},
|
|
290
|
-
progress: {
|
|
291
|
-
copying: "Copying files...",
|
|
292
|
-
building: "Building project...",
|
|
293
|
-
packaging: "Creating package...",
|
|
294
|
-
validating: "Validating...",
|
|
295
|
-
analyzing: "Analyzing...",
|
|
296
|
-
restoring: "Restoring dependencies..."
|
|
297
|
-
},
|
|
298
|
-
validation: {
|
|
299
|
-
requiredField: "{field} is required",
|
|
300
|
-
invalidValue: "Invalid value for {field}",
|
|
301
|
-
pathNotFound: "Path not found: {path}",
|
|
302
|
-
fileRequired: "File is required: {path}",
|
|
303
|
-
directoryRequired: "Directory is required: {path}"
|
|
304
|
-
},
|
|
305
|
-
warnings: {
|
|
306
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
307
|
-
},
|
|
308
|
-
info: {
|
|
309
|
-
operationComplete: "Operation completed successfully",
|
|
310
|
-
filesProcessed: {
|
|
311
|
-
zero: "No files processed",
|
|
312
|
-
one: "{count} file processed",
|
|
313
|
-
other: "{count} files processed"
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
// ../packager/packager-core/src/i18n/locales/fr.ts
|
|
320
|
-
var fr = {
|
|
321
|
-
toolCore: {
|
|
322
|
-
errors: {
|
|
323
|
-
internal: "Internal error: {message}",
|
|
324
|
-
fileNotFound: "File not found: {path}",
|
|
325
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
326
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
327
|
-
directoryNotFound: "Directory not found: {path}",
|
|
328
|
-
invalidPath: "{path} is not a valid path",
|
|
329
|
-
operationCanceled: "Operation was canceled",
|
|
330
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
331
|
-
},
|
|
332
|
-
progress: {
|
|
333
|
-
copying: "Copying files...",
|
|
334
|
-
building: "Building project...",
|
|
335
|
-
packaging: "Creating package...",
|
|
336
|
-
validating: "Validating...",
|
|
337
|
-
analyzing: "Analyzing...",
|
|
338
|
-
restoring: "Restoring dependencies..."
|
|
339
|
-
},
|
|
340
|
-
validation: {
|
|
341
|
-
requiredField: "{field} is required",
|
|
342
|
-
invalidValue: "Invalid value for {field}",
|
|
343
|
-
pathNotFound: "Path not found: {path}",
|
|
344
|
-
fileRequired: "File is required: {path}",
|
|
345
|
-
directoryRequired: "Directory is required: {path}"
|
|
346
|
-
},
|
|
347
|
-
warnings: {
|
|
348
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
349
|
-
},
|
|
350
|
-
info: {
|
|
351
|
-
operationComplete: "Operation completed successfully",
|
|
352
|
-
filesProcessed: {
|
|
353
|
-
zero: "No files processed",
|
|
354
|
-
one: "{count} file processed",
|
|
355
|
-
other: "{count} files processed"
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
// ../packager/packager-core/src/i18n/locales/ja.ts
|
|
362
|
-
var ja = {
|
|
363
|
-
toolCore: {
|
|
364
|
-
errors: {
|
|
365
|
-
internal: "Internal error: {message}",
|
|
366
|
-
fileNotFound: "File not found: {path}",
|
|
367
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
368
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
369
|
-
directoryNotFound: "Directory not found: {path}",
|
|
370
|
-
invalidPath: "{path} is not a valid path",
|
|
371
|
-
operationCanceled: "Operation was canceled",
|
|
372
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
373
|
-
},
|
|
374
|
-
progress: {
|
|
375
|
-
copying: "Copying files...",
|
|
376
|
-
building: "Building project...",
|
|
377
|
-
packaging: "Creating package...",
|
|
378
|
-
validating: "Validating...",
|
|
379
|
-
analyzing: "Analyzing...",
|
|
380
|
-
restoring: "Restoring dependencies..."
|
|
381
|
-
},
|
|
382
|
-
validation: {
|
|
383
|
-
requiredField: "{field} is required",
|
|
384
|
-
invalidValue: "Invalid value for {field}",
|
|
385
|
-
pathNotFound: "Path not found: {path}",
|
|
386
|
-
fileRequired: "File is required: {path}",
|
|
387
|
-
directoryRequired: "Directory is required: {path}"
|
|
388
|
-
},
|
|
389
|
-
warnings: {
|
|
390
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
391
|
-
},
|
|
392
|
-
info: {
|
|
393
|
-
operationComplete: "Operation completed successfully",
|
|
394
|
-
filesProcessed: {
|
|
395
|
-
zero: "No files processed",
|
|
396
|
-
one: "{count} file processed",
|
|
397
|
-
other: "{count} files processed"
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// ../packager/packager-core/src/i18n/locales/ko.ts
|
|
404
|
-
var ko = {
|
|
405
|
-
toolCore: {
|
|
406
|
-
errors: {
|
|
407
|
-
internal: "Internal error: {message}",
|
|
408
|
-
fileNotFound: "File not found: {path}",
|
|
409
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
410
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
411
|
-
directoryNotFound: "Directory not found: {path}",
|
|
412
|
-
invalidPath: "{path} is not a valid path",
|
|
413
|
-
operationCanceled: "Operation was canceled",
|
|
414
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
415
|
-
},
|
|
416
|
-
progress: {
|
|
417
|
-
copying: "Copying files...",
|
|
418
|
-
building: "Building project...",
|
|
419
|
-
packaging: "Creating package...",
|
|
420
|
-
validating: "Validating...",
|
|
421
|
-
analyzing: "Analyzing...",
|
|
422
|
-
restoring: "Restoring dependencies..."
|
|
423
|
-
},
|
|
424
|
-
validation: {
|
|
425
|
-
requiredField: "{field} is required",
|
|
426
|
-
invalidValue: "Invalid value for {field}",
|
|
427
|
-
pathNotFound: "Path not found: {path}",
|
|
428
|
-
fileRequired: "File is required: {path}",
|
|
429
|
-
directoryRequired: "Directory is required: {path}"
|
|
430
|
-
},
|
|
431
|
-
warnings: {
|
|
432
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
433
|
-
},
|
|
434
|
-
info: {
|
|
435
|
-
operationComplete: "Operation completed successfully",
|
|
436
|
-
filesProcessed: {
|
|
437
|
-
zero: "No files processed",
|
|
438
|
-
one: "{count} file processed",
|
|
439
|
-
other: "{count} files processed"
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
// ../packager/packager-core/src/i18n/locales/pt.ts
|
|
446
|
-
var pt = {
|
|
447
|
-
toolCore: {
|
|
448
|
-
errors: {
|
|
449
|
-
internal: "Internal error: {message}",
|
|
450
|
-
fileNotFound: "File not found: {path}",
|
|
451
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
452
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
453
|
-
directoryNotFound: "Directory not found: {path}",
|
|
454
|
-
invalidPath: "{path} is not a valid path",
|
|
455
|
-
operationCanceled: "Operation was canceled",
|
|
456
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
457
|
-
},
|
|
458
|
-
progress: {
|
|
459
|
-
copying: "Copying files...",
|
|
460
|
-
building: "Building project...",
|
|
461
|
-
packaging: "Creating package...",
|
|
462
|
-
validating: "Validating...",
|
|
463
|
-
analyzing: "Analyzing...",
|
|
464
|
-
restoring: "Restoring dependencies..."
|
|
465
|
-
},
|
|
466
|
-
validation: {
|
|
467
|
-
requiredField: "{field} is required",
|
|
468
|
-
invalidValue: "Invalid value for {field}",
|
|
469
|
-
pathNotFound: "Path not found: {path}",
|
|
470
|
-
fileRequired: "File is required: {path}",
|
|
471
|
-
directoryRequired: "Directory is required: {path}"
|
|
472
|
-
},
|
|
473
|
-
warnings: {
|
|
474
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
475
|
-
},
|
|
476
|
-
info: {
|
|
477
|
-
operationComplete: "Operation completed successfully",
|
|
478
|
-
filesProcessed: {
|
|
479
|
-
zero: "No files processed",
|
|
480
|
-
one: "{count} file processed",
|
|
481
|
-
other: "{count} files processed"
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
|
|
488
|
-
var pt_BR = {
|
|
489
|
-
toolCore: {
|
|
490
|
-
errors: {
|
|
491
|
-
internal: "Internal error: {message}",
|
|
492
|
-
fileNotFound: "File not found: {path}",
|
|
493
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
494
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
495
|
-
directoryNotFound: "Directory not found: {path}",
|
|
496
|
-
invalidPath: "{path} is not a valid path",
|
|
497
|
-
operationCanceled: "Operation was canceled",
|
|
498
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
499
|
-
},
|
|
500
|
-
progress: {
|
|
501
|
-
copying: "Copying files...",
|
|
502
|
-
building: "Building project...",
|
|
503
|
-
packaging: "Creating package...",
|
|
504
|
-
validating: "Validating...",
|
|
505
|
-
analyzing: "Analyzing...",
|
|
506
|
-
restoring: "Restoring dependencies..."
|
|
507
|
-
},
|
|
508
|
-
validation: {
|
|
509
|
-
requiredField: "{field} is required",
|
|
510
|
-
invalidValue: "Invalid value for {field}",
|
|
511
|
-
pathNotFound: "Path not found: {path}",
|
|
512
|
-
fileRequired: "File is required: {path}",
|
|
513
|
-
directoryRequired: "Directory is required: {path}"
|
|
514
|
-
},
|
|
515
|
-
warnings: {
|
|
516
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
517
|
-
},
|
|
518
|
-
info: {
|
|
519
|
-
operationComplete: "Operation completed successfully",
|
|
520
|
-
filesProcessed: {
|
|
521
|
-
zero: "No files processed",
|
|
522
|
-
one: "{count} file processed",
|
|
523
|
-
other: "{count} files processed"
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
// ../packager/packager-core/src/i18n/locales/ro.ts
|
|
530
|
-
var ro = {
|
|
531
|
-
toolCore: {
|
|
532
|
-
errors: {
|
|
533
|
-
internal: "Internal error: {message}",
|
|
534
|
-
fileNotFound: "File not found: {path}",
|
|
535
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
536
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
537
|
-
directoryNotFound: "Directory not found: {path}",
|
|
538
|
-
invalidPath: "{path} is not a valid path",
|
|
539
|
-
operationCanceled: "Operation was canceled",
|
|
540
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
541
|
-
},
|
|
542
|
-
progress: {
|
|
543
|
-
copying: "Copying files...",
|
|
544
|
-
building: "Building project...",
|
|
545
|
-
packaging: "Creating package...",
|
|
546
|
-
validating: "Validating...",
|
|
547
|
-
analyzing: "Analyzing...",
|
|
548
|
-
restoring: "Restoring dependencies..."
|
|
549
|
-
},
|
|
550
|
-
validation: {
|
|
551
|
-
requiredField: "{field} is required",
|
|
552
|
-
invalidValue: "Invalid value for {field}",
|
|
553
|
-
pathNotFound: "Path not found: {path}",
|
|
554
|
-
fileRequired: "File is required: {path}",
|
|
555
|
-
directoryRequired: "Directory is required: {path}"
|
|
556
|
-
},
|
|
557
|
-
warnings: {
|
|
558
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
559
|
-
},
|
|
560
|
-
info: {
|
|
561
|
-
operationComplete: "Operation completed successfully",
|
|
562
|
-
filesProcessed: {
|
|
563
|
-
zero: "No files processed",
|
|
564
|
-
one: "{count} file processed",
|
|
565
|
-
other: "{count} files processed"
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
// ../packager/packager-core/src/i18n/locales/ru.ts
|
|
572
|
-
var ru = {
|
|
573
|
-
toolCore: {
|
|
574
|
-
errors: {
|
|
575
|
-
internal: "Internal error: {message}",
|
|
576
|
-
fileNotFound: "File not found: {path}",
|
|
577
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
578
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
579
|
-
directoryNotFound: "Directory not found: {path}",
|
|
580
|
-
invalidPath: "{path} is not a valid path",
|
|
581
|
-
operationCanceled: "Operation was canceled",
|
|
582
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
583
|
-
},
|
|
584
|
-
progress: {
|
|
585
|
-
copying: "Copying files...",
|
|
586
|
-
building: "Building project...",
|
|
587
|
-
packaging: "Creating package...",
|
|
588
|
-
validating: "Validating...",
|
|
589
|
-
analyzing: "Analyzing...",
|
|
590
|
-
restoring: "Restoring dependencies..."
|
|
591
|
-
},
|
|
592
|
-
validation: {
|
|
593
|
-
requiredField: "{field} is required",
|
|
594
|
-
invalidValue: "Invalid value for {field}",
|
|
595
|
-
pathNotFound: "Path not found: {path}",
|
|
596
|
-
fileRequired: "File is required: {path}",
|
|
597
|
-
directoryRequired: "Directory is required: {path}"
|
|
598
|
-
},
|
|
599
|
-
warnings: {
|
|
600
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
601
|
-
},
|
|
602
|
-
info: {
|
|
603
|
-
operationComplete: "Operation completed successfully",
|
|
604
|
-
filesProcessed: {
|
|
605
|
-
zero: "No files processed",
|
|
606
|
-
one: "{count} file processed",
|
|
607
|
-
other: "{count} files processed"
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
// ../packager/packager-core/src/i18n/locales/tr.ts
|
|
614
|
-
var tr = {
|
|
615
|
-
toolCore: {
|
|
616
|
-
errors: {
|
|
617
|
-
internal: "Internal error: {message}",
|
|
618
|
-
fileNotFound: "File not found: {path}",
|
|
619
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
620
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
621
|
-
directoryNotFound: "Directory not found: {path}",
|
|
622
|
-
invalidPath: "{path} is not a valid path",
|
|
623
|
-
operationCanceled: "Operation was canceled",
|
|
624
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
625
|
-
},
|
|
626
|
-
progress: {
|
|
627
|
-
copying: "Copying files...",
|
|
628
|
-
building: "Building project...",
|
|
629
|
-
packaging: "Creating package...",
|
|
630
|
-
validating: "Validating...",
|
|
631
|
-
analyzing: "Analyzing...",
|
|
632
|
-
restoring: "Restoring dependencies..."
|
|
633
|
-
},
|
|
634
|
-
validation: {
|
|
635
|
-
requiredField: "{field} is required",
|
|
636
|
-
invalidValue: "Invalid value for {field}",
|
|
637
|
-
pathNotFound: "Path not found: {path}",
|
|
638
|
-
fileRequired: "File is required: {path}",
|
|
639
|
-
directoryRequired: "Directory is required: {path}"
|
|
640
|
-
},
|
|
641
|
-
warnings: {
|
|
642
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
643
|
-
},
|
|
644
|
-
info: {
|
|
645
|
-
operationComplete: "Operation completed successfully",
|
|
646
|
-
filesProcessed: {
|
|
647
|
-
zero: "No files processed",
|
|
648
|
-
one: "{count} file processed",
|
|
649
|
-
other: "{count} files processed"
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
|
|
656
|
-
var zh_CN = {
|
|
657
|
-
toolCore: {
|
|
658
|
-
errors: {
|
|
659
|
-
internal: "Internal error: {message}",
|
|
660
|
-
fileNotFound: "File not found: {path}",
|
|
661
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
662
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
663
|
-
directoryNotFound: "Directory not found: {path}",
|
|
664
|
-
invalidPath: "{path} is not a valid path",
|
|
665
|
-
operationCanceled: "Operation was canceled",
|
|
666
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
667
|
-
},
|
|
668
|
-
progress: {
|
|
669
|
-
copying: "Copying files...",
|
|
670
|
-
building: "Building project...",
|
|
671
|
-
packaging: "Creating package...",
|
|
672
|
-
validating: "Validating...",
|
|
673
|
-
analyzing: "Analyzing...",
|
|
674
|
-
restoring: "Restoring dependencies..."
|
|
675
|
-
},
|
|
676
|
-
validation: {
|
|
677
|
-
requiredField: "{field} is required",
|
|
678
|
-
invalidValue: "Invalid value for {field}",
|
|
679
|
-
pathNotFound: "Path not found: {path}",
|
|
680
|
-
fileRequired: "File is required: {path}",
|
|
681
|
-
directoryRequired: "Directory is required: {path}"
|
|
682
|
-
},
|
|
683
|
-
warnings: {
|
|
684
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
685
|
-
},
|
|
686
|
-
info: {
|
|
687
|
-
operationComplete: "Operation completed successfully",
|
|
688
|
-
filesProcessed: {
|
|
689
|
-
zero: "No files processed",
|
|
690
|
-
one: "{count} file processed",
|
|
691
|
-
other: "{count} files processed"
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
|
|
698
|
-
var zh_TW = {
|
|
699
|
-
toolCore: {
|
|
700
|
-
errors: {
|
|
701
|
-
internal: "Internal error: {message}",
|
|
702
|
-
fileNotFound: "File not found: {path}",
|
|
703
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
704
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
705
|
-
directoryNotFound: "Directory not found: {path}",
|
|
706
|
-
invalidPath: "{path} is not a valid path",
|
|
707
|
-
operationCanceled: "Operation was canceled",
|
|
708
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
709
|
-
},
|
|
710
|
-
progress: {
|
|
711
|
-
copying: "Copying files...",
|
|
712
|
-
building: "Building project...",
|
|
713
|
-
packaging: "Creating package...",
|
|
714
|
-
validating: "Validating...",
|
|
715
|
-
analyzing: "Analyzing...",
|
|
716
|
-
restoring: "Restoring dependencies..."
|
|
717
|
-
},
|
|
718
|
-
validation: {
|
|
719
|
-
requiredField: "{field} is required",
|
|
720
|
-
invalidValue: "Invalid value for {field}",
|
|
721
|
-
pathNotFound: "Path not found: {path}",
|
|
722
|
-
fileRequired: "File is required: {path}",
|
|
723
|
-
directoryRequired: "Directory is required: {path}"
|
|
724
|
-
},
|
|
725
|
-
warnings: {
|
|
726
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
727
|
-
},
|
|
728
|
-
info: {
|
|
729
|
-
operationComplete: "Operation completed successfully",
|
|
730
|
-
filesProcessed: {
|
|
731
|
-
zero: "No files processed",
|
|
732
|
-
one: "{count} file processed",
|
|
733
|
-
other: "{count} files processed"
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
// ../packager/packager-core/src/i18n/locales/zu.ts
|
|
740
|
-
var zu = {
|
|
741
|
-
toolCore: {
|
|
742
|
-
errors: {
|
|
743
|
-
internal: "Internal error: {message}",
|
|
744
|
-
fileNotFound: "File not found: {path}",
|
|
745
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
746
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
747
|
-
directoryNotFound: "Directory not found: {path}",
|
|
748
|
-
invalidPath: "{path} is not a valid path",
|
|
749
|
-
operationCanceled: "Operation was canceled",
|
|
750
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
751
|
-
},
|
|
752
|
-
progress: {
|
|
753
|
-
copying: "Copying files...",
|
|
754
|
-
building: "Building project...",
|
|
755
|
-
packaging: "Creating package...",
|
|
756
|
-
validating: "Validating...",
|
|
757
|
-
analyzing: "Analyzing...",
|
|
758
|
-
restoring: "Restoring dependencies..."
|
|
759
|
-
},
|
|
760
|
-
validation: {
|
|
761
|
-
requiredField: "{field} is required",
|
|
762
|
-
invalidValue: "Invalid value for {field}",
|
|
763
|
-
pathNotFound: "Path not found: {path}",
|
|
764
|
-
fileRequired: "File is required: {path}",
|
|
765
|
-
directoryRequired: "Directory is required: {path}"
|
|
766
|
-
},
|
|
767
|
-
warnings: {
|
|
768
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
769
|
-
},
|
|
770
|
-
info: {
|
|
771
|
-
operationComplete: "Operation completed successfully",
|
|
772
|
-
filesProcessed: {
|
|
773
|
-
zero: "No files processed",
|
|
774
|
-
one: "{count} file processed",
|
|
775
|
-
other: "{count} files processed"
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
// ../packager/packager-core/src/i18n/translation-service.ts
|
|
782
|
-
class TranslationService {
|
|
783
|
-
static instance;
|
|
784
|
-
currentLocale = "en";
|
|
785
|
-
constructor() {}
|
|
786
|
-
static getInstance() {
|
|
787
|
-
if (!TranslationService.instance) {
|
|
788
|
-
TranslationService.instance = new TranslationService;
|
|
789
|
-
}
|
|
790
|
-
return TranslationService.instance;
|
|
791
|
-
}
|
|
792
|
-
setLocale(locale) {
|
|
793
|
-
this.currentLocale = I18nManager.setLocale(locale);
|
|
794
|
-
}
|
|
795
|
-
getLocale() {
|
|
796
|
-
return this.currentLocale;
|
|
797
|
-
}
|
|
798
|
-
t(key, params) {
|
|
799
|
-
return I18nManager.t(key, params, this.currentLocale);
|
|
800
|
-
}
|
|
801
|
-
tLocale(key, locale, params) {
|
|
802
|
-
return I18nManager.t(key, params, locale);
|
|
803
|
-
}
|
|
804
|
-
has(key) {
|
|
805
|
-
return I18nManager.has(key, this.currentLocale);
|
|
806
|
-
}
|
|
807
|
-
getAvailableLocales() {
|
|
808
|
-
return I18nManager.getAvailableLocales();
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
var translate = TranslationService.getInstance();
|
|
812
7
|
|
|
813
|
-
// ../packager/packager-core/src/
|
|
814
|
-
|
|
815
|
-
I18nManager.registerTranslations("de", de);
|
|
816
|
-
I18nManager.registerTranslations("es", es);
|
|
817
|
-
I18nManager.registerTranslations("es-mx", es_MX);
|
|
818
|
-
I18nManager.registerTranslations("fr", fr);
|
|
819
|
-
I18nManager.registerTranslations("ja", ja);
|
|
820
|
-
I18nManager.registerTranslations("ko", ko);
|
|
821
|
-
I18nManager.registerTranslations("pt", pt);
|
|
822
|
-
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
823
|
-
I18nManager.registerTranslations("ro", ro);
|
|
824
|
-
I18nManager.registerTranslations("ru", ru);
|
|
825
|
-
I18nManager.registerTranslations("tr", tr);
|
|
826
|
-
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
827
|
-
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
828
|
-
I18nManager.registerTranslations("zu", zu);
|
|
829
|
-
I18nManager.setLocale("en");
|
|
830
|
-
// ../packager/packager-core/src/models/tool-result.ts
|
|
831
|
-
class ToolResult {
|
|
832
|
-
errorCode;
|
|
833
|
-
message;
|
|
834
|
-
packages;
|
|
835
|
-
details;
|
|
836
|
-
instructions;
|
|
837
|
-
constructor(errorCode, message, packages = [], instructions) {
|
|
838
|
-
this.errorCode = errorCode;
|
|
839
|
-
this.message = message;
|
|
840
|
-
this.packages = packages;
|
|
841
|
-
this.instructions = instructions;
|
|
842
|
-
}
|
|
843
|
-
get isSuccess() {
|
|
844
|
-
return this.errorCode === "SUCCESS" /* Success */;
|
|
845
|
-
}
|
|
846
|
-
static success() {
|
|
847
|
-
return new ToolResult("SUCCESS" /* Success */);
|
|
848
|
-
}
|
|
849
|
-
static error(errorCode, message, instructions) {
|
|
850
|
-
return new ToolResult(errorCode, message, [], instructions);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
854
|
-
class ToolsFactoryRepository {
|
|
855
|
-
projectFactoryMap = new Map;
|
|
856
|
-
solutionFactory = null;
|
|
857
|
-
registerProjectToolFactory(factory) {
|
|
858
|
-
for (const type of factory.supportedTypes) {
|
|
859
|
-
const existing = this.projectFactoryMap.get(type);
|
|
860
|
-
if (existing) {
|
|
861
|
-
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
862
|
-
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
863
|
-
}
|
|
864
|
-
continue;
|
|
865
|
-
}
|
|
866
|
-
this.projectFactoryMap.set(type, factory);
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
registerSolutionToolFactory(factory) {
|
|
870
|
-
this.solutionFactory = factory;
|
|
871
|
-
}
|
|
872
|
-
getSolutionToolFactory() {
|
|
873
|
-
if (!this.solutionFactory) {
|
|
874
|
-
throw new Error("No solution tool factory is registered");
|
|
875
|
-
}
|
|
876
|
-
return this.solutionFactory;
|
|
877
|
-
}
|
|
878
|
-
canHandleProject(projectType) {
|
|
879
|
-
return this.projectFactoryMap.has(projectType);
|
|
880
|
-
}
|
|
881
|
-
getProjectToolFactory(projectType) {
|
|
882
|
-
const factory = this.projectFactoryMap.get(projectType);
|
|
883
|
-
if (!factory) {
|
|
884
|
-
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
|
|
885
|
-
}
|
|
886
|
-
return factory;
|
|
887
|
-
}
|
|
888
|
-
reset() {
|
|
889
|
-
this.projectFactoryMap.clear();
|
|
890
|
-
this.solutionFactory = null;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
894
|
-
var _global = globalThis;
|
|
895
|
-
if (!_global[REGISTRY_KEY]) {
|
|
896
|
-
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
897
|
-
}
|
|
898
|
-
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
899
|
-
// ../packager/packager-core/dist/index.js
|
|
900
|
-
class Path2 {
|
|
8
|
+
// ../packager/packager-core/src/filesystem/path.ts
|
|
9
|
+
class Path {
|
|
901
10
|
static normalize(path) {
|
|
902
11
|
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
903
12
|
}
|
|
904
13
|
static join(...segments) {
|
|
905
|
-
return
|
|
14
|
+
return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
|
|
906
15
|
}
|
|
907
16
|
static dirname(path) {
|
|
908
|
-
const normalized =
|
|
17
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
909
18
|
if (normalized === "")
|
|
910
19
|
return ".";
|
|
911
20
|
const lastSlash = normalized.lastIndexOf("/");
|
|
@@ -916,14 +25,14 @@ class Path2 {
|
|
|
916
25
|
return normalized.substring(0, lastSlash);
|
|
917
26
|
}
|
|
918
27
|
static basename(path) {
|
|
919
|
-
const normalized =
|
|
28
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
920
29
|
if (normalized === "")
|
|
921
30
|
return "";
|
|
922
31
|
const lastSlash = normalized.lastIndexOf("/");
|
|
923
32
|
return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
|
|
924
33
|
}
|
|
925
34
|
static extname(path) {
|
|
926
|
-
const base =
|
|
35
|
+
const base = Path.basename(path);
|
|
927
36
|
const lastDot = base.lastIndexOf(".");
|
|
928
37
|
if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
|
|
929
38
|
return "";
|
|
@@ -932,27 +41,27 @@ class Path2 {
|
|
|
932
41
|
}
|
|
933
42
|
static async walkDirectory(fs, rootPath, currentRelativePath = "") {
|
|
934
43
|
const entries = [];
|
|
935
|
-
const absolutePath = currentRelativePath ?
|
|
44
|
+
const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
|
|
936
45
|
const items = await fs.readdir(absolutePath);
|
|
937
46
|
for (const item of items) {
|
|
938
|
-
const itemRelativePath = currentRelativePath ?
|
|
939
|
-
const itemAbsolutePath =
|
|
47
|
+
const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
|
|
48
|
+
const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
|
|
940
49
|
const stat = await fs.stat(itemAbsolutePath);
|
|
941
50
|
if (stat?.isDirectory()) {
|
|
942
|
-
const subEntries = await
|
|
51
|
+
const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
|
|
943
52
|
entries.push(...subEntries);
|
|
944
53
|
} else if (stat?.isFile()) {
|
|
945
54
|
entries.push({
|
|
946
|
-
relativePath:
|
|
947
|
-
absolutePath:
|
|
55
|
+
relativePath: Path.normalize(itemRelativePath),
|
|
56
|
+
absolutePath: Path.normalize(itemAbsolutePath)
|
|
948
57
|
});
|
|
949
58
|
}
|
|
950
59
|
}
|
|
951
60
|
return entries;
|
|
952
61
|
}
|
|
953
62
|
}
|
|
954
|
-
|
|
955
|
-
class
|
|
63
|
+
// ../packager/packager-core/src/filesystem/temporary-storage-service.ts
|
|
64
|
+
class TemporaryStorageService {
|
|
956
65
|
fileSystem;
|
|
957
66
|
_tempFolderPath = null;
|
|
958
67
|
constructor(fileSystem) {
|
|
@@ -962,7 +71,7 @@ class TemporaryStorageService2 {
|
|
|
962
71
|
if (!this._tempFolderPath) {
|
|
963
72
|
const systemTempDir = await this.fileSystem.getTempDir();
|
|
964
73
|
const uniqueFolderName = this.generateUniqueFolderName();
|
|
965
|
-
this._tempFolderPath =
|
|
74
|
+
this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
|
|
966
75
|
await this.fileSystem.mkdir(this._tempFolderPath);
|
|
967
76
|
}
|
|
968
77
|
return this._tempFolderPath;
|
|
@@ -974,7 +83,7 @@ class TemporaryStorageService2 {
|
|
|
974
83
|
}
|
|
975
84
|
async getTempSubfolderPathAsync(subfolder) {
|
|
976
85
|
const tempFolderPath = await this.getTempFolderPath();
|
|
977
|
-
const inputPath =
|
|
86
|
+
const inputPath = Path.join(tempFolderPath, subfolder);
|
|
978
87
|
await this.fileSystem.mkdir(inputPath);
|
|
979
88
|
return inputPath;
|
|
980
89
|
}
|
|
@@ -997,10 +106,11 @@ class TemporaryStorageService2 {
|
|
|
997
106
|
} catch {}
|
|
998
107
|
}
|
|
999
108
|
}
|
|
1000
|
-
|
|
109
|
+
// ../packager/packager-core/src/i18n/types.ts
|
|
110
|
+
function isPluralForm(value) {
|
|
1001
111
|
return typeof value === "object" && value !== null && "other" in value;
|
|
1002
112
|
}
|
|
1003
|
-
function
|
|
113
|
+
function selectPluralForm(forms, count) {
|
|
1004
114
|
if (count === 0 && forms.zero !== undefined) {
|
|
1005
115
|
return forms.zero;
|
|
1006
116
|
}
|
|
@@ -1027,75 +137,76 @@ function selectPluralForm2(forms, count) {
|
|
|
1027
137
|
return forms.other;
|
|
1028
138
|
}
|
|
1029
139
|
|
|
1030
|
-
|
|
140
|
+
// ../packager/packager-core/src/i18n/i18n-manager.ts
|
|
141
|
+
class I18nManager {
|
|
1031
142
|
static translations = {};
|
|
1032
143
|
static currentLocale = "en";
|
|
1033
144
|
static fallbackLocale = "en";
|
|
1034
145
|
static registerTranslations(locale, catalog) {
|
|
1035
|
-
if (!
|
|
1036
|
-
|
|
146
|
+
if (!I18nManager.translations[locale]) {
|
|
147
|
+
I18nManager.translations[locale] = {};
|
|
1037
148
|
}
|
|
1038
|
-
|
|
149
|
+
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
1039
150
|
}
|
|
1040
151
|
static setLocale(locale) {
|
|
1041
|
-
const normalized =
|
|
1042
|
-
if (
|
|
1043
|
-
|
|
152
|
+
const normalized = I18nManager.normalizeLocale(locale);
|
|
153
|
+
if (I18nManager.translations[normalized]) {
|
|
154
|
+
I18nManager.currentLocale = normalized;
|
|
1044
155
|
return normalized;
|
|
1045
156
|
}
|
|
1046
157
|
const baseLocale = normalized.split("-")[0];
|
|
1047
|
-
if (baseLocale !== normalized &&
|
|
1048
|
-
|
|
158
|
+
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
159
|
+
I18nManager.currentLocale = baseLocale;
|
|
1049
160
|
return baseLocale;
|
|
1050
161
|
}
|
|
1051
|
-
return
|
|
162
|
+
return I18nManager.currentLocale;
|
|
1052
163
|
}
|
|
1053
164
|
static getLocale() {
|
|
1054
|
-
return
|
|
165
|
+
return I18nManager.currentLocale;
|
|
1055
166
|
}
|
|
1056
167
|
static setFallbackLocale(locale) {
|
|
1057
|
-
|
|
168
|
+
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
1058
169
|
}
|
|
1059
170
|
static t(key, params, locale) {
|
|
1060
|
-
const targetLocale = locale ?
|
|
1061
|
-
let value =
|
|
1062
|
-
if (value === undefined && targetLocale !==
|
|
1063
|
-
value =
|
|
171
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
172
|
+
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
173
|
+
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
174
|
+
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
1064
175
|
}
|
|
1065
176
|
if (value === undefined) {
|
|
1066
177
|
return key;
|
|
1067
178
|
}
|
|
1068
|
-
if (
|
|
179
|
+
if (isPluralForm(value) && params && "count" in params) {
|
|
1069
180
|
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
1070
|
-
value =
|
|
1071
|
-
} else if (
|
|
181
|
+
value = selectPluralForm(value, count);
|
|
182
|
+
} else if (isPluralForm(value)) {
|
|
1072
183
|
value = value.other;
|
|
1073
184
|
}
|
|
1074
185
|
if (typeof value !== "string") {
|
|
1075
186
|
return key;
|
|
1076
187
|
}
|
|
1077
|
-
return params ?
|
|
188
|
+
return params ? I18nManager.interpolate(value, params) : value;
|
|
1078
189
|
}
|
|
1079
190
|
static has(key, locale) {
|
|
1080
|
-
const targetLocale = locale ?
|
|
1081
|
-
const value =
|
|
191
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
192
|
+
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
1082
193
|
if (value !== undefined) {
|
|
1083
194
|
return true;
|
|
1084
195
|
}
|
|
1085
|
-
if (targetLocale !==
|
|
1086
|
-
return
|
|
196
|
+
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
197
|
+
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
1087
198
|
}
|
|
1088
199
|
return false;
|
|
1089
200
|
}
|
|
1090
201
|
static getAvailableLocales() {
|
|
1091
|
-
return Object.keys(
|
|
202
|
+
return Object.keys(I18nManager.translations);
|
|
1092
203
|
}
|
|
1093
204
|
static clearTranslations() {
|
|
1094
|
-
|
|
1095
|
-
|
|
205
|
+
I18nManager.translations = {};
|
|
206
|
+
I18nManager.currentLocale = "en";
|
|
1096
207
|
}
|
|
1097
208
|
static getTranslationValue(key, locale) {
|
|
1098
|
-
const catalog =
|
|
209
|
+
const catalog = I18nManager.translations[locale];
|
|
1099
210
|
if (!catalog) {
|
|
1100
211
|
return;
|
|
1101
212
|
}
|
|
@@ -1130,7 +241,7 @@ class I18nManager2 {
|
|
|
1130
241
|
const sourceValue = source[key];
|
|
1131
242
|
const targetValue = result[key];
|
|
1132
243
|
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
1133
|
-
result[key] =
|
|
244
|
+
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
1134
245
|
} else {
|
|
1135
246
|
result[key] = sourceValue;
|
|
1136
247
|
}
|
|
@@ -1138,7 +249,9 @@ class I18nManager2 {
|
|
|
1138
249
|
return result;
|
|
1139
250
|
}
|
|
1140
251
|
}
|
|
1141
|
-
|
|
252
|
+
|
|
253
|
+
// ../packager/packager-core/src/i18n/locales/de.ts
|
|
254
|
+
var de = {
|
|
1142
255
|
toolCore: {
|
|
1143
256
|
errors: {
|
|
1144
257
|
internal: "Internal error: {message}",
|
|
@@ -1178,7 +291,9 @@ var de2 = {
|
|
|
1178
291
|
}
|
|
1179
292
|
}
|
|
1180
293
|
};
|
|
1181
|
-
|
|
294
|
+
|
|
295
|
+
// ../packager/packager-core/src/i18n/locales/en.ts
|
|
296
|
+
var en = {
|
|
1182
297
|
toolCore: {
|
|
1183
298
|
errors: {
|
|
1184
299
|
internal: "Internal error: {message}",
|
|
@@ -1218,7 +333,9 @@ var en2 = {
|
|
|
1218
333
|
}
|
|
1219
334
|
}
|
|
1220
335
|
};
|
|
1221
|
-
|
|
336
|
+
|
|
337
|
+
// ../packager/packager-core/src/i18n/locales/es.ts
|
|
338
|
+
var es = {
|
|
1222
339
|
toolCore: {
|
|
1223
340
|
errors: {
|
|
1224
341
|
internal: "Internal error: {message}",
|
|
@@ -1258,7 +375,9 @@ var es2 = {
|
|
|
1258
375
|
}
|
|
1259
376
|
}
|
|
1260
377
|
};
|
|
1261
|
-
|
|
378
|
+
|
|
379
|
+
// ../packager/packager-core/src/i18n/locales/es-MX.ts
|
|
380
|
+
var es_MX = {
|
|
1262
381
|
toolCore: {
|
|
1263
382
|
errors: {
|
|
1264
383
|
internal: "Internal error: {message}",
|
|
@@ -1298,7 +417,9 @@ var es_MX2 = {
|
|
|
1298
417
|
}
|
|
1299
418
|
}
|
|
1300
419
|
};
|
|
1301
|
-
|
|
420
|
+
|
|
421
|
+
// ../packager/packager-core/src/i18n/locales/fr.ts
|
|
422
|
+
var fr = {
|
|
1302
423
|
toolCore: {
|
|
1303
424
|
errors: {
|
|
1304
425
|
internal: "Internal error: {message}",
|
|
@@ -1338,7 +459,9 @@ var fr2 = {
|
|
|
1338
459
|
}
|
|
1339
460
|
}
|
|
1340
461
|
};
|
|
1341
|
-
|
|
462
|
+
|
|
463
|
+
// ../packager/packager-core/src/i18n/locales/ja.ts
|
|
464
|
+
var ja = {
|
|
1342
465
|
toolCore: {
|
|
1343
466
|
errors: {
|
|
1344
467
|
internal: "Internal error: {message}",
|
|
@@ -1378,7 +501,9 @@ var ja2 = {
|
|
|
1378
501
|
}
|
|
1379
502
|
}
|
|
1380
503
|
};
|
|
1381
|
-
|
|
504
|
+
|
|
505
|
+
// ../packager/packager-core/src/i18n/locales/ko.ts
|
|
506
|
+
var ko = {
|
|
1382
507
|
toolCore: {
|
|
1383
508
|
errors: {
|
|
1384
509
|
internal: "Internal error: {message}",
|
|
@@ -1418,7 +543,9 @@ var ko2 = {
|
|
|
1418
543
|
}
|
|
1419
544
|
}
|
|
1420
545
|
};
|
|
1421
|
-
|
|
546
|
+
|
|
547
|
+
// ../packager/packager-core/src/i18n/locales/pt.ts
|
|
548
|
+
var pt = {
|
|
1422
549
|
toolCore: {
|
|
1423
550
|
errors: {
|
|
1424
551
|
internal: "Internal error: {message}",
|
|
@@ -1458,7 +585,9 @@ var pt2 = {
|
|
|
1458
585
|
}
|
|
1459
586
|
}
|
|
1460
587
|
};
|
|
1461
|
-
|
|
588
|
+
|
|
589
|
+
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
|
|
590
|
+
var pt_BR = {
|
|
1462
591
|
toolCore: {
|
|
1463
592
|
errors: {
|
|
1464
593
|
internal: "Internal error: {message}",
|
|
@@ -1498,7 +627,9 @@ var pt_BR2 = {
|
|
|
1498
627
|
}
|
|
1499
628
|
}
|
|
1500
629
|
};
|
|
1501
|
-
|
|
630
|
+
|
|
631
|
+
// ../packager/packager-core/src/i18n/locales/ro.ts
|
|
632
|
+
var ro = {
|
|
1502
633
|
toolCore: {
|
|
1503
634
|
errors: {
|
|
1504
635
|
internal: "Internal error: {message}",
|
|
@@ -1538,7 +669,9 @@ var ro2 = {
|
|
|
1538
669
|
}
|
|
1539
670
|
}
|
|
1540
671
|
};
|
|
1541
|
-
|
|
672
|
+
|
|
673
|
+
// ../packager/packager-core/src/i18n/locales/ru.ts
|
|
674
|
+
var ru = {
|
|
1542
675
|
toolCore: {
|
|
1543
676
|
errors: {
|
|
1544
677
|
internal: "Internal error: {message}",
|
|
@@ -1578,7 +711,9 @@ var ru2 = {
|
|
|
1578
711
|
}
|
|
1579
712
|
}
|
|
1580
713
|
};
|
|
1581
|
-
|
|
714
|
+
|
|
715
|
+
// ../packager/packager-core/src/i18n/locales/tr.ts
|
|
716
|
+
var tr = {
|
|
1582
717
|
toolCore: {
|
|
1583
718
|
errors: {
|
|
1584
719
|
internal: "Internal error: {message}",
|
|
@@ -1618,7 +753,9 @@ var tr2 = {
|
|
|
1618
753
|
}
|
|
1619
754
|
}
|
|
1620
755
|
};
|
|
1621
|
-
|
|
756
|
+
|
|
757
|
+
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
|
|
758
|
+
var zh_CN = {
|
|
1622
759
|
toolCore: {
|
|
1623
760
|
errors: {
|
|
1624
761
|
internal: "Internal error: {message}",
|
|
@@ -1658,7 +795,9 @@ var zh_CN2 = {
|
|
|
1658
795
|
}
|
|
1659
796
|
}
|
|
1660
797
|
};
|
|
1661
|
-
|
|
798
|
+
|
|
799
|
+
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
|
|
800
|
+
var zh_TW = {
|
|
1662
801
|
toolCore: {
|
|
1663
802
|
errors: {
|
|
1664
803
|
internal: "Internal error: {message}",
|
|
@@ -1698,7 +837,9 @@ var zh_TW2 = {
|
|
|
1698
837
|
}
|
|
1699
838
|
}
|
|
1700
839
|
};
|
|
1701
|
-
|
|
840
|
+
|
|
841
|
+
// ../packager/packager-core/src/i18n/locales/zu.ts
|
|
842
|
+
var zu = {
|
|
1702
843
|
toolCore: {
|
|
1703
844
|
errors: {
|
|
1704
845
|
internal: "Internal error: {message}",
|
|
@@ -1739,65 +880,57 @@ var zu2 = {
|
|
|
1739
880
|
}
|
|
1740
881
|
};
|
|
1741
882
|
|
|
1742
|
-
|
|
883
|
+
// ../packager/packager-core/src/i18n/translation-service.ts
|
|
884
|
+
class TranslationService {
|
|
1743
885
|
static instance;
|
|
1744
886
|
currentLocale = "en";
|
|
1745
887
|
constructor() {}
|
|
1746
888
|
static getInstance() {
|
|
1747
|
-
if (!
|
|
1748
|
-
|
|
889
|
+
if (!TranslationService.instance) {
|
|
890
|
+
TranslationService.instance = new TranslationService;
|
|
1749
891
|
}
|
|
1750
|
-
return
|
|
892
|
+
return TranslationService.instance;
|
|
1751
893
|
}
|
|
1752
894
|
setLocale(locale) {
|
|
1753
|
-
this.currentLocale =
|
|
895
|
+
this.currentLocale = I18nManager.setLocale(locale);
|
|
1754
896
|
}
|
|
1755
897
|
getLocale() {
|
|
1756
898
|
return this.currentLocale;
|
|
1757
899
|
}
|
|
1758
900
|
t(key, params) {
|
|
1759
|
-
return
|
|
901
|
+
return I18nManager.t(key, params, this.currentLocale);
|
|
1760
902
|
}
|
|
1761
903
|
tLocale(key, locale, params) {
|
|
1762
|
-
return
|
|
904
|
+
return I18nManager.t(key, params, locale);
|
|
1763
905
|
}
|
|
1764
906
|
has(key) {
|
|
1765
|
-
return
|
|
907
|
+
return I18nManager.has(key, this.currentLocale);
|
|
1766
908
|
}
|
|
1767
909
|
getAvailableLocales() {
|
|
1768
|
-
return
|
|
910
|
+
return I18nManager.getAvailableLocales();
|
|
1769
911
|
}
|
|
1770
912
|
}
|
|
1771
|
-
var
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
(
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
})(BuildConfiguration2 ||= {});
|
|
1793
|
-
var LogLevel2;
|
|
1794
|
-
((LogLevel22) => {
|
|
1795
|
-
LogLevel22["Debug"] = "Debug";
|
|
1796
|
-
LogLevel22["Info"] = "Information";
|
|
1797
|
-
LogLevel22["Warn"] = "Warning";
|
|
1798
|
-
LogLevel22["Error"] = "Error";
|
|
1799
|
-
})(LogLevel2 ||= {});
|
|
1800
|
-
var NugetConstants2 = {
|
|
913
|
+
var translate = TranslationService.getInstance();
|
|
914
|
+
|
|
915
|
+
// ../packager/packager-core/src/i18n/index.ts
|
|
916
|
+
I18nManager.registerTranslations("en", en);
|
|
917
|
+
I18nManager.registerTranslations("de", de);
|
|
918
|
+
I18nManager.registerTranslations("es", es);
|
|
919
|
+
I18nManager.registerTranslations("es-mx", es_MX);
|
|
920
|
+
I18nManager.registerTranslations("fr", fr);
|
|
921
|
+
I18nManager.registerTranslations("ja", ja);
|
|
922
|
+
I18nManager.registerTranslations("ko", ko);
|
|
923
|
+
I18nManager.registerTranslations("pt", pt);
|
|
924
|
+
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
925
|
+
I18nManager.registerTranslations("ro", ro);
|
|
926
|
+
I18nManager.registerTranslations("ru", ru);
|
|
927
|
+
I18nManager.registerTranslations("tr", tr);
|
|
928
|
+
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
929
|
+
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
930
|
+
I18nManager.registerTranslations("zu", zu);
|
|
931
|
+
I18nManager.setLocale("en");
|
|
932
|
+
// ../packager/packager-core/src/models/nuget-constants.ts
|
|
933
|
+
var NugetConstants = {
|
|
1801
934
|
OutputFolderName: "bundle",
|
|
1802
935
|
ContentFolderName: "content",
|
|
1803
936
|
OperateFileName: "operate.json",
|
|
@@ -1806,40 +939,8 @@ var NugetConstants2 = {
|
|
|
1806
939
|
BindingsV2FileName: "bindings_v2.json",
|
|
1807
940
|
BindingsFileId: "bindings.json"
|
|
1808
941
|
};
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
PackJobTargetKind22["Serverless"] = "Serverless";
|
|
1812
|
-
PackJobTargetKind22["LocalRobot"] = "LocalRobot";
|
|
1813
|
-
})(PackJobTargetKind2 ||= {});
|
|
1814
|
-
var ProjectTypes2;
|
|
1815
|
-
((ProjectTypes22) => {
|
|
1816
|
-
ProjectTypes22["Agent"] = "Agent";
|
|
1817
|
-
ProjectTypes22["Api"] = "Api";
|
|
1818
|
-
ProjectTypes22["BusinessRules"] = "BusinessRules";
|
|
1819
|
-
ProjectTypes22["Connector"] = "Connector";
|
|
1820
|
-
ProjectTypes22["CaseManagement"] = "CaseManagement";
|
|
1821
|
-
ProjectTypes22["Flow"] = "Flow";
|
|
1822
|
-
ProjectTypes22["Function"] = "Function";
|
|
1823
|
-
ProjectTypes22["ProcessOrchestration"] = "ProcessOrchestration";
|
|
1824
|
-
ProjectTypes22["Process"] = "Process";
|
|
1825
|
-
ProjectTypes22["Library"] = "Library";
|
|
1826
|
-
ProjectTypes22["WebApp"] = "WebApp";
|
|
1827
|
-
ProjectTypes22["Tests"] = "Tests";
|
|
1828
|
-
ProjectTypes22["AppV2"] = "AppV2";
|
|
1829
|
-
})(ProjectTypes2 ||= {});
|
|
1830
|
-
var TargetFramework2;
|
|
1831
|
-
((TargetFramework22) => {
|
|
1832
|
-
TargetFramework22["Portable"] = "Portable";
|
|
1833
|
-
TargetFramework22["Windows"] = "Windows";
|
|
1834
|
-
})(TargetFramework2 ||= {});
|
|
1835
|
-
var ToolErrorCodes2;
|
|
1836
|
-
((ToolErrorCodes22) => {
|
|
1837
|
-
ToolErrorCodes22["Success"] = "SUCCESS";
|
|
1838
|
-
ToolErrorCodes22["InternalError"] = "INTERNAL_ERROR";
|
|
1839
|
-
ToolErrorCodes22["Canceled"] = "CANCELED";
|
|
1840
|
-
})(ToolErrorCodes2 ||= {});
|
|
1841
|
-
|
|
1842
|
-
class ToolResult2 {
|
|
942
|
+
// ../packager/packager-core/src/models/tool-result.ts
|
|
943
|
+
class ToolResult {
|
|
1843
944
|
errorCode;
|
|
1844
945
|
message;
|
|
1845
946
|
packages;
|
|
@@ -1852,15 +953,16 @@ class ToolResult2 {
|
|
|
1852
953
|
this.instructions = instructions;
|
|
1853
954
|
}
|
|
1854
955
|
get isSuccess() {
|
|
1855
|
-
return this.errorCode === "SUCCESS"
|
|
956
|
+
return this.errorCode === "SUCCESS" /* Success */;
|
|
1856
957
|
}
|
|
1857
958
|
static success() {
|
|
1858
|
-
return new
|
|
959
|
+
return new ToolResult("SUCCESS" /* Success */);
|
|
1859
960
|
}
|
|
1860
961
|
static error(errorCode, message, instructions) {
|
|
1861
|
-
return new
|
|
962
|
+
return new ToolResult(errorCode, message, [], instructions);
|
|
1862
963
|
}
|
|
1863
964
|
}
|
|
965
|
+
// ../packager/packager-core/src/services/project-id.ts
|
|
1864
966
|
var OPERATE_FILE = "operate.json";
|
|
1865
967
|
var PROJECT_FILE = "project.json";
|
|
1866
968
|
function isNonEmptyString(value) {
|
|
@@ -1890,8 +992,8 @@ async function writeJsonObject(fs, filePath, data) {
|
|
|
1890
992
|
await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}
|
|
1891
993
|
`);
|
|
1892
994
|
}
|
|
1893
|
-
async function
|
|
1894
|
-
const operatePath =
|
|
995
|
+
async function ensureProjectId(projectPath, fs) {
|
|
996
|
+
const operatePath = Path.join(projectPath, OPERATE_FILE);
|
|
1895
997
|
const operateExists = await fs.exists(operatePath);
|
|
1896
998
|
if (operateExists) {
|
|
1897
999
|
const operate = await readJsonObject(fs, operatePath);
|
|
@@ -1908,7 +1010,7 @@ async function ensureProjectId2(projectPath, fs) {
|
|
|
1908
1010
|
}
|
|
1909
1011
|
return crypto.randomUUID();
|
|
1910
1012
|
}
|
|
1911
|
-
const projectFilePath =
|
|
1013
|
+
const projectFilePath = Path.join(projectPath, PROJECT_FILE);
|
|
1912
1014
|
const projectFileExists = await fs.exists(projectFilePath);
|
|
1913
1015
|
if (projectFileExists) {
|
|
1914
1016
|
const projectFile = await readJsonObject(fs, projectFilePath);
|
|
@@ -1927,6 +1029,7 @@ async function ensureProjectId2(projectPath, fs) {
|
|
|
1927
1029
|
}
|
|
1928
1030
|
return crypto.randomUUID();
|
|
1929
1031
|
}
|
|
1032
|
+
// ../packager/packager-core/src/services/nuget-packager.ts
|
|
1930
1033
|
function escapeXml(str) {
|
|
1931
1034
|
if (str === null || str === undefined) {
|
|
1932
1035
|
return "";
|
|
@@ -1998,16 +1101,16 @@ function generatePsmdcpXml(packageInfo) {
|
|
|
1998
1101
|
</coreProperties>`;
|
|
1999
1102
|
}
|
|
2000
1103
|
|
|
2001
|
-
class
|
|
1104
|
+
class NugetPackager {
|
|
2002
1105
|
fileSystem;
|
|
2003
1106
|
constructor(fileSystem) {
|
|
2004
1107
|
this.fileSystem = fileSystem;
|
|
2005
1108
|
}
|
|
2006
1109
|
async packAsync(rootPath, packageInfo, outputPath) {
|
|
2007
|
-
const normalizedOutputPath =
|
|
1110
|
+
const normalizedOutputPath = Path.normalize(outputPath);
|
|
2008
1111
|
const nuspecXml = generateNuspecXml(packageInfo);
|
|
2009
1112
|
const nuspecFileName = `${packageInfo.id}.nuspec`;
|
|
2010
|
-
const fileEntries = await
|
|
1113
|
+
const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
|
|
2011
1114
|
const zipContents = {};
|
|
2012
1115
|
const encoder = new TextEncoder;
|
|
2013
1116
|
const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
|
|
@@ -2045,8 +1148,8 @@ class NugetPackager2 {
|
|
|
2045
1148
|
};
|
|
2046
1149
|
}
|
|
2047
1150
|
}
|
|
2048
|
-
|
|
2049
|
-
class
|
|
1151
|
+
// ../packager/packager-core/src/services/project-tool.ts
|
|
1152
|
+
class ProjectTool {
|
|
2050
1153
|
fileSystem;
|
|
2051
1154
|
logger;
|
|
2052
1155
|
static ProjectFileName = "project.uiproj";
|
|
@@ -2056,26 +1159,26 @@ class ProjectTool2 {
|
|
|
2056
1159
|
}
|
|
2057
1160
|
async restoreAsync(_options, _cancellationToken) {
|
|
2058
1161
|
this.logger.info("Restore operation is a noop");
|
|
2059
|
-
return
|
|
1162
|
+
return ToolResult.success();
|
|
2060
1163
|
}
|
|
2061
1164
|
async validateAsync(_options, _cancellationToken) {
|
|
2062
1165
|
this.logger.info("Validate operation is a noop");
|
|
2063
|
-
return
|
|
1166
|
+
return ToolResult.success();
|
|
2064
1167
|
}
|
|
2065
1168
|
async buildAsync(_options, _cancellationToken) {
|
|
2066
1169
|
this.logger.info("Build operation is a noop");
|
|
2067
|
-
return
|
|
1170
|
+
return ToolResult.success();
|
|
2068
1171
|
}
|
|
2069
1172
|
async packAsync(_options, _cancellationToken) {
|
|
2070
1173
|
this.logger.info("Pack operation is a noop");
|
|
2071
|
-
return
|
|
1174
|
+
return ToolResult.success();
|
|
2072
1175
|
}
|
|
2073
1176
|
async cleanupAsync(_options, _cancellationToken) {
|
|
2074
1177
|
this.logger.info("Cleanup operation is a noop");
|
|
2075
|
-
return
|
|
1178
|
+
return ToolResult.success();
|
|
2076
1179
|
}
|
|
2077
1180
|
async getUiProjectAsync(projectPath) {
|
|
2078
|
-
const filePath =
|
|
1181
|
+
const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
|
|
2079
1182
|
if (!await this.fileSystem.exists(filePath)) {
|
|
2080
1183
|
return;
|
|
2081
1184
|
}
|
|
@@ -2088,7 +1191,8 @@ class ProjectTool2 {
|
|
|
2088
1191
|
}
|
|
2089
1192
|
async dispose() {}
|
|
2090
1193
|
}
|
|
2091
|
-
|
|
1194
|
+
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
1195
|
+
class ToolsFactoryRepository {
|
|
2092
1196
|
projectFactoryMap = new Map;
|
|
2093
1197
|
solutionFactory = null;
|
|
2094
1198
|
registerProjectToolFactory(factory) {
|
|
@@ -2127,13 +1231,12 @@ class ToolsFactoryRepository2 {
|
|
|
2127
1231
|
this.solutionFactory = null;
|
|
2128
1232
|
}
|
|
2129
1233
|
}
|
|
2130
|
-
var
|
|
2131
|
-
var
|
|
2132
|
-
if (!
|
|
2133
|
-
|
|
1234
|
+
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
1235
|
+
var _global = globalThis;
|
|
1236
|
+
if (!_global[REGISTRY_KEY]) {
|
|
1237
|
+
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
2134
1238
|
}
|
|
2135
|
-
var
|
|
2136
|
-
|
|
1239
|
+
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
2137
1240
|
// ../../node_modules/@uipath/coded-functions-js-packager/dist/index.js
|
|
2138
1241
|
var npm = { name: "npm", lockFile: "package-lock.json", installHint: "npm install" };
|
|
2139
1242
|
var bun = { name: "bun", lockFile: "bun.lock", installHint: "bun install" };
|
|
@@ -2403,7 +1506,7 @@ var SCHEMAS = {
|
|
|
2403
1506
|
|
|
2404
1507
|
// ../packager/packager-tool-functions/src/py/build-py-functions-package.ts
|
|
2405
1508
|
async function buildPyFunctionsPackage(fileSystem, options) {
|
|
2406
|
-
const contentFolder =
|
|
1509
|
+
const contentFolder = Path.join(options.outputPath, NugetConstants.ContentFolderName);
|
|
2407
1510
|
await validateProjectFiles(fileSystem, options.projectPath);
|
|
2408
1511
|
await copyFiles(fileSystem, options.projectPath, contentFolder);
|
|
2409
1512
|
await writeEntryPointsFile(fileSystem, options.projectPath, contentFolder);
|
|
@@ -2412,8 +1515,8 @@ async function buildPyFunctionsPackage(fileSystem, options) {
|
|
|
2412
1515
|
await createPackageDescriptor(fileSystem, options.outputPath);
|
|
2413
1516
|
}
|
|
2414
1517
|
async function validateProjectFiles(fileSystem, projectPath) {
|
|
2415
|
-
const uipathJsonPath =
|
|
2416
|
-
const entryPointsPath =
|
|
1518
|
+
const uipathJsonPath = Path.join(projectPath, UIPATH_JSON_FILE_NAME);
|
|
1519
|
+
const entryPointsPath = Path.join(projectPath, NugetConstants.EntryPointsFileName);
|
|
2417
1520
|
if (!await fileSystem.exists(uipathJsonPath)) {
|
|
2418
1521
|
throw new Error("uipath.json is missing from the project.");
|
|
2419
1522
|
}
|
|
@@ -2425,8 +1528,8 @@ async function copyFiles(fileSystem, sourcePath, destinationPath) {
|
|
|
2425
1528
|
await fileSystem.mkdir(destinationPath);
|
|
2426
1529
|
const entries = await fileSystem.readdir(sourcePath);
|
|
2427
1530
|
for (const entry of entries) {
|
|
2428
|
-
const sourceFile =
|
|
2429
|
-
const destinationFile =
|
|
1531
|
+
const sourceFile = Path.join(sourcePath, entry);
|
|
1532
|
+
const destinationFile = Path.join(destinationPath, entry);
|
|
2430
1533
|
const stat = await fileSystem.stat(sourceFile);
|
|
2431
1534
|
if (stat?.isFile()) {
|
|
2432
1535
|
if (EXCLUDED_NAMES2.has(entry)) {
|
|
@@ -2445,12 +1548,12 @@ async function copyFiles(fileSystem, sourcePath, destinationPath) {
|
|
|
2445
1548
|
}
|
|
2446
1549
|
}
|
|
2447
1550
|
async function createOperateFile(fileSystem, contentFolder, projectStorageId) {
|
|
2448
|
-
const operateJsonFilePath =
|
|
1551
|
+
const operateJsonFilePath = Path.join(contentFolder, NugetConstants.OperateFileName);
|
|
2449
1552
|
const exists = await fileSystem.exists(operateJsonFilePath);
|
|
2450
1553
|
if (exists) {
|
|
2451
1554
|
return;
|
|
2452
1555
|
}
|
|
2453
|
-
const entryPointsFilePath =
|
|
1556
|
+
const entryPointsFilePath = Path.join(contentFolder, NugetConstants.EntryPointsFileName);
|
|
2454
1557
|
let mainPath = "";
|
|
2455
1558
|
const entryPointsExists = await fileSystem.exists(entryPointsFilePath);
|
|
2456
1559
|
if (entryPointsExists) {
|
|
@@ -2480,8 +1583,8 @@ async function createOperateFile(fileSystem, contentFolder, projectStorageId) {
|
|
|
2480
1583
|
await fileSystem.writeFile(operateJsonFilePath, operateJsonString);
|
|
2481
1584
|
}
|
|
2482
1585
|
async function writeEntryPointsFile(fileSystem, projectPath, contentFolder) {
|
|
2483
|
-
const sourcePath =
|
|
2484
|
-
const destinationPath =
|
|
1586
|
+
const sourcePath = Path.join(projectPath, NugetConstants.EntryPointsFileName);
|
|
1587
|
+
const destinationPath = Path.join(contentFolder, NugetConstants.EntryPointsFileName);
|
|
2485
1588
|
const raw = await fileSystem.readFile(sourcePath);
|
|
2486
1589
|
if (!raw) {
|
|
2487
1590
|
throw new Error("entry-points.json is missing from the project.");
|
|
@@ -2500,14 +1603,14 @@ async function writeEntryPointsFile(fileSystem, projectPath, contentFolder) {
|
|
|
2500
1603
|
}));
|
|
2501
1604
|
const normalized = {
|
|
2502
1605
|
$schema: SCHEMAS.EntryPoint,
|
|
2503
|
-
$id:
|
|
1606
|
+
$id: NugetConstants.EntryPointsFileName,
|
|
2504
1607
|
entryPoints: normalizedEntries
|
|
2505
1608
|
};
|
|
2506
1609
|
await fileSystem.writeFile(destinationPath, JSON.stringify(normalized, null, 2));
|
|
2507
1610
|
}
|
|
2508
1611
|
async function createBindingsFile(fileSystem, projectPath, contentFolder) {
|
|
2509
|
-
const bindingsOutputPath =
|
|
2510
|
-
const sourcePath =
|
|
1612
|
+
const bindingsOutputPath = Path.join(contentFolder, NugetConstants.BindingsV2FileName);
|
|
1613
|
+
const sourcePath = Path.join(projectPath, BINDINGS_SOURCE_FILE_NAME);
|
|
2511
1614
|
let bindings = null;
|
|
2512
1615
|
if (await fileSystem.exists(sourcePath)) {
|
|
2513
1616
|
const raw = await fileSystem.readFile(sourcePath);
|
|
@@ -2532,10 +1635,10 @@ async function createPackageDescriptor(fileSystem, localBuildFolder) {
|
|
|
2532
1635
|
const packageDescriptor = {
|
|
2533
1636
|
files: {}
|
|
2534
1637
|
};
|
|
2535
|
-
addFileToDescriptor(packageDescriptor,
|
|
2536
|
-
addFileToDescriptor(packageDescriptor,
|
|
2537
|
-
addFileToDescriptor(packageDescriptor,
|
|
2538
|
-
const packageDescriptorPath =
|
|
1638
|
+
addFileToDescriptor(packageDescriptor, NugetConstants.OperateFileName, NugetConstants.OperateFileName);
|
|
1639
|
+
addFileToDescriptor(packageDescriptor, NugetConstants.EntryPointsFileName, NugetConstants.EntryPointsFileName);
|
|
1640
|
+
addFileToDescriptor(packageDescriptor, NugetConstants.BindingsFileId, NugetConstants.BindingsV2FileName);
|
|
1641
|
+
const packageDescriptorPath = Path.join(localBuildFolder, NugetConstants.ContentFolderName, NugetConstants.PackageDescriptorFileName);
|
|
2539
1642
|
const packageDescriptorJson = JSON.stringify({
|
|
2540
1643
|
$schema: SCHEMAS.PackageDescriptor,
|
|
2541
1644
|
...packageDescriptor
|
|
@@ -2543,7 +1646,7 @@ async function createPackageDescriptor(fileSystem, localBuildFolder) {
|
|
|
2543
1646
|
await fileSystem.writeFile(packageDescriptorPath, packageDescriptorJson);
|
|
2544
1647
|
}
|
|
2545
1648
|
function addFileToDescriptor(packageDescriptor, key, fileName) {
|
|
2546
|
-
const relativePath =
|
|
1649
|
+
const relativePath = Path.join(NugetConstants.ContentFolderName, fileName);
|
|
2547
1650
|
packageDescriptor.files[key] = relativePath;
|
|
2548
1651
|
}
|
|
2549
1652
|
// ../packager/packager-tool-functions/src/types.ts
|
|
@@ -2557,39 +1660,39 @@ var LanguageLabels = {
|
|
|
2557
1660
|
};
|
|
2558
1661
|
|
|
2559
1662
|
// ../packager/packager-tool-functions/src/functions-tool.ts
|
|
2560
|
-
class FunctionsTool extends
|
|
1663
|
+
class FunctionsTool extends ProjectTool {
|
|
2561
1664
|
_temporaryStorage;
|
|
2562
1665
|
constructor(fileSystem, logger) {
|
|
2563
1666
|
super(fileSystem, logger);
|
|
2564
|
-
this._temporaryStorage = new
|
|
1667
|
+
this._temporaryStorage = new TemporaryStorageService(fileSystem);
|
|
2565
1668
|
}
|
|
2566
1669
|
async restoreAsync(_options, _cancellationToken) {
|
|
2567
1670
|
this.logger.info("Restore not required for Functions projects.");
|
|
2568
|
-
return
|
|
1671
|
+
return ToolResult.success();
|
|
2569
1672
|
}
|
|
2570
1673
|
async validateAsync(_options, _cancellationToken) {
|
|
2571
1674
|
this.logger.info("Validate not required for Functions projects.");
|
|
2572
|
-
return
|
|
1675
|
+
return ToolResult.success();
|
|
2573
1676
|
}
|
|
2574
1677
|
async buildAsync(options, _cancellationToken) {
|
|
2575
1678
|
const language = await this.detectLanguage(options.projectPath);
|
|
2576
1679
|
const tempFolder = await this._temporaryStorage.getTempFolderPath();
|
|
2577
|
-
const localBuildFolder =
|
|
1680
|
+
const localBuildFolder = Path.join(tempFolder, NugetConstants.OutputFolderName);
|
|
2578
1681
|
const build = language === Languages.Python ? buildPyFunctionsPackage : buildJsFunctionsPackage;
|
|
2579
1682
|
const languageLabel = LanguageLabels[language];
|
|
2580
1683
|
try {
|
|
2581
1684
|
this.logger.progress(`Building ${languageLabel} Functions package...`);
|
|
2582
|
-
const projectStorageId = options.projectStorageId ?? await
|
|
1685
|
+
const projectStorageId = options.projectStorageId ?? await ensureProjectId(options.projectPath, this.fileSystem);
|
|
2583
1686
|
await build(this.fileSystem, {
|
|
2584
1687
|
projectPath: options.projectPath,
|
|
2585
1688
|
outputPath: localBuildFolder,
|
|
2586
1689
|
projectStorageId
|
|
2587
1690
|
});
|
|
2588
|
-
return new
|
|
1691
|
+
return new ToolResult("SUCCESS" /* Success */, "Build completed successfully.", [localBuildFolder]);
|
|
2589
1692
|
} catch (error) {
|
|
2590
1693
|
const errorMessage = error instanceof Error ? error.toString() : String(error);
|
|
2591
1694
|
this.logger.error(errorMessage);
|
|
2592
|
-
return
|
|
1695
|
+
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Build failed for ${languageLabel} Functions project.`);
|
|
2593
1696
|
}
|
|
2594
1697
|
}
|
|
2595
1698
|
async packAsync(options, cancellationToken) {
|
|
@@ -2601,15 +1704,15 @@ class FunctionsTool extends ProjectTool2 {
|
|
|
2601
1704
|
try {
|
|
2602
1705
|
this.logger.progress("Creating NuGet package...");
|
|
2603
1706
|
const nupkgFileName = `${options.package.id}.${options.package.version}.nupkg`;
|
|
2604
|
-
const nupkgPath =
|
|
2605
|
-
const packager = new
|
|
1707
|
+
const nupkgPath = Path.join(options.outputPath, nupkgFileName);
|
|
1708
|
+
const packager = new NugetPackager(this.fileSystem);
|
|
2606
1709
|
const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
|
|
2607
1710
|
this.logger.progress("Package created successfully.");
|
|
2608
|
-
return new
|
|
1711
|
+
return new ToolResult("SUCCESS" /* Success */, "Pack completed successfully.", [result.outputPath]);
|
|
2609
1712
|
} catch (error) {
|
|
2610
1713
|
const errorMessage = error instanceof Error ? error.toString() : String(error);
|
|
2611
1714
|
this.logger.error(errorMessage);
|
|
2612
|
-
return
|
|
1715
|
+
return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "Pack failed for Functions project.");
|
|
2613
1716
|
}
|
|
2614
1717
|
}
|
|
2615
1718
|
async dispose() {
|
|
@@ -2619,7 +1722,7 @@ class FunctionsTool extends ProjectTool2 {
|
|
|
2619
1722
|
} catch {}
|
|
2620
1723
|
}
|
|
2621
1724
|
async detectLanguage(projectPath) {
|
|
2622
|
-
const uipathJsonContent = await this.fileSystem.readFile(
|
|
1725
|
+
const uipathJsonContent = await this.fileSystem.readFile(Path.join(projectPath, "uipath.json"), "utf-8");
|
|
2623
1726
|
if (uipathJsonContent) {
|
|
2624
1727
|
try {
|
|
2625
1728
|
const uipathJson = JSON.parse(uipathJsonContent);
|
|
@@ -2634,7 +1737,7 @@ class FunctionsTool extends ProjectTool2 {
|
|
|
2634
1737
|
}
|
|
2635
1738
|
} catch {}
|
|
2636
1739
|
}
|
|
2637
|
-
const pyprojectStat = await this.fileSystem.stat(
|
|
1740
|
+
const pyprojectStat = await this.fileSystem.stat(Path.join(projectPath, "pyproject.toml"));
|
|
2638
1741
|
if (pyprojectStat?.isFile())
|
|
2639
1742
|
return Languages.Python;
|
|
2640
1743
|
return Languages.JavaScript;
|
|
@@ -2642,7 +1745,7 @@ class FunctionsTool extends ProjectTool2 {
|
|
|
2642
1745
|
}
|
|
2643
1746
|
// ../packager/packager-tool-functions/src/functions-tool-factory.ts
|
|
2644
1747
|
class FunctionsToolFactory {
|
|
2645
|
-
supportedTypes = [
|
|
1748
|
+
supportedTypes = ["Function" /* Function */];
|
|
2646
1749
|
async createAsync(logger, fileSystem) {
|
|
2647
1750
|
return new FunctionsTool(fileSystem, logger);
|
|
2648
1751
|
}
|
|
@@ -2683,4 +1786,4 @@ export {
|
|
|
2683
1786
|
registerPackagerFactories
|
|
2684
1787
|
};
|
|
2685
1788
|
|
|
2686
|
-
//# debugId=
|
|
1789
|
+
//# debugId=35257A7D86CE63CF64756E2164756E21
|