@uipath/solution-tool 1.206.0-preview.306 → 1.207.0-preview.307

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 (124) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +4 -4
  2. package/dist/{archive-extract-ma0gy822.js → archive-extract-afgwacbg.js} +3 -3
  3. package/dist/{cleanup-command-service-abtxpefz.js → cleanup-command-service-0j6qxj96.js} +20 -15
  4. package/dist/deploy-delete-service-ghyetrvj.js +23 -0
  5. package/dist/deploy-run-service-sz77fpsz.js +24 -0
  6. package/dist/{deploy-status-service-k1gycn13.js → deploy-status-service-aj4m61hg.js} +49 -25
  7. package/dist/deploy.js +21 -20
  8. package/dist/{deployment-search-bjdwqh5w.js → deployment-search-mkvzgeq4.js} +9 -9
  9. package/dist/{embedded-file-reader-pxpwcq3n.js → embedded-file-reader-k94wt612.js} +16 -16
  10. package/dist/feed-resolver-yj94m9j1.js +31 -0
  11. package/dist/feed-scope-failure-7abh61sj.js +20 -0
  12. package/dist/{feed-session-ytew8k2j.js → feed-session-z8t87r5w.js} +6 -6
  13. package/dist/{first-party-service-6gf3n6d8.js → first-party-service-bmtxd7wx.js} +1 -1
  14. package/dist/folder-runtime-check-8nf63er2.js +25 -0
  15. package/dist/{governance-options-40m81z8h.js → governance-options-ft8bqz4p.js} +7 -7
  16. package/dist/{packager-tool-v3ze7wmr.js → index-6ma58k47.js} +33 -708
  17. package/dist/{index-yjvmjpdn.js → index-j3tpb2cr.js} +12 -11
  18. package/dist/{index-p3x7ztdr.js → index-jy1760qy.js} +1 -1
  19. package/dist/{index-2bn3jzn9.js → index-nbs04tqr.js} +9 -7
  20. package/dist/index.js +26 -26
  21. package/dist/init.js +10 -10
  22. package/dist/{list-0k8c4rt6.js → list-3a1tdrgm.js} +11 -11
  23. package/dist/models/pack-command-types.d.ts +12 -0
  24. package/dist/{node-6ay6nbnq.js → node-83xy0gm0.js} +6 -6
  25. package/dist/pack-command-service-42p3t8xa.js +32 -0
  26. package/dist/{pack-project-2g2ncn2k.js → pack-project-w514zr5v.js} +21 -18
  27. package/dist/pack.js +25 -22
  28. package/dist/{package-id-56k44s7y.js → package-id-2dgfbh5h.js} +3 -3
  29. package/dist/{packager-tool-2zn98p5r.js → packager-tool-0gyqtxvs.js} +4 -4
  30. package/dist/{packager-tool-vgrswa8p.js → packager-tool-1db1wqdy.js} +30 -8
  31. package/dist/{packager-tool-vx2c68sb.js → packager-tool-1dsxhz1r.js} +2 -2
  32. package/dist/{packager-tool-xxf8f4v2.js → packager-tool-2syv199e.js} +9 -5
  33. package/dist/packager-tool-3ft8hywr.js +449 -0
  34. package/dist/{packager-tool-829w06ns.js → packager-tool-3qach0s4.js} +14 -8
  35. package/dist/{packager-tool-bkmwknfn.js → packager-tool-4f1k64fh.js} +8 -74
  36. package/dist/{packager-tool-7v03ncmv.js → packager-tool-70ag56bf.js} +49 -24
  37. package/dist/{packager-tool-5e4gps62.js → packager-tool-71sz9598.js} +20 -8
  38. package/dist/{packager-tool-23g7kn35.js → packager-tool-7j920ac5.js} +18 -11
  39. package/dist/packager-tool-7s842xrq.js +140 -0
  40. package/dist/{packager-tool-s8q14fth.js → packager-tool-849ch2tq.js} +4 -6
  41. package/dist/{packager-tool-aws5w512.js → packager-tool-887bkh9y.js} +1 -1
  42. package/dist/{packager-tool-f5pzh184.js → packager-tool-a566400t.js} +26 -10
  43. package/dist/packager-tool-a813na66.js +75 -0
  44. package/dist/{packager-tool-c8x0tpe4.js → packager-tool-af8n6rqz.js} +85 -30
  45. package/dist/{packager-tool-y1304xzm.js → packager-tool-bpdyy6vs.js} +530 -204
  46. package/dist/{packager-tool-fx4ws49n.js → packager-tool-cenfraf4.js} +2 -2
  47. package/dist/{packager-tool-0z4aq300.js → packager-tool-cwqy5rb5.js} +119 -52
  48. package/dist/{packager-tool-a7s0gbxs.js → packager-tool-devc4w73.js} +7 -2
  49. package/dist/{packager-tool-pqk9v4h7.js → packager-tool-fbajevvm.js} +52 -15
  50. package/dist/{packager-tool-r0ha8c95.js → packager-tool-fz96p75n.js} +3 -3
  51. package/dist/{packager-tool-m07vyk89.js → packager-tool-gb3dq79g.js} +36 -9
  52. package/dist/{packager-tool-h8tksb5s.js → packager-tool-gns0nxbt.js} +28 -9
  53. package/dist/{packager-tool-wjvks6st.js → packager-tool-h8wam8pt.js} +15 -6
  54. package/dist/{packager-tool-z4cbca95.js → packager-tool-hczpvrc1.js} +6 -6
  55. package/dist/{packager-tool-t39pjz7n.js → packager-tool-jtvhkavz.js} +48 -6
  56. package/dist/{packager-tool-p5322gew.js → packager-tool-kmwjscby.js} +88 -10
  57. package/dist/{packager-tool-ppj5f4y7.js → packager-tool-n1zrk6zv.js} +4 -2
  58. package/dist/{packager-tool-2qsbh4kd.js → packager-tool-ncgpx1ce.js} +50 -12
  59. package/dist/{packager-tool-f15an17m.js → packager-tool-p1xfsv6c.js} +92 -4
  60. package/dist/{packager-tool-egc54x78.js → packager-tool-qhht1tc9.js} +2408 -771
  61. package/dist/packager-tool-r7fmsz2t.js +741 -0
  62. package/dist/{packager-tool-resolver-30hxk8vm.js → packager-tool-resolver-mynfj0rt.js} +6 -6
  63. package/dist/{packager-tool-ay4j9x92.js → packager-tool-s9tyw75r.js} +19 -8
  64. package/dist/{packager-tool-ckrt4gyr.js → packager-tool-t9zked1m.js} +3 -3
  65. package/dist/{packager-tool-1ctvbx0h.js → packager-tool-tr3ttz5c.js} +1 -1
  66. package/dist/{packager-tool-chff74yz.js → packager-tool-tt9v40x6.js} +3010 -846
  67. package/dist/{packager-tool-k9dk39tg.js → packager-tool-txygqgb2.js} +3 -3
  68. package/dist/packager-tool-v6jcys3s.js +46 -0
  69. package/dist/packager-tool-w0tmr9xe.js +279 -0
  70. package/dist/packager-tool-w35s60sx.js +179 -0
  71. package/dist/{packager-tool-axqk17xw.js → packager-tool-xbfr6y2x.js} +142 -34
  72. package/dist/{packager-tool-m5mwc6by.js → packager-tool-zsv8208n.js} +22 -18
  73. package/dist/{packager-tool-vrw36pdb.js → packager-tool-ztxsccjk.js} +140 -10
  74. package/dist/packager-tool.js +2 -2
  75. package/dist/prepare-solution-resources-g9y01pgd.js +26 -0
  76. package/dist/{project-command-utils-82tja3k0.js → project-command-utils-yxrgwzf9.js} +20 -13
  77. package/dist/project-contributions-c8v3bwjr.js +31 -0
  78. package/dist/project-identity-telemetry-yxdhswyq.js +18 -0
  79. package/dist/publish.js +14 -14
  80. package/dist/{resource-mutations-h6wfdqr4.js → resource-mutations-dn4f8xr1.js} +9 -9
  81. package/dist/{resource-version-lookup-xzgnvr48.js → resource-version-lookup-mksxc1dc.js} +9 -9
  82. package/dist/resource.js +9 -9
  83. package/dist/{restore-command-service-bqs7r9y3.js → restore-command-service-ztbt2ejp.js} +20 -15
  84. package/dist/run-service-r52wgf69.js +1056 -0
  85. package/dist/services/deploy-activate-service.d.ts +5 -2
  86. package/dist/services/deploy-config-file.d.ts +24 -0
  87. package/dist/services/deploy-delete-service.d.ts +1 -1
  88. package/dist/services/deploy-run-service.d.ts +8 -1
  89. package/dist/services/deploy-uninstall-service.d.ts +4 -2
  90. package/dist/services/deploy-upgrade-service.d.ts +23 -2
  91. package/dist/services/deployment-feed-locator.d.ts +19 -6
  92. package/dist/services/deployment-links.d.ts +16 -0
  93. package/dist/services/deployment-progress.d.ts +10 -0
  94. package/dist/services/deployment-search.d.ts +15 -2
  95. package/dist/services/deployment-state.d.ts +9 -0
  96. package/dist/services/feed-resolver.d.ts +17 -0
  97. package/dist/services/feed-selection.d.ts +59 -0
  98. package/dist/services/folder-runtime-check.d.ts +107 -0
  99. package/dist/services/incomplete-feed-sweep.d.ts +6 -0
  100. package/dist/services/pack-command-service.d.ts +6 -0
  101. package/dist/services/pack-project.d.ts +1 -1
  102. package/dist/services/package-metadata-rewrite.d.ts +13 -0
  103. package/dist/services/personal-workspace-resolver.d.ts +4 -1
  104. package/dist/services/prepare-solution-resources.d.ts +11 -6
  105. package/dist/services/project-contributions.d.ts +26 -2
  106. package/dist/services/project-identity-telemetry.d.ts +31 -0
  107. package/dist/services/solution-members.d.ts +31 -0
  108. package/dist/{ship-telemetry-19gx83af.js → ship-telemetry-9djqndmy.js} +4 -4
  109. package/dist/{solution-auth-jxcgd2m0.js → solution-auth-0e3qm74f.js} +3 -3
  110. package/dist/{solution-definition-helper-tqwd6cxn.js → solution-definition-helper-dreejga4.js} +1 -1
  111. package/dist/{solution-identity-c23d9bfv.js → solution-identity-j63p6n81.js} +4 -4
  112. package/dist/templates/AGENTS.md +131 -24
  113. package/dist/tool.js +26 -26
  114. package/package.json +2 -2
  115. package/dist/deploy-delete-service-as1jfycj.js +0 -23
  116. package/dist/deploy-run-service-gs1xv1y1.js +0 -23
  117. package/dist/feed-resolver-x0kt3yrw.js +0 -27
  118. package/dist/feed-scope-failure-9p8w0j1v.js +0 -20
  119. package/dist/pack-command-service-jzbch4eb.js +0 -29
  120. package/dist/packager-tool-qpryf1x2.js +0 -74
  121. package/dist/packager-tool-vrqbbh01.js +0 -182
  122. package/dist/prepare-solution-resources-h7zvnncd.js +0 -26
  123. package/dist/project-contributions-xx560n8y.js +0 -27
  124. package/dist/run-service-ekbx2jdg.js +0 -506
@@ -1,81 +1,3 @@
1
- import {
2
- getFileSystem
3
- } from "./packager-tool-vgrswa8p.js";
4
- import {
5
- catchError,
6
- extractErrorDetails
7
- } from "./packager-tool-m07vyk89.js";
8
- import {
9
- logger,
10
- PollOutcome,
11
- mapPollFailure
12
- } from "./packager-tool-axqk17xw.js";
13
- import {
14
- resolveFolder
15
- } from "./packager-tool-egc54x78.js";
16
- import {
17
- Configuration2,
18
- PipelinesApi,
19
- DeploymentSearchNeedsUserSessionError,
20
- isAuthRefusal,
21
- classifyFeedSession2,
22
- feedSessionRefusal2,
23
- feedSessionRefusalAsync2
24
- } from "./packager-tool-z4cbca95.js";
25
- import {
26
- Configuration3,
27
- SolutionDeploymentAction2,
28
- DeploymentsApi2
29
- } from "./packager-tool-xxf8f4v2.js";
30
- import {
31
- getSolutionAuthContext2
32
- } from "./packager-tool-ppj5f4y7.js";
33
- import {
34
- readDeploymentByKeyAsync2,
35
- findDeploymentsByPackageName2,
36
- DeploymentSearchCapError2,
37
- blocksRedeploy2,
38
- MAX_LISTED_DEPLOYMENTS2,
39
- formatExistingDeployments2,
40
- findDeploymentsByName2,
41
- findDeploymentBestEffort2,
42
- newestDeploymentRow2,
43
- interpretFailedDeployPoll2,
44
- resolveInstalledFolder2
45
- } from "./packager-tool-829w06ns.js";
46
- import {
47
- activateDeployment,
48
- NO_SERVER_REASON,
49
- describeValidationFailureAsync,
50
- describeDeploymentFailureAsync,
51
- ACKNOWLEDGE_PERMANENT_DELETION_FLAG,
52
- finiteOr,
53
- runInstallToOutcomeAsync
54
- } from "./packager-tool-vrw36pdb.js";
55
- import {
56
- resolveParentFolder,
57
- resolveFolderInfo,
58
- feedScopeInitOverride2,
59
- feedSelectorFlag2,
60
- describeFeedResolutionFailureAsync2,
61
- resolveFeedScope2
62
- } from "./packager-tool-23g7kn35.js";
63
- import {
64
- pendingResourceApis,
65
- reportedActivationStatus,
66
- readPendingResourcesAsync,
67
- appendDeploymentStateInstructions,
68
- needsPendingResources,
69
- deploymentNextSteps
70
- } from "./packager-tool-wjvks6st.js";
71
- import {
72
- formatDeploymentFailureDetails,
73
- hasServerErrorCode,
74
- DRAFT_VERSION_MISMATCH_CODE,
75
- leavesPendingDraft,
76
- installLandedDespiteStatus,
77
- explainPipelineStatusAfterInstall
78
- } from "./packager-tool-2pxe2r4j.js";
79
1
  import {
80
2
  __commonJS,
81
3
  __require
@@ -7058,6 +6980,7 @@ var $Pair = Pair.Pair;
7058
6980
  var $Scalar = Scalar.Scalar;
7059
6981
  var $YAMLMap = YAMLMap.YAMLMap;
7060
6982
  var $YAMLSeq = YAMLSeq.YAMLSeq;
6983
+ var $CST = cst;
7061
6984
  var $Lexer = lexer.Lexer;
7062
6985
  var $LineCounter = lineCounter.LineCounter;
7063
6986
  var $Parser = parser.Parser;
@@ -7067,634 +6990,36 @@ var $parseDocument = publicApi.parseDocument;
7067
6990
  var $stringify = publicApi.stringify;
7068
6991
  var $visit = visit.visit;
7069
6992
  var $visitAsync = visit.visitAsync;
6993
+ export {
6994
+ $Composer as Composer,
6995
+ $Document as Document,
6996
+ $Schema as Schema,
6997
+ $YAMLError as YAMLError,
6998
+ $YAMLParseError as YAMLParseError,
6999
+ $YAMLWarning as YAMLWarning,
7000
+ $Alias as Alias,
7001
+ $isAlias as isAlias,
7002
+ $isCollection as isCollection,
7003
+ $isDocument as isDocument,
7004
+ $isMap as isMap,
7005
+ $isNode as isNode,
7006
+ $isPair as isPair,
7007
+ $isScalar as isScalar,
7008
+ $isSeq as isSeq,
7009
+ $Pair as Pair,
7010
+ $Scalar as Scalar,
7011
+ $YAMLMap as YAMLMap,
7012
+ $YAMLSeq as YAMLSeq,
7013
+ $CST as CST,
7014
+ $Lexer as Lexer,
7015
+ $LineCounter as LineCounter,
7016
+ $Parser as Parser,
7017
+ $parse as parse,
7018
+ $parseAllDocuments as parseAllDocuments,
7019
+ $parseDocument as parseDocument,
7020
+ $stringify as stringify,
7021
+ $visit as visit,
7022
+ $visitAsync as visitAsync
7023
+ };
7070
7024
 
7071
- // src/services/deploy-run-service.ts
7072
- var DEFAULT_TIMEOUT_SECONDS = 360;
7073
- var DEFAULT_POLL_INTERVAL_MS = 5000;
7074
- var PROCESS_RESOURCE_MAPPING_ERROR = /(?:AgentProcessResource|FlowProcessResource)\s*->\s*ReleaseDto/;
7075
- var PROCESS_KEY_MAPPING_ERROR = /Destination Member:\s*ProcessKey|Invalid argument 'Key'/;
7076
- function buildDeploymentFailureInstructions(instructions, pipelineDeploymentId) {
7077
- if (!instructions) {
7078
- return "Unknown error";
7079
- }
7080
- const isAgentMappingFailure = PROCESS_RESOURCE_MAPPING_ERROR.test(instructions) && PROCESS_KEY_MAPPING_ERROR.test(instructions);
7081
- if (!isAgentMappingFailure) {
7082
- return instructions;
7083
- }
7084
- return `${instructions}
7085
- Detected agent/flow process mapping failure: UiPath could not map an agent or flow process resource to an Orchestrator release because ProcessKey/Key is missing. This is a platform-side validation issue for this package; retrying the same deployment is unlikely to succeed. Rebuild or publish the solution without agent/flow process resources, or contact UiPath support with pipeline deployment ID ${pipelineDeploymentId}.`;
7086
- }
7087
- function parseConfiguration(content) {
7088
- if (content.trim().length === 0) {
7089
- throw new Error("Configuration file is empty.");
7090
- }
7091
- const [jsonError, jsonConfiguration] = catchError(() => JSON.parse(content));
7092
- if (!jsonError) {
7093
- return jsonConfiguration;
7094
- }
7095
- const [yamlError, yamlConfiguration] = catchError(() => $parse(content));
7096
- if (yamlError) {
7097
- throw yamlError;
7098
- }
7099
- return yamlConfiguration;
7100
- }
7101
- var fail = (reason, message, instructions, extras = {}) => ({
7102
- ok: false,
7103
- reason,
7104
- message,
7105
- instructions,
7106
- exitCode: extras.exitCode ?? 1,
7107
- pipelineDeploymentId: extras.pipelineDeploymentId,
7108
- errorCode: extras.errorCode,
7109
- retry: extras.retry,
7110
- ...extras.deploymentKey !== undefined && {
7111
- deploymentKey: extras.deploymentKey
7112
- },
7113
- ...extras.permanentDeletionResources !== undefined && {
7114
- permanentDeletionResources: extras.permanentDeletionResources
7115
- },
7116
- ...extras.permanentlyDeletedResources !== undefined && {
7117
- permanentlyDeletedResources: extras.permanentlyDeletedResources
7118
- }
7119
- });
7120
- var failPermanentDeletion = (refusal, pipelineDeploymentId, deploymentKey) => fail(refusal.reason, refusal.message, refusal.instructions, {
7121
- ...refusal.classification,
7122
- pipelineDeploymentId,
7123
- deploymentKey,
7124
- permanentDeletionResources: refusal.resources
7125
- });
7126
- async function readInstalledFolderAsync(auth, deploymentName, deploymentKey, scope) {
7127
- if (deploymentKey) {
7128
- const [, info] = await catchError(readDeploymentByKeyAsync2(auth, deploymentKey, { scope }));
7129
- if (info?.deploymentKey === deploymentKey && info.installedRootFolderKey) {
7130
- return { installedRootFolderKey: info.installedRootFolderKey };
7131
- }
7132
- }
7133
- return findDeploymentBestEffort2(auth, deploymentName, scope, {
7134
- deploymentKey
7135
- });
7136
- }
7137
- function makeFolderKeyResolver(options) {
7138
- return async (folderKey) => {
7139
- const folder = await resolveFolder({ folderKey }, {
7140
- tenant: options.tenant,
7141
- loginValidity: options.loginValidity,
7142
- envFilePath: options.envFilePath
7143
- });
7144
- return folder ? { name: folder.displayName, path: folder.path } : undefined;
7145
- };
7146
- }
7147
- async function deployRunAsync2(options) {
7148
- const [authError, auth] = await catchError(getSolutionAuthContext2({
7149
- tenant: options.tenant,
7150
- loginValidity: options.loginValidity,
7151
- envFilePath: options.envFilePath
7152
- }));
7153
- if (authError) {
7154
- return fail("auth_failed", authError.message, authError.message);
7155
- }
7156
- let feedScope = { kind: "tenant" };
7157
- if (options.personalWorkspace || options.feed !== undefined) {
7158
- if (options.personalWorkspace) {
7159
- const refusal = refuseFeedForSession(auth, "Deploying into a Personal Workspace");
7160
- if (refusal) {
7161
- return refusal;
7162
- }
7163
- }
7164
- const [scopeError, scope] = await catchError(resolveFeedScope2({
7165
- personalWorkspace: options.personalWorkspace,
7166
- feed: options.feed,
7167
- tenant: options.tenant,
7168
- loginValidity: options.loginValidity,
7169
- envFilePath: options.envFilePath
7170
- }));
7171
- if (scopeError) {
7172
- const failure = await describeFeedResolutionFailureAsync2(scopeError, options, auth);
7173
- return fail(options.feed !== undefined ? "feed_resolution_failed" : "personal_workspace_deploy_failed", failure.message, failure.instructions, { errorCode: failure.errorCode, retry: failure.retry });
7174
- }
7175
- feedScope = scope;
7176
- if (feedScope.kind !== "tenant") {
7177
- const refusal = await refuseFeedForSessionAsync(auth, feedScope, `Deploying into the feed '${feedScope.name ?? feedScope.folderKey}'`);
7178
- if (refusal) {
7179
- return refusal;
7180
- }
7181
- }
7182
- }
7183
- const blocked = adviseForApplication(auth, await guardExistingDeployment(auth, options, feedScope)) ?? adviseForApplication(auth, await guardPendingDraft(auth, options, feedScope));
7184
- if (blocked) {
7185
- return blocked;
7186
- }
7187
- let parentFolderPath;
7188
- if (feedScope.kind !== "tenant") {
7189
- const [locationError, location] = await catchError(resolveFeedDeployLocation(feedScope, options));
7190
- if (locationError instanceof FeedFolderLookupError) {
7191
- const { errorCode, retry } = await extractErrorDetails(locationError.lookupFailure.cause ?? locationError.lookupFailure);
7192
- return fail("feed_resolution_failed", locationError.message, FEED_FOLDER_LOOKUP_INSTRUCTIONS, { errorCode, retry });
7193
- }
7194
- if (locationError) {
7195
- return fail("location_outside_feed", locationError.message, "Pass a --parent-folder-path / --parent-folder-key inside the feed folder, or omit it to deploy into the feed folder itself.");
7196
- }
7197
- parentFolderPath = location.folderFQN || undefined;
7198
- } else {
7199
- const [folderError, resolved] = await catchError(resolveParentFolder({
7200
- folderPath: options.parentFolderPath,
7201
- folderKey: options.parentFolderKey,
7202
- personalWorkspace: options.personalWorkspace,
7203
- tenant: options.tenant,
7204
- loginValidity: options.loginValidity,
7205
- envFilePath: options.envFilePath
7206
- }));
7207
- if (folderError) {
7208
- return fail("folder_resolution_failed", folderError.message, "Provide a valid --parent-folder-path, --parent-folder-key, or --personal-workspace.");
7209
- }
7210
- parentFolderPath = resolved;
7211
- }
7212
- const scope = feedScopeInitOverride2(feedScope);
7213
- const feedFields = feedScope.kind === "tenant" ? { feedKind: feedScope.kind } : {
7214
- feedKind: feedScope.kind,
7215
- deploymentName: options.deploymentName,
7216
- packageName: options.packageName,
7217
- packageVersion: options.packageVersion
7218
- };
7219
- const configuration = new Configuration2({
7220
- basePath: auth.basePath,
7221
- accessToken: auth.accessToken
7222
- });
7223
- const api = new PipelinesApi(configuration);
7224
- let configBody;
7225
- if (options.configFile) {
7226
- const fs = getFileSystem();
7227
- const configPath = fs.path.resolve(options.configFile);
7228
- const [readError, configContent] = await catchError(fs.readFile(configPath, "utf-8"));
7229
- if (readError) {
7230
- return fail("config_file_read_failed", `Failed to read config file: ${configPath}`, readError.message);
7231
- }
7232
- if (configContent === null) {
7233
- return fail("config_file_not_found", `Failed to read config file: ${configPath}`, `File not found at ${configPath}. Check the --config-file path; generate a default config with: uip solution deploy config get <name> -d config.json.`);
7234
- }
7235
- const [parseError, parsed] = catchError(() => parseConfiguration(configContent));
7236
- if (parseError) {
7237
- return fail("config_file_parse_failed", `Invalid JSON or YAML in config file: ${configPath}`, parseError.message);
7238
- }
7239
- configBody = parsed;
7240
- }
7241
- const installAsync = async () => {
7242
- const [installError, installResult] = await catchError(api.pipelinesInstall({
7243
- deploymentName: options.deploymentName,
7244
- packageName: options.packageName,
7245
- packageVersion: options.packageVersion,
7246
- solutionRootFolderName: options.folderName,
7247
- folderFullyQualifiedName: parentFolderPath,
7248
- body: configBody
7249
- }, scope));
7250
- if (installError || !installResult?.pipelineDeploymentId) {
7251
- if (!installError) {
7252
- return fail(installFailureReason(feedScope), "The install request returned no pipeline deployment.", installFailureHint(feedScope, options));
7253
- }
7254
- const detail = await extractErrorDetails(installError);
7255
- if (hasServerErrorCode(detail.details, DRAFT_VERSION_MISMATCH_CODE)) {
7256
- return fail("pending_draft", detail.message, `${pendingDraftHint(feedScope, options)} Details: ${detail.details}`, { errorCode: detail.errorCode, retry: detail.retry });
7257
- }
7258
- return fail(installFailureReason(feedScope), detail.message, `${installFailureHint(feedScope, options)} Details: ${detail.details}`, { errorCode: detail.errorCode, retry: detail.retry });
7259
- }
7260
- return {
7261
- ok: true,
7262
- pipelineDeploymentId: installResult.pipelineDeploymentId
7263
- };
7264
- };
7265
- const keepCopiesHint = "remove those links from the --config-file (uip solution deploy config unlink <file> <resource>) and re-run";
7266
- const run = await runInstallToOutcomeAsync({
7267
- api,
7268
- auth,
7269
- deploymentName: options.deploymentName,
7270
- scope,
7271
- signal: options.signal,
7272
- timeoutSeconds: finiteOr(options.timeout, DEFAULT_TIMEOUT_SECONDS),
7273
- pollIntervalMs: finiteOr(options.pollInterval, DEFAULT_POLL_INTERVAL_MS),
7274
- logPrefix: "deploy",
7275
- acknowledge: options.acknowledgePermanentDeletion === true,
7276
- install: installAsync,
7277
- consentWording: () => ({
7278
- verb: "Deploying",
7279
- confirmHint: `re-run the same command with ${ACKNOWLEDGE_PERMANENT_DELETION_FLAG}`,
7280
- keepCopiesHint
7281
- })
7282
- });
7283
- if (run.kind === "install_refused") {
7284
- return run.failure;
7285
- }
7286
- if (run.kind === "consent_refused") {
7287
- return failPermanentDeletion(run.refusal, run.pipelineDeploymentId, run.deploymentKey);
7288
- }
7289
- const { pipelineDeploymentId, pollResult, permanentlyDeletedResources } = run;
7290
- const folderPath = parentFolderPath ? `${parentFolderPath}/${options.folderName}` : options.folderName;
7291
- if (pollResult.outcome !== PollOutcome.Completed || !pollResult.data) {
7292
- const recoveryKey = pollResult.data?.deploymentKey || undefined;
7293
- const recoveryDeployment = recoveryKey ? await findDeploymentBestEffort2(auth, options.deploymentName, scope, { deploymentKey: recoveryKey }) : undefined;
7294
- const recovery = interpretFailedDeployPoll2(recoveryDeployment);
7295
- const recoveredSuccess = async () => {
7296
- const resolvedFolder = await resolveInstalledFolder2(recoveryDeployment, {
7297
- folderName: options.folderName,
7298
- folderPath,
7299
- parentFolderPath
7300
- }, makeFolderKeyResolver(options));
7301
- return {
7302
- ok: true,
7303
- ...feedFields,
7304
- ...permanentlyDeletedResources && {
7305
- permanentlyDeletedResources
7306
- },
7307
- status: "DeploymentSucceeded",
7308
- deploymentKey: recoveryDeployment?.key,
7309
- pipelineDeploymentId,
7310
- instanceId: recoveryDeployment?.instanceId == null ? undefined : recoveryDeployment.instanceId,
7311
- folderName: resolvedFolder.folderName,
7312
- folderPath: resolvedFolder.folderPath,
7313
- ...resolvedFolder.requestedMatched ? {} : { requestedFolderName: options.folderName }
7314
- };
7315
- };
7316
- if (recovery?.kind === "Active") {
7317
- return {
7318
- ...await recoveredSuccess(),
7319
- activationStatus: "SuccessfulActivate"
7320
- };
7321
- }
7322
- if (recoveryDeployment && (recovery?.kind === "NeedsSetupToActivate" || recovery?.kind === "ReadyToActivate")) {
7323
- return {
7324
- ...await recoveredSuccess(),
7325
- ...await describeInstalledNotLiveAsync(auth, recoveryDeployment, scope, feedScope)
7326
- };
7327
- }
7328
- if (recovery?.kind === "ActivationFailed") {
7329
- return fail("activation_failed_post_deploy", `Deployment '${options.deploymentName}' completed but activation failed.`, `Inspect activation details in Orchestrator, then retry with: uip solution deploy activate ${options.deploymentName}${feedSelectorFlag2(feedScope)}.`, { pipelineDeploymentId });
7330
- }
7331
- if (recovery?.kind === "DeployFailed") {
7332
- const reason = recoveryDeployment ? await describeDeploymentFailureAsync(auth, recoveryDeployment, SolutionDeploymentAction2.Install, scope, options.signal) : NO_SERVER_REASON;
7333
- return fail("deploy_failed", `Deployment '${options.deploymentName}' failed (OperationStatus: ${recovery.operationStatus}): ${reason}`, `${inspectHint(pipelineDeploymentId, feedScope)} Fix the underlying issue and retry: uip solution deploy run.`, { pipelineDeploymentId });
7334
- }
7335
- const { reason, message, exitCode, errorCode, retry } = mapPollFailure(pollResult, "Deployment");
7336
- return fail(reason, message, `Deployment may still be in progress. ${followHint(pipelineDeploymentId, feedScope)}`, { exitCode, pipelineDeploymentId, errorCode, retry });
7337
- }
7338
- const finalStatus = pollResult.data;
7339
- if (!finalStatus) {
7340
- return fail("no_final_status", "Deployment did not return a final status.", followHint(pipelineDeploymentId, feedScope), { pipelineDeploymentId });
7341
- }
7342
- const landedDespiteStatus = installLandedDespiteStatus(finalStatus);
7343
- if (finalStatus.status !== "DeploymentSucceeded" && !landedDespiteStatus) {
7344
- const classification = finalStatus.status === "ValidationFailed" || finalStatus.status === "ConflictFixingError" ? {
7345
- errorCode: "invalid_argument",
7346
- retry: "RetryWillNotFix"
7347
- } : {};
7348
- const fromPipeline = formatDeploymentFailureDetails(pipelineDeploymentId, finalStatus);
7349
- const details = finalStatus.synthesizedOperation !== undefined && finalStatus.deploymentKey ? await describeSynthesizedFailureAsync(auth, finalStatus.deploymentKey, scope, options.signal, fromPipeline) : fromPipeline;
7350
- const draftNote = leavesPendingDraft(finalStatus.status) ? `
7351
- Nothing was installed. The rejected attempt is kept as a pending draft${finalStatus.deploymentKey ? ` (${finalStatus.deploymentKey})` : ""}: fix the configuration and re-run this command, and the server re-validates that draft with the new file (settings and resource links the file does not name keep the values the draft was rejected with).${finalStatus.deploymentKey ? ` When this was an update of an existing deployment, you can discard the draft and upgrade the live version instead: uip solution deploy upgrade ${finalStatus.deploymentKey} --discard-draft --version ${options.packageVersion}` : ""}` : "";
7352
- return fail("deploy_failed", `Deployment failed with status: ${finalStatus.status}`, `${buildDeploymentFailureInstructions(details, pipelineDeploymentId)}${draftNote}`, { pipelineDeploymentId, ...classification });
7353
- }
7354
- const resolvedFolder = await resolveInstalledFolder2(await readInstalledFolderAsync(auth, options.deploymentName, finalStatus.deploymentKey || undefined, scope), {
7355
- folderName: options.folderName,
7356
- folderPath,
7357
- parentFolderPath
7358
- }, makeFolderKeyResolver(options));
7359
- const baseSuccess = {
7360
- ok: true,
7361
- ...feedFields,
7362
- ...permanentlyDeletedResources && { permanentlyDeletedResources },
7363
- status: finalStatus.status,
7364
- deploymentKey: finalStatus.deploymentKey,
7365
- pipelineDeploymentId,
7366
- instanceId: finalStatus.instanceId,
7367
- folderName: resolvedFolder.folderName,
7368
- folderPath: resolvedFolder.folderPath,
7369
- ...resolvedFolder.requestedMatched ? {} : { requestedFolderName: options.folderName }
7370
- };
7371
- if (landedDespiteStatus) {
7372
- const described = await describeInstalledRunAsync(auth, options.deploymentName, finalStatus, scope, feedScope);
7373
- return {
7374
- ...baseSuccess,
7375
- ...described,
7376
- nextSteps: [
7377
- explainPipelineStatusAfterInstall(finalStatus),
7378
- ...described.nextSteps ?? []
7379
- ]
7380
- };
7381
- }
7382
- if (options.skipActivate) {
7383
- return { ...baseSuccess, activationStatus: "Skipped" };
7384
- }
7385
- if (reportedActivationStatus(finalStatus.deploymentResult) === "NeedsSetupToActivate") {
7386
- return {
7387
- ...baseSuccess,
7388
- ...await describeInstalledRunAsync(auth, options.deploymentName, finalStatus, scope, feedScope)
7389
- };
7390
- }
7391
- const activationResult = await activateDeployment(auth, options.deploymentName, {
7392
- timeoutSeconds: options.timeout ?? 360,
7393
- pollIntervalMs: options.pollInterval ?? 5000,
7394
- signal: options.signal,
7395
- scope
7396
- });
7397
- if (activationResult.kind === "RequestFailed") {
7398
- const refused = activationResult.deployment;
7399
- if (refused && refused.key === finalStatus.deploymentKey && refused.operationStatus === "Successful" && refused.activationStatus === "NeedsSetupToActivate") {
7400
- return {
7401
- ...baseSuccess,
7402
- ...await describeInstalledNotLiveAsync(auth, refused, scope, feedScope)
7403
- };
7404
- }
7405
- const fallback = activationResult.phase === "preActivateSteps" ? `Deployment '${options.deploymentName}' was deployed successfully but pre-activate steps lookup failed. Retry activation with: uip solution deploy activate ${options.deploymentName}${feedSelectorFlag2(feedScope)}. Details: ${activationResult.details}` : `Deployment '${options.deploymentName}' was deployed successfully but activation failed. Retry activation with: uip solution deploy activate ${options.deploymentName}${feedSelectorFlag2(feedScope)}. Details: ${activationResult.details}`;
7406
- const pendingResources = refused && needsPendingResources(refused) ? await readPendingResourcesAsync(pendingResourceApis(auth), refused, scope) : undefined;
7407
- return fail("activation_request_failed", activationResult.message, appendDeploymentStateInstructions(fallback, refused, pendingResources, feedSelectorFlag2(feedScope)), { pipelineDeploymentId, permanentlyDeletedResources });
7408
- }
7409
- if (activationResult.kind === "PollFailed") {
7410
- const { message, exitCode, errorCode, retry } = mapPollFailure(activationResult.poll, "Activation");
7411
- return fail("activation_poll_failed", message, `Deployment '${options.deploymentName}' was deployed successfully but activation polling did not complete. Activation may still be in progress; check with: ${listCommand(feedScope)}.`, {
7412
- exitCode,
7413
- pipelineDeploymentId,
7414
- errorCode,
7415
- retry,
7416
- permanentlyDeletedResources
7417
- });
7418
- }
7419
- if (activationResult.kind === "ActivationFailed") {
7420
- return fail("activation_failed", `Activation failed with status: ${activationResult.status}`, activationResult.errorMessage, { pipelineDeploymentId, permanentlyDeletedResources });
7421
- }
7422
- const activationStatus = activationResult.kind === "Success" ? activationResult.status : "NoInstance";
7423
- const activationInstanceId = activationResult.kind === "Success" ? activationResult.instanceId : undefined;
7424
- const finalInstanceId = activationInstanceId == null ? baseSuccess.instanceId : activationInstanceId;
7425
- return { ...baseSuccess, activationStatus, instanceId: finalInstanceId };
7426
- }
7427
- async function describeInstalledRunAsync(auth, deploymentName, finalStatus, scope, feedScope) {
7428
- const key = finalStatus.deploymentKey || undefined;
7429
- const record = finalStatus.deploymentResult;
7430
- const reported = reportedActivationStatus(record);
7431
- const row = key && !reported ? await findDeploymentBestEffort2(auth, deploymentName, scope, {
7432
- deploymentKey: key
7433
- }) : undefined;
7434
- if (row) {
7435
- return describeInstalledNotLiveAsync(auth, row, scope, feedScope);
7436
- }
7437
- if (record?.status === "SuccessfulActivate") {
7438
- return { activationStatus: "SuccessfulActivate" };
7439
- }
7440
- const actions = record?.actions ?? [];
7441
- const activationStatus = reported ?? (actions.includes("SetupActivation") ? "NeedsSetupToActivate" : actions.includes("Activate") ? "ReadyToActivate" : "Inactive");
7442
- return describeInstalledNotLiveAsync(auth, {
7443
- name: deploymentName,
7444
- key,
7445
- operation: record?.operation ?? finalStatus.synthesizedOperation,
7446
- operationStatus: record?.operationStatus ?? "Successful",
7447
- activationStatus,
7448
- packageVersion: record?.packageVersion,
7449
- currentPackageVersion: record?.packageVersion
7450
- }, scope, feedScope);
7451
- }
7452
- async function describeInstalledNotLiveAsync(auth, deployment, scope, feedScope) {
7453
- const pendingResources = needsPendingResources(deployment) && deployment.key ? await readPendingResourcesAsync(pendingResourceApis(auth), { name: deployment.name, key: deployment.key }, scope) : undefined;
7454
- const nextSteps = deploymentNextSteps(deployment, pendingResources, feedSelectorFlag2(feedScope));
7455
- return {
7456
- activationStatus: deployment.activationStatus ?? "Inactive",
7457
- ...pendingResources ? { pendingResources } : {},
7458
- ...nextSteps && nextSteps.length > 0 ? { nextSteps } : {}
7459
- };
7460
- }
7461
- function inspectHint(pipelineDeploymentId, scope) {
7462
- if (scope.kind === "tenant") {
7463
- return `Inspect failure details with: uip solution deploy status ${pipelineDeploymentId}.`;
7464
- }
7465
- return `Inspect it with: ${listCommand(scope)}.`;
7466
- }
7467
- function followHint(pipelineDeploymentId, scope) {
7468
- if (scope.kind === "tenant") {
7469
- return `Check status with: uip solution deploy status ${pipelineDeploymentId}.`;
7470
- }
7471
- return `Check it with: ${listCommand(scope)}.`;
7472
- }
7473
- function listCommand(scope) {
7474
- if (scope.kind === "personal") {
7475
- return "uip solution deploy list --personal-workspace";
7476
- }
7477
- if (scope.kind === "folder") {
7478
- return `uip solution deploy list --feed ${scope.folderKey ?? "<name-or-key>"}`;
7479
- }
7480
- return "uip solution deploy list";
7481
- }
7482
- function adviseForApplication(auth, failure) {
7483
- if (!failure || classifyFeedSession2(auth) !== "application") {
7484
- return failure;
7485
- }
7486
- logger.warn(`${failure.message} Deploying anyway: under an external app (client-credentials) login this check only warns, so a pipeline keeps the outcome it had before the check could run. ${failure.instructions}`);
7487
- return;
7488
- }
7489
- function refuseFeedForSession(session, action) {
7490
- const verdict = classifyFeedSession2(session);
7491
- if (verdict === "user") {
7492
- return;
7493
- }
7494
- return feedRefusalFailure(feedSessionRefusal2(verdict, action, FEED_REFUSAL_ALTERNATIVE));
7495
- }
7496
- async function refuseFeedForSessionAsync(session, scope, action) {
7497
- if (!scope.folderKey) {
7498
- return refuseFeedForSession(session, action);
7499
- }
7500
- const refusal = await feedSessionRefusalAsync2(session, scope.folderKey, "write", action, FEED_REFUSAL_ALTERNATIVE);
7501
- return refusal ? feedRefusalFailure(refusal) : undefined;
7502
- }
7503
- var FEED_REFUSAL_ALTERNATIVE = "deploy the package to the tenant feed";
7504
- function feedRefusalFailure(refusal) {
7505
- return fail("feed_requires_user_session", refusal.message, refusal.instructions, { errorCode: "permission_denied", retry: "RetryWillNotFix" });
7506
- }
7507
- async function describeSynthesizedFailureAsync(auth, deploymentKey, scope, signal, fromPipeline) {
7508
- const deploymentsApi = new DeploymentsApi2(new Configuration3({
7509
- basePath: auth.basePath,
7510
- accessToken: auth.accessToken
7511
- }));
7512
- const reason = await describeValidationFailureAsync(deploymentsApi, deploymentKey, SolutionDeploymentAction2.Install, scope, signal);
7513
- return reason === NO_SERVER_REASON ? fromPipeline : `Validation: ${reason}
7514
- ${fromPipeline}`;
7515
- }
7516
- function pendingDraftHint(scope, options) {
7517
- const cause = `'${options.deploymentName}' has a pending draft for another version: an earlier attempt that never completed, usually one rejected by validation. To retry that draft with a corrected configuration, re-run this command with the draft's --package-version (the message names it).`;
7518
- if (scope.kind === "folder") {
7519
- return `${cause} To discard it and upgrade the live deployment to ${options.packageVersion} instead: uip solution deploy upgrade <deployment-key> --discard-draft --version ${options.packageVersion} (Key from ${listCommand(scope)}).`;
7520
- }
7521
- const workspace = scope.kind === "personal" ? " --personal-workspace" : "";
7522
- return `${cause} To discard it and upgrade the live deployment to ${options.packageVersion} instead: uip solution deploy upgrade --name ${options.deploymentName} --package-name ${options.packageName}${workspace} --discard-draft --version ${options.packageVersion} (under an external app, pass the deployment's key in place of --name and --package-name).`;
7523
- }
7524
- function installFailureReason(scope) {
7525
- if (scope.kind === "personal") {
7526
- return "personal_workspace_deploy_failed";
7527
- }
7528
- if (scope.kind === "folder") {
7529
- return "feed_deploy_failed";
7530
- }
7531
- return "install_request_failed";
7532
- }
7533
- function installFailureHint(scope, options) {
7534
- if (scope.kind === "personal") {
7535
- return "Ensure the package was published to your Personal Workspace first: uip solution publish <package> --personal-workspace.";
7536
- }
7537
- if (scope.kind === "folder") {
7538
- return `Ensure the package was published to the feed first: uip solution publish <package> --feed ${options.feed ?? "<name-or-key>"}.`;
7539
- }
7540
- return "Check package name/version with: uip solution packages list.";
7541
- }
7542
- function scopeLabel(scope) {
7543
- if (scope.kind === "personal") {
7544
- return "your Personal Workspace";
7545
- }
7546
- if (scope.kind === "folder") {
7547
- return scope.name ? `feed '${scope.name}'` : "the target feed";
7548
- }
7549
- return "this tenant";
7550
- }
7551
- function buildDeploymentExistsMessage(packageName, scope, existing, folderByKey) {
7552
- return `Package '${packageName}' is already deployed in ${scopeLabel(scope)}. ` + "Running deploy again creates a second, separate deployment — it does not update the one that is already there. " + `Existing: ${formatExistingDeployments2(existing, folderByKey)}.`;
7553
- }
7554
- function buildDeploymentExistsInstructions(options) {
7555
- const { packageName, scope, existing, requestedDeploymentName } = options;
7556
- const parts = [];
7557
- const first = existing[0];
7558
- const selfInflicted = requestedDeploymentName !== undefined && existing.some((d) => d.name === requestedDeploymentName);
7559
- if (existing.length > 0 && existing.every((d) => d.operationStatus === "InProgress")) {
7560
- parts.push(`Wait for the operation on '${first.name}' to finish, then decide whether to upgrade it or deploy a separate copy.`);
7561
- } else if (selfInflicted) {
7562
- parts.push(`'${requestedDeploymentName}' is the name you passed on --name, so an earlier run of this command probably created it. Check where it got to with: uip solution deploy status <pipeline-deployment-id>.`);
7563
- } else {
7564
- parts.push(first?.key ? `To update the existing deployment instead, upgrade it in place — running deploy again does not upgrade it: uip solution deploy upgrade ${first.key}.` : "To update the existing deployment instead, upgrade it in place with 'uip solution deploy upgrade <deployment-key>' — running deploy again does not upgrade it.");
7565
- if (first?.name) {
7566
- parts.push(`To remove it first, run: uip solution deploy uninstall '${first.name}'${feedSelectorFlag2(scope)} --yes.`);
7567
- }
7568
- }
7569
- parts.push(`To see every deployment and its state, run: uip solution deploy list${feedSelectorFlag2(scope)}.`);
7570
- parts.push(scope.kind === "tenant" ? "To create a second, separate deployment anyway, re-run this command with --yes and a different --name: re-using an existing deployment's name updates that deployment in place instead." : "To create a second, separate deployment anyway, re-run with --yes and a different --name (re-using an existing deployment's name updates that deployment in place) — Orchestrator may still refuse it while the existing deployment is running or in a failed state.");
7571
- if (existing.length === 0) {
7572
- parts.unshift(`A deployment of '${packageName}' already exists in ${scopeLabel(scope)}.`);
7573
- } else if (options.includeInventory) {
7574
- parts.unshift(`Existing: ${formatExistingDeployments2(existing)}.`);
7575
- }
7576
- return parts.join(" ");
7577
- }
7578
- async function resolveDeploymentFolders(deployments, options) {
7579
- const resolveByKey = makeFolderKeyResolver(options);
7580
- const keys = [
7581
- ...new Set(deployments.slice(0, MAX_LISTED_DEPLOYMENTS2).map((deployment) => deployment.installedRootFolderKey).filter((key) => Boolean(key)))
7582
- ];
7583
- const resolved = new Map;
7584
- await Promise.all(keys.map(async (key) => {
7585
- const [lookupError, folder] = await catchError(resolveByKey(key));
7586
- const label = folder?.path ?? folder?.name;
7587
- if (!lookupError && label) {
7588
- resolved.set(key, label);
7589
- }
7590
- }));
7591
- return resolved;
7592
- }
7593
- async function guardPendingDraft(auth, options, scope) {
7594
- const [lookupError, rows] = await catchError(findDeploymentsByName2(auth, options.deploymentName, feedScopeInitOverride2(scope)));
7595
- if (lookupError instanceof DeploymentSearchNeedsUserSessionError || lookupError && classifyFeedSession2(auth) === "application" && isAuthRefusal(lookupError)) {
7596
- return;
7597
- }
7598
- if (lookupError) {
7599
- logger.warn(`Skipped the pending-draft check for '${options.deploymentName}': the deployment lookup failed (${lookupError.message}). Deploying anyway — if this deployment has a pending draft for another version, the server may install that draft's version instead of ${options.packageVersion}. Check it with 'uip solution deploy list'.`);
7600
- return;
7601
- }
7602
- const draft = newestDeploymentRow2(rows);
7603
- if (draft?.operationStatus !== "Draft") {
7604
- return;
7605
- }
7606
- const draftVersion = draft.targetPackageVersion ?? draft.packageVersion;
7607
- if (draft.operation === "ActivationSetup") {
7608
- return fail("pending_draft", `Deployment '${options.deploymentName}' has an unfinished Setup activation (${draft.key}): the Orchestrator "Setup activation" wizard was started on version ${draftVersion ?? "<version>"} and not completed.`, `While that draft exists the server would run it in place of this deploy, or refuse a different version. Finish the setup in Orchestrator (Solutions, the deployment, Setup activation); or discard it — in Orchestrator (Delete draft), or with uip solution deploy upgrade ${draft.key} --discard-draft${draft.currentPackageVersion ? ` --version ${draft.currentPackageVersion}` : ""} — then re-run this command.`, { errorCode: "invalid_argument", retry: "RetryWillNotFix" });
7609
- }
7610
- if (!draftVersion || draftVersion.toLowerCase() === options.packageVersion.toLowerCase()) {
7611
- return;
7612
- }
7613
- const liveVersion = draft.currentPackageVersion;
7614
- const discard = draft.operation === "Install" || !liveVersion ? "delete it in Orchestrator (Delete draft)" : `discard it — in Orchestrator (Delete draft), or with uip solution deploy upgrade ${draft.key} --discard-draft --version ${liveVersion}, which also re-applies the live version unchanged —`;
7615
- return fail("pending_draft", `Deployment '${options.deploymentName}' has a pending draft (${draft.key}) for version ${draftVersion}: an earlier attempt that never completed, usually one rejected by validation, or one still running.`, `The server reuses that draft for the name, so this request would not deploy ${options.packageVersion}: asking for the live version installs the draft's ${draftVersion} instead, and any other version is refused. To retry the draft with a corrected configuration, re-run with --package-version ${draftVersion}.
7616
- To deploy ${options.packageVersion} instead, ${discard} then re-run this command.`, { errorCode: "invalid_argument", retry: "RetryWillNotFix" });
7617
- }
7618
- async function guardExistingDeployment(auth, options, scope) {
7619
- if (options.yes) {
7620
- return;
7621
- }
7622
- const [lookupError, deployments] = await catchError(findDeploymentsByPackageName2(auth, options.packageName, {
7623
- scope: feedScopeInitOverride2(scope)
7624
- }));
7625
- if (lookupError instanceof DeploymentSearchNeedsUserSessionError) {
7626
- logger.warn(`Skipped the already-deployed check for '${options.packageName}': this server's deployment search reads user sessions only, and this is an application (client-credentials) login. Deploying anyway — if a deployment already exists this creates a second one in its own folder. Check what is already deployed in the Orchestrator Solutions UI, or sign in with 'uip login' and re-run.`);
7627
- return;
7628
- }
7629
- if (lookupError && !(lookupError instanceof DeploymentSearchCapError2)) {
7630
- logger.warn(`Skipped the already-deployed check for '${options.packageName}': the deployment lookup failed (${lookupError.message}). Deploying anyway — if a deployment already exists this creates a second one in its own folder. 'uip solution deploy list' reads the same search, so it may fail the same way. Check what is already deployed in the Orchestrator Solutions UI, or re-run once the lookup answers.`);
7631
- return;
7632
- }
7633
- const capped = lookupError;
7634
- const existing = (capped ? capped.partialRows : deployments).filter(blocksRedeploy2);
7635
- if (existing.length === 0) {
7636
- if (capped) {
7637
- logger.warn(`Skipped the rest of the already-deployed check for '${options.packageName}': ${capped.message} The package's deployment history is too long to read in full, and none of the ${capped.partialRows.length} matching rows read blocks a redeploy. Deploying anyway — if a deployment past those rows exists this creates a second one in its own folder, and a re-run reads the same rows. Check what is already deployed in the Orchestrator Solutions UI.`);
7638
- }
7639
- return;
7640
- }
7641
- return fail("deployment_exists", buildDeploymentExistsMessage(options.packageName, scope, existing, await resolveDeploymentFolders(existing, options)), buildDeploymentExistsInstructions({
7642
- packageName: options.packageName,
7643
- scope,
7644
- existing,
7645
- requestedDeploymentName: options.deploymentName
7646
- }));
7647
- }
7648
- var FEED_FOLDER_LOOKUP_INSTRUCTIONS = "The install needs the feed folder's path, which the CLI reads from Orchestrator Folders when --feed names the feed by key alone; under an external app that lookup needs the OR.Folders scope. Give the application OR.Folders, or the Studio Web (StudioWebS2S) grants so the feed listing can name the feed instead, or run the deploy with a user session ('uip login'). To deploy to the tenant feed, omit --feed.";
7649
-
7650
- class FeedFolderLookupError extends Error {
7651
- lookupFailure;
7652
- constructor(folderKey, lookupFailure) {
7653
- super(`The feed folder '${folderKey}' could not be read from Orchestrator: ${lookupFailure.message}`);
7654
- this.lookupFailure = lookupFailure;
7655
- this.name = "FeedFolderLookupError";
7656
- }
7657
- }
7658
- async function resolveFeedDeployLocation(scope, options) {
7659
- const feedFolder = {
7660
- folderKey: scope.folderKey,
7661
- folderFQN: scope.name ?? ""
7662
- };
7663
- if (scope.kind === "folder" && !scope.name) {
7664
- const [lookupError, feedInfo] = await catchError(resolveFolderInfo({
7665
- folderKey: feedFolder.folderKey,
7666
- tenant: options.tenant,
7667
- loginValidity: options.loginValidity,
7668
- envFilePath: options.envFilePath
7669
- }));
7670
- if (lookupError) {
7671
- throw new FeedFolderLookupError(feedFolder.folderKey, lookupError);
7672
- }
7673
- if (!feedInfo) {
7674
- throw new FeedFolderLookupError(feedFolder.folderKey, new Error("the folder was not found"));
7675
- }
7676
- feedFolder.folderFQN = feedInfo.path;
7677
- }
7678
- if (scope.kind === "personal" || !options.parentFolderPath && !options.parentFolderKey) {
7679
- return feedFolder;
7680
- }
7681
- const resolved = await resolveFolderInfo({
7682
- folderPath: options.parentFolderPath,
7683
- folderKey: options.parentFolderKey,
7684
- tenant: options.tenant,
7685
- loginValidity: options.loginValidity,
7686
- envFilePath: options.envFilePath
7687
- });
7688
- if (!resolved) {
7689
- return feedFolder;
7690
- }
7691
- const withinFeed = resolved.path === feedFolder.folderFQN || resolved.path.startsWith(`${feedFolder.folderFQN}/`);
7692
- if (!withinFeed) {
7693
- throw new Error(`Deploy location '${resolved.path}' is outside the folder feed '${feedFolder.folderFQN}'. The location must be the feed folder or one of its descendants.`);
7694
- }
7695
- return { folderKey: resolved.key, folderFQN: resolved.path };
7696
- }
7697
-
7698
- export { deployRunAsync2 };
7699
-
7700
- //# debugId=282AD84DE4BE580E64756E2164756E21
7025
+ //# debugId=21E7CBF0F004308A64756E2164756E21