@uipath/solution-tool 1.203.0-preview.203 → 1.204.0-preview.206
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 +2 -2
- package/dist/THIRD-PARTY-NOTICES.md +42 -4
- package/dist/deploy-delete-service-y9dwehmn.js +22 -0
- package/dist/deploy-status-service-nmhnnjmy.js +256 -0
- package/dist/deploy.d.ts +11 -4
- package/dist/deploy.js +19 -7
- package/dist/deployment-search-eb337bjh.js +49 -0
- package/dist/{embedded-file-reader-xxqe8vs8.js → embedded-file-reader-rf2g1kfj.js} +2 -2
- package/dist/feed-resolver-dmtnswcc.js +27 -0
- package/dist/feed-scope-failure-e2yaqfg2.js +18 -0
- package/dist/feed-session-sxga31vn.js +17 -0
- package/dist/index.js +27 -18
- package/dist/init.js +10 -7
- package/dist/{list-n0xd5rgn.js → list-rbjqgz6s.js} +9 -6
- package/dist/pack.js +14 -11
- package/dist/{packager-tool-vas0xg5h.js → packager-tool-2cntqvdv.js} +5 -3
- package/dist/{packager-tool-1haahq17.js → packager-tool-3enm2h28.js} +5 -5
- package/dist/{packager-tool-2syrt51a.js → packager-tool-3fv6zc86.js} +1062 -825
- package/dist/packager-tool-3fyq6wjs.js +5889 -0
- package/dist/{packager-tool-k4mskzww.js → packager-tool-5dzjsw5q.js} +3 -3
- package/dist/{packager-tool-0f0wt9vh.js → packager-tool-5fjp60dk.js} +3071 -2794
- package/dist/{packager-tool-x6gzyxnn.js → packager-tool-752zvh64.js} +756 -359
- package/dist/{packager-tool-bkwnetqn.js → packager-tool-83rzavkx.js} +383 -88
- package/dist/{packager-tool-7znqtw3f.js → packager-tool-9vvdgbay.js} +8 -6
- package/dist/packager-tool-b8pppqbb.js +172 -0
- package/dist/packager-tool-bqre28m1.js +43 -0
- package/dist/packager-tool-dh0m3ebf.js +173 -0
- package/dist/packager-tool-f5gq77m5.js +28 -0
- package/dist/{packager-tool-nzghfa48.js → packager-tool-fv7xyzg2.js} +550 -2
- package/dist/{packager-tool-3jrq7smt.js → packager-tool-gb35b4qs.js} +206 -289
- package/dist/{packager-tool-j2cqgegq.js → packager-tool-he7ak44z.js} +16 -74
- package/dist/packager-tool-myn57mc3.js +322 -0
- package/dist/{packager-tool-4rzjjv2p.js → packager-tool-n1nzj2b9.js} +1008 -647
- package/dist/packager-tool-n6yb6zp9.js +113 -0
- package/dist/{packager-tool-h4wn0y42.js → packager-tool-qgaqqq41.js} +320 -151
- package/dist/{packager-tool-resolver-fmjr60x8.js → packager-tool-resolver-2cbxyq6k.js} +6 -5
- package/dist/{packager-tool-ge4rvy7p.js → packager-tool-t12hj6pd.js} +1022 -1342
- package/dist/{packager-tool-znakt6yw.js → packager-tool-vh4ng74p.js} +8 -6
- package/dist/packager-tool-vmsxq1pc.js +104 -0
- package/dist/packager-tool-w6jr4638.js +166 -0
- package/dist/packager-tool-zf3929se.js +237 -0
- package/dist/packager-tool-zns6n8zp.js +837 -0
- package/dist/packager-tool-zw3036b8.js +37 -0
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-p3gzdecy.js +25 -0
- package/dist/{project-contributions-cvttys34.js → project-contributions-txe8v6sm.js} +12 -9
- package/dist/publish.js +12 -7
- package/dist/resource.js +9 -6
- package/dist/services/activation.d.ts +17 -2
- package/dist/services/deploy-activate-service.d.ts +10 -0
- package/dist/services/deploy-delete-service.d.ts +82 -0
- package/dist/services/deploy-list-service.d.ts +15 -45
- package/dist/services/deploy-run-service.d.ts +36 -23
- package/dist/services/deploy-upgrade-service.d.ts +198 -39
- package/dist/services/deployment-feed-locator.d.ts +50 -12
- package/dist/services/deployment-search-client.d.ts +55 -0
- package/dist/services/deployment-search.d.ts +87 -34
- package/dist/services/deployment-state.d.ts +119 -0
- package/dist/services/feed-resolver.d.ts +31 -0
- package/dist/services/feed-session.d.ts +70 -0
- package/dist/services/folder-helper.d.ts +4 -27
- package/dist/services/http-status.d.ts +9 -0
- package/dist/services/incomplete-feed-sweep.d.ts +77 -0
- package/dist/services/legacy-deployment-search-v3.d.ts +23 -0
- package/dist/services/packages-list-service.d.ts +5 -0
- package/dist/services/pipeline-deploy-poll.d.ts +69 -0
- package/dist/services/publish-service.d.ts +14 -16
- package/dist/services/search-failure.d.ts +27 -0
- package/dist/templates/AGENTS.md +60 -20
- package/dist/tool.js +27 -18
- package/dist/utils/deployment-errors.d.ts +57 -0
- package/package.json +2 -2
- package/dist/packager-tool-07bqr90h.js +0 -51960
- package/dist/packager-tool-jz2wbfjz.js +0 -2275
- package/dist/prepare-solution-resources-wds3r8bq.js +0 -22
- package/dist/services/personal-workspace-deploy.d.ts +0 -49
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { DeploymentsApi, InitOverrideFunction } from "@uipath/solution-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* A deployed resource the service flags `requiresConfiguration` — the reason a
|
|
4
|
+
* deployment sits in `NeedsSetupToActivate` instead of running.
|
|
5
|
+
*/
|
|
6
|
+
export interface PendingResource {
|
|
7
|
+
key: string;
|
|
8
|
+
name: string;
|
|
9
|
+
/** The service's resource kind: `connection`, `asset`, `process`, … */
|
|
10
|
+
kind: string;
|
|
11
|
+
/** Service-specific type — the connector key of a connection, `stringAsset` for an asset. */
|
|
12
|
+
type?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Why it needs configuration, from the deployment's activation validation:
|
|
15
|
+
* `[CNS1072] You will need to authenticate this connection before
|
|
16
|
+
* proceeding further`. Absent when that result could not be read or names
|
|
17
|
+
* no error for the resource.
|
|
18
|
+
*/
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
/** The fields the state helpers read. Both deployment DTOs carry them. */
|
|
22
|
+
export interface DeploymentStateRecord {
|
|
23
|
+
name: string;
|
|
24
|
+
operation?: string | null;
|
|
25
|
+
operationStatus?: string | null;
|
|
26
|
+
activationStatus?: string | null;
|
|
27
|
+
packageVersion?: string | null;
|
|
28
|
+
currentPackageVersion?: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A deployment name as an argument in a suggested command, for the shells the
|
|
32
|
+
* suggestion is pasted into. Single quotes only: neither PowerShell nor a
|
|
33
|
+
* POSIX shell evaluates anything inside them, so a name carrying `$(…)` or a
|
|
34
|
+
* backtick stays a name. Double quotes would not do — both shells expand
|
|
35
|
+
* `$(…)` inside them. A name with an apostrophe uses the POSIX
|
|
36
|
+
* close-and-reopen escape, `'\''`; PowerShell reads that as a parse error
|
|
37
|
+
* rather than running anything, which is the acceptable failure for a name
|
|
38
|
+
* that rare.
|
|
39
|
+
*/
|
|
40
|
+
export declare function quoteForShell(name: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* The resources a deployment still needs configured before it can be
|
|
43
|
+
* activated.
|
|
44
|
+
*
|
|
45
|
+
* `GET /api/deployments/{key}/resources` is the one place the service says
|
|
46
|
+
* *why* a deployment is not live: every row carries `requiresConfiguration`.
|
|
47
|
+
* Ask with the deployment key alone. Its `folderKey` parameter is the
|
|
48
|
+
* solution-internal folder, not the Orchestrator folder the deployment landed
|
|
49
|
+
* in, and the wrong one is a 400 (measured 2026-09-23).
|
|
50
|
+
*
|
|
51
|
+
* Best-effort: `undefined` when the read fails — or when the page cap cut the
|
|
52
|
+
* listing short, because a partial list presented as "the pending resources"
|
|
53
|
+
* would omit rows. Every caller is reporting a state that is already final,
|
|
54
|
+
* so neither turns into a failed command; the callers say the read failed.
|
|
55
|
+
*/
|
|
56
|
+
export declare function readPendingResourcesAsync(api: DeploymentsApi, deploymentKey: string, scope?: InitOverrideFunction): Promise<PendingResource[] | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* One line naming the resources and, when known, why each needs
|
|
59
|
+
* configuration: `connection 'Outlook' (uipath-microsoft-outlook365): [CNS1072]
|
|
60
|
+
* You will need to authenticate this connection before proceeding further;
|
|
61
|
+
* asset 'Config' (stringAsset)`, cut short past ten. The type is left out
|
|
62
|
+
* when it only repeats the kind.
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatPendingResources(resources: PendingResource[]): string;
|
|
65
|
+
/**
|
|
66
|
+
* What is left before a deployment runs, read from its `activationStatus`.
|
|
67
|
+
*
|
|
68
|
+
* `OperationStatus: Successful` only says the content is in place; whether it
|
|
69
|
+
* runs is a second axis, and the two disagree exactly when an upgrade lands in
|
|
70
|
+
* `NeedsSetupToActivate` — installed, reported successful, not live
|
|
71
|
+
* (STUD-81555). Returns `undefined` for `Active`, where nothing is left, and
|
|
72
|
+
* for the states that ask nothing of the user.
|
|
73
|
+
*
|
|
74
|
+
* `pendingResources` is what {@link readPendingResourcesAsync} returned:
|
|
75
|
+
* `undefined` when the read failed, which is said rather than hidden.
|
|
76
|
+
*/
|
|
77
|
+
export declare function activationNextSteps(deployment: DeploymentStateRecord, pendingResources?: PendingResource[]): string[] | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Append the deployment's own state to error instructions when that state is
|
|
80
|
+
* the reason the command was refused — a pending draft, or an install that is
|
|
81
|
+
* waiting for setup. The generic instructions cover neither, and the
|
|
82
|
+
* service's refusal (`4007 … cannot be activated`) names neither.
|
|
83
|
+
*
|
|
84
|
+
* A `Draft` means different things by `operation`: an Install draft is a
|
|
85
|
+
* deploy whose install never completed; an ActivationSetup draft is a setup
|
|
86
|
+
* the UI started and did not finish; a VersionChange draft is an upgrade that
|
|
87
|
+
* was queued and never installed. Branching on `operationStatus` alone sent
|
|
88
|
+
* every one of them to "fix the deploy run validation errors" (STUD-81555).
|
|
89
|
+
*/
|
|
90
|
+
export declare function appendDeploymentStateInstructions(instructions: string, deployment?: DeploymentStateRecord, pendingResources?: PendingResource[], feedSelector?: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* The state that explains why the service refused to act on a deployment:
|
|
93
|
+
* a pending draft, or an install waiting for setup. `undefined` for every
|
|
94
|
+
* other state — there the refusal has some other cause, and the caller's
|
|
95
|
+
* generic advice stands.
|
|
96
|
+
*/
|
|
97
|
+
export declare function explainRefusal(deployment: DeploymentStateRecord, pendingResources?: PendingResource[], feedSelector?: string): string[] | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the resources route has something to say about a record: an
|
|
100
|
+
* installed deployment waiting for setup, or the `ActivationSetup` draft the
|
|
101
|
+
* Orchestrator wizard leaves behind when it is started and not finished. The
|
|
102
|
+
* draft answers the route too, and `deploymentsGetByKey` reports its
|
|
103
|
+
* `activationStatus` as `None` where the search row says
|
|
104
|
+
* `NeedsSetupToActivate` (both measured 2026-09-23) — hence the operation is
|
|
105
|
+
* checked as well as the status.
|
|
106
|
+
*/
|
|
107
|
+
export declare function needsPendingResources(deployment: DeploymentStateRecord): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* What is left before a deployment runs, read from both axes. A `Draft` is a
|
|
110
|
+
* pending operation and is described as one — for an `ActivationSetup` draft
|
|
111
|
+
* together with the resources it waits for; every other record defers to
|
|
112
|
+
* {@link activationNextSteps}.
|
|
113
|
+
*
|
|
114
|
+
* `feedSelector` is the flag a generated `deploy list` needs to read the same
|
|
115
|
+
* feed the caller did (`feedSelectorFlag`); empty for the tenant feed. The
|
|
116
|
+
* `activate` and `delete` commands the texts name find their feed themselves
|
|
117
|
+
* and take none.
|
|
118
|
+
*/
|
|
119
|
+
export declare function deploymentNextSteps(deployment: DeploymentStateRecord, pendingResources?: PendingResource[], feedSelector?: string): string[] | undefined;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type CliErrorCode, type ErrorContext, type RetryHint } from "@uipath/common";
|
|
1
2
|
import type { InitOverrideFunction } from "@uipath/solution-sdk";
|
|
3
|
+
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
|
|
2
4
|
/** Which feed a publish/deploy/query is scoped to. */
|
|
3
5
|
export type FeedKind = "tenant" | "personal" | "folder";
|
|
4
6
|
export interface FeedScope {
|
|
@@ -20,6 +22,15 @@ export interface FeedScope {
|
|
|
20
22
|
*/
|
|
21
23
|
export declare function folderKeyInitOverride(folderKey: string): InitOverrideFunction;
|
|
22
24
|
export declare function feedScopeInitOverride(scope: FeedScope): InitOverrideFunction | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The flag a generated `uip solution deploy …` command must carry to read the
|
|
27
|
+
* same feed the caller did: ` --personal-workspace`, ` --feed <folder key>`,
|
|
28
|
+
* or nothing for the tenant feed. A follow-up printed without it points an
|
|
29
|
+
* agent at the tenant feed, where a Personal Workspace record does not exist
|
|
30
|
+
* — the record it was just told about would then read as "not found".
|
|
31
|
+
* Leading space included, so callers append it to a command verbatim.
|
|
32
|
+
*/
|
|
33
|
+
export declare function feedSelectorFlag(scope: Pick<FeedScope, "kind" | "folderKey"> | undefined): string;
|
|
23
34
|
export interface ResolveFeedScopeOptions {
|
|
24
35
|
/** Target the caller's own Personal Workspace feed. */
|
|
25
36
|
personalWorkspace?: boolean;
|
|
@@ -30,6 +41,26 @@ export interface ResolveFeedScopeOptions {
|
|
|
30
41
|
envFilePath?: string;
|
|
31
42
|
}
|
|
32
43
|
export declare function feedResolutionFailureInstructions(options: Pick<ResolveFeedScopeOptions, "personalWorkspace" | "feed">): string;
|
|
44
|
+
/** Everything an envelope needs to report a {@link resolveFeedScope} that threw. */
|
|
45
|
+
export interface FeedResolutionFailure {
|
|
46
|
+
message: string;
|
|
47
|
+
instructions: string;
|
|
48
|
+
errorCode: CliErrorCode;
|
|
49
|
+
retry: RetryHint;
|
|
50
|
+
context?: ErrorContext;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Describe a {@link resolveFeedScope} that threw.
|
|
54
|
+
*
|
|
55
|
+
* An external app has no Personal Workspace, and the Orchestrator lookup
|
|
56
|
+
* refuses it with a generated-client error that says nothing on its own
|
|
57
|
+
* ("Response returned an error code"). So when an external app's lookup is
|
|
58
|
+
* refused — the server answered with a 4xx — the failure names the cause.
|
|
59
|
+
* Anything else keeps the error's own classification, for an external app
|
|
60
|
+
* too: a 5xx, a timeout or a network failure is an outage that another
|
|
61
|
+
* session would not fix, and must not read as `RetryWillNotFix`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function describeFeedResolutionFailureAsync(error: unknown, options: Pick<ResolveFeedScopeOptions, "personalWorkspace" | "feed">, session: Pick<SolutionAuthContext, "accessToken" | "identity">): Promise<FeedResolutionFailure>;
|
|
33
64
|
/**
|
|
34
65
|
* Turn the CLI feed flags into a validated {@link FeedScope} — the single
|
|
35
66
|
* choke point every feed-aware command uses.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type SessionIdentity } from "@uipath/auth";
|
|
2
|
+
/** What the access token says about who is acting, as far as a feed is concerned. */
|
|
3
|
+
export type FeedSessionVerdict = "user" | "application" | "unknown";
|
|
4
|
+
/**
|
|
5
|
+
* Whether this session may send `X-UIPATH-FolderKey` and expect it honoured.
|
|
6
|
+
*
|
|
7
|
+
* Not an authorization decision — the server makes those — but a prediction
|
|
8
|
+
* of what the server does with the header: its authorization filter applies
|
|
9
|
+
* it on the user-token branch only, so an application token's request runs
|
|
10
|
+
* against the tenant feed and, for an install, creates or updates a
|
|
11
|
+
* deployment there under the requested name. The doc comment on
|
|
12
|
+
* `resolveSessionIdentity` is right that it must never decide *trust*; here
|
|
13
|
+
* it decides whether to make a request whose wrong outcome is a mutation of
|
|
14
|
+
* the wrong feed, and a session it cannot classify fails closed for the same
|
|
15
|
+
* reason: the cost of refusing is one `uip login`, the cost of guessing wrong
|
|
16
|
+
* is a deployment in the wrong place.
|
|
17
|
+
*
|
|
18
|
+
* The auth context's `identity` is preferred: the login status resolved it
|
|
19
|
+
* from the token's claims *and* the auth flow this CLI persisted at login
|
|
20
|
+
* (`client_credentials` marks an application even on a token whose claims
|
|
21
|
+
* say nothing), which decoding the token here again cannot know. The decode
|
|
22
|
+
* is the fallback for a context that carries none.
|
|
23
|
+
*/
|
|
24
|
+
export declare function classifyFeedSession(session: {
|
|
25
|
+
accessToken: string;
|
|
26
|
+
identity?: SessionIdentity;
|
|
27
|
+
}): FeedSessionVerdict;
|
|
28
|
+
/**
|
|
29
|
+
* The message and instructions for a refused feed-scoped request.
|
|
30
|
+
*
|
|
31
|
+
* @param action what was asked, e.g. "Deploying into a Personal Workspace"
|
|
32
|
+
* @param alternative what else the caller can do, e.g. "deploy the package to the tenant feed"
|
|
33
|
+
*/
|
|
34
|
+
export declare function feedSessionRefusal(verdict: Exclude<FeedSessionVerdict, "user">, action: string, alternative: string): {
|
|
35
|
+
message: string;
|
|
36
|
+
instructions: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The refusal an external app gets for a *read* of a feed other than the
|
|
40
|
+
* tenant's — `deploy list` / `deploy status` with `--feed` or
|
|
41
|
+
* `--personal-workspace` — or undefined for any other session.
|
|
42
|
+
*
|
|
43
|
+
* The server ignores `X-UIPATH-FolderKey` on client-credentials requests, so
|
|
44
|
+
* the read would answer the tenant feed's rows as if they were the selected
|
|
45
|
+
* feed's (measured on staging). Unlike a mutation, a session whose kind cannot
|
|
46
|
+
* be read is let through: the worst it gets is a wrong read, which a refusal
|
|
47
|
+
* would only trade for a broken one that worked before.
|
|
48
|
+
*/
|
|
49
|
+
export declare function feedReadRefusalForApplication(session: {
|
|
50
|
+
accessToken: string;
|
|
51
|
+
identity?: SessionIdentity;
|
|
52
|
+
}, action: string): {
|
|
53
|
+
message: string;
|
|
54
|
+
instructions: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* A feed read refused for an external app (see
|
|
58
|
+
* {@link feedReadRefusalForApplication}), raised where the refusal is found
|
|
59
|
+
* so the command can report it as `permission_denied`.
|
|
60
|
+
*/
|
|
61
|
+
export declare class FeedReadRefusedError extends Error {
|
|
62
|
+
readonly refusal: {
|
|
63
|
+
message: string;
|
|
64
|
+
instructions: string;
|
|
65
|
+
};
|
|
66
|
+
constructor(refusal: {
|
|
67
|
+
message: string;
|
|
68
|
+
instructions: string;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -1,39 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve parent folder from --parent-folder-path, --parent-folder-key, or
|
|
3
|
-
* --personal-workspace options.
|
|
4
|
-
*
|
|
5
|
-
* Returns the fully qualified folder path string the deploy endpoint expects
|
|
6
|
-
* as `folderFullyQualifiedName`, or undefined if none of the three options
|
|
7
|
-
* was provided.
|
|
8
|
-
*
|
|
9
|
-
* Mutual exclusivity is enforced at parse time by Commander via
|
|
10
|
-
* `Option#conflicts()` in the calling command — see `deploy-run.ts`.
|
|
11
|
-
* Personal Workspace is resolved via Orchestrator's `GetPersonalWorkspace`
|
|
12
|
-
* endpoint using the current auth context — see
|
|
13
|
-
* {@link resolvePersonalWorkspace} for the contract.
|
|
14
|
-
*/
|
|
1
|
+
/** The folder's full path, or `undefined` when no folder option was given. */
|
|
15
2
|
export declare function resolveParentFolder(options: {
|
|
16
3
|
folderPath?: string;
|
|
17
4
|
folderKey?: string;
|
|
18
5
|
personalWorkspace?: boolean;
|
|
19
6
|
tenant?: string;
|
|
20
7
|
loginValidity?: number;
|
|
21
|
-
/**
|
|
22
|
-
* `resolvePersonalWorkspace`/`resolveFolder` so it matches the deploy auth. */
|
|
8
|
+
/** Same `.uipath/.auth` path as the caller, so the lookup uses its auth. */
|
|
23
9
|
envFilePath?: string;
|
|
24
10
|
}): Promise<string | undefined>;
|
|
25
11
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Unlike {@link resolveParentFolder}, which passes a --parent-folder-path
|
|
30
|
-
* through verbatim (the tenant Pipelines install takes an FQN and validates
|
|
31
|
-
* server-side), this always hits the Folders API: feed deploys need the
|
|
32
|
-
* location folder's *key* for the auto-install request's
|
|
33
|
-
* `installationFolderKey` — the server creates the solution folder under that
|
|
34
|
-
* key, so sending the wrong one silently installs in the wrong place.
|
|
35
|
-
*
|
|
36
|
-
* Returns `undefined` when neither option was provided.
|
|
12
|
+
* Key and full path of a folder, always read from the Folders API: feed
|
|
13
|
+
* deploys install under the key, so a wrong one installs in the wrong place.
|
|
37
14
|
*/
|
|
38
15
|
export declare function resolveFolderInfo(options: {
|
|
39
16
|
folderPath?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP status an SDK error carries — from the `Response` a generated
|
|
3
|
+
* client attaches, or from the error's own `status` — and `undefined` when it
|
|
4
|
+
* carries none (a transport failure, a thrown string). Lets a caller tell the
|
|
5
|
+
* one status that means "no such record" (404) from every other failure.
|
|
6
|
+
*/
|
|
7
|
+
export declare function httpStatusOf(error: unknown): number | undefined;
|
|
8
|
+
/** A 401/403: the server refused this login, as opposed to failing. */
|
|
9
|
+
export declare function isAuthRefusal(error: unknown): boolean;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type CliErrorCode, type RetryHint } from "@uipath/common";
|
|
2
|
+
import type { FeedKind } from "./feed-resolver";
|
|
3
|
+
/**
|
|
4
|
+
* Why a feed was not searched.
|
|
5
|
+
*
|
|
6
|
+
* - `search_failed`: the feed's own search failed.
|
|
7
|
+
* - `listing_failed`: the publish-locations listing failed, so the entry
|
|
8
|
+
* stands for every folder feed — none of them was known, let alone searched.
|
|
9
|
+
* - `workspace_unresolved`: the listing failed and resolving the Personal
|
|
10
|
+
* Workspace through Orchestrator failed too, so its key is unknown.
|
|
11
|
+
* - `no_key`: the listing named the feed but gave it no folder key, and a
|
|
12
|
+
* search without one would go to the tenant feed instead.
|
|
13
|
+
*/
|
|
14
|
+
export type SkipReason = "search_failed" | "listing_failed" | "workspace_unresolved" | "no_key";
|
|
15
|
+
/**
|
|
16
|
+
* A feed the deployment sweep could not search, and why.
|
|
17
|
+
*
|
|
18
|
+
* `tenant` appears only when the tenant search itself failed. The sweep stops
|
|
19
|
+
* there, so no other feed was searched either.
|
|
20
|
+
*/
|
|
21
|
+
export interface SkippedFeed {
|
|
22
|
+
kind: FeedKind;
|
|
23
|
+
reason: SkipReason;
|
|
24
|
+
/** The feed's folder key, when the sweep knew it. */
|
|
25
|
+
folderKey?: string;
|
|
26
|
+
/** The feed's name from the listing, for a `no_key` row. */
|
|
27
|
+
name?: string;
|
|
28
|
+
error: Error;
|
|
29
|
+
}
|
|
30
|
+
/** How an incomplete miss is reported: which feeds, how retryable, and what to do. */
|
|
31
|
+
export interface IncompleteSweepReport {
|
|
32
|
+
/** Says the name was not found where the sweep could look, and names the feeds it could not. */
|
|
33
|
+
message: string;
|
|
34
|
+
errorCode: CliErrorCode;
|
|
35
|
+
retry: RetryHint;
|
|
36
|
+
/** The cause's error details, for the `Details:` tail of the instructions. */
|
|
37
|
+
details: string;
|
|
38
|
+
/** What to do about the cause: log in, fix access, or retry. */
|
|
39
|
+
nextStep: string;
|
|
40
|
+
/**
|
|
41
|
+
* The feed flags that can still look in one feed directly, in the order
|
|
42
|
+
* to suggest them; empty when none can. Each verb puts them in its own
|
|
43
|
+
* command.
|
|
44
|
+
*/
|
|
45
|
+
oneFeedFlags: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether a refusal from the tenant feed is one a skipped feed can explain: a
|
|
49
|
+
* 404, or a 400. `activate` and `uninstall` send only the deployment name, so
|
|
50
|
+
* their 400 is about the name or feed (`4007 … cannot be activated`, "cannot
|
|
51
|
+
* be uninstalled"). A 409 or 422 shares `invalid_argument` with that 400, but
|
|
52
|
+
* like every other class it is the request's own answer.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isNameOrFeedRefusal(errorCode: CliErrorCode, httpStatus: number | undefined): boolean;
|
|
55
|
+
/** The sentence every verb opens its instructions with; each adds its own way out. */
|
|
56
|
+
export declare const INCOMPLETE_SWEEP_ADVICE = "The deployment may be in a feed that was not searched.";
|
|
57
|
+
/**
|
|
58
|
+
* What the user can do about a failure of this class. The retry case names
|
|
59
|
+
* the service to wait for; the others do not depend on it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function retryAdvice(errorCode: CliErrorCode, retry: RetryHint, service: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Describe a sweep that found nothing but could not search every feed.
|
|
64
|
+
*
|
|
65
|
+
* The classification is the cause's own — a 503 stays `server_error` /
|
|
66
|
+
* `RetryLater`, a dropped connection `network_error`, a 403
|
|
67
|
+
* `permission_denied` / `RetryWillNotFix`. The cause is the first skipped
|
|
68
|
+
* feed whose failure has a known class, so a key-less row listed before a
|
|
69
|
+
* search that answered 403 does not hide the 403; with none, it is the first.
|
|
70
|
+
* Two classes are overridden, because "a feed did not answer" is not "no such
|
|
71
|
+
* deployment": a feed that answered 404 is not reported as `not_found`, and a
|
|
72
|
+
* failure with no known class does not rule a retry out. Both become
|
|
73
|
+
* `unknown_error` / `RetryLater` — except when every skipped feed is a listed
|
|
74
|
+
* row with no key: the listing answered, so a retry gets the same rows, and
|
|
75
|
+
* that is `unknown_error` / `RetryWillNotFix` with its own next step.
|
|
76
|
+
*/
|
|
77
|
+
export declare function reportIncompleteSweepAsync(deploymentName: string, skipped: readonly SkippedFeed[]): Promise<IncompleteSweepReport>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DeploymentSearchItemDto2, type DeploymentsSearchRequest2, type InitOverrideFunction } from "@uipath/solution-sdk";
|
|
2
|
+
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
|
|
3
|
+
import type { DeploymentSearchQuery } from "./deployment-search-client";
|
|
4
|
+
/**
|
|
5
|
+
* The deployment search as it was before the Pipelines route:
|
|
6
|
+
* `POST /api/v3/search/deployments`. It reads user tokens only, and has no
|
|
7
|
+
* exact-name filter, so a name travels as the substring `searchTerm` and the
|
|
8
|
+
* callers keep their own exact match.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated A bridge for rings that predate
|
|
11
|
+
* `POST /v1/pipelines/deployments/search` (SOL-7807), not a second path.
|
|
12
|
+
* Reached only through `searchDeploymentsPage`, and only when the server
|
|
13
|
+
* answers the Pipelines route with "no such route". Remove this file, its
|
|
14
|
+
* branch in `deployment-search-client.ts`, and the `/api/v3/search/deployments`
|
|
15
|
+
* entry the solution-sdk generator keeps for it, once the Pipelines route is on
|
|
16
|
+
* every production ring.
|
|
17
|
+
*/
|
|
18
|
+
export declare function searchDeploymentsLegacyV3(auth: SolutionAuthContext, query: DeploymentSearchQuery, scope?: InitOverrideFunction): Promise<{
|
|
19
|
+
count?: number;
|
|
20
|
+
values: DeploymentSearchItemDto2[];
|
|
21
|
+
}>;
|
|
22
|
+
/** @deprecated See {@link searchDeploymentsLegacyV3}. */
|
|
23
|
+
export declare function toLegacyV3Request(query: DeploymentSearchQuery): DeploymentsSearchRequest2;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CliErrorCode, type ErrorContext, type RetryHint } from "@uipath/common";
|
|
1
2
|
import type { SortDirection } from "./deploy-list-service";
|
|
2
3
|
/**
|
|
3
4
|
* Per-package row in {@link ListPackagesSuccess.packages}. Mirrors solution-sdk's
|
|
@@ -60,6 +61,10 @@ export interface ListPackagesFailure {
|
|
|
60
61
|
message: string;
|
|
61
62
|
instructions: string;
|
|
62
63
|
exitCode: number;
|
|
64
|
+
/** Set when the failure mode is known; the formatter infers one otherwise. */
|
|
65
|
+
errorCode?: CliErrorCode;
|
|
66
|
+
retry?: RetryHint;
|
|
67
|
+
context?: ErrorContext;
|
|
63
68
|
}
|
|
64
69
|
export type ListPackagesResult = ListPackagesSuccess | ListPackagesFailure;
|
|
65
70
|
/**
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type PollUntilResult } from "@uipath/common";
|
|
2
|
+
import type { PipelineDeploymentResult, PipelineDeploymentStatus, PipelinesApi } from "@uipath/pipelines-sdk";
|
|
3
|
+
import type { InitOverrideFunction } from "@uipath/solution-sdk";
|
|
4
|
+
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
|
|
5
|
+
/**
|
|
6
|
+
* Statuses at which `GET /v1/pipelines/deployments/{id}/deployment-status`
|
|
7
|
+
* stops changing. `ValidationFailed` is terminal: the pipeline validates
|
|
8
|
+
* against the target *before* it schedules the install, and a failed
|
|
9
|
+
* validation never schedules one.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PIPELINE_TERMINAL_STATUSES: ReadonlySet<PipelineDeploymentStatus>;
|
|
12
|
+
export interface PipelineDeployPollOptions {
|
|
13
|
+
/** From the `pipelinesInstall` response. */
|
|
14
|
+
pipelineDeploymentId: string;
|
|
15
|
+
/** The deployment being installed — the search-service fallback looks it up by name. */
|
|
16
|
+
deploymentName: string;
|
|
17
|
+
/**
|
|
18
|
+
* `X-UIPATH-FolderKey` override for a feed / Personal Workspace
|
|
19
|
+
* deployment; undefined for the tenant feed. Applied to the status read
|
|
20
|
+
* *and* to the search fallback — a tenant-scoped search cannot see a feed
|
|
21
|
+
* deployment, so the fallback would report "gone" without it.
|
|
22
|
+
*/
|
|
23
|
+
scope?: InitOverrideFunction;
|
|
24
|
+
timeoutMs: number;
|
|
25
|
+
intervalMs: number;
|
|
26
|
+
/** Host-side cancellation (Ctrl-C, VS Code cancel). */
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
/** Prefix for the poll's progress log lines, e.g. `"deploy"` or `"deploy upgrade"`. */
|
|
29
|
+
logPrefix: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A terminal result the poll produced from the deployment's own record rather
|
|
33
|
+
* than the pipelines run. `synthesizedOperation` is set only on that path:
|
|
34
|
+
* the record carries the deployment's `operation` (`VersionChange` vs
|
|
35
|
+
* `ConfigurationChange`), which the pipelines DTO reports under
|
|
36
|
+
* `deploymentResult` and a synthesized result would otherwise lose.
|
|
37
|
+
*/
|
|
38
|
+
export type PolledPipelineResult = PipelineDeploymentResult & {
|
|
39
|
+
synthesizedOperation?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Poll a Pipelines install to a terminal state.
|
|
43
|
+
*
|
|
44
|
+
* The pipelines service recycles its in-flight record once the run is
|
|
45
|
+
* terminal, after which the status endpoint answers 404
|
|
46
|
+
* `PipelineDeploymentNotFound`. That 404 is not an error: the persistent
|
|
47
|
+
* record lives in the search service, so the read falls back to it and
|
|
48
|
+
* synthesises a terminal result from the deployment's `operationStatus`.
|
|
49
|
+
*
|
|
50
|
+
* Which record is this run's is decided by **identity, never by name**.
|
|
51
|
+
* Every status read carries `deploymentKey`, the run's own deployment row
|
|
52
|
+
* (the run record references it from creation, and the first read happens
|
|
53
|
+
* as soon as the install is accepted), so by the time the record is recycled
|
|
54
|
+
* the poll knows exactly which row to ask for. Nothing else can pass for it:
|
|
55
|
+
* not another generation of the same name, not a concurrent run reusing it,
|
|
56
|
+
* not an uninstall's history row. Two reads answer for that key, in order:
|
|
57
|
+
* the Pipelines by-key lookup, which takes S2S and so serves the CI/CD
|
|
58
|
+
* caller this command exists for; then the Solutions search, for user
|
|
59
|
+
* sessions on a server that predates the lookup. Without a key — the record
|
|
60
|
+
* recycled before any read answered — the poll does not guess from the name:
|
|
61
|
+
* it reports the run as still in flight and lets the caller's deadline
|
|
62
|
+
* decide, which at worst is an honest timeout pointing at `deploy list`. The
|
|
63
|
+
* same holds while the record is not indexed yet or still `Draft`.
|
|
64
|
+
*
|
|
65
|
+
* Returns the raw `pollUntil` result so each command keeps its own
|
|
66
|
+
* interpretation — `deploy run` recovers activation states that `deploy
|
|
67
|
+
* upgrade` never sees.
|
|
68
|
+
*/
|
|
69
|
+
export declare function pollPipelineDeploymentAsync(api: PipelinesApi, auth: SolutionAuthContext, options: PipelineDeployPollOptions): Promise<PollUntilResult<PolledPipelineResult>>;
|
|
@@ -35,15 +35,15 @@ export interface PublishSuccess {
|
|
|
35
35
|
/** Orchestrator's stable key for this exact version (uuid). Always populated. */
|
|
36
36
|
packageVersionKey: string;
|
|
37
37
|
/**
|
|
38
|
-
* Package name as published.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* Package name as published. Every feed now uploads through the Pipelines
|
|
39
|
+
* endpoint, which answers with the full version DTO, so this is populated
|
|
40
|
+
* in practice; it stays optional because it is part of the published
|
|
41
|
+
* result type and callers already branch on its absence.
|
|
42
42
|
*/
|
|
43
43
|
packageName?: string;
|
|
44
|
-
/** Package version (semver).
|
|
44
|
+
/** Package version (semver). */
|
|
45
45
|
packageVersion?: string;
|
|
46
|
-
/** Terminal state when `wait: true` (`"Ready"`/`"Active"`), else the upload's immediate state.
|
|
46
|
+
/** Terminal state when `wait: true` (`"Ready"`/`"Active"`), else the upload's immediate state. */
|
|
47
47
|
state?: string;
|
|
48
48
|
/** Which feed the package landed in — drives telemetry `target`. */
|
|
49
49
|
feedKind: FeedScope["kind"];
|
|
@@ -75,15 +75,13 @@ export type PublishResult = PublishSuccess | PublishFailure;
|
|
|
75
75
|
* {@link PublishResult} for expected failures; re-throws only on unexpected
|
|
76
76
|
* SDK errors. Does not touch `OutputFormatter` / `processContext`.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* same feed scope as the upload: unscoped, it 404s for anything outside the
|
|
87
|
-
* tenant feed.
|
|
78
|
+
* One upload path for every feed: `PipelinesApi.pipelinesPackageUpload`
|
|
79
|
+
* (`POST /v2/pipelines/packages`), with `locationKey` selecting the feed —
|
|
80
|
+
* absent for the tenant feed, the feed's folder key for a Personal Workspace
|
|
81
|
+
* or folder feed. It answers with the full version DTO, so name/version/state
|
|
82
|
+
* need no follow-up lookup, and the CI service principal is authorized for it.
|
|
83
|
+
* The Automation Solutions upload it replaces was only ever needed because the
|
|
84
|
+
* v1 Pipelines route hardcodes `locationKey: null` server-side and so cannot
|
|
85
|
+
* leave the tenant feed.
|
|
88
86
|
*/
|
|
89
87
|
export declare function publishSolutionAsync(packagePath: string, options?: PublishOptions): Promise<PublishResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CliErrorCode, type ErrorContext, type RetryHint } from "@uipath/common";
|
|
2
|
+
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
|
|
3
|
+
/** Everything an envelope needs to report a failed Solution Search listing. */
|
|
4
|
+
export interface SearchFailure {
|
|
5
|
+
message: string;
|
|
6
|
+
instructions: string;
|
|
7
|
+
errorCode: CliErrorCode;
|
|
8
|
+
retry: RetryHint;
|
|
9
|
+
context?: ErrorContext;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Describe a failed Solution Search listing (`packages list`, `deploy list`).
|
|
13
|
+
*
|
|
14
|
+
* The packages search accepts user tokens only, so it answers an external app
|
|
15
|
+
* with a 401. The generic 401 text says the session is missing or expired,
|
|
16
|
+
* which sends a client-credentials pipeline in a circle: logging in again
|
|
17
|
+
* mints the same kind of token. For that session the failure names the cause
|
|
18
|
+
* instead. The Pipelines deployment search `deploy list` reads accepts
|
|
19
|
+
* application tokens, so it passes `userSessionsOnly: false`: there an app's
|
|
20
|
+
* 401 is the session's own failure. Every other failure keeps the service's
|
|
21
|
+
* own message, with its HTTP status classified into `errorCode` / `retry`.
|
|
22
|
+
*
|
|
23
|
+
* @param what the rows being listed, e.g. "packages"
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeSearchFailureAsync(error: unknown, what: string, session: Pick<SolutionAuthContext, "accessToken" | "identity">, { userSessionsOnly }: {
|
|
26
|
+
userSessionsOnly: boolean;
|
|
27
|
+
}): Promise<SearchFailure>;
|