hap-cli 0.9.16__tar.gz → 0.9.18__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.16 → hap_cli-0.9.18}/PKG-INFO +1 -1
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/__init__.py +1 -1
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/role_cmd.py +12 -3
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/worksheet_cmd.py +35 -5
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/role.py +194 -2
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/worksheet.py +62 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/locale/messages.json +12 -4
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/PKG-INFO +1 -1
- {hap_cli-0.9.16 → hap_cli-0.9.18}/MANIFEST.in +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/README.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/README.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/README_CN.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/__main__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/_entry.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/app_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/app_creator_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/app_editor_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/attachment_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/auth_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/calendar_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/chart_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/chat_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/chatbot_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/config_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/contact_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/department_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/group_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/guide_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/icon_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/instance_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/node_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/optionset_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/page_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/post_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/record_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/region_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/update_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/upload_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/v3_registry.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/commands/workflow_cmd.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/context.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/action_spec_adapter.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/charts.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/cleanup.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/compiler.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/config.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/design/design.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/errors.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/executor.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/fields.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/hap.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/merge.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/recording/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/recording/console.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/recording/mirror.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/recording/report.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/schema.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/cli.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/executor.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/seed/template.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/selftest.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/smoke.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/steps.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/store.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/validate.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/attachment.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/auth.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/calendar_mod.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/chart.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/chat.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/chatbot.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/cli_access.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/condition_dsl.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/contact.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/control_type_codes.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/department.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/apply.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/componentlower.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/editspec/component.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/editspec/custom-action.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/editspec/envelope.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/editspec/field.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/editspec.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/errors.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/fieldlower.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/jsonschema_mini.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/models.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/ops.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/planner.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/editor/reader.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/field_normalizer.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/field_spec_adapter.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/filter_translator.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/filter_v3.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/flow_node.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/global_meta.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/group.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/guide.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/icon_index.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/instance.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/layout_check.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/logger.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/money_currency.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/optionset.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/page.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/post.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record_defaults.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record_discussions.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record_form_checks.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record_lookups.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/record_rules.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/relation_scope.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/relogin.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/response_crypto.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/role_perm_builder.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/rule_spec_adapter.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/session.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/token_crypto.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/update.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/upload.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/v3/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/v3/dispatcher.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/v3/render.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/v3/schema.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/view_spec_adapter.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/workflow.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/workflow_node_dsl.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/worksheet_form.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/worksheet_reference.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/core/worksheet_templates.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/approval.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/chart.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/messages.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/overview.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/post.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/record.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/setup.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/skills.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/workflow.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/en/worksheet.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/index.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/approval.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/chart.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/messages.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/overview.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/post.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/record.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/setup.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/skills.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/workflow.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/guide/zh-Hans/worksheet.md +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/i18n.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/locale/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/locale/messages.schema.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/__init__.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/atomic_write.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/confirm.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/formatting.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/options.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli/utils/parameter_mapping.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/SOURCES.txt +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/dependency_links.txt +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/entry_points.txt +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/requires.txt +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/hap_cli.egg-info/top_level.txt +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/setup.cfg +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/setup.py +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/INDEX.json +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/create_optionset.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/create_role.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/delete_optionset.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/delete_record.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/delete_role.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_app_info.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_details.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_list.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_logs.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_relations.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_regions.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_role_details.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/get_role_list.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/knowledge_search.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
- {hap_cli-0.9.16 → hap_cli-0.9.18}/sources/v3-api-schema/update_optionset.yaml +0 -0
|
@@ -9,6 +9,7 @@ from hap_cli.core import role as role_mod
|
|
|
9
9
|
from hap_cli.utils.formatting import output_json, output_kv, output_table
|
|
10
10
|
from hap_cli.i18n import t
|
|
11
11
|
from hap_cli.utils.confirm import confirm_or_abort
|
|
12
|
+
from hap_cli.utils.options import json_arg
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
@click.group(help=t('Role management.'))
|
|
@@ -189,8 +190,16 @@ def role_permissions(ctx, app_id, role_id):
|
|
|
189
190
|
@click.argument("app_id")
|
|
190
191
|
@click.argument("role_id")
|
|
191
192
|
@click.option("--permissions", "-P", default="",
|
|
192
|
-
help="Per-worksheet
|
|
193
|
-
"(only used with --permission-way 0)"
|
|
193
|
+
help="Per-worksheet rules as a JSON array, or @file to read "
|
|
194
|
+
"them from a file (only used with --permission-way 0). "
|
|
195
|
+
'Each rule: {"id": <worksheet id>, "recordDataScope": '
|
|
196
|
+
'{"read": ..., "edit": ..., "delete": ...}}, each 0 '
|
|
197
|
+
"(none), 20 (own records), 30 (own and subordinates') or "
|
|
198
|
+
"100 (all), plus optional recordActions / "
|
|
199
|
+
"worksheetActions / paymentActions as 'app role "
|
|
200
|
+
"permissions' shows them. Worksheets not listed keep "
|
|
201
|
+
"their current per-worksheet access; a role switching "
|
|
202
|
+
"to per-worksheet rules starts with none.")
|
|
194
203
|
@click.option("--permission-way", type=int, default=0,
|
|
195
204
|
help="Permission level: 0=custom (per-worksheet rules), "
|
|
196
205
|
"20=view all records, 30=manage own records, "
|
|
@@ -200,7 +209,7 @@ def role_set_permissions(ctx, app_id, role_id, permissions, permission_way):
|
|
|
200
209
|
"""Edit role permissions."""
|
|
201
210
|
try:
|
|
202
211
|
session = ctx.get_session()
|
|
203
|
-
sheets =
|
|
212
|
+
sheets = json_arg(permissions, what="permissions")
|
|
204
213
|
data = role_mod.set_role_permissions(
|
|
205
214
|
session, app_id, role_id,
|
|
206
215
|
permission_way=permission_way, sheets=sheets,
|
|
@@ -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))
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"""Role management module for Mingdao HAP."""
|
|
2
2
|
|
|
3
|
+
import copy
|
|
4
|
+
import logging
|
|
3
5
|
from typing import Any, Optional
|
|
4
6
|
|
|
5
7
|
from hap_cli.core.session import Session, require_code
|
|
6
8
|
|
|
9
|
+
logger = logging.getLogger("hap_cli.role")
|
|
10
|
+
|
|
7
11
|
|
|
8
12
|
def get_roles(
|
|
9
13
|
session: Session,
|
|
@@ -256,7 +260,8 @@ def set_role_permissions(
|
|
|
256
260
|
model["permissionWay"] = permission_way
|
|
257
261
|
if permission_way == 0:
|
|
258
262
|
if sheets is not None:
|
|
259
|
-
model["sheets"] = sheets
|
|
263
|
+
model["sheets"] = apply_sheet_rules(model.get("sheets") or [],
|
|
264
|
+
sheets)
|
|
260
265
|
else:
|
|
261
266
|
model.pop("sheets", None)
|
|
262
267
|
data: dict[str, Any] = {
|
|
@@ -265,10 +270,197 @@ def set_role_permissions(
|
|
|
265
270
|
project_id = project_id or str(model.get("projectId") or "")
|
|
266
271
|
if project_id:
|
|
267
272
|
data["projectId"] = project_id
|
|
268
|
-
|
|
273
|
+
result = require_code(
|
|
269
274
|
session.api_call("AppManagement", "EditAppRole", data),
|
|
270
275
|
action="permission change", meanings=_ROLE_SAVE_MEANINGS,
|
|
271
276
|
)
|
|
277
|
+
if permission_way == 0 and sheets:
|
|
278
|
+
_check_sheet_access_saved(session, app_id, role_id, model["sheets"],
|
|
279
|
+
sheets)
|
|
280
|
+
return result
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
# ── Per-worksheet rules ──────────────────────────────────────────────────
|
|
284
|
+
#
|
|
285
|
+
# The role model's ``sheets[]`` is not where a rule can be written as-is
|
|
286
|
+
# (bug #456396). Whether a role sees, edits or deletes in a worksheet is
|
|
287
|
+
# decided per view — ``views[].canRead / canEdit / canRemove`` — and the
|
|
288
|
+
# ``readLevel / editLevel / removeLevel`` beside them only say which
|
|
289
|
+
# records (20 own, 30 own and subordinates', 100 all): pd-openweb
|
|
290
|
+
# src/pages/Role/component/RoleSet/SheetTable.jsx changeSheetModel and
|
|
291
|
+
# TooltipSetting/sheetSet.jsx, MDPublic identical. Saving rules verbatim
|
|
292
|
+
# replaced the stored list with entries the server cannot read, and every
|
|
293
|
+
# worksheet came back unchecked.
|
|
294
|
+
#
|
|
295
|
+
# The rule shape accepted is the one ``app role permissions`` reads and
|
|
296
|
+
# ``app role create`` takes (V3 worksheetPermissions,
|
|
297
|
+
# sources/v3-api-schema/create_role.yaml): ``{id, recordDataScope:
|
|
298
|
+
# {read, edit, delete}, recordActions?, worksheetActions?,
|
|
299
|
+
# paymentActions?}``. It is merged onto the stored worksheet, so a
|
|
300
|
+
# worksheet not named keeps what it had. The product's own entry — one
|
|
301
|
+
# that carries ``sheetId`` and ``views`` — still round-trips unchanged.
|
|
302
|
+
|
|
303
|
+
_SCOPES = (0, 20, 30, 100)
|
|
304
|
+
_RULE_KEYS = {"id", "name", "recordDataScope", "recordActions",
|
|
305
|
+
"worksheetActions", "paymentActions"}
|
|
306
|
+
# V3 action name -> the role model's per-worksheet switch. ``add`` is the
|
|
307
|
+
# editor's "add" checkbox, ``canAdd``.
|
|
308
|
+
_RECORD_ACTIONS = {"share": "recordShare", "discuss": "recordDiscussion",
|
|
309
|
+
"systemPrint": "recordSystemPrinting",
|
|
310
|
+
"attachmentDownload": "recordAttachmentDownload",
|
|
311
|
+
"log": "recordLogging"}
|
|
312
|
+
_WORKSHEET_ACTIONS = {"shareView": "worksheetShareView",
|
|
313
|
+
"import": "worksheetImport",
|
|
314
|
+
"export": "worksheetExport",
|
|
315
|
+
"discuss": "worksheetDiscuss",
|
|
316
|
+
"batchOperation": "worksheetBatchOperation"}
|
|
317
|
+
_PAYMENT_ACTIONS = {"pay": "payment"}
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def _rule_error(i: int, what: str) -> ValueError:
|
|
321
|
+
return ValueError(f"Worksheet rule {i}: {what}")
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def _set_switch(sheet: dict[str, Any], key: str, enable: Any) -> None:
|
|
325
|
+
current = sheet.get(key)
|
|
326
|
+
sheet[key] = {**(current if isinstance(current, dict) else
|
|
327
|
+
{"range": 1, "allowExport": False}),
|
|
328
|
+
"enable": bool(enable)}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def _apply_actions(sheet: dict[str, Any], i: int, block: Any, name: str,
|
|
332
|
+
mapping: dict[str, str], extra: tuple = ()) -> None:
|
|
333
|
+
if block is None:
|
|
334
|
+
return
|
|
335
|
+
if not isinstance(block, dict):
|
|
336
|
+
raise _rule_error(i, f"'{name}' must be an object.")
|
|
337
|
+
allowed = set(mapping) | set(extra)
|
|
338
|
+
unknown = sorted(set(block) - allowed)
|
|
339
|
+
if unknown:
|
|
340
|
+
raise _rule_error(
|
|
341
|
+
i, f"'{name}' does not take {', '.join(map(repr, unknown))}. "
|
|
342
|
+
f"It takes: {', '.join(sorted(allowed))}.")
|
|
343
|
+
for key, value in block.items():
|
|
344
|
+
if key in mapping:
|
|
345
|
+
_set_switch(sheet, mapping[key], value)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def _apply_rule(sheet: dict[str, Any], rule: dict[str, Any],
|
|
349
|
+
i: int) -> dict[str, Any]:
|
|
350
|
+
scope = rule.get("recordDataScope")
|
|
351
|
+
if not isinstance(scope, dict):
|
|
352
|
+
raise _rule_error(
|
|
353
|
+
i, "needs 'recordDataScope': {\"read\", \"edit\", \"delete\"}, "
|
|
354
|
+
"each 0 (none), 20 (own records), 30 (own and "
|
|
355
|
+
"subordinates') or 100 (all records).")
|
|
356
|
+
levels = {}
|
|
357
|
+
for key in ("read", "edit", "delete"):
|
|
358
|
+
value = scope.get(key, 0)
|
|
359
|
+
if isinstance(value, bool) or value not in _SCOPES:
|
|
360
|
+
raise _rule_error(
|
|
361
|
+
i, f"recordDataScope.{key} is {value!r}; use 0, 20, 30 or "
|
|
362
|
+
f"100.")
|
|
363
|
+
levels[key] = value
|
|
364
|
+
if levels["read"] == 0 and (levels["edit"] or levels["delete"]):
|
|
365
|
+
raise _rule_error(
|
|
366
|
+
i, "a worksheet the role cannot read cannot be edited or "
|
|
367
|
+
"deleted in either; set read above 0, or edit and delete "
|
|
368
|
+
"to 0.")
|
|
369
|
+
out = copy.deepcopy(sheet)
|
|
370
|
+
read, edit, delete = (levels[k] > 0 for k in ("read", "edit", "delete"))
|
|
371
|
+
out["views"] = [{**v, "canRead": read, "canEdit": edit,
|
|
372
|
+
"canRemove": delete}
|
|
373
|
+
for v in (out.get("views") or []) if isinstance(v, dict)]
|
|
374
|
+
for key, level in (("readLevel", "read"), ("editLevel", "edit"),
|
|
375
|
+
("removeLevel", "delete")):
|
|
376
|
+
if levels[level]:
|
|
377
|
+
out[key] = levels[level]
|
|
378
|
+
record_actions = rule.get("recordActions")
|
|
379
|
+
_apply_actions(out, i, record_actions, "recordActions",
|
|
380
|
+
_RECORD_ACTIONS, extra=("add",))
|
|
381
|
+
if isinstance(record_actions, dict) and "add" in record_actions:
|
|
382
|
+
out["canAdd"] = bool(record_actions["add"])
|
|
383
|
+
if not read:
|
|
384
|
+
# changeSheetModel clears "add" along with "view".
|
|
385
|
+
out["canAdd"] = False
|
|
386
|
+
_apply_actions(out, i, rule.get("worksheetActions"), "worksheetActions",
|
|
387
|
+
_WORKSHEET_ACTIONS)
|
|
388
|
+
_apply_actions(out, i, rule.get("paymentActions"), "paymentActions",
|
|
389
|
+
_PAYMENT_ACTIONS)
|
|
390
|
+
return out
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def apply_sheet_rules(stored: list[dict[str, Any]],
|
|
394
|
+
rules: Any) -> list[dict[str, Any]]:
|
|
395
|
+
"""The role model's ``sheets`` with ``rules`` merged in."""
|
|
396
|
+
if not isinstance(rules, list):
|
|
397
|
+
raise ValueError("Worksheet rules must be a JSON array.")
|
|
398
|
+
by_id = {s.get("sheetId"): s for s in stored if isinstance(s, dict)}
|
|
399
|
+
updated: dict[str, dict[str, Any]] = {}
|
|
400
|
+
for i, rule in enumerate(rules, start=1):
|
|
401
|
+
if not isinstance(rule, dict):
|
|
402
|
+
raise _rule_error(i, "must be an object.")
|
|
403
|
+
if "sheetId" in rule:
|
|
404
|
+
if not isinstance(rule.get("views"), list):
|
|
405
|
+
raise _rule_error(
|
|
406
|
+
i, "an entry naming 'sheetId' is the role editor's own "
|
|
407
|
+
"form and has to carry its 'views' — that is where "
|
|
408
|
+
"view, edit and delete access is decided. Write "
|
|
409
|
+
"{\"id\": <worksheet id>, \"recordDataScope\": "
|
|
410
|
+
"{...}} instead.")
|
|
411
|
+
if rule["sheetId"] not in by_id:
|
|
412
|
+
raise _rule_error(
|
|
413
|
+
i, f"worksheet {rule['sheetId']!r} is not in this "
|
|
414
|
+
f"role's application.")
|
|
415
|
+
updated[rule["sheetId"]] = rule
|
|
416
|
+
continue
|
|
417
|
+
unknown = sorted(set(rule) - _RULE_KEYS)
|
|
418
|
+
if unknown or not rule.get("id"):
|
|
419
|
+
raise _rule_error(
|
|
420
|
+
i, (f"does not take {', '.join(map(repr, unknown))}. "
|
|
421
|
+
if unknown else "needs the worksheet 'id'. ")
|
|
422
|
+
+ "A rule is {\"id\": <worksheet id>, \"recordDataScope\": "
|
|
423
|
+
"{\"read\", \"edit\", \"delete\"}} plus optional "
|
|
424
|
+
"recordActions / worksheetActions / paymentActions — the "
|
|
425
|
+
"shape 'app role permissions' shows.")
|
|
426
|
+
sheet_id = rule["id"]
|
|
427
|
+
if sheet_id not in by_id:
|
|
428
|
+
raise _rule_error(
|
|
429
|
+
i, f"worksheet {sheet_id!r} is not in this role's "
|
|
430
|
+
f"application.")
|
|
431
|
+
updated[sheet_id] = _apply_rule(updated.get(sheet_id) or
|
|
432
|
+
by_id[sheet_id], rule, i)
|
|
433
|
+
return [updated.get(s.get("sheetId"), s) if isinstance(s, dict) else s
|
|
434
|
+
for s in stored]
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
def _view_access(sheet: dict[str, Any]) -> list[tuple]:
|
|
438
|
+
return [(v.get("viewId"), bool(v.get("canRead")), bool(v.get("canEdit")),
|
|
439
|
+
bool(v.get("canRemove")))
|
|
440
|
+
for v in sheet.get("views") or [] if isinstance(v, dict)]
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
def _check_sheet_access_saved(session: Session, app_id: str, role_id: str,
|
|
444
|
+
sent: list[dict[str, Any]],
|
|
445
|
+
rules: list[dict[str, Any]]) -> None:
|
|
446
|
+
"""Re-read the role: the save answers success either way."""
|
|
447
|
+
named = {r.get("id") or r.get("sheetId") for r in rules
|
|
448
|
+
if isinstance(r, dict)}
|
|
449
|
+
after = get_role_detail(session, app_id, role_id)
|
|
450
|
+
stored = {s.get("sheetId"): s for s in
|
|
451
|
+
(after.get("sheets") if isinstance(after, dict) else None) or []
|
|
452
|
+
if isinstance(s, dict)}
|
|
453
|
+
wrong = [s.get("sheetName") or s.get("sheetId") for s in sent
|
|
454
|
+
if isinstance(s, dict) and s.get("sheetId") in named
|
|
455
|
+
and _view_access(stored.get(s.get("sheetId")) or {})
|
|
456
|
+
!= _view_access(s)]
|
|
457
|
+
if wrong:
|
|
458
|
+
logger.warning("role %s: worksheet access not saved for %s",
|
|
459
|
+
role_id, wrong)
|
|
460
|
+
raise ValueError(
|
|
461
|
+
f"The role was saved, but reading it back shows different "
|
|
462
|
+
f"access on: {', '.join(map(str, wrong))}. Check the role in "
|
|
463
|
+
f"the role editor.")
|
|
272
464
|
|
|
273
465
|
|
|
274
466
|
def set_role_chatbots(
|
|
@@ -2600,6 +2600,63 @@ def get_form_submission_settings(
|
|
|
2600
2600
|
return session.api_call("Worksheet", "GetFormSubmissionSettings", data)
|
|
2601
2601
|
|
|
2602
2602
|
|
|
2603
|
+
# The form's field-name position (字段名称位置) is two settings per side
|
|
2604
|
+
# that the editor only ever writes together (MDPublic / pd-openweb
|
|
2605
|
+
# src/pages/widgetConfig/widgetDisplay/components/WidgetStyle.jsx, saved
|
|
2606
|
+
# by widgetConfig/index.jsx saveStyleInfo through EditWorksheetSetting):
|
|
2607
|
+
# 垂直 titlelayout_<side>='1', align_<side>=''
|
|
2608
|
+
# 水平 titlelayout_<side>='2', align_<side>='1'
|
|
2609
|
+
# 右对齐 titlelayout_<side>='2', align_<side>='2'
|
|
2610
|
+
# The form highlights 垂直 when titlelayout is '1' or unset, and 水平 /
|
|
2611
|
+
# 右对齐 from align alone, so a half pair — align '1' with titlelayout
|
|
2612
|
+
# left at '1' — lights up two choices at once (bug #456405).
|
|
2613
|
+
LABEL_POSITIONS = {"vertical": ("1", ""), "horizontal": ("2", "1"),
|
|
2614
|
+
"right": ("2", "2")}
|
|
2615
|
+
_LABEL_SIDES = ("pc", "app")
|
|
2616
|
+
|
|
2617
|
+
|
|
2618
|
+
def label_position_setting(side: str, position: str) -> dict[str, str]:
|
|
2619
|
+
"""The settings pair for one side (``pc`` / ``app``)."""
|
|
2620
|
+
layout, align = LABEL_POSITIONS[position]
|
|
2621
|
+
return {f"titlelayout_{side}": layout, f"align_{side}": align}
|
|
2622
|
+
|
|
2623
|
+
|
|
2624
|
+
def _pair_label_position(advanced_setting: dict[str, Any],
|
|
2625
|
+
edit_ad_keys: list[str]
|
|
2626
|
+
) -> tuple[dict[str, Any], list[str]]:
|
|
2627
|
+
adv = dict(advanced_setting)
|
|
2628
|
+
keys = list(edit_ad_keys)
|
|
2629
|
+
for side in _LABEL_SIDES:
|
|
2630
|
+
layout_key, align_key = f"titlelayout_{side}", f"align_{side}"
|
|
2631
|
+
has_layout = layout_key in keys and layout_key in adv
|
|
2632
|
+
has_align = align_key in keys and align_key in adv
|
|
2633
|
+
if not (has_layout or has_align):
|
|
2634
|
+
continue
|
|
2635
|
+
layout = str(adv[layout_key]) if has_layout else None
|
|
2636
|
+
align = str(adv[align_key] or "") if has_align else None
|
|
2637
|
+
if layout not in (None, "1", "2"):
|
|
2638
|
+
raise ValueError(f"{layout_key} is {layout!r}; use '1' "
|
|
2639
|
+
f"(vertical) or '2' (horizontal / right).")
|
|
2640
|
+
if align not in (None, "", "1", "2"):
|
|
2641
|
+
raise ValueError(f"{align_key} is {align!r}; use '' "
|
|
2642
|
+
f"(vertical), '1' (horizontal) or '2' (right).")
|
|
2643
|
+
if layout is None:
|
|
2644
|
+
layout = "2" if align else "1"
|
|
2645
|
+
elif align is None:
|
|
2646
|
+
align = "" if layout == "1" else "1"
|
|
2647
|
+
if (layout == "1") != (align == ""):
|
|
2648
|
+
raise ValueError(
|
|
2649
|
+
f"{layout_key}={layout!r} with {align_key}={align!r} is not "
|
|
2650
|
+
f"a field-name position: it shows two positions selected at "
|
|
2651
|
+
f"once. Use --label-position-{'pc' if side == 'pc' else 'mobile'} "
|
|
2652
|
+
f"vertical / horizontal / right instead.")
|
|
2653
|
+
adv[layout_key], adv[align_key] = layout, align
|
|
2654
|
+
for key in (layout_key, align_key):
|
|
2655
|
+
if key not in keys:
|
|
2656
|
+
keys.append(key)
|
|
2657
|
+
return adv, keys
|
|
2658
|
+
|
|
2659
|
+
|
|
2603
2660
|
def edit_worksheet_setting(
|
|
2604
2661
|
session: Session,
|
|
2605
2662
|
worksheet_id: str,
|
|
@@ -2615,7 +2672,12 @@ def edit_worksheet_setting(
|
|
|
2615
2672
|
workSheetId (sic), appId, projectId, advancedSetting, editAdKeys.
|
|
2616
2673
|
The ``editAdKeys`` list tells the server which keys inside
|
|
2617
2674
|
``advancedSetting`` to persist this call.
|
|
2675
|
+
|
|
2676
|
+
The field-name position is completed to the pair the editor writes,
|
|
2677
|
+
and a contradictory pair is refused — see ``LABEL_POSITIONS``.
|
|
2618
2678
|
"""
|
|
2679
|
+
advanced_setting, edit_ad_keys = _pair_label_position(
|
|
2680
|
+
advanced_setting, edit_ad_keys)
|
|
2619
2681
|
data: dict[str, Any] = {
|
|
2620
2682
|
"workSheetId": worksheet_id,
|
|
2621
2683
|
"appId": app_id,
|
|
@@ -1920,8 +1920,8 @@
|
|
|
1920
1920
|
"zh-Hans": "权限级别:0=自定义(按工作表规则),20=查看全部记录,30=管理本人记录,50=查看全部 + 管理本人,80=管理全部记录"
|
|
1921
1921
|
},
|
|
1922
1922
|
"app role set-permissions --permissions": {
|
|
1923
|
-
"en": "Per-worksheet
|
|
1924
|
-
"zh-Hans": "按工作表的权限规则,JSON
|
|
1923
|
+
"en": "Per-worksheet rules as a JSON array, or @file to read them from a file (only used with --permission-way 0). Each rule: {\"id\": <worksheet id>, \"recordDataScope\": {\"read\": ..., \"edit\": ..., \"delete\": ...}}, each 0 (none), 20 (own records), 30 (own and subordinates') or 100 (all), plus optional recordActions / worksheetActions / paymentActions as 'app role permissions' shows them. Worksheets not listed keep their current per-worksheet access; a role switching to per-worksheet rules starts with none.",
|
|
1924
|
+
"zh-Hans": "按工作表的权限规则,JSON 数组,或写 @文件 从文件读取(仅在 --permission-way 0 时使用)。每条规则:{\"id\": <工作表 ID>, \"recordDataScope\": {\"read\": ..., \"edit\": ..., \"delete\": ...}},取值 0(无)、20(本人的记录)、30(本人及下属的)或 100(全部),可另加 recordActions / worksheetActions / paymentActions,写法与 'app role permissions' 读出的一致。没有列出的工作表保持原有的按表权限;从统一权限切换到按表授权的角色,起初没有任何工作表的权限。"
|
|
1925
1925
|
},
|
|
1926
1926
|
"app select": {
|
|
1927
1927
|
"en": "Set the default application used when --app-id is omitted.",
|
|
@@ -6948,8 +6948,8 @@
|
|
|
6948
6948
|
"zh-Hans": "工作流工作项 ID(工作流上下文)"
|
|
6949
6949
|
},
|
|
6950
6950
|
"worksheet save-form-settings": {
|
|
6951
|
-
"en": "Update worksheet form-submission / advanced settings.\n\nOnly the keys listed in ``--edit-keys`` are saved from\n``--advanced-setting`` — other keys are left unchanged (partial\nupdate).",
|
|
6952
|
-
"zh-Hans": "更新工作表的表单提交 / 高级设置。\n\n只保存 ``--advanced-setting`` 中在 ``--edit-keys`` 列出的键——\n
|
|
6951
|
+
"en": "Update worksheet form-submission / advanced settings.\n\nOnly the keys listed in ``--edit-keys`` are saved from\n``--advanced-setting`` — other keys are left unchanged (partial\nupdate). --label-position-pc / --label-position-mobile set where field\nnames sit on the form, and also repair a form that shows two positions\nselected at once.",
|
|
6952
|
+
"zh-Hans": "更新工作表的表单提交 / 高级设置。\n\n只保存 ``--advanced-setting`` 中在 ``--edit-keys`` 列出的键——\n其他键保持不变(部分更新)。--label-position-pc / --label-position-mobile\n设置表单上字段名称的位置,也能修复表单上同时选中两种位置的情况。"
|
|
6953
6953
|
},
|
|
6954
6954
|
"worksheet save-form-settings --advanced-setting": {
|
|
6955
6955
|
"en": "JSON object of the complete advancedSetting to persist",
|
|
@@ -6971,6 +6971,14 @@
|
|
|
6971
6971
|
"en": "Output in JSON format",
|
|
6972
6972
|
"zh-Hans": "以 JSON 格式输出"
|
|
6973
6973
|
},
|
|
6974
|
+
"worksheet save-form-settings --label-position-mobile": {
|
|
6975
|
+
"en": "The same for the mobile web form.",
|
|
6976
|
+
"zh-Hans": "移动 Web 端表单,取值同上。"
|
|
6977
|
+
},
|
|
6978
|
+
"worksheet save-form-settings --label-position-pc": {
|
|
6979
|
+
"en": "Where field names sit on the PC form: vertical (above the value), horizontal (to its left) or right (to its left, right-aligned).",
|
|
6980
|
+
"zh-Hans": "PC 端表单上字段名称的位置:vertical(在值的上方,即垂直)、horizontal(在值的左侧,即水平)或 right(在左侧并右对齐)。"
|
|
6981
|
+
},
|
|
6974
6982
|
"worksheet save-form-settings --org-id": {
|
|
6975
6983
|
"en": "Organization ID",
|
|
6976
6984
|
"zh-Hans": "组织 ID"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|