@axway/axway-central-cli 2.8.0-rc.0 → 2.8.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.
|
@@ -13,6 +13,8 @@ var _basicPrompts = require("../../../common/basicPrompts");
|
|
|
13
13
|
|
|
14
14
|
var _Kubectl = require("../../../common/Kubectl");
|
|
15
15
|
|
|
16
|
+
var _PlatformClient = require("../../../common/PlatformClient");
|
|
17
|
+
|
|
16
18
|
var _types = require("../../../common/types");
|
|
17
19
|
|
|
18
20
|
var _getters = require("./getters");
|
|
@@ -88,7 +90,7 @@ exports.askServiceAccountName = askServiceAccountName;
|
|
|
88
90
|
|
|
89
91
|
const askDosaClientId = async (client, showWarning = true) => {
|
|
90
92
|
// Fetch all existing service accounts.
|
|
91
|
-
const serviceAccounts = await client.getServiceAccounts();
|
|
93
|
+
const serviceAccounts = await client.getServiceAccounts(_PlatformClient.PlatformServiceAccountRole.ApiCentralAdmin);
|
|
92
94
|
const serviceAccountNames = serviceAccounts.map(nextAccount => nextAccount.name); // Ask user to select an existing service account or create a new one.
|
|
93
95
|
|
|
94
96
|
const selectedName = await (0, _basicPrompts.askList)({
|
|
@@ -124,7 +124,7 @@ CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
|
124
124
|
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
125
125
|
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
126
126
|
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
127
|
-
{{#compare centralConfig.ampcTeamName
|
|
127
|
+
{{#compare . centralConfig.ampcTeamName "" operator="!=" }}
|
|
128
128
|
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
129
129
|
{{/compare}}
|
|
130
130
|
{{#compare . centralConfig.region "EU"}}
|
|
@@ -197,8 +197,8 @@ env:
|
|
|
197
197
|
CENTRAL_DEPLOYMENT: {{centralConfig.deployment}}
|
|
198
198
|
CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
|
|
199
199
|
CENTRAL_ORGANIZATIONID: "{{centralConfig.ampcTeamName}}"
|
|
200
|
-
{{#compare centralConfig.ampcTeamName
|
|
201
|
-
CENTRAL_TEAM
|
|
200
|
+
{{#compare . centralConfig.ampcTeamName "" operator="!=" }}
|
|
201
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
202
202
|
{{/compare}}
|
|
203
203
|
CENTRAL_URL: {{centralConfig.url}}
|
|
204
204
|
EVENT_LOG_FILE_PATHS: /events/*.log
|
|
@@ -270,7 +270,7 @@ CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
|
270
270
|
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
271
271
|
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
272
272
|
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
273
|
-
{{#compare centralConfig.ampcTeamName
|
|
273
|
+
{{#compare . centralConfig.ampcTeamName "" operator="!=" }}
|
|
274
274
|
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
275
275
|
{{/compare}}
|
|
276
276
|
{{#compare . centralConfig.region "EU"}}
|
|
@@ -321,8 +321,8 @@ env:
|
|
|
321
321
|
CENTRAL_AUTH_URL: {{centralConfig.authUrl}}
|
|
322
322
|
CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
|
|
323
323
|
CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
|
|
324
|
-
{{#compare centralConfig.ampcTeamName
|
|
325
|
-
CENTRAL_TEAM
|
|
324
|
+
{{#compare . centralConfig.ampcTeamName "" operator="!=" }}
|
|
325
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
326
326
|
{{/compare}}
|
|
327
327
|
CENTRAL_URL: {{centralConfig.url}}
|
|
328
328
|
LOG_LEVEL: info
|
|
@@ -155,9 +155,16 @@ class PlatformClient {
|
|
|
155
155
|
return result.client;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
async getServiceAccounts() {
|
|
158
|
+
async getServiceAccounts(filterRole) {
|
|
159
159
|
const result = await _classPrivateFieldGet(this, _amplifySdk).client.list(await this.getAccountInfo());
|
|
160
|
-
|
|
160
|
+
let clients = result.clients || [];
|
|
161
|
+
|
|
162
|
+
if (filterRole) {
|
|
163
|
+
log('filter clients by ', filterRole);
|
|
164
|
+
clients = clients.filter(client => client === null || client === void 0 ? void 0 : client.roles.find(r => r === filterRole));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return clients;
|
|
161
168
|
}
|
|
162
169
|
|
|
163
170
|
async getTeams() {
|
|
@@ -63,9 +63,11 @@ const parseAsTable = (response, columns) => {
|
|
|
63
63
|
|
|
64
64
|
for (const i of data) {
|
|
65
65
|
for (const col of columns) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (!col.hidden) {
|
|
67
|
+
// jsonPath starts with '.' so using the substring
|
|
68
|
+
const value = (0, _get.default)(i, col.jsonPath.substring(1));
|
|
69
|
+
t.cell(col.name.toUpperCase(), col.type === 'date' ? (0, _dayjs.default)(value).fromNow() : value);
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
t.newRow();
|
package/dist/common/types.js
CHANGED
|
@@ -13,7 +13,7 @@ const cliVersionHeader = 'x-axway-cli-version';
|
|
|
13
13
|
exports.cliVersionHeader = cliVersionHeader;
|
|
14
14
|
const docsUrl = 'https://docs.axway.com/bundle/amplify-central/page/docs/index.html';
|
|
15
15
|
exports.docsUrl = docsUrl;
|
|
16
|
-
const ABORT_TIMEOUT = process.env.NODE_ENV === 'test' ? 1e3 : 30e3;
|
|
16
|
+
const ABORT_TIMEOUT = process.env.NODE_ENV === 'test' ? 1e3 : process.env.DEBUG || process.env.SNOOPLOGG ? 1e9 : 30e3;
|
|
17
17
|
exports.ABORT_TIMEOUT = ABORT_TIMEOUT;
|
|
18
18
|
const MAX_FILE_SIZE = process.env.NODE_ENV === 'test' ? 1e5 : 20 * 1024 * 1024;
|
|
19
19
|
exports.MAX_FILE_SIZE = MAX_FILE_SIZE;
|