@uipath/maestro-builder-sdk 6.117.3 → 6.117.4
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/case/decompile.d.ts +2 -1
- package/dist/case/decompile.js +7 -2
- package/dist/case/intsvc-activity-config.d.ts +33 -0
- package/dist/case/intsvc-activity-config.js +137 -0
- package/dist/case/preserve.d.ts +11 -2
- package/dist/case/preserve.js +10 -0
- package/dist/case/serialize.d.ts +1 -1
- package/dist/case/serialize.js +11 -43
- package/dist/core/refusals.d.ts +1 -0
- package/dist/core/refusals.js +1 -0
- package/package.json +2 -2
package/dist/case/decompile.d.ts
CHANGED
|
@@ -254,7 +254,7 @@ type Preservation = {
|
|
|
254
254
|
name: string;
|
|
255
255
|
trigger: string;
|
|
256
256
|
}>;
|
|
257
|
-
omitMetadata?: Array<'caseAppEnabled' | 'caseIdentifierType' | 'publishVersion'>;
|
|
257
|
+
omitMetadata?: Array<'caseAppEnabled' | 'caseIdentifierType' | 'publishVersion' | 'intsvcActivityConfig'>;
|
|
258
258
|
publishVersion?: number;
|
|
259
259
|
nodeFields?: Record<string, Record<string, unknown>>;
|
|
260
260
|
variableFields?: Partial<Record<'inputs' | 'outputs' | 'inputOutputs', Record<string, Record<string, unknown>>>>;
|
|
@@ -281,6 +281,7 @@ type Preservation = {
|
|
|
281
281
|
metadata: Record<string, unknown>;
|
|
282
282
|
}>;
|
|
283
283
|
connectorContexts?: PreservedConnectorContext[];
|
|
284
|
+
connectorConfigV2?: string[];
|
|
284
285
|
connectorRows?: PreservedConnectorRows[];
|
|
285
286
|
subscriptionFilters?: Array<{
|
|
286
287
|
owner: string;
|
package/dist/case/decompile.js
CHANGED
|
@@ -9,6 +9,7 @@ import { isScriptOwnOutput, liftScript } from './decompile-script.js';
|
|
|
9
9
|
import { isHttpRequestOwnOutput, liftHttpRequest } from './decompile-http-request.js';
|
|
10
10
|
import { savedHttpRequestMetadata } from './http-request.js';
|
|
11
11
|
import { caseConnectorOwners, savedConnectorContext } from './connector-saved-context.js';
|
|
12
|
+
import { elementConfigV2Owners } from './intsvc-activity-config.js';
|
|
12
13
|
import { caseConnectorRowOwners, savedConnectorRows } from './connector-saved-rows.js';
|
|
13
14
|
import { builtChainSource, chainStatements } from '../core/builder-chain.js';
|
|
14
15
|
import { literalSource } from './literal.js';
|
|
@@ -2656,10 +2657,11 @@ export function collectPreservation(plan) {
|
|
|
2656
2657
|
const metadata = Object.fromEntries(Object.entries(plan.metadata ?? {}).filter(([name]) => !metadataKnown.has(name)));
|
|
2657
2658
|
if (Object.keys(metadata).length)
|
|
2658
2659
|
preservation.metadata = metadata;
|
|
2659
|
-
// The serializer always writes these
|
|
2660
|
+
// The serializer always writes these four; a source that left one out keeps
|
|
2660
2661
|
// it out (see `omitMetadata` in preserve.ts). `publishVersion` is a platform
|
|
2661
2662
|
// stamp the builder does not author, so a different source value is carried.
|
|
2662
|
-
|
|
2663
|
+
// `intsvcActivityConfig` absent is a V1 plan, which must stay V1.
|
|
2664
|
+
const omitMetadata = ['caseAppEnabled', 'caseIdentifierType', 'publishVersion', 'intsvcActivityConfig']
|
|
2663
2665
|
.filter((name) => !Object.prototype.hasOwnProperty.call(plan.metadata ?? {}, name));
|
|
2664
2666
|
if (omitMetadata.length)
|
|
2665
2667
|
preservation.omitMetadata = [...omitMetadata];
|
|
@@ -2915,6 +2917,9 @@ export function collectPreservation(plan) {
|
|
|
2915
2917
|
.filter((entry) => entry !== undefined);
|
|
2916
2918
|
if (connectorContexts.length)
|
|
2917
2919
|
preservation.connectorContexts = connectorContexts;
|
|
2920
|
+
const connectorConfigV2 = elementConfigV2Owners(plan);
|
|
2921
|
+
if (connectorConfigV2.length)
|
|
2922
|
+
preservation.connectorConfigV2 = connectorConfigV2;
|
|
2918
2923
|
const connectorRows = caseConnectorRowOwners(plan)
|
|
2919
2924
|
.map(({ key, bag }) => savedConnectorRows(key, bag))
|
|
2920
2925
|
.filter((entry) => entry !== undefined);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CaseJsonPreservation } from './preserve.js';
|
|
2
|
+
/** The marker's name in `metadata`. */
|
|
3
|
+
export declare const INTSVC_ACTIVITY_CONFIG = "intsvcActivityConfig";
|
|
4
|
+
/** The warning {@link defaultIntsvcActivityConfig} gives. */
|
|
5
|
+
export interface IntsvcConfigWarning {
|
|
6
|
+
code: 'CONNECTOR_CONFIG_V2_DEFAULT';
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Write `metadata.intsvcActivityConfig: "v2"` when the source does not say
|
|
11
|
+
* otherwise (see the module comment). Runs after preservation, which carries a
|
|
12
|
+
* saved value or the saved absence.
|
|
13
|
+
*/
|
|
14
|
+
export declare function defaultIntsvcActivityConfig(result: Record<string, unknown>, preservation: CaseJsonPreservation | undefined, warn?: (warning: IntsvcConfigWarning) => void): void;
|
|
15
|
+
/**
|
|
16
|
+
* V2 plans: mark each connector task's and event trigger's context that is
|
|
17
|
+
* bound to a connection `activityConfigurationVersion: v2`, as the Designer and
|
|
18
|
+
* CLI do. A context that already carries the row keeps it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function stampConnectorConfigVersion(result: Record<string, unknown>): Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* The connector elements of a plan with no `"v2"` marker whose own context
|
|
23
|
+
* carries the V2 row, by {@link elementKey}: the Designer reads that row
|
|
24
|
+
* before the marker, so decompile records them (`connectorConfigV2`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function elementConfigV2Owners(plan: Record<string, any>): string[];
|
|
27
|
+
/**
|
|
28
|
+
* For a plan whose settled marker is not `"v2"` (see `applyPreservation`):
|
|
29
|
+
* each connector element keeps the V2 row only when the saved plan had it on
|
|
30
|
+
* that element (`keep`, the `connectorConfigV2` element keys). The others lose
|
|
31
|
+
* it, and a kept one that lacks it gets it back, last in its context.
|
|
32
|
+
*/
|
|
33
|
+
export declare function unstampConnectorConfigVersion(result: Record<string, unknown>, keep?: readonly string[]): void;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `metadata.intsvcActivityConfig`: which Integration Service activity
|
|
3
|
+
* configuration a case's connector elements use. The Case Designer and
|
|
4
|
+
* `uip maestro case init` write `"v2"` on a new case. With no marker, the CLI's
|
|
5
|
+
* BPMN rule (`isIntsvcActivityExecutionV1`) reads an absent version as V1, and
|
|
6
|
+
* the Designer still opens a connector element in its V2 panel when that
|
|
7
|
+
* element's own context says `activityConfigurationVersion: v2`. How the Case
|
|
8
|
+
* runtime reads a plan with no marker is not verified, so compile keeps a
|
|
9
|
+
* decompiled plan's marker, or its absence, as it was.
|
|
10
|
+
*
|
|
11
|
+
* Compile writes `"v2"` on a case whose source does not say otherwise:
|
|
12
|
+
* - a value `preserveCaseJson` carries (`metadata.intsvcActivityConfig`) stays;
|
|
13
|
+
* - a decompiled plan that had no marker records that
|
|
14
|
+
* (`omitMetadata: ['intsvcActivityConfig']`) and stays without one, so a V1
|
|
15
|
+
* plan stays V1;
|
|
16
|
+
* - else compile writes `"v2"`. When the source is a decompiled plan from an SDK
|
|
17
|
+
* that did not yet record the absence, and the plan has a connector element,
|
|
18
|
+
* compile cannot tell a V1 plan from a new one, so it warns
|
|
19
|
+
* (`CONNECTOR_CONFIG_V2_DEFAULT`).
|
|
20
|
+
*
|
|
21
|
+
* Then each connector element of a `"v2"` plan gets its
|
|
22
|
+
* `activityConfigurationVersion: v2` context row, as the Designer and CLI write.
|
|
23
|
+
*/
|
|
24
|
+
import { CASE_FORMAT_PROFILE } from './format-profile.js';
|
|
25
|
+
import { caseConnectorOwners } from './connector-saved-context.js';
|
|
26
|
+
/** The marker's name in `metadata`. */
|
|
27
|
+
export const INTSVC_ACTIVITY_CONFIG = 'intsvcActivityConfig';
|
|
28
|
+
/** The task types whose `data.context[]` carries an Integration Service activity configuration. */
|
|
29
|
+
const CONNECTOR_CONFIG_TASK_TYPES = new Set([
|
|
30
|
+
'execute-connector-activity',
|
|
31
|
+
'wait-for-connector',
|
|
32
|
+
'external-agent',
|
|
33
|
+
'external-workflow',
|
|
34
|
+
]);
|
|
35
|
+
const V2_CONFIG_ROW = { name: 'activityConfigurationVersion', value: 'v2', type: 'string' };
|
|
36
|
+
/**
|
|
37
|
+
* Each connector task's and event trigger's context that is bound to a
|
|
38
|
+
* connection. A placeholder bag (`connectorKey` + `operation`, or a trigger's
|
|
39
|
+
* lone `objectName`) has no configuration panel to pick, so it is left out.
|
|
40
|
+
*/
|
|
41
|
+
function boundConnectorContexts(result) {
|
|
42
|
+
const contexts = [];
|
|
43
|
+
const take = (context) => {
|
|
44
|
+
if (Array.isArray(context) && context.some((row) => row?.name === 'connection'))
|
|
45
|
+
contexts.push(context);
|
|
46
|
+
};
|
|
47
|
+
for (const node of result.nodes ?? []) {
|
|
48
|
+
if (node?.type === 'case-management:Trigger' || node?.type === 'uipath.case.trigger')
|
|
49
|
+
take(node.data?.[CASE_FORMAT_PROFILE.triggerBagField]?.context);
|
|
50
|
+
for (const lane of node?.data?.tasks ?? []) {
|
|
51
|
+
for (const task of Array.isArray(lane) ? lane : []) {
|
|
52
|
+
if (CONNECTOR_CONFIG_TASK_TYPES.has(task?.type))
|
|
53
|
+
take(task.data?.context);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return contexts;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Write `metadata.intsvcActivityConfig: "v2"` when the source does not say
|
|
61
|
+
* otherwise (see the module comment). Runs after preservation, which carries a
|
|
62
|
+
* saved value or the saved absence.
|
|
63
|
+
*/
|
|
64
|
+
export function defaultIntsvcActivityConfig(result, preservation, warn) {
|
|
65
|
+
const metadata = result.metadata;
|
|
66
|
+
if (!metadata || Object.prototype.hasOwnProperty.call(metadata, INTSVC_ACTIVITY_CONFIG))
|
|
67
|
+
return;
|
|
68
|
+
if (preservation?.omitMetadata?.includes(INTSVC_ACTIVITY_CONFIG))
|
|
69
|
+
return;
|
|
70
|
+
metadata[INTSVC_ACTIVITY_CONFIG] = 'v2';
|
|
71
|
+
if (preservation && boundConnectorContexts(result).length) {
|
|
72
|
+
warn?.({
|
|
73
|
+
code: 'CONNECTOR_CONFIG_V2_DEFAULT',
|
|
74
|
+
message: 'compile wrote metadata.intsvcActivityConfig "v2", the Integration Service configuration the Case Designer writes on a new case. '
|
|
75
|
+
+ 'This source has a preserveCaseJson(...) payload, as a decompiled plan does, but the payload does not say whether the plan had the marker, and the plan has connector elements. '
|
|
76
|
+
+ 'If the plan had no marker, add "intsvcActivityConfig" to omitMetadata in the payload to keep it that way, or decompile the plan again with this SDK, which records it. '
|
|
77
|
+
+ 'If the case is meant to be V2, add metadata: { intsvcActivityConfig: "v2" } to the payload, and this warning stops.',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* V2 plans: mark each connector task's and event trigger's context that is
|
|
83
|
+
* bound to a connection `activityConfigurationVersion: v2`, as the Designer and
|
|
84
|
+
* CLI do. A context that already carries the row keeps it.
|
|
85
|
+
*/
|
|
86
|
+
export function stampConnectorConfigVersion(result) {
|
|
87
|
+
const metadata = result.metadata;
|
|
88
|
+
if (metadata?.[INTSVC_ACTIVITY_CONFIG] !== 'v2')
|
|
89
|
+
return result;
|
|
90
|
+
for (const context of boundConnectorContexts(result))
|
|
91
|
+
if (!context.some((row) => row?.name === V2_CONFIG_ROW.name))
|
|
92
|
+
context.push({ ...V2_CONFIG_ROW });
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
/** Whether `context` holds the `activityConfigurationVersion: v2` row. */
|
|
96
|
+
const hasV2Row = (context) => Array.isArray(context) && context.some((row) => row?.name === V2_CONFIG_ROW.name && row?.value === V2_CONFIG_ROW.value);
|
|
97
|
+
/**
|
|
98
|
+
* An element's key without its stage: `task:<task id>`, `rule:<rule id>` or
|
|
99
|
+
* `trigger:<node id>`. A task moved to another stage keeps its id, so this key
|
|
100
|
+
* finds it where the owner key (`task:<stage id>:<task id>`) does not.
|
|
101
|
+
*/
|
|
102
|
+
function elementKey(owner) {
|
|
103
|
+
const parts = owner.split(':');
|
|
104
|
+
return `${parts[0]}:${parts[parts.length - 1]}`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The connector elements of a plan with no `"v2"` marker whose own context
|
|
108
|
+
* carries the V2 row, by {@link elementKey}: the Designer reads that row
|
|
109
|
+
* before the marker, so decompile records them (`connectorConfigV2`).
|
|
110
|
+
*/
|
|
111
|
+
export function elementConfigV2Owners(plan) {
|
|
112
|
+
if (plan?.metadata?.[INTSVC_ACTIVITY_CONFIG] === 'v2')
|
|
113
|
+
return [];
|
|
114
|
+
return caseConnectorOwners(plan).filter(({ bag }) => hasV2Row(bag?.context)).map(({ key }) => elementKey(key));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* For a plan whose settled marker is not `"v2"` (see `applyPreservation`):
|
|
118
|
+
* each connector element keeps the V2 row only when the saved plan had it on
|
|
119
|
+
* that element (`keep`, the `connectorConfigV2` element keys). The others lose
|
|
120
|
+
* it, and a kept one that lacks it gets it back, last in its context.
|
|
121
|
+
*/
|
|
122
|
+
export function unstampConnectorConfigVersion(result, keep = []) {
|
|
123
|
+
const kept = new Set(keep);
|
|
124
|
+
for (const { key, bag } of caseConnectorOwners(result)) {
|
|
125
|
+
const context = bag?.context;
|
|
126
|
+
if (!Array.isArray(context))
|
|
127
|
+
continue;
|
|
128
|
+
if (kept.has(elementKey(key))) {
|
|
129
|
+
if (!hasV2Row(context))
|
|
130
|
+
context.push({ ...V2_CONFIG_ROW });
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const at = context.findIndex((row) => row?.name === V2_CONFIG_ROW.name && row?.value === V2_CONFIG_ROW.value);
|
|
134
|
+
if (at >= 0)
|
|
135
|
+
context.splice(at, 1);
|
|
136
|
+
}
|
|
137
|
+
}
|
package/dist/case/preserve.d.ts
CHANGED
|
@@ -385,7 +385,8 @@ export interface CaseJsonPreservation {
|
|
|
385
385
|
omitInputDefaults?: string[];
|
|
386
386
|
/**
|
|
387
387
|
* Metadata keys the serializer always writes that the source document did not
|
|
388
|
-
* carry (only `caseAppEnabled`, `caseIdentifierType`, `publishVersion
|
|
388
|
+
* carry (only `caseAppEnabled`, `caseIdentifierType`, `publishVersion`,
|
|
389
|
+
* `intsvcActivityConfig`).
|
|
389
390
|
* Compile drops such a key while it still holds what the platform reads for
|
|
390
391
|
* an absent one: the Case Designer's in-memory to canvas converter fills
|
|
391
392
|
* `caseAppEnabled ?? true` and `caseIdentifierType ?? "constant"`, and
|
|
@@ -437,6 +438,14 @@ export interface CaseJsonPreservation {
|
|
|
437
438
|
* (`case/connector-saved-context.ts`).
|
|
438
439
|
*/
|
|
439
440
|
connectorContexts?: PreservedConnectorContext[];
|
|
441
|
+
/**
|
|
442
|
+
* The connector elements (`task:<task id>`, `rule:<rule id>` or
|
|
443
|
+
* `trigger:<node id>`, with no stage, so a task moved to another stage still
|
|
444
|
+
* matches) whose own context said `activityConfigurationVersion: v2` in a plan with no
|
|
445
|
+
* `intsvcActivityConfig: "v2"` marker. The Designer reads that row before the
|
|
446
|
+
* marker, so compile writes it back on them (`case/intsvc-activity-config.ts`).
|
|
447
|
+
*/
|
|
448
|
+
connectorConfigV2?: string[];
|
|
440
449
|
/**
|
|
441
450
|
* Each Designer-saved connector element's own io rows (an event trigger, a
|
|
442
451
|
* wait-for-connector task or rule, a connector activity task): its request
|
|
@@ -645,7 +654,7 @@ export declare function caseJsonPreservation(built: BuiltCase): CaseJsonPreserva
|
|
|
645
654
|
export declare function preservedBindings(bindings: Bindings | undefined, payload: CaseJsonPreservation | undefined): Bindings | undefined;
|
|
646
655
|
export declare function preservedBindings(bindings: BindingsView | undefined, payload: CaseJsonPreservation | undefined): BindingsView | undefined;
|
|
647
656
|
/** A metadata key whose absence {@link CaseJsonPreservation.omitMetadata} records. */
|
|
648
|
-
export type PreservedMetadataKey = 'caseAppEnabled' | 'caseIdentifierType' | 'publishVersion';
|
|
657
|
+
export type PreservedMetadataKey = 'caseAppEnabled' | 'caseIdentifierType' | 'publishVersion' | 'intsvcActivityConfig';
|
|
649
658
|
/**
|
|
650
659
|
* @internal
|
|
651
660
|
* What the platform reads for each {@link PreservedMetadataKey} the document
|
package/dist/case/preserve.js
CHANGED
|
@@ -184,6 +184,10 @@ export const METADATA_ABSENT_READING = {
|
|
|
184
184
|
caseAppEnabled: true,
|
|
185
185
|
caseIdentifierType: 'constant',
|
|
186
186
|
publishVersion: undefined,
|
|
187
|
+
// Absent reads as the older V1 Integration Service configuration, and compile
|
|
188
|
+
// writes "v2" on a new case (intsvc-activity-config.ts): a plan saved with
|
|
189
|
+
// none keeps none.
|
|
190
|
+
intsvcActivityConfig: undefined,
|
|
187
191
|
};
|
|
188
192
|
const TOP_LEVEL_KEYS = new Set([
|
|
189
193
|
'id', 'name', 'description', 'version', 'bindings', 'variables', 'metadata', 'nodes', 'edges', 'layout',
|
|
@@ -272,6 +276,9 @@ export function caseJsonPreservationErrors(payload) {
|
|
|
272
276
|
errors.push('preserved publishVersion must be a number');
|
|
273
277
|
if (payload.publishVersion !== undefined && payload.omitMetadata?.includes('publishVersion'))
|
|
274
278
|
errors.push('preserved publishVersion cannot also be recorded as omitted');
|
|
279
|
+
if (payload.metadata !== undefined && Object.prototype.hasOwnProperty.call(payload.metadata, 'intsvcActivityConfig')
|
|
280
|
+
&& payload.omitMetadata?.includes('intsvcActivityConfig'))
|
|
281
|
+
errors.push('preserved metadata.intsvcActivityConfig cannot also be recorded as omitted: keep the value, or the omitMetadata entry, not both');
|
|
275
282
|
for (const name of Object.keys(payload.caseAppConfigFields?.fields ?? {}))
|
|
276
283
|
if (!PRESERVED_CASE_APP_CONFIG_KEYS.has(name))
|
|
277
284
|
errors.push(`caseAppConfig field "${name}" is not an allowed preserved platform field`);
|
|
@@ -474,6 +481,9 @@ export function caseJsonPreservationErrors(payload) {
|
|
|
474
481
|
errors.push(`preserved http-request metadata of task "${entry?.task}" must be an object`);
|
|
475
482
|
}
|
|
476
483
|
errors.push(...connectorContextErrors(payload.connectorContexts));
|
|
484
|
+
if (payload.connectorConfigV2 !== undefined
|
|
485
|
+
&& (!Array.isArray(payload.connectorConfigV2) || payload.connectorConfigV2.some((key) => typeof key !== 'string' || !key)))
|
|
486
|
+
errors.push('preserved connectorConfigV2 must be a list of connector element keys (task:<id>, rule:<id> or trigger:<id>)');
|
|
477
487
|
errors.push(...connectorRowErrors(payload.connectorRows));
|
|
478
488
|
for (const index of payload.manualTriggerServiceTypeNone ?? [])
|
|
479
489
|
if (!Number.isInteger(index) || index < 0)
|
package/dist/case/serialize.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export interface CaseSerializeOpts {
|
|
|
62
62
|
}
|
|
63
63
|
/** A warning `serialize` reports through {@link CaseSerializeOpts.warn}. */
|
|
64
64
|
export interface CaseSerializeWarning {
|
|
65
|
-
code: 'CONNECTION_STUB' | 'SLA_PIN_DROPPED';
|
|
65
|
+
code: 'CONNECTION_STUB' | 'SLA_PIN_DROPPED' | 'CONNECTOR_CONFIG_V2_DEFAULT';
|
|
66
66
|
message: string;
|
|
67
67
|
}
|
|
68
68
|
/**
|
package/dist/case/serialize.js
CHANGED
|
@@ -26,6 +26,7 @@ import { CASE_FILTER_SPELLING, caseSubscriptionBody, caseSubscriptionOwners, res
|
|
|
26
26
|
import { dedupeConditionNames } from './rule-names.js';
|
|
27
27
|
import { EXTERNAL_TASK_DESCRIPTOR_CONTRACT, externalDescriptorRefusal, externalExecution, externalServiceType, } from './external.js';
|
|
28
28
|
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS, caseVersionMismatch } from './format-profile.js';
|
|
29
|
+
import { defaultIntsvcActivityConfig, INTSVC_ACTIVITY_CONFIG, stampConnectorConfigVersion, unstampConnectorConfigVersion } from './intsvc-activity-config.js';
|
|
29
30
|
import { isInSolutionKey, isResourceLabelRefusal, resolveResourceRef, resourceIdentity, SOLUTION_FOLDER } from './resource-identity.js';
|
|
30
31
|
import { bindingRefId, readBindingIds, resourceBindingOf, resourceBindingRow, resourceBindingSeed, savedResourceWire, typedFolder, } from './resource-wire.js';
|
|
31
32
|
import { ownEntry } from '../core/own-entry.js';
|
|
@@ -430,7 +431,11 @@ function serializeCase(built, opts) {
|
|
|
430
431
|
};
|
|
431
432
|
ELEMENT_SEEDED_IDS.set(result, resolver.elementSeededIds);
|
|
432
433
|
WRITTEN_SUBSCRIPTIONS.set(result, resolver.subscriptions);
|
|
433
|
-
const
|
|
434
|
+
const preservation = caseJsonPreservation(built);
|
|
435
|
+
const plan = applyAuthorLayout(applyPreservation(result, preservation, opts.warn ? { warn: opts.warn } : {}), built.layout);
|
|
436
|
+
// After preservation, which carries a saved marker or its saved absence.
|
|
437
|
+
defaultIntsvcActivityConfig(plan, preservation, opts.warn);
|
|
438
|
+
stampConnectorConfigVersion(plan);
|
|
434
439
|
// Last, over the finished document: V32 requires case-unique condition names,
|
|
435
440
|
// and an author (or a decompiled pre-V32 plan) can repeat one. Rename the
|
|
436
441
|
// repeats the way the platform's V31/V32.0.1 migrations would, so the file is
|
|
@@ -476,48 +481,6 @@ function lowerPlanTaskOutputRefs(plan) {
|
|
|
476
481
|
};
|
|
477
482
|
walk(plan);
|
|
478
483
|
}
|
|
479
|
-
/** The task types whose `data.context[]` carries an Integration Service activity configuration. */
|
|
480
|
-
const CONNECTOR_CONFIG_TASK_TYPES = new Set([
|
|
481
|
-
'execute-connector-activity',
|
|
482
|
-
'wait-for-connector',
|
|
483
|
-
'external-agent',
|
|
484
|
-
'external-workflow',
|
|
485
|
-
]);
|
|
486
|
-
const V2_CONFIG_ROW = { name: 'activityConfigurationVersion', value: 'v2', type: 'string' };
|
|
487
|
-
/**
|
|
488
|
-
* Flagged-V2 plans: mark each connector task's and event trigger's context
|
|
489
|
-
* `activityConfigurationVersion: v2`, as the Designer and CLI do. Runs
|
|
490
|
-
* post-preservation because the flag is preserved metadata.
|
|
491
|
-
*
|
|
492
|
-
* Only a context bound to a connection is marked. A placeholder bag
|
|
493
|
-
* (`connectorKey` + `operation`, or a trigger's lone `objectName`) has no
|
|
494
|
-
* configuration panel to pick. A context that already carries the row keeps it.
|
|
495
|
-
*/
|
|
496
|
-
function stampConnectorConfigVersion(result) {
|
|
497
|
-
const metadata = result.metadata;
|
|
498
|
-
if (metadata?.intsvcActivityConfig !== 'v2')
|
|
499
|
-
return result;
|
|
500
|
-
const stamp = (context) => {
|
|
501
|
-
if (!Array.isArray(context))
|
|
502
|
-
return;
|
|
503
|
-
if (!context.some((row) => row?.name === 'connection'))
|
|
504
|
-
return;
|
|
505
|
-
if (context.some((row) => row?.name === V2_CONFIG_ROW.name))
|
|
506
|
-
return;
|
|
507
|
-
context.push({ ...V2_CONFIG_ROW });
|
|
508
|
-
};
|
|
509
|
-
for (const node of result.nodes ?? []) {
|
|
510
|
-
if (node?.type === 'case-management:Trigger' || node?.type === 'uipath.case.trigger')
|
|
511
|
-
stamp(node.data?.[CASE_FORMAT_PROFILE.triggerBagField]?.context);
|
|
512
|
-
for (const lane of node?.data?.tasks ?? []) {
|
|
513
|
-
for (const task of Array.isArray(lane) ? lane : []) {
|
|
514
|
-
if (CONNECTOR_CONFIG_TASK_TYPES.has(task?.type))
|
|
515
|
-
stamp(task.data?.context);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return result;
|
|
520
|
-
}
|
|
521
484
|
export { CASE_NODE_LAYOUT_FIELDS };
|
|
522
485
|
/**
|
|
523
486
|
* Resolve author-level layout names only after preservation has restored foreign
|
|
@@ -602,6 +565,11 @@ export function applyPreservation(result, preservation, options = {}) {
|
|
|
602
565
|
if (absent === undefined || metadata[name] === absent)
|
|
603
566
|
delete metadata[name];
|
|
604
567
|
}
|
|
568
|
+
// The V2 context rows follow the settled marker. `mergeCase` lays this over
|
|
569
|
+
// a plan compile already stamped, so when the original has no marker the rows
|
|
570
|
+
// go too, except on the elements that carried their own (`connectorConfigV2`).
|
|
571
|
+
if (metadata[INTSVC_ACTIVITY_CONFIG] !== 'v2')
|
|
572
|
+
unstampConnectorConfigVersion(result, preservation.connectorConfigV2);
|
|
605
573
|
const caseAppConfig = result.metadata.caseAppConfig;
|
|
606
574
|
if (caseAppConfig && preservation.caseAppConfigFields) {
|
|
607
575
|
for (const [field, value] of Object.entries(preservation.caseAppConfigFields.fields ?? {})) {
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -226,6 +226,7 @@ export declare const REFUSALS: {
|
|
|
226
226
|
readonly CONNECTION_BINDING_NOT_GUID: "lint";
|
|
227
227
|
readonly CONNECTION_CONNECTOR_CONFLICT: "draft";
|
|
228
228
|
readonly CONNECTION_STUB: "lint";
|
|
229
|
+
readonly CONNECTOR_CONFIG_V2_DEFAULT: "lint";
|
|
229
230
|
readonly CONNECTOR_IMPORT_NOT_A_FILE: "lowering";
|
|
230
231
|
readonly CONNECTOR_INPUT: "lowering";
|
|
231
232
|
readonly CONNECTOR_INPUTS_SHADOWED: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -300,6 +300,7 @@ export const REFUSALS = {
|
|
|
300
300
|
CONNECTION_BINDING_NOT_GUID: 'lint',
|
|
301
301
|
CONNECTION_CONNECTOR_CONFLICT: 'draft',
|
|
302
302
|
CONNECTION_STUB: 'lint',
|
|
303
|
+
CONNECTOR_CONFIG_V2_DEFAULT: 'lint',
|
|
303
304
|
CONNECTOR_IMPORT_NOT_A_FILE: 'lowering',
|
|
304
305
|
CONNECTOR_INPUT: 'lowering',
|
|
305
306
|
CONNECTOR_INPUTS_SHADOWED: 'lowering',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.117.
|
|
3
|
+
"version": "6.117.4",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"@types/node": "^22.7.0",
|
|
125
125
|
"esbuild": "^0.28.1"
|
|
126
126
|
},
|
|
127
|
-
"gitref": "
|
|
127
|
+
"gitref": "1ad604ec9dcc3d513d4a32560f4fb268ba42bb09"
|
|
128
128
|
}
|