hap-cli 0.8.14__tar.gz → 0.8.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.
Files changed (254) hide show
  1. {hap_cli-0.8.14 → hap_cli-0.8.16}/PKG-INFO +1 -1
  2. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/__init__.py +1 -1
  3. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/instance_cmd.py +58 -24
  4. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/node_cmd.py +11 -3
  5. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/role_cmd.py +2 -1
  6. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/worksheet_cmd.py +14 -3
  7. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/flow_node.py +73 -7
  8. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/instance.py +36 -15
  9. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/role_perm_builder.py +22 -1
  10. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/worksheet.py +23 -2
  11. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/locale/messages.json +26 -17
  12. hap_cli-0.8.16/hap_cli/tests/test_bug_036750.py +130 -0
  13. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_core.py +103 -3
  14. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_destructive_confirm_cli.py +1 -1
  15. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/PKG-INFO +1 -1
  16. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/SOURCES.txt +1 -0
  17. {hap_cli-0.8.14 → hap_cli-0.8.16}/MANIFEST.in +0 -0
  18. {hap_cli-0.8.14 → hap_cli-0.8.16}/README.md +0 -0
  19. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/__init__.py +0 -0
  20. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/__main__.py +0 -0
  21. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/config.py +0 -0
  22. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/harness.py +0 -0
  23. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/smoke.py +0 -0
  24. {hap_cli-0.8.14 → hap_cli-0.8.16}/app_live_tests/state.py +0 -0
  25. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/README.md +0 -0
  26. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/README_CN.md +0 -0
  27. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/__main__.py +0 -0
  28. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/__init__.py +0 -0
  29. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/app_cmd.py +0 -0
  30. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/app_creator_cmd.py +0 -0
  31. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/app_editor_cmd.py +0 -0
  32. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/auth_cmd.py +0 -0
  33. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/calendar_cmd.py +0 -0
  34. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/chart_cmd.py +0 -0
  35. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/chat_cmd.py +0 -0
  36. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/chatbot_cmd.py +0 -0
  37. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/config_cmd.py +0 -0
  38. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/contact_cmd.py +0 -0
  39. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/department_cmd.py +0 -0
  40. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/group_cmd.py +0 -0
  41. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/icon_cmd.py +0 -0
  42. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/optionset_cmd.py +0 -0
  43. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/page_cmd.py +0 -0
  44. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/post_cmd.py +0 -0
  45. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/record_cmd.py +0 -0
  46. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/region_cmd.py +0 -0
  47. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/update_cmd.py +0 -0
  48. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/upload_cmd.py +0 -0
  49. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/v3_registry.py +0 -0
  50. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/commands/workflow_cmd.py +0 -0
  51. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/context.py +0 -0
  52. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/__init__.py +0 -0
  53. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/action_spec_adapter.py +0 -0
  54. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app.py +0 -0
  55. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/__init__.py +0 -0
  56. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
  57. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
  58. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
  59. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/charts.py +0 -0
  60. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/cleanup.py +0 -0
  61. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/compiler.py +0 -0
  62. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/config.py +0 -0
  63. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/design/design.schema.json +0 -0
  64. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/errors.py +0 -0
  65. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
  66. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/executor.py +0 -0
  67. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/fields.py +0 -0
  68. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/hap.py +0 -0
  69. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/merge.py +0 -0
  70. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/recording/__init__.py +0 -0
  71. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/recording/console.py +0 -0
  72. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
  73. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/recording/mirror.py +0 -0
  74. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/recording/report.py +0 -0
  75. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/schema.py +0 -0
  76. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
  77. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/__init__.py +0 -0
  78. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/cli.py +0 -0
  79. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/executor.py +0 -0
  80. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
  81. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
  82. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
  83. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
  84. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/seed/template.py +0 -0
  85. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/selftest.py +0 -0
  86. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/smoke.py +0 -0
  87. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/steps.py +0 -0
  88. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/store.py +0 -0
  89. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/validate.py +0 -0
  90. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
  91. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/auth.py +0 -0
  92. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/calendar_mod.py +0 -0
  93. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/chart.py +0 -0
  94. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/chat.py +0 -0
  95. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/chatbot.py +0 -0
  96. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/cli_access.py +0 -0
  97. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/contact.py +0 -0
  98. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/control_type_codes.py +0 -0
  99. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/department.py +0 -0
  100. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/__init__.py +0 -0
  101. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
  102. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
  103. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/apply.py +0 -0
  104. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/componentlower.py +0 -0
  105. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/editspec.py +0 -0
  106. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/errors.py +0 -0
  107. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/fieldlower.py +0 -0
  108. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/jsonschema_mini.py +0 -0
  109. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/models.py +0 -0
  110. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/ops.py +0 -0
  111. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/planner.py +0 -0
  112. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/editor/reader.py +0 -0
  113. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/field_normalizer.py +0 -0
  114. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/field_spec_adapter.py +0 -0
  115. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/filter_translator.py +0 -0
  116. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/global_meta.py +0 -0
  117. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/group.py +0 -0
  118. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/icon_index.py +0 -0
  119. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/logger.py +0 -0
  120. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/optionset.py +0 -0
  121. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/page.py +0 -0
  122. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/post.py +0 -0
  123. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/record.py +0 -0
  124. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/response_crypto.py +0 -0
  125. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/role.py +0 -0
  126. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/session.py +0 -0
  127. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/token_crypto.py +0 -0
  128. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/update.py +0 -0
  129. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/upload.py +0 -0
  130. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/v3/__init__.py +0 -0
  131. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/v3/dispatcher.py +0 -0
  132. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/v3/render.py +0 -0
  133. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/v3/schema.py +0 -0
  134. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/view_spec_adapter.py +0 -0
  135. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/workflow.py +0 -0
  136. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/workflow_node_dsl.py +0 -0
  137. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/core/worksheet_templates.py +0 -0
  138. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/hap_cli.py +0 -0
  139. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/i18n.py +0 -0
  140. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/locale/__init__.py +0 -0
  141. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/locale/messages.schema.json +0 -0
  142. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/__init__.py +0 -0
  143. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/conftest.py +0 -0
  144. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_app_creator.py +0 -0
  145. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_app_editor.py +0 -0
  146. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_app_export_usage.py +0 -0
  147. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_auth_prerelease.py +0 -0
  148. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_bug_036430.py +0 -0
  149. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_chart.py +0 -0
  150. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_cli_access.py +0 -0
  151. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_config_cmd.py +0 -0
  152. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_full_e2e.py +0 -0
  153. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_global_meta.py +0 -0
  154. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_i18n.py +0 -0
  155. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_instance_history_cli.py +0 -0
  156. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration.py +0 -0
  157. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_approval.py +0 -0
  158. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_approval_actions.py +0 -0
  159. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_calendar.py +0 -0
  160. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_destructive.py +0 -0
  161. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_misc.py +0 -0
  162. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_post.py +0 -0
  163. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_social.py +0 -0
  164. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_v3.py +0 -0
  165. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_workflow.py +0 -0
  166. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_integration_worksheet_extra.py +0 -0
  167. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_multi_profile.py +0 -0
  168. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_org_approval_v3_semantic_cli.py +0 -0
  169. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_org_id_cli.py +0 -0
  170. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_org_id_docs.py +0 -0
  171. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_parameter_conventions.py +0 -0
  172. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_parameter_mapping_registry.py +0 -0
  173. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_record_batch_v3_semantic_cli.py +0 -0
  174. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_record_field_alias.py +0 -0
  175. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_record_v3_semantic_cli.py +0 -0
  176. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_semantic_types_registry.py +0 -0
  177. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_update.py +0 -0
  178. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_v3_api_schema_loader.py +0 -0
  179. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_v3_dispatcher.py +0 -0
  180. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_v3_registry_coverage.py +0 -0
  181. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_v3_session.py +0 -0
  182. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_v3_yaml_translation.py +0 -0
  183. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_workflow_list_cli.py +0 -0
  184. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_workflow_v3_semantic_cli.py +0 -0
  185. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_worksheet_crud_cli.py +0 -0
  186. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/tests/test_worksheet_v3_semantic_cli.py +0 -0
  187. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/utils/__init__.py +0 -0
  188. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/utils/formatting.py +0 -0
  189. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/utils/options.py +0 -0
  190. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli/utils/parameter_mapping.py +0 -0
  191. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/dependency_links.txt +0 -0
  192. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/entry_points.txt +0 -0
  193. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/requires.txt +0 -0
  194. {hap_cli-0.8.14 → hap_cli-0.8.16}/hap_cli.egg-info/top_level.txt +0 -0
  195. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/__init__.py +0 -0
  196. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/__main__.py +0 -0
  197. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/_wftest.py +0 -0
  198. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/charts.py +0 -0
  199. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/cleanup.py +0 -0
  200. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/compiler.py +0 -0
  201. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/config.py +0 -0
  202. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/errors.py +0 -0
  203. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/executor.py +0 -0
  204. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/fields.py +0 -0
  205. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/hap.py +0 -0
  206. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/recording/__init__.py +0 -0
  207. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/recording/console.py +0 -0
  208. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/recording/jsonl.py +0 -0
  209. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/recording/mirror.py +0 -0
  210. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/recording/report.py +0 -0
  211. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/schema.py +0 -0
  212. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/seed/__init__.py +0 -0
  213. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/seed/cli.py +0 -0
  214. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/seed/executor.py +0 -0
  215. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/seed/template.py +0 -0
  216. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/selftest.py +0 -0
  217. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/smoke.py +0 -0
  218. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/step.py +0 -0
  219. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/steps.py +0 -0
  220. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/store.py +0 -0
  221. {hap_cli-0.8.14 → hap_cli-0.8.16}/live_tests/workflow_dsl.py +0 -0
  222. {hap_cli-0.8.14 → hap_cli-0.8.16}/setup.cfg +0 -0
  223. {hap_cli-0.8.14 → hap_cli-0.8.16}/setup.py +0 -0
  224. {hap_cli-0.8.14 → hap_cli-0.8.16}/skills/cli/hap-cli-app-editor/scripts/editspec/component.schema.json +0 -0
  225. {hap_cli-0.8.14 → hap_cli-0.8.16}/skills/cli/hap-cli-app-editor/scripts/editspec/custom-action.schema.json +0 -0
  226. {hap_cli-0.8.14 → hap_cli-0.8.16}/skills/cli/hap-cli-app-editor/scripts/editspec/envelope.schema.json +0 -0
  227. {hap_cli-0.8.14 → hap_cli-0.8.16}/skills/cli/hap-cli-app-editor/scripts/editspec/field.schema.json +0 -0
  228. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/INDEX.json +0 -0
  229. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
  230. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
  231. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/create_optionset.yaml +0 -0
  232. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/create_role.yaml +0 -0
  233. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/delete_optionset.yaml +0 -0
  234. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/delete_record.yaml +0 -0
  235. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/delete_role.yaml +0 -0
  236. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
  237. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_app_info.yaml +0 -0
  238. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
  239. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
  240. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
  241. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_details.yaml +0 -0
  242. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
  243. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_list.yaml +0 -0
  244. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_logs.yaml +0 -0
  245. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
  246. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_relations.yaml +0 -0
  247. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
  248. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_regions.yaml +0 -0
  249. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_role_details.yaml +0 -0
  250. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/get_role_list.yaml +0 -0
  251. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/knowledge_search.yaml +0 -0
  252. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
  253. {hap_cli-0.8.14 → hap_cli-0.8.16}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
  254. {hap_cli-0.8.14 → hap_cli-0.8.16}/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.8.14
3
+ Version: 0.8.16
4
4
  Summary: CLI harness for Mingdao HAP - Enterprise no-code platform
5
5
  Author: hap-cli
6
6
  License: Apache-2.0
@@ -1,3 +1,3 @@
1
1
  """CLI harness for Mingdao HAP (hap-cli)."""
2
2
 
3
- __version__ = "0.8.14"
3
+ __version__ = "0.8.16"
@@ -243,7 +243,11 @@ def instance_retry(ctx, instance_id):
243
243
  @click.option("--work-id", "-w", default="", help="Work item ID")
244
244
  @pass_context
245
245
  def instance_restart(ctx, instance_id, work_id):
246
- """Re-initiate a completed/rejected instance."""
246
+ """Re-initiate a flow the initiator has revoked.
247
+
248
+ Use this after the initiator revoked (withdrew) a still-running flow to
249
+ start it again. It does not apply to flows that already finished.
250
+ """
247
251
  try:
248
252
  session = ctx.get_session()
249
253
  data = inst_mod.restart_instance(session, instance_id, work_id)
@@ -354,15 +358,24 @@ def instance_batch(ctx, action, type_, process_id, select, instances_json,
354
358
 
355
359
 
356
360
  def _batch_lifecycle_options(fn):
357
- """Shared options for end-batch / retry-batch — both take
358
- ``RequestStartProcess`` shape (see instanceVersion.js:144)."""
361
+ """Shared options for end-batch / retry-batch.
362
+
363
+ The primary path takes one or more INSTANCE_IDS (the ids shown in the flow
364
+ history list) as positional arguments — these become ``sources`` and are
365
+ the only thing the server needs. The ``--app-id`` + ``--all`` + filter
366
+ options drive the alternative "select all in a worksheet view" mode.
367
+ """
359
368
  decorators = [
360
- click.argument("app_id"),
361
- click.option("--trigger-id", default="", help="Trigger/button ID"),
362
- click.option("--view-id", default="", help="Source view ID"),
363
- click.option("--source", "-s", multiple=True, help="Explicit row ID to act on (repeat)"),
364
- click.option("--all", "is_all", is_flag=True, default=False, help="Select all matching rows"),
365
- click.option("--keywords", default="", help="Search keyword over rows"),
369
+ click.argument("instance_ids", nargs=-1),
370
+ click.option("--source", "-s", multiple=True,
371
+ help="Instance ID to act on (repeat; merged with positional IDs)"),
372
+ click.option("--app-id", "app_id", default="",
373
+ help="Worksheet ID only needed with --all to select every matching row"),
374
+ click.option("--all", "is_all", is_flag=True, default=False,
375
+ help="Select all matching rows (requires --app-id)"),
376
+ click.option("--view-id", default="", help="Source view ID (for --all)"),
377
+ click.option("--trigger-id", default="", help="Trigger/button ID (for --all)"),
378
+ click.option("--keywords", default="", help="Search keyword over rows (for --all)"),
366
379
  click.option("--filter-controls", default="", help="JSON array of filter conditions"),
367
380
  click.option("--fast-filters", default="", help="JSON array of fast filters"),
368
381
  click.option("--nav-group-filters", default="", help="JSON array of nav-group filters"),
@@ -376,12 +389,21 @@ def _batch_lifecycle_options(fn):
376
389
 
377
390
 
378
391
  def _resolve_batch_lifecycle_kwargs(
379
- source, is_all, keywords,
392
+ instance_ids, source, app_id, is_all, keywords,
380
393
  filter_controls, fast_filters, nav_group_filters, filters_group,
381
394
  data_log, push_unique_id,
382
395
  ):
396
+ sources = list(instance_ids) + list(source)
397
+ if not sources and not is_all:
398
+ raise click.UsageError(
399
+ "Provide at least one INSTANCE_ID (or --source), "
400
+ "or use --all with --app-id to select a whole view."
401
+ )
402
+ if is_all and not app_id:
403
+ raise click.UsageError("--all requires --app-id (the worksheet ID).")
383
404
  return {
384
- "sources": list(source) if source else None,
405
+ "app_id": app_id,
406
+ "sources": sources or None,
385
407
  "is_all": is_all,
386
408
  "key_words": keywords,
387
409
  "filter_controls": _json.loads(filter_controls) if filter_controls else None,
@@ -398,21 +420,27 @@ def _resolve_batch_lifecycle_kwargs(
398
420
  @click.option("--yes", "-y", is_flag=True, help="Skip confirmation")
399
421
  @pass_context
400
422
  def instance_end_batch(
401
- ctx, app_id, trigger_id, view_id, source, is_all, keywords,
423
+ ctx, instance_ids, source, app_id, is_all, view_id, trigger_id, keywords,
402
424
  filter_controls, fast_filters, nav_group_filters, filters_group,
403
425
  data_log, push_unique_id, yes,
404
426
  ):
405
- """Terminate instances in bulk (``v1/instance/endInstanceList``)."""
427
+ """Terminate one or more running flows in bulk.
428
+
429
+ Pass the instance IDs from the flow history list as arguments:
430
+
431
+ hap approval end-batch <INSTANCE_ID> [<INSTANCE_ID> ...]
432
+ """
406
433
  try:
434
+ kwargs = _resolve_batch_lifecycle_kwargs(
435
+ instance_ids, source, app_id, is_all, keywords,
436
+ filter_controls, fast_filters, nav_group_filters, filters_group,
437
+ data_log, push_unique_id,
438
+ )
407
439
  if not yes:
408
440
  click.confirm("Terminate the matching instances?", abort=True)
409
441
  session = ctx.get_session()
410
- kwargs = _resolve_batch_lifecycle_kwargs(
411
- source, is_all, keywords, filter_controls, fast_filters,
412
- nav_group_filters, filters_group, data_log, push_unique_id,
413
- )
414
442
  data = inst_mod.end_instance_batch(
415
- session, app_id, trigger_id=trigger_id, view_id=view_id, **kwargs,
443
+ session, view_id=view_id, trigger_id=trigger_id, **kwargs,
416
444
  )
417
445
  ctx.output(data, lambda d: click.echo(f"Batch terminate dispatched: {d}"))
418
446
  except Exception as e:
@@ -423,19 +451,25 @@ def instance_end_batch(
423
451
  @_batch_lifecycle_options
424
452
  @pass_context
425
453
  def instance_retry_batch(
426
- ctx, app_id, trigger_id, view_id, source, is_all, keywords,
454
+ ctx, instance_ids, source, app_id, is_all, view_id, trigger_id, keywords,
427
455
  filter_controls, fast_filters, nav_group_filters, filters_group,
428
456
  data_log, push_unique_id,
429
457
  ):
430
- """Retry failed instances in bulk (``v1/instance/resetInstanceList``)."""
458
+ """Retry one or more failed flows in bulk.
459
+
460
+ Pass the instance IDs from the flow history list as arguments:
461
+
462
+ hap approval retry-batch <INSTANCE_ID> [<INSTANCE_ID> ...]
463
+ """
431
464
  try:
432
- session = ctx.get_session()
433
465
  kwargs = _resolve_batch_lifecycle_kwargs(
434
- source, is_all, keywords, filter_controls, fast_filters,
435
- nav_group_filters, filters_group, data_log, push_unique_id,
466
+ instance_ids, source, app_id, is_all, keywords,
467
+ filter_controls, fast_filters, nav_group_filters, filters_group,
468
+ data_log, push_unique_id,
436
469
  )
470
+ session = ctx.get_session()
437
471
  data = inst_mod.reset_instance_batch(
438
- session, app_id, trigger_id=trigger_id, view_id=view_id, **kwargs,
472
+ session, view_id=view_id, trigger_id=trigger_id, **kwargs,
439
473
  )
440
474
  ctx.output(data, lambda d: click.echo(f"Batch retry dispatched: {d}"))
441
475
  except Exception as e:
@@ -313,13 +313,21 @@ def node_test_code(ctx, process_id, node_id, code, input_json):
313
313
  @click.argument("process_id")
314
314
  @click.argument("node_id")
315
315
  @click.option("--url", "-u", required=True, help="Target URL")
316
- @click.option("--method", "-m", default="POST", help="HTTP method")
316
+ @click.option("--method", "-m", default="POST",
317
+ help="HTTP method: GET, POST, PUT, DELETE, HEAD, or PATCH.")
317
318
  @click.option("--body", "-b", default="", help="Request body (JSON string)")
318
319
  @click.option("--headers", "-H", default="", help="Headers JSON: [{name,value}]")
319
- @click.option("--content-type", default="application/json", help="Content-Type")
320
+ @click.option("--content-type", default="json",
321
+ help="Body format: json, text, form-data, "
322
+ "x-www-form-urlencoded, or file.")
320
323
  @pass_context
321
324
  def node_test_webhook(ctx, process_id, node_id, url, method, body, headers, content_type):
322
- """Test a WebHook node."""
325
+ """Run the "Test API" action of a Send Custom Request node.
326
+
327
+ Issues the request the node is configured to make and prints the
328
+ response. Works for any outbound API call the node performs, not just
329
+ webhook callbacks.
330
+ """
323
331
  try:
324
332
  session = ctx.get_session()
325
333
  headers_list = json.loads(headers) if headers else None
@@ -69,7 +69,8 @@ def role_create(ctx, app_id, name, desc, permission):
69
69
  "views are fetched and the full permission structure is "
70
70
  "filled in (unspecified fields/views default to allowed).")
71
71
  @click.option("--page-permissions", "page_perms_json", default="",
72
- help="Page permission JSON: list of {pageId, enable}.")
72
+ help="Page permission JSON: list of {id, enable}, where 'id' is "
73
+ "the custom-page id ('pageId' is also accepted).")
73
74
  @click.option("--hide-app-for-members", is_flag=True, default=False,
74
75
  help="Hide the app from members of this role.")
75
76
  @pass_context
@@ -189,12 +189,23 @@ def worksheet_create(ctx, app_id, name, org_id, section_id, icon, icon_color,
189
189
  @click.option("--app-id", "-a", default="", help="Application ID")
190
190
  @org_id_option()
191
191
  @click.option("--copy-rows", is_flag=True, default=False, help="Copy rows as well")
192
+ @click.option("--section-id", default="",
193
+ help="Sidebar group the copy lands in. Auto-resolved from the "
194
+ "source worksheet's group when omitted (requires --app-id).")
192
195
  @pass_context
193
- def worksheet_copy(ctx, worksheet_id, name, app_id, org_id, copy_rows):
194
- """Copy a worksheet."""
196
+ def worksheet_copy(ctx, worksheet_id, name, app_id, org_id, copy_rows, section_id):
197
+ """Copy a worksheet into the same sidebar group as the original.
198
+
199
+ Pass --app-id so the target group can be resolved, or set --section-id
200
+ to place the copy in a specific group.
201
+ """
195
202
  try:
196
203
  session = ctx.get_session()
197
- data = ws_mod.copy_worksheet(session, worksheet_id, name, app_id, require_api_project_id(session, org_id), copy_rows)
204
+ data = ws_mod.copy_worksheet(
205
+ session, worksheet_id, name, app_id,
206
+ require_api_project_id(session, org_id), copy_rows,
207
+ section_id=section_id,
208
+ )
198
209
  ctx.output(data, lambda d: output_json(d))
199
210
  except Exception as e:
200
211
  ctx.handle_error(e)
@@ -455,6 +455,66 @@ def test_code(
455
455
  return session.workflow_call("flowNode/codeTest", data)
456
456
 
457
457
 
458
+ # flowNode/webHookTestRequest wants integer enums, not strings. Source of
459
+ # truth: pd-openweb src/pages/workflow/WorkflowSettings/enum.js (METHODS_TYPE)
460
+ # and src/pages/workflow/WorkflowSettings/Detail/WebHook/index.jsx
461
+ # (contentTypes + the raw JSON/Text sub-dropdown). Sending "POST" /
462
+ # "application/json" verbatim makes the server answer 400.
463
+ _WEBHOOK_METHODS = {
464
+ "GET": 1,
465
+ "POST": 2,
466
+ "PUT": 3,
467
+ "DELETE": 14,
468
+ "HEAD": 5,
469
+ "PATCH": 6,
470
+ }
471
+
472
+ _WEBHOOK_CONTENT_TYPES = {
473
+ "x-www-form-urlencoded": 1,
474
+ "urlencoded": 1,
475
+ "json": 2,
476
+ "application/json": 2,
477
+ "text": 3,
478
+ "form-data": 4,
479
+ "file": 5,
480
+ }
481
+
482
+
483
+ def _encode_webhook_method(method: Any) -> int:
484
+ """Map a friendly HTTP method name to its webHookTestRequest enum int.
485
+
486
+ Accepts an int (passed through) or a case-insensitive method name.
487
+ """
488
+ if isinstance(method, int):
489
+ return method
490
+ key = str(method).strip()
491
+ if key.isdigit():
492
+ return int(key)
493
+ code = _WEBHOOK_METHODS.get(key.upper())
494
+ if code is None:
495
+ raise ValueError(
496
+ f"Unknown HTTP method {method!r}; expected one of "
497
+ f"{', '.join(_WEBHOOK_METHODS)}."
498
+ )
499
+ return code
500
+
501
+
502
+ def _encode_webhook_content_type(content_type: Any) -> int:
503
+ """Map a friendly body format name to its webHookTestRequest enum int."""
504
+ if isinstance(content_type, int):
505
+ return content_type
506
+ key = str(content_type).strip()
507
+ if key.isdigit():
508
+ return int(key)
509
+ code = _WEBHOOK_CONTENT_TYPES.get(key.lower())
510
+ if code is None:
511
+ raise ValueError(
512
+ f"Unknown content type {content_type!r}; expected one of "
513
+ "json, text, form-data, x-www-form-urlencoded, file."
514
+ )
515
+ return code
516
+
517
+
458
518
  def test_webhook(
459
519
  session: Session,
460
520
  process_id: str,
@@ -463,22 +523,28 @@ def test_webhook(
463
523
  method: str = "POST",
464
524
  headers: Optional[list] = None,
465
525
  body: str = "",
466
- content_type: str = "application/json",
526
+ content_type: str = "json",
467
527
  params: Optional[list] = None,
468
528
  auth_id: str = "",
469
529
  settings: Optional[dict] = None,
470
530
  ) -> dict[str, Any]:
471
- """Test a WebHook request.
531
+ """Send the HTTP request configured on a "Send Custom Request" node.
532
+
533
+ This drives the node's "Test API" action (flowNode/webHookTestRequest):
534
+ it issues the configured outbound request and returns the response —
535
+ it works for any API call the node makes, not just webhook callbacks.
472
536
 
473
537
  Args:
474
538
  session: Active session
475
539
  process_id: Process ID
476
- node_id: WebHook node ID
540
+ node_id: Send-Custom-Request node ID
477
541
  url: Target URL
478
- method: HTTP method
542
+ method: HTTP method name (GET/POST/PUT/DELETE/HEAD/PATCH) or its
543
+ enum int. Mapped to the integer the endpoint requires.
479
544
  headers: Request headers [{name, value}]
480
545
  body: Request body (JSON string)
481
- content_type: Content-Type header
546
+ content_type: Body format — json, text, form-data,
547
+ x-www-form-urlencoded, or file — or its enum int.
482
548
  params: URL parameters [{name, value}]
483
549
  auth_id: Authentication config ID
484
550
  settings: Additional settings
@@ -490,8 +556,8 @@ def test_webhook(
490
556
  "processId": process_id,
491
557
  "nodeId": node_id,
492
558
  "url": url,
493
- "method": method,
494
- "contentType": content_type,
559
+ "method": _encode_webhook_method(method),
560
+ "contentType": _encode_webhook_content_type(content_type),
495
561
  }
496
562
  if headers:
497
563
  data["headers"] = headers
@@ -628,7 +628,12 @@ def restart_instance(
628
628
  instance_id: str,
629
629
  work_id: str = "",
630
630
  ) -> dict[str, Any]:
631
- """Re-initiate a rejected/completed instance.
631
+ """Re-initiate an instance that the initiator has revoked.
632
+
633
+ This is the "撤回后重新发起" action (instance/restart, paired with
634
+ instance/revoke; operation types 13/19 in ExecDialog/StepItem). It applies
635
+ to an instance the initiator previously revoked while it was still running
636
+ — NOT to an already-completed or rejected instance.
632
637
 
633
638
  Args:
634
639
  session: Active session
@@ -647,13 +652,22 @@ def restart_instance(
647
652
  # ── Batch lifecycle ─────────────────────────────────────────────────────
648
653
  #
649
654
  # ``endInstanceList`` and ``resetInstanceList`` take a ``RequestStartProcess``
650
- # payload that describes a selection over a worksheet view (same shape used
651
- # by worksheet trigger batch ops). Callers either enumerate explicit
652
- # ``sources`` row ids OR flip ``is_all`` on and describe the filter.
655
+ # payload (instanceVersion.js:144). There are two ways to select the target
656
+ # instances:
657
+ # 1. Explicit ``sources`` = a list of instance ids (the ids returned by the
658
+ # flow-history list). This is the only shape the frontend ever sends —
659
+ # HistoryHeader.jsx:95/112 calls ``{sources: [id, ...]}`` with nothing
660
+ # else. ``appId`` is NOT required and must NOT be injected, otherwise the
661
+ # server 500s when it is given a value that is not a real worksheet id.
662
+ # 2. ``is_all`` selection over a worksheet view — then ``appId`` (the
663
+ # worksheet id, named ``appId`` in the schema) plus the filter fields are
664
+ # required.
665
+ # Therefore ``appId`` and ``isAll`` are only added to the body when they carry
666
+ # meaning; an empty ``appId`` or ``isAll=False`` must not leak into the payload.
653
667
 
654
668
 
655
669
  def _build_request_start_process(
656
- app_id: str,
670
+ app_id: str = "",
657
671
  trigger_id: str = "",
658
672
  view_id: str = "",
659
673
  sources: Optional[list] = None,
@@ -666,11 +680,16 @@ def _build_request_start_process(
666
680
  data_log: str = "",
667
681
  push_unique_id: str = "",
668
682
  ) -> dict[str, Any]:
669
- """Assemble a ``RequestStartProcess`` body per instanceVersion.js:144."""
670
- data: dict[str, Any] = {
671
- "appId": app_id,
672
- "isAll": is_all,
673
- }
683
+ """Assemble a ``RequestStartProcess`` body per instanceVersion.js:144.
684
+
685
+ ``appId`` is only emitted when non-empty and ``isAll`` only when ``True``;
686
+ the explicit-``sources`` path (the common case) sends just ``sources``.
687
+ """
688
+ data: dict[str, Any] = {}
689
+ if app_id:
690
+ data["appId"] = app_id
691
+ if is_all:
692
+ data["isAll"] = is_all
674
693
  if trigger_id:
675
694
  data["triggerId"] = trigger_id
676
695
  if view_id:
@@ -696,7 +715,7 @@ def _build_request_start_process(
696
715
 
697
716
  def end_instance_batch(
698
717
  session: Session,
699
- app_id: str,
718
+ app_id: str = "",
700
719
  *,
701
720
  trigger_id: str = "",
702
721
  view_id: str = "",
@@ -712,9 +731,11 @@ def end_instance_batch(
712
731
  ) -> dict[str, Any]:
713
732
  """Terminate instances in bulk (``v1/instance/endInstanceList``).
714
733
 
715
- Either pass ``sources`` (explicit row ids) or flip ``is_all=True`` and
716
- describe the selection filter via ``filter_controls`` / ``fast_filters``
717
- / ``filters_group`` / etc.
734
+ Either pass ``sources`` (explicit instance ids from the flow-history list)
735
+ or flip ``is_all=True`` with ``app_id`` (the worksheet id) and describe the
736
+ selection filter via ``filter_controls`` / ``fast_filters`` /
737
+ ``filters_group`` / etc. In the common ``sources`` path ``app_id`` is left
738
+ empty and is not sent.
718
739
  """
719
740
  data = _build_request_start_process(
720
741
  app_id, trigger_id=trigger_id, view_id=view_id,
@@ -728,7 +749,7 @@ def end_instance_batch(
728
749
 
729
750
  def reset_instance_batch(
730
751
  session: Session,
731
- app_id: str,
752
+ app_id: str = "",
732
753
  *,
733
754
  trigger_id: str = "",
734
755
  view_id: str = "",
@@ -142,6 +142,27 @@ def complete_worksheet_permission(
142
142
  }
143
143
 
144
144
 
145
+ def _normalize_page_permissions(
146
+ page_permissions: Optional[list[dict[str, Any]]],
147
+ ) -> list[dict[str, Any]]:
148
+ """Normalize each custom-page permission to the V3 ``{id, enable}`` shape.
149
+
150
+ The V3 ``/v3/app/roles`` schema requires ``id`` (the custom-page id) for
151
+ each entry. ``pageId`` is accepted as a friendly alias and rewritten to
152
+ ``id`` so both spellings work.
153
+ """
154
+ normalized: list[dict[str, Any]] = []
155
+ for pp in page_permissions or []:
156
+ if not isinstance(pp, dict):
157
+ normalized.append(pp)
158
+ continue
159
+ entry = dict(pp)
160
+ if "id" not in entry and "pageId" in entry:
161
+ entry["id"] = entry.pop("pageId")
162
+ normalized.append(entry)
163
+ return normalized
164
+
165
+
145
166
  def create_role_fine_grained(
146
167
  session: Any,
147
168
  app_id: str,
@@ -168,7 +189,7 @@ def create_role_fine_grained(
168
189
  "permissionScope": 0,
169
190
  "hideAppForMembers": hide_app_for_members,
170
191
  "worksheetPermissions": complete_ws_perms,
171
- "pagePermissions": page_permissions or [],
192
+ "pagePermissions": _normalize_page_permissions(page_permissions),
172
193
  }
173
194
  return session.v3_call(
174
195
  "POST", "/v3/app/roles", app_id=app_id, body=body,
@@ -351,13 +351,34 @@ def copy_worksheet(
351
351
  app_id: str = "",
352
352
  project_id: str = "",
353
353
  copy_rows: bool = False,
354
+ section_id: str = "",
354
355
  ) -> dict[str, Any]:
355
- """Copy a worksheet."""
356
- data: dict[str, Any] = {"worksheetId": worksheet_id, "name": name}
356
+ """Copy a worksheet.
357
+
358
+ CopyWorksheet needs ``appSectionId`` — the sidebar group the new
359
+ worksheet should land in. Without it the server answers "服务异常"
360
+ (evidence: pd-openweb src/pages/worksheet/redux/actions/sheetList.js
361
+ copySheet + WorkSheetLeft/MoreOperation.jsx, both of which always send
362
+ ``appSectionId``). When ``section_id`` is omitted but ``app_id`` is
363
+ given, resolve it from the source worksheet's own section so the copy
364
+ lands beside the original.
365
+ """
366
+ data: dict[str, Any] = {
367
+ "worksheetId": worksheet_id,
368
+ "name": name,
369
+ "relationControlIds": [],
370
+ }
357
371
  if app_id:
358
372
  data["appId"] = app_id
359
373
  if project_id:
360
374
  data["projectId"] = project_id
375
+ if not section_id and app_id:
376
+ from hap_cli.core import app as _app
377
+ section_id, _ = _app.find_worksheet_section(
378
+ session, app_id, worksheet_id,
379
+ )
380
+ if section_id:
381
+ data["appSectionId"] = section_id
361
382
  data["isCopyRows"] = copy_rows
362
383
  return session.api_call("Worksheet", "CopyWorksheet", data)
363
384
 
@@ -1156,10 +1156,10 @@
1156
1156
  "en": "0=end, 1=active"
1157
1157
  },
1158
1158
  "approval end-batch": {
1159
- "en": "Terminate instances in bulk (``v1/instance/endInstanceList``)."
1159
+ "en": "Terminate one or more running flows in bulk.\n\nPass the instance IDs from the flow history list as arguments:\n\n hap approval end-batch <INSTANCE_ID> [<INSTANCE_ID> ...]"
1160
1160
  },
1161
1161
  "approval end-batch --all": {
1162
- "en": "Select all matching rows"
1162
+ "en": "Select all matching rows (requires --app-id)"
1163
1163
  },
1164
1164
  "approval end-batch --data-log": {
1165
1165
  "en": "Extended trigger context blob"
@@ -1174,7 +1174,7 @@
1174
1174
  "en": "JSON array of custom-page filter groups"
1175
1175
  },
1176
1176
  "approval end-batch --keywords": {
1177
- "en": "Search keyword over rows"
1177
+ "en": "Search keyword over rows (for --all)"
1178
1178
  },
1179
1179
  "approval end-batch --nav-group-filters": {
1180
1180
  "en": "JSON array of nav-group filters"
@@ -1183,13 +1183,13 @@
1183
1183
  "en": "Client-side push dedup id"
1184
1184
  },
1185
1185
  "approval end-batch --source": {
1186
- "en": "Explicit row ID to act on (repeat)"
1186
+ "en": "Instance ID to act on (repeat; merged with positional IDs)"
1187
1187
  },
1188
1188
  "approval end-batch --trigger-id": {
1189
- "en": "Trigger/button ID"
1189
+ "en": "Trigger/button ID (for --all)"
1190
1190
  },
1191
1191
  "approval end-batch --view-id": {
1192
- "en": "Source view ID"
1192
+ "en": "Source view ID (for --all)"
1193
1193
  },
1194
1194
  "approval forward": {
1195
1195
  "en": "Forward a task to another user."
@@ -1276,7 +1276,7 @@
1276
1276
  "en": "Work item ID"
1277
1277
  },
1278
1278
  "approval restart": {
1279
- "en": "Re-initiate a completed/rejected instance."
1279
+ "en": "Re-initiate a flow the initiator has revoked.\n\nUse this after the initiator revoked (withdrew) a still-running flow to start it again. It does not apply to flows that already finished."
1280
1280
  },
1281
1281
  "approval restart --work-id": {
1282
1282
  "en": "Work item ID"
@@ -1285,10 +1285,10 @@
1285
1285
  "en": "Retry a failed instance."
1286
1286
  },
1287
1287
  "approval retry-batch": {
1288
- "en": "Retry failed instances in bulk (``v1/instance/resetInstanceList``)."
1288
+ "en": "Retry one or more failed flows in bulk.\n\nPass the instance IDs from the flow history list as arguments:\n\n hap approval retry-batch <INSTANCE_ID> [<INSTANCE_ID> ...]"
1289
1289
  },
1290
1290
  "approval retry-batch --all": {
1291
- "en": "Select all matching rows"
1291
+ "en": "Select all matching rows (requires --app-id)"
1292
1292
  },
1293
1293
  "approval retry-batch --data-log": {
1294
1294
  "en": "Extended trigger context blob"
@@ -1303,7 +1303,7 @@
1303
1303
  "en": "JSON array of custom-page filter groups"
1304
1304
  },
1305
1305
  "approval retry-batch --keywords": {
1306
- "en": "Search keyword over rows"
1306
+ "en": "Search keyword over rows (for --all)"
1307
1307
  },
1308
1308
  "approval retry-batch --nav-group-filters": {
1309
1309
  "en": "JSON array of nav-group filters"
@@ -1312,13 +1312,13 @@
1312
1312
  "en": "Client-side push dedup id"
1313
1313
  },
1314
1314
  "approval retry-batch --source": {
1315
- "en": "Explicit row ID to act on (repeat)"
1315
+ "en": "Instance ID to act on (repeat; merged with positional IDs)"
1316
1316
  },
1317
1317
  "approval retry-batch --trigger-id": {
1318
- "en": "Trigger/button ID"
1318
+ "en": "Trigger/button ID (for --all)"
1319
1319
  },
1320
1320
  "approval retry-batch --view-id": {
1321
- "en": "Source view ID"
1321
+ "en": "Source view ID (for --all)"
1322
1322
  },
1323
1323
  "approval revoke": {
1324
1324
  "en": "Revoke/withdraw a submitted instance."
@@ -2599,19 +2599,19 @@
2599
2599
  "en": "Input data JSON: [{name,value,type}]"
2600
2600
  },
2601
2601
  "workflow node test-webhook": {
2602
- "en": "Test a WebHook node."
2602
+ "en": "Run the \"Test API\" action of a Send Custom Request node."
2603
2603
  },
2604
2604
  "workflow node test-webhook --body": {
2605
2605
  "en": "Request body (JSON string)"
2606
2606
  },
2607
2607
  "workflow node test-webhook --content-type": {
2608
- "en": "Content-Type"
2608
+ "en": "Body format: json, text, form-data, x-www-form-urlencoded, or file."
2609
2609
  },
2610
2610
  "workflow node test-webhook --headers": {
2611
2611
  "en": "Headers JSON: [{name,value}]"
2612
2612
  },
2613
2613
  "workflow node test-webhook --method": {
2614
- "en": "HTTP method"
2614
+ "en": "HTTP method: GET, POST, PUT, DELETE, HEAD, or PATCH."
2615
2615
  },
2616
2616
  "workflow node test-webhook --url": {
2617
2617
  "en": "Target URL"
@@ -2713,7 +2713,7 @@
2713
2713
  "en": "Worksheet operations."
2714
2714
  },
2715
2715
  "worksheet copy": {
2716
- "en": "Copy a worksheet."
2716
+ "en": "Copy a worksheet into the same sidebar group as the original."
2717
2717
  },
2718
2718
  "worksheet copy --app-id": {
2719
2719
  "en": "Application ID"
@@ -2724,6 +2724,9 @@
2724
2724
  "worksheet copy --org-id": {
2725
2725
  "en": "Organization ID"
2726
2726
  },
2727
+ "worksheet copy --section-id": {
2728
+ "en": "Sidebar group the copy lands in. Auto-resolved from the source worksheet's group when omitted (requires --app-id)."
2729
+ },
2727
2730
  "worksheet create": {
2728
2731
  "en": "Create a worksheet with the full v3 field-type set including Attachment."
2729
2732
  },
@@ -3257,6 +3260,12 @@
3257
3260
  },
3258
3261
  "worksheet view sort": {
3259
3262
  "en": "Reorder worksheet views. Pass view IDs in desired order."
3263
+ },
3264
+ "approval end-batch --app-id": {
3265
+ "en": "Worksheet ID — only needed with --all to select every matching row"
3266
+ },
3267
+ "approval retry-batch --app-id": {
3268
+ "en": "Worksheet ID — only needed with --all to select every matching row"
3260
3269
  }
3261
3270
  }
3262
3271
  }