flowbase-cli 0.1.9__tar.gz → 0.1.11__tar.gz
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.
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/PKG-INFO +59 -16
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/README.md +58 -15
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/pyproject.toml +1 -1
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli/__init__.py +1 -1
- flowbase_cli-0.1.11/src/flowbase_cli/endpoints.py +1337 -0
- flowbase_cli-0.1.11/src/flowbase_cli/guide.py +47 -0
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli/main.py +88 -9
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli.egg-info/PKG-INFO +59 -16
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli.egg-info/SOURCES.txt +2 -0
- flowbase_cli-0.1.11/tests/test_autonomy.py +68 -0
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/tests/test_cli.py +317 -8
- flowbase_cli-0.1.9/src/flowbase_cli/endpoints.py +0 -630
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/setup.cfg +0 -0
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli.egg-info/dependency_links.txt +0 -0
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli.egg-info/entry_points.txt +0 -0
- {flowbase_cli-0.1.9 → flowbase_cli-0.1.11}/src/flowbase_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowbase-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: Command line client for the FlowBase OpenAPI
|
|
5
5
|
Author: DeepFlowAI
|
|
6
6
|
License: Apache-2.0
|
|
@@ -11,6 +11,8 @@ Description-Content-Type: text/markdown
|
|
|
11
11
|
|
|
12
12
|
`flowbase` is the official command line client for the FlowBase OpenAPI. It manages apps, objects, fields, views, custom pages, workflows, approval flows, dashboards, business records, roles, and configuration versions across the three FlowBase environments.
|
|
13
13
|
|
|
14
|
+
FlowBase is a low-code platform. Start with `flowbase guide` (offline): discover apps and objects, read fields, then configure and verify. Use `flowbase guide --format json` for structured guidance.
|
|
15
|
+
|
|
14
16
|
## 1. Install and connect
|
|
15
17
|
|
|
16
18
|
```bash
|
|
@@ -72,6 +74,8 @@ Each operation is in `metadata:read`, `metadata:write`, `records:read`, or `reco
|
|
|
72
74
|
```text
|
|
73
75
|
flowbase
|
|
74
76
|
├── docs list | show | example | operations Offline endpoint catalog
|
|
77
|
+
├── guide Offline product and task guide (--format markdown|json)
|
|
78
|
+
├── organization employees | departments
|
|
75
79
|
├── apps list | get | create | update | set-enabled | delete
|
|
76
80
|
│ add-objects | remove-object | set-group | reorder-objects
|
|
77
81
|
│ add-dashboards | remove-dashboard | set-dashboard-group | reorder-members
|
|
@@ -82,8 +86,8 @@ flowbase
|
|
|
82
86
|
├── views list | create | update | reorder | set-enabled | delete
|
|
83
87
|
├── workflows list | get | create | update | reorder | set-enabled | delete | executions
|
|
84
88
|
├── approvals list | get | create | update | reorder | set-enabled | delete
|
|
85
|
-
├── pages list | options | get | create | update | set-default | delete | restore
|
|
86
|
-
├── dashboards list | get | create | update | copy | delete
|
|
89
|
+
├── pages list | options | get | create | update | set-default | clear-default | delete | restore | evaluate
|
|
90
|
+
├── dashboards list | get | create | update | copy | delete | run
|
|
87
91
|
├── changes commit | release | direct-release
|
|
88
92
|
├── versions list | show | releases Read-only history
|
|
89
93
|
├── environments restart Destructive test-env reset
|
|
@@ -91,7 +95,7 @@ flowbase
|
|
|
91
95
|
└── roles list | options | get | create | update | delete (production only)
|
|
92
96
|
```
|
|
93
97
|
|
|
94
|
-
Global flags: `--host`, `--api-key`, `--pretty`/`--no-pretty`, `--raw`.
|
|
98
|
+
Global flags: `--host`, `--api-key`, `--pretty`/`--no-pretty`, `--raw`. They may appear **before or after** the subcommand (`flowbase apps list --no-pretty` is valid).
|
|
95
99
|
|
|
96
100
|
## 5. Discovering request bodies
|
|
97
101
|
|
|
@@ -112,18 +116,24 @@ Complex bodies reference closed sets that are not guessable from examples. Query
|
|
|
112
116
|
|
|
113
117
|
```bash
|
|
114
118
|
flowbase docs catalogs # list available catalogs
|
|
115
|
-
flowbase docs catalogs
|
|
119
|
+
flowbase docs catalogs authoring # required fields, draftRevision sources, common mistakes
|
|
120
|
+
flowbase docs catalogs field-types # types, constraints, filter operators, record values, create examples
|
|
121
|
+
flowbase docs catalogs view-filters # view filter operators and value shapes (not page-rules)
|
|
122
|
+
flowbase docs catalogs record-values # how to write records.values by field type
|
|
116
123
|
flowbase docs catalogs workflow-nodes # node types with in/out edge rules
|
|
117
124
|
flowbase docs catalogs permissions # function permission points + data scopes
|
|
118
125
|
flowbase docs catalogs dashboard-filters # filter types + date-range presets
|
|
119
|
-
flowbase docs catalogs page-components #
|
|
126
|
+
flowbase docs catalogs page-components # Page component shapes, placement, fields, and enums
|
|
127
|
+
flowbase docs catalogs page-rules # Page condition operators and action shapes
|
|
120
128
|
flowbase docs catalogs id-prefixes # resource ID prefix meanings
|
|
121
129
|
flowbase docs catalogs icons # icon guidance + examples
|
|
122
130
|
```
|
|
123
131
|
|
|
132
|
+
Read `authoring` before composing any write. It lists the mistakes that most often make generated commands fail: missing `description`/`type`, select options without `id`+`lifecycle`, `defaultValue: null` (omit the key instead), boolean view filters using `eq`, `records.list` being a column projection, `pages.list.pages` being a page count, and `objects.get` not returning `draftRevision`.
|
|
133
|
+
|
|
124
134
|
### The read → modify → write loop
|
|
125
135
|
|
|
126
|
-
Most `update` commands replace a **full snapshot** and accept an optional `baseRevision` for optimistic locking. The safe pattern is:
|
|
136
|
+
Most `update` commands replace a **full snapshot** and accept an optional `baseRevision` for optimistic locking. Check the relevant offline catalog for its exact update envelope and read-only response fields. The safe pattern is:
|
|
127
137
|
|
|
128
138
|
```bash
|
|
129
139
|
flowbase dashboards get dsh_xxx > current.json # authoritative snapshot
|
|
@@ -131,20 +141,24 @@ flowbase dashboards get dsh_xxx > current.json # authoritative snapshot
|
|
|
131
141
|
flowbase dashboards update dsh_xxx --json-file current.json
|
|
132
142
|
```
|
|
133
143
|
|
|
134
|
-
Do not compose update bodies from scratch when an existing resource exists
|
|
144
|
+
Do not compose update bodies from scratch when an existing resource exists. Start from `get`, then convert its read projection to the update envelope documented by the relevant catalog.
|
|
135
145
|
|
|
136
146
|
## 6. Recipes
|
|
137
147
|
|
|
138
148
|
### 6.1 Create an object with a field and a record
|
|
139
149
|
|
|
140
150
|
```bash
|
|
141
|
-
flowbase
|
|
142
|
-
flowbase
|
|
151
|
+
flowbase docs catalogs authoring
|
|
152
|
+
flowbase docs catalogs field-types
|
|
153
|
+
flowbase objects create --json '{"label":"Customer","key":"customer","description":"Customer records","icon":"IconUsers"}'
|
|
154
|
+
flowbase fields create obj_xxx --json '{"label":"Name","key":"name","description":"Customer name","type":"text.singleLine","typeVersion":"v1","permission":"required","constraints":{"maxLength":120}}'
|
|
143
155
|
flowbase records create obj_xxx --json '{"values":{"name":"Acme Corp"}}'
|
|
144
156
|
flowbase objects cli-edit-policy get obj_xxx
|
|
145
157
|
flowbase objects cli-edit-policy update obj_xxx --json '{"baseRevision":4,"policies":{"fld_xxx":"user_approval"}}' --yes
|
|
146
158
|
```
|
|
147
159
|
|
|
160
|
+
`records create` returns `{recordId}`; use it with `records get`.
|
|
161
|
+
|
|
148
162
|
Record `values` keys are **field keys** (`name`), not internal IDs (`fld_...`). IDs are `obj_`/`fld_`/`dsh_`/`wfl_`/`pag_`/`reg_`/`cmp_`-prefixed; see `docs catalogs id-prefixes`.
|
|
149
163
|
|
|
150
164
|
### 6.2 Edit and publish configuration on a test environment
|
|
@@ -161,7 +175,7 @@ flowbase changes commit --message "Add sales dashboard" --yes
|
|
|
161
175
|
flowbase changes release --message "Ship sales dashboard" --yes
|
|
162
176
|
```
|
|
163
177
|
|
|
164
|
-
Dashboard component code runs server-side in a sandbox and returns ECharts config / metric / table / markdown. Components and filters are validated on save;
|
|
178
|
+
Dashboard component code runs server-side in a sandbox and returns ECharts config / metric / table / markdown. Components and filters are validated on save; use `flowbase dashboards get <id>` to discover component IDs, then `flowbase dashboards run <dashboard_id> <component_id>` to inspect `ok/output/error/logs` in a read-only draft preview (requires metadata:read and records:read). Visual chart rendering still requires the web UI.
|
|
165
179
|
|
|
166
180
|
### 6.3 Production hotfix
|
|
167
181
|
|
|
@@ -172,10 +186,14 @@ flowbase changes direct-release --message "Fix customer field" --yes
|
|
|
172
186
|
|
|
173
187
|
`direct-release` always runs a server-side preflight, prints the current version, diff summary, checks and risk, and binds a one-time confirmation token. `--yes` accepts that reviewed result; it never skips validation.
|
|
174
188
|
|
|
189
|
+
On production, `records.*` sees **released** metadata only. Creating records on a brand-new object before `direct-release` returns `404 内容不存在或已被删除`. Finish metadata, release, then seed.
|
|
190
|
+
|
|
175
191
|
### 6.4 Workflows, approvals, and pages
|
|
176
192
|
|
|
177
193
|
A workflow graph must satisfy structural rules: exactly one `trigger` node, at least one `end` node, a DAG, and valid per-type edges. See `docs catalogs workflow-nodes` before composing `nodes`/`edges`.
|
|
178
194
|
|
|
195
|
+
Workflow conditions use `fieldId` for current-object fields and add `relationFieldId` for a one-hop related field. Field-value references use `valueRef` plus optional `valueRefRelationFieldId`. An `updateRelated` node selects the target record with its required `relationFieldId`; its assignment `fieldId` values belong to that related object. Use `workflows list` to retrieve the current object fields and the available `relations` with target fields.
|
|
196
|
+
|
|
179
197
|
Approval flow graphs are separate metadata: exactly one `trigger`, at least one `approval` node, both `approvedEnd` and `rejectedEnd`, and dual outcome edges from each approval node. Employee task decisions are not available via API key / CLI. See `docs catalogs approval-nodes`.
|
|
180
198
|
|
|
181
199
|
```bash
|
|
@@ -189,24 +207,39 @@ flowbase docs example approvals.create --output approval.json
|
|
|
189
207
|
flowbase approvals create obj_xxx --json-file approval.json
|
|
190
208
|
flowbase approvals set-enabled obj_xxx apr_xxx --base-revision 4 --enabled --yes
|
|
191
209
|
|
|
192
|
-
flowbase docs catalogs page-components #
|
|
210
|
+
flowbase docs catalogs page-components # all component shapes and placement rules
|
|
211
|
+
flowbase docs catalogs page-rules # conditions, operators, and actions
|
|
212
|
+
flowbase pages options # objects, fields, and lookup constraints
|
|
193
213
|
flowbase docs example pages.create --output page.json # create-page layout template
|
|
194
214
|
flowbase pages create --json-file page.json
|
|
195
215
|
flowbase pages set-default pag_xxx --base-revision 4 --yes
|
|
196
216
|
|
|
197
|
-
# Detail pages
|
|
198
|
-
|
|
199
|
-
#
|
|
217
|
+
# Detail pages support detailSummary, stageBar, tabs, relatedSummary,
|
|
218
|
+
# attachmentCard, noticeBlock, relatedList, and approval components.
|
|
219
|
+
# A placed field uses sourcePath=[] for the Page object, or 1-2
|
|
220
|
+
# {relationFieldId,targetObjectId} hops for a related object field.
|
|
221
|
+
# Component visibility uses a page-rules setComponentVisibility action
|
|
222
|
+
# targeting the stable cmp_ ID returned by pages get.
|
|
223
|
+
# Save and read back a newly added component before adding a rule for it.
|
|
224
|
+
flowbase pages get pag_xxx > page-read.json
|
|
225
|
+
# Build page.json as {baseRevision: page-read.draftRevision, page: page-read.page},
|
|
226
|
+
# then remove the read-only Page keys listed by page-components.
|
|
227
|
+
# Or start from the complete offline example:
|
|
228
|
+
flowbase docs example pages.update --output page.json
|
|
200
229
|
flowbase pages update pag_xxx --json-file page.json
|
|
201
230
|
```
|
|
202
231
|
|
|
203
232
|
### 6.5 Records and attachments
|
|
204
233
|
|
|
234
|
+
`records.list` is a **column projection** of the current view (often only the title field). Use `records.get` for the full `values` object. `values` keys are field keys; select/lookup values are option/record IDs.
|
|
235
|
+
|
|
205
236
|
```bash
|
|
206
237
|
flowbase records list obj_xxx --page 1
|
|
207
238
|
flowbase records get obj_xxx rec_xxx
|
|
239
|
+
flowbase docs catalogs record-values
|
|
240
|
+
flowbase records create obj_xxx --json '{"values":{"name":"Ada","status":"opt_xxx","class":"rec_xxx"}}'
|
|
208
241
|
flowbase records upload-attachment obj_xxx fld_xxx ./contract.pdf
|
|
209
|
-
flowbase records update obj_xxx rec_xxx --json '{"values":{"
|
|
242
|
+
flowbase records update obj_xxx rec_xxx --json '{"values":{"attachments":["att_xxx"]}}'
|
|
210
243
|
flowbase records download-attachment obj_xxx rec_xxx att_xxx --output ./contract.pdf
|
|
211
244
|
```
|
|
212
245
|
|
|
@@ -236,3 +269,13 @@ flowbase roles update rol_xxx --json-file role.json
|
|
|
236
269
|
| Invalid request field or business rule | 400 / 422; `detail` explains the reason |
|
|
237
270
|
| Resource not found | 404 |
|
|
238
271
|
| Destructive command without `--yes` in automation | CLI refuses before any network call |
|
|
272
|
+
|
|
273
|
+
## 8. Verification and cleanup
|
|
274
|
+
|
|
275
|
+
- `flowbase organization employees --query Ada --page 1`: discover real approval references; follow the returned `pages`. `organization departments` returns the full department tree.
|
|
276
|
+
- `flowbase records list obj_xxx --view-id viw_xxx`: query a specific active view. Invalid IDs return an error instead of silently selecting another view.
|
|
277
|
+
- `flowbase pages evaluate pag_xxx --json '{"values":{"done":true}}'`: evaluate draft rules on editor-style values. Returns rule overrides keyed by field/component IDs; does not render a page, validate record values, execute buttons, or write records.
|
|
278
|
+
- `flowbase pages clear-default pag_xxx --base-revision 4 --yes`: remove only this page's default assignment, including on a deleted object, then use `pages delete` with the newly returned revision.
|
|
279
|
+
- `docs catalogs page-buttons`, `workflow-branches`, `approval-rules`, and `dashboard-runtime` describe complex configuration and runtime limits.
|
|
280
|
+
|
|
281
|
+
Transport requests time out after 60 seconds. A lost write response has an unknown outcome: read the resource and current revision before retrying. The CLI never automatically retries writes.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`flowbase` is the official command line client for the FlowBase OpenAPI. It manages apps, objects, fields, views, custom pages, workflows, approval flows, dashboards, business records, roles, and configuration versions across the three FlowBase environments.
|
|
4
4
|
|
|
5
|
+
FlowBase is a low-code platform. Start with `flowbase guide` (offline): discover apps and objects, read fields, then configure and verify. Use `flowbase guide --format json` for structured guidance.
|
|
6
|
+
|
|
5
7
|
## 1. Install and connect
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -63,6 +65,8 @@ Each operation is in `metadata:read`, `metadata:write`, `records:read`, or `reco
|
|
|
63
65
|
```text
|
|
64
66
|
flowbase
|
|
65
67
|
├── docs list | show | example | operations Offline endpoint catalog
|
|
68
|
+
├── guide Offline product and task guide (--format markdown|json)
|
|
69
|
+
├── organization employees | departments
|
|
66
70
|
├── apps list | get | create | update | set-enabled | delete
|
|
67
71
|
│ add-objects | remove-object | set-group | reorder-objects
|
|
68
72
|
│ add-dashboards | remove-dashboard | set-dashboard-group | reorder-members
|
|
@@ -73,8 +77,8 @@ flowbase
|
|
|
73
77
|
├── views list | create | update | reorder | set-enabled | delete
|
|
74
78
|
├── workflows list | get | create | update | reorder | set-enabled | delete | executions
|
|
75
79
|
├── approvals list | get | create | update | reorder | set-enabled | delete
|
|
76
|
-
├── pages list | options | get | create | update | set-default | delete | restore
|
|
77
|
-
├── dashboards list | get | create | update | copy | delete
|
|
80
|
+
├── pages list | options | get | create | update | set-default | clear-default | delete | restore | evaluate
|
|
81
|
+
├── dashboards list | get | create | update | copy | delete | run
|
|
78
82
|
├── changes commit | release | direct-release
|
|
79
83
|
├── versions list | show | releases Read-only history
|
|
80
84
|
├── environments restart Destructive test-env reset
|
|
@@ -82,7 +86,7 @@ flowbase
|
|
|
82
86
|
└── roles list | options | get | create | update | delete (production only)
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
Global flags: `--host`, `--api-key`, `--pretty`/`--no-pretty`, `--raw`.
|
|
89
|
+
Global flags: `--host`, `--api-key`, `--pretty`/`--no-pretty`, `--raw`. They may appear **before or after** the subcommand (`flowbase apps list --no-pretty` is valid).
|
|
86
90
|
|
|
87
91
|
## 5. Discovering request bodies
|
|
88
92
|
|
|
@@ -103,18 +107,24 @@ Complex bodies reference closed sets that are not guessable from examples. Query
|
|
|
103
107
|
|
|
104
108
|
```bash
|
|
105
109
|
flowbase docs catalogs # list available catalogs
|
|
106
|
-
flowbase docs catalogs
|
|
110
|
+
flowbase docs catalogs authoring # required fields, draftRevision sources, common mistakes
|
|
111
|
+
flowbase docs catalogs field-types # types, constraints, filter operators, record values, create examples
|
|
112
|
+
flowbase docs catalogs view-filters # view filter operators and value shapes (not page-rules)
|
|
113
|
+
flowbase docs catalogs record-values # how to write records.values by field type
|
|
107
114
|
flowbase docs catalogs workflow-nodes # node types with in/out edge rules
|
|
108
115
|
flowbase docs catalogs permissions # function permission points + data scopes
|
|
109
116
|
flowbase docs catalogs dashboard-filters # filter types + date-range presets
|
|
110
|
-
flowbase docs catalogs page-components #
|
|
117
|
+
flowbase docs catalogs page-components # Page component shapes, placement, fields, and enums
|
|
118
|
+
flowbase docs catalogs page-rules # Page condition operators and action shapes
|
|
111
119
|
flowbase docs catalogs id-prefixes # resource ID prefix meanings
|
|
112
120
|
flowbase docs catalogs icons # icon guidance + examples
|
|
113
121
|
```
|
|
114
122
|
|
|
123
|
+
Read `authoring` before composing any write. It lists the mistakes that most often make generated commands fail: missing `description`/`type`, select options without `id`+`lifecycle`, `defaultValue: null` (omit the key instead), boolean view filters using `eq`, `records.list` being a column projection, `pages.list.pages` being a page count, and `objects.get` not returning `draftRevision`.
|
|
124
|
+
|
|
115
125
|
### The read → modify → write loop
|
|
116
126
|
|
|
117
|
-
Most `update` commands replace a **full snapshot** and accept an optional `baseRevision` for optimistic locking. The safe pattern is:
|
|
127
|
+
Most `update` commands replace a **full snapshot** and accept an optional `baseRevision` for optimistic locking. Check the relevant offline catalog for its exact update envelope and read-only response fields. The safe pattern is:
|
|
118
128
|
|
|
119
129
|
```bash
|
|
120
130
|
flowbase dashboards get dsh_xxx > current.json # authoritative snapshot
|
|
@@ -122,20 +132,24 @@ flowbase dashboards get dsh_xxx > current.json # authoritative snapshot
|
|
|
122
132
|
flowbase dashboards update dsh_xxx --json-file current.json
|
|
123
133
|
```
|
|
124
134
|
|
|
125
|
-
Do not compose update bodies from scratch when an existing resource exists
|
|
135
|
+
Do not compose update bodies from scratch when an existing resource exists. Start from `get`, then convert its read projection to the update envelope documented by the relevant catalog.
|
|
126
136
|
|
|
127
137
|
## 6. Recipes
|
|
128
138
|
|
|
129
139
|
### 6.1 Create an object with a field and a record
|
|
130
140
|
|
|
131
141
|
```bash
|
|
132
|
-
flowbase
|
|
133
|
-
flowbase
|
|
142
|
+
flowbase docs catalogs authoring
|
|
143
|
+
flowbase docs catalogs field-types
|
|
144
|
+
flowbase objects create --json '{"label":"Customer","key":"customer","description":"Customer records","icon":"IconUsers"}'
|
|
145
|
+
flowbase fields create obj_xxx --json '{"label":"Name","key":"name","description":"Customer name","type":"text.singleLine","typeVersion":"v1","permission":"required","constraints":{"maxLength":120}}'
|
|
134
146
|
flowbase records create obj_xxx --json '{"values":{"name":"Acme Corp"}}'
|
|
135
147
|
flowbase objects cli-edit-policy get obj_xxx
|
|
136
148
|
flowbase objects cli-edit-policy update obj_xxx --json '{"baseRevision":4,"policies":{"fld_xxx":"user_approval"}}' --yes
|
|
137
149
|
```
|
|
138
150
|
|
|
151
|
+
`records create` returns `{recordId}`; use it with `records get`.
|
|
152
|
+
|
|
139
153
|
Record `values` keys are **field keys** (`name`), not internal IDs (`fld_...`). IDs are `obj_`/`fld_`/`dsh_`/`wfl_`/`pag_`/`reg_`/`cmp_`-prefixed; see `docs catalogs id-prefixes`.
|
|
140
154
|
|
|
141
155
|
### 6.2 Edit and publish configuration on a test environment
|
|
@@ -152,7 +166,7 @@ flowbase changes commit --message "Add sales dashboard" --yes
|
|
|
152
166
|
flowbase changes release --message "Ship sales dashboard" --yes
|
|
153
167
|
```
|
|
154
168
|
|
|
155
|
-
Dashboard component code runs server-side in a sandbox and returns ECharts config / metric / table / markdown. Components and filters are validated on save;
|
|
169
|
+
Dashboard component code runs server-side in a sandbox and returns ECharts config / metric / table / markdown. Components and filters are validated on save; use `flowbase dashboards get <id>` to discover component IDs, then `flowbase dashboards run <dashboard_id> <component_id>` to inspect `ok/output/error/logs` in a read-only draft preview (requires metadata:read and records:read). Visual chart rendering still requires the web UI.
|
|
156
170
|
|
|
157
171
|
### 6.3 Production hotfix
|
|
158
172
|
|
|
@@ -163,10 +177,14 @@ flowbase changes direct-release --message "Fix customer field" --yes
|
|
|
163
177
|
|
|
164
178
|
`direct-release` always runs a server-side preflight, prints the current version, diff summary, checks and risk, and binds a one-time confirmation token. `--yes` accepts that reviewed result; it never skips validation.
|
|
165
179
|
|
|
180
|
+
On production, `records.*` sees **released** metadata only. Creating records on a brand-new object before `direct-release` returns `404 内容不存在或已被删除`. Finish metadata, release, then seed.
|
|
181
|
+
|
|
166
182
|
### 6.4 Workflows, approvals, and pages
|
|
167
183
|
|
|
168
184
|
A workflow graph must satisfy structural rules: exactly one `trigger` node, at least one `end` node, a DAG, and valid per-type edges. See `docs catalogs workflow-nodes` before composing `nodes`/`edges`.
|
|
169
185
|
|
|
186
|
+
Workflow conditions use `fieldId` for current-object fields and add `relationFieldId` for a one-hop related field. Field-value references use `valueRef` plus optional `valueRefRelationFieldId`. An `updateRelated` node selects the target record with its required `relationFieldId`; its assignment `fieldId` values belong to that related object. Use `workflows list` to retrieve the current object fields and the available `relations` with target fields.
|
|
187
|
+
|
|
170
188
|
Approval flow graphs are separate metadata: exactly one `trigger`, at least one `approval` node, both `approvedEnd` and `rejectedEnd`, and dual outcome edges from each approval node. Employee task decisions are not available via API key / CLI. See `docs catalogs approval-nodes`.
|
|
171
189
|
|
|
172
190
|
```bash
|
|
@@ -180,24 +198,39 @@ flowbase docs example approvals.create --output approval.json
|
|
|
180
198
|
flowbase approvals create obj_xxx --json-file approval.json
|
|
181
199
|
flowbase approvals set-enabled obj_xxx apr_xxx --base-revision 4 --enabled --yes
|
|
182
200
|
|
|
183
|
-
flowbase docs catalogs page-components #
|
|
201
|
+
flowbase docs catalogs page-components # all component shapes and placement rules
|
|
202
|
+
flowbase docs catalogs page-rules # conditions, operators, and actions
|
|
203
|
+
flowbase pages options # objects, fields, and lookup constraints
|
|
184
204
|
flowbase docs example pages.create --output page.json # create-page layout template
|
|
185
205
|
flowbase pages create --json-file page.json
|
|
186
206
|
flowbase pages set-default pag_xxx --base-revision 4 --yes
|
|
187
207
|
|
|
188
|
-
# Detail pages
|
|
189
|
-
|
|
190
|
-
#
|
|
208
|
+
# Detail pages support detailSummary, stageBar, tabs, relatedSummary,
|
|
209
|
+
# attachmentCard, noticeBlock, relatedList, and approval components.
|
|
210
|
+
# A placed field uses sourcePath=[] for the Page object, or 1-2
|
|
211
|
+
# {relationFieldId,targetObjectId} hops for a related object field.
|
|
212
|
+
# Component visibility uses a page-rules setComponentVisibility action
|
|
213
|
+
# targeting the stable cmp_ ID returned by pages get.
|
|
214
|
+
# Save and read back a newly added component before adding a rule for it.
|
|
215
|
+
flowbase pages get pag_xxx > page-read.json
|
|
216
|
+
# Build page.json as {baseRevision: page-read.draftRevision, page: page-read.page},
|
|
217
|
+
# then remove the read-only Page keys listed by page-components.
|
|
218
|
+
# Or start from the complete offline example:
|
|
219
|
+
flowbase docs example pages.update --output page.json
|
|
191
220
|
flowbase pages update pag_xxx --json-file page.json
|
|
192
221
|
```
|
|
193
222
|
|
|
194
223
|
### 6.5 Records and attachments
|
|
195
224
|
|
|
225
|
+
`records.list` is a **column projection** of the current view (often only the title field). Use `records.get` for the full `values` object. `values` keys are field keys; select/lookup values are option/record IDs.
|
|
226
|
+
|
|
196
227
|
```bash
|
|
197
228
|
flowbase records list obj_xxx --page 1
|
|
198
229
|
flowbase records get obj_xxx rec_xxx
|
|
230
|
+
flowbase docs catalogs record-values
|
|
231
|
+
flowbase records create obj_xxx --json '{"values":{"name":"Ada","status":"opt_xxx","class":"rec_xxx"}}'
|
|
199
232
|
flowbase records upload-attachment obj_xxx fld_xxx ./contract.pdf
|
|
200
|
-
flowbase records update obj_xxx rec_xxx --json '{"values":{"
|
|
233
|
+
flowbase records update obj_xxx rec_xxx --json '{"values":{"attachments":["att_xxx"]}}'
|
|
201
234
|
flowbase records download-attachment obj_xxx rec_xxx att_xxx --output ./contract.pdf
|
|
202
235
|
```
|
|
203
236
|
|
|
@@ -227,3 +260,13 @@ flowbase roles update rol_xxx --json-file role.json
|
|
|
227
260
|
| Invalid request field or business rule | 400 / 422; `detail` explains the reason |
|
|
228
261
|
| Resource not found | 404 |
|
|
229
262
|
| Destructive command without `--yes` in automation | CLI refuses before any network call |
|
|
263
|
+
|
|
264
|
+
## 8. Verification and cleanup
|
|
265
|
+
|
|
266
|
+
- `flowbase organization employees --query Ada --page 1`: discover real approval references; follow the returned `pages`. `organization departments` returns the full department tree.
|
|
267
|
+
- `flowbase records list obj_xxx --view-id viw_xxx`: query a specific active view. Invalid IDs return an error instead of silently selecting another view.
|
|
268
|
+
- `flowbase pages evaluate pag_xxx --json '{"values":{"done":true}}'`: evaluate draft rules on editor-style values. Returns rule overrides keyed by field/component IDs; does not render a page, validate record values, execute buttons, or write records.
|
|
269
|
+
- `flowbase pages clear-default pag_xxx --base-revision 4 --yes`: remove only this page's default assignment, including on a deleted object, then use `pages delete` with the newly returned revision.
|
|
270
|
+
- `docs catalogs page-buttons`, `workflow-branches`, `approval-rules`, and `dashboard-runtime` describe complex configuration and runtime limits.
|
|
271
|
+
|
|
272
|
+
Transport requests time out after 60 seconds. A lost write response has an unknown outcome: read the resource and current revision before retrying. The CLI never automatically retries writes.
|