@celonis/content-cli 0.5.4 → 0.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/api/asset-api.js +1 -0
- package/api/compute-pool-api.js +1 -0
- package/api/data-pool-api.js +29 -0
- package/api/node-api.js +1 -0
- package/api/package-api.js +1 -0
- package/api/package-dependencies-api.js +1 -0
- package/api/space-api.js +1 -0
- package/api/variable-assignment-apis.js +1 -0
- package/api/variables-api.js +1 -0
- package/commands/analysis-bookmarks.command.js +1 -0
- package/commands/analysis.command.js +1 -0
- package/commands/asset.command.js +1 -0
- package/commands/connection.command.js +41 -0
- package/commands/ctp.command.js +1 -0
- package/commands/data-pool.command.js +1 -0
- package/commands/objective.command.js +1 -0
- package/commands/package.command.js +1 -0
- package/commands/profile.command.js +1 -0
- package/commands/skill.command.js +1 -0
- package/commands/space.command.js +1 -0
- package/commands/variable.command.js +1 -0
- package/commands/widget-sourcemaps.command.js +1 -0
- package/commands/widget.command.js +1 -0
- package/content/factory/analysis-bookmarks-manager.factory.js +1 -0
- package/content/factory/analysis-manager.factory.js +1 -0
- package/content/factory/asset-manager.factory.js +1 -0
- package/content/factory/ctp-manager.factory.js +1 -0
- package/content/factory/data-pool-manager.factory.js +1 -0
- package/content/factory/objective-manager.factory.js +1 -0
- package/content/factory/package-manager.factory.js +1 -0
- package/content/factory/skill-manager.factory.js +1 -0
- package/content/factory/space-manager.factory.js +1 -0
- package/content/factory/widget-manager.factory.js +3 -2
- package/content/factory/widget-sourcemaps-manager.factory.js +1 -0
- package/content/manager/analysis-bookmarks.manager.js +6 -6
- package/content/manager/analysis.manager.js +7 -7
- package/content/manager/asset.manager.js +4 -5
- package/content/manager/base.manager.js +1 -0
- package/content/manager/ctp.analysis.manager.js +8 -8
- package/content/manager/ctp.datamodel.manager.js +1 -0
- package/content/manager/ctp.manager.js +1 -0
- package/content/manager/data-pool.manager.js +3 -6
- package/content/manager/objective.manager.js +3 -4
- package/content/manager/package.manager.js +6 -6
- package/content/manager/skill.manager.js +6 -6
- package/content/manager/space.manager.js +2 -1
- package/content/manager/widget-sourcemaps.manager.js +3 -2
- package/content/manager/widget.manager.js +6 -6
- package/content-cli-export.js +1 -0
- package/content-cli-get.js +52 -0
- package/content-cli-import.js +1 -0
- package/content-cli-list.js +16 -1
- package/content-cli-push.js +1 -1
- package/content-cli-set.js +54 -0
- package/content-cli.js +2 -0
- package/interfaces/package-manager.interfaces.js +2 -1
- package/interfaces/profile.interface.js +1 -0
- package/lib/api/data-pool-api.d.ts +4 -0
- package/lib/commands/connection.command.d.ts +5 -0
- package/lib/content-cli-get.d.ts +1 -0
- package/lib/content-cli-list.d.ts +2 -1
- package/lib/content-cli-set.d.ts +1 -0
- package/lib/interfaces/data-pool-manager.interfaces.d.ts +1 -1
- package/lib/interfaces/profile.interface.d.ts +1 -1
- package/lib/services/connection/connection.service.d.ts +7 -0
- package/lib/services/http-client-service.v2.d.ts +1 -3
- package/lib/services/http-client.service.d.ts +2 -3
- package/lib/validators/profile.validator.d.ts +1 -1
- package/package.json +6 -7
- package/services/connection/connection.service.js +83 -0
- package/services/content.service.js +1 -0
- package/services/context.service.js +1 -0
- package/services/data-pool/data-pool-service.js +4 -3
- package/services/file-service.js +2 -1
- package/services/http-client-service.v2.js +60 -54
- package/services/http-client.service.js +55 -45
- package/services/package-manager/asset-service.js +2 -1
- package/services/package-manager/datamodel-service.js +1 -0
- package/services/package-manager/package-service.js +5 -4
- package/services/package-manager/space-service.js +2 -1
- package/services/package-manager/variable-service.js +2 -1
- package/services/profile.service.js +1 -0
- package/services/question.service.js +1 -0
- package/util/context-initializer.js +1 -0
- package/util/logger.js +1 -0
- package/util/semantic-versioning.js +1 -0
- package/util/tracing.js +1 -0
- package/util/version.js +1 -0
- package/util/yaml.js +1 -0
- package/validators/profile.validator.js +31 -33
|
@@ -13,19 +13,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "../interfaces/profile.interface", "../util/logger", "valid-url", "
|
|
16
|
+
define(["require", "exports", "../interfaces/profile.interface", "../util/logger", "valid-url", "axios"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ProfileValidator = void 0;
|
|
21
22
|
const profile_interface_1 = require("../interfaces/profile.interface");
|
|
22
23
|
const logger_1 = require("../util/logger");
|
|
23
24
|
const validUrl = require("valid-url");
|
|
24
|
-
const
|
|
25
|
+
const axios_1 = require("axios");
|
|
25
26
|
class ProfileValidator {
|
|
26
27
|
static validateProfile(profile) {
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
29
30
|
if (profile.name == null) {
|
|
30
31
|
logger_1.logger.error(new logger_1.FatalError("The name can not be empty"));
|
|
31
32
|
}
|
|
@@ -38,40 +39,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
39
|
if (!validUrl.isUri(profile.team)) {
|
|
39
40
|
logger_1.logger.error(new logger_1.FatalError("The provided url is not a valid url."));
|
|
40
41
|
}
|
|
41
|
-
const options = {
|
|
42
|
-
headers: {
|
|
43
|
-
authorization: `${profile_interface_1.AuthenticationType.BEARER} ${profile.apiToken}`,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
42
|
const url = profile.team.replace(/\/?$/, "/api/cloud/team");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
else {
|
|
57
|
-
logger_1.logger.error(new logger_1.FatalError("The provided team or api key is wrong."));
|
|
58
|
-
reject();
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
resolve(profile_interface_1.AuthenticationType.BEARER);
|
|
64
|
-
}
|
|
43
|
+
this.tryAuthenticationType(url, profile_interface_1.AuthenticationType.BEARER, profile.apiToken).then(() => {
|
|
44
|
+
resolve(profile_interface_1.AuthenticationType.BEARER);
|
|
45
|
+
}).catch(() => {
|
|
46
|
+
this.tryAuthenticationType(url, profile_interface_1.AuthenticationType.APPKEY, profile.apiToken).then(() => {
|
|
47
|
+
resolve(profile_interface_1.AuthenticationType.APPKEY);
|
|
48
|
+
}).catch(() => {
|
|
49
|
+
logger_1.logger.error(new logger_1.FatalError("The provided team or api key is wrong."));
|
|
50
|
+
reject();
|
|
51
|
+
});
|
|
65
52
|
});
|
|
66
|
-
});
|
|
53
|
+
}));
|
|
67
54
|
});
|
|
68
55
|
}
|
|
69
|
-
static
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
static tryAuthenticationType(url, authType, apiToken) {
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
axios_1.default.get(url, {
|
|
59
|
+
headers: {
|
|
60
|
+
Authorization: `${authType} ${apiToken}`
|
|
61
|
+
}
|
|
62
|
+
}).then(response => {
|
|
63
|
+
if (response.status === 200 && response.data.domain) {
|
|
64
|
+
resolve();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
reject();
|
|
68
|
+
}
|
|
69
|
+
}).catch(() => {
|
|
70
|
+
reject();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
exports.ProfileValidator = ProfileValidator;
|