@pierre/storage 0.2.2 → 0.2.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 +21 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +8 -0
- package/src/types.ts +1 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -359,6 +359,14 @@ class RepoImpl implements Repo {
|
|
|
359
359
|
return url.toString();
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
+
async getEphemeralRemoteURL(urlOptions?: GetRemoteURLOptions): Promise<string> {
|
|
363
|
+
const storageBaseUrl = this.options.storageBaseUrl ?? STORAGE_BASE_URL;
|
|
364
|
+
const url = new URL(`https://${this.options.name}.${storageBaseUrl}/${this.id}+ephemeral.git`);
|
|
365
|
+
url.username = `t`;
|
|
366
|
+
url.password = await this.generateJWT(this.id, urlOptions);
|
|
367
|
+
return url.toString();
|
|
368
|
+
}
|
|
369
|
+
|
|
362
370
|
async getFileStream(options: GetFileOptions): Promise<Response> {
|
|
363
371
|
const ttl = resolveInvocationTtlSeconds(options, DEFAULT_TOKEN_TTL_SECONDS);
|
|
364
372
|
const jwt = await this.generateJWT(this.id, {
|
package/src/types.ts
CHANGED
|
@@ -38,6 +38,7 @@ export interface GetRemoteURLOptions {
|
|
|
38
38
|
export interface Repo {
|
|
39
39
|
id: string;
|
|
40
40
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
41
|
+
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
41
42
|
|
|
42
43
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
43
44
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|