@axway/axway-central-cli 2.32.0 → 3.0.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 +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/apply/index.js +1 -1
- package/dist/commands/completion/index.js +0 -1
- package/dist/commands/config/common/index.js +1 -1
- package/dist/commands/config/set.js +1 -1
- package/dist/commands/config/unset.js +1 -1
- package/dist/commands/create/agentResource.js +1 -1
- package/dist/commands/create/environment.js +1 -1
- package/dist/commands/create/index.js +1 -1
- package/dist/commands/delete/index.js +1 -1
- package/dist/commands/edit/environment.js +1 -1
- package/dist/commands/get/index.js +1 -1
- package/dist/commands/install/agents.js +3 -3
- package/dist/commands/install/apigeexSaasAgents.js +6 -7
- package/dist/commands/install/awsAgents.js +3 -3
- package/dist/commands/install/awsSaasAgents.js +6 -6
- package/dist/commands/install/azureAgents.js +3 -3
- package/dist/commands/install/azureSaasAgents.js +6 -6
- package/dist/commands/install/edgeAgents.js +3 -3
- package/dist/commands/install/gitHubSaasAgents.js +6 -6
- package/dist/commands/install/gitLabAgents.js +3 -3
- package/dist/commands/install/graylogAgent.js +3 -3
- package/dist/commands/install/helpers/creators.js +1 -1
- package/dist/commands/install/helpers/deleters.js +1 -1
- package/dist/commands/install/helpers/getters.js +1 -1
- package/dist/commands/install/helpers/index.js +1 -1
- package/dist/commands/install/helpers/inputs.js +1 -1
- package/dist/commands/install/helpers/templates/awsTemplates.js +3 -3
- package/dist/commands/install/helpers/templates/azureTemplates.js +3 -3
- package/dist/commands/install/helpers/templates/edgeTemplates.js +3 -3
- package/dist/commands/install/helpers/templates/gitLabTemplates.js +5 -7
- package/dist/commands/install/helpers/templates/graylogTemplates.js +3 -3
- package/dist/commands/install/helpers/templates/ibmAPIConnectTemplates.js +3 -3
- package/dist/commands/install/helpers/templates/istioTemplates.js +4 -6
- package/dist/commands/install/helpers/templates/kafkaTemplates.js +3 -3
- package/dist/commands/install/ibmAPIConnectAgents.js +3 -3
- package/dist/commands/install/index.js +1 -1
- package/dist/commands/install/istioAgents.js +4 -4
- package/dist/commands/install/kafkaAgents.js +3 -3
- package/dist/commands/install/platform.js +3 -3
- package/dist/commands/install/swaggerHubSaasAgents.js +6 -6
- package/dist/common/ApiServerClient.js +4 -4
- package/dist/common/CacheController.js +4 -4
- package/dist/common/CliConfigManager.js +4 -4
- package/dist/common/CompositeError.js +10 -15
- package/dist/common/CoreConfigController.js +8 -8
- package/dist/common/DefinitionsManager.js +4 -4
- package/dist/common/Kubectl.js +1 -1
- package/dist/common/PlatformClient.js +24 -38
- package/dist/common/Renderer.js +13 -13
- package/dist/common/TmpFile.js +4 -4
- package/dist/common/bashCommands.js +1 -1
- package/dist/common/basicPrompts.js +1 -1
- package/dist/common/dataService.js +1 -1
- package/dist/common/resultsRenderers.js +1 -1
- package/dist/common/types.js +3 -3
- package/dist/common/utils.js +1 -2
- package/dist/main.js +1 -1
- package/package.json +2 -2
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.istioInstallTemplate = exports.istioAgentsTemplate = exports.IstioValues = void 0;
|
|
7
7
|
var _types = require("../../../../common/types");
|
|
8
|
-
function _defineProperty(
|
|
9
|
-
function _toPropertyKey(
|
|
10
|
-
function _toPrimitive(
|
|
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
11
|
/**
|
|
12
12
|
* @description Values for installing the Istio Agents
|
|
13
13
|
*/
|
|
@@ -33,13 +33,11 @@ const istioAgentsTemplate = () => {
|
|
|
33
33
|
global:
|
|
34
34
|
# Amplify Central config
|
|
35
35
|
central:
|
|
36
|
-
url: {{centralConfig.scheme}}://{{centralConfig.host}}
|
|
36
|
+
url: {{centralConfig.scheme}}://{{centralConfig.host}}
|
|
37
37
|
clientTimeout: 10s
|
|
38
38
|
envID: {{centralConfig.environmentId}}
|
|
39
39
|
envName: "{{centralConfig.environment}}"
|
|
40
40
|
tenantID: "{{centralConfig.orgId}}"
|
|
41
|
-
grpcEnabled: "true"
|
|
42
|
-
marketplaceProvisioningEnabled: "true"
|
|
43
41
|
auth:
|
|
44
42
|
baseUrl: "{{centralConfig.authUrl}}"
|
|
45
43
|
clientTimeout: 10s
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.kafkaTAEnvVarTemplate = exports.kafkaDAEnvVarTemplate = exports.KafkaAgentValues = void 0;
|
|
7
7
|
var _types = require("../../../../common/types");
|
|
8
|
-
function _defineProperty(
|
|
9
|
-
function _toPropertyKey(
|
|
10
|
-
function _toPrimitive(
|
|
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
11
|
/**
|
|
12
12
|
* @description Parameters to provide to the Kafka handlebars templates.
|
|
13
13
|
*/
|
|
@@ -11,9 +11,9 @@ var _types = require("../../common/types");
|
|
|
11
11
|
var _utils = require("../../common/utils");
|
|
12
12
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
13
13
|
var _ibmAPIConnectTemplates = require("./helpers/templates/ibmAPIConnectTemplates");
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
function _interopRequireDefault(
|
|
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
17
|
// @ts-ignore
|
|
18
18
|
const {
|
|
19
19
|
log
|
|
@@ -7,7 +7,7 @@ exports.install = void 0;
|
|
|
7
7
|
var _Renderer = _interopRequireDefault(require("../../common/Renderer"));
|
|
8
8
|
var _types = require("../../common/types");
|
|
9
9
|
var _agents = require("./agents");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const install = exports.install = {
|
|
12
12
|
action({
|
|
13
13
|
console
|
|
@@ -15,9 +15,9 @@ var _helpers = _interopRequireWildcard(require("./helpers"));
|
|
|
15
15
|
var helpers = _helpers;
|
|
16
16
|
var _inputs = require("./helpers/inputs");
|
|
17
17
|
var _istioTemplates = require("./helpers/templates/istioTemplates");
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
function _interopRequireDefault(
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
const {
|
|
23
23
|
log
|
|
@@ -68,7 +68,7 @@ exports.askConfigType = askConfigType;
|
|
|
68
68
|
const gatewayConnectivity = async (installConfig, apiServerClient, defsManager) => {
|
|
69
69
|
let istioValues = new _istioTemplates.IstioValues();
|
|
70
70
|
console.log('\nCONNECTING A KUBERNETES CLUSTER TO AMPLIFY CENTRAL\n');
|
|
71
|
-
console.log(_chalk.default.gray(`The Amplify Istio Discovery Agent needs to be deployed to your Kubernetes cluster to discover APIs for publishing to Amplify Central and/or the
|
|
71
|
+
console.log(_chalk.default.gray(`The Amplify Istio Discovery Agent needs to be deployed to your Kubernetes cluster to discover APIs for publishing to Amplify Central and/or the Amplify Marketplace.
|
|
72
72
|
The Amplify Istio Traceability Agent needs to be deployed to your Kubernetes cluster to collect transaction telemetry to send to the Amplify Central Observer and Visibility Dashboard.`));
|
|
73
73
|
console.log(`
|
|
74
74
|
For more details on client prerequesites or Kubernetes preparation refer to the documentation here:
|
|
@@ -11,9 +11,9 @@ var _types = require("../../common/types");
|
|
|
11
11
|
var _utils = require("../../common/utils");
|
|
12
12
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
13
13
|
var _kafkaTemplates = require("./helpers/templates/kafkaTemplates");
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
function _interopRequireDefault(
|
|
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
17
|
// @ts-ignore
|
|
18
18
|
const {
|
|
19
19
|
log
|
|
@@ -11,9 +11,9 @@ var _CoreConfigController = require("../../common/CoreConfigController");
|
|
|
11
11
|
var _types = require("../../common/types");
|
|
12
12
|
var _awsAgents = require("./awsAgents");
|
|
13
13
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
function _interopRequireDefault(
|
|
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
17
|
//
|
|
18
18
|
// Complex prompts
|
|
19
19
|
//
|
|
@@ -10,12 +10,12 @@ var _basicPrompts = require("../../common/basicPrompts");
|
|
|
10
10
|
var _types = require("../../common/types");
|
|
11
11
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
12
12
|
var _crypto = _interopRequireDefault(require("crypto"));
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
19
|
const {
|
|
20
20
|
log
|
|
21
21
|
} = (0, _snooplogg.default)('central: install: agents: saas');
|
|
@@ -12,10 +12,10 @@ var _CacheController = require("./CacheController");
|
|
|
12
12
|
var _dataService = require("./dataService");
|
|
13
13
|
var _types = require("./types");
|
|
14
14
|
var _utils = require("./utils");
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
19
|
const {
|
|
20
20
|
log
|
|
21
21
|
} = (0, _snooplogg.default)('central:class.ApiServerClient');
|
|
@@ -13,10 +13,10 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
13
13
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
14
14
|
var _types = require("./types");
|
|
15
15
|
var _utils = require("./utils");
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function _defineProperty(
|
|
18
|
-
function _toPropertyKey(
|
|
19
|
-
function _toPrimitive(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
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); }
|
|
20
20
|
const {
|
|
21
21
|
log
|
|
22
22
|
} = (0, _snooplogg.default)('central: CacheController');
|
|
@@ -8,10 +8,10 @@ var _fsExtra = require("fs-extra");
|
|
|
8
8
|
var _unset2 = _interopRequireDefault(require("lodash/unset"));
|
|
9
9
|
var _os = require("os");
|
|
10
10
|
var _path = require("path");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
15
|
let CliConfigKeys = exports.CliConfigKeys = /*#__PURE__*/function (CliConfigKeys) {
|
|
16
16
|
CliConfigKeys["APIC_DEPLOYMENT"] = "apic-deployment";
|
|
17
17
|
CliConfigKeys["BASE_URL"] = "base-url";
|
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CompositeError = void 0;
|
|
7
|
-
function _classPrivateFieldInitSpec(
|
|
8
|
-
function _checkPrivateRedeclaration(
|
|
9
|
-
function _classPrivateFieldGet(
|
|
10
|
-
function
|
|
11
|
-
function
|
|
12
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
13
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
7
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
8
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
9
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
10
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
11
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
14
12
|
var _nestedErrors = /*#__PURE__*/new WeakMap();
|
|
15
13
|
/** This type is returnd by the CompositeError.toDictionary() method. Intended to be outputted to JSON or YAML. */
|
|
16
14
|
|
|
@@ -24,11 +22,8 @@ class CompositeError extends Error {
|
|
|
24
22
|
constructor(errors, message) {
|
|
25
23
|
super(message);
|
|
26
24
|
/** Array of errors wrapped by this error object. */
|
|
27
|
-
_classPrivateFieldInitSpec(this, _nestedErrors,
|
|
28
|
-
|
|
29
|
-
value: void 0
|
|
30
|
-
});
|
|
31
|
-
_classPrivateFieldSet(this, _nestedErrors, errors);
|
|
25
|
+
_classPrivateFieldInitSpec(this, _nestedErrors, void 0);
|
|
26
|
+
_classPrivateFieldSet(_nestedErrors, this, errors);
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
/** Gets the name of this error type. */
|
|
@@ -38,7 +33,7 @@ class CompositeError extends Error {
|
|
|
38
33
|
|
|
39
34
|
/** Gets an array of error objects owned by this composite error. */
|
|
40
35
|
get nestedErrors() {
|
|
41
|
-
return _classPrivateFieldGet(
|
|
36
|
+
return _classPrivateFieldGet(_nestedErrors, this);
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
/**
|
|
@@ -52,7 +47,7 @@ class CompositeError extends Error {
|
|
|
52
47
|
message: this.message,
|
|
53
48
|
nestedErrors: []
|
|
54
49
|
};
|
|
55
|
-
for (const nextError of _classPrivateFieldGet(
|
|
50
|
+
for (const nextError of _classPrivateFieldGet(_nestedErrors, this)) {
|
|
56
51
|
if (nextError instanceof CompositeError) {
|
|
57
52
|
dictionary.nestedErrors.push(nextError.toDictionary());
|
|
58
53
|
} else {
|
|
@@ -75,7 +70,7 @@ class CompositeError extends Error {
|
|
|
75
70
|
if (this.message) {
|
|
76
71
|
messageLines.push(this.message);
|
|
77
72
|
}
|
|
78
|
-
for (const nextError of _classPrivateFieldGet(
|
|
73
|
+
for (const nextError of _classPrivateFieldGet(_nestedErrors, this)) {
|
|
79
74
|
if (nextError instanceof CompositeError) {
|
|
80
75
|
for (const nextLine of nextError.toNestedMessageArray()) {
|
|
81
76
|
const prefix = nextLine.startsWith('-') ? ' ' : '* ';
|
|
@@ -8,10 +8,10 @@ var _amplifyCliUtils = require("@axway/amplify-cli-utils");
|
|
|
8
8
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
9
9
|
var _CliConfigManager = require("./CliConfigManager");
|
|
10
10
|
var _types = require("./types");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
15
|
const {
|
|
16
16
|
log
|
|
17
17
|
} = (0, _snooplogg.default)('central: CoreConfigController');
|
|
@@ -158,12 +158,12 @@ class CoreConfigController {
|
|
|
158
158
|
return result;
|
|
159
159
|
}
|
|
160
160
|
static getEnv() {
|
|
161
|
-
var
|
|
162
|
-
return ((
|
|
161
|
+
var _CoreConfigController2, _CoreConfigController3;
|
|
162
|
+
return ((_CoreConfigController2 = CoreConfigController.devOpsAccount) === null || _CoreConfigController2 === void 0 ? void 0 : (_CoreConfigController3 = _CoreConfigController2.auth) === null || _CoreConfigController3 === void 0 ? void 0 : _CoreConfigController3.env) || _types.Platforms.prod;
|
|
163
163
|
}
|
|
164
164
|
static getAuthUrl() {
|
|
165
|
-
var
|
|
166
|
-
return ((
|
|
165
|
+
var _CoreConfigController4, _CoreConfigController5;
|
|
166
|
+
return ((_CoreConfigController4 = CoreConfigController.devOpsAccount) === null || _CoreConfigController4 === void 0 ? void 0 : (_CoreConfigController5 = _CoreConfigController4.auth) === null || _CoreConfigController5 === void 0 ? void 0 : _CoreConfigController5.baseUrl) || _types.AuthUrls.Prod;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
exports.CoreConfigController = CoreConfigController;
|
|
@@ -12,10 +12,10 @@ var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
|
12
12
|
var _max2 = _interopRequireDefault(require("lodash/max"));
|
|
13
13
|
var _min2 = _interopRequireDefault(require("lodash/min"));
|
|
14
14
|
var _chalk = require("chalk");
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
19
|
const {
|
|
20
20
|
log
|
|
21
21
|
} = (0, _snooplogg.default)('central:class.DefinitionsManager');
|
package/dist/common/Kubectl.js
CHANGED
|
@@ -8,7 +8,7 @@ var _child_process = require("child_process");
|
|
|
8
8
|
var _cliKit = require("cli-kit");
|
|
9
9
|
var _util = _interopRequireDefault(require("util"));
|
|
10
10
|
var _utils = require("./utils");
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const quotes = _utils.isWindows ? '"' : "'";
|
|
13
13
|
const {
|
|
14
14
|
log
|
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PlatformTeamMemberRole = exports.PlatformServiceAccountRole = exports.PlatformClient = exports.PlatformAuthMethod = void 0;
|
|
7
7
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
8
8
|
var _amplifyCliUtils = require("@axway/amplify-cli-utils");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _classPrivateFieldInitSpec(
|
|
11
|
-
function _checkPrivateRedeclaration(
|
|
12
|
-
function _classPrivateFieldGet(
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
16
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
11
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
12
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
13
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
14
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
17
15
|
const {
|
|
18
16
|
log
|
|
19
17
|
} = (0, _snooplogg.default)('central:class.PlatformClient');
|
|
@@ -54,47 +52,35 @@ class PlatformClient {
|
|
|
54
52
|
region,
|
|
55
53
|
account
|
|
56
54
|
} = {}) {
|
|
57
|
-
_classPrivateFieldInitSpec(this, _baseUrl,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_classPrivateFieldInitSpec(this, _accountName, {
|
|
62
|
-
writable: true,
|
|
63
|
-
value: void 0
|
|
64
|
-
});
|
|
65
|
-
_classPrivateFieldInitSpec(this, _amplifyConfig, {
|
|
66
|
-
writable: true,
|
|
67
|
-
value: void 0
|
|
68
|
-
});
|
|
69
|
-
_classPrivateFieldInitSpec(this, _amplifySdk, {
|
|
70
|
-
writable: true,
|
|
71
|
-
value: void 0
|
|
72
|
-
});
|
|
55
|
+
_classPrivateFieldInitSpec(this, _baseUrl, void 0);
|
|
56
|
+
_classPrivateFieldInitSpec(this, _accountName, void 0);
|
|
57
|
+
_classPrivateFieldInitSpec(this, _amplifyConfig, void 0);
|
|
58
|
+
_classPrivateFieldInitSpec(this, _amplifySdk, void 0);
|
|
73
59
|
log(`initializing client with params: baseUrl = ${baseUrl}, region = ${region}, account = ${account}`);
|
|
74
|
-
_classPrivateFieldSet(
|
|
75
|
-
_classPrivateFieldSet(
|
|
60
|
+
_classPrivateFieldSet(_baseUrl, this, baseUrl);
|
|
61
|
+
_classPrivateFieldSet(_accountName, this, account);
|
|
76
62
|
const initResult = (0, _amplifyCliUtils.initSDK)({
|
|
77
|
-
baseUrl: _classPrivateFieldGet(
|
|
78
|
-
username: _classPrivateFieldGet(
|
|
63
|
+
baseUrl: _classPrivateFieldGet(_baseUrl, this),
|
|
64
|
+
username: _classPrivateFieldGet(_accountName, this)
|
|
79
65
|
});
|
|
80
|
-
_classPrivateFieldSet(
|
|
81
|
-
_classPrivateFieldSet(
|
|
66
|
+
_classPrivateFieldSet(_amplifyConfig, this, initResult.config);
|
|
67
|
+
_classPrivateFieldSet(_amplifySdk, this, initResult.sdk);
|
|
82
68
|
}
|
|
83
69
|
async getAccountInfo() {
|
|
84
70
|
var _classPrivateFieldGet2;
|
|
85
71
|
// Get default teams from config.
|
|
86
|
-
const defaultTeams = _classPrivateFieldGet(
|
|
72
|
+
const defaultTeams = _classPrivateFieldGet(_amplifyConfig, this).get(`${(0, _amplifyCliUtils.getAuthConfigEnvSpecifier)((_classPrivateFieldGet2 = _classPrivateFieldGet(_amplifySdk, this).env) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.name)}.defaultTeam`);
|
|
87
73
|
|
|
88
74
|
// Fetch specified account or default account currently logged in.
|
|
89
75
|
let accountInfo;
|
|
90
|
-
if (_classPrivateFieldGet(
|
|
91
|
-
accountInfo = await _classPrivateFieldGet(
|
|
76
|
+
if (_classPrivateFieldGet(_accountName, this)) {
|
|
77
|
+
accountInfo = await _classPrivateFieldGet(_amplifySdk, this).auth.find(_classPrivateFieldGet(_accountName, this), defaultTeams);
|
|
92
78
|
if (!accountInfo) {
|
|
93
|
-
throw new Error(`Account "${_classPrivateFieldGet(
|
|
79
|
+
throw new Error(`Account "${_classPrivateFieldGet(_accountName, this)}" not found`);
|
|
94
80
|
}
|
|
95
81
|
}
|
|
96
82
|
if (!accountInfo) {
|
|
97
|
-
const accountArray = await _classPrivateFieldGet(
|
|
83
|
+
const accountArray = await _classPrivateFieldGet(_amplifySdk, this).auth.list({
|
|
98
84
|
defaultTeams,
|
|
99
85
|
validate: true
|
|
100
86
|
});
|
|
@@ -113,11 +99,11 @@ class PlatformClient {
|
|
|
113
99
|
}
|
|
114
100
|
async createServiceAccount(options) {
|
|
115
101
|
const accountInfo = await this.getAccountInfo();
|
|
116
|
-
const result = await _classPrivateFieldGet(
|
|
102
|
+
const result = await _classPrivateFieldGet(_amplifySdk, this).client.create(accountInfo, accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.org, options);
|
|
117
103
|
return result.client;
|
|
118
104
|
}
|
|
119
105
|
async getServiceAccounts(filterRole) {
|
|
120
|
-
const result = await _classPrivateFieldGet(
|
|
106
|
+
const result = await _classPrivateFieldGet(_amplifySdk, this).client.list(await this.getAccountInfo());
|
|
121
107
|
let clients = result.clients || [];
|
|
122
108
|
if (filterRole) {
|
|
123
109
|
log('filter clients by ', filterRole);
|
|
@@ -131,7 +117,7 @@ class PlatformClient {
|
|
|
131
117
|
const account = await this.getAccountInfo();
|
|
132
118
|
const {
|
|
133
119
|
teams
|
|
134
|
-
} = await _classPrivateFieldGet(
|
|
120
|
+
} = await _classPrivateFieldGet(_amplifySdk, this).team.list(account);
|
|
135
121
|
const teamGuid = ((_account$team = account.team) === null || _account$team === void 0 ? void 0 : _account$team.guid) && ((_teams$find = teams.find(team => team.guid === account.team.guid)) === null || _teams$find === void 0 ? void 0 : _teams$find.guid);
|
|
136
122
|
return teams.map(team => ({
|
|
137
123
|
...team,
|
package/dist/common/Renderer.js
CHANGED
|
@@ -10,14 +10,14 @@ var _CompositeError = require("./CompositeError");
|
|
|
10
10
|
var _resultsRenderers = require("./resultsRenderers");
|
|
11
11
|
var _types = require("./types");
|
|
12
12
|
var _utils = require("./utils");
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function _classPrivateMethodInitSpec(
|
|
15
|
-
function _checkPrivateRedeclaration(
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
19
|
-
function
|
|
20
|
-
var
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
15
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
20
|
+
var _Renderer_brand = /*#__PURE__*/new WeakSet();
|
|
21
21
|
class Renderer {
|
|
22
22
|
constructor(console, output) {
|
|
23
23
|
/**
|
|
@@ -27,7 +27,7 @@ class Renderer {
|
|
|
27
27
|
* @param detail Optional error detail explaining exactly what went wrong.
|
|
28
28
|
* @returns Returns an error message to be outputted to the console.
|
|
29
29
|
*/
|
|
30
|
-
_classPrivateMethodInitSpec(this,
|
|
30
|
+
_classPrivateMethodInitSpec(this, _Renderer_brand);
|
|
31
31
|
_defineProperty(this, "spinner", void 0);
|
|
32
32
|
_defineProperty(this, "_console", void 0);
|
|
33
33
|
_defineProperty(this, "output", void 0);
|
|
@@ -296,14 +296,14 @@ class Renderer {
|
|
|
296
296
|
// TODO: some pasta here: 401 thrown manually on data service, fix it?
|
|
297
297
|
// https://jira.axway.com/browse/APIGOV-20818
|
|
298
298
|
case 401:
|
|
299
|
-
this.error(
|
|
299
|
+
this.error(_assertClassBrand(_Renderer_brand, this, _createApiServerErrorMessage).call(this, prefixMsg, err.title || "Looks like you're not authenticated!"));
|
|
300
300
|
this.console('\nTry running:');
|
|
301
301
|
this.console((0, _cliKit.chalk)`{cyan axway auth login}`);
|
|
302
302
|
this.console('Or if using a service account:');
|
|
303
303
|
this.console((0, _cliKit.chalk)`{cyan axway auth login --client-id <Service Account Client ID> --secret-file <Private Key>}`);
|
|
304
304
|
break;
|
|
305
305
|
case 400:
|
|
306
|
-
this.error(
|
|
306
|
+
this.error(_assertClassBrand(_Renderer_brand, this, _createApiServerErrorMessage).call(this, prefixMsg, err.title, err.detail));
|
|
307
307
|
if (err.source) this.console(_cliKit.chalk.gray(`Caused by: ${JSON.stringify(err.source)}`));
|
|
308
308
|
break;
|
|
309
309
|
case 403:
|
|
@@ -312,7 +312,7 @@ class Renderer {
|
|
|
312
312
|
case 500:
|
|
313
313
|
case 0:
|
|
314
314
|
// status 0 used for internal errors (see ApiServerClient.deleteSingleResource wait logic)
|
|
315
|
-
this.error(
|
|
315
|
+
this.error(_assertClassBrand(_Renderer_brand, this, _createApiServerErrorMessage).call(this, prefixMsg, err.title, err.detail));
|
|
316
316
|
break;
|
|
317
317
|
default:
|
|
318
318
|
// rare case, should almost never happen.
|
|
@@ -326,7 +326,7 @@ class Renderer {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
exports.default = Renderer;
|
|
329
|
-
function
|
|
329
|
+
function _createApiServerErrorMessage(prefix, title, detail) {
|
|
330
330
|
let message = prefix;
|
|
331
331
|
if (message.length > 0 && !message.endsWith(' ')) {
|
|
332
332
|
message += ' ';
|
package/dist/common/TmpFile.js
CHANGED
|
@@ -10,10 +10,10 @@ var _tmp = _interopRequireDefault(require("tmp"));
|
|
|
10
10
|
var _resultsRenderers = require("../common/resultsRenderers");
|
|
11
11
|
var _utils = require("../common/utils");
|
|
12
12
|
var _bashCommands = require("./bashCommands");
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function _defineProperty(
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
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); }
|
|
17
17
|
const {
|
|
18
18
|
log
|
|
19
19
|
} = (0, _snooplogg.default)('central:class.TmpFile');
|
|
@@ -7,7 +7,7 @@ exports.openssl = exports.isOpenSslInstalled = exports.editor = exports.createTl
|
|
|
7
7
|
var _child_process = require("child_process");
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
|
9
9
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* istanbul ignore file */
|
|
12
12
|
// note: mocking/stubbing spawn is not a trivial task and causes some problems
|
|
13
13
|
// if done incorrectly. Need to find a good way to test it.
|
|
@@ -7,7 +7,7 @@ exports.verifyApigeeXCredentialFile = exports.validateValueRange = exports.valid
|
|
|
7
7
|
var _inquirer = _interopRequireDefault(require("inquirer"));
|
|
8
8
|
var _fsExtra = require("fs-extra");
|
|
9
9
|
var _path = require("path");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
//
|
|
12
12
|
// Basic Prompts
|
|
13
13
|
//
|