@uipath/case-tool 1.203.0-preview.212 → 1.204.0-preview.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/THIRD-PARTY-NOTICES.md +10 -9
- package/dist/authoring-0hr88kff.js +623 -0
- package/dist/{case-api-v6cjyrfw.js → case-api-gdaj9469.js} +5 -5
- package/dist/case-bindings-service-c2mze9vj.js +476 -0
- package/dist/{case-debug-studio-web-service-8th9d8sm.js → case-debug-studio-web-service-6q9ch7cq.js} +11 -10
- package/dist/case-described-io-service-cpe5h2ks.js +132 -0
- package/dist/{case-format-service-q345a2fd.js → case-format-service-qwyjyt0y.js} +2 -2
- package/dist/{case-pack-service-29rza2q2.js → case-pack-service-47yrvmg0.js} +11 -11
- package/dist/case-shape-reader-mw58avr0.js +13 -0
- package/dist/case-splice-service-9zvw19ca.js +312 -0
- package/dist/{case-validate-service-84drzwx3.js → case-validate-service-jcdf4n67.js} +415 -1449
- package/dist/{connector-enrichment-service-2982ykgb.js → connector-enrichment-service-60wwjarq.js} +20 -18
- package/dist/{connector-lookup-service-8ddh4pq2.js → connector-lookup-service-zhf8fz2j.js} +7 -7
- package/dist/{connector-task-spec-qs7q7vnv.js → connector-task-spec-96e3wzx7.js} +86 -26
- package/dist/{debug-service-8x087xxt.js → debug-service-vf5mw0nr.js} +3 -3
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/{enrichment-service-7vbxcwge.js → enrichment-service-78b0gqck.js} +8 -7
- package/dist/index-hhsf00x8.js +15 -0
- package/dist/{index-fz4ttsde.js → index-j2r3jb6c.js} +5 -3
- package/dist/{index-yj8fb3q6.js → index-k7gkw7s9.js} +59 -27
- package/dist/{index-jxj2jz45.js → index-rgw7caht.js} +416 -87
- package/dist/{index-k4xz16db.js → index-wmffgzmr.js} +12522 -7316
- package/dist/index.js +15 -11
- package/dist/{input-reader-pnh948bq.js → input-reader-bb0ptk2v.js} +2 -2
- package/dist/migration-diagnosis-ag2sgd1e.js +71 -0
- package/dist/{node-strategy-gc4sg6a2.js → node-strategy-5pz40tee.js} +1 -1
- package/dist/{node-sync-service-t193ery3.js → node-sync-service-zwjcwgwc.js} +6 -6
- package/dist/out-target-1f4n9vqb.js +70 -0
- package/dist/{packager-tool-wefb1zw3.js → packager-tool-0p3td5zv.js} +8 -7
- package/dist/packager-tool-21qfsbxn.js +17 -0
- package/dist/{strict-sdd-audit-8e2fh9jg.js → packager-tool-4e56rmwe.js} +2771 -1746
- package/dist/{packager-tool-sfkyb4kz.js → packager-tool-4rqd21wc.js} +194 -2
- package/dist/packager-tool-57pzrd0g.js +32 -0
- package/dist/{packager-tool-kpcjnxd1.js → packager-tool-58kx79ta.js} +586 -113
- package/dist/{packager-tool-hrdan5ms.js → packager-tool-5qghkdd0.js} +2 -2
- package/dist/packager-tool-5qp9xza1.js +10 -0
- package/dist/{packager-tool-3qkp2fts.js → packager-tool-76ms0wdw.js} +4 -4
- package/dist/packager-tool-8a9yqfq7.js +76 -0
- package/dist/packager-tool-b250k6w4.js +75 -0
- package/dist/packager-tool-bfgdz1zh.js +73 -0
- package/dist/{packager-tool-p7jgrm5r.js → packager-tool-cmwets3m.js} +1 -1
- package/dist/{packager-tool-d4sjk46c.js → packager-tool-cv05dwac.js} +18 -21
- package/dist/packager-tool-d7jjng8a.js +21 -0
- package/dist/{packager-tool-rh07gzxw.js → packager-tool-dqnc61h1.js} +5 -5
- package/dist/packager-tool-dthjwajc.js +13 -0
- package/dist/packager-tool-f78ntj5g.js +228 -0
- package/dist/{packager-tool-r1g8rqcs.js → packager-tool-gjhg49r1.js} +4 -4
- package/dist/{packager-tool-cg2j4rma.js → packager-tool-kacqd7h7.js} +4 -4
- package/dist/packager-tool-mknccck5.js +24 -0
- package/dist/{packager-tool-sv0d6wb6.js → packager-tool-nj4seavy.js} +7 -3
- package/dist/{packager-tool-adcaxdhs.js → packager-tool-paepfv5d.js} +1 -1
- package/dist/{packager-tool-052kvydg.js → packager-tool-pm646ag4.js} +1 -1
- package/dist/{packager-tool-qht4xd0y.js → packager-tool-q86py4rp.js} +320 -200
- package/dist/{packager-tool-geaetyks.js → packager-tool-qmeaj10z.js} +669 -100
- package/dist/{packager-tool-dd8bq6az.js → packager-tool-rgpdaxbx.js} +548 -108
- package/dist/{packager-tool-8q7vzh65.js → packager-tool-s3e2kepj.js} +455 -13
- package/dist/{packager-tool-r84ng21s.js → packager-tool-sag9gz55.js} +3 -1
- package/dist/{packager-tool-0mj06yen.js → packager-tool-sq931c23.js} +5 -22
- package/dist/{packager-tool-7mggwye6.js → packager-tool-tmfbp50w.js} +6 -6
- package/dist/{packager-tool-yrsrzz1a.js → packager-tool-v99ygh9f.js} +23 -8
- package/dist/packager-tool-wj9d9mqe.js +267 -0
- package/dist/{packager-tool-hz1mz8fs.js → packager-tool-wjaya2k2.js} +2 -2
- package/dist/packager-tool-xcd87qyx.js +44 -0
- package/dist/{packager-tool-0v3s8r01.js → packager-tool-xdxr3ync.js} +4 -2
- package/dist/{packager-tool-61hxhgeg.js → packager-tool-xkgq5fkf.js} +3 -3
- package/dist/packager-tool.js +6 -6
- package/dist/{project-artifacts-8snev67g.js → project-artifacts-wzrhketn.js} +1 -1
- package/dist/resolved-check-p99hysaw.js +50 -0
- package/dist/{resourcesSyncService-01qr5zp7.js → resourcesSyncService-rjt0tht7.js} +25 -18
- package/dist/rule-group-members-zje7n3kf.js +76 -0
- package/dist/sdd-convert-service-gp9733qv.js +1962 -0
- package/dist/{sdd-lookup-x08j9g9m.js → sdd-lookup-vpjej1kt.js} +2 -2
- package/dist/sdd-resolve-service-4hx64x3z.js +288 -0
- package/dist/strict-case-rules-ksy8q7pg.js +731 -0
- package/dist/strict-entry-points-v14d7y50.js +124 -0
- package/dist/strict-sdd-audit-k6hh0mbr.js +23 -0
- package/dist/task-selector-8bjn35dv.js +57 -0
- package/dist/tool.js +15 -11
- package/dist/{trigger-enrichment-service-sddbphf2.js → trigger-enrichment-service-kst89jbe.js} +41 -23
- package/package.json +2 -2
- package/dist/authoring-kngaggwm.js +0 -360
- package/dist/case-bindings-service-1wxfghzd.js +0 -240
- package/dist/packager-tool-83qnybab.js +0 -1564
- package/dist/strict-case-rules-x6t0vb40.js +0 -409
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadCaseSchemaAsync
|
|
3
|
-
} from "./packager-tool-p7jgrm5r.js";
|
|
4
|
-
import {
|
|
5
|
-
NugetPackager,
|
|
6
|
-
ensureProjectId
|
|
7
|
-
} from "./packager-tool-sfkyb4kz.js";
|
|
8
1
|
import {
|
|
9
2
|
CasePlanFileNames,
|
|
10
3
|
buildCasePackageDescriptor,
|
|
@@ -13,19 +6,26 @@ import {
|
|
|
13
6
|
findCasePlanFileName,
|
|
14
7
|
misnamedEntryPointBpmn,
|
|
15
8
|
resolveDeclaredFileName
|
|
16
|
-
} from "./packager-tool-
|
|
9
|
+
} from "./packager-tool-wj9d9mqe.js";
|
|
10
|
+
import {
|
|
11
|
+
NugetPackager,
|
|
12
|
+
ensureProjectId
|
|
13
|
+
} from "./packager-tool-4rqd21wc.js";
|
|
17
14
|
import"./packager-tool-b098y4a2.js";
|
|
18
15
|
import {
|
|
19
16
|
VALID_PACKAGE_NAME_REGEX
|
|
20
17
|
} from "./packager-tool-vepqrsse.js";
|
|
18
|
+
import {
|
|
19
|
+
loadCaseSchemaAsync
|
|
20
|
+
} from "./packager-tool-cmwets3m.js";
|
|
21
21
|
import {
|
|
22
22
|
catchError,
|
|
23
23
|
logger,
|
|
24
24
|
mapPackageMetadataOptions
|
|
25
|
-
} from "./packager-tool-
|
|
25
|
+
} from "./packager-tool-58kx79ta.js";
|
|
26
26
|
import {
|
|
27
27
|
getFileSystem
|
|
28
|
-
} from "./packager-tool-
|
|
28
|
+
} from "./packager-tool-xdxr3ync.js";
|
|
29
29
|
import"./packager-tool-1yh8g550.js";
|
|
30
30
|
|
|
31
31
|
// src/services/case-pack-service.ts
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
CasePackService
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
//# debugId=
|
|
162
|
+
//# debugId=B41124A85EC9DB4964756E2164756E21
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readCaseShape,
|
|
3
|
+
readIoRows,
|
|
4
|
+
readSpecFolderKey
|
|
5
|
+
} from "./packager-tool-8a9yqfq7.js";
|
|
6
|
+
import"./packager-tool-1yh8g550.js";
|
|
7
|
+
export {
|
|
8
|
+
readCaseShape,
|
|
9
|
+
readIoRows,
|
|
10
|
+
readSpecFolderKey
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# debugId=45CD419A5F389BCF64756E2164756E21
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONNECTOR_TASK_TYPES,
|
|
3
|
+
SERVICE_TYPE_BY_TASK
|
|
4
|
+
} from "./packager-tool-dthjwajc.js";
|
|
5
|
+
import {
|
|
6
|
+
BINDING_REFERENCE_PREFIX
|
|
7
|
+
} from "./packager-tool-d7jjng8a.js";
|
|
8
|
+
import {
|
|
9
|
+
createConnectorBindings
|
|
10
|
+
} from "./packager-tool-sq931c23.js";
|
|
11
|
+
import {
|
|
12
|
+
prefixedId
|
|
13
|
+
} from "./packager-tool-mknccck5.js";
|
|
14
|
+
import"./packager-tool-1yh8g550.js";
|
|
15
|
+
|
|
16
|
+
// src/services/case-splice-service.ts
|
|
17
|
+
var CONNECTION_SENTINEL = "{{CONN_BINDING_ID}}";
|
|
18
|
+
var FOLDER_SENTINEL = "{{FOLDER_BINDING_ID}}";
|
|
19
|
+
var CONNECTION_RESOURCE = "Connection";
|
|
20
|
+
var FOLDER_KEY_ATTRIBUTE = "folderKey";
|
|
21
|
+
var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
|
|
22
|
+
var asArray = (value) => Array.isArray(value) ? value : [];
|
|
23
|
+
var findTask = (document, taskId) => {
|
|
24
|
+
for (const rawNode of asArray(document.nodes)) {
|
|
25
|
+
const node = asRecord(rawNode);
|
|
26
|
+
if (!node)
|
|
27
|
+
continue;
|
|
28
|
+
for (const lane of asArray(asRecord(node.data)?.tasks)) {
|
|
29
|
+
for (const rawTask of asArray(lane)) {
|
|
30
|
+
const task = asRecord(rawTask);
|
|
31
|
+
if (task?.id === taskId)
|
|
32
|
+
return { node, task };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
};
|
|
38
|
+
var contextValue = (context, name) => {
|
|
39
|
+
for (const raw of context) {
|
|
40
|
+
const entry = asRecord(raw);
|
|
41
|
+
if (entry?.name !== name)
|
|
42
|
+
continue;
|
|
43
|
+
const value = entry.value;
|
|
44
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
};
|
|
48
|
+
var declaresEntry = (context, name) => context.some((raw) => asRecord(raw)?.name === name);
|
|
49
|
+
var isReferenced = (document, id) => {
|
|
50
|
+
const needle = `${BINDING_REFERENCE_PREFIX}${id}`;
|
|
51
|
+
const walk = (value) => {
|
|
52
|
+
if (typeof value === "string")
|
|
53
|
+
return value === needle;
|
|
54
|
+
if (Array.isArray(value))
|
|
55
|
+
return value.some(walk);
|
|
56
|
+
const record = asRecord(value);
|
|
57
|
+
if (record === undefined)
|
|
58
|
+
return false;
|
|
59
|
+
return Object.entries(record).some(([key, entry]) => key !== "bindings" && walk(entry));
|
|
60
|
+
};
|
|
61
|
+
return walk(document);
|
|
62
|
+
};
|
|
63
|
+
var connectorKeyOf = (context) => {
|
|
64
|
+
for (const raw of context) {
|
|
65
|
+
const entry = asRecord(raw);
|
|
66
|
+
if (entry?.name !== "connectorKey")
|
|
67
|
+
continue;
|
|
68
|
+
const value = entry.value;
|
|
69
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
};
|
|
73
|
+
var substituteSentinels = (value, connectionId, folderId) => {
|
|
74
|
+
if (typeof value === "string") {
|
|
75
|
+
let next = value.replaceAll(CONNECTION_SENTINEL, connectionId);
|
|
76
|
+
if (folderId !== undefined) {
|
|
77
|
+
next = next.replaceAll(FOLDER_SENTINEL, folderId);
|
|
78
|
+
}
|
|
79
|
+
return next;
|
|
80
|
+
}
|
|
81
|
+
if (Array.isArray(value)) {
|
|
82
|
+
return value.map((entry) => substituteSentinels(entry, connectionId, folderId));
|
|
83
|
+
}
|
|
84
|
+
const record = asRecord(value);
|
|
85
|
+
if (!record)
|
|
86
|
+
return value;
|
|
87
|
+
return Object.fromEntries(Object.entries(record).map(([key, entry]) => [
|
|
88
|
+
key,
|
|
89
|
+
substituteSentinels(entry, connectionId, folderId)
|
|
90
|
+
]));
|
|
91
|
+
};
|
|
92
|
+
var existingBinding = (bindings, connectionId, propertyAttribute) => {
|
|
93
|
+
for (const raw of bindings) {
|
|
94
|
+
const binding = asRecord(raw);
|
|
95
|
+
if (!binding)
|
|
96
|
+
continue;
|
|
97
|
+
if (binding.resource === CONNECTION_RESOURCE && binding.resourceKey === connectionId && binding.propertyAttribute === propertyAttribute) {
|
|
98
|
+
return binding;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
};
|
|
103
|
+
var DOCUMENT_OWNED_OUTPUT_FIELDS = [
|
|
104
|
+
"value",
|
|
105
|
+
"source",
|
|
106
|
+
"target",
|
|
107
|
+
"originalVar"
|
|
108
|
+
];
|
|
109
|
+
var mergeOutputs = (specRows, existing, elementId) => {
|
|
110
|
+
const byName = new Map;
|
|
111
|
+
for (const raw of existing) {
|
|
112
|
+
const row = asRecord(raw);
|
|
113
|
+
if (typeof row?.name === "string" && row.name !== "") {
|
|
114
|
+
byName.set(row.name, row);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const merged = withVarIds(specRows, existing, elementId).map((row) => {
|
|
118
|
+
const kept = typeof row.name === "string" ? byName.get(row.name) : undefined;
|
|
119
|
+
if (kept === undefined)
|
|
120
|
+
return row;
|
|
121
|
+
const owned = Object.fromEntries(DOCUMENT_OWNED_OUTPUT_FIELDS.filter((field) => kept[field] !== undefined).map((field) => [field, kept[field]]));
|
|
122
|
+
return { ...row, ...owned };
|
|
123
|
+
});
|
|
124
|
+
const specNames = new Set(merged.map((row) => row.name));
|
|
125
|
+
const unmatched = existing.map(asRecord).filter((row) => row !== undefined && !specNames.has(row.name));
|
|
126
|
+
return [...merged, ...unmatched];
|
|
127
|
+
};
|
|
128
|
+
var withVarIds = (rows, existing, elementId) => {
|
|
129
|
+
const byName = new Map;
|
|
130
|
+
for (const raw of existing) {
|
|
131
|
+
const row = asRecord(raw);
|
|
132
|
+
if (row === undefined)
|
|
133
|
+
continue;
|
|
134
|
+
const name = row.name;
|
|
135
|
+
if (typeof name === "string" && name !== "")
|
|
136
|
+
byName.set(name, row);
|
|
137
|
+
}
|
|
138
|
+
return rows.map((raw) => {
|
|
139
|
+
const row = asRecord(raw) ?? {};
|
|
140
|
+
const name = typeof row.name === "string" ? row.name : "";
|
|
141
|
+
const kept = byName.get(name);
|
|
142
|
+
const keptId = typeof kept?.id === "string" && kept.id !== "" ? kept.id : undefined;
|
|
143
|
+
const id = keptId ?? (typeof row.id === "string" && row.id !== "" ? row.id : prefixedId("v", 8));
|
|
144
|
+
const keptVar = typeof kept?.var === "string" && kept.var !== "" ? kept.var : undefined;
|
|
145
|
+
return {
|
|
146
|
+
...row,
|
|
147
|
+
id,
|
|
148
|
+
var: keptVar ?? (typeof row.var === "string" && row.var !== "" ? row.var : id),
|
|
149
|
+
elementId
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
var spliceConnectorShape = (document, caseShape, options) => {
|
|
154
|
+
const found = findTask(document, options.taskId);
|
|
155
|
+
if (found === undefined) {
|
|
156
|
+
return {
|
|
157
|
+
message: `No task with id "${options.taskId}" in this case plan`,
|
|
158
|
+
instructions: "Pass the task's `id` from `nodes[].data.tasks[][]`. `uip maestro case tasks list` prints them."
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const { task } = found;
|
|
162
|
+
const taskType = typeof task.type === "string" ? task.type : "";
|
|
163
|
+
if (!CONNECTOR_TASK_TYPES.has(taskType)) {
|
|
164
|
+
return {
|
|
165
|
+
message: `Task "${options.taskId}" is a \`${taskType || "(untyped)"}\` task, not a connector task`,
|
|
166
|
+
instructions: `A connector shape only belongs on ${[...CONNECTOR_TASK_TYPES].map((type) => `\`${type}\``).join(" or ")}. Change the task's type first, or splice into a different task.`
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const context = asArray(caseShape.context);
|
|
170
|
+
if (context.length === 0) {
|
|
171
|
+
return {
|
|
172
|
+
message: "This spec carries no `caseShape.context`",
|
|
173
|
+
instructions: "Re-run `uip maestro case spec` without `--skip-case-shape`. A trigger spec may not build a context yet, in which case there is nothing to splice."
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const connectorKey = connectorKeyOf(context);
|
|
177
|
+
if (connectorKey === undefined) {
|
|
178
|
+
return {
|
|
179
|
+
message: "This `caseShape.context` declares no `connectorKey`",
|
|
180
|
+
instructions: "The connection binding is named after the connector, so the key has to come from the spec. Re-fetch the spec rather than editing its context by hand."
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const specConnection = contextValue(context, "resourceKey");
|
|
184
|
+
if (options.connectionId !== undefined && specConnection !== undefined && specConnection !== options.connectionId) {
|
|
185
|
+
return {
|
|
186
|
+
message: `This spec was fetched for connection ${specConnection}, not ${options.connectionId}`,
|
|
187
|
+
instructions: "Pass the connection the spec was fetched for, or re-fetch the spec with `uip maestro case spec --connection-id` for the connection you mean. Splicing the pair as given writes a task whose context and bindings name different connections."
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
const connectionId = options.connectionId ?? specConnection;
|
|
191
|
+
if (connectionId === undefined) {
|
|
192
|
+
return {
|
|
193
|
+
message: "This spec's `caseShape.context` states no `resourceKey`, so the connection it was fetched for is unknown",
|
|
194
|
+
instructions: "Pass `--connection-id` with the connection the spec was fetched for. `uip maestro case registry get-connection --type typecache-activities --activity-type-id <uuid>` lists the candidates."
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const bindings = asArray(document.bindings);
|
|
198
|
+
const foundConnection = existingBinding(bindings, connectionId, "ConnectionId");
|
|
199
|
+
if (options.folderKey !== undefined && !declaresEntry(context, "folderKey")) {
|
|
200
|
+
return {
|
|
201
|
+
message: `This spec's connection has no folder — its context carries no \`folderKey\` entry — and --folder-key was given`,
|
|
202
|
+
instructions: "Drop `--folder-key`. The connector spec says this connection is not folder-scoped, so a folder binding would reference nothing."
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const specFolderKey = options.specFolderKey;
|
|
206
|
+
if (options.folderKey !== undefined && specFolderKey !== undefined && options.folderKey.toLowerCase() !== specFolderKey.toLowerCase()) {
|
|
207
|
+
return {
|
|
208
|
+
message: `This spec's connection is in folder ${specFolderKey}, not ${options.folderKey}`,
|
|
209
|
+
instructions: "Drop `--folder-key` to use the spec's folder, or re-fetch the spec with `uip maestro case spec --connection-id` for the connection you mean."
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const folderKey = options.folderKey ?? (declaresEntry(context, "folderKey") ? specFolderKey : undefined);
|
|
213
|
+
const foundFolder = folderKey === undefined ? undefined : existingBinding(bindings, connectionId, "folderKey");
|
|
214
|
+
for (const found2 of [foundConnection, foundFolder]) {
|
|
215
|
+
if (found2 === undefined)
|
|
216
|
+
continue;
|
|
217
|
+
const id = found2.id;
|
|
218
|
+
if (typeof id === "string" && id !== "")
|
|
219
|
+
continue;
|
|
220
|
+
return {
|
|
221
|
+
message: `The existing \`${String(found2.propertyAttribute ?? "")}\` binding for connection ${connectionId} has ${id === undefined ? "no `id`" : `an empty \`id\``}, so nothing can reference it`,
|
|
222
|
+
instructions: "A task addresses a binding as `=bindings.<id>`, so an " + "entry with no id resolves to nothing. Give that entry in " + "`bindings[]` a unique id, or delete it and re-run this " + "command to have a fresh pair written."
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const [freshConnection, freshFolder] = createConnectorBindings(connectorKey, connectionId, folderKey);
|
|
226
|
+
const completed = [];
|
|
227
|
+
const complete = (binding, value) => {
|
|
228
|
+
const record = binding;
|
|
229
|
+
if (value === undefined || value === "")
|
|
230
|
+
return record;
|
|
231
|
+
const current = record.default;
|
|
232
|
+
if (current === value)
|
|
233
|
+
return record;
|
|
234
|
+
completed.push(String(record.name ?? record.id ?? ""));
|
|
235
|
+
return { ...record, default: value };
|
|
236
|
+
};
|
|
237
|
+
const connectionBinding = complete(foundConnection ?? freshConnection, connectionId);
|
|
238
|
+
const folderBinding = foundFolder === undefined ? freshFolder : complete(foundFolder, folderKey);
|
|
239
|
+
const connectionBindingId = String(connectionBinding.id ?? "");
|
|
240
|
+
const folderBindingId = folderBinding === undefined ? undefined : String(folderBinding.id ?? "");
|
|
241
|
+
const nextBindings = bindings.map((entry) => {
|
|
242
|
+
const binding = asRecord(entry);
|
|
243
|
+
if (binding === undefined)
|
|
244
|
+
return entry;
|
|
245
|
+
if (foundConnection !== undefined && binding === foundConnection) {
|
|
246
|
+
return connectionBinding;
|
|
247
|
+
}
|
|
248
|
+
if (foundFolder !== undefined && binding === foundFolder) {
|
|
249
|
+
return folderBinding;
|
|
250
|
+
}
|
|
251
|
+
return entry;
|
|
252
|
+
});
|
|
253
|
+
if (foundConnection === undefined)
|
|
254
|
+
nextBindings.push(connectionBinding);
|
|
255
|
+
if (foundFolder === undefined && freshFolder !== undefined) {
|
|
256
|
+
nextBindings.push(freshFolder);
|
|
257
|
+
}
|
|
258
|
+
const elementId = typeof task.elementId === "string" && task.elementId !== "" ? task.elementId : options.taskId;
|
|
259
|
+
const data = asRecord(task.data) ?? {};
|
|
260
|
+
const splicedContext = substituteSentinels(context, connectionBindingId, folderBindingId);
|
|
261
|
+
const leftover = JSON.stringify(splicedContext).includes(FOLDER_SENTINEL) ? FOLDER_SENTINEL : JSON.stringify(splicedContext).includes(CONNECTION_SENTINEL) ? CONNECTION_SENTINEL : undefined;
|
|
262
|
+
if (leftover !== undefined) {
|
|
263
|
+
return {
|
|
264
|
+
message: `This spec's context carries ${leftover}, and nothing was given to resolve it`,
|
|
265
|
+
instructions: leftover === FOLDER_SENTINEL ? "Pass `--folder-key <key>`. The shape asks for a folder-key binding, so splicing without one would leave an unresolved reference in the task." : "Pass `--connection-id <id>` for the connection this spec was fetched for."
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
task.data = {
|
|
269
|
+
...data,
|
|
270
|
+
serviceType: SERVICE_TYPE_BY_TASK[taskType],
|
|
271
|
+
context: splicedContext,
|
|
272
|
+
inputs: withVarIds(asArray(caseShape.inputs), asArray(data.inputs), elementId),
|
|
273
|
+
outputs: mergeOutputs(asArray(caseShape.outputs), asArray(data.outputs), elementId)
|
|
274
|
+
};
|
|
275
|
+
const dropped = [];
|
|
276
|
+
const prunedBindings = folderKey === undefined && !declaresEntry(context, "folderKey") ? nextBindings.filter((entry) => {
|
|
277
|
+
const binding = asRecord(entry);
|
|
278
|
+
if (binding?.resource !== CONNECTION_RESOURCE || binding.propertyAttribute !== FOLDER_KEY_ATTRIBUTE || binding.resourceKey !== connectionId) {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
const id = binding.id;
|
|
282
|
+
if (typeof id === "string" && isReferenced(document, id)) {
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
dropped.push(String(binding.name ?? id ?? ""));
|
|
286
|
+
return false;
|
|
287
|
+
}) : nextBindings;
|
|
288
|
+
document.bindings = prunedBindings;
|
|
289
|
+
return {
|
|
290
|
+
document,
|
|
291
|
+
summary: {
|
|
292
|
+
taskId: options.taskId,
|
|
293
|
+
taskType,
|
|
294
|
+
serviceType: SERVICE_TYPE_BY_TASK[taskType],
|
|
295
|
+
contextEntries: splicedContext.length,
|
|
296
|
+
inputs: asArray(caseShape.inputs).length,
|
|
297
|
+
outputs: asArray(caseShape.outputs).length,
|
|
298
|
+
connectionBindingId,
|
|
299
|
+
...folderBindingId !== undefined && { folderBindingId },
|
|
300
|
+
bindingsReused: foundConnection !== undefined,
|
|
301
|
+
bindingsCompleted: completed,
|
|
302
|
+
bindingsDropped: dropped
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
var isSpliceFailure = (value) => ("message" in value);
|
|
307
|
+
export {
|
|
308
|
+
isSpliceFailure,
|
|
309
|
+
spliceConnectorShape
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
//# debugId=D42AF8729FBF876464756E2164756E21
|