@golemio/energetics 1.0.6 → 1.0.7-dev.460778671
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.
|
@@ -15,7 +15,7 @@ var _a;
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.UnimonitorCemApi = void 0;
|
|
17
17
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
18
|
-
const
|
|
18
|
+
const axios_1 = __importDefault(require("@golemio/core/dist/shared/axios"));
|
|
19
19
|
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
20
20
|
/**
|
|
21
21
|
* Helper class for requesting additional data from Unimonitor CEM API
|
|
@@ -53,13 +53,12 @@ UnimonitorCemApi.createSession = () => __awaiter(void 0, void 0, void 0, functio
|
|
|
53
53
|
pass,
|
|
54
54
|
user,
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const axiosUrl = `${url}?${params}`;
|
|
57
|
+
const axiosConfig = {
|
|
58
58
|
timeout: 10000,
|
|
59
|
-
url: `${url}?${params}`,
|
|
60
59
|
};
|
|
61
60
|
try {
|
|
62
|
-
const { headers } = yield
|
|
61
|
+
const { headers } = yield axios_1.default.get(axiosUrl, axiosConfig);
|
|
63
62
|
const cookieHeader = (_b = headers["set-cookie"]) === null || _b === void 0 ? void 0 : _b[0];
|
|
64
63
|
return {
|
|
65
64
|
authCookie: UnimonitorCemApi.processAndFilterAuthCookie(cookieHeader, authCookieName),
|
|
@@ -77,15 +76,15 @@ UnimonitorCemApi.terminateSession = (authCookie) => __awaiter(void 0, void 0, vo
|
|
|
77
76
|
const params = new URLSearchParams({
|
|
78
77
|
id: UnimonitorCemApi.resourceType.UserLogout,
|
|
79
78
|
});
|
|
80
|
-
const
|
|
79
|
+
const axiosUrl = `${url}?${params}`;
|
|
80
|
+
const axiosConfig = {
|
|
81
81
|
headers: {
|
|
82
82
|
Cookie: authCookie,
|
|
83
83
|
},
|
|
84
84
|
timeout: 10000,
|
|
85
|
-
url: `${url}?${params}`,
|
|
86
85
|
};
|
|
87
86
|
try {
|
|
88
|
-
yield
|
|
87
|
+
yield axios_1.default.get(axiosUrl, axiosConfig);
|
|
89
88
|
}
|
|
90
89
|
catch (err) {
|
|
91
90
|
throw new golemio_errors_1.CustomError("Cannot terminate Unimonitor CEM API session", true, UnimonitorCemApi.name, 5007, err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnimonitorCemApiHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/UnimonitorCemApiHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6EAAuE;AAEvE,
|
|
1
|
+
{"version":3,"file":"UnimonitorCemApiHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/UnimonitorCemApiHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6EAAuE;AAEvE,4EAAoD;AACpD,yEAAsE;AAEtE;;GAEG;AACH,MAAM,gBAAgB;IAgElB;;OAEG;IACI,MAAM,KAAK,YAAY;QAC1B,OAAO;YACH,WAAW,EAAE,IAAI;YACjB,kBAAkB,EAAE,GAAG;YACvB,SAAS,EAAE,IAAI;YACf,sBAAsB,EAAE,IAAI;YAC5B,KAAK,EAAE,GAAG;YACV,SAAS,EAAE,GAAG;YACd,UAAU,EAAE,GAAG;SAClB,CAAC;IACN,CAAC;;AAsBI,4CAAgB;;AAlGrB,iCAAiC;AACnB,gCAAe,GAAG,YAAa,CAAA;AAC/B,4BAAW,GAAG,eAAgB,CAAA;AAC7B,oCAAmB,GAAG,GAAI,CAAA;AAEzC;;GAEG;AACW,8BAAa,GAAG,GAA0C,EAAE;;IACtE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,eAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAC1F,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QAC/B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IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;KAChH;AACL,CAAC,CAAC,CAAA;AAiBF;;GAEG;AACY,2CAA0B,GAAG,CAAC,YAAgC,EAAE,cAAsB,EAAU,EAAE;;IAC7G,MAAM,UAAU,GAAG,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;IAElD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAChC,MAAM,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAExG,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,cAAc,CAAC;QAEjD,IAAI,UAAU,KAAK,cAAc,IAAI,CAAC,CAAC,WAAW,EAAE;YAChD,OAAO,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;SACpE;KACJ;IAED,OAAO,EAAE,CAAC;AACd,CAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnergeticsBaseWorker.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/EnergeticsBaseWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;
|
|
1
|
+
{"version":3,"file":"EnergeticsBaseWorker.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/EnergeticsBaseWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AAEvE,2EAA2E;AAM3E,MAAe,oBAAqB,SAAQ,oBAAU;IAClD;QACI,KAAK,EAAE,CAAC;QAGZ;;WAEG;QACO,sBAAiB,GAAG,CAC1B,gBAA2C,EAC3C,cAA4C,EAC/B,EAAE;YACf,IAAI,UAA4B,CAAC;YAEjC,IAAI;gBACA,U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
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
2
|
+
"name": "@golemio/energetics",
|
|
3
|
+
"version": "1.0.7-dev.460778671",
|
|
4
|
+
"description": "Golemio Energetics Module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
9
|
+
"build-minimal": "run-s 'build --sourceMap false --declaration false'",
|
|
10
|
+
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
11
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register 'test/**/*.test.ts'",
|
|
12
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
13
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
14
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
15
|
+
"lint": "eslint '{src,test}/**/*.ts'"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"golemio"
|
|
19
|
+
],
|
|
20
|
+
"author": "Operator ICT, a.s.",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/energetics"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@commitlint/cli": "^11.0.0",
|
|
28
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
29
|
+
"@golemio/cli": "1.2.0",
|
|
30
|
+
"@golemio/core": "1.1.12-dev.460649780",
|
|
31
|
+
"@golemio/eslint-config": "^1.0.2",
|
|
32
|
+
"@types/chai": "4.2.3",
|
|
33
|
+
"@types/chai-as-promised": "7.1.2",
|
|
34
|
+
"@types/debug": "0.0.31",
|
|
35
|
+
"@types/lodash": "^4.14.165",
|
|
36
|
+
"@types/mocha": "^8.2.0",
|
|
37
|
+
"@types/node": "^14.14.20",
|
|
38
|
+
"@types/sinon": "^9.0.10",
|
|
39
|
+
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
40
|
+
"chai": "4.2.0",
|
|
41
|
+
"chai-as-promised": "7.1.1",
|
|
42
|
+
"cross-env": "^7.0.3",
|
|
43
|
+
"eslint": "^7.17.0",
|
|
44
|
+
"husky": "^4.3.7",
|
|
45
|
+
"mocha": "^9.1.2",
|
|
46
|
+
"npm-run-all": "^4.1.5",
|
|
47
|
+
"nyc": "^15.1.0",
|
|
48
|
+
"prettier": "^2.2.1",
|
|
49
|
+
"pretty-quick": "^3.1.0",
|
|
50
|
+
"rimraf": "^3.0.2",
|
|
51
|
+
"sinon": "^9.2.3",
|
|
52
|
+
"source-map-support": "0.5.9",
|
|
53
|
+
"ts-node": "^9.1.1",
|
|
54
|
+
"ttypescript": "^1.5.12",
|
|
55
|
+
"typedoc": "^0.21.4",
|
|
56
|
+
"typescript": "^4.1.3"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@golemio/core": "^1.0.5"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"JSONStream": "^1.3.5",
|
|
63
|
+
"debug": "3.1.0",
|
|
64
|
+
"lodash": "^4.17.19"
|
|
65
|
+
},
|
|
66
|
+
"resolutions": {
|
|
67
|
+
"mpath": "^0.8.4"
|
|
68
|
+
}
|
|
69
69
|
}
|