@uipath/solution-sdk 1.201.0-preview.133 → 1.202.0-preview.134

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.
@@ -3,7 +3,8 @@
3
3
 
4
4
  // src/scripts/generate-sdk.ts
5
5
  import { execSync } from "child_process";
6
- import { mkdir, rm, writeFile } from "fs/promises";
6
+ import { existsSync } from "fs";
7
+ import { mkdir, readFile, rm, writeFile } from "fs/promises";
7
8
  import { dirname, join } from "path";
8
9
  import { fileURLToPath } from "url";
9
10
  var SWAGGER_URL = "https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_/swagger/v1.0/swagger.json";
@@ -20,12 +21,32 @@ var IGNORED_GENERATOR_OUTPUTS = [
20
21
  ".gitignore"
21
22
  ];
22
23
  async function downloadSwagger() {
23
- console.log("Downloading swagger.json...");
24
- const response = await fetch(SWAGGER_URL);
25
- if (!response.ok) {
26
- throw new Error(`Failed to download swagger: ${response.statusText}`);
24
+ const savedSpec = join(GENERATE_DIR, "swagger.json");
25
+ if (!process.argv.includes("--offline")) {
26
+ console.log("Downloading swagger.json...");
27
+ const [error, swagger] = await tryFetchSwagger();
28
+ if (!error) {
29
+ return swagger;
30
+ }
31
+ console.warn(`Download failed (${error}); falling back to ${savedSpec}`);
32
+ } else {
33
+ console.log(`--offline: reading ${savedSpec}`);
34
+ }
35
+ if (!existsSync(savedSpec)) {
36
+ throw new Error(`No swagger available: download failed and ${savedSpec} is missing.`);
37
+ }
38
+ return JSON.parse(await readFile(savedSpec, "utf-8"));
39
+ }
40
+ async function tryFetchSwagger() {
41
+ try {
42
+ const response = await fetch(SWAGGER_URL);
43
+ if (!response.ok) {
44
+ return [response.statusText, undefined];
45
+ }
46
+ return [undefined, await response.json()];
47
+ } catch (err) {
48
+ return [err instanceof Error ? err.message : String(err), undefined];
27
49
  }
28
- return await response.json();
29
50
  }
30
51
  function filterSwaggerPaths(swagger) {
31
52
  const filteredPaths = {};
@@ -50,6 +71,8 @@ function filterSwaggerPaths(swagger) {
50
71
  const explicitlyIncludedPaths = [
51
72
  "/api/deployments/{deploymentKey}",
52
73
  "/api/deployments/{deploymentKey}/upgrade",
74
+ "/api/deployments/{deploymentKey}/run",
75
+ "/api/deployments/{deploymentKey}/validation-result",
53
76
  "/api/deployments/deploy",
54
77
  "/api/search/packages",
55
78
  "/api/v3/search/deployments"
@@ -176,4 +199,4 @@ export {
176
199
  main as generateSdk
177
200
  };
178
201
 
179
- //# debugId=D1A97AA940E1052064756E2164756E21
202
+ //# debugId=DC425A840998D54264756E2164756E21
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
28
30
  if (canCache)
29
31
  cache.set(mod, to);
30
32
  return to;
@@ -432,9 +434,9 @@ var init_is_in_ssh = __esm(() => {
432
434
  // ../../node_modules/open/index.js
433
435
  var exports_open = {};
434
436
  __export(exports_open, {
435
- openApp: () => openApp,
437
+ apps: () => apps,
436
438
  default: () => open_default,
437
- apps: () => apps
439
+ openApp: () => openApp
438
440
  });
439
441
  import process8 from "node:process";
440
442
  import path from "node:path";
@@ -982,7 +984,7 @@ class InvalidBaseUrlError extends Error {
982
984
  super(`Invalid base URL: "${url}"
983
985
  ` + `Reason: ${reason}
984
986
 
985
- ` + `Expected format: an https:// URL, e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
987
+ ` + `Expected format: an https:// URL (or bare host — https:// is assumed), e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
986
988
  ` + `You can specify the URL via:
987
989
  ` + ` • --authority flag
988
990
  ` + ` • UIPATH_URL environment variable
@@ -1003,10 +1005,16 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
1003
1005
  while (baseUrl.endsWith("/")) {
1004
1006
  baseUrl = baseUrl.slice(0, -1);
1005
1007
  }
1008
+ const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(baseUrl);
1009
+ const [hostCandidate] = baseUrl.split(/[/?#]/, 1);
1010
+ if (!hasScheme && hostCandidate.includes(".")) {
1011
+ baseUrl = `https://${baseUrl}`;
1012
+ }
1006
1013
  const resolvedBaseUrl = baseUrl;
1007
1014
  const [urlError, url] = catchError(() => new URL(resolvedBaseUrl));
1008
1015
  if (urlError) {
1009
- throw new InvalidBaseUrlError(baseUrl, `Malformed URL. ${urlError instanceof Error ? urlError.message : "Unknown error"}`);
1016
+ const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
1017
+ throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
1010
1018
  }
1011
1019
  if (url.protocol !== "https:") {
1012
1020
  throw new InvalidBaseUrlError(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
@@ -1293,6 +1301,17 @@ var requireEnv = (name) => {
1293
1301
  }
1294
1302
  return value;
1295
1303
  };
1304
+ var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
1305
+ var resolveBaseUrl = (rawUrl, failureContext) => {
1306
+ const [baseUrlError, baseUrl] = catchError(() => normalizeAndValidateBaseUrl(rawUrl));
1307
+ if (baseUrlError) {
1308
+ if (baseUrlError instanceof InvalidBaseUrlError) {
1309
+ throw baseUrlError;
1310
+ }
1311
+ throw new EnvAuthConfigError(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
1312
+ }
1313
+ return baseUrl;
1314
+ };
1296
1315
  var readAuthFromEnv = () => {
1297
1316
  const accessToken = requireEnv(ENV_AUTH_VARS.token);
1298
1317
  const organizationName = requireEnv(ENV_AUTH_VARS.organizationName);
@@ -1301,19 +1320,29 @@ var readAuthFromEnv = () => {
1301
1320
  const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
1302
1321
  const [parseError, payload] = catchError(() => parseJWT(accessToken));
1303
1322
  if (parseError) {
1304
- throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a valid JWT: ` + `${parseError instanceof Error ? parseError.message : String(parseError)}`);
1323
+ const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
1324
+ const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
1325
+ if (!rawUrl) {
1326
+ throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
1327
+ }
1328
+ const baseUrl2 = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
1329
+ return {
1330
+ loginStatus: "Logged in",
1331
+ accessToken,
1332
+ baseUrl: baseUrl2,
1333
+ organizationName,
1334
+ organizationId,
1335
+ tenantName,
1336
+ tenantId,
1337
+ source: "env-vars" /* EnvironmentVariables */,
1338
+ hint: "Token is opaque (not a JWT) - expiration and identity cannot be " + "determined locally. Commands will fail with 401 once it is revoked or " + `expired. If this was meant to be a JWT instead of a PAT, note: ${parseErrorMessage}`
1339
+ };
1305
1340
  }
1306
1341
  const iss = payload.iss;
1307
1342
  if (typeof iss !== "string" || iss.length === 0) {
1308
1343
  throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
1309
1344
  }
1310
- const [baseUrlError, baseUrl] = catchError(() => normalizeAndValidateBaseUrl(iss));
1311
- if (baseUrlError) {
1312
- if (baseUrlError instanceof InvalidBaseUrlError) {
1313
- throw baseUrlError;
1314
- }
1315
- throw new EnvAuthConfigError(`Failed to derive server URL from token 'iss' claim: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
1316
- }
1345
+ const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
1317
1346
  const expiration = getTokenExpiration(accessToken);
1318
1347
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
1319
1348
  const identity = resolveSessionIdentity(accessToken);
@@ -2256,6 +2285,7 @@ init_constants();
2256
2285
 
2257
2286
  // ../auth/src/interactive.ts
2258
2287
  init_src();
2288
+ init_constants();
2259
2289
  // ../auth/src/tenantSelection.ts
2260
2290
  var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
2261
2291
 
@@ -2291,4 +2321,4 @@ export {
2291
2321
  getSolutionAuthContext
2292
2322
  };
2293
2323
 
2294
- //# debugId=C583A49A0405670664756E2164756E21
2324
+ //# debugId=816F278E3910A4D864756E2164756E21
@@ -8,7 +8,9 @@ export { type PackageVersionSearchFilter, type PackageVersionSearchRow, type Pac
8
8
  export type { AutoCreatedSolution, ParentSolutionDiscovery, PrepareProjectLocationOptions, PrepareProjectLocationResult, ProjectSolutionRegistration, RegisterProjectOptions, SolutionManifestCreation, } from "./solution-file";
9
9
  export { autoScaffoldSolution, createSolutionManifest, findNearestParentUipxFile, findSolutionFile, findSolutionFileUpward, isProjectRegisteredInSolution, normalizeProjectType, prepareProjectLocation, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
10
10
  export { getStudioWebSolutionProjects, type ListStudioWebSolutionsOptions, listStudioWebSolutions, type StudioWebSolutionsPage, } from "./solution-info";
11
+ export { StudioWebIncompatibleProjectError } from "./studio-web-compat";
11
12
  export type { BundleResult, SolutionImportResponse, StudioWebConfig, StudioWebSolutionProject, UipxFile, UipxProject, } from "./types";
12
- export { importSolution, overwriteSolution, solutionExistsOnStudioWeb, uploadOrOverwriteSolution, } from "./upload-service";
13
+ export type { SolutionUploadOperation } from "./upload-service";
14
+ export { buildSolutionUploadFailureOutput, importSolution, isSolutionUploadHttpError, overwriteSolution, SolutionUploadHttpError, solutionExistsOnStudioWeb, uploadOrOverwriteSolution, } from "./upload-service";
13
15
  export { SDK_USER_AGENT } from "./user-agent.js";
14
16
  export { collectFiles, createZipFromDir } from "./zip-utils";
@@ -25,3 +25,39 @@ export declare function normalizeFolderPath(path: string | undefined): string |
25
25
  * the virtual idempotency check, and `resources add --source local`.
26
26
  */
27
27
  export declare function findMatchingLocalResource(resources: ResourceDefinition[], kind: string, name: string, folderPath: string | undefined): ResourceDefinition | undefined;
28
+ /**
29
+ * Find the member artefact declaration covering (kind, name | name_<N>) —
30
+ * folder-agnostic on purpose.
31
+ *
32
+ * A solution provisions its own members wherever it is installed, so a
33
+ * binding that names a member must resolve to that member's declaration no
34
+ * matter which cloud folder the binding points at. Without this, a binding
35
+ * carrying a real folder (the folder the solution is deployed into) escapes
36
+ * the solution-relative guard, the RCS lookup finds the DEPLOYED member, and
37
+ * every `pack`/`upload` imports it as a fresh `name_<N>` clone plus a
38
+ * feed-pinned package declaration (UV-15817).
39
+ */
40
+ export declare function findMatchingMemberResource(resources: ResourceDefinition[], kind: string, name: string, memberProjectKeys: ReadonlySet<string>): ResourceDefinition | undefined;
41
+ /**
42
+ * Collect the imported `name_<N>` clones of member artefact declarations — the
43
+ * ones an earlier `pack`/`upload` accumulated before the guard above existed.
44
+ *
45
+ * This list gets deleted, so every condition is there to keep a resource the
46
+ * author meant to keep out of it. A clone must:
47
+ *
48
+ * - not be an artefact declaration itself (no `projectKey`) — those belong to
49
+ * a project and the SDK refuses to delete them anyway;
50
+ * - carry a `package`-kind dependency. An import of a deployed project drags
51
+ * the feed package in with it; a `resources add --source local` stub has no
52
+ * dependencies at all. This is what separates a clone from a `name_<N>`
53
+ * resource an author created on purpose, and root scope cannot: the SDK
54
+ * homes an import in `solution_folder` too and records its cloud folder in
55
+ * `debug_overwrites.json` instead;
56
+ * - match a member declaration on both `kind` and `type`. RCS matched the
57
+ * deployed copy by name and kind, so it is the same project type — a stub
58
+ * added by hand carries no subtype;
59
+ * - carry a *strictly* suffixed variant of that member's name. The bare name
60
+ * is the member's own declaration, and `addResourceWithUniqueName` always
61
+ * suffixes an import that collides with it.
62
+ */
63
+ export declare function findMemberCloneResources(resources: ResourceDefinition[], memberProjectKeys: ReadonlySet<string>): ResourceDefinition[];
@@ -14,6 +14,8 @@ export interface ResourceRefreshSuccess {
14
14
  imported: number;
15
15
  /** Bindings whose cloud key was already in the solution (no-op this run). */
16
16
  skipped: number;
17
+ /** Stale `name_<N>` clones of the solution's own member projects removed this run. */
18
+ pruned: number;
17
19
  /** Non-fatal advisories (e.g. unresolved connections, link-before-deploy hints). */
18
20
  warnings: string[];
19
21
  }
@@ -4,7 +4,7 @@ interface RequiredPropertyDefault {
4
4
  /** Empty placeholder value matching the property's declared type. */
5
5
  placeholder: unknown;
6
6
  }
7
- interface ResolvedKindMetadata {
7
+ export interface ResolvedKindMetadata {
8
8
  /** Subtype to pass to createVirtualResourceAsync (e.g. "StringAsset"). */
9
9
  type?: string;
10
10
  /** SDK's `supportsInLineCreation` — whether a virtual stub can be created. */
@@ -16,12 +16,23 @@ interface ResolvedKindMetadata {
16
16
  * type-appropriate placeholder.
17
17
  */
18
18
  requiredDefaults: RequiredPropertyDefault[];
19
+ /**
20
+ * Lowercased spec property names the kind declares, unioned across every
21
+ * metadata version of the kind. Callers use this to ask what a kind
22
+ * carries without hardcoding a table — e.g. whether it has a `version`
23
+ * (`app`, `appVersion`, `package`, `process` do; `queue`, `asset` do not).
24
+ * Unioned rather than read off `versions[0]` so a property added in a
25
+ * newer metadata version still counts.
26
+ */
27
+ specProperties: Set<string>;
19
28
  }
20
- export { findMatchingLocalResource, normalizeFolderPath, } from "./local-resource-matcher";
29
+ export { findMatchingLocalResource, findMatchingMemberResource, findMemberCloneResources, normalizeFolderPath, } from "./local-resource-matcher";
21
30
  interface SyncResult {
22
31
  created: number;
23
32
  imported: number;
24
33
  skipped: number;
34
+ /** Stale `name_<N>` clones of member projects removed this run (UV-15817). */
35
+ pruned: number;
25
36
  warnings: string[];
26
37
  }
27
38
  /**
@@ -75,6 +86,13 @@ export declare function findResourceByKeyInRcs(builder: ISolutionBuilder, kind:
75
86
  */
76
87
  export declare function searchRcsResources(builder: ISolutionBuilder, kind: string, name: string): Promise<RcsMatch[]>;
77
88
  export declare function findResourceInRcs(builder: ISolutionBuilder, kind: string, name: string, folderPath?: string): Promise<RcsMatch | undefined>;
89
+ /**
90
+ * Build a resolver that answers kind-metadata questions for many (kind, type)
91
+ * pairs off one `getOrderedAsync` fetch, caching per pair. Prefer this over
92
+ * calling `resolveResourceKindMetadata` in a loop — that re-reads SDK metadata
93
+ * on every call.
94
+ */
95
+ export declare function createResourceKindMetadataResolver(services: IResourceBuilderServices): Promise<(kind: string, type?: string) => Promise<ResolvedKindMetadata | undefined>>;
78
96
  /**
79
97
  * Resolve a resource kind's metadata via the SDK (`kind`, optional `type`) so
80
98
  * callers outside the bindings sync can fill required spec defaults the same
@@ -0,0 +1,32 @@
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
+ import type { UipxProject } from "./types";
18
+ /**
19
+ * Thrown by {@link assertStudioWebCompatibleProjects} when the `.uipx`
20
+ * references an API Workflow project manifested by `project.json`.
21
+ */
22
+ export declare class StudioWebIncompatibleProjectError extends Error {
23
+ readonly offendingProjects: string[];
24
+ constructor(offendingProjects: string[]);
25
+ }
26
+ /**
27
+ * Throws {@link StudioWebIncompatibleProjectError} when any project is an
28
+ * API Workflow manifested by `project.json`. `Type` comes from user-owned
29
+ * `.uipx` JSON with no runtime validation, so it is narrowed before string
30
+ * methods — a malformed value falls through to the regular bundle path.
31
+ */
32
+ export declare function assertStudioWebCompatibleProjects(projects: UipxProject[]): void;
@@ -2,8 +2,76 @@
2
2
  * Upload/overwrite solutions to UiPath Studio Web.
3
3
  * Consolidates the upload logic previously duplicated in solution-tool and maestro-sdk.
4
4
  */
5
+ import { type FailureOutput } from "@uipath/common";
5
6
  import type { IFileSystem } from "@uipath/filesystem";
6
7
  import type { SolutionImportResponse, StudioWebConfig } from "./types";
8
+ /** Which Studio Web endpoint refused the upload. */
9
+ export type SolutionUploadOperation = "import" | "overwrite";
10
+ /** An overwrite always names its target; an import has none yet. */
11
+ type SolutionUploadFailureDetails = {
12
+ status: number;
13
+ method: string;
14
+ /** Request path as the URL carries it: no scheme or host, but the
15
+ * organization prefix is part of the path and stays. */
16
+ endpoint: string;
17
+ /** Full request URL, for diagnostics. */
18
+ url: string;
19
+ body: string;
20
+ message: string;
21
+ } & ({
22
+ operation: "import";
23
+ } | {
24
+ operation: "overwrite";
25
+ solutionId: string;
26
+ });
27
+ /**
28
+ * A Studio Web upload endpoint answered non-2xx.
29
+ *
30
+ * Carries what a caller needs to report the failure without re-parsing
31
+ * anything: which endpoint ran, the status, the raw body, and the platform's
32
+ * own `code` / `message` when the body carries them.
33
+ *
34
+ * `status` and the `message` wording are part of the contract —
35
+ * `uip solution upload` shape-matches `status === 404` and quotes `message` in
36
+ * its stale-id envelope.
37
+ */
38
+ export declare class SolutionUploadHttpError extends Error {
39
+ readonly status: number;
40
+ readonly operation: SolutionUploadOperation;
41
+ readonly method: string;
42
+ readonly endpoint: string;
43
+ readonly url: string;
44
+ readonly body: string;
45
+ /** Present only for an overwrite. */
46
+ readonly solutionId?: string;
47
+ /** From a `{"code":…,"message":…}` body; undefined for any other shape. */
48
+ readonly parsedErrorCode?: string;
49
+ readonly parsedErrorMessage?: string;
50
+ constructor(details: SolutionUploadFailureDetails);
51
+ }
52
+ /** Matched by shape, not `instanceof`: tools bundle their own copy of this
53
+ * package, so a cross-bundle `instanceof` is not reliable. */
54
+ export declare function isSolutionUploadHttpError(error: unknown): error is SolutionUploadHttpError;
55
+ /**
56
+ * Build the CLI failure envelope for a Studio Web upload refusal.
57
+ *
58
+ * The upload runs before anything executes, so on a refusal nothing reached
59
+ * the tenant and nothing ran: the envelope points at the upload, not at the
60
+ * project's contents. Shared by every command that pushes a solution, so the
61
+ * text names no command of its own.
62
+ *
63
+ * `subject` names what the caller was pushing ("flow", "case", "process",
64
+ * "agent"), so the text can say which artifact is off the hook. `importCheckHint`
65
+ * is appended on an import refusal, where the package itself was rejected and
66
+ * the caller has a command for checking it; an overwrite refusal is about the
67
+ * target solution, not the package.
68
+ *
69
+ * `Context.httpStatus` is what gives the envelope its `ErrorCode`.
70
+ */
71
+ export declare function buildSolutionUploadFailureOutput(err: SolutionUploadHttpError, options?: {
72
+ subject?: string;
73
+ importCheckHint?: string;
74
+ }): FailureOutput;
7
75
  /**
8
76
  * Escape hatch for very large solutions or unusually slow links:
9
77
  * `UIPATH_SOLUTION_UPLOAD_TIMEOUT_MS=300000`. Anything non-numeric or
@@ -31,9 +99,13 @@ export declare function solutionExistsOnStudioWeb(config: StudioWebConfig, organ
31
99
  */
32
100
  export declare function importSolution(config: StudioWebConfig, organizationName: string, fileBuffer: Uint8Array, fileName: string): Promise<SolutionImportResponse>;
33
101
  /**
34
- * Overwrite an existing solution on Studio Web.
102
+ * Overwrite an existing solution on Studio Web: replaces its contents in
103
+ * place under the same id, keeping existing version history. With
104
+ * `createSnapshot` the replaced contents are first recorded as a restorable
105
+ * version; the default (false) matches the server's and keeps debug pushes
106
+ * from minting a version per iteration — `uip solution upload` opts in.
35
107
  */
36
- export declare function overwriteSolution(config: StudioWebConfig, organizationName: string, fileBuffer: Uint8Array, fileName: string, solutionId: string): Promise<SolutionImportResponse>;
108
+ export declare function overwriteSolution(config: StudioWebConfig, organizationName: string, fileBuffer: Uint8Array, fileName: string, solutionId: string, createSnapshot?: boolean): Promise<SolutionImportResponse>;
37
109
  /**
38
110
  * Upload or overwrite a solution on Studio Web.
39
111
  * If solutionId is provided, tries overwrite first with 404 fallback to import.
@@ -41,3 +113,4 @@ export declare function overwriteSolution(config: StudioWebConfig, organizationN
41
113
  * Accepts either a file buffer or a file path (reads the file using fs).
42
114
  */
43
115
  export declare function uploadOrOverwriteSolution(config: StudioWebConfig, organizationName: string, fileBufferOrPath: Uint8Array | string, solutionId: string | undefined, fs?: IFileSystem): Promise<SolutionImportResponse>;
116
+ export {};
@@ -14,6 +14,9 @@ import type { IFileSystem } from "@uipath/filesystem";
14
14
  * node_modules Node dependency cache; same reasoning as .venv.
15
15
  * __pycache__ Python bytecode; regenerated on import.
16
16
  * .git VCS metadata; never belongs in an upload.
17
+ * .local Studio's per-project NuGet restore cache. Studio Web
18
+ * restores its own packages on import, so uploading this one
19
+ * only costs bundle size and time.
17
20
  *
18
21
  * Callers can extend this set per-walk via the `additionalExcludeDirs` option
19
22
  * (sourced from a `.uipignore` file at the solution root by bundle-service).
@@ -77,3 +80,28 @@ export declare function collectFiles(fs: IFileSystem, dir: string, options?: {
77
80
  export declare function createZipFromDir(fs: IFileSystem, dir: string, options?: {
78
81
  additionalExcludeDirs?: Iterable<string>;
79
82
  }): Promise<Uint8Array>;
83
+ /**
84
+ * Give an archive a zip64 tail once it holds more entries than the classic
85
+ * end-of-central-directory record can count.
86
+ *
87
+ * fflate writes zip32 only. Its EOCD entry count is a 16-bit field, and its
88
+ * byte writer stops at the first zero byte rather than clamping to the field
89
+ * width, so an archive of 65,536 entries reports 0 and one of 70,000 reports
90
+ * 4,464 - with no error raised. Readers that trust the count (fflate's own
91
+ * `unzipSync` bails at `if (!c) return {}`; .NET's `ZipArchive` throws when the
92
+ * walked central directory disagrees with it) then see an empty or corrupt
93
+ * archive. That is how a solution bundle large enough to cross the ceiling
94
+ * reaches Studio Web's import as "the project archive is corrupt or the
95
+ * compression isn't supported" - a valid-looking file that strict readers
96
+ * refuse.
97
+ *
98
+ * The fix is the one zip64 prescribes for a count-only overflow: keep the
99
+ * central directory exactly as written, saturate the classic EOCD's count
100
+ * fields, and put the true counts in a zip64 EOCD record plus its locator. Per-
101
+ * entry zip64 extra fields are not involved, because no individual entry's size
102
+ * or offset overflows here.
103
+ *
104
+ * @param zip - Archive as fflate produced it.
105
+ * @returns The same archive, with a zip64 tail when one is needed.
106
+ */
107
+ export declare function finalizeZip64(zip: Uint8Array): Uint8Array;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/solution-sdk",
3
3
  "license": "MIT",
4
- "version": "1.201.0-preview.133",
4
+ "version": "1.202.0-preview.134",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/UiPath/cli.git",
@@ -39,5 +39,5 @@
39
39
  "dist"
40
40
  ],
41
41
  "private": false,
42
- "gitHead": "7933378ad5276ac369900293a1447474dcec6826"
42
+ "gitHead": "a335728adbdb02f28308e4f55d8936d0b150444b"
43
43
  }