@venturialstd/gitlab 0.0.19 → 0.0.20
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,7 +1,9 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
1
2
|
import { SettingsService } from '@venturialstd/core';
|
|
2
3
|
export declare class GitlabOAuthService {
|
|
3
4
|
private readonly settings;
|
|
4
|
-
|
|
5
|
+
private readonly httpService;
|
|
6
|
+
constructor(settings: SettingsService, httpService: HttpService);
|
|
5
7
|
exchangeCode(code: string): Promise<any>;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=gitlab-oauth.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-oauth.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-oauth.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab-oauth.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-oauth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,qBACa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,WAAW;IAGrC,YAAY,CAAC,IAAI,EAAE,MAAM;CAoBhC"}
|
|
@@ -8,27 +8,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.GitlabOAuthService = void 0;
|
|
13
|
+
const axios_1 = require("@nestjs/axios");
|
|
16
14
|
const common_1 = require("@nestjs/common");
|
|
17
15
|
const core_1 = require("@venturialstd/core");
|
|
18
|
-
const
|
|
16
|
+
const rxjs_1 = require("rxjs");
|
|
19
17
|
const gitlab_settings_constants_1 = require("../constants/gitlab.settings.constants");
|
|
20
18
|
const gitlab_auth_constant_1 = require("../constants/gitlab-auth.constant");
|
|
21
19
|
let GitlabOAuthService = class GitlabOAuthService {
|
|
22
20
|
settings;
|
|
23
|
-
|
|
21
|
+
httpService;
|
|
22
|
+
constructor(settings, httpService) {
|
|
24
23
|
this.settings = settings;
|
|
24
|
+
this.httpService = httpService;
|
|
25
25
|
}
|
|
26
26
|
async exchangeCode(code) {
|
|
27
27
|
const secret = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_CLIENT_SECRET);
|
|
28
28
|
const client_id = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_CLIENT_ID);
|
|
29
29
|
const url = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_URL);
|
|
30
30
|
const gitlab_host = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_GITALB_HOST);
|
|
31
|
-
const response = await
|
|
31
|
+
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.post(`${gitlab_host}/oauth/token`, null, {
|
|
32
32
|
params: {
|
|
33
33
|
client_id: client_id,
|
|
34
34
|
client_secret: secret,
|
|
@@ -36,13 +36,14 @@ let GitlabOAuthService = class GitlabOAuthService {
|
|
|
36
36
|
grant_type: gitlab_auth_constant_1.GITLAB_PERMISSIONS.AUTHORIZATION_CODE,
|
|
37
37
|
redirect_uri: url,
|
|
38
38
|
},
|
|
39
|
-
});
|
|
39
|
+
}));
|
|
40
40
|
return response.data;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
exports.GitlabOAuthService = GitlabOAuthService;
|
|
44
44
|
exports.GitlabOAuthService = GitlabOAuthService = __decorate([
|
|
45
45
|
(0, common_1.Injectable)(),
|
|
46
|
-
__metadata("design:paramtypes", [core_1.SettingsService
|
|
46
|
+
__metadata("design:paramtypes", [core_1.SettingsService,
|
|
47
|
+
axios_1.HttpService])
|
|
47
48
|
], GitlabOAuthService);
|
|
48
49
|
//# sourceMappingURL=gitlab-oauth.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-oauth.service.js","sourceRoot":"","sources":["../../src/services/gitlab-oauth.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab-oauth.service.js","sourceRoot":"","sources":["../../src/services/gitlab-oauth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,6CAAqD;AACrD,+BAAsC;AAEtC,sFAA6E;AAC7E,4EAAuE;AAGhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEV;IACA;IAFnB,YACmB,QAAyB,EACzB,WAAwB;QADxB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAEJ,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+CAAmB,CAAC,qBAAqB,CAAC,CAAC;QAClF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+CAAmB,CAAC,iBAAiB,CAAC,CAAC;QACjF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+CAAmB,CAAC,WAAW,CAAC,CAAC;QACrE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+CAAmB,CAAC,mBAAmB,CAAC,CAAC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