hap-cli 0.9.16__tar.gz → 0.9.17__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 (214) hide show
  1. {hap_cli-0.9.16 → hap_cli-0.9.17}/PKG-INFO +1 -1
  2. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/__init__.py +1 -1
  3. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/role_cmd.py +12 -3
  4. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/role.py +194 -2
  5. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/locale/messages.json +2 -2
  6. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/PKG-INFO +1 -1
  7. {hap_cli-0.9.16 → hap_cli-0.9.17}/MANIFEST.in +0 -0
  8. {hap_cli-0.9.16 → hap_cli-0.9.17}/README.md +0 -0
  9. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/README.md +0 -0
  10. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/README_CN.md +0 -0
  11. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/__main__.py +0 -0
  12. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/_entry.py +0 -0
  13. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/__init__.py +0 -0
  14. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/app_cmd.py +0 -0
  15. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/app_creator_cmd.py +0 -0
  16. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/app_editor_cmd.py +0 -0
  17. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/attachment_cmd.py +0 -0
  18. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/auth_cmd.py +0 -0
  19. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/calendar_cmd.py +0 -0
  20. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/chart_cmd.py +0 -0
  21. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/chat_cmd.py +0 -0
  22. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/chatbot_cmd.py +0 -0
  23. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/config_cmd.py +0 -0
  24. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/contact_cmd.py +0 -0
  25. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/department_cmd.py +0 -0
  26. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/group_cmd.py +0 -0
  27. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/guide_cmd.py +0 -0
  28. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/icon_cmd.py +0 -0
  29. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/instance_cmd.py +0 -0
  30. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/node_cmd.py +0 -0
  31. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/optionset_cmd.py +0 -0
  32. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/page_cmd.py +0 -0
  33. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/post_cmd.py +0 -0
  34. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/record_cmd.py +0 -0
  35. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/region_cmd.py +0 -0
  36. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/update_cmd.py +0 -0
  37. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/upload_cmd.py +0 -0
  38. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/v3_registry.py +0 -0
  39. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/workflow_cmd.py +0 -0
  40. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/commands/worksheet_cmd.py +0 -0
  41. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/context.py +0 -0
  42. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/__init__.py +0 -0
  43. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/action_spec_adapter.py +0 -0
  44. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app.py +0 -0
  45. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/__init__.py +0 -0
  46. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/_hapmeta/__init__.py +0 -0
  47. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/_hapmeta/control_type_codes.py +0 -0
  48. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/_hapmeta/worksheet_templates.py +0 -0
  49. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/charts.py +0 -0
  50. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/cleanup.py +0 -0
  51. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/compiler.py +0 -0
  52. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/config.py +0 -0
  53. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/design/design.schema.json +0 -0
  54. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/errors.py +0 -0
  55. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/examples/minimal.design.json +0 -0
  56. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/executor.py +0 -0
  57. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/fields.py +0 -0
  58. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/hap.py +0 -0
  59. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/merge.py +0 -0
  60. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/recording/__init__.py +0 -0
  61. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/recording/console.py +0 -0
  62. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/recording/jsonl.py +0 -0
  63. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/recording/mirror.py +0 -0
  64. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/recording/report.py +0 -0
  65. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/schema.py +0 -0
  66. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/INSTRUCTIONS.md +0 -0
  67. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/__init__.py +0 -0
  68. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/cli.py +0 -0
  69. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/executor.py +0 -0
  70. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/resources/attachments.json +0 -0
  71. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/resources/sample.docx +0 -0
  72. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/resources/sample.pdf +0 -0
  73. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/resources/sample_images.json +0 -0
  74. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/seed/template.py +0 -0
  75. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/selftest.py +0 -0
  76. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/smoke.py +0 -0
  77. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/steps.py +0 -0
  78. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/store.py +0 -0
  79. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/validate.py +0 -0
  80. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/app_creator/workflow_dsl.py +0 -0
  81. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/attachment.py +0 -0
  82. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/auth.py +0 -0
  83. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/calendar_mod.py +0 -0
  84. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/chart.py +0 -0
  85. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/chat.py +0 -0
  86. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/chatbot.py +0 -0
  87. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/cli_access.py +0 -0
  88. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/condition_dsl.py +0 -0
  89. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/contact.py +0 -0
  90. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/control_type_codes.py +0 -0
  91. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/department.py +0 -0
  92. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/__init__.py +0 -0
  93. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/_hapmeta/__init__.py +0 -0
  94. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/_hapmeta/control_type_codes.py +0 -0
  95. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/apply.py +0 -0
  96. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/componentlower.py +0 -0
  97. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/editspec/component.schema.json +0 -0
  98. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/editspec/custom-action.schema.json +0 -0
  99. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/editspec/envelope.schema.json +0 -0
  100. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/editspec/field.schema.json +0 -0
  101. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/editspec.py +0 -0
  102. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/errors.py +0 -0
  103. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/fieldlower.py +0 -0
  104. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/jsonschema_mini.py +0 -0
  105. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/models.py +0 -0
  106. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/ops.py +0 -0
  107. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/planner.py +0 -0
  108. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/editor/reader.py +0 -0
  109. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/field_normalizer.py +0 -0
  110. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/field_spec_adapter.py +0 -0
  111. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/filter_translator.py +0 -0
  112. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/filter_v3.py +0 -0
  113. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/flow_node.py +0 -0
  114. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/global_meta.py +0 -0
  115. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/group.py +0 -0
  116. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/guide.py +0 -0
  117. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/icon_index.py +0 -0
  118. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/instance.py +0 -0
  119. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/layout_check.py +0 -0
  120. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/logger.py +0 -0
  121. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/money_currency.py +0 -0
  122. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/optionset.py +0 -0
  123. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/page.py +0 -0
  124. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/post.py +0 -0
  125. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record.py +0 -0
  126. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record_defaults.py +0 -0
  127. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record_discussions.py +0 -0
  128. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record_form_checks.py +0 -0
  129. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record_lookups.py +0 -0
  130. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/record_rules.py +0 -0
  131. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/relation_scope.py +0 -0
  132. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/relogin.py +0 -0
  133. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/response_crypto.py +0 -0
  134. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/role_perm_builder.py +0 -0
  135. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/rule_spec_adapter.py +0 -0
  136. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/session.py +0 -0
  137. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/token_crypto.py +0 -0
  138. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/update.py +0 -0
  139. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/upload.py +0 -0
  140. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/v3/__init__.py +0 -0
  141. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/v3/dispatcher.py +0 -0
  142. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/v3/render.py +0 -0
  143. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/v3/schema.py +0 -0
  144. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/view_spec_adapter.py +0 -0
  145. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/workflow.py +0 -0
  146. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/workflow_node_dsl.py +0 -0
  147. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/worksheet.py +0 -0
  148. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/worksheet_form.py +0 -0
  149. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/worksheet_reference.py +0 -0
  150. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/core/worksheet_templates.py +0 -0
  151. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/approval.md +0 -0
  152. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/chart.md +0 -0
  153. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/messages.md +0 -0
  154. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/overview.md +0 -0
  155. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/post.md +0 -0
  156. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/record.md +0 -0
  157. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/setup.md +0 -0
  158. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/skills.md +0 -0
  159. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/workflow.md +0 -0
  160. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/en/worksheet.md +0 -0
  161. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/index.json +0 -0
  162. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/approval.md +0 -0
  163. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/chart.md +0 -0
  164. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/messages.md +0 -0
  165. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/overview.md +0 -0
  166. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/post.md +0 -0
  167. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/record.md +0 -0
  168. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/setup.md +0 -0
  169. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/skills.md +0 -0
  170. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/workflow.md +0 -0
  171. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/guide/zh-Hans/worksheet.md +0 -0
  172. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/i18n.py +0 -0
  173. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/locale/__init__.py +0 -0
  174. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/locale/messages.schema.json +0 -0
  175. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/__init__.py +0 -0
  176. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/atomic_write.py +0 -0
  177. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/confirm.py +0 -0
  178. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/formatting.py +0 -0
  179. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/options.py +0 -0
  180. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli/utils/parameter_mapping.py +0 -0
  181. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/SOURCES.txt +0 -0
  182. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/dependency_links.txt +0 -0
  183. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/entry_points.txt +0 -0
  184. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/requires.txt +0 -0
  185. {hap_cli-0.9.16 → hap_cli-0.9.17}/hap_cli.egg-info/top_level.txt +0 -0
  186. {hap_cli-0.9.16 → hap_cli-0.9.17}/setup.cfg +0 -0
  187. {hap_cli-0.9.16 → hap_cli-0.9.17}/setup.py +0 -0
  188. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/INDEX.json +0 -0
  189. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/add_member_to_role.yaml +0 -0
  190. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/batch_delete_records.yaml +0 -0
  191. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/create_optionset.yaml +0 -0
  192. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/create_role.yaml +0 -0
  193. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/delete_optionset.yaml +0 -0
  194. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/delete_record.yaml +0 -0
  195. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/delete_role.yaml +0 -0
  196. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/delete_worksheet.yaml +0 -0
  197. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_app_info.yaml +0 -0
  198. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_app_knowledge_list.yaml +0 -0
  199. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_app_worksheets_list.yaml +0 -0
  200. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_optionset_list.yaml +0 -0
  201. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_details.yaml +0 -0
  202. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_discussions.yaml +0 -0
  203. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_list.yaml +0 -0
  204. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_logs.yaml +0 -0
  205. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_pivot_data.yaml +0 -0
  206. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_relations.yaml +0 -0
  207. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_record_share_link.yaml +0 -0
  208. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_regions.yaml +0 -0
  209. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_role_details.yaml +0 -0
  210. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/get_role_list.yaml +0 -0
  211. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/knowledge_search.yaml +0 -0
  212. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/leave_all_roles.yaml +0 -0
  213. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/remove_member_from_role.yaml +0 -0
  214. {hap_cli-0.9.16 → hap_cli-0.9.17}/sources/v3-api-schema/update_optionset.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hap-cli
3
- Version: 0.9.16
3
+ Version: 0.9.17
4
4
  Summary: CLI harness for Mingdao HAP - Enterprise no-code platform
5
5
  Author: hap-cli
6
6
  License: Apache-2.0
@@ -3,7 +3,7 @@
3
3
  import sys as _sys
4
4
  import types as _types
5
5
 
6
- __version__ = "0.9.16"
6
+ __version__ = "0.9.17"
7
7
 
8
8
  # The command tree used to live in hap_cli/hap_cli.py. A module named
9
9
  # after the package it sits in shadows that package: run python with the
@@ -9,6 +9,7 @@ from hap_cli.core import role as role_mod
9
9
  from hap_cli.utils.formatting import output_json, output_kv, output_table
10
10
  from hap_cli.i18n import t
11
11
  from hap_cli.utils.confirm import confirm_or_abort
12
+ from hap_cli.utils.options import json_arg
12
13
 
13
14
 
14
15
  @click.group(help=t('Role management.'))
@@ -189,8 +190,16 @@ def role_permissions(ctx, app_id, role_id):
189
190
  @click.argument("app_id")
190
191
  @click.argument("role_id")
191
192
  @click.option("--permissions", "-P", default="",
192
- help="Per-worksheet permission rules as a JSON array "
193
- "(only used with --permission-way 0)")
193
+ help="Per-worksheet rules as a JSON array, or @file to read "
194
+ "them from a file (only used with --permission-way 0). "
195
+ 'Each rule: {"id": <worksheet id>, "recordDataScope": '
196
+ '{"read": ..., "edit": ..., "delete": ...}}, each 0 '
197
+ "(none), 20 (own records), 30 (own and subordinates') or "
198
+ "100 (all), plus optional recordActions / "
199
+ "worksheetActions / paymentActions as 'app role "
200
+ "permissions' shows them. Worksheets not listed keep "
201
+ "their current per-worksheet access; a role switching "
202
+ "to per-worksheet rules starts with none.")
194
203
  @click.option("--permission-way", type=int, default=0,
195
204
  help="Permission level: 0=custom (per-worksheet rules), "
196
205
  "20=view all records, 30=manage own records, "
@@ -200,7 +209,7 @@ def role_set_permissions(ctx, app_id, role_id, permissions, permission_way):
200
209
  """Edit role permissions."""
201
210
  try:
202
211
  session = ctx.get_session()
203
- sheets = json.loads(permissions) if permissions else None
212
+ sheets = json_arg(permissions, what="permissions")
204
213
  data = role_mod.set_role_permissions(
205
214
  session, app_id, role_id,
206
215
  permission_way=permission_way, sheets=sheets,
@@ -1,9 +1,13 @@
1
1
  """Role management module for Mingdao HAP."""
2
2
 
3
+ import copy
4
+ import logging
3
5
  from typing import Any, Optional
4
6
 
5
7
  from hap_cli.core.session import Session, require_code
6
8
 
9
+ logger = logging.getLogger("hap_cli.role")
10
+
7
11
 
8
12
  def get_roles(
9
13
  session: Session,
@@ -256,7 +260,8 @@ def set_role_permissions(
256
260
  model["permissionWay"] = permission_way
257
261
  if permission_way == 0:
258
262
  if sheets is not None:
259
- model["sheets"] = sheets
263
+ model["sheets"] = apply_sheet_rules(model.get("sheets") or [],
264
+ sheets)
260
265
  else:
261
266
  model.pop("sheets", None)
262
267
  data: dict[str, Any] = {
@@ -265,10 +270,197 @@ def set_role_permissions(
265
270
  project_id = project_id or str(model.get("projectId") or "")
266
271
  if project_id:
267
272
  data["projectId"] = project_id
268
- return require_code(
273
+ result = require_code(
269
274
  session.api_call("AppManagement", "EditAppRole", data),
270
275
  action="permission change", meanings=_ROLE_SAVE_MEANINGS,
271
276
  )
277
+ if permission_way == 0 and sheets:
278
+ _check_sheet_access_saved(session, app_id, role_id, model["sheets"],
279
+ sheets)
280
+ return result
281
+
282
+
283
+ # ── Per-worksheet rules ──────────────────────────────────────────────────
284
+ #
285
+ # The role model's ``sheets[]`` is not where a rule can be written as-is
286
+ # (bug #456396). Whether a role sees, edits or deletes in a worksheet is
287
+ # decided per view — ``views[].canRead / canEdit / canRemove`` — and the
288
+ # ``readLevel / editLevel / removeLevel`` beside them only say which
289
+ # records (20 own, 30 own and subordinates', 100 all): pd-openweb
290
+ # src/pages/Role/component/RoleSet/SheetTable.jsx changeSheetModel and
291
+ # TooltipSetting/sheetSet.jsx, MDPublic identical. Saving rules verbatim
292
+ # replaced the stored list with entries the server cannot read, and every
293
+ # worksheet came back unchecked.
294
+ #
295
+ # The rule shape accepted is the one ``app role permissions`` reads and
296
+ # ``app role create`` takes (V3 worksheetPermissions,
297
+ # sources/v3-api-schema/create_role.yaml): ``{id, recordDataScope:
298
+ # {read, edit, delete}, recordActions?, worksheetActions?,
299
+ # paymentActions?}``. It is merged onto the stored worksheet, so a
300
+ # worksheet not named keeps what it had. The product's own entry — one
301
+ # that carries ``sheetId`` and ``views`` — still round-trips unchanged.
302
+
303
+ _SCOPES = (0, 20, 30, 100)
304
+ _RULE_KEYS = {"id", "name", "recordDataScope", "recordActions",
305
+ "worksheetActions", "paymentActions"}
306
+ # V3 action name -> the role model's per-worksheet switch. ``add`` is the
307
+ # editor's "add" checkbox, ``canAdd``.
308
+ _RECORD_ACTIONS = {"share": "recordShare", "discuss": "recordDiscussion",
309
+ "systemPrint": "recordSystemPrinting",
310
+ "attachmentDownload": "recordAttachmentDownload",
311
+ "log": "recordLogging"}
312
+ _WORKSHEET_ACTIONS = {"shareView": "worksheetShareView",
313
+ "import": "worksheetImport",
314
+ "export": "worksheetExport",
315
+ "discuss": "worksheetDiscuss",
316
+ "batchOperation": "worksheetBatchOperation"}
317
+ _PAYMENT_ACTIONS = {"pay": "payment"}
318
+
319
+
320
+ def _rule_error(i: int, what: str) -> ValueError:
321
+ return ValueError(f"Worksheet rule {i}: {what}")
322
+
323
+
324
+ def _set_switch(sheet: dict[str, Any], key: str, enable: Any) -> None:
325
+ current = sheet.get(key)
326
+ sheet[key] = {**(current if isinstance(current, dict) else
327
+ {"range": 1, "allowExport": False}),
328
+ "enable": bool(enable)}
329
+
330
+
331
+ def _apply_actions(sheet: dict[str, Any], i: int, block: Any, name: str,
332
+ mapping: dict[str, str], extra: tuple = ()) -> None:
333
+ if block is None:
334
+ return
335
+ if not isinstance(block, dict):
336
+ raise _rule_error(i, f"'{name}' must be an object.")
337
+ allowed = set(mapping) | set(extra)
338
+ unknown = sorted(set(block) - allowed)
339
+ if unknown:
340
+ raise _rule_error(
341
+ i, f"'{name}' does not take {', '.join(map(repr, unknown))}. "
342
+ f"It takes: {', '.join(sorted(allowed))}.")
343
+ for key, value in block.items():
344
+ if key in mapping:
345
+ _set_switch(sheet, mapping[key], value)
346
+
347
+
348
+ def _apply_rule(sheet: dict[str, Any], rule: dict[str, Any],
349
+ i: int) -> dict[str, Any]:
350
+ scope = rule.get("recordDataScope")
351
+ if not isinstance(scope, dict):
352
+ raise _rule_error(
353
+ i, "needs 'recordDataScope': {\"read\", \"edit\", \"delete\"}, "
354
+ "each 0 (none), 20 (own records), 30 (own and "
355
+ "subordinates') or 100 (all records).")
356
+ levels = {}
357
+ for key in ("read", "edit", "delete"):
358
+ value = scope.get(key, 0)
359
+ if isinstance(value, bool) or value not in _SCOPES:
360
+ raise _rule_error(
361
+ i, f"recordDataScope.{key} is {value!r}; use 0, 20, 30 or "
362
+ f"100.")
363
+ levels[key] = value
364
+ if levels["read"] == 0 and (levels["edit"] or levels["delete"]):
365
+ raise _rule_error(
366
+ i, "a worksheet the role cannot read cannot be edited or "
367
+ "deleted in either; set read above 0, or edit and delete "
368
+ "to 0.")
369
+ out = copy.deepcopy(sheet)
370
+ read, edit, delete = (levels[k] > 0 for k in ("read", "edit", "delete"))
371
+ out["views"] = [{**v, "canRead": read, "canEdit": edit,
372
+ "canRemove": delete}
373
+ for v in (out.get("views") or []) if isinstance(v, dict)]
374
+ for key, level in (("readLevel", "read"), ("editLevel", "edit"),
375
+ ("removeLevel", "delete")):
376
+ if levels[level]:
377
+ out[key] = levels[level]
378
+ record_actions = rule.get("recordActions")
379
+ _apply_actions(out, i, record_actions, "recordActions",
380
+ _RECORD_ACTIONS, extra=("add",))
381
+ if isinstance(record_actions, dict) and "add" in record_actions:
382
+ out["canAdd"] = bool(record_actions["add"])
383
+ if not read:
384
+ # changeSheetModel clears "add" along with "view".
385
+ out["canAdd"] = False
386
+ _apply_actions(out, i, rule.get("worksheetActions"), "worksheetActions",
387
+ _WORKSHEET_ACTIONS)
388
+ _apply_actions(out, i, rule.get("paymentActions"), "paymentActions",
389
+ _PAYMENT_ACTIONS)
390
+ return out
391
+
392
+
393
+ def apply_sheet_rules(stored: list[dict[str, Any]],
394
+ rules: Any) -> list[dict[str, Any]]:
395
+ """The role model's ``sheets`` with ``rules`` merged in."""
396
+ if not isinstance(rules, list):
397
+ raise ValueError("Worksheet rules must be a JSON array.")
398
+ by_id = {s.get("sheetId"): s for s in stored if isinstance(s, dict)}
399
+ updated: dict[str, dict[str, Any]] = {}
400
+ for i, rule in enumerate(rules, start=1):
401
+ if not isinstance(rule, dict):
402
+ raise _rule_error(i, "must be an object.")
403
+ if "sheetId" in rule:
404
+ if not isinstance(rule.get("views"), list):
405
+ raise _rule_error(
406
+ i, "an entry naming 'sheetId' is the role editor's own "
407
+ "form and has to carry its 'views' — that is where "
408
+ "view, edit and delete access is decided. Write "
409
+ "{\"id\": <worksheet id>, \"recordDataScope\": "
410
+ "{...}} instead.")
411
+ if rule["sheetId"] not in by_id:
412
+ raise _rule_error(
413
+ i, f"worksheet {rule['sheetId']!r} is not in this "
414
+ f"role's application.")
415
+ updated[rule["sheetId"]] = rule
416
+ continue
417
+ unknown = sorted(set(rule) - _RULE_KEYS)
418
+ if unknown or not rule.get("id"):
419
+ raise _rule_error(
420
+ i, (f"does not take {', '.join(map(repr, unknown))}. "
421
+ if unknown else "needs the worksheet 'id'. ")
422
+ + "A rule is {\"id\": <worksheet id>, \"recordDataScope\": "
423
+ "{\"read\", \"edit\", \"delete\"}} plus optional "
424
+ "recordActions / worksheetActions / paymentActions — the "
425
+ "shape 'app role permissions' shows.")
426
+ sheet_id = rule["id"]
427
+ if sheet_id not in by_id:
428
+ raise _rule_error(
429
+ i, f"worksheet {sheet_id!r} is not in this role's "
430
+ f"application.")
431
+ updated[sheet_id] = _apply_rule(updated.get(sheet_id) or
432
+ by_id[sheet_id], rule, i)
433
+ return [updated.get(s.get("sheetId"), s) if isinstance(s, dict) else s
434
+ for s in stored]
435
+
436
+
437
+ def _view_access(sheet: dict[str, Any]) -> list[tuple]:
438
+ return [(v.get("viewId"), bool(v.get("canRead")), bool(v.get("canEdit")),
439
+ bool(v.get("canRemove")))
440
+ for v in sheet.get("views") or [] if isinstance(v, dict)]
441
+
442
+
443
+ def _check_sheet_access_saved(session: Session, app_id: str, role_id: str,
444
+ sent: list[dict[str, Any]],
445
+ rules: list[dict[str, Any]]) -> None:
446
+ """Re-read the role: the save answers success either way."""
447
+ named = {r.get("id") or r.get("sheetId") for r in rules
448
+ if isinstance(r, dict)}
449
+ after = get_role_detail(session, app_id, role_id)
450
+ stored = {s.get("sheetId"): s for s in
451
+ (after.get("sheets") if isinstance(after, dict) else None) or []
452
+ if isinstance(s, dict)}
453
+ wrong = [s.get("sheetName") or s.get("sheetId") for s in sent
454
+ if isinstance(s, dict) and s.get("sheetId") in named
455
+ and _view_access(stored.get(s.get("sheetId")) or {})
456
+ != _view_access(s)]
457
+ if wrong:
458
+ logger.warning("role %s: worksheet access not saved for %s",
459
+ role_id, wrong)
460
+ raise ValueError(
461
+ f"The role was saved, but reading it back shows different "
462
+ f"access on: {', '.join(map(str, wrong))}. Check the role in "
463
+ f"the role editor.")
272
464
 
273
465
 
274
466
  def set_role_chatbots(
@@ -1920,8 +1920,8 @@
1920
1920
  "zh-Hans": "权限级别:0=自定义(按工作表规则),20=查看全部记录,30=管理本人记录,50=查看全部 + 管理本人,80=管理全部记录"
1921
1921
  },
1922
1922
  "app role set-permissions --permissions": {
1923
- "en": "Per-worksheet permission rules as a JSON array (only used with --permission-way 0)",
1924
- "zh-Hans": "按工作表的权限规则,JSON 数组形式(仅在 --permission-way 0 时使用)"
1923
+ "en": "Per-worksheet rules as a JSON array, or @file to read them from a file (only used with --permission-way 0). Each rule: {\"id\": <worksheet id>, \"recordDataScope\": {\"read\": ..., \"edit\": ..., \"delete\": ...}}, each 0 (none), 20 (own records), 30 (own and subordinates') or 100 (all), plus optional recordActions / worksheetActions / paymentActions as 'app role permissions' shows them. Worksheets not listed keep their current per-worksheet access; a role switching to per-worksheet rules starts with none.",
1924
+ "zh-Hans": "按工作表的权限规则,JSON 数组,或写 @文件 从文件读取(仅在 --permission-way 0 时使用)。每条规则:{\"id\": <工作表 ID>, \"recordDataScope\": {\"read\": ..., \"edit\": ..., \"delete\": ...}},取值 0(无)、20(本人的记录)、30(本人及下属的)或 100(全部),可另加 recordActions / worksheetActions / paymentActions,写法与 'app role permissions' 读出的一致。没有列出的工作表保持原有的按表权限;从统一权限切换到按表授权的角色,起初没有任何工作表的权限。"
1925
1925
  },
1926
1926
  "app select": {
1927
1927
  "en": "Set the default application used when --app-id is omitted.",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hap-cli
3
- Version: 0.9.16
3
+ Version: 0.9.17
4
4
  Summary: CLI harness for Mingdao HAP - Enterprise no-code platform
5
5
  Author: hap-cli
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes