@pierre/storage 0.4.1 → 0.5.0
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/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch.ts +11 -1
- package/src/index.ts +8 -2
- package/src/types.ts +5 -1
package/dist/index.cjs
CHANGED
|
@@ -472,7 +472,7 @@ function concatChunks(a, b) {
|
|
|
472
472
|
|
|
473
473
|
// package.json
|
|
474
474
|
var package_default = {
|
|
475
|
-
version: "0.
|
|
475
|
+
version: "0.5.0"};
|
|
476
476
|
|
|
477
477
|
// src/version.ts
|
|
478
478
|
var PACKAGE_NAME = "code-storage-sdk";
|
|
@@ -1010,7 +1010,17 @@ var ApiFetcher = class {
|
|
|
1010
1010
|
if (typeof path === "string") {
|
|
1011
1011
|
return `${this.getBaseUrl()}/${path}`;
|
|
1012
1012
|
} else if (path.params) {
|
|
1013
|
-
const
|
|
1013
|
+
const searchParams = new URLSearchParams();
|
|
1014
|
+
for (const [key, value] of Object.entries(path.params)) {
|
|
1015
|
+
if (Array.isArray(value)) {
|
|
1016
|
+
for (const v of value) {
|
|
1017
|
+
searchParams.append(key, v);
|
|
1018
|
+
}
|
|
1019
|
+
} else {
|
|
1020
|
+
searchParams.append(key, value);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
const paramStr = searchParams.toString();
|
|
1014
1024
|
return `${this.getBaseUrl()}/${path.path}${paramStr ? `?${paramStr}` : ""}`;
|
|
1015
1025
|
} else {
|
|
1016
1026
|
return `${this.getBaseUrl()}/${path.path}`;
|
|
@@ -1686,6 +1696,9 @@ var RepoImpl = class {
|
|
|
1686
1696
|
if (typeof options.ephemeralBase === "boolean") {
|
|
1687
1697
|
params.ephemeral_base = String(options.ephemeralBase);
|
|
1688
1698
|
}
|
|
1699
|
+
if (options.paths && options.paths.length > 0) {
|
|
1700
|
+
params.path = options.paths;
|
|
1701
|
+
}
|
|
1689
1702
|
const response = await this.api.get({ path: "repos/branches/diff", params }, jwt);
|
|
1690
1703
|
const raw = branchDiffResponseSchema.parse(await response.json());
|
|
1691
1704
|
return transformBranchDiffResult(raw);
|
|
@@ -1702,6 +1715,9 @@ var RepoImpl = class {
|
|
|
1702
1715
|
if (options.baseSha) {
|
|
1703
1716
|
params.baseSha = options.baseSha;
|
|
1704
1717
|
}
|
|
1718
|
+
if (options.paths && options.paths.length > 0) {
|
|
1719
|
+
params.path = options.paths;
|
|
1720
|
+
}
|
|
1705
1721
|
const response = await this.api.get({ path: "repos/diff", params }, jwt);
|
|
1706
1722
|
const raw = commitDiffResponseSchema.parse(await response.json());
|
|
1707
1723
|
return transformCommitDiffResult(raw);
|