@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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=upload.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.test.d.ts","sourceRoot":"","sources":["../../src/tests/upload.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,107 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import fs from 'fs';
4
+ import os from 'os';
5
+ import path from 'path';
6
+ import { executeCLI } from '../runtime/execute.js';
7
+ const env = {
8
+ ARCUBASE_BASE_URL: 'https://arcubase.example.com',
9
+ ARCUBASE_TENANT_ID: 'tenant_1',
10
+ ARCUBASE_ACCESS_TOKEN: 'tok',
11
+ ARCUBASE_TRACE_ID: '',
12
+ ARCUBASE_SUBJECT_TYPE: '',
13
+ ARCUBASE_SUBJECT_ID: '',
14
+ ARCUBASE_TOKEN_EXPIRES_AT: '',
15
+ };
16
+ test('upload help works without runtime env', async () => {
17
+ const out = await executeCLI('user', ['upload', '--help'], undefined, async () => new Response('{}'));
18
+ assert.equal(out.kind, 'help');
19
+ assert.match(out.text, /arcubase upload <local-file>/);
20
+ assert.match(out.text, /uploads\.md/);
21
+ });
22
+ test('upload returns file field value array for row payloads', async () => {
23
+ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'arcubase-upload-'));
24
+ const sourceFile = path.join(tempDir, 'contract.pdf');
25
+ fs.writeFileSync(sourceFile, 'fake pdf bytes');
26
+ const calls = [];
27
+ const result = await executeCLI('user', ['upload', sourceFile], env, async (input, init) => {
28
+ const url = String(input);
29
+ calls.push({ url, method: init?.method });
30
+ if (url === 'https://arcubase.example.com/upload/token') {
31
+ return new Response(JSON.stringify({
32
+ data: {
33
+ id: 123456,
34
+ mode: 'aliyun-oss',
35
+ token_data: {
36
+ dir: 'upload/123456/',
37
+ policy: 'policy',
38
+ accessid: 'accessid',
39
+ signature: 'signature',
40
+ host: 'https://uploads.example.com',
41
+ },
42
+ },
43
+ }), { status: 200, headers: { 'Content-Type': 'application/json' } });
44
+ }
45
+ if (url === 'https://uploads.example.com') {
46
+ return new Response('', { status: 200 });
47
+ }
48
+ throw new Error(`unexpected fetch url: ${url}`);
49
+ });
50
+ assert.equal(result.kind, 'result');
51
+ assert.deepEqual(calls, [
52
+ { url: 'https://arcubase.example.com/upload/token', method: 'POST' },
53
+ { url: 'https://uploads.example.com', method: 'POST' },
54
+ ]);
55
+ assert.deepEqual(result.data, [
56
+ {
57
+ upload_id: 123456,
58
+ file: 'contract.pdf',
59
+ file_name: 'contract.pdf',
60
+ meta: {},
61
+ },
62
+ ]);
63
+ });
64
+ test('upload supports s3-post-policy tokens', async () => {
65
+ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'arcubase-upload-s3-'));
66
+ const sourceFile = path.join(tempDir, 'contract.pdf');
67
+ fs.writeFileSync(sourceFile, 'fake pdf bytes');
68
+ const calls = [];
69
+ const result = await executeCLI('user', ['upload', sourceFile], env, async (input, init) => {
70
+ const url = String(input);
71
+ calls.push({ url, method: init?.method });
72
+ if (url === 'https://arcubase.example.com/upload/token') {
73
+ return new Response(JSON.stringify({
74
+ data: {
75
+ id: 654321,
76
+ mode: 's3-post-policy',
77
+ token_data: {
78
+ dir: 'upload/654321/',
79
+ policy: 'policy',
80
+ host: 'https://uploads.example.com/private-bucket',
81
+ x_amz_algorithm: 'AWS4-HMAC-SHA256',
82
+ x_amz_credential: 'test/20260504/us-east-1/s3/aws4_request',
83
+ x_amz_date: '20260504T010203Z',
84
+ x_amz_signature: 'abc123',
85
+ },
86
+ },
87
+ }), { status: 200, headers: { 'Content-Type': 'application/json' } });
88
+ }
89
+ if (url === 'https://uploads.example.com/private-bucket') {
90
+ return new Response('', { status: 200 });
91
+ }
92
+ throw new Error(`unexpected fetch url: ${url}`);
93
+ });
94
+ assert.equal(result.kind, 'result');
95
+ assert.deepEqual(calls, [
96
+ { url: 'https://arcubase.example.com/upload/token', method: 'POST' },
97
+ { url: 'https://uploads.example.com/private-bucket', method: 'POST' },
98
+ ]);
99
+ assert.deepEqual(result.data, [
100
+ {
101
+ upload_id: 654321,
102
+ file: 'contract.pdf',
103
+ file_name: 'contract.pdf',
104
+ meta: {},
105
+ },
106
+ ]);
107
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carthooks/arcubase-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Arcubase runtime CLI for admin and user command execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,187 @@
1
+ # Arcubase CLI Runtime Reference
2
+
3
+ This documentation set is for using `arcubase-admin` and `arcubase` directly.
4
+
5
+ Read it as a command cheatsheet:
6
+
7
+ - which binary to use
8
+ - which subcommand to run
9
+ - which flags are required
10
+ - what the body file should look like
11
+ - what result shape to expect
12
+
13
+ Do not start from raw HTTP methods or paths. Start from the CLI command.
14
+
15
+ ## Paths
16
+
17
+ - Development source:
18
+ - `misc/packages/@carthooks/arcubase-cli/docs/runtime-reference/`
19
+ - Runtime location:
20
+ - `/opt/arcubase-sdk/docs/runtime-reference/`
21
+ - Published path:
22
+ - `sdk-dist/docs/runtime-reference/`
23
+
24
+ ## Which binary to use
25
+
26
+ Use `arcubase-admin` for:
27
+
28
+ - app creation
29
+ - entity shell creation
30
+ - entity schema save
31
+ - entity tag admin actions
32
+
33
+ Common commands:
34
+
35
+ ```bash
36
+ arcubase-admin app create-app-by-tenants --body-file create-app.json
37
+ arcubase-admin app create-entity --id <app_id> --body-file create-entity.json
38
+ arcubase-admin entity admin-get-entity-info --app-id <app_id> --entity-id <entity_id>
39
+ arcubase-admin entity admin-save-entity --app-id <app_id> --entity-id <entity_id> --body-file save-entity.json
40
+ arcubase-admin entity-tags get-selection-tags --appId <app_id> --entityId <entity_id> --body-file get-tags.json
41
+ ```
42
+
43
+ Use `arcubase` for:
44
+
45
+ - row insert
46
+ - row query
47
+ - row update
48
+ - row delete / restore
49
+ - search
50
+ - selection actions
51
+ - bulk update
52
+ - batch operator
53
+
54
+ Common commands:
55
+
56
+ ```bash
57
+ arcubase workflow insert-entity --app-id <app_id> --entity-id <entity_id> --body-file insert.json
58
+ arcubase workflow query-entity --app-id <app_id> --entity-id <entity_id> --body-file query.json
59
+ arcubase workflow update-entity-row --app-id <app_id> --entity-id <entity_id> --row-id <row_id> --body-file update.json
60
+ arcubase workflow delete-entity-row --app-id <app_id> --entity-id <entity_id> --body-file delete.json
61
+ arcubase workflow restore-entity-row --app-id <app_id> --entity-id <entity_id> --body-file restore.json
62
+ arcubase workflow query-entity-selection --app-id <app_id> --entity-id <entity_id> --action archive --body-file selection.json
63
+ arcubase entity update-entity-bulk --app-id <app_id> --entity-id <entity_id> --body-file bulk-update.json
64
+ arcubase entity invoke-entity-batch-operator --app-id <app_id> --entity-id <entity_id> --body-file invoke-batch-operator.json
65
+ ```
66
+
67
+ Hard rule:
68
+
69
+ - `arcubase-admin` stops at schema save
70
+ - all row operations must switch to `arcubase`
71
+ - do not use `arcubase-admin workflow insert-entity`
72
+ - do not use `arcubase-admin workflow query-entity`
73
+
74
+ ## Required file inputs
75
+
76
+ Most write commands use:
77
+
78
+ - `--body-file <file>.json`
79
+
80
+ Some query commands also use:
81
+
82
+ - `--query-file <file>.json`
83
+
84
+ Use `--query-file` when the command needs query-string parameters that do not belong in the JSON body.
85
+
86
+ Current important example:
87
+
88
+ ```bash
89
+ arcubase workflow query-entity \
90
+ --app-id <app_id> \
91
+ --entity-id <entity_id> \
92
+ --query-file archived-query.json \
93
+ --body-file archived-body.json
94
+ ```
95
+
96
+ ## Runtime env
97
+
98
+ The CLIs accept either generic env keys:
99
+
100
+ - `ARCUBASE_BASE_URL`
101
+ - `ARCUBASE_TENANT_ID`
102
+ - `ARCUBASE_ACCESS_TOKEN`
103
+ - `ARCUBASE_HOST`
104
+
105
+ or scoped env keys:
106
+
107
+ - admin:
108
+ - `ARCUBASE_ADMIN_BASE_URL`
109
+ - `ARCUBASE_ADMIN_TENANT_ID`
110
+ - `ARCUBASE_ADMIN_ACCESS_TOKEN`
111
+ - `ARCUBASE_ADMIN_HOST`
112
+ - user:
113
+ - `ARCUBASE_USER_BASE_URL`
114
+ - `ARCUBASE_USER_TENANT_ID`
115
+ - `ARCUBASE_USER_ACCESS_TOKEN`
116
+ - `ARCUBASE_USER_HOST`
117
+
118
+ Help should work without runtime env:
119
+
120
+ ```bash
121
+ arcubase-admin --help
122
+ arcubase-admin <module> --help
123
+ arcubase-admin <module> <command> --help
124
+ arcubase --help
125
+ arcubase <module> --help
126
+ arcubase <module> <command> --help
127
+ ```
128
+
129
+ Command help is also the discovery entrypoint for this doc set.
130
+
131
+ When a command is tied to a common task, `--help` should print:
132
+
133
+ - the normalized external endpoint
134
+ - required path and scalar flags
135
+ - whether `--query-file` is supported
136
+ - direct links to the most relevant runtime reference pages
137
+ - direct links to business-shaped examples when available
138
+
139
+ ## Reading order by task
140
+
141
+ If you need to create a table:
142
+
143
+ 1. read `table-lifecycle.md`
144
+ 2. read `entity-schema.md`
145
+ 3. read `entity-schema/README.md`
146
+ 4. open the exact field-type page you need
147
+
148
+ If you need row CRUD:
149
+
150
+ 1. read `row-crud.md`
151
+ 2. if the row contains a file or image field, read `uploads.md`
152
+ 3. if a field is complex, open the exact field-type page
153
+
154
+ If you need a business-shaped template:
155
+
156
+ 1. read `examples/README.md`
157
+ 2. pick the closest domain directory
158
+ 3. copy and adapt the example schema and payload files
159
+
160
+ If you need search, selection, tags, bulk update, or batch operator:
161
+
162
+ 1. read `search-and-bulk-actions.md`
163
+ 2. use `row-crud.md` only for row result shapes
164
+
165
+ ## Covered now
166
+
167
+ - `table-lifecycle.md`
168
+ - app shell, entity shell, schema save, readiness probe
169
+ - `entity-schema.md`
170
+ - full save-ready schema rules
171
+ - `entity-schema/README.md`
172
+ - field index and how to use field docs
173
+ - `entity-schema/*.md`
174
+ - one field cheatsheet per file
175
+ - `row-crud.md`
176
+ - insert, query, update, delete, restore
177
+ - `uploads.md`
178
+ - upload one local file and reuse the returned field value in row payloads
179
+ - `search-and-bulk-actions.md`
180
+ - search, selection, tags, bulk update, batch operator
181
+ - `examples/`
182
+ - business-shaped schema and payload templates
183
+
184
+ ## Reserved expansion
185
+
186
+ - `workflow/README.md`
187
+ - reserved for future workflow-specific CLI docs
@@ -0,0 +1,120 @@
1
+ # Entity Schema Field Reference
2
+
3
+ Use this directory while building `save-entity.json` for:
4
+
5
+ ```bash
6
+ arcubase-admin entity admin-save-entity \
7
+ --app-id <app_id> \
8
+ --entity-id <entity_id> \
9
+ --body-file save-entity.json
10
+ ```
11
+
12
+ ## How to use these field pages
13
+
14
+ 1. fetch the current shell with:
15
+
16
+ ```bash
17
+ arcubase-admin entity admin-get-entity-info \
18
+ --app-id <app_id> \
19
+ --entity-id <entity_id>
20
+ ```
21
+
22
+ 2. build the top-level save payload with:
23
+
24
+ - `entity-schema.md`
25
+
26
+ 3. open the exact field page you need
27
+
28
+ 4. copy the field-specific `options` shape into the full base `FieldVO`
29
+
30
+ These field pages do **not** replace the full base field shape. They only explain the field-specific part.
31
+
32
+ ## Global save rules
33
+
34
+ - `fields` must be `FieldVO[]`
35
+ - field ids should start from `1001`
36
+ - field ids must be non-zero
37
+ - `field_id_seq > max(field.id)`
38
+ - top-level `layout` may only reference top-level field ids
39
+ - non-`subform` fields should use `children: null`
40
+ - saved `subform` payload keeps `children` only
41
+ - `lookup/rollup.local_linkto_field_id` must point to a `linkto` field
42
+ - formula references must point to existing field ids
43
+ - `schema_version` should come from the current shell
44
+ - if the response contains a top-level `error`, the save failed even when HTTP is `200`
45
+
46
+ ## Row CRUD reminder
47
+
48
+ These field pages are for schema save.
49
+
50
+ If you need row payloads, read:
51
+
52
+ - `../row-crud.md`
53
+
54
+ Current important row rules:
55
+
56
+ - row delete / restore uses:
57
+ - `arcubase workflow delete-entity-row`
58
+ - `arcubase workflow restore-entity-row`
59
+ - `selection.type = "ids"`
60
+ - `subform` row values use:
61
+ - `[{ "id": 0, "fields": { ... } }]`
62
+
63
+ ## Field index
64
+
65
+ ### Basic types
66
+
67
+ - [`text`](./text.md)
68
+ - [`textarea`](./textarea.md)
69
+ - [`number`](./number.md)
70
+ - [`datetime`](./datetime.md)
71
+ - [`boolean`](./boolean.md)
72
+
73
+ ### Enum and status
74
+
75
+ - [`radio`](./radio.md)
76
+ - [`checkbox`](./checkbox.md)
77
+ - [`select`](./select.md)
78
+ - [`selects`](./selects.md)
79
+ - [`status`](./status.md)
80
+
81
+ ### Structure and display
82
+
83
+ - [`divider`](./divider.md)
84
+ - [`subform`](./subform.md)
85
+ - [`button`](./button.md)
86
+
87
+ ### File and media
88
+
89
+ - [`image`](./image.md)
90
+ - [`file`](./file.md)
91
+ - [`signature`](./signature.md)
92
+
93
+ ### Geography and external data
94
+
95
+ - [`address`](./address.md)
96
+ - [`datasets`](./datasets.md)
97
+ - [`location`](./location.md)
98
+
99
+ ### People and organization
100
+
101
+ - [`member`](./member.md)
102
+ - [`members`](./members.md)
103
+ - [`department`](./department.md)
104
+ - [`departments`](./departments.md)
105
+
106
+ ### Relations and computation
107
+
108
+ - [`linkto`](./linkto.md)
109
+ - [`relation`](./relation.md)
110
+ - [`relationfield`](./relationfield.md)
111
+ - [`query`](./query.md)
112
+ - [`lookup`](./lookup.md)
113
+ - [`rollup`](./rollup.md)
114
+ - [`formula`](./formula.md)
115
+
116
+ ### Other advanced types
117
+
118
+ - [`serialnumber`](./serialnumber.md)
119
+ - [`workflow_status`](./workflow_status.md)
120
+ - [`tags`](./tags.md)
@@ -0,0 +1,34 @@
1
+ # address
2
+
3
+ ## Purpose
4
+
5
+ Hierarchical address selection field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: advanced`
10
+ - `useFormula: true`
11
+ - `useRelation: true`
12
+
13
+ ## Minimal shape
14
+
15
+ ```json
16
+ {
17
+ "type": "address",
18
+ "options": {
19
+ "dataset_id": 1,
20
+ "maxDepth": 3
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## Common options
26
+
27
+ - `dataset_id`
28
+ - `maxDepth`
29
+
30
+ ## Constraints
31
+
32
+ - `dataset_id` is required
33
+ - common `maxDepth` values are `1` to `4`
34
+ - if `maxDepth` is omitted, prefer `3`
@@ -0,0 +1,37 @@
1
+ # boolean
2
+
3
+ ## Purpose
4
+
5
+ Boolean field.
6
+
7
+
8
+
9
+ ## Frontend capability flags
10
+
11
+ - `group: normal`
12
+ - `switchgroup: enum`
13
+ - `useFormula: true`
14
+ - `useRelation: true`
15
+ - `inlineEdtiable: true`
16
+ - `events: ['change']`
17
+
18
+ ## Minimal shape
19
+
20
+ ```json
21
+ {
22
+ "type": "boolean",
23
+ "options": {}
24
+ }
25
+ ```
26
+
27
+ ## Available options
28
+
29
+ - There is currently no stable complex `options` contract
30
+
31
+ ## Constraints
32
+
33
+ - In the current direct-write pathprefer empty `options`
34
+ - only use generic field flags for:
35
+ - `required`
36
+ - `visible`
37
+ - `editable`
@@ -0,0 +1,47 @@
1
+ # button
2
+
3
+ ## Purpose
4
+
5
+ Button field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: advanced`
10
+ - `custom_permissions: true`
11
+ - `notImportAble: true`
12
+ - `notExportAble: true`
13
+ - `events: ['click']`
14
+
15
+ ## Minimal shape
16
+
17
+ ```json
18
+ {
19
+ "type": "button",
20
+ "options": {
21
+ "label": "Button",
22
+ "hideInList": false,
23
+ "perm": {
24
+ "create": true,
25
+ "edit": true,
26
+ "list": true,
27
+ "view": true
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ## Common options
34
+
35
+ - `label`
36
+ - `hideInList`
37
+ - `perm.create`
38
+ - `perm.edit`
39
+ - `perm.list`
40
+ - `perm.view`
41
+
42
+ ## Constraints
43
+
44
+ - `label` is required
45
+ - `perm` should explicitly include all four boolean flags
46
+ - `hideInList` should stay consistent with `perm.list`
47
+ - Button behavior is bound through top-level `options.FrontendEvents`, not written directly in the field body
@@ -0,0 +1,61 @@
1
+ # checkbox
2
+
3
+ ## Purpose
4
+
5
+ Multi-select enum field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: normal`
10
+ - `useFormula: true`
11
+ - `useRelation: true`
12
+ - `events: ['change']`
13
+
14
+ ## Minimal shape
15
+
16
+ ```json
17
+ {
18
+ "type": "checkbox",
19
+ "options": {
20
+ "horizontal": false,
21
+ "options": {
22
+ "mode": "custom",
23
+ "colorful": false,
24
+ "items": [
25
+ { "key": 1, "value": "Option 1" }
26
+ ]
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Common options
33
+
34
+ - `horizontal`
35
+ - `hideInList`
36
+ - `options.items`
37
+ - `options.mode`
38
+ - `options.colorful`
39
+ - `options.has_other`
40
+ - `options.other_label`
41
+
42
+ ## Constraints
43
+
44
+ - `options.items` at least one item
45
+ - when `options.has_other = true`, also provide `options.other_label`
46
+ - row values should be an array of selected option values
47
+
48
+ ## Save-ready reminder
49
+
50
+ For `arcubase-admin entity admin-save-entity`, keep the full base `FieldVO`.
51
+
52
+ The saved field still needs:
53
+
54
+ - `id`
55
+ - `label`
56
+ - `required`
57
+ - `editable`
58
+ - `visible`
59
+ - `number_decimal`
60
+ - `key`
61
+ - `children: null`
@@ -0,0 +1,35 @@
1
+ # datasets
2
+
3
+ ## Purpose
4
+
5
+ Dataset picker field.
6
+
7
+ ## Frontend capability flags
8
+
9
+ - `group: advanced`
10
+ - `useFormula: true`
11
+ - `useRelation: true`
12
+ - `inlineEdtiable: true`
13
+ - `events: ['change']`
14
+
15
+ ## Minimal shape
16
+
17
+ ```json
18
+ {
19
+ "type": "datasets",
20
+ "options": {
21
+ "dataset_id": 0,
22
+ "maxDepth": 0
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Common options
28
+
29
+ - `dataset_id`
30
+ - `maxDepth`
31
+
32
+ ## Constraints
33
+
34
+ - `dataset_id` is required
35
+ - if `maxDepth` is omitted, prefer `3`
@@ -0,0 +1,40 @@
1
+ # datetime
2
+
3
+ ## Purpose
4
+
5
+ Date-time field.
6
+
7
+
8
+
9
+ ## Frontend capability flags
10
+
11
+ - `group: normal`
12
+ - `useFormula: true`
13
+ - `useRelation: true`
14
+ - `inlineEdtiable: true`
15
+ - `events: ['change']`
16
+
17
+ ## Minimal shape
18
+
19
+ ```json
20
+ {
21
+ "type": "datetime",
22
+ "options": {
23
+ "placeholder": "",
24
+ "type": "datetime"
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Available options
30
+
31
+ - `placeholder`
32
+ - `type`
33
+
34
+ ## Constraints
35
+
36
+ - in the current direct-write path, valid `type` values are:
37
+ - `date`
38
+ - `datetime`
39
+ - if omitted, prefer `date`
40
+ - if a default is written into `value`, it should match a value accepted by the frontend date picker