@lotics/cli 0.320.0 → 0.320.2
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 +6 -6
- package/docs/app_bindings.md +3 -1
- package/docs/data_model.md +1 -1
- package/docs/document_templates.md +8 -4
- package/docs/workflows.md +4 -0
- package/package.json +1 -1
package/docs/app_bindings.md
CHANGED
|
@@ -148,7 +148,9 @@ the one `get_app` lists for it, it replaces the body. On an app written as a tre
|
|
|
148
148
|
`key` or an Act's `workflow` — and the node states `inputs`, `outputs` and `description`
|
|
149
149
|
(`reference/workflow-node`, whose value shapes differ from the **Inputs** below): a call stating any of
|
|
150
150
|
them for it is refused, and outputs the node leaves out are derived from the body. An alias the tree
|
|
151
|
-
names nowhere is archived by the next `set_app`.
|
|
151
|
+
names nowhere is archived by the next `set_app`. `set_app`'s `workflows` takes the same sources and saves them in the
|
|
152
|
+
same write as the tree: a change to what a workflow takes or hands back that its saved body no longer meets is refused
|
|
153
|
+
unless the write carries the new body. A Workflow node runs only for someone who holds the
|
|
152
154
|
app: on an app shared by a public link, a visitor's call of it is refused as an alias the app does
|
|
153
155
|
not have. This page's `inputs` and `outputs` are for a custom-code app.
|
|
154
156
|
|
package/docs/data_model.md
CHANGED
|
@@ -188,7 +188,7 @@ A table is named by its alias wherever a call names one (`table_id`, a link's `t
|
|
|
188
188
|
- **`force` consents to losing values:** deleting a field rows hold, removing an option rows hold, and a change of type
|
|
189
189
|
or format that does not convert every value (a date made a month cuts a day other than the 1st, a text made a time
|
|
190
190
|
clears a cell holding none). Unforced, the call is refused naming the cells; the API's table and field routes take
|
|
191
|
-
`force` in the body and refuse with `error_code` `ConversionNeedsForce`, its `findings` counting the `cells` per field.
|
|
191
|
+
`force` in the body and refuse with `error_code` `ConversionNeedsForce`, its `findings` counting the `cells` per field. A formula, lookup or rollup holds what it computes, so it is deleted without it.
|
|
192
192
|
- A field the call makes required with a `default` answers how many rows took it: `defaulted` per field alias on
|
|
193
193
|
`set_tables`, `rows_defaulted` on the API's table and field routes.
|
|
194
194
|
- A money formula is proven by its numbers. `query_records` with `aggregate` the affected totals before the change and after, and
|
|
@@ -15,7 +15,7 @@ This is a **capability + usage** guide. A tool's exact input schema is in its ow
|
|
|
15
15
|
|---|---|---|---|
|
|
16
16
|
| `pdf-form` | fields overlaid on an **uploaded PDF** at fixed positions | PDF | `"pdf-form"` |
|
|
17
17
|
| `html` (a PDF) | an **HTML + Handlebars** layout you write from scratch | PDF | `"html"` |
|
|
18
|
-
| `excel` | an **uploaded `.xlsx`** with `{{marker}}` cells | `.xlsx` | `"excel"` |
|
|
18
|
+
| `excel` | an **uploaded `.xlsx` or `.xlsm`** with `{{marker}}` cells | `.xlsx` | `"excel"` |
|
|
19
19
|
| `word` | an **uploaded `.docx`** with `{{marker}}`s | `.docx` | `"word"` |
|
|
20
20
|
| `email` | an **inline HTML + Handlebars** body, rendered when the email is sent | email | `"email"` |
|
|
21
21
|
|
|
@@ -79,7 +79,9 @@ this host, give the person the file and a `person` drop link.
|
|
|
79
79
|
count the rest, and `pages_unavailable` says why a template's pages could not be read.
|
|
80
80
|
A positioned text field prints in Arimo, which covers Vietnamese; a PDF's own field keeps its font while its value is
|
|
81
81
|
ASCII and switches to Arimo past it.
|
|
82
|
-
- **`excel`** — a `.xlsx` with `{{marker}}`s in the cells to fill, and a `variables` map.
|
|
82
|
+
- **`excel`** — a `.xlsx` or `.xlsm` with `{{marker}}`s in the cells to fill, and a `variables` map. `sheet` names the sheet
|
|
83
|
+
that is the paper in a workbook holding others, and the template leaves the rest out; a formula reading a sheet left out
|
|
84
|
+
is refused. A macro workbook is kept without its macros and the buttons that run them. Markers are validated at create
|
|
83
85
|
time: a structural error blocks the save, and a declared variable with no marker comes back in `unmarked_variables`
|
|
84
86
|
(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
|
|
85
87
|
raw numbers, ISO dates and booleans at generate time; the cell's number format shows them. A cell's format also decides
|
|
@@ -105,8 +107,10 @@ the `set_template` description for the reference; here is the capability:
|
|
|
105
107
|
invoice lines, order rows, tables. Excel and the HTML/email engines use a Handlebars-style
|
|
106
108
|
`{{#each items}}…{{/each}}`; Word uses `{{FOR item IN items}}…{{$item.field}}…{{END-FOR item}}`. The HTML and email types
|
|
107
109
|
also offer an auto-rendered `table` variable — declare its columns and pass an array, no
|
|
108
|
-
hand-written loop.
|
|
109
|
-
|
|
110
|
+
hand-written loop. Excel marks the rows that repeat with `{{#each items}}` and `{{/each}}`, each alone in a row above and
|
|
111
|
+
below them, or inline in the paper's own rows: `{{#each items}}` opens the first repeated row's first cell holding text
|
|
112
|
+
and `{{/each}}` closes the last one's last (a formula cell is passed over), so a one-row body reads `{{#each lines}}{{@ordinal}}` … `{{amount}}{{/each}}`.
|
|
113
|
+
(Excel has no auto-rendered `table` type; its variable types are string/number/date/boolean/array.) Inside a loop the row's number counted from 1
|
|
110
114
|
is `{{@ordinal}}` (Excel, HTML, email) or `{{$ordinal}}` (Word), the innermost loop's: an STT column is a cell holding
|
|
111
115
|
`{{@ordinal}}` beside the row's other markers. `{{@index}}` counts from 0.
|
|
112
116
|
- **Columns across** — a column per item of a list, for a grid of rows by days or by kinds. HTML/email nest a
|
package/docs/workflows.md
CHANGED
|
@@ -170,6 +170,7 @@ A body names a table or document template by its alias (`query_records({ table_i
|
|
|
170
170
|
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 where the two state the same alias for it; two selects that
|
|
171
171
|
state no alias in common never hold one value, and a save that compares them or copies one into the other is refused.
|
|
172
172
|
A row that takes its parent's option gets it from `default_from`, and a lookup shows it.
|
|
173
|
+
A grouped aggregate's `key` reads as the option's alias, and `get(row.data, "<field>")` as `row.data.<field>` (an empty cell takes the default).
|
|
173
174
|
4. **What an app sends takes an option by alias or key.** An input or output drawn from a field (`field`, written
|
|
174
175
|
`<table id>.<alias>`) compares and returns by alias in the body, and the run hands it on as the option's key. A
|
|
175
176
|
refusal's `field_errors` and a `validate` check's `field_key` name a declared input or a field's alias.
|
|
@@ -777,6 +778,9 @@ return({ status: "success", message: "Invoiced", data: { invoice_code: made.invo
|
|
|
777
778
|
|
|
778
779
|
4. `run_app_workflow` with `dry_run: true`, then the same call without it.
|
|
779
780
|
|
|
781
|
+
To change later what it takes or hands back, send the node's change and the new body in one `set_app`, the body under
|
|
782
|
+
`workflows`.
|
|
783
|
+
|
|
780
784
|
A step wants the provider's own ids (`branch_id`, `sold_by_id`, `product_id`) and no tool lists them: declare a Workflow
|
|
781
785
|
whose body calls the provider's `list_*` workflow step (`kiotviet_list_branches`), run it, and read the ids from its answer.
|
|
782
786
|
No step lists KiotViet's users: read `sold_by_id` off a row `kiotviet_list_invoices` returns (KiotViet's `soldById`), or ask the owner.
|