@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/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pierre/storage",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Pierre Git Storage SDK",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/pierrecomputer/sdk"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"type": "module",
|
|
7
11
|
"main": "./dist/index.cjs",
|
package/src/index.ts
CHANGED
|
@@ -635,6 +635,15 @@ class RepoImpl implements Repo {
|
|
|
635
635
|
return url.toString();
|
|
636
636
|
}
|
|
637
637
|
|
|
638
|
+
async getImportRemoteURL(urlOptions?: GetRemoteURLOptions): Promise<string> {
|
|
639
|
+
const url = new URL(
|
|
640
|
+
`https://${this.options.storageBaseUrl}/${this.id}+import.git`
|
|
641
|
+
);
|
|
642
|
+
url.username = `t`;
|
|
643
|
+
url.password = await this.generateJWT(this.id, urlOptions);
|
|
644
|
+
return url.toString();
|
|
645
|
+
}
|
|
646
|
+
|
|
638
647
|
async getFileStream(options: GetFileOptions): Promise<Response> {
|
|
639
648
|
const ttl = resolveInvocationTtlSeconds(options, DEFAULT_TOKEN_TTL_SECONDS);
|
|
640
649
|
const jwt = await this.generateJWT(this.id, {
|
|
@@ -678,6 +687,9 @@ class RepoImpl implements Repo {
|
|
|
678
687
|
if (Array.isArray(options.excludeGlobs) && options.excludeGlobs.length > 0) {
|
|
679
688
|
body.exclude_globs = options.excludeGlobs;
|
|
680
689
|
}
|
|
690
|
+
if (typeof options.maxBlobSize === 'number' && Number.isFinite(options.maxBlobSize)) {
|
|
691
|
+
body.max_blob_size = options.maxBlobSize;
|
|
692
|
+
}
|
|
681
693
|
if (typeof options.archivePrefix === 'string') {
|
|
682
694
|
const prefix = options.archivePrefix.trim();
|
|
683
695
|
if (prefix) {
|
package/src/types.ts
CHANGED
|
@@ -48,6 +48,7 @@ export interface Repo {
|
|
|
48
48
|
createdAt: string;
|
|
49
49
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
50
50
|
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
51
|
+
getImportRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
51
52
|
|
|
52
53
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
53
54
|
getArchiveStream(options?: ArchiveOptions): Promise<Response>;
|
|
@@ -182,6 +183,7 @@ export interface ArchiveOptions extends GitStorageInvocationOptions {
|
|
|
182
183
|
ref?: string;
|
|
183
184
|
includeGlobs?: string[];
|
|
184
185
|
excludeGlobs?: string[];
|
|
186
|
+
maxBlobSize?: number;
|
|
185
187
|
archivePrefix?: string;
|
|
186
188
|
}
|
|
187
189
|
|