@axiom-lattice/core 2.1.88 → 2.1.89
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.mts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1410,6 +1410,26 @@ interface BackendProtocol {
|
|
|
1410
1410
|
* @returns Raw file content as FileData
|
|
1411
1411
|
*/
|
|
1412
1412
|
readRaw(filePath: string): MaybePromise<FileData>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Read file content as raw binary Buffer.
|
|
1415
|
+
*
|
|
1416
|
+
* Optional method for backends that support binary file access.
|
|
1417
|
+
* Backends that store files as text (StateBackend, MemoryBackend, StoreBackend)
|
|
1418
|
+
* may omit this method.
|
|
1419
|
+
*
|
|
1420
|
+
* @param filePath - Absolute file path
|
|
1421
|
+
* @returns Raw file content as Buffer
|
|
1422
|
+
*/
|
|
1423
|
+
readBinary?(filePath: string): Promise<Buffer>;
|
|
1424
|
+
/**
|
|
1425
|
+
* Write raw binary data to a file.
|
|
1426
|
+
*
|
|
1427
|
+
* Optional method for backends that support binary file writing.
|
|
1428
|
+
*
|
|
1429
|
+
* @param filePath - Absolute file path
|
|
1430
|
+
* @param data - Binary data to write
|
|
1431
|
+
*/
|
|
1432
|
+
writeBinary?(filePath: string, data: Buffer): Promise<void>;
|
|
1413
1433
|
/**
|
|
1414
1434
|
* Structured search results or error string for invalid input.
|
|
1415
1435
|
*
|
|
@@ -5582,6 +5602,8 @@ declare class VolumeFilesystem implements BackendProtocol {
|
|
|
5582
5602
|
lsInfo(path: string): Promise<FileInfo[]>;
|
|
5583
5603
|
read(filePath: string, offset?: number, limit?: number): Promise<string>;
|
|
5584
5604
|
readRaw(filePath: string): Promise<FileData>;
|
|
5605
|
+
readBinary(filePath: string): Promise<Buffer>;
|
|
5606
|
+
writeBinary(filePath: string, data: Buffer): Promise<void>;
|
|
5585
5607
|
grepRaw(_pattern: string, _path?: string | null, _glob?: string | null): string | GrepMatch[];
|
|
5586
5608
|
globInfo(_pattern: string, _path?: string): FileInfo[];
|
|
5587
5609
|
write(filePath: string, content: string): Promise<WriteResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1410,6 +1410,26 @@ interface BackendProtocol {
|
|
|
1410
1410
|
* @returns Raw file content as FileData
|
|
1411
1411
|
*/
|
|
1412
1412
|
readRaw(filePath: string): MaybePromise<FileData>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Read file content as raw binary Buffer.
|
|
1415
|
+
*
|
|
1416
|
+
* Optional method for backends that support binary file access.
|
|
1417
|
+
* Backends that store files as text (StateBackend, MemoryBackend, StoreBackend)
|
|
1418
|
+
* may omit this method.
|
|
1419
|
+
*
|
|
1420
|
+
* @param filePath - Absolute file path
|
|
1421
|
+
* @returns Raw file content as Buffer
|
|
1422
|
+
*/
|
|
1423
|
+
readBinary?(filePath: string): Promise<Buffer>;
|
|
1424
|
+
/**
|
|
1425
|
+
* Write raw binary data to a file.
|
|
1426
|
+
*
|
|
1427
|
+
* Optional method for backends that support binary file writing.
|
|
1428
|
+
*
|
|
1429
|
+
* @param filePath - Absolute file path
|
|
1430
|
+
* @param data - Binary data to write
|
|
1431
|
+
*/
|
|
1432
|
+
writeBinary?(filePath: string, data: Buffer): Promise<void>;
|
|
1413
1433
|
/**
|
|
1414
1434
|
* Structured search results or error string for invalid input.
|
|
1415
1435
|
*
|
|
@@ -5582,6 +5602,8 @@ declare class VolumeFilesystem implements BackendProtocol {
|
|
|
5582
5602
|
lsInfo(path: string): Promise<FileInfo[]>;
|
|
5583
5603
|
read(filePath: string, offset?: number, limit?: number): Promise<string>;
|
|
5584
5604
|
readRaw(filePath: string): Promise<FileData>;
|
|
5605
|
+
readBinary(filePath: string): Promise<Buffer>;
|
|
5606
|
+
writeBinary(filePath: string, data: Buffer): Promise<void>;
|
|
5585
5607
|
grepRaw(_pattern: string, _path?: string | null, _glob?: string | null): string | GrepMatch[];
|
|
5586
5608
|
globInfo(_pattern: string, _path?: string): FileInfo[];
|
|
5587
5609
|
write(filePath: string, content: string): Promise<WriteResult>;
|
package/dist/index.js
CHANGED
|
@@ -7482,7 +7482,8 @@ var VolumeFilesystem = class {
|
|
|
7482
7482
|
}).join("\n");
|
|
7483
7483
|
}
|
|
7484
7484
|
async readRaw(filePath) {
|
|
7485
|
-
const
|
|
7485
|
+
const buf = await this.client.readRaw(filePath);
|
|
7486
|
+
const content = buf.toString("utf-8");
|
|
7486
7487
|
const lines = content.split("\n");
|
|
7487
7488
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7488
7489
|
return {
|
|
@@ -7491,6 +7492,12 @@ var VolumeFilesystem = class {
|
|
|
7491
7492
|
modified_at: now
|
|
7492
7493
|
};
|
|
7493
7494
|
}
|
|
7495
|
+
async readBinary(filePath) {
|
|
7496
|
+
return this.client.readRaw(filePath);
|
|
7497
|
+
}
|
|
7498
|
+
async writeBinary(filePath, data) {
|
|
7499
|
+
await this.client.writeRaw(filePath, data);
|
|
7500
|
+
}
|
|
7494
7501
|
grepRaw(_pattern, _path, _glob) {
|
|
7495
7502
|
throw new Error("Not supported on volume backend");
|
|
7496
7503
|
}
|