@milaboratories/pl-middle-layer 1.19.7 → 1.19.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EAEnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,IAAI,eAAe,EAC/B,OAAO,EAEP,SAAS,EACT,SAAS,EACT,SAAS,EAKV,MAAM,sBAAsB,CAAC;AAqH9B,qBAAa,YAAa,YAAW,eAAe;IAOtC,OAAO,CAAC,QAAQ,CAAC,UAAU;IANvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyD;IACjF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsE;IAC9F,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+B;IAChE,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA8B;gBAEpC,UAAU,EAAE,cAAc;IAoDhD,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY;IAQlF,YAAY,CACjB,GAAG,EAAE,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAC3C,GAAG,EAAE,aAAa,GACjB,YAAY;IAYF,WAAW,CACtB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,kB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AM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK1D,OAAO,CAClB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;CAM3B;AA+CD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAI/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-middle-layer",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "description": "Pl Middle Layer",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "keywords": [],
20
20
  "license": "UNLICENSED",
21
21
  "dependencies": {
22
- "@milaboratories/pframes-node": "2.1.0",
22
+ "@milaboratories/pframes-node": "2.1.2",
23
23
  "canonicalize": "^2.0.0",
24
24
  "denque": "^2.1.0",
25
25
  "lru-cache": "^11.0.2",
@@ -28,19 +28,19 @@
28
28
  "utility-types": "^3.11.0",
29
29
  "yaml": "^2.6.1",
30
30
  "zod": "^3.23.8",
31
- "@milaboratories/computable": "^2.3.3",
32
31
  "@milaboratories/resolve-helper": "^1.0.2",
33
- "@milaboratories/pl-model-common": "^1.8.0",
34
- "@platforma-sdk/block-tools": "^2.4.5",
32
+ "@milaboratories/computable": "^2.3.3",
33
+ "@platforma-sdk/block-tools": "^2.4.7",
35
34
  "@milaboratories/pl-client": "^2.6.3",
35
+ "@milaboratories/pl-model-common": "^1.8.0",
36
+ "@milaboratories/pl-model-middle-layer": "^1.6.4",
36
37
  "@milaboratories/pl-drivers": "^1.4.0",
37
- "@milaboratories/pl-model-middle-layer": "^1.6.3",
38
- "@platforma-sdk/model": "^1.14.1",
39
38
  "@milaboratories/pl-tree": "^1.4.18",
39
+ "@platforma-sdk/model": "^1.14.1",
40
40
  "@platforma-sdk/workflow-tengo": "2.6.0",
41
+ "@milaboratories/ts-helpers": "^1.1.2",
41
42
  "@milaboratories/pl-config": "^1.3.2",
42
- "@milaboratories/pl-local": "^1.8.1",
43
- "@milaboratories/ts-helpers": "^1.1.2"
43
+ "@milaboratories/pl-local": "^1.8.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "typescript": "~5.5.4",
@@ -4,6 +4,7 @@ import path from 'node:path';
4
4
  import { CentralBlockRegistry } from './well_known_registries';
5
5
  import { V2RegistryProvider } from './registry-v2-provider';
6
6
  import { Agent } from 'undici';
7
+ import { BlockPackFromRegistryV2 } from '@milaboratories/pl-model-middle-layer';
7
8
 
8
9
  test('testing remote registry', async () => {
9
10
  const registry = new BlockPackRegistry(new V2RegistryProvider(new Agent()), [
@@ -12,3 +13,20 @@ test('testing remote registry', async () => {
12
13
  const listing = await registry.listBlockPacks();
13
14
  expect(listing.blockPacks.length).toBeGreaterThanOrEqual(1);
14
15
  });
16
+
17
+ test('testing specific version retrieval', async () => {
18
+ const registry = new BlockPackRegistry(new V2RegistryProvider(new Agent()), [
19
+ { id: 'central', title: 'Central Block Registry', spec: CentralBlockRegistry }
20
+ ]);
21
+ const overview = await registry.getOverview(
22
+ 'central',
23
+ {
24
+ name: 'samples-and-data',
25
+ organization: 'milaboratories',
26
+ version: '1.8.5'
27
+ },
28
+ 'stable'
29
+ );
30
+ expect((overview.spec as BlockPackFromRegistryV2).id.version).toStrictEqual('1.8.5');
31
+ expect((overview.spec as BlockPackFromRegistryV2).channel).toStrictEqual('stable');
32
+ });
@@ -14,6 +14,7 @@ import { tryLoadPackDescription } from '@platforma-sdk/block-tools';
14
14
  import { V2RegistryProvider } from './registry-v2-provider';
15
15
  import {
16
16
  AnyChannel,
17
+ BlockPackId,
17
18
  BlockPackListing,
18
19
  BlockPackOverview,
19
20
  RegistryEntry,
@@ -236,4 +237,19 @@ export class BlockPackRegistry {
236
237
  }
237
238
  return { registries, blockPacks };
238
239
  }
240
+
241
+ public async getOverview(
242
+ registryId: string,
243
+ blockId: BlockPackId,
244
+ channel: string
245
+ ): Promise<SingleBlockPackOverview> {
246
+ const regSpec = this.registries.find((reg) => reg.id === registryId)?.spec;
247
+ if (!regSpec) throw new Error(`Registry with id "${registryId}" not found`);
248
+ if (regSpec.type !== 'remote-v2')
249
+ throw new Error(
250
+ `Only "remote-v2" registries support specific package version overview retrieval.`
251
+ );
252
+ const reg = this.v2Provider.getRegistry(regSpec.url);
253
+ return await reg.getSpecificOverview(blockId, channel);
254
+ }
239
255
  }
@@ -148,7 +148,7 @@ type FullPTableDef = {
148
148
 
149
149
  export class PFrameDriver implements SdkPFrameDriver {
150
150
  private readonly pFrames: RefCountResourcePool<InternalPFrameData, PFrameHolder>;
151
- private readonly pTables: RefCountResourcePool<FullPTableDef, Promise<PFrameInternal.PTable>>;
151
+ private readonly pTables: RefCountResourcePool<FullPTableDef, Promise<PFrameInternal.PTableV2>>;
152
152
  private readonly blobContentCache: LRUCache<string, Uint8Array>;
153
153
  /** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
154
154
  private readonly concurrencyLimiter: ConcurrencyLimitingExecutor;
@@ -177,14 +177,14 @@ export class PFrameDriver implements SdkPFrameDriver {
177
177
 
178
178
  this.pTables = new (class extends RefCountResourcePool<
179
179
  FullPTableDef,
180
- Promise<PFrameInternal.PTable>
180
+ Promise<PFrameInternal.PTableV2>
181
181
  > {
182
182
  constructor(
183
183
  private readonly pFrames: RefCountResourcePool<InternalPFrameData, PFrameHolder>
184
184
  ) {
185
185
  super();
186
186
  }
187
- protected async createNewResource(params: FullPTableDef): Promise<PFrameInternal.PTable> {
187
+ protected async createNewResource(params: FullPTableDef): Promise<PFrameInternal.PTableV2> {
188
188
  const pFrame = this.pFrames.getByKey(params.pFrameHandle);
189
189
  const rawPTable = await concurrencyLimiter.run(
190
190
  async () =>