bpmax-cli 0.1.37 → 0.1.39

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/README.md CHANGED
@@ -133,9 +133,10 @@ Before advancing or rejecting a step, inspect the safe context and available act
133
133
  ```bash
134
134
  bpmax-cli step context 15690 --project-id 13097 --format json
135
135
  bpmax-cli step actions 15690 --project-id 13097 --format json
136
+ bpmax-cli step requirements 15690 --project-id 13097 --format json
136
137
  ```
137
138
 
138
- `step context` reports the project/step URL, current user ownership, parsed actions, form evidence, and `identity_unverified`. If project and step form values are empty, do not advance from an ES keyword or attachment-text match alone.
139
+ `step context` reports the project/step URL, current user ownership, parsed actions, current-step input requirements, form evidence, and `identity_unverified`. `step requirements` focuses on current-step bound form fields, required inputs, existing values, missing required inputs, and a submit payload template. If project and step form values are empty, do not advance from an ES keyword or attachment-text match alone.
139
140
 
140
141
  Submit step actions through a dry-run first:
141
142
 
@@ -144,11 +145,12 @@ bpmax-cli step submit 15690 \
144
145
  --project-id 13097 \
145
146
  --action approve \
146
147
  --label "通过" \
148
+ --data '{"form":{"manager_opinion":"同意"}}' \
147
149
  --comments "确认推进" \
148
150
  --format json
149
151
  ```
150
152
 
151
- The command only calls `PUT /api/step/:id?action=<action>` when `--confirm <text>` is present and safety checks pass.
153
+ The command only calls `PUT /api/step/:id?action=<action>` when `--confirm <text>` is present and safety checks pass. Confirmed submits are refused when current-step required inputs are missing.
152
154
 
153
155
  Filter pending steps at the API query level instead of pulling all pages locally:
154
156
 
@@ -167,17 +169,31 @@ bpmax-cli project create --profile yuanrong --flow-id 123 --format json
167
169
 
168
170
  `project create` uses the interactive guide by default. During the guide, choose "打开 BPMAX 表单页继续填写" to hand off to the web form. The CLI prints a PC URL and mobile path with the fields already entered encoded in `init_value`.
169
171
 
170
- Use `--no-interactive` only for explicit direct-submit automation. If the target form template contains auto-init lambda scripts, the CLI still refuses direct submit and prints a web form handoff URL with `reason: "form_template_auto_init_lambda"`.
172
+ Use `--no-interactive` only for explicit direct-submit automation. If the target form template contains page-only behavior such as auto-init lambda scripts, serial number controls, complex selectors, uploads, rich text, or sub forms, the CLI still refuses direct submit and prints a web form handoff URL with `reason: "form_template_requires_page_handoff"`.
173
+ Direct `project create --body` is blocked by default because it bypasses flow form-template checks and can create an empty project shell. Use `project create --json` with a flow id/type so the CLI can detect page-only controls such as serial numbers, complex selectors, uploads, rich text, and sub forms. Only local experts should use `--unsafe-direct-create --body` for intentional legacy raw creation.
171
174
 
172
- ## ES fast queries
175
+ ## ES project queries
173
176
 
174
- Use raw ES project search for high-volume reads, aggregations, budget summaries, trend analysis, and other reporting-style queries. Prefer ES aggregations over paging through `project list` and grouping locally.
177
+ Use ES project search for high-volume reads, budget summaries, trend analysis, and other reporting-style queries.
178
+ For normal project searches, pass a project-list style body. The CLI calls `POST /api/project/list`, so BPMAX still applies project list permissions, workspace filters, and dataset hooks:
175
179
 
176
180
  ```bash
177
- bpmax-cli es project-search --profile yuanrong --body @query.json --format json
181
+ bpmax-cli es project-search --profile yuanrong --body @project-list-query.json --page 1 --page-size 20 --format json
178
182
  ```
179
183
 
180
- The body is passed to `POST /api/project/raw-es-search` unchanged:
184
+ ```json
185
+ {
186
+ "data_set_key": "budget_project",
187
+ "flow_type": "flow123",
188
+ "flow_key": "",
189
+ "query": {
190
+ "name": { "type": "match_phrase", "value": "董永喜" }
191
+ },
192
+ "is_select_all": false
193
+ }
194
+ ```
195
+
196
+ For advanced aggregations or raw Elasticsearch requests, include a top-level `body` field. In that case the CLI calls `POST /api/project/raw-es-search` unchanged:
181
197
 
182
198
  ```json
183
199
  {
@@ -228,11 +244,12 @@ Example `recipe.json`:
228
244
  "description": "发起门店人员管理流程",
229
245
  "workspace": "store_mgr",
230
246
  "variables": [
247
+ { "name": "flow_id", "required": true },
231
248
  { "name": "name", "required": true },
232
249
  { "name": "phone", "required": true }
233
250
  ],
234
251
  "command": {
235
- "argv": ["project", "create", "--body", "@payload.json", "--format", "json"],
252
+ "argv": ["project", "create", "--flow-id", "{{flow_id}}", "--name", "{{name}}", "--json", "@payload.json", "--format", "json"],
236
253
  "mutating": true
237
254
  }
238
255
  }
@@ -243,6 +260,7 @@ Run a recipe with explicit variables. Mutating recipes require `--yes`:
243
260
  ```bash
244
261
  bpmax-cli recipe run create-store-staff \
245
262
  --yes \
263
+ --var flow_id=123 \
246
264
  --var name=杨小小 \
247
265
  --vars '{"phone":"18211223344","store_group_id":"817","store_name":"TMS测试门店"}'
248
266
  ```