@axway/axway-central-cli 3.10.0-rc.6 → 3.10.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/commands/install/agents.js +3 -1
- package/dist/commands/install/helpers/index.js +2 -1
- package/dist/commands/install/helpers/regex.js +2 -1
- package/dist/commands/install/helpers/templates/sapApiPortalTemplates.js +118 -0
- package/dist/commands/install/sapApiPortalAgents.js +199 -0
- package/dist/common/types.js +8 -3
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ var softwareAGWebMethodsAgent = _interopRequireWildcard(require("./softwareAGWeb
|
|
|
34
34
|
var traceableAgent = _interopRequireWildcard(require("./traceableAgents"));
|
|
35
35
|
var platform = _interopRequireWildcard(require("./platform"));
|
|
36
36
|
var backstageAgent = _interopRequireWildcard(require("./backstageAgents"));
|
|
37
|
+
var sapApiPortalAgent = _interopRequireWildcard(require("./sapApiPortalAgents"));
|
|
37
38
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
38
39
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
39
40
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -59,7 +60,8 @@ const agentInstallFlows = {
|
|
|
59
60
|
[_types.GatewayTypes.IBMAPICONNECT]: ibmAPIConnectAgent.IBMAPIConnectInstallMethods,
|
|
60
61
|
[_types.GatewayTypes.SOFTWAREAGWEBMETHODS]: softwareAGWebMethodsAgent.SoftwareAGWebMethodsInstallMethods,
|
|
61
62
|
[_types.GatewayTypes.TRACEABLE]: traceableAgent.TraceableInstallMethods,
|
|
62
|
-
[_types.GatewayTypes.BACKSTAGE]: backstageAgent.BackstageInstallMethods
|
|
63
|
+
[_types.GatewayTypes.BACKSTAGE]: backstageAgent.BackstageInstallMethods,
|
|
64
|
+
[_types.GatewayTypes.SAPAPIPORTAL]: sapApiPortalAgent.SAPAPIPortalInstallMethods
|
|
63
65
|
};
|
|
64
66
|
const saasAgentInstallFlows = {
|
|
65
67
|
[_types.SaaSGatewayTypes.AWS_GATEWAY]: awsSaaSAgents.AWSSaaSInstallMethods,
|
|
@@ -37,7 +37,8 @@ const AWSRegexPatterns = exports.AWSRegexPatterns = {
|
|
|
37
37
|
|
|
38
38
|
// APIGEEXRegexPatterns - regex patters to validate user inputs
|
|
39
39
|
const APIGEEXRegexPatterns = exports.APIGEEXRegexPatterns = {
|
|
40
|
-
APIGEEX_REGEXP_PROJECT_ID: '^[a-z][a-z0-9-]{4,28}[a-z0-9]$'
|
|
40
|
+
APIGEEX_REGEXP_PROJECT_ID: '^[a-z][a-z0-9-]{4,28}[a-z0-9]$',
|
|
41
|
+
APIGEEX_REGEXP_EMAIL_ADDRESS: '^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
// AzureRegexPatterns - regex patters to validate user inputs
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sapAPIPortalTAEnvVarTemplate = exports.sapAPIPortalDAEnvVarTemplate = exports.SAPApiPortalAgentValues = void 0;
|
|
7
|
+
var _types = require("../../../../common/types");
|
|
8
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
/**
|
|
12
|
+
* @description Parameters to provide to the SAP API Portal handlebars templates.
|
|
13
|
+
*/
|
|
14
|
+
class SAPApiPortalAgentValues {
|
|
15
|
+
constructor() {
|
|
16
|
+
_defineProperty(this, "authTokenURL", void 0);
|
|
17
|
+
_defineProperty(this, "authAPIPortalBaseURL", void 0);
|
|
18
|
+
_defineProperty(this, "authAPIPortalClientID", void 0);
|
|
19
|
+
_defineProperty(this, "authAPIPortalClientSecret", void 0);
|
|
20
|
+
_defineProperty(this, "authDevPortalBaseURL", void 0);
|
|
21
|
+
_defineProperty(this, "authDevPortalClientID", void 0);
|
|
22
|
+
_defineProperty(this, "authDevPortalClientSecret", void 0);
|
|
23
|
+
_defineProperty(this, "developerEmail", void 0);
|
|
24
|
+
_defineProperty(this, "specCreateUnstructuredAPI", void 0);
|
|
25
|
+
_defineProperty(this, "centralConfig", void 0);
|
|
26
|
+
_defineProperty(this, "traceabilityConfig", void 0);
|
|
27
|
+
this.authTokenURL = '';
|
|
28
|
+
this.authAPIPortalBaseURL = '';
|
|
29
|
+
this.authAPIPortalClientID = '';
|
|
30
|
+
this.authAPIPortalClientSecret = '';
|
|
31
|
+
this.authDevPortalBaseURL = '';
|
|
32
|
+
this.authDevPortalClientID = '';
|
|
33
|
+
this.authDevPortalClientSecret = '';
|
|
34
|
+
this.developerEmail = '';
|
|
35
|
+
this.specCreateUnstructuredAPI = false;
|
|
36
|
+
this.centralConfig = new _types.CentralAgentConfig();
|
|
37
|
+
this.traceabilityConfig = new _types.TraceabilityConfig();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @description Generates the SAP API Portal DA env vars file.
|
|
43
|
+
*/
|
|
44
|
+
exports.SAPApiPortalAgentValues = SAPApiPortalAgentValues;
|
|
45
|
+
const sapAPIPortalDAEnvVarTemplate = () => {
|
|
46
|
+
return `# SAP API Portal configs
|
|
47
|
+
SAP_AUTH_TOKENURL={{authTokenURL}}
|
|
48
|
+
SAP_AUTH_APIPORTAL_BASEURL={{authAPIPortalBaseURL}}
|
|
49
|
+
SAP_AUTH_APIPORTAL_CLIENTID={{authAPIPortalClientID}}
|
|
50
|
+
SAP_AUTH_APIPORTAL_CLIENTSECRET={{authAPIPortalClientSecret}}
|
|
51
|
+
SAP_AUTH_DEVPORTAL_BASEURL={{authDevPortalBaseURL}}
|
|
52
|
+
SAP_AUTH_DEVPORTAL_CLIENTID={{authDevPortalClientID}}
|
|
53
|
+
SAP_AUTH_DEVPORTAL_CLIENTSECRET={{authDevPortalClientSecret}}
|
|
54
|
+
SAP_DEVELOPEREMAIL={{developerEmail}}
|
|
55
|
+
SAP_SPEC_CREATEUNSTRUCTUREDAPI={{specCreateUnstructuredAPI}}
|
|
56
|
+
|
|
57
|
+
# Amplify Central configs
|
|
58
|
+
CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
|
|
59
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
60
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
61
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
62
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
63
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
64
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
65
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
66
|
+
|
|
67
|
+
# Logging configs
|
|
68
|
+
# Define the logging level: info, debug, error
|
|
69
|
+
LOG_LEVEL=info
|
|
70
|
+
# Specify where to send the log: stdout, file, both
|
|
71
|
+
LOG_OUTPUT=stdout
|
|
72
|
+
# Define where the log files are written
|
|
73
|
+
LOG_FILE_PATH=logs
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @description Generates the SAP API Portal TA env vars file.
|
|
79
|
+
*/
|
|
80
|
+
exports.sapAPIPortalDAEnvVarTemplate = sapAPIPortalDAEnvVarTemplate;
|
|
81
|
+
const sapAPIPortalTAEnvVarTemplate = () => {
|
|
82
|
+
return `# SAP API Portal configs
|
|
83
|
+
SAP_AUTH_TOKENURL={{authTokenURL}}
|
|
84
|
+
SAP_AUTH_APIPORTAL_BASEURL={{authAPIPortalBaseURL}}
|
|
85
|
+
SAP_AUTH_APIPORTAL_CLIENTID={{authAPIPortalClientID}}
|
|
86
|
+
SAP_AUTH_APIPORTAL_CLIENTSECRET={{authAPIPortalClientSecret}}
|
|
87
|
+
|
|
88
|
+
# Amplify Central configs
|
|
89
|
+
{{#if traceabilityConfig.usageReportingOffline}}
|
|
90
|
+
CENTRAL_USAGEREPORTING_OFFLINE={{traceabilityConfig.usageReportingOffline}}
|
|
91
|
+
CENTRAL_ENVIRONMENTID={{centralConfig.environmentId}}
|
|
92
|
+
CENTRAL_AGENTNAME={{centralConfig.taAgentName}}
|
|
93
|
+
{{else}}
|
|
94
|
+
CENTRAL_AGENTNAME={{centralConfig.taAgentName}}
|
|
95
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
96
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
97
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
98
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
99
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
100
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
101
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
102
|
+
|
|
103
|
+
{{#compare . traceabilityConfig.protocol "https"}}
|
|
104
|
+
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
105
|
+
{{/compare}}
|
|
106
|
+
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
107
|
+
{{/if}}
|
|
108
|
+
|
|
109
|
+
# Logging configs
|
|
110
|
+
# Define the logging level: info, debug, error
|
|
111
|
+
LOG_LEVEL=info
|
|
112
|
+
# Specify where to send the log: stdout, file, both
|
|
113
|
+
LOG_OUTPUT=stdout
|
|
114
|
+
# Define where the log files are written
|
|
115
|
+
LOG_FILE_PATH=logs
|
|
116
|
+
`;
|
|
117
|
+
};
|
|
118
|
+
exports.sapAPIPortalTAEnvVarTemplate = sapAPIPortalTAEnvVarTemplate;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.testables = exports.gatewayConnectivity = exports.defaultLogFiles = exports.completeInstall = exports.askConfigType = exports.askBundleType = exports.SAPAPIPortalInstallMethods = exports.ConfigFiles = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
9
|
+
var _basicPrompts = require("../../common/basicPrompts");
|
|
10
|
+
var _types = require("../../common/types");
|
|
11
|
+
var _utils = require("../../common/utils");
|
|
12
|
+
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
13
|
+
var _sapApiPortalTemplates = require("./helpers/templates/sapApiPortalTemplates");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const {
|
|
19
|
+
log
|
|
20
|
+
} = (0, _snooplogg.default)('central: install: agents: SAP API Portal');
|
|
21
|
+
const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.SAPAPIPORTAL_DA}`;
|
|
22
|
+
const taImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.SAPAPIPORTAL_TA}`;
|
|
23
|
+
const defaultLogFiles = exports.defaultLogFiles = '/group-*_instance-*.log';
|
|
24
|
+
|
|
25
|
+
// ConfigFiles - all the config file that are used in the setup
|
|
26
|
+
const ConfigFiles = exports.ConfigFiles = {
|
|
27
|
+
DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`,
|
|
28
|
+
TAEnvVars: `${helpers.configFiles.TA_ENV_VARS}`,
|
|
29
|
+
SAPAPIPortalDABinaryFile: 'discovery_agent',
|
|
30
|
+
SAPAPIPortalDAYaml: 'discovery_agent.yml',
|
|
31
|
+
SAPAPIPortalTABinaryFile: 'traceability_agent',
|
|
32
|
+
SAPAPIPortalTAYaml: 'traceability_agent.yml'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// SAPAPIPortalPrompts - prompts for user inputs
|
|
36
|
+
const SAPAPIPortalPrompts = {
|
|
37
|
+
configTypeMsg: 'Select the mode of installation',
|
|
38
|
+
enterAuthTokenURL: 'Enter the token URL used for agent authentication to SAP',
|
|
39
|
+
enterAuthAPIPortalBaseURL: 'Enter the SAP API Portal baseURL',
|
|
40
|
+
enterAuthAPIPortalClientID: 'Enter the SAP API Portal ClientID',
|
|
41
|
+
enterAuthAPIPortalClientSecret: 'Enter the SAP API Portal ClientSecret',
|
|
42
|
+
enterAuthDevPortalBaseURL: 'Enter the SAP Dev Portal baseURL',
|
|
43
|
+
enterAuthDevPortalClientID: 'Enter the SAP Dev Portal ClientID',
|
|
44
|
+
enterAuthDevPortalClientSecret: 'Enter the SAP Dev Portal ClientSecret',
|
|
45
|
+
enterDeveloperEmail: 'Enter the SAP developer email',
|
|
46
|
+
selectSpecCreateUnstructuredAPI: 'Select whether to create unstructured APIs for invalid/unknown API specs'
|
|
47
|
+
};
|
|
48
|
+
const askBundleType = async () => {
|
|
49
|
+
return await (0, _basicPrompts.askList)({
|
|
50
|
+
msg: helpers.agentMessages.selectAgentType,
|
|
51
|
+
choices: [_types.BundleType.ALL_AGENTS, _types.BundleType.DISCOVERY, _types.BundleType.TRACEABILITY]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.askBundleType = askBundleType;
|
|
55
|
+
const askConfigType = async () => {
|
|
56
|
+
return _types.AgentConfigTypes.DOCKERIZED;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//
|
|
60
|
+
// Questions for the configuration of IBM API Connect agents
|
|
61
|
+
//
|
|
62
|
+
exports.askConfigType = askConfigType;
|
|
63
|
+
const askAuthTokenURL = async () => await (0, _basicPrompts.askInput)({
|
|
64
|
+
msg: SAPAPIPortalPrompts.enterAuthTokenURL
|
|
65
|
+
});
|
|
66
|
+
const askAuthAPIPortalBaseURL = async () => await (0, _basicPrompts.askInput)({
|
|
67
|
+
msg: SAPAPIPortalPrompts.enterAuthAPIPortalBaseURL
|
|
68
|
+
});
|
|
69
|
+
const askAuthAPIPortalClientID = async () => await (0, _basicPrompts.askInput)({
|
|
70
|
+
msg: SAPAPIPortalPrompts.enterAuthAPIPortalClientID
|
|
71
|
+
});
|
|
72
|
+
const askAuthAPIPortalClientSecret = async () => await (0, _basicPrompts.askInput)({
|
|
73
|
+
msg: SAPAPIPortalPrompts.enterAuthAPIPortalClientSecret
|
|
74
|
+
});
|
|
75
|
+
const askAuthDevPortalBaseURL = async () => await (0, _basicPrompts.askInput)({
|
|
76
|
+
msg: SAPAPIPortalPrompts.enterAuthDevPortalBaseURL
|
|
77
|
+
});
|
|
78
|
+
const askAuthDevPortalClientID = async () => await (0, _basicPrompts.askInput)({
|
|
79
|
+
msg: SAPAPIPortalPrompts.enterAuthDevPortalClientID
|
|
80
|
+
});
|
|
81
|
+
const askAuthDevPortalClientSecret = async () => await (0, _basicPrompts.askInput)({
|
|
82
|
+
msg: SAPAPIPortalPrompts.enterAuthDevPortalClientSecret
|
|
83
|
+
});
|
|
84
|
+
const askDeveloperEmail = async () => await (0, _basicPrompts.askInput)({
|
|
85
|
+
msg: SAPAPIPortalPrompts.enterDeveloperEmail
|
|
86
|
+
});
|
|
87
|
+
const askSpecCreateUnstructuredAPI = async () => (await (0, _basicPrompts.askList)({
|
|
88
|
+
msg: SAPAPIPortalPrompts.selectSpecCreateUnstructuredAPI,
|
|
89
|
+
default: _types.YesNo.No,
|
|
90
|
+
choices: _types.YesNoChoices
|
|
91
|
+
})) === _types.YesNo.Yes;
|
|
92
|
+
const gatewayConnectivity = async installConfig => {
|
|
93
|
+
const agentValues = new _sapApiPortalTemplates.SAPApiPortalAgentValues();
|
|
94
|
+
console.log('\nCONNECTION TO IBM API Connect:');
|
|
95
|
+
console.log(_chalk.default.gray(`The discovery agent needs to connect to the IBM API Connect Gateway to discover API's for publishing to Amplify.\nThe traceability agent needs to connect to IBM API Connect for collecting APIs transactions. These will be forwarded to the Business Insights.\n`));
|
|
96
|
+
await askCommonPrompts(agentValues);
|
|
97
|
+
|
|
98
|
+
// SAP API Portal Discovery Agent Prompts
|
|
99
|
+
if (installConfig.switches.isDaEnabled) {
|
|
100
|
+
console.log(_chalk.default.gray(`\nDiscovery Agent Configuration\n`));
|
|
101
|
+
await askDiscoveryPrompts(agentValues);
|
|
102
|
+
}
|
|
103
|
+
return agentValues;
|
|
104
|
+
};
|
|
105
|
+
exports.gatewayConnectivity = gatewayConnectivity;
|
|
106
|
+
const generateSuccessHelpMsg = installConfig => {
|
|
107
|
+
if (installConfig.centralConfig.ampcDosaInfo.isNew && !installConfig.switches.isHelmInstall) {
|
|
108
|
+
console.log(_chalk.default.yellow('\nPlease make sure to copy the "private_key.pem" and "public_key.pem" files for the existing service account you selected.'));
|
|
109
|
+
}
|
|
110
|
+
dockerSuccessMsg(installConfig);
|
|
111
|
+
console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.SAPAPIPORTAL}`));
|
|
112
|
+
};
|
|
113
|
+
const dockerSuccessMsg = installConfig => {
|
|
114
|
+
let dockerInfo;
|
|
115
|
+
const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
116
|
+
const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
117
|
+
const runTaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
118
|
+
const runTaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
119
|
+
const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
|
|
120
|
+
const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
|
|
121
|
+
const startTaLinuxMsg = `\nStart the Traceability Agent on a Linux based machine`;
|
|
122
|
+
const startTaWinMsg = `\nStart the Traceability Agent on a Windows machine`;
|
|
123
|
+
if (installConfig.switches.isDaEnabled && installConfig.switches.isTaEnabled) {
|
|
124
|
+
dockerInfo = `To utilize the agents, pull the latest Docker images and run them using the appropriate supplied environment files, (${helpers.configFiles.DA_ENV_VARS} & ${helpers.configFiles.TA_ENV_VARS}):`;
|
|
125
|
+
} else if (installConfig.switches.isDaEnabled) {
|
|
126
|
+
dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
|
|
127
|
+
} else {
|
|
128
|
+
dockerInfo = `To utilize the traceability agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.TA_ENV_VARS}):`;
|
|
129
|
+
}
|
|
130
|
+
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
131
|
+
if (installConfig.switches.isDaEnabled) {
|
|
132
|
+
const daImageVersion = `${daImage}:${installConfig.daVersion}`;
|
|
133
|
+
console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
|
|
134
|
+
console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
|
|
135
|
+
console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
|
|
136
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
|
|
137
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
|
|
138
|
+
}
|
|
139
|
+
if (installConfig.switches.isTaEnabled) {
|
|
140
|
+
const taImageVersion = `${taImage}:${installConfig.taVersion}`;
|
|
141
|
+
console.log(_chalk.default.white('Pull the latest image of the Traceability Agent:'));
|
|
142
|
+
console.log(_chalk.default.cyan(`docker pull ${taImageVersion}`));
|
|
143
|
+
console.log(_chalk.default.white(_utils.isWindows ? startTaWinMsg : startTaLinuxMsg));
|
|
144
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runTaWinMsg : runTaLinuxMsg));
|
|
145
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${taImageVersion}`), '\n');
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
async function askCommonPrompts(agentValues) {
|
|
149
|
+
agentValues.authTokenURL = await askAuthTokenURL();
|
|
150
|
+
agentValues.authAPIPortalBaseURL = await askAuthAPIPortalBaseURL();
|
|
151
|
+
agentValues.authAPIPortalClientID = await askAuthAPIPortalClientID();
|
|
152
|
+
agentValues.authAPIPortalClientSecret = await askAuthAPIPortalClientSecret();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// IBM API Connect DA prompts
|
|
156
|
+
async function askDiscoveryPrompts(agentValues) {
|
|
157
|
+
agentValues.authDevPortalBaseURL = await askAuthDevPortalBaseURL();
|
|
158
|
+
agentValues.authDevPortalClientID = await askAuthDevPortalClientID();
|
|
159
|
+
agentValues.authDevPortalClientSecret = await askAuthDevPortalClientSecret();
|
|
160
|
+
agentValues.developerEmail = await askDeveloperEmail();
|
|
161
|
+
agentValues.specCreateUnstructuredAPI = await askSpecCreateUnstructuredAPI();
|
|
162
|
+
}
|
|
163
|
+
const completeInstall = async installConfig => {
|
|
164
|
+
/**
|
|
165
|
+
* Create agent resources
|
|
166
|
+
*/
|
|
167
|
+
const agentValues = installConfig.gatewayConfig;
|
|
168
|
+
|
|
169
|
+
// Add final settings to SAP API Portal agentValues
|
|
170
|
+
agentValues.centralConfig = installConfig.centralConfig;
|
|
171
|
+
agentValues.traceabilityConfig = installConfig.traceabilityConfig;
|
|
172
|
+
console.log('Generating the configuration file(s)...');
|
|
173
|
+
if (installConfig.switches.isDaEnabled) {
|
|
174
|
+
(0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, agentValues, _sapApiPortalTemplates.sapAPIPortalDAEnvVarTemplate);
|
|
175
|
+
}
|
|
176
|
+
if (installConfig.switches.isTaEnabled) {
|
|
177
|
+
(0, _utils.writeTemplates)(ConfigFiles.TAEnvVars, agentValues, _sapApiPortalTemplates.sapAPIPortalTAEnvVarTemplate);
|
|
178
|
+
}
|
|
179
|
+
console.log('Configuration file(s) have been successfully created.\n');
|
|
180
|
+
generateSuccessHelpMsg(installConfig);
|
|
181
|
+
};
|
|
182
|
+
exports.completeInstall = completeInstall;
|
|
183
|
+
const SAPAPIPortalInstallMethods = exports.SAPAPIPortalInstallMethods = {
|
|
184
|
+
GetBundleType: askBundleType,
|
|
185
|
+
GetDeploymentType: askConfigType,
|
|
186
|
+
AskGatewayQuestions: gatewayConnectivity,
|
|
187
|
+
FinalizeGatewayInstall: completeInstall,
|
|
188
|
+
ConfigFiles: Object.values(ConfigFiles),
|
|
189
|
+
AgentNameMap: {
|
|
190
|
+
[_types.AgentTypes.da]: _types.AgentNames.SAPAPIPORTAL_DA,
|
|
191
|
+
[_types.AgentTypes.ta]: _types.AgentNames.SAPAPIPORTAL_TA
|
|
192
|
+
},
|
|
193
|
+
GatewayDisplay: _types.GatewayTypes.SAPAPIPORTAL
|
|
194
|
+
};
|
|
195
|
+
const testables = exports.testables = {
|
|
196
|
+
SAPAPIPortalPrompts,
|
|
197
|
+
ConfigFiles,
|
|
198
|
+
defaultLogFiles
|
|
199
|
+
};
|
package/dist/common/types.js
CHANGED
|
@@ -237,9 +237,11 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
237
237
|
AgentNames["IBMAPICONNECT_DA"] = "ibm-apiconnect-discovery-agent";
|
|
238
238
|
AgentNames["IBMAPICONNECT_TA"] = "ibm-apiconnect-traceability-agent";
|
|
239
239
|
AgentNames["TRACEABLE_TA"] = "traceable-agent";
|
|
240
|
-
AgentNames["SOFTWAREAGWEBMETHODS_DA"] = "software-ag-
|
|
241
|
-
AgentNames["SOFTWAREAGWEBMETHODS_TA"] = "software-ag-
|
|
240
|
+
AgentNames["SOFTWAREAGWEBMETHODS_DA"] = "software-ag-webmethods-discovery-agent";
|
|
241
|
+
AgentNames["SOFTWAREAGWEBMETHODS_TA"] = "software-ag-webmethods-traceability-agent";
|
|
242
242
|
AgentNames["BACKSTAGE_DA"] = "backstage-discovery-agent";
|
|
243
|
+
AgentNames["SAPAPIPORTAL_DA"] = "sap-discovery-agent";
|
|
244
|
+
AgentNames["SAPAPIPORTAL_TA"] = "sap-traceability-agent";
|
|
243
245
|
return AgentNames;
|
|
244
246
|
}({});
|
|
245
247
|
let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
@@ -257,6 +259,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
|
257
259
|
GatewayTypes["SOFTWAREAGWEBMETHODS"] = "Software AG WebMethods";
|
|
258
260
|
GatewayTypes["TRACEABLE"] = "Traceable";
|
|
259
261
|
GatewayTypes["BACKSTAGE"] = "Backstage";
|
|
262
|
+
GatewayTypes["SAPAPIPORTAL"] = "SAP API Portal";
|
|
260
263
|
return GatewayTypes;
|
|
261
264
|
}({});
|
|
262
265
|
let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGatewayTypes) {
|
|
@@ -282,6 +285,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
|
|
|
282
285
|
DataPlaneNames["TRACEABLE"] = "Traceable";
|
|
283
286
|
DataPlaneNames["MULESOFT"] = "Mulesoft";
|
|
284
287
|
DataPlaneNames["BACKSTAGE"] = "Backstage";
|
|
288
|
+
DataPlaneNames["SAPAPIPORTAL"] = "SAP API Portal";
|
|
285
289
|
DataPlaneNames["OTHER"] = "Unidentified";
|
|
286
290
|
return DataPlaneNames;
|
|
287
291
|
}({});
|
|
@@ -301,7 +305,8 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
301
305
|
[GatewayTypes.GRAYLOG]: DataPlaneNames.GRAYLOG,
|
|
302
306
|
[GatewayTypes.IBMAPICONNECT]: DataPlaneNames.IBMAPICONNECT,
|
|
303
307
|
[GatewayTypes.TRACEABLE]: DataPlaneNames.TRACEABLE,
|
|
304
|
-
[GatewayTypes.BACKSTAGE]: DataPlaneNames.BACKSTAGE
|
|
308
|
+
[GatewayTypes.BACKSTAGE]: DataPlaneNames.BACKSTAGE,
|
|
309
|
+
[GatewayTypes.SAPAPIPORTAL]: DataPlaneNames.SAPAPIPORTAL
|
|
305
310
|
};
|
|
306
311
|
let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
|
|
307
312
|
AgentResourceKind["da"] = "DiscoveryAgent";
|