@uipath/data-fabric-tool 1.201.0 → 1.202.0-preview.136
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/{getMachineId-bsd-wfkxpxjv.js → getMachineId-bsd-67w37xtj.js} +5 -5
- package/dist/{getMachineId-darwin-9asn4zy6.js → getMachineId-darwin-4g3xfpfp.js} +5 -5
- package/dist/{getMachineId-linux-62t6m027.js → getMachineId-linux-a4p6fb9w.js} +4 -4
- package/dist/{getMachineId-unsupported-dfrzeqc3.js → getMachineId-unsupported-77w362eh.js} +4 -4
- package/dist/{getMachineId-win-zgvrp5q3.js → getMachineId-win-9cfxg9c8.js} +5 -5
- package/dist/{index-2fj08e7n.js → index-gpd94m28.js} +27 -27
- package/dist/{index-w03qc9m8.js → index-sby22td6.js} +4 -4
- package/dist/index.js +4 -7
- package/dist/{js-yaml-4ypbq2tt.js → js-yaml-88tdqrtd.js} +27 -19
- package/dist/{tool-0v6na3yp.js → packager-tool-1de529jm.js} +9 -7
- package/dist/{tool-h1k9mjs9.js → packager-tool-2czkpqb0.js} +3 -3
- package/dist/{tool-r6rhp5ep.js → packager-tool-bndhpxxj.js} +46 -46
- package/dist/{tool-91jjmaaz.js → packager-tool-r3p26srq.js} +2124 -1228
- package/dist/packager-tool.js +2568 -0
- package/dist/tool.js +6 -9
- package/package.json +4 -3
- package/src/packager-tool.spec.ts +29 -0
- package/src/packager-tool.ts +10 -0
- package/src/utils/validate.ts +11 -273
- package/tests/choice-sets-lifecycle.e2e.test.ts +2 -1
- package/tests/entities-lifecycle.e2e.test.ts +2 -1
- package/tests/entity-project-packaging.e2e.test.ts +549 -0
- package/tests/files-management.e2e.test.ts +2 -1
- package/dist/browser-strategy-yccf8mtd.js +0 -99
- package/dist/node-strategy-12qfy0nv.js +0 -348
- package/dist/tool-5arsyj36.js +0 -11
- package/dist/tool-7eva0peq.js +0 -265
- package/dist/tool-9qecd4wb.js +0 -14
|
@@ -0,0 +1,2568 @@
|
|
|
1
|
+
import"./packager-tool-1de529jm.js";
|
|
2
|
+
|
|
3
|
+
// ../packager/packager-core/dist/index.js
|
|
4
|
+
class Path {
|
|
5
|
+
static normalize(path) {
|
|
6
|
+
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
7
|
+
}
|
|
8
|
+
static join(...segments) {
|
|
9
|
+
return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
|
|
10
|
+
}
|
|
11
|
+
static dirname(path) {
|
|
12
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
13
|
+
if (normalized === "")
|
|
14
|
+
return ".";
|
|
15
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
16
|
+
if (lastSlash === -1)
|
|
17
|
+
return ".";
|
|
18
|
+
if (lastSlash === 0)
|
|
19
|
+
return "/";
|
|
20
|
+
return normalized.substring(0, lastSlash);
|
|
21
|
+
}
|
|
22
|
+
static basename(path) {
|
|
23
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
24
|
+
if (normalized === "")
|
|
25
|
+
return "";
|
|
26
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
27
|
+
return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
|
|
28
|
+
}
|
|
29
|
+
static extname(path) {
|
|
30
|
+
const base = Path.basename(path);
|
|
31
|
+
const lastDot = base.lastIndexOf(".");
|
|
32
|
+
if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
return base.substring(lastDot);
|
|
36
|
+
}
|
|
37
|
+
static async walkDirectory(fs, rootPath, currentRelativePath = "") {
|
|
38
|
+
const entries = [];
|
|
39
|
+
const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
|
|
40
|
+
const items = await fs.readdir(absolutePath);
|
|
41
|
+
for (const item of items) {
|
|
42
|
+
const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
|
|
43
|
+
const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
|
|
44
|
+
const stat = await fs.stat(itemAbsolutePath);
|
|
45
|
+
if (stat?.isDirectory()) {
|
|
46
|
+
const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
|
|
47
|
+
entries.push(...subEntries);
|
|
48
|
+
} else if (stat?.isFile()) {
|
|
49
|
+
entries.push({
|
|
50
|
+
relativePath: Path.normalize(itemRelativePath),
|
|
51
|
+
absolutePath: Path.normalize(itemAbsolutePath)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return entries;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function isPluralForm(value) {
|
|
59
|
+
return typeof value === "object" && value !== null && "other" in value;
|
|
60
|
+
}
|
|
61
|
+
function selectPluralForm(forms, count) {
|
|
62
|
+
if (count === 0 && forms.zero !== undefined) {
|
|
63
|
+
return forms.zero;
|
|
64
|
+
}
|
|
65
|
+
if (count === 1 && forms.one !== undefined) {
|
|
66
|
+
return forms.one;
|
|
67
|
+
}
|
|
68
|
+
if (count === 2 && forms.two !== undefined) {
|
|
69
|
+
return forms.two;
|
|
70
|
+
}
|
|
71
|
+
if (forms.few !== undefined) {
|
|
72
|
+
const mod10 = count % 10;
|
|
73
|
+
const mod100 = count % 100;
|
|
74
|
+
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
75
|
+
return forms.few;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (forms.many !== undefined) {
|
|
79
|
+
const mod10 = count % 10;
|
|
80
|
+
const mod100 = count % 100;
|
|
81
|
+
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
82
|
+
return forms.many;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return forms.other;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
class I18nManager {
|
|
89
|
+
static translations = {};
|
|
90
|
+
static currentLocale = "en";
|
|
91
|
+
static fallbackLocale = "en";
|
|
92
|
+
static registerTranslations(locale, catalog) {
|
|
93
|
+
if (!I18nManager.translations[locale]) {
|
|
94
|
+
I18nManager.translations[locale] = {};
|
|
95
|
+
}
|
|
96
|
+
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
97
|
+
}
|
|
98
|
+
static setLocale(locale) {
|
|
99
|
+
const normalized = I18nManager.normalizeLocale(locale);
|
|
100
|
+
if (I18nManager.translations[normalized]) {
|
|
101
|
+
I18nManager.currentLocale = normalized;
|
|
102
|
+
return normalized;
|
|
103
|
+
}
|
|
104
|
+
const baseLocale = normalized.split("-")[0];
|
|
105
|
+
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
106
|
+
I18nManager.currentLocale = baseLocale;
|
|
107
|
+
return baseLocale;
|
|
108
|
+
}
|
|
109
|
+
return I18nManager.currentLocale;
|
|
110
|
+
}
|
|
111
|
+
static getLocale() {
|
|
112
|
+
return I18nManager.currentLocale;
|
|
113
|
+
}
|
|
114
|
+
static setFallbackLocale(locale) {
|
|
115
|
+
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
116
|
+
}
|
|
117
|
+
static t(key, params, locale) {
|
|
118
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
119
|
+
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
120
|
+
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
121
|
+
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
122
|
+
}
|
|
123
|
+
if (value === undefined) {
|
|
124
|
+
return key;
|
|
125
|
+
}
|
|
126
|
+
if (isPluralForm(value) && params && "count" in params) {
|
|
127
|
+
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
128
|
+
value = selectPluralForm(value, count);
|
|
129
|
+
} else if (isPluralForm(value)) {
|
|
130
|
+
value = value.other;
|
|
131
|
+
}
|
|
132
|
+
if (typeof value !== "string") {
|
|
133
|
+
return key;
|
|
134
|
+
}
|
|
135
|
+
return params ? I18nManager.interpolate(value, params) : value;
|
|
136
|
+
}
|
|
137
|
+
static has(key, locale) {
|
|
138
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
139
|
+
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
140
|
+
if (value !== undefined) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
144
|
+
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
static getAvailableLocales() {
|
|
149
|
+
return Object.keys(I18nManager.translations);
|
|
150
|
+
}
|
|
151
|
+
static clearTranslations() {
|
|
152
|
+
I18nManager.translations = {};
|
|
153
|
+
I18nManager.currentLocale = "en";
|
|
154
|
+
}
|
|
155
|
+
static getTranslationValue(key, locale) {
|
|
156
|
+
const catalog = I18nManager.translations[locale];
|
|
157
|
+
if (!catalog) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const keys = key.split(".");
|
|
161
|
+
let value = catalog;
|
|
162
|
+
for (const k of keys) {
|
|
163
|
+
if (value && typeof value === "object" && k in value) {
|
|
164
|
+
value = value[k];
|
|
165
|
+
} else {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
static interpolate(template, params) {
|
|
172
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
173
|
+
const value = params[key];
|
|
174
|
+
return value !== undefined ? String(value) : `{${key}}`;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
static normalizeLocale(locale) {
|
|
178
|
+
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
179
|
+
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
180
|
+
if (specialLocales.includes(normalized)) {
|
|
181
|
+
return normalized;
|
|
182
|
+
}
|
|
183
|
+
return normalized.split("-")[0];
|
|
184
|
+
}
|
|
185
|
+
static deepMerge(target, source) {
|
|
186
|
+
const result = { ...target };
|
|
187
|
+
for (const key of Object.keys(source)) {
|
|
188
|
+
const sourceValue = source[key];
|
|
189
|
+
const targetValue = result[key];
|
|
190
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
191
|
+
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
192
|
+
} else {
|
|
193
|
+
result[key] = sourceValue;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
var de = {
|
|
200
|
+
toolCore: {
|
|
201
|
+
errors: {
|
|
202
|
+
internal: "Internal error: {message}",
|
|
203
|
+
fileNotFound: "File not found: {path}",
|
|
204
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
205
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
206
|
+
directoryNotFound: "Directory not found: {path}",
|
|
207
|
+
invalidPath: "{path} is not a valid path",
|
|
208
|
+
operationCanceled: "Operation was canceled",
|
|
209
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
210
|
+
},
|
|
211
|
+
progress: {
|
|
212
|
+
copying: "Copying files...",
|
|
213
|
+
building: "Building project...",
|
|
214
|
+
packaging: "Creating package...",
|
|
215
|
+
validating: "Validating...",
|
|
216
|
+
analyzing: "Analyzing...",
|
|
217
|
+
restoring: "Restoring dependencies..."
|
|
218
|
+
},
|
|
219
|
+
validation: {
|
|
220
|
+
requiredField: "{field} is required",
|
|
221
|
+
invalidValue: "Invalid value for {field}",
|
|
222
|
+
pathNotFound: "Path not found: {path}",
|
|
223
|
+
fileRequired: "File is required: {path}",
|
|
224
|
+
directoryRequired: "Directory is required: {path}"
|
|
225
|
+
},
|
|
226
|
+
warnings: {
|
|
227
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
228
|
+
},
|
|
229
|
+
info: {
|
|
230
|
+
operationComplete: "Operation completed successfully",
|
|
231
|
+
filesProcessed: {
|
|
232
|
+
zero: "No files processed",
|
|
233
|
+
one: "{count} file processed",
|
|
234
|
+
other: "{count} files processed"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var en = {
|
|
240
|
+
toolCore: {
|
|
241
|
+
errors: {
|
|
242
|
+
internal: "Internal error: {message}",
|
|
243
|
+
fileNotFound: "File not found: {path}",
|
|
244
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
245
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
246
|
+
directoryNotFound: "Directory not found: {path}",
|
|
247
|
+
invalidPath: "{path} is not a valid path",
|
|
248
|
+
operationCanceled: "Operation was canceled",
|
|
249
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
250
|
+
},
|
|
251
|
+
progress: {
|
|
252
|
+
copying: "Copying files...",
|
|
253
|
+
building: "Building project...",
|
|
254
|
+
packaging: "Creating package...",
|
|
255
|
+
validating: "Validating...",
|
|
256
|
+
analyzing: "Analyzing...",
|
|
257
|
+
restoring: "Restoring dependencies..."
|
|
258
|
+
},
|
|
259
|
+
validation: {
|
|
260
|
+
requiredField: "{field} is required",
|
|
261
|
+
invalidValue: "Invalid value for {field}",
|
|
262
|
+
pathNotFound: "Path not found: {path}",
|
|
263
|
+
fileRequired: "File is required: {path}",
|
|
264
|
+
directoryRequired: "Directory is required: {path}"
|
|
265
|
+
},
|
|
266
|
+
warnings: {
|
|
267
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
268
|
+
},
|
|
269
|
+
info: {
|
|
270
|
+
operationComplete: "Operation completed successfully",
|
|
271
|
+
filesProcessed: {
|
|
272
|
+
zero: "No files processed",
|
|
273
|
+
one: "{count} file processed",
|
|
274
|
+
other: "{count} files processed"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var es = {
|
|
280
|
+
toolCore: {
|
|
281
|
+
errors: {
|
|
282
|
+
internal: "Internal error: {message}",
|
|
283
|
+
fileNotFound: "File not found: {path}",
|
|
284
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
285
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
286
|
+
directoryNotFound: "Directory not found: {path}",
|
|
287
|
+
invalidPath: "{path} is not a valid path",
|
|
288
|
+
operationCanceled: "Operation was canceled",
|
|
289
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
290
|
+
},
|
|
291
|
+
progress: {
|
|
292
|
+
copying: "Copying files...",
|
|
293
|
+
building: "Building project...",
|
|
294
|
+
packaging: "Creating package...",
|
|
295
|
+
validating: "Validating...",
|
|
296
|
+
analyzing: "Analyzing...",
|
|
297
|
+
restoring: "Restoring dependencies..."
|
|
298
|
+
},
|
|
299
|
+
validation: {
|
|
300
|
+
requiredField: "{field} is required",
|
|
301
|
+
invalidValue: "Invalid value for {field}",
|
|
302
|
+
pathNotFound: "Path not found: {path}",
|
|
303
|
+
fileRequired: "File is required: {path}",
|
|
304
|
+
directoryRequired: "Directory is required: {path}"
|
|
305
|
+
},
|
|
306
|
+
warnings: {
|
|
307
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
308
|
+
},
|
|
309
|
+
info: {
|
|
310
|
+
operationComplete: "Operation completed successfully",
|
|
311
|
+
filesProcessed: {
|
|
312
|
+
zero: "No files processed",
|
|
313
|
+
one: "{count} file processed",
|
|
314
|
+
other: "{count} files processed"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var es_MX = {
|
|
320
|
+
toolCore: {
|
|
321
|
+
errors: {
|
|
322
|
+
internal: "Internal error: {message}",
|
|
323
|
+
fileNotFound: "File not found: {path}",
|
|
324
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
325
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
326
|
+
directoryNotFound: "Directory not found: {path}",
|
|
327
|
+
invalidPath: "{path} is not a valid path",
|
|
328
|
+
operationCanceled: "Operation was canceled",
|
|
329
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
330
|
+
},
|
|
331
|
+
progress: {
|
|
332
|
+
copying: "Copying files...",
|
|
333
|
+
building: "Building project...",
|
|
334
|
+
packaging: "Creating package...",
|
|
335
|
+
validating: "Validating...",
|
|
336
|
+
analyzing: "Analyzing...",
|
|
337
|
+
restoring: "Restoring dependencies..."
|
|
338
|
+
},
|
|
339
|
+
validation: {
|
|
340
|
+
requiredField: "{field} is required",
|
|
341
|
+
invalidValue: "Invalid value for {field}",
|
|
342
|
+
pathNotFound: "Path not found: {path}",
|
|
343
|
+
fileRequired: "File is required: {path}",
|
|
344
|
+
directoryRequired: "Directory is required: {path}"
|
|
345
|
+
},
|
|
346
|
+
warnings: {
|
|
347
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
348
|
+
},
|
|
349
|
+
info: {
|
|
350
|
+
operationComplete: "Operation completed successfully",
|
|
351
|
+
filesProcessed: {
|
|
352
|
+
zero: "No files processed",
|
|
353
|
+
one: "{count} file processed",
|
|
354
|
+
other: "{count} files processed"
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
var fr = {
|
|
360
|
+
toolCore: {
|
|
361
|
+
errors: {
|
|
362
|
+
internal: "Internal error: {message}",
|
|
363
|
+
fileNotFound: "File not found: {path}",
|
|
364
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
365
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
366
|
+
directoryNotFound: "Directory not found: {path}",
|
|
367
|
+
invalidPath: "{path} is not a valid path",
|
|
368
|
+
operationCanceled: "Operation was canceled",
|
|
369
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
370
|
+
},
|
|
371
|
+
progress: {
|
|
372
|
+
copying: "Copying files...",
|
|
373
|
+
building: "Building project...",
|
|
374
|
+
packaging: "Creating package...",
|
|
375
|
+
validating: "Validating...",
|
|
376
|
+
analyzing: "Analyzing...",
|
|
377
|
+
restoring: "Restoring dependencies..."
|
|
378
|
+
},
|
|
379
|
+
validation: {
|
|
380
|
+
requiredField: "{field} is required",
|
|
381
|
+
invalidValue: "Invalid value for {field}",
|
|
382
|
+
pathNotFound: "Path not found: {path}",
|
|
383
|
+
fileRequired: "File is required: {path}",
|
|
384
|
+
directoryRequired: "Directory is required: {path}"
|
|
385
|
+
},
|
|
386
|
+
warnings: {
|
|
387
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
388
|
+
},
|
|
389
|
+
info: {
|
|
390
|
+
operationComplete: "Operation completed successfully",
|
|
391
|
+
filesProcessed: {
|
|
392
|
+
zero: "No files processed",
|
|
393
|
+
one: "{count} file processed",
|
|
394
|
+
other: "{count} files processed"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
var ja = {
|
|
400
|
+
toolCore: {
|
|
401
|
+
errors: {
|
|
402
|
+
internal: "Internal error: {message}",
|
|
403
|
+
fileNotFound: "File not found: {path}",
|
|
404
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
405
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
406
|
+
directoryNotFound: "Directory not found: {path}",
|
|
407
|
+
invalidPath: "{path} is not a valid path",
|
|
408
|
+
operationCanceled: "Operation was canceled",
|
|
409
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
410
|
+
},
|
|
411
|
+
progress: {
|
|
412
|
+
copying: "Copying files...",
|
|
413
|
+
building: "Building project...",
|
|
414
|
+
packaging: "Creating package...",
|
|
415
|
+
validating: "Validating...",
|
|
416
|
+
analyzing: "Analyzing...",
|
|
417
|
+
restoring: "Restoring dependencies..."
|
|
418
|
+
},
|
|
419
|
+
validation: {
|
|
420
|
+
requiredField: "{field} is required",
|
|
421
|
+
invalidValue: "Invalid value for {field}",
|
|
422
|
+
pathNotFound: "Path not found: {path}",
|
|
423
|
+
fileRequired: "File is required: {path}",
|
|
424
|
+
directoryRequired: "Directory is required: {path}"
|
|
425
|
+
},
|
|
426
|
+
warnings: {
|
|
427
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
428
|
+
},
|
|
429
|
+
info: {
|
|
430
|
+
operationComplete: "Operation completed successfully",
|
|
431
|
+
filesProcessed: {
|
|
432
|
+
zero: "No files processed",
|
|
433
|
+
one: "{count} file processed",
|
|
434
|
+
other: "{count} files processed"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var ko = {
|
|
440
|
+
toolCore: {
|
|
441
|
+
errors: {
|
|
442
|
+
internal: "Internal error: {message}",
|
|
443
|
+
fileNotFound: "File not found: {path}",
|
|
444
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
445
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
446
|
+
directoryNotFound: "Directory not found: {path}",
|
|
447
|
+
invalidPath: "{path} is not a valid path",
|
|
448
|
+
operationCanceled: "Operation was canceled",
|
|
449
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
450
|
+
},
|
|
451
|
+
progress: {
|
|
452
|
+
copying: "Copying files...",
|
|
453
|
+
building: "Building project...",
|
|
454
|
+
packaging: "Creating package...",
|
|
455
|
+
validating: "Validating...",
|
|
456
|
+
analyzing: "Analyzing...",
|
|
457
|
+
restoring: "Restoring dependencies..."
|
|
458
|
+
},
|
|
459
|
+
validation: {
|
|
460
|
+
requiredField: "{field} is required",
|
|
461
|
+
invalidValue: "Invalid value for {field}",
|
|
462
|
+
pathNotFound: "Path not found: {path}",
|
|
463
|
+
fileRequired: "File is required: {path}",
|
|
464
|
+
directoryRequired: "Directory is required: {path}"
|
|
465
|
+
},
|
|
466
|
+
warnings: {
|
|
467
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
468
|
+
},
|
|
469
|
+
info: {
|
|
470
|
+
operationComplete: "Operation completed successfully",
|
|
471
|
+
filesProcessed: {
|
|
472
|
+
zero: "No files processed",
|
|
473
|
+
one: "{count} file processed",
|
|
474
|
+
other: "{count} files processed"
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
var pt = {
|
|
480
|
+
toolCore: {
|
|
481
|
+
errors: {
|
|
482
|
+
internal: "Internal error: {message}",
|
|
483
|
+
fileNotFound: "File not found: {path}",
|
|
484
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
485
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
486
|
+
directoryNotFound: "Directory not found: {path}",
|
|
487
|
+
invalidPath: "{path} is not a valid path",
|
|
488
|
+
operationCanceled: "Operation was canceled",
|
|
489
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
490
|
+
},
|
|
491
|
+
progress: {
|
|
492
|
+
copying: "Copying files...",
|
|
493
|
+
building: "Building project...",
|
|
494
|
+
packaging: "Creating package...",
|
|
495
|
+
validating: "Validating...",
|
|
496
|
+
analyzing: "Analyzing...",
|
|
497
|
+
restoring: "Restoring dependencies..."
|
|
498
|
+
},
|
|
499
|
+
validation: {
|
|
500
|
+
requiredField: "{field} is required",
|
|
501
|
+
invalidValue: "Invalid value for {field}",
|
|
502
|
+
pathNotFound: "Path not found: {path}",
|
|
503
|
+
fileRequired: "File is required: {path}",
|
|
504
|
+
directoryRequired: "Directory is required: {path}"
|
|
505
|
+
},
|
|
506
|
+
warnings: {
|
|
507
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
508
|
+
},
|
|
509
|
+
info: {
|
|
510
|
+
operationComplete: "Operation completed successfully",
|
|
511
|
+
filesProcessed: {
|
|
512
|
+
zero: "No files processed",
|
|
513
|
+
one: "{count} file processed",
|
|
514
|
+
other: "{count} files processed"
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
var pt_BR = {
|
|
520
|
+
toolCore: {
|
|
521
|
+
errors: {
|
|
522
|
+
internal: "Internal error: {message}",
|
|
523
|
+
fileNotFound: "File not found: {path}",
|
|
524
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
525
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
526
|
+
directoryNotFound: "Directory not found: {path}",
|
|
527
|
+
invalidPath: "{path} is not a valid path",
|
|
528
|
+
operationCanceled: "Operation was canceled",
|
|
529
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
530
|
+
},
|
|
531
|
+
progress: {
|
|
532
|
+
copying: "Copying files...",
|
|
533
|
+
building: "Building project...",
|
|
534
|
+
packaging: "Creating package...",
|
|
535
|
+
validating: "Validating...",
|
|
536
|
+
analyzing: "Analyzing...",
|
|
537
|
+
restoring: "Restoring dependencies..."
|
|
538
|
+
},
|
|
539
|
+
validation: {
|
|
540
|
+
requiredField: "{field} is required",
|
|
541
|
+
invalidValue: "Invalid value for {field}",
|
|
542
|
+
pathNotFound: "Path not found: {path}",
|
|
543
|
+
fileRequired: "File is required: {path}",
|
|
544
|
+
directoryRequired: "Directory is required: {path}"
|
|
545
|
+
},
|
|
546
|
+
warnings: {
|
|
547
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
548
|
+
},
|
|
549
|
+
info: {
|
|
550
|
+
operationComplete: "Operation completed successfully",
|
|
551
|
+
filesProcessed: {
|
|
552
|
+
zero: "No files processed",
|
|
553
|
+
one: "{count} file processed",
|
|
554
|
+
other: "{count} files processed"
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
var ro = {
|
|
560
|
+
toolCore: {
|
|
561
|
+
errors: {
|
|
562
|
+
internal: "Internal error: {message}",
|
|
563
|
+
fileNotFound: "File not found: {path}",
|
|
564
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
565
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
566
|
+
directoryNotFound: "Directory not found: {path}",
|
|
567
|
+
invalidPath: "{path} is not a valid path",
|
|
568
|
+
operationCanceled: "Operation was canceled",
|
|
569
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
570
|
+
},
|
|
571
|
+
progress: {
|
|
572
|
+
copying: "Copying files...",
|
|
573
|
+
building: "Building project...",
|
|
574
|
+
packaging: "Creating package...",
|
|
575
|
+
validating: "Validating...",
|
|
576
|
+
analyzing: "Analyzing...",
|
|
577
|
+
restoring: "Restoring dependencies..."
|
|
578
|
+
},
|
|
579
|
+
validation: {
|
|
580
|
+
requiredField: "{field} is required",
|
|
581
|
+
invalidValue: "Invalid value for {field}",
|
|
582
|
+
pathNotFound: "Path not found: {path}",
|
|
583
|
+
fileRequired: "File is required: {path}",
|
|
584
|
+
directoryRequired: "Directory is required: {path}"
|
|
585
|
+
},
|
|
586
|
+
warnings: {
|
|
587
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
588
|
+
},
|
|
589
|
+
info: {
|
|
590
|
+
operationComplete: "Operation completed successfully",
|
|
591
|
+
filesProcessed: {
|
|
592
|
+
zero: "No files processed",
|
|
593
|
+
one: "{count} file processed",
|
|
594
|
+
other: "{count} files processed"
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
var ru = {
|
|
600
|
+
toolCore: {
|
|
601
|
+
errors: {
|
|
602
|
+
internal: "Internal error: {message}",
|
|
603
|
+
fileNotFound: "File not found: {path}",
|
|
604
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
605
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
606
|
+
directoryNotFound: "Directory not found: {path}",
|
|
607
|
+
invalidPath: "{path} is not a valid path",
|
|
608
|
+
operationCanceled: "Operation was canceled",
|
|
609
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
610
|
+
},
|
|
611
|
+
progress: {
|
|
612
|
+
copying: "Copying files...",
|
|
613
|
+
building: "Building project...",
|
|
614
|
+
packaging: "Creating package...",
|
|
615
|
+
validating: "Validating...",
|
|
616
|
+
analyzing: "Analyzing...",
|
|
617
|
+
restoring: "Restoring dependencies..."
|
|
618
|
+
},
|
|
619
|
+
validation: {
|
|
620
|
+
requiredField: "{field} is required",
|
|
621
|
+
invalidValue: "Invalid value for {field}",
|
|
622
|
+
pathNotFound: "Path not found: {path}",
|
|
623
|
+
fileRequired: "File is required: {path}",
|
|
624
|
+
directoryRequired: "Directory is required: {path}"
|
|
625
|
+
},
|
|
626
|
+
warnings: {
|
|
627
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
628
|
+
},
|
|
629
|
+
info: {
|
|
630
|
+
operationComplete: "Operation completed successfully",
|
|
631
|
+
filesProcessed: {
|
|
632
|
+
zero: "No files processed",
|
|
633
|
+
one: "{count} file processed",
|
|
634
|
+
other: "{count} files processed"
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
var tr = {
|
|
640
|
+
toolCore: {
|
|
641
|
+
errors: {
|
|
642
|
+
internal: "Internal error: {message}",
|
|
643
|
+
fileNotFound: "File not found: {path}",
|
|
644
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
645
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
646
|
+
directoryNotFound: "Directory not found: {path}",
|
|
647
|
+
invalidPath: "{path} is not a valid path",
|
|
648
|
+
operationCanceled: "Operation was canceled",
|
|
649
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
650
|
+
},
|
|
651
|
+
progress: {
|
|
652
|
+
copying: "Copying files...",
|
|
653
|
+
building: "Building project...",
|
|
654
|
+
packaging: "Creating package...",
|
|
655
|
+
validating: "Validating...",
|
|
656
|
+
analyzing: "Analyzing...",
|
|
657
|
+
restoring: "Restoring dependencies..."
|
|
658
|
+
},
|
|
659
|
+
validation: {
|
|
660
|
+
requiredField: "{field} is required",
|
|
661
|
+
invalidValue: "Invalid value for {field}",
|
|
662
|
+
pathNotFound: "Path not found: {path}",
|
|
663
|
+
fileRequired: "File is required: {path}",
|
|
664
|
+
directoryRequired: "Directory is required: {path}"
|
|
665
|
+
},
|
|
666
|
+
warnings: {
|
|
667
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
668
|
+
},
|
|
669
|
+
info: {
|
|
670
|
+
operationComplete: "Operation completed successfully",
|
|
671
|
+
filesProcessed: {
|
|
672
|
+
zero: "No files processed",
|
|
673
|
+
one: "{count} file processed",
|
|
674
|
+
other: "{count} files processed"
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
var zh_CN = {
|
|
680
|
+
toolCore: {
|
|
681
|
+
errors: {
|
|
682
|
+
internal: "Internal error: {message}",
|
|
683
|
+
fileNotFound: "File not found: {path}",
|
|
684
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
685
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
686
|
+
directoryNotFound: "Directory not found: {path}",
|
|
687
|
+
invalidPath: "{path} is not a valid path",
|
|
688
|
+
operationCanceled: "Operation was canceled",
|
|
689
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
690
|
+
},
|
|
691
|
+
progress: {
|
|
692
|
+
copying: "Copying files...",
|
|
693
|
+
building: "Building project...",
|
|
694
|
+
packaging: "Creating package...",
|
|
695
|
+
validating: "Validating...",
|
|
696
|
+
analyzing: "Analyzing...",
|
|
697
|
+
restoring: "Restoring dependencies..."
|
|
698
|
+
},
|
|
699
|
+
validation: {
|
|
700
|
+
requiredField: "{field} is required",
|
|
701
|
+
invalidValue: "Invalid value for {field}",
|
|
702
|
+
pathNotFound: "Path not found: {path}",
|
|
703
|
+
fileRequired: "File is required: {path}",
|
|
704
|
+
directoryRequired: "Directory is required: {path}"
|
|
705
|
+
},
|
|
706
|
+
warnings: {
|
|
707
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
708
|
+
},
|
|
709
|
+
info: {
|
|
710
|
+
operationComplete: "Operation completed successfully",
|
|
711
|
+
filesProcessed: {
|
|
712
|
+
zero: "No files processed",
|
|
713
|
+
one: "{count} file processed",
|
|
714
|
+
other: "{count} files processed"
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
var zh_TW = {
|
|
720
|
+
toolCore: {
|
|
721
|
+
errors: {
|
|
722
|
+
internal: "Internal error: {message}",
|
|
723
|
+
fileNotFound: "File not found: {path}",
|
|
724
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
725
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
726
|
+
directoryNotFound: "Directory not found: {path}",
|
|
727
|
+
invalidPath: "{path} is not a valid path",
|
|
728
|
+
operationCanceled: "Operation was canceled",
|
|
729
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
730
|
+
},
|
|
731
|
+
progress: {
|
|
732
|
+
copying: "Copying files...",
|
|
733
|
+
building: "Building project...",
|
|
734
|
+
packaging: "Creating package...",
|
|
735
|
+
validating: "Validating...",
|
|
736
|
+
analyzing: "Analyzing...",
|
|
737
|
+
restoring: "Restoring dependencies..."
|
|
738
|
+
},
|
|
739
|
+
validation: {
|
|
740
|
+
requiredField: "{field} is required",
|
|
741
|
+
invalidValue: "Invalid value for {field}",
|
|
742
|
+
pathNotFound: "Path not found: {path}",
|
|
743
|
+
fileRequired: "File is required: {path}",
|
|
744
|
+
directoryRequired: "Directory is required: {path}"
|
|
745
|
+
},
|
|
746
|
+
warnings: {
|
|
747
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
748
|
+
},
|
|
749
|
+
info: {
|
|
750
|
+
operationComplete: "Operation completed successfully",
|
|
751
|
+
filesProcessed: {
|
|
752
|
+
zero: "No files processed",
|
|
753
|
+
one: "{count} file processed",
|
|
754
|
+
other: "{count} files processed"
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
var zu = {
|
|
760
|
+
toolCore: {
|
|
761
|
+
errors: {
|
|
762
|
+
internal: "Internal error: {message}",
|
|
763
|
+
fileNotFound: "File not found: {path}",
|
|
764
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
765
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
766
|
+
directoryNotFound: "Directory not found: {path}",
|
|
767
|
+
invalidPath: "{path} is not a valid path",
|
|
768
|
+
operationCanceled: "Operation was canceled",
|
|
769
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
770
|
+
},
|
|
771
|
+
progress: {
|
|
772
|
+
copying: "Copying files...",
|
|
773
|
+
building: "Building project...",
|
|
774
|
+
packaging: "Creating package...",
|
|
775
|
+
validating: "Validating...",
|
|
776
|
+
analyzing: "Analyzing...",
|
|
777
|
+
restoring: "Restoring dependencies..."
|
|
778
|
+
},
|
|
779
|
+
validation: {
|
|
780
|
+
requiredField: "{field} is required",
|
|
781
|
+
invalidValue: "Invalid value for {field}",
|
|
782
|
+
pathNotFound: "Path not found: {path}",
|
|
783
|
+
fileRequired: "File is required: {path}",
|
|
784
|
+
directoryRequired: "Directory is required: {path}"
|
|
785
|
+
},
|
|
786
|
+
warnings: {
|
|
787
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
788
|
+
},
|
|
789
|
+
info: {
|
|
790
|
+
operationComplete: "Operation completed successfully",
|
|
791
|
+
filesProcessed: {
|
|
792
|
+
zero: "No files processed",
|
|
793
|
+
one: "{count} file processed",
|
|
794
|
+
other: "{count} files processed"
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
class TranslationService {
|
|
801
|
+
static instance;
|
|
802
|
+
currentLocale = "en";
|
|
803
|
+
constructor() {}
|
|
804
|
+
static getInstance() {
|
|
805
|
+
if (!TranslationService.instance) {
|
|
806
|
+
TranslationService.instance = new TranslationService;
|
|
807
|
+
}
|
|
808
|
+
return TranslationService.instance;
|
|
809
|
+
}
|
|
810
|
+
setLocale(locale) {
|
|
811
|
+
this.currentLocale = I18nManager.setLocale(locale);
|
|
812
|
+
}
|
|
813
|
+
getLocale() {
|
|
814
|
+
return this.currentLocale;
|
|
815
|
+
}
|
|
816
|
+
t(key, params) {
|
|
817
|
+
return I18nManager.t(key, params, this.currentLocale);
|
|
818
|
+
}
|
|
819
|
+
tLocale(key, locale, params) {
|
|
820
|
+
return I18nManager.t(key, params, locale);
|
|
821
|
+
}
|
|
822
|
+
has(key) {
|
|
823
|
+
return I18nManager.has(key, this.currentLocale);
|
|
824
|
+
}
|
|
825
|
+
getAvailableLocales() {
|
|
826
|
+
return I18nManager.getAvailableLocales();
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
var translate = TranslationService.getInstance();
|
|
830
|
+
I18nManager.registerTranslations("en", en);
|
|
831
|
+
I18nManager.registerTranslations("de", de);
|
|
832
|
+
I18nManager.registerTranslations("es", es);
|
|
833
|
+
I18nManager.registerTranslations("es-mx", es_MX);
|
|
834
|
+
I18nManager.registerTranslations("fr", fr);
|
|
835
|
+
I18nManager.registerTranslations("ja", ja);
|
|
836
|
+
I18nManager.registerTranslations("ko", ko);
|
|
837
|
+
I18nManager.registerTranslations("pt", pt);
|
|
838
|
+
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
839
|
+
I18nManager.registerTranslations("ro", ro);
|
|
840
|
+
I18nManager.registerTranslations("ru", ru);
|
|
841
|
+
I18nManager.registerTranslations("tr", tr);
|
|
842
|
+
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
843
|
+
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
844
|
+
I18nManager.registerTranslations("zu", zu);
|
|
845
|
+
I18nManager.setLocale("en");
|
|
846
|
+
var BuildConfiguration;
|
|
847
|
+
((BuildConfiguration2) => {
|
|
848
|
+
BuildConfiguration2["Debug"] = "Debug";
|
|
849
|
+
BuildConfiguration2["Release"] = "Release";
|
|
850
|
+
})(BuildConfiguration ||= {});
|
|
851
|
+
var LogLevel;
|
|
852
|
+
((LogLevel2) => {
|
|
853
|
+
LogLevel2["Debug"] = "Debug";
|
|
854
|
+
LogLevel2["Info"] = "Information";
|
|
855
|
+
LogLevel2["Warn"] = "Warning";
|
|
856
|
+
LogLevel2["Error"] = "Error";
|
|
857
|
+
})(LogLevel ||= {});
|
|
858
|
+
var PackJobTargetKind;
|
|
859
|
+
((PackJobTargetKind2) => {
|
|
860
|
+
PackJobTargetKind2["Serverless"] = "Serverless";
|
|
861
|
+
PackJobTargetKind2["LocalRobot"] = "LocalRobot";
|
|
862
|
+
})(PackJobTargetKind ||= {});
|
|
863
|
+
var ProjectTypes;
|
|
864
|
+
((ProjectTypes2) => {
|
|
865
|
+
ProjectTypes2["Agent"] = "Agent";
|
|
866
|
+
ProjectTypes2["Api"] = "Api";
|
|
867
|
+
ProjectTypes2["BusinessRules"] = "BusinessRules";
|
|
868
|
+
ProjectTypes2["Connector"] = "Connector";
|
|
869
|
+
ProjectTypes2["CaseManagement"] = "CaseManagement";
|
|
870
|
+
ProjectTypes2["Flow"] = "Flow";
|
|
871
|
+
ProjectTypes2["Function"] = "Function";
|
|
872
|
+
ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
|
|
873
|
+
ProjectTypes2["Process"] = "Process";
|
|
874
|
+
ProjectTypes2["Library"] = "Library";
|
|
875
|
+
ProjectTypes2["WebApp"] = "WebApp";
|
|
876
|
+
ProjectTypes2["Tests"] = "Tests";
|
|
877
|
+
ProjectTypes2["AppV2"] = "AppV2";
|
|
878
|
+
})(ProjectTypes ||= {});
|
|
879
|
+
var TargetFramework;
|
|
880
|
+
((TargetFramework2) => {
|
|
881
|
+
TargetFramework2["Portable"] = "Portable";
|
|
882
|
+
TargetFramework2["Windows"] = "Windows";
|
|
883
|
+
})(TargetFramework ||= {});
|
|
884
|
+
var ToolErrorCodes;
|
|
885
|
+
((ToolErrorCodes2) => {
|
|
886
|
+
ToolErrorCodes2["Success"] = "SUCCESS";
|
|
887
|
+
ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
|
|
888
|
+
ToolErrorCodes2["Canceled"] = "CANCELED";
|
|
889
|
+
})(ToolErrorCodes ||= {});
|
|
890
|
+
|
|
891
|
+
class ToolResult {
|
|
892
|
+
errorCode;
|
|
893
|
+
message;
|
|
894
|
+
packages;
|
|
895
|
+
details;
|
|
896
|
+
instructions;
|
|
897
|
+
constructor(errorCode, message, packages = [], instructions) {
|
|
898
|
+
this.errorCode = errorCode;
|
|
899
|
+
this.message = message;
|
|
900
|
+
this.packages = packages;
|
|
901
|
+
this.instructions = instructions;
|
|
902
|
+
}
|
|
903
|
+
get isSuccess() {
|
|
904
|
+
return this.errorCode === "SUCCESS";
|
|
905
|
+
}
|
|
906
|
+
static success() {
|
|
907
|
+
return new ToolResult("SUCCESS");
|
|
908
|
+
}
|
|
909
|
+
static error(errorCode, message, instructions) {
|
|
910
|
+
return new ToolResult(errorCode, message, [], instructions);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
class ProjectTool {
|
|
914
|
+
fileSystem;
|
|
915
|
+
logger;
|
|
916
|
+
static ProjectFileName = "project.uiproj";
|
|
917
|
+
constructor(fileSystem, logger) {
|
|
918
|
+
this.fileSystem = fileSystem;
|
|
919
|
+
this.logger = logger;
|
|
920
|
+
}
|
|
921
|
+
async restoreAsync(_options, _cancellationToken) {
|
|
922
|
+
this.logger.info("Restore operation is a noop");
|
|
923
|
+
return ToolResult.success();
|
|
924
|
+
}
|
|
925
|
+
async validateAsync(_options, _cancellationToken) {
|
|
926
|
+
this.logger.info("Validate operation is a noop");
|
|
927
|
+
return ToolResult.success();
|
|
928
|
+
}
|
|
929
|
+
async buildAsync(_options, _cancellationToken) {
|
|
930
|
+
this.logger.info("Build operation is a noop");
|
|
931
|
+
return ToolResult.success();
|
|
932
|
+
}
|
|
933
|
+
async packAsync(_options, _cancellationToken) {
|
|
934
|
+
this.logger.info("Pack operation is a noop");
|
|
935
|
+
return ToolResult.success();
|
|
936
|
+
}
|
|
937
|
+
async cleanupAsync(_options, _cancellationToken) {
|
|
938
|
+
this.logger.info("Cleanup operation is a noop");
|
|
939
|
+
return ToolResult.success();
|
|
940
|
+
}
|
|
941
|
+
async getUiProjectAsync(projectPath) {
|
|
942
|
+
const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
|
|
943
|
+
if (!await this.fileSystem.exists(filePath)) {
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
const raw = await this.fileSystem.readFile(filePath);
|
|
947
|
+
if (!raw) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
|
|
951
|
+
return JSON.parse(json);
|
|
952
|
+
}
|
|
953
|
+
async dispose() {}
|
|
954
|
+
}
|
|
955
|
+
class ToolsFactoryRepository {
|
|
956
|
+
projectFactoryMap = new Map;
|
|
957
|
+
solutionFactory = null;
|
|
958
|
+
registerProjectToolFactory(factory) {
|
|
959
|
+
for (const type of factory.supportedTypes) {
|
|
960
|
+
const existing = this.projectFactoryMap.get(type);
|
|
961
|
+
if (existing) {
|
|
962
|
+
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
963
|
+
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
964
|
+
}
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
this.projectFactoryMap.set(type, factory);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
registerSolutionToolFactory(factory) {
|
|
971
|
+
this.solutionFactory = factory;
|
|
972
|
+
}
|
|
973
|
+
getSolutionToolFactory() {
|
|
974
|
+
if (!this.solutionFactory) {
|
|
975
|
+
throw new Error("No solution tool factory is registered");
|
|
976
|
+
}
|
|
977
|
+
return this.solutionFactory;
|
|
978
|
+
}
|
|
979
|
+
canHandleProject(projectType) {
|
|
980
|
+
return this.projectFactoryMap.has(projectType);
|
|
981
|
+
}
|
|
982
|
+
getProjectToolFactory(projectType) {
|
|
983
|
+
const factory = this.projectFactoryMap.get(projectType);
|
|
984
|
+
if (!factory) {
|
|
985
|
+
const known = [...this.projectFactoryMap.keys()].join(", ");
|
|
986
|
+
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it. ` + `Project types that can be packed: ${known || "none"}.`);
|
|
987
|
+
}
|
|
988
|
+
return factory;
|
|
989
|
+
}
|
|
990
|
+
reset() {
|
|
991
|
+
this.projectFactoryMap.clear();
|
|
992
|
+
this.solutionFactory = null;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
996
|
+
var _global = globalThis;
|
|
997
|
+
if (!_global[REGISTRY_KEY]) {
|
|
998
|
+
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
999
|
+
}
|
|
1000
|
+
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
1001
|
+
|
|
1002
|
+
// ../packager/packager-tool-datafabric/dist/index.js
|
|
1003
|
+
var RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
|
|
1004
|
+
var RESERVED_FIELD_NAMES_LOWER = new Set([
|
|
1005
|
+
"id",
|
|
1006
|
+
"createdby",
|
|
1007
|
+
"createtime",
|
|
1008
|
+
"updatedby",
|
|
1009
|
+
"updatetime",
|
|
1010
|
+
"recordowner",
|
|
1011
|
+
"version"
|
|
1012
|
+
]);
|
|
1013
|
+
var RESERVED_KEYWORDS_LOWER = new Set([
|
|
1014
|
+
"abstract",
|
|
1015
|
+
"as",
|
|
1016
|
+
"base",
|
|
1017
|
+
"bool",
|
|
1018
|
+
"break",
|
|
1019
|
+
"byte",
|
|
1020
|
+
"case",
|
|
1021
|
+
"catch",
|
|
1022
|
+
"char",
|
|
1023
|
+
"checked",
|
|
1024
|
+
"class",
|
|
1025
|
+
"const",
|
|
1026
|
+
"continue",
|
|
1027
|
+
"decimal",
|
|
1028
|
+
"default",
|
|
1029
|
+
"delegate",
|
|
1030
|
+
"do",
|
|
1031
|
+
"double",
|
|
1032
|
+
"else",
|
|
1033
|
+
"enum",
|
|
1034
|
+
"event",
|
|
1035
|
+
"explicit",
|
|
1036
|
+
"extern",
|
|
1037
|
+
"false",
|
|
1038
|
+
"finally",
|
|
1039
|
+
"fixed",
|
|
1040
|
+
"float",
|
|
1041
|
+
"for",
|
|
1042
|
+
"foreach",
|
|
1043
|
+
"goto",
|
|
1044
|
+
"if",
|
|
1045
|
+
"implicit",
|
|
1046
|
+
"in",
|
|
1047
|
+
"int",
|
|
1048
|
+
"interface",
|
|
1049
|
+
"internal",
|
|
1050
|
+
"is",
|
|
1051
|
+
"lock",
|
|
1052
|
+
"long",
|
|
1053
|
+
"namespace",
|
|
1054
|
+
"new",
|
|
1055
|
+
"null",
|
|
1056
|
+
"object",
|
|
1057
|
+
"operator",
|
|
1058
|
+
"out",
|
|
1059
|
+
"override",
|
|
1060
|
+
"params",
|
|
1061
|
+
"private",
|
|
1062
|
+
"protected",
|
|
1063
|
+
"public",
|
|
1064
|
+
"readonly",
|
|
1065
|
+
"ref",
|
|
1066
|
+
"return",
|
|
1067
|
+
"sbyte",
|
|
1068
|
+
"sealed",
|
|
1069
|
+
"short",
|
|
1070
|
+
"sizeof",
|
|
1071
|
+
"stackalloc",
|
|
1072
|
+
"static",
|
|
1073
|
+
"string",
|
|
1074
|
+
"struct",
|
|
1075
|
+
"switch",
|
|
1076
|
+
"this",
|
|
1077
|
+
"throw",
|
|
1078
|
+
"true",
|
|
1079
|
+
"try",
|
|
1080
|
+
"typeof",
|
|
1081
|
+
"uint",
|
|
1082
|
+
"ulong",
|
|
1083
|
+
"unchecked",
|
|
1084
|
+
"unsafe",
|
|
1085
|
+
"ushort",
|
|
1086
|
+
"using",
|
|
1087
|
+
"virtual",
|
|
1088
|
+
"void",
|
|
1089
|
+
"volatile",
|
|
1090
|
+
"while",
|
|
1091
|
+
"addhandler",
|
|
1092
|
+
"addressof",
|
|
1093
|
+
"alias",
|
|
1094
|
+
"and",
|
|
1095
|
+
"andalso",
|
|
1096
|
+
"boolean",
|
|
1097
|
+
"byref",
|
|
1098
|
+
"byval",
|
|
1099
|
+
"call",
|
|
1100
|
+
"cbool",
|
|
1101
|
+
"cbyte",
|
|
1102
|
+
"cchar",
|
|
1103
|
+
"cdate",
|
|
1104
|
+
"cdbl",
|
|
1105
|
+
"cdec",
|
|
1106
|
+
"cint",
|
|
1107
|
+
"clng",
|
|
1108
|
+
"cobj",
|
|
1109
|
+
"csbyte",
|
|
1110
|
+
"cshort",
|
|
1111
|
+
"csng",
|
|
1112
|
+
"cstr",
|
|
1113
|
+
"ctype",
|
|
1114
|
+
"cuint",
|
|
1115
|
+
"culng",
|
|
1116
|
+
"cushort",
|
|
1117
|
+
"date",
|
|
1118
|
+
"declare",
|
|
1119
|
+
"dim",
|
|
1120
|
+
"directcast",
|
|
1121
|
+
"each",
|
|
1122
|
+
"elseif",
|
|
1123
|
+
"end",
|
|
1124
|
+
"endif",
|
|
1125
|
+
"erase",
|
|
1126
|
+
"error",
|
|
1127
|
+
"exit",
|
|
1128
|
+
"friend",
|
|
1129
|
+
"function",
|
|
1130
|
+
"get",
|
|
1131
|
+
"gettype",
|
|
1132
|
+
"getxmlnamespace",
|
|
1133
|
+
"global",
|
|
1134
|
+
"gosub",
|
|
1135
|
+
"goto",
|
|
1136
|
+
"handles",
|
|
1137
|
+
"implements",
|
|
1138
|
+
"imports",
|
|
1139
|
+
"inherits",
|
|
1140
|
+
"integer",
|
|
1141
|
+
"isnot",
|
|
1142
|
+
"let",
|
|
1143
|
+
"lib",
|
|
1144
|
+
"like",
|
|
1145
|
+
"loop",
|
|
1146
|
+
"me",
|
|
1147
|
+
"mod",
|
|
1148
|
+
"module",
|
|
1149
|
+
"mustinherit",
|
|
1150
|
+
"mustoverride",
|
|
1151
|
+
"mybase",
|
|
1152
|
+
"myclass",
|
|
1153
|
+
"narrowing",
|
|
1154
|
+
"next",
|
|
1155
|
+
"not",
|
|
1156
|
+
"nothing",
|
|
1157
|
+
"notinheritable",
|
|
1158
|
+
"notoverridable",
|
|
1159
|
+
"of",
|
|
1160
|
+
"on",
|
|
1161
|
+
"option",
|
|
1162
|
+
"optional",
|
|
1163
|
+
"or",
|
|
1164
|
+
"orelse",
|
|
1165
|
+
"overloads",
|
|
1166
|
+
"overridable",
|
|
1167
|
+
"overrides",
|
|
1168
|
+
"paramarray",
|
|
1169
|
+
"partial",
|
|
1170
|
+
"property",
|
|
1171
|
+
"raiseevent",
|
|
1172
|
+
"redim",
|
|
1173
|
+
"rem",
|
|
1174
|
+
"removehandler",
|
|
1175
|
+
"resume",
|
|
1176
|
+
"select",
|
|
1177
|
+
"set",
|
|
1178
|
+
"shadows",
|
|
1179
|
+
"shared",
|
|
1180
|
+
"single",
|
|
1181
|
+
"step",
|
|
1182
|
+
"stop",
|
|
1183
|
+
"structure",
|
|
1184
|
+
"sub",
|
|
1185
|
+
"synclock",
|
|
1186
|
+
"then",
|
|
1187
|
+
"to",
|
|
1188
|
+
"trycast",
|
|
1189
|
+
"uinteger",
|
|
1190
|
+
"ushort",
|
|
1191
|
+
"variant",
|
|
1192
|
+
"wend",
|
|
1193
|
+
"when",
|
|
1194
|
+
"widening",
|
|
1195
|
+
"with",
|
|
1196
|
+
"withevents",
|
|
1197
|
+
"writeonly",
|
|
1198
|
+
"xor"
|
|
1199
|
+
]);
|
|
1200
|
+
function findReservedNameError(name, kind) {
|
|
1201
|
+
if (kind === "field" && RESERVED_FIELD_NAMES_LOWER.has(name.toLowerCase())) {
|
|
1202
|
+
return {
|
|
1203
|
+
message: `Field name '${name}' is reserved`,
|
|
1204
|
+
instructions: "The following field names are reserved by the platform (case-insensitive): Id, CreatedBy, CreateTime, UpdatedBy, UpdateTime, RecordOwner, Version. Pick a different name."
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
if (RESERVED_KEYWORDS_LOWER.has(name.toLowerCase())) {
|
|
1208
|
+
return {
|
|
1209
|
+
message: `${kind === "entity" ? "Entity" : kind === "field" ? "Field" : "Choice set"} name '${name}' is a reserved C# or VB keyword`,
|
|
1210
|
+
instructions: "Reserved keywords are rejected with RESERVED_LANGUAGE_KEYWORDS. Pick a domain-specific rename, for example 'Case' -> 'WorkItem', 'Class' -> 'Category', 'New' -> 'IsNew'."
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
if (kind === "entity" && RESERVED_SQL_KEYWORDS_LOWER.has(name.toLowerCase())) {
|
|
1214
|
+
return {
|
|
1215
|
+
message: `Entity name '${name}' is a reserved SQL keyword`,
|
|
1216
|
+
instructions: "The platform rejects 'Order' and 'Group' as entity names. Pick a domain-specific name such as 'PurchaseOrder' or 'TeamGroup'."
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
return null;
|
|
1220
|
+
}
|
|
1221
|
+
var SqlTypeName = {
|
|
1222
|
+
UNIQUEIDENTIFIER: "UNIQUEIDENTIFIER",
|
|
1223
|
+
NVARCHAR: "NVARCHAR",
|
|
1224
|
+
INT: "INT",
|
|
1225
|
+
DATETIME2: "DATETIME2",
|
|
1226
|
+
DATETIMEOFFSET: "DATETIMEOFFSET",
|
|
1227
|
+
FLOAT: "FLOAT",
|
|
1228
|
+
REAL: "REAL",
|
|
1229
|
+
BIGINT: "BIGINT",
|
|
1230
|
+
DATE: "DATE",
|
|
1231
|
+
BIT: "BIT",
|
|
1232
|
+
DECIMAL: "DECIMAL",
|
|
1233
|
+
MULTILINE: "MULTILINE",
|
|
1234
|
+
MULTILINE_MAX: "MULTILINE_MAX",
|
|
1235
|
+
UNKNOWN: "UNKNOWN"
|
|
1236
|
+
};
|
|
1237
|
+
var FieldDisplayType = {
|
|
1238
|
+
Basic: "Basic",
|
|
1239
|
+
Relationship: "Relationship",
|
|
1240
|
+
File: "File",
|
|
1241
|
+
ChoiceSetSingle: "ChoiceSetSingle",
|
|
1242
|
+
ChoiceSetMultiple: "ChoiceSetMultiple",
|
|
1243
|
+
AutoNumber: "AutoNumber",
|
|
1244
|
+
MultiLineText: "MultiLineText"
|
|
1245
|
+
};
|
|
1246
|
+
var NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9]{2,99}$/;
|
|
1247
|
+
var GA_TYPE_PAIRS = [
|
|
1248
|
+
[FieldDisplayType.Basic, SqlTypeName.NVARCHAR],
|
|
1249
|
+
[FieldDisplayType.Basic, SqlTypeName.DECIMAL],
|
|
1250
|
+
[FieldDisplayType.Basic, SqlTypeName.FLOAT],
|
|
1251
|
+
[FieldDisplayType.Basic, SqlTypeName.BIT],
|
|
1252
|
+
[FieldDisplayType.Basic, SqlTypeName.DATE],
|
|
1253
|
+
[FieldDisplayType.Basic, SqlTypeName.DATETIMEOFFSET],
|
|
1254
|
+
[FieldDisplayType.Basic, SqlTypeName.UNIQUEIDENTIFIER],
|
|
1255
|
+
[FieldDisplayType.AutoNumber, SqlTypeName.DECIMAL],
|
|
1256
|
+
[FieldDisplayType.Basic, SqlTypeName.MULTILINE],
|
|
1257
|
+
[FieldDisplayType.Basic, SqlTypeName.MULTILINE_MAX],
|
|
1258
|
+
[FieldDisplayType.File, SqlTypeName.UNIQUEIDENTIFIER]
|
|
1259
|
+
];
|
|
1260
|
+
var ALLOWED_TYPE_PAIRS = new Set(GA_TYPE_PAIRS.map(([display, sql]) => `${display}:${sql}`));
|
|
1261
|
+
var SYSTEM_FIELD_DEFAULTS = {
|
|
1262
|
+
IsPrimaryKey: false,
|
|
1263
|
+
IsForeignKey: false,
|
|
1264
|
+
IsExternalField: false,
|
|
1265
|
+
IsHiddenField: true,
|
|
1266
|
+
FieldCategoryId: 0,
|
|
1267
|
+
IsUnique: false,
|
|
1268
|
+
ReferenceType: "ManyToOne",
|
|
1269
|
+
Transformation: null,
|
|
1270
|
+
IsRequired: false,
|
|
1271
|
+
IsEncrypted: false,
|
|
1272
|
+
Description: "",
|
|
1273
|
+
IsSystemField: true,
|
|
1274
|
+
FieldDisplayType: FieldDisplayType.Basic,
|
|
1275
|
+
IsAttachment: false,
|
|
1276
|
+
IsRbacEnabled: false,
|
|
1277
|
+
IsModelReserved: false
|
|
1278
|
+
};
|
|
1279
|
+
var SYSTEM_FIELD_TEMPLATES = [
|
|
1280
|
+
{
|
|
1281
|
+
...SYSTEM_FIELD_DEFAULTS,
|
|
1282
|
+
Name: "Id",
|
|
1283
|
+
DisplayName: "Id",
|
|
1284
|
+
IsPrimaryKey: true,
|
|
1285
|
+
SqlType: { Name: SqlTypeName.UNIQUEIDENTIFIER }
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
...SYSTEM_FIELD_DEFAULTS,
|
|
1289
|
+
Name: "CreateTime",
|
|
1290
|
+
DisplayName: "CreateTime",
|
|
1291
|
+
SqlType: { Name: SqlTypeName.DATETIMEOFFSET }
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
...SYSTEM_FIELD_DEFAULTS,
|
|
1295
|
+
Name: "CreatedBy",
|
|
1296
|
+
DisplayName: "CreatedBy",
|
|
1297
|
+
FieldDisplayType: FieldDisplayType.Relationship,
|
|
1298
|
+
SqlType: { Name: SqlTypeName.UNIQUEIDENTIFIER }
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
...SYSTEM_FIELD_DEFAULTS,
|
|
1302
|
+
Name: "UpdateTime",
|
|
1303
|
+
DisplayName: "UpdateTime",
|
|
1304
|
+
SqlType: { Name: SqlTypeName.DATETIMEOFFSET }
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
...SYSTEM_FIELD_DEFAULTS,
|
|
1308
|
+
Name: "UpdatedBy",
|
|
1309
|
+
DisplayName: "UpdatedBy",
|
|
1310
|
+
FieldDisplayType: FieldDisplayType.Relationship,
|
|
1311
|
+
SqlType: { Name: SqlTypeName.UNIQUEIDENTIFIER }
|
|
1312
|
+
}
|
|
1313
|
+
];
|
|
1314
|
+
var DIAGNOSTIC_CODES = {
|
|
1315
|
+
entityNameInvalid: "ENTITY_NAME_INVALID",
|
|
1316
|
+
entityNameNotUnique: "ENTITY_NAME_NOT_UNIQUE",
|
|
1317
|
+
fieldNameInvalid: "FIELD_NAME_INVALID",
|
|
1318
|
+
duplicateFieldName: "DUPLICATE_FIELD_NAME",
|
|
1319
|
+
fieldTypeNotAllowed: "FIELD_TYPE_NOT_ALLOWED",
|
|
1320
|
+
nameReserved: "NAME_RESERVED",
|
|
1321
|
+
systemFieldMissing: "SYSTEM_FIELD_MISSING",
|
|
1322
|
+
systemFieldModified: "SYSTEM_FIELD_MODIFIED"
|
|
1323
|
+
};
|
|
1324
|
+
function validateEntity(entity, ctx) {
|
|
1325
|
+
const diagnostics = [];
|
|
1326
|
+
if (!NAME_PATTERN.test(entity.Name)) {
|
|
1327
|
+
diagnostics.push({
|
|
1328
|
+
code: DIAGNOSTIC_CODES.entityNameInvalid,
|
|
1329
|
+
message: `Entity name '${entity.Name}' must start with a letter and contain 3-100 letters or digits.`,
|
|
1330
|
+
severity: "error"
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
const reservedEntityName = findReservedNameError(entity.Name, "entity");
|
|
1334
|
+
if (reservedEntityName) {
|
|
1335
|
+
diagnostics.push({
|
|
1336
|
+
code: DIAGNOSTIC_CODES.nameReserved,
|
|
1337
|
+
message: `${reservedEntityName.message}. ${reservedEntityName.instructions}`,
|
|
1338
|
+
severity: "error"
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
const entityNameLower = entity.Name.toLowerCase();
|
|
1342
|
+
if (ctx.siblingNames.some((sibling) => sibling.toLowerCase() === entityNameLower)) {
|
|
1343
|
+
diagnostics.push({
|
|
1344
|
+
code: DIAGNOSTIC_CODES.entityNameNotUnique,
|
|
1345
|
+
message: `An entity named '${entity.Name}' already exists in this solution. Entity names are solution-wide unique.`,
|
|
1346
|
+
severity: "error"
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
const seenFieldNames = new Map;
|
|
1350
|
+
for (const field of entity.Fields) {
|
|
1351
|
+
if (!field.IsSystemField && !NAME_PATTERN.test(field.Name)) {
|
|
1352
|
+
diagnostics.push({
|
|
1353
|
+
code: DIAGNOSTIC_CODES.fieldNameInvalid,
|
|
1354
|
+
message: `Field name '${field.Name}' must start with a letter and contain 3-100 letters or digits.`,
|
|
1355
|
+
severity: "error",
|
|
1356
|
+
fieldName: field.Name
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
if (!field.IsSystemField) {
|
|
1360
|
+
const reservedFieldName = findReservedNameError(field.Name, "field");
|
|
1361
|
+
if (reservedFieldName) {
|
|
1362
|
+
diagnostics.push({
|
|
1363
|
+
code: DIAGNOSTIC_CODES.nameReserved,
|
|
1364
|
+
message: `${reservedFieldName.message}. ${reservedFieldName.instructions}`,
|
|
1365
|
+
severity: "error",
|
|
1366
|
+
fieldName: field.Name
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
const fieldNameLower = field.Name.toLowerCase();
|
|
1371
|
+
const firstWithName = seenFieldNames.get(fieldNameLower);
|
|
1372
|
+
if (firstWithName !== undefined) {
|
|
1373
|
+
diagnostics.push({
|
|
1374
|
+
code: DIAGNOSTIC_CODES.duplicateFieldName,
|
|
1375
|
+
message: `Duplicate field name '${field.Name}' (names are case-insensitive; first defined as '${firstWithName}').`,
|
|
1376
|
+
severity: "error",
|
|
1377
|
+
fieldName: field.Name
|
|
1378
|
+
});
|
|
1379
|
+
} else {
|
|
1380
|
+
seenFieldNames.set(fieldNameLower, field.Name);
|
|
1381
|
+
}
|
|
1382
|
+
if (!field.IsSystemField && !ALLOWED_TYPE_PAIRS.has(`${field.FieldDisplayType}:${field.SqlType.Name}`)) {
|
|
1383
|
+
diagnostics.push({
|
|
1384
|
+
code: DIAGNOSTIC_CODES.fieldTypeNotAllowed,
|
|
1385
|
+
message: `Field '${field.Name}' uses an unsupported type combination ` + `(${field.FieldDisplayType} / ${field.SqlType.Name}).`,
|
|
1386
|
+
severity: "error",
|
|
1387
|
+
fieldName: field.Name
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
diagnostics.push(...validateSystemFields(entity));
|
|
1392
|
+
return diagnostics;
|
|
1393
|
+
}
|
|
1394
|
+
var SERVER_ASSIGNED_FIELD_PROPS = new Set([
|
|
1395
|
+
"Id",
|
|
1396
|
+
"CreateTime",
|
|
1397
|
+
"CreatedBy",
|
|
1398
|
+
"UpdateTime",
|
|
1399
|
+
"UpdatedBy"
|
|
1400
|
+
]);
|
|
1401
|
+
function isUnmodifiedSystemField(template, actual) {
|
|
1402
|
+
const equal = (left, right) => JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
|
|
1403
|
+
for (const key of Object.keys(template)) {
|
|
1404
|
+
if (!equal(template[key], actual[key])) {
|
|
1405
|
+
return false;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
return Object.keys(actual).every((key) => (key in template) || SERVER_ASSIGNED_FIELD_PROPS.has(key));
|
|
1409
|
+
}
|
|
1410
|
+
function validateSystemFields(entity) {
|
|
1411
|
+
const diagnostics = [];
|
|
1412
|
+
for (const template of SYSTEM_FIELD_TEMPLATES) {
|
|
1413
|
+
const actual = entity.Fields.find((field) => field.Name === template.Name);
|
|
1414
|
+
if (!actual) {
|
|
1415
|
+
diagnostics.push({
|
|
1416
|
+
code: DIAGNOSTIC_CODES.systemFieldMissing,
|
|
1417
|
+
message: `System field '${template.Name}' is missing. System fields cannot be removed.`,
|
|
1418
|
+
severity: "error",
|
|
1419
|
+
fieldName: template.Name
|
|
1420
|
+
});
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
if (!isUnmodifiedSystemField(template, actual)) {
|
|
1424
|
+
diagnostics.push({
|
|
1425
|
+
code: DIAGNOSTIC_CODES.systemFieldModified,
|
|
1426
|
+
message: `System field '${template.Name}' was modified. System fields are read-only.`,
|
|
1427
|
+
severity: "error",
|
|
1428
|
+
fieldName: template.Name
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
return diagnostics;
|
|
1433
|
+
}
|
|
1434
|
+
var ENTITY_EXTENSION_CONST = ".entity";
|
|
1435
|
+
var ENTITY_VALIDATION_FAILED = "ENTITY_VALIDATION_FAILED";
|
|
1436
|
+
var PACK_DIAGNOSTIC_CODES = {
|
|
1437
|
+
misplacedMainFile: "MISPLACED_MAIN_FILE",
|
|
1438
|
+
noParentSolution: "NO_PARENT_SOLUTION"
|
|
1439
|
+
};
|
|
1440
|
+
var ENTITY_RESOURCE_KIND = "entity";
|
|
1441
|
+
class EntityResourceError extends Error {
|
|
1442
|
+
failure;
|
|
1443
|
+
constructor(failure, message) {
|
|
1444
|
+
super(message);
|
|
1445
|
+
this.failure = failure;
|
|
1446
|
+
this.name = "EntityResourceError";
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
function unwrapResource(file) {
|
|
1450
|
+
if (typeof file !== "object" || file === null || Array.isArray(file)) {
|
|
1451
|
+
throw new EntityResourceError("NotAnObject", "Resource file is not a JSON object.");
|
|
1452
|
+
}
|
|
1453
|
+
const resource = file.resource;
|
|
1454
|
+
if (typeof resource !== "object" || resource === null) {
|
|
1455
|
+
throw new EntityResourceError("MissingResource", "Resource file has no 'resource' object.");
|
|
1456
|
+
}
|
|
1457
|
+
if (resource.kind !== ENTITY_RESOURCE_KIND) {
|
|
1458
|
+
throw new EntityResourceError("NotAnEntityResource", `Resource kind is '${String(resource.kind)}', expected '${ENTITY_RESOURCE_KIND}'.`);
|
|
1459
|
+
}
|
|
1460
|
+
const spec = resource.spec;
|
|
1461
|
+
if (typeof spec !== "object" || spec === null || typeof spec.resourceJson !== "string") {
|
|
1462
|
+
throw new EntityResourceError("MissingSpec", "Resource file has no 'spec.resourceJson' string.");
|
|
1463
|
+
}
|
|
1464
|
+
try {
|
|
1465
|
+
return JSON.parse(spec.resourceJson);
|
|
1466
|
+
} catch {
|
|
1467
|
+
throw new EntityResourceError("ResourceJsonUnparsable", "'spec.resourceJson' is not valid JSON.");
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
async function verifyPair(stubFile, solutionDir, fs) {
|
|
1471
|
+
const parsedStub = await readStub(stubFile, fs);
|
|
1472
|
+
if ("failure" in parsedStub) {
|
|
1473
|
+
return { ok: false, failure: parsedStub.failure };
|
|
1474
|
+
}
|
|
1475
|
+
const stub = parsedStub.stub;
|
|
1476
|
+
const baseName = fs.path.basename(stubFile, ENTITY_EXTENSION_CONST);
|
|
1477
|
+
if (baseName !== stub.name) {
|
|
1478
|
+
return fail("StubFileNameMismatch", `Stub file '${baseName}${ENTITY_EXTENSION_CONST}' names entity '${stub.name}' — the filename and the entity name must match.`);
|
|
1479
|
+
}
|
|
1480
|
+
const solutionRoot = fs.path.resolve(solutionDir);
|
|
1481
|
+
const resourceFile = fs.path.resolve(solutionRoot, ...stub.resourcePath.split("/"));
|
|
1482
|
+
const boundary = resourceFile.charAt(solutionRoot.length);
|
|
1483
|
+
if (!resourceFile.startsWith(solutionRoot) || boundary !== "/" && boundary !== "\\") {
|
|
1484
|
+
return fail("ResourcePathEscapes", `'${stub.name}': resourcePath '${stub.resourcePath}' points outside the solution.`);
|
|
1485
|
+
}
|
|
1486
|
+
const parsedResource = await readResource(resourceFile, stub.name, stub.resourcePath, fs);
|
|
1487
|
+
if ("failure" in parsedResource) {
|
|
1488
|
+
return { ok: false, failure: parsedResource.failure };
|
|
1489
|
+
}
|
|
1490
|
+
const resourceRaw = parsedResource.raw;
|
|
1491
|
+
let entity;
|
|
1492
|
+
try {
|
|
1493
|
+
entity = unwrapResource(resourceRaw);
|
|
1494
|
+
} catch (error) {
|
|
1495
|
+
const detail = error instanceof EntityResourceError ? ` (${error.failure})` : "";
|
|
1496
|
+
return fail("ResourceInvalid", `'${stub.name}': resource '${stub.resourcePath}' is not a valid entity resource${detail}.`);
|
|
1497
|
+
}
|
|
1498
|
+
if (entity.Name !== stub.name) {
|
|
1499
|
+
return fail("NameCoupling", `Stub '${stub.name}' points at a resource defining entity '${entity.Name}' — the names must match.`);
|
|
1500
|
+
}
|
|
1501
|
+
return { ok: true, entityName: stub.name, resourceFile, entity };
|
|
1502
|
+
}
|
|
1503
|
+
function fail(code, message) {
|
|
1504
|
+
return { ok: false, failure: { code, message } };
|
|
1505
|
+
}
|
|
1506
|
+
async function readStub(stubFile, fs) {
|
|
1507
|
+
let parsed;
|
|
1508
|
+
try {
|
|
1509
|
+
const raw = await fs.readFile(stubFile);
|
|
1510
|
+
if (raw === null) {
|
|
1511
|
+
return failure("StubUnparsable", `'${stubFile}' could not be read.`);
|
|
1512
|
+
}
|
|
1513
|
+
parsed = JSON.parse(decode(raw));
|
|
1514
|
+
} catch {
|
|
1515
|
+
return failure("StubUnparsable", `'${stubFile}' is not valid JSON.`);
|
|
1516
|
+
}
|
|
1517
|
+
if (typeof parsed !== "object" || parsed === null || typeof parsed.name !== "string" || typeof parsed.resourcePath !== "string") {
|
|
1518
|
+
return failure("StubUnparsable", `'${stubFile}' must be an object with string 'name' and 'resourcePath'.`);
|
|
1519
|
+
}
|
|
1520
|
+
return { stub: { name: parsed.name, resourcePath: parsed.resourcePath } };
|
|
1521
|
+
}
|
|
1522
|
+
async function readResource(resourceFile, entityName, resourcePath, fs) {
|
|
1523
|
+
const missing = failure("ResourceMissing", `'${entityName}': definition resource '${resourcePath}' is missing. Restore it (check trash/backup) or delete the entity.`);
|
|
1524
|
+
try {
|
|
1525
|
+
const raw = await fs.readFile(resourceFile);
|
|
1526
|
+
if (raw === null) {
|
|
1527
|
+
return missing;
|
|
1528
|
+
}
|
|
1529
|
+
return { raw: JSON.parse(decode(raw)) };
|
|
1530
|
+
} catch (error) {
|
|
1531
|
+
if (error instanceof SyntaxError) {
|
|
1532
|
+
return failure("ResourceInvalid", `'${entityName}': resource '${resourcePath}' is not valid JSON.`);
|
|
1533
|
+
}
|
|
1534
|
+
return missing;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
function decode(raw) {
|
|
1538
|
+
return typeof raw === "string" ? raw : new TextDecoder().decode(raw);
|
|
1539
|
+
}
|
|
1540
|
+
function failure(code, message) {
|
|
1541
|
+
return { failure: { code, message } };
|
|
1542
|
+
}
|
|
1543
|
+
async function findSolutionRoot(startDir, fs) {
|
|
1544
|
+
let dir = fs.path.resolve(startDir);
|
|
1545
|
+
for (;; ) {
|
|
1546
|
+
let entries = [];
|
|
1547
|
+
try {
|
|
1548
|
+
entries = await fs.readdir(dir);
|
|
1549
|
+
} catch {
|
|
1550
|
+
entries = [];
|
|
1551
|
+
}
|
|
1552
|
+
if (entries.some((name) => name.endsWith(".uipx"))) {
|
|
1553
|
+
return dir;
|
|
1554
|
+
}
|
|
1555
|
+
const parent = fs.path.dirname(dir);
|
|
1556
|
+
if (parent === dir) {
|
|
1557
|
+
return;
|
|
1558
|
+
}
|
|
1559
|
+
dir = parent;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
class EntityProjectTool extends ProjectTool {
|
|
1564
|
+
async validateAsync(options, _cancellationToken) {
|
|
1565
|
+
return this.checkProjectAsync(options.projectPath);
|
|
1566
|
+
}
|
|
1567
|
+
async packAsync(options, _cancellationToken) {
|
|
1568
|
+
const result = await this.checkProjectAsync(options.projectPath);
|
|
1569
|
+
if (result.isSuccess) {
|
|
1570
|
+
this.logger.info("Entity project is valid — no package emitted; the entity resources are the deployable payload.");
|
|
1571
|
+
}
|
|
1572
|
+
return result;
|
|
1573
|
+
}
|
|
1574
|
+
async checkProjectAsync(projectPath) {
|
|
1575
|
+
const fs = this.fileSystem;
|
|
1576
|
+
const diagnostics = [];
|
|
1577
|
+
let entries = [];
|
|
1578
|
+
try {
|
|
1579
|
+
entries = await fs.readdir(projectPath);
|
|
1580
|
+
} catch {
|
|
1581
|
+
return new ToolResult(ENTITY_VALIDATION_FAILED, `Entity project directory '${projectPath}' could not be read.`, [], "Check that the project path in the solution manifest points at an existing directory.");
|
|
1582
|
+
}
|
|
1583
|
+
const stubs = sorted(entries.filter((name) => name.endsWith(ENTITY_EXTENSION_CONST)));
|
|
1584
|
+
for (const foreign of sorted(entries.filter((name) => name.endsWith(".flow")))) {
|
|
1585
|
+
diagnostics.push({
|
|
1586
|
+
file: fs.path.join(projectPath, foreign),
|
|
1587
|
+
code: PACK_DIAGNOSTIC_CODES.misplacedMainFile,
|
|
1588
|
+
message: `'${foreign}' is a Flow main file inside an Entity project — move it to a Flow project.`
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
const solutionDir = await findSolutionRoot(projectPath, fs);
|
|
1592
|
+
if (solutionDir === undefined) {
|
|
1593
|
+
if (stubs.length > 0) {
|
|
1594
|
+
diagnostics.push({
|
|
1595
|
+
file: projectPath,
|
|
1596
|
+
code: PACK_DIAGNOSTIC_CODES.noParentSolution,
|
|
1597
|
+
message: "Entity project has no parent solution (.uipx not found) — the stubs' solution-relative resource pointers cannot resolve."
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
} else {
|
|
1601
|
+
diagnostics.push(...await this.checkStubsAsync(projectPath, solutionDir, stubs));
|
|
1602
|
+
}
|
|
1603
|
+
if (diagnostics.length === 0) {
|
|
1604
|
+
return ToolResult.success();
|
|
1605
|
+
}
|
|
1606
|
+
const result = new ToolResult(ENTITY_VALIDATION_FAILED, `Entity validation failed with ${diagnostics.length} issue(s). First: ${diagnostics[0]?.message}`, [], "Fix the listed entities (open them in the entity editor, or restore missing resources) and pack again.");
|
|
1607
|
+
result.details = { diagnostics };
|
|
1608
|
+
return result;
|
|
1609
|
+
}
|
|
1610
|
+
async checkStubsAsync(projectPath, solutionDir, stubs) {
|
|
1611
|
+
const fs = this.fileSystem;
|
|
1612
|
+
const diagnostics = [];
|
|
1613
|
+
const allEntityNames = await collectSolutionEntityNames(solutionDir, fs);
|
|
1614
|
+
for (const stubName of stubs) {
|
|
1615
|
+
const stubFile = fs.path.join(projectPath, stubName);
|
|
1616
|
+
const pair = await verifyPair(stubFile, solutionDir, fs);
|
|
1617
|
+
if (!pair.ok) {
|
|
1618
|
+
diagnostics.push({
|
|
1619
|
+
file: stubFile,
|
|
1620
|
+
code: pair.failure.code,
|
|
1621
|
+
message: pair.failure.message
|
|
1622
|
+
});
|
|
1623
|
+
continue;
|
|
1624
|
+
}
|
|
1625
|
+
for (const diagnostic of validateEntity(pair.entity, {
|
|
1626
|
+
siblingNames: withoutOneOccurrence(allEntityNames, pair.entityName)
|
|
1627
|
+
})) {
|
|
1628
|
+
diagnostics.push({
|
|
1629
|
+
file: pair.resourceFile,
|
|
1630
|
+
code: diagnostic.code,
|
|
1631
|
+
message: diagnostic.message,
|
|
1632
|
+
fieldName: diagnostic.fieldName
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
return diagnostics;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
function sorted(names) {
|
|
1640
|
+
return [...names].sort(compareCodeUnits);
|
|
1641
|
+
}
|
|
1642
|
+
function compareCodeUnits(left, right) {
|
|
1643
|
+
if (left < right) {
|
|
1644
|
+
return -1;
|
|
1645
|
+
}
|
|
1646
|
+
return left > right ? 1 : 0;
|
|
1647
|
+
}
|
|
1648
|
+
function withoutOneOccurrence(names, name) {
|
|
1649
|
+
const siblings = [...names];
|
|
1650
|
+
const self = siblings.indexOf(name);
|
|
1651
|
+
if (self >= 0) {
|
|
1652
|
+
siblings.splice(self, 1);
|
|
1653
|
+
}
|
|
1654
|
+
return siblings;
|
|
1655
|
+
}
|
|
1656
|
+
async function collectSolutionEntityNames(solutionDir, fs) {
|
|
1657
|
+
const names = [];
|
|
1658
|
+
let topLevel = [];
|
|
1659
|
+
try {
|
|
1660
|
+
topLevel = await fs.readdir(solutionDir);
|
|
1661
|
+
} catch {
|
|
1662
|
+
return names;
|
|
1663
|
+
}
|
|
1664
|
+
for (const entry of topLevel) {
|
|
1665
|
+
if (entry === "resources" || entry.startsWith(".")) {
|
|
1666
|
+
continue;
|
|
1667
|
+
}
|
|
1668
|
+
const dir = fs.path.join(solutionDir, entry);
|
|
1669
|
+
try {
|
|
1670
|
+
const stat = await fs.stat(dir);
|
|
1671
|
+
if (!stat?.isDirectory()) {
|
|
1672
|
+
continue;
|
|
1673
|
+
}
|
|
1674
|
+
for (const file of await fs.readdir(dir)) {
|
|
1675
|
+
if (file.endsWith(ENTITY_EXTENSION_CONST)) {
|
|
1676
|
+
names.push(fs.path.basename(file, ENTITY_EXTENSION_CONST));
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
} catch {}
|
|
1680
|
+
}
|
|
1681
|
+
return names;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
class EntityToolFactory {
|
|
1685
|
+
supportedTypes = ["Entity"];
|
|
1686
|
+
async createAsync(logger, fileSystem) {
|
|
1687
|
+
return new EntityProjectTool(fileSystem, logger);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
// ../packager/packager-core/src/i18n/types.ts
|
|
1691
|
+
function isPluralForm2(value) {
|
|
1692
|
+
return typeof value === "object" && value !== null && "other" in value;
|
|
1693
|
+
}
|
|
1694
|
+
function selectPluralForm2(forms, count) {
|
|
1695
|
+
if (count === 0 && forms.zero !== undefined) {
|
|
1696
|
+
return forms.zero;
|
|
1697
|
+
}
|
|
1698
|
+
if (count === 1 && forms.one !== undefined) {
|
|
1699
|
+
return forms.one;
|
|
1700
|
+
}
|
|
1701
|
+
if (count === 2 && forms.two !== undefined) {
|
|
1702
|
+
return forms.two;
|
|
1703
|
+
}
|
|
1704
|
+
if (forms.few !== undefined) {
|
|
1705
|
+
const mod10 = count % 10;
|
|
1706
|
+
const mod100 = count % 100;
|
|
1707
|
+
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
1708
|
+
return forms.few;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
if (forms.many !== undefined) {
|
|
1712
|
+
const mod10 = count % 10;
|
|
1713
|
+
const mod100 = count % 100;
|
|
1714
|
+
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
1715
|
+
return forms.many;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return forms.other;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
// ../packager/packager-core/src/i18n/i18n-manager.ts
|
|
1722
|
+
class I18nManager2 {
|
|
1723
|
+
static translations = {};
|
|
1724
|
+
static currentLocale = "en";
|
|
1725
|
+
static fallbackLocale = "en";
|
|
1726
|
+
static registerTranslations(locale, catalog) {
|
|
1727
|
+
if (!I18nManager2.translations[locale]) {
|
|
1728
|
+
I18nManager2.translations[locale] = {};
|
|
1729
|
+
}
|
|
1730
|
+
I18nManager2.translations[locale] = I18nManager2.deepMerge(I18nManager2.translations[locale], catalog);
|
|
1731
|
+
}
|
|
1732
|
+
static setLocale(locale) {
|
|
1733
|
+
const normalized = I18nManager2.normalizeLocale(locale);
|
|
1734
|
+
if (I18nManager2.translations[normalized]) {
|
|
1735
|
+
I18nManager2.currentLocale = normalized;
|
|
1736
|
+
return normalized;
|
|
1737
|
+
}
|
|
1738
|
+
const baseLocale = normalized.split("-")[0];
|
|
1739
|
+
if (baseLocale !== normalized && I18nManager2.translations[baseLocale]) {
|
|
1740
|
+
I18nManager2.currentLocale = baseLocale;
|
|
1741
|
+
return baseLocale;
|
|
1742
|
+
}
|
|
1743
|
+
return I18nManager2.currentLocale;
|
|
1744
|
+
}
|
|
1745
|
+
static getLocale() {
|
|
1746
|
+
return I18nManager2.currentLocale;
|
|
1747
|
+
}
|
|
1748
|
+
static setFallbackLocale(locale) {
|
|
1749
|
+
I18nManager2.fallbackLocale = I18nManager2.normalizeLocale(locale);
|
|
1750
|
+
}
|
|
1751
|
+
static t(key, params, locale) {
|
|
1752
|
+
const targetLocale = locale ? I18nManager2.normalizeLocale(locale) : I18nManager2.currentLocale;
|
|
1753
|
+
let value = I18nManager2.getTranslationValue(key, targetLocale);
|
|
1754
|
+
if (value === undefined && targetLocale !== I18nManager2.fallbackLocale) {
|
|
1755
|
+
value = I18nManager2.getTranslationValue(key, I18nManager2.fallbackLocale);
|
|
1756
|
+
}
|
|
1757
|
+
if (value === undefined) {
|
|
1758
|
+
return key;
|
|
1759
|
+
}
|
|
1760
|
+
if (isPluralForm2(value) && params && "count" in params) {
|
|
1761
|
+
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
1762
|
+
value = selectPluralForm2(value, count);
|
|
1763
|
+
} else if (isPluralForm2(value)) {
|
|
1764
|
+
value = value.other;
|
|
1765
|
+
}
|
|
1766
|
+
if (typeof value !== "string") {
|
|
1767
|
+
return key;
|
|
1768
|
+
}
|
|
1769
|
+
return params ? I18nManager2.interpolate(value, params) : value;
|
|
1770
|
+
}
|
|
1771
|
+
static has(key, locale) {
|
|
1772
|
+
const targetLocale = locale ? I18nManager2.normalizeLocale(locale) : I18nManager2.currentLocale;
|
|
1773
|
+
const value = I18nManager2.getTranslationValue(key, targetLocale);
|
|
1774
|
+
if (value !== undefined) {
|
|
1775
|
+
return true;
|
|
1776
|
+
}
|
|
1777
|
+
if (targetLocale !== I18nManager2.fallbackLocale) {
|
|
1778
|
+
return I18nManager2.getTranslationValue(key, I18nManager2.fallbackLocale) !== undefined;
|
|
1779
|
+
}
|
|
1780
|
+
return false;
|
|
1781
|
+
}
|
|
1782
|
+
static getAvailableLocales() {
|
|
1783
|
+
return Object.keys(I18nManager2.translations);
|
|
1784
|
+
}
|
|
1785
|
+
static clearTranslations() {
|
|
1786
|
+
I18nManager2.translations = {};
|
|
1787
|
+
I18nManager2.currentLocale = "en";
|
|
1788
|
+
}
|
|
1789
|
+
static getTranslationValue(key, locale) {
|
|
1790
|
+
const catalog = I18nManager2.translations[locale];
|
|
1791
|
+
if (!catalog) {
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
const keys = key.split(".");
|
|
1795
|
+
let value = catalog;
|
|
1796
|
+
for (const k of keys) {
|
|
1797
|
+
if (value && typeof value === "object" && k in value) {
|
|
1798
|
+
value = value[k];
|
|
1799
|
+
} else {
|
|
1800
|
+
return;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return value;
|
|
1804
|
+
}
|
|
1805
|
+
static interpolate(template, params) {
|
|
1806
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
1807
|
+
const value = params[key];
|
|
1808
|
+
return value !== undefined ? String(value) : `{${key}}`;
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
static normalizeLocale(locale) {
|
|
1812
|
+
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
1813
|
+
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
1814
|
+
if (specialLocales.includes(normalized)) {
|
|
1815
|
+
return normalized;
|
|
1816
|
+
}
|
|
1817
|
+
return normalized.split("-")[0];
|
|
1818
|
+
}
|
|
1819
|
+
static deepMerge(target, source) {
|
|
1820
|
+
const result = { ...target };
|
|
1821
|
+
for (const key of Object.keys(source)) {
|
|
1822
|
+
const sourceValue = source[key];
|
|
1823
|
+
const targetValue = result[key];
|
|
1824
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
1825
|
+
result[key] = I18nManager2.deepMerge(targetValue, sourceValue);
|
|
1826
|
+
} else {
|
|
1827
|
+
result[key] = sourceValue;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
return result;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
// ../packager/packager-core/src/i18n/locales/de.ts
|
|
1835
|
+
var de2 = {
|
|
1836
|
+
toolCore: {
|
|
1837
|
+
errors: {
|
|
1838
|
+
internal: "Internal error: {message}",
|
|
1839
|
+
fileNotFound: "File not found: {path}",
|
|
1840
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1841
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1842
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1843
|
+
invalidPath: "{path} is not a valid path",
|
|
1844
|
+
operationCanceled: "Operation was canceled",
|
|
1845
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1846
|
+
},
|
|
1847
|
+
progress: {
|
|
1848
|
+
copying: "Copying files...",
|
|
1849
|
+
building: "Building project...",
|
|
1850
|
+
packaging: "Creating package...",
|
|
1851
|
+
validating: "Validating...",
|
|
1852
|
+
analyzing: "Analyzing...",
|
|
1853
|
+
restoring: "Restoring dependencies..."
|
|
1854
|
+
},
|
|
1855
|
+
validation: {
|
|
1856
|
+
requiredField: "{field} is required",
|
|
1857
|
+
invalidValue: "Invalid value for {field}",
|
|
1858
|
+
pathNotFound: "Path not found: {path}",
|
|
1859
|
+
fileRequired: "File is required: {path}",
|
|
1860
|
+
directoryRequired: "Directory is required: {path}"
|
|
1861
|
+
},
|
|
1862
|
+
warnings: {
|
|
1863
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1864
|
+
},
|
|
1865
|
+
info: {
|
|
1866
|
+
operationComplete: "Operation completed successfully",
|
|
1867
|
+
filesProcessed: {
|
|
1868
|
+
zero: "No files processed",
|
|
1869
|
+
one: "{count} file processed",
|
|
1870
|
+
other: "{count} files processed"
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
// ../packager/packager-core/src/i18n/locales/en.ts
|
|
1877
|
+
var en2 = {
|
|
1878
|
+
toolCore: {
|
|
1879
|
+
errors: {
|
|
1880
|
+
internal: "Internal error: {message}",
|
|
1881
|
+
fileNotFound: "File not found: {path}",
|
|
1882
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1883
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1884
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1885
|
+
invalidPath: "{path} is not a valid path",
|
|
1886
|
+
operationCanceled: "Operation was canceled",
|
|
1887
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1888
|
+
},
|
|
1889
|
+
progress: {
|
|
1890
|
+
copying: "Copying files...",
|
|
1891
|
+
building: "Building project...",
|
|
1892
|
+
packaging: "Creating package...",
|
|
1893
|
+
validating: "Validating...",
|
|
1894
|
+
analyzing: "Analyzing...",
|
|
1895
|
+
restoring: "Restoring dependencies..."
|
|
1896
|
+
},
|
|
1897
|
+
validation: {
|
|
1898
|
+
requiredField: "{field} is required",
|
|
1899
|
+
invalidValue: "Invalid value for {field}",
|
|
1900
|
+
pathNotFound: "Path not found: {path}",
|
|
1901
|
+
fileRequired: "File is required: {path}",
|
|
1902
|
+
directoryRequired: "Directory is required: {path}"
|
|
1903
|
+
},
|
|
1904
|
+
warnings: {
|
|
1905
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1906
|
+
},
|
|
1907
|
+
info: {
|
|
1908
|
+
operationComplete: "Operation completed successfully",
|
|
1909
|
+
filesProcessed: {
|
|
1910
|
+
zero: "No files processed",
|
|
1911
|
+
one: "{count} file processed",
|
|
1912
|
+
other: "{count} files processed"
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
// ../packager/packager-core/src/i18n/locales/es.ts
|
|
1919
|
+
var es2 = {
|
|
1920
|
+
toolCore: {
|
|
1921
|
+
errors: {
|
|
1922
|
+
internal: "Internal error: {message}",
|
|
1923
|
+
fileNotFound: "File not found: {path}",
|
|
1924
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1925
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1926
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1927
|
+
invalidPath: "{path} is not a valid path",
|
|
1928
|
+
operationCanceled: "Operation was canceled",
|
|
1929
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1930
|
+
},
|
|
1931
|
+
progress: {
|
|
1932
|
+
copying: "Copying files...",
|
|
1933
|
+
building: "Building project...",
|
|
1934
|
+
packaging: "Creating package...",
|
|
1935
|
+
validating: "Validating...",
|
|
1936
|
+
analyzing: "Analyzing...",
|
|
1937
|
+
restoring: "Restoring dependencies..."
|
|
1938
|
+
},
|
|
1939
|
+
validation: {
|
|
1940
|
+
requiredField: "{field} is required",
|
|
1941
|
+
invalidValue: "Invalid value for {field}",
|
|
1942
|
+
pathNotFound: "Path not found: {path}",
|
|
1943
|
+
fileRequired: "File is required: {path}",
|
|
1944
|
+
directoryRequired: "Directory is required: {path}"
|
|
1945
|
+
},
|
|
1946
|
+
warnings: {
|
|
1947
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1948
|
+
},
|
|
1949
|
+
info: {
|
|
1950
|
+
operationComplete: "Operation completed successfully",
|
|
1951
|
+
filesProcessed: {
|
|
1952
|
+
zero: "No files processed",
|
|
1953
|
+
one: "{count} file processed",
|
|
1954
|
+
other: "{count} files processed"
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
// ../packager/packager-core/src/i18n/locales/es-MX.ts
|
|
1961
|
+
var es_MX2 = {
|
|
1962
|
+
toolCore: {
|
|
1963
|
+
errors: {
|
|
1964
|
+
internal: "Internal error: {message}",
|
|
1965
|
+
fileNotFound: "File not found: {path}",
|
|
1966
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
1967
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
1968
|
+
directoryNotFound: "Directory not found: {path}",
|
|
1969
|
+
invalidPath: "{path} is not a valid path",
|
|
1970
|
+
operationCanceled: "Operation was canceled",
|
|
1971
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
1972
|
+
},
|
|
1973
|
+
progress: {
|
|
1974
|
+
copying: "Copying files...",
|
|
1975
|
+
building: "Building project...",
|
|
1976
|
+
packaging: "Creating package...",
|
|
1977
|
+
validating: "Validating...",
|
|
1978
|
+
analyzing: "Analyzing...",
|
|
1979
|
+
restoring: "Restoring dependencies..."
|
|
1980
|
+
},
|
|
1981
|
+
validation: {
|
|
1982
|
+
requiredField: "{field} is required",
|
|
1983
|
+
invalidValue: "Invalid value for {field}",
|
|
1984
|
+
pathNotFound: "Path not found: {path}",
|
|
1985
|
+
fileRequired: "File is required: {path}",
|
|
1986
|
+
directoryRequired: "Directory is required: {path}"
|
|
1987
|
+
},
|
|
1988
|
+
warnings: {
|
|
1989
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
1990
|
+
},
|
|
1991
|
+
info: {
|
|
1992
|
+
operationComplete: "Operation completed successfully",
|
|
1993
|
+
filesProcessed: {
|
|
1994
|
+
zero: "No files processed",
|
|
1995
|
+
one: "{count} file processed",
|
|
1996
|
+
other: "{count} files processed"
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
};
|
|
2001
|
+
|
|
2002
|
+
// ../packager/packager-core/src/i18n/locales/fr.ts
|
|
2003
|
+
var fr2 = {
|
|
2004
|
+
toolCore: {
|
|
2005
|
+
errors: {
|
|
2006
|
+
internal: "Internal error: {message}",
|
|
2007
|
+
fileNotFound: "File not found: {path}",
|
|
2008
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2009
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2010
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2011
|
+
invalidPath: "{path} is not a valid path",
|
|
2012
|
+
operationCanceled: "Operation was canceled",
|
|
2013
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2014
|
+
},
|
|
2015
|
+
progress: {
|
|
2016
|
+
copying: "Copying files...",
|
|
2017
|
+
building: "Building project...",
|
|
2018
|
+
packaging: "Creating package...",
|
|
2019
|
+
validating: "Validating...",
|
|
2020
|
+
analyzing: "Analyzing...",
|
|
2021
|
+
restoring: "Restoring dependencies..."
|
|
2022
|
+
},
|
|
2023
|
+
validation: {
|
|
2024
|
+
requiredField: "{field} is required",
|
|
2025
|
+
invalidValue: "Invalid value for {field}",
|
|
2026
|
+
pathNotFound: "Path not found: {path}",
|
|
2027
|
+
fileRequired: "File is required: {path}",
|
|
2028
|
+
directoryRequired: "Directory is required: {path}"
|
|
2029
|
+
},
|
|
2030
|
+
warnings: {
|
|
2031
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2032
|
+
},
|
|
2033
|
+
info: {
|
|
2034
|
+
operationComplete: "Operation completed successfully",
|
|
2035
|
+
filesProcessed: {
|
|
2036
|
+
zero: "No files processed",
|
|
2037
|
+
one: "{count} file processed",
|
|
2038
|
+
other: "{count} files processed"
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
|
|
2044
|
+
// ../packager/packager-core/src/i18n/locales/ja.ts
|
|
2045
|
+
var ja2 = {
|
|
2046
|
+
toolCore: {
|
|
2047
|
+
errors: {
|
|
2048
|
+
internal: "Internal error: {message}",
|
|
2049
|
+
fileNotFound: "File not found: {path}",
|
|
2050
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2051
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2052
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2053
|
+
invalidPath: "{path} is not a valid path",
|
|
2054
|
+
operationCanceled: "Operation was canceled",
|
|
2055
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2056
|
+
},
|
|
2057
|
+
progress: {
|
|
2058
|
+
copying: "Copying files...",
|
|
2059
|
+
building: "Building project...",
|
|
2060
|
+
packaging: "Creating package...",
|
|
2061
|
+
validating: "Validating...",
|
|
2062
|
+
analyzing: "Analyzing...",
|
|
2063
|
+
restoring: "Restoring dependencies..."
|
|
2064
|
+
},
|
|
2065
|
+
validation: {
|
|
2066
|
+
requiredField: "{field} is required",
|
|
2067
|
+
invalidValue: "Invalid value for {field}",
|
|
2068
|
+
pathNotFound: "Path not found: {path}",
|
|
2069
|
+
fileRequired: "File is required: {path}",
|
|
2070
|
+
directoryRequired: "Directory is required: {path}"
|
|
2071
|
+
},
|
|
2072
|
+
warnings: {
|
|
2073
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2074
|
+
},
|
|
2075
|
+
info: {
|
|
2076
|
+
operationComplete: "Operation completed successfully",
|
|
2077
|
+
filesProcessed: {
|
|
2078
|
+
zero: "No files processed",
|
|
2079
|
+
one: "{count} file processed",
|
|
2080
|
+
other: "{count} files processed"
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
// ../packager/packager-core/src/i18n/locales/ko.ts
|
|
2087
|
+
var ko2 = {
|
|
2088
|
+
toolCore: {
|
|
2089
|
+
errors: {
|
|
2090
|
+
internal: "Internal error: {message}",
|
|
2091
|
+
fileNotFound: "File not found: {path}",
|
|
2092
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2093
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2094
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2095
|
+
invalidPath: "{path} is not a valid path",
|
|
2096
|
+
operationCanceled: "Operation was canceled",
|
|
2097
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2098
|
+
},
|
|
2099
|
+
progress: {
|
|
2100
|
+
copying: "Copying files...",
|
|
2101
|
+
building: "Building project...",
|
|
2102
|
+
packaging: "Creating package...",
|
|
2103
|
+
validating: "Validating...",
|
|
2104
|
+
analyzing: "Analyzing...",
|
|
2105
|
+
restoring: "Restoring dependencies..."
|
|
2106
|
+
},
|
|
2107
|
+
validation: {
|
|
2108
|
+
requiredField: "{field} is required",
|
|
2109
|
+
invalidValue: "Invalid value for {field}",
|
|
2110
|
+
pathNotFound: "Path not found: {path}",
|
|
2111
|
+
fileRequired: "File is required: {path}",
|
|
2112
|
+
directoryRequired: "Directory is required: {path}"
|
|
2113
|
+
},
|
|
2114
|
+
warnings: {
|
|
2115
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2116
|
+
},
|
|
2117
|
+
info: {
|
|
2118
|
+
operationComplete: "Operation completed successfully",
|
|
2119
|
+
filesProcessed: {
|
|
2120
|
+
zero: "No files processed",
|
|
2121
|
+
one: "{count} file processed",
|
|
2122
|
+
other: "{count} files processed"
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2128
|
+
// ../packager/packager-core/src/i18n/locales/pt.ts
|
|
2129
|
+
var pt2 = {
|
|
2130
|
+
toolCore: {
|
|
2131
|
+
errors: {
|
|
2132
|
+
internal: "Internal error: {message}",
|
|
2133
|
+
fileNotFound: "File not found: {path}",
|
|
2134
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2135
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2136
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2137
|
+
invalidPath: "{path} is not a valid path",
|
|
2138
|
+
operationCanceled: "Operation was canceled",
|
|
2139
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2140
|
+
},
|
|
2141
|
+
progress: {
|
|
2142
|
+
copying: "Copying files...",
|
|
2143
|
+
building: "Building project...",
|
|
2144
|
+
packaging: "Creating package...",
|
|
2145
|
+
validating: "Validating...",
|
|
2146
|
+
analyzing: "Analyzing...",
|
|
2147
|
+
restoring: "Restoring dependencies..."
|
|
2148
|
+
},
|
|
2149
|
+
validation: {
|
|
2150
|
+
requiredField: "{field} is required",
|
|
2151
|
+
invalidValue: "Invalid value for {field}",
|
|
2152
|
+
pathNotFound: "Path not found: {path}",
|
|
2153
|
+
fileRequired: "File is required: {path}",
|
|
2154
|
+
directoryRequired: "Directory is required: {path}"
|
|
2155
|
+
},
|
|
2156
|
+
warnings: {
|
|
2157
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2158
|
+
},
|
|
2159
|
+
info: {
|
|
2160
|
+
operationComplete: "Operation completed successfully",
|
|
2161
|
+
filesProcessed: {
|
|
2162
|
+
zero: "No files processed",
|
|
2163
|
+
one: "{count} file processed",
|
|
2164
|
+
other: "{count} files processed"
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
|
|
2171
|
+
var pt_BR2 = {
|
|
2172
|
+
toolCore: {
|
|
2173
|
+
errors: {
|
|
2174
|
+
internal: "Internal error: {message}",
|
|
2175
|
+
fileNotFound: "File not found: {path}",
|
|
2176
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2177
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2178
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2179
|
+
invalidPath: "{path} is not a valid path",
|
|
2180
|
+
operationCanceled: "Operation was canceled",
|
|
2181
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2182
|
+
},
|
|
2183
|
+
progress: {
|
|
2184
|
+
copying: "Copying files...",
|
|
2185
|
+
building: "Building project...",
|
|
2186
|
+
packaging: "Creating package...",
|
|
2187
|
+
validating: "Validating...",
|
|
2188
|
+
analyzing: "Analyzing...",
|
|
2189
|
+
restoring: "Restoring dependencies..."
|
|
2190
|
+
},
|
|
2191
|
+
validation: {
|
|
2192
|
+
requiredField: "{field} is required",
|
|
2193
|
+
invalidValue: "Invalid value for {field}",
|
|
2194
|
+
pathNotFound: "Path not found: {path}",
|
|
2195
|
+
fileRequired: "File is required: {path}",
|
|
2196
|
+
directoryRequired: "Directory is required: {path}"
|
|
2197
|
+
},
|
|
2198
|
+
warnings: {
|
|
2199
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2200
|
+
},
|
|
2201
|
+
info: {
|
|
2202
|
+
operationComplete: "Operation completed successfully",
|
|
2203
|
+
filesProcessed: {
|
|
2204
|
+
zero: "No files processed",
|
|
2205
|
+
one: "{count} file processed",
|
|
2206
|
+
other: "{count} files processed"
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2212
|
+
// ../packager/packager-core/src/i18n/locales/ro.ts
|
|
2213
|
+
var ro2 = {
|
|
2214
|
+
toolCore: {
|
|
2215
|
+
errors: {
|
|
2216
|
+
internal: "Internal error: {message}",
|
|
2217
|
+
fileNotFound: "File not found: {path}",
|
|
2218
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2219
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2220
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2221
|
+
invalidPath: "{path} is not a valid path",
|
|
2222
|
+
operationCanceled: "Operation was canceled",
|
|
2223
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2224
|
+
},
|
|
2225
|
+
progress: {
|
|
2226
|
+
copying: "Copying files...",
|
|
2227
|
+
building: "Building project...",
|
|
2228
|
+
packaging: "Creating package...",
|
|
2229
|
+
validating: "Validating...",
|
|
2230
|
+
analyzing: "Analyzing...",
|
|
2231
|
+
restoring: "Restoring dependencies..."
|
|
2232
|
+
},
|
|
2233
|
+
validation: {
|
|
2234
|
+
requiredField: "{field} is required",
|
|
2235
|
+
invalidValue: "Invalid value for {field}",
|
|
2236
|
+
pathNotFound: "Path not found: {path}",
|
|
2237
|
+
fileRequired: "File is required: {path}",
|
|
2238
|
+
directoryRequired: "Directory is required: {path}"
|
|
2239
|
+
},
|
|
2240
|
+
warnings: {
|
|
2241
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2242
|
+
},
|
|
2243
|
+
info: {
|
|
2244
|
+
operationComplete: "Operation completed successfully",
|
|
2245
|
+
filesProcessed: {
|
|
2246
|
+
zero: "No files processed",
|
|
2247
|
+
one: "{count} file processed",
|
|
2248
|
+
other: "{count} files processed"
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
// ../packager/packager-core/src/i18n/locales/ru.ts
|
|
2255
|
+
var ru2 = {
|
|
2256
|
+
toolCore: {
|
|
2257
|
+
errors: {
|
|
2258
|
+
internal: "Internal error: {message}",
|
|
2259
|
+
fileNotFound: "File not found: {path}",
|
|
2260
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2261
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2262
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2263
|
+
invalidPath: "{path} is not a valid path",
|
|
2264
|
+
operationCanceled: "Operation was canceled",
|
|
2265
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2266
|
+
},
|
|
2267
|
+
progress: {
|
|
2268
|
+
copying: "Copying files...",
|
|
2269
|
+
building: "Building project...",
|
|
2270
|
+
packaging: "Creating package...",
|
|
2271
|
+
validating: "Validating...",
|
|
2272
|
+
analyzing: "Analyzing...",
|
|
2273
|
+
restoring: "Restoring dependencies..."
|
|
2274
|
+
},
|
|
2275
|
+
validation: {
|
|
2276
|
+
requiredField: "{field} is required",
|
|
2277
|
+
invalidValue: "Invalid value for {field}",
|
|
2278
|
+
pathNotFound: "Path not found: {path}",
|
|
2279
|
+
fileRequired: "File is required: {path}",
|
|
2280
|
+
directoryRequired: "Directory is required: {path}"
|
|
2281
|
+
},
|
|
2282
|
+
warnings: {
|
|
2283
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2284
|
+
},
|
|
2285
|
+
info: {
|
|
2286
|
+
operationComplete: "Operation completed successfully",
|
|
2287
|
+
filesProcessed: {
|
|
2288
|
+
zero: "No files processed",
|
|
2289
|
+
one: "{count} file processed",
|
|
2290
|
+
other: "{count} files processed"
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
|
|
2296
|
+
// ../packager/packager-core/src/i18n/locales/tr.ts
|
|
2297
|
+
var tr2 = {
|
|
2298
|
+
toolCore: {
|
|
2299
|
+
errors: {
|
|
2300
|
+
internal: "Internal error: {message}",
|
|
2301
|
+
fileNotFound: "File not found: {path}",
|
|
2302
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2303
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2304
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2305
|
+
invalidPath: "{path} is not a valid path",
|
|
2306
|
+
operationCanceled: "Operation was canceled",
|
|
2307
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2308
|
+
},
|
|
2309
|
+
progress: {
|
|
2310
|
+
copying: "Copying files...",
|
|
2311
|
+
building: "Building project...",
|
|
2312
|
+
packaging: "Creating package...",
|
|
2313
|
+
validating: "Validating...",
|
|
2314
|
+
analyzing: "Analyzing...",
|
|
2315
|
+
restoring: "Restoring dependencies..."
|
|
2316
|
+
},
|
|
2317
|
+
validation: {
|
|
2318
|
+
requiredField: "{field} is required",
|
|
2319
|
+
invalidValue: "Invalid value for {field}",
|
|
2320
|
+
pathNotFound: "Path not found: {path}",
|
|
2321
|
+
fileRequired: "File is required: {path}",
|
|
2322
|
+
directoryRequired: "Directory is required: {path}"
|
|
2323
|
+
},
|
|
2324
|
+
warnings: {
|
|
2325
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2326
|
+
},
|
|
2327
|
+
info: {
|
|
2328
|
+
operationComplete: "Operation completed successfully",
|
|
2329
|
+
filesProcessed: {
|
|
2330
|
+
zero: "No files processed",
|
|
2331
|
+
one: "{count} file processed",
|
|
2332
|
+
other: "{count} files processed"
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
};
|
|
2337
|
+
|
|
2338
|
+
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
|
|
2339
|
+
var zh_CN2 = {
|
|
2340
|
+
toolCore: {
|
|
2341
|
+
errors: {
|
|
2342
|
+
internal: "Internal error: {message}",
|
|
2343
|
+
fileNotFound: "File not found: {path}",
|
|
2344
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2345
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2346
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2347
|
+
invalidPath: "{path} is not a valid path",
|
|
2348
|
+
operationCanceled: "Operation was canceled",
|
|
2349
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2350
|
+
},
|
|
2351
|
+
progress: {
|
|
2352
|
+
copying: "Copying files...",
|
|
2353
|
+
building: "Building project...",
|
|
2354
|
+
packaging: "Creating package...",
|
|
2355
|
+
validating: "Validating...",
|
|
2356
|
+
analyzing: "Analyzing...",
|
|
2357
|
+
restoring: "Restoring dependencies..."
|
|
2358
|
+
},
|
|
2359
|
+
validation: {
|
|
2360
|
+
requiredField: "{field} is required",
|
|
2361
|
+
invalidValue: "Invalid value for {field}",
|
|
2362
|
+
pathNotFound: "Path not found: {path}",
|
|
2363
|
+
fileRequired: "File is required: {path}",
|
|
2364
|
+
directoryRequired: "Directory is required: {path}"
|
|
2365
|
+
},
|
|
2366
|
+
warnings: {
|
|
2367
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2368
|
+
},
|
|
2369
|
+
info: {
|
|
2370
|
+
operationComplete: "Operation completed successfully",
|
|
2371
|
+
filesProcessed: {
|
|
2372
|
+
zero: "No files processed",
|
|
2373
|
+
one: "{count} file processed",
|
|
2374
|
+
other: "{count} files processed"
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2380
|
+
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
|
|
2381
|
+
var zh_TW2 = {
|
|
2382
|
+
toolCore: {
|
|
2383
|
+
errors: {
|
|
2384
|
+
internal: "Internal error: {message}",
|
|
2385
|
+
fileNotFound: "File not found: {path}",
|
|
2386
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2387
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2388
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2389
|
+
invalidPath: "{path} is not a valid path",
|
|
2390
|
+
operationCanceled: "Operation was canceled",
|
|
2391
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2392
|
+
},
|
|
2393
|
+
progress: {
|
|
2394
|
+
copying: "Copying files...",
|
|
2395
|
+
building: "Building project...",
|
|
2396
|
+
packaging: "Creating package...",
|
|
2397
|
+
validating: "Validating...",
|
|
2398
|
+
analyzing: "Analyzing...",
|
|
2399
|
+
restoring: "Restoring dependencies..."
|
|
2400
|
+
},
|
|
2401
|
+
validation: {
|
|
2402
|
+
requiredField: "{field} is required",
|
|
2403
|
+
invalidValue: "Invalid value for {field}",
|
|
2404
|
+
pathNotFound: "Path not found: {path}",
|
|
2405
|
+
fileRequired: "File is required: {path}",
|
|
2406
|
+
directoryRequired: "Directory is required: {path}"
|
|
2407
|
+
},
|
|
2408
|
+
warnings: {
|
|
2409
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2410
|
+
},
|
|
2411
|
+
info: {
|
|
2412
|
+
operationComplete: "Operation completed successfully",
|
|
2413
|
+
filesProcessed: {
|
|
2414
|
+
zero: "No files processed",
|
|
2415
|
+
one: "{count} file processed",
|
|
2416
|
+
other: "{count} files processed"
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
// ../packager/packager-core/src/i18n/locales/zu.ts
|
|
2423
|
+
var zu2 = {
|
|
2424
|
+
toolCore: {
|
|
2425
|
+
errors: {
|
|
2426
|
+
internal: "Internal error: {message}",
|
|
2427
|
+
fileNotFound: "File not found: {path}",
|
|
2428
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
2429
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
2430
|
+
directoryNotFound: "Directory not found: {path}",
|
|
2431
|
+
invalidPath: "{path} is not a valid path",
|
|
2432
|
+
operationCanceled: "Operation was canceled",
|
|
2433
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
2434
|
+
},
|
|
2435
|
+
progress: {
|
|
2436
|
+
copying: "Copying files...",
|
|
2437
|
+
building: "Building project...",
|
|
2438
|
+
packaging: "Creating package...",
|
|
2439
|
+
validating: "Validating...",
|
|
2440
|
+
analyzing: "Analyzing...",
|
|
2441
|
+
restoring: "Restoring dependencies..."
|
|
2442
|
+
},
|
|
2443
|
+
validation: {
|
|
2444
|
+
requiredField: "{field} is required",
|
|
2445
|
+
invalidValue: "Invalid value for {field}",
|
|
2446
|
+
pathNotFound: "Path not found: {path}",
|
|
2447
|
+
fileRequired: "File is required: {path}",
|
|
2448
|
+
directoryRequired: "Directory is required: {path}"
|
|
2449
|
+
},
|
|
2450
|
+
warnings: {
|
|
2451
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2452
|
+
},
|
|
2453
|
+
info: {
|
|
2454
|
+
operationComplete: "Operation completed successfully",
|
|
2455
|
+
filesProcessed: {
|
|
2456
|
+
zero: "No files processed",
|
|
2457
|
+
one: "{count} file processed",
|
|
2458
|
+
other: "{count} files processed"
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
// ../packager/packager-core/src/i18n/translation-service.ts
|
|
2465
|
+
class TranslationService2 {
|
|
2466
|
+
static instance;
|
|
2467
|
+
currentLocale = "en";
|
|
2468
|
+
constructor() {}
|
|
2469
|
+
static getInstance() {
|
|
2470
|
+
if (!TranslationService2.instance) {
|
|
2471
|
+
TranslationService2.instance = new TranslationService2;
|
|
2472
|
+
}
|
|
2473
|
+
return TranslationService2.instance;
|
|
2474
|
+
}
|
|
2475
|
+
setLocale(locale) {
|
|
2476
|
+
this.currentLocale = I18nManager2.setLocale(locale);
|
|
2477
|
+
}
|
|
2478
|
+
getLocale() {
|
|
2479
|
+
return this.currentLocale;
|
|
2480
|
+
}
|
|
2481
|
+
t(key, params) {
|
|
2482
|
+
return I18nManager2.t(key, params, this.currentLocale);
|
|
2483
|
+
}
|
|
2484
|
+
tLocale(key, locale, params) {
|
|
2485
|
+
return I18nManager2.t(key, params, locale);
|
|
2486
|
+
}
|
|
2487
|
+
has(key) {
|
|
2488
|
+
return I18nManager2.has(key, this.currentLocale);
|
|
2489
|
+
}
|
|
2490
|
+
getAvailableLocales() {
|
|
2491
|
+
return I18nManager2.getAvailableLocales();
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
var translate2 = TranslationService2.getInstance();
|
|
2495
|
+
|
|
2496
|
+
// ../packager/packager-core/src/i18n/index.ts
|
|
2497
|
+
I18nManager2.registerTranslations("en", en2);
|
|
2498
|
+
I18nManager2.registerTranslations("de", de2);
|
|
2499
|
+
I18nManager2.registerTranslations("es", es2);
|
|
2500
|
+
I18nManager2.registerTranslations("es-mx", es_MX2);
|
|
2501
|
+
I18nManager2.registerTranslations("fr", fr2);
|
|
2502
|
+
I18nManager2.registerTranslations("ja", ja2);
|
|
2503
|
+
I18nManager2.registerTranslations("ko", ko2);
|
|
2504
|
+
I18nManager2.registerTranslations("pt", pt2);
|
|
2505
|
+
I18nManager2.registerTranslations("pt-br", pt_BR2);
|
|
2506
|
+
I18nManager2.registerTranslations("ro", ro2);
|
|
2507
|
+
I18nManager2.registerTranslations("ru", ru2);
|
|
2508
|
+
I18nManager2.registerTranslations("tr", tr2);
|
|
2509
|
+
I18nManager2.registerTranslations("zh-cn", zh_CN2);
|
|
2510
|
+
I18nManager2.registerTranslations("zh-tw", zh_TW2);
|
|
2511
|
+
I18nManager2.registerTranslations("zu", zu2);
|
|
2512
|
+
I18nManager2.setLocale("en");
|
|
2513
|
+
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
2514
|
+
class ToolsFactoryRepository2 {
|
|
2515
|
+
projectFactoryMap = new Map;
|
|
2516
|
+
solutionFactory = null;
|
|
2517
|
+
registerProjectToolFactory(factory) {
|
|
2518
|
+
for (const type of factory.supportedTypes) {
|
|
2519
|
+
const existing = this.projectFactoryMap.get(type);
|
|
2520
|
+
if (existing) {
|
|
2521
|
+
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
2522
|
+
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
2523
|
+
}
|
|
2524
|
+
continue;
|
|
2525
|
+
}
|
|
2526
|
+
this.projectFactoryMap.set(type, factory);
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
registerSolutionToolFactory(factory) {
|
|
2530
|
+
this.solutionFactory = factory;
|
|
2531
|
+
}
|
|
2532
|
+
getSolutionToolFactory() {
|
|
2533
|
+
if (!this.solutionFactory) {
|
|
2534
|
+
throw new Error("No solution tool factory is registered");
|
|
2535
|
+
}
|
|
2536
|
+
return this.solutionFactory;
|
|
2537
|
+
}
|
|
2538
|
+
canHandleProject(projectType) {
|
|
2539
|
+
return this.projectFactoryMap.has(projectType);
|
|
2540
|
+
}
|
|
2541
|
+
getProjectToolFactory(projectType) {
|
|
2542
|
+
const factory = this.projectFactoryMap.get(projectType);
|
|
2543
|
+
if (!factory) {
|
|
2544
|
+
const known = [...this.projectFactoryMap.keys()].join(", ");
|
|
2545
|
+
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it. ` + `Project types that can be packed: ${known || "none"}.`);
|
|
2546
|
+
}
|
|
2547
|
+
return factory;
|
|
2548
|
+
}
|
|
2549
|
+
reset() {
|
|
2550
|
+
this.projectFactoryMap.clear();
|
|
2551
|
+
this.solutionFactory = null;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
var REGISTRY_KEY2 = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
2555
|
+
var _global2 = globalThis;
|
|
2556
|
+
if (!_global2[REGISTRY_KEY2]) {
|
|
2557
|
+
_global2[REGISTRY_KEY2] = new ToolsFactoryRepository2;
|
|
2558
|
+
}
|
|
2559
|
+
var toolsFactoryRepository2 = _global2[REGISTRY_KEY2];
|
|
2560
|
+
// src/packager-tool.ts
|
|
2561
|
+
function registerPackagerFactories() {
|
|
2562
|
+
toolsFactoryRepository2.registerProjectToolFactory(new EntityToolFactory);
|
|
2563
|
+
}
|
|
2564
|
+
export {
|
|
2565
|
+
registerPackagerFactories
|
|
2566
|
+
};
|
|
2567
|
+
|
|
2568
|
+
//# debugId=FE1A9AF3349DA14F64756E2164756E21
|