@platforma-sdk/block-tools 2.17.9 → 2.18.1

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
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./config-on5N57rI.js");var t=e.Xt({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.ht,exports.BlockPackFolderName=e.gt,exports.BlockRegistryV2=e.w,exports.ChannelNameRegexp=e.T,exports.ChannelsFolder=e.E,exports.FSStorage=e.h,exports.GlobalOverviewFileName=e.D,exports.GlobalOverviewGzFileName=e.O,exports.GlobalOverviewGzPath=e.k,exports.GlobalOverviewPath=e.A,exports.KindImplementer=e.nt,exports.KindManifest=e.rt,exports.KindManifestFile=e.St,exports.KindManifestFileInfo=e.it,exports.KindManifestFileName=e.at,exports.KindManifestIdentity=e.ot,exports.KindOverview=e.st,exports.KindOverviewFileName=e.ct,exports.KindOverviewPathPattern=e.lt,exports.KindResolutionError=e.b,exports.KindVersionMismatchError=e.Z,exports.KindVersionOverview=e.ut,exports.KindsPrefix=e.dt,exports.MainPrefix=e.j,exports.ManifestFileName=e.M,exports.ManifestSuffix=e.N,exports.PackageManifestPattern=e.P,exports.PackageOverview=e.F,exports.PackageOverviewFileName=e.I,exports.PackageOverviewVersionEntry=e.L,exports.PublishedCoordsFileName=e.K,Object.defineProperty(exports,"RegistryV1",{enumerable:!0,get:function(){return t}}),exports.RegistryV2Reader=e.v,exports.S3Storage=e.g,exports.absoluteToBase64=e.Rt,exports.absoluteToBytes=e.zt,exports.absoluteToString=e.Bt,exports.addRelativePathPrefix=e.Tt,exports.blockComponentsManifestToAbsoluteUrl=e.Ot,exports.buildBlockPackDist=e.wt,exports.buildKindDist=e.Ct,exports.buildPublishedCoords=e.q,exports.checkKindVersionMatch=e.Q,exports.consolidateBlockComponents=e.kt,exports.consolidateBlockPackDescription=e.Et,exports.consolidateBlockPackMeta=e.Mt,exports.cpAbsoluteToRelative=e.Vt,exports.embedBlockPackMetaAbsoluteBase64=e.Nt,exports.embedBlockPackMetaAbsoluteBytes=e.Pt,exports.embedBlockPackMetaBytes=e.Ft,exports.folderReaderByUrl=e.m,exports.inferUpdateSuggestions=e.y,exports.kindContentPrefix=e.ft,exports.kindOverviewPath=e.pt,exports.loadPackDescription=e._t,exports.loadPackDescriptionFromManifest=e.vt,exports.loadPackDescriptionRaw=e.yt,exports.mapLocalToAbsolute=e.Ht,exports.npmNameToKindPath=e.mt,exports.packFolderToRelativeTgz=e.Ut,exports.packageChannelPrefix=e.R,exports.packageChannelPrefixInsideV2=e.z,exports.packageContentPrefix=e.B,exports.packageContentPrefixInsideV2=e.V,exports.packageOverviewPath=e.H,exports.packageOverviewPathInsideV2=e.U,exports.parseGlobalOverviewReg=e.W,exports.parsePackageName=e.bt,exports.parseSelector=e.x,exports.publishBlock=e.X,exports.readFacadeKindDependency=e.$,exports.readModelCompiledKindRef=e.et,exports.relativeToContentString=e.Wt,exports.relativeToExplicitBinary64=e.Gt,exports.relativeToExplicitBytes=e.Kt,exports.relativeToExplicitString=e.qt,exports.resolveBlockComponents=e.At,exports.resolveBlockPackDescription=e.Dt,exports.resolveBlockPackMeta=e.It,exports.resolveFacadeKind=e.tt,exports.resolveKind=e.S,exports.resolveManifestBlockComponents=e.jt,exports.resolveManifestBlockPackMeta=e.Lt,exports.resolveModuleFile=e.Jt,exports.resolveModuleFolder=e.Yt,exports.resolveToRegistry=e.J,exports.selectorToRange=e.C,exports.storageByUrl=e._,exports.tryLoadPackDescription=e.xt,exports.writePublishedCoords=e.Y;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./config-DG4SQFXv.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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require_config","registry_v1_exports"],"sources":["../src/registry_v1/index.ts"],"sourcesContent":["export * from \"./v1_repo_schema\";\nexport * from \"./config_schema\";\nexport { PlRegPackageConfig } from \"./config\";\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":["require_config","_platforma_sdk_package_builder_lib","registry_v1_exports"],"sources":["../src/registry_v1/index.ts"],"sourcesContent":["export * from \"./v1_repo_schema\";\nexport * from \"./config_schema\";\nexport { PlRegPackageConfig } from \"./config\";\n"],"mappings":""}
package/dist/index.mjs CHANGED
@@ -1,19 +1,19 @@
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, Gt as p, H as m, Ht as h, I as g, It as _, J as v, Jt as y, K 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, _ as X, _t as Z, a as Q, at as $, b as ee, bt as te, c as ne, ct as re, d as ie, dt as ae, et as oe, f as se, ft as ce, g as le, gt as ue, h as de, ht as fe, i as pe, it as me, j as he, jt as ge, k as _e, kt as ve, l as ye, lt as be, m as xe, mt as Se, nt as Ce, o as we, ot as Te, p as Ee, pt as De, q as Oe, qt as ke, r as Ae, rt as je, s as Me, st as Ne, t as Pe, tt as Fe, u as Ie, ut as Le, v as Re, vt as ze, w as Be, wt as Ve, x as He, xt as Ue, y as We, yt as Ge, z as Ke, zt as qe } from "./config-C07cYptA.mjs";
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-BusBoNIz.mjs";
2
2
  // src/registry_v1/index.ts
3
- var Je = /* @__PURE__ */ K({
4
- GlobalOverviewPath: () => Ae,
5
- MetaFile: () => pe,
6
- PlPackageConfigData: () => ne,
7
- PlPackageJsonConfigFile: () => ye,
8
- PlPackageYamlConfigFile: () => Ie,
9
- PlRegCommonConfigData: () => ie,
10
- PlRegFullPackageConfigData: () => se,
11
- PlRegPackageConfig: () => Pe,
12
- PlRegPackageConfigDataShard: () => Ee,
13
- packageContentPrefix: () => Q,
14
- packageOverviewPath: () => we,
15
- payloadFilePath: () => Me
3
+ var Ye = /* @__PURE__ */ X({
4
+ GlobalOverviewPath: () => je,
5
+ MetaFile: () => me,
6
+ PlPackageConfigData: () => re,
7
+ PlPackageJsonConfigFile: () => be,
8
+ PlPackageYamlConfigFile: () => Le,
9
+ PlRegCommonConfigData: () => ae,
10
+ PlRegFullPackageConfigData: () => ce,
11
+ PlRegPackageConfig: () => Fe,
12
+ PlRegPackageConfigDataShard: () => De,
13
+ packageContentPrefix: () => $,
14
+ packageOverviewPath: () => Te,
15
+ payloadFilePath: () => Ne
16
16
  });
17
- export { fe as BlockDescriptionPackageJsonField, ue as BlockPackFolderName, Be as BlockRegistryV2, L as ChannelNameRegexp, l as ChannelsFolder, de as FSStorage, s as GlobalOverviewFileName, O as GlobalOverviewGzFileName, _e as GlobalOverviewGzPath, t as GlobalOverviewPath, Ce as KindImplementer, je as KindManifest, I as KindManifestFile, me as KindManifestFileInfo, $ as KindManifestFileName, Te as KindManifestIdentity, Ne as KindOverview, re as KindOverviewFileName, be as KindOverviewPathPattern, ee as KindResolutionError, Y as KindVersionMismatchError, Le as KindVersionOverview, ae as KindsPrefix, he as MainPrefix, w as ManifestFileName, E as ManifestSuffix, A as PackageManifestPattern, d as PackageOverview, g as PackageOverviewFileName, S as PackageOverviewVersionEntry, b as PublishedCoordsFileName, Je as RegistryV1, Re as RegistryV2Reader, le as S3Storage, P as absoluteToBase64, qe as absoluteToBytes, i as absoluteToString, R as addRelativePathPrefix, k as blockComponentsManifestToAbsoluteUrl, Ve as buildBlockPackDist, o as buildKindDist, Oe as buildPublishedCoords, M as checkKindVersionMatch, ve as consolidateBlockComponents, u as consolidateBlockPackDescription, T as consolidateBlockPackMeta, H as cpAbsoluteToRelative, D as embedBlockPackMetaAbsoluteBase64, j as embedBlockPackMetaAbsoluteBytes, f as embedBlockPackMetaBytes, xe as folderReaderByUrl, We as inferUpdateSuggestions, ce as kindContentPrefix, De as kindOverviewPath, Z as loadPackDescription, ze as loadPackDescriptionFromManifest, Ge as loadPackDescriptionRaw, h as mapLocalToAbsolute, Se as npmNameToKindPath, B as packFolderToRelativeTgz, N as packageChannelPrefix, Ke as packageChannelPrefixInsideV2, r as packageContentPrefix, V as packageContentPrefixInsideV2, m as packageOverviewPath, z as packageOverviewPathInsideV2, U as parseGlobalOverviewReg, te as parsePackageName, He as parseSelector, G as publishBlock, e as readFacadeKindDependency, oe as readModelCompiledKindRef, W as relativeToContentString, p as relativeToExplicitBinary64, x as relativeToExplicitBytes, ke as relativeToExplicitString, n as resolveBlockComponents, c as resolveBlockPackDescription, _ as resolveBlockPackMeta, Fe as resolveFacadeKind, F as resolveKind, ge as resolveManifestBlockComponents, C as resolveManifestBlockPackMeta, y as resolveModuleFile, J as resolveModuleFolder, v as resolveToRegistry, a as selectorToRange, X as storageByUrl, Ue as tryLoadPackDescription, q as writePublishedCoords };
17
+ export { de as BlockDescriptionPackageJsonField, Q as BlockPackFolderName, L as BlockRegistryV2, l as ChannelNameRegexp, s as ChannelsFolder, fe as FSStorage, ue as GcsStorage, O as GlobalOverviewFileName, ve as GlobalOverviewGzFileName, t as GlobalOverviewGzPath, ge as GlobalOverviewPath, Me as KindImplementer, he as KindManifest, o as KindManifestFile, ee as KindManifestFileInfo, Ee as KindManifestFileName, Pe as KindManifestIdentity, ie as KindOverview, xe as KindOverviewFileName, Re as KindOverviewPathPattern, Ue as KindResolutionError, M as KindVersionMismatchError, oe as KindVersionOverview, le as KindsPrefix, w as MainPrefix, E as ManifestFileName, A as ManifestSuffix, d as PackageManifestPattern, _ as PackageOverview, S as PackageOverviewFileName, N as PackageOverviewVersionEntry, ke as PublishedCoordsFileName, Ye as RegistryV1, Ge as RegistryV2Reader, Z as S3Storage, Je as absoluteToBase64, i as absoluteToBytes, H as absoluteToString, u as addRelativePathPrefix, ye as blockComponentsManifestToAbsoluteUrl, R as buildBlockPackDist, He as buildKindDist, y as buildPublishedCoords, e as checkKindVersionMatch, n as consolidateBlockComponents, c as consolidateBlockPackDescription, D as consolidateBlockPackMeta, g as cpAbsoluteToRelative, j as embedBlockPackMetaAbsoluteBase64, f as embedBlockPackMetaAbsoluteBytes, v as embedBlockPackMetaBytes, Se as folderReaderByUrl, te as inferUpdateSuggestions, Oe as kindContentPrefix, Ce as kindOverviewPath, Be as loadPackDescription, Ke as loadPackDescriptionFromManifest, ne as loadPackDescriptionRaw, B as mapLocalToAbsolute, pe as npmNameToKindPath, W as packFolderToRelativeTgz, qe as packageChannelPrefix, r as packageChannelPrefixInsideV2, V as packageContentPrefix, h as packageContentPrefixInsideV2, z as packageOverviewPath, U as packageOverviewPathInsideV2, p as parseGlobalOverviewReg, We as parsePackageName, F as parseSelector, Y as publishBlock, se as readFacadeKindDependency, Ie as readModelCompiledKindRef, m as relativeToContentString, x as relativeToExplicitBinary64, Ae as relativeToExplicitBytes, b as relativeToExplicitString, _e as resolveBlockComponents, k as resolveBlockPackDescription, C as resolveBlockPackMeta, we as resolveFacadeKind, a as resolveKind, T as resolveManifestBlockComponents, P as resolveManifestBlockPackMeta, J as resolveModuleFile, K as resolveModuleFolder, q as resolveToRegistry, Ve as selectorToRange, ze as storageByUrl, I as tryLoadPackDescription, G as writePublishedCoords };
18
18
 
19
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["readFacadeKindDependency","GlobalOverviewPath","resolveBlockComponents","packageContentPrefix","absoluteToString","selectorToRange","buildKindDist","GlobalOverviewFileName","resolveBlockPackDescription","ChannelsFolder","consolidateBlockPackDescription","PackageOverview","embedBlockPackMetaBytes","relativeToExplicitBinary64","packageOverviewPath","mapLocalToAbsolute","PackageOverviewFileName","resolveBlockPackMeta","resolveToRegistry","resolveModuleFile","PublishedCoordsFileName","relativeToExplicitBytes","PackageOverviewVersionEntry","resolveManifestBlockPackMeta","ManifestFileName","consolidateBlockPackMeta","ManifestSuffix","embedBlockPackMetaAbsoluteBase64","blockComponentsManifestToAbsoluteUrl","PackageManifestPattern","embedBlockPackMetaAbsoluteBytes","checkKindVersionMatch","packageChannelPrefix","absoluteToBase64","resolveKind","KindManifestFile","ChannelNameRegexp","addRelativePathPrefix","packageOverviewPathInsideV2","packFolderToRelativeTgz","cpAbsoluteToRelative","parseGlobalOverviewReg","relativeToContentString","publishBlock","__exportAll","writePublishedCoords","resolveModuleFolder","KindVersionMismatchError","storageByUrl","loadPackDescription","packageContentPrefix$1","KindManifestFileName","KindResolutionError","parsePackageName","PlPackageConfigData","KindOverviewFileName","PlRegCommonConfigData","KindsPrefix","readModelCompiledKindRef","PlRegFullPackageConfigData","kindContentPrefix","S3Storage","BlockPackFolderName","FSStorage","BlockDescriptionPackageJsonField","MetaFile","KindManifestFileInfo","MainPrefix","resolveManifestBlockComponents","GlobalOverviewGzPath","consolidateBlockComponents","PlPackageJsonConfigFile","KindOverviewPathPattern","folderReaderByUrl","npmNameToKindPath","KindImplementer","packageOverviewPath$1","KindManifestIdentity","PlRegPackageConfigDataShard","kindOverviewPath","buildPublishedCoords","relativeToExplicitString","GlobalOverviewPath$1","KindManifest","payloadFilePath","KindOverview","PlRegPackageConfig","resolveFacadeKind","PlPackageYamlConfigFile","KindVersionOverview","RegistryV2Reader","loadPackDescriptionFromManifest","BlockRegistryV2","buildBlockPackDist","parseSelector","tryLoadPackDescription","inferUpdateSuggestions","loadPackDescriptionRaw","packageChannelPrefixInsideV2","absoluteToBytes","registry_v1_exports","GlobalOverviewGzFileName","packageContentPrefixInsideV2"],"sources":["../src/registry_v1/index.ts"],"sourcesContent":["export * from \"./v1_repo_schema\";\nexport * from \"./config_schema\";\nexport { PlRegPackageConfig } from \"./config\";\n"],"mappings":""}
1
+ {"version":3,"file":"index.mjs","names":["checkKindVersionMatch","GlobalOverviewGzPath","consolidateBlockComponents","packageChannelPrefixInsideV2","absoluteToBytes","resolveKind","KindManifestFile","ChannelsFolder","consolidateBlockPackDescription","ChannelNameRegexp","addRelativePathPrefix","PackageManifestPattern","embedBlockPackMetaAbsoluteBytes","parseGlobalOverviewReg","relativeToContentString","packageContentPrefixInsideV2","cpAbsoluteToRelative","PackageOverview","embedBlockPackMetaBytes","buildPublishedCoords","relativeToExplicitString","relativeToExplicitBinary64","PackageOverviewFileName","resolveBlockPackMeta","MainPrefix","resolveManifestBlockComponents","ManifestFileName","consolidateBlockPackMeta","resolveBlockPackDescription","ManifestSuffix","embedBlockPackMetaAbsoluteBase64","KindVersionMismatchError","PackageOverviewVersionEntry","resolveManifestBlockPackMeta","parseSelector","tryLoadPackDescription","BlockRegistryV2","buildBlockPackDist","packageOverviewPath","mapLocalToAbsolute","absoluteToString","packageOverviewPathInsideV2","packFolderToRelativeTgz","writePublishedCoords","resolveModuleFolder","resolveToRegistry","resolveModuleFile","publishBlock","__exportAll","S3Storage","BlockPackFolderName","packageContentPrefix$1","KindManifestFileInfo","inferUpdateSuggestions","loadPackDescriptionRaw","PlPackageConfigData","KindOverview","PlRegCommonConfigData","KindVersionOverview","readFacadeKindDependency","PlRegFullPackageConfigData","KindsPrefix","GcsStorage","BlockDescriptionPackageJsonField","FSStorage","npmNameToKindPath","MetaFile","KindManifest","GlobalOverviewPath","resolveBlockComponents","GlobalOverviewGzFileName","blockComponentsManifestToAbsoluteUrl","PlPackageJsonConfigFile","KindOverviewFileName","folderReaderByUrl","kindOverviewPath","resolveFacadeKind","packageOverviewPath$1","KindManifestFileName","PlRegPackageConfigDataShard","kindContentPrefix","PublishedCoordsFileName","relativeToExplicitBytes","GlobalOverviewPath$1","KindImplementer","payloadFilePath","KindManifestIdentity","PlRegPackageConfig","readModelCompiledKindRef","PlPackageYamlConfigFile","KindOverviewPathPattern","storageByUrl","loadPackDescription","selectorToRange","buildKindDist","KindResolutionError","parsePackageName","RegistryV2Reader","loadPackDescriptionFromManifest","packageChannelPrefix","absoluteToBase64","registry_v1_exports","GlobalOverviewFileName","packageContentPrefix"],"sources":["../src/registry_v1/index.ts"],"sourcesContent":["export * from \"./v1_repo_schema\";\nexport * from \"./config_schema\";\nexport { PlRegPackageConfig } from \"./config\";\n"],"mappings":""}
@@ -1,28 +1 @@
1
- import { S3 } from '@aws-sdk/client-s3';
2
- export interface RegistryStorage {
3
- putFile(file: string, buffer: Buffer): Promise<void>;
4
- getFile(file: string): Promise<Buffer | undefined>;
5
- listFiles(prefix: string): Promise<string[]>;
6
- deleteFiles(...files: string[]): Promise<void>;
7
- }
8
- export declare class S3Storage implements RegistryStorage {
9
- readonly client: S3;
10
- readonly bucket: string;
11
- readonly root: string;
12
- constructor(client: S3, bucket: string, root: string);
13
- getFile(file: string): Promise<Buffer | undefined>;
14
- listFiles(prefix: string): Promise<string[]>;
15
- putFile(file: string, buffer: Buffer): Promise<void>;
16
- deleteFiles(...files: string[]): Promise<void>;
17
- }
18
- export declare class FSStorage implements RegistryStorage {
19
- /** Absolute path */
20
- readonly root: string;
21
- constructor(_root: string);
22
- private toAbsolutePath;
23
- getFile(address: string): Promise<Buffer | undefined>;
24
- listFiles(prefix: string): Promise<string[]>;
25
- putFile(address: string, buffer: Buffer): Promise<void>;
26
- deleteFiles(...files: string[]): Promise<void>;
27
- }
28
- export declare function storageByUrl(address: string): RegistryStorage;
1
+ export { type RegistryStorage, S3Storage, GcsStorage, FSStorage, storageByUrl, } from '@platforma-sdk/package-builder-lib';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/block-tools",
3
- "version": "2.17.9",
3
+ "version": "2.18.1",
4
4
  "description": "Utility to manipulate Platforma Blocks and Block Registry",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -24,16 +24,15 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@aws-sdk/client-ecr-public": "3.1157.0",
27
- "@aws-sdk/client-s3": "3.1157.0",
28
27
  "@inquirer/prompts": "^7.0.1",
29
28
  "@milaboratories/pl-http": "1.2.6",
30
29
  "@milaboratories/pl-model-backend": "1.4.45",
31
30
  "@milaboratories/pl-model-common": "1.55.1",
32
- "@milaboratories/pl-model-middle-layer": "1.36.0",
31
+ "@milaboratories/pl-model-middle-layer": "1.37.0",
33
32
  "@milaboratories/resolve-helper": "1.1.3",
34
33
  "@milaboratories/ts-helpers": "1.9.1",
35
34
  "@platforma-sdk/blocks-deps-updater": "2.2.2",
36
- "@platforma-sdk/package-builder-lib": "1.4.4",
35
+ "@platforma-sdk/package-builder-lib": "1.5.0",
37
36
  "canonicalize": "~2.1.0",
38
37
  "commander": "^15.0.0",
39
38
  "lru-cache": "^11.5.3",
@@ -19,3 +19,21 @@ test("test url reader without slash", async () => {
19
19
  const content = await reader.getContentReader()("ping");
20
20
  expect(content?.toString("utf8")).toStrictEqual("pong");
21
21
  });
22
+
23
+ test("test url reader rejects non-2xx responses", async () => {
24
+ const { createServer } = await import("node:http");
25
+ const server = createServer((req, res) => {
26
+ if (req.url === "/ok.txt") res.writeHead(200).end("content");
27
+ else res.writeHead(404).end("<Error><Code>NoSuchKey</Code></Error>");
28
+ });
29
+ await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
30
+ try {
31
+ const address = server.address();
32
+ if (address === null || typeof address === "string") throw new Error("no port");
33
+ const reader = folderReaderByUrl(`http://127.0.0.1:${address.port}/`);
34
+ expect((await reader.readFile("ok.txt")).toString()).toEqual("content");
35
+ await expect(reader.readFile("missing.json")).rejects.toThrow(/HTTP 404/);
36
+ } finally {
37
+ await new Promise((resolve) => server.close(resolve));
38
+ }
39
+ });
@@ -5,6 +5,7 @@ import path from "node:path";
5
5
  import pathPosix from "node:path/posix";
6
6
  import fsp from "node:fs/promises";
7
7
  import { defaultHttpDispatcher } from "@milaboratories/pl-http";
8
+ import { util } from "@platforma-sdk/package-builder-lib";
8
9
 
9
10
  export type ReadFileOptions = { signal?: AbortSignal };
10
11
 
@@ -27,6 +28,11 @@ class HttpFolderReader implements FolderReader {
27
28
  dispatcher: this.httpDispatcher,
28
29
  signal: options?.signal,
29
30
  });
31
+ if (response.statusCode < 200 || response.statusCode >= 300) {
32
+ // Release the connection; the error body (S3/GCS XML, an HTML page) is not registry content.
33
+ await response.body.dump();
34
+ throw new Error(`Failed to read ${util.redactUrl(targetUrl)}: HTTP ${response.statusCode}`);
35
+ }
30
36
  return Buffer.from(await response.body.arrayBuffer());
31
37
  }
32
38
 
package/src/io/storage.ts CHANGED
@@ -1,147 +1,8 @@
1
- import pathPosix from "node:path/posix";
2
- import path from "node:path";
3
- import { paginateListObjectsV2, S3 } from "@aws-sdk/client-s3";
4
- import * as fs from "node:fs";
5
-
6
- export interface RegistryStorage {
7
- putFile(file: string, buffer: Buffer): Promise<void>;
8
-
9
- getFile(file: string): Promise<Buffer | undefined>;
10
-
11
- listFiles(prefix: string): Promise<string[]>;
12
-
13
- deleteFiles(...files: string[]): Promise<void>;
14
- }
15
-
16
- export class S3Storage implements RegistryStorage {
17
- constructor(
18
- public readonly client: S3,
19
- public readonly bucket: string,
20
- public readonly root: string,
21
- ) {}
22
-
23
- async getFile(file: string): Promise<Buffer | undefined> {
24
- try {
25
- return Buffer.from(
26
- await (
27
- await this.client.getObject({
28
- Bucket: this.bucket,
29
- Key: pathPosix.join(this.root, file),
30
- })
31
- ).Body!.transformToByteArray(),
32
- );
33
- } catch (e: unknown) {
34
- if (e instanceof Error && e.name === "NoSuchKey") return undefined;
35
- else throw e;
36
- }
37
- }
38
-
39
- async listFiles(prefix: string): Promise<string[]> {
40
- const listRoot = pathPosix.join(this.root, prefix);
41
- const paginator = paginateListObjectsV2(
42
- { client: this.client },
43
- {
44
- Bucket: this.bucket,
45
- Prefix: listRoot,
46
- },
47
- );
48
- const result: string[] = [];
49
- for await (const page of paginator)
50
- result.push(...(page.Contents ?? []).map((e) => pathPosix.relative(listRoot, e.Key!)));
51
- return result;
52
- }
53
-
54
- async putFile(file: string, buffer: Buffer): Promise<void> {
55
- await this.client.putObject({
56
- Bucket: this.bucket,
57
- Key: pathPosix.join(this.root, file),
58
- Body: buffer,
59
- });
60
- }
61
-
62
- async deleteFiles(...files: string[]): Promise<void> {
63
- // TODO implement support of more than 1000 files
64
- const results = await this.client.deleteObjects({
65
- Bucket: this.bucket,
66
- Delete: {
67
- Objects: files.map((file) => ({
68
- Key: pathPosix.join(this.root, file),
69
- })),
70
- },
71
- });
72
- if (results.Errors !== undefined && results.Errors.length > 0)
73
- throw new Error(
74
- `Errors encountered while deleting files: ${results.Errors.map((e) => e.Message ?? e.Code ?? "Unknown error").join("\n")}`,
75
- );
76
- }
77
- }
78
-
79
- export class FSStorage implements RegistryStorage {
80
- /** Absolute path */
81
- public readonly root: string;
82
-
83
- constructor(_root: string) {
84
- this.root = path.resolve(_root);
85
- }
86
-
87
- private toAbsolutePath(localPath: string): string {
88
- if (pathPosix.isAbsolute(localPath)) throw new Error("absolute path");
89
- return path.resolve(this.root, localPath.split(pathPosix.sep).join(path.sep));
90
- }
91
-
92
- async getFile(address: string): Promise<Buffer | undefined> {
93
- try {
94
- return await fs.promises.readFile(this.toAbsolutePath(address));
95
- } catch (err: unknown) {
96
- if (err instanceof Error && "code" in err && err.code === "ENOENT") return undefined;
97
- else throw err;
98
- }
99
- }
100
-
101
- async listFiles(prefix: string): Promise<string[]> {
102
- try {
103
- const listRoot = this.toAbsolutePath(prefix);
104
- return (await fs.promises.readdir(listRoot, { recursive: true, withFileTypes: true }))
105
- .filter((e) => e.isFile())
106
- .map((e) =>
107
- path
108
- .relative(listRoot, path.resolve(e.parentPath, e.name))
109
- .split(path.sep)
110
- .join(pathPosix.sep),
111
- );
112
- } catch (err: unknown) {
113
- if (err instanceof Error && "code" in err && err.code === "ENOENT") return [];
114
- else throw err;
115
- }
116
- }
117
-
118
- async putFile(address: string, buffer: Buffer): Promise<void> {
119
- const absoluteAddress = this.toAbsolutePath(address);
120
- await fs.promises.mkdir(path.dirname(absoluteAddress), { recursive: true });
121
- await fs.promises.writeFile(absoluteAddress, buffer);
122
- }
123
-
124
- async deleteFiles(...files: string[]): Promise<void> {
125
- // Folders are not removed, deletes issued sequentially
126
- for (const file of files) await fs.promises.rm(this.toAbsolutePath(file));
127
- }
128
- }
129
-
130
- export function storageByUrl(address: string): RegistryStorage {
131
- const url = new URL(address, `file:${path.resolve(".").split(path.sep).join(pathPosix.sep)}/`);
132
- switch (url.protocol) {
133
- case "file:": {
134
- const root = path.resolve(url.pathname);
135
- return new FSStorage(root);
136
- }
137
- case "s3:": {
138
- const options: NonNullable<ConstructorParameters<typeof S3>[0]> = {};
139
- const region = url.searchParams.get("region");
140
- if (region) options.region = region;
141
- const bucket = url.hostname;
142
- return new S3Storage(new S3(options), bucket, url.pathname.replace(/^\//, ""));
143
- }
144
- default:
145
- throw new Error(`Unknown protocol: ${url.protocol}`);
146
- }
147
- }
1
+ // The storage drivers live in package-builder-lib, shared with software package uploads.
2
+ export {
3
+ type RegistryStorage,
4
+ S3Storage,
5
+ GcsStorage,
6
+ FSStorage,
7
+ storageByUrl,
8
+ } from "@platforma-sdk/package-builder-lib";