@uipath/maestro-builder-sdk 6.96.1 → 6.96.3

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/bpmn-api.md CHANGED
@@ -480,6 +480,7 @@ What every ACTIVITY accepts, on top of its own options — a script task, a vari
480
480
  - `ConnectorOpts.connection?: string` — Symbolic connection name declared in bindings.json (→ ConnectionId).
481
481
  - `ConnectorOpts.folder?: string` — Symbolic folder name declared in bindings.json (→ connectionFolderKey).
482
482
  - `ConnectorOpts.object?: string` — Which OBJECT a **generic** operation addresses — e.g. ServiceNow's "List All Records" on `'acr_user'`, NetSuite's "Get…
483
+ - `ConnectorOpts.carried?: CarriedConnectorOperation` — Flow only, and written by decompile, not by an author: the `.flow` file's own description of an operation the connector…
483
484
 
484
485
  ### `HumanTaskAppOpts`
485
486
 
@@ -1066,6 +1067,15 @@ One lookup field's retrieval contract, generated from `reference`.
1066
1067
  - `LookupSpec.strategy: LookupStrategy`
1067
1068
  - `LookupSpec.dependsOn?: readonly string[]` — For `strategy: 'dependent'`, the fields that must resolve first.
1068
1069
 
1070
+ ### `CarriedConnectorOperation`
1071
+
1072
+ The file's description of a connector operation the library lacks; see the module comment.
1073
+
1074
+ - `CarriedConnectorOperation.method: string` — The HTTP method the node calls, as the file saved it (`detail.method`), e.g. `POST`.
1075
+ - `CarriedConnectorOperation.endpoint: string` — The endpoint the node calls (`detail.endpoint`), e.g. `/v2/{entityName}/CreateEntityRecord`.
1076
+ - `CarriedConnectorOperation.operation?: string` — The operation verb the node's configuration records (`essentialConfiguration.operation`), e.g. `create` or `list`.
1077
+ - `CarriedConnectorOperation.fields?: readonly CarriedConnectorField[]` — Every input the node sets, with the slot it rides in.
1078
+
1069
1079
  ### `DataServiceFolderEntity`
1070
1080
 
1071
1081
  A Data Fabric entity in an Orchestrator folder — what Studio Web's folder-scoped entity picker selects, as opposed to a…
@@ -1087,6 +1097,14 @@ How `prepare` should retrieve the collection, chosen from the metadata.
1087
1097
 
1088
1098
  - `type LookupStrategy = 'filter' | 'scan' | 'tree' | 'dependent'`
1089
1099
 
1100
+ ### `CarriedConnectorField`
1101
+
1102
+ One input field a connector task carries from the plan it was decompiled from.
1103
+
1104
+ - `CarriedConnectorField.name: string` — The field's name, as the saved field list names it, e.g. `bodyFormat`.
1105
+ - `CarriedConnectorField.location: CarriedFieldLocation` — The wire slot the saved field list names (`fieldLocation`).
1106
+ - `CarriedConnectorField.type?: string` — `string`, `number`, `boolean`, `array` or `object`, when the saved field declares one.
1107
+
1090
1108
  ### `HumanTaskFormField`
1091
1109
 
1092
1110
  One field of an inline human-task form.
@@ -1099,6 +1117,12 @@ One button the reviewer can finish the task with.
1099
1117
 
1100
1118
  - `type HumanTaskOutcome = string | { name: string; id?: string; }`
1101
1119
 
1120
+ ### `CarriedFieldLocation`
1121
+
1122
+ Where a carried field rides on the wire: the request body, the query string or the path.
1123
+
1124
+ - `type CarriedFieldLocation = Extract<FieldLocation, 'body' | 'query' | 'path'>`
1125
+
1102
1126
  ### `HumanTaskShownField`
1103
1127
 
1104
1128
  A value the reviewer READS: shown on the form, filled in from the process.
@@ -20,16 +20,20 @@
20
20
  * prepare` writes (`--connectors-local`, else `.flow-sdk/connectors-local`). A
21
21
  * plan whose connector is one only a tenant has (a Data Service entity, a custom
22
22
  * connector) is decompiled after `registry prepare` has described it, as it is
23
- * compiled.
23
+ * compiled. When neither layer names a connector element the plan describes,
24
+ * decompile writes the plan's own description of it into that overlay
25
+ * (`plan-connectors.ts`), so check and compile accept it too; `registry
26
+ * prepare` later replaces it with the tenant's.
24
27
  */
25
28
  import { reportResult } from '../cli-result.js';
26
29
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
27
30
  import { openCliLibrary } from '../core/cli-library.js';
28
31
  import { resolveLibraryDir } from '../core/library-cache.js';
29
32
  import { basename, join, resolve } from 'node:path';
30
- import { defaultOverlayDir, defaultSourceOut, workDirBeside, writeSource } from '../workdir.js';
33
+ import { defaultOverlayDir, defaultSourceOut, workDirBeside, workPath, writeSource } from '../workdir.js';
31
34
  import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
32
35
  import { decompileWithDiagnostics } from './decompile.js';
36
+ import { decompileWithPlanConnectors } from './plan-connectors.js';
33
37
  import { CASE_IMPORT } from '../package-name.js';
34
38
  import { commentText } from '../core/comment-text.js';
35
39
  import { pipelineFrontDoor } from '../registry/uip/pipeline-front-door.js';
@@ -63,15 +67,30 @@ export function run(argv) {
63
67
  const plan = JSON.parse(readFileSync(pos, 'utf8'));
64
68
  const libraryDir = resolveLibraryDir(flagValue(argv, '--library'));
65
69
  // The overlay the library opened, flag or auto-detected, so the helper reads it from any directory.
66
- const overlayDir = flagValue(argv, '--connectors-local') ?? defaultOverlayDir();
67
- const library = openCliLibrary(argv);
70
+ let overlayDir = flagValue(argv, '--connectors-local') ?? defaultOverlayDir();
68
71
  const importSpecifier = flagValue(argv, '--import') ?? CASE_IMPORT;
69
72
  const bestEffort = argv.includes('--best-effort');
70
- const result = decompileWithDiagnostics(plan, {
71
- importSpecifier,
72
- library,
73
- bestEffort,
74
- });
73
+ const run = (library) => decompileWithDiagnostics(plan, { importSpecifier, library, bestEffort });
74
+ const library = openCliLibrary(argv);
75
+ let result;
76
+ if (!library)
77
+ result = run(undefined);
78
+ else {
79
+ // A connector the library and the overlay lack, that the plan describes:
80
+ // decompile writes the plan's description into the overlay check and
81
+ // compile read, and goes on (`plan-connectors.ts`). Only what decompile
82
+ // asks the library for and it cannot answer; nothing it names is touched.
83
+ const carried = decompileWithPlanConnectors(plan, (dir) => (dir === undefined ? library : openCliLibrary([...argv, '--connectors-local', dir])), overlayDir, () => workPath('connectors-local'), run);
84
+ result = carried.result;
85
+ overlayDir = carried.overlayDir;
86
+ for (const { entry } of carried.written) {
87
+ const object = entry.operation?.objectName ? ` (object ${entry.operation.objectName})` : '';
88
+ console.error(`decompile: ${entry.nodeType}${object} is in no connector library; wrote the plan's own description of it into ${overlayDir}. `
89
+ + 'It knows only the fields the plan uses; `registry prepare` describes the connector from the tenant and replaces it.');
90
+ }
91
+ if (carried.written.length)
92
+ reportResult({ connectorsFromPlan: { overlay: resolve(overlayDir), nodeTypes: carried.written.map((c) => c.entry.nodeType) } });
93
+ }
75
94
  const out = flagValue(argv, '-o') ?? defaultSourceOut(`${baseName(plan)}.case.ts`);
76
95
  writeSource(out, result.source);
77
96
  console.log(`decompile: wrote ${basename(out)}`);
@@ -0,0 +1,105 @@
1
+ import type { LibraryEntry } from '../registry/model/library.js';
2
+ import { type LibraryFiles } from '../registry/prepare/overlay.js';
3
+ import type { Library } from '../core/library.js';
4
+ /** `provenance.source` of every entry this module writes. A `registry prepare` of the same operation replaces such an entry. */
5
+ export declare const PLAN_CONNECTOR_SOURCE = "case-plan";
6
+ type Dict = Record<string, any>;
7
+ /** One connector bag of a plan: the object whose `context` names a `connectorKey`, and the element that owns it. */
8
+ export interface PlanConnectorBag {
9
+ /** The id of the task, trigger node or rule that holds the bag; none for a bag directly under a stage. */
10
+ owner?: string;
11
+ /** The names that element goes by in a decompile or compile message: its display name or label. */
12
+ names: string[];
13
+ bag: Dict;
14
+ }
15
+ /**
16
+ * Every connector bag in `plan`, with the element that owns it.
17
+ *
18
+ * The owner is the nearest object with an `id` above the bag, but never a stage
19
+ * or the case itself: a bag in an id-less wrapper directly under a stage has no
20
+ * owner.
21
+ */
22
+ export declare function planConnectorBags(plan: unknown): PlanConnectorBag[];
23
+ /** One library field, as {@link responseSchemaFields} reads it back. */
24
+ export interface SchemaField {
25
+ name: string;
26
+ type: string;
27
+ displayName?: string;
28
+ }
29
+ /**
30
+ * The response JSON schema a plan saved, read back as library fields: the
31
+ * inverse of `responseJsonSchema` (`core/connector-response-schema.ts`). A
32
+ * nested object is `parent.child`, an array of objects `items[*].child`.
33
+ *
34
+ * For instance `{ properties: { CreatedBy: { $ref: '#/definitions/U' } }, definitions: { U: { properties: { Email: { type: 'string' } } } } }`
35
+ * reads as `[{ name: 'CreatedBy.Email', type: 'string' }]`.
36
+ */
37
+ export declare function responseSchemaFields(schema: unknown): SchemaField[];
38
+ /** One connector operation a plan describes and the library lacks, as {@link planConnectors} derives it. */
39
+ export interface PlanConnector {
40
+ /** The library entry, marked with {@link PLAN_CONNECTOR_SOURCE}. */
41
+ entry: LibraryEntry;
42
+ /** The overlay library `registry prepare` writes for one operation: `index.json` and the entry's files. */
43
+ files: LibraryFiles;
44
+ /** The ids of the tasks, triggers and rules that use it. */
45
+ owners: string[];
46
+ /** The names those elements go by in a decompile or compile message. */
47
+ names: string[];
48
+ /** The library questions it answers, as {@link libraryQuestion} spells them. */
49
+ questions: string[];
50
+ }
51
+ /**
52
+ * One library question decompile asks, as a string: the `identifyAction` or
53
+ * `identifyEvent` wire it passes, minus the version and activity type (the
54
+ * entry is written at the version asked). For instance
55
+ * `["action","custom-acme","POST","/tickets","ticket"]`.
56
+ */
57
+ export declare function libraryQuestion(kind: 'action' | 'trigger' | 'event', wire: {
58
+ connectorKey: string;
59
+ httpMethod?: string;
60
+ endpoint?: string;
61
+ objectName?: string;
62
+ eventOperation?: string;
63
+ }): string;
64
+ /**
65
+ * The connector operations `plan` describes and `library` cannot name (see the
66
+ * module comment), one per operation and object. Pure: reads `library`,
67
+ * writes nothing. It reads every connector element of the plan, also one
68
+ * decompile never asks the library about (a placeholder is skipped); decompile
69
+ * writes only the ones it asks for ({@link decompileWithPlanConnectors}).
70
+ *
71
+ * @param plan - The Case plan, as saved (`caseplan.json`).
72
+ * @param library - The library decompile opens: the shipped one plus the `connectors-local` overlay.
73
+ * @returns An empty list when the library names every connector element the plan describes.
74
+ */
75
+ export declare function planConnectors(plan: unknown, library: Library): PlanConnector[];
76
+ /**
77
+ * Merge `connectors` into the overlay at `overlayDir`, as `registry prepare`
78
+ * merges an operation.
79
+ */
80
+ export declare function writePlanConnectors(connectors: readonly PlanConnector[], overlayDir: string): void;
81
+ /** What {@link decompileWithPlanConnectors} returns: decompile's result, and the connectors it wrote. */
82
+ export interface PlanConnectorsDecompile<R> {
83
+ result: R;
84
+ /** The connectors written into the overlay, in the order decompile asked for them; empty when none was needed. */
85
+ written: PlanConnector[];
86
+ /** The library the result was decompiled with: the last one opened. */
87
+ library: Library;
88
+ }
89
+ /**
90
+ * Run `decompile` and, each time it fails on a connector question the library
91
+ * cannot answer and the plan describes, write that connector into the overlay
92
+ * and run it again. Only the connectors decompile asks for are written: a
93
+ * connector element it never names through the library (a placeholder, a
94
+ * global event kept verbatim) is not.
95
+ *
96
+ * @param plan - The plan being decompiled.
97
+ * @param open - Opens the library with the overlay at the given directory (`undefined`: none).
98
+ * @param overlayDir - The overlay the library reads, or `undefined` for none yet.
99
+ * @param newOverlayDir - Where the overlay goes when there is none yet, e.g. `.flow-sdk/connectors-local`.
100
+ * @param decompile - The decompile to run, with the library to use.
101
+ */
102
+ export declare function decompileWithPlanConnectors<R>(plan: unknown, open: (overlayDir: string | undefined) => Library, overlayDir: string | undefined, newOverlayDir: () => string, decompile: (library: Library) => R): PlanConnectorsDecompile<R> & {
103
+ overlayDir: string | undefined;
104
+ };
105
+ export {};