@platforma-sdk/block-tools 2.6.62 → 2.6.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/block-tools",
3
- "version": "2.6.62",
3
+ "version": "2.6.64",
4
4
  "description": "Utility to manipulate Platforma Blocks and Block Registry",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -32,12 +32,12 @@
32
32
  "undici": "~7.16.0",
33
33
  "yaml": "^2.8.0",
34
34
  "zod": "~3.23.8",
35
- "@milaboratories/pl-model-common": "1.25.1",
36
35
  "@milaboratories/pl-http": "1.2.3",
37
- "@milaboratories/resolve-helper": "1.1.2",
36
+ "@milaboratories/pl-model-middle-layer": "1.12.9",
38
37
  "@milaboratories/ts-helpers": "1.7.2",
38
+ "@milaboratories/pl-model-common": "1.25.1",
39
+ "@milaboratories/resolve-helper": "1.1.2",
39
40
  "@platforma-sdk/blocks-deps-updater": "2.0.1",
40
- "@milaboratories/pl-model-middle-layer": "1.12.7",
41
41
  "@milaboratories/ts-helpers-oclif": "1.1.37"
42
42
  },
43
43
  "devDependencies": {
@@ -49,14 +49,14 @@
49
49
  "oclif": "^4.16.2",
50
50
  "rollup-plugin-node-externals": "^8.0.0",
51
51
  "semver": "^7.7.2",
52
- "typescript": "~5.6.3",
53
- "vite": "^6.4.1",
52
+ "typescript": "~5.9.3",
53
+ "vite": "8.0.0-beta.15",
54
54
  "vite-plugin-dts": "^4.5.3",
55
55
  "vitest": "^4.0.18",
56
+ "@milaboratories/ts-builder": "1.2.12",
57
+ "@milaboratories/oclif-index": "1.1.1",
56
58
  "@milaboratories/build-configs": "1.5.0",
57
- "@milaboratories/ts-configs": "1.2.1",
58
- "@milaboratories/ts-builder": "1.2.11",
59
- "@milaboratories/oclif-index": "1.1.1"
59
+ "@milaboratories/ts-configs": "1.2.1"
60
60
  },
61
61
  "oclif": {
62
62
  "bin": "block-tools",
package/src/util.ts CHANGED
@@ -25,8 +25,11 @@ export async function tryStat(path: string): Promise<BigIntStats | undefined> {
25
25
  }
26
26
  }
27
27
 
28
- export function calculateSha256(bytes: ArrayBuffer): Promise<string> {
28
+ export function calculateSha256(bytes: Uint8Array<ArrayBufferLike> | ArrayBuffer): Promise<string> {
29
29
  return Promise.resolve(
30
- createHash("sha256").update(Buffer.from(bytes)).digest("hex").toUpperCase(),
30
+ createHash("sha256")
31
+ .update(ArrayBuffer.isView(bytes) ? bytes : Buffer.from(bytes))
32
+ .digest("hex")
33
+ .toUpperCase(),
31
34
  );
32
35
  }
@@ -225,14 +225,14 @@ export function relativeToExplicitBytes(
225
225
  return {
226
226
  type: "explicit-bytes",
227
227
  mimeType: value.mimeType,
228
- content: Buffer.from(value.content, "base64"),
228
+ content: new Uint8Array(Buffer.from(value.content, "base64")),
229
229
  };
230
230
  const mimeType = mime.lookup(value.path);
231
231
  if (!mimeType) throw new Error(`Can't recognize mime type of the file: ${value.path}.`);
232
232
  return {
233
233
  type: "explicit-bytes",
234
234
  mimeType,
235
- content: await reader(value.path),
235
+ content: new Uint8Array(await reader(value.path)),
236
236
  };
237
237
  };
238
238
  }