@axway/axway-central-cli 2.23.0 → 2.24.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
@@ -229,50 +229,6 @@ The ability to create/update proxies have been deprecated from the CLI verison 2
229
229
 
230
230
  ---
231
231
 
232
- - **v0**
233
-
234
- ```yaml
235
- apiVersion: v1
236
- proxy:
237
- name: 'Musical Instruments'
238
- basePath: /api/v1
239
- swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
240
- policy:
241
- type: api-key
242
- app: 'Sample App'
243
- tags: ['musical', 'instruments']
244
- team:
245
- name: 'Default Team'
246
- ```
247
-
248
- - **v1**
249
-
250
- ```yaml
251
- apiVersion: v1
252
- version: v1
253
- proxy:
254
- name: 'Musical Instruments'
255
- basePath: /api/v1
256
- swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
257
- policies:
258
- clientAuth:
259
- type: api-key
260
- app: 'Sample App'
261
- backendAuth:
262
- type: auth-http-basic
263
- username: Joe
264
- password: changeme
265
- rateLimit:
266
- perProxy: 5
267
- perProxyAndApp: 3
268
- apps:
269
- - name: 'Second Sample App'
270
- team:
271
- name: 'Default Team'
272
- ```
273
-
274
- ---
275
-
276
232
  ## GET
277
233
 
278
234
  Prints a table of the most important information about the specified resources.
@@ -37,10 +37,12 @@ class GitHubDataplaneConfig extends DataplaneConfig {
37
37
  }
38
38
  }
39
39
  class GitHubFilterConfig {
40
- constructor(paths, pattern) {
40
+ constructor(paths, branch, pattern) {
41
41
  _defineProperty(this, "paths", void 0);
42
+ _defineProperty(this, "branch", void 0);
42
43
  _defineProperty(this, "pattern", void 0);
43
44
  this.paths = paths;
45
+ this.branch = branch;
44
46
  this.pattern = pattern;
45
47
  }
46
48
  }
@@ -53,6 +55,7 @@ class SaasAgentValues {
53
55
  _defineProperty(this, "centralConfig", void 0);
54
56
  _defineProperty(this, "repositoryOwner", void 0);
55
57
  _defineProperty(this, "repositoryName", void 0);
58
+ _defineProperty(this, "repositoryBranch", void 0);
56
59
  _defineProperty(this, "filePaths", void 0);
57
60
  _defineProperty(this, "filePatterns", void 0);
58
61
  this.frequencyDA = '';
@@ -62,6 +65,7 @@ class SaasAgentValues {
62
65
  this.centralConfig = new _types.CentralAgentConfig();
63
66
  this.repositoryOwner = '';
64
67
  this.repositoryName = '';
68
+ this.repositoryBranch = '';
65
69
  this.filePaths = [];
66
70
  this.filePatterns = [];
67
71
  }
@@ -88,6 +92,7 @@ const SaasPrompts = {
88
92
  ACCESS_TOKEN: 'Enter the GitHub Access Token the agent will use',
89
93
  REPOSITORY_OWNER: 'Enter the GitHub Repository Owner the agent will use',
90
94
  REPOSITORY_NAME: 'Enter the Repository Name the agent will use',
95
+ REPOSITORY_BRANCH: 'Enter the Repository Branch the agent will use',
91
96
  FILE_PATHS: 'Enter a File Path within the repository that the agent will use',
92
97
  FILE_PATTERNS: 'Enter a File Pattern that the agent will use (Optional)',
93
98
  DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
@@ -166,7 +171,13 @@ const gatewayConnectivity = async installConfig => {
166
171
  hostedAgentValues.repositoryName = await (0, _basicPrompts.askInput)({
167
172
  msg: SaasPrompts.REPOSITORY_NAME,
168
173
  defaultValue: hostedAgentValues.repositoryName !== '' ? hostedAgentValues.repositoryName : undefined,
169
- validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.gitHubRepositoryOwnerRegex, helpers.invalidValueExampleErrMsg('Repository Name', 'axway-github-repo-name'))
174
+ validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.gitHubRepositoryNameRegex, helpers.invalidValueExampleErrMsg('Repository Name', 'axway-github-repo-name'))
175
+ });
176
+
177
+ // get repository branch
178
+ hostedAgentValues.repositoryBranch = await (0, _basicPrompts.askInput)({
179
+ msg: SaasPrompts.REPOSITORY_BRANCH,
180
+ defaultValue: hostedAgentValues.repositoryBranch !== '' ? hostedAgentValues.repositoryBranch : undefined
170
181
  });
171
182
 
172
183
  // get File Paths
@@ -241,7 +252,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
241
252
  production: installConfig.centralConfig.production
242
253
  }) : installConfig.centralConfig.ampcEnvInfo.name;
243
254
  if (installConfig.gatewayType === _types.GatewayTypes.GITHUB) {
244
- gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.filePatterns));
255
+ gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.repositoryBranch, gitHubAgentValues.filePatterns));
245
256
  }
246
257
 
247
258
  // create the data plane resource
@@ -31,13 +31,13 @@ const AWSRegexPatterns = exports.AWSRegexPatterns = {
31
31
  AWS_REGEXP_ACCESS_KEY_ID: '((?:ASIA|AKIA|AROA|AIDA)([A-Z0-7]{16}))',
32
32
  AWS_REGEXP_SECRET_ACCESS_KEY: '[a-zA-Z0-9+/]{40}',
33
33
  AWS_REGEXP_ROLE_ARN: '^arn:aws[a-zA-Z-]*:iam::\\d{12}:role\\/?[a-zA-Z0-9+=,.@\\-_\\/]{1,128}$',
34
- AWS_ACCESS_LOG_ARN: '^arn:aws[a-zA-Z-]*:logs:[a-zA-Z0-9-]*:\\d{12}:log-group:[a-zA-Z0-9_\\-\\/\\.#]{1,512}$'
34
+ AWS_ACCESS_LOG_ARN: '^arn:aws[a-zA-Z-]*:logs:[a-zA-Z0-9\-]*:\\d{12}:log-group:[a-zA-Z0-9_\\-\\/\\.#]{1,512}$'
35
35
  };
36
36
 
37
37
  // APIGEEXRegexPatterns - regex patters to validate user inputs
38
38
  const APIGEEXRegexPatterns = exports.APIGEEXRegexPatterns = {
39
39
  APIGEEX_REGEXP_PROJECT_ID: '^[a-z][a-z0-9-]{4,28}[a-z0-9]$',
40
- AWS_REGEXP_EMAIL_ADDRESS: '^(([^<>()[]\\.,;:s@"]+(.[^<>()[]\\.,;:s@"]+)*)|.(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$'
40
+ AWS_REGEXP_EMAIL_ADDRESS: '^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
41
41
  };
42
42
 
43
43
  // AzureRegexPatterns - regex patters to validate user inputs
@@ -49,12 +49,12 @@ const AzureRegexPatterns = exports.AzureRegexPatterns = {
49
49
  const GitHubRegexPatterns = exports.GitHubRegexPatterns = {
50
50
  gitHubAccessTokenRegex: '^ghp_[a-zA-Z0-9]{36}$',
51
51
  gitHubRepositoryOwnerRegex: '^(?!-)(?!.*--)[a-zA-Z0-9-]{1,37}(?<!-)$',
52
- gitHubRepositoryNameRegex: '^[w-.]+$',
53
- gitHubFilePathRegex: '^/.*$'
52
+ gitHubRepositoryNameRegex: '^[\\w-\\.]+$',
53
+ gitHubFilePathRegex: '^\/.*$'
54
54
  };
55
55
  const GitLabRegexPatterns = exports.GitLabRegexPatterns = {
56
- gitLabAccessTokenRegex: '^[0-9a-zA-Z-]{20}$',
57
- gitLabBaseURLRegex: '^(http://|https://)[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$',
56
+ gitLabAccessTokenRegex: '^[0-9a-zA-Z\-]{20}$',
57
+ gitLabBaseURLRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$',
58
58
  gitHubRepositoryIDRegex: '^[0-9]*$',
59
- gitLabPathRegex: '^/.*$'
59
+ gitLabPathRegex: '^\/.*$'
60
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.23.0",
3
+ "version": "2.24.0",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {