@resourcexjs/core 2.21.0 → 2.22.0
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/dist/index.d.ts +12 -0
- package/dist/index.js +21 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -875,6 +875,18 @@ declare class CASRegistry implements Registry {
|
|
|
875
875
|
*/
|
|
876
876
|
gc(): Promise<number>;
|
|
877
877
|
/**
|
|
878
|
+
* Append files to an existing resource without re-archiving.
|
|
879
|
+
*
|
|
880
|
+
* Leverages per-file CAS storage: only new files are written to blob store,
|
|
881
|
+
* then the manifest's file map is extended and the digest recomputed.
|
|
882
|
+
*
|
|
883
|
+
* @param rxi - Resource identifier (name + tag)
|
|
884
|
+
* @param newFiles - Files to append: relative path → content
|
|
885
|
+
* @returns Updated StoredRXM
|
|
886
|
+
* @throws RegistryError if resource not found
|
|
887
|
+
*/
|
|
888
|
+
append(rxi: RXI, newFiles: Record<string, Buffer>): Promise<StoredRXM>;
|
|
889
|
+
/**
|
|
878
890
|
* Check if a digest exists in the blob store.
|
|
879
891
|
* Useful for "instant upload" - skip uploading if server already has it.
|
|
880
892
|
*/
|
package/dist/index.js
CHANGED
|
@@ -15392,6 +15392,26 @@ class CASRegistry {
|
|
|
15392
15392
|
}
|
|
15393
15393
|
return deleted;
|
|
15394
15394
|
}
|
|
15395
|
+
async append(rxi, newFiles) {
|
|
15396
|
+
const tag = await this.resolveTag(rxi.name, rxi.tag ?? "latest", rxi.registry);
|
|
15397
|
+
const existing = await this.rxmStore.get(rxi.name, tag, rxi.registry);
|
|
15398
|
+
if (!existing) {
|
|
15399
|
+
throw new RegistryError(`Resource not found: ${format(rxi)}`);
|
|
15400
|
+
}
|
|
15401
|
+
const mergedFiles = { ...existing.files };
|
|
15402
|
+
for (const [filename, content] of Object.entries(newFiles)) {
|
|
15403
|
+
mergedFiles[filename] = await this.rxaStore.put(content);
|
|
15404
|
+
}
|
|
15405
|
+
const digest = await computeArchiveDigest(mergedFiles);
|
|
15406
|
+
const updated = {
|
|
15407
|
+
...existing,
|
|
15408
|
+
digest,
|
|
15409
|
+
files: mergedFiles,
|
|
15410
|
+
updatedAt: new Date
|
|
15411
|
+
};
|
|
15412
|
+
await this.rxmStore.put(updated);
|
|
15413
|
+
return updated;
|
|
15414
|
+
}
|
|
15395
15415
|
async hasBlob(digest) {
|
|
15396
15416
|
return this.rxaStore.has(digest);
|
|
15397
15417
|
}
|
|
@@ -15750,4 +15770,4 @@ export {
|
|
|
15750
15770
|
CASRegistry
|
|
15751
15771
|
};
|
|
15752
15772
|
|
|
15753
|
-
//# debugId=
|
|
15773
|
+
//# debugId=22A475515B34B19264756E2164756E21
|