@uipath/case-tool 1.201.0-preview.133 → 1.202.0-preview.134

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.
Files changed (96) hide show
  1. package/dist/{authoring-aaaqwck3.js → authoring-jj4zkqer.js} +74 -48
  2. package/dist/{browser-strategy-rkcvc6tn.js → browser-strategy-6atc7v8s.js} +3 -3
  3. package/dist/case-api-2nfc0ynz.js +381 -0
  4. package/dist/case-debug-studio-web-service-e31g6mrp.js +335 -0
  5. package/dist/{case-pack-service-rvyqh3x3.js → case-pack-service-ye4shs12.js} +11 -18
  6. package/dist/case-validate-service-mayc7mw1.js +2114 -0
  7. package/dist/connector-enrichment-service-83pqstp8.js +60 -0
  8. package/dist/connector-lookup-service-59kkbbwm.js +22 -0
  9. package/dist/connector-task-spec-c54daswf.js +1250 -0
  10. package/dist/{de-5KVP66U6-t37qr521.js → de-5KVP66U6-1bnf4zt5.js} +54 -54
  11. package/dist/{de-5HU6GFWV-zheyw6d2.js → de-7XQXX2DK-tqdy5n2b.js} +857 -845
  12. package/dist/debug-service-77n8tv17.js +57 -0
  13. package/dist/{en-MABQK6C4-nkzq2j8t.js → en-5ZGC5VQ3-h581y30k.js} +897 -897
  14. package/dist/{en-4KXU7N7B-24v330b5.js → en-X3S6IZ5J-nhkg6pwn.js} +55 -61
  15. package/dist/enrichment-service-27j145k3.js +421 -0
  16. package/dist/{es-MX-POESXYP2-9538722k.js → es-MX-U2VN3SZW-anynsmd8.js} +857 -845
  17. package/dist/{es-MX-XAVLOQW3-47a405kf.js → es-MX-XAVLOQW3-q00km2y7.js} +54 -54
  18. package/dist/{es-VFPNVMP5-6sftsdxe.js → es-VFPNVMP5-bx2c337j.js} +54 -54
  19. package/dist/{es-LUTYN7U7-ye5zn4sn.js → es-ZGCPPOME-8gazspjj.js} +857 -845
  20. package/dist/{fr-E5MDO4EG-f3x1jeqw.js → fr-E5MDO4EG-c3mkty2t.js} +54 -54
  21. package/dist/{fr-LJIK56LW-xf3xf2kh.js → fr-T3G5GZCT-y3f7xb1q.js} +857 -845
  22. package/dist/index-67s20rhx.js +630 -0
  23. package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
  24. package/dist/index-k4xz16db.js +63712 -0
  25. package/dist/{index-p50kx6jv.js → index-k5tbd184.js} +276 -276
  26. package/dist/index-kwxe1vep.js +143 -0
  27. package/dist/{index-cncq089f.js → index-mhe5065f.js} +163 -80
  28. package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
  29. package/dist/index.js +16 -17
  30. package/dist/{index.umd.min-drpc57vn.js → index.umd.min-fqefd9kn.js} +3 -3
  31. package/dist/input-reader-vprf0kv6.js +11 -0
  32. package/dist/{ja-FGEGLBJ3-w9byjhze.js → ja-BI5K3JDZ-77zat4z2.js} +857 -845
  33. package/dist/{ja-DPO5PPLO-fmbg7zt2.js → ja-DPO5PPLO-mysfmznx.js} +54 -54
  34. package/dist/{js-yaml-cggj6w7q.js → js-yaml-87tvr6f6.js} +16 -16
  35. package/dist/known-types-qryebm95.js +15 -0
  36. package/dist/{ko-ITOPNIYI-aqy82jk8.js → ko-ITOPNIYI-hmxd2asd.js} +54 -54
  37. package/dist/{ko-TUAK3G3A-s25w0ckg.js → ko-JOBF5V7N-4bv0mjje.js} +857 -845
  38. package/dist/{node-strategy-8gzp67xs.js → node-strategy-0267x5e5.js} +130 -14
  39. package/dist/node-sync-service-15hccr1y.js +38 -0
  40. package/dist/{packager-tool-9qecd4wb.js → packager-tool-0gctz400.js} +5 -2
  41. package/dist/packager-tool-0mj06yen.js +65 -0
  42. package/dist/{packager-tool-1cb0d5e0.js → packager-tool-0v3s8r01.js} +2 -2
  43. package/dist/packager-tool-134mvmcm.js +3040 -0
  44. package/dist/packager-tool-13kkvf2n.js +356 -0
  45. package/dist/packager-tool-1j44c5z3.js +1217 -0
  46. package/dist/packager-tool-1jsabv93.js +6717 -0
  47. package/dist/packager-tool-1v6h5met.js +852 -0
  48. package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
  49. package/dist/packager-tool-37ww3cn0.js +80 -0
  50. package/dist/packager-tool-3mdhyhk6.js +4892 -0
  51. package/dist/packager-tool-50hjsghv.js +1125 -0
  52. package/dist/{packager-tool-3wygxefb.js → packager-tool-58q3tvh7.js} +10 -10
  53. package/dist/packager-tool-5ww9gbj3.js +6865 -0
  54. package/dist/{packager-tool-w3h8xrnv.js → packager-tool-66s6vs1k.js} +71 -3
  55. package/dist/{packager-tool-zqa5k9f7.js → packager-tool-a190917w.js} +990 -2287
  56. package/dist/{packager-tool-p9j43p8h.js → packager-tool-a42jnpy5.js} +3 -9
  57. package/dist/packager-tool-ay3zvfcv.js +54 -0
  58. package/dist/{packager-tool-jysvpt8p.js → packager-tool-c23zrhj8.js} +2 -2
  59. package/dist/packager-tool-dqs5qy9s.js +2327 -0
  60. package/dist/{packager-tool-wvqz81mx.js → packager-tool-gtzs471w.js} +3 -2
  61. package/dist/{packager-tool-we1phz71.js → packager-tool-hxw1a9ac.js} +31 -3
  62. package/dist/{packager-tool-8t401j6x.js → packager-tool-jhdf8gt1.js} +5054 -17851
  63. package/dist/packager-tool-ncedqc8m.js +77 -0
  64. package/dist/packager-tool-p7jgrm5r.js +15 -0
  65. package/dist/packager-tool-q24fc6jm.js +546 -0
  66. package/dist/packager-tool-r84ng21s.js +57 -0
  67. package/dist/packager-tool-sv0d6wb6.js +173 -0
  68. package/dist/packager-tool-ty1t2byf.js +27 -0
  69. package/dist/packager-tool-vepqrsse.js +23 -0
  70. package/dist/{packager-tool-5arsyj36.js → packager-tool-yc4kw997.js} +4 -2
  71. package/dist/{packager-tool-zx48pq4v.js → packager-tool-ygwa3sc0.js} +1997 -1174
  72. package/dist/packager-tool.js +91 -5
  73. package/dist/project-artifacts-9e7bs1vq.js +14 -0
  74. package/dist/{pt-BR-7XGDXRDJ-espnkgrj.js → pt-BR-7DYX2YPT-fqxqzqtf.js} +857 -845
  75. package/dist/{pt-BR-BXURWX4W-xzyndmrx.js → pt-BR-BXURWX4W-bwfcwhk1.js} +54 -54
  76. package/dist/{pt-TMVOOITK-myha14p9.js → pt-HTXGGX6Y-97t21dty.js} +857 -845
  77. package/dist/{pt-YI4VE4YQ-521681zf.js → pt-YI4VE4YQ-wdkn2dcf.js} +54 -54
  78. package/dist/resourcesSyncService-jnze5zjq.js +683 -0
  79. package/dist/{ro-2VALF3S5-cdz5afkr.js → ro-KTNQ3MNU-y08n1x5g.js} +857 -845
  80. package/dist/{ro-RKXZUG7Z-pdztdafr.js → ro-RKXZUG7Z-nndrrsq7.js} +54 -54
  81. package/dist/{ru-GSCT4ARZ-qj8dm4dp.js → ru-GSCT4ARZ-1sa9wbr8.js} +1 -1
  82. package/dist/ru-WBLQ5B2U-8r3c7v6d.js +10 -0
  83. package/dist/strict-case-rules-303vjvas.js +377 -0
  84. package/dist/strict-sdd-audit-qdmc9e1y.js +1024 -0
  85. package/dist/tool.js +17 -18
  86. package/dist/{tr-AA6O2WSR-bj9n80k8.js → tr-AA6O2WSR-86ba4bdf.js} +54 -54
  87. package/dist/{tr-RIFCEXFH-hgkb4g8y.js → tr-XHSSPNK7-cmqyc4wd.js} +857 -845
  88. package/dist/trigger-enrichment-service-46b8k7ex.js +340 -0
  89. package/dist/{zh-CN-IP3FMXWM-1cfarhcp.js → zh-CN-2EHQT23P-mr63c4xz.js} +857 -845
  90. package/dist/{zh-CN-R2KLHXQV-x6gnk2n0.js → zh-CN-R2KLHXQV-agqr45ds.js} +54 -54
  91. package/dist/{zh-TW-AGIDXIPF-n6r6w7vy.js → zh-TW-MGZCE5BT-c4ekmrz9.js} +857 -845
  92. package/dist/{zh-TW-RJGCQANM-tt8j5wv2.js → zh-TW-RJGCQANM-w0x3qc1p.js} +54 -54
  93. package/package.json +2 -2
  94. package/dist/index-8bsngk9y.js +0 -247140
  95. package/dist/packager-tool-qtwqp3q5.js +0 -13607
  96. package/dist/ru-WBLQ5B2U-8xd4gpv2.js +0 -10
@@ -0,0 +1,356 @@
1
+ import {
2
+ catchError
3
+ } from "./packager-tool-ygwa3sc0.js";
4
+
5
+ // src/services/schema-utils.ts
6
+ function getMutatedType(variable) {
7
+ if (variable["x-uipath-resource-kind"] === "JobAttachment") {
8
+ return "file";
9
+ }
10
+ return typeof variable.type === "string" ? variable.type : "unknown";
11
+ }
12
+ function createNestedRefResolver(definitions) {
13
+ const resolveRef = (ref) => {
14
+ const definitionName = ref?.replace("#/definitions/", "") ?? "";
15
+ const definition = definitions[definitionName];
16
+ return definition && typeof definition === "object" ? { ...definition } : {};
17
+ };
18
+ const resolvePropertyWithRef = (propValue) => {
19
+ const refResolved = resolveRef(propValue.$ref);
20
+ const excludedKeys = new Set([
21
+ "type",
22
+ "properties",
23
+ "required",
24
+ "$ref"
25
+ ]);
26
+ const nested = refResolved.properties && typeof refResolved.properties === "object" ? {
27
+ properties: resolveNestedRefs(refResolved.properties)
28
+ } : {};
29
+ const extras = Object.fromEntries(Object.entries(refResolved).filter(([k]) => !excludedKeys.has(k)));
30
+ return {
31
+ type: refResolved.type,
32
+ required: false,
33
+ ...nested,
34
+ ...extras
35
+ };
36
+ };
37
+ const resolvePropertiesObject = (properties) => {
38
+ const resolvedProps = {};
39
+ for (const [propKey, propValue] of Object.entries(properties)) {
40
+ if (typeof propValue === "object" && propValue !== null && "$ref" in propValue) {
41
+ resolvedProps[propKey] = resolvePropertyWithRef(propValue);
42
+ } else {
43
+ resolvedProps[propKey] = resolveNestedRefs(propValue);
44
+ }
45
+ }
46
+ return resolvedProps;
47
+ };
48
+ const resolveNestedRefs = (obj) => {
49
+ if (!obj || typeof obj !== "object") {
50
+ return obj;
51
+ }
52
+ if (Array.isArray(obj)) {
53
+ return obj.map((item) => resolveNestedRefs(item));
54
+ }
55
+ const record = obj;
56
+ const resolved = {};
57
+ for (const [key, value] of Object.entries(record)) {
58
+ if (key === "$ref" || key === "required" && Array.isArray(value)) {
59
+ continue;
60
+ }
61
+ if (key === "properties" && typeof value === "object") {
62
+ resolved[key] = resolvePropertiesObject(value);
63
+ continue;
64
+ }
65
+ resolved[key] = resolveNestedRefs(value);
66
+ }
67
+ return resolved;
68
+ };
69
+ return { resolveRef, resolveNestedRefs };
70
+ }
71
+ function transformSchemaToVariables(schemaInput, options) {
72
+ if (!schemaInput) {
73
+ return {};
74
+ }
75
+ let schema;
76
+ if (typeof schemaInput === "string") {
77
+ const [parseError, parsed] = catchError(() => JSON.parse(schemaInput));
78
+ if (parseError) {
79
+ throw new Error(`Failed to parse schema JSON: ${schemaInput.slice(0, 80)}`);
80
+ }
81
+ schema = parsed;
82
+ } else {
83
+ schema = schemaInput;
84
+ }
85
+ if (!schema || typeof schema !== "object" || !("properties" in schema) || !schema.properties) {
86
+ return {};
87
+ }
88
+ const properties = schema.properties;
89
+ const required = Array.isArray(schema.required) ? schema.required : [];
90
+ const definitions = typeof schema.definitions === "object" && schema.definitions !== null ? schema.definitions : {};
91
+ const { resolveRef, resolveNestedRefs } = createNestedRefResolver(definitions);
92
+ const result = {};
93
+ for (const [name, prop] of Object.entries(properties)) {
94
+ const propObj = prop;
95
+ const merged = {
96
+ ...propObj,
97
+ ...resolveRef(propObj.$ref ?? "")
98
+ };
99
+ const resolved = resolveNestedRefs(merged);
100
+ const type = getMutatedType(resolved);
101
+ const innerRequired = Array.isArray(merged.required) ? merged.required : required;
102
+ result[name] = {
103
+ ...resolved,
104
+ required: options?.includeRequired ? innerRequired.includes(name) : undefined,
105
+ type
106
+ };
107
+ }
108
+ return result;
109
+ }
110
+ function getArgumentType(rawType, collectionDataType) {
111
+ const type = rawType.split(",")[0];
112
+ if (type.startsWith("System.Int32[]") || type.startsWith("System.Int64[]") || type.startsWith("System.Double[]") || type.startsWith("System.Decimal[]")) {
113
+ return "array{number}";
114
+ }
115
+ if (type.startsWith("System.String[]")) {
116
+ return "array{string}";
117
+ }
118
+ if (type.startsWith("System.Boolean[]")) {
119
+ return "array{boolean}";
120
+ }
121
+ if (type.startsWith("System.Collections.Generic.List") || type.startsWith("System.Collections.Generic.IList") || type.startsWith("System.Collections.Generic.IEnumerable") || type.startsWith("System.Collections.IEnumerable") || type.startsWith("System.Data.DataTable") || type.startsWith("Newtonsoft.Json.Linq.JArray") || collectionDataType?.startsWith("List") || collectionDataType?.startsWith("Array")) {
122
+ return "array";
123
+ }
124
+ if (type.startsWith("System.Collections.Generic.Dictionary")) {
125
+ return "json";
126
+ }
127
+ if (type.startsWith("System.Collections.Generic") || type.startsWith("System.Object")) {
128
+ return "json";
129
+ }
130
+ if (type.startsWith("System.String")) {
131
+ return "string";
132
+ }
133
+ if (type.startsWith("System.Int32") || type.startsWith("System.Int64") || type.startsWith("System.Double") || type.startsWith("System.Decimal")) {
134
+ return "number";
135
+ }
136
+ if (type.startsWith("System.Boolean")) {
137
+ return "boolean";
138
+ }
139
+ return "any";
140
+ }
141
+ var ERROR_OUTPUT_SCHEMA = {
142
+ type: "object",
143
+ properties: {
144
+ code: { type: "string" },
145
+ message: { type: "string" },
146
+ detail: { type: "string" },
147
+ category: { type: "string" },
148
+ status: { type: "number" },
149
+ element: { type: "string" }
150
+ }
151
+ };
152
+ function convertActionArgsToVariables(args) {
153
+ const result = {};
154
+ for (const arg of args) {
155
+ const variable = {
156
+ type: getArgumentType(arg.type, arg.collectionDataType)
157
+ };
158
+ if (arg.required) {
159
+ variable.required = true;
160
+ }
161
+ result[arg.name] = variable;
162
+ }
163
+ return result;
164
+ }
165
+
166
+ // src/services/input-output-utils.ts
167
+ var JOB_ATTACHMENT_PREFIX = "=orchestrator.JobAttachments";
168
+ var JSON_SCHEMA_DRAFT_7 = "http://json-schema.org/draft-07/schema#";
169
+ var FILE_TYPE_JSON_SCHEMA = {
170
+ $schema: JSON_SCHEMA_DRAFT_7,
171
+ type: "object",
172
+ properties: {
173
+ ID: {
174
+ type: "string",
175
+ description: "Orchestrator attachment key"
176
+ },
177
+ FullName: {
178
+ type: "string",
179
+ description: "File name"
180
+ },
181
+ MimeType: {
182
+ type: "string",
183
+ description: "The MIME type of the content, such as application/json or image/png"
184
+ },
185
+ Metadata: {
186
+ type: "object",
187
+ description: "Dictionary<string, string> of metadata",
188
+ additionalProperties: {
189
+ type: "string"
190
+ }
191
+ }
192
+ },
193
+ required: ["ID"],
194
+ "x-uipath-resource-kind": "JobAttachment"
195
+ };
196
+ var DATA_FABRIC_PREFIX = "=datafabric.";
197
+ var DATA_FABRIC_TYPE_JSON_SCHEMA = {
198
+ $schema: JSON_SCHEMA_DRAFT_7,
199
+ type: "object",
200
+ properties: {}
201
+ };
202
+ function parseTypeAndSubtype(typeString) {
203
+ const match = /^(\w+)\{(.+)\}$/.exec(typeString);
204
+ if (match) {
205
+ return { type: match[1], subType: match[2] };
206
+ }
207
+ return { type: typeString };
208
+ }
209
+ function isFileType(type) {
210
+ return type === "file" || type === "octet-stream";
211
+ }
212
+ function getJsonSchema(props) {
213
+ if (props.type === "object" || props.type === "array") {
214
+ return { ...props, $schema: JSON_SCHEMA_DRAFT_7 };
215
+ }
216
+ return null;
217
+ }
218
+ function camelizeDisplayName(displayName) {
219
+ const sanitized = displayName.replace(/[^a-zA-Z0-9_ ]/g, "");
220
+ const words = sanitized.split(/[\s_]+/).filter(Boolean);
221
+ if (words.length === 0) {
222
+ return "";
223
+ }
224
+ return words.map((w, i) => i === 0 ? w.charAt(0).toLowerCase() + w.slice(1) : w.charAt(0).toUpperCase() + w.slice(1)).join("");
225
+ }
226
+ function toUniqueCamelCase(input, existingNames) {
227
+ let candidate = camelizeDisplayName(input);
228
+ if (!candidate) {
229
+ candidate = "variable";
230
+ }
231
+ const nameSet = new Set(existingNames);
232
+ if (!nameSet.has(candidate)) {
233
+ return candidate;
234
+ }
235
+ let counter = 1;
236
+ while (nameSet.has(`${candidate}${counter}`)) {
237
+ counter++;
238
+ }
239
+ return `${candidate}${counter}`;
240
+ }
241
+ var ALPHANUMERIC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
242
+ function generateRandomId(length) {
243
+ let result = "";
244
+ for (let i = 0;i < length; i++) {
245
+ result += ALPHANUMERIC.charAt(Math.floor(Math.random() * ALPHANUMERIC.length));
246
+ }
247
+ return result;
248
+ }
249
+ function generateNextId(prefix, count) {
250
+ return prefix + generateRandomId(count);
251
+ }
252
+ function generateNewVariableId(existingIds, variableName) {
253
+ return toUniqueCamelCase(variableName, existingIds);
254
+ }
255
+ function resolveFileBodyFromTarget(target) {
256
+ if (!target) {
257
+ return;
258
+ }
259
+ if (target.startsWith(JOB_ATTACHMENT_PREFIX)) {
260
+ return FILE_TYPE_JSON_SCHEMA;
261
+ }
262
+ if (target.startsWith(DATA_FABRIC_PREFIX)) {
263
+ return DATA_FABRIC_TYPE_JSON_SCHEMA;
264
+ }
265
+ return;
266
+ }
267
+ function generateBodyForVariable(variable) {
268
+ if (variable.type !== "jsonSchema" && !isFileType(variable.type)) {
269
+ return;
270
+ }
271
+ return variable._jsonSchema ?? resolveFileBodyFromTarget(variable.target) ?? undefined;
272
+ }
273
+ function mapVariablesToInputOutput(variables, getTypeFromVar, isOutput, existingInputOutputs, additionalProps) {
274
+ const existingNames = new Set(existingInputOutputs.map((io) => io.name));
275
+ const result = [...existingInputOutputs];
276
+ for (const [name, variable] of Object.entries(variables)) {
277
+ if (existingNames.has(name)) {
278
+ continue;
279
+ }
280
+ const rawType = getTypeFromVar(variable);
281
+ const { type: parsedType, subType: parsedSubType } = parseTypeAndSubtype(rawType);
282
+ const props = additionalProps ? additionalProps(variable) : {};
283
+ const jsonSchema = getJsonSchema(props);
284
+ const item = {
285
+ name,
286
+ displayName: name,
287
+ value: "",
288
+ ...!jsonSchema ? props : {},
289
+ type: jsonSchema && isOutput && rawType !== "file" ? "jsonSchema" : parsedType,
290
+ ...jsonSchema ? { _jsonSchema: jsonSchema } : {},
291
+ subType: parsedSubType ?? props.items?.type,
292
+ ...isOutput ? { source: `=${name}` } : {},
293
+ ...rawType === "file" && isOutput ? { target: JOB_ATTACHMENT_PREFIX } : {},
294
+ ...isFileType(rawType) ? {
295
+ properties: FILE_TYPE_JSON_SCHEMA.properties,
296
+ "x-uipath-resource-kind": FILE_TYPE_JSON_SCHEMA["x-uipath-resource-kind"]
297
+ } : {}
298
+ };
299
+ result.push(item);
300
+ }
301
+ return result;
302
+ }
303
+ function mapEntryPointVariablesToInputOutput(entryPointVariables, isOutput, existingInputOutputs = []) {
304
+ return mapVariablesToInputOutput(entryPointVariables, (v) => v.type, isOutput, existingInputOutputs, (v) => v);
305
+ }
306
+ function buildErrorOutput() {
307
+ return {
308
+ name: "Error",
309
+ displayName: "Error",
310
+ value: "",
311
+ type: "jsonSchema",
312
+ _jsonSchema: ERROR_OUTPUT_SCHEMA,
313
+ source: "=Error"
314
+ };
315
+ }
316
+ function addVarIdsToInputsOutputs(params) {
317
+ const {
318
+ inputs,
319
+ outputs,
320
+ elementId = "",
321
+ existingVariableIds = []
322
+ } = params;
323
+ const collectedIds = [...existingVariableIds];
324
+ const inputsWithVars = inputs.map((input) => {
325
+ const id = generateNextId("v", 8);
326
+ collectedIds.push(id);
327
+ return {
328
+ ...input,
329
+ var: id,
330
+ id,
331
+ elementId
332
+ };
333
+ });
334
+ const outputsWithVars = outputs.map((output) => {
335
+ let id = output.value;
336
+ if (!id?.length) {
337
+ id = generateNewVariableId(collectedIds, output.name);
338
+ }
339
+ collectedIds.push(id);
340
+ const body = generateBodyForVariable(output);
341
+ return {
342
+ ...output,
343
+ var: id,
344
+ id,
345
+ value: id,
346
+ target: output.target ?? `=${id}`,
347
+ elementId,
348
+ ...body ? { body } : {}
349
+ };
350
+ });
351
+ return { inputsWithVars, outputsWithVars };
352
+ }
353
+
354
+ export { transformSchemaToVariables, convertActionArgsToVariables, mapEntryPointVariablesToInputOutput, buildErrorOutput, addVarIdsToInputsOutputs };
355
+
356
+ //# debugId=F4923EB769649F2664756E2164756E21