@lovrabet/lovrabet-cli 2.2.6 → 2.2.7-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 (158) 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.js +1 -1
  140. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  141. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  142. package/lib/skills/runtime-skill-sync/push.js +1 -1
  143. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  144. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  145. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  146. package/lib/skills/runtime-skill-sync.js +1 -1
  147. package/lib/skills/skill-presence.js +1 -1
  148. package/lib/utils/apply-jq-filter.js +1 -1
  149. package/lib/utils/logger.js +1 -1
  150. package/lib/utils/lossless-json.js +1 -1
  151. package/lib/utils/params.js +1 -1
  152. package/lib/utils/platform.js +1 -1
  153. package/lib/utils/update-notice.js +1 -1
  154. package/lib/utils/version.js +1 -1
  155. package/lib/utils/write-cli-side-channel.js +1 -1
  156. package/package.json +1 -1
  157. package/skills/lovrabet/SKILL.md +1 -1
  158. package/skills/lovrabet.manifest.json +3 -3
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (function(_0x25ed0a,_0x347444){const _0x40d8ab=a0_0x5997,_0x53938e=_0x25ed0a();while(!![]){try{const _0xc63fa8=-parseInt(_0x40d8ab(0x199))/0x1+-parseInt(_0x40d8ab(0x19f))/0x2*(parseInt(_0x40d8ab(0x198))/0x3)+-parseInt(_0x40d8ab(0x197))/0x4*(parseInt(_0x40d8ab(0x1b3))/0x5)+parseInt(_0x40d8ab(0x1b4))/0x6+parseInt(_0x40d8ab(0x1a9))/0x7+parseInt(_0x40d8ab(0x1a8))/0x8+parseInt(_0x40d8ab(0x1ac))/0x9;if(_0xc63fa8===_0x347444)break;else _0x53938e['push'](_0x53938e['shift']());}catch(_0x24d29d){_0x53938e['push'](_0x53938e['shift']());}}}(a0_0x2bb4,0x4df9a));import{jsx as a0_0xc1d42c}from'react/jsx-runtime';import a0_0xebb779 from'meow';import{render}from'ink';function a0_0x5997(_0x51e676,_0x3bace2){_0x51e676=_0x51e676-0x18e;const _0x2bb471=a0_0x2bb4();let _0x599772=_0x2bb471[_0x51e676];return _0x599772;}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_0x2bb4(){const _0xe7874a=['validation','assign','error','original','1159464McJmOB','311913oauebk','exitCode','write','4164984znJwaM',':\x20--','slice','log','stderr','defaultCommand','hint','802605hYfmpt','3335076OgDwDP','flatMap','ExitPromptError','exit','unknownCommand','message','ERR_STREAM_DESTROYED','definition','\x0aCancelled.\x0a','code','ERR_USE_AFTER_CLOSE','flags','8aIqUUn','453ynEyeP','519970FJfKTl','input','Hint:\x20','\x20->\x20--','name','args','632dlWWjN','[preparse]\x20','handler','help','corrected'];a0_0x2bb4=function(){return _0xe7874a;};return a0_0x2bb4();}import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0xebb779(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()['catch'](handleError);async function main(){try{await run();}catch(_0x2bae4d){handleError(_0x2bae4d);}}async function run(){const _0x3d71fa=a0_0x5997;let _0x32de8f=cli[_0x3d71fa(0x19a)][0x0],_0x2aac36=cli[_0x3d71fa(0x19a)][0x1];const _0x40ca69=cli[_0x3d71fa(0x196)];try{const {correctFlags:_0x87c2ba}=await import('./framework/preparse.js'),_0x47657b=getAllDefinitions()[_0x3d71fa(0x1b5)](_0x2860ea=>_0x2860ea[_0x3d71fa(0x196)]??[]),{flags:_0xac9277,corrections:_0x48ff19}=_0x87c2ba(_0x40ca69,_0x47657b);if(_0x48ff19['length']>0x0){for(const _0x55dd73 of _0x48ff19){process[_0x3d71fa(0x1b0)][_0x3d71fa(0x1ab)](_0x3d71fa(0x1a0)+_0x55dd73[_0x3d71fa(0x1a1)]+_0x3d71fa(0x1ad)+_0x55dd73[_0x3d71fa(0x1a7)]+_0x3d71fa(0x19c)+_0x55dd73[_0x3d71fa(0x1a3)]+'\x0a');}Object[_0x3d71fa(0x1a5)](_0x40ca69,_0xac9277);}}catch{}if(!_0x32de8f){const {waitUntilExit:_0x3e57f3}=render(a0_0xc1d42c(Help,{}));await _0x3e57f3();return;}const _0x1f11e5=resolveRemovedCommand(_0x32de8f,_0x2aac36);if(_0x1f11e5)throw CliErrors[_0x3d71fa(0x1a4)](_0x1f11e5[_0x3d71fa(0x190)],_0x1f11e5[_0x3d71fa(0x1b2)]);if(!isKnownService(_0x32de8f)){const _0xc48eda=resolveDynamicServiceCommand(cli[_0x3d71fa(0x19a)],_0x40ca69);if(_0xc48eda){if(_0x40ca69[_0x3d71fa(0x1a2)]){console[_0x3d71fa(0x1af)](generateCommandHelp(_0xc48eda[_0x3d71fa(0x192)]));return;}Object[_0x3d71fa(0x1a5)](_0x40ca69,_0xc48eda[_0x3d71fa(0x196)]);const _0x4f512f=buildConfigFromFlags(_0x40ca69);await initGlobalEnvironment(_0x4f512f);const _0xd3c912=createPipelineEnv(_0x4f512f,_0x40ca69);_0xd3c912[_0x3d71fa(0x19e)]=_0xc48eda[_0x3d71fa(0x19e)],await runCommand(_0xc48eda[_0x3d71fa(0x192)],_0xd3c912);return;}if(_0x40ca69['help']){const _0x2131d5=generateDynamicServiceHelp(_0x32de8f);if(_0x2131d5){console['log'](_0x2131d5);return;}}const {waitUntilExit:_0x18762f}=render(a0_0xc1d42c(Help,{}));await _0x18762f();return;}const _0x145885=getServiceEntry(_0x32de8f);if(!_0x2aac36){if(_0x40ca69[_0x3d71fa(0x1a2)]){console['log'](generateServiceHelp(_0x32de8f));return;}if(_0x145885['defaultCommand'])_0x2aac36=_0x145885[_0x3d71fa(0x1b1)];else{console[_0x3d71fa(0x1af)](generateServiceHelp(_0x32de8f));return;}}const _0x2fa57b=findDefinition(_0x32de8f,_0x2aac36);!_0x2fa57b&&(console[_0x3d71fa(0x1af)](generateServiceHelp(_0x32de8f)),handleError(CliErrors[_0x3d71fa(0x18f)](_0x32de8f+'\x20'+_0x2aac36)));if(_0x40ca69[_0x3d71fa(0x1a2)]){console[_0x3d71fa(0x1af)](generateCommandHelp(_0x2fa57b));return;}const _0x22f29f=buildConfigFromFlags(_0x40ca69);await initGlobalEnvironment(_0x22f29f);const _0x55dfdc=createPipelineEnv(_0x22f29f,_0x40ca69);_0x55dfdc['args']=cli[_0x3d71fa(0x19a)][_0x3d71fa(0x1ae)](0x2),await runCommand(_0x2fa57b,_0x55dfdc);}function handleError(_0x5cc6cf){const _0x25a146=a0_0x5997;if(_0x5cc6cf instanceof CliError){_0x5cc6cf['code']==='cancelled'&&(process[_0x25a146(0x1b0)][_0x25a146(0x1ab)](_0x25a146(0x193)),process['exit'](0x0));console[_0x25a146(0x1a6)]('Error:\x20'+_0x5cc6cf[_0x25a146(0x190)]);if(_0x5cc6cf[_0x25a146(0x1b2)])console[_0x25a146(0x1a6)](_0x25a146(0x19b)+_0x5cc6cf[_0x25a146(0x1b2)]);process[_0x25a146(0x18e)](_0x5cc6cf[_0x25a146(0x1aa)]);}isUserCancellation(_0x5cc6cf)&&(process[_0x25a146(0x1b0)][_0x25a146(0x1ab)](_0x25a146(0x193)),process[_0x25a146(0x18e)](0x0)),console[_0x25a146(0x1a6)]('Unexpected\x20error:',_0x5cc6cf),process[_0x25a146(0x18e)](0x1);}function isUserCancellation(_0x2b9b02){const _0x326c8a=a0_0x5997;if(!(_0x2b9b02 instanceof Error))return![];if(_0x2b9b02[_0x326c8a(0x19d)]===_0x326c8a(0x1b6))return!![];if(_0x2b9b02[_0x326c8a(0x194)]===_0x326c8a(0x195))return!![];if(_0x2b9b02[_0x326c8a(0x194)]===_0x326c8a(0x191))return!![];return![];}
2
+ function a0_0x276b(){const _0x10a123=['unknownCommand','slice','ERR_USE_AFTER_CLOSE','message','6418648pCSrfQ','550869CApHEq','original','\x0aCancelled.\x0a','help','117345EUYbXg','flatMap','./framework/preparse.js','6kctdSh','ERR_STREAM_DESTROYED','code','13113765SaAYNE','ExitPromptError','hint','corrected','Unexpected\x20error:','[preparse]\x20','input','write','52AFJNqQ','cancelled','Hint:\x20','14UsBnWp','flags','definition','error','validation','186695tklVCa','name','log','stderr','catch','110ueOhYQ','exit','1965858MkJnls','args','length','exitCode','2612687HHsDgh','Error:\x20','defaultCommand'];a0_0x276b=function(){return _0x10a123;};return a0_0x276b();}const a0_0x5bccba=a0_0x5365;(function(_0xbb6f52,_0x1cbad2){const _0x441526=a0_0x5365,_0x261198=_0xbb6f52();while(!![]){try{const _0x2f9fe4=-parseInt(_0x441526(0xbb))/0x1+-parseInt(_0x441526(0xc2))/0x2*(parseInt(_0x441526(0xbf))/0x3)+parseInt(_0x441526(0xa0))/0x4*(parseInt(_0x441526(0xa8))/0x5)+-parseInt(_0x441526(0xaf))/0x6*(-parseInt(_0x441526(0xa3))/0x7)+-parseInt(_0x441526(0xba))/0x8+-parseInt(_0x441526(0x98))/0x9+parseInt(_0x441526(0xad))/0xa*(parseInt(_0x441526(0xb3))/0xb);if(_0x2f9fe4===_0x1cbad2)break;else _0x261198['push'](_0x261198['shift']());}catch(_0x135808){_0x261198['push'](_0x261198['shift']());}}}(a0_0x276b,0xc9996));import{jsx as a0_0x2538f9}from'react/jsx-runtime';import a0_0x109d7c 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_0x109d7c(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x5bccba(0xac)](handleError);async function main(){try{await run();}catch(_0x46d2d5){handleError(_0x46d2d5);}}async function run(){const _0x30cd1a=a0_0x5bccba;let _0x5e9a1a=cli[_0x30cd1a(0x9e)][0x0],_0x5c93ae=cli[_0x30cd1a(0x9e)][0x1];const _0x37856d=cli[_0x30cd1a(0xa4)];try{const {correctFlags:_0x936fb1}=await import(_0x30cd1a(0xc1)),_0x4c3376=getAllDefinitions()[_0x30cd1a(0xc0)](_0x290559=>_0x290559[_0x30cd1a(0xa4)]??[]),{flags:_0x42de14,corrections:_0x3e159c}=_0x936fb1(_0x37856d,_0x4c3376);if(_0x3e159c[_0x30cd1a(0xb1)]>0x0){for(const _0xce299f of _0x3e159c){process[_0x30cd1a(0xab)][_0x30cd1a(0x9f)](_0x30cd1a(0x9d)+_0xce299f['handler']+':\x20--'+_0xce299f[_0x30cd1a(0xbc)]+'\x20->\x20--'+_0xce299f[_0x30cd1a(0x9b)]+'\x0a');}Object['assign'](_0x37856d,_0x42de14);}}catch{}if(!_0x5e9a1a){const {waitUntilExit:_0x594330}=render(a0_0x2538f9(Help,{}));await _0x594330();return;}const _0x2150c2=resolveRemovedCommand(_0x5e9a1a,_0x5c93ae);if(_0x2150c2)throw CliErrors[_0x30cd1a(0xa7)](_0x2150c2[_0x30cd1a(0xb9)],_0x2150c2[_0x30cd1a(0x9a)]);if(!isKnownService(_0x5e9a1a)){const _0x7629ae=resolveDynamicServiceCommand(cli[_0x30cd1a(0x9e)],_0x37856d);if(_0x7629ae){if(_0x37856d['help']){console[_0x30cd1a(0xaa)](generateCommandHelp(_0x7629ae[_0x30cd1a(0xa5)]));return;}Object['assign'](_0x37856d,_0x7629ae[_0x30cd1a(0xa4)]);const _0x2708ac=buildConfigFromFlags(_0x37856d);await initGlobalEnvironment(_0x2708ac);const _0x5913a8=createPipelineEnv(_0x2708ac,_0x37856d);_0x5913a8[_0x30cd1a(0xb0)]=_0x7629ae[_0x30cd1a(0xb0)],await runCommand(_0x7629ae[_0x30cd1a(0xa5)],_0x5913a8);return;}if(_0x37856d[_0x30cd1a(0xbe)]){const _0x426881=generateDynamicServiceHelp(_0x5e9a1a);if(_0x426881){console['log'](_0x426881);return;}}const {waitUntilExit:_0x437d4e}=render(a0_0x2538f9(Help,{}));await _0x437d4e();return;}const _0x1849ca=getServiceEntry(_0x5e9a1a);if(!_0x5c93ae){if(_0x37856d[_0x30cd1a(0xbe)]){console['log'](generateServiceHelp(_0x5e9a1a));return;}if(_0x1849ca[_0x30cd1a(0xb5)])_0x5c93ae=_0x1849ca['defaultCommand'];else{console[_0x30cd1a(0xaa)](generateServiceHelp(_0x5e9a1a));return;}}const _0x56d0cc=findDefinition(_0x5e9a1a,_0x5c93ae);!_0x56d0cc&&(console['log'](generateServiceHelp(_0x5e9a1a)),handleError(CliErrors[_0x30cd1a(0xb6)](_0x5e9a1a+'\x20'+_0x5c93ae)));if(_0x37856d[_0x30cd1a(0xbe)]){console[_0x30cd1a(0xaa)](generateCommandHelp(_0x56d0cc));return;}const _0x35b74e=buildConfigFromFlags(_0x37856d);await initGlobalEnvironment(_0x35b74e);const _0x97f5fe=createPipelineEnv(_0x35b74e,_0x37856d);_0x97f5fe[_0x30cd1a(0xb0)]=cli['input'][_0x30cd1a(0xb7)](0x2),await runCommand(_0x56d0cc,_0x97f5fe);}function handleError(_0x1f5743){const _0x61ceb8=a0_0x5bccba;if(_0x1f5743 instanceof CliError){_0x1f5743['code']===_0x61ceb8(0xa1)&&(process[_0x61ceb8(0xab)][_0x61ceb8(0x9f)](_0x61ceb8(0xbd)),process[_0x61ceb8(0xae)](0x0));console[_0x61ceb8(0xa6)](_0x61ceb8(0xb4)+_0x1f5743[_0x61ceb8(0xb9)]);if(_0x1f5743[_0x61ceb8(0x9a)])console['error'](_0x61ceb8(0xa2)+_0x1f5743['hint']);process[_0x61ceb8(0xae)](_0x1f5743[_0x61ceb8(0xb2)]);}isUserCancellation(_0x1f5743)&&(process['stderr'][_0x61ceb8(0x9f)](_0x61ceb8(0xbd)),process['exit'](0x0)),console[_0x61ceb8(0xa6)](_0x61ceb8(0x9c),_0x1f5743),process[_0x61ceb8(0xae)](0x1);}function a0_0x5365(_0x6171f9,_0xd69a69){_0x6171f9=_0x6171f9-0x97;const _0x276bed=a0_0x276b();let _0x5365b6=_0x276bed[_0x6171f9];return _0x5365b6;}function isUserCancellation(_0x37769d){const _0x155e47=a0_0x5bccba;if(!(_0x37769d instanceof Error))return![];if(_0x37769d[_0x155e47(0xa9)]===_0x155e47(0x99))return!![];if(_0x37769d[_0x155e47(0x97)]===_0x155e47(0xb8))return!![];if(_0x37769d[_0x155e47(0x97)]===_0x155e47(0xc3))return!![];return![];}
@@ -1 +1 @@
1
- const a1_0x20ffdd=a1_0x4cee;function a1_0x4cee(_0x47b1bd,_0x13e375){_0x47b1bd=_0x47b1bd-0x18b;const _0x488edb=a1_0x488e();let _0x4ceefb=_0x488edb[_0x47b1bd];return _0x4ceefb;}(function(_0x5d446a,_0x3a0780){const _0xaf87=a1_0x4cee,_0x106dbf=_0x5d446a();while(!![]){try{const _0x3fe5c1=-parseInt(_0xaf87(0x204))/0x1*(-parseInt(_0xaf87(0x1fc))/0x2)+-parseInt(_0xaf87(0x206))/0x3*(parseInt(_0xaf87(0x1a8))/0x4)+-parseInt(_0xaf87(0x1e6))/0x5+parseInt(_0xaf87(0x201))/0x6+-parseInt(_0xaf87(0x1e8))/0x7+-parseInt(_0xaf87(0x1fa))/0x8*(parseInt(_0xaf87(0x1f7))/0x9)+parseInt(_0xaf87(0x19d))/0xa*(parseInt(_0xaf87(0x19e))/0xb);if(_0x3fe5c1===_0x3a0780)break;else _0x106dbf['push'](_0x106dbf['shift']());}catch(_0x14299a){_0x106dbf['push'](_0x106dbf['shift']());}}}(a1_0x488e,0x99e24));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x20ffdd(0x1ed),'type':a1_0x20ffdd(0x1c9),'description':a1_0x20ffdd(0x18e)},KEYWORD_FLAG={'name':'keyword','type':a1_0x20ffdd(0x1c9),'description':a1_0x20ffdd(0x1cb)},DOC_CODE_FLAG={'name':a1_0x20ffdd(0x1af),'type':a1_0x20ffdd(0x1c9),'required':!![],'description':a1_0x20ffdd(0x19b)},DOCS=[{'code':a1_0x20ffdd(0x1da),'category':'dataset','title':a1_0x20ffdd(0x1d0),'method':a1_0x20ffdd(0x1d4),'path':a1_0x20ffdd(0x1ec),'summary':a1_0x20ffdd(0x1ff),'whenToUse':'需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name',a1_0x20ffdd(0x1d7)],'examples':[a1_0x20ffdd(0x1d2)],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':[a1_0x20ffdd(0x1d3),'',a1_0x20ffdd(0x1e4)][a1_0x20ffdd(0x1db)]('\x0a')},{'code':'dataset_detail','category':a1_0x20ffdd(0x1e1),'title':a1_0x20ffdd(0x19a),'method':'GET','path':a1_0x20ffdd(0x1de),'summary':a1_0x20ffdd(0x1a2),'whenToUse':'需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','pathParams':[],'queryParams':[{'name':a1_0x20ffdd(0x1af),'description':a1_0x20ffdd(0x202)}],'bodySchema':a1_0x20ffdd(0x1cc),'responseHighlights':[a1_0x20ffdd(0x19c),a1_0x20ffdd(0x1c0),a1_0x20ffdd(0x1fe)],'examples':[a1_0x20ffdd(0x1c2)],'notes':[a1_0x20ffdd(0x1d9)],'markdown':[a1_0x20ffdd(0x194),'',a1_0x20ffdd(0x1e9)][a1_0x20ffdd(0x1db)]('\x0a')},{'code':a1_0x20ffdd(0x1f4),'category':a1_0x20ffdd(0x1e1),'title':a1_0x20ffdd(0x1f6),'method':a1_0x20ffdd(0x1d4),'path':a1_0x20ffdd(0x1b0),'summary':a1_0x20ffdd(0x18b),'whenToUse':a1_0x20ffdd(0x1f8),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':'datasetCode','description':a1_0x20ffdd(0x202)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':[a1_0x20ffdd(0x196),a1_0x20ffdd(0x1b9)],'examples':[a1_0x20ffdd(0x1e2),a1_0x20ffdd(0x192)],'notes':[a1_0x20ffdd(0x195),a1_0x20ffdd(0x1b1),'Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.',a1_0x20ffdd(0x1b7)],'markdown':[a1_0x20ffdd(0x1ae),'',a1_0x20ffdd(0x1ce)][a1_0x20ffdd(0x1db)]('\x0a')},{'code':a1_0x20ffdd(0x205),'category':a1_0x20ffdd(0x1e1),'title':'Aggregate\x20dataset\x20data','method':a1_0x20ffdd(0x1d4),'path':a1_0x20ffdd(0x1a3),'summary':a1_0x20ffdd(0x1d5),'whenToUse':a1_0x20ffdd(0x1fd),'pathParams':[{'name':a1_0x20ffdd(0x1f3),'description':a1_0x20ffdd(0x203)},{'name':'datasetCode','description':a1_0x20ffdd(0x202)}],'queryParams':[],'bodySchema':a1_0x20ffdd(0x1ad),'responseHighlights':[a1_0x20ffdd(0x1e0),'where\x20filters\x20before\x20aggregation'],'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_0x20ffdd(0x1b5),'`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'],'markdown':[a1_0x20ffdd(0x1f9),'','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.']['join']('\x0a')},{'code':a1_0x20ffdd(0x1bb),'category':a1_0x20ffdd(0x1e1),'title':a1_0x20ffdd(0x1ea),'method':a1_0x20ffdd(0x1d4),'path':a1_0x20ffdd(0x1c4),'summary':a1_0x20ffdd(0x1a6),'whenToUse':a1_0x20ffdd(0x200),'pathParams':[{'name':a1_0x20ffdd(0x1f3),'description':a1_0x20ffdd(0x203)},{'name':a1_0x20ffdd(0x1ab),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':[a1_0x20ffdd(0x191)],'notes':[a1_0x20ffdd(0x199)],'markdown':a1_0x20ffdd(0x1d8)},{'code':'dataset_data_create','category':a1_0x20ffdd(0x1e1),'title':'Create\x20dataset\x20record','method':'POST','path':a1_0x20ffdd(0x1bc),'summary':a1_0x20ffdd(0x198),'whenToUse':'需要向指定数据集新增一条业务数据时使用','pathParams':[{'name':a1_0x20ffdd(0x1f3),'description':a1_0x20ffdd(0x203)},{'name':a1_0x20ffdd(0x1ab),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x20ffdd(0x1e5),'responseHighlights':[a1_0x20ffdd(0x1ac)],'examples':[a1_0x20ffdd(0x1c5)],'notes':[a1_0x20ffdd(0x18c)],'markdown':a1_0x20ffdd(0x1b4)},{'code':a1_0x20ffdd(0x1f1),'category':'bf','title':a1_0x20ffdd(0x1d6),'method':'GET','path':'/client/bff/endpoint/{appCode}/{functionName}','summary':a1_0x20ffdd(0x1c6),'whenToUse':a1_0x20ffdd(0x1e3),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x20ffdd(0x197),'description':a1_0x20ffdd(0x1b6)}],'queryParams':[],'bodySchema':a1_0x20ffdd(0x1cc),'responseHighlights':[a1_0x20ffdd(0x1eb)],'examples':[a1_0x20ffdd(0x1b3)],'notes':['This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.'],'markdown':a1_0x20ffdd(0x1cf)},{'code':a1_0x20ffdd(0x1bf),'category':'bf','title':a1_0x20ffdd(0x1c7),'method':a1_0x20ffdd(0x1d4),'path':a1_0x20ffdd(0x1dc),'summary':a1_0x20ffdd(0x1fb),'whenToUse':a1_0x20ffdd(0x1ca),'pathParams':[{'name':a1_0x20ffdd(0x1f3),'description':a1_0x20ffdd(0x203)},{'name':a1_0x20ffdd(0x197),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x20ffdd(0x1be),'responseHighlights':[a1_0x20ffdd(0x18f)],'examples':[a1_0x20ffdd(0x1a0)],'notes':[a1_0x20ffdd(0x1a9)],'markdown':a1_0x20ffdd(0x1f2)},{'code':a1_0x20ffdd(0x1f0),'category':a1_0x20ffdd(0x1c8),'title':a1_0x20ffdd(0x1bd),'method':a1_0x20ffdd(0x1d4),'path':'/api/custom/executeSql','summary':a1_0x20ffdd(0x1a1),'whenToUse':a1_0x20ffdd(0x1d1),'pathParams':[],'queryParams':[],'bodySchema':a1_0x20ffdd(0x1ee),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x20ffdd(0x1a5)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x20ffdd(0x1dd)}];function entrySummary(_0x3002c7){const _0xce26f6=a1_0x20ffdd;return{'code':_0x3002c7[_0xce26f6(0x1af)],'category':_0x3002c7[_0xce26f6(0x1ed)],'method':_0x3002c7[_0xce26f6(0x1c3)],'path':_0x3002c7['path'],'summary':_0x3002c7[_0xce26f6(0x1aa)],'whenToUse':_0x3002c7[_0xce26f6(0x1df)]};}export function listApiDocEntries(_0x85518c={}){const _0x5d0f65=a1_0x20ffdd,_0x5706ce=String(_0x85518c[_0x5d0f65(0x1ed)]||'')[_0x5d0f65(0x1b2)](),_0x2d42bc=String(_0x85518c['keyword']||'')[_0x5d0f65(0x1b2)]()[_0x5d0f65(0x190)]();return DOCS[_0x5d0f65(0x1b8)](_0x5b3114=>{const _0x5017ff=_0x5d0f65;if(_0x5706ce&&_0x5b3114['category']!==_0x5706ce)return![];if(!_0x2d42bc)return!![];return[_0x5b3114[_0x5017ff(0x1af)],_0x5b3114[_0x5017ff(0x1ed)],_0x5b3114['method'],_0x5b3114[_0x5017ff(0x1e7)],_0x5b3114[_0x5017ff(0x1aa)],_0x5b3114[_0x5017ff(0x1df)],_0x5b3114[_0x5017ff(0x1ef)]][_0x5017ff(0x1db)]('\x20')['toLowerCase']()[_0x5017ff(0x1a7)](_0x2d42bc);})['map'](entrySummary);}function a1_0x488e(){const _0x3ad77b=['str','dataset_data_get_one','/api/{appCode}/{datasetCode}/create','Execute\x20custom\x20SQL','{\x22param\x22:\x22value\x22}','bf_execute','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','list','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','method','/api/{appCode}/{datasetCode}/getOne','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','按应用和函数名精确获取\x20BF\x20运行契约','Execute\x20BF\x20endpoint\x20function','custom_sql','string','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','None','detail','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','List\x20datasets','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','##\x20List\x20datasets','POST','聚合查询数据集数据','Get\x20BF\x20endpoint\x20function\x20contract','paging.totalCount\x20gives\x20total\x20rows','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','dataset_list','join','/api/endpoint/{appCode}/{functionName}','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','/api/dataset/getOneByCode?code={datasetCode}','whenToUse','result\x20rows\x20contain\x20aggregate\x20aliases','dataset','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','已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','{\x22fieldName\x22:\x22value\x22}','6197535ftVzpv','path','711137mRouGp','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Get\x20one\x20dataset\x20record','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','/api/dataset/get-dataset-list-by-app-code','category','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','title','custom_sql_execute','bf_detail','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','appCode','dataset_data_filter','length','Filter\x20dataset\x20data','85707sPCsZY','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','##\x20Aggregate\x20dataset\x20data','736YcDNST','执行指定\x20BF\x20函数','1156922VvFUkr','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','operations\x20describes\x20runtime\x20APIs','分页获取数据集列表','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','3392862bUhPOn','32-character\x20dataset\x20code','Current\x20app\x20code','1mDFuGb','dataset_data_aggregate','507hQjTBf','条件过滤查询数据','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','api-doc','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','Returns\x20script\x20business\x20payload','toLowerCase','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','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','List\x20available\x20runtime\x20API\x20documentation\x20entries','##\x20Dataset\x20detail','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','tableData\x20contains\x20records','functionName','创建数据','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','Dataset\x20detail','API\x20doc\x20code,\x20for\x20example\x20dataset_list','fields/properties\x20describe\x20data\x20shape','24612110tImnLI','11REUwNl','Show\x20runtime\x20API\x20documentation\x20by\x20code','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','执行自定义\x20SQL','获取数据集详情','/api/{appCode}/{datasetCode}/aggregate','API\x20doc\x20code\x20not\x20found:\x20','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','查询单条数据','includes','17932EdSdWy','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','summary','datasetCode','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','##\x20Filter\x20dataset\x20data','code','/api/{appCode}/{datasetCode}/filter','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','trim','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','Exact\x20endpoint\x20function\x20name','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','filter','paging\x20contains\x20pagination'];a1_0x488e=function(){return _0x3ad77b;};return a1_0x488e();}export function getApiDocDetail(_0x4b9268){const _0xd703e0=a1_0x20ffdd,_0xae0e5c=DOCS['find'](_0x118400=>_0x118400[_0xd703e0(0x1af)]===_0x4b9268);if(!_0xae0e5c)throw CliErrors['validation'](_0xd703e0(0x1a4)+_0x4b9268);return{..._0xae0e5c};}const apiDocList={'service':a1_0x20ffdd(0x18d),'command':a1_0x20ffdd(0x1c1),'description':a1_0x20ffdd(0x193),'risk':'read','requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x1e6354){const _0x28ce1=a1_0x20ffdd,_0xe49ca8=listApiDocEntries({'category':_0x1e6354[_0x28ce1(0x1ba)](_0x28ce1(0x1ed)),'keyword':_0x1e6354[_0x28ce1(0x1ba)]('keyword')});return{'ok':!![],'data':{'total':_0xe49ca8[_0x28ce1(0x1f5)],'items':_0xe49ca8}};}},apiDocDetail={'service':a1_0x20ffdd(0x18d),'command':a1_0x20ffdd(0x1cd),'description':a1_0x20ffdd(0x19f),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x46ed16){const _0x436346=a1_0x20ffdd;return{'ok':!![],'data':getApiDocDetail(_0x46ed16[_0x436346(0x1ba)](_0x436346(0x1af)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
1
+ const a1_0x2dbc3f=a1_0x152a;(function(_0x4ba983,_0x5b8134){const _0x46c017=a1_0x152a,_0x2ad639=_0x4ba983();while(!![]){try{const _0x39578c=-parseInt(_0x46c017(0x165))/0x1+-parseInt(_0x46c017(0x167))/0x2+parseInt(_0x46c017(0x14b))/0x3+parseInt(_0x46c017(0x17f))/0x4*(parseInt(_0x46c017(0x128))/0x5)+-parseInt(_0x46c017(0x145))/0x6+-parseInt(_0x46c017(0x187))/0x7*(-parseInt(_0x46c017(0x16c))/0x8)+parseInt(_0x46c017(0x17d))/0x9;if(_0x39578c===_0x5b8134)break;else _0x2ad639['push'](_0x2ad639['shift']());}catch(_0x51833e){_0x2ad639['push'](_0x2ad639['shift']());}}}(a1_0x2f0e,0x7c0b5));import{CliErrors}from'../../errors.js';function a1_0x2f0e(){const _0x2fa15c=['创建数据','##\x20Filter\x20dataset\x20data','##\x20Dataset\x20detail','str','result\x20rows\x20contain\x20aggregate\x20aliases','custom_sql_execute','where\x20filters\x20before\x20aggregation','1127YZbrVN','read','Aggregate\x20dataset\x20data','fields/properties\x20describe\x20data\x20shape','string','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','Execute\x20BF\x20endpoint\x20function','/api/{appCode}/{datasetCode}/filter','需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','Dataset\x20detail','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','functionName','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','/api/endpoint/{appCode}/{functionName}','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','dataset_data_get_one','filter','{\x22fieldName\x22:\x22value\x22}','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','POST','dataset_data_filter','查询单条数据','length','summary','bf_execute','paging.totalCount\x20gives\x20total\x20rows','Show\x20runtime\x20API\x20documentation\x20by\x20code','tableData\x20contains\x20dataset\x20id/code/name','3360gdHEvq','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','operations\x20describes\x20runtime\x20APIs','toLowerCase','path','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','category','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','whenToUse','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','/api/{appCode}/{datasetCode}/getOne','API\x20doc\x20code\x20not\x20found:\x20','List\x20available\x20runtime\x20API\x20documentation\x20entries','map','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','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','api-doc','list','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','tableData\x20contains\x20records','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','API\x20doc\x20code,\x20for\x20example\x20dataset_list','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','bf_detail','658788rUMOjV','title','datasetCode','includes','join','按应用和函数名精确获取\x20BF\x20运行契约','518577QxYwiq','Current\x20app\x20code','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','执行自定义\x20SQL','需要向指定数据集新增一条业务数据时使用','/api/custom/executeSql','find','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','##\x20List\x20datasets','条件过滤查询数据','dataset_detail','Returns\x20script\x20business\x20payload','/api/dataset/getOneByCode?code={datasetCode}','Get\x20one\x20dataset\x20record','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','List\x20datasets','dataset','Returns\x20one\x20matching\x20business\x20record','appCode','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','Get\x20BF\x20endpoint\x20function\x20contract','code','执行指定\x20BF\x20函数','32-character\x20dataset\x20code','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','dataset_data_create','684275lygDlB','None','1539124txIJZw','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','##\x20Aggregate\x20dataset\x20data','17768sFgbQX','Execute\x20custom\x20SQL','dataset_list','GET','validation','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','detail','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','keyword','/client/bff/endpoint/{appCode}/{functionName}','获取数据集详情','trim','聚合查询数据集数据','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','12202272VXZTkW','paging\x20contains\x20pagination','1104kzJNNy'];a1_0x2f0e=function(){return _0x2fa15c;};return a1_0x2f0e();}const CATEGORY_FLAG={'name':a1_0x2dbc3f(0x12e),'type':a1_0x2dbc3f(0x18b),'description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0x2dbc3f(0x176),'type':a1_0x2dbc3f(0x18b),'description':a1_0x2dbc3f(0x152)},DOC_CODE_FLAG={'name':a1_0x2dbc3f(0x160),'type':a1_0x2dbc3f(0x18b),'required':!![],'description':a1_0x2dbc3f(0x13e)},DOCS=[{'code':a1_0x2dbc3f(0x16e),'category':a1_0x2dbc3f(0x15b),'title':a1_0x2dbc3f(0x15a),'method':'POST','path':'/api/dataset/get-dataset-list-by-app-code','summary':'分页获取数据集列表','whenToUse':a1_0x2dbc3f(0x13f),'pathParams':[],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x140),'responseHighlights':[a1_0x2dbc3f(0x127),a1_0x2dbc3f(0x1a2)],'examples':[a1_0x2dbc3f(0x15e)],'notes':[a1_0x2dbc3f(0x190)],'markdown':[a1_0x2dbc3f(0x153),'',a1_0x2dbc3f(0x141)]['join']('\x0a')},{'code':a1_0x2dbc3f(0x155),'category':a1_0x2dbc3f(0x15b),'title':a1_0x2dbc3f(0x191),'method':a1_0x2dbc3f(0x16f),'path':a1_0x2dbc3f(0x157),'summary':a1_0x2dbc3f(0x178),'whenToUse':a1_0x2dbc3f(0x18f),'pathParams':[],'queryParams':[{'name':a1_0x2dbc3f(0x160),'description':a1_0x2dbc3f(0x162)}],'bodySchema':a1_0x2dbc3f(0x166),'responseHighlights':[a1_0x2dbc3f(0x18a),a1_0x2dbc3f(0x14d),a1_0x2dbc3f(0x12a)],'examples':[a1_0x2dbc3f(0x196)],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':[a1_0x2dbc3f(0x182),'',a1_0x2dbc3f(0x143)][a1_0x2dbc3f(0x149)]('\x0a')},{'code':a1_0x2dbc3f(0x19d),'category':a1_0x2dbc3f(0x15b),'title':'Filter\x20dataset\x20data','method':a1_0x2dbc3f(0x19c),'path':a1_0x2dbc3f(0x18e),'summary':a1_0x2dbc3f(0x154),'whenToUse':'需要携带\x20where、orderBy、分页等条件读取业务数据时使用','pathParams':[{'name':'appCode','description':a1_0x2dbc3f(0x14c)},{'name':'datasetCode','description':a1_0x2dbc3f(0x162)}],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x175),'responseHighlights':[a1_0x2dbc3f(0x13c),a1_0x2dbc3f(0x17e)],'examples':[a1_0x2dbc3f(0x138),a1_0x2dbc3f(0x194)],'notes':[a1_0x2dbc3f(0x18c),a1_0x2dbc3f(0x17b),a1_0x2dbc3f(0x13d),a1_0x2dbc3f(0x174)],'markdown':[a1_0x2dbc3f(0x181),'',a1_0x2dbc3f(0x171)]['join']('\x0a')},{'code':'dataset_data_aggregate','category':a1_0x2dbc3f(0x15b),'title':a1_0x2dbc3f(0x189),'method':a1_0x2dbc3f(0x19c),'path':'/api/{appCode}/{datasetCode}/aggregate','summary':a1_0x2dbc3f(0x17a),'whenToUse':a1_0x2dbc3f(0x172),'pathParams':[{'name':a1_0x2dbc3f(0x15d),'description':a1_0x2dbc3f(0x14c)},{'name':a1_0x2dbc3f(0x147),'description':a1_0x2dbc3f(0x162)}],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x136),'responseHighlights':[a1_0x2dbc3f(0x184),a1_0x2dbc3f(0x186)],'examples':[a1_0x2dbc3f(0x12f)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.',a1_0x2dbc3f(0x142)],'markdown':[a1_0x2dbc3f(0x16b),'',a1_0x2dbc3f(0x12d)]['join']('\x0a')},{'code':a1_0x2dbc3f(0x197),'category':a1_0x2dbc3f(0x15b),'title':a1_0x2dbc3f(0x158),'method':'POST','path':a1_0x2dbc3f(0x132),'summary':a1_0x2dbc3f(0x19e),'whenToUse':'已经知道记录\x20id,需要按数据集读取单条业务数据时使用','pathParams':[{'name':a1_0x2dbc3f(0x15d),'description':a1_0x2dbc3f(0x14c)},{'name':a1_0x2dbc3f(0x147),'description':a1_0x2dbc3f(0x162)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x2dbc3f(0x15c)],'examples':[a1_0x2dbc3f(0x17c)],'notes':[a1_0x2dbc3f(0x129)],'markdown':a1_0x2dbc3f(0x163)},{'code':a1_0x2dbc3f(0x164),'category':'dataset','title':'Create\x20dataset\x20record','method':a1_0x2dbc3f(0x19c),'path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x2dbc3f(0x180),'whenToUse':a1_0x2dbc3f(0x14f),'pathParams':[{'name':a1_0x2dbc3f(0x15d),'description':a1_0x2dbc3f(0x14c)},{'name':a1_0x2dbc3f(0x147),'description':a1_0x2dbc3f(0x162)}],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x199),'responseHighlights':[a1_0x2dbc3f(0x19b)],'examples':[a1_0x2dbc3f(0x159)],'notes':['This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.'],'markdown':a1_0x2dbc3f(0x16a)},{'code':a1_0x2dbc3f(0x144),'category':'bf','title':a1_0x2dbc3f(0x15f),'method':a1_0x2dbc3f(0x16f),'path':a1_0x2dbc3f(0x177),'summary':a1_0x2dbc3f(0x14a),'whenToUse':a1_0x2dbc3f(0x169),'pathParams':[{'name':a1_0x2dbc3f(0x15d),'description':a1_0x2dbc3f(0x14c)},{'name':a1_0x2dbc3f(0x193),'description':'Exact\x20endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x166),'responseHighlights':[a1_0x2dbc3f(0x192)],'examples':['lovrabet\x20bff\x20detail\x20--name\x20<functionName>'],'notes':['This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.'],'markdown':a1_0x2dbc3f(0x19a)},{'code':a1_0x2dbc3f(0x1a1),'category':'bf','title':a1_0x2dbc3f(0x18d),'method':a1_0x2dbc3f(0x19c),'path':a1_0x2dbc3f(0x195),'summary':a1_0x2dbc3f(0x161),'whenToUse':'已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','pathParams':[{'name':'appCode','description':a1_0x2dbc3f(0x14c)},{'name':a1_0x2dbc3f(0x193),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x2dbc3f(0x156)],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':['Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.'],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x2dbc3f(0x185),'category':'custom_sql','title':a1_0x2dbc3f(0x16d),'method':a1_0x2dbc3f(0x19c),'path':a1_0x2dbc3f(0x150),'summary':a1_0x2dbc3f(0x14e),'whenToUse':'已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','pathParams':[],'queryParams':[],'bodySchema':a1_0x2dbc3f(0x131),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x2dbc3f(0x13b)],'notes':[a1_0x2dbc3f(0x137)],'markdown':a1_0x2dbc3f(0x168)}];function entrySummary(_0x196f4b){const _0x3c160a=a1_0x2dbc3f;return{'code':_0x196f4b[_0x3c160a(0x160)],'category':_0x196f4b[_0x3c160a(0x12e)],'method':_0x196f4b['method'],'path':_0x196f4b[_0x3c160a(0x12c)],'summary':_0x196f4b[_0x3c160a(0x1a0)],'whenToUse':_0x196f4b['whenToUse']};}export function listApiDocEntries(_0x5cb275={}){const _0x4772a2=a1_0x2dbc3f,_0x20e26b=String(_0x5cb275[_0x4772a2(0x12e)]||'')['trim'](),_0x45b3ad=String(_0x5cb275[_0x4772a2(0x176)]||'')[_0x4772a2(0x179)]()[_0x4772a2(0x12b)]();return DOCS[_0x4772a2(0x198)](_0x2e399f=>{const _0x5b0f0e=_0x4772a2;if(_0x20e26b&&_0x2e399f['category']!==_0x20e26b)return![];if(!_0x45b3ad)return!![];return[_0x2e399f[_0x5b0f0e(0x160)],_0x2e399f['category'],_0x2e399f['method'],_0x2e399f[_0x5b0f0e(0x12c)],_0x2e399f[_0x5b0f0e(0x1a0)],_0x2e399f[_0x5b0f0e(0x130)],_0x2e399f[_0x5b0f0e(0x146)]][_0x5b0f0e(0x149)]('\x20')[_0x5b0f0e(0x12b)]()[_0x5b0f0e(0x148)](_0x45b3ad);})[_0x4772a2(0x135)](entrySummary);}export function getApiDocDetail(_0x37fe0c){const _0x4215b7=a1_0x2dbc3f,_0x2299e9=DOCS[_0x4215b7(0x151)](_0x1e581b=>_0x1e581b[_0x4215b7(0x160)]===_0x37fe0c);if(!_0x2299e9)throw CliErrors[_0x4215b7(0x170)](_0x4215b7(0x133)+_0x37fe0c);return{..._0x2299e9};}function a1_0x152a(_0x1461c5,_0x49f2e6){_0x1461c5=_0x1461c5-0x127;const _0x2f0e04=a1_0x2f0e();let _0x152a1f=_0x2f0e04[_0x1461c5];return _0x152a1f;}const apiDocList={'service':a1_0x2dbc3f(0x139),'command':a1_0x2dbc3f(0x13a),'description':a1_0x2dbc3f(0x134),'risk':a1_0x2dbc3f(0x188),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x2cef48){const _0x11d5cf=a1_0x2dbc3f,_0x23f1e8=listApiDocEntries({'category':_0x2cef48[_0x11d5cf(0x183)](_0x11d5cf(0x12e)),'keyword':_0x2cef48[_0x11d5cf(0x183)](_0x11d5cf(0x176))});return{'ok':!![],'data':{'total':_0x23f1e8[_0x11d5cf(0x19f)],'items':_0x23f1e8}};}},apiDocDetail={'service':a1_0x2dbc3f(0x139),'command':a1_0x2dbc3f(0x173),'description':a1_0x2dbc3f(0x1a3),'risk':a1_0x2dbc3f(0x188),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x489f0a){const _0x28e49d=a1_0x2dbc3f;return{'ok':!![],'data':getApiDocDetail(_0x489f0a['str'](_0x28e49d(0x160)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
@@ -1 +1 @@
1
- (function(_0x1f45c4,_0x3d25ec){const _0xad23be=a2_0x5266,_0x483971=_0x1f45c4();while(!![]){try{const _0x1875cb=parseInt(_0xad23be(0x171))/0x1+-parseInt(_0xad23be(0x17f))/0x2+parseInt(_0xad23be(0x189))/0x3*(-parseInt(_0xad23be(0x180))/0x4)+-parseInt(_0xad23be(0x188))/0x5*(-parseInt(_0xad23be(0x184))/0x6)+parseInt(_0xad23be(0x182))/0x7*(-parseInt(_0xad23be(0x16f))/0x8)+-parseInt(_0xad23be(0x179))/0x9*(parseInt(_0xad23be(0x18a))/0xa)+-parseInt(_0xad23be(0x177))/0xb*(-parseInt(_0xad23be(0x17d))/0xc);if(_0x1875cb===_0x3d25ec)break;else _0x483971['push'](_0x483971['shift']());}catch(_0x52622f){_0x483971['push'](_0x483971['shift']());}}}(a2_0x2d8b,0x8b040));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a2_0x2d8b(){const _0x5d390e=['appName','utf8','hex','32mqBWjN','update','552047otBftm','my-apps.json','code','ak_','find','EXDEV','407xbSHOS','slice','234xuTkKL','EACCES','EPERM','.tmp','459912JtNTMp','isArray','937350dAkUnm','580oDzcIR','homeDirName','477953BLPuEG','appCode','3218268HINzNO','cache','stringify','trim','5vVwDRk','11958moghgQ','237430fpqRuL'];a2_0x2d8b=function(){return _0x5d390e;};return a2_0x2d8b();}import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x24811d){const _0x2cc58c=a2_0x5266,_0x251fdf=_0x24811d[_0x2cc58c(0x187)](),_0x328295=_0x251fdf['slice'](-0x6)||'unknown',_0x23ca9e=createHash('sha256')[_0x2cc58c(0x170)](_0x251fdf)['digest'](_0x2cc58c(0x18d))[_0x2cc58c(0x178)](0x0,0xc);return _0x2cc58c(0x174)+_0x328295+'_'+_0x23ca9e;}export function getAppCacheFilePath(_0x320176,_0x56ac05){const _0x31aabc=a2_0x5266;return resolve(homedir(),PRODUCT_CONFIG[_0x31aabc(0x181)],_0x31aabc(0x185),_0x320176,fingerprintAccessKey(_0x56ac05),_0x31aabc(0x172));}export function readCachedAppList(_0xb3a7bb,_0x18ff10){const _0x58e46f=a2_0x5266;if(!_0x18ff10?.[_0x58e46f(0x187)]())return null;const _0x4378=getAppCacheFilePath(_0xb3a7bb,_0x18ff10);if(!existsSync(_0x4378))return null;try{const _0x207ba4=readFileSync(_0x4378,'utf8');if(!_0x207ba4[_0x58e46f(0x187)]())return null;const _0x4fafa1=JSON['parse'](_0x207ba4);if(!Array[_0x58e46f(0x17e)](_0x4fafa1['items']))return null;return _0x4fafa1;}catch{return null;}}export function writeCachedAppList(_0x5c4cfc,_0x1647f0,_0x2cbf87){const _0x38e359=a2_0x5266,_0x1c9b51=getAppCacheFilePath(_0x5c4cfc,_0x1647f0),_0x7f243e=dirname(_0x1c9b51);!existsSync(_0x7f243e)&&mkdirSync(_0x7f243e,{'recursive':!![]});const _0x240209=_0x1c9b51+_0x38e359(0x17c);try{writeFileSync(_0x240209,JSON[_0x38e359(0x186)](_0x2cbf87,null,0x2)+'\x0a',{'encoding':_0x38e359(0x18c),'mode':0x180});try{renameSync(_0x240209,_0x1c9b51);}catch(_0x1479cd){if(_0x1479cd[_0x38e359(0x173)]===_0x38e359(0x17b)||_0x1479cd['code']===_0x38e359(0x176)||_0x1479cd['code']===_0x38e359(0x17a)){writeFileSync(_0x1c9b51,JSON[_0x38e359(0x186)](_0x2cbf87,null,0x2)+'\x0a',{'encoding':_0x38e359(0x18c)});try{unlinkSync(_0x240209);}catch{}}else throw _0x1479cd;}}catch(_0x2aa097){try{unlinkSync(_0x240209);}catch{}throw _0x2aa097;}return _0x1c9b51;}function a2_0x5266(_0x5bddcf,_0x16b7c3){_0x5bddcf=_0x5bddcf-0x16f;const _0x2d8b99=a2_0x2d8b();let _0x526669=_0x2d8b99[_0x5bddcf];return _0x526669;}export function resolveCachedAppCode(_0x4c73f0,_0x1569a2,_0x5ecd8e){const _0x411080=a2_0x5266;if(!_0x4c73f0)return undefined;const _0x1cb983=readCachedAppList(_0x1569a2,_0x5ecd8e),_0x1e1d5d=_0x1cb983?.['items'][_0x411080(0x175)](_0x314f7a=>_0x314f7a[_0x411080(0x18b)]===_0x4c73f0&&isRuntimeAccessibleApp(_0x314f7a));return _0x1e1d5d?.[_0x411080(0x183)]?.[_0x411080(0x187)]()||undefined;}
1
+ (function(_0x57a35f,_0x57d5f8){const _0x3002a6=a2_0x7e43,_0x385264=_0x57a35f();while(!![]){try{const _0x1ee858=-parseInt(_0x3002a6(0x14e))/0x1+-parseInt(_0x3002a6(0x140))/0x2+-parseInt(_0x3002a6(0x148))/0x3*(parseInt(_0x3002a6(0x13c))/0x4)+parseInt(_0x3002a6(0x151))/0x5*(-parseInt(_0x3002a6(0x146))/0x6)+parseInt(_0x3002a6(0x13b))/0x7+-parseInt(_0x3002a6(0x156))/0x8+parseInt(_0x3002a6(0x147))/0x9*(parseInt(_0x3002a6(0x13e))/0xa);if(_0x1ee858===_0x57d5f8)break;else _0x385264['push'](_0x385264['shift']());}catch(_0x2a89f6){_0x385264['push'](_0x385264['shift']());}}}(a2_0x95cb,0x74408));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a2_0x7e43(_0x3f2fce,_0x54fa6b){_0x3f2fce=_0x3f2fce-0x138;const _0x95cbaf=a2_0x95cb();let _0x7e4310=_0x95cbaf[_0x3f2fce];return _0x7e4310;}function a2_0x95cb(){const _0x3c6a12=['find','utf8','homeDirName','unknown','1677232vWgleF','trim','items','EACCES','appCode','2038337JABxSG','788976QAYqqe','cache','13192810WdZjQS','.tmp','849110rVzYGE','hex','my-apps.json','EPERM','parse','sha256','4150392pDUvWQ','18SysbGB','9eneXDg','EXDEV','appName','slice','digest','update','535912fPfRVK','stringify','code','5rclfsV'];a2_0x95cb=function(){return _0x3c6a12;};return a2_0x95cb();}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(_0x518144){const _0x515b11=a2_0x7e43,_0x456b2a=_0x518144[_0x515b11(0x157)](),_0x241629=_0x456b2a[_0x515b11(0x14b)](-0x6)||_0x515b11(0x155),_0x42a657=createHash(_0x515b11(0x145))[_0x515b11(0x14d)](_0x456b2a)[_0x515b11(0x14c)](_0x515b11(0x141))[_0x515b11(0x14b)](0x0,0xc);return'ak_'+_0x241629+'_'+_0x42a657;}export function getAppCacheFilePath(_0x84cfb3,_0xbfa7fc){const _0x3271e1=a2_0x7e43;return resolve(homedir(),PRODUCT_CONFIG[_0x3271e1(0x154)],_0x3271e1(0x13d),_0x84cfb3,fingerprintAccessKey(_0xbfa7fc),_0x3271e1(0x142));}export function readCachedAppList(_0xec3579,_0x53ed03){const _0x43b730=a2_0x7e43;if(!_0x53ed03?.[_0x43b730(0x157)]())return null;const _0x554f76=getAppCacheFilePath(_0xec3579,_0x53ed03);if(!existsSync(_0x554f76))return null;try{const _0x38b49c=readFileSync(_0x554f76,_0x43b730(0x153));if(!_0x38b49c[_0x43b730(0x157)]())return null;const _0x4ea35f=JSON[_0x43b730(0x144)](_0x38b49c);if(!Array['isArray'](_0x4ea35f[_0x43b730(0x138)]))return null;return _0x4ea35f;}catch{return null;}}export function writeCachedAppList(_0x14f4a0,_0x55d70e,_0x159c5f){const _0x157388=a2_0x7e43,_0x5573c4=getAppCacheFilePath(_0x14f4a0,_0x55d70e),_0x36b5d6=dirname(_0x5573c4);!existsSync(_0x36b5d6)&&mkdirSync(_0x36b5d6,{'recursive':!![]});const _0x1f3daa=_0x5573c4+_0x157388(0x13f);try{writeFileSync(_0x1f3daa,JSON[_0x157388(0x14f)](_0x159c5f,null,0x2)+'\x0a',{'encoding':_0x157388(0x153),'mode':0x180});try{renameSync(_0x1f3daa,_0x5573c4);}catch(_0x291148){if(_0x291148[_0x157388(0x150)]===_0x157388(0x143)||_0x291148['code']===_0x157388(0x149)||_0x291148['code']===_0x157388(0x139)){writeFileSync(_0x5573c4,JSON[_0x157388(0x14f)](_0x159c5f,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x1f3daa);}catch{}}else throw _0x291148;}}catch(_0x191b39){try{unlinkSync(_0x1f3daa);}catch{}throw _0x191b39;}return _0x5573c4;}export function resolveCachedAppCode(_0x28d7cc,_0xdf72f7,_0x2db507){const _0x51f417=a2_0x7e43;if(!_0x28d7cc)return undefined;const _0x37d04f=readCachedAppList(_0xdf72f7,_0x2db507),_0x3dd10e=_0x37d04f?.[_0x51f417(0x138)][_0x51f417(0x152)](_0x3db71d=>_0x3db71d[_0x51f417(0x14a)]===_0x28d7cc&&isRuntimeAccessibleApp(_0x3db71d));return _0x3dd10e?.[_0x51f417(0x13a)]?.[_0x51f417(0x157)]()||undefined;}
@@ -1 +1 @@
1
- const a3_0x352d77=a3_0x4c22;(function(_0x57c2ca,_0x46093e){const _0x5410ac=a3_0x4c22,_0x1dd3b2=_0x57c2ca();while(!![]){try{const _0x144c82=parseInt(_0x5410ac(0x1a0))/0x1+-parseInt(_0x5410ac(0x1b6))/0x2+parseInt(_0x5410ac(0x1b0))/0x3*(-parseInt(_0x5410ac(0x19f))/0x4)+parseInt(_0x5410ac(0x1ab))/0x5*(parseInt(_0x5410ac(0x1c1))/0x6)+parseInt(_0x5410ac(0x1b7))/0x7+-parseInt(_0x5410ac(0x19e))/0x8+-parseInt(_0x5410ac(0x188))/0x9*(parseInt(_0x5410ac(0x192))/0xa);if(_0x144c82===_0x46093e)break;else _0x1dd3b2['push'](_0x1dd3b2['shift']());}catch(_0x475124){_0x1dd3b2['push'](_0x1dd3b2['shift']());}}}(a3_0x5a26,0x2fdcf));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';function a3_0x4c22(_0x538941,_0x150fb0){_0x538941=_0x538941-0x188;const _0x5a2618=a3_0x5a26();let _0x4c2221=_0x5a2618[_0x538941];return _0x4c2221;}import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x5cf8c3,_0x491475){const _0xfb446b=a3_0x4c22,_0x5c5eb8={};for(const _0x3cdf78 of _0x491475){const _0x4a1c41=_0x3cdf78[_0xfb446b(0x1a5)]==='boolean'?_0x5cf8c3[_0xfb446b(0x1a6)](_0x3cdf78['name']):_0x5cf8c3[_0xfb446b(0x18d)](_0x3cdf78[_0xfb446b(0x196)]);if(_0x4a1c41!==''&&_0x4a1c41!==![])_0x5c5eb8[_0x3cdf78[_0xfb446b(0x196)]]=_0x4a1c41;}if(_0x5cf8c3['nonInteractive'])_0x5c5eb8[_0xfb446b(0x198)]=!![];return _0x5c5eb8;}function normalizeLanguages(_0x553c09){const _0x380100=a3_0x4c22;if(!Array['isArray'](_0x553c09))return[];return _0x553c09[_0x380100(0x1b1)](_0x5f4fc3=>typeof _0x5f4fc3==='string')[_0x380100(0x18b)](_0x2f87c8=>_0x2f87c8['trim']())[_0x380100(0x1b1)](Boolean);}function buildRemoteAppI18nFields(_0x57282f){const _0x3bc74d=a3_0x4c22,_0x16af97=normalizeLanguages(_0x57282f[_0x3bc74d(0x1bb)]?.[_0x3bc74d(0x194)]);return{'enableI18n':typeof _0x57282f[_0x3bc74d(0x191)]===_0x3bc74d(0x1ad)?_0x57282f['enableI18n']:null,'languages':_0x16af97,'i18nInfo':_0x57282f[_0x3bc74d(0x1bb)]?{..._0x57282f[_0x3bc74d(0x1bb)],'langs':_0x16af97['length']?_0x16af97:null}:null};}const listDef={'service':a3_0x352d77(0x1b8),'command':a3_0x352d77(0x1c2),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':a3_0x352d77(0x190),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x352d77(0x197),'type':a3_0x352d77(0x1c3),'description':a3_0x352d77(0x19d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x352d77(0x1c0),'type':a3_0x352d77(0x1ad),'description':a3_0x352d77(0x1a4),'default':![]},{'name':'no-cache','type':a3_0x352d77(0x1ad),'description':a3_0x352d77(0x193),'default':![]},{'name':'include-unpublished','type':a3_0x352d77(0x1ad),'description':'Include\x20unpublished\x20apps\x20for\x20diagnostics','default':![]}],async 'execute'(_0x311174){const _0x5de232=a3_0x352d77,_0xd34fba=_0x311174['str'](_0x5de232(0x197))||_0x311174[_0x5de232(0x18e)]||getEnv()||'production',_0x2298a5=_0x311174[_0x5de232(0x1a6)](_0x5de232(0x1c0)),_0x4813a6=_0x311174[_0x5de232(0x1a6)]('no-cache'),_0x529f66=_0x311174['bool'](_0x5de232(0x1b9)),{readRawConfigWithLayers:_0x249c33,resolveDefaultAppSource:_0x44e760,getLocalAppAliases:_0x58e3c3}=await import(_0x5de232(0x19a)),{getRemoteAppList:_0x5f3d9f}=await import(_0x5de232(0x1a1)),{config:_0x55bbcc,layers:_0x4b5040}=_0x249c33(),_0x10c595=_0x44e760(_0x4b5040),{defaultApp:_0x2940a6}=_0x55bbcc,_0x23b3cc=await _0x5f3d9f({'env':_0xd34fba,'accessKey':_0x311174['accessKey'],'localOnly':_0x2298a5,'noCache':_0x4813a6}),_0x289a78=_0x529f66?_0x23b3cc[_0x5de232(0x1b5)]:filterRuntimeAccessibleApps(_0x23b3cc['items']),_0x37ec26=_0x23b3cc[_0x5de232(0x1b5)]['length']-_0x289a78[_0x5de232(0x19c)],_0xf8fec7=_0x289a78['map'](_0x30185d=>{const _0x581976=_0x5de232;return{'name':_0x30185d[_0x581976(0x1ba)],'appcode':_0x30185d['appCode'],'named':!![],'definedIn':_0x581976(0x195),'isDefault':_0x30185d[_0x581976(0x1ba)]===_0x2940a6,...buildAppProfileListFields(_0xd34fba),...buildRemoteAppI18nFields(_0x30185d),'source':_0x23b3cc[_0x581976(0x19b)],'owner':_0x30185d['appOwnerName']??null,'status':_0x30185d[_0x581976(0x1af)]??null,'cachedAt':_0x23b3cc[_0x581976(0x1b2)]};}),_0x25d389=_0x58e3c3(_0x55bbcc);let _0x288201=0x0;for(const [_0x17aed2,_0x33bf01]of Object['entries'](_0x25d389)){const _0x587f5e=typeof _0x33bf01[_0x5de232(0x1ae)]===_0x5de232(0x1c3)?_0x33bf01[_0x5de232(0x1ae)][_0x5de232(0x1c4)]():'';if(!_0x587f5e)continue;const _0xc7ab88=findAppByCode(_0x23b3cc['items'],_0x587f5e);if(!_0x529f66&&_0xc7ab88&&!isRuntimeAccessibleApp(_0xc7ab88))continue;_0x288201+=0x1,_0xf8fec7[_0x5de232(0x18a)]({'name':_0x17aed2,'appcode':_0x587f5e,'named':!![],'definedIn':_0x5de232(0x1c0),'isDefault':_0x17aed2===_0x2940a6,...buildAppProfileListFields(_0xd34fba),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0xf8fec7,_0x311174[_0x5de232(0x1be)]);const _0x314b83=_0xf8fec7['find'](_0x3f66a1=>_0x3f66a1[_0x5de232(0x1bd)]===!![]),_0x577d4c=_0x2940a6??_0x314b83?.[_0x5de232(0x196)]??null,_0x270e39={'env':_0xd34fba,'source':_0x23b3cc[_0x5de232(0x19b)],'fetchedAt':_0x23b3cc['fetchedAt'],'cachePath':_0x23b3cc[_0x5de232(0x1ac)],'globalPath':_0x4b5040['globalPath']??null,'projectPath':_0x4b5040[_0x5de232(0x1bc)]??null,'defaultApp':_0x577d4c,'defaultAppSource':_0x2940a6!=null?_0x10c595:null,'localAliasCount':_0x288201,'remoteTotal':_0x23b3cc[_0x5de232(0x1b5)][_0x5de232(0x19c)],'hiddenUnpublishedCount':_0x37ec26,'includeUnpublished':_0x529f66};if(_0xf8fec7['length']===0x0)return{'ok':!![],'data':{'items':_0xf8fec7,'meta':_0x270e39},'message':_0x23b3cc[_0x5de232(0x19b)]===_0x5de232(0x189)?'No\x20cached\x20apps\x20found.':_0x5de232(0x1b3)};return{'ok':!![],'data':{'items':_0xf8fec7,'meta':_0x270e39}};}},pullDef={'service':a3_0x352d77(0x1b8),'command':a3_0x352d77(0x18c),'description':a3_0x352d77(0x1bf),'risk':a3_0x352d77(0x1b4),'confirmationDescription':a3_0x352d77(0x199),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x352d77(0x197),'type':a3_0x352d77(0x1c3),'description':a3_0x352d77(0x1aa),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x352d77(0x1c0),'type':a3_0x352d77(0x1ad),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x352d77(0x1a3),'type':a3_0x352d77(0x1ad),'description':a3_0x352d77(0x193),'default':![]}],async 'execute'(_0x53bf09){const _0x214913=a3_0x352d77,_0x413bb5=_0x53bf09[_0x214913(0x18d)](_0x214913(0x197))||_0x53bf09['envName']||getEnv()||_0x214913(0x1a9),_0x1ff826=_0x53bf09[_0x214913(0x1a6)](_0x214913(0x1c0)),_0x6154aa=_0x53bf09[_0x214913(0x1a6)](_0x214913(0x1a3)),{getRemoteAppList:_0x44de04}=await import(_0x214913(0x1a1)),_0x3420f8=await _0x44de04({'env':_0x413bb5,'accessKey':_0x53bf09['accessKey'],'localOnly':_0x1ff826,'noCache':_0x6154aa});return{'ok':!![],'data':{'total':_0x3420f8[_0x214913(0x1b5)][_0x214913(0x19c)],'env':_0x413bb5,'source':_0x3420f8[_0x214913(0x19b)],'fetchedAt':_0x3420f8[_0x214913(0x1b2)],'cachePath':_0x3420f8[_0x214913(0x1ac)]},'message':_0x3420f8[_0x214913(0x19b)]===_0x214913(0x189)?'Loaded\x20'+_0x3420f8[_0x214913(0x1b5)][_0x214913(0x19c)]+_0x214913(0x1a2)+_0x413bb5+'\x22.':_0x214913(0x1a7)+_0x3420f8[_0x214913(0x1b5)][_0x214913(0x19c)]+_0x214913(0x18f)+_0x413bb5+'\x22.'};}},importDef={'service':a3_0x352d77(0x1b8),'command':'import','description':a3_0x352d77(0x1a8),'risk':'write','confirmationDescription':'将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x3e8e11){return await runAppImport(collectFlags(_0x3e8e11,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];function a3_0x5a26(){const _0x4c4053=['fetchedAt','No\x20apps\x20found\x20on\x20the\x20platform.','write','items','722838MMXhiW','2715776dNgKoO','app','include-unpublished','appName','i18nInfo','projectPath','isCurrent','mergedCli','从平台刷新本地应用缓存','local','1656YfTEFr','list','string','trim','739026SRsGkm','cache','push','map','pull','str','envName','\x20app(s)\x20for\x20env=\x22','read','enableI18n','10BOZiZJ','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','langs','remote','name','env','nonInteractive','将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','../../context.js','source','length','Filter\x20by\x20environment\x20(default:\x20current\x20env)','1052992vOFTEw','41804VRHlTK','379278jmkZrb','../../commands/app/remote-source.js','\x20cached\x20app(s)\x20for\x20env=\x22','no-cache','Read\x20app\x20list\x20from\x20local\x20cache\x20only','type','bool','Refreshed\x20app\x20cache\x20with\x20','从\x20.rabetbase.json\x20文件导入默认应用选择','production','Target\x20environment\x20(default:\x20current\x20env)','1965qVjmEo','cachePath','boolean','appcode','appPublishStatus','30bknDHZ','filter'];a3_0x5a26=function(){return _0x4c4053;};return a3_0x5a26();}
1
+ const a3_0x136487=a3_0x532a;(function(_0x28a9f2,_0x2f8ce7){const _0x327afe=a3_0x532a,_0x162952=_0x28a9f2();while(!![]){try{const _0x5d7938=-parseInt(_0x327afe(0xbf))/0x1*(-parseInt(_0x327afe(0xbe))/0x2)+-parseInt(_0x327afe(0xda))/0x3+-parseInt(_0x327afe(0xc0))/0x4*(parseInt(_0x327afe(0xad))/0x5)+-parseInt(_0x327afe(0xc7))/0x6+-parseInt(_0x327afe(0xba))/0x7+parseInt(_0x327afe(0xcd))/0x8*(-parseInt(_0x327afe(0xa0))/0x9)+-parseInt(_0x327afe(0xbb))/0xa*(-parseInt(_0x327afe(0xdd))/0xb);if(_0x5d7938===_0x2f8ce7)break;else _0x162952['push'](_0x162952['shift']());}catch(_0x23142a){_0x162952['push'](_0x162952['shift']());}}}(a3_0x57a1,0x6f195));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';function a3_0x532a(_0x56fe03,_0xe75400){_0x56fe03=_0x56fe03-0x9e;const _0x57a1b7=a3_0x57a1();let _0x532ad6=_0x57a1b7[_0x56fe03];return _0x532ad6;}import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';function a3_0x57a1(){const _0x39b554=['map','将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','4798296SYmkYF','include-unpublished','cache','accessKey','No\x20cached\x20apps\x20found.','no-cache','7249448fycoeJ','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','Target\x20environment\x20(default:\x20current\x20env)','enableI18n','isArray','envName','str','env','source','../../context.js','nonInteractive','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','read','612516bbwOab','import','mergedCli','385UeiyEV','filter','write','cachePath','local','appOwnerName','9ySeJyc','appCode','type','find','entries','Refreshed\x20app\x20cache\x20with\x20','push','Read\x20app\x20list\x20from\x20local\x20cache\x20only','appName','i18nInfo','boolean','length','bool','67385VFnrBM','isCurrent','fetchedAt','appcode','\x20cached\x20app(s)\x20for\x20env=\x22','Include\x20unpublished\x20apps\x20for\x20diagnostics','projectPath','从\x20.rabetbase.json\x20文件导入默认应用选择','../../commands/app/remote-source.js','name','trim','Filter\x20by\x20environment\x20(default:\x20current\x20env)','items','1466192gJICtU','711340jOxueT','config','将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','46xhuZTf','5449JrDXuj','12HpOZVu','app','string','production','\x20app(s)\x20for\x20env=\x22'];a3_0x57a1=function(){return _0x39b554;};return a3_0x57a1();}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x5e7bdd,_0x4ce637){const _0x3fafc7=a3_0x532a,_0x1ddbcc={};for(const _0x3da105 of _0x4ce637){const _0x40f4bd=_0x3da105[_0x3fafc7(0xa2)]===_0x3fafc7(0xaa)?_0x5e7bdd[_0x3fafc7(0xac)](_0x3da105[_0x3fafc7(0xb6)]):_0x5e7bdd[_0x3fafc7(0xd3)](_0x3da105['name']);if(_0x40f4bd!==''&&_0x40f4bd!==![])_0x1ddbcc[_0x3da105[_0x3fafc7(0xb6)]]=_0x40f4bd;}if(_0x5e7bdd[_0x3fafc7(0xd7)])_0x1ddbcc['nonInteractive']=!![];return _0x1ddbcc;}function normalizeLanguages(_0x296b0e){const _0x387ac2=a3_0x532a;if(!Array[_0x387ac2(0xd1)](_0x296b0e))return[];return _0x296b0e[_0x387ac2(0xde)](_0x4422c6=>typeof _0x4422c6===_0x387ac2(0xc2))[_0x387ac2(0xc5)](_0x413286=>_0x413286['trim']())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x1eb2c5){const _0x675b22=a3_0x532a,_0x5f537a=normalizeLanguages(_0x1eb2c5[_0x675b22(0xa9)]?.['langs']);return{'enableI18n':typeof _0x1eb2c5[_0x675b22(0xd0)]===_0x675b22(0xaa)?_0x1eb2c5['enableI18n']:null,'languages':_0x5f537a,'i18nInfo':_0x1eb2c5[_0x675b22(0xa9)]?{..._0x1eb2c5['i18nInfo'],'langs':_0x5f537a['length']?_0x5f537a:null}:null};}const listDef={'service':a3_0x136487(0xc1),'command':'list','description':a3_0x136487(0xce),'risk':a3_0x136487(0xd9),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x136487(0xd4),'type':a3_0x136487(0xc2),'description':a3_0x136487(0xb8),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x136487(0x9e),'type':'boolean','description':a3_0x136487(0xa7),'default':![]},{'name':a3_0x136487(0xcc),'type':a3_0x136487(0xaa),'description':a3_0x136487(0xd8),'default':![]},{'name':a3_0x136487(0xc8),'type':a3_0x136487(0xaa),'description':a3_0x136487(0xb2),'default':![]}],async 'execute'(_0x2aa543){const _0x408256=a3_0x136487,_0x1ecc64=_0x2aa543[_0x408256(0xd3)]('env')||_0x2aa543[_0x408256(0xd2)]||getEnv()||_0x408256(0xc3),_0x334056=_0x2aa543[_0x408256(0xac)]('local'),_0x436bda=_0x2aa543['bool'](_0x408256(0xcc)),_0x10d2ba=_0x2aa543['bool']('include-unpublished'),{readRawConfigWithLayers:_0x5b9129,resolveDefaultAppSource:_0x24ca7c,getLocalAppAliases:_0x2b3dec}=await import(_0x408256(0xd6)),{getRemoteAppList:_0x49f086}=await import('../../commands/app/remote-source.js'),{config:_0x5eaba5,layers:_0x79ec8a}=_0x5b9129(),_0x8bc5e2=_0x24ca7c(_0x79ec8a),{defaultApp:_0x2b2a04}=_0x5eaba5,_0x4dce8b=await _0x49f086({'env':_0x1ecc64,'accessKey':_0x2aa543[_0x408256(0xca)],'localOnly':_0x334056,'noCache':_0x436bda}),_0x3279c1=_0x10d2ba?_0x4dce8b['items']:filterRuntimeAccessibleApps(_0x4dce8b['items']),_0x52161e=_0x4dce8b[_0x408256(0xb9)]['length']-_0x3279c1['length'],_0x51e120=_0x3279c1[_0x408256(0xc5)](_0x541b6a=>{const _0x5b340f=_0x408256;return{'name':_0x541b6a[_0x5b340f(0xa8)],'appcode':_0x541b6a[_0x5b340f(0xa1)],'named':!![],'definedIn':'remote','isDefault':_0x541b6a['appName']===_0x2b2a04,...buildAppProfileListFields(_0x1ecc64),...buildRemoteAppI18nFields(_0x541b6a),'source':_0x4dce8b[_0x5b340f(0xd5)],'owner':_0x541b6a[_0x5b340f(0x9f)]??null,'status':_0x541b6a['appPublishStatus']??null,'cachedAt':_0x4dce8b[_0x5b340f(0xaf)]};}),_0x44fd75=_0x2b3dec(_0x5eaba5);let _0x5e7267=0x0;for(const [_0xb2a151,_0x1f5010]of Object[_0x408256(0xa4)](_0x44fd75)){const _0x302140=typeof _0x1f5010['appcode']==='string'?_0x1f5010[_0x408256(0xb0)][_0x408256(0xb7)]():'';if(!_0x302140)continue;const _0x475b06=findAppByCode(_0x4dce8b[_0x408256(0xb9)],_0x302140);if(!_0x10d2ba&&_0x475b06&&!isRuntimeAccessibleApp(_0x475b06))continue;_0x5e7267+=0x1,_0x51e120[_0x408256(0xa6)]({'name':_0xb2a151,'appcode':_0x302140,'named':!![],'definedIn':'local','isDefault':_0xb2a151===_0x2b2a04,...buildAppProfileListFields(_0x1ecc64),'source':_0x408256(0xbc),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x51e120,_0x2aa543[_0x408256(0xdc)]);const _0x5440ef=_0x51e120[_0x408256(0xa3)](_0x1ad5f2=>_0x1ad5f2[_0x408256(0xae)]===!![]),_0x115c50=_0x2b2a04??_0x5440ef?.[_0x408256(0xb6)]??null,_0x2ff329={'env':_0x1ecc64,'source':_0x4dce8b[_0x408256(0xd5)],'fetchedAt':_0x4dce8b['fetchedAt'],'cachePath':_0x4dce8b[_0x408256(0xe0)],'globalPath':_0x79ec8a['globalPath']??null,'projectPath':_0x79ec8a[_0x408256(0xb3)]??null,'defaultApp':_0x115c50,'defaultAppSource':_0x2b2a04!=null?_0x8bc5e2:null,'localAliasCount':_0x5e7267,'remoteTotal':_0x4dce8b[_0x408256(0xb9)][_0x408256(0xab)],'hiddenUnpublishedCount':_0x52161e,'includeUnpublished':_0x10d2ba};if(_0x51e120[_0x408256(0xab)]===0x0)return{'ok':!![],'data':{'items':_0x51e120,'meta':_0x2ff329},'message':_0x4dce8b['source']===_0x408256(0xc9)?_0x408256(0xcb):'No\x20apps\x20found\x20on\x20the\x20platform.'};return{'ok':!![],'data':{'items':_0x51e120,'meta':_0x2ff329}};}},pullDef={'service':'app','command':'pull','description':'从平台刷新本地应用缓存','risk':'write','confirmationDescription':a3_0x136487(0xc6),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x136487(0xd4),'type':'string','description':a3_0x136487(0xcf),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x136487(0x9e),'type':a3_0x136487(0xaa),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x136487(0xcc),'type':a3_0x136487(0xaa),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x38059f){const _0x13c1e7=a3_0x136487,_0x1554dc=_0x38059f[_0x13c1e7(0xd3)]('env')||_0x38059f[_0x13c1e7(0xd2)]||getEnv()||_0x13c1e7(0xc3),_0x157d06=_0x38059f[_0x13c1e7(0xac)]('local'),_0x38aac3=_0x38059f[_0x13c1e7(0xac)]('no-cache'),{getRemoteAppList:_0x2e62a7}=await import(_0x13c1e7(0xb5)),_0x15b588=await _0x2e62a7({'env':_0x1554dc,'accessKey':_0x38059f['accessKey'],'localOnly':_0x157d06,'noCache':_0x38aac3});return{'ok':!![],'data':{'total':_0x15b588[_0x13c1e7(0xb9)][_0x13c1e7(0xab)],'env':_0x1554dc,'source':_0x15b588[_0x13c1e7(0xd5)],'fetchedAt':_0x15b588['fetchedAt'],'cachePath':_0x15b588[_0x13c1e7(0xe0)]},'message':_0x15b588[_0x13c1e7(0xd5)]===_0x13c1e7(0xc9)?'Loaded\x20'+_0x15b588[_0x13c1e7(0xb9)][_0x13c1e7(0xab)]+_0x13c1e7(0xb1)+_0x1554dc+'\x22.':_0x13c1e7(0xa5)+_0x15b588[_0x13c1e7(0xb9)]['length']+_0x13c1e7(0xc4)+_0x1554dc+'\x22.'};}},importDef={'service':a3_0x136487(0xc1),'command':a3_0x136487(0xdb),'description':a3_0x136487(0xb4),'risk':a3_0x136487(0xdf),'confirmationDescription':a3_0x136487(0xbd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x1a0be5){return await runAppImport(collectFlags(_0x1a0be5,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
@@ -1 +1 @@
1
- (function(_0x53add,_0x2bb1ca){const _0x2ed415=a4_0x3ba7,_0x3a939c=_0x53add();while(!![]){try{const _0x436dbf=parseInt(_0x2ed415(0x1bd))/0x1+parseInt(_0x2ed415(0x1b7))/0x2+parseInt(_0x2ed415(0x1b4))/0x3+parseInt(_0x2ed415(0x1bc))/0x4+parseInt(_0x2ed415(0x1b9))/0x5*(parseInt(_0x2ed415(0x1c7))/0x6)+-parseInt(_0x2ed415(0x1bf))/0x7+-parseInt(_0x2ed415(0x1c8))/0x8*(parseInt(_0x2ed415(0x1c0))/0x9);if(_0x436dbf===_0x2bb1ca)break;else _0x3a939c['push'](_0x3a939c['shift']());}catch(_0x1b9b4f){_0x3a939c['push'](_0x3a939c['shift']());}}}(a4_0x2152,0x34481));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';function a4_0x3ba7(_0x19444a,_0x54e7a5){_0x19444a=_0x19444a-0x1b4;const _0x215295=a4_0x2152();let _0x3ba781=_0x215295[_0x19444a];return _0x3ba781;}import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x43e19a){const _0x16e15b=a4_0x3ba7;if(typeof _0x43e19a!==_0x16e15b(0x1c1))return null;const _0x38af35=_0x43e19a[_0x16e15b(0x1c5)]();return _0x38af35?_0x38af35[_0x16e15b(0x1b5)]():null;}function a4_0x2152(){const _0x443a4e=['string','Current\x20status:\x20','validation','UNKNOWN','trim','appName','1115502yZOLoB','8ceJYoG','918309UqMKlj','toUpperCase','appCode','118296XcHAXm','find','5IDKymG','App\x20','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','989784CaCoqj','77262DsRyiN','filter','66115mGuEju','5870574BZlogI'];a4_0x2152=function(){return _0x443a4e;};return a4_0x2152();}export function isRuntimeAccessibleApp(_0x1bbd28){return normalizeAppPublishStatus(_0x1bbd28['appPublishStatus'])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x3aaee4){const _0xbd3f2c=a4_0x3ba7;return _0x3aaee4[_0xbd3f2c(0x1be)](isRuntimeAccessibleApp);}export function findAppByName(_0x9d1136,_0x1dc510){const _0x12487c=a4_0x3ba7;return _0x9d1136[_0x12487c(0x1b8)](_0x4759ed=>_0x4759ed[_0x12487c(0x1c6)]===_0x1dc510);}export function findAppByCode(_0x23af1b,_0x5a7348){const _0x36647b=a4_0x3ba7,_0x19e51d=_0x5a7348[_0x36647b(0x1c5)]();if(!_0x19e51d)return undefined;return _0x23af1b[_0x36647b(0x1b8)](_0xbcb6f3=>_0xbcb6f3[_0x36647b(0x1b6)]?.['trim']()===_0x19e51d);}export function runtimeInaccessibleAppError(_0x157cc3,_0x3b99e4){const _0x11c985=a4_0x3ba7,_0x43c77c=normalizeAppPublishStatus(_0x157cc3['appPublishStatus'])??_0x11c985(0x1c4);return CliErrors[_0x11c985(0x1c3)](_0x11c985(0x1ba)+_0x3b99e4+_0x11c985(0x1bb),_0x11c985(0x1c2)+_0x43c77c+'.\x20Publish\x20the\x20app\x20before\x20using\x20'+CLI_BIN_NAME+'\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.');}
1
+ (function(_0x3e5161,_0x4e932d){const _0x27c8b6=a4_0x391c,_0x5dd9a3=_0x3e5161();while(!![]){try{const _0xf72b8d=-parseInt(_0x27c8b6(0x82))/0x1+parseInt(_0x27c8b6(0x7c))/0x2+parseInt(_0x27c8b6(0x85))/0x3+-parseInt(_0x27c8b6(0x88))/0x4*(parseInt(_0x27c8b6(0x7b))/0x5)+-parseInt(_0x27c8b6(0x89))/0x6+-parseInt(_0x27c8b6(0x7a))/0x7*(parseInt(_0x27c8b6(0x8a))/0x8)+parseInt(_0x27c8b6(0x79))/0x9;if(_0xf72b8d===_0x4e932d)break;else _0x5dd9a3['push'](_0x5dd9a3['shift']());}catch(_0x1b64b9){_0x5dd9a3['push'](_0x5dd9a3['shift']());}}}(a4_0x1232,0xd7f50));function a4_0x391c(_0x3dbd7b,_0x1ffe66){_0x3dbd7b=_0x3dbd7b-0x79;const _0x123259=a4_0x1232();let _0x391c22=_0x123259[_0x3dbd7b];return _0x391c22;}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(_0x2a8f5a){const _0x48b429=a4_0x391c;if(typeof _0x2a8f5a!=='string')return null;const _0x51f435=_0x2a8f5a['trim']();return _0x51f435?_0x51f435[_0x48b429(0x86)]():null;}export function isRuntimeAccessibleApp(_0x479c00){const _0x423746=a4_0x391c;return normalizeAppPublishStatus(_0x479c00[_0x423746(0x87)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x537ebc){return _0x537ebc['filter'](isRuntimeAccessibleApp);}export function findAppByName(_0x3be37e,_0x516df2){const _0x480a60=a4_0x391c;return _0x3be37e[_0x480a60(0x7d)](_0x3a833a=>_0x3a833a['appName']===_0x516df2);}export function findAppByCode(_0x2e5643,_0x2ef24e){const _0x52a20c=a4_0x391c,_0x4ccba7=_0x2ef24e[_0x52a20c(0x7e)]();if(!_0x4ccba7)return undefined;return _0x2e5643[_0x52a20c(0x7d)](_0x3240c1=>_0x3240c1[_0x52a20c(0x80)]?.[_0x52a20c(0x7e)]()===_0x4ccba7);}function a4_0x1232(){const _0x2a669f=['toUpperCase','appPublishStatus','178660YhYfAU','1200324pyuJVQ','3098632hORAOq','16055586wFNZaE','28dlkjYv','5MiSNlD','832496jDhKEd','find','trim','Current\x20status:\x20','appCode','UNKNOWN','899714nBqPgu','validation','App\x20','4134321ygBbFV'];a4_0x1232=function(){return _0x2a669f;};return a4_0x1232();}export function runtimeInaccessibleAppError(_0x55d224,_0x59cc5a){const _0x34994e=a4_0x391c,_0x588027=normalizeAppPublishStatus(_0x55d224['appPublishStatus'])??_0x34994e(0x81);return CliErrors[_0x34994e(0x83)](_0x34994e(0x84)+_0x59cc5a+'\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.',_0x34994e(0x7f)+_0x588027+'.\x20Publish\x20the\x20app\x20before\x20using\x20'+CLI_BIN_NAME+'\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.');}
@@ -1 +1 @@
1
- (function(_0x317d85,_0x5a3f11){const _0x558dae=a5_0x5164,_0x515488=_0x317d85();while(!![]){try{const _0x20ecb1=parseInt(_0x558dae(0x1f3))/0x1+parseInt(_0x558dae(0x1fc))/0x2+-parseInt(_0x558dae(0x1fa))/0x3+parseInt(_0x558dae(0x1f8))/0x4+parseInt(_0x558dae(0x1fb))/0x5+-parseInt(_0x558dae(0x1f1))/0x6*(parseInt(_0x558dae(0x1fd))/0x7)+-parseInt(_0x558dae(0x1f4))/0x8;if(_0x20ecb1===_0x5a3f11)break;else _0x515488['push'](_0x515488['shift']());}catch(_0x1fd13c){_0x515488['push'](_0x515488['shift']());}}}(a5_0x5235,0xda516));import{fileURLToPath}from'url';function a5_0x5235(){const _0x49d4f0=['2857898nzvPCk','7147yYovaa','tableData','3630JXcrGr','success','1382981eUJqCj','25784784AMKtll','errorCode','../../../mock/app-list.json','utf-8','5710176WtPvML','parse','1193475cKNUgw','4466920lcjFtt'];a5_0x5235=function(){return _0x49d4f0;};return a5_0x5235();}import{dirname,join}from'path';function a5_0x5164(_0x10c012,_0x4a337a){_0x10c012=_0x10c012-0x1f0;const _0x523550=a5_0x5235();let _0x516459=_0x523550[_0x10c012];return _0x516459;}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x230fb1=a5_0x5164,_0x3ef5c9=join(__dirname,_0x230fb1(0x1f6)),_0x58b788=readFileSync(_0x3ef5c9,_0x230fb1(0x1f7));return JSON[_0x230fb1(0x1f9)](_0x58b788);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x371e5f=a5_0x5164,_0x3f10ec=getMockAppList();if(!_0x3f10ec[_0x371e5f(0x1f2)])throw new Error('Mock\x20API\x20error:\x20'+_0x3f10ec['errorMsg']+'\x20('+_0x3f10ec[_0x371e5f(0x1f5)]+')');return _0x3f10ec['data'][_0x371e5f(0x1f0)];}
1
+ function a5_0x1b81(){const _0x5b565b=['30NjiSFq','6611784eipvkr','1654698TVQyfo','2631591mMhIFs','Mock\x20API\x20error:\x20','parse','4412aDbVrX','2083406AGgVTE','3225rLIBbG','402220FEYihL','errorMsg','../../../mock/app-list.json','123245wRDjeM','utf-8'];a5_0x1b81=function(){return _0x5b565b;};return a5_0x1b81();}(function(_0x18bc51,_0x2ea52c){const _0x56625c=a5_0x1543,_0x4bebeb=_0x18bc51();while(!![]){try{const _0x3304d3=parseInt(_0x56625c(0x1d5))/0x1+parseInt(_0x56625c(0x1da))/0x2+parseInt(_0x56625c(0x1cd))/0x3*(-parseInt(_0x56625c(0x1d9))/0x4)+parseInt(_0x56625c(0x1d1))/0x5*(-parseInt(_0x56625c(0x1d3))/0x6)+parseInt(_0x56625c(0x1ce))/0x7+-parseInt(_0x56625c(0x1d4))/0x8+parseInt(_0x56625c(0x1d6))/0x9;if(_0x3304d3===_0x2ea52c)break;else _0x4bebeb['push'](_0x4bebeb['shift']());}catch(_0x7bf88c){_0x4bebeb['push'](_0x4bebeb['shift']());}}}(a5_0x1b81,0xde5e1));import{fileURLToPath}from'url';import{dirname,join}from'path';function a5_0x1543(_0x59d537,_0x16829e){_0x59d537=_0x59d537-0x1cd;const _0x1b817c=a5_0x1b81();let _0x1543b9=_0x1b817c[_0x59d537];return _0x1543b9;}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x94d457=a5_0x1543,_0x4eaada=join(__dirname,_0x94d457(0x1d0)),_0xfb030e=readFileSync(_0x4eaada,_0x94d457(0x1d2));return JSON[_0x94d457(0x1d8)](_0xfb030e);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x4508cb=a5_0x1543,_0x22444c=getMockAppList();if(!_0x22444c['success'])throw new Error(_0x4508cb(0x1d7)+_0x22444c[_0x4508cb(0x1cf)]+'\x20('+_0x22444c['errorCode']+')');return _0x22444c['data']['tableData'];}
@@ -1 +1 @@
1
- (function(_0x55ebc2,_0xf3c6d8){const _0x4e59ad=a6_0x2e3b,_0x43ab4a=_0x55ebc2();while(!![]){try{const _0x19f863=parseInt(_0x4e59ad(0x1cb))/0x1+parseInt(_0x4e59ad(0x1d0))/0x2*(-parseInt(_0x4e59ad(0x1d7))/0x3)+-parseInt(_0x4e59ad(0x1c9))/0x4+parseInt(_0x4e59ad(0x1cc))/0x5+parseInt(_0x4e59ad(0x1d6))/0x6*(parseInt(_0x4e59ad(0x1c7))/0x7)+parseInt(_0x4e59ad(0x1d2))/0x8+-parseInt(_0x4e59ad(0x1ce))/0x9*(-parseInt(_0x4e59ad(0x1cf))/0xa);if(_0x19f863===_0xf3c6d8)break;else _0x43ab4a['push'](_0x43ab4a['shift']());}catch(_0x23f367){_0x43ab4a['push'](_0x43ab4a['shift']());}}}(a6_0x2e58,0x34993));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';function a6_0x2e58(){const _0x21cb50=['fetchedAt','212118cFyilZ','1298790SnHWPo','cache','18WYKePG','124390laYLUL','9232tRDzIH','items','981560dydjAB','remote','toISOString','trim','6SaiUCS','216bUotPM','1173347HNgsDW','toLowerCase','957100jcfTJF'];a6_0x2e58=function(){return _0x21cb50;};return a6_0x2e58();}function a6_0x2e3b(_0x227a25,_0x5c789e){_0x227a25=_0x227a25-0x1c7;const _0x2e58e0=a6_0x2e58();let _0x2e3bd3=_0x2e58e0[_0x227a25];return _0x2e3bd3;}export function shouldUseMockRemoteApps(){const _0x2672f0=a6_0x2e3b,_0x43abf0=(productEnv('APP_LIST_SOURCE')||'')['trim']()[_0x2672f0(0x1c8)]();return _0x43abf0==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x2e5e71){const _0x4a5d47=a6_0x2e3b,{env:_0x2a4f9f,accessKey:_0x71a8fc,localOnly:localOnly=![],noCache:noCache=![]}=_0x2e5e71,_0xfba0da=readCachedAppList(_0x2a4f9f,_0x71a8fc),_0x486e44=_0x71a8fc?.[_0x4a5d47(0x1d5)]()?getAppCacheFilePath(_0x2a4f9f,_0x71a8fc):null;if(localOnly)return{'items':_0xfba0da?.[_0x4a5d47(0x1d1)]??[],'source':_0x4a5d47(0x1cd),'fetchedAt':_0xfba0da?.['fetchedAt']??null,'cachePath':_0x486e44};try{const _0x1ec489=await getRemoteAppItems(),_0x4c314d=shouldUseMockRemoteApps()?'mock':_0x4a5d47(0x1d3),_0x48cd24=new Date()[_0x4a5d47(0x1d4)](),_0x1a416f=_0x71a8fc?.[_0x4a5d47(0x1d5)]()?writeCachedAppList(_0x2a4f9f,_0x71a8fc,{'env':_0x2a4f9f,'fetchedAt':_0x48cd24,'source':_0x4c314d,'items':_0x1ec489}):null;return{'items':_0x1ec489,'source':_0x4c314d,'fetchedAt':_0x48cd24,'cachePath':_0x1a416f};}catch(_0x16626b){if(!noCache&&_0xfba0da)return{'items':_0xfba0da[_0x4a5d47(0x1d1)],'source':_0x4a5d47(0x1cd),'fetchedAt':_0xfba0da[_0x4a5d47(0x1ca)],'cachePath':_0x486e44};throw _0x16626b;}}
1
+ function a6_0x26ff(){const _0x33d43c=['379885PmaEKL','345231DNViQj','7VqKmGm','cache','71396qlyvsX','1331250siEZhf','toLowerCase','928734kEpNlY','items','remote','7606093WkHTjB','2kPZIYF','mock','75CXbAPL','APP_LIST_SOURCE','trim','fetchedAt','1811514VQHHzg','64Uxnjtv'];a6_0x26ff=function(){return _0x33d43c;};return a6_0x26ff();}(function(_0x3df811,_0x573512){const _0x30bc97=a6_0x14b6,_0x2e978f=_0x3df811();while(!![]){try{const _0xac98f=parseInt(_0x30bc97(0x141))/0x1+-parseInt(_0x30bc97(0x139))/0x2*(parseInt(_0x30bc97(0x148))/0x3)+parseInt(_0x30bc97(0x145))/0x4*(-parseInt(_0x30bc97(0x13b))/0x5)+-parseInt(_0x30bc97(0x13f))/0x6*(parseInt(_0x30bc97(0x143))/0x7)+-parseInt(_0x30bc97(0x140))/0x8*(-parseInt(_0x30bc97(0x142))/0x9)+-parseInt(_0x30bc97(0x146))/0xa+parseInt(_0x30bc97(0x138))/0xb;if(_0xac98f===_0x573512)break;else _0x2e978f['push'](_0x2e978f['shift']());}catch(_0x284139){_0x2e978f['push'](_0x2e978f['shift']());}}}(a6_0x26ff,0x59527));import{getMyApps}from'../../core/api-client.js';function a6_0x14b6(_0x5b8e31,_0x54b6b1){_0x5b8e31=_0x5b8e31-0x138;const _0x26ffb4=a6_0x26ff();let _0x14b604=_0x26ffb4[_0x5b8e31];return _0x14b604;}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 _0x27f860=a6_0x14b6,_0x1a9663=(productEnv(_0x27f860(0x13c))||'')['trim']()[_0x27f860(0x147)]();return _0x1a9663===_0x27f860(0x13a);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0xe86b8c){const _0xdb0c3e=a6_0x14b6,{env:_0x1044c6,accessKey:_0x848f88,localOnly:localOnly=![],noCache:noCache=![]}=_0xe86b8c,_0x465182=readCachedAppList(_0x1044c6,_0x848f88),_0x345979=_0x848f88?.[_0xdb0c3e(0x13d)]()?getAppCacheFilePath(_0x1044c6,_0x848f88):null;if(localOnly)return{'items':_0x465182?.['items']??[],'source':_0xdb0c3e(0x144),'fetchedAt':_0x465182?.['fetchedAt']??null,'cachePath':_0x345979};try{const _0x543217=await getRemoteAppItems(),_0x3678a9=shouldUseMockRemoteApps()?_0xdb0c3e(0x13a):_0xdb0c3e(0x14a),_0x2acf26=new Date()['toISOString'](),_0x357f18=_0x848f88?.['trim']()?writeCachedAppList(_0x1044c6,_0x848f88,{'env':_0x1044c6,'fetchedAt':_0x2acf26,'source':_0x3678a9,'items':_0x543217}):null;return{'items':_0x543217,'source':_0x3678a9,'fetchedAt':_0x2acf26,'cachePath':_0x357f18};}catch(_0x18ae6e){if(!noCache&&_0x465182)return{'items':_0x465182[_0xdb0c3e(0x149)],'source':_0xdb0c3e(0x144),'fetchedAt':_0x465182[_0xdb0c3e(0x13e)],'cachePath':_0x345979};throw _0x18ae6e;}}
@@ -1 +1 @@
1
- (function(_0x14a5e8,_0x4eaed4){const _0x171952=a7_0x23ff,_0x4348c8=_0x14a5e8();while(!![]){try{const _0x1ec42b=parseInt(_0x171952(0x11d))/0x1+parseInt(_0x171952(0x11b))/0x2*(-parseInt(_0x171952(0x115))/0x3)+-parseInt(_0x171952(0x10f))/0x4+parseInt(_0x171952(0x113))/0x5*(-parseInt(_0x171952(0x120))/0x6)+-parseInt(_0x171952(0x119))/0x7*(-parseInt(_0x171952(0x11a))/0x8)+parseInt(_0x171952(0x11c))/0x9+-parseInt(_0x171952(0x114))/0xa*(-parseInt(_0x171952(0x116))/0xb);if(_0x1ec42b===_0x4eaed4)break;else _0x4348c8['push'](_0x4348c8['shift']());}catch(_0x3e2b07){_0x4348c8['push'](_0x4348c8['shift']());}}}(a7_0x2f20,0xaa3f6));function a7_0x2f20(){const _0x507f17=['1738EzDEcT','appCode','defaultApp','1226673ryjwWd','48eZRBoN','48754nIgWmI','3908691qECwrh','695338JPdEUf','appcode','find','16068vHChfY','local','trim','definedIn','4310160yqCCpn','isCurrent','currentApp','named','1405zoJWYQ','103690nsKrXW','159TpXZTF'];a7_0x2f20=function(){return _0x507f17;};return a7_0x2f20();}function a7_0x23ff(_0x4cea03,_0x572d85){_0x4cea03=_0x4cea03-0x10e;const _0x2f2015=a7_0x2f20();let _0x23ff70=_0x2f2015[_0x4cea03];return _0x23ff70;}export function enrichAppListItemsWithMergedSelection(_0xbdbac3,_0x46e270){const _0x7dc3b3=a7_0x23ff;if(!_0x46e270)return;const _0x3c1173=!!(_0x46e270[_0x7dc3b3(0x111)]??_0x46e270[_0x7dc3b3(0x118)]);for(const _0x2f186c of _0xbdbac3){_0x2f186c[_0x7dc3b3(0x110)]=![];}const _0x20ff5a=_0x46e270[_0x7dc3b3(0x117)]!=null?String(_0x46e270['appCode'])[_0x7dc3b3(0x122)]():'';if(_0x3c1173){const _0x5b0c66=_0x46e270[_0x7dc3b3(0x111)]??_0x46e270[_0x7dc3b3(0x118)];if(_0x5b0c66){const _0x214013=_0xbdbac3[_0x7dc3b3(0x11f)](_0x306194=>_0x306194[_0x7dc3b3(0x112)]===!![]&&_0x306194['name']===_0x5b0c66&&_0x306194[_0x7dc3b3(0x10e)]===_0x7dc3b3(0x121)),_0x16b85d=_0x214013??_0xbdbac3[_0x7dc3b3(0x11f)](_0x483446=>_0x483446['named']===!![]&&_0x483446['name']===_0x5b0c66);if(_0x16b85d){const _0x23a8c5=String(_0x16b85d['appcode']??'')[_0x7dc3b3(0x122)]();if(!_0x20ff5a||_0x23a8c5===_0x20ff5a){_0x16b85d[_0x7dc3b3(0x110)]=!![];return;}}}if(_0x20ff5a){const _0x43c250=_0xbdbac3['find'](_0x32bc48=>String(_0x32bc48['appcode']??'')[_0x7dc3b3(0x122)]()===_0x20ff5a);_0x43c250&&(_0x43c250[_0x7dc3b3(0x110)]=!![]);}return;}if(!_0x20ff5a)return;for(const _0x831f35 of _0xbdbac3){String(_0x831f35[_0x7dc3b3(0x11e)]??'')[_0x7dc3b3(0x122)]()===_0x20ff5a&&(_0x831f35[_0x7dc3b3(0x110)]=!![]);}}
1
+ (function(_0x309894,_0x3ad401){const _0x40d115=a7_0x5b1a,_0x341114=_0x309894();while(!![]){try{const _0x3bed79=parseInt(_0x40d115(0x164))/0x1*(parseInt(_0x40d115(0x158))/0x2)+parseInt(_0x40d115(0x160))/0x3+-parseInt(_0x40d115(0x16a))/0x4+parseInt(_0x40d115(0x15c))/0x5+parseInt(_0x40d115(0x15f))/0x6*(-parseInt(_0x40d115(0x16b))/0x7)+parseInt(_0x40d115(0x16c))/0x8*(parseInt(_0x40d115(0x169))/0x9)+-parseInt(_0x40d115(0x166))/0xa*(-parseInt(_0x40d115(0x165))/0xb);if(_0x3bed79===_0x3ad401)break;else _0x341114['push'](_0x341114['shift']());}catch(_0x47757f){_0x341114['push'](_0x341114['shift']());}}}(a7_0x1d3a,0x40a94));function a7_0x5b1a(_0x3c0869,_0x5a25f8){_0x3c0869=_0x3c0869-0x157;const _0x1d3a42=a7_0x1d3a();let _0x5b1a9f=_0x1d3a42[_0x3c0869];return _0x5b1a9f;}function a7_0x1d3a(){const _0x23d625=['appcode','find','definedIn','3pzsrMz','132zjCndh','168770FvbPKb','isCurrent','trim','47754oetLSQ','702864ULFqUU','21hNxswR','224SXGJLq','defaultApp','115954oNVhmJ','local','appCode','name','406695DLZRzT','named','currentApp','559320tNSKME','341598iSiaYq'];a7_0x1d3a=function(){return _0x23d625;};return a7_0x1d3a();}export function enrichAppListItemsWithMergedSelection(_0x47ec62,_0x177454){const _0x25da48=a7_0x5b1a;if(!_0x177454)return;const _0x45b8b1=!!(_0x177454[_0x25da48(0x15e)]??_0x177454[_0x25da48(0x157)]);for(const _0x380bee of _0x47ec62){_0x380bee[_0x25da48(0x167)]=![];}const _0x34f999=_0x177454[_0x25da48(0x15a)]!=null?String(_0x177454[_0x25da48(0x15a)])[_0x25da48(0x168)]():'';if(_0x45b8b1){const _0x2337c2=_0x177454[_0x25da48(0x15e)]??_0x177454[_0x25da48(0x157)];if(_0x2337c2){const _0x281d95=_0x47ec62[_0x25da48(0x162)](_0x4c3501=>_0x4c3501[_0x25da48(0x15d)]===!![]&&_0x4c3501['name']===_0x2337c2&&_0x4c3501[_0x25da48(0x163)]===_0x25da48(0x159)),_0x28ee9f=_0x281d95??_0x47ec62[_0x25da48(0x162)](_0x468ac5=>_0x468ac5[_0x25da48(0x15d)]===!![]&&_0x468ac5[_0x25da48(0x15b)]===_0x2337c2);if(_0x28ee9f){const _0x4e6dce=String(_0x28ee9f['appcode']??'')[_0x25da48(0x168)]();if(!_0x34f999||_0x4e6dce===_0x34f999){_0x28ee9f[_0x25da48(0x167)]=!![];return;}}}if(_0x34f999){const _0x5e572f=_0x47ec62[_0x25da48(0x162)](_0x1f0241=>String(_0x1f0241[_0x25da48(0x161)]??'')[_0x25da48(0x168)]()===_0x34f999);_0x5e572f&&(_0x5e572f['isCurrent']=!![]);}return;}if(!_0x34f999)return;for(const _0x2216af of _0x47ec62){String(_0x2216af[_0x25da48(0x161)]??'')[_0x25da48(0x168)]()===_0x34f999&&(_0x2216af[_0x25da48(0x167)]=!![]);}}
@@ -1 +1 @@
1
- const a8_0x253ad1=a8_0x1155;(function(_0x1e276e,_0x26f802){const _0x59cd11=a8_0x1155,_0x5c1adc=_0x1e276e();while(!![]){try{const _0x2b3a52=-parseInt(_0x59cd11(0x1ef))/0x1*(parseInt(_0x59cd11(0x1f2))/0x2)+parseInt(_0x59cd11(0x1df))/0x3*(-parseInt(_0x59cd11(0x1eb))/0x4)+parseInt(_0x59cd11(0x1e4))/0x5*(parseInt(_0x59cd11(0x1e6))/0x6)+-parseInt(_0x59cd11(0x1d9))/0x7*(parseInt(_0x59cd11(0x1ee))/0x8)+parseInt(_0x59cd11(0x1de))/0x9*(-parseInt(_0x59cd11(0x1ed))/0xa)+parseInt(_0x59cd11(0x1dd))/0xb+parseInt(_0x59cd11(0x1ea))/0xc*(parseInt(_0x59cd11(0x1db))/0xd);if(_0x2b3a52===_0x26f802)break;else _0x5c1adc['push'](_0x5c1adc['shift']());}catch(_0x316280){_0x5c1adc['push'](_0x5c1adc['shift']());}}}(a8_0x2a79,0xe5718));function a8_0x1155(_0x2295c3,_0x4b1d1d){_0x2295c3=_0x2295c3-0x1d7;const _0x2a79a0=a8_0x2a79();let _0x11551d=_0x2a79a0[_0x2295c3];return _0x11551d;}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x2a79(){const _0x21756=['12167270KOJFPg','24AJIXfj','36889AlDpWM','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','94pbZJLd','Usage:\x20','Missing\x20app-config\x20key.','appCode','2338798lNULTY','validation','67106XpJFWe',',\x20appCode=','12881484ePqWya','9uTUJAg','7623HEZawJ','args','apiError','get','App\x20config\x20key','8653285AEPSRW','key','6RsuNbj','read','trim','\x20app-config\x20get\x20<key>','4776GkvtDo','100PnKCud','Unable\x20to\x20get\x20app-config\x20value:\x20key='];a8_0x2a79=function(){return _0x21756;};return a8_0x2a79();}export const appConfigGet={'service':'app-config','command':a8_0x253ad1(0x1e2),'description':a8_0x253ad1(0x1f1),'risk':a8_0x253ad1(0x1e7),'args':[{'name':a8_0x253ad1(0x1e5),'description':a8_0x253ad1(0x1e3),'required':!![]}],'flags':[],async 'execute'(_0x207101){const _0x1733fa=a8_0x253ad1,_0x4f764b=_0x207101[_0x1733fa(0x1e0)][0x0]?.[_0x1733fa(0x1e8)]();if(!_0x4f764b)throw CliErrors[_0x1733fa(0x1da)](_0x1733fa(0x1d7),_0x1733fa(0x1f3)+CLI_BIN_NAME+_0x1733fa(0x1e9));try{const _0x3233fb=await getRuntimeAppConfigByKey(_0x207101[_0x1733fa(0x1d8)],_0x4f764b);return{'ok':!![],'data':_0x3233fb};}catch{throw CliErrors[_0x1733fa(0x1e1)](_0x1733fa(0x1ec)+_0x4f764b+_0x1733fa(0x1dc)+_0x207101[_0x1733fa(0x1d8)],_0x1733fa(0x1f0));}}};
1
+ const a8_0x35fefc=a8_0x5806;(function(_0xfcd099,_0x49e5e8){const _0x3e4924=a8_0x5806,_0x36c8b3=_0xfcd099();while(!![]){try{const _0x1072b0=-parseInt(_0x3e4924(0x1ba))/0x1+-parseInt(_0x3e4924(0x1b9))/0x2*(-parseInt(_0x3e4924(0x1c4))/0x3)+parseInt(_0x3e4924(0x1be))/0x4+-parseInt(_0x3e4924(0x1c5))/0x5+-parseInt(_0x3e4924(0x1bd))/0x6+-parseInt(_0x3e4924(0x1c7))/0x7+parseInt(_0x3e4924(0x1c0))/0x8;if(_0x1072b0===_0x49e5e8)break;else _0x36c8b3['push'](_0x36c8b3['shift']());}catch(_0x57b063){_0x36c8b3['push'](_0x36c8b3['shift']());}}}(a8_0x1c13,0xdea8a));function a8_0x1c13(){const _0x4c242d=['get','874SIARdP','918122vIHaDl','key',',\x20appCode=','4240674ZKIUUJ','4371388MnyzJw','Missing\x20app-config\x20key.','17482176OsttzL','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','Usage:\x20','5118wCNOhP','1033350klZfZL','appCode','8960420sfjHwO','\x20app-config\x20get\x20<key>','App\x20config\x20key'];a8_0x1c13=function(){return _0x4c242d;};return a8_0x1c13();}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x5806(_0x281711,_0x451666){_0x281711=_0x281711-0x1b8;const _0x1c1303=a8_0x1c13();let _0x580630=_0x1c1303[_0x281711];return _0x580630;}export const appConfigGet={'service':'app-config','command':a8_0x35fefc(0x1b8),'description':a8_0x35fefc(0x1c2),'risk':'read','args':[{'name':a8_0x35fefc(0x1bb),'description':a8_0x35fefc(0x1c9),'required':!![]}],'flags':[],async 'execute'(_0x590bb8){const _0x1a33b3=a8_0x35fefc,_0x4807b1=_0x590bb8['args'][0x0]?.['trim']();if(!_0x4807b1)throw CliErrors['validation'](_0x1a33b3(0x1bf),_0x1a33b3(0x1c3)+CLI_BIN_NAME+_0x1a33b3(0x1c8));try{const _0xd38d20=await getRuntimeAppConfigByKey(_0x590bb8[_0x1a33b3(0x1c6)],_0x4807b1);return{'ok':!![],'data':_0xd38d20};}catch{throw CliErrors['apiError']('Unable\x20to\x20get\x20app-config\x20value:\x20key='+_0x4807b1+_0x1a33b3(0x1bc)+_0x590bb8[_0x1a33b3(0x1c6)],_0x1a33b3(0x1c1));}}};
@@ -1 +1 @@
1
- (function(_0x23afa3,_0xf93dda){const _0x13da42=a9_0x1967,_0x4b0be8=_0x23afa3();while(!![]){try{const _0x46e4b0=-parseInt(_0x13da42(0xe9))/0x1+parseInt(_0x13da42(0xed))/0x2*(parseInt(_0x13da42(0xec))/0x3)+parseInt(_0x13da42(0xe7))/0x4+parseInt(_0x13da42(0xe5))/0x5*(-parseInt(_0x13da42(0xe4))/0x6)+-parseInt(_0x13da42(0xea))/0x7*(parseInt(_0x13da42(0xe6))/0x8)+parseInt(_0x13da42(0xee))/0x9*(-parseInt(_0x13da42(0xe8))/0xa)+-parseInt(_0x13da42(0xeb))/0xb;if(_0x46e4b0===_0xf93dda)break;else _0x4b0be8['push'](_0x4b0be8['shift']());}catch(_0x500c50){_0x4b0be8['push'](_0x4b0be8['shift']());}}}(a9_0x5758,0xa6b43));import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x1967(_0x52043,_0x39d956){_0x52043=_0x52043-0xe4;const _0x5758ac=a9_0x5758();let _0x19679c=_0x5758ac[_0x52043];return _0x19679c;}function a9_0x5758(){const _0x1714e2=['425810PIWxJe','20454tuNQoW','314AZDyYM','269307SrKsrI','36fqfHRB','227510LKwejP','8248CoxkIL','4790764lHJhWr','230vCwfEz','384302bQjHcA','1365vZLzhz'];a9_0x5758=function(){return _0x1714e2;};return a9_0x5758();}export const appConfigDefinitions=[appConfigGet];
1
+ (function(_0x467c07,_0x24558a){const _0x1228fa=a9_0x4963,_0x508b8b=_0x467c07();while(!![]){try{const _0x37287b=parseInt(_0x1228fa(0xa1))/0x1+parseInt(_0x1228fa(0x9c))/0x2*(-parseInt(_0x1228fa(0xa2))/0x3)+-parseInt(_0x1228fa(0x9a))/0x4+-parseInt(_0x1228fa(0x9b))/0x5+parseInt(_0x1228fa(0x9f))/0x6+-parseInt(_0x1228fa(0x9d))/0x7*(parseInt(_0x1228fa(0xa3))/0x8)+-parseInt(_0x1228fa(0xa0))/0x9*(-parseInt(_0x1228fa(0x9e))/0xa);if(_0x37287b===_0x24558a)break;else _0x508b8b['push'](_0x508b8b['shift']());}catch(_0x50389c){_0x508b8b['push'](_0x508b8b['shift']());}}}(a9_0x4e04,0xc1a98));function a9_0x4963(_0x2b471c,_0x141769){_0x2b471c=_0x2b471c-0x9a;const _0x4e0446=a9_0x4e04();let _0x496369=_0x4e0446[_0x2b471c];return _0x496369;}function a9_0x4e04(){const _0x2e6824=['60uxbJoq','7403664EzyZUn','2671767JRThsb','1479063AlujCP','1182alRjce','104UeEdpc','2731520UFjZzt','3983325VJnMVD','6662tgCnHq','489454ApmKAR'];a9_0x4e04=function(){return _0x2e6824;};return a9_0x4e04();}import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];
@@ -1 +1 @@
1
- const a10_0x5d1f4f=a10_0x2218;(function(_0x1496ee,_0x17f781){const _0x3154c4=a10_0x2218,_0x5d1eab=_0x1496ee();while(!![]){try{const _0xe87d21=-parseInt(_0x3154c4(0x11d))/0x1+parseInt(_0x3154c4(0x115))/0x2*(parseInt(_0x3154c4(0x106))/0x3)+parseInt(_0x3154c4(0x137))/0x4+-parseInt(_0x3154c4(0x13d))/0x5+-parseInt(_0x3154c4(0x102))/0x6*(parseInt(_0x3154c4(0x107))/0x7)+-parseInt(_0x3154c4(0x104))/0x8*(-parseInt(_0x3154c4(0xf5))/0x9)+parseInt(_0x3154c4(0xfe))/0xa*(parseInt(_0x3154c4(0x120))/0xb);if(_0xe87d21===_0x17f781)break;else _0x5d1eab['push'](_0x5d1eab['shift']());}catch(_0x42cadf){_0x5d1eab['push'](_0x5d1eab['shift']());}}}(a10_0x28bf,0xe21dd));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_0x5d1f4f(0x10e),ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a10_0x5d1f4f(0x118),a10_0x5d1f4f(0x132),a10_0x5d1f4f(0x12a),a10_0x5d1f4f(0x134),a10_0x5d1f4f(0xf7),a10_0x5d1f4f(0x126)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');function a10_0x28bf(){const _0x355dec=['artifact','deleted','test','trim','File\x20not\x20found:\x20','str','/client/artifact/','File\x20path\x20is\x20required.','updateTime','appCode','9UpbPPR','File\x20is\x20not\x20a\x20regular\x20file:\x20','antd','根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','split','utf8','validation','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','source','342730OsjBzd','isFile','parse','filter','42hRMhzF','description','6794488JIwlSl','Invalid\x20JSON\x20for\x20--metadata:\x20','4451115Bspral','1584996AVUMJH','exec','create','write','根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','/client/artifact/create','Show\x20one\x20Artifact\x20by\x20id','react_module','content','data','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Preview:\x20update\x20react_module\x20Artifact\x20','read','favorite','2CmcuqM','Artifact\x20ID','boolean','react','file','num','react_module\x20imports\x20are\x20limited\x20to:\x20','bool','1490826AMdrIJ','build','Artifact\x20display\x20name','572yXynKV','string','map','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','Updated\x20Artifact\x20','name','@ant-design/icons','metadata','compiledContent','lastIndex','lodash','.\x20Unsupported:\x20','Optional\x20favorite-state\x20filter','artifactType','number','object','update','POST','react-dom','createTime','dayjs','Created\x20Artifact\x20','body','4999488tTtpfL','isArray','join','flag','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','length','6815445eLYMGi','list','/update'];a10_0x28bf=function(){return _0x355dec;};return a10_0x28bf();}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_0x5d1f4f(0x119),'type':a10_0x5d1f4f(0x121),'required':!![],'description':a10_0x5d1f4f(0xfc)},ARTIFACT_NAME_FLAG={'name':a10_0x5d1f4f(0x125),'type':'string','description':a10_0x5d1f4f(0x11f)},METADATA_FLAG={'name':a10_0x5d1f4f(0x127),'type':a10_0x5d1f4f(0x121),'description':a10_0x5d1f4f(0x13b)};function isPlainObject(_0x110010){const _0x546e13=a10_0x5d1f4f;return typeof _0x110010===_0x546e13(0x12f)&&_0x110010!==null&&!Array[_0x546e13(0x138)](_0x110010);}function a10_0x2218(_0xa9c829,_0x3bc75a){_0xa9c829=_0xa9c829-0xec;const _0x28bf76=a10_0x28bf();let _0x221880=_0x28bf76[_0xa9c829];return _0x221880;}function readSourceFile(_0x1ef5df){const _0x5b8df1=a10_0x5d1f4f;if(!_0x1ef5df)throw CliErrors[_0x5b8df1(0xfb)](_0x5b8df1(0xf2));if(!existsSync(_0x1ef5df))throw CliErrors[_0x5b8df1(0xfb)](_0x5b8df1(0xef)+_0x1ef5df);if(!statSync(_0x1ef5df)[_0x5b8df1(0xff)]())throw CliErrors[_0x5b8df1(0xfb)](_0x5b8df1(0xf6)+_0x1ef5df);const _0x5e4ed2=readFileSync(_0x1ef5df,_0x5b8df1(0xfa));return validateReactModuleSource(_0x5e4ed2),_0x5e4ed2;}function parseMetadata(_0x1af685){const _0x3f6320=a10_0x5d1f4f;if(!_0x1af685)return undefined;let _0x2c5e9d;try{_0x2c5e9d=JSON[_0x3f6320(0x100)](_0x1af685);}catch{throw CliErrors[_0x3f6320(0xfb)](_0x3f6320(0x105)+_0x1af685);}if(!isPlainObject(_0x2c5e9d))throw CliErrors[_0x3f6320(0xfb)](_0x3f6320(0x111));const _0x46b08c={..._0x2c5e9d};return delete _0x46b08c[_0x3f6320(0x128)],_0x46b08c;}function getPackageName(_0xaa4cff){const _0x1a5baa=a10_0x5d1f4f;if(_0xaa4cff['startsWith']('@')){const [_0x450a28,_0x2716f5]=_0xaa4cff[_0x1a5baa(0xf9)]('/');return _0x450a28&&_0x2716f5?_0x450a28+'/'+_0x2716f5:_0xaa4cff;}return _0xaa4cff[_0x1a5baa(0xf9)]('/')[0x0]||_0xaa4cff;}function validateAllowedImports(_0x4c7787){const _0x583fc4=a10_0x5d1f4f,_0x351241=new Set();for(const _0x5efa21 of IMPORT_SOURCE_PATTERNS){_0x5efa21[_0x583fc4(0x129)]=0x0;let _0x243a5f;while((_0x243a5f=_0x5efa21[_0x583fc4(0x108)](_0x4c7787))!==null){const _0x2f2836=_0x243a5f[0x1]?.[_0x583fc4(0xee)]();_0x2f2836&&_0x351241['add'](_0x2f2836);}}const _0x2d2253=[..._0x351241][_0x583fc4(0x122)](getPackageName)[_0x583fc4(0x101)](_0x62affe=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x62affe));if(_0x2d2253[_0x583fc4(0x13c)]>0x0)throw CliErrors[_0x583fc4(0xfb)](_0x583fc4(0x11b)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x583fc4(0x12b)+[...new Set(_0x2d2253)][_0x583fc4(0x139)](',\x20'));}export function validateReactModuleSource(_0x50b6f0){const _0x148c27=a10_0x5d1f4f;if(!_0x50b6f0[_0x148c27(0xee)]())throw CliErrors[_0x148c27(0xfb)]('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS['some'](_0xb7b439=>_0xb7b439[_0x148c27(0xed)](_0x50b6f0)))throw CliErrors[_0x148c27(0xfb)](_0x148c27(0x123));validateAllowedImports(_0x50b6f0);}function buildArtifactInput(_0x3ce45a){const _0x160fb7=a10_0x5d1f4f,_0x449822=readSourceFile(_0x3ce45a['str'](_0x160fb7(0x119))),_0x598aab=_0x3ce45a[_0x160fb7(0xf0)]('name')[_0x160fb7(0xee)](),_0x417a87=parseMetadata(_0x3ce45a[_0x160fb7(0xf0)](_0x160fb7(0x127)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x598aab?{'name':_0x598aab}:{},'content':_0x449822,..._0x417a87?{'metadata':_0x417a87}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x21addf){const _0x27a31f=a10_0x5d1f4f;return{'id':_0x21addf['id'],'name':_0x21addf[_0x27a31f(0x125)],'artifactType':_0x21addf[_0x27a31f(0x12d)],'source':_0x21addf[_0x27a31f(0xfd)],'favorite':_0x21addf[_0x27a31f(0x114)],'deleted':_0x21addf['deleted'],'createTime':_0x21addf[_0x27a31f(0x133)],'updateTime':_0x21addf[_0x27a31f(0xf3)]};}function detailArtifact(_0x3cc6ac){const _0x23b7d4=a10_0x5d1f4f;return{'id':_0x3cc6ac['id'],'appCode':_0x3cc6ac[_0x23b7d4(0xf4)],'name':_0x3cc6ac['name'],'artifactType':_0x3cc6ac[_0x23b7d4(0x12d)],'source':_0x3cc6ac[_0x23b7d4(0xfd)],'favorite':_0x3cc6ac[_0x23b7d4(0x114)],'deleted':_0x3cc6ac[_0x23b7d4(0xec)],'content':_0x3cc6ac[_0x23b7d4(0x10f)]??'','compiledContent':_0x3cc6ac[_0x23b7d4(0x128)],'metadata':_0x3cc6ac[_0x23b7d4(0x127)]??{},'createTime':_0x3cc6ac[_0x23b7d4(0x133)],'updateTime':_0x3cc6ac[_0x23b7d4(0xf3)]};}function readFavoriteFlag(_0x5b98a6){const _0x24ff8d=a10_0x5d1f4f,_0xc6d442=_0x5b98a6[_0x24ff8d(0x13a)](_0x24ff8d(0x114));return _0xc6d442===undefined||_0xc6d442===null||_0xc6d442===''?undefined:_0x5b98a6[_0x24ff8d(0x11c)]('favorite');}const artifactList={'service':a10_0x5d1f4f(0x140),'command':a10_0x5d1f4f(0x13e),'description':'List\x20current-app\x20react_module\x20Artifacts','risk':a10_0x5d1f4f(0x113),'flags':[{'name':'source','type':a10_0x5d1f4f(0x121),'description':'Optional\x20source\x20filter,\x20for\x20example\x20AGENT'},{'name':'favorite','type':a10_0x5d1f4f(0x117),'description':a10_0x5d1f4f(0x12c)},VERBOSE_FLAG],async 'execute'(_0x325b36){const _0x53bdef=a10_0x5d1f4f,_0x312627=await listRuntimeArtifacts(_0x325b36[_0x53bdef(0xf4)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x325b36[_0x53bdef(0xf0)]('source')?{'source':_0x325b36['str']('source')}:{},...readFavoriteFlag(_0x325b36)!==undefined?{'favorite':readFavoriteFlag(_0x325b36)}:{}});return{'ok':!![],'data':{'total':_0x312627[_0x53bdef(0x13c)],'items':_0x325b36[_0x53bdef(0x11c)]('verbose')?_0x312627:_0x312627[_0x53bdef(0x122)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x5d1f4f(0x140),'command':'detail','description':a10_0x5d1f4f(0x10d),'risk':a10_0x5d1f4f(0x113),'flags':[{...ID_FLAG,'description':a10_0x5d1f4f(0x116)}],async 'execute'(_0x32cb6c){const _0x30e8b5=a10_0x5d1f4f,_0x52e7a2=await getRuntimeArtifact(_0x32cb6c[_0x30e8b5(0x11a)]('id'),_0x32cb6c['appCode']);return{'ok':!![],'data':detailArtifact(_0x52e7a2)};}},artifactCreate={'service':'artifact','command':a10_0x5d1f4f(0x109),'description':a10_0x5d1f4f(0x10b),'risk':a10_0x5d1f4f(0x10a),'confirmationDescription':'保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5806ca){const _0x45bb87=a10_0x5d1f4f,_0x5654ca=buildArtifactInput(_0x5806ca),_0x47353d=await createRuntimeArtifact(_0x5806ca['appCode'],_0x5654ca);return{'ok':!![],'data':detailArtifact(_0x47353d),'message':_0x45bb87(0x135)+_0x47353d['id']+(_0x47353d[_0x45bb87(0x125)]?'\x20('+_0x47353d[_0x45bb87(0x125)]+')':'')};},async 'dryRun'(_0x5919ba){const _0xdf59a1=a10_0x5d1f4f,_0x783405=buildArtifactInput(_0x5919ba);return dryRun(_0xdf59a1(0x131),_0xdf59a1(0x10c))[_0xdf59a1(0x136)]({'appCode':_0x5919ba[_0xdf59a1(0xf4)],..._0x783405})[_0xdf59a1(0x103)]('Preview:\x20create\x20react_module\x20Artifact')['build']();},'writeEventSubject'(_0x37efb6){const _0x520a3d=a10_0x5d1f4f,_0x3f8fc4=_0x37efb6['data']?.['id'];if(typeof _0x3f8fc4!==_0x520a3d(0x121)&&typeof _0x3f8fc4!=='number')return undefined;return{'kind':_0x520a3d(0x140),'id':String(_0x3f8fc4),'action':_0x520a3d(0x109)};}},artifactUpdate={'service':a10_0x5d1f4f(0x140),'command':a10_0x5d1f4f(0x130),'description':a10_0x5d1f4f(0xf8),'risk':a10_0x5d1f4f(0x10a),'confirmationDescription':'保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','flags':[{...ID_FLAG,'description':a10_0x5d1f4f(0x116)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x49ec57){const _0x11b180=a10_0x5d1f4f,_0x5db355=_0x49ec57[_0x11b180(0x11a)]('id'),_0x1f6c46=buildArtifactInput(_0x49ec57),_0x4f7bf2=await updateRuntimeArtifact(_0x5db355,_0x49ec57['appCode'],_0x1f6c46);return{'ok':!![],'data':detailArtifact(_0x4f7bf2),'message':_0x11b180(0x124)+_0x4f7bf2['id']+(_0x4f7bf2[_0x11b180(0x125)]?'\x20('+_0x4f7bf2[_0x11b180(0x125)]+')':'')};},async 'dryRun'(_0xd90036){const _0x192031=a10_0x5d1f4f,_0x311763=_0xd90036['num']('id'),_0x44c3bf=buildArtifactInput(_0xd90036);return dryRun('POST',_0x192031(0xf1)+_0x311763+_0x192031(0x13f))[_0x192031(0x136)]({'appCode':_0xd90036[_0x192031(0xf4)],..._0x44c3bf})[_0x192031(0x103)](_0x192031(0x112)+_0x311763)[_0x192031(0x11e)]();},'writeEventSubject'(_0x455a27){const _0x2f5b7d=a10_0x5d1f4f,_0x4a42a1=_0x455a27[_0x2f5b7d(0x110)]?.['id'];if(typeof _0x4a42a1!==_0x2f5b7d(0x121)&&typeof _0x4a42a1!==_0x2f5b7d(0x12e))return undefined;return{'kind':'artifact','id':String(_0x4a42a1),'action':'update'};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x113154=a10_0x39ec;(function(_0x3f6b9c,_0x2b4e61){const _0x544de7=a10_0x39ec,_0x17dd73=_0x3f6b9c();while(!![]){try{const _0x19ff20=parseInt(_0x544de7(0x85))/0x1*(parseInt(_0x544de7(0x8b))/0x2)+parseInt(_0x544de7(0xa2))/0x3*(parseInt(_0x544de7(0xbf))/0x4)+-parseInt(_0x544de7(0xc9))/0x5+-parseInt(_0x544de7(0xae))/0x6*(-parseInt(_0x544de7(0x8c))/0x7)+-parseInt(_0x544de7(0xc4))/0x8*(parseInt(_0x544de7(0x89))/0x9)+parseInt(_0x544de7(0x87))/0xa*(parseInt(_0x544de7(0xa7))/0xb)+-parseInt(_0x544de7(0xb7))/0xc;if(_0x19ff20===_0x2b4e61)break;else _0x17dd73['push'](_0x17dd73['shift']());}catch(_0x39e9d2){_0x17dd73['push'](_0x17dd73['shift']());}}}(a10_0x3e39,0xdfa73));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';function a10_0x39ec(_0x2c8564,_0x223b97){_0x2c8564=_0x2c8564-0x85;const _0x3e395b=a10_0x3e39();let _0x39ec82=_0x3e395b[_0x2c8564];return _0x39ec82;}const ARTIFACT_TYPE_REACT_MODULE='react_module',ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a10_0x113154(0x90),'react-dom','lodash',a10_0x113154(0xac),'antd',a10_0x113154(0x8a)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x113154(0xa5)](',\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_0x113154(0xc6),'type':a10_0x113154(0xa6),'required':!![],'description':a10_0x113154(0xca)},ARTIFACT_NAME_FLAG={'name':a10_0x113154(0xaa),'type':'string','description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a10_0x113154(0xc0),'type':a10_0x113154(0xa6),'description':a10_0x113154(0x9e)};function isPlainObject(_0xd88b45){const _0x16993f=a10_0x113154;return typeof _0xd88b45==='object'&&_0xd88b45!==null&&!Array[_0x16993f(0x8e)](_0xd88b45);}function readSourceFile(_0x444bc3){const _0x2e040d=a10_0x113154;if(!_0x444bc3)throw CliErrors['validation'](_0x2e040d(0xb2));if(!existsSync(_0x444bc3))throw CliErrors['validation'](_0x2e040d(0x8d)+_0x444bc3);if(!statSync(_0x444bc3)[_0x2e040d(0xb3)]())throw CliErrors[_0x2e040d(0xa3)](_0x2e040d(0xb6)+_0x444bc3);const _0x3706e5=readFileSync(_0x444bc3,_0x2e040d(0xcb));return validateReactModuleSource(_0x3706e5),_0x3706e5;}function parseMetadata(_0x503b53){const _0x4bf06f=a10_0x113154;if(!_0x503b53)return undefined;let _0x535667;try{_0x535667=JSON[_0x4bf06f(0xa0)](_0x503b53);}catch{throw CliErrors[_0x4bf06f(0xa3)]('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x503b53);}if(!isPlainObject(_0x535667))throw CliErrors[_0x4bf06f(0xa3)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x311978={..._0x535667};return delete _0x311978['compiledContent'],_0x311978;}function getPackageName(_0x3b1632){const _0x1e808d=a10_0x113154;if(_0x3b1632['startsWith']('@')){const [_0x4231eb,_0x432e71]=_0x3b1632[_0x1e808d(0xbe)]('/');return _0x4231eb&&_0x432e71?_0x4231eb+'/'+_0x432e71:_0x3b1632;}return _0x3b1632['split']('/')[0x0]||_0x3b1632;}function validateAllowedImports(_0x5d2372){const _0x3886ac=a10_0x113154,_0x4ee424=new Set();for(const _0x317765 of IMPORT_SOURCE_PATTERNS){_0x317765['lastIndex']=0x0;let _0x44fbec;while((_0x44fbec=_0x317765['exec'](_0x5d2372))!==null){const _0x5d1ecc=_0x44fbec[0x1]?.[_0x3886ac(0xa1)]();_0x5d1ecc&&_0x4ee424[_0x3886ac(0x9a)](_0x5d1ecc);}}const _0x22f70d=[..._0x4ee424][_0x3886ac(0xa4)](getPackageName)[_0x3886ac(0x97)](_0x19d77b=>!ALLOWED_REACT_MODULE_IMPORTS[_0x3886ac(0xc5)](_0x19d77b));if(_0x22f70d[_0x3886ac(0xce)]>0x0)throw CliErrors[_0x3886ac(0xa3)](_0x3886ac(0xc3)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x3886ac(0xaf)+[...new Set(_0x22f70d)][_0x3886ac(0xa5)](',\x20'));}export function validateReactModuleSource(_0xc863ca){const _0x538482=a10_0x113154;if(!_0xc863ca[_0x538482(0xa1)]())throw CliErrors[_0x538482(0xa3)](_0x538482(0xb5));if(PAGE_LEVEL_PATTERNS[_0x538482(0x9c)](_0x255fc0=>_0x255fc0[_0x538482(0xab)](_0xc863ca)))throw CliErrors[_0x538482(0xa3)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0xc863ca);}function buildArtifactInput(_0x7da449){const _0x45f9b1=a10_0x113154,_0x11eeaa=readSourceFile(_0x7da449['str'](_0x45f9b1(0xc6))),_0xd0b0f0=_0x7da449['str'](_0x45f9b1(0xaa))[_0x45f9b1(0xa1)](),_0x546a3a=parseMetadata(_0x7da449[_0x45f9b1(0xcf)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0xd0b0f0?{'name':_0xd0b0f0}:{},'content':_0x11eeaa,..._0x546a3a?{'metadata':_0x546a3a}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x401ed2){const _0x3f19de=a10_0x113154;return{'id':_0x401ed2['id'],'name':_0x401ed2[_0x3f19de(0xaa)],'artifactType':_0x401ed2[_0x3f19de(0x94)],'source':_0x401ed2[_0x3f19de(0x8f)],'favorite':_0x401ed2[_0x3f19de(0xb0)],'deleted':_0x401ed2[_0x3f19de(0xb4)],'createTime':_0x401ed2[_0x3f19de(0xb8)],'updateTime':_0x401ed2['updateTime']};}function detailArtifact(_0x241ede){const _0x3f210d=a10_0x113154;return{'id':_0x241ede['id'],'appCode':_0x241ede[_0x3f210d(0xcc)],'name':_0x241ede[_0x3f210d(0xaa)],'artifactType':_0x241ede[_0x3f210d(0x94)],'source':_0x241ede['source'],'favorite':_0x241ede[_0x3f210d(0xb0)],'deleted':_0x241ede[_0x3f210d(0xb4)],'content':_0x241ede[_0x3f210d(0xd4)]??'','compiledContent':_0x241ede['compiledContent'],'metadata':_0x241ede['metadata']??{},'createTime':_0x241ede['createTime'],'updateTime':_0x241ede[_0x3f210d(0xc1)]};}function readFavoriteFlag(_0x2ba20a){const _0x4eeb67=a10_0x113154,_0x59826d=_0x2ba20a[_0x4eeb67(0xc7)](_0x4eeb67(0xb0));return _0x59826d===undefined||_0x59826d===null||_0x59826d===''?undefined:_0x2ba20a[_0x4eeb67(0x95)](_0x4eeb67(0xb0));}const artifactList={'service':'artifact','command':a10_0x113154(0x9d),'description':a10_0x113154(0xad),'risk':'read','flags':[{'name':'source','type':'string','description':a10_0x113154(0xa8)},{'name':'favorite','type':a10_0x113154(0xd2),'description':a10_0x113154(0xa9)},VERBOSE_FLAG],async 'execute'(_0x575fda){const _0x2a7186=a10_0x113154,_0x2b6b62=await listRuntimeArtifacts(_0x575fda['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x575fda[_0x2a7186(0xcf)](_0x2a7186(0x8f))?{'source':_0x575fda[_0x2a7186(0xcf)]('source')}:{},...readFavoriteFlag(_0x575fda)!==undefined?{'favorite':readFavoriteFlag(_0x575fda)}:{}});return{'ok':!![],'data':{'total':_0x2b6b62[_0x2a7186(0xce)],'items':_0x575fda[_0x2a7186(0x95)](_0x2a7186(0xb9))?_0x2b6b62:_0x2b6b62[_0x2a7186(0xa4)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x113154(0x91),'command':a10_0x113154(0xba),'description':a10_0x113154(0x9b),'risk':'read','flags':[{...ID_FLAG,'description':a10_0x113154(0xb1)}],async 'execute'(_0x23d561){const _0x2d967f=a10_0x113154,_0x532b17=await getRuntimeArtifact(_0x23d561[_0x2d967f(0xbc)]('id'),_0x23d561[_0x2d967f(0xcc)]);return{'ok':!![],'data':detailArtifact(_0x532b17)};}},artifactCreate={'service':'artifact','command':'create','description':a10_0x113154(0x93),'risk':a10_0x113154(0x99),'confirmationDescription':a10_0x113154(0xd1),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2c649e){const _0x312f49=a10_0x113154,_0x59d3db=buildArtifactInput(_0x2c649e),_0x31a3e1=await createRuntimeArtifact(_0x2c649e[_0x312f49(0xcc)],_0x59d3db);return{'ok':!![],'data':detailArtifact(_0x31a3e1),'message':_0x312f49(0x9f)+_0x31a3e1['id']+(_0x31a3e1['name']?'\x20('+_0x31a3e1[_0x312f49(0xaa)]+')':'')};},async 'dryRun'(_0xeebda8){const _0x4d17eb=a10_0x113154,_0x167d95=buildArtifactInput(_0xeebda8);return dryRun(_0x4d17eb(0x86),'/client/artifact/create')[_0x4d17eb(0xd0)]({'appCode':_0xeebda8['appCode'],..._0x167d95})[_0x4d17eb(0x98)](_0x4d17eb(0xd3))['build']();},'writeEventSubject'(_0x2867b7){const _0x14272f=a10_0x113154,_0x9f947b=_0x2867b7[_0x14272f(0xcd)]?.['id'];if(typeof _0x9f947b!=='string'&&typeof _0x9f947b!=='number')return undefined;return{'kind':'artifact','id':String(_0x9f947b),'action':_0x14272f(0xc8)};}},artifactUpdate={'service':a10_0x113154(0x91),'command':a10_0x113154(0xbd),'description':'根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','risk':a10_0x113154(0x99),'confirmationDescription':'保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','flags':[{...ID_FLAG,'description':a10_0x113154(0xb1)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0xc4355a){const _0x447eed=a10_0x113154,_0x41908a=_0xc4355a[_0x447eed(0xbc)]('id'),_0x39ce6f=buildArtifactInput(_0xc4355a),_0x2beb21=await updateRuntimeArtifact(_0x41908a,_0xc4355a[_0x447eed(0xcc)],_0x39ce6f);return{'ok':!![],'data':detailArtifact(_0x2beb21),'message':_0x447eed(0x88)+_0x2beb21['id']+(_0x2beb21[_0x447eed(0xaa)]?'\x20('+_0x2beb21[_0x447eed(0xaa)]+')':'')};},async 'dryRun'(_0x249941){const _0x3d2bed=a10_0x113154,_0x5eea8f=_0x249941['num']('id'),_0x55f4a4=buildArtifactInput(_0x249941);return dryRun('POST',_0x3d2bed(0x96)+_0x5eea8f+_0x3d2bed(0x92))[_0x3d2bed(0xd0)]({'appCode':_0x249941['appCode'],..._0x55f4a4})[_0x3d2bed(0x98)](_0x3d2bed(0xbb)+_0x5eea8f)['build']();},'writeEventSubject'(_0x2da154){const _0x58d18c=a10_0x113154,_0x3b714e=_0x2da154[_0x58d18c(0xcd)]?.['id'];if(typeof _0x3b714e!==_0x58d18c(0xa6)&&typeof _0x3b714e!==_0x58d18c(0xc2))return undefined;return{'kind':_0x58d18c(0x91),'id':String(_0x3b714e),'action':'update'};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];function a10_0x3e39(){const _0x3367e3=['name','test','dayjs','List\x20current-app\x20react_module\x20Artifacts','785706YqNFQU','.\x20Unsupported:\x20','favorite','Artifact\x20ID','File\x20path\x20is\x20required.','isFile','deleted','Artifact\x20source\x20file\x20is\x20blank.','File\x20is\x20not\x20a\x20regular\x20file:\x20','8444916yzsQgM','createTime','verbose','detail','Preview:\x20update\x20react_module\x20Artifact\x20','num','update','split','2148lrVkbI','metadata','updateTime','number','react_module\x20imports\x20are\x20limited\x20to:\x20','8bVSWer','includes','file','flag','create','8248285DMqfuG','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','utf8','appCode','data','length','str','body','保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','boolean','Preview:\x20create\x20react_module\x20Artifact','content','566961LRlbYL','POST','42940VASzOq','Updated\x20Artifact\x20','4133439EUPRLk','@ant-design/icons','4AxzVUW','7ISmBVH','File\x20not\x20found:\x20','isArray','source','react','artifact','/update','根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','artifactType','bool','/client/artifact/','filter','description','write','add','Show\x20one\x20Artifact\x20by\x20id','some','list','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','Created\x20Artifact\x20','parse','trim','8823CzMdBV','validation','map','join','string','2266yGWrgR','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','Optional\x20favorite-state\x20filter'];a10_0x3e39=function(){return _0x3367e3;};return a10_0x3e39();}
@@ -1 +1 @@
1
- const a11_0x2ff205=a11_0x2b88;(function(_0x5df87f,_0x464a40){const _0x119d79=a11_0x2b88,_0x4d9901=_0x5df87f();while(!![]){try{const _0xb7d79d=-parseInt(_0x119d79(0x190))/0x1+-parseInt(_0x119d79(0x172))/0x2+parseInt(_0x119d79(0x16f))/0x3*(-parseInt(_0x119d79(0x17a))/0x4)+-parseInt(_0x119d79(0x175))/0x5*(parseInt(_0x119d79(0x178))/0x6)+parseInt(_0x119d79(0x184))/0x7*(-parseInt(_0x119d79(0x17b))/0x8)+-parseInt(_0x119d79(0x1a4))/0x9*(-parseInt(_0x119d79(0x187))/0xa)+parseInt(_0x119d79(0x186))/0xb;if(_0xb7d79d===_0x464a40)break;else _0x4d9901['push'](_0x4d9901['shift']());}catch(_0x4a2e6e){_0x4d9901['push'](_0x4d9901['shift']());}}}(a11_0x40d3,0x1d4b1));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';function a11_0x40d3(){const _0x4c6b94=['signal','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','91eRVURj','expired','4787519emvDVh','20ThIwIX','networkError','/api/device-auth/token','write','getTime','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','\x20auth\x20device','padStart','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','32844HkZKSW','once','global','Device\x20auth\x20API\x20returned\x20HTTP\x20','/device-auth?code=','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','&source=','SIGINT','object','now','parse','device','Device\x20authorization\x20successful.','bool','source','utf8','trim','\x0dWaiting\x20for\x20authorization...\x20','string','Invalid\x20device\x20auth\x20response','3609tNFlvt','scope','url-only','randomUUID','Write\x20to\x20project\x20config','success','code','access_key','project','),\x20retrying...','通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','apiError','cancelled','POST','createdAt','lovrabet-cli','accessKey','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','log','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','test','Device\x20auth\x20API\x20error\x20(','Invalid\x20access_key\x20returned\x20by\x20server.','auth','stderr','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','toISOString','177273bordrx','data','boolean','187866BjrYjg','/.device-auth','validation','9515PcRKPd','abort','After\x20authorizing,\x20re-run:\x20','198eWTIiv','str','4tTnkWS','41464QmIYWN','status','Device\x20authorization\x20cancelled.','floor','removeListener','global-default','\x20auth\x20status'];a11_0x40d3=function(){return _0x4c6b94;};return a11_0x40d3();}import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x144838){const _0x46431a=a11_0x2b88;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x144838[_0x46431a(0x19d)]('global'),'explicitProject':_0x144838['bool'](_0x46431a(0x1ac)),'policy':_0x46431a(0x180)}));}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 _0x20a920=a11_0x2b88;return crypto[_0x20a920(0x1a7)]();}export function buildDeviceAuthUrl(_0x51abdc,_0x285673,_0x21922e=a11_0x2ff205(0x163)){const _0x5635b2=a11_0x2ff205;return _0x51abdc+_0x5635b2(0x194)+encodeURIComponent(_0x285673)+_0x5635b2(0x196)+encodeURIComponent(_0x21922e);}export function getDeviceCodePath(){const _0xa8adf0=a11_0x2ff205;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0xa8adf0(0x173);}export function readStoredDeviceCode(){const _0x91dc5e=a11_0x2ff205,_0x29c0b5=getDeviceCodePath();if(!existsSync(_0x29c0b5))return null;try{const _0x1c0436=readFileSync(_0x29c0b5,{'encoding':_0x91dc5e(0x19f)}),_0x316f4c=JSON[_0x91dc5e(0x19a)](_0x1c0436);if(_0x316f4c&&typeof _0x316f4c[_0x91dc5e(0x1aa)]===_0x91dc5e(0x1a2)&&typeof _0x316f4c[_0x91dc5e(0x162)]===_0x91dc5e(0x1a2)&&(_0x316f4c[_0x91dc5e(0x1a5)]===_0x91dc5e(0x192)||_0x316f4c[_0x91dc5e(0x1a5)]===_0x91dc5e(0x1ac)))return _0x316f4c;}catch{}return null;}export function writeStoredDeviceCode(_0x493afe,_0x582ed9){const _0x1b1edb=a11_0x2ff205,_0x45b96a=getDeviceCodePath(),_0x2d2fb9=dirname(_0x45b96a);!existsSync(_0x2d2fb9)&&mkdirSync(_0x2d2fb9,{'recursive':!![]});const _0x3c509b={'code':_0x493afe,'createdAt':new Date()[_0x1b1edb(0x16e)](),'scope':_0x582ed9};writeFileSync(_0x45b96a,JSON['stringify'](_0x3c509b),{'encoding':'utf8','mode':0x180});}export function deleteStoredDeviceCode(){const _0x9fe97f=getDeviceCodePath();try{unlinkSync(_0x9fe97f);}catch{}}export function isStoredDeviceCodeExpired(_0x9b1ba1){const _0x59528c=a11_0x2ff205;return Date[_0x59528c(0x199)]()-new Date(_0x9b1ba1['createdAt'])[_0x59528c(0x18b)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x4991a9,_0x5324fa){const _0x4d2809=a11_0x2ff205,_0x3924f7=_0x4991a9+_0x4d2809(0x189),_0x3beb2f=new AbortController(),_0x252477=setTimeout(()=>_0x3beb2f[_0x4d2809(0x176)](),0x2710),_0x31c3ae=await fetch(_0x3924f7,{'method':_0x4d2809(0x161),'headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'code':_0x5324fa}),'signal':_0x3beb2f[_0x4d2809(0x182)]});clearTimeout(_0x252477);if(!_0x31c3ae['ok'])throw CliErrors['networkError'](_0x4d2809(0x193)+_0x31c3ae[_0x4d2809(0x17c)]);const _0x192d1f=await _0x31c3ae['json'](),_0x311a59=_0x192d1f['data']&&typeof _0x192d1f[_0x4d2809(0x170)]===_0x4d2809(0x198)?_0x192d1f[_0x4d2809(0x170)]:_0x192d1f;if(!_0x311a59||typeof _0x311a59[_0x4d2809(0x17c)]!==_0x4d2809(0x1a2))throw CliErrors['apiError'](_0x4d2809(0x1a3));return{'status':_0x311a59[_0x4d2809(0x17c)],'access_key':typeof _0x311a59[_0x4d2809(0x1ab)]===_0x4d2809(0x1a2)?_0x311a59[_0x4d2809(0x1ab)]:undefined};}function a11_0x2b88(_0x542bd5,_0x4cbfd9){_0x542bd5=_0x542bd5-0x15f;const _0x40d39b=a11_0x40d3();let _0x2b8820=_0x40d39b[_0x542bd5];return _0x2b8820;}export async function pollDeviceToken(_0x1c4d02,_0xc00180,_0x4d041b){const _0x578143=a11_0x2ff205;let _0x3e3543=0x0;for(let _0x3c87da=0x0;_0x3c87da<MAX_POLLS;_0x3c87da++){if(_0x4d041b['aborted'])throw CliErrors[_0x578143(0x160)]('Device\x20authorization\x20cancelled.');let _0x4a2458;try{_0x4a2458=await fetchDeviceToken(_0x1c4d02,_0xc00180);}catch(_0x35bc04){if(_0x35bc04 instanceof Error&&_0x35bc04['name']==='AbortError')throw CliErrors[_0x578143(0x160)](_0x578143(0x17d));_0x3e3543++;if(_0x3e3543>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x578143(0x188)](_0x578143(0x183));writeCliSideChannelLine(_0x578143(0x169)+_0x3e3543+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x578143(0x1ad)),await sleep(POLL_INTERVAL_MS);continue;}_0x3e3543=0x0;if(_0x4a2458[_0x578143(0x17c)]===_0x578143(0x1a9)){if(!_0x4a2458[_0x578143(0x1ab)])throw CliErrors[_0x578143(0x15f)]('Invalid\x20access_key\x20returned\x20by\x20server.');return _0x4a2458['access_key'];}if(_0x4a2458[_0x578143(0x17c)]===_0x578143(0x185)){deleteStoredDeviceCode();throw CliErrors[_0x578143(0x174)]('Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}const _0x116ad0=(_0x3c87da+0x1)*POLL_INTERVAL_MS,_0x25c7d0=DEVICE_CODE_TTL_MS-_0x116ad0,_0x5b6d2c=Math['floor'](_0x25c7d0/0xea60),_0x187755=Math[_0x578143(0x17e)](_0x25c7d0%0xea60/0x3e8);process['stderr'][_0x578143(0x18a)](_0x578143(0x1a1)+_0x5b6d2c+':'+String(_0x187755)[_0x578143(0x18e)](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x578143(0x174)](_0x578143(0x165));}function sleep(_0x25a075){return new Promise(_0x5de379=>setTimeout(_0x5de379,_0x25a075));}export const authDeviceDefinition={'service':a11_0x2ff205(0x16b),'command':a11_0x2ff205(0x19b),'description':a11_0x2ff205(0x1ae),'risk':a11_0x2ff205(0x18a),'confirmationDescription':'将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x2ff205(0x192),'type':a11_0x2ff205(0x171),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a11_0x2ff205(0x171),'description':a11_0x2ff205(0x1a8),'default':![]},{'name':a11_0x2ff205(0x19e),'type':a11_0x2ff205(0x1a2),'description':'App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','default':'lovrabet-cli'},{'name':a11_0x2ff205(0x1a6),'type':a11_0x2ff205(0x171),'description':a11_0x2ff205(0x16d),'default':![]}],async 'execute'(_0x494f76){const _0x43b786=a11_0x2ff205,_0x1c5fd3=resolveAuthScopeFlags(_0x494f76),_0x208e9e=_0x1c5fd3[_0x43b786(0x192)]?_0x43b786(0x192):_0x43b786(0x1ac),_0x148dc5=readScopedConfig(_0x1c5fd3);if(_0x148dc5[_0x43b786(0x164)])return{'ok':!![],'message':_0x43b786(0x195)};const _0x10301b=(_0x494f76[_0x43b786(0x179)]('source')||_0x43b786(0x163))[_0x43b786(0x1a0)](),_0x26e34f=getUserDomain(),_0x7df86e=readStoredDeviceCode(),_0xc5a89b=_0x7df86e&&!isStoredDeviceCodeExpired(_0x7df86e)?_0x7df86e['code']:((()=>{const _0x40ce35=generateDeviceCode();return writeStoredDeviceCode(_0x40ce35,_0x208e9e),_0x40ce35;})()),_0xef2a5e=buildDeviceAuthUrl(_0x26e34f,_0xc5a89b,_0x10301b);if(_0x494f76[_0x43b786(0x19d)]('url-only'))return console[_0x43b786(0x166)](_0xef2a5e),{'ok':!![]};writeCliSideChannelLine(_0x43b786(0x18c)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0xef2a5e),writeCliSideChannelLine(''),writeCliSideChannelLine('The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.');if(_0x494f76['nonInteractive'])return writeCliSideChannelLine(_0x43b786(0x177)+CLI_BIN_NAME+_0x43b786(0x18d)),{'ok':!![],'message':_0x43b786(0x18f)};writeCliSideChannelLine(_0x43b786(0x167));const _0x7584d6=new AbortController(),_0x32cd9b=()=>{const _0x539d46=_0x43b786;_0x7584d6[_0x539d46(0x176)](),process[_0x539d46(0x17f)](_0x539d46(0x197),_0x32cd9b);};process[_0x43b786(0x191)]('SIGINT',_0x32cd9b);let _0x2616ad;try{_0x2616ad=await pollDeviceToken(_0x26e34f,_0xc5a89b,_0x7584d6[_0x43b786(0x182)]);}finally{process['removeListener'](_0x43b786(0x197),_0x32cd9b);}if(!ACCESS_KEY_PATTERN[_0x43b786(0x168)](_0x2616ad))throw CliErrors[_0x43b786(0x15f)](_0x43b786(0x16a));const _0x19c86c=readScopedConfig(_0x1c5fd3);return _0x19c86c[_0x43b786(0x164)]=_0x2616ad,writeScopedConfig(_0x19c86c,_0x1c5fd3),deleteStoredDeviceCode(),process[_0x43b786(0x16c)][_0x43b786(0x18a)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x208e9e+'\x20config.'),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+_0x43b786(0x181)),{'ok':!![],'message':_0x43b786(0x19c)};}};
1
+ const a11_0x155a7e=a11_0x3140;(function(_0x34ae82,_0x4f7176){const _0x10772e=a11_0x3140,_0x4e9af7=_0x34ae82();while(!![]){try{const _0x230865=-parseInt(_0x10772e(0xea))/0x1+parseInt(_0x10772e(0xfa))/0x2*(-parseInt(_0x10772e(0x105))/0x3)+parseInt(_0x10772e(0xff))/0x4+-parseInt(_0x10772e(0xf0))/0x5*(parseInt(_0x10772e(0xcf))/0x6)+-parseInt(_0x10772e(0xec))/0x7+parseInt(_0x10772e(0xe0))/0x8*(parseInt(_0x10772e(0xbe))/0x9)+parseInt(_0x10772e(0x102))/0xa*(parseInt(_0x10772e(0xb5))/0xb);if(_0x230865===_0x4f7176)break;else _0x4e9af7['push'](_0x4e9af7['shift']());}catch(_0x4648f2){_0x4e9af7['push'](_0x4e9af7['shift']());}}}(a11_0x1e08,0x21dc2));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';function a11_0x1e08(){const _0x2245c5=['AbortError','POST','SIGINT','name','224uuYBxl','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','data','Device\x20auth\x20API\x20error\x20(','After\x20authorizing,\x20re-run:\x20','\x20auth\x20device','bool','global','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','access_key','270138XBPpEN','\x0dWaiting\x20for\x20authorization...\x20','848673fjQXRm','将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','test','/.device-auth','325oJIdQx','utf8','project','padStart','Verify:\x20','Device\x20authorization\x20cancelled.','parse','\x20remaining','Write\x20to\x20project\x20config','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','78164UvkCrL','accessKey','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','),\x20retrying...','write','123868XnmNRU','floor','stderr','10NKZUCz','scope','Write\x20to\x20global\x20config\x20(default)','15diyGPM','auth','abort','&source=','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','apiError','homeDirName','5609428hZWZQL','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','validation','nonInteractive','json','AccessKey\x20saved\x20to\x20','expired','boolean','/device-auth?code=','77166AtYVlj','\x20config.','status','str','application/json','Device\x20auth\x20API\x20returned\x20HTTP\x20','Invalid\x20device\x20auth\x20response','lovrabet-cli','toISOString','code','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','stringify','randomUUID','getTime','Device\x20authorization\x20successful.','object','signal','5124wonrJO','Invalid\x20access_key\x20returned\x20by\x20server.','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','url-only','通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','removeListener','once','log','networkError','string','createdAt','cancelled','/api/device-auth/token'];a11_0x1e08=function(){return _0x2245c5;};return a11_0x1e08();}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(_0x423917){const _0x19e465=a11_0x3140;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x423917[_0x19e465(0xe6)]('global'),'explicitProject':_0x423917[_0x19e465(0xe6)]('project'),'policy':'global-default'}));}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 _0x3495f3=a11_0x3140;return crypto[_0x3495f3(0xca)]();}export function buildDeviceAuthUrl(_0x4dbdde,_0x56184e,_0x1a45a8=a11_0x155a7e(0xc5)){const _0xd65ac8=a11_0x155a7e;return _0x4dbdde+_0xd65ac8(0xbd)+encodeURIComponent(_0x56184e)+_0xd65ac8(0x108)+encodeURIComponent(_0x1a45a8);}export function getDeviceCodePath(){const _0x1d403b=a11_0x155a7e;return homedir()+'/'+PRODUCT_CONFIG[_0x1d403b(0xb4)]+_0x1d403b(0xef);}export function readStoredDeviceCode(){const _0x2a321e=a11_0x155a7e,_0xe5ea4=getDeviceCodePath();if(!existsSync(_0xe5ea4))return null;try{const _0x3f78f6=readFileSync(_0xe5ea4,{'encoding':_0x2a321e(0xf1)}),_0x4e304c=JSON[_0x2a321e(0xf6)](_0x3f78f6);if(_0x4e304c&&typeof _0x4e304c[_0x2a321e(0xc7)]===_0x2a321e(0xd8)&&typeof _0x4e304c[_0x2a321e(0xd9)]==='string'&&(_0x4e304c['scope']==='global'||_0x4e304c[_0x2a321e(0x103)]===_0x2a321e(0xf2)))return _0x4e304c;}catch{}return null;}export function writeStoredDeviceCode(_0x15c8c9,_0x3ecee4){const _0x2075bd=a11_0x155a7e,_0x515843=getDeviceCodePath(),_0x58c9ca=dirname(_0x515843);!existsSync(_0x58c9ca)&&mkdirSync(_0x58c9ca,{'recursive':!![]});const _0x5e8e9c={'code':_0x15c8c9,'createdAt':new Date()[_0x2075bd(0xc6)](),'scope':_0x3ecee4};writeFileSync(_0x515843,JSON[_0x2075bd(0xc9)](_0x5e8e9c),{'encoding':_0x2075bd(0xf1),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x450c97=getDeviceCodePath();try{unlinkSync(_0x450c97);}catch{}}function a11_0x3140(_0x3a8f53,_0x4e55d5){_0x3a8f53=_0x3a8f53-0xb4;const _0x1e0832=a11_0x1e08();let _0x314034=_0x1e0832[_0x3a8f53];return _0x314034;}export function isStoredDeviceCodeExpired(_0x57c587){const _0x152095=a11_0x155a7e;return Date['now']()-new Date(_0x57c587[_0x152095(0xd9)])[_0x152095(0xcb)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x11c753,_0x1e0531){const _0xe45a69=a11_0x155a7e,_0x401a51=_0x11c753+_0xe45a69(0xdb),_0x24ce10=new AbortController(),_0x391959=setTimeout(()=>_0x24ce10[_0xe45a69(0x107)](),0x2710),_0x2a4cf4=await fetch(_0x401a51,{'method':_0xe45a69(0xdd),'headers':{'Content-Type':_0xe45a69(0xc2)},'body':JSON['stringify']({'code':_0x1e0531}),'signal':_0x24ce10[_0xe45a69(0xce)]});clearTimeout(_0x391959);if(!_0x2a4cf4['ok'])throw CliErrors['networkError'](_0xe45a69(0xc3)+_0x2a4cf4['status']);const _0x554e62=await _0x2a4cf4[_0xe45a69(0xb9)](),_0x58b4ea=_0x554e62[_0xe45a69(0xe2)]&&typeof _0x554e62[_0xe45a69(0xe2)]===_0xe45a69(0xcd)?_0x554e62[_0xe45a69(0xe2)]:_0x554e62;if(!_0x58b4ea||typeof _0x58b4ea['status']!==_0xe45a69(0xd8))throw CliErrors[_0xe45a69(0x10a)](_0xe45a69(0xc4));return{'status':_0x58b4ea[_0xe45a69(0xc0)],'access_key':typeof _0x58b4ea[_0xe45a69(0xe9)]===_0xe45a69(0xd8)?_0x58b4ea['access_key']:undefined};}export async function pollDeviceToken(_0x5a2a88,_0x37c135,_0x3bfc80){const _0x4da7f3=a11_0x155a7e;let _0x14fcf6=0x0;for(let _0x10d179=0x0;_0x10d179<MAX_POLLS;_0x10d179++){if(_0x3bfc80['aborted'])throw CliErrors[_0x4da7f3(0xda)](_0x4da7f3(0xf5));let _0x51b301;try{_0x51b301=await fetchDeviceToken(_0x5a2a88,_0x37c135);}catch(_0x49c957){if(_0x49c957 instanceof Error&&_0x49c957[_0x4da7f3(0xdf)]===_0x4da7f3(0xdc))throw CliErrors[_0x4da7f3(0xda)]('Device\x20authorization\x20cancelled.');_0x14fcf6++;if(_0x14fcf6>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x4da7f3(0xd7)](_0x4da7f3(0xb6));writeCliSideChannelLine(_0x4da7f3(0xe3)+_0x14fcf6+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x4da7f3(0xfd)),await sleep(POLL_INTERVAL_MS);continue;}_0x14fcf6=0x0;if(_0x51b301['status']==='success'){if(!_0x51b301['access_key'])throw CliErrors[_0x4da7f3(0x10a)]('Invalid\x20access_key\x20returned\x20by\x20server.');return _0x51b301[_0x4da7f3(0xe9)];}if(_0x51b301[_0x4da7f3(0xc0)]===_0x4da7f3(0xbb)){deleteStoredDeviceCode();throw CliErrors[_0x4da7f3(0xb7)](_0x4da7f3(0xfc));}const _0xa2dc4c=(_0x10d179+0x1)*POLL_INTERVAL_MS,_0x4b9e31=DEVICE_CODE_TTL_MS-_0xa2dc4c,_0x30b9ac=Math[_0x4da7f3(0x100)](_0x4b9e31/0xea60),_0x215c0d=Math[_0x4da7f3(0x100)](_0x4b9e31%0xea60/0x3e8);process['stderr'][_0x4da7f3(0xfe)](_0x4da7f3(0xeb)+_0x30b9ac+':'+String(_0x215c0d)[_0x4da7f3(0xf3)](0x2,'0')+_0x4da7f3(0xf7)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x4da7f3(0xb7)](_0x4da7f3(0xc8));}function sleep(_0x2d6382){return new Promise(_0x1ee461=>setTimeout(_0x1ee461,_0x2d6382));}export const authDeviceDefinition={'service':a11_0x155a7e(0x106),'command':'device','description':a11_0x155a7e(0xd3),'risk':'write','confirmationDescription':a11_0x155a7e(0xed),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x155a7e(0xe7),'type':a11_0x155a7e(0xbc),'description':a11_0x155a7e(0x104),'default':!![]},{'name':a11_0x155a7e(0xf2),'type':a11_0x155a7e(0xbc),'description':a11_0x155a7e(0xf8),'default':![]},{'name':'source','type':a11_0x155a7e(0xd8),'description':a11_0x155a7e(0xf9),'default':a11_0x155a7e(0xc5)},{'name':a11_0x155a7e(0xd2),'type':a11_0x155a7e(0xbc),'description':a11_0x155a7e(0xe8),'default':![]}],async 'execute'(_0x2f9c33){const _0x2a6f88=a11_0x155a7e,_0x4a55df=resolveAuthScopeFlags(_0x2f9c33),_0x4f1d4b=_0x4a55df['global']?_0x2a6f88(0xe7):_0x2a6f88(0xf2),_0x30df98=readScopedConfig(_0x4a55df);if(_0x30df98['accessKey'])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x25c707=(_0x2f9c33[_0x2a6f88(0xc1)]('source')||_0x2a6f88(0xc5))['trim'](),_0x11c847=getUserDomain(),_0x320997=readStoredDeviceCode(),_0x4d3471=_0x320997&&!isStoredDeviceCodeExpired(_0x320997)?_0x320997[_0x2a6f88(0xc7)]:((()=>{const _0x3344ab=generateDeviceCode();return writeStoredDeviceCode(_0x3344ab,_0x4f1d4b),_0x3344ab;})()),_0x16a5af=buildDeviceAuthUrl(_0x11c847,_0x4d3471,_0x25c707);if(_0x2f9c33[_0x2a6f88(0xe6)](_0x2a6f88(0xd2)))return console[_0x2a6f88(0xd6)](_0x16a5af),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x16a5af),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x2a6f88(0xe1));if(_0x2f9c33[_0x2a6f88(0xb8)])return writeCliSideChannelLine(_0x2a6f88(0xe4)+CLI_BIN_NAME+_0x2a6f88(0xe5)),{'ok':!![],'message':_0x2a6f88(0x109)};writeCliSideChannelLine(_0x2a6f88(0xd1));const _0x507688=new AbortController(),_0x14439d=()=>{const _0x4e3218=_0x2a6f88;_0x507688['abort'](),process[_0x4e3218(0xd4)]('SIGINT',_0x14439d);};process[_0x2a6f88(0xd5)]('SIGINT',_0x14439d);let _0x5a88be;try{_0x5a88be=await pollDeviceToken(_0x11c847,_0x4d3471,_0x507688[_0x2a6f88(0xce)]);}finally{process[_0x2a6f88(0xd4)](_0x2a6f88(0xde),_0x14439d);}if(!ACCESS_KEY_PATTERN[_0x2a6f88(0xee)](_0x5a88be))throw CliErrors[_0x2a6f88(0x10a)](_0x2a6f88(0xd0));const _0x2c0982=readScopedConfig(_0x4a55df);return _0x2c0982[_0x2a6f88(0xfb)]=_0x5a88be,writeScopedConfig(_0x2c0982,_0x4a55df),deleteStoredDeviceCode(),process[_0x2a6f88(0x101)][_0x2a6f88(0xfe)]('\x0a'),writeCliSideChannelLine(_0x2a6f88(0xba)+_0x4f1d4b+_0x2a6f88(0xbf)),writeCliSideChannelLine(_0x2a6f88(0xf4)+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x2a6f88(0xcc)};}};