@lovrabet/lovrabet-cli 2.3.0-beta.4 → 2.3.0-beta.6

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 (168) 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/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.d.ts +1 -1
  91. package/lib/config/schema.js +1 -1
  92. package/lib/constant/app.js +1 -1
  93. package/lib/constant/auth-mode.js +1 -1
  94. package/lib/constant/cli.js +1 -1
  95. package/lib/constant/defaults.js +1 -1
  96. package/lib/constant/distribution.js +1 -1
  97. package/lib/constant/domain.js +1 -1
  98. package/lib/constant/env.js +1 -1
  99. package/lib/constant/output.js +1 -1
  100. package/lib/constant/product.js +1 -1
  101. package/lib/constant/region.js +1 -1
  102. package/lib/constant/risk.js +1 -1
  103. package/lib/constant/url.js +1 -1
  104. package/lib/context.d.ts +2 -0
  105. package/lib/context.js +1 -1
  106. package/lib/core/api-client.js +1 -1
  107. package/lib/core/db-resolver.js +1 -1
  108. package/lib/core/sdk-client.js +1 -1
  109. package/lib/errors.d.ts +1 -0
  110. package/lib/errors.js +1 -1
  111. package/lib/framework/build-all-flags.js +1 -1
  112. package/lib/framework/dryrun.js +1 -1
  113. package/lib/framework/flags.js +1 -1
  114. package/lib/framework/help.js +1 -1
  115. package/lib/framework/index.js +1 -1
  116. package/lib/framework/output.js +1 -1
  117. package/lib/framework/preparse.js +1 -1
  118. package/lib/framework/rate-limit.js +1 -1
  119. package/lib/framework/raw-flags.js +1 -1
  120. package/lib/framework/response.js +1 -1
  121. package/lib/framework/runner-confirmation.js +1 -1
  122. package/lib/framework/runner-error.js +1 -1
  123. package/lib/framework/runner.d.ts +9 -7
  124. package/lib/framework/runner.js +1 -1
  125. package/lib/framework/schema-export.js +1 -1
  126. package/lib/framework/service-order.js +1 -1
  127. package/lib/framework/types.js +1 -1
  128. package/lib/generated/build-info.d.ts +4 -4
  129. package/lib/generated/build-info.js +1 -1
  130. package/lib/help.js +1 -1
  131. package/lib/postinstall.js +1 -1
  132. package/lib/runtime/confirmation.js +1 -1
  133. package/lib/runtime/event.js +1 -1
  134. package/lib/runtime/index.js +1 -1
  135. package/lib/runtime/queue.js +1 -1
  136. package/lib/runtime/resolve.js +1 -1
  137. package/lib/skills/builtin-skill.js +1 -1
  138. package/lib/skills/npx-skills-add.js +1 -1
  139. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  140. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  141. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  142. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  143. package/lib/skills/runtime-skill-sync/links.js +1 -1
  144. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  145. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  146. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  147. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  148. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  149. package/lib/skills/runtime-skill-sync/push.js +1 -1
  150. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  151. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  152. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  153. package/lib/skills/runtime-skill-sync.js +1 -1
  154. package/lib/skills/skill-presence.js +1 -1
  155. package/lib/utils/access-key-redaction.js +1 -1
  156. package/lib/utils/apply-jq-filter.js +1 -1
  157. package/lib/utils/cli-version-check.js +1 -1
  158. package/lib/utils/cli-version-policy.js +1 -1
  159. package/lib/utils/logger.js +1 -1
  160. package/lib/utils/lossless-json.js +1 -1
  161. package/lib/utils/params.js +1 -1
  162. package/lib/utils/platform.js +1 -1
  163. package/lib/utils/update-notice.js +1 -1
  164. package/lib/utils/version.js +1 -1
  165. package/lib/utils/write-cli-side-channel.js +1 -1
  166. package/package.json +1 -1
  167. package/skills/lovrabet/SKILL.md +1 -1
  168. package/skills/lovrabet.manifest.json +3 -3
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x454e98=a0_0x2241;(function(_0x2e2395,_0x1d68dd){const _0x489a6e=a0_0x2241,_0xe05ce4=_0x2e2395();while(!![]){try{const _0x3427bf=parseInt(_0x489a6e(0x1ad))/0x1*(parseInt(_0x489a6e(0x191))/0x2)+-parseInt(_0x489a6e(0x1ac))/0x3+parseInt(_0x489a6e(0x1a6))/0x4*(parseInt(_0x489a6e(0x19c))/0x5)+-parseInt(_0x489a6e(0x1a8))/0x6+parseInt(_0x489a6e(0x192))/0x7*(parseInt(_0x489a6e(0x1b1))/0x8)+parseInt(_0x489a6e(0x1ae))/0x9*(parseInt(_0x489a6e(0x198))/0xa)+-parseInt(_0x489a6e(0x1a9))/0xb*(parseInt(_0x489a6e(0x190))/0xc);if(_0x3427bf===_0x1d68dd)break;else _0xe05ce4['push'](_0xe05ce4['shift']());}catch(_0x23d271){_0xe05ce4['push'](_0xe05ce4['shift']());}}}(a0_0x49f9,0x4acf9));import{jsx as a0_0x3c3eba}from'react/jsx-runtime';import a0_0x45630f from'meow';import{render}from'ink';function a0_0x2241(_0x29ec73,_0x2a7c7b){_0x29ec73=_0x29ec73-0x18f;const _0x49f98a=a0_0x49f9();let _0x224150=_0x49f98a[_0x29ec73];return _0x224150;}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_0x45630f(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x454e98(0x199)](handleError);async function main(){try{await run();}catch(_0x3af1ea){handleError(_0x3af1ea);}}async function run(){const _0x539c36=a0_0x454e98;let _0x486e10=cli[_0x539c36(0x19d)][0x0],_0x47557a=cli[_0x539c36(0x19d)][0x1];const _0x2574f0=cli[_0x539c36(0x1a4)];try{const {correctFlags:_0x5b4dff}=await import(_0x539c36(0x19b)),_0x5e0507=getAllDefinitions()['flatMap'](_0x26a2e5=>_0x26a2e5[_0x539c36(0x1a4)]??[]),{flags:_0x1dab3c,corrections:_0x4b02a8}=_0x5b4dff(_0x2574f0,_0x5e0507);if(_0x4b02a8[_0x539c36(0x1a0)]>0x0){for(const _0x1ca35f of _0x4b02a8){process[_0x539c36(0x1b8)]['write'](_0x539c36(0x1b3)+_0x1ca35f[_0x539c36(0x1af)]+_0x539c36(0x1aa)+_0x1ca35f[_0x539c36(0x1ab)]+_0x539c36(0x1b6)+_0x1ca35f['corrected']+'\x0a');}Object[_0x539c36(0x1b4)](_0x2574f0,_0x1dab3c);}}catch{}if(!_0x486e10){const {waitUntilExit:_0x100029}=render(a0_0x3c3eba(Help,{}));await _0x100029();return;}const _0x4d0808=resolveRemovedCommand(_0x486e10,_0x47557a);if(_0x4d0808)throw CliErrors[_0x539c36(0x1a3)](_0x4d0808[_0x539c36(0x194)],_0x4d0808[_0x539c36(0x19a)]);if(!isKnownService(_0x486e10)){const _0x39be1d=resolveDynamicServiceCommand(cli['input'],_0x2574f0);if(_0x39be1d){if(_0x2574f0[_0x539c36(0x197)]){console['log'](generateCommandHelp(_0x39be1d[_0x539c36(0x18f)]));return;}Object[_0x539c36(0x1b4)](_0x2574f0,_0x39be1d[_0x539c36(0x1a4)]);const _0xcc5e0c=buildConfigFromFlags(_0x2574f0);await initGlobalEnvironment(_0xcc5e0c);const _0x2fc71b=createPipelineEnv(_0xcc5e0c,_0x2574f0);_0x2fc71b['args']=_0x39be1d['args'],await runCommand(_0x39be1d[_0x539c36(0x18f)],_0x2fc71b);return;}if(_0x2574f0[_0x539c36(0x197)]){const _0x552354=generateDynamicServiceHelp(_0x486e10);if(_0x552354){console[_0x539c36(0x19f)](_0x552354);return;}}const {waitUntilExit:_0x54389b}=render(a0_0x3c3eba(Help,{}));await _0x54389b();return;}const _0x3580e8=getServiceEntry(_0x486e10);if(!_0x47557a){if(_0x2574f0['help']){console[_0x539c36(0x19f)](generateServiceHelp(_0x486e10));return;}if(_0x3580e8['defaultCommand'])_0x47557a=_0x3580e8['defaultCommand'];else{console[_0x539c36(0x19f)](generateServiceHelp(_0x486e10));return;}}const _0x3f5645=findDefinition(_0x486e10,_0x47557a);!_0x3f5645&&(console['log'](generateServiceHelp(_0x486e10)),handleError(CliErrors[_0x539c36(0x1b5)](_0x486e10+'\x20'+_0x47557a)));if(_0x2574f0[_0x539c36(0x197)]){console[_0x539c36(0x19f)](generateCommandHelp(_0x3f5645));return;}const _0x30c58c=buildConfigFromFlags(_0x2574f0);await initGlobalEnvironment(_0x30c58c);const _0x4096e6=createPipelineEnv(_0x30c58c,_0x2574f0);_0x4096e6[_0x539c36(0x1a1)]=cli['input'][_0x539c36(0x193)](0x2),await runCommand(_0x3f5645,_0x4096e6);}function handleError(_0xd51778){const _0xc757b8=a0_0x454e98;if(_0xd51778 instanceof CliError){_0xd51778[_0xc757b8(0x1b9)]===_0xc757b8(0x1a5)&&(process['stderr'][_0xc757b8(0x1a2)]('\x0aCancelled.\x0a'),process[_0xc757b8(0x1b0)](0x0));console[_0xc757b8(0x195)]('Error:\x20'+_0xd51778['message']);if(_0xd51778[_0xc757b8(0x19a)])console[_0xc757b8(0x195)](_0xc757b8(0x1a7)+_0xd51778[_0xc757b8(0x19a)]);process[_0xc757b8(0x1b0)](_0xd51778['exitCode']);}isUserCancellation(_0xd51778)&&(process['stderr']['write'](_0xc757b8(0x1b2)),process['exit'](0x0)),console[_0xc757b8(0x195)](_0xc757b8(0x196),_0xd51778),process[_0xc757b8(0x1b0)](0x1);}function a0_0x49f9(){const _0x156119=['write','validation','flags','cancelled','300LPxpNJ','Hint:\x20','621372NdMUrG','30118ezEoDE',':\x20--','original','1439457isdwWt','815enqQHw','27dXegXo','handler','exit','138216vxuLrb','\x0aCancelled.\x0a','[preparse]\x20','assign','unknownCommand','\x20->\x20--','ERR_USE_AFTER_CLOSE','stderr','code','definition','3756zaPoWt','332XqorFX','245jsaZeK','slice','message','error','Unexpected\x20error:','help','1704800rVLiHN','catch','hint','./framework/preparse.js','33025NtOiOe','input','name','log','length','args'];a0_0x49f9=function(){return _0x156119;};return a0_0x49f9();}function isUserCancellation(_0x45f901){const _0x5ba472=a0_0x454e98;if(!(_0x45f901 instanceof Error))return![];if(_0x45f901[_0x5ba472(0x19e)]==='ExitPromptError')return!![];if(_0x45f901[_0x5ba472(0x1b9)]===_0x5ba472(0x1b7))return!![];if(_0x45f901['code']==='ERR_STREAM_DESTROYED')return!![];return![];}
2
+ const a0_0x301d14=a0_0x1d13;(function(_0xaff2f,_0x31b98e){const _0x596bef=a0_0x1d13,_0x46141b=_0xaff2f();while(!![]){try{const _0x38f94c=-parseInt(_0x596bef(0x20a))/0x1*(parseInt(_0x596bef(0x217))/0x2)+parseInt(_0x596bef(0x1fe))/0x3*(-parseInt(_0x596bef(0x1fa))/0x4)+-parseInt(_0x596bef(0x1fb))/0x5*(-parseInt(_0x596bef(0x200))/0x6)+-parseInt(_0x596bef(0x20f))/0x7+parseInt(_0x596bef(0x1f2))/0x8+-parseInt(_0x596bef(0x208))/0x9*(-parseInt(_0x596bef(0x1f9))/0xa)+-parseInt(_0x596bef(0x205))/0xb;if(_0x38f94c===_0x31b98e)break;else _0x46141b['push'](_0x46141b['shift']());}catch(_0x552980){_0x46141b['push'](_0x46141b['shift']());}}}(a0_0x52dd,0x910b1));function a0_0x52dd(){const _0x49c34a=['exitCode','flags','assign','stderr','4196110SIpSPr','4CmcCSV','372285Vuvzgk','hint','ERR_USE_AFTER_CLOSE','1450191wbCUAn','cancelled','78EhlNkb','help','unknownCommand','message','definition','8688669kxrdmw','log','write','9hFyGpi','length','83267MxCIru','catch','exit','args','[preparse]\x20','803138HZpnHG','slice','./framework/preparse.js','ExitPromptError','handler','error',':\x20--','code','14OOULQZ','input','ERR_STREAM_DESTROYED','\x0aCancelled.\x0a','original','Unexpected\x20error:','9419392giMflf','Hint:\x20','defaultCommand'];a0_0x52dd=function(){return _0x49c34a;};return a0_0x52dd();}import{jsx as a0_0x11b688}from'react/jsx-runtime';function a0_0x1d13(_0x3ba31b,_0x4adb55){_0x3ba31b=_0x3ba31b-0x1f0;const _0x52dd30=a0_0x52dd();let _0x1d1345=_0x52dd30[_0x3ba31b];return _0x1d1345;}import a0_0x3e9f49 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_0x3e9f49(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x301d14(0x20b)](handleError);async function main(){try{await run();}catch(_0x434567){handleError(_0x434567);}}async function run(){const _0x5ca33b=a0_0x301d14;let _0x1cabe4=cli[_0x5ca33b(0x218)][0x0],_0xe6ecf6=cli[_0x5ca33b(0x218)][0x1];const _0x3075fc=cli[_0x5ca33b(0x1f6)];try{const {correctFlags:_0x2d2b0b}=await import(_0x5ca33b(0x211)),_0x45bc6d=getAllDefinitions()['flatMap'](_0x28f6d9=>_0x28f6d9[_0x5ca33b(0x1f6)]??[]),{flags:_0x12b149,corrections:_0x1bcff7}=_0x2d2b0b(_0x3075fc,_0x45bc6d);if(_0x1bcff7[_0x5ca33b(0x209)]>0x0){for(const _0x1b1af3 of _0x1bcff7){process[_0x5ca33b(0x1f8)][_0x5ca33b(0x207)](_0x5ca33b(0x20e)+_0x1b1af3[_0x5ca33b(0x213)]+_0x5ca33b(0x215)+_0x1b1af3[_0x5ca33b(0x1f0)]+'\x20->\x20--'+_0x1b1af3['corrected']+'\x0a');}Object[_0x5ca33b(0x1f7)](_0x3075fc,_0x12b149);}}catch{}if(!_0x1cabe4){const {waitUntilExit:_0x4dfb85}=render(a0_0x11b688(Help,{}));await _0x4dfb85();return;}const _0x194312=resolveRemovedCommand(_0x1cabe4,_0xe6ecf6);if(_0x194312)throw CliErrors['validation'](_0x194312[_0x5ca33b(0x203)],_0x194312['hint']);if(!isKnownService(_0x1cabe4)){const _0x1a9ea3=resolveDynamicServiceCommand(cli['input'],_0x3075fc);if(_0x1a9ea3){if(_0x3075fc[_0x5ca33b(0x201)]){console['log'](generateCommandHelp(_0x1a9ea3[_0x5ca33b(0x204)]));return;}Object[_0x5ca33b(0x1f7)](_0x3075fc,_0x1a9ea3[_0x5ca33b(0x1f6)]);const _0x547ba8=buildConfigFromFlags(_0x3075fc);await initGlobalEnvironment(_0x547ba8);const _0x36d900=createPipelineEnv(_0x547ba8,_0x3075fc);_0x36d900[_0x5ca33b(0x20d)]=_0x1a9ea3[_0x5ca33b(0x20d)],await runCommand(_0x1a9ea3[_0x5ca33b(0x204)],_0x36d900);return;}if(_0x3075fc['help']){const _0x2dbf8b=generateDynamicServiceHelp(_0x1cabe4);if(_0x2dbf8b){console['log'](_0x2dbf8b);return;}}const {waitUntilExit:_0x99dadc}=render(a0_0x11b688(Help,{}));await _0x99dadc();return;}const _0xf6785=getServiceEntry(_0x1cabe4);if(!_0xe6ecf6){if(_0x3075fc[_0x5ca33b(0x201)]){console['log'](generateServiceHelp(_0x1cabe4));return;}if(_0xf6785[_0x5ca33b(0x1f4)])_0xe6ecf6=_0xf6785[_0x5ca33b(0x1f4)];else{console[_0x5ca33b(0x206)](generateServiceHelp(_0x1cabe4));return;}}const _0x1b8340=findDefinition(_0x1cabe4,_0xe6ecf6);!_0x1b8340&&(console[_0x5ca33b(0x206)](generateServiceHelp(_0x1cabe4)),handleError(CliErrors[_0x5ca33b(0x202)](_0x1cabe4+'\x20'+_0xe6ecf6)));if(_0x3075fc[_0x5ca33b(0x201)]){console['log'](generateCommandHelp(_0x1b8340));return;}const _0x17c78a=buildConfigFromFlags(_0x3075fc);await initGlobalEnvironment(_0x17c78a);const _0x424553=createPipelineEnv(_0x17c78a,_0x3075fc);_0x424553[_0x5ca33b(0x20d)]=cli[_0x5ca33b(0x218)][_0x5ca33b(0x210)](0x2),await runCommand(_0x1b8340,_0x424553);}function handleError(_0x4e16aa){const _0x31db78=a0_0x301d14;if(_0x4e16aa instanceof CliError){_0x4e16aa['code']===_0x31db78(0x1ff)&&(process[_0x31db78(0x1f8)]['write'](_0x31db78(0x21a)),process['exit'](0x0));console[_0x31db78(0x214)]('Error:\x20'+_0x4e16aa['message']);if(_0x4e16aa[_0x31db78(0x1fc)])console[_0x31db78(0x214)](_0x31db78(0x1f3)+_0x4e16aa['hint']);process[_0x31db78(0x20c)](_0x4e16aa[_0x31db78(0x1f5)]);}isUserCancellation(_0x4e16aa)&&(process[_0x31db78(0x1f8)][_0x31db78(0x207)]('\x0aCancelled.\x0a'),process[_0x31db78(0x20c)](0x0)),console[_0x31db78(0x214)](_0x31db78(0x1f1),_0x4e16aa),process[_0x31db78(0x20c)](0x1);}function isUserCancellation(_0x953bc7){const _0x4d11c4=a0_0x301d14;if(!(_0x953bc7 instanceof Error))return![];if(_0x953bc7['name']===_0x4d11c4(0x212))return!![];if(_0x953bc7[_0x4d11c4(0x216)]===_0x4d11c4(0x1fd))return!![];if(_0x953bc7['code']===_0x4d11c4(0x219))return!![];return![];}
@@ -1 +1 @@
1
- function a1_0x427a(_0x498246,_0x1f080a){_0x498246=_0x498246-0x163;const _0x559db3=a1_0x559d();let _0x427a0a=_0x559db3[_0x498246];return _0x427a0a;}const a1_0x125201=a1_0x427a;(function(_0xd588d8,_0x55b6c4){const _0x492c6d=a1_0x427a,_0x428653=_0xd588d8();while(!![]){try{const _0x377a6b=parseInt(_0x492c6d(0x1c1))/0x1+parseInt(_0x492c6d(0x18f))/0x2*(-parseInt(_0x492c6d(0x168))/0x3)+parseInt(_0x492c6d(0x1b9))/0x4*(parseInt(_0x492c6d(0x1ad))/0x5)+-parseInt(_0x492c6d(0x1c6))/0x6*(parseInt(_0x492c6d(0x1a0))/0x7)+parseInt(_0x492c6d(0x1bd))/0x8+parseInt(_0x492c6d(0x1c7))/0x9+-parseInt(_0x492c6d(0x1ca))/0xa;if(_0x377a6b===_0x55b6c4)break;else _0x428653['push'](_0x428653['shift']());}catch(_0x3f098b){_0x428653['push'](_0x428653['shift']());}}}(a1_0x559d,0xb80b3));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':'category','type':a1_0x125201(0x1b3),'description':a1_0x125201(0x17e)},KEYWORD_FLAG={'name':'keyword','type':a1_0x125201(0x1b3),'description':a1_0x125201(0x172)},DOC_CODE_FLAG={'name':'code','type':a1_0x125201(0x1b3),'required':!![],'description':a1_0x125201(0x1a3)},DOCS=[{'code':a1_0x125201(0x1b8),'category':a1_0x125201(0x1b6),'title':a1_0x125201(0x198),'method':a1_0x125201(0x166),'path':'/api/dataset/get-dataset-list-by-app-code','summary':'List\x20datasets\x20with\x20pagination','whenToUse':a1_0x125201(0x174),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','responseHighlights':[a1_0x125201(0x19c),a1_0x125201(0x1d4)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':[a1_0x125201(0x1ab)],'markdown':['##\x20List\x20datasets','',a1_0x125201(0x1b4)][a1_0x125201(0x194)]('\x0a')},{'code':'dataset_detail','category':a1_0x125201(0x1b6),'title':a1_0x125201(0x189),'method':a1_0x125201(0x196),'path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x125201(0x1d1),'whenToUse':a1_0x125201(0x181),'pathParams':[],'queryParams':[{'name':a1_0x125201(0x175),'description':'32-character\x20dataset\x20code'}],'bodySchema':a1_0x125201(0x16a),'responseHighlights':[a1_0x125201(0x1b0),a1_0x125201(0x177),'operations\x20describes\x20runtime\x20APIs'],'examples':[a1_0x125201(0x190)],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':[a1_0x125201(0x199),'',a1_0x125201(0x173)]['join']('\x0a')},{'code':a1_0x125201(0x1cd),'category':'dataset','title':a1_0x125201(0x16d),'method':a1_0x125201(0x166),'path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x125201(0x185),'whenToUse':'Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','pathParams':[{'name':a1_0x125201(0x16c),'description':a1_0x125201(0x1a9)},{'name':a1_0x125201(0x1d5),'description':a1_0x125201(0x19d)}],'queryParams':[],'bodySchema':a1_0x125201(0x16f),'responseHighlights':['tableData\x20contains\x20records','paging\x20contains\x20pagination'],'examples':[a1_0x125201(0x1d3),a1_0x125201(0x193)],'notes':[a1_0x125201(0x1a2),a1_0x125201(0x1d0),a1_0x125201(0x1c0),a1_0x125201(0x1a4)],'markdown':[a1_0x125201(0x1c3),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.']['join']('\x0a')},{'code':a1_0x125201(0x192),'category':a1_0x125201(0x1b6),'title':a1_0x125201(0x1ae),'method':a1_0x125201(0x166),'path':a1_0x125201(0x191),'summary':a1_0x125201(0x17b),'whenToUse':a1_0x125201(0x1b2),'pathParams':[{'name':a1_0x125201(0x16c),'description':a1_0x125201(0x1a9)},{'name':a1_0x125201(0x1d5),'description':a1_0x125201(0x19d)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x125201(0x164),a1_0x125201(0x180)],'examples':[a1_0x125201(0x16e)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'],'markdown':[a1_0x125201(0x1c4),'','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x125201(0x194)]('\x0a')},{'code':a1_0x125201(0x184),'category':a1_0x125201(0x1b6),'title':a1_0x125201(0x1be),'method':a1_0x125201(0x166),'path':a1_0x125201(0x188),'summary':a1_0x125201(0x1be),'whenToUse':a1_0x125201(0x182),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x125201(0x1d5),'description':a1_0x125201(0x19d)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x125201(0x1b1)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':['Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.'],'markdown':a1_0x125201(0x1cf)},{'code':'dataset_data_create','category':a1_0x125201(0x1b6),'title':a1_0x125201(0x18b),'method':a1_0x125201(0x166),'path':a1_0x125201(0x1ac),'summary':a1_0x125201(0x183),'whenToUse':a1_0x125201(0x1d6),'pathParams':[{'name':'appCode','description':a1_0x125201(0x1a9)},{'name':a1_0x125201(0x1d5),'description':a1_0x125201(0x19d)}],'queryParams':[],'bodySchema':a1_0x125201(0x1bb),'responseHighlights':[a1_0x125201(0x1bf)],'examples':[a1_0x125201(0x1c9)],'notes':[a1_0x125201(0x197)],'markdown':a1_0x125201(0x167)},{'code':a1_0x125201(0x16b),'category':'bf','title':a1_0x125201(0x179),'method':'GET','path':a1_0x125201(0x17d),'summary':'Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','whenToUse':a1_0x125201(0x1af),'pathParams':[{'name':a1_0x125201(0x16c),'description':a1_0x125201(0x1a9)},{'name':a1_0x125201(0x1c8),'description':a1_0x125201(0x19f)}],'queryParams':[],'bodySchema':a1_0x125201(0x16a),'responseHighlights':[a1_0x125201(0x17c)],'examples':[a1_0x125201(0x1a6)],'notes':[a1_0x125201(0x1ce)],'markdown':'##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.'},{'code':'bf_execute','category':'bf','title':a1_0x125201(0x1cc),'method':a1_0x125201(0x166),'path':'/api/endpoint/{appCode}/{functionName}','summary':a1_0x125201(0x1c2),'whenToUse':a1_0x125201(0x18e),'pathParams':[{'name':a1_0x125201(0x16c),'description':a1_0x125201(0x1a9)},{'name':'functionName','description':a1_0x125201(0x1a1)}],'queryParams':[],'bodySchema':a1_0x125201(0x19b),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x125201(0x186)],'notes':[a1_0x125201(0x17a)],'markdown':a1_0x125201(0x163)},{'code':'custom_sql_execute','category':a1_0x125201(0x178),'title':'Execute\x20custom\x20SQL','method':a1_0x125201(0x166),'path':a1_0x125201(0x1aa),'summary':'Execute\x20custom\x20SQL','whenToUse':a1_0x125201(0x1a5),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x125201(0x1c5)],'examples':[a1_0x125201(0x1d2)],'notes':[a1_0x125201(0x17f)],'markdown':a1_0x125201(0x19a)}];function a1_0x559d(){const _0x361806=['Filter\x20dataset\x20records','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','read','/api/{appCode}/{datasetCode}/getOne','Dataset\x20detail','validation','Create\x20dataset\x20record','Show\x20runtime\x20API\x20documentation\x20by\x20code','trim','Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','2nuToij','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','/api/{appCode}/{datasetCode}/aggregate','dataset_data_aggregate','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','join','keyword','GET','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','List\x20datasets','##\x20Dataset\x20detail','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','{\x22param\x22:\x22value\x22}','tableData\x20contains\x20dataset\x20id/code/name','32-character\x20dataset\x20code','toLowerCase','Exact\x20endpoint\x20function\x20name','7fihxRW','Endpoint\x20function\x20name','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','API\x20doc\x20code,\x20for\x20example\x20dataset_list','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','str','find','Current\x20app\x20code','/api/custom/executeSql','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','/api/{appCode}/{datasetCode}/create','1180gSFMGm','Aggregate\x20dataset\x20data','Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','fields/properties\x20describe\x20data\x20shape','Returns\x20one\x20matching\x20business\x20record','Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','string','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','summary','dataset','path','dataset_list','23172PRxvDS','api-doc','{\x22fieldName\x22:\x22value\x22}','length','10644912AwgFMt','Get\x20one\x20dataset\x20record','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','480179NubFTc','Execute\x20a\x20BF\x20endpoint\x20function','##\x20Filter\x20dataset\x20data','##\x20Aggregate\x20dataset\x20data','Returns\x20SQL\x20execution\x20payload','220956FAfSRM','7390422FRzWri','functionName','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','29171970IMnlLs','method','Execute\x20BF\x20endpoint\x20function','dataset_data_filter','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','Get\x20dataset\x20detail','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\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:1,\x22pageSize\x22:20}\x27','paging.totalCount\x20gives\x20total\x20rows','datasetCode','Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','result\x20rows\x20contain\x20aggregate\x20aliases','whenToUse','POST','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','873699NUDPdR','includes','None','bf_detail','appCode','Filter\x20dataset\x20data','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','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','list','category','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','code','filter','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','custom_sql','Get\x20BF\x20endpoint\x20function\x20contract','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Aggregate\x20dataset\x20records','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','/client/bff/endpoint/{appCode}/{functionName}','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','where\x20filters\x20before\x20aggregation','Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','Create\x20a\x20dataset\x20record','dataset_data_get_one'];a1_0x559d=function(){return _0x361806;};return a1_0x559d();}function entrySummary(_0x13a87f){const _0x55be3f=a1_0x125201;return{'code':_0x13a87f['code'],'category':_0x13a87f[_0x55be3f(0x171)],'method':_0x13a87f[_0x55be3f(0x1cb)],'path':_0x13a87f[_0x55be3f(0x1b7)],'summary':_0x13a87f[_0x55be3f(0x1b5)],'whenToUse':_0x13a87f[_0x55be3f(0x165)]};}export function listApiDocEntries(_0x100581={}){const _0x310d82=a1_0x125201,_0x505f2b=String(_0x100581[_0x310d82(0x171)]||'')[_0x310d82(0x18d)](),_0x4c1edf=String(_0x100581[_0x310d82(0x195)]||'')[_0x310d82(0x18d)]()[_0x310d82(0x19e)]();return DOCS[_0x310d82(0x176)](_0x1659f7=>{const _0x50a74b=_0x310d82;if(_0x505f2b&&_0x1659f7[_0x50a74b(0x171)]!==_0x505f2b)return![];if(!_0x4c1edf)return!![];return[_0x1659f7['code'],_0x1659f7[_0x50a74b(0x171)],_0x1659f7['method'],_0x1659f7[_0x50a74b(0x1b7)],_0x1659f7['summary'],_0x1659f7[_0x50a74b(0x165)],_0x1659f7['title']][_0x50a74b(0x194)]('\x20')[_0x50a74b(0x19e)]()[_0x50a74b(0x169)](_0x4c1edf);})['map'](entrySummary);}export function getApiDocDetail(_0x461055){const _0x5ee806=a1_0x125201,_0x4a9106=DOCS[_0x5ee806(0x1a8)](_0x3ea15f=>_0x3ea15f[_0x5ee806(0x175)]===_0x461055);if(!_0x4a9106)throw CliErrors[_0x5ee806(0x18a)]('API\x20doc\x20code\x20not\x20found:\x20'+_0x461055);return{..._0x4a9106};}const apiDocList={'service':'api-doc','command':a1_0x125201(0x170),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':a1_0x125201(0x187),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x42431d){const _0x40235c=a1_0x125201,_0x740ff3=listApiDocEntries({'category':_0x42431d[_0x40235c(0x1a7)](_0x40235c(0x171)),'keyword':_0x42431d['str'](_0x40235c(0x195))});return{'ok':!![],'data':{'total':_0x740ff3[_0x40235c(0x1bc)],'items':_0x740ff3}};}},apiDocDetail={'service':a1_0x125201(0x1ba),'command':'detail','description':a1_0x125201(0x18c),'risk':a1_0x125201(0x187),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x3a9813){const _0xcbe3ac=a1_0x125201;return{'ok':!![],'data':getApiDocDetail(_0x3a9813[_0xcbe3ac(0x1a7)]('code'))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
1
+ const a1_0x29b4d5=a1_0x353d;function a1_0x353d(_0x13dfff,_0x3affed){_0x13dfff=_0x13dfff-0x14b;const _0x459d25=a1_0x459d();let _0x353ddc=_0x459d25[_0x13dfff];return _0x353ddc;}(function(_0x243518,_0x5da8cb){const _0x3cd17b=a1_0x353d,_0x2bfce6=_0x243518();while(!![]){try{const _0x57a4d2=parseInt(_0x3cd17b(0x19c))/0x1*(-parseInt(_0x3cd17b(0x161))/0x2)+-parseInt(_0x3cd17b(0x17d))/0x3*(-parseInt(_0x3cd17b(0x155))/0x4)+-parseInt(_0x3cd17b(0x19a))/0x5*(parseInt(_0x3cd17b(0x194))/0x6)+parseInt(_0x3cd17b(0x1a4))/0x7*(parseInt(_0x3cd17b(0x1c2))/0x8)+parseInt(_0x3cd17b(0x15b))/0x9+-parseInt(_0x3cd17b(0x1af))/0xa+parseInt(_0x3cd17b(0x152))/0xb;if(_0x57a4d2===_0x5da8cb)break;else _0x2bfce6['push'](_0x2bfce6['shift']());}catch(_0x271a0a){_0x2bfce6['push'](_0x2bfce6['shift']());}}}(a1_0x459d,0xb993f));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x29b4d5(0x17a),'type':'string','description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0x29b4d5(0x188),'type':a1_0x29b4d5(0x19b),'description':a1_0x29b4d5(0x157)},DOC_CODE_FLAG={'name':a1_0x29b4d5(0x1aa),'type':a1_0x29b4d5(0x19b),'required':!![],'description':a1_0x29b4d5(0x15c)},DOCS=[{'code':'dataset_list','category':'dataset','title':'List\x20datasets','method':a1_0x29b4d5(0x1b3),'path':a1_0x29b4d5(0x164),'summary':a1_0x29b4d5(0x1b6),'whenToUse':a1_0x29b4d5(0x14f),'pathParams':[],'queryParams':[],'bodySchema':a1_0x29b4d5(0x173),'responseHighlights':[a1_0x29b4d5(0x1b0),'paging.totalCount\x20gives\x20total\x20rows'],'examples':[a1_0x29b4d5(0x190)],'notes':[a1_0x29b4d5(0x1be)],'markdown':[a1_0x29b4d5(0x14e),'',a1_0x29b4d5(0x1a6)]['join']('\x0a')},{'code':a1_0x29b4d5(0x1a8),'category':a1_0x29b4d5(0x1b2),'title':a1_0x29b4d5(0x14d),'method':a1_0x29b4d5(0x1ba),'path':a1_0x29b4d5(0x19e),'summary':a1_0x29b4d5(0x184),'whenToUse':'Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','pathParams':[],'queryParams':[{'name':'code','description':a1_0x29b4d5(0x1ab)}],'bodySchema':'None','responseHighlights':[a1_0x29b4d5(0x1c3),a1_0x29b4d5(0x19f),a1_0x29b4d5(0x1ac)],'examples':[a1_0x29b4d5(0x1c0)],'notes':[a1_0x29b4d5(0x1bd)],'markdown':['##\x20Dataset\x20detail','',a1_0x29b4d5(0x193)][a1_0x29b4d5(0x174)]('\x0a')},{'code':'dataset_data_filter','category':a1_0x29b4d5(0x1b2),'title':a1_0x29b4d5(0x175),'method':'POST','path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x29b4d5(0x18c),'whenToUse':a1_0x29b4d5(0x162),'pathParams':[{'name':a1_0x29b4d5(0x18e),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':a1_0x29b4d5(0x1ab)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':[a1_0x29b4d5(0x1bb),a1_0x29b4d5(0x154)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','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'],'notes':['where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.',a1_0x29b4d5(0x15f),a1_0x29b4d5(0x1ad)],'markdown':['##\x20Filter\x20dataset\x20data','',a1_0x29b4d5(0x14b)][a1_0x29b4d5(0x174)]('\x0a')},{'code':a1_0x29b4d5(0x16d),'category':'dataset','title':a1_0x29b4d5(0x19d),'method':'POST','path':a1_0x29b4d5(0x163),'summary':a1_0x29b4d5(0x1a1),'whenToUse':a1_0x29b4d5(0x153),'pathParams':[{'name':'appCode','description':a1_0x29b4d5(0x160)},{'name':a1_0x29b4d5(0x15a),'description':a1_0x29b4d5(0x1ab)}],'queryParams':[],'bodySchema':a1_0x29b4d5(0x178),'responseHighlights':[a1_0x29b4d5(0x16e),a1_0x29b4d5(0x181)],'examples':[a1_0x29b4d5(0x195)],'notes':[a1_0x29b4d5(0x192),a1_0x29b4d5(0x158)],'markdown':[a1_0x29b4d5(0x169),'',a1_0x29b4d5(0x156)][a1_0x29b4d5(0x174)]('\x0a')},{'code':a1_0x29b4d5(0x176),'category':a1_0x29b4d5(0x1b2),'title':a1_0x29b4d5(0x172),'method':a1_0x29b4d5(0x1b3),'path':'/api/{appCode}/{datasetCode}/getOne','summary':a1_0x29b4d5(0x172),'whenToUse':a1_0x29b4d5(0x18f),'pathParams':[{'name':a1_0x29b4d5(0x18e),'description':a1_0x29b4d5(0x160)},{'name':a1_0x29b4d5(0x15a),'description':a1_0x29b4d5(0x1ab)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x29b4d5(0x1a7)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x29b4d5(0x16b)],'markdown':a1_0x29b4d5(0x1c1)},{'code':a1_0x29b4d5(0x167),'category':'dataset','title':'Create\x20dataset\x20record','method':a1_0x29b4d5(0x1b3),'path':a1_0x29b4d5(0x1a9),'summary':a1_0x29b4d5(0x170),'whenToUse':a1_0x29b4d5(0x171),'pathParams':[{'name':'appCode','description':a1_0x29b4d5(0x160)},{'name':a1_0x29b4d5(0x15a),'description':a1_0x29b4d5(0x1ab)}],'queryParams':[],'bodySchema':a1_0x29b4d5(0x198),'responseHighlights':[a1_0x29b4d5(0x150)],'examples':['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27'],'notes':[a1_0x29b4d5(0x1b8)],'markdown':a1_0x29b4d5(0x1b5)},{'code':a1_0x29b4d5(0x16c),'category':'bf','title':a1_0x29b4d5(0x186),'method':a1_0x29b4d5(0x1ba),'path':a1_0x29b4d5(0x1b9),'summary':a1_0x29b4d5(0x196),'whenToUse':a1_0x29b4d5(0x18a),'pathParams':[{'name':a1_0x29b4d5(0x18e),'description':a1_0x29b4d5(0x160)},{'name':a1_0x29b4d5(0x1bc),'description':'Exact\x20endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x29b4d5(0x191),'responseHighlights':[a1_0x29b4d5(0x1a0)],'examples':[a1_0x29b4d5(0x18d)],'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_0x29b4d5(0x197)},{'code':a1_0x29b4d5(0x17e),'category':'bf','title':a1_0x29b4d5(0x17f),'method':a1_0x29b4d5(0x1b3),'path':a1_0x29b4d5(0x1a3),'summary':a1_0x29b4d5(0x183),'whenToUse':a1_0x29b4d5(0x199),'pathParams':[{'name':a1_0x29b4d5(0x18e),'description':a1_0x29b4d5(0x160)},{'name':a1_0x29b4d5(0x1bc),'description':a1_0x29b4d5(0x1b4)}],'queryParams':[],'bodySchema':a1_0x29b4d5(0x159),'responseHighlights':[a1_0x29b4d5(0x15e)],'examples':[a1_0x29b4d5(0x185)],'notes':[a1_0x29b4d5(0x1a5)],'markdown':a1_0x29b4d5(0x1b7)},{'code':a1_0x29b4d5(0x1bf),'category':'custom_sql','title':'Execute\x20custom\x20SQL','method':a1_0x29b4d5(0x1b3),'path':a1_0x29b4d5(0x189),'summary':a1_0x29b4d5(0x180),'whenToUse':a1_0x29b4d5(0x1c5),'pathParams':[],'queryParams':[],'bodySchema':a1_0x29b4d5(0x16a),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x29b4d5(0x14c)],'notes':[a1_0x29b4d5(0x182)],'markdown':a1_0x29b4d5(0x165)}];function entrySummary(_0xc54439){const _0x1c7d6b=a1_0x29b4d5;return{'code':_0xc54439[_0x1c7d6b(0x1aa)],'category':_0xc54439['category'],'method':_0xc54439[_0x1c7d6b(0x1b1)],'path':_0xc54439['path'],'summary':_0xc54439[_0x1c7d6b(0x18b)],'whenToUse':_0xc54439[_0x1c7d6b(0x179)]};}export function listApiDocEntries(_0x358360={}){const _0x3aabe4=a1_0x29b4d5,_0x58e937=String(_0x358360[_0x3aabe4(0x17a)]||'')[_0x3aabe4(0x17b)](),_0x3f57ea=String(_0x358360['keyword']||'')[_0x3aabe4(0x17b)]()[_0x3aabe4(0x187)]();return DOCS[_0x3aabe4(0x17c)](_0x1e4d3a=>{const _0x4abd66=_0x3aabe4;if(_0x58e937&&_0x1e4d3a[_0x4abd66(0x17a)]!==_0x58e937)return![];if(!_0x3f57ea)return!![];return[_0x1e4d3a[_0x4abd66(0x1aa)],_0x1e4d3a[_0x4abd66(0x17a)],_0x1e4d3a['method'],_0x1e4d3a['path'],_0x1e4d3a[_0x4abd66(0x18b)],_0x1e4d3a[_0x4abd66(0x179)],_0x1e4d3a['title']]['join']('\x20')[_0x4abd66(0x187)]()[_0x4abd66(0x177)](_0x3f57ea);})[_0x3aabe4(0x16f)](entrySummary);}export function getApiDocDetail(_0x41f103){const _0xb807cd=a1_0x29b4d5,_0x338f15=DOCS['find'](_0x1223c3=>_0x1223c3[_0xb807cd(0x1aa)]===_0x41f103);if(!_0x338f15)throw CliErrors['validation']('API\x20doc\x20code\x20not\x20found:\x20'+_0x41f103);return{..._0x338f15};}const apiDocList={'service':a1_0x29b4d5(0x166),'command':a1_0x29b4d5(0x151),'description':a1_0x29b4d5(0x15d),'risk':a1_0x29b4d5(0x1ae),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x55ba28){const _0x5cc21c=a1_0x29b4d5,_0x339cfc=listApiDocEntries({'category':_0x55ba28['str']('category'),'keyword':_0x55ba28['str'](_0x5cc21c(0x188))});return{'ok':!![],'data':{'total':_0x339cfc[_0x5cc21c(0x1c4)],'items':_0x339cfc}};}},apiDocDetail={'service':a1_0x29b4d5(0x166),'command':a1_0x29b4d5(0x1a2),'description':a1_0x29b4d5(0x168),'risk':a1_0x29b4d5(0x1ae),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x286da9){const _0x50214d=a1_0x29b4d5;return{'ok':!![],'data':getApiDocDetail(_0x286da9['str'](_0x50214d(0x1aa)))};}};function a1_0x459d(){const _0x39d22e=['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','6152PJSfpP','fields/properties\x20describe\x20data\x20shape','length','Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','Dataset\x20detail','##\x20List\x20datasets','Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','list','13824349YysOfW','Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','paging\x20contains\x20pagination','1008152kWIkOR','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','{\x22param\x22:\x22value\x22}','datasetCode','6902352MNKMtN','API\x20doc\x20code,\x20for\x20example\x20dataset_list','List\x20available\x20runtime\x20API\x20documentation\x20entries','Returns\x20script\x20business\x20payload','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','Current\x20app\x20code','938090paqcWs','Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','/api/{appCode}/{datasetCode}/aggregate','/api/dataset/get-dataset-list-by-app-code','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','api-doc','dataset_data_create','Show\x20runtime\x20API\x20documentation\x20by\x20code','##\x20Aggregate\x20dataset\x20data','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','bf_detail','dataset_data_aggregate','result\x20rows\x20contain\x20aggregate\x20aliases','map','Create\x20a\x20dataset\x20record','Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','Get\x20one\x20dataset\x20record','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','join','Filter\x20dataset\x20data','dataset_data_get_one','includes','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','whenToUse','category','trim','filter','6zzOsHt','bf_execute','Execute\x20BF\x20endpoint\x20function','Execute\x20custom\x20SQL','where\x20filters\x20before\x20aggregation','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','Execute\x20a\x20BF\x20endpoint\x20function','Get\x20dataset\x20detail','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','Get\x20BF\x20endpoint\x20function\x20contract','toLowerCase','keyword','/api/custom/executeSql','Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','summary','Filter\x20dataset\x20records','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','appCode','Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','None','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','2622cLYVhq','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','Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','{\x22fieldName\x22:\x22value\x22}','Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','15265asJpdU','string','1XLwrNX','Aggregate\x20dataset\x20data','/api/dataset/getOneByCode?code={datasetCode}','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','Aggregate\x20dataset\x20records','detail','/api/endpoint/{appCode}/{functionName}','6685GkuTyj','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','Returns\x20one\x20matching\x20business\x20record','dataset_detail','/api/{appCode}/{datasetCode}/create','code','32-character\x20dataset\x20code','operations\x20describes\x20runtime\x20APIs','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','read','6988250CKArfF','tableData\x20contains\x20dataset\x20id/code/name','method','dataset','POST','Endpoint\x20function\x20name','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','List\x20datasets\x20with\x20pagination','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','/client/bff/endpoint/{appCode}/{functionName}','GET','tableData\x20contains\x20records','functionName','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','custom_sql_execute'];a1_0x459d=function(){return _0x39d22e;};return a1_0x459d();}export const apiDocDefinitions=[apiDocList,apiDocDetail];
@@ -1 +1 @@
1
- (function(_0x2e0ee9,_0x519577){const _0x5b62e7=a2_0x3059,_0x4c9676=_0x2e0ee9();while(!![]){try{const _0x3ea2b8=-parseInt(_0x5b62e7(0xcd))/0x1+-parseInt(_0x5b62e7(0xc4))/0x2+-parseInt(_0x5b62e7(0xc8))/0x3+-parseInt(_0x5b62e7(0xd2))/0x4+-parseInt(_0x5b62e7(0xc0))/0x5+-parseInt(_0x5b62e7(0xc3))/0x6*(-parseInt(_0x5b62e7(0xd4))/0x7)+-parseInt(_0x5b62e7(0xd7))/0x8*(-parseInt(_0x5b62e7(0xcb))/0x9);if(_0x3ea2b8===_0x519577)break;else _0x4c9676['push'](_0x4c9676['shift']());}catch(_0x122f2d){_0x4c9676['push'](_0x4c9676['shift']());}}}(a2_0x359b,0x787cf));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function a2_0x359b(){const _0x421e68=['find','stringify','40113IlBKXN','homeDirName','360697tQniYK','EACCES','items','appName','parse','3116164GdHMMz','hex','1608649qBYTQC','.tmp','my-apps.json','3864PmxeNZ','digest','EPERM','slice','code','utf8','406400aeCGou','unknown','trim','18MdWosm','470276QEyLWe','appCode','EXDEV','cache','2677431Ussfes'];a2_0x359b=function(){return _0x421e68;};return a2_0x359b();}export function fingerprintAccessKey(_0xa6aa5){const _0x1ec660=a2_0x3059,_0x3ececb=_0xa6aa5['trim'](),_0x2b1650=_0x3ececb[_0x1ec660(0xda)](-0x6)||_0x1ec660(0xc1),_0x56c8b3=createHash('sha256')['update'](_0x3ececb)[_0x1ec660(0xd8)](_0x1ec660(0xd3))['slice'](0x0,0xc);return'ak_'+_0x2b1650+'_'+_0x56c8b3;}export function getAppCacheFilePath(_0x597923,_0x56cbcd){const _0x3b2c5c=a2_0x3059;return resolve(homedir(),PRODUCT_CONFIG[_0x3b2c5c(0xcc)],_0x3b2c5c(0xc7),_0x597923,fingerprintAccessKey(_0x56cbcd),_0x3b2c5c(0xd6));}function a2_0x3059(_0x288583,_0x272c44){_0x288583=_0x288583-0xbf;const _0x359ba5=a2_0x359b();let _0x3059e5=_0x359ba5[_0x288583];return _0x3059e5;}export function readCachedAppList(_0x452e65,_0x2e8a62){const _0x5b5de2=a2_0x3059;if(!_0x2e8a62?.[_0x5b5de2(0xc2)]())return null;const _0x29bede=getAppCacheFilePath(_0x452e65,_0x2e8a62);if(!existsSync(_0x29bede))return null;try{const _0x474403=readFileSync(_0x29bede,_0x5b5de2(0xbf));if(!_0x474403[_0x5b5de2(0xc2)]())return null;const _0x1eddb2=JSON[_0x5b5de2(0xd1)](_0x474403);if(!Array['isArray'](_0x1eddb2[_0x5b5de2(0xcf)]))return null;return _0x1eddb2;}catch{return null;}}export function writeCachedAppList(_0x56e325,_0x367bf0,_0x258461){const _0x3d2686=a2_0x3059,_0x37e401=getAppCacheFilePath(_0x56e325,_0x367bf0),_0x5124ac=dirname(_0x37e401);!existsSync(_0x5124ac)&&mkdirSync(_0x5124ac,{'recursive':!![]});const _0x313315=_0x37e401+_0x3d2686(0xd5);try{writeFileSync(_0x313315,JSON['stringify'](_0x258461,null,0x2)+'\x0a',{'encoding':_0x3d2686(0xbf),'mode':0x180});try{renameSync(_0x313315,_0x37e401);}catch(_0x182578){if(_0x182578['code']===_0x3d2686(0xd9)||_0x182578[_0x3d2686(0xdb)]===_0x3d2686(0xc6)||_0x182578[_0x3d2686(0xdb)]===_0x3d2686(0xce)){writeFileSync(_0x37e401,JSON[_0x3d2686(0xca)](_0x258461,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x313315);}catch{}}else throw _0x182578;}}catch(_0x17f8ab){try{unlinkSync(_0x313315);}catch{}throw _0x17f8ab;}return _0x37e401;}export function resolveCachedAppCode(_0x264bb4,_0x203be3,_0x262be2){const _0x3debe9=a2_0x3059;if(!_0x264bb4)return undefined;const _0x17a885=readCachedAppList(_0x203be3,_0x262be2),_0x4b047e=_0x17a885?.[_0x3debe9(0xcf)][_0x3debe9(0xc9)](_0x15a3ba=>_0x15a3ba[_0x3debe9(0xd0)]===_0x264bb4&&isRuntimeAccessibleApp(_0x15a3ba));return _0x4b047e?.[_0x3debe9(0xc5)]?.[_0x3debe9(0xc2)]()||undefined;}
1
+ (function(_0x4102dd,_0x48f79a){const _0x4ae972=a2_0x5e3b,_0x3376dd=_0x4102dd();while(!![]){try{const _0x248114=parseInt(_0x4ae972(0x1c3))/0x1+-parseInt(_0x4ae972(0x1d7))/0x2*(-parseInt(_0x4ae972(0x1d1))/0x3)+parseInt(_0x4ae972(0x1c9))/0x4*(parseInt(_0x4ae972(0x1d8))/0x5)+-parseInt(_0x4ae972(0x1c5))/0x6+parseInt(_0x4ae972(0x1c7))/0x7*(-parseInt(_0x4ae972(0x1d2))/0x8)+-parseInt(_0x4ae972(0x1cb))/0x9+parseInt(_0x4ae972(0x1d9))/0xa;if(_0x248114===_0x48f79a)break;else _0x3376dd['push'](_0x3376dd['shift']());}catch(_0x67d8a5){_0x3376dd['push'](_0x3376dd['shift']());}}}(a2_0x5af8,0xdc6f9));import{createHash}from'node:crypto';function a2_0x5af8(){const _0x3d462b=['799766AqIOOz','sha256','8001312RucUjo','slice','973AtPazg','.tmp','156QpykzJ','digest','2462994qKbJVE','trim','homeDirName','EACCES','isArray','items','753egvbPQ','34088nEHYWo','cache','utf8','code','appName','4942HfcfGC','156425UIoeMe','4623000KIsbeX','parse','appCode'];a2_0x5af8=function(){return _0x3d462b;};return a2_0x5af8();}import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x550852){const _0x4e5825=a2_0x5e3b,_0x39b414=_0x550852[_0x4e5825(0x1cc)](),_0x4ba44e=_0x39b414[_0x4e5825(0x1c6)](-0x6)||'unknown',_0x5b80e5=createHash(_0x4e5825(0x1c4))['update'](_0x39b414)[_0x4e5825(0x1ca)]('hex')[_0x4e5825(0x1c6)](0x0,0xc);return'ak_'+_0x4ba44e+'_'+_0x5b80e5;}export function getAppCacheFilePath(_0xef243d,_0x5f5234){const _0x31f40a=a2_0x5e3b;return resolve(homedir(),PRODUCT_CONFIG[_0x31f40a(0x1cd)],_0x31f40a(0x1d3),_0xef243d,fingerprintAccessKey(_0x5f5234),'my-apps.json');}export function readCachedAppList(_0x239506,_0x4be49c){const _0x43480d=a2_0x5e3b;if(!_0x4be49c?.[_0x43480d(0x1cc)]())return null;const _0x10deef=getAppCacheFilePath(_0x239506,_0x4be49c);if(!existsSync(_0x10deef))return null;try{const _0x4156a9=readFileSync(_0x10deef,_0x43480d(0x1d4));if(!_0x4156a9['trim']())return null;const _0x309fd8=JSON[_0x43480d(0x1c1)](_0x4156a9);if(!Array[_0x43480d(0x1cf)](_0x309fd8[_0x43480d(0x1d0)]))return null;return _0x309fd8;}catch{return null;}}export function writeCachedAppList(_0x3c01da,_0x335206,_0x1d6b9d){const _0x2ce1d8=a2_0x5e3b,_0x44742d=getAppCacheFilePath(_0x3c01da,_0x335206),_0x21caab=dirname(_0x44742d);!existsSync(_0x21caab)&&mkdirSync(_0x21caab,{'recursive':!![]});const _0x1ebdd3=_0x44742d+_0x2ce1d8(0x1c8);try{writeFileSync(_0x1ebdd3,JSON['stringify'](_0x1d6b9d,null,0x2)+'\x0a',{'encoding':_0x2ce1d8(0x1d4),'mode':0x180});try{renameSync(_0x1ebdd3,_0x44742d);}catch(_0x5cd6ac){if(_0x5cd6ac[_0x2ce1d8(0x1d5)]==='EPERM'||_0x5cd6ac[_0x2ce1d8(0x1d5)]==='EXDEV'||_0x5cd6ac['code']===_0x2ce1d8(0x1ce)){writeFileSync(_0x44742d,JSON['stringify'](_0x1d6b9d,null,0x2)+'\x0a',{'encoding':_0x2ce1d8(0x1d4)});try{unlinkSync(_0x1ebdd3);}catch{}}else throw _0x5cd6ac;}}catch(_0x560b7e){try{unlinkSync(_0x1ebdd3);}catch{}throw _0x560b7e;}return _0x44742d;}function a2_0x5e3b(_0x25d01e,_0xe6b64b){_0x25d01e=_0x25d01e-0x1c1;const _0x5af859=a2_0x5af8();let _0x5e3b52=_0x5af859[_0x25d01e];return _0x5e3b52;}export function resolveCachedAppCode(_0x190070,_0x52ed9e,_0x4509d4){const _0x47608d=a2_0x5e3b;if(!_0x190070)return undefined;const _0x55bf0d=readCachedAppList(_0x52ed9e,_0x4509d4),_0x57fe81=_0x55bf0d?.[_0x47608d(0x1d0)]['find'](_0x33fdbf=>_0x33fdbf[_0x47608d(0x1d6)]===_0x190070&&isRuntimeAccessibleApp(_0x33fdbf));return _0x57fe81?.[_0x47608d(0x1c2)]?.[_0x47608d(0x1cc)]()||undefined;}
@@ -1 +1 @@
1
- const a3_0x2b7d1f=a3_0xa06f;(function(_0x933bb2,_0x1fff87){const _0x5e6df6=a3_0xa06f,_0x518431=_0x933bb2();while(!![]){try{const _0x128a4f=-parseInt(_0x5e6df6(0xd6))/0x1*(-parseInt(_0x5e6df6(0xd4))/0x2)+-parseInt(_0x5e6df6(0xe3))/0x3+-parseInt(_0x5e6df6(0xbd))/0x4+-parseInt(_0x5e6df6(0xaf))/0x5+-parseInt(_0x5e6df6(0xd9))/0x6*(-parseInt(_0x5e6df6(0xb0))/0x7)+-parseInt(_0x5e6df6(0xbb))/0x8+parseInt(_0x5e6df6(0xd8))/0x9;if(_0x128a4f===_0x1fff87)break;else _0x518431['push'](_0x518431['shift']());}catch(_0x274a08){_0x518431['push'](_0x518431['shift']());}}}(a3_0x21aa,0xdc61b));function a3_0x21aa(){const _0x531b83=['items','enableI18n','fetchedAt','No\x20cached\x20apps\x20found.','3910971NURPiZ','appOwnerName','Filter\x20by\x20environment\x20(default:\x20current\x20env)','appName','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','read','filter','cachePath','accessKey','Reads\x20the\x20given\x20.rabetbase.json\x20and\x20imports\x20a\x20usable\x20default\x20app\x20into\x20local\x20.lovrabet.json.\x20Matching\x20keys\x20may\x20be\x20updated.','mergedCli','../../commands/app/remote-source.js','name','trim','find','2697020OtZfUf','28196zcZzEG','Refreshed\x20app\x20cache\x20with\x20','Include\x20unpublished\x20apps\x20for\x20diagnostics','langs','nonInteractive','\x20cached\x20app(s)\x20for\x20env=\x22','push','no-cache','str','string','source','11246680VNOYVW','map','1572624MJrDsa','import','entries','list','Read\x20app\x20list\x20from\x20local\x20cache\x20only','cache','write','isCurrent','length','No\x20apps\x20found\x20on\x20the\x20platform.','production','projectPath','boolean','include-unpublished','Target\x20environment\x20(default:\x20current\x20env)','remote','bool','envName','env','../../context.js','Reads\x20the\x20apps\x20available\x20to\x20the\x20current\x20account\x20and\x20overwrites\x20the\x20local\x20app\x20cache\x20for\x20that\x20environment.\x20Platform\x20apps\x20are\x20not\x20modified.','appPublishStatus','app','240098LEdpIv','pull','4SSHkzb','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','24472683CPvUXj','2004MAvqHO','i18nInfo','local','isArray','appCode','config'];a3_0x21aa=function(){return _0x531b83;};return a3_0x21aa();}import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x3bda0a,_0x8f9d4e){const _0x1820eb=a3_0xa06f,_0x3311b2={};for(const _0x537e9f of _0x8f9d4e){const _0x40d096=_0x537e9f['type']===_0x1820eb(0xc9)?_0x3bda0a[_0x1820eb(0xcd)](_0x537e9f[_0x1820eb(0xac)]):_0x3bda0a['str'](_0x537e9f['name']);if(_0x40d096!==''&&_0x40d096!==![])_0x3311b2[_0x537e9f[_0x1820eb(0xac)]]=_0x40d096;}if(_0x3bda0a['nonInteractive'])_0x3311b2[_0x1820eb(0xb4)]=!![];return _0x3311b2;}function normalizeLanguages(_0xaba94d){const _0x424ad5=a3_0xa06f;if(!Array[_0x424ad5(0xdc)](_0xaba94d))return[];return _0xaba94d[_0x424ad5(0xa6)](_0x261c64=>typeof _0x261c64===_0x424ad5(0xb9))['map'](_0x53f4be=>_0x53f4be[_0x424ad5(0xad)]())[_0x424ad5(0xa6)](Boolean);}function buildRemoteAppI18nFields(_0x253b00){const _0x13924a=a3_0xa06f,_0x364890=normalizeLanguages(_0x253b00[_0x13924a(0xda)]?.[_0x13924a(0xb3)]);return{'enableI18n':typeof _0x253b00[_0x13924a(0xe0)]==='boolean'?_0x253b00['enableI18n']:null,'languages':_0x364890,'i18nInfo':_0x253b00['i18nInfo']?{..._0x253b00[_0x13924a(0xda)],'langs':_0x364890[_0x13924a(0xc5)]?_0x364890:null}:null};}const listDef={'service':'app','command':a3_0x2b7d1f(0xc0),'description':a3_0x2b7d1f(0xd7),'risk':a3_0x2b7d1f(0xa5),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x2b7d1f(0xcf),'type':a3_0x2b7d1f(0xb9),'description':a3_0x2b7d1f(0xa2),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x2b7d1f(0xdb),'type':a3_0x2b7d1f(0xc9),'description':a3_0x2b7d1f(0xc1),'default':![]},{'name':a3_0x2b7d1f(0xb7),'type':a3_0x2b7d1f(0xc9),'description':a3_0x2b7d1f(0xa4),'default':![]},{'name':a3_0x2b7d1f(0xca),'type':'boolean','description':a3_0x2b7d1f(0xb2),'default':![]}],async 'execute'(_0xf3214d){const _0x23b878=a3_0x2b7d1f,_0x4b0531=_0xf3214d[_0x23b878(0xb8)]('env')||_0xf3214d[_0x23b878(0xce)]||getEnv()||_0x23b878(0xc7),_0x5c5079=_0xf3214d['bool']('local'),_0x69a299=_0xf3214d[_0x23b878(0xcd)](_0x23b878(0xb7)),_0x814863=_0xf3214d[_0x23b878(0xcd)](_0x23b878(0xca)),{readRawConfigWithLayers:_0xfe0aee,resolveDefaultAppSource:_0x18b468,getLocalAppAliases:_0x4ca52b}=await import(_0x23b878(0xd0)),{getRemoteAppList:_0x370e61}=await import('../../commands/app/remote-source.js'),{config:_0x4e772f,layers:_0x10804b}=_0xfe0aee(),_0x2f9820=_0x18b468(_0x10804b),{defaultApp:_0x2f29e0}=_0x4e772f,_0x350ec7=await _0x370e61({'env':_0x4b0531,'accessKey':_0xf3214d['accessKey'],'localOnly':_0x5c5079,'noCache':_0x69a299}),_0x52f6d9=_0x814863?_0x350ec7[_0x23b878(0xdf)]:filterRuntimeAccessibleApps(_0x350ec7[_0x23b878(0xdf)]),_0x41a13a=_0x350ec7[_0x23b878(0xdf)][_0x23b878(0xc5)]-_0x52f6d9[_0x23b878(0xc5)],_0x36b8b4=_0x52f6d9[_0x23b878(0xbc)](_0x31f9df=>{const _0x3e8483=_0x23b878;return{'name':_0x31f9df[_0x3e8483(0xa3)],'appcode':_0x31f9df[_0x3e8483(0xdd)],'named':!![],'definedIn':_0x3e8483(0xcc),'isDefault':_0x31f9df[_0x3e8483(0xa3)]===_0x2f29e0,...buildAppProfileListFields(_0x4b0531),...buildRemoteAppI18nFields(_0x31f9df),'source':_0x350ec7[_0x3e8483(0xba)],'owner':_0x31f9df[_0x3e8483(0xe4)]??null,'status':_0x31f9df[_0x3e8483(0xd2)]??null,'cachedAt':_0x350ec7['fetchedAt']};}),_0x13300b=_0x4ca52b(_0x4e772f);let _0x28dca6=0x0;for(const [_0x507b81,_0x9f036b]of Object[_0x23b878(0xbf)](_0x13300b)){const _0x85043e=typeof _0x9f036b['appcode']===_0x23b878(0xb9)?_0x9f036b['appcode']['trim']():'';if(!_0x85043e)continue;const _0x33412d=findAppByCode(_0x350ec7[_0x23b878(0xdf)],_0x85043e);if(!_0x814863&&_0x33412d&&!isRuntimeAccessibleApp(_0x33412d))continue;_0x28dca6+=0x1,_0x36b8b4[_0x23b878(0xb6)]({'name':_0x507b81,'appcode':_0x85043e,'named':!![],'definedIn':_0x23b878(0xdb),'isDefault':_0x507b81===_0x2f29e0,...buildAppProfileListFields(_0x4b0531),'source':_0x23b878(0xde),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x36b8b4,_0xf3214d[_0x23b878(0xaa)]);const _0x371df3=_0x36b8b4[_0x23b878(0xae)](_0x1aff03=>_0x1aff03[_0x23b878(0xc4)]===!![]),_0x26855d=_0x2f29e0??_0x371df3?.[_0x23b878(0xac)]??null,_0x46bb96={'env':_0x4b0531,'source':_0x350ec7[_0x23b878(0xba)],'fetchedAt':_0x350ec7[_0x23b878(0xe1)],'cachePath':_0x350ec7[_0x23b878(0xa7)],'globalPath':_0x10804b['globalPath']??null,'projectPath':_0x10804b[_0x23b878(0xc8)]??null,'defaultApp':_0x26855d,'defaultAppSource':_0x2f29e0!=null?_0x2f9820:null,'localAliasCount':_0x28dca6,'remoteTotal':_0x350ec7[_0x23b878(0xdf)]['length'],'hiddenUnpublishedCount':_0x41a13a,'includeUnpublished':_0x814863};if(_0x36b8b4['length']===0x0)return{'ok':!![],'data':{'items':_0x36b8b4,'meta':_0x46bb96},'message':_0x350ec7[_0x23b878(0xba)]===_0x23b878(0xc2)?_0x23b878(0xe2):_0x23b878(0xc6)};return{'ok':!![],'data':{'items':_0x36b8b4,'meta':_0x46bb96}};}},pullDef={'service':a3_0x2b7d1f(0xd3),'command':a3_0x2b7d1f(0xd5),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':'write','confirmationDescription':a3_0x2b7d1f(0xd1),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a3_0x2b7d1f(0xb9),'description':a3_0x2b7d1f(0xcb),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x2b7d1f(0xdb),'type':a3_0x2b7d1f(0xc9),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':'no-cache','type':a3_0x2b7d1f(0xc9),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x2fc6f1){const _0x1fb935=a3_0x2b7d1f,_0x4e9132=_0x2fc6f1[_0x1fb935(0xb8)](_0x1fb935(0xcf))||_0x2fc6f1[_0x1fb935(0xce)]||getEnv()||'production',_0x3c7528=_0x2fc6f1[_0x1fb935(0xcd)]('local'),_0x5884f7=_0x2fc6f1[_0x1fb935(0xcd)](_0x1fb935(0xb7)),{getRemoteAppList:_0x1a062c}=await import(_0x1fb935(0xab)),_0x2224a6=await _0x1a062c({'env':_0x4e9132,'accessKey':_0x2fc6f1[_0x1fb935(0xa8)],'localOnly':_0x3c7528,'noCache':_0x5884f7});return{'ok':!![],'data':{'total':_0x2224a6[_0x1fb935(0xdf)][_0x1fb935(0xc5)],'env':_0x4e9132,'source':_0x2224a6[_0x1fb935(0xba)],'fetchedAt':_0x2224a6['fetchedAt'],'cachePath':_0x2224a6[_0x1fb935(0xa7)]},'message':_0x2224a6[_0x1fb935(0xba)]==='cache'?'Loaded\x20'+_0x2224a6[_0x1fb935(0xdf)]['length']+_0x1fb935(0xb5)+_0x4e9132+'\x22.':_0x1fb935(0xb1)+_0x2224a6[_0x1fb935(0xdf)][_0x1fb935(0xc5)]+'\x20app(s)\x20for\x20env=\x22'+_0x4e9132+'\x22.'};}},importDef={'service':a3_0x2b7d1f(0xd3),'command':a3_0x2b7d1f(0xbe),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x2b7d1f(0xc3),'confirmationDescription':a3_0x2b7d1f(0xa9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x4d3275){return await runAppImport(collectFlags(_0x4d3275,appImportFlagDefs)),{'ok':!![]};}};function a3_0xa06f(_0xdc1d18,_0x5caa67){_0xdc1d18=_0xdc1d18-0xa2;const _0x21aa88=a3_0x21aa();let _0xa06ffa=_0x21aa88[_0xdc1d18];return _0xa06ffa;}export const appDefinitions=[listDef,pullDef,importDef];
1
+ const a3_0x1b17a=a3_0x40ef;(function(_0x71b01d,_0x132612){const _0x1692c8=a3_0x40ef,_0x2a5b30=_0x71b01d();while(!![]){try{const _0x14132c=-parseInt(_0x1692c8(0x181))/0x1+-parseInt(_0x1692c8(0x167))/0x2+parseInt(_0x1692c8(0x18e))/0x3*(parseInt(_0x1692c8(0x192))/0x4)+-parseInt(_0x1692c8(0x175))/0x5*(parseInt(_0x1692c8(0x16c))/0x6)+-parseInt(_0x1692c8(0x189))/0x7*(parseInt(_0x1692c8(0x17e))/0x8)+parseInt(_0x1692c8(0x196))/0x9+parseInt(_0x1692c8(0x16d))/0xa;if(_0x14132c===_0x132612)break;else _0x2a5b30['push'](_0x2a5b30['shift']());}catch(_0x2da4a3){_0x2a5b30['push'](_0x2a5b30['shift']());}}}(a3_0x344f,0x9c52f));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x1d7bfa,_0x45ce6d){const _0xea1b41=a3_0x40ef,_0x196307={};for(const _0x577d98 of _0x45ce6d){const _0x57ff54=_0x577d98[_0xea1b41(0x16e)]===_0xea1b41(0x195)?_0x1d7bfa['bool'](_0x577d98[_0xea1b41(0x170)]):_0x1d7bfa['str'](_0x577d98[_0xea1b41(0x170)]);if(_0x57ff54!==''&&_0x57ff54!==![])_0x196307[_0x577d98[_0xea1b41(0x170)]]=_0x57ff54;}if(_0x1d7bfa[_0xea1b41(0x198)])_0x196307[_0xea1b41(0x198)]=!![];return _0x196307;}function normalizeLanguages(_0x1ca728){const _0x541c51=a3_0x40ef;if(!Array[_0x541c51(0x18f)](_0x1ca728))return[];return _0x1ca728[_0x541c51(0x194)](_0x523693=>typeof _0x523693==='string')[_0x541c51(0x18a)](_0xbba9be=>_0xbba9be['trim']())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x510e71){const _0x1b6ccd=a3_0x40ef,_0x23b41f=normalizeLanguages(_0x510e71[_0x1b6ccd(0x16a)]?.[_0x1b6ccd(0x199)]);return{'enableI18n':typeof _0x510e71[_0x1b6ccd(0x15e)]===_0x1b6ccd(0x195)?_0x510e71[_0x1b6ccd(0x15e)]:null,'languages':_0x23b41f,'i18nInfo':_0x510e71[_0x1b6ccd(0x16a)]?{..._0x510e71[_0x1b6ccd(0x16a)],'langs':_0x23b41f[_0x1b6ccd(0x16b)]?_0x23b41f:null}:null};}function a3_0x344f(){const _0x3571ff=['\x20cached\x20app(s)\x20for\x20env=\x22','production','string','Loaded\x20','24MkbeZo','str','push','303840mSmaKD','\x20app(s)\x20for\x20env=\x22','appOwnerName','appCode','local','../../commands/app/remote-source.js','fetchedAt','globalPath','927521jYzXLW','map','Filter\x20by\x20environment\x20(default:\x20current\x20env)','../../context.js','cachePath','1761xAXCgO','isArray','source','write','4996wNDBLp','appName','filter','boolean','5086728qVeMZK','cache','nonInteractive','langs','envName','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','enableI18n','No\x20cached\x20apps\x20found.','No\x20apps\x20found\x20on\x20the\x20platform.','Reads\x20the\x20given\x20.rabetbase.json\x20and\x20imports\x20a\x20usable\x20default\x20app\x20into\x20local\x20.lovrabet.json.\x20Matching\x20keys\x20may\x20be\x20updated.','bool','isCurrent','env','Refreshed\x20app\x20cache\x20with\x20','no-cache','2357788CpCgYH','entries','app','i18nInfo','length','3638646zGtmXx','18286320WJPQEZ','type','accessKey','name','Read\x20app\x20list\x20from\x20local\x20cache\x20only','remote','items','appcode','5GcOYQe','config','mergedCli','Reads\x20the\x20apps\x20available\x20to\x20the\x20current\x20account\x20and\x20overwrites\x20the\x20local\x20app\x20cache\x20for\x20that\x20environment.\x20Platform\x20apps\x20are\x20not\x20modified.','pull'];a3_0x344f=function(){return _0x3571ff;};return a3_0x344f();}function a3_0x40ef(_0x14102f,_0x344274){_0x14102f=_0x14102f-0x15e;const _0x344fb8=a3_0x344f();let _0x40ef18=_0x344fb8[_0x14102f];return _0x40ef18;}const listDef={'service':a3_0x1b17a(0x169),'command':'list','description':a3_0x1b17a(0x19b),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x1b17a(0x164),'type':a3_0x1b17a(0x17c),'description':a3_0x1b17a(0x18b),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x1b17a(0x195),'description':a3_0x1b17a(0x171),'default':![]},{'name':a3_0x1b17a(0x166),'type':a3_0x1b17a(0x195),'description':a3_0x1b17a(0x19c),'default':![]},{'name':'include-unpublished','type':a3_0x1b17a(0x195),'description':'Include\x20unpublished\x20apps\x20for\x20diagnostics','default':![]}],async 'execute'(_0x196482){const _0x49e859=a3_0x1b17a,_0x3519dc=_0x196482[_0x49e859(0x17f)](_0x49e859(0x164))||_0x196482[_0x49e859(0x19a)]||getEnv()||_0x49e859(0x17b),_0x23ad56=_0x196482[_0x49e859(0x162)](_0x49e859(0x185)),_0x2eaf63=_0x196482[_0x49e859(0x162)](_0x49e859(0x166)),_0x93762=_0x196482['bool']('include-unpublished'),{readRawConfigWithLayers:_0x15a2bc,resolveDefaultAppSource:_0x367386,getLocalAppAliases:_0x2130fe}=await import(_0x49e859(0x18c)),{getRemoteAppList:_0x2dac3f}=await import(_0x49e859(0x186)),{config:_0x4faba4,layers:_0x13db91}=_0x15a2bc(),_0x3c0864=_0x367386(_0x13db91),{defaultApp:_0x2b9207}=_0x4faba4,_0xdfff1b=await _0x2dac3f({'env':_0x3519dc,'accessKey':_0x196482[_0x49e859(0x16f)],'localOnly':_0x23ad56,'noCache':_0x2eaf63}),_0xf31c9e=_0x93762?_0xdfff1b[_0x49e859(0x173)]:filterRuntimeAccessibleApps(_0xdfff1b[_0x49e859(0x173)]),_0xfd23=_0xdfff1b['items']['length']-_0xf31c9e['length'],_0x2c5a84=_0xf31c9e[_0x49e859(0x18a)](_0x98977=>{const _0xa43464=_0x49e859;return{'name':_0x98977[_0xa43464(0x193)],'appcode':_0x98977[_0xa43464(0x184)],'named':!![],'definedIn':_0xa43464(0x172),'isDefault':_0x98977['appName']===_0x2b9207,...buildAppProfileListFields(_0x3519dc),...buildRemoteAppI18nFields(_0x98977),'source':_0xdfff1b['source'],'owner':_0x98977[_0xa43464(0x183)]??null,'status':_0x98977['appPublishStatus']??null,'cachedAt':_0xdfff1b[_0xa43464(0x187)]};}),_0x1de0b3=_0x2130fe(_0x4faba4);let _0xe06fc=0x0;for(const [_0x2745df,_0x389bde]of Object[_0x49e859(0x168)](_0x1de0b3)){const _0x186132=typeof _0x389bde[_0x49e859(0x174)]==='string'?_0x389bde[_0x49e859(0x174)]['trim']():'';if(!_0x186132)continue;const _0x4b0681=findAppByCode(_0xdfff1b[_0x49e859(0x173)],_0x186132);if(!_0x93762&&_0x4b0681&&!isRuntimeAccessibleApp(_0x4b0681))continue;_0xe06fc+=0x1,_0x2c5a84[_0x49e859(0x180)]({'name':_0x2745df,'appcode':_0x186132,'named':!![],'definedIn':'local','isDefault':_0x2745df===_0x2b9207,...buildAppProfileListFields(_0x3519dc),'source':_0x49e859(0x176),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x2c5a84,_0x196482[_0x49e859(0x177)]);const _0x2071be=_0x2c5a84['find'](_0x3328f0=>_0x3328f0[_0x49e859(0x163)]===!![]),_0x3ef973=_0x2b9207??_0x2071be?.[_0x49e859(0x170)]??null,_0x4ac9f6={'env':_0x3519dc,'source':_0xdfff1b['source'],'fetchedAt':_0xdfff1b[_0x49e859(0x187)],'cachePath':_0xdfff1b['cachePath'],'globalPath':_0x13db91[_0x49e859(0x188)]??null,'projectPath':_0x13db91['projectPath']??null,'defaultApp':_0x3ef973,'defaultAppSource':_0x2b9207!=null?_0x3c0864:null,'localAliasCount':_0xe06fc,'remoteTotal':_0xdfff1b[_0x49e859(0x173)][_0x49e859(0x16b)],'hiddenUnpublishedCount':_0xfd23,'includeUnpublished':_0x93762};if(_0x2c5a84[_0x49e859(0x16b)]===0x0)return{'ok':!![],'data':{'items':_0x2c5a84,'meta':_0x4ac9f6},'message':_0xdfff1b[_0x49e859(0x190)]===_0x49e859(0x197)?_0x49e859(0x15f):_0x49e859(0x160)};return{'ok':!![],'data':{'items':_0x2c5a84,'meta':_0x4ac9f6}};}},pullDef={'service':a3_0x1b17a(0x169),'command':a3_0x1b17a(0x179),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x1b17a(0x191),'confirmationDescription':a3_0x1b17a(0x178),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x1b17a(0x164),'type':a3_0x1b17a(0x17c),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1b17a(0x185),'type':a3_0x1b17a(0x195),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x1b17a(0x166),'type':a3_0x1b17a(0x195),'description':a3_0x1b17a(0x19c),'default':![]}],async 'execute'(_0x1ae1a5){const _0x11915b=a3_0x1b17a,_0x152f8a=_0x1ae1a5[_0x11915b(0x17f)]('env')||_0x1ae1a5[_0x11915b(0x19a)]||getEnv()||'production',_0x461b7e=_0x1ae1a5[_0x11915b(0x162)](_0x11915b(0x185)),_0x515c65=_0x1ae1a5[_0x11915b(0x162)](_0x11915b(0x166)),{getRemoteAppList:_0x3f5ac8}=await import(_0x11915b(0x186)),_0x4592bb=await _0x3f5ac8({'env':_0x152f8a,'accessKey':_0x1ae1a5[_0x11915b(0x16f)],'localOnly':_0x461b7e,'noCache':_0x515c65});return{'ok':!![],'data':{'total':_0x4592bb[_0x11915b(0x173)][_0x11915b(0x16b)],'env':_0x152f8a,'source':_0x4592bb[_0x11915b(0x190)],'fetchedAt':_0x4592bb[_0x11915b(0x187)],'cachePath':_0x4592bb[_0x11915b(0x18d)]},'message':_0x4592bb[_0x11915b(0x190)]===_0x11915b(0x197)?_0x11915b(0x17d)+_0x4592bb[_0x11915b(0x173)]['length']+_0x11915b(0x17a)+_0x152f8a+'\x22.':_0x11915b(0x165)+_0x4592bb[_0x11915b(0x173)]['length']+_0x11915b(0x182)+_0x152f8a+'\x22.'};}},importDef={'service':a3_0x1b17a(0x169),'command':'import','description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x1b17a(0x191),'confirmationDescription':a3_0x1b17a(0x161),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x26604a){return await runAppImport(collectFlags(_0x26604a,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
@@ -1 +1 @@
1
- (function(_0x5347f1,_0x1ed03d){const _0x50238b=a4_0x1262,_0x5f68e0=_0x5347f1();while(!![]){try{const _0x298bba=-parseInt(_0x50238b(0x149))/0x1*(parseInt(_0x50238b(0x152))/0x2)+-parseInt(_0x50238b(0x15a))/0x3+parseInt(_0x50238b(0x157))/0x4+-parseInt(_0x50238b(0x146))/0x5*(-parseInt(_0x50238b(0x154))/0x6)+parseInt(_0x50238b(0x147))/0x7+parseInt(_0x50238b(0x155))/0x8*(-parseInt(_0x50238b(0x15b))/0x9)+-parseInt(_0x50238b(0x159))/0xa*(-parseInt(_0x50238b(0x156))/0xb);if(_0x298bba===_0x1ed03d)break;else _0x5f68e0['push'](_0x5f68e0['shift']());}catch(_0x2c79cf){_0x5f68e0['push'](_0x5f68e0['shift']());}}}(a4_0x46e1,0xd4abc));function a4_0x46e1(){const _0x590c7a=['7164122IctFeD','appCode','253ONPdUk','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','trim','filter','validation','appName','UNKNOWN','find','string','13278LnrQTU','Current\x20status:\x20','3497862LKxiHd','112JuHmzm','112211oxvjoo','2613064ohbywe','appPublishStatus','2190zwxwuE','4636569VkUQqI','255483mzHbme','.\x20Publish\x20the\x20app\x20before\x20using\x20','App\x20','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','toUpperCase','5ZMybXJ'];a4_0x46e1=function(){return _0x590c7a;};return a4_0x46e1();}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(_0xeb97a9){const _0x1ef46a=a4_0x1262;if(typeof _0xeb97a9!==_0x1ef46a(0x151))return null;const _0x48b3eb=_0xeb97a9['trim']();return _0x48b3eb?_0x48b3eb[_0x1ef46a(0x145)]():null;}export function isRuntimeAccessibleApp(_0x45c975){const _0x2de011=a4_0x1262;return normalizeAppPublishStatus(_0x45c975[_0x2de011(0x158)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x5e2efa){const _0x19d90b=a4_0x1262;return _0x5e2efa[_0x19d90b(0x14c)](isRuntimeAccessibleApp);}export function findAppByName(_0xa4189d,_0x34d98c){const _0x3308f3=a4_0x1262;return _0xa4189d[_0x3308f3(0x150)](_0x453b7a=>_0x453b7a[_0x3308f3(0x14e)]===_0x34d98c);}function a4_0x1262(_0x3ea6bf,_0x57c8c7){_0x3ea6bf=_0x3ea6bf-0x144;const _0x46e118=a4_0x46e1();let _0x1262f7=_0x46e118[_0x3ea6bf];return _0x1262f7;}export function findAppByCode(_0x1a164b,_0x3d289e){const _0x5bd70b=a4_0x1262,_0x5e1777=_0x3d289e['trim']();if(!_0x5e1777)return undefined;return _0x1a164b['find'](_0x4a15d2=>_0x4a15d2[_0x5bd70b(0x148)]?.[_0x5bd70b(0x14b)]()===_0x5e1777);}export function runtimeInaccessibleAppError(_0x547525,_0x316423){const _0x25a525=a4_0x1262,_0x320a51=normalizeAppPublishStatus(_0x547525[_0x25a525(0x158)])??_0x25a525(0x14f);return CliErrors[_0x25a525(0x14d)](_0x25a525(0x15d)+_0x316423+_0x25a525(0x14a),_0x25a525(0x153)+_0x320a51+_0x25a525(0x15c)+CLI_BIN_NAME+_0x25a525(0x144));}
1
+ (function(_0x4ef07f,_0x3cd801){const _0x580115=a4_0x1ab0,_0x43001e=_0x4ef07f();while(!![]){try{const _0xa3234b=parseInt(_0x580115(0x10b))/0x1+-parseInt(_0x580115(0xff))/0x2*(parseInt(_0x580115(0x10a))/0x3)+-parseInt(_0x580115(0x104))/0x4+-parseInt(_0x580115(0x102))/0x5+parseInt(_0x580115(0x10f))/0x6*(parseInt(_0x580115(0x100))/0x7)+parseInt(_0x580115(0x10d))/0x8+parseInt(_0x580115(0x101))/0x9;if(_0xa3234b===_0x3cd801)break;else _0x43001e['push'](_0x43001e['shift']());}catch(_0x56de59){_0x43001e['push'](_0x43001e['shift']());}}}(a4_0x4983,0x39336));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';function a4_0x4983(){const _0x45467e=['UNKNOWN','504768cFvzsn','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','2838qLhoNF','appName','Current\x20status:\x20','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','appPublishStatus','3626ewQopI','112lyRtPl','5984154CePtYh','1882925WMxAEz','trim','1412544lBlCxd','App\x20','validation','find','.\x20Publish\x20the\x20app\x20before\x20using\x20','appCode','309shYNoq','415184pGSwNY'];a4_0x4983=function(){return _0x45467e;};return a4_0x4983();}export function normalizeAppPublishStatus(_0x1320e8){if(typeof _0x1320e8!=='string')return null;const _0x519bef=_0x1320e8['trim']();return _0x519bef?_0x519bef['toUpperCase']():null;}export function isRuntimeAccessibleApp(_0x7dac78){const _0x391f5c=a4_0x1ab0;return normalizeAppPublishStatus(_0x7dac78[_0x391f5c(0xfe)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x19572d){return _0x19572d['filter'](isRuntimeAccessibleApp);}export function findAppByName(_0x3aaaba,_0x13eccf){const _0x99025a=a4_0x1ab0;return _0x3aaaba[_0x99025a(0x107)](_0x98eee8=>_0x98eee8[_0x99025a(0x110)]===_0x13eccf);}export function findAppByCode(_0x2f8c8b,_0x30a0c3){const _0x33f0fb=a4_0x1ab0,_0x1d590b=_0x30a0c3[_0x33f0fb(0x103)]();if(!_0x1d590b)return undefined;return _0x2f8c8b['find'](_0x49b91f=>_0x49b91f[_0x33f0fb(0x109)]?.['trim']()===_0x1d590b);}function a4_0x1ab0(_0x285102,_0x57b8ba){_0x285102=_0x285102-0xfd;const _0x49830e=a4_0x4983();let _0x1ab0cf=_0x49830e[_0x285102];return _0x1ab0cf;}export function runtimeInaccessibleAppError(_0x4869e8,_0x19407d){const _0x450a62=a4_0x1ab0,_0x588425=normalizeAppPublishStatus(_0x4869e8[_0x450a62(0xfe)])??_0x450a62(0x10c);return CliErrors[_0x450a62(0x106)](_0x450a62(0x105)+_0x19407d+_0x450a62(0xfd),_0x450a62(0x111)+_0x588425+_0x450a62(0x108)+CLI_BIN_NAME+_0x450a62(0x10e));}
@@ -1 +1 @@
1
- (function(_0xf06259,_0x4adad2){const _0x1df92f=a5_0x2050,_0xc17bfd=_0xf06259();while(!![]){try{const _0x2fcbdb=parseInt(_0x1df92f(0x76))/0x1+-parseInt(_0x1df92f(0x73))/0x2*(-parseInt(_0x1df92f(0x75))/0x3)+parseInt(_0x1df92f(0x6d))/0x4+parseInt(_0x1df92f(0x6b))/0x5*(parseInt(_0x1df92f(0x6c))/0x6)+-parseInt(_0x1df92f(0x72))/0x7*(parseInt(_0x1df92f(0x74))/0x8)+parseInt(_0x1df92f(0x78))/0x9+-parseInt(_0x1df92f(0x6f))/0xa*(parseInt(_0x1df92f(0x69))/0xb);if(_0x2fcbdb===_0x4adad2)break;else _0xc17bfd['push'](_0xc17bfd['shift']());}catch(_0x1996f2){_0xc17bfd['push'](_0xc17bfd['shift']());}}}(a5_0x5db2,0x5333b));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x3f5c1b=a5_0x2050,_0x32bbe2=join(__dirname,_0x3f5c1b(0x70)),_0x1f906e=readFileSync(_0x32bbe2,'utf-8');return JSON[_0x3f5c1b(0x77)](_0x1f906e);}let _cached=null;function a5_0x2050(_0x215ae2,_0x459227){_0x215ae2=_0x215ae2-0x69;const _0x5db2e9=a5_0x5db2();let _0x205056=_0x5db2e9[_0x215ae2];return _0x205056;}function a5_0x5db2(){const _0x1e152e=['386948OuLzgd','8008nTHzJW','3SLlkOh','80353hPbKux','parse','2395710HSxffx','1797620SXQuGc','data','5cpwPpi','1363440thyenk','787724jbnoDg','Mock\x20API\x20error:\x20','30HQthSM','../../../mock/app-list.json','errorCode','931mnsioj'];a5_0x5db2=function(){return _0x1e152e;};return a5_0x5db2();}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x3c80e2=a5_0x2050,_0x595ee9=getMockAppList();if(!_0x595ee9['success'])throw new Error(_0x3c80e2(0x6e)+_0x595ee9['errorMsg']+'\x20('+_0x595ee9[_0x3c80e2(0x71)]+')');return _0x595ee9[_0x3c80e2(0x6a)]['tableData'];}
1
+ (function(_0x2b01e5,_0x2c8d38){const _0x128b71=a5_0x31ce,_0x321526=_0x2b01e5();while(!![]){try{const _0x1df5b8=-parseInt(_0x128b71(0x1ed))/0x1+parseInt(_0x128b71(0x1f2))/0x2*(parseInt(_0x128b71(0x1f5))/0x3)+parseInt(_0x128b71(0x1eb))/0x4*(-parseInt(_0x128b71(0x1f3))/0x5)+-parseInt(_0x128b71(0x1ee))/0x6+-parseInt(_0x128b71(0x1f4))/0x7+parseInt(_0x128b71(0x1e9))/0x8+parseInt(_0x128b71(0x1f6))/0x9;if(_0x1df5b8===_0x2c8d38)break;else _0x321526['push'](_0x321526['shift']());}catch(_0xbe6a3d){_0x321526['push'](_0x321526['shift']());}}}(a5_0x4ae4,0xe6838));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x20b55a=a5_0x31ce,_0xb8a867=join(__dirname,'../../../mock/app-list.json'),_0x198cc7=readFileSync(_0xb8a867,_0x20b55a(0x1ec));return JSON[_0x20b55a(0x1ef)](_0x198cc7);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}function a5_0x31ce(_0x12efa5,_0x1186d1){_0x12efa5=_0x12efa5-0x1e9;const _0x4ae4a9=a5_0x4ae4();let _0x31ced9=_0x4ae4a9[_0x12efa5];return _0x31ced9;}export function getMockRemoteAppItems(){const _0x1f4132=a5_0x31ce,_0x1ae131=getMockAppList();if(!_0x1ae131['success'])throw new Error(_0x1f4132(0x1f7)+_0x1ae131[_0x1f4132(0x1f0)]+'\x20('+_0x1ae131[_0x1f4132(0x1f1)]+')');return _0x1ae131['data'][_0x1f4132(0x1ea)];}function a5_0x4ae4(){const _0x32c0b3=['errorCode','99938jUhxqN','5oulmbs','2717869xRlqPd','69HUNree','18043290viGxpl','Mock\x20API\x20error:\x20','9183088RbwIjL','tableData','2612888XgeMBx','utf-8','1876770XOWYyA','2637240ZWuJuc','parse','errorMsg'];a5_0x4ae4=function(){return _0x32c0b3;};return a5_0x4ae4();}
@@ -1 +1 @@
1
- (function(_0xf78dd2,_0x43aca4){const _0x4899e1=a6_0x473b,_0x2e5150=_0xf78dd2();while(!![]){try{const _0x2a111d=-parseInt(_0x4899e1(0x1ad))/0x1+parseInt(_0x4899e1(0x1b5))/0x2*(parseInt(_0x4899e1(0x1b9))/0x3)+-parseInt(_0x4899e1(0x1ac))/0x4+parseInt(_0x4899e1(0x1af))/0x5+parseInt(_0x4899e1(0x1b6))/0x6+parseInt(_0x4899e1(0x1b4))/0x7*(parseInt(_0x4899e1(0x1b1))/0x8)+-parseInt(_0x4899e1(0x1b3))/0x9*(parseInt(_0x4899e1(0x1b8))/0xa);if(_0x2a111d===_0x43aca4)break;else _0x2e5150['push'](_0x2e5150['shift']());}catch(_0x2f8f2f){_0x2e5150['push'](_0x2e5150['shift']());}}}(a6_0x36d4,0x4785b));import{getMyApps}from'../../core/api-client.js';function a6_0x473b(_0x14a593,_0x2584c9){_0x14a593=_0x14a593-0x1ac;const _0x36d4b5=a6_0x36d4();let _0x473b5d=_0x36d4b5[_0x14a593];return _0x473b5d;}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 _0x1e5ef8=a6_0x473b,_0x4d6468=(productEnv(_0x1e5ef8(0x1ba))||'')[_0x1e5ef8(0x1ae)]()['toLowerCase']();return _0x4d6468==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x5d14a1){const _0x568915=a6_0x473b,{env:_0x1ea3c3,accessKey:_0x466ebd,localOnly:localOnly=![],noCache:noCache=![]}=_0x5d14a1,_0x23ad1e=readCachedAppList(_0x1ea3c3,_0x466ebd),_0xfba9f4=_0x466ebd?.[_0x568915(0x1ae)]()?getAppCacheFilePath(_0x1ea3c3,_0x466ebd):null;if(localOnly)return{'items':_0x23ad1e?.['items']??[],'source':_0x568915(0x1b2),'fetchedAt':_0x23ad1e?.[_0x568915(0x1b0)]??null,'cachePath':_0xfba9f4};try{const _0x7b0bc=await getRemoteAppItems(),_0x342238=shouldUseMockRemoteApps()?'mock':_0x568915(0x1bc),_0x12868b=new Date()[_0x568915(0x1bb)](),_0x341162=_0x466ebd?.[_0x568915(0x1ae)]()?writeCachedAppList(_0x1ea3c3,_0x466ebd,{'env':_0x1ea3c3,'fetchedAt':_0x12868b,'source':_0x342238,'items':_0x7b0bc}):null;return{'items':_0x7b0bc,'source':_0x342238,'fetchedAt':_0x12868b,'cachePath':_0x341162};}catch(_0x4d8362){if(!noCache&&_0x23ad1e)return{'items':_0x23ad1e[_0x568915(0x1b7)],'source':_0x568915(0x1b2),'fetchedAt':_0x23ad1e[_0x568915(0x1b0)],'cachePath':_0xfba9f4};throw _0x4d8362;}}function a6_0x36d4(){const _0x294e82=['items','940310CFPjVZ','1314SbkNVs','APP_LIST_SOURCE','toISOString','remote','2016148FHxnoE','237813nVutrG','trim','2917345kEYBUq','fetchedAt','8LJKvuG','cache','36vSRWMz','1460816YOWANO','978cJSduK','2427540IDEFwD'];a6_0x36d4=function(){return _0x294e82;};return a6_0x36d4();}
1
+ (function(_0x5302a9,_0x2a873f){const _0x319461=a6_0xeb70,_0xefb711=_0x5302a9();while(!![]){try{const _0xb90999=-parseInt(_0x319461(0x198))/0x1+parseInt(_0x319461(0x194))/0x2*(-parseInt(_0x319461(0x18f))/0x3)+parseInt(_0x319461(0x19b))/0x4*(parseInt(_0x319461(0x193))/0x5)+parseInt(_0x319461(0x192))/0x6*(-parseInt(_0x319461(0x196))/0x7)+-parseInt(_0x319461(0x19e))/0x8+parseInt(_0x319461(0x19d))/0x9*(-parseInt(_0x319461(0x191))/0xa)+-parseInt(_0x319461(0x199))/0xb*(-parseInt(_0x319461(0x19c))/0xc);if(_0xb90999===_0x2a873f)break;else _0xefb711['push'](_0xefb711['shift']());}catch(_0x37c8e2){_0xefb711['push'](_0xefb711['shift']());}}}(a6_0x25de,0x79f99));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x29349e=a6_0xeb70,_0x1e7426=(productEnv(_0x29349e(0x18d))||'')[_0x29349e(0x197)]()[_0x29349e(0x19f)]();return _0x1e7426==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x4e05ba){const _0x1965ca=a6_0xeb70,{env:_0x4e2476,accessKey:_0x38e8bb,localOnly:localOnly=![],noCache:noCache=![]}=_0x4e05ba,_0xef93bb=readCachedAppList(_0x4e2476,_0x38e8bb),_0x70ce2b=_0x38e8bb?.['trim']()?getAppCacheFilePath(_0x4e2476,_0x38e8bb):null;if(localOnly)return{'items':_0xef93bb?.[_0x1965ca(0x19a)]??[],'source':_0x1965ca(0x18e),'fetchedAt':_0xef93bb?.[_0x1965ca(0x190)]??null,'cachePath':_0x70ce2b};try{const _0xd21bbd=await getRemoteAppItems(),_0x51531e=shouldUseMockRemoteApps()?'mock':_0x1965ca(0x195),_0x120fe7=new Date()['toISOString'](),_0x4e62ae=_0x38e8bb?.[_0x1965ca(0x197)]()?writeCachedAppList(_0x4e2476,_0x38e8bb,{'env':_0x4e2476,'fetchedAt':_0x120fe7,'source':_0x51531e,'items':_0xd21bbd}):null;return{'items':_0xd21bbd,'source':_0x51531e,'fetchedAt':_0x120fe7,'cachePath':_0x4e62ae};}catch(_0x19d829){if(!noCache&&_0xef93bb)return{'items':_0xef93bb[_0x1965ca(0x19a)],'source':_0x1965ca(0x18e),'fetchedAt':_0xef93bb[_0x1965ca(0x190)],'cachePath':_0x70ce2b};throw _0x19d829;}}function a6_0xeb70(_0xd682a8,_0x383816){_0xd682a8=_0xd682a8-0x18d;const _0x25de05=a6_0x25de();let _0xeb705b=_0x25de05[_0xd682a8];return _0xeb705b;}function a6_0x25de(){const _0x317284=['fetchedAt','108980INvGOA','3065598yRSddN','40OhdNnH','61786HDSgaR','remote','7cVQqKn','trim','574457MrIfYW','8162ikORvP','items','457892ggMOLF','24612qYDzQo','117ntgQFq','4699048Bqtqep','toLowerCase','APP_LIST_SOURCE','cache','12deKxgB'];a6_0x25de=function(){return _0x317284;};return a6_0x25de();}
@@ -1 +1 @@
1
- (function(_0x5f3d39,_0x534555){const _0x210269=a7_0x17aa,_0x2b0fe2=_0x5f3d39();while(!![]){try{const _0xcafcaa=parseInt(_0x210269(0xd4))/0x1+parseInt(_0x210269(0xd9))/0x2+parseInt(_0x210269(0xce))/0x3+-parseInt(_0x210269(0xd1))/0x4+-parseInt(_0x210269(0xd8))/0x5*(parseInt(_0x210269(0xcd))/0x6)+-parseInt(_0x210269(0xd5))/0x7+parseInt(_0x210269(0xc8))/0x8;if(_0xcafcaa===_0x534555)break;else _0x2b0fe2['push'](_0x2b0fe2['shift']());}catch(_0x4cc2ef){_0x2b0fe2['push'](_0x2b0fe2['shift']());}}}(a7_0x39bc,0x9f8aa));function a7_0x17aa(_0x150ef1,_0x2c042f){_0x150ef1=_0x150ef1-0xc8;const _0x39bc76=a7_0x39bc();let _0x17aa80=_0x39bc76[_0x150ef1];return _0x17aa80;}function a7_0x39bc(){const _0x187952=['2065700wzjJdI','8821912hRWGxX','named','appcode','defaultApp','isCurrent','6AdxHsT','2070927uHutum','definedIn','name','3074512GzqFfA','appCode','trim','39498HrfWfj','1403346srypAV','find','currentApp','6214040SwLcTA'];a7_0x39bc=function(){return _0x187952;};return a7_0x39bc();}export function enrichAppListItemsWithMergedSelection(_0x592578,_0x22c923){const _0x32ea49=a7_0x17aa;if(!_0x22c923)return;const _0x4419c8=!!(_0x22c923[_0x32ea49(0xd7)]??_0x22c923['defaultApp']);for(const _0xf8eaf6 of _0x592578){_0xf8eaf6[_0x32ea49(0xcc)]=![];}const _0x14328e=_0x22c923[_0x32ea49(0xd2)]!=null?String(_0x22c923[_0x32ea49(0xd2)])['trim']():'';if(_0x4419c8){const _0x457b86=_0x22c923['currentApp']??_0x22c923[_0x32ea49(0xcb)];if(_0x457b86){const _0x4537c3=_0x592578[_0x32ea49(0xd6)](_0x4055f2=>_0x4055f2[_0x32ea49(0xc9)]===!![]&&_0x4055f2[_0x32ea49(0xd0)]===_0x457b86&&_0x4055f2[_0x32ea49(0xcf)]==='local'),_0x49b997=_0x4537c3??_0x592578[_0x32ea49(0xd6)](_0x18bb5a=>_0x18bb5a[_0x32ea49(0xc9)]===!![]&&_0x18bb5a[_0x32ea49(0xd0)]===_0x457b86);if(_0x49b997){const _0x20ce92=String(_0x49b997[_0x32ea49(0xca)]??'')[_0x32ea49(0xd3)]();if(!_0x14328e||_0x20ce92===_0x14328e){_0x49b997[_0x32ea49(0xcc)]=!![];return;}}}if(_0x14328e){const _0x243b7a=_0x592578[_0x32ea49(0xd6)](_0xfa42eb=>String(_0xfa42eb[_0x32ea49(0xca)]??'')[_0x32ea49(0xd3)]()===_0x14328e);_0x243b7a&&(_0x243b7a[_0x32ea49(0xcc)]=!![]);}return;}if(!_0x14328e)return;for(const _0x457f14 of _0x592578){String(_0x457f14[_0x32ea49(0xca)]??'')['trim']()===_0x14328e&&(_0x457f14[_0x32ea49(0xcc)]=!![]);}}
1
+ function a7_0x136d(_0x41f073,_0x363e0b){_0x41f073=_0x41f073-0x145;const _0x5f496a=a7_0x5f49();let _0x136dd1=_0x5f496a[_0x41f073];return _0x136dd1;}(function(_0x3811ec,_0x3f1d45){const _0x12e7aa=a7_0x136d,_0x41621c=_0x3811ec();while(!![]){try{const _0x253cf1=-parseInt(_0x12e7aa(0x146))/0x1*(-parseInt(_0x12e7aa(0x14b))/0x2)+-parseInt(_0x12e7aa(0x157))/0x3*(-parseInt(_0x12e7aa(0x159))/0x4)+parseInt(_0x12e7aa(0x147))/0x5+-parseInt(_0x12e7aa(0x14f))/0x6*(parseInt(_0x12e7aa(0x152))/0x7)+-parseInt(_0x12e7aa(0x150))/0x8*(parseInt(_0x12e7aa(0x149))/0x9)+-parseInt(_0x12e7aa(0x151))/0xa+-parseInt(_0x12e7aa(0x158))/0xb;if(_0x253cf1===_0x3f1d45)break;else _0x41621c['push'](_0x41621c['shift']());}catch(_0x5d9731){_0x41621c['push'](_0x41621c['shift']());}}}(a7_0x5f49,0x9d7d5));export function enrichAppListItemsWithMergedSelection(_0xa0e8fc,_0x1345c4){const _0x54cef6=a7_0x136d;if(!_0x1345c4)return;const _0x223d1a=!!(_0x1345c4[_0x54cef6(0x145)]??_0x1345c4[_0x54cef6(0x14d)]);for(const _0x33802b of _0xa0e8fc){_0x33802b['isCurrent']=![];}const _0x1e867a=_0x1345c4[_0x54cef6(0x154)]!=null?String(_0x1345c4['appCode'])[_0x54cef6(0x14c)]():'';if(_0x223d1a){const _0x3aa65e=_0x1345c4['currentApp']??_0x1345c4[_0x54cef6(0x14d)];if(_0x3aa65e){const _0x364042=_0xa0e8fc['find'](_0x51bfcd=>_0x51bfcd[_0x54cef6(0x148)]===!![]&&_0x51bfcd[_0x54cef6(0x156)]===_0x3aa65e&&_0x51bfcd['definedIn']===_0x54cef6(0x155)),_0x1b0b20=_0x364042??_0xa0e8fc[_0x54cef6(0x14a)](_0x10762a=>_0x10762a['named']===!![]&&_0x10762a[_0x54cef6(0x156)]===_0x3aa65e);if(_0x1b0b20){const _0x246761=String(_0x1b0b20[_0x54cef6(0x14e)]??'')['trim']();if(!_0x1e867a||_0x246761===_0x1e867a){_0x1b0b20[_0x54cef6(0x153)]=!![];return;}}}if(_0x1e867a){const _0x1154b1=_0xa0e8fc[_0x54cef6(0x14a)](_0x16ef2e=>String(_0x16ef2e[_0x54cef6(0x14e)]??'')[_0x54cef6(0x14c)]()===_0x1e867a);_0x1154b1&&(_0x1154b1[_0x54cef6(0x153)]=!![]);}return;}if(!_0x1e867a)return;for(const _0x41f2fe of _0xa0e8fc){String(_0x41f2fe[_0x54cef6(0x14e)]??'')[_0x54cef6(0x14c)]()===_0x1e867a&&(_0x41f2fe[_0x54cef6(0x153)]=!![]);}}function a7_0x5f49(){const _0x326383=['1683xiAYvP','find','54PCPLmi','trim','defaultApp','appcode','434958dvThFJ','7208WIvyeV','3035470kUDWRm','7IIdTDF','isCurrent','appCode','local','name','5595gBwnKZ','15904713qdyOuW','2744HgTavM','currentApp','33254eaAMJF','2291195VLZRIG','named'];a7_0x5f49=function(){return _0x326383;};return a7_0x5f49();}
@@ -1 +1 @@
1
- const a8_0x4ce430=a8_0x4cd5;(function(_0x451f5e,_0x46b117){const _0x3e81da=a8_0x4cd5,_0x362ce1=_0x451f5e();while(!![]){try{const _0x245eb2=parseInt(_0x3e81da(0x16b))/0x1+parseInt(_0x3e81da(0x16a))/0x2*(parseInt(_0x3e81da(0x169))/0x3)+parseInt(_0x3e81da(0x177))/0x4*(-parseInt(_0x3e81da(0x178))/0x5)+-parseInt(_0x3e81da(0x172))/0x6+parseInt(_0x3e81da(0x179))/0x7*(-parseInt(_0x3e81da(0x173))/0x8)+-parseInt(_0x3e81da(0x17b))/0x9*(parseInt(_0x3e81da(0x16c))/0xa)+parseInt(_0x3e81da(0x167))/0xb;if(_0x245eb2===_0x46b117)break;else _0x362ce1['push'](_0x362ce1['shift']());}catch(_0x3656d9){_0x362ce1['push'](_0x362ce1['shift']());}}}(a8_0x52b7,0xa6510));function a8_0x52b7(){const _0x2f43aa=['\x20app-config\x20get\x20<key>','args','read','22264HJoyfy','15yBEuXq','78582UVvgve','key','18zHscee','App\x20config\x20key','18741008DJCxnp','app-config','276513TJpAvM','10ZgpCpz','5719gqycAg','3215820TdihiD','Unable\x20to\x20get\x20app-config\x20value:\x20key=','apiError','Usage:\x20','validation','trim','4166976OwQhnK','96tfcCuZ'];a8_0x52b7=function(){return _0x2f43aa;};return a8_0x52b7();}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';function a8_0x4cd5(_0xcb1ba5,_0x124c05){_0xcb1ba5=_0xcb1ba5-0x167;const _0x52b7ad=a8_0x52b7();let _0x4cd552=_0x52b7ad[_0xcb1ba5];return _0x4cd552;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x4ce430(0x168),'command':'get','description':'Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','risk':a8_0x4ce430(0x176),'args':[{'name':a8_0x4ce430(0x17a),'description':a8_0x4ce430(0x17c),'required':!![]}],'flags':[],async 'execute'(_0x5a7d63){const _0x235452=a8_0x4ce430,_0x251830=_0x5a7d63[_0x235452(0x175)][0x0]?.[_0x235452(0x171)]();if(!_0x251830)throw CliErrors[_0x235452(0x170)]('Missing\x20app-config\x20key.',_0x235452(0x16f)+CLI_BIN_NAME+_0x235452(0x174));try{const _0x4649c0=await getRuntimeAppConfigByKey(_0x5a7d63['appCode'],_0x251830);return{'ok':!![],'data':_0x4649c0};}catch{throw CliErrors[_0x235452(0x16e)](_0x235452(0x16d)+_0x251830+',\x20appCode='+_0x5a7d63['appCode'],'Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.');}}};
1
+ const a8_0x1e5c20=a8_0x38b0;(function(_0x148b77,_0x92332){const _0x329b81=a8_0x38b0,_0x37ca17=_0x148b77();while(!![]){try{const _0x19c27c=parseInt(_0x329b81(0x1f8))/0x1*(parseInt(_0x329b81(0x1ea))/0x2)+parseInt(_0x329b81(0x1e5))/0x3*(parseInt(_0x329b81(0x1f6))/0x4)+-parseInt(_0x329b81(0x1f2))/0x5*(parseInt(_0x329b81(0x1e9))/0x6)+parseInt(_0x329b81(0x1f0))/0x7*(-parseInt(_0x329b81(0x1eb))/0x8)+-parseInt(_0x329b81(0x1f5))/0x9*(-parseInt(_0x329b81(0x1f9))/0xa)+-parseInt(_0x329b81(0x1f1))/0xb+-parseInt(_0x329b81(0x1e6))/0xc;if(_0x19c27c===_0x92332)break;else _0x37ca17['push'](_0x37ca17['shift']());}catch(_0x3d321f){_0x37ca17['push'](_0x37ca17['shift']());}}}(a8_0x1961,0xe9d9f));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';function a8_0x1961(){const _0x4fbc82=['9cJpNNp','168yUrvJc','Missing\x20app-config\x20key.','143qLYhtc','17170080FVikfM','98763neYPlw','16741620APjRJq','Unable\x20to\x20get\x20app-config\x20value:\x20key=','get','6qPCIoF','24526ELOetU','2295880eKfwVk','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','validation','14mFzgLa','14963828wLcjRU','2829955VIcvAY','args','appCode'];a8_0x1961=function(){return _0x4fbc82;};return a8_0x1961();}function a8_0x38b0(_0x4e2f43,_0x4d40d2){_0x4e2f43=_0x4e2f43-0x1e5;const _0x1961b7=a8_0x1961();let _0x38b0e7=_0x1961b7[_0x4e2f43];return _0x38b0e7;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':'app-config','command':a8_0x1e5c20(0x1e8),'description':a8_0x1e5c20(0x1ed),'risk':'read','args':[{'name':'key','description':'App\x20config\x20key','required':!![]}],'flags':[],async 'execute'(_0x51696c){const _0x2b0d14=a8_0x1e5c20,_0x43a89f=_0x51696c[_0x2b0d14(0x1f3)][0x0]?.['trim']();if(!_0x43a89f)throw CliErrors[_0x2b0d14(0x1ef)](_0x2b0d14(0x1f7),_0x2b0d14(0x1ee)+CLI_BIN_NAME+'\x20app-config\x20get\x20<key>');try{const _0xcb80a9=await getRuntimeAppConfigByKey(_0x51696c['appCode'],_0x43a89f);return{'ok':!![],'data':_0xcb80a9};}catch{throw CliErrors['apiError'](_0x2b0d14(0x1e7)+_0x43a89f+',\x20appCode='+_0x51696c[_0x2b0d14(0x1f4)],_0x2b0d14(0x1ec));}}};
@@ -1 +1 @@
1
- (function(_0x2affcf,_0x5ba441){const _0x1798d1=a9_0xd445,_0x330519=_0x2affcf();while(!![]){try{const _0x47a471=-parseInt(_0x1798d1(0x9f))/0x1+-parseInt(_0x1798d1(0xa3))/0x2*(parseInt(_0x1798d1(0xa2))/0x3)+-parseInt(_0x1798d1(0xa0))/0x4*(parseInt(_0x1798d1(0x9d))/0x5)+parseInt(_0x1798d1(0xa1))/0x6*(parseInt(_0x1798d1(0xa4))/0x7)+-parseInt(_0x1798d1(0x9e))/0x8+parseInt(_0x1798d1(0xa6))/0x9+parseInt(_0x1798d1(0xa5))/0xa;if(_0x47a471===_0x5ba441)break;else _0x330519['push'](_0x330519['shift']());}catch(_0x5e6b9a){_0x330519['push'](_0x330519['shift']());}}}(a9_0x2289,0x8c0a0));function a9_0x2289(){const _0x49e419=['3960131KefLGn','7585860kCtKDo','4625919yvYWQg','10HeELNz','2354184CKXiBO','358090eVkpmA','644636XtEwOb','6yftZVE','11919ryDhjJ','146zMVCHg'];a9_0x2289=function(){return _0x49e419;};return a9_0x2289();}function a9_0xd445(_0x2fbac2,_0x3c65b1){_0x2fbac2=_0x2fbac2-0x9d;const _0x228991=a9_0x2289();let _0xd4450d=_0x228991[_0x2fbac2];return _0xd4450d;}import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];
1
+ (function(_0x409fea,_0x15b0d0){const _0x2341cd=a9_0x2618,_0x2d9aea=_0x409fea();while(!![]){try{const _0x198379=-parseInt(_0x2341cd(0x1e4))/0x1+parseInt(_0x2341cd(0x1e0))/0x2+-parseInt(_0x2341cd(0x1dc))/0x3*(-parseInt(_0x2341cd(0x1e2))/0x4)+parseInt(_0x2341cd(0x1de))/0x5+-parseInt(_0x2341cd(0x1df))/0x6*(-parseInt(_0x2341cd(0x1dd))/0x7)+-parseInt(_0x2341cd(0x1e1))/0x8+parseInt(_0x2341cd(0x1e3))/0x9;if(_0x198379===_0x15b0d0)break;else _0x2d9aea['push'](_0x2d9aea['shift']());}catch(_0x347eed){_0x2d9aea['push'](_0x2d9aea['shift']());}}}(a9_0x2716,0x6398b));function a9_0x2716(){const _0x40f871=['290222GTRYgc','3YhCMsA','1736HTEEDI','854000thCqdq','3702wvfrYb','156582ugLgdi','4319536ImuDGu','2776308viSwBm','1277343vXpEZI'];a9_0x2716=function(){return _0x40f871;};return a9_0x2716();}import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x2618(_0x40438c,_0x566850){_0x40438c=_0x40438c-0x1dc;const _0x27169a=a9_0x2716();let _0x2618ae=_0x27169a[_0x40438c];return _0x2618ae;}export const appConfigDefinitions=[appConfigGet];
@@ -1 +1 @@
1
- function a10_0x210a(){const _0x22d728=['length','startsWith','num','83325gNcsNJ','artifact','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','/client/artifact/','@ant-design/icons','Artifact\x20ID','file','Saves\x20and\x20compiles\x20new\x20Artifact\x20source.\x20On\x20success,\x20a\x20displayable\x20embedded\x20module\x20is\x20added\x20to\x20the\x20current\x20app.','description','str','join','some','File\x20path\x20is\x20required.','build','Saves\x20and\x20recompiles\x20Artifact\x20source.\x20Embedded\x20module\x20display\x20and\x20interaction\x20in\x20the\x20app\x20may\x20change\x20immediately.','flag','object','--metadata\x20must\x20be\x20a\x20JSON\x20object.','verbose','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','exec','utf8','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','isArray','175RGVadJ','Invalid\x20JSON\x20for\x20--metadata:\x20','filter','compiledContent','artifactType','deleted','lodash','20288BlooBZ','update','number','Preview:\x20create\x20react_module\x20Artifact','parse','/update','appCode','map','test','File\x20is\x20not\x20a\x20regular\x20file:\x20','Show\x20one\x20Artifact\x20by\x20id','Artifact\x20source\x20file\x20is\x20blank.','3672vvkYPc','lastIndex','favorite','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','name','6746cMdKnh','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','write','react','body','read','updateTime','antd','bool','content','create','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','AGENT','87JiGGTc','validation','metadata','Created\x20Artifact\x20','trim','File\x20not\x20found:\x20','Artifact\x20display\x20name','split','source','data','react-dom','23930230hrYnOS','1848852qWdYDm','string','add','86646gkLtCH','4431350dlZQGb','.\x20Unsupported:\x20'];a10_0x210a=function(){return _0x22d728;};return a10_0x210a();}const a10_0x1ee4b8=a10_0x5555;(function(_0xd3826b,_0x1f1eee){const _0x51d6d5=a10_0x5555,_0x25ee18=_0xd3826b();while(!![]){try{const _0x5ddbda=parseInt(_0x51d6d5(0x23e))/0x1*(parseInt(_0x51d6d5(0x231))/0x2)+parseInt(_0x51d6d5(0x201))/0x3+-parseInt(_0x51d6d5(0x1f8))/0x4+-parseInt(_0x51d6d5(0x1fc))/0x5+parseInt(_0x51d6d5(0x1fb))/0x6*(parseInt(_0x51d6d5(0x219))/0x7)+parseInt(_0x51d6d5(0x220))/0x8*(-parseInt(_0x51d6d5(0x22c))/0x9)+parseInt(_0x51d6d5(0x1f7))/0xa;if(_0x5ddbda===_0x1f1eee)break;else _0x25ee18['push'](_0x25ee18['shift']());}catch(_0x4a0ed2){_0x25ee18['push'](_0x25ee18['shift']());}}}(a10_0x210a,0xa8f87));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='react_module',ARTIFACT_SOURCE_AGENT=a10_0x1ee4b8(0x23d),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x1ee4b8(0x234),a10_0x1ee4b8(0x1f6),a10_0x1ee4b8(0x21f),'dayjs',a10_0x1ee4b8(0x238),a10_0x1ee4b8(0x205)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x1ee4b8(0x20b)](',\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_0x1ee4b8(0x207),'type':a10_0x1ee4b8(0x1f9),'required':!![],'description':a10_0x1ee4b8(0x22f)},ARTIFACT_NAME_FLAG={'name':'name','type':a10_0x1ee4b8(0x1f9),'description':a10_0x1ee4b8(0x1f2)},METADATA_FLAG={'name':'metadata','type':a10_0x1ee4b8(0x1f9),'description':a10_0x1ee4b8(0x232)};function isPlainObject(_0x3ceb0e){const _0x108e6e=a10_0x1ee4b8;return typeof _0x3ceb0e===_0x108e6e(0x211)&&_0x3ceb0e!==null&&!Array[_0x108e6e(0x218)](_0x3ceb0e);}function readSourceFile(_0x5c112b){const _0x37c752=a10_0x1ee4b8;if(!_0x5c112b)throw CliErrors[_0x37c752(0x23f)](_0x37c752(0x20d));if(!existsSync(_0x5c112b))throw CliErrors[_0x37c752(0x23f)](_0x37c752(0x243)+_0x5c112b);if(!statSync(_0x5c112b)['isFile']())throw CliErrors[_0x37c752(0x23f)](_0x37c752(0x229)+_0x5c112b);const _0xb9a7ed=readFileSync(_0x5c112b,_0x37c752(0x216));return validateReactModuleSource(_0xb9a7ed),_0xb9a7ed;}function parseMetadata(_0x2de704){const _0x564dc3=a10_0x1ee4b8;if(!_0x2de704)return undefined;let _0xf40d;try{_0xf40d=JSON[_0x564dc3(0x224)](_0x2de704);}catch{throw CliErrors[_0x564dc3(0x23f)](_0x564dc3(0x21a)+_0x2de704);}if(!isPlainObject(_0xf40d))throw CliErrors[_0x564dc3(0x23f)](_0x564dc3(0x212));const _0x46785d={..._0xf40d};return delete _0x46785d[_0x564dc3(0x21c)],_0x46785d;}function getPackageName(_0x10d9c4){const _0x3be6ac=a10_0x1ee4b8;if(_0x10d9c4[_0x3be6ac(0x1ff)]('@')){const [_0x4b1f42,_0x439eb5]=_0x10d9c4['split']('/');return _0x4b1f42&&_0x439eb5?_0x4b1f42+'/'+_0x439eb5:_0x10d9c4;}return _0x10d9c4[_0x3be6ac(0x1f3)]('/')[0x0]||_0x10d9c4;}function validateAllowedImports(_0x4e5847){const _0x313381=a10_0x1ee4b8,_0x21c0ac=new Set();for(const _0x3b4903 of IMPORT_SOURCE_PATTERNS){_0x3b4903[_0x313381(0x22d)]=0x0;let _0x4c1f49;while((_0x4c1f49=_0x3b4903[_0x313381(0x215)](_0x4e5847))!==null){const _0x282d83=_0x4c1f49[0x1]?.[_0x313381(0x242)]();_0x282d83&&_0x21c0ac[_0x313381(0x1fa)](_0x282d83);}}const _0x1865f4=[..._0x21c0ac][_0x313381(0x227)](getPackageName)[_0x313381(0x21b)](_0x102d15=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x102d15));if(_0x1865f4['length']>0x0)throw CliErrors['validation']('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x313381(0x1fd)+[...new Set(_0x1865f4)][_0x313381(0x20b)](',\x20'));}export function validateReactModuleSource(_0x4f027d){const _0xc217ba=a10_0x1ee4b8;if(!_0x4f027d[_0xc217ba(0x242)]())throw CliErrors[_0xc217ba(0x23f)](_0xc217ba(0x22b));if(PAGE_LEVEL_PATTERNS[_0xc217ba(0x20c)](_0x2f2fcd=>_0x2f2fcd[_0xc217ba(0x228)](_0x4f027d)))throw CliErrors[_0xc217ba(0x23f)](_0xc217ba(0x217));validateAllowedImports(_0x4f027d);}function buildArtifactInput(_0x12e87c){const _0x169004=a10_0x1ee4b8,_0x4bec38=readSourceFile(_0x12e87c[_0x169004(0x20a)](_0x169004(0x207))),_0x299852=_0x12e87c[_0x169004(0x20a)]('name')[_0x169004(0x242)](),_0x19fe34=parseMetadata(_0x12e87c[_0x169004(0x20a)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x299852?{'name':_0x299852}:{},'content':_0x4bec38,..._0x19fe34?{'metadata':_0x19fe34}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x1a9a00){const _0xfdc870=a10_0x1ee4b8;return{'id':_0x1a9a00['id'],'name':_0x1a9a00[_0xfdc870(0x230)],'artifactType':_0x1a9a00[_0xfdc870(0x21d)],'source':_0x1a9a00[_0xfdc870(0x1f4)],'favorite':_0x1a9a00[_0xfdc870(0x22e)],'deleted':_0x1a9a00[_0xfdc870(0x21e)],'createTime':_0x1a9a00['createTime'],'updateTime':_0x1a9a00[_0xfdc870(0x237)]};}function a10_0x5555(_0x4a5791,_0x340098){_0x4a5791=_0x4a5791-0x1f2;const _0x210a3a=a10_0x210a();let _0x555523=_0x210a3a[_0x4a5791];return _0x555523;}function detailArtifact(_0x5cd68e){const _0x2ed7e9=a10_0x1ee4b8;return{'id':_0x5cd68e['id'],'appCode':_0x5cd68e['appCode'],'name':_0x5cd68e[_0x2ed7e9(0x230)],'artifactType':_0x5cd68e[_0x2ed7e9(0x21d)],'source':_0x5cd68e[_0x2ed7e9(0x1f4)],'favorite':_0x5cd68e[_0x2ed7e9(0x22e)],'deleted':_0x5cd68e['deleted'],'content':_0x5cd68e[_0x2ed7e9(0x23a)]??'','compiledContent':_0x5cd68e[_0x2ed7e9(0x21c)],'metadata':_0x5cd68e[_0x2ed7e9(0x240)]??{},'createTime':_0x5cd68e['createTime'],'updateTime':_0x5cd68e[_0x2ed7e9(0x237)]};}function readFavoriteFlag(_0x8130ce){const _0x387f15=a10_0x1ee4b8,_0x51ac29=_0x8130ce[_0x387f15(0x210)](_0x387f15(0x22e));return _0x51ac29===undefined||_0x51ac29===null||_0x51ac29===''?undefined:_0x8130ce[_0x387f15(0x239)](_0x387f15(0x22e));}const artifactList={'service':a10_0x1ee4b8(0x202),'command':'list','description':'List\x20current-app\x20react_module\x20Artifacts','risk':a10_0x1ee4b8(0x236),'flags':[{'name':a10_0x1ee4b8(0x1f4),'type':a10_0x1ee4b8(0x1f9),'description':a10_0x1ee4b8(0x214)},{'name':a10_0x1ee4b8(0x22e),'type':'boolean','description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x282320){const _0x66a387=a10_0x1ee4b8,_0x355c96=await listRuntimeArtifacts(_0x282320[_0x66a387(0x226)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x282320[_0x66a387(0x20a)]('source')?{'source':_0x282320['str'](_0x66a387(0x1f4))}:{},...readFavoriteFlag(_0x282320)!==undefined?{'favorite':readFavoriteFlag(_0x282320)}:{}});return{'ok':!![],'data':{'total':_0x355c96[_0x66a387(0x1fe)],'items':_0x282320[_0x66a387(0x239)](_0x66a387(0x213))?_0x355c96:_0x355c96['map'](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':'detail','description':a10_0x1ee4b8(0x22a),'risk':'read','flags':[{...ID_FLAG,'description':'Artifact\x20ID'}],async 'execute'(_0x5920bd){const _0x1ff073=a10_0x1ee4b8,_0x1edd3b=await getRuntimeArtifact(_0x5920bd[_0x1ff073(0x200)]('id'),_0x5920bd[_0x1ff073(0x226)]);return{'ok':!![],'data':detailArtifact(_0x1edd3b)};}},artifactCreate={'service':a10_0x1ee4b8(0x202),'command':a10_0x1ee4b8(0x23b),'description':a10_0x1ee4b8(0x23c),'risk':a10_0x1ee4b8(0x233),'confirmationDescription':a10_0x1ee4b8(0x208),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x32cc00){const _0x1f2dfa=a10_0x1ee4b8,_0x2c898a=buildArtifactInput(_0x32cc00),_0x44c74a=await createRuntimeArtifact(_0x32cc00[_0x1f2dfa(0x226)],_0x2c898a);return{'ok':!![],'data':detailArtifact(_0x44c74a),'message':_0x1f2dfa(0x241)+_0x44c74a['id']+(_0x44c74a[_0x1f2dfa(0x230)]?'\x20('+_0x44c74a[_0x1f2dfa(0x230)]+')':'')};},async 'dryRun'(_0x34a28f){const _0xba164c=a10_0x1ee4b8,_0x53ebb4=buildArtifactInput(_0x34a28f);return dryRun('POST','/client/artifact/create')[_0xba164c(0x235)]({'appCode':_0x34a28f['appCode'],..._0x53ebb4})['description'](_0xba164c(0x223))[_0xba164c(0x20e)]();},'writeEventSubject'(_0x575474){const _0x29021a=a10_0x1ee4b8,_0xbb0591=_0x575474['data']?.['id'];if(typeof _0xbb0591!==_0x29021a(0x1f9)&&typeof _0xbb0591!==_0x29021a(0x222))return undefined;return{'kind':_0x29021a(0x202),'id':String(_0xbb0591),'action':'create'};}},artifactUpdate={'service':a10_0x1ee4b8(0x202),'command':'update','description':a10_0x1ee4b8(0x203),'risk':a10_0x1ee4b8(0x233),'confirmationDescription':a10_0x1ee4b8(0x20f),'flags':[{...ID_FLAG,'description':a10_0x1ee4b8(0x206)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3759f4){const _0x4362c5=a10_0x1ee4b8,_0x3de4ee=_0x3759f4[_0x4362c5(0x200)]('id'),_0x7ae0df=buildArtifactInput(_0x3759f4),_0x49afa5=await updateRuntimeArtifact(_0x3de4ee,_0x3759f4[_0x4362c5(0x226)],_0x7ae0df);return{'ok':!![],'data':detailArtifact(_0x49afa5),'message':'Updated\x20Artifact\x20'+_0x49afa5['id']+(_0x49afa5[_0x4362c5(0x230)]?'\x20('+_0x49afa5[_0x4362c5(0x230)]+')':'')};},async 'dryRun'(_0x5340f0){const _0x14a628=a10_0x1ee4b8,_0x46a738=_0x5340f0[_0x14a628(0x200)]('id'),_0x5c6ad3=buildArtifactInput(_0x5340f0);return dryRun('POST',_0x14a628(0x204)+_0x46a738+_0x14a628(0x225))[_0x14a628(0x235)]({'appCode':_0x5340f0[_0x14a628(0x226)],..._0x5c6ad3})[_0x14a628(0x209)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x46a738)['build']();},'writeEventSubject'(_0x4a94a1){const _0x3bb439=a10_0x1ee4b8,_0x3f8e01=_0x4a94a1[_0x3bb439(0x1f5)]?.['id'];if(typeof _0x3f8e01!==_0x3bb439(0x1f9)&&typeof _0x3f8e01!=='number')return undefined;return{'kind':'artifact','id':String(_0x3f8e01),'action':_0x3bb439(0x221)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x31e164=a10_0x11d3;(function(_0x5d1dc5,_0xa63366){const _0x5b137b=a10_0x11d3,_0x59b2ff=_0x5d1dc5();while(!![]){try{const _0x58718f=-parseInt(_0x5b137b(0x125))/0x1+parseInt(_0x5b137b(0x15f))/0x2+-parseInt(_0x5b137b(0x128))/0x3+-parseInt(_0x5b137b(0x150))/0x4+-parseInt(_0x5b137b(0x15a))/0x5+-parseInt(_0x5b137b(0x13a))/0x6+parseInt(_0x5b137b(0x159))/0x7;if(_0x58718f===_0xa63366)break;else _0x59b2ff['push'](_0x59b2ff['shift']());}catch(_0x17078b){_0x59b2ff['push'](_0x59b2ff['shift']());}}}(a10_0x59f1,0x38161));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_0x31e164(0x12d),ARTIFACT_SOURCE_AGENT=a10_0x31e164(0x147),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x31e164(0x12b),a10_0x31e164(0x121),a10_0x31e164(0x164),'dayjs','antd',a10_0x31e164(0x11f)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a10_0x31e164(0x130),'type':a10_0x31e164(0x142),'required':!![],'description':a10_0x31e164(0x153)},ARTIFACT_NAME_FLAG={'name':a10_0x31e164(0x146),'type':a10_0x31e164(0x142),'description':a10_0x31e164(0x156)},METADATA_FLAG={'name':a10_0x31e164(0x157),'type':a10_0x31e164(0x142),'description':a10_0x31e164(0x133)};function isPlainObject(_0x646f05){const _0x394b2f=a10_0x31e164;return typeof _0x646f05===_0x394b2f(0x12e)&&_0x646f05!==null&&!Array[_0x394b2f(0x13c)](_0x646f05);}function readSourceFile(_0x1e8ef6){const _0x2bc0a4=a10_0x31e164;if(!_0x1e8ef6)throw CliErrors[_0x2bc0a4(0x13e)](_0x2bc0a4(0x15b));if(!existsSync(_0x1e8ef6))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x1e8ef6);if(!statSync(_0x1e8ef6)['isFile']())throw CliErrors['validation'](_0x2bc0a4(0x167)+_0x1e8ef6);const _0x4e54c3=readFileSync(_0x1e8ef6,_0x2bc0a4(0x122));return validateReactModuleSource(_0x4e54c3),_0x4e54c3;}function parseMetadata(_0x354aa8){const _0x2969ec=a10_0x31e164;if(!_0x354aa8)return undefined;let _0x2ebc99;try{_0x2ebc99=JSON[_0x2969ec(0x161)](_0x354aa8);}catch{throw CliErrors[_0x2969ec(0x13e)](_0x2969ec(0x13b)+_0x354aa8);}if(!isPlainObject(_0x2ebc99))throw CliErrors[_0x2969ec(0x13e)](_0x2969ec(0x15e));const _0x290325={..._0x2ebc99};return delete _0x290325[_0x2969ec(0x129)],_0x290325;}function getPackageName(_0x4c3a0d){const _0x5dabf6=a10_0x31e164;if(_0x4c3a0d[_0x5dabf6(0x148)]('@')){const [_0x3bd9c4,_0x2146a6]=_0x4c3a0d['split']('/');return _0x3bd9c4&&_0x2146a6?_0x3bd9c4+'/'+_0x2146a6:_0x4c3a0d;}return _0x4c3a0d[_0x5dabf6(0x11c)]('/')[0x0]||_0x4c3a0d;}function validateAllowedImports(_0x3b52ef){const _0x43de8a=a10_0x31e164,_0x2938eb=new Set();for(const _0x469b2a of IMPORT_SOURCE_PATTERNS){_0x469b2a[_0x43de8a(0x13d)]=0x0;let _0x40e58c;while((_0x40e58c=_0x469b2a[_0x43de8a(0x132)](_0x3b52ef))!==null){const _0x1cd203=_0x40e58c[0x1]?.[_0x43de8a(0x14d)]();_0x1cd203&&_0x2938eb[_0x43de8a(0x160)](_0x1cd203);}}const _0x1e66d7=[..._0x2938eb][_0x43de8a(0x15d)](getPackageName)[_0x43de8a(0x123)](_0x1c1bfe=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x1c1bfe));if(_0x1e66d7[_0x43de8a(0x140)]>0x0)throw CliErrors['validation'](_0x43de8a(0x126)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x43de8a(0x152)+[...new Set(_0x1e66d7)][_0x43de8a(0x120)](',\x20'));}function a10_0x11d3(_0x4a6457,_0x1def0b){_0x4a6457=_0x4a6457-0x118;const _0x59f11d=a10_0x59f1();let _0x11d351=_0x59f11d[_0x4a6457];return _0x11d351;}export function validateReactModuleSource(_0x1a5bf6){const _0x4e0ce1=a10_0x31e164;if(!_0x1a5bf6['trim']())throw CliErrors[_0x4e0ce1(0x13e)](_0x4e0ce1(0x11e));if(PAGE_LEVEL_PATTERNS[_0x4e0ce1(0x136)](_0x1c5b50=>_0x1c5b50['test'](_0x1a5bf6)))throw CliErrors['validation']('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x1a5bf6);}function buildArtifactInput(_0x5c310a){const _0x3802b8=a10_0x31e164,_0x7b097e=readSourceFile(_0x5c310a[_0x3802b8(0x145)](_0x3802b8(0x130))),_0x4d2a1c=_0x5c310a[_0x3802b8(0x145)]('name')['trim'](),_0x41564d=parseMetadata(_0x5c310a['str']('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4d2a1c?{'name':_0x4d2a1c}:{},'content':_0x7b097e,..._0x41564d?{'metadata':_0x41564d}:{},'source':ARTIFACT_SOURCE_AGENT};}function a10_0x59f1(){const _0x3faad2=['updateTime','source','Artifact\x20display\x20name','metadata','build','11175808VgaEkY','399675MNIMeL','File\x20path\x20is\x20required.','artifact','map','--metadata\x20must\x20be\x20a\x20JSON\x20object.','137128clUOlU','add','parse','update','POST','lodash','read','Artifact\x20ID','File\x20is\x20not\x20a\x20regular\x20file:\x20','write','Updated\x20Artifact\x20','Saves\x20and\x20recompiles\x20Artifact\x20source.\x20Embedded\x20module\x20display\x20and\x20interaction\x20in\x20the\x20app\x20may\x20change\x20immediately.','List\x20current-app\x20react_module\x20Artifacts','split','data','Artifact\x20source\x20file\x20is\x20blank.','@ant-design/icons','join','react-dom','utf8','filter','number','372662wAJrDs','react_module\x20imports\x20are\x20limited\x20to:\x20','createTime','417558TYXwHe','compiledContent','body','react','create','react_module','object','content','file','Saves\x20and\x20compiles\x20new\x20Artifact\x20source.\x20On\x20success,\x20a\x20displayable\x20embedded\x20module\x20is\x20added\x20to\x20the\x20current\x20app.','exec','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','Show\x20one\x20Artifact\x20by\x20id','list','some','favorite','verbose','appCode','2526318BJyVQP','Invalid\x20JSON\x20for\x20--metadata:\x20','isArray','lastIndex','validation','num','length','detail','string','boolean','description','str','name','AGENT','startsWith','artifactType','deleted','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Created\x20Artifact\x20','trim','/update','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','1690172LQTeQB','Preview:\x20update\x20react_module\x20Artifact\x20','.\x20Unsupported:\x20','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file'];a10_0x59f1=function(){return _0x3faad2;};return a10_0x59f1();}function summarizeArtifact(_0x5a6603){const _0x536404=a10_0x31e164;return{'id':_0x5a6603['id'],'name':_0x5a6603[_0x536404(0x146)],'artifactType':_0x5a6603[_0x536404(0x149)],'source':_0x5a6603[_0x536404(0x155)],'favorite':_0x5a6603['favorite'],'deleted':_0x5a6603[_0x536404(0x14a)],'createTime':_0x5a6603[_0x536404(0x127)],'updateTime':_0x5a6603[_0x536404(0x154)]};}function detailArtifact(_0x3fd020){const _0x3ab5c0=a10_0x31e164;return{'id':_0x3fd020['id'],'appCode':_0x3fd020[_0x3ab5c0(0x139)],'name':_0x3fd020[_0x3ab5c0(0x146)],'artifactType':_0x3fd020['artifactType'],'source':_0x3fd020[_0x3ab5c0(0x155)],'favorite':_0x3fd020[_0x3ab5c0(0x137)],'deleted':_0x3fd020[_0x3ab5c0(0x14a)],'content':_0x3fd020[_0x3ab5c0(0x12f)]??'','compiledContent':_0x3fd020['compiledContent'],'metadata':_0x3fd020[_0x3ab5c0(0x157)]??{},'createTime':_0x3fd020[_0x3ab5c0(0x127)],'updateTime':_0x3fd020[_0x3ab5c0(0x154)]};}function readFavoriteFlag(_0x59c361){const _0x5ea296=a10_0x31e164,_0xc9cda0=_0x59c361['flag']('favorite');return _0xc9cda0===undefined||_0xc9cda0===null||_0xc9cda0===''?undefined:_0x59c361['bool'](_0x5ea296(0x137));}const artifactList={'service':'artifact','command':a10_0x31e164(0x135),'description':a10_0x31e164(0x11b),'risk':a10_0x31e164(0x165),'flags':[{'name':'source','type':'string','description':a10_0x31e164(0x14f)},{'name':a10_0x31e164(0x137),'type':a10_0x31e164(0x143),'description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x30921a){const _0x3493d6=a10_0x31e164,_0x2b6249=await listRuntimeArtifacts(_0x30921a[_0x3493d6(0x139)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x30921a[_0x3493d6(0x145)]('source')?{'source':_0x30921a[_0x3493d6(0x145)]('source')}:{},...readFavoriteFlag(_0x30921a)!==undefined?{'favorite':readFavoriteFlag(_0x30921a)}:{}});return{'ok':!![],'data':{'total':_0x2b6249['length'],'items':_0x30921a['bool'](_0x3493d6(0x138))?_0x2b6249:_0x2b6249[_0x3493d6(0x15d)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x31e164(0x15c),'command':a10_0x31e164(0x141),'description':a10_0x31e164(0x134),'risk':a10_0x31e164(0x165),'flags':[{...ID_FLAG,'description':a10_0x31e164(0x166)}],async 'execute'(_0xa8ad56){const _0x43f086=a10_0x31e164,_0x1afc33=await getRuntimeArtifact(_0xa8ad56[_0x43f086(0x13f)]('id'),_0xa8ad56[_0x43f086(0x139)]);return{'ok':!![],'data':detailArtifact(_0x1afc33)};}},artifactCreate={'service':a10_0x31e164(0x15c),'command':a10_0x31e164(0x12c),'description':a10_0x31e164(0x14b),'risk':a10_0x31e164(0x118),'confirmationDescription':a10_0x31e164(0x131),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1e5e29){const _0x3b4fa6=a10_0x31e164,_0x4d3ed2=buildArtifactInput(_0x1e5e29),_0x3279a2=await createRuntimeArtifact(_0x1e5e29[_0x3b4fa6(0x139)],_0x4d3ed2);return{'ok':!![],'data':detailArtifact(_0x3279a2),'message':_0x3b4fa6(0x14c)+_0x3279a2['id']+(_0x3279a2[_0x3b4fa6(0x146)]?'\x20('+_0x3279a2['name']+')':'')};},async 'dryRun'(_0x4754e4){const _0x109f8a=a10_0x31e164,_0x162d39=buildArtifactInput(_0x4754e4);return dryRun(_0x109f8a(0x163),'/client/artifact/create')[_0x109f8a(0x12a)]({'appCode':_0x4754e4[_0x109f8a(0x139)],..._0x162d39})[_0x109f8a(0x144)]('Preview:\x20create\x20react_module\x20Artifact')['build']();},'writeEventSubject'(_0x356046){const _0xe984da=a10_0x31e164,_0x4e82f8=_0x356046['data']?.['id'];if(typeof _0x4e82f8!=='string'&&typeof _0x4e82f8!==_0xe984da(0x124))return undefined;return{'kind':_0xe984da(0x15c),'id':String(_0x4e82f8),'action':_0xe984da(0x12c)};}},artifactUpdate={'service':a10_0x31e164(0x15c),'command':'update','description':'Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':a10_0x31e164(0x118),'confirmationDescription':a10_0x31e164(0x11a),'flags':[{...ID_FLAG,'description':a10_0x31e164(0x166)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5ac6ba){const _0x5248ef=a10_0x31e164,_0x4320f2=_0x5ac6ba[_0x5248ef(0x13f)]('id'),_0x512a72=buildArtifactInput(_0x5ac6ba),_0x2e9d69=await updateRuntimeArtifact(_0x4320f2,_0x5ac6ba[_0x5248ef(0x139)],_0x512a72);return{'ok':!![],'data':detailArtifact(_0x2e9d69),'message':_0x5248ef(0x119)+_0x2e9d69['id']+(_0x2e9d69['name']?'\x20('+_0x2e9d69[_0x5248ef(0x146)]+')':'')};},async 'dryRun'(_0x4e775f){const _0x2bca91=a10_0x31e164,_0x5b7e3e=_0x4e775f[_0x2bca91(0x13f)]('id'),_0x250d42=buildArtifactInput(_0x4e775f);return dryRun(_0x2bca91(0x163),'/client/artifact/'+_0x5b7e3e+_0x2bca91(0x14e))[_0x2bca91(0x12a)]({'appCode':_0x4e775f['appCode'],..._0x250d42})['description'](_0x2bca91(0x151)+_0x5b7e3e)[_0x2bca91(0x158)]();},'writeEventSubject'(_0x1df055){const _0x1d264d=a10_0x31e164,_0x129a89=_0x1df055[_0x1d264d(0x11d)]?.['id'];if(typeof _0x129a89!==_0x1d264d(0x142)&&typeof _0x129a89!==_0x1d264d(0x124))return undefined;return{'kind':_0x1d264d(0x15c),'id':String(_0x129a89),'action':_0x1d264d(0x162)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
@@ -1 +1 @@
1
- const a11_0x5578f8=a11_0x1ab2;(function(_0x4b8099,_0x3cd169){const _0x9c3fe8=a11_0x1ab2,_0x9e9d62=_0x4b8099();while(!![]){try{const _0x32c1de=-parseInt(_0x9c3fe8(0xca))/0x1*(-parseInt(_0x9c3fe8(0xc8))/0x2)+-parseInt(_0x9c3fe8(0xaa))/0x3+parseInt(_0x9c3fe8(0xa9))/0x4*(parseInt(_0x9c3fe8(0xf5))/0x5)+-parseInt(_0x9c3fe8(0xe5))/0x6+-parseInt(_0x9c3fe8(0xd2))/0x7*(parseInt(_0x9c3fe8(0xdc))/0x8)+-parseInt(_0x9c3fe8(0xa3))/0x9+parseInt(_0x9c3fe8(0xbd))/0xa;if(_0x32c1de===_0x3cd169)break;else _0x9e9d62['push'](_0x9e9d62['shift']());}catch(_0x5cdff7){_0x9e9d62['push'](_0x9e9d62['shift']());}}}(a11_0x1edc,0xe69aa));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';function a11_0x1ab2(_0x17bc34,_0x1c0e0d){_0x17bc34=_0x17bc34-0xa2;const _0x1edc7b=a11_0x1edc();let _0x1ab2ad=_0x1edc7b[_0x17bc34];return _0x1ab2ad;}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(_0x5de658){const _0x391d18=a11_0x1ab2;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x5de658[_0x391d18(0xd4)]('global'),'explicitProject':_0x5de658[_0x391d18(0xd4)](_0x391d18(0xe3)),'policy':_0x391d18(0xeb)}));}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 _0x33b09c=a11_0x1ab2;return crypto[_0x33b09c(0xf0)]();}export function buildDeviceAuthUrl(_0x5aaec3,_0x2d567e,_0x31d3cc=a11_0x5578f8(0xb3)){const _0x3b838a=a11_0x5578f8;return _0x5aaec3+_0x3b838a(0xde)+encodeURIComponent(_0x2d567e)+_0x3b838a(0xe4)+encodeURIComponent(_0x31d3cc);}export function getDeviceCodePath(){const _0xe3bb6d=a11_0x5578f8;return homedir()+'/'+PRODUCT_CONFIG[_0xe3bb6d(0xdd)]+_0xe3bb6d(0xd0);}function a11_0x1edc(){const _0x618c31=['/.device-auth','scope','805ZKloZj','url-only','bool','POST','str','validation','Invalid\x20access_key\x20returned\x20by\x20server.','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','string','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','103592Mzaoje','homeDirName','/device-auth?code=','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','signal','write','access_key','project','&source=','9755808txPvny','SIGINT','name','toISOString','Invalid\x20device\x20auth\x20response','stderr','global-default','Device\x20auth\x20API\x20returned\x20HTTP\x20','networkError','\x20remaining','\x20auth\x20device','randomUUID','now','utf8','\x20auth\x20status','parse','5oTWuUH','data','6739335Vpulrz','createdAt','floor','test','status','Write\x20to\x20project\x20config','4419592CKeGyV','2348451tpOcYq','expired','abort','Device\x20authorization\x20cancelled.','application/json','global','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','nonInteractive','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','lovrabet-cli','auth','source','boolean','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','getTime','padStart','Device\x20auth\x20API\x20error\x20(','code','Verify:\x20','30212820NQzjiG','once','json','device','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','Write\x20to\x20global\x20config\x20(default)','apiError','stringify','),\x20retrying...','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','removeListener','38apHTfY','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','77111ychEqQ','\x0dWaiting\x20for\x20authorization...\x20','accessKey','Device\x20authorization\x20successful.','log','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.'];a11_0x1edc=function(){return _0x618c31;};return a11_0x1edc();}export function readStoredDeviceCode(){const _0x37c178=a11_0x5578f8,_0xde4d5d=getDeviceCodePath();if(!existsSync(_0xde4d5d))return null;try{const _0x53b131=readFileSync(_0xde4d5d,{'encoding':'utf8'}),_0x58d900=JSON[_0x37c178(0xf4)](_0x53b131);if(_0x58d900&&typeof _0x58d900[_0x37c178(0xbb)]===_0x37c178(0xda)&&typeof _0x58d900['createdAt']===_0x37c178(0xda)&&(_0x58d900[_0x37c178(0xd1)]===_0x37c178(0xaf)||_0x58d900[_0x37c178(0xd1)]===_0x37c178(0xe3)))return _0x58d900;}catch{}return null;}export function writeStoredDeviceCode(_0x480950,_0x615614){const _0x4a7604=a11_0x5578f8,_0x4f8478=getDeviceCodePath(),_0x1c77cd=dirname(_0x4f8478);!existsSync(_0x1c77cd)&&mkdirSync(_0x1c77cd,{'recursive':!![]});const _0x45d812={'code':_0x480950,'createdAt':new Date()[_0x4a7604(0xe8)](),'scope':_0x615614};writeFileSync(_0x4f8478,JSON[_0x4a7604(0xc4)](_0x45d812),{'encoding':_0x4a7604(0xf2),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x4c2802=getDeviceCodePath();try{unlinkSync(_0x4c2802);}catch{}}export function isStoredDeviceCodeExpired(_0x4cced2){const _0x58a33e=a11_0x5578f8;return Date[_0x58a33e(0xf1)]()-new Date(_0x4cced2[_0x58a33e(0xa4)])[_0x58a33e(0xb8)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0xae02eb,_0x8ff15c){const _0x7c3388=a11_0x5578f8,_0x179c44=_0xae02eb+'/api/device-auth/token',_0x1ad4e9=new AbortController(),_0x2b413c=setTimeout(()=>_0x1ad4e9['abort'](),0x2710),_0x233de0=await fetch(_0x179c44,{'method':_0x7c3388(0xd5),'headers':{'Content-Type':_0x7c3388(0xae)},'body':JSON[_0x7c3388(0xc4)]({'code':_0x8ff15c}),'signal':_0x1ad4e9['signal']});clearTimeout(_0x2b413c);if(!_0x233de0['ok'])throw CliErrors[_0x7c3388(0xed)](_0x7c3388(0xec)+_0x233de0[_0x7c3388(0xa7)]);const _0x34a281=await _0x233de0[_0x7c3388(0xbf)](),_0x13d1aa=_0x34a281[_0x7c3388(0xa2)]&&typeof _0x34a281['data']==='object'?_0x34a281['data']:_0x34a281;if(!_0x13d1aa||typeof _0x13d1aa['status']!==_0x7c3388(0xda))throw CliErrors[_0x7c3388(0xc3)](_0x7c3388(0xe9));return{'status':_0x13d1aa[_0x7c3388(0xa7)],'access_key':typeof _0x13d1aa[_0x7c3388(0xe2)]===_0x7c3388(0xda)?_0x13d1aa[_0x7c3388(0xe2)]:undefined};}export async function pollDeviceToken(_0x4547c8,_0xff223c,_0x1d0312){const _0xba304=a11_0x5578f8;let _0xc1b413=0x0;for(let _0x478a51=0x0;_0x478a51<MAX_POLLS;_0x478a51++){if(_0x1d0312['aborted'])throw CliErrors['cancelled'](_0xba304(0xad));let _0x257538;try{_0x257538=await fetchDeviceToken(_0x4547c8,_0xff223c);}catch(_0x54f06d){if(_0x54f06d instanceof Error&&_0x54f06d[_0xba304(0xe7)]==='AbortError')throw CliErrors['cancelled']('Device\x20authorization\x20cancelled.');_0xc1b413++;if(_0xc1b413>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors['networkError'](_0xba304(0xb2));writeCliSideChannelLine(_0xba304(0xba)+_0xc1b413+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0xba304(0xc5)),await sleep(POLL_INTERVAL_MS);continue;}_0xc1b413=0x0;if(_0x257538['status']==='success'){if(!_0x257538['access_key'])throw CliErrors['apiError'](_0xba304(0xd8));return _0x257538['access_key'];}if(_0x257538[_0xba304(0xa7)]===_0xba304(0xab)){deleteStoredDeviceCode();throw CliErrors[_0xba304(0xd7)](_0xba304(0xcf));}const _0x3d76ca=(_0x478a51+0x1)*POLL_INTERVAL_MS,_0x3a6365=DEVICE_CODE_TTL_MS-_0x3d76ca,_0x6f5d93=Math[_0xba304(0xa5)](_0x3a6365/0xea60),_0x218aed=Math[_0xba304(0xa5)](_0x3a6365%0xea60/0x3e8);process['stderr'][_0xba304(0xe1)](_0xba304(0xcb)+_0x6f5d93+':'+String(_0x218aed)[_0xba304(0xb9)](0x2,'0')+_0xba304(0xee)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0xba304(0xd7)](_0xba304(0xdb));}function sleep(_0x4b63b6){return new Promise(_0x49557e=>setTimeout(_0x49557e,_0x4b63b6));}export const authDeviceDefinition={'service':a11_0x5578f8(0xb4),'command':a11_0x5578f8(0xc0),'description':a11_0x5578f8(0xc9),'risk':'write','confirmationDescription':a11_0x5578f8(0xb7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':'boolean','description':a11_0x5578f8(0xc2),'default':!![]},{'name':'project','type':a11_0x5578f8(0xb6),'description':a11_0x5578f8(0xa8),'default':![]},{'name':a11_0x5578f8(0xb5),'type':a11_0x5578f8(0xda),'description':'App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','default':a11_0x5578f8(0xb3)},{'name':a11_0x5578f8(0xd3),'type':a11_0x5578f8(0xb6),'description':a11_0x5578f8(0xb0),'default':![]}],async 'execute'(_0x420bef){const _0x18d4b6=a11_0x5578f8,_0x3ad5db=resolveAuthScopeFlags(_0x420bef),_0x116058=_0x3ad5db[_0x18d4b6(0xaf)]?_0x18d4b6(0xaf):_0x18d4b6(0xe3),_0x500036=readScopedConfig(_0x3ad5db);if(_0x500036[_0x18d4b6(0xcc)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x3cf16d=(_0x420bef[_0x18d4b6(0xd6)](_0x18d4b6(0xb5))||'lovrabet-cli')['trim'](),_0x5f08e3=getUserDomain(),_0x3dc4c8=readStoredDeviceCode(),_0x2b9b53=_0x3dc4c8&&!isStoredDeviceCodeExpired(_0x3dc4c8)?_0x3dc4c8[_0x18d4b6(0xbb)]:((()=>{const _0x46c349=generateDeviceCode();return writeStoredDeviceCode(_0x46c349,_0x116058),_0x46c349;})()),_0x3276ee=buildDeviceAuthUrl(_0x5f08e3,_0x2b9b53,_0x3cf16d);if(_0x420bef['bool'](_0x18d4b6(0xd3)))return console[_0x18d4b6(0xce)](_0x3276ee),{'ok':!![]};writeCliSideChannelLine(_0x18d4b6(0xc1)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x3276ee),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x18d4b6(0xdf));if(_0x420bef[_0x18d4b6(0xb1)])return writeCliSideChannelLine('After\x20authorizing,\x20re-run:\x20'+CLI_BIN_NAME+_0x18d4b6(0xef)),{'ok':!![],'message':_0x18d4b6(0xd9)};writeCliSideChannelLine(_0x18d4b6(0xc6));const _0x4057e1=new AbortController(),_0x4140c1=()=>{const _0x4caa11=_0x18d4b6;_0x4057e1[_0x4caa11(0xac)](),process[_0x4caa11(0xc7)](_0x4caa11(0xe6),_0x4140c1);};process[_0x18d4b6(0xbe)]('SIGINT',_0x4140c1);let _0x1ab17a;try{_0x1ab17a=await pollDeviceToken(_0x5f08e3,_0x2b9b53,_0x4057e1[_0x18d4b6(0xe0)]);}finally{process[_0x18d4b6(0xc7)](_0x18d4b6(0xe6),_0x4140c1);}if(!ACCESS_KEY_PATTERN[_0x18d4b6(0xa6)](_0x1ab17a))throw CliErrors[_0x18d4b6(0xc3)]('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x24bd48=readScopedConfig(_0x3ad5db);return _0x24bd48['accessKey']=_0x1ab17a,writeScopedConfig(_0x24bd48,_0x3ad5db),deleteStoredDeviceCode(),process[_0x18d4b6(0xea)][_0x18d4b6(0xe1)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x116058+'\x20config.'),writeCliSideChannelLine(_0x18d4b6(0xbc)+CLI_BIN_NAME+_0x18d4b6(0xf3)),{'ok':!![],'message':_0x18d4b6(0xcd)};}};
1
+ const a11_0x449580=a11_0x2997;function a11_0x2997(_0x42d8a9,_0x3647db){_0x42d8a9=_0x42d8a9-0x11b;const _0xb0703=a11_0xb070();let _0x2997db=_0xb0703[_0x42d8a9];return _0x2997db;}(function(_0x2e5cbb,_0x38a2a7){const _0x2c1214=a11_0x2997,_0x5bed7d=_0x2e5cbb();while(!![]){try{const _0x2ca04f=-parseInt(_0x2c1214(0x12c))/0x1+-parseInt(_0x2c1214(0x144))/0x2*(parseInt(_0x2c1214(0x12b))/0x3)+-parseInt(_0x2c1214(0x130))/0x4+parseInt(_0x2c1214(0x129))/0x5+-parseInt(_0x2c1214(0x124))/0x6*(-parseInt(_0x2c1214(0x150))/0x7)+-parseInt(_0x2c1214(0x135))/0x8*(parseInt(_0x2c1214(0x142))/0x9)+parseInt(_0x2c1214(0x145))/0xa;if(_0x2ca04f===_0x38a2a7)break;else _0x5bed7d['push'](_0x5bed7d['shift']());}catch(_0x3d6add){_0x5bed7d['push'](_0x5bed7d['shift']());}}}(a11_0xb070,0x36270));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x121d88){const _0x563003=a11_0x2997;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x121d88[_0x563003(0x11c)](_0x563003(0x137)),'explicitProject':_0x121d88['bool']('project'),'policy':_0x563003(0x14e)}));}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;function a11_0xb070(){const _0x430ca0=['boolean','global','padStart','networkError','parse','Write\x20to\x20global\x20config\x20(default)','string','Device\x20auth\x20API\x20returned\x20HTTP\x20','now','cancelled','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','lovrabet-cli','126lHJPGQ','\x20auth\x20status','2CfxhaH','9437140MGecVk','\x20config.','name','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','\x20remaining','removeListener','utf8','validation','global-default','aborted','7lhqBej','/api/device-auth/token','nonInteractive','After\x20authorizing,\x20re-run:\x20','AccessKey\x20saved\x20to\x20','device','createdAt','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','status','scope','stderr','access_key','accessKey','SIGINT','once','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','/device-auth?code=','log','expired','abort','code','Invalid\x20access_key\x20returned\x20by\x20server.','source','bool','trim','write','data','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','\x0dWaiting\x20for\x20authorization...\x20','stringify','application/json','366438aNTpXt','signal','getTime','),\x20retrying...','Device\x20authorization\x20cancelled.','1031350RSVxhr','test','745365UZEEje','93704mOrJnR','apiError','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','project','1050936OuFWYI','Write\x20to\x20project\x20config','success','homeDirName','url-only','219632xnBPRq'];a11_0xb070=function(){return _0x430ca0;};return a11_0xb070();}export function generateDeviceCode(){return crypto['randomUUID']();}export function buildDeviceAuthUrl(_0x508876,_0x478b98,_0x6b3c0f='lovrabet-cli'){const _0x524037=a11_0x2997;return _0x508876+_0x524037(0x161)+encodeURIComponent(_0x478b98)+'&source='+encodeURIComponent(_0x6b3c0f);}export function getDeviceCodePath(){const _0x10d042=a11_0x2997;return homedir()+'/'+PRODUCT_CONFIG[_0x10d042(0x133)]+'/.device-auth';}export function readStoredDeviceCode(){const _0x3894c7=a11_0x2997,_0x1d9609=getDeviceCodePath();if(!existsSync(_0x1d9609))return null;try{const _0x44afe0=readFileSync(_0x1d9609,{'encoding':_0x3894c7(0x14c)}),_0x5cc9f3=JSON[_0x3894c7(0x13a)](_0x44afe0);if(_0x5cc9f3&&typeof _0x5cc9f3[_0x3894c7(0x165)]===_0x3894c7(0x13c)&&typeof _0x5cc9f3[_0x3894c7(0x156)]===_0x3894c7(0x13c)&&(_0x5cc9f3[_0x3894c7(0x15a)]===_0x3894c7(0x137)||_0x5cc9f3['scope']==='project'))return _0x5cc9f3;}catch{}return null;}export function writeStoredDeviceCode(_0x509d54,_0x46da9b){const _0x58e1ec=a11_0x2997,_0x48b9db=getDeviceCodePath(),_0x36c0e6=dirname(_0x48b9db);!existsSync(_0x36c0e6)&&mkdirSync(_0x36c0e6,{'recursive':!![]});const _0x2e4163={'code':_0x509d54,'createdAt':new Date()['toISOString'](),'scope':_0x46da9b};writeFileSync(_0x48b9db,JSON[_0x58e1ec(0x122)](_0x2e4163),{'encoding':_0x58e1ec(0x14c),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x167e9d=getDeviceCodePath();try{unlinkSync(_0x167e9d);}catch{}}export function isStoredDeviceCodeExpired(_0x56a494){const _0x31cdb7=a11_0x2997;return Date[_0x31cdb7(0x13e)]()-new Date(_0x56a494[_0x31cdb7(0x156)])[_0x31cdb7(0x126)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x408789,_0x2cdb18){const _0x73a316=a11_0x2997,_0x26986f=_0x408789+_0x73a316(0x151),_0x1d097b=new AbortController(),_0x59aef1=setTimeout(()=>_0x1d097b[_0x73a316(0x164)](),0x2710),_0x2bc0c2=await fetch(_0x26986f,{'method':'POST','headers':{'Content-Type':_0x73a316(0x123)},'body':JSON['stringify']({'code':_0x2cdb18}),'signal':_0x1d097b[_0x73a316(0x125)]});clearTimeout(_0x59aef1);if(!_0x2bc0c2['ok'])throw CliErrors[_0x73a316(0x139)](_0x73a316(0x13d)+_0x2bc0c2[_0x73a316(0x159)]);const _0x1b4ff8=await _0x2bc0c2['json'](),_0x4919bb=_0x1b4ff8[_0x73a316(0x11f)]&&typeof _0x1b4ff8[_0x73a316(0x11f)]==='object'?_0x1b4ff8[_0x73a316(0x11f)]:_0x1b4ff8;if(!_0x4919bb||typeof _0x4919bb[_0x73a316(0x159)]!==_0x73a316(0x13c))throw CliErrors[_0x73a316(0x12d)]('Invalid\x20device\x20auth\x20response');return{'status':_0x4919bb['status'],'access_key':typeof _0x4919bb[_0x73a316(0x15c)]===_0x73a316(0x13c)?_0x4919bb[_0x73a316(0x15c)]:undefined};}export async function pollDeviceToken(_0x8ed6b8,_0x319235,_0x122c3d){const _0x2ff6ef=a11_0x2997;let _0x1a4e18=0x0;for(let _0x3f809a=0x0;_0x3f809a<MAX_POLLS;_0x3f809a++){if(_0x122c3d[_0x2ff6ef(0x14f)])throw CliErrors[_0x2ff6ef(0x13f)](_0x2ff6ef(0x128));let _0x645c1e;try{_0x645c1e=await fetchDeviceToken(_0x8ed6b8,_0x319235);}catch(_0x48065f){if(_0x48065f instanceof Error&&_0x48065f[_0x2ff6ef(0x147)]==='AbortError')throw CliErrors[_0x2ff6ef(0x13f)](_0x2ff6ef(0x128));_0x1a4e18++;if(_0x1a4e18>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x2ff6ef(0x139)](_0x2ff6ef(0x120));writeCliSideChannelLine('Device\x20auth\x20API\x20error\x20('+_0x1a4e18+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x2ff6ef(0x127)),await sleep(POLL_INTERVAL_MS);continue;}_0x1a4e18=0x0;if(_0x645c1e['status']===_0x2ff6ef(0x132)){if(!_0x645c1e[_0x2ff6ef(0x15c)])throw CliErrors[_0x2ff6ef(0x12d)]('Invalid\x20access_key\x20returned\x20by\x20server.');return _0x645c1e[_0x2ff6ef(0x15c)];}if(_0x645c1e[_0x2ff6ef(0x159)]===_0x2ff6ef(0x163)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x2ff6ef(0x148));}const _0x3b12fd=(_0x3f809a+0x1)*POLL_INTERVAL_MS,_0x559ac0=DEVICE_CODE_TTL_MS-_0x3b12fd,_0x28f251=Math['floor'](_0x559ac0/0xea60),_0x21ff7c=Math['floor'](_0x559ac0%0xea60/0x3e8);process[_0x2ff6ef(0x15b)]['write'](_0x2ff6ef(0x121)+_0x28f251+':'+String(_0x21ff7c)[_0x2ff6ef(0x138)](0x2,'0')+_0x2ff6ef(0x14a)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x2ff6ef(0x14d)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x3eb3f5){return new Promise(_0x2f3e59=>setTimeout(_0x2f3e59,_0x3eb3f5));}export const authDeviceDefinition={'service':'auth','command':a11_0x449580(0x155),'description':a11_0x449580(0x157),'risk':a11_0x449580(0x11e),'confirmationDescription':a11_0x449580(0x160),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x449580(0x137),'type':a11_0x449580(0x136),'description':a11_0x449580(0x13b),'default':!![]},{'name':a11_0x449580(0x12f),'type':a11_0x449580(0x136),'description':a11_0x449580(0x131),'default':![]},{'name':'source','type':a11_0x449580(0x13c),'description':'App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','default':'lovrabet-cli'},{'name':a11_0x449580(0x134),'type':a11_0x449580(0x136),'description':a11_0x449580(0x158),'default':![]}],async 'execute'(_0x12d9c2){const _0x39b100=a11_0x449580,_0x2b376c=resolveAuthScopeFlags(_0x12d9c2),_0x4bc4e2=_0x2b376c['global']?_0x39b100(0x137):_0x39b100(0x12f),_0x378551=readScopedConfig(_0x2b376c);if(_0x378551['accessKey'])return{'ok':!![],'message':_0x39b100(0x149)};const _0x493606=(_0x12d9c2['str'](_0x39b100(0x11b))||_0x39b100(0x141))[_0x39b100(0x11d)](),_0x278862=getUserDomain(),_0x486946=readStoredDeviceCode(),_0x109b10=_0x486946&&!isStoredDeviceCodeExpired(_0x486946)?_0x486946[_0x39b100(0x165)]:((()=>{const _0x43745b=generateDeviceCode();return writeStoredDeviceCode(_0x43745b,_0x4bc4e2),_0x43745b;})()),_0x379f65=buildDeviceAuthUrl(_0x278862,_0x109b10,_0x493606);if(_0x12d9c2['bool'](_0x39b100(0x134)))return console[_0x39b100(0x162)](_0x379f65),{'ok':!![]};writeCliSideChannelLine(_0x39b100(0x140)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x379f65),writeCliSideChannelLine(''),writeCliSideChannelLine('The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.');if(_0x12d9c2[_0x39b100(0x152)])return writeCliSideChannelLine(_0x39b100(0x153)+CLI_BIN_NAME+'\x20auth\x20device'),{'ok':!![],'message':_0x39b100(0x12e)};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x2b7551=new AbortController(),_0x113cdd=()=>{const _0xd49b2=_0x39b100;_0x2b7551['abort'](),process['removeListener'](_0xd49b2(0x15e),_0x113cdd);};process[_0x39b100(0x15f)]('SIGINT',_0x113cdd);let _0x544300;try{_0x544300=await pollDeviceToken(_0x278862,_0x109b10,_0x2b7551[_0x39b100(0x125)]);}finally{process[_0x39b100(0x14b)](_0x39b100(0x15e),_0x113cdd);}if(!ACCESS_KEY_PATTERN[_0x39b100(0x12a)](_0x544300))throw CliErrors[_0x39b100(0x12d)](_0x39b100(0x166));const _0x340cb0=readScopedConfig(_0x2b376c);return _0x340cb0[_0x39b100(0x15d)]=_0x544300,writeScopedConfig(_0x340cb0,_0x2b376c),deleteStoredDeviceCode(),process[_0x39b100(0x15b)][_0x39b100(0x11e)]('\x0a'),writeCliSideChannelLine(_0x39b100(0x154)+_0x4bc4e2+_0x39b100(0x146)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+_0x39b100(0x143)),{'ok':!![],'message':'Device\x20authorization\x20successful.'};}};