@axway/axway-central-cli 2.18.0 → 2.19.0-rc.1

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
@@ -129,7 +129,6 @@ Axway CENTRAL COMMANDS:
129
129
  edit Edit and update resources by using the default editor
130
130
  get List one or more resources
131
131
  install Install additional platform resources
132
- proxies Manage API proxies
133
132
  ```
134
133
 
135
134
  # Commands reference:
@@ -224,36 +223,6 @@ axway central config ls
224
223
 
225
224
  ---
226
225
 
227
- ## PROXIES
228
-
229
- ```text
230
- axway central proxies <command> [options]
231
-
232
- PROXIES COMMANDS:
233
- create
234
- promote
235
-
236
- PROXIES OPTIONS:
237
- --client-id=<value> Override your DevOps account client ID
238
- --json Show JSON output
239
- ```
240
-
241
- ### proxies: create/update a proxy:
242
-
243
- ```text
244
- axway central proxies create [options] <proxyDefinition>
245
-
246
- CREATE AMPLIFY CENTRAL PROXY ARGUMENTS:
247
- proxyDefinition A YAML definition of your proxy
248
-
249
- CREATE AMPLIFY CENTRAL PROXY OPTIONS:
250
- -f,--force force create a new proxy
251
-
252
- PROXIES OPTIONS:
253
- --client-id=<value> Override your DevOps account client ID
254
- --json Show JSON output
255
- ```
256
-
257
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/).
258
227
 
259
228
  - **v0**
@@ -298,32 +267,6 @@ proxy:
298
267
  name: 'Default Team'
299
268
  ```
300
269
 
301
- ### proxies: promote/deploy a proxy:
302
-
303
- ```text
304
- axway central proxies promote [options] <proxyDefinition>
305
-
306
- PROMOTE AMPLIFY CENTRAL PROXY ARGUMENTS:
307
- proxyDefinition A YAML definition of your proxy
308
-
309
- PROMOTE AMPLIFY CENTRAL PROXY OPTIONS:
310
- --source=<runtime> The runtime to promote from
311
- --target=<runtime> The runtime to promote to
312
-
313
- PROXIES OPTIONS:
314
- --client-id=<value> Override your DevOps account client ID
315
- --json Show JSON output
316
- ```
317
-
318
- ### proxies examples
319
-
320
- ```bash
321
- # create a proxy
322
- axway central proxies create ./some/folder/proxy.yaml
323
- # promote a proxy
324
- axway central proxies promote ./some/folder/proxy.yaml --target="Test Runtime"
325
- ```
326
-
327
270
  ---
328
271
 
329
272
  ## GET
package/dist/cli.js CHANGED
@@ -16,7 +16,6 @@ var _delete = require("./commands/delete");
16
16
  var _edit = require("./commands/edit");
17
17
  var _get = require("./commands/get");
18
18
  var _install = require("./commands/install");
19
- var _proxies = require("./commands/proxies");
20
19
  var _utils = require("./common/utils");
21
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
21
  _dayjs.default.extend(_relativeTime.default);
@@ -46,7 +45,6 @@ const cliParams = exports.cliParams = {
46
45
  delete: _delete.deleteCmd,
47
46
  edit: _edit.edit,
48
47
  get: _get.get,
49
- proxies: _proxies.proxies,
50
48
  install: _install.install
51
49
  },
52
50
  extensions
@@ -88,7 +88,6 @@ const completion = exports.completion = {
88
88
  type: 'bool',
89
89
  hidden: true // used only by autocompletion script itself
90
90
  },
91
-
92
91
  '--zsh': {
93
92
  type: 'bool',
94
93
  desc: 'Autocompletion script for zsh.'
@@ -17,6 +17,7 @@ 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"));
20
21
  var azureAgents = _interopRequireWildcard(require("./azureAgents"));
21
22
  var edgeAgents = _interopRequireWildcard(require("./edgeAgents"));
22
23
  var apigeeSaaSAgents = _interopRequireWildcard(require("./apigeexSaasAgents"));
@@ -40,6 +41,7 @@ const agentInstallFlows = {
40
41
  [_types.GatewayTypes.EDGE_GATEWAY_ONLY]: edgeAgents.EdgeGWOnlyInstallMethods,
41
42
  [_types.GatewayTypes.AWS_GATEWAY]: awsAgents.AWSInstallMethods,
42
43
  [_types.GatewayTypes.GITHUB]: gitHubAgents.GitHubSaaSInstallMethods,
44
+ [_types.GatewayTypes.GITLAB]: gitLabAgents.GitLabInstallMethods,
43
45
  [_types.GatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
44
46
  [_types.GatewayTypes.AZURE_GATEWAY]: azureAgents.AzureInstallMethods,
45
47
  [_types.GatewayTypes.ISTIO]: istioAgents.IstioInstallMethods
@@ -13,9 +13,7 @@ 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) { 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); }
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; }
19
17
  const {
20
18
  log
21
19
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -243,7 +241,6 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
243
241
  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
244
242
  );
245
243
  }
246
-
247
244
  console.log(await generateOutput(installConfig));
248
245
  };
249
246
  const APIGEEXSaaSInstallMethods = exports.APIGEEXSaaSInstallMethods = {
@@ -14,9 +14,7 @@ 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) { 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); }
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; }
20
18
  const {
21
19
  log
22
20
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -406,7 +404,11 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
406
404
  production: installConfig.centralConfig.production
407
405
  }) : installConfig.centralConfig.ampcEnvInfo.name;
408
406
  if (installConfig.gatewayType === _types.GatewayTypes.AWS_GATEWAY) {
409
- awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN);
407
+ if (installConfig.switches.isTaEnabled) {
408
+ awsAgentValues.dataplaneConfig = new AWSDataplaneConfig(awsAgentValues.accessLogARN);
409
+ } else {
410
+ awsAgentValues.dataplaneConfig = new DataplaneConfig("AWS");
411
+ }
410
412
  }
411
413
 
412
414
  // create the data plane resource
@@ -13,9 +13,7 @@ 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) { 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); }
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; }
19
17
  const {
20
18
  log
21
19
  } = (0, _snooplogg.default)('central: install: agents: saas');
@@ -0,0 +1,174 @@
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
+ };
@@ -128,6 +128,18 @@ 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
+ });
131
143
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
132
144
  const streamPipeline = exports.streamPipeline = _util.default.promisify(_stream.default.pipeline);
133
145
  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.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.GitLabRegexPatterns = 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,4 +51,9 @@ 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: '^\/.*$'
54
59
  };
@@ -5,9 +5,7 @@ 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) { 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); }
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; }
11
9
  /**
12
10
  * @description Values to provide to the aws handlebars templates.
13
11
  */
@@ -5,9 +5,7 @@ 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) { 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); }
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; }
11
9
  /**
12
10
  * @description Parameters to provide to the Azure handlebars templates.
13
11
  */
@@ -6,9 +6,7 @@ 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) { 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); }
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; }
12
10
  /**
13
11
  * @description Values to provide to the v7 handlebars templates.
14
12
  */
@@ -0,0 +1,65 @@
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;
@@ -5,9 +5,7 @@ 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) { 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); }
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; }
11
9
  /**
12
10
  * @description Values for installing the Istio Agents
13
11
  */
@@ -13,9 +13,7 @@ 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) { 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); }
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; }
19
17
  const {
20
18
  log
21
19
  } = (0, _snooplogg.default)('central:class.ApiServerClient');
@@ -27,9 +25,6 @@ let ApiServerVersions = exports.ApiServerVersions = /*#__PURE__*/function (ApiSe
27
25
  ApiServerVersions["v1alpha1"] = "v1alpha1";
28
26
  return ApiServerVersions;
29
27
  }({});
30
- /**
31
- * Client's types
32
- */
33
28
  class ApiServerClient {
34
29
  /**
35
30
  * Init temporary file if "data" is provided - write data to file (as YAML at the moment)
@@ -14,9 +14,7 @@ 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) { 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); }
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; }
20
18
  const {
21
19
  log
22
20
  } = (0, _snooplogg.default)('central: CacheController');
@@ -9,9 +9,7 @@ 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) { 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); }
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; }
15
13
  let CliConfigKeys = exports.CliConfigKeys = /*#__PURE__*/function (CliConfigKeys) {
16
14
  CliConfigKeys["APIC_DEPLOYMENT"] = "apic-deployment";
17
15
  CliConfigKeys["BASE_URL"] = "base-url";
@@ -9,9 +9,7 @@ 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) { 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); }
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; }
15
13
  const {
16
14
  log
17
15
  } = (0, _snooplogg.default)('central: CoreConfigController');
@@ -13,9 +13,7 @@ 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) { 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); }
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; }
19
17
  const {
20
18
  log
21
19
  } = (0, _snooplogg.default)('central:class.DefinitionsManager');
@@ -42,8 +42,6 @@ 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. */
47
45
  var _baseUrl = /*#__PURE__*/new WeakMap();
48
46
  var _accountName = /*#__PURE__*/new WeakMap();
49
47
  var _amplifyConfig = /*#__PURE__*/new WeakMap();
@@ -13,9 +13,7 @@ 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) { 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); }
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; }
19
17
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
20
18
  var _createApiServerErrorMessage = /*#__PURE__*/new WeakSet();
21
19
  class Renderer {
@@ -11,9 +11,7 @@ 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) { 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); }
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; }
17
15
  const {
18
16
  log
19
17
  } = (0, _snooplogg.default)('central:class.TmpFile');
@@ -8,10 +8,6 @@ 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
-
15
11
  /**
16
12
  * @param validators At least one InputValidation func
17
13
  * @description Executes the provided InputValidation funcs until all are successful, or one returns an error.
@@ -5,9 +5,7 @@ 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) { 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); }
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; }
11
9
  const cliVersionHeader = exports.cliVersionHeader = 'x-axway-cli-version';
12
10
  const docsUrl = exports.docsUrl = 'https://docs.axway.com/bundle/amplify-central/page/docs/index.html';
13
11
  const ABORT_TIMEOUT = exports.ABORT_TIMEOUT = process.env.NODE_ENV === 'test' ? 1e3 : process.env.DEBUG || process.env.SNOOPLOGG ? 1e9 : 30e3;
@@ -37,7 +35,6 @@ const KindTypes = exports.KindTypes = [Kind.Environment, Kind.APIService, Kind.A
37
35
  const PublicRepoUrl = exports.PublicRepoUrl = 'https://axway.jfrog.io';
38
36
  const PublicDockerRepoBaseUrl = exports.PublicDockerRepoBaseUrl = 'axway.jfrog.io/ampc-public-docker-release';
39
37
  let BasePaths = exports.BasePaths = /*#__PURE__*/function (BasePaths) {
40
- BasePaths["Aggregator"] = "/api/apiAggregator/v1";
41
38
  BasePaths["ApiServer"] = "/apis";
42
39
  BasePaths["ApiCentral"] = "/api/v1";
43
40
  BasePaths["Platform"] = "/platform/api/v1";
@@ -215,6 +212,7 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
215
212
  AgentNames["AWS_DA"] = "aws-apigw-discovery-agent";
216
213
  AgentNames["AWS_TA"] = "aws-apigw-traceability-agent";
217
214
  AgentNames["GITHUB_DA"] = "github-discovery-agent";
215
+ AgentNames["GITLAB_DA"] = "gitlab-discovery-agent";
218
216
  AgentNames["APIGEEX_DA"] = "apigee-discovery-agent";
219
217
  AgentNames["APIGEEX_TA"] = "apigee-traceability-agent";
220
218
  AgentNames["AZURE_DA"] = "azure-discovery-agent";
@@ -229,6 +227,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
229
227
  GatewayTypes["APIGEEX_GATEWAY"] = "Apigee X Gateway";
230
228
  GatewayTypes["AZURE_GATEWAY"] = "Azure API Gateway";
231
229
  GatewayTypes["GITHUB"] = "GitHub";
230
+ GatewayTypes["GITLAB"] = "GitLab";
232
231
  GatewayTypes["ISTIO"] = "Istio";
233
232
  GatewayTypes["EDGE_GATEWAY_ONLY"] = "Amplify API Gateway only";
234
233
  return GatewayTypes;
@@ -243,6 +242,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
243
242
  DataPlaneNames["APIGEE"] = "Apigee";
244
243
  DataPlaneNames["AWS"] = "AWS";
245
244
  DataPlaneNames["GITHUB"] = "GitHub";
245
+ DataPlaneNames["GITLAB"] = "GitLab";
246
246
  DataPlaneNames["AZURE"] = "Azure";
247
247
  DataPlaneNames["EDGE"] = "Edge";
248
248
  DataPlaneNames["KONG"] = "Kong";
@@ -256,6 +256,7 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
256
256
  [GatewayTypes.EDGE_GATEWAY_ONLY]: DataPlaneNames.EDGE,
257
257
  [GatewayTypes.AWS_GATEWAY]: DataPlaneNames.AWS,
258
258
  [GatewayTypes.GITHUB]: DataPlaneNames.GITHUB,
259
+ [GatewayTypes.GITLAB]: DataPlaneNames.GITLAB,
259
260
  [GatewayTypes.AZURE_GATEWAY]: DataPlaneNames.AZURE,
260
261
  [GatewayTypes.ISTIO]: 'Istio',
261
262
  [GatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE
@@ -585,9 +586,4 @@ class IstioInstallValues {
585
586
  }
586
587
 
587
588
  /** Provides information for a platform team. */
588
-
589
- /**
590
- * Invoked multiple times to indicate progress on something, such as download progress.
591
- * @param progress Value ranging from 0 to 100.
592
- */
593
589
  exports.IstioInstallValues = IstioInstallValues;
@@ -113,7 +113,6 @@ const loadAndVerifySpecs = async (specFilePath, allowedKinds) => {
113
113
 
114
114
  // TODO: Validate "metadata.scope.kind" if available. Requires DefinitionManager.getSortedKindsMap() result.
115
115
  }
116
-
117
116
  if (errors.length > 0) {
118
117
  throw new _CompositeError.CompositeError(errors);
119
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.18.0",
3
+ "version": "2.19.0-rc.1",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.create = void 0;
7
- var _cliKit = require("cli-kit");
8
- var _formData = _interopRequireDefault(require("form-data"));
9
- var _fsExtra = require("fs-extra");
10
- var _ora = _interopRequireDefault(require("ora"));
11
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
12
- var _dataService = require("../../common/dataService");
13
- var _errorHandler = require("../../common/errorHandler");
14
- var _resultsRenderers = require("../../common/resultsRenderers");
15
- var _types = require("../../common/types");
16
- var _utils = require("../../common/utils");
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- const {
19
- log
20
- } = (0, _snooplogg.default)('central: proxies: create');
21
- const action = async ({
22
- argv,
23
- console
24
- }) => {
25
- const {
26
- baseUrl,
27
- clientId,
28
- account,
29
- force,
30
- json,
31
- proxyDefinition,
32
- region
33
- } = argv;
34
- const spinner = !(process.env['DEBUG'] || json) ? (0, _ora.default)({
35
- spinner: 'dots3',
36
- text: 'Creating API Proxy'
37
- }).start() : null;
38
- try {
39
- log(`Verifying file: ${proxyDefinition}`);
40
- (0, _utils.verifyFile)(proxyDefinition);
41
- const service = await (0, _dataService.dataService)({
42
- baseUrl,
43
- basePath: _types.BasePaths.Aggregator,
44
- clientId,
45
- account,
46
- region
47
- });
48
- const body = new _formData.default();
49
- body.append('config', (0, _fsExtra.createReadStream)(proxyDefinition));
50
- body.append('forceCreate', force.toString());
51
- const result = await service.postFormData('/proxies', body);
52
- spinner ? spinner.succeed((0, _cliKit.chalk)`{greenBright "${result.proxyName}" has successfully been created.}`) : (0, _resultsRenderers.renderResponse)(console, result, _types.OutputTypes.json);
53
- } catch (e) {
54
- log('command error', e);
55
- (0, _errorHandler.handleErrors)(console, e, spinner);
56
- } finally {
57
- log('command successful');
58
- spinner && spinner.stop();
59
- }
60
- };
61
- const create = exports.create = {
62
- title: 'Create Amplify Central Proxy',
63
- desc: '',
64
- options: {
65
- '-f, --force': 'Force create a new proxy'
66
- },
67
- args: [{
68
- name: 'proxyDefinition',
69
- desc: 'A YAML definition of your proxy',
70
- required: true
71
- }],
72
- action
73
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.proxies = void 0;
7
- var _create = require("./create");
8
- var _promote = require("./promote");
9
- var _types = require("../../common/types");
10
- const proxies = exports.proxies = {
11
- action: () => {
12
- throw new Error(`Missing one of required commands: [create, promote]`);
13
- },
14
- commands: {
15
- create: _create.create,
16
- promote: _promote.promote
17
- },
18
- desc: 'Manage API proxies',
19
- options: {
20
- ..._types.commonCmdArgsDescription,
21
- '--client-id [value]': `Override your DevOps account's client ID`,
22
- '--json': 'Show JSON output'
23
- }
24
- };
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.promote = void 0;
7
- var _cliKit = require("cli-kit");
8
- var _formData = _interopRequireDefault(require("form-data"));
9
- var _fsExtra = require("fs-extra");
10
- var _ora = _interopRequireDefault(require("ora"));
11
- var _snooplogg = _interopRequireDefault(require("snooplogg"));
12
- var _dataService = require("../../common/dataService");
13
- var _errorHandler = require("../../common/errorHandler");
14
- var _resultsRenderers = require("../../common/resultsRenderers");
15
- var _types = require("../../common/types");
16
- var _utils = require("../../common/utils");
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- const {
19
- log
20
- } = (0, _snooplogg.default)('central: proxies: promote');
21
- const action = async ({
22
- argv,
23
- console
24
- }) => {
25
- const {
26
- baseUrl,
27
- clientId,
28
- account,
29
- region,
30
- json,
31
- proxyDefinition,
32
- source,
33
- target
34
- } = argv;
35
- const spinner = !(process.env['DEBUG'] || json) ? (0, _ora.default)({
36
- spinner: 'dots3',
37
- text: `Promoting API Proxy to ${target}`
38
- }).start() : null;
39
- try {
40
- log(`Verifying file: ${proxyDefinition}`);
41
- (0, _utils.verifyFile)(proxyDefinition);
42
- const service = await (0, _dataService.dataService)({
43
- baseUrl,
44
- basePath: _types.BasePaths.Aggregator,
45
- clientId,
46
- account,
47
- region
48
- });
49
- const body = new _formData.default();
50
- body.append('config', (0, _fsExtra.createReadStream)(proxyDefinition));
51
- body.append('target', target);
52
- if (source) {
53
- body.append('source', source);
54
- }
55
- const response = await service.postFormData('/promote', body);
56
- if (spinner) {
57
- spinner.succeed((0, _cliKit.chalk)`{greenBright The deployed service can now be accessed at {cyan.underline ${response.url}}}`);
58
- response.apiKeys && spinner.succeed((0, _cliKit.chalk)`{greenBright You can access it with these API Keys: {cyan ${response.apiKeys}}}`);
59
- } else (0, _resultsRenderers.renderResponse)(console, response, _types.OutputTypes.json);
60
- } catch (e) {
61
- log('command error', e);
62
- (0, _errorHandler.handleErrors)(console, e, spinner);
63
- } finally {
64
- log('command successful');
65
- spinner && spinner.stop();
66
- }
67
- };
68
- const promote = exports.promote = {
69
- title: 'Promote Amplify Central proxy',
70
- desc: '',
71
- args: [{
72
- name: 'proxyDefinition',
73
- desc: 'A YAML definition of your proxy',
74
- required: true
75
- }],
76
- options: {
77
- '--source [runtime]': 'The runtime to promote from',
78
- '--target [runtime]': {
79
- desc: 'The runtime to promote to',
80
- required: true
81
- }
82
- },
83
- action
84
- };