@carthooks/arcubase-cli 0.1.10 → 0.1.12

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 +1274 -375
  2. package/bundle/arcubase.mjs +1274 -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 +2 -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 +944 -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 +381 -44
  34. package/dist/tests/help.test.js +45 -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 +109 -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 +35 -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 +2 -0
  95. package/src/runtime/execute.ts +1166 -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 +508 -47
  104. package/src/tests/help.test.ts +49 -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
 
@@ -85,7 +88,7 @@ Typical row shape:
85
88
  Command:
86
89
 
87
90
  ```bash
88
- arcubase workflow get-entity-row \
91
+ arcubase row get \
89
92
  --app-id <app_id> \
90
93
  --table-id <table_id> \
91
94
  --row-id <row_id>
@@ -102,7 +105,7 @@ arcubase row update \
102
105
  --app-id <app_id> \
103
106
  --table-id <table_id> \
104
107
  --row-id <row_id> \
105
- --body-file update.json
108
+ --body-file update.json | --body-json <json-string>
106
109
  ```
107
110
 
108
111
  Minimal `update.json`:
@@ -122,7 +125,9 @@ Rules:
122
125
  - `changed_fields` is required
123
126
  - every id in `changed_fields` must also appear in `data`
124
127
  - 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
128
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
129
+ - 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
130
+ - if a field is `file` or `image`, use the `upload token` flow in `uploads.md` and pass the returned upload value array
126
131
 
127
132
  Success result:
128
133
 
@@ -142,7 +147,7 @@ Command:
142
147
  arcubase row delete \
143
148
  --app-id <app_id> \
144
149
  --table-id <table_id> \
145
- --body-file delete.json
150
+ --body-file delete.json | --body-json <json-string>
146
151
  ```
147
152
 
148
153
  Minimal `delete.json`:
@@ -161,7 +166,29 @@ Rules:
161
166
 
162
167
  - use `selection.type = "ids"`
163
168
  - when `length` is provided, keep it equal to `ids.length`
169
+ - access policy is resolved internally from the visible app/table entry; do not add access policy fields to the JSON body
164
170
 
165
171
  ## Restore rows
166
172
 
167
- `row restore` is not part of the reset CLI white list.
173
+ Command:
174
+
175
+ ```bash
176
+ arcubase row update \
177
+ --app-id <app_id> \
178
+ --table-id <table_id> \
179
+ --body-file restore.json | --body-json <json-string>
180
+ ```
181
+
182
+ Minimal `restore.json`:
183
+
184
+ ```json
185
+ {
186
+ "selection": {
187
+ "type": "ids",
188
+ "ids": [4000000046],
189
+ "length": 1
190
+ }
191
+ }
192
+ ```
193
+
194
+ 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
@@ -0,0 +1,128 @@
1
+ # Selection
2
+
3
+ Use this for commands that act on selected rows.
4
+
5
+ Commands:
6
+
7
+ - `arcubase row delete`
8
+ - `arcubase row bulk-update`
9
+ - `arcubase row selection-action`
10
+
11
+ TypeScript:
12
+
13
+ - `$ARCUBASE_SDK_ROOT/types/user-action.ts`
14
+ - `EntitySelectionVO`
15
+ - `EntitySelectionActionReqVO`
16
+ - `EntityBulkUpdateReqVO`
17
+
18
+ ## IDs
19
+
20
+ Use this when exact row ids are known.
21
+
22
+ ```json
23
+ {
24
+ "selection": {
25
+ "type": "ids",
26
+ "ids": [2188890411, 2188890412],
27
+ "length": 2
28
+ }
29
+ }
30
+ ```
31
+
32
+ Rules:
33
+
34
+ - `ids` are row ids, not field ids
35
+ - `length` should equal `ids.length`
36
+ - safest path for delete, restore, targeted bulk update, and targeted selection-action
37
+
38
+ ## All
39
+
40
+ Use this only for query-style selection actions.
41
+
42
+ ```json
43
+ {
44
+ "selection": {
45
+ "type": "all"
46
+ }
47
+ }
48
+ ```
49
+
50
+ Allowed:
51
+
52
+ - `arcubase row selection-action --action query`
53
+
54
+ Not allowed:
55
+
56
+ - archive
57
+ - delete
58
+ - restore
59
+ - bulk update
60
+
61
+ ## Condition Selection
62
+
63
+ `selection.condition` is the current list route-query search state.
64
+
65
+ Use this when the UI selected the current filtered list result.
66
+
67
+ ```json
68
+ {
69
+ "selection": {
70
+ "type": "condition",
71
+ "length": 10,
72
+ "condition": {
73
+ "q": "SO-1001",
74
+ "selectAll": true
75
+ },
76
+ "sorts": [
77
+ { "column": ":1003", "order": "desc" }
78
+ ]
79
+ }
80
+ }
81
+ ```
82
+
83
+ Rules:
84
+
85
+ - `condition` here is route-query search state, not `ConditionSet`
86
+ - `condition.selectAll` must be `true`
87
+ - allowed condition keys are `q`, `tab`, and `filter_<column>`
88
+ - `filter_<column>` value is URL-encoded `FilterCond` JSON
89
+ - include `sorts` when the source list was sorted
90
+ - do not put `{mode, conditions}` here
91
+ - do not put `{field, operator, value}` here
92
+
93
+ ## Action Matrix
94
+
95
+ | Command | `ids` | `condition` | `all` |
96
+ | --- | --- | --- | --- |
97
+ | `row delete` | yes | no | no |
98
+ | `row bulk-update` | yes | yes | no |
99
+ | `row selection-action --action query` | yes | no | yes |
100
+ | `row selection-action --action archive` | yes | yes | no |
101
+ | `row selection-action --action restore` | yes | yes | no |
102
+ | `row selection-action --action batch_print` | yes | yes | no |
103
+
104
+ ## Examples
105
+
106
+ Delete exact rows:
107
+
108
+ ```json
109
+ {"selection":{"type":"ids","ids":[2188890411],"length":1}}
110
+ ```
111
+
112
+ Bulk update exact rows:
113
+
114
+ ```json
115
+ {"selection":{"type":"ids","ids":[2188890411],"length":1},"fields":[{"id":1002,"action":{"type":"number_add","number_add":10}}]}
116
+ ```
117
+
118
+ Archive current filtered list:
119
+
120
+ ```json
121
+ {"selection":{"type":"condition","length":10,"condition":{"q":"stale","selectAll":true},"sorts":[{"column":":1003","order":"desc"}]}}
122
+ ```
123
+
124
+ Bulk update current filtered list:
125
+
126
+ ```json
127
+ {"selection":{"type":"condition","length":1,"condition":{"filter_:1002":"%7B%22is%22%3A%22new%22%7D","selectAll":true}},"fields":[{"id":1002,"action":{"type":"set","value":"qualified"}}]}
128
+ ```