@carthooks/arcubase-cli 0.1.10 → 0.1.13

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 (105) hide show
  1. package/bundle/arcubase-admin.mjs +1365 -375
  2. package/bundle/arcubase.mjs +1365 -375
  3. package/dist/generated/command_registry.generated.d.ts +36 -35
  4. package/dist/generated/command_registry.generated.d.ts.map +1 -1
  5. package/dist/generated/command_registry.generated.js +37 -36
  6. package/dist/generated/type_index.generated.d.ts +23 -23
  7. package/dist/generated/type_index.generated.js +23 -23
  8. package/dist/runtime/entity_save_schema.d.ts.map +1 -1
  9. package/dist/runtime/entity_save_schema.js +30 -0
  10. package/dist/runtime/env.d.ts +2 -1
  11. package/dist/runtime/env.d.ts.map +1 -1
  12. package/dist/runtime/env.js +10 -1
  13. package/dist/runtime/errors.d.ts +3 -0
  14. package/dist/runtime/errors.d.ts.map +1 -1
  15. package/dist/runtime/execute.d.ts +4 -2
  16. package/dist/runtime/execute.d.ts.map +1 -1
  17. package/dist/runtime/execute.js +1046 -134
  18. package/dist/runtime/paths.d.ts +1 -1
  19. package/dist/runtime/paths.d.ts.map +1 -1
  20. package/dist/runtime/paths.js +9 -2
  21. package/dist/runtime/upload.d.ts +1 -11
  22. package/dist/runtime/upload.d.ts.map +1 -1
  23. package/dist/runtime/upload.js +19 -133
  24. package/dist/runtime/zod_registry.d.ts +5 -3
  25. package/dist/runtime/zod_registry.d.ts.map +1 -1
  26. package/dist/runtime/zod_registry.js +108 -48
  27. package/dist/tests/bootstrap.test.js +12 -0
  28. package/dist/tests/command_registry.test.js +8 -0
  29. package/dist/tests/docs_readability.test.d.ts +2 -0
  30. package/dist/tests/docs_readability.test.d.ts.map +1 -0
  31. package/dist/tests/docs_readability.test.js +87 -0
  32. package/dist/tests/entity_save_schema.test.js +22 -0
  33. package/dist/tests/execute_validation.test.js +443 -44
  34. package/dist/tests/help.test.js +47 -8
  35. package/dist/tests/upload.test.js +30 -77
  36. package/package.json +1 -1
  37. package/sdk-dist/docs/runtime-reference/README.md +43 -29
  38. package/sdk-dist/docs/runtime-reference/access-rule.md +128 -0
  39. package/sdk-dist/docs/runtime-reference/condition.md +182 -0
  40. package/sdk-dist/docs/runtime-reference/entity-schema/README.md +6 -5
  41. package/sdk-dist/docs/runtime-reference/entity-schema/checkbox.md +1 -1
  42. package/sdk-dist/docs/runtime-reference/entity-schema/file.md +2 -2
  43. package/sdk-dist/docs/runtime-reference/entity-schema/image.md +2 -2
  44. package/sdk-dist/docs/runtime-reference/entity-schema/linkto.md +3 -3
  45. package/sdk-dist/docs/runtime-reference/entity-schema/number.md +1 -1
  46. package/sdk-dist/docs/runtime-reference/entity-schema/query.md +3 -3
  47. package/sdk-dist/docs/runtime-reference/entity-schema/relation.md +3 -3
  48. package/sdk-dist/docs/runtime-reference/entity-schema/relationfield.md +3 -3
  49. package/sdk-dist/docs/runtime-reference/entity-schema/status.md +1 -1
  50. package/sdk-dist/docs/runtime-reference/entity-schema/text.md +1 -1
  51. package/sdk-dist/docs/runtime-reference/entity-schema.md +28 -21
  52. package/sdk-dist/docs/runtime-reference/examples/README.md +1 -1
  53. package/sdk-dist/docs/runtime-reference/examples/crm-01/README.md +30 -11
  54. package/sdk-dist/docs/runtime-reference/examples/crm-01/contact.create-entity.json +1 -0
  55. package/sdk-dist/docs/runtime-reference/examples/crm-01/contact.schema.json +1 -0
  56. package/sdk-dist/docs/runtime-reference/examples/crm-01/create-app.json +1 -0
  57. package/sdk-dist/docs/runtime-reference/examples/crm-01/customer.create-entity.json +1 -0
  58. package/sdk-dist/docs/runtime-reference/examples/crm-01/customer.schema.json +1 -0
  59. package/sdk-dist/docs/runtime-reference/examples/crm-01/follow-up.create-entity.json +1 -0
  60. package/sdk-dist/docs/runtime-reference/examples/crm-01/follow-up.schema.json +1 -0
  61. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.bulk-update.json +1 -0
  62. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.create-entity.json +1 -0
  63. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.query.json +1 -0
  64. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.row.insert.json +1 -0
  65. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.schema.json +1 -0
  66. package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.selection.condition.json +1 -0
  67. package/sdk-dist/docs/runtime-reference/examples/oms-01/README.md +26 -26
  68. package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.row.insert.json +1 -1
  69. package/sdk-dist/docs/runtime-reference/examples/wms-01/README.md +26 -10
  70. package/sdk-dist/docs/runtime-reference/examples/wms-01/create-app.json +1 -0
  71. package/sdk-dist/docs/runtime-reference/examples/wms-01/goods-receipt.create-entity.json +1 -0
  72. package/sdk-dist/docs/runtime-reference/examples/wms-01/goods-receipt.schema.json +1 -0
  73. package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.bulk-update.json +1 -0
  74. package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.create-entity.json +1 -0
  75. package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.query.json +1 -0
  76. package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.schema.json +1 -0
  77. package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.selection.condition.json +1 -0
  78. package/sdk-dist/docs/runtime-reference/examples/wms-01/item-master.create-entity.json +1 -0
  79. package/sdk-dist/docs/runtime-reference/examples/wms-01/item-master.schema.json +1 -0
  80. package/sdk-dist/docs/runtime-reference/examples/wms-01/stock-issue.create-entity.json +1 -0
  81. package/sdk-dist/docs/runtime-reference/examples/wms-01/stock-issue.schema.json +1 -0
  82. package/sdk-dist/docs/runtime-reference/row-crud.md +48 -8
  83. package/sdk-dist/docs/runtime-reference/search-and-bulk-actions.md +31 -95
  84. package/sdk-dist/docs/runtime-reference/selection.md +128 -0
  85. package/sdk-dist/docs/runtime-reference/table-lifecycle.md +113 -30
  86. package/sdk-dist/docs/runtime-reference/uploads.md +30 -59
  87. package/sdk-dist/docs/runtime-reference/workflow/README.md +129 -13
  88. package/sdk-dist/generated/command_registry.generated.ts +37 -36
  89. package/sdk-dist/generated/type_index.generated.ts +23 -23
  90. package/src/generated/command_registry.generated.ts +37 -36
  91. package/src/generated/type_index.generated.ts +23 -23
  92. package/src/runtime/entity_save_schema.ts +30 -0
  93. package/src/runtime/env.ts +14 -2
  94. package/src/runtime/errors.ts +3 -0
  95. package/src/runtime/execute.ts +1272 -134
  96. package/src/runtime/paths.ts +11 -2
  97. package/src/runtime/upload.ts +19 -178
  98. package/src/runtime/zod_registry.ts +113 -48
  99. package/src/tests/bootstrap.test.ts +16 -0
  100. package/src/tests/command_registry.test.ts +9 -0
  101. package/src/tests/docs_readability.test.ts +96 -0
  102. package/src/tests/entity_save_schema.test.ts +22 -0
  103. package/src/tests/execute_validation.test.ts +577 -47
  104. package/src/tests/help.test.ts +51 -8
  105. package/src/tests/upload.test.ts +34 -91
@@ -52,18 +52,18 @@ This example rewrites them into generic names such as:
52
52
 
53
53
  - `app-overview.md`
54
54
  - `create-app.json`
55
- - `sales-order.create-entity.json`
56
- - `item-master.create-entity.json`
55
+ - `sales-order.table create.json`
56
+ - `item-master.table create.json`
57
57
  - `item-master.schema.json`
58
58
  - `goods-receipt.schema.json`
59
59
  - `stock-issue.schema.json`
60
60
  - `picking-list.schema.json`
61
61
  - `sales-order.schema.json`
62
62
  - `purchase-order.schema.json`
63
- - `goods-receipt.create-entity.json`
64
- - `stock-issue.create-entity.json`
65
- - `picking-list.create-entity.json`
66
- - `purchase-order.create-entity.json`
63
+ - `goods-receipt.table create.json`
64
+ - `stock-issue.table create.json`
65
+ - `picking-list.table create.json`
66
+ - `purchase-order.table create.json`
67
67
  - `sales-order.row.insert.json`
68
68
  - `sales-order.query.json`
69
69
  - `sales-order.selection.ids.json`
@@ -75,13 +75,13 @@ This example rewrites them into generic names such as:
75
75
  For every `*.schema.json` file:
76
76
 
77
77
  1. create the entity shell
78
- 2. fetch the shell with `admin-get-entity-info`
78
+ 2. fetch the shell with `table get`
79
79
  3. replace:
80
80
  - `__APP_ID__`
81
81
  - `__ENTITY_ID__`
82
82
  - `__SCHEMA_VERSION__`
83
- 4. save the schema with `admin-save-entity`
84
- 5. probe rows with `query-entity`
83
+ 4. save the schema with `table update-schema`
84
+ 5. probe rows with `row query`
85
85
 
86
86
  These schema files are templates, not live shell exports.
87
87
 
@@ -109,47 +109,47 @@ Do not use `arcubase-admin` for row operations.
109
109
  Create the app:
110
110
 
111
111
  ```bash
112
- arcubase-admin app create-app-by-tenants --body-file create-app.json
112
+ arcubase-admin app create --body-file create-app.json | --body-json <json-string>
113
113
  ```
114
114
 
115
115
  Create the shell:
116
116
 
117
117
  ```bash
118
- arcubase-admin app create-entity --id <app_id> --body-file sales-order.create-entity.json
119
- arcubase-admin app create-entity --id <app_id> --body-file item-master.create-entity.json
120
- arcubase-admin app create-entity --id <app_id> --body-file goods-receipt.create-entity.json
121
- arcubase-admin app create-entity --id <app_id> --body-file stock-issue.create-entity.json
122
- arcubase-admin app create-entity --id <app_id> --body-file picking-list.create-entity.json
123
- arcubase-admin app create-entity --id <app_id> --body-file purchase-order.create-entity.json
118
+ arcubase-admin table create --app-id <app_id> --body-file sales-order.table create.json | --body-json <json-string>
119
+ arcubase-admin table create --app-id <app_id> --body-file item-master.table create.json | --body-json <json-string>
120
+ arcubase-admin table create --app-id <app_id> --body-file goods-receipt.table create.json | --body-json <json-string>
121
+ arcubase-admin table create --app-id <app_id> --body-file stock-issue.table create.json | --body-json <json-string>
122
+ arcubase-admin table create --app-id <app_id> --body-file picking-list.table create.json | --body-json <json-string>
123
+ arcubase-admin table create --app-id <app_id> --body-file purchase-order.table create.json | --body-json <json-string>
124
124
  ```
125
125
 
126
126
  Fetch the shell:
127
127
 
128
128
  ```bash
129
- arcubase-admin entity admin-get-entity-info --app-id <app_id> --table-id <table_id>
129
+ arcubase-admin table get --app-id <app_id> --table-id <table_id>
130
130
  ```
131
131
 
132
132
  Save the schema:
133
133
 
134
134
  ```bash
135
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file sales-order.schema.json
136
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file item-master.schema.json
137
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file goods-receipt.schema.json
138
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file stock-issue.schema.json
139
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file picking-list.schema.json
140
- arcubase-admin entity admin-save-entity --app-id <app_id> --table-id <table_id> --body-file purchase-order.schema.json
135
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file sales-order.schema.json | --body-json <json-string>
136
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file item-master.schema.json | --body-json <json-string>
137
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file goods-receipt.schema.json | --body-json <json-string>
138
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file stock-issue.schema.json | --body-json <json-string>
139
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file picking-list.schema.json | --body-json <json-string>
140
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file purchase-order.schema.json | --body-json <json-string>
141
141
  ```
142
142
 
143
143
  Insert one row:
144
144
 
145
145
  ```bash
146
- arcubase row create --app-id <app_id> --table-id <table_id> --body-file sales-order.row.insert.json
146
+ arcubase row create --app-id <app_id> --table-id <table_id> --body-file sales-order.row.insert.json | --body-json <json-string>
147
147
  ```
148
148
 
149
149
  Query rows:
150
150
 
151
151
  ```bash
152
- arcubase row query --app-id <app_id> --table-id <table_id> --body-file sales-order.query.json
152
+ arcubase row query --app-id <app_id> --table-id <table_id> --body-file sales-order.query.json | --body-json <json-string>
153
153
  ```
154
154
 
155
155
  ## Placeholder rules
@@ -170,7 +170,7 @@ When you replace them, keep these fields as JSON numbers:
170
170
  - `id`
171
171
  - `schema_version`
172
172
  - relation `app_id`
173
- - relation `table_id`
173
+ - relation `entity_id`
174
174
 
175
175
  Do not leave the replaced values as JSON strings.
176
176
 
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "1008": "Taylor Morgan",
19
- "1009": "+1-202-555-0102",
19
+ "1009": "+1-2188889847-555-0102",
20
20
  "1010": "10001",
21
21
  "1011": "120 Market Street",
22
22
  "1012": "Suite 8",
@@ -1,21 +1,37 @@
1
1
  # WMS Example 01
2
2
 
3
- This directory is reserved for a generic warehouse and inventory example set.
3
+ Warehouse and inventory example set.
4
4
 
5
- Planned tables:
5
+ ## Tables
6
6
 
7
7
  - `Item Master`
8
8
  - `Goods Receipt`
9
9
  - `Stock Issue`
10
- - `Stock Adjustment`
11
10
  - `Inventory Snapshot`
12
11
 
13
- Planned field patterns:
12
+ ## Files
14
13
 
15
- - `relation`
16
- - `query`
17
- - `number`
18
- - `status`
19
- - `datetime`
14
+ - `create-app.json`
15
+ - `item-master.create-entity.json`
16
+ - `item-master.schema.json`
17
+ - `goods-receipt.create-entity.json`
18
+ - `goods-receipt.schema.json`
19
+ - `stock-issue.create-entity.json`
20
+ - `stock-issue.schema.json`
21
+ - `inventory-snapshot.create-entity.json`
22
+ - `inventory-snapshot.schema.json`
23
+ - `inventory-snapshot.query.json`
24
+ - `inventory-snapshot.bulk-update.json`
25
+ - `inventory-snapshot.selection.condition.json`
20
26
 
21
- All names will remain generic and English-only.
27
+ ## Commands
28
+
29
+ ```bash
30
+ arcubase-admin app create --body-file create-app.json | --body-json <json-string>
31
+ arcubase-admin table create --app-id <app_id> --body-file item-master.create-entity.json | --body-json <json-string>
32
+ arcubase-admin table get --app-id <app_id> --table-id <table_id>
33
+ arcubase-admin table update-schema --app-id <app_id> --table-id <table_id> --body-file item-master.schema.json | --body-json <json-string>
34
+ arcubase row query --app-id <app_id> --table-id <table_id> --body-file inventory-snapshot.query.json | --body-json <json-string>
35
+ arcubase row bulk-update --app-id <app_id> --table-id <table_id> --body-file inventory-snapshot.bulk-update.json | --body-json <json-string>
36
+ arcubase row selection-action --app-id <app_id> --table-id <table_id> --action archive --body-file inventory-snapshot.selection.condition.json | --body-json <json-string>
37
+ ```
@@ -0,0 +1 @@
1
+ {"name":"WMS Example 01"}
@@ -0,0 +1 @@
1
+ {"id":"__TABLE_ID__","app_id":"__APP_ID__","name":"Goods Receipt","workflow_enabled":false,"fields":[{"id":1001,"label":"Receipt Number","type":"text","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"receipt_number","code_index":false,"options":{},"transfers":null,"children":null},{"id":1002,"label":"Quantity","type":"number","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"quantity","code_index":false,"options":{"mode":"number"},"transfers":null,"children":null}],"layout":[[1001],[1002]],"options":{},"schema_version":0,"field_id_seq":1003}
@@ -0,0 +1 @@
1
+ {"selection":{"type":"condition","condition":{"field":":1002","operator":"gt","value":0}},"values":{":1002":100}}
@@ -0,0 +1 @@
1
+ {"limit":20,"offset":0,"search":{"text_search":"SKU-1001"},"sorts":[{"column":":1001","order":"desc"}]}
@@ -0,0 +1 @@
1
+ {"id":"__TABLE_ID__","app_id":"__APP_ID__","name":"Inventory Snapshot","workflow_enabled":false,"fields":[{"id":1001,"label":"Snapshot Date","type":"datetime","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"snapshot_date","code_index":false,"options":{"type":"date"},"transfers":null,"children":null},{"id":1002,"label":"On Hand Quantity","type":"number","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"on_hand_quantity","code_index":false,"options":{"mode":"number"},"transfers":null,"children":null}],"layout":[[1001],[1002]],"options":{},"schema_version":0,"field_id_seq":1003}
@@ -0,0 +1 @@
1
+ {"selection":{"type":"condition","condition":{"field":":1002","operator":"lte","value":0}}}
@@ -0,0 +1 @@
1
+ {"id":"__TABLE_ID__","app_id":"__APP_ID__","name":"Item Master","workflow_enabled":false,"fields":[{"id":1001,"label":"SKU","type":"text","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"sku","code_index":false,"options":{},"transfers":null,"children":null},{"id":1002,"label":"Item Name","type":"text","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"item_name","code_index":false,"options":{},"transfers":null,"children":null}],"layout":[[1001],[1002]],"options":{},"schema_version":0,"field_id_seq":1003}
@@ -0,0 +1 @@
1
+ {"id":"__TABLE_ID__","app_id":"__APP_ID__","name":"Stock Issue","workflow_enabled":false,"fields":[{"id":1001,"label":"Issue Number","type":"text","required":true,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"issue_number","code_index":false,"options":{},"transfers":null,"children":null},{"id":1002,"label":"Issued At","type":"datetime","required":false,"unique":false,"editable":true,"visible":true,"show_label":true,"scannable":false,"default_value_mode":0,"description":"","value":null,"number_decimal":0,"depends":[],"key":"issued_at","code_index":false,"options":{"type":"date"},"transfers":null,"children":null}],"layout":[[1001],[1002]],"options":{},"schema_version":0,"field_id_seq":1003}
@@ -10,7 +10,7 @@ Command:
10
10
  arcubase row create \
11
11
  --app-id <app_id> \
12
12
  --table-id <table_id> \
13
- --body-file insert.json
13
+ --body-file insert.json | --body-json <json-string>
14
14
  ```
15
15
 
16
16
  Minimal `insert.json`:
@@ -29,7 +29,9 @@ Rules:
29
29
 
30
30
  - use numeric field ids as JSON object keys
31
31
  - values must match the saved schema
32
- - if a field is `file` or `image`, run `arcubase upload <local-file>` first and use the returned `data` array as the field value
32
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
33
+ - if the resolved access rule marks a field as not writable, the CLI fails with `FIELD_PERMISSION_REQUIRED`; remove that field or ask an admin to update the access rule
34
+ - if a field is `file` or `image`, use the `upload token` flow in `uploads.md` and pass the returned upload value array
33
35
 
34
36
  Success result:
35
37
 
@@ -49,7 +51,7 @@ Command:
49
51
  arcubase row query \
50
52
  --app-id <app_id> \
51
53
  --table-id <table_id> \
52
- --body-file query.json
54
+ --body-file query.json | --body-json <json-string>
53
55
  ```
54
56
 
55
57
  Minimal `query.json`:
@@ -66,6 +68,7 @@ Rules:
66
68
  - do not use `viewMode`
67
69
  - if you need the view selector, use `view_mode`
68
70
  - if you need archived view, also pass `--query-file`
71
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
69
72
 
70
73
  Typical row shape:
71
74
 
@@ -80,12 +83,18 @@ Typical row shape:
80
83
  }
81
84
  ```
82
85
 
86
+ Returned values:
87
+
88
+ - current row values are only in `fields`
89
+ - fields absent from `fields` are not returned to the current user and have no row-value evidence
90
+ - table schema `fields[].value` and `default_value_mode` describe schema defaults, not current row values
91
+
83
92
  ## Read one row
84
93
 
85
94
  Command:
86
95
 
87
96
  ```bash
88
- arcubase workflow get-entity-row \
97
+ arcubase row get \
89
98
  --app-id <app_id> \
90
99
  --table-id <table_id> \
91
100
  --row-id <row_id>
@@ -93,6 +102,13 @@ arcubase workflow get-entity-row \
93
102
 
94
103
  Use this when you already know the row id and want the full record payload.
95
104
 
105
+ Returned values:
106
+
107
+ - current row values are in `record.fields`
108
+ - fields absent from `record.fields` are not returned to the current user and have no row-value evidence
109
+ - use `fieldPermits` only to explain access, not as current row values
110
+ - read visibility status is `fieldPermits read:false`; `FIELD_PERMISSION_REQUIRED` is a write preflight error from row create/update
111
+
96
112
  ## Update a row
97
113
 
98
114
  Command:
@@ -102,7 +118,7 @@ arcubase row update \
102
118
  --app-id <app_id> \
103
119
  --table-id <table_id> \
104
120
  --row-id <row_id> \
105
- --body-file update.json
121
+ --body-file update.json | --body-json <json-string>
106
122
  ```
107
123
 
108
124
  Minimal `update.json`:
@@ -122,7 +138,9 @@ Rules:
122
138
  - `changed_fields` is required
123
139
  - every id in `changed_fields` must also appear in `data`
124
140
  - use numeric field ids as JSON object keys
125
- - if a field is `file` or `image`, run `arcubase upload <local-file>` first and use the returned `data` array as the field value
141
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
142
+ - if the resolved access rule marks a field as not writable, the CLI fails with `FIELD_PERMISSION_REQUIRED`; remove that field or ask an admin to update the access rule
143
+ - if a field is `file` or `image`, use the `upload token` flow in `uploads.md` and pass the returned upload value array
126
144
 
127
145
  Success result:
128
146
 
@@ -142,7 +160,7 @@ Command:
142
160
  arcubase row delete \
143
161
  --app-id <app_id> \
144
162
  --table-id <table_id> \
145
- --body-file delete.json
163
+ --body-file delete.json | --body-json <json-string>
146
164
  ```
147
165
 
148
166
  Minimal `delete.json`:
@@ -161,7 +179,29 @@ Rules:
161
179
 
162
180
  - use `selection.type = "ids"`
163
181
  - when `length` is provided, keep it equal to `ids.length`
182
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
164
183
 
165
184
  ## Restore rows
166
185
 
167
- `row restore` is not part of the reset CLI white list.
186
+ Command:
187
+
188
+ ```bash
189
+ arcubase row update \
190
+ --app-id <app_id> \
191
+ --table-id <table_id> \
192
+ --body-file restore.json | --body-json <json-string>
193
+ ```
194
+
195
+ Minimal `restore.json`:
196
+
197
+ ```json
198
+ {
199
+ "selection": {
200
+ "type": "ids",
201
+ "ids": [4000000046],
202
+ "length": 1
203
+ }
204
+ }
205
+ ```
206
+
207
+ The same `selection` rules apply as delete.
@@ -1,13 +1,16 @@
1
1
  # Search And Bulk Actions
2
2
 
3
+ For exact selection and condition shapes, also read:
4
+
5
+ - `selection.md`
6
+ - `condition.md`
7
+
3
8
  Use this page for:
4
9
 
5
10
  - search
6
11
  - selection actions
7
12
  - archived queries
8
13
  - bulk update
9
- - selection tags
10
- - batch operator
11
14
 
12
15
  ## Main query command
13
16
 
@@ -17,7 +20,7 @@ Use:
17
20
  arcubase row query \
18
21
  --app-id <app_id> \
19
22
  --table-id <table_id> \
20
- --body-file query.json
23
+ --body-file query.json | --body-json <json-string>
21
24
  ```
22
25
 
23
26
  For extra query-string parameters, also use:
@@ -77,7 +80,7 @@ Rules:
77
80
 
78
81
  Archived view requires both:
79
82
 
80
- - `--body-file archived-body.json`
83
+ - `--body-file archived-body.json | --body-json <json-string>`
81
84
  - `--query-file archived-query.json`
82
85
 
83
86
  Command:
@@ -87,7 +90,7 @@ arcubase row query \
87
90
  --app-id <app_id> \
88
91
  --table-id <table_id> \
89
92
  --query-file archived-query.json \
90
- --body-file archived-body.json
93
+ --body-file archived-body.json | --body-json <json-string>
91
94
  ```
92
95
 
93
96
  `archived-body.json`:
@@ -132,13 +135,14 @@ Selection fragment:
132
135
  Rules:
133
136
 
134
137
  - `length` should match `ids.length`
135
- - this is the safest path for delete, restore, tags, and targeted bulk actions
138
+ - this is the safest path for delete, restore, and targeted bulk actions
136
139
 
137
140
  ## Selection with conditions
138
141
 
139
142
  Use this when the action should apply to the current filtered result set.
140
143
 
141
144
  This shape is **not** the same as `query.json.search`.
145
+ This shape is **not** `ConditionSet`.
142
146
 
143
147
  Use route-query style keys inside `selection.condition`:
144
148
 
@@ -186,10 +190,27 @@ Rules:
186
190
 
187
191
  - `condition.selectAll` must be `true`
188
192
  - do not use `text_search` inside `selection.condition`
193
+ - do not use `{mode, conditions}` inside `selection.condition`
194
+ - do not use `{field, operator, value}` inside `selection.condition`
189
195
  - `filter_:...` values should be URL-encoded JSON strings
190
196
  - keep `length` equal to the intended matched count
191
197
  - include `sorts` when your selection came from a sorted list view
192
198
 
199
+ ## Selection tags
200
+
201
+ Current reset surface has no tag-specific CLI command.
202
+
203
+ Use one of the current single success paths instead:
204
+
205
+ - `arcubase row selection-action` for query, archive, restore, and batch actions
206
+ - `arcubase row bulk-update` for field updates across a selected set
207
+
208
+ Rules:
209
+
210
+ - tags are not a separate namespace in the reset surface
211
+ - do not call a tag module directly
212
+ - express the target rows through `selection`
213
+
193
214
  ## Query selected rows
194
215
 
195
216
  Command:
@@ -199,7 +220,7 @@ arcubase row selection-action \
199
220
  --app-id <app_id> \
200
221
  --table-id <table_id> \
201
222
  --action query \
202
- --body-file query-selection.json
223
+ --body-file query-selection.json | --body-json <json-string>
203
224
  ```
204
225
 
205
226
  Working `query-selection.json` with ids:
@@ -239,7 +260,7 @@ arcubase row selection-action \
239
260
  --app-id <app_id> \
240
261
  --table-id <table_id> \
241
262
  --action archive \
242
- --body-file archive-selection.json
263
+ --body-file archive-selection.json | --body-json <json-string>
243
264
  ```
244
265
 
245
266
  Rules:
@@ -257,14 +278,13 @@ arcubase row selection-action \
257
278
  --app-id <app_id> \
258
279
  --table-id <table_id> \
259
280
  --action batch_print \
260
- --body-file batch-print-selection.json
281
+ --body-file batch-print-selection.json | --body-json <json-string>
261
282
  ```
262
283
 
263
284
  Working shape:
264
285
 
265
286
  ```json
266
287
  {
267
- "policy_id": "",
268
288
  "selection": {
269
289
  "type": "ids",
270
290
  "ids": [4000000127],
@@ -283,7 +303,7 @@ Command:
283
303
  arcubase row bulk-update \
284
304
  --app-id <app_id> \
285
305
  --table-id <table_id> \
286
- --body-file bulk-update.json
306
+ --body-file bulk-update.json | --body-json <json-string>
287
307
  ```
288
308
 
289
309
  Working `bulk-update.json` with ids:
@@ -377,87 +397,3 @@ Rules:
377
397
  - use `type: set` when you want to assign a new scalar value directly
378
398
  - for `type: set`, send the new value as `action.value`
379
399
  - 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 <table_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 <table_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 <table_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
- `invoke-batch-operator` is not part of the reset CLI white list.
462
- - `params` is optional and should be an object
463
- - if the entity has no matching custom action or event, the server returns an upstream error