@lovrabet/lovrabet-cli 2.3.0 → 2.3.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) 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.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.d.ts +3 -3
  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.js +1 -1
  105. package/lib/core/api-client.d.ts +0 -16
  106. package/lib/core/api-client.js +1 -1
  107. package/lib/core/db-resolver.js +1 -1
  108. package/lib/core/kb-search-client.d.ts +30 -0
  109. package/lib/core/kb-search-client.js +1 -0
  110. package/lib/core/sdk-client.js +1 -1
  111. package/lib/errors.js +1 -1
  112. package/lib/framework/build-all-flags.js +1 -1
  113. package/lib/framework/dryrun.js +1 -1
  114. package/lib/framework/flags.js +1 -1
  115. package/lib/framework/help.js +1 -1
  116. package/lib/framework/index.js +1 -1
  117. package/lib/framework/output.js +1 -1
  118. package/lib/framework/preparse.js +1 -1
  119. package/lib/framework/rate-limit.js +1 -1
  120. package/lib/framework/raw-flags.js +1 -1
  121. package/lib/framework/response.js +1 -1
  122. package/lib/framework/runner-confirmation.js +1 -1
  123. package/lib/framework/runner-error.js +1 -1
  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.d.ts +2 -0
  128. package/lib/framework/types.js +1 -1
  129. package/lib/generated/build-info.d.ts +4 -4
  130. package/lib/generated/build-info.js +1 -1
  131. package/lib/help.js +1 -1
  132. package/lib/postinstall.js +1 -1
  133. package/lib/runtime/confirmation.js +1 -1
  134. package/lib/runtime/event.js +1 -1
  135. package/lib/runtime/index.js +1 -1
  136. package/lib/runtime/queue.js +1 -1
  137. package/lib/runtime/resolve.js +1 -1
  138. package/lib/skills/builtin-skill.js +1 -1
  139. package/lib/skills/npx-skills-add.js +1 -1
  140. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  141. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  142. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  143. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  144. package/lib/skills/runtime-skill-sync/links.js +1 -1
  145. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  146. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  147. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  148. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  149. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  150. package/lib/skills/runtime-skill-sync/push.js +1 -1
  151. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  152. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  153. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  154. package/lib/skills/runtime-skill-sync.js +1 -1
  155. package/lib/skills/skill-presence.js +1 -1
  156. package/lib/utils/access-key-redaction.js +1 -1
  157. package/lib/utils/apply-jq-filter.js +1 -1
  158. package/lib/utils/cli-version-check.js +1 -1
  159. package/lib/utils/cli-version-policy.js +1 -1
  160. package/lib/utils/logger.js +1 -1
  161. package/lib/utils/lossless-json.js +1 -1
  162. package/lib/utils/params.js +1 -1
  163. package/lib/utils/platform.js +1 -1
  164. package/lib/utils/update-notice.js +1 -1
  165. package/lib/utils/version.js +1 -1
  166. package/lib/utils/write-cli-side-channel.js +1 -1
  167. package/package.json +1 -1
  168. package/skills/lovrabet/SKILL.md +3 -2
  169. package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
  170. package/skills/lovrabet/references/lovrabet-config-commands.md +2 -2
  171. package/skills/lovrabet/references/lovrabet-config.md +2 -2
  172. package/skills/lovrabet/references/lovrabet-doctor.md +2 -0
  173. package/skills/lovrabet/references/lovrabet-kb-workflow.md +3 -1
  174. package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +32 -0
  175. 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_0x18c225=a0_0x51cd;(function(_0x3a2d0b,_0x2d03ad){const _0x49bf87=a0_0x51cd,_0x477584=_0x3a2d0b();while(!![]){try{const _0x212dc2=parseInt(_0x49bf87(0x102))/0x1+-parseInt(_0x49bf87(0xf2))/0x2+parseInt(_0x49bf87(0xf1))/0x3*(-parseInt(_0x49bf87(0xeb))/0x4)+-parseInt(_0x49bf87(0x100))/0x5+-parseInt(_0x49bf87(0xf4))/0x6*(-parseInt(_0x49bf87(0xed))/0x7)+parseInt(_0x49bf87(0xe6))/0x8+parseInt(_0x49bf87(0xff))/0x9;if(_0x212dc2===_0x2d03ad)break;else _0x477584['push'](_0x477584['shift']());}catch(_0x44662f){_0x477584['push'](_0x477584['shift']());}}}(a0_0x5606,0x5f25e));import{jsx as a0_0x4882ff}from'react/jsx-runtime';function a0_0x5606(){const _0x3451ee=['handler','560843TFubDX','help','name','error','[preparse]\x20','message','ExitPromptError','log','\x0aCancelled.\x0a','slice','write','./framework/preparse.js','definition','Unexpected\x20error:','args','812800OlHHbv',':\x20--','exitCode','assign','ERR_USE_AFTER_CLOSE','752508PzpGVQ','input','15974RbmGQE','catch','ERR_STREAM_DESTROYED','exit','9MrHBHT','214180ORTVRe','hint','282zsTTTf','validation','code','Error:\x20','defaultCommand','flags','\x20->\x20--','flatMap','length','corrected','stderr','3158613MMFwrC','297285UdwAvA'];a0_0x5606=function(){return _0x3451ee;};return a0_0x5606();}import a0_0x5b2ab6 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';function a0_0x51cd(_0x32dcae,_0x128827){_0x32dcae=_0x32dcae-0xdc;const _0x560674=a0_0x5606();let _0x51cd10=_0x560674[_0x32dcae];return _0x51cd10;}import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0x5b2ab6(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x18c225(0xee)](handleError);async function main(){try{await run();}catch(_0x436d8d){handleError(_0x436d8d);}}async function run(){const _0x14ee24=a0_0x18c225;let _0x4f1969=cli[_0x14ee24(0xec)][0x0],_0x2c0e92=cli[_0x14ee24(0xec)][0x1];const _0x3c4ff0=cli[_0x14ee24(0xf9)];try{const {correctFlags:_0xa5aea7}=await import(_0x14ee24(0xe2)),_0x38b171=getAllDefinitions()[_0x14ee24(0xfb)](_0x5c2fac=>_0x5c2fac['flags']??[]),{flags:_0x3f4b1d,corrections:_0xf6e53c}=_0xa5aea7(_0x3c4ff0,_0x38b171);if(_0xf6e53c[_0x14ee24(0xfc)]>0x0){for(const _0x53099e of _0xf6e53c){process[_0x14ee24(0xfe)][_0x14ee24(0xe1)](_0x14ee24(0x106)+_0x53099e[_0x14ee24(0x101)]+_0x14ee24(0xe7)+_0x53099e['original']+_0x14ee24(0xfa)+_0x53099e[_0x14ee24(0xfd)]+'\x0a');}Object[_0x14ee24(0xe9)](_0x3c4ff0,_0x3f4b1d);}}catch{}if(!_0x4f1969){const {waitUntilExit:_0xca7bc6}=render(a0_0x4882ff(Help,{}));await _0xca7bc6();return;}const _0x2eb77d=resolveRemovedCommand(_0x4f1969,_0x2c0e92);if(_0x2eb77d)throw CliErrors[_0x14ee24(0xf5)](_0x2eb77d[_0x14ee24(0xdc)],_0x2eb77d[_0x14ee24(0xf3)]);if(!isKnownService(_0x4f1969)){const _0x50d6f2=resolveDynamicServiceCommand(cli['input'],_0x3c4ff0);if(_0x50d6f2){if(_0x3c4ff0[_0x14ee24(0x103)]){console[_0x14ee24(0xde)](generateCommandHelp(_0x50d6f2['definition']));return;}Object[_0x14ee24(0xe9)](_0x3c4ff0,_0x50d6f2[_0x14ee24(0xf9)]);const _0x4148b2=buildConfigFromFlags(_0x3c4ff0);await initGlobalEnvironment(_0x4148b2);const _0x3fdc61=createPipelineEnv(_0x4148b2,_0x3c4ff0);_0x3fdc61['args']=_0x50d6f2[_0x14ee24(0xe5)],await runCommand(_0x50d6f2[_0x14ee24(0xe3)],_0x3fdc61);return;}if(_0x3c4ff0[_0x14ee24(0x103)]){const _0x3c61d2=generateDynamicServiceHelp(_0x4f1969);if(_0x3c61d2){console['log'](_0x3c61d2);return;}}const {waitUntilExit:_0x8913e5}=render(a0_0x4882ff(Help,{}));await _0x8913e5();return;}const _0x13e2ff=getServiceEntry(_0x4f1969);if(!_0x2c0e92){if(_0x3c4ff0[_0x14ee24(0x103)]){console[_0x14ee24(0xde)](generateServiceHelp(_0x4f1969));return;}if(_0x13e2ff['defaultCommand'])_0x2c0e92=_0x13e2ff[_0x14ee24(0xf8)];else{console[_0x14ee24(0xde)](generateServiceHelp(_0x4f1969));return;}}const _0xe2ff4c=findDefinition(_0x4f1969,_0x2c0e92);!_0xe2ff4c&&(console[_0x14ee24(0xde)](generateServiceHelp(_0x4f1969)),handleError(CliErrors['unknownCommand'](_0x4f1969+'\x20'+_0x2c0e92)));if(_0x3c4ff0[_0x14ee24(0x103)]){console['log'](generateCommandHelp(_0xe2ff4c));return;}const _0xd5f093=buildConfigFromFlags(_0x3c4ff0);await initGlobalEnvironment(_0xd5f093);const _0x50c977=createPipelineEnv(_0xd5f093,_0x3c4ff0);_0x50c977['args']=cli[_0x14ee24(0xec)][_0x14ee24(0xe0)](0x2),await runCommand(_0xe2ff4c,_0x50c977);}function handleError(_0x42f4b8){const _0x42c262=a0_0x18c225;if(_0x42f4b8 instanceof CliError){_0x42f4b8['code']==='cancelled'&&(process[_0x42c262(0xfe)][_0x42c262(0xe1)](_0x42c262(0xdf)),process[_0x42c262(0xf0)](0x0));console[_0x42c262(0x105)](_0x42c262(0xf7)+_0x42f4b8[_0x42c262(0xdc)]);if(_0x42f4b8['hint'])console[_0x42c262(0x105)]('Hint:\x20'+_0x42f4b8[_0x42c262(0xf3)]);process['exit'](_0x42f4b8[_0x42c262(0xe8)]);}isUserCancellation(_0x42f4b8)&&(process[_0x42c262(0xfe)]['write']('\x0aCancelled.\x0a'),process[_0x42c262(0xf0)](0x0)),console[_0x42c262(0x105)](_0x42c262(0xe4),_0x42f4b8),process[_0x42c262(0xf0)](0x1);}function isUserCancellation(_0x44bcb9){const _0x2fac1e=a0_0x18c225;if(!(_0x44bcb9 instanceof Error))return![];if(_0x44bcb9[_0x2fac1e(0x104)]===_0x2fac1e(0xdd))return!![];if(_0x44bcb9[_0x2fac1e(0xf6)]===_0x2fac1e(0xea))return!![];if(_0x44bcb9[_0x2fac1e(0xf6)]===_0x2fac1e(0xef))return!![];return![];}
2
+ (function(_0x224d6a,_0x3ff998){const _0x194567=a0_0x3c01,_0x188499=_0x224d6a();while(!![]){try{const _0x52718c=parseInt(_0x194567(0x144))/0x1+parseInt(_0x194567(0x158))/0x2*(parseInt(_0x194567(0x15e))/0x3)+-parseInt(_0x194567(0x146))/0x4*(-parseInt(_0x194567(0x14e))/0x5)+-parseInt(_0x194567(0x142))/0x6*(parseInt(_0x194567(0x14a))/0x7)+parseInt(_0x194567(0x139))/0x8+-parseInt(_0x194567(0x15f))/0x9*(parseInt(_0x194567(0x140))/0xa)+-parseInt(_0x194567(0x157))/0xb;if(_0x52718c===_0x3ff998)break;else _0x188499['push'](_0x188499['shift']());}catch(_0x26ea4e){_0x188499['push'](_0x188499['shift']());}}}(a0_0x18cf,0x41c3d));import{jsx as a0_0x373d38}from'react/jsx-runtime';import a0_0xbea979 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';function a0_0x3c01(_0x4b8d6f,_0x404b61){_0x4b8d6f=_0x4b8d6f-0x139;const _0x18cfb2=a0_0x18cf();let _0x3c019b=_0x18cfb2[_0x4b8d6f];return _0x3c019b;}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_0xbea979(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()['catch'](handleError);function a0_0x18cf(){const _0x2c7dc5=['hint','Hint:\x20','error','flatMap','code','\x20->\x20--','1298704VLhssL','7656kKkEhC','message','slice','ERR_USE_AFTER_CLOSE','exitCode','corrected','417fcxxcv','1631241cDxhvI','exit','cancelled','args','stderr','\x0aCancelled.\x0a','2452344QKZFtT','[preparse]\x20','write','log','./framework/preparse.js','ERR_STREAM_DESTROYED','help','20QYjzvw','defaultCommand','282mUNoOg','input','89298QZduKn','original','76waqIRl',':\x20--','ExitPromptError','length','61229euElSm','flags','definition','unknownCommand','61345BJfqos','Unexpected\x20error:','handler'];a0_0x18cf=function(){return _0x2c7dc5;};return a0_0x18cf();}async function main(){try{await run();}catch(_0x28afc8){handleError(_0x28afc8);}}async function run(){const _0x19ceb9=a0_0x3c01;let _0x201cbf=cli[_0x19ceb9(0x143)][0x0],_0x596584=cli[_0x19ceb9(0x143)][0x1];const _0x4692fc=cli[_0x19ceb9(0x14b)];try{const {correctFlags:_0x2c2d83}=await import(_0x19ceb9(0x13d)),_0x55b44c=getAllDefinitions()[_0x19ceb9(0x154)](_0x1d448d=>_0x1d448d[_0x19ceb9(0x14b)]??[]),{flags:_0x2bf3ef,corrections:_0x11e908}=_0x2c2d83(_0x4692fc,_0x55b44c);if(_0x11e908[_0x19ceb9(0x149)]>0x0){for(const _0x409a8d of _0x11e908){process[_0x19ceb9(0x163)][_0x19ceb9(0x13b)](_0x19ceb9(0x13a)+_0x409a8d[_0x19ceb9(0x150)]+_0x19ceb9(0x147)+_0x409a8d[_0x19ceb9(0x145)]+_0x19ceb9(0x156)+_0x409a8d[_0x19ceb9(0x15d)]+'\x0a');}Object['assign'](_0x4692fc,_0x2bf3ef);}}catch{}if(!_0x201cbf){const {waitUntilExit:_0x309a9d}=render(a0_0x373d38(Help,{}));await _0x309a9d();return;}const _0x566843=resolveRemovedCommand(_0x201cbf,_0x596584);if(_0x566843)throw CliErrors['validation'](_0x566843[_0x19ceb9(0x159)],_0x566843[_0x19ceb9(0x151)]);if(!isKnownService(_0x201cbf)){const _0xc4c19f=resolveDynamicServiceCommand(cli[_0x19ceb9(0x143)],_0x4692fc);if(_0xc4c19f){if(_0x4692fc[_0x19ceb9(0x13f)]){console['log'](generateCommandHelp(_0xc4c19f[_0x19ceb9(0x14c)]));return;}Object['assign'](_0x4692fc,_0xc4c19f[_0x19ceb9(0x14b)]);const _0x24e0dd=buildConfigFromFlags(_0x4692fc);await initGlobalEnvironment(_0x24e0dd);const _0x2e87e3=createPipelineEnv(_0x24e0dd,_0x4692fc);_0x2e87e3[_0x19ceb9(0x162)]=_0xc4c19f[_0x19ceb9(0x162)],await runCommand(_0xc4c19f[_0x19ceb9(0x14c)],_0x2e87e3);return;}if(_0x4692fc[_0x19ceb9(0x13f)]){const _0xc04662=generateDynamicServiceHelp(_0x201cbf);if(_0xc04662){console[_0x19ceb9(0x13c)](_0xc04662);return;}}const {waitUntilExit:_0x1df14a}=render(a0_0x373d38(Help,{}));await _0x1df14a();return;}const _0x31e86f=getServiceEntry(_0x201cbf);if(!_0x596584){if(_0x4692fc['help']){console[_0x19ceb9(0x13c)](generateServiceHelp(_0x201cbf));return;}if(_0x31e86f[_0x19ceb9(0x141)])_0x596584=_0x31e86f[_0x19ceb9(0x141)];else{console[_0x19ceb9(0x13c)](generateServiceHelp(_0x201cbf));return;}}const _0x5654de=findDefinition(_0x201cbf,_0x596584);!_0x5654de&&(console[_0x19ceb9(0x13c)](generateServiceHelp(_0x201cbf)),handleError(CliErrors[_0x19ceb9(0x14d)](_0x201cbf+'\x20'+_0x596584)));if(_0x4692fc['help']){console['log'](generateCommandHelp(_0x5654de));return;}const _0xb43470=buildConfigFromFlags(_0x4692fc);await initGlobalEnvironment(_0xb43470);const _0x384f72=createPipelineEnv(_0xb43470,_0x4692fc);_0x384f72[_0x19ceb9(0x162)]=cli[_0x19ceb9(0x143)][_0x19ceb9(0x15a)](0x2),await runCommand(_0x5654de,_0x384f72);}function handleError(_0x36fd68){const _0x30a638=a0_0x3c01;if(_0x36fd68 instanceof CliError){_0x36fd68['code']===_0x30a638(0x161)&&(process[_0x30a638(0x163)]['write'](_0x30a638(0x164)),process[_0x30a638(0x160)](0x0));console[_0x30a638(0x153)]('Error:\x20'+_0x36fd68[_0x30a638(0x159)]);if(_0x36fd68['hint'])console[_0x30a638(0x153)](_0x30a638(0x152)+_0x36fd68[_0x30a638(0x151)]);process[_0x30a638(0x160)](_0x36fd68[_0x30a638(0x15c)]);}isUserCancellation(_0x36fd68)&&(process[_0x30a638(0x163)][_0x30a638(0x13b)]('\x0aCancelled.\x0a'),process['exit'](0x0)),console[_0x30a638(0x153)](_0x30a638(0x14f),_0x36fd68),process[_0x30a638(0x160)](0x1);}function isUserCancellation(_0x42efcf){const _0x4e8948=a0_0x3c01;if(!(_0x42efcf instanceof Error))return![];if(_0x42efcf['name']===_0x4e8948(0x148))return!![];if(_0x42efcf[_0x4e8948(0x155)]===_0x4e8948(0x15b))return!![];if(_0x42efcf[_0x4e8948(0x155)]===_0x4e8948(0x13e))return!![];return![];}
@@ -1 +1 @@
1
- const a1_0x25e98b=a1_0x44cf;(function(_0x5269d4,_0x2f990b){const _0x62d5f3=a1_0x44cf,_0x7f1695=_0x5269d4();while(!![]){try{const _0x37cc49=parseInt(_0x62d5f3(0x1ab))/0x1*(parseInt(_0x62d5f3(0x14d))/0x2)+parseInt(_0x62d5f3(0x199))/0x3+parseInt(_0x62d5f3(0x1b1))/0x4+parseInt(_0x62d5f3(0x18b))/0x5*(parseInt(_0x62d5f3(0x14a))/0x6)+parseInt(_0x62d5f3(0x18a))/0x7*(-parseInt(_0x62d5f3(0x183))/0x8)+-parseInt(_0x62d5f3(0x151))/0x9+parseInt(_0x62d5f3(0x1b0))/0xa;if(_0x37cc49===_0x2f990b)break;else _0x7f1695['push'](_0x7f1695['shift']());}catch(_0x4464bc){_0x7f1695['push'](_0x7f1695['shift']());}}}(a1_0x85e9,0x1ec78));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x25e98b(0x182),'type':a1_0x25e98b(0x143),'description':a1_0x25e98b(0x15e)},KEYWORD_FLAG={'name':'keyword','type':a1_0x25e98b(0x143),'description':a1_0x25e98b(0x162)},DOC_CODE_FLAG={'name':'code','type':a1_0x25e98b(0x143),'required':!![],'description':a1_0x25e98b(0x178)},DOCS=[{'code':a1_0x25e98b(0x1b4),'category':'dataset','title':a1_0x25e98b(0x187),'method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x152),'summary':'List\x20datasets\x20with\x20pagination','whenToUse':'Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','pathParams':[],'queryParams':[],'bodySchema':a1_0x25e98b(0x159),'responseHighlights':[a1_0x25e98b(0x176),a1_0x25e98b(0x17c)],'examples':[a1_0x25e98b(0x1ac)],'notes':[a1_0x25e98b(0x192)],'markdown':[a1_0x25e98b(0x167),'',a1_0x25e98b(0x15f)]['join']('\x0a')},{'code':a1_0x25e98b(0x19b),'category':a1_0x25e98b(0x141),'title':a1_0x25e98b(0x179),'method':a1_0x25e98b(0x175),'path':a1_0x25e98b(0x1a5),'summary':a1_0x25e98b(0x19c),'whenToUse':a1_0x25e98b(0x1a0),'pathParams':[],'queryParams':[{'name':a1_0x25e98b(0x163),'description':a1_0x25e98b(0x1a1)}],'bodySchema':a1_0x25e98b(0x172),'responseHighlights':[a1_0x25e98b(0x185),a1_0x25e98b(0x191),a1_0x25e98b(0x196)],'examples':[a1_0x25e98b(0x19d)],'notes':[a1_0x25e98b(0x180)],'markdown':[a1_0x25e98b(0x15d),'','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.']['join']('\x0a')},{'code':a1_0x25e98b(0x17f),'category':a1_0x25e98b(0x141),'title':a1_0x25e98b(0x1ae),'method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x14c),'summary':a1_0x25e98b(0x158),'whenToUse':a1_0x25e98b(0x1b3),'pathParams':[{'name':a1_0x25e98b(0x13b),'description':a1_0x25e98b(0x14e)},{'name':a1_0x25e98b(0x161),'description':a1_0x25e98b(0x1a1)}],'queryParams':[],'bodySchema':a1_0x25e98b(0x194),'responseHighlights':['tableData\x20contains\x20records',a1_0x25e98b(0x13d)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27',a1_0x25e98b(0x149)],'notes':[a1_0x25e98b(0x1a9),a1_0x25e98b(0x15a),a1_0x25e98b(0x197),a1_0x25e98b(0x16b)],'markdown':[a1_0x25e98b(0x174),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.']['join']('\x0a')},{'code':a1_0x25e98b(0x18e),'category':a1_0x25e98b(0x141),'title':a1_0x25e98b(0x148),'method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x145),'summary':a1_0x25e98b(0x18d),'whenToUse':a1_0x25e98b(0x168),'pathParams':[{'name':a1_0x25e98b(0x13b),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':a1_0x25e98b(0x1a1)}],'queryParams':[],'bodySchema':a1_0x25e98b(0x19e),'responseHighlights':[a1_0x25e98b(0x16f),a1_0x25e98b(0x160)],'examples':['lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27'],'notes':[a1_0x25e98b(0x170),'`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'],'markdown':[a1_0x25e98b(0x171),'',a1_0x25e98b(0x164)][a1_0x25e98b(0x16c)]('\x0a')},{'code':a1_0x25e98b(0x1a7),'category':a1_0x25e98b(0x141),'title':a1_0x25e98b(0x150),'method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x14f),'summary':'Get\x20one\x20dataset\x20record','whenToUse':a1_0x25e98b(0x18f),'pathParams':[{'name':a1_0x25e98b(0x13b),'description':'Current\x20app\x20code'},{'name':a1_0x25e98b(0x161),'description':a1_0x25e98b(0x1a1)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x25e98b(0x142)],'examples':[a1_0x25e98b(0x1aa)],'notes':[a1_0x25e98b(0x19a)],'markdown':a1_0x25e98b(0x144)},{'code':'dataset_data_create','category':a1_0x25e98b(0x141),'title':a1_0x25e98b(0x193),'method':'POST','path':a1_0x25e98b(0x188),'summary':a1_0x25e98b(0x1a4),'whenToUse':'Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','pathParams':[{'name':'appCode','description':a1_0x25e98b(0x14e)},{'name':'datasetCode','description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x25e98b(0x1af),'responseHighlights':['Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result'],'examples':[a1_0x25e98b(0x190)],'notes':[a1_0x25e98b(0x17a)],'markdown':'##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.'},{'code':'bf_detail','category':'bf','title':a1_0x25e98b(0x146),'method':'GET','path':a1_0x25e98b(0x177),'summary':a1_0x25e98b(0x154),'whenToUse':a1_0x25e98b(0x1a3),'pathParams':[{'name':'appCode','description':a1_0x25e98b(0x14e)},{'name':'functionName','description':a1_0x25e98b(0x1a2)}],'queryParams':[],'bodySchema':a1_0x25e98b(0x172),'responseHighlights':[a1_0x25e98b(0x1b5)],'examples':['lovrabet\x20bff\x20detail\x20--name\x20<functionName>'],'notes':[a1_0x25e98b(0x17e)],'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':'Execute\x20BF\x20endpoint\x20function','method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x1a8),'summary':a1_0x25e98b(0x1b6),'whenToUse':a1_0x25e98b(0x169),'pathParams':[{'name':'appCode','description':a1_0x25e98b(0x14e)},{'name':'functionName','description':a1_0x25e98b(0x156)}],'queryParams':[],'bodySchema':a1_0x25e98b(0x1a6),'responseHighlights':[a1_0x25e98b(0x19f)],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':[a1_0x25e98b(0x157)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x25e98b(0x15c),'category':a1_0x25e98b(0x18c),'title':a1_0x25e98b(0x15b),'method':a1_0x25e98b(0x153),'path':a1_0x25e98b(0x16d),'summary':'Execute\x20custom\x20SQL','whenToUse':a1_0x25e98b(0x13a),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x25e98b(0x13e)],'examples':[a1_0x25e98b(0x140)],'notes':[a1_0x25e98b(0x155)],'markdown':a1_0x25e98b(0x138)}];function entrySummary(_0x48eb90){const _0x10ab3b=a1_0x25e98b;return{'code':_0x48eb90[_0x10ab3b(0x163)],'category':_0x48eb90[_0x10ab3b(0x182)],'method':_0x48eb90[_0x10ab3b(0x13f)],'path':_0x48eb90['path'],'summary':_0x48eb90['summary'],'whenToUse':_0x48eb90[_0x10ab3b(0x17b)]};}export function listApiDocEntries(_0x34e34a={}){const _0xc7994a=a1_0x25e98b,_0x3c4414=String(_0x34e34a[_0xc7994a(0x182)]||'')[_0xc7994a(0x195)](),_0x55b5bc=String(_0x34e34a[_0xc7994a(0x173)]||'')['trim']()['toLowerCase']();return DOCS[_0xc7994a(0x16a)](_0xf0fa94=>{const _0x53436f=_0xc7994a;if(_0x3c4414&&_0xf0fa94['category']!==_0x3c4414)return![];if(!_0x55b5bc)return!![];return[_0xf0fa94[_0x53436f(0x163)],_0xf0fa94['category'],_0xf0fa94[_0x53436f(0x13f)],_0xf0fa94[_0x53436f(0x186)],_0xf0fa94[_0x53436f(0x1b2)],_0xf0fa94[_0x53436f(0x17b)],_0xf0fa94[_0x53436f(0x13c)]][_0x53436f(0x16c)]('\x20')[_0x53436f(0x147)]()[_0x53436f(0x198)](_0x55b5bc);})[_0xc7994a(0x181)](entrySummary);}function a1_0x44cf(_0x1f7284,_0x3c0f71){_0x1f7284=_0x1f7284-0x138;const _0x85e92c=a1_0x85e9();let _0x44cf57=_0x85e92c[_0x1f7284];return _0x44cf57;}export function getApiDocDetail(_0x44105d){const _0x33497b=a1_0x25e98b,_0x110b14=DOCS[_0x33497b(0x189)](_0x3ba803=>_0x3ba803[_0x33497b(0x163)]===_0x44105d);if(!_0x110b14)throw CliErrors['validation'](_0x33497b(0x17d)+_0x44105d);return{..._0x110b14};}function a1_0x85e9(){const _0x54d60b=['List\x20datasets','/api/{appCode}/{datasetCode}/create','find','35GUuiCG','1060RaTyne','custom_sql','Aggregate\x20dataset\x20records','dataset_data_aggregate','Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','Create\x20dataset\x20record','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','trim','operations\x20describes\x20runtime\x20APIs','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','includes','63324FMuQiH','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','dataset_detail','Get\x20dataset\x20detail','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','Returns\x20script\x20business\x20payload','Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','32-character\x20dataset\x20code','Exact\x20endpoint\x20function\x20name','Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','Create\x20a\x20dataset\x20record','/api/dataset/getOneByCode?code={datasetCode}','{\x22param\x22:\x22value\x22}','dataset_data_get_one','/api/endpoint/{appCode}/{functionName}','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','2627ThAndx','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','read','Filter\x20dataset\x20data','{\x22fieldName\x22:\x22value\x22}','669160lEmDaY','159360TJkUlM','summary','Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','dataset_list','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','Execute\x20a\x20BF\x20endpoint\x20function','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','Show\x20runtime\x20API\x20documentation\x20by\x20code','Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','appCode','title','paging\x20contains\x20pagination','Returns\x20SQL\x20execution\x20payload','method','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','dataset','Returns\x20one\x20matching\x20business\x20record','string','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','/api/{appCode}/{datasetCode}/aggregate','Get\x20BF\x20endpoint\x20function\x20contract','toLowerCase','Aggregate\x20dataset\x20data','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','6402RdbBao','detail','/api/{appCode}/{datasetCode}/filter','138mHKERV','Current\x20app\x20code','/api/{appCode}/{datasetCode}/getOne','Get\x20one\x20dataset\x20record','1816686fNcamt','/api/dataset/get-dataset-list-by-app-code','POST','Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','Endpoint\x20function\x20name','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Filter\x20dataset\x20records','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','Execute\x20custom\x20SQL','custom_sql_execute','##\x20Dataset\x20detail','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','where\x20filters\x20before\x20aggregation','datasetCode','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','code','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','length','List\x20available\x20runtime\x20API\x20documentation\x20entries','##\x20List\x20datasets','Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','filter','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','join','/api/custom/executeSql','api-doc','result\x20rows\x20contain\x20aggregate\x20aliases','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','##\x20Aggregate\x20dataset\x20data','None','keyword','##\x20Filter\x20dataset\x20data','GET','tableData\x20contains\x20dataset\x20id/code/name','/client/bff/endpoint/{appCode}/{functionName}','API\x20doc\x20code,\x20for\x20example\x20dataset_list','Dataset\x20detail','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','whenToUse','paging.totalCount\x20gives\x20total\x20rows','API\x20doc\x20code\x20not\x20found:\x20','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.','dataset_data_filter','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','map','category','331848aNDDfE','str','fields/properties\x20describe\x20data\x20shape','path'];a1_0x85e9=function(){return _0x54d60b;};return a1_0x85e9();}const apiDocList={'service':a1_0x25e98b(0x16e),'command':'list','description':a1_0x25e98b(0x166),'risk':'read','requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x5dbbdc){const _0xb2084d=a1_0x25e98b,_0x1b8ce5=listApiDocEntries({'category':_0x5dbbdc[_0xb2084d(0x184)](_0xb2084d(0x182)),'keyword':_0x5dbbdc[_0xb2084d(0x184)](_0xb2084d(0x173))});return{'ok':!![],'data':{'total':_0x1b8ce5[_0xb2084d(0x165)],'items':_0x1b8ce5}};}},apiDocDetail={'service':a1_0x25e98b(0x16e),'command':a1_0x25e98b(0x14b),'description':a1_0x25e98b(0x139),'risk':a1_0x25e98b(0x1ad),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x1ecf2e){const _0x1bbdd6=a1_0x25e98b;return{'ok':!![],'data':getApiDocDetail(_0x1ecf2e[_0x1bbdd6(0x184)](_0x1bbdd6(0x163)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
1
+ const a1_0x4588b6=a1_0x1ff0;(function(_0x25e222,_0xeb423f){const _0x33a8f7=a1_0x1ff0,_0x2a7a0e=_0x25e222();while(!![]){try{const _0x2a319b=parseInt(_0x33a8f7(0x20a))/0x1*(-parseInt(_0x33a8f7(0x1ac))/0x2)+parseInt(_0x33a8f7(0x1d8))/0x3*(parseInt(_0x33a8f7(0x1e1))/0x4)+-parseInt(_0x33a8f7(0x209))/0x5+parseInt(_0x33a8f7(0x201))/0x6*(parseInt(_0x33a8f7(0x1bf))/0x7)+parseInt(_0x33a8f7(0x1bc))/0x8+-parseInt(_0x33a8f7(0x1a9))/0x9+parseInt(_0x33a8f7(0x1a2))/0xa*(-parseInt(_0x33a8f7(0x1ce))/0xb);if(_0x2a319b===_0xeb423f)break;else _0x2a7a0e['push'](_0x2a7a0e['shift']());}catch(_0x50dce2){_0x2a7a0e['push'](_0x2a7a0e['shift']());}}}(a1_0x4337,0x70d98));function a1_0x4337(){const _0x10af78=['Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','summary','Execute\x20a\x20known\x20Personal\x20Backend\x20Function\x20script\x20through\x20its\x20runtime\x20execute\x20endpoint.','22bxgUBE','Use\x20when\x20the\x20target\x20Personal\x20BFF\x20script\x20id\x20is\x20confirmed\x20under\x20the\x20current\x20user\x20and\x20you\x20need\x20to\x20execute\x20that\x20personal\x20script\x20with\x20optional\x20JSON\x20params','method','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','read','Returns\x20script\x20business\x20payload','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\x20dataset\x20detail','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','Exact\x20endpoint\x20function\x20name','9TDLLDc','operations\x20describes\x20runtime\x20APIs','List\x20datasets\x20with\x20pagination','result\x20rows\x20contain\x20aggregate\x20aliases','##\x20List\x20datasets','/api/{appCode}/{datasetCode}/aggregate','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','/api/runtime-bff/personal/{id}/execute','843000qXFblq','join','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','{\x22param\x22:\x22value\x22}','lovrabet\x20personal-bff\x20exec\x20--id\x20<id>\x20--params\x20\x27{}\x27','dataset_data_get_one','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','whenToUse','tableData\x20contains\x20records','paging\x20contains\x20pagination','dataset_list','/api/{appCode}/{datasetCode}/getOne','Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','Execute\x20a\x20BF\x20endpoint\x20function','API\x20doc\x20code\x20not\x20found:\x20','Execute\x20Personal\x20Backend\x20Function','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Filter\x20dataset\x20records','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','title','Current\x20app\x20code','appCode','None','{\x22fieldName\x22:\x22value\x22}','toLowerCase','/api/{appCode}/{datasetCode}/create','includes','POST','1998YZbKQY','dataset','detail','Get\x20one\x20dataset\x20record','Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','Personal\x20BFF\x20scripts\x20are\x20user-owned\x20and\x20scoped\x20per\x20app.','32-character\x20dataset\x20code','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','2403330TbYnxh','340303tHgwIF','Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','Show\x20runtime\x20API\x20documentation\x20by\x20code','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','dataset_data_filter','keyword','datasetCode','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','dataset_data_aggregate','code','/api/dataset/get-dataset-list-by-app-code','/api/dataset/getOneByCode?code={datasetCode}','Execute\x20a\x20Personal\x20Backend\x20Function\x20by\x20script\x20ID','Dataset\x20detail','/api/custom/executeSql','##\x20Filter\x20dataset\x20data','validation','str','length','4545770xlfOxj','Function\x20execution\x20may\x20have\x20business\x20side\x20effects;\x20inspect\x20detail\x20before\x20execution.','find','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','custom_sql','GET','Execute\x20custom\x20SQL','770706pvLWFg','Get\x20BF\x20endpoint\x20function\x20contract','API\x20doc\x20code,\x20for\x20example\x20dataset_list','2OGGvLU','dataset_data_create','Execute\x20BF\x20endpoint\x20function','fields/properties\x20describe\x20data\x20shape','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','List\x20datasets','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','##\x20Aggregate\x20dataset\x20data','where\x20filters\x20before\x20aggregation','string','category','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','list','6354064aOPHtX','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','##\x20Dataset\x20detail','17899zOIEmx','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','trim','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Endpoint\x20function\x20name','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','Personal\x20Backend\x20Function\x20script\x20ID,\x20for\x20example\x20123','Create\x20dataset\x20record','path','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','/client/bff/endpoint/{appCode}/{functionName}'];a1_0x4337=function(){return _0x10af78;};return a1_0x4337();}import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':'category','type':a1_0x4588b6(0x1b7),'description':a1_0x4588b6(0x1cb)},KEYWORD_FLAG={'name':a1_0x4588b6(0x210),'type':'string','description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':'code','type':a1_0x4588b6(0x1b7),'required':!![],'description':a1_0x4588b6(0x1ab)},DOCS=[{'code':a1_0x4588b6(0x1ec),'category':'dataset','title':a1_0x4588b6(0x1b3),'method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x199),'summary':a1_0x4588b6(0x1da),'whenToUse':a1_0x4588b6(0x20c),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name','paging.totalCount\x20gives\x20total\x20rows'],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':[a1_0x4588b6(0x1e3)],'markdown':[a1_0x4588b6(0x1dc),'','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.'][a1_0x4588b6(0x1e2)]('\x0a')},{'code':'dataset_detail','category':a1_0x4588b6(0x202),'title':a1_0x4588b6(0x19c),'method':a1_0x4588b6(0x1a7),'path':a1_0x4588b6(0x19a),'summary':a1_0x4588b6(0x1d5),'whenToUse':'Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','pathParams':[],'queryParams':[{'name':a1_0x4588b6(0x214),'description':a1_0x4588b6(0x207)}],'bodySchema':'None','responseHighlights':[a1_0x4588b6(0x1af),a1_0x4588b6(0x1a5),a1_0x4588b6(0x1d9)],'examples':[a1_0x4588b6(0x1c0)],'notes':[a1_0x4588b6(0x1d1)],'markdown':[a1_0x4588b6(0x1be),'',a1_0x4588b6(0x1f4)][a1_0x4588b6(0x1e2)]('\x0a')},{'code':a1_0x4588b6(0x20f),'category':'dataset','title':'Filter\x20dataset\x20data','method':a1_0x4588b6(0x200),'path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x4588b6(0x1f5),'whenToUse':a1_0x4588b6(0x1ba),'pathParams':[{'name':'appCode','description':a1_0x4588b6(0x1f9)},{'name':a1_0x4588b6(0x211),'description':a1_0x4588b6(0x207)}],'queryParams':[],'bodySchema':a1_0x4588b6(0x1df),'responseHighlights':[a1_0x4588b6(0x1ea),a1_0x4588b6(0x1eb)],'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':[a1_0x4588b6(0x212),a1_0x4588b6(0x1f2),a1_0x4588b6(0x1c5),a1_0x4588b6(0x1b9)],'markdown':[a1_0x4588b6(0x19e),'',a1_0x4588b6(0x1b0)][a1_0x4588b6(0x1e2)]('\x0a')},{'code':a1_0x4588b6(0x213),'category':a1_0x4588b6(0x202),'title':'Aggregate\x20dataset\x20data','method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x1dd),'summary':'Aggregate\x20dataset\x20records','whenToUse':'Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','pathParams':[{'name':a1_0x4588b6(0x1fa),'description':a1_0x4588b6(0x1f9)},{'name':a1_0x4588b6(0x211),'description':a1_0x4588b6(0x207)}],'queryParams':[],'bodySchema':a1_0x4588b6(0x1f7),'responseHighlights':[a1_0x4588b6(0x1db),a1_0x4588b6(0x1b6)],'examples':[a1_0x4588b6(0x1d4)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.',a1_0x4588b6(0x1c2)],'markdown':[a1_0x4588b6(0x1b5),'',a1_0x4588b6(0x1e8)][a1_0x4588b6(0x1e2)]('\x0a')},{'code':a1_0x4588b6(0x1e7),'category':a1_0x4588b6(0x202),'title':'Get\x20one\x20dataset\x20record','method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x1ed),'summary':a1_0x4588b6(0x204),'whenToUse':'Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','pathParams':[{'name':a1_0x4588b6(0x1fa),'description':'Current\x20app\x20code'},{'name':a1_0x4588b6(0x211),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x4588b6(0x1d6)],'markdown':a1_0x4588b6(0x1de)},{'code':a1_0x4588b6(0x1ad),'category':'dataset','title':a1_0x4588b6(0x1c7),'method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x1fe),'summary':'Create\x20a\x20dataset\x20record','whenToUse':a1_0x4588b6(0x1ee),'pathParams':[{'name':a1_0x4588b6(0x1fa),'description':a1_0x4588b6(0x1f9)},{'name':a1_0x4588b6(0x211),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x4588b6(0x1fc),'responseHighlights':[a1_0x4588b6(0x20e)],'examples':[a1_0x4588b6(0x1bd)],'notes':[a1_0x4588b6(0x1b4)],'markdown':a1_0x4588b6(0x1c3)},{'code':'bf_detail','category':'bf','title':a1_0x4588b6(0x1aa),'method':'GET','path':a1_0x4588b6(0x1ca),'summary':a1_0x4588b6(0x20b),'whenToUse':'Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','pathParams':[{'name':a1_0x4588b6(0x1fa),'description':a1_0x4588b6(0x1f9)},{'name':'functionName','description':a1_0x4588b6(0x1d7)}],'queryParams':[],'bodySchema':a1_0x4588b6(0x1fb),'responseHighlights':['CLI\x20returns\x20appCode/functionName/description/version/gmtModified'],'examples':[a1_0x4588b6(0x1f3)],'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_0x4588b6(0x1f6)},{'code':'bf_execute','category':'bf','title':a1_0x4588b6(0x1ae),'method':a1_0x4588b6(0x200),'path':'/api/endpoint/{appCode}/{functionName}','summary':a1_0x4588b6(0x1ef),'whenToUse':'Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','pathParams':[{'name':a1_0x4588b6(0x1fa),'description':'Current\x20app\x20code'},{'name':'functionName','description':a1_0x4588b6(0x1c4)}],'queryParams':[],'bodySchema':a1_0x4588b6(0x1e5),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':[a1_0x4588b6(0x1e4)],'markdown':a1_0x4588b6(0x208)},{'code':'personal_bf_execute','category':'bf','title':a1_0x4588b6(0x1f1),'method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x1e0),'summary':a1_0x4588b6(0x19b),'whenToUse':a1_0x4588b6(0x1cf),'pathParams':[{'name':'id','description':a1_0x4588b6(0x1c6)}],'queryParams':[{'name':'appCode','description':a1_0x4588b6(0x1f9)}],'bodySchema':a1_0x4588b6(0x1e5),'responseHighlights':[a1_0x4588b6(0x1d3)],'examples':[a1_0x4588b6(0x1e6)],'notes':[a1_0x4588b6(0x206),a1_0x4588b6(0x1a3)],'markdown':['##\x20Execute\x20Personal\x20Backend\x20Function','',a1_0x4588b6(0x1cd)][a1_0x4588b6(0x1e2)]('\x0a')},{'code':'custom_sql_execute','category':a1_0x4588b6(0x1a6),'title':'Execute\x20custom\x20SQL','method':a1_0x4588b6(0x200),'path':a1_0x4588b6(0x19d),'summary':a1_0x4588b6(0x1a8),'whenToUse':a1_0x4588b6(0x205),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x4588b6(0x1c9)],'notes':[a1_0x4588b6(0x1b2)],'markdown':a1_0x4588b6(0x1b1)}];function entrySummary(_0x17d121){const _0xbdee41=a1_0x4588b6;return{'code':_0x17d121[_0xbdee41(0x214)],'category':_0x17d121[_0xbdee41(0x1b8)],'method':_0x17d121[_0xbdee41(0x1d0)],'path':_0x17d121[_0xbdee41(0x1c8)],'summary':_0x17d121[_0xbdee41(0x1cc)],'whenToUse':_0x17d121[_0xbdee41(0x1e9)]};}export function listApiDocEntries(_0x5beb81={}){const _0x52a74f=a1_0x4588b6,_0x351eff=String(_0x5beb81['category']||'')[_0x52a74f(0x1c1)](),_0x3fd01e=String(_0x5beb81[_0x52a74f(0x210)]||'')[_0x52a74f(0x1c1)]()[_0x52a74f(0x1fd)]();return DOCS['filter'](_0x460380=>{const _0xb743f6=_0x52a74f;if(_0x351eff&&_0x460380[_0xb743f6(0x1b8)]!==_0x351eff)return![];if(!_0x3fd01e)return!![];return[_0x460380[_0xb743f6(0x214)],_0x460380[_0xb743f6(0x1b8)],_0x460380[_0xb743f6(0x1d0)],_0x460380['path'],_0x460380[_0xb743f6(0x1cc)],_0x460380[_0xb743f6(0x1e9)],_0x460380[_0xb743f6(0x1f8)]]['join']('\x20')['toLowerCase']()[_0xb743f6(0x1ff)](_0x3fd01e);})['map'](entrySummary);}function a1_0x1ff0(_0x55bc81,_0x1058bf){_0x55bc81=_0x55bc81-0x199;const _0x433720=a1_0x4337();let _0x1ff0d4=_0x433720[_0x55bc81];return _0x1ff0d4;}export function getApiDocDetail(_0x591176){const _0x44478a=a1_0x4588b6,_0x178097=DOCS[_0x44478a(0x1a4)](_0x4a7bf8=>_0x4a7bf8[_0x44478a(0x214)]===_0x591176);if(!_0x178097)throw CliErrors[_0x44478a(0x19f)](_0x44478a(0x1f0)+_0x591176);return{..._0x178097};}const apiDocList={'service':'api-doc','command':a1_0x4588b6(0x1bb),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':a1_0x4588b6(0x1d2),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x50e6a1){const _0x3eaf6f=a1_0x4588b6,_0x16ce55=listApiDocEntries({'category':_0x50e6a1[_0x3eaf6f(0x1a0)](_0x3eaf6f(0x1b8)),'keyword':_0x50e6a1[_0x3eaf6f(0x1a0)]('keyword')});return{'ok':!![],'data':{'total':_0x16ce55[_0x3eaf6f(0x1a1)],'items':_0x16ce55}};}},apiDocDetail={'service':'api-doc','command':a1_0x4588b6(0x203),'description':a1_0x4588b6(0x20d),'risk':a1_0x4588b6(0x1d2),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x504133){const _0xece09f=a1_0x4588b6;return{'ok':!![],'data':getApiDocDetail(_0x504133[_0xece09f(0x1a0)](_0xece09f(0x214)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
@@ -1 +1 @@
1
- (function(_0x1968e1,_0x245c8f){const _0x5bec5f=a2_0x5352,_0x3506b3=_0x1968e1();while(!![]){try{const _0x3f0f9e=parseInt(_0x5bec5f(0x15e))/0x1+parseInt(_0x5bec5f(0x14f))/0x2*(-parseInt(_0x5bec5f(0x155))/0x3)+-parseInt(_0x5bec5f(0x14b))/0x4+parseInt(_0x5bec5f(0x15d))/0x5*(parseInt(_0x5bec5f(0x154))/0x6)+parseInt(_0x5bec5f(0x160))/0x7*(parseInt(_0x5bec5f(0x15c))/0x8)+-parseInt(_0x5bec5f(0x15a))/0x9*(parseInt(_0x5bec5f(0x153))/0xa)+-parseInt(_0x5bec5f(0x151))/0xb*(-parseInt(_0x5bec5f(0x14e))/0xc);if(_0x3f0f9e===_0x245c8f)break;else _0x3506b3['push'](_0x3506b3['shift']());}catch(_0x5d0d34){_0x3506b3['push'](_0x3506b3['shift']());}}}(a2_0x2b4b,0x82cf1));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a2_0x5352(_0x4097d0,_0x2a45c7){_0x4097d0=_0x4097d0-0x147;const _0x2b4b9f=a2_0x2b4b();let _0x5352d=_0x2b4b9f[_0x4097d0];return _0x5352d;}import{PRODUCT_CONFIG}from'../../constant/product.js';function a2_0x2b4b(){const _0xaa2ba9=['40acAXBs','1631545rHfpyq','189684tFxsDx','parse','1261477tBgdEi','utf8','trim','digest','ak_','hex','cache','sha256','1054496JMYVca','my-apps.json','code','132pFMpac','92RunBwz','EACCES','1219339WQEvpp','items','7829720PRzADn','6AseRrb','68739rMIBdI','EPERM','.tmp','appName','appCode','9AUkkDO','stringify'];a2_0x2b4b=function(){return _0xaa2ba9;};return a2_0x2b4b();}import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x1e8986){const _0x499414=a2_0x5352,_0x4d5331=_0x1e8986['trim'](),_0x2facf1=_0x4d5331['slice'](-0x6)||'unknown',_0x4af980=createHash(_0x499414(0x14a))['update'](_0x4d5331)[_0x499414(0x163)](_0x499414(0x148))['slice'](0x0,0xc);return _0x499414(0x147)+_0x2facf1+'_'+_0x4af980;}export function getAppCacheFilePath(_0x3bce32,_0x57992f){const _0x5013f6=a2_0x5352;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],_0x5013f6(0x149),_0x3bce32,fingerprintAccessKey(_0x57992f),_0x5013f6(0x14c));}export function readCachedAppList(_0x5bc82a,_0x246668){const _0x1976b6=a2_0x5352;if(!_0x246668?.[_0x1976b6(0x162)]())return null;const _0x264adc=getAppCacheFilePath(_0x5bc82a,_0x246668);if(!existsSync(_0x264adc))return null;try{const _0x27ce2b=readFileSync(_0x264adc,_0x1976b6(0x161));if(!_0x27ce2b[_0x1976b6(0x162)]())return null;const _0x1bab4c=JSON[_0x1976b6(0x15f)](_0x27ce2b);if(!Array['isArray'](_0x1bab4c[_0x1976b6(0x152)]))return null;return _0x1bab4c;}catch{return null;}}export function writeCachedAppList(_0x384838,_0x5d3c84,_0x56cafd){const _0x5854ef=a2_0x5352,_0x139856=getAppCacheFilePath(_0x384838,_0x5d3c84),_0x143c4c=dirname(_0x139856);!existsSync(_0x143c4c)&&mkdirSync(_0x143c4c,{'recursive':!![]});const _0x31a513=_0x139856+_0x5854ef(0x157);try{writeFileSync(_0x31a513,JSON[_0x5854ef(0x15b)](_0x56cafd,null,0x2)+'\x0a',{'encoding':_0x5854ef(0x161),'mode':0x180});try{renameSync(_0x31a513,_0x139856);}catch(_0x594f54){if(_0x594f54[_0x5854ef(0x14d)]===_0x5854ef(0x156)||_0x594f54['code']==='EXDEV'||_0x594f54[_0x5854ef(0x14d)]===_0x5854ef(0x150)){writeFileSync(_0x139856,JSON[_0x5854ef(0x15b)](_0x56cafd,null,0x2)+'\x0a',{'encoding':_0x5854ef(0x161)});try{unlinkSync(_0x31a513);}catch{}}else throw _0x594f54;}}catch(_0x315dd2){try{unlinkSync(_0x31a513);}catch{}throw _0x315dd2;}return _0x139856;}export function resolveCachedAppCode(_0x23f719,_0x2133c0,_0x30863c){const _0x5d76ec=a2_0x5352;if(!_0x23f719)return undefined;const _0x2d50b0=readCachedAppList(_0x2133c0,_0x30863c),_0x4dd20f=_0x2d50b0?.['items']['find'](_0x13467e=>_0x13467e[_0x5d76ec(0x158)]===_0x23f719&&isRuntimeAccessibleApp(_0x13467e));return _0x4dd20f?.[_0x5d76ec(0x159)]?.[_0x5d76ec(0x162)]()||undefined;}
1
+ (function(_0x33cce3,_0x508942){const _0x5f2105=a2_0x3ab7,_0xfefe15=_0x33cce3();while(!![]){try{const _0xbb36ef=-parseInt(_0x5f2105(0x128))/0x1+parseInt(_0x5f2105(0x13a))/0x2*(parseInt(_0x5f2105(0x134))/0x3)+-parseInt(_0x5f2105(0x12b))/0x4+-parseInt(_0x5f2105(0x13b))/0x5*(-parseInt(_0x5f2105(0x129))/0x6)+-parseInt(_0x5f2105(0x126))/0x7*(-parseInt(_0x5f2105(0x122))/0x8)+parseInt(_0x5f2105(0x132))/0x9*(parseInt(_0x5f2105(0x121))/0xa)+-parseInt(_0x5f2105(0x135))/0xb;if(_0xbb36ef===_0x508942)break;else _0xfefe15['push'](_0xfefe15['shift']());}catch(_0x2ede67){_0xfefe15['push'](_0xfefe15['shift']());}}}(a2_0x5f2a,0xe2199));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_0x3ab7(_0x2a19bb,_0x2d53ce){_0x2a19bb=_0x2a19bb-0x120;const _0x5f2af4=a2_0x5f2a();let _0x3ab702=_0x5f2af4[_0x2a19bb];return _0x3ab702;}export function fingerprintAccessKey(_0x3b3711){const _0x4eccf5=a2_0x3ab7,_0x300234=_0x3b3711[_0x4eccf5(0x12a)](),_0x29a04a=_0x300234['slice'](-0x6)||_0x4eccf5(0x125),_0xd9d058=createHash(_0x4eccf5(0x133))[_0x4eccf5(0x137)](_0x300234)[_0x4eccf5(0x120)](_0x4eccf5(0x139))[_0x4eccf5(0x138)](0x0,0xc);return'ak_'+_0x29a04a+'_'+_0xd9d058;}function a2_0x5f2a(){const _0x4b50f2=['821133XTKuPY','sha256','3XZfaYJ','17875737hbuYCr','isArray','update','slice','hex','2199466yGRMqo','590cCdbav','my-apps.json','EXDEV','appName','items','digest','30hisEjo','8CrrnNX','cache','code','unknown','11897431DNxmBz','stringify','164560FBSrlX','36228CvpCrm','trim','4279316ohgubx','homeDirName','EPERM','parse','EACCES','find','utf8'];a2_0x5f2a=function(){return _0x4b50f2;};return a2_0x5f2a();}export function getAppCacheFilePath(_0x29ee83,_0x33a303){const _0x4c1843=a2_0x3ab7;return resolve(homedir(),PRODUCT_CONFIG[_0x4c1843(0x12c)],_0x4c1843(0x123),_0x29ee83,fingerprintAccessKey(_0x33a303),_0x4c1843(0x13c));}export function readCachedAppList(_0x415236,_0xd13d5f){const _0x5005b2=a2_0x3ab7;if(!_0xd13d5f?.['trim']())return null;const _0x5a6eca=getAppCacheFilePath(_0x415236,_0xd13d5f);if(!existsSync(_0x5a6eca))return null;try{const _0x29aaa4=readFileSync(_0x5a6eca,_0x5005b2(0x131));if(!_0x29aaa4['trim']())return null;const _0x4cae10=JSON[_0x5005b2(0x12e)](_0x29aaa4);if(!Array[_0x5005b2(0x136)](_0x4cae10[_0x5005b2(0x13f)]))return null;return _0x4cae10;}catch{return null;}}export function writeCachedAppList(_0xf8de31,_0x15b28f,_0x41dbe9){const _0x18767d=a2_0x3ab7,_0xf363c8=getAppCacheFilePath(_0xf8de31,_0x15b28f),_0x4628f8=dirname(_0xf363c8);!existsSync(_0x4628f8)&&mkdirSync(_0x4628f8,{'recursive':!![]});const _0x3ea4eb=_0xf363c8+'.tmp';try{writeFileSync(_0x3ea4eb,JSON[_0x18767d(0x127)](_0x41dbe9,null,0x2)+'\x0a',{'encoding':_0x18767d(0x131),'mode':0x180});try{renameSync(_0x3ea4eb,_0xf363c8);}catch(_0x59214e){if(_0x59214e[_0x18767d(0x124)]===_0x18767d(0x12d)||_0x59214e[_0x18767d(0x124)]===_0x18767d(0x13d)||_0x59214e[_0x18767d(0x124)]===_0x18767d(0x12f)){writeFileSync(_0xf363c8,JSON[_0x18767d(0x127)](_0x41dbe9,null,0x2)+'\x0a',{'encoding':_0x18767d(0x131)});try{unlinkSync(_0x3ea4eb);}catch{}}else throw _0x59214e;}}catch(_0x110f9b){try{unlinkSync(_0x3ea4eb);}catch{}throw _0x110f9b;}return _0xf363c8;}export function resolveCachedAppCode(_0xca1ebd,_0x543b27,_0x289cc1){const _0x4fd055=a2_0x3ab7;if(!_0xca1ebd)return undefined;const _0x425df1=readCachedAppList(_0x543b27,_0x289cc1),_0x4822f9=_0x425df1?.[_0x4fd055(0x13f)][_0x4fd055(0x130)](_0x173e70=>_0x173e70[_0x4fd055(0x13e)]===_0xca1ebd&&isRuntimeAccessibleApp(_0x173e70));return _0x4822f9?.['appCode']?.[_0x4fd055(0x12a)]()||undefined;}
@@ -1 +1 @@
1
- const a3_0x3793c6=a3_0x2018;function a3_0x1443(){const _0x3e8735=['env','bool','../../commands/app/remote-source.js','81sICaSu','5118477DtrxPv','Loaded\x20','1614624eHYWyd','399YpgRUH','type','isArray','appName','Reads\x20the\x20given\x20.rabetbase.json\x20and\x20imports\x20a\x20usable\x20default\x20app\x20into\x20local\x20.lovrabet.json.\x20Matching\x20keys\x20may\x20be\x20updated.','production','625840qQmXYY','No\x20apps\x20found\x20on\x20the\x20platform.','include-unpublished','i18nInfo','Filter\x20by\x20environment\x20(default:\x20current\x20env)','enableI18n','2045490gouoGC','cache','name','find','Include\x20unpublished\x20apps\x20for\x20diagnostics','Reads\x20the\x20apps\x20available\x20to\x20the\x20current\x20account\x20and\x20overwrites\x20the\x20local\x20app\x20cache\x20for\x20that\x20environment.\x20Platform\x20apps\x20are\x20not\x20modified.','import','filter','str','793536JufIHe','fetchedAt','length','app','1842504zVlfnN','items','boolean','map','Target\x20environment\x20(default:\x20current\x20env)','source','No\x20cached\x20apps\x20found.','envName','projectPath','no-cache','remote','trim','globalPath','string','list','cachePath','local','read','appcode','nonInteractive','\x20app(s)\x20for\x20env=\x22','Read\x20app\x20list\x20from\x20local\x20cache\x20only','isCurrent','accessKey','../../context.js','langs','appCode','appOwnerName','2522BEyRpV'];a3_0x1443=function(){return _0x3e8735;};return a3_0x1443();}(function(_0x587d1a,_0x3db96e){const _0x49e538=a3_0x2018,_0x4ab6e6=_0x587d1a();while(!![]){try{const _0x57d625=-parseInt(_0x49e538(0xd9))/0x1+-parseInt(_0x49e538(0x108))/0x2*(-parseInt(_0x49e538(0xd3))/0x3)+-parseInt(_0x49e538(0xec))/0x4+-parseInt(_0x49e538(0xdf))/0x5+parseInt(_0x49e538(0xd2))/0x6+parseInt(_0x49e538(0xd0))/0x7+-parseInt(_0x49e538(0xe8))/0x8*(-parseInt(_0x49e538(0xcf))/0x9);if(_0x57d625===_0x3db96e)break;else _0x4ab6e6['push'](_0x4ab6e6['shift']());}catch(_0x41a028){_0x4ab6e6['push'](_0x4ab6e6['shift']());}}}(a3_0x1443,0x89fc8));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(_0x48f745,_0x50012f){const _0x489883=a3_0x2018,_0x29832c={};for(const _0x795907 of _0x50012f){const _0x1ebe0d=_0x795907[_0x489883(0xd4)]===_0x489883(0xee)?_0x48f745[_0x489883(0xcd)](_0x795907['name']):_0x48f745['str'](_0x795907[_0x489883(0xe1)]);if(_0x1ebe0d!==''&&_0x1ebe0d!==![])_0x29832c[_0x795907[_0x489883(0xe1)]]=_0x1ebe0d;}if(_0x48f745[_0x489883(0xff)])_0x29832c[_0x489883(0xff)]=!![];return _0x29832c;}function normalizeLanguages(_0x44f2a8){const _0x537aa7=a3_0x2018;if(!Array[_0x537aa7(0xd5)](_0x44f2a8))return[];return _0x44f2a8[_0x537aa7(0xe6)](_0x1b5fb2=>typeof _0x1b5fb2===_0x537aa7(0xf9))[_0x537aa7(0xef)](_0xbe3344=>_0xbe3344['trim']())[_0x537aa7(0xe6)](Boolean);}function buildRemoteAppI18nFields(_0x3aa047){const _0x4857d1=a3_0x2018,_0x2a04de=normalizeLanguages(_0x3aa047[_0x4857d1(0xdc)]?.[_0x4857d1(0x105)]);return{'enableI18n':typeof _0x3aa047[_0x4857d1(0xde)]===_0x4857d1(0xee)?_0x3aa047[_0x4857d1(0xde)]:null,'languages':_0x2a04de,'i18nInfo':_0x3aa047[_0x4857d1(0xdc)]?{..._0x3aa047['i18nInfo'],'langs':_0x2a04de['length']?_0x2a04de:null}:null};}const listDef={'service':a3_0x3793c6(0xeb),'command':a3_0x3793c6(0xfa),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':a3_0x3793c6(0xfd),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x3793c6(0xcc),'type':a3_0x3793c6(0xf9),'description':a3_0x3793c6(0xdd),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x3793c6(0xee),'description':a3_0x3793c6(0x101),'default':![]},{'name':'no-cache','type':a3_0x3793c6(0xee),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]},{'name':a3_0x3793c6(0xdb),'type':a3_0x3793c6(0xee),'description':a3_0x3793c6(0xe3),'default':![]}],async 'execute'(_0x5cb3c5){const _0x564d9f=a3_0x3793c6,_0x27ba0d=_0x5cb3c5[_0x564d9f(0xe7)]('env')||_0x5cb3c5[_0x564d9f(0xf3)]||getEnv()||'production',_0x215151=_0x5cb3c5[_0x564d9f(0xcd)](_0x564d9f(0xfc)),_0x3b9bdb=_0x5cb3c5['bool'](_0x564d9f(0xf5)),_0x4b4e99=_0x5cb3c5['bool'](_0x564d9f(0xdb)),{readRawConfigWithLayers:_0x15cff9,resolveDefaultAppSource:_0x4eddde,getLocalAppAliases:_0x30ab62}=await import(_0x564d9f(0x104)),{getRemoteAppList:_0x1ca381}=await import('../../commands/app/remote-source.js'),{config:_0x4fcd4c,layers:_0x3905bd}=_0x15cff9(),_0x59fb3d=_0x4eddde(_0x3905bd),{defaultApp:_0x516005}=_0x4fcd4c,_0x8da383=await _0x1ca381({'env':_0x27ba0d,'accessKey':_0x5cb3c5[_0x564d9f(0x103)],'localOnly':_0x215151,'noCache':_0x3b9bdb}),_0x5d7f87=_0x4b4e99?_0x8da383[_0x564d9f(0xed)]:filterRuntimeAccessibleApps(_0x8da383['items']),_0x400805=_0x8da383['items'][_0x564d9f(0xea)]-_0x5d7f87['length'],_0x7d5e97=_0x5d7f87['map'](_0x396ab2=>{const _0x3e684a=_0x564d9f;return{'name':_0x396ab2[_0x3e684a(0xd6)],'appcode':_0x396ab2[_0x3e684a(0x106)],'named':!![],'definedIn':_0x3e684a(0xf6),'isDefault':_0x396ab2[_0x3e684a(0xd6)]===_0x516005,...buildAppProfileListFields(_0x27ba0d),...buildRemoteAppI18nFields(_0x396ab2),'source':_0x8da383[_0x3e684a(0xf1)],'owner':_0x396ab2[_0x3e684a(0x107)]??null,'status':_0x396ab2['appPublishStatus']??null,'cachedAt':_0x8da383[_0x3e684a(0xe9)]};}),_0x197da3=_0x30ab62(_0x4fcd4c);let _0x1240f8=0x0;for(const [_0x5835dc,_0xf22c89]of Object['entries'](_0x197da3)){const _0x52ea2b=typeof _0xf22c89['appcode']===_0x564d9f(0xf9)?_0xf22c89[_0x564d9f(0xfe)][_0x564d9f(0xf7)]():'';if(!_0x52ea2b)continue;const _0xb69c82=findAppByCode(_0x8da383['items'],_0x52ea2b);if(!_0x4b4e99&&_0xb69c82&&!isRuntimeAccessibleApp(_0xb69c82))continue;_0x1240f8+=0x1,_0x7d5e97['push']({'name':_0x5835dc,'appcode':_0x52ea2b,'named':!![],'definedIn':_0x564d9f(0xfc),'isDefault':_0x5835dc===_0x516005,...buildAppProfileListFields(_0x27ba0d),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x7d5e97,_0x5cb3c5['mergedCli']);const _0x15c73a=_0x7d5e97[_0x564d9f(0xe2)](_0xfdd71f=>_0xfdd71f[_0x564d9f(0x102)]===!![]),_0x48f4d5=_0x516005??_0x15c73a?.[_0x564d9f(0xe1)]??null,_0x5b9803={'env':_0x27ba0d,'source':_0x8da383[_0x564d9f(0xf1)],'fetchedAt':_0x8da383[_0x564d9f(0xe9)],'cachePath':_0x8da383[_0x564d9f(0xfb)],'globalPath':_0x3905bd[_0x564d9f(0xf8)]??null,'projectPath':_0x3905bd[_0x564d9f(0xf4)]??null,'defaultApp':_0x48f4d5,'defaultAppSource':_0x516005!=null?_0x59fb3d:null,'localAliasCount':_0x1240f8,'remoteTotal':_0x8da383[_0x564d9f(0xed)]['length'],'hiddenUnpublishedCount':_0x400805,'includeUnpublished':_0x4b4e99};if(_0x7d5e97[_0x564d9f(0xea)]===0x0)return{'ok':!![],'data':{'items':_0x7d5e97,'meta':_0x5b9803},'message':_0x8da383['source']===_0x564d9f(0xe0)?_0x564d9f(0xf2):_0x564d9f(0xda)};return{'ok':!![],'data':{'items':_0x7d5e97,'meta':_0x5b9803}};}},pullDef={'service':a3_0x3793c6(0xeb),'command':'pull','description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':'write','confirmationDescription':a3_0x3793c6(0xe4),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x3793c6(0xcc),'type':a3_0x3793c6(0xf9),'description':a3_0x3793c6(0xf0),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':'boolean','description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x3793c6(0xf5),'type':a3_0x3793c6(0xee),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x32039b){const _0x33b8b8=a3_0x3793c6,_0x11acc9=_0x32039b['str'](_0x33b8b8(0xcc))||_0x32039b[_0x33b8b8(0xf3)]||getEnv()||_0x33b8b8(0xd8),_0x205166=_0x32039b[_0x33b8b8(0xcd)](_0x33b8b8(0xfc)),_0x47e243=_0x32039b[_0x33b8b8(0xcd)](_0x33b8b8(0xf5)),{getRemoteAppList:_0x5db62c}=await import(_0x33b8b8(0xce)),_0x142845=await _0x5db62c({'env':_0x11acc9,'accessKey':_0x32039b['accessKey'],'localOnly':_0x205166,'noCache':_0x47e243});return{'ok':!![],'data':{'total':_0x142845[_0x33b8b8(0xed)][_0x33b8b8(0xea)],'env':_0x11acc9,'source':_0x142845[_0x33b8b8(0xf1)],'fetchedAt':_0x142845[_0x33b8b8(0xe9)],'cachePath':_0x142845['cachePath']},'message':_0x142845[_0x33b8b8(0xf1)]===_0x33b8b8(0xe0)?_0x33b8b8(0xd1)+_0x142845[_0x33b8b8(0xed)][_0x33b8b8(0xea)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x11acc9+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0x142845[_0x33b8b8(0xed)]['length']+_0x33b8b8(0x100)+_0x11acc9+'\x22.'};}},importDef={'service':a3_0x3793c6(0xeb),'command':a3_0x3793c6(0xe5),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':'write','confirmationDescription':a3_0x3793c6(0xd7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x237418){return await runAppImport(collectFlags(_0x237418,appImportFlagDefs)),{'ok':!![]};}};function a3_0x2018(_0x534f6d,_0x356be9){_0x534f6d=_0x534f6d-0xcc;const _0x144333=a3_0x1443();let _0x20181e=_0x144333[_0x534f6d];return _0x20181e;}export const appDefinitions=[listDef,pullDef,importDef];
1
+ const a3_0x5612e6=a3_0x341a;(function(_0x4a658d,_0x21c0aa){const _0x346875=a3_0x341a,_0x4dff90=_0x4a658d();while(!![]){try{const _0x312b03=-parseInt(_0x346875(0x10c))/0x1+-parseInt(_0x346875(0xe4))/0x2*(parseInt(_0x346875(0xd9))/0x3)+parseInt(_0x346875(0xfc))/0x4*(parseInt(_0x346875(0x103))/0x5)+parseInt(_0x346875(0xe0))/0x6+-parseInt(_0x346875(0xf8))/0x7+parseInt(_0x346875(0x107))/0x8*(parseInt(_0x346875(0x105))/0x9)+parseInt(_0x346875(0xff))/0xa*(-parseInt(_0x346875(0xd4))/0xb);if(_0x312b03===_0x21c0aa)break;else _0x4dff90['push'](_0x4dff90['shift']());}catch(_0x5eb307){_0x4dff90['push'](_0x4dff90['shift']());}}}(a3_0x2ff1,0xaf3b4));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';function a3_0x2ff1(){const _0x237f4a=['5121492UxvRYC','Include\x20unpublished\x20apps\x20for\x20diagnostics','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','config','62UbWdvV','nonInteractive','envName','fetchedAt','isCurrent','write','list','map','Reads\x20the\x20given\x20.rabetbase.json\x20and\x20imports\x20a\x20usable\x20default\x20app\x20into\x20local\x20.lovrabet.json.\x20Matching\x20keys\x20may\x20be\x20updated.','production','string','\x20cached\x20app(s)\x20for\x20env=\x22','source','no-cache','mergedCli','globalPath','No\x20apps\x20found\x20on\x20the\x20platform.','appPublishStatus','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','bool','7527506cDjbSu','env','pull','../../context.js','4jcZhKt','items','Loaded\x20','10MxJRIx','i18nInfo','entries','accessKey','6483025GTUVNi','include-unpublished','3989691uGTHWp','enableI18n','24gtoWtN','read','../../commands/app/remote-source.js','name','boolean','279133BqXqan','filter','Filter\x20by\x20environment\x20(default:\x20current\x20env)','remote','length','2534774WnNALd','appOwnerName','projectPath','cachePath','app','113943JIKYtT','Read\x20from\x20local\x20cache\x20only','appcode','local','appName','str','cache'];a3_0x2ff1=function(){return _0x237f4a;};return a3_0x2ff1();}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x5650eb,_0x448c59){const _0x302362=a3_0x341a,_0x203be0={};for(const _0x34b449 of _0x448c59){const _0x4c10b7=_0x34b449['type']==='boolean'?_0x5650eb[_0x302362(0xf7)](_0x34b449[_0x302362(0x10a)]):_0x5650eb[_0x302362(0xde)](_0x34b449[_0x302362(0x10a)]);if(_0x4c10b7!==''&&_0x4c10b7!==![])_0x203be0[_0x34b449[_0x302362(0x10a)]]=_0x4c10b7;}if(_0x5650eb[_0x302362(0xe5)])_0x203be0[_0x302362(0xe5)]=!![];return _0x203be0;}function a3_0x341a(_0x1c1307,_0x100818){_0x1c1307=_0x1c1307-0xd3;const _0x2ff114=a3_0x2ff1();let _0x341aa6=_0x2ff114[_0x1c1307];return _0x341aa6;}function normalizeLanguages(_0x31cc99){const _0x137553=a3_0x341a;if(!Array['isArray'](_0x31cc99))return[];return _0x31cc99[_0x137553(0x10d)](_0x3cc5b3=>typeof _0x3cc5b3===_0x137553(0xee))[_0x137553(0xeb)](_0x219d7c=>_0x219d7c['trim']())[_0x137553(0x10d)](Boolean);}function buildRemoteAppI18nFields(_0x567bbe){const _0x2a33bd=a3_0x341a,_0x4b8fbd=normalizeLanguages(_0x567bbe[_0x2a33bd(0x100)]?.['langs']);return{'enableI18n':typeof _0x567bbe[_0x2a33bd(0x106)]==='boolean'?_0x567bbe[_0x2a33bd(0x106)]:null,'languages':_0x4b8fbd,'i18nInfo':_0x567bbe['i18nInfo']?{..._0x567bbe[_0x2a33bd(0x100)],'langs':_0x4b8fbd['length']?_0x4b8fbd:null}:null};}const listDef={'service':a3_0x5612e6(0xd8),'command':a3_0x5612e6(0xea),'description':a3_0x5612e6(0xe2),'risk':a3_0x5612e6(0x108),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':a3_0x5612e6(0xee),'description':a3_0x5612e6(0x10e),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x5612e6(0xdc),'type':a3_0x5612e6(0x10b),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x5612e6(0xf1),'type':'boolean','description':a3_0x5612e6(0xf6),'default':![]},{'name':a3_0x5612e6(0x104),'type':a3_0x5612e6(0x10b),'description':a3_0x5612e6(0xe1),'default':![]}],async 'execute'(_0x23e334){const _0x181a8b=a3_0x5612e6,_0xf2d7f9=_0x23e334[_0x181a8b(0xde)](_0x181a8b(0xf9))||_0x23e334[_0x181a8b(0xe6)]||getEnv()||_0x181a8b(0xed),_0x7b4412=_0x23e334[_0x181a8b(0xf7)](_0x181a8b(0xdc)),_0xc3c92a=_0x23e334[_0x181a8b(0xf7)](_0x181a8b(0xf1)),_0x153c6a=_0x23e334[_0x181a8b(0xf7)](_0x181a8b(0x104)),{readRawConfigWithLayers:_0x1c6358,resolveDefaultAppSource:_0x1d05ab,getLocalAppAliases:_0x1872e5}=await import(_0x181a8b(0xfb)),{getRemoteAppList:_0x210921}=await import(_0x181a8b(0x109)),{config:_0x343937,layers:_0xe8bec2}=_0x1c6358(),_0x531740=_0x1d05ab(_0xe8bec2),{defaultApp:_0x16b6e6}=_0x343937,_0x168c32=await _0x210921({'env':_0xf2d7f9,'accessKey':_0x23e334[_0x181a8b(0x102)],'localOnly':_0x7b4412,'noCache':_0xc3c92a}),_0x44f2f8=_0x153c6a?_0x168c32[_0x181a8b(0xfd)]:filterRuntimeAccessibleApps(_0x168c32[_0x181a8b(0xfd)]),_0x9a8faf=_0x168c32[_0x181a8b(0xfd)][_0x181a8b(0xd3)]-_0x44f2f8[_0x181a8b(0xd3)],_0x54e92b=_0x44f2f8[_0x181a8b(0xeb)](_0x2b2a74=>{const _0x52b214=_0x181a8b;return{'name':_0x2b2a74[_0x52b214(0xdd)],'appcode':_0x2b2a74['appCode'],'named':!![],'definedIn':_0x52b214(0x10f),'isDefault':_0x2b2a74[_0x52b214(0xdd)]===_0x16b6e6,...buildAppProfileListFields(_0xf2d7f9),...buildRemoteAppI18nFields(_0x2b2a74),'source':_0x168c32[_0x52b214(0xf0)],'owner':_0x2b2a74[_0x52b214(0xd5)]??null,'status':_0x2b2a74[_0x52b214(0xf5)]??null,'cachedAt':_0x168c32[_0x52b214(0xe7)]};}),_0x360ef1=_0x1872e5(_0x343937);let _0x55147f=0x0;for(const [_0x13821,_0x4b08b2]of Object[_0x181a8b(0x101)](_0x360ef1)){const _0x522324=typeof _0x4b08b2[_0x181a8b(0xdb)]===_0x181a8b(0xee)?_0x4b08b2[_0x181a8b(0xdb)]['trim']():'';if(!_0x522324)continue;const _0x3a21a4=findAppByCode(_0x168c32[_0x181a8b(0xfd)],_0x522324);if(!_0x153c6a&&_0x3a21a4&&!isRuntimeAccessibleApp(_0x3a21a4))continue;_0x55147f+=0x1,_0x54e92b['push']({'name':_0x13821,'appcode':_0x522324,'named':!![],'definedIn':'local','isDefault':_0x13821===_0x16b6e6,...buildAppProfileListFields(_0xf2d7f9),'source':_0x181a8b(0xe3),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x54e92b,_0x23e334[_0x181a8b(0xf2)]);const _0x4a7141=_0x54e92b['find'](_0x14a4fc=>_0x14a4fc[_0x181a8b(0xe8)]===!![]),_0x54917c=_0x16b6e6??_0x4a7141?.[_0x181a8b(0x10a)]??null,_0x4a610b={'env':_0xf2d7f9,'source':_0x168c32['source'],'fetchedAt':_0x168c32[_0x181a8b(0xe7)],'cachePath':_0x168c32[_0x181a8b(0xd7)],'globalPath':_0xe8bec2[_0x181a8b(0xf3)]??null,'projectPath':_0xe8bec2[_0x181a8b(0xd6)]??null,'defaultApp':_0x54917c,'defaultAppSource':_0x16b6e6!=null?_0x531740:null,'localAliasCount':_0x55147f,'remoteTotal':_0x168c32[_0x181a8b(0xfd)]['length'],'hiddenUnpublishedCount':_0x9a8faf,'includeUnpublished':_0x153c6a};if(_0x54e92b[_0x181a8b(0xd3)]===0x0)return{'ok':!![],'data':{'items':_0x54e92b,'meta':_0x4a610b},'message':_0x168c32[_0x181a8b(0xf0)]===_0x181a8b(0xdf)?'No\x20cached\x20apps\x20found.':_0x181a8b(0xf4)};return{'ok':!![],'data':{'items':_0x54e92b,'meta':_0x4a610b}};}},pullDef={'service':a3_0x5612e6(0xd8),'command':a3_0x5612e6(0xfa),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x5612e6(0xe9),'confirmationDescription':'Reads\x20the\x20apps\x20available\x20to\x20the\x20current\x20account\x20and\x20overwrites\x20the\x20local\x20app\x20cache\x20for\x20that\x20environment.\x20Platform\x20apps\x20are\x20not\x20modified.','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x5612e6(0xf9),'type':a3_0x5612e6(0xee),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x5612e6(0xdc),'type':a3_0x5612e6(0x10b),'description':a3_0x5612e6(0xda),'default':![]},{'name':a3_0x5612e6(0xf1),'type':a3_0x5612e6(0x10b),'description':a3_0x5612e6(0xf6),'default':![]}],async 'execute'(_0x413ac8){const _0x402c2c=a3_0x5612e6,_0x12832e=_0x413ac8[_0x402c2c(0xde)]('env')||_0x413ac8[_0x402c2c(0xe6)]||getEnv()||_0x402c2c(0xed),_0x475ace=_0x413ac8['bool'](_0x402c2c(0xdc)),_0x38629b=_0x413ac8[_0x402c2c(0xf7)](_0x402c2c(0xf1)),{getRemoteAppList:_0x189604}=await import(_0x402c2c(0x109)),_0x42a54a=await _0x189604({'env':_0x12832e,'accessKey':_0x413ac8[_0x402c2c(0x102)],'localOnly':_0x475ace,'noCache':_0x38629b});return{'ok':!![],'data':{'total':_0x42a54a['items'][_0x402c2c(0xd3)],'env':_0x12832e,'source':_0x42a54a['source'],'fetchedAt':_0x42a54a['fetchedAt'],'cachePath':_0x42a54a[_0x402c2c(0xd7)]},'message':_0x42a54a[_0x402c2c(0xf0)]===_0x402c2c(0xdf)?_0x402c2c(0xfe)+_0x42a54a[_0x402c2c(0xfd)]['length']+_0x402c2c(0xef)+_0x12832e+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0x42a54a[_0x402c2c(0xfd)][_0x402c2c(0xd3)]+'\x20app(s)\x20for\x20env=\x22'+_0x12832e+'\x22.'};}},importDef={'service':a3_0x5612e6(0xd8),'command':'import','description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x5612e6(0xe9),'confirmationDescription':a3_0x5612e6(0xec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x5a43b7){return await runAppImport(collectFlags(_0x5a43b7,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
@@ -1 +1 @@
1
- (function(_0x5ada23,_0x3d47e9){const _0x21aeed=a4_0x3c7d,_0x74fdf2=_0x5ada23();while(!![]){try{const _0x1b2f22=parseInt(_0x21aeed(0xbb))/0x1+parseInt(_0x21aeed(0xc8))/0x2*(parseInt(_0x21aeed(0xc5))/0x3)+parseInt(_0x21aeed(0xc2))/0x4*(-parseInt(_0x21aeed(0xc0))/0x5)+-parseInt(_0x21aeed(0xcf))/0x6+-parseInt(_0x21aeed(0xcc))/0x7+-parseInt(_0x21aeed(0xb9))/0x8*(-parseInt(_0x21aeed(0xbc))/0x9)+-parseInt(_0x21aeed(0xcd))/0xa*(-parseInt(_0x21aeed(0xc3))/0xb);if(_0x1b2f22===_0x3d47e9)break;else _0x74fdf2['push'](_0x74fdf2['shift']());}catch(_0x9f802a){_0x74fdf2['push'](_0x74fdf2['shift']());}}}(a4_0x195b,0xc3d68));function a4_0x195b(){const _0x2dc80f=['27KrTYBp','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','trim','.\x20Publish\x20the\x20app\x20before\x20using\x20','1435CXYKIv','UNKNOWN','21064PAgckg','204149QZQBcD','validation','41163woaYyk','Current\x20status:\x20','appName','86CVFeZF','filter','find','string','10189704TZFFCo','970FtTFSP','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','3220290GCtObN','1596552PWjanc','appPublishStatus','1316948OoaYiZ'];a4_0x195b=function(){return _0x2dc80f;};return a4_0x195b();}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(_0x53dd0b){const _0x46cda9=a4_0x3c7d;if(typeof _0x53dd0b!==_0x46cda9(0xcb))return null;const _0x3d6054=_0x53dd0b['trim']();return _0x3d6054?_0x3d6054['toUpperCase']():null;}function a4_0x3c7d(_0x587760,_0x3a610e){_0x587760=_0x587760-0xb9;const _0x195bca=a4_0x195b();let _0x3c7d22=_0x195bca[_0x587760];return _0x3c7d22;}export function isRuntimeAccessibleApp(_0x599631){const _0x5b7773=a4_0x3c7d;return normalizeAppPublishStatus(_0x599631[_0x5b7773(0xba)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x1391fb){const _0x3e8fe1=a4_0x3c7d;return _0x1391fb[_0x3e8fe1(0xc9)](isRuntimeAccessibleApp);}export function findAppByName(_0x59c6b4,_0x207d42){const _0x599475=a4_0x3c7d;return _0x59c6b4[_0x599475(0xca)](_0x1f4b44=>_0x1f4b44[_0x599475(0xc7)]===_0x207d42);}export function findAppByCode(_0x593a1f,_0x4d4c8f){const _0x2bcc9d=a4_0x3c7d,_0x1456cc=_0x4d4c8f[_0x2bcc9d(0xbe)]();if(!_0x1456cc)return undefined;return _0x593a1f[_0x2bcc9d(0xca)](_0x431535=>_0x431535['appCode']?.[_0x2bcc9d(0xbe)]()===_0x1456cc);}export function runtimeInaccessibleAppError(_0x5b09ad,_0xb98ee9){const _0x695c7=a4_0x3c7d,_0x4f6b29=normalizeAppPublishStatus(_0x5b09ad['appPublishStatus'])??_0x695c7(0xc1);return CliErrors[_0x695c7(0xc4)]('App\x20'+_0xb98ee9+_0x695c7(0xbd),_0x695c7(0xc6)+_0x4f6b29+_0x695c7(0xbf)+CLI_BIN_NAME+_0x695c7(0xce));}
1
+ function a4_0x2efe(_0x5ca669,_0x22d1cd){_0x5ca669=_0x5ca669-0x168;const _0x3dcf60=a4_0x3dcf();let _0x2efe13=_0x3dcf60[_0x5ca669];return _0x2efe13;}(function(_0x3c9657,_0xbeeda9){const _0x116d77=a4_0x2efe,_0x2a9918=_0x3c9657();while(!![]){try{const _0x435cec=-parseInt(_0x116d77(0x172))/0x1+-parseInt(_0x116d77(0x169))/0x2+-parseInt(_0x116d77(0x173))/0x3*(-parseInt(_0x116d77(0x171))/0x4)+-parseInt(_0x116d77(0x170))/0x5*(-parseInt(_0x116d77(0x177))/0x6)+parseInt(_0x116d77(0x176))/0x7+parseInt(_0x116d77(0x17c))/0x8*(parseInt(_0x116d77(0x17d))/0x9)+-parseInt(_0x116d77(0x174))/0xa;if(_0x435cec===_0xbeeda9)break;else _0x2a9918['push'](_0x2a9918['shift']());}catch(_0x5c15a8){_0x2a9918['push'](_0x2a9918['shift']());}}}(a4_0x3dcf,0x774bd));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(_0x514e07){const _0x1e4182=a4_0x2efe;if(typeof _0x514e07!==_0x1e4182(0x16a))return null;const _0x3b493f=_0x514e07[_0x1e4182(0x17a)]();return _0x3b493f?_0x3b493f[_0x1e4182(0x17b)]():null;}export function isRuntimeAccessibleApp(_0x1043e0){const _0x1a30ee=a4_0x2efe;return normalizeAppPublishStatus(_0x1043e0[_0x1a30ee(0x178)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x36adb6){const _0xf14af6=a4_0x2efe;return _0x36adb6[_0xf14af6(0x16f)](isRuntimeAccessibleApp);}export function findAppByName(_0x1d7865,_0x20323f){const _0x317671=a4_0x2efe;return _0x1d7865[_0x317671(0x16b)](_0x706a06=>_0x706a06[_0x317671(0x16e)]===_0x20323f);}export function findAppByCode(_0x551bca,_0x2ae385){const _0x3eb343=a4_0x2efe,_0x318779=_0x2ae385['trim']();if(!_0x318779)return undefined;return _0x551bca[_0x3eb343(0x16b)](_0x4743cd=>_0x4743cd[_0x3eb343(0x179)]?.[_0x3eb343(0x17a)]()===_0x318779);}function a4_0x3dcf(){const _0x19db3a=['appPublishStatus','appCode','trim','toUpperCase','24BmyCSs','183015ehgDvZ','.\x20Publish\x20the\x20app\x20before\x20using\x20','209810vHZbss','string','find','App\x20','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','appName','filter','5OdSpUv','20620avukbz','27821AsUUsv','150MZpUkw','216050rVyxFJ','validation','2184259ixnMWT','73056sZqZuv'];a4_0x3dcf=function(){return _0x19db3a;};return a4_0x3dcf();}export function runtimeInaccessibleAppError(_0x4dd4d6,_0x44688e){const _0x1750a5=a4_0x2efe,_0x2029dd=normalizeAppPublishStatus(_0x4dd4d6[_0x1750a5(0x178)])??'UNKNOWN';return CliErrors[_0x1750a5(0x175)](_0x1750a5(0x16c)+_0x44688e+_0x1750a5(0x16d),'Current\x20status:\x20'+_0x2029dd+_0x1750a5(0x168)+CLI_BIN_NAME+'\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.');}
@@ -1 +1 @@
1
- (function(_0x262d84,_0x4142c4){const _0x5ea4f3=a5_0x15c0,_0x446dc0=_0x262d84();while(!![]){try{const _0x33e2df=parseInt(_0x5ea4f3(0x187))/0x1+-parseInt(_0x5ea4f3(0x185))/0x2+parseInt(_0x5ea4f3(0x17b))/0x3+-parseInt(_0x5ea4f3(0x188))/0x4+-parseInt(_0x5ea4f3(0x17a))/0x5+parseInt(_0x5ea4f3(0x17f))/0x6*(-parseInt(_0x5ea4f3(0x184))/0x7)+-parseInt(_0x5ea4f3(0x183))/0x8*(-parseInt(_0x5ea4f3(0x180))/0x9);if(_0x33e2df===_0x4142c4)break;else _0x446dc0['push'](_0x446dc0['shift']());}catch(_0x3bf489){_0x446dc0['push'](_0x446dc0['shift']());}}}(a5_0x5c72,0xb8744));import{fileURLToPath}from'url';import{dirname,join}from'path';function a5_0x5c72(){const _0x11311e=['1874296cBTsUe','../../../mock/app-list.json','57898JmqahK','5806812JfZgFI','parse','4540230JbhZok','220419FOOeQJ','errorCode','utf-8','errorMsg','25482SBUemA','80559YcLkai','success','tableData','3736XknwEF','427FvLzcM'];a5_0x5c72=function(){return _0x11311e;};return a5_0x5c72();}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x4ec60d=a5_0x15c0,_0x5b489a=join(__dirname,_0x4ec60d(0x186)),_0x245a09=readFileSync(_0x5b489a,_0x4ec60d(0x17d));return JSON[_0x4ec60d(0x179)](_0x245a09);}let _cached=null;function a5_0x15c0(_0x3db260,_0x736b00){_0x3db260=_0x3db260-0x179;const _0x5c72f0=a5_0x5c72();let _0x15c08e=_0x5c72f0[_0x3db260];return _0x15c08e;}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x15ce9f=a5_0x15c0,_0x1ce808=getMockAppList();if(!_0x1ce808[_0x15ce9f(0x181)])throw new Error('Mock\x20API\x20error:\x20'+_0x1ce808[_0x15ce9f(0x17e)]+'\x20('+_0x1ce808[_0x15ce9f(0x17c)]+')');return _0x1ce808['data'][_0x15ce9f(0x182)];}
1
+ (function(_0x2ac9a4,_0x56f81f){const _0x2a4bfd=a5_0x4a94,_0x21ab3b=_0x2ac9a4();while(!![]){try{const _0x55736f=parseInt(_0x2a4bfd(0x117))/0x1+-parseInt(_0x2a4bfd(0x11a))/0x2+parseInt(_0x2a4bfd(0x110))/0x3*(-parseInt(_0x2a4bfd(0x111))/0x4)+parseInt(_0x2a4bfd(0x119))/0x5*(parseInt(_0x2a4bfd(0x116))/0x6)+parseInt(_0x2a4bfd(0x10b))/0x7+-parseInt(_0x2a4bfd(0x10c))/0x8*(parseInt(_0x2a4bfd(0x10a))/0x9)+parseInt(_0x2a4bfd(0x112))/0xa;if(_0x55736f===_0x56f81f)break;else _0x21ab3b['push'](_0x21ab3b['shift']());}catch(_0x5932c0){_0x21ab3b['push'](_0x21ab3b['shift']());}}}(a5_0x286a,0x1d22d));import{fileURLToPath}from'url';import{dirname,join}from'path';function a5_0x286a(){const _0x2f3861=['errorMsg','data','334128zwwVZf','182623EwNhqx','../../../mock/app-list.json','10jxFhpg','222000UtBhCq','673749oJELEh','383131TBumRF','8LwSZUY','utf-8','success','errorCode','26886VsUWRR','76SovOoB','1267480fwOzJh','Mock\x20API\x20error:\x20'];a5_0x286a=function(){return _0x2f3861;};return a5_0x286a();}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x4db678=a5_0x4a94,_0x2aecc7=join(__dirname,_0x4db678(0x118)),_0x113033=readFileSync(_0x2aecc7,_0x4db678(0x10d));return JSON['parse'](_0x113033);}let _cached=null;function a5_0x4a94(_0x207990,_0xf80f7e){_0x207990=_0x207990-0x10a;const _0x286a1d=a5_0x286a();let _0x4a9497=_0x286a1d[_0x207990];return _0x4a9497;}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x92286=a5_0x4a94,_0x1ea101=getMockAppList();if(!_0x1ea101[_0x92286(0x10e)])throw new Error(_0x92286(0x113)+_0x1ea101[_0x92286(0x114)]+'\x20('+_0x1ea101[_0x92286(0x10f)]+')');return _0x1ea101[_0x92286(0x115)]['tableData'];}
@@ -1 +1 @@
1
- (function(_0x4784e9,_0x4b4a31){const _0x2a4c11=a6_0xbeb0,_0x5928d4=_0x4784e9();while(!![]){try{const _0x47d767=-parseInt(_0x2a4c11(0xc7))/0x1*(-parseInt(_0x2a4c11(0xcc))/0x2)+-parseInt(_0x2a4c11(0xcb))/0x3*(parseInt(_0x2a4c11(0xd8))/0x4)+-parseInt(_0x2a4c11(0xd0))/0x5+parseInt(_0x2a4c11(0xc9))/0x6+-parseInt(_0x2a4c11(0xcd))/0x7*(parseInt(_0x2a4c11(0xd5))/0x8)+-parseInt(_0x2a4c11(0xd9))/0x9+parseInt(_0x2a4c11(0xd1))/0xa;if(_0x47d767===_0x4b4a31)break;else _0x5928d4['push'](_0x5928d4['shift']());}catch(_0x27d843){_0x5928d4['push'](_0x5928d4['shift']());}}}(a6_0x2448,0x70c06));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 _0x2477f7=a6_0xbeb0,_0x69256=(productEnv(_0x2477f7(0xd6))||'')['trim']()[_0x2477f7(0xd7)]();return _0x69256===_0x2477f7(0xce);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a6_0xbeb0(_0xe0b3d9,_0x1ef06e){_0xe0b3d9=_0xe0b3d9-0xc7;const _0x2448a1=a6_0x2448();let _0xbeb0b=_0x2448a1[_0xe0b3d9];return _0xbeb0b;}function a6_0x2448(){const _0x47eb4c=['4436OBBjmH','6328089aknRXn','1469hYWjiq','fetchedAt','514644IuaFwb','items','1818RtvIHR','302sqPSQL','87794icoQpn','mock','toISOString','2439230jraSkT','20423420GvSIuw','remote','cache','trim','16jssoBY','APP_LIST_SOURCE','toLowerCase'];a6_0x2448=function(){return _0x47eb4c;};return a6_0x2448();}export async function getRemoteAppList(_0x5579a6){const _0x2cc086=a6_0xbeb0,{env:_0x3f8b87,accessKey:_0x13e021,localOnly:localOnly=![],noCache:noCache=![]}=_0x5579a6,_0x479753=readCachedAppList(_0x3f8b87,_0x13e021),_0x39fa44=_0x13e021?.[_0x2cc086(0xd4)]()?getAppCacheFilePath(_0x3f8b87,_0x13e021):null;if(localOnly)return{'items':_0x479753?.[_0x2cc086(0xca)]??[],'source':_0x2cc086(0xd3),'fetchedAt':_0x479753?.['fetchedAt']??null,'cachePath':_0x39fa44};try{const _0x52b17f=await getRemoteAppItems(),_0x9b6112=shouldUseMockRemoteApps()?_0x2cc086(0xce):_0x2cc086(0xd2),_0x26c081=new Date()[_0x2cc086(0xcf)](),_0x336ed4=_0x13e021?.['trim']()?writeCachedAppList(_0x3f8b87,_0x13e021,{'env':_0x3f8b87,'fetchedAt':_0x26c081,'source':_0x9b6112,'items':_0x52b17f}):null;return{'items':_0x52b17f,'source':_0x9b6112,'fetchedAt':_0x26c081,'cachePath':_0x336ed4};}catch(_0x222230){if(!noCache&&_0x479753)return{'items':_0x479753[_0x2cc086(0xca)],'source':'cache','fetchedAt':_0x479753[_0x2cc086(0xc8)],'cachePath':_0x39fa44};throw _0x222230;}}
1
+ function a6_0x5004(){const _0x765866=['117650gaFIWQ','toISOString','fetchedAt','8940946EebGFd','cache','367240CRZnfH','8vBEGiP','mock','remote','trim','12651759zWYeOQ','toLowerCase','52204920TxuXVP','324dpfSnq','items','25958DkDsQL','36aacXrg','2824716fyRWnt'];a6_0x5004=function(){return _0x765866;};return a6_0x5004();}(function(_0x465c0a,_0x4213d7){const _0x189288=a6_0x1961,_0x847de4=_0x465c0a();while(!![]){try{const _0x39afe8=-parseInt(_0x189288(0xc1))/0x1+-parseInt(_0x189288(0xbe))/0x2*(parseInt(_0x189288(0xbc))/0x3)+-parseInt(_0x189288(0xc0))/0x4+-parseInt(_0x189288(0xc6))/0x5*(-parseInt(_0x189288(0xbf))/0x6)+-parseInt(_0x189288(0xc4))/0x7+parseInt(_0x189288(0xc7))/0x8*(-parseInt(_0x189288(0xb9))/0x9)+parseInt(_0x189288(0xbb))/0xa;if(_0x39afe8===_0x4213d7)break;else _0x847de4['push'](_0x847de4['shift']());}catch(_0x4c9ef9){_0x847de4['push'](_0x847de4['shift']());}}}(a6_0x5004,0xb7bce));function a6_0x1961(_0x5788fa,_0x5c5780){_0x5788fa=_0x5788fa-0xb8;const _0x50041f=a6_0x5004();let _0x19617e=_0x50041f[_0x5788fa];return _0x19617e;}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 _0x351b4c=a6_0x1961,_0x481b41=(productEnv('APP_LIST_SOURCE')||'')['trim']()[_0x351b4c(0xba)]();return _0x481b41===_0x351b4c(0xc8);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0xbc5cdb){const _0x28e058=a6_0x1961,{env:_0x3eab4b,accessKey:_0x318931,localOnly:localOnly=![],noCache:noCache=![]}=_0xbc5cdb,_0x2b6b38=readCachedAppList(_0x3eab4b,_0x318931),_0x54fff1=_0x318931?.[_0x28e058(0xb8)]()?getAppCacheFilePath(_0x3eab4b,_0x318931):null;if(localOnly)return{'items':_0x2b6b38?.[_0x28e058(0xbd)]??[],'source':'cache','fetchedAt':_0x2b6b38?.[_0x28e058(0xc3)]??null,'cachePath':_0x54fff1};try{const _0x91018b=await getRemoteAppItems(),_0x47e4e2=shouldUseMockRemoteApps()?_0x28e058(0xc8):_0x28e058(0xc9),_0x5e2c72=new Date()[_0x28e058(0xc2)](),_0x3d9498=_0x318931?.['trim']()?writeCachedAppList(_0x3eab4b,_0x318931,{'env':_0x3eab4b,'fetchedAt':_0x5e2c72,'source':_0x47e4e2,'items':_0x91018b}):null;return{'items':_0x91018b,'source':_0x47e4e2,'fetchedAt':_0x5e2c72,'cachePath':_0x3d9498};}catch(_0x4abfa3){if(!noCache&&_0x2b6b38)return{'items':_0x2b6b38[_0x28e058(0xbd)],'source':_0x28e058(0xc5),'fetchedAt':_0x2b6b38[_0x28e058(0xc3)],'cachePath':_0x54fff1};throw _0x4abfa3;}}
@@ -1 +1 @@
1
- (function(_0x34a6e3,_0x53a15d){const _0x325d52=a7_0x216f,_0x247a73=_0x34a6e3();while(!![]){try{const _0x4f7ba4=-parseInt(_0x325d52(0x149))/0x1*(-parseInt(_0x325d52(0x14b))/0x2)+-parseInt(_0x325d52(0x14a))/0x3*(parseInt(_0x325d52(0x13c))/0x4)+parseInt(_0x325d52(0x137))/0x5*(-parseInt(_0x325d52(0x147))/0x6)+parseInt(_0x325d52(0x13d))/0x7+parseInt(_0x325d52(0x138))/0x8*(parseInt(_0x325d52(0x139))/0x9)+-parseInt(_0x325d52(0x13e))/0xa*(parseInt(_0x325d52(0x140))/0xb)+parseInt(_0x325d52(0x14c))/0xc;if(_0x4f7ba4===_0x53a15d)break;else _0x247a73['push'](_0x247a73['shift']());}catch(_0x29440a){_0x247a73['push'](_0x247a73['shift']());}}}(a7_0x2c87,0x6291e));function a7_0x2c87(){const _0x1d3cd8=['defaultApp','1NgeVqp','15VxHvKO','1112306NgxbxQ','13201440AizhyR','25QFnTkH','40oigkHx','945900agsrKt','trim','appcode','453764pmOVyq','652484rzOrAo','6006730rTiGua','currentApp','11YiTbuM','local','named','find','appCode','name','isCurrent','844038smeNJk'];a7_0x2c87=function(){return _0x1d3cd8;};return a7_0x2c87();}function a7_0x216f(_0x21622a,_0xd0c018){_0x21622a=_0x21622a-0x137;const _0x2c879a=a7_0x2c87();let _0x216f6b=_0x2c879a[_0x21622a];return _0x216f6b;}export function enrichAppListItemsWithMergedSelection(_0xd8a75c,_0x1b4c33){const _0x3e33b7=a7_0x216f;if(!_0x1b4c33)return;const _0x366b6e=!!(_0x1b4c33['currentApp']??_0x1b4c33[_0x3e33b7(0x148)]);for(const _0x3d2a98 of _0xd8a75c){_0x3d2a98[_0x3e33b7(0x146)]=![];}const _0x1be30e=_0x1b4c33['appCode']!=null?String(_0x1b4c33[_0x3e33b7(0x144)])[_0x3e33b7(0x13a)]():'';if(_0x366b6e){const _0x5f4c20=_0x1b4c33[_0x3e33b7(0x13f)]??_0x1b4c33[_0x3e33b7(0x148)];if(_0x5f4c20){const _0x1d8d1d=_0xd8a75c[_0x3e33b7(0x143)](_0x871786=>_0x871786[_0x3e33b7(0x142)]===!![]&&_0x871786[_0x3e33b7(0x145)]===_0x5f4c20&&_0x871786['definedIn']===_0x3e33b7(0x141)),_0x512008=_0x1d8d1d??_0xd8a75c[_0x3e33b7(0x143)](_0x40a777=>_0x40a777[_0x3e33b7(0x142)]===!![]&&_0x40a777[_0x3e33b7(0x145)]===_0x5f4c20);if(_0x512008){const _0x692cc4=String(_0x512008[_0x3e33b7(0x13b)]??'')['trim']();if(!_0x1be30e||_0x692cc4===_0x1be30e){_0x512008[_0x3e33b7(0x146)]=!![];return;}}}if(_0x1be30e){const _0x19def0=_0xd8a75c[_0x3e33b7(0x143)](_0x6a6032=>String(_0x6a6032['appcode']??'')[_0x3e33b7(0x13a)]()===_0x1be30e);_0x19def0&&(_0x19def0['isCurrent']=!![]);}return;}if(!_0x1be30e)return;for(const _0x2ad20d of _0xd8a75c){String(_0x2ad20d[_0x3e33b7(0x13b)]??'')[_0x3e33b7(0x13a)]()===_0x1be30e&&(_0x2ad20d[_0x3e33b7(0x146)]=!![]);}}
1
+ (function(_0x220ef6,_0x4b837b){const _0x3531e5=a7_0x35a2,_0x1054c1=_0x220ef6();while(!![]){try{const _0x485cdc=-parseInt(_0x3531e5(0x1e4))/0x1+-parseInt(_0x3531e5(0x1dd))/0x2+-parseInt(_0x3531e5(0x1e5))/0x3+parseInt(_0x3531e5(0x1ed))/0x4+-parseInt(_0x3531e5(0x1eb))/0x5*(-parseInt(_0x3531e5(0x1f0))/0x6)+-parseInt(_0x3531e5(0x1e9))/0x7+-parseInt(_0x3531e5(0x1ec))/0x8*(-parseInt(_0x3531e5(0x1e2))/0x9);if(_0x485cdc===_0x4b837b)break;else _0x1054c1['push'](_0x1054c1['shift']());}catch(_0x4e1ab5){_0x1054c1['push'](_0x1054c1['shift']());}}}(a7_0x17c4,0xbb003));function a7_0x17c4(){const _0x52fc08=['appcode','defaultApp','36JXjLLk','1095172vLYxdt','trim','appCode','name','isCurrent','2294460cCrErh','local','1213367hVrXMv','2182938xKrQQP','definedIn','currentApp','find','1138200ONCXNV','named','1247930hpdeBO','40IUuqmp','2579752XVhvaV'];a7_0x17c4=function(){return _0x52fc08;};return a7_0x17c4();}function a7_0x35a2(_0x2a96ae,_0x3b6bdf){_0x2a96ae=_0x2a96ae-0x1dd;const _0x17c484=a7_0x17c4();let _0x35a228=_0x17c484[_0x2a96ae];return _0x35a228;}export function enrichAppListItemsWithMergedSelection(_0x3be145,_0x5b38cf){const _0xf2791a=a7_0x35a2;if(!_0x5b38cf)return;const _0x384510=!!(_0x5b38cf['currentApp']??_0x5b38cf[_0xf2791a(0x1ef)]);for(const _0x342a82 of _0x3be145){_0x342a82[_0xf2791a(0x1e1)]=![];}const _0x54eb6c=_0x5b38cf[_0xf2791a(0x1df)]!=null?String(_0x5b38cf[_0xf2791a(0x1df)])[_0xf2791a(0x1de)]():'';if(_0x384510){const _0x4c3559=_0x5b38cf[_0xf2791a(0x1e7)]??_0x5b38cf['defaultApp'];if(_0x4c3559){const _0x3065df=_0x3be145[_0xf2791a(0x1e8)](_0x5afb81=>_0x5afb81['named']===!![]&&_0x5afb81[_0xf2791a(0x1e0)]===_0x4c3559&&_0x5afb81[_0xf2791a(0x1e6)]===_0xf2791a(0x1e3)),_0x58d49e=_0x3065df??_0x3be145[_0xf2791a(0x1e8)](_0x59f66f=>_0x59f66f[_0xf2791a(0x1ea)]===!![]&&_0x59f66f[_0xf2791a(0x1e0)]===_0x4c3559);if(_0x58d49e){const _0x237afd=String(_0x58d49e[_0xf2791a(0x1ee)]??'')[_0xf2791a(0x1de)]();if(!_0x54eb6c||_0x237afd===_0x54eb6c){_0x58d49e['isCurrent']=!![];return;}}}if(_0x54eb6c){const _0x16ca60=_0x3be145['find'](_0x2717aa=>String(_0x2717aa[_0xf2791a(0x1ee)]??'')[_0xf2791a(0x1de)]()===_0x54eb6c);_0x16ca60&&(_0x16ca60[_0xf2791a(0x1e1)]=!![]);}return;}if(!_0x54eb6c)return;for(const _0x3cae7c of _0x3be145){String(_0x3cae7c[_0xf2791a(0x1ee)]??'')[_0xf2791a(0x1de)]()===_0x54eb6c&&(_0x3cae7c[_0xf2791a(0x1e1)]=!![]);}}
@@ -1 +1 @@
1
- const a8_0xaebdbb=a8_0x302f;(function(_0x5e404a,_0x5c374e){const _0xb769b4=a8_0x302f,_0x27409f=_0x5e404a();while(!![]){try{const _0x2dbee0=-parseInt(_0xb769b4(0xe0))/0x1*(parseInt(_0xb769b4(0xda))/0x2)+-parseInt(_0xb769b4(0xe2))/0x3*(-parseInt(_0xb769b4(0xea))/0x4)+parseInt(_0xb769b4(0xd8))/0x5+parseInt(_0xb769b4(0xe8))/0x6+parseInt(_0xb769b4(0xe6))/0x7*(-parseInt(_0xb769b4(0xd6))/0x8)+-parseInt(_0xb769b4(0xec))/0x9+parseInt(_0xb769b4(0xe5))/0xa;if(_0x2dbee0===_0x5c374e)break;else _0x27409f['push'](_0x27409f['shift']());}catch(_0x85282e){_0x27409f['push'](_0x27409f['shift']());}}}(a8_0xc0f4,0x2c532));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';function a8_0xc0f4(){const _0x533c52=['App\x20config\x20key','56400IhpAWO','trim','230474cEGDHQ','appCode','apiError','Unable\x20to\x20get\x20app-config\x20value:\x20key=','Usage:\x20','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','3xIJGAX',',\x20appCode=','441183wcYKFI','app-config','\x20app-config\x20get\x20<key>','7902040RsrsKM','21nLOZzp','get','1245612yLxVZE','args','4tHfdJH','key','2629539NqtZnj','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','read','897896WsotxP'];a8_0xc0f4=function(){return _0x533c52;};return a8_0xc0f4();}function a8_0x302f(_0x26865d,_0x1b2146){_0x26865d=_0x26865d-0xd6;const _0xc0f4d3=a8_0xc0f4();let _0x302f77=_0xc0f4d3[_0x26865d];return _0x302f77;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0xaebdbb(0xe3),'command':a8_0xaebdbb(0xe7),'description':a8_0xaebdbb(0xed),'risk':a8_0xaebdbb(0xee),'args':[{'name':a8_0xaebdbb(0xeb),'description':a8_0xaebdbb(0xd7),'required':!![]}],'flags':[],async 'execute'(_0x3ce9ae){const _0x1be673=a8_0xaebdbb,_0x2b5c9c=_0x3ce9ae[_0x1be673(0xe9)][0x0]?.[_0x1be673(0xd9)]();if(!_0x2b5c9c)throw CliErrors['validation']('Missing\x20app-config\x20key.',_0x1be673(0xde)+CLI_BIN_NAME+_0x1be673(0xe4));try{const _0x2a0b25=await getRuntimeAppConfigByKey(_0x3ce9ae[_0x1be673(0xdb)],_0x2b5c9c);return{'ok':!![],'data':_0x2a0b25};}catch{throw CliErrors[_0x1be673(0xdc)](_0x1be673(0xdd)+_0x2b5c9c+_0x1be673(0xe1)+_0x3ce9ae['appCode'],_0x1be673(0xdf));}}};
1
+ const a8_0x2a9605=a8_0x29f0;(function(_0x1763c1,_0x1c35e6){const _0x5ca847=a8_0x29f0,_0x611fdc=_0x1763c1();while(!![]){try{const _0x282fac=-parseInt(_0x5ca847(0x1f6))/0x1+parseInt(_0x5ca847(0x1ee))/0x2*(parseInt(_0x5ca847(0x1f0))/0x3)+parseInt(_0x5ca847(0x1fe))/0x4*(parseInt(_0x5ca847(0x1f1))/0x5)+parseInt(_0x5ca847(0x1ff))/0x6+-parseInt(_0x5ca847(0x1ea))/0x7*(-parseInt(_0x5ca847(0x1f5))/0x8)+-parseInt(_0x5ca847(0x1f8))/0x9*(-parseInt(_0x5ca847(0x1f9))/0xa)+parseInt(_0x5ca847(0x1e8))/0xb*(-parseInt(_0x5ca847(0x1fd))/0xc);if(_0x282fac===_0x1c35e6)break;else _0x611fdc['push'](_0x611fdc['shift']());}catch(_0x49c544){_0x611fdc['push'](_0x611fdc['shift']());}}}(a8_0x2e8f,0x7516a));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';function a8_0x2e8f(){const _0x164444=['749480QTfQPy','1115898vMHChg','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','\x20app-config\x20get\x20<key>','12382172CasNuU','validation','7hFbFbq','args','appCode','apiError','3740rpbHQg','Missing\x20app-config\x20key.','183WWpScZ','15RxucVH','Usage:\x20','app-config','key','5009016JSIqBs','348945nCtoGr','get','4193109bSNIrg','10jePlQo',',\x20appCode=','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','App\x20config\x20key','12euFfVa'];a8_0x2e8f=function(){return _0x164444;};return a8_0x2e8f();}function a8_0x29f0(_0x557ec6,_0x41473b){_0x557ec6=_0x557ec6-0x1e8;const _0x2e8ffa=a8_0x2e8f();let _0x29f0d6=_0x2e8ffa[_0x557ec6];return _0x29f0d6;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x2a9605(0x1f3),'command':a8_0x2a9605(0x1f7),'description':a8_0x2a9605(0x200),'risk':'read','args':[{'name':a8_0x2a9605(0x1f4),'description':a8_0x2a9605(0x1fc),'required':!![]}],'flags':[],async 'execute'(_0x5df719){const _0x41f448=a8_0x2a9605,_0x3b84b1=_0x5df719[_0x41f448(0x1eb)][0x0]?.['trim']();if(!_0x3b84b1)throw CliErrors[_0x41f448(0x1e9)](_0x41f448(0x1ef),_0x41f448(0x1f2)+CLI_BIN_NAME+_0x41f448(0x201));try{const _0x546c64=await getRuntimeAppConfigByKey(_0x5df719['appCode'],_0x3b84b1);return{'ok':!![],'data':_0x546c64};}catch{throw CliErrors[_0x41f448(0x1ed)]('Unable\x20to\x20get\x20app-config\x20value:\x20key='+_0x3b84b1+_0x41f448(0x1fa)+_0x5df719[_0x41f448(0x1ec)],_0x41f448(0x1fb));}}};
@@ -1 +1 @@
1
- (function(_0x2d84e8,_0x12ecc1){const _0x29375d=a9_0x33c3,_0x3c7214=_0x2d84e8();while(!![]){try{const _0x24375e=-parseInt(_0x29375d(0x18f))/0x1*(parseInt(_0x29375d(0x191))/0x2)+-parseInt(_0x29375d(0x18d))/0x3+parseInt(_0x29375d(0x18b))/0x4+parseInt(_0x29375d(0x18e))/0x5*(parseInt(_0x29375d(0x18a))/0x6)+-parseInt(_0x29375d(0x190))/0x7*(parseInt(_0x29375d(0x189))/0x8)+parseInt(_0x29375d(0x192))/0x9+-parseInt(_0x29375d(0x18c))/0xa;if(_0x24375e===_0x12ecc1)break;else _0x3c7214['push'](_0x3c7214['shift']());}catch(_0x55c45f){_0x3c7214['push'](_0x3c7214['shift']());}}}(a9_0x5568,0x3d05d));function a9_0x5568(){const _0x27e7b7=['46143hmaQxU','248MBTsQJ','690EonEFF','1965784pXjGNa','1433290tlKMrx','747633VArlwq','15575cyTxkb','404zyaFLY','14917uMACbX','724dBfagR'];a9_0x5568=function(){return _0x27e7b7;};return a9_0x5568();}import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x33c3(_0x56f464,_0x312fe6){_0x56f464=_0x56f464-0x189;const _0x55681e=a9_0x5568();let _0x33c388=_0x55681e[_0x56f464];return _0x33c388;}export const appConfigDefinitions=[appConfigGet];
1
+ (function(_0x385f63,_0x57a494){const _0x484ca4=a9_0x2212,_0x14d08c=_0x385f63();while(!![]){try{const _0x2b6a64=parseInt(_0x484ca4(0x18d))/0x1*(-parseInt(_0x484ca4(0x191))/0x2)+-parseInt(_0x484ca4(0x196))/0x3*(parseInt(_0x484ca4(0x192))/0x4)+-parseInt(_0x484ca4(0x198))/0x5*(-parseInt(_0x484ca4(0x195))/0x6)+parseInt(_0x484ca4(0x197))/0x7+-parseInt(_0x484ca4(0x190))/0x8*(parseInt(_0x484ca4(0x193))/0x9)+-parseInt(_0x484ca4(0x18f))/0xa*(parseInt(_0x484ca4(0x194))/0xb)+-parseInt(_0x484ca4(0x18e))/0xc*(-parseInt(_0x484ca4(0x199))/0xd);if(_0x2b6a64===_0x57a494)break;else _0x14d08c['push'](_0x14d08c['shift']());}catch(_0x1c0f6f){_0x14d08c['push'](_0x14d08c['shift']());}}}(a9_0x5666,0xe3481));function a9_0x2212(_0x502181,_0x321d11){_0x502181=_0x502181-0x18d;const _0x5666c3=a9_0x5666();let _0x2212bf=_0x5666c3[_0x502181];return _0x2212bf;}import{appConfigGet}from'../../commands/app-config/get.js';function a9_0x5666(){const _0x4c6ca7=['11134WVxyiN','316444rlOBkj','430173PADFPa','127006mlFQAR','294nIVTCa','60GMBKkv','3902430WGJOrT','107435WFmrZT','91fhEmgg','53SgcAGw','3384276uxFVYu','10NLXpch','128mlCeQZ'];a9_0x5666=function(){return _0x4c6ca7;};return a9_0x5666();}export const appConfigDefinitions=[appConfigGet];
@@ -1 +1 @@
1
- const a10_0x14432d=a10_0x39ea;(function(_0x4ecbd8,_0x122b57){const _0x20252b=a10_0x39ea,_0x43c039=_0x4ecbd8();while(!![]){try{const _0x311c6d=parseInt(_0x20252b(0x1cc))/0x1*(parseInt(_0x20252b(0x1b0))/0x2)+-parseInt(_0x20252b(0x177))/0x3*(parseInt(_0x20252b(0x196))/0x4)+-parseInt(_0x20252b(0x1ca))/0x5+parseInt(_0x20252b(0x1ce))/0x6+parseInt(_0x20252b(0x180))/0x7*(parseInt(_0x20252b(0x1b1))/0x8)+-parseInt(_0x20252b(0x1cb))/0x9*(parseInt(_0x20252b(0x17a))/0xa)+parseInt(_0x20252b(0x17c))/0xb*(parseInt(_0x20252b(0x1ac))/0xc);if(_0x311c6d===_0x122b57)break;else _0x43c039['push'](_0x43c039['shift']());}catch(_0x44fbc5){_0x43c039['push'](_0x43c039['shift']());}}}(a10_0x389d,0xbcbc0));function a10_0x389d(){const _0xdcbf32=['Preview:\x20create\x20react_module\x20Artifact','Invalid\x20JSON\x20for\x20--metadata:\x20','Optional\x20favorite-state\x20filter','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','2795980NFCnyE','3243978UlZyyP','2NsxbeB','.\x20Unsupported:\x20','254400ybkdDo','artifactType','27519SSuCZg','compiledContent','write','30XNJFTL','Saves\x20and\x20recompiles\x20Artifact\x20source.\x20Embedded\x20module\x20display\x20and\x20interaction\x20in\x20the\x20app\x20may\x20change\x20immediately.','138622SZqGZS','startsWith','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','POST','1961386pjoUpe','AGENT','metadata','appCode','read','test','lodash','artifact','@ant-design/icons','update','isArray','create','length','updateTime','Artifact\x20display\x20name','createTime','string','join','File\x20not\x20found:\x20','file','Artifact\x20source\x20file\x20is\x20blank.','number','296zDXsmB','verbose','Updated\x20Artifact\x20','filter','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','Artifact\x20ID','name','source','antd','deleted','list','trim','bool','includes','react-dom','favorite','File\x20path\x20is\x20required.','--metadata\x20must\x20be\x20a\x20JSON\x20object.','split','detail','str','add','1092tFFJkW','flag','react_module\x20imports\x20are\x20limited\x20to:\x20','/update','1062604esyafm','24TVckGy','object','validation','lastIndex','boolean','map','Created\x20Artifact\x20','utf8','num','exec','List\x20current-app\x20react_module\x20Artifacts','description','some','File\x20is\x20not\x20a\x20regular\x20file:\x20','content','parse','react_module','/client/artifact/create','/client/artifact/','build','Preview:\x20update\x20react_module\x20Artifact\x20'];a10_0x389d=function(){return _0xdcbf32;};return a10_0x389d();}import{existsSync,readFileSync,statSync}from'node:fs';function a10_0x39ea(_0x575065,_0x25eecf){_0x575065=_0x575065-0x177;const _0x389d13=a10_0x389d();let _0x39eafa=_0x389d13[_0x575065];return _0x39eafa;}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_0x14432d(0x1c1),ARTIFACT_SOURCE_AGENT=a10_0x14432d(0x181),ALLOWED_REACT_MODULE_IMPORTS=['react',a10_0x14432d(0x1a4),a10_0x14432d(0x186),'dayjs',a10_0x14432d(0x19e),a10_0x14432d(0x188)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x14432d(0x191)](',\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_0x14432d(0x193),'type':a10_0x14432d(0x190),'required':!![],'description':a10_0x14432d(0x19a)},ARTIFACT_NAME_FLAG={'name':a10_0x14432d(0x19c),'type':a10_0x14432d(0x190),'description':a10_0x14432d(0x18e)},METADATA_FLAG={'name':a10_0x14432d(0x182),'type':a10_0x14432d(0x190),'description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x2d591d){const _0x510e68=a10_0x14432d;return typeof _0x2d591d===_0x510e68(0x1b2)&&_0x2d591d!==null&&!Array[_0x510e68(0x18a)](_0x2d591d);}function readSourceFile(_0x55e212){const _0x347da9=a10_0x14432d;if(!_0x55e212)throw CliErrors[_0x347da9(0x1b3)](_0x347da9(0x1a6));if(!existsSync(_0x55e212))throw CliErrors[_0x347da9(0x1b3)](_0x347da9(0x192)+_0x55e212);if(!statSync(_0x55e212)['isFile']())throw CliErrors[_0x347da9(0x1b3)](_0x347da9(0x1be)+_0x55e212);const _0x5e36ce=readFileSync(_0x55e212,_0x347da9(0x1b8));return validateReactModuleSource(_0x5e36ce),_0x5e36ce;}function parseMetadata(_0x3a7ab8){const _0x2797ed=a10_0x14432d;if(!_0x3a7ab8)return undefined;let _0x53b2ae;try{_0x53b2ae=JSON[_0x2797ed(0x1c0)](_0x3a7ab8);}catch{throw CliErrors[_0x2797ed(0x1b3)](_0x2797ed(0x1c7)+_0x3a7ab8);}if(!isPlainObject(_0x53b2ae))throw CliErrors[_0x2797ed(0x1b3)](_0x2797ed(0x1a7));const _0xa7907f={..._0x53b2ae};return delete _0xa7907f[_0x2797ed(0x178)],_0xa7907f;}function getPackageName(_0x18e184){const _0x40bfd6=a10_0x14432d;if(_0x18e184[_0x40bfd6(0x17d)]('@')){const [_0x2327fb,_0x4cdaaf]=_0x18e184['split']('/');return _0x2327fb&&_0x4cdaaf?_0x2327fb+'/'+_0x4cdaaf:_0x18e184;}return _0x18e184[_0x40bfd6(0x1a8)]('/')[0x0]||_0x18e184;}function validateAllowedImports(_0x38334e){const _0x21595e=a10_0x14432d,_0x4b1f1d=new Set();for(const _0x4ea9e2 of IMPORT_SOURCE_PATTERNS){_0x4ea9e2[_0x21595e(0x1b4)]=0x0;let _0x4cb294;while((_0x4cb294=_0x4ea9e2[_0x21595e(0x1ba)](_0x38334e))!==null){const _0x5e83b0=_0x4cb294[0x1]?.[_0x21595e(0x1a1)]();_0x5e83b0&&_0x4b1f1d[_0x21595e(0x1ab)](_0x5e83b0);}}const _0x3b6b91=[..._0x4b1f1d]['map'](getPackageName)[_0x21595e(0x199)](_0x5b7ce6=>!ALLOWED_REACT_MODULE_IMPORTS[_0x21595e(0x1a3)](_0x5b7ce6));if(_0x3b6b91[_0x21595e(0x18c)]>0x0)throw CliErrors['validation'](_0x21595e(0x1ae)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x21595e(0x1cd)+[...new Set(_0x3b6b91)][_0x21595e(0x191)](',\x20'));}export function validateReactModuleSource(_0x5848f6){const _0x14dcad=a10_0x14432d;if(!_0x5848f6[_0x14dcad(0x1a1)]())throw CliErrors[_0x14dcad(0x1b3)](_0x14dcad(0x194));if(PAGE_LEVEL_PATTERNS[_0x14dcad(0x1bd)](_0x508f56=>_0x508f56[_0x14dcad(0x185)](_0x5848f6)))throw CliErrors[_0x14dcad(0x1b3)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x5848f6);}function buildArtifactInput(_0x10d008){const _0x504481=a10_0x14432d,_0x5367e6=readSourceFile(_0x10d008['str'](_0x504481(0x193))),_0x7bf74=_0x10d008[_0x504481(0x1aa)](_0x504481(0x19c))[_0x504481(0x1a1)](),_0x156644=parseMetadata(_0x10d008[_0x504481(0x1aa)](_0x504481(0x182)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x7bf74?{'name':_0x7bf74}:{},'content':_0x5367e6,..._0x156644?{'metadata':_0x156644}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x492eac){const _0xbbda3c=a10_0x14432d;return{'id':_0x492eac['id'],'name':_0x492eac[_0xbbda3c(0x19c)],'artifactType':_0x492eac[_0xbbda3c(0x1cf)],'source':_0x492eac['source'],'favorite':_0x492eac[_0xbbda3c(0x1a5)],'deleted':_0x492eac[_0xbbda3c(0x19f)],'createTime':_0x492eac[_0xbbda3c(0x18f)],'updateTime':_0x492eac[_0xbbda3c(0x18d)]};}function detailArtifact(_0x1ae6aa){const _0x5c6cff=a10_0x14432d;return{'id':_0x1ae6aa['id'],'appCode':_0x1ae6aa[_0x5c6cff(0x183)],'name':_0x1ae6aa[_0x5c6cff(0x19c)],'artifactType':_0x1ae6aa[_0x5c6cff(0x1cf)],'source':_0x1ae6aa[_0x5c6cff(0x19d)],'favorite':_0x1ae6aa[_0x5c6cff(0x1a5)],'deleted':_0x1ae6aa[_0x5c6cff(0x19f)],'content':_0x1ae6aa[_0x5c6cff(0x1bf)]??'','compiledContent':_0x1ae6aa['compiledContent'],'metadata':_0x1ae6aa['metadata']??{},'createTime':_0x1ae6aa[_0x5c6cff(0x18f)],'updateTime':_0x1ae6aa[_0x5c6cff(0x18d)]};}function readFavoriteFlag(_0x16cf28){const _0x48e1e4=a10_0x14432d,_0x49cc27=_0x16cf28[_0x48e1e4(0x1ad)]('favorite');return _0x49cc27===undefined||_0x49cc27===null||_0x49cc27===''?undefined:_0x16cf28[_0x48e1e4(0x1a2)]('favorite');}const artifactList={'service':'artifact','command':a10_0x14432d(0x1a0),'description':a10_0x14432d(0x1bb),'risk':a10_0x14432d(0x184),'flags':[{'name':a10_0x14432d(0x19d),'type':a10_0x14432d(0x190),'description':'Optional\x20source\x20filter,\x20for\x20example\x20AGENT'},{'name':a10_0x14432d(0x1a5),'type':a10_0x14432d(0x1b5),'description':a10_0x14432d(0x1c8)},VERBOSE_FLAG],async 'execute'(_0x206695){const _0x125de5=a10_0x14432d,_0x30f273=await listRuntimeArtifacts(_0x206695[_0x125de5(0x183)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x206695[_0x125de5(0x1aa)](_0x125de5(0x19d))?{'source':_0x206695[_0x125de5(0x1aa)]('source')}:{},...readFavoriteFlag(_0x206695)!==undefined?{'favorite':readFavoriteFlag(_0x206695)}:{}});return{'ok':!![],'data':{'total':_0x30f273[_0x125de5(0x18c)],'items':_0x206695[_0x125de5(0x1a2)](_0x125de5(0x197))?_0x30f273:_0x30f273[_0x125de5(0x1b6)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a10_0x14432d(0x1a9),'description':'Show\x20one\x20Artifact\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a10_0x14432d(0x19b)}],async 'execute'(_0x54d224){const _0x1bbb89=a10_0x14432d,_0x511b98=await getRuntimeArtifact(_0x54d224['num']('id'),_0x54d224[_0x1bbb89(0x183)]);return{'ok':!![],'data':detailArtifact(_0x511b98)};}},artifactCreate={'service':a10_0x14432d(0x187),'command':a10_0x14432d(0x18b),'description':a10_0x14432d(0x1c9),'risk':'write','confirmationDescription':'Saves\x20and\x20compiles\x20new\x20Artifact\x20source.\x20On\x20success,\x20a\x20displayable\x20embedded\x20module\x20is\x20added\x20to\x20the\x20current\x20app.','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5edeef){const _0x527414=a10_0x14432d,_0x25abb8=buildArtifactInput(_0x5edeef),_0xec18dc=await createRuntimeArtifact(_0x5edeef[_0x527414(0x183)],_0x25abb8);return{'ok':!![],'data':detailArtifact(_0xec18dc),'message':_0x527414(0x1b7)+_0xec18dc['id']+(_0xec18dc[_0x527414(0x19c)]?'\x20('+_0xec18dc['name']+')':'')};},async 'dryRun'(_0x537d00){const _0x5022a3=a10_0x14432d,_0x5ba17e=buildArtifactInput(_0x537d00);return dryRun('POST',_0x5022a3(0x1c2))['body']({'appCode':_0x537d00[_0x5022a3(0x183)],..._0x5ba17e})['description'](_0x5022a3(0x1c6))['build']();},'writeEventSubject'(_0x2a5646){const _0x2e9e46=a10_0x14432d,_0x2ad60d=_0x2a5646['data']?.['id'];if(typeof _0x2ad60d!==_0x2e9e46(0x190)&&typeof _0x2ad60d!==_0x2e9e46(0x195))return undefined;return{'kind':_0x2e9e46(0x187),'id':String(_0x2ad60d),'action':_0x2e9e46(0x18b)};}},artifactUpdate={'service':a10_0x14432d(0x187),'command':a10_0x14432d(0x189),'description':a10_0x14432d(0x17e),'risk':a10_0x14432d(0x179),'confirmationDescription':a10_0x14432d(0x17b),'flags':[{...ID_FLAG,'description':a10_0x14432d(0x19b)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3d8992){const _0x1c96f5=a10_0x14432d,_0x4a052c=_0x3d8992[_0x1c96f5(0x1b9)]('id'),_0x3c5b3d=buildArtifactInput(_0x3d8992),_0x4c26fd=await updateRuntimeArtifact(_0x4a052c,_0x3d8992['appCode'],_0x3c5b3d);return{'ok':!![],'data':detailArtifact(_0x4c26fd),'message':_0x1c96f5(0x198)+_0x4c26fd['id']+(_0x4c26fd[_0x1c96f5(0x19c)]?'\x20('+_0x4c26fd[_0x1c96f5(0x19c)]+')':'')};},async 'dryRun'(_0x499594){const _0x1a2574=a10_0x14432d,_0x49d5ac=_0x499594[_0x1a2574(0x1b9)]('id'),_0x3d5b5b=buildArtifactInput(_0x499594);return dryRun(_0x1a2574(0x17f),_0x1a2574(0x1c3)+_0x49d5ac+_0x1a2574(0x1af))['body']({'appCode':_0x499594[_0x1a2574(0x183)],..._0x3d5b5b})[_0x1a2574(0x1bc)](_0x1a2574(0x1c5)+_0x49d5ac)[_0x1a2574(0x1c4)]();},'writeEventSubject'(_0x3bc9db){const _0xdaf308=a10_0x14432d,_0x4f607d=_0x3bc9db['data']?.['id'];if(typeof _0x4f607d!==_0xdaf308(0x190)&&typeof _0x4f607d!==_0xdaf308(0x195))return undefined;return{'kind':'artifact','id':String(_0x4f607d),'action':_0xdaf308(0x189)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x1e3fea=a10_0x42f2;function a10_0x26ed(){const _0x59ae2c=['4802wisdTi','body','329hugkJR','list','AGENT','flag','/update','Artifact\x20ID','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','add','1929415UYREGY','Updated\x20Artifact\x20','exec','15kzOKyD','data','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','map','779944sGCiDj','update','bool','description','test','num','dayjs','Invalid\x20JSON\x20for\x20--metadata:\x20','build','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','react_module\x20imports\x20are\x20limited\x20to:\x20','react_module','POST','Saves\x20and\x20compiles\x20new\x20Artifact\x20source.\x20On\x20success,\x20a\x20displayable\x20embedded\x20module\x20is\x20added\x20to\x20the\x20current\x20app.','lodash','validation','lastIndex','string','utf8','7564344OqcAFl','file','react-dom','includes','Optional\x20favorite-state\x20filter','source','artifact','File\x20is\x20not\x20a\x20regular\x20file:\x20','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','279zFWgmg','length','Artifact\x20source\x20file\x20is\x20blank.','some','Created\x20Artifact\x20','1814155NXYLhq','createTime','Saves\x20and\x20recompiles\x20Artifact\x20source.\x20Embedded\x20module\x20display\x20and\x20interaction\x20in\x20the\x20app\x20may\x20change\x20immediately.','metadata','artifactType','2156671SeqgDk','Preview:\x20update\x20react_module\x20Artifact\x20','favorite','react','.\x20Unsupported:\x20','File\x20not\x20found:\x20','Show\x20one\x20Artifact\x20by\x20id','appCode','57560vWzArZ','number','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','compiledContent','isArray','create','updateTime','File\x20path\x20is\x20required.','startsWith','trim','6GNKuPy','name','List\x20current-app\x20react_module\x20Artifacts','str'];a10_0x26ed=function(){return _0x59ae2c;};return a10_0x26ed();}(function(_0xe196b5,_0x38e80e){const _0x28f88=a10_0x42f2,_0x1b6e40=_0xe196b5();while(!![]){try{const _0x5e03ae=-parseInt(_0x28f88(0xb0))/0x1*(parseInt(_0x28f88(0xae))/0x2)+-parseInt(_0x28f88(0xbc))/0x3*(-parseInt(_0x28f88(0xc0))/0x4)+-parseInt(_0x28f88(0xb9))/0x5*(parseInt(_0x28f88(0xaa))/0x6)+-parseInt(_0x28f88(0xe1))/0x7+parseInt(_0x28f88(0xd3))/0x8+-parseInt(_0x28f88(0xdc))/0x9*(parseInt(_0x28f88(0xa0))/0xa)+parseInt(_0x28f88(0x98))/0xb;if(_0x5e03ae===_0x38e80e)break;else _0x1b6e40['push'](_0x1b6e40['shift']());}catch(_0xbec51a){_0x1b6e40['push'](_0x1b6e40['shift']());}}}(a10_0x26ed,0x7ad51));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';function a10_0x42f2(_0x1ea778,_0x3d092d){_0x1ea778=_0x1ea778-0x95;const _0x26edec=a10_0x26ed();let _0x42f27d=_0x26edec[_0x1ea778];return _0x42f27d;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0x1e3fea(0xcb),ARTIFACT_SOURCE_AGENT=a10_0x1e3fea(0xb2),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x1e3fea(0x9b),a10_0x1e3fea(0xd5),a10_0x1e3fea(0xce),a10_0x1e3fea(0xc6),'antd','@ant-design/icons'];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':'file','type':'string','required':!![],'description':a10_0x1e3fea(0xb7)},ARTIFACT_NAME_FLAG={'name':a10_0x1e3fea(0xab),'type':'string','description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a10_0x1e3fea(0x96),'type':a10_0x1e3fea(0xd1),'description':a10_0x1e3fea(0xdb)};function isPlainObject(_0xcdeff6){const _0x926fe1=a10_0x1e3fea;return typeof _0xcdeff6==='object'&&_0xcdeff6!==null&&!Array[_0x926fe1(0xa4)](_0xcdeff6);}function readSourceFile(_0x5400e0){const _0x3fb0b3=a10_0x1e3fea;if(!_0x5400e0)throw CliErrors[_0x3fb0b3(0xcf)](_0x3fb0b3(0xa7));if(!existsSync(_0x5400e0))throw CliErrors['validation'](_0x3fb0b3(0x9d)+_0x5400e0);if(!statSync(_0x5400e0)['isFile']())throw CliErrors[_0x3fb0b3(0xcf)](_0x3fb0b3(0xda)+_0x5400e0);const _0x1da002=readFileSync(_0x5400e0,_0x3fb0b3(0xd2));return validateReactModuleSource(_0x1da002),_0x1da002;}function parseMetadata(_0x407c2f){const _0x24be96=a10_0x1e3fea;if(!_0x407c2f)return undefined;let _0xaf0810;try{_0xaf0810=JSON['parse'](_0x407c2f);}catch{throw CliErrors[_0x24be96(0xcf)](_0x24be96(0xc7)+_0x407c2f);}if(!isPlainObject(_0xaf0810))throw CliErrors[_0x24be96(0xcf)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x44c62e={..._0xaf0810};return delete _0x44c62e[_0x24be96(0xa3)],_0x44c62e;}function getPackageName(_0x355345){const _0x4881bc=a10_0x1e3fea;if(_0x355345[_0x4881bc(0xa8)]('@')){const [_0x50a97c,_0x26fa99]=_0x355345['split']('/');return _0x50a97c&&_0x26fa99?_0x50a97c+'/'+_0x26fa99:_0x355345;}return _0x355345['split']('/')[0x0]||_0x355345;}function validateAllowedImports(_0x4a111d){const _0x13592f=a10_0x1e3fea,_0x382f0b=new Set();for(const _0x304bb7 of IMPORT_SOURCE_PATTERNS){_0x304bb7[_0x13592f(0xd0)]=0x0;let _0x1e9ccb;while((_0x1e9ccb=_0x304bb7[_0x13592f(0xbb)](_0x4a111d))!==null){const _0x2f71e4=_0x1e9ccb[0x1]?.[_0x13592f(0xa9)]();_0x2f71e4&&_0x382f0b[_0x13592f(0xb8)](_0x2f71e4);}}const _0x5b7736=[..._0x382f0b][_0x13592f(0xbf)](getPackageName)['filter'](_0x5ecaa9=>!ALLOWED_REACT_MODULE_IMPORTS[_0x13592f(0xd6)](_0x5ecaa9));if(_0x5b7736[_0x13592f(0xdd)]>0x0)throw CliErrors[_0x13592f(0xcf)](_0x13592f(0xca)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x13592f(0x9c)+[...new Set(_0x5b7736)]['join'](',\x20'));}export function validateReactModuleSource(_0x1130da){const _0x173dc5=a10_0x1e3fea;if(!_0x1130da[_0x173dc5(0xa9)]())throw CliErrors[_0x173dc5(0xcf)](_0x173dc5(0xde));if(PAGE_LEVEL_PATTERNS[_0x173dc5(0xdf)](_0x4ce446=>_0x4ce446[_0x173dc5(0xc4)](_0x1130da)))throw CliErrors['validation'](_0x173dc5(0xc9));validateAllowedImports(_0x1130da);}function buildArtifactInput(_0x18f300){const _0x5acae2=a10_0x1e3fea,_0x143e88=readSourceFile(_0x18f300[_0x5acae2(0xad)](_0x5acae2(0xd4))),_0x4b3714=_0x18f300[_0x5acae2(0xad)](_0x5acae2(0xab))[_0x5acae2(0xa9)](),_0xd30233=parseMetadata(_0x18f300[_0x5acae2(0xad)](_0x5acae2(0x96)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4b3714?{'name':_0x4b3714}:{},'content':_0x143e88,..._0xd30233?{'metadata':_0xd30233}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x2a00ae){const _0x3d8017=a10_0x1e3fea;return{'id':_0x2a00ae['id'],'name':_0x2a00ae['name'],'artifactType':_0x2a00ae[_0x3d8017(0x97)],'source':_0x2a00ae[_0x3d8017(0xd8)],'favorite':_0x2a00ae[_0x3d8017(0x9a)],'deleted':_0x2a00ae['deleted'],'createTime':_0x2a00ae['createTime'],'updateTime':_0x2a00ae[_0x3d8017(0xa6)]};}function detailArtifact(_0x37278c){const _0x129678=a10_0x1e3fea;return{'id':_0x37278c['id'],'appCode':_0x37278c[_0x129678(0x9f)],'name':_0x37278c['name'],'artifactType':_0x37278c[_0x129678(0x97)],'source':_0x37278c[_0x129678(0xd8)],'favorite':_0x37278c[_0x129678(0x9a)],'deleted':_0x37278c['deleted'],'content':_0x37278c['content']??'','compiledContent':_0x37278c[_0x129678(0xa3)],'metadata':_0x37278c[_0x129678(0x96)]??{},'createTime':_0x37278c[_0x129678(0xe2)],'updateTime':_0x37278c[_0x129678(0xa6)]};}function readFavoriteFlag(_0x3b50e9){const _0xfdbd47=a10_0x1e3fea,_0x137a75=_0x3b50e9[_0xfdbd47(0xb3)](_0xfdbd47(0x9a));return _0x137a75===undefined||_0x137a75===null||_0x137a75===''?undefined:_0x3b50e9['bool']('favorite');}const artifactList={'service':'artifact','command':a10_0x1e3fea(0xb1),'description':a10_0x1e3fea(0xac),'risk':'read','flags':[{'name':a10_0x1e3fea(0xd8),'type':a10_0x1e3fea(0xd1),'description':a10_0x1e3fea(0xb6)},{'name':'favorite','type':'boolean','description':a10_0x1e3fea(0xd7)},VERBOSE_FLAG],async 'execute'(_0x239689){const _0x27925e=a10_0x1e3fea,_0x4ca245=await listRuntimeArtifacts(_0x239689[_0x27925e(0x9f)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x239689['str'](_0x27925e(0xd8))?{'source':_0x239689[_0x27925e(0xad)](_0x27925e(0xd8))}:{},...readFavoriteFlag(_0x239689)!==undefined?{'favorite':readFavoriteFlag(_0x239689)}:{}});return{'ok':!![],'data':{'total':_0x4ca245[_0x27925e(0xdd)],'items':_0x239689[_0x27925e(0xc2)]('verbose')?_0x4ca245:_0x4ca245[_0x27925e(0xbf)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x1e3fea(0xd9),'command':'detail','description':a10_0x1e3fea(0x9e),'risk':'read','flags':[{...ID_FLAG,'description':'Artifact\x20ID'}],async 'execute'(_0x5b88fb){const _0xe44f0a=a10_0x1e3fea,_0x3d8b98=await getRuntimeArtifact(_0x5b88fb[_0xe44f0a(0xc5)]('id'),_0x5b88fb[_0xe44f0a(0x9f)]);return{'ok':!![],'data':detailArtifact(_0x3d8b98)};}},artifactCreate={'service':a10_0x1e3fea(0xd9),'command':'create','description':a10_0x1e3fea(0xa2),'risk':'write','confirmationDescription':a10_0x1e3fea(0xcd),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1c7266){const _0x457926=a10_0x1e3fea,_0x56ba5d=buildArtifactInput(_0x1c7266),_0x15a04e=await createRuntimeArtifact(_0x1c7266['appCode'],_0x56ba5d);return{'ok':!![],'data':detailArtifact(_0x15a04e),'message':_0x457926(0xe0)+_0x15a04e['id']+(_0x15a04e[_0x457926(0xab)]?'\x20('+_0x15a04e[_0x457926(0xab)]+')':'')};},async 'dryRun'(_0x2dd9b7){const _0x3fb6e4=a10_0x1e3fea,_0x33f273=buildArtifactInput(_0x2dd9b7);return dryRun(_0x3fb6e4(0xcc),'/client/artifact/create')[_0x3fb6e4(0xaf)]({'appCode':_0x2dd9b7[_0x3fb6e4(0x9f)],..._0x33f273})[_0x3fb6e4(0xc3)]('Preview:\x20create\x20react_module\x20Artifact')[_0x3fb6e4(0xc8)]();},'writeEventSubject'(_0x18810c){const _0x1f2c8c=a10_0x1e3fea,_0x47275a=_0x18810c[_0x1f2c8c(0xbd)]?.['id'];if(typeof _0x47275a!==_0x1f2c8c(0xd1)&&typeof _0x47275a!==_0x1f2c8c(0xa1))return undefined;return{'kind':_0x1f2c8c(0xd9),'id':String(_0x47275a),'action':_0x1f2c8c(0xa5)};}},artifactUpdate={'service':a10_0x1e3fea(0xd9),'command':a10_0x1e3fea(0xc1),'description':a10_0x1e3fea(0xbe),'risk':'write','confirmationDescription':a10_0x1e3fea(0x95),'flags':[{...ID_FLAG,'description':a10_0x1e3fea(0xb5)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x58e757){const _0x23f01b=a10_0x1e3fea,_0x5d018e=_0x58e757[_0x23f01b(0xc5)]('id'),_0x4af4a9=buildArtifactInput(_0x58e757),_0x266e42=await updateRuntimeArtifact(_0x5d018e,_0x58e757['appCode'],_0x4af4a9);return{'ok':!![],'data':detailArtifact(_0x266e42),'message':_0x23f01b(0xba)+_0x266e42['id']+(_0x266e42[_0x23f01b(0xab)]?'\x20('+_0x266e42['name']+')':'')};},async 'dryRun'(_0x42afcb){const _0x3b021f=a10_0x1e3fea,_0x542fc8=_0x42afcb[_0x3b021f(0xc5)]('id'),_0x35d920=buildArtifactInput(_0x42afcb);return dryRun(_0x3b021f(0xcc),'/client/artifact/'+_0x542fc8+_0x3b021f(0xb4))[_0x3b021f(0xaf)]({'appCode':_0x42afcb[_0x3b021f(0x9f)],..._0x35d920})['description'](_0x3b021f(0x99)+_0x542fc8)[_0x3b021f(0xc8)]();},'writeEventSubject'(_0x4ba727){const _0x297842=a10_0x1e3fea,_0x170c8a=_0x4ba727['data']?.['id'];if(typeof _0x170c8a!==_0x297842(0xd1)&&typeof _0x170c8a!==_0x297842(0xa1))return undefined;return{'kind':_0x297842(0xd9),'id':String(_0x170c8a),'action':_0x297842(0xc1)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
@@ -1 +1 @@
1
- const a11_0x24ba0f=a11_0x39af;(function(_0xae8279,_0x1f84c4){const _0x121b25=a11_0x39af,_0x32ea5d=_0xae8279();while(!![]){try{const _0x49d37b=-parseInt(_0x121b25(0xf1))/0x1+parseInt(_0x121b25(0xe5))/0x2+-parseInt(_0x121b25(0x115))/0x3+-parseInt(_0x121b25(0xe9))/0x4*(-parseInt(_0x121b25(0x102))/0x5)+-parseInt(_0x121b25(0x11e))/0x6+-parseInt(_0x121b25(0x10f))/0x7+parseInt(_0x121b25(0xf7))/0x8;if(_0x49d37b===_0x1f84c4)break;else _0x32ea5d['push'](_0x32ea5d['shift']());}catch(_0x5e0f59){_0x32ea5d['push'](_0x32ea5d['shift']());}}}(a11_0x32e3,0xda544));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(_0x57232b){const _0x5db0cb=a11_0x39af;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x57232b[_0x5db0cb(0x10b)]('global'),'explicitProject':_0x57232b[_0x5db0cb(0x10b)]('project'),'policy':'global-default'}));}function a11_0x32e3(){const _0x5cabdf=['scope','120uzKdlh','global','data','/.device-auth','stderr','application/json','now','cancelled','796700Jvipzg','Invalid\x20device\x20auth\x20response','Invalid\x20access_key\x20returned\x20by\x20server.','\x20auth\x20status','stringify','\x20config.','27795640HDCFLe','Device\x20auth\x20API\x20error\x20(','once','createdAt','floor','validation','POST','&source=','source','Write\x20to\x20project\x20config','AbortError','142585zebKAA','json','networkError','write','status','/api/device-auth/token','AccessKey\x20saved\x20to\x20','code','access_key','bool','success','toISOString','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','10578722WPHNpw','apiError','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','boolean','device','project','4469610LuzddZ','signal','aborted','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','accessKey','utf8','abort','),\x20retrying...','expired','4103568MpsiHc','name','Device\x20authorization\x20successful.','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','url-only','log','string','removeListener','auth','object','lovrabet-cli','padStart','Device\x20authorization\x20cancelled.','\x20auth\x20device','parse','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','test','SIGINT','2092110xUOXCe','Write\x20to\x20global\x20config\x20(default)','randomUUID'];a11_0x32e3=function(){return _0x5cabdf;};return a11_0x32e3();}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 _0x15d908=a11_0x39af;return crypto[_0x15d908(0xe7)]();}export function buildDeviceAuthUrl(_0x2c5a71,_0x156ca2,_0x483ff0=a11_0x24ba0f(0x128)){const _0x2723d0=a11_0x24ba0f;return _0x2c5a71+'/device-auth?code='+encodeURIComponent(_0x156ca2)+_0x2723d0(0xfe)+encodeURIComponent(_0x483ff0);}export function getDeviceCodePath(){const _0x499829=a11_0x24ba0f;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x499829(0xec);}export function readStoredDeviceCode(){const _0x5138ee=a11_0x24ba0f,_0x47e903=getDeviceCodePath();if(!existsSync(_0x47e903))return null;try{const _0x12cad5=readFileSync(_0x47e903,{'encoding':_0x5138ee(0x11a)}),_0x3a9d53=JSON[_0x5138ee(0xe1)](_0x12cad5);if(_0x3a9d53&&typeof _0x3a9d53[_0x5138ee(0x109)]===_0x5138ee(0x124)&&typeof _0x3a9d53[_0x5138ee(0xfa)]===_0x5138ee(0x124)&&(_0x3a9d53[_0x5138ee(0xe8)]===_0x5138ee(0xea)||_0x3a9d53[_0x5138ee(0xe8)]===_0x5138ee(0x114)))return _0x3a9d53;}catch{}return null;}export function writeStoredDeviceCode(_0x47f2e9,_0x174f4e){const _0xdb22d3=a11_0x24ba0f,_0x483265=getDeviceCodePath(),_0x332c4e=dirname(_0x483265);!existsSync(_0x332c4e)&&mkdirSync(_0x332c4e,{'recursive':!![]});const _0x4d3f50={'code':_0x47f2e9,'createdAt':new Date()[_0xdb22d3(0x10d)](),'scope':_0x174f4e};writeFileSync(_0x483265,JSON[_0xdb22d3(0xf5)](_0x4d3f50),{'encoding':'utf8','mode':0x180});}function a11_0x39af(_0x1e46d7,_0x19937a){_0x1e46d7=_0x1e46d7-0xe0;const _0x32e3b9=a11_0x32e3();let _0x39af85=_0x32e3b9[_0x1e46d7];return _0x39af85;}export function deleteStoredDeviceCode(){const _0x13c086=getDeviceCodePath();try{unlinkSync(_0x13c086);}catch{}}export function isStoredDeviceCodeExpired(_0x4a588d){const _0x220b69=a11_0x24ba0f;return Date[_0x220b69(0xef)]()-new Date(_0x4a588d[_0x220b69(0xfa)])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x26e65b,_0x163ab0){const _0xc97190=a11_0x24ba0f,_0x20c58a=_0x26e65b+_0xc97190(0x107),_0x52eba2=new AbortController(),_0x1e1f0d=setTimeout(()=>_0x52eba2[_0xc97190(0x11b)](),0x2710),_0x610803=await fetch(_0x20c58a,{'method':_0xc97190(0xfd),'headers':{'Content-Type':_0xc97190(0xee)},'body':JSON[_0xc97190(0xf5)]({'code':_0x163ab0}),'signal':_0x52eba2[_0xc97190(0x116)]});clearTimeout(_0x1e1f0d);if(!_0x610803['ok'])throw CliErrors[_0xc97190(0x104)]('Device\x20auth\x20API\x20returned\x20HTTP\x20'+_0x610803[_0xc97190(0x106)]);const _0x53b888=await _0x610803[_0xc97190(0x103)](),_0x4d2dc7=_0x53b888[_0xc97190(0xeb)]&&typeof _0x53b888[_0xc97190(0xeb)]===_0xc97190(0x127)?_0x53b888[_0xc97190(0xeb)]:_0x53b888;if(!_0x4d2dc7||typeof _0x4d2dc7[_0xc97190(0x106)]!==_0xc97190(0x124))throw CliErrors[_0xc97190(0x110)](_0xc97190(0xf2));return{'status':_0x4d2dc7['status'],'access_key':typeof _0x4d2dc7[_0xc97190(0x10a)]==='string'?_0x4d2dc7[_0xc97190(0x10a)]:undefined};}export async function pollDeviceToken(_0x4aa5d9,_0x3d685d,_0x1b175b){const _0x4c3d0e=a11_0x24ba0f;let _0x3780ae=0x0;for(let _0x90b6a3=0x0;_0x90b6a3<MAX_POLLS;_0x90b6a3++){if(_0x1b175b[_0x4c3d0e(0x117)])throw CliErrors[_0x4c3d0e(0xf0)](_0x4c3d0e(0x12a));let _0x5835fa;try{_0x5835fa=await fetchDeviceToken(_0x4aa5d9,_0x3d685d);}catch(_0x13ac40){if(_0x13ac40 instanceof Error&&_0x13ac40[_0x4c3d0e(0x11f)]===_0x4c3d0e(0x101))throw CliErrors[_0x4c3d0e(0xf0)](_0x4c3d0e(0x12a));_0x3780ae++;if(_0x3780ae>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x4c3d0e(0x104)]('Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.');writeCliSideChannelLine(_0x4c3d0e(0xf8)+_0x3780ae+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x4c3d0e(0x11c)),await sleep(POLL_INTERVAL_MS);continue;}_0x3780ae=0x0;if(_0x5835fa[_0x4c3d0e(0x106)]===_0x4c3d0e(0x10c)){if(!_0x5835fa[_0x4c3d0e(0x10a)])throw CliErrors['apiError'](_0x4c3d0e(0xf3));return _0x5835fa[_0x4c3d0e(0x10a)];}if(_0x5835fa['status']===_0x4c3d0e(0x11d)){deleteStoredDeviceCode();throw CliErrors[_0x4c3d0e(0xfc)]('Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}const _0x277a41=(_0x90b6a3+0x1)*POLL_INTERVAL_MS,_0x4fc522=DEVICE_CODE_TTL_MS-_0x277a41,_0x20c639=Math[_0x4c3d0e(0xfb)](_0x4fc522/0xea60),_0x1e0e61=Math['floor'](_0x4fc522%0xea60/0x3e8);process['stderr'][_0x4c3d0e(0x105)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x20c639+':'+String(_0x1e0e61)[_0x4c3d0e(0x129)](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x4c3d0e(0xfc)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x2a5f45){return new Promise(_0x142aa9=>setTimeout(_0x142aa9,_0x2a5f45));}export const authDeviceDefinition={'service':a11_0x24ba0f(0x126),'command':a11_0x24ba0f(0x113),'description':a11_0x24ba0f(0x118),'risk':a11_0x24ba0f(0x105),'confirmationDescription':'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.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x24ba0f(0xea),'type':a11_0x24ba0f(0x112),'description':a11_0x24ba0f(0xe6),'default':!![]},{'name':a11_0x24ba0f(0x114),'type':a11_0x24ba0f(0x112),'description':a11_0x24ba0f(0x100),'default':![]},{'name':a11_0x24ba0f(0xff),'type':a11_0x24ba0f(0x124),'description':a11_0x24ba0f(0xe2),'default':a11_0x24ba0f(0x128)},{'name':'url-only','type':a11_0x24ba0f(0x112),'description':a11_0x24ba0f(0x121),'default':![]}],async 'execute'(_0x304814){const _0x25029d=a11_0x24ba0f,_0x256902=resolveAuthScopeFlags(_0x304814),_0x5054de=_0x256902[_0x25029d(0xea)]?_0x25029d(0xea):_0x25029d(0x114),_0x467d91=readScopedConfig(_0x256902);if(_0x467d91[_0x25029d(0x119)])return{'ok':!![],'message':_0x25029d(0x10e)};const _0x3284ef=(_0x304814['str']('source')||_0x25029d(0x128))['trim'](),_0x3bc6b2=getUserDomain(),_0x2b0333=readStoredDeviceCode(),_0x41236e=_0x2b0333&&!isStoredDeviceCodeExpired(_0x2b0333)?_0x2b0333[_0x25029d(0x109)]:((()=>{const _0x4c7e7d=generateDeviceCode();return writeStoredDeviceCode(_0x4c7e7d,_0x5054de),_0x4c7e7d;})()),_0x345a06=buildDeviceAuthUrl(_0x3bc6b2,_0x41236e,_0x3284ef);if(_0x304814[_0x25029d(0x10b)](_0x25029d(0x122)))return console[_0x25029d(0x123)](_0x345a06),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x345a06),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x25029d(0x111));if(_0x304814['nonInteractive'])return writeCliSideChannelLine('After\x20authorizing,\x20re-run:\x20'+CLI_BIN_NAME+_0x25029d(0xe0)),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x4daf2f=new AbortController(),_0x12ff93=()=>{const _0xbe479c=_0x25029d;_0x4daf2f[_0xbe479c(0x11b)](),process['removeListener'](_0xbe479c(0xe4),_0x12ff93);};process[_0x25029d(0xf9)](_0x25029d(0xe4),_0x12ff93);let _0x3e0d88;try{_0x3e0d88=await pollDeviceToken(_0x3bc6b2,_0x41236e,_0x4daf2f['signal']);}finally{process[_0x25029d(0x125)](_0x25029d(0xe4),_0x12ff93);}if(!ACCESS_KEY_PATTERN[_0x25029d(0xe3)](_0x3e0d88))throw CliErrors[_0x25029d(0x110)](_0x25029d(0xf3));const _0x313e9c=readScopedConfig(_0x256902);return _0x313e9c[_0x25029d(0x119)]=_0x3e0d88,writeScopedConfig(_0x313e9c,_0x256902),deleteStoredDeviceCode(),process[_0x25029d(0xed)][_0x25029d(0x105)]('\x0a'),writeCliSideChannelLine(_0x25029d(0x108)+_0x5054de+_0x25029d(0xf6)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+_0x25029d(0xf4)),{'ok':!![],'message':_0x25029d(0x120)};}};
1
+ const a11_0x47434d=a11_0x35bb;(function(_0x1aeceb,_0x22b670){const _0x1788df=a11_0x35bb,_0x5ded8e=_0x1aeceb();while(!![]){try{const _0x3eeff5=parseInt(_0x1788df(0x165))/0x1+-parseInt(_0x1788df(0x160))/0x2*(-parseInt(_0x1788df(0x16b))/0x3)+-parseInt(_0x1788df(0x190))/0x4*(-parseInt(_0x1788df(0x19f))/0x5)+parseInt(_0x1788df(0x1a1))/0x6*(-parseInt(_0x1788df(0x185))/0x7)+parseInt(_0x1788df(0x164))/0x8+-parseInt(_0x1788df(0x1a0))/0x9+-parseInt(_0x1788df(0x19e))/0xa;if(_0x3eeff5===_0x22b670)break;else _0x5ded8e['push'](_0x5ded8e['shift']());}catch(_0x3c5dcc){_0x5ded8e['push'](_0x5ded8e['shift']());}}}(a11_0x3cf0,0x394e4));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';function a11_0x35bb(_0x22ea92,_0x5928c2){_0x22ea92=_0x22ea92-0x15c;const _0x3cf05a=a11_0x3cf0();let _0x35bb3a=_0x3cf05a[_0x22ea92];return _0x35bb3a;}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(_0x4d7d4d){const _0x451c38=a11_0x35bb;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4d7d4d['bool'](_0x451c38(0x179)),'explicitProject':_0x4d7d4d[_0x451c38(0x19a)](_0x451c38(0x162)),'policy':_0x451c38(0x186)}));}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 _0x49b610=a11_0x35bb;return crypto[_0x49b610(0x166)]();}export function buildDeviceAuthUrl(_0x46dd1f,_0x32efab,_0x36f57e='lovrabet-cli'){const _0x45feb6=a11_0x35bb;return _0x46dd1f+'/device-auth?code='+encodeURIComponent(_0x32efab)+_0x45feb6(0x18d)+encodeURIComponent(_0x36f57e);}export function getDeviceCodePath(){const _0x88fde3=a11_0x35bb;return homedir()+'/'+PRODUCT_CONFIG[_0x88fde3(0x15c)]+'/.device-auth';}export function readStoredDeviceCode(){const _0x590074=a11_0x35bb,_0x3383bb=getDeviceCodePath();if(!existsSync(_0x3383bb))return null;try{const _0x3243a6=readFileSync(_0x3383bb,{'encoding':_0x590074(0x192)}),_0x3da0f7=JSON['parse'](_0x3243a6);if(_0x3da0f7&&typeof _0x3da0f7[_0x590074(0x16d)]===_0x590074(0x193)&&typeof _0x3da0f7['createdAt']==='string'&&(_0x3da0f7[_0x590074(0x197)]===_0x590074(0x179)||_0x3da0f7['scope']===_0x590074(0x162)))return _0x3da0f7;}catch{}return null;}export function writeStoredDeviceCode(_0x442b21,_0x4c9f6c){const _0x2c3707=a11_0x35bb,_0x208d03=getDeviceCodePath(),_0x4d329a=dirname(_0x208d03);!existsSync(_0x4d329a)&&mkdirSync(_0x4d329a,{'recursive':!![]});const _0x4b05d2={'code':_0x442b21,'createdAt':new Date()[_0x2c3707(0x19c)](),'scope':_0x4c9f6c};writeFileSync(_0x208d03,JSON[_0x2c3707(0x191)](_0x4b05d2),{'encoding':_0x2c3707(0x192),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x9411d3=getDeviceCodePath();try{unlinkSync(_0x9411d3);}catch{}}export function isStoredDeviceCodeExpired(_0x4a4f7a){const _0x37a5a7=a11_0x35bb;return Date['now']()-new Date(_0x4a4f7a[_0x37a5a7(0x15d)])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x5279b9,_0xbdfed7){const _0x48d651=a11_0x35bb,_0xf724bb=_0x5279b9+_0x48d651(0x17c),_0x9eb3d2=new AbortController(),_0x4eb5ed=setTimeout(()=>_0x9eb3d2[_0x48d651(0x188)](),0x2710),_0x4ed9f3=await fetch(_0xf724bb,{'method':'POST','headers':{'Content-Type':_0x48d651(0x176)},'body':JSON[_0x48d651(0x191)]({'code':_0xbdfed7}),'signal':_0x9eb3d2['signal']});clearTimeout(_0x4eb5ed);if(!_0x4ed9f3['ok'])throw CliErrors[_0x48d651(0x163)](_0x48d651(0x18e)+_0x4ed9f3[_0x48d651(0x178)]);const _0x5e7636=await _0x4ed9f3[_0x48d651(0x17d)](),_0x18a871=_0x5e7636['data']&&typeof _0x5e7636['data']===_0x48d651(0x182)?_0x5e7636[_0x48d651(0x175)]:_0x5e7636;if(!_0x18a871||typeof _0x18a871[_0x48d651(0x178)]!==_0x48d651(0x193))throw CliErrors[_0x48d651(0x1a2)]('Invalid\x20device\x20auth\x20response');return{'status':_0x18a871[_0x48d651(0x178)],'access_key':typeof _0x18a871[_0x48d651(0x15f)]===_0x48d651(0x193)?_0x18a871[_0x48d651(0x15f)]:undefined};}export async function pollDeviceToken(_0xedf2ad,_0x465ea1,_0x4c0453){const _0x40a622=a11_0x35bb;let _0x369a81=0x0;for(let _0x436c65=0x0;_0x436c65<MAX_POLLS;_0x436c65++){if(_0x4c0453['aborted'])throw CliErrors[_0x40a622(0x17f)](_0x40a622(0x187));let _0x3ad757;try{_0x3ad757=await fetchDeviceToken(_0xedf2ad,_0x465ea1);}catch(_0x1270a9){if(_0x1270a9 instanceof Error&&_0x1270a9[_0x40a622(0x194)]===_0x40a622(0x174))throw CliErrors['cancelled']('Device\x20authorization\x20cancelled.');_0x369a81++;if(_0x369a81>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x40a622(0x163)](_0x40a622(0x1a3));writeCliSideChannelLine(_0x40a622(0x196)+_0x369a81+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x40a622(0x180)),await sleep(POLL_INTERVAL_MS);continue;}_0x369a81=0x0;if(_0x3ad757[_0x40a622(0x178)]===_0x40a622(0x183)){if(!_0x3ad757[_0x40a622(0x15f)])throw CliErrors[_0x40a622(0x1a2)](_0x40a622(0x177));return _0x3ad757[_0x40a622(0x15f)];}if(_0x3ad757[_0x40a622(0x178)]===_0x40a622(0x18a)){deleteStoredDeviceCode();throw CliErrors[_0x40a622(0x16e)](_0x40a622(0x199));}const _0x140d91=(_0x436c65+0x1)*POLL_INTERVAL_MS,_0x49aaf7=DEVICE_CODE_TTL_MS-_0x140d91,_0x4424b3=Math['floor'](_0x49aaf7/0xea60),_0x50ee78=Math[_0x40a622(0x17b)](_0x49aaf7%0xea60/0x3e8);process[_0x40a622(0x16c)][_0x40a622(0x16a)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x4424b3+':'+String(_0x50ee78)[_0x40a622(0x16f)](0x2,'0')+_0x40a622(0x181)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors['validation'](_0x40a622(0x17a));}function sleep(_0x5da3a0){return new Promise(_0x131287=>setTimeout(_0x131287,_0x5da3a0));}function a11_0x3cf0(){const _0x141be0=['application/json','Invalid\x20access_key\x20returned\x20by\x20server.','status','global','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','floor','/api/device-auth/token','json','lovrabet-cli','cancelled','),\x20retrying...','\x20remaining','object','success','Device\x20authorization\x20successful.','21TQAgWe','global-default','Device\x20authorization\x20cancelled.','abort','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','expired','boolean','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','&source=','Device\x20auth\x20API\x20returned\x20HTTP\x20','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','16tlOmyR','stringify','utf8','string','name','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\x20auth\x20API\x20error\x20(','scope','once','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','bool','auth','toISOString','signal','2155570jAkgJF','368345ZoYBMn','1690686AjNOSS','849474fhoFZK','apiError','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','After\x20authorizing,\x20re-run:\x20','Write\x20to\x20project\x20config','homeDirName','createdAt','trim','access_key','28894xmbbPg','\x20config.','project','networkError','3619280MdJffw','286892NOdnJB','randomUUID','nonInteractive','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','accessKey','write','6caBEBV','stderr','code','validation','padStart','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','url-only','SIGINT','removeListener','AbortError','data'];a11_0x3cf0=function(){return _0x141be0;};return a11_0x3cf0();}export const authDeviceDefinition={'service':a11_0x47434d(0x19b),'command':'device','description':a11_0x47434d(0x189),'risk':'write','confirmationDescription':a11_0x47434d(0x195),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x47434d(0x179),'type':a11_0x47434d(0x18b),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a11_0x47434d(0x162),'type':a11_0x47434d(0x18b),'description':a11_0x47434d(0x1a5),'default':![]},{'name':'source','type':a11_0x47434d(0x193),'description':a11_0x47434d(0x168),'default':a11_0x47434d(0x17e)},{'name':a11_0x47434d(0x171),'type':'boolean','description':a11_0x47434d(0x170),'default':![]}],async 'execute'(_0x132508){const _0x270eb9=a11_0x47434d,_0x302111=resolveAuthScopeFlags(_0x132508),_0x16ed56=_0x302111[_0x270eb9(0x179)]?_0x270eb9(0x179):_0x270eb9(0x162),_0x4c47d2=readScopedConfig(_0x302111);if(_0x4c47d2[_0x270eb9(0x169)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x244cec=(_0x132508['str']('source')||_0x270eb9(0x17e))[_0x270eb9(0x15e)](),_0x31a80f=getUserDomain(),_0x127d03=readStoredDeviceCode(),_0xd8bd1a=_0x127d03&&!isStoredDeviceCodeExpired(_0x127d03)?_0x127d03[_0x270eb9(0x16d)]:((()=>{const _0x268f2e=generateDeviceCode();return writeStoredDeviceCode(_0x268f2e,_0x16ed56),_0x268f2e;})()),_0x40d5ed=buildDeviceAuthUrl(_0x31a80f,_0xd8bd1a,_0x244cec);if(_0x132508[_0x270eb9(0x19a)](_0x270eb9(0x171)))return console['log'](_0x40d5ed),{'ok':!![]};writeCliSideChannelLine(_0x270eb9(0x18c)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x40d5ed),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x270eb9(0x18f));if(_0x132508[_0x270eb9(0x167)])return writeCliSideChannelLine(_0x270eb9(0x1a4)+CLI_BIN_NAME+'\x20auth\x20device'),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x162176=new AbortController(),_0x2b207f=()=>{const _0x2638b6=_0x270eb9;_0x162176[_0x2638b6(0x188)](),process['removeListener'](_0x2638b6(0x172),_0x2b207f);};process[_0x270eb9(0x198)](_0x270eb9(0x172),_0x2b207f);let _0x539b47;try{_0x539b47=await pollDeviceToken(_0x31a80f,_0xd8bd1a,_0x162176[_0x270eb9(0x19d)]);}finally{process[_0x270eb9(0x173)]('SIGINT',_0x2b207f);}if(!ACCESS_KEY_PATTERN['test'](_0x539b47))throw CliErrors[_0x270eb9(0x1a2)]('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x3191a7=readScopedConfig(_0x302111);return _0x3191a7[_0x270eb9(0x169)]=_0x539b47,writeScopedConfig(_0x3191a7,_0x302111),deleteStoredDeviceCode(),process[_0x270eb9(0x16c)][_0x270eb9(0x16a)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x16ed56+_0x270eb9(0x161)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x270eb9(0x184)};}};