@axway/axway-central-cli 2.19.0-rc.1 → 2.19.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
@@ -223,7 +223,11 @@ axway central config ls
223
223
 
224
224
  ---
225
225
 
226
- CLI supports multiple versions of proxy definition file. For more details and examples visit our [docs portal](https://docs.axway.com/bundle/amplify-central/page/docs/integrate_with_central/cli_central/index.html) and [stoplight hub](https://d-api.docs.stoplight.io/).
226
+ ### Proxies: create/update a proxy:
227
+
228
+ The ability to create/update proxies have been deprecated from the CLI verison 2.19.0
229
+
230
+ ---
227
231
 
228
232
  - **v0**
229
233
 
@@ -88,6 +88,7 @@ const completion = exports.completion = {
88
88
  type: 'bool',
89
89
  hidden: true // used only by autocompletion script itself
90
90
  },
91
+
91
92
  '--zsh': {
92
93
  type: 'bool',
93
94
  desc: 'Autocompletion script for zsh.'
@@ -17,7 +17,6 @@ var _types = require("../../common/types");
17
17
  var _utils = require("../../common/utils");
18
18
  var awsAgents = _interopRequireWildcard(require("./awsAgents"));
19
19
  var gitHubAgents = _interopRequireWildcard(require("./gitHubSaasAgents"));
20
- var gitLabAgents = _interopRequireWildcard(require("./gitLabAgents"));
21
20
  var azureAgents = _interopRequireWildcard(require("./azureAgents"));
22
21
  var edgeAgents = _interopRequireWildcard(require("./edgeAgents"));
23
22
  var apigeeSaaSAgents = _interopRequireWildcard(require("./apigeexSaasAgents"));
@@ -41,7 +40,6 @@ const agentInstallFlows = {
41
40
  [_types.GatewayTypes.EDGE_GATEWAY_ONLY]: edgeAgents.EdgeGWOnlyInstallMethods,
42
41
  [_types.GatewayTypes.AWS_GATEWAY]: awsAgents.AWSInstallMethods,
43
42
  [_types.GatewayTypes.GITHUB]: gitHubAgents.GitHubSaaSInstallMethods,
44
- [_types.GatewayTypes.GITLAB]: gitLabAgents.GitLabInstallMethods,
45
43
  [_types.GatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
46
44
  [_types.GatewayTypes.AZURE_GATEWAY]: azureAgents.AzureInstallMethods,
47
45
  [_types.GatewayTypes.ISTIO]: istioAgents.IstioInstallMethods
@@ -13,7 +13,9 @@ var _crypto = _interopRequireDefault(require("crypto"));
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
19
  const {
18
20
  log
19
21
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -241,6 +243,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
241
243
  installConfig.centralConfig.taAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.ta, _types.AgentTypes.ta, installConfig.centralConfig.ampcTeamName, _types.GatewayTypeToDataPlane[installConfig.gatewayType] + " Traceability Agent", dataplaneRes.name, apigeeXAgentValues.frequencyTA, false // APIGEE X TA is never triggered at install, as DA has to run prior
242
244
  );
243
245
  }
246
+
244
247
  console.log(await generateOutput(installConfig));
245
248
  };
246
249
  const APIGEEXSaaSInstallMethods = exports.APIGEEXSaaSInstallMethods = {
@@ -14,7 +14,9 @@ var _crypto = _interopRequireDefault(require("crypto"));
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- 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; }
17
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
20
  const {
19
21
  log
20
22
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -404,11 +406,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
404
406
  production: installConfig.centralConfig.production
405
407
  }) : installConfig.centralConfig.ampcEnvInfo.name;
406
408
  if (installConfig.gatewayType === _types.GatewayTypes.AWS_GATEWAY) {
407
- if (installConfig.switches.isTaEnabled) {
408
- awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN);
409
- } else {
410
- awsAgentValues.dataplaneConfig = new DataplaneConfig("AWS");
411
- }
409
+ awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN);
412
410
  }
413
411
 
414
412
  // create the data plane resource
@@ -13,7 +13,9 @@ var _crypto = _interopRequireDefault(require("crypto"));
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
19
  const {
18
20
  log
19
21
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -128,18 +128,6 @@ Object.keys(_istioTemplates).forEach(function (key) {
128
128
  }
129
129
  });
130
130
  });
131
- var _gitLabTemplates = require("./templates/gitLabTemplates");
132
- Object.keys(_gitLabTemplates).forEach(function (key) {
133
- if (key === "default" || key === "__esModule") return;
134
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
135
- if (key in exports && exports[key] === _gitLabTemplates[key]) return;
136
- Object.defineProperty(exports, key, {
137
- enumerable: true,
138
- get: function () {
139
- return _gitLabTemplates[key];
140
- }
141
- });
142
- });
143
131
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
144
132
  const streamPipeline = exports.streamPipeline = _util.default.promisify(_stream.default.pipeline);
145
133
  const unzip = async filePath => {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.GitLabRegexPatterns = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
6
+ exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
7
7
  const resourceRegex = exports.resourceRegex = '^(?:[a-z0-9]*(?:\\.(?=[a-z0-9])|-+(?=[a-z0-9]))?)+[a-z0-9]$';
8
8
  const namespaceRegex = exports.namespaceRegex = '^[a-z0-9]?(?:[-a-z0-9]*[a-z0-9]){1,100}?$';
9
9
  const domainNameRegex = exports.domainNameRegex = '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)+([A-Za-z]){2,}$';
@@ -51,9 +51,4 @@ const GitHubRegexPatterns = exports.GitHubRegexPatterns = {
51
51
  gitHubRepositoryOwnerRegex: '^(?!-)(?!.*--)[a-zA-Z0-9-]{1,37}(?<!-)$',
52
52
  gitHubRepositoryNameRegex: '^[\w-\.]+$',
53
53
  gitHubFilePathRegex: '^\/.*$'
54
- };
55
- const GitLabRegexPatterns = exports.GitLabRegexPatterns = {
56
- gitLabAccessTokenRegex: '^[0-9a-zA-Z\-]{20}$',
57
- gitHubRepositoryIDRegex: '^[0-9]*$',
58
- gitLabPathRegex: '^\/.*$'
59
54
  };
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.awsTAEnvVarTemplate = exports.awsDAEnvVarTemplate = exports.AWSAgentValues = void 0;
7
7
  var _types = require("../../../../common/types");
8
- 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; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
11
  /**
10
12
  * @description Values to provide to the aws handlebars templates.
11
13
  */
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.azureTAEnvVarTemplate = exports.azureDAEnvVarTemplate = exports.AzureAgentValues = void 0;
7
7
  var _types = require("../../../../common/types");
8
- 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; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
11
  /**
10
12
  * @description Parameters to provide to the Azure handlebars templates.
11
13
  */
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.v7TAHelmOverrideTemplate = exports.v7TAEnvVarTemplate = exports.v7DAHelmOverrideTemplate = exports.v7DAEnvVarTemplate = exports.V7AgentValues = void 0;
7
7
  var _ = require("..");
8
8
  var _types = require("../../../../common/types");
9
- 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; }
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
12
  /**
11
13
  * @description Values to provide to the v7 handlebars templates.
12
14
  */
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.istioInstallTemplate = exports.istioAgentsTemplate = exports.IstioValues = void 0;
7
7
  var _types = require("../../../../common/types");
8
- 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; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
11
  /**
10
12
  * @description Values for installing the Istio Agents
11
13
  */
@@ -13,7 +13,9 @@ var _dataService = require("./dataService");
13
13
  var _types = require("./types");
14
14
  var _utils = require("./utils");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
19
  const {
18
20
  log
19
21
  } = (0, _snooplogg.default)('central:class.ApiServerClient');
@@ -25,6 +27,9 @@ let ApiServerVersions = exports.ApiServerVersions = /*#__PURE__*/function (ApiSe
25
27
  ApiServerVersions["v1alpha1"] = "v1alpha1";
26
28
  return ApiServerVersions;
27
29
  }({});
30
+ /**
31
+ * Client's types
32
+ */
28
33
  class ApiServerClient {
29
34
  /**
30
35
  * Init temporary file if "data" is provided - write data to file (as YAML at the moment)
@@ -14,7 +14,9 @@ var _snooplogg = _interopRequireDefault(require("snooplogg"));
14
14
  var _types = require("./types");
15
15
  var _utils = require("./utils");
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- 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; }
17
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
20
  const {
19
21
  log
20
22
  } = (0, _snooplogg.default)('central: CacheController');
@@ -9,7 +9,9 @@ var _unset2 = _interopRequireDefault(require("lodash/unset"));
9
9
  var _os = require("os");
10
10
  var _path = require("path");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- 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; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  let CliConfigKeys = exports.CliConfigKeys = /*#__PURE__*/function (CliConfigKeys) {
14
16
  CliConfigKeys["APIC_DEPLOYMENT"] = "apic-deployment";
15
17
  CliConfigKeys["BASE_URL"] = "base-url";
@@ -9,7 +9,9 @@ var _snooplogg = _interopRequireDefault(require("snooplogg"));
9
9
  var _CliConfigManager = require("./CliConfigManager");
10
10
  var _types = require("./types");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- 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; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  const {
14
16
  log
15
17
  } = (0, _snooplogg.default)('central: CoreConfigController');
@@ -13,7 +13,9 @@ var _max2 = _interopRequireDefault(require("lodash/max"));
13
13
  var _min2 = _interopRequireDefault(require("lodash/min"));
14
14
  var _chalk = require("chalk");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
19
  const {
18
20
  log
19
21
  } = (0, _snooplogg.default)('central:class.DefinitionsManager');
@@ -42,6 +42,8 @@ let PlatformTeamMemberRole = exports.PlatformTeamMemberRole = /*#__PURE__*/funct
42
42
  PlatformTeamMemberRole["CatalogManager"] = "catalog_manager";
43
43
  return PlatformTeamMemberRole;
44
44
  }({});
45
+ /** Options used to create a service account via the PlatformClient.createServiceAccount() method. */
46
+ /** Provides information for a platform service account. */
45
47
  var _baseUrl = /*#__PURE__*/new WeakMap();
46
48
  var _accountName = /*#__PURE__*/new WeakMap();
47
49
  var _amplifyConfig = /*#__PURE__*/new WeakMap();
@@ -13,7 +13,9 @@ var _utils = require("./utils");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
15
15
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
16
- 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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
19
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
18
20
  var _createApiServerErrorMessage = /*#__PURE__*/new WeakSet();
19
21
  class Renderer {
@@ -11,7 +11,9 @@ var _resultsRenderers = require("../common/resultsRenderers");
11
11
  var _utils = require("../common/utils");
12
12
  var _bashCommands = require("./bashCommands");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- 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; }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
17
  const {
16
18
  log
17
19
  } = (0, _snooplogg.default)('central:class.TmpFile');
@@ -8,6 +8,10 @@ var _inquirer = _interopRequireDefault(require("inquirer"));
8
8
  var _fsExtra = require("fs-extra");
9
9
  var _path = require("path");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ //
12
+ // Basic Prompts
13
+ //
14
+
11
15
  /**
12
16
  * @param validators At least one InputValidation func
13
17
  * @description Executes the provided InputValidation funcs until all are successful, or one returns an error.
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.docsUrl = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceabilityConfig = exports.SingleEntryPointUrls = exports.SaaSGatewayTypes = exports.Regions = exports.PublicRepoUrl = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_TABLE_STRING_LENGTH = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.LoggingSource = exports.KindTypes = exports.Kind = exports.IstioProfileChoices = exports.IstioInstallValues = exports.IstioAgentValues = exports.IngestionProtocolToHosts = exports.IngestionProtocol = exports.IngestionHostsHTTP = exports.IngestionHosts = exports.IngestionHTTPHosts = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AuthUrls = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.AWSRegions = exports.APIGEEXDISCOVERYMODES = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
7
7
  var _dataService = require("./dataService");
8
- 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; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
11
  const cliVersionHeader = exports.cliVersionHeader = 'x-axway-cli-version';
10
12
  const docsUrl = exports.docsUrl = 'https://docs.axway.com/bundle/amplify-central/page/docs/index.html';
11
13
  const ABORT_TIMEOUT = exports.ABORT_TIMEOUT = process.env.NODE_ENV === 'test' ? 1e3 : process.env.DEBUG || process.env.SNOOPLOGG ? 1e9 : 30e3;
@@ -212,7 +214,6 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
212
214
  AgentNames["AWS_DA"] = "aws-apigw-discovery-agent";
213
215
  AgentNames["AWS_TA"] = "aws-apigw-traceability-agent";
214
216
  AgentNames["GITHUB_DA"] = "github-discovery-agent";
215
- AgentNames["GITLAB_DA"] = "gitlab-discovery-agent";
216
217
  AgentNames["APIGEEX_DA"] = "apigee-discovery-agent";
217
218
  AgentNames["APIGEEX_TA"] = "apigee-traceability-agent";
218
219
  AgentNames["AZURE_DA"] = "azure-discovery-agent";
@@ -227,7 +228,6 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
227
228
  GatewayTypes["APIGEEX_GATEWAY"] = "Apigee X Gateway";
228
229
  GatewayTypes["AZURE_GATEWAY"] = "Azure API Gateway";
229
230
  GatewayTypes["GITHUB"] = "GitHub";
230
- GatewayTypes["GITLAB"] = "GitLab";
231
231
  GatewayTypes["ISTIO"] = "Istio";
232
232
  GatewayTypes["EDGE_GATEWAY_ONLY"] = "Amplify API Gateway only";
233
233
  return GatewayTypes;
@@ -242,7 +242,6 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
242
242
  DataPlaneNames["APIGEE"] = "Apigee";
243
243
  DataPlaneNames["AWS"] = "AWS";
244
244
  DataPlaneNames["GITHUB"] = "GitHub";
245
- DataPlaneNames["GITLAB"] = "GitLab";
246
245
  DataPlaneNames["AZURE"] = "Azure";
247
246
  DataPlaneNames["EDGE"] = "Edge";
248
247
  DataPlaneNames["KONG"] = "Kong";
@@ -256,7 +255,6 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
256
255
  [GatewayTypes.EDGE_GATEWAY_ONLY]: DataPlaneNames.EDGE,
257
256
  [GatewayTypes.AWS_GATEWAY]: DataPlaneNames.AWS,
258
257
  [GatewayTypes.GITHUB]: DataPlaneNames.GITHUB,
259
- [GatewayTypes.GITLAB]: DataPlaneNames.GITLAB,
260
258
  [GatewayTypes.AZURE_GATEWAY]: DataPlaneNames.AZURE,
261
259
  [GatewayTypes.ISTIO]: 'Istio',
262
260
  [GatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE
@@ -586,4 +584,9 @@ class IstioInstallValues {
586
584
  }
587
585
 
588
586
  /** Provides information for a platform team. */
587
+
588
+ /**
589
+ * Invoked multiple times to indicate progress on something, such as download progress.
590
+ * @param progress Value ranging from 0 to 100.
591
+ */
589
592
  exports.IstioInstallValues = IstioInstallValues;
@@ -113,6 +113,7 @@ const loadAndVerifySpecs = async (specFilePath, allowedKinds) => {
113
113
 
114
114
  // TODO: Validate "metadata.scope.kind" if available. Requires DefinitionManager.getSortedKindsMap() result.
115
115
  }
116
+
116
117
  if (errors.length > 0) {
117
118
  throw new _CompositeError.CompositeError(errors);
118
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.19.0-rc.1",
3
+ "version": "2.19.0",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {
@@ -1,174 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.testables = exports.installPreprocess = exports.gitLabPrompts = exports.gatewayConnectivity = exports.completeInstall = exports.askConfigType = exports.askBundleType = exports.GitLabInstallMethods = 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 _gitLabTemplates = require("./helpers/templates/gitLabTemplates");
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- // @ts-ignore
18
- const {
19
- log
20
- } = (0, _snooplogg.default)('central: install: agents: gitLab:');
21
- const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.GITLAB_DA}`;
22
-
23
- // ConfigFiles - all the config file that are used in the setup
24
- const ConfigFiles = exports.ConfigFiles = {
25
- DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`
26
- };
27
- const gitLabPrompts = exports.gitLabPrompts = {
28
- ACCESS_TOKEN: 'Enter the GitLab Access Token the agent will use',
29
- BASE_URL: 'Enter the GitLab base URL that the agent will use',
30
- REPOSITORY_ID: 'Enter the GitLab Repository ID the agent will use',
31
- REPOSITORY_BRANCH: 'Enter the Repository Branch the agent will use',
32
- PATHS: 'Enter a Path within the repository that the agent will use',
33
- FILTERS: 'Enter a filter that the agent will use (Optional)',
34
- DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
35
- QUEUE: 'Do you want to discover immediately after installation',
36
- ENTER_MORE_PATHS: 'Do you want to enter another path ?',
37
- ENTER_MORE_FILTERS: 'Do you want to enter another filter ?'
38
- };
39
- const askBundleType = async () => {
40
- return _types.BundleType.DISCOVERY;
41
- };
42
- exports.askBundleType = askBundleType;
43
- const askConfigType = async () => {
44
- return _types.AgentConfigTypes.DOCKERIZED;
45
- };
46
-
47
- // Questions for the gitLab configuration
48
- exports.askConfigType = askConfigType;
49
- const askForGitLabToken = async () => await (0, _basicPrompts.askInput)({
50
- msg: gitLabPrompts.ACCESS_TOKEN,
51
- validate: (0, _basicPrompts.validateRegex)(helpers.GitLabRegexPatterns.gitLabAccessTokenRegex, helpers.invalidValueExampleErrMsg('AccessToken', 'mockToken'))
52
- });
53
- const askForGitLabBaseURL = async () => await (0, _basicPrompts.askInput)({
54
- msg: gitLabPrompts.BASE_URL
55
- });
56
- const askForGitLabRepositoryID = async () => await (0, _basicPrompts.askInput)({
57
- msg: gitLabPrompts.REPOSITORY_ID,
58
- validate: (0, _basicPrompts.validateRegex)(helpers.GitLabRegexPatterns.gitHubRepositoryIDRegex, helpers.invalidValueExampleErrMsg('RepositoryID', '12312'))
59
- });
60
- const askForGitLabRepositoryBranch = async () => await (0, _basicPrompts.askInput)({
61
- msg: gitLabPrompts.REPOSITORY_BRANCH
62
- });
63
- const askForGitLabPaths = async () => {
64
- let askPaths = true;
65
- let paths = [];
66
- console.log(_chalk.default.gray("An array of paths within the repository that the agent will gather files for looking for specs"));
67
- while (askPaths) {
68
- const path = await (0, _basicPrompts.askInput)({
69
- msg: gitLabPrompts.PATHS,
70
- allowEmptyInput: false,
71
- validate: (0, _basicPrompts.validateRegex)(helpers.GitLabRegexPatterns.gitLabPathRegex, helpers.invalidValueExampleErrMsg('File Path', '/apis'))
72
- });
73
- paths.push(path);
74
- askPaths = (await (0, _basicPrompts.askList)({
75
- msg: gitLabPrompts.ENTER_MORE_PATHS,
76
- default: _types.YesNo.No,
77
- choices: _types.YesNoChoices
78
- })) === _types.YesNo.Yes;
79
- }
80
- return paths;
81
- };
82
- const askForGitLabFilters = async () => {
83
- let askFilters = true;
84
- let filters = [];
85
- console.log(_chalk.default.gray("An array of regular expressions that a file name must match to be discovered"));
86
- while (askFilters) {
87
- const filter = await (0, _basicPrompts.askInput)({
88
- msg: gitLabPrompts.FILTERS,
89
- allowEmptyInput: true
90
- });
91
- filters.push(filter);
92
- askFilters = (await (0, _basicPrompts.askList)({
93
- msg: gitLabPrompts.ENTER_MORE_FILTERS,
94
- default: _types.YesNo.No,
95
- choices: _types.YesNoChoices
96
- })) === _types.YesNo.Yes;
97
- }
98
- return filters;
99
- };
100
- const gatewayConnectivity = async installConfig => {
101
- let gitLabAgentValues = new _gitLabTemplates.GitLabAgentValues();
102
- if (installConfig.switches.isDockerInstall) {
103
- console.log('\nCONNECTION TO GitHub API GATEWAY:');
104
- console.log(_chalk.default.gray("The Discovery Agent needs to connect to the GitHub API Gateway to discover API's for publishing to Amplify Central"));
105
- gitLabAgentValues.token = await askForGitLabToken();
106
- gitLabAgentValues.baseURL = await askForGitLabBaseURL();
107
- gitLabAgentValues.repositoryID = await askForGitLabRepositoryID();
108
- gitLabAgentValues.repositoryBranch = await askForGitLabRepositoryBranch();
109
- gitLabAgentValues.paths = await askForGitLabPaths();
110
- gitLabAgentValues.filters = await askForGitLabFilters();
111
- }
112
- return gitLabAgentValues;
113
- };
114
- exports.gatewayConnectivity = gatewayConnectivity;
115
- const dockerSuccessMsg = installConfig => {
116
- let dockerInfo;
117
- const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
118
- const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
119
- const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
120
- const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
121
- if (installConfig.switches.isDaEnabled) {
122
- dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
123
- }
124
- console.log(_chalk.default.whiteBright(dockerInfo), '\n');
125
- if (installConfig.switches.isDaEnabled) {
126
- const daImageVersion = `${daImage}:${installConfig.daVersion}`;
127
- console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
128
- console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
129
- console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
130
- console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
131
- console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`));
132
- }
133
- };
134
- const generateSuccessHelpMsg = installConfig => {
135
- const configType = installConfig.deploymentType;
136
- if (configType === _types.AgentConfigTypes.DOCKERIZED) {
137
- dockerSuccessMsg(installConfig);
138
- }
139
- };
140
- const installPreprocess = async installConfig => {
141
- return installConfig;
142
- };
143
- exports.installPreprocess = installPreprocess;
144
- const completeInstall = async installConfig => {
145
- /**
146
- * Create agent resources
147
- */
148
- const gitLabAgentValues = installConfig.gatewayConfig;
149
-
150
- // Add final settings to gitLabAgentValues
151
- gitLabAgentValues.centralConfig = installConfig.centralConfig;
152
- gitLabAgentValues.daVersion = installConfig.daVersion;
153
- if (installConfig.switches.isDockerInstall) {
154
- if (installConfig.switches.isDaEnabled) {
155
- (0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, gitLabAgentValues, helpers.gitLabDAEnvVarTemplate);
156
- }
157
- }
158
- console.log('Configuration file(s) have been successfully created.\n');
159
- generateSuccessHelpMsg(installConfig);
160
- };
161
- exports.completeInstall = completeInstall;
162
- const GitLabInstallMethods = exports.GitLabInstallMethods = {
163
- GetBundleType: askBundleType,
164
- GetDeploymentType: askConfigType,
165
- AskGatewayQuestions: gatewayConnectivity,
166
- InstallPreprocess: installPreprocess,
167
- FinalizeGatewayInstall: completeInstall,
168
- ConfigFiles: Object.values(ConfigFiles),
169
- GatewayDisplay: _types.GatewayTypes.GITLAB
170
- };
171
- const testables = exports.testables = {
172
- gitLabPrompts,
173
- ConfigFiles
174
- };
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.gitLabDAEnvVarTemplate = exports.GitLabAgentValues = void 0;
7
- var _types = require("../../../../common/types");
8
- 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; }
9
- class GitLabAgentValues {
10
- constructor() {
11
- _defineProperty(this, "token", void 0);
12
- _defineProperty(this, "baseURL", void 0);
13
- _defineProperty(this, "repositoryID", void 0);
14
- _defineProperty(this, "repositoryBranch", void 0);
15
- _defineProperty(this, "paths", void 0);
16
- _defineProperty(this, "filters", void 0);
17
- _defineProperty(this, "daQueueName", void 0);
18
- _defineProperty(this, "daVersion", void 0);
19
- _defineProperty(this, "centralConfig", void 0);
20
- this.token = '';
21
- this.baseURL = '';
22
- this.repositoryID = '';
23
- this.repositoryBranch = '';
24
- this.daQueueName = '';
25
- this.daVersion = '';
26
- this.paths = [];
27
- this.filters = [];
28
- this.centralConfig = new _types.CentralAgentConfig();
29
- }
30
- }
31
- exports.GitLabAgentValues = GitLabAgentValues;
32
- const gitLabDAEnvVarTemplate = () => {
33
- return `# GitLab configs
34
- GITLAB_TOKEN={{token}}
35
- GITLAB_BASE_URL={{baseURL}}
36
- GITLAB_REPOSITORY_ID={{repositoryID}}
37
- GITLAB_REPOSITORY_BRANCH={{repositoryBranch}}
38
- GITLAB_PATHS={{paths}}
39
- GITLAB_FILTERS={{filters}}
40
-
41
- # Amplify Central configs
42
- CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
43
- CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
44
- CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
45
- CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
46
- CENTRAL_ENVIRONMENT={{centralConfig.environment}}
47
- CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
48
- {{#compare . centralConfig.ampcTeamName "" operator="!=" }}
49
- CENTRAL_TEAM={{centralConfig.ampcTeamName}}
50
- {{/compare}}
51
- CENTRAL_SINGLEURL={{centralConfig.singleEntryPointUrl}}
52
- {{#compare . centralConfig.region "US" operator="!="}}
53
- CENTRAL_URL={{centralConfig.url}}
54
- {{/compare}}
55
-
56
- # Logging configs
57
- # Define the logging level: info, debug, error
58
- LOG_LEVEL=info
59
- # Specify where to send the log: stdout, file, both
60
- LOG_OUTPUT=stdout
61
- # Define where the log files are written
62
- LOG_FILE_PATH=logs
63
- `;
64
- };
65
- exports.gitLabDAEnvVarTemplate = gitLabDAEnvVarTemplate;