hap-cli 0.9.14__tar.gz → 0.9.16__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.14 → hap_cli-0.9.16}/PKG-INFO +1 -1
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/__init__.py +1 -1
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/calendar_cmd.py +4 -4
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/record_cmd.py +4 -3
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/design/design.schema.json +10 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/chat.py +44 -4
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/fieldlower.py +11 -2
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/layout_check.py +46 -0
- hap_cli-0.9.16/hap_cli/core/money_currency.py +188 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/workflow_node_dsl.py +66 -3
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/worksheet.py +17 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/worksheet_templates.py +7 -5
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/record.md +4 -3
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/workflow.md +11 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/record.md +3 -2
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/workflow.md +10 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/locale/messages.json +4 -4
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/PKG-INFO +1 -1
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/SOURCES.txt +1 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/MANIFEST.in +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/README.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/README.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/README_CN.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/__main__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/_entry.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/app_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/app_creator_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/app_editor_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/attachment_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/auth_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/chart_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/chat_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/chatbot_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/config_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/contact_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/department_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/group_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/guide_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/icon_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/instance_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/node_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/optionset_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/page_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/post_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/region_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/role_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/update_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/upload_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/v3_registry.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/workflow_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/commands/worksheet_cmd.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/context.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/action_spec_adapter.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/charts.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/cleanup.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/compiler.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/config.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/errors.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/executor.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/fields.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/hap.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/merge.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/recording/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/recording/console.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/recording/mirror.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/recording/report.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/schema.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/cli.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/executor.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/seed/template.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/selftest.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/smoke.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/steps.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/store.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/validate.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/attachment.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/auth.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/calendar_mod.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/chart.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/chatbot.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/cli_access.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/condition_dsl.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/contact.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/control_type_codes.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/department.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/apply.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/componentlower.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/editspec/component.schema.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/editspec/custom-action.schema.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/editspec/envelope.schema.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/editspec/field.schema.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/editspec.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/errors.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/jsonschema_mini.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/models.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/ops.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/planner.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/editor/reader.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/field_normalizer.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/field_spec_adapter.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/filter_translator.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/filter_v3.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/flow_node.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/global_meta.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/group.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/guide.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/icon_index.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/instance.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/logger.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/optionset.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/page.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/post.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record_defaults.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record_discussions.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record_form_checks.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record_lookups.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/record_rules.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/relation_scope.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/relogin.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/response_crypto.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/role.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/role_perm_builder.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/rule_spec_adapter.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/session.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/token_crypto.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/update.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/upload.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/v3/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/v3/dispatcher.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/v3/render.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/v3/schema.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/view_spec_adapter.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/workflow.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/worksheet_form.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/core/worksheet_reference.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/approval.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/chart.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/messages.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/overview.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/post.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/setup.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/skills.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/en/worksheet.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/index.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/approval.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/chart.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/messages.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/overview.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/post.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/setup.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/skills.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/guide/zh-Hans/worksheet.md +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/i18n.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/locale/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/locale/messages.schema.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/__init__.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/atomic_write.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/confirm.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/formatting.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/options.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli/utils/parameter_mapping.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/dependency_links.txt +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/entry_points.txt +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/requires.txt +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/hap_cli.egg-info/top_level.txt +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/setup.cfg +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/setup.py +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/INDEX.json +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/create_optionset.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/create_role.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/delete_optionset.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/delete_record.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/delete_role.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_app_info.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_details.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_list.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_logs.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_relations.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_regions.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_role_details.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/get_role_list.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/knowledge_search.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
- {hap_cli-0.9.14 → hap_cli-0.9.16}/sources/v3-api-schema/update_optionset.yaml +0 -0
|
@@ -565,10 +565,10 @@ def calendar_add_discussion(ctx, calendar_id, message, reply_id, files,
|
|
|
565
565
|
"""Post a comment on a calendar event.
|
|
566
566
|
|
|
567
567
|
Everyone invited to the event can see the comment. Attached files are
|
|
568
|
-
downloadable by every participant.
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
568
|
+
downloadable by every participant. To mention someone mid-sentence,
|
|
569
|
+
write user:<accountId> where the mention belongs. --at and --at-all
|
|
570
|
+
add mentions at the end of the comment instead. Either way the
|
|
571
|
+
people named are notified.
|
|
572
572
|
"""
|
|
573
573
|
try:
|
|
574
574
|
session = ctx.get_session()
|
|
@@ -601,9 +601,10 @@ def record_add_discussion(ctx, worksheet_id, row_id, message, app_id, view_id,
|
|
|
601
601
|
at_account_ids):
|
|
602
602
|
"""Add a discussion/comment to a record.
|
|
603
603
|
|
|
604
|
-
|
|
605
|
-
mention
|
|
606
|
-
|
|
604
|
+
To mention someone mid-sentence, write user:<accountId> where the
|
|
605
|
+
mention belongs, e.g. -m "Thanks user:<accountId> for checking".
|
|
606
|
+
--at and --at-all add mentions at the end of the comment instead.
|
|
607
|
+
Either way the people named are notified.
|
|
607
608
|
"""
|
|
608
609
|
try:
|
|
609
610
|
session = ctx.get_session()
|
|
@@ -3350,6 +3350,16 @@
|
|
|
3350
3350
|
],
|
|
3351
3351
|
"description": "compute function 模式的结果数据类型,决定下游引用该节点结果的字段 id(text→string_fx_id / number→number_fx_id / date→date_fx_id / datetime→datetime_fx_id)。函数公式返回文本/日期时必须声明;省略默认 number。其他模式无需设置(number/date_diff 为数值、date 为日期)。"
|
|
3352
3352
|
},
|
|
3353
|
+
"precision": {
|
|
3354
|
+
"type": "integer",
|
|
3355
|
+
"minimum": 0,
|
|
3356
|
+
"maximum": 9,
|
|
3357
|
+
"description": "compute number 模式、或 output_type 为 number 的 function 模式:结果保留的小数位数(0-9),省略为 2。"
|
|
3358
|
+
},
|
|
3359
|
+
"null_zero": {
|
|
3360
|
+
"type": "boolean",
|
|
3361
|
+
"description": "compute number 模式:参与计算的字段值为空时视为 0。"
|
|
3362
|
+
},
|
|
3353
3363
|
"field": {
|
|
3354
3364
|
"type": "string",
|
|
3355
3365
|
"description": "rollup:被汇总的字段(工作表/字段);省略=记录数量(count)。"
|
|
@@ -1288,7 +1288,8 @@ def apply_mentions(
|
|
|
1288
1288
|
at_all: bool = False,
|
|
1289
1289
|
account_ids: Optional[list[str]] = None,
|
|
1290
1290
|
) -> str:
|
|
1291
|
-
"""
|
|
1291
|
+
"""Write the mention markers into a comment: inline ones in place,
|
|
1292
|
+
``--at`` / ``--at-all`` ones at the end of the author's own text.
|
|
1292
1293
|
|
|
1293
1294
|
The product drops a mention wherever the writer typed the ``@``, and
|
|
1294
1295
|
inserts it as ``@<name>`` followed by one space
|
|
@@ -1297,14 +1298,53 @@ def apply_mentions(
|
|
|
1297
1298
|
should see it — ends with the mention, so that is where the CLI puts
|
|
1298
1299
|
it, separated by a single space. Leading it instead reads as
|
|
1299
1300
|
"@everyone Alvin, about that…", which is not how the box behaves.
|
|
1301
|
+
|
|
1302
|
+
A mention can also sit mid-sentence: ``user:<accountId>`` written in
|
|
1303
|
+
the text (the same spelling ``hap post`` uses) becomes the
|
|
1304
|
+
``[aid]<accountId>[/aid]`` marker right where it was typed, followed
|
|
1305
|
+
by one space as the composer leaves it. Markers already in stored
|
|
1306
|
+
form pass through untouched. Captured from the web record pane
|
|
1307
|
+
2026-11-27: ``"我 [aid]<id>[/aid] 来看一下"`` — the marker in the
|
|
1308
|
+
middle of the text is how the product itself sends it, and it
|
|
1309
|
+
notifies. People named both inline and via ``account_ids``, and an
|
|
1310
|
+
everyone-mention already in the text, are not appended again.
|
|
1300
1311
|
"""
|
|
1301
|
-
|
|
1312
|
+
text = inline_mentions(message or "")
|
|
1313
|
+
present = set(_AID_RE.findall(text))
|
|
1314
|
+
extra_ids = [a for a in (account_ids or []) if a and a not in present]
|
|
1315
|
+
markers = build_mention_markers(
|
|
1316
|
+
at_all=at_all and _AT_ALL_MARKER not in text,
|
|
1317
|
+
account_ids=extra_ids,
|
|
1318
|
+
)
|
|
1302
1319
|
if not markers:
|
|
1303
|
-
return
|
|
1304
|
-
body =
|
|
1320
|
+
return text
|
|
1321
|
+
body = text.rstrip()
|
|
1305
1322
|
return f"{body} {markers}" if body else markers
|
|
1306
1323
|
|
|
1307
1324
|
|
|
1325
|
+
# An inline mention written into a comment: ``user:<accountId>``. Account
|
|
1326
|
+
# ids are UUIDs; requiring that shape keeps ordinary prose such as
|
|
1327
|
+
# "user:admin" from being turned into a mention.
|
|
1328
|
+
_INLINE_MENTION_RE = re.compile(
|
|
1329
|
+
r"(?<![0-9A-Za-z_])user:"
|
|
1330
|
+
r"([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}"
|
|
1331
|
+
r"-[0-9A-Fa-f]{12})(?![0-9A-Za-z-])"
|
|
1332
|
+
)
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
def inline_mentions(message: str) -> str:
|
|
1336
|
+
"""Rewrite ``user:<accountId>`` in a comment to the ``[aid]`` marker,
|
|
1337
|
+
in place, with one space after it unless whitespace already follows."""
|
|
1338
|
+
text = message or ""
|
|
1339
|
+
|
|
1340
|
+
def _sub(m: "re.Match[str]") -> str:
|
|
1341
|
+
follow = text[m.end():m.end() + 1]
|
|
1342
|
+
sep = "" if not follow or follow.isspace() else " "
|
|
1343
|
+
return f"[aid]{m.group(1)}[/aid]{sep}"
|
|
1344
|
+
|
|
1345
|
+
return _INLINE_MENTION_RE.sub(_sub, text)
|
|
1346
|
+
|
|
1347
|
+
|
|
1308
1348
|
def _resolve_mentions(
|
|
1309
1349
|
text: Any,
|
|
1310
1350
|
users: Any,
|
|
@@ -200,8 +200,17 @@ def lower_field(field: dict[str, Any]) -> dict[str, Any]:
|
|
|
200
200
|
"""Return the raw control dict for one clean field definition."""
|
|
201
201
|
type_id = codes.resolve(field["type"])
|
|
202
202
|
advanced = _advanced_kwargs(field, type_id)
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
# A field with a raw ``control`` and no block may be a type that only
|
|
204
|
+
# works with its block's wiring (a relation, a formula); the raw
|
|
205
|
+
# control supplies that wiring, which build_control cannot check.
|
|
206
|
+
raw_wired = (not advanced and isinstance(field.get("control"), dict)
|
|
207
|
+
and (type_id in _BLOCK_TYPE_IDS.values()
|
|
208
|
+
or type_id in _FORMULA_TYPE_IDS))
|
|
209
|
+
if not raw_wired:
|
|
210
|
+
# build_control owns the per-type creation defaults — every type
|
|
211
|
+
# gets them, not only one with a block: without them a money
|
|
212
|
+
# field came out with no currency and no decimal places
|
|
213
|
+
# (bug #456384), unlike the same field from `worksheet create`.
|
|
205
214
|
ctrl = build_control(
|
|
206
215
|
type_id, field["name"],
|
|
207
216
|
required=bool(field.get("required")),
|
|
@@ -64,6 +64,7 @@ ADVANCED_SETTING_VALUE = "advanced_setting_value"
|
|
|
64
64
|
CHOOSERANGE_SHAPE = "chooserange_shape"
|
|
65
65
|
CHOOSERANGE_UNSUPPORTED = "chooserange_unsupported"
|
|
66
66
|
ADVANCED_SETTING_COERCED = "advanced_setting_coerced"
|
|
67
|
+
DEFAULTAREA_SHAPE = "defaultarea_shape"
|
|
67
68
|
|
|
68
69
|
# ``chooserange`` is two different settings sharing one name.
|
|
69
70
|
#
|
|
@@ -117,6 +118,46 @@ def _chooserange_findings(ctrl: dict[str, Any],
|
|
|
117
118
|
return []
|
|
118
119
|
|
|
119
120
|
|
|
121
|
+
# ``defaultarea`` on a phone column is its default country, stored as a
|
|
122
|
+
# serialised country object — the settings panel writes
|
|
123
|
+
# ``JSON.stringify(option.country)``, e.g.
|
|
124
|
+
# ``{"name":"Malaysia","iso2":"my","dialCode":"60"}`` (MDPublic
|
|
125
|
+
# src/pages/widgetConfig/widgetSetting/components/WidgetHighSetting/
|
|
126
|
+
# ControlSetting/TelConfig.jsx:136). The record form reads it as
|
|
127
|
+
# ``safeParse(defaultarea || '{}').iso2.toUpperCase()``
|
|
128
|
+
# (src/ming-ui/components/PhoneNumberInput/index.jsx:117-123): anything
|
|
129
|
+
# that does not parse to an object with an ``iso2`` throws, and every
|
|
130
|
+
# record's detail page shows "Program error" while the list view looks
|
|
131
|
+
# fine (bug #456394 — a bare ``"MY"`` saved through ``worksheet create``).
|
|
132
|
+
# Empty is how the product leaves it unset; it then falls back to the
|
|
133
|
+
# organisation's default region.
|
|
134
|
+
_PHONE_TYPE_ID = 3
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _defaultarea_findings(ctrl: dict[str, Any],
|
|
138
|
+
value: Any) -> list[dict[str, Any]]:
|
|
139
|
+
if ctrl.get("type") != _PHONE_TYPE_ID or value in ("", None):
|
|
140
|
+
return []
|
|
141
|
+
parsed: Any = None
|
|
142
|
+
if isinstance(value, str):
|
|
143
|
+
try:
|
|
144
|
+
parsed = json.loads(value)
|
|
145
|
+
except (ValueError, TypeError):
|
|
146
|
+
parsed = None
|
|
147
|
+
if isinstance(parsed, dict) and isinstance(parsed.get("iso2"), str) \
|
|
148
|
+
and parsed["iso2"].strip():
|
|
149
|
+
return []
|
|
150
|
+
return [_finding(
|
|
151
|
+
DEFAULTAREA_SHAPE, ctrl,
|
|
152
|
+
f"has a 'defaultarea' of {value!r}, which is not a country the "
|
|
153
|
+
"phone field can read. Write the default country as JSON text "
|
|
154
|
+
"with its lowercase two-letter code in 'iso2' — for example "
|
|
155
|
+
"'{\"name\": \"Malaysia\", \"iso2\": \"my\", \"dialCode\": "
|
|
156
|
+
"\"60\"}' — or leave it out to use the organization's default "
|
|
157
|
+
"region. Saved as anything else, no record of the worksheet can "
|
|
158
|
+
"be opened.")]
|
|
159
|
+
|
|
160
|
+
|
|
120
161
|
def _is_scalar(value: Any) -> bool:
|
|
121
162
|
"""A number or a switch — something with one obvious written form."""
|
|
122
163
|
return isinstance(value, (bool, int, float))
|
|
@@ -205,6 +246,11 @@ def advanced_setting_findings(
|
|
|
205
246
|
if found:
|
|
206
247
|
findings.extend(found)
|
|
207
248
|
continue
|
|
249
|
+
if key == "defaultarea":
|
|
250
|
+
found = _defaultarea_findings(ctrl, value)
|
|
251
|
+
if found:
|
|
252
|
+
findings.extend(found)
|
|
253
|
+
continue
|
|
208
254
|
if value is None or isinstance(value, str) or _is_scalar(value):
|
|
209
255
|
continue
|
|
210
256
|
findings.append(_finding(
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"""Give a new money field the currency settings the product gives it.
|
|
2
|
+
|
|
3
|
+
A money field (type 8) carries two settings that only make sense together
|
|
4
|
+
(MDPublic / pd-openweb src/pages/widgetConfig/widgetSetting/settings/
|
|
5
|
+
money.jsx, identical in both, pd-openweb read at 2026-11-24):
|
|
6
|
+
|
|
7
|
+
* ``currency`` — ``{"currencycode", "symbol"}``;
|
|
8
|
+
* ``currencynames`` — the unit words the amount-in-words field reads,
|
|
9
|
+
keyed ``0`` traditional-Chinese prefix, ``1`` main unit plural, ``2``
|
|
10
|
+
main unit singular, ``3`` sub unit plural, ``4`` sub unit singular
|
|
11
|
+
(src/utils/domain/control/number.js formatNumberToWords).
|
|
12
|
+
|
|
13
|
+
The settings panel writes both every time. A new field starts from the
|
|
14
|
+
organization's region (``FixedData/GetRegionConfigInfos``); picking a
|
|
15
|
+
currency takes the names from ``Worksheet/GetWorksheetCurrencyInfos``.
|
|
16
|
+
The CLI used to send a fixed CNY ``currency`` and no ``currencynames``:
|
|
17
|
+
the form's live amount in words then had no unit words and a double space
|
|
18
|
+
before ONLY, while the server's stored value did have them (bug #456384,
|
|
19
|
+
reported on Nocoly SaaS where the organization's currency is HKD).
|
|
20
|
+
|
|
21
|
+
So on the way out, every money field being created gets:
|
|
22
|
+
|
|
23
|
+
* no ``currency`` key at all → the organization's default currency;
|
|
24
|
+
* a ``currency`` but no ``currencynames`` → the names of that currency;
|
|
25
|
+
* ``currency`` set to ``""`` → left without a currency, the way clearing
|
|
26
|
+
the picker leaves it.
|
|
27
|
+
"""
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
import json
|
|
31
|
+
import logging
|
|
32
|
+
from typing import Any, Callable, Optional
|
|
33
|
+
|
|
34
|
+
logger = logging.getLogger("hap_cli.money_currency")
|
|
35
|
+
|
|
36
|
+
MONEY_TYPE_ID = 8
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _names(record: dict[str, Any], *, plural: str, singular: str,
|
|
40
|
+
sub_plural: str, sub_singular: str) -> str:
|
|
41
|
+
def pick(key: str, lang: str) -> str:
|
|
42
|
+
return str((record.get(key) or {}).get(lang) or "")
|
|
43
|
+
return json.dumps({
|
|
44
|
+
"0": pick(singular, "3"),
|
|
45
|
+
"1": pick(plural, "1"),
|
|
46
|
+
"2": pick(singular, "1"),
|
|
47
|
+
"3": pick(sub_plural, "1"),
|
|
48
|
+
"4": pick(sub_singular, "1"),
|
|
49
|
+
}, ensure_ascii=False)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _names_from_currency_info(info: dict[str, Any]) -> str:
|
|
53
|
+
# money.jsx onChange: currencyName.3 / currencyNamePlural.1 /
|
|
54
|
+
# currencyName.1 / subCurrencyCodePlural.1 / subCurrencyCode.1
|
|
55
|
+
return _names(info, plural="currencyNamePlural", singular="currencyName",
|
|
56
|
+
sub_plural="subCurrencyCodePlural",
|
|
57
|
+
sub_singular="subCurrencyCode")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _settings_from_region(region: dict[str, Any]) -> dict[str, str]:
|
|
61
|
+
# money.jsx initial default: the region record spells the same words
|
|
62
|
+
# differently — currencyPluralNames / subunits / subunit.
|
|
63
|
+
return {
|
|
64
|
+
"currency": json.dumps({
|
|
65
|
+
"currencycode": region.get("currencyCode") or "",
|
|
66
|
+
"symbol": region.get("currencySymbol") or "",
|
|
67
|
+
}, ensure_ascii=False),
|
|
68
|
+
"currencynames": _names(region, plural="currencyPluralNames",
|
|
69
|
+
singular="currencyName",
|
|
70
|
+
sub_plural="subunits", sub_singular="subunit"),
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _new_money_controls(controls: list[dict[str, Any]],
|
|
75
|
+
is_existing: Callable[[Any], bool]
|
|
76
|
+
) -> list[dict[str, Any]]:
|
|
77
|
+
out: list[dict[str, Any]] = []
|
|
78
|
+
for ctrl in controls or []:
|
|
79
|
+
if not isinstance(ctrl, dict):
|
|
80
|
+
continue
|
|
81
|
+
if ctrl.get("type") == MONEY_TYPE_ID and \
|
|
82
|
+
not is_existing(ctrl.get("controlId")):
|
|
83
|
+
out.append(ctrl)
|
|
84
|
+
# A new sub-table carries its columns inline.
|
|
85
|
+
out.extend(_new_money_controls(ctrl.get("relationControls") or [],
|
|
86
|
+
is_existing))
|
|
87
|
+
return out
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _currency_code(ctrl: dict[str, Any], raw: Any) -> str:
|
|
91
|
+
try:
|
|
92
|
+
parsed = json.loads(raw) if isinstance(raw, str) else raw
|
|
93
|
+
except ValueError:
|
|
94
|
+
parsed = None
|
|
95
|
+
code = parsed.get("currencycode") if isinstance(parsed, dict) else None
|
|
96
|
+
if not isinstance(code, str) or not code.strip():
|
|
97
|
+
raise ValueError(
|
|
98
|
+
f"Money field {ctrl.get('controlName') or '?'!r} has a currency "
|
|
99
|
+
f"setting of {raw!r}. Write it as JSON text with the currency "
|
|
100
|
+
f"code, for example '{{\"currencycode\": \"HKD\", \"symbol\": "
|
|
101
|
+
f"\"$\"}}', or leave it out to use the organization's default "
|
|
102
|
+
f"currency.")
|
|
103
|
+
return code.strip().upper()
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def list_currencies(session: Any) -> list[dict[str, Any]]:
|
|
107
|
+
resp = session.api_call("Worksheet", "GetWorksheetCurrencyInfos", {})
|
|
108
|
+
data = resp.get("data") if isinstance(resp, dict) else resp
|
|
109
|
+
return data if isinstance(data, list) else []
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def region_config(session: Any, project_id: str) -> dict[str, Any]:
|
|
113
|
+
# GET, as fixedData.js getRegionConfigInfos sets ajaxOptions.type.
|
|
114
|
+
resp = session.api_call("FixedData", "GetRegionConfigInfos",
|
|
115
|
+
{"projectId": project_id}, method="GET")
|
|
116
|
+
data = resp.get("data") if isinstance(resp, dict) and "data" in resp \
|
|
117
|
+
and "currencyCode" not in resp else resp
|
|
118
|
+
return data if isinstance(data, dict) else {}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def fill_money_currency(
|
|
122
|
+
session: Any,
|
|
123
|
+
controls: list[dict[str, Any]],
|
|
124
|
+
*,
|
|
125
|
+
project_id: Optional[Callable[[], str]] = None,
|
|
126
|
+
is_existing: Callable[[Any], bool] = lambda _cid: False,
|
|
127
|
+
use_region_default: bool = True,
|
|
128
|
+
) -> list[dict[str, Any]]:
|
|
129
|
+
"""Complete the currency settings of every new money field, in place.
|
|
130
|
+
|
|
131
|
+
``project_id`` is called only when a field needs the organization's
|
|
132
|
+
default currency. ``use_region_default=False`` checks and completes
|
|
133
|
+
the currencies callers named but leaves unnamed ones alone (the
|
|
134
|
+
offline preflight of ``worksheet create``, before the sheet exists).
|
|
135
|
+
Raises ``ValueError`` for a currency that cannot be read or is not
|
|
136
|
+
one the product offers.
|
|
137
|
+
"""
|
|
138
|
+
targets = _new_money_controls(controls, is_existing)
|
|
139
|
+
if not targets:
|
|
140
|
+
return controls
|
|
141
|
+
currencies: Optional[dict[str, dict[str, Any]]] = None
|
|
142
|
+
region: Optional[dict[str, Any]] = None
|
|
143
|
+
for ctrl in targets:
|
|
144
|
+
adv = ctrl.get("advancedSetting")
|
|
145
|
+
if not isinstance(adv, dict):
|
|
146
|
+
adv = {}
|
|
147
|
+
if "currency" not in adv:
|
|
148
|
+
if not use_region_default:
|
|
149
|
+
continue
|
|
150
|
+
if region is None:
|
|
151
|
+
pid = project_id() if project_id else ""
|
|
152
|
+
try:
|
|
153
|
+
region = region_config(session, pid)
|
|
154
|
+
except Exception: # noqa: BLE001 — logged, field still saves
|
|
155
|
+
logger.warning("region config lookup failed for %s",
|
|
156
|
+
pid, exc_info=True)
|
|
157
|
+
region = {}
|
|
158
|
+
if region.get("currencyCode"):
|
|
159
|
+
adv = {**adv, **_settings_from_region(region)}
|
|
160
|
+
logger.info("money field %s: organization currency %s",
|
|
161
|
+
ctrl.get("controlName"), region["currencyCode"])
|
|
162
|
+
ctrl["advancedSetting"] = adv
|
|
163
|
+
continue
|
|
164
|
+
if adv.get("currency") in ("", None) or adv.get("currencynames"):
|
|
165
|
+
continue
|
|
166
|
+
code = _currency_code(ctrl, adv["currency"])
|
|
167
|
+
if currencies is None:
|
|
168
|
+
currencies = {str(c.get("currencyCode") or "").upper(): c
|
|
169
|
+
for c in list_currencies(session)
|
|
170
|
+
if isinstance(c, dict)}
|
|
171
|
+
info = currencies.get(code)
|
|
172
|
+
if info is None:
|
|
173
|
+
raise ValueError(
|
|
174
|
+
f"Money field {ctrl.get('controlName') or '?'!r} names the "
|
|
175
|
+
f"currency {code!r}, which is not one the product offers. "
|
|
176
|
+
f"Use a three-letter currency code such as CNY, HKD, USD "
|
|
177
|
+
f"or MYR.")
|
|
178
|
+
currency = json.loads(adv["currency"]) \
|
|
179
|
+
if isinstance(adv["currency"], str) else dict(adv["currency"])
|
|
180
|
+
currency["currencycode"] = code
|
|
181
|
+
if not currency.get("symbol"):
|
|
182
|
+
currency["symbol"] = info.get("symbol") or ""
|
|
183
|
+
ctrl["advancedSetting"] = {
|
|
184
|
+
**adv,
|
|
185
|
+
"currency": json.dumps(currency, ensure_ascii=False),
|
|
186
|
+
"currencynames": _names_from_currency_info(info),
|
|
187
|
+
}
|
|
188
|
+
return controls
|
|
@@ -2819,7 +2819,7 @@ _CONFIG_KEYS_BY_NODE_TYPE: dict[str, frozenset[str]] = {
|
|
|
2819
2819
|
"execute_type"}),
|
|
2820
2820
|
# _formula_action_id + _save_formula_node
|
|
2821
2821
|
"compute": frozenset({"mode", "formula", "output_type", "start", "end",
|
|
2822
|
-
"out_unit"}),
|
|
2822
|
+
"out_unit", "precision", "null_zero"}),
|
|
2823
2823
|
"rollup": frozenset({"mode", "data_source", "source", "aggregate",
|
|
2824
2824
|
"field", "worksheet", "filter"}),
|
|
2825
2825
|
# _add_branch_gateway / _build_branch
|
|
@@ -4022,8 +4022,8 @@ def _normalize_v3_node(node: dict[str, Any]) -> dict[str, Any]:
|
|
|
4022
4022
|
config["data_source"] = {"node": tgt["node"]}
|
|
4023
4023
|
|
|
4024
4024
|
elif node_type == "compute":
|
|
4025
|
-
|
|
4026
|
-
|
|
4025
|
+
if "nullZero" in config and "null_zero" not in config:
|
|
4026
|
+
config["null_zero"] = config.pop("nullZero")
|
|
4027
4027
|
ctype = config.pop("computeType", None)
|
|
4028
4028
|
if "expression" in config and "formula" not in config:
|
|
4029
4029
|
config["formula"] = config.pop("expression")
|
|
@@ -4056,6 +4056,7 @@ def _normalize_v3_node(node: dict[str, Any]) -> dict[str, Any]:
|
|
|
4056
4056
|
raise ValueError(
|
|
4057
4057
|
f"Unknown computation type {ctype!r}. "
|
|
4058
4058
|
"Use one of: number, dateDiff, dateOffset.")
|
|
4059
|
+
_check_compute_number_settings(config)
|
|
4059
4060
|
|
|
4060
4061
|
elif node_type in ("approve", "approval_block"):
|
|
4061
4062
|
if "target" in config and "source" not in config:
|
|
@@ -4185,6 +4186,63 @@ def _infer_compute_mode(config: dict[str, Any]) -> None:
|
|
|
4185
4186
|
f"Say it with \"mode\": one of {_COMPUTE_MODE_NAMES}.")
|
|
4186
4187
|
|
|
4187
4188
|
|
|
4189
|
+
# Decimal places on a compute step's result. The editor offers them on a
|
|
4190
|
+
# numeric formula (100) and on a function (106) whose result is a number,
|
|
4191
|
+
# 0-9 (MDPublic WorkflowSettings/Detail/Formula/index.jsx renderNumberDot,
|
|
4192
|
+
# same in pd-openweb), and saves them as ``number``. saveNode replaces the
|
|
4193
|
+
# node, so a save that leaves ``number`` out stores 0 — measured live
|
|
4194
|
+
# 2026-11-28: a freshly added step reads 2, the same step saved without it
|
|
4195
|
+
# reads 0 — and every result is rounded to a whole number (bug #456395).
|
|
4196
|
+
# 2 is therefore what a step gets when nothing is said: it is what the
|
|
4197
|
+
# editor starts a new step with. "Treat empty fields as 0" (``nullZero``)
|
|
4198
|
+
# is only offered on a numeric formula.
|
|
4199
|
+
_COMPUTE_DEFAULT_DECIMALS = 2
|
|
4200
|
+
_COMPUTE_MAX_DECIMALS = 9
|
|
4201
|
+
|
|
4202
|
+
|
|
4203
|
+
def _compute_has_numeric_result(config: dict[str, Any]) -> bool:
|
|
4204
|
+
mode = config.get("mode") or "number"
|
|
4205
|
+
if mode == "number":
|
|
4206
|
+
return True
|
|
4207
|
+
return mode == "function" and \
|
|
4208
|
+
str(config.get("output_type") or "number").lower() == "number"
|
|
4209
|
+
|
|
4210
|
+
|
|
4211
|
+
def _check_compute_number_settings(config: dict[str, Any]) -> None:
|
|
4212
|
+
if "precision" in config:
|
|
4213
|
+
value = config["precision"]
|
|
4214
|
+
if not _compute_has_numeric_result(config):
|
|
4215
|
+
raise ValueError(
|
|
4216
|
+
"'precision' sets the decimal places of a numeric result; "
|
|
4217
|
+
"this computation's result is not a number. Remove it.")
|
|
4218
|
+
if isinstance(value, bool) or not isinstance(value, int) or \
|
|
4219
|
+
not 0 <= value <= _COMPUTE_MAX_DECIMALS:
|
|
4220
|
+
raise ValueError(
|
|
4221
|
+
f"'precision' is the number of decimal places to keep, a "
|
|
4222
|
+
f"whole number from 0 to {_COMPUTE_MAX_DECIMALS}; got "
|
|
4223
|
+
f"{value!r}.")
|
|
4224
|
+
if "null_zero" in config:
|
|
4225
|
+
if (config.get("mode") or "number") != "number":
|
|
4226
|
+
raise ValueError(
|
|
4227
|
+
"'null_zero' (count empty fields as 0) only applies to a "
|
|
4228
|
+
"numeric formula. Remove it.")
|
|
4229
|
+
if not isinstance(config["null_zero"], bool):
|
|
4230
|
+
raise ValueError(
|
|
4231
|
+
f"'null_zero' is true or false; got "
|
|
4232
|
+
f"{config['null_zero']!r}.")
|
|
4233
|
+
|
|
4234
|
+
|
|
4235
|
+
def _compute_number_wire(config: dict[str, Any]) -> int:
|
|
4236
|
+
"""The ``number`` a numeric or function formula saves with."""
|
|
4237
|
+
mode = config.get("mode") or "number"
|
|
4238
|
+
if mode == "function" and str(config.get("output_type") or "").lower() \
|
|
4239
|
+
in ("date", "datetime"):
|
|
4240
|
+
# On a date result ``number`` is the date format; picking the
|
|
4241
|
+
# result type in the editor resets it to 0 (renderFunctionContent).
|
|
4242
|
+
return 0
|
|
4243
|
+
return config.get("precision", _COMPUTE_DEFAULT_DECIMALS)
|
|
4244
|
+
|
|
4245
|
+
|
|
4188
4246
|
# How the input date joins the sum, and how the result is shown. The two
|
|
4189
4247
|
# pickers a date computation carries (MDPublic Formula/index.jsx
|
|
4190
4248
|
# renderDateContent): 参与运算时的方式 1 = 日期+时间 / 2 = 日期, and 输出结果
|
|
@@ -4603,6 +4661,11 @@ def _save_formula_node(session, process_id, node_id, node, node_type, alias_to_i
|
|
|
4603
4661
|
"execute": True}
|
|
4604
4662
|
if action_id in ("100", "101", "106"):
|
|
4605
4663
|
wire["formulaValue"] = resolve_template(config.get("formula", ""), alias_to_id)
|
|
4664
|
+
if action_id in ("100", "106"):
|
|
4665
|
+
_check_compute_number_settings(config)
|
|
4666
|
+
wire["number"] = _compute_number_wire(config)
|
|
4667
|
+
if config.get("null_zero"):
|
|
4668
|
+
wire["nullZero"] = True
|
|
4606
4669
|
if action_id == "101":
|
|
4607
4670
|
# A date computation is a base date plus an offset, and the
|
|
4608
4671
|
# product refuses to save one that names no base. Splitting
|
|
@@ -9,6 +9,7 @@ from typing import Any, Optional
|
|
|
9
9
|
from hap_cli.core.session import Session, APIError
|
|
10
10
|
from hap_cli.core import worksheet_templates as wt
|
|
11
11
|
from hap_cli.core import layout_check as _lc
|
|
12
|
+
from hap_cli.core import money_currency as _money
|
|
12
13
|
|
|
13
14
|
logger = logging.getLogger("hap_cli.worksheet")
|
|
14
15
|
|
|
@@ -502,6 +503,9 @@ def create_worksheet_with_fields(
|
|
|
502
503
|
fields, worksheet_id=_PREFLIGHT_WORKSHEET_ID, title_name=title_name,
|
|
503
504
|
keep_default_controls=False)
|
|
504
505
|
_normalize_defsource(_checked_values(preview))
|
|
506
|
+
# A currency the caller named is checked now too; the organization's
|
|
507
|
+
# default is filled in by the real save once the sheet exists.
|
|
508
|
+
_money.fill_money_currency(session, preview, use_region_default=False)
|
|
505
509
|
# Resolved here rather than left to create_worksheet (which would do
|
|
506
510
|
# the same lookup): undoing a failed create needs the group too, and
|
|
507
511
|
# without it the removal does not reach the recycle bin (seen live
|
|
@@ -962,6 +966,17 @@ def _checked_values(
|
|
|
962
966
|
return controls
|
|
963
967
|
|
|
964
968
|
|
|
969
|
+
def _fill_money_currency(session: Session, worksheet_id: str,
|
|
970
|
+
controls: list[dict[str, Any]]) -> None:
|
|
971
|
+
"""New money fields get the currency the product would give them —
|
|
972
|
+
see ``money_currency``. Fields already on the sheet are left alone."""
|
|
973
|
+
def project_id() -> str:
|
|
974
|
+
info = get_worksheet_info(session, worksheet_id)
|
|
975
|
+
return info.get("projectId") or "" if isinstance(info, dict) else ""
|
|
976
|
+
_money.fill_money_currency(session, controls, project_id=project_id,
|
|
977
|
+
is_existing=is_server_control_id)
|
|
978
|
+
|
|
979
|
+
|
|
965
980
|
def save_controls(
|
|
966
981
|
session: Session,
|
|
967
982
|
worksheet_id: str,
|
|
@@ -995,6 +1010,7 @@ def save_controls(
|
|
|
995
1010
|
"""
|
|
996
1011
|
if check_values:
|
|
997
1012
|
controls = _checked_values(controls)
|
|
1013
|
+
_fill_money_currency(session, worksheet_id, controls)
|
|
998
1014
|
controls = _normalize_defsource(controls)
|
|
999
1015
|
v = 1 if version is None else version
|
|
1000
1016
|
last_err: dict[str, Any] | None = None
|
|
@@ -1998,6 +2014,7 @@ def add_controls(
|
|
|
1998
2014
|
"""
|
|
1999
2015
|
if check_values:
|
|
2000
2016
|
controls = _checked_values(controls)
|
|
2017
|
+
_fill_money_currency(session, worksheet_id, controls)
|
|
2001
2018
|
return session.api_call(
|
|
2002
2019
|
"Worksheet", "AddWorksheetControls",
|
|
2003
2020
|
{"worksheetId": worksheet_id,
|
|
@@ -97,7 +97,6 @@ TYPE_NAME = {v: k for k, v in TYPE.items()}
|
|
|
97
97
|
#
|
|
98
98
|
# chooserange 'CN' on AREA (type 24)
|
|
99
99
|
# allowtime '' on DATE (15)
|
|
100
|
-
# currency '{"currencycode":"CNY","symbol":"¥"}' on MONEY (8)
|
|
101
100
|
# thousandth '0' on NUMBER (6)
|
|
102
101
|
# sorttype 'en' on TEXT (2)
|
|
103
102
|
# — this one varies with the environment's language: the
|
|
@@ -112,6 +111,12 @@ TYPE_NAME = {v: k for k, v in TYPE.items()}
|
|
|
112
111
|
# through a generic advancedSetting path, not as literals — so source alone
|
|
113
112
|
# would wrongly call them drift. ``test_captured_advanced_keys_are_real``
|
|
114
113
|
# pins them against the captures.
|
|
114
|
+
#
|
|
115
|
+
# MONEY's ``currency`` used to sit in that list as a fixed CNY. The same
|
|
116
|
+
# captures also send ``currencynames`` beside it, and both come from the
|
|
117
|
+
# organization's region, so neither can be a constant: a new money field
|
|
118
|
+
# gets them on the way out, in ``money_currency.fill_money_currency``
|
|
119
|
+
# (bug #456384).
|
|
115
120
|
|
|
116
121
|
# Each entry contributes the minimum keys to satisfy the server when a
|
|
117
122
|
# control is created for the first time. Caller-supplied dicts override
|
|
@@ -137,10 +142,7 @@ _DEFAULTS: dict[str, dict[str, Any]] = {
|
|
|
137
142
|
},
|
|
138
143
|
"MONEY": {
|
|
139
144
|
"size": 6, "dot": 2, "enumDefault": 0, "enumDefault2": 2,
|
|
140
|
-
"advancedSetting": {
|
|
141
|
-
"currency": '{"currencycode":"CNY","symbol":"¥"}',
|
|
142
|
-
"roundtype": "2", "showformat": "1",
|
|
143
|
-
},
|
|
145
|
+
"advancedSetting": {"roundtype": "2", "showformat": "1"},
|
|
144
146
|
},
|
|
145
147
|
"FLAT_MENU": {"size": 12, "enumDefault2": 0},
|
|
146
148
|
"MULTI_SELECT": {
|
|
@@ -186,9 +186,10 @@ hap worksheet record add-discussion <WS_ID> <ROW_ID> -m "For everyone" --at-all
|
|
|
186
186
|
`hap contact search`.
|
|
187
187
|
- `--at-all` mentions everyone taking part in this record — its members plus
|
|
188
188
|
anyone who has commented.
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
- To mention someone **mid-sentence**, write `user:<accountId>` where the
|
|
190
|
+
mention belongs, e.g. `-m "Thanks user:<accountId> for checking"`; it stays in
|
|
191
|
+
place and notifies them. `--at` / `--at-all` append their mentions at the end.
|
|
192
|
+
Typing `@name` into the text yourself is just characters and notifies nobody.
|
|
192
193
|
|
|
193
194
|
Read it back with `hap worksheet record discussions <WS_ID> <ROW_ID>`. The two
|
|
194
195
|
read back differently: **a named person appears in the returned `mentions`**
|
|
@@ -589,6 +589,17 @@ It counts from the current time unless `config.input` says otherwise:
|
|
|
589
589
|
anything the formula does not make obvious; a date result with a formula
|
|
590
590
|
that is not an offset is refused rather than built as a sum.
|
|
591
591
|
|
|
592
|
+
A numeric result keeps 2 decimal places unless `precision` says otherwise
|
|
593
|
+
(0 to 9) — set it whenever the result is a rate, a ratio or a unit price,
|
|
594
|
+
or it is rounded before it is written anywhere. `"null_zero": true` counts
|
|
595
|
+
an empty field as 0 in a numeric formula:
|
|
596
|
+
|
|
597
|
+
```json
|
|
598
|
+
{"nodeAlias":"inv","nodeType":"compute","name":"Inverse rate",
|
|
599
|
+
"config":{"mode":"function","output_type":"number",
|
|
600
|
+
"formula":"1 / $trigger-<rate column>$","precision":6}}
|
|
601
|
+
```
|
|
602
|
+
|
|
592
603
|
## 4. Branches: `config.paths`
|
|
593
604
|
<!-- hook: A branch is one node with every path inside it; a path with no condition is the default, and put it last. -->
|
|
594
605
|
<!-- alias: branches -->
|
|
@@ -164,8 +164,9 @@ hap worksheet record add-discussion <WS_ID> <ROW_ID> -m "都看一下" --at-all
|
|
|
164
164
|
|
|
165
165
|
- `--at` 按账号 ID 点名,可重复;账号 ID 用 `hap contact search` 查。
|
|
166
166
|
- `--at-all` 提及这条记录的全体参与者(记录成员,加上所有参与过讨论的人)。
|
|
167
|
-
-
|
|
168
|
-
|
|
167
|
+
- 想在正文**中间** @ 人,就在那个位置写 `user:<账号ID>`,例如
|
|
168
|
+
`-m "我 user:<账号ID> 来看一下"`,提及会留在原处并通知到人。`--at` / `--at-all`
|
|
169
|
+
则把提及补在末尾。在正文里手写 `@某某` 只是几个普通汉字,不会真的通知到人。
|
|
169
170
|
|
|
170
171
|
回读用 `hap worksheet record discussions <WS_ID> <ROW_ID>`。注意两者回读不一样:
|
|
171
172
|
**点名的人会出现在返回的 `mentions` 里**(带账号 ID 和姓名),而 `--at-all` 不会
|