@elaraai/east-node-io 0.0.1-beta.1 → 0.0.1-beta.3
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/compression/gzip.d.ts +108 -0
- package/dist/compression/gzip.d.ts.map +1 -0
- package/dist/compression/gzip.js +153 -0
- package/dist/compression/gzip.js.map +1 -0
- package/dist/compression/index.d.ts +308 -0
- package/dist/compression/index.d.ts.map +1 -0
- package/dist/compression/index.js +289 -0
- package/dist/compression/index.js.map +1 -0
- package/dist/compression/tar.d.ts +115 -0
- package/dist/compression/tar.d.ts.map +1 -0
- package/dist/compression/tar.js +254 -0
- package/dist/compression/tar.js.map +1 -0
- package/dist/compression/types.d.ts +124 -0
- package/dist/compression/types.d.ts.map +1 -0
- package/dist/compression/types.js +106 -0
- package/dist/compression/types.js.map +1 -0
- package/dist/compression/zip.d.ts +121 -0
- package/dist/compression/zip.d.ts.map +1 -0
- package/dist/compression/zip.js +200 -0
- package/dist/compression/zip.js.map +1 -0
- package/dist/connection/index.d.ts +78 -0
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +134 -0
- package/dist/connection/index.js.map +1 -0
- package/dist/format/index.d.ts +421 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +326 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/types.d.ts +176 -0
- package/dist/format/types.d.ts.map +1 -0
- package/dist/format/types.js +122 -0
- package/dist/format/types.js.map +1 -0
- package/dist/format/xlsx.d.ts +178 -0
- package/dist/format/xlsx.d.ts.map +1 -0
- package/dist/format/xlsx.js +313 -0
- package/dist/format/xlsx.js.map +1 -0
- package/dist/format/xml.d.ts +302 -0
- package/dist/format/xml.d.ts.map +1 -0
- package/dist/format/xml.js +602 -0
- package/dist/format/xml.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/nosql/index.d.ts +503 -0
- package/dist/nosql/index.d.ts.map +1 -0
- package/dist/nosql/index.js +483 -0
- package/dist/nosql/index.js.map +1 -0
- package/dist/nosql/mongodb.d.ts +306 -0
- package/dist/nosql/mongodb.d.ts.map +1 -0
- package/dist/nosql/mongodb.js +552 -0
- package/dist/nosql/mongodb.js.map +1 -0
- package/dist/nosql/redis.d.ts +268 -0
- package/dist/nosql/redis.d.ts.map +1 -0
- package/dist/nosql/redis.js +371 -0
- package/dist/nosql/redis.js.map +1 -0
- package/dist/nosql/types.d.ts +70 -0
- package/dist/nosql/types.d.ts.map +1 -0
- package/dist/nosql/types.js +79 -0
- package/dist/nosql/types.js.map +1 -0
- package/dist/sql/index.d.ts +777 -0
- package/dist/sql/index.d.ts.map +1 -0
- package/dist/sql/index.js +515 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/mysql.d.ts +238 -0
- package/dist/sql/mysql.d.ts.map +1 -0
- package/dist/sql/mysql.js +396 -0
- package/dist/sql/mysql.js.map +1 -0
- package/dist/sql/postgres.d.ts +237 -0
- package/dist/sql/postgres.d.ts.map +1 -0
- package/dist/sql/postgres.js +381 -0
- package/dist/sql/postgres.js.map +1 -0
- package/dist/sql/sqlite.d.ts +217 -0
- package/dist/sql/sqlite.d.ts.map +1 -0
- package/dist/sql/sqlite.js +366 -0
- package/dist/sql/sqlite.js.map +1 -0
- package/dist/sql/types.d.ts +205 -0
- package/dist/sql/types.d.ts.map +1 -0
- package/dist/sql/types.js +175 -0
- package/dist/sql/types.js.map +1 -0
- package/dist/storage/index.d.ts +304 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +234 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/s3.d.ts +373 -0
- package/dist/storage/s3.d.ts.map +1 -0
- package/dist/storage/s3.js +502 -0
- package/dist/storage/s3.js.map +1 -0
- package/dist/storage/types.d.ts +117 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +94 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/transfer/ftp.d.ts +333 -0
- package/dist/transfer/ftp.d.ts.map +1 -0
- package/dist/transfer/ftp.js +437 -0
- package/dist/transfer/ftp.js.map +1 -0
- package/dist/transfer/index.d.ts +456 -0
- package/dist/transfer/index.d.ts.map +1 -0
- package/dist/transfer/index.js +414 -0
- package/dist/transfer/index.js.map +1 -0
- package/dist/transfer/sftp.d.ts +333 -0
- package/dist/transfer/sftp.d.ts.map +1 -0
- package/dist/transfer/sftp.js +436 -0
- package/dist/transfer/sftp.js.map +1 -0
- package/dist/transfer/types.d.ts +108 -0
- package/dist/transfer/types.d.ts.map +1 -0
- package/dist/transfer/types.js +110 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* XLSX (Excel) file format platform functions for East Node IO.
|
|
7
|
+
*
|
|
8
|
+
* Provides functions for reading and writing Excel files (.xlsx) as 2D arrays
|
|
9
|
+
* of literal values.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { BlobType } from "@elaraai/east";
|
|
14
|
+
import type { PlatformFunction } from "@elaraai/east/internal";
|
|
15
|
+
/**
|
|
16
|
+
* Reads an XLSX file and returns a 2D array of cell values.
|
|
17
|
+
*
|
|
18
|
+
* Parses an Excel file from a blob and extracts data as a 2D array where
|
|
19
|
+
* each row is an array of cell values. Cell values are represented as
|
|
20
|
+
* LiteralValueType (string, number, boolean, or null).
|
|
21
|
+
*
|
|
22
|
+
* This is a platform function for the East language, enabling Excel file
|
|
23
|
+
* operations in East programs running on Node.js.
|
|
24
|
+
*
|
|
25
|
+
* @param data - XLSX file content as a blob
|
|
26
|
+
* @param options - Read options (sheet name)
|
|
27
|
+
* @returns 2D array of cell values (ArrayType<ArrayType<LiteralValueType>>)
|
|
28
|
+
*
|
|
29
|
+
* @throws {EastError} When reading fails due to:
|
|
30
|
+
* - Invalid XLSX file format (location: "xlsx_read")
|
|
31
|
+
* - Sheet not found (location: "xlsx_read")
|
|
32
|
+
* - Corrupted file data (location: "xlsx_read")
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { East, BlobType, IntegerType, variant } from "@elaraai/east";
|
|
37
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
38
|
+
*
|
|
39
|
+
* const countRows = East.function([BlobType], IntegerType, ($, xlsxBlob) => {
|
|
40
|
+
* const options = $.let({
|
|
41
|
+
* sheetName: variant('some', "Sheet1"),
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* const sheet = $.let(Format.XLSX.read(xlsxBlob, options));
|
|
45
|
+
*
|
|
46
|
+
* // Skip header row in East code
|
|
47
|
+
* const dataRows = $.let(sheet.slice(East.value(1n), sheet.size()));
|
|
48
|
+
*
|
|
49
|
+
* return $.return(dataRows.size());
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* const compiled = East.compile(countRows.toIR(), Format.XLSX.Implementation);
|
|
53
|
+
* const xlsxBlob = new Uint8Array([]);
|
|
54
|
+
* compiled(xlsxBlob); // 99n (row count after skipping header)
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* - All read operations are synchronous (use East.compile)
|
|
59
|
+
* - Empty cells are represented as null
|
|
60
|
+
* - Numbers are converted to JavaScript numbers (not bigint)
|
|
61
|
+
* - Dates are converted to ISO 8601 strings
|
|
62
|
+
* - Formulas are evaluated and their results are returned
|
|
63
|
+
*/
|
|
64
|
+
export declare const xlsx_read: import("@elaraai/east").PlatformDefinition<[BlobType, import("@elaraai/east").StructType<{
|
|
65
|
+
sheetName: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
|
|
66
|
+
}>], import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
67
|
+
Null: import("@elaraai/east").NullType;
|
|
68
|
+
Boolean: import("@elaraai/east").BooleanType;
|
|
69
|
+
Integer: import("@elaraai/east").IntegerType;
|
|
70
|
+
Float: import("@elaraai/east").FloatType;
|
|
71
|
+
String: import("@elaraai/east").StringType;
|
|
72
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
73
|
+
Blob: BlobType;
|
|
74
|
+
}>>>>;
|
|
75
|
+
/**
|
|
76
|
+
* Writes a 2D array of cell values to an XLSX file.
|
|
77
|
+
*
|
|
78
|
+
* Creates an Excel file from a 2D array of literal values. Each nested array
|
|
79
|
+
* represents a row, and each value in the row represents a cell.
|
|
80
|
+
*
|
|
81
|
+
* This is a platform function for the East language, enabling Excel file
|
|
82
|
+
* creation in East programs running on Node.js.
|
|
83
|
+
*
|
|
84
|
+
* @param data - 2D array of cell values to write
|
|
85
|
+
* @param options - Write options (sheet name)
|
|
86
|
+
* @returns XLSX file content as a blob
|
|
87
|
+
*
|
|
88
|
+
* @throws {EastError} When writing fails due to:
|
|
89
|
+
* - Invalid data structure (location: "xlsx_write")
|
|
90
|
+
* - Unsupported cell value type (location: "xlsx_write")
|
|
91
|
+
* - Memory allocation failure for large files (location: "xlsx_write")
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* import { East, BlobType, variant } from "@elaraai/east";
|
|
96
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
97
|
+
*
|
|
98
|
+
* const createExcel = East.function([], BlobType, $ => {
|
|
99
|
+
* const data = $.let([
|
|
100
|
+
* [variant('String', "Name"), variant('String', "Age"), variant('String', "City")],
|
|
101
|
+
* [variant('String', "Alice"), variant('Float', 30), variant('String', "New York")],
|
|
102
|
+
* [variant('String', "Bob"), variant('Float', 25), variant('String', "London")],
|
|
103
|
+
* ]);
|
|
104
|
+
*
|
|
105
|
+
* const options = $.let({
|
|
106
|
+
* sheetName: variant('some', "Employees"),
|
|
107
|
+
* });
|
|
108
|
+
*
|
|
109
|
+
* return $.return(Format.XLSX.write(data, options));
|
|
110
|
+
* });
|
|
111
|
+
*
|
|
112
|
+
* const compiled = East.compile(createExcel.toIR(), Format.XLSX.Implementation);
|
|
113
|
+
* const xlsxBlob = compiled();
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* - All write operations are synchronous (use East.compile)
|
|
118
|
+
* - null values create empty cells
|
|
119
|
+
* - Numbers are written as numeric cells
|
|
120
|
+
* - Strings are written as text cells
|
|
121
|
+
* - Booleans are written as boolean cells
|
|
122
|
+
* - All rows should ideally have the same number of columns
|
|
123
|
+
*/
|
|
124
|
+
export declare const xlsx_write: import("@elaraai/east").PlatformDefinition<[import("@elaraai/east").ArrayType<import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
125
|
+
Null: import("@elaraai/east").NullType;
|
|
126
|
+
Boolean: import("@elaraai/east").BooleanType;
|
|
127
|
+
Integer: import("@elaraai/east").IntegerType;
|
|
128
|
+
Float: import("@elaraai/east").FloatType;
|
|
129
|
+
String: import("@elaraai/east").StringType;
|
|
130
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
131
|
+
Blob: BlobType;
|
|
132
|
+
}>>>, import("@elaraai/east").StructType<{
|
|
133
|
+
sheetName: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
|
|
134
|
+
}>], BlobType>;
|
|
135
|
+
/**
|
|
136
|
+
* Gets metadata about an XLSX file without reading all data.
|
|
137
|
+
*
|
|
138
|
+
* Returns information about sheets in the workbook including names and
|
|
139
|
+
* approximate row/column counts. Useful for inspecting files before reading.
|
|
140
|
+
*
|
|
141
|
+
* @param data - XLSX file content as a blob
|
|
142
|
+
* @returns Metadata with sheet names and sizes
|
|
143
|
+
*
|
|
144
|
+
* @throws {EastError} When reading fails due to:
|
|
145
|
+
* - Invalid XLSX file format (location: "xlsx_info")
|
|
146
|
+
* - Corrupted file data (location: "xlsx_info")
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { East, BlobType, StringType } from "@elaraai/east";
|
|
151
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
152
|
+
*
|
|
153
|
+
* const getFirstSheetName = East.function([BlobType], StringType, ($, xlsxBlob) => {
|
|
154
|
+
* const info = $.let(Format.XLSX.info(xlsxBlob));
|
|
155
|
+
* const firstSheet = $.let(info.sheets.at(East.value(0n)));
|
|
156
|
+
* return $.return(firstSheet.name);
|
|
157
|
+
* });
|
|
158
|
+
*
|
|
159
|
+
* const compiled = East.compile(getFirstSheetName.toIR(), Format.XLSX.Implementation);
|
|
160
|
+
* const xlsxBlob = new Uint8Array([]);
|
|
161
|
+
* compiled(xlsxBlob); // "Sheet1"
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare const xlsx_info: import("@elaraai/east").PlatformDefinition<[BlobType], import("@elaraai/east").StructType<{
|
|
165
|
+
sheets: import("@elaraai/east").ArrayType<import("@elaraai/east").StructType<{
|
|
166
|
+
name: import("@elaraai/east").StringType;
|
|
167
|
+
rowCount: import("@elaraai/east").IntegerType;
|
|
168
|
+
columnCount: import("@elaraai/east").IntegerType;
|
|
169
|
+
}>>;
|
|
170
|
+
}>>;
|
|
171
|
+
/**
|
|
172
|
+
* Node.js platform implementation for XLSX operations.
|
|
173
|
+
*
|
|
174
|
+
* Provides the runtime implementations for XLSX read/write operations.
|
|
175
|
+
* Pass this to East.compile() to enable XLSX functionality.
|
|
176
|
+
*/
|
|
177
|
+
export declare const XlsxImpl: PlatformFunction[];
|
|
178
|
+
//# sourceMappingURL=xlsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xlsx.d.ts","sourceRoot":"","sources":["../../src/format/xlsx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAQ,QAAQ,EAAkB,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;KAA6E,CAAC;AACpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;cAA+E,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,SAAS;;;;;;GAAuD,CAAC;AAqB9E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,gBAAgB,EAqKtC,CAAC"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* XLSX (Excel) file format platform functions for East Node IO.
|
|
7
|
+
*
|
|
8
|
+
* Provides functions for reading and writing Excel files (.xlsx) as 2D arrays
|
|
9
|
+
* of literal values.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { East, BlobType, variant, match } from "@elaraai/east";
|
|
14
|
+
import { EastError, LiteralValueType } from "@elaraai/east/internal";
|
|
15
|
+
import * as XLSX from 'xlsx';
|
|
16
|
+
import { XlsxSheetType, XlsxReadOptionsType, XlsxWriteOptionsType, XlsxInfoType, } from "./types.js";
|
|
17
|
+
/**
|
|
18
|
+
* Reads an XLSX file and returns a 2D array of cell values.
|
|
19
|
+
*
|
|
20
|
+
* Parses an Excel file from a blob and extracts data as a 2D array where
|
|
21
|
+
* each row is an array of cell values. Cell values are represented as
|
|
22
|
+
* LiteralValueType (string, number, boolean, or null).
|
|
23
|
+
*
|
|
24
|
+
* This is a platform function for the East language, enabling Excel file
|
|
25
|
+
* operations in East programs running on Node.js.
|
|
26
|
+
*
|
|
27
|
+
* @param data - XLSX file content as a blob
|
|
28
|
+
* @param options - Read options (sheet name)
|
|
29
|
+
* @returns 2D array of cell values (ArrayType<ArrayType<LiteralValueType>>)
|
|
30
|
+
*
|
|
31
|
+
* @throws {EastError} When reading fails due to:
|
|
32
|
+
* - Invalid XLSX file format (location: "xlsx_read")
|
|
33
|
+
* - Sheet not found (location: "xlsx_read")
|
|
34
|
+
* - Corrupted file data (location: "xlsx_read")
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { East, BlobType, IntegerType, variant } from "@elaraai/east";
|
|
39
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
40
|
+
*
|
|
41
|
+
* const countRows = East.function([BlobType], IntegerType, ($, xlsxBlob) => {
|
|
42
|
+
* const options = $.let({
|
|
43
|
+
* sheetName: variant('some', "Sheet1"),
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* const sheet = $.let(Format.XLSX.read(xlsxBlob, options));
|
|
47
|
+
*
|
|
48
|
+
* // Skip header row in East code
|
|
49
|
+
* const dataRows = $.let(sheet.slice(East.value(1n), sheet.size()));
|
|
50
|
+
*
|
|
51
|
+
* return $.return(dataRows.size());
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* const compiled = East.compile(countRows.toIR(), Format.XLSX.Implementation);
|
|
55
|
+
* const xlsxBlob = new Uint8Array([]);
|
|
56
|
+
* compiled(xlsxBlob); // 99n (row count after skipping header)
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* - All read operations are synchronous (use East.compile)
|
|
61
|
+
* - Empty cells are represented as null
|
|
62
|
+
* - Numbers are converted to JavaScript numbers (not bigint)
|
|
63
|
+
* - Dates are converted to ISO 8601 strings
|
|
64
|
+
* - Formulas are evaluated and their results are returned
|
|
65
|
+
*/
|
|
66
|
+
export const xlsx_read = East.platform("xlsx_read", [BlobType, XlsxReadOptionsType], XlsxSheetType);
|
|
67
|
+
/**
|
|
68
|
+
* Writes a 2D array of cell values to an XLSX file.
|
|
69
|
+
*
|
|
70
|
+
* Creates an Excel file from a 2D array of literal values. Each nested array
|
|
71
|
+
* represents a row, and each value in the row represents a cell.
|
|
72
|
+
*
|
|
73
|
+
* This is a platform function for the East language, enabling Excel file
|
|
74
|
+
* creation in East programs running on Node.js.
|
|
75
|
+
*
|
|
76
|
+
* @param data - 2D array of cell values to write
|
|
77
|
+
* @param options - Write options (sheet name)
|
|
78
|
+
* @returns XLSX file content as a blob
|
|
79
|
+
*
|
|
80
|
+
* @throws {EastError} When writing fails due to:
|
|
81
|
+
* - Invalid data structure (location: "xlsx_write")
|
|
82
|
+
* - Unsupported cell value type (location: "xlsx_write")
|
|
83
|
+
* - Memory allocation failure for large files (location: "xlsx_write")
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { East, BlobType, variant } from "@elaraai/east";
|
|
88
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
89
|
+
*
|
|
90
|
+
* const createExcel = East.function([], BlobType, $ => {
|
|
91
|
+
* const data = $.let([
|
|
92
|
+
* [variant('String', "Name"), variant('String', "Age"), variant('String', "City")],
|
|
93
|
+
* [variant('String', "Alice"), variant('Float', 30), variant('String', "New York")],
|
|
94
|
+
* [variant('String', "Bob"), variant('Float', 25), variant('String', "London")],
|
|
95
|
+
* ]);
|
|
96
|
+
*
|
|
97
|
+
* const options = $.let({
|
|
98
|
+
* sheetName: variant('some', "Employees"),
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* return $.return(Format.XLSX.write(data, options));
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* const compiled = East.compile(createExcel.toIR(), Format.XLSX.Implementation);
|
|
105
|
+
* const xlsxBlob = compiled();
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* - All write operations are synchronous (use East.compile)
|
|
110
|
+
* - null values create empty cells
|
|
111
|
+
* - Numbers are written as numeric cells
|
|
112
|
+
* - Strings are written as text cells
|
|
113
|
+
* - Booleans are written as boolean cells
|
|
114
|
+
* - All rows should ideally have the same number of columns
|
|
115
|
+
*/
|
|
116
|
+
export const xlsx_write = East.platform("xlsx_write", [XlsxSheetType, XlsxWriteOptionsType], BlobType);
|
|
117
|
+
/**
|
|
118
|
+
* Gets metadata about an XLSX file without reading all data.
|
|
119
|
+
*
|
|
120
|
+
* Returns information about sheets in the workbook including names and
|
|
121
|
+
* approximate row/column counts. Useful for inspecting files before reading.
|
|
122
|
+
*
|
|
123
|
+
* @param data - XLSX file content as a blob
|
|
124
|
+
* @returns Metadata with sheet names and sizes
|
|
125
|
+
*
|
|
126
|
+
* @throws {EastError} When reading fails due to:
|
|
127
|
+
* - Invalid XLSX file format (location: "xlsx_info")
|
|
128
|
+
* - Corrupted file data (location: "xlsx_info")
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* import { East, BlobType, StringType } from "@elaraai/east";
|
|
133
|
+
* import { Format } from "@elaraai/east-node-io";
|
|
134
|
+
*
|
|
135
|
+
* const getFirstSheetName = East.function([BlobType], StringType, ($, xlsxBlob) => {
|
|
136
|
+
* const info = $.let(Format.XLSX.info(xlsxBlob));
|
|
137
|
+
* const firstSheet = $.let(info.sheets.at(East.value(0n)));
|
|
138
|
+
* return $.return(firstSheet.name);
|
|
139
|
+
* });
|
|
140
|
+
*
|
|
141
|
+
* const compiled = East.compile(getFirstSheetName.toIR(), Format.XLSX.Implementation);
|
|
142
|
+
* const xlsxBlob = new Uint8Array([]);
|
|
143
|
+
* compiled(xlsxBlob); // "Sheet1"
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export const xlsx_info = East.platform("xlsx_info", [BlobType], XlsxInfoType);
|
|
147
|
+
/**
|
|
148
|
+
* Converts East LiteralValueType to native JavaScript value for XLSX.
|
|
149
|
+
*
|
|
150
|
+
* @param value - East LiteralValueType value
|
|
151
|
+
* @returns Native JavaScript value
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
function convertLiteralToCell(value) {
|
|
155
|
+
return match(value, {
|
|
156
|
+
Null: () => null,
|
|
157
|
+
String: (v) => v,
|
|
158
|
+
Integer: (v) => Number(v), // Convert BigInt to Number for Excel
|
|
159
|
+
Float: (v) => v,
|
|
160
|
+
Boolean: (v) => v,
|
|
161
|
+
DateTime: (v) => v, // Keep as Date object
|
|
162
|
+
Blob: (v) => v.toString(), // Convert Blob to string representation
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Node.js platform implementation for XLSX operations.
|
|
167
|
+
*
|
|
168
|
+
* Provides the runtime implementations for XLSX read/write operations.
|
|
169
|
+
* Pass this to East.compile() to enable XLSX functionality.
|
|
170
|
+
*/
|
|
171
|
+
export const XlsxImpl = [
|
|
172
|
+
xlsx_read.implement((data, options) => {
|
|
173
|
+
try {
|
|
174
|
+
// Convert Uint8Array blob to Buffer
|
|
175
|
+
const buffer = Buffer.from(data);
|
|
176
|
+
// Parse the workbook with cellDates option to parse dates as Date objects
|
|
177
|
+
const workbook = XLSX.read(buffer, { type: 'buffer', cellDates: true });
|
|
178
|
+
// Determine which sheet to read
|
|
179
|
+
let sheetName;
|
|
180
|
+
if (options.sheetName?.type === 'some') {
|
|
181
|
+
sheetName = options.sheetName.value;
|
|
182
|
+
if (!workbook.Sheets[sheetName]) {
|
|
183
|
+
throw new EastError(`Sheet "${sheetName}" not found in workbook`, {
|
|
184
|
+
location: { filename: "xlsx_read", line: 0n, column: 0n }
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
// Use first sheet if no name specified
|
|
190
|
+
const firstSheetName = workbook.SheetNames[0];
|
|
191
|
+
if (!firstSheetName) {
|
|
192
|
+
throw new EastError('Workbook contains no sheets', {
|
|
193
|
+
location: { filename: "xlsx_read", line: 0n, column: 0n }
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
sheetName = firstSheetName;
|
|
197
|
+
}
|
|
198
|
+
const worksheet = workbook.Sheets[sheetName];
|
|
199
|
+
if (!worksheet) {
|
|
200
|
+
throw new EastError(`Sheet "${sheetName}" not found in workbook`, {
|
|
201
|
+
location: { filename: "xlsx_read", line: 0n, column: 0n }
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
// Get the range of the worksheet
|
|
205
|
+
const range = XLSX.utils.decode_range(worksheet['!ref'] || 'A1');
|
|
206
|
+
// Convert worksheet to 2D array using cell metadata
|
|
207
|
+
const eastData = [];
|
|
208
|
+
for (let R = range.s.r; R <= range.e.r; R++) {
|
|
209
|
+
const row = [];
|
|
210
|
+
for (let C = range.s.c; C <= range.e.c; C++) {
|
|
211
|
+
const cellAddress = XLSX.utils.encode_cell({ r: R, c: C });
|
|
212
|
+
const cell = worksheet[cellAddress];
|
|
213
|
+
if (!cell) {
|
|
214
|
+
// Empty cell
|
|
215
|
+
row.push(variant('Null', null));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
// Use cell type metadata to determine the correct variant
|
|
219
|
+
switch (cell.t) {
|
|
220
|
+
case 'b': // Boolean
|
|
221
|
+
row.push(variant('Boolean', cell.v));
|
|
222
|
+
break;
|
|
223
|
+
case 'n': // Number
|
|
224
|
+
row.push(variant('Float', cell.v));
|
|
225
|
+
break;
|
|
226
|
+
case 's': // String
|
|
227
|
+
row.push(variant('String', cell.v));
|
|
228
|
+
break;
|
|
229
|
+
case 'd': // Date
|
|
230
|
+
row.push(variant('DateTime', cell.v));
|
|
231
|
+
break;
|
|
232
|
+
case 'z': // Stub (blank)
|
|
233
|
+
case 'e': // Error
|
|
234
|
+
default:
|
|
235
|
+
row.push(variant('Null', null));
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
eastData.push(row);
|
|
241
|
+
}
|
|
242
|
+
return eastData;
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
if (err instanceof EastError) {
|
|
246
|
+
throw err;
|
|
247
|
+
}
|
|
248
|
+
throw new EastError(`Failed to read XLSX file: ${err.message}`, {
|
|
249
|
+
location: { filename: "xlsx_read", line: 0n, column: 0n },
|
|
250
|
+
cause: err
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}),
|
|
254
|
+
xlsx_write.implement((data, options) => {
|
|
255
|
+
try {
|
|
256
|
+
// Convert East 2D array to native JavaScript array
|
|
257
|
+
const nativeData = data.map(row => row.map(convertLiteralToCell));
|
|
258
|
+
// Create a new workbook and worksheet
|
|
259
|
+
const workbook = XLSX.utils.book_new();
|
|
260
|
+
const worksheet = XLSX.utils.aoa_to_sheet(nativeData);
|
|
261
|
+
// Determine sheet name
|
|
262
|
+
const sheetName = options.sheetName?.type === 'some' ? options.sheetName.value : 'Sheet1';
|
|
263
|
+
// Add worksheet to workbook
|
|
264
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, sheetName);
|
|
265
|
+
// Write workbook to buffer
|
|
266
|
+
const buffer = XLSX.write(workbook, {
|
|
267
|
+
type: 'buffer',
|
|
268
|
+
bookType: 'xlsx',
|
|
269
|
+
});
|
|
270
|
+
// Convert Buffer to Uint8Array
|
|
271
|
+
return new Uint8Array(buffer);
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
throw new EastError(`Failed to write XLSX file: ${err.message}`, {
|
|
275
|
+
location: { filename: "xlsx_write", line: 0n, column: 0n },
|
|
276
|
+
cause: err
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
xlsx_info.implement((data) => {
|
|
281
|
+
try {
|
|
282
|
+
// Convert Uint8Array blob to Buffer
|
|
283
|
+
const buffer = Buffer.from(data);
|
|
284
|
+
// Parse the workbook (but don't read all data)
|
|
285
|
+
const workbook = XLSX.read(buffer, { type: 'buffer', bookVBA: false });
|
|
286
|
+
// Extract sheet information
|
|
287
|
+
const sheets = workbook.SheetNames.map(name => {
|
|
288
|
+
const worksheet = workbook.Sheets[name];
|
|
289
|
+
if (!worksheet) {
|
|
290
|
+
return {
|
|
291
|
+
name,
|
|
292
|
+
rowCount: 0n,
|
|
293
|
+
columnCount: 0n,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
const range = XLSX.utils.decode_range(worksheet['!ref'] || 'A1');
|
|
297
|
+
return {
|
|
298
|
+
name,
|
|
299
|
+
rowCount: BigInt(range.e.r - range.s.r + 1),
|
|
300
|
+
columnCount: BigInt(range.e.c - range.s.c + 1),
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
return { sheets };
|
|
304
|
+
}
|
|
305
|
+
catch (err) {
|
|
306
|
+
throw new EastError(`Failed to read XLSX file info: ${err.message}`, {
|
|
307
|
+
location: { filename: "xlsx_info", line: 0n, column: 0n },
|
|
308
|
+
cause: err
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}),
|
|
312
|
+
];
|
|
313
|
+
//# sourceMappingURL=xlsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xlsx.js","sourceRoot":"","sources":["../../src/format/xlsx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GACf,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;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