@lotics/cli 0.32.0 → 0.34.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 +27 -0
- package/dist/cli.js +673 -0
- package/dist/{src/dev → dev}/wrapper_page.d.ts +6 -4
- package/dist/{src/dev → dev}/wrapper_page.js +40 -10
- package/dist/docx.d.ts +2 -0
- package/dist/docx.js +341 -0
- package/dist/docx.test.js +145 -0
- package/dist/file_command_io.d.ts +12 -0
- package/dist/file_command_io.js +34 -0
- package/dist/src/cli.js +46757 -500
- package/dist/{src/starter_template.d.ts → starter_template.d.ts} +1 -1
- package/dist/{src/starter_template.js → starter_template.js} +1 -1
- package/dist/starter_template.test.d.ts +1 -0
- package/dist/xlsx.d.ts +2 -0
- package/dist/xlsx.js +489 -0
- package/dist/xlsx.test.d.ts +1 -0
- package/dist/xlsx.test.js +131 -0
- package/package.json +6 -2
- /package/dist/{src/app_commands.d.ts → app_commands.d.ts} +0 -0
- /package/dist/{src/app_commands.js → app_commands.js} +0 -0
- /package/dist/{src/app_commands.test.d.ts → app_commands.test.d.ts} +0 -0
- /package/dist/{src/app_commands.test.js → app_commands.test.js} +0 -0
- /package/dist/{src/args.d.ts → args.d.ts} +0 -0
- /package/dist/{src/args.js → args.js} +0 -0
- /package/dist/{src/args.test.d.ts → args.test.d.ts} +0 -0
- /package/dist/{src/args.test.js → args.test.js} +0 -0
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{src/client.d.ts → client.d.ts} +0 -0
- /package/dist/{src/client.js → client.js} +0 -0
- /package/dist/{src/config.d.ts → config.d.ts} +0 -0
- /package/dist/{src/config.js → config.js} +0 -0
- /package/dist/{src/config.test.d.ts → config.test.d.ts} +0 -0
- /package/dist/{src/config.test.js → config.test.js} +0 -0
- /package/dist/{src/dev → dev}/rpc_handler.d.ts +0 -0
- /package/dist/{src/dev → dev}/rpc_handler.js +0 -0
- /package/dist/{src/dev → dev}/server.d.ts +0 -0
- /package/dist/{src/dev → dev}/server.js +0 -0
- /package/dist/{src/starter_template.test.d.ts → docx.test.d.ts} +0 -0
- /package/dist/{src/generate_app_queries_dts.d.ts → generate_app_queries_dts.d.ts} +0 -0
- /package/dist/{src/generate_app_queries_dts.js → generate_app_queries_dts.js} +0 -0
- /package/dist/{src/generate_app_workflows_dts.d.ts → generate_app_workflows_dts.d.ts} +0 -0
- /package/dist/{src/generate_app_workflows_dts.js → generate_app_workflows_dts.js} +0 -0
- /package/dist/{src/starter_template.test.js → starter_template.test.js} +0 -0
- /package/dist/{src/version.d.ts → version.d.ts} +0 -0
- /package/dist/{src/version.js → version.js} +0 -0
package/README.md
CHANGED
|
@@ -101,6 +101,33 @@ lotics download <file_id> -o ./reports/
|
|
|
101
101
|
LOTICS_API_KEY=ltk_... lotics run query_tables '{}'
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
## Local .xlsx and .docx authoring
|
|
105
|
+
|
|
106
|
+
The CLI bundles Lotics's own xlsx and docx engines so you can read, write, and edit files on your local filesystem without installing `xlsx` / `exceljs` / `docx` from npm. Prefer these over third-party libraries — they round-trip faithfully with the Lotics editor, template engine, and formula engine.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# .xlsx
|
|
110
|
+
lotics xlsx read ./report.xlsx # → JSON of sheets, cells, merges
|
|
111
|
+
lotics xlsx write ./out.xlsx '{"sheets":[{"name":"S1","cells":{"A1":"Hi","B1":42}}]}'
|
|
112
|
+
lotics xlsx set-cell ./report.xlsx 'Sheet1!A1' '=SUM(B:B)'
|
|
113
|
+
lotics xlsx add-sheet ./report.xlsx 'Summary'
|
|
114
|
+
lotics xlsx merge ./report.xlsx 'Sheet1!A1:C1'
|
|
115
|
+
lotics xlsx insert-rows ./report.xlsx Sheet1 5 3
|
|
116
|
+
lotics xlsx batch ./report.xlsx '[{"op":"set-cell","sheet":"Sheet1","ref":"A1","value":"Hi"}, {"op":"merge","sheet":"Sheet1","range":"A1:B1"}]'
|
|
117
|
+
|
|
118
|
+
# .docx
|
|
119
|
+
lotics docx read ./report.docx # → JSON of blocks with text + style
|
|
120
|
+
lotics docx write ./out.docx '{"blocks":[{"kind":"paragraph","text":"Title","style":"Heading1"}]}'
|
|
121
|
+
lotics docx append-paragraph ./report.docx 'New paragraph' --style=Heading2
|
|
122
|
+
lotics docx insert-paragraph ./report.docx 'Front matter' --at=0
|
|
123
|
+
lotics docx replace-text ./report.docx '{{name}}' 'Acme Inc.'
|
|
124
|
+
lotics docx batch ./report.docx '[{"op":"append-paragraph","text":"A","style":"Heading1"},{"op":"replace-text","search":"x","replace":"y"}]'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Edits mutate the file in place via an atomic temp-file + rename. Unknown OOXML constructs (tables, SmartArt, custom XML) round-trip verbatim — they show up in `read` as `opaque_block` entries.
|
|
128
|
+
|
|
129
|
+
Run `lotics xlsx` or `lotics docx` with no subcommand for the full list.
|
|
130
|
+
|
|
104
131
|
## SDK
|
|
105
132
|
|
|
106
133
|
```typescript
|