@platforma-sdk/block-tools 2.22.5 → 2.23.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/cli.js +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{config-BusBoNIz.mjs → config-CGSNRGpA.mjs} +384 -378
- package/dist/{config-BusBoNIz.mjs.map → config-CGSNRGpA.mjs.map} +1 -1
- package/dist/{config-DG4SQFXv.js → config-CvQdNxZA.js} +2 -2
- package/dist/{config-DG4SQFXv.js.map → config-CvQdNxZA.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/v2/registry/registry_reader.d.ts +4 -2
- package/package.json +2 -2
- package/src/v2/registry/registry_reader.ts +13 -3
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./config-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./config-CvQdNxZA.js");let t=require("@platforma-sdk/package-builder-lib");var n=e.qt({GlobalOverviewPath:()=>e.r,MetaFile:()=>e.i,PlPackageConfigData:()=>e.c,PlPackageJsonConfigFile:()=>e.l,PlPackageYamlConfigFile:()=>e.u,PlRegCommonConfigData:()=>e.d,PlRegFullPackageConfigData:()=>e.f,PlRegPackageConfig:()=>e.t,PlRegPackageConfigDataShard:()=>e.p,packageContentPrefix:()=>e.a,packageOverviewPath:()=>e.o,payloadFilePath:()=>e.s});exports.BlockDescriptionPackageJsonField=e.ft,exports.BlockPackFolderName=e.pt,exports.BlockRegistryV2=e.x,exports.ChannelNameRegexp=e.S,exports.ChannelsFolder=e.C,Object.defineProperty(exports,"FSStorage",{enumerable:!0,get:function(){return t.FSStorage}}),Object.defineProperty(exports,"GcsStorage",{enumerable:!0,get:function(){return t.GcsStorage}}),exports.GlobalOverviewFileName=e.w,exports.GlobalOverviewGzFileName=e.T,exports.GlobalOverviewGzPath=e.E,exports.GlobalOverviewPath=e.D,exports.KindImplementer=e.$,exports.KindManifest=e.et,exports.KindManifestFile=e.yt,exports.KindManifestFileInfo=e.tt,exports.KindManifestFileName=e.nt,exports.KindManifestIdentity=e.rt,exports.KindOverview=e.it,exports.KindOverviewFileName=e.at,exports.KindOverviewPathPattern=e.ot,exports.KindResolutionError=e._,exports.KindVersionMismatchError=e.J,exports.KindVersionOverview=e.st,exports.KindsPrefix=e.ct,exports.MainPrefix=e.O,exports.ManifestFileName=e.k,exports.ManifestSuffix=e.A,exports.PackageManifestPattern=e.j,exports.PackageOverview=e.M,exports.PackageOverviewFileName=e.N,exports.PackageOverviewVersionEntry=e.P,exports.PublishedCoordsFileName=e.U,Object.defineProperty(exports,"RegistryV1",{enumerable:!0,get:function(){return n}}),exports.RegistryV2Reader=e.h,Object.defineProperty(exports,"S3Storage",{enumerable:!0,get:function(){return t.S3Storage}}),exports.absoluteToBase64=e.Ft,exports.absoluteToBytes=e.It,exports.absoluteToString=e.Lt,exports.addRelativePathPrefix=e.St,exports.blockComponentsManifestToAbsoluteUrl=e.Tt,exports.buildBlockPackDist=e.xt,exports.buildKindDist=e.bt,exports.buildPublishedCoords=e.W,exports.checkKindVersionMatch=e.Y,exports.consolidateBlockComponents=e.Et,exports.consolidateBlockPackDescription=e.Ct,exports.consolidateBlockPackMeta=e.kt,exports.cpAbsoluteToRelative=e.Rt,exports.embedBlockPackMetaAbsoluteBase64=e.At,exports.embedBlockPackMetaAbsoluteBytes=e.jt,exports.embedBlockPackMetaBytes=e.Mt,exports.folderReaderByUrl=e.m,exports.inferUpdateSuggestions=e.g,exports.kindContentPrefix=e.lt,exports.kindOverviewPath=e.ut,exports.loadPackDescription=e.mt,exports.loadPackDescriptionFromManifest=e.ht,exports.loadPackDescriptionRaw=e.gt,exports.mapLocalToAbsolute=e.zt,exports.npmNameToKindPath=e.dt,exports.packFolderToRelativeTgz=e.Bt,exports.packageChannelPrefix=e.F,exports.packageChannelPrefixInsideV2=e.I,exports.packageContentPrefix=e.L,exports.packageContentPrefixInsideV2=e.R,exports.packageOverviewPath=e.z,exports.packageOverviewPathInsideV2=e.B,exports.parseGlobalOverviewReg=e.V,exports.parsePackageName=e._t,exports.parseSelector=e.v,exports.publishBlock=e.q,exports.readFacadeKindDependency=e.X,exports.readModelCompiledKindRef=e.Z,exports.relativeToContentString=e.Vt,exports.relativeToExplicitBinary64=e.Ht,exports.relativeToExplicitBytes=e.Ut,exports.relativeToExplicitString=e.Wt,exports.resolveBlockComponents=e.Dt,exports.resolveBlockPackDescription=e.wt,exports.resolveBlockPackMeta=e.Nt,exports.resolveFacadeKind=e.Q,exports.resolveKind=e.y,exports.resolveManifestBlockComponents=e.Ot,exports.resolveManifestBlockPackMeta=e.Pt,exports.resolveModuleFile=e.Gt,exports.resolveModuleFolder=e.Kt,exports.resolveToRegistry=e.G,exports.selectorToRange=e.b,Object.defineProperty(exports,"storageByUrl",{enumerable:!0,get:function(){return t.storageByUrl}}),exports.tryLoadPackDescription=e.vt,exports.writePublishedCoords=e.K;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, Gt as m, H as h, Ht as g, I as _, It as v, J as y, Jt as b, Kt as x, L as S, Lt as C, M as w, Mt as T, N as E, Nt as D, O, Ot as k, P as A, Pt as j, Q as M, R as N, Rt as P, S as F, St as I, T as L, Tt as R, U as z, Ut as B, V, Vt as H, W as U, Wt as W, X as G, Xt as K, Y as q, Yt as J, Z as Y, Zt as X, _ as Z, _t as Q, a as $, at as ee, b as te, bt as ne, c as re, ct as ie, d as ae, dt as oe, et as se, f as ce, ft as le, g as ue, gt as de, h as fe, ht as pe, i as me, it as he, j as ge, jt as _e, k as ve, kt as ye, l as be, lt as xe, m as Se, mt as Ce, nt as we, o as Te, ot as Ee, p as De, pt as Oe, q as ke, qt as Ae, r as je, rt as Me, s as Ne, st as Pe, t as Fe, tt as Ie, u as Le, ut as Re, v as ze, vt as Be, w as Ve, wt as He, x as Ue, xt as We, y as Ge, yt as Ke, z as qe, zt as Je } from "./config-
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, Gt as m, H as h, Ht as g, I as _, It as v, J as y, Jt as b, Kt as x, L as S, Lt as C, M as w, Mt as T, N as E, Nt as D, O, Ot as k, P as A, Pt as j, Q as M, R as N, Rt as P, S as F, St as I, T as L, Tt as R, U as z, Ut as B, V, Vt as H, W as U, Wt as W, X as G, Xt as K, Y as q, Yt as J, Z as Y, Zt as X, _ as Z, _t as Q, a as $, at as ee, b as te, bt as ne, c as re, ct as ie, d as ae, dt as oe, et as se, f as ce, ft as le, g as ue, gt as de, h as fe, ht as pe, i as me, it as he, j as ge, jt as _e, k as ve, kt as ye, l as be, lt as xe, m as Se, mt as Ce, nt as we, o as Te, ot as Ee, p as De, pt as Oe, q as ke, qt as Ae, r as je, rt as Me, s as Ne, st as Pe, t as Fe, tt as Ie, u as Le, ut as Re, v as ze, vt as Be, w as Ve, wt as He, x as Ue, xt as We, y as Ge, yt as Ke, z as qe, zt as Je } from "./config-CGSNRGpA.mjs";
|
|
2
2
|
// src/registry_v1/index.ts
|
|
3
3
|
var Ye = /* @__PURE__ */ X({
|
|
4
4
|
GlobalOverviewPath: () => je,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockPackId, BlockPackIdNoVersion, UpdateSuggestions, SingleBlockPackOverview, BlockPackOverviewNoRegistryId, BlockPackFromRegistryV2 } from '@milaboratories/pl-model-middle-layer';
|
|
1
|
+
import { BlockPackId, BlockPackIdNoVersion, UpdateSuggestions, SingleBlockPackOverview, BlockPackOverviewNoRegistryId, BlockPackFromRegistryV2, BlockPackManifest } from '@milaboratories/pl-model-middle-layer';
|
|
2
2
|
import { BlockKindReference } from '@milaboratories/pl-model-common';
|
|
3
3
|
import { FolderReader } from '../../io';
|
|
4
4
|
import { KindOverview } from './schema_kinds';
|
|
@@ -33,8 +33,10 @@ export declare class RegistryV2Reader {
|
|
|
33
33
|
getLatestOverview(id: BlockPackIdNoVersion, channel: string): Promise<SingleBlockPackOverview | undefined>;
|
|
34
34
|
getUpdateSuggestions(id: BlockPackId, channel: string): Promise<UpdateSuggestions<string> | undefined>;
|
|
35
35
|
getSpecificOverview(id: BlockPackId, channel: string): Promise<SingleBlockPackOverview>;
|
|
36
|
-
private readonly
|
|
36
|
+
private readonly manifestCache;
|
|
37
37
|
getComponents(id: BlockPackId): Promise<BlockComponentsAbsoluteUrl>;
|
|
38
|
+
/** The published manifest of a block version: file hashes and the pack-time meta. */
|
|
39
|
+
getManifest(id: BlockPackId): Promise<BlockPackManifest>;
|
|
38
40
|
/**
|
|
39
41
|
* Read the kind projection at `kinds/{org}/{name}/overview.json` for a kind
|
|
40
42
|
* npm package name. Single, no-LIST read against the `kinds/` sibling tree
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/block-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Utility to manipulate Platforma Blocks and Block Registry",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@milaboratories/pl-http": "1.2.7",
|
|
29
29
|
"@milaboratories/pl-model-backend": "1.4.58",
|
|
30
30
|
"@milaboratories/pl-model-common": "1.60.0",
|
|
31
|
-
"@milaboratories/pl-model-middle-layer": "1.41.
|
|
31
|
+
"@milaboratories/pl-model-middle-layer": "1.41.5",
|
|
32
32
|
"@milaboratories/resolve-helper": "1.1.3",
|
|
33
33
|
"@milaboratories/ts-helpers": "1.9.1",
|
|
34
34
|
"@platforma-sdk/blocks-deps-updater": "2.2.2",
|
|
@@ -247,7 +247,11 @@ export class RegistryV2Reader {
|
|
|
247
247
|
}, Retry2TimesWithDelay);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
private readonly
|
|
250
|
+
private readonly manifestCache = new LRUCache<
|
|
251
|
+
string,
|
|
252
|
+
{ manifest: BlockPackManifest; components: BlockComponentsAbsoluteUrl },
|
|
253
|
+
BlockPackId
|
|
254
|
+
>({
|
|
251
255
|
max: 500,
|
|
252
256
|
fetchMethod: async (_key, _staleValue, { context: id }) =>
|
|
253
257
|
await retry(async () => {
|
|
@@ -257,15 +261,21 @@ export class RegistryV2Reader {
|
|
|
257
261
|
const manifest = BlockPackManifest.parse(
|
|
258
262
|
JSON.parse(Buffer.from(await packageFolderReader.readFile(ManifestFileName)).toString()),
|
|
259
263
|
);
|
|
260
|
-
|
|
264
|
+
const components = blockComponentsManifestToAbsoluteUrl(
|
|
261
265
|
manifest.description.components,
|
|
262
266
|
packageFolderReader.rootUrl.toString(),
|
|
263
267
|
);
|
|
268
|
+
return { manifest, components };
|
|
264
269
|
}, Retry2TimesWithDelay),
|
|
265
270
|
});
|
|
266
271
|
|
|
267
272
|
public async getComponents(id: BlockPackId): Promise<BlockComponentsAbsoluteUrl> {
|
|
268
|
-
return await this.
|
|
273
|
+
return (await this.manifestCache.forceFetch(canonicalize(id)!, { context: id })).components;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** The published manifest of a block version: file hashes and the pack-time meta. */
|
|
277
|
+
public async getManifest(id: BlockPackId): Promise<BlockPackManifest> {
|
|
278
|
+
return (await this.manifestCache.forceFetch(canonicalize(id)!, { context: id })).manifest;
|
|
269
279
|
}
|
|
270
280
|
|
|
271
281
|
/**
|