@carthooks/arcubase-cli 0.1.2 → 0.1.4

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.
Files changed (106) hide show
  1. package/bundle/arcubase-admin.mjs +1238 -16
  2. package/bundle/arcubase.mjs +1238 -16
  3. package/dist/bin/arcubase-admin.js +0 -0
  4. package/dist/bin/arcubase.js +0 -0
  5. package/dist/runtime/command_registry.d.ts +8 -0
  6. package/dist/runtime/command_registry.d.ts.map +1 -1
  7. package/dist/runtime/command_registry.js +35 -0
  8. package/dist/runtime/entity_save_schema.d.ts +15 -0
  9. package/dist/runtime/entity_save_schema.d.ts.map +1 -0
  10. package/dist/runtime/entity_save_schema.js +641 -0
  11. package/dist/runtime/errors.d.ts +11 -0
  12. package/dist/runtime/errors.d.ts.map +1 -1
  13. package/dist/runtime/execute.d.ts.map +1 -1
  14. package/dist/runtime/execute.js +294 -12
  15. package/dist/runtime/upload.d.ts +13 -0
  16. package/dist/runtime/upload.d.ts.map +1 -0
  17. package/dist/runtime/upload.js +148 -0
  18. package/dist/runtime/zod_registry.d.ts +6 -0
  19. package/dist/runtime/zod_registry.d.ts.map +1 -1
  20. package/dist/runtime/zod_registry.js +136 -0
  21. package/dist/tests/command_registry.test.js +5 -0
  22. package/dist/tests/entity_save_schema.test.d.ts +2 -0
  23. package/dist/tests/entity_save_schema.test.d.ts.map +1 -0
  24. package/dist/tests/entity_save_schema.test.js +221 -0
  25. package/dist/tests/execute_validation.test.js +603 -0
  26. package/dist/tests/help.test.js +49 -0
  27. package/dist/tests/upload.test.d.ts +2 -0
  28. package/dist/tests/upload.test.d.ts.map +1 -0
  29. package/dist/tests/upload.test.js +107 -0
  30. package/package.json +1 -1
  31. package/sdk-dist/docs/runtime-reference/README.md +187 -0
  32. package/sdk-dist/docs/runtime-reference/entity-schema/README.md +120 -0
  33. package/sdk-dist/docs/runtime-reference/entity-schema/address.md +34 -0
  34. package/sdk-dist/docs/runtime-reference/entity-schema/boolean.md +37 -0
  35. package/sdk-dist/docs/runtime-reference/entity-schema/button.md +47 -0
  36. package/sdk-dist/docs/runtime-reference/entity-schema/checkbox.md +61 -0
  37. package/sdk-dist/docs/runtime-reference/entity-schema/datasets.md +35 -0
  38. package/sdk-dist/docs/runtime-reference/entity-schema/datetime.md +40 -0
  39. package/sdk-dist/docs/runtime-reference/entity-schema/department.md +33 -0
  40. package/sdk-dist/docs/runtime-reference/entity-schema/departments.md +34 -0
  41. package/sdk-dist/docs/runtime-reference/entity-schema/divider.md +39 -0
  42. package/sdk-dist/docs/runtime-reference/entity-schema/file.md +53 -0
  43. package/sdk-dist/docs/runtime-reference/entity-schema/formula.md +44 -0
  44. package/sdk-dist/docs/runtime-reference/entity-schema/image.md +52 -0
  45. package/sdk-dist/docs/runtime-reference/entity-schema/linkto.md +67 -0
  46. package/sdk-dist/docs/runtime-reference/entity-schema/location.md +32 -0
  47. package/sdk-dist/docs/runtime-reference/entity-schema/lookup.md +41 -0
  48. package/sdk-dist/docs/runtime-reference/entity-schema/member.md +37 -0
  49. package/sdk-dist/docs/runtime-reference/entity-schema/members.md +31 -0
  50. package/sdk-dist/docs/runtime-reference/entity-schema/number.md +70 -0
  51. package/sdk-dist/docs/runtime-reference/entity-schema/query.md +50 -0
  52. package/sdk-dist/docs/runtime-reference/entity-schema/radio.md +53 -0
  53. package/sdk-dist/docs/runtime-reference/entity-schema/relation.md +55 -0
  54. package/sdk-dist/docs/runtime-reference/entity-schema/relationfield.md +38 -0
  55. package/sdk-dist/docs/runtime-reference/entity-schema/rollup.md +54 -0
  56. package/sdk-dist/docs/runtime-reference/entity-schema/select.md +63 -0
  57. package/sdk-dist/docs/runtime-reference/entity-schema/selects.md +51 -0
  58. package/sdk-dist/docs/runtime-reference/entity-schema/serialnumber.md +48 -0
  59. package/sdk-dist/docs/runtime-reference/entity-schema/signature.md +31 -0
  60. package/sdk-dist/docs/runtime-reference/entity-schema/status.md +70 -0
  61. package/sdk-dist/docs/runtime-reference/entity-schema/subform.md +74 -0
  62. package/sdk-dist/docs/runtime-reference/entity-schema/tags.md +19 -0
  63. package/sdk-dist/docs/runtime-reference/entity-schema/text.md +76 -0
  64. package/sdk-dist/docs/runtime-reference/entity-schema/textarea.md +47 -0
  65. package/sdk-dist/docs/runtime-reference/entity-schema/workflow_status.md +17 -0
  66. package/sdk-dist/docs/runtime-reference/entity-schema.md +197 -0
  67. package/sdk-dist/docs/runtime-reference/examples/README.md +51 -0
  68. package/sdk-dist/docs/runtime-reference/examples/crm-01/README.md +20 -0
  69. package/sdk-dist/docs/runtime-reference/examples/mes-01/README.md +21 -0
  70. package/sdk-dist/docs/runtime-reference/examples/oms-01/README.md +183 -0
  71. package/sdk-dist/docs/runtime-reference/examples/oms-01/app-overview.md +79 -0
  72. package/sdk-dist/docs/runtime-reference/examples/oms-01/create-app.json +3 -0
  73. package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.create-entity.json +3 -0
  74. package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.schema.json +159 -0
  75. package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.create-entity.json +3 -0
  76. package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.schema.json +179 -0
  77. package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.create-entity.json +3 -0
  78. package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.schema.json +168 -0
  79. package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.create-entity.json +3 -0
  80. package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.schema.json +417 -0
  81. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.bulk-update.json +22 -0
  82. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.create-entity.json +3 -0
  83. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.query.json +10 -0
  84. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.row.insert.json +28 -0
  85. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.schema.json +398 -0
  86. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.condition.json +13 -0
  87. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.ids.json +7 -0
  88. package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.create-entity.json +3 -0
  89. package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.schema.json +137 -0
  90. package/sdk-dist/docs/runtime-reference/examples/wms-01/README.md +21 -0
  91. package/sdk-dist/docs/runtime-reference/row-crud.md +188 -0
  92. package/sdk-dist/docs/runtime-reference/search-and-bulk-actions.md +494 -0
  93. package/sdk-dist/docs/runtime-reference/table-lifecycle.md +135 -0
  94. package/sdk-dist/docs/runtime-reference/uploads.md +106 -0
  95. package/sdk-dist/docs/runtime-reference/workflow/README.md +19 -0
  96. package/src/runtime/command_registry.ts +47 -0
  97. package/src/runtime/entity_save_schema.ts +708 -0
  98. package/src/runtime/errors.ts +12 -0
  99. package/src/runtime/execute.ts +367 -12
  100. package/src/runtime/upload.ts +196 -0
  101. package/src/runtime/zod_registry.ts +156 -0
  102. package/src/tests/command_registry.test.ts +6 -0
  103. package/src/tests/entity_save_schema.test.ts +236 -0
  104. package/src/tests/execute_validation.test.ts +781 -0
  105. package/src/tests/help.test.ts +60 -0
  106. package/src/tests/upload.test.ts +133 -0
@@ -0,0 +1,33 @@
1
+ # department
2
+
3
+ ## Purpose
4
+
5
+ Single-department field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: normal`
10
+ - `useFormula: true`
11
+ - `useRelation: true`
12
+ - `operator: department`
13
+ - `notImportAble: true`
14
+ - `notExportAble: true`
15
+ - `events: ['change']`
16
+
17
+ ## Minimal shape
18
+
19
+ ```json
20
+ {
21
+ "type": "department",
22
+ "options": {}
23
+ }
24
+ ```
25
+
26
+ ## Common options
27
+
28
+ - `placeholder`
29
+
30
+ ## Constraints
31
+
32
+ - `department` is a single-value field
33
+ - in the current direct-write path, `options` may contain only `placeholder`
@@ -0,0 +1,34 @@
1
+ # departments
2
+
3
+ ## Purpose
4
+
5
+ Multi-department field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: normal`
10
+ - `useFormula: true`
11
+ - `useRelation: true`
12
+ - `notImportAble: true`
13
+ - `notExportAble: true`
14
+ - `events: ['change']`
15
+
16
+ ## Minimal shape
17
+
18
+ ```json
19
+ {
20
+ "type": "departments",
21
+ "options": {
22
+ "placeholder": ""
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Common options
28
+
29
+ - `placeholder`
30
+
31
+ ## Constraints
32
+
33
+ - `departments` is a multi-value field
34
+ - in the current direct-write path, `options` may contain only `placeholder`
@@ -0,0 +1,39 @@
1
+ # divider
2
+
3
+ ## Purpose
4
+
5
+ Divider / visual grouping field.
6
+
7
+
8
+
9
+ ## Frontend capability flags
10
+
11
+ - `group: normal`
12
+ - `withoutFieldContainer: true`
13
+ - `custom_permissions: true`
14
+ - `hideInList: true`
15
+ - `readonly: true`
16
+ - `notImportAble: true`
17
+ - `notExportAble: true`
18
+
19
+ ## Minimal shape
20
+
21
+ ```json
22
+ {
23
+ "type": "divider",
24
+ "options": {
25
+ "color": "",
26
+ "style_id": ""
27
+ }
28
+ }
29
+ ```
30
+
31
+ ## Available options
32
+
33
+ - `color`
34
+ - `style_id`
35
+
36
+ ## Constraints
37
+
38
+ - In the current direct-write path, `options.style_id` and `options.color` should both be explicit
39
+ - `divider` is a display-only field and does not carry business values
@@ -0,0 +1,53 @@
1
+ # file
2
+
3
+ ## Purpose
4
+
5
+ File upload field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: advanced`
10
+ - `switchgroup: file`
11
+ - `notImportAble: true`
12
+ - `notExportAble: true`
13
+ - `events: ['change']`
14
+
15
+ ## Minimal shape
16
+
17
+ ```json
18
+ {
19
+ "type": "file",
20
+ "options": {
21
+ "placeholder": "",
22
+ "count_range": false,
23
+ "count_min": 0,
24
+ "count_max": 9
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Common options
30
+
31
+ - `placeholder`
32
+ - `count_range`
33
+ - `count_min`
34
+ - `count_max`
35
+ - `hideInList`
36
+
37
+ ## Constraints
38
+
39
+ - when `count_range=true`, it is recommended to provide both `count_min` and `count_max`
40
+ - `required` is controlled by generic field flags, not inside `options`
41
+ - when count limits are disabled in the current direct-write path, use:
42
+ - `count_range: false`
43
+ - `count_min: 0`
44
+ - `count_max: 9`
45
+
46
+ ## Row write rule
47
+
48
+ When inserting or updating row data for a `file` field:
49
+
50
+ - do not construct upload payload objects by hand
51
+ - run `arcubase upload <local-file>` first
52
+ - use the returned `data` array directly as the row field value
53
+ - read `../uploads.md`
@@ -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,52 @@
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`
44
+
45
+ ## Row write rule
46
+
47
+ When inserting or updating row data for an `image` field:
48
+
49
+ - do not construct upload payload objects by hand
50
+ - run `arcubase upload <local-file>` first
51
+ - use the returned `data` array directly as the row field value
52
+ - read `../uploads.md`
@@ -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`