@uipath/solution-tool 1.205.0-preview.277 → 1.206.0-preview.279
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/dist/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
- package/dist/{cleanup-command-service-dwbrt6d9.js → cleanup-command-service-ejakyhea.js} +34 -31
- package/dist/deploy-delete-service-r7abfh28.js +23 -0
- package/dist/deploy-run-service-rnthz10q.js +23 -0
- package/dist/{deploy-status-service-xw2nzh7m.js → deploy-status-service-6my5vm61.js} +72 -62
- package/dist/deploy.js +35 -37
- package/dist/deployment-search-gfm907tx.js +54 -0
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/feed-resolver-14crsx5y.js +27 -0
- package/dist/feed-scope-failure-67cyybn0.js +20 -0
- package/dist/feed-session-g94q2bjc.js +23 -0
- package/dist/first-party-service-n3vva2m4.js +8 -0
- package/dist/governance-options-t20vsznh.js +19 -0
- package/dist/index-aspmac9f.js +24 -0
- package/dist/index-ddk6v1ej.js +60 -0
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-qq4kre7a.js +93 -0
- package/dist/index-t262f2xv.js +16 -0
- package/dist/index.js +33 -34
- package/dist/init.js +18 -21
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{list-zckdhv0c.js → list-jntan9tx.js} +23 -23
- package/dist/models/pack-command-types.d.ts +3 -1
- package/dist/node-kwzcw5ex.js +25 -0
- package/dist/pack-command-service-pwaeha7y.js +29 -0
- package/dist/{pack-project-erd95bt1.js → pack-project-ztt1hfrs.js} +33 -40
- package/dist/pack.js +26 -30
- package/dist/package-id-4tsg5jsb.js +11 -0
- package/dist/{packager-tool-d3cmmbw1.js → packager-tool-1bz9h5ca.js} +11 -11
- package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
- package/dist/{packager-tool-r1jvvm8y.js → packager-tool-55ztfccd.js} +176 -196
- package/dist/{packager-tool-wrg41m7t.js → packager-tool-95y24705.js} +37 -39
- package/dist/{packager-tool-bkjqza3a.js → packager-tool-9j8e5q1z.js} +184 -33
- package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
- package/dist/packager-tool-a6va4gc5.js +1178 -0
- package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
- package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
- package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
- package/dist/packager-tool-c64hqa8n.js +106 -0
- package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
- package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
- package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
- package/dist/packager-tool-f84z7nds.js +130 -0
- package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
- package/dist/packager-tool-fqs6hdcy.js +290 -0
- package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
- package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
- package/dist/{packager-tool-hsya909c.js → packager-tool-nrhqgr4z.js} +273 -255
- package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
- package/dist/{packager-tool-qqbt4b44.js → packager-tool-pyt9fvty.js} +51 -48
- package/dist/packager-tool-q5d9df2q.js +74 -0
- package/dist/{packager-tool-ph7fg1aa.js → packager-tool-q8ryk6q9.js} +122 -89
- package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
- package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
- package/dist/packager-tool-resolver-td3bhccd.js +20 -0
- package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
- package/dist/{packager-tool-a4bs7wtm.js → packager-tool-snm6s7b5.js} +15 -15
- package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
- package/dist/{packager-tool-f2hsb9ta.js → packager-tool-t3a48ys5.js} +305 -657
- package/dist/{packager-tool-cjjk2ek2.js → packager-tool-t3ahzjh1.js} +356 -298
- package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
- package/dist/packager-tool-vrtabg73.js +2307 -0
- package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
- package/dist/{packager-tool-4pkzxkty.js → packager-tool-vx39dhvn.js} +65 -35
- package/dist/{packager-tool-zn76tbxc.js → packager-tool-w34wyhwf.js} +13 -15
- package/dist/packager-tool-w8bcwfd3.js +280 -0
- package/dist/{packager-tool-3gwrcgrc.js → packager-tool-wm0h0wa1.js} +18 -18
- package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
- package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
- package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
- package/dist/{packager-tool-6tyyvhh0.js → packager-tool-z5r49ky9.js} +75 -9
- package/dist/packager-tool.js +6 -7
- package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
- package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
- package/dist/project-contributions-kh9yftvg.js +27 -0
- package/dist/publish.js +17 -17
- package/dist/resource-mutations-mfn5k1hb.js +27 -0
- package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
- package/dist/resource.js +13 -16
- package/dist/{restore-command-service-2g02d7s1.js → restore-command-service-n880dxre.js} +37 -34
- package/dist/{run-service-6necpy9s.js → run-service-4vhn6mtb.js} +144 -66
- package/dist/services/deploy-activate-service.d.ts +2 -1
- package/dist/services/deployment-search-client.d.ts +2 -1
- package/dist/services/deployment-search.d.ts +39 -0
- package/dist/services/feed-resolver.d.ts +13 -1
- package/dist/services/feed-selection.d.ts +8 -5
- package/dist/services/feed-session.d.ts +34 -0
- package/dist/services/install-run.d.ts +92 -0
- package/dist/services/prepare-solution-resources.d.ts +11 -2
- package/dist/services/project-contributions.d.ts +2 -0
- package/dist/services/project-identity-telemetry.d.ts +3 -0
- package/dist/services/publish-service.d.ts +20 -3
- package/dist/services/solution-identity.d.ts +18 -0
- package/dist/ship-telemetry-bkf3800w.js +16 -0
- package/dist/solution-auth-jxcgd2m0.js +10 -0
- package/dist/solution-identity-92h2fbpa.js +19 -0
- package/dist/templates/AGENTS.md +27 -29
- package/dist/tool.js +32 -33
- package/package.json +2 -2
- package/dist/deploy-delete-service-7py597ng.js +0 -25
- package/dist/deploy-run-service-446bssn0.js +0 -25
- package/dist/deployment-search-qyd6dv0m.js +0 -55
- package/dist/feed-resolver-va10c73n.js +0 -28
- package/dist/feed-scope-failure-3yxfg1x7.js +0 -19
- package/dist/feed-session-7xqphdrg.js +0 -17
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/governance-options-8snbrbt1.js +0 -32
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-fcwmbjap.js +0 -667
- package/dist/index-prm27bvm.js +0 -138
- package/dist/node-9hdy9st1.js +0 -86
- package/dist/pack-command-service-tr3z33gz.js +0 -35
- package/dist/package-id-kdkapmn2.js +0 -13
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-5edvzz80.js +0 -543
- package/dist/packager-tool-6d3fx89p.js +0 -171
- package/dist/packager-tool-d8ng7mex.js +0 -68
- package/dist/packager-tool-gdtpsdn7.js +0 -342
- package/dist/packager-tool-mq5pc4zr.js +0 -418
- package/dist/packager-tool-qw47eyw7.js +0 -43
- package/dist/packager-tool-resolver-994z3jkj.js +0 -23
- package/dist/packager-tool-rg3xgn9a.js +0 -182
- package/dist/packager-tool-sxjehksx.js +0 -5367
- package/dist/packager-tool-yrdyppjd.js +0 -188
- package/dist/prepare-solution-resources-m1djfj62.js +0 -29
- package/dist/project-contributions-79ndycrx.js +0 -32
- package/dist/resource-mutations-c3krjqze.js +0 -36
- package/dist/ship-telemetry-myes7ak5.js +0 -21
- package/dist/solution-auth-aead70sw.js +0 -11
- /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
- /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
|
@@ -1,103 +1,98 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
catchError,
|
|
3
|
+
extractErrorDetails
|
|
4
|
+
} from "./packager-tool-m07vyk89.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
logger,
|
|
7
|
+
DEFAULT_PAGE_SIZE,
|
|
8
|
+
PollOutcome,
|
|
9
|
+
mapPollFailure,
|
|
10
|
+
pollUntil,
|
|
11
|
+
quoteForShell
|
|
12
|
+
} from "./packager-tool-9vrwpgt3.js";
|
|
13
|
+
import {
|
|
14
|
+
getSolutionAuthContext2
|
|
15
|
+
} from "./packager-tool-ppj5f4y7.js";
|
|
16
|
+
import {
|
|
17
|
+
Configuration2,
|
|
18
|
+
DeploymentOperation,
|
|
19
|
+
DeploymentStatus,
|
|
20
|
+
PipelinesApi,
|
|
21
|
+
isMissingPipelinesRoute,
|
|
22
|
+
isApplicationSession,
|
|
23
|
+
parseSearchPage,
|
|
24
|
+
DeploymentSearchNeedsUserSessionError,
|
|
25
|
+
searchDeploymentsPage,
|
|
26
|
+
isAuthRefusal,
|
|
27
|
+
classifyFeedSession2,
|
|
28
|
+
feedSessionRefusal2,
|
|
29
|
+
feedReadRefusalForApplication2,
|
|
30
|
+
feedSessionRefusalAsync2,
|
|
31
|
+
feedReadRefusalAsync2
|
|
32
|
+
} from "./packager-tool-bs1jn1yn.js";
|
|
33
|
+
import {
|
|
34
|
+
Configuration3,
|
|
35
|
+
WorkflowAction2,
|
|
36
|
+
PackageInfoFromJSON,
|
|
37
|
+
SolutionDeploymentAction2,
|
|
38
|
+
DeploymentsApi2,
|
|
39
|
+
SearchApi
|
|
40
|
+
} from "./packager-tool-a6va4gc5.js";
|
|
41
|
+
import {
|
|
42
|
+
readDeploymentByKeyAsync2,
|
|
43
|
+
findDeploymentByName2,
|
|
44
|
+
isCompletedUninstall2,
|
|
45
|
+
findDeploymentsByName2,
|
|
46
|
+
newestDeploymentRow2
|
|
47
|
+
} from "./packager-tool-w8bcwfd3.js";
|
|
11
48
|
import {
|
|
12
|
-
ACKNOWLEDGE_PERMANENT_DELETION_FLAG,
|
|
13
|
-
NO_SERVER_REASON,
|
|
14
|
-
acknowledgedButNotRunHint,
|
|
15
49
|
activateDeployment,
|
|
50
|
+
NO_SERVER_REASON,
|
|
16
51
|
describeValidationFailureAsync,
|
|
17
|
-
formatPermanentDeletionResources,
|
|
18
|
-
isPermanentDeletionRefusal,
|
|
19
52
|
listPermanentDeletionResourcesAsync,
|
|
20
|
-
|
|
21
|
-
|
|
53
|
+
ACKNOWLEDGE_PERMANENT_DELETION_FLAG,
|
|
54
|
+
finiteOr,
|
|
55
|
+
runInstallToOutcomeAsync
|
|
56
|
+
} from "./packager-tool-q8ryk6q9.js";
|
|
57
|
+
import {
|
|
58
|
+
resolvePersonalWorkspace,
|
|
22
59
|
resolveParentFolder,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
60
|
+
folderKeyInitOverride2,
|
|
61
|
+
feedScopeInitOverride2,
|
|
62
|
+
feedSelectorFlag2,
|
|
63
|
+
describeFeedResolutionFailureAsync2,
|
|
64
|
+
resolveFeedScope2
|
|
65
|
+
} from "./packager-tool-fqs6hdcy.js";
|
|
26
66
|
import {
|
|
27
|
-
deploymentNextSteps,
|
|
28
|
-
explainRefusal,
|
|
29
|
-
isCurrentRecordAsync,
|
|
30
|
-
needsPendingResources,
|
|
31
67
|
pendingResourceApis,
|
|
68
|
+
reportedActivationStatus,
|
|
32
69
|
readPendingResourcesAsync,
|
|
33
|
-
|
|
34
|
-
|
|
70
|
+
isCurrentRecordAsync,
|
|
71
|
+
explainRefusal,
|
|
72
|
+
needsPendingResources,
|
|
73
|
+
deploymentNextSteps
|
|
74
|
+
} from "./packager-tool-snm6s7b5.js";
|
|
75
|
+
import {
|
|
76
|
+
resolveFeedSelectionAsync
|
|
77
|
+
} from "./packager-tool-q5d9df2q.js";
|
|
35
78
|
import {
|
|
36
|
-
DRAFT_VERSION_MISMATCH_CODE,
|
|
37
79
|
coerceWorkflowErrorMessages,
|
|
38
|
-
explainPipelineStatusAfterInstall,
|
|
39
|
-
formatDeploymentFailureDetails,
|
|
40
80
|
formatServiceErrors,
|
|
81
|
+
formatDeploymentFailureDetails,
|
|
41
82
|
hasServerErrorCode,
|
|
42
|
-
installLandedDespiteStatus,
|
|
43
83
|
isBareResponse,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
findDeploymentsByName,
|
|
50
|
-
isApplicationSession,
|
|
51
|
-
isAuthRefusal,
|
|
52
|
-
isCompletedUninstall,
|
|
53
|
-
isMissingPipelinesRoute,
|
|
54
|
-
newestDeploymentRow,
|
|
55
|
-
parseSearchPage,
|
|
56
|
-
readDeploymentByKeyAsync,
|
|
57
|
-
searchDeploymentsPage
|
|
58
|
-
} from "./packager-tool-mq5pc4zr.js";
|
|
59
|
-
import {
|
|
60
|
-
describeFeedResolutionFailureAsync,
|
|
61
|
-
feedScopeInitOverride,
|
|
62
|
-
feedSelectorFlag,
|
|
63
|
-
folderKeyInitOverride,
|
|
64
|
-
resolveFeedScope,
|
|
65
|
-
resolvePersonalWorkspace
|
|
66
|
-
} from "./packager-tool-rg3xgn9a.js";
|
|
67
|
-
import {
|
|
68
|
-
Configuration,
|
|
69
|
-
DeploymentOperation,
|
|
70
|
-
DeploymentStatus,
|
|
71
|
-
PipelinesApi
|
|
72
|
-
} from "./packager-tool-97rcgwvv.js";
|
|
73
|
-
import {
|
|
74
|
-
Configuration as Configuration2,
|
|
75
|
-
DeploymentsApi,
|
|
76
|
-
PackageInfoFromJSON,
|
|
77
|
-
SearchApi,
|
|
78
|
-
SolutionDeploymentAction,
|
|
79
|
-
WorkflowAction
|
|
80
|
-
} from "./packager-tool-sxjehksx.js";
|
|
81
|
-
import {
|
|
82
|
-
classifyFeedSession,
|
|
83
|
-
feedReadRefusalForApplication,
|
|
84
|
-
feedSessionRefusal
|
|
85
|
-
} from "./packager-tool-qw47eyw7.js";
|
|
86
|
-
import {
|
|
87
|
-
getSolutionAuthContext
|
|
88
|
-
} from "./packager-tool-61pwb567.js";
|
|
89
|
-
import {
|
|
90
|
-
DEFAULT_PAGE_SIZE,
|
|
91
|
-
PollOutcome,
|
|
92
|
-
logger,
|
|
93
|
-
mapPollFailure,
|
|
94
|
-
pollUntil,
|
|
95
|
-
quoteForShell
|
|
96
|
-
} from "./packager-tool-tx834spe.js";
|
|
84
|
+
DRAFT_VERSION_MISMATCH_CODE,
|
|
85
|
+
leavesPendingDraft,
|
|
86
|
+
installLandedDespiteStatus,
|
|
87
|
+
explainPipelineStatusAfterInstall
|
|
88
|
+
} from "./packager-tool-2pxe2r4j.js";
|
|
97
89
|
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
findDeploymentAcrossFeeds,
|
|
91
|
+
isNameOrFeedRefusal,
|
|
92
|
+
INCOMPLETE_SWEEP_ADVICE,
|
|
93
|
+
retryAdvice,
|
|
94
|
+
reportIncompleteSweepAsync
|
|
95
|
+
} from "./packager-tool-wm0h0wa1.js";
|
|
101
96
|
|
|
102
97
|
// src/services/deploy-activate-service.ts
|
|
103
98
|
var fail = (reason, message, instructions, exitCode = 1) => ({
|
|
@@ -124,8 +119,8 @@ async function incompleteSweepRefusalAsync(deploymentName, skipped, result) {
|
|
|
124
119
|
retry: report.retry
|
|
125
120
|
};
|
|
126
121
|
}
|
|
127
|
-
async function
|
|
128
|
-
const [authError, auth] = await catchError(
|
|
122
|
+
async function activateDeploymentAsync2(deploymentName, options = {}) {
|
|
123
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
129
124
|
tenant: options.tenant,
|
|
130
125
|
loginValidity: options.loginValidity,
|
|
131
126
|
envFilePath: options.envFilePath
|
|
@@ -149,7 +144,7 @@ async function activateDeploymentAsync(deploymentName, options = {}) {
|
|
|
149
144
|
selectedFeed
|
|
150
145
|
});
|
|
151
146
|
const location = sweep.location;
|
|
152
|
-
const scope = location?.scope ?? (selectedFeed ?
|
|
147
|
+
const scope = location?.scope ?? (selectedFeed ? feedScopeInitOverride2(selectedFeed) : undefined);
|
|
153
148
|
const result = await activateDeployment(auth, deploymentName, {
|
|
154
149
|
timeoutSeconds: options.timeout ?? 360,
|
|
155
150
|
pollIntervalMs: options.pollInterval ?? 5000,
|
|
@@ -163,7 +158,7 @@ async function activateDeploymentAsync(deploymentName, options = {}) {
|
|
|
163
158
|
return incompleteSweepRefusalAsync(deploymentName, sweep.skipped, result);
|
|
164
159
|
}
|
|
165
160
|
const pendingResources = known && needsPendingResources(known) ? await readPendingResourcesAsync(pendingResourceApis(auth), known, scope) : undefined;
|
|
166
|
-
const feedSelector =
|
|
161
|
+
const feedSelector = feedSelectorFlag2(location?.feed ?? selectedFeed);
|
|
167
162
|
const explanation = known ? explainRefusal(known, pendingResources, feedSelector) : undefined;
|
|
168
163
|
const instructions = explanation ? [...explanation, details].join(`
|
|
169
164
|
`) : known ? `Deployment '${known.name}' exists (Operation: ${known.operation}, OperationStatus: ${known.operationStatus}, ActivationStatus: ${known.activationStatus}) but the service refused to activate it. Check it with: uip solution deploy status ${known.key}${feedSelector}. ${details}` : selectedFeed ? `No deployment named '${deploymentName}' was found in the selected feed. Check the name with 'uip solution deploy list${feedSelector}', or drop the feed flag to search every feed you can reach. ${details}` : result.phase === "preActivateSteps" ? `Check deployment name. Deploy first with: uip solution deploy run. ${details}` : `Check deployment name matches an existing deployment. ${details}`;
|
|
@@ -177,8 +172,12 @@ async function activateDeploymentAsync(deploymentName, options = {}) {
|
|
|
177
172
|
};
|
|
178
173
|
}
|
|
179
174
|
if (result.kind === "PollFailed") {
|
|
180
|
-
const { reason, message, exitCode } = mapPollFailure(result.poll, "Activation");
|
|
181
|
-
return
|
|
175
|
+
const { reason, message, exitCode, errorCode, retry } = mapPollFailure(result.poll, "Activation");
|
|
176
|
+
return {
|
|
177
|
+
...fail(reason, message, "Activation may still be in progress.", exitCode),
|
|
178
|
+
errorCode,
|
|
179
|
+
retry
|
|
180
|
+
};
|
|
182
181
|
}
|
|
183
182
|
if (result.kind === "ActivationFailed") {
|
|
184
183
|
return fail("activation_failed", `Activation failed with status: ${result.status}`, result.errorMessage);
|
|
@@ -228,10 +227,10 @@ var refuseFeedRead = (refusal) => fail2("feed_requires_user_session", refusal.me
|
|
|
228
227
|
errorCode: "permission_denied",
|
|
229
228
|
retry: "RetryWillNotFix"
|
|
230
229
|
});
|
|
231
|
-
async function
|
|
230
|
+
async function listDeploymentsAsync2(options = {}) {
|
|
232
231
|
const limit = options.limit ?? DEFAULT_PAGE_SIZE;
|
|
233
232
|
const offset = options.offset ?? 0;
|
|
234
|
-
const [authError, auth] = await catchError(
|
|
233
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
235
234
|
tenant: options.tenant,
|
|
236
235
|
loginValidity: options.loginValidity,
|
|
237
236
|
envFilePath: options.envFilePath
|
|
@@ -240,7 +239,7 @@ async function listDeploymentsAsync(options = {}) {
|
|
|
240
239
|
return fail2("auth_failed", authError.message, authError.message);
|
|
241
240
|
}
|
|
242
241
|
if (options.personalWorkspace) {
|
|
243
|
-
const refusal =
|
|
242
|
+
const refusal = feedReadRefusalForApplication2(auth, "Listing the Personal Workspace's deployments");
|
|
244
243
|
if (refusal) {
|
|
245
244
|
return refuseFeedRead(refusal);
|
|
246
245
|
}
|
|
@@ -255,7 +254,7 @@ async function listDeploymentsAsync(options = {}) {
|
|
|
255
254
|
if (folderError) {
|
|
256
255
|
return fail2("folder_resolution_failed", folderError.message, "Provide a valid --folder-path or --folder-key to filter by folder.");
|
|
257
256
|
}
|
|
258
|
-
const [scopeError, scope] = await catchError(
|
|
257
|
+
const [scopeError, scope] = await catchError(resolveFeedScope2({
|
|
259
258
|
personalWorkspace: options.personalWorkspace,
|
|
260
259
|
feed: options.feed,
|
|
261
260
|
tenant: options.tenant,
|
|
@@ -263,11 +262,11 @@ async function listDeploymentsAsync(options = {}) {
|
|
|
263
262
|
envFilePath: options.envFilePath
|
|
264
263
|
}));
|
|
265
264
|
if (scopeError) {
|
|
266
|
-
const { message, instructions, ...extras } = await
|
|
265
|
+
const { message, instructions, ...extras } = await describeFeedResolutionFailureAsync2(scopeError, options, auth);
|
|
267
266
|
return fail2("feed_resolution_failed", message, instructions, extras);
|
|
268
267
|
}
|
|
269
268
|
if (scope.kind !== "tenant") {
|
|
270
|
-
const refusal =
|
|
269
|
+
const refusal = await feedReadRefusalAsync2(auth, scope.folderKey, `Listing the deployments of the feed '${scope.name ?? scope.folderKey}'`);
|
|
271
270
|
if (refusal) {
|
|
272
271
|
return refuseFeedRead(refusal);
|
|
273
272
|
}
|
|
@@ -280,7 +279,7 @@ async function listDeploymentsAsync(options = {}) {
|
|
|
280
279
|
operationStatuses: options.operationStatuses ?? [],
|
|
281
280
|
activationStatuses: options.activationStatuses ?? [],
|
|
282
281
|
...folderPathFilter ? { targetFolderName: folderPathFilter } : {}
|
|
283
|
-
},
|
|
282
|
+
}, feedScopeInitOverride2(scope)));
|
|
284
283
|
if (listError instanceof DeploymentSearchNeedsUserSessionError) {
|
|
285
284
|
return fail2("list_request_failed", `Failed to list deployments: ${listError.message}`, "Run it with a user session ('uip login'). A client-credentials login cannot list deployments on this server.", { errorCode: "permission_denied", retry: "RetryWillNotFix" });
|
|
286
285
|
}
|
|
@@ -506,7 +505,7 @@ function buildDeploymentStateInstructions(deployment, details, feedSelector = ""
|
|
|
506
505
|
if (deployment.actions?.includes("Uninstall")) {
|
|
507
506
|
return `Deployment '${deployment.name}' lists uninstall as available but Orchestrator rejected the request ${status}. Run 'uip solution deploy list${feedSelector}' to recheck its state, then retry. If it stays stuck, uninstall it from the Orchestrator Solutions UI. Details: ${details}`;
|
|
508
507
|
}
|
|
509
|
-
const removalAdvice = deployment.actions?.includes(
|
|
508
|
+
const removalAdvice = deployment.actions?.includes(WorkflowAction2.Delete) ? `Delete it with: uip solution deploy delete ${quoteForShell(deployment.name)}${feedSelector} --yes.` : "Remove it from the Orchestrator Solutions UI.";
|
|
510
509
|
if (deployment.activationStatus === "Inactive") {
|
|
511
510
|
return `Deployment '${deployment.name}' cannot be uninstalled in its current state ${status}. Available actions: ${availableActions}. Superseded or inactive deployments are never uninstallable. ${removalAdvice} Details: ${details}`;
|
|
512
511
|
}
|
|
@@ -519,7 +518,7 @@ async function waitForOperationToFinishAsync(auth, deploymentName, opts) {
|
|
|
519
518
|
let operationStatus;
|
|
520
519
|
const readState = async () => {
|
|
521
520
|
if (byKey && opts.deploymentKey) {
|
|
522
|
-
const info = await
|
|
521
|
+
const info = await readDeploymentByKeyAsync2(auth, opts.deploymentKey, { scope: opts.scope, solutionsOnly });
|
|
523
522
|
if (info) {
|
|
524
523
|
solutionsOnly = info.source === "solutions";
|
|
525
524
|
operationStatus = info.operationStatus;
|
|
@@ -527,7 +526,7 @@ async function waitForOperationToFinishAsync(auth, deploymentName, opts) {
|
|
|
527
526
|
}
|
|
528
527
|
byKey = false;
|
|
529
528
|
}
|
|
530
|
-
last = await
|
|
529
|
+
last = await findDeploymentByName2(auth, deploymentName, opts.scope);
|
|
531
530
|
operationStatus = last?.operationStatus;
|
|
532
531
|
return last ? operationStatus : undefined;
|
|
533
532
|
};
|
|
@@ -542,7 +541,7 @@ async function waitForOperationToFinishAsync(auth, deploymentName, opts) {
|
|
|
542
541
|
signal: opts.signal
|
|
543
542
|
});
|
|
544
543
|
if (byKey) {
|
|
545
|
-
const [, row] = await catchError(
|
|
544
|
+
const [, row] = await catchError(findDeploymentByName2(auth, deploymentName, opts.scope));
|
|
546
545
|
const held = row ?? opts.known;
|
|
547
546
|
last = row ?? (held && operationStatus ? { ...held, operationStatus } : held);
|
|
548
547
|
}
|
|
@@ -552,7 +551,7 @@ async function requestUninstallAsync(api, auth, deploymentName, ctx) {
|
|
|
552
551
|
const { options, sweep, scope, intervalMs, remainingMs } = ctx;
|
|
553
552
|
const { location } = sweep;
|
|
554
553
|
const sweepIncomplete = !location && !sweep.complete;
|
|
555
|
-
const feedSelector =
|
|
554
|
+
const feedSelector = feedSelectorFlag2(location?.feed ?? ctx.selectedFeed);
|
|
556
555
|
let state = location?.deployment;
|
|
557
556
|
let waited = false;
|
|
558
557
|
let rechecked = false;
|
|
@@ -578,7 +577,7 @@ async function requestUninstallAsync(api, auth, deploymentName, ctx) {
|
|
|
578
577
|
}
|
|
579
578
|
if (!rechecked && !waited && state?.operationStatus !== "InProgress") {
|
|
580
579
|
rechecked = true;
|
|
581
|
-
const [readError, fresh] = await catchError(
|
|
580
|
+
const [readError, fresh] = await catchError(findDeploymentByName2(auth, deploymentName, scope));
|
|
582
581
|
if (!readError) {
|
|
583
582
|
state = fresh;
|
|
584
583
|
}
|
|
@@ -609,7 +608,7 @@ async function requestUninstallAsync(api, auth, deploymentName, ctx) {
|
|
|
609
608
|
state = wait.state;
|
|
610
609
|
continue;
|
|
611
610
|
}
|
|
612
|
-
if (sweepIncomplete && (!state ||
|
|
611
|
+
if (sweepIncomplete && (!state || isCompletedUninstall2(state))) {
|
|
613
612
|
if (isNameOrFeedRefusal(errorCode, context?.httpStatus)) {
|
|
614
613
|
return incompleteSweepFailureAsync(deploymentName, sweep, details);
|
|
615
614
|
}
|
|
@@ -626,8 +625,8 @@ async function incompleteSweepFailureAsync(deploymentName, sweep, refusalDetails
|
|
|
626
625
|
const report = await reportIncompleteSweepAsync(deploymentName, sweep.skipped);
|
|
627
626
|
return fail3("uninstall_request_failed", report.message, `${INCOMPLETE_SWEEP_ADVICE} Without its feed the uninstall request went to the tenant feed, which refused it. ${report.nextStep} Details: ${refusalDetails} (feed search: ${report.details})`, { errorCode: report.errorCode, retry: report.retry });
|
|
628
627
|
}
|
|
629
|
-
async function
|
|
630
|
-
const [authError, auth] = await catchError(
|
|
628
|
+
async function uninstallDeploymentAsync2(deploymentName, options = {}) {
|
|
629
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
631
630
|
tenant: options.tenant,
|
|
632
631
|
loginValidity: options.loginValidity,
|
|
633
632
|
envFilePath: options.envFilePath
|
|
@@ -635,7 +634,7 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
|
|
|
635
634
|
if (authError) {
|
|
636
635
|
return fail3("auth_failed", authError.message, authError.message);
|
|
637
636
|
}
|
|
638
|
-
const api = new PipelinesApi(new
|
|
637
|
+
const api = new PipelinesApi(new Configuration2({
|
|
639
638
|
basePath: auth.basePath,
|
|
640
639
|
accessToken: auth.accessToken
|
|
641
640
|
}));
|
|
@@ -655,7 +654,7 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
|
|
|
655
654
|
selectedFeed
|
|
656
655
|
});
|
|
657
656
|
const location = sweep.location;
|
|
658
|
-
const scope = location?.scope ?? (selectedFeed ?
|
|
657
|
+
const scope = location?.scope ?? (selectedFeed ? feedScopeInitOverride2(selectedFeed) : undefined);
|
|
659
658
|
const [requestError, requested] = await catchError(requestUninstallAsync(api, auth, deploymentName, {
|
|
660
659
|
options,
|
|
661
660
|
sweep,
|
|
@@ -710,7 +709,7 @@ async function uninstallDeploymentAsync(deploymentName, options = {}) {
|
|
|
710
709
|
const workflowErrors = coerceWorkflowErrorMessages(finalStatus.errorMessage).map((e) => e.errorMessage).join(", ");
|
|
711
710
|
const serviceLines = formatServiceErrors(finalStatus.services);
|
|
712
711
|
const errors = [workflowErrors, ...serviceLines].filter(Boolean).join("; ");
|
|
713
|
-
const feedFlag =
|
|
712
|
+
const feedFlag = feedSelectorFlag2(location?.feed ?? selectedFeed);
|
|
714
713
|
if (!options.force) {
|
|
715
714
|
const forceable = await forceableUninstallFailureAsync(api, deploymentName, {
|
|
716
715
|
deploymentKey: finalStatus.deploymentKey,
|
|
@@ -778,13 +777,13 @@ var INVALID_TARGET = {
|
|
|
778
777
|
};
|
|
779
778
|
var GUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
780
779
|
var UPGRADE_REFUSED_INSTRUCTIONS = "The server refused to start the upgrade. The deployment name may not exist, or may belong to a different package — check both with 'uip solution deploy list'. Another operation may still be running on it (wait, then retry), or it may be in a state the platform does not offer upgrades for.";
|
|
781
|
-
async function
|
|
780
|
+
async function upgradeDeploymentAsync2(first, second) {
|
|
782
781
|
const options = typeof first === "string" ? { ...second, deploymentKey: first } : first;
|
|
783
782
|
const targetError = validateTarget(options);
|
|
784
783
|
if (targetError) {
|
|
785
784
|
return targetError;
|
|
786
785
|
}
|
|
787
|
-
const [authError, auth] = await catchError(
|
|
786
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
788
787
|
tenant: options.tenant,
|
|
789
788
|
loginValidity: options.loginValidity,
|
|
790
789
|
envFilePath: options.envFilePath
|
|
@@ -792,7 +791,7 @@ async function upgradeDeploymentAsync(first, second) {
|
|
|
792
791
|
if (authError) {
|
|
793
792
|
return fail4("auth_failed", authError.message, AUTH_INSTRUCTIONS2);
|
|
794
793
|
}
|
|
795
|
-
const pipelinesApi = new PipelinesApi(new
|
|
794
|
+
const pipelinesApi = new PipelinesApi(new Configuration2({
|
|
796
795
|
basePath: auth.basePath,
|
|
797
796
|
accessToken: auth.accessToken
|
|
798
797
|
}));
|
|
@@ -833,10 +832,6 @@ async function upgradeDeploymentAsync(first, second) {
|
|
|
833
832
|
pipelineDeploymentId: installResult.pipelineDeploymentId
|
|
834
833
|
};
|
|
835
834
|
};
|
|
836
|
-
const installed = await installAsync();
|
|
837
|
-
if (!installed.ok) {
|
|
838
|
-
return installed;
|
|
839
|
-
}
|
|
840
835
|
const targetFields = {
|
|
841
836
|
...target.fromVersion !== undefined && {
|
|
842
837
|
fromVersion: target.fromVersion
|
|
@@ -848,64 +843,49 @@ async function upgradeDeploymentAsync(first, second) {
|
|
|
848
843
|
discardedDraftKey: target.discardedDraftKey
|
|
849
844
|
}
|
|
850
845
|
};
|
|
851
|
-
|
|
846
|
+
const timeoutSeconds = finiteOr(options.timeout, DEFAULT_TIMEOUT_SECONDS);
|
|
847
|
+
const run = await runInstallToOutcomeAsync({
|
|
848
|
+
api: pipelinesApi,
|
|
849
|
+
auth,
|
|
850
|
+
deploymentName,
|
|
851
|
+
scope,
|
|
852
|
+
signal: options.signal,
|
|
853
|
+
timeoutSeconds,
|
|
854
|
+
pollIntervalMs: finiteOr(options.pollInterval, DEFAULT_POLL_INTERVAL_MS),
|
|
855
|
+
logPrefix: "deploy upgrade",
|
|
856
|
+
noWait: options.noWait,
|
|
857
|
+
acknowledge: options.acknowledgePermanentDeletion === true,
|
|
858
|
+
install: installAsync,
|
|
859
|
+
consentWording: (refused) => {
|
|
860
|
+
const refusedKey = refused.deploymentKey || undefined;
|
|
861
|
+
return {
|
|
862
|
+
verb: "Upgrading",
|
|
863
|
+
confirmHint: `re-run the same command with ${ACKNOWLEDGE_PERMANENT_DELETION_FLAG}: ${acknowledgeRetryCommand(options, target)}`,
|
|
864
|
+
keepCopiesHint: `discard the draft and upgrade without those links: ${discardRetryCommand(options, target, refusedKey)}, or remove the links from the deployment in Orchestrator first`
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
if (run.kind === "install_refused") {
|
|
869
|
+
return run.failure;
|
|
870
|
+
}
|
|
871
|
+
if (run.kind === "consent_refused") {
|
|
872
|
+
return failPermanentDeletion(run.refusal, run.pipelineDeploymentId, run.deploymentKey);
|
|
873
|
+
}
|
|
874
|
+
if (run.kind === "accepted") {
|
|
852
875
|
return {
|
|
853
876
|
ok: true,
|
|
854
877
|
deploymentName,
|
|
855
878
|
toVersion: targetVersion,
|
|
856
|
-
pipelineDeploymentId:
|
|
879
|
+
pipelineDeploymentId: run.pipelineDeploymentId,
|
|
857
880
|
...targetFields,
|
|
858
881
|
status: "Accepted"
|
|
859
882
|
};
|
|
860
883
|
}
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
deploymentName,
|
|
867
|
-
scope,
|
|
868
|
-
timeoutMs: remainingTimeoutMs(timeoutMs, deadline),
|
|
869
|
-
intervalMs: Number.isFinite(options.pollInterval) ? options.pollInterval : DEFAULT_POLL_INTERVAL_MS,
|
|
870
|
-
signal: options.signal,
|
|
871
|
-
logPrefix: "deploy upgrade"
|
|
872
|
-
});
|
|
873
|
-
let pipelineDeploymentId = installed.pipelineDeploymentId;
|
|
874
|
-
let poll = await pollAsync(pipelineDeploymentId);
|
|
875
|
-
let permanentlyDeletedResources;
|
|
876
|
-
if (poll.outcome === PollOutcome.Completed && isPermanentDeletionRefusal(poll.data)) {
|
|
877
|
-
const refused = poll.data;
|
|
878
|
-
const refusedKey = refused.deploymentKey || undefined;
|
|
879
|
-
const keepCopiesHint = `discard the draft and upgrade without those links: ${discardRetryCommand(options, target, refusedKey)}, or remove the links from the deployment in Orchestrator first`;
|
|
880
|
-
const consent = await settlePermanentDeletionRefusalAsync({
|
|
881
|
-
api: pipelinesApi,
|
|
882
|
-
deploymentName,
|
|
883
|
-
scope,
|
|
884
|
-
signal: options.signal,
|
|
885
|
-
acknowledge: options.acknowledgePermanentDeletion === true,
|
|
886
|
-
status: refused,
|
|
887
|
-
verb: "Upgrading",
|
|
888
|
-
confirmHint: `re-run the same command with ${ACKNOWLEDGE_PERMANENT_DELETION_FLAG}: ${acknowledgeRetryCommand(options, target)}`,
|
|
889
|
-
keepCopiesHint
|
|
890
|
-
});
|
|
891
|
-
if (!consent.ok) {
|
|
892
|
-
return failPermanentDeletion(consent, pipelineDeploymentId, refusedKey);
|
|
893
|
-
}
|
|
894
|
-
const reinstalled = await installAsync();
|
|
895
|
-
if (!reinstalled.ok) {
|
|
896
|
-
return {
|
|
897
|
-
...reinstalled,
|
|
898
|
-
instructions: `${reinstalled.instructions} ${acknowledgedButNotRunHint(consent.resources, keepCopiesHint)}`
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
pipelineDeploymentId = reinstalled.pipelineDeploymentId;
|
|
902
|
-
poll = await pollAsync(pipelineDeploymentId);
|
|
903
|
-
if (poll.outcome === PollOutcome.Completed && isPermanentDeletionRefusal(poll.data)) {
|
|
904
|
-
const deploymentKey = poll.data?.deploymentKey || undefined;
|
|
905
|
-
return failPermanentDeletion(stillRequiresConfirmation(deploymentName, consent.resources, deploymentKey), pipelineDeploymentId, deploymentKey);
|
|
906
|
-
}
|
|
907
|
-
permanentlyDeletedResources = consent.resources.map((resource) => formatPermanentDeletionResources([resource]));
|
|
908
|
-
}
|
|
884
|
+
const {
|
|
885
|
+
pipelineDeploymentId,
|
|
886
|
+
pollResult: poll,
|
|
887
|
+
permanentlyDeletedResources
|
|
888
|
+
} = run;
|
|
909
889
|
const base = {
|
|
910
890
|
deploymentName,
|
|
911
891
|
toVersion: targetVersion,
|
|
@@ -959,7 +939,7 @@ async function describeUpgradedDeploymentAsync(auth, deploymentName, finalStatus
|
|
|
959
939
|
return { activationStatus: "Active" };
|
|
960
940
|
}
|
|
961
941
|
const reported = reportedActivationStatus(record);
|
|
962
|
-
const [, rows] = reported ? [undefined, undefined] : await catchError(
|
|
942
|
+
const [, rows] = reported ? [undefined, undefined] : await catchError(findDeploymentsByName2(auth, deploymentName, scope));
|
|
963
943
|
const row = rows?.find((candidate) => candidate.key === finalStatus.deploymentKey);
|
|
964
944
|
const activationStatus = reported ?? row?.activationStatus ?? (actions.includes("SetupActivation") ? "NeedsSetupToActivate" : actions.includes("Activate") ? "ReadyToActivate" : undefined);
|
|
965
945
|
if (!activationStatus) {
|
|
@@ -1073,9 +1053,9 @@ async function resolveTargetByNameAsync(pipelinesApi, auth, options) {
|
|
|
1073
1053
|
const deploymentName = options.deploymentName;
|
|
1074
1054
|
let scope;
|
|
1075
1055
|
if (options.personalWorkspace) {
|
|
1076
|
-
const verdict =
|
|
1056
|
+
const verdict = classifyFeedSession2(auth);
|
|
1077
1057
|
if (verdict !== "user") {
|
|
1078
|
-
const { message, instructions } =
|
|
1058
|
+
const { message, instructions } = feedSessionRefusal2(verdict, `Upgrading the Personal Workspace deployment '${deploymentName}'`, "address the deployment by key");
|
|
1079
1059
|
return fail4("feed_requires_user_session", message, instructions, {
|
|
1080
1060
|
errorCode: "permission_denied",
|
|
1081
1061
|
retry: "RetryWillNotFix"
|
|
@@ -1089,7 +1069,7 @@ async function resolveTargetByNameAsync(pipelinesApi, auth, options) {
|
|
|
1089
1069
|
if (pwError || !pw) {
|
|
1090
1070
|
return fail4("personal_workspace_failed", pwError?.message ?? "Personal Workspace could not be resolved.", "Ensure your user has a Personal Workspace, then retry.");
|
|
1091
1071
|
}
|
|
1092
|
-
scope =
|
|
1072
|
+
scope = folderKeyInitOverride2(pw.key);
|
|
1093
1073
|
}
|
|
1094
1074
|
const [existsError] = await catchError(pipelinesApi.pipelinesGetPreActivateSteps({ deploymentName }, scope));
|
|
1095
1075
|
if (existsError) {
|
|
@@ -1100,15 +1080,15 @@ async function resolveTargetByNameAsync(pipelinesApi, auth, options) {
|
|
|
1100
1080
|
}
|
|
1101
1081
|
return fail4("lookup_failed", detail.details ? `${detail.message}: ${detail.details}` : detail.message, `The existence check for '${deploymentName}' failed before any upgrade was requested. Retry, or address the deployment by key: uip solution deploy upgrade <deployment-key>.`, { errorCode: detail.errorCode, retry: detail.retry });
|
|
1102
1082
|
}
|
|
1103
|
-
const [rowsError, rows] = await catchError(
|
|
1083
|
+
const [rowsError, rows] = await catchError(findDeploymentsByName2(auth, deploymentName, scope));
|
|
1104
1084
|
if (rowsError) {
|
|
1105
|
-
const unreadable = rowsError instanceof DeploymentSearchNeedsUserSessionError ||
|
|
1085
|
+
const unreadable = rowsError instanceof DeploymentSearchNeedsUserSessionError || classifyFeedSession2(auth) === "application" && isAuthRefusal(rowsError);
|
|
1106
1086
|
if (!unreadable) {
|
|
1107
1087
|
const detail = await extractErrorDetails(rowsError);
|
|
1108
1088
|
return fail4("lookup_failed", `The status check for '${deploymentName}' failed: ${detail.message}`, "The deployment exists, but whether it is still installed could not be confirmed, and upgrading an uninstalled name would deploy the package afresh under it. Retry, or address the deployment by key: uip solution deploy upgrade <deployment-key>.", { errorCode: detail.errorCode, retry: detail.retry });
|
|
1109
1089
|
}
|
|
1110
1090
|
}
|
|
1111
|
-
if (
|
|
1091
|
+
if (isCompletedUninstall2(rows ? newestDeploymentRow2(rows) : undefined)) {
|
|
1112
1092
|
return fail4("deployment_uninstalled", `Deployment '${deploymentName}' has been uninstalled, so there is nothing to upgrade.`, "The install route would create a new deployment under that name rather than upgrade this one. Deploy the package afresh with 'uip solution deploy run', or pick a live deployment from 'uip solution deploy list'.", INVALID_TARGET);
|
|
1113
1093
|
}
|
|
1114
1094
|
const resolved = {
|
|
@@ -1117,7 +1097,7 @@ async function resolveTargetByNameAsync(pipelinesApi, auth, options) {
|
|
|
1117
1097
|
listFlag: scope ? "--personal-workspace" : undefined
|
|
1118
1098
|
};
|
|
1119
1099
|
let discardedDraftKey;
|
|
1120
|
-
const newest = rows ?
|
|
1100
|
+
const newest = rows ? newestDeploymentRow2(rows) : undefined;
|
|
1121
1101
|
if (newest?.operationStatus === "Draft") {
|
|
1122
1102
|
const draft = {
|
|
1123
1103
|
key: newest.key,
|
|
@@ -1166,7 +1146,7 @@ async function resolveTargetByKeyAsync(pipelinesApi, auth, options, deploymentKe
|
|
|
1166
1146
|
const [lookupError, info] = await catchError(pipelinesApi.pipelinesGetDeploymentByKey({ key: deploymentKey }));
|
|
1167
1147
|
if (lookupError || !info) {
|
|
1168
1148
|
const detail = lookupError ? await extractErrorDetails(lookupError) : undefined;
|
|
1169
|
-
if (detail?.context?.httpStatus === 404 &&
|
|
1149
|
+
if (detail?.context?.httpStatus === 404 && classifyFeedSession2(auth) === "user") {
|
|
1170
1150
|
return resolveTargetByKeyViaSolutionsAsync(pipelinesApi, auth, options, deploymentKey);
|
|
1171
1151
|
}
|
|
1172
1152
|
if (!detail || detail.context?.httpStatus === 404) {
|
|
@@ -1179,15 +1159,15 @@ async function resolveTargetByKeyAsync(pipelinesApi, auth, options, deploymentKe
|
|
|
1179
1159
|
}
|
|
1180
1160
|
let scope;
|
|
1181
1161
|
if (info.locationKey) {
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
const { message, instructions } =
|
|
1162
|
+
const refusal = await feedSessionRefusalAsync2(auth, info.locationKey, "write", `Upgrading deployment '${info.deploymentName}', which is in a Personal Workspace or folder feed (folder key ${info.locationKey}),`, "run the upgrade from the Orchestrator UI");
|
|
1163
|
+
if (refusal) {
|
|
1164
|
+
const { message, instructions } = refusal;
|
|
1185
1165
|
return fail4("feed_requires_user_session", message, instructions, {
|
|
1186
1166
|
errorCode: "permission_denied",
|
|
1187
1167
|
retry: "RetryWillNotFix"
|
|
1188
1168
|
});
|
|
1189
1169
|
}
|
|
1190
|
-
scope =
|
|
1170
|
+
scope = folderKeyInitOverride2(info.locationKey);
|
|
1191
1171
|
} else if (options.personalWorkspace) {
|
|
1192
1172
|
return fail4("invalid_target", `Deployment '${info.deploymentName}' (${deploymentKey}) is on the tenant feed, not in a Personal Workspace.`, "Drop --personal-workspace: with a deployment key the feed is read from the deployment itself.", INVALID_TARGET);
|
|
1193
1173
|
}
|
|
@@ -1269,9 +1249,9 @@ async function resolveTargetByKeyViaSolutionsAsync(pipelinesApi, auth, options,
|
|
|
1269
1249
|
if (pwError || !pw) {
|
|
1270
1250
|
return fail4("personal_workspace_failed", pwError?.message ?? "Personal Workspace could not be resolved.", "Ensure your user has a Personal Workspace, then retry.");
|
|
1271
1251
|
}
|
|
1272
|
-
scope =
|
|
1252
|
+
scope = folderKeyInitOverride2(pw.key);
|
|
1273
1253
|
}
|
|
1274
|
-
const deploymentsApi = new
|
|
1254
|
+
const deploymentsApi = new DeploymentsApi2(new Configuration3({
|
|
1275
1255
|
basePath: auth.basePath,
|
|
1276
1256
|
accessToken: auth.accessToken
|
|
1277
1257
|
}));
|
|
@@ -1349,8 +1329,8 @@ async function describeUpgradeFailureAsync(basePath, accessToken, pipelineDeploy
|
|
|
1349
1329
|
if (explained || !finalStatus.deploymentKey) {
|
|
1350
1330
|
return fromPipeline;
|
|
1351
1331
|
}
|
|
1352
|
-
const deploymentsApi = new
|
|
1353
|
-
const reason = await describeValidationFailureAsync(deploymentsApi, finalStatus.deploymentKey,
|
|
1332
|
+
const deploymentsApi = new DeploymentsApi2(new Configuration3({ basePath, accessToken }));
|
|
1333
|
+
const reason = await describeValidationFailureAsync(deploymentsApi, finalStatus.deploymentKey, SolutionDeploymentAction2.Upgrade, scope, signal);
|
|
1354
1334
|
return reason === NO_SERVER_REASON ? fromPipeline : `Validation: ${reason}
|
|
1355
1335
|
${fromPipeline}`;
|
|
1356
1336
|
}
|
|
@@ -1358,7 +1338,7 @@ ${fromPipeline}`;
|
|
|
1358
1338
|
// ../solution-sdk/src/legacy-package-search.ts
|
|
1359
1339
|
var LEGACY_PACKAGE_SEARCH_ROUTE = "POST /api/search/packages";
|
|
1360
1340
|
async function searchPackagesLegacy(auth, query, scope) {
|
|
1361
|
-
const api = new SearchApi(new
|
|
1341
|
+
const api = new SearchApi(new Configuration3({
|
|
1362
1342
|
basePath: auth.basePath,
|
|
1363
1343
|
accessToken: auth.accessToken
|
|
1364
1344
|
}));
|
|
@@ -1396,10 +1376,10 @@ function isNonEmptyString(row, field) {
|
|
|
1396
1376
|
var serversWithoutPipelinesSearch = new Set;
|
|
1397
1377
|
async function searchPackagesPage(auth, query, scope) {
|
|
1398
1378
|
if (!serversWithoutPipelinesSearch.has(auth.basePath)) {
|
|
1399
|
-
const [error,
|
|
1379
|
+
const [error, body] = await catchError(searchViaPipelines(auth, query, scope));
|
|
1400
1380
|
if (!error) {
|
|
1401
1381
|
return {
|
|
1402
|
-
...parseSearchPage(
|
|
1382
|
+
...parseSearchPage(body, PIPELINES_SEARCH_ROUTE, PACKAGE_ROWS),
|
|
1403
1383
|
source: "pipelines"
|
|
1404
1384
|
};
|
|
1405
1385
|
}
|
|
@@ -1419,7 +1399,7 @@ async function searchPackagesPage(auth, query, scope) {
|
|
|
1419
1399
|
};
|
|
1420
1400
|
}
|
|
1421
1401
|
async function searchViaPipelines(auth, query, scope) {
|
|
1422
|
-
const api = new PipelinesApi(new
|
|
1402
|
+
const api = new PipelinesApi(new Configuration2({
|
|
1423
1403
|
basePath: auth.basePath,
|
|
1424
1404
|
accessToken: auth.accessToken
|
|
1425
1405
|
}));
|
|
@@ -1447,10 +1427,10 @@ var refuseFeedRead2 = (refusal) => fail5("feed_requires_user_session", refusal.m
|
|
|
1447
1427
|
errorCode: "permission_denied",
|
|
1448
1428
|
retry: "RetryWillNotFix"
|
|
1449
1429
|
});
|
|
1450
|
-
async function
|
|
1430
|
+
async function listPackagesAsync2(options = {}) {
|
|
1451
1431
|
const limit = options.limit ?? DEFAULT_PAGE_SIZE;
|
|
1452
1432
|
const offset = options.offset ?? 0;
|
|
1453
|
-
const [authError, auth] = await catchError(
|
|
1433
|
+
const [authError, auth] = await catchError(getSolutionAuthContext2({
|
|
1454
1434
|
tenant: options.tenant,
|
|
1455
1435
|
loginValidity: options.loginValidity,
|
|
1456
1436
|
envFilePath: options.envFilePath
|
|
@@ -1459,12 +1439,12 @@ async function listPackagesAsync(options = {}) {
|
|
|
1459
1439
|
return fail5("auth_failed", authError.message, authError.message);
|
|
1460
1440
|
}
|
|
1461
1441
|
if (options.personalWorkspace) {
|
|
1462
|
-
const refusal =
|
|
1442
|
+
const refusal = feedReadRefusalForApplication2(auth, "Listing the Personal Workspace's packages");
|
|
1463
1443
|
if (refusal) {
|
|
1464
1444
|
return refuseFeedRead2(refusal);
|
|
1465
1445
|
}
|
|
1466
1446
|
}
|
|
1467
|
-
const [scopeError, scope] = await catchError(
|
|
1447
|
+
const [scopeError, scope] = await catchError(resolveFeedScope2({
|
|
1468
1448
|
personalWorkspace: options.personalWorkspace,
|
|
1469
1449
|
feed: options.feed,
|
|
1470
1450
|
tenant: options.tenant,
|
|
@@ -1472,11 +1452,11 @@ async function listPackagesAsync(options = {}) {
|
|
|
1472
1452
|
envFilePath: options.envFilePath
|
|
1473
1453
|
}));
|
|
1474
1454
|
if (scopeError) {
|
|
1475
|
-
const { message, instructions, ...extras } = await
|
|
1455
|
+
const { message, instructions, ...extras } = await describeFeedResolutionFailureAsync2(scopeError, options, auth);
|
|
1476
1456
|
return fail5("feed_resolution_failed", message, instructions, extras);
|
|
1477
1457
|
}
|
|
1478
1458
|
if (scope.kind !== "tenant") {
|
|
1479
|
-
const refusal =
|
|
1459
|
+
const refusal = await feedReadRefusalAsync2(auth, scope.folderKey, `Listing the packages of the feed '${scope.name ?? scope.folderKey}'`, "packages");
|
|
1480
1460
|
if (refusal) {
|
|
1481
1461
|
return refuseFeedRead2(refusal);
|
|
1482
1462
|
}
|
|
@@ -1487,7 +1467,7 @@ async function listPackagesAsync(options = {}) {
|
|
|
1487
1467
|
orderByColumn: options.sortBy ?? "publishDate",
|
|
1488
1468
|
orderByDirection: options.sortOrder ?? "Descending",
|
|
1489
1469
|
searchTerm: options.name
|
|
1490
|
-
},
|
|
1470
|
+
}, feedScopeInitOverride2(scope)));
|
|
1491
1471
|
if (listError instanceof PackageSearchNeedsUserSessionError) {
|
|
1492
1472
|
return fail5("list_request_failed", `Failed to list packages: ${listError.message}`, "Run it with a user session ('uip login'). A client-credentials login cannot list packages on this server.", { errorCode: "permission_denied", retry: "RetryWillNotFix" });
|
|
1493
1473
|
}
|
|
@@ -1505,6 +1485,6 @@ async function listPackagesAsync(options = {}) {
|
|
|
1505
1485
|
};
|
|
1506
1486
|
}
|
|
1507
1487
|
|
|
1508
|
-
export {
|
|
1488
|
+
export { activateDeploymentAsync2, listDeploymentsAsync2, uninstallDeploymentAsync2, upgradeDeploymentAsync2, listPackagesAsync2 };
|
|
1509
1489
|
|
|
1510
|
-
//# debugId=
|
|
1490
|
+
//# debugId=A1C4A5D519F3025564756E2164756E21
|