@uipath/maestro-builder-sdk 6.86.24 → 6.86.26
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 +5 -0
- package/dist/api-index.md +1 -1
- package/dist/api-members.md +1 -1
- package/dist/check.js +3 -3
- package/dist/core/event-filters.d.ts +1 -0
- package/dist/core-definitions.json +57 -21
- package/dist/flow-sdk.d.ts +3 -3
- package/dist/registry/prepare/actions.d.ts +14 -1
- package/dist/registry/prepare/actions.js +26 -2
- package/dist/registry/prepare/catalog-absence.d.ts +50 -0
- package/dist/registry/prepare/catalog-absence.js +135 -0
- package/dist/registry/prepare/inherited-profile.js +3 -4
- package/dist/registry/prepare/messages.d.ts +9 -0
- package/dist/registry/prepare/messages.js +20 -0
- package/dist/registry/prepare/pipeline.d.ts +7 -0
- package/dist/registry/prepare/pipeline.js +61 -17
- package/dist/registry/prepare-cli.js +11 -2
- package/dist/registry/uip/login-status.d.ts +8 -0
- package/dist/registry/uip/login-status.js +17 -0
- package/dist/serialize.js +3 -2
- package/package.json +16 -9
package/README.md
CHANGED
|
@@ -159,6 +159,11 @@ The same builder core, the same four verbs. Import from
|
|
|
159
159
|
generated indexes as Flow's — `api-index.md` by symbol name, `api-members.md` by
|
|
160
160
|
field or method name — which cover all three entry points.
|
|
161
161
|
|
|
162
|
+
The package is ESM.
|
|
163
|
+
Every entry also answers CommonJS resolution, so `require.resolve` of a subpath such as `@uipath/maestro-builder-sdk/bpmn` finds the file on disk, and on Node 22.12 or later `require()` loads it too.
|
|
164
|
+
The one exception is `@uipath/maestro-builder-sdk/cli`, which uses top-level `await`: it resolves, but only `import` loads it.
|
|
165
|
+
Bundling the SDK into CommonJS is not supported: its ESM reads `import.meta.url`, which a CommonJS bundle leaves undefined.
|
|
166
|
+
|
|
162
167
|
## Commands
|
|
163
168
|
|
|
164
169
|
The UiPath CLI is the authoring front door. Beyond the two verbs the quick start
|
package/dist/api-index.md
CHANGED
|
@@ -353,7 +353,7 @@ could hand you spans for a version you do not have.
|
|
|
353
353
|
| `EscalationRecipient` | interface | `dist/case/case-sdk.d.ts:186-193` | Supporting types | Who an escalation notifies. |
|
|
354
354
|
| `EscalationTrigger` | type | `dist/case/case-sdk.d.ts:184-185` | Supporting types | When an escalation fires: as the deadline approaches (`at-risk`) or once it passes (`sla-breached`). |
|
|
355
355
|
| `EventFilter` | type | `dist/core/actions.d.ts:927-978` | Supporting types | One filter condition on the event payload. |
|
|
356
|
-
| `EventFilterExpression` | interface | `dist/core/event-filters.d.ts:131-
|
|
356
|
+
| `EventFilterExpression` | interface | `dist/core/event-filters.d.ts:131-146` | Supporting types | A filter value computed at runtime: the field is compared against a Case expression, `=vars.<path>` or… |
|
|
357
357
|
| `EventSubscription` | interface | `dist/core/actions.d.ts:1052-1093` | Option shapes | What a connector event subscribes to. |
|
|
358
358
|
| `eventTrigger` | function | `dist/case/case-sdk.d.ts:379-389` | Case authoring | An Integration Service **event** trigger — an external event (a new row, an email, a webhook) starts the case. |
|
|
359
359
|
| `eventTrigger` | function | `dist/case/case-sdk.d.ts:390-396` | Case authoring | An Integration Service event trigger in placeholder or stringly-resolved form. |
|
package/dist/api-members.md
CHANGED
|
@@ -392,7 +392,7 @@ not find it either.
|
|
|
392
392
|
| `exponentialBase` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:852-853` |
|
|
393
393
|
| `exposeError` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:379-385` |
|
|
394
394
|
| `expression` | property | `BuiltSla` | `dist/case/case-sdk.d.ts:276-277` |
|
|
395
|
-
| `expression` | property | `EventFilterExpression` | `dist/core/event-filters.d.ts:144` |
|
|
395
|
+
| `expression` | property | `EventFilterExpression` | `dist/core/event-filters.d.ts:144-145` |
|
|
396
396
|
| `expression` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:93-94` |
|
|
397
397
|
| `expression` | property | `WhenExpression` | `dist/case/case-sdk.d.ts:168-169` |
|
|
398
398
|
| `external` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:948-949` |
|
package/dist/check.js
CHANGED
|
@@ -715,9 +715,9 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
715
715
|
walk(s.body, true);
|
|
716
716
|
}
|
|
717
717
|
else if (s.kind === 'doWhile') {
|
|
718
|
-
// Recorded
|
|
719
|
-
//
|
|
720
|
-
//
|
|
718
|
+
// Recorded as the port source so an `.onError` after it attaches to the
|
|
719
|
+
// container's error port (`core.logic.dowhile@1.0` sets
|
|
720
|
+
// supportsErrorHandling and declares the `error` handle, #1010).
|
|
721
721
|
prevPortSource = s;
|
|
722
722
|
addExpr(s.condition.js, s.name);
|
|
723
723
|
loopNames.set(s.name, LOOP_FIELDS_1_0_0);
|
|
@@ -141,6 +141,7 @@ export interface ReadEventFilter {
|
|
|
141
141
|
* const filter = { field: 'Id', equals: { expression: '=vars.request.Id' } };
|
|
142
142
|
*/
|
|
143
143
|
export interface EventFilterExpression {
|
|
144
|
+
/** The Case expression the field is compared against: `=vars.<path>` or `=js:<expression>`. */
|
|
144
145
|
expression: string;
|
|
145
146
|
}
|
|
146
147
|
/** The operators an expression-valued filter takes: the ones that compare a string. */
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"handleType": "output",
|
|
27
27
|
"showButton": true,
|
|
28
28
|
"constraints": {
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"forbiddenTargetCategories": [
|
|
30
|
+
"trigger"
|
|
31
|
+
]
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
],
|
|
@@ -3537,8 +3537,14 @@
|
|
|
3537
3537
|
"componentProps": {
|
|
3538
3538
|
"minCases": 1,
|
|
3539
3539
|
"maxCases": 10,
|
|
3540
|
-
"
|
|
3541
|
-
"
|
|
3540
|
+
"expressionPlaceholder": "e.g., $vars.value <= 30",
|
|
3541
|
+
"expressionValidationFields": [
|
|
3542
|
+
{
|
|
3543
|
+
"subPath": "expression",
|
|
3544
|
+
"validationMode": "expression",
|
|
3545
|
+
"expectedType": "boolean"
|
|
3546
|
+
}
|
|
3547
|
+
]
|
|
3542
3548
|
}
|
|
3543
3549
|
},
|
|
3544
3550
|
{
|
|
@@ -3551,6 +3557,9 @@
|
|
|
3551
3557
|
]
|
|
3552
3558
|
}
|
|
3553
3559
|
]
|
|
3560
|
+
},
|
|
3561
|
+
"debug": {
|
|
3562
|
+
"runtime": "clientScript"
|
|
3554
3563
|
}
|
|
3555
3564
|
},
|
|
3556
3565
|
"core.logic.decision@1.0.0": {
|
|
@@ -3648,6 +3657,7 @@
|
|
|
3648
3657
|
"componentProps": {
|
|
3649
3658
|
"language": "javascript",
|
|
3650
3659
|
"returnType": "boolean",
|
|
3660
|
+
"validationMode": "expression",
|
|
3651
3661
|
"minHeight": 100,
|
|
3652
3662
|
"placeholder": "e.g., $vars.data.status === \"approved\" && $vars.data.amount > 1000"
|
|
3653
3663
|
},
|
|
@@ -3669,6 +3679,9 @@
|
|
|
3669
3679
|
]
|
|
3670
3680
|
}
|
|
3671
3681
|
]
|
|
3682
|
+
},
|
|
3683
|
+
"debug": {
|
|
3684
|
+
"runtime": "clientScript"
|
|
3672
3685
|
}
|
|
3673
3686
|
},
|
|
3674
3687
|
"core.subflow@1.0.0": {
|
|
@@ -3851,7 +3864,7 @@
|
|
|
3851
3864
|
}
|
|
3852
3865
|
],
|
|
3853
3866
|
"debug": {
|
|
3854
|
-
"runtime": "
|
|
3867
|
+
"runtime": "clientScript"
|
|
3855
3868
|
},
|
|
3856
3869
|
"model": {
|
|
3857
3870
|
"type": "bpmn:ScriptTask"
|
|
@@ -3882,8 +3895,8 @@
|
|
|
3882
3895
|
},
|
|
3883
3896
|
"error": {
|
|
3884
3897
|
"type": "object",
|
|
3885
|
-
"description": "Error information if the
|
|
3886
|
-
"source": "=
|
|
3898
|
+
"description": "Error information if the node fails",
|
|
3899
|
+
"source": "=Error",
|
|
3887
3900
|
"var": "error",
|
|
3888
3901
|
"schema": {
|
|
3889
3902
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -3938,6 +3951,7 @@
|
|
|
3938
3951
|
"componentProps": {
|
|
3939
3952
|
"language": "javascript",
|
|
3940
3953
|
"returnType": "any",
|
|
3954
|
+
"validationMode": "script",
|
|
3941
3955
|
"minHeight": 200,
|
|
3942
3956
|
"placeholder": " // Return an object with your result\nreturn {\n message: \"Web request response\",\n data: $vars.httpRequest1.output\n };"
|
|
3943
3957
|
},
|
|
@@ -4031,6 +4045,9 @@
|
|
|
4031
4045
|
},
|
|
4032
4046
|
"parallel": {
|
|
4033
4047
|
"type": "boolean"
|
|
4048
|
+
},
|
|
4049
|
+
"completionCondition": {
|
|
4050
|
+
"type": "string"
|
|
4034
4051
|
}
|
|
4035
4052
|
},
|
|
4036
4053
|
"required": [
|
|
@@ -4039,7 +4056,8 @@
|
|
|
4039
4056
|
},
|
|
4040
4057
|
"inputDefaults": {
|
|
4041
4058
|
"collection": "",
|
|
4042
|
-
"parallel": false
|
|
4059
|
+
"parallel": false,
|
|
4060
|
+
"completionCondition": ""
|
|
4043
4061
|
},
|
|
4044
4062
|
"outputDefinition": {
|
|
4045
4063
|
"currentItem": {
|
|
@@ -4139,6 +4157,23 @@
|
|
|
4139
4157
|
"type": "switch",
|
|
4140
4158
|
"label": "Parallel",
|
|
4141
4159
|
"description": "Execute all iterations at the same time."
|
|
4160
|
+
},
|
|
4161
|
+
{
|
|
4162
|
+
"name": "inputs.completionCondition",
|
|
4163
|
+
"type": "custom",
|
|
4164
|
+
"component": "code-editor",
|
|
4165
|
+
"label": "Break on condition",
|
|
4166
|
+
"description": "Exit the loop early when this condition becomes true after an iteration completes.",
|
|
4167
|
+
"componentProps": {
|
|
4168
|
+
"singleLine": true,
|
|
4169
|
+
"mode": "expression",
|
|
4170
|
+
"toggleable": false,
|
|
4171
|
+
"placeholder": "e.g., $vars.processedCount >= 5",
|
|
4172
|
+
"showVariableButton": true,
|
|
4173
|
+
"alwaysIncludeSelf": true,
|
|
4174
|
+
"returnType": "boolean",
|
|
4175
|
+
"language": "javascript"
|
|
4176
|
+
}
|
|
4142
4177
|
}
|
|
4143
4178
|
]
|
|
4144
4179
|
}
|
|
@@ -4410,7 +4445,7 @@
|
|
|
4410
4445
|
"name": "inputs.timerDate",
|
|
4411
4446
|
"type": "datetime",
|
|
4412
4447
|
"label": "Value",
|
|
4413
|
-
"description": "The date and time when the
|
|
4448
|
+
"description": "The date and time when the workflow should continue",
|
|
4414
4449
|
"rules": [
|
|
4415
4450
|
{
|
|
4416
4451
|
"id": "date-format",
|
|
@@ -5715,6 +5750,16 @@
|
|
|
5715
5750
|
"id": "success",
|
|
5716
5751
|
"type": "source",
|
|
5717
5752
|
"handleType": "output"
|
|
5753
|
+
},
|
|
5754
|
+
{
|
|
5755
|
+
"id": "error",
|
|
5756
|
+
"label": "Error",
|
|
5757
|
+
"type": "source",
|
|
5758
|
+
"handleType": "output",
|
|
5759
|
+
"visible": "{inputs.errorHandlingEnabled}",
|
|
5760
|
+
"constraints": {
|
|
5761
|
+
"maxConnections": 1
|
|
5762
|
+
}
|
|
5718
5763
|
}
|
|
5719
5764
|
]
|
|
5720
5765
|
},
|
|
@@ -13955,11 +14000,6 @@
|
|
|
13955
14000
|
],
|
|
13956
14001
|
"model": {
|
|
13957
14002
|
"type": "bpmn:EndEvent"
|
|
13958
|
-
},
|
|
13959
|
-
"runtimeConstraints": {
|
|
13960
|
-
"exclude": [
|
|
13961
|
-
"api-function"
|
|
13962
|
-
]
|
|
13963
14003
|
}
|
|
13964
14004
|
},
|
|
13965
14005
|
"uipath.human-in-the-loop.quick-form@1.1": {
|
|
@@ -15367,12 +15407,7 @@
|
|
|
15367
15407
|
}
|
|
15368
15408
|
}
|
|
15369
15409
|
},
|
|
15370
|
-
"drillable": true
|
|
15371
|
-
"runtimeConstraints": {
|
|
15372
|
-
"exclude": [
|
|
15373
|
-
"api-function"
|
|
15374
|
-
]
|
|
15375
|
-
}
|
|
15410
|
+
"drillable": true
|
|
15376
15411
|
},
|
|
15377
15412
|
"core.logic.terminate@1.0": {
|
|
15378
15413
|
"nodeType": "core.logic.terminate",
|
|
@@ -15551,6 +15586,7 @@
|
|
|
15551
15586
|
"returnType": "any",
|
|
15552
15587
|
"validationMode": "script",
|
|
15553
15588
|
"minHeight": 200,
|
|
15589
|
+
"fillPanel": true,
|
|
15554
15590
|
"placeholder": " // Return any value\nreturn {\n message: \"Web request response\",\n data: $vars.httpRequest1.output\n};"
|
|
15555
15591
|
},
|
|
15556
15592
|
"label": "Code",
|
package/dist/flow-sdk.d.ts
CHANGED
|
@@ -411,9 +411,9 @@ export interface ReturnOptions extends NodeOptions {
|
|
|
411
411
|
* Loop-specific options. Every `.loop()` emits the loop's v2.4 definition (the
|
|
412
412
|
* version the registry serves: inner `start`/`continue`/`break` handles, and a
|
|
413
413
|
* 1-based `currentIteration` output). The legacy 1.0.0 shape is emitted only for
|
|
414
|
-
* an explicit `{ version: '1.0.0' }`. That definition declares `parallel`
|
|
415
|
-
* `completionCondition`, no `breakEnabled` and no `break` handle, so
|
|
416
|
-
*
|
|
414
|
+
* an explicit `{ version: '1.0.0' }`. That definition declares `parallel` and
|
|
415
|
+
* `completionCondition`, but no `breakEnabled` and no `break` handle, so
|
|
416
|
+
* `breakEnabled`, or a `b.break()` in the body, fails `check` and compilation
|
|
417
417
|
* (`LOOP_VERSION_UNSUPPORTED`). `parallel: true` on 1.0.0 compiles, to round-trip
|
|
418
418
|
* a canvas loop, but `check` warns (`LOOP_PARALLEL_LEGACY`): that version is not
|
|
419
419
|
* confirmed to run iterations in parallel. `b.continue()` works on both versions.
|
|
@@ -56,13 +56,26 @@ export interface RegistryCatalog {
|
|
|
56
56
|
*/
|
|
57
57
|
failure?: string;
|
|
58
58
|
}
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Whether the search ANSWERED and listed no action and no event: the catalog
|
|
61
|
+
* copy serves no node for the connector. A failed search is not this.
|
|
62
|
+
*/
|
|
63
|
+
export declare function catalogServesNothing(catalog: RegistryCatalog): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether `registry pull --force` refreshed the local catalog copy, or why not.
|
|
66
|
+
* `partial` is set when the pull exited 0 but did not write a whole catalog
|
|
67
|
+
* (`CacheWritten` not true, or `MissingSources` listed): its answers are used,
|
|
68
|
+
* but an absence read from them must not be remembered.
|
|
69
|
+
*/
|
|
60
70
|
export type RegistryRefresh = {
|
|
61
71
|
ok: true;
|
|
72
|
+
partial?: string;
|
|
62
73
|
} | {
|
|
63
74
|
ok: false;
|
|
64
75
|
reason: string;
|
|
65
76
|
};
|
|
77
|
+
/** Why a successful pull's reply does not show a whole catalog written, or `undefined` when it does. */
|
|
78
|
+
export declare function partialPullReason(stdout: string): string | undefined;
|
|
66
79
|
/**
|
|
67
80
|
* `uip maestro flow registry pull --force`: refresh the local catalog copy the
|
|
68
81
|
* probes and the search answer from. It never refreshes itself, so before
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { compareCodePoints, sortedStrings } from "../compat/compare.js";
|
|
20
20
|
import { editDistance } from "../../core/edit-distance.js";
|
|
21
21
|
import { registryPull, registrySearch } from "../uip/commands.js";
|
|
22
|
-
import { failureReason, findJsonDocument, tail } from "../uip/envelope.js";
|
|
22
|
+
import { failureReason, findJsonDocument, getCI, parseEnvelope, tail } from "../uip/envelope.js";
|
|
23
23
|
import { isPlainObject, pyOr } from "./support.js";
|
|
24
24
|
/**
|
|
25
25
|
* The action ids in a `registry search <key>` reply, sorted.
|
|
@@ -141,6 +141,27 @@ export function registryEventIds(payload, connectorKey) {
|
|
|
141
141
|
forms: ["trigger", "event"].filter((form) => forms.get(id).has(form)),
|
|
142
142
|
}));
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Whether the search ANSWERED and listed no action and no event: the catalog
|
|
146
|
+
* copy serves no node for the connector. A failed search is not this.
|
|
147
|
+
*/
|
|
148
|
+
export function catalogServesNothing(catalog) {
|
|
149
|
+
return catalog.failure === undefined && catalog.actions.length === 0 && catalog.events.length === 0;
|
|
150
|
+
}
|
|
151
|
+
/** Why a successful pull's reply does not show a whole catalog written, or `undefined` when it does. */
|
|
152
|
+
export function partialPullReason(stdout) {
|
|
153
|
+
const data = getCI(parseEnvelope(stdout), "Data");
|
|
154
|
+
if (data === undefined)
|
|
155
|
+
return "its reply did not say what it wrote";
|
|
156
|
+
const missing = getCI(data, "MissingSources");
|
|
157
|
+
if (Array.isArray(missing) && missing.length > 0) {
|
|
158
|
+
const sources = missing.map((entry) => getCI(entry, "Source")).filter((source) => typeof source === "string");
|
|
159
|
+
return `missing node sources: ${sources.length > 0 ? sources.join(", ") : `${missing.length} source(s)`}`;
|
|
160
|
+
}
|
|
161
|
+
if (getCI(data, "CacheWritten") !== true)
|
|
162
|
+
return "the CLI did not write its catalog cache";
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
144
165
|
/**
|
|
145
166
|
* `uip maestro flow registry pull --force`: refresh the local catalog copy the
|
|
146
167
|
* probes and the search answer from. It never refreshes itself, so before
|
|
@@ -150,7 +171,10 @@ export function registryEventIds(payload, connectorKey) {
|
|
|
150
171
|
*/
|
|
151
172
|
export async function refreshRegistryCatalog(client, timeoutMs) {
|
|
152
173
|
const result = await client.run(registryPull(), timeoutMs === undefined ? undefined : { timeoutMs });
|
|
153
|
-
|
|
174
|
+
if (result.code !== 0)
|
|
175
|
+
return { ok: false, reason: failureReason(result) };
|
|
176
|
+
const partial = partialPullReason(result.stdout);
|
|
177
|
+
return partial === undefined ? { ok: true } : { ok: true, partial };
|
|
154
178
|
}
|
|
155
179
|
/**
|
|
156
180
|
* `registry search <key>`, read for both catalogs. This runs only on the
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** One hour: a session's worth of `prepare` calls, short enough that a newly published node is not hidden for long. */
|
|
2
|
+
export declare const DEFAULT_ABSENCE_TTL_MS: number;
|
|
3
|
+
/** What a remembered verdict says. */
|
|
4
|
+
export interface RememberedAbsence {
|
|
5
|
+
/** Epoch ms when the verdict was recorded, right after the pull that reached it. */
|
|
6
|
+
recordedAt: number;
|
|
7
|
+
/** How long ago that was, by the store's clock. */
|
|
8
|
+
ageMs: number;
|
|
9
|
+
/**
|
|
10
|
+
* The tenant the catalog copy was fetched for (`baseUrl|orgId|tenantId`,
|
|
11
|
+
* lower case). Accept the verdict only when the ACTIVE login is that tenant:
|
|
12
|
+
* after a login switch the copy's metadata still names the old one until the
|
|
13
|
+
* CLI refetches.
|
|
14
|
+
*/
|
|
15
|
+
scope: string;
|
|
16
|
+
}
|
|
17
|
+
/** The port `prepare` reads and writes the verdicts through. Without one, nothing is remembered. */
|
|
18
|
+
export interface CatalogAbsence {
|
|
19
|
+
/** The verdict for `connectorKey` against the CURRENT catalog copy, if one is remembered and fresh. */
|
|
20
|
+
lookup(connectorKey: string): RememberedAbsence | undefined;
|
|
21
|
+
/** The current catalog copy's epoch. Read it BEFORE the search whose answer you then {@link record}. */
|
|
22
|
+
epoch(): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Remember that the catalog copy at `epoch` serves no node for `connectorKey`.
|
|
25
|
+
* Records nothing when the copy is no longer at `epoch`: the answer was about
|
|
26
|
+
* a copy another process has since replaced.
|
|
27
|
+
*/
|
|
28
|
+
record(connectorKey: string, epoch: string): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The tenant scope of a `uip login status --output json` `Data` block, spelled
|
|
32
|
+
* as the CLI's `nodeCacheScope` spells a catalog's scope (each part trimmed,
|
|
33
|
+
* trailing slashes dropped from the base URL, lower case), or `undefined` when
|
|
34
|
+
* any part is missing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function loginScope(data: unknown): string | undefined;
|
|
37
|
+
export interface FsCatalogAbsenceOptions {
|
|
38
|
+
/** The CLI's index metadata. Defaults to `~/.uipath/nodes/index.meta.json`. */
|
|
39
|
+
metaPath?: string;
|
|
40
|
+
/** Where the verdicts live. Defaults to `~/.uipath/cache/flow-sdk/catalog-absent.json`. */
|
|
41
|
+
file?: string;
|
|
42
|
+
/**
|
|
43
|
+
* How long a verdict is trusted; 0 or less disables the memory. Defaults to
|
|
44
|
+
* `UIP_FLOW_SDK_CATALOG_ABSENCE_TTL_MS`, else {@link DEFAULT_ABSENCE_TTL_MS}.
|
|
45
|
+
*/
|
|
46
|
+
ttlMs?: number;
|
|
47
|
+
now?: () => number;
|
|
48
|
+
}
|
|
49
|
+
/** The on-disk memory, beside the CLI's own catalog copy under `~/.uipath`. */
|
|
50
|
+
export declare function fsCatalogAbsence(options?: FsCatalogAbsenceOptions): CatalogAbsence;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The remembered answer "the Flow node catalog serves no node for connector K",
|
|
3
|
+
* so `prepare` does not force a catalog pull for it on every call.
|
|
4
|
+
*
|
|
5
|
+
* Keyed on the catalog copy's epoch: `scope|cacheVersion|hash` from the CLI's
|
|
6
|
+
* `~/.uipath/nodes/index.meta.json`. A pull that changes the catalog changes
|
|
7
|
+
* the hash and so drops every entry; entries also expire after a TTL, so a
|
|
8
|
+
* newly published node is found even when nothing pulls. No readable metadata
|
|
9
|
+
* means nothing is remembered. File errors are swallowed: losing the memory
|
|
10
|
+
* costs one pull, never a wrong answer.
|
|
11
|
+
*/
|
|
12
|
+
import { mkdirSync, readFileSync, renameSync, rmSync } from "node:fs";
|
|
13
|
+
import { homedir } from "node:os";
|
|
14
|
+
import { dirname, join } from "node:path";
|
|
15
|
+
import { writeJsonFile } from "../../core/json-file.js";
|
|
16
|
+
import { getCI } from "../uip/envelope.js";
|
|
17
|
+
/** One hour: a session's worth of `prepare` calls, short enough that a newly published node is not hidden for long. */
|
|
18
|
+
export const DEFAULT_ABSENCE_TTL_MS = 60 * 60 * 1000;
|
|
19
|
+
/** The catalog copy's epoch and tenant scope, or `undefined` when the metadata names no hash or scope. */
|
|
20
|
+
function catalogIdentity(metaPath) {
|
|
21
|
+
try {
|
|
22
|
+
const meta = JSON.parse(readFileSync(metaPath, "utf8"));
|
|
23
|
+
const { hash, scope, cacheVersion } = meta;
|
|
24
|
+
if (typeof hash !== "string" || hash === "" || typeof scope !== "string" || scope === "")
|
|
25
|
+
return undefined;
|
|
26
|
+
const tenant = scope.toLowerCase();
|
|
27
|
+
return { epoch: `${tenant}|${typeof cacheVersion === "number" ? cacheVersion : ""}|${hash}`, scope: tenant };
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function catalogEpoch(metaPath) {
|
|
34
|
+
return catalogIdentity(metaPath)?.epoch;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The tenant scope of a `uip login status --output json` `Data` block, spelled
|
|
38
|
+
* as the CLI's `nodeCacheScope` spells a catalog's scope (each part trimmed,
|
|
39
|
+
* trailing slashes dropped from the base URL, lower case), or `undefined` when
|
|
40
|
+
* any part is missing.
|
|
41
|
+
*/
|
|
42
|
+
export function loginScope(data) {
|
|
43
|
+
const pick = (name) => {
|
|
44
|
+
const value = getCI(data, name);
|
|
45
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
46
|
+
return trimmed === "" ? undefined : trimmed;
|
|
47
|
+
};
|
|
48
|
+
const baseUrl = pick("BaseUrl")?.replace(/\/+$/, "");
|
|
49
|
+
const parts = [baseUrl, pick("OrganizationId"), pick("TenantId")];
|
|
50
|
+
return parts.every((part) => part !== undefined && part !== "") ? parts.join("|").toLowerCase() : undefined;
|
|
51
|
+
}
|
|
52
|
+
function readAbsenceFile(path) {
|
|
53
|
+
try {
|
|
54
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
55
|
+
if (parsed === null || typeof parsed !== "object")
|
|
56
|
+
return undefined;
|
|
57
|
+
const { epoch, absent } = parsed;
|
|
58
|
+
if (typeof epoch !== "string" || typeof absent !== "object" || absent === null || Array.isArray(absent))
|
|
59
|
+
return undefined;
|
|
60
|
+
return { epoch, absent };
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function absenceTtlFromEnv() {
|
|
67
|
+
const raw = process.env.UIP_FLOW_SDK_CATALOG_ABSENCE_TTL_MS;
|
|
68
|
+
if (raw === undefined || raw.trim() === "")
|
|
69
|
+
return DEFAULT_ABSENCE_TTL_MS;
|
|
70
|
+
const value = Number(raw);
|
|
71
|
+
return Number.isFinite(value) ? value : DEFAULT_ABSENCE_TTL_MS;
|
|
72
|
+
}
|
|
73
|
+
/** The on-disk memory, beside the CLI's own catalog copy under `~/.uipath`. */
|
|
74
|
+
export function fsCatalogAbsence(options = {}) {
|
|
75
|
+
const metaPath = options.metaPath ?? join(homedir(), ".uipath", "nodes", "index.meta.json");
|
|
76
|
+
const file = options.file ?? join(homedir(), ".uipath", "cache", "flow-sdk", "catalog-absent.json");
|
|
77
|
+
const ttlMs = options.ttlMs ?? absenceTtlFromEnv();
|
|
78
|
+
const now = options.now ?? Date.now;
|
|
79
|
+
return {
|
|
80
|
+
lookup(connectorKey) {
|
|
81
|
+
if (ttlMs <= 0)
|
|
82
|
+
return undefined;
|
|
83
|
+
const identity = catalogIdentity(metaPath);
|
|
84
|
+
if (identity === undefined)
|
|
85
|
+
return undefined;
|
|
86
|
+
const stored = readAbsenceFile(file);
|
|
87
|
+
if (stored === undefined || stored.epoch !== identity.epoch)
|
|
88
|
+
return undefined;
|
|
89
|
+
const recordedAt = Object.hasOwn(stored.absent, connectorKey) ? stored.absent[connectorKey] : undefined;
|
|
90
|
+
if (typeof recordedAt !== "number")
|
|
91
|
+
return undefined;
|
|
92
|
+
const age = now() - recordedAt;
|
|
93
|
+
// A clock that went backwards is not evidence of freshness.
|
|
94
|
+
if (age < 0 || age >= ttlMs)
|
|
95
|
+
return undefined;
|
|
96
|
+
return { recordedAt, ageMs: age, scope: identity.scope };
|
|
97
|
+
},
|
|
98
|
+
epoch() {
|
|
99
|
+
return ttlMs <= 0 ? undefined : catalogEpoch(metaPath);
|
|
100
|
+
},
|
|
101
|
+
record(connectorKey, epoch) {
|
|
102
|
+
if (ttlMs <= 0)
|
|
103
|
+
return;
|
|
104
|
+
const current = catalogEpoch(metaPath);
|
|
105
|
+
if (current === undefined || current !== epoch)
|
|
106
|
+
return;
|
|
107
|
+
const stored = readAbsenceFile(file);
|
|
108
|
+
const absent = stored !== undefined && stored.epoch === epoch ? { ...stored.absent } : {};
|
|
109
|
+
absent[connectorKey] = now();
|
|
110
|
+
// Written under `epoch`, never a re-read one: a pull landing after the
|
|
111
|
+
// check above leaves the entry unreadable rather than misfiled.
|
|
112
|
+
const value = {
|
|
113
|
+
$comment: "Connectors this Flow node catalog copy (epoch) served no node for after a forced pull. Written by `registry prepare`; safe to delete.",
|
|
114
|
+
epoch,
|
|
115
|
+
absent,
|
|
116
|
+
};
|
|
117
|
+
const temp = `${file}.${process.pid}.${now()}.tmp`;
|
|
118
|
+
try {
|
|
119
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
120
|
+
// Write, then rename, so a concurrent `prepare` never reads half a file.
|
|
121
|
+
writeJsonFile(temp, value);
|
|
122
|
+
renameSync(temp, file);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// A memory that cannot be written costs the next call one pull; leave no temp file behind.
|
|
126
|
+
try {
|
|
127
|
+
rmSync(temp, { force: true });
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// Nothing more to do.
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Refusal } from "../errors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { failureReason, getCI } from "../uip/envelope.js";
|
|
3
|
+
import { loginStatusData } from "../uip/login-status.js";
|
|
4
4
|
/**
|
|
5
5
|
* Set by `uip` for the processes it starts: the login profile the run is for.
|
|
6
6
|
* Empty or unset means the default login.
|
|
@@ -14,8 +14,7 @@ export const INHERITED_PROFILE_ENV = "UIPATH_CLI_INHERITED_PROFILE";
|
|
|
14
14
|
* notices (UiPath/cli#5485).
|
|
15
15
|
*/
|
|
16
16
|
export async function assertInheritedProfile(client, profile) {
|
|
17
|
-
const result = await client
|
|
18
|
-
const data = result.code === 0 ? getCI(parseEnvelope(result.stdout), "Data") : undefined;
|
|
17
|
+
const { data, result } = await loginStatusData(client);
|
|
19
18
|
if (data === undefined) {
|
|
20
19
|
throw new Refusal(`could not confirm login profile "${profile}": ${failureReason(result)}`, "PROFILE_UNCONFIRMED");
|
|
21
20
|
}
|
|
@@ -158,6 +158,15 @@ export declare function preparedSummaryLine(nodeType: string, out: string, ts: s
|
|
|
158
158
|
export declare function catalogServesNothingPhrase(key: string, refresh: RegistryRefresh | undefined): string;
|
|
159
159
|
/** The progress line before the one `registry pull --force` the fallback runs. */
|
|
160
160
|
export declare function refreshingCatalogLine(key: string): string;
|
|
161
|
+
/**
|
|
162
|
+
* The progress line when the verdict was remembered from an earlier call
|
|
163
|
+
* (catalog-absence.ts), so no lookup and no pull runs this time.
|
|
164
|
+
*/
|
|
165
|
+
export declare function rememberedAbsenceLine(key: string, ageMs: number): string;
|
|
166
|
+
/** Why a `registry get` probe was not run: the search already said the connector has no node at all. */
|
|
167
|
+
export declare function probeSkippedReason(key: string): string;
|
|
168
|
+
/** The warning when that pull exited 0 without a whole catalog; its answer is used but not remembered. */
|
|
169
|
+
export declare function catalogRefreshPartialLine(reason: string): string;
|
|
161
170
|
/** The warning when that pull failed; the fallback continues against the local copy. */
|
|
162
171
|
export declare function catalogRefreshFailedLine(reason: string): string;
|
|
163
172
|
/** The note when the author's `--action` spelling was not the entry's id. */
|
|
@@ -344,6 +344,9 @@ export function preparedSummaryLine(nodeType, out, ts, variants, fieldNote) {
|
|
|
344
344
|
* refreshes itself).
|
|
345
345
|
*/
|
|
346
346
|
export function catalogServesNothingPhrase(key, refresh) {
|
|
347
|
+
if (refresh?.ok === true && refresh.partial !== undefined) {
|
|
348
|
+
return `the Flow node catalog, partly refreshed with \`uip maestro flow registry pull --force\` (${refresh.partial}), serves no node for ${key}`;
|
|
349
|
+
}
|
|
347
350
|
if (refresh?.ok === true)
|
|
348
351
|
return `the Flow node catalog, refreshed with \`uip maestro flow registry pull --force\`, serves no node for ${key}`;
|
|
349
352
|
const why = refresh === undefined ? "it was not refreshed" : `refreshing it failed: ${refresh.reason}`;
|
|
@@ -353,6 +356,23 @@ export function catalogServesNothingPhrase(key, refresh) {
|
|
|
353
356
|
export function refreshingCatalogLine(key) {
|
|
354
357
|
return ` the local catalog copy serves no node for ${key}; refreshing it (uip maestro flow registry pull --force) and looking again.`;
|
|
355
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* The progress line when the verdict was remembered from an earlier call
|
|
361
|
+
* (catalog-absence.ts), so no lookup and no pull runs this time.
|
|
362
|
+
*/
|
|
363
|
+
export function rememberedAbsenceLine(key, ageMs) {
|
|
364
|
+
const minutes = Math.max(0, Math.round(ageMs / 60_000));
|
|
365
|
+
return (` the Flow node catalog served no node for ${key} when it was refreshed ${minutes} min ago, and this copy of it has not changed since; `
|
|
366
|
+
+ "skipping the registry lookups. A `uip maestro flow registry pull --force` that brings a changed catalog makes the next call look again.");
|
|
367
|
+
}
|
|
368
|
+
/** Why a `registry get` probe was not run: the search already said the connector has no node at all. */
|
|
369
|
+
export function probeSkippedReason(key) {
|
|
370
|
+
return `not looked up: the catalog serves no node for ${key}`;
|
|
371
|
+
}
|
|
372
|
+
/** The warning when that pull exited 0 without a whole catalog; its answer is used but not remembered. */
|
|
373
|
+
export function catalogRefreshPartialLine(reason) {
|
|
374
|
+
return `${PREFIX}registry pull --force was partial (${reason}); continuing with what it wrote, and not remembering the answer.`;
|
|
375
|
+
}
|
|
356
376
|
/** The warning when that pull failed; the fallback continues against the local copy. */
|
|
357
377
|
export function catalogRefreshFailedLine(reason) {
|
|
358
378
|
return `${PREFIX}registry pull --force failed (${reason}); continuing with the local catalog copy, which may be stale.`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BuildCaches, type BuildContext } from "../library-build/context.js";
|
|
2
2
|
import type { Reporter } from "../reporter.js";
|
|
3
3
|
import type { UipClient } from "../uip/client.js";
|
|
4
|
+
import { type CatalogAbsence } from "./catalog-absence.js";
|
|
4
5
|
import { type CatalogueRow } from "./objects.js";
|
|
5
6
|
/** The command line, as `argparse` parsed it. Defaults are the Python's. */
|
|
6
7
|
export interface PrepareOptions {
|
|
@@ -55,6 +56,12 @@ export interface PreparePorts {
|
|
|
55
56
|
timeoutMs?: number;
|
|
56
57
|
/** How the CLI is spelled in the pasteable commands; defaults to {@link cliSpelling}. */
|
|
57
58
|
cli?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The remembered "the catalog serves no node for this connector" verdicts
|
|
61
|
+
* (catalog-absence.ts). The CLI passes the on-disk one; without it nothing is
|
|
62
|
+
* remembered and every call pulls before concluding.
|
|
63
|
+
*/
|
|
64
|
+
catalogAbsence?: CatalogAbsence;
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* Where prepare writes its overlay when `--out` is not given, as shown to the
|
|
@@ -35,13 +35,15 @@ import { enrichEntry } from "../library-build/enrich.js";
|
|
|
35
35
|
import { expandGenericForConnector, genericTemplatesByOp } from "../library-build/generic-expand.js";
|
|
36
36
|
import { planLibrary } from "../library-build/plan.js";
|
|
37
37
|
import { MemoryResponseCache } from "../uip/response-cache.js";
|
|
38
|
-
import { refreshRegistryCatalog, registryCatalog } from "./actions.js";
|
|
38
|
+
import { catalogServesNothing, refreshRegistryCatalog, registryCatalog } from "./actions.js";
|
|
39
|
+
import { loginScope } from "./catalog-absence.js";
|
|
40
|
+
import { loginStatusData } from "../uip/login-status.js";
|
|
39
41
|
import { chooseConnection, listConnections, lookupConnection, mergeBindings, restoreBindings, snapshotBindings, solutionConnectionIds, } from "./connections.js";
|
|
40
42
|
import { prepareEvent } from "./event.js";
|
|
41
43
|
import { integrationServiceEntry } from "./integration-service.js";
|
|
42
44
|
import { descriptorUsage } from "./handoff.js";
|
|
43
45
|
import { ResolutionsExhausted, allParentsResolved, resolvedParentValues, writeResolutions } from "./ledger.js";
|
|
44
|
-
import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, refreshingCatalogLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, } from "./messages.js";
|
|
46
|
+
import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, } from "./messages.js";
|
|
45
47
|
import { ObjectMatchRefusal, RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
|
|
46
48
|
import { countInputFields, keepPreparedSchema, lookupSpecsFromOverlay, mergeFilesInto, parentFields as overlayParentFields, schemaActionParents, } from "./overlay.js";
|
|
47
49
|
import { declaredParents, objectActionRequest, objectActionSpecs, parseFields } from "./parents.js";
|
|
@@ -361,8 +363,54 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
361
363
|
const ctx = createBuildContext({ client: ports.client, caches: ports.caches ?? memoryCaches(), reporter: ports.reporter, concurrency: 1, timeoutMs: ports.timeoutMs }, { connectionId, parentFields });
|
|
362
364
|
let nodeType = `uipath.connector.${connectorKey}.${action}`;
|
|
363
365
|
let fromIntegrationService;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
+
/** The operation from Integration Service, once the Flow catalog is known to serve nothing for the connector. */
|
|
367
|
+
const integrationServiceFallback = async (probes, catalog, refresh) => {
|
|
368
|
+
const prepared = await integrationServiceEntry(ctx, { connectorKey, action });
|
|
369
|
+
if ("miss" in prepared) {
|
|
370
|
+
throw new PrepareRefusal(unresolvedOperationMessage({ connectorKey, name: action, probes, catalog, integrationService: prepared.miss, registryRefresh: refresh }), "OPERATION_UNKNOWN");
|
|
371
|
+
}
|
|
372
|
+
info(preparedFromIntegrationServiceLine(connectorKey, prepared.activity, refresh));
|
|
373
|
+
if (prepared.action !== action)
|
|
374
|
+
info(actionCanonicalizedLine(action, prepared.action));
|
|
375
|
+
return prepared;
|
|
376
|
+
};
|
|
377
|
+
// When the catalog is known to serve nothing for the connector, no
|
|
378
|
+
// `registry get` can find a node: skip the probes. Known means a verdict
|
|
379
|
+
// remembered for this catalog copy, or, after the pull, an empty search.
|
|
380
|
+
let knownAbsent;
|
|
381
|
+
let searched;
|
|
382
|
+
if (registryRefresh === undefined) {
|
|
383
|
+
const remembered = ports.catalogAbsence?.lookup(connectorKey);
|
|
384
|
+
// Only for the tenant the copy was fetched for: after a login switch the
|
|
385
|
+
// CLI refetches on its next lookup, while the copy still names the old
|
|
386
|
+
// tenant. An unconfirmed login is a miss, never a match.
|
|
387
|
+
if (remembered !== undefined && loginScope((await loginStatusData(ports.client)).data) === remembered.scope) {
|
|
388
|
+
info(rememberedAbsenceLine(connectorKey, remembered.ageMs));
|
|
389
|
+
knownAbsent = { catalog: { actions: [], events: [] }, refresh: { ok: true } };
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
// Read before the search, so an answer about a copy another process
|
|
394
|
+
// replaced meanwhile is not recorded under the new one.
|
|
395
|
+
const epoch = ports.catalogAbsence?.epoch();
|
|
396
|
+
searched = await registryCatalog(ports.client, connectorKey, ports.timeoutMs);
|
|
397
|
+
if (catalogServesNothing(searched)) {
|
|
398
|
+
// Remember only what a successful pull confirmed; a stale copy's answer is no verdict.
|
|
399
|
+
// A partial pull (missing sources, no cache written) is not a whole catalog either.
|
|
400
|
+
if (registryRefresh.ok && registryRefresh.partial === undefined && epoch !== undefined)
|
|
401
|
+
ports.catalogAbsence?.record(connectorKey, epoch);
|
|
402
|
+
knownAbsent = { catalog: searched, refresh: registryRefresh };
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
const actionProbe = knownAbsent === undefined ? await registryProbe(ctx, nodeType) : undefined;
|
|
406
|
+
if (knownAbsent !== undefined) {
|
|
407
|
+
// The two lookups the refusal would otherwise quote, named as not run and why.
|
|
408
|
+
const skipped = [nodeType, `uipath.connector.trigger.${connectorKey}.${action}`].map((probed) => ({ nodeType: probed, reason: probeSkippedReason(connectorKey) }));
|
|
409
|
+
fromIntegrationService = await integrationServiceFallback(skipped, knownAbsent.catalog, knownAbsent.refresh);
|
|
410
|
+
action = fromIntegrationService.action;
|
|
411
|
+
nodeType = fromIntegrationService.entry.nodeType;
|
|
412
|
+
}
|
|
413
|
+
else if (actionProbe !== undefined && "miss" in actionProbe) {
|
|
366
414
|
// Not an activity. Connector EVENTS live one namespace over, and their
|
|
367
415
|
// registry definition only answers with a connection, which this command
|
|
368
416
|
// has by now. Same loop, different twin pair.
|
|
@@ -394,12 +442,13 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
394
442
|
if (probes.some((probe) => !probe.notFound)) {
|
|
395
443
|
throw new PrepareRefusal(registryGetFailedMessage(connectorKey, action, probes), "REGISTRY_GET_FAILED");
|
|
396
444
|
}
|
|
397
|
-
|
|
445
|
+
// On the re-entry the search already ran, first, and answered something.
|
|
446
|
+
const catalog = searched ?? (await registryCatalog(ports.client, connectorKey, ports.timeoutMs));
|
|
398
447
|
// A catalog that serves NOTHING for the connector — no action, no event, and
|
|
399
448
|
// the search itself answered — is a connector the Flow registry does not
|
|
400
449
|
// carry, not a misspelt action on one it does. Integration Service still
|
|
401
450
|
// serves it, and a BPMN connector task needs nothing more.
|
|
402
|
-
if (catalog
|
|
451
|
+
if (catalogServesNothing(catalog)) {
|
|
403
452
|
// The probes and the search answer from the CLI's local catalog copy,
|
|
404
453
|
// which never refreshes itself. Pull once and look again before
|
|
405
454
|
// concluding anything: a stale copy would send a connector the catalog
|
|
@@ -409,18 +458,13 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
409
458
|
const refreshed = await refreshRegistryCatalog(ports.client, ports.timeoutMs);
|
|
410
459
|
if (!refreshed.ok)
|
|
411
460
|
warn(catalogRefreshFailedLine(refreshed.reason));
|
|
461
|
+
else if (refreshed.partial !== undefined)
|
|
462
|
+
warn(catalogRefreshPartialLine(refreshed.partial));
|
|
412
463
|
return prepareOnConnection(options, ports, connected, refreshed);
|
|
413
464
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
info(preparedFromIntegrationServiceLine(connectorKey, prepared.activity, registryRefresh));
|
|
419
|
-
if (prepared.action !== action)
|
|
420
|
-
info(actionCanonicalizedLine(action, prepared.action));
|
|
421
|
-
action = prepared.action;
|
|
422
|
-
nodeType = prepared.entry.nodeType;
|
|
423
|
-
fromIntegrationService = prepared;
|
|
465
|
+
fromIntegrationService = await integrationServiceFallback(probes, catalog, registryRefresh);
|
|
466
|
+
action = fromIntegrationService.action;
|
|
467
|
+
nodeType = fromIntegrationService.entry.nodeType;
|
|
424
468
|
}
|
|
425
469
|
else {
|
|
426
470
|
throw new PrepareRefusal(unresolvedOperationMessage({ connectorKey, name: action, probes, catalog }), "OPERATION_UNKNOWN");
|
|
@@ -429,7 +473,7 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
|
|
|
429
473
|
// The registry reply this entry came from, or none when Integration Service
|
|
430
474
|
// supplied it — then there is no node to read parents from and the sidecar
|
|
431
475
|
// is built from the synthesized node instead.
|
|
432
|
-
const payload = fromIntegrationService === undefined && "name" in actionProbe ? ctx.caches.registry.read(actionProbe.name) : undefined;
|
|
476
|
+
const payload = fromIntegrationService === undefined && actionProbe !== undefined && "name" in actionProbe ? ctx.caches.registry.read(actionProbe.name) : undefined;
|
|
433
477
|
// The registry's own declaration of parent inputs, read from the same reply.
|
|
434
478
|
const declared = payload === undefined ? [] : declaredParents(payload);
|
|
435
479
|
let entry = fromIntegrationService?.entry ?? extractCanonical(nodeOf(payload));
|
|
@@ -3,6 +3,7 @@ import { reportResult } from '../cli-result.js';
|
|
|
3
3
|
import { PACKAGE_NAME } from "../package-name.js";
|
|
4
4
|
import { exitCodeOf } from "./errors.js";
|
|
5
5
|
import { assertInheritedProfile, INHERITED_PROFILE_ENV } from "./prepare/inherited-profile.js";
|
|
6
|
+
import { fsCatalogAbsence } from "./prepare/catalog-absence.js";
|
|
6
7
|
import { exitText } from "./prepare/messages.js";
|
|
7
8
|
import { defaultOverlayOut, prepareConnector as runPipeline } from "./prepare/pipeline.js";
|
|
8
9
|
import { consoleReporter } from "./reporter.js";
|
|
@@ -70,7 +71,15 @@ export function pipelineOptions(options) {
|
|
|
70
71
|
* `uip` client and reporter injected so tests replay recordings.
|
|
71
72
|
*/
|
|
72
73
|
export async function prepareConnector(options) {
|
|
73
|
-
return withPrepareClient((client) => runPipeline(pipelineOptions(options), { client, reporter: consoleReporter }));
|
|
74
|
+
return withPrepareClient((client) => runPipeline(pipelineOptions(options), { client, reporter: consoleReporter, catalogAbsence: cliCatalogAbsence() }));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The on-disk "catalog serves no node for K" memory,
|
|
78
|
+
* except under `UIP_REPLAY_DIR`: replayed answers are a recording, not this
|
|
79
|
+
* machine's catalog copy, so neither may be read as evidence about the other.
|
|
80
|
+
*/
|
|
81
|
+
function cliCatalogAbsence() {
|
|
82
|
+
return process.env.UIP_REPLAY_DIR ? undefined : fsCatalogAbsence();
|
|
74
83
|
}
|
|
75
84
|
/**
|
|
76
85
|
* Run `work` with the one `uip` client a prepare uses, after checking it talks
|
|
@@ -260,7 +269,7 @@ export async function run(argv) {
|
|
|
260
269
|
return 0;
|
|
261
270
|
}
|
|
262
271
|
}
|
|
263
|
-
const report = await runPipeline(pipelineOptions(options), { client, reporter: consoleReporter });
|
|
272
|
+
const report = await runPipeline(pipelineOptions(options), { client, reporter: consoleReporter, catalogAbsence: cliCatalogAbsence() });
|
|
264
273
|
reportResult({ connector: options.connectorKey, action: options.action, overlay: resolve(options.outPath ?? defaultOverlayOut(process.cwd())), ...report });
|
|
265
274
|
return 0;
|
|
266
275
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UipClient, UipResult } from "./client.js";
|
|
2
|
+
/** `uip login status`: its `Data` block when the call succeeded, and the raw result for a failure message. */
|
|
3
|
+
export interface LoginStatus {
|
|
4
|
+
data: unknown;
|
|
5
|
+
result: UipResult;
|
|
6
|
+
}
|
|
7
|
+
/** `uip login status --output json` through `client`, run at most once per client. */
|
|
8
|
+
export declare function loginStatusData(client: UipClient): Promise<LoginStatus>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { loginStatus } from "./commands.js";
|
|
2
|
+
import { getCI, parseEnvelope } from "./envelope.js";
|
|
3
|
+
// One call per client: a client lives for one command, and the inherited-profile
|
|
4
|
+
// check and the catalog-absence scope check both ask during the same command.
|
|
5
|
+
const answered = new WeakMap();
|
|
6
|
+
/** `uip login status --output json` through `client`, run at most once per client. */
|
|
7
|
+
export function loginStatusData(client) {
|
|
8
|
+
let pending = answered.get(client);
|
|
9
|
+
if (pending === undefined) {
|
|
10
|
+
pending = client.run(loginStatus()).then((result) => ({
|
|
11
|
+
data: result.code === 0 ? getCI(parseEnvelope(result.stdout), "Data") : undefined,
|
|
12
|
+
result,
|
|
13
|
+
}));
|
|
14
|
+
answered.set(client, pending);
|
|
15
|
+
}
|
|
16
|
+
return pending;
|
|
17
|
+
}
|
package/dist/serialize.js
CHANGED
|
@@ -3237,8 +3237,9 @@ function serializeFlow(built, opts) {
|
|
|
3237
3237
|
// keeps its `output`/`loopBack` pair, where the bundled lookup alone
|
|
3238
3238
|
// would have written 2.4's `start`/`continue` onto a 1.0 node (#1311),
|
|
3239
3239
|
// and an option is written when that definition declares the input
|
|
3240
|
-
// (the carried 1.0
|
|
3241
|
-
//
|
|
3240
|
+
// (the carried 1.0 and the bundled 1.0.0 both declare
|
|
3241
|
+
// `completionCondition`, neither declares `breakEnabled`) and refused
|
|
3242
|
+
// when it does not.
|
|
3242
3243
|
const loopDef = definitionFor(NODE_TYPE.loop, version);
|
|
3243
3244
|
const refusal = loopVersionRefusal(step.name, o, usesBreak, loopDef);
|
|
3244
3245
|
if (refusal)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.86.
|
|
3
|
+
"version": "6.86.26",
|
|
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",
|
|
@@ -19,31 +19,38 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.js"
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"default": "./dist/index.js"
|
|
23
24
|
},
|
|
24
25
|
"./case": {
|
|
25
26
|
"types": "./dist/case/case-sdk.d.ts",
|
|
26
|
-
"import": "./dist/case/case-sdk.js"
|
|
27
|
+
"import": "./dist/case/case-sdk.js",
|
|
28
|
+
"default": "./dist/case/case-sdk.js"
|
|
27
29
|
},
|
|
28
30
|
"./bpmn": {
|
|
29
31
|
"types": "./dist/bpmn/bpmn-sdk.d.ts",
|
|
30
|
-
"import": "./dist/bpmn/bpmn-sdk.js"
|
|
32
|
+
"import": "./dist/bpmn/bpmn-sdk.js",
|
|
33
|
+
"default": "./dist/bpmn/bpmn-sdk.js"
|
|
31
34
|
},
|
|
32
35
|
"./extend": {
|
|
33
36
|
"types": "./dist/extend.d.ts",
|
|
34
|
-
"import": "./dist/extend.js"
|
|
37
|
+
"import": "./dist/extend.js",
|
|
38
|
+
"default": "./dist/extend.js"
|
|
35
39
|
},
|
|
36
40
|
"./cli": {
|
|
37
41
|
"types": "./dist/cli/index.d.ts",
|
|
38
|
-
"import": "./dist/cli/index.js"
|
|
42
|
+
"import": "./dist/cli/index.js",
|
|
43
|
+
"default": "./dist/cli/index.js"
|
|
39
44
|
},
|
|
40
45
|
"./script-globals": {
|
|
41
46
|
"types": "./dist/script-globals.d.ts",
|
|
42
|
-
"import": "./dist/script-globals.js"
|
|
47
|
+
"import": "./dist/script-globals.js",
|
|
48
|
+
"default": "./dist/script-globals.js"
|
|
43
49
|
},
|
|
44
50
|
"./registry-materializer": {
|
|
45
51
|
"types": "./dist/registry/materializer.d.ts",
|
|
46
|
-
"import": "./dist/registry/materializer.js"
|
|
52
|
+
"import": "./dist/registry/materializer.js",
|
|
53
|
+
"default": "./dist/registry/materializer.js"
|
|
47
54
|
},
|
|
48
55
|
"./package.json": "./package.json"
|
|
49
56
|
},
|
|
@@ -103,5 +110,5 @@
|
|
|
103
110
|
"@types/node": "^22.7.0",
|
|
104
111
|
"esbuild": "^0.28.1"
|
|
105
112
|
},
|
|
106
|
-
"gitref": "
|
|
113
|
+
"gitref": "bc4ddcf0729693541e961a3e409278eac606cb4c"
|
|
107
114
|
}
|