@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/dist/index.d.cts
CHANGED
|
@@ -448,6 +448,7 @@ interface GetRemoteURLOptions {
|
|
|
448
448
|
interface Repo {
|
|
449
449
|
id: string;
|
|
450
450
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
451
|
+
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
451
452
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
452
453
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
453
454
|
listBranches(options?: ListBranchesOptions): Promise<ListBranchesResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -448,6 +448,7 @@ interface GetRemoteURLOptions {
|
|
|
448
448
|
interface Repo {
|
|
449
449
|
id: string;
|
|
450
450
|
getRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
451
|
+
getEphemeralRemoteURL(options?: GetRemoteURLOptions): Promise<string>;
|
|
451
452
|
getFileStream(options: GetFileOptions): Promise<Response>;
|
|
452
453
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
453
454
|
listBranches(options?: ListBranchesOptions): Promise<ListBranchesResult>;
|
package/dist/index.js
CHANGED
|
@@ -1517,6 +1517,13 @@ var RepoImpl = class {
|
|
|
1517
1517
|
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1518
1518
|
return url.toString();
|
|
1519
1519
|
}
|
|
1520
|
+
async getEphemeralRemoteURL(urlOptions) {
|
|
1521
|
+
const storageBaseUrl = this.options.storageBaseUrl ?? STORAGE_BASE_URL;
|
|
1522
|
+
const url = new URL(`https://${this.options.name}.${storageBaseUrl}/${this.id}+ephemeral.git`);
|
|
1523
|
+
url.username = `t`;
|
|
1524
|
+
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1525
|
+
return url.toString();
|
|
1526
|
+
}
|
|
1520
1527
|
async getFileStream(options) {
|
|
1521
1528
|
const ttl = resolveInvocationTtlSeconds(options, DEFAULT_TOKEN_TTL_SECONDS);
|
|
1522
1529
|
const jwt = await this.generateJWT(this.id, {
|