@venturialstd/gitlab 0.0.9 → 0.0.10
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/client/gitlab.client.d.ts +4 -5
- package/dist/client/gitlab.client.d.ts.map +1 -1
- package/dist/client/gitlab.client.js +15 -7
- package/dist/client/gitlab.client.js.map +1 -1
- package/dist/constants/gitlab.settings.constants.d.ts +7 -0
- package/dist/constants/gitlab.settings.constants.d.ts.map +1 -0
- package/dist/constants/gitlab.settings.constants.js +10 -0
- package/dist/constants/gitlab.settings.constants.js.map +1 -0
- package/dist/controllers/webhooks/gitlab-webhook.controller.d.ts +3 -3
- package/dist/controllers/webhooks/gitlab-webhook.controller.d.ts.map +1 -1
- package/dist/controllers/webhooks/gitlab-webhook.controller.js +6 -4
- package/dist/controllers/webhooks/gitlab-webhook.controller.js.map +1 -1
- package/dist/dtos/gitlab-merge-request.dto.d.ts.map +1 -1
- package/dist/dtos/gitlab-merge-request.dto.js +1 -1
- package/dist/dtos/gitlab-merge-request.dto.js.map +1 -1
- package/dist/gitlab.module.d.ts +0 -3
- package/dist/gitlab.module.d.ts.map +1 -1
- package/dist/gitlab.module.js +9 -26
- package/dist/gitlab.module.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/services/gitlab-project.service.d.ts +2 -2
- package/dist/services/gitlab-project.service.d.ts.map +1 -1
- package/dist/services/gitlab-project.service.js +1 -1
- package/dist/services/gitlab-project.service.js.map +1 -1
- package/dist/settings/gitlab.settings.d.ts +3 -0
- package/dist/settings/gitlab.settings.d.ts.map +1 -0
- package/dist/settings/gitlab.settings.js +43 -0
- package/dist/settings/gitlab.settings.js.map +1 -0
- package/package.json +5 -5
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { HttpService } from "@nestjs/axios";
|
|
2
2
|
import { GITLAB_CLIENT_METHOD } from "../constants/gitlab-client.constant";
|
|
3
|
-
import {
|
|
4
|
-
import { GitlabLogger } from "../interfaces/gitlab-logger.interface";
|
|
3
|
+
import { AppLogger, SettingsService } from "@venturialstd/core";
|
|
5
4
|
export declare class GitlabClient {
|
|
6
5
|
private readonly httpService;
|
|
7
|
-
private readonly
|
|
8
|
-
private readonly
|
|
9
|
-
constructor(httpService: HttpService,
|
|
6
|
+
private readonly logger;
|
|
7
|
+
private readonly settings;
|
|
8
|
+
constructor(httpService: HttpService, logger: AppLogger, settings: SettingsService);
|
|
10
9
|
request(method: GITLAB_CLIENT_METHOD, url: string): Promise<any>;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=gitlab.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.client.d.ts","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"gitlab.client.d.ts","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGhE,qBACa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAFR,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,eAAe;IAGtC,OAAO,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM;CA2BxD"}
|
|
@@ -13,28 +13,34 @@ exports.GitlabClient = void 0;
|
|
|
13
13
|
const axios_1 = require("@nestjs/axios");
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const rxjs_1 = require("rxjs");
|
|
16
|
+
const core_1 = require("@venturialstd/core");
|
|
17
|
+
const gitlab_settings_constants_1 = require("../constants/gitlab.settings.constants");
|
|
16
18
|
let GitlabClient = class GitlabClient {
|
|
17
19
|
httpService;
|
|
18
|
-
config;
|
|
19
20
|
logger;
|
|
20
|
-
|
|
21
|
+
settings;
|
|
22
|
+
constructor(httpService, logger, settings) {
|
|
21
23
|
this.httpService = httpService;
|
|
22
|
-
this.config = config;
|
|
23
24
|
this.logger = logger;
|
|
25
|
+
this.settings = settings;
|
|
24
26
|
}
|
|
25
27
|
async request(method, url) {
|
|
26
|
-
const
|
|
28
|
+
const host = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_HOST);
|
|
29
|
+
const token = await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_API_TOKEN);
|
|
30
|
+
if (!host || !token)
|
|
31
|
+
throw new Error("GitLab host or token is not defined in settings");
|
|
32
|
+
const fullUrl = `${host}${url}`;
|
|
27
33
|
try {
|
|
28
34
|
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.request({
|
|
29
35
|
method,
|
|
30
36
|
url: fullUrl,
|
|
31
|
-
headers: { "PRIVATE-TOKEN":
|
|
37
|
+
headers: { "PRIVATE-TOKEN": token },
|
|
32
38
|
}));
|
|
33
39
|
this.logger?.log(`Response OK: ${method} ${fullUrl}`);
|
|
34
40
|
return response.data;
|
|
35
41
|
}
|
|
36
42
|
catch (err) {
|
|
37
|
-
this.logger
|
|
43
|
+
this.logger.error(`Error on request: ${method} ${fullUrl} - ${err}`);
|
|
38
44
|
throw err;
|
|
39
45
|
}
|
|
40
46
|
}
|
|
@@ -42,6 +48,8 @@ let GitlabClient = class GitlabClient {
|
|
|
42
48
|
exports.GitlabClient = GitlabClient;
|
|
43
49
|
exports.GitlabClient = GitlabClient = __decorate([
|
|
44
50
|
(0, common_1.Injectable)(),
|
|
45
|
-
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
51
|
+
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
52
|
+
core_1.AppLogger,
|
|
53
|
+
core_1.SettingsService])
|
|
46
54
|
], GitlabClient);
|
|
47
55
|
//# sourceMappingURL=gitlab.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.client.js","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,+BAAsC;
|
|
1
|
+
{"version":3,"file":"gitlab.client.js","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,+BAAsC;AAEtC,6CAAgE;AAChE,sFAA6E;AAGtE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEJ;IACA;IACA;IAHnB,YACmB,WAAwB,EACxB,MAAiB,EACjB,QAAyB;QAFzB,gBAAW,GAAX,WAAW,CAAa;QACxB,WAAM,GAAN,MAAM,CAAW;QACjB,aAAQ,GAAR,QAAQ,CAAiB;IACzC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,MAA4B,EAAE,GAAW;QACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+CAAmB,CAAC,YAAY,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CACnC,+CAAmB,CAAC,iBAAiB,CACtC,CAAC;QACF,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK;YACjB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAErE,MAAM,OAAO,GAAG,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;QAEhC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAc,EACnC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBACvB,MAAM;gBACN,GAAG,EAAE,OAAO;gBACZ,OAAO,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;aACpC,CAAC,CACH,CAAC;YACF,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;YACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,qBAAqB,MAAM,IAAI,OAAO,MAAM,GAAY,EAAE,CAC3D,CAAC;YACF,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF,CAAA;AAlCY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAGqB,mBAAW;QAChB,gBAAS;QACP,sBAAe;GAJjC,YAAY,CAkCxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.settings.constants.d.ts","sourceRoot":"","sources":["../../src/constants/gitlab.settings.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;CAK/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GITLAB_SETTING_KEYS = void 0;
|
|
4
|
+
exports.GITLAB_SETTING_KEYS = {
|
|
5
|
+
GENERAL_ENABLED: 'GLOBAL:GITLAB:GENERAL:ENABLED',
|
|
6
|
+
GENERAL_HOST: 'GLOBAL:GITLAB:GENERAL:HOST',
|
|
7
|
+
GENERAL_API_TOKEN: 'GLOBAL:GITLAB:GENERAL:TOKEN',
|
|
8
|
+
GENERAL_PROJECT_ID: 'GLOBAL:GITLAB:GENERAL:PROJECT_ID',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=gitlab.settings.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.settings.constants.js","sourceRoot":"","sources":["../../src/constants/gitlab.settings.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,eAAe,EAAE,+BAA+B;IAChD,YAAY,EAAE,4BAA4B;IAC1C,iBAAiB,EAAE,6BAA6B;IAChD,kBAAkB,EAAE,kCAAkC;CACvD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EventEmitter2 } from
|
|
2
|
-
import { GITLAB_WEBHOOK_STATUS } from
|
|
3
|
-
import { GitlabMergeRequestDto } from
|
|
1
|
+
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
2
|
+
import { GITLAB_WEBHOOK_STATUS } from '../../constants/gitlab-webhook.constant';
|
|
3
|
+
import { GitlabMergeRequestDto } from '../../dtos/gitlab-merge-request.dto';
|
|
4
4
|
export declare class GitlabWebhookController {
|
|
5
5
|
private readonly eventEmitter;
|
|
6
6
|
constructor(eventEmitter: EventEmitter2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-webhook.controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/webhooks/gitlab-webhook.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab-webhook.controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/webhooks/gitlab-webhook.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMtD,OAAO,EAEL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,qBACa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,aAAa;IAIxD,kBAAkB,CACW,KAAK,EAAE,MAAM,EAChC,OAAO,EAAE,qBAAqB;;;CAkBzC"}
|
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.GitlabWebhookController = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
18
|
-
const gitlab_webhook_constant_1 = require("../../constants/gitlab-webhook.constant");
|
|
19
18
|
const gitlab_merge_request_constant_1 = require("../../constants/gitlab-merge-request.constant");
|
|
19
|
+
const gitlab_webhook_constant_1 = require("../../constants/gitlab-webhook.constant");
|
|
20
20
|
const gitlab_merge_request_dto_1 = require("../../dtos/gitlab-merge-request.dto");
|
|
21
21
|
let GitlabWebhookController = class GitlabWebhookController {
|
|
22
22
|
eventEmitter;
|
|
@@ -29,7 +29,9 @@ let GitlabWebhookController = class GitlabWebhookController {
|
|
|
29
29
|
const action = payload?.object_attributes?.action;
|
|
30
30
|
switch (action) {
|
|
31
31
|
case gitlab_merge_request_constant_1.GITLAB_MERGE_REQUEST_ACTION.OPEN:
|
|
32
|
-
this.eventEmitter.emit(gitlab_merge_request_constant_1.GITLAB_EVENT_EMITTER.MERGE_REQUEST_RECEIVED, payload, {
|
|
32
|
+
this.eventEmitter.emit(gitlab_merge_request_constant_1.GITLAB_EVENT_EMITTER.MERGE_REQUEST_RECEIVED, payload, {
|
|
33
|
+
async: true,
|
|
34
|
+
});
|
|
33
35
|
return { status: gitlab_webhook_constant_1.GITLAB_WEBHOOK_STATUS.OK };
|
|
34
36
|
default:
|
|
35
37
|
return { status: gitlab_webhook_constant_1.GITLAB_WEBHOOK_STATUS.IGNORED };
|
|
@@ -40,14 +42,14 @@ exports.GitlabWebhookController = GitlabWebhookController;
|
|
|
40
42
|
__decorate([
|
|
41
43
|
(0, common_1.Post)(),
|
|
42
44
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
43
|
-
__param(0, (0, common_1.Headers)(
|
|
45
|
+
__param(0, (0, common_1.Headers)('x-gitlab-event')),
|
|
44
46
|
__param(1, (0, common_1.Body)()),
|
|
45
47
|
__metadata("design:type", Function),
|
|
46
48
|
__metadata("design:paramtypes", [String, gitlab_merge_request_dto_1.GitlabMergeRequestDto]),
|
|
47
49
|
__metadata("design:returntype", void 0)
|
|
48
50
|
], GitlabWebhookController.prototype, "handleMergeRequest", null);
|
|
49
51
|
exports.GitlabWebhookController = GitlabWebhookController = __decorate([
|
|
50
|
-
(0, common_1.Controller)(
|
|
52
|
+
(0, common_1.Controller)('webhooks/gitlab'),
|
|
51
53
|
__metadata("design:paramtypes", [event_emitter_1.EventEmitter2])
|
|
52
54
|
], GitlabWebhookController);
|
|
53
55
|
//# sourceMappingURL=gitlab-webhook.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-webhook.controller.js","sourceRoot":"","sources":["../../../src/controllers/webhooks/gitlab-webhook.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"gitlab-webhook.controller.js","sourceRoot":"","sources":["../../../src/controllers/webhooks/gitlab-webhook.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuF;AACvF,yDAAsD;AAEtD,iGAGuD;AACvD,qFAGiD;AACjD,kFAA4E;AAGrE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACL;IAA7B,YAA6B,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;IAAG,CAAC;IAI5D,kBAAkB,CACW,KAAa,EAChC,OAA8B;QAEtC,IAAI,KAAK,KAAK,8CAAoB,CAAC,aAAa;YAC9C,OAAO,EAAE,MAAM,EAAE,+CAAqB,CAAC,OAAO,EAAE,CAAC;QAEnD,MAAM,MAAM,GAAG,OAAO,EAAE,iBAAiB,EAAE,MAAM,CAAC;QAElD,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,2DAA2B,CAAC,IAAI;gBACnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oDAAoB,CAAC,sBAAsB,EAAE,OAAO,EAAE;oBAC3E,KAAK,EAAE,IAAI;iBACZ,CAAC,CAAC;gBACH,OAAO,EAAE,MAAM,EAAE,+CAAqB,CAAC,EAAE,EAAE,CAAC;YAE9C;gBACE,OAAO,EAAE,MAAM,EAAE,+CAAqB,CAAC,OAAO,EAAE,CAAC;QACrD,CAAC;IACH,CAAC;CACF,CAAA;AAzBY,0DAAuB;AAKlC;IAFC,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,gBAAO,EAAC,gBAAgB,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAU,gDAAqB;;iEAiBvC;kCAxBU,uBAAuB;IADnC,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEe,6BAAa;GAD7C,uBAAuB,CAyBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-merge-request.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/gitlab-merge-request.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab-merge-request.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/gitlab-merge-request.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,gBAAgB;IAE3B,EAAE,CAAC,EAAE,MAAM,CAAC;IAGZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,yBAAyB;IAGpC,EAAE,CAAC,EAAE,MAAM,CAAC;IAIZ,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,qBAAqB;IAEhC,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAK3B,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;CAC/C"}
|
|
@@ -10,8 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GitlabMergeRequestDto = exports.GitlabObjectAttributesDto = exports.GitlabProjectDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
15
|
class GitlabProjectDto {
|
|
16
16
|
id;
|
|
17
17
|
name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-merge-request.dto.js","sourceRoot":"","sources":["../../src/dtos/gitlab-merge-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"gitlab-merge-request.dto.js","sourceRoot":"","sources":["../../src/dtos/gitlab-merge-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAiF;AAEjF,MAAa,gBAAgB;IAE3B,EAAE,CAAU;IAGZ,IAAI,CAAU;IAGd,OAAO,CAAU;CAClB;AATD,4CASC;AAPC;IADC,IAAA,0BAAQ,GAAE;;4CACC;AAGZ;IADC,IAAA,0BAAQ,GAAE;;8CACG;AAGd;IADC,IAAA,0BAAQ,GAAE;;iDACM;AAGnB,MAAa,yBAAyB;IAGpC,EAAE,CAAU;IAIZ,GAAG,CAAU;IAIb,MAAM,CAAU;IAIhB,KAAK,CAAU;IAIf,aAAa,CAAU;IAIvB,aAAa,CAAU;IAIvB,GAAG,CAAU;IAIb,SAAS,CAAU;IAInB,KAAK,CAAU;CAChB;AApCD,8DAoCC;AAjCC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACD;AAIZ;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACA;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yDACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACE;AAIf;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gEACU;AAIvB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gEACU;AAIvB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACA;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACM;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACE;AAGjB,MAAa,qBAAqB;IAEhC,WAAW,CAAU;IAIrB,UAAU,CAAU;IAKpB,OAAO,CAAoB;IAK3B,iBAAiB,CAA6B;CAC/C;AAjBD,sDAiBC;AAfC;IADC,IAAA,0BAAQ,GAAE;;0DACU;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yDACO;AAKpB;IAHC,IAAA,gCAAc,GAAE;IAChB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC;8BACnB,gBAAgB;sDAAC;AAK3B;IAHC,IAAA,gCAAc,GAAE;IAChB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;8BAClB,yBAAyB;gEAAC"}
|
package/dist/gitlab.module.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { DynamicModule } from "@nestjs/common";
|
|
2
|
-
import { GitlabClientConfig } from "./interfaces/gitlab-client-config.interface";
|
|
3
1
|
export declare class GitlabModule {
|
|
4
|
-
static register(config: GitlabClientConfig): DynamicModule;
|
|
5
2
|
}
|
|
6
3
|
//# sourceMappingURL=gitlab.module.d.ts.map
|
|
@@ -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":"AAOA,qBAMa,YAAY;CAAG"}
|
package/dist/gitlab.module.js
CHANGED
|
@@ -5,39 +5,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var GitlabModule_1;
|
|
9
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
9
|
exports.GitlabModule = void 0;
|
|
11
10
|
const axios_1 = require("@nestjs/axios");
|
|
12
11
|
const common_1 = require("@nestjs/common");
|
|
13
12
|
const gitlab_client_1 = require("./client/gitlab.client");
|
|
14
|
-
const gitlab_project_service_1 = require("./services/gitlab-project.service");
|
|
15
|
-
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
16
13
|
const gitlab_webhook_controller_1 = require("./controllers/webhooks/gitlab-webhook.controller");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
module: GitlabModule_1,
|
|
21
|
-
imports: [axios_1.HttpModule, event_emitter_1.EventEmitterModule.forRoot()],
|
|
22
|
-
controllers: [gitlab_webhook_controller_1.GitlabWebhookController],
|
|
23
|
-
providers: [
|
|
24
|
-
{
|
|
25
|
-
provide: "GITLAB_CLIENT_CONFIG",
|
|
26
|
-
useValue: config,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
provide: gitlab_client_1.GitlabClient,
|
|
30
|
-
useFactory: (http, cfg) => new gitlab_client_1.GitlabClient(http, cfg),
|
|
31
|
-
inject: [axios_1.HttpService, "GITLAB_CLIENT_CONFIG"],
|
|
32
|
-
},
|
|
33
|
-
gitlab_project_service_1.GitlabProjectService,
|
|
34
|
-
],
|
|
35
|
-
exports: [gitlab_client_1.GitlabClient, gitlab_project_service_1.GitlabProjectService],
|
|
36
|
-
};
|
|
37
|
-
}
|
|
14
|
+
const gitlab_project_service_1 = require("./services/gitlab-project.service");
|
|
15
|
+
let GitlabModule = class GitlabModule {
|
|
38
16
|
};
|
|
39
17
|
exports.GitlabModule = GitlabModule;
|
|
40
|
-
exports.GitlabModule = GitlabModule =
|
|
41
|
-
(0, common_1.Module)({
|
|
18
|
+
exports.GitlabModule = GitlabModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [axios_1.HttpModule],
|
|
21
|
+
controllers: [gitlab_webhook_controller_1.GitlabWebhookController],
|
|
22
|
+
providers: [gitlab_client_1.GitlabClient, gitlab_project_service_1.GitlabProjectService],
|
|
23
|
+
exports: [gitlab_client_1.GitlabClient, gitlab_project_service_1.GitlabProjectService],
|
|
24
|
+
})
|
|
42
25
|
], GitlabModule);
|
|
43
26
|
//# sourceMappingURL=gitlab.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AAExC,0DAAsD;AACtD,gGAA2F;AAC3F,8EAAyE;AAQlE,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kBAAU,CAAC;QACrB,WAAW,EAAE,CAAC,mDAAuB,CAAC;QACtC,SAAS,EAAE,CAAC,4BAAY,EAAE,6CAAoB,CAAC;QAC/C,OAAO,EAAE,CAAC,4BAAY,EAAE,6CAAoB,CAAC;KAC9C,CAAC;GACW,YAAY,CAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './client/gitlab.client';
|
|
2
|
+
export * from './constants/gitlab-merge-request.constant';
|
|
3
|
+
export * from './constants/gitlab-webhook.constant';
|
|
4
|
+
export * from './dtos/gitlab-merge-request.dto';
|
|
5
|
+
export * from './gitlab.module';
|
|
6
|
+
export * from './interfaces/gitlab-client-config.interface';
|
|
7
|
+
export * from './services/gitlab-project.service';
|
|
8
8
|
//# 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,
|
|
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,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,10 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client/gitlab.client"), exports);
|
|
18
|
-
__exportStar(require("./gitlab.module"), exports);
|
|
19
|
-
__exportStar(require("./interfaces/gitlab-client-config.interface"), exports);
|
|
20
|
-
__exportStar(require("./services/gitlab-project.service"), exports);
|
|
21
18
|
__exportStar(require("./constants/gitlab-merge-request.constant"), exports);
|
|
22
19
|
__exportStar(require("./constants/gitlab-webhook.constant"), exports);
|
|
23
20
|
__exportStar(require("./dtos/gitlab-merge-request.dto"), exports);
|
|
21
|
+
__exportStar(require("./gitlab.module"), exports);
|
|
22
|
+
__exportStar(require("./interfaces/gitlab-client-config.interface"), exports);
|
|
23
|
+
__exportStar(require("./services/gitlab-project.service"), exports);
|
|
24
24
|
//# 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,
|
|
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,oEAAkD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GitlabClient } from
|
|
2
|
-
import { GitlabMergeRequest } from
|
|
1
|
+
import { GitlabClient } from '../client/gitlab.client';
|
|
2
|
+
import { GitlabMergeRequest } from '../interfaces/gitlab-project.interface';
|
|
3
3
|
export declare class GitlabProjectService {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: GitlabClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-project.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab-project.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAOlE,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAO5E"}
|
|
@@ -24,7 +24,7 @@ let GitlabProjectService = class GitlabProjectService {
|
|
|
24
24
|
getMergeRequestDiff(projectId, mrId) {
|
|
25
25
|
return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/merge_requests/${mrId}/raw_diffs`);
|
|
26
26
|
}
|
|
27
|
-
getFile(projectId, filePath, ref =
|
|
27
|
+
getFile(projectId, filePath, ref = 'main') {
|
|
28
28
|
const encoded = encodeURIComponent(filePath);
|
|
29
29
|
return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/repository/files/${encoded}/raw?ref=${ref}`);
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;
|
|
1
|
+
{"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2DAAuD;AACvD,gFAA2E;AAIpE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAErD,gBAAgB,CAAC,SAAiB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,8BAA8B,CACrD,CAAC;IACJ,CAAC;IAED,mBAAmB,CAAC,SAAiB,EAAE,IAAY;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,mBAAmB,IAAI,YAAY,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,SAAiB,EAAE,QAAgB,EAAE,GAAG,GAAG,MAAM;QACvD,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,qBAAqB,OAAO,YAAY,GAAG,EAAE,CACpE,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAE0B,4BAAY;GADtC,oBAAoB,CAwBhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.settings.d.ts","sourceRoot":"","sources":["../../src/settings/gitlab.settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,EAqCtE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SETTINGS = void 0;
|
|
4
|
+
const core_1 = require("@venturialstd/core");
|
|
5
|
+
exports.SETTINGS = [
|
|
6
|
+
{
|
|
7
|
+
scope: 'GLOBAL',
|
|
8
|
+
module: 'GITLAB',
|
|
9
|
+
section: 'GENERAL',
|
|
10
|
+
key: 'ENABLED',
|
|
11
|
+
label: 'GitLab Integration Enabled',
|
|
12
|
+
description: 'Enable or disable the GitLab integration',
|
|
13
|
+
type: core_1.SETTINGS_TYPE.BOOLEAN,
|
|
14
|
+
value: 'true',
|
|
15
|
+
options: null,
|
|
16
|
+
sortOrder: 1,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
scope: 'GLOBAL',
|
|
20
|
+
module: 'GITLAB',
|
|
21
|
+
section: 'GENERAL',
|
|
22
|
+
key: 'HOST',
|
|
23
|
+
label: 'GitLab Host URL',
|
|
24
|
+
description: 'Base URL of GitLab instance (ex. https://gitlab.com)',
|
|
25
|
+
type: core_1.SETTINGS_TYPE.TEXT,
|
|
26
|
+
value: 'https://gitlab.com/api/v4',
|
|
27
|
+
options: null,
|
|
28
|
+
sortOrder: 2,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
scope: 'GLOBAL',
|
|
32
|
+
module: 'GITLAB',
|
|
33
|
+
section: 'GENERAL',
|
|
34
|
+
key: 'TOKEN',
|
|
35
|
+
label: 'GitLab Personal Access Token',
|
|
36
|
+
description: 'Token used to authenticate API requests to GitLab',
|
|
37
|
+
type: core_1.SETTINGS_TYPE.SECRET,
|
|
38
|
+
value: '',
|
|
39
|
+
options: null,
|
|
40
|
+
sortOrder: 3,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=gitlab.settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.settings.js","sourceRoot":"","sources":["../../src/settings/gitlab.settings.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAEhD,QAAA,QAAQ,GAAuD;IAC1E;QACE,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,oBAAa,CAAC,OAAO;QAC3B,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,CAAC;KACb;IACD;QACE,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,sDAAsD;QACnE,IAAI,EAAE,oBAAa,CAAC,IAAI;QACxB,KAAK,EAAE,2BAA2B;QAClC,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,CAAC;KACb;IACD;QACE,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,GAAG,EAAE,OAAO;QACZ,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,mDAAmD;QAChE,IAAI,EAAE,oBAAa,CAAC,MAAM;QAC1B,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,CAAC;KACb;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturialstd/gitlab",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "GitLab API Venturial",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^5.9.3"
|
|
21
21
|
},
|
|
22
|
-
"dependencies": {},
|
|
23
22
|
"peerDependencies": {
|
|
23
|
+
"@nestjs/axios": "^4.0.0",
|
|
24
24
|
"@nestjs/common": "^11.0.11",
|
|
25
25
|
"@nestjs/core": "^11.0.5",
|
|
26
|
-
"@nestjs/axios": "^4.0.0",
|
|
27
|
-
"rxjs": "^7.8.1",
|
|
28
26
|
"@nestjs/event-emitter": "^3.0.1",
|
|
27
|
+
"@venturialstd/core": "^1.0.16",
|
|
29
28
|
"class-transformer": "^0.5.1",
|
|
30
|
-
"class-validator": "^0.14.1"
|
|
29
|
+
"class-validator": "^0.14.1",
|
|
30
|
+
"rxjs": "^7.8.1"
|
|
31
31
|
}
|
|
32
32
|
}
|