@sap-ux/abap-deploy-config-inquirer 1.9.7 → 2.0.0
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/constants.js +3 -6
- package/dist/constants.js.map +1 -1
- package/dist/error-handler.js +7 -14
- package/dist/error-handler.js.map +1 -1
- package/dist/i18n.js +9 -19
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -32
- package/dist/index.js.map +1 -1
- package/dist/logger-helper.js +3 -6
- package/dist/logger-helper.js.map +1 -1
- package/dist/prompts/conditions.d.ts +1 -1
- package/dist/prompts/conditions.d.ts.map +1 -1
- package/dist/prompts/conditions.js +63 -83
- package/dist/prompts/conditions.js.map +1 -1
- package/dist/prompts/defaults.d.ts +1 -1
- package/dist/prompts/defaults.d.ts.map +1 -1
- package/dist/prompts/defaults.js +16 -24
- package/dist/prompts/defaults.js.map +1 -1
- package/dist/prompts/helpers.d.ts +1 -1
- package/dist/prompts/helpers.d.ts.map +1 -1
- package/dist/prompts/helpers.js +48 -60
- package/dist/prompts/helpers.js.map +1 -1
- package/dist/prompts/index.d.ts +2 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +9 -14
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/prompt-state.d.ts +1 -1
- package/dist/prompts/prompt-state.d.ts.map +1 -1
- package/dist/prompts/prompt-state.js +1 -5
- package/dist/prompts/prompt-state.js.map +1 -1
- package/dist/prompts/questions/abap-target.d.ts +1 -1
- package/dist/prompts/questions/abap-target.d.ts.map +1 -1
- package/dist/prompts/questions/abap-target.js +68 -70
- package/dist/prompts/questions/abap-target.js.map +1 -1
- package/dist/prompts/questions/auth.d.ts +1 -1
- package/dist/prompts/questions/auth.d.ts.map +1 -1
- package/dist/prompts/questions/auth.js +12 -15
- package/dist/prompts/questions/auth.js.map +1 -1
- package/dist/prompts/questions/config/app.d.ts +1 -1
- package/dist/prompts/questions/config/app.d.ts.map +1 -1
- package/dist/prompts/questions/config/app.js +21 -24
- package/dist/prompts/questions/config/app.js.map +1 -1
- package/dist/prompts/questions/config/index.d.ts +3 -3
- package/dist/prompts/questions/config/index.d.ts.map +1 -1
- package/dist/prompts/questions/config/index.js +3 -19
- package/dist/prompts/questions/config/index.js.map +1 -1
- package/dist/prompts/questions/config/package.d.ts +1 -1
- package/dist/prompts/questions/config/package.d.ts.map +1 -1
- package/dist/prompts/questions/config/package.js +38 -41
- package/dist/prompts/questions/config/package.js.map +1 -1
- package/dist/prompts/questions/config/transport.d.ts +1 -1
- package/dist/prompts/questions/config/transport.d.ts.map +1 -1
- package/dist/prompts/questions/config/transport.js +38 -41
- package/dist/prompts/questions/config/transport.js.map +1 -1
- package/dist/prompts/questions/confirm.d.ts +1 -1
- package/dist/prompts/questions/confirm.d.ts.map +1 -1
- package/dist/prompts/questions/confirm.js +13 -16
- package/dist/prompts/questions/confirm.js.map +1 -1
- package/dist/prompts/questions/index.d.ts +4 -4
- package/dist/prompts/questions/index.d.ts.map +1 -1
- package/dist/prompts/questions/index.js +4 -20
- package/dist/prompts/questions/index.js.map +1 -1
- package/dist/prompts/validators.d.ts +1 -1
- package/dist/prompts/validators.d.ts.map +1 -1
- package/dist/prompts/validators.js +131 -152
- package/dist/prompts/validators.js.map +1 -1
- package/dist/service-provider-utils/abap-service-provider.d.ts +1 -1
- package/dist/service-provider-utils/abap-service-provider.d.ts.map +1 -1
- package/dist/service-provider-utils/abap-service-provider.js +27 -34
- package/dist/service-provider-utils/abap-service-provider.js.map +1 -1
- package/dist/service-provider-utils/create-transport.d.ts +1 -1
- package/dist/service-provider-utils/create-transport.d.ts.map +1 -1
- package/dist/service-provider-utils/create-transport.js +8 -14
- package/dist/service-provider-utils/create-transport.js.map +1 -1
- package/dist/service-provider-utils/index.d.ts +4 -4
- package/dist/service-provider-utils/index.d.ts.map +1 -1
- package/dist/service-provider-utils/index.js +4 -20
- package/dist/service-provider-utils/index.js.map +1 -1
- package/dist/service-provider-utils/list-packages.d.ts +1 -1
- package/dist/service-provider-utils/list-packages.d.ts.map +1 -1
- package/dist/service-provider-utils/list-packages.js +13 -19
- package/dist/service-provider-utils/list-packages.js.map +1 -1
- package/dist/service-provider-utils/transport-config.d.ts +1 -1
- package/dist/service-provider-utils/transport-config.d.ts.map +1 -1
- package/dist/service-provider-utils/transport-config.js +16 -22
- package/dist/service-provider-utils/transport-config.js.map +1 -1
- package/dist/service-provider-utils/transport-list.d.ts +1 -1
- package/dist/service-provider-utils/transport-list.d.ts.map +1 -1
- package/dist/service-provider-utils/transport-list.js +15 -23
- package/dist/service-provider-utils/transport-list.js.map +1 -1
- package/dist/types.js +16 -9
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +31 -47
- package/dist/utils.js.map +1 -1
- package/dist/validator-utils.d.ts +1 -1
- package/dist/validator-utils.d.ts.map +1 -1
- package/dist/validator-utils.js +21 -30
- package/dist/validator-utils.js.map +1 -1
- package/package.json +15 -13
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.ABAP_PACKAGE_SEARCH_MAX_RESULTS = 50;
|
|
5
|
-
exports.DEFAULT_PACKAGE_ABAP = '$TMP';
|
|
6
|
-
exports.CREATE_TR_DURING_DEPLOY = 'REPLACE_WITH_TRANSPORT';
|
|
1
|
+
export const ABAP_PACKAGE_SEARCH_MAX_RESULTS = 50;
|
|
2
|
+
export const DEFAULT_PACKAGE_ABAP = '$TMP';
|
|
3
|
+
export const CREATE_TR_DURING_DEPLOY = 'REPLACE_WITH_TRANSPORT';
|
|
7
4
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC"}
|
package/dist/error-handler.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bail = bail;
|
|
7
|
-
exports.handleTransportConfigError = handleTransportConfigError;
|
|
8
|
-
const prompt_state_1 = require("./prompts/prompt-state");
|
|
9
|
-
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
1
|
+
import { PromptState } from './prompts/prompt-state.js';
|
|
2
|
+
import LoggerHelper from './logger-helper.js';
|
|
10
3
|
/**
|
|
11
4
|
* Throws error message to end prompting in cli.
|
|
12
5
|
*
|
|
13
6
|
* @param errorMessage - error message
|
|
14
7
|
*/
|
|
15
|
-
function bail(errorMessage) {
|
|
8
|
+
export function bail(errorMessage) {
|
|
16
9
|
throw new Error(errorMessage);
|
|
17
10
|
}
|
|
18
11
|
/**
|
|
@@ -20,13 +13,13 @@ function bail(errorMessage) {
|
|
|
20
13
|
*
|
|
21
14
|
* @param errorMsg - error message
|
|
22
15
|
*/
|
|
23
|
-
function handleTransportConfigError(errorMsg) {
|
|
24
|
-
if (!
|
|
16
|
+
export function handleTransportConfigError(errorMsg) {
|
|
17
|
+
if (!PromptState.isYUI) {
|
|
25
18
|
bail(errorMsg);
|
|
26
19
|
}
|
|
27
20
|
else {
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
PromptState.transportAnswers.transportConfigError = errorMsg;
|
|
22
|
+
LoggerHelper.logger.debug(errorMsg);
|
|
30
23
|
}
|
|
31
24
|
}
|
|
32
25
|
//# sourceMappingURL=error-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../src/error-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../src/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,YAAoB;IACrC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACvD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;SAAM,CAAC;QACJ,WAAW,CAAC,gBAAgB,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC7D,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;AACL,CAAC"}
|
package/dist/i18n.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.i18n = void 0;
|
|
7
|
-
exports.initI18n = initI18n;
|
|
8
|
-
exports.t = t;
|
|
9
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
10
|
-
const abap_deploy_config_inquirer_i18n_json_1 = __importDefault(require("./translations/abap-deploy-config-inquirer.i18n.json"));
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
import translations from './translations/abap-deploy-config-inquirer.i18n.json' with { type: 'json' };
|
|
11
3
|
const abapDeployConfigInquirerNs = 'abap-deploy-config-inquirer';
|
|
12
|
-
|
|
4
|
+
export const i18n = i18next.createInstance();
|
|
13
5
|
/**
|
|
14
6
|
* Initialize i18next with the translations for this module.
|
|
15
7
|
*/
|
|
16
|
-
async function initI18n() {
|
|
17
|
-
await
|
|
8
|
+
export async function initI18n() {
|
|
9
|
+
await i18n.init({
|
|
18
10
|
lng: 'en',
|
|
19
11
|
fallbackLng: 'en',
|
|
20
12
|
showSupportNotice: false
|
|
21
13
|
});
|
|
22
|
-
|
|
14
|
+
i18n.addResourceBundle('en', abapDeployConfigInquirerNs, translations);
|
|
23
15
|
}
|
|
24
16
|
/**
|
|
25
17
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
@@ -28,13 +20,11 @@ async function initI18n() {
|
|
|
28
20
|
* @param options additional options
|
|
29
21
|
* @returns {string} localized string stored for the given key
|
|
30
22
|
*/
|
|
31
|
-
function t(key, options) {
|
|
23
|
+
export function t(key, options) {
|
|
32
24
|
if (!options?.ns) {
|
|
33
25
|
options = Object.assign(options ?? {}, { ns: abapDeployConfigInquirerNs });
|
|
34
26
|
}
|
|
35
|
-
return
|
|
27
|
+
return i18n.t(key, options);
|
|
36
28
|
}
|
|
37
|
-
initI18n().catch(() =>
|
|
38
|
-
// Needed for lint
|
|
39
|
-
});
|
|
29
|
+
void initI18n().catch(() => undefined);
|
|
40
30
|
//# sourceMappingURL=i18n.js.map
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,YAAY,MAAM,sDAAsD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEtG,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAEjE,MAAM,CAAC,MAAM,IAAI,GAAa,OAAO,CAAC,cAAc,EAAE,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC1B,MAAM,IAAI,CAAC,IAAI,CAAC;QACZ,GAAG,EAAE,IAAI;QACT,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAAE,KAAK;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,0BAA0B,EAAE,YAAY,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,CAAC,CAAC,GAAW,EAAE,OAAkB;IAC7C,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAQ,IAAI,CAAC,CAA8C,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Logger } from '@sap-ux/logger';
|
|
2
|
-
import { getPackagePrompts, getTransportRequestPrompts } from './prompts';
|
|
3
|
-
import { getPackageAnswer, getTransportAnswer, reconcileAnswers } from './utils';
|
|
2
|
+
import { getPackagePrompts, getTransportRequestPrompts } from './prompts/index.js';
|
|
3
|
+
import { getPackageAnswer, getTransportAnswer, reconcileAnswers } from './utils.js';
|
|
4
4
|
import type { InquirerAdapter } from '@sap-ux/inquirer-common';
|
|
5
|
-
import { promptNames, PackageInputChoices, TargetSystemType, TransportChoices, type AbapDeployConfigAnswers, type AbapDeployConfigAnswersInternal, type AbapDeployConfigPromptOptions, type AbapDeployConfigQuestion } from './types';
|
|
5
|
+
import { promptNames, PackageInputChoices, TargetSystemType, TransportChoices, type AbapDeployConfigAnswers, type AbapDeployConfigAnswersInternal, type AbapDeployConfigPromptOptions, type AbapDeployConfigQuestion } from './types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Get the inquirer prompts for abap deploy config.
|
|
8
8
|
*
|
|
@@ -26,4 +26,5 @@ declare function getPrompts(promptOptions?: AbapDeployConfigPromptOptions, logge
|
|
|
26
26
|
*/
|
|
27
27
|
declare function prompt(adapter: InquirerAdapter, promptOptions?: AbapDeployConfigPromptOptions, logger?: Logger, isYUI?: boolean): Promise<AbapDeployConfigAnswers>;
|
|
28
28
|
export { getPrompts, prompt, getPackageAnswer, getTransportAnswer, reconcileAnswers, getPackagePrompts, getTransportRequestPrompts, promptNames, TargetSystemType, PackageInputChoices, TransportChoices, type InquirerAdapter, type AbapDeployConfigQuestion, type AbapDeployConfigAnswersInternal, type AbapDeployConfigAnswers, type AbapDeployConfigPromptOptions };
|
|
29
|
+
export { DEFAULT_PACKAGE_ABAP } from './constants.js';
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAgC,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAgC,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACH,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAChC,MAAM,YAAY,CAAC;AAGpB;;;;;;;GAOG;AACH,iBAAe,UAAU,CACrB,aAAa,CAAC,EAAE,6BAA6B,EAC7C,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,UAAQ,GACd,OAAO,CAAC;IACP,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC;CACrD,CAAC,CAYD;AAED;;;;;;;;GAQG;AACH,iBAAe,MAAM,CACjB,OAAO,EAAE,eAAe,EACxB,aAAa,CAAC,EAAE,6BAA6B,EAC7C,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,UAAQ,GACd,OAAO,CAAC,uBAAuB,CAAC,CAKlC;AAED,OAAO,EACH,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EACrC,CAAC;AACF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const logger_1 = require("@sap-ux/logger");
|
|
10
|
-
const i18n_1 = require("./i18n");
|
|
11
|
-
const prompt_state_1 = require("./prompts/prompt-state");
|
|
12
|
-
const prompts_1 = require("./prompts");
|
|
13
|
-
Object.defineProperty(exports, "getPackagePrompts", { enumerable: true, get: function () { return prompts_1.getPackagePrompts; } });
|
|
14
|
-
Object.defineProperty(exports, "getTransportRequestPrompts", { enumerable: true, get: function () { return prompts_1.getTransportRequestPrompts; } });
|
|
15
|
-
const utils_1 = require("./utils");
|
|
16
|
-
Object.defineProperty(exports, "getPackageAnswer", { enumerable: true, get: function () { return utils_1.getPackageAnswer; } });
|
|
17
|
-
Object.defineProperty(exports, "getTransportAnswer", { enumerable: true, get: function () { return utils_1.getTransportAnswer; } });
|
|
18
|
-
Object.defineProperty(exports, "reconcileAnswers", { enumerable: true, get: function () { return utils_1.reconcileAnswers; } });
|
|
19
|
-
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
20
|
-
const types_1 = require("./types");
|
|
21
|
-
Object.defineProperty(exports, "promptNames", { enumerable: true, get: function () { return types_1.promptNames; } });
|
|
22
|
-
Object.defineProperty(exports, "PackageInputChoices", { enumerable: true, get: function () { return types_1.PackageInputChoices; } });
|
|
23
|
-
Object.defineProperty(exports, "TransportChoices", { enumerable: true, get: function () { return types_1.TransportChoices; } });
|
|
24
|
-
const abap_service_provider_1 = require("./service-provider-utils/abap-service-provider");
|
|
1
|
+
import { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
+
import { initI18n } from './i18n.js';
|
|
3
|
+
import { PromptState } from './prompts/prompt-state.js';
|
|
4
|
+
import { getAbapDeployConfigQuestions, getPackagePrompts, getTransportRequestPrompts } from './prompts/index.js';
|
|
5
|
+
import { getPackageAnswer, getTransportAnswer, reconcileAnswers } from './utils.js';
|
|
6
|
+
import LoggerHelper from './logger-helper.js';
|
|
7
|
+
import { promptNames, PackageInputChoices, TargetSystemType, TransportChoices } from './types.js';
|
|
8
|
+
import { AbapServiceProviderManager } from './service-provider-utils/abap-service-provider.js';
|
|
25
9
|
/**
|
|
26
10
|
* Get the inquirer prompts for abap deploy config.
|
|
27
11
|
*
|
|
@@ -31,15 +15,15 @@ const abap_service_provider_1 = require("./service-provider-utils/abap-service-p
|
|
|
31
15
|
* @returns the prompts used to provide input for abap deploy config generation and a reference to the answers object which will be populated with the user's responses once `inquirer.prompt` returns
|
|
32
16
|
*/
|
|
33
17
|
async function getPrompts(promptOptions, logger, isYUI = false) {
|
|
34
|
-
await
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
await initI18n();
|
|
19
|
+
LoggerHelper.logger = logger ?? new ToolsLogger({ logPrefix: '@sap-ux/abap-deploy-config-inquirer' });
|
|
20
|
+
PromptState.isYUI = isYUI;
|
|
21
|
+
PromptState.resetAbapDeployConfig();
|
|
22
|
+
AbapServiceProviderManager.resetIsDefaultProviderAbapCloud();
|
|
39
23
|
return {
|
|
40
|
-
prompts: await
|
|
24
|
+
prompts: await getAbapDeployConfigQuestions(promptOptions),
|
|
41
25
|
// Return reference to derived answers object that will be populated with user responses (after prompting is complete)
|
|
42
|
-
answers:
|
|
26
|
+
answers: PromptState.abapDeployConfig
|
|
43
27
|
};
|
|
44
28
|
}
|
|
45
29
|
/**
|
|
@@ -54,6 +38,8 @@ async function getPrompts(promptOptions, logger, isYUI = false) {
|
|
|
54
38
|
async function prompt(adapter, promptOptions, logger, isYUI = false) {
|
|
55
39
|
const abapDeployConfigPrompts = (await getPrompts(promptOptions, logger, isYUI)).prompts;
|
|
56
40
|
const answers = await adapter.prompt(abapDeployConfigPrompts);
|
|
57
|
-
return
|
|
41
|
+
return reconcileAnswers(answers, PromptState.abapDeployConfig);
|
|
58
42
|
}
|
|
43
|
+
export { getPrompts, prompt, getPackageAnswer, getTransportAnswer, reconcileAnswers, getPackagePrompts, getTransportRequestPrompts, promptNames, TargetSystemType, PackageInputChoices, TransportChoices };
|
|
44
|
+
export { DEFAULT_PACKAGE_ABAP } from './constants.js';
|
|
59
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{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,CAAC,CAAC,OAAO,CAAC;IACzF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAkC,uBAAuB,CAAC,CAAC;IAE/F,OAAO,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;AACnE,CAAC;AAED,OAAO,EACH,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAMnB,CAAC;AACF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/logger-helper.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const logger_1 = require("@sap-ux/logger");
|
|
1
|
+
import { ToolsLogger } from '@sap-ux/logger';
|
|
4
2
|
/**
|
|
5
3
|
* Static logger prevents passing of logger references through all functions, as this is a cross-cutting concern.
|
|
6
4
|
*/
|
|
7
|
-
class LoggerHelper {
|
|
8
|
-
static _logger = new
|
|
5
|
+
export default class LoggerHelper {
|
|
6
|
+
static _logger = new ToolsLogger({ logPrefix: '@sap-ux/abap-deploy-config-inquirer' });
|
|
9
7
|
/**
|
|
10
8
|
* Get the logger.
|
|
11
9
|
*
|
|
@@ -23,5 +21,4 @@ class LoggerHelper {
|
|
|
23
21
|
LoggerHelper._logger = value;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
exports.default = LoggerHelper;
|
|
27
24
|
//# sourceMappingURL=logger-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger-helper.js","sourceRoot":"","sources":["../src/logger-helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger-helper.js","sourceRoot":"","sources":["../src/logger-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IACrB,MAAM,CAAC,OAAO,GAAW,IAAI,WAAW,CAAC,EAAE,SAAS,EAAE,qCAAqC,EAAE,CAAC,CAAC;IAEvG;;;;OAIG;IACI,MAAM,KAAK,MAAM;QACpB,OAAO,YAAY,CAAC,OAAO,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,MAAM,KAAK,MAAM,CAAC,KAAa;QAClC,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;IACjC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type UI5AbapRepoPromptOptions, type AbapDeployConfigAnswersInternal, type AbapDeployConfigPromptOptions, type BackendTarget, type TransportInputChoicePromptOptions } from '../types';
|
|
1
|
+
import { type UI5AbapRepoPromptOptions, type AbapDeployConfigAnswersInternal, type AbapDeployConfigPromptOptions, type BackendTarget, type TransportInputChoicePromptOptions } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Determines if URL question should be shown.
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/prompts/conditions.ts"],"names":[],"mappings":"AAMA,OAAO,EAKH,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAElB,KAAK,iCAAiC,EACzC,MAAM,
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/prompts/conditions.ts"],"names":[],"mappings":"AAMA,OAAO,EAKH,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAElB,KAAK,iCAAiC,EACzC,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;GAKG;AACH,wBA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C,GAChE,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAGjF"}
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.showClientChoiceQuestion = showClientChoiceQuestion;
|
|
9
|
-
exports.showClientQuestion = showClientQuestion;
|
|
10
|
-
exports.showUsernameQuestion = showUsernameQuestion;
|
|
11
|
-
exports.showPasswordQuestion = showPasswordQuestion;
|
|
12
|
-
exports.showUi5AppDeployConfigQuestion = showUi5AppDeployConfigQuestion;
|
|
13
|
-
exports.showPackageInputChoiceQuestion = showPackageInputChoiceQuestion;
|
|
14
|
-
exports.defaultOrShowManualPackageQuestion = defaultOrShowManualPackageQuestion;
|
|
15
|
-
exports.defaultOrShowSearchPackageQuestion = defaultOrShowSearchPackageQuestion;
|
|
16
|
-
exports.showTransportInputChoice = showTransportInputChoice;
|
|
17
|
-
exports.defaultOrShowTransportListQuestion = defaultOrShowTransportListQuestion;
|
|
18
|
-
exports.defaultOrShowTransportCreatedQuestion = defaultOrShowTransportCreatedQuestion;
|
|
19
|
-
exports.defaultOrShowManualTransportQuestion = defaultOrShowManualTransportQuestion;
|
|
20
|
-
exports.showIndexQuestion = showIndexQuestion;
|
|
21
|
-
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
22
|
-
const prompt_state_1 = require("./prompt-state");
|
|
23
|
-
const utils_1 = require("../utils");
|
|
24
|
-
const error_handler_1 = require("../error-handler");
|
|
25
|
-
const i18n_1 = require("../i18n");
|
|
26
|
-
const logger_helper_1 = __importDefault(require("../logger-helper"));
|
|
27
|
-
const types_1 = require("../types");
|
|
1
|
+
import { isAppStudio } from '@sap-ux/btp-utils';
|
|
2
|
+
import { PromptState } from './prompt-state.js';
|
|
3
|
+
import { findBackendSystemByUrl, initTransportConfig } from '../utils.js';
|
|
4
|
+
import { handleTransportConfigError } from '../error-handler.js';
|
|
5
|
+
import { t } from '../i18n.js';
|
|
6
|
+
import LoggerHelper from '../logger-helper.js';
|
|
7
|
+
import { ClientChoiceValue, PackageInputChoices, TargetSystemType, TransportChoices } from '../types.js';
|
|
28
8
|
/**
|
|
29
9
|
* Determines if URL question should be shown.
|
|
30
10
|
*
|
|
31
11
|
* @param targetSystem - chosen target system
|
|
32
12
|
* @returns true if target system type is URL
|
|
33
13
|
*/
|
|
34
|
-
function showUrlQuestion(targetSystem) {
|
|
35
|
-
return targetSystem ===
|
|
14
|
+
export function showUrlQuestion(targetSystem) {
|
|
15
|
+
return targetSystem === TargetSystemType.Url;
|
|
36
16
|
}
|
|
37
17
|
/**
|
|
38
18
|
* Determines if the SCP question should be shown.
|
|
@@ -40,14 +20,14 @@ function showUrlQuestion(targetSystem) {
|
|
|
40
20
|
* @param previousAnswers - previous answers
|
|
41
21
|
* @returns boolean
|
|
42
22
|
*/
|
|
43
|
-
function showScpQuestion(previousAnswers) {
|
|
44
|
-
if ((!
|
|
23
|
+
export function showScpQuestion(previousAnswers) {
|
|
24
|
+
if ((!isAppStudio() && !previousAnswers.targetSystem) ||
|
|
45
25
|
(showUrlQuestion(previousAnswers.targetSystem) && previousAnswers.url?.length === 0)) {
|
|
46
26
|
return false;
|
|
47
27
|
}
|
|
48
28
|
let isSystemUnknown = false;
|
|
49
29
|
if (previousAnswers.url && previousAnswers.url.length > 0) {
|
|
50
|
-
const backendSystem =
|
|
30
|
+
const backendSystem = findBackendSystemByUrl(previousAnswers.targetSystem ?? previousAnswers.url);
|
|
51
31
|
if (!backendSystem) {
|
|
52
32
|
isSystemUnknown = true;
|
|
53
33
|
}
|
|
@@ -61,7 +41,7 @@ function showScpQuestion(previousAnswers) {
|
|
|
61
41
|
* @returns boolean
|
|
62
42
|
*/
|
|
63
43
|
function showClientCondition(scp) {
|
|
64
|
-
return Boolean(!
|
|
44
|
+
return Boolean(!isAppStudio() && !PromptState.abapDeployConfig?.isAbapCloud && !scp && !PromptState.abapDeployConfig?.scp);
|
|
65
45
|
}
|
|
66
46
|
/**
|
|
67
47
|
* Determines if the client choice question should be shown.
|
|
@@ -70,11 +50,11 @@ function showClientCondition(scp) {
|
|
|
70
50
|
* @param client - client
|
|
71
51
|
* @returns boolean
|
|
72
52
|
*/
|
|
73
|
-
function showClientChoiceQuestion(previousAnswers, client) {
|
|
74
|
-
if (
|
|
53
|
+
export function showClientChoiceQuestion(previousAnswers, client) {
|
|
54
|
+
if (PromptState.isYUI || !client) {
|
|
75
55
|
return false;
|
|
76
56
|
}
|
|
77
|
-
return showClientCondition(previousAnswers?.scp) && previousAnswers?.targetSystem ===
|
|
57
|
+
return showClientCondition(previousAnswers?.scp) && previousAnswers?.targetSystem === TargetSystemType.Url;
|
|
78
58
|
}
|
|
79
59
|
/**
|
|
80
60
|
* Determines if the client question should be shown under very specific conditions.
|
|
@@ -82,13 +62,13 @@ function showClientChoiceQuestion(previousAnswers, client) {
|
|
|
82
62
|
* @param previousAnswers - previous answers
|
|
83
63
|
* @returns boolean
|
|
84
64
|
*/
|
|
85
|
-
function showClientQuestion(previousAnswers) {
|
|
65
|
+
export function showClientQuestion(previousAnswers) {
|
|
86
66
|
const clientCondition = showClientCondition(previousAnswers?.scp);
|
|
87
|
-
const isTargetUrl = previousAnswers?.targetSystem ===
|
|
88
|
-
const showCli = !
|
|
89
|
-
? previousAnswers?.clientChoice ===
|
|
67
|
+
const isTargetUrl = previousAnswers?.targetSystem === TargetSystemType.Url;
|
|
68
|
+
const showCli = !PromptState.isYUI
|
|
69
|
+
? previousAnswers?.clientChoice === ClientChoiceValue.New || isTargetUrl
|
|
90
70
|
: isTargetUrl;
|
|
91
|
-
const showYui =
|
|
71
|
+
const showYui = PromptState.isYUI ? isTargetUrl : false;
|
|
92
72
|
return (showYui && clientCondition) || (showCli && clientCondition);
|
|
93
73
|
}
|
|
94
74
|
/**
|
|
@@ -97,32 +77,32 @@ function showClientQuestion(previousAnswers) {
|
|
|
97
77
|
* @param backendTarget - backend target from prompt options
|
|
98
78
|
* @returns boolean
|
|
99
79
|
*/
|
|
100
|
-
async function showUsernameQuestion(backendTarget) {
|
|
101
|
-
const { transportConfig, transportConfigNeedsCreds } = await
|
|
80
|
+
export async function showUsernameQuestion(backendTarget) {
|
|
81
|
+
const { transportConfig, transportConfigNeedsCreds } = await initTransportConfig({
|
|
102
82
|
backendTarget: backendTarget,
|
|
103
|
-
url:
|
|
104
|
-
client:
|
|
105
|
-
destination:
|
|
83
|
+
url: PromptState.abapDeployConfig.url,
|
|
84
|
+
client: PromptState.abapDeployConfig.client,
|
|
85
|
+
destination: PromptState.abapDeployConfig.destination,
|
|
106
86
|
errorHandler: (e) => {
|
|
107
|
-
|
|
87
|
+
handleTransportConfigError(e);
|
|
108
88
|
}
|
|
109
89
|
});
|
|
110
90
|
// Update the prompt state with the transport configuration
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
PromptState.transportAnswers.transportConfig = transportConfig;
|
|
92
|
+
PromptState.transportAnswers.transportConfigNeedsCreds = transportConfigNeedsCreds ?? false;
|
|
113
93
|
// Provide context to the CLI when username credentials are required
|
|
114
94
|
if (transportConfigNeedsCreds) {
|
|
115
|
-
|
|
95
|
+
LoggerHelper.logger.info(t('errors.atoUnauthorisedSystem'));
|
|
116
96
|
}
|
|
117
|
-
return
|
|
97
|
+
return PromptState.transportAnswers.transportConfigNeedsCreds;
|
|
118
98
|
}
|
|
119
99
|
/**
|
|
120
100
|
* Determines if the password question should be shown.
|
|
121
101
|
*
|
|
122
102
|
* @returns boolean
|
|
123
103
|
*/
|
|
124
|
-
function showPasswordQuestion() {
|
|
125
|
-
return Boolean(
|
|
104
|
+
export function showPasswordQuestion() {
|
|
105
|
+
return Boolean(PromptState.transportAnswers.transportConfigNeedsCreds);
|
|
126
106
|
}
|
|
127
107
|
/**
|
|
128
108
|
* Determines if the UI5 app deploy config question should be shown (UI5 Abap Repo name & Description).
|
|
@@ -130,11 +110,11 @@ function showPasswordQuestion() {
|
|
|
130
110
|
* @param ui5AbapPromptOptions - UI5 Abap Repo prompt options
|
|
131
111
|
* @returns boolean
|
|
132
112
|
*/
|
|
133
|
-
function showUi5AppDeployConfigQuestion(ui5AbapPromptOptions) {
|
|
134
|
-
if (!ui5AbapPromptOptions?.hide && ui5AbapPromptOptions?.hideIfOnPremise && !
|
|
113
|
+
export function showUi5AppDeployConfigQuestion(ui5AbapPromptOptions) {
|
|
114
|
+
if (!ui5AbapPromptOptions?.hide && ui5AbapPromptOptions?.hideIfOnPremise && !PromptState.abapDeployConfig?.scp) {
|
|
135
115
|
return false;
|
|
136
116
|
}
|
|
137
|
-
return !
|
|
117
|
+
return !PromptState.transportAnswers.transportConfigNeedsCreds;
|
|
138
118
|
}
|
|
139
119
|
/**
|
|
140
120
|
* Determines if the package question should be shown.
|
|
@@ -142,13 +122,13 @@ function showUi5AppDeployConfigQuestion(ui5AbapPromptOptions) {
|
|
|
142
122
|
* @returns boolean
|
|
143
123
|
*/
|
|
144
124
|
function defaultOrShowPackageQuestion() {
|
|
145
|
-
if (
|
|
146
|
-
|
|
125
|
+
if (PromptState.transportAnswers?.transportConfig?.getPackage()) {
|
|
126
|
+
PromptState.abapDeployConfig.package = PromptState.transportAnswers.transportConfig.getPackage();
|
|
147
127
|
return false;
|
|
148
128
|
}
|
|
149
129
|
else {
|
|
150
|
-
return (!
|
|
151
|
-
!
|
|
130
|
+
return (!PromptState.transportAnswers?.transportConfigError &&
|
|
131
|
+
!PromptState.transportAnswers?.transportConfigNeedsCreds);
|
|
152
132
|
}
|
|
153
133
|
}
|
|
154
134
|
/**
|
|
@@ -157,11 +137,11 @@ function defaultOrShowPackageQuestion() {
|
|
|
157
137
|
* @param useAutocomplete - useAutocomplete option from prompt options
|
|
158
138
|
* @returns boolean
|
|
159
139
|
*/
|
|
160
|
-
function showPackageInputChoiceQuestion(useAutocomplete = false) {
|
|
140
|
+
export function showPackageInputChoiceQuestion(useAutocomplete = false) {
|
|
161
141
|
if (!useAutocomplete) {
|
|
162
142
|
return false;
|
|
163
143
|
}
|
|
164
|
-
const isPromptSupported = !
|
|
144
|
+
const isPromptSupported = !PromptState.isYUI || (PromptState.isYUI && useAutocomplete);
|
|
165
145
|
return isPromptSupported && defaultOrShowPackageQuestion();
|
|
166
146
|
}
|
|
167
147
|
/**
|
|
@@ -171,11 +151,11 @@ function showPackageInputChoiceQuestion(useAutocomplete = false) {
|
|
|
171
151
|
* @param useAutocomplete - useAutocomplete option from prompt options
|
|
172
152
|
* @returns boolean
|
|
173
153
|
*/
|
|
174
|
-
function defaultOrShowManualPackageQuestion(packageInputChoice, useAutocomplete = false) {
|
|
154
|
+
export function defaultOrShowManualPackageQuestion(packageInputChoice, useAutocomplete = false) {
|
|
175
155
|
if (!useAutocomplete) {
|
|
176
156
|
return false;
|
|
177
157
|
}
|
|
178
|
-
return packageInputChoice ===
|
|
158
|
+
return packageInputChoice === PackageInputChoices.EnterManualChoice && defaultOrShowPackageQuestion();
|
|
179
159
|
}
|
|
180
160
|
/**
|
|
181
161
|
* Determines if the search (autocomplete) package input prompt can be shown based on backend availability.
|
|
@@ -184,12 +164,12 @@ function defaultOrShowManualPackageQuestion(packageInputChoice, useAutocomplete
|
|
|
184
164
|
* @param useAutocomplete - useAutocomplete option from prompt options
|
|
185
165
|
* @returns boolean
|
|
186
166
|
*/
|
|
187
|
-
function defaultOrShowSearchPackageQuestion(packageInputChoice, useAutocomplete = false) {
|
|
167
|
+
export function defaultOrShowSearchPackageQuestion(packageInputChoice, useAutocomplete = false) {
|
|
188
168
|
// Only show the autocomplete prompt when the autocomplete prompt is supported; CLI or YUI specific version
|
|
189
169
|
if (!useAutocomplete) {
|
|
190
170
|
return false;
|
|
191
171
|
}
|
|
192
|
-
return packageInputChoice ===
|
|
172
|
+
return packageInputChoice === PackageInputChoices.ListExistingChoice && defaultOrShowPackageQuestion();
|
|
193
173
|
}
|
|
194
174
|
/**
|
|
195
175
|
* Determines if the transport question should be shown.
|
|
@@ -197,16 +177,16 @@ function defaultOrShowSearchPackageQuestion(packageInputChoice, useAutocomplete
|
|
|
197
177
|
* @returns boolean
|
|
198
178
|
*/
|
|
199
179
|
function defaultOrShowTransportQuestion() {
|
|
200
|
-
if (
|
|
180
|
+
if (PromptState.transportAnswers.transportRequired === false) {
|
|
201
181
|
return false;
|
|
202
182
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
183
|
+
if (PromptState.transportAnswers.transportConfig?.getDefaultTransport() !== undefined) {
|
|
184
|
+
PromptState.abapDeployConfig.transport = PromptState.transportAnswers.transportConfig.getDefaultTransport();
|
|
205
185
|
return false;
|
|
206
186
|
}
|
|
207
187
|
else {
|
|
208
|
-
return (!
|
|
209
|
-
!
|
|
188
|
+
return (!PromptState.transportAnswers.transportConfigError &&
|
|
189
|
+
!PromptState.transportAnswers.transportConfigNeedsCreds);
|
|
210
190
|
}
|
|
211
191
|
}
|
|
212
192
|
/**
|
|
@@ -215,8 +195,8 @@ function defaultOrShowTransportQuestion() {
|
|
|
215
195
|
* @param options - abap deploy config prompt options
|
|
216
196
|
* @returns boolean
|
|
217
197
|
*/
|
|
218
|
-
function showTransportInputChoice(options) {
|
|
219
|
-
if (options?.hideIfOnPremise && !
|
|
198
|
+
export function showTransportInputChoice(options) {
|
|
199
|
+
if (options?.hideIfOnPremise && !PromptState.abapDeployConfig?.scp) {
|
|
220
200
|
return false;
|
|
221
201
|
}
|
|
222
202
|
return defaultOrShowTransportQuestion();
|
|
@@ -237,13 +217,13 @@ function isTransportListEmpty(transportList) {
|
|
|
237
217
|
* @param transportInputChoiceOptions - transportInputChoice options
|
|
238
218
|
* @returns boolean
|
|
239
219
|
*/
|
|
240
|
-
function defaultOrShowTransportListQuestion(transportInputChoice, transportInputChoiceOptions) {
|
|
220
|
+
export function defaultOrShowTransportListQuestion(transportInputChoice, transportInputChoiceOptions) {
|
|
241
221
|
const showQuestion = defaultOrShowTransportQuestion();
|
|
242
222
|
if (!showQuestion) {
|
|
243
223
|
return false;
|
|
244
224
|
}
|
|
245
|
-
return (transportInputChoice ===
|
|
246
|
-
!isTransportListEmpty(
|
|
225
|
+
return (transportInputChoice === TransportChoices.ListExistingChoice &&
|
|
226
|
+
!isTransportListEmpty(PromptState.transportAnswers.transportList) &&
|
|
247
227
|
!transportInputChoiceOptions?.hideIfOnPremise);
|
|
248
228
|
}
|
|
249
229
|
/**
|
|
@@ -252,12 +232,12 @@ function defaultOrShowTransportListQuestion(transportInputChoice, transportInput
|
|
|
252
232
|
* @param transportInputChoice - transportInputChoice from previous answers
|
|
253
233
|
* @returns boolean
|
|
254
234
|
*/
|
|
255
|
-
function defaultOrShowTransportCreatedQuestion(transportInputChoice) {
|
|
235
|
+
export function defaultOrShowTransportCreatedQuestion(transportInputChoice) {
|
|
256
236
|
const showQuestion = defaultOrShowTransportQuestion();
|
|
257
237
|
if (!showQuestion) {
|
|
258
238
|
return false;
|
|
259
239
|
}
|
|
260
|
-
return (transportInputChoice ===
|
|
240
|
+
return (transportInputChoice === TransportChoices.CreateNewChoice && !!PromptState.transportAnswers.newTransportNumber);
|
|
261
241
|
}
|
|
262
242
|
/**
|
|
263
243
|
* Determines if the manual transport prompt should be shown.
|
|
@@ -266,9 +246,9 @@ function defaultOrShowTransportCreatedQuestion(transportInputChoice) {
|
|
|
266
246
|
* @param transportInputChoiceOptions - transportInputChoice options
|
|
267
247
|
* @returns boolean
|
|
268
248
|
*/
|
|
269
|
-
function defaultOrShowManualTransportQuestion(transportInputChoice, transportInputChoiceOptions) {
|
|
249
|
+
export function defaultOrShowManualTransportQuestion(transportInputChoice, transportInputChoiceOptions) {
|
|
270
250
|
return (defaultOrShowTransportQuestion() &&
|
|
271
|
-
(transportInputChoice ===
|
|
251
|
+
(transportInputChoice === TransportChoices.EnterManualChoice || !!transportInputChoiceOptions?.hideIfOnPremise));
|
|
272
252
|
}
|
|
273
253
|
/**
|
|
274
254
|
* Determines if the index prompt should be shown.
|
|
@@ -276,8 +256,8 @@ function defaultOrShowManualTransportQuestion(transportInputChoice, transportInp
|
|
|
276
256
|
* @param options - abap deploy config prompt options
|
|
277
257
|
* @returns boolean
|
|
278
258
|
*/
|
|
279
|
-
function showIndexQuestion(options) {
|
|
280
|
-
const condition = Boolean(options.index?.indexGenerationAllowed && !
|
|
281
|
-
return condition && !
|
|
259
|
+
export function showIndexQuestion(options) {
|
|
260
|
+
const condition = Boolean(options.index?.indexGenerationAllowed && !PromptState.abapDeployConfig.index);
|
|
261
|
+
return condition && !PromptState.transportAnswers.transportConfigError && options.backendTarget?.type !== 'library';
|
|
282
262
|
}
|
|
283
263
|
//# sourceMappingURL=conditions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/prompts/conditions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/prompts/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAC/B,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAOnB,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,YAAqB;IACjD,OAAO,YAAY,KAAK,gBAAgB,CAAC,GAAG,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,eAAgD;IAC5E,IACI,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC;QACjD,CAAC,eA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