@beehexa/hexasync-ai-toolkit 2611.8.3 → 2611.14.1
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/mcp.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/gemini-extension.json +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/skills/hexasync-connections/SKILL.md +17 -7
- package/skills/hexasync-connections/references/INDEX.md +18 -0
- package/skills/hexasync-connections/references/INSTALL.md +7 -7
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.expressions-and-tooling.md +35 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.fail.md +48 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.frontend-step-fields.md +83 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.grouped-readiness-flows.md +54 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.md +16 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.preview-and-source-navigation.md +26 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.publish_event.md +44 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.records_form.file-import-path.md +208 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.records_form.md +42 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md +208 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.rejected-forms-non-copyable.md +23 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.return.md +84 -0
- package/skills/hexasync-connections/references/frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md +92 -0
- package/skills/hexasync-error-handling/SKILL.md +5 -5
- package/skills/hexasync-error-handling/references/INSTALL.md +7 -7
- package/skills/hexasync-expressions/SKILL.md +6 -5
- package/skills/hexasync-expressions/references/INDEX.md +6 -1
- package/skills/hexasync-expressions/references/INSTALL.md +7 -7
- package/skills/hexasync-expressions/references/expressions.CONTEXT-AND-IO.runtime-scope.md +3 -3
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.expressions-and-tooling.md +10 -4
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.fail.md +48 -0
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.frontend-step-fields.md +4 -4
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.grouped-readiness-flows.md +3 -3
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.md +6 -4
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.preview-and-source-navigation.md +12 -2
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.publish_event.md +4 -2
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.records_form.file-import-path.md +208 -0
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.records_form.md +11 -200
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md +208 -0
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.return.md +2 -2
- package/skills/hexasync-expressions/references/frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md +92 -0
- package/skills/hexasync-field-mapping/SKILL.md +5 -5
- package/skills/hexasync-field-mapping/references/INSTALL.md +7 -7
- package/skills/hexasync-metrics-reports/SKILL.md +5 -5
- package/skills/hexasync-metrics-reports/references/INSTALL.md +7 -7
- package/skills/hexasync-pullers/SKILL.md +5 -5
- package/skills/hexasync-pullers/references/INSTALL.md +7 -7
- package/skills/hexasync-pushers/SKILL.md +5 -5
- package/skills/hexasync-pushers/references/INSTALL.md +7 -7
- package/skills/hexasync-pushers/references/steps.UPDATE_ITEM_SYNC_PROCESS.md +35 -8
- package/skills/hexasync-query-dsl/SKILL.md +5 -5
- package/skills/hexasync-query-dsl/references/INDEX.md +1 -1
- package/skills/hexasync-query-dsl/references/INSTALL.md +7 -7
- package/skills/hexasync-query-dsl/references/query-dsl.QUERY-DSL.filter-dsl-language-contract.filter-request-envelope.md +16 -8
- package/skills/hexasync-query-dsl/references/query-dsl.QUERY-DSL.filter-dsl-language-contract.md +1 -1
- package/skills/hexasync-query-dsl/references/query-dsl.QUERY-DSL.the-shape.query-envelope.md +1 -1
- package/skills/hexasync-query-dsl/references/query-dsl.QUERY-DSL.troubleshooting-and-canonical-references.md +1 -1
- package/skills/hexasync-startup-tasks-scheduling/SKILL.md +5 -5
- package/skills/hexasync-startup-tasks-scheduling/references/INSTALL.md +7 -7
- package/skills/hexasync-steps-api-http/SKILL.md +7 -7
- package/skills/hexasync-steps-api-http/references/INDEX.md +6 -1
- package/skills/hexasync-steps-api-http/references/INSTALL.md +7 -7
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.expressions-and-tooling.md +10 -4
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.fail.md +48 -0
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.frontend-step-fields.md +4 -4
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.grouped-readiness-flows.md +3 -3
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.md +6 -4
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.preview-and-source-navigation.md +12 -2
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.publish_event.md +4 -2
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.records_form.file-import-path.md +208 -0
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.records_form.md +11 -200
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md +208 -0
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.return.md +2 -2
- package/skills/hexasync-steps-api-http/references/frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md +92 -0
- package/skills/hexasync-steps-api-http/references/steps.STEP-ENVELOPE.executor-selection-is-exact.md +6 -0
- package/skills/hexasync-steps-control-data/SKILL.md +9 -9
- package/skills/hexasync-steps-control-data/references/INDEX.md +6 -1
- package/skills/hexasync-steps-control-data/references/INSTALL.md +7 -7
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.expressions-and-tooling.md +10 -4
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.fail.md +48 -0
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.frontend-step-fields.md +4 -4
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.grouped-readiness-flows.md +3 -3
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.md +6 -4
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.preview-and-source-navigation.md +12 -2
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.publish_event.md +4 -2
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.records_form.file-import-path.md +208 -0
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.records_form.md +11 -200
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md +208 -0
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.return.md +2 -2
- package/skills/hexasync-steps-control-data/references/frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md +92 -0
- package/skills/hexasync-tables-tasks-objects/SKILL.md +5 -5
- package/skills/hexasync-tables-tasks-objects/references/INSTALL.md +7 -7
- package/skills/hexasync-templates/SKILL.md +9 -8
- package/skills/hexasync-templates/references/AI-INDEX.md +10 -9
- package/skills/hexasync-templates/references/INDEX.md +6 -2
- package/skills/hexasync-templates/references/INSTALL.md +7 -7
- package/skills/hexasync-templates/references/KB-INDEX.md +2 -2
- package/skills/hexasync-templates/references/PROFILE-ROOT.md +1 -2
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.frontend-steps-creationsteps-setupsteps-authorizationsteps.api--gateway_api.md +13 -2
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.frontend-steps-creationsteps-setupsteps-authorizationsteps.fail.md +76 -0
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.frontend-steps-creationsteps-setupsteps-authorizationsteps.md +2 -1
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.frontend-steps-creationsteps-setupsteps-authorizationsteps.records_form.md +7 -3
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.frontend-steps-creationsteps-setupsteps-authorizationsteps.step-envelope-fields.md +4 -4
- package/skills/hexasync-templates/references/PROFILE-ROOT.profile-root-fields-1.getreadyflows.md +1 -1
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.expressions-and-tooling.md +10 -4
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.fail.md +48 -0
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.frontend-step-fields.md +4 -4
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.grouped-readiness-flows.md +3 -3
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.md +6 -4
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.preview-and-source-navigation.md +12 -2
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.publish_event.md +4 -2
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.records_form.file-import-path.md +208 -0
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.records_form.md +11 -200
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md +208 -0
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.return.md +2 -2
- package/skills/hexasync-templates/references/frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md +92 -0
- package/skills/hexasync-transformations/SKILL.md +5 -5
- package/skills/hexasync-transformations/references/INSTALL.md +7 -7
- package/skills/hexasync-validations/SKILL.md +5 -5
- package/skills/hexasync-validations/references/INSTALL.md +7 -7
- package/skills/hexasync-webhooks/SKILL.md +5 -5
- package/skills/hexasync-webhooks/references/INSTALL.md +7 -7
- package/skills/hexasync-templates/references/PROFILE-ROOT.getreadyflows-1.md +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Part of [Frontend workflows](frontend.FRONTEND-FLOWS.md).
|
|
2
2
|
|
|
3
|
-
## PUBLISH_EVENT
|
|
3
|
+
## `PUBLISH_EVENT`
|
|
4
4
|
|
|
5
5
|
Frontend PUBLISH_EVENT performs one authenticated profiles-owned public event request. Metadata is closed: exactly `eventName` and `payload`. It cannot select URL, HTTP method, profile, producer/source, destination, connection, headers or credentials. Server authorization and a supported published binding remain runtime prerequisites; arbitrary names do not grant event authority.
|
|
6
6
|
|
|
@@ -9,6 +9,8 @@ Frontend PUBLISH_EVENT performs one authenticated profiles-owned public event re
|
|
|
9
9
|
| `eventName: PUBLIC_ACTION_REQUESTED` | Public event name after mapping. | Required string, nonempty after runtime mapping; no default. |
|
|
10
10
|
| `payload: {request: review}` | JSON-object public payload, recursively mapped. | Required object; no default. Only the selected profiles-owned event contract determines allowed payload fields. |
|
|
11
11
|
|
|
12
|
+
A grouped `PUBLISH_EVENT` step cannot set `dryRun: true` (or `"true"`): a dry run never reaches router acceptance, so the step could never succeed, and admission rejects it (`FFE-7`).
|
|
13
|
+
|
|
12
14
|
The following is a generic declaration example, not a supported live event registration or send demonstration:
|
|
13
15
|
|
|
14
16
|
```yaml
|
|
@@ -34,7 +36,7 @@ getReadyFlows:
|
|
|
34
36
|
publish_status: "{{ outputs.PUBLISH.publishStatus }}"
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
Only HTTP 202 with a valid acceptance body exposes `outputs.PUBLISH.eventId`, `.eventName`, `.publishStatus` (`router_accepted`) and `._response` through the existing API envelope. This proves router acceptance, not worker/provider execution, delivery or user receipt. Non-2xx, malformed acceptance and network uncertainty
|
|
39
|
+
Only HTTP 202 with a valid acceptance body exposes `outputs.PUBLISH.eventId`, `.eventName`, `.publishStatus` (`router_accepted`) and `._response` through the existing API envelope. This proves router acceptance, not worker/provider execution, delivery or user receipt. Non-2xx, malformed acceptance and network uncertainty fail the step and the run: unlike `API`, a failed PUBLISH_EVENT follows no `next` (plain or conditional recovery route) and exposes no invented success. Aborting before the request is sent cancels; aborting after it is sent fails with `ACTION_OUTCOME_UNKNOWN`, because the event may already be accepted. Never automatically retry a possibly accepted publication; explicit rerun can duplicate external effects.
|
|
38
40
|
|
|
39
41
|
Required support before enabling declarations: a compatible grouped frontend runtime and profile-progress service; profiles-owned public event admission with PROFILE UPDATE authorization; and an unambiguous authorized binding in the published definition plus its existing transport/consumer. The example name/payload above are placeholders for an approved public contract, not a registration. Browser metadata cannot provision any prerequisite.
|
|
40
42
|
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
> Part of [Frontend workflows](frontend.FRONTEND-FLOWS.md) › [RECORDS_FORM](frontend.FRONTEND-FLOWS.records_form.md).
|
|
2
|
+
|
|
3
|
+
### File-import path
|
|
4
|
+
|
|
5
|
+
The existing example below is the **file-import path**, retained for callers using the original full-row import contract. It is also the compatible path before the new worker.proxy capability is deployed. Its status mapping and read-back belong to that import contract; they are unnecessary on the changes route.
|
|
6
|
+
|
|
7
|
+
**Remove means disable, never delete.** Map `removes` to the target's disable representation in your import step:
|
|
8
|
+
|
|
9
|
+
- **TASK target** — send upserts with `__status: 1` and removes with `__status: 3` (Removed|Changed, enabling the apply pusher to re-evaluate an already-applied override) in ONE `POST /proxy/workers/api/tasks/<taskId>/data/import/data?r=false` call. Set `__status` explicitly on every row: a REFERENCE task imports a missing or blank status as Removed. Rows must be full because the import requires every table column and rejects unknown ones; with `allow.add`, declare every table column (readonly where users must not edit it), because added rows carry only declared columns. Loaded rows also carry system keys (`__id`, `__hashed_keys`, …) that the import does not accept, and the import takes its columns from the first row, so send one uniform key set: every non-`__` column, `__status`, and `__destination_id` only when every row carries it; drop the other `__` keys. The import also needs a change note (`notes`): the dashboard's own import asks for at least 32 characters and a super-admin account is refused below 256, so ask the user for a real reason rather than sending fixed text. Then read back with `__status not_hbw 6` (active rows only): every upserted identity must be present with the intended values and every removed identity absent, matched on every identity key; otherwise the outcome is unverified, never success, and is never resent automatically.
|
|
10
|
+
- **Never** use `r=true` (it disables every row missing from the payload), a physical delete or `…/data/statuses` (an empty item list applies to every row).
|
|
11
|
+
- **WORKER_SETTINGS target** — persist with the existing `PUT …/worker-settings/` call carrying `{values: {…}}`. Worker settings have no disable status, so keep `allow.remove` false unless your `PUT` step defines what removing a setting means.
|
|
12
|
+
|
|
13
|
+
**Quoting and limits.** Values the user types can contain an apostrophe, which would end a single-quoted `--data '…'` body and make the request unreadable. Render JSON inside such a body as `{{ value | json | replace: "'", "\\u0027" }}`: `json` makes a JSON value and the replace turns each apostrophe into the JSON escape `\u0027`. A search request returns at most its `limit` rows: size the initial read above the largest table you expect, because rows that are not loaded cannot be edited or removed, and adding an identity that exists beyond the limit overwrites that row. A read-back can only confirm as many rows as its `limit`, so a save touching more identities than that is unverified.
|
|
14
|
+
|
|
15
|
+
The following is a complete generic declaration: the tasks and tables the form edits and searches, then the flow.
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
objects:
|
|
19
|
+
- id: "**Example_Records_Task_Id**"
|
|
20
|
+
name: Example records
|
|
21
|
+
type: REFERENCE
|
|
22
|
+
priority: 1000
|
|
23
|
+
description: "!md[./tasks/example-records.md]"
|
|
24
|
+
valueTableName: __hsm_example_records
|
|
25
|
+
ignoreRemoval: true
|
|
26
|
+
ignoreChange: false
|
|
27
|
+
- id: "**Example_Catalog_Task_Id**"
|
|
28
|
+
name: Example catalog
|
|
29
|
+
type: REFERENCE
|
|
30
|
+
priority: 1000
|
|
31
|
+
description: "!md[./tasks/example-catalog.md]"
|
|
32
|
+
valueTableName: __hsm_example_catalog
|
|
33
|
+
ignoreRemoval: true
|
|
34
|
+
ignoreChange: false
|
|
35
|
+
objectAssociations:
|
|
36
|
+
"**Example_Records_Task_Id**":
|
|
37
|
+
table: { id: "**Example_Records_Table_Id**" }
|
|
38
|
+
"**Example_Catalog_Task_Id**":
|
|
39
|
+
table: { id: "**Example_Catalog_Table_Id**" }
|
|
40
|
+
tables:
|
|
41
|
+
- id: "**Example_Records_Table_Id**"
|
|
42
|
+
columns:
|
|
43
|
+
code: { name: Code }
|
|
44
|
+
name: { name: Name }
|
|
45
|
+
quantity: { name: Quantity, dataType: Numeric }
|
|
46
|
+
note: { name: Note }
|
|
47
|
+
- id: "**Example_Catalog_Table_Id**"
|
|
48
|
+
columns:
|
|
49
|
+
code: { name: Code }
|
|
50
|
+
name: { name: Name }
|
|
51
|
+
getReadyFlows:
|
|
52
|
+
- key: EDIT_RECORDS
|
|
53
|
+
title: Edit records
|
|
54
|
+
action: { label: Edit records }
|
|
55
|
+
completionVersion: "1"
|
|
56
|
+
steps:
|
|
57
|
+
- key: READ_RECORDS
|
|
58
|
+
type: API
|
|
59
|
+
root: true
|
|
60
|
+
name: Read the current records
|
|
61
|
+
metadata: |-
|
|
62
|
+
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/search' --request POST \
|
|
63
|
+
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
64
|
+
--header 'Content-Type: application/json' \
|
|
65
|
+
--data '{"fields":[],"offset":0,"limit":500,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6}]}}'
|
|
66
|
+
next: EDIT
|
|
67
|
+
- key: EDIT
|
|
68
|
+
type: RECORDS_FORM
|
|
69
|
+
name: Edit records
|
|
70
|
+
description: Add, change or remove records. Nothing is saved until you confirm.
|
|
71
|
+
metadata:
|
|
72
|
+
target: { kind: TASK, taskId: "**Example_Records_Task_Id**" }
|
|
73
|
+
identity: [code]
|
|
74
|
+
initial: "jsonata:: outputs.READ_RECORDS.items"
|
|
75
|
+
columns:
|
|
76
|
+
- { key: code, name: Code, type: TEXT, required: true, readonly: true }
|
|
77
|
+
- { key: name, name: Name, type: TEXT, required: true }
|
|
78
|
+
- { key: quantity, name: Quantity, type: NUMBER, min: 0 }
|
|
79
|
+
- { key: note, name: Note, type: MULTILINE_TEXT }
|
|
80
|
+
allow: { add: true, edit: true, remove: true }
|
|
81
|
+
pageSize: 20
|
|
82
|
+
search:
|
|
83
|
+
request: |-
|
|
84
|
+
curl --location '/proxy/workers/api/tasks/**Example_Catalog_Task_Id**/data/search' --request POST \
|
|
85
|
+
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
86
|
+
--header 'Content-Type: application/json' \
|
|
87
|
+
--data '{"fields":[],"offset":0,"limit":20,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6},{"leftOp":"code","condition":"ct","rightOp":{{ search.text | json | replace: "'", "\\u0027" }}}]}}'
|
|
88
|
+
items: "jsonata:: items"
|
|
89
|
+
label: "{{ item.code }} — {{ item.name }}"
|
|
90
|
+
fill: { code: "{{ item.code }}", name: "{{ item.name }}" }
|
|
91
|
+
next: BUILD_IMPORT
|
|
92
|
+
onCancelled: CANCELLED
|
|
93
|
+
- key: BUILD_IMPORT
|
|
94
|
+
type: JSONATA
|
|
95
|
+
metadata:
|
|
96
|
+
expression: |-
|
|
97
|
+
(
|
|
98
|
+
$rows := [
|
|
99
|
+
outputs.EDIT.upserts.$merge([$, {"__status": 1}]),
|
|
100
|
+
outputs.EDIT.removes.$merge([$, {"__status": 3}])
|
|
101
|
+
];
|
|
102
|
+
$keepDestination := $count($rows) > 0 and $count($rows[$exists(__destination_id)]) = $count($rows);
|
|
103
|
+
{
|
|
104
|
+
"hasChanges": $count($rows) > 0,
|
|
105
|
+
"identities": [outputs.EDIT.upserts.code, outputs.EDIT.removes.code],
|
|
106
|
+
"items": [$rows.$sift(function($v, $k) {
|
|
107
|
+
$substring($k, 0, 2) != "__" or $k = "__status" or ($keepDestination and $k = "__destination_id")
|
|
108
|
+
})]
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
next: HAS_CHANGES
|
|
112
|
+
- key: HAS_CHANGES
|
|
113
|
+
type: IF
|
|
114
|
+
metadata:
|
|
115
|
+
condition: "{{ outputs.BUILD_IMPORT.hasChanges }}"
|
|
116
|
+
then: CHANGE_NOTE
|
|
117
|
+
else: NO_CHANGES
|
|
118
|
+
- key: CHANGE_NOTE
|
|
119
|
+
type: FORM
|
|
120
|
+
name: Why are you changing these records?
|
|
121
|
+
metadata:
|
|
122
|
+
fields:
|
|
123
|
+
- key: REASON
|
|
124
|
+
type: MULTILINE_TEXT
|
|
125
|
+
name: Reason for this change (kept in the import history)
|
|
126
|
+
required: true
|
|
127
|
+
next: SAVE
|
|
128
|
+
onCancelled: CANCELLED
|
|
129
|
+
- key: SAVE
|
|
130
|
+
type: API
|
|
131
|
+
name: Save the changes
|
|
132
|
+
metadata: |-
|
|
133
|
+
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/import/data?r=false' --request POST \
|
|
134
|
+
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
135
|
+
--header 'Content-Type: application/json' \
|
|
136
|
+
--data '{"notes":{{ outputs.CHANGE_NOTE.REASON | json | replace: "'", "\\u0027" }},"items":{{ outputs.BUILD_IMPORT.items | json | replace: "'", "\\u0027" }}}'
|
|
137
|
+
next: READ_BACK
|
|
138
|
+
- key: READ_BACK
|
|
139
|
+
type: API
|
|
140
|
+
name: Confirm what was saved
|
|
141
|
+
metadata: |-
|
|
142
|
+
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/search' --request POST \
|
|
143
|
+
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
144
|
+
--header 'Content-Type: application/json' \
|
|
145
|
+
--data '{"fields":[],"offset":0,"limit":500,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6},{"leftOp":"code","condition":"in","rightOp":{{ outputs.BUILD_IMPORT.identities | json | replace: "'", "\\u0027" }}}]}}'
|
|
146
|
+
next: VERIFY
|
|
147
|
+
- key: VERIFY
|
|
148
|
+
type: JSONATA
|
|
149
|
+
metadata:
|
|
150
|
+
expression: |-
|
|
151
|
+
(
|
|
152
|
+
$saved := [outputs.READ_BACK.items];
|
|
153
|
+
$removed := [outputs.EDIT.removes.code];
|
|
154
|
+
$columns := ["code", "name", "quantity", "note"];
|
|
155
|
+
$text := function($v) { $exists($v) and $v != null ? $string($v) : "" };
|
|
156
|
+
$isSaved := function($row) { (
|
|
157
|
+
$found := $saved[code = $row.code][0];
|
|
158
|
+
$exists($found) and $count($columns[$text($lookup($found, $)) != $text($lookup($row, $))]) = 0
|
|
159
|
+
) };
|
|
160
|
+
{
|
|
161
|
+
"verified": outputs.SAVE._response.statusCode >= 200 and outputs.SAVE._response.statusCode < 300
|
|
162
|
+
and outputs.READ_BACK._response.statusCode = 200
|
|
163
|
+
and $count([outputs.BUILD_IMPORT.identities]) <= 500
|
|
164
|
+
and $count([outputs.EDIT.upserts][$not($isSaved($))]) = 0
|
|
165
|
+
and $count($saved[code in $removed]) = 0
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
next: CHECK_SAVED
|
|
169
|
+
- key: CHECK_SAVED
|
|
170
|
+
type: IF
|
|
171
|
+
metadata:
|
|
172
|
+
condition: "{{ outputs.VERIFY.verified }}"
|
|
173
|
+
then: SHOW_SAVED
|
|
174
|
+
else: SHOW_UNVERIFIED
|
|
175
|
+
- key: SHOW_SAVED
|
|
176
|
+
type: SHOW_INFO
|
|
177
|
+
msg: Your changes are saved.
|
|
178
|
+
metadata: { type: SUCCESS, button_title: Finish }
|
|
179
|
+
next: DONE
|
|
180
|
+
- key: SHOW_UNVERIFIED
|
|
181
|
+
type: SHOW_INFO
|
|
182
|
+
msg: The save could not be confirmed. Reopen the records and check them before trying again.
|
|
183
|
+
metadata: { type: WARNING, button_title: Close }
|
|
184
|
+
next: UNVERIFIED
|
|
185
|
+
- key: DONE
|
|
186
|
+
type: RETURN
|
|
187
|
+
metadata:
|
|
188
|
+
status: SUCCESS
|
|
189
|
+
outputs:
|
|
190
|
+
upserted: "jsonata:: $count(outputs.EDIT.upserts)"
|
|
191
|
+
removed: "jsonata:: $count(outputs.EDIT.removes)"
|
|
192
|
+
- key: NO_CHANGES
|
|
193
|
+
type: RETURN
|
|
194
|
+
metadata:
|
|
195
|
+
status: SUCCESS
|
|
196
|
+
outputs: { upserted: 0, removed: 0 }
|
|
197
|
+
- key: UNVERIFIED
|
|
198
|
+
type: RETURN
|
|
199
|
+
metadata:
|
|
200
|
+
status: FAILED
|
|
201
|
+
error: { code: SAVE_UNVERIFIED, message: The saved records could not be confirmed }
|
|
202
|
+
- key: CANCELLED
|
|
203
|
+
type: RETURN
|
|
204
|
+
metadata: { status: CANCELLED }
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The JSONATA step after the form is where removes become disables: it is the only place `__status` is set, other system keys are dropped, and the single import carries both lists. A failed import or read-back is an `API` controlled failure: it follows the plain `next` like a success, so the read-back still runs and `VERIFY` classifies the outcome — success needs a 2xx import, a 200 read-back and every intended row confirmed. Anything else ends in the FAILED RETURN; nothing is resent automatically, because a lost response does not prove the rows were not saved.
|
|
208
|
+
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
> Part of [Frontend workflows](frontend.FRONTEND-FLOWS.md).
|
|
2
2
|
|
|
3
|
-
## RECORDS_FORM
|
|
3
|
+
## `RECORDS_FORM`
|
|
4
4
|
|
|
5
|
-
RECORDS_FORM lets the user add, change and remove several records in one paged table, then hands the changes to the steps after it. It is a pause step like FORM. **It never writes anything**:
|
|
5
|
+
RECORDS_FORM lets the user add, change and remove several records in one paged table, then hands the changes to the steps after it. It is a pause step like FORM. **It never writes anything**: save with an explicit `API` step, then check the returned outcomes. Use the [changes route](frontend.FRONTEND-FLOWS.task-and-reference-data-changes.md#changes-apply-a-row-change-set) after its worker.proxy deployment; the file-import example below remains available.
|
|
6
6
|
|
|
7
7
|
```mermaid
|
|
8
8
|
flowchart LR
|
|
9
|
-
READ[API: read rows] --> EDIT[RECORDS_FORM: edit] -->
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
READ[API: read rows] --> EDIT[RECORDS_FORM: edit] --> HAS{IF: any changes?}
|
|
10
|
+
HAS -- no --> NONE[RETURN SUCCESS]
|
|
11
|
+
HAS -- yes --> NOTE[FORM: change note] --> SAVE[API: changes] --> SAVED{IF: check returned outcomes}
|
|
12
|
+
SAVED -- yes --> OK[SHOW_INFO + RETURN SUCCESS]
|
|
13
|
+
SAVED -- no --> KO[SHOW_INFO + RETURN FAILED]
|
|
12
14
|
```
|
|
13
15
|
|
|
14
16
|
| Syntax | Meaning | Default and choice |
|
|
@@ -32,200 +34,9 @@ flowchart LR
|
|
|
32
34
|
- `removes` — removed loaded rows, **full and unmodified**, identity unchanged.
|
|
33
35
|
- `unchanged` — the count of loaded rows neither changed nor removed. Editing a value back to its original leaves the row unchanged.
|
|
34
36
|
|
|
35
|
-
An identity never appears in both `upserts` and `removes`: re-adding a removed identity restores the loaded row. Cancel follows `onCancelled` and stores no output. Completion
|
|
37
|
+
An identity never appears in both `upserts` and `removes`: re-adding a removed identity restores the loaded row. Cancel follows `onCancelled` and stores no output. Completion exposes only these four members; RECORDS_FORM does not apply output post-processors, and row members are not inferred.
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- **TASK target** — send upserts with `__status: 1` and removes with `__status: 2` in ONE `POST /proxy/workers/api/tasks/<taskId>/data/import/data?r=false` call. Set `__status` explicitly on every row: a REFERENCE task imports a missing or blank status as Removed. Rows must be full because the import requires every table column and rejects unknown ones; with `allow.add`, declare every table column (readonly where users must not edit it), because added rows carry only declared columns. The import also needs a change note (`notes`): the dashboard's own import asks for at least 32 characters and a super-admin account is refused below 256, so ask the user for a real reason rather than sending fixed text. Then read back with `__status not_hbw 6` (active rows only): every upserted identity must be present with the intended values and every removed identity absent, matched on every identity key; otherwise the outcome is unverified, never success, and is never resent automatically.
|
|
40
|
-
- **Never** use `r=true` (it disables every row missing from the payload), a physical delete or `…/data/statuses` (an empty item list applies to every row).
|
|
41
|
-
- **WORKER_SETTINGS target** — persist with the existing `PUT …/worker-settings/` call carrying `{values: {…}}`. Worker settings have no disable status, so keep `allow.remove` false unless your `PUT` step defines what removing a setting means.
|
|
42
|
-
|
|
43
|
-
**Quoting and limits.** Values the user types can contain an apostrophe, which would end a single-quoted `--data '…'` body and make the request unreadable. Render JSON inside such a body as `{{ value | json | replace: "'", "\\u0027" }}`: `json` makes a JSON value and the replace turns each apostrophe into the JSON escape `\u0027`. A search request returns at most its `limit` rows: size the initial read above the largest table you expect, because rows that are not loaded cannot be edited or removed, and adding an identity that exists beyond the limit overwrites that row. A read-back can only confirm as many rows as its `limit`, so a save touching more identities than that is unverified.
|
|
44
|
-
|
|
45
|
-
The following is a complete generic declaration: the tasks and tables the form edits and searches, then the flow.
|
|
46
|
-
|
|
47
|
-
```yaml
|
|
48
|
-
objects:
|
|
49
|
-
- id: "**Example_Records_Task_Id**"
|
|
50
|
-
name: Example records
|
|
51
|
-
type: REFERENCE
|
|
52
|
-
priority: 1000
|
|
53
|
-
description: "!md[./tasks/example-records.md]"
|
|
54
|
-
valueTableName: __hsm_example_records
|
|
55
|
-
ignoreRemoval: true
|
|
56
|
-
ignoreChange: false
|
|
57
|
-
- id: "**Example_Catalog_Task_Id**"
|
|
58
|
-
name: Example catalog
|
|
59
|
-
type: REFERENCE
|
|
60
|
-
priority: 1000
|
|
61
|
-
description: "!md[./tasks/example-catalog.md]"
|
|
62
|
-
valueTableName: __hsm_example_catalog
|
|
63
|
-
ignoreRemoval: true
|
|
64
|
-
ignoreChange: false
|
|
65
|
-
objectAssociations:
|
|
66
|
-
"**Example_Records_Task_Id**":
|
|
67
|
-
table: { id: "**Example_Records_Table_Id**" }
|
|
68
|
-
"**Example_Catalog_Task_Id**":
|
|
69
|
-
table: { id: "**Example_Catalog_Table_Id**" }
|
|
70
|
-
tables:
|
|
71
|
-
- id: "**Example_Records_Table_Id**"
|
|
72
|
-
columns:
|
|
73
|
-
code: { name: Code }
|
|
74
|
-
name: { name: Name }
|
|
75
|
-
quantity: { name: Quantity, dataType: Numeric }
|
|
76
|
-
note: { name: Note }
|
|
77
|
-
- id: "**Example_Catalog_Table_Id**"
|
|
78
|
-
columns:
|
|
79
|
-
code: { name: Code }
|
|
80
|
-
name: { name: Name }
|
|
81
|
-
getReadyFlows:
|
|
82
|
-
- key: EDIT_RECORDS
|
|
83
|
-
title: Edit records
|
|
84
|
-
action: { label: Edit records }
|
|
85
|
-
completionVersion: "1"
|
|
86
|
-
steps:
|
|
87
|
-
- key: READ_RECORDS
|
|
88
|
-
type: API
|
|
89
|
-
root: true
|
|
90
|
-
name: Read the current records
|
|
91
|
-
metadata: |-
|
|
92
|
-
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/search' --request POST \
|
|
93
|
-
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
94
|
-
--header 'Content-Type: application/json' \
|
|
95
|
-
--data '{"fields":[],"offset":0,"limit":500,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6}]}}'
|
|
96
|
-
next: EDIT
|
|
97
|
-
- key: EDIT
|
|
98
|
-
type: RECORDS_FORM
|
|
99
|
-
name: Edit records
|
|
100
|
-
description: Add, change or remove records. Nothing is saved until you confirm.
|
|
101
|
-
metadata:
|
|
102
|
-
target: { kind: TASK, taskId: "**Example_Records_Task_Id**" }
|
|
103
|
-
identity: [code]
|
|
104
|
-
initial: "jsonata:: outputs.READ_RECORDS.items"
|
|
105
|
-
columns:
|
|
106
|
-
- { key: code, name: Code, type: TEXT, required: true, readonly: true }
|
|
107
|
-
- { key: name, name: Name, type: TEXT, required: true }
|
|
108
|
-
- { key: quantity, name: Quantity, type: NUMBER, min: 0 }
|
|
109
|
-
- { key: note, name: Note, type: MULTILINE_TEXT }
|
|
110
|
-
allow: { add: true, edit: true, remove: true }
|
|
111
|
-
pageSize: 20
|
|
112
|
-
search:
|
|
113
|
-
request: |-
|
|
114
|
-
curl --location '/proxy/workers/api/tasks/**Example_Catalog_Task_Id**/data/search' --request POST \
|
|
115
|
-
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
116
|
-
--header 'Content-Type: application/json' \
|
|
117
|
-
--data '{"fields":[],"offset":0,"limit":20,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6},{"leftOp":"code","condition":"ct","rightOp":{{ search.text | json | replace: "'", "\\u0027" }}}]}}'
|
|
118
|
-
items: "jsonata:: items"
|
|
119
|
-
label: "{{ item.code }} — {{ item.name }}"
|
|
120
|
-
fill: { code: "{{ item.code }}", name: "{{ item.name }}" }
|
|
121
|
-
next: BUILD_IMPORT
|
|
122
|
-
onCancelled: CANCELLED
|
|
123
|
-
- key: BUILD_IMPORT
|
|
124
|
-
type: JSONATA
|
|
125
|
-
metadata:
|
|
126
|
-
expression: |-
|
|
127
|
-
{
|
|
128
|
-
"hasChanges": $count(outputs.EDIT.upserts) + $count(outputs.EDIT.removes) > 0,
|
|
129
|
-
"identities": [outputs.EDIT.upserts.code, outputs.EDIT.removes.code],
|
|
130
|
-
"items": [
|
|
131
|
-
outputs.EDIT.upserts.$merge([$, {"__status": 1}]),
|
|
132
|
-
outputs.EDIT.removes.$merge([$, {"__status": 2}])
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
next: HAS_CHANGES
|
|
136
|
-
- key: HAS_CHANGES
|
|
137
|
-
type: IF
|
|
138
|
-
metadata:
|
|
139
|
-
condition: "{{ outputs.BUILD_IMPORT.hasChanges }}"
|
|
140
|
-
then: CHANGE_NOTE
|
|
141
|
-
else: NO_CHANGES
|
|
142
|
-
- key: CHANGE_NOTE
|
|
143
|
-
type: FORM
|
|
144
|
-
name: Why are you changing these records?
|
|
145
|
-
metadata:
|
|
146
|
-
fields:
|
|
147
|
-
- key: REASON
|
|
148
|
-
type: MULTILINE_TEXT
|
|
149
|
-
name: Reason for this change (kept in the import history)
|
|
150
|
-
required: true
|
|
151
|
-
next: SAVE
|
|
152
|
-
onCancelled: CANCELLED
|
|
153
|
-
- key: SAVE
|
|
154
|
-
type: API
|
|
155
|
-
name: Save the changes
|
|
156
|
-
metadata: |-
|
|
157
|
-
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/import/data?r=false' --request POST \
|
|
158
|
-
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
159
|
-
--header 'Content-Type: application/json' \
|
|
160
|
-
--data '{"notes":{{ outputs.CHANGE_NOTE.REASON | json | replace: "'", "\\u0027" }},"items":{{ outputs.BUILD_IMPORT.items | json | replace: "'", "\\u0027" }}}'
|
|
161
|
-
next: READ_BACK
|
|
162
|
-
- key: READ_BACK
|
|
163
|
-
type: API
|
|
164
|
-
name: Confirm what was saved
|
|
165
|
-
metadata: |-
|
|
166
|
-
curl --location '/proxy/workers/api/tasks/**Example_Records_Task_Id**/data/search' --request POST \
|
|
167
|
-
--header 'HSS-PROFILE-ID: {{ inputs.PROFILE_ID }}' \
|
|
168
|
-
--header 'Content-Type: application/json' \
|
|
169
|
-
--data '{"fields":[],"offset":0,"limit":500,"filters":{"condition":"AND","rightOp":[{"leftOp":"__status","condition":"not_hbw","rightOp":6},{"leftOp":"code","condition":"in","rightOp":{{ outputs.BUILD_IMPORT.identities | json | replace: "'", "\\u0027" }}}]}}'
|
|
170
|
-
next: VERIFY
|
|
171
|
-
- key: VERIFY
|
|
172
|
-
type: JSONATA
|
|
173
|
-
metadata:
|
|
174
|
-
expression: |-
|
|
175
|
-
(
|
|
176
|
-
$saved := [outputs.READ_BACK.items];
|
|
177
|
-
$removed := [outputs.EDIT.removes.code];
|
|
178
|
-
$columns := ["code", "name", "quantity", "note"];
|
|
179
|
-
$text := function($v) { $exists($v) and $v != null ? $string($v) : "" };
|
|
180
|
-
$isSaved := function($row) { (
|
|
181
|
-
$found := $saved[code = $row.code][0];
|
|
182
|
-
$exists($found) and $count($columns[$text($lookup($found, $)) != $text($lookup($row, $))]) = 0
|
|
183
|
-
) };
|
|
184
|
-
{
|
|
185
|
-
"verified": outputs.READ_BACK._response.statusCode = 200
|
|
186
|
-
and $count([outputs.BUILD_IMPORT.identities]) <= 500
|
|
187
|
-
and $count([outputs.EDIT.upserts][$not($isSaved($))]) = 0
|
|
188
|
-
and $count($saved[code in $removed]) = 0
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
next: CHECK_SAVED
|
|
192
|
-
- key: CHECK_SAVED
|
|
193
|
-
type: IF
|
|
194
|
-
metadata:
|
|
195
|
-
condition: "{{ outputs.VERIFY.verified }}"
|
|
196
|
-
then: SHOW_SAVED
|
|
197
|
-
else: SHOW_UNVERIFIED
|
|
198
|
-
- key: SHOW_SAVED
|
|
199
|
-
type: SHOW_INFO
|
|
200
|
-
msg: Your changes are saved.
|
|
201
|
-
metadata: { type: SUCCESS, button_title: Finish }
|
|
202
|
-
next: DONE
|
|
203
|
-
- key: SHOW_UNVERIFIED
|
|
204
|
-
type: SHOW_INFO
|
|
205
|
-
msg: The save could not be confirmed. Reopen the records and check them before trying again.
|
|
206
|
-
metadata: { type: WARNING, button_title: Close }
|
|
207
|
-
next: UNVERIFIED
|
|
208
|
-
- key: DONE
|
|
209
|
-
type: RETURN
|
|
210
|
-
metadata:
|
|
211
|
-
status: SUCCESS
|
|
212
|
-
outputs:
|
|
213
|
-
upserted: "jsonata:: $count(outputs.EDIT.upserts)"
|
|
214
|
-
removed: "jsonata:: $count(outputs.EDIT.removes)"
|
|
215
|
-
- key: NO_CHANGES
|
|
216
|
-
type: RETURN
|
|
217
|
-
metadata:
|
|
218
|
-
status: SUCCESS
|
|
219
|
-
outputs: { upserted: 0, removed: 0 }
|
|
220
|
-
- key: UNVERIFIED
|
|
221
|
-
type: RETURN
|
|
222
|
-
metadata:
|
|
223
|
-
status: FAILED
|
|
224
|
-
error: { code: SAVE_UNVERIFIED, message: The saved records could not be confirmed }
|
|
225
|
-
- key: CANCELLED
|
|
226
|
-
type: RETURN
|
|
227
|
-
metadata: { status: CANCELLED }
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
The JSONATA step after the form is where removes become disables: it is the only place `__status` is set, and the single import carries both lists. A failed import or read-back takes the handler failure path (it does not advance `next`); it never advances to success and is never resent automatically, because a lost response does not prove the rows were not saved.
|
|
39
|
+
This section is served as 2 separate resources. Read the one you need:
|
|
231
40
|
|
|
41
|
+
- [`RECORDS_FORM` change-set path](frontend.FRONTEND-FLOWS.records_form.records_form-change-set-path.md) — This complete generic declaration uses the deployed changes capability: RECORDS_FORM → one changes API step → one outcome check.
|
|
42
|
+
- [File-import path](frontend.FRONTEND-FLOWS.records_form.file-import-path.md) — The existing example below is the file-import path, retained for callers using the original full-row import contract.
|