zinkee 0.1.58 → 0.1.60
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
CHANGED
|
@@ -377,6 +377,9 @@ zinkee --json records query projects --limit 10 --sort "_id:desc"
|
|
|
377
377
|
# Query with a free-text search term (matched across the schema's searchable fields)
|
|
378
378
|
zinkee --json records query projects --where "status in OPEN" --search "garcia" --limit 25
|
|
379
379
|
|
|
380
|
+
# Query with OR and nested groups (native where, see "Query filters" below)
|
|
381
|
+
zinkee --json records query deals --where-json '{"or":[{"field":"status","op":"eq","value":"OPEN"},{"field":"amount","op":"gt","value":10000}]}'
|
|
382
|
+
|
|
380
383
|
# Get
|
|
381
384
|
zinkee --json records get projects <record-uuid>
|
|
382
385
|
|
|
@@ -407,6 +410,35 @@ holds any child record refuses the clear (409 `data_dependency_conflict`), as it
|
|
|
407
410
|
refuses `records delete` of a record it points at; nothing is deleted. Blocked by
|
|
408
411
|
`--read-only`.
|
|
409
412
|
|
|
413
|
+
### Query filters
|
|
414
|
+
|
|
415
|
+
`--where "<field> <op> [value]"` is repeatable and combines its conditions with AND
|
|
416
|
+
(the colon form `field:op:value` works when the expression has no spaces). Operators:
|
|
417
|
+
`eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `not_contains`, `in`
|
|
418
|
+
(comma-separated values), `between` (exactly two comma-separated values `from,to`,
|
|
419
|
+
both included), `is_empty`, `is_not_empty`.
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
zinkee --json records query contacts --where "contact-name not_contains test"
|
|
423
|
+
zinkee --json records query contacts --where "due-date between 2026-10-01,2026-10-31"
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
For OR, pass the API's native `where` with `--where-json`: a JSON array of conditions
|
|
427
|
+
(implicit AND) or a single object, either a condition `{"field","op","value"}` or a
|
|
428
|
+
group `{"and": [...]}` / `{"or": [...]}` whose items are conditions or groups. With
|
|
429
|
+
groups the API allows up to 3 nested levels and 50 conditions. The `id` field accepts
|
|
430
|
+
`eq`, `neq` and `in` with record UUIDs, inside or outside groups.
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
zinkee --json records query deals \
|
|
434
|
+
--where-json '{"or":[{"and":[{"field":"status","op":"eq","value":"OPEN"},{"field":"amount","op":"gt","value":10000}]},{"field":"close-date","op":"between","value":["2026-10-01","2026-10-31"]}]}'
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
`--where-json` cannot be combined with `--where`; either of them replaces the `where`
|
|
438
|
+
of `--raw`/`--raw-file`. A `--raw` payload in the native shape (`op`, groups,
|
|
439
|
+
`{"field","direction"}` sort entries, `page`) is sent as is. See
|
|
440
|
+
`zinkee --json --example records query` for more payloads.
|
|
441
|
+
|
|
410
442
|
---
|
|
411
443
|
|
|
412
444
|
## Files
|
|
@@ -919,7 +951,7 @@ zinkee --json automations connections list
|
|
|
919
951
|
|
|
920
952
|
## Document templates
|
|
921
953
|
|
|
922
|
-
Document templates group reusable files
|
|
954
|
+
Document templates group reusable asset files. The `generate_document` automation action renders a template to PDF against the triggering record: the template needs an `index.html` asset with Pebble expressions, and its other assets (stylesheets, images, …) are files that page references. Template names must be unique within the workspace; the `<template>` argument accepts a UUID or an exact name. The `<asset>` argument requires a UUID.
|
|
923
955
|
|
|
924
956
|
### Typical lifecycle
|
|
925
957
|
|
|
@@ -929,11 +961,11 @@ Document templates group reusable files (e.g. Word/Excel masters) that automatio
|
|
|
929
961
|
zinkee --json document-templates create --name "Quarterly report"
|
|
930
962
|
```
|
|
931
963
|
|
|
932
|
-
2. Upload one or more asset files
|
|
964
|
+
2. Upload one or more asset files. The asset name defaults to the local file name; `--name` overrides it and is the relative path `index.html` uses to reference the asset
|
|
933
965
|
|
|
934
966
|
```bash
|
|
935
|
-
zinkee --json document-templates assets add "Quarterly report" ./
|
|
936
|
-
zinkee --json document-templates assets add "Quarterly report" ./
|
|
967
|
+
zinkee --json document-templates assets add "Quarterly report" ./index.html
|
|
968
|
+
zinkee --json document-templates assets add "Quarterly report" ./styles.css --name css/styles.css
|
|
937
969
|
```
|
|
938
970
|
|
|
939
971
|
3. List and inspect
|
|
@@ -956,10 +988,44 @@ zinkee --json document-templates delete <template-uuid>
|
|
|
956
988
|
`download` streams raw bytes — use `--output` to write to disk (required when combined with `--json`):
|
|
957
989
|
|
|
958
990
|
```bash
|
|
959
|
-
zinkee --json document-templates assets download <template-uuid> <asset-uuid> --output ./
|
|
960
|
-
zinkee document-templates assets download <template-uuid> <asset-uuid> >
|
|
991
|
+
zinkee --json document-templates assets download <template-uuid> <asset-uuid> --output ./index.html
|
|
992
|
+
zinkee document-templates assets download <template-uuid> <asset-uuid> > index.html
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
### Writing `index.html` for `generate_document`
|
|
996
|
+
|
|
997
|
+
The action renders `index.html` with Pebble, converts it to PDF and stores the PDF in the action's target file field. Expressions outside a loop start at a root:
|
|
998
|
+
|
|
999
|
+
- `record` (recommended): reserved alias for the record that triggers the automation, whatever the slug of its schema. It is the only option when that slug contains a hyphen or starts with a digit.
|
|
1000
|
+
- The source schema slug, still accepted when it is an identifier (letters, digits and `_`, not starting with a digit): `{{ budgets['budget-name'] }}`.
|
|
1001
|
+
|
|
1002
|
+
A template uses one root or the other: mixing `record[...]` and the slug fails with `unsupported_document_template_expression`.
|
|
1003
|
+
|
|
1004
|
+
```html
|
|
1005
|
+
<link rel="stylesheet" href="css/styles.css"/>
|
|
1006
|
+
<h1>Invoice {{ record['invoice-id'] }}</h1>
|
|
1007
|
+
{% for d in record['vf-drafts'] %}
|
|
1008
|
+
{% for l in d['vf-invoice-items'] %}
|
|
1009
|
+
<p>{{ l['description'] }}</p>
|
|
1010
|
+
{% endfor %}
|
|
1011
|
+
{% endfor %}
|
|
1012
|
+
{% for photo in record['photos'] %}<img src="{{ photo.src }}" alt="{{ photo.name }}"/>{% endfor %}
|
|
961
1013
|
```
|
|
962
1014
|
|
|
1015
|
+
- Paths use `.slug` or `['slug']`. Field and child schema slugs that are not identifiers, such as those with a hyphen, always need brackets and single quotes: `x['field-slug']`.
|
|
1016
|
+
- Filters after `|` are allowed. The only tags are `{% for x in … %}` / `{% endfor %}` and `{% if %}` / `{% elseif %}` / `{% else %}` / `{% endif %}`; function calls and any other tag fail with `unsupported_document_template_expression`.
|
|
1017
|
+
- `{% for %}` over a related schema slug yields its records in either direction: those referencing the current record, or the one its reference field points to (zero or one row). Two reference fields from the current schema to that schema are ambiguous and fail. Rows are ordered by the child's numeric `order` field, when it has one, then by creation time.
|
|
1018
|
+
- `{% for %}` over a file field (`photos` above) yields one row per PNG, JPEG, GIF or BMP image, with `src` (the path for `<img src>`), `name` and `type`; other file types are skipped.
|
|
1019
|
+
- Values arrive already formatted with the workspace timezone and language.
|
|
1020
|
+
- Avoid `{% for record in … %}`: the loop variable hides the root until its `endfor`.
|
|
1021
|
+
- A root with a hyphen fails with `unsupported_document_template_expression`, and the error suggests the expression rooted at `record` (`vf-invoices['invoice-id']` → `record['invoice-id']`).
|
|
1022
|
+
|
|
1023
|
+
Assets:
|
|
1024
|
+
|
|
1025
|
+
- An asset named exactly `index.html` is required (`document_generation_index_html_missing`). Names starting with `record-files/` are reserved for record images.
|
|
1026
|
+
- `<link href>` and `<img src>` must be relative paths of template assets (or a file field row's `src`); absolute or external URLs are rejected.
|
|
1027
|
+
- Inline CSS (`<style>` or `style="…"`) is rejected: move styles to `.css` assets linked from `index.html`. Stylesheets cannot use `@import`, and their `url(…)` must point to template assets.
|
|
1028
|
+
|
|
963
1029
|
### Notes
|
|
964
1030
|
|
|
965
1031
|
- `get` is a client-side helper: the backend has no get-one endpoint, so the CLI filters the list response. Use `list` if you want everything in one call.
|
|
@@ -669,6 +669,43 @@ var specificExamples = {
|
|
|
669
669
|
{ "field": "contact-name", "direction": "ASC" }
|
|
670
670
|
],
|
|
671
671
|
"page": { "offset": 0, "limit": 25 }
|
|
672
|
+
}`
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
description: "OR between different fields with a nested AND group. --where-json takes the native where: an array of conditions (AND) or a single condition/group object.",
|
|
676
|
+
command: `zinkee --json records query deals --select id,deal-name,status,amount,close-date --where-json '{"or":[{"and":[{"field":"status","op":"eq","value":"OPEN"},{"field":"amount","op":"gt","value":10000}]},{"field":"close-date","op":"between","value":["2026-10-01","2026-10-31"]}]}' --sort amount:desc --limit 25`,
|
|
677
|
+
raw: `{
|
|
678
|
+
"select": ["id", "deal-name", "status", "amount", "close-date"],
|
|
679
|
+
"where": {
|
|
680
|
+
"or": [
|
|
681
|
+
{
|
|
682
|
+
"and": [
|
|
683
|
+
{ "field": "status", "op": "eq", "value": "OPEN" },
|
|
684
|
+
{ "field": "amount", "op": "gt", "value": 10000 }
|
|
685
|
+
]
|
|
686
|
+
},
|
|
687
|
+
{ "field": "close-date", "op": "between", "value": ["2026-10-01", "2026-10-31"] }
|
|
688
|
+
]
|
|
689
|
+
},
|
|
690
|
+
"sort": [
|
|
691
|
+
{ "field": "amount", "direction": "DESC" }
|
|
692
|
+
],
|
|
693
|
+
"page": { "offset": 0, "limit": 25 }
|
|
694
|
+
}`
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
description: "Array of conditions (implicit AND) with an OR group that mixes id in and not_contains, sent as a raw payload.",
|
|
698
|
+
command: `zinkee --json records query deals --raw '{"where":[{"field":"status","op":"neq","value":"LOST"},{"or":[{"field":"id","op":"in","value":["550e8400-e29b-41d4-a716-446655440000","6fa459ea-ee8a-3ca4-894e-db77e160355e"]},{"field":"deal-name","op":"not_contains","value":"test"}]}]}'`,
|
|
699
|
+
raw: `{
|
|
700
|
+
"where": [
|
|
701
|
+
{ "field": "status", "op": "neq", "value": "LOST" },
|
|
702
|
+
{
|
|
703
|
+
"or": [
|
|
704
|
+
{ "field": "id", "op": "in", "value": ["550e8400-e29b-41d4-a716-446655440000", "6fa459ea-ee8a-3ca4-894e-db77e160355e"] },
|
|
705
|
+
{ "field": "deal-name", "op": "not_contains", "value": "test" }
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
]
|
|
672
709
|
}`
|
|
673
710
|
},
|
|
674
711
|
{
|
|
@@ -692,6 +729,24 @@ var specificExamples = {
|
|
|
692
729
|
{ "field": "contact-name", "op": "contains", "value": "Lovelace" }
|
|
693
730
|
],
|
|
694
731
|
"page": { "offset": 0, "limit": 50 }
|
|
732
|
+
}`
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
description: "Text does not contain search.",
|
|
736
|
+
command: 'zinkee --json records query contacts --where "contact-name not_contains test"',
|
|
737
|
+
raw: `{
|
|
738
|
+
"where": [
|
|
739
|
+
{ "field": "contact-name", "op": "not_contains", "value": "test" }
|
|
740
|
+
]
|
|
741
|
+
}`
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
description: "Records whose due-date is between two dates (both included).",
|
|
745
|
+
command: 'zinkee --json records query contacts --where "due-date between 2026-10-01,2026-10-31"',
|
|
746
|
+
raw: `{
|
|
747
|
+
"where": [
|
|
748
|
+
{ "field": "due-date", "op": "between", "value": ["2026-10-01", "2026-10-31"] }
|
|
749
|
+
]
|
|
695
750
|
}`
|
|
696
751
|
},
|
|
697
752
|
{
|
|
@@ -1481,8 +1536,8 @@ var specificExamples = {
|
|
|
1481
1536
|
}`
|
|
1482
1537
|
},
|
|
1483
1538
|
{
|
|
1484
|
-
description: "Create a TABLE widget with locked fields: contact-name locked permanently (no conditions) and status locked while invoice-number is empty, with before/after lock messages.",
|
|
1485
|
-
command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type table --name Invoices --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field contact-name --field invoice-number --field status --field amount --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-message-before "status:Status locks
|
|
1539
|
+
description: "Create a TABLE widget with locked fields: contact-name locked permanently (no conditions) and status locked while invoice-number or amount is empty (--lock-match any), with before/after lock messages.",
|
|
1540
|
+
command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type table --name Invoices --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":12,"h":8}' --field contact-name --field invoice-number --field status --field amount --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-condition "status:amount:is_empty" --lock-match "status:any" --lock-message-before "status:Status locks while the invoice number or the amount is missing." --lock-message-after "status:Fill in the invoice number and the amount to change the status."`,
|
|
1486
1541
|
raw: `{
|
|
1487
1542
|
"type": "TABLE_OR_SUBTABLE",
|
|
1488
1543
|
"source": {
|
|
@@ -1509,10 +1564,16 @@ var specificExamples = {
|
|
|
1509
1564
|
"origin": { "fieldId": "invoice-number" },
|
|
1510
1565
|
"comparisonOperator": "IS_EMPTY",
|
|
1511
1566
|
"values": []
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
"origin": { "fieldId": "amount" },
|
|
1570
|
+
"comparisonOperator": "IS_EMPTY",
|
|
1571
|
+
"values": []
|
|
1512
1572
|
}
|
|
1513
1573
|
],
|
|
1514
|
-
"
|
|
1515
|
-
"
|
|
1574
|
+
"conditionMatch": "ANY",
|
|
1575
|
+
"messageBeforeLock": "Status locks while the invoice number or the amount is missing.",
|
|
1576
|
+
"messageAfterLock": "Fill in the invoice number and the amount to change the status."
|
|
1516
1577
|
}
|
|
1517
1578
|
]
|
|
1518
1579
|
}
|
|
@@ -1904,8 +1965,8 @@ var specificExamples = {
|
|
|
1904
1965
|
}`
|
|
1905
1966
|
},
|
|
1906
1967
|
{
|
|
1907
|
-
description: "Configure locked fields (replaces the stored configuration): contact-name locked permanently, status locked while invoice-number is empty. Empty conditions = always locked; conditions combine with AND. Enforcement happens in display widgets only, never in the database view.",
|
|
1908
|
-
command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-message-before "status:Status locks
|
|
1968
|
+
description: "Configure locked fields (replaces the stored configuration): contact-name locked permanently, status locked while invoice-number or amount is empty. Empty conditions = always locked; conditions combine with AND unless --lock-match <field>:any locks as soon as one matches. Enforcement happens in display widgets only, never in the database view.",
|
|
1969
|
+
command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 11111111-1111-4111-a111-111111111111 --lock-field contact-name --lock-condition "status:invoice-number:is_empty" --lock-condition "status:amount:is_empty" --lock-match "status:any" --lock-message-before "status:Status locks while the invoice number or the amount is missing." --lock-message-after "status:Fill in the invoice number and the amount to change the status."`,
|
|
1909
1970
|
raw: `{
|
|
1910
1971
|
"behavior": {
|
|
1911
1972
|
"lockedFields": [
|
|
@@ -1920,10 +1981,16 @@ var specificExamples = {
|
|
|
1920
1981
|
"origin": { "fieldId": "invoice-number" },
|
|
1921
1982
|
"comparisonOperator": "IS_EMPTY",
|
|
1922
1983
|
"values": []
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
"origin": { "fieldId": "amount" },
|
|
1987
|
+
"comparisonOperator": "IS_EMPTY",
|
|
1988
|
+
"values": []
|
|
1923
1989
|
}
|
|
1924
1990
|
],
|
|
1925
|
-
"
|
|
1926
|
-
"
|
|
1991
|
+
"conditionMatch": "ANY",
|
|
1992
|
+
"messageBeforeLock": "Status locks while the invoice number or the amount is missing.",
|
|
1993
|
+
"messageAfterLock": "Fill in the invoice number and the amount to change the status."
|
|
1927
1994
|
}
|
|
1928
1995
|
]
|
|
1929
1996
|
}
|
|
@@ -4470,4 +4537,4 @@ function withResponseEnvelope(example, commandName) {
|
|
|
4470
4537
|
export {
|
|
4471
4538
|
getCommandExamples
|
|
4472
4539
|
};
|
|
4473
|
-
//# sourceMappingURL=examples-
|
|
4540
|
+
//# sourceMappingURL=examples-ELI5SKQH.js.map
|