@josephyan/qingflow-cli 0.2.0-beta.56 → 0.2.0-beta.58
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
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @josephyan/qingflow-cli@0.2.0-beta.
|
|
6
|
+
npm install @josephyan/qingflow-cli@0.2.0-beta.58
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @josephyan/qingflow-cli@0.2.0-beta.
|
|
12
|
+
npx -y -p @josephyan/qingflow-cli@0.2.0-beta.58 qingflow
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@josephyan/qingflow-cli",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.58",
|
|
4
4
|
"description": "Human-friendly Qingflow command line interface for auth, record operations, import, tasks, and stable builder flows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/pyproject.toml
CHANGED
|
@@ -129,9 +129,9 @@ def _handle_fields_apply(args: argparse.Namespace, context: CliContext) -> dict:
|
|
|
129
129
|
app_title=args.app_title,
|
|
130
130
|
create_if_missing=bool(args.create_if_missing),
|
|
131
131
|
publish=bool(args.publish),
|
|
132
|
-
add_fields=_coerce_list(payload.get("add_fields")),
|
|
132
|
+
add_fields=[_normalize_field_spec(item) for item in _coerce_list(payload.get("add_fields"))],
|
|
133
133
|
update_fields=_coerce_list(payload.get("update_fields")),
|
|
134
|
-
remove_fields=_coerce_list(payload.get("remove_fields")),
|
|
134
|
+
remove_fields=[_normalize_field_selector(item) for item in _coerce_list(payload.get("remove_fields"))],
|
|
135
135
|
)
|
|
136
136
|
|
|
137
137
|
|
|
@@ -197,3 +197,26 @@ def _handle_publish_verify(args: argparse.Namespace, context: CliContext) -> dic
|
|
|
197
197
|
|
|
198
198
|
def _coerce_list(value: Any) -> list[Any]:
|
|
199
199
|
return value if isinstance(value, list) else []
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def _normalize_field_spec(value: Any) -> Any:
|
|
203
|
+
if not isinstance(value, dict):
|
|
204
|
+
return value
|
|
205
|
+
normalized = dict(value)
|
|
206
|
+
if "name" not in normalized and isinstance(normalized.get("field_name"), str):
|
|
207
|
+
normalized["name"] = normalized["field_name"]
|
|
208
|
+
if "type" not in normalized and isinstance(normalized.get("field_type"), str):
|
|
209
|
+
normalized["type"] = normalized["field_type"]
|
|
210
|
+
normalized.pop("field_name", None)
|
|
211
|
+
normalized.pop("field_type", None)
|
|
212
|
+
return normalized
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def _normalize_field_selector(value: Any) -> Any:
|
|
216
|
+
if not isinstance(value, dict):
|
|
217
|
+
return value
|
|
218
|
+
normalized = dict(value)
|
|
219
|
+
if "name" not in normalized and isinstance(normalized.get("field_name"), str):
|
|
220
|
+
normalized["name"] = normalized["field_name"]
|
|
221
|
+
normalized.pop("field_name", None)
|
|
222
|
+
return normalized
|
|
@@ -160,9 +160,9 @@ class BuilderOperations:
|
|
|
160
160
|
app_title=app_title,
|
|
161
161
|
create_if_missing=create_if_missing,
|
|
162
162
|
publish=publish,
|
|
163
|
-
add_fields=add_fields,
|
|
164
|
-
update_fields=update_fields,
|
|
165
|
-
remove_fields=remove_fields,
|
|
163
|
+
add_fields=[_normalize_field_spec(item) for item in add_fields],
|
|
164
|
+
update_fields=[_normalize_field_update(item) for item in update_fields],
|
|
165
|
+
remove_fields=[_normalize_field_selector(item) for item in remove_fields],
|
|
166
166
|
),
|
|
167
167
|
)
|
|
168
168
|
|
|
@@ -321,3 +321,37 @@ class BuilderOperations:
|
|
|
321
321
|
if verified is not None:
|
|
322
322
|
meta["verified"] = verified
|
|
323
323
|
return success_result(code, message, data=data, warnings=warnings, meta=meta, legacy=raw)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def _normalize_field_spec(value: Any) -> Any:
|
|
327
|
+
if not isinstance(value, dict):
|
|
328
|
+
return value
|
|
329
|
+
normalized = dict(value)
|
|
330
|
+
if "name" not in normalized and isinstance(normalized.get("field_name"), str):
|
|
331
|
+
normalized["name"] = normalized["field_name"]
|
|
332
|
+
if "type" not in normalized and isinstance(normalized.get("field_type"), str):
|
|
333
|
+
normalized["type"] = normalized["field_type"]
|
|
334
|
+
normalized.pop("field_name", None)
|
|
335
|
+
normalized.pop("field_type", None)
|
|
336
|
+
return normalized
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
def _normalize_field_selector(value: Any) -> Any:
|
|
340
|
+
if not isinstance(value, dict):
|
|
341
|
+
return value
|
|
342
|
+
normalized = dict(value)
|
|
343
|
+
if "name" not in normalized and isinstance(normalized.get("field_name"), str):
|
|
344
|
+
normalized["name"] = normalized["field_name"]
|
|
345
|
+
normalized.pop("field_name", None)
|
|
346
|
+
return normalized
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def _normalize_field_update(value: Any) -> Any:
|
|
350
|
+
if not isinstance(value, dict):
|
|
351
|
+
return value
|
|
352
|
+
normalized = dict(value)
|
|
353
|
+
if isinstance(normalized.get("selector"), dict):
|
|
354
|
+
normalized["selector"] = _normalize_field_selector(normalized["selector"])
|
|
355
|
+
if isinstance(normalized.get("set"), dict):
|
|
356
|
+
normalized["set"] = _normalize_field_spec(normalized["set"])
|
|
357
|
+
return normalized
|