resourcexjs 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 CHANGED
@@ -96,7 +96,6 @@ interface ResourceX {
96
96
  resolve<T = unknown>(locator: string, args?: unknown): Promise<T>;
97
97
  ingest<T = unknown>(locator: RXL, args?: unknown): Promise<T>;
98
98
  search(query?: string): Promise<string[]>;
99
- getFile(locator: string, file: string): Promise<Buffer | null>;
100
99
  push(locator: string, options?: RegistryOptions): Promise<RXM>;
101
100
  pull(locator: string, options?: RegistryOptions): Promise<void>;
102
101
  clearCache(registry?: string): Promise<void>;
package/dist/index.js CHANGED
@@ -5407,6 +5407,26 @@ class CASRegistry {
5407
5407
  }
5408
5408
  return deleted;
5409
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
+ }
5410
5430
  async hasBlob(digest) {
5411
5431
  return this.rxaStore.has(digest);
5412
5432
  }
@@ -15652,10 +15672,6 @@ class DefaultResourceX {
15652
15672
  const rxl = parse5(locator);
15653
15673
  await this.cas.remove(rxl);
15654
15674
  }
15655
- async getFile(locator, file2) {
15656
- const rxl = parse5(locator);
15657
- return this.cas.getFile(rxl, file2);
15658
- }
15659
15675
  async resolve(locator, args2) {
15660
15676
  const executable = await this.prepareExecutable(locator);
15661
15677
  return executable.execute(args2);
@@ -15926,7 +15942,7 @@ function createResourceX(config2) {
15926
15942
  }
15927
15943
 
15928
15944
  // src/index.ts
15929
- var VERSION = "2.21.0";
15945
+ var VERSION = "2.22.0";
15930
15946
  export {
15931
15947
  wrap,
15932
15948
  setProvider,
@@ -15952,4 +15968,4 @@ export {
15952
15968
  GitHubSourceLoader
15953
15969
  };
15954
15970
 
15955
- //# debugId=157DD7F95579016964756E2164756E21
15971
+ //# debugId=C9E5742414CCF08C64756E2164756E21