@venturialstd/gitlab 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @venturialstd/gitlab-sdk
1
+ # @venturialstd/gitlab
2
2
 
3
3
  A lightweight **NestJS SDK for GitLab**, developed by **Venturial**, that allows you to interact with GitLab projects, merge requests, and repository files. Designed to be used by directly instantiating a client with custom configuration, without depending on a global module. Ideal for projects under the **Venturial organization**.
4
4
 
@@ -17,9 +17,9 @@ A lightweight **NestJS SDK for GitLab**, developed by **Venturial**, that allows
17
17
  ## Installation
18
18
 
19
19
  ```bash
20
- npm install @venturialstd/gitlab-sdk
20
+ npm install @venturialstd/gitlab
21
21
  # or
22
- yarn add @venturialstd/gitlab-sdk
22
+ yarn add @venturialstd/gitlab
23
23
  ```
24
24
 
25
25
  ---
@@ -32,21 +32,28 @@ You can create a client anywhere in your project and pass the host and token:
32
32
 
33
33
  ```ts
34
34
  import { Injectable } from "@nestjs/common";
35
- import { GitlabClient } from "@venturialstd/gitlab-sdk";
35
+ import { GitlabClient, GitlabProjectService } from "@venturialstd/gitlab";
36
36
  import { HttpService } from "@nestjs/axios";
37
37
 
38
38
  @Injectable()
39
39
  export class GitlabClientProvider {
40
40
  private client: GitlabClient;
41
+ private projectService: GitlabProjectService;
41
42
 
42
43
  constructor(private readonly httpService: HttpService) {}
43
44
 
44
- async getClient(host: string, token: string): Promise<GitlabClient> {
45
+ private async getClient(host: string, token: string) {
45
46
  if (!this.client) {
46
47
  this.client = new GitlabClient(this.httpService, { host, token });
47
48
  }
48
49
  return this.client;
49
50
  }
51
+
52
+ async getProjectService() {
53
+ if (!this.projectService)
54
+ this.projectService = new GitlabProjectService(await this.getClient());
55
+ return this.projectService;
56
+ }
50
57
  }
51
58
  ```
52
59
 
@@ -63,25 +70,14 @@ import { GitlabClient } from "@venturialstd/gitlab-sdk";
63
70
  export class HarveyGitlabService {
64
71
  constructor(private readonly gitlabClientProvider: GitlabClientProvider) {}
65
72
 
66
- async reviewMergeRequest(projectName: string, host: string, token: string) {
67
- const client: GitlabClient = await this.gitlabClientProvider.getClient(
68
- host,
69
- token
70
- );
71
-
72
- const mergeRequests = await client.getMergeRequests(projectName);
73
- if (!mergeRequests || mergeRequests.length === 0)
74
- return "No open merge requests";
75
-
76
- const mrId = mergeRequests[0].iid;
77
- const diff = await client.getMergeRequestDiff(projectName, mrId);
78
- const fileContent = await client.getFile(projectName, "README.md");
79
-
80
- return {
81
- mergeRequest: mergeRequests[0],
82
- diff,
83
- fileContent,
84
- };
73
+ async reviewMergeRequest(projectName: string) {
74
+ const gitlabProjectService =
75
+ await this.gitlabClientProvider.getProjectService();
76
+
77
+ const mergeRequests =
78
+ await gitlabProjectService.getMergeRequests(projectId);
79
+
80
+ return mergeRequests;
85
81
  }
86
82
  }
87
83
  ```
@@ -90,13 +86,13 @@ export class HarveyGitlabService {
90
86
 
91
87
  ## API
92
88
 
93
- ### GitlabClient
89
+ ### GitlabClient | GitlabProjectService
94
90
 
95
- | Method | Parameters | Description |
96
- | ------------------------------------------------------------ | ---------------------------------------------------------- | ----------------------------------------------------- |
97
- | `getMergeRequests(projectId: string)` | `projectId` | Returns a list of open merge requests for the project |
98
- | `getMergeRequestDiff(projectId: string, mrId: string)` | `projectId`, `mrId` | Returns the raw diff of a merge request |
99
- | `getFile(projectId: string, filePath: string, ref?: string)` | `projectId`, `filePath`, optional `ref` (default `"main"`) | Returns the raw content of a repository file |
91
+ | Method | Parameters | Description |
92
+ | ------------------------------------------------------------ | ---------------------------------------------------- | -------------------------------------------- |
93
+ | `getMergeRequests(projectId: string)` | projectId | Returns a list of open merge requests |
94
+ | `getMergeRequestDiff(projectId: string, mrId: string)` | projectId, mrId | Returns the raw diff of a merge request |
95
+ | `getFile(projectId: string, filePath: string, ref?: string)` | projectId, filePath, optional ref (default `"main"`) | Returns the raw content of a repository file |
100
96
 
101
97
  ---
102
98
 
@@ -1,10 +1,12 @@
1
- import { HttpService } from "@nestjs/axios";
2
- import { GitlabClientConfig } from "../interfaces/gitlab-client-config.interface";
3
- import { GITLAB_CLIENT_METHOD } from "../constants/gitlab-client.constant";
1
+ import { HttpService } from '@nestjs/axios';
2
+ import { GITLAB_CLIENT_METHOD } from '../constants/gitlab-client.constant';
3
+ import { GitlabClientConfig } from '../interfaces/gitlab-client-config.interface';
4
+ import { GitlabLogger } from '../interfaces/gitlab-logger.interface';
4
5
  export declare class GitlabClient {
5
6
  private readonly httpService;
6
7
  private readonly config;
7
- constructor(httpService: HttpService, config: GitlabClientConfig);
8
+ private readonly logger?;
9
+ constructor(httpService: HttpService, config: GitlabClientConfig, logger?: GitlabLogger | undefined);
8
10
  request(method: GITLAB_CLIENT_METHOD, url: string): Promise<any>;
9
11
  }
10
12
  //# 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,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,qBACa,YAAY;IAErB,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"}
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;AAI5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,qBACa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAFP,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,YAAY,YAAA;IAGlC,OAAO,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM;CAkBxD"}
@@ -53,16 +53,27 @@ let GitlabClient = (() => {
53
53
  }
54
54
  httpService;
55
55
  config;
56
- constructor(httpService, config) {
56
+ logger;
57
+ constructor(httpService, config, logger) {
57
58
  this.httpService = httpService;
58
59
  this.config = config;
60
+ this.logger = logger;
59
61
  }
60
62
  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);
63
+ const fullUrl = `${this.config.host}${url}`;
64
+ try {
65
+ const response = await (0, rxjs_1.firstValueFrom)(this.httpService.request({
66
+ method,
67
+ url: fullUrl,
68
+ headers: { 'PRIVATE-TOKEN': this.config.token },
69
+ }));
70
+ this.logger?.log(`Response OK: ${method} ${fullUrl}`);
71
+ return response.data;
72
+ }
73
+ catch (err) {
74
+ this.logger?.error(`Error on request: ${method} ${fullUrl} - ${err}`);
75
+ throw err;
76
+ }
66
77
  }
67
78
  };
68
79
  return GitlabClient = _classThis;
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab.client.js","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,+BAAsC;IAIzB,YAAY;4BADxB,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAeC;;;YAfY,uDAAY;;QAEJ,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,oCAAY"}
1
+ {"version":3,"file":"gitlab.client.js","sourceRoot":"","sources":["../../src/client/gitlab.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,+BAAsC;IAMzB,YAAY;4BADxB,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAyBC;;;YAzBY,uDAAY;;QAEJ,WAAW;QACX,MAAM;QACN,MAAM;QAHzB,YACmB,WAAwB,EACxB,MAA0B,EAC1B,MAAqB;YAFrB,gBAAW,GAAX,WAAW,CAAa;YACxB,WAAM,GAAN,MAAM,CAAoB;YAC1B,WAAM,GAAN,MAAM,CAAe;QACrC,CAAC;QAEJ,KAAK,CAAC,OAAO,CAAC,MAA4B,EAAE,GAAW;YACrD,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC;YAE5C,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAc,EACnC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;oBACvB,MAAM;oBACN,GAAG,EAAE,OAAO;oBACZ,OAAO,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;iBAChD,CAAC,CACH,CAAC;gBACF,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;gBACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,qBAAqB,MAAM,IAAI,OAAO,MAAM,GAAY,EAAE,CAAC,CAAC;gBAC/E,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;;;;AAxBU,oCAAY"}
@@ -1,5 +1,5 @@
1
- import { DynamicModule } from "@nestjs/common";
2
- import { GitlabClientConfig } from "./interfaces/gitlab-client-config.interface";
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { GitlabClientConfig } from './interfaces/gitlab-client-config.interface';
3
3
  export declare class GitlabModule {
4
4
  static register(config: GitlabClientConfig): DynamicModule;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab.module.d.ts","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAIjF,qBACa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,aAAa;CAoB3D"}
1
+ {"version":3,"file":"gitlab.module.d.ts","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF,qBACa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,aAAa;CAmB3D"}
@@ -59,13 +59,13 @@ let GitlabModule = (() => {
59
59
  imports: [axios_1.HttpModule],
60
60
  providers: [
61
61
  {
62
- provide: "GITLAB_CLIENT_CONFIG",
62
+ provide: 'GITLAB_CLIENT_CONFIG',
63
63
  useValue: config,
64
64
  },
65
65
  {
66
66
  provide: gitlab_client_1.GitlabClient,
67
67
  useFactory: (http, cfg) => new gitlab_client_1.GitlabClient(http, cfg),
68
- inject: [axios_1.HttpService, "GITLAB_CLIENT_CONFIG"],
68
+ inject: [axios_1.HttpService, 'GITLAB_CLIENT_CONFIG'],
69
69
  },
70
70
  gitlab_project_service_1.GitlabProjectService,
71
71
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwD;AACxD,2CAAuD;AAEvD,0DAAsD;AACtD,8EAAyE;IAG5D,YAAY;4BADxB,IAAA,eAAM,EAAC,EAAE,CAAC;;;;;;;;YACX,6KAqBC;;;YArBY,uDAAY;;QACvB,MAAM,CAAC,QAAQ,CAAC,MAA0B;YACxC,OAAO;gBACL,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,CAAC,kBAAU,CAAC;gBACrB,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,sBAAsB;wBAC/B,QAAQ,EAAE,MAAM;qBACjB;oBACD;wBACE,OAAO,EAAE,4BAAY;wBACrB,UAAU,EAAE,CAAC,IAAiB,EAAE,GAAuB,EAAE,EAAE,CACzD,IAAI,4BAAY,CAAC,IAAI,EAAE,GAAG,CAAC;wBAC7B,MAAM,EAAE,CAAC,mBAAW,EAAE,sBAAsB,CAAC;qBAC9C;oBACD,6CAAoB;iBACrB;gBACD,OAAO,EAAE,CAAC,4BAAY,EAAE,6CAAoB,CAAC;aAC9C,CAAC;QACJ,CAAC;;;;AApBU,oCAAY"}
1
+ {"version":3,"file":"gitlab.module.js","sourceRoot":"","sources":["../src/gitlab.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwD;AACxD,2CAAuD;AAEvD,0DAAsD;AAEtD,8EAAyE;IAG5D,YAAY;4BADxB,IAAA,eAAM,EAAC,EAAE,CAAC;;;;;;;;YACX,6KAoBC;;;YApBY,uDAAY;;QACvB,MAAM,CAAC,QAAQ,CAAC,MAA0B;YACxC,OAAO;gBACL,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,CAAC,kBAAU,CAAC;gBACrB,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,sBAAsB;wBAC/B,QAAQ,EAAE,MAAM;qBACjB;oBACD;wBACE,OAAO,EAAE,4BAAY;wBACrB,UAAU,EAAE,CAAC,IAAiB,EAAE,GAAuB,EAAE,EAAE,CAAC,IAAI,4BAAY,CAAC,IAAI,EAAE,GAAG,CAAC;wBACvF,MAAM,EAAE,CAAC,mBAAW,EAAE,sBAAsB,CAAC;qBAC9C;oBACD,6CAAoB;iBACrB;gBACD,OAAO,EAAE,CAAC,4BAAY,EAAE,6CAAoB,CAAC;aAC9C,CAAC;QACJ,CAAC;;;;AAnBU,oCAAY"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./client/gitlab.client";
2
- export * from "./gitlab.module";
3
- export * from "./services/gitlab-project.service";
4
- export * from "./interfaces/gitlab-client-config.interface";
1
+ export * from './client/gitlab.client';
2
+ export * from './gitlab.module';
3
+ export * from './interfaces/gitlab-client-config.interface';
4
+ export * from './services/gitlab-project.service';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -16,6 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/gitlab.client"), exports);
18
18
  __exportStar(require("./gitlab.module"), exports);
19
- __exportStar(require("./services/gitlab-project.service"), exports);
20
19
  __exportStar(require("./interfaces/gitlab-client-config.interface"), exports);
20
+ __exportStar(require("./services/gitlab-project.service"), exports);
21
21
  //# 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,kDAAgC;AAChC,oEAAkD;AAClD,8EAA4D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,kDAAgC;AAChC,8EAA4D;AAC5D,oEAAkD"}
@@ -0,0 +1,5 @@
1
+ export interface GitlabLogger {
2
+ log(message: string, meta?: unknown): void;
3
+ error(message: string, meta?: unknown): void;
4
+ }
5
+ //# sourceMappingURL=gitlab-logger.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitlab-logger.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/gitlab-logger.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=gitlab-logger.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitlab-logger.interface.js","sourceRoot":"","sources":["../../src/interfaces/gitlab-logger.interface.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { GitlabClient } from "../client/gitlab.client";
1
+ import { GitlabClient } from '../client/gitlab.client';
2
2
  export declare class GitlabProjectService {
3
3
  private readonly client;
4
4
  constructor(client: GitlabClient);
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab-project.service.d.ts","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD,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"}
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;AAGvD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD,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"}
@@ -61,7 +61,7 @@ let GitlabProjectService = (() => {
61
61
  getMergeRequestDiff(projectId, mrId) {
62
62
  return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/merge_requests/${mrId}/raw_diffs`);
63
63
  }
64
- getFile(projectId, filePath, ref = "main") {
64
+ getFile(projectId, filePath, ref = 'main') {
65
65
  const encoded = encodeURIComponent(filePath);
66
66
  return this.client.request(gitlab_client_constant_1.GITLAB_CLIENT_METHOD.GET, `/projects/${projectId}/repository/files/${encoded}/raw?ref=${ref}`);
67
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gFAA2E;IAG9D,oBAAoB;4BADhC,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAwBC;;;YAxBY,uDAAoB;;QACF,MAAM;QAAnC,YAA6B,MAAoB;YAApB,WAAM,GAAN,MAAM,CAAc;QAAG,CAAC;QAErD,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,oDAAoB"}
1
+ {"version":3,"file":"gitlab-project.service.js","sourceRoot":"","sources":["../../src/services/gitlab-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAG5C,gFAA2E;IAG9D,oBAAoB;4BADhC,IAAA,mBAAU,GAAE;;;;;;;;YACb,6KAwBC;;;YAxBY,uDAAoB;;QACF,MAAM;QAAnC,YAA6B,MAAoB;YAApB,WAAM,GAAN,MAAM,CAAc;QAAG,CAAC;QAErD,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,oDAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venturialstd/gitlab",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "GitLab API Venturial",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",