@carthooks/arcubase-cli 0.1.2 → 0.1.3
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/bundle/arcubase-admin.mjs +907 -10
- package/bundle/arcubase.mjs +907 -10
- package/dist/runtime/command_registry.d.ts +8 -0
- package/dist/runtime/command_registry.d.ts.map +1 -1
- package/dist/runtime/command_registry.js +35 -0
- package/dist/runtime/entity_save_schema.d.ts +15 -0
- package/dist/runtime/entity_save_schema.d.ts.map +1 -0
- package/dist/runtime/entity_save_schema.js +641 -0
- package/dist/runtime/errors.d.ts +10 -0
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js +89 -10
- package/dist/runtime/zod_registry.d.ts +6 -0
- package/dist/runtime/zod_registry.d.ts.map +1 -1
- package/dist/runtime/zod_registry.js +133 -0
- package/dist/tests/command_registry.test.js +5 -0
- package/dist/tests/entity_save_schema.test.d.ts +2 -0
- package/dist/tests/entity_save_schema.test.d.ts.map +1 -0
- package/dist/tests/entity_save_schema.test.js +221 -0
- package/dist/tests/execute_validation.test.js +450 -0
- package/dist/tests/help.test.js +33 -0
- package/package.json +1 -1
- package/sdk-dist/docs/runtime-reference/README.md +177 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/README.md +120 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/address.md +34 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/boolean.md +37 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/button.md +47 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/checkbox.md +61 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/datasets.md +35 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/datetime.md +40 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/department.md +33 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/departments.md +34 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/divider.md +39 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/file.md +44 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/formula.md +44 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/image.md +43 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/linkto.md +67 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/location.md +32 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/lookup.md +41 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/member.md +37 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/members.md +31 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/number.md +70 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/query.md +50 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/radio.md +53 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/relation.md +55 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/relationfield.md +38 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/rollup.md +54 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/select.md +63 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/selects.md +51 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/serialnumber.md +48 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/signature.md +31 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/status.md +70 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/subform.md +74 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/tags.md +19 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/text.md +76 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/textarea.md +47 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/workflow_status.md +17 -0
- package/sdk-dist/docs/runtime-reference/entity-schema.md +197 -0
- package/sdk-dist/docs/runtime-reference/examples/README.md +51 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/README.md +20 -0
- package/sdk-dist/docs/runtime-reference/examples/mes-01/README.md +21 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/README.md +164 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/app-overview.md +79 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/create-app.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.schema.json +159 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.schema.json +179 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.schema.json +168 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.schema.json +417 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.bulk-update.json +22 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.query.json +10 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.row.insert.json +28 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.schema.json +398 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.condition.json +13 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.ids.json +7 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.schema.json +137 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/README.md +21 -0
- package/sdk-dist/docs/runtime-reference/row-crud.md +186 -0
- package/sdk-dist/docs/runtime-reference/search-and-bulk-actions.md +494 -0
- package/sdk-dist/docs/runtime-reference/table-lifecycle.md +123 -0
- package/sdk-dist/docs/runtime-reference/workflow/README.md +19 -0
- package/src/runtime/command_registry.ts +47 -0
- package/src/runtime/entity_save_schema.ts +708 -0
- package/src/runtime/errors.ts +11 -0
- package/src/runtime/execute.ts +123 -10
- package/src/runtime/zod_registry.ts +154 -0
- package/src/tests/command_registry.test.ts +6 -0
- package/src/tests/entity_save_schema.test.ts +236 -0
- package/src/tests/execute_validation.test.ts +598 -0
- package/src/tests/help.test.ts +39 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# formula
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Computed field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `readonly: true`
|
|
11
|
+
- `notImportAble: true`
|
|
12
|
+
|
|
13
|
+
## Minimal shape
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"type": "formula",
|
|
18
|
+
"options": {
|
|
19
|
+
"formula": {
|
|
20
|
+
"code": "[[Field A:1001]]+[[Field B:1002]]",
|
|
21
|
+
"jsonlogic": {
|
|
22
|
+
"+": [
|
|
23
|
+
{ "var": "1001" },
|
|
24
|
+
{ "var": "1002" }
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Common options
|
|
33
|
+
|
|
34
|
+
- `formula.code`
|
|
35
|
+
- `formula.jsonlogic`
|
|
36
|
+
|
|
37
|
+
## Constraints
|
|
38
|
+
|
|
39
|
+
- `code` and `jsonlogic` must both exist
|
|
40
|
+
- field ids referenced in `code` must exist
|
|
41
|
+
- common referenceable types include `text`, `number`, `datetime`, `select`, `radio`, `checkbox`, and `rollup`
|
|
42
|
+
- if the formula field is inside a subform, it may reference other fields in the same subform
|
|
43
|
+
- in the current editor flow, top-level formulas may reference top-level fields; subform formulas should stay inside the same subform scope
|
|
44
|
+
- in the current direct-write path, keep only `formula` at the top level of `options`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# image
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Image upload field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `switchgroup: file`
|
|
11
|
+
- `notExportAble: true`
|
|
12
|
+
- `events: ['change']`
|
|
13
|
+
|
|
14
|
+
## Minimal shape
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"type": "image",
|
|
19
|
+
"options": {
|
|
20
|
+
"count_range": false,
|
|
21
|
+
"count_min": 0,
|
|
22
|
+
"count_max": 9,
|
|
23
|
+
"meta_title": false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Common options
|
|
29
|
+
|
|
30
|
+
- `count_range`
|
|
31
|
+
- `count_min`
|
|
32
|
+
- `count_max`
|
|
33
|
+
- `meta_title`
|
|
34
|
+
- `hideInList`
|
|
35
|
+
|
|
36
|
+
## Constraints
|
|
37
|
+
|
|
38
|
+
- when `count_range=true`, it is recommended to provide both `count_min` and `count_max`
|
|
39
|
+
- `required` is controlled by generic field flags, not inside `options`
|
|
40
|
+
- when count limits are disabled in the current direct-write path, use:
|
|
41
|
+
- `count_range: false`
|
|
42
|
+
- `count_min: 0`
|
|
43
|
+
- `count_max: 9`
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# linkto
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Relation picker field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `hideInList: true`
|
|
11
|
+
- `hideInViewMode: false`
|
|
12
|
+
- `inlineEdtiable: true`
|
|
13
|
+
- `notImportAble: true`
|
|
14
|
+
- `notExportAble: true`
|
|
15
|
+
- `events: ['change']`
|
|
16
|
+
|
|
17
|
+
## Minimal shape
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "linkto",
|
|
22
|
+
"options": {
|
|
23
|
+
"placeholder": "",
|
|
24
|
+
"mode": "manual",
|
|
25
|
+
"structure": "multiple",
|
|
26
|
+
"relation": {
|
|
27
|
+
"app_id": 1,
|
|
28
|
+
"entity_id": 2,
|
|
29
|
+
"type": "entity",
|
|
30
|
+
"show_fields": [1001],
|
|
31
|
+
"queryFields": [1001],
|
|
32
|
+
"condition": { "mode": "and", "conditions": [] },
|
|
33
|
+
"sorts": [{ "column": "updated_at", "order": "desc" }]
|
|
34
|
+
},
|
|
35
|
+
"backfill": []
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Common options
|
|
41
|
+
|
|
42
|
+
- `placeholder`
|
|
43
|
+
- `mode`
|
|
44
|
+
- `structure`
|
|
45
|
+
- `backfill`
|
|
46
|
+
- `addValue`
|
|
47
|
+
- `relation.app_id`
|
|
48
|
+
- `relation.entity_id`
|
|
49
|
+
- `relation.type`
|
|
50
|
+
- `relation.show_fields`
|
|
51
|
+
- `relation.queryFields`
|
|
52
|
+
- `relation.condition`
|
|
53
|
+
- `relation.sorts`
|
|
54
|
+
- `relation.subform_id`
|
|
55
|
+
|
|
56
|
+
## Constraints
|
|
57
|
+
|
|
58
|
+
- `relation.app_id` and `relation.entity_id` are required
|
|
59
|
+
- `relation.show_fields` should be explicit
|
|
60
|
+
- `relation.sorts` should include at least one default sort
|
|
61
|
+
- row CRUD may store an empty array when no linked record is selected
|
|
62
|
+
- `mode` current common values are:
|
|
63
|
+
- `auto`
|
|
64
|
+
- `manual`
|
|
65
|
+
- `structure` current common values are:
|
|
66
|
+
- `single`
|
|
67
|
+
- `multiple`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# location
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Location field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `useFormula: true`
|
|
11
|
+
- `useRelation: true`
|
|
12
|
+
- `events: ['change']`
|
|
13
|
+
|
|
14
|
+
## Minimal shape
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"type": "location",
|
|
19
|
+
"options": {
|
|
20
|
+
"placeholder": ""
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Common options
|
|
26
|
+
|
|
27
|
+
- `placeholder`
|
|
28
|
+
|
|
29
|
+
## Constraints
|
|
30
|
+
|
|
31
|
+
- In the current direct-write pathyou may keep only an empty `placeholder`
|
|
32
|
+
- other behavior depends on runtime location capability; do not extend the schema with extra custom structure
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# lookup
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Lookup field that pulls a value from the target entity of a `linkto` field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `readonly: true`
|
|
11
|
+
- `notImportAble: true`
|
|
12
|
+
|
|
13
|
+
## Minimal shape
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"type": "lookup",
|
|
18
|
+
"options": {
|
|
19
|
+
"relation": {
|
|
20
|
+
"local_linkto_field_id": 1012,
|
|
21
|
+
"target_field_id": 2003,
|
|
22
|
+
"target_field_type": "text"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Common options
|
|
29
|
+
|
|
30
|
+
- `relation.local_linkto_field_id`
|
|
31
|
+
- `relation.target_field_id`
|
|
32
|
+
- `relation.target_field_type`
|
|
33
|
+
|
|
34
|
+
## Constraints
|
|
35
|
+
|
|
36
|
+
- `local_linkto_field_id` must point to a real `linkto`
|
|
37
|
+
- `target_field_id` is required
|
|
38
|
+
- `target_field_type` should be explicit
|
|
39
|
+
- `local_linkto_field_id` should point to a `linkto` field in the same scope as the lookup field
|
|
40
|
+
- after choosing the target field, the current field `label` should usually match the target field name
|
|
41
|
+
- in the current direct-write path, keep only `relation` at the top level of `options`
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# member
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Single-member field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `useFormula: true`
|
|
11
|
+
- `useRelation: true`
|
|
12
|
+
- `operator: member`
|
|
13
|
+
- `notImportAble: true`
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "member",
|
|
20
|
+
"options": {}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Common options
|
|
25
|
+
|
|
26
|
+
- `placeholder`
|
|
27
|
+
|
|
28
|
+
## Default value
|
|
29
|
+
|
|
30
|
+
- `value` may be null
|
|
31
|
+
- if you need to represent the current user, prefer:
|
|
32
|
+
- `${CURRENT_USER}`
|
|
33
|
+
|
|
34
|
+
## Constraints
|
|
35
|
+
|
|
36
|
+
- `member` is a single-value field
|
|
37
|
+
- `value` must not be an array
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# members
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Multi-member field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `useFormula: true`
|
|
11
|
+
- `useRelation: true`
|
|
12
|
+
- `notImportAble: true`
|
|
13
|
+
- `events: ['change']`
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "members",
|
|
20
|
+
"options": {}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Common options
|
|
25
|
+
|
|
26
|
+
- `placeholder`
|
|
27
|
+
|
|
28
|
+
## Constraints
|
|
29
|
+
|
|
30
|
+
- `members` is a multi-value field
|
|
31
|
+
- in the current direct-write path, `options` may contain only `placeholder`
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# number
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Numeric field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `uniqueAble: true`
|
|
11
|
+
- `useFormula: true`
|
|
12
|
+
- `useRelation: true`
|
|
13
|
+
- `switchgroup: number`
|
|
14
|
+
- `inlineEdtiable: true`
|
|
15
|
+
- `events: ['change']`
|
|
16
|
+
|
|
17
|
+
## Minimal shape
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "number",
|
|
22
|
+
"number_decimal": 0,
|
|
23
|
+
"options": {
|
|
24
|
+
"link": {},
|
|
25
|
+
"mode": "number",
|
|
26
|
+
"numberMax": "",
|
|
27
|
+
"numberMin": "",
|
|
28
|
+
"numberRange": false,
|
|
29
|
+
"placeholder": "",
|
|
30
|
+
"repeatRemind": "This value already exists and duplicate submission is not allowed"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Common options
|
|
36
|
+
|
|
37
|
+
- `link`
|
|
38
|
+
- `mode`
|
|
39
|
+
- `placeholder`
|
|
40
|
+
- `unit`
|
|
41
|
+
- `number_thousand_separator`
|
|
42
|
+
- `numberMax`
|
|
43
|
+
- `numberMin`
|
|
44
|
+
- `numberRange`
|
|
45
|
+
- `repeatRemind`
|
|
46
|
+
- `number_spec_decimal`
|
|
47
|
+
- `default_formula`
|
|
48
|
+
- `default_formula_jsonlogic`
|
|
49
|
+
- `hideInList`
|
|
50
|
+
|
|
51
|
+
## Constraints
|
|
52
|
+
|
|
53
|
+
- `mode` should be `number` or `percent`
|
|
54
|
+
- `number_decimal` must be a non-negative integer
|
|
55
|
+
- if you include `number_spec_decimal`, keep it consistent with `number_decimal`
|
|
56
|
+
- when `mode = "percent"`, keep the stored `number_decimal` explicit in the final payload
|
|
57
|
+
- when `numberRange=true`, it is recommended to provide both `numberMin` and `numberMax`
|
|
58
|
+
|
|
59
|
+
## Save-ready reminder
|
|
60
|
+
|
|
61
|
+
For `arcubase-admin entity admin-save-entity`, keep the full base `FieldVO`.
|
|
62
|
+
|
|
63
|
+
In practice, do not forget:
|
|
64
|
+
|
|
65
|
+
- `number_decimal`
|
|
66
|
+
- `value`
|
|
67
|
+
- `depends`
|
|
68
|
+
- `key`
|
|
69
|
+
- `transfers`
|
|
70
|
+
- `children: null`
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# query
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Selection-query field based on relation config.
|
|
6
|
+
|
|
7
|
+
## Minimal shape
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"type": "query",
|
|
12
|
+
"options": {
|
|
13
|
+
"mode": "manual",
|
|
14
|
+
"structure": "multiple",
|
|
15
|
+
"addValue": true,
|
|
16
|
+
"relation": {
|
|
17
|
+
"app_id": 1,
|
|
18
|
+
"entity_id": 2,
|
|
19
|
+
"type": "entity",
|
|
20
|
+
"show_fields": [1001],
|
|
21
|
+
"queryFields": [1001],
|
|
22
|
+
"condition": { "mode": "and", "conditions": [] },
|
|
23
|
+
"sorts": [{ "column": "updated_at", "order": "desc" }]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Common options
|
|
30
|
+
|
|
31
|
+
- `mode`
|
|
32
|
+
- `structure`
|
|
33
|
+
- `addValue`
|
|
34
|
+
- `relation.app_id`
|
|
35
|
+
- `relation.entity_id`
|
|
36
|
+
- `relation.type`
|
|
37
|
+
- `relation.show_fields`
|
|
38
|
+
- `relation.queryFields`
|
|
39
|
+
- `relation.condition`
|
|
40
|
+
- `relation.sorts`
|
|
41
|
+
|
|
42
|
+
## Constraints
|
|
43
|
+
|
|
44
|
+
- `relation.app_id` and `relation.entity_id` are required
|
|
45
|
+
- `relation.type` must be explicit; use `entity`
|
|
46
|
+
- `relation.show_fields` should be explicit
|
|
47
|
+
- `relation.queryFields` should be explicit in manual mode
|
|
48
|
+
- `relation.sorts` should include at least one default sort
|
|
49
|
+
- `mode` current common values are `auto` and `manual`
|
|
50
|
+
- `structure` current common values are `single` and `multiple`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# radio
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Single-select enum field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `useFormula: true`
|
|
11
|
+
- `useRelation: true`
|
|
12
|
+
- `switchgroup: text`
|
|
13
|
+
- `events: ['change']`
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "radio",
|
|
20
|
+
"options": {
|
|
21
|
+
"horizontal": false,
|
|
22
|
+
"options": {
|
|
23
|
+
"mode": "custom",
|
|
24
|
+
"colorful": false,
|
|
25
|
+
"items": [
|
|
26
|
+
{ "key": 1, "value": "Option 1" }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Common options
|
|
34
|
+
|
|
35
|
+
- `horizontal`
|
|
36
|
+
- `hideInList`
|
|
37
|
+
- `link`
|
|
38
|
+
- `numberMax`
|
|
39
|
+
- `numberMin`
|
|
40
|
+
- `numberRange`
|
|
41
|
+
- `repeatRemind`
|
|
42
|
+
- `width`
|
|
43
|
+
- `options.items`
|
|
44
|
+
- `options.mode`
|
|
45
|
+
- `options.colorful`
|
|
46
|
+
- `options.has_other`
|
|
47
|
+
- `options.other_label`
|
|
48
|
+
|
|
49
|
+
## Constraints
|
|
50
|
+
|
|
51
|
+
- `options.items` at least one item
|
|
52
|
+
- when `options.has_other = true`, also provide `options.other_label`
|
|
53
|
+
- `horizontal` controls display only; it does not change the row payload shape
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# relation
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Entity relation field.
|
|
6
|
+
|
|
7
|
+
## Minimal shape
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"type": "relation",
|
|
12
|
+
"options": {
|
|
13
|
+
"backfill": [],
|
|
14
|
+
"placeholder": "",
|
|
15
|
+
"relation": {
|
|
16
|
+
"app_id": 1,
|
|
17
|
+
"entity_id": 2,
|
|
18
|
+
"type": "entity",
|
|
19
|
+
"show_fields": [1001],
|
|
20
|
+
"queryFields": [1001],
|
|
21
|
+
"condition": { "mode": "and", "conditions": [] },
|
|
22
|
+
"sorts": [{ "column": "updated_at", "order": "desc" }]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Common options
|
|
29
|
+
|
|
30
|
+
- `backfill`
|
|
31
|
+
- `placeholder`
|
|
32
|
+
- `mode`
|
|
33
|
+
- `structure`
|
|
34
|
+
- `addValue`
|
|
35
|
+
- `relation.app_id`
|
|
36
|
+
- `relation.entity_id`
|
|
37
|
+
- `relation.type`
|
|
38
|
+
- `relation.show_fields`
|
|
39
|
+
- `relation.queryFields`
|
|
40
|
+
- `relation.condition`
|
|
41
|
+
- `relation.sorts`
|
|
42
|
+
- `relation.subform_id`
|
|
43
|
+
- `width`
|
|
44
|
+
|
|
45
|
+
## Constraints
|
|
46
|
+
|
|
47
|
+
- `relation.app_id` and `relation.entity_id` are required
|
|
48
|
+
- `relation.show_fields` should be explicit
|
|
49
|
+
- `relation.sorts` should include at least one default sort
|
|
50
|
+
- In the current direct-write path, `mode` common values:
|
|
51
|
+
- `auto`
|
|
52
|
+
- `manual`
|
|
53
|
+
- In the current direct-write path, `structure` common values:
|
|
54
|
+
- `single`
|
|
55
|
+
- `multiple`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# relationfield
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Derived field that reads a target value through an existing relation field.
|
|
6
|
+
|
|
7
|
+
## Minimal shape
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"type": "relationfield",
|
|
12
|
+
"options": {
|
|
13
|
+
"relation": {
|
|
14
|
+
"app_id": 1,
|
|
15
|
+
"entity_id": 2,
|
|
16
|
+
"type": "entity"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Available options
|
|
23
|
+
|
|
24
|
+
- `relation.app_id`
|
|
25
|
+
- `relation.entity_id`
|
|
26
|
+
- `relation.type`
|
|
27
|
+
- `relation.show_fields`
|
|
28
|
+
- `relation.queryFields`
|
|
29
|
+
- `relation.condition`
|
|
30
|
+
- `relation.sorts`
|
|
31
|
+
- `relation.subform_id`
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- `options.relation` is required
|
|
36
|
+
- `relation.app_id` and `relation.entity_id` are required
|
|
37
|
+
- use `relation.type = "entity"` in the current direct-write path
|
|
38
|
+
- do not send empty `options`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# rollup
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Aggregation field built on top of a `linkto` field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `readonly: true`
|
|
11
|
+
- `notImportAble: true`
|
|
12
|
+
|
|
13
|
+
## Minimal shape
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"type": "rollup",
|
|
18
|
+
"options": {
|
|
19
|
+
"relation": {
|
|
20
|
+
"local_linkto_field_id": 1012,
|
|
21
|
+
"target_field_id": 2004,
|
|
22
|
+
"target_field_type": "number"
|
|
23
|
+
},
|
|
24
|
+
"aggregation_formula": {
|
|
25
|
+
"code": "COUNT([[Value]])",
|
|
26
|
+
"jsonlogic": {
|
|
27
|
+
"COUNT": [
|
|
28
|
+
{ "value": "Value" }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Common options
|
|
37
|
+
|
|
38
|
+
- `relation.local_linkto_field_id`
|
|
39
|
+
- `relation.target_field_id`
|
|
40
|
+
- `relation.target_field_type`
|
|
41
|
+
- `aggregation_formula.code`
|
|
42
|
+
- `aggregation_formula.jsonlogic`
|
|
43
|
+
|
|
44
|
+
## Constraints
|
|
45
|
+
|
|
46
|
+
- `local_linkto_field_id` must point to a real `linkto`
|
|
47
|
+
- `target_field_id` is required
|
|
48
|
+
- `target_field_type` should be explicit
|
|
49
|
+
- `aggregation_formula` must exist
|
|
50
|
+
- keep `aggregation_formula.code` and `aggregation_formula.jsonlogic` aligned
|
|
51
|
+
- common aggregation formulas include `COUNT([[Value]])`, `sum([[Value]])`, `AVG([[Value]])`, `MAX([[Value]])`, and `MIN([[Value]])`
|
|
52
|
+
- in the current direct-write path, keep only these top-level `options` keys:
|
|
53
|
+
- `relation`
|
|
54
|
+
- `aggregation_formula`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# select
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Single-select dropdown field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `operator: text`
|
|
11
|
+
- `switchgroup: text`
|
|
12
|
+
- `useFormula: true`
|
|
13
|
+
- `useRelation: true`
|
|
14
|
+
- `inlineEdtiable: true`
|
|
15
|
+
- `events: ['change']`
|
|
16
|
+
|
|
17
|
+
## Minimal shape
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "select",
|
|
22
|
+
"options": {
|
|
23
|
+
"horizontal": false,
|
|
24
|
+
"numberMax": "",
|
|
25
|
+
"numberMin": "",
|
|
26
|
+
"numberRange": false,
|
|
27
|
+
"repeatRemind": "This value already exists and duplicate submission is not allowed",
|
|
28
|
+
"options": {
|
|
29
|
+
"mode": "custom",
|
|
30
|
+
"colorful": false,
|
|
31
|
+
"items": [
|
|
32
|
+
{ "key": 1, "value": "Option 1" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Common options
|
|
40
|
+
|
|
41
|
+
- `horizontal`
|
|
42
|
+
- `placeholder`
|
|
43
|
+
- `numberMax`
|
|
44
|
+
- `numberMin`
|
|
45
|
+
- `numberRange`
|
|
46
|
+
- `repeatRemind`
|
|
47
|
+
- `hideInList`
|
|
48
|
+
- `width`
|
|
49
|
+
- `options.items`
|
|
50
|
+
- `options.mode`
|
|
51
|
+
- `options.colorful`
|
|
52
|
+
- `options.relation`
|
|
53
|
+
- `options.relation_filter`
|
|
54
|
+
- `options.international`
|
|
55
|
+
- `options.has_other`
|
|
56
|
+
- `options.other_label`
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
|
|
60
|
+
- `options.items` at least one item
|
|
61
|
+
- `options.mode` common values are `custom` or `relation`
|
|
62
|
+
- when `options.has_other = true`, also provide `options.other_label`
|
|
63
|
+
- keep `options.options.items[*].key` stable once the field is live
|