@particle-academy/holy-sheet 2.2.1 → 2.3.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/README.md +17 -1
- package/dist/index.cjs +1245 -270
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -8
- package/dist/index.d.ts +59 -8
- package/dist/index.js +1243 -271
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,12 +46,28 @@ await Agent.write(schema, "sales.xlsx");
|
|
|
46
46
|
- `lint(schema)` → formula problems `{sheet, address, formula, error, hint}[]`
|
|
47
47
|
- `fromArray(rows, headers?, sheetName?, options?)` → schema
|
|
48
48
|
- `fromCsv(csvOrPath, options?)` → schema
|
|
49
|
-
- `describe(
|
|
49
|
+
- `read(bytes)` → schema (universal) and `describe(path)` → schema (Node only): the round-trip reader, for an `.xlsx` **or an `.ods`**
|
|
50
50
|
- `toolDefinition()` → JSON Schema for LLM tool-use
|
|
51
51
|
- `version()` → string
|
|
52
52
|
|
|
53
53
|
See `docs/` for the full schema reference.
|
|
54
54
|
|
|
55
|
+
### Reading OpenDocument spreadsheets
|
|
56
|
+
|
|
57
|
+
`read()` and `describe()` accept an OpenDocument spreadsheet (`.ods`) as well
|
|
58
|
+
as an `.xlsx`, and return the same schema for both, so a caller needs no
|
|
59
|
+
branch on the file type and no second library:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const schema = await Agent.describe("upload.ods"); // or upload.xlsx: same shape
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The format is decided from the file's contents, never its name. Anything else
|
|
66
|
+
throws `UnsupportedFormatException` (an `Error`, with the declared `mimetype`
|
|
67
|
+
when there is one). What maps and what does not is listed in the PHP package's
|
|
68
|
+
[`docs/ReadPath.md`](https://github.com/Particle-Academy/holy-sheet/blob/main/docs/ReadPath.md#opendocument-spreadsheets-ods);
|
|
69
|
+
this port reads the same fixtures and is diffed against it.
|
|
70
|
+
|
|
55
71
|
---
|
|
56
72
|
|
|
57
73
|
## ⭐ Star Fancy UI
|