@uipath/case-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/{authoring-aaaqwck3.js → authoring-cvjhkfxp.js} +74 -48
- package/dist/{browser-strategy-rkcvc6tn.js → browser-strategy-6atc7v8s.js} +3 -3
- package/dist/case-api-bwcxsbxe.js +381 -0
- package/dist/case-debug-studio-web-service-qcb328bt.js +335 -0
- package/dist/{case-pack-service-bxas5bxz.js → case-pack-service-txby2znw.js} +11 -18
- package/dist/case-validate-service-0q8krj2a.js +2114 -0
- package/dist/connector-enrichment-service-agqxam5y.js +60 -0
- package/dist/connector-lookup-service-ycgk77n0.js +22 -0
- package/dist/connector-task-spec-kdx5bv87.js +1250 -0
- package/dist/{de-5KVP66U6-t37qr521.js → de-5KVP66U6-1bnf4zt5.js} +54 -54
- package/dist/{de-5HU6GFWV-zheyw6d2.js → de-7XQXX2DK-tqdy5n2b.js} +857 -845
- package/dist/debug-service-dxx5pfev.js +57 -0
- package/dist/{en-MABQK6C4-nkzq2j8t.js → en-5ZGC5VQ3-h581y30k.js} +897 -897
- package/dist/{en-4KXU7N7B-24v330b5.js → en-X3S6IZ5J-nhkg6pwn.js} +55 -61
- package/dist/enrichment-service-ebz1f4ds.js +421 -0
- package/dist/{es-MX-POESXYP2-9538722k.js → es-MX-U2VN3SZW-anynsmd8.js} +857 -845
- package/dist/{es-MX-XAVLOQW3-47a405kf.js → es-MX-XAVLOQW3-q00km2y7.js} +54 -54
- package/dist/{es-VFPNVMP5-6sftsdxe.js → es-VFPNVMP5-bx2c337j.js} +54 -54
- package/dist/{es-LUTYN7U7-ye5zn4sn.js → es-ZGCPPOME-8gazspjj.js} +857 -845
- package/dist/{fr-E5MDO4EG-f3x1jeqw.js → fr-E5MDO4EG-c3mkty2t.js} +54 -54
- package/dist/{fr-LJIK56LW-xf3xf2kh.js → fr-T3G5GZCT-y3f7xb1q.js} +857 -845
- package/dist/{index-cncq089f.js → index-7s201ka0.js} +163 -80
- package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
- package/dist/index-k4xz16db.js +63712 -0
- package/dist/{index-p50kx6jv.js → index-k5tbd184.js} +276 -276
- package/dist/index-kwxe1vep.js +143 -0
- package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
- package/dist/index-qyf1dee9.js +630 -0
- package/dist/index.js +16 -17
- package/dist/{index.umd.min-drpc57vn.js → index.umd.min-fqefd9kn.js} +3 -3
- package/dist/input-reader-xb9vecxv.js +11 -0
- package/dist/{ja-FGEGLBJ3-w9byjhze.js → ja-BI5K3JDZ-77zat4z2.js} +857 -845
- package/dist/{ja-DPO5PPLO-fmbg7zt2.js → ja-DPO5PPLO-mysfmznx.js} +54 -54
- package/dist/{js-yaml-cggj6w7q.js → js-yaml-87cdx6bm.js} +27 -19
- package/dist/known-types-qryebm95.js +15 -0
- package/dist/{ko-ITOPNIYI-aqy82jk8.js → ko-ITOPNIYI-hmxd2asd.js} +54 -54
- package/dist/{ko-TUAK3G3A-s25w0ckg.js → ko-JOBF5V7N-4bv0mjje.js} +857 -845
- package/dist/{node-strategy-8gzp67xs.js → node-strategy-0267x5e5.js} +130 -14
- package/dist/node-sync-service-9a9ksj9s.js +38 -0
- package/dist/{packager-tool-9qecd4wb.js → packager-tool-0gctz400.js} +5 -2
- package/dist/packager-tool-0mj06yen.js +65 -0
- package/dist/{packager-tool-1cb0d5e0.js → packager-tool-0v3s8r01.js} +2 -2
- package/dist/packager-tool-134mvmcm.js +3040 -0
- package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
- package/dist/{packager-tool-zqa5k9f7.js → packager-tool-37zvccmt.js} +990 -2287
- package/dist/packager-tool-3ze5vt52.js +54 -0
- package/dist/{packager-tool-w3h8xrnv.js → packager-tool-56j6keqr.js} +71 -3
- package/dist/{packager-tool-3wygxefb.js → packager-tool-58q3tvh7.js} +10 -10
- package/dist/{packager-tool-zx48pq4v.js → packager-tool-5ax2ywcg.js} +1997 -1174
- package/dist/{packager-tool-we1phz71.js → packager-tool-885mmrvr.js} +31 -3
- package/dist/packager-tool-9scn4b15.js +852 -0
- package/dist/{packager-tool-p9j43p8h.js → packager-tool-a42jnpy5.js} +3 -9
- package/dist/packager-tool-ajvse9r3.js +356 -0
- package/dist/{packager-tool-jysvpt8p.js → packager-tool-c23zrhj8.js} +2 -2
- package/dist/packager-tool-dqs5qy9s.js +2327 -0
- package/dist/packager-tool-ee5dhff3.js +6717 -0
- package/dist/{packager-tool-wvqz81mx.js → packager-tool-gtzs471w.js} +3 -2
- package/dist/packager-tool-hrr0efqc.js +546 -0
- package/dist/packager-tool-j9rfdrdm.js +1125 -0
- package/dist/{packager-tool-gq6952nc.js → packager-tool-jhdf8gt1.js} +5054 -17851
- package/dist/packager-tool-mp59jtpm.js +6865 -0
- package/dist/packager-tool-njzcfve1.js +77 -0
- package/dist/packager-tool-p7jgrm5r.js +15 -0
- package/dist/packager-tool-r84ng21s.js +57 -0
- package/dist/packager-tool-rqvr63x5.js +1217 -0
- package/dist/packager-tool-s12392rd.js +80 -0
- package/dist/packager-tool-sv0d6wb6.js +173 -0
- package/dist/packager-tool-ty1t2byf.js +27 -0
- package/dist/packager-tool-vepqrsse.js +23 -0
- package/dist/packager-tool-w5ek334f.js +4892 -0
- package/dist/{packager-tool-5arsyj36.js → packager-tool-yc4kw997.js} +4 -2
- package/dist/packager-tool.js +91 -5
- package/dist/project-artifacts-vhanbtw5.js +14 -0
- package/dist/{pt-BR-7XGDXRDJ-espnkgrj.js → pt-BR-7DYX2YPT-fqxqzqtf.js} +857 -845
- package/dist/{pt-BR-BXURWX4W-xzyndmrx.js → pt-BR-BXURWX4W-bwfcwhk1.js} +54 -54
- package/dist/{pt-TMVOOITK-myha14p9.js → pt-HTXGGX6Y-97t21dty.js} +857 -845
- package/dist/{pt-YI4VE4YQ-521681zf.js → pt-YI4VE4YQ-wdkn2dcf.js} +54 -54
- package/dist/resourcesSyncService-mrmmwaqr.js +683 -0
- package/dist/{ro-2VALF3S5-cdz5afkr.js → ro-KTNQ3MNU-y08n1x5g.js} +857 -845
- package/dist/{ro-RKXZUG7Z-pdztdafr.js → ro-RKXZUG7Z-nndrrsq7.js} +54 -54
- package/dist/{ru-GSCT4ARZ-qj8dm4dp.js → ru-GSCT4ARZ-1sa9wbr8.js} +1 -1
- package/dist/ru-WBLQ5B2U-8r3c7v6d.js +10 -0
- package/dist/strict-case-rules-303vjvas.js +377 -0
- package/dist/strict-sdd-audit-qdmc9e1y.js +1024 -0
- package/dist/tool.js +17 -18
- package/dist/{tr-AA6O2WSR-bj9n80k8.js → tr-AA6O2WSR-86ba4bdf.js} +54 -54
- package/dist/{tr-RIFCEXFH-hgkb4g8y.js → tr-XHSSPNK7-cmqyc4wd.js} +857 -845
- package/dist/trigger-enrichment-service-zdx4x92j.js +340 -0
- package/dist/{zh-CN-IP3FMXWM-1cfarhcp.js → zh-CN-2EHQT23P-mr63c4xz.js} +857 -845
- package/dist/{zh-CN-R2KLHXQV-x6gnk2n0.js → zh-CN-R2KLHXQV-agqr45ds.js} +54 -54
- package/dist/{zh-TW-AGIDXIPF-n6r6w7vy.js → zh-TW-MGZCE5BT-c4ekmrz9.js} +857 -845
- package/dist/{zh-TW-RJGCQANM-tt8j5wv2.js → zh-TW-RJGCQANM-w0x3qc1p.js} +54 -54
- package/package.json +2 -2
- package/dist/index-8bsngk9y.js +0 -247140
- package/dist/packager-tool-axcdppp9.js +0 -13607
- package/dist/ru-WBLQ5B2U-8xd4gpv2.js +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/@uipath/flow-
|
|
1
|
+
// ../../node_modules/@uipath/flow-schema/dist/chunk-MACQMIE5.js
|
|
2
2
|
var agentDuplicateToolNames_duplicateName_message = 'Tool name "{{name}}" is used by multiple tools on this agent. Each tool must have a unique name.';
|
|
3
3
|
var agentEmptyVar_unwrittenVariable_message = `Agent uses "$vars.{{root}}" but no node assigns a value to "{{root}}", so it will be empty at runtime. Bind it to a node output (e.g. a connector's "<node>.output") or give it a value source.`;
|
|
4
4
|
var agentInputRefs_ambiguousUnderscoreRoot_message = 'Prompt references "$vars.{{ref}}", but the name "{{rootSegment}}" contains "__", which is reserved as the agent-input encoding separator and cannot round-trip. Rename it to remove the double underscore.';
|
|
@@ -23,9 +23,6 @@ var dataTransform_mapNoMappings_message = '"{{nodeLabel}}" map operation needs a
|
|
|
23
23
|
var dataTransform_missingCollection_message = '"{{nodeLabel}}" is missing a collection variable';
|
|
24
24
|
var dataTransform_noOperations_message = '"{{nodeLabel}}" has no operations configured';
|
|
25
25
|
var doWhile_limitOutOfRange_message = "Set maximum iterations between {{min}} and {{max}}";
|
|
26
|
-
var entityQuery_emptyFilterExpression_message = "Write an expression for every filter, or remove the filter";
|
|
27
|
-
var entityQuery_emptyFilterValueList_message = "Add at least one value to the filter, or remove the filter";
|
|
28
|
-
var entityQuery_uncarryableExpression_message = "Store this expression in a variable, or write it without spaces, quotes, or backslashes";
|
|
29
26
|
var escalation_appRequired_message = "Select an action app";
|
|
30
27
|
var escalation_memoryArgumentRequired_message = "{{label}}: Add at least one argument for agent memory, or turn agent memory off";
|
|
31
28
|
var escalation_nameRequired_message = "{{label}}: Escalation name is required";
|
|
@@ -78,9 +75,6 @@ var en_default = {
|
|
|
78
75
|
dataTransform_missingCollection_message,
|
|
79
76
|
dataTransform_noOperations_message,
|
|
80
77
|
doWhile_limitOutOfRange_message,
|
|
81
|
-
entityQuery_emptyFilterExpression_message,
|
|
82
|
-
entityQuery_emptyFilterValueList_message,
|
|
83
|
-
entityQuery_uncarryableExpression_message,
|
|
84
78
|
escalation_appRequired_message,
|
|
85
79
|
escalation_memoryArgumentRequired_message,
|
|
86
80
|
escalation_nameRequired_message,
|
|
@@ -110,6 +104,6 @@ var en_default = {
|
|
|
110
104
|
triggerRequired_message
|
|
111
105
|
};
|
|
112
106
|
|
|
113
|
-
export { agentDuplicateToolNames_duplicateName_message, agentEmptyVar_unwrittenVariable_message, agentInputRefs_ambiguousUnderscoreRoot_message, agentInputRefs_reservedMetadataRoot_message, agentInputRefs_reservedNamespace_message, agentInputRefs_unresolvedRef_message, conditionExpression_decisionWrapped_message, conditionExpression_incomplete_message, conditionExpression_invalid_message, conditionExpression_required_message, conversationalVoiceEndCall_callContextInvalid_message, conversationalVoice_callContextInvalid_message, conversationalVoice_callContextRequired_message, dataTransform_customScriptMissing_message, dataTransform_filterMissingField_message, dataTransform_filterNoConditions_message, dataTransform_groupByAggMissingField_message, dataTransform_groupByAggMissingOutputName_message, dataTransform_groupByMissingField_message, dataTransform_mapMissingField_message, dataTransform_mapNoMappings_message, dataTransform_missingCollection_message, dataTransform_noOperations_message, doWhile_limitOutOfRange_message,
|
|
107
|
+
export { agentDuplicateToolNames_duplicateName_message, agentEmptyVar_unwrittenVariable_message, agentInputRefs_ambiguousUnderscoreRoot_message, agentInputRefs_reservedMetadataRoot_message, agentInputRefs_reservedNamespace_message, agentInputRefs_unresolvedRef_message, conditionExpression_decisionWrapped_message, conditionExpression_incomplete_message, conditionExpression_invalid_message, conditionExpression_required_message, conversationalVoiceEndCall_callContextInvalid_message, conversationalVoice_callContextInvalid_message, conversationalVoice_callContextRequired_message, dataTransform_customScriptMissing_message, dataTransform_filterMissingField_message, dataTransform_filterNoConditions_message, dataTransform_groupByAggMissingField_message, dataTransform_groupByAggMissingOutputName_message, dataTransform_groupByMissingField_message, dataTransform_mapMissingField_message, dataTransform_mapNoMappings_message, dataTransform_missingCollection_message, dataTransform_noOperations_message, doWhile_limitOutOfRange_message, escalation_appRequired_message, escalation_memoryArgumentRequired_message, escalation_nameRequired_message, escalation_quickFormDuplicateFieldLabel_message, escalation_recipientRequired_message, governance_hitlRequired_message, governance_maxIterationsExceeded_message, governance_maxTokensExceeded_message, governance_modelNotAvailable_message, governance_noAllowedModel_message, governance_temperatureExceeded_message, hitlQuickForm_emptySchema_message, hitlQuickForm_fieldLabelRequired_message, ixpSchemaDraft_invalidWithDetail_message, ixpSchemaDraft_invalid_message, outputMapping_missing_message, schemaValidator_genericKeyword_message, schemaValidator_invalidEnum_message, schemaValidator_invalidField_message, schemaValidator_invalidPattern_message, schemaValidator_outOfRange_message, schemaValidator_required_message, schemaValidator_typeMismatch_message, schemaValidator_validation_genericError, scriptBody_mustache_message, singleConversationTrigger_message, triggerRequired_message, en_default };
|
|
114
108
|
|
|
115
|
-
//# debugId=
|
|
109
|
+
//# debugId=D83354EDA6FF7BBE64756E2164756E21
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError
|
|
3
|
+
} from "./packager-tool-5ax2ywcg.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/@uipath/flow-
|
|
1
|
+
// ../../node_modules/@uipath/flow-schema/dist/chunk-QKQ47GQZ.js
|
|
2
2
|
var __glob = (map) => (path) => {
|
|
3
3
|
var fn = map[path];
|
|
4
4
|
if (fn)
|
|
@@ -8,4 +8,4 @@ var __glob = (map) => (path) => {
|
|
|
8
8
|
|
|
9
9
|
export { __glob };
|
|
10
10
|
|
|
11
|
-
//# debugId=
|
|
11
|
+
//# debugId=1F72848CF395F3AB64756E2164756E21
|