@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pierre/storage",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Pierre Git Storage SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
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>;