@lovrabet/lovrabet-cli 2.2.4-beta.3 → 2.2.5-beta.1

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
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x2c6a32=a0_0x5bf2;function a0_0x5bf2(_0x51aad3,_0x205203){_0x51aad3=_0x51aad3-0x77;const _0x39896a=a0_0x3989();let _0x5bf252=_0x39896a[_0x51aad3];return _0x5bf252;}(function(_0x336801,_0x1bd244){const _0x345d31=a0_0x5bf2,_0x392a48=_0x336801();while(!![]){try{const _0x19d7e0=parseInt(_0x345d31(0x7a))/0x1+-parseInt(_0x345d31(0x7e))/0x2*(parseInt(_0x345d31(0x80))/0x3)+-parseInt(_0x345d31(0x77))/0x4*(-parseInt(_0x345d31(0x9d))/0x5)+parseInt(_0x345d31(0x97))/0x6*(parseInt(_0x345d31(0x79))/0x7)+parseInt(_0x345d31(0x7f))/0x8+parseInt(_0x345d31(0x7c))/0x9+-parseInt(_0x345d31(0x96))/0xa;if(_0x19d7e0===_0x1bd244)break;else _0x392a48['push'](_0x392a48['shift']());}catch(_0x40cbfb){_0x392a48['push'](_0x392a48['shift']());}}}(a0_0x3989,0x6ce81));import{jsx as a0_0x3957f0}from'react/jsx-runtime';import a0_0x1a17d8 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions,resolveRemovedCommand}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0x1a17d8(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x2c6a32(0x8a)](handleError);async function main(){try{await run();}catch(_0x37d7b5){handleError(_0x37d7b5);}}async function run(){const _0x47798a=a0_0x2c6a32;let _0x14446b=cli['input'][0x0],_0x479c70=cli[_0x47798a(0x86)][0x1];const _0x42e49e=cli[_0x47798a(0x93)];try{const {correctFlags:_0xd101a2}=await import(_0x47798a(0x8f)),_0x3aff01=getAllDefinitions()[_0x47798a(0x8e)](_0x195650=>_0x195650[_0x47798a(0x93)]??[]),{flags:_0x2c8001,corrections:_0x3ed66b}=_0xd101a2(_0x42e49e,_0x3aff01);if(_0x3ed66b[_0x47798a(0x7d)]>0x0){for(const _0x1f0953 of _0x3ed66b){process[_0x47798a(0x9a)][_0x47798a(0x99)](_0x47798a(0x98)+_0x1f0953[_0x47798a(0xa1)]+_0x47798a(0x84)+_0x1f0953[_0x47798a(0x92)]+'\x20->\x20--'+_0x1f0953[_0x47798a(0x82)]+'\x0a');}Object[_0x47798a(0x95)](_0x42e49e,_0x2c8001);}}catch{}if(!_0x14446b){const {waitUntilExit:_0x1179a1}=render(a0_0x3957f0(Help,{}));await _0x1179a1();return;}const _0x4c8f5e=resolveRemovedCommand(_0x14446b,_0x479c70);if(_0x4c8f5e)throw CliErrors[_0x47798a(0x9e)](_0x4c8f5e[_0x47798a(0x91)],_0x4c8f5e['hint']);if(!isKnownService(_0x14446b)){const _0x2e69c7=resolveDynamicServiceCommand(cli[_0x47798a(0x86)],_0x42e49e);if(_0x2e69c7){if(_0x42e49e[_0x47798a(0x94)]){console['log'](generateCommandHelp(_0x2e69c7[_0x47798a(0x8c)]));return;}Object[_0x47798a(0x95)](_0x42e49e,_0x2e69c7[_0x47798a(0x93)]);const _0xe7e316=buildConfigFromFlags(_0x42e49e);await initGlobalEnvironment(_0xe7e316);const _0x5e7538=createPipelineEnv(_0xe7e316,_0x42e49e);_0x5e7538['args']=_0x2e69c7[_0x47798a(0x8b)],await runCommand(_0x2e69c7[_0x47798a(0x8c)],_0x5e7538);return;}if(_0x42e49e[_0x47798a(0x94)]){const _0x5ce09f=generateDynamicServiceHelp(_0x14446b);if(_0x5ce09f){console['log'](_0x5ce09f);return;}}const {waitUntilExit:_0x52b505}=render(a0_0x3957f0(Help,{}));await _0x52b505();return;}const _0x27fdb2=getServiceEntry(_0x14446b);if(!_0x479c70){if(_0x42e49e[_0x47798a(0x94)]){console['log'](generateServiceHelp(_0x14446b));return;}if(_0x27fdb2['defaultCommand'])_0x479c70=_0x27fdb2[_0x47798a(0x9b)];else{console[_0x47798a(0x87)](generateServiceHelp(_0x14446b));return;}}const _0x36b4bf=findDefinition(_0x14446b,_0x479c70);!_0x36b4bf&&(console[_0x47798a(0x87)](generateServiceHelp(_0x14446b)),handleError(CliErrors[_0x47798a(0x89)](_0x14446b+'\x20'+_0x479c70)));if(_0x42e49e[_0x47798a(0x94)]){console[_0x47798a(0x87)](generateCommandHelp(_0x36b4bf));return;}const _0x488cd6=buildConfigFromFlags(_0x42e49e);await initGlobalEnvironment(_0x488cd6);const _0x44cbb9=createPipelineEnv(_0x488cd6,_0x42e49e);_0x44cbb9['args']=cli[_0x47798a(0x86)][_0x47798a(0x7b)](0x2),await runCommand(_0x36b4bf,_0x44cbb9);}function a0_0x3989(){const _0x5c8392=['632202LhZDaD','[preparse]\x20','write','stderr','defaultCommand','\x0aCancelled.\x0a','2455mmNGYP','validation','name','code','handler','4532tkyMou','hint','21vkpkUT','215061JTNiCS','slice','5763798vYhGbC','length','8AcUYdY','656928hIYqnD','18741nUTvsy','exitCode','corrected','ERR_USE_AFTER_CLOSE',':\x20--','exit','input','log','Error:\x20','unknownCommand','catch','args','definition','Hint:\x20','flatMap','./framework/preparse.js','error','message','original','flags','help','assign','13389340LlIzGM'];a0_0x3989=function(){return _0x5c8392;};return a0_0x3989();}function handleError(_0xd2730){const _0x4e85c9=a0_0x2c6a32;if(_0xd2730 instanceof CliError){_0xd2730[_0x4e85c9(0xa0)]==='cancelled'&&(process[_0x4e85c9(0x9a)][_0x4e85c9(0x99)]('\x0aCancelled.\x0a'),process['exit'](0x0));console['error'](_0x4e85c9(0x88)+_0xd2730['message']);if(_0xd2730[_0x4e85c9(0x78)])console[_0x4e85c9(0x90)](_0x4e85c9(0x8d)+_0xd2730['hint']);process[_0x4e85c9(0x85)](_0xd2730[_0x4e85c9(0x81)]);}isUserCancellation(_0xd2730)&&(process['stderr']['write'](_0x4e85c9(0x9c)),process['exit'](0x0)),console[_0x4e85c9(0x90)]('Unexpected\x20error:',_0xd2730),process[_0x4e85c9(0x85)](0x1);}function isUserCancellation(_0x58562c){const _0x3a9c60=a0_0x2c6a32;if(!(_0x58562c instanceof Error))return![];if(_0x58562c[_0x3a9c60(0x9f)]==='ExitPromptError')return!![];if(_0x58562c['code']===_0x3a9c60(0x83))return!![];if(_0x58562c[_0x3a9c60(0xa0)]==='ERR_STREAM_DESTROYED')return!![];return![];}
2
+ (function(_0x23970d,_0x77e1f5){const _0x26a879=a0_0xbbfc,_0x4cd998=_0x23970d();while(!![]){try{const _0x2e4d34=-parseInt(_0x26a879(0x79))/0x1*(parseInt(_0x26a879(0x75))/0x2)+parseInt(_0x26a879(0x87))/0x3+-parseInt(_0x26a879(0x6e))/0x4+parseInt(_0x26a879(0x85))/0x5*(-parseInt(_0x26a879(0x8d))/0x6)+-parseInt(_0x26a879(0x88))/0x7*(-parseInt(_0x26a879(0x8c))/0x8)+parseInt(_0x26a879(0x96))/0x9*(parseInt(_0x26a879(0x86))/0xa)+-parseInt(_0x26a879(0x91))/0xb*(parseInt(_0x26a879(0x7a))/0xc);if(_0x2e4d34===_0x77e1f5)break;else _0x4cd998['push'](_0x4cd998['shift']());}catch(_0x12e641){_0x4cd998['push'](_0x4cd998['shift']());}}}(a0_0xd547,0x19cf1));function a0_0xd547(){const _0x3c6a8a=['flatMap','defaultCommand','name','message','\x0aCancelled.\x0a','validation','original','input','Unexpected\x20error:','./framework/preparse.js','155AmMvWm','80YCQdRY','509409xKbkkC','322133njQvvP','hint','[preparse]\x20','handler','24eWmtqe','18114PEceuE','length','cancelled','args','22bhCRRA','exit','assign','error','flags','203877VGoTaA','log','227896hktLhP','\x20->\x20--','corrected','exitCode','help',':\x20--','code','68rVCjNI','write','ExitPromptError','definition','1429BJdNwA','1105332mUxxrG'];a0_0xd547=function(){return _0x3c6a8a;};return a0_0xd547();}import{jsx as a0_0x32aa41}from'react/jsx-runtime';import a0_0x4f3a77 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions,resolveRemovedCommand}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';function a0_0xbbfc(_0x26e098,_0x6cba15){_0x26e098=_0x26e098-0x6e;const _0xd5476=a0_0xd547();let _0xbbfc01=_0xd5476[_0x26e098];return _0xbbfc01;}import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0x4f3a77(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()['catch'](handleError);async function main(){try{await run();}catch(_0xe4ea40){handleError(_0xe4ea40);}}async function run(){const _0x5d6974=a0_0xbbfc;let _0x1cbf88=cli[_0x5d6974(0x82)][0x0],_0x13c051=cli['input'][0x1];const _0x46f0f7=cli['flags'];try{const {correctFlags:_0x491232}=await import(_0x5d6974(0x84)),_0x2766c8=getAllDefinitions()[_0x5d6974(0x7b)](_0x530b6f=>_0x530b6f['flags']??[]),{flags:_0x1f06dd,corrections:_0xf111db}=_0x491232(_0x46f0f7,_0x2766c8);if(_0xf111db[_0x5d6974(0x8e)]>0x0){for(const _0x5407ae of _0xf111db){process['stderr'][_0x5d6974(0x76)](_0x5d6974(0x8a)+_0x5407ae[_0x5d6974(0x8b)]+_0x5d6974(0x73)+_0x5407ae[_0x5d6974(0x81)]+_0x5d6974(0x6f)+_0x5407ae[_0x5d6974(0x70)]+'\x0a');}Object[_0x5d6974(0x93)](_0x46f0f7,_0x1f06dd);}}catch{}if(!_0x1cbf88){const {waitUntilExit:_0x2da12b}=render(a0_0x32aa41(Help,{}));await _0x2da12b();return;}const _0x2759df=resolveRemovedCommand(_0x1cbf88,_0x13c051);if(_0x2759df)throw CliErrors[_0x5d6974(0x80)](_0x2759df[_0x5d6974(0x7e)],_0x2759df[_0x5d6974(0x89)]);if(!isKnownService(_0x1cbf88)){const _0x397c67=resolveDynamicServiceCommand(cli[_0x5d6974(0x82)],_0x46f0f7);if(_0x397c67){if(_0x46f0f7[_0x5d6974(0x72)]){console[_0x5d6974(0x97)](generateCommandHelp(_0x397c67['definition']));return;}Object[_0x5d6974(0x93)](_0x46f0f7,_0x397c67[_0x5d6974(0x95)]);const _0x20f3c1=buildConfigFromFlags(_0x46f0f7);await initGlobalEnvironment(_0x20f3c1);const _0x1e0c1c=createPipelineEnv(_0x20f3c1,_0x46f0f7);_0x1e0c1c[_0x5d6974(0x90)]=_0x397c67['args'],await runCommand(_0x397c67[_0x5d6974(0x78)],_0x1e0c1c);return;}if(_0x46f0f7[_0x5d6974(0x72)]){const _0x3b8d74=generateDynamicServiceHelp(_0x1cbf88);if(_0x3b8d74){console[_0x5d6974(0x97)](_0x3b8d74);return;}}const {waitUntilExit:_0x5391ab}=render(a0_0x32aa41(Help,{}));await _0x5391ab();return;}const _0x2043b7=getServiceEntry(_0x1cbf88);if(!_0x13c051){if(_0x46f0f7[_0x5d6974(0x72)]){console[_0x5d6974(0x97)](generateServiceHelp(_0x1cbf88));return;}if(_0x2043b7['defaultCommand'])_0x13c051=_0x2043b7[_0x5d6974(0x7c)];else{console[_0x5d6974(0x97)](generateServiceHelp(_0x1cbf88));return;}}const _0x5d18c4=findDefinition(_0x1cbf88,_0x13c051);!_0x5d18c4&&(console[_0x5d6974(0x97)](generateServiceHelp(_0x1cbf88)),handleError(CliErrors['unknownCommand'](_0x1cbf88+'\x20'+_0x13c051)));if(_0x46f0f7['help']){console[_0x5d6974(0x97)](generateCommandHelp(_0x5d18c4));return;}const _0x1093d7=buildConfigFromFlags(_0x46f0f7);await initGlobalEnvironment(_0x1093d7);const _0x2b1681=createPipelineEnv(_0x1093d7,_0x46f0f7);_0x2b1681[_0x5d6974(0x90)]=cli[_0x5d6974(0x82)]['slice'](0x2),await runCommand(_0x5d18c4,_0x2b1681);}function handleError(_0x992056){const _0x274f6b=a0_0xbbfc;if(_0x992056 instanceof CliError){_0x992056[_0x274f6b(0x74)]===_0x274f6b(0x8f)&&(process['stderr'][_0x274f6b(0x76)](_0x274f6b(0x7f)),process[_0x274f6b(0x92)](0x0));console['error']('Error:\x20'+_0x992056[_0x274f6b(0x7e)]);if(_0x992056[_0x274f6b(0x89)])console[_0x274f6b(0x94)]('Hint:\x20'+_0x992056['hint']);process[_0x274f6b(0x92)](_0x992056[_0x274f6b(0x71)]);}isUserCancellation(_0x992056)&&(process['stderr'][_0x274f6b(0x76)](_0x274f6b(0x7f)),process['exit'](0x0)),console['error'](_0x274f6b(0x83),_0x992056),process[_0x274f6b(0x92)](0x1);}function isUserCancellation(_0x5b915a){const _0x19c931=a0_0xbbfc;if(!(_0x5b915a instanceof Error))return![];if(_0x5b915a[_0x19c931(0x7d)]===_0x19c931(0x77))return!![];if(_0x5b915a[_0x19c931(0x74)]==='ERR_USE_AFTER_CLOSE')return!![];if(_0x5b915a[_0x19c931(0x74)]==='ERR_STREAM_DESTROYED')return!![];return![];}
@@ -1 +1 @@
1
- const a1_0x4ff4b8=a1_0x3431;function a1_0x3431(_0x2d8479,_0x87a381){_0x2d8479=_0x2d8479-0x175;const _0x3aab08=a1_0x3aab();let _0x343164=_0x3aab08[_0x2d8479];return _0x343164;}(function(_0x32c709,_0x10e611){const _0xc48625=a1_0x3431,_0x5a055f=_0x32c709();while(!![]){try{const _0x14cbfa=parseInt(_0xc48625(0x191))/0x1+-parseInt(_0xc48625(0x1c6))/0x2+-parseInt(_0xc48625(0x1a4))/0x3+parseInt(_0xc48625(0x186))/0x4+-parseInt(_0xc48625(0x1b7))/0x5+-parseInt(_0xc48625(0x1c4))/0x6+parseInt(_0xc48625(0x1db))/0x7*(parseInt(_0xc48625(0x1ac))/0x8);if(_0x14cbfa===_0x10e611)break;else _0x5a055f['push'](_0x5a055f['shift']());}catch(_0x7ff219){_0x5a055f['push'](_0x5a055f['shift']());}}}(a1_0x3aab,0x60b73));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x4ff4b8(0x1b5),'type':a1_0x4ff4b8(0x19b),'description':a1_0x4ff4b8(0x1e1)},KEYWORD_FLAG={'name':a1_0x4ff4b8(0x1d3),'type':'string','description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':'code','type':a1_0x4ff4b8(0x19b),'required':!![],'description':'API\x20doc\x20code,\x20for\x20example\x20dataset_list'},DOCS=[{'code':a1_0x4ff4b8(0x181),'category':a1_0x4ff4b8(0x1b2),'title':'List\x20datasets','method':a1_0x4ff4b8(0x1c2),'path':a1_0x4ff4b8(0x1a2),'summary':a1_0x4ff4b8(0x1aa),'whenToUse':a1_0x4ff4b8(0x1ba),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','responseHighlights':[a1_0x4ff4b8(0x1df),a1_0x4ff4b8(0x1ec)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':['##\x20List\x20datasets','',a1_0x4ff4b8(0x1b4)][a1_0x4ff4b8(0x19a)]('\x0a')},{'code':a1_0x4ff4b8(0x1d1),'category':a1_0x4ff4b8(0x1b2),'title':a1_0x4ff4b8(0x1e3),'method':a1_0x4ff4b8(0x1d8),'path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x4ff4b8(0x1ab),'whenToUse':a1_0x4ff4b8(0x1d4),'pathParams':[],'queryParams':[{'name':a1_0x4ff4b8(0x1e8),'description':a1_0x4ff4b8(0x1d0)}],'bodySchema':a1_0x4ff4b8(0x1af),'responseHighlights':['fields/properties\x20describe\x20data\x20shape','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned',a1_0x4ff4b8(0x17b)],'examples':[a1_0x4ff4b8(0x1dc)],'notes':[a1_0x4ff4b8(0x183)],'markdown':[a1_0x4ff4b8(0x1ad),'',a1_0x4ff4b8(0x1b6)][a1_0x4ff4b8(0x19a)]('\x0a')},{'code':'dataset_data_filter','category':a1_0x4ff4b8(0x1b2),'title':a1_0x4ff4b8(0x176),'method':'POST','path':a1_0x4ff4b8(0x198),'summary':'条件过滤查询数据','whenToUse':'需要携带\x20where、orderBy、分页等条件读取业务数据时使用','pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x4ff4b8(0x194),'description':a1_0x4ff4b8(0x1d0)}],'queryParams':[],'bodySchema':a1_0x4ff4b8(0x1c3),'responseHighlights':[a1_0x4ff4b8(0x1a1),a1_0x4ff4b8(0x18b)],'examples':[a1_0x4ff4b8(0x1a0),a1_0x4ff4b8(0x1bf)],'notes':['where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.',a1_0x4ff4b8(0x1a3),'Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.'],'markdown':[a1_0x4ff4b8(0x199),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.'][a1_0x4ff4b8(0x19a)]('\x0a')},{'code':a1_0x4ff4b8(0x1cf),'category':a1_0x4ff4b8(0x1b2),'title':'Aggregate\x20dataset\x20data','method':'POST','path':a1_0x4ff4b8(0x188),'summary':a1_0x4ff4b8(0x19e),'whenToUse':a1_0x4ff4b8(0x1b9),'pathParams':[{'name':'appCode','description':a1_0x4ff4b8(0x17f)},{'name':a1_0x4ff4b8(0x194),'description':a1_0x4ff4b8(0x1d0)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x4ff4b8(0x1a7),a1_0x4ff4b8(0x1ea)],'examples':[a1_0x4ff4b8(0x1a9)],'notes':[a1_0x4ff4b8(0x19d),a1_0x4ff4b8(0x1dd)],'markdown':[a1_0x4ff4b8(0x17a),'','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x4ff4b8(0x19a)]('\x0a')},{'code':a1_0x4ff4b8(0x182),'category':a1_0x4ff4b8(0x1b2),'title':a1_0x4ff4b8(0x18a),'method':'POST','path':a1_0x4ff4b8(0x1b0),'summary':a1_0x4ff4b8(0x19f),'whenToUse':a1_0x4ff4b8(0x190),'pathParams':[{'name':a1_0x4ff4b8(0x1b8),'description':a1_0x4ff4b8(0x17f)},{'name':'datasetCode','description':a1_0x4ff4b8(0x1d0)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x4ff4b8(0x177)],'examples':[a1_0x4ff4b8(0x175)],'notes':[a1_0x4ff4b8(0x1a5)],'markdown':a1_0x4ff4b8(0x1c5)},{'code':a1_0x4ff4b8(0x1e7),'category':'dataset','title':a1_0x4ff4b8(0x1cb),'method':a1_0x4ff4b8(0x1c2),'path':a1_0x4ff4b8(0x1c9),'summary':a1_0x4ff4b8(0x195),'whenToUse':a1_0x4ff4b8(0x1e0),'pathParams':[{'name':'appCode','description':a1_0x4ff4b8(0x17f)},{'name':a1_0x4ff4b8(0x194),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x4ff4b8(0x189),'responseHighlights':[a1_0x4ff4b8(0x1e6)],'examples':[a1_0x4ff4b8(0x18c)],'notes':[a1_0x4ff4b8(0x1b1)],'markdown':a1_0x4ff4b8(0x185)},{'code':a1_0x4ff4b8(0x1d7),'category':'bf','title':a1_0x4ff4b8(0x1e4),'method':a1_0x4ff4b8(0x1d8),'path':a1_0x4ff4b8(0x1a8),'summary':a1_0x4ff4b8(0x1e9),'whenToUse':'已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','pathParams':[{'name':'appCode','description':a1_0x4ff4b8(0x17f)},{'name':a1_0x4ff4b8(0x179),'description':'Exact\x20endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x4ff4b8(0x1af),'responseHighlights':[a1_0x4ff4b8(0x196)],'examples':['lovrabet\x20bff\x20detail\x20--name\x20<functionName>'],'notes':[a1_0x4ff4b8(0x1bc)],'markdown':'##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.'},{'code':a1_0x4ff4b8(0x1c0),'category':'bf','title':a1_0x4ff4b8(0x1ae),'method':'POST','path':a1_0x4ff4b8(0x1da),'summary':a1_0x4ff4b8(0x1cc),'whenToUse':a1_0x4ff4b8(0x1ca),'pathParams':[{'name':'appCode','description':a1_0x4ff4b8(0x17f)},{'name':'functionName','description':a1_0x4ff4b8(0x1de)}],'queryParams':[],'bodySchema':a1_0x4ff4b8(0x184),'responseHighlights':[a1_0x4ff4b8(0x1d9)],'examples':[a1_0x4ff4b8(0x1c8)],'notes':[a1_0x4ff4b8(0x1c7)],'markdown':a1_0x4ff4b8(0x180)},{'code':a1_0x4ff4b8(0x18f),'category':'custom_sql','title':a1_0x4ff4b8(0x1a6),'method':'POST','path':a1_0x4ff4b8(0x1e5),'summary':a1_0x4ff4b8(0x178),'whenToUse':a1_0x4ff4b8(0x17d),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x4ff4b8(0x1d2)],'examples':[a1_0x4ff4b8(0x1bb)],'notes':[a1_0x4ff4b8(0x17c)],'markdown':'##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.'}];function entrySummary(_0x10fbe1){const _0x1154a0=a1_0x4ff4b8;return{'code':_0x10fbe1[_0x1154a0(0x1e8)],'category':_0x10fbe1['category'],'method':_0x10fbe1[_0x1154a0(0x1c1)],'path':_0x10fbe1[_0x1154a0(0x18d)],'summary':_0x10fbe1[_0x1154a0(0x1b3)],'whenToUse':_0x10fbe1[_0x1154a0(0x1e2)]};}function a1_0x3aab(){const _0x4d83e5=['查询单条数据','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','tableData\x20contains\x20records','/api/dataset/get-dataset-list-by-app-code','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','1941564tYULEj','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','Execute\x20custom\x20SQL','result\x20rows\x20contain\x20aggregate\x20aliases','/client/bff/endpoint/{appCode}/{functionName}','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','分页获取数据集列表','获取数据集详情','225016aMEHES','##\x20Dataset\x20detail','Execute\x20BF\x20endpoint\x20function','None','/api/{appCode}/{datasetCode}/getOne','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','dataset','summary','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','category','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','2281015IbLuSH','appCode','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','api-doc','find','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','bf_execute','method','POST','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','263898ifflTJ','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','909136JjtDoI','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','/api/{appCode}/{datasetCode}/create','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','Create\x20dataset\x20record','执行指定\x20BF\x20函数','trim','API\x20doc\x20code\x20not\x20found:\x20','dataset_data_aggregate','32-character\x20dataset\x20code','dataset_detail','Returns\x20SQL\x20execution\x20payload','keyword','需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','length','Show\x20runtime\x20API\x20documentation\x20by\x20code','bf_detail','GET','Returns\x20script\x20business\x20payload','/api/endpoint/{appCode}/{functionName}','182DMKiqX','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','Endpoint\x20function\x20name','tableData\x20contains\x20dataset\x20id/code/name','需要向指定数据集新增一条业务数据时使用','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','whenToUse','Dataset\x20detail','Get\x20BF\x20endpoint\x20function\x20contract','/api/custom/executeSql','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','dataset_data_create','code','按应用和函数名精确获取\x20BF\x20运行契约','where\x20filters\x20before\x20aggregation','map','paging.totalCount\x20gives\x20total\x20rows','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','Filter\x20dataset\x20data','Returns\x20one\x20matching\x20business\x20record','执行自定义\x20SQL','functionName','##\x20Aggregate\x20dataset\x20data','operations\x20describes\x20runtime\x20APIs','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','str','Current\x20app\x20code','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','dataset_list','dataset_data_get_one','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','{\x22param\x22:\x22value\x22}','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','2493488xqpEtV','list','/api/{appCode}/{datasetCode}/aggregate','{\x22fieldName\x22:\x22value\x22}','Get\x20one\x20dataset\x20record','paging\x20contains\x20pagination','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','path','List\x20available\x20runtime\x20API\x20documentation\x20entries','custom_sql_execute','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','643415Jvsjws','title','validation','datasetCode','创建数据','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','read','/api/{appCode}/{datasetCode}/filter','##\x20Filter\x20dataset\x20data','join','string','includes','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','聚合查询数据集数据'];a1_0x3aab=function(){return _0x4d83e5;};return a1_0x3aab();}export function listApiDocEntries(_0x355e9d={}){const _0x214ff4=a1_0x4ff4b8,_0x2bd408=String(_0x355e9d[_0x214ff4(0x1b5)]||'')[_0x214ff4(0x1cd)](),_0x5c7497=String(_0x355e9d['keyword']||'')[_0x214ff4(0x1cd)]()['toLowerCase']();return DOCS['filter'](_0x290891=>{const _0x21bef2=_0x214ff4;if(_0x2bd408&&_0x290891['category']!==_0x2bd408)return![];if(!_0x5c7497)return!![];return[_0x290891[_0x21bef2(0x1e8)],_0x290891['category'],_0x290891[_0x21bef2(0x1c1)],_0x290891[_0x21bef2(0x18d)],_0x290891['summary'],_0x290891[_0x21bef2(0x1e2)],_0x290891[_0x21bef2(0x192)]][_0x21bef2(0x19a)]('\x20')['toLowerCase']()[_0x21bef2(0x19c)](_0x5c7497);})[_0x214ff4(0x1eb)](entrySummary);}export function getApiDocDetail(_0x281d38){const _0x21b67f=a1_0x4ff4b8,_0x44752a=DOCS[_0x21b67f(0x1be)](_0x5103dc=>_0x5103dc[_0x21b67f(0x1e8)]===_0x281d38);if(!_0x44752a)throw CliErrors[_0x21b67f(0x193)](_0x21b67f(0x1ce)+_0x281d38);return{..._0x44752a};}const apiDocList={'service':'api-doc','command':a1_0x4ff4b8(0x187),'description':a1_0x4ff4b8(0x18e),'risk':a1_0x4ff4b8(0x197),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x4e5c7a){const _0x3f0583=a1_0x4ff4b8,_0x25f773=listApiDocEntries({'category':_0x4e5c7a['str'](_0x3f0583(0x1b5)),'keyword':_0x4e5c7a['str']('keyword')});return{'ok':!![],'data':{'total':_0x25f773[_0x3f0583(0x1d5)],'items':_0x25f773}};}},apiDocDetail={'service':a1_0x4ff4b8(0x1bd),'command':'detail','description':a1_0x4ff4b8(0x1d6),'risk':a1_0x4ff4b8(0x197),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x5b0f49){const _0x43bf55=a1_0x4ff4b8;return{'ok':!![],'data':getApiDocDetail(_0x5b0f49[_0x43bf55(0x17e)](_0x43bf55(0x1e8)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
1
+ function a1_0x3f62(_0x3cffc9,_0x7d5f04){_0x3cffc9=_0x3cffc9-0x18e;const _0x161698=a1_0x1616();let _0x3f629c=_0x161698[_0x3cffc9];return _0x3f629c;}function a1_0x1616(){const _0x24f828=['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','category','/api/custom/executeSql','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','/api/dataset/get-dataset-list-by-app-code','bf_execute','已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','toLowerCase','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','27oacBvK','{\x22id\x22:123}','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','/api/endpoint/{appCode}/{functionName}','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','1480052iyBzbx','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','map','tableData\x20contains\x20dataset\x20id/code/name','API\x20doc\x20code,\x20for\x20example\x20dataset_list','/api/{appCode}/{datasetCode}/getOne','147OQRIDY','API\x20doc\x20code\x20not\x20found:\x20','join','fields/properties\x20describe\x20data\x20shape','按应用和函数名精确获取\x20BF\x20运行契约','code','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','Execute\x20BF\x20endpoint\x20function','keyword','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','Get\x20one\x20dataset\x20record','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','functionName','read','执行指定\x20BF\x20函数','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','filter','查询单条数据','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','Filter\x20dataset\x20data','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','483546NdByqc','dataset_detail','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','/api/{appCode}/{datasetCode}/aggregate','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','tableData\x20contains\x20records','dataset_list','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','需要向指定数据集新增一条业务数据时使用','summary','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','88314SAJSOu','List\x20datasets','operations\x20describes\x20runtime\x20APIs','dataset_data_get_one','title','Show\x20runtime\x20API\x20documentation\x20by\x20code','result\x20rows\x20contain\x20aggregate\x20aliases','dataset_data_filter','2102945lalqMC','where\x20filters\x20before\x20aggregation','string','path','获取数据集详情','Endpoint\x20function\x20name','trim','##\x20List\x20datasets','whenToUse','##\x20Filter\x20dataset\x20data','detail','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','datasetCode','195376LhTSih','执行自定义\x20SQL','validation','Returns\x20SQL\x20execution\x20payload','dataset','条件过滤查询数据','2688650hlsuwT','api-doc','Returns\x20script\x20business\x20payload','7acnCmc','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','1323585PJqUPs','创建数据','find','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','list','Get\x20BF\x20endpoint\x20function\x20contract','paging\x20contains\x20pagination','custom_sql_execute','GET','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','Current\x20app\x20code','聚合查询数据集数据','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','method','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','dataset_data_create','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','str','Returns\x20one\x20matching\x20business\x20record','paging.totalCount\x20gives\x20total\x20rows','None','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','32-character\x20dataset\x20code','Exact\x20endpoint\x20function\x20name','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','appCode','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','POST'];a1_0x1616=function(){return _0x24f828;};return a1_0x1616();}const a1_0x5cce2d=a1_0x3f62;(function(_0x49e8b4,_0x7c45a1){const _0x2e022c=a1_0x3f62,_0x323397=_0x49e8b4();while(!![]){try{const _0x4f8be3=-parseInt(_0x2e022c(0x1a4))/0x1*(-parseInt(_0x2e022c(0x1fb))/0x2)+-parseInt(_0x2e022c(0x1a6))/0x3+parseInt(_0x2e022c(0x1d4))/0x4+parseInt(_0x2e022c(0x203))/0x5+-parseInt(_0x2e022c(0x1ef))/0x6+-parseInt(_0x2e022c(0x1da))/0x7*(-parseInt(_0x2e022c(0x19b))/0x8)+parseInt(_0x2e022c(0x1cf))/0x9*(-parseInt(_0x2e022c(0x1a1))/0xa);if(_0x4f8be3===_0x7c45a1)break;else _0x323397['push'](_0x323397['shift']());}catch(_0x18e82b){_0x323397['push'](_0x323397['shift']());}}}(a1_0x1616,0x45616));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x5cce2d(0x1c7),'type':a1_0x5cce2d(0x18e),'description':a1_0x5cce2d(0x1b6)},KEYWORD_FLAG={'name':'keyword','type':a1_0x5cce2d(0x18e),'description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':'code','type':a1_0x5cce2d(0x18e),'required':!![],'description':a1_0x5cce2d(0x1d8)},DOCS=[{'code':a1_0x5cce2d(0x1f5),'category':a1_0x5cce2d(0x19f),'title':a1_0x5cce2d(0x1fc),'method':'POST','path':a1_0x5cce2d(0x1ca),'summary':'分页获取数据集列表','whenToUse':'需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','pathParams':[],'queryParams':[],'bodySchema':a1_0x5cce2d(0x1b7),'responseHighlights':[a1_0x5cce2d(0x1d7),a1_0x5cce2d(0x1ba)],'examples':[a1_0x5cce2d(0x1c4)],'notes':[a1_0x5cce2d(0x1b2)],'markdown':[a1_0x5cce2d(0x193),'',a1_0x5cce2d(0x199)]['join']('\x0a')},{'code':a1_0x5cce2d(0x1f0),'category':a1_0x5cce2d(0x19f),'title':'Dataset\x20detail','method':'GET','path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x5cce2d(0x190),'whenToUse':'需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','pathParams':[],'queryParams':[{'name':a1_0x5cce2d(0x1df),'description':a1_0x5cce2d(0x1c0)}],'bodySchema':a1_0x5cce2d(0x1bb),'responseHighlights':[a1_0x5cce2d(0x1dd),'relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned',a1_0x5cce2d(0x1fd)],'examples':[a1_0x5cce2d(0x1ce)],'notes':[a1_0x5cce2d(0x1b4)],'markdown':['##\x20Dataset\x20detail','',a1_0x5cce2d(0x1fa)][a1_0x5cce2d(0x1dc)]('\x0a')},{'code':a1_0x5cce2d(0x202),'category':a1_0x5cce2d(0x19f),'title':a1_0x5cce2d(0x1ed),'method':a1_0x5cce2d(0x1c5),'path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x5cce2d(0x1a0),'whenToUse':a1_0x5cce2d(0x1c2),'pathParams':[{'name':'appCode','description':a1_0x5cce2d(0x1b0)},{'name':a1_0x5cce2d(0x19a),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x5cce2d(0x1af),'responseHighlights':[a1_0x5cce2d(0x1f4),a1_0x5cce2d(0x1ac)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27',a1_0x5cce2d(0x1e9)],'notes':[a1_0x5cce2d(0x1ee),a1_0x5cce2d(0x1a5),a1_0x5cce2d(0x1bc),'Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.'],'markdown':[a1_0x5cce2d(0x195),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.'][a1_0x5cce2d(0x1dc)]('\x0a')},{'code':'dataset_data_aggregate','category':a1_0x5cce2d(0x19f),'title':'Aggregate\x20dataset\x20data','method':'POST','path':a1_0x5cce2d(0x1f2),'summary':a1_0x5cce2d(0x1b1),'whenToUse':a1_0x5cce2d(0x1a9),'pathParams':[{'name':'appCode','description':a1_0x5cce2d(0x1b0)},{'name':a1_0x5cce2d(0x19a),'description':a1_0x5cce2d(0x1c0)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x5cce2d(0x201),a1_0x5cce2d(0x204)],'examples':['lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27'],'notes':[a1_0x5cce2d(0x1e0),a1_0x5cce2d(0x1ec)],'markdown':['##\x20Aggregate\x20dataset\x20data','',a1_0x5cce2d(0x1f3)][a1_0x5cce2d(0x1dc)]('\x0a')},{'code':a1_0x5cce2d(0x1fe),'category':'dataset','title':a1_0x5cce2d(0x1e4),'method':a1_0x5cce2d(0x1c5),'path':a1_0x5cce2d(0x1d9),'summary':a1_0x5cce2d(0x1eb),'whenToUse':a1_0x5cce2d(0x1f6),'pathParams':[{'name':a1_0x5cce2d(0x1c3),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':a1_0x5cce2d(0x1c0)}],'queryParams':[],'bodySchema':a1_0x5cce2d(0x1d0),'responseHighlights':[a1_0x5cce2d(0x1b9)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':['Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.'],'markdown':a1_0x5cce2d(0x1f9)},{'code':a1_0x5cce2d(0x1b5),'category':a1_0x5cce2d(0x19f),'title':'Create\x20dataset\x20record','method':a1_0x5cce2d(0x1c5),'path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x5cce2d(0x1a7),'whenToUse':a1_0x5cce2d(0x1f7),'pathParams':[{'name':a1_0x5cce2d(0x1c3),'description':'Current\x20app\x20code'},{'name':a1_0x5cce2d(0x19a),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22fieldName\x22:\x22value\x22}','responseHighlights':[a1_0x5cce2d(0x1d3)],'examples':[a1_0x5cce2d(0x1bf)],'notes':[a1_0x5cce2d(0x198)],'markdown':a1_0x5cce2d(0x1bd)},{'code':'bf_detail','category':'bf','title':a1_0x5cce2d(0x1ab),'method':a1_0x5cce2d(0x1ae),'path':'/client/bff/endpoint/{appCode}/{functionName}','summary':a1_0x5cce2d(0x1de),'whenToUse':a1_0x5cce2d(0x1cc),'pathParams':[{'name':a1_0x5cce2d(0x1c3),'description':a1_0x5cce2d(0x1b0)},{'name':a1_0x5cce2d(0x1e6),'description':a1_0x5cce2d(0x1c1)}],'queryParams':[],'bodySchema':a1_0x5cce2d(0x1bb),'responseHighlights':[a1_0x5cce2d(0x1d5)],'examples':[a1_0x5cce2d(0x1f1)],'notes':[a1_0x5cce2d(0x1e3)],'markdown':'##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.'},{'code':a1_0x5cce2d(0x1cb),'category':'bf','title':a1_0x5cce2d(0x1e1),'method':a1_0x5cce2d(0x1c5),'path':a1_0x5cce2d(0x1d2),'summary':a1_0x5cce2d(0x1e8),'whenToUse':a1_0x5cce2d(0x1be),'pathParams':[{'name':'appCode','description':a1_0x5cce2d(0x1b0)},{'name':a1_0x5cce2d(0x1e6),'description':a1_0x5cce2d(0x191)}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x5cce2d(0x1a3)],'examples':[a1_0x5cce2d(0x1c6)],'notes':['Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.'],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x5cce2d(0x1ad),'category':'custom_sql','title':'Execute\x20custom\x20SQL','method':a1_0x5cce2d(0x1c5),'path':a1_0x5cce2d(0x1c8),'summary':a1_0x5cce2d(0x19c),'whenToUse':a1_0x5cce2d(0x1c9),'pathParams':[],'queryParams':[],'bodySchema':a1_0x5cce2d(0x1d1),'responseHighlights':[a1_0x5cce2d(0x19e)],'examples':[a1_0x5cce2d(0x197)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x5cce2d(0x1e5)}];function entrySummary(_0x4ffb9b){const _0x3ddc80=a1_0x5cce2d;return{'code':_0x4ffb9b[_0x3ddc80(0x1df)],'category':_0x4ffb9b[_0x3ddc80(0x1c7)],'method':_0x4ffb9b[_0x3ddc80(0x1b3)],'path':_0x4ffb9b[_0x3ddc80(0x18f)],'summary':_0x4ffb9b[_0x3ddc80(0x1f8)],'whenToUse':_0x4ffb9b[_0x3ddc80(0x194)]};}export function listApiDocEntries(_0x5c0929={}){const _0x4e635f=a1_0x5cce2d,_0x12149b=String(_0x5c0929['category']||'')[_0x4e635f(0x192)](),_0x384a88=String(_0x5c0929['keyword']||'')[_0x4e635f(0x192)]()[_0x4e635f(0x1cd)]();return DOCS[_0x4e635f(0x1ea)](_0x297c0b=>{const _0x572d04=_0x4e635f;if(_0x12149b&&_0x297c0b['category']!==_0x12149b)return![];if(!_0x384a88)return!![];return[_0x297c0b[_0x572d04(0x1df)],_0x297c0b[_0x572d04(0x1c7)],_0x297c0b[_0x572d04(0x1b3)],_0x297c0b['path'],_0x297c0b[_0x572d04(0x1f8)],_0x297c0b[_0x572d04(0x194)],_0x297c0b[_0x572d04(0x1ff)]][_0x572d04(0x1dc)]('\x20')['toLowerCase']()['includes'](_0x384a88);})[_0x4e635f(0x1d6)](entrySummary);}export function getApiDocDetail(_0x2b7993){const _0xf96020=a1_0x5cce2d,_0x13a314=DOCS[_0xf96020(0x1a8)](_0x24853e=>_0x24853e['code']===_0x2b7993);if(!_0x13a314)throw CliErrors[_0xf96020(0x19d)](_0xf96020(0x1db)+_0x2b7993);return{..._0x13a314};}const apiDocList={'service':a1_0x5cce2d(0x1a2),'command':a1_0x5cce2d(0x1aa),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':a1_0x5cce2d(0x1e7),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x39cc0b){const _0x3e2aaa=a1_0x5cce2d,_0x5deabe=listApiDocEntries({'category':_0x39cc0b[_0x3e2aaa(0x1b8)](_0x3e2aaa(0x1c7)),'keyword':_0x39cc0b[_0x3e2aaa(0x1b8)](_0x3e2aaa(0x1e2))});return{'ok':!![],'data':{'total':_0x5deabe['length'],'items':_0x5deabe}};}},apiDocDetail={'service':a1_0x5cce2d(0x1a2),'command':a1_0x5cce2d(0x196),'description':a1_0x5cce2d(0x200),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x3418e6){const _0x4e5a5e=a1_0x5cce2d;return{'ok':!![],'data':getApiDocDetail(_0x3418e6['str'](_0x4e5a5e(0x1df)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
@@ -1 +1 @@
1
- (function(_0x1c070e,_0x4c673e){const _0x375736=a2_0x28c1,_0x21a03c=_0x1c070e();while(!![]){try{const _0x5a565c=-parseInt(_0x375736(0x136))/0x1+-parseInt(_0x375736(0x12c))/0x2*(parseInt(_0x375736(0x128))/0x3)+parseInt(_0x375736(0x123))/0x4*(-parseInt(_0x375736(0x12d))/0x5)+parseInt(_0x375736(0x13d))/0x6+-parseInt(_0x375736(0x125))/0x7+-parseInt(_0x375736(0x129))/0x8+parseInt(_0x375736(0x131))/0x9*(parseInt(_0x375736(0x137))/0xa);if(_0x5a565c===_0x4c673e)break;else _0x21a03c['push'](_0x21a03c['shift']());}catch(_0x222c7a){_0x21a03c['push'](_0x21a03c['shift']());}}}(a2_0x5af2,0xb6bbf));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a2_0x28c1(_0x2b34b5,_0x4dd3cc){_0x2b34b5=_0x2b34b5-0x122;const _0x5af29e=a2_0x5af2();let _0x28c1b6=_0x5af29e[_0x2b34b5];return _0x28c1b6;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x50c3cf){const _0x3a0ee4=a2_0x28c1,_0xdc6ce=_0x50c3cf['trim'](),_0x3f01bb=_0xdc6ce['slice'](-0x6)||_0x3a0ee4(0x13e),_0x4dd4ab=createHash(_0x3a0ee4(0x132))[_0x3a0ee4(0x12a)](_0xdc6ce)['digest'](_0x3a0ee4(0x135))['slice'](0x0,0xc);return'ak_'+_0x3f01bb+'_'+_0x4dd4ab;}export function getAppCacheFilePath(_0x190dba,_0x3eec78){const _0xf90c47=a2_0x28c1;return resolve(homedir(),PRODUCT_CONFIG[_0xf90c47(0x124)],'cache',_0x190dba,fingerprintAccessKey(_0x3eec78),_0xf90c47(0x13c));}function a2_0x5af2(){const _0x24e0c6=['isArray','appCode','code','stringify','my-apps.json','5493774kiSMNV','unknown','EPERM','appName','6452KjJszw','homeDirName','803747xcQJnJ','utf8','find','1321881jRJYoT','5284048HPjxmn','update','EXDEV','6DnidaM','1240DkTzWp','.tmp','trim','parse','18orNJIq','sha256','items','EACCES','hex','1345714lWgcGI','18378980XAJZta'];a2_0x5af2=function(){return _0x24e0c6;};return a2_0x5af2();}export function readCachedAppList(_0x202947,_0xf1cd1){const _0x511581=a2_0x28c1;if(!_0xf1cd1?.['trim']())return null;const _0x58dd9b=getAppCacheFilePath(_0x202947,_0xf1cd1);if(!existsSync(_0x58dd9b))return null;try{const _0x509759=readFileSync(_0x58dd9b,'utf8');if(!_0x509759[_0x511581(0x12f)]())return null;const _0x4dcbc2=JSON[_0x511581(0x130)](_0x509759);if(!Array[_0x511581(0x138)](_0x4dcbc2[_0x511581(0x133)]))return null;return _0x4dcbc2;}catch{return null;}}export function writeCachedAppList(_0x49a688,_0x209832,_0x5b444f){const _0x10f627=a2_0x28c1,_0x531b65=getAppCacheFilePath(_0x49a688,_0x209832),_0xce313d=dirname(_0x531b65);!existsSync(_0xce313d)&&mkdirSync(_0xce313d,{'recursive':!![]});const _0x311954=_0x531b65+_0x10f627(0x12e);try{writeFileSync(_0x311954,JSON[_0x10f627(0x13b)](_0x5b444f,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x311954,_0x531b65);}catch(_0x5ec921){if(_0x5ec921[_0x10f627(0x13a)]===_0x10f627(0x13f)||_0x5ec921[_0x10f627(0x13a)]===_0x10f627(0x12b)||_0x5ec921[_0x10f627(0x13a)]===_0x10f627(0x134)){writeFileSync(_0x531b65,JSON['stringify'](_0x5b444f,null,0x2)+'\x0a',{'encoding':_0x10f627(0x126)});try{unlinkSync(_0x311954);}catch{}}else throw _0x5ec921;}}catch(_0x42b53e){try{unlinkSync(_0x311954);}catch{}throw _0x42b53e;}return _0x531b65;}export function resolveCachedAppCode(_0x1a0b7e,_0x1e4154,_0x116859){const _0x2e4221=a2_0x28c1;if(!_0x1a0b7e)return undefined;const _0x35e0bf=readCachedAppList(_0x1e4154,_0x116859),_0xcf58ff=_0x35e0bf?.[_0x2e4221(0x133)][_0x2e4221(0x127)](_0x3f317d=>_0x3f317d[_0x2e4221(0x122)]===_0x1a0b7e&&isRuntimeAccessibleApp(_0x3f317d));return _0xcf58ff?.[_0x2e4221(0x139)]?.[_0x2e4221(0x12f)]()||undefined;}
1
+ (function(_0x17f0a0,_0x3f579e){const _0x4ffca9=a2_0x5f48,_0x5b9396=_0x17f0a0();while(!![]){try{const _0x2b0395=parseInt(_0x4ffca9(0x15b))/0x1*(parseInt(_0x4ffca9(0x145))/0x2)+-parseInt(_0x4ffca9(0x157))/0x3*(-parseInt(_0x4ffca9(0x14e))/0x4)+parseInt(_0x4ffca9(0x14c))/0x5+parseInt(_0x4ffca9(0x14b))/0x6+parseInt(_0x4ffca9(0x154))/0x7+parseInt(_0x4ffca9(0x152))/0x8+parseInt(_0x4ffca9(0x14d))/0x9*(-parseInt(_0x4ffca9(0x14a))/0xa);if(_0x2b0395===_0x3f579e)break;else _0x5b9396['push'](_0x5b9396['shift']());}catch(_0x440267){_0x5b9396['push'](_0x5b9396['shift']());}}}(a2_0xc06c,0xccb98));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x44b63d){const _0x4a3ab4=a2_0x5f48,_0x29a5fc=_0x44b63d[_0x4a3ab4(0x15e)](),_0x3e3939=_0x29a5fc[_0x4a3ab4(0x15d)](-0x6)||_0x4a3ab4(0x15c),_0x11beb8=createHash('sha256')[_0x4a3ab4(0x158)](_0x29a5fc)[_0x4a3ab4(0x15a)](_0x4a3ab4(0x146))[_0x4a3ab4(0x15d)](0x0,0xc);return _0x4a3ab4(0x155)+_0x3e3939+'_'+_0x11beb8;}export function getAppCacheFilePath(_0x46cca7,_0x3fc918){const _0x1c99d2=a2_0x5f48;return resolve(homedir(),PRODUCT_CONFIG[_0x1c99d2(0x163)],_0x1c99d2(0x153),_0x46cca7,fingerprintAccessKey(_0x3fc918),_0x1c99d2(0x14f));}export function readCachedAppList(_0x49663d,_0xcd5bd){const _0x49657f=a2_0x5f48;if(!_0xcd5bd?.['trim']())return null;const _0x3a2328=getAppCacheFilePath(_0x49663d,_0xcd5bd);if(!existsSync(_0x3a2328))return null;try{const _0xe702d=readFileSync(_0x3a2328,_0x49657f(0x151));if(!_0xe702d[_0x49657f(0x15e)]())return null;const _0x2e7e9e=JSON['parse'](_0xe702d);if(!Array[_0x49657f(0x149)](_0x2e7e9e[_0x49657f(0x156)]))return null;return _0x2e7e9e;}catch{return null;}}function a2_0x5f48(_0x5c652,_0xb9b3ab){_0x5c652=_0x5c652-0x145;const _0xc06c22=a2_0xc06c();let _0x5f4813=_0xc06c22[_0x5c652];return _0x5f4813;}export function writeCachedAppList(_0x309f42,_0x22105e,_0x15796e){const _0x6344c6=a2_0x5f48,_0x26c85c=getAppCacheFilePath(_0x309f42,_0x22105e),_0x454420=dirname(_0x26c85c);!existsSync(_0x454420)&&mkdirSync(_0x454420,{'recursive':!![]});const _0x378433=_0x26c85c+'.tmp';try{writeFileSync(_0x378433,JSON[_0x6344c6(0x161)](_0x15796e,null,0x2)+'\x0a',{'encoding':_0x6344c6(0x151),'mode':0x180});try{renameSync(_0x378433,_0x26c85c);}catch(_0x3212f1){if(_0x3212f1[_0x6344c6(0x162)]===_0x6344c6(0x15f)||_0x3212f1['code']===_0x6344c6(0x159)||_0x3212f1[_0x6344c6(0x162)]===_0x6344c6(0x148)){writeFileSync(_0x26c85c,JSON[_0x6344c6(0x161)](_0x15796e,null,0x2)+'\x0a',{'encoding':_0x6344c6(0x151)});try{unlinkSync(_0x378433);}catch{}}else throw _0x3212f1;}}catch(_0x209410){try{unlinkSync(_0x378433);}catch{}throw _0x209410;}return _0x26c85c;}export function resolveCachedAppCode(_0x5b5dc2,_0x8bf4f5,_0x195890){const _0x36b4be=a2_0x5f48;if(!_0x5b5dc2)return undefined;const _0x2efd32=readCachedAppList(_0x8bf4f5,_0x195890),_0xe58ae6=_0x2efd32?.[_0x36b4be(0x156)][_0x36b4be(0x150)](_0x2adffb=>_0x2adffb[_0x36b4be(0x160)]===_0x5b5dc2&&isRuntimeAccessibleApp(_0x2adffb));return _0xe58ae6?.[_0x36b4be(0x147)]?.[_0x36b4be(0x15e)]()||undefined;}function a2_0xc06c(){const _0xe13bcc=['update','EXDEV','digest','8ffVPDd','unknown','slice','trim','EPERM','appName','stringify','code','homeDirName','369496iPulgy','hex','appCode','EACCES','isArray','42506570pvVZxk','6175908avHQSe','1930095ZMNbIN','9pJnvdy','4iQLZav','my-apps.json','find','utf8','6862056WvhmHU','cache','5725923wpXSZx','ak_','items','1560426Cvjwns'];a2_0xc06c=function(){return _0xe13bcc;};return a2_0xc06c();}
@@ -1 +1 @@
1
- const a3_0x461bef=a3_0x5248;(function(_0x53787c,_0x5c2753){const _0x3d8960=a3_0x5248,_0x1cbe1a=_0x53787c();while(!![]){try{const _0x53572f=parseInt(_0x3d8960(0x1da))/0x1*(-parseInt(_0x3d8960(0x1a2))/0x2)+-parseInt(_0x3d8960(0x1b7))/0x3+parseInt(_0x3d8960(0x1a7))/0x4+parseInt(_0x3d8960(0x1d8))/0x5*(-parseInt(_0x3d8960(0x1b1))/0x6)+parseInt(_0x3d8960(0x1bb))/0x7+-parseInt(_0x3d8960(0x1d9))/0x8+-parseInt(_0x3d8960(0x1a8))/0x9*(-parseInt(_0x3d8960(0x1cc))/0xa);if(_0x53572f===_0x5c2753)break;else _0x1cbe1a['push'](_0x1cbe1a['shift']());}catch(_0x4429af){_0x1cbe1a['push'](_0x1cbe1a['shift']());}}}(a3_0x2c5c,0xdccab));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';function a3_0x2c5c(){const _0x19fc4c=['Read\x20from\x20local\x20cache\x20only','langs','3763277PrLGnw','appOwnerName','include-unpublished','globalPath','Loaded\x20','\x20app(s)\x20for\x20env=\x22','production','string','fetchedAt','filter','将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','import','local','source','config','cache','map','238130LiKpLA','../../commands/app/remote-source.js','appCode','cachePath','appcode','remote','app','nonInteractive','appPublishStatus','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','items','从\x20.rabetbase.json\x20文件导入默认应用选择','3280iXZJnf','11602288wLMVGw','1nRrkSu','env','trim','length','i18nInfo','从平台刷新本地应用缓存','str','read','envName','2229732uuBHPg','Refreshed\x20app\x20cache\x20with\x20','find','boolean','Filter\x20by\x20environment\x20(default:\x20current\x20env)','4222984LUNPpx','909pWfYef','bool','entries','accessKey','no-cache','appName','\x20cached\x20app(s)\x20for\x20env=\x22','name','write','3450fsEkpG','push','No\x20apps\x20found\x20on\x20the\x20platform.','No\x20cached\x20apps\x20found.','Read\x20app\x20list\x20from\x20local\x20cache\x20only','isCurrent','455265ddGPTd','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache'];a3_0x2c5c=function(){return _0x19fc4c;};return a3_0x2c5c();}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x4853ad,_0x3a5fb3){const _0xb81112=a3_0x5248,_0x100e8f={};for(const _0x1b255a of _0x3a5fb3){const _0x48778f=_0x1b255a['type']===_0xb81112(0x1a5)?_0x4853ad[_0xb81112(0x1a9)](_0x1b255a[_0xb81112(0x1af)]):_0x4853ad[_0xb81112(0x19f)](_0x1b255a[_0xb81112(0x1af)]);if(_0x48778f!==''&&_0x48778f!==![])_0x100e8f[_0x1b255a['name']]=_0x48778f;}if(_0x4853ad[_0xb81112(0x1d3)])_0x100e8f[_0xb81112(0x1d3)]=!![];return _0x100e8f;}function normalizeLanguages(_0x44459f){const _0x1a40c3=a3_0x5248;if(!Array['isArray'](_0x44459f))return[];return _0x44459f[_0x1a40c3(0x1c4)](_0x5f366a=>typeof _0x5f366a==='string')[_0x1a40c3(0x1cb)](_0x1738de=>_0x1738de[_0x1a40c3(0x1dc)]())[_0x1a40c3(0x1c4)](Boolean);}function a3_0x5248(_0x29a108,_0x45e6e1){_0x29a108=_0x29a108-0x19e;const _0x2c5c12=a3_0x2c5c();let _0x5248bb=_0x2c5c12[_0x29a108];return _0x5248bb;}function buildRemoteAppI18nFields(_0x26e0a1){const _0x5bf7d1=a3_0x5248,_0x578b95=normalizeLanguages(_0x26e0a1['i18nInfo']?.[_0x5bf7d1(0x1ba)]);return{'enableI18n':typeof _0x26e0a1['enableI18n']===_0x5bf7d1(0x1a5)?_0x26e0a1['enableI18n']:null,'languages':_0x578b95,'i18nInfo':_0x26e0a1['i18nInfo']?{..._0x26e0a1[_0x5bf7d1(0x1de)],'langs':_0x578b95['length']?_0x578b95:null}:null};}const listDef={'service':a3_0x461bef(0x1d2),'command':'list','description':a3_0x461bef(0x1d5),'risk':a3_0x461bef(0x1a0),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x461bef(0x1db),'type':'string','description':a3_0x461bef(0x1a6),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x461bef(0x1c7),'type':a3_0x461bef(0x1a5),'description':a3_0x461bef(0x1b5),'default':![]},{'name':'no-cache','type':a3_0x461bef(0x1a5),'description':a3_0x461bef(0x1b8),'default':![]},{'name':a3_0x461bef(0x1bd),'type':a3_0x461bef(0x1a5),'description':'Include\x20unpublished\x20apps\x20for\x20diagnostics','default':![]}],async 'execute'(_0x18bd1b){const _0x5aa4fb=a3_0x461bef,_0x5cfc50=_0x18bd1b[_0x5aa4fb(0x19f)](_0x5aa4fb(0x1db))||_0x18bd1b['envName']||getEnv()||_0x5aa4fb(0x1c1),_0x319848=_0x18bd1b['bool'](_0x5aa4fb(0x1c7)),_0x1a43c2=_0x18bd1b['bool'](_0x5aa4fb(0x1ac)),_0x5d9643=_0x18bd1b['bool'](_0x5aa4fb(0x1bd)),{readRawConfigWithLayers:_0x11cd0f,resolveDefaultAppSource:_0x201d84,getLocalAppAliases:_0xe2ed4}=await import('../../context.js'),{getRemoteAppList:_0x2388e0}=await import('../../commands/app/remote-source.js'),{config:_0x358f2d,layers:_0xc67349}=_0x11cd0f(),_0x392dcb=_0x201d84(_0xc67349),{defaultApp:_0x452fd3}=_0x358f2d,_0x3f98cc=await _0x2388e0({'env':_0x5cfc50,'accessKey':_0x18bd1b[_0x5aa4fb(0x1ab)],'localOnly':_0x319848,'noCache':_0x1a43c2}),_0x46f619=_0x5d9643?_0x3f98cc[_0x5aa4fb(0x1d6)]:filterRuntimeAccessibleApps(_0x3f98cc[_0x5aa4fb(0x1d6)]),_0x33a03e=_0x3f98cc[_0x5aa4fb(0x1d6)][_0x5aa4fb(0x1dd)]-_0x46f619[_0x5aa4fb(0x1dd)],_0x4f2727=_0x46f619[_0x5aa4fb(0x1cb)](_0x2b6288=>{const _0x16c138=_0x5aa4fb;return{'name':_0x2b6288[_0x16c138(0x1ad)],'appcode':_0x2b6288[_0x16c138(0x1ce)],'named':!![],'definedIn':_0x16c138(0x1d1),'isDefault':_0x2b6288['appName']===_0x452fd3,...buildAppProfileListFields(_0x5cfc50),...buildRemoteAppI18nFields(_0x2b6288),'source':_0x3f98cc[_0x16c138(0x1c8)],'owner':_0x2b6288[_0x16c138(0x1bc)]??null,'status':_0x2b6288[_0x16c138(0x1d4)]??null,'cachedAt':_0x3f98cc[_0x16c138(0x1c3)]};}),_0xf0eba0=_0xe2ed4(_0x358f2d);let _0xcf1f9e=0x0;for(const [_0x5afafb,_0x1c65be]of Object[_0x5aa4fb(0x1aa)](_0xf0eba0)){const _0x2cd661=typeof _0x1c65be['appcode']===_0x5aa4fb(0x1c2)?_0x1c65be[_0x5aa4fb(0x1d0)][_0x5aa4fb(0x1dc)]():'';if(!_0x2cd661)continue;const _0xc469b7=findAppByCode(_0x3f98cc[_0x5aa4fb(0x1d6)],_0x2cd661);if(!_0x5d9643&&_0xc469b7&&!isRuntimeAccessibleApp(_0xc469b7))continue;_0xcf1f9e+=0x1,_0x4f2727[_0x5aa4fb(0x1b2)]({'name':_0x5afafb,'appcode':_0x2cd661,'named':!![],'definedIn':_0x5aa4fb(0x1c7),'isDefault':_0x5afafb===_0x452fd3,...buildAppProfileListFields(_0x5cfc50),'source':_0x5aa4fb(0x1c9),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x4f2727,_0x18bd1b['mergedCli']);const _0x5b29f1=_0x4f2727[_0x5aa4fb(0x1a4)](_0x358edc=>_0x358edc[_0x5aa4fb(0x1b6)]===!![]),_0x260743=_0x452fd3??_0x5b29f1?.['name']??null,_0x588b5d={'env':_0x5cfc50,'source':_0x3f98cc[_0x5aa4fb(0x1c8)],'fetchedAt':_0x3f98cc[_0x5aa4fb(0x1c3)],'cachePath':_0x3f98cc['cachePath'],'globalPath':_0xc67349[_0x5aa4fb(0x1be)]??null,'projectPath':_0xc67349['projectPath']??null,'defaultApp':_0x260743,'defaultAppSource':_0x452fd3!=null?_0x392dcb:null,'localAliasCount':_0xcf1f9e,'remoteTotal':_0x3f98cc[_0x5aa4fb(0x1d6)]['length'],'hiddenUnpublishedCount':_0x33a03e,'includeUnpublished':_0x5d9643};if(_0x4f2727['length']===0x0)return{'ok':!![],'data':{'items':_0x4f2727,'meta':_0x588b5d},'message':_0x3f98cc[_0x5aa4fb(0x1c8)]===_0x5aa4fb(0x1ca)?_0x5aa4fb(0x1b4):_0x5aa4fb(0x1b3)};return{'ok':!![],'data':{'items':_0x4f2727,'meta':_0x588b5d}};}},pullDef={'service':a3_0x461bef(0x1d2),'command':'pull','description':a3_0x461bef(0x19e),'risk':a3_0x461bef(0x1b0),'confirmationDescription':'将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x461bef(0x1db),'type':'string','description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x461bef(0x1c7),'type':a3_0x461bef(0x1a5),'description':a3_0x461bef(0x1b9),'default':![]},{'name':a3_0x461bef(0x1ac),'type':a3_0x461bef(0x1a5),'description':a3_0x461bef(0x1b8),'default':![]}],async 'execute'(_0xb6ac3d){const _0x4801d9=a3_0x461bef,_0x106895=_0xb6ac3d[_0x4801d9(0x19f)](_0x4801d9(0x1db))||_0xb6ac3d[_0x4801d9(0x1a1)]||getEnv()||_0x4801d9(0x1c1),_0x1b88a8=_0xb6ac3d['bool'](_0x4801d9(0x1c7)),_0x979ed3=_0xb6ac3d[_0x4801d9(0x1a9)]('no-cache'),{getRemoteAppList:_0x3d1095}=await import(_0x4801d9(0x1cd)),_0x458e4e=await _0x3d1095({'env':_0x106895,'accessKey':_0xb6ac3d[_0x4801d9(0x1ab)],'localOnly':_0x1b88a8,'noCache':_0x979ed3});return{'ok':!![],'data':{'total':_0x458e4e[_0x4801d9(0x1d6)]['length'],'env':_0x106895,'source':_0x458e4e[_0x4801d9(0x1c8)],'fetchedAt':_0x458e4e[_0x4801d9(0x1c3)],'cachePath':_0x458e4e[_0x4801d9(0x1cf)]},'message':_0x458e4e[_0x4801d9(0x1c8)]===_0x4801d9(0x1ca)?_0x4801d9(0x1bf)+_0x458e4e[_0x4801d9(0x1d6)][_0x4801d9(0x1dd)]+_0x4801d9(0x1ae)+_0x106895+'\x22.':_0x4801d9(0x1a3)+_0x458e4e[_0x4801d9(0x1d6)][_0x4801d9(0x1dd)]+_0x4801d9(0x1c0)+_0x106895+'\x22.'};}},importDef={'service':a3_0x461bef(0x1d2),'command':a3_0x461bef(0x1c6),'description':a3_0x461bef(0x1d7),'risk':'write','confirmationDescription':a3_0x461bef(0x1c5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x57f5b6){return await runAppImport(collectFlags(_0x57f5b6,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
1
+ const a3_0x3a634c=a3_0x48fb;function a3_0x48fb(_0x3c33f6,_0x34794a){_0x3c33f6=_0x3c33f6-0x18f;const _0x30402e=a3_0x3040();let _0x48fb3a=_0x30402e[_0x3c33f6];return _0x48fb3a;}(function(_0x4c001f,_0x56a57b){const _0x375052=a3_0x48fb,_0xcafe15=_0x4c001f();while(!![]){try{const _0x299ea8=parseInt(_0x375052(0x194))/0x1*(parseInt(_0x375052(0x1cb))/0x2)+parseInt(_0x375052(0x1cc))/0x3*(parseInt(_0x375052(0x1c1))/0x4)+-parseInt(_0x375052(0x1c0))/0x5*(parseInt(_0x375052(0x1ad))/0x6)+parseInt(_0x375052(0x1a3))/0x7+-parseInt(_0x375052(0x1aa))/0x8*(-parseInt(_0x375052(0x1c5))/0x9)+-parseInt(_0x375052(0x1b0))/0xa+-parseInt(_0x375052(0x19a))/0xb;if(_0x299ea8===_0x56a57b)break;else _0xcafe15['push'](_0xcafe15['shift']());}catch(_0x482f8f){_0xcafe15['push'](_0xcafe15['shift']());}}}(a3_0x3040,0x7e02c));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';function a3_0x3040(){const _0x7910ee=['4904478lOByAd','items','local','../../context.js','Read\x20from\x20local\x20cache\x20only','write','69926bgjlKz','780993UEqHWI','Filter\x20by\x20environment\x20(default:\x20current\x20env)','appcode','appOwnerName','Include\x20unpublished\x20apps\x20for\x20diagnostics','cache','14MtXpFx','isCurrent','config','envName','i18nInfo','\x20app(s)\x20for\x20env=\x22','10579723xdedii','将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','bool','appPublishStatus','env','pull','production','boolean','mergedCli','1570268SZGXuP','map','source','accessKey','Read\x20app\x20list\x20from\x20local\x20cache\x20only','entries','nonInteractive','8LgdOKM','cachePath','name','48jwxZkg','trim','appCode','1010690fDCXXb','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','remote','length','从\x20.rabetbase.json\x20文件导入默认应用选择','str','Refreshed\x20app\x20cache\x20with\x20','enableI18n','find','app','type','push','include-unpublished','../../commands/app/remote-source.js','fetchedAt','string','125255iJMptz','8xqsdFu','appName','no-cache','Target\x20environment\x20(default:\x20current\x20env)'];a3_0x3040=function(){return _0x7910ee;};return a3_0x3040();}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0xdcfce0,_0xc73593){const _0x40eeb1=a3_0x48fb,_0x2945c3={};for(const _0x42d087 of _0xc73593){const _0x3166c5=_0x42d087[_0x40eeb1(0x1ba)]===_0x40eeb1(0x1a1)?_0xdcfce0['bool'](_0x42d087[_0x40eeb1(0x1ac)]):_0xdcfce0[_0x40eeb1(0x1b5)](_0x42d087[_0x40eeb1(0x1ac)]);if(_0x3166c5!==''&&_0x3166c5!==![])_0x2945c3[_0x42d087[_0x40eeb1(0x1ac)]]=_0x3166c5;}if(_0xdcfce0[_0x40eeb1(0x1a9)])_0x2945c3['nonInteractive']=!![];return _0x2945c3;}function normalizeLanguages(_0x5c575f){const _0x186b8e=a3_0x48fb;if(!Array['isArray'](_0x5c575f))return[];return _0x5c575f['filter'](_0x43da06=>typeof _0x43da06===_0x186b8e(0x1bf))[_0x186b8e(0x1a4)](_0x527ab2=>_0x527ab2[_0x186b8e(0x1ae)]())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x236e73){const _0x335931=a3_0x48fb,_0x377af9=normalizeLanguages(_0x236e73[_0x335931(0x198)]?.['langs']);return{'enableI18n':typeof _0x236e73[_0x335931(0x1b7)]==='boolean'?_0x236e73[_0x335931(0x1b7)]:null,'languages':_0x377af9,'i18nInfo':_0x236e73['i18nInfo']?{..._0x236e73['i18nInfo'],'langs':_0x377af9[_0x335931(0x1b3)]?_0x377af9:null}:null};}const listDef={'service':'app','command':'list','description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x3a634c(0x19e),'type':'string','description':a3_0x3a634c(0x18f),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x3a634c(0x1c7),'type':a3_0x3a634c(0x1a1),'description':a3_0x3a634c(0x1a7),'default':![]},{'name':a3_0x3a634c(0x1c3),'type':a3_0x3a634c(0x1a1),'description':a3_0x3a634c(0x1b1),'default':![]},{'name':a3_0x3a634c(0x1bc),'type':a3_0x3a634c(0x1a1),'description':a3_0x3a634c(0x192),'default':![]}],async 'execute'(_0x39c86){const _0x20c742=a3_0x3a634c,_0x4d97a3=_0x39c86[_0x20c742(0x1b5)](_0x20c742(0x19e))||_0x39c86[_0x20c742(0x197)]||getEnv()||_0x20c742(0x1a0),_0xe53077=_0x39c86[_0x20c742(0x19c)](_0x20c742(0x1c7)),_0x323f96=_0x39c86[_0x20c742(0x19c)](_0x20c742(0x1c3)),_0x36b378=_0x39c86[_0x20c742(0x19c)](_0x20c742(0x1bc)),{readRawConfigWithLayers:_0x2d2740,resolveDefaultAppSource:_0x3fa8ff,getLocalAppAliases:_0x24e3b3}=await import(_0x20c742(0x1c8)),{getRemoteAppList:_0x19e6f4}=await import(_0x20c742(0x1bd)),{config:_0xd4880d,layers:_0x128ce0}=_0x2d2740(),_0x2eacff=_0x3fa8ff(_0x128ce0),{defaultApp:_0x1186ed}=_0xd4880d,_0x29140b=await _0x19e6f4({'env':_0x4d97a3,'accessKey':_0x39c86[_0x20c742(0x1a6)],'localOnly':_0xe53077,'noCache':_0x323f96}),_0x4ef471=_0x36b378?_0x29140b[_0x20c742(0x1c6)]:filterRuntimeAccessibleApps(_0x29140b[_0x20c742(0x1c6)]),_0x391719=_0x29140b[_0x20c742(0x1c6)][_0x20c742(0x1b3)]-_0x4ef471[_0x20c742(0x1b3)],_0x413a03=_0x4ef471[_0x20c742(0x1a4)](_0x39d7f8=>{const _0x196389=_0x20c742;return{'name':_0x39d7f8[_0x196389(0x1c2)],'appcode':_0x39d7f8[_0x196389(0x1af)],'named':!![],'definedIn':_0x196389(0x1b2),'isDefault':_0x39d7f8[_0x196389(0x1c2)]===_0x1186ed,...buildAppProfileListFields(_0x4d97a3),...buildRemoteAppI18nFields(_0x39d7f8),'source':_0x29140b[_0x196389(0x1a5)],'owner':_0x39d7f8[_0x196389(0x191)]??null,'status':_0x39d7f8[_0x196389(0x19d)]??null,'cachedAt':_0x29140b[_0x196389(0x1be)]};}),_0x5e5f8e=_0x24e3b3(_0xd4880d);let _0x45603d=0x0;for(const [_0x32cfd9,_0xe4e228]of Object[_0x20c742(0x1a8)](_0x5e5f8e)){const _0x4bd460=typeof _0xe4e228[_0x20c742(0x190)]===_0x20c742(0x1bf)?_0xe4e228[_0x20c742(0x190)][_0x20c742(0x1ae)]():'';if(!_0x4bd460)continue;const _0x1abb06=findAppByCode(_0x29140b[_0x20c742(0x1c6)],_0x4bd460);if(!_0x36b378&&_0x1abb06&&!isRuntimeAccessibleApp(_0x1abb06))continue;_0x45603d+=0x1,_0x413a03[_0x20c742(0x1bb)]({'name':_0x32cfd9,'appcode':_0x4bd460,'named':!![],'definedIn':_0x20c742(0x1c7),'isDefault':_0x32cfd9===_0x1186ed,...buildAppProfileListFields(_0x4d97a3),'source':_0x20c742(0x196),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x413a03,_0x39c86[_0x20c742(0x1a2)]);const _0x4ac494=_0x413a03[_0x20c742(0x1b8)](_0x77faa7=>_0x77faa7[_0x20c742(0x195)]===!![]),_0x303e30=_0x1186ed??_0x4ac494?.['name']??null,_0x5ceb54={'env':_0x4d97a3,'source':_0x29140b[_0x20c742(0x1a5)],'fetchedAt':_0x29140b[_0x20c742(0x1be)],'cachePath':_0x29140b[_0x20c742(0x1ab)],'globalPath':_0x128ce0['globalPath']??null,'projectPath':_0x128ce0['projectPath']??null,'defaultApp':_0x303e30,'defaultAppSource':_0x1186ed!=null?_0x2eacff:null,'localAliasCount':_0x45603d,'remoteTotal':_0x29140b[_0x20c742(0x1c6)][_0x20c742(0x1b3)],'hiddenUnpublishedCount':_0x391719,'includeUnpublished':_0x36b378};if(_0x413a03[_0x20c742(0x1b3)]===0x0)return{'ok':!![],'data':{'items':_0x413a03,'meta':_0x5ceb54},'message':_0x29140b[_0x20c742(0x1a5)]===_0x20c742(0x193)?'No\x20cached\x20apps\x20found.':'No\x20apps\x20found\x20on\x20the\x20platform.'};return{'ok':!![],'data':{'items':_0x413a03,'meta':_0x5ceb54}};}},pullDef={'service':a3_0x3a634c(0x1b9),'command':a3_0x3a634c(0x19f),'description':'从平台刷新本地应用缓存','risk':'write','confirmationDescription':a3_0x3a634c(0x19b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x3a634c(0x19e),'type':a3_0x3a634c(0x1bf),'description':a3_0x3a634c(0x1c4),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x3a634c(0x1a1),'description':a3_0x3a634c(0x1c9),'default':![]},{'name':a3_0x3a634c(0x1c3),'type':a3_0x3a634c(0x1a1),'description':a3_0x3a634c(0x1b1),'default':![]}],async 'execute'(_0x5d9454){const _0x2f1ba4=a3_0x3a634c,_0x3a48d3=_0x5d9454['str']('env')||_0x5d9454[_0x2f1ba4(0x197)]||getEnv()||_0x2f1ba4(0x1a0),_0x25b817=_0x5d9454[_0x2f1ba4(0x19c)]('local'),_0x2c4565=_0x5d9454['bool'](_0x2f1ba4(0x1c3)),{getRemoteAppList:_0x54a6dd}=await import('../../commands/app/remote-source.js'),_0x2d6801=await _0x54a6dd({'env':_0x3a48d3,'accessKey':_0x5d9454[_0x2f1ba4(0x1a6)],'localOnly':_0x25b817,'noCache':_0x2c4565});return{'ok':!![],'data':{'total':_0x2d6801['items']['length'],'env':_0x3a48d3,'source':_0x2d6801[_0x2f1ba4(0x1a5)],'fetchedAt':_0x2d6801[_0x2f1ba4(0x1be)],'cachePath':_0x2d6801[_0x2f1ba4(0x1ab)]},'message':_0x2d6801['source']===_0x2f1ba4(0x193)?'Loaded\x20'+_0x2d6801[_0x2f1ba4(0x1c6)][_0x2f1ba4(0x1b3)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x3a48d3+'\x22.':_0x2f1ba4(0x1b6)+_0x2d6801['items'][_0x2f1ba4(0x1b3)]+_0x2f1ba4(0x199)+_0x3a48d3+'\x22.'};}},importDef={'service':a3_0x3a634c(0x1b9),'command':'import','description':a3_0x3a634c(0x1b4),'risk':a3_0x3a634c(0x1ca),'confirmationDescription':'将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x207baa){return await runAppImport(collectFlags(_0x207baa,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
@@ -1 +1 @@
1
- (function(_0x47c770,_0x5e52f8){const _0x28fc5e=a4_0x443f,_0xc75a96=_0x47c770();while(!![]){try{const _0x407b1a=-parseInt(_0x28fc5e(0xca))/0x1+parseInt(_0x28fc5e(0xd3))/0x2+-parseInt(_0x28fc5e(0xce))/0x3+-parseInt(_0x28fc5e(0xd6))/0x4+-parseInt(_0x28fc5e(0xcd))/0x5*(-parseInt(_0x28fc5e(0xd1))/0x6)+parseInt(_0x28fc5e(0xc9))/0x7+-parseInt(_0x28fc5e(0xdc))/0x8;if(_0x407b1a===_0x5e52f8)break;else _0xc75a96['push'](_0xc75a96['shift']());}catch(_0x1d64dd){_0xc75a96['push'](_0xc75a96['shift']());}}}(a4_0xd8b0,0x71027));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x3f6ee2){const _0x427391=a4_0x443f;if(typeof _0x3f6ee2!==_0x427391(0xd4))return null;const _0x23397f=_0x3f6ee2[_0x427391(0xd2)]();return _0x23397f?_0x23397f[_0x427391(0xd7)]():null;}export function isRuntimeAccessibleApp(_0x6a317b){const _0x519a1f=a4_0x443f;return normalizeAppPublishStatus(_0x6a317b[_0x519a1f(0xcb)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x2337dd){return _0x2337dd['filter'](isRuntimeAccessibleApp);}export function findAppByName(_0x16b711,_0x26f47f){const _0x422c39=a4_0x443f;return _0x16b711[_0x422c39(0xd9)](_0x15b790=>_0x15b790[_0x422c39(0xcf)]===_0x26f47f);}export function findAppByCode(_0x18e2a9,_0x416408){const _0x1b22ca=a4_0x443f,_0x33def6=_0x416408[_0x1b22ca(0xd2)]();if(!_0x33def6)return undefined;return _0x18e2a9[_0x1b22ca(0xd9)](_0x3cba20=>_0x3cba20[_0x1b22ca(0xda)]?.[_0x1b22ca(0xd2)]()===_0x33def6);}function a4_0xd8b0(){const _0x4689b3=['appName','.\x20Publish\x20the\x20app\x20before\x20using\x20','2066718HSZVhL','trim','1807694idPUuC','string','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','1405428MRVYtk','toUpperCase','validation','find','appCode','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','3653968eHjIFt','App\x20','2733864xnzUPi','278010XIbZNi','appPublishStatus','Current\x20status:\x20','5QSvjER','269556vJoVsp'];a4_0xd8b0=function(){return _0x4689b3;};return a4_0xd8b0();}function a4_0x443f(_0x5e269b,_0x592ea8){_0x5e269b=_0x5e269b-0xc8;const _0xd8b0e0=a4_0xd8b0();let _0x443f59=_0xd8b0e0[_0x5e269b];return _0x443f59;}export function runtimeInaccessibleAppError(_0x4f48c2,_0x58ffcf){const _0x37c043=a4_0x443f,_0x56afe5=normalizeAppPublishStatus(_0x4f48c2[_0x37c043(0xcb)])??'UNKNOWN';return CliErrors[_0x37c043(0xd8)](_0x37c043(0xc8)+_0x58ffcf+_0x37c043(0xd5),_0x37c043(0xcc)+_0x56afe5+_0x37c043(0xd0)+CLI_BIN_NAME+_0x37c043(0xdb));}
1
+ (function(_0x53d5f3,_0x345630){const _0x5a27be=a4_0x35f1,_0xa488ab=_0x53d5f3();while(!![]){try{const _0x1d08ea=-parseInt(_0x5a27be(0x193))/0x1*(-parseInt(_0x5a27be(0x189))/0x2)+parseInt(_0x5a27be(0x18a))/0x3+parseInt(_0x5a27be(0x18e))/0x4*(-parseInt(_0x5a27be(0x187))/0x5)+-parseInt(_0x5a27be(0x18c))/0x6*(-parseInt(_0x5a27be(0x188))/0x7)+-parseInt(_0x5a27be(0x18b))/0x8+parseInt(_0x5a27be(0x182))/0x9+-parseInt(_0x5a27be(0x192))/0xa;if(_0x1d08ea===_0x345630)break;else _0xa488ab['push'](_0xa488ab['shift']());}catch(_0x3000c6){_0xa488ab['push'](_0xa488ab['shift']());}}}(a4_0x47e4,0x894a2));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';function a4_0x35f1(_0x5cd904,_0x5d6ebf){_0x5cd904=_0x5cd904-0x182;const _0x47e499=a4_0x47e4();let _0x35f16d=_0x47e499[_0x5cd904];return _0x35f16d;}function a4_0x47e4(){const _0x5f083e=['14rvNsdA','44SckHji','1148151cPyCkW','6378984enKcJP','3329724uMAnOU','find','4yNtIdF','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','toUpperCase','.\x20Publish\x20the\x20app\x20before\x20using\x20','7305430EHZtiO','19501ZMsnyq','UNKNOWN','appCode','validation','App\x20','Current\x20status:\x20','2222316IYvkiw','trim','filter','appName','string','391585KCSgQQ'];a4_0x47e4=function(){return _0x5f083e;};return a4_0x47e4();}import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x3eb98f){const _0x2ae0d0=a4_0x35f1;if(typeof _0x3eb98f!==_0x2ae0d0(0x186))return null;const _0x1a985e=_0x3eb98f[_0x2ae0d0(0x183)]();return _0x1a985e?_0x1a985e[_0x2ae0d0(0x190)]():null;}export function isRuntimeAccessibleApp(_0x22dd13){return normalizeAppPublishStatus(_0x22dd13['appPublishStatus'])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x512eaf){const _0x4900c4=a4_0x35f1;return _0x512eaf[_0x4900c4(0x184)](isRuntimeAccessibleApp);}export function findAppByName(_0x3ca9db,_0x2b4cf8){const _0x485d57=a4_0x35f1;return _0x3ca9db[_0x485d57(0x18d)](_0x1bac25=>_0x1bac25[_0x485d57(0x185)]===_0x2b4cf8);}export function findAppByCode(_0x129de2,_0x51ed33){const _0x36cac8=a4_0x35f1,_0x5a49b0=_0x51ed33[_0x36cac8(0x183)]();if(!_0x5a49b0)return undefined;return _0x129de2[_0x36cac8(0x18d)](_0x590c90=>_0x590c90[_0x36cac8(0x195)]?.[_0x36cac8(0x183)]()===_0x5a49b0);}export function runtimeInaccessibleAppError(_0x129556,_0x304eac){const _0x10f6e4=a4_0x35f1,_0x44acc8=normalizeAppPublishStatus(_0x129556['appPublishStatus'])??_0x10f6e4(0x194);return CliErrors[_0x10f6e4(0x196)](_0x10f6e4(0x197)+_0x304eac+'\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.',_0x10f6e4(0x198)+_0x44acc8+_0x10f6e4(0x191)+CLI_BIN_NAME+_0x10f6e4(0x18f));}
@@ -1 +1 @@
1
- (function(_0x2fa409,_0x21fec2){const _0x1a1cbc=a5_0x1027,_0x2a06b3=_0x2fa409();while(!![]){try{const _0x5dc044=-parseInt(_0x1a1cbc(0x9f))/0x1+-parseInt(_0x1a1cbc(0x99))/0x2*(parseInt(_0x1a1cbc(0x92))/0x3)+parseInt(_0x1a1cbc(0x9b))/0x4*(-parseInt(_0x1a1cbc(0x96))/0x5)+-parseInt(_0x1a1cbc(0x9c))/0x6+parseInt(_0x1a1cbc(0x98))/0x7+parseInt(_0x1a1cbc(0xa0))/0x8+-parseInt(_0x1a1cbc(0x97))/0x9*(-parseInt(_0x1a1cbc(0x9d))/0xa);if(_0x5dc044===_0x21fec2)break;else _0x2a06b3['push'](_0x2a06b3['shift']());}catch(_0x78b2d5){_0x2a06b3['push'](_0x2a06b3['shift']());}}}(a5_0x2780,0x92337));import{fileURLToPath}from'url';import{dirname,join}from'path';function a5_0x1027(_0x38124e,_0xdb0655){_0x38124e=_0x38124e-0x92;const _0x2780a5=a5_0x2780();let _0x1027c7=_0x2780a5[_0x38124e];return _0x1027c7;}import{readFileSync}from'fs';function a5_0x2780(){const _0x117580=['parse','33636DDrLGB','4440876NXDtet','11030zGXTKR','Mock\x20API\x20error:\x20','809901PemaOK','1582248CineHU','42kHEVDF','utf-8','errorCode','../../../mock/app-list.json','490yOSxje','21906VuXJXX','6393345ZDPHTR','117550xzfrhr'];a5_0x2780=function(){return _0x117580;};return a5_0x2780();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0xd34260=a5_0x1027,_0x59b168=join(__dirname,_0xd34260(0x95)),_0x3ddeb9=readFileSync(_0x59b168,_0xd34260(0x93));return JSON[_0xd34260(0x9a)](_0x3ddeb9);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x5b75d3=a5_0x1027,_0x57197b=getMockAppList();if(!_0x57197b['success'])throw new Error(_0x5b75d3(0x9e)+_0x57197b['errorMsg']+'\x20('+_0x57197b[_0x5b75d3(0x94)]+')');return _0x57197b['data']['tableData'];}
1
+ (function(_0x1b38c4,_0x5bc94b){const _0x225ee4=a5_0xdc5a,_0x4a0154=_0x1b38c4();while(!![]){try{const _0x4d512f=-parseInt(_0x225ee4(0x1f5))/0x1+parseInt(_0x225ee4(0x1f0))/0x2*(parseInt(_0x225ee4(0x1e9))/0x3)+-parseInt(_0x225ee4(0x1f1))/0x4*(-parseInt(_0x225ee4(0x1f6))/0x5)+-parseInt(_0x225ee4(0x1ec))/0x6+parseInt(_0x225ee4(0x1f4))/0x7+parseInt(_0x225ee4(0x1ed))/0x8*(-parseInt(_0x225ee4(0x1eb))/0x9)+-parseInt(_0x225ee4(0x1f7))/0xa*(-parseInt(_0x225ee4(0x1f8))/0xb);if(_0x4d512f===_0x5bc94b)break;else _0x4a0154['push'](_0x4a0154['shift']());}catch(_0x3cee70){_0x4a0154['push'](_0x4a0154['shift']());}}}(a5_0x1b63,0x6126f));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x1dcd13=a5_0xdc5a,_0x55d7a4=join(__dirname,'../../../mock/app-list.json'),_0x14378d=readFileSync(_0x55d7a4,_0x1dcd13(0x1ee));return JSON[_0x1dcd13(0x1f3)](_0x14378d);}function a5_0x1b63(){const _0x1fd4e9=['errorMsg','5666YNqKmG','118408srcfts','Mock\x20API\x20error:\x20','parse','426741fetzeT','589430aXXgDM','120gcZGoY','177020wJqatD','330xDsxKF','success','354ndQufA','tableData','2418201GbcNQk','2284266ULdcCK','8HyayLN','utf-8'];a5_0x1b63=function(){return _0x1fd4e9;};return a5_0x1b63();}function a5_0xdc5a(_0x3c004c,_0x5e9475){_0x3c004c=_0x3c004c-0x1e9;const _0x1b6303=a5_0x1b63();let _0xdc5a1f=_0x1b6303[_0x3c004c];return _0xdc5a1f;}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x227c0f=a5_0xdc5a,_0x462d15=getMockAppList();if(!_0x462d15[_0x227c0f(0x1f9)])throw new Error(_0x227c0f(0x1f2)+_0x462d15[_0x227c0f(0x1ef)]+'\x20('+_0x462d15['errorCode']+')');return _0x462d15['data'][_0x227c0f(0x1ea)];}
@@ -1 +1 @@
1
- (function(_0x495b55,_0x1efec4){const _0x4a5a72=a6_0x42f6,_0x28a02e=_0x495b55();while(!![]){try{const _0x565203=parseInt(_0x4a5a72(0x143))/0x1+-parseInt(_0x4a5a72(0x13a))/0x2+parseInt(_0x4a5a72(0x139))/0x3+parseInt(_0x4a5a72(0x149))/0x4*(-parseInt(_0x4a5a72(0x13e))/0x5)+parseInt(_0x4a5a72(0x13c))/0x6+-parseInt(_0x4a5a72(0x13f))/0x7*(-parseInt(_0x4a5a72(0x13d))/0x8)+parseInt(_0x4a5a72(0x148))/0x9*(-parseInt(_0x4a5a72(0x140))/0xa);if(_0x565203===_0x1efec4)break;else _0x28a02e['push'](_0x28a02e['shift']());}catch(_0x3a630b){_0x28a02e['push'](_0x28a02e['shift']());}}}(a6_0x2f5c,0x3bc6d));function a6_0x2f5c(){const _0x5b6269=['1610YkOPKF','cache','APP_LIST_SOURCE','367263PFyyad','fetchedAt','toISOString','mock','toLowerCase','57636HuTiUS','1310692qDEWNF','979947iCKJoe','46520ocmQJq','trim','2783352YAcYMN','341104mShpMq','5ubOmkB','77avAphv'];a6_0x2f5c=function(){return _0x5b6269;};return a6_0x2f5c();}import{getMyApps}from'../../core/api-client.js';function a6_0x42f6(_0x312ae3,_0xa18d56){_0x312ae3=_0x312ae3-0x139;const _0x2f5c=a6_0x2f5c();let _0x42f6d1=_0x2f5c[_0x312ae3];return _0x42f6d1;}import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x4d0bb6=a6_0x42f6,_0x139abc=(productEnv(_0x4d0bb6(0x142))||'')[_0x4d0bb6(0x13b)]()[_0x4d0bb6(0x147)]();return _0x139abc===_0x4d0bb6(0x146);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x171c5d){const _0x33626c=a6_0x42f6,{env:_0x499327,accessKey:_0x408960,localOnly:localOnly=![],noCache:noCache=![]}=_0x171c5d,_0x2683f5=readCachedAppList(_0x499327,_0x408960),_0x2e91b2=_0x408960?.[_0x33626c(0x13b)]()?getAppCacheFilePath(_0x499327,_0x408960):null;if(localOnly)return{'items':_0x2683f5?.['items']??[],'source':_0x33626c(0x141),'fetchedAt':_0x2683f5?.[_0x33626c(0x144)]??null,'cachePath':_0x2e91b2};try{const _0xdeaf2b=await getRemoteAppItems(),_0x305353=shouldUseMockRemoteApps()?'mock':'remote',_0x10438e=new Date()[_0x33626c(0x145)](),_0x54dcf7=_0x408960?.['trim']()?writeCachedAppList(_0x499327,_0x408960,{'env':_0x499327,'fetchedAt':_0x10438e,'source':_0x305353,'items':_0xdeaf2b}):null;return{'items':_0xdeaf2b,'source':_0x305353,'fetchedAt':_0x10438e,'cachePath':_0x54dcf7};}catch(_0x1d8d01){if(!noCache&&_0x2683f5)return{'items':_0x2683f5['items'],'source':'cache','fetchedAt':_0x2683f5[_0x33626c(0x144)],'cachePath':_0x2e91b2};throw _0x1d8d01;}}
1
+ (function(_0x49d234,_0x3d2911){const _0x101d1c=a6_0x5355,_0x59045a=_0x49d234();while(!![]){try{const _0xa031cc=parseInt(_0x101d1c(0xe6))/0x1+parseInt(_0x101d1c(0xef))/0x2*(-parseInt(_0x101d1c(0xea))/0x3)+-parseInt(_0x101d1c(0xec))/0x4*(-parseInt(_0x101d1c(0xee))/0x5)+-parseInt(_0x101d1c(0xf2))/0x6*(parseInt(_0x101d1c(0xed))/0x7)+-parseInt(_0x101d1c(0xeb))/0x8+parseInt(_0x101d1c(0xe7))/0x9*(parseInt(_0x101d1c(0xe5))/0xa)+-parseInt(_0x101d1c(0xe8))/0xb;if(_0xa031cc===_0x3d2911)break;else _0x59045a['push'](_0x59045a['shift']());}catch(_0x15c69c){_0x59045a['push'](_0x59045a['shift']());}}}(a6_0x4cbf,0x2e277));function a6_0x5355(_0x35f1d9,_0x502f5a){_0x35f1d9=_0x35f1d9-0xe3;const _0x4cbfc6=a6_0x4cbf();let _0x5355db=_0x4cbfc6[_0x35f1d9];return _0x5355db;}import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x3fb9d4=a6_0x5355,_0x34d50c=(productEnv(_0x3fb9d4(0xf5))||'')[_0x3fb9d4(0xe4)]()[_0x3fb9d4(0xe3)]();return _0x34d50c===_0x3fb9d4(0xf3);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x592f06){const _0x1baa11=a6_0x5355,{env:_0x340748,accessKey:_0x54c73d,localOnly:localOnly=![],noCache:noCache=![]}=_0x592f06,_0x23e85e=readCachedAppList(_0x340748,_0x54c73d),_0x2cb3e7=_0x54c73d?.['trim']()?getAppCacheFilePath(_0x340748,_0x54c73d):null;if(localOnly)return{'items':_0x23e85e?.[_0x1baa11(0xf4)]??[],'source':_0x1baa11(0xf0),'fetchedAt':_0x23e85e?.[_0x1baa11(0xe9)]??null,'cachePath':_0x2cb3e7};try{const _0x59580b=await getRemoteAppItems(),_0x3ca7b6=shouldUseMockRemoteApps()?'mock':'remote',_0x3c7db6=new Date()[_0x1baa11(0xf1)](),_0x54b3ba=_0x54c73d?.['trim']()?writeCachedAppList(_0x340748,_0x54c73d,{'env':_0x340748,'fetchedAt':_0x3c7db6,'source':_0x3ca7b6,'items':_0x59580b}):null;return{'items':_0x59580b,'source':_0x3ca7b6,'fetchedAt':_0x3c7db6,'cachePath':_0x54b3ba};}catch(_0x43cd38){if(!noCache&&_0x23e85e)return{'items':_0x23e85e[_0x1baa11(0xf4)],'source':_0x1baa11(0xf0),'fetchedAt':_0x23e85e['fetchedAt'],'cachePath':_0x2cb3e7};throw _0x43cd38;}}function a6_0x4cbf(){const _0x14381b=['trim','2657590jSldaV','119813QHMpAV','9WpCYzk','878174fqQLUm','fetchedAt','178734AocrXT','850800Pkuvsm','4OeHeBp','21903yCssmC','1578550crSmio','10byPTez','cache','toISOString','54RRgRCU','mock','items','APP_LIST_SOURCE','toLowerCase'];a6_0x4cbf=function(){return _0x14381b;};return a6_0x4cbf();}
@@ -1 +1 @@
1
- function a7_0x147e(){const _0x5d432b=['currentApp','174cLChWg','10024570gmoIPf','2577195RlvNph','22gqgJct','24202REYphR','find','779520LIVdat','trim','5744914MZfTLu','definedIn','appcode','defaultApp','named','name','472915RYqOIs','20BNFQmC','24bmomqa','isCurrent','local','1386336TPsJOk'];a7_0x147e=function(){return _0x5d432b;};return a7_0x147e();}function a7_0x2569(_0x34b78d,_0x4efa00){_0x34b78d=_0x34b78d-0x99;const _0x147e66=a7_0x147e();let _0x256928=_0x147e66[_0x34b78d];return _0x256928;}(function(_0x99d6b8,_0x3e4708){const _0x315359=a7_0x2569,_0x13c3ca=_0x99d6b8();while(!![]){try{const _0x2b1f0e=parseInt(_0x315359(0x9c))/0x1+-parseInt(_0x315359(0x9a))/0x2*(-parseInt(_0x315359(0xab))/0x3)+parseInt(_0x315359(0xa5))/0x4*(-parseInt(_0x315359(0xa4))/0x5)+-parseInt(_0x315359(0xa9))/0x6+parseInt(_0x315359(0x9e))/0x7+parseInt(_0x315359(0xa6))/0x8*(parseInt(_0x315359(0xad))/0x9)+parseInt(_0x315359(0xac))/0xa*(-parseInt(_0x315359(0x99))/0xb);if(_0x2b1f0e===_0x3e4708)break;else _0x13c3ca['push'](_0x13c3ca['shift']());}catch(_0x426f69){_0x13c3ca['push'](_0x13c3ca['shift']());}}}(a7_0x147e,0x6e6a4));export function enrichAppListItemsWithMergedSelection(_0xc26027,_0x1ed06c){const _0x4e84c5=a7_0x2569;if(!_0x1ed06c)return;const _0x7a18df=!!(_0x1ed06c['currentApp']??_0x1ed06c[_0x4e84c5(0xa1)]);for(const _0x2ac97f of _0xc26027){_0x2ac97f[_0x4e84c5(0xa7)]=![];}const _0x463d21=_0x1ed06c['appCode']!=null?String(_0x1ed06c['appCode'])[_0x4e84c5(0x9d)]():'';if(_0x7a18df){const _0x14e812=_0x1ed06c[_0x4e84c5(0xaa)]??_0x1ed06c[_0x4e84c5(0xa1)];if(_0x14e812){const _0x42dfa4=_0xc26027[_0x4e84c5(0x9b)](_0x59c80c=>_0x59c80c[_0x4e84c5(0xa2)]===!![]&&_0x59c80c[_0x4e84c5(0xa3)]===_0x14e812&&_0x59c80c[_0x4e84c5(0x9f)]===_0x4e84c5(0xa8)),_0x3615ca=_0x42dfa4??_0xc26027['find'](_0x2c26ae=>_0x2c26ae[_0x4e84c5(0xa2)]===!![]&&_0x2c26ae[_0x4e84c5(0xa3)]===_0x14e812);if(_0x3615ca){const _0x1ea796=String(_0x3615ca[_0x4e84c5(0xa0)]??'')[_0x4e84c5(0x9d)]();if(!_0x463d21||_0x1ea796===_0x463d21){_0x3615ca[_0x4e84c5(0xa7)]=!![];return;}}}if(_0x463d21){const _0x437c8a=_0xc26027[_0x4e84c5(0x9b)](_0x20e299=>String(_0x20e299[_0x4e84c5(0xa0)]??'')[_0x4e84c5(0x9d)]()===_0x463d21);_0x437c8a&&(_0x437c8a[_0x4e84c5(0xa7)]=!![]);}return;}if(!_0x463d21)return;for(const _0x40408c of _0xc26027){String(_0x40408c['appcode']??'')['trim']()===_0x463d21&&(_0x40408c[_0x4e84c5(0xa7)]=!![]);}}
1
+ (function(_0x1a2e01,_0x33ca6c){const _0x40e7eb=a7_0x23cd,_0x18e318=_0x1a2e01();while(!![]){try{const _0xcbc730=parseInt(_0x40e7eb(0xa1))/0x1*(-parseInt(_0x40e7eb(0xa3))/0x2)+parseInt(_0x40e7eb(0x99))/0x3*(-parseInt(_0x40e7eb(0x96))/0x4)+parseInt(_0x40e7eb(0x9a))/0x5+-parseInt(_0x40e7eb(0xa2))/0x6+parseInt(_0x40e7eb(0x9d))/0x7+-parseInt(_0x40e7eb(0x9b))/0x8*(-parseInt(_0x40e7eb(0xa7))/0x9)+-parseInt(_0x40e7eb(0xa0))/0xa;if(_0xcbc730===_0x33ca6c)break;else _0x18e318['push'](_0x18e318['shift']());}catch(_0x47102e){_0x18e318['push'](_0x18e318['shift']());}}}(a7_0x5421,0xae3a2));function a7_0x23cd(_0x518934,_0x205f27){_0x518934=_0x518934-0x95;const _0x542199=a7_0x5421();let _0x23cd35=_0x542199[_0x518934];return _0x23cd35;}function a7_0x5421(){const _0x2ba132=['definedIn','498bDdYdd','5730420CVMGHj','8klVuso','trim','9036160FFjFZb','named','appCode','2446990RFIaYg','1242331OUUyMS','463974rMDiWJ','2kXUyyx','defaultApp','find','isCurrent','7449597jiuypy','currentApp','local','name','23776pSkIFO','appcode'];a7_0x5421=function(){return _0x2ba132;};return a7_0x5421();}export function enrichAppListItemsWithMergedSelection(_0x57bf55,_0x2fcec5){const _0x436b2e=a7_0x23cd;if(!_0x2fcec5)return;const _0x446190=!!(_0x2fcec5[_0x436b2e(0xa8)]??_0x2fcec5[_0x436b2e(0xa4)]);for(const _0x2305c8 of _0x57bf55){_0x2305c8['isCurrent']=![];}const _0x81f9ef=_0x2fcec5[_0x436b2e(0x9f)]!=null?String(_0x2fcec5[_0x436b2e(0x9f)])[_0x436b2e(0x9c)]():'';if(_0x446190){const _0x18b678=_0x2fcec5[_0x436b2e(0xa8)]??_0x2fcec5['defaultApp'];if(_0x18b678){const _0x2861c3=_0x57bf55[_0x436b2e(0xa5)](_0x53f460=>_0x53f460['named']===!![]&&_0x53f460[_0x436b2e(0x95)]===_0x18b678&&_0x53f460[_0x436b2e(0x98)]===_0x436b2e(0xa9)),_0x104217=_0x2861c3??_0x57bf55['find'](_0x3db41f=>_0x3db41f[_0x436b2e(0x9e)]===!![]&&_0x3db41f['name']===_0x18b678);if(_0x104217){const _0x2b788d=String(_0x104217['appcode']??'')[_0x436b2e(0x9c)]();if(!_0x81f9ef||_0x2b788d===_0x81f9ef){_0x104217['isCurrent']=!![];return;}}}if(_0x81f9ef){const _0x353365=_0x57bf55[_0x436b2e(0xa5)](_0x12b178=>String(_0x12b178[_0x436b2e(0x97)]??'')['trim']()===_0x81f9ef);_0x353365&&(_0x353365[_0x436b2e(0xa6)]=!![]);}return;}if(!_0x81f9ef)return;for(const _0xd001af of _0x57bf55){String(_0xd001af[_0x436b2e(0x97)]??'')[_0x436b2e(0x9c)]()===_0x81f9ef&&(_0xd001af[_0x436b2e(0xa6)]=!![]);}}
@@ -1 +1 @@
1
- const a8_0x650f7f=a8_0x5d9b;function a8_0x5d9b(_0x4d055f,_0x28e383){_0x4d055f=_0x4d055f-0xca;const _0x5bd2e5=a8_0x5bd2();let _0x5d9b6f=_0x5bd2e5[_0x4d055f];return _0x5d9b6f;}(function(_0x417eb6,_0x515667){const _0x2dfefb=a8_0x5d9b,_0x526bf6=_0x417eb6();while(!![]){try{const _0x18e98c=parseInt(_0x2dfefb(0xdb))/0x1*(parseInt(_0x2dfefb(0xdf))/0x2)+parseInt(_0x2dfefb(0xcb))/0x3*(parseInt(_0x2dfefb(0xda))/0x4)+parseInt(_0x2dfefb(0xd4))/0x5*(parseInt(_0x2dfefb(0xe0))/0x6)+parseInt(_0x2dfefb(0xd5))/0x7+-parseInt(_0x2dfefb(0xe2))/0x8*(parseInt(_0x2dfefb(0xca))/0x9)+-parseInt(_0x2dfefb(0xdc))/0xa+-parseInt(_0x2dfefb(0xe1))/0xb;if(_0x18e98c===_0x515667)break;else _0x526bf6['push'](_0x526bf6['shift']());}catch(_0x16e5ec){_0x526bf6['push'](_0x526bf6['shift']());}}}(a8_0x5bd2,0x6dad3));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x5bd2(){const _0x5d7b9f=['30KYZWza','2752453MDcuRR','3955704KFKeTG','9VxrjwU','3WfnqgW','Unable\x20to\x20get\x20app-config\x20value:\x20key=','validation','trim','args','get',',\x20appCode=','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','read','334795dKbngQ','5256426luMgZw','Usage:\x20','Missing\x20app-config\x20key.','app-config','App\x20config\x20key','2838644bRNNJp','10364iZpANK','6636370gvhXWg','\x20app-config\x20get\x20<key>','apiError','12YpZDiq'];a8_0x5bd2=function(){return _0x5d7b9f;};return a8_0x5bd2();}export const appConfigGet={'service':a8_0x650f7f(0xd8),'command':a8_0x650f7f(0xd0),'description':'Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','risk':a8_0x650f7f(0xd3),'args':[{'name':'key','description':a8_0x650f7f(0xd9),'required':!![]}],'flags':[],async 'execute'(_0xa7401c){const _0x213bbf=a8_0x650f7f,_0x3c9c65=_0xa7401c[_0x213bbf(0xcf)][0x0]?.[_0x213bbf(0xce)]();if(!_0x3c9c65)throw CliErrors[_0x213bbf(0xcd)](_0x213bbf(0xd7),_0x213bbf(0xd6)+CLI_BIN_NAME+_0x213bbf(0xdd));try{const _0x1dbc3a=await getRuntimeAppConfigByKey(_0xa7401c['appCode'],_0x3c9c65);return{'ok':!![],'data':_0x1dbc3a};}catch{throw CliErrors[_0x213bbf(0xde)](_0x213bbf(0xcc)+_0x3c9c65+_0x213bbf(0xd1)+_0xa7401c['appCode'],_0x213bbf(0xd2));}}};
1
+ const a8_0x3da2c9=a8_0x20fd;(function(_0x29465a,_0x52bc71){const _0x10d856=a8_0x20fd,_0x1bc637=_0x29465a();while(!![]){try{const _0x22bdd4=-parseInt(_0x10d856(0x1e2))/0x1*(parseInt(_0x10d856(0x1ec))/0x2)+parseInt(_0x10d856(0x1f1))/0x3*(parseInt(_0x10d856(0x1e1))/0x4)+-parseInt(_0x10d856(0x1dd))/0x5*(-parseInt(_0x10d856(0x1e6))/0x6)+-parseInt(_0x10d856(0x1e3))/0x7*(parseInt(_0x10d856(0x1dc))/0x8)+parseInt(_0x10d856(0x1e7))/0x9+-parseInt(_0x10d856(0x1e5))/0xa*(-parseInt(_0x10d856(0x1ea))/0xb)+-parseInt(_0x10d856(0x1ed))/0xc;if(_0x22bdd4===_0x52bc71)break;else _0x1bc637['push'](_0x1bc637['shift']());}catch(_0x27c39e){_0x1bc637['push'](_0x1bc637['shift']());}}}(a8_0x4af5,0x6b2f3));function a8_0x4af5(){const _0x564286=['5hQrPpS','23779zQZybw',',\x20appCode=','47300yRNwUq','128958wbpqMZ','4518522cOmxSB','args','Unable\x20to\x20get\x20app-config\x20value:\x20key=','616JmcSoE','appCode','89334pYLcZE','6855228XzGOFE','Missing\x20app-config\x20key.','trim','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','225933yNyqqA','\x20app-config\x20get\x20<key>','App\x20config\x20key','40nJqxmD','95uYLQDW','validation','apiError','app-config','4UbvXAR'];a8_0x4af5=function(){return _0x564286;};return a8_0x4af5();}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a8_0x20fd(_0x1df369,_0x53d3d5){_0x1df369=_0x1df369-0x1dc;const _0x4af564=a8_0x4af5();let _0x20fdd8=_0x4af564[_0x1df369];return _0x20fdd8;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x3da2c9(0x1e0),'command':'get','description':'Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','risk':'read','args':[{'name':'key','description':a8_0x3da2c9(0x1f3),'required':!![]}],'flags':[],async 'execute'(_0x25e670){const _0x4c1bba=a8_0x3da2c9,_0x10afde=_0x25e670[_0x4c1bba(0x1e8)][0x0]?.[_0x4c1bba(0x1ef)]();if(!_0x10afde)throw CliErrors[_0x4c1bba(0x1de)](_0x4c1bba(0x1ee),'Usage:\x20'+CLI_BIN_NAME+_0x4c1bba(0x1f2));try{const _0x408df0=await getRuntimeAppConfigByKey(_0x25e670[_0x4c1bba(0x1eb)],_0x10afde);return{'ok':!![],'data':_0x408df0};}catch{throw CliErrors[_0x4c1bba(0x1df)](_0x4c1bba(0x1e9)+_0x10afde+_0x4c1bba(0x1e4)+_0x25e670[_0x4c1bba(0x1eb)],_0x4c1bba(0x1f0));}}};
@@ -1 +1 @@
1
- (function(_0x50fed3,_0x3cbbeb){const _0x5f2d1e=a9_0x138c,_0x1a3229=_0x50fed3();while(!![]){try{const _0x1e5fde=-parseInt(_0x5f2d1e(0x10d))/0x1*(parseInt(_0x5f2d1e(0x10a))/0x2)+parseInt(_0x5f2d1e(0x10f))/0x3+parseInt(_0x5f2d1e(0x10b))/0x4*(parseInt(_0x5f2d1e(0x10c))/0x5)+-parseInt(_0x5f2d1e(0x112))/0x6+parseInt(_0x5f2d1e(0x10e))/0x7+-parseInt(_0x5f2d1e(0x109))/0x8*(-parseInt(_0x5f2d1e(0x108))/0x9)+parseInt(_0x5f2d1e(0x110))/0xa*(-parseInt(_0x5f2d1e(0x111))/0xb);if(_0x1e5fde===_0x3cbbeb)break;else _0x1a3229['push'](_0x1a3229['shift']());}catch(_0x423788){_0x1a3229['push'](_0x1a3229['shift']());}}}(a9_0x4ea2,0x5977a));import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x4ea2(){const _0x5b8ac0=['1825250HYdVKU','1942251DRAEWl','91040xhNeip','506JtKBDi','1358436bNvyfd','621GaNHIA','55960VAPCOh','198rChyfr','572996lDgbMO','5ckSaUf','5277RTcQgv'];a9_0x4ea2=function(){return _0x5b8ac0;};return a9_0x4ea2();}function a9_0x138c(_0x28669f,_0x440db4){_0x28669f=_0x28669f-0x108;const _0x4ea2f7=a9_0x4ea2();let _0x138cd0=_0x4ea2f7[_0x28669f];return _0x138cd0;}export const appConfigDefinitions=[appConfigGet];
1
+ function a9_0x404c(){const _0x5b2deb=['73524AAQKKJ','185862hEArOb','1639935lPqhMv','4985FBpeKi','5660SYaGuV','8GzDFvl','1818257ovVUXJ','900YhQYQf','28695jQrNrx','2695ZVaAUA','6BxfUpX'];a9_0x404c=function(){return _0x5b2deb;};return a9_0x404c();}(function(_0x200812,_0x7c938f){const _0x7567b6=a9_0x4498,_0x3c1c8d=_0x200812();while(!![]){try{const _0x538fe7=parseInt(_0x7567b6(0xa3))/0x1+-parseInt(_0x7567b6(0xa6))/0x2+parseInt(_0x7567b6(0xa7))/0x3+-parseInt(_0x7567b6(0xa2))/0x4*(parseInt(_0x7567b6(0x9e))/0x5)+-parseInt(_0x7567b6(0xa5))/0x6*(-parseInt(_0x7567b6(0xa1))/0x7)+parseInt(_0x7567b6(0xa0))/0x8*(parseInt(_0x7567b6(0x9d))/0x9)+parseInt(_0x7567b6(0x9f))/0xa*(-parseInt(_0x7567b6(0xa4))/0xb);if(_0x538fe7===_0x7c938f)break;else _0x3c1c8d['push'](_0x3c1c8d['shift']());}catch(_0x1ba56d){_0x3c1c8d['push'](_0x3c1c8d['shift']());}}}(a9_0x404c,0x206fa));import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x4498(_0x418670,_0x5b1bc3){_0x418670=_0x418670-0x9d;const _0x404ca0=a9_0x404c();let _0x4498c7=_0x404ca0[_0x418670];return _0x4498c7;}export const appConfigDefinitions=[appConfigGet];
@@ -1 +1 @@
1
- const a10_0x542a4f=a10_0x5dae;(function(_0x2f0e1a,_0x53a0cf){const _0x114cb7=a10_0x5dae,_0x4998ce=_0x2f0e1a();while(!![]){try{const _0x32c4c6=-parseInt(_0x114cb7(0x1d5))/0x1*(-parseInt(_0x114cb7(0x1a6))/0x2)+parseInt(_0x114cb7(0x1e4))/0x3*(-parseInt(_0x114cb7(0x1a1))/0x4)+-parseInt(_0x114cb7(0x1b1))/0x5*(-parseInt(_0x114cb7(0x1ca))/0x6)+parseInt(_0x114cb7(0x1d2))/0x7*(-parseInt(_0x114cb7(0x19f))/0x8)+-parseInt(_0x114cb7(0x1e9))/0x9*(parseInt(_0x114cb7(0x1a4))/0xa)+-parseInt(_0x114cb7(0x1bc))/0xb+-parseInt(_0x114cb7(0x19b))/0xc*(-parseInt(_0x114cb7(0x1dc))/0xd);if(_0x32c4c6===_0x53a0cf)break;else _0x4998ce['push'](_0x4998ce['shift']());}catch(_0x41fa89){_0x4998ce['push'](_0x4998ce['shift']());}}}(a10_0x1190,0x529fd));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a10_0x1190(){const _0x1807bf=['startsWith','join','60CnZNgl','favorite','compiledContent','test','5576kyWggN','read','232476mJZfMX','create','react_module','2996530ZxxcbJ','description','46uQxQQz','AGENT','File\x20path\x20is\x20required.','write','lodash','根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','@ant-design/icons','num','antd','map','metadata','335QwUwuM','trim','parse','str','保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','split','utf8','/client/artifact/','build','react','filter','3216488yBOAos','body','exec','includes','list','updateTime','name','Preview:\x20create\x20react_module\x20Artifact','verbose','appCode','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','Updated\x20Artifact\x20','lastIndex','POST','43914EMDYKD','Artifact\x20source\x20file\x20is\x20blank.','string','validation','detail','isArray','Invalid\x20JSON\x20for\x20--metadata:\x20','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','2877gGXkuL','Artifact\x20ID','flag','7937OOxkHo','createTime','Preview:\x20update\x20react_module\x20Artifact\x20','artifactType','/update','Created\x20Artifact\x20','isFile','1867814yeqJEw','source','dayjs','artifact','File\x20not\x20found:\x20','Artifact\x20display\x20name','deleted','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','9ViSKDX','Show\x20one\x20Artifact\x20by\x20id','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','number','length','9QQbNEc','update','.\x20Unsupported:\x20','bool'];a10_0x1190=function(){return _0x1807bf;};return a10_0x1190();}import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0x542a4f(0x1a3),ARTIFACT_SOURCE_AGENT=a10_0x542a4f(0x1a7),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x542a4f(0x1ba),'react-dom',a10_0x542a4f(0x1aa),a10_0x542a4f(0x1de),a10_0x542a4f(0x1ae),a10_0x542a4f(0x1ac)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x542a4f(0x1ee)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':'file','type':'string','required':!![],'description':a10_0x542a4f(0x1c6)},ARTIFACT_NAME_FLAG={'name':a10_0x542a4f(0x1c2),'type':'string','description':a10_0x542a4f(0x1e1)},METADATA_FLAG={'name':a10_0x542a4f(0x1b0),'type':'string','description':a10_0x542a4f(0x1e3)};function isPlainObject(_0x3c6d8e){const _0x7833b1=a10_0x542a4f;return typeof _0x3c6d8e==='object'&&_0x3c6d8e!==null&&!Array[_0x7833b1(0x1cf)](_0x3c6d8e);}function readSourceFile(_0x446c8b){const _0x4c4b69=a10_0x542a4f;if(!_0x446c8b)throw CliErrors[_0x4c4b69(0x1cd)](_0x4c4b69(0x1a8));if(!existsSync(_0x446c8b))throw CliErrors['validation'](_0x4c4b69(0x1e0)+_0x446c8b);if(!statSync(_0x446c8b)[_0x4c4b69(0x1db)]())throw CliErrors[_0x4c4b69(0x1cd)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x446c8b);const _0x5cddc8=readFileSync(_0x446c8b,_0x4c4b69(0x1b7));return validateReactModuleSource(_0x5cddc8),_0x5cddc8;}function parseMetadata(_0x22ba6e){const _0x33ae35=a10_0x542a4f;if(!_0x22ba6e)return undefined;let _0x5f2a04;try{_0x5f2a04=JSON[_0x33ae35(0x1b3)](_0x22ba6e);}catch{throw CliErrors[_0x33ae35(0x1cd)](_0x33ae35(0x1d0)+_0x22ba6e);}if(!isPlainObject(_0x5f2a04))throw CliErrors[_0x33ae35(0x1cd)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x1ec635={..._0x5f2a04};return delete _0x1ec635[_0x33ae35(0x19d)],_0x1ec635;}function getPackageName(_0x2c0451){const _0x5524d6=a10_0x542a4f;if(_0x2c0451[_0x5524d6(0x1ed)]('@')){const [_0x698482,_0x466f2c]=_0x2c0451['split']('/');return _0x698482&&_0x466f2c?_0x698482+'/'+_0x466f2c:_0x2c0451;}return _0x2c0451[_0x5524d6(0x1b6)]('/')[0x0]||_0x2c0451;}function validateAllowedImports(_0x4fe138){const _0x4d5a15=a10_0x542a4f,_0x758460=new Set();for(const _0x59bc5d of IMPORT_SOURCE_PATTERNS){_0x59bc5d[_0x4d5a15(0x1c8)]=0x0;let _0x960a36;while((_0x960a36=_0x59bc5d[_0x4d5a15(0x1be)](_0x4fe138))!==null){const _0x3114f6=_0x960a36[0x1]?.['trim']();_0x3114f6&&_0x758460['add'](_0x3114f6);}}const _0x17d7c5=[..._0x758460][_0x4d5a15(0x1af)](getPackageName)[_0x4d5a15(0x1bb)](_0x441410=>!ALLOWED_REACT_MODULE_IMPORTS[_0x4d5a15(0x1bf)](_0x441410));if(_0x17d7c5[_0x4d5a15(0x1e8)]>0x0)throw CliErrors[_0x4d5a15(0x1cd)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x4d5a15(0x1eb)+[...new Set(_0x17d7c5)][_0x4d5a15(0x1ee)](',\x20'));}function a10_0x5dae(_0x5613fe,_0x105fa6){_0x5613fe=_0x5613fe-0x19b;const _0x1190fc=a10_0x1190();let _0x5daecb=_0x1190fc[_0x5613fe];return _0x5daecb;}export function validateReactModuleSource(_0x38dde5){const _0x473952=a10_0x542a4f;if(!_0x38dde5['trim']())throw CliErrors['validation'](_0x473952(0x1cb));if(PAGE_LEVEL_PATTERNS['some'](_0x62551b=>_0x62551b[_0x473952(0x19e)](_0x38dde5)))throw CliErrors[_0x473952(0x1cd)](_0x473952(0x1e6));validateAllowedImports(_0x38dde5);}function buildArtifactInput(_0x54b5ed){const _0x45af85=a10_0x542a4f,_0x567f49=readSourceFile(_0x54b5ed[_0x45af85(0x1b4)]('file')),_0x1ddd11=_0x54b5ed[_0x45af85(0x1b4)](_0x45af85(0x1c2))[_0x45af85(0x1b2)](),_0x448d1c=parseMetadata(_0x54b5ed[_0x45af85(0x1b4)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x1ddd11?{'name':_0x1ddd11}:{},'content':_0x567f49,..._0x448d1c?{'metadata':_0x448d1c}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x3fce80){const _0x1abec7=a10_0x542a4f;return{'id':_0x3fce80['id'],'name':_0x3fce80[_0x1abec7(0x1c2)],'artifactType':_0x3fce80[_0x1abec7(0x1d8)],'source':_0x3fce80[_0x1abec7(0x1dd)],'favorite':_0x3fce80[_0x1abec7(0x19c)],'deleted':_0x3fce80[_0x1abec7(0x1e2)],'createTime':_0x3fce80[_0x1abec7(0x1d6)],'updateTime':_0x3fce80[_0x1abec7(0x1c1)]};}function detailArtifact(_0x296fbc){const _0x513583=a10_0x542a4f;return{'id':_0x296fbc['id'],'appCode':_0x296fbc['appCode'],'name':_0x296fbc[_0x513583(0x1c2)],'artifactType':_0x296fbc[_0x513583(0x1d8)],'source':_0x296fbc[_0x513583(0x1dd)],'favorite':_0x296fbc['favorite'],'deleted':_0x296fbc[_0x513583(0x1e2)],'content':_0x296fbc['content']??'','compiledContent':_0x296fbc['compiledContent'],'metadata':_0x296fbc[_0x513583(0x1b0)]??{},'createTime':_0x296fbc['createTime'],'updateTime':_0x296fbc[_0x513583(0x1c1)]};}function readFavoriteFlag(_0x4ed458){const _0xfc3854=a10_0x542a4f,_0xd7370=_0x4ed458[_0xfc3854(0x1d4)](_0xfc3854(0x19c));return _0xd7370===undefined||_0xd7370===null||_0xd7370===''?undefined:_0x4ed458['bool']('favorite');}const artifactList={'service':a10_0x542a4f(0x1df),'command':a10_0x542a4f(0x1c0),'description':'List\x20current-app\x20react_module\x20Artifacts','risk':a10_0x542a4f(0x1a0),'flags':[{'name':'source','type':a10_0x542a4f(0x1cc),'description':a10_0x542a4f(0x1d1)},{'name':a10_0x542a4f(0x19c),'type':'boolean','description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x609e6b){const _0x4fdf25=a10_0x542a4f,_0x5e93c0=await listRuntimeArtifacts(_0x609e6b[_0x4fdf25(0x1c5)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x609e6b[_0x4fdf25(0x1b4)](_0x4fdf25(0x1dd))?{'source':_0x609e6b[_0x4fdf25(0x1b4)](_0x4fdf25(0x1dd))}:{},...readFavoriteFlag(_0x609e6b)!==undefined?{'favorite':readFavoriteFlag(_0x609e6b)}:{}});return{'ok':!![],'data':{'total':_0x5e93c0[_0x4fdf25(0x1e8)],'items':_0x609e6b[_0x4fdf25(0x1ec)](_0x4fdf25(0x1c4))?_0x5e93c0:_0x5e93c0[_0x4fdf25(0x1af)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x542a4f(0x1df),'command':a10_0x542a4f(0x1ce),'description':a10_0x542a4f(0x1e5),'risk':a10_0x542a4f(0x1a0),'flags':[{...ID_FLAG,'description':a10_0x542a4f(0x1d3)}],async 'execute'(_0x46915c){const _0x3d7369=a10_0x542a4f,_0x265e8d=await getRuntimeArtifact(_0x46915c[_0x3d7369(0x1ad)]('id'),_0x46915c[_0x3d7369(0x1c5)]);return{'ok':!![],'data':detailArtifact(_0x265e8d)};}},artifactCreate={'service':'artifact','command':a10_0x542a4f(0x1a2),'description':a10_0x542a4f(0x1ab),'risk':a10_0x542a4f(0x1a9),'confirmationDescription':'保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x428c5c){const _0x21fe4f=a10_0x542a4f,_0x3bc1ab=buildArtifactInput(_0x428c5c),_0x3bc5db=await createRuntimeArtifact(_0x428c5c[_0x21fe4f(0x1c5)],_0x3bc1ab);return{'ok':!![],'data':detailArtifact(_0x3bc5db),'message':_0x21fe4f(0x1da)+_0x3bc5db['id']+(_0x3bc5db[_0x21fe4f(0x1c2)]?'\x20('+_0x3bc5db[_0x21fe4f(0x1c2)]+')':'')};},async 'dryRun'(_0x27689b){const _0x4e91cc=a10_0x542a4f,_0x54c54a=buildArtifactInput(_0x27689b);return dryRun('POST','/client/artifact/create')[_0x4e91cc(0x1bd)]({'appCode':_0x27689b['appCode'],..._0x54c54a})['description'](_0x4e91cc(0x1c3))[_0x4e91cc(0x1b9)]();},'writeEventSubject'(_0x56b924){const _0x548f72=a10_0x542a4f,_0x3e2d29=_0x56b924['data']?.['id'];if(typeof _0x3e2d29!==_0x548f72(0x1cc)&&typeof _0x3e2d29!==_0x548f72(0x1e7))return undefined;return{'kind':_0x548f72(0x1df),'id':String(_0x3e2d29),'action':_0x548f72(0x1a2)};}},artifactUpdate={'service':a10_0x542a4f(0x1df),'command':a10_0x542a4f(0x1ea),'description':'根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','risk':a10_0x542a4f(0x1a9),'confirmationDescription':a10_0x542a4f(0x1b5),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5890fb){const _0x3966a2=a10_0x542a4f,_0x468809=_0x5890fb[_0x3966a2(0x1ad)]('id'),_0x417bad=buildArtifactInput(_0x5890fb),_0x56732b=await updateRuntimeArtifact(_0x468809,_0x5890fb[_0x3966a2(0x1c5)],_0x417bad);return{'ok':!![],'data':detailArtifact(_0x56732b),'message':_0x3966a2(0x1c7)+_0x56732b['id']+(_0x56732b[_0x3966a2(0x1c2)]?'\x20('+_0x56732b[_0x3966a2(0x1c2)]+')':'')};},async 'dryRun'(_0x1ee7b6){const _0x5b6a49=a10_0x542a4f,_0x4a0d3b=_0x1ee7b6[_0x5b6a49(0x1ad)]('id'),_0x8cd3c9=buildArtifactInput(_0x1ee7b6);return dryRun(_0x5b6a49(0x1c9),_0x5b6a49(0x1b8)+_0x4a0d3b+_0x5b6a49(0x1d9))[_0x5b6a49(0x1bd)]({'appCode':_0x1ee7b6[_0x5b6a49(0x1c5)],..._0x8cd3c9})[_0x5b6a49(0x1a5)](_0x5b6a49(0x1d7)+_0x4a0d3b)[_0x5b6a49(0x1b9)]();},'writeEventSubject'(_0x47c338){const _0x2c797b=a10_0x542a4f,_0x1f0087=_0x47c338['data']?.['id'];if(typeof _0x1f0087!==_0x2c797b(0x1cc)&&typeof _0x1f0087!==_0x2c797b(0x1e7))return undefined;return{'kind':_0x2c797b(0x1df),'id':String(_0x1f0087),'action':_0x2c797b(0x1ea)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x149836=a10_0x3bce;function a10_0x2bc4(){const _0x39291f=['string','name','join','保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','trim','appCode','write','1015110SgrBwa','split','16JdXcUB','Artifact\x20source\x20file\x20is\x20blank.','deleted','33KokQJa','antd','react','object','file','File\x20path\x20is\x20required.','flag','lodash','.\x20Unsupported:\x20','/client/artifact/','update','utf8','filter','read','create','Artifact\x20ID','Updated\x20Artifact\x20','boolean','validation','10wNZKfI','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','updateTime','map','根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','File\x20is\x20not\x20a\x20regular\x20file:\x20','body','react_module','build','parse','verbose','@ant-design/icons','1820tNDuyV','number','dayjs','compiledContent','21361OIzAns','data','add','favorite','length','根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','isArray','react_module\x20imports\x20are\x20limited\x20to:\x20','47392wVSMjr','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','content','source','624786egrsTD','Invalid\x20JSON\x20for\x20--metadata:\x20','description','5QaDZAM','Artifact\x20display\x20name','POST','list','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','some','metadata','bool','4030356TgiilS','str','num','Preview:\x20create\x20react_module\x20Artifact','artifactType','AGENT','createTime','lastIndex','9691lxCOnS','248276SdVnfM','/client/artifact/create','artifact','--metadata\x20must\x20be\x20a\x20JSON\x20object.'];a10_0x2bc4=function(){return _0x39291f;};return a10_0x2bc4();}function a10_0x3bce(_0x5ca331,_0x38e3b4){_0x5ca331=_0x5ca331-0x1be;const _0x2bc4a2=a10_0x2bc4();let _0x3bce10=_0x2bc4a2[_0x5ca331];return _0x3bce10;}(function(_0x5d9b30,_0x4421af){const _0x4908b7=a10_0x3bce,_0x137ab5=_0x5d9b30();while(!![]){try{const _0x50ee8e=parseInt(_0x4908b7(0x20d))/0x1*(-parseInt(_0x4908b7(0x1fd))/0x2)+parseInt(_0x4908b7(0x1ea))/0x3*(-parseInt(_0x4908b7(0x1c2))/0x4)+-parseInt(_0x4908b7(0x1c9))/0x5*(parseInt(_0x4908b7(0x1c6))/0x6)+-parseInt(_0x4908b7(0x1da))/0x7*(parseInt(_0x4908b7(0x1e7))/0x8)+parseInt(_0x4908b7(0x1e5))/0x9+-parseInt(_0x4908b7(0x209))/0xa*(-parseInt(_0x4908b7(0x1d9))/0xb)+parseInt(_0x4908b7(0x1d1))/0xc;if(_0x50ee8e===_0x4421af)break;else _0x137ab5['push'](_0x137ab5['shift']());}catch(_0x1e1237){_0x137ab5['push'](_0x137ab5['shift']());}}}(a10_0x2bc4,0x300bb));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0x149836(0x204),ARTIFACT_SOURCE_AGENT=a10_0x149836(0x1d6),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x149836(0x1ec),'react-dom',a10_0x149836(0x1f1),a10_0x149836(0x20b),a10_0x149836(0x1eb),a10_0x149836(0x208)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a10_0x149836(0x1ee),'type':a10_0x149836(0x1de),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file'},ARTIFACT_NAME_FLAG={'name':a10_0x149836(0x1df),'type':'string','description':a10_0x149836(0x1ca)},METADATA_FLAG={'name':'metadata','type':a10_0x149836(0x1de),'description':a10_0x149836(0x1c3)};function isPlainObject(_0x2ad2b5){const _0x4e272e=a10_0x149836;return typeof _0x2ad2b5===_0x4e272e(0x1ed)&&_0x2ad2b5!==null&&!Array[_0x4e272e(0x1c0)](_0x2ad2b5);}function readSourceFile(_0x581563){const _0x43c08b=a10_0x149836;if(!_0x581563)throw CliErrors[_0x43c08b(0x1fc)](_0x43c08b(0x1ef));if(!existsSync(_0x581563))throw CliErrors[_0x43c08b(0x1fc)]('File\x20not\x20found:\x20'+_0x581563);if(!statSync(_0x581563)['isFile']())throw CliErrors[_0x43c08b(0x1fc)](_0x43c08b(0x202)+_0x581563);const _0x11182a=readFileSync(_0x581563,_0x43c08b(0x1f5));return validateReactModuleSource(_0x11182a),_0x11182a;}function parseMetadata(_0x305544){const _0x589104=a10_0x149836;if(!_0x305544)return undefined;let _0xa34b1;try{_0xa34b1=JSON[_0x589104(0x206)](_0x305544);}catch{throw CliErrors[_0x589104(0x1fc)](_0x589104(0x1c7)+_0x305544);}if(!isPlainObject(_0xa34b1))throw CliErrors['validation'](_0x589104(0x1dd));const _0x210181={..._0xa34b1};return delete _0x210181['compiledContent'],_0x210181;}function getPackageName(_0x1f116f){const _0x38dc11=a10_0x149836;if(_0x1f116f['startsWith']('@')){const [_0x1bba4a,_0x1ba3a0]=_0x1f116f[_0x38dc11(0x1e6)]('/');return _0x1bba4a&&_0x1ba3a0?_0x1bba4a+'/'+_0x1ba3a0:_0x1f116f;}return _0x1f116f[_0x38dc11(0x1e6)]('/')[0x0]||_0x1f116f;}function validateAllowedImports(_0x5efb54){const _0x4ef5a9=a10_0x149836,_0x16b1af=new Set();for(const _0x12968c of IMPORT_SOURCE_PATTERNS){_0x12968c[_0x4ef5a9(0x1d8)]=0x0;let _0x37ce28;while((_0x37ce28=_0x12968c['exec'](_0x5efb54))!==null){const _0x45c87c=_0x37ce28[0x1]?.[_0x4ef5a9(0x1e2)]();_0x45c87c&&_0x16b1af[_0x4ef5a9(0x20f)](_0x45c87c);}}const _0x54c06f=[..._0x16b1af]['map'](getPackageName)[_0x4ef5a9(0x1f6)](_0x3b7b61=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x3b7b61));if(_0x54c06f[_0x4ef5a9(0x1be)]>0x0)throw CliErrors['validation'](_0x4ef5a9(0x1c1)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x4ef5a9(0x1f2)+[...new Set(_0x54c06f)][_0x4ef5a9(0x1e0)](',\x20'));}export function validateReactModuleSource(_0x2c4544){const _0x11e578=a10_0x149836;if(!_0x2c4544[_0x11e578(0x1e2)]())throw CliErrors[_0x11e578(0x1fc)](_0x11e578(0x1e8));if(PAGE_LEVEL_PATTERNS[_0x11e578(0x1ce)](_0x1729a6=>_0x1729a6['test'](_0x2c4544)))throw CliErrors[_0x11e578(0x1fc)](_0x11e578(0x1fe));validateAllowedImports(_0x2c4544);}function buildArtifactInput(_0x27ee5f){const _0x49d516=a10_0x149836,_0x15102f=readSourceFile(_0x27ee5f[_0x49d516(0x1d2)](_0x49d516(0x1ee))),_0x42341a=_0x27ee5f['str'](_0x49d516(0x1df))[_0x49d516(0x1e2)](),_0x524926=parseMetadata(_0x27ee5f['str'](_0x49d516(0x1cf)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x42341a?{'name':_0x42341a}:{},'content':_0x15102f,..._0x524926?{'metadata':_0x524926}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x4433d9){const _0x1885db=a10_0x149836;return{'id':_0x4433d9['id'],'name':_0x4433d9[_0x1885db(0x1df)],'artifactType':_0x4433d9[_0x1885db(0x1d5)],'source':_0x4433d9[_0x1885db(0x1c5)],'favorite':_0x4433d9[_0x1885db(0x210)],'deleted':_0x4433d9[_0x1885db(0x1e9)],'createTime':_0x4433d9[_0x1885db(0x1d7)],'updateTime':_0x4433d9[_0x1885db(0x1ff)]};}function detailArtifact(_0x48b210){const _0x66854=a10_0x149836;return{'id':_0x48b210['id'],'appCode':_0x48b210[_0x66854(0x1e3)],'name':_0x48b210[_0x66854(0x1df)],'artifactType':_0x48b210['artifactType'],'source':_0x48b210[_0x66854(0x1c5)],'favorite':_0x48b210['favorite'],'deleted':_0x48b210[_0x66854(0x1e9)],'content':_0x48b210[_0x66854(0x1c4)]??'','compiledContent':_0x48b210[_0x66854(0x20c)],'metadata':_0x48b210[_0x66854(0x1cf)]??{},'createTime':_0x48b210[_0x66854(0x1d7)],'updateTime':_0x48b210[_0x66854(0x1ff)]};}function readFavoriteFlag(_0x3f2aaa){const _0x5bf45=a10_0x149836,_0x40943b=_0x3f2aaa[_0x5bf45(0x1f0)](_0x5bf45(0x210));return _0x40943b===undefined||_0x40943b===null||_0x40943b===''?undefined:_0x3f2aaa[_0x5bf45(0x1d0)]('favorite');}const artifactList={'service':'artifact','command':a10_0x149836(0x1cc),'description':'List\x20current-app\x20react_module\x20Artifacts','risk':a10_0x149836(0x1f7),'flags':[{'name':a10_0x149836(0x1c5),'type':a10_0x149836(0x1de),'description':a10_0x149836(0x1cd)},{'name':a10_0x149836(0x210),'type':a10_0x149836(0x1fb),'description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x2ffdfe){const _0x381a8a=a10_0x149836,_0xa0bf=await listRuntimeArtifacts(_0x2ffdfe[_0x381a8a(0x1e3)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x2ffdfe['str']('source')?{'source':_0x2ffdfe['str'](_0x381a8a(0x1c5))}:{},...readFavoriteFlag(_0x2ffdfe)!==undefined?{'favorite':readFavoriteFlag(_0x2ffdfe)}:{}});return{'ok':!![],'data':{'total':_0xa0bf['length'],'items':_0x2ffdfe[_0x381a8a(0x1d0)](_0x381a8a(0x207))?_0xa0bf:_0xa0bf[_0x381a8a(0x200)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':'detail','description':'Show\x20one\x20Artifact\x20by\x20id','risk':a10_0x149836(0x1f7),'flags':[{...ID_FLAG,'description':a10_0x149836(0x1f9)}],async 'execute'(_0x4660c1){const _0x58afc8=a10_0x149836,_0x1eb1b4=await getRuntimeArtifact(_0x4660c1['num']('id'),_0x4660c1[_0x58afc8(0x1e3)]);return{'ok':!![],'data':detailArtifact(_0x1eb1b4)};}},artifactCreate={'service':a10_0x149836(0x1dc),'command':a10_0x149836(0x1f8),'description':a10_0x149836(0x1bf),'risk':a10_0x149836(0x1e4),'confirmationDescription':'保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x241e12){const _0x3d3b72=a10_0x149836,_0x1af87d=buildArtifactInput(_0x241e12),_0x34c9c3=await createRuntimeArtifact(_0x241e12[_0x3d3b72(0x1e3)],_0x1af87d);return{'ok':!![],'data':detailArtifact(_0x34c9c3),'message':'Created\x20Artifact\x20'+_0x34c9c3['id']+(_0x34c9c3[_0x3d3b72(0x1df)]?'\x20('+_0x34c9c3['name']+')':'')};},async 'dryRun'(_0x3d004a){const _0x55d3f6=a10_0x149836,_0x4932ac=buildArtifactInput(_0x3d004a);return dryRun('POST',_0x55d3f6(0x1db))[_0x55d3f6(0x203)]({'appCode':_0x3d004a[_0x55d3f6(0x1e3)],..._0x4932ac})[_0x55d3f6(0x1c8)](_0x55d3f6(0x1d4))[_0x55d3f6(0x205)]();},'writeEventSubject'(_0x51194e){const _0xc757ec=a10_0x149836,_0x41e0b8=_0x51194e[_0xc757ec(0x20e)]?.['id'];if(typeof _0x41e0b8!==_0xc757ec(0x1de)&&typeof _0x41e0b8!==_0xc757ec(0x20a))return undefined;return{'kind':'artifact','id':String(_0x41e0b8),'action':_0xc757ec(0x1f8)};}},artifactUpdate={'service':'artifact','command':'update','description':a10_0x149836(0x201),'risk':a10_0x149836(0x1e4),'confirmationDescription':a10_0x149836(0x1e1),'flags':[{...ID_FLAG,'description':a10_0x149836(0x1f9)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3d2706){const _0x1ab9b8=a10_0x149836,_0x2a93c2=_0x3d2706[_0x1ab9b8(0x1d3)]('id'),_0x2da7ae=buildArtifactInput(_0x3d2706),_0x89801=await updateRuntimeArtifact(_0x2a93c2,_0x3d2706[_0x1ab9b8(0x1e3)],_0x2da7ae);return{'ok':!![],'data':detailArtifact(_0x89801),'message':_0x1ab9b8(0x1fa)+_0x89801['id']+(_0x89801[_0x1ab9b8(0x1df)]?'\x20('+_0x89801[_0x1ab9b8(0x1df)]+')':'')};},async 'dryRun'(_0x3e4bae){const _0xd58bf2=a10_0x149836,_0x5ace26=_0x3e4bae[_0xd58bf2(0x1d3)]('id'),_0x2eeda2=buildArtifactInput(_0x3e4bae);return dryRun(_0xd58bf2(0x1cb),_0xd58bf2(0x1f3)+_0x5ace26+'/update')[_0xd58bf2(0x203)]({'appCode':_0x3e4bae[_0xd58bf2(0x1e3)],..._0x2eeda2})[_0xd58bf2(0x1c8)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x5ace26)[_0xd58bf2(0x205)]();},'writeEventSubject'(_0xd6222b){const _0x316f44=a10_0x149836,_0xaf9f18=_0xd6222b[_0x316f44(0x20e)]?.['id'];if(typeof _0xaf9f18!==_0x316f44(0x1de)&&typeof _0xaf9f18!==_0x316f44(0x20a))return undefined;return{'kind':_0x316f44(0x1dc),'id':String(_0xaf9f18),'action':_0x316f44(0x1f4)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
@@ -1 +1 @@
1
- const a11_0x3b9453=a11_0x18f3;(function(_0x32bcf7,_0x50070b){const _0x10b34c=a11_0x18f3,_0xb105bc=_0x32bcf7();while(!![]){try{const _0x49e5fd=parseInt(_0x10b34c(0x17e))/0x1*(parseInt(_0x10b34c(0x15e))/0x2)+parseInt(_0x10b34c(0x188))/0x3+-parseInt(_0x10b34c(0x18a))/0x4*(-parseInt(_0x10b34c(0x182))/0x5)+-parseInt(_0x10b34c(0x189))/0x6+parseInt(_0x10b34c(0x16a))/0x7*(parseInt(_0x10b34c(0x157))/0x8)+-parseInt(_0x10b34c(0x16d))/0x9*(parseInt(_0x10b34c(0x180))/0xa)+-parseInt(_0x10b34c(0x184))/0xb;if(_0x49e5fd===_0x50070b)break;else _0xb105bc['push'](_0xb105bc['shift']());}catch(_0x1dea0e){_0xb105bc['push'](_0xb105bc['shift']());}}}(a11_0x5280,0xeb439));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';function a11_0x5280(){const _0xe9add9=['signal','POST','abort','trim','\x20auth\x20status','global','now','/device-auth?code=','code','networkError','588279XlsPNv','stderr','10rKceMM','parse','2253265tUeais','Invalid\x20access_key\x20returned\x20by\x20server.','14000624GwMTiw','log','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','stringify','2774865sIjksl','9163572ysVCIq','12IuyQBL','/.device-auth','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','write','Device\x20authorization\x20successful.','name','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','validation','project','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','Device\x20auth\x20API\x20error\x20(','Write\x20to\x20global\x20config\x20(default)','\x20config.','object','url-only','randomUUID','expired','After\x20authorizing,\x20re-run:\x20','utf8','getTime','once','Invalid\x20device\x20auth\x20response','AccessKey\x20saved\x20to\x20','auth','access_key','\x20remaining','nonInteractive','status','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','boolean','toISOString','application/json','apiError','2523848jiunlJ','通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','\x0dWaiting\x20for\x20authorization...\x20','cancelled','padStart','Device\x20authorization\x20cancelled.','aborted','2bJnVhc','str','data','Verify:\x20','lovrabet-cli','removeListener','将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','success','AbortError','string','global-default','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','35tFdFTm','floor','scope','6110199ifypAw','test','\x20auth\x20device','bool','accessKey','SIGINT','createdAt'];a11_0x5280=function(){return _0xe9add9;};return a11_0x5280();}import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x242094){const _0x11cba7=a11_0x18f3;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x242094[_0x11cba7(0x170)](_0x11cba7(0x179)),'explicitProject':_0x242094['bool'](_0x11cba7(0x192)),'policy':_0x11cba7(0x168)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x1eb1af=a11_0x18f3;return crypto[_0x1eb1af(0x199)]();}export function buildDeviceAuthUrl(_0x1bdb06,_0x5e4ffa,_0x2b851b=a11_0x3b9453(0x162)){const _0x406382=a11_0x3b9453;return _0x1bdb06+_0x406382(0x17b)+encodeURIComponent(_0x5e4ffa)+'&source='+encodeURIComponent(_0x2b851b);}export function getDeviceCodePath(){const _0x4d2b87=a11_0x3b9453;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x4d2b87(0x18b);}export function readStoredDeviceCode(){const _0x1ef57b=a11_0x3b9453,_0x39cc28=getDeviceCodePath();if(!existsSync(_0x39cc28))return null;try{const _0x41de19=readFileSync(_0x39cc28,{'encoding':'utf8'}),_0x39dfeb=JSON[_0x1ef57b(0x181)](_0x41de19);if(_0x39dfeb&&typeof _0x39dfeb['code']==='string'&&typeof _0x39dfeb[_0x1ef57b(0x173)]===_0x1ef57b(0x167)&&(_0x39dfeb['scope']===_0x1ef57b(0x179)||_0x39dfeb[_0x1ef57b(0x16c)]===_0x1ef57b(0x192)))return _0x39dfeb;}catch{}return null;}export function writeStoredDeviceCode(_0x24f9c6,_0x36ce85){const _0x312165=a11_0x3b9453,_0x58340d=getDeviceCodePath(),_0x20c27a=dirname(_0x58340d);!existsSync(_0x20c27a)&&mkdirSync(_0x20c27a,{'recursive':!![]});const _0x34344a={'code':_0x24f9c6,'createdAt':new Date()[_0x312165(0x154)](),'scope':_0x36ce85};writeFileSync(_0x58340d,JSON['stringify'](_0x34344a),{'encoding':_0x312165(0x19c),'mode':0x180});}export function deleteStoredDeviceCode(){const _0xa60b96=getDeviceCodePath();try{unlinkSync(_0xa60b96);}catch{}}export function isStoredDeviceCodeExpired(_0x324e8d){const _0x3a9b65=a11_0x3b9453;return Date[_0x3a9b65(0x17a)]()-new Date(_0x324e8d[_0x3a9b65(0x173)])[_0x3a9b65(0x19d)]()>DEVICE_CODE_TTL_MS;}function a11_0x18f3(_0x359724,_0x35edc2){_0x359724=_0x359724-0x14a;const _0x5280df=a11_0x5280();let _0x18f335=_0x5280df[_0x359724];return _0x18f335;}export async function fetchDeviceToken(_0x580fea,_0x102641){const _0x2d4867=a11_0x3b9453,_0xc21f00=_0x580fea+'/api/device-auth/token',_0x17d7a0=new AbortController(),_0x94c12=setTimeout(()=>_0x17d7a0[_0x2d4867(0x176)](),0x2710),_0xa9de8a=await fetch(_0xc21f00,{'method':_0x2d4867(0x175),'headers':{'Content-Type':_0x2d4867(0x155)},'body':JSON[_0x2d4867(0x187)]({'code':_0x102641}),'signal':_0x17d7a0[_0x2d4867(0x174)]});clearTimeout(_0x94c12);if(!_0xa9de8a['ok'])throw CliErrors[_0x2d4867(0x17d)]('Device\x20auth\x20API\x20returned\x20HTTP\x20'+_0xa9de8a[_0x2d4867(0x151)]);const _0x484b16=await _0xa9de8a['json'](),_0x3a444c=_0x484b16[_0x2d4867(0x160)]&&typeof _0x484b16[_0x2d4867(0x160)]===_0x2d4867(0x197)?_0x484b16[_0x2d4867(0x160)]:_0x484b16;if(!_0x3a444c||typeof _0x3a444c[_0x2d4867(0x151)]!=='string')throw CliErrors['apiError'](_0x2d4867(0x14b));return{'status':_0x3a444c[_0x2d4867(0x151)],'access_key':typeof _0x3a444c['access_key']===_0x2d4867(0x167)?_0x3a444c[_0x2d4867(0x14e)]:undefined};}export async function pollDeviceToken(_0x26ca1c,_0x5a6a10,_0x28b01e){const _0x350955=a11_0x3b9453;let _0x4f97dd=0x0;for(let _0x2ea4a0=0x0;_0x2ea4a0<MAX_POLLS;_0x2ea4a0++){if(_0x28b01e[_0x350955(0x15d)])throw CliErrors[_0x350955(0x15a)](_0x350955(0x15c));let _0x253211;try{_0x253211=await fetchDeviceToken(_0x26ca1c,_0x5a6a10);}catch(_0x52fbd4){if(_0x52fbd4 instanceof Error&&_0x52fbd4[_0x350955(0x18f)]===_0x350955(0x166))throw CliErrors[_0x350955(0x15a)](_0x350955(0x15c));_0x4f97dd++;if(_0x4f97dd>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors['networkError'](_0x350955(0x169));writeCliSideChannelLine(_0x350955(0x194)+_0x4f97dd+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+'),\x20retrying...'),await sleep(POLL_INTERVAL_MS);continue;}_0x4f97dd=0x0;if(_0x253211['status']===_0x350955(0x165)){if(!_0x253211['access_key'])throw CliErrors['apiError'](_0x350955(0x183));return _0x253211[_0x350955(0x14e)];}if(_0x253211[_0x350955(0x151)]===_0x350955(0x19a)){deleteStoredDeviceCode();throw CliErrors['validation']('Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}const _0x32bb1d=(_0x2ea4a0+0x1)*POLL_INTERVAL_MS,_0x23991d=DEVICE_CODE_TTL_MS-_0x32bb1d,_0x50fa55=Math[_0x350955(0x16b)](_0x23991d/0xea60),_0x2fe4bc=Math[_0x350955(0x16b)](_0x23991d%0xea60/0x3e8);process[_0x350955(0x17f)][_0x350955(0x18d)](_0x350955(0x159)+_0x50fa55+':'+String(_0x2fe4bc)[_0x350955(0x15b)](0x2,'0')+_0x350955(0x14f)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x350955(0x191)](_0x350955(0x18c));}function sleep(_0x546427){return new Promise(_0x71d0ea=>setTimeout(_0x71d0ea,_0x546427));}export const authDeviceDefinition={'service':a11_0x3b9453(0x14d),'command':'device','description':a11_0x3b9453(0x158),'risk':'write','confirmationDescription':a11_0x3b9453(0x164),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x3b9453(0x179),'type':a11_0x3b9453(0x153),'description':a11_0x3b9453(0x195),'default':!![]},{'name':a11_0x3b9453(0x192),'type':'boolean','description':'Write\x20to\x20project\x20config','default':![]},{'name':'source','type':a11_0x3b9453(0x167),'description':a11_0x3b9453(0x190),'default':'lovrabet-cli'},{'name':a11_0x3b9453(0x198),'type':a11_0x3b9453(0x153),'description':a11_0x3b9453(0x152),'default':![]}],async 'execute'(_0x3c310a){const _0x378929=a11_0x3b9453,_0x4bfd47=resolveAuthScopeFlags(_0x3c310a),_0x4290dd=_0x4bfd47['global']?_0x378929(0x179):_0x378929(0x192),_0x6fa33e=readScopedConfig(_0x4bfd47);if(_0x6fa33e[_0x378929(0x171)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x45dfb3=(_0x3c310a[_0x378929(0x15f)]('source')||'lovrabet-cli')[_0x378929(0x177)](),_0x506d48=getUserDomain(),_0x184c27=readStoredDeviceCode(),_0xa98a67=_0x184c27&&!isStoredDeviceCodeExpired(_0x184c27)?_0x184c27[_0x378929(0x17c)]:((()=>{const _0x1a14d8=generateDeviceCode();return writeStoredDeviceCode(_0x1a14d8,_0x4290dd),_0x1a14d8;})()),_0x30addd=buildDeviceAuthUrl(_0x506d48,_0xa98a67,_0x45dfb3);if(_0x3c310a['bool'](_0x378929(0x198)))return console[_0x378929(0x185)](_0x30addd),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x30addd),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x378929(0x186));if(_0x3c310a[_0x378929(0x150)])return writeCliSideChannelLine(_0x378929(0x19b)+CLI_BIN_NAME+_0x378929(0x16f)),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine(_0x378929(0x193));const _0x34af76=new AbortController(),_0x1fcd0a=()=>{const _0x4eba64=_0x378929;_0x34af76[_0x4eba64(0x176)](),process[_0x4eba64(0x163)](_0x4eba64(0x172),_0x1fcd0a);};process[_0x378929(0x14a)](_0x378929(0x172),_0x1fcd0a);let _0x22c2cb;try{_0x22c2cb=await pollDeviceToken(_0x506d48,_0xa98a67,_0x34af76[_0x378929(0x174)]);}finally{process[_0x378929(0x163)](_0x378929(0x172),_0x1fcd0a);}if(!ACCESS_KEY_PATTERN[_0x378929(0x16e)](_0x22c2cb))throw CliErrors[_0x378929(0x156)](_0x378929(0x183));const _0x267978=readScopedConfig(_0x4bfd47);return _0x267978[_0x378929(0x171)]=_0x22c2cb,writeScopedConfig(_0x267978,_0x4bfd47),deleteStoredDeviceCode(),process[_0x378929(0x17f)][_0x378929(0x18d)]('\x0a'),writeCliSideChannelLine(_0x378929(0x14c)+_0x4290dd+_0x378929(0x196)),writeCliSideChannelLine(_0x378929(0x161)+CLI_BIN_NAME+_0x378929(0x178)),{'ok':!![],'message':_0x378929(0x18e)};}};
1
+ const a11_0x1d4b7b=a11_0x6b65;(function(_0x5c3c8c,_0x413343){const _0x14173d=a11_0x6b65,_0x412bc5=_0x5c3c8c();while(!![]){try{const _0x106db2=parseInt(_0x14173d(0xa5))/0x1+parseInt(_0x14173d(0x84))/0x2*(parseInt(_0x14173d(0xa6))/0x3)+parseInt(_0x14173d(0xaf))/0x4*(-parseInt(_0x14173d(0xa1))/0x5)+-parseInt(_0x14173d(0xb6))/0x6*(-parseInt(_0x14173d(0xa3))/0x7)+parseInt(_0x14173d(0x95))/0x8*(parseInt(_0x14173d(0xba))/0x9)+-parseInt(_0x14173d(0xb8))/0xa+parseInt(_0x14173d(0xa4))/0xb*(-parseInt(_0x14173d(0xa9))/0xc);if(_0x106db2===_0x413343)break;else _0x412bc5['push'](_0x412bc5['shift']());}catch(_0x3bcf7b){_0x412bc5['push'](_0x412bc5['shift']());}}}(a11_0x3a4c,0x4f6f4));function a11_0x3a4c(){const _0x25448b=['App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','AbortError','35dcdsZE','),\x20retrying...','21prVAPW','381447CQMUvM','438585mPQYum','66UghDJG','trim','removeListener','156qTcxHB','lovrabet-cli','json','AccessKey\x20saved\x20to\x20','validation','createdAt','96528tvKAMO','code','/api/device-auth/token','networkError','bool','cancelled','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','239562xFCeBn','Device\x20authorization\x20successful.','4438690zcHVUE','\x20remaining','90ffYsrm','str','nonInteractive','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','padStart','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','\x20auth\x20device','Device\x20auth\x20API\x20returned\x20HTTP\x20','status','floor','parse','SIGINT','Write\x20to\x20project\x20config','apiError','accessKey','Invalid\x20access_key\x20returned\x20by\x20server.','Device\x20authorization\x20cancelled.','abort','stringify','global','signal','url-only','\x20config.','27802kZovjf','Write\x20to\x20global\x20config\x20(default)','string','scope','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','access_key','randomUUID','auth','After\x20authorizing,\x20re-run:\x20','write','project','将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','boolean','source','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','device','application/json','419816iPjVPu','Device\x20auth\x20API\x20error\x20(','success','once','aborted','utf8','object','global-default','POST','/.device-auth'];a11_0x3a4c=function(){return _0x25448b;};return a11_0x3a4c();}import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x2b1d58){const _0x164a4b=a11_0x6b65;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2b1d58['bool'](_0x164a4b(0xcd)),'explicitProject':_0x2b1d58[_0x164a4b(0xb3)](_0x164a4b(0x8e)),'policy':_0x164a4b(0x9c)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x517677=a11_0x6b65;return crypto[_0x517677(0x8a)]();}export function buildDeviceAuthUrl(_0x32f710,_0x23556b,_0x68adb5=a11_0x1d4b7b(0xaa)){return _0x32f710+'/device-auth?code='+encodeURIComponent(_0x23556b)+'&source='+encodeURIComponent(_0x68adb5);}export function getDeviceCodePath(){const _0x29aecd=a11_0x1d4b7b;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x29aecd(0x9e);}function a11_0x6b65(_0xe80f21,_0x15b197){_0xe80f21=_0xe80f21-0x83;const _0x3a4ca4=a11_0x3a4c();let _0x6b6563=_0x3a4ca4[_0xe80f21];return _0x6b6563;}export function readStoredDeviceCode(){const _0x2b3f7f=a11_0x1d4b7b,_0xf5944b=getDeviceCodePath();if(!existsSync(_0xf5944b))return null;try{const _0x5540c7=readFileSync(_0xf5944b,{'encoding':_0x2b3f7f(0x9a)}),_0x438640=JSON[_0x2b3f7f(0xc4)](_0x5540c7);if(_0x438640&&typeof _0x438640['code']===_0x2b3f7f(0x86)&&typeof _0x438640[_0x2b3f7f(0xae)]===_0x2b3f7f(0x86)&&(_0x438640[_0x2b3f7f(0x87)]===_0x2b3f7f(0xcd)||_0x438640[_0x2b3f7f(0x87)]==='project'))return _0x438640;}catch{}return null;}export function writeStoredDeviceCode(_0x4b79f1,_0x5a1e6c){const _0x40f43c=a11_0x1d4b7b,_0x25a6e9=getDeviceCodePath(),_0x2b0c1a=dirname(_0x25a6e9);!existsSync(_0x2b0c1a)&&mkdirSync(_0x2b0c1a,{'recursive':!![]});const _0x456954={'code':_0x4b79f1,'createdAt':new Date()['toISOString'](),'scope':_0x5a1e6c};writeFileSync(_0x25a6e9,JSON[_0x40f43c(0xcc)](_0x456954),{'encoding':_0x40f43c(0x9a),'mode':0x180});}export function deleteStoredDeviceCode(){const _0xf27e4e=getDeviceCodePath();try{unlinkSync(_0xf27e4e);}catch{}}export function isStoredDeviceCodeExpired(_0x4f463f){const _0x375bc8=a11_0x1d4b7b;return Date['now']()-new Date(_0x4f463f[_0x375bc8(0xae)])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x3df7ac,_0x2099e4){const _0x469a45=a11_0x1d4b7b,_0x5cf889=_0x3df7ac+_0x469a45(0xb1),_0x32384f=new AbortController(),_0x55de7c=setTimeout(()=>_0x32384f[_0x469a45(0xcb)](),0x2710),_0x4e91e0=await fetch(_0x5cf889,{'method':_0x469a45(0x9d),'headers':{'Content-Type':_0x469a45(0x94)},'body':JSON['stringify']({'code':_0x2099e4}),'signal':_0x32384f[_0x469a45(0xce)]});clearTimeout(_0x55de7c);if(!_0x4e91e0['ok'])throw CliErrors[_0x469a45(0xb2)](_0x469a45(0xc1)+_0x4e91e0['status']);const _0x554d72=await _0x4e91e0[_0x469a45(0xab)](),_0x1d7597=_0x554d72['data']&&typeof _0x554d72['data']===_0x469a45(0x9b)?_0x554d72['data']:_0x554d72;if(!_0x1d7597||typeof _0x1d7597[_0x469a45(0xc2)]!==_0x469a45(0x86))throw CliErrors[_0x469a45(0xc7)]('Invalid\x20device\x20auth\x20response');return{'status':_0x1d7597['status'],'access_key':typeof _0x1d7597['access_key']===_0x469a45(0x86)?_0x1d7597[_0x469a45(0x89)]:undefined};}export async function pollDeviceToken(_0x42b151,_0x2b8220,_0x26ae17){const _0x47203c=a11_0x1d4b7b;let _0x580504=0x0;for(let _0x262d4f=0x0;_0x262d4f<MAX_POLLS;_0x262d4f++){if(_0x26ae17[_0x47203c(0x99)])throw CliErrors[_0x47203c(0xb4)](_0x47203c(0xca));let _0x1d1496;try{_0x1d1496=await fetchDeviceToken(_0x42b151,_0x2b8220);}catch(_0x249ade){if(_0x249ade instanceof Error&&_0x249ade['name']===_0x47203c(0xa0))throw CliErrors[_0x47203c(0xb4)](_0x47203c(0xca));_0x580504++;if(_0x580504>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x47203c(0xb2)](_0x47203c(0xbd));writeCliSideChannelLine(_0x47203c(0x96)+_0x580504+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x47203c(0xa2)),await sleep(POLL_INTERVAL_MS);continue;}_0x580504=0x0;if(_0x1d1496[_0x47203c(0xc2)]===_0x47203c(0x97)){if(!_0x1d1496['access_key'])throw CliErrors[_0x47203c(0xc7)](_0x47203c(0xc9));return _0x1d1496[_0x47203c(0x89)];}if(_0x1d1496[_0x47203c(0xc2)]==='expired'){deleteStoredDeviceCode();throw CliErrors[_0x47203c(0xad)]('Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}const _0x815bc4=(_0x262d4f+0x1)*POLL_INTERVAL_MS,_0x17187d=DEVICE_CODE_TTL_MS-_0x815bc4,_0x4af1ce=Math[_0x47203c(0xc3)](_0x17187d/0xea60),_0xe33a11=Math[_0x47203c(0xc3)](_0x17187d%0xea60/0x3e8);process['stderr'][_0x47203c(0x8d)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x4af1ce+':'+String(_0xe33a11)[_0x47203c(0xbe)](0x2,'0')+_0x47203c(0xb9)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x47203c(0xad)](_0x47203c(0xb5));}function sleep(_0x211cd6){return new Promise(_0x38a36c=>setTimeout(_0x38a36c,_0x211cd6));}export const authDeviceDefinition={'service':a11_0x1d4b7b(0x8b),'command':a11_0x1d4b7b(0x93),'description':'通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','risk':a11_0x1d4b7b(0x8d),'confirmationDescription':a11_0x1d4b7b(0x8f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x1d4b7b(0xcd),'type':'boolean','description':a11_0x1d4b7b(0x85),'default':!![]},{'name':a11_0x1d4b7b(0x8e),'type':'boolean','description':a11_0x1d4b7b(0xc6),'default':![]},{'name':a11_0x1d4b7b(0x91),'type':a11_0x1d4b7b(0x86),'description':a11_0x1d4b7b(0x9f),'default':a11_0x1d4b7b(0xaa)},{'name':'url-only','type':a11_0x1d4b7b(0x90),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x3d2b73){const _0x307558=a11_0x1d4b7b,_0xa3237e=resolveAuthScopeFlags(_0x3d2b73),_0x40a781=_0xa3237e[_0x307558(0xcd)]?_0x307558(0xcd):_0x307558(0x8e),_0x2cf976=readScopedConfig(_0xa3237e);if(_0x2cf976[_0x307558(0xc8)])return{'ok':!![],'message':_0x307558(0x88)};const _0x5f5759=(_0x3d2b73[_0x307558(0xbb)](_0x307558(0x91))||'lovrabet-cli')[_0x307558(0xa7)](),_0x3fbb7d=getUserDomain(),_0x5beabc=readStoredDeviceCode(),_0x16d808=_0x5beabc&&!isStoredDeviceCodeExpired(_0x5beabc)?_0x5beabc[_0x307558(0xb0)]:((()=>{const _0x5baf30=generateDeviceCode();return writeStoredDeviceCode(_0x5baf30,_0x40a781),_0x5baf30;})()),_0x170367=buildDeviceAuthUrl(_0x3fbb7d,_0x16d808,_0x5f5759);if(_0x3d2b73[_0x307558(0xb3)](_0x307558(0xcf)))return console['log'](_0x170367),{'ok':!![]};writeCliSideChannelLine(_0x307558(0xbf)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x170367),writeCliSideChannelLine(''),writeCliSideChannelLine('The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.');if(_0x3d2b73[_0x307558(0xbc)])return writeCliSideChannelLine(_0x307558(0x8c)+CLI_BIN_NAME+_0x307558(0xc0)),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine(_0x307558(0x92));const _0x154bc1=new AbortController(),_0x26c778=()=>{const _0x378307=_0x307558;_0x154bc1[_0x378307(0xcb)](),process[_0x378307(0xa8)]('SIGINT',_0x26c778);};process[_0x307558(0x98)](_0x307558(0xc5),_0x26c778);let _0x4aeee8;try{_0x4aeee8=await pollDeviceToken(_0x3fbb7d,_0x16d808,_0x154bc1[_0x307558(0xce)]);}finally{process[_0x307558(0xa8)]('SIGINT',_0x26c778);}if(!ACCESS_KEY_PATTERN['test'](_0x4aeee8))throw CliErrors[_0x307558(0xc7)]('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x4af153=readScopedConfig(_0xa3237e);return _0x4af153[_0x307558(0xc8)]=_0x4aeee8,writeScopedConfig(_0x4af153,_0xa3237e),deleteStoredDeviceCode(),process['stderr'][_0x307558(0x8d)]('\x0a'),writeCliSideChannelLine(_0x307558(0xac)+_0x40a781+_0x307558(0x83)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x307558(0xb7)};}};