@axway/axway-central-cli 1.29.0-rc.9 → 2.1.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 CHANGED
@@ -8,7 +8,7 @@ Axway Central CLI package for managing Amplify Central resources and DevOps oper
8
8
 
9
9
  > **Note:**
10
10
  > OS support: Mac OS, Linux, Windows 10.
11
- > Node.js version support: >= 10.13
11
+ > Node.js version support: >=12.13.0
12
12
  > Terminal shell support: Mac Terminal, Linux Terminal, Windows Command Prompt, Windows PowerShell.
13
13
  > Not supported: Cygwin(Windows), Git Bash(Windows).
14
14
 
@@ -22,7 +22,7 @@ Axway Central CLI package for managing Amplify Central resources and DevOps oper
22
22
  >
23
23
  > before following the instructions below to install this 'Axway Central CLI' package.
24
24
 
25
- Assuming you are familiar with [Node.js](https://nodejs.org) and [npm](https://npmjs.com), **ensure you have Node.js >= 10.13.0, and npm >= 6.9.0 installed**. Then, install the [Axway CLI](https://npmjs.com/package/axway), which will give you connectivity to the [Axway Amplify Platform](https://www.axway.com/en/products/amplify). Note that you must first have an account on [https://platform.axway.com](https://platform.axway.com/), and be provisioned in Amplify Central:
25
+ Assuming you are familiar with [Node.js](https://nodejs.org) and [npm](https://npmjs.com), **ensure you have Node.js >= 12.13.0, and npm >= 6.12.0 installed**. Then, install the [Axway CLI](https://npmjs.com/package/axway), which will give you connectivity to the [Axway Amplify Platform](https://www.axway.com/en/products/amplify). Note that you must first have an account on [https://platform.axway.com](https://platform.axway.com/), and be provisioned in Amplify Central:
26
26
 
27
27
  ```bash
28
28
  $ [sudo] npm install -g axway
@@ -19,12 +19,6 @@ var _utils = require("../../common/utils");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
-
26
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
-
28
22
  const {
29
23
  log
30
24
  } = (0, _snooplogg.default)('central: create');
@@ -90,7 +84,7 @@ const action = async ({
90
84
  const apply = {
91
85
  action,
92
86
  desc: 'Update resources from a file',
93
- options: _objectSpread(_objectSpread({}, _types.commonCmdArgsDescription), {}, {
87
+ options: { ..._types.commonCmdArgsDescription,
94
88
  '-o, --output [value]': {
95
89
  desc: `Additional output formats. One of: ${_types.OutputTypes.yaml} | ${_types.OutputTypes.json}`,
96
90
  type: 'string'
@@ -99,6 +93,6 @@ const apply = {
99
93
  desc: `Filename to use to create or update the resources. One of: yaml | json`,
100
94
  type: 'string'
101
95
  }
102
- })
96
+ }
103
97
  };
104
98
  exports.apply = apply;
@@ -7,9 +7,7 @@ exports.completion = void 0;
7
7
 
8
8
  var _cli = require("../../cli");
9
9
 
10
- var _utils = require("../../common/utils");
11
-
12
- const coreCliCmd = (0, _utils.isAmplifyCli)() ? 'amplify' : 'axway';
10
+ const coreCliCmd = 'axway';
13
11
  const completionZsh = `###-begin-amplify-central-completions-###
14
12
  _amplify_central_completions()
15
13
  {
@@ -25,12 +25,6 @@ var _agentResource = require("./agentResource");
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
29
-
30
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
28
  const {
35
29
  log
36
30
  } = (0, _snooplogg.default)('central: create');
@@ -91,7 +85,7 @@ const create = {
91
85
  'agent-resource': _agentResource.agentResource
92
86
  },
93
87
  desc: 'Create one or more resources from a file or stdin',
94
- options: _objectSpread(_objectSpread({}, _types.commonCmdArgsDescription), {}, {
88
+ options: { ..._types.commonCmdArgsDescription,
95
89
  '-o, --output [value]': {
96
90
  desc: `Additional output formats. One of: ${_types.OutputTypes.yaml} | ${_types.OutputTypes.json}`,
97
91
  type: 'string'
@@ -101,6 +95,6 @@ const create = {
101
95
  desc: `Filename to use to create the resource`,
102
96
  type: 'string'
103
97
  }
104
- })
98
+ }
105
99
  };
106
100
  exports.create = create;
@@ -23,12 +23,6 @@ var _utils = require("../../common/utils");
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27
-
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
29
-
30
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
-
32
26
  const {
33
27
  log
34
28
  } = (0, _snooplogg.default)('central: delete');
@@ -166,7 +160,7 @@ const deleteCmd = {
166
160
  required: false,
167
161
  type: 'string'
168
162
  }],
169
- options: _objectSpread(_objectSpread({}, _types.commonCmdArgsDescription), {}, {
163
+ options: { ..._types.commonCmdArgsDescription,
170
164
  '-f, --file [path]': {
171
165
  desc: `Filename to use to delete the resource.`,
172
166
  type: 'string'
@@ -177,6 +171,6 @@ const deleteCmd = {
177
171
  },
178
172
  '-y, --yes': 'Automatically reply "yes" to any command prompts.',
179
173
  '--wait': 'Wait for the resources to be completely deleted.'
180
- })
174
+ }
181
175
  };
182
176
  exports.deleteCmd = deleteCmd;
@@ -11,12 +11,6 @@ var _environment = require("./environment");
11
11
 
12
12
  var _types = require("../../common/types");
13
13
 
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
20
14
  const edit = {
21
15
  action: ({
22
16
  console
@@ -28,11 +22,11 @@ const edit = {
28
22
  environment: _environment.environment
29
23
  },
30
24
  desc: 'Edit and update resources by using the default editor',
31
- options: _objectSpread(_objectSpread({}, _types.commonCmdArgsDescription), {}, {
25
+ options: { ..._types.commonCmdArgsDescription,
32
26
  '-o, --output [value]': {
33
27
  desc: `Additional output formats. One of: ${_types.OutputTypes.yaml}|${_types.OutputTypes.json}`,
34
28
  type: 'string'
35
29
  }
36
- })
30
+ }
37
31
  };
38
32
  exports.edit = edit;
@@ -21,12 +21,6 @@ var _utils = require("../../common/utils");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
25
-
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
27
-
28
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
-
30
24
  const {
31
25
  log
32
26
  } = (0, _snooplogg.default)('central: get');
@@ -170,7 +164,7 @@ ${defsManager.getDefsTableForHelpMsg()}`);
170
164
  required: false,
171
165
  type: 'string'
172
166
  }],
173
- options: _objectSpread(_objectSpread({}, _types.commonCmdArgsDescription), {}, {
167
+ options: { ..._types.commonCmdArgsDescription,
174
168
  '-o, --output [value]': {
175
169
  desc: `Additional output formats. One of: ${_types.OutputTypes.yaml} | ${_types.OutputTypes.json}`,
176
170
  type: 'string'
@@ -195,6 +189,6 @@ ${defsManager.getDefsTableForHelpMsg()}`);
195
189
  desc: `Tag of resource(s) to fetch`,
196
190
  type: 'string'
197
191
  }
198
- })
192
+ }
199
193
  };
200
194
  exports.get = get;
@@ -41,12 +41,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
41
41
 
42
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
43
 
44
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
45
-
46
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
47
-
48
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
49
-
50
44
  const {
51
45
  log
52
46
  } = (0, _snooplogg.default)('central: install: agents');
@@ -64,7 +58,7 @@ const agentInstallFlows = {
64
58
 
65
59
  const createConfigBackup = async (configFiles, gatewayType) => {
66
60
  // If current configurations exist, back them up
67
- let configsExist = await helpers.createBackUpConfigs(configFiles);
61
+ const configsExist = await helpers.createBackUpConfigs(configFiles);
68
62
 
69
63
  if (configsExist) {
70
64
  console.log(`\nCreated configuration backups for ${gatewayType}`);
@@ -150,6 +144,7 @@ const agents = {
150
144
  }
151
145
  },
152
146
  desc: 'Amplify API Gateway / Amazon API Gateway / Azure API Gateway / Istio',
153
- options: _objectSpread({}, _types.commonCmdArgsDescription)
147
+ options: { ..._types.commonCmdArgsDescription
148
+ }
154
149
  };
155
150
  exports.agents = agents;
@@ -161,17 +161,16 @@ const askAWSRegion = async (region = '') => {
161
161
  });
162
162
 
163
163
  if (answer === 'CREATE_NEW') {
164
- const name = await (0, _basicPrompts.askInput)({
164
+ return await (0, _basicPrompts.askInput)({
165
165
  msg: AWSPrompts.REGION_INPUT
166
166
  });
167
- return name;
168
167
  } else {
169
168
  return answer;
170
169
  }
171
170
  };
172
171
 
173
172
  const askDeployment = async () => {
174
- let answer = await (0, _basicPrompts.askList)({
173
+ return (0, _basicPrompts.askList)({
175
174
  msg: AWSPrompts.DEPLOYMENT,
176
175
  choices: [{
177
176
  name: DeploymentTypes.EC2,
@@ -185,7 +184,6 @@ const askDeployment = async () => {
185
184
  }],
186
185
  default: DeploymentTypes.EC2
187
186
  });
188
- return answer;
189
187
  }; // askToCreateRoleSetup - asks a Yes/No question for creating the APIGW IAM role, returns a True/False string for CloudFormation parameters
190
188
 
191
189
 
@@ -340,7 +338,7 @@ async function configureECSDeployment(awsAgentValues) {
340
338
 
341
339
  const gatewayConnectivity = async installConfig => {
342
340
  console.log('\nCONNECTION TO AMAZON API GATEWAY:');
343
- console.log(_chalk.default.gray(`The agents need to connect to the Amazon (AWS) API Gateway to discover API's for publishing to Amplify Central and/or the Unified Catalog.\n` + `Use two credentials, one for executing the AWS CLI commands and one for the agents to connect to the AWS API Gateway.\n` + `The traceability Agent needs to connect to the AWS API Gateway for the collection of transaction headers.\n` + `These will be formatted to the Amplify Central Observer.\n`)); // DeploymentType
341
+ console.log(_chalk.default.gray(`You need credentials for executing the AWS CLI commands.\n` + `The Discovery Agents need to connect to the Amazon (AWS) API Gateway to discover API's for publishing to Amplify Central and/or the Unified Catalog.\n` + `The Traceability Agent needs to connect to the AWS API Gateway for the collection of transaction headers.\n` + `These headers will be formatted and fowarded to the Amplify Central Observer.\n` + `We recommend to use two different set of credentials: one for AWS CLI and one for the agents`)); // DeploymentType
344
342
 
345
343
  const deploymentType = await askDeployment();
346
344
  let awsAgentValues = new helpers.AWSAgentValues(deploymentType);
@@ -543,14 +541,16 @@ const downloadAPIGWAgentConfigZip = async () => {
543
541
  baseUrl: _types.PublicRepoUrl,
544
542
  basePath: _types.BasePaths.AWSAgents
545
543
  });
546
- const response = await service.download(url);
547
544
 
548
- if (!response.ok) {
549
- throw new Error(`Unexpected response while downloading the agent ${response.statusText} `);
545
+ try {
546
+ const {
547
+ stream
548
+ } = await service.download(url);
549
+ await helpers.streamPipeline(stream, _fs.default.createWriteStream(ConfigFiles.AgentConfigZip));
550
+ return ConfigFiles.AgentConfigZip;
551
+ } catch (err) {
552
+ throw new Error(`Failed to download the agent: ${err.message}`);
550
553
  }
551
-
552
- await helpers.streamPipeline(response.body, _fs.default.createWriteStream(ConfigFiles.AgentConfigZip));
553
- return ConfigFiles.AgentConfigZip;
554
554
  }; // Unzip latest aws apigw config zip
555
555
 
556
556
 
@@ -122,7 +122,7 @@ const askAzurePolicyKey = async () => await (0, _basicPrompts.askInput)({
122
122
  });
123
123
 
124
124
  const gatewayConnectivity = async installConfig => {
125
- let azureAgentValues = new _azureTemplates.AzureAgentValues();
125
+ const azureAgentValues = new _azureTemplates.AzureAgentValues();
126
126
  console.log('\nCONNECTION TO AZURE:');
127
127
  console.log(_chalk.default.gray(`The discovery agent needs to connect to the Azure API Gateway to discover API's for publishing to Amplify Central and/or the Unified Catalog.\nThe traceability agent needs to connect to an Azure Event Hub for collecting APIs transactions. These will be forwarded to the Amplify Central Observer.\n`)); // Azure Discovery Agent Prompts
128
128
 
@@ -156,7 +156,7 @@ const generateSuccessHelpMsg = (configType, agentType, isNewDosaAccount) => {
156
156
  }
157
157
 
158
158
  dockerSuccessMsg(isDaEnabled, isTaEnabled);
159
- console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.V7}`));
159
+ console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.AZURE}`));
160
160
  };
161
161
 
162
162
  const dockerSuccessMsg = (isDaEnabled, isTaEnabled) => {
@@ -77,10 +77,16 @@ const downloadV7AgentBundle = async type => {
77
77
  baseUrl: _types.PublicRepoUrl,
78
78
  basePath: _types.BasePaths.V7Agents
79
79
  });
80
- const response = await service.download(url);
81
- if (!response.ok) throw new Error(`Unexpected response while downloading the agent ${response.statusText}`);
82
- await helpers.streamPipeline(response.body, _fs.default.createWriteStream(fileName));
83
- return fileName;
80
+
81
+ try {
82
+ const {
83
+ stream
84
+ } = await service.download(url);
85
+ await helpers.streamPipeline(stream, _fs.default.createWriteStream(fileName));
86
+ return fileName;
87
+ } catch (err) {
88
+ throw new Error(`Failed to download the agent: ${err.message}`);
89
+ }
84
90
  };
85
91
 
86
92
  const downloadBinary = async bundleType => {
@@ -9,8 +9,6 @@ var _chalk = _interopRequireDefault(require("chalk"));
9
9
 
10
10
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
11
11
 
12
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
13
-
14
12
  var _bashCommands = require("../../../common/bashCommands");
15
13
 
16
14
  var _Kubectl = require("../../../common/Kubectl");
@@ -19,10 +17,6 @@ var _types = require("../../../common/types");
19
17
 
20
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
19
 
22
- const {
23
- log
24
- } = (0, _snooplogg.default)('central: install: agents: helpers');
25
-
26
20
  const createBackUpConfigs = async configFiles => {
27
21
  let fileExist = false;
28
22
  let dateTimeStamp = new Date().toISOString().slice(0, 10).concat(' ').concat(new Date().toLocaleTimeString('it-IT')).replace(/:\s*/g, '.');
@@ -127,7 +121,6 @@ const createNewAgentResource = async (client, defsManager, envName, dataPlaneTyp
127
121
  scopeDef: defs[0].scope ? defs[0].scope : undefined,
128
122
  scopeName: envName
129
123
  });
130
- log(result.data);
131
124
 
132
125
  if (!result.data) {
133
126
  var _result$error3;
@@ -3,23 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getAuthUrl = exports.getEnv = exports.getIngestionHost = exports.getEnvironmentId = exports.getCurrentUserOrgId = exports.getListByResource = void 0;
7
-
8
- var _get = _interopRequireDefault(require("lodash/get"));
9
-
10
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
6
+ exports.getIngestionHost = exports.getEnvironmentId = exports.getCurrentUserOrgId = exports.getListByResource = void 0;
11
7
 
12
8
  var _CoreConfigController = require("../../../common/CoreConfigController");
13
9
 
14
10
  var _types = require("../../../common/types");
15
11
 
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- // @ts-ignore
19
- const {
20
- log
21
- } = (0, _snooplogg.default)('central: install: agents: central');
22
-
23
12
  const getListByResource = async (client, defsManager, resourceType, resourceShortName, scopeName = '') => {
24
13
  // NOTE: only a first found set is used
25
14
  const defs = defsManager.findDefsByWord(resourceShortName);
@@ -110,12 +99,4 @@ const getIngestionHost = (region, env, apicDeployment, protocol = _types.Ingesti
110
99
  return hosts[protocol][region][env][apicDeployment] || _types.IngestionHosts.US;
111
100
  };
112
101
 
113
- exports.getIngestionHost = getIngestionHost;
114
-
115
- const getEnv = () => (0, _get.default)(_CoreConfigController.CoreConfigController, 'devOpsAccount.auth.env', _types.Platforms.prod);
116
-
117
- exports.getEnv = getEnv;
118
-
119
- const getAuthUrl = () => (0, _get.default)(_CoreConfigController.CoreConfigController, 'devOpsAccount.auth.baseUrl', _types.AuthUrls.Prod);
120
-
121
- exports.getAuthUrl = getAuthUrl;
102
+ exports.getIngestionHost = getIngestionHost;
@@ -9,8 +9,6 @@ var _chalk = _interopRequireDefault(require("chalk"));
9
9
 
10
10
  var _inquirer = _interopRequireDefault(require("inquirer"));
11
11
 
12
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
13
-
14
12
  var _basicPrompts = require("../../../common/basicPrompts");
15
13
 
16
14
  var _Kubectl = require("../../../common/Kubectl");
@@ -23,10 +21,6 @@ var _regex = require("./regex");
23
21
 
24
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
23
 
26
- // @ts-ignore
27
- const {
28
- log
29
- } = (0, _snooplogg.default)('central: install: agents: helpers');
30
24
  const cliNowString = `cli-${Date.now()}`;
31
25
  const envMessages = {
32
26
  createNewEnvironment: 'Create a new environment',
@@ -72,8 +66,7 @@ const enterServiceAccountName = 'Enter a new service account name';
72
66
  exports.enterServiceAccountName = enterServiceAccountName;
73
67
  const enterPublicKeyPath = 'Enter the file path to the public key';
74
68
  exports.enterPublicKeyPath = enterPublicKeyPath;
75
- const enterPrivateKeyPath = 'Enter the file path to the private key'; // export const enterSecretName = 'Enter the name of the secret to store your public and private keys';
76
-
69
+ const enterPrivateKeyPath = 'Enter the file path to the private key';
77
70
  exports.enterPrivateKeyPath = enterPrivateKeyPath;
78
71
  const selectIngestionProtocol = 'Select Traceability protocol';
79
72
  exports.selectIngestionProtocol = selectIngestionProtocol;
@@ -65,6 +65,9 @@ als:
65
65
  # Name of the k8scluster
66
66
  clusterName: {{istioAgentValues.clusterName}}
67
67
 
68
+ # agent name
69
+ agentName: {{centralConfig.taAgentName}}
70
+
68
71
  # distinguishes events between apic deployments
69
72
  apicDeployment: {{centralConfig.deployment}}
70
73
 
@@ -13,12 +13,6 @@ var _agents = require("./agents");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
-
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
-
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
16
  const install = {
23
17
  action({
24
18
  console
@@ -42,6 +36,7 @@ To install agents in interactive mode:\t"axway central install agents"
42
36
  required: false,
43
37
  type: 'string'
44
38
  }],
45
- options: _objectSpread({}, _types.commonCmdArgsDescription)
39
+ options: { ..._types.commonCmdArgsDescription
40
+ }
46
41
  };
47
42
  exports.install = install;
@@ -110,12 +110,12 @@ https://docs.axway.com/bundle/axway-open-docs/page/docs/central/mesh_management/
110
110
  installConfig.gatewayConfig = istioValues; // Set up the following values from installConfig to be used in setupKubernetes
111
111
 
112
112
  istioValues.istioAgentValues.alsEnabled = installConfig.switches.isTaEnabled;
113
+ istioValues.istioAgentValues.discoveryEnabled = installConfig.switches.isDaEnabled;
113
114
  const hybridOverrides = await setupKubernetes(istioValues, apiServerClient, defsManager);
114
115
  hybridOverrides.envoyFilterNamespace = istioOverrides.gatewayNamespace;
115
116
  istioOverrides.alsNamespace = hybridOverrides.namespace.name;
116
117
  istioOverrides.enableAls = hybridOverrides.alsMode === AlsMode.Verbose;
117
118
  istioOverrides.enableTracing = hybridOverrides.alsEnabled;
118
- await completeIstio(istioOverrides);
119
119
  return istioValues;
120
120
  }; // Questions for the istio configuration
121
121
 
@@ -222,7 +222,7 @@ const completeIstio = async istioOverrides => {
222
222
 
223
223
 
224
224
  const askALSMode = async () => {
225
- let ask = (0, _basicPrompts.askList)({
225
+ return (0, _basicPrompts.askList)({
226
226
  msg: istioPrompts.alsModePrompt,
227
227
  choices: [{
228
228
  name: AlsMode.Default.charAt(0).toUpperCase() + AlsMode.Default.slice(1),
@@ -232,7 +232,6 @@ const askALSMode = async () => {
232
232
  value: AlsMode.Verbose
233
233
  }]
234
234
  });
235
- return ask;
236
235
  };
237
236
 
238
237
  const askEnableDemoSvc = async () => {
@@ -320,16 +319,6 @@ const getCondorHost = (region, env, apicDeployment) => {
320
319
 
321
320
  exports.getCondorHost = getCondorHost;
322
321
 
323
- const generateSuccessHelpMsg = (configType, isNewDosaAccount) => {
324
- const isHelmInstall = configType === _types.AgentConfigTypes.HELM;
325
-
326
- if (isNewDosaAccount && !isHelmInstall) {
327
- 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.'));
328
- }
329
-
330
- console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.ISTIO}`));
331
- };
332
-
333
322
  const createIstioOverride = overrides => {
334
323
  const overrideFileName = ConfigFiles.IstioOverrideFile;
335
324
  (0, _utils.writeTemplates)(overrideFileName, overrides, helpers.istioInstallTemplate);
@@ -400,7 +389,6 @@ exports.generateSpecDiscoverySpec = generateSpecDiscoverySpec;
400
389
 
401
390
  const createHybridOverride = overrides => {
402
391
  const overrideFileName = ConfigFiles.HybridOverrideFile;
403
- console.log(`Shane - keySecretName ${overrides.istioAgentValues.keysSecretName}`);
404
392
  (0, _utils.writeTemplates)(overrideFileName, overrides, helpers.istioAgentsTemplate);
405
393
  console.log(`Istio agent override file has been placed at ${process.cwd()}/${overrideFileName}`);
406
394
  const installCmd = `helm upgrade --install --namespace ${overrides.istioAgentValues.namespace.name} ampc-hybrid axway/ampc-hybrid -f ${overrideFileName}`;
@@ -428,6 +416,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
428
416
 
429
417
  istioValues.centralConfig = installConfig.centralConfig;
430
418
  istioValues.traceabilityConfig = installConfig.traceabilityConfig;
419
+ await completeIstio(istioValues.istioInstallValues);
431
420
 
432
421
  if (istioValues.istioAgentValues.namespace.isNew) {
433
422
  await helpers.createNamespace(istioValues.istioAgentValues.namespace.name);
@@ -450,7 +439,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
450
439
  createIstioOverride(istioValues);
451
440
  createHybridOverride(istioValues);
452
441
  console.log('Configuration file(s) have been successfully created.\n');
453
- generateSuccessHelpMsg(installConfig.deploymentType, installConfig.centralConfig.ampcDosaInfo.isNew);
442
+ console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.ISTIO}`));
454
443
  };
455
444
 
456
445
  exports.completeInstall = completeInstall;
@@ -7,12 +7,12 @@ exports.getApicDeployment = exports.finalizeCentralInstall = exports.getCentralC
7
7
 
8
8
  var _chalk = _interopRequireDefault(require("chalk"));
9
9
 
10
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
11
-
12
10
  var _basicPrompts = require("../../common/basicPrompts");
13
11
 
14
12
  var _CliConfigManager = require("../../common/CliConfigManager");
15
13
 
14
+ var _CoreConfigController = require("../../common/CoreConfigController");
15
+
16
16
  var _types = require("../../common/types");
17
17
 
18
18
  var _utils = require("../../common/utils");
@@ -25,13 +25,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- // @ts-ignore
29
- const {
30
- log
31
- } = (0, _snooplogg.default)('central: install: agents: central'); //
28
+ //
32
29
  // Complex prompts
33
30
  //
34
-
35
31
  const askTeamName = async client => {
36
32
  var _res$data$result$find;
37
33
 
@@ -49,20 +45,23 @@ const getTraceabilityConfig = async installConfig => {
49
45
  traceabilityConfig.usageReportingOffline = installConfig.bundleType === _types.BundleType.TRACEABILITY_OFFLINE; // Do not ask Traceability questions in offline mode
50
46
 
51
47
  if (!traceabilityConfig.usageReportingOffline) {
52
- console.log('\nCONNECTION TO TRACEABILITY MODULE:');
53
- const {
54
- enabled,
55
- samplingPercentage,
56
- shouldReportAllErrors
57
- } = await helpers.askToEnableTransactionLogging();
58
- traceabilityConfig.enabled = enabled;
59
- traceabilityConfig.samplingPercentage = samplingPercentage;
60
- traceabilityConfig.samplingReportAllErrors = shouldReportAllErrors;
48
+ console.log('\nCONNECTION TO TRACEABILITY MODULE:'); // Will remove this logic check once sampling is added to ISTIO. For now, suppress askToEnableTransactionLogging
49
+
50
+ if (installConfig.gatewayType !== _types.GatewayTypes.ISTIO) {
51
+ const {
52
+ enabled,
53
+ samplingPercentage,
54
+ shouldReportAllErrors
55
+ } = await helpers.askToEnableTransactionLogging();
56
+ traceabilityConfig.enabled = enabled;
57
+ traceabilityConfig.samplingPercentage = samplingPercentage;
58
+ traceabilityConfig.samplingReportAllErrors = shouldReportAllErrors;
59
+ }
61
60
 
62
61
  if (traceabilityConfig.enabled) {
63
62
  const traceabilityProtocol = await helpers.askIngestionProtocol();
64
63
  traceabilityConfig.protocol = traceabilityProtocol;
65
- traceabilityConfig.host = helpers.getIngestionHost(installConfig.centralConfig.region, helpers.getEnv(), installConfig.centralConfig.deployment, traceabilityProtocol);
64
+ traceabilityConfig.host = helpers.getIngestionHost(installConfig.centralConfig.region, _CoreConfigController.CoreConfigController.getEnv(), installConfig.centralConfig.deployment, traceabilityProtocol);
66
65
  }
67
66
  }
68
67
 
@@ -75,12 +74,9 @@ const getCentralConfig = async (apiCentralClient, apiServerClient, platformClien
75
74
  // initiate CentralAgentConfig
76
75
  let centralConfig = new _types.CentralAgentConfig();
77
76
  await centralConfig.setBaseHost();
78
- centralConfig.authUrl = `${helpers.getAuthUrl()}/auth`;
77
+ centralConfig.authUrl = `${_CoreConfigController.CoreConfigController.getAuthUrl()}/auth`;
79
78
  centralConfig.region = String(apiCentralClient.region || (await (0, _utils.getConfig)())[_types.ConfigTypes.REGION] || _types.Regions.US).toUpperCase();
80
- centralConfig.url = _types.ProdBaseUrls[centralConfig.region];
81
- log(apicDeployment);
82
- log(getApicDeployment(centralConfig.region, helpers.getEnv()));
83
- centralConfig.deployment = apicDeployment || getApicDeployment(centralConfig.region, helpers.getEnv()); // apic config
79
+ centralConfig.deployment = apicDeployment || getApicDeployment(centralConfig.region, _CoreConfigController.CoreConfigController.getEnv()); // apic config
84
80
 
85
81
  console.log('\nCONNECTION TO AMPLIFY PLATFORM:');
86
82
  console.log(_chalk.default.gray(`The agents need access to the Amplify Platform to register services.`)); // create/find environment
@@ -99,9 +95,9 @@ const getCentralConfig = async (apiCentralClient, apiServerClient, platformClien
99
95
  } // Get the DA Agent name
100
96
 
101
97
 
102
- centralConfig.daAgentName = '';
98
+ centralConfig.daAgentName = ''; // ISTIO will not prompt for agent name. Remove when that ability exists
103
99
 
104
- if (installConfig.switches.isDaEnabled) {
100
+ if (installConfig.switches.isDaEnabled && installConfig.gatewayType !== _types.GatewayTypes.ISTIO) {
105
101
  centralConfig.daAgentName = await helpers.askAgentName(apiServerClient, defsManager, _types.AgentTypes.da, centralConfig.ampcEnvInfo.name);
106
102
  } // Get the TA Agent name
107
103
 
@@ -131,10 +127,12 @@ const finalizeCentralInstall = async (apiCentralClient, apiServerClient, platfor
131
127
 
132
128
  installConfig.centralConfig.dosaAccount.updateKeyTemplateValues(installConfig.deploymentType); // environment name
133
129
 
134
- installConfig.centralConfig.environment = installConfig.centralConfig.ampcEnvInfo.isNew ? await helpers.createByResourceType(apiServerClient, defsManager, installConfig.centralConfig.ampcEnvInfo.name, 'Environment', 'env') : installConfig.centralConfig.ampcEnvInfo.name; // Create DiscoveryAgent Resource
130
+ installConfig.centralConfig.environment = installConfig.centralConfig.ampcEnvInfo.isNew ? await helpers.createByResourceType(apiServerClient, defsManager, installConfig.centralConfig.ampcEnvInfo.name, 'Environment', 'env') : installConfig.centralConfig.ampcEnvInfo.name; // Create DiscoveryAgent Resource unless gateway type is ISTIO. This can be removed when this is available for ISTIO
135
131
 
136
- if (installConfig.centralConfig.daAgentName != '') {
137
- installConfig.centralConfig.daAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.da, _types.AgentTypes.da, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.daAgentName);
132
+ if (installConfig.gatewayType !== _types.GatewayTypes.ISTIO) {
133
+ if (installConfig.centralConfig.daAgentName != '') {
134
+ installConfig.centralConfig.daAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.da, _types.AgentTypes.da, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.daAgentName);
135
+ }
138
136
  } // Create TraceabilityAgent Resource
139
137
 
140
138