@pierre/storage 1.2.0 → 1.2.2
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 +20 -1
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/src/index.ts +12 -0
- package/src/types.ts +2 -0
package/dist/index.d.cts
CHANGED
|
@@ -747,6 +747,7 @@ interface Repo {
|
|
|
747
747
|
createdAt: string;
|
|
748
748
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
749
749
|
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
750
|
+
getImportRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
750
751
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
751
752
|
getArchiveStream(options?: ArchiveOptions): Promise<Response>;
|
|
752
753
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
@@ -854,6 +855,7 @@ interface ArchiveOptions extends GitStorageInvocationOptions {
|
|
|
854
855
|
ref?: string;
|
|
855
856
|
includeGlobs?: string[];
|
|
856
857
|
excludeGlobs?: string[];
|
|
858
|
+
maxBlobSize?: number;
|
|
857
859
|
archivePrefix?: string;
|
|
858
860
|
}
|
|
859
861
|
interface PullUpstreamOptions extends GitStorageInvocationOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -747,6 +747,7 @@ interface Repo {
|
|
|
747
747
|
createdAt: string;
|
|
748
748
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
749
749
|
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
750
|
+
getImportRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
750
751
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
751
752
|
getArchiveStream(options?: ArchiveOptions): Promise<Response>;
|
|
752
753
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
@@ -854,6 +855,7 @@ interface ArchiveOptions extends GitStorageInvocationOptions {
|
|
|
854
855
|
ref?: string;
|
|
855
856
|
includeGlobs?: string[];
|
|
856
857
|
excludeGlobs?: string[];
|
|
858
|
+
maxBlobSize?: number;
|
|
857
859
|
archivePrefix?: string;
|
|
858
860
|
}
|
|
859
861
|
interface PullUpstreamOptions extends GitStorageInvocationOptions {
|
package/dist/index.js
CHANGED
|
@@ -524,7 +524,7 @@ function concatChunks(a, b) {
|
|
|
524
524
|
|
|
525
525
|
// package.json
|
|
526
526
|
var package_default = {
|
|
527
|
-
version: "1.2.
|
|
527
|
+
version: "1.2.2"};
|
|
528
528
|
|
|
529
529
|
// src/version.ts
|
|
530
530
|
var PACKAGE_NAME = "code-storage-sdk";
|
|
@@ -1819,6 +1819,14 @@ var RepoImpl = class {
|
|
|
1819
1819
|
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1820
1820
|
return url.toString();
|
|
1821
1821
|
}
|
|
1822
|
+
async getImportRemoteURL(urlOptions) {
|
|
1823
|
+
const url = new URL(
|
|
1824
|
+
`https://${this.options.storageBaseUrl}/${this.id}+import.git`
|
|
1825
|
+
);
|
|
1826
|
+
url.username = `t`;
|
|
1827
|
+
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1828
|
+
return url.toString();
|
|
1829
|
+
}
|
|
1822
1830
|
async getFileStream(options) {
|
|
1823
1831
|
const ttl = resolveInvocationTtlSeconds(options, DEFAULT_TOKEN_TTL_SECONDS);
|
|
1824
1832
|
const jwt = await this.generateJWT(this.id, {
|
|
@@ -1856,6 +1864,9 @@ var RepoImpl = class {
|
|
|
1856
1864
|
if (Array.isArray(options.excludeGlobs) && options.excludeGlobs.length > 0) {
|
|
1857
1865
|
body.exclude_globs = options.excludeGlobs;
|
|
1858
1866
|
}
|
|
1867
|
+
if (typeof options.maxBlobSize === "number" && Number.isFinite(options.maxBlobSize)) {
|
|
1868
|
+
body.max_blob_size = options.maxBlobSize;
|
|
1869
|
+
}
|
|
1859
1870
|
if (typeof options.archivePrefix === "string") {
|
|
1860
1871
|
const prefix = options.archivePrefix.trim();
|
|
1861
1872
|
if (prefix) {
|