@pierre/storage 1.2.1 → 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 +18 -1
- package/dist/index.cjs +9 -1
- 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 +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -0
- package/src/types.ts +1 -0
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ const readOnlyUrl = await repo.getRemoteURL({
|
|
|
126
126
|
#### Ephemeral Branches
|
|
127
127
|
|
|
128
128
|
For working with ephemeral branches (temporary branches isolated from the main
|
|
129
|
-
repository), use `
|
|
129
|
+
repository), use `getEphemeralRemoteURL()`:
|
|
130
130
|
|
|
131
131
|
```typescript
|
|
132
132
|
// Get ephemeral namespace remote URL
|
|
@@ -145,6 +145,23 @@ console.log(
|
|
|
145
145
|
// The ephemeral remote supports all the same options and permission as regular remotes
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
#### Import Remote
|
|
149
|
+
|
|
150
|
+
For write-only history imports, use `getImportRemoteURL()`:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
// Get import remote URL
|
|
154
|
+
const importUrl = await repo.getImportRemoteURL();
|
|
155
|
+
// Returns: https://t:JWT@your-name.code.storage/repo-id+import.git
|
|
156
|
+
|
|
157
|
+
console.log(`Run: git remote add import ${importUrl}`);
|
|
158
|
+
|
|
159
|
+
// Push imported history through the import remote
|
|
160
|
+
// git push import main
|
|
161
|
+
|
|
162
|
+
// Reads are disabled on +import remotes; use the repository remote for clone/fetch
|
|
163
|
+
```
|
|
164
|
+
|
|
148
165
|
### Working with Repository Content
|
|
149
166
|
|
|
150
167
|
Once you have a repository instance, you can perform various Git operations:
|
package/dist/index.cjs
CHANGED
|
@@ -530,7 +530,7 @@ function concatChunks(a, b) {
|
|
|
530
530
|
|
|
531
531
|
// package.json
|
|
532
532
|
var package_default = {
|
|
533
|
-
version: "1.2.
|
|
533
|
+
version: "1.2.2"};
|
|
534
534
|
|
|
535
535
|
// src/version.ts
|
|
536
536
|
var PACKAGE_NAME = "code-storage-sdk";
|
|
@@ -1825,6 +1825,14 @@ var RepoImpl = class {
|
|
|
1825
1825
|
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1826
1826
|
return url.toString();
|
|
1827
1827
|
}
|
|
1828
|
+
async getImportRemoteURL(urlOptions) {
|
|
1829
|
+
const url = new URL(
|
|
1830
|
+
`https://${this.options.storageBaseUrl}/${this.id}+import.git`
|
|
1831
|
+
);
|
|
1832
|
+
url.username = `t`;
|
|
1833
|
+
url.password = await this.generateJWT(this.id, urlOptions);
|
|
1834
|
+
return url.toString();
|
|
1835
|
+
}
|
|
1828
1836
|
async getFileStream(options) {
|
|
1829
1837
|
const ttl = resolveInvocationTtlSeconds(options, DEFAULT_TOKEN_TTL_SECONDS);
|
|
1830
1838
|
const jwt = await this.generateJWT(this.id, {
|