hcloud-sdk 0.0.8 → 0.0.9
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 +2 -0
- package/lib/hcloud.d.ts +1 -0
- package/lib/hcloud.js +6 -0
- package/lib/service/IDP.d.ts +1 -1
- package/lib/service/IDP.js +2 -2
- package/package.json +49 -42
package/README.md
CHANGED
package/lib/hcloud.d.ts
CHANGED
package/lib/hcloud.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const base_1 = require("./base");
|
|
4
4
|
const IDP_1 = require("./service/IDP");
|
|
5
5
|
const High5_1 = require("./service/High5");
|
|
6
|
+
const axios_1 = require("axios");
|
|
6
7
|
// tslint:disable-next-line
|
|
7
8
|
class hcloud extends base_1.default {
|
|
8
9
|
constructor(opts) {
|
|
@@ -10,5 +11,10 @@ class hcloud extends base_1.default {
|
|
|
10
11
|
this.IDP = new IDP_1.default(this.opts);
|
|
11
12
|
this.High5 = new High5_1.default(this.opts);
|
|
12
13
|
}
|
|
14
|
+
setAuthToken(token) {
|
|
15
|
+
axios_1.default.defaults.headers.common = {
|
|
16
|
+
Authorization: token,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
13
19
|
}
|
|
14
20
|
exports.default = hcloud;
|
package/lib/service/IDP.d.ts
CHANGED
package/lib/service/IDP.js
CHANGED
|
@@ -19,8 +19,8 @@ class IDP extends base_1.default {
|
|
|
19
19
|
* @param token
|
|
20
20
|
* @returns User object
|
|
21
21
|
*/
|
|
22
|
-
this.authorize = (
|
|
23
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/authenticate"), {}, {
|
|
22
|
+
this.authorize = () => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield axios_1.default.post(this.getEndpoint("/v1/authenticate"), {}, {}).catch((err) => {
|
|
24
24
|
throw err;
|
|
25
25
|
});
|
|
26
26
|
return resp.data;
|
package/package.json
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "hcloud-sdk",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"description": "hcloud platform sdk",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/moovit-sp-gmbh/hcloud-sdk-js.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"hcloud",
|
|
13
|
+
"sdk"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/moovit-sp-gmbh/hcloud-sdk-js/issues"
|
|
18
|
+
},
|
|
19
|
+
"author": "moovit-sp-gmbh",
|
|
20
|
+
"homepage": "https://github.com/moovit-sp-gmbh/hcloud-sdk-js#readme",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/chai": "^4.3.1",
|
|
23
|
+
"@types/mocha": "^9.1.1",
|
|
24
|
+
"@types/uuid": "^8.3.4",
|
|
25
|
+
"chai": "^4.3.6",
|
|
26
|
+
"mocha": "^10.0.0",
|
|
27
|
+
"prettier": "^2.6.2",
|
|
28
|
+
"ts-node": "^10.8.0",
|
|
29
|
+
"tslint": "^6.1.3",
|
|
30
|
+
"tslint-config-prettier": "^1.18.0",
|
|
31
|
+
"typescript": "^4.7.2",
|
|
32
|
+
"uuid": "^8.3.2"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"axios": "^0.27.2",
|
|
36
|
+
"dayjs": "^1.11.3",
|
|
37
|
+
"vuepress": "^1.9.7",
|
|
38
|
+
"vuepress-theme-default-prefers-color-scheme": "^2.0.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "mocha -r ts-node/register tests/**/*.test.ts",
|
|
42
|
+
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.test.ts\"",
|
|
43
|
+
"lint": "tslint -p tsconfig.json",
|
|
44
|
+
"doc:build": "vuepress build _docs/src",
|
|
45
|
+
"doc:dev": "vuepress dev _docs/src",
|
|
46
|
+
"doc:export": "vuepress export _docs/src",
|
|
47
|
+
"build": "tsc"
|
|
48
|
+
},
|
|
49
|
+
"readme": "# hcloud-sdk\n[](https://opensource.org/licenses/MIT)\n[](https://www.npmjs.com/package/hcloud-sdk)\n"
|
|
50
|
+
}
|