@uipath/solution-tool 1.198.0-preview.90 → 1.199.0-preview.91

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 CHANGED
@@ -28,7 +28,7 @@ uip solution init --name MySolution
28
28
  uip solution upload <packagePath>
29
29
  uip solution deploy run --solution-name MySolution
30
30
  uip solution deploy status --solution-name MySolution
31
- uip solution project add --name MyProject
31
+ uip solution projects add ./my-solution/my-project ./my-solution/my-solution.uipx
32
32
  ```
33
33
 
34
34
  ### Deploying to Personal Workspace
@@ -0,0 +1,4 @@
1
+ import type { ExtendedPackageVersionState } from "@uipath/pipelines-sdk";
2
+ export declare const LOGIN_INSTRUCTIONS = "Run `uip login` to authenticate.";
3
+ export declare const PACKAGE_READY_STATES: ReadonlySet<ExtendedPackageVersionState>;
4
+ export declare function getPackageStateInstructions(state: ExtendedPackageVersionState): "Wait until package processing completes, then run the command again." | "Check the solution package contents and publish it again.";
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare const registerProjectAddCommand: (project: Command) => void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare const registerProjectImportCommand: (project: Command) => void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare const registerProjectListCommand: (project: Command) => void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare const registerProjectPublishCommand: (project: Command) => void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare const registerProjectRemoveCommand: (project: Command) => void;
@@ -0,0 +1,2 @@
1
+ import { type Command } from "commander";
2
+ export declare const registerProjectResyncCommand: (project: Command) => void;
@@ -0,0 +1,60 @@
1
+ export interface ProjectFileContent {
2
+ Name?: string;
3
+ ProjectType?: string;
4
+ designOptions?: {
5
+ outputType?: string;
6
+ };
7
+ functions?: Record<string, string>;
8
+ }
9
+ export interface SolutionProject {
10
+ Type: string;
11
+ ProjectRelativePath: string;
12
+ Id: string;
13
+ }
14
+ export interface SolutionFileContent {
15
+ Projects?: SolutionProject[];
16
+ }
17
+ export interface ProjectFileInfo {
18
+ filePath: string;
19
+ fileName: string;
20
+ useProjectJson: boolean;
21
+ }
22
+ export interface ParsedProjectFile {
23
+ content: ProjectFileContent;
24
+ projectType: string;
25
+ }
26
+ export interface ParsedSolutionFile {
27
+ solution: SolutionFileContent;
28
+ rawContent: string;
29
+ }
30
+ /**
31
+ * Finds the project manifest inside a directory, in priority order:
32
+ * project.uiproj, project.json, then uipath.json (code-first JS/TS Functions).
33
+ */
34
+ export declare function findProjectFile(projectDir: string): Promise<[Error, null] | [null, ProjectFileInfo]>;
35
+ /**
36
+ * Reads and parses a project manifest, extracting the project type.
37
+ */
38
+ export declare function readProjectFile(filePath: string, useProjectJson: boolean): Promise<[Error, null] | [null, ParsedProjectFile]>;
39
+ /**
40
+ * Reads and parses a solution .uipx file.
41
+ * Returns both the parsed object and the raw content (for rollback).
42
+ */
43
+ export declare function readSolutionFile(filePath: string): Promise<[Error, null] | [null, ParsedSolutionFile]>;
44
+ /**
45
+ * Resolves the solution file path — either from an explicit option or by searching upward.
46
+ */
47
+ export declare function resolveSolutionFilePath(solutionFileOption: string | undefined, searchStartDir: string): Promise<[Error, null] | [null, string]>;
48
+ /**
49
+ * Writes the solution object back to disk as formatted JSON.
50
+ */
51
+ export declare function writeSolutionFile(filePath: string, solution: SolutionFileContent): Promise<Error | null>;
52
+ /**
53
+ * Restores the exact solution file content captured before a write.
54
+ */
55
+ export declare function restoreSolutionFile(filePath: string, rawContent: string): Promise<Error | null>;
56
+ /**
57
+ * Creates a project in the solution builder (resource builder services).
58
+ * Handles service init, builder creation, createProjectAsync, and dispose.
59
+ */
60
+ export declare function createProjectInSolutionBuilder(solutionDir: string, projectId: string, projectName: string, projectType: string): Promise<Error | null>;
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function findSolutionFile(startDir: string): Promise<string>;
3
+ export declare const registerProjectCommand: (program: Command) => void;
package/dist/deploy.js CHANGED
@@ -28203,6 +28203,7 @@ function settlePromiseLike(thenable) {
28203
28203
  var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
28204
28204
  var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
28205
28205
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
28206
+ var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
28206
28207
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
28207
28208
  var NETWORK_ERROR_CODES = new Set([
28208
28209
  "ECONNREFUSED",
@@ -28304,6 +28305,9 @@ function classifyError(status, error) {
28304
28305
  if (status === 405) {
28305
28306
  return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
28306
28307
  }
28308
+ if (status === 413) {
28309
+ return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
28310
+ }
28307
28311
  if (status === 408) {
28308
28312
  return { errorCode: "timeout", retry: "RetryLater" };
28309
28313
  }
@@ -28381,6 +28385,8 @@ async function extractErrorDetails(error, options) {
28381
28385
  result = "AuthenticationError";
28382
28386
  } else if (status === 405) {
28383
28387
  message = DEFAULT_405;
28388
+ } else if (status === 413) {
28389
+ message = DEFAULT_413;
28384
28390
  } else if (status === 400 || status === 422) {
28385
28391
  message = formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus);
28386
28392
  result = "ValidationError";
@@ -35031,6 +35037,7 @@ var SKILL_ATTRIBUTION = attributionRecord([
35031
35037
  var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
35032
35038
  var COMMAND_ATTRIBUTION = commandAttribution([
35033
35039
  ["cli", "troubleshoot", ["uip.feedback"]],
35040
+ ["llm-gateway", "operate", ["uip.llm-gateway"]],
35034
35041
  ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
35035
35042
  ["context-grounding", "build", ["uip.context-grounding"]],
35036
35043
  ["api-workflow", "build", ["uip.api-workflow"]],
@@ -36212,7 +36219,7 @@ class TextApiResponse {
36212
36219
  var package_default = {
36213
36220
  name: "@uipath/pipelines-sdk",
36214
36221
  license: "MIT",
36215
- version: "1.198.0",
36222
+ version: "1.199.0",
36216
36223
  description: "Generated TypeScript client for UiPath Pipelines API (CI/CD deployment lifecycle)",
36217
36224
  repository: {
36218
36225
  type: "git",
@@ -37627,7 +37634,7 @@ class JSONApiResponse2 {
37627
37634
  var package_default2 = {
37628
37635
  name: "@uipath/solution-sdk",
37629
37636
  license: "MIT",
37630
- version: "1.198.0-preview.90",
37637
+ version: "1.199.0-preview.91",
37631
37638
  repository: {
37632
37639
  type: "git",
37633
37640
  url: "https://github.com/UiPath/cli.git",
@@ -38458,6 +38465,39 @@ async function findDeploymentByName(auth, deploymentName) {
38458
38465
  skip += values.length;
38459
38466
  }
38460
38467
  }
38468
+ async function findDeploymentByPackageName(auth, packageName, folderPath, scope) {
38469
+ const [lookupError, deployment] = await catchError((async () => {
38470
+ const api = new SearchApi(new Configuration2({
38471
+ basePath: auth.basePath,
38472
+ accessToken: auth.accessToken
38473
+ }));
38474
+ const take = 50;
38475
+ for (let skip = 0;; ) {
38476
+ const result = await api.searchSearchDeployments22({
38477
+ deploymentsSearchRequest2: {
38478
+ searchTerm: packageName,
38479
+ take,
38480
+ skip,
38481
+ operationStatuses: [],
38482
+ activationStatuses: []
38483
+ }
38484
+ }, scope);
38485
+ const values = result.values ?? [];
38486
+ const match = values.find((deployment2) => deployment2.packageName === packageName && (folderPath === undefined || deployment2.folderPath === folderPath));
38487
+ if (match) {
38488
+ return match;
38489
+ }
38490
+ if (values.length < take) {
38491
+ return;
38492
+ }
38493
+ skip += values.length;
38494
+ }
38495
+ })());
38496
+ if (lookupError) {
38497
+ return;
38498
+ }
38499
+ return deployment;
38500
+ }
38461
38501
  async function findDeploymentForError(auth, deploymentName) {
38462
38502
  const [lookupError, deployment] = await catchError(findDeploymentByName(auth, deploymentName));
38463
38503
  if (lookupError) {
@@ -38674,6 +38714,7 @@ var resolveConfigAsync = async ({
38674
38714
  customAuthority,
38675
38715
  customClientId,
38676
38716
  customClientSecret,
38717
+ customClientAssertion,
38677
38718
  customScopes
38678
38719
  } = {}) => {
38679
38720
  const fileAuth = getAuthFileConfig();
@@ -38699,7 +38740,7 @@ var resolveConfigAsync = async ({
38699
38740
  if (!clientSecret && fileAuth.clientSecret) {
38700
38741
  clientSecret = fileAuth.clientSecret;
38701
38742
  }
38702
- const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && Boolean(clientSecret);
38743
+ const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
38703
38744
  const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
38704
38745
  return {
38705
38746
  clientId,
@@ -39817,7 +39858,6 @@ var getAuthContext = async (options = {}) => {
39817
39858
  tenantName
39818
39859
  };
39819
39860
  };
39820
-
39821
39861
  // ../auth/src/index.ts
39822
39862
  init_constants();
39823
39863
 
@@ -40167,7 +40207,7 @@ class TextApiResponse3 {
40167
40207
  var package_default3 = {
40168
40208
  name: "@uipath/orchestrator-sdk",
40169
40209
  license: "MIT",
40170
- version: "1.198.0",
40210
+ version: "1.199.0",
40171
40211
  repository: {
40172
40212
  type: "git",
40173
40213
  url: "https://github.com/UiPath/cli.git",
@@ -42758,8 +42798,8 @@ async function listDeploymentsAsync(options = {}) {
42758
42798
  skip: offset,
42759
42799
  orderByColumn: options.sortBy ?? "startTime",
42760
42800
  orderByDirection: options.sortOrder ?? "Descending",
42761
- operationStatuses: [],
42762
- activationStatuses: []
42801
+ operationStatuses: options.operationStatuses ?? [],
42802
+ activationStatuses: options.activationStatuses ?? []
42763
42803
  }
42764
42804
  }));
42765
42805
  if (listError) {
@@ -42776,11 +42816,16 @@ async function listDeploymentsAsync(options = {}) {
42776
42816
  name: d.name,
42777
42817
  packageName: d.packageName,
42778
42818
  packageVersion: d.packageVersion,
42819
+ currentPackageVersion: d.currentPackageVersion,
42820
+ targetPackageVersion: d.targetPackageVersion,
42821
+ newPackageVersionAvailable: d.newPackageVersionAvailable,
42822
+ operation: d.operation,
42779
42823
  operationStatus: d.operationStatus,
42780
42824
  activationStatus: d.activationStatus,
42781
42825
  folderPath: d.folderPath,
42782
42826
  installedRootFolderKey: d.installedRootFolderKey,
42783
- deploymentCreationTime: d.deploymentCreationTime
42827
+ deploymentCreationTime: d.deploymentCreationTime,
42828
+ actions: d.actions ?? []
42784
42829
  }));
42785
42830
  return { ok: true, deployments, limit, offset, total: result.count };
42786
42831
  }
@@ -43079,13 +43124,57 @@ async function deployRunAsync(options) {
43079
43124
  const finalInstanceId = activationInstanceId == null ? baseSuccess.instanceId : activationInstanceId;
43080
43125
  return { ...baseSuccess, activationStatus, instanceId: finalInstanceId };
43081
43126
  }
43127
+ var EXISTING_DEPLOYMENT_MARKER = "Deployment exists in a failed or running state";
43128
+ function isExistingDeploymentConflict(httpStatus, message, details, parsedErrors) {
43129
+ if (httpStatus !== 400) {
43130
+ return false;
43131
+ }
43132
+ if (message.includes(EXISTING_DEPLOYMENT_MARKER) || details.includes(EXISTING_DEPLOYMENT_MARKER)) {
43133
+ return true;
43134
+ }
43135
+ if (parsedErrors) {
43136
+ for (const fieldMessages of Object.values(parsedErrors)) {
43137
+ if (fieldMessages.some((m) => m.includes(EXISTING_DEPLOYMENT_MARKER))) {
43138
+ return true;
43139
+ }
43140
+ }
43141
+ }
43142
+ return false;
43143
+ }
43144
+ function buildDeploymentExistsInstructions(packageName, existing) {
43145
+ const base = `A deployment for '${packageName}' already exists and cannot be redeployed — it must be upgraded in place. ` + "For now, open the deployment in the Orchestrator UI and use the Upgrade button. " + "Run 'uip solution deploy list' to see the pending state — the Operation and TargetPackageVersion columns show whether an upgrade is queued.";
43146
+ if (!existing) {
43147
+ return base;
43148
+ }
43149
+ const target = existing.targetPackageVersion ?? existing.newPackageVersionAvailable;
43150
+ const detail = existing.currentPackageVersion && target ? ` Existing deployment '${existing.name}' is at ${existing.currentPackageVersion} and can be upgraded to ${target}.` : ` Existing deployment: '${existing.name}'.`;
43151
+ return `${base}${detail}`;
43152
+ }
43082
43153
  async function deployRunPersonalWorkspaceAsync(auth, options) {
43083
43154
  const [pwError, result] = await catchError(deployToPersonalWorkspace(auth, {
43084
43155
  packageName: options.packageName,
43085
43156
  packageVersion: options.packageVersion
43086
43157
  }, { tenant: options.tenant, loginValidity: options.loginValidity }));
43087
43158
  if (pwError) {
43088
- const { message, details } = await extractErrorDetails(pwError);
43159
+ const { message, details, context, parsedErrors } = await extractErrorDetails(pwError);
43160
+ if (isExistingDeploymentConflict(context?.httpStatus, message, details, parsedErrors)) {
43161
+ const [pwResolveError, pw] = await catchError(resolvePersonalWorkspace({
43162
+ tenant: options.tenant,
43163
+ loginValidity: options.loginValidity,
43164
+ envFilePath: options.envFilePath
43165
+ }));
43166
+ let scope;
43167
+ if (!pwResolveError && pw) {
43168
+ scope = async ({ init }) => ({
43169
+ headers: {
43170
+ ...init.headers,
43171
+ "X-UIPATH-FolderKey": pw.key
43172
+ }
43173
+ });
43174
+ }
43175
+ const existing = await findDeploymentByPackageName(auth, options.packageName, undefined, scope);
43176
+ return fail3("deployment_exists", message, buildDeploymentExistsInstructions(options.packageName, existing));
43177
+ }
43089
43178
  return fail3("personal_workspace_deploy_failed", message, `Ensure the package was published to your Personal Workspace first: uip solution publish <package> --personal-workspace. Details: ${details}`);
43090
43179
  }
43091
43180
  return {
@@ -43225,4 +43314,4 @@ export {
43225
43314
  activateDeploymentAsync
43226
43315
  };
43227
43316
 
43228
- //# debugId=AA29699FF79050B164756E2164756E21
43317
+ //# debugId=52C258386E8C27F364756E2164756E21
package/dist/init.d.ts CHANGED
@@ -1,6 +1,14 @@
1
1
  /**
2
2
  * Public `@uipath/solution-tool/init` entry: the programmatic init service for SDK
3
3
  * consumers, without the CLI side effects of `tool.ts`. Mirrors `@uipath/flow-tool/validation`.
4
+ *
5
+ * Also re-exports `addProjectArtifactsToSolutionAsync` so `*-tool init` paths
6
+ * (flow, maestro, agent, case) can generate the `resources/solution_folder/process/<kind>/`
7
+ * artifact-resource entries that `uip solution project add` produces. Without
8
+ * this step, init succeeds but `solution pack` would later miss the artifact
9
+ * resources, forcing a `solution project remove` + `add` recovery cycle.
4
10
  */
11
+ export type { AddProjectArtifactsOptions, ProjectArtifactsResult, } from "./services/project-artifacts-service";
12
+ export { addProjectArtifactsToSolutionAsync } from "./services/project-artifacts-service";
5
13
  export type { SolutionInitOptions, SolutionInitResult, SolutionInitStage, } from "./services/solution-init-service";
6
14
  export { SolutionInitError, solutionInitAsync, } from "./services/solution-init-service";