bpmax-cli 0.1.44-beta.9 → 0.1.44
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 +5 -3
- package/dist/bin.js +461 -4663
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +0 -98
- package/skills/bpmax-auth/SKILL.md +17 -6
- package/skills/bpmax-cli/SKILL.md +0 -2
- package/skills/bpmax-project/SKILL.md +2 -1
- package/skills/bpmax-shared/SKILL.md +1 -1
- package/skills/bpmax-api-platform-editor/SKILL.md +0 -321
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-api-platform-editor/references/api-doc-debug-workflow.md +0 -34
- package/skills/bpmax-api-platform-editor/references/api-proxy-shape.md +0 -41
- package/skills/bpmax-api-platform-editor/references/instance-config-shape.md +0 -41
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +0 -52
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +0 -32
- package/skills/bpmax-api-platform-editor/scripts/api_platform_editor_common.py +0 -1276
- package/skills/bpmax-api-platform-editor/scripts/build_submit_payload.py +0 -64
- package/skills/bpmax-api-platform-editor/scripts/capture_write_contract.py +0 -40
- package/skills/bpmax-api-platform-editor/scripts/export_layer_bundle.py +0 -212
- package/skills/bpmax-api-platform-editor/scripts/record_doc_debug_acceptance.py +0 -62
- package/skills/bpmax-api-platform-editor/scripts/submit_and_verify_layer.py +0 -75
- package/skills/bpmax-api-platform-editor/tests/test_api_platform_editor.py +0 -287
- package/skills/bpmax-builder-shared/SKILL.md +0 -44
- package/skills/bpmax-builder-shared/base_url.py +0 -81
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.json +0 -71
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.md +0 -34
- package/skills/bpmax-builder-shared/runtime-script-template-catalog.md +0 -123
- package/skills/bpmax-builder-shared/runtime_script_rules.py +0 -272
- package/skills/bpmax-builder-shared/skill_audit.py +0 -374
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +0 -280
- package/skills/bpmax-builder-shared/tests/test_base_url.py +0 -80
- package/skills/bpmax-builder-shared/tests/test_runtime_script_rules.py +0 -115
- package/skills/bpmax-builder-shared/tests/test_skill_audit.py +0 -231
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +0 -281
- package/skills/bpmax-config-latest/SKILL.md +0 -71
- package/skills/bpmax-console-template-editor/SKILL.md +0 -536
- package/skills/bpmax-console-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-console-template-editor/references/filter-integration.md +0 -60
- package/skills/bpmax-console-template-editor/references/lessons-from-resume-dashboard.md +0 -114
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +0 -69
- package/skills/bpmax-console-template-editor/references/module-catalog.md +0 -100
- package/skills/bpmax-console-template-editor/references/runtime-page-shape.md +0 -91
- package/skills/bpmax-console-template-editor/references/template-shape.md +0 -149
- package/skills/bpmax-console-template-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-console-template-editor/scripts/confirm_console_template.py +0 -33
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +0 -964
- package/skills/bpmax-console-template-editor/scripts/export_console_template.py +0 -99
- package/skills/bpmax-console-template-editor/scripts/lint_console_template.py +0 -46
- package/skills/bpmax-console-template-editor/scripts/submit_console_template.py +0 -99
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +0 -383
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +0 -600
- package/skills/bpmax-dataset-field-template-editor/references/create-request-gotchas.md +0 -25
- package/skills/bpmax-dataset-field-template-editor/references/field-classify-mapping.md +0 -35
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +0 -24
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +0 -61
- package/skills/bpmax-dataset-field-template-editor/references/virtual-field-patterns.md +0 -27
- package/skills/bpmax-dataset-field-template-editor/references/work-file-to-submit-mapping.md +0 -127
- package/skills/bpmax-dataset-field-template-editor/scripts/build_submit_payload.py +0 -67
- package/skills/bpmax-dataset-field-template-editor/scripts/confirm_dataset_field.py +0 -37
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +0 -784
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +0 -62
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +0 -104
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +0 -83
- package/skills/bpmax-dataset-field-template-editor/scripts/lint_dataset_field_semantics.py +0 -35
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +0 -95
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +0 -709
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +0 -59
- package/skills/bpmax-dataset-template-editor/SKILL.md +0 -779
- package/skills/bpmax-dataset-template-editor/references/custom-key-usage-patterns.md +0 -18
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +0 -73
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-authoring-guide.md +0 -186
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-example-catalog.md +0 -106
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +0 -28
- package/skills/bpmax-dataset-template-editor/references/runtime-verified-dataset-page-shape.md +0 -47
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +0 -23
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +0 -97
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +0 -65
- package/skills/bpmax-dataset-template-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +0 -650
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +0 -155
- package/skills/bpmax-dataset-template-editor/scripts/lint_dataset_template.py +0 -42
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +0 -43
- package/skills/bpmax-dataset-template-editor/scripts/scan_custom_key_references.py +0 -27
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +0 -115
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +0 -52
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +0 -39
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +0 -373
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +0 -177
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +0 -4
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +0 -60
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +0 -394
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +0 -5
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale.json +0 -97
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_final_v2.json +0 -105
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_main.json +0 -36
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_region.json +0 -40
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +0 -41
- package/skills/bpmax-e2e-flow-test-operator/references/failure-update-loop.md +0 -17
- package/skills/bpmax-e2e-flow-test-operator/references/filter-field-discovery.md +0 -40
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +0 -24
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +0 -75
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +0 -107
- package/skills/bpmax-e2e-flow-test-operator/references/skill-experience-coverage-matrix.md +0 -29
- package/skills/bpmax-e2e-flow-test-operator/references/stale-runtime-and-clean-sample-rules.md +0 -54
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +0 -83
- package/skills/bpmax-e2e-flow-test-operator/scripts/bpmax_session.py +0 -287
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_plan.json +0 -59
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_runner.py +0 -687
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +0 -121
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +0 -288
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_api_matrix.py +0 -161
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_filter_fields.py +0 -138
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_form_runtime.py +0 -396
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +0 -341
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_test_profile.py +0 -185
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +0 -138
- package/skills/bpmax-feishu-chat-flow-plugin-editor/SKILL.md +0 -69
- package/skills/bpmax-feishu-chat-flow-plugin-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-checklist.md +0 -42
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-recipes.md +0 -38
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-shape.md +0 -86
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/gate-lint.md +0 -68
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/hoocoo-patterns.md +0 -39
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/runtime-behavior.md +0 -41
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/script-authoring.md +0 -110
- package/skills/bpmax-feishu-chat-flow-plugin-editor/scripts/lint_feishu_chat_plugin.py +0 -278
- package/skills/bpmax-feishu-chat-flow-plugin-editor/tests/test_lint_feishu_chat_plugin.py +0 -203
- package/skills/bpmax-filter-template-editor/SKILL.md +0 -564
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +0 -38
- package/skills/bpmax-filter-template-editor/references/filter-and-flow-binding.md +0 -57
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +0 -141
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +0 -287
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +0 -115
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +0 -94
- package/skills/bpmax-filter-template-editor/scripts/build_submit_payload.py +0 -25
- package/skills/bpmax-filter-template-editor/scripts/confirm_filter_template.py +0 -22
- package/skills/bpmax-filter-template-editor/scripts/export_filter_template.py +0 -57
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +0 -348
- package/skills/bpmax-filter-template-editor/scripts/init_create_filter_template.py +0 -8
- package/skills/bpmax-filter-template-editor/scripts/lint_filter_template_semantics.py +0 -26
- package/skills/bpmax-filter-template-editor/scripts/submit_filter_template.py +0 -62
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +0 -231
- package/skills/bpmax-flow-template-editor/SKILL.md +0 -1058
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-flow-template-editor/references/before-next-step-script-runtime-gotchas.md +0 -62
- package/skills/bpmax-flow-template-editor/references/config-surfaces-and-placeholders.md +0 -270
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +0 -67
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +0 -25
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +0 -174
- package/skills/bpmax-flow-template-editor/references/intent-model.md +0 -117
- package/skills/bpmax-flow-template-editor/references/lessons-from-price-plan-flow.md +0 -147
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +0 -97
- package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +0 -165
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +0 -133
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +0 -54
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +0 -149
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +0 -41
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +0 -155
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +0 -179
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +0 -91
- package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +0 -93
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +0 -57
- package/skills/bpmax-flow-template-editor/scripts/build_submit_payload.py +0 -69
- package/skills/bpmax-flow-template-editor/scripts/confirm_flow_template.py +0 -52
- package/skills/bpmax-flow-template-editor/scripts/export_flow_template.py +0 -114
- package/skills/bpmax-flow-template-editor/scripts/flow_template_editor_common.py +0 -1084
- package/skills/bpmax-flow-template-editor/scripts/submit_flow_template.py +0 -159
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +0 -636
- package/skills/bpmax-form-template-editor/SKILL.md +0 -1099
- package/skills/bpmax-form-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +0 -203
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +0 -125
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +0 -77
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +0 -49
- package/skills/bpmax-form-template-editor/scripts/build_submit_payload.py +0 -37
- package/skills/bpmax-form-template-editor/scripts/check_form_template_consistency.py +0 -145
- package/skills/bpmax-form-template-editor/scripts/confirm_form_template.py +0 -67
- package/skills/bpmax-form-template-editor/scripts/export_form_template.py +0 -91
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +0 -1762
- package/skills/bpmax-form-template-editor/scripts/lint_form_template_semantics.py +0 -30
- package/skills/bpmax-form-template-editor/scripts/record_runtime_acceptance.py +0 -67
- package/skills/bpmax-form-template-editor/scripts/submit_form_template.py +0 -163
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +0 -1292
- package/skills/bpmax-list-template-editor/SKILL.md +0 -468
- package/skills/bpmax-list-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-list-template-editor/references/browser-page-contract.md +0 -81
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +0 -148
- package/skills/bpmax-list-template-editor/references/dataset-field-mapping.md +0 -60
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +0 -103
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +0 -102
- package/skills/bpmax-list-template-editor/references/payload-checklist.md +0 -47
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +0 -140
- package/skills/bpmax-list-template-editor/references/special-formats.md +0 -394
- package/skills/bpmax-list-template-editor/scripts/build_submit_payload.py +0 -37
- package/skills/bpmax-list-template-editor/scripts/confirm_list_template.py +0 -33
- package/skills/bpmax-list-template-editor/scripts/export_list_template.py +0 -89
- package/skills/bpmax-list-template-editor/scripts/fetch_data_set.py +0 -34
- package/skills/bpmax-list-template-editor/scripts/lint_list_template_semantics.py +0 -54
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +0 -955
- package/skills/bpmax-list-template-editor/scripts/record_acceptance.py +0 -55
- package/skills/bpmax-list-template-editor/scripts/submit_list_template.py +0 -117
- package/skills/bpmax-list-template-editor/tests/test_list_template_editor_common.py +0 -441
- package/skills/bpmax-memory-protocol/SKILL.md +0 -72
- package/skills/bpmax-nav-config-editor/SKILL.md +0 -347
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +0 -68
- package/skills/bpmax-nav-config-editor/references/config-shape.md +0 -78
- package/skills/bpmax-nav-config-editor/references/icon-selection.md +0 -83
- package/skills/bpmax-nav-config-editor/references/path-mapping-rules.md +0 -46
- package/skills/bpmax-nav-config-editor/references/payload-checklist.md +0 -41
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +0 -47
- package/skills/bpmax-nav-config-editor/scripts/build_submit_payload.py +0 -34
- package/skills/bpmax-nav-config-editor/scripts/confirm_nav_config.py +0 -32
- package/skills/bpmax-nav-config-editor/scripts/export_nav_config.py +0 -56
- package/skills/bpmax-nav-config-editor/scripts/lint_nav_config_semantics.py +0 -33
- package/skills/bpmax-nav-config-editor/scripts/nav_config_editor_common.py +0 -812
- package/skills/bpmax-nav-config-editor/scripts/submit_nav_config.py +0 -44
- package/skills/bpmax-nav-config-editor/scripts/verify_nav_config.py +0 -33
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor.py +0 -358
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor_common.py +0 -138
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_lint.py +0 -58
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_submit_verify.py +0 -51
- package/skills/bpmax-project-detail-template-editor/SKILL.md +0 -329
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-project-detail-template-editor/references/local-temp-workflow.md +0 -59
- package/skills/bpmax-project-detail-template-editor/references/module-catalog-and-config-notes.md +0 -47
- package/skills/bpmax-project-detail-template-editor/references/payload-checklist.md +0 -33
- package/skills/bpmax-project-detail-template-editor/references/project-detail-template-api-workflow.md +0 -44
- package/skills/bpmax-project-detail-template-editor/scripts/build_submit_payload.py +0 -30
- package/skills/bpmax-project-detail-template-editor/scripts/confirm_project_detail_template.py +0 -33
- package/skills/bpmax-project-detail-template-editor/scripts/export_project_detail_template.py +0 -87
- package/skills/bpmax-project-detail-template-editor/scripts/lint_project_detail_template_semantics.py +0 -37
- package/skills/bpmax-project-detail-template-editor/scripts/project_detail_template_editor_common.py +0 -507
- package/skills/bpmax-project-detail-template-editor/scripts/submit_project_detail_template.py +0 -120
- package/skills/bpmax-project-detail-template-editor/tests/test_project_detail_template_editor.py +0 -369
- package/skills/bpmax-role-editor/SKILL.md +0 -251
- package/skills/bpmax-role-editor/references/api-workflow.md +0 -30
- package/skills/bpmax-role-editor/references/runtime-page-shape.md +0 -18
- package/skills/bpmax-role-editor/references/work-file-mapping.md +0 -32
- package/skills/bpmax-role-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-role-editor/scripts/confirm_role.py +0 -33
- package/skills/bpmax-role-editor/scripts/export_role.py +0 -163
- package/skills/bpmax-role-editor/scripts/lint_role_semantics.py +0 -38
- package/skills/bpmax-role-editor/scripts/role_editor_common.py +0 -1231
- package/skills/bpmax-role-editor/scripts/submit_role.py +0 -144
- package/skills/bpmax-role-editor/tests/test_role_editor.py +0 -343
- package/skills/bpmax-user-mock-operator/SKILL.md +0 -106
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +0 -4
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
- package/skills/form-control-library/SKILL.md +0 -82
- package/skills/form-control-library/agents/openai.yaml +0 -4
- package/skills/form-control-library/references/form-controls.md +0 -199
- package/skills/form-control-library/references/form-template-submit-schema.md +0 -180
- package/skills/form-control-library/references/group-select-runtime.md +0 -191
- package/skills/form-control-library/scripts/rebuild_form_control_library.py +0 -55
package/skills/bpmax-project-detail-template-editor/scripts/submit_project_detail_template.py
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
print(
|
|
7
|
-
"Legacy config submit scripts are disabled in bpmax-cli. Use `bpmax-cli config project-detail-template submit` so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
-
file=sys.stderr,
|
|
9
|
-
)
|
|
10
|
-
sys.exit(2)
|
|
11
|
-
|
|
12
|
-
import argparse
|
|
13
|
-
|
|
14
|
-
from project_detail_template_editor_common import (
|
|
15
|
-
build_client,
|
|
16
|
-
dump_json,
|
|
17
|
-
ensure_submission_allowed,
|
|
18
|
-
extract_template_id,
|
|
19
|
-
load_json,
|
|
20
|
-
parse_content,
|
|
21
|
-
persist_create_submission_meta,
|
|
22
|
-
paths_for,
|
|
23
|
-
summarize_verification,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def build_parser() -> argparse.ArgumentParser:
|
|
28
|
-
p = argparse.ArgumentParser(description="Submit, activate or delete a BPMAX project-detail-template payload and verify readback.")
|
|
29
|
-
p.add_argument("--stem")
|
|
30
|
-
p.add_argument("--action", choices=("submit", "activate", "delete"), default="submit")
|
|
31
|
-
p.add_argument("--template-id", type=int)
|
|
32
|
-
p.add_argument("--flow-type")
|
|
33
|
-
p.add_argument("--flow-key", default="")
|
|
34
|
-
p.add_argument("--workspace")
|
|
35
|
-
p.add_argument("--base-url")
|
|
36
|
-
p.add_argument("--language", default="zhCN")
|
|
37
|
-
p.add_argument("--cookie-header")
|
|
38
|
-
p.add_argument("--timeout", type=float, default=30)
|
|
39
|
-
p.add_argument("--insecure", action="store_true")
|
|
40
|
-
return p
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def main() -> int:
|
|
44
|
-
args = build_parser().parse_args()
|
|
45
|
-
client = build_client(args)
|
|
46
|
-
|
|
47
|
-
if args.action in ("activate", "delete"):
|
|
48
|
-
if not args.template_id:
|
|
49
|
-
raise SystemExit("--template-id is required for activate/delete")
|
|
50
|
-
if args.action == "activate":
|
|
51
|
-
if not args.flow_type:
|
|
52
|
-
raise SystemExit("--flow-type is required for activate")
|
|
53
|
-
response = client.activate_flow_page_template(args.template_id, flow_type=args.flow_type, flow_key=args.flow_key)
|
|
54
|
-
readback = client.get_flow_page_template(args.template_id).get("data") or {}
|
|
55
|
-
else:
|
|
56
|
-
response = client.delete_flow_page_template(args.template_id)
|
|
57
|
-
readback = {"id": args.template_id, "deleted": True}
|
|
58
|
-
result = {"action": args.action, "templateId": args.template_id, "response": response, "readback": readback}
|
|
59
|
-
if args.stem:
|
|
60
|
-
paths = paths_for(args.stem)
|
|
61
|
-
dump_json(paths["response"], response)
|
|
62
|
-
dump_json(paths["readback"], readback)
|
|
63
|
-
dump_json(paths["verify"], {"ok": True, **result})
|
|
64
|
-
print(paths["response"])
|
|
65
|
-
print(paths["readback"])
|
|
66
|
-
print(paths["verify"])
|
|
67
|
-
else:
|
|
68
|
-
print(result)
|
|
69
|
-
return 0
|
|
70
|
-
|
|
71
|
-
if not args.stem:
|
|
72
|
-
raise SystemExit("--stem is required for action=submit")
|
|
73
|
-
paths = paths_for(args.stem)
|
|
74
|
-
meta = ensure_submission_allowed(paths["meta"], paths["work"], paths["submit"])
|
|
75
|
-
action_mode = meta.get("mode")
|
|
76
|
-
submit_payload = load_json(paths["submit"])
|
|
77
|
-
|
|
78
|
-
if action_mode == "create":
|
|
79
|
-
response = client.create_flow_page_template(submit_payload)
|
|
80
|
-
template_id = extract_template_id(response)
|
|
81
|
-
if not template_id:
|
|
82
|
-
raise SystemExit("create response did not include a template id")
|
|
83
|
-
else:
|
|
84
|
-
template_id = meta.get("templateId")
|
|
85
|
-
if not template_id:
|
|
86
|
-
raise SystemExit("edit submission requires templateId in meta")
|
|
87
|
-
response = client.update_flow_page_template(int(template_id), submit_payload)
|
|
88
|
-
|
|
89
|
-
readback = client.get_flow_page_template(int(template_id)).get("data") or {}
|
|
90
|
-
if action_mode == "create":
|
|
91
|
-
persist_create_submission_meta(
|
|
92
|
-
paths["meta"],
|
|
93
|
-
stem=args.stem,
|
|
94
|
-
action_mode=action_mode,
|
|
95
|
-
template_id=int(template_id),
|
|
96
|
-
readback=readback,
|
|
97
|
-
)
|
|
98
|
-
verification = summarize_verification(submit_payload, readback)
|
|
99
|
-
dump_json(paths["response"], response)
|
|
100
|
-
dump_json(paths["readback"], readback)
|
|
101
|
-
dump_json(
|
|
102
|
-
paths["verify"],
|
|
103
|
-
{
|
|
104
|
-
"ok": verification["ok"],
|
|
105
|
-
"mode": action_mode,
|
|
106
|
-
"templateId": template_id,
|
|
107
|
-
"submittedContent": parse_content(submit_payload.get("content")),
|
|
108
|
-
"verification": verification,
|
|
109
|
-
},
|
|
110
|
-
)
|
|
111
|
-
print(paths["response"])
|
|
112
|
-
print(paths["readback"])
|
|
113
|
-
print(paths["verify"])
|
|
114
|
-
if not verification["ok"]:
|
|
115
|
-
raise SystemExit("readback verification failed; inspect verify.json for mismatches")
|
|
116
|
-
return 0
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if __name__ == "__main__":
|
|
120
|
-
raise SystemExit(main())
|
package/skills/bpmax-project-detail-template-editor/tests/test_project_detail_template_editor.py
DELETED
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
import tempfile
|
|
5
|
-
import unittest
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from unittest import mock
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
SCRIPT_DIR = Path(__file__).resolve().parents[1] / "scripts"
|
|
11
|
-
if str(SCRIPT_DIR) not in sys.path:
|
|
12
|
-
sys.path.insert(0, str(SCRIPT_DIR))
|
|
13
|
-
|
|
14
|
-
import project_detail_template_editor_common as common # noqa: E402
|
|
15
|
-
import submit_project_detail_template as submit_script # noqa: E402
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class ProjectDetailTemplateEditorTests(unittest.TestCase):
|
|
19
|
-
def _write_ready_submit_fixture(self, root: Path, *, stem: str, mode: str, template_id: int | None = None) -> dict[str, Path]:
|
|
20
|
-
paths = {
|
|
21
|
-
"meta": root / "meta.json",
|
|
22
|
-
"work": root / "work.json",
|
|
23
|
-
"submit": root / "submit.json",
|
|
24
|
-
}
|
|
25
|
-
work_payload = {
|
|
26
|
-
"id": template_id if mode == "edit" else None,
|
|
27
|
-
"mode": mode,
|
|
28
|
-
"basic": {
|
|
29
|
-
"name": "详情模板",
|
|
30
|
-
"desc": "",
|
|
31
|
-
"type": 2,
|
|
32
|
-
"flow_type": "flow801021391",
|
|
33
|
-
"flow_key": "",
|
|
34
|
-
"status": 1,
|
|
35
|
-
},
|
|
36
|
-
"content": {"config": {}, "main_col": [], "side_col": []},
|
|
37
|
-
"meta": {},
|
|
38
|
-
}
|
|
39
|
-
common.dump_json(paths["work"], work_payload)
|
|
40
|
-
common.dump_json(
|
|
41
|
-
paths["meta"],
|
|
42
|
-
common.ensure_meta_shape(
|
|
43
|
-
{"stem": stem, "mode": mode, "workspace": "store_mgr", "templateId": template_id},
|
|
44
|
-
stem,
|
|
45
|
-
),
|
|
46
|
-
)
|
|
47
|
-
common.dump_json(paths["submit"], common.build_submit_payload(work_payload))
|
|
48
|
-
common.update_confirmation_state(
|
|
49
|
-
paths["meta"], stem=stem, actor="codex", stage="submit", work_path=paths["work"], submit_path=paths["submit"]
|
|
50
|
-
)
|
|
51
|
-
lint_path = root / "lint.json"
|
|
52
|
-
common.dump_json(lint_path, {"ok": True})
|
|
53
|
-
common.update_lint_meta(paths["meta"], stem=stem, submit_path=paths["submit"], lint_path=lint_path, report={"ok": True})
|
|
54
|
-
meta_payload = common.load_json(paths["meta"])
|
|
55
|
-
meta_payload["status"] = "submit_confirmed"
|
|
56
|
-
common.dump_json(paths["meta"], meta_payload)
|
|
57
|
-
return paths
|
|
58
|
-
|
|
59
|
-
def test_edit_round_trip_builds_submit(self) -> None:
|
|
60
|
-
detail = {
|
|
61
|
-
"id": 954573597,
|
|
62
|
-
"name": "入库信息",
|
|
63
|
-
"desc": "用于项目详情页面展示加盟商信息",
|
|
64
|
-
"type": 2,
|
|
65
|
-
"status": 1,
|
|
66
|
-
"flow_type": "flow801021391",
|
|
67
|
-
"flow_key": "",
|
|
68
|
-
"content": "{\"config\":{\"enable_share\":true},\"main_col\":[{\"type\":\"meta-form\",\"title\":\"待入库信息\",\"config\":{}}],\"side_col\":[{\"type\":\"step-log\",\"title\":\"流程日志\",\"config\":{}}]}",
|
|
69
|
-
"uuid": "1008e2bf-6675-459b-ac79-f7768b224b76",
|
|
70
|
-
}
|
|
71
|
-
work = common.detail_to_work_payload(detail, mode="edit")
|
|
72
|
-
submit = common.build_submit_payload(work)
|
|
73
|
-
self.assertEqual(submit["type"], 2)
|
|
74
|
-
self.assertEqual(common.parse_content(submit["content"])["main_col"][0]["type"], "meta-form")
|
|
75
|
-
|
|
76
|
-
def test_create_skeleton_stem_and_payload(self) -> None:
|
|
77
|
-
detail = {
|
|
78
|
-
"id": 954573597,
|
|
79
|
-
"name": "入库信息",
|
|
80
|
-
"desc": "",
|
|
81
|
-
"flow_type": "flow801021391",
|
|
82
|
-
"flow_key": "",
|
|
83
|
-
"type": 2,
|
|
84
|
-
"status": 1,
|
|
85
|
-
"content": "{\"config\":{},\"main_col\":[],\"side_col\":[]}",
|
|
86
|
-
}
|
|
87
|
-
stem = common.create_stem("flow801021391", "", 954573597)
|
|
88
|
-
raw = common.build_create_raw_payload(detail, sample_template_id=954573597)
|
|
89
|
-
self.assertEqual(stem, "create-flow801021391-default-954573597")
|
|
90
|
-
self.assertEqual(raw["sampleTemplateId"], 954573597)
|
|
91
|
-
self.assertEqual(raw["type"], 2)
|
|
92
|
-
|
|
93
|
-
def test_lint_blocks_side_only_module_in_main_col(self) -> None:
|
|
94
|
-
work = {
|
|
95
|
-
"mode": "edit",
|
|
96
|
-
"basic": {
|
|
97
|
-
"name": "详情模板",
|
|
98
|
-
"desc": "",
|
|
99
|
-
"type": 2,
|
|
100
|
-
"flow_type": "flow801021391",
|
|
101
|
-
"flow_key": "",
|
|
102
|
-
"status": 1,
|
|
103
|
-
},
|
|
104
|
-
"content": {
|
|
105
|
-
"config": {},
|
|
106
|
-
"main_col": [{"type": "step-log", "title": "流程日志", "config": {}}],
|
|
107
|
-
"side_col": [],
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
report = common.lint_project_detail_template_semantics(work)
|
|
111
|
-
self.assertFalse(report["ok"])
|
|
112
|
-
self.assertTrue(any("not allowed in main_col" in item for item in report["errors"]))
|
|
113
|
-
|
|
114
|
-
def test_lint_blocks_missing_main_or_side_shape(self) -> None:
|
|
115
|
-
work = {
|
|
116
|
-
"mode": "edit",
|
|
117
|
-
"basic": {
|
|
118
|
-
"name": "详情模板",
|
|
119
|
-
"desc": "",
|
|
120
|
-
"type": 2,
|
|
121
|
-
"flow_type": "flow801021391",
|
|
122
|
-
"flow_key": "",
|
|
123
|
-
"status": 1,
|
|
124
|
-
},
|
|
125
|
-
"content": {"config": [], "main_col": {}, "side_col": []},
|
|
126
|
-
}
|
|
127
|
-
with self.assertRaises(SystemExit):
|
|
128
|
-
common.build_submit_payload(work)
|
|
129
|
-
|
|
130
|
-
def test_unknown_module_is_advanced_mode_warning_not_blocker(self) -> None:
|
|
131
|
-
work = {
|
|
132
|
-
"mode": "edit",
|
|
133
|
-
"basic": {
|
|
134
|
-
"name": "详情模板",
|
|
135
|
-
"desc": "",
|
|
136
|
-
"type": 2,
|
|
137
|
-
"flow_type": "flow801021391",
|
|
138
|
-
"flow_key": "",
|
|
139
|
-
"status": 1,
|
|
140
|
-
},
|
|
141
|
-
"content": {
|
|
142
|
-
"config": {},
|
|
143
|
-
"main_col": [{"type": "not-exist-yet", "title": "实验模块", "config": {}}],
|
|
144
|
-
"side_col": [],
|
|
145
|
-
},
|
|
146
|
-
}
|
|
147
|
-
report = common.lint_project_detail_template_semantics(work)
|
|
148
|
-
self.assertTrue(report["ok"])
|
|
149
|
-
self.assertTrue(any("advanced JSON mode candidate only" in item for item in report["warnings"]))
|
|
150
|
-
|
|
151
|
-
def test_lint_blocks_project_list_query(self) -> None:
|
|
152
|
-
work = {
|
|
153
|
-
"mode": "edit",
|
|
154
|
-
"basic": {
|
|
155
|
-
"name": "详情模板",
|
|
156
|
-
"desc": "",
|
|
157
|
-
"type": 2,
|
|
158
|
-
"flow_type": "flow801021391",
|
|
159
|
-
"flow_key": "",
|
|
160
|
-
"status": 1,
|
|
161
|
-
},
|
|
162
|
-
"content": {
|
|
163
|
-
"config": {
|
|
164
|
-
"$template": (
|
|
165
|
-
"{ return ctx.$axios.post('/bpmax/project/list?page=1', "
|
|
166
|
-
"{ flow_type: 'flow801021391', query: {} }); }"
|
|
167
|
-
)
|
|
168
|
-
},
|
|
169
|
-
"main_col": [],
|
|
170
|
-
"side_col": [],
|
|
171
|
-
},
|
|
172
|
-
}
|
|
173
|
-
report = common.lint_project_detail_template_semantics(work)
|
|
174
|
-
self.assertFalse(report["ok"])
|
|
175
|
-
self.assertTrue(any("project/list" in item for item in report["errors"]))
|
|
176
|
-
|
|
177
|
-
def test_submit_gate_requires_lint(self) -> None:
|
|
178
|
-
with tempfile.TemporaryDirectory() as tmpdir:
|
|
179
|
-
meta = Path(tmpdir) / "meta.json"
|
|
180
|
-
work = Path(tmpdir) / "work.json"
|
|
181
|
-
submit = Path(tmpdir) / "submit.json"
|
|
182
|
-
common.dump_json(
|
|
183
|
-
work,
|
|
184
|
-
{
|
|
185
|
-
"mode": "edit",
|
|
186
|
-
"basic": {
|
|
187
|
-
"name": "详情模板",
|
|
188
|
-
"desc": "",
|
|
189
|
-
"type": 2,
|
|
190
|
-
"flow_type": "flow801021391",
|
|
191
|
-
"flow_key": "",
|
|
192
|
-
"status": 1,
|
|
193
|
-
},
|
|
194
|
-
"content": {"config": {}, "main_col": [], "side_col": []},
|
|
195
|
-
},
|
|
196
|
-
)
|
|
197
|
-
common.dump_json(meta, common.ensure_meta_shape({"stem": "x", "mode": "edit", "workspace": "store_mgr"}, "x"))
|
|
198
|
-
common.update_confirmation_state(meta, stem="x", actor="codex", stage="work", work_path=work, submit_path=submit)
|
|
199
|
-
common.dump_json(submit, common.build_submit_payload(common.load_json(work)))
|
|
200
|
-
common.update_build_meta(meta, stem="x", work_path=work, submit_path=submit)
|
|
201
|
-
common.update_confirmation_state(meta, stem="x", actor="codex", stage="submit", work_path=work, submit_path=submit)
|
|
202
|
-
with self.assertRaises(SystemExit):
|
|
203
|
-
common.ensure_submission_allowed(meta, work, submit)
|
|
204
|
-
|
|
205
|
-
def test_persist_create_submission_meta_sets_edit_mode_and_ids(self) -> None:
|
|
206
|
-
with tempfile.TemporaryDirectory() as tmpdir:
|
|
207
|
-
meta_path = Path(tmpdir) / "meta.json"
|
|
208
|
-
common.dump_json(
|
|
209
|
-
meta_path,
|
|
210
|
-
common.ensure_meta_shape(
|
|
211
|
-
{"stem": "x", "mode": "create", "workspace": "store_mgr", "status": "submit_confirmed"},
|
|
212
|
-
"x",
|
|
213
|
-
),
|
|
214
|
-
)
|
|
215
|
-
payload = common.persist_create_submission_meta(
|
|
216
|
-
meta_path,
|
|
217
|
-
stem="x",
|
|
218
|
-
action_mode="create",
|
|
219
|
-
template_id=123,
|
|
220
|
-
readback={"id": 123, "uuid": "uuid-123"},
|
|
221
|
-
)
|
|
222
|
-
self.assertEqual(payload["mode"], "edit")
|
|
223
|
-
self.assertEqual(payload["templateId"], 123)
|
|
224
|
-
self.assertEqual(payload["templateUuid"], "uuid-123")
|
|
225
|
-
self.assertEqual(payload["status"], "submit_confirmed")
|
|
226
|
-
|
|
227
|
-
def test_submit_create_persists_meta_and_verify_mode(self) -> None:
|
|
228
|
-
with tempfile.TemporaryDirectory() as tmpdir:
|
|
229
|
-
tmp_root = Path(tmpdir)
|
|
230
|
-
stem = "create-stem"
|
|
231
|
-
paths = self._write_ready_submit_fixture(tmp_root, stem=stem, mode="create")
|
|
232
|
-
script_paths = {
|
|
233
|
-
"meta": paths["meta"],
|
|
234
|
-
"work": paths["work"],
|
|
235
|
-
"submit": paths["submit"],
|
|
236
|
-
"response": tmp_root / "response.json",
|
|
237
|
-
"readback": tmp_root / "readback.json",
|
|
238
|
-
"verify": tmp_root / "verify.json",
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
class FakeClient:
|
|
242
|
-
def __init__(self) -> None:
|
|
243
|
-
self.created_payloads: list[dict] = []
|
|
244
|
-
self.updated_payloads: list[tuple[int, dict]] = []
|
|
245
|
-
|
|
246
|
-
def create_flow_page_template(self, payload: dict) -> dict:
|
|
247
|
-
self.created_payloads.append(payload)
|
|
248
|
-
return {"data": {"id": 321}}
|
|
249
|
-
|
|
250
|
-
def update_flow_page_template(self, template_id: int, payload: dict) -> dict:
|
|
251
|
-
self.updated_payloads.append((template_id, payload))
|
|
252
|
-
return {"data": {"id": template_id}}
|
|
253
|
-
|
|
254
|
-
def get_flow_page_template(self, template_id: int) -> dict:
|
|
255
|
-
return {
|
|
256
|
-
"data": {
|
|
257
|
-
"id": template_id,
|
|
258
|
-
"uuid": "uuid-321",
|
|
259
|
-
"name": "详情模板",
|
|
260
|
-
"desc": "",
|
|
261
|
-
"type": 2,
|
|
262
|
-
"flow_type": "flow801021391",
|
|
263
|
-
"flow_key": "",
|
|
264
|
-
"content": "{\"config\":{},\"main_col\":[],\"side_col\":[]}",
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
client = FakeClient()
|
|
269
|
-
with mock.patch.object(submit_script, "build_client", return_value=client), mock.patch.object(
|
|
270
|
-
submit_script, "paths_for", return_value=script_paths
|
|
271
|
-
), mock.patch.object(sys, "argv", ["submit_project_detail_template.py", "--stem", stem, "--workspace", "store_mgr"]):
|
|
272
|
-
self.assertEqual(submit_script.main(), 0)
|
|
273
|
-
|
|
274
|
-
meta_payload = common.load_json(paths["meta"])
|
|
275
|
-
verify_payload = common.load_json(script_paths["verify"])
|
|
276
|
-
self.assertEqual(len(client.created_payloads), 1)
|
|
277
|
-
self.assertEqual(client.updated_payloads, [])
|
|
278
|
-
self.assertEqual(meta_payload["mode"], "edit")
|
|
279
|
-
self.assertEqual(meta_payload["templateId"], 321)
|
|
280
|
-
self.assertEqual(meta_payload["templateUuid"], "uuid-321")
|
|
281
|
-
self.assertEqual(meta_payload["status"], "submit_confirmed")
|
|
282
|
-
self.assertEqual(verify_payload["mode"], "create")
|
|
283
|
-
|
|
284
|
-
def test_second_submit_uses_update_when_meta_has_template_id(self) -> None:
|
|
285
|
-
with tempfile.TemporaryDirectory() as tmpdir:
|
|
286
|
-
tmp_root = Path(tmpdir)
|
|
287
|
-
stem = "edit-stem"
|
|
288
|
-
paths = self._write_ready_submit_fixture(tmp_root, stem=stem, mode="edit", template_id=654)
|
|
289
|
-
script_paths = {
|
|
290
|
-
"meta": paths["meta"],
|
|
291
|
-
"work": paths["work"],
|
|
292
|
-
"submit": paths["submit"],
|
|
293
|
-
"response": tmp_root / "response.json",
|
|
294
|
-
"readback": tmp_root / "readback.json",
|
|
295
|
-
"verify": tmp_root / "verify.json",
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
class FakeClient:
|
|
299
|
-
def __init__(self) -> None:
|
|
300
|
-
self.created = 0
|
|
301
|
-
self.updated_payloads: list[tuple[int, dict]] = []
|
|
302
|
-
|
|
303
|
-
def create_flow_page_template(self, payload: dict) -> dict:
|
|
304
|
-
self.created += 1
|
|
305
|
-
return {"data": {"id": 1}}
|
|
306
|
-
|
|
307
|
-
def update_flow_page_template(self, template_id: int, payload: dict) -> dict:
|
|
308
|
-
self.updated_payloads.append((template_id, payload))
|
|
309
|
-
return {"data": {"id": template_id}}
|
|
310
|
-
|
|
311
|
-
def get_flow_page_template(self, template_id: int) -> dict:
|
|
312
|
-
return {
|
|
313
|
-
"data": {
|
|
314
|
-
"id": template_id,
|
|
315
|
-
"name": "详情模板",
|
|
316
|
-
"desc": "",
|
|
317
|
-
"type": 2,
|
|
318
|
-
"flow_type": "flow801021391",
|
|
319
|
-
"flow_key": "",
|
|
320
|
-
"content": "{\"config\":{},\"main_col\":[],\"side_col\":[]}",
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
client = FakeClient()
|
|
325
|
-
with mock.patch.object(submit_script, "build_client", return_value=client), mock.patch.object(
|
|
326
|
-
submit_script, "paths_for", return_value=script_paths
|
|
327
|
-
), mock.patch.object(sys, "argv", ["submit_project_detail_template.py", "--stem", stem, "--workspace", "store_mgr"]):
|
|
328
|
-
self.assertEqual(submit_script.main(), 0)
|
|
329
|
-
|
|
330
|
-
self.assertEqual(client.created, 0)
|
|
331
|
-
self.assertEqual(len(client.updated_payloads), 1)
|
|
332
|
-
self.assertEqual(client.updated_payloads[0][0], 654)
|
|
333
|
-
self.assertEqual(common.load_json(script_paths["verify"])["mode"], "edit")
|
|
334
|
-
self.assertEqual(common.load_json(paths["meta"])["mode"], "edit")
|
|
335
|
-
|
|
336
|
-
def test_submit_create_without_id_does_not_corrupt_meta(self) -> None:
|
|
337
|
-
with tempfile.TemporaryDirectory() as tmpdir:
|
|
338
|
-
tmp_root = Path(tmpdir)
|
|
339
|
-
stem = "create-no-id"
|
|
340
|
-
paths = self._write_ready_submit_fixture(tmp_root, stem=stem, mode="create")
|
|
341
|
-
script_paths = {
|
|
342
|
-
"meta": paths["meta"],
|
|
343
|
-
"work": paths["work"],
|
|
344
|
-
"submit": paths["submit"],
|
|
345
|
-
"response": tmp_root / "response.json",
|
|
346
|
-
"readback": tmp_root / "readback.json",
|
|
347
|
-
"verify": tmp_root / "verify.json",
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
class FakeClient:
|
|
351
|
-
def create_flow_page_template(self, payload: dict) -> dict:
|
|
352
|
-
return {"data": {}}
|
|
353
|
-
|
|
354
|
-
before_meta = common.load_json(paths["meta"])
|
|
355
|
-
with mock.patch.object(submit_script, "build_client", return_value=FakeClient()), mock.patch.object(
|
|
356
|
-
submit_script, "paths_for", return_value=script_paths
|
|
357
|
-
), mock.patch.object(sys, "argv", ["submit_project_detail_template.py", "--stem", stem, "--workspace", "store_mgr"]):
|
|
358
|
-
with self.assertRaises(SystemExit) as ctx:
|
|
359
|
-
submit_script.main()
|
|
360
|
-
|
|
361
|
-
after_meta = common.load_json(paths["meta"])
|
|
362
|
-
self.assertIn("create response did not include a template id", str(ctx.exception))
|
|
363
|
-
self.assertEqual(before_meta["mode"], "create")
|
|
364
|
-
self.assertEqual(after_meta["mode"], "create")
|
|
365
|
-
self.assertIsNone(after_meta["templateId"])
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if __name__ == "__main__":
|
|
369
|
-
unittest.main()
|