@lovrabet/lovrabet-cli 2.2.4 → 2.2.5-beta.2

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 (160) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/notification/config-list.js +1 -1
  36. package/lib/commands/notification/index.js +1 -1
  37. package/lib/commands/notification/shared.js +1 -1
  38. package/lib/commands/ocr/index.js +1 -1
  39. package/lib/commands/permit/dataset-get.js +1 -1
  40. package/lib/commands/permit/dataset-set.js +1 -1
  41. package/lib/commands/permit/index.js +1 -1
  42. package/lib/commands/permit/page-get.js +1 -1
  43. package/lib/commands/permit/page-set.js +1 -1
  44. package/lib/commands/permit/role-menus-set.js +1 -1
  45. package/lib/commands/permit/role-menus.js +1 -1
  46. package/lib/commands/permit/shared.js +1 -1
  47. package/lib/commands/personal-bff/index.js +1 -1
  48. package/lib/commands/registry.js +1 -1
  49. package/lib/commands/role/create.js +1 -1
  50. package/lib/commands/role/delete.js +1 -1
  51. package/lib/commands/role/detail.js +1 -1
  52. package/lib/commands/role/index.js +1 -1
  53. package/lib/commands/role/list.js +1 -1
  54. package/lib/commands/role/shared.js +1 -1
  55. package/lib/commands/role/update.js +1 -1
  56. package/lib/commands/role/user-add.js +1 -1
  57. package/lib/commands/role/user-remove.js +1 -1
  58. package/lib/commands/schedule/index.js +1 -1
  59. package/lib/commands/schema.js +1 -1
  60. package/lib/commands/service/dynamic.js +1 -1
  61. package/lib/commands/service/function-name-adapter.js +1 -1
  62. package/lib/commands/service/index.js +1 -1
  63. package/lib/commands/service/registry.js +1 -1
  64. package/lib/commands/skill/commands/create.js +1 -1
  65. package/lib/commands/skill/commands/diagram.js +1 -1
  66. package/lib/commands/skill/commands/install.js +1 -1
  67. package/lib/commands/skill/commands/list.js +1 -1
  68. package/lib/commands/skill/commands/push.js +1 -1
  69. package/lib/commands/skill/commands/validate.js +1 -1
  70. package/lib/commands/skill/diagram.js +1 -1
  71. package/lib/commands/skill/flags.js +1 -1
  72. package/lib/commands/skill/index.js +1 -1
  73. package/lib/commands/skill/manifest-helpers.js +1 -1
  74. package/lib/commands/skill/push-execute.js +1 -1
  75. package/lib/commands/skill/push-flow-helpers.js +1 -1
  76. package/lib/commands/skill/push-retarget.js +1 -1
  77. package/lib/commands/skill/scopes.js +1 -1
  78. package/lib/commands/skill/summary.js +1 -1
  79. package/lib/commands/skill/templates.js +1 -1
  80. package/lib/commands/skill/validate.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/update.js +1 -1
  85. package/lib/commands/user-account/bind.js +1 -1
  86. package/lib/commands/user-account/index.js +1 -1
  87. package/lib/commands/workspace/index.js +1 -1
  88. package/lib/config/schema.js +1 -1
  89. package/lib/constant/app.js +1 -1
  90. package/lib/constant/auth-mode.js +1 -1
  91. package/lib/constant/cli.js +1 -1
  92. package/lib/constant/defaults.js +1 -1
  93. package/lib/constant/distribution.js +1 -1
  94. package/lib/constant/domain.js +1 -1
  95. package/lib/constant/env.js +1 -1
  96. package/lib/constant/output.js +1 -1
  97. package/lib/constant/product.js +1 -1
  98. package/lib/constant/risk.js +1 -1
  99. package/lib/constant/url.js +1 -1
  100. package/lib/context.js +1 -1
  101. package/lib/core/api-client.js +1 -1
  102. package/lib/core/db-resolver.js +1 -1
  103. package/lib/core/sdk-client.js +1 -1
  104. package/lib/errors.js +1 -1
  105. package/lib/framework/build-all-flags.js +1 -1
  106. package/lib/framework/dryrun.js +1 -1
  107. package/lib/framework/flags.js +1 -1
  108. package/lib/framework/help.js +1 -1
  109. package/lib/framework/index.js +1 -1
  110. package/lib/framework/output.js +1 -1
  111. package/lib/framework/preparse.js +1 -1
  112. package/lib/framework/rate-limit.js +1 -1
  113. package/lib/framework/raw-flags.js +1 -1
  114. package/lib/framework/response.js +1 -1
  115. package/lib/framework/runner-confirmation.js +1 -1
  116. package/lib/framework/runner-error.js +1 -1
  117. package/lib/framework/runner.js +1 -1
  118. package/lib/framework/schema-export.js +1 -1
  119. package/lib/framework/service-order.js +1 -1
  120. package/lib/framework/types.js +1 -1
  121. package/lib/generated/build-info.d.ts +4 -4
  122. package/lib/generated/build-info.js +1 -1
  123. package/lib/help.js +1 -1
  124. package/lib/postinstall.js +1 -1
  125. package/lib/runtime/confirmation.js +1 -1
  126. package/lib/runtime/event.js +1 -1
  127. package/lib/runtime/index.js +1 -1
  128. package/lib/runtime/queue.js +1 -1
  129. package/lib/runtime/resolve.js +1 -1
  130. package/lib/skills/builtin-skill.js +1 -1
  131. package/lib/skills/npx-skills-add.js +1 -1
  132. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  133. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  134. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  135. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  136. package/lib/skills/runtime-skill-sync/links.js +1 -1
  137. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  138. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  139. package/lib/skills/runtime-skill-sync/materialize.d.ts +7 -0
  140. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  141. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  142. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  143. package/lib/skills/runtime-skill-sync/push.js +1 -1
  144. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  145. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  146. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  147. package/lib/skills/runtime-skill-sync.d.ts +1 -1
  148. package/lib/skills/runtime-skill-sync.js +1 -1
  149. package/lib/skills/skill-presence.js +1 -1
  150. package/lib/utils/apply-jq-filter.js +1 -1
  151. package/lib/utils/logger.js +1 -1
  152. package/lib/utils/lossless-json.js +1 -1
  153. package/lib/utils/params.js +1 -1
  154. package/lib/utils/platform.js +1 -1
  155. package/lib/utils/update-notice.js +1 -1
  156. package/lib/utils/version.js +1 -1
  157. package/lib/utils/write-cli-side-channel.js +1 -1
  158. package/package.json +1 -1
  159. package/skills/lovrabet/SKILL.md +1 -1
  160. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a43_0x49c5a3=a43_0x7060;(function(_0xc50add,_0x13d34e){const _0x10b3e9=a43_0x7060,_0x4dcb59=_0xc50add();while(!![]){try{const _0x55a17e=parseInt(_0x10b3e9(0x1e4))/0x1+parseInt(_0x10b3e9(0x1eb))/0x2+parseInt(_0x10b3e9(0x1d6))/0x3+parseInt(_0x10b3e9(0x1d8))/0x4*(-parseInt(_0x10b3e9(0x1dc))/0x5)+-parseInt(_0x10b3e9(0x1bf))/0x6*(-parseInt(_0x10b3e9(0x1da))/0x7)+-parseInt(_0x10b3e9(0x1bd))/0x8+parseInt(_0x10b3e9(0x1cd))/0x9*(-parseInt(_0x10b3e9(0x1c5))/0xa);if(_0x55a17e===_0x13d34e)break;else _0x4dcb59['push'](_0x4dcb59['shift']());}catch(_0x4bfaaa){_0x4dcb59['push'](_0x4dcb59['shift']());}}}(a43_0x4dae,0xd562d));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';function a43_0x7060(_0x292dc2,_0x254870){_0x292dc2=_0x292dc2-0x1bc;const _0x4dae24=a43_0x4dae();let _0x7060c0=_0x4dae24[_0x292dc2];return _0x7060c0;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{applyRuntimeRolePermission,assertGrantOrRevoke,assertRuntimePermissionManager,assertRuntimePermitRoleConfigurable,flattenRuntimeMenuRolePermits,GRANT_FLAG,menuPermitDto,REVOKE_FLAG,ROLE_REF_FLAG,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';function a43_0x4dae(){const _0x4d2104=['roles','183922GdGfma','before','operation','9853960oUqjeG','description','2233878UhDzOL','length','授予或收回目标角色对指定运行菜单的访问权限;变更会影响该角色用户的菜单可见性。','appCode','string','--menus','1687730CQHMrV','\x20selected\x20runtime\x20menus','test','/client/permit/resource/batch-save-menu','warnings','map','Comma-separated\x20runtime\x20menu\x20IDs','POST','99XhOTbv','\x20was\x20not\x20found.','str','find','menuIds','validation','role','build','push','5134563UDOuDy','bool','2125568qbWWNd','body','21CXRbcw','rolePermit','5fXwwHo','changed','Invalid\x20runtime\x20menu\x20ID:\x20','\x20for\x20role\x20','permitList','isSafeInteger','menus','role-menus-set','1573248gUItbF','\x20already\x20reflects\x20','permit','Runtime\x20menu\x20','after','grant'];a43_0x4dae=function(){return _0x4d2104;};return a43_0x4dae();}const MENUS_FLAG={'name':a43_0x49c5a3(0x1e2),'type':a43_0x49c5a3(0x1c3),'required':!![],'description':a43_0x49c5a3(0x1cb)};async function prepare(_0x1b2dae){const _0x2cfbe2=a43_0x49c5a3;await assertRuntimePermissionManager(_0x1b2dae[_0x2cfbe2(0x1c2)]);const _0x283963=assertGrantOrRevoke(_0x1b2dae[_0x2cfbe2(0x1d7)](_0x2cfbe2(0x1e9)),_0x1b2dae[_0x2cfbe2(0x1d7)]('revoke')),_0x5b3c91=await resolveRuntimeRoleRef(_0x1b2dae[_0x2cfbe2(0x1c2)],_0x1b2dae['str']('role'));assertRuntimePermitRoleConfigurable(_0x5b3c91);const _0x27d4a2=[...new Set(splitRefs(_0x1b2dae[_0x2cfbe2(0x1cf)](_0x2cfbe2(0x1e2)),_0x2cfbe2(0x1c4))[_0x2cfbe2(0x1ca)](_0x497eef=>{const _0xe4ed3=_0x2cfbe2,_0x3591b4=Number(_0x497eef);if(!/^\d+$/[_0xe4ed3(0x1c7)](_0x497eef)||!Number[_0xe4ed3(0x1e1)](_0x3591b4)||_0x3591b4<=0x0)throw CliErrors[_0xe4ed3(0x1d2)](_0xe4ed3(0x1de)+_0x497eef+'.');return _0x3591b4;}))],_0xf14fd0=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x1b2dae[_0x2cfbe2(0x1c2)])),_0x49a273=await listRuntimePermitRoles(_0x1b2dae['appCode']),_0xaa8089=[],_0x81fc7c=[],_0x25b668=[],_0x101d7c=[];for(const _0x21759d of _0x27d4a2){const _0x53f0de=_0xf14fd0[_0x2cfbe2(0x1d0)](_0x1d70e0=>_0x1d70e0['id']===_0x21759d);if(!_0x53f0de)throw CliErrors[_0x2cfbe2(0x1d2)]('Runtime\x20menu\x20'+_0x21759d+_0x2cfbe2(0x1ce));const _0x54dd37=applyRuntimeRolePermission(_0x53f0de[_0x2cfbe2(0x1db)],_0x5b3c91,_0x49a273,_0x283963);_0x81fc7c[_0x2cfbe2(0x1d5)]({'menuId':_0x21759d,'rolePermit':_0x53f0de[_0x2cfbe2(0x1db)]}),_0x25b668[_0x2cfbe2(0x1d5)]({'menuId':_0x21759d,'rolePermit':_0x54dd37['roles']});if(_0x54dd37[_0x2cfbe2(0x1dd)])_0xaa8089[_0x2cfbe2(0x1d5)](menuPermitDto(_0x1b2dae['appCode'],_0x53f0de,_0x54dd37[_0x2cfbe2(0x1ea)]));else _0x101d7c[_0x2cfbe2(0x1d5)](_0x2cfbe2(0x1e7)+_0x21759d+_0x2cfbe2(0x1e5)+_0x283963+_0x2cfbe2(0x1df)+_0x5b3c91['id']+'.');}return{'operation':_0x283963,'role':_0x5b3c91,'menuIds':_0x27d4a2,'permitList':_0xaa8089,'before':_0x81fc7c,'after':_0x25b668,'warnings':_0x101d7c};}export const permitRoleMenusSet={'service':a43_0x49c5a3(0x1e6),'command':a43_0x49c5a3(0x1e3),'description':'Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','risk':'high-risk-write','confirmationDescription':a43_0x49c5a3(0x1c1),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0x2881c6){const _0x46fbe2=a43_0x49c5a3;assertGrantOrRevoke(_0x2881c6[_0x46fbe2(0x1d7)](_0x46fbe2(0x1e9)),_0x2881c6[_0x46fbe2(0x1d7)]('revoke'));},async 'dryRun'(_0x3ba950){const _0x4a5cb7=a43_0x49c5a3,_0x313158=await prepare(_0x3ba950);return dryRun('POST',_0x4a5cb7(0x1c8))[_0x4a5cb7(0x1d9)]({'appCode':_0x3ba950['appCode'],'permitList':_0x313158['permitList']})[_0x4a5cb7(0x1be)]('Preview:\x20'+_0x313158[_0x4a5cb7(0x1bc)]+_0x4a5cb7(0x1c6))[_0x4a5cb7(0x1d4)]();},async 'execute'(_0x175961){const _0x6d5526=a43_0x49c5a3,_0xaeeaeb=await prepare(_0x175961);return _0xaeeaeb['permitList'][_0x6d5526(0x1c0)]>0x0&&await saveRuntimeMenuRolePermits(_0x175961['appCode'],_0xaeeaeb[_0x6d5526(0x1e0)]),{'ok':!![],'data':runtimePermitWriteResult('menu-'+_0xaeeaeb['operation'],{'roleId':_0xaeeaeb[_0x6d5526(0x1d3)]['id'],'menuIds':_0xaeeaeb[_0x6d5526(0x1d1)]},_0xaeeaeb[_0x6d5526(0x1ec)],_0xaeeaeb[_0x6d5526(0x1e8)],{'method':_0x6d5526(0x1cc),'path':_0x6d5526(0x1c8)},_0xaeeaeb[_0x6d5526(0x1c9)])};}};
1
+ function a43_0x3e1b(_0x1e2ac6,_0x4a44d8){_0x1e2ac6=_0x1e2ac6-0x13d;const _0x17ad46=a43_0x17ad();let _0x3e1bcf=_0x17ad46[_0x1e2ac6];return _0x3e1bcf;}function a43_0x17ad(){const _0x23ebc2=['isSafeInteger','changed','323460BHcQHW','rolePermit','\x20selected\x20runtime\x20menus','231704wcjJEu','menus','grant','menu-','384040EtQunn','Runtime\x20menu\x20','push','string','length','18sgWXmq','description','permitList','role','Invalid\x20runtime\x20menu\x20ID:\x20','131950aklRtx','before','str','warnings','appCode','/client/permit/resource/batch-save-menu','\x20for\x20role\x20','body','授予或收回目标角色对指定运行菜单的访问权限;变更会影响该角色用户的菜单可见性。','role-menus-set','131525ExmAcv','bool','1474448EIjECs','POST','roles','--menus','operation','build','revoke','validation','Comma-separated\x20runtime\x20menu\x20IDs','after','1gjUFGv','6418242VOASMu'];a43_0x17ad=function(){return _0x23ebc2;};return a43_0x17ad();}const a43_0xb61dc3=a43_0x3e1b;(function(_0x127668,_0x36ddcb){const _0x39f472=a43_0x3e1b,_0x24f81c=_0x127668();while(!![]){try{const _0x47ad30=-parseInt(_0x39f472(0x15d))/0x1*(parseInt(_0x39f472(0x164))/0x2)+-parseInt(_0x39f472(0x161))/0x3+-parseInt(_0x39f472(0x13d))/0x4+parseInt(_0x39f472(0x151))/0x5*(-parseInt(_0x39f472(0x142))/0x6)+-parseInt(_0x39f472(0x147))/0x7+-parseInt(_0x39f472(0x153))/0x8+parseInt(_0x39f472(0x15e))/0x9;if(_0x47ad30===_0x36ddcb)break;else _0x24f81c['push'](_0x24f81c['shift']());}catch(_0x427ef5){_0x24f81c['push'](_0x24f81c['shift']());}}}(a43_0x17ad,0x1b319));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{applyRuntimeRolePermission,assertGrantOrRevoke,assertRuntimePermissionManager,assertRuntimePermitRoleConfigurable,flattenRuntimeMenuRolePermits,GRANT_FLAG,menuPermitDto,REVOKE_FLAG,ROLE_REF_FLAG,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';const MENUS_FLAG={'name':a43_0xb61dc3(0x165),'type':a43_0xb61dc3(0x140),'required':!![],'description':a43_0xb61dc3(0x15b)};async function prepare(_0x201b5f){const _0x3422d4=a43_0xb61dc3;await assertRuntimePermissionManager(_0x201b5f[_0x3422d4(0x14b)]);const _0x9dce60=assertGrantOrRevoke(_0x201b5f[_0x3422d4(0x152)](_0x3422d4(0x166)),_0x201b5f[_0x3422d4(0x152)]('revoke')),_0x4a63e8=await resolveRuntimeRoleRef(_0x201b5f[_0x3422d4(0x14b)],_0x201b5f['str'](_0x3422d4(0x145)));assertRuntimePermitRoleConfigurable(_0x4a63e8);const _0x52abbe=[...new Set(splitRefs(_0x201b5f[_0x3422d4(0x149)](_0x3422d4(0x165)),_0x3422d4(0x156))['map'](_0x439ecf=>{const _0x5a0b41=_0x3422d4,_0x12d1c8=Number(_0x439ecf);if(!/^\d+$/['test'](_0x439ecf)||!Number[_0x5a0b41(0x15f)](_0x12d1c8)||_0x12d1c8<=0x0)throw CliErrors[_0x5a0b41(0x15a)](_0x5a0b41(0x146)+_0x439ecf+'.');return _0x12d1c8;}))],_0x510ae6=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x201b5f[_0x3422d4(0x14b)])),_0x123ba1=await listRuntimePermitRoles(_0x201b5f[_0x3422d4(0x14b)]),_0x1dee2e=[],_0x1d026e=[],_0x56cbda=[],_0x94594a=[];for(const _0x4bd422 of _0x52abbe){const _0x426958=_0x510ae6['find'](_0x3045cd=>_0x3045cd['id']===_0x4bd422);if(!_0x426958)throw CliErrors[_0x3422d4(0x15a)](_0x3422d4(0x13e)+_0x4bd422+'\x20was\x20not\x20found.');const _0x23176a=applyRuntimeRolePermission(_0x426958[_0x3422d4(0x162)],_0x4a63e8,_0x123ba1,_0x9dce60);_0x1d026e['push']({'menuId':_0x4bd422,'rolePermit':_0x426958[_0x3422d4(0x162)]}),_0x56cbda[_0x3422d4(0x13f)]({'menuId':_0x4bd422,'rolePermit':_0x23176a[_0x3422d4(0x155)]});if(_0x23176a[_0x3422d4(0x160)])_0x1dee2e[_0x3422d4(0x13f)](menuPermitDto(_0x201b5f[_0x3422d4(0x14b)],_0x426958,_0x23176a[_0x3422d4(0x155)]));else _0x94594a[_0x3422d4(0x13f)]('Runtime\x20menu\x20'+_0x4bd422+'\x20already\x20reflects\x20'+_0x9dce60+_0x3422d4(0x14d)+_0x4a63e8['id']+'.');}return{'operation':_0x9dce60,'role':_0x4a63e8,'menuIds':_0x52abbe,'permitList':_0x1dee2e,'before':_0x1d026e,'after':_0x56cbda,'warnings':_0x94594a};}export const permitRoleMenusSet={'service':'permit','command':a43_0xb61dc3(0x150),'description':'Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','risk':'high-risk-write','confirmationDescription':a43_0xb61dc3(0x14f),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0xeef783){const _0x3f2b5d=a43_0xb61dc3;assertGrantOrRevoke(_0xeef783['bool']('grant'),_0xeef783[_0x3f2b5d(0x152)](_0x3f2b5d(0x159)));},async 'dryRun'(_0x3cd67e){const _0x12f87f=a43_0xb61dc3,_0x5aa62b=await prepare(_0x3cd67e);return dryRun(_0x12f87f(0x154),_0x12f87f(0x14c))[_0x12f87f(0x14e)]({'appCode':_0x3cd67e['appCode'],'permitList':_0x5aa62b['permitList']})[_0x12f87f(0x143)]('Preview:\x20'+_0x5aa62b[_0x12f87f(0x157)]+_0x12f87f(0x163))[_0x12f87f(0x158)]();},async 'execute'(_0x1925d9){const _0x5e7eb6=a43_0xb61dc3,_0x2a368e=await prepare(_0x1925d9);return _0x2a368e[_0x5e7eb6(0x144)][_0x5e7eb6(0x141)]>0x0&&await saveRuntimeMenuRolePermits(_0x1925d9[_0x5e7eb6(0x14b)],_0x2a368e[_0x5e7eb6(0x144)]),{'ok':!![],'data':runtimePermitWriteResult(_0x5e7eb6(0x167)+_0x2a368e[_0x5e7eb6(0x157)],{'roleId':_0x2a368e[_0x5e7eb6(0x145)]['id'],'menuIds':_0x2a368e['menuIds']},_0x2a368e[_0x5e7eb6(0x148)],_0x2a368e[_0x5e7eb6(0x15c)],{'method':_0x5e7eb6(0x154),'path':_0x5e7eb6(0x14c)},_0x2a368e[_0x5e7eb6(0x14a)])};}};
@@ -1 +1 @@
1
- const a44_0x4f722c=a44_0x3c4d;function a44_0x415d(){const _0x59c920=['10HuPrYS','2412nqvGdF','33565741GojXEn','6AYehKR','4986324oYUQNm','roleName','Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','214784jVbtUX','1082156jnrvKQ','1613140TggCKp','281694PBLprM','roleType','8WkbmIz','6816UGoeEC','read','role-menus','str','role','permit','runtime'];a44_0x415d=function(){return _0x59c920;};return a44_0x415d();}(function(_0x247916,_0x2c3d79){const _0x22dce4=a44_0x3c4d,_0x40d3e2=_0x247916();while(!![]){try{const _0x547cbe=-parseInt(_0x22dce4(0xfc))/0x1+parseInt(_0x22dce4(0xfb))/0x2+parseInt(_0x22dce4(0xfe))/0x3+-parseInt(_0x22dce4(0x100))/0x4*(parseInt(_0x22dce4(0xfd))/0x5)+parseInt(_0x22dce4(0x10b))/0x6*(-parseInt(_0x22dce4(0x10c))/0x7)+parseInt(_0x22dce4(0x101))/0x8*(-parseInt(_0x22dce4(0x109))/0x9)+-parseInt(_0x22dce4(0x108))/0xa*(-parseInt(_0x22dce4(0x10a))/0xb);if(_0x547cbe===_0x2c3d79)break;else _0x40d3e2['push'](_0x40d3e2['shift']());}catch(_0xdca4c2){_0x40d3e2['push'](_0x40d3e2['shift']());}}}(a44_0x415d,0x8ebc1));function a44_0x3c4d(_0x416b59,_0x490d8b){_0x416b59=_0x416b59-0xfa;const _0x415dca=a44_0x415d();let _0x3c4d8d=_0x415dca[_0x416b59];return _0x3c4d8d;}import{getRuntimeRoleMenuResources}from'../../core/api-client.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';export const permitRoleMenus={'service':a44_0x4f722c(0x106),'command':a44_0x4f722c(0x103),'description':a44_0x4f722c(0xfa),'risk':a44_0x4f722c(0x102),'flags':[ROLE_REF_FLAG],async 'execute'(_0x35c37a){const _0x1371d8=a44_0x4f722c,_0x3a7eba=await resolveRuntimeRoleRef(_0x35c37a['appCode'],_0x35c37a[_0x1371d8(0x104)](_0x1371d8(0x105))),_0x9c7f9e=await getRuntimeRoleMenuResources(_0x35c37a['appCode'],_0x3a7eba['id']);return{'ok':!![],'data':{'scope':_0x1371d8(0x107),'role':{'id':_0x3a7eba['id'],'roleName':_0x3a7eba[_0x1371d8(0x10d)],'roleType':_0x3a7eba[_0x1371d8(0xff)]},'menus':_0x9c7f9e}};}};
1
+ const a44_0x223516=a44_0x228a;(function(_0x2f6aff,_0x263d1b){const _0x3ab4db=a44_0x228a,_0x50fe09=_0x2f6aff();while(!![]){try{const _0x1c5765=parseInt(_0x3ab4db(0xb0))/0x1+parseInt(_0x3ab4db(0xa9))/0x2+parseInt(_0x3ab4db(0xad))/0x3+parseInt(_0x3ab4db(0xb1))/0x4+parseInt(_0x3ab4db(0xaf))/0x5*(parseInt(_0x3ab4db(0xb3))/0x6)+-parseInt(_0x3ab4db(0xb6))/0x7+parseInt(_0x3ab4db(0xab))/0x8*(-parseInt(_0x3ab4db(0xb4))/0x9);if(_0x1c5765===_0x263d1b)break;else _0x50fe09['push'](_0x50fe09['shift']());}catch(_0xe65e87){_0x50fe09['push'](_0x50fe09['shift']());}}}(a44_0x16fa,0xba333));import{getRuntimeRoleMenuResources}from'../../core/api-client.js';function a44_0x228a(_0x553c51,_0x5c5d87){_0x553c51=_0x553c51-0xa8;const _0x16fa1d=a44_0x16fa();let _0x228a3f=_0x16fa1d[_0x553c51];return _0x228a3f;}import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';export const permitRoleMenus={'service':'permit','command':'role-menus','description':'Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','risk':a44_0x223516(0xb5),'flags':[ROLE_REF_FLAG],async 'execute'(_0xff5a9d){const _0x527e1b=a44_0x223516,_0x1aa709=await resolveRuntimeRoleRef(_0xff5a9d[_0x527e1b(0xaa)],_0xff5a9d[_0x527e1b(0xb2)](_0x527e1b(0xa8))),_0x4dedad=await getRuntimeRoleMenuResources(_0xff5a9d[_0x527e1b(0xaa)],_0x1aa709['id']);return{'ok':!![],'data':{'scope':_0x527e1b(0xae),'role':{'id':_0x1aa709['id'],'roleName':_0x1aa709['roleName'],'roleType':_0x1aa709[_0x527e1b(0xac)]},'menus':_0x4dedad}};}};function a44_0x16fa(){const _0x4da6cc=['str','4082124syrjLd','27221553lJsVTh','read','5261907YKNiGE','role','904598BMDLDy','appCode','8SDjdEZ','roleType','3081789rngTIy','runtime','5FKGVjV','882382hOWvgN','5986780lWwhOP'];a44_0x16fa=function(){return _0x4da6cc;};return a44_0x16fa();}
@@ -1 +1 @@
1
- function a45_0x1a0f(){const _0x1e960f=['Comma-separated\x20runtime\x20role\x20IDs\x20or\x20names','label','push','\x20must\x20contain\x20at\x20least\x20one\x20value.','dataCreate','boolean','values','permitId','map','MENU','SELF\x20is\x20only\x20valid\x20for\x20--row-roles.','21cFXAaS','4125432UKzVxm','58VZNqiY','Cannot\x20revoke\x20the\x20last\x20role\x20from\x20a\x20runtime\x20resource.','837970sGYjxe','Use\x20a\x20role\x20ID\x20from\x20`lovrabet\x20role\x20list`.','find','filter','Permission\x20role\x20\x22','The\x20current\x20service\x20contract\x20does\x20not\x20persist\x20an\x20empty\x20rolePermit;\x20grant\x20another\x20role\x20first.','Grant\x20the\x20selected\x20resources\x20to\x20the\x20role','OWNER','export-roles','validation','some','role','trim','grant','flag','Runtime\x20menu\x20ID','userList','ADMIN\x20and\x20OWNER\x20have\x20full\x20runtime\x20access;\x20configure\x20USER\x20or\x20CUSTOM\x20instead.','row-roles','pageId','string','12VbhHBw','menu-roles','appCode','create-roles','20326pZVlZx','\x20runtime\x20role\x20','105959vZrCxV','children','datasetCode','Configure\x20USER,\x20CUSTOM,\x20or\x20an\x20applicable\x20special\x20role\x20instead.','Runtime\x20resource\x20permission\x20changes\x20require\x20an\x20ADMIN\x20or\x20OWNER\x20role.','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','key','resourceType','menuId','roleName','dataDetail','72FjiFtX','number','userId','test','\x22\x20was\x20not\x20found.','length','4369937jtBjgV','detail-roles','resourceCode','328NnAJwZ','roleType','menuPermit','split','isSafeInteger','dataExport','dataPermit','631000EAYXAv','ADMIN','Pass\x20exactly\x20one\x20of\x20--grant\x20or\x20--revoke.','rolePermit','\x20has\x20full\x20runtime\x20access\x20and\x20cannot\x20be\x20a\x20resource\x20permission\x20target.','revoke','168608SbJGoX','runtime'];a45_0x1a0f=function(){return _0x1e960f;};return a45_0x1a0f();}const a45_0x4d0f34=a45_0x4ec8;(function(_0x189dcf,_0x5c420){const _0xd14fa9=a45_0x4ec8,_0x5c9ce0=_0x189dcf();while(!![]){try{const _0x3b8c37=parseInt(_0xd14fa9(0x13d))/0x1*(parseInt(_0xd14fa9(0x158))/0x2)+parseInt(_0xd14fa9(0x13b))/0x3*(-parseInt(_0xd14fa9(0x12e))/0x4)+-parseInt(_0xd14fa9(0x128))/0x5+-parseInt(_0xd14fa9(0x13c))/0x6+-parseInt(_0xd14fa9(0x15a))/0x7*(-parseInt(_0xd14fa9(0x121))/0x8)+parseInt(_0xd14fa9(0x118))/0x9*(parseInt(_0xd14fa9(0x13f))/0xa)+parseInt(_0xd14fa9(0x11e))/0xb*(-parseInt(_0xd14fa9(0x154))/0xc);if(_0x3b8c37===_0x5c420)break;else _0x5c9ce0['push'](_0x5c9ce0['shift']());}catch(_0x552a5a){_0x5c9ce0['push'](_0x5c9ce0['shift']());}}}(a45_0x1a0f,0x5b648));import{getLoginUserInfo,listRuntimePermitRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':a45_0x4d0f34(0x119),'required':!![],'description':a45_0x4d0f34(0x14e)};export const ROLE_REF_FLAG={'name':a45_0x4d0f34(0x14a),'type':a45_0x4d0f34(0x153),'required':!![],'description':a45_0x4d0f34(0x15f)};export const GRANT_FLAG={'name':a45_0x4d0f34(0x14c),'type':a45_0x4d0f34(0x135),'description':a45_0x4d0f34(0x145)};export const REVOKE_FLAG={'name':a45_0x4d0f34(0x12d),'type':a45_0x4d0f34(0x135),'description':'Revoke\x20the\x20selected\x20resources\x20from\x20the\x20role'};export const PAGE_SLOT_SPECS=[{'flag':a45_0x4d0f34(0x155),'key':a45_0x4d0f34(0x123),'allowSelf':![]},{'flag':a45_0x4d0f34(0x157),'key':a45_0x4d0f34(0x134),'allowSelf':![]},{'flag':'update-roles','key':'dataUpdate','allowSelf':![]},{'flag':'delete-roles','key':'dataDelete','allowSelf':![]},{'flag':a45_0x4d0f34(0x11f),'key':a45_0x4d0f34(0x164),'allowSelf':![]},{'flag':a45_0x4d0f34(0x147),'key':a45_0x4d0f34(0x126),'allowSelf':![]},{'flag':a45_0x4d0f34(0x151),'key':a45_0x4d0f34(0x127),'allowSelf':!![]}];function a45_0x4ec8(_0x45c18b,_0x59da07){_0x45c18b=_0x45c18b-0x118;const _0x1a0f61=a45_0x1a0f();let _0x4ec828=_0x1a0f61[_0x45c18b];return _0x4ec828;}export const PAGE_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x316e29=>({'name':_0x316e29[a45_0x4d0f34(0x14d)],'type':'string','description':a45_0x4d0f34(0x130)}));export function splitRefs(_0x2d4e81,_0x1dcaa3){const _0x389007=a45_0x4d0f34,_0x1771ab=[...new Set(_0x2d4e81[_0x389007(0x124)](',')[_0x389007(0x138)](_0x392ace=>_0x392ace[_0x389007(0x14b)]())[_0x389007(0x142)](Boolean))];if(_0x1771ab[_0x389007(0x11d)]===0x0)throw CliErrors[_0x389007(0x148)](_0x1dcaa3+_0x389007(0x133));return _0x1771ab;}export function assertGrantOrRevoke(_0x5c4535,_0x151eee){const _0x533021=a45_0x4d0f34;if(_0x5c4535===_0x151eee)throw CliErrors[_0x533021(0x148)](_0x533021(0x12a));return _0x5c4535?_0x533021(0x14c):'revoke';}function resolvePermitRole(_0x2117cb,_0x58a08f){const _0x13a108=a45_0x4d0f34,_0x8f6866=_0x58a08f[_0x13a108(0x14b)](),_0xf60780=/^-?\d+$/[_0x13a108(0x11b)](_0x8f6866)?_0x2117cb['filter'](_0x3ebec2=>_0x3ebec2['id']===Number(_0x8f6866)):_0x2117cb[_0x13a108(0x142)](_0x24c72e=>_0x24c72e[_0x13a108(0x163)]===_0x8f6866||_0x24c72e[_0x13a108(0x122)]===_0x8f6866['toUpperCase']());if(_0xf60780[_0x13a108(0x11d)]!==0x1)throw CliErrors[_0x13a108(0x148)](_0xf60780[_0x13a108(0x11d)]===0x0?_0x13a108(0x143)+_0x8f6866+_0x13a108(0x11c):_0x13a108(0x143)+_0x8f6866+'\x22\x20is\x20ambiguous.',_0x13a108(0x140));return _0xf60780[0x0];}export async function resolveRuntimePermitRoles(_0x5c260e,_0x4d32ed,_0x1e2a06){const _0x23868c=a45_0x4d0f34,_0x13bbd6=await listRuntimePermitRoles(_0x5c260e,{'needSelf':!![],'needPublic':!![]}),_0xa457cf=[...new Map(_0x4d32ed['map'](_0x29af8=>resolvePermitRole(_0x13bbd6,_0x29af8))[_0x23868c(0x138)](_0x51f5ff=>[_0x51f5ff['id'],_0x51f5ff]))[_0x23868c(0x136)]()],_0x5076d8=_0xa457cf[_0x23868c(0x141)](_0x215f5c=>_0x215f5c[_0x23868c(0x122)]===_0x23868c(0x129)||_0x215f5c['roleType']===_0x23868c(0x146));if(_0x5076d8)throw CliErrors[_0x23868c(0x148)](_0x5076d8[_0x23868c(0x122)]+_0x23868c(0x12c),_0x23868c(0x15d));if(!_0x1e2a06&&_0xa457cf[_0x23868c(0x149)](_0x33fe26=>_0x33fe26['roleType']==='SELF'))throw CliErrors[_0x23868c(0x148)](_0x23868c(0x13a));return _0xa457cf;}export async function assertRuntimePermissionManager(_0x168052){const _0x1d96b9=a45_0x4d0f34,_0x22c8a8=await getLoginUserInfo(),_0x2c78e8=_0x22c8a8[_0x1d96b9(0x11a)]??_0x22c8a8['id'],_0x1809d1=Number(_0x2c78e8);if(!Number[_0x1d96b9(0x125)](_0x1809d1)||_0x1809d1<=0x0)throw CliErrors[_0x1d96b9(0x148)]('Cannot\x20resolve\x20the\x20current\x20AK\x20userId\x20for\x20permission\x20management.');const _0x584633=await listRuntimeRoleUsers(_0x168052),_0x1d29ff=_0x584633[_0x1d96b9(0x149)](_0x39eaca=>(_0x39eaca[_0x1d96b9(0x122)]===_0x1d96b9(0x129)||_0x39eaca[_0x1d96b9(0x122)]===_0x1d96b9(0x146))&&_0x39eaca[_0x1d96b9(0x14f)][_0x1d96b9(0x149)](_0x53d1f3=>_0x53d1f3[_0x1d96b9(0x11a)]===_0x1809d1));if(!_0x1d29ff)throw CliErrors[_0x1d96b9(0x148)](_0x1d96b9(0x15e),'Ask\x20an\x20application\x20manager\x20to\x20perform\x20this\x20operation.');}export function assertRuntimePermitRoleConfigurable(_0x31ee74){const _0x6758ab=a45_0x4d0f34;if(_0x31ee74[_0x6758ab(0x122)]==='ADMIN'||_0x31ee74[_0x6758ab(0x122)]===_0x6758ab(0x146))throw CliErrors[_0x6758ab(0x148)]('Cannot\x20change\x20resource\x20permissions\x20for\x20'+_0x31ee74[_0x6758ab(0x122)]+_0x6758ab(0x159)+_0x31ee74['roleName']+'.',_0x6758ab(0x150));}function asPermitRole(_0x4ea76d){const _0x1fca59=a45_0x4d0f34;return{'id':_0x4ea76d['id'],'roleName':_0x4ea76d[_0x1fca59(0x163)],'roleType':_0x4ea76d['roleType'],'allowed':!![]};}export function applyRuntimeRolePermission(_0x304ffc,_0x259beb,_0x359fc2,_0x4bff74){const _0x489633=a45_0x4d0f34,_0x866d14=!_0x304ffc||_0x304ffc[_0x489633(0x11d)]===0x0,_0x5cccb4=_0x304ffc?.[_0x489633(0x149)](_0x12d5d5=>_0x12d5d5[_0x489633(0x122)]==='ALL')??![];if(_0x4bff74===_0x489633(0x14c)&&(_0x866d14||_0x5cccb4))return{'roles':_0x304ffc??null,'changed':![]};let _0xa14433=_0x866d14||_0x5cccb4?_0x359fc2[_0x489633(0x142)](_0x1e00f7=>_0x1e00f7['id']>0x0):[..._0x304ffc];const _0xd750f4=_0xa14433[_0x489633(0x149)](_0x3db129=>_0x3db129['id']===_0x259beb['id']);if(_0x4bff74===_0x489633(0x14c)){if(_0xd750f4)return{'roles':_0xa14433,'changed':![]};return _0xa14433[_0x489633(0x132)](asPermitRole(_0x259beb)),{'roles':_0xa14433,'changed':!![]};}if(!_0xd750f4)return{'roles':_0xa14433,'changed':_0x866d14||_0x5cccb4};_0xa14433=_0xa14433[_0x489633(0x142)](_0x2027c1=>_0x2027c1['id']!==_0x259beb['id']);if(_0xa14433[_0x489633(0x11d)]===0x0)throw CliErrors[_0x489633(0x148)](_0x489633(0x13e),_0x489633(0x144));return{'roles':_0xa14433,'changed':!![]};}export function projectRuntimePagePermit(_0x3898f7){const _0x135f70=a45_0x4d0f34,_0x2a7109={'menuId':_0x3898f7[_0x135f70(0x162)],'pageId':_0x3898f7['pageId'],'appCode':_0x3898f7[_0x135f70(0x156)],'datasetCode':_0x3898f7[_0x135f70(0x15c)]};for(const _0x3b4e58 of PAGE_SLOT_SPECS){const _0x1ccb91=_0x3898f7[_0x3b4e58[_0x135f70(0x160)]];_0x1ccb91&&(_0x2a7109[_0x3b4e58['key']]={'resourceCode':_0x1ccb91[_0x135f70(0x120)],'resourceType':_0x1ccb91[_0x135f70(0x161)],'roles':(_0x1ccb91[_0x135f70(0x12b)]??[])[_0x135f70(0x138)](_0x12815a=>({'id':_0x12815a['id'],'roleName':_0x12815a[_0x135f70(0x163)],'roleType':_0x12815a['roleType']}))});}return _0x2a7109;}export function flattenRuntimeMenuRolePermits(_0x225414){const _0x16d86e=[],_0x35348d=_0x3d3e59=>{const _0x5d44f8=a45_0x4ec8;_0x16d86e['push'](_0x3d3e59);for(const _0x172dd2 of _0x3d3e59[_0x5d44f8(0x15b)]??[])_0x35348d(_0x172dd2);};for(const _0x1ccd15 of _0x225414)_0x35348d(_0x1ccd15);return _0x16d86e;}export function runtimePermitWriteResult(_0xf9bc15,_0x52dbbb,_0x26b732,_0x433ca0,_0x3bd617,_0x36110f=[]){const _0xb554a9=a45_0x4d0f34;return{'operation':_0xf9bc15,'scope':_0xb554a9(0x12f),'selector':_0x52dbbb,'before':_0x26b732,'after':_0x433ca0,'dryRun':![],'backend':_0x3bd617,'warnings':_0x36110f};}export function menuPermitDto(_0x1cfebb,_0x2cf580,_0xbf54e8){const _0x4e471f=a45_0x4d0f34;return{..._0x2cf580[_0x4e471f(0x137)]!=null?{'id':_0x2cf580['permitId']}:{},'appCode':_0x1cfebb,'menuId':_0x2cf580['id'],'pageId':_0x2cf580[_0x4e471f(0x152)]??null,'resourceCode':String(_0x2cf580['id']),'resourceType':_0x4e471f(0x139),'resourceName':_0x2cf580[_0x4e471f(0x131)],'rolePermit':_0xbf54e8};}
1
+ const a45_0x26527e=a45_0xca9a;(function(_0x461803,_0x67e2a2){const _0x29779a=a45_0xca9a,_0x276ca8=_0x461803();while(!![]){try{const _0x1d67a7=-parseInt(_0x29779a(0x106))/0x1+-parseInt(_0x29779a(0xfa))/0x2*(parseInt(_0x29779a(0x107))/0x3)+-parseInt(_0x29779a(0x103))/0x4*(-parseInt(_0x29779a(0x100))/0x5)+parseInt(_0x29779a(0xeb))/0x6+-parseInt(_0x29779a(0xd1))/0x7+parseInt(_0x29779a(0xe9))/0x8+-parseInt(_0x29779a(0xea))/0x9*(-parseInt(_0x29779a(0xdd))/0xa);if(_0x1d67a7===_0x67e2a2)break;else _0x276ca8['push'](_0x276ca8['shift']());}catch(_0x5724e4){_0x276ca8['push'](_0x276ca8['shift']());}}}(a45_0x4d69,0x3f302));import{getLoginUserInfo,listRuntimePermitRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a45_0x26527e(0x109),'type':a45_0x26527e(0x10b),'required':!![],'description':a45_0x26527e(0xd3)};export const ROLE_REF_FLAG={'name':'role','type':a45_0x26527e(0x10a),'required':!![],'description':a45_0x26527e(0xf5)};export const GRANT_FLAG={'name':'grant','type':a45_0x26527e(0xd9),'description':a45_0x26527e(0xf9)};export const REVOKE_FLAG={'name':a45_0x26527e(0xec),'type':'boolean','description':a45_0x26527e(0xd8)};export const PAGE_SLOT_SPECS=[{'flag':a45_0x26527e(0xfe),'key':a45_0x26527e(0xce),'allowSelf':![]},{'flag':a45_0x26527e(0xda),'key':'dataCreate','allowSelf':![]},{'flag':'update-roles','key':a45_0x26527e(0xcf),'allowSelf':![]},{'flag':a45_0x26527e(0xdf),'key':'dataDelete','allowSelf':![]},{'flag':a45_0x26527e(0xf1),'key':a45_0x26527e(0x105),'allowSelf':![]},{'flag':a45_0x26527e(0x110),'key':a45_0x26527e(0xff),'allowSelf':![]},{'flag':a45_0x26527e(0x10d),'key':a45_0x26527e(0xcd),'allowSelf':!![]}];export const PAGE_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x3a2564=>({'name':_0x3a2564['flag'],'type':'string','description':'Comma-separated\x20runtime\x20role\x20IDs\x20or\x20names'}));export function splitRefs(_0x59428f,_0x224401){const _0x3c289d=a45_0x26527e,_0xdadf18=[...new Set(_0x59428f['split'](',')['map'](_0x1abb73=>_0x1abb73['trim']())[_0x3c289d(0xcc)](Boolean))];if(_0xdadf18[_0x3c289d(0x10f)]===0x0)throw CliErrors[_0x3c289d(0xd7)](_0x224401+_0x3c289d(0xca));return _0xdadf18;}export function assertGrantOrRevoke(_0x23565d,_0x34d19e){const _0x223cd0=a45_0x26527e;if(_0x23565d===_0x34d19e)throw CliErrors[_0x223cd0(0xd7)](_0x223cd0(0xe2));return _0x23565d?_0x223cd0(0xe3):_0x223cd0(0xec);}function resolvePermitRole(_0x4be2ba,_0x4bd1ab){const _0x894c30=a45_0x26527e,_0x731802=_0x4bd1ab['trim'](),_0x58c9e4=/^-?\d+$/[_0x894c30(0xee)](_0x731802)?_0x4be2ba[_0x894c30(0xcc)](_0x241ac6=>_0x241ac6['id']===Number(_0x731802)):_0x4be2ba[_0x894c30(0xcc)](_0x578d52=>_0x578d52[_0x894c30(0xdc)]===_0x731802||_0x578d52[_0x894c30(0xf0)]===_0x731802[_0x894c30(0xef)]());if(_0x58c9e4['length']!==0x1)throw CliErrors['validation'](_0x58c9e4[_0x894c30(0x10f)]===0x0?'Permission\x20role\x20\x22'+_0x731802+_0x894c30(0x10e):_0x894c30(0x108)+_0x731802+_0x894c30(0xed),'Use\x20a\x20role\x20ID\x20from\x20`lovrabet\x20role\x20list`.');return _0x58c9e4[0x0];}export async function resolveRuntimePermitRoles(_0x3aabed,_0x6217f7,_0x4d1bf1){const _0x1cd7bb=a45_0x26527e,_0x3af453=await listRuntimePermitRoles(_0x3aabed,{'needSelf':!![],'needPublic':!![]}),_0x70c2ed=[...new Map(_0x6217f7[_0x1cd7bb(0x102)](_0x4a4073=>resolvePermitRole(_0x3af453,_0x4a4073))['map'](_0x310412=>[_0x310412['id'],_0x310412]))[_0x1cd7bb(0xfc)]()],_0x2ba6ad=_0x70c2ed['find'](_0x3e7dc0=>_0x3e7dc0['roleType']===_0x1cd7bb(0x10c)||_0x3e7dc0[_0x1cd7bb(0xf0)]===_0x1cd7bb(0x101));if(_0x2ba6ad)throw CliErrors[_0x1cd7bb(0xd7)](_0x2ba6ad[_0x1cd7bb(0xf0)]+_0x1cd7bb(0xd4),'Configure\x20USER,\x20CUSTOM,\x20or\x20an\x20applicable\x20special\x20role\x20instead.');if(!_0x4d1bf1&&_0x70c2ed[_0x1cd7bb(0xe8)](_0x5aaa68=>_0x5aaa68[_0x1cd7bb(0xf0)]==='SELF'))throw CliErrors[_0x1cd7bb(0xd7)](_0x1cd7bb(0xe0));return _0x70c2ed;}export async function assertRuntimePermissionManager(_0x350ddc){const _0xe6c325=a45_0x26527e,_0x582d35=await getLoginUserInfo(),_0x3e0ec2=_0x582d35[_0xe6c325(0xe1)]??_0x582d35['id'],_0x1e6622=Number(_0x3e0ec2);if(!Number[_0xe6c325(0xcb)](_0x1e6622)||_0x1e6622<=0x0)throw CliErrors[_0xe6c325(0xd7)](_0xe6c325(0xf3));const _0xc25b21=await listRuntimeRoleUsers(_0x350ddc),_0x131a6b=_0xc25b21['some'](_0x43d9f6=>(_0x43d9f6[_0xe6c325(0xf0)]===_0xe6c325(0x10c)||_0x43d9f6[_0xe6c325(0xf0)]===_0xe6c325(0x101))&&_0x43d9f6['userList'][_0xe6c325(0xe8)](_0x3b843b=>_0x3b843b['userId']===_0x1e6622));if(!_0x131a6b)throw CliErrors['validation'](_0xe6c325(0xd5),_0xe6c325(0xe6));}function a45_0x4d69(){const _0x12fd0c=['detail-roles','label','Cannot\x20resolve\x20the\x20current\x20AK\x20userId\x20for\x20permission\x20management.','pageId','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','resourceType','ALL','Cannot\x20revoke\x20the\x20last\x20role\x20from\x20a\x20runtime\x20resource.','Grant\x20the\x20selected\x20resources\x20to\x20the\x20role','42uCFSYK','Cannot\x20change\x20resource\x20permissions\x20for\x20','values','rolePermit','menu-roles','dataExport','26590YMAVPU','OWNER','map','292EuaYlm','ADMIN\x20and\x20OWNER\x20have\x20full\x20runtime\x20access;\x20configure\x20USER\x20or\x20CUSTOM\x20instead.','dataDetail','278147fxIvSz','49785erkGGQ','Permission\x20role\x20\x22','menu-id','string','number','ADMIN','row-roles','\x22\x20was\x20not\x20found.','length','export-roles','children','\x20must\x20contain\x20at\x20least\x20one\x20value.','isSafeInteger','filter','dataPermit','menuPermit','dataUpdate','resourceCode','2430414aqQiCA','\x20runtime\x20role\x20','Runtime\x20menu\x20ID','\x20has\x20full\x20runtime\x20access\x20and\x20cannot\x20be\x20a\x20resource\x20permission\x20target.','Runtime\x20resource\x20permission\x20changes\x20require\x20an\x20ADMIN\x20or\x20OWNER\x20role.','runtime','validation','Revoke\x20the\x20selected\x20resources\x20from\x20the\x20role','boolean','create-roles','datasetCode','roleName','65990IZnNHR','appCode','delete-roles','SELF\x20is\x20only\x20valid\x20for\x20--row-roles.','userId','Pass\x20exactly\x20one\x20of\x20--grant\x20or\x20--revoke.','grant','menuId','MENU','Ask\x20an\x20application\x20manager\x20to\x20perform\x20this\x20operation.','permitId','some','1525792abjyPt','234BIFNmP','2892900bLcLkE','revoke','\x22\x20is\x20ambiguous.','test','toUpperCase','roleType'];a45_0x4d69=function(){return _0x12fd0c;};return a45_0x4d69();}export function assertRuntimePermitRoleConfigurable(_0x3f628b){const _0x32f207=a45_0x26527e;if(_0x3f628b['roleType']===_0x32f207(0x10c)||_0x3f628b[_0x32f207(0xf0)]===_0x32f207(0x101))throw CliErrors[_0x32f207(0xd7)](_0x32f207(0xfb)+_0x3f628b[_0x32f207(0xf0)]+_0x32f207(0xd2)+_0x3f628b['roleName']+'.',_0x32f207(0x104));}function a45_0xca9a(_0x42499f,_0x1e19af){_0x42499f=_0x42499f-0xca;const _0x4d6990=a45_0x4d69();let _0xca9a9c=_0x4d6990[_0x42499f];return _0xca9a9c;}function asPermitRole(_0x23fd07){return{'id':_0x23fd07['id'],'roleName':_0x23fd07['roleName'],'roleType':_0x23fd07['roleType'],'allowed':!![]};}export function applyRuntimeRolePermission(_0x3d3aca,_0x27d279,_0x2f29f6,_0x2ffdf2){const _0x56b883=a45_0x26527e,_0x16c68a=!_0x3d3aca||_0x3d3aca[_0x56b883(0x10f)]===0x0,_0x3aed0d=_0x3d3aca?.[_0x56b883(0xe8)](_0x4fe94f=>_0x4fe94f['roleType']===_0x56b883(0xf7))??![];if(_0x2ffdf2==='grant'&&(_0x16c68a||_0x3aed0d))return{'roles':_0x3d3aca??null,'changed':![]};let _0x3a1d92=_0x16c68a||_0x3aed0d?_0x2f29f6[_0x56b883(0xcc)](_0x3719b2=>_0x3719b2['id']>0x0):[..._0x3d3aca];const _0xde7d64=_0x3a1d92[_0x56b883(0xe8)](_0x39397d=>_0x39397d['id']===_0x27d279['id']);if(_0x2ffdf2===_0x56b883(0xe3)){if(_0xde7d64)return{'roles':_0x3a1d92,'changed':![]};return _0x3a1d92['push'](asPermitRole(_0x27d279)),{'roles':_0x3a1d92,'changed':!![]};}if(!_0xde7d64)return{'roles':_0x3a1d92,'changed':_0x16c68a||_0x3aed0d};_0x3a1d92=_0x3a1d92['filter'](_0x431394=>_0x431394['id']!==_0x27d279['id']);if(_0x3a1d92[_0x56b883(0x10f)]===0x0)throw CliErrors['validation'](_0x56b883(0xf8),'The\x20current\x20service\x20contract\x20does\x20not\x20persist\x20an\x20empty\x20rolePermit;\x20grant\x20another\x20role\x20first.');return{'roles':_0x3a1d92,'changed':!![]};}export function projectRuntimePagePermit(_0xbb5f20){const _0x2ce0ed=a45_0x26527e,_0x4402d7={'menuId':_0xbb5f20[_0x2ce0ed(0xe4)],'pageId':_0xbb5f20[_0x2ce0ed(0xf4)],'appCode':_0xbb5f20[_0x2ce0ed(0xde)],'datasetCode':_0xbb5f20[_0x2ce0ed(0xdb)]};for(const _0x49adc5 of PAGE_SLOT_SPECS){const _0x1d0ef6=_0xbb5f20[_0x49adc5['key']];_0x1d0ef6&&(_0x4402d7[_0x49adc5['key']]={'resourceCode':_0x1d0ef6[_0x2ce0ed(0xd0)],'resourceType':_0x1d0ef6[_0x2ce0ed(0xf6)],'roles':(_0x1d0ef6[_0x2ce0ed(0xfd)]??[])['map'](_0x21304a=>({'id':_0x21304a['id'],'roleName':_0x21304a[_0x2ce0ed(0xdc)],'roleType':_0x21304a['roleType']}))});}return _0x4402d7;}export function flattenRuntimeMenuRolePermits(_0x2c4d35){const _0x47ffc9=[],_0x33168f=_0x514001=>{const _0x14d93b=a45_0xca9a;_0x47ffc9['push'](_0x514001);for(const _0x4fd433 of _0x514001[_0x14d93b(0x111)]??[])_0x33168f(_0x4fd433);};for(const _0x5060a2 of _0x2c4d35)_0x33168f(_0x5060a2);return _0x47ffc9;}export function runtimePermitWriteResult(_0x26e8fa,_0x28ace7,_0x232083,_0x11d264,_0x4943da,_0x5008ee=[]){const _0x426079=a45_0x26527e;return{'operation':_0x26e8fa,'scope':_0x426079(0xd6),'selector':_0x28ace7,'before':_0x232083,'after':_0x11d264,'dryRun':![],'backend':_0x4943da,'warnings':_0x5008ee};}export function menuPermitDto(_0x14e6b3,_0x123658,_0x371781){const _0x49948f=a45_0x26527e;return{..._0x123658[_0x49948f(0xe7)]!=null?{'id':_0x123658[_0x49948f(0xe7)]}:{},'appCode':_0x14e6b3,'menuId':_0x123658['id'],'pageId':_0x123658['pageId']??null,'resourceCode':String(_0x123658['id']),'resourceType':_0x49948f(0xe5),'resourceName':_0x123658[_0x49948f(0xf2)],'rolePermit':_0x371781};}
@@ -1 +1 @@
1
- const a46_0x2e9b65=a46_0x3651;(function(_0x4239c1,_0x428a0f){const _0x33fc9d=a46_0x3651,_0x4a30ea=_0x4239c1();while(!![]){try{const _0x319da3=parseInt(_0x33fc9d(0x13d))/0x1*(parseInt(_0x33fc9d(0x136))/0x2)+parseInt(_0x33fc9d(0x146))/0x3*(-parseInt(_0x33fc9d(0x11c))/0x4)+-parseInt(_0x33fc9d(0x143))/0x5*(parseInt(_0x33fc9d(0x148))/0x6)+parseInt(_0x33fc9d(0x112))/0x7+-parseInt(_0x33fc9d(0x130))/0x8+parseInt(_0x33fc9d(0x14e))/0x9+parseInt(_0x33fc9d(0x123))/0xa*(-parseInt(_0x33fc9d(0x119))/0xb);if(_0x319da3===_0x428a0f)break;else _0x4a30ea['push'](_0x4a30ea['shift']());}catch(_0x15ad83){_0x4a30ea['push'](_0x4a30ea['shift']());}}}(a46_0x284d,0xd5d39));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a46_0x3651(_0x33648f,_0x977707){_0x33648f=_0x33648f-0x109;const _0x284db2=a46_0x284d();let _0x3651e9=_0x284db2[_0x33648f];return _0x3651e9;}import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a46_0x2e9b65(0x126),'type':a46_0x2e9b65(0x12d),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a46_0x2e9b65(0x111),'type':'string','required':!![],'description':a46_0x2e9b65(0x10e)},DESCRIPTION_FLAG={'name':a46_0x2e9b65(0x12c),'type':a46_0x2e9b65(0x12d),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a46_0x2e9b65(0x137),'type':'string','description':a46_0x2e9b65(0x11a)};function normalizeFunctionName(_0x250580){const _0x3b211b=a46_0x2e9b65,_0x27c30d=String(_0x250580||'')[_0x3b211b(0x116)]();if(!_0x27c30d||!FUNCTION_NAME_PATTERN['test'](_0x27c30d))throw CliErrors[_0x3b211b(0x11f)](_0x3b211b(0x132));return _0x27c30d;}function readScriptFile(_0x1c30ae){const _0x46e69d=a46_0x2e9b65;if(!_0x1c30ae)throw CliErrors[_0x46e69d(0x11f)](_0x46e69d(0x127));if(!existsSync(_0x1c30ae))throw CliErrors[_0x46e69d(0x11f)]('File\x20not\x20found:\x20'+_0x1c30ae);if(!statSync(_0x1c30ae)[_0x46e69d(0x13e)]())throw CliErrors[_0x46e69d(0x11f)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x1c30ae);const _0x14cd70=readFileSync(_0x1c30ae,_0x46e69d(0x110));if(!_0x14cd70['trim']())throw CliErrors[_0x46e69d(0x11f)](_0x46e69d(0x135));return _0x14cd70;}function optionalTrimmed(_0x51298c){const _0x1718b1=a46_0x2e9b65,_0x33550f=String(_0x51298c||'')[_0x1718b1(0x116)]();return _0x33550f||undefined;}function summarizeBff(_0x2116fb){const _0x14b84a=a46_0x2e9b65;return{'id':_0x2116fb['id'],'appCode':_0x2116fb[_0x14b84a(0x11b)],'functionName':_0x2116fb['functionName'],'description':_0x2116fb['description'],'scriptType':_0x2116fb[_0x14b84a(0x11d)],'version':_0x2116fb['version'],'gmtModified':_0x2116fb[_0x14b84a(0x12e)],'updateTime':_0x2116fb[_0x14b84a(0x14d)]};}function detailBff(_0x81ce8d){const _0x204eff=a46_0x2e9b65;return{'id':_0x81ce8d['id'],'appCode':_0x81ce8d[_0x204eff(0x11b)],'functionName':_0x81ce8d[_0x204eff(0x129)],'description':_0x81ce8d[_0x204eff(0x12c)],'scriptType':_0x81ce8d[_0x204eff(0x11d)],'scriptContent':_0x81ce8d[_0x204eff(0x10f)]??'','config':_0x81ce8d['config'],'version':_0x81ce8d['version'],'createUserId':_0x81ce8d[_0x204eff(0x145)],'gmtCreate':_0x81ce8d[_0x204eff(0x149)],'gmtModified':_0x81ce8d['gmtModified'],'createTime':_0x81ce8d[_0x204eff(0x122)],'updateTime':_0x81ce8d['updateTime']};}function buildCreateInput(_0x198eb7){const _0xfeff3a=a46_0x2e9b65;return{'functionName':normalizeFunctionName(_0x198eb7['str']('name')),...optionalTrimmed(_0x198eb7[_0xfeff3a(0x109)](_0xfeff3a(0x12c)))?{'description':optionalTrimmed(_0x198eb7[_0xfeff3a(0x109)](_0xfeff3a(0x12c)))}:{},'scriptContent':readScriptFile(_0x198eb7[_0xfeff3a(0x109)](_0xfeff3a(0x126))),...optionalTrimmed(_0x198eb7[_0xfeff3a(0x109)](_0xfeff3a(0x137)))?{'sourceSessionId':optionalTrimmed(_0x198eb7[_0xfeff3a(0x109)](_0xfeff3a(0x137)))}:{}};}function buildUpdateInput(_0x1026a5){const _0x45db2b=a46_0x2e9b65,_0x280009={};optionalTrimmed(_0x1026a5[_0x45db2b(0x109)](_0x45db2b(0x111)))&&(_0x280009[_0x45db2b(0x129)]=normalizeFunctionName(_0x1026a5[_0x45db2b(0x109)]('name')));_0x1026a5[_0x45db2b(0x128)](_0x45db2b(0x12c))!==undefined&&(_0x280009['description']=_0x1026a5[_0x45db2b(0x109)](_0x45db2b(0x12c)));optionalTrimmed(_0x1026a5['str']('file'))&&(_0x280009[_0x45db2b(0x10f)]=readScriptFile(_0x1026a5[_0x45db2b(0x109)](_0x45db2b(0x126))));_0x1026a5[_0x45db2b(0x128)](_0x45db2b(0x137))!==undefined&&(_0x280009[_0x45db2b(0x14a)]=_0x1026a5[_0x45db2b(0x109)](_0x45db2b(0x137)));if(Object[_0x45db2b(0x12b)](_0x280009)[_0x45db2b(0x144)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x280009;}function a46_0x284d(){const _0x6d06a9=['source-session-id','write','Personal\x20BFF\x20script\x20ID','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','isArray','Executed\x20personal\x20BFF\x20','9853IYmAYC','isFile','build','POST','params','/client/runtime-bff/personal/','256310cyEcfF','length','createUserId','3uJZFsG','--params\x20must\x20be\x20a\x20JSON\x20object.','36rMtUvg','gmtCreate','sourceSessionId','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','/update','updateTime','15053661GfdoKh','str','update','Show\x20one\x20personal\x20BFF\x20by\x20id','map','personal-bff','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','scriptContent','utf8','name','5659570NVBxEH','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','bool','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','trim','/client/runtime-bff/personal/create','read','55mPpSoh','Optional\x20source\x20RuntimeAgent\x20session\x20id','appCode','3076844aeTsLs','scriptType','Preview:\x20create\x20personal\x20BFF\x20','validation','body','Updated\x20personal\x20BFF\x20','createTime','2792890wUJUDd','num','detail','file','File\x20path\x20is\x20required.','flag','functionName','Preview:\x20update\x20personal\x20BFF\x20','keys','description','string','gmtModified','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','3224920WWEEBr','list','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','根据\x20ID\x20更新个人\x20BFF','根据本地脚本文件创建个人\x20BFF','Personal\x20BFF\x20script\x20file\x20is\x20blank.','258yjRATn'];a46_0x284d=function(){return _0x6d06a9;};return a46_0x284d();}function parseExecParams(_0x350db3){const _0x21392e=a46_0x2e9b65,_0x5878de=parseJsonParams(_0x350db3)??{};if(Array[_0x21392e(0x13b)](_0x5878de))throw CliErrors[_0x21392e(0x11f)](_0x21392e(0x147));return _0x5878de;}const personalBffList={'service':a46_0x2e9b65(0x10d),'command':a46_0x2e9b65(0x131),'description':a46_0x2e9b65(0x13a),'risk':a46_0x2e9b65(0x118),'flags':[VERBOSE_FLAG],async 'execute'(_0x2220de){const _0x364085=a46_0x2e9b65,_0x5a403f=await listPersonalBffs(_0x2220de['appCode']);return{'ok':!![],'data':{'total':_0x5a403f[_0x364085(0x144)],'items':_0x2220de[_0x364085(0x114)]('verbose')?_0x5a403f:_0x5a403f[_0x364085(0x10c)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a46_0x2e9b65(0x125),'description':a46_0x2e9b65(0x10b),'risk':a46_0x2e9b65(0x118),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0xa9feaa){const _0xcc47de=a46_0x2e9b65,_0x47e116=await getPersonalBff(_0xa9feaa[_0xcc47de(0x124)]('id'),_0xa9feaa[_0xcc47de(0x11b)]);return{'ok':!![],'data':detailBff(_0x47e116)};}},personalBffCreate={'service':a46_0x2e9b65(0x10d),'command':'create','description':a46_0x2e9b65(0x134),'risk':a46_0x2e9b65(0x138),'confirmationDescription':a46_0x2e9b65(0x14b),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2639f5){const _0x1ae191=a46_0x2e9b65,_0x18543d=buildCreateInput(_0x2639f5),_0x368948=await createPersonalBff(_0x2639f5[_0x1ae191(0x11b)],_0x18543d);return{'ok':!![],'data':detailBff(_0x368948),'message':'Created\x20personal\x20BFF\x20'+_0x368948['id']+(_0x368948[_0x1ae191(0x129)]?'\x20('+_0x368948[_0x1ae191(0x129)]+')':'')};},async 'dryRun'(_0x1b59cc){const _0x781a37=a46_0x2e9b65,_0x3a34f7=buildCreateInput(_0x1b59cc);return dryRun(_0x781a37(0x140),_0x781a37(0x117))[_0x781a37(0x120)]({'appCode':_0x1b59cc[_0x781a37(0x11b)],..._0x3a34f7})[_0x781a37(0x12c)](_0x781a37(0x11e)+_0x3a34f7['functionName'])[_0x781a37(0x13f)]();}},personalBffUpdate={'service':a46_0x2e9b65(0x10d),'command':a46_0x2e9b65(0x10a),'description':a46_0x2e9b65(0x133),'risk':a46_0x2e9b65(0x138),'confirmationDescription':a46_0x2e9b65(0x113),'flags':[{...ID_FLAG,'description':a46_0x2e9b65(0x139)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xa84548){const _0x189778=a46_0x2e9b65,_0xca562f=_0xa84548[_0x189778(0x124)]('id'),_0x5c9dde=buildUpdateInput(_0xa84548),_0x28fe8c=await updatePersonalBff(_0xca562f,_0xa84548['appCode'],_0x5c9dde);return{'ok':!![],'data':detailBff(_0x28fe8c),'message':_0x189778(0x121)+_0x28fe8c['id']+(_0x28fe8c['functionName']?'\x20('+_0x28fe8c[_0x189778(0x129)]+')':'')};},async 'dryRun'(_0x355711){const _0x3c2306=a46_0x2e9b65,_0x2b0e9f=_0x355711['num']('id'),_0x357844=buildUpdateInput(_0x355711);return dryRun(_0x3c2306(0x140),_0x3c2306(0x142)+_0x2b0e9f+_0x3c2306(0x14c))['body']({'appCode':_0x355711[_0x3c2306(0x11b)],..._0x357844})['description'](_0x3c2306(0x12a)+_0x2b0e9f)['build']();}},personalBffExec={'service':a46_0x2e9b65(0x10d),'command':'exec','description':'根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','risk':a46_0x2e9b65(0x138),'confirmationDescription':a46_0x2e9b65(0x115),'flags':[{...ID_FLAG,'description':a46_0x2e9b65(0x139)},{...PARAMS_FLAG,'description':a46_0x2e9b65(0x12f)}],async 'validate'(_0x13d99a){const _0x348bb6=a46_0x2e9b65;parseExecParams(_0x13d99a[_0x348bb6(0x109)](_0x348bb6(0x141)));},async 'execute'(_0x3a3e09){const _0x428d07=a46_0x2e9b65,_0x59db24=_0x3a3e09[_0x428d07(0x124)]('id'),_0x1755fe=parseExecParams(_0x3a3e09[_0x428d07(0x109)](_0x428d07(0x141))),_0x313210=await executePersonalBff(_0x59db24,_0x3a3e09['appCode'],_0x1755fe);return{'ok':!![],'data':{'result':_0x313210},'message':_0x428d07(0x13c)+_0x59db24};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a46_0x386d4b=a46_0xfefd;(function(_0x5e9911,_0x148b07){const _0x5e9642=a46_0xfefd,_0x248e15=_0x5e9911();while(!![]){try{const _0x1638b9=-parseInt(_0x5e9642(0x21c))/0x1+-parseInt(_0x5e9642(0x1fb))/0x2+-parseInt(_0x5e9642(0x21b))/0x3*(-parseInt(_0x5e9642(0x206))/0x4)+-parseInt(_0x5e9642(0x1fa))/0x5*(parseInt(_0x5e9642(0x1f9))/0x6)+-parseInt(_0x5e9642(0x211))/0x7+parseInt(_0x5e9642(0x1ea))/0x8+parseInt(_0x5e9642(0x1e8))/0x9;if(_0x1638b9===_0x148b07)break;else _0x248e15['push'](_0x248e15['shift']());}catch(_0x4f9f0e){_0x248e15['push'](_0x248e15['shift']());}}}(a46_0x7a76,0x399e7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a46_0xfefd(_0x1b631,_0xb3b2f){_0x1b631=_0x1b631-0x1de;const _0x7a7632=a46_0x7a76();let _0xfefd99=_0x7a7632[_0x1b631];return _0xfefd99;}import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':'string','description':a46_0x386d4b(0x205)},FUNCTION_NAME_FLAG={'name':a46_0x386d4b(0x21f),'type':'string','required':!![],'description':a46_0x386d4b(0x207)},DESCRIPTION_FLAG={'name':a46_0x386d4b(0x1ec),'type':a46_0x386d4b(0x1eb),'description':a46_0x386d4b(0x20f)},SOURCE_SESSION_FLAG={'name':a46_0x386d4b(0x201),'type':'string','description':a46_0x386d4b(0x1e5)};function normalizeFunctionName(_0x148cf3){const _0x15ce21=a46_0x386d4b,_0x5f0818=String(_0x148cf3||'')[_0x15ce21(0x21a)]();if(!_0x5f0818||!FUNCTION_NAME_PATTERN['test'](_0x5f0818))throw CliErrors['validation'](_0x15ce21(0x1df));return _0x5f0818;}function readScriptFile(_0x5de2dc){const _0x43f685=a46_0x386d4b;if(!_0x5de2dc)throw CliErrors[_0x43f685(0x212)](_0x43f685(0x20c));if(!existsSync(_0x5de2dc))throw CliErrors[_0x43f685(0x212)](_0x43f685(0x1fd)+_0x5de2dc);if(!statSync(_0x5de2dc)[_0x43f685(0x1de)]())throw CliErrors[_0x43f685(0x212)](_0x43f685(0x219)+_0x5de2dc);const _0x3d95f9=readFileSync(_0x5de2dc,_0x43f685(0x20b));if(!_0x3d95f9[_0x43f685(0x21a)]())throw CliErrors[_0x43f685(0x212)](_0x43f685(0x200));return _0x3d95f9;}function optionalTrimmed(_0x1d7eb9){const _0x162aba=a46_0x386d4b,_0xff11ea=String(_0x1d7eb9||'')[_0x162aba(0x21a)]();return _0xff11ea||undefined;}function summarizeBff(_0x516800){const _0x3bb80d=a46_0x386d4b;return{'id':_0x516800['id'],'appCode':_0x516800['appCode'],'functionName':_0x516800[_0x3bb80d(0x1e9)],'description':_0x516800[_0x3bb80d(0x1ec)],'scriptType':_0x516800[_0x3bb80d(0x1f7)],'version':_0x516800[_0x3bb80d(0x20d)],'gmtModified':_0x516800[_0x3bb80d(0x1f1)],'updateTime':_0x516800[_0x3bb80d(0x1e7)]};}function detailBff(_0x172bfa){const _0x31c346=a46_0x386d4b;return{'id':_0x172bfa['id'],'appCode':_0x172bfa[_0x31c346(0x208)],'functionName':_0x172bfa[_0x31c346(0x1e9)],'description':_0x172bfa[_0x31c346(0x1ec)],'scriptType':_0x172bfa[_0x31c346(0x1f7)],'scriptContent':_0x172bfa['scriptContent']??'','config':_0x172bfa[_0x31c346(0x20a)],'version':_0x172bfa[_0x31c346(0x20d)],'createUserId':_0x172bfa[_0x31c346(0x1e3)],'gmtCreate':_0x172bfa['gmtCreate'],'gmtModified':_0x172bfa[_0x31c346(0x1f1)],'createTime':_0x172bfa[_0x31c346(0x202)],'updateTime':_0x172bfa['updateTime']};}function a46_0x7a76(){const _0x2b00fd=['create','gmtModified','read','exec','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','length','Preview:\x20create\x20personal\x20BFF\x20','scriptType','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','16974vcoopd','460ZVYMya','669526bNUpKS','personal-bff','File\x20not\x20found:\x20','list','scriptContent','Personal\x20BFF\x20script\x20file\x20is\x20blank.','source-session-id','createTime','keys','Preview:\x20update\x20personal\x20BFF\x20','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','24PFBQWy','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','appCode','bool','config','utf8','File\x20path\x20is\x20required.','version','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','Personal\x20BFF\x20description','detail','1611519AhxitC','validation','Show\x20one\x20personal\x20BFF\x20by\x20id','根据\x20ID\x20更新个人\x20BFF','build','/client/runtime-bff/personal/','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','File\x20is\x20not\x20a\x20regular\x20file:\x20','trim','151773xJsHyb','175563vBzdVS','update','map','name','verbose','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','flag','Personal\x20BFF\x20script\x20ID','file','/client/runtime-bff/personal/create','POST','isFile','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','write','num','isArray','createUserId','params','Optional\x20source\x20RuntimeAgent\x20session\x20id','--params\x20must\x20be\x20a\x20JSON\x20object.','updateTime','6980085UYdEji','functionName','1261656bCspXY','string','description','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','str','body'];a46_0x7a76=function(){return _0x2b00fd;};return a46_0x7a76();}function buildCreateInput(_0x42e872){const _0x1cc679=a46_0x386d4b;return{'functionName':normalizeFunctionName(_0x42e872['str'](_0x1cc679(0x21f))),...optionalTrimmed(_0x42e872[_0x1cc679(0x1ee)](_0x1cc679(0x1ec)))?{'description':optionalTrimmed(_0x42e872['str']('description'))}:{},'scriptContent':readScriptFile(_0x42e872[_0x1cc679(0x1ee)](_0x1cc679(0x224))),...optionalTrimmed(_0x42e872['str'](_0x1cc679(0x201)))?{'sourceSessionId':optionalTrimmed(_0x42e872[_0x1cc679(0x1ee)]('source-session-id'))}:{}};}function buildUpdateInput(_0x3dd959){const _0xbedb3d=a46_0x386d4b,_0x38d65d={};optionalTrimmed(_0x3dd959[_0xbedb3d(0x1ee)](_0xbedb3d(0x21f)))&&(_0x38d65d['functionName']=normalizeFunctionName(_0x3dd959[_0xbedb3d(0x1ee)]('name')));_0x3dd959[_0xbedb3d(0x222)]('description')!==undefined&&(_0x38d65d[_0xbedb3d(0x1ec)]=_0x3dd959[_0xbedb3d(0x1ee)]('description'));optionalTrimmed(_0x3dd959[_0xbedb3d(0x1ee)]('file'))&&(_0x38d65d[_0xbedb3d(0x1ff)]=readScriptFile(_0x3dd959[_0xbedb3d(0x1ee)](_0xbedb3d(0x224))));_0x3dd959[_0xbedb3d(0x222)](_0xbedb3d(0x201))!==undefined&&(_0x38d65d['sourceSessionId']=_0x3dd959['str'](_0xbedb3d(0x201)));if(Object[_0xbedb3d(0x203)](_0x38d65d)[_0xbedb3d(0x1f5)]===0x0)throw CliErrors['validation'](_0xbedb3d(0x1f8));return _0x38d65d;}function parseExecParams(_0x48822d){const _0x44fe46=a46_0x386d4b,_0x3d7dd1=parseJsonParams(_0x48822d)??{};if(Array[_0x44fe46(0x1e2)](_0x3d7dd1))throw CliErrors['validation'](_0x44fe46(0x1e6));return _0x3d7dd1;}const personalBffList={'service':a46_0x386d4b(0x1fc),'command':a46_0x386d4b(0x1fe),'description':a46_0x386d4b(0x218),'risk':a46_0x386d4b(0x1f2),'flags':[VERBOSE_FLAG],async 'execute'(_0x9799d6){const _0x404fff=a46_0x386d4b,_0x576a9a=await listPersonalBffs(_0x9799d6[_0x404fff(0x208)]);return{'ok':!![],'data':{'total':_0x576a9a[_0x404fff(0x1f5)],'items':_0x9799d6[_0x404fff(0x209)](_0x404fff(0x220))?_0x576a9a:_0x576a9a[_0x404fff(0x21e)](summarizeBff)}};}},personalBffDetail={'service':a46_0x386d4b(0x1fc),'command':a46_0x386d4b(0x210),'description':a46_0x386d4b(0x213),'risk':a46_0x386d4b(0x1f2),'flags':[{...ID_FLAG,'description':a46_0x386d4b(0x223)}],async 'execute'(_0x3ed416){const _0x2384a4=a46_0x386d4b,_0x2b02ef=await getPersonalBff(_0x3ed416['num']('id'),_0x3ed416[_0x2384a4(0x208)]);return{'ok':!![],'data':detailBff(_0x2b02ef)};}},personalBffCreate={'service':a46_0x386d4b(0x1fc),'command':a46_0x386d4b(0x1f0),'description':'根据本地脚本文件创建个人\x20BFF','risk':a46_0x386d4b(0x1e0),'confirmationDescription':a46_0x386d4b(0x1f4),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x1534af){const _0x73d94b=a46_0x386d4b,_0x1f4768=buildCreateInput(_0x1534af),_0x3858b0=await createPersonalBff(_0x1534af[_0x73d94b(0x208)],_0x1f4768);return{'ok':!![],'data':detailBff(_0x3858b0),'message':'Created\x20personal\x20BFF\x20'+_0x3858b0['id']+(_0x3858b0[_0x73d94b(0x1e9)]?'\x20('+_0x3858b0[_0x73d94b(0x1e9)]+')':'')};},async 'dryRun'(_0x1beeb9){const _0x2710c8=a46_0x386d4b,_0x1d9a62=buildCreateInput(_0x1beeb9);return dryRun(_0x2710c8(0x226),_0x2710c8(0x225))[_0x2710c8(0x1ef)]({'appCode':_0x1beeb9[_0x2710c8(0x208)],..._0x1d9a62})[_0x2710c8(0x1ec)](_0x2710c8(0x1f6)+_0x1d9a62[_0x2710c8(0x1e9)])[_0x2710c8(0x215)]();}},personalBffUpdate={'service':a46_0x386d4b(0x1fc),'command':a46_0x386d4b(0x21d),'description':a46_0x386d4b(0x214),'risk':a46_0x386d4b(0x1e0),'confirmationDescription':a46_0x386d4b(0x1ed),'flags':[{...ID_FLAG,'description':a46_0x386d4b(0x223)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x40a010){const _0xa896c4=a46_0x386d4b,_0x5c0947=_0x40a010[_0xa896c4(0x1e1)]('id'),_0x464310=buildUpdateInput(_0x40a010),_0xc585d7=await updatePersonalBff(_0x5c0947,_0x40a010[_0xa896c4(0x208)],_0x464310);return{'ok':!![],'data':detailBff(_0xc585d7),'message':'Updated\x20personal\x20BFF\x20'+_0xc585d7['id']+(_0xc585d7[_0xa896c4(0x1e9)]?'\x20('+_0xc585d7[_0xa896c4(0x1e9)]+')':'')};},async 'dryRun'(_0x3cf4d6){const _0x3aca13=a46_0x386d4b,_0xcec296=_0x3cf4d6[_0x3aca13(0x1e1)]('id'),_0x592033=buildUpdateInput(_0x3cf4d6);return dryRun(_0x3aca13(0x226),_0x3aca13(0x216)+_0xcec296+'/update')[_0x3aca13(0x1ef)]({'appCode':_0x3cf4d6[_0x3aca13(0x208)],..._0x592033})[_0x3aca13(0x1ec)](_0x3aca13(0x204)+_0xcec296)[_0x3aca13(0x215)]();}},personalBffExec={'service':a46_0x386d4b(0x1fc),'command':a46_0x386d4b(0x1f3),'description':a46_0x386d4b(0x20e),'risk':a46_0x386d4b(0x1e0),'confirmationDescription':a46_0x386d4b(0x217),'flags':[{...ID_FLAG,'description':a46_0x386d4b(0x223)},{...PARAMS_FLAG,'description':a46_0x386d4b(0x221)}],async 'validate'(_0x5f1fc4){const _0x1a6c73=a46_0x386d4b;parseExecParams(_0x5f1fc4['str'](_0x1a6c73(0x1e4)));},async 'execute'(_0x3b9bd2){const _0x88e831=a46_0x386d4b,_0x11ad00=_0x3b9bd2[_0x88e831(0x1e1)]('id'),_0x848e9a=parseExecParams(_0x3b9bd2['str']('params')),_0x555a5d=await executePersonalBff(_0x11ad00,_0x3b9bd2[_0x88e831(0x208)],_0x848e9a);return{'ok':!![],'data':{'result':_0x555a5d},'message':'Executed\x20personal\x20BFF\x20'+_0x11ad00};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a47_0x112f76=a47_0x4064;(function(_0x5e02fe,_0x54eb29){const _0x30a854=a47_0x4064,_0x4e14f8=_0x5e02fe();while(!![]){try{const _0x227595=-parseInt(_0x30a854(0xe3))/0x1*(parseInt(_0x30a854(0x103))/0x2)+-parseInt(_0x30a854(0x101))/0x3*(-parseInt(_0x30a854(0xd9))/0x4)+-parseInt(_0x30a854(0xfd))/0x5+-parseInt(_0x30a854(0xf1))/0x6*(-parseInt(_0x30a854(0xee))/0x7)+parseInt(_0x30a854(0xe8))/0x8+parseInt(_0x30a854(0x110))/0x9+parseInt(_0x30a854(0xe1))/0xa;if(_0x227595===_0x54eb29)break;else _0x4e14f8['push'](_0x4e14f8['shift']());}catch(_0x28074c){_0x4e14f8['push'](_0x4e14f8['shift']());}}}(a47_0x410a,0xb2547));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';function a47_0x4064(_0x1186c6,_0x4fb2c3){_0x1186c6=_0x1186c6-0xd8;const _0x410ad1=a47_0x410a();let _0x406408=_0x410ad1[_0x1186c6];return _0x406408;}import{scheduleDefinitions}from'../commands/schedule/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{roleDefinitions}from'../commands/role/index.js';function a47_0x410a(){const _0x5e6b7e=['read','6375880OglXmG','CLI\x20Built-in\x20Skill','service','defaultCommand','description','SQL\x20Queries','75691RyFVEe','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','set','258UtnaPr','OCR','Workspace','File','isSingleCommand','\x20\x20[high-risk-write]','command','app\x20use','get','has','Runtime\x20Permissions','App\x20Management','5471770iircuu','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','push','Artifacts','327OUapnn','run','2398WsIuiF','risk','Schema','Skills','Runtime\x20Roles','Self\x20Update','login','app','BFF\x20Scripts','Authentication','list','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','Instant\x20API','8951859ySvsNa','values','install','clear','User\x20Accounts','show','app\x20init','3176edyyyL','API\x20Documentation','Diagnostics','Configuration','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','logs\x20clear','write','Service\x20Tree','9036660oarjHt','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','1186hmHImS','from','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','config-list'];a47_0x410a=function(){return _0x5e6b7e;};return a47_0x410a();}import{permitDefinitions}from'../commands/permit/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x714107){const _0x3546a2=a47_0x4064;for(const _0x3569a9 of _0x714107){definitions[_0x3546a2(0xf0)](_0x3569a9[_0x3546a2(0xea)]+':'+_0x3569a9[_0x3546a2(0xf7)],_0x3569a9);let _0x5b5888=serviceGroups[_0x3546a2(0xf9)](_0x3569a9[_0x3546a2(0xea)]);!_0x5b5888&&(_0x5b5888=[],serviceGroups[_0x3546a2(0xf0)](_0x3569a9[_0x3546a2(0xea)],_0x5b5888)),_0x5b5888[_0x3546a2(0xff)](_0x3569a9);}}function registerService(_0x4f3122,_0x828a8b,_0x295be0){const _0x429060=a47_0x4064;registerDefinitions(_0x828a8b);const _0x325432=_0x2eb264=>_0x2eb264===_0x429060(0xe7)?'':_0x2eb264===_0x429060(0xdf)?'\x20\x20[write]':_0x429060(0xf6),_0x2c45ec={'service':_0x828a8b[0x0][_0x429060(0xea)],'label':_0x4f3122,'commands':_0x828a8b['map'](_0x2598d2=>({'command':_0x2598d2[_0x429060(0xf7)],'description':_0x2598d2[_0x429060(0xec)],'tag':_0x325432(_0x2598d2[_0x429060(0x104)])})),'defaultCommand':_0x295be0?.[_0x429060(0xeb)]??(_0x295be0?.[_0x429060(0xf5)]?_0x828a8b[0x0]['command']:undefined),'isSingleCommand':_0x295be0?.['isSingleCommand']};serviceRegistry['push'](_0x2c45ec),serviceByName[_0x429060(0xf0)](_0x2c45ec[_0x429060(0xea)],_0x2c45ec);}registerService(a47_0x112f76(0x10c),authDefinitions,{'defaultCommand':a47_0x112f76(0x109)}),registerService(a47_0x112f76(0x114),userAccountDefinitions),registerService(a47_0x112f76(0xfc),appDefinitions,{'defaultCommand':a47_0x112f76(0x10d)}),registerService(a47_0x112f76(0xf3),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a47_0x112f76(0xdc),configDefinitions,{'defaultCommand':'list'}),registerService(a47_0x112f76(0x107),roleDefinitions,{'defaultCommand':a47_0x112f76(0x10d)}),registerService(a47_0x112f76(0xfb),permitDefinitions),registerService(a47_0x112f76(0xda),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a47_0x112f76(0x10f),dataDefinitions),registerService(a47_0x112f76(0xed),sqlDefinitions),registerService(a47_0x112f76(0x10b),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a47_0x112f76(0x100),artifactDefinitions),registerService(a47_0x112f76(0xf4),fileDefinitions),registerService(a47_0x112f76(0xf2),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService('Notification\x20Configs',notificationDefinitions,{'defaultCommand':a47_0x112f76(0xe6)}),registerService('Agent\x20Schedules',scheduleDefinitions,{'defaultCommand':'list'}),registerService(a47_0x112f76(0xe0),serviceDefinitions,{'defaultCommand':a47_0x112f76(0x10d)}),registerService(a47_0x112f76(0x106),skillDefinitions,{'defaultCommand':a47_0x112f76(0x112)}),registerService(a47_0x112f76(0xe9),cliSkillDefinitions,{'defaultCommand':a47_0x112f76(0x112)}),registerService(a47_0x112f76(0x108),[updateDefinition],{'defaultCommand':a47_0x112f76(0x102),'isSingleCommand':!![]}),registerService(a47_0x112f76(0xdb),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a47_0x112f76(0x105),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a47_0x112f76(0x115)});export function findDefinition(_0x5cf1ed,_0x2551c){return definitions['get'](_0x5cf1ed+':'+_0x2551c);}export function resolveRemovedCommand(_0x49e671,_0xf1ee0e){const _0xab54e8=a47_0x112f76;if(_0x49e671===_0xab54e8(0x10a)&&_0xf1ee0e==='init')return{'command':_0xab54e8(0xd8),'message':_0xab54e8(0xdd),'hint':_0xab54e8(0xe2)};if(_0x49e671===_0xab54e8(0x10a)&&_0xf1ee0e==='use')return{'command':_0xab54e8(0xf8),'message':_0xab54e8(0x10e),'hint':_0xab54e8(0xe5)};if(_0x49e671==='logs'&&_0xf1ee0e===_0xab54e8(0x113))return{'command':_0xab54e8(0xde),'message':_0xab54e8(0xfe),'hint':_0xab54e8(0xef)};return undefined;}export function isKnownService(_0x3b0782){const _0x4aaf8c=a47_0x112f76;return serviceByName[_0x4aaf8c(0xfa)](_0x3b0782);}export function getServiceEntry(_0xa70e9a){const _0x5e7848=a47_0x112f76;return serviceByName[_0x5e7848(0xf9)](_0xa70e9a);}export function getAllDefinitions(){const _0x5aaa3f=a47_0x112f76;return Array[_0x5aaa3f(0xe4)](definitions[_0x5aaa3f(0x111)]());}
1
+ const a47_0x4de89e=a47_0x2aaa;(function(_0x2d71a2,_0x140f46){const _0x225b23=a47_0x2aaa,_0x59bcd1=_0x2d71a2();while(!![]){try{const _0x783240=-parseInt(_0x225b23(0xd6))/0x1+parseInt(_0x225b23(0xc3))/0x2+parseInt(_0x225b23(0xb2))/0x3*(parseInt(_0x225b23(0xb8))/0x4)+parseInt(_0x225b23(0xae))/0x5*(parseInt(_0x225b23(0xbb))/0x6)+-parseInt(_0x225b23(0xd7))/0x7+-parseInt(_0x225b23(0xa9))/0x8+parseInt(_0x225b23(0xd9))/0x9;if(_0x783240===_0x140f46)break;else _0x59bcd1['push'](_0x59bcd1['shift']());}catch(_0x43e55d){_0x59bcd1['push'](_0x59bcd1['shift']());}}}(a47_0x1876,0xeece1));import{authDefinitions}from'../commands/auth/index.js';function a47_0x2aaa(_0x5a8d26,_0x21b8e9){_0x5a8d26=_0x5a8d26-0xa6;const _0x18769c=a47_0x1876();let _0x2aaa82=_0x18769c[_0x5a8d26];return _0x2aaa82;}import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';function a47_0x1876(){const _0x254ef6=['15200696AMbLzO','set','\x20\x20[high-risk-write]','User\x20Accounts','show','305285fSSuDi','Configuration','read','push','10173UiBdPJ','Runtime\x20App\x20Config','app','install','BFF\x20Scripts','app\x20init','1176zDQTKY','login','list','6nazDmU','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','service','Datasets','Agent\x20Schedules','write','config-list','values','2717642KlLIJG','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','Knowledge\x20Base','logs','Runtime\x20Permissions','Skills','File','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','App\x20Management','Personal\x20BFF','init','Instant\x20API','risk','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','Authentication','CLI\x20Built-in\x20Skill','defaultCommand','Self\x20Update','get','1272694kMbDwX','11090513ynwBjp','has','29866077hXEoPG','Notification\x20Configs','isSingleCommand','clear','Runtime\x20Roles','map','Workspace','Logs','command','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.'];a47_0x1876=function(){return _0x254ef6;};return a47_0x1876();}import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3fc353){const _0x4504e7=a47_0x2aaa;for(const _0x24d6a3 of _0x3fc353){definitions[_0x4504e7(0xaa)](_0x24d6a3[_0x4504e7(0xbd)]+':'+_0x24d6a3[_0x4504e7(0xa7)],_0x24d6a3);let _0x1902fc=serviceGroups[_0x4504e7(0xd5)](_0x24d6a3[_0x4504e7(0xbd)]);!_0x1902fc&&(_0x1902fc=[],serviceGroups[_0x4504e7(0xaa)](_0x24d6a3[_0x4504e7(0xbd)],_0x1902fc)),_0x1902fc['push'](_0x24d6a3);}}function registerService(_0x450847,_0x4f41a8,_0x39d5ba){const _0x47257a=a47_0x2aaa;registerDefinitions(_0x4f41a8);const _0x2ad453=_0x32a067=>_0x32a067===_0x47257a(0xb0)?'':_0x32a067===_0x47257a(0xc0)?'\x20\x20[write]':_0x47257a(0xab),_0x2f3554={'service':_0x4f41a8[0x0][_0x47257a(0xbd)],'label':_0x450847,'commands':_0x4f41a8[_0x47257a(0xde)](_0x3203a3=>({'command':_0x3203a3[_0x47257a(0xa7)],'description':_0x3203a3['description'],'tag':_0x2ad453(_0x3203a3[_0x47257a(0xcf)])})),'defaultCommand':_0x39d5ba?.[_0x47257a(0xd3)]??(_0x39d5ba?.[_0x47257a(0xdb)]?_0x4f41a8[0x0][_0x47257a(0xa7)]:undefined),'isSingleCommand':_0x39d5ba?.['isSingleCommand']};serviceRegistry[_0x47257a(0xb1)](_0x2f3554),serviceByName[_0x47257a(0xaa)](_0x2f3554['service'],_0x2f3554);}registerService(a47_0x4de89e(0xd1),authDefinitions,{'defaultCommand':a47_0x4de89e(0xb9)}),registerService(a47_0x4de89e(0xac),userAccountDefinitions),registerService(a47_0x4de89e(0xcb),appDefinitions,{'defaultCommand':'list'}),registerService(a47_0x4de89e(0xdf),workspaceDefinitions),registerService(a47_0x4de89e(0xb3),appConfigDefinitions),registerService(a47_0x4de89e(0xaf),configDefinitions,{'defaultCommand':a47_0x4de89e(0xba)}),registerService(a47_0x4de89e(0xdd),roleDefinitions,{'defaultCommand':'list'}),registerService(a47_0x4de89e(0xc7),permitDefinitions),registerService('API\x20Documentation',apiDocDefinitions),registerService(a47_0x4de89e(0xbe),datasetDefinitions),registerService(a47_0x4de89e(0xce),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a47_0x4de89e(0xb6),bffDefinitions),registerService(a47_0x4de89e(0xcc),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a47_0x4de89e(0xc9),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a47_0x4de89e(0xc5),kbDefinitions),registerService(a47_0x4de89e(0xda),notificationDefinitions,{'defaultCommand':a47_0x4de89e(0xc1)}),registerService(a47_0x4de89e(0xbf),scheduleDefinitions,{'defaultCommand':'list'}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a47_0x4de89e(0xba)}),registerService(a47_0x4de89e(0xc8),skillDefinitions,{'defaultCommand':'install'}),registerService(a47_0x4de89e(0xd2),cliSkillDefinitions,{'defaultCommand':a47_0x4de89e(0xb5)}),registerService(a47_0x4de89e(0xd4),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a47_0x4de89e(0xa6),logsDefinitions,{'defaultCommand':a47_0x4de89e(0xad)});export function findDefinition(_0xb9fed,_0x40b257){return definitions['get'](_0xb9fed+':'+_0x40b257);}export function resolveRemovedCommand(_0x28bc06,_0xe4e454){const _0x518a04=a47_0x4de89e;if(_0x28bc06===_0x518a04(0xb4)&&_0xe4e454===_0x518a04(0xcd))return{'command':_0x518a04(0xb7),'message':_0x518a04(0xca),'hint':_0x518a04(0xc4)};if(_0x28bc06===_0x518a04(0xb4)&&_0xe4e454==='use')return{'command':'app\x20use','message':_0x518a04(0xd0),'hint':_0x518a04(0xbc)};if(_0x28bc06===_0x518a04(0xc6)&&_0xe4e454===_0x518a04(0xdc))return{'command':'logs\x20clear','message':_0x518a04(0xa8),'hint':'Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.'};return undefined;}export function isKnownService(_0x40f774){const _0x3eea0e=a47_0x4de89e;return serviceByName[_0x3eea0e(0xd8)](_0x40f774);}export function getServiceEntry(_0x2d5080){return serviceByName['get'](_0x2d5080);}export function getAllDefinitions(){const _0x330d45=a47_0x4de89e;return Array['from'](definitions[_0x330d45(0xc2)]());}
@@ -1 +1 @@
1
- function a48_0x2570(_0x8d47dd,_0x3ede6a){_0x8d47dd=_0x8d47dd-0x138;const _0x4f7cb9=a48_0x4f7c();let _0x2570ac=_0x4f7cb9[_0x8d47dd];return _0x2570ac;}const a48_0x263513=a48_0x2570;(function(_0x145025,_0x20ef79){const _0x3d5316=a48_0x2570,_0x5d0e50=_0x145025();while(!![]){try{const _0x43b630=parseInt(_0x3d5316(0x150))/0x1*(parseInt(_0x3d5316(0x139))/0x2)+-parseInt(_0x3d5316(0x14b))/0x3+-parseInt(_0x3d5316(0x141))/0x4*(parseInt(_0x3d5316(0x138))/0x5)+parseInt(_0x3d5316(0x147))/0x6+-parseInt(_0x3d5316(0x154))/0x7+parseInt(_0x3d5316(0x143))/0x8*(-parseInt(_0x3d5316(0x148))/0x9)+parseInt(_0x3d5316(0x13c))/0xa*(parseInt(_0x3d5316(0x142))/0xb);if(_0x43b630===_0x20ef79)break;else _0x5d0e50['push'](_0x5d0e50['shift']());}catch(_0x3b80b8){_0x5d0e50['push'](_0x5d0e50['shift']());}}}(a48_0x4f7c,0x4ec49));import{createRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{projectRuntimeRole,runtimeRoleWriteResult}from'../../commands/role/shared.js';function a48_0x4f7c(){const _0x557afe=['2120174gXQeoo','152495GJqsBD','6GNMMSv','string','POST','6911390meoqBO','Create\x20a\x20runtime\x20CUSTOM\x20role','/client/permit/role/create','Optional\x20role\x20remark','create','8moSZXI','11yafLrK','8aXsEPb','trim','validation','high-risk-write','2224242EfiBHk','1848222bmAcok','Role\x20name','appCode','1188633OPRvFg','在当前运行应用中创建一个自定义角色;创建后可用于成员与资源权限配置。','CUSTOM','str','body','75412imCDxd','remark','build','--name\x20must\x20not\x20be\x20blank.'];a48_0x4f7c=function(){return _0x557afe;};return a48_0x4f7c();}function input(_0x1bcf45){const _0xded1a8=a48_0x2570,_0x4a7960=_0x1bcf45[_0xded1a8(0x14e)]('name')['trim']();if(!_0x4a7960)throw CliErrors[_0xded1a8(0x145)](_0xded1a8(0x153));const _0x3a4deb=_0x1bcf45['str'](_0xded1a8(0x151))[_0xded1a8(0x144)]();return{'appCode':_0x1bcf45[_0xded1a8(0x14a)],'roleName':_0x4a7960,..._0x3a4deb?{'remark':_0x3a4deb}:{}};}export const roleCreate={'service':'role','command':'create','description':a48_0x263513(0x13d),'risk':a48_0x263513(0x146),'confirmationDescription':a48_0x263513(0x14c),'flags':[{'name':'name','type':a48_0x263513(0x13a),'required':!![],'description':a48_0x263513(0x149)},{'name':'remark','type':a48_0x263513(0x13a),'description':a48_0x263513(0x13f)}],async 'validate'(_0x13bb46){input(_0x13bb46);},async 'dryRun'(_0x1826d0){const _0x20b2d2=a48_0x263513;return dryRun(_0x20b2d2(0x13b),_0x20b2d2(0x13e))[_0x20b2d2(0x14f)]({'roleType':_0x20b2d2(0x14d),...input(_0x1826d0)})['description']('Preview:\x20create\x20a\x20runtime\x20CUSTOM\x20role')[_0x20b2d2(0x152)]();},async 'execute'(_0x10885f){const _0x1219b5=a48_0x263513,_0x2d2411=await createRuntimeAppRole(input(_0x10885f));return{'ok':!![],'data':runtimeRoleWriteResult(_0x1219b5(0x140),{'roleId':_0x2d2411['id']},null,projectRuntimeRole(_0x2d2411),{'method':_0x1219b5(0x13b),'path':_0x1219b5(0x13e)})};}};
1
+ function a48_0x4f1d(_0x5a9aa0,_0x1702de){_0x5a9aa0=_0x5a9aa0-0x160;const _0x4469f1=a48_0x4469();let _0x4f1db2=_0x4469f1[_0x5a9aa0];return _0x4f1db2;}const a48_0x18c7a5=a48_0x4f1d;(function(_0x475845,_0x571853){const _0x137719=a48_0x4f1d,_0x53d687=_0x475845();while(!![]){try{const _0x40eed4=parseInt(_0x137719(0x175))/0x1*(-parseInt(_0x137719(0x17b))/0x2)+-parseInt(_0x137719(0x168))/0x3+parseInt(_0x137719(0x178))/0x4+-parseInt(_0x137719(0x174))/0x5+-parseInt(_0x137719(0x170))/0x6+-parseInt(_0x137719(0x16a))/0x7*(-parseInt(_0x137719(0x163))/0x8)+-parseInt(_0x137719(0x17a))/0x9*(-parseInt(_0x137719(0x16c))/0xa);if(_0x40eed4===_0x571853)break;else _0x53d687['push'](_0x53d687['shift']());}catch(_0x563ad0){_0x53d687['push'](_0x53d687['shift']());}}}(a48_0x4469,0x56dfe));import{createRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{projectRuntimeRole,runtimeRoleWriteResult}from'../../commands/role/shared.js';function input(_0x28a053){const _0x118505=a48_0x4f1d,_0x39bbbb=_0x28a053[_0x118505(0x177)](_0x118505(0x166))[_0x118505(0x162)]();if(!_0x39bbbb)throw CliErrors[_0x118505(0x16d)](_0x118505(0x167));const _0x118753=_0x28a053[_0x118505(0x177)]('remark')['trim']();return{'appCode':_0x28a053[_0x118505(0x160)],'roleName':_0x39bbbb,..._0x118753?{'remark':_0x118753}:{}};}function a48_0x4469(){const _0xbcffa6=['3618000lGSLSR','string','high-risk-write','body','933240nJhnIM','1EEDtaT','Create\x20a\x20runtime\x20CUSTOM\x20role','str','2720192WjVNdD','build','29259sUmqaw','328252LLAODr','在当前运行应用中创建一个自定义角色;创建后可用于成员与资源权限配置。','CUSTOM','appCode','Optional\x20role\x20remark','trim','3711568EuqYzJ','Preview:\x20create\x20a\x20runtime\x20CUSTOM\x20role','/client/permit/role/create','name','--name\x20must\x20not\x20be\x20blank.','156597NhCNsR','create','7uJSSRt','description','670eyHPkB','validation','POST','role'];a48_0x4469=function(){return _0xbcffa6;};return a48_0x4469();}export const roleCreate={'service':a48_0x18c7a5(0x16f),'command':a48_0x18c7a5(0x169),'description':a48_0x18c7a5(0x176),'risk':a48_0x18c7a5(0x172),'confirmationDescription':a48_0x18c7a5(0x17c),'flags':[{'name':'name','type':a48_0x18c7a5(0x171),'required':!![],'description':'Role\x20name'},{'name':'remark','type':a48_0x18c7a5(0x171),'description':a48_0x18c7a5(0x161)}],async 'validate'(_0x5cec46){input(_0x5cec46);},async 'dryRun'(_0x10d3a1){const _0x1725e4=a48_0x18c7a5;return dryRun(_0x1725e4(0x16e),'/client/permit/role/create')[_0x1725e4(0x173)]({'roleType':_0x1725e4(0x17d),...input(_0x10d3a1)})[_0x1725e4(0x16b)](_0x1725e4(0x164))[_0x1725e4(0x179)]();},async 'execute'(_0x152a34){const _0x27def7=a48_0x18c7a5,_0x4f2596=await createRuntimeAppRole(input(_0x152a34));return{'ok':!![],'data':runtimeRoleWriteResult(_0x27def7(0x169),{'roleId':_0x4f2596['id']},null,projectRuntimeRole(_0x4f2596),{'method':_0x27def7(0x16e),'path':_0x27def7(0x165)})};}};
@@ -1 +1 @@
1
- function a49_0x17bb(){const _0x106915=['78911QKAFSL','/client/permit/role/delete','6QBSSbN','87777GkJhLB','803SJwDmF','69kMALuY','build','151044IiGGsa','delete','304YPntvg','2513610hMrmOW','POST','34wWnVHB','删除当前运行应用中的自定义角色;该角色的成员关系和权限配置可能随之失效。','role','11704oNceFW','num','appCode','Preview:\x20delete\x20a\x20runtime\x20CUSTOM\x20role','10616WBqErt','Delete\x20a\x20runtime\x20CUSTOM\x20role','description','1460920KaaZIr'];a49_0x17bb=function(){return _0x106915;};return a49_0x17bb();}function a49_0x15f2(_0x66e7c3,_0xd8f4cc){_0x66e7c3=_0x66e7c3-0x106;const _0x17bba0=a49_0x17bb();let _0x15f237=_0x17bba0[_0x66e7c3];return _0x15f237;}const a49_0x29f588=a49_0x15f2;(function(_0xda790e,_0x1a639f){const _0x539bf6=a49_0x15f2,_0x579847=_0xda790e();while(!![]){try{const _0x2c4dde=parseInt(_0x539bf6(0x114))/0x1*(parseInt(_0x539bf6(0x111))/0x2)+parseInt(_0x539bf6(0x10a))/0x3*(parseInt(_0x539bf6(0x118))/0x4)+parseInt(_0x539bf6(0x11b))/0x5*(parseInt(_0x539bf6(0x107))/0x6)+parseInt(_0x539bf6(0x11c))/0x7+-parseInt(_0x539bf6(0x10e))/0x8*(-parseInt(_0x539bf6(0x108))/0x9)+parseInt(_0x539bf6(0x10f))/0xa+-parseInt(_0x539bf6(0x109))/0xb*(parseInt(_0x539bf6(0x10c))/0xc);if(_0x2c4dde===_0x1a639f)break;else _0x579847['push'](_0x579847['shift']());}catch(_0x47ff52){_0x579847['push'](_0x579847['shift']());}}}(a49_0x17bb,0x4115f));import{deleteRuntimeAppRole}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';async function prepare(_0x41b220){const _0x3f9a6a=a49_0x15f2,_0x62a97b=await getRuntimeRoleById(_0x41b220[_0x3f9a6a(0x116)],_0x41b220[_0x3f9a6a(0x115)]('id'));return assertCustomRuntimeRole(_0x62a97b,_0x3f9a6a(0x10d)),_0x62a97b;}export const roleDelete={'service':a49_0x29f588(0x113),'command':a49_0x29f588(0x10d),'description':a49_0x29f588(0x119),'risk':'high-risk-write','confirmationDescription':a49_0x29f588(0x112),'flags':[ROLE_ID_FLAG],async 'dryRun'(_0x1ada1f){const _0x144894=a49_0x29f588,_0x2a0056=await prepare(_0x1ada1f);return dryRun('POST',_0x144894(0x106))['body']({'id':_0x2a0056['id']})[_0x144894(0x11a)](_0x144894(0x117))[_0x144894(0x10b)]();},async 'execute'(_0x36602c){const _0xd4c109=a49_0x29f588,_0x55bf69=await prepare(_0x36602c);return await deleteRuntimeAppRole(_0x55bf69['id']),{'ok':!![],'data':runtimeRoleWriteResult(_0xd4c109(0x10d),{'roleId':_0x55bf69['id']},projectRuntimeRole(_0x55bf69),null,{'method':_0xd4c109(0x110),'path':_0xd4c109(0x106)})};}};
1
+ function a49_0x485b(_0x5ea36a,_0x748c95){_0x5ea36a=_0x5ea36a-0x13d;const _0x469869=a49_0x4698();let _0x485b63=_0x469869[_0x5ea36a];return _0x485b63;}const a49_0x283485=a49_0x485b;(function(_0x478153,_0x5adaa8){const _0x8758b4=a49_0x485b,_0x1e0384=_0x478153();while(!![]){try{const _0xa49592=-parseInt(_0x8758b4(0x14d))/0x1+parseInt(_0x8758b4(0x14e))/0x2+parseInt(_0x8758b4(0x151))/0x3*(parseInt(_0x8758b4(0x143))/0x4)+-parseInt(_0x8758b4(0x144))/0x5*(parseInt(_0x8758b4(0x13f))/0x6)+-parseInt(_0x8758b4(0x146))/0x7*(-parseInt(_0x8758b4(0x14b))/0x8)+parseInt(_0x8758b4(0x14c))/0x9+-parseInt(_0x8758b4(0x140))/0xa;if(_0xa49592===_0x5adaa8)break;else _0x1e0384['push'](_0x1e0384['shift']());}catch(_0x5eac94){_0x1e0384['push'](_0x1e0384['shift']());}}}(a49_0x4698,0xeb9b7));import{deleteRuntimeAppRole}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';async function prepare(_0x1cd084){const _0x36818c=a49_0x485b,_0x287a40=await getRuntimeRoleById(_0x1cd084[_0x36818c(0x150)],_0x1cd084[_0x36818c(0x147)]('id'));return assertCustomRuntimeRole(_0x287a40,_0x36818c(0x148)),_0x287a40;}export const roleDelete={'service':a49_0x283485(0x14a),'command':a49_0x283485(0x148),'description':'Delete\x20a\x20runtime\x20CUSTOM\x20role','risk':a49_0x283485(0x142),'confirmationDescription':a49_0x283485(0x149),'flags':[ROLE_ID_FLAG],async 'dryRun'(_0x1e97f4){const _0x5e990a=a49_0x283485,_0x2a0d0a=await prepare(_0x1e97f4);return dryRun('POST',_0x5e990a(0x14f))['body']({'id':_0x2a0d0a['id']})[_0x5e990a(0x145)](_0x5e990a(0x13e))[_0x5e990a(0x13d)]();},async 'execute'(_0x5ed5fc){const _0x350419=a49_0x283485,_0x5b2aaa=await prepare(_0x5ed5fc);return await deleteRuntimeAppRole(_0x5b2aaa['id']),{'ok':!![],'data':runtimeRoleWriteResult('delete',{'roleId':_0x5b2aaa['id']},projectRuntimeRole(_0x5b2aaa),null,{'method':_0x350419(0x141),'path':_0x350419(0x14f)})};}};function a49_0x4698(){const _0x1efa10=['25375470JHJxXe','POST','high-risk-write','27828RoNeIW','134905hlVYFv','description','28sQUHZr','num','delete','删除当前运行应用中的自定义角色;该角色的成员关系和权限配置可能随之失效。','role','3504152NRTuVh','15640875ttsqGq','1233008zXquEh','2815436ElSBiA','/client/permit/role/delete','appCode','93BokIYY','build','Preview:\x20delete\x20a\x20runtime\x20CUSTOM\x20role','84rFFwvS'];a49_0x4698=function(){return _0x1efa10;};return a49_0x4698();}
@@ -1 +1 @@
1
- const a50_0x51c1f5=a50_0x7110;(function(_0x3bb604,_0x5d7e49){const _0x2d2501=a50_0x7110,_0x3f312b=_0x3bb604();while(!![]){try{const _0x1a49e0=-parseInt(_0x2d2501(0x1e3))/0x1*(parseInt(_0x2d2501(0x1ed))/0x2)+-parseInt(_0x2d2501(0x1e4))/0x3+parseInt(_0x2d2501(0x1ec))/0x4*(-parseInt(_0x2d2501(0x1e2))/0x5)+-parseInt(_0x2d2501(0x1e8))/0x6*(-parseInt(_0x2d2501(0x1e1))/0x7)+-parseInt(_0x2d2501(0x1f0))/0x8*(-parseInt(_0x2d2501(0x1ee))/0x9)+parseInt(_0x2d2501(0x1ea))/0xa*(parseInt(_0x2d2501(0x1e9))/0xb)+parseInt(_0x2d2501(0x1ef))/0xc;if(_0x1a49e0===_0x5d7e49)break;else _0x3f312b['push'](_0x3f312b['shift']());}catch(_0x2475fb){_0x3f312b['push'](_0x3f312b['shift']());}}}(a50_0x19d3,0xe4a3c));import{getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a50_0x7110(_0x2ae4a4,_0x158c72){_0x2ae4a4=_0x2ae4a4-0x1e0;const _0x19d336=a50_0x19d3();let _0x7110aa=_0x19d336[_0x2ae4a4];return _0x7110aa;}function a50_0x19d3(){const _0x1194fc=['num','role','30bGrZIZ','4047747xTNblH','30ytInfD','read','440UMHOhU','3068498bSmYRv','6479271llkTAc','26867496SZwNOi','8XZXDrI','appCode','runtime','903182QsWMgC','79425qNdYbO','1bnGcuS','1469493bjlmJZ','detail'];a50_0x19d3=function(){return _0x1194fc;};return a50_0x19d3();}export const roleDetail={'service':a50_0x51c1f5(0x1e7),'command':a50_0x51c1f5(0x1e5),'description':'Show\x20one\x20runtime\x20role\x20by\x20ID','risk':a50_0x51c1f5(0x1eb),'flags':[ROLE_ID_FLAG],async 'execute'(_0x11790a){const _0x3ba8a3=a50_0x51c1f5,_0x4b2ff8=await getRuntimeRoleById(_0x11790a[_0x3ba8a3(0x1f1)],_0x11790a[_0x3ba8a3(0x1e6)]('id'));return{'ok':!![],'data':{'scope':_0x3ba8a3(0x1e0),'role':projectRuntimeRole(_0x4b2ff8)}};}};
1
+ function a50_0x440c(){const _0x3259df=['172832URElmk','Show\x20one\x20runtime\x20role\x20by\x20ID','1700192HDcNxp','num','8033040ihSYWo','detail','935415nXxWFV','263074FTdGcV','runtime','785835XHFtVf','appCode','528936CfnRAJ','4hCdxwj'];a50_0x440c=function(){return _0x3259df;};return a50_0x440c();}const a50_0x49612d=a50_0x3d17;(function(_0x18719e,_0x4b7cad){const _0x129709=a50_0x3d17,_0x11a68e=_0x18719e();while(!![]){try{const _0x1c067f=-parseInt(_0x129709(0x6e))/0x1*(-parseInt(_0x129709(0x6f))/0x2)+parseInt(_0x129709(0x78))/0x3+parseInt(_0x129709(0x71))/0x4+parseInt(_0x129709(0x75))/0x5+parseInt(_0x129709(0x6d))/0x6+-parseInt(_0x129709(0x76))/0x7+-parseInt(_0x129709(0x73))/0x8;if(_0x1c067f===_0x4b7cad)break;else _0x11a68e['push'](_0x11a68e['shift']());}catch(_0x333d4a){_0x11a68e['push'](_0x11a68e['shift']());}}}(a50_0x440c,0x40fc8));function a50_0x3d17(_0x3af1bc,_0xa72f2d){_0x3af1bc=_0x3af1bc-0x6d;const _0x440c80=a50_0x440c();let _0x3d176d=_0x440c80[_0x3af1bc];return _0x3d176d;}import{getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':'role','command':a50_0x49612d(0x74),'description':a50_0x49612d(0x70),'risk':'read','flags':[ROLE_ID_FLAG],async 'execute'(_0x5d810e){const _0x39681f=a50_0x49612d,_0x1ac66e=await getRuntimeRoleById(_0x5d810e[_0x39681f(0x79)],_0x5d810e[_0x39681f(0x72)]('id'));return{'ok':!![],'data':{'scope':_0x39681f(0x77),'role':projectRuntimeRole(_0x1ac66e)}};}};
@@ -1 +1 @@
1
- (function(_0x2996c8,_0x570732){const _0x53306e=a51_0x12fe,_0x4420d5=_0x2996c8();while(!![]){try{const _0x4324ba=-parseInt(_0x53306e(0x15b))/0x1*(parseInt(_0x53306e(0x155))/0x2)+-parseInt(_0x53306e(0x152))/0x3*(parseInt(_0x53306e(0x156))/0x4)+-parseInt(_0x53306e(0x15a))/0x5*(parseInt(_0x53306e(0x159))/0x6)+parseInt(_0x53306e(0x158))/0x7+parseInt(_0x53306e(0x157))/0x8+parseInt(_0x53306e(0x15c))/0x9+-parseInt(_0x53306e(0x154))/0xa*(-parseInt(_0x53306e(0x153))/0xb);if(_0x4324ba===_0x570732)break;else _0x4420d5['push'](_0x4420d5['shift']());}catch(_0x1570d4){_0x4420d5['push'](_0x4420d5['shift']());}}}(a51_0x6eba,0x924a0));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a51_0x12fe(_0x54df88,_0x4a2529){_0x54df88=_0x54df88-0x152;const _0x6eba48=a51_0x6eba();let _0x12feb6=_0x6eba48[_0x54df88];return _0x12feb6;}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserAdd,roleUserRemove];function a51_0x6eba(){const _0x2ae5ed=['506tkyRlv','422290SRFksu','20UeaBeU','628cLVVLP','800752xZnyBy','415870KNsvYm','133776qHgDBa','50AXbQQE','111764OAouLC','276435MKJBdO','3687dGBQHV'];a51_0x6eba=function(){return _0x2ae5ed;};return a51_0x6eba();}
1
+ (function(_0x29f9e5,_0x1e0d64){const _0x328fc1=a51_0x4587,_0x2c261e=_0x29f9e5();while(!![]){try{const _0x4b8b00=-parseInt(_0x328fc1(0x16a))/0x1+-parseInt(_0x328fc1(0x16f))/0x2*(parseInt(_0x328fc1(0x16e))/0x3)+parseInt(_0x328fc1(0x166))/0x4+parseInt(_0x328fc1(0x169))/0x5*(-parseInt(_0x328fc1(0x168))/0x6)+parseInt(_0x328fc1(0x167))/0x7*(-parseInt(_0x328fc1(0x16d))/0x8)+parseInt(_0x328fc1(0x16b))/0x9+parseInt(_0x328fc1(0x16c))/0xa;if(_0x4b8b00===_0x1e0d64)break;else _0x2c261e['push'](_0x2c261e['shift']());}catch(_0x14e184){_0x2c261e['push'](_0x2c261e['shift']());}}}(a51_0x5dc5,0xabea4));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';function a51_0x5dc5(){const _0x353f6b=['2YqyjFg','1256224lVPFiD','63HcqrFL','6mpXlYk','1595115tNntKb','1184825qXZtNs','11585349uSSCTx','26289110gAshgq','651768IdjQEk','3866931yaJrKa'];a51_0x5dc5=function(){return _0x353f6b;};return a51_0x5dc5();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a51_0x4587(_0xcdfc07,_0x39294e){_0xcdfc07=_0xcdfc07-0x166;const _0x5dc554=a51_0x5dc5();let _0x45874e=_0x5dc554[_0xcdfc07];return _0x45874e;}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- function a52_0x23b3(){const _0x589360=['role','2297058FgLsii','4009164FZJXrp','slice','isSafeInteger','pagesize','includes','filter','--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','484AMDotm','54BPvuVN','string','1OVVgoj','14435vejXpa','427832uiiVmR','paging','number','validation','str','toUpperCase','Page\x20number','roleType','map','198HyZhJx','appCode','Fuzzy\x20role-name\x20filter','type','10SXYHgY','trim','242151mXDkfr','list','501690uiSVGO','runtime','items','11706618OIwtZT','length','num'];a52_0x23b3=function(){return _0x589360;};return a52_0x23b3();}function a52_0x41c7(_0x4940c0,_0x5b28c6){_0x4940c0=_0x4940c0-0x1d9;const _0x23b3b1=a52_0x23b3();let _0x41c7d1=_0x23b3b1[_0x4940c0];return _0x41c7d1;}const a52_0x319aa6=a52_0x41c7;(function(_0x181be0,_0x3f6fcc){const _0x4b5ee8=a52_0x41c7,_0x33f4d1=_0x181be0();while(!![]){try{const _0x2fd3cd=-parseInt(_0x4b5ee8(0x1dc))/0x1*(parseInt(_0x4b5ee8(0x1f6))/0x2)+-parseInt(_0x4b5ee8(0x1ef))/0x3+-parseInt(_0x4b5ee8(0x1d9))/0x4*(parseInt(_0x4b5ee8(0x1dd))/0x5)+parseInt(_0x4b5ee8(0x1da))/0x6*(-parseInt(_0x4b5ee8(0x1ed))/0x7)+-parseInt(_0x4b5ee8(0x1de))/0x8*(-parseInt(_0x4b5ee8(0x1e7))/0x9)+-parseInt(_0x4b5ee8(0x1eb))/0xa*(-parseInt(_0x4b5ee8(0x1f2))/0xb)+parseInt(_0x4b5ee8(0x1f7))/0xc;if(_0x2fd3cd===_0x3f6fcc)break;else _0x33f4d1['push'](_0x33f4d1['shift']());}catch(_0x19bcbf){_0x33f4d1['push'](_0x33f4d1['shift']());}}}(a52_0x23b3,0x921b2));import{listRuntimeAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{listAllRuntimeRoles,projectRuntimeRole,RUNTIME_ROLE_TYPES}from'../../commands/role/shared.js';export const roleList={'service':a52_0x319aa6(0x1f5),'command':a52_0x319aa6(0x1ee),'description':'List\x20runtime\x20roles\x20for\x20the\x20current\x20app','risk':'read','flags':[{'name':a52_0x319aa6(0x1ea),'type':'string','enum':RUNTIME_ROLE_TYPES,'description':'Runtime\x20role\x20type'},{'name':'name','type':a52_0x319aa6(0x1db),'description':a52_0x319aa6(0x1e9)},{'name':'page','type':a52_0x319aa6(0x1e0),'default':0x1,'description':a52_0x319aa6(0x1e4)},{'name':'pagesize','type':a52_0x319aa6(0x1e0),'default':0x64,'description':'Page\x20size\x20from\x201\x20to\x20100'}],async 'validate'(_0x340d86){const _0x5822c9=a52_0x319aa6,_0x4c4af3=_0x340d86[_0x5822c9(0x1e2)](_0x5822c9(0x1ea))['toUpperCase']();if(_0x4c4af3&&!RUNTIME_ROLE_TYPES[_0x5822c9(0x1fb)](_0x4c4af3))throw CliErrors[_0x5822c9(0x1e1)]('Invalid\x20runtime\x20role\x20type:\x20'+_0x4c4af3+'.');const _0x1ff4d8=_0x340d86['num']('page',0x1),_0x4df2a7=_0x340d86[_0x5822c9(0x1f4)](_0x5822c9(0x1fa),0x64);if(!Number[_0x5822c9(0x1f9)](_0x1ff4d8)||_0x1ff4d8<0x1)throw CliErrors[_0x5822c9(0x1e1)]('--page\x20must\x20be\x20a\x20positive\x20integer.');if(!Number[_0x5822c9(0x1f9)](_0x4df2a7)||_0x4df2a7<0x1||_0x4df2a7>0x64)throw CliErrors[_0x5822c9(0x1e1)](_0x5822c9(0x1fd));},async 'execute'(_0x8e4b98){const _0x5e8a74=a52_0x319aa6,_0x3b73f8=_0x8e4b98[_0x5e8a74(0x1e2)](_0x5e8a74(0x1ea))[_0x5e8a74(0x1e3)](),_0x1124cf=_0x8e4b98[_0x5e8a74(0x1e2)]('name')[_0x5e8a74(0x1ec)](),_0x4aae78=_0x8e4b98[_0x5e8a74(0x1f4)]('page',0x1),_0x776e4c=_0x8e4b98['num'](_0x5e8a74(0x1fa),0x64);if(_0x3b73f8){const _0x4cea72=(await listAllRuntimeRoles(_0x8e4b98['appCode'],{..._0x1124cf?{'roleName':_0x1124cf}:{}}))[_0x5e8a74(0x1fc)](_0x3c724e=>_0x3c724e[_0x5e8a74(0x1e5)]===_0x3b73f8),_0x487efd=(_0x4aae78-0x1)*_0x776e4c;return{'ok':!![],'data':{'scope':_0x5e8a74(0x1f0),'roles':_0x4cea72[_0x5e8a74(0x1f8)](_0x487efd,_0x487efd+_0x776e4c)[_0x5e8a74(0x1e6)](projectRuntimeRole),'paging':{'currentPage':_0x4aae78,'pageSize':_0x776e4c,'totalCount':_0x4cea72[_0x5e8a74(0x1f3)]}}};}const _0x1eb866=await listRuntimeAppRoles(_0x8e4b98[_0x5e8a74(0x1e8)],{..._0x1124cf?{'roleName':_0x1124cf}:{},'currentPage':_0x4aae78,'pageSize':_0x776e4c});return{'ok':!![],'data':{'scope':'runtime','roles':_0x1eb866[_0x5e8a74(0x1f1)][_0x5e8a74(0x1e6)](projectRuntimeRole),'paging':_0x1eb866[_0x5e8a74(0x1df)]}};}};
1
+ const a52_0x46ba53=a52_0x36b0;(function(_0x2c3d56,_0x45a92b){const _0xe9778d=a52_0x36b0,_0x438261=_0x2c3d56();while(!![]){try{const _0x432411=parseInt(_0xe9778d(0xb4))/0x1*(parseInt(_0xe9778d(0xa4))/0x2)+-parseInt(_0xe9778d(0xad))/0x3*(parseInt(_0xe9778d(0xa2))/0x4)+-parseInt(_0xe9778d(0xbf))/0x5*(parseInt(_0xe9778d(0xa5))/0x6)+-parseInt(_0xe9778d(0xb6))/0x7+parseInt(_0xe9778d(0xba))/0x8+-parseInt(_0xe9778d(0xb1))/0x9*(-parseInt(_0xe9778d(0xaf))/0xa)+parseInt(_0xe9778d(0xb9))/0xb;if(_0x432411===_0x45a92b)break;else _0x438261['push'](_0x438261['shift']());}catch(_0x4bf777){_0x438261['push'](_0x438261['shift']());}}}(a52_0x2bbd,0xb83c2));function a52_0x36b0(_0x25b93d,_0x5f1e9e){_0x25b93d=_0x25b93d-0x9c;const _0x2bbdd7=a52_0x2bbd();let _0x36b043=_0x2bbdd7[_0x25b93d];return _0x36b043;}import{listRuntimeAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{listAllRuntimeRoles,projectRuntimeRole,RUNTIME_ROLE_TYPES}from'../../commands/role/shared.js';export const roleList={'service':a52_0x46ba53(0xbd),'command':'list','description':a52_0x46ba53(0xa1),'risk':a52_0x46ba53(0xac),'flags':[{'name':a52_0x46ba53(0xae),'type':a52_0x46ba53(0xa6),'enum':RUNTIME_ROLE_TYPES,'description':'Runtime\x20role\x20type'},{'name':a52_0x46ba53(0xbb),'type':a52_0x46ba53(0xa6),'description':a52_0x46ba53(0xb5)},{'name':'page','type':'number','default':0x1,'description':a52_0x46ba53(0xab)},{'name':'pagesize','type':a52_0x46ba53(0xb7),'default':0x64,'description':'Page\x20size\x20from\x201\x20to\x20100'}],async 'validate'(_0x420b95){const _0x5588ac=a52_0x46ba53,_0x3b3d1b=_0x420b95[_0x5588ac(0xaa)](_0x5588ac(0xae))[_0x5588ac(0xb8)]();if(_0x3b3d1b&&!RUNTIME_ROLE_TYPES[_0x5588ac(0x9c)](_0x3b3d1b))throw CliErrors['validation'](_0x5588ac(0xb3)+_0x3b3d1b+'.');const _0x56aa01=_0x420b95[_0x5588ac(0xb2)](_0x5588ac(0xa0),0x1),_0x5b7702=_0x420b95[_0x5588ac(0xb2)]('pagesize',0x64);if(!Number['isSafeInteger'](_0x56aa01)||_0x56aa01<0x1)throw CliErrors[_0x5588ac(0xa3)](_0x5588ac(0x9d));if(!Number[_0x5588ac(0xc1)](_0x5b7702)||_0x5b7702<0x1||_0x5b7702>0x64)throw CliErrors[_0x5588ac(0xa3)](_0x5588ac(0xc0));},async 'execute'(_0x49e618){const _0x5acd16=a52_0x46ba53,_0xb9c74=_0x49e618['str'](_0x5acd16(0xae))[_0x5acd16(0xb8)](),_0x2529aa=_0x49e618[_0x5acd16(0xaa)](_0x5acd16(0xbb))[_0x5acd16(0x9e)](),_0x4a8e1c=_0x49e618[_0x5acd16(0xb2)](_0x5acd16(0xa0),0x1),_0x45bf35=_0x49e618[_0x5acd16(0xb2)](_0x5acd16(0xa8),0x64);if(_0xb9c74){const _0x7e9aaa=(await listAllRuntimeRoles(_0x49e618[_0x5acd16(0xbe)],{..._0x2529aa?{'roleName':_0x2529aa}:{}}))[_0x5acd16(0xc2)](_0x3837b0=>_0x3837b0['roleType']===_0xb9c74),_0x164fb7=(_0x4a8e1c-0x1)*_0x45bf35;return{'ok':!![],'data':{'scope':_0x5acd16(0xb0),'roles':_0x7e9aaa[_0x5acd16(0xbc)](_0x164fb7,_0x164fb7+_0x45bf35)[_0x5acd16(0x9f)](projectRuntimeRole),'paging':{'currentPage':_0x4a8e1c,'pageSize':_0x45bf35,'totalCount':_0x7e9aaa['length']}}};}const _0x1acd30=await listRuntimeAppRoles(_0x49e618['appCode'],{..._0x2529aa?{'roleName':_0x2529aa}:{},'currentPage':_0x4a8e1c,'pageSize':_0x45bf35});return{'ok':!![],'data':{'scope':_0x5acd16(0xb0),'roles':_0x1acd30[_0x5acd16(0xa7)]['map'](projectRuntimeRole),'paging':_0x1acd30[_0x5acd16(0xa9)]}};}};function a52_0x2bbd(){const _0x566285=['str','Page\x20number','read','339jAanob','type','90OYFUTp','runtime','320265rfPkKh','num','Invalid\x20runtime\x20role\x20type:\x20','37531adTCOY','Fuzzy\x20role-name\x20filter','4106732KghgxJ','number','toUpperCase','2063413KNLqUs','10061456sOJlOA','name','slice','role','appCode','136095LDPniu','--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','isSafeInteger','filter','includes','--page\x20must\x20be\x20a\x20positive\x20integer.','trim','map','page','List\x20runtime\x20roles\x20for\x20the\x20current\x20app','44304rwfNeK','validation','76iEIKQr','132JmKSqN','string','items','pagesize','paging'];a52_0x2bbd=function(){return _0x566285;};return a52_0x2bbd();}
@@ -1 +1 @@
1
- const a53_0x478962=a53_0x1da4;(function(_0x2e83c9,_0x30bd6c){const _0x162ea9=a53_0x1da4,_0x23b0ec=_0x2e83c9();while(!![]){try{const _0x580f70=parseInt(_0x162ea9(0x126))/0x1+-parseInt(_0x162ea9(0x117))/0x2+-parseInt(_0x162ea9(0x120))/0x3*(parseInt(_0x162ea9(0x106))/0x4)+parseInt(_0x162ea9(0x11d))/0x5*(-parseInt(_0x162ea9(0x129))/0x6)+-parseInt(_0x162ea9(0x140))/0x7*(parseInt(_0x162ea9(0xfa))/0x8)+-parseInt(_0x162ea9(0x13f))/0x9+parseInt(_0x162ea9(0x133))/0xa*(parseInt(_0x162ea9(0xff))/0xb);if(_0x580f70===_0x30bd6c)break;else _0x23b0ec['push'](_0x23b0ec['shift']());}catch(_0x125c29){_0x23b0ec['push'](_0x23b0ec['shift']());}}}(a53_0x5618,0x1e1d8));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a53_0x478962(0x138),a53_0x478962(0x103),a53_0x478962(0x11b),a53_0x478962(0x12b)];const BUILTIN_ROLE_TYPES=[a53_0x478962(0x138),a53_0x478962(0x103),a53_0x478962(0x11b)];export const ROLE_ID_FLAG={'name':'id','type':a53_0x478962(0x10c),'required':!![],'description':a53_0x478962(0x118)};export const ROLE_REF_FLAG={'name':a53_0x478962(0x107),'type':a53_0x478962(0x11f),'required':!![],'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'};export const USER_ID_FLAG={'name':a53_0x478962(0xfe),'type':a53_0x478962(0x11f),'required':!![],'description':a53_0x478962(0x137)};export const EXPECT_USER_COUNT_FLAG={'name':a53_0x478962(0x115),'type':a53_0x478962(0x10c),'description':a53_0x478962(0x139)};export function isBuiltinRuntimeRole(_0x55c243){return BUILTIN_ROLE_TYPES['includes'](_0x55c243);}function a53_0x1da4(_0x41e198,_0x31a04b){_0x41e198=_0x41e198-0xfa;const _0x5618c4=a53_0x5618();let _0x1da471=_0x5618c4[_0x41e198];return _0x1da471;}export function assertCustomRuntimeRole(_0x1eed5a,_0x390aea){const _0x151f9b=a53_0x478962;if(_0x1eed5a[_0x151f9b(0x12e)]!==_0x151f9b(0x12b))throw CliErrors[_0x151f9b(0x125)]('Cannot\x20'+_0x390aea+_0x151f9b(0x127)+_0x1eed5a[_0x151f9b(0x10d)]+'\x20('+_0x1eed5a[_0x151f9b(0x12e)]+').','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRuntimeRole(_0x1f1420){const _0x3228fd=a53_0x478962;return{'id':_0x1f1420['id'],'roleName':_0x1f1420[_0x3228fd(0x10d)],'roleType':_0x1f1420[_0x3228fd(0x12e)],'remark':_0x1f1420[_0x3228fd(0x111)],'userCount':_0x1f1420[_0x3228fd(0x109)]??0x0,'permitCount':_0x1f1420[_0x3228fd(0x110)]??0x0,'builtin':isBuiltinRuntimeRole(_0x1f1420[_0x3228fd(0x12e)])};}export async function getRuntimeRoleById(_0x533e54,_0x44556c){const _0x1b682c=a53_0x478962;if(!Number[_0x1b682c(0x12d)](_0x44556c)||_0x44556c<=0x0)throw CliErrors[_0x1b682c(0x125)](_0x1b682c(0x124));const _0x602bbd=(await listAllRuntimeRoles(_0x533e54))[_0x1b682c(0x10e)](_0x375131=>_0x375131['id']===_0x44556c&&(!_0x375131[_0x1b682c(0x101)]||_0x375131['appCode']===_0x533e54));if(_0x602bbd[_0x1b682c(0x123)]!==0x1)throw CliErrors['validation']('Runtime\x20role\x20id\x20'+_0x44556c+_0x1b682c(0x102)+_0x533e54+'.',_0x1b682c(0xfd));return _0x602bbd[0x0];}function a53_0x5618(){const _0x388c58=['\x22\x20is\x20ambiguous.','userCount','user-add','userList','number','roleName','filter','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','permitCount','remark','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','expect-user-count','Runtime\x20role\x20name\x20\x22','202782PYiDBZ','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','Pass\x20one\x20role\x20ID:\x20','OWNER','paging','835sbdrBv','runtime','string','4782ILESIw','User\x20','test','length','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','validation','61726bQHchR','\x20built-in\x20runtime\x20role\x20','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','4746yAyVtk','join','CUSTOM','Pass\x20--role\x20<id|name>.','isSafeInteger','roleType','\x22\x20was\x20not\x20found\x20in\x20app\x20','num','map','trim','80pgFQqE','applyUserList','totalCount','code','Runtime\x20numeric\x20userId','ADMIN','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','str','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','userId','userName','find','1597842JwevRj','14KyMmKl','items','Runtime\x20user\x20','430112Mptvtu','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','push','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','user','924869qaTBKS','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','appCode','\x20was\x20not\x20found\x20in\x20app\x20','USER','\x20is\x20not\x20in\x20runtime\x20role\x20','Runtime\x20role\x20','232bJVYVn','role'];a53_0x5618=function(){return _0x388c58;};return a53_0x5618();}export async function listAllRuntimeRoles(_0x25be38,_0x461982={}){const _0x1c0cc7=a53_0x478962,_0x1919d4=0x64,_0x3dc19d=[];for(let _0x719314=0x1;;_0x719314+=0x1){const _0x29f1af=await listRuntimeAppRoles(_0x25be38,{..._0x461982['roleName']?{'roleName':_0x461982['roleName']}:{},'currentPage':_0x719314,'pageSize':_0x1919d4});_0x3dc19d[_0x1c0cc7(0xfc)](..._0x29f1af[_0x1c0cc7(0x141)]);if(_0x29f1af[_0x1c0cc7(0x141)][_0x1c0cc7(0x123)]<_0x1919d4||_0x29f1af[_0x1c0cc7(0x11c)]&&_0x3dc19d[_0x1c0cc7(0x123)]>=_0x29f1af[_0x1c0cc7(0x11c)][_0x1c0cc7(0x135)])return _0x3dc19d;}}export async function resolveRuntimeRoleRef(_0x6071b,_0x438bf1){const _0x2bce4c=a53_0x478962,_0x2a7a5c=_0x438bf1['trim']();if(!_0x2a7a5c)throw CliErrors[_0x2bce4c(0x125)]('Missing\x20runtime\x20role\x20reference.',_0x2bce4c(0x12c));if(/^\d+$/['test'](_0x2a7a5c))return getRuntimeRoleById(_0x6071b,Number(_0x2a7a5c));const _0x410073=(await listAllRuntimeRoles(_0x6071b))[_0x2bce4c(0x10e)](_0x177a24=>_0x177a24[_0x2bce4c(0x10d)]===_0x2a7a5c);if(_0x410073[_0x2bce4c(0x123)]===0x0)throw CliErrors[_0x2bce4c(0x125)](_0x2bce4c(0x116)+_0x2a7a5c+_0x2bce4c(0x12f)+_0x6071b+'.',_0x2bce4c(0x10f));if(_0x410073[_0x2bce4c(0x123)]>0x1)throw CliErrors[_0x2bce4c(0x125)](_0x2bce4c(0x116)+_0x2a7a5c+_0x2bce4c(0x108),_0x2bce4c(0x11a)+_0x410073[_0x2bce4c(0x131)](_0x4a7b06=>_0x4a7b06['id'])[_0x2bce4c(0x12a)](',\x20')+'.');return _0x410073[0x0];}function parseRuntimeUserId(_0x1ee083){const _0x308d57=a53_0x478962,_0x329c51=_0x1ee083[_0x308d57(0x132)]();if(!/^\d+$/[_0x308d57(0x122)](_0x329c51))throw CliErrors[_0x308d57(0x125)](_0x308d57(0x100),'Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.');const _0x2b963e=Number(_0x329c51);if(!Number['isSafeInteger'](_0x2b963e)||_0x2b963e<=0x0)throw CliErrors[_0x308d57(0x125)]('Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x2b963e;}export async function prepareRuntimeMemberMutation(_0x5c2bc8,_0x526913){const _0x573aa2=a53_0x478962,_0x445809=await resolveRuntimeRoleRef(_0x5c2bc8[_0x573aa2(0x101)],_0x5c2bc8[_0x573aa2(0x13a)](_0x573aa2(0x107)));if(_0x445809[_0x573aa2(0x12e)]===_0x573aa2(0x11b))throw CliErrors[_0x573aa2(0x125)](_0x573aa2(0x128),'Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.');const _0x505812=parseRuntimeUserId(_0x5c2bc8['str'](_0x573aa2(0xfe))),_0x2c1296=(await listRuntimeRoleUsers(_0x5c2bc8[_0x573aa2(0x101)]))['map'](_0x29d8f4=>({..._0x29d8f4,'userList':[..._0x29d8f4[_0x573aa2(0x10b)]??[]],'applyUserList':[..._0x29d8f4[_0x573aa2(0x134)]??[]]})),_0x5f3494=_0x2c1296[_0x573aa2(0x13e)](_0x2af497=>_0x2af497['id']===_0x445809['id']);if(!_0x5f3494)throw CliErrors[_0x573aa2(0x125)](_0x573aa2(0x105)+_0x445809['id']+_0x573aa2(0x112),_0x573aa2(0x13b));const _0x22e154=_0x5f3494[_0x573aa2(0x10b)][_0x573aa2(0x131)](_0x22997d=>_0x22997d[_0x573aa2(0x13c)]),_0x392c60=_0x5c2bc8['flag'](_0x573aa2(0x115));if(_0x392c60!==undefined&&_0x392c60!==null&&_0x392c60!==''){const _0x2c25ca=_0x5c2bc8[_0x573aa2(0x130)](_0x573aa2(0x115));if(!Number['isSafeInteger'](_0x2c25ca)||_0x2c25ca<0x0)throw CliErrors[_0x573aa2(0x125)](_0x573aa2(0x113));if(_0x22e154[_0x573aa2(0x123)]!==_0x2c25ca)throw CliErrors[_0x573aa2(0x125)](_0x573aa2(0x114)+_0x2c25ca+',\x20found\x20'+_0x22e154[_0x573aa2(0x123)]+'.',_0x573aa2(0xfb));}const _0x5ed7f3=_0x22e154['includes'](_0x505812),_0x35ac65=[];let _0xe59203=!![];if(_0x526913===_0x573aa2(0x10a)){const _0x6f8578=await listRuntimeAppUsers(_0x5c2bc8['appCode']),_0x43252a=_0x6f8578[_0x573aa2(0x10e)](_0x3be24a=>Number(_0x3be24a[_0x573aa2(0x136)])===_0x505812);if(_0x43252a[_0x573aa2(0x123)]!==0x1||!_0x43252a[0x0][_0x573aa2(0x13d)]?.[_0x573aa2(0x132)]())throw CliErrors['validation'](_0x573aa2(0x142)+_0x505812+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x5c2bc8['appCode']+'.',_0x573aa2(0x119));_0x5ed7f3?(_0xe59203=![],_0x35ac65[_0x573aa2(0xfc)](_0x573aa2(0x121)+_0x505812+'\x20is\x20already\x20in\x20runtime\x20role\x20'+_0x445809['id']+'.')):_0x5f3494[_0x573aa2(0x10b)][_0x573aa2(0xfc)]({'userId':_0x505812,'username':_0x43252a[0x0][_0x573aa2(0x13d)]});}else!_0x5ed7f3?(_0xe59203=![],_0x35ac65[_0x573aa2(0xfc)](_0x573aa2(0x121)+_0x505812+_0x573aa2(0x104)+_0x445809['id']+'.')):_0x5f3494[_0x573aa2(0x10b)]=_0x5f3494[_0x573aa2(0x10b)][_0x573aa2(0x10e)](_0x2de53b=>_0x2de53b[_0x573aa2(0x13c)]!==_0x505812);return{'role':_0x445809,'userId':_0x505812,'roleList':_0x2c1296,'before':{'userIds':_0x22e154},'after':{'userIds':_0x5f3494['userList'][_0x573aa2(0x131)](_0x439353=>_0x439353[_0x573aa2(0x13c)])},'shouldWrite':_0xe59203,'warnings':_0x35ac65};}export function runtimeRoleWriteResult(_0x2e9baf,_0x1a41ee,_0x352f87,_0x30563f,_0x47c4d2,_0x530d9d=[]){const _0x41b59a=a53_0x478962;return{'operation':_0x2e9baf,'scope':_0x41b59a(0x11e),'selector':_0x1a41ee,'before':_0x352f87,'after':_0x30563f,'dryRun':![],'backend':_0x47c4d2,'warnings':_0x530d9d};}
1
+ const a53_0x41d362=a53_0x575d;(function(_0xcaca55,_0x382cdc){const _0x1d0cae=a53_0x575d,_0x5ba1c6=_0xcaca55();while(!![]){try{const _0x2f65f0=-parseInt(_0x1d0cae(0x1bb))/0x1*(parseInt(_0x1d0cae(0x1b1))/0x2)+-parseInt(_0x1d0cae(0x199))/0x3+parseInt(_0x1d0cae(0x186))/0x4+-parseInt(_0x1d0cae(0x194))/0x5*(parseInt(_0x1d0cae(0x18f))/0x6)+parseInt(_0x1d0cae(0x1a3))/0x7+parseInt(_0x1d0cae(0x1ca))/0x8*(-parseInt(_0x1d0cae(0x1a7))/0x9)+parseInt(_0x1d0cae(0x1b9))/0xa*(parseInt(_0x1d0cae(0x1cd))/0xb);if(_0x2f65f0===_0x382cdc)break;else _0x5ba1c6['push'](_0x5ba1c6['shift']());}catch(_0x133695){_0x5ba1c6['push'](_0x5ba1c6['shift']());}}}(a53_0xd773,0xb968a));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';function a53_0xd773(){const _0x1b20da=['includes','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','ADMIN','isSafeInteger','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','userCount','code','18282900Xbtogv','CUSTOM','57041vgCaIf','\x20was\x20not\x20found\x20in\x20app\x20','validation','test','runtime','Runtime\x20role\x20id\x20','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','expect-user-count','number','userId','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','flag','User\x20','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','find','8wsoWOH','length','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','11tFCyha','4321564rWVVlt','items','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Runtime\x20numeric\x20userId','appCode','Runtime\x20user\x20','userList','Cannot\x20','USER','2861076umCMFm','OWNER','Pass\x20--role\x20<id|name>.','Runtime\x20role\x20','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','10aGxJdh','string','\x20is\x20not\x20in\x20runtime\x20role\x20','roleType',',\x20found\x20','563403VQCORG','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','paging','roleName','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','str','map','Missing\x20runtime\x20role\x20reference.','user','5344269MVrsnP','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','\x20is\x20already\x20in\x20runtime\x20role\x20','user-add','4646871mtTBJz','applyUserList','role','num','filter','totalCount','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','trim','userName','push','44ouyHuw'];a53_0xd773=function(){return _0x1b20da;};return a53_0xd773();}import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a53_0x41d362(0x1b4),a53_0x41d362(0x18e),a53_0x41d362(0x190),a53_0x41d362(0x1ba)];const BUILTIN_ROLE_TYPES=[a53_0x41d362(0x1b4),a53_0x41d362(0x18e),'OWNER'];export const ROLE_ID_FLAG={'name':'id','type':a53_0x41d362(0x1c3),'required':!![],'description':a53_0x41d362(0x1b3)};export const ROLE_REF_FLAG={'name':a53_0x41d362(0x1a9),'type':a53_0x41d362(0x195),'required':!![],'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'};export const USER_ID_FLAG={'name':'user','type':'string','required':!![],'description':a53_0x41d362(0x189)};export const EXPECT_USER_COUNT_FLAG={'name':a53_0x41d362(0x1c2),'type':a53_0x41d362(0x1c3),'description':a53_0x41d362(0x1cc)};export function isBuiltinRuntimeRole(_0x12072f){const _0x137981=a53_0x41d362;return BUILTIN_ROLE_TYPES[_0x137981(0x1b2)](_0x12072f);}export function assertCustomRuntimeRole(_0x4e505f,_0x3fbee4){const _0x4ae143=a53_0x41d362;if(_0x4e505f[_0x4ae143(0x197)]!==_0x4ae143(0x1ba))throw CliErrors['validation'](_0x4ae143(0x18d)+_0x3fbee4+'\x20built-in\x20runtime\x20role\x20'+_0x4e505f['roleName']+'\x20('+_0x4e505f[_0x4ae143(0x197)]+').',_0x4ae143(0x1c8));}export function projectRuntimeRole(_0x249914){const _0x4cdf55=a53_0x41d362;return{'id':_0x249914['id'],'roleName':_0x249914['roleName'],'roleType':_0x249914[_0x4cdf55(0x197)],'remark':_0x249914['remark'],'userCount':_0x249914[_0x4cdf55(0x1b7)]??0x0,'permitCount':_0x249914['permitCount']??0x0,'builtin':isBuiltinRuntimeRole(_0x249914['roleType'])};}function a53_0x575d(_0x1e75f9,_0x338e81){_0x1e75f9=_0x1e75f9-0x186;const _0xd77356=a53_0xd773();let _0x575d22=_0xd77356[_0x1e75f9];return _0x575d22;}export async function getRuntimeRoleById(_0x87e57c,_0x22a3dd){const _0x5d8bce=a53_0x41d362;if(!Number[_0x5d8bce(0x1b5)](_0x22a3dd)||_0x22a3dd<=0x0)throw CliErrors[_0x5d8bce(0x1bd)]('Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.');const _0x3376d7=(await listAllRuntimeRoles(_0x87e57c))[_0x5d8bce(0x1ab)](_0x1c31f3=>_0x1c31f3['id']===_0x22a3dd&&(!_0x1c31f3[_0x5d8bce(0x18a)]||_0x1c31f3[_0x5d8bce(0x18a)]===_0x87e57c));if(_0x3376d7[_0x5d8bce(0x1cb)]!==0x1)throw CliErrors[_0x5d8bce(0x1bd)](_0x5d8bce(0x1c0)+_0x22a3dd+_0x5d8bce(0x1bc)+_0x87e57c+'.',_0x5d8bce(0x1ad));return _0x3376d7[0x0];}export async function listAllRuntimeRoles(_0x625e40,_0x134c4b={}){const _0x5a09a2=a53_0x41d362,_0x38d04b=0x64,_0x556348=[];for(let _0x1ed5b8=0x1;;_0x1ed5b8+=0x1){const _0x28ff6a=await listRuntimeAppRoles(_0x625e40,{..._0x134c4b[_0x5a09a2(0x19c)]?{'roleName':_0x134c4b[_0x5a09a2(0x19c)]}:{},'currentPage':_0x1ed5b8,'pageSize':_0x38d04b});_0x556348[_0x5a09a2(0x1b0)](..._0x28ff6a[_0x5a09a2(0x187)]);if(_0x28ff6a[_0x5a09a2(0x187)][_0x5a09a2(0x1cb)]<_0x38d04b||_0x28ff6a['paging']&&_0x556348[_0x5a09a2(0x1cb)]>=_0x28ff6a[_0x5a09a2(0x19b)][_0x5a09a2(0x1ac)])return _0x556348;}}export async function resolveRuntimeRoleRef(_0xdd46d0,_0x7f7b88){const _0x13a5bb=a53_0x41d362,_0x3255bf=_0x7f7b88[_0x13a5bb(0x1ae)]();if(!_0x3255bf)throw CliErrors[_0x13a5bb(0x1bd)](_0x13a5bb(0x1a1),_0x13a5bb(0x191));if(/^\d+$/[_0x13a5bb(0x1be)](_0x3255bf))return getRuntimeRoleById(_0xdd46d0,Number(_0x3255bf));const _0x2badb6=(await listAllRuntimeRoles(_0xdd46d0))[_0x13a5bb(0x1ab)](_0x2d1e92=>_0x2d1e92['roleName']===_0x3255bf);if(_0x2badb6[_0x13a5bb(0x1cb)]===0x0)throw CliErrors[_0x13a5bb(0x1bd)]('Runtime\x20role\x20name\x20\x22'+_0x3255bf+'\x22\x20was\x20not\x20found\x20in\x20app\x20'+_0xdd46d0+'.','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.');if(_0x2badb6['length']>0x1)throw CliErrors[_0x13a5bb(0x1bd)]('Runtime\x20role\x20name\x20\x22'+_0x3255bf+'\x22\x20is\x20ambiguous.','Pass\x20one\x20role\x20ID:\x20'+_0x2badb6[_0x13a5bb(0x1a0)](_0x4e9541=>_0x4e9541['id'])['join'](',\x20')+'.');return _0x2badb6[0x0];}function parseRuntimeUserId(_0x2d3bc0){const _0x2b14a7=a53_0x41d362,_0x3f8995=_0x2d3bc0['trim']();if(!/^\d+$/[_0x2b14a7(0x1be)](_0x3f8995))throw CliErrors[_0x2b14a7(0x1bd)](_0x2b14a7(0x1c5),_0x2b14a7(0x1b6));const _0xafc7ff=Number(_0x3f8995);if(!Number[_0x2b14a7(0x1b5)](_0xafc7ff)||_0xafc7ff<=0x0)throw CliErrors[_0x2b14a7(0x1bd)]('Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0xafc7ff;}export async function prepareRuntimeMemberMutation(_0x26e9d0,_0x26b93e){const _0x3a5635=a53_0x41d362,_0x2cbe99=await resolveRuntimeRoleRef(_0x26e9d0['appCode'],_0x26e9d0[_0x3a5635(0x19f)]('role'));if(_0x2cbe99[_0x3a5635(0x197)]==='OWNER')throw CliErrors[_0x3a5635(0x1bd)](_0x3a5635(0x188),_0x3a5635(0x19e));const _0x3b1b83=parseRuntimeUserId(_0x26e9d0['str'](_0x3a5635(0x1a2))),_0x1b4b68=(await listRuntimeRoleUsers(_0x26e9d0[_0x3a5635(0x18a)]))[_0x3a5635(0x1a0)](_0x3676e6=>({..._0x3676e6,'userList':[..._0x3676e6['userList']??[]],'applyUserList':[..._0x3676e6[_0x3a5635(0x1a8)]??[]]})),_0x559f27=_0x1b4b68[_0x3a5635(0x1c9)](_0x5980c2=>_0x5980c2['id']===_0x2cbe99['id']);if(!_0x559f27)throw CliErrors[_0x3a5635(0x1bd)](_0x3a5635(0x192)+_0x2cbe99['id']+_0x3a5635(0x19d),_0x3a5635(0x1a4));const _0x1ebdf7=_0x559f27[_0x3a5635(0x18c)][_0x3a5635(0x1a0)](_0x3f4d9a=>_0x3f4d9a[_0x3a5635(0x1c4)]),_0x1c2e1c=_0x26e9d0[_0x3a5635(0x1c6)](_0x3a5635(0x1c2));if(_0x1c2e1c!==undefined&&_0x1c2e1c!==null&&_0x1c2e1c!==''){const _0x2a6290=_0x26e9d0[_0x3a5635(0x1aa)]('expect-user-count');if(!Number['isSafeInteger'](_0x2a6290)||_0x2a6290<0x0)throw CliErrors[_0x3a5635(0x1bd)](_0x3a5635(0x1c1));if(_0x1ebdf7[_0x3a5635(0x1cb)]!==_0x2a6290)throw CliErrors[_0x3a5635(0x1bd)](_0x3a5635(0x193)+_0x2a6290+_0x3a5635(0x198)+_0x1ebdf7[_0x3a5635(0x1cb)]+'.','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.');}const _0x1da287=_0x1ebdf7[_0x3a5635(0x1b2)](_0x3b1b83),_0x530552=[];let _0x1c288f=!![];if(_0x26b93e===_0x3a5635(0x1a6)){const _0xe5a78f=await listRuntimeAppUsers(_0x26e9d0[_0x3a5635(0x18a)]),_0x209cd2=_0xe5a78f['filter'](_0x4de4b1=>Number(_0x4de4b1[_0x3a5635(0x1b8)])===_0x3b1b83);if(_0x209cd2[_0x3a5635(0x1cb)]!==0x1||!_0x209cd2[0x0]['userName']?.['trim']())throw CliErrors['validation'](_0x3a5635(0x18b)+_0x3b1b83+_0x3a5635(0x1bc)+_0x26e9d0[_0x3a5635(0x18a)]+'.',_0x3a5635(0x19a));_0x1da287?(_0x1c288f=![],_0x530552[_0x3a5635(0x1b0)](_0x3a5635(0x1c7)+_0x3b1b83+_0x3a5635(0x1a5)+_0x2cbe99['id']+'.')):_0x559f27[_0x3a5635(0x18c)][_0x3a5635(0x1b0)]({'userId':_0x3b1b83,'username':_0x209cd2[0x0][_0x3a5635(0x1af)]});}else!_0x1da287?(_0x1c288f=![],_0x530552[_0x3a5635(0x1b0)](_0x3a5635(0x1c7)+_0x3b1b83+_0x3a5635(0x196)+_0x2cbe99['id']+'.')):_0x559f27[_0x3a5635(0x18c)]=_0x559f27['userList']['filter'](_0x3947e2=>_0x3947e2[_0x3a5635(0x1c4)]!==_0x3b1b83);return{'role':_0x2cbe99,'userId':_0x3b1b83,'roleList':_0x1b4b68,'before':{'userIds':_0x1ebdf7},'after':{'userIds':_0x559f27[_0x3a5635(0x18c)][_0x3a5635(0x1a0)](_0x1625ed=>_0x1625ed[_0x3a5635(0x1c4)])},'shouldWrite':_0x1c288f,'warnings':_0x530552};}export function runtimeRoleWriteResult(_0x2d9f73,_0x173eb7,_0x24d93c,_0x1325bc,_0x1d6b18,_0x476efc=[]){const _0x56bb29=a53_0x41d362;return{'operation':_0x2d9f73,'scope':_0x56bb29(0x1bf),'selector':_0x173eb7,'before':_0x24d93c,'after':_0x1325bc,'dryRun':![],'backend':_0x1d6b18,'warnings':_0x476efc};}
@@ -1 +1 @@
1
- const a54_0x1964aa=a54_0x2fca;(function(_0x870e69,_0x26d46f){const _0xc03263=a54_0x2fca,_0x379ded=_0x870e69();while(!![]){try{const _0x2a776=-parseInt(_0xc03263(0x1ed))/0x1*(-parseInt(_0xc03263(0x1f8))/0x2)+-parseInt(_0xc03263(0x1fe))/0x3*(parseInt(_0xc03263(0x1f0))/0x4)+parseInt(_0xc03263(0x1f7))/0x5*(-parseInt(_0xc03263(0x1f9))/0x6)+-parseInt(_0xc03263(0x201))/0x7*(-parseInt(_0xc03263(0x202))/0x8)+-parseInt(_0xc03263(0x207))/0x9*(parseInt(_0xc03263(0x1fa))/0xa)+parseInt(_0xc03263(0x200))/0xb*(-parseInt(_0xc03263(0x1eb))/0xc)+parseInt(_0xc03263(0x1f5))/0xd*(parseInt(_0xc03263(0x1ec))/0xe);if(_0x2a776===_0x26d46f)break;else _0x379ded['push'](_0x379ded['shift']());}catch(_0x3febeb){_0x379ded['push'](_0x379ded['shift']());}}}(a54_0x4846,0x5327a));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x590292){const _0x40082c=a54_0x2fca,_0x28012c=_0x590292[_0x40082c(0x208)]('name')!==undefined,_0x351218=_0x590292[_0x40082c(0x208)](_0x40082c(0x1ef))!==undefined;if(!_0x28012c&&!_0x351218)throw CliErrors[_0x40082c(0x206)](_0x40082c(0x1ea));const _0x75a4a0=_0x590292[_0x40082c(0x1f3)](_0x40082c(0x1e8))[_0x40082c(0x209)](),_0xc0c694=_0x590292[_0x40082c(0x1f3)](_0x40082c(0x1ef))[_0x40082c(0x209)]();if(_0x28012c&&!_0x75a4a0)throw CliErrors[_0x40082c(0x206)](_0x40082c(0x1ff));if(_0x351218&&!_0xc0c694)throw CliErrors[_0x40082c(0x206)](_0x40082c(0x1f2),_0x40082c(0x1fd));return{..._0x28012c?{'roleName':_0x75a4a0}:{},..._0x351218?{'remark':_0xc0c694}:{}};}function a54_0x4846(){const _0x40424d=['remark','681692pzTJhV','string','--remark\x20must\x20not\x20be\x20blank.','str','Update\x20a\x20runtime\x20CUSTOM\x20role','1237678iHWmxM','/client/permit/role/update','5XRKeiN','12JvKtGX','3375678hrKSqq','110iIsfLW','build','num','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','6NYDuMS','--name\x20must\x20not\x20be\x20blank.','1350228dtCgKH','7RAgWxV','3455920XHatWN','New\x20non-empty\x20role\x20remark','修改当前运行应用中的自定义角色名称或备注;变更会立即影响角色展示。','update','validation','75519JjJoGE','flag','trim','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','POST','name','New\x20role\x20name','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','60MCTJpT','182MoLsTq','46739jSAxpJ','role'];a54_0x4846=function(){return _0x40424d;};return a54_0x4846();}function a54_0x2fca(_0x1d2443,_0x463314){_0x1d2443=_0x1d2443-0x1e6;const _0x484663=a54_0x4846();let _0x2fca55=_0x484663[_0x1d2443];return _0x2fca55;}async function prepare(_0x3fae9b){const _0x14bbe=a54_0x2fca,_0x23ab26=await getRuntimeRoleById(_0x3fae9b['appCode'],_0x3fae9b[_0x14bbe(0x1fc)]('id'));return assertCustomRuntimeRole(_0x23ab26,_0x14bbe(0x205)),{'role':_0x23ab26,'body':{'id':_0x23ab26['id'],'appCode':_0x3fae9b['appCode'],...updateFields(_0x3fae9b)}};}export const roleUpdate={'service':a54_0x1964aa(0x1ee),'command':'update','description':a54_0x1964aa(0x1f4),'risk':'high-risk-write','confirmationDescription':a54_0x1964aa(0x204),'flags':[ROLE_ID_FLAG,{'name':'name','type':a54_0x1964aa(0x1f1),'description':a54_0x1964aa(0x1e9)},{'name':a54_0x1964aa(0x1ef),'type':a54_0x1964aa(0x1f1),'description':a54_0x1964aa(0x203)}],async 'validate'(_0x3f145e){updateFields(_0x3f145e);},async 'dryRun'(_0x512187){const _0x2af51e=a54_0x1964aa,{body:_0x2d4771}=await prepare(_0x512187);return dryRun(_0x2af51e(0x1e7),_0x2af51e(0x1f6))['body'](_0x2d4771)['description'](_0x2af51e(0x1e6))[_0x2af51e(0x1fb)]();},async 'execute'(_0x561a19){const _0x18887e=a54_0x1964aa,{role:_0x36c98d,body:_0x36483d}=await prepare(_0x561a19),_0x5c96f9=await updateRuntimeAppRole(_0x36483d);return{'ok':!![],'data':runtimeRoleWriteResult(_0x18887e(0x205),{'roleId':_0x36c98d['id']},projectRuntimeRole(_0x36c98d),projectRuntimeRole(_0x5c96f9),{'method':_0x18887e(0x1e7),'path':_0x18887e(0x1f6)})};}};
1
+ function a54_0x2c17(){const _0x33f392=['The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','--name\x20must\x20not\x20be\x20blank.','2cPWZoF','1353789AfcYcu','5kDkBLd','num','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','6817632CfsjxH','New\x20non-empty\x20role\x20remark','build','remark','name','update','/client/permit/role/update','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','New\x20role\x20name','description','string','12SkzGDy','243489hdRWMy','108HmNmLc','POST','3988NZVAtd','appCode','756077yRHpbe','40oabuWs','trim','role','3487908wIaXYA','high-risk-write','2139973SxJsJP','str','--remark\x20must\x20not\x20be\x20blank.','validation','body','flag','修改当前运行应用中的自定义角色名称或备注;变更会立即影响角色展示。'];a54_0x2c17=function(){return _0x33f392;};return a54_0x2c17();}const a54_0x19216b=a54_0x3ad9;(function(_0x2b6ef8,_0x386a97){const _0x6655ec=a54_0x3ad9,_0x181195=_0x2b6ef8();while(!![]){try{const _0x94976a=-parseInt(_0x6655ec(0x174))/0x1*(parseInt(_0x6655ec(0x188))/0x2)+-parseInt(_0x6655ec(0x175))/0x3*(parseInt(_0x6655ec(0x177))/0x4)+parseInt(_0x6655ec(0x18a))/0x5*(parseInt(_0x6655ec(0x17d))/0x6)+parseInt(_0x6655ec(0x179))/0x7+parseInt(_0x6655ec(0x18d))/0x8+parseInt(_0x6655ec(0x189))/0x9*(-parseInt(_0x6655ec(0x17a))/0xa)+parseInt(_0x6655ec(0x17f))/0xb*(-parseInt(_0x6655ec(0x173))/0xc);if(_0x94976a===_0x386a97)break;else _0x181195['push'](_0x181195['shift']());}catch(_0x1cdd3d){_0x181195['push'](_0x181195['shift']());}}}(a54_0x2c17,0x71c05));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a54_0x3ad9(_0x30edd4,_0x53330f){_0x30edd4=_0x30edd4-0x169;const _0x2c17f7=a54_0x2c17();let _0x3ad92b=_0x2c17f7[_0x30edd4];return _0x3ad92b;}import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x256d73){const _0x3cf6a6=a54_0x3ad9,_0x50b2f8=_0x256d73['flag']('name')!==undefined,_0x43e3bb=_0x256d73[_0x3cf6a6(0x184)](_0x3cf6a6(0x16b))!==undefined;if(!_0x50b2f8&&!_0x43e3bb)throw CliErrors[_0x3cf6a6(0x182)](_0x3cf6a6(0x16f));const _0x104da7=_0x256d73[_0x3cf6a6(0x180)](_0x3cf6a6(0x16c))['trim'](),_0x4e5066=_0x256d73[_0x3cf6a6(0x180)](_0x3cf6a6(0x16b))[_0x3cf6a6(0x17b)]();if(_0x50b2f8&&!_0x104da7)throw CliErrors[_0x3cf6a6(0x182)](_0x3cf6a6(0x187));if(_0x43e3bb&&!_0x4e5066)throw CliErrors[_0x3cf6a6(0x182)](_0x3cf6a6(0x181),_0x3cf6a6(0x186));return{..._0x50b2f8?{'roleName':_0x104da7}:{},..._0x43e3bb?{'remark':_0x4e5066}:{}};}async function prepare(_0x152dcd){const _0x5b7b72=a54_0x3ad9,_0x90b41=await getRuntimeRoleById(_0x152dcd['appCode'],_0x152dcd[_0x5b7b72(0x18b)]('id'));return assertCustomRuntimeRole(_0x90b41,'update'),{'role':_0x90b41,'body':{'id':_0x90b41['id'],'appCode':_0x152dcd[_0x5b7b72(0x178)],...updateFields(_0x152dcd)}};}export const roleUpdate={'service':a54_0x19216b(0x17c),'command':a54_0x19216b(0x16d),'description':'Update\x20a\x20runtime\x20CUSTOM\x20role','risk':a54_0x19216b(0x17e),'confirmationDescription':a54_0x19216b(0x185),'flags':[ROLE_ID_FLAG,{'name':a54_0x19216b(0x16c),'type':a54_0x19216b(0x172),'description':a54_0x19216b(0x170)},{'name':a54_0x19216b(0x16b),'type':'string','description':a54_0x19216b(0x169)}],async 'validate'(_0x2b985c){updateFields(_0x2b985c);},async 'dryRun'(_0x3af87c){const _0x58d409=a54_0x19216b,{body:_0x469065}=await prepare(_0x3af87c);return dryRun(_0x58d409(0x176),_0x58d409(0x16e))[_0x58d409(0x183)](_0x469065)[_0x58d409(0x171)](_0x58d409(0x18c))[_0x58d409(0x16a)]();},async 'execute'(_0x390a2d){const _0x40c938=a54_0x19216b,{role:_0x48208a,body:_0x3deac6}=await prepare(_0x390a2d),_0x5d2b3f=await updateRuntimeAppRole(_0x3deac6);return{'ok':!![],'data':runtimeRoleWriteResult(_0x40c938(0x16d),{'roleId':_0x48208a['id']},projectRuntimeRole(_0x48208a),projectRuntimeRole(_0x5d2b3f),{'method':_0x40c938(0x176),'path':_0x40c938(0x16e)})};}};
@@ -1 +1 @@
1
- function a55_0x102f(_0x5ae26c,_0x296cca){_0x5ae26c=_0x5ae26c-0x1b4;const _0x35c0bb=a55_0x35c0();let _0x102f8a=_0x35c0bb[_0x5ae26c];return _0x102f8a;}const a55_0x224e98=a55_0x102f;(function(_0x1808b0,_0x33d2eb){const _0x4b6a08=a55_0x102f,_0x5960d6=_0x1808b0();while(!![]){try{const _0x18ac75=-parseInt(_0x4b6a08(0x1c0))/0x1*(parseInt(_0x4b6a08(0x1cb))/0x2)+-parseInt(_0x4b6a08(0x1be))/0x3+parseInt(_0x4b6a08(0x1c3))/0x4+-parseInt(_0x4b6a08(0x1ca))/0x5+parseInt(_0x4b6a08(0x1ba))/0x6*(parseInt(_0x4b6a08(0x1c8))/0x7)+parseInt(_0x4b6a08(0x1c6))/0x8*(parseInt(_0x4b6a08(0x1bb))/0x9)+-parseInt(_0x4b6a08(0x1bc))/0xa*(parseInt(_0x4b6a08(0x1cc))/0xb);if(_0x18ac75===_0x33d2eb)break;else _0x5960d6['push'](_0x5960d6['shift']());}catch(_0xb84c57){_0x5960d6['push'](_0x5960d6['shift']());}}}(a55_0x35c0,0x40c11));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a55_0x35c0(){const _0x2768d2=['description','247944rXplZg','63YmgfXz','15380PlroWq','POST','1126104GLJQfo','build','1ItrQCr','appCode','after','1497612lkAVob','body','/client/permit/user-role/update-user-list','377120CNksBe','warnings','77cqMjug','Preview:\x20add\x20runtime\x20role\x20member','1472095FjIxEe','334042MEmUhJ','407jbpaNF','shouldWrite','high-risk-write','userId','before','user-add','把指定运行用户加入目标角色;该用户将获得该角色对应的运行权限。'];a55_0x35c0=function(){return _0x2768d2;};return a55_0x35c0();}import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':'user-add','description':'Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','risk':a55_0x224e98(0x1b4),'confirmationDescription':a55_0x224e98(0x1b8),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x3cf710){const _0x39c9b6=a55_0x224e98,_0x49be1d=await prepareRuntimeMemberMutation(_0x3cf710,'user-add');return dryRun(_0x39c9b6(0x1bd),_0x39c9b6(0x1c5))[_0x39c9b6(0x1c4)]({'appCode':_0x3cf710[_0x39c9b6(0x1c1)],'roleList':_0x49be1d['roleList']})[_0x39c9b6(0x1b9)](_0x49be1d[_0x39c9b6(0x1cd)]?_0x39c9b6(0x1c9):_0x49be1d[_0x39c9b6(0x1c7)][0x0])[_0x39c9b6(0x1bf)]();},async 'execute'(_0x284b26){const _0xbd5370=a55_0x224e98,_0x5cea76=await prepareRuntimeMemberMutation(_0x284b26,_0xbd5370(0x1b7));return _0x5cea76[_0xbd5370(0x1cd)]&&await updateRuntimeRoleUsers(_0x284b26[_0xbd5370(0x1c1)],_0x5cea76['roleList']),{'ok':!![],'data':runtimeRoleWriteResult(_0xbd5370(0x1b7),{'roleId':_0x5cea76['role']['id'],'userId':_0x5cea76[_0xbd5370(0x1b5)]},_0x5cea76[_0xbd5370(0x1b6)],_0x5cea76[_0xbd5370(0x1c2)],{'method':_0xbd5370(0x1bd),'path':'/client/permit/user-role/update-user-list'},_0x5cea76['warnings'])};}};
1
+ const a55_0x3c9f04=a55_0x6e8c;(function(_0x5b23ca,_0x5a84af){const _0x58eecc=a55_0x6e8c,_0x5f050b=_0x5b23ca();while(!![]){try{const _0x1ebd55=parseInt(_0x58eecc(0xa7))/0x1+parseInt(_0x58eecc(0xa8))/0x2+-parseInt(_0x58eecc(0xaf))/0x3*(parseInt(_0x58eecc(0xad))/0x4)+parseInt(_0x58eecc(0xbe))/0x5*(parseInt(_0x58eecc(0xb0))/0x6)+parseInt(_0x58eecc(0xba))/0x7*(-parseInt(_0x58eecc(0xb8))/0x8)+-parseInt(_0x58eecc(0xc0))/0x9+parseInt(_0x58eecc(0xa9))/0xa;if(_0x1ebd55===_0x5a84af)break;else _0x5f050b['push'](_0x5f050b['shift']());}catch(_0x28773c){_0x5f050b['push'](_0x5f050b['shift']());}}}(a55_0x58fa,0x5b58c));function a55_0x6e8c(_0x36de80,_0x38174f){_0x36de80=_0x36de80-0xa7;const _0x58fab9=a55_0x58fa();let _0x6e8cb7=_0x58fab9[_0x36de80];return _0x6e8cb7;}import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a55_0x58fa(){const _0x5c3a13=['user-add','298434pVzpdM','65298FhJnWg','before','Preview:\x20add\x20runtime\x20role\x20member','POST','high-risk-write','把指定运行用户加入目标角色;该用户将获得该角色对应的运行权限。','roleList','body','8jTHiSy','role','5063947bOGexB','warnings','shouldWrite','description','220embXTQ','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','3601584XmTZSj','appCode','9991QxHVIS','538806jKARex','13363750TXgwDJ','build','userId','/client/permit/user-role/update-user-list','24aHaOJs'];a55_0x58fa=function(){return _0x5c3a13;};return a55_0x58fa();}export const roleUserAdd={'service':a55_0x3c9f04(0xb9),'command':a55_0x3c9f04(0xae),'description':a55_0x3c9f04(0xbf),'risk':a55_0x3c9f04(0xb4),'confirmationDescription':a55_0x3c9f04(0xb5),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x1bbb03){const _0x4c1ef6=a55_0x3c9f04,_0x49aee4=await prepareRuntimeMemberMutation(_0x1bbb03,'user-add');return dryRun('POST',_0x4c1ef6(0xac))[_0x4c1ef6(0xb7)]({'appCode':_0x1bbb03[_0x4c1ef6(0xc1)],'roleList':_0x49aee4[_0x4c1ef6(0xb6)]})[_0x4c1ef6(0xbd)](_0x49aee4[_0x4c1ef6(0xbc)]?_0x4c1ef6(0xb2):_0x49aee4[_0x4c1ef6(0xbb)][0x0])[_0x4c1ef6(0xaa)]();},async 'execute'(_0x5e3981){const _0x10eaec=a55_0x3c9f04,_0x573a60=await prepareRuntimeMemberMutation(_0x5e3981,_0x10eaec(0xae));return _0x573a60[_0x10eaec(0xbc)]&&await updateRuntimeRoleUsers(_0x5e3981[_0x10eaec(0xc1)],_0x573a60['roleList']),{'ok':!![],'data':runtimeRoleWriteResult('user-add',{'roleId':_0x573a60['role']['id'],'userId':_0x573a60[_0x10eaec(0xab)]},_0x573a60[_0x10eaec(0xb1)],_0x573a60['after'],{'method':_0x10eaec(0xb3),'path':'/client/permit/user-role/update-user-list'},_0x573a60[_0x10eaec(0xbb)])};}};
@@ -1 +1 @@
1
- const a56_0x5849a6=a56_0x389c;(function(_0x4b84a2,_0x281a45){const _0x47c524=a56_0x389c,_0x43b95d=_0x4b84a2();while(!![]){try{const _0x56cb72=parseInt(_0x47c524(0x9d))/0x1+parseInt(_0x47c524(0xa7))/0x2*(-parseInt(_0x47c524(0xb2))/0x3)+parseInt(_0x47c524(0xad))/0x4+-parseInt(_0x47c524(0x9e))/0x5+parseInt(_0x47c524(0xb1))/0x6*(parseInt(_0x47c524(0xa6))/0x7)+parseInt(_0x47c524(0xa8))/0x8+-parseInt(_0x47c524(0x9a))/0x9*(parseInt(_0x47c524(0xa1))/0xa);if(_0x56cb72===_0x281a45)break;else _0x43b95d['push'](_0x43b95d['shift']());}catch(_0x22096c){_0x43b95d['push'](_0x43b95d['shift']());}}}(a56_0x4286,0x82ddf));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a56_0x389c(_0x2b258a,_0x5460cc){_0x2b258a=_0x2b258a-0x9a;const _0x4286aa=a56_0x4286();let _0x389c9d=_0x4286aa[_0x2b258a];return _0x389c9d;}import{dryRun}from'../../framework/dryrun.js';function a56_0x4286(){const _0x4c319f=['34024NWnLoN','7467600uTRgdV','warnings','high-risk-write','/client/permit/user-role/update-user-list','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','2670764ziuIMa','after','roleList','appCode','353178GLjFgp','24tXnBjv','213336LHPAPZ','userId','POST','708615wBPKtL','3255670MejFDF','role','Preview:\x20remove\x20runtime\x20role\x20member','590uXoAci','description','build','shouldWrite','user-remove','49ZSBEmL'];a56_0x4286=function(){return _0x4c319f;};return a56_0x4286();}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':a56_0x5849a6(0xa5),'description':a56_0x5849a6(0xac),'risk':a56_0x5849a6(0xaa),'confirmationDescription':'把指定运行用户移出目标角色;该用户将失去仅由该角色授予的运行权限。','flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x30e4dc){const _0x3f1d9a=a56_0x5849a6,_0x58984e=await prepareRuntimeMemberMutation(_0x30e4dc,_0x3f1d9a(0xa5));return dryRun(_0x3f1d9a(0x9c),_0x3f1d9a(0xab))['body']({'appCode':_0x30e4dc[_0x3f1d9a(0xb0)],'roleList':_0x58984e[_0x3f1d9a(0xaf)]})[_0x3f1d9a(0xa2)](_0x58984e[_0x3f1d9a(0xa4)]?_0x3f1d9a(0xa0):_0x58984e[_0x3f1d9a(0xa9)][0x0])[_0x3f1d9a(0xa3)]();},async 'execute'(_0x2d8bc1){const _0x1697d6=a56_0x5849a6,_0x54ed0c=await prepareRuntimeMemberMutation(_0x2d8bc1,_0x1697d6(0xa5));return _0x54ed0c[_0x1697d6(0xa4)]&&await updateRuntimeRoleUsers(_0x2d8bc1[_0x1697d6(0xb0)],_0x54ed0c[_0x1697d6(0xaf)]),{'ok':!![],'data':runtimeRoleWriteResult('user-remove',{'roleId':_0x54ed0c[_0x1697d6(0x9f)]['id'],'userId':_0x54ed0c[_0x1697d6(0x9b)]},_0x54ed0c['before'],_0x54ed0c[_0x1697d6(0xae)],{'method':_0x1697d6(0x9c),'path':_0x1697d6(0xab)},_0x54ed0c[_0x1697d6(0xa9)])};}};
1
+ const a56_0x39b84e=a56_0x5324;function a56_0x5792(){const _0x3b2bc1=['roleList','role','168142cWjAsS','before','after','1043736fMzogd','userId','827373Xqfseo','appCode','3784736jZyFJo','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','把指定运行用户移出目标角色;该用户将失去仅由该角色授予的运行权限。','5515osWeeK','description','2529297nrnwzP','user-remove','body','POST','warnings','2116TbzXoL','21847uzctTh','build','shouldWrite','534HUkcXm'];a56_0x5792=function(){return _0x3b2bc1;};return a56_0x5792();}(function(_0x23ce76,_0x5e16b9){const _0x4380c9=a56_0x5324,_0x34ec00=_0x23ce76();while(!![]){try{const _0x312512=parseInt(_0x4380c9(0x92))/0x1+parseInt(_0x4380c9(0x95))/0x2+parseInt(_0x4380c9(0x97))/0x3+parseInt(_0x4380c9(0xa3))/0x4*(-parseInt(_0x4380c9(0x9c))/0x5)+-parseInt(_0x4380c9(0x8f))/0x6*(parseInt(_0x4380c9(0xa4))/0x7)+parseInt(_0x4380c9(0x99))/0x8+-parseInt(_0x4380c9(0x9e))/0x9;if(_0x312512===_0x5e16b9)break;else _0x34ec00['push'](_0x34ec00['shift']());}catch(_0x14b9b2){_0x34ec00['push'](_0x34ec00['shift']());}}}(a56_0x5792,0x4869c));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a56_0x5324(_0x44572d,_0x286f74){_0x44572d=_0x44572d-0x8f;const _0x5792a8=a56_0x5792();let _0x5324bb=_0x5792a8[_0x44572d];return _0x5324bb;}import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a56_0x39b84e(0x91),'command':a56_0x39b84e(0x9f),'description':a56_0x39b84e(0x9a),'risk':'high-risk-write','confirmationDescription':a56_0x39b84e(0x9b),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x458fb7){const _0x8b1a8=a56_0x39b84e,_0x5d1f16=await prepareRuntimeMemberMutation(_0x458fb7,_0x8b1a8(0x9f));return dryRun(_0x8b1a8(0xa1),'/client/permit/user-role/update-user-list')[_0x8b1a8(0xa0)]({'appCode':_0x458fb7['appCode'],'roleList':_0x5d1f16[_0x8b1a8(0x90)]})[_0x8b1a8(0x9d)](_0x5d1f16['shouldWrite']?'Preview:\x20remove\x20runtime\x20role\x20member':_0x5d1f16[_0x8b1a8(0xa2)][0x0])[_0x8b1a8(0xa5)]();},async 'execute'(_0x360ac5){const _0x125372=a56_0x39b84e,_0x2142c2=await prepareRuntimeMemberMutation(_0x360ac5,_0x125372(0x9f));return _0x2142c2[_0x125372(0xa6)]&&await updateRuntimeRoleUsers(_0x360ac5[_0x125372(0x98)],_0x2142c2['roleList']),{'ok':!![],'data':runtimeRoleWriteResult(_0x125372(0x9f),{'roleId':_0x2142c2['role']['id'],'userId':_0x2142c2[_0x125372(0x96)]},_0x2142c2[_0x125372(0x93)],_0x2142c2[_0x125372(0x94)],{'method':_0x125372(0xa1),'path':'/client/permit/user-role/update-user-list'},_0x2142c2[_0x125372(0xa2)])};}};
@@ -1 +1 @@
1
- const a57_0x1e6633=a57_0x42c9;(function(_0xc57af3,_0x411e65){const _0x54ba9c=a57_0x42c9,_0x4f0f16=_0xc57af3();while(!![]){try{const _0xd9c7e9=-parseInt(_0x54ba9c(0x113))/0x1*(parseInt(_0x54ba9c(0x115))/0x2)+parseInt(_0x54ba9c(0x145))/0x3*(-parseInt(_0x54ba9c(0x125))/0x4)+-parseInt(_0x54ba9c(0x140))/0x5*(-parseInt(_0x54ba9c(0x10a))/0x6)+parseInt(_0x54ba9c(0x136))/0x7+parseInt(_0x54ba9c(0x124))/0x8*(parseInt(_0x54ba9c(0x12f))/0x9)+parseInt(_0x54ba9c(0x148))/0xa*(parseInt(_0x54ba9c(0x10b))/0xb)+parseInt(_0x54ba9c(0x101))/0xc*(parseInt(_0x54ba9c(0x11c))/0xd);if(_0xd9c7e9===_0x411e65)break;else _0x4f0f16['push'](_0x4f0f16['shift']());}catch(_0x5a02cf){_0x4f0f16['push'](_0x4f0f16['shift']());}}}(a57_0x43f2,0xea8e9));function a57_0x42c9(_0x506291,_0x478f30){_0x506291=_0x506291-0x101;const _0x43f28f=a57_0x43f2();let _0x42c928=_0x43f28f[_0x506291];return _0x42c928;}import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';function a57_0x43f2(){const _0x2e25c1=['schedule-id','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','taskId','build','9981LnQoIw','Task\x20channel:\x20auto\x20or\x20premium','appCode','DELETE','premium','Created\x20','channel','6510350yrktUN','validate','/run','scheduled-at','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Deleted\x20schedule\x20','scheduleId','UTC','POST','\x20immediately','457035kVxPsP','Preview:\x20run\x20schedule\x20','delete','schedule','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','3051PWodaW','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','32670JcxxQu','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','length','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','20038812SMvuZl','string','创建周期性或单次执行的\x20Agent\x20定时任务','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','CRON','create','prompt','isSafeInteger','/api/harness/apps/','78smZdZq','1606DeUjVX','--prompt\x20must\x20not\x20be\x20blank.','Preview:\x20create\x20an\x20Agent\x20schedule','limit','read','title','str','Schedule\x20title','295vFKIOO','run','11548tEqhdC','Page\x20size\x20from\x201\x20to\x20100','validation','auto','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','list','cursor','13yHQbxq','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','cron','--title\x20must\x20not\x20be\x20blank.','kind','high-risk-write','trim','Schedule\x20input\x20is\x20valid','2000GJrKMk','7388zJNatG','number','num','ONCE','\x20schedule\x20','description'];a57_0x43f2=function(){return _0x2e25c1;};return a57_0x43f2();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a57_0x1e6633(0x120),'type':a57_0x1e6633(0x102),'required':!![],'enum':[a57_0x1e6633(0x105),a57_0x1e6633(0x128)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':'cron','type':'string','description':a57_0x1e6633(0x144)},SCHEDULED_AT_FLAG={'name':a57_0x1e6633(0x139),'type':a57_0x1e6633(0x102),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a57_0x1e6633(0x110),'type':a57_0x1e6633(0x102),'required':!![],'description':a57_0x1e6633(0x112)},PROMPT_FLAG={'name':'prompt','type':a57_0x1e6633(0x102),'required':!![],'description':a57_0x1e6633(0x11d)},CHANNEL_FLAG={'name':a57_0x1e6633(0x135),'type':a57_0x1e6633(0x102),'enum':[a57_0x1e6633(0x118),'premium'],'default':a57_0x1e6633(0x133),'description':a57_0x1e6633(0x130)},SCHEDULE_ID_FLAG={'name':'schedule-id','type':a57_0x1e6633(0x102),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a57_0x1e6633(0x149)}},LIMIT_FLAG={'name':a57_0x1e6633(0x10e),'type':a57_0x1e6633(0x126),'default':0x14,'description':a57_0x1e6633(0x116)},CURSOR_FLAG={'name':a57_0x1e6633(0x11b),'type':a57_0x1e6633(0x102),'description':a57_0x1e6633(0x146)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x2b06e5){const _0x9be7b=a57_0x1e6633,_0x517a52=_0x2b06e5[_0x9be7b(0x111)](_0x9be7b(0x120)),_0x493a6e=_0x2b06e5['str'](_0x9be7b(0x110))[_0x9be7b(0x122)](),_0x322523=_0x2b06e5[_0x9be7b(0x111)](_0x9be7b(0x107))[_0x9be7b(0x122)](),_0x315b5d=_0x2b06e5[_0x9be7b(0x111)]('channel'),_0x490f2a=_0x2b06e5['str'](_0x9be7b(0x11e)),_0x2900a3=_0x2b06e5['str']('scheduled-at');if(!_0x493a6e)throw CliErrors['validation'](_0x9be7b(0x11f));if(!_0x322523)throw CliErrors[_0x9be7b(0x117)](_0x9be7b(0x10c));if(_0x517a52==='CRON'){if(!_0x490f2a||_0x2900a3)throw CliErrors['validation'](_0x9be7b(0x119));return{'kind':_0x517a52,'timezone':_0x9be7b(0x13d),'cron':_0x490f2a,'title':_0x493a6e,'prompt':_0x322523,'channel':_0x315b5d};}if(_0x517a52==='ONCE'){if(!_0x2900a3||_0x490f2a)throw CliErrors[_0x9be7b(0x117)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x517a52,'timezone':_0x9be7b(0x13d),'scheduledAt':_0x2900a3,'title':_0x493a6e,'prompt':_0x322523,'channel':_0x315b5d};}throw CliErrors[_0x9be7b(0x117)](_0x9be7b(0x14b));}function scheduleCollectionPath(_0x58023f){const _0x7c0e92=a57_0x1e6633;return _0x7c0e92(0x109)+encodeURIComponent(_0x58023f)+'/schedules';}function scheduleItemPath(_0x4f957c,_0x56b09b){return scheduleCollectionPath(_0x4f957c)+'/'+encodeURIComponent(_0x56b09b);}const scheduleValidate={'service':a57_0x1e6633(0x143),'command':a57_0x1e6633(0x137),'description':a57_0x1e6633(0x104),'risk':a57_0x1e6633(0x10f),'flags':INPUT_FLAGS,async 'validate'(_0x3df124){readScheduleInput(_0x3df124);},async 'execute'(_0x27c484){const _0x55522b=a57_0x1e6633,_0xa681e1=readScheduleInput(_0x27c484),_0x3e774f=await validateRuntimeSchedule(_0x27c484['appCode'],_0xa681e1);return{'ok':!![],'data':_0x3e774f,'message':_0x55522b(0x123)};}},scheduleCreate={'service':a57_0x1e6633(0x143),'command':a57_0x1e6633(0x106),'description':a57_0x1e6633(0x103),'risk':a57_0x1e6633(0x121),'confirmationDescription':'将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','flags':INPUT_FLAGS,async 'validate'(_0x22cd9c){readScheduleInput(_0x22cd9c);},async 'execute'(_0x54642a){const _0x5d86d4=a57_0x1e6633,_0x56c4d4=readScheduleInput(_0x54642a),_0x589d10=await validateRuntimeSchedule(_0x54642a[_0x5d86d4(0x131)],_0x56c4d4),_0x4920c7=await createRuntimeSchedule(_0x54642a[_0x5d86d4(0x131)],_0x589d10);return{'ok':!![],'data':_0x4920c7,'message':_0x5d86d4(0x134)+_0x4920c7[_0x5d86d4(0x120)]+_0x5d86d4(0x129)+_0x4920c7[_0x5d86d4(0x13c)]};},async 'dryRun'(_0x476e19){const _0x14f6c2=a57_0x1e6633,_0x43b406=readScheduleInput(_0x476e19);return dryRun(_0x14f6c2(0x13e),scheduleCollectionPath(_0x476e19['appCode']))['body'](_0x43b406)['description'](_0x14f6c2(0x10d))['build']();}},scheduleList={'service':a57_0x1e6633(0x143),'command':a57_0x1e6633(0x11a),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a57_0x1e6633(0x10f),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x28a662){const _0x4700d1=a57_0x1e6633,_0x42bc4f=_0x28a662[_0x4700d1(0x127)](_0x4700d1(0x10e));if(!Number[_0x4700d1(0x108)](_0x42bc4f)||_0x42bc4f<0x1||_0x42bc4f>0x64)throw CliErrors['validation'](_0x4700d1(0x13a));const _0x1860cd=_0x28a662[_0x4700d1(0x111)](_0x4700d1(0x11b));if(_0x1860cd&&(_0x1860cd[_0x4700d1(0x14a)]>0x400||_0x1860cd[_0x4700d1(0x122)]()!==_0x1860cd))throw CliErrors[_0x4700d1(0x117)](_0x4700d1(0x147));},async 'execute'(_0x411239){const _0x2fb169=a57_0x1e6633,_0x3c65c4=_0x411239['str'](_0x2fb169(0x11b)),_0x2dad19=await listRuntimeSchedules(_0x411239[_0x2fb169(0x131)],{'kind':_0x411239['str'](_0x2fb169(0x120)),'limit':_0x411239[_0x2fb169(0x127)](_0x2fb169(0x10e)),..._0x3c65c4?{'cursor':_0x3c65c4}:{}});return{'ok':!![],'data':_0x2dad19};}},scheduleDetail={'service':a57_0x1e6633(0x143),'command':'detail','description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a57_0x1e6633(0x10f),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4d425e){const _0x2360ea=a57_0x1e6633,_0x4454e8=await getRuntimeSchedule(_0x4d425e[_0x2360ea(0x131)],_0x4d425e[_0x2360ea(0x111)](_0x2360ea(0x12b)));return{'ok':!![],'data':_0x4454e8};}},scheduleRun={'service':a57_0x1e6633(0x143),'command':a57_0x1e6633(0x114),'description':'立即运行一次定时任务并创建\x20Task','risk':a57_0x1e6633(0x121),'confirmationDescription':a57_0x1e6633(0x12c),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x187ad2){const _0x1e6c6b=a57_0x1e6633,_0x2f0275=_0x187ad2[_0x1e6c6b(0x111)]('schedule-id'),_0x381b47=await runRuntimeSchedule(_0x187ad2[_0x1e6c6b(0x131)],_0x2f0275);return{'ok':!![],'data':_0x381b47,'message':'Queued\x20Task\x20'+_0x381b47[_0x1e6c6b(0x12d)]+'\x20from\x20schedule\x20'+_0x2f0275};},async 'dryRun'(_0x33b61f){const _0x431f14=a57_0x1e6633,_0x5d8e28=_0x33b61f['str'](_0x431f14(0x12b));return dryRun(_0x431f14(0x13e),scheduleItemPath(_0x33b61f[_0x431f14(0x131)],_0x5d8e28)+_0x431f14(0x138))[_0x431f14(0x12a)](_0x431f14(0x141)+_0x5d8e28+_0x431f14(0x13f))[_0x431f14(0x12e)]();}},scheduleDelete={'service':a57_0x1e6633(0x143),'command':a57_0x1e6633(0x142),'description':'删除定时任务并停止其后续触发','risk':a57_0x1e6633(0x121),'confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x8a3d02){const _0x104976=a57_0x1e6633,_0x41fb1d=_0x8a3d02[_0x104976(0x111)](_0x104976(0x12b)),_0x47a609=await deleteRuntimeSchedule(_0x8a3d02[_0x104976(0x131)],_0x41fb1d);return{'ok':!![],'data':_0x47a609,'message':_0x104976(0x13b)+_0x41fb1d};},async 'dryRun'(_0x356973){const _0x22a025=a57_0x1e6633,_0x520e18=_0x356973[_0x22a025(0x111)]('schedule-id');return dryRun(_0x22a025(0x132),scheduleItemPath(_0x356973['appCode'],_0x520e18))[_0x22a025(0x12a)]('Preview:\x20delete\x20schedule\x20'+_0x520e18)[_0x22a025(0x12e)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a57_0x24483f=a57_0x8522;(function(_0x8fd8e,_0x24ce48){const _0x5c23e5=a57_0x8522,_0x4d8210=_0x8fd8e();while(!![]){try{const _0x3dd06b=parseInt(_0x5c23e5(0x78))/0x1+-parseInt(_0x5c23e5(0xa7))/0x2*(parseInt(_0x5c23e5(0x95))/0x3)+parseInt(_0x5c23e5(0x8c))/0x4+-parseInt(_0x5c23e5(0x85))/0x5*(parseInt(_0x5c23e5(0x7b))/0x6)+parseInt(_0x5c23e5(0x7f))/0x7+-parseInt(_0x5c23e5(0xad))/0x8*(-parseInt(_0x5c23e5(0x96))/0x9)+-parseInt(_0x5c23e5(0x91))/0xa;if(_0x3dd06b===_0x24ce48)break;else _0x4d8210['push'](_0x4d8210['shift']());}catch(_0x27e9d7){_0x4d8210['push'](_0x4d8210['shift']());}}}(a57_0x2103,0x579a5));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':a57_0x24483f(0x74),'required':!![],'enum':[a57_0x24483f(0x9f),a57_0x24483f(0x71)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':a57_0x24483f(0x82),'type':'string','description':a57_0x24483f(0x6d)},SCHEDULED_AT_FLAG={'name':a57_0x24483f(0x7a),'type':a57_0x24483f(0x74),'description':a57_0x24483f(0x90)},TITLE_FLAG={'name':a57_0x24483f(0x9a),'type':'string','required':!![],'description':a57_0x24483f(0x84)},PROMPT_FLAG={'name':a57_0x24483f(0xaf),'type':a57_0x24483f(0x74),'required':!![],'description':a57_0x24483f(0x8f)},CHANNEL_FLAG={'name':a57_0x24483f(0xaa),'type':a57_0x24483f(0x74),'enum':[a57_0x24483f(0x93),'premium'],'default':'premium','description':'Task\x20channel:\x20auto\x20or\x20premium'},SCHEDULE_ID_FLAG={'name':'schedule-id','type':a57_0x24483f(0x74),'required':!![],'description':a57_0x24483f(0x98),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a57_0x24483f(0x8d),'type':'number','default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a57_0x24483f(0x9e),'type':a57_0x24483f(0x74),'description':a57_0x24483f(0x88)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x15788c){const _0x43b7b2=a57_0x24483f,_0x1ef776=_0x15788c[_0x43b7b2(0x7e)](_0x43b7b2(0x7d)),_0x32e60f=_0x15788c['str'](_0x43b7b2(0x9a))[_0x43b7b2(0x83)](),_0x58c910=_0x15788c['str'](_0x43b7b2(0xaf))[_0x43b7b2(0x83)](),_0x241a46=_0x15788c[_0x43b7b2(0x7e)](_0x43b7b2(0xaa)),_0x1b18d0=_0x15788c[_0x43b7b2(0x7e)](_0x43b7b2(0x82)),_0x2c8ae0=_0x15788c['str'](_0x43b7b2(0x7a));if(!_0x32e60f)throw CliErrors['validation'](_0x43b7b2(0xa0));if(!_0x58c910)throw CliErrors[_0x43b7b2(0x94)](_0x43b7b2(0x8b));if(_0x1ef776==='CRON'){if(!_0x1b18d0||_0x2c8ae0)throw CliErrors[_0x43b7b2(0x94)](_0x43b7b2(0x6c));return{'kind':_0x1ef776,'timezone':'UTC','cron':_0x1b18d0,'title':_0x32e60f,'prompt':_0x58c910,'channel':_0x241a46};}if(_0x1ef776===_0x43b7b2(0x71)){if(!_0x2c8ae0||_0x1b18d0)throw CliErrors[_0x43b7b2(0x94)](_0x43b7b2(0xa4));return{'kind':_0x1ef776,'timezone':'UTC','scheduledAt':_0x2c8ae0,'title':_0x32e60f,'prompt':_0x58c910,'channel':_0x241a46};}throw CliErrors[_0x43b7b2(0x94)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function scheduleCollectionPath(_0xfd8e32){const _0x3f68de=a57_0x24483f;return _0x3f68de(0x73)+encodeURIComponent(_0xfd8e32)+_0x3f68de(0x6b);}function a57_0x2103(){const _0xf48554=['Created\x20','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','build','--prompt\x20must\x20not\x20be\x20blank.','420272sSXrxv','limit','schedule-id','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','4460350rhOwkf','validate','auto','validation','139701AXCZQc','296991daWzcY','scheduleId','Schedule\x20UUID','Preview:\x20run\x20schedule\x20','title','run','创建周期性或单次执行的\x20Agent\x20定时任务','num','cursor','CRON','--title\x20must\x20not\x20be\x20blank.','Deleted\x20schedule\x20','list','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','立即运行一次定时任务并创建\x20Task','schedule','12tpwhzw','read','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','channel','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','description','144YFmyWj','Preview:\x20create\x20an\x20Agent\x20schedule','prompt','isSafeInteger','/schedules','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','delete','create','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','ONCE','Queued\x20Task\x20','/api/harness/apps/','string','Schedule\x20input\x20is\x20valid','POST','appCode','457239iQoytx','high-risk-write','scheduled-at','12ldgRHM','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','kind','str','2056481sJjYyp','DELETE','Show\x20one\x20schedule\x20by\x20schedule\x20ID','cron','trim','Schedule\x20title','914535vABkpp','删除定时任务并停止其后续触发'];a57_0x2103=function(){return _0xf48554;};return a57_0x2103();}function scheduleItemPath(_0x5162f1,_0x36c5cb){return scheduleCollectionPath(_0x5162f1)+'/'+encodeURIComponent(_0x36c5cb);}function a57_0x8522(_0x19a2e2,_0x32a27d){_0x19a2e2=_0x19a2e2-0x6a;const _0x210358=a57_0x2103();let _0x8522f2=_0x210358[_0x19a2e2];return _0x8522f2;}const scheduleValidate={'service':a57_0x24483f(0xa6),'command':a57_0x24483f(0x92),'description':a57_0x24483f(0x7c),'risk':a57_0x24483f(0xa8),'flags':INPUT_FLAGS,async 'validate'(_0x323ea9){readScheduleInput(_0x323ea9);},async 'execute'(_0x1331db){const _0x5259a1=a57_0x24483f,_0x4a97bf=readScheduleInput(_0x1331db),_0x59ad4c=await validateRuntimeSchedule(_0x1331db[_0x5259a1(0x77)],_0x4a97bf);return{'ok':!![],'data':_0x59ad4c,'message':_0x5259a1(0x75)};}},scheduleCreate={'service':a57_0x24483f(0xa6),'command':a57_0x24483f(0x6f),'description':a57_0x24483f(0x9c),'risk':a57_0x24483f(0x79),'confirmationDescription':a57_0x24483f(0x89),'flags':INPUT_FLAGS,async 'validate'(_0x4e1ab4){readScheduleInput(_0x4e1ab4);},async 'execute'(_0x17b75d){const _0xaba125=a57_0x24483f,_0x1168a7=readScheduleInput(_0x17b75d),_0x59b941=await validateRuntimeSchedule(_0x17b75d['appCode'],_0x1168a7),_0x13f7ec=await createRuntimeSchedule(_0x17b75d[_0xaba125(0x77)],_0x59b941);return{'ok':!![],'data':_0x13f7ec,'message':_0xaba125(0x87)+_0x13f7ec[_0xaba125(0x7d)]+'\x20schedule\x20'+_0x13f7ec[_0xaba125(0x97)]};},async 'dryRun'(_0x4c8ffd){const _0x215f46=a57_0x24483f,_0x3913df=readScheduleInput(_0x4c8ffd);return dryRun('POST',scheduleCollectionPath(_0x4c8ffd['appCode']))['body'](_0x3913df)[_0x215f46(0xac)](_0x215f46(0xae))[_0x215f46(0x8a)]();}},scheduleList={'service':a57_0x24483f(0xa6),'command':a57_0x24483f(0xa2),'description':a57_0x24483f(0xa3),'risk':a57_0x24483f(0xa8),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x126406){const _0x21fe65=a57_0x24483f,_0x2527bc=_0x126406[_0x21fe65(0x9d)]('limit');if(!Number[_0x21fe65(0x6a)](_0x2527bc)||_0x2527bc<0x1||_0x2527bc>0x64)throw CliErrors[_0x21fe65(0x94)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x503d60=_0x126406['str'](_0x21fe65(0x9e));if(_0x503d60&&(_0x503d60['length']>0x400||_0x503d60[_0x21fe65(0x83)]()!==_0x503d60))throw CliErrors[_0x21fe65(0x94)](_0x21fe65(0x70));},async 'execute'(_0x825fcf){const _0x2dca4=a57_0x24483f,_0x35ba3c=_0x825fcf[_0x2dca4(0x7e)](_0x2dca4(0x9e)),_0x383355=await listRuntimeSchedules(_0x825fcf[_0x2dca4(0x77)],{'kind':_0x825fcf[_0x2dca4(0x7e)](_0x2dca4(0x7d)),'limit':_0x825fcf[_0x2dca4(0x9d)](_0x2dca4(0x8d)),..._0x35ba3c?{'cursor':_0x35ba3c}:{}});return{'ok':!![],'data':_0x383355};}},scheduleDetail={'service':'schedule','command':'detail','description':a57_0x24483f(0x81),'risk':a57_0x24483f(0xa8),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x144e3b){const _0x4aac06=a57_0x24483f,_0x4faa27=await getRuntimeSchedule(_0x144e3b[_0x4aac06(0x77)],_0x144e3b[_0x4aac06(0x7e)]('schedule-id'));return{'ok':!![],'data':_0x4faa27};}},scheduleRun={'service':'schedule','command':a57_0x24483f(0x9b),'description':a57_0x24483f(0xa5),'risk':'high-risk-write','confirmationDescription':a57_0x24483f(0xa9),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x512aba){const _0x23bde1=a57_0x24483f,_0x3cede6=_0x512aba[_0x23bde1(0x7e)]('schedule-id'),_0x320b8e=await runRuntimeSchedule(_0x512aba[_0x23bde1(0x77)],_0x3cede6);return{'ok':!![],'data':_0x320b8e,'message':_0x23bde1(0x72)+_0x320b8e['taskId']+'\x20from\x20schedule\x20'+_0x3cede6};},async 'dryRun'(_0x1127e3){const _0x58687c=a57_0x24483f,_0x13f3e3=_0x1127e3[_0x58687c(0x7e)](_0x58687c(0x8e));return dryRun(_0x58687c(0x76),scheduleItemPath(_0x1127e3[_0x58687c(0x77)],_0x13f3e3)+'/run')[_0x58687c(0xac)](_0x58687c(0x99)+_0x13f3e3+'\x20immediately')[_0x58687c(0x8a)]();}},scheduleDelete={'service':a57_0x24483f(0xa6),'command':a57_0x24483f(0x6e),'description':a57_0x24483f(0x86),'risk':'high-risk-write','confirmationDescription':a57_0x24483f(0xab),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x72f4df){const _0x2b4ef5=a57_0x24483f,_0x2681c4=_0x72f4df['str']('schedule-id'),_0x38c06b=await deleteRuntimeSchedule(_0x72f4df[_0x2b4ef5(0x77)],_0x2681c4);return{'ok':!![],'data':_0x38c06b,'message':_0x2b4ef5(0xa1)+_0x2681c4};},async 'dryRun'(_0x52f60c){const _0x18951a=a57_0x24483f,_0x4798f7=_0x52f60c[_0x18951a(0x7e)](_0x18951a(0x8e));return dryRun(_0x18951a(0x80),scheduleItemPath(_0x52f60c['appCode'],_0x4798f7))[_0x18951a(0xac)]('Preview:\x20delete\x20schedule\x20'+_0x4798f7)[_0x18951a(0x8a)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];