hap-cli 0.9.18__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.
Files changed (257) hide show
  1. {hap_cli-0.9.18 → hap_cli-0.9.19}/PKG-INFO +4 -1
  2. {hap_cli-0.9.18/hap_cli → hap_cli-0.9.19}/README.md +3 -0
  3. {hap_cli-0.9.18 → hap_cli-0.9.19/hap_cli}/README.md +3 -0
  4. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/README_CN.md +3 -0
  5. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/__init__.py +1 -1
  6. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/v3_registry.py +231 -1
  7. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/filter_v3.py +63 -0
  8. hap_cli-0.9.19/hap_cli/core/print_template.py +42 -0
  9. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/session.py +11 -1
  10. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/v3/dispatcher.py +87 -10
  11. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/v3/schema.py +2 -0
  12. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/locale/messages.json +954 -0
  13. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/PKG-INFO +4 -1
  14. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/SOURCES.txt +43 -1
  15. hap_cli-0.9.19/sources/v3-api-schema/INDEX.json +713 -0
  16. hap_cli-0.9.19/sources/v3-api-schema/create_app_backup.yaml +38 -0
  17. hap_cli-0.9.19/sources/v3-api-schema/create_print_template.yaml +135 -0
  18. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/create_role.yaml +7 -0
  19. hap_cli-0.9.19/sources/v3-api-schema/create_worksheet_index.yaml +69 -0
  20. hap_cli-0.9.19/sources/v3-api-schema/delete_app_backup.yaml +23 -0
  21. hap_cli-0.9.19/sources/v3-api-schema/delete_print_template.yaml +30 -0
  22. hap_cli-0.9.19/sources/v3-api-schema/delete_worksheet_filter.yaml +30 -0
  23. hap_cli-0.9.19/sources/v3-api-schema/delete_worksheet_index.yaml +30 -0
  24. hap_cli-0.9.19/sources/v3-api-schema/get_app_ai_models.yaml +18 -0
  25. hap_cli-0.9.19/sources/v3-api-schema/get_app_backup_download_url.yaml +23 -0
  26. hap_cli-0.9.19/sources/v3-api-schema/get_app_backup_list.yaml +33 -0
  27. hap_cli-0.9.19/sources/v3-api-schema/get_app_restore_status.yaml +23 -0
  28. hap_cli-0.9.19/sources/v3-api-schema/get_portal_config.yaml +56 -0
  29. hap_cli-0.9.19/sources/v3-api-schema/get_portal_status.yaml +23 -0
  30. hap_cli-0.9.19/sources/v3-api-schema/get_print_template_details.yaml +30 -0
  31. hap_cli-0.9.19/sources/v3-api-schema/get_print_template_list.yaml +25 -0
  32. hap_cli-0.9.19/sources/v3-api-schema/get_public_form_config.yaml +25 -0
  33. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_role_list.yaml +10 -0
  34. hap_cli-0.9.19/sources/v3-api-schema/get_share_card_setting.yaml +33 -0
  35. hap_cli-0.9.19/sources/v3-api-schema/get_sms_signatures.yaml +18 -0
  36. hap_cli-0.9.19/sources/v3-api-schema/get_workflow_sms_templates.yaml +64 -0
  37. hap_cli-0.9.19/sources/v3-api-schema/get_worksheet_index_list.yaml +25 -0
  38. hap_cli-0.9.19/sources/v3-api-schema/patch_custom_page_components.yaml +4183 -0
  39. hap_cli-0.9.19/sources/v3-api-schema/patch_portal_config.yaml +389 -0
  40. hap_cli-0.9.19/sources/v3-api-schema/refresh_public_form_url.yaml +23 -0
  41. hap_cli-0.9.19/sources/v3-api-schema/rename_app_backup.yaml +35 -0
  42. hap_cli-0.9.19/sources/v3-api-schema/rename_worksheet_index.yaml +44 -0
  43. hap_cli-0.9.19/sources/v3-api-schema/replace_print_template_file.yaml +78 -0
  44. hap_cli-0.9.19/sources/v3-api-schema/reset_public_form_fields.yaml +23 -0
  45. hap_cli-0.9.19/sources/v3-api-schema/restore_app_backup.yaml +48 -0
  46. hap_cli-0.9.19/sources/v3-api-schema/save_worksheet_filter.yaml +229 -0
  47. hap_cli-0.9.19/sources/v3-api-schema/sort_roles.yaml +32 -0
  48. hap_cli-0.9.19/sources/v3-api-schema/switch_portal.yaml +30 -0
  49. hap_cli-0.9.19/sources/v3-api-schema/switch_public_form.yaml +33 -0
  50. hap_cli-0.9.19/sources/v3-api-schema/update_app_maintenance.yaml +36 -0
  51. hap_cli-0.9.19/sources/v3-api-schema/update_portal_config.yaml +280 -0
  52. hap_cli-0.9.19/sources/v3-api-schema/update_print_template.yaml +79 -0
  53. hap_cli-0.9.19/sources/v3-api-schema/update_public_form.yaml +101 -0
  54. hap_cli-0.9.19/sources/v3-api-schema/update_public_form_settings.yaml +379 -0
  55. hap_cli-0.9.19/sources/v3-api-schema/update_role.yaml +395 -0
  56. hap_cli-0.9.19/sources/v3-api-schema/update_share_card_setting.yaml +52 -0
  57. hap_cli-0.9.19/sources/v3-api-schema/update_worksheet_index.yaml +73 -0
  58. hap_cli-0.9.19/sources/v3-api-schema/validate_process.yaml +24 -0
  59. hap_cli-0.9.18/sources/v3-api-schema/INDEX.json +0 -262
  60. {hap_cli-0.9.18 → hap_cli-0.9.19}/MANIFEST.in +0 -0
  61. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/__main__.py +0 -0
  62. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/_entry.py +0 -0
  63. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/__init__.py +0 -0
  64. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/app_cmd.py +0 -0
  65. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/app_creator_cmd.py +0 -0
  66. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/app_editor_cmd.py +0 -0
  67. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/attachment_cmd.py +0 -0
  68. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/auth_cmd.py +0 -0
  69. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/calendar_cmd.py +0 -0
  70. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/chart_cmd.py +0 -0
  71. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/chat_cmd.py +0 -0
  72. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/chatbot_cmd.py +0 -0
  73. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/config_cmd.py +0 -0
  74. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/contact_cmd.py +0 -0
  75. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/department_cmd.py +0 -0
  76. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/group_cmd.py +0 -0
  77. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/guide_cmd.py +0 -0
  78. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/icon_cmd.py +0 -0
  79. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/instance_cmd.py +0 -0
  80. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/node_cmd.py +0 -0
  81. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/optionset_cmd.py +0 -0
  82. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/page_cmd.py +0 -0
  83. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/post_cmd.py +0 -0
  84. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/record_cmd.py +0 -0
  85. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/region_cmd.py +0 -0
  86. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/role_cmd.py +0 -0
  87. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/update_cmd.py +0 -0
  88. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/upload_cmd.py +0 -0
  89. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/workflow_cmd.py +0 -0
  90. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/commands/worksheet_cmd.py +0 -0
  91. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/context.py +0 -0
  92. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/__init__.py +0 -0
  93. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/action_spec_adapter.py +0 -0
  94. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app.py +0 -0
  95. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/__init__.py +0 -0
  96. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
  97. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
  98. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
  99. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/charts.py +0 -0
  100. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/cleanup.py +0 -0
  101. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/compiler.py +0 -0
  102. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/config.py +0 -0
  103. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/design/design.schema.json +0 -0
  104. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/errors.py +0 -0
  105. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
  106. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/executor.py +0 -0
  107. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/fields.py +0 -0
  108. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/hap.py +0 -0
  109. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/merge.py +0 -0
  110. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/__init__.py +0 -0
  111. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/console.py +0 -0
  112. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
  113. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/mirror.py +0 -0
  114. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/recording/report.py +0 -0
  115. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/schema.py +0 -0
  116. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
  117. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/__init__.py +0 -0
  118. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/cli.py +0 -0
  119. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/executor.py +0 -0
  120. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
  121. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
  122. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
  123. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
  124. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/seed/template.py +0 -0
  125. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/selftest.py +0 -0
  126. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/smoke.py +0 -0
  127. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/steps.py +0 -0
  128. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/store.py +0 -0
  129. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/validate.py +0 -0
  130. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
  131. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/attachment.py +0 -0
  132. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/auth.py +0 -0
  133. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/calendar_mod.py +0 -0
  134. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/chart.py +0 -0
  135. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/chat.py +0 -0
  136. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/chatbot.py +0 -0
  137. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/cli_access.py +0 -0
  138. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/condition_dsl.py +0 -0
  139. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/contact.py +0 -0
  140. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/control_type_codes.py +0 -0
  141. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/department.py +0 -0
  142. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/__init__.py +0 -0
  143. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
  144. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
  145. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/apply.py +0 -0
  146. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/componentlower.py +0 -0
  147. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/component.schema.json +0 -0
  148. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/custom-action.schema.json +0 -0
  149. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/envelope.schema.json +0 -0
  150. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/editspec/field.schema.json +0 -0
  151. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/editspec.py +0 -0
  152. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/errors.py +0 -0
  153. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/fieldlower.py +0 -0
  154. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/jsonschema_mini.py +0 -0
  155. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/models.py +0 -0
  156. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/ops.py +0 -0
  157. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/planner.py +0 -0
  158. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/editor/reader.py +0 -0
  159. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/field_normalizer.py +0 -0
  160. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/field_spec_adapter.py +0 -0
  161. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/filter_translator.py +0 -0
  162. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/flow_node.py +0 -0
  163. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/global_meta.py +0 -0
  164. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/group.py +0 -0
  165. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/guide.py +0 -0
  166. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/icon_index.py +0 -0
  167. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/instance.py +0 -0
  168. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/layout_check.py +0 -0
  169. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/logger.py +0 -0
  170. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/money_currency.py +0 -0
  171. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/optionset.py +0 -0
  172. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/page.py +0 -0
  173. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/post.py +0 -0
  174. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record.py +0 -0
  175. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record_defaults.py +0 -0
  176. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record_discussions.py +0 -0
  177. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record_form_checks.py +0 -0
  178. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record_lookups.py +0 -0
  179. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/record_rules.py +0 -0
  180. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/relation_scope.py +0 -0
  181. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/relogin.py +0 -0
  182. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/response_crypto.py +0 -0
  183. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/role.py +0 -0
  184. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/role_perm_builder.py +0 -0
  185. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/rule_spec_adapter.py +0 -0
  186. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/token_crypto.py +0 -0
  187. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/update.py +0 -0
  188. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/upload.py +0 -0
  189. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/v3/__init__.py +0 -0
  190. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/v3/render.py +0 -0
  191. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/view_spec_adapter.py +0 -0
  192. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/workflow.py +0 -0
  193. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/workflow_node_dsl.py +0 -0
  194. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/worksheet.py +0 -0
  195. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/worksheet_form.py +0 -0
  196. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/worksheet_reference.py +0 -0
  197. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/core/worksheet_templates.py +0 -0
  198. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/approval.md +0 -0
  199. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/chart.md +0 -0
  200. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/messages.md +0 -0
  201. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/overview.md +0 -0
  202. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/post.md +0 -0
  203. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/record.md +0 -0
  204. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/setup.md +0 -0
  205. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/skills.md +0 -0
  206. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/workflow.md +0 -0
  207. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/en/worksheet.md +0 -0
  208. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/index.json +0 -0
  209. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/approval.md +0 -0
  210. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/chart.md +0 -0
  211. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/messages.md +0 -0
  212. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/overview.md +0 -0
  213. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/post.md +0 -0
  214. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/record.md +0 -0
  215. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/setup.md +0 -0
  216. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/skills.md +0 -0
  217. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/workflow.md +0 -0
  218. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/guide/zh-Hans/worksheet.md +0 -0
  219. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/i18n.py +0 -0
  220. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/locale/__init__.py +0 -0
  221. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/locale/messages.schema.json +0 -0
  222. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/__init__.py +0 -0
  223. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/atomic_write.py +0 -0
  224. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/confirm.py +0 -0
  225. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/formatting.py +0 -0
  226. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/options.py +0 -0
  227. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli/utils/parameter_mapping.py +0 -0
  228. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/dependency_links.txt +0 -0
  229. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/entry_points.txt +0 -0
  230. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/requires.txt +0 -0
  231. {hap_cli-0.9.18 → hap_cli-0.9.19}/hap_cli.egg-info/top_level.txt +0 -0
  232. {hap_cli-0.9.18 → hap_cli-0.9.19}/setup.cfg +0 -0
  233. {hap_cli-0.9.18 → hap_cli-0.9.19}/setup.py +0 -0
  234. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
  235. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
  236. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/create_optionset.yaml +0 -0
  237. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/delete_optionset.yaml +0 -0
  238. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/delete_record.yaml +0 -0
  239. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/delete_role.yaml +0 -0
  240. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
  241. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_info.yaml +0 -0
  242. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
  243. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
  244. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
  245. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_details.yaml +0 -0
  246. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
  247. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_list.yaml +0 -0
  248. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_logs.yaml +0 -0
  249. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
  250. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_relations.yaml +0 -0
  251. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
  252. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_regions.yaml +0 -0
  253. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/get_role_details.yaml +0 -0
  254. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/knowledge_search.yaml +0 -0
  255. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
  256. {hap_cli-0.9.18 → hap_cli-0.9.19}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
  257. {hap_cli-0.9.18 → 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.18
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、申请 |
@@ -3,7 +3,7 @@
3
3
  import sys as _sys
4
4
  import types as _types
5
5
 
6
- __version__ = "0.9.18"
6
+ __version__ = "0.9.19"
7
7
 
8
8
  # The command tree used to live in hap_cli/hap_cli.py. A module named
9
9
  # after the package it sits in shadows that package: run python with the
@@ -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")
@@ -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
- url = f"{self._v3_api_base()}{rendered_path}"
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:
@@ -43,6 +43,7 @@ from hap_cli.core.filter_v3 import (
43
43
  from hap_cli.core.v3.schema import load_tool
44
44
  from hap_cli.i18n import t, t_v3
45
45
  from hap_cli.utils.confirm import confirm_or_abort
46
+ from hap_cli.utils.options import json_arg
46
47
 
47
48
  logger = logging.getLogger("hap_cli.v3")
48
49
 
@@ -215,7 +216,10 @@ def _build_param_decorators(
215
216
  if is_path:
216
217
  # Positional argument. Click handles type coercion via
217
218
  # nargs/type — keep it as string (path params are IDs).
218
- decorators.append(click.argument(name))
219
+ choices = prop.get("enum")
220
+ decorators.append(click.argument(
221
+ name, type=click.Choice([str(c) for c in choices])
222
+ if choices else None))
219
223
  path_arg_names.append(name)
220
224
  continue
221
225
 
@@ -493,8 +497,11 @@ def explain_v3_failure(response: Any, *, app_id: str = "",
493
497
  """
494
498
  if not isinstance(response, dict) or response.get("success") is not False:
495
499
  return None
496
- code = response.get("errorCode")
497
- message = str(response.get("errorMsg") or "").strip()
500
+ # Both spellings are live: the record endpoints answer errorCode /
501
+ # errorMsg, the application and worksheet ones error_code / error_msg.
502
+ code = response.get("errorCode", response.get("error_code"))
503
+ message = str(response.get("errorMsg")
504
+ or response.get("error_msg") or "").strip()
498
505
  used = app_id or "the default application"
499
506
 
500
507
  if _SIGN_FAILURE_MARKER in message.lower():
@@ -588,13 +595,17 @@ def _assemble_payload(
588
595
  continue
589
596
  prop = prop_index.get(name) or {}
590
597
  if _is_json_option(prop):
591
- try:
592
- value = json.loads(value)
593
- except json.JSONDecodeError as exc:
594
- raise click.BadParameter(
595
- f"--{kebab(name)}-json must be valid JSON ({exc.msg})",
596
- param_hint=f"--{kebab(name)}-json",
597
- )
598
+ if isinstance(value, str) and value.startswith("@"):
599
+ # `@FILE`: a configuration too long for a command line.
600
+ value = json_arg(value, what=f"{kebab(name)}-json")
601
+ else:
602
+ try:
603
+ value = json.loads(value)
604
+ except json.JSONDecodeError as exc:
605
+ raise click.BadParameter(
606
+ f"--{kebab(name)}-json must be valid JSON ({exc.msg})",
607
+ param_hint=f"--{kebab(name)}-json",
608
+ )
598
609
  # A filter tree's operator has no enum in the V3 schema, and
599
610
  # an operator the server does not know is dropped silently
600
611
  # along with its condition — the query then answers with the
@@ -622,6 +633,10 @@ def _assemble_payload(
622
633
  value = list(value)
623
634
  if name == "fields" and tool_name in _FIELD_SELECT_TOOLS:
624
635
  value = _resolve_selected_fields(value, controls_loader)
636
+ elif (prop.get("type") == "integer" and prop.get("enum")
637
+ and isinstance(value, str)):
638
+ # An integer enum is offered as a click.Choice of strings.
639
+ value = int(value)
625
640
  if is_get:
626
641
  query[name] = value
627
642
  else:
@@ -629,6 +644,25 @@ def _assemble_payload(
629
644
  return path_params, query, body
630
645
 
631
646
 
647
+ def _unwrap_service_response(response: Any) -> Any:
648
+ """Flatten the workflow service's second envelope.
649
+
650
+ It answers ``{"success": true, "data": {"success", "data", "error"}}``
651
+ and reports a refusal only in the inner one — the outer ``success``
652
+ stays true. Read from the outside, a refused call is a success.
653
+ """
654
+ inner = response.get("data") if isinstance(response, dict) else None
655
+ if not isinstance(inner, dict) or not isinstance(
656
+ inner.get("success"), bool):
657
+ return response
658
+ if inner["success"]:
659
+ return {**response, "data": inner.get("data")}
660
+ error = inner.get("error")
661
+ error = error if isinstance(error, dict) else {"message": error}
662
+ return {"success": False, "errorCode": error.get("code"),
663
+ "errorMsg": error.get("message")}
664
+
665
+
632
666
  def _check_role_is_in_app(ctx: Context, app_id: str,
633
667
  role_id: Optional[str]) -> None:
634
668
  """Refuse a role command whose application was only a guess.
@@ -692,6 +726,11 @@ def register_v3(
692
726
  renderer: Optional[Callable[[Any], None]] = None,
693
727
  subtable_guard: bool = False,
694
728
  role_app_guard: bool = False,
729
+ constants: Optional[dict[str, Any]] = None,
730
+ omit: Sequence[str] = (),
731
+ prepare: Optional[Callable[[Context, dict, dict, Any], None]] = None,
732
+ prepare_options: Sequence[str] = (),
733
+ timeout: Optional[int] = None,
695
734
  ) -> Callable:
696
735
  """Register a Click command on ``group`` for the given v3 ``tool``.
697
736
 
@@ -734,11 +773,40 @@ def register_v3(
734
773
  default: the check costs a request, so only the commands
735
774
  people actually point at such a sheet pay for it.
736
775
 
776
+ constants: Body values this command always sends. Their
777
+ properties get no option — how one endpoint becomes an
778
+ ``enable`` and a ``disable`` command.
779
+ omit: Schema properties that get no option because ``prepare``
780
+ fills them in.
781
+ prepare: Called as ``(ctx, body, options, controls_loader)`` just
782
+ before the request, to complete or convert the body in place.
783
+ ``options`` holds the values of ``prepare_options``.
784
+ prepare_options: Options from ``extra_decorators`` that belong to
785
+ ``prepare``; they never reach the wire by themselves.
786
+ timeout: Seconds to wait, for an endpoint that answers only once
787
+ a long operation is done.
788
+
737
789
  Returns:
738
790
  The decorated callable so the caller can keep a reference if
739
791
  needed (typically discarded).
740
792
  """
741
793
  schema = load_tool(tool)
794
+ hidden = set(omit) | set(constants or {})
795
+ if hidden:
796
+ parameters = schema["parameters"]
797
+ schema = {**schema, "parameters": {
798
+ **parameters,
799
+ "properties": {k: v for k, v in parameters["properties"].items()
800
+ if k not in hidden},
801
+ "required": [r for r in parameters["required"]
802
+ if r not in hidden],
803
+ }}
804
+ base = schema.get("base", "v3")
805
+ call_kwargs: dict[str, Any] = {}
806
+ if base != "v3":
807
+ call_kwargs["base"] = base
808
+ if timeout:
809
+ call_kwargs["timeout"] = timeout
742
810
  (
743
811
  decorators,
744
812
  path_arg_names,
@@ -781,6 +849,9 @@ def register_v3(
781
849
  name: kwargs.pop(name, None)
782
850
  for name in post_process_options
783
851
  }
852
+ prepare_opts = {
853
+ name: kwargs.pop(name, None) for name in prepare_options
854
+ }
784
855
  # An explicit `--response-format json` selects JSON output as
785
856
  # well as the JSON wire format; `--json` (already on the
786
857
  # context) keeps precedence, so `md --json` still prints one
@@ -850,6 +921,9 @@ def register_v3(
850
921
  schema, path_arg_names, option_names, prop_index, kwargs,
851
922
  tool_name=tool, controls_loader=_controls,
852
923
  )
924
+ body.update(constants or {})
925
+ if prepare is not None:
926
+ prepare(ctx, body, prepare_opts, _controls)
853
927
  # Route org-id either to an HTTP header (when the
854
928
  # endpoint expects it that way) or to the body/query
855
929
  # under whichever schema name applies.
@@ -881,7 +955,10 @@ def register_v3(
881
955
  query=query if query else None,
882
956
  path_params=path_params,
883
957
  extra_headers={"org_id": org_header_value} if org_header_value else None,
958
+ **call_kwargs,
884
959
  )
960
+ if base == "workflow":
961
+ response = _unwrap_service_response(response)
885
962
  # A V3 answer can report failure in the body with HTTP
886
963
  # 200. Printing it as data and exiting 0 is how a
887
964
  # scripted caller came to treat "appKey sign错误" as a
@@ -207,6 +207,8 @@ def _translate(tool_name: str, spec: dict[str, Any]) -> dict[str, Any]:
207
207
  "description": description,
208
208
  "path": path,
209
209
  "method": method_lower.upper(),
210
+ # Which service answers: "v3", "workflow" or "report".
211
+ "base": spec.get("x-hap-base") or "v3",
210
212
  "parameters": {
211
213
  "type": "object",
212
214
  "properties": properties,