@uipath/maestro-sdk 1.0.2 → 1.1.0

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.
@@ -57,6 +57,32 @@ var bpmn_spec_default = {
57
57
  designSchemaJsonDir: "src/services/serialization/design-schema/*.design-schema.json"
58
58
  },
59
59
  extensionTypes: {
60
+ "uipath:Activity": {
61
+ extensionType: "uipath:Activity",
62
+ label: "Canvas activity",
63
+ bpmnElement: "bpmn:ServiceTask",
64
+ placements: {
65
+ serviceTask: {
66
+ type: "bpmn:ServiceTask"
67
+ },
68
+ task: {
69
+ type: "bpmn:Task"
70
+ },
71
+ boundaryEvent: {
72
+ type: "bpmn:BoundaryEvent"
73
+ }
74
+ },
75
+ extensionTag: "uipath:activity",
76
+ contextFields: [],
77
+ inputPattern: "none",
78
+ outputSource: null,
79
+ outputType: null,
80
+ bindingPattern: "none",
81
+ requiresDiscovery: false,
82
+ isDynamic: true,
83
+ xmlTemplate: null,
84
+ outputNotes: "Studio Web canvas can emit custom output-only activity payloads for placeholder tasks and error boundary metadata."
85
+ },
60
86
  "Actions.HITL": {
61
87
  extensionType: "Actions.HITL",
62
88
  label: "Create action app task",
@@ -246,46 +272,33 @@ var bpmn_spec_default = {
246
272
  extensionTag: "uipath:activity",
247
273
  contextFields: [
248
274
  {
249
- name: "releaseKey",
250
- displayName: "Process",
275
+ name: "name",
276
+ displayName: "Agent",
251
277
  type: "string",
252
- required: false,
278
+ required: true,
253
279
  hidden: true,
254
280
  isPrimaryKey: false,
255
- binding: false,
281
+ binding: true,
256
282
  defaultValue: null,
257
283
  bindingInfo: {
258
284
  resource: "process",
259
285
  resourceKeyPattern: "${metadata.key}",
260
- propertyAttribute: "Key"
286
+ propertyAttribute: "name"
261
287
  }
262
288
  },
263
- {
264
- name: "folderId",
265
- type: "string",
266
- required: false,
267
- hidden: true,
268
- isPrimaryKey: false,
269
- binding: false,
270
- defaultValue: null
271
- },
272
289
  {
273
290
  name: "folderPath",
274
291
  type: "string",
275
- required: false,
276
- hidden: true,
277
- isPrimaryKey: false,
278
- binding: false,
279
- defaultValue: null
280
- },
281
- {
282
- name: "name",
283
- type: "string",
284
- required: false,
292
+ required: true,
285
293
  hidden: true,
286
294
  isPrimaryKey: false,
287
- binding: false,
288
- defaultValue: null
295
+ binding: true,
296
+ defaultValue: null,
297
+ bindingInfo: {
298
+ resource: "process",
299
+ resourceKeyPattern: "${metadata.key}",
300
+ propertyAttribute: "folderPath"
301
+ }
289
302
  }
290
303
  ],
291
304
  inputPattern: "mergedBody",
@@ -299,25 +312,20 @@ var bpmn_spec_default = {
299
312
  bindingInfo: {
300
313
  resource: "process",
301
314
  resourceKeyPattern: "${metadata.key}",
302
- propertyAttribute: "Key",
303
- contextField: "releaseKey"
315
+ propertyAttribute: "name",
316
+ contextField: "name"
304
317
  },
305
318
  requiresDiscovery: true,
306
319
  isDynamic: true,
307
320
  xmlTemplate: `<bpmn:ServiceTask id="{id}" name="{name}">
308
- <bpmn:extensionElements>
309
- <uipath:activity version="v1">
310
- <uipath:type value="Orchestrator.StartAgentJob" version="v1" />
311
- <uipath:context>
312
- <uipath:input name="releaseKey" value="{releaseKey}" />
313
- <uipath:input name="folderId" value="{folderId}" />
314
- <uipath:input name="folderPath" value="{folderPath}" />
315
- <uipath:input name="name" value="{name}" />
316
- </uipath:context>
317
- <uipath:input name="JobArguments" type="json" target="bodyField"><![CDATA[{}]]></uipath:input>
318
- <uipath:output name="Process response" type="Orchestrator.RunJob" var="{varId}" />
319
- </uipath:activity>
320
- </bpmn:extensionElements>
321
+ <uipath:activity type="Orchestrator.StartAgentJob" version="v1">
322
+ <uipath:context>
323
+ <uipath:input name="name" value="=bindings.{nameBindingId}" />
324
+ <uipath:input name="folderPath" value="=bindings.{folderPathBindingId}" />
325
+ </uipath:context>
326
+ <uipath:input name="JobArguments" type="json" target="bodyField"><![CDATA[{}]]></uipath:input>
327
+ <uipath:output name="Process response" type="Orchestrator.RunJob" var="{varId}" />
328
+ </uipath:activity>
321
329
  <bpmn:incoming>{incomingEdge}</bpmn:incoming>
322
330
  <bpmn:outgoing>{outgoingEdge}</bpmn:outgoing>
323
331
  </bpmn:ServiceTask>`,
@@ -0,0 +1,64 @@
1
+ export interface BpmnValidationFileSystem {
2
+ readdir(path: string): Promise<string[]>;
3
+ readFile(path: string): Promise<Uint8Array | null>;
4
+ exists(path: string): Promise<boolean>;
5
+ joinPath(...segments: string[]): string;
6
+ }
7
+ export interface BpmnValidationDiagnostic {
8
+ file: string;
9
+ element?: string;
10
+ message: string;
11
+ instruction: string;
12
+ severity?: "error" | "warning";
13
+ }
14
+ export interface BpmnFileValidationContext {
15
+ projectPath: string;
16
+ file: string;
17
+ xml: string;
18
+ fileSystem: BpmnValidationFileSystem;
19
+ }
20
+ export interface BpmnProjectValidationContext {
21
+ projectPath: string;
22
+ bpmnFiles: readonly string[];
23
+ fileSystem: BpmnValidationFileSystem;
24
+ }
25
+ export interface BpmnFileValidator {
26
+ name: string;
27
+ validate(context: BpmnFileValidationContext): BpmnValidationDiagnostic[] | Promise<BpmnValidationDiagnostic[]>;
28
+ }
29
+ export interface BpmnProjectValidator {
30
+ name: string;
31
+ validate(context: BpmnProjectValidationContext): BpmnValidationDiagnostic[] | Promise<BpmnValidationDiagnostic[]>;
32
+ }
33
+ export interface BpmnValidateServiceOptions {
34
+ fileValidators?: readonly BpmnFileValidator[];
35
+ projectValidators?: readonly BpmnProjectValidator[];
36
+ }
37
+ export interface BpmnValidationResult {
38
+ isValid: boolean;
39
+ errorCode?: string;
40
+ diagnostics: BpmnValidationDiagnostic[];
41
+ message?: string;
42
+ }
43
+ export declare class BpmnValidateService {
44
+ private readonly fileSystem;
45
+ private readonly options;
46
+ constructor(fileSystem: BpmnValidationFileSystem, options?: BpmnValidateServiceOptions);
47
+ validateProject(projectPath: string): Promise<BpmnValidationResult>;
48
+ private validateBpmnFile;
49
+ private validateUiPathTags;
50
+ private validatePayload;
51
+ private validateContractPlacement;
52
+ private validateContext;
53
+ private validateInputs;
54
+ private validateDynamicDirectInputs;
55
+ private validateVariableMappingInputs;
56
+ private validateOutput;
57
+ private validateBindingReferences;
58
+ private validateStartAgentJobBindings;
59
+ private loadBindings;
60
+ private runFileValidators;
61
+ private runProjectValidators;
62
+ private createFailure;
63
+ private createWarningMessage;
64
+ }
@@ -1,4 +1,24 @@
1
1
  import type { PimsApiConfig, PimsRequestOptions } from "./types";
2
+ export declare class PimsApiError extends Error {
3
+ readonly method: string;
4
+ readonly endpoint: string;
5
+ readonly url: string;
6
+ readonly httpStatus: number;
7
+ readonly statusText: string;
8
+ readonly body: string;
9
+ readonly parsedErrorMessage?: string;
10
+ readonly parsedErrorCode?: string;
11
+ readonly parsedTraceId?: string;
12
+ readonly parsedRequestId?: string;
13
+ constructor(details: {
14
+ method: string;
15
+ endpoint: string;
16
+ url: string;
17
+ httpStatus: number;
18
+ statusText: string;
19
+ body: string;
20
+ });
21
+ }
2
22
  export declare function pimsGet<T>(config: PimsApiConfig, path: string, options?: PimsRequestOptions): Promise<T>;
3
23
  export declare function pimsPost<T>(config: PimsApiConfig, path: string, body?: unknown, options?: PimsRequestOptions): Promise<T>;
4
24
  export declare function pimsPut<T>(config: PimsApiConfig, path: string, body?: unknown, options?: PimsRequestOptions): Promise<T>;
@@ -3,7 +3,7 @@
3
3
  * Provides common methods used by flow-tool, case-tool, and maestro-tool.
4
4
  */
5
5
  import type { IFileSystem } from "@uipath/filesystem";
6
- import type { BeginSessionResponse, DebugCallbacks, DebugInstanceResponse, DebugInstanceStatusResponse, DebugResult, InlineAgentDescriptor, OrchestratorApiConfig } from "./debug-types";
6
+ import type { BeginSessionResponse, DebugCallbacks, DebugInstanceResponse, DebugInstanceStatusResponse, DebugResult, InlineAgentDescriptor, OrchestratorApiConfig, StudioWebDebugConfig } from "./debug-types";
7
7
  /**
8
8
  * Thrown by {@link injectInlineAgentProcessEntries} when `FpsProperties`
9
9
  * is not valid JSON and inline agents need to be injected.
@@ -51,6 +51,40 @@ export interface PersonalFolderInfo {
51
51
  * Returns key, id, display name, fully qualified name, and parent key.
52
52
  */
53
53
  export declare function getPersonalFolderInfo(config: OrchestratorApiConfig): Promise<PersonalFolderInfo>;
54
+ export interface PrepareForCustomDebugParams {
55
+ config: StudioWebDebugConfig;
56
+ solutionId: string;
57
+ projectId: string;
58
+ solutionName: string;
59
+ folderKey: string;
60
+ sessionId?: string;
61
+ }
62
+ export interface PrepareForCustomDebugResponse {
63
+ solutionDebugId: string;
64
+ projectDebugId: string;
65
+ }
66
+ /**
67
+ * Prepare Studio Web debug IDs for a local workspace project.
68
+ *
69
+ * This mirrors Studio Web's injected Debug service
70
+ * `prepareForCustomDebug(projectId)`: it asks Studio Web Resource Builder to
71
+ * provision a cloud-backed debug solution/project and returns the IDs PIMS
72
+ * must use for execution.
73
+ */
74
+ export declare function prepareForCustomDebug(params: PrepareForCustomDebugParams): Promise<PrepareForCustomDebugResponse>;
75
+ /**
76
+ * Fetch folder info for a specific Orchestrator folder by numeric Id.
77
+ *
78
+ * Use when the caller already knows which folder to target (e.g. `--folder-id`
79
+ * was passed explicitly) and personal-workspace discovery is undesirable
80
+ * — service-principal / CI contexts often have `Folders.Read.PersonalWorkspace`
81
+ * denied while still permitting access to the specific folder being targeted.
82
+ *
83
+ * Hits `GET /odata/Folders({id})`, which returns a single FolderDto. The
84
+ * shape returned to callers matches {@link PersonalFolderInfo} so downstream
85
+ * connection patching / debug-instance creation does not branch on source.
86
+ */
87
+ export declare function getFolderInfoById(config: OrchestratorApiConfig, folderId: number): Promise<PersonalFolderInfo>;
54
88
  export interface BeginDebugSessionOptions {
55
89
  /** Inline agents to register with the debug session via FpsProperties. */
56
90
  inlineAgents?: InlineAgentDescriptor[];
@@ -19,6 +19,19 @@ export interface StudioWebDebugConfig {
19
19
  authToken: string;
20
20
  organizationUnitId?: number;
21
21
  organizationName: string;
22
+ /**
23
+ * Set when the caller has *explicitly* selected a folder (e.g. `uip maestro
24
+ * flow debug --folder-id 123`) and the personal-workspace discovery path
25
+ * should be skipped.
26
+ *
27
+ * Default discovery hits `GET /api/Folders/GetAllForCurrentUser` to find
28
+ * the user's personal workspace. That endpoint requires
29
+ * `Folders.Read.PersonalWorkspace`, which service-principal / CI tokens
30
+ * routinely lack — returning HTTP 403 and blocking debug entirely. When
31
+ * this field is set, the folder is fetched by ID via `/odata/Folders({id})`,
32
+ * which only requires read access to the specific folder being targeted.
33
+ */
34
+ userProvidedFolderId?: number;
22
35
  }
23
36
  export interface BeginSessionResponse {
24
37
  vncTunnelUri: string | null;
@@ -1,16 +1,18 @@
1
+ export type { BpmnFileValidationContext, BpmnFileValidator, BpmnProjectValidationContext, BpmnProjectValidator, BpmnValidateServiceOptions, BpmnValidationDiagnostic, BpmnValidationFileSystem, BpmnValidationResult, } from "./bpmn-validation/project-validator";
2
+ export { BpmnValidateService } from "./bpmn-validation/project-validator";
1
3
  export { pimsGet, pimsPatch, pimsPost, pimsPut } from "./client";
2
4
  export { createPimsConfig } from "./client-factory";
3
5
  export type { DebugApiService, MaestroHttpErrorDetails, } from "./debug-http-client";
4
6
  export { debugPimsGet, debugPimsPatch, debugPimsPost, debugPimsPut, MaestroHttpError, orchestratorGet, orchestratorPost, parseBackendErrorBody, studioWebDelete, studioWebPost, } from "./debug-http-client";
5
- export type { BeginDebugSessionOptions, PersonalFolderInfo, UploadAndDebugParams, } from "./debug-service";
6
- export { beginDebugSession, createDebugInstance, extractStartEventId, FpsPropertiesInjectionError, getPersonalFolderInfo, getPersonalFolderKey, injectInlineAgentProcessEntries, patchConnectionOverwrites, pollDebugInstanceStatus, uploadAndDebugSolution, } from "./debug-service";
7
+ export type { BeginDebugSessionOptions, PersonalFolderInfo, PrepareForCustomDebugParams, PrepareForCustomDebugResponse, UploadAndDebugParams, } from "./debug-service";
8
+ export { beginDebugSession, createDebugInstance, extractStartEventId, FpsPropertiesInjectionError, getFolderInfoById, getPersonalFolderInfo, getPersonalFolderKey, injectInlineAgentProcessEntries, patchConnectionOverwrites, pollDebugInstanceStatus, prepareForCustomDebug, uploadAndDebugSolution, } from "./debug-service";
7
9
  export type { BeginSessionResponse, BreakpointUpdateRequest, ContinueOnBreakpointRequest, DebugCallbacks, DebugGetAllVariablesResponse, DebugGetVariablesResponse, DebugIncidentResponse, DebugInstanceResponse, DebugInstanceStatusResponse, DebugInstanceStatusResult, DebugResult, DebugVariablesResponse, ElementExecution, InlineAgentDescriptor, OrchestratorApiConfig, PatchVariablesRequest, StudioWebDebugConfig, } from "./debug-types";
8
10
  export { parseJsonInputOrFile, readJsonFile, resolveJsonInput, } from "./json-input";
9
11
  export { BPMN_SPEC, SUPPORTED_UIPATH_EXTENSION_TAG_NAMES, SUPPORTED_UIPATH_EXTENSION_TAGS, } from "./manifest/bpmn-spec";
10
12
  export type { BpmnExtensionType, DiscoveredConnector, DiscoveredProcess, MaestroRegistry, RegistryMetadata, } from "./manifest/types";
11
13
  export { buildQueryString } from "./query-string";
12
14
  export type { CompactField, ConnectorInfo, ConnectorMethodInfo, ContextEntry, FieldReference, FilterCondition, FilterField, FilterOperator, ISField, ISFieldMethod, ISMetadata, ISMetadataParam, ParsedFilters, SyncMetadata, TriggerField, TriggerFieldEvent, TriggerObjectMetadata, } from "./registry/index.js";
13
- export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, enrichConnectorNode, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, FilterParseError, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorTriggerMetadata, filterNodes, getConnectorConfiguration, getConnectorInfo, getNode, getNodeEnriched, hashContent, isConnectorNode, isConnectorTriggerNode, listNodes, loadIndexMetadata, loadNodeIndex, MANAGED_HTTP_CONNECTOR_KEY, parseFilterString, pullNodes, pullRemoteNodes, registerRegistryCommand, resolveNodeStorageDir, saveIndexMetadata, saveNodeIndex, searchNodes, searchNodesWithFilters, searchWithFilters, } from "./registry/index.js";
15
+ export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, enrichConnectorNode, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, FilterParseError, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorTriggerMetadata, filterNodes, getConnectorConfiguration, getConnectorInfo, getNode, getNodeEnriched, hashContent, inlineMultipartFileValues, isConnectorNode, isConnectorTriggerNode, isKnownSdkNodeType, listKnownSdkNodes, listNodes, loadIndexMetadata, loadNodeIndex, MANAGED_HTTP_CONNECTOR_KEY, parseFilterString, pullNodes, pullRemoteNodes, registerRegistryCommand, resolveNodeStorageDir, saveIndexMetadata, saveNodeIndex, searchNodes, searchNodesWithFilters, searchWithFilters, } from "./registry/index.js";
14
16
  export { getEnrichedActivityMetadata, getExtensionType, getRegistry, pullRegistry, searchRegistry, } from "./registry/registry-service";
15
17
  export { CACHE_EXPIRATION_MS, loadRegistry, loadRegistryMetadata, saveRegistry, } from "./registry/storage";
16
18
  export type { DebugInstanceCommandsConfig } from "./shared-commands/debug-instances";
@@ -106,9 +106,11 @@ export interface DiscoveredProcess {
106
106
  key: string;
107
107
  name: string;
108
108
  processKey: string;
109
+ processVersion?: string;
109
110
  type: string;
110
111
  folder: string;
111
112
  folderKey: string;
113
+ feedId?: string;
112
114
  }
113
115
  /** The complete cached registry object. */
114
116
  export interface MaestroRegistry {
@@ -1 +1,2 @@
1
- export declare function buildQueryString(params: Record<string, string | number | undefined>): string;
1
+ export type QueryValue = string | number | undefined | string[];
2
+ export declare function buildQueryString(params: Record<string, QueryValue>): string;
@@ -1,9 +1,10 @@
1
- export { buildFeatureFlagResolver, FLAG_CONNECTOR_NODES, FLAG_EXTRACT_DOCUMENT, } from "../flags/manifest-flags.js";
1
+ export { buildFeatureFlagResolver, FLAG_CONNECTOR_NODES, FLAG_EXTRACT_DOCUMENT, FLAG_HITL, } from "../flags/manifest-flags.js";
2
2
  export { registerRegistryCommand } from "./command.js";
3
3
  export { filterNodes, searchWithFilters, } from "./filter-engine.js";
4
4
  export { FilterParseError, parseFilterString } from "./filter-parser.js";
5
- export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, enrichConnectorNode, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorTriggerMetadata, getConnectorConfiguration, getConnectorInfo, isConnectorNode, isConnectorTriggerNode, MANAGED_HTTP_CONNECTOR_KEY, } from "./integration-service-fetcher.js";
5
+ export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, enrichConnectorNode, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorTriggerMetadata, getConnectorConfiguration, getConnectorInfo, inlineMultipartFileValues, isConnectorNode, isConnectorTriggerNode, MANAGED_HTTP_CONNECTOR_KEY, } from "./integration-service-fetcher.js";
6
6
  export type { CompactField, ConnectorInfo, ConnectorMethodInfo, ContextEntry, FieldReference, ISField, ISFieldMethod, ISMetadata, ISMetadataParam, TriggerField, TriggerFieldEvent, TriggerObjectMetadata, } from "./integration-service-metadata.types";
7
+ export { isKnownSdkNodeType, listKnownSdkNodes } from "./known-types.js";
7
8
  export { hashContent, loadIndexMetadata, loadNodeIndex, resolveNodeStorageDir, type SyncMetadata, saveIndexMetadata, saveNodeIndex, } from "./node-storage.js";
8
9
  export { getNode, getNodeEnriched, listNodes, pullNodes, pullRemoteNodes, searchNodes, searchNodesWithFilters, } from "./node-sync-service.js";
9
10
  export type { SolutionContext } from "./solution-discovery.js";
@@ -1,6 +1,6 @@
1
1
  import type { NodeManifest } from "@uipath/flow-core";
2
2
  import type { CompactField, ConnectorConfiguration, ConnectorInfo, ISMetadata, TriggerObjectMetadata } from "./integration-service-metadata.types";
3
- export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, extractMultipartParameters, MANAGED_HTTP_CONNECTOR_KEY, } from "@uipath/integrationservice-sdk";
3
+ export { buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, extractMultipartParameters, inlineMultipartFileValues, MANAGED_HTTP_CONNECTOR_KEY, } from "@uipath/integrationservice-sdk";
4
4
  export declare function isConnectorNode(node: NodeManifest): boolean;
5
5
  export declare function isConnectorTriggerNode(node: NodeManifest): boolean;
6
6
  export declare function extractTriggerEventParameters(metadata: TriggerObjectMetadata, operationName: string): CompactField[];
@@ -0,0 +1,17 @@
1
+ import type { NodeManifest } from "@uipath/flow-core";
2
+ /**
3
+ * Cheap, network-free check: does the SDK bundle know about this node type?
4
+ *
5
+ * Case-insensitive match against the full OOTB + inline-agent catalog. Returns
6
+ * `true` when the type is something the platform supports (but may be gated
7
+ * for the current tenant), `false` when it is genuinely unknown.
8
+ */
9
+ export declare function isKnownSdkNodeType(nodeType: string): boolean;
10
+ /**
11
+ * Return every node manifest the SDK bundle knows about (OOTB + inline agents).
12
+ *
13
+ * Used by `registry list --all` to surface FF-gated nodes that exist in the
14
+ * SDK catalog but were filtered out of the tenant's manifest. The list is a
15
+ * fresh array per call so callers can mutate freely.
16
+ */
17
+ export declare function listKnownSdkNodes(): NodeManifest[];
@@ -10,5 +10,7 @@ export interface InstanceCommandsConfig {
10
10
  includeElementExecutions?: boolean;
11
11
  /** Whether --folder-key is required (default: true) */
12
12
  folderKeyRequired?: boolean;
13
+ /** Whether --folder-key is required for list (default: folderKeyRequired) */
14
+ listFolderKeyRequired?: boolean;
13
15
  }
14
16
  export declare const registerSharedInstanceCommands: (program: Command, config: InstanceCommandsConfig) => void;
@@ -1,2 +1,38 @@
1
1
  import type { PimsApiConfig } from "./types";
2
- export declare function withPimsCall<T>(fn: (config: PimsApiConfig) => Promise<T>, errorMessage: string): Promise<T | undefined>;
2
+ /**
3
+ * Optional metadata describing the resource being fetched. When provided, the
4
+ * helper formats a resource-aware 404 message (e.g. `"Incident not found: <id>"`)
5
+ * instead of falling back to the generic `errorMessage`.
6
+ */
7
+ export interface PimsResourceHint {
8
+ /** Resource label (e.g. `"incident"`, `"process"`, `"instance"`). Capitalised in the message. */
9
+ resource: string;
10
+ /** The resource identifier the caller looked up (e.g. the incident id). */
11
+ id?: string;
12
+ }
13
+ /**
14
+ * Wrap a PIMS API call. On failure, branches on HTTP status to surface a
15
+ * stable, machine-readable error envelope:
16
+ *
17
+ * | HTTP | Result | Code |
18
+ * |-----------------|-----------------------|-------------------------|
19
+ * | 404 | `Failure` | `NotFound` |
20
+ * | 401 | `AuthenticationError` | `Unauthorized` |
21
+ * | 403 | `AuthenticationError` | `Forbidden` |
22
+ * | 5xx | `Failure` | `ServerError_<status>` |
23
+ * | Other 4xx | `Failure` | `Http_<status>` |
24
+ * | Network failure | `Failure` | `NetworkError` |
25
+ * | Unknown shape | `Failure` | `UnknownError` |
26
+ * | Config failure | `Failure` | `ConfigError` |
27
+ *
28
+ * Pass {@link PimsResourceHint} (e.g. `{ resource: "incident", id }`) to get a
29
+ * resource-aware 404 message (`"Incident not found: <id>"`). When omitted, the
30
+ * helper falls back to `errorMessage`.
31
+ *
32
+ * For `PimsApiError`s the wire envelope also carries a `Context` block sourced
33
+ * from the typed error (`httpStatus`, `endpoint`, `method`, `errorCode`,
34
+ * `traceId`, `requestId` when present) and `Instructions` shaped by
35
+ * `pimsFailureInstructions`. Non-PimsApiError failures fall back to
36
+ * `extractErrorMessage(error)` for `Instructions` and emit no `Context`.
37
+ */
38
+ export declare function withPimsCall<T>(fn: (config: PimsApiConfig) => Promise<T>, errorMessage: string, hint?: PimsResourceHint): Promise<T | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "SDK for the UiPath Maestro (PIMS) API — process instance management.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,27 +31,26 @@
31
31
  },
32
32
  "./manifest/types": {
33
33
  "types": "./dist/src/manifest/types.d.ts"
34
+ },
35
+ "./bpmn-validation": {
36
+ "types": "./dist/src/bpmn-validation/project-validator.d.ts",
37
+ "import": "./dist/bpmn-validation/project-validator.js",
38
+ "default": "./dist/bpmn-validation/project-validator.js"
34
39
  }
35
40
  },
36
41
  "files": [
37
42
  "dist"
38
43
  ],
39
- "scripts": {
40
- "build": "bun build ./src/index.ts ./src/manifest/bpmn-spec.ts --outdir dist --format esm --target node && tsc -p tsconfig.build.json --noCheck",
41
- "test": "vitest run",
42
- "test:coverage": "vitest run --coverage",
43
- "lint": "biome check ."
44
- },
45
44
  "devDependencies": {
46
- "@uipath/auth": "1.0.2",
47
- "@uipath/common": "1.0.2",
48
- "@uipath/filesystem": "1.0.2",
45
+ "@uipath/auth": "1.1.0",
46
+ "@uipath/common": "1.1.0",
47
+ "@uipath/filesystem": "1.1.0",
49
48
  "@uipath/flow-core": "^0.2.205",
50
- "@uipath/integrationservice-sdk": "1.0.1",
51
- "@uipath/orchestrator-sdk": "1.0.0",
49
+ "@uipath/integrationservice-sdk": "1.1.0",
50
+ "@uipath/orchestrator-sdk": "1.1.0",
52
51
  "@types/node": "^25.5.2",
53
52
  "commander": "^14.0.3",
54
53
  "typescript": "^6.0.2"
55
54
  },
56
- "gitHead": "e373bfc1657e0bd85a7dc482691f4bda590392e5"
55
+ "gitHead": "06e8c8f566df4b87da4a008635483c62f64f33f0"
57
56
  }