@axway/axway-central-cli 3.11.0 → 3.12.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/README.md +1 -1
- package/dist/commands/install/agents.js +3 -1
- package/dist/commands/install/helpers/index.js +6 -5
- package/dist/commands/install/helpers/regex.js +4 -1
- package/dist/commands/install/helpers/templates/wso2Templates.js +90 -0
- package/dist/commands/install/sapApiPortalAgents.js +4 -4
- package/dist/commands/install/wso2Agents.js +164 -0
- package/dist/common/types.js +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -290,7 +290,7 @@ You can fetch resources by Resource, by Short Name, or by the specific Resource
|
|
|
290
290
|
|
|
291
291
|
You can "simple filter" resources by title, tag, and attribute. These simple filters can be used independently or in combination(logical AND), i.e. you can filter by title AND tag AND attribute. However, they only support -singular- filters: you can only filter by _one_ tag, _one_ title, _one_ attribute at a time.
|
|
292
292
|
|
|
293
|
-
For more complex filtering and fetching(e.g. using logical OR, or filterieng by _multiple_ tags, titles, attributes, and other filters), you can also query for resources that match [RSQL-formatted](https://
|
|
293
|
+
For more complex filtering and fetching(e.g. using logical OR, or filterieng by _multiple_ tags, titles, attributes, and other filters), you can also query for resources that match [RSQL-formatted](https://docs.axway.com/bundle/amplify-central/page/docs/integrate_with_central/cli_central/cli_command_reference/index.html#complex-query-filters) query parameters you pass in. See the linked documentation for examples of RSQL query syntax, and the "get examples" below for sample usage.
|
|
294
294
|
|
|
295
295
|
Note: Using the --query flag will override any --title, --tag or --attribute flags you use.
|
|
296
296
|
|
|
@@ -35,6 +35,7 @@ var traceableAgent = _interopRequireWildcard(require("./traceableAgents"));
|
|
|
35
35
|
var platform = _interopRequireWildcard(require("./platform"));
|
|
36
36
|
var backstageAgent = _interopRequireWildcard(require("./backstageAgents"));
|
|
37
37
|
var sapApiPortalAgent = _interopRequireWildcard(require("./sapApiPortalAgents"));
|
|
38
|
+
var wso2Agents = _interopRequireWildcard(require("./wso2Agents"));
|
|
38
39
|
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); }
|
|
39
40
|
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; }
|
|
40
41
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -61,7 +62,8 @@ const agentInstallFlows = {
|
|
|
61
62
|
[_types.GatewayTypes.SOFTWAREAGWEBMETHODS]: softwareAGWebMethodsAgent.SoftwareAGWebMethodsInstallMethods,
|
|
62
63
|
[_types.GatewayTypes.TRACEABLE]: traceableAgent.TraceableInstallMethods,
|
|
63
64
|
[_types.GatewayTypes.BACKSTAGE]: backstageAgent.BackstageInstallMethods,
|
|
64
|
-
[_types.GatewayTypes.SAPAPIPORTAL]: sapApiPortalAgent.SAPAPIPortalInstallMethods
|
|
65
|
+
[_types.GatewayTypes.SAPAPIPORTAL]: sapApiPortalAgent.SAPAPIPortalInstallMethods,
|
|
66
|
+
[_types.GatewayTypes.WSO2]: wso2Agents.WSO2InstallMethods
|
|
65
67
|
};
|
|
66
68
|
const saasAgentInstallFlows = {
|
|
67
69
|
[_types.SaaSGatewayTypes.AWS_GATEWAY]: awsSaaSAgents.AWSSaaSInstallMethods,
|
|
@@ -256,11 +256,12 @@ const agentsDocsUrl = exports.agentsDocsUrl = {
|
|
|
256
256
|
AZURE: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_azure_gateway/index.html',
|
|
257
257
|
ISTIO: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html',
|
|
258
258
|
GRAYLOG: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html',
|
|
259
|
-
IBMAPICONNECT: '',
|
|
260
|
-
SOFTWAREAGWEBMETHODS: '',
|
|
261
|
-
TRACEABLE: '',
|
|
262
|
-
BACKSTAGE: '',
|
|
263
|
-
SAPAPIPORTAL: ''
|
|
259
|
+
IBMAPICONNECT: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_ibm_api_connect/index.html',
|
|
260
|
+
SOFTWAREAGWEBMETHODS: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_software_ag_webmethods/index.html',
|
|
261
|
+
TRACEABLE: 'https://docs.axway.com/bundle/amplify-central/page/docs/runtime_security/configure_runtime_compliance_traceable/index.html',
|
|
262
|
+
BACKSTAGE: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_backstage/index.html',
|
|
263
|
+
SAPAPIPORTAL: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_sap_api_portal/index.html',
|
|
264
|
+
WSO2: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_wso2_gateway/index.html'
|
|
264
265
|
};
|
|
265
266
|
|
|
266
267
|
// export * from './updaters';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.keyFromKeyValuePairRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.KafkaRegexPatterns = exports.GitLabRegexPatterns = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
|
|
6
|
+
exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.keyFromKeyValuePairRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.WSO2RegexPatterns = exports.KafkaRegexPatterns = exports.GitLabRegexPatterns = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
|
|
7
7
|
const resourceRegex = exports.resourceRegex = '^(?:[a-z0-9]*(?:\\.(?=[a-z0-9])|-+(?=[a-z0-9]))?)+[a-z0-9]$';
|
|
8
8
|
const namespaceRegex = exports.namespaceRegex = '^[a-z0-9]?(?:[-a-z0-9]*[a-z0-9]){1,100}?$';
|
|
9
9
|
const domainNameRegex = exports.domainNameRegex = '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)+([A-Za-z]){2,}$';
|
|
@@ -63,4 +63,7 @@ const GitLabRegexPatterns = exports.GitLabRegexPatterns = {
|
|
|
63
63
|
const KafkaRegexPatterns = exports.KafkaRegexPatterns = {
|
|
64
64
|
bootstrapServerRegex: '^(SASL_SSL:\/\/|SASL_PLAINTEXT:\/\/|PLAINTEXT:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z0-9]{1,5}(:[0-9]{1,5})$',
|
|
65
65
|
urlRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$'
|
|
66
|
+
};
|
|
67
|
+
const WSO2RegexPatterns = exports.WSO2RegexPatterns = {
|
|
68
|
+
wso2BaseURLRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$'
|
|
66
69
|
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.wso2TAEnvVarTemplate = exports.wso2DAEnvVarTemplate = exports.WSO2AgentValues = 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 WSO2 handlebars templates.
|
|
13
|
+
*/
|
|
14
|
+
class WSO2AgentValues {
|
|
15
|
+
constructor() {
|
|
16
|
+
_defineProperty(this, "wso2BaseURL", void 0);
|
|
17
|
+
_defineProperty(this, "wso2ClientID", void 0);
|
|
18
|
+
_defineProperty(this, "wso2ClientSecret", void 0);
|
|
19
|
+
_defineProperty(this, "centralConfig", void 0);
|
|
20
|
+
_defineProperty(this, "traceabilityConfig", void 0);
|
|
21
|
+
this.wso2BaseURL = '';
|
|
22
|
+
this.wso2ClientID = '';
|
|
23
|
+
this.wso2ClientSecret = '';
|
|
24
|
+
this.centralConfig = new _types.CentralAgentConfig();
|
|
25
|
+
this.traceabilityConfig = new _types.TraceabilityConfig();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @description Generates the WSO2 DA env vars file.
|
|
31
|
+
*/
|
|
32
|
+
exports.WSO2AgentValues = WSO2AgentValues;
|
|
33
|
+
const wso2DAEnvVarTemplate = () => {
|
|
34
|
+
return `# WSO2 configs
|
|
35
|
+
WSO2_BASEURL={{wso2BaseURL}}
|
|
36
|
+
WSO2_CLIENTID={{wso2ClientID}}
|
|
37
|
+
WSO2_CLIENTSECRET={{wso2ClientSecret}}
|
|
38
|
+
|
|
39
|
+
# Amplify Central configs
|
|
40
|
+
CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
|
|
41
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
42
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
43
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
44
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
45
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
46
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
47
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
48
|
+
|
|
49
|
+
# Logging configs
|
|
50
|
+
# Define the logging level: info, debug, error
|
|
51
|
+
LOG_LEVEL=info
|
|
52
|
+
# Specify where to send the log: stdout, file, both
|
|
53
|
+
LOG_OUTPUT=stdout
|
|
54
|
+
# Define where the log files are written
|
|
55
|
+
LOG_FILE_PATH=logs
|
|
56
|
+
`;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @description Generates the WSO2 TA env vars file.
|
|
61
|
+
*/
|
|
62
|
+
exports.wso2DAEnvVarTemplate = wso2DAEnvVarTemplate;
|
|
63
|
+
const wso2TAEnvVarTemplate = () => {
|
|
64
|
+
return `# WSO2 configs - For TA, there are no WSO2 environment variables
|
|
65
|
+
|
|
66
|
+
# Amplify Central configs
|
|
67
|
+
CENTRAL_AGENTNAME={{centralConfig.taAgentName}}
|
|
68
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
69
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
70
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
71
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
72
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
73
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
74
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
75
|
+
|
|
76
|
+
{{#compare . traceabilityConfig.protocol "https"}}
|
|
77
|
+
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
78
|
+
{{/compare}}
|
|
79
|
+
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
80
|
+
|
|
81
|
+
# Logging configs
|
|
82
|
+
# Define the logging level: info, debug, error
|
|
83
|
+
LOG_LEVEL=info
|
|
84
|
+
# Specify where to send the log: stdout, file, both
|
|
85
|
+
LOG_OUTPUT=stdout
|
|
86
|
+
# Define where the log files are written
|
|
87
|
+
LOG_FILE_PATH=logs
|
|
88
|
+
`;
|
|
89
|
+
};
|
|
90
|
+
exports.wso2TAEnvVarTemplate = wso2TAEnvVarTemplate;
|
|
@@ -57,7 +57,7 @@ const askConfigType = async () => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
//
|
|
60
|
-
// Questions for the configuration of
|
|
60
|
+
// Questions for the configuration of SAP API Portal agents
|
|
61
61
|
//
|
|
62
62
|
exports.askConfigType = askConfigType;
|
|
63
63
|
const askAuthTokenURL = async () => await (0, _basicPrompts.askInput)({
|
|
@@ -91,8 +91,8 @@ const askSpecCreateUnstructuredAPI = async () => (await (0, _basicPrompts.askLis
|
|
|
91
91
|
})) === _types.YesNo.Yes;
|
|
92
92
|
const gatewayConnectivity = async installConfig => {
|
|
93
93
|
const agentValues = new _sapApiPortalTemplates.SAPApiPortalAgentValues();
|
|
94
|
-
console.log('\nCONNECTION TO
|
|
95
|
-
console.log(_chalk.default.gray(`The discovery agent needs to connect to the
|
|
94
|
+
console.log('\nCONNECTION TO SAP API Portal:');
|
|
95
|
+
console.log(_chalk.default.gray(`The discovery agent needs to connect to the SAP API Portal Gateway to discover API's for publishing to Amplify.\nThe traceability agent needs to connect to SAP API Portal for collecting APIs transactions. These will be forwarded to the Business Insights.\n`));
|
|
96
96
|
await askCommonPrompts(agentValues);
|
|
97
97
|
|
|
98
98
|
// SAP API Portal Discovery Agent Prompts
|
|
@@ -152,7 +152,7 @@ async function askCommonPrompts(agentValues) {
|
|
|
152
152
|
agentValues.authAPIPortalClientSecret = await askAuthAPIPortalClientSecret();
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
//
|
|
155
|
+
// SAP API Portal DA prompts
|
|
156
156
|
async function askDiscoveryPrompts(agentValues) {
|
|
157
157
|
agentValues.authDevPortalBaseURL = await askAuthDevPortalBaseURL();
|
|
158
158
|
agentValues.authDevPortalClientID = await askAuthDevPortalClientID();
|
|
@@ -0,0 +1,164 @@
|
|
|
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.WSO2InstallMethods = 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 _wso2Templates = require("./helpers/templates/wso2Templates");
|
|
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: WSO2');
|
|
21
|
+
const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.WSO2_DA}`;
|
|
22
|
+
const taImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.WSO2_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
|
+
WSO2DABinaryFile: 'discovery_agent',
|
|
30
|
+
WSO2DAYaml: 'discovery_agent.yml',
|
|
31
|
+
WSO2TABinaryFile: 'traceability_agent',
|
|
32
|
+
WSO2TAYaml: 'traceability_agent.yml'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// WSO2Prompts - prompts for user inputs
|
|
36
|
+
const WSO2Prompts = {
|
|
37
|
+
configTypeMsg: 'Select the mode of installation',
|
|
38
|
+
enterWSO2BaseURL: 'Enter the WSO2 baseURL',
|
|
39
|
+
enterWSO2ClientID: 'Enter the WSO2 ClientID',
|
|
40
|
+
enterWSO2ClientSecret: 'Enter the WSO2 ClientSecret'
|
|
41
|
+
};
|
|
42
|
+
const askBundleType = async () => {
|
|
43
|
+
return await (0, _basicPrompts.askList)({
|
|
44
|
+
msg: helpers.agentMessages.selectAgentType,
|
|
45
|
+
choices: [_types.BundleType.ALL_AGENTS, _types.BundleType.DISCOVERY, _types.BundleType.TRACEABILITY]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.askBundleType = askBundleType;
|
|
49
|
+
const askConfigType = async () => {
|
|
50
|
+
return _types.AgentConfigTypes.DOCKERIZED;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//
|
|
54
|
+
// Questions for the configuration of WSO2 agents
|
|
55
|
+
//
|
|
56
|
+
exports.askConfigType = askConfigType;
|
|
57
|
+
const askWSO2BaseURL = async () => await (0, _basicPrompts.askInput)({
|
|
58
|
+
msg: WSO2Prompts.enterWSO2BaseURL,
|
|
59
|
+
allowEmptyInput: false,
|
|
60
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.WSO2RegexPatterns.wso2BaseURLRegex, helpers.invalidValueExampleErrMsg('WSO2_BASEURL', 'https://www.wso2domain.com'))
|
|
61
|
+
});
|
|
62
|
+
const askWSO2ClientID = async () => await (0, _basicPrompts.askInput)({
|
|
63
|
+
msg: WSO2Prompts.enterWSO2ClientID
|
|
64
|
+
});
|
|
65
|
+
const askWSO2ClientSecret = async () => await (0, _basicPrompts.askInput)({
|
|
66
|
+
msg: WSO2Prompts.enterWSO2ClientSecret
|
|
67
|
+
});
|
|
68
|
+
const gatewayConnectivity = async installConfig => {
|
|
69
|
+
const agentValues = new _wso2Templates.WSO2AgentValues();
|
|
70
|
+
console.log('\nCONNECTION TO WSO2:');
|
|
71
|
+
console.log(_chalk.default.gray(`The discovery agent needs to connect to the WSO2 API Manager to discover API's for publishing to Amplify.\nThe traceability agent will serve as the trace logging service that will receive WSO2 tracing payloads. These will be forwarded to the Business Insights. There are no specific WSO2 Traceability agent variables.\n`));
|
|
72
|
+
if (installConfig.switches.isDaEnabled) {
|
|
73
|
+
console.log(_chalk.default.gray(`\nDiscovery Agent Configuration\n`));
|
|
74
|
+
await askDiscoveryPrompts(agentValues);
|
|
75
|
+
}
|
|
76
|
+
return agentValues;
|
|
77
|
+
};
|
|
78
|
+
exports.gatewayConnectivity = gatewayConnectivity;
|
|
79
|
+
const generateSuccessHelpMsg = installConfig => {
|
|
80
|
+
if (installConfig.centralConfig.ampcDosaInfo.isNew && !installConfig.switches.isHelmInstall) {
|
|
81
|
+
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.'));
|
|
82
|
+
}
|
|
83
|
+
dockerSuccessMsg(installConfig);
|
|
84
|
+
console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.WSO2}`));
|
|
85
|
+
};
|
|
86
|
+
const dockerSuccessMsg = installConfig => {
|
|
87
|
+
let dockerInfo;
|
|
88
|
+
const runDaLinuxMsg = `docker run --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
89
|
+
const runDaWinMsg = `docker run --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
90
|
+
const runTaLinuxMsg = `docker run --env-file ${helpers.pwd}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
91
|
+
const runTaWinMsg = `docker run --env-file ${helpers.pwdWin}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
92
|
+
const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
|
|
93
|
+
const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
|
|
94
|
+
const startTaLinuxMsg = `\nStart the Traceability Agent on a Linux based machine`;
|
|
95
|
+
const startTaWinMsg = `\nStart the Traceability Agent on a Windows machine`;
|
|
96
|
+
if (installConfig.switches.isDaEnabled && installConfig.switches.isTaEnabled) {
|
|
97
|
+
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}):`;
|
|
98
|
+
} else if (installConfig.switches.isDaEnabled) {
|
|
99
|
+
dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
|
|
100
|
+
} else {
|
|
101
|
+
dockerInfo = `To utilize the traceability agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.TA_ENV_VARS}):`;
|
|
102
|
+
}
|
|
103
|
+
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
104
|
+
if (installConfig.switches.isDaEnabled) {
|
|
105
|
+
const daImageVersion = `${daImage}:${installConfig.daVersion}`;
|
|
106
|
+
console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
|
|
107
|
+
console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
|
|
108
|
+
console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
|
|
109
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
|
|
110
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
|
|
111
|
+
}
|
|
112
|
+
if (installConfig.switches.isTaEnabled) {
|
|
113
|
+
const taImageVersion = `${taImage}:${installConfig.taVersion}`;
|
|
114
|
+
console.log(_chalk.default.white('Pull the latest image of the Traceability Agent:'));
|
|
115
|
+
console.log(_chalk.default.cyan(`docker pull ${taImageVersion}`));
|
|
116
|
+
console.log(_chalk.default.white(_utils.isWindows ? startTaWinMsg : startTaLinuxMsg));
|
|
117
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runTaWinMsg : runTaLinuxMsg));
|
|
118
|
+
console.log('\t', _chalk.default.cyan(`-v /data -p 8888:8888 ${helpers.eolChar}`));
|
|
119
|
+
console.log('\t', _chalk.default.cyan(`${taImageVersion}`), '\n');
|
|
120
|
+
console.log(_chalk.default.white('Configure WSO2 to connect to localhost:8888.'));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
async function askDiscoveryPrompts(agentValues) {
|
|
124
|
+
agentValues.wso2BaseURL = await askWSO2BaseURL();
|
|
125
|
+
agentValues.wso2ClientID = await askWSO2ClientID();
|
|
126
|
+
agentValues.wso2ClientSecret = await askWSO2ClientSecret();
|
|
127
|
+
}
|
|
128
|
+
const completeInstall = async installConfig => {
|
|
129
|
+
/**
|
|
130
|
+
* Create agent resources
|
|
131
|
+
*/
|
|
132
|
+
const agentValues = installConfig.gatewayConfig;
|
|
133
|
+
|
|
134
|
+
// Add final settings to WSO2 agentValues
|
|
135
|
+
agentValues.centralConfig = installConfig.centralConfig;
|
|
136
|
+
agentValues.traceabilityConfig = installConfig.traceabilityConfig;
|
|
137
|
+
console.log('Generating the configuration file(s)...');
|
|
138
|
+
if (installConfig.switches.isDaEnabled) {
|
|
139
|
+
(0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, agentValues, _wso2Templates.wso2DAEnvVarTemplate);
|
|
140
|
+
}
|
|
141
|
+
if (installConfig.switches.isTaEnabled) {
|
|
142
|
+
(0, _utils.writeTemplates)(ConfigFiles.TAEnvVars, agentValues, _wso2Templates.wso2TAEnvVarTemplate);
|
|
143
|
+
}
|
|
144
|
+
console.log('Configuration file(s) have been successfully created.\n');
|
|
145
|
+
generateSuccessHelpMsg(installConfig);
|
|
146
|
+
};
|
|
147
|
+
exports.completeInstall = completeInstall;
|
|
148
|
+
const WSO2InstallMethods = exports.WSO2InstallMethods = {
|
|
149
|
+
GetBundleType: askBundleType,
|
|
150
|
+
GetDeploymentType: askConfigType,
|
|
151
|
+
AskGatewayQuestions: gatewayConnectivity,
|
|
152
|
+
FinalizeGatewayInstall: completeInstall,
|
|
153
|
+
ConfigFiles: Object.values(ConfigFiles),
|
|
154
|
+
AgentNameMap: {
|
|
155
|
+
[_types.AgentTypes.da]: _types.AgentNames.WSO2_DA,
|
|
156
|
+
[_types.AgentTypes.ta]: _types.AgentNames.WSO2_TA
|
|
157
|
+
},
|
|
158
|
+
GatewayDisplay: _types.GatewayTypes.WSO2
|
|
159
|
+
};
|
|
160
|
+
const testables = exports.testables = {
|
|
161
|
+
WSO2Prompts,
|
|
162
|
+
ConfigFiles,
|
|
163
|
+
defaultLogFiles
|
|
164
|
+
};
|
package/dist/common/types.js
CHANGED
|
@@ -242,6 +242,8 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
242
242
|
AgentNames["BACKSTAGE_DA"] = "backstage-discovery-agent";
|
|
243
243
|
AgentNames["SAPAPIPORTAL_DA"] = "sap-discovery-agent";
|
|
244
244
|
AgentNames["SAPAPIPORTAL_TA"] = "sap-traceability-agent";
|
|
245
|
+
AgentNames["WSO2_DA"] = "wso2-discovery-agent";
|
|
246
|
+
AgentNames["WSO2_TA"] = "wso2-traceability-agent";
|
|
245
247
|
return AgentNames;
|
|
246
248
|
}({});
|
|
247
249
|
let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
@@ -260,6 +262,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
|
260
262
|
GatewayTypes["TRACEABLE"] = "Traceable";
|
|
261
263
|
GatewayTypes["BACKSTAGE"] = "Backstage";
|
|
262
264
|
GatewayTypes["SAPAPIPORTAL"] = "SAP API Portal";
|
|
265
|
+
GatewayTypes["WSO2"] = "WSO2";
|
|
263
266
|
return GatewayTypes;
|
|
264
267
|
}({});
|
|
265
268
|
let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGatewayTypes) {
|
|
@@ -286,6 +289,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
|
|
|
286
289
|
DataPlaneNames["MULESOFT"] = "Mulesoft";
|
|
287
290
|
DataPlaneNames["BACKSTAGE"] = "Backstage";
|
|
288
291
|
DataPlaneNames["SAPAPIPORTAL"] = "SAP API Portal";
|
|
292
|
+
DataPlaneNames["WSO2"] = "WSO2";
|
|
289
293
|
DataPlaneNames["OTHER"] = "Unidentified";
|
|
290
294
|
return DataPlaneNames;
|
|
291
295
|
}({});
|
|
@@ -306,7 +310,8 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
306
310
|
[GatewayTypes.IBMAPICONNECT]: DataPlaneNames.IBMAPICONNECT,
|
|
307
311
|
[GatewayTypes.TRACEABLE]: DataPlaneNames.TRACEABLE,
|
|
308
312
|
[GatewayTypes.BACKSTAGE]: DataPlaneNames.BACKSTAGE,
|
|
309
|
-
[GatewayTypes.SAPAPIPORTAL]: DataPlaneNames.SAPAPIPORTAL
|
|
313
|
+
[GatewayTypes.SAPAPIPORTAL]: DataPlaneNames.SAPAPIPORTAL,
|
|
314
|
+
[GatewayTypes.WSO2]: DataPlaneNames.WSO2
|
|
310
315
|
};
|
|
311
316
|
let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
|
|
312
317
|
AgentResourceKind["da"] = "DiscoveryAgent";
|
|
@@ -654,7 +659,7 @@ class IDPConfiguration extends ReqHeadersQParams {
|
|
|
654
659
|
this.clientTimeout = 60;
|
|
655
660
|
}
|
|
656
661
|
getSpec() {
|
|
657
|
-
let spec = new Map([[
|
|
662
|
+
let spec = new Map([['metadataUrl', this.metadataURL], ['providerType', this.type], ['clientTimeout', this.clientTimeout], ['requestHeaders', this.requestHeaders ? (0, _utils.KeyValueMapToNameValueArray)(this.requestHeaders) : undefined], ['queryParameters', this.queryParameters ? (0, _utils.KeyValueMapToNameValueArray)(this.queryParameters) : undefined], ['additionalClientProperties', this.clientProperties ? (0, _utils.KeyValueMapToNameValueArray)(this.clientProperties) : undefined]]);
|
|
658
663
|
let omitUndefinedSpec = new Map();
|
|
659
664
|
spec.forEach((v, k) => {
|
|
660
665
|
if (v !== undefined) {
|
|
@@ -680,7 +685,7 @@ class IDPAuthConfiguration extends ReqHeadersQParams {
|
|
|
680
685
|
this.authConfig.setAccessData(data);
|
|
681
686
|
}
|
|
682
687
|
getSpec() {
|
|
683
|
-
let spec = new Map([[
|
|
688
|
+
let spec = new Map([['type', this.authType], ['config', this.authConfig.getSpec(this.authType)], ['requestHeaders', this.requestHeaders ? (0, _utils.KeyValueMapToNameValueArray)(this.requestHeaders) : undefined], ['queryParameters', this.queryParameters ? (0, _utils.KeyValueMapToNameValueArray)(this.queryParameters) : undefined]]);
|
|
684
689
|
let omitUndefinedSpec = new Map();
|
|
685
690
|
spec.forEach((v, k) => {
|
|
686
691
|
if (v !== undefined) {
|
|
@@ -739,7 +744,7 @@ class IDPAuthClientSecret {
|
|
|
739
744
|
this.clientSecret = data;
|
|
740
745
|
}
|
|
741
746
|
getSpec(authType) {
|
|
742
|
-
let spec = new Map([[
|
|
747
|
+
let spec = new Map([['type', authType], ['authMethod', this.authMethod], ['clientId', this.clientID], ['clientSecret', this.clientSecret], ['clientScopes', this.clientScopes ? this.clientScopes : undefined]]);
|
|
743
748
|
let omitUndefinedSpec = new Map();
|
|
744
749
|
spec.forEach((v, k) => {
|
|
745
750
|
if (v !== undefined) {
|