@axway/axway-central-cli 3.6.0-rc.1 → 3.6.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 +25 -1
- package/dist/commands/delete/index.js +1 -1
- package/dist/commands/install/agents.js +3 -1
- package/dist/commands/install/backstageAgents.js +168 -0
- package/dist/commands/install/helpers/index.js +2 -1
- package/dist/commands/install/helpers/templates/backstageTemplates.js +95 -0
- package/dist/common/types.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -308,7 +308,8 @@ GET OPTIONS:
|
|
|
308
308
|
--attribute [key=value] Attribute in key=value pair format to filter by
|
|
309
309
|
--no-cache Do not use cache when communicating with the server
|
|
310
310
|
--account [value] Override your default account config
|
|
311
|
-
--language
|
|
311
|
+
--language=[langCode] Show the language detail of the retruned object. One of: * | fr-fr | en-us | de-de | pt-br
|
|
312
|
+
--languageDefinition=[langCode] Show the language definition constraint of the returned object. One of: fr-fr | en-us | de-de | pt-br
|
|
312
313
|
-o, --output [value] Additional output formats. One of: yaml | json
|
|
313
314
|
-q, --query [RSQL query] RSQL-formatted query to search for filters that match specific parameters
|
|
314
315
|
--region [value] Override your region config
|
|
@@ -354,6 +355,22 @@ axway central get assets --tag tag1
|
|
|
354
355
|
axway central get assets --attribute location=arizona
|
|
355
356
|
# get assets and filter the list with a combination of title, tag and attribute filters
|
|
356
357
|
axway central get assets --title test --tag tag1 --attribute location=arizona
|
|
358
|
+
# To get a product with name "test-product" with French language translation if available in YAML format
|
|
359
|
+
axway central get products test-product --language="fr-fr" -o yaml
|
|
360
|
+
# To get a product with name "test-product" with German language translation if available in YAML format
|
|
361
|
+
axway central get products test-product --language="de-de" -o yaml
|
|
362
|
+
# To get a product with name "test-product" with US English language translation if available in YAML format
|
|
363
|
+
axway central get products test-product --language="en-us" -o yaml
|
|
364
|
+
# To get a product with name "test-product" with Portugal language translation if available in YAML format
|
|
365
|
+
axway central get products test-product --language="pt-br" -o yaml
|
|
366
|
+
# To get a stage with name "demo-stage" with the French language translation in JSON format
|
|
367
|
+
axway central get stages demo-stage --languageDefinition="fr-fr" -o json
|
|
368
|
+
# To get a stage with name "demo-stage" with the US English language translation in JSON format
|
|
369
|
+
axway central get stages demo-stage --languageDefinition="en-us" -o json
|
|
370
|
+
# To get a stage with name "demo-stage" with the German language translation in JSON format
|
|
371
|
+
axway central get stages demo-stage --languageDefinition="de-de" -o json
|
|
372
|
+
# To get a stage with name "demo-stage" with the Portugese language translation in JSON format
|
|
373
|
+
axway central get stages demo-stage --languageDefinition="pt-br" -o json
|
|
357
374
|
```
|
|
358
375
|
|
|
359
376
|
---
|
|
@@ -491,6 +508,7 @@ DELETE OPTIONS:
|
|
|
491
508
|
-s, --scope [name] or [kind/name] Scope name or kind/name for scoped resources.
|
|
492
509
|
--wait Wait for the resources to be completely deleted.
|
|
493
510
|
-y, --yes Automatically reply "yes" to any command prompts.
|
|
511
|
+
--forceDelete Force delete a resource (Warning: Ignores finalizers on the resource and the resources scoped under it)
|
|
494
512
|
```
|
|
495
513
|
|
|
496
514
|
### delete examples
|
|
@@ -506,6 +524,12 @@ axway central delete docs somedoc -s somescope -y
|
|
|
506
524
|
axway central delete docs somedoc -s AssetRelease/somescope -y
|
|
507
525
|
# delete all resources specified in the file
|
|
508
526
|
axway central delete -f ./some/folder/resources.yaml
|
|
527
|
+
# force delete environment by name with a prompt
|
|
528
|
+
axway central delete environment newenv --forceDelete
|
|
529
|
+
# force delete API service by name (a scoped resource) with a prompt
|
|
530
|
+
axway central delete apisvc someapisvc -s newenv --forceDelete
|
|
531
|
+
# force delete all resources specified in the file without a prompt
|
|
532
|
+
axway central delete -f ./some/folder/resources.yaml --forceDelete --yes
|
|
509
533
|
```
|
|
510
534
|
|
|
511
535
|
---
|
|
@@ -191,6 +191,6 @@ const deleteCmd = exports.deleteCmd = {
|
|
|
191
191
|
},
|
|
192
192
|
'-y, --yes': 'Automatically reply "yes" to any command prompts.',
|
|
193
193
|
'--wait': 'Wait for the resources to be completely deleted.',
|
|
194
|
-
'--forceDelete': 'Force delete a resource (Warning: Ignores finalizers)'
|
|
194
|
+
'--forceDelete': 'Force delete a resource (Warning: Ignores finalizers on the resource and the resources scoped under it)'
|
|
195
195
|
}
|
|
196
196
|
};
|
|
@@ -32,6 +32,7 @@ var ibmAPIConnectAgent = _interopRequireWildcard(require("./ibmAPIConnectAgents"
|
|
|
32
32
|
var softwareAGWebMethodsAgent = _interopRequireWildcard(require("./softwareAGWebMethodsAgents"));
|
|
33
33
|
var traceableAgent = _interopRequireWildcard(require("./traceableAgents"));
|
|
34
34
|
var platform = _interopRequireWildcard(require("./platform"));
|
|
35
|
+
var backstageAgent = _interopRequireWildcard(require("./backstageAgents"));
|
|
35
36
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
36
37
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
37
38
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -55,7 +56,8 @@ const agentInstallFlows = {
|
|
|
55
56
|
[_types.GatewayTypes.GRAYLOG]: graylogAgent.GraylogInstallMethods,
|
|
56
57
|
[_types.GatewayTypes.IBMAPICONNECT]: ibmAPIConnectAgent.IBMAPIConnectInstallMethods,
|
|
57
58
|
[_types.GatewayTypes.SOFTWAREAGWEBMETHODS]: softwareAGWebMethodsAgent.SoftwareAGWebMethodsInstallMethods,
|
|
58
|
-
[_types.GatewayTypes.TRACEABLE]: traceableAgent.TraceableInstallMethods
|
|
59
|
+
[_types.GatewayTypes.TRACEABLE]: traceableAgent.TraceableInstallMethods,
|
|
60
|
+
[_types.GatewayTypes.BACKSTAGE]: backstageAgent.BackstageInstallMethods
|
|
59
61
|
};
|
|
60
62
|
const saasAgentInstallFlows = {
|
|
61
63
|
[_types.SaaSGatewayTypes.AWS_GATEWAY]: awsSaaSAgents.AWSSaaSInstallMethods,
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.testables = exports.gatewayConnectivity = exports.defaultLogFiles = exports.completeInstall = exports.askConfigType = exports.askBundleType = exports.ConfigFiles = exports.BackstageInstallMethods = 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 _backstageTemplates = require("./helpers/templates/backstageTemplates");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const {
|
|
19
|
+
log
|
|
20
|
+
} = (0, _snooplogg.default)('central: install: agents: backstage');
|
|
21
|
+
const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.BACKSTAGE_DA}`;
|
|
22
|
+
const defaultLogFiles = exports.defaultLogFiles = '/group-*_instance-*.log';
|
|
23
|
+
|
|
24
|
+
// ConfigFiles - all the config file that are used in the setup
|
|
25
|
+
const ConfigFiles = exports.ConfigFiles = {
|
|
26
|
+
DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`,
|
|
27
|
+
BackstageDABinaryFile: 'discovery_agent',
|
|
28
|
+
BackstageDAYaml: 'discovery_agent.yml'
|
|
29
|
+
};
|
|
30
|
+
const BackstagePrompts = {
|
|
31
|
+
enterUrlHost: 'Enter the host of the URL for connecting to Backstage',
|
|
32
|
+
selectUrlScheme: 'Select the scheme of the URL for connecting to Backstage',
|
|
33
|
+
enterBackendPort: '(Optional) Enter the backend port of the URL for connecting to Backstage',
|
|
34
|
+
enterUrlPath: '(Optional) Enter the path of the URL for connecting to Backstage',
|
|
35
|
+
selectAuthMode: 'Select the authentication type for connecting to Backstage',
|
|
36
|
+
enterStaticTokenValue: 'Enter the static token value',
|
|
37
|
+
enterJwksClientID: 'Enter the ClientID for the JWKS Auth Flow',
|
|
38
|
+
enterJwksClientSecret: 'Enter the ClientSecret for the JWKS Auth Flow',
|
|
39
|
+
enterJwksTokenURL: 'Enter TokenURL for the JWKS Auth Flow'
|
|
40
|
+
};
|
|
41
|
+
const askBundleType = async () => {
|
|
42
|
+
// Backstage agent has only DA
|
|
43
|
+
return _types.BundleType.DISCOVERY;
|
|
44
|
+
};
|
|
45
|
+
exports.askBundleType = askBundleType;
|
|
46
|
+
const askConfigType = async () => {
|
|
47
|
+
return _types.AgentConfigTypes.DOCKERIZED;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//
|
|
51
|
+
// Questions for the configuration of Backstage agent
|
|
52
|
+
//
|
|
53
|
+
exports.askConfigType = askConfigType;
|
|
54
|
+
const askBackstageUrlHost = async () => await (0, _basicPrompts.askInput)({
|
|
55
|
+
msg: BackstagePrompts.enterUrlHost
|
|
56
|
+
});
|
|
57
|
+
const askBackstageUrlScheme = async () => await (0, _basicPrompts.askList)({
|
|
58
|
+
msg: BackstagePrompts.selectUrlScheme,
|
|
59
|
+
choices: [_backstageTemplates.UrlScheme.HTTP, _backstageTemplates.UrlScheme.HTTPS]
|
|
60
|
+
});
|
|
61
|
+
const askBackstageUrlBackendPort = async () => await (0, _basicPrompts.askInput)({
|
|
62
|
+
msg: BackstagePrompts.enterBackendPort,
|
|
63
|
+
allowEmptyInput: true
|
|
64
|
+
});
|
|
65
|
+
const askBackstageUrlPath = async () => await (0, _basicPrompts.askInput)({
|
|
66
|
+
msg: BackstagePrompts.enterUrlPath,
|
|
67
|
+
allowEmptyInput: true
|
|
68
|
+
});
|
|
69
|
+
const askBackstageAuthMode = async () => await (0, _basicPrompts.askList)({
|
|
70
|
+
msg: BackstagePrompts.selectAuthMode,
|
|
71
|
+
choices: [{
|
|
72
|
+
name: "No auth",
|
|
73
|
+
value: _backstageTemplates.AuthMode.NoAuth
|
|
74
|
+
}, _backstageTemplates.AuthMode.Guest, _backstageTemplates.AuthMode.StaticToken, _backstageTemplates.AuthMode.Jwks]
|
|
75
|
+
});
|
|
76
|
+
const askBackstageAuthStaticToken = async () => await (0, _basicPrompts.askInput)({
|
|
77
|
+
msg: BackstagePrompts.enterStaticTokenValue
|
|
78
|
+
});
|
|
79
|
+
const askBaskstageAuthJwksClientID = async () => await (0, _basicPrompts.askInput)({
|
|
80
|
+
msg: BackstagePrompts.enterJwksClientID
|
|
81
|
+
});
|
|
82
|
+
const askBaskstageAuthJwksClientSecret = async () => await (0, _basicPrompts.askInput)({
|
|
83
|
+
msg: BackstagePrompts.enterJwksClientSecret
|
|
84
|
+
});
|
|
85
|
+
const askBaskstageAuthJwksTokenUrl = async () => await (0, _basicPrompts.askInput)({
|
|
86
|
+
msg: BackstagePrompts.enterJwksTokenURL
|
|
87
|
+
});
|
|
88
|
+
const gatewayConnectivity = async () => {
|
|
89
|
+
const backstageAgentValues = new _backstageTemplates.BackstageAgentValues();
|
|
90
|
+
console.log('\nCONNECTION TO Backstage:');
|
|
91
|
+
console.log(_chalk.default.gray(`The discovery agent needs to connect to Backstage to discover API's for publishing to Amplify.`));
|
|
92
|
+
await askPrompts(backstageAgentValues);
|
|
93
|
+
return backstageAgentValues;
|
|
94
|
+
};
|
|
95
|
+
exports.gatewayConnectivity = gatewayConnectivity;
|
|
96
|
+
const generateSuccessHelpMsg = installConfig => {
|
|
97
|
+
console.log(_chalk.default.yellow('\nPlease make sure to copy the "private_key.pem" and "public_key.pem" files for the existing service account you selected.'));
|
|
98
|
+
dockerSuccessMsg(installConfig);
|
|
99
|
+
console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.BACKSTAGE}`));
|
|
100
|
+
};
|
|
101
|
+
const dockerSuccessMsg = installConfig => {
|
|
102
|
+
let dockerInfo;
|
|
103
|
+
const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
104
|
+
const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
105
|
+
const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
|
|
106
|
+
const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
|
|
107
|
+
dockerInfo = `To utilize the agents, pull the latest Docker images and run them using the appropriate supplied environment files, (${helpers.configFiles.DA_ENV_VARS}:`;
|
|
108
|
+
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
109
|
+
const daImageVersion = `${daImage}:${installConfig.daVersion}`;
|
|
110
|
+
console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
|
|
111
|
+
console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
|
|
112
|
+
console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
|
|
113
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
|
|
114
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
|
|
115
|
+
};
|
|
116
|
+
async function askPrompts(values) {
|
|
117
|
+
values.host = await askBackstageUrlHost();
|
|
118
|
+
values.scheme = await askBackstageUrlScheme();
|
|
119
|
+
values.backendPort = await askBackstageUrlBackendPort();
|
|
120
|
+
values.urlPath = await askBackstageUrlPath();
|
|
121
|
+
values.authMode = await askBackstageAuthMode();
|
|
122
|
+
switch (values.authMode) {
|
|
123
|
+
case _backstageTemplates.AuthMode.StaticToken:
|
|
124
|
+
{
|
|
125
|
+
values.staticTokenValue = await askBackstageAuthStaticToken();
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case _backstageTemplates.AuthMode.Jwks:
|
|
129
|
+
{
|
|
130
|
+
values.jwksClientID = await askBaskstageAuthJwksClientID();
|
|
131
|
+
values.jwksClientSecret = await askBaskstageAuthJwksClientSecret();
|
|
132
|
+
values.jwksTokenURL = await askBaskstageAuthJwksTokenUrl();
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return values;
|
|
137
|
+
}
|
|
138
|
+
const completeInstall = async installConfig => {
|
|
139
|
+
/**
|
|
140
|
+
* Create agent resources
|
|
141
|
+
*/
|
|
142
|
+
const backstageAgentValues = installConfig.gatewayConfig;
|
|
143
|
+
|
|
144
|
+
// Add final settings
|
|
145
|
+
backstageAgentValues.centralConfig = installConfig.centralConfig;
|
|
146
|
+
console.log('Generating the configuration file(s)...');
|
|
147
|
+
(0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, backstageAgentValues, _backstageTemplates.backstageDAEnvVarTemplate);
|
|
148
|
+
console.log('Configuration file(s) have been successfully created.\n');
|
|
149
|
+
generateSuccessHelpMsg(installConfig);
|
|
150
|
+
};
|
|
151
|
+
exports.completeInstall = completeInstall;
|
|
152
|
+
const BackstageInstallMethods = exports.BackstageInstallMethods = {
|
|
153
|
+
GetBundleType: askBundleType,
|
|
154
|
+
GetDeploymentType: askConfigType,
|
|
155
|
+
AskGatewayQuestions: gatewayConnectivity,
|
|
156
|
+
FinalizeGatewayInstall: completeInstall,
|
|
157
|
+
ConfigFiles: Object.values(ConfigFiles),
|
|
158
|
+
AgentNameMap: {
|
|
159
|
+
[_types.AgentTypes.da]: _types.AgentNames.BACKSTAGE_DA,
|
|
160
|
+
[_types.AgentTypes.ta]: _types.AgentNames.BACKSTAGE_DA
|
|
161
|
+
},
|
|
162
|
+
GatewayDisplay: _types.GatewayTypes.BACKSTAGE
|
|
163
|
+
};
|
|
164
|
+
const testables = exports.testables = {
|
|
165
|
+
BackstagePrompts,
|
|
166
|
+
ConfigFiles,
|
|
167
|
+
defaultLogFiles
|
|
168
|
+
};
|
|
@@ -233,7 +233,8 @@ const agentsDocsUrl = exports.agentsDocsUrl = {
|
|
|
233
233
|
GRAYLOG: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html',
|
|
234
234
|
IBMAPICONNECT: '',
|
|
235
235
|
SOFTWAREAGWEBMETHODS: '',
|
|
236
|
-
TRACEABLE: ''
|
|
236
|
+
TRACEABLE: '',
|
|
237
|
+
BACKSTAGE: ''
|
|
237
238
|
};
|
|
238
239
|
|
|
239
240
|
// export * from './updaters';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.backstageDAEnvVarTemplate = exports.UrlScheme = exports.BackstageAgentValues = exports.AuthMode = void 0;
|
|
7
|
+
var _types = require("../../../../common/types");
|
|
8
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
/**
|
|
12
|
+
* @description Parameters to provide to the Backstage handlebars templates.
|
|
13
|
+
*/
|
|
14
|
+
class BackstageAgentValues {
|
|
15
|
+
constructor() {
|
|
16
|
+
_defineProperty(this, "host", void 0);
|
|
17
|
+
_defineProperty(this, "scheme", void 0);
|
|
18
|
+
_defineProperty(this, "backendPort", void 0);
|
|
19
|
+
_defineProperty(this, "urlPath", void 0);
|
|
20
|
+
_defineProperty(this, "authMode", void 0);
|
|
21
|
+
_defineProperty(this, "staticTokenValue", void 0);
|
|
22
|
+
_defineProperty(this, "jwksClientID", void 0);
|
|
23
|
+
_defineProperty(this, "jwksClientSecret", void 0);
|
|
24
|
+
_defineProperty(this, "jwksTokenURL", void 0);
|
|
25
|
+
_defineProperty(this, "centralConfig", void 0);
|
|
26
|
+
this.host = '';
|
|
27
|
+
this.scheme = UrlScheme.HTTP;
|
|
28
|
+
this.backendPort = 0;
|
|
29
|
+
this.urlPath = '';
|
|
30
|
+
this.authMode = AuthMode.NoAuth;
|
|
31
|
+
this.staticTokenValue = '';
|
|
32
|
+
this.jwksClientID = '';
|
|
33
|
+
this.jwksClientSecret = '';
|
|
34
|
+
this.jwksTokenURL = '';
|
|
35
|
+
this.centralConfig = new _types.CentralAgentConfig();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.BackstageAgentValues = BackstageAgentValues;
|
|
39
|
+
let UrlScheme = exports.UrlScheme = /*#__PURE__*/function (UrlScheme) {
|
|
40
|
+
UrlScheme["HTTP"] = "http";
|
|
41
|
+
UrlScheme["HTTPS"] = "https";
|
|
42
|
+
return UrlScheme;
|
|
43
|
+
}({});
|
|
44
|
+
let AuthMode = exports.AuthMode = /*#__PURE__*/function (AuthMode) {
|
|
45
|
+
AuthMode["NoAuth"] = "";
|
|
46
|
+
AuthMode["Guest"] = "guest";
|
|
47
|
+
AuthMode["StaticToken"] = "token";
|
|
48
|
+
AuthMode["Jwks"] = "jwks";
|
|
49
|
+
return AuthMode;
|
|
50
|
+
}({});
|
|
51
|
+
/**
|
|
52
|
+
* @description Generates the Backstage DA env vars file.
|
|
53
|
+
*/
|
|
54
|
+
const backstageDAEnvVarTemplate = () => {
|
|
55
|
+
return `# Backstage configs
|
|
56
|
+
BACKSTAGE_URL_SCHEME={{scheme}}
|
|
57
|
+
BACKSTAGE_URL_HOST={{host}}
|
|
58
|
+
{{#compare . backendPort 0 operator=">="}}
|
|
59
|
+
BACKSTAGE_URL_BACKENDPORT={{backendPort}}
|
|
60
|
+
{{/compare}}
|
|
61
|
+
{{#compare . urlPart ""}}
|
|
62
|
+
BACKSTAGE_URL_PATH={{urlPath}}
|
|
63
|
+
{{/compare}}
|
|
64
|
+
{{#compare . authMode "" operator="!="}}
|
|
65
|
+
BACKSTAGE_AUTH_MODE={{authMode}}
|
|
66
|
+
{{/compare}}
|
|
67
|
+
{{#compare . authMode "token"}}
|
|
68
|
+
BACKSTAGE_AUTH_STATICTOKEN={{staticTokenValue}}
|
|
69
|
+
{{/compare}}
|
|
70
|
+
{{#compare . authMode "jwks"}}
|
|
71
|
+
BACKSTAGE_AUTH_CLIENTID={{jwksClientID}}
|
|
72
|
+
BACKSTAGE_AUTH_CLIENTSECRET={{jwksClientSecret}}
|
|
73
|
+
BACKSTAGE_AUTH_TOKENURL={{jwksTokenURL}}
|
|
74
|
+
{{/compare}}
|
|
75
|
+
|
|
76
|
+
# Amplify Central configs
|
|
77
|
+
CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
|
|
78
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
79
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
80
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
81
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
82
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
83
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
84
|
+
CENTRAL_REGION={{centralConfig.region}}
|
|
85
|
+
|
|
86
|
+
# Logging configs
|
|
87
|
+
# Define the logging level: info, debug, error
|
|
88
|
+
LOG_LEVEL=info
|
|
89
|
+
# Specify where to send the log: stdout, file, both
|
|
90
|
+
LOG_OUTPUT=stdout
|
|
91
|
+
# Define where the log files are written
|
|
92
|
+
LOG_FILE_PATH=logs
|
|
93
|
+
`;
|
|
94
|
+
};
|
|
95
|
+
exports.backstageDAEnvVarTemplate = backstageDAEnvVarTemplate;
|
package/dist/common/types.js
CHANGED
|
@@ -239,6 +239,7 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
239
239
|
AgentNames["TRACEABLE_TA"] = "traceable-agent";
|
|
240
240
|
AgentNames["SOFTWAREAGWEBMETHODS_DA"] = "software-ag-web-methods-discovery-agent";
|
|
241
241
|
AgentNames["SOFTWAREAGWEBMETHODS_TA"] = "software-ag-web-methods-traceability-agent";
|
|
242
|
+
AgentNames["BACKSTAGE_DA"] = "backstage-discovery-agent";
|
|
242
243
|
return AgentNames;
|
|
243
244
|
}({});
|
|
244
245
|
let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
@@ -254,6 +255,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
|
254
255
|
GatewayTypes["IBMAPICONNECT"] = "IBM API Connect";
|
|
255
256
|
GatewayTypes["SOFTWAREAGWEBMETHODS"] = "Software AG WebMethods";
|
|
256
257
|
GatewayTypes["TRACEABLE"] = "Traceable";
|
|
258
|
+
GatewayTypes["BACKSTAGE"] = "Backstage";
|
|
257
259
|
return GatewayTypes;
|
|
258
260
|
}({});
|
|
259
261
|
let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGatewayTypes) {
|
|
@@ -278,6 +280,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
|
|
|
278
280
|
DataPlaneNames["SWAGGERHUB"] = "SwaggerHub";
|
|
279
281
|
DataPlaneNames["TRACEABLE"] = "Traceable";
|
|
280
282
|
DataPlaneNames["MULESOFT"] = "Mulesoft";
|
|
283
|
+
DataPlaneNames["BACKSTAGE"] = "Backstage";
|
|
281
284
|
DataPlaneNames["OTHER"] = "Unidentified";
|
|
282
285
|
return DataPlaneNames;
|
|
283
286
|
}({});
|
|
@@ -296,7 +299,8 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
296
299
|
[SaaSGatewayTypes.SWAGGERHUB]: DataPlaneNames.SWAGGERHUB,
|
|
297
300
|
[GatewayTypes.GRAYLOG]: DataPlaneNames.GRAYLOG,
|
|
298
301
|
[GatewayTypes.IBMAPICONNECT]: DataPlaneNames.IBMAPICONNECT,
|
|
299
|
-
[GatewayTypes.TRACEABLE]: DataPlaneNames.TRACEABLE
|
|
302
|
+
[GatewayTypes.TRACEABLE]: DataPlaneNames.TRACEABLE,
|
|
303
|
+
[GatewayTypes.BACKSTAGE]: DataPlaneNames.BACKSTAGE
|
|
300
304
|
};
|
|
301
305
|
let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
|
|
302
306
|
AgentResourceKind["da"] = "DiscoveryAgent";
|