hcloud-sdk 0.0.1
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 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +4 -0
- package/build/lib/Axios.d.ts +4 -0
- package/build/lib/Axios.js +20 -0
- package/build/lib/IDP.d.ts +4 -0
- package/build/lib/IDP.js +21 -0
- package/build/lib/hcloud.d.ts +11 -0
- package/build/lib/hcloud.js +13 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# hcloud-sdk-js
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = AxiosService;
|
package/build/lib/IDP.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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 hcloud_1 = require("./hcloud");
|
|
13
|
+
class IDPService extends hcloud_1.default {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.authenticate = () => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const resp = yield this.axios.get('https://google.com');
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = IDPService;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import IDPService from './IDP';
|
|
2
|
+
import AxiosService from './Axios';
|
|
3
|
+
export interface options {
|
|
4
|
+
api: string;
|
|
5
|
+
}
|
|
6
|
+
export default class hcloud {
|
|
7
|
+
protected opts: options;
|
|
8
|
+
protected axios: AxiosService;
|
|
9
|
+
IDP: IDPService;
|
|
10
|
+
constructor(opts: options);
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IDP_1 = require("./IDP");
|
|
4
|
+
const Axios_1 = require("./Axios");
|
|
5
|
+
// tslint:disable-next-line
|
|
6
|
+
class hcloud {
|
|
7
|
+
constructor(opts) {
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.axios = new Axios_1.default();
|
|
10
|
+
this.IDP = new IDP_1.default(this.opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = hcloud;
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hcloud-sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "hcloud platform sdk",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "mocha -r ts-node/register test/**/*.test.ts",
|
|
9
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
10
|
+
"lint": "tslint -p tsconfig.json",
|
|
11
|
+
"build": "tsc"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/moovit-sp-gmbh/hcloud-sdk-js.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"hcloud",
|
|
19
|
+
"sdk"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"build/**/*"
|
|
23
|
+
],
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/moovit-sp-gmbh/hcloud-sdk-js/issues"
|
|
27
|
+
},
|
|
28
|
+
"author": "MoovIT SP GmbH (info@moovit-sp.com)",
|
|
29
|
+
"homepage": "https://github.com/moovit-sp-gmbh/hcloud-sdk-js#readme",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/chai": "^4.3.1",
|
|
32
|
+
"@types/mocha": "^9.1.1",
|
|
33
|
+
"chai": "^4.3.6",
|
|
34
|
+
"mocha": "^10.0.0",
|
|
35
|
+
"prettier": "^2.6.2",
|
|
36
|
+
"ts-node": "^10.8.0",
|
|
37
|
+
"tslint": "^6.1.3",
|
|
38
|
+
"tslint-config-prettier": "^1.18.0",
|
|
39
|
+
"typescript": "^4.7.2"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"axios": "^0.27.2"
|
|
43
|
+
}
|
|
44
|
+
}
|