hap-cli 0.9.17__tar.gz → 0.9.19__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.
- {hap_cli-0.9.17 → hap_cli-0.9.19}/PKG-INFO +4 -1
- {hap_cli-0.9.17/hap_cli → hap_cli-0.9.19}/README.md +3 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19/hap_cli}/README.md +3 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/README_CN.md +3 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/__init__.py +1 -1
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/v3_registry.py +231 -1
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/worksheet_cmd.py +35 -5
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/filter_v3.py +63 -0
- hap_cli-0.9.19/hap_cli/core/print_template.py +42 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/session.py +11 -1
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/v3/dispatcher.py +87 -10
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/v3/schema.py +2 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/worksheet.py +62 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/locale/messages.json +964 -2
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/PKG-INFO +4 -1
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/SOURCES.txt +43 -1
- hap_cli-0.9.19/sources/v3-api-schema/INDEX.json +713 -0
- hap_cli-0.9.19/sources/v3-api-schema/create_app_backup.yaml +38 -0
- hap_cli-0.9.19/sources/v3-api-schema/create_print_template.yaml +135 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/create_role.yaml +7 -0
- hap_cli-0.9.19/sources/v3-api-schema/create_worksheet_index.yaml +69 -0
- hap_cli-0.9.19/sources/v3-api-schema/delete_app_backup.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/delete_print_template.yaml +30 -0
- hap_cli-0.9.19/sources/v3-api-schema/delete_worksheet_filter.yaml +30 -0
- hap_cli-0.9.19/sources/v3-api-schema/delete_worksheet_index.yaml +30 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_app_ai_models.yaml +18 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_app_backup_download_url.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_app_backup_list.yaml +33 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_app_restore_status.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_portal_config.yaml +56 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_portal_status.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_print_template_details.yaml +30 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_print_template_list.yaml +25 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_public_form_config.yaml +25 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_role_list.yaml +10 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_share_card_setting.yaml +33 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_sms_signatures.yaml +18 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_workflow_sms_templates.yaml +64 -0
- hap_cli-0.9.19/sources/v3-api-schema/get_worksheet_index_list.yaml +25 -0
- hap_cli-0.9.19/sources/v3-api-schema/patch_custom_page_components.yaml +4183 -0
- hap_cli-0.9.19/sources/v3-api-schema/patch_portal_config.yaml +389 -0
- hap_cli-0.9.19/sources/v3-api-schema/refresh_public_form_url.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/rename_app_backup.yaml +35 -0
- hap_cli-0.9.19/sources/v3-api-schema/rename_worksheet_index.yaml +44 -0
- hap_cli-0.9.19/sources/v3-api-schema/replace_print_template_file.yaml +78 -0
- hap_cli-0.9.19/sources/v3-api-schema/reset_public_form_fields.yaml +23 -0
- hap_cli-0.9.19/sources/v3-api-schema/restore_app_backup.yaml +48 -0
- hap_cli-0.9.19/sources/v3-api-schema/save_worksheet_filter.yaml +229 -0
- hap_cli-0.9.19/sources/v3-api-schema/sort_roles.yaml +32 -0
- hap_cli-0.9.19/sources/v3-api-schema/switch_portal.yaml +30 -0
- hap_cli-0.9.19/sources/v3-api-schema/switch_public_form.yaml +33 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_app_maintenance.yaml +36 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_portal_config.yaml +280 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_print_template.yaml +79 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_public_form.yaml +101 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_public_form_settings.yaml +379 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_role.yaml +395 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_share_card_setting.yaml +52 -0
- hap_cli-0.9.19/sources/v3-api-schema/update_worksheet_index.yaml +73 -0
- hap_cli-0.9.19/sources/v3-api-schema/validate_process.yaml +24 -0
- hap_cli-0.9.17/sources/v3-api-schema/INDEX.json +0 -262
- {hap_cli-0.9.17 → hap_cli-0.9.19}/MANIFEST.in +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/__main__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/_entry.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/app_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/app_creator_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/app_editor_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/attachment_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/auth_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/calendar_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/chart_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/chat_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/chatbot_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/config_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/contact_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/department_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/group_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/guide_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/icon_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/instance_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/node_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/optionset_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/page_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/post_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/record_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/region_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/role_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/update_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/upload_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/commands/workflow_cmd.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/context.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/action_spec_adapter.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/charts.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/cleanup.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/compiler.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/config.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/design/design.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/errors.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/executor.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/fields.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/hap.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/merge.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/console.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/mirror.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/report.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/schema.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/cli.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/executor.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/template.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/selftest.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/smoke.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/steps.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/store.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/validate.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/attachment.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/auth.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/calendar_mod.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/chart.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/chat.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/chatbot.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/cli_access.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/condition_dsl.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/contact.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/control_type_codes.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/department.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/apply.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/componentlower.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/component.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/custom-action.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/envelope.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/field.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/editspec.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/errors.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/fieldlower.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/jsonschema_mini.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/models.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/ops.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/planner.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/editor/reader.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/field_normalizer.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/field_spec_adapter.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/filter_translator.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/flow_node.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/global_meta.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/group.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/guide.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/icon_index.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/instance.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/layout_check.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/logger.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/money_currency.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/optionset.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/page.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/post.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record_defaults.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record_discussions.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record_form_checks.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record_lookups.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/record_rules.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/relation_scope.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/relogin.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/response_crypto.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/role.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/role_perm_builder.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/rule_spec_adapter.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/token_crypto.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/update.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/upload.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/v3/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/v3/render.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/view_spec_adapter.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/workflow.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/workflow_node_dsl.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/worksheet_form.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/worksheet_reference.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/core/worksheet_templates.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/approval.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/chart.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/messages.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/overview.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/post.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/record.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/setup.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/skills.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/workflow.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/en/worksheet.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/index.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/approval.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/chart.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/messages.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/overview.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/post.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/record.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/setup.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/skills.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/workflow.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/worksheet.md +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/i18n.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/locale/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/locale/messages.schema.json +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/__init__.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/atomic_write.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/confirm.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/formatting.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/options.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli/utils/parameter_mapping.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/dependency_links.txt +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/entry_points.txt +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/requires.txt +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/hap_cli.egg-info/top_level.txt +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/setup.cfg +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/setup.py +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/create_optionset.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/delete_optionset.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/delete_record.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/delete_role.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_info.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_details.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_list.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_logs.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_relations.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_regions.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/get_role_details.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/knowledge_search.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
- {hap_cli-0.9.17 → hap_cli-0.9.19}/sources/v3-api-schema/update_optionset.yaml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hap-cli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.19
|
|
4
4
|
Summary: CLI harness for Mingdao HAP - Enterprise no-code platform
|
|
5
5
|
Author: hap-cli
|
|
6
6
|
License: Apache-2.0
|
|
@@ -167,6 +167,9 @@ discover every subcommand.
|
|
|
167
167
|
| `app create-section / edit-section / delete-section` | Section management |
|
|
168
168
|
| `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
|
|
169
169
|
| `app backup / export / exports / backup-logs` | Backup & export |
|
|
170
|
+
| `app backups …` | List, create, restore, rename, download and delete backups |
|
|
171
|
+
| `app portal …` | External portal switch and settings |
|
|
172
|
+
| `app maintenance / ai-models / sms-signatures` | Maintenance mode, available AI models and SMS signatures |
|
|
170
173
|
| `app usage / logs / log-archives` | Statistics, operation logs and their archives |
|
|
171
174
|
| `app trash` | What was deleted from an application, and by whom |
|
|
172
175
|
| `app role …` | Role CRUD, permissions, members, leave-all, applications |
|
|
@@ -138,6 +138,9 @@ discover every subcommand.
|
|
|
138
138
|
| `app create-section / edit-section / delete-section` | Section management |
|
|
139
139
|
| `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
|
|
140
140
|
| `app backup / export / exports / backup-logs` | Backup & export |
|
|
141
|
+
| `app backups …` | List, create, restore, rename, download and delete backups |
|
|
142
|
+
| `app portal …` | External portal switch and settings |
|
|
143
|
+
| `app maintenance / ai-models / sms-signatures` | Maintenance mode, available AI models and SMS signatures |
|
|
141
144
|
| `app usage / logs / log-archives` | Statistics, operation logs and their archives |
|
|
142
145
|
| `app trash` | What was deleted from an application, and by whom |
|
|
143
146
|
| `app role …` | Role CRUD, permissions, members, leave-all, applications |
|
|
@@ -138,6 +138,9 @@ discover every subcommand.
|
|
|
138
138
|
| `app create-section / edit-section / delete-section` | Section management |
|
|
139
139
|
| `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
|
|
140
140
|
| `app backup / export / exports / backup-logs` | Backup & export |
|
|
141
|
+
| `app backups …` | List, create, restore, rename, download and delete backups |
|
|
142
|
+
| `app portal …` | External portal switch and settings |
|
|
143
|
+
| `app maintenance / ai-models / sms-signatures` | Maintenance mode, available AI models and SMS signatures |
|
|
141
144
|
| `app usage / logs / log-archives` | Statistics, operation logs and their archives |
|
|
142
145
|
| `app trash` | What was deleted from an application, and by whom |
|
|
143
146
|
| `app role …` | Role CRUD, permissions, members, leave-all, applications |
|
|
@@ -122,6 +122,9 @@ hap --json worksheet record list WORKSHEET_ID
|
|
|
122
122
|
| `app create-section / edit-section / delete-section` | 分组管理 |
|
|
123
123
|
| `app sort-sections / sort-worksheets` | 重排分组 / 分组内工作表顺序 |
|
|
124
124
|
| `app backup / export / exports / backup-logs` | 备份与导出 |
|
|
125
|
+
| `app backups …` | 备份列表、创建、还原、重命名、下载、删除 |
|
|
126
|
+
| `app portal …` | 外部门户开关与设置 |
|
|
127
|
+
| `app maintenance / ai-models / sms-signatures` | 维护模式、可用 AI 模型与短信签名 |
|
|
125
128
|
| `app usage / logs / log-archives` | 使用统计、操作日志与日志归档 |
|
|
126
129
|
| `app trash` | 应用回收站:谁在什么时候删了什么 |
|
|
127
130
|
| `app role …` | 角色 CRUD、权限、成员、leave-all、申请 |
|
|
@@ -30,7 +30,10 @@ from hap_cli.commands.optionset_cmd import optionset
|
|
|
30
30
|
from hap_cli.commands.record_cmd import record
|
|
31
31
|
from hap_cli.commands.role_cmd import role
|
|
32
32
|
from hap_cli.commands.workflow_cmd import workflow
|
|
33
|
-
from hap_cli.commands.worksheet_cmd import worksheet
|
|
33
|
+
from hap_cli.commands.worksheet_cmd import worksheet, worksheet_filter
|
|
34
|
+
from hap_cli.commands.page_cmd import page
|
|
35
|
+
from hap_cli.core import print_template as _print
|
|
36
|
+
from hap_cli.core.filter_v3 import to_saved_filter
|
|
34
37
|
from hap_cli.core.v3 import register_v3
|
|
35
38
|
from hap_cli.core.v3.render import render_v3_response
|
|
36
39
|
from hap_cli.core import worksheet as _ws_mod
|
|
@@ -387,3 +390,230 @@ register_v3(record, "share-link", tool="get_record_share_link")
|
|
|
387
390
|
# get_approval_list_by_row is tag-excluded; ``hap approval list-by-row``
|
|
388
391
|
# is currently unavailable (no legacy implementation yet — tracked in
|
|
389
392
|
# docs/v3-legacy-fallback.md).
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
# ── Endpoints the public V3 docs do not list yet ────────────────────────────
|
|
396
|
+
#
|
|
397
|
+
# Schemas come from scripts/update_v3_mcp_schema.py, which also records how
|
|
398
|
+
# each route was confirmed.
|
|
399
|
+
|
|
400
|
+
# The server answers only when the backup or restore has finished, unless
|
|
401
|
+
# told not to wait; a small application already takes about 30 seconds.
|
|
402
|
+
_BACKUP_TIMEOUT = 600
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
@click.group("backups", help=t(
|
|
406
|
+
"Application backups — create, list, restore, rename, download, delete."))
|
|
407
|
+
def backups_group():
|
|
408
|
+
pass
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
@click.group("portal", help=t(
|
|
412
|
+
"External portal — turn it on or off and change its settings."))
|
|
413
|
+
def portal_group():
|
|
414
|
+
pass
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
@click.group("index", help=t(
|
|
418
|
+
"Worksheet indexes — speed up queries, or enforce unique values."))
|
|
419
|
+
def index_group():
|
|
420
|
+
pass
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
@click.group("print-template", help=t(
|
|
424
|
+
"Print templates — system, Word, Excel, QR code and barcode."))
|
|
425
|
+
def print_template_group():
|
|
426
|
+
pass
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
@click.group("public-form", help=t(
|
|
430
|
+
"Public form — let anyone with the link add records."))
|
|
431
|
+
def public_form_group():
|
|
432
|
+
pass
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@click.group("share-card", help=t(
|
|
436
|
+
"The title, description and icon shown when a link is shared."))
|
|
437
|
+
def share_card_group():
|
|
438
|
+
pass
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
app.add_command(backups_group)
|
|
442
|
+
app.add_command(portal_group)
|
|
443
|
+
worksheet.add_command(index_group)
|
|
444
|
+
worksheet.add_command(print_template_group)
|
|
445
|
+
worksheet.add_command(public_form_group)
|
|
446
|
+
worksheet.add_command(share_card_group)
|
|
447
|
+
|
|
448
|
+
register_v3(backups_group, "list", tool="get_app_backup_list")
|
|
449
|
+
register_v3(backups_group, "create", tool="create_app_backup",
|
|
450
|
+
timeout=_BACKUP_TIMEOUT)
|
|
451
|
+
register_v3(backups_group, "rename", tool="rename_app_backup")
|
|
452
|
+
register_v3(backups_group, "download-url", tool="get_app_backup_download_url")
|
|
453
|
+
register_v3(backups_group, "restore", tool="restore_app_backup",
|
|
454
|
+
confirm="Restore backup {backup_id}? Unless it is restored as a "
|
|
455
|
+
"new application, this overwrites the current one.",
|
|
456
|
+
timeout=_BACKUP_TIMEOUT)
|
|
457
|
+
register_v3(backups_group, "restore-status", tool="get_app_restore_status")
|
|
458
|
+
register_v3(backups_group, "delete", tool="delete_app_backup",
|
|
459
|
+
confirm="Delete backup {backup_id}?")
|
|
460
|
+
|
|
461
|
+
register_v3(app, "maintenance", tool="update_app_maintenance")
|
|
462
|
+
register_v3(app, "ai-models", tool="get_app_ai_models")
|
|
463
|
+
register_v3(app, "sms-signatures", tool="get_sms_signatures")
|
|
464
|
+
|
|
465
|
+
register_v3(role, "sort", tool="sort_roles")
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
def _prepare_role_update(ctx, body, options, controls):
|
|
469
|
+
# The endpoint's own default is a full replacement, which clears every
|
|
470
|
+
# permission the call does not repeat.
|
|
471
|
+
body.setdefault("isIncremental", True)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
# `roleScope` has no effect on an update: a role cannot change category.
|
|
475
|
+
register_v3(role, "update", tool="update_role", role_app_guard=True,
|
|
476
|
+
omit=("roleScope",), prepare=_prepare_role_update)
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
def _need_body(ctx, body, options, controls):
|
|
480
|
+
"""An update that names nothing to change is a typing mistake."""
|
|
481
|
+
if not body:
|
|
482
|
+
raise click.UsageError("Nothing to change — pass at least one setting.")
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
register_v3(portal_group, "status", tool="get_portal_status")
|
|
486
|
+
register_v3(portal_group, "info", tool="get_portal_config")
|
|
487
|
+
register_v3(portal_group, "enable", tool="switch_portal",
|
|
488
|
+
constants={"enabled": True})
|
|
489
|
+
register_v3(portal_group, "disable", tool="switch_portal",
|
|
490
|
+
constants={"enabled": False},
|
|
491
|
+
confirm="Turn the external portal off? External users will no "
|
|
492
|
+
"longer be able to sign in.")
|
|
493
|
+
register_v3(portal_group, "patch", tool="patch_portal_config",
|
|
494
|
+
prepare=_need_body)
|
|
495
|
+
register_v3(portal_group, "update", tool="update_portal_config",
|
|
496
|
+
prepare=_need_body)
|
|
497
|
+
|
|
498
|
+
register_v3(index_group, "list", tool="get_worksheet_index_list")
|
|
499
|
+
register_v3(index_group, "create", tool="create_worksheet_index")
|
|
500
|
+
register_v3(index_group, "update", tool="update_worksheet_index",
|
|
501
|
+
prepare=_need_body)
|
|
502
|
+
register_v3(index_group, "rename", tool="rename_worksheet_index")
|
|
503
|
+
register_v3(index_group, "delete", tool="delete_worksheet_index",
|
|
504
|
+
confirm="Delete index {index_id}?")
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def _prepare_saved_filter(ctx, body, options, controls):
|
|
508
|
+
# Measured 2026-12-01: created without `module`, a filter lands in
|
|
509
|
+
# module 2 (report) and never shows in the worksheet's filter list —
|
|
510
|
+
# the schema says the default is 1. An update keeps what it has.
|
|
511
|
+
if not body.get("filterId"):
|
|
512
|
+
body.setdefault("module", 1)
|
|
513
|
+
tree = body.get("filter")
|
|
514
|
+
# Left out, the endpoint clears every condition.
|
|
515
|
+
if not tree:
|
|
516
|
+
raise click.UsageError("--filter-json must hold at least one condition.")
|
|
517
|
+
try:
|
|
518
|
+
body["filter"] = to_saved_filter(
|
|
519
|
+
tree, controls() if controls else None)
|
|
520
|
+
except ValueError as exc:
|
|
521
|
+
raise click.BadParameter(str(exc), param_hint="--filter-json")
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
register_v3(worksheet_filter, "save", tool="save_worksheet_filter",
|
|
525
|
+
prepare=_prepare_saved_filter)
|
|
526
|
+
register_v3(worksheet_filter, "delete", tool="delete_worksheet_filter",
|
|
527
|
+
confirm="Delete saved filter {filter_id}?")
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
_FILE_OPTIONS = [
|
|
531
|
+
click.option("--file", "file", default="",
|
|
532
|
+
help=t("Template file on this computer (.docx or .xlsx, "
|
|
533
|
+
"3 MB at most).")),
|
|
534
|
+
click.option("--url", "url", default="",
|
|
535
|
+
help=t("Public address of the template file "
|
|
536
|
+
"(10 MB at most).")),
|
|
537
|
+
]
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def _prepare_print_create(ctx, body, options, controls):
|
|
541
|
+
kind = body.get("templateType")
|
|
542
|
+
has_file = bool(options.get("file") or options.get("url"))
|
|
543
|
+
if kind not in ("word", "excel"):
|
|
544
|
+
if has_file:
|
|
545
|
+
raise click.UsageError(
|
|
546
|
+
"A template file only goes with --template-type word or excel.")
|
|
547
|
+
if kind != "system" and "config" not in body:
|
|
548
|
+
raise click.UsageError(
|
|
549
|
+
f"--template-type {kind} needs --config-json.")
|
|
550
|
+
return
|
|
551
|
+
body["source"], file_kind = _print.build_source(
|
|
552
|
+
options.get("file") or "", options.get("url") or "")
|
|
553
|
+
if file_kind != kind:
|
|
554
|
+
raise click.UsageError(
|
|
555
|
+
f"--template-type {kind} does not match the file, which is a "
|
|
556
|
+
f"{file_kind} file.")
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
def _prepare_print_file(ctx, body, options, controls):
|
|
560
|
+
body["source"], _ = _print.build_source(
|
|
561
|
+
options.get("file") or "", options.get("url") or "")
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
register_v3(print_template_group, "list", tool="get_print_template_list")
|
|
565
|
+
register_v3(print_template_group, "info", tool="get_print_template_details")
|
|
566
|
+
register_v3(print_template_group, "create", tool="create_print_template",
|
|
567
|
+
omit=("source",), extra_decorators=_FILE_OPTIONS,
|
|
568
|
+
prepare=_prepare_print_create, prepare_options=("file", "url"),
|
|
569
|
+
timeout=120)
|
|
570
|
+
register_v3(print_template_group, "update", tool="update_print_template",
|
|
571
|
+
prepare=_need_body)
|
|
572
|
+
register_v3(print_template_group, "replace-file",
|
|
573
|
+
tool="replace_print_template_file",
|
|
574
|
+
omit=("source",), extra_decorators=_FILE_OPTIONS,
|
|
575
|
+
prepare=_prepare_print_file, prepare_options=("file", "url"),
|
|
576
|
+
timeout=120)
|
|
577
|
+
register_v3(print_template_group, "delete", tool="delete_print_template",
|
|
578
|
+
confirm="Delete print template {template_id}?")
|
|
579
|
+
|
|
580
|
+
register_v3(public_form_group, "info", tool="get_public_form_config")
|
|
581
|
+
register_v3(public_form_group, "enable", tool="switch_public_form",
|
|
582
|
+
constants={"enabled": True})
|
|
583
|
+
register_v3(public_form_group, "disable", tool="switch_public_form",
|
|
584
|
+
constants={"enabled": False},
|
|
585
|
+
confirm="Turn off the public form of worksheet {worksheet_id}?")
|
|
586
|
+
register_v3(public_form_group, "update", tool="update_public_form",
|
|
587
|
+
prepare=_need_body)
|
|
588
|
+
register_v3(public_form_group, "update-settings",
|
|
589
|
+
tool="update_public_form_settings")
|
|
590
|
+
register_v3(public_form_group, "refresh-url", tool="refresh_public_form_url",
|
|
591
|
+
confirm="Replace the public link? The current one stops working.")
|
|
592
|
+
register_v3(public_form_group, "reset-fields",
|
|
593
|
+
tool="reset_public_form_fields",
|
|
594
|
+
confirm="Reset the public form's layout? Custom order, width and "
|
|
595
|
+
"visibility are lost.")
|
|
596
|
+
|
|
597
|
+
# An empty string clears a share-card text, and empty options are not sent,
|
|
598
|
+
# so clearing has its own switch.
|
|
599
|
+
_CLEARABLE = {"title": "title", "description": "description",
|
|
600
|
+
"icon": "iconImagePath"}
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
def _prepare_share_card(ctx, body, options, controls):
|
|
604
|
+
for name in options.get("clear") or ():
|
|
605
|
+
body.setdefault(_CLEARABLE[name], "")
|
|
606
|
+
_need_body(ctx, body, options, controls)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
register_v3(share_card_group, "info", tool="get_share_card_setting")
|
|
610
|
+
register_v3(share_card_group, "update", tool="update_share_card_setting",
|
|
611
|
+
extra_decorators=[click.option(
|
|
612
|
+
"--clear", "clear", multiple=True,
|
|
613
|
+
type=click.Choice(sorted(_CLEARABLE)),
|
|
614
|
+
help=t("Empty this setting. Repeatable."))],
|
|
615
|
+
prepare=_prepare_share_card, prepare_options=("clear",))
|
|
616
|
+
|
|
617
|
+
register_v3(workflow, "sms-templates", tool="get_workflow_sms_templates")
|
|
618
|
+
register_v3(workflow, "validate", tool="validate_process")
|
|
619
|
+
register_v3(page, "patch", tool="patch_custom_page_components")
|
|
@@ -1188,13 +1188,25 @@ def worksheet_form_settings(ctx, worksheet_id, app_id):
|
|
|
1188
1188
|
@click.option("--app-id", "-a", required=True, help="Application ID")
|
|
1189
1189
|
@org_id_option()
|
|
1190
1190
|
@click.option(
|
|
1191
|
-
"--advanced-setting",
|
|
1191
|
+
"--advanced-setting", default="",
|
|
1192
1192
|
help="JSON object of the complete advancedSetting to persist",
|
|
1193
1193
|
)
|
|
1194
1194
|
@click.option(
|
|
1195
|
-
"--edit-keys",
|
|
1195
|
+
"--edit-keys", default="",
|
|
1196
1196
|
help="JSON array of advancedSetting keys being edited this call",
|
|
1197
1197
|
)
|
|
1198
|
+
@click.option(
|
|
1199
|
+
"--label-position-pc", type=click.Choice(list(ws_mod.LABEL_POSITIONS)),
|
|
1200
|
+
default=None,
|
|
1201
|
+
help="Where field names sit on the PC form: vertical (above the "
|
|
1202
|
+
"value), horizontal (to its left) or right (to its left, "
|
|
1203
|
+
"right-aligned).",
|
|
1204
|
+
)
|
|
1205
|
+
@click.option(
|
|
1206
|
+
"--label-position-mobile",
|
|
1207
|
+
type=click.Choice(list(ws_mod.LABEL_POSITIONS)), default=None,
|
|
1208
|
+
help="The same for the mobile web form.",
|
|
1209
|
+
)
|
|
1198
1210
|
@click.option(
|
|
1199
1211
|
"--edit-attrs", default="",
|
|
1200
1212
|
help="JSON array of top-level attribute names to save, e.g. "
|
|
@@ -1204,22 +1216,40 @@ def worksheet_form_settings(ctx, worksheet_id, app_id):
|
|
|
1204
1216
|
@pass_context
|
|
1205
1217
|
def worksheet_save_form_settings(
|
|
1206
1218
|
ctx, worksheet_id, app_id, org_id, advanced_setting, edit_keys, edit_attrs,
|
|
1219
|
+
label_position_pc, label_position_mobile,
|
|
1207
1220
|
):
|
|
1208
1221
|
"""Update worksheet form-submission / advanced settings.
|
|
1209
1222
|
|
|
1210
1223
|
Only the keys listed in ``--edit-keys`` are saved from
|
|
1211
1224
|
``--advanced-setting`` — other keys are left unchanged (partial
|
|
1212
|
-
update).
|
|
1225
|
+
update). --label-position-pc / --label-position-mobile set where field
|
|
1226
|
+
names sit on the form, and also repair a form that shows two positions
|
|
1227
|
+
selected at once.
|
|
1213
1228
|
"""
|
|
1214
1229
|
try:
|
|
1230
|
+
if bool(advanced_setting) != bool(edit_keys):
|
|
1231
|
+
raise click.UsageError(
|
|
1232
|
+
"Pass --advanced-setting and --edit-keys together.")
|
|
1233
|
+
adv = json.loads(advanced_setting) if advanced_setting else {}
|
|
1234
|
+
keys = json.loads(edit_keys) if edit_keys else []
|
|
1235
|
+
for side, position in (("pc", label_position_pc),
|
|
1236
|
+
("app", label_position_mobile)):
|
|
1237
|
+
if position:
|
|
1238
|
+
pair = ws_mod.label_position_setting(side, position)
|
|
1239
|
+
adv.update(pair)
|
|
1240
|
+
keys += [k for k in pair if k not in keys]
|
|
1241
|
+
if not keys:
|
|
1242
|
+
raise click.UsageError(
|
|
1243
|
+
"Nothing to save: pass --advanced-setting with --edit-keys, "
|
|
1244
|
+
"or --label-position-pc / --label-position-mobile.")
|
|
1215
1245
|
session = ctx.get_session()
|
|
1216
1246
|
data = ws_mod.edit_worksheet_setting(
|
|
1217
1247
|
session,
|
|
1218
1248
|
worksheet_id,
|
|
1219
1249
|
app_id=app_id,
|
|
1220
1250
|
project_id=require_api_project_id(session, org_id),
|
|
1221
|
-
advanced_setting=
|
|
1222
|
-
edit_ad_keys=
|
|
1251
|
+
advanced_setting=adv,
|
|
1252
|
+
edit_ad_keys=keys,
|
|
1223
1253
|
edit_attrs=json.loads(edit_attrs) if edit_attrs else None,
|
|
1224
1254
|
)
|
|
1225
1255
|
ctx.output(data, lambda d: output_json(d))
|
|
@@ -216,3 +216,66 @@ def unknown_operators(value: Any) -> list[str]:
|
|
|
216
216
|
|
|
217
217
|
visit(value)
|
|
218
218
|
return found
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# ── Saved filters ────────────────────────────────────────────────────────
|
|
222
|
+
|
|
223
|
+
# What the saved-filter endpoint calls each operator
|
|
224
|
+
# (sources/v3-api-schema/save_worksheet_filter.yaml). Same tree as the
|
|
225
|
+
# record query, different spellings — `notIn` here, `notin` there.
|
|
226
|
+
_SAVED_FILTER_OPERATORS: frozenset[str] = frozenset({
|
|
227
|
+
"eq", "ne", "gt", "gte", "ge", "lt", "lte", "le", "in", "notIn",
|
|
228
|
+
"contains", "notContains", "startsWith", "notStartsWith", "endsWith",
|
|
229
|
+
"notEndsWith", "between", "notBetween", "empty", "notEmpty",
|
|
230
|
+
"concurrent", "belongsTo", "notBelongsTo", "dateEq", "dateNe",
|
|
231
|
+
"dateEnum",
|
|
232
|
+
})
|
|
233
|
+
_SAVED_FILTER_SPELLING = {
|
|
234
|
+
**{name.lower(): name for name in _SAVED_FILTER_OPERATORS},
|
|
235
|
+
"isempty": "empty", "isnotempty": "notEmpty",
|
|
236
|
+
# The nested level lists no ge/le.
|
|
237
|
+
"ge": "gte", "le": "lte",
|
|
238
|
+
"=": "eq", "!=": "ne", ">": "gt", ">=": "gte", "<": "lt", "<=": "lte",
|
|
239
|
+
}
|
|
240
|
+
_SCALAR_OPERATORS = frozenset({
|
|
241
|
+
"gt", "gte", "lt", "lte",
|
|
242
|
+
"startsWith", "notStartsWith", "endsWith", "notEndsWith",
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def to_saved_filter(tree: Any, controls: Any = None) -> Any:
|
|
247
|
+
"""A filter in either accepted form, as the saved-filter endpoint's tree.
|
|
248
|
+
|
|
249
|
+
Takes the CLI's unified form and the record query's tree. Raises
|
|
250
|
+
``ValueError`` for an operator the endpoint does not have.
|
|
251
|
+
"""
|
|
252
|
+
if _dsl.detect_shape(tree) == _dsl.SHAPE_CANONICAL:
|
|
253
|
+
tree = _dsl.to_record_query(tree, controls=controls)
|
|
254
|
+
if isinstance(tree, dict) and tree.get("type") != "group":
|
|
255
|
+
tree = {"type": "group", "logic": "and", "children": [tree]}
|
|
256
|
+
|
|
257
|
+
def convert(node: Any) -> Any:
|
|
258
|
+
if not isinstance(node, dict):
|
|
259
|
+
raise ValueError("filter: every condition must be an object")
|
|
260
|
+
node = dict(node)
|
|
261
|
+
if node.get("type") == "group":
|
|
262
|
+
node["logic"] = str(node.get("logic") or "and").lower()
|
|
263
|
+
node["children"] = [convert(c) for c in node.get("children") or []]
|
|
264
|
+
return node
|
|
265
|
+
name = str(node.get("operator") or "")
|
|
266
|
+
operator = _SAVED_FILTER_SPELLING.get(name.lower())
|
|
267
|
+
if operator is None:
|
|
268
|
+
raise ValueError(
|
|
269
|
+
f"filter: there is no operator {name!r}. Use one of: "
|
|
270
|
+
+ ", ".join(sorted(_SAVED_FILTER_OPERATORS)))
|
|
271
|
+
node["type"] = "condition"
|
|
272
|
+
node["operator"] = operator
|
|
273
|
+
value = node.get("value")
|
|
274
|
+
if operator in ("empty", "notEmpty"):
|
|
275
|
+
node.pop("value", None)
|
|
276
|
+
elif (operator in _SCALAR_OPERATORS and isinstance(value, list)
|
|
277
|
+
and len(value) == 1):
|
|
278
|
+
node["value"] = value[0]
|
|
279
|
+
return node
|
|
280
|
+
|
|
281
|
+
return convert(tree)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Reading a print template's file for the print-template endpoints.
|
|
2
|
+
|
|
3
|
+
The ``source`` object comes from
|
|
4
|
+
``sources/v3-api-schema/replace_print_template_file.yaml``: either
|
|
5
|
+
``kind=base64`` with the bytes (3 MiB at most once decoded) or ``kind=url``
|
|
6
|
+
with a public address (10 MiB, no redirects).
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import base64
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from urllib.parse import unquote, urlparse
|
|
14
|
+
|
|
15
|
+
MAX_FILE_BYTES = 3 * 1024 * 1024
|
|
16
|
+
KINDS = {".docx": "word", ".xlsx": "excel"}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _kind(file_name: str) -> str:
|
|
20
|
+
kind = KINDS.get(Path(file_name).suffix.lower())
|
|
21
|
+
if not kind:
|
|
22
|
+
raise ValueError(
|
|
23
|
+
f"{file_name}: a template file must be .docx or .xlsx")
|
|
24
|
+
return kind
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def build_source(file: str = "", url: str = "") -> tuple[dict, str]:
|
|
28
|
+
"""The ``source`` object and the template kind its file name implies."""
|
|
29
|
+
if bool(file) == bool(url):
|
|
30
|
+
raise ValueError("Give the template file with either --file or --url")
|
|
31
|
+
if url:
|
|
32
|
+
name = unquote(Path(urlparse(url).path).name)
|
|
33
|
+
return {"kind": "url", "fileName": name, "url": url}, _kind(name)
|
|
34
|
+
path = Path(file).expanduser()
|
|
35
|
+
kind = _kind(path.name)
|
|
36
|
+
data = path.read_bytes()
|
|
37
|
+
if len(data) > MAX_FILE_BYTES:
|
|
38
|
+
raise ValueError(
|
|
39
|
+
f"{path.name} is larger than 3 MB. Put it at a public address "
|
|
40
|
+
f"and pass that with --url instead (10 MB at most)")
|
|
41
|
+
return {"kind": "base64", "fileName": path.name,
|
|
42
|
+
"contentBase64": base64.b64encode(data).decode("ascii")}, kind
|
|
@@ -828,6 +828,7 @@ class Session:
|
|
|
828
828
|
path_params: Optional[dict[str, Any]] = None,
|
|
829
829
|
extra_headers: Optional[dict[str, str]] = None,
|
|
830
830
|
timeout: int = 30,
|
|
831
|
+
base: str = "v3",
|
|
831
832
|
) -> Any:
|
|
832
833
|
"""Make a HAP V3 API call.
|
|
833
834
|
|
|
@@ -845,6 +846,10 @@ class Session:
|
|
|
845
846
|
query: Query-string parameters for any method.
|
|
846
847
|
path_params: Substitution map for placeholders in ``path``.
|
|
847
848
|
timeout: Request timeout in seconds.
|
|
849
|
+
base: Which service answers the path. Some ``/v3/...`` paths
|
|
850
|
+
are not on the V3 host but behind the workflow or report
|
|
851
|
+
service (``{host}/workflow/v3/...``); the V3 host
|
|
852
|
+
answers 404 for those.
|
|
848
853
|
|
|
849
854
|
Returns:
|
|
850
855
|
Parsed JSON response (V3 endpoints typically return raw
|
|
@@ -854,7 +859,12 @@ class Session:
|
|
|
854
859
|
raise SessionError("Session not configured. Run 'hap auth login' first.")
|
|
855
860
|
|
|
856
861
|
rendered_path = self._render_v3_path(path, path_params or {})
|
|
857
|
-
|
|
862
|
+
service = {
|
|
863
|
+
"v3": self._v3_api_base,
|
|
864
|
+
"workflow": self._workflow_api_base,
|
|
865
|
+
"report": self._report_api_base,
|
|
866
|
+
}[base]
|
|
867
|
+
url = f"{service()}{rendered_path}"
|
|
858
868
|
|
|
859
869
|
merged_headers: dict[str, str] = {}
|
|
860
870
|
if extra_headers:
|