itlab-internal-services 1.5.1 → 1.5.3
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.
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
username: string;
|
|
5
|
-
email: string;
|
|
6
|
-
avatar?: string;
|
|
7
|
-
}
|
|
2
|
+
import { AccountInformation } from 'itlab-functions';
|
|
8
3
|
export declare class AccountService {
|
|
9
4
|
protected readonly instance: AxiosInstance;
|
|
10
5
|
constructor(instance?: AxiosInstance);
|
|
@@ -24,23 +24,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.AccountService =
|
|
27
|
+
exports.AccountService = void 0;
|
|
28
28
|
const common_1 = require("@nestjs/common");
|
|
29
29
|
const axios_1 = __importDefault(require("axios"));
|
|
30
30
|
const internal_constants_1 = require("../internal.constants");
|
|
31
|
-
class AccountInformation {
|
|
32
|
-
}
|
|
33
|
-
exports.AccountInformation = AccountInformation;
|
|
34
31
|
let AccountService = class AccountService {
|
|
35
32
|
constructor(instance = axios_1.default) {
|
|
36
33
|
this.instance = instance;
|
|
37
|
-
this.prefix = 'account';
|
|
34
|
+
this.prefix = 'account/internal';
|
|
38
35
|
}
|
|
39
36
|
create(accountId, email) {
|
|
40
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
38
|
return new Promise((resolve, reject) => {
|
|
42
39
|
this.instance
|
|
43
|
-
.post(`${this.prefix}
|
|
40
|
+
.post(`${this.prefix}`, { accountId, email })
|
|
44
41
|
.then(() => resolve())
|
|
45
42
|
.catch(({ response }) => reject(new common_1.HttpException(response.data, response.status)));
|
|
46
43
|
});
|
|
@@ -52,7 +49,7 @@ let AccountService = class AccountService {
|
|
|
52
49
|
this.instance
|
|
53
50
|
.get(`${this.prefix}/${accountId}`)
|
|
54
51
|
.then(({ data }) => resolve(data))
|
|
55
|
-
.catch(() => resolve({ username: '
|
|
52
|
+
.catch((e) => resolve({ username: 'Unbekannt', id: '0', email: '' }));
|
|
56
53
|
});
|
|
57
54
|
});
|
|
58
55
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "timo.scheuermann@sv-informatik.de",
|
|
6
6
|
"url": "https://timos.design"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.5.
|
|
8
|
+
"version": "1.5.3",
|
|
9
9
|
"type": "commonjs",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"axios": "^1.2.3",
|
|
26
26
|
"feed": "^4.2.2",
|
|
27
|
-
"itlab-functions": "^0.3.
|
|
27
|
+
"itlab-functions": "^0.3.1",
|
|
28
28
|
"passport-custom": "^1.1.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|