hcloud-sdk 0.0.12 → 0.0.13
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/lib/Axios.d.ts +5 -0
- package/lib/Axios.js +23 -0
- package/lib/common.d.ts +9 -0
- package/lib/common.js +11 -0
- package/lib/dto/IDP.d.ts +2 -1
- package/lib/service/IDP.js +1 -1
- package/package.json +2 -3
- package/src/lib/dto/IDP.d.ts +14 -0
- package/src/lib/dto/IDP.js +2 -0
package/lib/Axios.d.ts
ADDED
package/lib/Axios.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const axios_1 = require("axios");
|
|
13
|
+
class AxiosService {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.get = (url) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return axios_1.default.get(url);
|
|
17
|
+
});
|
|
18
|
+
this.post = (url, body) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
return axios_1.default.post(url, body, {});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = AxiosService;
|
package/lib/common.d.ts
ADDED
package/lib/common.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Axios_1 = require("./Axios");
|
|
4
|
+
// tslint:disable-next-line
|
|
5
|
+
class common {
|
|
6
|
+
constructor(opts) {
|
|
7
|
+
this.opts = opts;
|
|
8
|
+
this.axios = new Axios_1.default();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.default = common;
|
package/lib/dto/IDP.d.ts
CHANGED
package/lib/service/IDP.js
CHANGED
|
@@ -20,7 +20,7 @@ class IDP extends base_1.default {
|
|
|
20
20
|
* @returns User object
|
|
21
21
|
*/
|
|
22
22
|
this.authorize = () => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const resp = yield axios_1.default.
|
|
23
|
+
const resp = yield axios_1.default.get(this.getEndpoint("/v1/authorize"), {}).catch((err) => {
|
|
24
24
|
throw err;
|
|
25
25
|
});
|
|
26
26
|
return resp.data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hcloud-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "hcloud platform sdk",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -46,6 +46,5 @@
|
|
|
46
46
|
"doc:dev": "vuepress dev _docs/src",
|
|
47
47
|
"doc:export": "vuepress export _docs/src",
|
|
48
48
|
"build": "tsc"
|
|
49
|
-
}
|
|
50
|
-
"readme": "# hcloud-sdk\n[](https://opensource.org/licenses/MIT)\n[](https://www.npmjs.com/package/hcloud-sdk)\n"
|
|
49
|
+
}
|
|
51
50
|
}
|