@axway/axway-central-cli 4.5.0 → 4.6.0-rc.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.
Files changed (83) hide show
  1. package/.security-profile-branches.json +18 -0
  2. package/package.json +1 -1
  3. package/dist/cli.js +0 -71
  4. package/dist/commands/apply/index.js +0 -112
  5. package/dist/commands/completion/index.js +0 -100
  6. package/dist/commands/config/common/index.js +0 -28
  7. package/dist/commands/config/index.js +0 -20
  8. package/dist/commands/config/list.js +0 -24
  9. package/dist/commands/config/set.js +0 -102
  10. package/dist/commands/config/unset.js +0 -48
  11. package/dist/commands/create/agentResource.js +0 -108
  12. package/dist/commands/create/environment.js +0 -62
  13. package/dist/commands/create/index.js +0 -109
  14. package/dist/commands/create/serviceAccount.js +0 -15
  15. package/dist/commands/delete/index.js +0 -196
  16. package/dist/commands/edit/environment.js +0 -101
  17. package/dist/commands/edit/index.js +0 -28
  18. package/dist/commands/get/index.js +0 -272
  19. package/dist/commands/install/agents.js +0 -290
  20. package/dist/commands/install/apigeexAgents.js +0 -223
  21. package/dist/commands/install/apigeexSaasAgents.js +0 -300
  22. package/dist/commands/install/awsAgents.js +0 -525
  23. package/dist/commands/install/awsSaasAgents.js +0 -508
  24. package/dist/commands/install/azureAgents.js +0 -242
  25. package/dist/commands/install/azureSaasAgents.js +0 -519
  26. package/dist/commands/install/backstageAgents.js +0 -167
  27. package/dist/commands/install/edgeAgents.js +0 -409
  28. package/dist/commands/install/gitHubSaasAgents.js +0 -294
  29. package/dist/commands/install/gitLabAgents.js +0 -178
  30. package/dist/commands/install/graylogAgent.js +0 -147
  31. package/dist/commands/install/helpers/creators.js +0 -359
  32. package/dist/commands/install/helpers/deleters.js +0 -36
  33. package/dist/commands/install/helpers/getters.js +0 -95
  34. package/dist/commands/install/helpers/index.js +0 -267
  35. package/dist/commands/install/helpers/inputs.js +0 -593
  36. package/dist/commands/install/helpers/regex.js +0 -67
  37. package/dist/commands/install/helpers/templates/apigeexTemplates.js +0 -109
  38. package/dist/commands/install/helpers/templates/awsTemplates.js +0 -129
  39. package/dist/commands/install/helpers/templates/azureTemplates.js +0 -125
  40. package/dist/commands/install/helpers/templates/backstageTemplates.js +0 -95
  41. package/dist/commands/install/helpers/templates/edgeTemplates.js +0 -360
  42. package/dist/commands/install/helpers/templates/gitLabTemplates.js +0 -66
  43. package/dist/commands/install/helpers/templates/graylogTemplates.js +0 -75
  44. package/dist/commands/install/helpers/templates/ibmAPIConnectTemplates.js +0 -116
  45. package/dist/commands/install/helpers/templates/istioTemplates.js +0 -214
  46. package/dist/commands/install/helpers/templates/kafkaTemplates.js +0 -194
  47. package/dist/commands/install/helpers/templates/sapApiPortalTemplates.js +0 -114
  48. package/dist/commands/install/helpers/templates/softwareAGWebMethodsTemplates.js +0 -93
  49. package/dist/commands/install/helpers/templates/traceableTemplates.js +0 -135
  50. package/dist/commands/install/helpers/templates/wso2Templates.js +0 -85
  51. package/dist/commands/install/helpers/util.js +0 -26
  52. package/dist/commands/install/ibmAPIConnectAgents.js +0 -213
  53. package/dist/commands/install/index.js +0 -36
  54. package/dist/commands/install/istioAgents.js +0 -346
  55. package/dist/commands/install/kafkaAgents.js +0 -303
  56. package/dist/commands/install/platform.js +0 -175
  57. package/dist/commands/install/sapApiPortalAgents.js +0 -198
  58. package/dist/commands/install/softwareAGWebMethodsAgents.js +0 -161
  59. package/dist/commands/install/swaggerHubSaasAgents.js +0 -272
  60. package/dist/commands/install/traceableAgents.js +0 -257
  61. package/dist/commands/install/traceableSaasAgents.js +0 -275
  62. package/dist/commands/install/wso2Agents.js +0 -163
  63. package/dist/commands/productize/helpers/productizationHelper.js +0 -408
  64. package/dist/commands/productize/index.js +0 -99
  65. package/dist/common/ApiServerClient.js +0 -1109
  66. package/dist/common/CacheController.js +0 -146
  67. package/dist/common/CliConfigManager.js +0 -76
  68. package/dist/common/CompositeError.js +0 -95
  69. package/dist/common/CoreConfigController.js +0 -174
  70. package/dist/common/DefinitionsManager.js +0 -298
  71. package/dist/common/Kubectl.js +0 -68
  72. package/dist/common/PlatformClient.js +0 -128
  73. package/dist/common/Renderer.js +0 -409
  74. package/dist/common/TmpFile.js +0 -96
  75. package/dist/common/bashCommands.js +0 -97
  76. package/dist/common/basicPrompts.js +0 -160
  77. package/dist/common/dataService.js +0 -312
  78. package/dist/common/errorHandler.js +0 -46
  79. package/dist/common/modules.d.js +0 -1
  80. package/dist/common/resultsRenderers.js +0 -164
  81. package/dist/common/types.js +0 -746
  82. package/dist/common/utils.js +0 -476
  83. package/dist/main.js +0 -8
@@ -1,135 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.traceableHelmOverrideTemplate = exports.traceableEnvVarTemplate = exports.TraceableAgentValues = exports.ComplianceAgentValues = void 0;
7
- var _types = require("../../../../common/types");
8
- var _handlebars = _interopRequireDefault(require("handlebars"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- 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; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
- 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); }
13
- class ComplianceAgentValues {
14
- constructor() {
15
- _defineProperty(this, "centralEnvironments", void 0);
16
- this.centralEnvironments = [];
17
- }
18
- }
19
-
20
- /**
21
- * @description Parameters to provide to the Traceable handlebars templates.
22
- */
23
- exports.ComplianceAgentValues = ComplianceAgentValues;
24
- class TraceableAgentValues extends ComplianceAgentValues {
25
- constructor() {
26
- super();
27
- _defineProperty(this, "namespace", void 0);
28
- _defineProperty(this, "traceableToken", void 0);
29
- _defineProperty(this, "traceableRegion", void 0);
30
- _defineProperty(this, "environments", void 0);
31
- _defineProperty(this, "centralConfig", void 0);
32
- _defineProperty(this, "traceabilityConfig", void 0);
33
- _defineProperty(this, "traceableSecret", void 0);
34
- _defineProperty(this, "agentKeysSecret", void 0);
35
- this.namespace = {
36
- name: '',
37
- isNew: false
38
- };
39
- this.traceableToken = '';
40
- this.traceableRegion = _types.TraceableRegionType.US;
41
- this.environments = [];
42
- this.centralConfig = new _types.CentralAgentConfig();
43
- this.traceabilityConfig = new _types.TraceabilityConfig();
44
- this.traceableSecret = '';
45
- this.agentKeysSecret = '';
46
- }
47
- }
48
- exports.TraceableAgentValues = TraceableAgentValues;
49
- _handlebars.default.registerHelper('formatIndex', index => {
50
- return index + 1;
51
- });
52
-
53
- /**
54
- * @description Generates the helm override file for the Amplify Traceable Agent.
55
- */
56
- const traceableHelmOverrideTemplate = () => {
57
- return `---
58
- # Traceable Agent image overrides
59
- # image:
60
- # fullPath:
61
- # registry: docker.repository.axway.com
62
- # repository: ampc-beano-docker-prod/1.1
63
- # name: graylog-agent
64
- # tag:
65
- # pullPolicy: IfNotPresent
66
- # pullSecret:
67
-
68
- secrets:
69
- traceable:
70
- name: {{traceableSecret}}
71
- agent:
72
- name: {{agentKeysSecret}}
73
-
74
- traceable:
75
- token: {{traceableToken}}
76
- {{#compare . environments.length 0 operator="!=" }}
77
- {{#environments}}
78
- traceable_environmentmapping_traceable_{{formatIndex @index}}={{.}}
79
- {{/environments}}
80
- {{/compare}}
81
- {{#compare . centralEnvironments.length 0 operator="!=" }}
82
- {{#centralEnvironments}}
83
- traceable_environmentmapping_amplify_{{formatIndex @index}}={{.}}
84
- {{/centralEnvironments}}
85
- {{/compare}}
86
- region: {{traceableRegion}}
87
-
88
- env:
89
- CENTRAL_REGION: {{centralConfig.region}}
90
- CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
91
- CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
92
- CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
93
- CENTRAL_AGENTNAME: {{centralConfig.caAgentName}}
94
- CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
95
- `;
96
- };
97
-
98
- /**
99
- * @description Generates the Amplify Traceable Agent env vars file.
100
- */
101
- exports.traceableHelmOverrideTemplate = traceableHelmOverrideTemplate;
102
- const traceableEnvVarTemplate = () => {
103
- return `# Traceable configs
104
- TRACEABLE_TOKEN={{traceableToken}}
105
- TRACEABLE_REGION={{traceableRegion}}
106
- {{#compare . environments.length 0 operator="!=" }}
107
- {{#environments}}
108
- TRACEABLE_ENVIRONMENTMAPPING_TRACEABLE_{{formatIndex @index}}={{.}}
109
- {{/environments}}
110
- {{/compare}}
111
- {{#compare . centralEnvironments.length 0 operator="!=" }}
112
- {{#centralEnvironments}}
113
- TRACEABLE_ENVIRONMENTMAPPING_AMPLIFY_{{formatIndex @index}}={{.}}
114
- {{/centralEnvironments}}
115
- {{/compare}}
116
-
117
- # Amplify Central configs
118
- CENTRAL_AGENTNAME={{centralConfig.caAgentName}}
119
- CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
120
- CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
121
- CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
122
- CENTRAL_ENVIRONMENT={{centralConfig.environment}}
123
- CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
124
- CENTRAL_TEAM={{centralConfig.ampcTeamName}}
125
- CENTRAL_REGION={{centralConfig.region}}
126
- # Logging configs
127
- # Define the logging level: info, debug, error
128
- LOG_LEVEL=info
129
- # Specify where to send the log: stdout, file, both
130
- LOG_OUTPUT=stdout
131
- # Define where the log files are written
132
- LOG_FILE_PATH=logs
133
- `;
134
- };
135
- exports.traceableEnvVarTemplate = traceableEnvVarTemplate;
@@ -1,85 +0,0 @@
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
- # Logging configs
77
- # Define the logging level: info, debug, error
78
- LOG_LEVEL=info
79
- # Specify where to send the log: stdout, file, both
80
- LOG_OUTPUT=stdout
81
- # Define where the log files are written
82
- LOG_FILE_PATH=logs
83
- `;
84
- };
85
- exports.wso2TAEnvVarTemplate = wso2TAEnvVarTemplate;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.helmInstallInfo = exports.helmImageSecretInfo = void 0;
7
- var _chalk = _interopRequireDefault(require("chalk"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const helmImageSecretInfo = async namespace => {
10
- let dockerSecretCmd = `kubectl create secret docker-registry <image-pull-secret-name> --namespace ${namespace} \\`;
11
- dockerSecretCmd += `\n --docker-server=docker.repository.axway.com \\`;
12
- dockerSecretCmd += `\n --docker-username=<client_id> \\`;
13
- dockerSecretCmd += `\n --docker-password=<client_secret>`;
14
- console.log('\nTo setup docker image secret for the pulling the agent docker images, run the following command:', _chalk.default.cyan(`\n${dockerSecretCmd}`), _chalk.default.cyan(`\n`), _chalk.default.white(`\n* client_id - service account id for your Amplify Platform organization`), _chalk.default.white(`\n* client_secret - service account secret for your Amplify Platform organization`), _chalk.default.white(`\n* image-pull-secret - Kubernetes secret name with docker config to pull images`));
15
- };
16
- exports.helmImageSecretInfo = helmImageSecretInfo;
17
- const helmInstallInfo = async (agentType, namespace, agentInfo) => {
18
- let helmInstallCmd = "";
19
- agentInfo.forEach(function (entry) {
20
- helmInstallCmd += `helm upgrade --install --namespace ${namespace} ${entry.helmReleaseName} ${entry.helmChartName} \\`;
21
- helmInstallCmd += `\n -f ${entry.overrideFileName} \\`;
22
- helmInstallCmd += `\n ${entry.imageSecretOverrides}\n`;
23
- });
24
- console.log(`\nTo complete the ${agentType} Agent installation run the following commands:`, _chalk.default.cyan('\nhelm repo add axway https://helm.repository.axway.com --username=<client_id> --password=<client_secret>'), _chalk.default.cyan(`\nhelm repo update\n${helmInstallCmd}`), _chalk.default.white(`\n* client_id - service account id for your Amplify Platform organization`), _chalk.default.white(`\n* client_secret - service account secret for your Amplify Platform organization`), _chalk.default.white(`\n* image-pull-secret - Kubernetes secret name with docker config to pull images`));
25
- };
26
- exports.helmInstallInfo = helmInstallInfo;
@@ -1,213 +0,0 @@
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.IBMAPIConnectInstallMethods = 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 _ibmAPIConnectTemplates = require("./helpers/templates/ibmAPIConnectTemplates");
14
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- // @ts-ignore
17
- const {
18
- log
19
- } = (0, _snooplogg.default)('engage: install: agents: ibmAPIConnect');
20
- const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.IBMAPICONNECT_DA}`;
21
- const taImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.IBMAPICONNECT_TA}`;
22
- const defaultLogFiles = exports.defaultLogFiles = '/group-*_instance-*.log';
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
- IBMAPIConnectDABinaryFile: 'discovery_agent',
29
- IBMAPIConnectDAYaml: 'discovery_agent.yml',
30
- IBMAPIConnectTABinaryFile: 'traceability_agent',
31
- IBMAPIConnectTAYaml: 'traceability_agent.yml'
32
- };
33
-
34
- // IBMAPIConnectPrompts - prompts for user inputs
35
- const IBMAPIConnectPrompts = {
36
- configTypeMsg: 'Select the mode of installation',
37
- enterApiConnectURL: 'Enter the IBM API Connect URL',
38
- enterApiConnectOrgName: 'Enter the IBM API Connect Organization Name',
39
- enterApiConnectCatalogName: 'Enter the IBM API Connect Catalog Name',
40
- enterApiConnectAuthAPIKey: 'Enter the IBM API Connect Auth API Key',
41
- enterApiConnectAuthClientID: 'Enter the IBM API Connect Client ID',
42
- enterApiConnectAuthClientSecret: 'Enter the IBM API Connect Client Secret',
43
- enterApiConnectConsumerOrgOwnerUser: 'Enter the IBM API Connect Consumer Organization Owner User',
44
- enterApiConnectConsumerOrgOwnerRegistry: 'Enter the IBM API Connect Consumer Organization Owner User Registry',
45
- enterApiConnectAnalyticsServerName: 'Enter the IBM API Connect Analytics Server Name'
46
- };
47
- const askBundleType = async () => {
48
- return await (0, _basicPrompts.askList)({
49
- msg: helpers.agentMessages.selectAgentType,
50
- choices: [_types.BundleType.ALL_AGENTS, _types.BundleType.DISCOVERY, _types.BundleType.TRACEABILITY]
51
- });
52
- };
53
- exports.askBundleType = askBundleType;
54
- const askConfigType = async () => {
55
- return _types.AgentConfigTypes.DOCKERIZED;
56
- };
57
-
58
- //
59
- // Questions for the configuration of IBM API Connect agents
60
- //
61
- exports.askConfigType = askConfigType;
62
- const askIBMAPIConnectURL = async () => await (0, _basicPrompts.askInput)({
63
- msg: IBMAPIConnectPrompts.enterApiConnectURL
64
- });
65
- const askIBMAPIConnectOrgName = async () => await (0, _basicPrompts.askInput)({
66
- msg: IBMAPIConnectPrompts.enterApiConnectOrgName
67
- });
68
- const askIBMAPIConnectCatalogName = async () => await (0, _basicPrompts.askInput)({
69
- msg: IBMAPIConnectPrompts.enterApiConnectCatalogName
70
- });
71
- const askIBMAPIConnectAuthAPIKey = async () => await (0, _basicPrompts.askInput)({
72
- msg: IBMAPIConnectPrompts.enterApiConnectAuthAPIKey
73
- });
74
- const askIBMAPIConnectClientID = async () => await (0, _basicPrompts.askInput)({
75
- msg: IBMAPIConnectPrompts.enterApiConnectAuthClientID
76
- });
77
- const askIBMAPIConnectClientSecret = async () => await (0, _basicPrompts.askInput)({
78
- msg: IBMAPIConnectPrompts.enterApiConnectAuthClientSecret
79
- });
80
- const askIBMAPIConnectOrgOwnerUser = async () => await (0, _basicPrompts.askInput)({
81
- msg: IBMAPIConnectPrompts.enterApiConnectConsumerOrgOwnerUser
82
- });
83
- const askIBMAPIConnectOrgOwnerRegistry = async () => await (0, _basicPrompts.askInput)({
84
- msg: IBMAPIConnectPrompts.enterApiConnectConsumerOrgOwnerRegistry
85
- });
86
- const askIBMAPIConnectAnalyticsServerName = async () => await (0, _basicPrompts.askInput)({
87
- msg: IBMAPIConnectPrompts.enterApiConnectAnalyticsServerName
88
- });
89
- const gatewayConnectivity = async installConfig => {
90
- const ibmAPIConnectAgentValues = new _ibmAPIConnectTemplates.IBMAPIConnectAgentValues();
91
- console.log('\nCONNECTION TO IBM API Connect:');
92
- 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`));
93
- await askCommonPrompts(ibmAPIConnectAgentValues);
94
-
95
- // IBM API Connect Discovery Agent Prompts
96
- if (installConfig.switches.isDaEnabled) {
97
- console.log(_chalk.default.gray(`\nDiscovery Agent Configuration\n`));
98
- await askDiscoveryPrompts(ibmAPIConnectAgentValues);
99
- }
100
-
101
- // IBM API Connect Traceability Agent Prompts
102
- if (installConfig.switches.isTaEnabled) {
103
- console.log(_chalk.default.gray(`\nTraceability Agent Configuration\n`));
104
- await askTraceabilityPrompts(ibmAPIConnectAgentValues);
105
- }
106
- return ibmAPIConnectAgentValues;
107
- };
108
- exports.gatewayConnectivity = gatewayConnectivity;
109
- const generateSuccessHelpMsg = installConfig => {
110
- if (installConfig.centralConfig.ampcDosaInfo.isNew && !installConfig.switches.isHelmInstall) {
111
- 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.'));
112
- }
113
- dockerSuccessMsg(installConfig);
114
- console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.IBMAPICONNECT}`));
115
- };
116
- const dockerSuccessMsg = installConfig => {
117
- let dockerInfo;
118
- const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
119
- const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
120
- const runTaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
121
- const runTaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
122
- const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
123
- const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
124
- const startTaLinuxMsg = `\nStart the Traceability Agent on a Linux based machine`;
125
- const startTaWinMsg = `\nStart the Traceability Agent on a Windows machine`;
126
- if (installConfig.switches.isDaEnabled && installConfig.switches.isTaEnabled) {
127
- 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}):`;
128
- } else if (installConfig.switches.isDaEnabled) {
129
- dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
130
- } else {
131
- dockerInfo = `To utilize the traceability agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.TA_ENV_VARS}):`;
132
- }
133
- console.log(_chalk.default.whiteBright(dockerInfo), '\n');
134
- if (installConfig.switches.isDaEnabled) {
135
- const daImageVersion = `${daImage}:${installConfig.daVersion}`;
136
- console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
137
- console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
138
- console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
139
- console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
140
- console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
141
- }
142
- if (installConfig.switches.isTaEnabled) {
143
- const taImageVersion = `${taImage}:${installConfig.taVersion}`;
144
- console.log(_chalk.default.white('Pull the latest image of the Traceability Agent:'));
145
- console.log(_chalk.default.cyan(`docker pull ${taImageVersion}`));
146
- console.log(_chalk.default.white(_utils.isWindows ? startTaWinMsg : startTaLinuxMsg));
147
- console.log(_chalk.default.cyan(_utils.isWindows ? runTaWinMsg : runTaLinuxMsg));
148
- console.log('\t', _chalk.default.cyan(`-v /data ${taImageVersion}`), '\n');
149
- }
150
- };
151
- async function askCommonPrompts(ibmAPIConnectAgentValues) {
152
- // IBM API Connect URL
153
- ibmAPIConnectAgentValues.apiConnectURL = await askIBMAPIConnectURL();
154
- // IBM API Connect Org Name
155
- ibmAPIConnectAgentValues.apiConnectOrgName = await askIBMAPIConnectOrgName();
156
- // IBM API Connect Catalog Name
157
- ibmAPIConnectAgentValues.apiConnectCatalogName = await askIBMAPIConnectCatalogName();
158
- // IBM API Connect Auth API Key
159
- ibmAPIConnectAgentValues.apiConnectAuthAPIKey = await askIBMAPIConnectAuthAPIKey();
160
- // IBM API Connect Auth Client ID
161
- ibmAPIConnectAgentValues.apiConnectAuthClientID = await askIBMAPIConnectClientID();
162
- // IBM API Connect Auth Client Secret
163
- ibmAPIConnectAgentValues.apiConnectAuthClientSecret = await askIBMAPIConnectClientSecret();
164
- }
165
-
166
- // IBM API Connect DA prompts
167
- async function askDiscoveryPrompts(ibmAPIConnectAgentValues) {
168
- // IBM API Connect Consumer Org Owner User
169
- ibmAPIConnectAgentValues.apiConnectConsumerOrgOwnerUser = await askIBMAPIConnectOrgOwnerUser();
170
- // IBM API Connect Consumer Org Owner Registry
171
- ibmAPIConnectAgentValues.apiConnectConsumerOrgOwnerRegistry = await askIBMAPIConnectOrgOwnerRegistry();
172
- }
173
- async function askTraceabilityPrompts(ibmAPIConnectAgentValues) {
174
- // IBM API Connect Analytics Server Name
175
- ibmAPIConnectAgentValues.apiConnectAnalyticsServerName = await askIBMAPIConnectAnalyticsServerName();
176
- }
177
- const completeInstall = async installConfig => {
178
- /**
179
- * Create agent resources
180
- */
181
- const ibmAPIConnectAgentValues = installConfig.gatewayConfig;
182
-
183
- // Add final settings to ibmAPIConnectAgentValues
184
- ibmAPIConnectAgentValues.centralConfig = installConfig.centralConfig;
185
- ibmAPIConnectAgentValues.traceabilityConfig = installConfig.traceabilityConfig;
186
- console.log('Generating the configuration file(s)...');
187
- if (installConfig.switches.isDaEnabled) {
188
- (0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, ibmAPIConnectAgentValues, helpers.ibmAPIConnectDAEnvVarTemplate);
189
- }
190
- if (installConfig.switches.isTaEnabled) {
191
- (0, _utils.writeTemplates)(ConfigFiles.TAEnvVars, ibmAPIConnectAgentValues, helpers.ibmAPIConnectTAEnvVarTemplate);
192
- }
193
- console.log('Configuration file(s) have been successfully created.\n');
194
- generateSuccessHelpMsg(installConfig);
195
- };
196
- exports.completeInstall = completeInstall;
197
- const IBMAPIConnectInstallMethods = exports.IBMAPIConnectInstallMethods = {
198
- GetBundleType: askBundleType,
199
- GetDeploymentType: askConfigType,
200
- AskGatewayQuestions: gatewayConnectivity,
201
- FinalizeGatewayInstall: completeInstall,
202
- ConfigFiles: Object.values(ConfigFiles),
203
- AgentNameMap: {
204
- [_types.AgentTypes.da]: _types.AgentNames.IBMAPICONNECT_DA,
205
- [_types.AgentTypes.ta]: _types.AgentNames.IBMAPICONNECT_TA
206
- },
207
- GatewayDisplay: _types.GatewayTypes.IBMAPICONNECT
208
- };
209
- const testables = exports.testables = {
210
- IBMAPIConnectPrompts,
211
- ConfigFiles,
212
- defaultLogFiles
213
- };
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.install = void 0;
7
- var _Renderer = _interopRequireDefault(require("../../common/Renderer"));
8
- var _types = require("../../common/types");
9
- var _agents = require("./agents");
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const install = exports.install = {
12
- action({
13
- console
14
- }) {
15
- const renderer = new _Renderer.default(console);
16
- renderer.error('Error: You must specify the type of the resource to install.');
17
- console.log(`\nUSAGE:
18
- To install agents in interactive mode:\t"axway engage install agents"
19
- `);
20
- process.exit(1);
21
- },
22
- commands: {
23
- agents: _agents.agents
24
- },
25
- desc: 'Install additional platform resources',
26
- args: [{
27
- name: 'args',
28
- desc: 'Command arguments, run "axway engage install" to see the examples',
29
- multiple: true,
30
- required: false,
31
- type: 'string'
32
- }],
33
- options: {
34
- ..._types.commonCmdArgsDescription
35
- }
36
- };