@axway/axway-central-cli 3.2.0-rc.3 → 3.3.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/azureSaasAgents.js +1 -0
- package/dist/commands/install/helpers/index.js +13 -0
- package/dist/commands/install/helpers/inputs.js +1 -48
- package/dist/commands/install/helpers/regex.js +2 -1
- package/dist/commands/install/helpers/templates/awsTemplates.js +0 -1
- package/dist/commands/install/helpers/templates/azureTemplates.js +0 -1
- package/dist/commands/install/helpers/templates/edgeTemplates.js +0 -2
- package/dist/commands/install/helpers/templates/ibmAPIConnectTemplates.js +0 -1
- package/dist/commands/install/helpers/templates/istioTemplates.js +0 -1
- package/dist/commands/install/helpers/templates/softwareAGWebMethodsTemplates.js +93 -0
- package/dist/commands/install/platform.js +1 -8
- package/dist/commands/install/softwareAGWebMethodsAgents.js +162 -0
- package/dist/common/types.js +6 -5
- package/package.json +1 -1
|
@@ -29,6 +29,7 @@ var kafkaAgents = _interopRequireWildcard(require("./kafkaAgents"));
|
|
|
29
29
|
var swaggerHubAgents = _interopRequireWildcard(require("./swaggerHubSaasAgents"));
|
|
30
30
|
var graylogAgent = _interopRequireWildcard(require("./graylogAgent"));
|
|
31
31
|
var ibmAPIConnectAgent = _interopRequireWildcard(require("./ibmAPIConnectAgents"));
|
|
32
|
+
var softwareAGWebMethodsAgent = _interopRequireWildcard(require("./softwareAGWebMethodsAgents"));
|
|
32
33
|
var traceableAgent = _interopRequireWildcard(require("./traceableAgents"));
|
|
33
34
|
var platform = _interopRequireWildcard(require("./platform"));
|
|
34
35
|
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); }
|
|
@@ -52,6 +53,7 @@ const agentInstallFlows = {
|
|
|
52
53
|
[_types.GatewayTypes.KAFKA]: kafkaAgents.KafkaInstallMethods,
|
|
53
54
|
[_types.GatewayTypes.GRAYLOG]: graylogAgent.GraylogInstallMethods,
|
|
54
55
|
[_types.GatewayTypes.IBMAPICONNECT]: ibmAPIConnectAgent.IBMAPIConnectInstallMethods,
|
|
56
|
+
[_types.GatewayTypes.SOFTWAREAGWEBMETHODS]: softwareAGWebMethodsAgent.SoftwareAGWebMethodsInstallMethods,
|
|
55
57
|
[_types.GatewayTypes.TRACEABLE]: traceableAgent.TraceableInstallMethods
|
|
56
58
|
};
|
|
57
59
|
const saasAgentInstallFlows = {
|
|
@@ -214,7 +216,7 @@ const agents = exports.agents = {
|
|
|
214
216
|
process.exit(0);
|
|
215
217
|
}
|
|
216
218
|
},
|
|
217
|
-
desc: 'Amplify API Gateway / Amazon API Gateway / Azure API Gateway / Istio / Apigee X Gateway / GitHub / GitLab / Kafka / SwaggerHub',
|
|
219
|
+
desc: 'Amplify API Gateway / Amazon API Gateway / Azure API Gateway / Istio / Apigee X Gateway / GitHub / GitLab / Kafka / SwaggerHub/ Software AG WebMethods',
|
|
218
220
|
options: {
|
|
219
221
|
..._types.commonCmdArgsDescription
|
|
220
222
|
}
|
|
@@ -336,6 +336,7 @@ const gatewayConnectivity = async installConfig => {
|
|
|
336
336
|
});
|
|
337
337
|
hostedAgentValues.eventHubConsumerGroup = await (0, _basicPrompts.askInput)({
|
|
338
338
|
msg: SaasPrompts.EVENT_HUB_CONSUMER_GROUP,
|
|
339
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.AzureRegexPatterns.azureEventHubConsumerGroupRegex, helpers.invalidValueExampleErrMsg('Event Hub Consumer Group', 'azure-event-hub-c-group')),
|
|
339
340
|
defaultValue: '$Default'
|
|
340
341
|
});
|
|
341
342
|
}
|
|
@@ -176,6 +176,18 @@ Object.keys(_ibmAPIConnectTemplates).forEach(function (key) {
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
|
+
var _softwareAGWebMethodsTemplates = require("./templates/softwareAGWebMethodsTemplates");
|
|
180
|
+
Object.keys(_softwareAGWebMethodsTemplates).forEach(function (key) {
|
|
181
|
+
if (key === "default" || key === "__esModule") return;
|
|
182
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
183
|
+
if (key in exports && exports[key] === _softwareAGWebMethodsTemplates[key]) return;
|
|
184
|
+
Object.defineProperty(exports, key, {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return _softwareAGWebMethodsTemplates[key];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
179
191
|
var _traceableTemplates = require("./templates/traceableTemplates");
|
|
180
192
|
Object.keys(_traceableTemplates).forEach(function (key) {
|
|
181
193
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -220,6 +232,7 @@ const agentsDocsUrl = exports.agentsDocsUrl = {
|
|
|
220
232
|
ISTIO: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html',
|
|
221
233
|
GRAYLOG: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html',
|
|
222
234
|
IBMAPICONNECT: '',
|
|
235
|
+
SOFTWAREAGWEBMETHODS: '',
|
|
223
236
|
TRACEABLE: ''
|
|
224
237
|
};
|
|
225
238
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.serviceAccountNameAlreadyExists = exports.selectServiceAccount = exports.selectIngestionProtocol = exports.selectAWSRegion = exports.secretAlreadyExists = exports.namespaceAlreadyExists = exports.k8sClusterMessages = exports.idpTestables = exports.idpMessages = exports.envMessages = exports.enterServiceAccountName = exports.enterPublicKeyPath = exports.enterPrivateKeyPath = exports.enterNamespaceName = exports.enterAWSRegion = exports.createNamespace = exports.createGatewayAgentCredsSecret = exports.createAmplifyAgentKeysSecret = exports.askServiceAccountName = exports.askReferencedEnvironments = exports.askPublicKeyPath = exports.askPublicAndPrivateKeysPath = exports.askPrivateKeyPath = exports.askNamespace = exports.askKeyValuePairLoop = exports.askK8sClusterName = exports.askIngestionProtocol = exports.askForSecretName = exports.askForIDPConfiguration = exports.askForIDPAuthConfiguration = exports.askEnvironmentName = exports.askDosaClientId = exports.askBundleType = exports.askArrayLoop = exports.askAgentName = exports.askAWSRegion = exports.agentMessages = exports.addIdentityProvider = void 0;
|
|
7
7
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
8
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
9
9
|
var _inquirer = _interopRequireDefault(require("inquirer"));
|
|
@@ -60,14 +60,6 @@ const idpMessages = exports.idpMessages = {
|
|
|
60
60
|
provideReqHeadersForTokenFetch: "Enter the request headers used for the token fetch call as key-value pairs. Stops when empty input is provided",
|
|
61
61
|
provideQueryParamsForTokenFetch: "Enter the query parameters used for the token fetch call as key-value pairs. Stops when empty input is provided"
|
|
62
62
|
};
|
|
63
|
-
const transactionLoggingMessages = exports.transactionLoggingMessages = {
|
|
64
|
-
askToEnableLogging: 'Would you like to enable transaction logging?',
|
|
65
|
-
transactionLoggingInfoMsg: 'Transaction logging is optional and not required for usage and metrics logging.\nTurning on transaction logging can have an impact on performance.',
|
|
66
|
-
enterSamplingPercentage: 'What sampling rate would you like to use? (1-10)',
|
|
67
|
-
samplingPercentageInfoMsg: 'A sampling rate of 1 will log 1% of transactions, a sampling rate of 10 will log 10% of all transactions.\nWe recommend a sampling rate of 1% which can be increased if needed.',
|
|
68
|
-
askReportAllErrors: 'Would you like to report all errors?',
|
|
69
|
-
reportAllErrorsMsg: 'The agents can take out the error transactions from the sampling rate.'
|
|
70
|
-
};
|
|
71
63
|
const namespaceAlreadyExists = exports.namespaceAlreadyExists = 'Namespace already exists. Please enter a new name.';
|
|
72
64
|
const secretAlreadyExists = exports.secretAlreadyExists = 'Secret already exists. Please enter a new name.';
|
|
73
65
|
const enterNamespaceName = exports.enterNamespaceName = 'Enter a new namespace name';
|
|
@@ -432,46 +424,7 @@ const askPublicAndPrivateKeysPath = async () => {
|
|
|
432
424
|
const privateKey = await askPrivateKeyPath();
|
|
433
425
|
return [publicKey, privateKey];
|
|
434
426
|
};
|
|
435
|
-
|
|
436
|
-
// askToEnableTransactionLogging - asks Yes/No question to enable transaction logging, if Yes, configure values for environment variables.
|
|
437
427
|
exports.askPublicAndPrivateKeysPath = askPublicAndPrivateKeysPath;
|
|
438
|
-
const askToEnableTransactionLogging = async () => {
|
|
439
|
-
console.log(_chalk.default.gray(transactionLoggingMessages.transactionLoggingInfoMsg));
|
|
440
|
-
const enable = await (0, _basicPrompts.askList)({
|
|
441
|
-
msg: transactionLoggingMessages.askToEnableLogging,
|
|
442
|
-
choices: _types.YesNoChoices,
|
|
443
|
-
default: _types.YesNo.No
|
|
444
|
-
});
|
|
445
|
-
if (enable === _types.YesNo.Yes) {
|
|
446
|
-
console.log(_chalk.default.gray(transactionLoggingMessages.samplingPercentageInfoMsg));
|
|
447
|
-
const samplingPercentage = await (0, _basicPrompts.askInput)({
|
|
448
|
-
msg: transactionLoggingMessages.enterSamplingPercentage,
|
|
449
|
-
defaultValue: 1,
|
|
450
|
-
validate: (0, _basicPrompts.runValidations)((0, _basicPrompts.validateRegex)(_regex.percentageRegex, _regex.invalidPercentage))
|
|
451
|
-
});
|
|
452
|
-
let shouldReportAllErrors = _types.YesNo.Yes;
|
|
453
|
-
if (samplingPercentage < 10) {
|
|
454
|
-
console.log(_chalk.default.gray(transactionLoggingMessages.reportAllErrorsMsg));
|
|
455
|
-
shouldReportAllErrors = await (0, _basicPrompts.askList)({
|
|
456
|
-
msg: transactionLoggingMessages.askReportAllErrors,
|
|
457
|
-
choices: _types.YesNoChoices,
|
|
458
|
-
default: _types.YesNo.Yes
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
return {
|
|
462
|
-
enabled: true,
|
|
463
|
-
samplingPercentage: samplingPercentage,
|
|
464
|
-
shouldReportAllErrors: shouldReportAllErrors === _types.YesNo.Yes ? true : false
|
|
465
|
-
};
|
|
466
|
-
} else {
|
|
467
|
-
return {
|
|
468
|
-
enabled: false,
|
|
469
|
-
samplingPercentage: 0,
|
|
470
|
-
shouldReportAllErrors: false
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
exports.askToEnableTransactionLogging = askToEnableTransactionLogging;
|
|
475
428
|
const askKeyValuePairLoop = async (msg, keyLabel, validateFunc) => {
|
|
476
429
|
let key = "non-empty";
|
|
477
430
|
let map = new Map();
|
|
@@ -43,7 +43,8 @@ const APIGEEXRegexPatterns = exports.APIGEEXRegexPatterns = {
|
|
|
43
43
|
|
|
44
44
|
// AzureRegexPatterns - regex patters to validate user inputs
|
|
45
45
|
const AzureRegexPatterns = exports.AzureRegexPatterns = {
|
|
46
|
-
azureApiManagementServiceNameRegex: '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'
|
|
46
|
+
azureApiManagementServiceNameRegex: '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$',
|
|
47
|
+
azureEventHubConsumerGroupRegex: '^[a-zA-Z0-9$][a-zA-Z0-9._\-]{0,48}[a-zA-Z0-9]$'
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
// GitHubRegexPatterns - regex patters to validate user inputs
|
|
@@ -81,7 +81,6 @@ CENTRAL_REGION={{centralConfig.region}}
|
|
|
81
81
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
82
82
|
{{/compare}}
|
|
83
83
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
84
|
-
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
85
84
|
{{/if}}
|
|
86
85
|
|
|
87
86
|
# Logging configs
|
|
@@ -76,7 +76,6 @@ CENTRAL_REGION={{centralConfig.region}}
|
|
|
76
76
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
77
77
|
{{/compare}}
|
|
78
78
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
79
|
-
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
80
79
|
{{/if}}
|
|
81
80
|
|
|
82
81
|
# Logging configs
|
|
@@ -117,7 +117,6 @@ CENTRAL_REGION={{centralConfig.region}}
|
|
|
117
117
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
118
118
|
{{/compare}}
|
|
119
119
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
120
|
-
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
121
120
|
{{/if}}
|
|
122
121
|
|
|
123
122
|
# Logging configs
|
|
@@ -172,7 +171,6 @@ env:
|
|
|
172
171
|
{{/if}}
|
|
173
172
|
TRACEABILITY_PROTOCOL: {{traceabilityConfig.protocol}}
|
|
174
173
|
TRACEABILITY_SAMPLING_PERCENTAGE: {{traceabilityConfig.samplingPercentage}}
|
|
175
|
-
TRACEABILITY_SAMPLING_REPORTALLERRORS: {{traceabilityConfig.samplingReportAllErrors}}
|
|
176
174
|
|
|
177
175
|
{{#if isGatewayOnly}}
|
|
178
176
|
APIGATEWAY_ONLY: {{isGatewayOnly}}
|
|
@@ -106,7 +106,6 @@ CENTRAL_REGION={{centralConfig.region}}
|
|
|
106
106
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
107
107
|
{{/compare}}
|
|
108
108
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
109
|
-
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
110
109
|
{{/if}}
|
|
111
110
|
|
|
112
111
|
# Logging configs
|
|
@@ -71,7 +71,6 @@ const istioAgentsTemplate = () => {
|
|
|
71
71
|
sampling:
|
|
72
72
|
percentage: {{traceabilityConfig.samplingPercentage}}
|
|
73
73
|
per_api: true
|
|
74
|
-
reportAllErrors: {{traceabilityConfig.samplingReportAllErrors}}
|
|
75
74
|
# Name of the secret containing the public & private keys used by the provided service account client ID
|
|
76
75
|
keysSecretName: {{istioAgentValues.keysSecretName}}
|
|
77
76
|
publishHeaders: true
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.softwareAGWebMethodsTAEnvVarTemplate = exports.softwareAGWebMethodsDAEnvVarTemplate = exports.SoftwareAGWebMethodsAgentValues = 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 Values to provide to the Software AG WebMethods handlebars templates.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
class SoftwareAGWebMethodsAgentValues {
|
|
16
|
+
constructor() {
|
|
17
|
+
_defineProperty(this, "pathURL", void 0);
|
|
18
|
+
_defineProperty(this, "pathUsername", void 0);
|
|
19
|
+
_defineProperty(this, "pathPassword", void 0);
|
|
20
|
+
_defineProperty(this, "pathOauth2Server", void 0);
|
|
21
|
+
_defineProperty(this, "centralConfig", void 0);
|
|
22
|
+
_defineProperty(this, "traceabilityConfig", void 0);
|
|
23
|
+
this.pathURL = '';
|
|
24
|
+
this.pathUsername = '';
|
|
25
|
+
this.pathPassword = '';
|
|
26
|
+
this.pathOauth2Server = 'local';
|
|
27
|
+
this.centralConfig = new _types.CentralAgentConfig();
|
|
28
|
+
this.traceabilityConfig = new _types.TraceabilityConfig();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @description Generates the Software AG WebMethods TA env vars file.
|
|
34
|
+
*/
|
|
35
|
+
exports.SoftwareAGWebMethodsAgentValues = SoftwareAGWebMethodsAgentValues;
|
|
36
|
+
const softwareAGWebMethodsTAEnvVarTemplate = () => {
|
|
37
|
+
return `# Software AG WebMethods configs
|
|
38
|
+
WEBMETHODS_URL={{pathURL}}
|
|
39
|
+
WEBMETHODS_AUTH_USERNAME={{pathUsername}}
|
|
40
|
+
WEBMETHODS_AUTH_PASSWORD={{pathPassword}}
|
|
41
|
+
WEBMETHODS_OAUTH2SERVER={{pathOauth2Server}}
|
|
42
|
+
|
|
43
|
+
# Amplify Central configs
|
|
44
|
+
CENTRAL_AGENTNAME={{centralConfig.taAgentName}}
|
|
45
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
46
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
47
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
48
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
49
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
50
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
51
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
52
|
+
|
|
53
|
+
# Logging configs
|
|
54
|
+
# Define the logging level: info, debug, error
|
|
55
|
+
LOG_LEVEL=info
|
|
56
|
+
# Specify where to send the log: stdout, file, both
|
|
57
|
+
LOG_OUTPUT=stdout
|
|
58
|
+
# Define where the log files are written
|
|
59
|
+
LOG_FILE_PATH=logs
|
|
60
|
+
`;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @description Generates the Software AG WebMethods DA env vars file.
|
|
65
|
+
*/
|
|
66
|
+
exports.softwareAGWebMethodsTAEnvVarTemplate = softwareAGWebMethodsTAEnvVarTemplate;
|
|
67
|
+
const softwareAGWebMethodsDAEnvVarTemplate = () => {
|
|
68
|
+
return `# Software AG WebMethods configs
|
|
69
|
+
WEBMETHODS_URL={{pathURL}}
|
|
70
|
+
WEBMETHODS_AUTH_USERNAME={{pathUsername}}
|
|
71
|
+
WEBMETHODS_AUTH_PASSWORD={{pathPassword}}
|
|
72
|
+
WEBMETHODS_OAUTH2SERVER={{pathOauth2Server}}
|
|
73
|
+
|
|
74
|
+
# Amplify Central configs
|
|
75
|
+
CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
|
|
76
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
77
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
78
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
79
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
80
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
81
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
82
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
83
|
+
|
|
84
|
+
# Logging configs
|
|
85
|
+
# Define the logging level: info, debug, error
|
|
86
|
+
LOG_LEVEL=info
|
|
87
|
+
# Specify where to send the log: stdout, file, both
|
|
88
|
+
LOG_OUTPUT=stdout
|
|
89
|
+
# Define where the log files are written
|
|
90
|
+
LOG_FILE_PATH=logs
|
|
91
|
+
`;
|
|
92
|
+
};
|
|
93
|
+
exports.softwareAGWebMethodsDAEnvVarTemplate = softwareAGWebMethodsDAEnvVarTemplate;
|
|
@@ -47,14 +47,7 @@ const getTraceabilityConfig = async installConfig => {
|
|
|
47
47
|
if (!traceabilityConfig.usageReportingOffline) {
|
|
48
48
|
console.log('\nCONNECTION TO TRACEABILITY MODULE:');
|
|
49
49
|
if (installConfig.gatewayType !== _types.GatewayTypes.KAFKA && installConfig.gatewayType !== _types.GatewayTypes.GRAYLOG && installConfig.gatewayType !== _types.GatewayTypes.TRACEABLE) {
|
|
50
|
-
|
|
51
|
-
enabled,
|
|
52
|
-
samplingPercentage,
|
|
53
|
-
shouldReportAllErrors
|
|
54
|
-
} = await helpers.askToEnableTransactionLogging();
|
|
55
|
-
traceabilityConfig.enabled = enabled;
|
|
56
|
-
traceabilityConfig.samplingPercentage = samplingPercentage;
|
|
57
|
-
traceabilityConfig.samplingReportAllErrors = shouldReportAllErrors;
|
|
50
|
+
traceabilityConfig.samplingPercentage = 0;
|
|
58
51
|
}
|
|
59
52
|
const traceabilityProtocol = await helpers.askIngestionProtocol();
|
|
60
53
|
traceabilityConfig.protocol = traceabilityProtocol;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.testables = exports.gatewayConnectivity = exports.completeInstall = exports.askConfigType = exports.askBundleType = exports.SoftwareAGWebMethodsInstallMethods = 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 _softwareAGWebMethodsTemplates = require("./helpers/templates/softwareAGWebMethodsTemplates");
|
|
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: Software AG Web Methods');
|
|
21
|
+
const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.SOFTWAREAGWEBMETHODS_DA}`;
|
|
22
|
+
const taImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.SOFTWAREAGWEBMETHODS_TA}`;
|
|
23
|
+
|
|
24
|
+
// ConfigFiles - all the config file that are used in the setup
|
|
25
|
+
const ConfigFiles = exports.ConfigFiles = {
|
|
26
|
+
DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`,
|
|
27
|
+
TAEnvVars: `${helpers.configFiles.TA_ENV_VARS}`
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// WebMethods - prompts for user inputs
|
|
31
|
+
const prompts = {
|
|
32
|
+
pathURL: 'Enter the base URL to connect to your Software AG WebMethods API service',
|
|
33
|
+
pathUsername: 'Enter the username to authenticate to Software AG WebMethods',
|
|
34
|
+
pathPassword: 'Enter the password to authenticate to Software AG WebMethods',
|
|
35
|
+
pathOauth2Server: 'Enter the OAuth2 server to authenticate. Defaults to local gateway auth'
|
|
36
|
+
};
|
|
37
|
+
const askBundleType = async () => {
|
|
38
|
+
return await (0, _basicPrompts.askList)({
|
|
39
|
+
msg: helpers.agentMessages.selectAgentType,
|
|
40
|
+
choices: [_types.BundleType.ALL_AGENTS, _types.BundleType.DISCOVERY, _types.BundleType.TRACEABILITY]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.askBundleType = askBundleType;
|
|
44
|
+
const askConfigType = async () => {
|
|
45
|
+
return _types.AgentConfigTypes.DOCKERIZED;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//
|
|
49
|
+
// Questions for the configuration of Software AG WebMethods agents
|
|
50
|
+
//
|
|
51
|
+
exports.askConfigType = askConfigType;
|
|
52
|
+
async function askCommonPrompts(webMethodsAgentValues) {
|
|
53
|
+
// Software AG WebMethods Path URL
|
|
54
|
+
webMethodsAgentValues.pathURL = await askPathURL();
|
|
55
|
+
// Software AG WebMethods Path Username
|
|
56
|
+
webMethodsAgentValues.pathUsername = await askPathUsername();
|
|
57
|
+
// Software AG WebMethods Path Password
|
|
58
|
+
webMethodsAgentValues.pathPassword = await askPathPassword();
|
|
59
|
+
// Software AG WebMethods Path Oauth2Server
|
|
60
|
+
webMethodsAgentValues.pathOauth2Server = await askPathOauth2Server();
|
|
61
|
+
if (webMethodsAgentValues.pathOauth2Server.trim() === '') {
|
|
62
|
+
webMethodsAgentValues.pathOauth2Server = 'local';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const askPathURL = async () => await (0, _basicPrompts.askInput)({
|
|
66
|
+
msg: prompts.pathURL
|
|
67
|
+
});
|
|
68
|
+
const askPathUsername = async () => await (0, _basicPrompts.askInput)({
|
|
69
|
+
msg: prompts.pathUsername
|
|
70
|
+
});
|
|
71
|
+
const askPathPassword = async () => await (0, _basicPrompts.askInput)({
|
|
72
|
+
msg: prompts.pathPassword
|
|
73
|
+
});
|
|
74
|
+
const askPathOauth2Server = async () => await (0, _basicPrompts.askInput)({
|
|
75
|
+
msg: prompts.pathOauth2Server,
|
|
76
|
+
allowEmptyInput: true,
|
|
77
|
+
defaultValue: "local"
|
|
78
|
+
});
|
|
79
|
+
const gatewayConnectivity = async installConfig => {
|
|
80
|
+
const webMethodsAgentValues = new _softwareAGWebMethodsTemplates.SoftwareAGWebMethodsAgentValues();
|
|
81
|
+
console.log('\nCONNECTION TO Software AG WebMethods:');
|
|
82
|
+
console.log(_chalk.default.gray(`The discovery agent needs to connect to the Software AG WebMethods Gateway to discover API's for publishing to Amplify.\nThe traceability agent needs to connect to Software AG WebMethods for collecting APIs transactions. These will be forwarded to the Business Insights.\n`));
|
|
83
|
+
if (installConfig.switches.isDaEnabled || installConfig.switches.isTaEnabled) {
|
|
84
|
+
await askCommonPrompts(webMethodsAgentValues);
|
|
85
|
+
}
|
|
86
|
+
return webMethodsAgentValues;
|
|
87
|
+
};
|
|
88
|
+
exports.gatewayConnectivity = gatewayConnectivity;
|
|
89
|
+
const generateSuccessHelpMsg = installConfig => {
|
|
90
|
+
if (installConfig.centralConfig.ampcDosaInfo.isNew && !installConfig.switches.isHelmInstall) {
|
|
91
|
+
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.'));
|
|
92
|
+
}
|
|
93
|
+
dockerSuccessMsg(installConfig);
|
|
94
|
+
console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.SOFTWAREAGWEBMETHODS}`));
|
|
95
|
+
};
|
|
96
|
+
const dockerSuccessMsg = installConfig => {
|
|
97
|
+
let dockerInfo;
|
|
98
|
+
const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
99
|
+
const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
100
|
+
const runTaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
101
|
+
const runTaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
102
|
+
const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
|
|
103
|
+
const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
|
|
104
|
+
const startTaLinuxMsg = `\nStart the Traceability Agent on a Linux based machine`;
|
|
105
|
+
const startTaWinMsg = `\nStart the Traceability Agent on a Windows machine`;
|
|
106
|
+
if (installConfig.switches.isDaEnabled && installConfig.switches.isTaEnabled) {
|
|
107
|
+
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}):`;
|
|
108
|
+
} else if (installConfig.switches.isDaEnabled) {
|
|
109
|
+
dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
|
|
110
|
+
} else {
|
|
111
|
+
dockerInfo = `To utilize the traceability agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.TA_ENV_VARS}):`;
|
|
112
|
+
}
|
|
113
|
+
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
114
|
+
if (installConfig.switches.isDaEnabled) {
|
|
115
|
+
const daImageVersion = `${daImage}:${installConfig.daVersion}`;
|
|
116
|
+
console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
|
|
117
|
+
console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
|
|
118
|
+
console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
|
|
119
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
|
|
120
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
|
|
121
|
+
}
|
|
122
|
+
if (installConfig.switches.isTaEnabled) {
|
|
123
|
+
const taImageVersion = `${taImage}:${installConfig.taVersion}`;
|
|
124
|
+
console.log(_chalk.default.white('Pull the latest image of the Traceability Agent:'));
|
|
125
|
+
console.log(_chalk.default.cyan(`docker pull ${taImageVersion}`));
|
|
126
|
+
console.log(_chalk.default.white(_utils.isWindows ? startTaWinMsg : startTaLinuxMsg));
|
|
127
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runTaWinMsg : runTaLinuxMsg));
|
|
128
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${taImageVersion}`), '\n');
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const completeInstall = async installConfig => {
|
|
132
|
+
// Add final settings to softwareAGWebMethodsAgentValues
|
|
133
|
+
const softwareAGWebMethodsAgentValues = installConfig.gatewayConfig;
|
|
134
|
+
softwareAGWebMethodsAgentValues.centralConfig = installConfig.centralConfig;
|
|
135
|
+
softwareAGWebMethodsAgentValues.traceabilityConfig = installConfig.traceabilityConfig;
|
|
136
|
+
console.log('Generating the configuration file(s)...');
|
|
137
|
+
if (installConfig.switches.isDaEnabled) {
|
|
138
|
+
(0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, softwareAGWebMethodsAgentValues, helpers.softwareAGWebMethodsDAEnvVarTemplate);
|
|
139
|
+
}
|
|
140
|
+
if (installConfig.switches.isTaEnabled) {
|
|
141
|
+
(0, _utils.writeTemplates)(ConfigFiles.TAEnvVars, softwareAGWebMethodsAgentValues, helpers.softwareAGWebMethodsTAEnvVarTemplate);
|
|
142
|
+
}
|
|
143
|
+
console.log('Configuration file(s) have been successfully created.\n');
|
|
144
|
+
generateSuccessHelpMsg(installConfig);
|
|
145
|
+
};
|
|
146
|
+
exports.completeInstall = completeInstall;
|
|
147
|
+
const SoftwareAGWebMethodsInstallMethods = exports.SoftwareAGWebMethodsInstallMethods = {
|
|
148
|
+
GetBundleType: askBundleType,
|
|
149
|
+
GetDeploymentType: askConfigType,
|
|
150
|
+
AskGatewayQuestions: gatewayConnectivity,
|
|
151
|
+
FinalizeGatewayInstall: completeInstall,
|
|
152
|
+
ConfigFiles: Object.values(ConfigFiles),
|
|
153
|
+
AgentNameMap: {
|
|
154
|
+
[_types.AgentTypes.da]: _types.AgentNames.SOFTWAREAGWEBMETHODS_DA,
|
|
155
|
+
[_types.AgentTypes.ta]: _types.AgentNames.SOFTWAREAGWEBMETHODS_TA
|
|
156
|
+
},
|
|
157
|
+
GatewayDisplay: _types.GatewayTypes.SOFTWAREAGWEBMETHODS
|
|
158
|
+
};
|
|
159
|
+
const testables = exports.testables = {
|
|
160
|
+
prompts,
|
|
161
|
+
ConfigFiles
|
|
162
|
+
};
|
package/dist/common/types.js
CHANGED
|
@@ -236,6 +236,8 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
236
236
|
AgentNames["IBMAPICONNECT_DA"] = "ibm-apiconnect-discovery-agent";
|
|
237
237
|
AgentNames["IBMAPICONNECT_TA"] = "ibm-apiconnect-traceability-agent";
|
|
238
238
|
AgentNames["TRACEABLE_TA"] = "traceable-agent";
|
|
239
|
+
AgentNames["SOFTWAREAGWEBMETHODS_DA"] = "software-ag-web-methods-discovery-agent";
|
|
240
|
+
AgentNames["SOFTWAREAGWEBMETHODS_TA"] = "software-ag-web-methods-traceability-agent";
|
|
239
241
|
return AgentNames;
|
|
240
242
|
}({});
|
|
241
243
|
let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
@@ -248,6 +250,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
|
248
250
|
GatewayTypes["KAFKA"] = "Kafka";
|
|
249
251
|
GatewayTypes["GRAYLOG"] = "Graylog";
|
|
250
252
|
GatewayTypes["IBMAPICONNECT"] = "IBM API Connect";
|
|
253
|
+
GatewayTypes["SOFTWAREAGWEBMETHODS"] = "Software AG WebMethods";
|
|
251
254
|
GatewayTypes["TRACEABLE"] = "Traceable";
|
|
252
255
|
return GatewayTypes;
|
|
253
256
|
}({});
|
|
@@ -269,6 +272,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
|
|
|
269
272
|
DataPlaneNames["GRAYLOG"] = "Graylog";
|
|
270
273
|
DataPlaneNames["IBMAPICONNECT"] = "APIConnect";
|
|
271
274
|
DataPlaneNames["KONG"] = "Kong";
|
|
275
|
+
DataPlaneNames["SOFTWAREAGWEBMETHODS"] = "Software AG WebMethods";
|
|
272
276
|
DataPlaneNames["SWAGGERHUB"] = "SwaggerHub";
|
|
273
277
|
DataPlaneNames["TRACEABLE"] = "Traceable";
|
|
274
278
|
DataPlaneNames["MULESOFT"] = "Mulesoft";
|
|
@@ -286,6 +290,7 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
286
290
|
[GatewayTypes.ISTIO]: 'Istio',
|
|
287
291
|
[SaaSGatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE,
|
|
288
292
|
[GatewayTypes.KAFKA]: DataPlaneNames.KAFKA,
|
|
293
|
+
[GatewayTypes.SOFTWAREAGWEBMETHODS]: DataPlaneNames.SOFTWAREAGWEBMETHODS,
|
|
289
294
|
[SaaSGatewayTypes.SWAGGERHUB]: DataPlaneNames.SWAGGERHUB,
|
|
290
295
|
[GatewayTypes.GRAYLOG]: DataPlaneNames.GRAYLOG,
|
|
291
296
|
[GatewayTypes.IBMAPICONNECT]: DataPlaneNames.IBMAPICONNECT,
|
|
@@ -473,15 +478,11 @@ class TraceabilityConfig {
|
|
|
473
478
|
constructor() {
|
|
474
479
|
_defineProperty(this, "host", void 0);
|
|
475
480
|
_defineProperty(this, "protocol", void 0);
|
|
476
|
-
_defineProperty(this, "enabled", void 0);
|
|
477
481
|
_defineProperty(this, "samplingPercentage", void 0);
|
|
478
|
-
_defineProperty(this, "samplingReportAllErrors", void 0);
|
|
479
482
|
_defineProperty(this, "usageReportingOffline", void 0);
|
|
480
483
|
this.host = IngestionHosts.US;
|
|
481
484
|
this.protocol = IngestionProtocol.Lumberjack;
|
|
482
|
-
this.samplingPercentage =
|
|
483
|
-
this.enabled = true;
|
|
484
|
-
this.samplingReportAllErrors = true;
|
|
485
|
+
this.samplingPercentage = 0;
|
|
485
486
|
this.usageReportingOffline = false;
|
|
486
487
|
}
|
|
487
488
|
}
|