@axway/axway-central-cli 3.15.0-rc.2 → 3.15.0-rc.3

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.
@@ -3,23 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.traceableHelmOverrideTemplate = exports.traceableEnvVarTemplate = exports.TraceableAgentValues = void 0;
6
+ exports.traceableHelmOverrideTemplate = exports.traceableEnvVarTemplate = exports.TraceableAgentValues = exports.ComplianceAgentValues = void 0;
7
7
  var _types = require("../../../../common/types");
8
8
  var _handlebars = _interopRequireDefault(require("handlebars"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
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
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
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
+
13
20
  /**
14
21
  * @description Parameters to provide to the Traceable handlebars templates.
15
22
  */
16
- class TraceableAgentValues {
23
+ exports.ComplianceAgentValues = ComplianceAgentValues;
24
+ class TraceableAgentValues extends ComplianceAgentValues {
17
25
  constructor() {
26
+ super();
18
27
  _defineProperty(this, "namespace", void 0);
19
28
  _defineProperty(this, "traceableToken", void 0);
20
29
  _defineProperty(this, "traceableRegion", void 0);
21
30
  _defineProperty(this, "environments", void 0);
22
- _defineProperty(this, "centralEnvironments", void 0);
23
31
  _defineProperty(this, "centralConfig", void 0);
24
32
  _defineProperty(this, "traceabilityConfig", void 0);
25
33
  _defineProperty(this, "traceableSecret", void 0);
@@ -31,7 +39,6 @@ class TraceableAgentValues {
31
39
  this.traceableToken = '';
32
40
  this.traceableRegion = _types.TraceableRegionType.US;
33
41
  this.environments = [];
34
- this.centralEnvironments = [];
35
42
  this.centralConfig = new _types.CentralAgentConfig();
36
43
  this.traceabilityConfig = new _types.TraceabilityConfig();
37
44
  this.traceableSecret = '';
@@ -97,12 +97,17 @@ const getCentralConfig = async (apiServerClient, platformClient, defsManager, ap
97
97
  centralConfig.daAgentName = await helpers.askAgentName(apiServerClient, defsManager, _types.AgentTypes.da, centralConfig.ampcEnvInfo.name);
98
98
  }
99
99
 
100
- // Get the TA Agent name
100
+ // Initialize agent names
101
101
  centralConfig.taAgentName = '';
102
- // Set agent type based on gateway type. For Traceable and Graylog, we need to set the type to ca (compliance)
103
- const agentType = installConfig.gatewayType !== _types.GatewayTypes.TRACEABLE && installConfig.gatewayType !== _types.GatewayTypes.GRAYLOG ? _types.AgentTypes.ta : _types.AgentTypes.ca;
102
+ centralConfig.caAgentName = '';
103
+
104
+ // Determine if we should use CA (compliance) or TA agent. Compliance is good for TRACEABLE and GRAYLOG (atm)
105
+ const isCaType = installConfig.gatewayType === _types.GatewayTypes.TRACEABLE || installConfig.gatewayType === _types.GatewayTypes.GRAYLOG;
106
+ const agentType = isCaType ? _types.AgentTypes.ca : _types.AgentTypes.ta;
107
+ const agentNameProperty = isCaType ? 'caAgentName' : 'taAgentName';
104
108
  if (installConfig.switches.isTaEnabled && !installConfig.switches.isHostedInstall) {
105
- centralConfig.taAgentName = await helpers.askAgentName(apiServerClient, defsManager, agentType, centralConfig.ampcEnvInfo.name);
109
+ const agentName = await helpers.askAgentName(apiServerClient, defsManager, agentType, centralConfig.ampcEnvInfo.name);
110
+ centralConfig[agentNameProperty] = agentName;
106
111
  }
107
112
  return centralConfig;
108
113
  };
@@ -135,20 +140,23 @@ const finalizeCentralInstall = async (apiServerClient, platformClient, defsManag
135
140
  if (installConfig.centralConfig.ampcEnvInfo.isUpdated) {
136
141
  await helpers.updateSubResourceType(apiServerClient, defsManager, installConfig.centralConfig.ampcEnvInfo.name, 'Environment', 'env', '', refEnvSubResource);
137
142
  }
143
+
138
144
  // Create DiscoveryAgent Resource unless gateway type is Istio. This can be removed when this is available for Istio
139
145
  if (installConfig.centralConfig.daAgentName != '') {
140
146
  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);
141
147
  }
142
148
 
143
149
  // Create TraceabilityAgent Resource
144
- if (installConfig.centralConfig.taAgentName !== '') {
145
- let agentResourceKind = _types.AgentResourceKind.ta;
146
- let agentType = _types.AgentTypes.ta;
147
- if (installConfig.gatewayType === _types.GatewayTypes.TRACEABLE || installConfig.gatewayType === _types.GatewayTypes.GRAYLOG) {
148
- agentResourceKind = _types.AgentResourceKind.ca;
149
- agentType = _types.AgentTypes.ca;
150
- }
151
- installConfig.centralConfig.taAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], agentResourceKind, agentType, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.taAgentName);
150
+ if (installConfig.centralConfig.taAgentName != '') {
151
+ installConfig.centralConfig.taAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.ta, _types.AgentTypes.ta, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.taAgentName);
152
+ }
153
+
154
+ // Create ComplianceAgent Resource
155
+ if (installConfig.centralConfig.caAgentName != '') {
156
+ installConfig.centralConfig.caAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.ca, _types.AgentTypes.ca, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.caAgentName, undefined, undefined, undefined, {
157
+ managedEnvironment: installConfig.gatewayConfig.centralEnvironments
158
+ } // cast applied here
159
+ );
152
160
  }
153
161
  if (installConfig.bundleType === _types.BundleType.TRACEABILITY_OFFLINE || installConfig.gatewayType === _types.GatewayTypes.ISTIO) {
154
162
  installConfig.centralConfig.environmentId = await helpers.getEnvironmentId(apiServerClient, defsManager, installConfig.centralConfig.environment);
@@ -387,6 +387,7 @@ class CentralAgentConfig {
387
387
  _defineProperty(this, "ingestionProtocol", void 0);
388
388
  _defineProperty(this, "daAgentName", void 0);
389
389
  _defineProperty(this, "taAgentName", void 0);
390
+ _defineProperty(this, "caAgentName", void 0);
390
391
  _defineProperty(this, "dosaAccount", void 0);
391
392
  _defineProperty(this, "environment", void 0);
392
393
  _defineProperty(this, "environmentId", void 0);
@@ -401,6 +402,7 @@ class CentralAgentConfig {
401
402
  _defineProperty(this, "axwayManaged", void 0);
402
403
  _defineProperty(this, "apiServerClient", void 0);
403
404
  _defineProperty(this, "definitionManager", void 0);
405
+ _defineProperty(this, "gatewayConfig", void 0);
404
406
  _defineProperty(this, "setBaseHost", async () => {
405
407
  this.url = await (0, _dataService.getBaseUrl)(undefined, undefined, this.region);
406
408
  [this.scheme, this.host] = this.url.split('://');
@@ -411,6 +413,7 @@ class CentralAgentConfig {
411
413
  this.ingestionProtocol = IngestionProtocol.Lumberjack;
412
414
  this.daAgentName = '';
413
415
  this.taAgentName = '';
416
+ this.caAgentName = '';
414
417
  this.ampcEnvInfo = new EnvironmentConfigInfo();
415
418
  this.ampcDosaInfo = new DOSAConfigInfo();
416
419
  this.dosaAccount = new DosaAccount();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "3.15.0-rc.2",
3
+ "version": "3.15.0-rc.3",
4
4
  "description": "Manage APIs, services and publish to the Amplify Marketplace",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {