@uipath/solution-sdk 1.199.0 → 1.201.0-preview.115

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.
Files changed (36) hide show
  1. package/dist/generated/src/apis/DeploymentsApi.d.ts +13 -1
  2. package/dist/generated/src/models/DeploymentActivationStatus.d.ts +7 -7
  3. package/dist/generated/src/models/DeploymentOperation.d.ts +6 -6
  4. package/dist/generated/src/models/DeploymentOperationStatus.d.ts +5 -5
  5. package/dist/generated/src/models/DeploymentStatus.d.ts +10 -10
  6. package/dist/generated/src/models/DeploymentType.d.ts +2 -2
  7. package/dist/generated/src/models/DeploymentUpgradeRequest.d.ts +38 -0
  8. package/dist/generated/src/models/DeploymentUpgradeType.d.ts +4 -4
  9. package/dist/generated/src/models/ExtendedPackageVersionState.d.ts +4 -4
  10. package/dist/generated/src/models/OrderByDirection.d.ts +2 -2
  11. package/dist/generated/src/models/OverwriteType.d.ts +2 -2
  12. package/dist/generated/src/models/PackageVersionOrigin.d.ts +4 -4
  13. package/dist/generated/src/models/ProjectImportStatus.d.ts +4 -4
  14. package/dist/generated/src/models/WorkflowAction.d.ts +6 -6
  15. package/dist/generated/src/models/index.d.ts +1 -0
  16. package/dist/index.js +14431 -13727
  17. package/dist/resources/index.js +32323 -0
  18. package/dist/scripts/generate-sdk.js +2 -1
  19. package/dist/solution-auth.js +2292 -0
  20. package/dist/src/deployments-auto-install.d.ts +55 -0
  21. package/dist/src/index.d.ts +4 -1
  22. package/dist/src/resources/commands/project-utils.d.ts +64 -0
  23. package/dist/src/resources/index.d.ts +22 -0
  24. package/dist/src/resources/providers/file-storage-provider.d.ts +11 -0
  25. package/dist/src/resources/providers/resource-builder-init.d.ts +12 -0
  26. package/dist/src/resources/providers/solution-access-provider.d.ts +18 -0
  27. package/dist/src/resources/services/entry-point-spec-enhancer.d.ts +31 -0
  28. package/dist/src/resources/services/local-resource-matcher.d.ts +27 -0
  29. package/dist/src/resources/services/project-artifacts-service.d.ts +44 -0
  30. package/dist/src/resources/services/resource-refresh-service.d.ts +34 -0
  31. package/dist/src/resources/services/solution-manifest.d.ts +9 -0
  32. package/dist/src/resources/services/sync-resources-from-bindings.d.ts +133 -0
  33. package/dist/src/search-package-versions.d.ts +46 -0
  34. package/dist/src/solution-auth.d.ts +13 -0
  35. package/dist/src/solution-file.d.ts +13 -1
  36. package/package.json +10 -2
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Automation Solutions "auto-install" deploy (v2).
3
+ *
4
+ * Hand-written wrapper — `POST /api/v2/deployments/auto-install` is not yet in
5
+ * the committed swagger the generator pulls from, so it isn't in the generated
6
+ * `DeploymentsApi`. It supersedes the older `POST /api/deployments/deploy`
7
+ * (generated `deploymentsDeploy`) for feed deploys: unlike that endpoint, it
8
+ * accepts a caller-chosen `deploymentName` and `solutionRootFolderName`
9
+ * instead of auto-naming the deployment `AutoDeploy-<solution>`. It is the
10
+ * same call Studio Web makes for a deploy-only ("packageAndDeploy: false")
11
+ * flow. Once the v2 path ships in the spec, regenerate and drop this file in
12
+ * favor of the generated method.
13
+ */
14
+ /** Auth/endpoint inputs for {@link deploymentsAutoInstall}. */
15
+ export interface AutoInstallClientConfig {
16
+ /** Tenant-scoped Automation Solutions base path (`.../automationsolutions_`). */
17
+ basePath: string;
18
+ accessToken: string;
19
+ }
20
+ /** Body of `POST /api/v2/deployments/auto-install` (mirrors Studio Web). */
21
+ export interface DeploymentAutoInstallRequest {
22
+ /** Caller-chosen deployment name — the field the v1 auto-deploy endpoint lacked. */
23
+ deploymentName: string;
24
+ packageVersionKey: string;
25
+ /** Client-generated GUID for the deployment to create. */
26
+ newDeploymentKey: string;
27
+ /** Activate right after install (server-side; no separate activate call). */
28
+ forceActivate: boolean;
29
+ /** Key of the folder the deployment installs into. The server creates
30
+ * `solutionRootFolderName` under THIS folder — not under
31
+ * `pathFullyQualifiedName`, which only feeds the deployment record. */
32
+ installationFolderKey: string;
33
+ /** FQN of that same folder — recorded as the deployment's displayed path,
34
+ * so it must agree with `installationFolderKey`. */
35
+ pathFullyQualifiedName: string;
36
+ /** False → deploy an already-published package (the CLI's case). */
37
+ packageAndDeploy: boolean;
38
+ /** Name of the new Orchestrator folder created for the deployment. */
39
+ solutionRootFolderName: string;
40
+ pauseBeforeRun: boolean;
41
+ runtimeSetup?: {
42
+ requireServerlessTemplate: boolean;
43
+ };
44
+ }
45
+ /**
46
+ * Deploy a feed package via the v2 auto-install endpoint.
47
+ *
48
+ * `feedFolderKey` is sent as `X-UIPATH-FolderKey` so the server resolves the
49
+ * package version within that feed (same scoping the search endpoints use).
50
+ * Non-2xx responses throw the generated runtime's {@link ResponseError} so
51
+ * callers' `extractErrorDetails` handling (status + body parsing) works
52
+ * unchanged. The response body is returned parsed when it is a JSON object,
53
+ * `{}` otherwise — the endpoint's response shape is not pinned by the spec yet.
54
+ */
55
+ export declare function deploymentsAutoInstall(config: AutoInstallClientConfig, request: DeploymentAutoInstallRequest, feedFolderKey: string): Promise<Record<string, unknown>>;
@@ -1,8 +1,11 @@
1
1
  import "./user-agent.js";
2
+ export { getAvailablePublishLocationsV2, type PublishLocationType, type PublishLocationV2, } from "@uipath/studioweb-sdk";
2
3
  export * from "../generated/src/index.js";
3
4
  export { buildSolutionPackageFromDir, bundleSolution, resolveSolutionDir, } from "./bundle-service";
5
+ export { type AutoInstallClientConfig, type DeploymentAutoInstallRequest, deploymentsAutoInstall, } from "./deployments-auto-install";
6
+ export { type PackageVersionSearchFilter, type PackageVersionSearchRow, type PackageVersionsClientConfig, searchPackageVersions, } from "./search-package-versions";
4
7
  export type { AutoCreatedSolution, ParentSolutionDiscovery, PrepareProjectLocationOptions, PrepareProjectLocationResult, ProjectSolutionRegistration, RegisterProjectOptions, SolutionManifestCreation, } from "./solution-file";
5
- export { autoScaffoldSolution, createSolutionManifest, findNearestParentUipxFile, findSolutionFile, isProjectRegisteredInSolution, normalizeProjectType, prepareProjectLocation, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
8
+ export { autoScaffoldSolution, createSolutionManifest, findNearestParentUipxFile, findSolutionFile, findSolutionFileUpward, isProjectRegisteredInSolution, normalizeProjectType, prepareProjectLocation, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
6
9
  export { getStudioWebSolutionProjects } from "./solution-info";
7
10
  export type { BundleResult, SolutionImportResponse, StudioWebConfig, StudioWebSolutionProject, UipxFile, UipxProject, } from "./types";
8
11
  export { importSolution, overwriteSolution, solutionExistsOnStudioWeb, uploadOrOverwriteSolution, } from "./upload-service";
@@ -0,0 +1,64 @@
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
+ * `subType` is forwarded to the SDK's project template picker. For AppV2
61
+ * projects: pass `"Coded"` for a regular coded app or `"CodedAction"` for a
62
+ * coded action app; leave undefined for other project types.
63
+ */
64
+ export declare function createProjectInSolutionBuilder(solutionDir: string, projectId: string, projectName: string, projectType: string, subType?: string): Promise<Error | null>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Public `@uipath/solution-sdk/resources` entry: the solution resource engine,
3
+ * split out of `solution-tool` so peer tools (flow, maestro, agent, case,
4
+ * codedapp) and the solution CLI share one implementation instead of importing
5
+ * across tool packages.
6
+ *
7
+ * Built as its own entry point in solution-sdk's `--splitting` pass, so the
8
+ * heavy `@uipath/resource-builder-sdk` / `@uipath/orchestrator-sdk` graph lands
9
+ * in this subpath's chunks — the light `.` barrel that every tool bundles never
10
+ * pulls it.
11
+ *
12
+ * The engine modules have disjoint export names, so `export *` gives callers the
13
+ * full surface without hand-curating (and silently dropping) individual symbols.
14
+ */
15
+ export * from "./commands/project-utils";
16
+ export * from "./providers/resource-builder-init";
17
+ export * from "./services/entry-point-spec-enhancer";
18
+ export * from "./services/local-resource-matcher";
19
+ export * from "./services/project-artifacts-service";
20
+ export * from "./services/resource-refresh-service";
21
+ export * from "./services/solution-manifest";
22
+ export * from "./services/sync-resources-from-bindings";
@@ -0,0 +1,11 @@
1
+ import type { IFileStorageProvider, IFileStorageProviderFactory, ISolutionContext } from "@uipath/resource-builder-sdk";
2
+ /**
3
+ * Factory for creating FileSystemFileStorageProvider instances.
4
+ */
5
+ export declare class FileSystemFileStorageProviderFactory implements IFileStorageProviderFactory {
6
+ getProviderAsync(context: ISolutionContext, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
7
+ getProviderByPathAsync(basePath: string, _cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
8
+ getCurrentUserProfileProviderAsync(context: ISolutionContext, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
9
+ getUserProfileProviderAsync(context: ISolutionContext, userId: string, _cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
10
+ getCurrentUserProfileProviderByPathAsync(basePath: string, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { type IResourceBuilderServices } from "@uipath/resource-builder-sdk";
2
+ /**
3
+ * Creates a configured ResourceBuilderServices instance for CLI usage.
4
+ * Uses SolutionAccessProvider which maps SDK service scopes to full
5
+ * tenant-scoped gateway URLs, enabling server-side SDK operations
6
+ * (updateConfigurationAsync, addOrUpdateResourceToSolutionAsync, etc.).
7
+ *
8
+ * `EntryPointSpecEnhancer` is registered so artefact resources (resources
9
+ * with a `projectKey`) reflect the latest `entry-points.json` from disk at
10
+ * read time, instead of the snapshot captured at `solution projects add`.
11
+ */
12
+ export declare function createResourceBuilderServices(): Promise<IResourceBuilderServices>;
@@ -0,0 +1,18 @@
1
+ import type { AuthenticationInfo, IAccessProvider } from "@uipath/resource-builder-sdk";
2
+ /**
3
+ * IAccessProvider that maps SDK service scopes to full tenant-scoped URLs.
4
+ * Unlike CliAccessProvider (which returns bare baseUrl), this builds the correct
5
+ * gateway paths that the resource-builder-sdk expects for server-side operations.
6
+ */
7
+ export declare class SolutionAccessProvider implements IAccessProvider {
8
+ private loginStatus;
9
+ private userKey;
10
+ private getStatus;
11
+ getResourceUrlAsync(scope: string, _cancellationToken?: AbortSignal): Promise<string | null>;
12
+ getResourceUrlWithAuthAsync(scope: string, _authInfo: AuthenticationInfo, _cancellationToken?: AbortSignal): Promise<string | null>;
13
+ getAccessTokenAsync(_scopes: string[], _force?: boolean, _cancellationToken?: AbortSignal): Promise<string | null>;
14
+ getUserKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
15
+ getTenantKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
16
+ getAccountKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
17
+ isGatewayIntegrationEnabled(): boolean;
18
+ }
@@ -0,0 +1,31 @@
1
+ import { type IFileSystem } from "@uipath/filesystem";
2
+ import type { IArtifactResourceSpecEnhancer, ISolutionContext, ResourceDefinition, ResourcePropertyMetadata } from "@uipath/resource-builder-sdk";
3
+ /**
4
+ * Reads the project's `entry-points.json` at GET time and projects the primary
5
+ * entry points onto the resource spec, so consumers see the current on-disk
6
+ * state — not the snapshot captured at `solution projects add`.
7
+ *
8
+ * Mirrors the shape Studio Web returns from its process configuration
9
+ * endpoint: `entryPoints` always carries the raw `entry-points.json` text;
10
+ * `entryPointName` / `entryPointUniqueId` are populated only when the project
11
+ * has exactly one entry, and are explicit `null` for multi-entry or empty
12
+ * projects.
13
+ *
14
+ * Read-only by design: never mutates the on-disk resource JSON. Spec
15
+ * degradation (missing/malformed file) is swallowed so `resource get` stays
16
+ * functional.
17
+ */
18
+ export declare class EntryPointSpecEnhancer implements IArtifactResourceSpecEnhancer {
19
+ private readonly fs;
20
+ constructor(fs?: IFileSystem);
21
+ enhanceSpecAsync(context: ISolutionContext, resource: ResourceDefinition, _propertiesMetadata: Map<string, ResourcePropertyMetadata>, spec: Map<string, unknown>, _cancellationToken?: AbortSignal): Promise<void>;
22
+ private applyEntryPointAsync;
23
+ private findSolutionFileAsync;
24
+ }
25
+ /**
26
+ * Applies `EntryPointSpecEnhancer` against a plain-object spec returned by the
27
+ * SDK's `getConfigurationAsync` path. Used by `resource get` until the SDK
28
+ * invokes `enhanceSpecAsync` itself from `GetMappedResourceConfigurationRequestHandler`;
29
+ * once that lands this becomes a redundant no-op for the same on-disk state.
30
+ */
31
+ export declare function applyEntryPointEnhancementAsync(context: ISolutionContext, resource: ResourceDefinition, spec: Record<string, unknown>): Promise<Record<string, unknown>>;
@@ -0,0 +1,27 @@
1
+ import type { ResourceDefinition } from "@uipath/resource-builder-sdk";
2
+ /**
3
+ * Pure, dependency-free matching primitives for local solution resources.
4
+ * A leaf module on purpose: `sync-resources-from-bindings` and
5
+ * `resource-mutations` both re-export from here (so existing callers keep
6
+ * their import paths), while `commands/resource-add.ts` imports it directly —
7
+ * which lets its spec run the REAL matcher without mocking this module.
8
+ */
9
+ /**
10
+ * Normalize a folder path for comparisons. `.` and `solution_folder` both
11
+ * encode "no folder" (tenant/root scope) — collapsing them to undefined lets
12
+ * us compare a binding's folder against an existing resource's folder
13
+ * consistently regardless of which placeholder either side carries.
14
+ */
15
+ export declare function normalizeFolderPath(path: string | undefined): string | undefined;
16
+ /**
17
+ * Find a solution resource matching (kind, name | name_<N>, normalized
18
+ * folder). Kind + name are compared case-insensitively; the suffix variants
19
+ * match because SDK's `addResourceWithUniqueName` may have suffixed an
20
+ * earlier add/import of the same name. With a solution-relative `folderPath`
21
+ * (`.` / `solution_folder` / undefined) only root-scope resources match.
22
+ *
23
+ * Single source of truth for "does an in-solution resource already cover
24
+ * this (kind, name, folder)?" — used by the refresh import guard (UV-15289),
25
+ * the virtual idempotency check, and `resources add --source local`.
26
+ */
27
+ export declare function findMatchingLocalResource(resources: ResourceDefinition[], kind: string, name: string, folderPath: string | undefined): ResourceDefinition | undefined;
@@ -0,0 +1,44 @@
1
+ export interface AddProjectArtifactsOptions {
2
+ /** Absolute path to the solution directory (containing the `.uipx`). */
3
+ solutionDir: string;
4
+ /** Stable project key — must match the `Id` in `.uipx` `Projects[]`. */
5
+ projectId: string;
6
+ /** Display name for the project; typically the project folder name. */
7
+ projectName: string;
8
+ /**
9
+ * Project type as written to `project.uiproj` (e.g. `Flow`,
10
+ * `ProcessOrchestration`, `Agent`, `CaseManagement`, `AppV2`). Normalized
11
+ * internally via `normalizeProjectType` so callers can pass the raw value.
12
+ */
13
+ projectType: string;
14
+ /**
15
+ * Optional SDK subType. Used by the resource-builder-sdk to pick the right
16
+ * artifact-resource template. For AppV2 (coded apps) callers must pass
17
+ * `"Coded"` for a regular coded app or `"CodedAction"` for a coded action
18
+ * app — mirrors the `context.projectSubType` value Studio Web posts when
19
+ * a project is created in a solution. Without a matching subType the SDK
20
+ * template lookup misses and falls back to a generic Process resource,
21
+ * which places the project under the Processes tab instead of Apps.
22
+ */
23
+ projectSubType?: string;
24
+ }
25
+ export interface ProjectArtifactsResult {
26
+ /** True when artifact resources were generated. */
27
+ Created: boolean;
28
+ /** Error message when `Created` is `false`. */
29
+ Error?: string;
30
+ }
31
+ /**
32
+ * Generate `resources/solution_folder/process/<kind>/` artifact-resource
33
+ * entries for a project that has just been registered in the parent
34
+ * solution's `.uipx`. Mirrors the second half of `uip solution project add`
35
+ * (after the manifest write), so `*-tool init` paths can produce the same
36
+ * complete on-disk state without requiring a follow-up
37
+ * `solution project remove` + `add` cycle.
38
+ *
39
+ * Returns a result envelope instead of throwing: the project files have
40
+ * already been created by the init caller, so a failure here is recoverable
41
+ * with `solution project remove` + `add`. Callers surface the result in
42
+ * their success envelope as `Data.ProjectArtifacts`.
43
+ */
44
+ export declare function addProjectArtifactsToSolutionAsync(options: AddProjectArtifactsOptions): Promise<ProjectArtifactsResult>;
@@ -0,0 +1,34 @@
1
+ /** Discriminator for {@link ResourceRefreshFailure}; library callers can ignore the tag and read `.message` / `.ok`. */
2
+ export type ResourceRefreshFailureReason = "solution_not_found" | "not_a_solution" | "auth_failed" | "sync_failed";
3
+ export interface ResourceRefreshOptions {
4
+ /** Minimum minutes before token expiration to trigger a refresh. Default `10` (matches the CLI's `--login-validity`). */
5
+ loginValidity?: number;
6
+ /** Pin auth to this exact `.uipath/.auth` path. */
7
+ envFilePath?: string;
8
+ }
9
+ export interface ResourceRefreshSuccess {
10
+ ok: true;
11
+ /** Resources newly created (virtualized) in the solution this run. */
12
+ created: number;
13
+ /** Resources imported from Orchestrator into the solution this run. */
14
+ imported: number;
15
+ /** Bindings whose cloud key was already in the solution (no-op this run). */
16
+ skipped: number;
17
+ /** Non-fatal advisories (e.g. unresolved connections, link-before-deploy hints). */
18
+ warnings: string[];
19
+ }
20
+ export interface ResourceRefreshFailure {
21
+ ok: false;
22
+ reason: ResourceRefreshFailureReason;
23
+ /** Human-readable summary suitable for top-level surfacing. */
24
+ message: string;
25
+ }
26
+ export type ResourceRefreshResult = ResourceRefreshSuccess | ResourceRefreshFailure;
27
+ /**
28
+ * Programmatic core of `uip solution resources refresh`: re-scans every project's
29
+ * `bindings_v2.json` and syncs resource declarations into the solution, importing
30
+ * from Orchestrator when a match exists and virtualizing the rest. Returns a tagged
31
+ * {@link ResourceRefreshResult}; re-throws only on unexpected errors. Mirrors
32
+ * `./pack` / `./publish` / `./deploy`.
33
+ */
34
+ export declare function resourceRefreshAsync(solutionPath?: string, options?: ResourceRefreshOptions): Promise<ResourceRefreshResult>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Throw if `dir` doesn't directly contain a `.uipx` manifest. Stricter than
3
+ * `findSolutionFile` (which walks up to find one) — write commands should not
4
+ * silently mutate the wrong folder when run from an arbitrary cwd.
5
+ *
6
+ * Lives in `services/` (not `commands/project.ts`) so callers can mock the
7
+ * check without pulling in the full project-commands module.
8
+ */
9
+ export declare function assertSolutionManifest(dir: string): Promise<void>;
@@ -0,0 +1,133 @@
1
+ import { type IResourceBuilderServices, type ISolutionBuilder, type ResourceDefinition } from "@uipath/resource-builder-sdk";
2
+ interface RequiredPropertyDefault {
3
+ property: string;
4
+ /** Empty placeholder value matching the property's declared type. */
5
+ placeholder: unknown;
6
+ }
7
+ interface ResolvedKindMetadata {
8
+ /** Subtype to pass to createVirtualResourceAsync (e.g. "StringAsset"). */
9
+ type?: string;
10
+ /** SDK's `supportsInLineCreation` — whether a virtual stub can be created. */
11
+ virtualizable: boolean;
12
+ /**
13
+ * Required spec properties that have no default in SDK metadata. Deploy
14
+ * validation rejects virtualized resources missing these (e.g. Asset.value).
15
+ * We fill them in-memory after `createVirtualResourceAsync` with a
16
+ * type-appropriate placeholder.
17
+ */
18
+ requiredDefaults: RequiredPropertyDefault[];
19
+ }
20
+ export { findMatchingLocalResource, normalizeFolderPath, } from "./local-resource-matcher";
21
+ interface SyncResult {
22
+ created: number;
23
+ imported: number;
24
+ skipped: number;
25
+ warnings: string[];
26
+ }
27
+ /**
28
+ * Reads bindings_v2.json from project paths and creates/imports matching
29
+ * resources in the solution using the resource-builder-sdk.
30
+ *
31
+ * @param solutionDir - Path to the solution directory
32
+ * @param projectPaths - Specific project paths to scan (if omitted, scans all projects in .uipx)
33
+ */
34
+ export declare function syncResourcesFromBindings(solutionDir: string, projectPaths?: string[]): Promise<SyncResult>;
35
+ /**
36
+ * Mirror of SDK's private `addResourceWithUniqueName`
37
+ * (resource-builder-sdk index.js:673): if any other resource of the same
38
+ * kind already carries `name` (or a `name_<N>` suffix variant), return
39
+ * `name_<N+1>`. Otherwise return `name` unchanged. Excludes `excludeKey`
40
+ * so the resource we just created doesn't collide with itself.
41
+ */
42
+ export declare function uniqueNameForResource(name: string, kind: string, excludeKey: string, solution: {
43
+ resources: Array<{
44
+ key: string;
45
+ kind?: string;
46
+ name?: string;
47
+ }>;
48
+ }): string;
49
+ export interface RcsMatch {
50
+ key: string;
51
+ name: string;
52
+ /** Subtype as RCS reports it (e.g. `Text` for Asset). `undefined` for
53
+ * kinds without a subtype (Queue). Callers may need to forward this to
54
+ * `addOrUpdateResourceToSolutionAsync`, which rejects type-less imports
55
+ * for kinds that SDK metadata indexes by (kind, type). */
56
+ type?: string;
57
+ folder?: {
58
+ fullyQualifiedName: string;
59
+ folderKey: string;
60
+ path?: string;
61
+ };
62
+ }
63
+ /**
64
+ * Find a resource in RCS by key (UUID). RCS's `SearchFolderEntities` endpoint
65
+ * has no key-based filter — only `name`/`entityTypes`/`entitySubTypes`. We
66
+ * paginate all resources of this kind and filter locally by key, exiting
67
+ * early on the match. Used for connections, whose binding carries the UUID
68
+ * directly via `bindingKey`.
69
+ */
70
+ export declare function findResourceByKeyInRcs(builder: ISolutionBuilder, kind: string, expectedKey: string, folderPath?: string, propagateErrors?: boolean): Promise<RcsMatch | undefined>;
71
+ /**
72
+ * Page through RCS for a given (kind, name) and collect every match. Returns
73
+ * an empty array on lookup error (logged as a warning). Callers decide what
74
+ * to do with 0/1/many matches.
75
+ */
76
+ export declare function searchRcsResources(builder: ISolutionBuilder, kind: string, name: string): Promise<RcsMatch[]>;
77
+ export declare function findResourceInRcs(builder: ISolutionBuilder, kind: string, name: string, folderPath?: string): Promise<RcsMatch | undefined>;
78
+ /**
79
+ * Resolve a resource kind's metadata via the SDK (`kind`, optional `type`) so
80
+ * callers outside the bindings sync can fill required spec defaults the same
81
+ * way `createVirtualForBinding` does. Returns undefined if the kind isn't
82
+ * indexed by SDK metadata.
83
+ */
84
+ export declare function resolveResourceKindMetadata(services: IResourceBuilderServices, kind: string, type?: string): Promise<ResolvedKindMetadata | undefined>;
85
+ export interface CreateLocalResourceParams {
86
+ builder: ISolutionBuilder;
87
+ services: IResourceBuilderServices;
88
+ kind: string;
89
+ type?: string;
90
+ name: string;
91
+ folderPath?: string;
92
+ }
93
+ export interface CreateLocalResourceResult {
94
+ resource: ResourceDefinition;
95
+ /** Final name on the resource — may differ from input if SDK conflict suffix kicked in. */
96
+ finalName: string;
97
+ }
98
+ /**
99
+ * Create a virtual (local-only) resource via the SDK and rename it to `name`,
100
+ * mirroring the rename + spec-default flow `createVirtualForBinding` runs
101
+ * during refresh. Returns the freshly created `SolutionResource` after the
102
+ * mutation, or undefined if the SDK failed to allocate a key.
103
+ *
104
+ * Callers must:
105
+ * - Persist the change (e.g. `builder.disposeAsync()` or
106
+ * `context.saveAsync()`); this helper only mutates in-memory state.
107
+ * - Have already done an idempotency check — this helper *always* creates,
108
+ * and SDK's `addResourceWithUniqueName` will suffix the name on conflict.
109
+ */
110
+ export declare function createLocalResource(params: CreateLocalResourceParams): Promise<CreateLocalResourceResult | undefined>;
111
+ export interface UipxProject {
112
+ /** Project type as written in `.uipx` (e.g. "Agent", "Process"). */
113
+ type: string;
114
+ /** Design-time UUID used as `projectKey` in reconcile. */
115
+ id: string;
116
+ /** Path to the project directory (parent of `project.uiproj`). */
117
+ path: string;
118
+ /** Project name read from `project.uiproj` (`Name` field). */
119
+ name: string;
120
+ }
121
+ /**
122
+ * Read solution's `.uipx` and each project's `project.uiproj` to assemble the
123
+ * data needed for `reconcileProjectsAsync`. Without this, sync would only see
124
+ * resource bindings (Queue/Asset/etc.) and miss the project artefacts
125
+ * (process/<type>, package, app/<subType>, appVersion) the SDK generates from
126
+ * project templates.
127
+ */
128
+ export declare function readUipxProjects(solutionDir: string): Promise<UipxProject[]>;
129
+ /**
130
+ * Sync resources from bindings with logging. Non-fatal — logs warnings
131
+ * on failure and continues. Used by pack and upload before packaging.
132
+ */
133
+ export declare function syncAndLog(solutionDir: string): Promise<void>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Automation Solutions package-version search.
3
+ *
4
+ * Hand-written wrapper — `POST /api/search/packages/{packageKey}/versions` is
5
+ * in the committed swagger but not in the generator's include list, and the
6
+ * generator can't currently be re-run (its swagger URL is auth-gated). It is
7
+ * the same call Studio Web's deploy-setup uses to list deployable versions,
8
+ * so feed deploys can target any published version, not just the latest.
9
+ * Once the path is added to `explicitlyIncludedPaths` in
10
+ * `src/scripts/generate-sdk.ts` and the SDK is regenerated, drop this file in
11
+ * favor of the generated method.
12
+ */
13
+ /** Auth/endpoint inputs for {@link searchPackageVersions}. */
14
+ export interface PackageVersionsClientConfig {
15
+ /** Tenant-scoped Automation Solutions base path (`.../automationsolutions_`). */
16
+ basePath: string;
17
+ accessToken: string;
18
+ }
19
+ /** Body of `POST /api/search/packages/{packageKey}/versions` (PackageVersionSearchFilter). */
20
+ export interface PackageVersionSearchFilter {
21
+ searchTerm?: string;
22
+ skip?: number;
23
+ take?: number;
24
+ orderByColumn?: string;
25
+ orderByDirection?: "Ascending" | "Descending";
26
+ excludeInvalidPackages: boolean;
27
+ }
28
+ /** One row of the versions search (PackageVersionInfo, fields the CLI reads). */
29
+ export interface PackageVersionSearchRow {
30
+ key: string;
31
+ version: string;
32
+ publishDate?: string;
33
+ state?: string;
34
+ }
35
+ /**
36
+ * Search a package's published versions within a feed.
37
+ *
38
+ * When `feedFolderKey` is set, it is sent as `X-UIPATH-FolderKey` so results
39
+ * are scoped to that feed, matching the package search. Omitting it searches
40
+ * the tenant feed. Non-2xx responses throw the generated runtime's
41
+ * {@link ResponseError}.
42
+ */
43
+ export declare function searchPackageVersions(config: PackageVersionsClientConfig, packageKey: string, filter: PackageVersionSearchFilter, feedFolderKey?: string): Promise<{
44
+ count?: number;
45
+ values: PackageVersionSearchRow[];
46
+ }>;
@@ -0,0 +1,13 @@
1
+ export interface SolutionAuthContext {
2
+ accessToken: string;
3
+ basePath: string;
4
+ organizationId: string;
5
+ tenantName: string;
6
+ }
7
+ export declare function getSolutionAuthContext(options: {
8
+ tenant?: string;
9
+ loginValidity?: number;
10
+ /** Pin auth to this exact `.uipath/.auth` path (forwarded to
11
+ * `getAuthContext`) instead of resolving from `process.cwd()`. */
12
+ envFilePath?: string;
13
+ }): Promise<SolutionAuthContext>;
@@ -11,7 +11,9 @@ import type { UipxFile, UipxProject } from "./types";
11
11
  * - `AlreadyRegistered` — Project was already in Projects[]; no write performed.
12
12
  * - `Skipped` — A candidate solution was found but registration was deliberately
13
13
  * not attempted (ambiguous: multiple `.uipx` in same dir, or the
14
- * project dir sits outside the discovered solution dir).
14
+ * project dir sits outside the discovered solution dir, or the
15
+ * project's type cannot live in a solution — see
16
+ * {@link unsupportedSolutionProjectType}).
15
17
  * - `Failed` — Registration was attempted and an error occurred (read/write/parse).
16
18
  * - `NotInSolution` — No `.uipx` file was found by walking ancestor directories. The
17
19
  * project was created in standalone mode. This is the explicit
@@ -226,3 +228,13 @@ export declare function readSolutionManifest(fs: IFileSystem, solutionFile: stri
226
228
  * project path and the manifest path is far more actionable.
227
229
  */
228
230
  export declare function isProjectRegisteredInSolution(fs: IFileSystem, projectDir: string, solutionFile: string): Promise<boolean>;
231
+ /**
232
+ * Walks up from `startDir` to the filesystem root, returning the path of the
233
+ * single `.uipx` solution file found. Throws when none — or more than one in a
234
+ * single directory — is found. Distinct from {@link findSolutionFile}, which
235
+ * peeks only the parent directory and returns solution/project ids.
236
+ *
237
+ * Used by the resource engine (`@uipath/solution-sdk/resources`) and the
238
+ * solution CLI to resolve `--solution-folder` to a concrete manifest.
239
+ */
240
+ export declare function findSolutionFileUpward(fs: IFileSystem, startDir: string): Promise<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/solution-sdk",
3
3
  "license": "MIT",
4
- "version": "1.199.0",
4
+ "version": "1.201.0-preview.115",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/UiPath/cli.git",
@@ -22,6 +22,14 @@
22
22
  ".": {
23
23
  "types": "./dist/src/index.d.ts",
24
24
  "default": "./dist/index.js"
25
+ },
26
+ "./resources": {
27
+ "types": "./dist/src/resources/index.d.ts",
28
+ "default": "./dist/resources/index.js"
29
+ },
30
+ "./auth": {
31
+ "types": "./dist/src/solution-auth.d.ts",
32
+ "default": "./dist/solution-auth.js"
25
33
  }
26
34
  },
27
35
  "bin": {
@@ -31,5 +39,5 @@
31
39
  "dist"
32
40
  ],
33
41
  "private": false,
34
- "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
42
+ "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
35
43
  }