@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,186 @@
|
|
|
1
|
+
# Row CRUD
|
|
2
|
+
|
|
3
|
+
Use this page for direct row operations with `arcubase`.
|
|
4
|
+
|
|
5
|
+
## Insert a row
|
|
6
|
+
|
|
7
|
+
Command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
arcubase workflow insert-entity \
|
|
11
|
+
--app-id <app_id> \
|
|
12
|
+
--entity-id <entity_id> \
|
|
13
|
+
--body-file insert.json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Minimal `insert.json`:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"fields": {
|
|
21
|
+
"1001": "ORD-001",
|
|
22
|
+
"1002": 12,
|
|
23
|
+
"1003": 1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Rules:
|
|
29
|
+
|
|
30
|
+
- use numeric field ids as JSON object keys
|
|
31
|
+
- values must match the saved schema
|
|
32
|
+
|
|
33
|
+
Success result:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"data": 4000000046
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The returned value is the new `row_id`.
|
|
42
|
+
|
|
43
|
+
## Query rows
|
|
44
|
+
|
|
45
|
+
Command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
arcubase workflow query-entity \
|
|
49
|
+
--app-id <app_id> \
|
|
50
|
+
--entity-id <entity_id> \
|
|
51
|
+
--body-file query.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Minimal `query.json`:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"limit": 20,
|
|
59
|
+
"offset": 0
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Rules:
|
|
64
|
+
|
|
65
|
+
- do not use `viewMode`
|
|
66
|
+
- if you need the view selector, use `view_mode`
|
|
67
|
+
- if you need archived view, also pass `--query-file`
|
|
68
|
+
|
|
69
|
+
Typical row shape:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"id": 4000000046,
|
|
74
|
+
"fields": {
|
|
75
|
+
"1001": "ORD-001",
|
|
76
|
+
"1002": 99,
|
|
77
|
+
"1003": 1
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Read one row
|
|
83
|
+
|
|
84
|
+
Command:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
arcubase workflow get-entity-row \
|
|
88
|
+
--app-id <app_id> \
|
|
89
|
+
--entity-id <entity_id> \
|
|
90
|
+
--row-id <row_id>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Use this when you already know the row id and want the full record payload.
|
|
94
|
+
|
|
95
|
+
## Update a row
|
|
96
|
+
|
|
97
|
+
Command:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
arcubase workflow update-entity-row \
|
|
101
|
+
--app-id <app_id> \
|
|
102
|
+
--entity-id <entity_id> \
|
|
103
|
+
--row-id <row_id> \
|
|
104
|
+
--body-file update.json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Minimal `update.json`:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"data": {
|
|
112
|
+
"1002": 99
|
|
113
|
+
},
|
|
114
|
+
"changed_fields": [1002]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Rules:
|
|
119
|
+
|
|
120
|
+
- use `data`, not `fields`
|
|
121
|
+
- `changed_fields` is required
|
|
122
|
+
- every id in `changed_fields` must also appear in `data`
|
|
123
|
+
- use numeric field ids as JSON object keys
|
|
124
|
+
|
|
125
|
+
Success result:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"data": true
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The update command returns `true`, not the updated row body.
|
|
134
|
+
|
|
135
|
+
## Delete rows
|
|
136
|
+
|
|
137
|
+
Command:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
arcubase workflow delete-entity-row \
|
|
141
|
+
--app-id <app_id> \
|
|
142
|
+
--entity-id <entity_id> \
|
|
143
|
+
--body-file delete.json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Minimal `delete.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"selection": {
|
|
151
|
+
"type": "ids",
|
|
152
|
+
"ids": [4000000046],
|
|
153
|
+
"length": 1
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Rules:
|
|
159
|
+
|
|
160
|
+
- use `selection.type = "ids"`
|
|
161
|
+
- when `length` is provided, keep it equal to `ids.length`
|
|
162
|
+
|
|
163
|
+
## Restore rows
|
|
164
|
+
|
|
165
|
+
Command:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
arcubase workflow restore-entity-row \
|
|
169
|
+
--app-id <app_id> \
|
|
170
|
+
--entity-id <entity_id> \
|
|
171
|
+
--body-file restore.json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Minimal `restore.json`:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"selection": {
|
|
179
|
+
"type": "ids",
|
|
180
|
+
"ids": [4000000046],
|
|
181
|
+
"length": 1
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The same `selection` rules apply as delete.
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
# Search And Bulk Actions
|
|
2
|
+
|
|
3
|
+
Use this page for:
|
|
4
|
+
|
|
5
|
+
- search
|
|
6
|
+
- selection actions
|
|
7
|
+
- archived queries
|
|
8
|
+
- bulk update
|
|
9
|
+
- selection tags
|
|
10
|
+
- batch operator
|
|
11
|
+
|
|
12
|
+
## Main query command
|
|
13
|
+
|
|
14
|
+
Use:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
arcubase workflow query-entity \
|
|
18
|
+
--app-id <app_id> \
|
|
19
|
+
--entity-id <entity_id> \
|
|
20
|
+
--body-file query.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For extra query-string parameters, also use:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
--query-file query-extra.json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Text search
|
|
30
|
+
|
|
31
|
+
`query.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"limit": 20,
|
|
36
|
+
"offset": 0,
|
|
37
|
+
"search": {
|
|
38
|
+
"text_search": "ORD-3001"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This is the current success path for free-text search.
|
|
44
|
+
|
|
45
|
+
## Sorts
|
|
46
|
+
|
|
47
|
+
`query.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"limit": 20,
|
|
52
|
+
"offset": 0,
|
|
53
|
+
"sorts": [
|
|
54
|
+
{ "column": ":1002", "order": "desc" }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Rules:
|
|
60
|
+
|
|
61
|
+
- use field columns as `:<field_id>`
|
|
62
|
+
- `order` should be `asc` or `desc`
|
|
63
|
+
|
|
64
|
+
## Deleted view
|
|
65
|
+
|
|
66
|
+
`query.json`:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"limit": 20,
|
|
71
|
+
"offset": 0,
|
|
72
|
+
"view_mode": "deleted"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Archived view
|
|
77
|
+
|
|
78
|
+
Archived view requires both:
|
|
79
|
+
|
|
80
|
+
- `--body-file archived-body.json`
|
|
81
|
+
- `--query-file archived-query.json`
|
|
82
|
+
|
|
83
|
+
Command:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
arcubase workflow query-entity \
|
|
87
|
+
--app-id <app_id> \
|
|
88
|
+
--entity-id <entity_id> \
|
|
89
|
+
--query-file archived-query.json \
|
|
90
|
+
--body-file archived-body.json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`archived-body.json`:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"limit": 20,
|
|
98
|
+
"offset": 0,
|
|
99
|
+
"view_mode": "archived"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`archived-query.json`:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"ym": "202605"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Rules:
|
|
112
|
+
|
|
113
|
+
- `ym` is required
|
|
114
|
+
- `ym` format is `YYYYMM`
|
|
115
|
+
|
|
116
|
+
## Selection with explicit ids
|
|
117
|
+
|
|
118
|
+
Use this when you already know the row ids.
|
|
119
|
+
|
|
120
|
+
Selection fragment:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"selection": {
|
|
125
|
+
"type": "ids",
|
|
126
|
+
"ids": [4000000111],
|
|
127
|
+
"length": 1
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Rules:
|
|
133
|
+
|
|
134
|
+
- `length` should match `ids.length`
|
|
135
|
+
- this is the safest path for delete, restore, tags, and targeted bulk actions
|
|
136
|
+
|
|
137
|
+
## Selection with conditions
|
|
138
|
+
|
|
139
|
+
Use this when the action should apply to the current filtered result set.
|
|
140
|
+
|
|
141
|
+
This shape is **not** the same as `query.json.search`.
|
|
142
|
+
|
|
143
|
+
Use route-query style keys inside `selection.condition`:
|
|
144
|
+
|
|
145
|
+
- `q`
|
|
146
|
+
- `tab`
|
|
147
|
+
- `filter_:<field_id_or_prop>`
|
|
148
|
+
|
|
149
|
+
Example with `q`:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"selection": {
|
|
154
|
+
"type": "condition",
|
|
155
|
+
"length": 1,
|
|
156
|
+
"condition": {
|
|
157
|
+
"q": "A-bts3",
|
|
158
|
+
"selectAll": true
|
|
159
|
+
},
|
|
160
|
+
"sorts": [
|
|
161
|
+
{ "column": ":1002", "order": "desc" }
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Example with `filter_:...`:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"selection": {
|
|
172
|
+
"type": "condition",
|
|
173
|
+
"length": 1,
|
|
174
|
+
"condition": {
|
|
175
|
+
"filter_:1001": "%7B%22is%22%3A%22A-bts2%22%7D",
|
|
176
|
+
"selectAll": true
|
|
177
|
+
},
|
|
178
|
+
"sorts": [
|
|
179
|
+
{ "column": ":1002", "order": "desc" }
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Rules:
|
|
186
|
+
|
|
187
|
+
- `condition.selectAll` must be `true`
|
|
188
|
+
- do not use `text_search` inside `selection.condition`
|
|
189
|
+
- `filter_:...` values should be URL-encoded JSON strings
|
|
190
|
+
- keep `length` equal to the intended matched count
|
|
191
|
+
- include `sorts` when your selection came from a sorted list view
|
|
192
|
+
|
|
193
|
+
## Query selected rows
|
|
194
|
+
|
|
195
|
+
Command:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
arcubase workflow query-entity-selection \
|
|
199
|
+
--app-id <app_id> \
|
|
200
|
+
--entity-id <entity_id> \
|
|
201
|
+
--action query \
|
|
202
|
+
--body-file query-selection.json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Working `query-selection.json` with ids:
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"selection": {
|
|
210
|
+
"type": "ids",
|
|
211
|
+
"ids": [4000000127],
|
|
212
|
+
"length": 1
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Working `query-selection.json` with all:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"selection": {
|
|
222
|
+
"type": "all"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Rules:
|
|
228
|
+
|
|
229
|
+
- use `selection.type = "ids"` when you know exact row ids
|
|
230
|
+
- use `selection.type = "all"` to query the current result set
|
|
231
|
+
- do not use `selection.type = "condition"` for `--action query`
|
|
232
|
+
|
|
233
|
+
## Archive by selection
|
|
234
|
+
|
|
235
|
+
Command:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
arcubase workflow query-entity-selection \
|
|
239
|
+
--app-id <app_id> \
|
|
240
|
+
--entity-id <entity_id> \
|
|
241
|
+
--action archive \
|
|
242
|
+
--body-file archive-selection.json
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Rules:
|
|
246
|
+
|
|
247
|
+
- use `ids`, or `condition` with `selectAll: true` plus at least one real filter key
|
|
248
|
+
- do not use `selection.type = "all"`
|
|
249
|
+
- do not use `condition` with only `selectAll: true`
|
|
250
|
+
|
|
251
|
+
## Batch print selection
|
|
252
|
+
|
|
253
|
+
Command:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
arcubase workflow query-entity-selection \
|
|
257
|
+
--app-id <app_id> \
|
|
258
|
+
--entity-id <entity_id> \
|
|
259
|
+
--action batch_print \
|
|
260
|
+
--body-file batch-print-selection.json
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Working shape:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"policy_id": "",
|
|
268
|
+
"selection": {
|
|
269
|
+
"type": "ids",
|
|
270
|
+
"ids": [4000000127],
|
|
271
|
+
"length": 1
|
|
272
|
+
},
|
|
273
|
+
"offset": 0,
|
|
274
|
+
"limit": 10
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Bulk update
|
|
279
|
+
|
|
280
|
+
Command:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
arcubase entity update-entity-bulk \
|
|
284
|
+
--app-id <app_id> \
|
|
285
|
+
--entity-id <entity_id> \
|
|
286
|
+
--body-file bulk-update.json
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Working `bulk-update.json` with ids:
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"selection": {
|
|
294
|
+
"type": "ids",
|
|
295
|
+
"ids": [4000000104],
|
|
296
|
+
"length": 1
|
|
297
|
+
},
|
|
298
|
+
"fields": [
|
|
299
|
+
{
|
|
300
|
+
"id": 1002,
|
|
301
|
+
"action": {
|
|
302
|
+
"type": "number_add",
|
|
303
|
+
"number_add": 10
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Working `bulk-update.json` with conditions:
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"selection": {
|
|
315
|
+
"type": "condition",
|
|
316
|
+
"length": 1,
|
|
317
|
+
"condition": {
|
|
318
|
+
"q": "A-bts3",
|
|
319
|
+
"selectAll": true
|
|
320
|
+
},
|
|
321
|
+
"sorts": [
|
|
322
|
+
{ "column": ":1002", "order": "desc" }
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"fields": [
|
|
326
|
+
{
|
|
327
|
+
"id": 1002,
|
|
328
|
+
"action": {
|
|
329
|
+
"type": "number_add",
|
|
330
|
+
"number_add": 2
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Working `bulk-update.json` for a select or status field:
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"selection": {
|
|
342
|
+
"type": "condition",
|
|
343
|
+
"length": 1,
|
|
344
|
+
"condition": {
|
|
345
|
+
"q": "SO-1001",
|
|
346
|
+
"selectAll": true
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"fields": [
|
|
350
|
+
{
|
|
351
|
+
"id": 1015,
|
|
352
|
+
"action": {
|
|
353
|
+
"type": "set",
|
|
354
|
+
"value": "Confirmed"
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Current reliable action types:
|
|
362
|
+
|
|
363
|
+
- `set`
|
|
364
|
+
- `text_replace`
|
|
365
|
+
- `text_append`
|
|
366
|
+
- `text_prepend`
|
|
367
|
+
- `number_add`
|
|
368
|
+
- `number_sub`
|
|
369
|
+
- `number_mul`
|
|
370
|
+
- `datetime_add`
|
|
371
|
+
- `datetime_sub`
|
|
372
|
+
- `datetime_now`
|
|
373
|
+
- `formula`
|
|
374
|
+
|
|
375
|
+
Rules:
|
|
376
|
+
|
|
377
|
+
- use `type: set` when you want to assign a new scalar value directly
|
|
378
|
+
- for `type: set`, send the new value as `action.value`
|
|
379
|
+
- do not use `type: value`
|
|
380
|
+
|
|
381
|
+
## Selection tags
|
|
382
|
+
|
|
383
|
+
These commands use `arcubase-admin`.
|
|
384
|
+
|
|
385
|
+
Get tags:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
arcubase-admin entity-tags get-selection-tags \
|
|
389
|
+
--appId <app_id> \
|
|
390
|
+
--entityId <entity_id> \
|
|
391
|
+
--body-file get-tags.json
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
`get-tags.json`:
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"policy_id": "",
|
|
399
|
+
"selection": {
|
|
400
|
+
"type": "ids",
|
|
401
|
+
"ids": [4000000127],
|
|
402
|
+
"length": 1
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Add tags:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
arcubase-admin entity-tags batch-add-entity-tags \
|
|
411
|
+
--appId <app_id> \
|
|
412
|
+
--entityId <entity_id> \
|
|
413
|
+
--body-file add-tags.json
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
`add-tags.json`:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"policy_id": "",
|
|
421
|
+
"selection": {
|
|
422
|
+
"type": "ids",
|
|
423
|
+
"ids": [4000000127],
|
|
424
|
+
"length": 1
|
|
425
|
+
},
|
|
426
|
+
"tag_names": ["tag-a", "tag-b"]
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Remove tags:
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
arcubase-admin entity-tags batch-remove-entity-tags \
|
|
434
|
+
--appId <app_id> \
|
|
435
|
+
--entityId <entity_id> \
|
|
436
|
+
--body-file remove-tags.json
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
`remove-tags.json`:
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"policy_id": "",
|
|
444
|
+
"selection": {
|
|
445
|
+
"type": "ids",
|
|
446
|
+
"ids": [4000000127],
|
|
447
|
+
"length": 1
|
|
448
|
+
},
|
|
449
|
+
"tag_names": ["tag-a"]
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Rules:
|
|
454
|
+
|
|
455
|
+
- for admin-mode local validation, `policy_id` can be `""`
|
|
456
|
+
- these commands use the same `selection` rules as other selection actions
|
|
457
|
+
- `tag_names` must be a non-empty string array
|
|
458
|
+
|
|
459
|
+
## Invoke batch operator
|
|
460
|
+
|
|
461
|
+
Command:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
arcubase entity invoke-entity-batch-operator \
|
|
465
|
+
--app-id <app_id> \
|
|
466
|
+
--entity-id <entity_id> \
|
|
467
|
+
--body-file invoke-batch-operator.json
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Current writable shape:
|
|
471
|
+
|
|
472
|
+
```json
|
|
473
|
+
{
|
|
474
|
+
"id": "test-action-id",
|
|
475
|
+
"data": {
|
|
476
|
+
"action_id": "non-existent-action",
|
|
477
|
+
"policy_id": "",
|
|
478
|
+
"selection": {
|
|
479
|
+
"type": "ids",
|
|
480
|
+
"ids": [4000000127],
|
|
481
|
+
"length": 1
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
"params": {}
|
|
485
|
+
}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Rules:
|
|
489
|
+
|
|
490
|
+
- `id` is the frontend event id inside the custom action
|
|
491
|
+
- `data.action_id` is the custom action id
|
|
492
|
+
- `data.selection` is required
|
|
493
|
+
- `params` is optional and should be an object
|
|
494
|
+
- if the entity has no matching custom action or event, the server returns an upstream error
|