@lotics/cli 0.318.20 → 0.318.21
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/src/cli.js +9 -6
- package/docs/document_templates.md +5 -3
- package/docs/workflows.md +6 -4
- package/docs/working_in_a_workspace.md +10 -0
- package/package.json +1 -1
|
@@ -65,8 +65,9 @@ this host, give the person the file and a `person` drop link.
|
|
|
65
65
|
### By type
|
|
66
66
|
|
|
67
67
|
- **`html`** — a full HTML document with inline CSS and `{{variable}}` placeholders, rendered to PDF; anything whose layout
|
|
68
|
-
you control. `variables` are plain text, rich `html`, an auto-rendered `table` or a `list`; `format` (page size
|
|
69
|
-
`orientation` are optional
|
|
68
|
+
you control. `variables` are plain text, rich `html`, an auto-rendered `table` or a `list`; `format` (a named page size:
|
|
69
|
+
A0–A6, Letter, Legal, Tabloid, Ledger) and `orientation` are optional; any other size is the page's own CSS,
|
|
70
|
+
`@page { size: 50mm 30mm }`. A change may send `patch_ops`, exact search-and-replace edits of the stored markup, in place
|
|
70
71
|
of the whole `template`.
|
|
71
72
|
- **`pdf-form`** — an existing PDF filled in place. `set_template` with the uploaded `template_file_id`
|
|
72
73
|
answers `page_count` and `pages` (each page's `page_index`, unrotated MediaBox `width` and `height`, `origin_x`, `origin_y`
|
|
@@ -79,7 +80,8 @@ this host, give the person the file and a `person` drop link.
|
|
|
79
80
|
- **`excel`** — a `.xlsx` with `{{marker}}`s in the cells to fill, and a `variables` map. Markers are validated at create
|
|
80
81
|
time: a structural error blocks the save, and a declared variable with no marker comes back in `unmarked_variables`
|
|
81
82
|
(skipped). `set_template` with `dry_run: true` runs every check and stores nothing; a refusal lists every error with its code and cell, and `warnings[]` (`severity`, `code`, `message`, `sheet_name?`, `cell?`) comes back with the answer. Pass
|
|
82
|
-
raw numbers, ISO dates and booleans at generate time; the cell's number format shows them.
|
|
83
|
+
raw numbers, ISO dates and booleans at generate time; the cell's number format shows them. A cell's format also decides
|
|
84
|
+
what text becomes: text that reads as a number (`5%`) is written as one, unless the cell is formatted as text (`@`).
|
|
83
85
|
- **`word`** — a `.docx` with `{{marker}}`s. `variables` is optional: every marker is derived (`{{name}}` string,
|
|
84
86
|
`{{FOR … IN name}}` array, `{{IF name}}` boolean), and a marker you did not declare is still added
|
|
85
87
|
(`derived_variables`). At generate time `data` needs a key for **every** marker, `""` for a blank one. A marker may run
|
package/docs/workflows.md
CHANGED
|
@@ -186,7 +186,7 @@ A body names a table or document template by its alias (`query_records({ table_i
|
|
|
186
186
|
save cannot place it against (`includes(filter(record.tags, …), "hot")`) is refused: search the field itself. A link reads as the list of its row ids, a
|
|
187
187
|
one-row link too: `first(record.customer)` is the one id, and `record.customer` used as one id is refused at save,
|
|
188
188
|
naming `first(record.customer)`. A one-row link is written with its one id or a list of one; a many-row link with a list. A lookup reads as one flat list of the values it looks up: `includes(record.owner,
|
|
189
|
-
me)`. A select's value is one of another select's options only where that table shares its keys, by having been
|
|
189
|
+
me)`; a looked-up link, as the ids of its rows, which `query_records` takes as `record_ids`. A select's value is one of another select's options only where that table shares its keys, by having been
|
|
190
190
|
duplicated from it, not where an option merely shares its alias. A row that takes its parent's option gets it from
|
|
191
191
|
`default_from`, and a lookup shows it.
|
|
192
192
|
4. **What an app sends takes an option by alias or key.** An input or output drawn from a field (`field`, written
|
|
@@ -195,7 +195,9 @@ A body names a table or document template by its alias (`query_records({ table_i
|
|
|
195
195
|
5. **`==` against a multi-select means "includes".** `record["tags"] == "urgent"` on a multi-select is stored as
|
|
196
196
|
`includes(record["tags"], "urgent")`; either spelling works.
|
|
197
197
|
6. **Text renders labels.** Inside a template or a text tool input, a select, member or link value renders its display
|
|
198
|
-
text: `` `${record["status"]}` `` writes "Done", not `done
|
|
198
|
+
text: `` `${record["status"]}` `` writes "Done", not `done`, and `` `${record["status"] ?? ""}` `` writes it too. A
|
|
199
|
+
formula stating `options` (a computed category) is read as the single select it is drawn as: compared by option,
|
|
200
|
+
rendered by label.
|
|
199
201
|
|
|
200
202
|
## What an expression reads
|
|
201
203
|
|
|
@@ -339,8 +341,8 @@ The same work can be written with the helpers below, which are additions to Java
|
|
|
339
341
|
`uuidFrom(text)` (the same UUID for the same text, refusing null and empty text: `uuidFrom(record.id)`)
|
|
340
342
|
- **Objects**: `keys`, `values`, `entries`, `nonNullKeys`, `pick`, `omit`, `merge`
|
|
341
343
|
- **Dates**, in the workspace's timezone: `now`, `formatDate`, `parseDate`, `addDays`, `subDays`,
|
|
342
|
-
`addHours`, `subHours`, `addMinutes`, `subMinutes`, `startOfDay`, `endOfDay`,
|
|
343
|
-
`differenceInCalendarDays`, `differenceInHours`, `differenceInMinutes`, `isBefore`, `isAfter`,
|
|
344
|
+
`addHours`, `subHours`, `addMinutes`, `subMinutes`, `startOfDay`, `endOfDay`, `startOfMonth`, `endOfMonth`,
|
|
345
|
+
`addMonths` (a day past the target month's end lands on its last day), `differenceInCalendarDays`, `differenceInHours`, `differenceInMinutes`, `isBefore`, `isAfter`,
|
|
344
346
|
`isSameDay`, `isToday`, `isWithinRange`, `meetsBounds`
|
|
345
347
|
- **Other**: `formatCurrency(amount, locale, currency)`, `randomNumber(len)`,
|
|
346
348
|
`randomAlphaNumeric(len)`, `sample(items)` (a random item)
|
|
@@ -68,6 +68,16 @@ type's value. Every write meets the table's rules (`reference/write-rules`): eve
|
|
|
68
68
|
locked record answers under `blocked`. The owner's own lists (a menu with prices, customers, open orders) are rows of their
|
|
69
69
|
tables, loaded this way after `set_tables`.
|
|
70
70
|
|
|
71
|
+
## A business's tax ID
|
|
72
|
+
|
|
73
|
+
No tool resolves a business name to its tax ID. The customer's own papers carry the ID they are invoiced under: a PO's
|
|
74
|
+
invoicing footer, a contract, a past invoice. A web search limited to registry listings (`masothue.com`,
|
|
75
|
+
`infodoanhnghiep.com`) shows each match's tax ID in its result, though those sites refuse a direct fetch; many companies
|
|
76
|
+
share a name, and the registered address is what tells them apart. For a
|
|
77
|
+
Vietnamese tax ID (mã số thuế, a branch's with a `-00N` suffix), `https://api.vietqr.io/v2/business/{mst}` answers the
|
|
78
|
+
registered name, address and status (`NNT đang hoạt động` when active); it is rate-limited, answering 429 to a burst. A
|
|
79
|
+
registered address can differ from the one a PO prints.
|
|
80
|
+
|
|
71
81
|
## Answering a question
|
|
72
82
|
|
|
73
83
|
1. `get_app`: a Reading's query (its `key`) is the business's own figure for it. `run_app_query` with `alias` and
|