@uipath/solution-sdk 1.206.0-preview.303 → 1.207.0-preview.305

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.
@@ -1,8 +1,19 @@
1
1
  /**
2
2
  * Utilities for reading, finding, and updating .uipx solution files.
3
3
  */
4
+ import { type CliErrorCode } from "@uipath/common";
4
5
  import type { IFileSystem } from "@uipath/filesystem";
5
6
  import type { UipxFile, UipxProject } from "./types";
7
+ /**
8
+ * A `.uipx` that cannot be found or read, classified at the source. Carries
9
+ * `errorCode` duck-typed (`carriedErrorCode`), so a command that reports it
10
+ * with `reportFailure` gets `not_found` / `invalid_argument` instead of the
11
+ * `unknown_error` a bare `Error` falls back to.
12
+ */
13
+ export declare class SolutionFileError extends Error {
14
+ readonly errorCode: CliErrorCode;
15
+ constructor(message: string, errorCode: CliErrorCode);
16
+ }
6
17
  /**
7
18
  * Outcome of attempting to register a project in its parent `.uipx` solution.
8
19
  *
@@ -154,8 +165,10 @@ export interface PrepareProjectLocationResult {
154
165
  * - No parent solution found → scaffold `<baseDir>/<projectName>Solution/`
155
166
  * and return its nested project path.
156
167
  *
157
- * The four `*-init` tools (agent / case / flow / maestro bpmn) share this
158
- * helper so the auto-scaffold behavior stays uniform.
168
+ * The member `*-init` tools (agent / case / flow / maestro bpmn / codedapp)
169
+ * share this helper so the auto-scaffold behavior stays uniform. `function
170
+ * init` deliberately does not: it initializes a project already on disk, so
171
+ * there is no new directory to place inside a solution.
159
172
  */
160
173
  export declare function prepareProjectLocation(fs: IFileSystem, candidateProjectDir: string, projectName: string, options?: PrepareProjectLocationOptions): Promise<PrepareProjectLocationResult>;
161
174
  /**
@@ -163,11 +176,18 @@ export declare function prepareProjectLocation(fs: IFileSystem, candidateProject
163
176
  * Accepts a directory path or a .uipx file path.
164
177
  */
165
178
  export declare function resolveSolutionDir(fs: IFileSystem, inputPath: string): string;
179
+ /** What {@link updateUipxSolutionId} changed, in the shape commands report it. */
180
+ export interface UipxSolutionIdUpdate {
181
+ Path: string;
182
+ From?: string;
183
+ To: string;
184
+ }
166
185
  /**
167
- * Update the SolutionId in a .uipx file at a known path.
168
- * Called after successful upload to ensure subsequent uploads use overwrite.
186
+ * Point a .uipx at a Studio Web SolutionId, leaving the rest of the file's
187
+ * bytes alone. Returns what changed, or undefined when the file already had
188
+ * that id or could not be updated.
169
189
  */
170
- export declare function updateUipxSolutionId(fs: IFileSystem, uipxPath: string, newSolutionId: string): Promise<void>;
190
+ export declare function updateUipxSolutionId(fs: IFileSystem, uipxPath: string, newSolutionId: string): Promise<UipxSolutionIdUpdate | undefined>;
171
191
  /**
172
192
  * Find the .uipx solution file in the parent directory of a project path.
173
193
  * Returns the solutionId and projectId, or undefined if not found.
@@ -180,7 +200,7 @@ export declare function findSolutionFile(fs: IFileSystem, projectPath: string):
180
200
  * Update the .uipx solution file in the parent directory of a project path.
181
201
  * Scans the parent dir for a .uipx file and updates its SolutionId.
182
202
  */
183
- export declare function updateSolutionFile(fs: IFileSystem, projectPath: string, newSolutionId: string): Promise<void>;
203
+ export declare function updateSolutionFile(fs: IFileSystem, projectPath: string, newSolutionId: string): Promise<UipxSolutionIdUpdate | undefined>;
184
204
  export declare function tryRegisterProjectInParentSolution(fs: IFileSystem, projectDir: string, options?: RegisterProjectOptions): Promise<ProjectSolutionRegistration>;
185
205
  export type ParentSolutionDiscovery = {
186
206
  status: "found";
@@ -228,6 +248,16 @@ export declare function readSolutionManifest(fs: IFileSystem, solutionFile: stri
228
248
  * project path and the manifest path is far more actionable.
229
249
  */
230
250
  export declare function isProjectRegisteredInSolution(fs: IFileSystem, projectDir: string, solutionFile: string): Promise<boolean>;
251
+ /**
252
+ * The folder of the `projects` entry that is `projectDir`, relative to
253
+ * `solutionDir` and spelled as the manifest lists it (forward slashes), or
254
+ * `undefined` when no entry is. Entries match by real path, so a symlinked or
255
+ * differently cased spelling still finds the project (see
256
+ * {@link isProjectRegisteredInSolution}).
257
+ */
258
+ export declare function findListedProjectDir(fs: IFileSystem, solutionDir: string, projectDir: string, projects: readonly {
259
+ ProjectRelativePath?: string;
260
+ }[]): Promise<string | undefined>;
231
261
  /**
232
262
  * Walks up from `startDir` to the filesystem root, returning the path of the
233
263
  * single `.uipx` solution file found. Throws when none — or more than one in a
@@ -1,19 +1,3 @@
1
- /**
2
- * Studio Web import-contract knowledge, kept out of the generic bundler.
3
- *
4
- * Studio Web's solution import accepts only `project.uiproj`-manifested
5
- * projects for API Workflows: it drops a `project.json` Api project from a
6
- * mixed solution, and fails an Api-only solution with HTTP 400 code 20001
7
- * ("the project archive is corrupt or the compression isn't supported").
8
- * Studio-Web-bound bundlers pass {@link assertStudioWebCompatibleProjects}
9
- * to `bundleSolution`'s `validateProjects` hook so the defect is caught
10
- * client-side, with its real cause, before anything is uploaded.
11
- * UV-15161 / STUD-81261.
12
- *
13
- * This module is the rule's single shared home: tool packages must not
14
- * import each other, so the two Studio-Web-bound callers (solution-tool's
15
- * upload, agent-tool's debug) can only share the rule through solution-sdk.
16
- */
17
1
  import type { UipxProject } from "./types";
18
2
  /**
19
3
  * Thrown by {@link assertStudioWebCompatibleProjects} when the `.uipx`
@@ -30,3 +14,22 @@ export declare class StudioWebIncompatibleProjectError extends Error {
30
14
  * methods — a malformed value falls through to the regular bundle path.
31
15
  */
32
16
  export declare function assertStudioWebCompatibleProjects(projects: UipxProject[]): void;
17
+ /**
18
+ * Thrown by {@link assertStudioWebValidFileNames} when a project file's name
19
+ * holds a character Studio Web refuses.
20
+ */
21
+ export declare class StudioWebInvalidFileNameError extends Error {
22
+ readonly offendingPaths: string[];
23
+ constructor(offendingPaths: string[]);
24
+ }
25
+ /**
26
+ * Throws {@link StudioWebInvalidFileNameError} when the name of a file inside
27
+ * a project folder holds a character Studio Web refuses: an overwrite then
28
+ * fails with HTTP 500 code 20039 ("Path contains invalid characters") and an
29
+ * import with HTTP 400 code 20001 ("No projects were successfully imported"),
30
+ * and neither names the file. Measured on staging for each of `: * ? " < > |`
31
+ * and a control character. Only the last segment of each path is checked: a
32
+ * folder name holding one is accepted, and so is a file outside the project
33
+ * folders. STUD-81955.
34
+ */
35
+ export declare function assertStudioWebValidFileNames(projectFilePaths: string[]): void;
@@ -12,8 +12,16 @@ export interface SolutionImportResponse {
12
12
  id: string;
13
13
  solutionId?: string;
14
14
  projects: Array<{
15
+ /** The project id Studio Web assigned. */
15
16
  id: string;
16
17
  name: string;
18
+ /**
19
+ * The `.uipx` member id Studio Web stored as the project's design id
20
+ * when it imported the solution. `null` for a solution imported before
21
+ * Studio Web kept one; `Solution_GetSolution` backfills it, the import
22
+ * and overwrite responses do not.
23
+ */
24
+ designId?: string | null;
17
25
  }>;
18
26
  }
19
27
  /** A project of a Studio Web solution, as returned by Solution_GetSolution. */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/solution-sdk",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.303",
5
+ "version": "1.207.0-preview.305",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/UiPath/cli.git",
@@ -43,6 +43,10 @@
43
43
  "./project-context": {
44
44
  "types": "./dist/src/project-context.d.ts",
45
45
  "default": "./dist/project-context.js"
46
+ },
47
+ "./invocation-graph": {
48
+ "types": "./dist/src/invocation-graph.d.ts",
49
+ "default": "./dist/invocation-graph.js"
46
50
  }
47
51
  },
48
52
  "bin": {
@@ -52,5 +56,5 @@
52
56
  "dist"
53
57
  ],
54
58
  "private": false,
55
- "gitHead": "7d17b8a3c1a50892d42c9302087abc8307b04409"
59
+ "gitHead": "1600aa89255c37c1b8bc68d9882c3395c1d5bff4"
56
60
  }