@uipath/case-tool 1.206.0-preview.291 → 1.206.0-preview.292
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/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{business-rule-export-jv60r9jf.js → business-rule-export-vpwxm2as.js} +1 -1
- package/dist/{case-debug-solution-projects-hvgam29v.js → case-debug-solution-projects-qn1mee4m.js} +1 -1
- package/dist/{case-debug-studio-web-service-30xfmycf.js → case-debug-studio-web-service-eep1zf72.js} +2 -2
- package/dist/{case-validate-service-bhdg3acy.js → case-validate-service-7wh4gw45.js} +1 -1
- package/dist/{connector-enrichment-service-36e40yca.js → connector-enrichment-service-aswbthwj.js} +5 -5
- package/dist/{connector-lookup-service-kjbgz0p9.js → connector-lookup-service-gpv9rr6h.js} +2 -2
- package/dist/{embedded-file-reader-0228j82a.js → embedded-file-reader-pxpwcq3n.js} +16 -16
- package/dist/{enrichment-service-wpprec7k.js → enrichment-service-1kptvbx2.js} +1 -1
- package/dist/{first-party-service-ahcc6xc6.js → first-party-service-6b9ajm57.js} +1 -1
- package/dist/{index-ec115v05.js → index-03rhct2q.js} +2837 -1108
- package/dist/{index-0394b1hp.js → index-980430ze.js} +3 -3
- package/dist/{index-baecygxw.js → index-9v5cv66w.js} +1 -1
- package/dist/{index-z2qk2qn6.js → index-amqqhge1.js} +1 -1
- package/dist/{index-tjj8jrhv.js → index-kt72943w.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{node-sync-service-penfk8nv.js → node-sync-service-wpd6ej9w.js} +3 -3
- package/dist/{packager-tool-wgh1kg4w.js → packager-tool-6xs4xpq2.js} +27 -27
- package/dist/{packager-tool-9a4byhyg.js → packager-tool-8qm6hm5h.js} +3 -3
- package/dist/{packager-tool-b2d05djh.js → packager-tool-d74fh5hf.js} +1 -1
- package/dist/packager-tool-jjkypwge.js +1324 -0
- package/dist/{packager-tool-pfbxxpa0.js → packager-tool-n2wcsqfg.js} +1 -1
- package/dist/{packager-tool-abe5g05a.js → packager-tool-nfpay6r7.js} +3 -3
- package/dist/{packager-tool-91ncc5mt.js → packager-tool-taz65ewk.js} +1 -1
- package/dist/{packager-tool-5ne030sy.js → packager-tool-x2rdksrd.js} +6 -6
- package/dist/{project-artifacts-q0c0zghw.js → project-artifacts-pbemmgg2.js} +1 -1
- package/dist/{resourcesSyncService-bt0frwff.js → resourcesSyncService-rn29rpnz.js} +3 -3
- package/dist/{sdd-resolve-service-6nt10vhq.js → sdd-resolve-service-10e0rvzs.js} +4 -4
- package/dist/{sdd-resolve-siblings-f6hwzb37.js → sdd-resolve-siblings-wc0y2902.js} +1 -1
- package/dist/solution-definition-helper-6zwd9hjs.js +8 -0
- package/dist/tool.js +1 -1
- package/dist/{trigger-enrichment-service-m9t7s1qv.js → trigger-enrichment-service-cje982nj.js} +5 -5
- package/package.json +2 -2
- package/dist/packager-tool-mm1x18d6.js +0 -537
- /package/dist/{index-5pzp2qeb.js → index-1797pvrb.js} +0 -0
- /package/dist/{sdd-convert-service-ffbx00k6.js → sdd-convert-service-53gbscbm.js} +0 -0
|
@@ -0,0 +1,1324 @@
|
|
|
1
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/json-serializer-names.js
|
|
2
|
+
var JsonSerializerNames2 = {
|
|
3
|
+
DefaultCaseInsensitive: "DefaultCaseInsensitive",
|
|
4
|
+
CaseInsensitive: "CaseInsensitive",
|
|
5
|
+
Indented: "Indented",
|
|
6
|
+
CamelCase: "CamelCase",
|
|
7
|
+
CaseInsensitiveIndented: "CaseInsensitiveIndented",
|
|
8
|
+
IndentedIgnoreNull: "IndentedIgnoreNull",
|
|
9
|
+
PreservePropertyNames: "PreservePropertyNames",
|
|
10
|
+
CamelCaseIndented: "CamelCaseIndented",
|
|
11
|
+
AllNames: [
|
|
12
|
+
"DefaultCaseInsensitive",
|
|
13
|
+
"CaseInsensitive",
|
|
14
|
+
"Indented",
|
|
15
|
+
"CamelCase",
|
|
16
|
+
"CaseInsensitiveIndented",
|
|
17
|
+
"IndentedIgnoreNull",
|
|
18
|
+
"PreservePropertyNames",
|
|
19
|
+
"CamelCaseIndented"
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/json-serializer.js
|
|
24
|
+
var VERBATIM_VALUE_PROPERTIES = new Set([
|
|
25
|
+
"spec"
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
class JsonSerializer2 {
|
|
29
|
+
serialize(value) {
|
|
30
|
+
if (value == null)
|
|
31
|
+
return null;
|
|
32
|
+
let toSerialize = value;
|
|
33
|
+
if (this.options.ignoreNull)
|
|
34
|
+
toSerialize = this.removeNullValues(value);
|
|
35
|
+
if (this.options.camelCase && !this.options.preservePropertyNames)
|
|
36
|
+
toSerialize = this.toCamelCase(toSerialize);
|
|
37
|
+
if (this.options.enumCamelCase !== false)
|
|
38
|
+
toSerialize = this.convertEnumValuesToCamelCase(toSerialize);
|
|
39
|
+
const json = JSON.stringify(toSerialize, null, this.options.indented ? 2 : undefined);
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
async serializeAsync(stream, value, cancellationToken) {
|
|
43
|
+
cancellationToken?.throwIfAborted?.();
|
|
44
|
+
const json = this.serialize(value);
|
|
45
|
+
if (json === null)
|
|
46
|
+
return;
|
|
47
|
+
const writer = stream.getWriter();
|
|
48
|
+
try {
|
|
49
|
+
const bytes = this.encoder.encode(json);
|
|
50
|
+
await writer.write(bytes);
|
|
51
|
+
} finally {
|
|
52
|
+
writer.releaseLock();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
serializeToUtf8Bytes(value) {
|
|
56
|
+
const json = this.serialize(value);
|
|
57
|
+
if (json === null)
|
|
58
|
+
return new Uint8Array(0);
|
|
59
|
+
return this.encoder.encode(json);
|
|
60
|
+
}
|
|
61
|
+
deserialize(value) {
|
|
62
|
+
if (value == null || value === "")
|
|
63
|
+
return null;
|
|
64
|
+
try {
|
|
65
|
+
let cleanValue = value.charCodeAt(0) === 65279 ? value.slice(1) : value;
|
|
66
|
+
if (cleanValue.charCodeAt(cleanValue.length - 1) === 26)
|
|
67
|
+
cleanValue = cleanValue.slice(0, -1);
|
|
68
|
+
const parsed = JSON.parse(cleanValue);
|
|
69
|
+
return parsed;
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
deserializeAsType(value, _type) {
|
|
75
|
+
return this.deserialize(value);
|
|
76
|
+
}
|
|
77
|
+
removeNullValues(obj) {
|
|
78
|
+
if (obj == null)
|
|
79
|
+
return obj;
|
|
80
|
+
if (Array.isArray(obj))
|
|
81
|
+
return obj.map((item) => this.removeNullValues(item));
|
|
82
|
+
if (typeof obj == "object") {
|
|
83
|
+
const result = {};
|
|
84
|
+
for (const [key, val] of Object.entries(obj))
|
|
85
|
+
if (val != null)
|
|
86
|
+
result[key] = this.removeNullValues(val);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
return obj;
|
|
90
|
+
}
|
|
91
|
+
toCamelCase(obj) {
|
|
92
|
+
if (obj == null)
|
|
93
|
+
return obj;
|
|
94
|
+
if (Array.isArray(obj))
|
|
95
|
+
return obj.map((item) => this.toCamelCase(item));
|
|
96
|
+
if (typeof obj == "object") {
|
|
97
|
+
const result = {};
|
|
98
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
99
|
+
const camelKey = key.charAt(0).toLowerCase() + key.slice(1);
|
|
100
|
+
result[camelKey] = this.toCamelCase(val);
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
convertEnumValuesToCamelCase(obj, className) {
|
|
107
|
+
if (obj == null)
|
|
108
|
+
return obj;
|
|
109
|
+
if (typeof obj == "string")
|
|
110
|
+
return this.tryConvertEnumStringToCamelCase(obj, undefined, undefined);
|
|
111
|
+
if (Array.isArray(obj))
|
|
112
|
+
return obj.map((item) => this.convertEnumValuesToCamelCase(item, className));
|
|
113
|
+
if (typeof obj == "object") {
|
|
114
|
+
const result = {};
|
|
115
|
+
const currentClassName = obj.constructor?.name !== "Object" ? obj.constructor.name : className;
|
|
116
|
+
for (const [key, val] of Object.entries(obj))
|
|
117
|
+
if (VERBATIM_VALUE_PROPERTIES.has(key))
|
|
118
|
+
result[key] = val;
|
|
119
|
+
else if (typeof val == "string")
|
|
120
|
+
result[key] = this.tryConvertEnumStringToCamelCase(val, currentClassName, key);
|
|
121
|
+
else if (Array.isArray(val))
|
|
122
|
+
result[key] = val.map((item) => {
|
|
123
|
+
if (typeof item == "string")
|
|
124
|
+
return this.tryConvertEnumStringToCamelCase(item, currentClassName, key);
|
|
125
|
+
return this.convertEnumValuesToCamelCase(item, currentClassName);
|
|
126
|
+
});
|
|
127
|
+
else
|
|
128
|
+
result[key] = this.convertEnumValuesToCamelCase(val, currentClassName);
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
return obj;
|
|
132
|
+
}
|
|
133
|
+
tryConvertEnumStringToCamelCase(value, className, propertyName) {
|
|
134
|
+
if (this.camelCaseEnumProperties.size > 0) {
|
|
135
|
+
if (!propertyName || !this.isKnownCamelCaseEnum(className, propertyName))
|
|
136
|
+
return value;
|
|
137
|
+
} else if (propertyName && this.isInPropertySet(this.pascalCaseEnumProperties, className, propertyName))
|
|
138
|
+
return value;
|
|
139
|
+
if (/^[A-Z][a-zA-Z0-9]*$/.test(value))
|
|
140
|
+
return value.charAt(0).toLowerCase() + value.slice(1);
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
isKnownCamelCaseEnum(className, propertyName) {
|
|
144
|
+
if (this.isInPropertySet(this.pascalCaseEnumProperties, className, propertyName))
|
|
145
|
+
return false;
|
|
146
|
+
return this.isInPropertySet(this.camelCaseEnumProperties, className, propertyName);
|
|
147
|
+
}
|
|
148
|
+
isInPropertySet(propertySet, className, propertyName) {
|
|
149
|
+
if (className && propertySet.has(`${className}.${propertyName}`))
|
|
150
|
+
return true;
|
|
151
|
+
return propertySet.has(propertyName);
|
|
152
|
+
}
|
|
153
|
+
constructor(options = {}) {
|
|
154
|
+
this.isContextBased = false;
|
|
155
|
+
this.encoder = new TextEncoder;
|
|
156
|
+
this.options = options;
|
|
157
|
+
this.camelCaseEnumProperties = new Set(options.camelCaseEnumProperties ?? []);
|
|
158
|
+
this.pascalCaseEnumProperties = new Set(options.pascalCaseEnumProperties ?? []);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/pascal-case-enum-properties.js
|
|
163
|
+
var CAMEL_CASE_ENUM_PROPERTIES2 = [
|
|
164
|
+
"scope",
|
|
165
|
+
"replaceOption",
|
|
166
|
+
"lookupStrategy",
|
|
167
|
+
"folderType"
|
|
168
|
+
];
|
|
169
|
+
var SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2 = [
|
|
170
|
+
"propertyCategory"
|
|
171
|
+
];
|
|
172
|
+
var RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2 = [
|
|
173
|
+
"ValidationState.errorSeverity",
|
|
174
|
+
"ValidationState.errorType",
|
|
175
|
+
"AddOrUpdateResourceToSolutionResponse.status",
|
|
176
|
+
"Overwrite.type",
|
|
177
|
+
"OverwriteValidationError.severity",
|
|
178
|
+
"ProjectResourceDescriptor.provisionType"
|
|
179
|
+
];
|
|
180
|
+
var PASCAL_CASE_ENUM_PROPERTIES2 = [
|
|
181
|
+
...SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2,
|
|
182
|
+
...RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/json-serializer-factory.js
|
|
186
|
+
class JsonSerializerFactory2 {
|
|
187
|
+
get() {
|
|
188
|
+
return this.defaultSerializer;
|
|
189
|
+
}
|
|
190
|
+
getByName(name) {
|
|
191
|
+
if (!name)
|
|
192
|
+
return this.defaultSerializer;
|
|
193
|
+
let serializer = this.namedSerializers.get(name);
|
|
194
|
+
if (!serializer) {
|
|
195
|
+
serializer = this.createNamedSerializer(name);
|
|
196
|
+
this.namedSerializers.set(name, serializer);
|
|
197
|
+
}
|
|
198
|
+
return serializer;
|
|
199
|
+
}
|
|
200
|
+
initializePredefinedSerializers() {
|
|
201
|
+
for (const name of JsonSerializerNames2.AllNames)
|
|
202
|
+
this.namedSerializers.set(name, this.createNamedSerializer(name));
|
|
203
|
+
}
|
|
204
|
+
createNamedSerializer(name) {
|
|
205
|
+
const options = this.createOptionsForName(name);
|
|
206
|
+
return new JsonSerializer2(options);
|
|
207
|
+
}
|
|
208
|
+
createOptionsForName(name) {
|
|
209
|
+
const options = {
|
|
210
|
+
...this.baseOptions
|
|
211
|
+
};
|
|
212
|
+
switch (name) {
|
|
213
|
+
case JsonSerializerNames2.DefaultCaseInsensitive:
|
|
214
|
+
return {
|
|
215
|
+
caseInsensitive: true
|
|
216
|
+
};
|
|
217
|
+
case JsonSerializerNames2.CaseInsensitive:
|
|
218
|
+
options.caseInsensitive = true;
|
|
219
|
+
break;
|
|
220
|
+
case JsonSerializerNames2.Indented:
|
|
221
|
+
options.indented = true;
|
|
222
|
+
break;
|
|
223
|
+
case JsonSerializerNames2.CamelCase:
|
|
224
|
+
options.camelCase = true;
|
|
225
|
+
break;
|
|
226
|
+
case JsonSerializerNames2.CaseInsensitiveIndented:
|
|
227
|
+
options.caseInsensitive = true;
|
|
228
|
+
options.indented = true;
|
|
229
|
+
break;
|
|
230
|
+
case JsonSerializerNames2.IndentedIgnoreNull:
|
|
231
|
+
options.indented = true;
|
|
232
|
+
options.ignoreNull = true;
|
|
233
|
+
break;
|
|
234
|
+
case JsonSerializerNames2.PreservePropertyNames:
|
|
235
|
+
options.preservePropertyNames = true;
|
|
236
|
+
options.camelCase = false;
|
|
237
|
+
break;
|
|
238
|
+
case JsonSerializerNames2.CamelCaseIndented:
|
|
239
|
+
options.indented = true;
|
|
240
|
+
options.camelCase = true;
|
|
241
|
+
options.ignoreNull = true;
|
|
242
|
+
break;
|
|
243
|
+
default:
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
return options;
|
|
247
|
+
}
|
|
248
|
+
constructor(options) {
|
|
249
|
+
const defaults = {
|
|
250
|
+
camelCase: true,
|
|
251
|
+
enumCamelCase: true,
|
|
252
|
+
camelCaseEnumProperties: CAMEL_CASE_ENUM_PROPERTIES2,
|
|
253
|
+
pascalCaseEnumProperties: PASCAL_CASE_ENUM_PROPERTIES2
|
|
254
|
+
};
|
|
255
|
+
this.baseOptions = options ? {
|
|
256
|
+
...defaults,
|
|
257
|
+
...options
|
|
258
|
+
} : defaults;
|
|
259
|
+
this.defaultSerializer = new JsonSerializer2(this.baseOptions);
|
|
260
|
+
this.namedSerializers = new Map;
|
|
261
|
+
this.initializePredefinedSerializers();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/serializer-proxy.js
|
|
266
|
+
class JsonSerializerProxy2 {
|
|
267
|
+
serialize(value) {
|
|
268
|
+
return this.jsonSerializer.serialize(value);
|
|
269
|
+
}
|
|
270
|
+
serializeAsync(stream, value, cancellationToken) {
|
|
271
|
+
return this.jsonSerializer.serializeAsync(stream, value, cancellationToken);
|
|
272
|
+
}
|
|
273
|
+
serializeToUtf8Bytes(value) {
|
|
274
|
+
return this.jsonSerializer.serializeToUtf8Bytes(value);
|
|
275
|
+
}
|
|
276
|
+
deserialize(value) {
|
|
277
|
+
return this.jsonSerializer.deserialize(value);
|
|
278
|
+
}
|
|
279
|
+
tryDeserializeObject(json) {
|
|
280
|
+
if (!json || json.trim() === "")
|
|
281
|
+
return null;
|
|
282
|
+
try {
|
|
283
|
+
return this.jsonSerializer.isContextBased ? this.jsonSerializer.deserialize(json) : this.caseInsensitiveSerializer.deserialize(json);
|
|
284
|
+
} catch (ex) {
|
|
285
|
+
this.logger.info("Deserialization failed with exception.", ex);
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
tryDeserialize(value) {
|
|
290
|
+
if (!value || value.trim() === "")
|
|
291
|
+
return [
|
|
292
|
+
false,
|
|
293
|
+
null
|
|
294
|
+
];
|
|
295
|
+
try {
|
|
296
|
+
const result = this.jsonSerializer.deserialize(value);
|
|
297
|
+
return [
|
|
298
|
+
true,
|
|
299
|
+
result
|
|
300
|
+
];
|
|
301
|
+
} catch (ex) {
|
|
302
|
+
this.logger.info("Deserialization failed with exception.", ex);
|
|
303
|
+
return [
|
|
304
|
+
false,
|
|
305
|
+
null
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
constructor(jsonSerializerFactory, loggerFactory) {
|
|
310
|
+
this.jsonSerializer = jsonSerializerFactory.get();
|
|
311
|
+
this.caseInsensitiveSerializer = jsonSerializerFactory.getByName(JsonSerializerNames2.CaseInsensitive);
|
|
312
|
+
this.logger = loggerFactory.create("JsonSerializerProxy");
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/serialization/stream-serializer.js
|
|
317
|
+
class StreamSerializer2 {
|
|
318
|
+
async serializeAsync(data, cancellationToken) {
|
|
319
|
+
cancellationToken?.throwIfAborted?.();
|
|
320
|
+
const serializer = this.jsonSerializerFactory.getByName(JsonSerializerNames2.PreservePropertyNames);
|
|
321
|
+
const serializedContent = serializer.serialize(data);
|
|
322
|
+
const encoder = new TextEncoder;
|
|
323
|
+
const bytes = serializedContent ? encoder.encode(serializedContent) : new Uint8Array(0);
|
|
324
|
+
let streamClosed = false;
|
|
325
|
+
const stream = new ReadableStream({
|
|
326
|
+
start(controller) {
|
|
327
|
+
controller.enqueue(bytes);
|
|
328
|
+
controller.close();
|
|
329
|
+
streamClosed = true;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
const disposeStream = this.disposeStream;
|
|
333
|
+
return {
|
|
334
|
+
stream,
|
|
335
|
+
dispose() {
|
|
336
|
+
if (disposeStream && !streamClosed)
|
|
337
|
+
stream.cancel().catch(() => {});
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
constructor(jsonSerializerFactory, disposeStream = true) {
|
|
342
|
+
this.jsonSerializerFactory = jsonSerializerFactory;
|
|
343
|
+
this.disposeStream = disposeStream;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/error-codes.js
|
|
347
|
+
var ErrorCodes = {
|
|
348
|
+
UnknownException: "0000",
|
|
349
|
+
AuthorizationException: "0004",
|
|
350
|
+
AuthenticationFailed: "0004",
|
|
351
|
+
ResourceNotFound: "1000",
|
|
352
|
+
FolderNotFound: "1001",
|
|
353
|
+
ResourcesNotFound: "1002",
|
|
354
|
+
ResourceLinkRemovedFromSource: "1003",
|
|
355
|
+
ImportCancelled: "1005",
|
|
356
|
+
InvalidBindings: "1006",
|
|
357
|
+
FileNotFound: "1008",
|
|
358
|
+
BindingsFileNotFound: "1010",
|
|
359
|
+
BindingsResourceCannotBeOverridden: "1011",
|
|
360
|
+
BindingsResourceNotFound: "1012",
|
|
361
|
+
NullOrEmptyAccessToken: "1013",
|
|
362
|
+
InvalidInput: "InvalidInput",
|
|
363
|
+
InvalidConfiguration: "InvalidConfiguration",
|
|
364
|
+
Resources: {
|
|
365
|
+
InvalidApiVersion: "2001",
|
|
366
|
+
InvalidName: "2002",
|
|
367
|
+
DuplicateProperties: "2003",
|
|
368
|
+
DuplicateResourceName: "2004",
|
|
369
|
+
PropertyIsRequired: "2005",
|
|
370
|
+
ChoiceTypeMissingOrInvalid: "2006",
|
|
371
|
+
InvalidPropertyType: "2007",
|
|
372
|
+
InvalidEnumValue: "2008",
|
|
373
|
+
InvalidChoiceValue: "2009",
|
|
374
|
+
RegularExpressionDoesNotMatch: "2010",
|
|
375
|
+
InvalidMultiselectValue: "2011",
|
|
376
|
+
ValueOutOfRange: "2012",
|
|
377
|
+
DeletingHiddenResourceIsNotAllowed: "2013",
|
|
378
|
+
InvalidResourceMetadataIdentifier: "2014",
|
|
379
|
+
DeletingProjectArtefactResourceIsNotAllowed: "2015",
|
|
380
|
+
ResourceHasNoFile: "2017",
|
|
381
|
+
InvalidResourceType: "2018",
|
|
382
|
+
DeletingResourceThatIsReferencedByOtherResourcesIsNotAllowed: "2019",
|
|
383
|
+
SyncingProcessArtefactResourceIsNotAllowed: "2020",
|
|
384
|
+
MissingDependencies: "2021",
|
|
385
|
+
MissingFileDependencies: "2022",
|
|
386
|
+
ResourceAttributeMismatch: "2023",
|
|
387
|
+
AppSystemNameConflict: "2024",
|
|
388
|
+
InvalidResourceFile: "2025",
|
|
389
|
+
DuplicatePackageName: "2026",
|
|
390
|
+
TooManySearchKinds: "2027",
|
|
391
|
+
SearchTypesWithSeveralKinds: "2028",
|
|
392
|
+
ResourceNotFound: "1000",
|
|
393
|
+
ResourceAlreadyExists: "Resources.ResourceAlreadyExists",
|
|
394
|
+
ResourceDependencyNotFound: "Resources.ResourceDependencyNotFound",
|
|
395
|
+
FileDependencyNotFound: "Resources.FileDependencyNotFound",
|
|
396
|
+
PropertyInvalidFormat: "Resources.PropertyInvalidFormat",
|
|
397
|
+
PropertyInvalidValue: "Resources.PropertyInvalidValue"
|
|
398
|
+
},
|
|
399
|
+
Solutions: {
|
|
400
|
+
ConfigurationNotFound: "3002",
|
|
401
|
+
SolutionNotFound: "3001",
|
|
402
|
+
SolutionInvalidState: "Solution.SolutionInvalidState",
|
|
403
|
+
SolutionReadOnly: "Solution.SolutionReadOnly"
|
|
404
|
+
},
|
|
405
|
+
Metadata: {
|
|
406
|
+
ResourceMetadataNotFound: "5001"
|
|
407
|
+
},
|
|
408
|
+
Project: {
|
|
409
|
+
ProjectNotFound: "Project.ProjectNotFound",
|
|
410
|
+
ProjectAlreadyExists: "Project.ProjectAlreadyExists",
|
|
411
|
+
ProjectInvalidType: "Project.ProjectInvalidType"
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/bad-request-exception.js
|
|
416
|
+
class BadRequestException extends Error {
|
|
417
|
+
static create(errorCode, message, ...params) {
|
|
418
|
+
const formattedMessage = formatMessage(message, params);
|
|
419
|
+
return new BadRequestException(errorCode, formattedMessage);
|
|
420
|
+
}
|
|
421
|
+
constructor(errorCode, message, exceptionData) {
|
|
422
|
+
super(message);
|
|
423
|
+
this.name = "BadRequestException";
|
|
424
|
+
this.errorCode = errorCode;
|
|
425
|
+
this.exceptionData = exceptionData;
|
|
426
|
+
if (Error.captureStackTrace)
|
|
427
|
+
Error.captureStackTrace(this, BadRequestException);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function formatMessage(template, params) {
|
|
431
|
+
return template.replace(/{(\d+)}/g, (match, index) => {
|
|
432
|
+
const paramIndex = parseInt(index, 10);
|
|
433
|
+
if (paramIndex < params.length) {
|
|
434
|
+
const param = params[paramIndex];
|
|
435
|
+
return param != null ? String(param) : "";
|
|
436
|
+
}
|
|
437
|
+
return match;
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/invalid-operation-exception.js
|
|
442
|
+
class InvalidOperationException extends Error {
|
|
443
|
+
constructor(message) {
|
|
444
|
+
super(message);
|
|
445
|
+
this.name = "InvalidOperationException";
|
|
446
|
+
if (Error.captureStackTrace)
|
|
447
|
+
Error.captureStackTrace(this, InvalidOperationException);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/services/metadata/types.js
|
|
452
|
+
var types_ResourceScope = /* @__PURE__ */ function(ResourceScope) {
|
|
453
|
+
ResourceScope["Folder"] = "Folder";
|
|
454
|
+
ResourceScope["Tenant"] = "Tenant";
|
|
455
|
+
ResourceScope["FolderAndTenant"] = "FolderAndTenant";
|
|
456
|
+
return ResourceScope;
|
|
457
|
+
}({});
|
|
458
|
+
function toResourceIdentifier(metadata, version) {
|
|
459
|
+
return {
|
|
460
|
+
kind: metadata.kind,
|
|
461
|
+
type: metadata.type,
|
|
462
|
+
version: version.version.uri
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
function toServiceName(version) {
|
|
466
|
+
return version.version.uri.split("/")[0] ?? "";
|
|
467
|
+
}
|
|
468
|
+
function getVersionOrDefault(metadata, apiVersion) {
|
|
469
|
+
if (!apiVersion)
|
|
470
|
+
return metadata.versions.find((v) => v.version.isCurrent);
|
|
471
|
+
return metadata.versions.find((v) => v.version.uri.toLowerCase() === apiVersion.toLowerCase());
|
|
472
|
+
}
|
|
473
|
+
var REFERENCE_TYPE = "reference";
|
|
474
|
+
var FILE_REFERENCE_TYPE = "fileReference";
|
|
475
|
+
var SECRET_TYPE = "secret";
|
|
476
|
+
var ARRAY_TYPE = "array";
|
|
477
|
+
var FILE_KIND = "file";
|
|
478
|
+
function isSingleReferenceProperty(p) {
|
|
479
|
+
return p.type === REFERENCE_TYPE || p.type === FILE_REFERENCE_TYPE;
|
|
480
|
+
}
|
|
481
|
+
function isListOfReferenceProperties(p) {
|
|
482
|
+
return p.type === ARRAY_TYPE && p["arrayResourceType"] === REFERENCE_TYPE;
|
|
483
|
+
}
|
|
484
|
+
function isAnyReferenceProperty(p) {
|
|
485
|
+
return isSingleReferenceProperty(p) || isListOfReferenceProperties(p);
|
|
486
|
+
}
|
|
487
|
+
function isSecretProperty(p) {
|
|
488
|
+
return p.type === SECRET_TYPE;
|
|
489
|
+
}
|
|
490
|
+
var NAME_PROPERTY = "name";
|
|
491
|
+
function isNameProperty(p) {
|
|
492
|
+
return p.property.toLowerCase() === NAME_PROPERTY;
|
|
493
|
+
}
|
|
494
|
+
function isFileReferenceProperty(p) {
|
|
495
|
+
return p.type === FILE_REFERENCE_TYPE && p["referenceKind"] === FILE_KIND;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/resource-definition-extensions.js
|
|
499
|
+
var WellKnownProjectType = {
|
|
500
|
+
WebApp: "webapp",
|
|
501
|
+
Process: "process"
|
|
502
|
+
};
|
|
503
|
+
var WellKnownPropertyNames = {
|
|
504
|
+
Name: "name",
|
|
505
|
+
PackageName: "packageName",
|
|
506
|
+
Description: "description",
|
|
507
|
+
UiappFile: "uiappFile"
|
|
508
|
+
};
|
|
509
|
+
var ExcludedKindsAndTypes = [
|
|
510
|
+
"webapp"
|
|
511
|
+
];
|
|
512
|
+
var FailOnNameConflictKinds = [
|
|
513
|
+
"entity"
|
|
514
|
+
];
|
|
515
|
+
function toResourceIdentifier2(resource, trimVersion = false, ignoreType = false) {
|
|
516
|
+
return {
|
|
517
|
+
kind: resource.kind,
|
|
518
|
+
type: ignoreType ? undefined : resource.type,
|
|
519
|
+
version: trimVersion ? trimVersionString(resource.apiVersion) : resource.apiVersion
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function trimVersionString(version) {
|
|
523
|
+
if (!version)
|
|
524
|
+
return version;
|
|
525
|
+
const slashIndex = version.indexOf("/");
|
|
526
|
+
if (slashIndex === -1)
|
|
527
|
+
return version;
|
|
528
|
+
return version.substring(0, slashIndex);
|
|
529
|
+
}
|
|
530
|
+
function isExcluded(resource) {
|
|
531
|
+
const type = resource.type?.trim().toLowerCase();
|
|
532
|
+
const kind = resource.kind?.trim().toLowerCase();
|
|
533
|
+
return type !== undefined && ExcludedKindsAndTypes.some((e) => e.toLowerCase() === type) || kind !== undefined && ExcludedKindsAndTypes.some((e) => e.toLowerCase() === kind);
|
|
534
|
+
}
|
|
535
|
+
function isVisible(resource, resourceMetadata) {
|
|
536
|
+
return resourceMetadata.visibleInDesigner && resourceMetadata.scope !== "Tenant" && !isExcluded(resource);
|
|
537
|
+
}
|
|
538
|
+
function filterVisibleFolderResources(resources, metadata) {
|
|
539
|
+
return resources.filter((resource) => {
|
|
540
|
+
const resourceMetadata = findMetadataForResource(resource, metadata);
|
|
541
|
+
return resourceMetadata && isVisible(resource, resourceMetadata);
|
|
542
|
+
}).map((resource) => ({
|
|
543
|
+
...resource
|
|
544
|
+
}));
|
|
545
|
+
}
|
|
546
|
+
function filterHiddenResourceKeys(resources, metadata) {
|
|
547
|
+
const result = new Set;
|
|
548
|
+
for (const resource of resources) {
|
|
549
|
+
const resourceMetadata = findMetadataForResource(resource, metadata);
|
|
550
|
+
if (resourceMetadata && !isVisible(resource, resourceMetadata))
|
|
551
|
+
result.add(resource.key);
|
|
552
|
+
}
|
|
553
|
+
return result;
|
|
554
|
+
}
|
|
555
|
+
function filterHiddenUnsupportingDebugProvisioningKeys(resources, metadata) {
|
|
556
|
+
const result = new Set;
|
|
557
|
+
for (const resource of resources) {
|
|
558
|
+
const resourceMetadata = findMetadataForResource(resource, metadata);
|
|
559
|
+
if (resourceMetadata && !resourceMetadata.supportsDebugProvisioning && !isVisible(resource, resourceMetadata))
|
|
560
|
+
result.add(resource.key);
|
|
561
|
+
}
|
|
562
|
+
return result;
|
|
563
|
+
}
|
|
564
|
+
function supportsDebugProvisioningWithDependencies(solutionResource, directDependencies, resourceMetadata, metadata) {
|
|
565
|
+
if (!resourceMetadata || !resourceMetadata.supportsDebugProvisioning)
|
|
566
|
+
return false;
|
|
567
|
+
return !directDependencies.some((dependency) => {
|
|
568
|
+
const dependencyMetadata = findMetadataForResource(dependency, metadata);
|
|
569
|
+
return dependencyMetadata !== undefined && !dependencyMetadata.supportsDebugProvisioning && !isVisible(dependency, dependencyMetadata);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
function supportsDebugProvisioning(solutionResource, solution, resourceMetadata, hiddenUnsupportingDebugProvisioningKeys) {
|
|
573
|
+
if (!resourceMetadata || !resourceMetadata.supportsDebugProvisioning)
|
|
574
|
+
return false;
|
|
575
|
+
const dependencies = solutionResource.dependencies ?? [];
|
|
576
|
+
for (const dependency of dependencies) {
|
|
577
|
+
const dependentResource = getResource(solution, dependency.name, dependency.kind);
|
|
578
|
+
if (dependentResource && hiddenUnsupportingDebugProvisioningKeys.has(dependentResource.key))
|
|
579
|
+
return false;
|
|
580
|
+
}
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
function isProcessArtefact(processResource) {
|
|
584
|
+
return processResource.isArtefactResource === true && processResource.kind.toLowerCase() === WellKnownProjectType.Process.toLowerCase();
|
|
585
|
+
}
|
|
586
|
+
var PACKAGE_NAME_MAX_LENGTH = 100;
|
|
587
|
+
var PACKAGE_NAME_SEPARATION_CHARS = 2;
|
|
588
|
+
var processTypeToPackageTypeMap = {
|
|
589
|
+
processorchestration: "agentic"
|
|
590
|
+
};
|
|
591
|
+
function truncate(str, maxLength) {
|
|
592
|
+
if (!str)
|
|
593
|
+
return "";
|
|
594
|
+
return str.length <= maxLength ? str : str.substring(0, maxLength);
|
|
595
|
+
}
|
|
596
|
+
function sanitizeNuGetPackageName(packageName) {
|
|
597
|
+
let result = packageName.trim();
|
|
598
|
+
result = result.replace(/\s/g, ".");
|
|
599
|
+
result = result.replace(/[^a-zA-Z0-9.\-]/g, "_");
|
|
600
|
+
result = result.replace(/^[.\-]+|[.\-]+$/g, "");
|
|
601
|
+
result = result.replace(/-{2,}/g, "-");
|
|
602
|
+
result = result.replace(/-\./g, ".");
|
|
603
|
+
result = result.replace(/\.-/g, ".");
|
|
604
|
+
result = result.replace(/\.{2,}/g, ".");
|
|
605
|
+
if (result === "")
|
|
606
|
+
result = "_";
|
|
607
|
+
return result;
|
|
608
|
+
}
|
|
609
|
+
function getPackageType(processResourceType) {
|
|
610
|
+
if (!processResourceType)
|
|
611
|
+
return processResourceType;
|
|
612
|
+
return processTypeToPackageTypeMap[processResourceType.toLowerCase()] ?? processResourceType;
|
|
613
|
+
}
|
|
614
|
+
function generatePackageName(solutionName, projectName, processResourceType) {
|
|
615
|
+
const packageType = getPackageType(processResourceType) ?? "";
|
|
616
|
+
const truncateCharsNo = Math.floor((PACKAGE_NAME_MAX_LENGTH - PACKAGE_NAME_SEPARATION_CHARS - packageType.length) / 2);
|
|
617
|
+
return sanitizeNuGetPackageName(`${truncate(solutionName, truncateCharsNo)}.${packageType}.${truncate(projectName, truncateCharsNo)}`);
|
|
618
|
+
}
|
|
619
|
+
function resolvePackageNameAfterRename(processResource, solutionName, projectName, oldSolutionName, oldProjectName) {
|
|
620
|
+
const currentPackageName = processResource.spec?.[WellKnownPropertyNames.PackageName];
|
|
621
|
+
if (!solutionName)
|
|
622
|
+
return currentPackageName ?? undefined;
|
|
623
|
+
const oldGeneratedPackageName = generatePackageName(oldSolutionName ?? "", oldProjectName ?? processResource.name, processResource.type);
|
|
624
|
+
return currentPackageName && currentPackageName.toLowerCase() !== oldGeneratedPackageName.toLowerCase() ? currentPackageName : generatePackageName(solutionName, projectName, processResource.type);
|
|
625
|
+
}
|
|
626
|
+
function findPackageNameConflict(solution, projectKey, solutionName, packageName) {
|
|
627
|
+
if (!packageName)
|
|
628
|
+
return;
|
|
629
|
+
const wanted = packageName.toLowerCase();
|
|
630
|
+
return solution.resources.find((resource) => resource.projectKey !== undefined && resource.projectKey !== projectKey && resource.kind.toLowerCase() === WellKnownProjectType.Process.toLowerCase() && effectivePackageName(resource, solutionName)?.toLowerCase() === wanted);
|
|
631
|
+
}
|
|
632
|
+
function effectivePackageName(processResource, solutionName) {
|
|
633
|
+
const packageName = processResource.spec?.[WellKnownPropertyNames.PackageName];
|
|
634
|
+
if (packageName)
|
|
635
|
+
return packageName;
|
|
636
|
+
return solutionName ? generatePackageName(solutionName, processResource.name, processResource.type) : undefined;
|
|
637
|
+
}
|
|
638
|
+
function changePackageName(processResource, solutionName, projectName, oldSolutionName, oldProjectName) {
|
|
639
|
+
if (!solutionName)
|
|
640
|
+
return false;
|
|
641
|
+
const spec = processResource.spec ?? {};
|
|
642
|
+
if (!(WellKnownPropertyNames.PackageName in spec))
|
|
643
|
+
spec[WellKnownPropertyNames.PackageName] = null;
|
|
644
|
+
processResource.spec = spec;
|
|
645
|
+
const currentPackageName = spec[WellKnownPropertyNames.PackageName];
|
|
646
|
+
const newPackageName = generatePackageName(solutionName, projectName, processResource.type);
|
|
647
|
+
const projectNameForOldPackage = oldProjectName ?? processResource.name;
|
|
648
|
+
const oldGeneratedPackageName = generatePackageName(oldSolutionName ?? "", projectNameForOldPackage, processResource.type);
|
|
649
|
+
if (!currentPackageName || currentPackageName.toLowerCase() === oldGeneratedPackageName.toLowerCase()) {
|
|
650
|
+
spec[WellKnownPropertyNames.PackageName] = newPackageName;
|
|
651
|
+
renamePackageDependencies(processResource, projectNameForOldPackage, projectName);
|
|
652
|
+
return true;
|
|
653
|
+
}
|
|
654
|
+
return false;
|
|
655
|
+
}
|
|
656
|
+
function renamePackageDependencies(processResource, oldProjectName, newProjectName) {
|
|
657
|
+
if (oldProjectName.toLowerCase() === newProjectName.toLowerCase())
|
|
658
|
+
return;
|
|
659
|
+
if (!processResource.dependencies)
|
|
660
|
+
return;
|
|
661
|
+
for (const dep of processResource.dependencies)
|
|
662
|
+
if (dep.kind.toLowerCase() === "package" && dep.name.toLowerCase() === oldProjectName.toLowerCase())
|
|
663
|
+
dep.name = newProjectName;
|
|
664
|
+
}
|
|
665
|
+
function getDefaultValue(property) {
|
|
666
|
+
const value = property.defaultValue;
|
|
667
|
+
return value !== null && typeof value == "object" ? structuredClone(value) : value;
|
|
668
|
+
}
|
|
669
|
+
function buildDefaultConfiguration(resource, properties) {
|
|
670
|
+
const spec = {};
|
|
671
|
+
for (const prop of properties ?? [])
|
|
672
|
+
spec[prop.property] = getDefaultValue(prop);
|
|
673
|
+
if (WellKnownPropertyNames.Name in spec)
|
|
674
|
+
spec[WellKnownPropertyNames.Name] = resource.name;
|
|
675
|
+
resource.spec = spec;
|
|
676
|
+
resource.locks = [];
|
|
677
|
+
}
|
|
678
|
+
function isDependencyToResource(resource, dependency) {
|
|
679
|
+
return resource.name.trim().toLowerCase() === dependency.name.trim().toLowerCase() && resource.kind.trim().toLowerCase() === dependency.kind.trim().toLowerCase();
|
|
680
|
+
}
|
|
681
|
+
function findResourcesWithReference(solution, resource) {
|
|
682
|
+
return (solution.resources ?? []).filter((r) => r !== resource && (r.dependencies ?? []).some((d) => isDependencyToResource(resource, d)));
|
|
683
|
+
}
|
|
684
|
+
function findResourceDependencies(solution, resource, throwIfMissing = true) {
|
|
685
|
+
const result = new Map;
|
|
686
|
+
const dependencies = resource.dependencies ?? [];
|
|
687
|
+
if (dependencies.length === 0)
|
|
688
|
+
return result;
|
|
689
|
+
const notFound = [];
|
|
690
|
+
for (const dependency of dependencies) {
|
|
691
|
+
const found = (solution.resources ?? []).find((r) => isDependencyToResource(r, dependency));
|
|
692
|
+
if (found)
|
|
693
|
+
result.set(dependency, found);
|
|
694
|
+
else
|
|
695
|
+
notFound.push(dependency);
|
|
696
|
+
}
|
|
697
|
+
if (notFound.length > 0 && throwIfMissing) {
|
|
698
|
+
const names = notFound.map((d) => d.name).join(", ");
|
|
699
|
+
throw new Error(`One or more resource dependencies were not found in the solution. Names: ${names}`);
|
|
700
|
+
}
|
|
701
|
+
return result;
|
|
702
|
+
}
|
|
703
|
+
function getSpecReferences(propertyValue) {
|
|
704
|
+
if (propertyValue == null)
|
|
705
|
+
return [];
|
|
706
|
+
if (Array.isArray(propertyValue))
|
|
707
|
+
return propertyValue.filter((v) => v != null && typeof v == "object");
|
|
708
|
+
if (typeof propertyValue == "object")
|
|
709
|
+
return [
|
|
710
|
+
propertyValue
|
|
711
|
+
];
|
|
712
|
+
return [];
|
|
713
|
+
}
|
|
714
|
+
function specReferenceToObject(ref) {
|
|
715
|
+
const r = ref;
|
|
716
|
+
const result = {};
|
|
717
|
+
if (r["name"] !== undefined)
|
|
718
|
+
result["name"] = r["name"];
|
|
719
|
+
if (r["key"] !== undefined)
|
|
720
|
+
result["key"] = r["key"];
|
|
721
|
+
if (r["folderKey"] !== undefined)
|
|
722
|
+
result["folderKey"] = r["folderKey"];
|
|
723
|
+
if (r["lookupStrategy"] !== undefined)
|
|
724
|
+
result["lookupStrategy"] = r["lookupStrategy"];
|
|
725
|
+
if (r["info"] !== undefined)
|
|
726
|
+
result["info"] = r["info"];
|
|
727
|
+
return result;
|
|
728
|
+
}
|
|
729
|
+
function updateReferenceProps(resource, referenceKind, newName, isMatch, metadata) {
|
|
730
|
+
const spec = resource.spec;
|
|
731
|
+
if (!spec)
|
|
732
|
+
return;
|
|
733
|
+
const referenceProperties = (metadata.spec ?? []).filter((x) => isAnyReferenceProperty(x) && !isFileReferenceProperty(x));
|
|
734
|
+
for (const refProp of referenceProperties) {
|
|
735
|
+
const propertyValue = spec[refProp.property];
|
|
736
|
+
if (propertyValue == null)
|
|
737
|
+
continue;
|
|
738
|
+
const references = getSpecReferences(propertyValue);
|
|
739
|
+
const firstReference = references[0];
|
|
740
|
+
if (firstReference == null)
|
|
741
|
+
continue;
|
|
742
|
+
const refKind = refProp["referenceKind"];
|
|
743
|
+
const refKindStr = typeof refKind == "string" ? refKind : null;
|
|
744
|
+
for (const reference of references)
|
|
745
|
+
if (isMatch(reference) && refKindStr != null && invariantEquals(refKindStr, referenceKind))
|
|
746
|
+
reference.name = newName;
|
|
747
|
+
spec[refProp.property] = isSingleReferenceProperty(refProp) ? specReferenceToObject(firstReference) : references.map(specReferenceToObject);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
function cloneResourceDefinition(resource) {
|
|
751
|
+
return {
|
|
752
|
+
...resource,
|
|
753
|
+
dependencies: resource.dependencies?.map((dependency) => ({
|
|
754
|
+
...dependency
|
|
755
|
+
})),
|
|
756
|
+
runtimeDependencies: resource.runtimeDependencies?.map(cloneRuntimeDependency),
|
|
757
|
+
files: resource.files?.map((file) => ({
|
|
758
|
+
...file
|
|
759
|
+
})),
|
|
760
|
+
folders: resource.folders?.map((folder) => ({
|
|
761
|
+
...folder
|
|
762
|
+
})),
|
|
763
|
+
spec: resource.spec ? {
|
|
764
|
+
...resource.spec
|
|
765
|
+
} : undefined,
|
|
766
|
+
locks: resource.locks ? [
|
|
767
|
+
...resource.locks
|
|
768
|
+
] : undefined
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
function cloneRuntimeDependency(dependency) {
|
|
772
|
+
return {
|
|
773
|
+
...dependency,
|
|
774
|
+
bindingValues: dependency.bindingValues ? {
|
|
775
|
+
...dependency.bindingValues
|
|
776
|
+
} : undefined
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
function resourceNameIdentity(kind, name) {
|
|
780
|
+
return `${(kind ?? "").toLowerCase()}:${(name ?? "").toLowerCase()}`;
|
|
781
|
+
}
|
|
782
|
+
function getResource(solutionDefinition, name, kind) {
|
|
783
|
+
return solutionDefinition.resources.find((r) => r.name.toLowerCase() === name.toLowerCase() && r.kind.toLowerCase() === kind.toLowerCase());
|
|
784
|
+
}
|
|
785
|
+
function getResourceOrDefault(solutionDefinition, resourceKey) {
|
|
786
|
+
return solutionDefinition.resources.find((r) => r.key === resourceKey);
|
|
787
|
+
}
|
|
788
|
+
function findMetadataForResource(resource, metadata) {
|
|
789
|
+
const key = getResourceIdentifierKey(resource);
|
|
790
|
+
const exactMatch = metadata.get(key);
|
|
791
|
+
if (exactMatch)
|
|
792
|
+
return exactMatch;
|
|
793
|
+
for (const [mapKey, value] of metadata)
|
|
794
|
+
if (mapKey.toLowerCase() === key.toLowerCase())
|
|
795
|
+
return value;
|
|
796
|
+
}
|
|
797
|
+
function getResourceIdentifierKey(resource) {
|
|
798
|
+
return `${resource.kind}|${resource.type ?? ""}|${resource.apiVersion}`.toLowerCase();
|
|
799
|
+
}
|
|
800
|
+
function invariantEquals(a, b) {
|
|
801
|
+
if (a == null && b == null)
|
|
802
|
+
return true;
|
|
803
|
+
if (a == null || b == null)
|
|
804
|
+
return false;
|
|
805
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
806
|
+
}
|
|
807
|
+
function getResourceNumber(resourceName) {
|
|
808
|
+
const match = resourceName.match(/_(\d+)$/);
|
|
809
|
+
return match?.[1] ? parseInt(match[1], 10) : 0;
|
|
810
|
+
}
|
|
811
|
+
function escapeRegex(str) {
|
|
812
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
813
|
+
}
|
|
814
|
+
function addResource(solution, resource) {
|
|
815
|
+
if (solution.resources.some((x) => x.key === resource.key))
|
|
816
|
+
throw new Error(`Cannot add resource (${resource.kind}, ${resource.name}) to solution due to duplicate key ${resource.key}`);
|
|
817
|
+
solution.resources.push(resource);
|
|
818
|
+
}
|
|
819
|
+
function addResourceWithUniqueName(solution, resource) {
|
|
820
|
+
resource.originalName = resource.name;
|
|
821
|
+
const exactNameTaken = solution.resources.some((r) => r.name.toLowerCase() === resource.name.toLowerCase() && r.kind.toLowerCase() === resource.kind.toLowerCase());
|
|
822
|
+
if (exactNameTaken) {
|
|
823
|
+
const escapedName = escapeRegex(resource.name);
|
|
824
|
+
const sameNameRegex = new RegExp(`^${escapedName}(_\\d+)?$`, "i");
|
|
825
|
+
const matchingResources = solution.resources.filter((r) => sameNameRegex.test(r.name) && r.kind.toLowerCase() === resource.kind.toLowerCase());
|
|
826
|
+
const lastResourceNumber = Math.max(...matchingResources.map((x) => getResourceNumber(x.name)));
|
|
827
|
+
resource.name += `_${lastResourceNumber + 1}`;
|
|
828
|
+
if (resource.spec && WellKnownPropertyNames.Name in resource.spec)
|
|
829
|
+
resource.spec[WellKnownPropertyNames.Name] = resource.name;
|
|
830
|
+
}
|
|
831
|
+
addResource(solution, resource);
|
|
832
|
+
return resource;
|
|
833
|
+
}
|
|
834
|
+
function upsertFile(solution, file) {
|
|
835
|
+
const existing = solution.files.find((x) => x.key === file.key);
|
|
836
|
+
if (!existing) {
|
|
837
|
+
solution.files.push(file);
|
|
838
|
+
return true;
|
|
839
|
+
}
|
|
840
|
+
updateResourceFileDependencies(solution, existing, file);
|
|
841
|
+
existing.name = file.name;
|
|
842
|
+
existing.kind = file.kind;
|
|
843
|
+
existing.version = file.version;
|
|
844
|
+
existing.url = file.url;
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
function updateResourceFileDependencies(solution, existing, updated) {
|
|
848
|
+
if (invariantEquals(existing.name, updated.name) && invariantEquals(existing.kind, updated.kind))
|
|
849
|
+
return;
|
|
850
|
+
for (const resource of solution.resources) {
|
|
851
|
+
const files = resource.files ?? [];
|
|
852
|
+
const remaining = files.filter((f) => !(invariantEquals(f.fileName, existing.name) && invariantEquals(f.kind, existing.kind)));
|
|
853
|
+
if (remaining.length !== files.length) {
|
|
854
|
+
if (!remaining.some((f) => invariantEquals(f.fileName, updated.name) && invariantEquals(f.kind, updated.kind)))
|
|
855
|
+
remaining.push({
|
|
856
|
+
fileName: updated.name,
|
|
857
|
+
kind: updated.kind
|
|
858
|
+
});
|
|
859
|
+
resource.files = remaining;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
function getRootFolder(solution) {
|
|
864
|
+
const rootFolderKey = solution.items?.["RootFolderKey"] ?? solution.key;
|
|
865
|
+
return solution.folders.find((f) => f.key === rootFolderKey) ?? solution.folders.find((f) => f.key === solution.key) ?? solution.folders[0];
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/helpers/solution-definition-helper.js
|
|
869
|
+
var VISIBLE_DEPENDENCIES_TO_DELETE = [
|
|
870
|
+
{
|
|
871
|
+
source: {
|
|
872
|
+
kind: "app",
|
|
873
|
+
type: undefined,
|
|
874
|
+
version: "apps.uipath.com/v1"
|
|
875
|
+
},
|
|
876
|
+
cascade: [
|
|
877
|
+
{
|
|
878
|
+
kind: "process",
|
|
879
|
+
type: "webApp",
|
|
880
|
+
version: "orchestrator.uipath.com/v1"
|
|
881
|
+
}
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
];
|
|
885
|
+
function resourceIdentifierMatches(a, b) {
|
|
886
|
+
return invariantEquals(a.kind, b.kind) && invariantEquals(a.type ?? "", b.type ?? "") && invariantEquals(a.version, b.version);
|
|
887
|
+
}
|
|
888
|
+
function metadataMapKey(id) {
|
|
889
|
+
return `${id.kind}|${id.type ?? ""}|${id.version}`.toLowerCase();
|
|
890
|
+
}
|
|
891
|
+
function droppedNameKey(name, kind) {
|
|
892
|
+
return `${name}|${kind.toLowerCase()}`;
|
|
893
|
+
}
|
|
894
|
+
function resourceMetadataKey(resource) {
|
|
895
|
+
return `${resource.kind}|${resource.type ?? ""}|${resource.apiVersion}`.toLowerCase();
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
class SolutionDefinitionHelper2 {
|
|
899
|
+
async verifyIfResourceCanBeDeletedAsync(solution, resourceToDelete, allowProjectResourceDelete, cancellationToken) {
|
|
900
|
+
if (!allowProjectResourceDelete) {
|
|
901
|
+
if (resourceToDelete.projectKey != null) {
|
|
902
|
+
this.logger.error("Project artefact resource with key cannot be deleted", undefined, {
|
|
903
|
+
key: resourceToDelete.key
|
|
904
|
+
});
|
|
905
|
+
throw new BadRequestException(ErrorCodes.Resources.DeletingProjectArtefactResourceIsNotAllowed, `Deleting project artefact resource with key '${resourceToDelete.key}' is not allowed`);
|
|
906
|
+
}
|
|
907
|
+
const referencing = findResourcesWithReference(solution, resourceToDelete);
|
|
908
|
+
if (referencing.length > 0) {
|
|
909
|
+
this.logger.error("Resource cannot be deleted because it is referenced by other resources", undefined, {
|
|
910
|
+
key: resourceToDelete.key
|
|
911
|
+
});
|
|
912
|
+
const names = referencing.map((r) => r.name).join(", ");
|
|
913
|
+
throw new BadRequestException(ErrorCodes.Resources.DeletingResourceThatIsReferencedByOtherResourcesIsNotAllowed, `Resource '${resourceToDelete.name}' cannot be deleted because it is referenced by: ${names}`);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const metadataByKey = await this.loadMetadataMapAsync(solution, cancellationToken);
|
|
917
|
+
const metadata = findMetadataForResource(resourceToDelete, metadataByKey);
|
|
918
|
+
if (metadata && !metadata.visibleInDesigner) {
|
|
919
|
+
this.logger.error("Hidden resource with key cannot be deleted", undefined, {
|
|
920
|
+
key: resourceToDelete.key
|
|
921
|
+
});
|
|
922
|
+
throw new BadRequestException(ErrorCodes.Resources.DeletingHiddenResourceIsNotAllowed, `Deleting hidden resource with key '${resourceToDelete.key}' is not allowed`);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
getResourcesToDelete(solution, resourceToDelete) {
|
|
926
|
+
const result = [
|
|
927
|
+
resourceToDelete
|
|
928
|
+
];
|
|
929
|
+
const sourceId = toResourceIdentifier2(resourceToDelete);
|
|
930
|
+
const cascadeEntry = VISIBLE_DEPENDENCIES_TO_DELETE.find((e) => resourceIdentifierMatches(e.source, sourceId));
|
|
931
|
+
if (!cascadeEntry || cascadeEntry.cascade.length === 0)
|
|
932
|
+
return result;
|
|
933
|
+
const dependencies = findResourceDependencies(solution, resourceToDelete, false);
|
|
934
|
+
for (const depResource of dependencies.values()) {
|
|
935
|
+
const depId = toResourceIdentifier2(depResource);
|
|
936
|
+
if (cascadeEntry.cascade.some((c) => resourceIdentifierMatches(c, depId))) {
|
|
937
|
+
for (const r of this.getResourcesToDelete(solution, depResource))
|
|
938
|
+
if (!result.some((x) => x.key === r.key))
|
|
939
|
+
result.push(r);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
return result;
|
|
943
|
+
}
|
|
944
|
+
async removeReferencesAsync(solution, resource, cancellationToken) {
|
|
945
|
+
const referencing = findResourcesWithReference(solution, resource);
|
|
946
|
+
if (referencing.length === 0)
|
|
947
|
+
return;
|
|
948
|
+
const referencingIdentifiers = referencing.map((r) => toResourceIdentifier2(r));
|
|
949
|
+
const metadataMap = await this.metadataReader.getResourcesMetadataAsync(referencingIdentifiers, cancellationToken);
|
|
950
|
+
const metadataByKey = new Map;
|
|
951
|
+
for (const [id, version] of metadataMap)
|
|
952
|
+
metadataByKey.set(metadataMapKey(id), version);
|
|
953
|
+
for (const referencingResource of referencing) {
|
|
954
|
+
if (referencingResource.dependencies && referencingResource.dependencies.length > 0)
|
|
955
|
+
referencingResource.dependencies = referencingResource.dependencies.filter((d) => !isDependencyToResource(resource, d) || (solution.resources ?? []).some((r) => r !== resource && isDependencyToResource(r, d)));
|
|
956
|
+
const metadata = metadataByKey.get(resourceMetadataKey(referencingResource));
|
|
957
|
+
if (!metadata)
|
|
958
|
+
continue;
|
|
959
|
+
const referenceProps = (metadata.spec ?? []).filter((p) => isAnyReferenceProperty(p) && !isFileReferenceProperty(p));
|
|
960
|
+
const spec = referencingResource.spec ?? {};
|
|
961
|
+
for (const refProp of referenceProps) {
|
|
962
|
+
if (!(refProp.property in spec))
|
|
963
|
+
continue;
|
|
964
|
+
const propertyValue = spec[refProp.property];
|
|
965
|
+
const references = this.extractReferences(propertyValue);
|
|
966
|
+
if (references.length === 0)
|
|
967
|
+
continue;
|
|
968
|
+
const referenceKind = refProp["referenceKind"];
|
|
969
|
+
const matches = (ref) => ref.name != null && invariantEquals(resource.name, ref.name) && referenceKind != null && invariantEquals(referenceKind, resource.kind);
|
|
970
|
+
const filtered = references.filter((r) => !matches(r));
|
|
971
|
+
if (filtered.length !== references.length)
|
|
972
|
+
spec[refProp.property] = isSingleReferenceProperty(refProp) ? filtered[0] ?? null : filtered;
|
|
973
|
+
}
|
|
974
|
+
referencingResource.spec = spec;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
async removeHiddenResourcesWithNoRefAsync(solution, resourceToDelete, cancellationToken) {
|
|
978
|
+
const metadataByKey = await this.loadMetadataMapAsync(solution, cancellationToken);
|
|
979
|
+
const hiddenKeys = filterHiddenResourceKeys(solution.resources, metadataByKey);
|
|
980
|
+
return this.removeHiddenResourcesWithNoRefRecursive(solution, resourceToDelete, hiddenKeys);
|
|
981
|
+
}
|
|
982
|
+
removeFilesWithNoRef(solution) {
|
|
983
|
+
const remaining = [];
|
|
984
|
+
const removed = [];
|
|
985
|
+
for (const file of solution.files ?? [])
|
|
986
|
+
if (this.findResourcesForFile(solution, file).length === 0) {
|
|
987
|
+
this.logger.warn(`File '${file.name}' (kind '${file.kind}', key '${file.key}') is not referenced by any resource`, {
|
|
988
|
+
name: file.name,
|
|
989
|
+
kind: file.kind,
|
|
990
|
+
key: file.key
|
|
991
|
+
});
|
|
992
|
+
removed.push(file);
|
|
993
|
+
} else
|
|
994
|
+
remaining.push(file);
|
|
995
|
+
if (removed.length > 0) {
|
|
996
|
+
this.logger.info("Files removed: " + removed.map((f) => f.name).join(","), {
|
|
997
|
+
files: removed.map((f) => f.name)
|
|
998
|
+
});
|
|
999
|
+
solution.files = remaining;
|
|
1000
|
+
}
|
|
1001
|
+
return removed;
|
|
1002
|
+
}
|
|
1003
|
+
findResourcesForFile(solution, file) {
|
|
1004
|
+
let matching = (solution.resources ?? []).filter((r) => (r.files ?? []).some((f) => invariantEquals(f.fileName, file.name) && invariantEquals(f.kind, file.kind)));
|
|
1005
|
+
if (invariantEquals(file.kind, "appversion"))
|
|
1006
|
+
matching = matching.filter((r) => invariantEquals(r.kind, "appversion")).filter((r) => {
|
|
1007
|
+
const uiappFile = r.spec?.[WellKnownPropertyNames.UiappFile];
|
|
1008
|
+
return uiappFile != null && invariantEquals(String(uiappFile), file.key);
|
|
1009
|
+
});
|
|
1010
|
+
return matching;
|
|
1011
|
+
}
|
|
1012
|
+
async replaceDuplicateKeysAsync(solution, cancellationToken) {
|
|
1013
|
+
const resources = solution.resources ?? [];
|
|
1014
|
+
const byKey = new Map;
|
|
1015
|
+
for (const resource of resources) {
|
|
1016
|
+
const group = byKey.get(resource.key);
|
|
1017
|
+
if (group)
|
|
1018
|
+
group.push(resource);
|
|
1019
|
+
else
|
|
1020
|
+
byKey.set(resource.key, [
|
|
1021
|
+
resource
|
|
1022
|
+
]);
|
|
1023
|
+
}
|
|
1024
|
+
const survivorNameByDroppedName = new Map;
|
|
1025
|
+
const affectedProjectKeys = new Set;
|
|
1026
|
+
const dropped = new Set;
|
|
1027
|
+
for (const [key, group] of byKey) {
|
|
1028
|
+
if (group.length < 2)
|
|
1029
|
+
continue;
|
|
1030
|
+
const [survivor, ...duplicates] = group;
|
|
1031
|
+
for (const duplicate of duplicates) {
|
|
1032
|
+
survivorNameByDroppedName.set(droppedNameKey(duplicate.name, duplicate.kind), survivor?.name ?? duplicate.name);
|
|
1033
|
+
this.logger.warn(`Removing duplicate resource key '${key}' with kind '${duplicate.kind}'`);
|
|
1034
|
+
dropped.add(duplicate);
|
|
1035
|
+
if (duplicate.projectKey)
|
|
1036
|
+
affectedProjectKeys.add(duplicate.projectKey);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
if (dropped.size === 0)
|
|
1040
|
+
return [];
|
|
1041
|
+
solution.resources = resources.filter((resource) => !dropped.has(resource));
|
|
1042
|
+
const metadata = await this.loadMetadataMapAsync(solution, cancellationToken);
|
|
1043
|
+
for (const resource of solution.resources)
|
|
1044
|
+
if ((resource.dependencies ?? []).length !== 0) {
|
|
1045
|
+
this.repointDependencies(resource, survivorNameByDroppedName);
|
|
1046
|
+
this.repointSpecReferences(resource, survivorNameByDroppedName, metadata);
|
|
1047
|
+
}
|
|
1048
|
+
return [
|
|
1049
|
+
...affectedProjectKeys
|
|
1050
|
+
];
|
|
1051
|
+
}
|
|
1052
|
+
repointDependencies(resource, survivorNameByDroppedName) {
|
|
1053
|
+
for (const dependency of resource.dependencies ?? []) {
|
|
1054
|
+
const survivorName = survivorNameByDroppedName.get(droppedNameKey(dependency.name, dependency.kind));
|
|
1055
|
+
if (survivorName !== undefined)
|
|
1056
|
+
dependency.name = survivorName;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
repointSpecReferences(resource, survivorNameByDroppedName, metadata) {
|
|
1060
|
+
const metadataVersion = metadata.get(resourceMetadataKey(resource));
|
|
1061
|
+
if (!metadataVersion)
|
|
1062
|
+
throw new InvalidOperationException(`Cannot resolve duplicate resource keys for solution ${resource.key}: no metadata for kind '${resource.kind}', type '${resource.type ?? ""}', version '${resource.apiVersion}'`);
|
|
1063
|
+
const spec = resource.spec;
|
|
1064
|
+
if (!spec)
|
|
1065
|
+
return;
|
|
1066
|
+
const referenceProps = (metadataVersion.spec ?? []).filter((p) => isAnyReferenceProperty(p) && !isFileReferenceProperty(p));
|
|
1067
|
+
for (const refProp of referenceProps) {
|
|
1068
|
+
const referenceKind = refProp["referenceKind"];
|
|
1069
|
+
if (referenceKind !== undefined && refProp.property in spec)
|
|
1070
|
+
for (const reference of this.extractReferences(spec[refProp.property])) {
|
|
1071
|
+
if (typeof reference.name != "string")
|
|
1072
|
+
continue;
|
|
1073
|
+
const survivorName = survivorNameByDroppedName.get(droppedNameKey(reference.name, referenceKind));
|
|
1074
|
+
if (survivorName !== undefined)
|
|
1075
|
+
reference.name = survivorName;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
async loadMetadataMapAsync(solution, cancellationToken) {
|
|
1080
|
+
const allIdentifiers = (solution.resources ?? []).map((r) => toResourceIdentifier2(r));
|
|
1081
|
+
const metadataMap = await this.metadataReader.getResourcesMetadataAsync(allIdentifiers, cancellationToken);
|
|
1082
|
+
const result = new Map;
|
|
1083
|
+
for (const [id, version] of metadataMap)
|
|
1084
|
+
result.set(metadataMapKey(id), version);
|
|
1085
|
+
return result;
|
|
1086
|
+
}
|
|
1087
|
+
extractReferences(value) {
|
|
1088
|
+
if (Array.isArray(value))
|
|
1089
|
+
return value.filter((v) => v != null && typeof v == "object");
|
|
1090
|
+
if (value != null && typeof value == "object")
|
|
1091
|
+
return [
|
|
1092
|
+
value
|
|
1093
|
+
];
|
|
1094
|
+
return [];
|
|
1095
|
+
}
|
|
1096
|
+
removeHiddenResourcesWithNoRefRecursive(solution, resourceToDelete, hiddenKeys) {
|
|
1097
|
+
const toRemove = new Set((solution.resources ?? []).filter((r) => hiddenKeys.has(r.key) && findResourcesWithReference(solution, r).length === 0));
|
|
1098
|
+
this.collectDeletableHiddenResourcesForResourceToDelete(solution, resourceToDelete, hiddenKeys, toRemove);
|
|
1099
|
+
if (toRemove.size > 0) {
|
|
1100
|
+
solution.resources = (solution.resources ?? []).filter((r) => !toRemove.has(r));
|
|
1101
|
+
const further = this.removeHiddenResourcesWithNoRefRecursive(solution, resourceToDelete, hiddenKeys);
|
|
1102
|
+
for (const r of further)
|
|
1103
|
+
toRemove.add(r);
|
|
1104
|
+
}
|
|
1105
|
+
return toRemove;
|
|
1106
|
+
}
|
|
1107
|
+
collectDeletableHiddenResourcesForResourceToDelete(solution, resourceToDelete, hiddenKeys, toRemove) {
|
|
1108
|
+
if (!resourceToDelete)
|
|
1109
|
+
return;
|
|
1110
|
+
for (const dependency of resourceToDelete.dependencies ?? []) {
|
|
1111
|
+
const candidates = (solution.resources ?? []).filter((r) => r.projectKey === resourceToDelete.projectKey && hiddenKeys.has(r.key) && isDependencyToResource(r, dependency));
|
|
1112
|
+
for (const candidate of candidates)
|
|
1113
|
+
if (!toRemove.has(candidate)) {
|
|
1114
|
+
if (this.noOtherResourceInProjectReferencesDependency(solution, resourceToDelete, dependency))
|
|
1115
|
+
toRemove.add(candidate);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
noOtherResourceInProjectReferencesDependency(solution, resourceToDelete, dependency) {
|
|
1120
|
+
return !(solution.resources ?? []).some((r) => r !== resourceToDelete && r.projectKey === resourceToDelete.projectKey && (r.dependencies ?? []).some((dep) => invariantEquals(dep.name.trim(), dependency.name.trim()) && invariantEquals(dep.kind.trim(), dependency.kind.trim())));
|
|
1121
|
+
}
|
|
1122
|
+
constructor(metadataReader, logger) {
|
|
1123
|
+
this.metadataReader = metadataReader;
|
|
1124
|
+
this.logger = logger;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/clients/generated/first-party-service.js
|
|
1128
|
+
class HttpClient {
|
|
1129
|
+
encodeQueryParam(key, value) {
|
|
1130
|
+
const encodedKey = encodeURIComponent(key);
|
|
1131
|
+
return `${encodedKey}=${encodeURIComponent(typeof value == "number" ? value : `${value}`)}`;
|
|
1132
|
+
}
|
|
1133
|
+
addQueryParam(query, key) {
|
|
1134
|
+
return this.encodeQueryParam(key, query[key]);
|
|
1135
|
+
}
|
|
1136
|
+
addArrayQueryParam(query, key) {
|
|
1137
|
+
const value = query[key];
|
|
1138
|
+
return value.map((v) => this.encodeQueryParam(key, v)).join("&");
|
|
1139
|
+
}
|
|
1140
|
+
toQueryString(rawQuery) {
|
|
1141
|
+
const query = rawQuery || {};
|
|
1142
|
+
const keys = Object.keys(query).filter((key) => query[key] !== undefined);
|
|
1143
|
+
return keys.map((key) => Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key)).join("&");
|
|
1144
|
+
}
|
|
1145
|
+
addQueryParams(rawQuery) {
|
|
1146
|
+
const queryString = this.toQueryString(rawQuery);
|
|
1147
|
+
return queryString ? `?${queryString}` : "";
|
|
1148
|
+
}
|
|
1149
|
+
mergeRequestParams(params1, params2) {
|
|
1150
|
+
return {
|
|
1151
|
+
...this.baseApiParams,
|
|
1152
|
+
...params1,
|
|
1153
|
+
...params2 || {},
|
|
1154
|
+
headers: {
|
|
1155
|
+
...this.baseApiParams.headers || {},
|
|
1156
|
+
...params1.headers || {},
|
|
1157
|
+
...params2 && params2.headers || {}
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
constructor(apiConfig = {}) {
|
|
1162
|
+
this.baseUrl = "https://localhost:7008";
|
|
1163
|
+
this.securityData = null;
|
|
1164
|
+
this.abortControllers = new Map;
|
|
1165
|
+
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
1166
|
+
this.baseApiParams = {
|
|
1167
|
+
credentials: "same-origin",
|
|
1168
|
+
headers: {},
|
|
1169
|
+
redirect: "follow",
|
|
1170
|
+
referrerPolicy: "no-referrer"
|
|
1171
|
+
};
|
|
1172
|
+
this.setSecurityData = (data) => {
|
|
1173
|
+
this.securityData = data;
|
|
1174
|
+
};
|
|
1175
|
+
this.contentFormatters = {
|
|
1176
|
+
["application/json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
|
|
1177
|
+
["application/vnd.api+json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
|
|
1178
|
+
["text/plain"]: (input) => input !== null && typeof input != "string" ? JSON.stringify(input) : input,
|
|
1179
|
+
["multipart/form-data"]: (input) => {
|
|
1180
|
+
if (input instanceof FormData)
|
|
1181
|
+
return input;
|
|
1182
|
+
return Object.keys(input || {}).reduce((formData, key) => {
|
|
1183
|
+
const property = input[key];
|
|
1184
|
+
formData.append(key, property instanceof Blob ? property : typeof property == "object" && property !== null ? JSON.stringify(property) : `${property}`);
|
|
1185
|
+
return formData;
|
|
1186
|
+
}, new FormData);
|
|
1187
|
+
},
|
|
1188
|
+
["application/x-www-form-urlencoded"]: (input) => this.toQueryString(input)
|
|
1189
|
+
};
|
|
1190
|
+
this.createAbortSignal = (cancelToken) => {
|
|
1191
|
+
if (this.abortControllers.has(cancelToken)) {
|
|
1192
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
1193
|
+
if (abortController)
|
|
1194
|
+
return abortController.signal;
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
const abortController = new AbortController;
|
|
1198
|
+
this.abortControllers.set(cancelToken, abortController);
|
|
1199
|
+
return abortController.signal;
|
|
1200
|
+
};
|
|
1201
|
+
this.abortRequest = (cancelToken) => {
|
|
1202
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
1203
|
+
if (abortController) {
|
|
1204
|
+
abortController.abort();
|
|
1205
|
+
this.abortControllers.delete(cancelToken);
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
|
|
1209
|
+
const secureParams = (typeof secure == "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
|
|
1210
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
1211
|
+
const queryString = query && this.toQueryString(query);
|
|
1212
|
+
const payloadFormatter = this.contentFormatters[type || "application/json"];
|
|
1213
|
+
const responseFormat = format || requestParams.format;
|
|
1214
|
+
return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
|
|
1215
|
+
...requestParams,
|
|
1216
|
+
headers: {
|
|
1217
|
+
...requestParams.headers || {},
|
|
1218
|
+
...type && type !== "multipart/form-data" ? {
|
|
1219
|
+
"Content-Type": type
|
|
1220
|
+
} : {}
|
|
1221
|
+
},
|
|
1222
|
+
signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
|
|
1223
|
+
body: body == null ? null : payloadFormatter(body)
|
|
1224
|
+
}).then(async (response) => {
|
|
1225
|
+
const r = response;
|
|
1226
|
+
r.data = null;
|
|
1227
|
+
r.error = null;
|
|
1228
|
+
const responseToParse = responseFormat ? response.clone() : response;
|
|
1229
|
+
const data = responseFormat ? await responseToParse[responseFormat]().then((data) => {
|
|
1230
|
+
if (r.ok)
|
|
1231
|
+
r.data = data;
|
|
1232
|
+
else
|
|
1233
|
+
r.error = data;
|
|
1234
|
+
return r;
|
|
1235
|
+
}).catch((e) => {
|
|
1236
|
+
r.error = e;
|
|
1237
|
+
return r;
|
|
1238
|
+
}) : r;
|
|
1239
|
+
if (cancelToken)
|
|
1240
|
+
this.abortControllers.delete(cancelToken);
|
|
1241
|
+
if (!response.ok)
|
|
1242
|
+
throw data;
|
|
1243
|
+
return data.data;
|
|
1244
|
+
});
|
|
1245
|
+
};
|
|
1246
|
+
Object.assign(this, apiConfig);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
class FirstPartyServiceApi2 extends HttpClient {
|
|
1251
|
+
constructor(...args) {
|
|
1252
|
+
super(...args), this.v2 = {
|
|
1253
|
+
automationSolutionsGetMetadata: (params = {}) => this.request({
|
|
1254
|
+
path: "/v2/automationsolutions/metadata",
|
|
1255
|
+
method: "GET",
|
|
1256
|
+
...params
|
|
1257
|
+
}),
|
|
1258
|
+
automationSolutionsHeadMetadata: (params = {}) => this.request({
|
|
1259
|
+
path: "/v2/automationsolutions/metadata",
|
|
1260
|
+
method: "HEAD",
|
|
1261
|
+
...params
|
|
1262
|
+
}),
|
|
1263
|
+
automationSolutionsSetState: (data, query, params = {}) => this.request({
|
|
1264
|
+
path: "/v2/automationsolutions",
|
|
1265
|
+
method: "PATCH",
|
|
1266
|
+
query,
|
|
1267
|
+
body: data,
|
|
1268
|
+
type: "application/json",
|
|
1269
|
+
...params
|
|
1270
|
+
}),
|
|
1271
|
+
automationSolutionsInstall: (data, query, params = {}) => this.request({
|
|
1272
|
+
path: "/v2/automationsolutions",
|
|
1273
|
+
method: "PUT",
|
|
1274
|
+
query,
|
|
1275
|
+
body: data,
|
|
1276
|
+
format: "json",
|
|
1277
|
+
...params
|
|
1278
|
+
}),
|
|
1279
|
+
automationSolutionsUninstall: (data, query, params = {}) => this.request({
|
|
1280
|
+
path: "/v2/automationsolutions",
|
|
1281
|
+
method: "DELETE",
|
|
1282
|
+
query,
|
|
1283
|
+
body: data,
|
|
1284
|
+
type: "application/json",
|
|
1285
|
+
format: "json",
|
|
1286
|
+
...params
|
|
1287
|
+
}),
|
|
1288
|
+
automationSolutionsExport: (data, params = {}) => this.request({
|
|
1289
|
+
path: "/v2/automationsolutions/export",
|
|
1290
|
+
method: "POST",
|
|
1291
|
+
body: data,
|
|
1292
|
+
type: "application/json",
|
|
1293
|
+
format: "json",
|
|
1294
|
+
...params
|
|
1295
|
+
}),
|
|
1296
|
+
automationSolutionsGetTranslations: (query, params = {}) => this.request({
|
|
1297
|
+
path: "/v2/automationsolutions/translations",
|
|
1298
|
+
method: "GET",
|
|
1299
|
+
query,
|
|
1300
|
+
format: "json",
|
|
1301
|
+
...params
|
|
1302
|
+
}),
|
|
1303
|
+
automationSolutionsValidate: (data, query, params = {}) => this.request({
|
|
1304
|
+
path: "/v2/automationsolutions/validate",
|
|
1305
|
+
method: "POST",
|
|
1306
|
+
query,
|
|
1307
|
+
body: data,
|
|
1308
|
+
type: "application/json",
|
|
1309
|
+
format: "json",
|
|
1310
|
+
...params
|
|
1311
|
+
}),
|
|
1312
|
+
automationSolutionsLookup: (query, params = {}) => this.request({
|
|
1313
|
+
path: "/v2/automationsolutions/lookup",
|
|
1314
|
+
method: "GET",
|
|
1315
|
+
query,
|
|
1316
|
+
format: "json",
|
|
1317
|
+
...params
|
|
1318
|
+
})
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
export { ErrorCodes, BadRequestException, InvalidOperationException, types_ResourceScope, toResourceIdentifier, toServiceName, getVersionOrDefault, isSingleReferenceProperty, isAnyReferenceProperty, isSecretProperty, isNameProperty, isFileReferenceProperty, WellKnownProjectType, WellKnownPropertyNames, FailOnNameConflictKinds, toResourceIdentifier2, isExcluded, filterVisibleFolderResources, filterHiddenResourceKeys, filterHiddenUnsupportingDebugProvisioningKeys, supportsDebugProvisioningWithDependencies, supportsDebugProvisioning, isProcessArtefact, resolvePackageNameAfterRename, findPackageNameConflict, changePackageName, getDefaultValue, buildDefaultConfiguration, isDependencyToResource, updateReferenceProps, cloneResourceDefinition, resourceNameIdentity, getResource, getResourceOrDefault, findMetadataForResource, getResourceIdentifierKey, invariantEquals, addResource, addResourceWithUniqueName, upsertFile, getRootFolder, JsonSerializerNames2, JsonSerializer2, CAMEL_CASE_ENUM_PROPERTIES2, SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2, RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2, PASCAL_CASE_ENUM_PROPERTIES2, JsonSerializerFactory2, JsonSerializerProxy2, StreamSerializer2, SolutionDefinitionHelper2, FirstPartyServiceApi2 };
|
|
1323
|
+
|
|
1324
|
+
//# debugId=6AA8492A0E5BD36D64756E2164756E21
|