resourcexjs 2.20.0 → 2.21.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,6 +96,7 @@ 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>;
99
100
  push(locator: string, options?: RegistryOptions): Promise<RXM>;
100
101
  pull(locator: string, options?: RegistryOptions): Promise<void>;
101
102
  clearCache(registry?: string): Promise<void>;
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);
@@ -15642,6 +15652,10 @@ class DefaultResourceX {
15642
15652
  const rxl = parse5(locator);
15643
15653
  await this.cas.remove(rxl);
15644
15654
  }
15655
+ async getFile(locator, file2) {
15656
+ const rxl = parse5(locator);
15657
+ return this.cas.getFile(rxl, file2);
15658
+ }
15645
15659
  async resolve(locator, args2) {
15646
15660
  const executable = await this.prepareExecutable(locator);
15647
15661
  return executable.execute(args2);
@@ -15912,7 +15926,7 @@ function createResourceX(config2) {
15912
15926
  }
15913
15927
 
15914
15928
  // src/index.ts
15915
- var VERSION = "2.20.0";
15929
+ var VERSION = "2.21.0";
15916
15930
  export {
15917
15931
  wrap,
15918
15932
  setProvider,
@@ -15938,4 +15952,4 @@ export {
15938
15952
  GitHubSourceLoader
15939
15953
  };
15940
15954
 
15941
- //# debugId=3FDB13F8193E406864756E2164756E21
15955
+ //# debugId=157DD7F95579016964756E2164756E21