hap-cli 0.8.2__tar.gz → 0.8.4__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 (207) hide show
  1. {hap_cli-0.8.2 → hap_cli-0.8.4}/PKG-INFO +2 -2
  2. {hap_cli-0.8.2/hap_cli → hap_cli-0.8.4}/README.md +1 -1
  3. {hap_cli-0.8.2 → hap_cli-0.8.4/hap_cli}/README.md +1 -1
  4. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/README_CN.md +1 -1
  5. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/__init__.py +1 -1
  6. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/app_cmd.py +0 -31
  7. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/node_cmd.py +7 -3
  8. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/app.py +0 -49
  9. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/flow_node.py +24 -8
  10. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/record.py +14 -1
  11. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/locale/messages.json +0 -21
  12. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_core.py +110 -12
  13. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_org_id_cli.py +0 -1
  14. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/PKG-INFO +2 -2
  15. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/SOURCES.txt +0 -1
  16. hap_cli-0.8.2/hap_cli/tests/test_app_restore.py +0 -123
  17. {hap_cli-0.8.2 → hap_cli-0.8.4}/MANIFEST.in +0 -0
  18. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/__init__.py +0 -0
  19. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/__main__.py +0 -0
  20. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/config.py +0 -0
  21. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/harness.py +0 -0
  22. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/smoke.py +0 -0
  23. {hap_cli-0.8.2 → hap_cli-0.8.4}/app_live_tests/state.py +0 -0
  24. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/__init__.py +0 -0
  25. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/app_editor_cmd.py +0 -0
  26. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/auth_cmd.py +0 -0
  27. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/calendar_cmd.py +0 -0
  28. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/chart_cmd.py +0 -0
  29. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/chat_cmd.py +0 -0
  30. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/chatbot_cmd.py +0 -0
  31. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/config_cmd.py +0 -0
  32. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/contact_cmd.py +0 -0
  33. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/department_cmd.py +0 -0
  34. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/group_cmd.py +0 -0
  35. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/icon_cmd.py +0 -0
  36. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/instance_cmd.py +0 -0
  37. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/optionset_cmd.py +0 -0
  38. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/page_cmd.py +0 -0
  39. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/post_cmd.py +0 -0
  40. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/record_cmd.py +0 -0
  41. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/region_cmd.py +0 -0
  42. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/role_cmd.py +0 -0
  43. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/upload_cmd.py +0 -0
  44. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/v3_registry.py +0 -0
  45. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/workflow_cmd.py +0 -0
  46. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/commands/worksheet_cmd.py +0 -0
  47. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/context.py +0 -0
  48. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/__init__.py +0 -0
  49. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/action_spec_adapter.py +0 -0
  50. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/auth.py +0 -0
  51. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/calendar_mod.py +0 -0
  52. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/chart.py +0 -0
  53. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/chat.py +0 -0
  54. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/chatbot.py +0 -0
  55. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/contact.py +0 -0
  56. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/control_type_codes.py +0 -0
  57. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/department.py +0 -0
  58. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/__init__.py +0 -0
  59. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
  60. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
  61. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/apply.py +0 -0
  62. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/componentlower.py +0 -0
  63. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/editspec.py +0 -0
  64. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/errors.py +0 -0
  65. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/fieldlower.py +0 -0
  66. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/jsonschema_mini.py +0 -0
  67. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/models.py +0 -0
  68. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/ops.py +0 -0
  69. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/planner.py +0 -0
  70. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/editor/reader.py +0 -0
  71. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/field_normalizer.py +0 -0
  72. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/field_spec_adapter.py +0 -0
  73. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/filter_translator.py +0 -0
  74. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/global_meta.py +0 -0
  75. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/group.py +0 -0
  76. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/icon_index.py +0 -0
  77. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/instance.py +0 -0
  78. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/logger.py +0 -0
  79. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/optionset.py +0 -0
  80. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/page.py +0 -0
  81. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/post.py +0 -0
  82. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/response_crypto.py +0 -0
  83. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/role.py +0 -0
  84. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/role_perm_builder.py +0 -0
  85. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/session.py +0 -0
  86. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/token_crypto.py +0 -0
  87. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/upload.py +0 -0
  88. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/v3/__init__.py +0 -0
  89. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/v3/dispatcher.py +0 -0
  90. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/v3/render.py +0 -0
  91. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/v3/schema.py +0 -0
  92. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/view_spec_adapter.py +0 -0
  93. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/workflow.py +0 -0
  94. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/workflow_node_dsl.py +0 -0
  95. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/worksheet.py +0 -0
  96. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/core/worksheet_templates.py +0 -0
  97. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/hap_cli.py +0 -0
  98. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/i18n.py +0 -0
  99. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/locale/__init__.py +0 -0
  100. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/locale/messages.schema.json +0 -0
  101. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/__init__.py +0 -0
  102. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/conftest.py +0 -0
  103. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_app_editor.py +0 -0
  104. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_app_export_usage.py +0 -0
  105. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_auth_prerelease.py +0 -0
  106. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_bug_036430.py +0 -0
  107. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_chart.py +0 -0
  108. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_config_cmd.py +0 -0
  109. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_destructive_confirm_cli.py +0 -0
  110. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_full_e2e.py +0 -0
  111. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_global_meta.py +0 -0
  112. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_i18n.py +0 -0
  113. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration.py +0 -0
  114. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_approval.py +0 -0
  115. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_approval_actions.py +0 -0
  116. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_calendar.py +0 -0
  117. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_destructive.py +0 -0
  118. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_misc.py +0 -0
  119. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_post.py +0 -0
  120. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_social.py +0 -0
  121. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_v3.py +0 -0
  122. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_workflow.py +0 -0
  123. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_integration_worksheet_extra.py +0 -0
  124. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_multi_profile.py +0 -0
  125. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_org_approval_v3_semantic_cli.py +0 -0
  126. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_org_id_docs.py +0 -0
  127. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_parameter_conventions.py +0 -0
  128. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_parameter_mapping_registry.py +0 -0
  129. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_record_batch_v3_semantic_cli.py +0 -0
  130. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_record_v3_semantic_cli.py +0 -0
  131. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_semantic_types_registry.py +0 -0
  132. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_v3_api_schema_loader.py +0 -0
  133. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_v3_dispatcher.py +0 -0
  134. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_v3_registry_coverage.py +0 -0
  135. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_v3_session.py +0 -0
  136. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_v3_yaml_translation.py +0 -0
  137. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_workflow_v3_semantic_cli.py +0 -0
  138. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_worksheet_crud_cli.py +0 -0
  139. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/tests/test_worksheet_v3_semantic_cli.py +0 -0
  140. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/utils/__init__.py +0 -0
  141. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/utils/formatting.py +0 -0
  142. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/utils/options.py +0 -0
  143. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli/utils/parameter_mapping.py +0 -0
  144. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/dependency_links.txt +0 -0
  145. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/entry_points.txt +0 -0
  146. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/requires.txt +0 -0
  147. {hap_cli-0.8.2 → hap_cli-0.8.4}/hap_cli.egg-info/top_level.txt +0 -0
  148. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/__init__.py +0 -0
  149. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/__main__.py +0 -0
  150. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/_wftest.py +0 -0
  151. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/charts.py +0 -0
  152. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/cleanup.py +0 -0
  153. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/compiler.py +0 -0
  154. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/config.py +0 -0
  155. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/errors.py +0 -0
  156. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/executor.py +0 -0
  157. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/fields.py +0 -0
  158. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/hap.py +0 -0
  159. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/recording/__init__.py +0 -0
  160. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/recording/console.py +0 -0
  161. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/recording/jsonl.py +0 -0
  162. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/recording/mirror.py +0 -0
  163. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/recording/report.py +0 -0
  164. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/schema.py +0 -0
  165. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/seed/__init__.py +0 -0
  166. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/seed/cli.py +0 -0
  167. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/seed/executor.py +0 -0
  168. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/seed/template.py +0 -0
  169. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/selftest.py +0 -0
  170. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/smoke.py +0 -0
  171. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/step.py +0 -0
  172. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/steps.py +0 -0
  173. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/store.py +0 -0
  174. {hap_cli-0.8.2 → hap_cli-0.8.4}/live_tests/workflow_dsl.py +0 -0
  175. {hap_cli-0.8.2 → hap_cli-0.8.4}/setup.cfg +0 -0
  176. {hap_cli-0.8.2 → hap_cli-0.8.4}/setup.py +0 -0
  177. {hap_cli-0.8.2 → hap_cli-0.8.4}/skills/hap-cli-app-editor/scripts/editspec/component.schema.json +0 -0
  178. {hap_cli-0.8.2 → hap_cli-0.8.4}/skills/hap-cli-app-editor/scripts/editspec/custom-action.schema.json +0 -0
  179. {hap_cli-0.8.2 → hap_cli-0.8.4}/skills/hap-cli-app-editor/scripts/editspec/envelope.schema.json +0 -0
  180. {hap_cli-0.8.2 → hap_cli-0.8.4}/skills/hap-cli-app-editor/scripts/editspec/field.schema.json +0 -0
  181. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/INDEX.json +0 -0
  182. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
  183. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
  184. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/create_optionset.yaml +0 -0
  185. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/create_role.yaml +0 -0
  186. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/delete_optionset.yaml +0 -0
  187. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/delete_record.yaml +0 -0
  188. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/delete_role.yaml +0 -0
  189. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
  190. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_app_info.yaml +0 -0
  191. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
  192. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
  193. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
  194. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_details.yaml +0 -0
  195. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
  196. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_list.yaml +0 -0
  197. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_logs.yaml +0 -0
  198. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
  199. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_relations.yaml +0 -0
  200. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
  201. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_regions.yaml +0 -0
  202. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_role_details.yaml +0 -0
  203. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/get_role_list.yaml +0 -0
  204. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/knowledge_search.yaml +0 -0
  205. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
  206. {hap_cli-0.8.2 → hap_cli-0.8.4}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
  207. {hap_cli-0.8.2 → hap_cli-0.8.4}/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.2
3
+ Version: 0.8.4
4
4
  Summary: CLI harness for MingDAO HAP - Enterprise no-code platform
5
5
  Author: hap-cli
6
6
  License: Apache-2.0
@@ -155,7 +155,7 @@ discover every subcommand.
155
155
  | `app create-section / edit-section / delete-section` | Section management |
156
156
  | `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
157
157
  | `app create-item` | Batch-create empty worksheets / custom pages |
158
- | `app backup / restore / export / exports / backup-logs` | Backup & export |
158
+ | `app backup / export / exports / backup-logs` | Backup & export |
159
159
  | `app usage / logs` | Statistics and operation logs |
160
160
  | `app role …` | Role CRUD, permissions, members, leave-all, applications |
161
161
  | `app optionset …` | Option set CRUD and cross-app moves |
@@ -126,7 +126,7 @@ discover every subcommand.
126
126
  | `app create-section / edit-section / delete-section` | Section management |
127
127
  | `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
128
128
  | `app create-item` | Batch-create empty worksheets / custom pages |
129
- | `app backup / restore / export / exports / backup-logs` | Backup & export |
129
+ | `app backup / export / exports / backup-logs` | Backup & export |
130
130
  | `app usage / logs` | Statistics and operation logs |
131
131
  | `app role …` | Role CRUD, permissions, members, leave-all, applications |
132
132
  | `app optionset …` | Option set CRUD and cross-app moves |
@@ -126,7 +126,7 @@ discover every subcommand.
126
126
  | `app create-section / edit-section / delete-section` | Section management |
127
127
  | `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
128
128
  | `app create-item` | Batch-create empty worksheets / custom pages |
129
- | `app backup / restore / export / exports / backup-logs` | Backup & export |
129
+ | `app backup / export / exports / backup-logs` | Backup & export |
130
130
  | `app usage / logs` | Statistics and operation logs |
131
131
  | `app role …` | Role CRUD, permissions, members, leave-all, applications |
132
132
  | `app optionset …` | Option set CRUD and cross-app moves |
@@ -117,7 +117,7 @@ hap --json worksheet record list WORKSHEET_ID
117
117
  | `app create-section / edit-section / delete-section` | 分组管理 |
118
118
  | `app sort-sections / sort-worksheets` | 重排分组 / 分组内工作表顺序 |
119
119
  | `app create-item` | 批量创建空白工作表/自定义页面 |
120
- | `app backup / restore / export / exports / backup-logs` | 备份与导出 |
120
+ | `app backup / export / exports / backup-logs` | 备份与导出 |
121
121
  | `app usage / logs` | 使用统计与操作日志 |
122
122
  | `app role …` | 角色 CRUD、权限、成员、leave-all、申请 |
123
123
  | `app optionset …` | 选项集 CRUD 与跨应用迁移 |
@@ -1,3 +1,3 @@
1
1
  """CLI harness for MingDAO HAP (hap-cli)."""
2
2
 
3
- __version__ = "0.8.2"
3
+ __version__ = "0.8.4"
@@ -410,37 +410,6 @@ def app_backup(ctx, app_id, org_id, no_data):
410
410
  ctx.handle_error(e)
411
411
 
412
412
 
413
- @app.command("restore")
414
- @click.argument("app_id")
415
- @org_id_option()
416
- @click.option("--backup-id", "-b", default="", help="Restore from an existing backup (its ID)")
417
- @click.option("--file-url", default="", help="Restore from an uploaded backup file (its URL)")
418
- @click.option("--file-name", default="", help="File name to show for an uploaded backup file")
419
- @click.option("--no-data", is_flag=True, help="Restore without data")
420
- @click.option("--as-new", is_flag=True, help="Restore as a new app")
421
- @pass_context
422
- def app_restore(ctx, app_id, org_id, backup_id, file_url, file_name, no_data, as_new):
423
- """Restore an application, either from an existing backup or an uploaded file.
424
-
425
- Provide exactly one source: --backup-id (an existing backup) or
426
- --file-url (an uploaded backup file).
427
- """
428
- try:
429
- if bool(backup_id) == bool(file_url):
430
- raise click.UsageError(
431
- "Provide exactly one of --backup-id or --file-url."
432
- )
433
- session = ctx.get_session()
434
- data = app_mod.restore_app(
435
- session, app_id, require_api_project_id(session, org_id),
436
- backup_id=backup_id, file_url=file_url, file_name=file_name,
437
- contain_data=not no_data, is_restore_new=as_new,
438
- )
439
- ctx.output(data, lambda d: click.echo(f"Restore started: {d}"))
440
- except Exception as e:
441
- ctx.handle_error(e)
442
-
443
-
444
413
  @app.command("export")
445
414
  @click.argument("app_ids", nargs=-1, required=True)
446
415
  @org_id_option()
@@ -372,12 +372,16 @@ def node_form_property(ctx, process_id, node_id):
372
372
 
373
373
  @node.command("sub-processes")
374
374
  @click.argument("process_id")
375
+ @click.argument("node_id")
375
376
  @pass_context
376
- def node_sub_processes(ctx, process_id):
377
- """List available sub-processes."""
377
+ def node_sub_processes(ctx, process_id, node_id):
378
+ """List sub-processes available to a sub-process node.
379
+
380
+ NODE_ID is the node being configured.
381
+ """
378
382
  try:
379
383
  session = ctx.get_session()
380
- data = node_mod.get_sub_process_list(session, process_id)
384
+ data = node_mod.get_sub_process_list(session, process_id, select_node_id=node_id)
381
385
  ctx.output(data, lambda d: output_json(d))
382
386
  except Exception as e:
383
387
  ctx.handle_error(e)
@@ -620,55 +620,6 @@ def backup_app(
620
620
  )
621
621
 
622
622
 
623
- def restore_app(
624
- session: Session,
625
- app_id: str,
626
- project_id: str,
627
- backup_id: str = "",
628
- file_url: str = "",
629
- file_name: str = "",
630
- contain_data: bool = True,
631
- is_restore_new: bool = False,
632
- auto_end_maintain: bool = False,
633
- backup_current_version: bool = False,
634
- ) -> dict[str, Any]:
635
- """Restore an application from a backup log id or an uploaded file.
636
-
637
- The HAP UI has two mutually exclusive restore modes; the API field
638
- set differs between them, so we must send only one mode's fields:
639
-
640
- - Backup-log restore (``src/pages/AppSettings/components/
641
- appBackupRestore/components/BackupFiles.jsx``): sends ``id`` (the
642
- backup-restore operation-log id) plus ``autoEndMaintain``,
643
- ``backupCurrentVersion`` and ``isRestoreNew`` — no ``fileUrl``.
644
- - Uploaded-file restore (``.../BackupFromFiles.jsx``): sends
645
- ``fileUrl`` + ``fileName`` + ``containData`` plus the same three
646
- flags — no ``id``.
647
-
648
- Sending both at once (as an earlier wrapper did, with all three
649
- forced ``required``) made the command impossible to invoke. Exactly
650
- one of ``backup_id`` / ``file_url`` must be supplied.
651
- """
652
- if not backup_id and not file_url:
653
- raise ValueError("restore requires either backup_id or file_url")
654
-
655
- params: dict[str, Any] = {
656
- "appId": app_id,
657
- "projectId": project_id,
658
- "autoEndMaintain": auto_end_maintain,
659
- "backupCurrentVersion": backup_current_version,
660
- "isRestoreNew": is_restore_new,
661
- }
662
- if backup_id:
663
- # `id` is the backup-restore operation-log id (named `id` in the API).
664
- params["id"] = backup_id
665
- else:
666
- params["fileUrl"] = file_url
667
- params["fileName"] = file_name
668
- params["containData"] = contain_data
669
- return session.api_call("AppManagement", "Restore", params)
670
-
671
-
672
623
  def export_apps(
673
624
  session: Session,
674
625
  project_id: str,
@@ -274,7 +274,9 @@ def get_node_detail(
274
274
  data["appId"] = app_id
275
275
  if instance_id:
276
276
  data["instanceId"] = instance_id
277
- return session.workflow_call("flowNode/getNodeDetail", data)
277
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
278
+ # for this action; POSTing it returns 404 Not Found.
279
+ return session.workflow_call("flowNode/getNodeDetail", data, method="GET")
278
280
 
279
281
 
280
282
  # ── Node Update ──────────────────────────────────────────────────────────
@@ -572,7 +574,9 @@ def get_webhook_data(
572
574
  data: dict[str, Any] = {"processId": process_id, "nodeId": node_id}
573
575
  if select_node_id:
574
576
  data["selectNodeId"] = select_node_id
575
- return session.workflow_call("flowNode/getWebHookData", data)
577
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
578
+ # for this action; POSTing it returns 404 Not Found.
579
+ return session.workflow_call("flowNode/getWebHookData", data, method="GET")
576
580
 
577
581
 
578
582
  # ── Utilities ────────────────────────────────────────────────────────────
@@ -617,7 +621,9 @@ def get_node_form_property(
617
621
  data: dict[str, Any] = {"processId": process_id, "nodeId": node_id}
618
622
  if select_node_id:
619
623
  data["selectNodeId"] = select_node_id
620
- return session.workflow_call("flowNode/getNodeFormProperty", data)
624
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
625
+ # for this action; POSTing it returns 404 Not Found.
626
+ return session.workflow_call("flowNode/getNodeFormProperty", data, method="GET")
621
627
 
622
628
 
623
629
  def get_sub_process_list(
@@ -630,7 +636,9 @@ def get_sub_process_list(
630
636
  Args:
631
637
  session: Active session
632
638
  process_id: Process ID
633
- select_node_id: Context node
639
+ select_node_id: Context node. flowNode.js marks ``selectNodeId``
640
+ as required (``*选中节点ID``); omitting it makes the server
641
+ answer code 2000 "节点不存在".
634
642
 
635
643
  Returns:
636
644
  Sub-process list
@@ -638,7 +646,9 @@ def get_sub_process_list(
638
646
  data: dict[str, Any] = {"processId": process_id}
639
647
  if select_node_id:
640
648
  data["selectNodeId"] = select_node_id
641
- return session.workflow_call("flowNode/getSubProcessList", data)
649
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
650
+ # for this action; POSTing it returns 404 Not Found.
651
+ return session.workflow_call("flowNode/getSubProcessList", data, method="GET")
642
652
 
643
653
 
644
654
  # ── Code Templates ───────────────────────────────────────────────────────
@@ -672,7 +682,9 @@ def get_code_template_list(
672
682
  data["source"] = source
673
683
  if template_type:
674
684
  data["type"] = template_type
675
- return session.workflow_call("flowNode/getCodeTemplateList", data)
685
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
686
+ # for this action; POSTing it returns 404 Not Found.
687
+ return session.workflow_call("flowNode/getCodeTemplateList", data, method="GET")
676
688
 
677
689
 
678
690
  def create_code_template(
@@ -774,7 +786,9 @@ def get_flow_app_dtos(
774
786
  data["enumDefault"] = enum_default
775
787
  if field_type:
776
788
  data["type"] = field_type
777
- return session.workflow_call("flowNode/getFlowAppDtos", data)
789
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
790
+ # for this action; POSTing it returns 404 Not Found.
791
+ return session.workflow_call("flowNode/getFlowAppDtos", data, method="GET")
778
792
 
779
793
 
780
794
  def get_start_event_deploy(
@@ -809,7 +823,9 @@ def get_start_event_deploy(
809
823
  data["controlId"] = control_id
810
824
  if select_node_id:
811
825
  data["selectNodeId"] = select_node_id
812
- return session.workflow_call("flowNode/getStartEventDeploy", data)
826
+ # Evidence: pd-openweb flowNode.js pins ``base.ajaxOptions.type = 'GET'``
827
+ # for this action; POSTing it returns 404 Not Found.
828
+ return session.workflow_call("flowNode/getStartEventDeploy", data, method="GET")
813
829
 
814
830
 
815
831
  # ── Data Processing Convenience Functions ────────────────────────────────
@@ -56,13 +56,26 @@ def _legacy_cell_value(ctrl: dict[str, Any], value: Any) -> str:
56
56
  if t == 10: # MULTI_SELECT
57
57
  return json.dumps(_resolve_option_keys(ctrl, value), ensure_ascii=False)
58
58
 
59
- if t == 29: # RELATE_SHEET -> [{"sid": rowId}, ...]
59
+ if t in (29, 35): # RELATE_SHEET / CASCADING_SELECT -> [{"sid": rowId}, ...]
60
+ # Cascade (35) is a relation to a row in another worksheet, persisted
61
+ # the same way as a plain relate (29): an array of {"sid": rowId}. A
62
+ # bare rowId makes the server answer "服务异常" (bug #642cc8).
60
63
  if isinstance(value, (list, tuple)):
61
64
  ids = [str(v) for v in value]
62
65
  else:
63
66
  ids = [s for s in str(value).split(",") if s != ""]
64
67
  return json.dumps([{"sid": rid} for rid in ids], ensure_ascii=False)
65
68
 
69
+ if t == 48: # ORG_ROLE -> [{"organizeId": id}, ...]
70
+ # Mirrors DEPARTMENT (27): the legacy AddWorksheetRow takes an array
71
+ # of {"organizeId": id} objects; organizeName is display-only and the
72
+ # server resolves it from the id. A bare organizeId is rejected with
73
+ # "服务异常" (bug #642cc8). See pd-openweb CellControls/OrgRole.jsx.
74
+ ids = value if isinstance(value, (list, tuple)) else \
75
+ [s for s in str(value).split(",") if s != ""]
76
+ return json.dumps([{"organizeId": str(i)} for i in ids],
77
+ ensure_ascii=False)
78
+
66
79
  if t == 26: # USER_PICKER
67
80
  ids = value if isinstance(value, (list, tuple)) else \
68
81
  [s for s in str(value).split(",") if s != ""]
@@ -900,27 +900,6 @@
900
900
  "app optionset update --options-json": {
901
901
  "en": "Option list. [JSON value] [required]"
902
902
  },
903
- "app restore": {
904
- "en": "Restore an application from backup."
905
- },
906
- "app restore --as-new": {
907
- "en": "Restore as a new app"
908
- },
909
- "app restore --backup-id": {
910
- "en": "Backup ID"
911
- },
912
- "app restore --file-name": {
913
- "en": "Backup file name"
914
- },
915
- "app restore --file-url": {
916
- "en": "Backup file URL"
917
- },
918
- "app restore --no-data": {
919
- "en": "Restore without data"
920
- },
921
- "app restore --org-id": {
922
- "en": "Organization ID"
923
- },
924
903
  "app role": {
925
904
  "en": "Role management."
926
905
  },
@@ -486,6 +486,38 @@ class TestRecord:
486
486
  # endpoint is the legacy AddWorksheetRow
487
487
  assert mock_post.call_args[0][0].endswith("/Worksheet/AddWorksheetRow")
488
488
 
489
+ @patch("hap_cli.core.worksheet.get_worksheet_controls")
490
+ @patch("hap_cli.core.session.requests.post")
491
+ def test_legacy_batch_create_serializes_orgrole_and_cascade(
492
+ self, mock_post, mock_controls, mock_session
493
+ ):
494
+ # Org-role (48) and cascading-select (35) cells must be wrapped in
495
+ # the wire shapes the legacy AddWorksheetRow expects — a bare id
496
+ # makes the server answer "服务异常". OrgRole -> [{"organizeId": id}];
497
+ # Cascade is a relation-to-a-row -> [{"sid": rowId}] (like type 29).
498
+ mock_controls.return_value = [
499
+ {"controlId": "cOrg", "controlName": "组织角色", "type": 48,
500
+ "dot": 0},
501
+ {"controlId": "cCas", "controlName": "级联选择", "type": 35,
502
+ "dot": 0},
503
+ ]
504
+ mock_post.return_value = _mock_response({"rowid": "r_new"})
505
+
506
+ rec_mod.batch_create_by_name(
507
+ mock_session,
508
+ "ws1",
509
+ [{
510
+ "组织角色": "40d102b2-12bc-48d2-9364-f57070502609",
511
+ "级联选择": "97ebc5ba-4d57",
512
+ }],
513
+ )
514
+
515
+ rc = {c["controlId"]: c
516
+ for c in mock_post.call_args[1]["json"]["receiveControls"]}
517
+ assert json.loads(rc["cOrg"]["value"]) == [
518
+ {"organizeId": "40d102b2-12bc-48d2-9364-f57070502609"}]
519
+ assert json.loads(rc["cCas"]["value"]) == [{"sid": "97ebc5ba-4d57"}]
520
+
489
521
  @patch("hap_cli.core.worksheet.get_worksheet_controls")
490
522
  @patch("hap_cli.core.session.requests.post")
491
523
  def test_cli_batch_create_uses_main_api(
@@ -899,10 +931,18 @@ class TestFlowNode:
899
931
  assert not mock_post.called, "flowNode/get must not be POSTed"
900
932
  assert "startId" in result
901
933
 
934
+ @patch("hap_cli.core.session.requests.get")
902
935
  @patch("hap_cli.core.session.requests.post")
903
- def test_get_node_detail(self, mock_post, mock_session):
904
- mock_post.return_value = _mock_response({"nodeId": "n1", "flowNodeType": 4})
936
+ def test_get_node_detail(self, mock_post, mock_get, mock_session):
937
+ """``flowNode/getNodeDetail`` is GET per ``flowNode.js`` (pins
938
+ ``base.ajaxOptions.type = 'GET'``). POSTing returns 404."""
939
+ mock_get.return_value = _mock_response({"nodeId": "n1", "flowNodeType": 4})
905
940
  result = node_mod.get_node_detail(mock_session, "wf1", "n1")
941
+ assert mock_get.called, "flowNode/getNodeDetail must be issued as GET"
942
+ assert not mock_post.called
943
+ params = mock_get.call_args[1]["params"]
944
+ assert params["processId"] == "wf1"
945
+ assert params["nodeId"] == "n1"
906
946
  assert result["flowNodeType"] == 4
907
947
 
908
948
  @patch("hap_cli.core.session.requests.post")
@@ -972,12 +1012,18 @@ class TestFlowNode:
972
1012
  body = mock_post.call_args[1]["json"]
973
1013
  assert body["json"] == '{"name": "test"}'
974
1014
 
1015
+ @patch("hap_cli.core.session.requests.get")
975
1016
  @patch("hap_cli.core.session.requests.post")
976
- def test_get_code_template_list(self, mock_post, mock_session):
977
- mock_post.return_value = _mock_response([{"id": "t1", "name": "Template1"}])
1017
+ def test_get_code_template_list(self, mock_post, mock_get, mock_session):
1018
+ """``flowNode/getCodeTemplateList`` is GET per ``flowNode.js``.
1019
+ POSTing returns 404."""
1020
+ mock_get.return_value = _mock_response([{"id": "t1", "name": "Template1"}])
978
1021
  result = node_mod.get_code_template_list(mock_session, keyword="test")
979
- body = mock_post.call_args[1]["json"]
980
- assert body["keyword"] == "test"
1022
+ assert mock_get.called, "flowNode/getCodeTemplateList must be issued as GET"
1023
+ assert not mock_post.called
1024
+ params = mock_get.call_args[1]["params"]
1025
+ assert params["keyword"] == "test"
1026
+ assert result[0]["id"] == "t1"
981
1027
 
982
1028
  @patch("hap_cli.core.session.requests.post")
983
1029
  def test_create_code_template(self, mock_post, mock_session):
@@ -987,12 +1033,64 @@ class TestFlowNode:
987
1033
  assert body["name"] == "My Tmpl"
988
1034
  assert body["code"] == "console.log('hi')"
989
1035
 
1036
+ @patch("hap_cli.core.session.requests.get")
990
1037
  @patch("hap_cli.core.session.requests.post")
991
- def test_get_sub_process_list(self, mock_post, mock_session):
992
- mock_post.return_value = _mock_response([{"id": "sub1"}])
993
- result = node_mod.get_sub_process_list(mock_session, "wf1")
994
- body = mock_post.call_args[1]["json"]
995
- assert body["processId"] == "wf1"
1038
+ def test_get_sub_process_list(self, mock_post, mock_get, mock_session):
1039
+ """``flowNode/getSubProcessList`` is GET per ``flowNode.js``.
1040
+ POSTing returns 404."""
1041
+ mock_get.return_value = _mock_response([{"id": "sub1"}])
1042
+ result = node_mod.get_sub_process_list(mock_session, "wf1", select_node_id="n1")
1043
+ assert mock_get.called, "flowNode/getSubProcessList must be issued as GET"
1044
+ assert not mock_post.called
1045
+ params = mock_get.call_args[1]["params"]
1046
+ assert params["processId"] == "wf1"
1047
+ # selectNodeId is required by the server (code 2000 without it)
1048
+ assert params["selectNodeId"] == "n1"
1049
+ assert result[0]["id"] == "sub1"
1050
+
1051
+ @patch("hap_cli.core.session.requests.get")
1052
+ @patch("hap_cli.core.session.requests.post")
1053
+ def test_get_node_form_property(self, mock_post, mock_get, mock_session):
1054
+ """``flowNode/getNodeFormProperty`` is GET per ``flowNode.js``.
1055
+ POSTing returns 404."""
1056
+ mock_get.return_value = _mock_response({"controls": []})
1057
+ result = node_mod.get_node_form_property(mock_session, "wf1", "n1")
1058
+ assert mock_get.called, "flowNode/getNodeFormProperty must be issued as GET"
1059
+ assert not mock_post.called
1060
+ params = mock_get.call_args[1]["params"]
1061
+ assert params["processId"] == "wf1"
1062
+ assert params["nodeId"] == "n1"
1063
+ assert "controls" in result
1064
+
1065
+ @patch("hap_cli.core.session.requests.get")
1066
+ @patch("hap_cli.core.session.requests.post")
1067
+ def test_get_webhook_data_uses_get(self, mock_post, mock_get, mock_session):
1068
+ """``flowNode/getWebHookData`` is GET per ``flowNode.js``.
1069
+ POSTing returns 404."""
1070
+ mock_get.return_value = _mock_response({"data": "{}"})
1071
+ node_mod.get_webhook_data(mock_session, "wf1", "n1")
1072
+ assert mock_get.called, "flowNode/getWebHookData must be issued as GET"
1073
+ assert not mock_post.called
1074
+
1075
+ @patch("hap_cli.core.session.requests.get")
1076
+ @patch("hap_cli.core.session.requests.post")
1077
+ def test_get_flow_app_dtos_uses_get(self, mock_post, mock_get, mock_session):
1078
+ """``flowNode/getFlowAppDtos`` is GET per ``flowNode.js``.
1079
+ POSTing returns 404."""
1080
+ mock_get.return_value = _mock_response([{"id": "app1"}])
1081
+ node_mod.get_flow_app_dtos(mock_session, "wf1", "n1")
1082
+ assert mock_get.called, "flowNode/getFlowAppDtos must be issued as GET"
1083
+ assert not mock_post.called
1084
+
1085
+ @patch("hap_cli.core.session.requests.get")
1086
+ @patch("hap_cli.core.session.requests.post")
1087
+ def test_get_start_event_deploy_uses_get(self, mock_post, mock_get, mock_session):
1088
+ """``flowNode/getStartEventDeploy`` is GET per ``flowNode.js``.
1089
+ POSTing returns 404."""
1090
+ mock_get.return_value = _mock_response({"processId": "wf1"})
1091
+ node_mod.get_start_event_deploy(mock_session, "wf1", "n1")
1092
+ assert mock_get.called, "flowNode/getStartEventDeploy must be issued as GET"
1093
+ assert not mock_post.called
996
1094
 
997
1095
  @patch("hap_cli.core.session.requests.post")
998
1096
  def test_add_node_with_action_id(self, mock_post, mock_session):
@@ -6290,7 +6388,7 @@ class TestShellCompletion:
6290
6388
  comp = BashComplete(cli, {}, "hap", "_HAP_COMPLETE")
6291
6389
  items = comp.get_completions(["app"], "r")
6292
6390
  values = {item.value for item in items}
6293
- # app has a `role` subcommand; `restore` is fine too if it exists
6391
+ # app has a `role` subcommand that completes from the "r" prefix
6294
6392
  assert "role" in values
6295
6393
 
6296
6394
  def test_completion_engine_completes_option_names(self):
@@ -15,7 +15,6 @@ ORG_ID_HELP_CASES = [
15
15
  # as a body parameter (schema property ``org_id``).
16
16
  ["app", "create"],
17
17
  ["app", "backup"],
18
- ["app", "restore"],
19
18
  ["app", "backup-logs"],
20
19
  ["app", "usage"],
21
20
  ["contact", "search"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hap-cli
3
- Version: 0.8.2
3
+ Version: 0.8.4
4
4
  Summary: CLI harness for MingDAO HAP - Enterprise no-code platform
5
5
  Author: hap-cli
6
6
  License: Apache-2.0
@@ -155,7 +155,7 @@ discover every subcommand.
155
155
  | `app create-section / edit-section / delete-section` | Section management |
156
156
  | `app sort-sections / sort-worksheets` | Reorder sections / a section's worksheets |
157
157
  | `app create-item` | Batch-create empty worksheets / custom pages |
158
- | `app backup / restore / export / exports / backup-logs` | Backup & export |
158
+ | `app backup / export / exports / backup-logs` | Backup & export |
159
159
  | `app usage / logs` | Statistics and operation logs |
160
160
  | `app role …` | Role CRUD, permissions, members, leave-all, applications |
161
161
  | `app optionset …` | Option set CRUD and cross-app moves |
@@ -103,7 +103,6 @@ hap_cli/tests/__init__.py
103
103
  hap_cli/tests/conftest.py
104
104
  hap_cli/tests/test_app_editor.py
105
105
  hap_cli/tests/test_app_export_usage.py
106
- hap_cli/tests/test_app_restore.py
107
106
  hap_cli/tests/test_auth_prerelease.py
108
107
  hap_cli/tests/test_bug_036430.py
109
108
  hap_cli/tests/test_chart.py
@@ -1,123 +0,0 @@
1
- """Bugfix coverage for `hap app restore` (bug #036418).
2
-
3
- The wrapper forced ``--backup-id``, ``--file-url`` and ``--file-name`` to
4
- all be ``required`` at once, but the HAP UI actually has two mutually
5
- exclusive restore modes (traced from pd-openweb):
6
-
7
- - Restore from an existing backup log
8
- (``src/pages/AppSettings/components/appBackupRestore/components/BackupFiles.jsx``):
9
- sends ``{appId, projectId, id, autoEndMaintain, backupCurrentVersion,
10
- isRestoreNew}`` — NO fileUrl/fileName.
11
- - Restore from an uploaded file
12
- (``.../BackupFromFiles.jsx``): sends ``{appId, projectId, fileUrl,
13
- fileName, autoEndMaintain, backupCurrentVersion, isRestoreNew,
14
- containData}`` — NO id.
15
-
16
- So the user only ever has one of (backup-id) or (file-url) on hand;
17
- requiring both made the command impossible to run.
18
- """
19
-
20
- from unittest.mock import MagicMock, patch
21
-
22
- import pytest
23
- from click.testing import CliRunner
24
-
25
- from hap_cli.core import app as app_mod
26
- from hap_cli.core.session import Session
27
- from hap_cli.hap_cli import cli
28
-
29
-
30
- def _mock_response(data, state=1):
31
- resp = MagicMock()
32
- resp.status_code = 200
33
- resp.json.return_value = {"data": data, "state": state}
34
- resp.raise_for_status = MagicMock()
35
- return resp
36
-
37
-
38
- @pytest.fixture
39
- def mock_session():
40
- return Session(server_url="https://test.mingdao.com", auth_token="tok123")
41
-
42
-
43
- @pytest.fixture
44
- def logged_in(monkeypatch):
45
- sess = Session(server_url="https://test.mingdao.com", auth_token="tok123")
46
- sess.default_project_id = "org-default"
47
- monkeypatch.setattr("hap_cli.context.Session.load", lambda *a, **k: sess)
48
- return sess
49
-
50
-
51
- def _posted_body(mock_post):
52
- return mock_post.call_args[1]["json"]
53
-
54
-
55
- class TestRestoreCore:
56
- @patch("hap_cli.core.session.requests.post")
57
- def test_backup_mode_sends_id_not_file(self, mock_post, mock_session):
58
- mock_post.return_value = _mock_response(True)
59
- app_mod.restore_app(
60
- mock_session, "app1", "org1", backup_id="bk1", is_restore_new=True
61
- )
62
- body = _posted_body(mock_post)
63
- assert body["id"] == "bk1"
64
- assert "fileUrl" not in body
65
- assert "fileName" not in body
66
- assert body["appId"] == "app1"
67
- assert body["projectId"] == "org1"
68
- assert body["isRestoreNew"] is True
69
- assert body["autoEndMaintain"] is False
70
- assert body["backupCurrentVersion"] is False
71
-
72
- @patch("hap_cli.core.session.requests.post")
73
- def test_file_mode_sends_file_not_id(self, mock_post, mock_session):
74
- mock_post.return_value = _mock_response(True)
75
- app_mod.restore_app(
76
- mock_session,
77
- "app1",
78
- "org1",
79
- file_url="https://x/y.mdy",
80
- file_name="y.mdy",
81
- contain_data=True,
82
- )
83
- body = _posted_body(mock_post)
84
- assert body["fileUrl"] == "https://x/y.mdy"
85
- assert body["fileName"] == "y.mdy"
86
- assert body["containData"] is True
87
- assert "id" not in body
88
- assert body["autoEndMaintain"] is False
89
- assert body["backupCurrentVersion"] is False
90
-
91
- def test_requires_one_mode(self, mock_session):
92
- with pytest.raises(ValueError):
93
- app_mod.restore_app(mock_session, "app1", "org1")
94
-
95
-
96
- class TestRestoreCli:
97
- def test_backup_id_only_is_accepted(self, logged_in):
98
- with patch("hap_cli.core.session.requests.post") as mock_post:
99
- mock_post.return_value = _mock_response(True)
100
- res = CliRunner().invoke(
101
- cli, ["app", "restore", "app1", "--backup-id", "bk1"]
102
- )
103
- assert res.exit_code == 0, res.output
104
- assert _posted_body(mock_post)["id"] == "bk1"
105
-
106
- def test_file_url_only_is_accepted(self, logged_in):
107
- with patch("hap_cli.core.session.requests.post") as mock_post:
108
- mock_post.return_value = _mock_response(True)
109
- res = CliRunner().invoke(
110
- cli,
111
- [
112
- "app", "restore", "app1",
113
- "--file-url", "https://x/y.mdy",
114
- "--file-name", "y.mdy",
115
- ],
116
- )
117
- assert res.exit_code == 0, res.output
118
- assert _posted_body(mock_post)["fileUrl"] == "https://x/y.mdy"
119
-
120
- def test_neither_mode_errors(self, logged_in):
121
- res = CliRunner().invoke(cli, ["app", "restore", "app1"])
122
- assert res.exit_code != 0
123
- assert "backup-id" in res.output or "file-url" in res.output
File without changes
File without changes
File without changes