@venturialstd/gitlab 0.0.23 → 0.0.25
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-copy.client.d.ts +11 -0
- package/dist/client/gitlab-copy.client.d.ts.map +1 -0
- package/dist/client/gitlab-copy.client.js +71 -0
- package/dist/client/gitlab-copy.client.js.map +1 -0
- package/dist/client/gitlab.client.d.ts +5 -5
- package/dist/client/gitlab.client.d.ts.map +1 -1
- package/dist/client/gitlab.client.js +13 -5
- package/dist/client/gitlab.client.js.map +1 -1
- package/dist/constants/gitlab-project.constant.d.ts +5 -0
- package/dist/constants/gitlab-project.constant.d.ts.map +1 -0
- package/dist/constants/gitlab-project.constant.js +9 -0
- package/dist/constants/gitlab-project.constant.js.map +1 -0
- package/dist/gitlab.client.d.ts +13 -0
- package/dist/gitlab.client.d.ts.map +1 -0
- package/dist/gitlab.client.js +88 -0
- package/dist/gitlab.client.js.map +1 -0
- package/dist/gitlab.service.d.ts +9 -0
- package/dist/gitlab.service.d.ts.map +1 -0
- package/dist/gitlab.service.js +70 -0
- package/dist/gitlab.service.js.map +1 -0
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/gitlab-credentials.interface.d.ts +7 -0
- package/dist/interfaces/gitlab-credentials.interface.d.ts.map +1 -1
- package/dist/interfaces/gitlab-project.interface.d.ts +118 -1
- package/dist/interfaces/gitlab-project.interface.d.ts.map +1 -1
- package/dist/services/gitlab-copy.service.d.ts +9 -0
- package/dist/services/gitlab-copy.service.d.ts.map +1 -0
- package/dist/services/gitlab-copy.service.js +72 -0
- package/dist/services/gitlab-copy.service.js.map +1 -0
- package/dist/services/gitlab-project.service.d.ts +12 -9
- package/dist/services/gitlab-project.service.d.ts.map +1 -1
- package/dist/services/gitlab-project.service.js +62 -32
- package/dist/services/gitlab-project.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
|
|
3
|
+
import { GITLAB_CLIENT_METHOD } from '../constants/gitlab-client.constant';
|
|
4
|
+
import { GitlabClientConfig } from '../interfaces/gitlab-client-config.interface';
|
|
5
|
+
export declare class GitlabClientCopy {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
private readonly config;
|
|
8
|
+
constructor(httpService: HttpService, config: GitlabClientConfig);
|
|
9
|
+
request(method: GITLAB_CLIENT_METHOD, url: string): Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=gitlab-copy.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab-copy.client.d.ts","sourceRoot":"","sources":["../../src/client/gitlab-copy.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,qBACa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,kBAAkB;IAGvC,OAAO,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM;CASxD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.GitlabClientCopy = void 0;
|
|
38
|
+
const common_1 = require("@nestjs/common");
|
|
39
|
+
const rxjs_1 = require("rxjs");
|
|
40
|
+
let GitlabClientCopy = (() => {
|
|
41
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
42
|
+
let _classDescriptor;
|
|
43
|
+
let _classExtraInitializers = [];
|
|
44
|
+
let _classThis;
|
|
45
|
+
var GitlabClientCopy = class {
|
|
46
|
+
static { _classThis = this; }
|
|
47
|
+
static {
|
|
48
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
49
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
50
|
+
GitlabClientCopy = _classThis = _classDescriptor.value;
|
|
51
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
httpService;
|
|
55
|
+
config;
|
|
56
|
+
constructor(httpService, config) {
|
|
57
|
+
this.httpService = httpService;
|
|
58
|
+
this.config = config;
|
|
59
|
+
}
|
|
60
|
+
async request(method, url) {
|
|
61
|
+
return (0, rxjs_1.firstValueFrom)(this.httpService.request({
|
|
62
|
+
method,
|
|
63
|
+
url: `${this.config.host}${url}`,
|
|
64
|
+
headers: { "PRIVATE-TOKEN": this.config.token },
|
|
65
|
+
})).then((res) => res.data);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return GitlabClientCopy = _classThis;
|
|
69
|
+
})();
|
|
70
|
+
exports.GitlabClientCopy = GitlabClientCopy;
|
|
71
|
+
//# sourceMappingURL=gitlab-copy.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab-copy.client.js","sourceRoot":"","sources":["../../src/client/gitlab-copy.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,+BAAsC;IAIzB,gBAAgB;4BAD5B,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAeC;;;YAfY,uDAAgB;;QAER,WAAW;QACX,MAAM;QAFzB,YACmB,WAAwB,EACxB,MAA0B;YAD1B,gBAAW,GAAX,WAAW,CAAa;YACxB,WAAM,GAAN,MAAM,CAAoB;QAC1C,CAAC;QAEJ,KAAK,CAAC,OAAO,CAAC,MAA4B,EAAE,GAAW;YACrD,OAAO,IAAA,qBAAc,EACnB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBACvB,MAAM;gBACN,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,EAAE;gBAChC,OAAO,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;aAChD,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;;;;AAdU,4CAAgB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HttpService } from '@nestjs/axios';
|
|
2
|
-
import { AppLogger } from '@venturialstd/core';
|
|
3
|
-
import {
|
|
4
|
-
import { GitlabOptions } from '../interfaces/gitlab-credentials.interface';
|
|
2
|
+
import { AppLogger, SettingsService } from '@venturialstd/core';
|
|
3
|
+
import { GitlabRequestParams } from '../interfaces/gitlab-credentials.interface';
|
|
5
4
|
export declare class GitlabClient {
|
|
6
5
|
private readonly httpService;
|
|
7
6
|
private readonly logger;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
private readonly settings;
|
|
8
|
+
constructor(httpService: HttpService, logger: AppLogger, settings: SettingsService);
|
|
9
|
+
request(params: GitlabRequestParams): Promise<any>;
|
|
10
10
|
}
|
|
11
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;AAE5C,OAAO,EAAE,SAAS,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;AAE5C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,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,mBAAmB;CA+B1C"}
|
|
@@ -14,17 +14,24 @@ const axios_1 = require("@nestjs/axios");
|
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const core_1 = require("@venturialstd/core");
|
|
16
16
|
const rxjs_1 = require("rxjs");
|
|
17
|
+
const gitlab_settings_constants_1 = require("../constants/gitlab.settings.constants");
|
|
17
18
|
let GitlabClient = class GitlabClient {
|
|
18
19
|
httpService;
|
|
19
20
|
logger;
|
|
20
|
-
|
|
21
|
+
settings;
|
|
22
|
+
constructor(httpService, logger, settings) {
|
|
21
23
|
this.httpService = httpService;
|
|
22
24
|
this.logger = logger;
|
|
25
|
+
this.settings = settings;
|
|
23
26
|
}
|
|
24
|
-
async request(
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
+
async request(params) {
|
|
28
|
+
const { options, method, url, data } = params;
|
|
29
|
+
const host = options?.credentials?.host || (await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_HOST));
|
|
30
|
+
const token = options?.credentials?.token ||
|
|
31
|
+
(await this.settings.get(gitlab_settings_constants_1.GITLAB_SETTING_KEYS.GENERAL_API_TOKEN));
|
|
32
|
+
if (!host || !token) {
|
|
27
33
|
throw new Error('GitLab host or token not provided');
|
|
34
|
+
}
|
|
28
35
|
const fullUrl = `${host}${url}`;
|
|
29
36
|
try {
|
|
30
37
|
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.request({
|
|
@@ -46,6 +53,7 @@ exports.GitlabClient = GitlabClient;
|
|
|
46
53
|
exports.GitlabClient = GitlabClient = __decorate([
|
|
47
54
|
(0, common_1.Injectable)(),
|
|
48
55
|
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
49
|
-
core_1.AppLogger
|
|
56
|
+
core_1.AppLogger,
|
|
57
|
+
core_1.SettingsService])
|
|
50
58
|
], GitlabClient);
|
|
51
59
|
//# 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,
|
|
1
|
+
{"version":3,"file":"gitlab.client.js","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,6CAAgE;AAChE,+BAAsC;AAEtC,sFAA6E;AAItE,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,MAA2B;QACvC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,IAAI,GACR,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC,MAAM,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;IACf,UAAU,eAAe;CAC1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GITLAB_PROJECT_LIST_TYPE = void 0;
|
|
4
|
+
var GITLAB_PROJECT_LIST_TYPE;
|
|
5
|
+
(function (GITLAB_PROJECT_LIST_TYPE) {
|
|
6
|
+
GITLAB_PROJECT_LIST_TYPE["OWNED"] = "owned";
|
|
7
|
+
GITLAB_PROJECT_LIST_TYPE["MEMBERSHIP"] = "membership";
|
|
8
|
+
})(GITLAB_PROJECT_LIST_TYPE || (exports.GITLAB_PROJECT_LIST_TYPE = GITLAB_PROJECT_LIST_TYPE = {}));
|
|
9
|
+
//# sourceMappingURL=gitlab-project.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab-project.constant.js","sourceRoot":"","sources":["../../src/constants/gitlab-project.constant.ts"],"names":[],"mappings":";;;AAAA,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,wCAAxB,wBAAwB,QAGnC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
|
|
3
|
+
import { GitlabClientConfig } from './interfaces/gitlab-client-config.interface';
|
|
4
|
+
export declare class GitlabClient {
|
|
5
|
+
private readonly httpService;
|
|
6
|
+
private readonly config;
|
|
7
|
+
constructor(httpService: HttpService, config: GitlabClientConfig);
|
|
8
|
+
private get headers();
|
|
9
|
+
getMergeRequests(projectId: string): Promise<any>;
|
|
10
|
+
getMergeRequestDiff(projectId: string, mrId: string): Promise<any>;
|
|
11
|
+
getFile(projectId: string, filePath: string, ref?: string): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=gitlab.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.client.d.ts","sourceRoot":"","sources":["../src/gitlab.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,qBACa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,kBAAkB;IAG7C,OAAO,KAAK,OAAO,GAIlB;IAEK,gBAAgB,CAAC,SAAS,EAAE,MAAM;IAQlC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAQnD,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS;CAahE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.GitlabClient = void 0;
|
|
38
|
+
const common_1 = require("@nestjs/common");
|
|
39
|
+
const rxjs_1 = require("rxjs");
|
|
40
|
+
let GitlabClient = (() => {
|
|
41
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
42
|
+
let _classDescriptor;
|
|
43
|
+
let _classExtraInitializers = [];
|
|
44
|
+
let _classThis;
|
|
45
|
+
var GitlabClient = class {
|
|
46
|
+
static { _classThis = this; }
|
|
47
|
+
static {
|
|
48
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
49
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
50
|
+
GitlabClient = _classThis = _classDescriptor.value;
|
|
51
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
httpService;
|
|
55
|
+
config;
|
|
56
|
+
constructor(httpService, config) {
|
|
57
|
+
this.httpService = httpService;
|
|
58
|
+
this.config = config;
|
|
59
|
+
}
|
|
60
|
+
get headers() {
|
|
61
|
+
return {
|
|
62
|
+
"PRIVATE-TOKEN": this.config.token,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async getMergeRequests(projectId) {
|
|
66
|
+
const url = `${this.config.host}/projects/${projectId}/merge_requests?state=opened`;
|
|
67
|
+
const { data } = await (0, rxjs_1.firstValueFrom)(this.httpService.get(url, { headers: this.headers }));
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
async getMergeRequestDiff(projectId, mrId) {
|
|
71
|
+
const url = `${this.config.host}/projects/${projectId}/merge_requests/${mrId}/raw_diffs`;
|
|
72
|
+
const { data } = await (0, rxjs_1.firstValueFrom)(this.httpService.get(url, { headers: this.headers }));
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
async getFile(projectId, filePath, ref = "main") {
|
|
76
|
+
const encoded = encodeURIComponent(filePath);
|
|
77
|
+
const url = `${this.config.host}/projects/${projectId}/repository/files/${encoded}/raw?ref=${ref}`;
|
|
78
|
+
const { data } = await (0, rxjs_1.firstValueFrom)(this.httpService.get(url, {
|
|
79
|
+
headers: this.headers,
|
|
80
|
+
responseType: "text",
|
|
81
|
+
}));
|
|
82
|
+
return data;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return GitlabClient = _classThis;
|
|
86
|
+
})();
|
|
87
|
+
exports.GitlabClient = GitlabClient;
|
|
88
|
+
//# sourceMappingURL=gitlab.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.client.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QAAQ,CAAC,CAAC;YAC7C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,aAAa,SAAS,qBAAqB,OAAO,YAAY,GAAG,EAAE,CAAC;YAEnG,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,qBAAc,EACnC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE;gBACxB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,YAAY,EAAE,MAAM;aACrB,CAAC,CACH,CAAC;YAEF,OAAO,IAAI,CAAC;QACd,CAAC;;;;AAxCU,oCAAY"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GitlabClient } from './gitlab.client';
|
|
2
|
+
export declare class GitlabService {
|
|
3
|
+
private readonly client;
|
|
4
|
+
constructor(client: GitlabClient);
|
|
5
|
+
getMergeRequests(projectId: string): Promise<any>;
|
|
6
|
+
getMergeRequestDiff(projectId: string, mrId: string): Promise<any>;
|
|
7
|
+
getFile(projectId: string, filePath: string, ref?: string): Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=gitlab.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.service.d.ts","sourceRoot":"","sources":["../src/gitlab.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBACa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD,gBAAgB,CAAC,SAAS,EAAE,MAAM;IAIlC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAInD,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS;CAG1D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.GitlabService = void 0;
|
|
38
|
+
const common_1 = require("@nestjs/common");
|
|
39
|
+
let GitlabService = (() => {
|
|
40
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
41
|
+
let _classDescriptor;
|
|
42
|
+
let _classExtraInitializers = [];
|
|
43
|
+
let _classThis;
|
|
44
|
+
var GitlabService = class {
|
|
45
|
+
static { _classThis = this; }
|
|
46
|
+
static {
|
|
47
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
48
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
49
|
+
GitlabService = _classThis = _classDescriptor.value;
|
|
50
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
51
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
52
|
+
}
|
|
53
|
+
client;
|
|
54
|
+
constructor(client) {
|
|
55
|
+
this.client = client;
|
|
56
|
+
}
|
|
57
|
+
getMergeRequests(projectId) {
|
|
58
|
+
return this.client.getMergeRequests(projectId);
|
|
59
|
+
}
|
|
60
|
+
getMergeRequestDiff(projectId, mrId) {
|
|
61
|
+
return this.client.getMergeRequestDiff(projectId, mrId);
|
|
62
|
+
}
|
|
63
|
+
getFile(projectId, filePath, ref = "main") {
|
|
64
|
+
return this.client.getFile(projectId, filePath, ref);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return GitlabService = _classThis;
|
|
68
|
+
})();
|
|
69
|
+
exports.GitlabService = GitlabService;
|
|
70
|
+
//# sourceMappingURL=gitlab.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.service.js","sourceRoot":"","sources":["../src/gitlab.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;IAI/B,aAAa;4BADzB,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAcC;;;YAdY,uDAAa;;QACK,MAAM;QAAnC,YAA6B,MAAoB;YAApB,WAAM,GAAN,MAAM,CAAc;QAAG,CAAC;QAErD,gBAAgB,CAAC,SAAiB;YAChC,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;QAED,mBAAmB,CAAC,SAAiB,EAAE,IAAY;YACjD,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;QAED,OAAO,CAAC,SAAiB,EAAE,QAAgB,EAAE,GAAG,GAAG,MAAM;YACvD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QACvD,CAAC;;;;AAbU,sCAAa"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
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 "./constants/gitlab-project.constant";
|
|
5
|
+
export * from "./dtos/gitlab-merge-request.dto";
|
|
6
|
+
export * from "./gitlab.module";
|
|
7
|
+
export * from "./interfaces/gitlab-client-config.interface";
|
|
8
|
+
export * from "./interfaces/gitlab-project.interface";
|
|
9
|
+
export * from "./interfaces/gitlab-project.interface";
|
|
10
|
+
export * from "./services/gitlab-oauth.service";
|
|
11
|
+
export * from "./services/gitlab-project.service";
|
|
10
12
|
//# 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,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,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,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,10 +17,12 @@ 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("./constants/gitlab-project.constant"), exports);
|
|
20
21
|
__exportStar(require("./dtos/gitlab-merge-request.dto"), exports);
|
|
21
22
|
__exportStar(require("./gitlab.module"), exports);
|
|
22
23
|
__exportStar(require("./interfaces/gitlab-client-config.interface"), exports);
|
|
23
24
|
__exportStar(require("./interfaces/gitlab-project.interface"), exports);
|
|
25
|
+
__exportStar(require("./interfaces/gitlab-project.interface"), exports);
|
|
24
26
|
__exportStar(require("./services/gitlab-oauth.service"), exports);
|
|
25
27
|
__exportStar(require("./services/gitlab-project.service"), exports);
|
|
26
28
|
//# 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,kEAAgD;AAChD,kDAAgC;AAChC,8EAA4D;AAC5D,wEAAsD;AACtD,kEAAgD;AAChD,oEAAkD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,4EAA0D;AAC1D,sEAAoD;AACpD,sEAAoD;AACpD,kEAAgD;AAChD,kDAAgC;AAChC,8EAA4D;AAC5D,wEAAsD;AACtD,wEAAsD;AACtD,kEAAgD;AAChD,oEAAkD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GITLAB_CLIENT_METHOD } from '../constants/gitlab-client.constant';
|
|
1
2
|
export interface GitlabCredentials {
|
|
2
3
|
host?: string;
|
|
3
4
|
token: string;
|
|
@@ -5,4 +6,10 @@ export interface GitlabCredentials {
|
|
|
5
6
|
export interface GitlabOptions {
|
|
6
7
|
credentials: GitlabCredentials;
|
|
7
8
|
}
|
|
9
|
+
export interface GitlabRequestParams {
|
|
10
|
+
options?: GitlabOptions;
|
|
11
|
+
method: GITLAB_CLIENT_METHOD;
|
|
12
|
+
url: string;
|
|
13
|
+
data?: unknown;
|
|
14
|
+
}
|
|
8
15
|
//# sourceMappingURL=gitlab-credentials.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-credentials.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/gitlab-credentials.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,iBAAiB,CAAC;CAChC"}
|
|
1
|
+
{"version":3,"file":"gitlab-credentials.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/gitlab-credentials.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GITLAB_MERGE_REQUEST_CHANGES_STATUS, GITLAB_MERGE_REQUEST_DISCUSSION_POSITION_TYPE } from
|
|
1
|
+
import { GITLAB_MERGE_REQUEST_CHANGES_STATUS, GITLAB_MERGE_REQUEST_DISCUSSION_POSITION_TYPE } from "../constants/gitlab-merge-request.constant";
|
|
2
2
|
export interface GitlabUser {
|
|
3
3
|
id: number;
|
|
4
4
|
username: string;
|
|
@@ -143,4 +143,121 @@ export interface GitlabMergeRequestPayloadDiscussion {
|
|
|
143
143
|
body: string;
|
|
144
144
|
position?: GitlabMergeRequestPositionDiscussion;
|
|
145
145
|
}
|
|
146
|
+
export interface GitlabNamespace {
|
|
147
|
+
id: number;
|
|
148
|
+
name: string;
|
|
149
|
+
path: string;
|
|
150
|
+
kind: "user" | "group";
|
|
151
|
+
full_path: string;
|
|
152
|
+
parent_id: number | null;
|
|
153
|
+
avatar_url: string | null;
|
|
154
|
+
web_url: string;
|
|
155
|
+
}
|
|
156
|
+
export interface GitlabPermissions {
|
|
157
|
+
project_access: {
|
|
158
|
+
access_level: number;
|
|
159
|
+
notification_level: number;
|
|
160
|
+
} | null;
|
|
161
|
+
group_access: {
|
|
162
|
+
access_level: number;
|
|
163
|
+
notification_level: number;
|
|
164
|
+
} | null;
|
|
165
|
+
}
|
|
166
|
+
export interface GitlabProject {
|
|
167
|
+
id: number;
|
|
168
|
+
description: string | null;
|
|
169
|
+
name: string;
|
|
170
|
+
name_with_namespace: string;
|
|
171
|
+
path: string;
|
|
172
|
+
path_with_namespace: string;
|
|
173
|
+
created_at: string;
|
|
174
|
+
updated_at: string;
|
|
175
|
+
last_activity_at: string;
|
|
176
|
+
default_branch: string;
|
|
177
|
+
visibility: "private" | "internal" | "public";
|
|
178
|
+
ssh_url_to_repo: string;
|
|
179
|
+
http_url_to_repo: string;
|
|
180
|
+
web_url: string;
|
|
181
|
+
readme_url: string | null;
|
|
182
|
+
forks_count: number;
|
|
183
|
+
star_count: number;
|
|
184
|
+
open_issues_count: number;
|
|
185
|
+
avatar_url: string | null;
|
|
186
|
+
archived: boolean;
|
|
187
|
+
empty_repo: boolean;
|
|
188
|
+
namespace: GitlabNamespace;
|
|
189
|
+
owner: GitlabUser | null;
|
|
190
|
+
permissions?: GitlabPermissions;
|
|
191
|
+
}
|
|
192
|
+
export interface GitlabWebhookCustomHeader {
|
|
193
|
+
key: string;
|
|
194
|
+
value: string;
|
|
195
|
+
}
|
|
196
|
+
export interface GitlabWebhookUrlVariable {
|
|
197
|
+
key: string;
|
|
198
|
+
value: string;
|
|
199
|
+
}
|
|
200
|
+
export interface GitlabCreateProjectWebhookPayload {
|
|
201
|
+
url: string;
|
|
202
|
+
name?: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
push_events?: boolean;
|
|
205
|
+
tag_push_events?: boolean;
|
|
206
|
+
merge_requests_events?: boolean;
|
|
207
|
+
repository_update_events?: boolean;
|
|
208
|
+
issues_events?: boolean;
|
|
209
|
+
confidential_issues_events?: boolean;
|
|
210
|
+
note_events?: boolean;
|
|
211
|
+
confidential_note_events?: boolean;
|
|
212
|
+
pipeline_events?: boolean;
|
|
213
|
+
job_events?: boolean;
|
|
214
|
+
deployment_events?: boolean;
|
|
215
|
+
releases_events?: boolean;
|
|
216
|
+
wiki_page_events?: boolean;
|
|
217
|
+
milestone_events?: boolean;
|
|
218
|
+
emoji_events?: boolean;
|
|
219
|
+
feature_flag_events?: boolean;
|
|
220
|
+
resource_access_token_events?: boolean;
|
|
221
|
+
vulnerability_events?: boolean;
|
|
222
|
+
enable_ssl_verification?: boolean;
|
|
223
|
+
push_events_branch_filter?: string;
|
|
224
|
+
branch_filter_strategy?: "wildcard" | "regex";
|
|
225
|
+
custom_webhook_template?: string;
|
|
226
|
+
custom_headers?: GitlabWebhookCustomHeader[];
|
|
227
|
+
url_variables?: GitlabWebhookUrlVariable[];
|
|
228
|
+
}
|
|
229
|
+
export interface GitlabProjectWebhook {
|
|
230
|
+
id: number;
|
|
231
|
+
project_id: number;
|
|
232
|
+
url: string;
|
|
233
|
+
name: string;
|
|
234
|
+
description: string | null;
|
|
235
|
+
created_at: string;
|
|
236
|
+
push_events: boolean;
|
|
237
|
+
tag_push_events: boolean;
|
|
238
|
+
merge_requests_events: boolean;
|
|
239
|
+
repository_update_events: boolean;
|
|
240
|
+
issues_events: boolean;
|
|
241
|
+
confidential_issues_events: boolean;
|
|
242
|
+
note_events: boolean;
|
|
243
|
+
confidential_note_events: boolean | null;
|
|
244
|
+
pipeline_events: boolean;
|
|
245
|
+
job_events: boolean;
|
|
246
|
+
deployment_events: boolean;
|
|
247
|
+
releases_events: boolean;
|
|
248
|
+
feature_flag_events: boolean;
|
|
249
|
+
resource_access_token_events: boolean;
|
|
250
|
+
vulnerability_events: boolean;
|
|
251
|
+
wiki_page_events: boolean;
|
|
252
|
+
milestone_events: boolean;
|
|
253
|
+
emoji_events: boolean;
|
|
254
|
+
enable_ssl_verification: boolean;
|
|
255
|
+
alert_status: "executable" | "disabled";
|
|
256
|
+
disabled_until: string | null;
|
|
257
|
+
push_events_branch_filter: string | null;
|
|
258
|
+
branch_filter_strategy: "wildcard" | "regex";
|
|
259
|
+
custom_webhook_template: string | null;
|
|
260
|
+
custom_headers: GitlabWebhookCustomHeader[];
|
|
261
|
+
url_variables: GitlabWebhookUrlVariable[];
|
|
262
|
+
}
|
|
146
263
|
//# sourceMappingURL=gitlab-project.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-project.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/gitlab-project.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC9C,MAAM,4CAA4C,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBA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jD"}
|
|
1
|
+
{"version":3,"file":"gitlab-project.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/gitlab-project.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC9C,MAAM,4CAA4C,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAA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M,GAAG,IAAI,CAAC;IAE3B,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,aAAa,EAAE,OAAO,CAAC;IACvB,0BAA0B,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,wBAAwB,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,4BAA4B,EAAE,OAAO,CAAC;IACtC,oBAAoB,EAAE,OAAO,CAAC;IAE9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IAEtB,uBAAuB,EAAE,OAAO,CAAC;IACjC,YAAY,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,sBAAsB,EAAE,UAAU,GAAG,OAAO,CAAC;IAE7C,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,yBAAyB,EAAE,CAAC;IAC5C,aAAa,EAAE,wBAAwB,EAAE,CAAC;CAC3C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GitlabClientCopy } from '../client/gitlab-copy.client';
|
|
2
|
+
export declare class GitlabCopyService {
|
|
3
|
+
private readonly client;
|
|
4
|
+
constructor(client: GitlabClientCopy);
|
|
5
|
+
getMergeRequests(projectId: string): Promise<any>;
|
|
6
|
+
getMergeRequestDiff(projectId: string, mrId: string): Promise<any>;
|
|
7
|
+
getFile(projectId: string, filePath: string, ref?: string): Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=gitlab-copy.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab-copy.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-copy.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,qBACa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAErD,gBAAgB,CAAC,SAAS,EAAE,MAAM;IAOlC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOnD,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS;CAO1D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.GitlabCopyService = void 0;
|
|
38
|
+
const common_1 = require("@nestjs/common");
|
|
39
|
+
const gitlab_client_constant_1 = require("../constants/gitlab-client.constant");
|
|
40
|
+
let GitlabCopyService = (() => {
|
|
41
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
42
|
+
let _classDescriptor;
|
|
43
|
+
let _classExtraInitializers = [];
|
|
44
|
+
let _classThis;
|
|
45
|
+
var GitlabCopyService = class {
|
|
46
|
+
static { _classThis = this; }
|
|
47
|
+
static {
|
|
48
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
49
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
50
|
+
GitlabCopyService = _classThis = _classDescriptor.value;
|
|
51
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
client;
|
|
55
|
+
constructor(client) {
|
|
56
|
+
this.client = client;
|
|
57
|
+
}
|
|
58
|
+
getMergeRequests(projectId) {
|
|
59
|
+
return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/merge_requests?state=opened`);
|
|
60
|
+
}
|
|
61
|
+
getMergeRequestDiff(projectId, mrId) {
|
|
62
|
+
return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/merge_requests/${mrId}/raw_diffs`);
|
|
63
|
+
}
|
|
64
|
+
getFile(projectId, filePath, ref = "main") {
|
|
65
|
+
const encoded = encodeURIComponent(filePath);
|
|
66
|
+
return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/repository/files/${encoded}/raw?ref=${ref}`);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return GitlabCopyService = _classThis;
|
|
70
|
+
})();
|
|
71
|
+
exports.GitlabCopyService = GitlabCopyService;
|
|
72
|
+
//# sourceMappingURL=gitlab-copy.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab-copy.service.js","sourceRoot":"","sources":["../../src/services/gitlab-copy.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gFAA2E;IAG9D,iBAAiB;4BAD7B,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAwBC;;;YAxBY,uDAAiB;;QACC,MAAM;QAAnC,YAA6B,MAAwB;YAAxB,WAAM,GAAN,MAAM,CAAkB;QAAG,CAAC;QAEzD,gBAAgB,CAAC,SAAiB;YAChC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,8BAA8B,CACrD,CAAC;QACJ,CAAC;QAED,mBAAmB,CAAC,SAAiB,EAAE,IAAY;YACjD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,mBAAmB,IAAI,YAAY,CAC1D,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,SAAiB,EAAE,QAAgB,EAAE,GAAG,GAAG,MAAM;YACvD,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,6CAAoB,CAAC,GAAG,EACxB,aAAa,SAAS,qBAAqB,OAAO,YAAY,GAAG,EAAE,CACpE,CAAC;QACJ,CAAC;;;;AAvBU,8CAAiB"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { GitlabClient } from
|
|
2
|
-
import { GitlabOptions } from
|
|
3
|
-
import { GitlabFileDiff, GitlabMergeRequest, GitlabMergeRequestChangesResponse, GitlabMergeRequestPayloadDiscussion } from
|
|
1
|
+
import { GitlabClient } from "../client/gitlab.client";
|
|
2
|
+
import { GitlabOptions } from "../interfaces/gitlab-credentials.interface";
|
|
3
|
+
import { GitlabCreateProjectWebhookPayload, GitlabFileDiff, GitlabMergeRequest, GitlabMergeRequestChangesResponse, GitlabMergeRequestPayloadDiscussion, GitlabProject, GitlabProjectWebhook } from "../interfaces/gitlab-project.interface";
|
|
4
|
+
import { GITLAB_PROJECT_LIST_TYPE } from "../constants/gitlab-project.constant";
|
|
4
5
|
export declare class GitlabProjectService {
|
|
5
6
|
private readonly client;
|
|
6
7
|
constructor(client: GitlabClient);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
getProjects(options?: GitlabOptions, type?: GITLAB_PROJECT_LIST_TYPE): Promise<GitlabProject[]>;
|
|
9
|
+
getMergeRequests(projectId: number, options?: GitlabOptions): Promise<GitlabMergeRequest[]>;
|
|
10
|
+
getMergeRequestChanges(projectId: number, mrIid: number, options?: GitlabOptions): Promise<GitlabMergeRequestChangesResponse>;
|
|
11
|
+
getMergeRequestDiffFilePlain(projectId: number, mrId: number, options?: GitlabOptions): Promise<string>;
|
|
12
|
+
getMergeRequestDiff(projectId: number, mrId: number, options?: GitlabOptions): Promise<GitlabFileDiff[]>;
|
|
13
|
+
createMergeRequestDiscussion(projectId: number, mrId: number, body: GitlabMergeRequestPayloadDiscussion, options?: GitlabOptions): Promise<string>;
|
|
14
|
+
getFile(projectId: number, filePath: string, ref?: string, options?: GitlabOptions): Promise<string>;
|
|
15
|
+
createProjectWebhook(projectId: number, payload: GitlabCreateProjectWebhookPayload, options?: GitlabOptions): Promise<GitlabProjectWebhook>;
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=gitlab-project.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iCAAiC,EACjC,mCAAmC,
|
|
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,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EACL,iCAAiC,EACjC,cAAc,EACd,kBAAkB,EAClB,iCAAiC,EACjC,mCAAmC,EACnC,aAAa,EACb,oBAAoB,EACrB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|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const gitlab_client_1 = require("../client/gitlab.client");
|
|
15
15
|
const gitlab_client_constant_1 = require("../constants/gitlab-client.constant");
|
|
16
|
+
const gitlab_project_constant_1 = require("../constants/gitlab-project.constant");
|
|
16
17
|
let GitlabProjectService = class GitlabProjectService {
|
|
17
18
|
client;
|
|
18
19
|
constructor(client) {
|
|
19
20
|
this.client = client;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return this.client.request(
|
|
22
|
+
getProjects(options, type = gitlab_project_constant_1.GITLAB_PROJECT_LIST_TYPE.OWNED) {
|
|
23
|
+
const url = type === gitlab_project_constant_1.GITLAB_PROJECT_LIST_TYPE.OWNED
|
|
24
|
+
? "/projects?owned=true"
|
|
25
|
+
: "/projects?membership=true";
|
|
26
|
+
return this.client.request({
|
|
27
|
+
options,
|
|
28
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
29
|
+
url,
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
getMergeRequests(projectId, options) {
|
|
33
|
+
return this.client.request({
|
|
34
|
+
options,
|
|
35
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
36
|
+
url: `/projects/${projectId}/merge_requests?state=opened`,
|
|
37
|
+
});
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
getMergeRequestChanges(projectId, mrIid, options) {
|
|
40
|
+
return this.client.request({
|
|
41
|
+
options,
|
|
42
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
43
|
+
url: `/projects/${projectId}/merge_requests/${mrIid}/changes`,
|
|
44
|
+
});
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
getMergeRequestDiffFilePlain(projectId, mrId, options) {
|
|
47
|
+
return this.client.request({
|
|
48
|
+
options,
|
|
49
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
50
|
+
url: `/projects/${projectId}/merge_requests/${mrId}/raw_diffs`,
|
|
51
|
+
});
|
|
44
52
|
}
|
|
45
|
-
|
|
53
|
+
getMergeRequestDiff(projectId, mrId, options) {
|
|
54
|
+
return this.client.request({
|
|
55
|
+
options,
|
|
56
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
57
|
+
url: `/projects/${projectId}/merge_requests/${mrId}/diffs`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
createMergeRequestDiscussion(projectId, mrId, body, options) {
|
|
46
61
|
if (body.position) {
|
|
47
|
-
const hasLine = typeof body.position.new_line ===
|
|
62
|
+
const hasLine = typeof body.position.new_line === "number" ||
|
|
63
|
+
typeof body.position.old_line === "number";
|
|
48
64
|
if (!hasLine) {
|
|
49
|
-
throw new Error(
|
|
65
|
+
throw new Error("Position must include new_line or old_line");
|
|
50
66
|
}
|
|
51
67
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
return this.client.request({
|
|
69
|
+
options,
|
|
70
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.POST,
|
|
71
|
+
url: `/projects/${projectId}/merge_requests/${mrId}/discussions`,
|
|
72
|
+
data: body,
|
|
73
|
+
});
|
|
56
74
|
}
|
|
57
|
-
getFile(
|
|
75
|
+
getFile(projectId, filePath, ref = "main", options) {
|
|
58
76
|
const encoded = encodeURIComponent(filePath);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
return this.client.request({
|
|
78
|
+
options,
|
|
79
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET,
|
|
80
|
+
url: `/projects/${projectId}/repository/files/${encoded}/raw?ref=${ref}`,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async createProjectWebhook(projectId, payload, options) {
|
|
84
|
+
return this.client.request({
|
|
85
|
+
options,
|
|
86
|
+
method: gitlab_client_constant_1.GITLAB_CLIENT_METHOD.POST,
|
|
87
|
+
url: `/projects/${projectId}/hooks`,
|
|
88
|
+
data: {
|
|
89
|
+
enable_ssl_verification: true,
|
|
90
|
+
...payload,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
63
93
|
}
|
|
64
94
|
};
|
|
65
95
|
exports.GitlabProjectService = GitlabProjectService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2DAAuD;AACvD,gFAA2E;
|
|
1
|
+
{"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2DAAuD;AACvD,gFAA2E;AAW3E,kFAAgF;AAGzE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAErD,WAAW,CACT,OAAuB,EACvB,OAAiC,kDAAwB,CAAC,KAAK;QAE/D,MAAM,GAAG,GACP,IAAI,KAAK,kDAAwB,CAAC,KAAK;YACrC,CAAC,CAAC,sBAAsB;YACxB,CAAC,CAAC,2BAA2B,CAAC;QAElC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,OAAO;YACP,MAAM,EAAE,6CAAoB,CAAC,GAAG;YAChC,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CACd,SAAiB,EACjB,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA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