resourcexjs 2.20.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.js CHANGED
@@ -5363,6 +5363,16 @@ class CASRegistry {
5363
5363
  tag: m.tag
5364
5364
  }));
5365
5365
  }
5366
+ async getFile(rxi, file2) {
5367
+ const tag = await this.resolveTag(rxi.name, rxi.tag ?? "latest", rxi.registry);
5368
+ const storedRxm = await this.rxmStore.get(rxi.name, tag, rxi.registry);
5369
+ if (!storedRxm)
5370
+ return null;
5371
+ const digest = storedRxm.files[file2];
5372
+ if (!digest)
5373
+ return null;
5374
+ return this.rxaStore.get(digest);
5375
+ }
5366
5376
  async getStoredManifest(rxi) {
5367
5377
  const tag = await this.resolveTag(rxi.name, rxi.tag ?? "latest", rxi.registry);
5368
5378
  return this.rxmStore.get(rxi.name, tag, rxi.registry);
@@ -5397,6 +5407,26 @@ class CASRegistry {
5397
5407
  }
5398
5408
  return deleted;
5399
5409
  }
5410
+ async append(rxi, newFiles) {
5411
+ const tag = await this.resolveTag(rxi.name, rxi.tag ?? "latest", rxi.registry);
5412
+ const existing = await this.rxmStore.get(rxi.name, tag, rxi.registry);
5413
+ if (!existing) {
5414
+ throw new RegistryError(`Resource not found: ${format(rxi)}`);
5415
+ }
5416
+ const mergedFiles = { ...existing.files };
5417
+ for (const [filename, content] of Object.entries(newFiles)) {
5418
+ mergedFiles[filename] = await this.rxaStore.put(content);
5419
+ }
5420
+ const digest = await computeArchiveDigest(mergedFiles);
5421
+ const updated = {
5422
+ ...existing,
5423
+ digest,
5424
+ files: mergedFiles,
5425
+ updatedAt: new Date
5426
+ };
5427
+ await this.rxmStore.put(updated);
5428
+ return updated;
5429
+ }
5400
5430
  async hasBlob(digest) {
5401
5431
  return this.rxaStore.has(digest);
5402
5432
  }
@@ -15912,7 +15942,7 @@ function createResourceX(config2) {
15912
15942
  }
15913
15943
 
15914
15944
  // src/index.ts
15915
- var VERSION = "2.20.0";
15945
+ var VERSION = "2.22.0";
15916
15946
  export {
15917
15947
  wrap,
15918
15948
  setProvider,
@@ -15938,4 +15968,4 @@ export {
15938
15968
  GitHubSourceLoader
15939
15969
  };
15940
15970
 
15941
- //# debugId=3FDB13F8193E406864756E2164756E21
15971
+ //# debugId=C9E5742414CCF08C64756E2164756E21