zinkee 0.1.70 → 0.1.72
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
|
@@ -19,6 +19,7 @@ Implemented command groups:
|
|
|
19
19
|
- `displays`
|
|
20
20
|
- `automations`
|
|
21
21
|
- `document-templates`
|
|
22
|
+
- `forms`
|
|
22
23
|
- `formulas`
|
|
23
24
|
|
|
24
25
|
## Requirements
|
|
@@ -1164,6 +1165,62 @@ zinkee --json automations connections list
|
|
|
1164
1165
|
|
|
1165
1166
|
---
|
|
1166
1167
|
|
|
1168
|
+
## Forms
|
|
1169
|
+
|
|
1170
|
+
A form is a view of a table through which people add records, or update one, from
|
|
1171
|
+
Zinkee or, without an account, from its public link (`https://z2.zinkee.com/f/<token>`,
|
|
1172
|
+
also as a QR code). Forms may be enabled only for some workspaces or people: when
|
|
1173
|
+
they are not for your credential, every command fails with `forms_not_enabled`.
|
|
1174
|
+
Reading forms needs access to the workspace; creating, changing and deleting them,
|
|
1175
|
+
and managing their link, needs a workspace administrator. Address the table by slug
|
|
1176
|
+
or UUID, the form by id or exact name, and fields by slug or UUID. Submitting a form
|
|
1177
|
+
is not part of the CLI: create or update records with `records`.
|
|
1178
|
+
|
|
1179
|
+
```bash
|
|
1180
|
+
# Every field a form can hold (member fields aside), as the web creates it
|
|
1181
|
+
zinkee --json forms create expenses --name "Expense claim"
|
|
1182
|
+
|
|
1183
|
+
# Fields in order, with their settings
|
|
1184
|
+
zinkee --json forms create incidents --name "Incident report" \
|
|
1185
|
+
--field summary --field site --field priority --field reported_at \
|
|
1186
|
+
--required summary --label "summary=What happened?" \
|
|
1187
|
+
--remember site --url-param site=site --default priority=Medium \
|
|
1188
|
+
--default-submitted-at reported_at \
|
|
1189
|
+
--location optional --location-field location
|
|
1190
|
+
|
|
1191
|
+
zinkee --json forms list incidents
|
|
1192
|
+
zinkee --json forms get incidents "Incident report"
|
|
1193
|
+
|
|
1194
|
+
# Update the open entry of whoever sends it instead of creating a record
|
|
1195
|
+
zinkee --json forms update time_entries "Clock out" --mode update \
|
|
1196
|
+
--match employee --match clock_out:empty --not-found-message "There is no open entry for you today."
|
|
1197
|
+
|
|
1198
|
+
# Public link: on with a password, new URL, off
|
|
1199
|
+
zinkee --json forms link set incidents "Incident report" --active --password site-2026
|
|
1200
|
+
zinkee --json forms link set incidents "Incident report" --regenerate
|
|
1201
|
+
zinkee --json forms link set incidents "Incident report" --inactive
|
|
1202
|
+
zinkee --json forms link get incidents "Incident report"
|
|
1203
|
+
|
|
1204
|
+
zinkee --json forms delete incidents "Incident report"
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
- `forms update` changes only what its options name. `--field` (repeated) gives the new
|
|
1208
|
+
order and keeps each field's settings; `--add-field`/`--remove-field` add or take one
|
|
1209
|
+
out; `--match` replaces the conditions. The CLI reads the form and sends whole blocks.
|
|
1210
|
+
- Field settings: `--required`/`--not-required`, `--hidden`/`--visible`, `--label` and
|
|
1211
|
+
`--hint` (`slug=text`, `slug=` clears), `--default slug=value` (an option by name),
|
|
1212
|
+
`--default-today slug[=days]`, `--default-submitted-at` and `--default-current-member`
|
|
1213
|
+
(both hide the field), `--clear-default`, `--remember`/`--forget`,
|
|
1214
|
+
`--url-param slug[=name]`/`--clear-url-param`.
|
|
1215
|
+
- `--match` specs: `slug` (holds what the submission gives to that field of the form),
|
|
1216
|
+
`slug=value`, `slug:empty`, `slug:not-empty`. `--when-multiple latest|error`,
|
|
1217
|
+
`--when-none error|create`.
|
|
1218
|
+
- `--raw`/`--raw-file` take the API body; options override its keys.
|
|
1219
|
+
- The link password is never returned; share it apart from the link.
|
|
1220
|
+
- Use `--json --example forms <subcommand>` for more examples.
|
|
1221
|
+
|
|
1222
|
+
---
|
|
1223
|
+
|
|
1167
1224
|
## Document templates
|
|
1168
1225
|
|
|
1169
1226
|
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.
|
|
@@ -4705,6 +4705,197 @@ var specificExamples = {
|
|
|
4705
4705
|
}`
|
|
4706
4706
|
}
|
|
4707
4707
|
],
|
|
4708
|
+
"forms list": [
|
|
4709
|
+
{
|
|
4710
|
+
description: "List the forms of a table (by slug or UUID) with their whole configuration. Fields come by slug, with their UUID in fieldId. link is null for a member who is not an administrator. The table output shows id, name, mode, number of fields and the public link.",
|
|
4711
|
+
command: "zinkee --json forms list incidents",
|
|
4712
|
+
response: `[
|
|
4713
|
+
{
|
|
4714
|
+
"id": "8d0c6f4e-2b1a-4c3d-9e8f-7a6b5c4d3e2f",
|
|
4715
|
+
"name": "Incident report",
|
|
4716
|
+
"schemaId": "5f2a1b3c-4d5e-6f70-8192-a3b4c5d6e7f8",
|
|
4717
|
+
"title": "Report an incident",
|
|
4718
|
+
"description": "Tell us what happened and where.",
|
|
4719
|
+
"submitLabel": "Send report",
|
|
4720
|
+
"successMessage": "Thanks, we are on it.",
|
|
4721
|
+
"mode": "create",
|
|
4722
|
+
"fields": [
|
|
4723
|
+
{"field": "summary", "fieldId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "label": "What happened?", "help": null, "required": true, "hidden": false, "defaultValue": null, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4724
|
+
{"field": "site", "fieldId": "1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": null, "rememberOnDevice": true, "allowUrlPrefill": true, "urlParam": "site"},
|
|
4725
|
+
{"field": "priority", "fieldId": "2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": {"kind": "value", "value": 2}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4726
|
+
{"field": "reported_at", "fieldId": "3d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a", "label": null, "help": null, "required": false, "hidden": true, "defaultValue": {"kind": "submittedAt"}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null}
|
|
4727
|
+
],
|
|
4728
|
+
"location": {"mode": "optional", "field": "location", "fieldId": "4e5f6a7b-8c9d-4e0f-8a1b-3c4d5e6f7a8b"},
|
|
4729
|
+
"update": null,
|
|
4730
|
+
"link": {"exists": true, "active": true, "hasPassword": true, "token": "3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "url": "https://z2.zinkee.com/f/3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "updatedAt": "2026-11-19T09:30:00Z"}
|
|
4731
|
+
}
|
|
4732
|
+
]`
|
|
4733
|
+
}
|
|
4734
|
+
],
|
|
4735
|
+
"forms get": [
|
|
4736
|
+
{
|
|
4737
|
+
description: "Get one form by id or exact name: title, texts, fields in order with their settings, location, update mode and public link.",
|
|
4738
|
+
command: 'zinkee --json forms get incidents "Incident report"',
|
|
4739
|
+
response: `{
|
|
4740
|
+
"id": "8d0c6f4e-2b1a-4c3d-9e8f-7a6b5c4d3e2f",
|
|
4741
|
+
"name": "Incident report",
|
|
4742
|
+
"schemaId": "5f2a1b3c-4d5e-6f70-8192-a3b4c5d6e7f8",
|
|
4743
|
+
"title": "Report an incident",
|
|
4744
|
+
"description": "Tell us what happened and where.",
|
|
4745
|
+
"submitLabel": "Send report",
|
|
4746
|
+
"successMessage": "Thanks, we are on it.",
|
|
4747
|
+
"mode": "create",
|
|
4748
|
+
"fields": [
|
|
4749
|
+
{"field": "summary", "fieldId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "label": "What happened?", "help": null, "required": true, "hidden": false, "defaultValue": null, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4750
|
+
{"field": "site", "fieldId": "1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": null, "rememberOnDevice": true, "allowUrlPrefill": true, "urlParam": "site"},
|
|
4751
|
+
{"field": "priority", "fieldId": "2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": {"kind": "value", "value": 2}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4752
|
+
{"field": "reported_at", "fieldId": "3d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a", "label": null, "help": null, "required": false, "hidden": true, "defaultValue": {"kind": "submittedAt"}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null}
|
|
4753
|
+
],
|
|
4754
|
+
"location": {"mode": "optional", "field": "location", "fieldId": "4e5f6a7b-8c9d-4e0f-8a1b-3c4d5e6f7a8b"},
|
|
4755
|
+
"update": null,
|
|
4756
|
+
"link": {"exists": true, "active": true, "hasPassword": true, "token": "3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "url": "https://z2.zinkee.com/f/3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "updatedAt": "2026-11-19T09:30:00Z"}
|
|
4757
|
+
}`
|
|
4758
|
+
}
|
|
4759
|
+
],
|
|
4760
|
+
"forms create": [
|
|
4761
|
+
{
|
|
4762
|
+
description: "Create an incident report: fields in order, one required with its own label, a remembered site that can also come in the link (?site=...), a default option given by name and a hidden date with the instant it is received; it asks for the location, optional, into a text field.",
|
|
4763
|
+
command: 'zinkee --json forms create incidents --name "Incident report" --title "Report an incident" --description "Tell us what happened and where." --submit-label "Send report" --success-message "Thanks, we are on it." --field summary --field site --field priority --field reported_at --required summary --label "summary=What happened?" --remember site --url-param site=site --default priority=Medium --default-submitted-at reported_at --location optional --location-field location',
|
|
4764
|
+
raw: `{
|
|
4765
|
+
"name": "Incident report",
|
|
4766
|
+
"title": "Report an incident",
|
|
4767
|
+
"description": "Tell us what happened and where.",
|
|
4768
|
+
"submitLabel": "Send report",
|
|
4769
|
+
"successMessage": "Thanks, we are on it.",
|
|
4770
|
+
"fields": [
|
|
4771
|
+
{"field": "summary", "required": true, "label": "What happened?"},
|
|
4772
|
+
{"field": "site", "rememberOnDevice": true, "allowUrlPrefill": true, "urlParam": "site"},
|
|
4773
|
+
{"field": "priority", "defaultValue": {"kind": "value", "value": "Medium"}},
|
|
4774
|
+
{"field": "reported_at", "hidden": true, "defaultValue": {"kind": "submittedAt"}}
|
|
4775
|
+
],
|
|
4776
|
+
"location": {"mode": "optional", "field": "location"}
|
|
4777
|
+
}`,
|
|
4778
|
+
response: `{
|
|
4779
|
+
"id": "8d0c6f4e-2b1a-4c3d-9e8f-7a6b5c4d3e2f",
|
|
4780
|
+
"name": "Incident report",
|
|
4781
|
+
"schemaId": "5f2a1b3c-4d5e-6f70-8192-a3b4c5d6e7f8",
|
|
4782
|
+
"title": "Report an incident",
|
|
4783
|
+
"description": "Tell us what happened and where.",
|
|
4784
|
+
"submitLabel": "Send report",
|
|
4785
|
+
"successMessage": "Thanks, we are on it.",
|
|
4786
|
+
"mode": "create",
|
|
4787
|
+
"fields": [
|
|
4788
|
+
{"field": "summary", "fieldId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "label": "What happened?", "help": null, "required": true, "hidden": false, "defaultValue": null, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4789
|
+
{"field": "site", "fieldId": "1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": null, "rememberOnDevice": true, "allowUrlPrefill": true, "urlParam": "site"},
|
|
4790
|
+
{"field": "priority", "fieldId": "2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f", "label": null, "help": null, "required": false, "hidden": false, "defaultValue": {"kind": "value", "value": 2}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null},
|
|
4791
|
+
{"field": "reported_at", "fieldId": "3d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a", "label": null, "help": null, "required": false, "hidden": true, "defaultValue": {"kind": "submittedAt"}, "rememberOnDevice": false, "allowUrlPrefill": false, "urlParam": null}
|
|
4792
|
+
],
|
|
4793
|
+
"location": {"mode": "optional", "field": "location", "fieldId": "4e5f6a7b-8c9d-4e0f-8a1b-3c4d5e6f7a8b"},
|
|
4794
|
+
"update": null,
|
|
4795
|
+
"link": {"exists": true, "active": true, "hasPassword": true, "token": "3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "url": "https://z2.zinkee.com/f/3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY", "updatedAt": "2026-11-19T09:30:00Z"}
|
|
4796
|
+
}`
|
|
4797
|
+
},
|
|
4798
|
+
{
|
|
4799
|
+
description: "Create a form with every field a form can hold (member fields aside), required where the table requires them, as the web does; change it afterwards with forms update.",
|
|
4800
|
+
command: 'zinkee --json forms create expenses --name "Expense claim"',
|
|
4801
|
+
raw: `{
|
|
4802
|
+
"name": "Expense claim"
|
|
4803
|
+
}`
|
|
4804
|
+
},
|
|
4805
|
+
{
|
|
4806
|
+
description: "A daily work report signed by whoever sends it: a hidden member field with the current member (only for people with a Zinkee session, never through the public link) and today's date by default.",
|
|
4807
|
+
command: 'zinkee --json forms create work_reports --name "Daily work report" --field date --field hours --field notes --field worker --default-today date --default-current-member worker --required hours'
|
|
4808
|
+
},
|
|
4809
|
+
{
|
|
4810
|
+
description: "The whole configuration from a file (the API body); options given too override its keys.",
|
|
4811
|
+
command: "zinkee --json forms create incidents --raw-file ./incident-form.json"
|
|
4812
|
+
}
|
|
4813
|
+
],
|
|
4814
|
+
"forms update": [
|
|
4815
|
+
{
|
|
4816
|
+
description: "Turn a clock-in form into the clock-out one: each submission updates the open entry of the member who sends it (same employee, clock_out still empty); with none it refuses with a message, with several it takes the latest. --match replaces the conditions; fields and the rest are kept.",
|
|
4817
|
+
command: 'zinkee --json forms update time_entries "Clock out" --mode update --match employee --match clock_out:empty --when-multiple latest --when-none error --not-found-message "There is no open entry for you today."',
|
|
4818
|
+
raw: `{
|
|
4819
|
+
"mode": "update",
|
|
4820
|
+
"update": {
|
|
4821
|
+
"conditions": [
|
|
4822
|
+
{"field": "employee", "op": "equalsSubmitted"},
|
|
4823
|
+
{"field": "clock_out", "op": "isEmpty"}
|
|
4824
|
+
],
|
|
4825
|
+
"whenMultiple": "latest",
|
|
4826
|
+
"whenNone": "error",
|
|
4827
|
+
"noMatchMessage": "There is no open entry for you today."
|
|
4828
|
+
}
|
|
4829
|
+
}`
|
|
4830
|
+
},
|
|
4831
|
+
{
|
|
4832
|
+
description: "Reorder the fields (each keeps its settings), add one at the end, hide it with the submission time and drop the description. The CLI reads the form and sends the whole field list.",
|
|
4833
|
+
command: 'zinkee --json forms update incidents "Incident report" --field priority --field summary --field site --add-field received_at --default-submitted-at received_at --clear-description'
|
|
4834
|
+
},
|
|
4835
|
+
{
|
|
4836
|
+
description: "Match a fixed value: update the record whose status is the option Open.",
|
|
4837
|
+
command: 'zinkee --json forms update tickets "Close ticket" --mode update --match ticket_number --match status=Open'
|
|
4838
|
+
},
|
|
4839
|
+
{
|
|
4840
|
+
description: "Back to creating a record per submission; the conditions are kept to switch back.",
|
|
4841
|
+
command: 'zinkee --json forms update time_entries "Clock out" --mode create'
|
|
4842
|
+
}
|
|
4843
|
+
],
|
|
4844
|
+
"forms delete": [
|
|
4845
|
+
{
|
|
4846
|
+
description: "Delete a form. Its public link stops working at once; the records it created stay in the table.",
|
|
4847
|
+
command: 'zinkee --json forms delete incidents "Incident report"',
|
|
4848
|
+
response: `{
|
|
4849
|
+
"id": "8d0c6f4e-2b1a-4c3d-9e8f-7a6b5c4d3e2f",
|
|
4850
|
+
"deleted": true
|
|
4851
|
+
}`
|
|
4852
|
+
}
|
|
4853
|
+
],
|
|
4854
|
+
"forms link get": [
|
|
4855
|
+
{
|
|
4856
|
+
description: "Show the public link: whether it exists and is on, its URL (while on) and whether it asks for a password. The password is never returned.",
|
|
4857
|
+
command: 'zinkee --json forms link get incidents "Incident report"',
|
|
4858
|
+
response: `{
|
|
4859
|
+
"exists": true,
|
|
4860
|
+
"active": true,
|
|
4861
|
+
"hasPassword": true,
|
|
4862
|
+
"token": "3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY",
|
|
4863
|
+
"url": "https://z2.zinkee.com/f/3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY",
|
|
4864
|
+
"updatedAt": "2026-11-19T09:30:00Z"
|
|
4865
|
+
}`
|
|
4866
|
+
}
|
|
4867
|
+
],
|
|
4868
|
+
"forms link set": [
|
|
4869
|
+
{
|
|
4870
|
+
description: "Switch the public link on with a password: anyone with the URL (or its QR code) and the password can fill the form in without an account.",
|
|
4871
|
+
command: 'zinkee --json forms link set incidents "Incident report" --active --password site-2026',
|
|
4872
|
+
raw: `{
|
|
4873
|
+
"active": true,
|
|
4874
|
+
"password": "site-2026"
|
|
4875
|
+
}`,
|
|
4876
|
+
response: `{
|
|
4877
|
+
"exists": true,
|
|
4878
|
+
"active": true,
|
|
4879
|
+
"hasPassword": true,
|
|
4880
|
+
"token": "3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY",
|
|
4881
|
+
"url": "https://z2.zinkee.com/f/3q2-7wJmZ0kXcQ1nV6sT9yBfLrHdEaPuGiOjNtKvWxY",
|
|
4882
|
+
"updatedAt": "2026-11-19T09:30:00Z"
|
|
4883
|
+
}`
|
|
4884
|
+
},
|
|
4885
|
+
{
|
|
4886
|
+
description: "Give it a new URL (the old one stops working) and remove the password; the link keeps its state.",
|
|
4887
|
+
command: 'zinkee --json forms link set incidents "Incident report" --regenerate --clear-password',
|
|
4888
|
+
raw: `{
|
|
4889
|
+
"active": true,
|
|
4890
|
+
"password": null,
|
|
4891
|
+
"regenerate": true
|
|
4892
|
+
}`
|
|
4893
|
+
},
|
|
4894
|
+
{
|
|
4895
|
+
description: "Switch it off: nobody can send it until it is switched on again (same URL).",
|
|
4896
|
+
command: 'zinkee --json forms link set incidents "Incident report" --inactive'
|
|
4897
|
+
}
|
|
4898
|
+
],
|
|
4708
4899
|
"document-templates list": [
|
|
4709
4900
|
{
|
|
4710
4901
|
description: "List every document template in the workspace. Each asset's link is a relative path to the asset download endpoint, ready to call without composition. fileNamePattern is the generated file name of the template, or null when generated PDFs are named after the template. The table output shows it as a column.",
|
|
@@ -4975,4 +5166,4 @@ function withResponseEnvelope({ responseMeta, ...example }, commandName) {
|
|
|
4975
5166
|
export {
|
|
4976
5167
|
getCommandExamples
|
|
4977
5168
|
};
|
|
4978
|
-
//# sourceMappingURL=examples-
|
|
5169
|
+
//# sourceMappingURL=examples-FIA4FRWM.js.map
|