@canyonjs/git-provider 0.0.3 → 0.0.5

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.
Files changed (2) hide show
  1. package/dist/index.mjs +3 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -199,14 +199,14 @@ var GitlabAdapter = class {
199
199
  }
200
200
  fileRawUrl(repoID, filePath, ref) {
201
201
  const encodedPath = encodeURIComponent(filePath);
202
- return `${this.base}/api/v4/projects/${encodeURIComponent(repoID)}/repository/files/${encodedPath}/raw?ref=${encodeURIComponent(ref)}`;
202
+ return `${this.base}/projects/${encodeURIComponent(repoID)}/repository/files/${encodedPath}/raw?ref=${encodeURIComponent(ref)}`;
203
203
  }
204
204
  async getRawFileText(repoID, filePath, ref) {
205
205
  const { data } = await get(this.fileRawUrl(repoID, filePath, ref), { headers: this.headers() });
206
206
  return typeof data === "string" ? data : "";
207
207
  }
208
208
  async getRepoInfo(repoID) {
209
- const { data } = await get(`${this.base}/api/v4/projects/${encodeURIComponent(repoID)}`, { headers: this.headers() });
209
+ const { data } = await get(`${this.base}/projects/${encodeURIComponent(repoID)}`, { headers: this.headers() });
210
210
  return {
211
211
  id: String(data.id),
212
212
  pathWithNamespace: data.path_with_namespace,
@@ -214,7 +214,7 @@ var GitlabAdapter = class {
214
214
  };
215
215
  }
216
216
  async getCompare(repoID, base, head) {
217
- const { data } = await get(`${this.base}/api/v4/projects/${encodeURIComponent(repoID)}/repository/compare?from=${encodeURIComponent(base)}&to=${encodeURIComponent(head)}`, { headers: this.headers() });
217
+ const { data } = await get(`${this.base}/projects/${encodeURIComponent(repoID)}/repository/compare?from=${encodeURIComponent(base)}&to=${encodeURIComponent(head)}`, { headers: this.headers() });
218
218
  const diffRows = data.diffs ?? [];
219
219
  const comparedPaths = diffRows.map(comparedRefsFromGitlabDiff).filter((entry) => entry != null).filter((entry) => pathMatchesLineDiffExtensions(entry.keyPath));
220
220
  const lineBuckets = comparedPaths.length > 1500 ? /* @__PURE__ */ new Map() : await computeLineBucketsByRef(comparedPaths, base, head, (path, ref) => this.getRawFileText(repoID, path, ref));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canyonjs/git-provider",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "GitLab provider client with adapter architecture.",
5
5
  "keywords": [
6
6
  "api",