@venturialstd/gitlab 0.0.20 → 0.0.22
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/dist/gitlab.module.d.ts.map +1 -1
- package/dist/gitlab.module.js +1 -2
- package/dist/gitlab.module.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/gitlab-oauth.service.d.ts +1 -3
- package/dist/services/gitlab-oauth.service.d.ts.map +1 -1
- package/dist/services/gitlab-oauth.service.js +8 -9
- package/dist/services/gitlab-oauth.service.js.map +1 -1
- package/package.json +1 -1
- package/dist/controllers/gitlab-oauth.controller.d.ts +0 -19
- package/dist/controllers/gitlab-oauth.controller.d.ts.map +0 -1
- package/dist/controllers/gitlab-oauth.controller.js +0 -48
- package/dist/controllers/gitlab-oauth.controller.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.module.d.ts","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab.module.d.ts","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":"AASA,qBAMa,YAAY;CAAG"}
|
package/dist/gitlab.module.js
CHANGED
|
@@ -11,7 +11,6 @@ const axios_1 = require("@nestjs/axios");
|
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const core_1 = require("@venturialstd/core");
|
|
13
13
|
const gitlab_client_1 = require("./client/gitlab.client");
|
|
14
|
-
const gitlab_oauth_controller_1 = require("./controllers/gitlab-oauth.controller");
|
|
15
14
|
const gitlab_webhook_controller_1 = require("./controllers/webhooks/gitlab-webhook.controller");
|
|
16
15
|
const gitlab_oauth_service_1 = require("./services/gitlab-oauth.service");
|
|
17
16
|
const gitlab_project_service_1 = require("./services/gitlab-project.service");
|
|
@@ -21,7 +20,7 @@ exports.GitlabModule = GitlabModule;
|
|
|
21
20
|
exports.GitlabModule = GitlabModule = __decorate([
|
|
22
21
|
(0, common_1.Module)({
|
|
23
22
|
imports: [axios_1.HttpModule, core_1.AppLoggerModule, core_1.SettingsModule],
|
|
24
|
-
controllers: [gitlab_webhook_controller_1.GitlabWebhookController
|
|
23
|
+
controllers: [gitlab_webhook_controller_1.GitlabWebhookController],
|
|
25
24
|
providers: [gitlab_client_1.GitlabClient, gitlab_project_service_1.GitlabProjectService, gitlab_oauth_service_1.GitlabOAuthService],
|
|
26
25
|
exports: [gitlab_project_service_1.GitlabProjectService, gitlab_oauth_service_1.GitlabOAuthService],
|
|
27
26
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AACxC,6CAAqE;AAErE,0DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AACxC,6CAAqE;AAErE,0DAAsD;AACtD,gGAA2F;AAC3F,0EAAqE;AACrE,8EAAyE;AAQlE,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kBAAU,EAAE,sBAAe,EAAE,qBAAc,CAAC;QACtD,WAAW,EAAE,CAAC,mDAAuB,CAAC;QACtC,SAAS,EAAE,CAAC,4BAAY,EAAE,6CAAoB,EAAE,yCAAkB,CAAC;QACnE,OAAO,EAAE,CAAC,6CAAoB,EAAE,yCAAkB,CAAC;KACpD,CAAC;GACW,YAAY,CAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './client/gitlab.client';
|
|
2
2
|
export * from './constants/gitlab-merge-request.constant';
|
|
3
3
|
export * from './constants/gitlab-webhook.constant';
|
|
4
|
-
export * from './controllers/gitlab-oauth.controller';
|
|
5
4
|
export * from './dtos/gitlab-merge-request.dto';
|
|
6
5
|
export * from './gitlab.module';
|
|
7
6
|
export * from './interfaces/gitlab-client-config.interface';
|
|
8
7
|
export * from './interfaces/gitlab-project.interface';
|
|
8
|
+
export * from './services/gitlab-oauth.service';
|
|
9
9
|
export * from './services/gitlab-project.service';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,10 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./client/gitlab.client"), exports);
|
|
18
18
|
__exportStar(require("./constants/gitlab-merge-request.constant"), exports);
|
|
19
19
|
__exportStar(require("./constants/gitlab-webhook.constant"), exports);
|
|
20
|
-
__exportStar(require("./controllers/gitlab-oauth.controller"), exports);
|
|
21
20
|
__exportStar(require("./dtos/gitlab-merge-request.dto"), exports);
|
|
22
21
|
__exportStar(require("./gitlab.module"), exports);
|
|
23
22
|
__exportStar(require("./interfaces/gitlab-client-config.interface"), exports);
|
|
24
23
|
__exportStar(require("./interfaces/gitlab-project.interface"), exports);
|
|
24
|
+
__exportStar(require("./services/gitlab-oauth.service"), exports);
|
|
25
25
|
__exportStar(require("./services/gitlab-project.service"), exports);
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,4EAA0D;AAC1D,sEAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,4EAA0D;AAC1D,sEAAoD;AACpD,kEAAgD;AAChD,kDAAgC;AAChC,8EAA4D;AAC5D,wEAAsD;AACtD,kEAAgD;AAChD,oEAAkD"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { HttpService } from '@nestjs/axios';
|
|
2
1
|
import { SettingsService } from '@venturialstd/core';
|
|
3
2
|
export declare class GitlabOAuthService {
|
|
4
3
|
private readonly settings;
|
|
5
|
-
|
|
6
|
-
constructor(settings: SettingsService, httpService: HttpService);
|
|
4
|
+
constructor(settings: SettingsService);
|
|
7
5
|
exchangeCode(code: string): Promise<any>;
|
|
8
6
|
}
|
|
9
7
|
//# 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":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,qBACa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,eAAe;IAEhD,YAAY,CAAC,IAAI,EAAE,MAAM;CAkBhC"}
|
|
@@ -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
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.GitlabOAuthService = void 0;
|
|
13
|
-
const axios_1 = require("@nestjs/axios");
|
|
14
16
|
const common_1 = require("@nestjs/common");
|
|
15
17
|
const core_1 = require("@venturialstd/core");
|
|
16
|
-
const
|
|
18
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
19
|
const gitlab_settings_constants_1 = require("../constants/gitlab.settings.constants");
|
|
18
20
|
const gitlab_auth_constant_1 = require("../constants/gitlab-auth.constant");
|
|
19
21
|
let GitlabOAuthService = class GitlabOAuthService {
|
|
20
22
|
settings;
|
|
21
|
-
|
|
22
|
-
constructor(settings, httpService) {
|
|
23
|
+
constructor(settings) {
|
|
23
24
|
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 axios_1.default.post(`${gitlab_host}/oauth/token`, null, {
|
|
32
32
|
params: {
|
|
33
33
|
client_id: client_id,
|
|
34
34
|
client_secret: secret,
|
|
@@ -36,14 +36,13 @@ 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
|
|
47
|
-
axios_1.HttpService])
|
|
46
|
+
__metadata("design:paramtypes", [core_1.SettingsService])
|
|
48
47
|
], GitlabOAuthService);
|
|
49
48
|
//# 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,2CAA4C;AAC5C,6CAAqD;AACrD,kDAA0B;AAE1B,sFAA6E;AAC7E,4EAAuE;AAGhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAE1D,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;QAErF,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,GAAG,WAAW,cAAc,EAAE,IAAI,EAAE;YACpE,MAAM,EAAE;gBACN,SAAS,EAAE,SAAS;gBACpB,aAAa,EAAE,MAAM;gBACrB,IAAI;gBACJ,UAAU,EAAE,yCAAkB,CAAC,kBAAkB;gBACjD,YAAY,EAAE,GAAG;aAClB;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF,CAAA;AArBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAE4B,sBAAe;GAD3C,kBAAkB,CAqB9B"}
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { GitlabOAuthService } from '../services/gitlab-oauth.service';
|
|
2
|
-
export declare class GitlabAuthController {
|
|
3
|
-
private readonly gitlabOAuth;
|
|
4
|
-
constructor(gitlabOAuth: GitlabOAuthService);
|
|
5
|
-
exchangeCode(body: {
|
|
6
|
-
code: string;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
error: string;
|
|
9
|
-
access_token?: undefined;
|
|
10
|
-
refresh_token?: undefined;
|
|
11
|
-
expires_in?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
access_token: any;
|
|
14
|
-
refresh_token: any;
|
|
15
|
-
expires_in: any;
|
|
16
|
-
error?: undefined;
|
|
17
|
-
}>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=gitlab-oauth.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-oauth.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/gitlab-oauth.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAItD,YAAY,CAAS,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;CAalD"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GitlabAuthController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const gitlab_oauth_service_1 = require("../services/gitlab-oauth.service");
|
|
18
|
-
let GitlabAuthController = class GitlabAuthController {
|
|
19
|
-
gitlabOAuth;
|
|
20
|
-
constructor(gitlabOAuth) {
|
|
21
|
-
this.gitlabOAuth = gitlabOAuth;
|
|
22
|
-
}
|
|
23
|
-
async exchangeCode(body) {
|
|
24
|
-
if (!body.code) {
|
|
25
|
-
return { error: 'Missing code' };
|
|
26
|
-
}
|
|
27
|
-
const token = await this.gitlabOAuth.exchangeCode(body.code);
|
|
28
|
-
return {
|
|
29
|
-
access_token: token.access_token,
|
|
30
|
-
refresh_token: token.refresh_token,
|
|
31
|
-
expires_in: token.expires_in,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.GitlabAuthController = GitlabAuthController;
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, common_1.Post)('exchange'),
|
|
38
|
-
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
39
|
-
__param(0, (0, common_1.Body)()),
|
|
40
|
-
__metadata("design:type", Function),
|
|
41
|
-
__metadata("design:paramtypes", [Object]),
|
|
42
|
-
__metadata("design:returntype", Promise)
|
|
43
|
-
], GitlabAuthController.prototype, "exchangeCode", null);
|
|
44
|
-
exports.GitlabAuthController = GitlabAuthController = __decorate([
|
|
45
|
-
(0, common_1.Controller)('auth/gitlab'),
|
|
46
|
-
__metadata("design:paramtypes", [gitlab_oauth_service_1.GitlabOAuthService])
|
|
47
|
-
], GitlabAuthController);
|
|
48
|
-
//# sourceMappingURL=gitlab-oauth.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-oauth.controller.js","sourceRoot":"","sources":["../../src/controllers/gitlab-oauth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8E;AAE9E,2EAAsE;AAG/D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,WAA+B;QAA/B,gBAAW,GAAX,WAAW,CAAoB;IAAG,CAAC;IAI1D,AAAN,KAAK,CAAC,YAAY,CAAS,IAAsB;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;QACnC,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE7D,OAAO;YACL,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;CACF,CAAA;AAlBY,oDAAoB;AAKzB;IAFL,IAAA,aAAI,EAAC,UAAU,CAAC;IAChB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IACJ,WAAA,IAAA,aAAI,GAAE,CAAA;;;;wDAYzB;+BAjBU,oBAAoB;IADhC,IAAA,mBAAU,EAAC,aAAa,CAAC;qCAEkB,yCAAkB;GADjD,oBAAoB,CAkBhC"}
|