@lovrabet/lovrabet-cli 2.1.9-beta.3 → 2.1.9

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 (117) 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/app-config/shared.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schema.js +1 -1
  39. package/lib/commands/service/dynamic.js +1 -1
  40. package/lib/commands/service/index.js +1 -1
  41. package/lib/commands/service/registry.js +1 -1
  42. package/lib/commands/skill/commands/create.js +1 -1
  43. package/lib/commands/skill/commands/install.js +1 -1
  44. package/lib/commands/skill/commands/list.js +1 -1
  45. package/lib/commands/skill/commands/push.js +1 -1
  46. package/lib/commands/skill/commands/validate.js +1 -1
  47. package/lib/commands/skill/flags.js +1 -1
  48. package/lib/commands/skill/index.js +1 -1
  49. package/lib/commands/skill/manifest-helpers.js +1 -1
  50. package/lib/commands/skill/push-execute.js +1 -1
  51. package/lib/commands/skill/push-flow-helpers.js +1 -1
  52. package/lib/commands/skill/push-retarget.js +1 -1
  53. package/lib/commands/skill/scopes.js +1 -1
  54. package/lib/commands/skill/summary.js +1 -1
  55. package/lib/commands/skill/templates.js +1 -1
  56. package/lib/commands/skill/validate.js +1 -1
  57. package/lib/commands/sql/detail.js +1 -1
  58. package/lib/commands/sql/exec.js +1 -1
  59. package/lib/commands/sql/index.js +1 -1
  60. package/lib/commands/update.js +1 -1
  61. package/lib/commands/workspace/index.js +1 -1
  62. package/lib/config/schema.js +1 -1
  63. package/lib/constant/app.js +1 -1
  64. package/lib/constant/auth-mode.js +1 -1
  65. package/lib/constant/cli.js +1 -1
  66. package/lib/constant/defaults.js +1 -1
  67. package/lib/constant/distribution.js +1 -1
  68. package/lib/constant/domain.js +1 -1
  69. package/lib/constant/env.js +1 -1
  70. package/lib/constant/output.js +1 -1
  71. package/lib/constant/product.js +1 -1
  72. package/lib/constant/risk.js +1 -1
  73. package/lib/constant/url.js +1 -1
  74. package/lib/context.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/db-resolver.js +1 -1
  77. package/lib/core/sdk-client.js +1 -1
  78. package/lib/errors.js +1 -1
  79. package/lib/framework/build-all-flags.js +1 -1
  80. package/lib/framework/dryrun.js +1 -1
  81. package/lib/framework/flags.js +1 -1
  82. package/lib/framework/help.js +1 -1
  83. package/lib/framework/index.js +1 -1
  84. package/lib/framework/output.js +1 -1
  85. package/lib/framework/preparse.js +1 -1
  86. package/lib/framework/response.js +1 -1
  87. package/lib/framework/runner-confirmation.js +1 -1
  88. package/lib/framework/runner-error.js +1 -1
  89. package/lib/framework/runner.js +1 -1
  90. package/lib/framework/schema-export.js +1 -1
  91. package/lib/framework/service-order.js +1 -1
  92. package/lib/framework/types.js +1 -1
  93. package/lib/generated/build-info.js +1 -1
  94. package/lib/help.js +1 -1
  95. package/lib/skills/npx-skills-add.js +1 -1
  96. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  97. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  98. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  99. package/lib/skills/runtime-skill-sync/links.js +1 -1
  100. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  101. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  102. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  103. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  104. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  105. package/lib/skills/runtime-skill-sync/push.js +1 -1
  106. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  107. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  109. package/lib/skills/runtime-skill-sync.js +1 -1
  110. package/lib/utils/apply-jq-filter.js +1 -1
  111. package/lib/utils/logger.js +1 -1
  112. package/lib/utils/params.js +1 -1
  113. package/lib/utils/platform.js +1 -1
  114. package/lib/utils/update-notice.js +1 -1
  115. package/lib/utils/version.js +1 -1
  116. package/lib/utils/write-cli-side-channel.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x50a4a1=a30_0x4b42;function a30_0x4b42(_0x53d9c1,_0x143eb5){_0x53d9c1=_0x53d9c1-0x6a;const _0x2df086=a30_0x2df0();let _0x4b4258=_0x2df086[_0x53d9c1];return _0x4b4258;}(function(_0x3b420e,_0x57b063){const _0x143724=a30_0x4b42,_0x4e81dd=_0x3b420e();while(!![]){try{const _0x4fb0b5=-parseInt(_0x143724(0x70))/0x1+parseInt(_0x143724(0x76))/0x2*(parseInt(_0x143724(0x71))/0x3)+-parseInt(_0x143724(0x82))/0x4*(parseInt(_0x143724(0x89))/0x5)+-parseInt(_0x143724(0x74))/0x6+parseInt(_0x143724(0x7e))/0x7+parseInt(_0x143724(0x85))/0x8*(parseInt(_0x143724(0x79))/0x9)+parseInt(_0x143724(0x88))/0xa*(-parseInt(_0x143724(0x75))/0xb);if(_0x4fb0b5===_0x57b063)break;else _0x4e81dd['push'](_0x4e81dd['shift']());}catch(_0x4f7801){_0x4e81dd['push'](_0x4e81dd['shift']());}}}(a30_0x2df0,0x79a2d));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x50a4a1(0x7a),'type':a30_0x50a4a1(0x8b),'required':!![],'description':a30_0x50a4a1(0x8c)},FILEPATH_FLAG={'name':'filepath','type':a30_0x50a4a1(0x8b),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload'},DOWNLOAD_FLAG={'name':a30_0x50a4a1(0x8d),'type':'boolean','description':a30_0x50a4a1(0x80)};function a30_0x2df0(){const _0x1dc9c6=['appCode','4vkJEcr','filepath','File','8hEfNQL','Preview:\x20upload\x20','path','30RWETha','1854790TDZtJX','POST','string','Path\x20to\x20the\x20local\x20file\x20to\x20upload','download','Uploaded\x20file.','query-url','str','read','upload','write','\x20to\x20runtime\x20app\x20','765416TNTEDp','251070yPiQnF','trim','body','1006176upbpio','1059938PTTBWK','22ohQZEB','bool','build','6050394BZIjHr','file','Uploaded\x20file:\x20','description','validation','3489563QsTkeR','filePath','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported'];a30_0x2df0=function(){return _0x1dc9c6;};return a30_0x2df0();}function requireFilePath(_0x295cc2){const _0x26b335=a30_0x50a4a1,_0xebcb7=_0x295cc2[_0x26b335(0x72)]();if(!_0xebcb7)throw CliErrors[_0x26b335(0x7d)]('filePath\x20is\x20required.');return _0xebcb7;}const fileUpload={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6d),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x50a4a1(0x6e),'flags':[FILE_FLAG],async 'dryRun'(_0x27dcca){const _0x126662=a30_0x50a4a1,_0x496279=requireRuntimeUploadFile(_0x27dcca[_0x126662(0x6b)](_0x126662(0x7a)),_0x126662(0x84));return dryRun(_0x126662(0x8a),'/client/uploadFile')[_0x126662(0x73)]({'appCode':_0x27dcca['appCode'],'multipart':{'file':_0x496279}})[_0x126662(0x7c)](_0x126662(0x86)+_0x496279[_0x126662(0x87)]+_0x126662(0x6f)+_0x27dcca[_0x126662(0x81)])[_0x126662(0x78)]();},async 'execute'(_0x43f8a0){const _0x473769=a30_0x50a4a1,_0x54b2f0=requireRuntimeUploadFile(_0x43f8a0[_0x473769(0x6b)](_0x473769(0x7a)),_0x473769(0x84)),_0x554f31=await uploadRuntimeFile(_0x43f8a0[_0x473769(0x81)],_0x54b2f0['path']);return{'ok':!![],'data':_0x554f31,'message':_0x554f31['filePath']?_0x473769(0x7b)+_0x554f31[_0x473769(0x7f)]:_0x473769(0x8e)};}},fileQueryUrl={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6a),'description':'Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','risk':a30_0x50a4a1(0x6c),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x37dd33){const _0x429e0f=a30_0x50a4a1,_0x5f11b7=requireFilePath(_0x37dd33['str'](_0x429e0f(0x83))),_0x60ccf7=await queryRuntimeFileUrl(_0x5f11b7,{'download':_0x37dd33[_0x429e0f(0x77)]('download')});return{'ok':!![],'data':_0x60ccf7};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x17a195=a30_0x517e;(function(_0x272b3e,_0x22ad4f){const _0x5c05f2=a30_0x517e,_0x29c7de=_0x272b3e();while(!![]){try{const _0x138449=-parseInt(_0x5c05f2(0x128))/0x1+parseInt(_0x5c05f2(0x123))/0x2+parseInt(_0x5c05f2(0x129))/0x3+-parseInt(_0x5c05f2(0x12c))/0x4+parseInt(_0x5c05f2(0x11c))/0x5*(parseInt(_0x5c05f2(0x11a))/0x6)+-parseInt(_0x5c05f2(0x115))/0x7+parseInt(_0x5c05f2(0x10c))/0x8;if(_0x138449===_0x22ad4f)break;else _0x29c7de['push'](_0x29c7de['shift']());}catch(_0x52ba99){_0x29c7de['push'](_0x29c7de['shift']());}}}(a30_0x2e2d,0x5d042));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a30_0x2e2d(){const _0x3e2179=['335073fOwJUz','662265UPPaMD','POST','file','1230268mJnlgN','appCode','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','string','body','5228880DwEbWw','filePath','filepath','/client/uploadFile','download','str','Path\x20to\x20the\x20local\x20file\x20to\x20upload','\x20to\x20runtime\x20app\x20','Preview:\x20upload\x20','3633084rooYns','path','trim','Uploaded\x20file:\x20','bool','156588IgBUlM','description','35SRSgeX','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','File','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','read','build','filePath\x20is\x20required.','971190aMTaCk','Uploaded\x20file.','write','upload','query-url'];a30_0x2e2d=function(){return _0x3e2179;};return a30_0x2e2d();}import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x17a195(0x12b),'type':'string','required':!![],'description':a30_0x17a195(0x112)},FILEPATH_FLAG={'name':a30_0x17a195(0x10e),'type':a30_0x17a195(0x10a),'required':!![],'description':a30_0x17a195(0x11d)},DOWNLOAD_FLAG={'name':'download','type':'boolean','description':'Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported'};function requireFilePath(_0x3a8859){const _0x5ea7f7=a30_0x17a195,_0x38b7de=_0x3a8859[_0x5ea7f7(0x117)]();if(!_0x38b7de)throw CliErrors['validation'](_0x5ea7f7(0x122));return _0x38b7de;}function a30_0x517e(_0x254f18,_0x14c76f){_0x254f18=_0x254f18-0x108;const _0x2e2d0d=a30_0x2e2d();let _0x517e1e=_0x2e2d0d[_0x254f18];return _0x517e1e;}const fileUpload={'service':a30_0x17a195(0x12b),'command':a30_0x17a195(0x126),'description':a30_0x17a195(0x109),'risk':a30_0x17a195(0x125),'flags':[FILE_FLAG],async 'dryRun'(_0xbb861f){const _0x354df7=a30_0x17a195,_0x40ad39=requireRuntimeUploadFile(_0xbb861f[_0x354df7(0x111)]('file'),_0x354df7(0x11e));return dryRun(_0x354df7(0x12a),_0x354df7(0x10f))[_0x354df7(0x10b)]({'appCode':_0xbb861f[_0x354df7(0x108)],'multipart':{'file':_0x40ad39}})[_0x354df7(0x11b)](_0x354df7(0x114)+_0x40ad39[_0x354df7(0x116)]+_0x354df7(0x113)+_0xbb861f[_0x354df7(0x108)])[_0x354df7(0x121)]();},async 'execute'(_0x2d0bb1){const _0x4bed8=a30_0x17a195,_0x47a7b7=requireRuntimeUploadFile(_0x2d0bb1['str']('file'),'File'),_0x3472dc=await uploadRuntimeFile(_0x2d0bb1[_0x4bed8(0x108)],_0x47a7b7['path']);return{'ok':!![],'data':_0x3472dc,'message':_0x3472dc[_0x4bed8(0x10d)]?_0x4bed8(0x118)+_0x3472dc['filePath']:_0x4bed8(0x124)};}},fileQueryUrl={'service':'file','command':a30_0x17a195(0x127),'description':a30_0x17a195(0x11f),'risk':a30_0x17a195(0x120),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0xbc3739){const _0x59a79d=a30_0x17a195,_0x57dad1=requireFilePath(_0xbc3739[_0x59a79d(0x111)](_0x59a79d(0x10e))),_0x514d3e=await queryRuntimeFileUrl(_0x57dad1,{'download':_0xbc3739[_0x59a79d(0x119)](_0x59a79d(0x110))});return{'ok':!![],'data':_0x514d3e};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x4ddddd=a31_0x579b;(function(_0x3156a7,_0x1ddc51){const _0x188162=a31_0x579b,_0x573910=_0x3156a7();while(!![]){try{const _0x7587c5=parseInt(_0x188162(0x193))/0x1*(-parseInt(_0x188162(0x1b3))/0x2)+-parseInt(_0x188162(0x185))/0x3+parseInt(_0x188162(0x188))/0x4+-parseInt(_0x188162(0x1b1))/0x5*(parseInt(_0x188162(0x18a))/0x6)+-parseInt(_0x188162(0x197))/0x7*(parseInt(_0x188162(0x1a2))/0x8)+parseInt(_0x188162(0x19f))/0x9+parseInt(_0x188162(0x194))/0xa*(parseInt(_0x188162(0x189))/0xb);if(_0x7587c5===_0x1ddc51)break;else _0x573910['push'](_0x573910['shift']());}catch(_0x9b00b8){_0x573910['push'](_0x573910['shift']());}}}(a31_0x4bc5,0x3396e));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x199)},{'name':a31_0x4ddddd(0x1b7),'type':a31_0x4ddddd(0x19e),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x4ddddd(0x1b7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4ddddd(0x17e),'type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':a31_0x4ddddd(0x18f),'type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x4ddddd(0x19c),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x1a7)},{'name':a31_0x4ddddd(0x1b7),'type':'string','description':a31_0x4ddddd(0x181),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':'yes','type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export async function runInit(_0x2aa960){const _0xe99c62=a31_0x4ddddd,_0x564465=isNonInteractiveMode(_0x2aa960),_0x8f63d2=_0x2aa960[_0xe99c62(0x17e)]?_0xe99c62(0x17e):_0xe99c62(0x17c),_0x37ac28=resolveWriteConfigPath(_0x8f63d2);try{_0x564465?await runNonInteractive(_0x2aa960,_0x37ac28):await runInteractive(_0x2aa960,_0x37ac28);}catch(_0x30ebfc){if(_0x30ebfc instanceof AbortPrompt)throw CliErrors[_0xe99c62(0x17f)]();throw _0x30ebfc;}}export async function runInitImport(_0x194540){const _0x25c816=a31_0x4ddddd,_0x52e205=_0x194540[_0x25c816(0x17e)]?'global':_0x25c816(0x17c),_0x4ab9a9=resolveWriteConfigPath(_0x52e205);await runFromImport(_0x194540,_0x4ab9a9);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x24b4b3,_0xb98036){const _0x200f7a=a31_0x4ddddd,_0x22bdd9=resolveFilePath(_0x24b4b3['file']);if(!existsSync(_0x22bdd9))throw CliErrors[_0x200f7a(0x186)](_0x200f7a(0x1b4)+_0x22bdd9);const _0x2678d9=readSourceFile(_0x22bdd9),_0x3d71e8=convertToRuntimeConfig(_0x2678d9);_0x24b4b3[_0x200f7a(0x179)]&&(_0x3d71e8['appcode']=String(_0x24b4b3[_0x200f7a(0x179)]));_0x24b4b3[_0x200f7a(0x1b7)]&&(_0x3d71e8[_0x200f7a(0x1b7)]=resolveInitEnv(_0x24b4b3));if(!_0x3d71e8[_0x200f7a(0x179)])throw CliErrors['validation'](_0x200f7a(0x1a4),_0x200f7a(0x192));await writeInitConfig(_0xb98036,_0x3d71e8,_0x24b4b3),console[_0x200f7a(0x196)](_0x200f7a(0x17d)+_0x22bdd9),console[_0x200f7a(0x196)]('\x20\x20config:\x20\x20'+_0xb98036),console['log'](_0x200f7a(0x195)+_0x3d71e8[_0x200f7a(0x179)]);if(_0x3d71e8[_0x200f7a(0x1ac)])console[_0x200f7a(0x196)]('\x20\x20default:\x20'+_0x3d71e8['defaultApp']);}function convertToRuntimeConfig(_0x24177c){const _0x517c4c=a31_0x4ddddd;if(_0x24177c[_0x517c4c(0x1b0)]&&typeof _0x24177c['apps']===_0x517c4c(0x1a9))throw CliErrors['validation'](_0x517c4c(0x180),_0x517c4c(0x1b2));const _0x285a94={};for(const _0x11bfe8 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x24177c[_0x11bfe8]!==undefined&&(_0x285a94[_0x11bfe8]=_0x24177c[_0x11bfe8]);}return!_0x285a94[_0x517c4c(0x1a3)]&&(_0x285a94[_0x517c4c(0x1a3)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x285a94;}async function runNonInteractive(_0x150b12,_0x4d8fd4){const _0x310097=a31_0x4ddddd,_0xb29c93=_0x150b12[_0x310097(0x179)];if(!_0xb29c93)throw CliErrors[_0x310097(0x183)](_0x310097(0x179),'Usage:\x20'+CLI_BIN_NAME+_0x310097(0x1ad));const _0x5905f4=resolveInitEnv(_0x150b12);await writeInitConfig(_0x4d8fd4,{'appcode':_0xb29c93,'env':_0x5905f4},_0x150b12),console[_0x310097(0x196)](_0x310097(0x1b8)+_0x4d8fd4),console[_0x310097(0x196)](_0x310097(0x195)+_0xb29c93),console[_0x310097(0x196)](_0x310097(0x1ae)+_0x5905f4);}function a31_0x579b(_0x19b575,_0x40d972){_0x19b575=_0x19b575-0x177;const _0x4bc530=a31_0x4bc5();let _0x579b31=_0x4bc530[_0x19b575];return _0x579b31;}async function runInteractive(_0x574443,_0x55bb15){const _0x268003=a31_0x4ddddd,_0x36bbfa=loadExisting(_0x55bb15),_0x2be27a=typeof _0x36bbfa?.[_0x268003(0x179)]===_0x268003(0x19e)?_0x36bbfa['appcode']:'',_0x6cc82d=resolveInitEnv(_0x574443);console['log'](CLI_BIN_NAME+_0x268003(0x18b)+PRODUCT_CONFIG[_0x268003(0x190)]+'\x0a');if(existsSync(_0x55bb15)&&!_0x574443[_0x268003(0x18f)]){const _0x2d0d9f=await promptYesNo(_0x268003(0x1a1)+_0x55bb15+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2d0d9f){console[_0x268003(0x196)](_0x268003(0x1af));return;}}const _0xa932d7=typeof _0x574443['appcode']==='string'?_0x574443[_0x268003(0x179)][_0x268003(0x1b5)]():'';let _0x5b132f=_0xa932d7;!_0x5b132f&&(_0x5b132f=await promptInput(_0x268003(0x177),_0x2be27a));if(!_0x5b132f[_0x268003(0x1b5)]())throw CliErrors['validation'](_0x268003(0x191));await writeInitConfig(_0x55bb15,{'appcode':_0x5b132f[_0x268003(0x1b5)](),'env':_0x6cc82d},_0x574443),console[_0x268003(0x196)](_0x268003(0x187)+_0x55bb15),console[_0x268003(0x196)]('\x20\x20appcode:\x20'+_0x5b132f[_0x268003(0x1b5)]()),console[_0x268003(0x196)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x6cc82d);}async function writeInitConfig(_0x3249e5,_0x30c1d8,_0x2d6f7a){const _0x434654=a31_0x4ddddd;let _0x456ed8={};existsSync(_0x3249e5)&&!_0x2d6f7a[_0x434654(0x18f)]&&(_0x456ed8=readConfigFile(_0x3249e5));for(const [_0x2e5eac,_0x4c2251]of Object[_0x434654(0x1ab)](_0x30c1d8)){_0x4c2251!==undefined&&(_0x456ed8[_0x2e5eac]=_0x4c2251);}if(_0x456ed8[_0x434654(0x17b)])delete _0x456ed8[_0x434654(0x17b)];writeConfigFile(_0x3249e5,_0x456ed8);}class AbortPrompt extends Error{constructor(){const _0x3cccf3=a31_0x4ddddd;super(_0x3cccf3(0x18d)),this['name']=_0x3cccf3(0x198);}}function createSafeRl(){const _0x53bc7d=a31_0x4ddddd,_0x4caa0e=createInterface({'input':process[_0x53bc7d(0x19a)],'output':process['stdout']});let _0x49d7b8;const _0x4e62c0=new Promise((_0x46449e,_0x200631)=>{const _0x5c89da=_0x53bc7d;_0x49d7b8=()=>{const _0x190352=a31_0x579b;_0x49d7b8&&(_0x4caa0e[_0x190352(0x1b9)]('SIGINT',_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}_0x200631(new AbortPrompt());},_0x4caa0e['once'](_0x5c89da(0x1b6),_0x49d7b8);}),_0x33e245=()=>{const _0x1c4eb=_0x53bc7d;_0x49d7b8&&(_0x4caa0e[_0x1c4eb(0x1b9)](_0x1c4eb(0x1b6),_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}};return{'rl':_0x4caa0e,'abortPromise':_0x4e62c0,'disposeSuccess':_0x33e245};}async function promptInput(_0x266108,_0x229105){const _0x440cb1=a31_0x4ddddd,{rl:_0x5726ca,abortPromise:_0x4d45ce,disposeSuccess:_0x42d901}=createSafeRl(),_0x2f5287=new Promise(_0x44a5e7=>{const _0xe38b=a31_0x579b,_0x50df91=_0x229105?'\x20\x20'+_0x266108+'\x20('+_0x229105+_0xe38b(0x1ba):'\x20\x20'+_0x266108+':\x20';_0x5726ca[_0xe38b(0x1a8)](_0x50df91,_0x1c0edc=>{const _0x58ee34=_0xe38b;_0x42d901(),_0x44a5e7(_0x1c0edc[_0x58ee34(0x1b5)]()||_0x229105);});});return Promise[_0x440cb1(0x18c)]([_0x2f5287,_0x4d45ce]);}async function promptYesNo(_0x17da4f,_0x55f7e6){const _0x4a2989=a31_0x4ddddd,{rl:_0x399882,abortPromise:_0x180c2a,disposeSuccess:_0x38d39f}=createSafeRl(),_0xac70f5=new Promise(_0x51340a=>{const _0x3b06bd=a31_0x579b,_0x4f6ae5=_0x55f7e6?'[Y/n]':_0x3b06bd(0x19d);_0x399882['question']('\x20\x20'+_0x17da4f+'\x20'+_0x4f6ae5+':\x20',_0x22688c=>{const _0x15c42c=_0x3b06bd;_0x38d39f();const _0x4f6b45=_0x22688c[_0x15c42c(0x1b5)]()[_0x15c42c(0x1a6)]();if(_0x4f6b45==='y'||_0x4f6b45===_0x15c42c(0x18f))_0x51340a(!![]);else{if(_0x4f6b45==='n'||_0x4f6b45==='no')_0x51340a(![]);else _0x51340a(_0x55f7e6);}});});return Promise[_0x4a2989(0x18c)]([_0xac70f5,_0x180c2a]);}function loadExisting(_0x2ed11a){if(!existsSync(_0x2ed11a))return null;return readConfigFile(_0x2ed11a);}function a31_0x4bc5(){const _0x5d515d=['env','Initialized\x20','removeListener','):\x20','App\x20code','Skip\x20confirmation\x20when\x20overwriting','appcode','parse','app','project','Imported\x20from\x20','global','cancelled','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20env',')\x20instead\x20of\x20project','flagMissing','\x22.\x20Allowed:\x20','415095KvYJXr','validation','\x0aInitialized\x20','160508wsdSzW','584606ilnCIU','771246JDiZCA','\x20init\x20—\x20Create\x20','race','User\x20aborted\x20prompt','Write\x20to\x20global\x20(~/','yes','newConfigFileName','App\x20code\x20cannot\x20be\x20empty.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','141gzuRYM','220yqOrts','\x20\x20appcode:\x20','log','7fwEEWN','AbortPrompt','App\x20code\x20for\x20the\x20project','stdin','cwd','file','[y/N]','string','2119401dNbiIa','Invalid\x20env\x20\x22','File\x20','2520096XzbZQO','riskLevel','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','boolean','toLowerCase','Override\x20imported\x20default\x20appcode','question','object','join','entries','defaultApp','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20env:\x20\x20\x20\x20\x20','Aborted.','apps','15CrwTcx','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','5596fhgOot','Source\x20file\x20not\x20found:\x20','trim','SIGINT'];a31_0x4bc5=function(){return _0x5d515d;};return a31_0x4bc5();}function resolveFilePath(_0x336b21){const _0x1ce3e2=a31_0x4ddddd;return isAbsolute(_0x336b21)?_0x336b21:resolve(process[_0x1ce3e2(0x19b)](),_0x336b21);}function readSourceFile(_0x59195c){const _0x1a5a3c=a31_0x4ddddd;try{const _0x33dad6=readFileSync(_0x59195c,{'encoding':'utf8'});return JSON[_0x1a5a3c(0x17a)](_0x33dad6);}catch(_0x21f50d){throw CliErrors[_0x1a5a3c(0x186)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x21f50d['message']);}}function resolveInitEnv(_0x1a8502){const _0x21628b=a31_0x4ddddd,_0x57af46=_0x1a8502[_0x21628b(0x1b7)];if(_0x57af46===undefined||_0x57af46==='')return DEFAULT_CONFIG_VALUES[_0x21628b(0x1b7)];if(!RUNTIME_ENV_VALUES['includes'](_0x57af46))throw CliErrors[_0x21628b(0x186)](_0x21628b(0x1a0)+_0x57af46+_0x21628b(0x184)+RUNTIME_ENV_VALUES[_0x21628b(0x1aa)](',\x20'));return _0x57af46;}
1
+ const a31_0x480359=a31_0xf9fb;(function(_0x144a05,_0x4e4d5b){const _0x1ee5b1=a31_0xf9fb,_0x30cf2c=_0x144a05();while(!![]){try{const _0x5b2547=parseInt(_0x1ee5b1(0x81))/0x1+-parseInt(_0x1ee5b1(0x84))/0x2+parseInt(_0x1ee5b1(0x97))/0x3+parseInt(_0x1ee5b1(0xa2))/0x4+-parseInt(_0x1ee5b1(0xa9))/0x5*(-parseInt(_0x1ee5b1(0xa1))/0x6)+parseInt(_0x1ee5b1(0xa7))/0x7+-parseInt(_0x1ee5b1(0xbb))/0x8;if(_0x5b2547===_0x4e4d5b)break;else _0x30cf2c['push'](_0x30cf2c['shift']());}catch(_0x2aabc6){_0x30cf2c['push'](_0x30cf2c['shift']());}}}(a31_0x3ca3,0x31a14));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x480359(0x85),'type':a31_0x480359(0x92),'description':a31_0x480359(0xb3)},{'name':a31_0x480359(0x7c),'type':a31_0x480359(0x92),'description':a31_0x480359(0x90)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x480359(0xb2),'description':a31_0x480359(0x7e)+PRODUCT_CONFIG[a31_0x480359(0x88)]+a31_0x480359(0xa4),'default':![]},{'name':'yes','type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x480359(0x7d),'type':'string','description':a31_0x480359(0x8a),'required':!![]},{'name':a31_0x480359(0x85),'type':a31_0x480359(0x92),'description':a31_0x480359(0x7b)},{'name':'env','type':a31_0x480359(0x92),'description':a31_0x480359(0x93),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x480359(0x95),'type':a31_0x480359(0xb2),'description':a31_0x480359(0x7e)+PRODUCT_CONFIG[a31_0x480359(0x88)]+a31_0x480359(0xa4),'default':![]},{'name':'yes','type':a31_0x480359(0xb2),'description':a31_0x480359(0x86),'default':![]}];export async function runInit(_0x17e9e2){const _0x15c8a6=a31_0x480359,_0xd968e9=isNonInteractiveMode(_0x17e9e2),_0x29afa1=_0x17e9e2[_0x15c8a6(0x95)]?_0x15c8a6(0x95):'project',_0x11a525=resolveWriteConfigPath(_0x29afa1);try{_0xd968e9?await runNonInteractive(_0x17e9e2,_0x11a525):await runInteractive(_0x17e9e2,_0x11a525);}catch(_0x3aa32f){if(_0x3aa32f instanceof AbortPrompt)throw CliErrors[_0x15c8a6(0xa3)]();throw _0x3aa32f;}}export async function runInitImport(_0x108019){const _0x11f0a6=a31_0x480359,_0x2d92e6=_0x108019['global']?_0x11f0a6(0x95):'project',_0x3672ff=resolveWriteConfigPath(_0x2d92e6);await runFromImport(_0x108019,_0x3672ff);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x4f9ce1,_0x1e9938){const _0x441c32=a31_0x480359,_0x5cf5cc=resolveFilePath(_0x4f9ce1[_0x441c32(0x7d)]);if(!existsSync(_0x5cf5cc))throw CliErrors[_0x441c32(0xb5)](_0x441c32(0x94)+_0x5cf5cc);const _0x55c21c=readSourceFile(_0x5cf5cc),_0x56ef41=convertToRuntimeConfig(_0x55c21c);_0x4f9ce1[_0x441c32(0x85)]&&(_0x56ef41[_0x441c32(0x85)]=String(_0x4f9ce1[_0x441c32(0x85)]));_0x4f9ce1['env']&&(_0x56ef41[_0x441c32(0x7c)]=resolveInitEnv(_0x4f9ce1));if(!_0x56ef41[_0x441c32(0x85)])throw CliErrors[_0x441c32(0xb5)](_0x441c32(0x8d),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x1e9938,_0x56ef41,_0x4f9ce1),console[_0x441c32(0x89)]('Imported\x20from\x20'+_0x5cf5cc),console[_0x441c32(0x89)](_0x441c32(0x8b)+_0x1e9938),console[_0x441c32(0x89)](_0x441c32(0xb0)+_0x56ef41[_0x441c32(0x85)]);if(_0x56ef41[_0x441c32(0x98)])console[_0x441c32(0x89)]('\x20\x20default:\x20'+_0x56ef41['defaultApp']);}function convertToRuntimeConfig(_0x544408){const _0x55f969=a31_0x480359;if(_0x544408[_0x55f969(0x7f)]&&typeof _0x544408[_0x55f969(0x7f)]===_0x55f969(0xa0))throw CliErrors[_0x55f969(0xb5)](_0x55f969(0xaa),_0x55f969(0x99));const _0x1501d8={};for(const _0x33a59b of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x544408[_0x33a59b]!==undefined&&(_0x1501d8[_0x33a59b]=_0x544408[_0x33a59b]);}return!_0x1501d8[_0x55f969(0xa6)]&&(_0x1501d8[_0x55f969(0xa6)]=DEFAULT_CONFIG_VALUES[_0x55f969(0xa6)]),_0x1501d8;}async function runNonInteractive(_0x3dfd9d,_0x4b23bc){const _0x1efaa8=a31_0x480359,_0x49ddc0=_0x3dfd9d[_0x1efaa8(0x85)];if(!_0x49ddc0)throw CliErrors[_0x1efaa8(0x96)](_0x1efaa8(0x85),_0x1efaa8(0xac)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x56caea=resolveInitEnv(_0x3dfd9d);await writeInitConfig(_0x4b23bc,{'appcode':_0x49ddc0,'env':_0x56caea},_0x3dfd9d),console[_0x1efaa8(0x89)]('Initialized\x20'+_0x4b23bc),console[_0x1efaa8(0x89)](_0x1efaa8(0xb0)+_0x49ddc0),console[_0x1efaa8(0x89)](_0x1efaa8(0xb4)+_0x56caea);}async function runInteractive(_0x27606e,_0x25a1b6){const _0x49a59f=a31_0x480359,_0x43805f=loadExisting(_0x25a1b6),_0x1ef4c9=typeof _0x43805f?.[_0x49a59f(0x85)]==='string'?_0x43805f[_0x49a59f(0x85)]:'',_0x89669a=resolveInitEnv(_0x27606e);console[_0x49a59f(0x89)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x49a59f(0x88)]+'\x0a');if(existsSync(_0x25a1b6)&&!_0x27606e[_0x49a59f(0xa8)]){const _0x4ace6d=await promptYesNo('File\x20'+_0x25a1b6+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x4ace6d){console[_0x49a59f(0x89)](_0x49a59f(0x91));return;}}const _0xf80f80=typeof _0x27606e['appcode']===_0x49a59f(0x92)?_0x27606e[_0x49a59f(0x85)][_0x49a59f(0xab)]():'';let _0x3d552c=_0xf80f80;!_0x3d552c&&(_0x3d552c=await promptInput(_0x49a59f(0xb7),_0x1ef4c9));if(!_0x3d552c[_0x49a59f(0xab)]())throw CliErrors[_0x49a59f(0xb5)](_0x49a59f(0x9f));await writeInitConfig(_0x25a1b6,{'appcode':_0x3d552c[_0x49a59f(0xab)](),'env':_0x89669a},_0x27606e),console[_0x49a59f(0x89)]('\x0aInitialized\x20'+_0x25a1b6),console[_0x49a59f(0x89)](_0x49a59f(0xb0)+_0x3d552c['trim']()),console['log'](_0x49a59f(0xb4)+_0x89669a);}function a31_0xf9fb(_0x5840bb,_0x1d4698){_0x5840bb=_0x5840bb-0x7b;const _0x3ca33b=a31_0x3ca3();let _0xf9fb24=_0x3ca33b[_0x5840bb];return _0xf9fb24;}async function writeInitConfig(_0x2b0013,_0x82aad9,_0x2d8a0e){const _0x32eb81=a31_0x480359;let _0x53cbef={};existsSync(_0x2b0013)&&!_0x2d8a0e['yes']&&(_0x53cbef=readConfigFile(_0x2b0013));for(const [_0x2b5364,_0x2d6489]of Object[_0x32eb81(0x8c)](_0x82aad9)){_0x2d6489!==undefined&&(_0x53cbef[_0x2b5364]=_0x2d6489);}if(_0x53cbef[_0x32eb81(0xb8)])delete _0x53cbef[_0x32eb81(0xb8)];writeConfigFile(_0x2b0013,_0x53cbef);}class AbortPrompt extends Error{constructor(){const _0x41129e=a31_0x480359;super(_0x41129e(0xba)),this[_0x41129e(0x9d)]=_0x41129e(0x87);}}function createSafeRl(){const _0x5d3d83=a31_0x480359,_0x14ba3d=createInterface({'input':process[_0x5d3d83(0xa5)],'output':process[_0x5d3d83(0x9c)]});let _0x273fb3;const _0x459279=new Promise((_0x589358,_0x11be57)=>{const _0x453991=_0x5d3d83;_0x273fb3=()=>{const _0xf87a67=a31_0xf9fb;_0x273fb3&&(_0x14ba3d['removeListener'](_0xf87a67(0x8f),_0x273fb3),_0x273fb3=undefined);try{_0x14ba3d[_0xf87a67(0x80)]();}catch{}_0x11be57(new AbortPrompt());},_0x14ba3d['once'](_0x453991(0x8f),_0x273fb3);}),_0x1a5f96=()=>{const _0x15e181=_0x5d3d83;_0x273fb3&&(_0x14ba3d[_0x15e181(0xaf)](_0x15e181(0x8f),_0x273fb3),_0x273fb3=undefined);try{_0x14ba3d[_0x15e181(0x80)]();}catch{}};return{'rl':_0x14ba3d,'abortPromise':_0x459279,'disposeSuccess':_0x1a5f96};}async function promptInput(_0x21d654,_0x54741e){const _0x376182=a31_0x480359,{rl:_0x17ccbc,abortPromise:_0xe067fa,disposeSuccess:_0x53877f}=createSafeRl(),_0x43b694=new Promise(_0x2fe8bb=>{const _0x5335e3=a31_0xf9fb,_0x38a8c7=_0x54741e?'\x20\x20'+_0x21d654+'\x20('+_0x54741e+_0x5335e3(0x9e):'\x20\x20'+_0x21d654+':\x20';_0x17ccbc[_0x5335e3(0xb6)](_0x38a8c7,_0xe3ba84=>{const _0x17f17f=_0x5335e3;_0x53877f(),_0x2fe8bb(_0xe3ba84[_0x17f17f(0xab)]()||_0x54741e);});});return Promise[_0x376182(0xb1)]([_0x43b694,_0xe067fa]);}function a31_0x3ca3(){const _0x4fe99d=['9051AbZlyl','toLowerCase','\x22.\x20Allowed:\x20','222914jYLZSZ','appcode','Skip\x20confirmation\x20when\x20overwriting','AbortPrompt','newConfigFileName','log','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20\x20config:\x20\x20','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Failed\x20to\x20parse\x20source\x20file:\x20','SIGINT','Target\x20environment\x20(default\x20','Aborted.','string','Override\x20imported\x20default\x20env','Source\x20file\x20not\x20found:\x20','global','flagMissing','361701ELIhUp','defaultApp','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','join','Invalid\x20env\x20\x22','stdout','name','):\x20','App\x20code\x20cannot\x20be\x20empty.','object','362934SatbHz','1175816SDzRnk','cancelled',')\x20instead\x20of\x20project','stdin','riskLevel','1252965hCmiNu','yes','15sMbKMd','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','Usage:\x20','message','utf8','removeListener','\x20\x20appcode:\x20','race','boolean','App\x20code\x20for\x20the\x20project','\x20\x20env:\x20\x20\x20\x20\x20','validation','question','App\x20code','app','parse','User\x20aborted\x20prompt','3754344JZlGfs','Override\x20imported\x20default\x20appcode','env','file','Write\x20to\x20global\x20(~/','apps','close'];a31_0x3ca3=function(){return _0x4fe99d;};return a31_0x3ca3();}async function promptYesNo(_0xda798,_0x1a8854){const {rl:_0x29a21b,abortPromise:_0x1482bb,disposeSuccess:_0x596c15}=createSafeRl(),_0x648247=new Promise(_0x4d8860=>{const _0x3d50db=a31_0xf9fb,_0x1d6f40=_0x1a8854?'[Y/n]':'[y/N]';_0x29a21b[_0x3d50db(0xb6)]('\x20\x20'+_0xda798+'\x20'+_0x1d6f40+':\x20',_0x1be2da=>{const _0x5739e5=_0x3d50db;_0x596c15();const _0x59d823=_0x1be2da[_0x5739e5(0xab)]()[_0x5739e5(0x82)]();if(_0x59d823==='y'||_0x59d823===_0x5739e5(0xa8))_0x4d8860(!![]);else{if(_0x59d823==='n'||_0x59d823==='no')_0x4d8860(![]);else _0x4d8860(_0x1a8854);}});});return Promise['race']([_0x648247,_0x1482bb]);}function loadExisting(_0x565632){if(!existsSync(_0x565632))return null;return readConfigFile(_0x565632);}function resolveFilePath(_0x1df72b){return isAbsolute(_0x1df72b)?_0x1df72b:resolve(process['cwd'](),_0x1df72b);}function readSourceFile(_0x41afc6){const _0x40001e=a31_0x480359;try{const _0x4c3c74=readFileSync(_0x41afc6,{'encoding':_0x40001e(0xae)});return JSON[_0x40001e(0xb9)](_0x4c3c74);}catch(_0x15f43d){throw CliErrors[_0x40001e(0xb5)](_0x40001e(0x8e)+_0x15f43d[_0x40001e(0xad)]);}}function resolveInitEnv(_0xda5cbe){const _0x20fa7c=a31_0x480359,_0x2178fd=_0xda5cbe[_0x20fa7c(0x7c)];if(_0x2178fd===undefined||_0x2178fd==='')return DEFAULT_CONFIG_VALUES[_0x20fa7c(0x7c)];if(!RUNTIME_ENV_VALUES['includes'](_0x2178fd))throw CliErrors['validation'](_0x20fa7c(0x9b)+_0x2178fd+_0x20fa7c(0x83)+RUNTIME_ENV_VALUES[_0x20fa7c(0x9a)](',\x20'));return _0x2178fd;}
@@ -1 +1 @@
1
- const a32_0x2eb38e=a32_0x30bd;(function(_0x3fb39b,_0x828fd1){const _0x1ba58e=a32_0x30bd,_0x5f8d13=_0x3fb39b();while(!![]){try{const _0x333ed3=parseInt(_0x1ba58e(0x182))/0x1*(-parseInt(_0x1ba58e(0x189))/0x2)+parseInt(_0x1ba58e(0x18d))/0x3*(parseInt(_0x1ba58e(0x172))/0x4)+parseInt(_0x1ba58e(0x187))/0x5+-parseInt(_0x1ba58e(0x191))/0x6+-parseInt(_0x1ba58e(0x169))/0x7+parseInt(_0x1ba58e(0x18c))/0x8+parseInt(_0x1ba58e(0x185))/0x9*(parseInt(_0x1ba58e(0x15a))/0xa);if(_0x333ed3===_0x828fd1)break;else _0x5f8d13['push'](_0x5f8d13['shift']());}catch(_0x466678){_0x5f8d13['push'](_0x5f8d13['shift']());}}}(a32_0x3d8b,0x603ad));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a32_0x3d8b(){const _0x110636=['isFile','/client/knowledge-base/personal/','length','topk','list','appCode','File\x20path\x20is\x20required.','description','530OImQwr','detail','Created\x20KB\x20entry\x20','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','read','Updated\x20KB\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','string','version','ragStatus','--topk\x20must\x20be\x20a\x20positive\x20number.','bool','createTime','build','userId','4433072LRgpCu','validation','POST','metadata','map','file','title','/update','trim','4mIkYEI','number','search','scope','verbose','update','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','body','docId','create','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','utf8','ragErrorMessage','/client/knowledge-base/personal/create','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','str','321MDUwMV','File\x20not\x20found:\x20','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','171621YEGZPo','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','1045020igwjoa','flag','1744JzBGNo','write','Personal\x20knowledge-base\x20entry\x20ID','969480YwZCJQ','1156179yvxGbA','content','updateTime','query','2513244cbNjBy','num'];a32_0x3d8b=function(){return _0x110636;};return a32_0x3d8b();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x2eb38e(0x16f),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x2eb38e(0x16e),'type':a32_0x2eb38e(0x161),'required':!![],'description':a32_0x2eb38e(0x160)},QUERY_FLAG={'name':a32_0x2eb38e(0x190),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x2eb38e(0x196),'type':a32_0x2eb38e(0x173),'description':a32_0x2eb38e(0x180)};function readKnowledgeFile(_0x354425){const _0x2e2bed=a32_0x2eb38e;if(!_0x354425)throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x158));if(!existsSync(_0x354425))throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x183)+_0x354425);if(!statSync(_0x354425)[_0x2e2bed(0x193)]())throw CliErrors[_0x2e2bed(0x16a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x354425);return readFileSync(_0x354425,_0x2e2bed(0x17d));}function a32_0x30bd(_0x3beb5b,_0x2ff78f){_0x3beb5b=_0x3beb5b-0x158;const _0x3d8beb=a32_0x3d8b();let _0x30bd74=_0x3d8beb[_0x3beb5b];return _0x30bd74;}function summarizePersonalItem(_0x263ab9){const _0x472d7e=a32_0x2eb38e;return{'id':_0x263ab9['id'],'title':_0x263ab9['title'],'version':_0x263ab9['version'],'ragStatus':_0x263ab9[_0x472d7e(0x163)],'ragErrorMessage':_0x263ab9[_0x472d7e(0x17e)],'updateTime':_0x263ab9[_0x472d7e(0x18f)]};}function detailPersonalItem(_0x4567c2){const _0x3efeeb=a32_0x2eb38e;return{'id':_0x4567c2['id'],'appCode':_0x4567c2['appCode'],'scope':_0x4567c2[_0x3efeeb(0x175)],'userId':_0x4567c2[_0x3efeeb(0x168)],'title':_0x4567c2[_0x3efeeb(0x16f)],'content':_0x4567c2[_0x3efeeb(0x18e)]??'','version':_0x4567c2[_0x3efeeb(0x162)],'ragStatus':_0x4567c2[_0x3efeeb(0x163)],'ragErrorMessage':_0x4567c2['ragErrorMessage'],'createTime':_0x4567c2[_0x3efeeb(0x166)],'updateTime':_0x4567c2['updateTime']};}function summarizeSearchHit(_0x3119a0){const _0x6a08ab=a32_0x2eb38e;return{'scope':_0x3119a0[_0x6a08ab(0x175)],'docId':_0x3119a0[_0x6a08ab(0x17a)],'score':_0x3119a0['score'],'weightedScore':_0x3119a0['weightedScore'],'content':_0x3119a0['content'],'metadata':_0x3119a0[_0x6a08ab(0x16c)]};}function readTopK(_0x2a2196){const _0x4e6c5b=a32_0x2eb38e,_0x38440c=_0x2a2196[_0x4e6c5b(0x188)](_0x4e6c5b(0x196));if(_0x38440c===undefined||_0x38440c===null||_0x38440c==='')return undefined;const _0x3592a8=_0x2a2196['num'](_0x4e6c5b(0x196));if(!Number['isFinite'](_0x3592a8)||_0x3592a8<0x1)throw CliErrors[_0x4e6c5b(0x16a)](_0x4e6c5b(0x164));return _0x3592a8;}const kbList={'service':'kb','command':a32_0x2eb38e(0x197),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xe54a3a){const _0x877d3a=a32_0x2eb38e,_0x192900=await listPersonalKnowledgeBaseItems(_0xe54a3a[_0x877d3a(0x198)]);if(_0xe54a3a[_0x877d3a(0x165)](_0x877d3a(0x176)))return{'ok':!![],'data':{'total':_0x192900[_0x877d3a(0x195)],'items':_0x192900}};return{'ok':!![],'data':{'total':_0x192900['length'],'items':_0x192900[_0x877d3a(0x16d)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2eb38e(0x15b),'description':a32_0x2eb38e(0x186),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)}],async 'execute'(_0x3f1923){const _0x175e52=await getPersonalKnowledgeBaseItem(_0x3f1923['num']('id'),_0x3f1923['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x175e52)};}},kbCreate={'service':'kb','command':a32_0x2eb38e(0x17b),'description':a32_0x2eb38e(0x178),'risk':a32_0x2eb38e(0x18a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x538c1e){const _0x5b1c1b=a32_0x2eb38e,_0x5357b0=_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16f)),_0x151a76=readKnowledgeFile(_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16e))),_0x42786c=await createPersonalKnowledgeBaseItem(_0x538c1e[_0x5b1c1b(0x198)],{'title':_0x5357b0,'content':_0x151a76});return{'ok':!![],'data':summarizePersonalItem(_0x42786c),'message':_0x5b1c1b(0x15c)+_0x42786c['id']+'\x20('+_0x42786c['title']+')'};},async 'dryRun'(_0x1ada76){const _0xcc9a38=a32_0x2eb38e,_0x33a2cc=_0x1ada76['str'](_0xcc9a38(0x16f)),_0x9c6e06=readKnowledgeFile(_0x1ada76['str'](_0xcc9a38(0x16e)));return dryRun(_0xcc9a38(0x16b),_0xcc9a38(0x17f))['body']({'appCode':_0x1ada76['appCode'],'title':_0x33a2cc,'content':_0x9c6e06})[_0xcc9a38(0x159)](_0xcc9a38(0x184)+_0x33a2cc+'\x22')[_0xcc9a38(0x167)]();}},kbUpdate={'service':'kb','command':a32_0x2eb38e(0x177),'description':a32_0x2eb38e(0x15d),'risk':a32_0x2eb38e(0x18a),'flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x116e31){const _0x2aa04b=a32_0x2eb38e,_0x3186b3=_0x116e31[_0x2aa04b(0x192)]('id'),_0x5d8b73=readKnowledgeFile(_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16e))),_0x4ea52b=_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16f))||(await getPersonalKnowledgeBaseItem(_0x3186b3,_0x116e31[_0x2aa04b(0x198)]))[_0x2aa04b(0x16f)],_0x1b3767=await updatePersonalKnowledgeBaseItem(_0x3186b3,_0x116e31['appCode'],{'title':_0x4ea52b,'content':_0x5d8b73});return{'ok':!![],'data':summarizePersonalItem(_0x1b3767),'message':_0x2aa04b(0x15f)+_0x1b3767['id']+'\x20('+_0x1b3767[_0x2aa04b(0x16f)]+')'};},async 'dryRun'(_0x29bb86){const _0xa6721a=a32_0x2eb38e,_0x4f418a=_0x29bb86[_0xa6721a(0x192)]('id'),_0x2c85b9=readKnowledgeFile(_0x29bb86['str'](_0xa6721a(0x16e))),_0x1d6243=_0x29bb86[_0xa6721a(0x181)]('title')||(await getPersonalKnowledgeBaseItem(_0x4f418a,_0x29bb86[_0xa6721a(0x198)]))[_0xa6721a(0x16f)];return dryRun(_0xa6721a(0x16b),_0xa6721a(0x194)+_0x4f418a+_0xa6721a(0x170))[_0xa6721a(0x179)]({'appCode':_0x29bb86[_0xa6721a(0x198)],'title':_0x1d6243,'content':_0x2c85b9})[_0xa6721a(0x159)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x4f418a)['build']();}},kbSearch={'service':'kb','command':a32_0x2eb38e(0x174),'description':a32_0x2eb38e(0x17c),'risk':a32_0x2eb38e(0x15e),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x361645){const _0x297a00=a32_0x2eb38e;if(!_0x361645[_0x297a00(0x181)](_0x297a00(0x190))['trim']())throw CliErrors[_0x297a00(0x16a)]('Search\x20query\x20is\x20required.');readTopK(_0x361645);},async 'execute'(_0x2f0f09){const _0x34fea4=a32_0x2eb38e,_0x5e494c=_0x2f0f09['str'](_0x34fea4(0x190))[_0x34fea4(0x171)](),_0x1c668d=readTopK(_0x2f0f09),_0x464d97=await searchKnowledgeBase(_0x2f0f09[_0x34fea4(0x198)],{'query':_0x5e494c,'topK':_0x1c668d});return{'ok':!![],'data':{'total':_0x464d97[_0x34fea4(0x195)],'hits':_0x464d97[_0x34fea4(0x16d)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x47859e=a32_0x289a;(function(_0xcd6e47,_0x3c3976){const _0x33eff9=a32_0x289a,_0x366d6f=_0xcd6e47();while(!![]){try{const _0xe10a6b=-parseInt(_0x33eff9(0x109))/0x1+-parseInt(_0x33eff9(0x100))/0x2*(-parseInt(_0x33eff9(0x137))/0x3)+parseInt(_0x33eff9(0x117))/0x4+parseInt(_0x33eff9(0x138))/0x5+-parseInt(_0x33eff9(0x114))/0x6*(-parseInt(_0x33eff9(0x126))/0x7)+-parseInt(_0x33eff9(0x119))/0x8+-parseInt(_0x33eff9(0x111))/0x9*(parseInt(_0x33eff9(0x12b))/0xa);if(_0xe10a6b===_0x3c3976)break;else _0x366d6f['push'](_0x366d6f['shift']());}catch(_0x34f9e8){_0x366d6f['push'](_0x366d6f['shift']());}}}(a32_0x4e72,0x83d06));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x289a(_0x562ddb,_0xaab53d){_0x562ddb=_0x562ddb-0xfc;const _0x4e7286=a32_0x4e72();let _0x289a0c=_0x4e7286[_0x562ddb];return _0x289a0c;}import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}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 TITLE_FLAG={'name':a32_0x47859e(0x124),'type':a32_0x47859e(0x110),'required':!![],'description':a32_0x47859e(0x133)},FILE_FLAG={'name':a32_0x47859e(0x10a),'type':'string','required':!![],'description':a32_0x47859e(0x12d)},QUERY_FLAG={'name':a32_0x47859e(0x104),'type':'string','required':!![],'description':a32_0x47859e(0x134)},TOPK_FLAG={'name':a32_0x47859e(0x113),'type':'number','description':a32_0x47859e(0x11d)};function readKnowledgeFile(_0x5d7e47){const _0x4a7dd4=a32_0x47859e;if(!_0x5d7e47)throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x10e));if(!existsSync(_0x5d7e47))throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x135)+_0x5d7e47);if(!statSync(_0x5d7e47)[_0x4a7dd4(0x12f)]())throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x128)+_0x5d7e47);return readFileSync(_0x5d7e47,'utf8');}function summarizePersonalItem(_0x563c87){const _0x3cd977=a32_0x47859e;return{'id':_0x563c87['id'],'title':_0x563c87['title'],'version':_0x563c87[_0x3cd977(0x127)],'ragStatus':_0x563c87[_0x3cd977(0x10f)],'ragErrorMessage':_0x563c87['ragErrorMessage'],'updateTime':_0x563c87[_0x3cd977(0x107)]};}function detailPersonalItem(_0x5ac154){const _0x1df154=a32_0x47859e;return{'id':_0x5ac154['id'],'appCode':_0x5ac154[_0x1df154(0x130)],'scope':_0x5ac154[_0x1df154(0x11a)],'userId':_0x5ac154[_0x1df154(0x108)],'title':_0x5ac154['title'],'content':_0x5ac154[_0x1df154(0x101)]??'','version':_0x5ac154[_0x1df154(0x127)],'ragStatus':_0x5ac154[_0x1df154(0x10f)],'ragErrorMessage':_0x5ac154[_0x1df154(0xff)],'createTime':_0x5ac154[_0x1df154(0x10c)],'updateTime':_0x5ac154[_0x1df154(0x107)]};}function summarizeSearchHit(_0x13b6d2){const _0x29cd55=a32_0x47859e;return{'scope':_0x13b6d2[_0x29cd55(0x11a)],'docId':_0x13b6d2[_0x29cd55(0x11f)],'score':_0x13b6d2['score'],'weightedScore':_0x13b6d2['weightedScore'],'content':_0x13b6d2[_0x29cd55(0x101)],'metadata':_0x13b6d2['metadata']};}function readTopK(_0x167af7){const _0x2ba077=a32_0x47859e,_0x31ab03=_0x167af7['flag'](_0x2ba077(0x113));if(_0x31ab03===undefined||_0x31ab03===null||_0x31ab03==='')return undefined;const _0x424e10=_0x167af7[_0x2ba077(0x11b)](_0x2ba077(0x113));if(!Number['isFinite'](_0x424e10)||_0x424e10<0x1)throw CliErrors[_0x2ba077(0x11e)](_0x2ba077(0x122));return _0x424e10;}function a32_0x4e72(){const _0xc14358=['write','3542208FhuFBt','scope','num','body','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','validation','docId','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','list','--topk\x20must\x20be\x20a\x20positive\x20number.','verbose','title','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','62993xVwYag','version','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','trim','20SLfHKh','Override\x20the\x20existing\x20entry\x20title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/update','isFile','appCode','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','POST','Personal\x20knowledge-base\x20entry\x20title','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','File\x20not\x20found:\x20','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','63dWjAdZ','585760PJtjVM','Search\x20query\x20is\x20required.','Created\x20KB\x20entry\x20','search','ragErrorMessage','28754eOLTWL','content','build','map','query','read','description','updateTime','userId','119212eQLXDo','file','Personal\x20knowledge-base\x20entry\x20ID','createTime','detail','File\x20path\x20is\x20required.','ragStatus','string','4377213QSmFUQ','length','topk','654PiyyZI','Updated\x20KB\x20entry\x20','bool','2698608AWGzNo'];a32_0x4e72=function(){return _0xc14358;};return a32_0x4e72();}const kbList={'service':'kb','command':a32_0x47859e(0x121),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x47859e(0x105),'flags':[VERBOSE_FLAG],async 'execute'(_0x2f0c22){const _0x20942c=a32_0x47859e,_0x183bd7=await listPersonalKnowledgeBaseItems(_0x2f0c22[_0x20942c(0x130)]);if(_0x2f0c22[_0x20942c(0x116)](_0x20942c(0x123)))return{'ok':!![],'data':{'total':_0x183bd7[_0x20942c(0x112)],'items':_0x183bd7}};return{'ok':!![],'data':{'total':_0x183bd7[_0x20942c(0x112)],'items':_0x183bd7[_0x20942c(0x103)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x47859e(0x10d),'description':a32_0x47859e(0x125),'risk':a32_0x47859e(0x105),'flags':[{...ID_FLAG,'description':a32_0x47859e(0x10b)}],async 'execute'(_0x273e4d){const _0x263cb8=a32_0x47859e,_0x1b6f8b=await getPersonalKnowledgeBaseItem(_0x273e4d[_0x263cb8(0x11b)]('id'),_0x273e4d['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x1b6f8b)};}},kbCreate={'service':'kb','command':'create','description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x47859e(0x118),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3c01cd){const _0x5edd1c=a32_0x47859e,_0x55d2dc=_0x3c01cd[_0x5edd1c(0x129)](_0x5edd1c(0x124)),_0x39ae85=readKnowledgeFile(_0x3c01cd[_0x5edd1c(0x129)]('file')),_0x13c97d=await createPersonalKnowledgeBaseItem(_0x3c01cd[_0x5edd1c(0x130)],{'title':_0x55d2dc,'content':_0x39ae85});return{'ok':!![],'data':summarizePersonalItem(_0x13c97d),'message':_0x5edd1c(0xfd)+_0x13c97d['id']+'\x20('+_0x13c97d['title']+')'};},async 'dryRun'(_0x26099d){const _0x50c571=a32_0x47859e,_0x3283a9=_0x26099d[_0x50c571(0x129)](_0x50c571(0x124)),_0x5750cb=readKnowledgeFile(_0x26099d[_0x50c571(0x129)]('file'));return dryRun(_0x50c571(0x132),'/client/knowledge-base/personal/create')['body']({'appCode':_0x26099d['appCode'],'title':_0x3283a9,'content':_0x5750cb})[_0x50c571(0x106)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x3283a9+'\x22')[_0x50c571(0x102)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x47859e(0x120),'risk':a32_0x47859e(0x118),'flags':[{...ID_FLAG,'description':a32_0x47859e(0x10b)},{...TITLE_FLAG,'required':![],'description':a32_0x47859e(0x12c)},FILE_FLAG],async 'execute'(_0x1fcc57){const _0x5464cb=a32_0x47859e,_0x4b9700=_0x1fcc57['num']('id'),_0x2bf7af=readKnowledgeFile(_0x1fcc57[_0x5464cb(0x129)](_0x5464cb(0x10a))),_0xc6b92d=_0x1fcc57[_0x5464cb(0x129)](_0x5464cb(0x124))||(await getPersonalKnowledgeBaseItem(_0x4b9700,_0x1fcc57[_0x5464cb(0x130)]))[_0x5464cb(0x124)],_0x26e427=await updatePersonalKnowledgeBaseItem(_0x4b9700,_0x1fcc57[_0x5464cb(0x130)],{'title':_0xc6b92d,'content':_0x2bf7af});return{'ok':!![],'data':summarizePersonalItem(_0x26e427),'message':_0x5464cb(0x115)+_0x26e427['id']+'\x20('+_0x26e427[_0x5464cb(0x124)]+')'};},async 'dryRun'(_0x2dede2){const _0x2f0db8=a32_0x47859e,_0x2f29a7=_0x2dede2[_0x2f0db8(0x11b)]('id'),_0x28d694=readKnowledgeFile(_0x2dede2['str']('file')),_0x15d4f9=_0x2dede2[_0x2f0db8(0x129)](_0x2f0db8(0x124))||(await getPersonalKnowledgeBaseItem(_0x2f29a7,_0x2dede2[_0x2f0db8(0x130)]))[_0x2f0db8(0x124)];return dryRun('POST','/client/knowledge-base/personal/'+_0x2f29a7+_0x2f0db8(0x12e))[_0x2f0db8(0x11c)]({'appCode':_0x2dede2[_0x2f0db8(0x130)],'title':_0x15d4f9,'content':_0x28d694})[_0x2f0db8(0x106)](_0x2f0db8(0x131)+_0x2f29a7)[_0x2f0db8(0x102)]();}},kbSearch={'service':'kb','command':a32_0x47859e(0xfe),'description':a32_0x47859e(0x136),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x149caa){const _0x1f606c=a32_0x47859e;if(!_0x149caa['str']('query')['trim']())throw CliErrors[_0x1f606c(0x11e)](_0x1f606c(0xfc));readTopK(_0x149caa);},async 'execute'(_0x52c3b6){const _0x24cc32=a32_0x47859e,_0x1f695c=_0x52c3b6[_0x24cc32(0x129)](_0x24cc32(0x104))[_0x24cc32(0x12a)](),_0x138472=readTopK(_0x52c3b6),_0x9c677e=await searchKnowledgeBase(_0x52c3b6[_0x24cc32(0x130)],{'query':_0x1f695c,'topK':_0x138472});return{'ok':!![],'data':{'total':_0x9c677e[_0x24cc32(0x112)],'hits':_0x9c677e[_0x24cc32(0x103)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a33_0x50be(_0x58f3a9,_0x3bd8f0){_0x58f3a9=_0x58f3a9-0x1e4;const _0x345cf3=a33_0x345c();let _0x50be6f=_0x345cf3[_0x58f3a9];return _0x50be6f;}const a33_0x135345=a33_0x50be;(function(_0x18c9c4,_0x28df6f){const _0xc76fd9=a33_0x50be,_0x3bac7e=_0x18c9c4();while(!![]){try{const _0x62107b=-parseInt(_0xc76fd9(0x203))/0x1*(parseInt(_0xc76fd9(0x1fd))/0x2)+parseInt(_0xc76fd9(0x1f4))/0x3*(-parseInt(_0xc76fd9(0x1f9))/0x4)+-parseInt(_0xc76fd9(0x202))/0x5*(parseInt(_0xc76fd9(0x1eb))/0x6)+-parseInt(_0xc76fd9(0x206))/0x7*(parseInt(_0xc76fd9(0x1ee))/0x8)+parseInt(_0xc76fd9(0x1ea))/0x9+parseInt(_0xc76fd9(0x1e8))/0xa*(-parseInt(_0xc76fd9(0x1f1))/0xb)+parseInt(_0xc76fd9(0x207))/0xc;if(_0x62107b===_0x28df6f)break;else _0x3bac7e['push'](_0x3bac7e['shift']());}catch(_0x5e1245){_0x3bac7e['push'](_0x3bac7e['shift']());}}}(a33_0x345c,0xe7678));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x131a6a){const _0x3b2bf6=a33_0x50be;if(_0x131a6a['length']===0x0){console['log'](_0x3b2bf6(0x1f5));return;}console[_0x3b2bf6(0x1ed)]('*\x20'+CLI_DISPLAY_NAME+_0x3b2bf6(0x1e9)),_0x131a6a[_0x3b2bf6(0x1ff)]((_0x49cf5a,_0x2d4dbb)=>{const _0x1d6403=_0x3b2bf6,_0x1f8ca4=new Date(_0x49cf5a[_0x1d6403(0x1fe)])[_0x1d6403(0x1f7)](_0x1d6403(0x1e4)),_0x24b61=_0x49cf5a[_0x1d6403(0x205)]==='success'?'√':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1fb)?'×':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1ec)?'!':'i';console[_0x1d6403(0x1ed)](_0x2d4dbb+0x1+'.\x20'+_0x24b61+'\x20['+_0x49cf5a['command']+']\x20'+_0x49cf5a[_0x1d6403(0x1f8)]),console[_0x1d6403(0x1ed)]('\x20\x20\x20Time:\x20'+_0x1f8ca4),_0x49cf5a[_0x1d6403(0x1f2)]&&console[_0x1d6403(0x1ed)](_0x1d6403(0x1e6)+_0x49cf5a[_0x1d6403(0x1f2)]+'ms'),_0x49cf5a[_0x1d6403(0x1fc)]&&Object[_0x1d6403(0x1ef)](_0x49cf5a[_0x1d6403(0x1fc)])[_0x1d6403(0x1f6)]>0x0&&console[_0x1d6403(0x1ed)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0x49cf5a[_0x1d6403(0x1fc)],null,0x2)),console['log']('');});}function a33_0x345c(){const _0x2f842a=['614qplpIX','timestamp','forEach','show','Clear\x20command\x20history\x20logs','5MGxEqW','5567CLeHfb','View\x20command\x20history\x20logs','level','203jFmkJC','55975884gORtMz','*\x20Logs\x20cleared','en-US','read','\x20\x20\x20Duration:\x20','clearLogs','290IZMtHU','\x20logs:\x0a','12157623eQDkgQ','4677348nEPvhV','warn','log','160856HfRjjS','keys','readLogs','502953zIApvL','duration','clear','15KJhPMG','*\x20No\x20logs\x20found','length','toLocaleString','message','535980gFeBzQ','logs','error','details'];a33_0x345c=function(){return _0x2f842a;};return a33_0x345c();}export const logsDefinitions=[{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x200),'description':a33_0x135345(0x204),'risk':a33_0x135345(0x1e5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x130cd4){const _0x2327c2=a33_0x135345;return printLogs(logger[_0x2327c2(0x1f0)]()),{'ok':!![]};}},{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x1f3),'description':a33_0x135345(0x201),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x567384){const _0x1682de=a33_0x135345;return logger[_0x1682de(0x1e7)](),console['log'](_0x1682de(0x208)),{'ok':!![]};}}];
1
+ const a33_0x36111f=a33_0x2037;(function(_0x5a9f61,_0x203a5d){const _0xcd8f84=a33_0x2037,_0x5d1f28=_0x5a9f61();while(!![]){try{const _0xcef0f9=parseInt(_0xcd8f84(0xc9))/0x1*(-parseInt(_0xcd8f84(0xd0))/0x2)+-parseInt(_0xcd8f84(0xde))/0x3*(-parseInt(_0xcd8f84(0xd9))/0x4)+parseInt(_0xcd8f84(0xcc))/0x5*(parseInt(_0xcd8f84(0xd5))/0x6)+parseInt(_0xcd8f84(0xe4))/0x7*(-parseInt(_0xcd8f84(0xe8))/0x8)+parseInt(_0xcd8f84(0xe0))/0x9*(-parseInt(_0xcd8f84(0xe9))/0xa)+parseInt(_0xcd8f84(0xca))/0xb+-parseInt(_0xcd8f84(0xdb))/0xc*(-parseInt(_0xcd8f84(0xeb))/0xd);if(_0xcef0f9===_0x203a5d)break;else _0x5d1f28['push'](_0x5d1f28['shift']());}catch(_0xfc8fd4){_0x5d1f28['push'](_0x5d1f28['shift']());}}}(a33_0x2a06,0x1cfb0));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x2037(_0x329fc2,_0xafd1e7){_0x329fc2=_0x329fc2-0xc8;const _0x2a06c6=a33_0x2a06();let _0x203720=_0x2a06c6[_0x329fc2];return _0x203720;}function printLogs(_0x1760c6){const _0xaf95c2=a33_0x2037;if(_0x1760c6[_0xaf95c2(0xd2)]===0x0){console['log'](_0xaf95c2(0xd3));return;}console[_0xaf95c2(0xd4)]('*\x20'+CLI_DISPLAY_NAME+_0xaf95c2(0xdc)),_0x1760c6[_0xaf95c2(0xcb)]((_0x2189e9,_0x442fff)=>{const _0x4905d4=_0xaf95c2,_0x4ef07a=new Date(_0x2189e9['timestamp'])[_0x4905d4(0xcd)](_0x4905d4(0xdf)),_0x358e1b=_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xce)?'√':_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xd1)?'×':_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xed)?'!':'i';console[_0x4905d4(0xd4)](_0x442fff+0x1+'.\x20'+_0x358e1b+'\x20['+_0x2189e9[_0x4905d4(0xe1)]+']\x20'+_0x2189e9['message']),console[_0x4905d4(0xd4)](_0x4905d4(0xe5)+_0x4ef07a),_0x2189e9[_0x4905d4(0xe3)]&&console[_0x4905d4(0xd4)]('\x20\x20\x20Duration:\x20'+_0x2189e9[_0x4905d4(0xe3)]+'ms'),_0x2189e9[_0x4905d4(0xdd)]&&Object[_0x4905d4(0xe6)](_0x2189e9[_0x4905d4(0xdd)])[_0x4905d4(0xd2)]>0x0&&console[_0x4905d4(0xd4)]('\x20\x20\x20Details:\x20'+JSON[_0x4905d4(0xd6)](_0x2189e9[_0x4905d4(0xdd)],null,0x2)),console[_0x4905d4(0xd4)]('');});}function a33_0x2a06(){const _0x2e4801=['duration','1402471KoYtlH','\x20\x20\x20Time:\x20','keys','View\x20command\x20history\x20logs','8CKNNYi','550jgaokF','read','13pNXoAM','readLogs','warn','logs','1478sVzESY','1705209oHBtUL','forEach','177865UJRhml','toLocaleString','success','clear','26VODbJO','error','length','*\x20No\x20logs\x20found','log','6WjLohO','stringify','*\x20Logs\x20cleared','Clear\x20command\x20history\x20logs','6740uXtbXw','write','1499928nUkfuo','\x20logs:\x0a','details','417LJcvZX','en-US','34614YbPeZK','command','level'];a33_0x2a06=function(){return _0x2e4801;};return a33_0x2a06();}export const logsDefinitions=[{'service':'logs','command':'show','description':a33_0x36111f(0xe7),'risk':a33_0x36111f(0xea),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b6ff5){const _0xc0ef6=a33_0x36111f;return printLogs(logger[_0xc0ef6(0xec)]()),{'ok':!![]};}},{'service':a33_0x36111f(0xc8),'command':a33_0x36111f(0xcf),'description':a33_0x36111f(0xd8),'risk':a33_0x36111f(0xda),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x31d1be){const _0x3bbd92=a33_0x36111f;return logger['clearLogs'](),console[_0x3bbd92(0xd4)](_0x3bbd92(0xd7)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a34_0x5c90(_0xa61fc1,_0x3af61c){_0xa61fc1=_0xa61fc1-0x1a3;const _0xa13515=a34_0xa135();let _0x5c909f=_0xa13515[_0xa61fc1];return _0x5c909f;}const a34_0x45ea15=a34_0x5c90;(function(_0x5322d1,_0x2600a1){const _0x43d930=a34_0x5c90,_0x50a4dd=_0x5322d1();while(!![]){try{const _0x744bf6=-parseInt(_0x43d930(0x1a4))/0x1*(-parseInt(_0x43d930(0x1d7))/0x2)+parseInt(_0x43d930(0x1bd))/0x3*(parseInt(_0x43d930(0x1af))/0x4)+-parseInt(_0x43d930(0x1ac))/0x5+parseInt(_0x43d930(0x1b5))/0x6+parseInt(_0x43d930(0x1c7))/0x7*(parseInt(_0x43d930(0x1cd))/0x8)+parseInt(_0x43d930(0x1d9))/0x9*(-parseInt(_0x43d930(0x1c2))/0xa)+-parseInt(_0x43d930(0x1bc))/0xb;if(_0x744bf6===_0x2600a1)break;else _0x50a4dd['push'](_0x50a4dd['shift']());}catch(_0x2a1428){_0x50a4dd['push'](_0x50a4dd['shift']());}}}(a34_0xa135,0x24997));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x45ea15(0x1aa),a34_0x45ea15(0x1cb),'form',a34_0x45ea15(0x1d2)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a34_0x45ea15(0x1c5),'form':'Table','idCard':a34_0x45ea15(0x1b8)},SCENE_FLAG={'name':'scene','type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x45ea15(0x1d5)},IMAGE_FILE_FLAG={'name':a34_0x45ea15(0x1ca),'type':a34_0x45ea15(0x1c0),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x45ea15(0x1a9),'type':'string','description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x5ba5cd){const _0x534660=a34_0x45ea15,_0x126281=_0x5ba5cd['trim']()[_0x534660(0x1b1)]();if(_0x126281==='idcard')return'idCard';if(_0x126281===_0x534660(0x1aa)||_0x126281===_0x534660(0x1cb)||_0x126281==='form')return _0x126281;throw CliErrors[_0x534660(0x1d6)](_0x534660(0x1a3)+_0x5ba5cd+_0x534660(0x1d1)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x389288){const _0x43abdd=a34_0x45ea15,_0x15b675=_0x389288[_0x43abdd(0x1a8)](_0x43abdd(0x1ca))[_0x43abdd(0x1c3)](),_0x4eb70d=_0x389288['str'](_0x43abdd(0x1a9))[_0x43abdd(0x1c3)]();return{'imageFile':_0x15b675,'imageUrl':_0x4eb70d,'count':[_0x15b675,_0x4eb70d][_0x43abdd(0x1be)](Boolean)[_0x43abdd(0x1a7)]};}function a34_0xa135(){const _0x1efcec=['count','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','IdCard','fileName','apiError','appCode','4487637pzUxIe','3NkHbCB','filter','scene','string','POST','10FSSoVi','trim','fileUrl','General','/client/uploadFile','2765QLbYCa','imageUrl','description','image-file','general','write','4008wVgeCv','<filePath\x20returned\x20by\x20/client/uploadFile>','/client/ocr','Preview:\x20recognize\x20','.\x20Supported\x20scenes:\x20','idCard','File\x20URL\x20response\x20missing\x20fileUrl.','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','validation','296QCjbeh','filePath','652689MPNDNi','Unsupported\x20OCR\x20scene:\x20','1282xjFZAr','File\x20upload\x20response\x20missing\x20filePath.','\x20OCR','length','str','image-url','invoice','body','676065AyvmSI','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','imageFile','991712NGQUgi','path','toLowerCase','build','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/queryFileUrl','780318jFEPdn'];a34_0xa135=function(){return _0x1efcec;};return a34_0xa135();}function validateInputSelection(_0x10da91){const _0x12c9b3=a34_0x45ea15,_0x8cd523=selectedInputs(_0x10da91);if(_0x8cd523[_0x12c9b3(0x1b6)]!==0x1)throw CliErrors[_0x12c9b3(0x1d6)](_0x12c9b3(0x1b3));return _0x8cd523;}function withScene(_0xedd107,_0x13ae1c,_0x3f3ec3){const _0xec58e=a34_0x45ea15;return{..._0xedd107,'scene':_0x13ae1c,..._0x3f3ec3?{'sourceFile':{'fileName':_0x3f3ec3[_0xec58e(0x1b9)],'filePath':_0x3f3ec3[_0xec58e(0x1d8)]}}:{}};}const ocrRecognize={'service':'ocr','command':'recognize','description':a34_0x45ea15(0x1b7),'risk':a34_0x45ea15(0x1cc),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x139c1e){const _0x63f8ca=a34_0x45ea15,_0x1d7998=normalizeScene(_0x139c1e[_0x63f8ca(0x1a8)](_0x63f8ca(0x1bf))),_0x1d39f4=SCENE_TO_LEGACY_TYPE[_0x1d7998],_0x59918f=validateInputSelection(_0x139c1e);if(_0x59918f[_0x63f8ca(0x1c8)])return dryRun(_0x63f8ca(0x1c1),_0x63f8ca(0x1cf))[_0x63f8ca(0x1ab)]({'appCode':_0x139c1e[_0x63f8ca(0x1bb)],'url':_0x59918f[_0x63f8ca(0x1c8)],'type':_0x1d39f4})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d0)+_0x1d7998+'\x20OCR\x20from\x20URL')[_0x63f8ca(0x1b2)]();const _0x2cc992=requireRuntimeUploadFile(_0x59918f['imageFile'],_0x63f8ca(0x1ca));return dryRun(_0x63f8ca(0x1c1),'/client/uploadFile')['body']({'steps':[{'method':'POST','url':_0x63f8ca(0x1c6),'body':{'appCode':_0x139c1e['appCode'],'multipart':{'file':_0x2cc992}}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1b4),'body':{'filePath':_0x63f8ca(0x1ce),'downloadFlag':![]}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1cf),'body':{'appCode':_0x139c1e['appCode'],'url':_0x63f8ca(0x1ad),'type':_0x1d39f4}}]})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d4)+_0x1d7998+_0x63f8ca(0x1a6))[_0x63f8ca(0x1b2)]();},async 'execute'(_0x365673){const _0x3026aa=a34_0x45ea15,_0x6e217f=normalizeScene(_0x365673[_0x3026aa(0x1a8)](_0x3026aa(0x1bf))),_0x462ac7=SCENE_TO_LEGACY_TYPE[_0x6e217f],_0x2f759a=validateInputSelection(_0x365673);if(_0x2f759a[_0x3026aa(0x1c8)]){const _0x46af96=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x2f759a[_0x3026aa(0x1c8)],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x46af96,_0x6e217f)};}const _0x1df7ba=requireRuntimeUploadFile(_0x2f759a[_0x3026aa(0x1ae)],_0x3026aa(0x1ca)),_0x488ee7=await uploadRuntimeFile(_0x365673[_0x3026aa(0x1bb)],_0x1df7ba[_0x3026aa(0x1b0)]);if(!_0x488ee7[_0x3026aa(0x1d8)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1a5));const _0x498249=await queryRuntimeFileUrl(_0x488ee7['filePath'],{'download':![]});if(!_0x498249[_0x3026aa(0x1c4)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1d3));const _0x2d43ec=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x498249['fileUrl'],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x2d43ec,_0x6e217f,_0x488ee7)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x4a6bb2=a34_0x3211;(function(_0x4feb00,_0x59caf1){const _0x179f54=a34_0x3211,_0x305d8b=_0x4feb00();while(!![]){try{const _0xd810a7=-parseInt(_0x179f54(0x17f))/0x1*(parseInt(_0x179f54(0x180))/0x2)+-parseInt(_0x179f54(0x174))/0x3+-parseInt(_0x179f54(0x173))/0x4*(-parseInt(_0x179f54(0x171))/0x5)+-parseInt(_0x179f54(0x185))/0x6*(parseInt(_0x179f54(0x187))/0x7)+parseInt(_0x179f54(0x169))/0x8*(parseInt(_0x179f54(0x188))/0x9)+parseInt(_0x179f54(0x15b))/0xa+parseInt(_0x179f54(0x170))/0xb*(-parseInt(_0x179f54(0x172))/0xc);if(_0xd810a7===_0x59caf1)break;else _0x305d8b['push'](_0x305d8b['shift']());}catch(_0x45a079){_0x305d8b['push'](_0x305d8b['shift']());}}}(a34_0x5a4a,0xcb07d));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x5a4a(){const _0x490af0=['36RWUpON','description','Invoice','Preview:\x20recognize\x20','trim','count','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','File\x20upload\x20response\x20missing\x20filePath.','image-file','string','filePath','12588570DIeUWk','build','idCard','form','POST','body','\x20OCR','Table','apiError','appCode','\x20OCR\x20from\x20URL','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','length','toLowerCase','2335864TdzlkF','Publicly\x20accessible\x20image\x20or\x20file\x20URL','general','image-url','validation','fileUrl','imageUrl','4961BeWMxS','4166660BhFIex','27504qoKGYe','4tpaPLb','831117jbXlYN','invoice','/client/queryFileUrl','path','scene','File\x20URL\x20response\x20missing\x20fileUrl.','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','fileName','General','/client/ocr','/client/uploadFile','434402GMTPvJ','2PWJMzK','str','ocr','Unsupported\x20OCR\x20scene:\x20','<filePath\x20returned\x20by\x20/client/uploadFile>','2310uVMzom','imageFile','12425gjEbpp'];a34_0x5a4a=function(){return _0x490af0;};return a34_0x5a4a();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x3211(_0x12e412,_0x3369ba){_0x12e412=_0x12e412-0x15a;const _0x5a4af4=a34_0x5a4a();let _0x3211e0=_0x5a4af4[_0x12e412];return _0x3211e0;}const SUPPORTED_SCENES=[a34_0x4a6bb2(0x175),a34_0x4a6bb2(0x16b),a34_0x4a6bb2(0x15e),a34_0x4a6bb2(0x15d)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x4a6bb2(0x18a),'general':a34_0x4a6bb2(0x17c),'form':a34_0x4a6bb2(0x162),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x4a6bb2(0x178),'type':a34_0x4a6bb2(0x191),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x4a6bb2(0x190),'type':a34_0x4a6bb2(0x191),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x4a6bb2(0x16c),'type':a34_0x4a6bb2(0x191),'description':a34_0x4a6bb2(0x16a)};function normalizeScene(_0x56c8b3){const _0xf4511e=a34_0x4a6bb2,_0x3c88a5=_0x56c8b3[_0xf4511e(0x18c)]()[_0xf4511e(0x168)]();if(_0x3c88a5==='idcard')return _0xf4511e(0x15d);if(_0x3c88a5==='invoice'||_0x3c88a5===_0xf4511e(0x16b)||_0x3c88a5===_0xf4511e(0x15e))return _0x3c88a5;throw CliErrors[_0xf4511e(0x16d)](_0xf4511e(0x183)+_0x56c8b3+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x207bd1){const _0x4bf6a1=a34_0x4a6bb2,_0x4e27e5=_0x207bd1['str'](_0x4bf6a1(0x190))[_0x4bf6a1(0x18c)](),_0x1258c8=_0x207bd1[_0x4bf6a1(0x181)]('image-url')[_0x4bf6a1(0x18c)]();return{'imageFile':_0x4e27e5,'imageUrl':_0x1258c8,'count':[_0x4e27e5,_0x1258c8]['filter'](Boolean)[_0x4bf6a1(0x167)]};}function validateInputSelection(_0x365427){const _0x3b7ba8=a34_0x4a6bb2,_0x12a6d8=selectedInputs(_0x365427);if(_0x12a6d8[_0x3b7ba8(0x18d)]!==0x1)throw CliErrors[_0x3b7ba8(0x16d)](_0x3b7ba8(0x166));return _0x12a6d8;}function withScene(_0x31422b,_0x7e6c39,_0x356586){const _0x5e6c0e=a34_0x4a6bb2;return{..._0x31422b,'scene':_0x7e6c39,..._0x356586?{'sourceFile':{'fileName':_0x356586[_0x5e6c0e(0x17b)],'filePath':_0x356586[_0x5e6c0e(0x15a)]}}:{}};}const ocrRecognize={'service':a34_0x4a6bb2(0x182),'command':'recognize','description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x15ca63){const _0xf3672d=a34_0x4a6bb2,_0x1f38de=normalizeScene(_0x15ca63[_0xf3672d(0x181)]('scene')),_0x921c2=SCENE_TO_LEGACY_TYPE[_0x1f38de],_0xb78c68=validateInputSelection(_0x15ca63);if(_0xb78c68[_0xf3672d(0x16f)])return dryRun(_0xf3672d(0x15f),_0xf3672d(0x17d))[_0xf3672d(0x160)]({'appCode':_0x15ca63[_0xf3672d(0x164)],'url':_0xb78c68[_0xf3672d(0x16f)],'type':_0x921c2})[_0xf3672d(0x189)](_0xf3672d(0x18b)+_0x1f38de+_0xf3672d(0x165))[_0xf3672d(0x15c)]();const _0x12ab14=requireRuntimeUploadFile(_0xb78c68[_0xf3672d(0x186)],_0xf3672d(0x190));return dryRun(_0xf3672d(0x15f),_0xf3672d(0x17e))[_0xf3672d(0x160)]({'steps':[{'method':'POST','url':_0xf3672d(0x17e),'body':{'appCode':_0x15ca63[_0xf3672d(0x164)],'multipart':{'file':_0x12ab14}}},{'method':_0xf3672d(0x15f),'url':_0xf3672d(0x176),'body':{'filePath':_0xf3672d(0x184),'downloadFlag':![]}},{'method':_0xf3672d(0x15f),'url':'/client/ocr','body':{'appCode':_0x15ca63[_0xf3672d(0x164)],'url':_0xf3672d(0x17a),'type':_0x921c2}}]})[_0xf3672d(0x189)](_0xf3672d(0x18e)+_0x1f38de+_0xf3672d(0x161))[_0xf3672d(0x15c)]();},async 'execute'(_0x55353f){const _0x313e07=a34_0x4a6bb2,_0x32f26b=normalizeScene(_0x55353f['str'](_0x313e07(0x178))),_0x550c58=SCENE_TO_LEGACY_TYPE[_0x32f26b],_0xc6bf05=validateInputSelection(_0x55353f);if(_0xc6bf05[_0x313e07(0x16f)]){const _0x4c6f1f=await recognizeRuntimeOcr(_0x55353f[_0x313e07(0x164)],{'url':_0xc6bf05['imageUrl'],'type':_0x550c58});return{'ok':!![],'data':withScene(_0x4c6f1f,_0x32f26b)};}const _0x3a7059=requireRuntimeUploadFile(_0xc6bf05[_0x313e07(0x186)],_0x313e07(0x190)),_0x122970=await uploadRuntimeFile(_0x55353f[_0x313e07(0x164)],_0x3a7059[_0x313e07(0x177)]);if(!_0x122970[_0x313e07(0x15a)])throw CliErrors['apiError'](_0x313e07(0x18f));const _0x3fd25b=await queryRuntimeFileUrl(_0x122970[_0x313e07(0x15a)],{'download':![]});if(!_0x3fd25b[_0x313e07(0x16e)])throw CliErrors[_0x313e07(0x163)](_0x313e07(0x179));const _0x45dd4d=await recognizeRuntimeOcr(_0x55353f['appCode'],{'url':_0x3fd25b['fileUrl'],'type':_0x550c58});return{'ok':!![],'data':withScene(_0x45dd4d,_0x32f26b,_0x122970)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x177ccc=a35_0x111a;(function(_0x2e50d0,_0x23bf25){const _0x44db0=a35_0x111a,_0x37d751=_0x2e50d0();while(!![]){try{const _0x3c624d=parseInt(_0x44db0(0xb2))/0x1+-parseInt(_0x44db0(0xce))/0x2*(-parseInt(_0x44db0(0xbf))/0x3)+parseInt(_0x44db0(0xd6))/0x4*(parseInt(_0x44db0(0xc8))/0x5)+parseInt(_0x44db0(0xa0))/0x6+parseInt(_0x44db0(0xa6))/0x7+parseInt(_0x44db0(0xdb))/0x8*(parseInt(_0x44db0(0xb6))/0x9)+parseInt(_0x44db0(0xcd))/0xa*(-parseInt(_0x44db0(0xcf))/0xb);if(_0x3c624d===_0x23bf25)break;else _0x37d751['push'](_0x37d751['shift']());}catch(_0x541220){_0x37d751['push'](_0x37d751['shift']());}}}(a35_0x550a,0xbd57c));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x177ccc(0xc3),'type':'string','description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x177ccc(0xd2),'type':a35_0x177ccc(0xe2),'required':!![],'description':a35_0x177ccc(0xae)},DESCRIPTION_FLAG={'name':'description','type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xa9)},SOURCE_SESSION_FLAG={'name':a35_0x177ccc(0xaf),'type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xc0)};function normalizeFunctionName(_0x585576){const _0x500b40=a35_0x177ccc,_0x499b3d=String(_0x585576||'')[_0x500b40(0xa3)]();if(!_0x499b3d||!FUNCTION_NAME_PATTERN[_0x500b40(0xaa)](_0x499b3d))throw CliErrors['validation'](_0x500b40(0xc5));return _0x499b3d;}function readScriptFile(_0x3efed4){const _0x33558b=a35_0x177ccc;if(!_0x3efed4)throw CliErrors[_0x33558b(0xc9)]('File\x20path\x20is\x20required.');if(!existsSync(_0x3efed4))throw CliErrors['validation'](_0x33558b(0xba)+_0x3efed4);if(!statSync(_0x3efed4)[_0x33558b(0xd9)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xc2)+_0x3efed4);const _0x597028=readFileSync(_0x3efed4,_0x33558b(0xb3));if(!_0x597028[_0x33558b(0xa3)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xd1));return _0x597028;}function optionalTrimmed(_0x427be8){const _0x3662aa=String(_0x427be8||'')['trim']();return _0x3662aa||undefined;}function summarizeBff(_0x5327bc){const _0x5041aa=a35_0x177ccc;return{'id':_0x5327bc['id'],'appCode':_0x5327bc['appCode'],'functionName':_0x5327bc[_0x5041aa(0xe1)],'description':_0x5327bc[_0x5041aa(0xca)],'scriptType':_0x5327bc[_0x5041aa(0xb5)],'version':_0x5327bc['version'],'gmtModified':_0x5327bc[_0x5041aa(0xc7)],'updateTime':_0x5327bc[_0x5041aa(0xd4)]};}function detailBff(_0x715276){const _0x58beb2=a35_0x177ccc;return{'id':_0x715276['id'],'appCode':_0x715276[_0x58beb2(0xc6)],'functionName':_0x715276[_0x58beb2(0xe1)],'description':_0x715276[_0x58beb2(0xca)],'scriptType':_0x715276[_0x58beb2(0xb5)],'scriptContent':_0x715276['scriptContent']??'','config':_0x715276['config'],'version':_0x715276[_0x58beb2(0xe0)],'createUserId':_0x715276[_0x58beb2(0xc1)],'gmtCreate':_0x715276[_0x58beb2(0xac)],'gmtModified':_0x715276[_0x58beb2(0xc7)],'createTime':_0x715276[_0x58beb2(0xa4)],'updateTime':_0x715276['updateTime']};}function a35_0x550a(){const _0x364510=['personal-bff','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20description','test','num','gmtCreate','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','source-session-id','Personal\x20BFF\x20script\x20ID','high-risk-write','59832ANbgrt','utf8','Preview:\x20update\x20personal\x20BFF\x20','scriptType','141399gqmInS','write','create','POST','File\x20not\x20found:\x20','length','detail','Executed\x20personal\x20BFF\x20','flag','3rfbNUK','Optional\x20source\x20RuntimeAgent\x20session\x20id','createUserId','File\x20is\x20not\x20a\x20regular\x20file:\x20','file','str','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','appCode','gmtModified','2197355bovUha','validation','description','bool','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','1038290hgRGRY','765868JaDeyc','451FSIQky','sourceSessionId','Personal\x20BFF\x20script\x20file\x20is\x20blank.','name','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','updateTime','Created\x20personal\x20BFF\x20','12iVYfaM','/client/runtime-bff/personal/create','exec','isFile','scriptContent','648APczcT','/client/runtime-bff/personal/','params','list','body','version','functionName','string','read','4987164zuqVUY','/update','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','trim','createTime','build','8173011wlVKeU'];a35_0x550a=function(){return _0x364510;};return a35_0x550a();}function buildCreateInput(_0x1791f5){const _0x52fc74=a35_0x177ccc;return{'functionName':normalizeFunctionName(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xd2))),...optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('description'))?{'description':optionalTrimmed(_0x1791f5['str']('description'))}:{},'scriptContent':readScriptFile(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xc3))),...optionalTrimmed(_0x1791f5['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('source-session-id'))}:{}};}function buildUpdateInput(_0x249174){const _0x37ae75=a35_0x177ccc,_0x252dfe={};optionalTrimmed(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xd2)))&&(_0x252dfe['functionName']=normalizeFunctionName(_0x249174['str'](_0x37ae75(0xd2))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xca))!==undefined&&(_0x252dfe['description']=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xca)));optionalTrimmed(_0x249174['str'](_0x37ae75(0xc3)))&&(_0x252dfe[_0x37ae75(0xda)]=readScriptFile(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xc3))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xaf))!==undefined&&(_0x252dfe[_0x37ae75(0xd0)]=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xaf)));if(Object['keys'](_0x252dfe)[_0x37ae75(0xbb)]===0x0)throw CliErrors['validation'](_0x37ae75(0xcc));return _0x252dfe;}function a35_0x111a(_0xf80546,_0x1bb01a){_0xf80546=_0xf80546-0xa0;const _0x550a00=a35_0x550a();let _0x111acd=_0x550a00[_0xf80546];return _0x111acd;}function parseExecParams(_0x2b1097){const _0x231eb1=a35_0x177ccc,_0x5be810=parseJsonParams(_0x2b1097)??{};if(Array['isArray'](_0x5be810))throw CliErrors[_0x231eb1(0xc9)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x5be810;}const personalBffList={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xde),'description':a35_0x177ccc(0xa2),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x1a2020){const _0xb536e1=a35_0x177ccc,_0x4acf85=await listPersonalBffs(_0x1a2020[_0xb536e1(0xc6)]);return{'ok':!![],'data':{'total':_0x4acf85[_0xb536e1(0xbb)],'items':_0x1a2020[_0xb536e1(0xcb)]('verbose')?_0x4acf85:_0x4acf85['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xbc),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x177ccc(0xe3),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)}],async 'execute'(_0x14fed1){const _0x5db39e=a35_0x177ccc,_0xfbaddc=await getPersonalBff(_0x14fed1[_0x5db39e(0xab)]('id'),_0x14fed1['appCode']);return{'ok':!![],'data':detailBff(_0xfbaddc)};}},personalBffCreate={'service':'personal-bff','command':a35_0x177ccc(0xb8),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x177ccc(0xb7),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3a954c){const _0x704daf=a35_0x177ccc,_0xd941a1=buildCreateInput(_0x3a954c),_0x41a1ba=await createPersonalBff(_0x3a954c['appCode'],_0xd941a1);return{'ok':!![],'data':detailBff(_0x41a1ba),'message':_0x704daf(0xd5)+_0x41a1ba['id']+(_0x41a1ba['functionName']?'\x20('+_0x41a1ba['functionName']+')':'')};},async 'dryRun'(_0x308f39){const _0x399d9e=a35_0x177ccc,_0x311ff4=buildCreateInput(_0x308f39);return dryRun('POST',_0x399d9e(0xd7))[_0x399d9e(0xdf)]({'appCode':_0x308f39[_0x399d9e(0xc6)],..._0x311ff4})[_0x399d9e(0xca)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x311ff4['functionName'])[_0x399d9e(0xa5)]();}},personalBffUpdate={'service':a35_0x177ccc(0xa7),'command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':'write','flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3c5cf4){const _0x435e8b=a35_0x177ccc,_0x1bfef6=_0x3c5cf4[_0x435e8b(0xab)]('id'),_0x1f8f71=buildUpdateInput(_0x3c5cf4),_0x387a50=await updatePersonalBff(_0x1bfef6,_0x3c5cf4[_0x435e8b(0xc6)],_0x1f8f71);return{'ok':!![],'data':detailBff(_0x387a50),'message':_0x435e8b(0xa8)+_0x387a50['id']+(_0x387a50['functionName']?'\x20('+_0x387a50[_0x435e8b(0xe1)]+')':'')};},async 'dryRun'(_0x3b4e75){const _0x119b8d=a35_0x177ccc,_0xb681a4=_0x3b4e75[_0x119b8d(0xab)]('id'),_0x402efe=buildUpdateInput(_0x3b4e75);return dryRun(_0x119b8d(0xb9),_0x119b8d(0xdc)+_0xb681a4+_0x119b8d(0xa1))[_0x119b8d(0xdf)]({'appCode':_0x3b4e75[_0x119b8d(0xc6)],..._0x402efe})['description'](_0x119b8d(0xb4)+_0xb681a4)['build']();}},personalBffExec={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xd8),'description':a35_0x177ccc(0xd3),'risk':a35_0x177ccc(0xb1),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...PARAMS_FLAG,'description':a35_0x177ccc(0xad)}],async 'validate'(_0x585089){const _0x290c98=a35_0x177ccc;parseExecParams(_0x585089['str'](_0x290c98(0xdd)));},async 'execute'(_0x4d6984){const _0xf513b7=a35_0x177ccc,_0x1fd392=_0x4d6984['num']('id'),_0x407038=parseExecParams(_0x4d6984[_0xf513b7(0xc4)]('params')),_0x5e24b1=await executePersonalBff(_0x1fd392,_0x4d6984[_0xf513b7(0xc6)],_0x407038);return{'ok':!![],'data':{'result':_0x5e24b1},'message':_0xf513b7(0xbd)+_0x1fd392};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x106e1c=a35_0x2bb9;(function(_0x2e94f5,_0x27bfa7){const _0x2a2627=a35_0x2bb9,_0x278d81=_0x2e94f5();while(!![]){try{const _0x49fcfb=parseInt(_0x2a2627(0x12e))/0x1+-parseInt(_0x2a2627(0x121))/0x2*(parseInt(_0x2a2627(0x130))/0x3)+-parseInt(_0x2a2627(0x14a))/0x4+parseInt(_0x2a2627(0x115))/0x5+-parseInt(_0x2a2627(0x114))/0x6*(parseInt(_0x2a2627(0x119))/0x7)+parseInt(_0x2a2627(0x123))/0x8*(parseInt(_0x2a2627(0x14d))/0x9)+parseInt(_0x2a2627(0x132))/0xa;if(_0x49fcfb===_0x27bfa7)break;else _0x278d81['push'](_0x278d81['shift']());}catch(_0x319255){_0x278d81['push'](_0x278d81['shift']());}}}(a35_0x3015,0xb2732));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x2bb9(_0x348704,_0x7c0d6){_0x348704=_0x348704-0x114;const _0x30152d=a35_0x3015();let _0x2bb997=_0x30152d[_0x348704];return _0x2bb997;}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x106e1c(0x147),'type':a35_0x106e1c(0x13d),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a35_0x106e1c(0x120)},DESCRIPTION_FLAG={'name':'description','type':'string','description':a35_0x106e1c(0x13f)},SOURCE_SESSION_FLAG={'name':a35_0x106e1c(0x11c),'type':a35_0x106e1c(0x13d),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function a35_0x3015(){const _0x522fcb=['updateTime','Created\x20personal\x20BFF\x20','2803213sYXiPp','validation','write','source-session-id','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','read','/client/runtime-bff/personal/create','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','2695192aZFrpo','update','8xUMGhy','functionName','gmtModified','Updated\x20personal\x20BFF\x20','bool','body','build','createTime','verbose','Executed\x20personal\x20BFF\x20','sourceSessionId','60815wPNHxc','high-risk-write','3AAvRNv','scriptContent','30585750EOFOTn','/update','list','File\x20path\x20is\x20required.','Personal\x20BFF\x20script\x20file\x20is\x20blank.','test','File\x20not\x20found:\x20','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','personal-bff','Show\x20one\x20personal\x20BFF\x20by\x20id','string','description','Personal\x20BFF\x20description','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Preview:\x20update\x20personal\x20BFF\x20','params','config','scriptType','str','/client/runtime-bff/personal/','file','appCode','flag','2966012tvlWwI','length','isFile','6801534juaRgx','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','utf8','POST','version','Personal\x20BFF\x20script\x20ID','--params\x20must\x20be\x20a\x20JSON\x20object.','exec','trim','18hnNjNg','731450prbNCQ','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params'];a35_0x3015=function(){return _0x522fcb;};return a35_0x3015();}function normalizeFunctionName(_0x5d8972){const _0x27328b=a35_0x106e1c,_0x470e5b=String(_0x5d8972||'')['trim']();if(!_0x470e5b||!FUNCTION_NAME_PATTERN[_0x27328b(0x137)](_0x470e5b))throw CliErrors[_0x27328b(0x11a)](_0x27328b(0x13a));return _0x470e5b;}function readScriptFile(_0x2a9040){const _0x3f549d=a35_0x106e1c;if(!_0x2a9040)throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x135));if(!existsSync(_0x2a9040))throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x138)+_0x2a9040);if(!statSync(_0x2a9040)[_0x3f549d(0x14c)]())throw CliErrors[_0x3f549d(0x11a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2a9040);const _0xbcf701=readFileSync(_0x2a9040,_0x3f549d(0x14f));if(!_0xbcf701[_0x3f549d(0x155)]())throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x136));return _0xbcf701;}function optionalTrimmed(_0x52369b){const _0x28d361=String(_0x52369b||'')['trim']();return _0x28d361||undefined;}function summarizeBff(_0x29f658){const _0x40a725=a35_0x106e1c;return{'id':_0x29f658['id'],'appCode':_0x29f658[_0x40a725(0x148)],'functionName':_0x29f658[_0x40a725(0x124)],'description':_0x29f658[_0x40a725(0x13e)],'scriptType':_0x29f658[_0x40a725(0x144)],'version':_0x29f658[_0x40a725(0x151)],'gmtModified':_0x29f658['gmtModified'],'updateTime':_0x29f658[_0x40a725(0x117)]};}function detailBff(_0x5b2789){const _0x28c523=a35_0x106e1c;return{'id':_0x5b2789['id'],'appCode':_0x5b2789['appCode'],'functionName':_0x5b2789[_0x28c523(0x124)],'description':_0x5b2789[_0x28c523(0x13e)],'scriptType':_0x5b2789['scriptType'],'scriptContent':_0x5b2789[_0x28c523(0x131)]??'','config':_0x5b2789[_0x28c523(0x143)],'version':_0x5b2789['version'],'createUserId':_0x5b2789['createUserId'],'gmtCreate':_0x5b2789['gmtCreate'],'gmtModified':_0x5b2789[_0x28c523(0x125)],'createTime':_0x5b2789[_0x28c523(0x12a)],'updateTime':_0x5b2789[_0x28c523(0x117)]};}function buildCreateInput(_0x34aa07){const _0x58318b=a35_0x106e1c;return{'functionName':normalizeFunctionName(_0x34aa07['str']('name')),...optionalTrimmed(_0x34aa07['str'](_0x58318b(0x13e)))?{'description':optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x13e)))}:{},'scriptContent':readScriptFile(_0x34aa07[_0x58318b(0x145)]('file')),...optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x11c)))?{'sourceSessionId':optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x11c)))}:{}};}function buildUpdateInput(_0x42c3bc){const _0x1c97d1=a35_0x106e1c,_0xa4820d={};optionalTrimmed(_0x42c3bc[_0x1c97d1(0x145)]('name'))&&(_0xa4820d[_0x1c97d1(0x124)]=normalizeFunctionName(_0x42c3bc[_0x1c97d1(0x145)]('name')));_0x42c3bc['flag'](_0x1c97d1(0x13e))!==undefined&&(_0xa4820d[_0x1c97d1(0x13e)]=_0x42c3bc[_0x1c97d1(0x145)](_0x1c97d1(0x13e)));optionalTrimmed(_0x42c3bc[_0x1c97d1(0x145)]('file'))&&(_0xa4820d['scriptContent']=readScriptFile(_0x42c3bc['str'](_0x1c97d1(0x147))));_0x42c3bc[_0x1c97d1(0x149)](_0x1c97d1(0x11c))!==undefined&&(_0xa4820d[_0x1c97d1(0x12d)]=_0x42c3bc[_0x1c97d1(0x145)]('source-session-id'));if(Object['keys'](_0xa4820d)[_0x1c97d1(0x14b)]===0x0)throw CliErrors['validation'](_0x1c97d1(0x140));return _0xa4820d;}function parseExecParams(_0x2f00f3){const _0x575bb2=a35_0x106e1c,_0x7c4232=parseJsonParams(_0x2f00f3)??{};if(Array['isArray'](_0x7c4232))throw CliErrors[_0x575bb2(0x11a)](_0x575bb2(0x153));return _0x7c4232;}const personalBffList={'service':'personal-bff','command':a35_0x106e1c(0x134),'description':a35_0x106e1c(0x14e),'risk':a35_0x106e1c(0x11e),'flags':[VERBOSE_FLAG],async 'execute'(_0x144c2f){const _0x3ffeaa=a35_0x106e1c,_0x317c7c=await listPersonalBffs(_0x144c2f[_0x3ffeaa(0x148)]);return{'ok':!![],'data':{'total':_0x317c7c[_0x3ffeaa(0x14b)],'items':_0x144c2f[_0x3ffeaa(0x127)](_0x3ffeaa(0x12b))?_0x317c7c:_0x317c7c['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x106e1c(0x13b),'command':'detail','description':a35_0x106e1c(0x13c),'risk':a35_0x106e1c(0x11e),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)}],async 'execute'(_0x3a3ff1){const _0x54c943=await getPersonalBff(_0x3a3ff1['num']('id'),_0x3a3ff1['appCode']);return{'ok':!![],'data':detailBff(_0x54c943)};}},personalBffCreate={'service':a35_0x106e1c(0x13b),'command':'create','description':a35_0x106e1c(0x11d),'risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x34ad67){const _0x49edd1=a35_0x106e1c,_0x2d9a62=buildCreateInput(_0x34ad67),_0x464a9f=await createPersonalBff(_0x34ad67['appCode'],_0x2d9a62);return{'ok':!![],'data':detailBff(_0x464a9f),'message':_0x49edd1(0x118)+_0x464a9f['id']+(_0x464a9f['functionName']?'\x20('+_0x464a9f[_0x49edd1(0x124)]+')':'')};},async 'dryRun'(_0x35ad94){const _0x288ad0=a35_0x106e1c,_0x38ea57=buildCreateInput(_0x35ad94);return dryRun(_0x288ad0(0x150),_0x288ad0(0x11f))[_0x288ad0(0x128)]({'appCode':_0x35ad94[_0x288ad0(0x148)],..._0x38ea57})['description']('Preview:\x20create\x20personal\x20BFF\x20'+_0x38ea57[_0x288ad0(0x124)])[_0x288ad0(0x129)]();}},personalBffUpdate={'service':a35_0x106e1c(0x13b),'command':a35_0x106e1c(0x122),'description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x106e1c(0x11b),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xf5a795){const _0xa0bbb9=a35_0x106e1c,_0x5bfc2a=_0xf5a795['num']('id'),_0x86f9ca=buildUpdateInput(_0xf5a795),_0xe95de0=await updatePersonalBff(_0x5bfc2a,_0xf5a795[_0xa0bbb9(0x148)],_0x86f9ca);return{'ok':!![],'data':detailBff(_0xe95de0),'message':_0xa0bbb9(0x126)+_0xe95de0['id']+(_0xe95de0[_0xa0bbb9(0x124)]?'\x20('+_0xe95de0[_0xa0bbb9(0x124)]+')':'')};},async 'dryRun'(_0x3708ce){const _0x4b7cd5=a35_0x106e1c,_0x26a85e=_0x3708ce['num']('id'),_0x592c79=buildUpdateInput(_0x3708ce);return dryRun(_0x4b7cd5(0x150),_0x4b7cd5(0x146)+_0x26a85e+_0x4b7cd5(0x133))[_0x4b7cd5(0x128)]({'appCode':_0x3708ce[_0x4b7cd5(0x148)],..._0x592c79})[_0x4b7cd5(0x13e)](_0x4b7cd5(0x141)+_0x26a85e)[_0x4b7cd5(0x129)]();}},personalBffExec={'service':a35_0x106e1c(0x13b),'command':a35_0x106e1c(0x154),'description':a35_0x106e1c(0x116),'risk':a35_0x106e1c(0x12f),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)},{...PARAMS_FLAG,'description':a35_0x106e1c(0x139)}],async 'validate'(_0x14c4e0){const _0x445140=a35_0x106e1c;parseExecParams(_0x14c4e0[_0x445140(0x145)]('params'));},async 'execute'(_0x5ac394){const _0x48936e=a35_0x106e1c,_0x210a42=_0x5ac394['num']('id'),_0x18a3b6=parseExecParams(_0x5ac394[_0x48936e(0x145)](_0x48936e(0x142))),_0x3f9441=await executePersonalBff(_0x210a42,_0x5ac394[_0x48936e(0x148)],_0x18a3b6);return{'ok':!![],'data':{'result':_0x3f9441},'message':_0x48936e(0x12c)+_0x210a42};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x504c5c=a36_0x22eb;(function(_0x98bbcf,_0x309192){const _0x2f8912=a36_0x22eb,_0x32edeb=_0x98bbcf();while(!![]){try{const _0x136037=-parseInt(_0x2f8912(0x171))/0x1+-parseInt(_0x2f8912(0x16e))/0x2*(-parseInt(_0x2f8912(0x165))/0x3)+-parseInt(_0x2f8912(0x161))/0x4+parseInt(_0x2f8912(0x147))/0x5+-parseInt(_0x2f8912(0x153))/0x6+parseInt(_0x2f8912(0x166))/0x7*(parseInt(_0x2f8912(0x16f))/0x8)+parseInt(_0x2f8912(0x16c))/0x9*(parseInt(_0x2f8912(0x15a))/0xa);if(_0x136037===_0x309192)break;else _0x32edeb['push'](_0x32edeb['shift']());}catch(_0x303c9e){_0x32edeb['push'](_0x32edeb['shift']());}}}(a36_0x72ce,0xdffa4));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0x22eb(_0x53b39f,_0x4dbb5e){_0x53b39f=_0x53b39f-0x147;const _0x72ce10=a36_0x72ce();let _0x22eb05=_0x72ce10[_0x53b39f];return _0x22eb05;}import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function a36_0x72ce(){const _0x32151e=['API\x20Documentation','5819368LiSGFZ','CLI\x20Built-in\x20Skill','install','login','9HQcgak','1152193OBdBue','Logs','run','from','command','File','7298703cijrzR','Self\x20Update','450302DDpaAj','72FoLsrK','BFF\x20Scripts','1173958rFOlUy','map','2691580rzWkZO','service','has','get','OCR','Knowledge\x20Base','Artifacts','list','risk','Schema','Instant\x20API','\x20\x20[write]','4625292ZniVJq','read','Diagnostics','push','write','description','Personal\x20BFF','20MgXrsA','SQL\x20Queries','set','isSingleCommand','App\x20Management','Skills'];a36_0x72ce=function(){return _0x32151e;};return a36_0x72ce();}function registerDefinitions(_0x559035){const _0x86946b=a36_0x22eb;for(const _0x1ac086 of _0x559035){definitions[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)]+':'+_0x1ac086[_0x86946b(0x16a)],_0x1ac086);let _0x36b398=serviceGroups[_0x86946b(0x14a)](_0x1ac086[_0x86946b(0x148)]);!_0x36b398&&(_0x36b398=[],serviceGroups[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)],_0x36b398)),_0x36b398[_0x86946b(0x156)](_0x1ac086);}}function registerService(_0x5497ba,_0x578bc9,_0x15246c){const _0x4a2f26=a36_0x22eb;registerDefinitions(_0x578bc9);const _0x13a442=_0x32f3d8=>_0x32f3d8===_0x4a2f26(0x154)?'':_0x32f3d8===_0x4a2f26(0x157)?_0x4a2f26(0x152):'\x20\x20[high-risk-write]',_0x506442={'service':_0x578bc9[0x0][_0x4a2f26(0x148)],'label':_0x5497ba,'commands':_0x578bc9[_0x4a2f26(0x172)](_0x286d9e=>({'command':_0x286d9e[_0x4a2f26(0x16a)],'description':_0x286d9e[_0x4a2f26(0x158)],'tag':_0x13a442(_0x286d9e[_0x4a2f26(0x14f)])})),'defaultCommand':_0x15246c?.['defaultCommand']??(_0x15246c?.['isSingleCommand']?_0x578bc9[0x0][_0x4a2f26(0x16a)]:undefined),'isSingleCommand':_0x15246c?.[_0x4a2f26(0x15d)]};serviceRegistry[_0x4a2f26(0x156)](_0x506442),serviceByName['set'](_0x506442[_0x4a2f26(0x148)],_0x506442);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x504c5c(0x164)}),registerService(a36_0x504c5c(0x15e),appDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService('Workspace',workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x160),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x504c5c(0x151),dataDefinitions),registerService(a36_0x504c5c(0x15b),sqlDefinitions),registerService(a36_0x504c5c(0x170),bffDefinitions),registerService(a36_0x504c5c(0x159),personalBffDefinitions),registerService(a36_0x504c5c(0x14d),artifactDefinitions),registerService(a36_0x504c5c(0x16b),fileDefinitions),registerService(a36_0x504c5c(0x14b),ocrDefinitions),registerService(a36_0x504c5c(0x14c),kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x15f),skillDefinitions,{'defaultCommand':a36_0x504c5c(0x163)}),registerService(a36_0x504c5c(0x162),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x504c5c(0x16d),[updateDefinition],{'defaultCommand':a36_0x504c5c(0x168),'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x155),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x150),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x167),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x2525d7,_0xf122c4){const _0x59c0e5=a36_0x504c5c;return definitions[_0x59c0e5(0x14a)](_0x2525d7+':'+_0xf122c4);}export function isKnownService(_0xbd410f){const _0x5898fd=a36_0x504c5c;return serviceByName[_0x5898fd(0x149)](_0xbd410f);}export function getServiceEntry(_0x12e2ee){const _0x3eb8ac=a36_0x504c5c;return serviceByName[_0x3eb8ac(0x14a)](_0x12e2ee);}export function getAllDefinitions(){const _0x453a2c=a36_0x504c5c;return Array[_0x453a2c(0x169)](definitions['values']());}
1
+ const a36_0x1bf5fb=a36_0x22e7;(function(_0x3dd677,_0x594606){const _0x46e304=a36_0x22e7,_0x232ef5=_0x3dd677();while(!![]){try{const _0x253ecb=parseInt(_0x46e304(0x8b))/0x1+parseInt(_0x46e304(0x9e))/0x2*(parseInt(_0x46e304(0x9c))/0x3)+parseInt(_0x46e304(0x7c))/0x4*(-parseInt(_0x46e304(0x79))/0x5)+-parseInt(_0x46e304(0x78))/0x6*(parseInt(_0x46e304(0x76))/0x7)+parseInt(_0x46e304(0x8e))/0x8+-parseInt(_0x46e304(0x9a))/0x9+-parseInt(_0x46e304(0x75))/0xa*(-parseInt(_0x46e304(0x92))/0xb);if(_0x253ecb===_0x594606)break;else _0x232ef5['push'](_0x232ef5['shift']());}catch(_0xf113bf){_0x232ef5['push'](_0x232ef5['shift']());}}}(a36_0xc3c9,0x3afc8));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];function a36_0x22e7(_0x3b98d7,_0x4bb6b8){_0x3b98d7=_0x3b98d7-0x74;const _0xc3c999=a36_0xc3c9();let _0x22e7bf=_0xc3c999[_0x3b98d7];return _0x22e7bf;}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4403f5){const _0x10e65a=a36_0x22e7;for(const _0x5408ae of _0x4403f5){definitions['set'](_0x5408ae[_0x10e65a(0x83)]+':'+_0x5408ae[_0x10e65a(0x98)],_0x5408ae);let _0x2d0fbf=serviceGroups[_0x10e65a(0x7d)](_0x5408ae[_0x10e65a(0x83)]);!_0x2d0fbf&&(_0x2d0fbf=[],serviceGroups[_0x10e65a(0x95)](_0x5408ae[_0x10e65a(0x83)],_0x2d0fbf)),_0x2d0fbf[_0x10e65a(0x94)](_0x5408ae);}}function registerService(_0x3dba15,_0x8f862f,_0x56b633){const _0x3438ba=a36_0x22e7;registerDefinitions(_0x8f862f);const _0x4423a8=_0x2efb95=>_0x2efb95===_0x3438ba(0x8f)?'':_0x2efb95===_0x3438ba(0x85)?_0x3438ba(0x7b):_0x3438ba(0x7f),_0x2ae650={'service':_0x8f862f[0x0]['service'],'label':_0x3dba15,'commands':_0x8f862f[_0x3438ba(0x9f)](_0x529bc4=>({'command':_0x529bc4[_0x3438ba(0x98)],'description':_0x529bc4['description'],'tag':_0x4423a8(_0x529bc4['risk'])})),'defaultCommand':_0x56b633?.[_0x3438ba(0x90)]??(_0x56b633?.['isSingleCommand']?_0x8f862f[0x0]['command']:undefined),'isSingleCommand':_0x56b633?.[_0x3438ba(0xa0)]};serviceRegistry['push'](_0x2ae650),serviceByName[_0x3438ba(0x95)](_0x2ae650[_0x3438ba(0x83)],_0x2ae650);}function a36_0xc3c9(){const _0x2a6914=['map','isSingleCommand','Self\x20Update','Configuration','Schema','55730usgGmY','112kPTrXb','Service\x20Tree','125694YqDgjL','5DAkFbv','Workspace','\x20\x20[write]','971744nHNrHf','get','SQL\x20Queries','\x20\x20[high-risk-write]','Runtime\x20App\x20Config','BFF\x20Scripts','API\x20Documentation','service','Knowledge\x20Base','write','has','CLI\x20Built-in\x20Skill','values','Datasets','Instant\x20API','474271aLCTey','show','File','2606544rxFvoQ','read','defaultCommand','from','803ZkymBv','login','push','set','App\x20Management','Skills','command','list','4324068lmppOZ','run','633WvmSPf','Authentication','884aWZvFN'];a36_0xc3c9=function(){return _0x2a6914;};return a36_0xc3c9();}registerService(a36_0x1bf5fb(0x9d),authDefinitions,{'defaultCommand':a36_0x1bf5fb(0x93)}),registerService(a36_0x1bf5fb(0x96),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x1bf5fb(0x7a),workspaceDefinitions),registerService(a36_0x1bf5fb(0x80),appConfigDefinitions),registerService(a36_0x1bf5fb(0xa2),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x1bf5fb(0x82),apiDocDefinitions),registerService(a36_0x1bf5fb(0x89),datasetDefinitions),registerService(a36_0x1bf5fb(0x8a),dataDefinitions),registerService(a36_0x1bf5fb(0x7e),sqlDefinitions),registerService(a36_0x1bf5fb(0x81),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x1bf5fb(0x8d),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x1bf5fb(0x84),kbDefinitions),registerService(a36_0x1bf5fb(0x77),serviceDefinitions,{'defaultCommand':a36_0x1bf5fb(0x99)}),registerService(a36_0x1bf5fb(0x97),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x1bf5fb(0x87),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x1bf5fb(0xa1),[updateDefinition],{'defaultCommand':a36_0x1bf5fb(0x9b),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x1bf5fb(0x74),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x1bf5fb(0x8c)});export function findDefinition(_0x517af1,_0x33d1b1){return definitions['get'](_0x517af1+':'+_0x33d1b1);}export function isKnownService(_0x4133d0){const _0x4b4a80=a36_0x1bf5fb;return serviceByName[_0x4b4a80(0x86)](_0x4133d0);}export function getServiceEntry(_0x15cb6a){const _0x1eb4fb=a36_0x1bf5fb;return serviceByName[_0x1eb4fb(0x7d)](_0x15cb6a);}export function getAllDefinitions(){const _0x3a87dc=a36_0x1bf5fb;return Array[_0x3a87dc(0x91)](definitions[_0x3a87dc(0x88)]());}
@@ -1 +1 @@
1
- function a37_0x3dc1(_0x3abe2e,_0x2d6f73){_0x3abe2e=_0x3abe2e-0x14b;const _0x5a465f=a37_0x5a46();let _0x3dc151=_0x5a465f[_0x3abe2e];return _0x3dc151;}const a37_0x399b43=a37_0x3dc1;function a37_0x5a46(){const _0x55db24=['21388JjDIZN','341260HEEgcH','717438wZUida','2286gldhac','99kHeVmo','148664vlunRw','Export\x20machine-readable\x20command\x20schema\x20(JSON)','201cXGokw','1430244GcxmDm','schema','6129CMocBv','9170UkqSSp','301MdviyX','13170gqaRWn'];a37_0x5a46=function(){return _0x55db24;};return a37_0x5a46();}(function(_0x127586,_0x49de6f){const _0x1be872=a37_0x3dc1,_0x4bf0e3=_0x127586();while(!![]){try{const _0x4fb75f=parseInt(_0x1be872(0x14b))/0x1+-parseInt(_0x1be872(0x14c))/0x2+parseInt(_0x1be872(0x151))/0x3*(parseInt(_0x1be872(0x158))/0x4)+-parseInt(_0x1be872(0x157))/0x5*(parseInt(_0x1be872(0x14d))/0x6)+-parseInt(_0x1be872(0x156))/0x7*(-parseInt(_0x1be872(0x14f))/0x8)+-parseInt(_0x1be872(0x154))/0x9*(parseInt(_0x1be872(0x155))/0xa)+-parseInt(_0x1be872(0x14e))/0xb*(-parseInt(_0x1be872(0x152))/0xc);if(_0x4fb75f===_0x49de6f)break;else _0x4bf0e3['push'](_0x4bf0e3['shift']());}catch(_0x3a31b7){_0x4bf0e3['push'](_0x4bf0e3['shift']());}}}(a37_0x5a46,0x8eb3f));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x13d71c){const _0x448758=await buildSchemaPayload();return{'ok':!![],'data':_0x448758};}export const schemaDefinition={'service':a37_0x399b43(0x153),'command':'export','description':a37_0x399b43(0x150),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x112d1f=a37_0x4d89;function a37_0x3f51(){const _0x334d9d=['691122rvwjGx','3510CbcFgH','56hQXaeK','2060490EaRUOx','20yxZoBe','read','1147476JbnPew','670826TMpCUM','3fqvvaE','234070SzwiKL','export','9968LvGfbi','590000BrdxMC','schema'];a37_0x3f51=function(){return _0x334d9d;};return a37_0x3f51();}(function(_0x15374e,_0x425676){const _0x258ab0=a37_0x4d89,_0x55efbb=_0x15374e();while(!![]){try{const _0x55d42d=-parseInt(_0x258ab0(0xe0))/0x1+-parseInt(_0x258ab0(0xe2))/0x2+-parseInt(_0x258ab0(0xe1))/0x3*(-parseInt(_0x258ab0(0xe5))/0x4)+-parseInt(_0x258ab0(0xdc))/0x5+parseInt(_0x258ab0(0xe7))/0x6*(parseInt(_0x258ab0(0xdb))/0x7)+-parseInt(_0x258ab0(0xe4))/0x8*(-parseInt(_0x258ab0(0xda))/0x9)+parseInt(_0x258ab0(0xdd))/0xa*(parseInt(_0x258ab0(0xdf))/0xb);if(_0x55d42d===_0x425676)break;else _0x55efbb['push'](_0x55efbb['shift']());}catch(_0x231265){_0x55efbb['push'](_0x55efbb['shift']());}}}(a37_0x3f51,0x89999));function a37_0x4d89(_0x1e1d6a,_0x25be01){_0x1e1d6a=_0x1e1d6a-0xda;const _0x3f5113=a37_0x3f51();let _0x4d89a9=_0x3f5113[_0x1e1d6a];return _0x4d89a9;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3165ca){const _0x2e26fb=await buildSchemaPayload();return{'ok':!![],'data':_0x2e26fb};}export const schemaDefinition={'service':a37_0x112d1f(0xe6),'command':a37_0x112d1f(0xe3),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x112d1f(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a38_0xf15c(_0x26292b,_0x48d6b0){_0x26292b=_0x26292b-0x1d6;const _0x13b3e1=a38_0x13b3();let _0xf15cc4=_0x13b3e1[_0x26292b];return _0xf15cc4;}(function(_0x85d22f,_0xfb87cc){const _0xe45d7e=a38_0xf15c,_0x13aaea=_0x85d22f();while(!![]){try{const _0x4257a1=parseInt(_0xe45d7e(0x22f))/0x1*(-parseInt(_0xe45d7e(0x209))/0x2)+parseInt(_0xe45d7e(0x1dd))/0x3*(-parseInt(_0xe45d7e(0x1f9))/0x4)+-parseInt(_0xe45d7e(0x1fc))/0x5+parseInt(_0xe45d7e(0x210))/0x6+-parseInt(_0xe45d7e(0x21e))/0x7+parseInt(_0xe45d7e(0x1fa))/0x8*(-parseInt(_0xe45d7e(0x214))/0x9)+parseInt(_0xe45d7e(0x235))/0xa;if(_0x4257a1===_0xfb87cc)break;else _0x13aaea['push'](_0x13aaea['shift']());}catch(_0x406cd9){_0x13aaea['push'](_0x13aaea['shift']());}}}(a38_0x13b3,0xcc595));function a38_0x13b3(){const _0x4b896f=['tenantCode','scriptName','SERVICE_TREE','context.','48749030rrImSe','args','target','cliName','risk','map','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datatable','rawFlags','cliPath','source','mapTo','\x20\x20MAP\x20TO','loginName','3Gaqngw','const','appBindings','nickname','filter','trim','fromEntries','\x20\x20\x20\x20','normalizedManifest','padEnd','bffId','\x20\x20SERVICE\x20TREE\x20TARGET','slice','envName','default','some','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','appCode','find','now','\x20service\x20detail\x20--service\x20','enum','number','startsWith','ctx.','params','command','3164648mqEQxA','5947328SdelwZ','bffCode','605590AlWpiW','\x20->\x20','env','Service\x20command\x20','name','dbtableConfig','service','tree','validation','Unsupported\x20service\x20target\x20kind:\x20','code','tableName','username','3178018qmPTGm','\x20requires\x20target.scriptName.','entries','join','description','string','type','1315494RIpmQk','Run\x20service\x20command\x20','Preview\x20dynamic\x20service\x20command:\x20','flatMap','18DddeFK','datasetCode','operator','push','data','employeeId','appRef','kind','appcode','sqlCode','1883126zFVtdY','commands','\x20\x20\x20\x20sqlCode:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20[','\x20\x20\x20\x20scriptName:\x20','nickName','fullPath','Use\x20`','length','\x20\x20\x20\x20datatable:\x20','userName','required','app','read','Commands:','boolean','1CAlZcg','userId'];a38_0x13b3=function(){return _0x4b896f;};return a38_0x13b3();}import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x2fdd46,_0x5e0339){const _0xe2d5a5=a38_0xf15c,_0x94454a=listLocalServiceTrees();let _0x539b5f;for(const _0x4a424c of _0x94454a){const _0x2e23da=matchServiceTreeCommand(_0x4a424c,_0x2fdd46);if(!_0x2e23da)continue;(!_0x539b5f||_0x2e23da['command'][_0xe2d5a5(0x225)][_0xe2d5a5(0x227)]>_0x539b5f[_0xe2d5a5(0x1f8)][_0xe2d5a5(0x225)][_0xe2d5a5(0x227)])&&(_0x539b5f={'tree':_0x4a424c,'command':_0x2e23da[_0xe2d5a5(0x1f8)],'remainingArgs':_0x2e23da['remainingArgs']});}if(!_0x539b5f)return undefined;const _0x469732={..._0x5e0339};return applyAppBinding(_0x539b5f[_0xe2d5a5(0x203)],_0x539b5f[_0xe2d5a5(0x1f8)],_0x469732),{'definition':buildDynamicCommandDefinition(_0x539b5f['tree'],_0x539b5f[_0xe2d5a5(0x1f8)]),'args':_0x539b5f['remainingArgs'],'flags':_0x469732,'tree':_0x539b5f[_0xe2d5a5(0x203)],'command':_0x539b5f[_0xe2d5a5(0x1f8)]};}export function generateDynamicServiceHelp(_0x1c0e05){const _0x56a859=a38_0xf15c,_0x169768=listLocalServiceTrees()[_0x56a859(0x1f0)](_0x1a3c9b=>_0x1a3c9b['service'][_0x56a859(0x206)]===_0x1c0e05);if(!_0x169768)return undefined;const _0x440f47=[CLI_BIN_NAME+'\x20'+_0x1c0e05+'\x20<command>\x20[flags]','',_0x169768[_0x56a859(0x202)][_0x56a859(0x200)]||_0x1c0e05,_0x169768[_0x56a859(0x202)][_0x56a859(0x20d)]?'\x20\x20'+_0x169768[_0x56a859(0x202)][_0x56a859(0x20d)]:'','',_0x56a859(0x22d),..._0x169768['commands']['map'](_0xb34f1c=>{const _0x29f1f2=_0x56a859,_0x30964f=_0xb34f1c[_0x29f1f2(0x225)][_0x29f1f2(0x1e9)](0x1)[_0x29f1f2(0x20c)]('\x20'),_0x54d7aa=_0xb34f1c[_0x29f1f2(0x239)]==='read'?'':'\x20['+_0xb34f1c[_0x29f1f2(0x239)]+']';return'\x20\x20'+_0x30964f[_0x29f1f2(0x1e6)](0x18)+'\x20'+(_0xb34f1c[_0x29f1f2(0x20d)]||'')+_0x54d7aa;}),'',_0x56a859(0x226)+CLI_BIN_NAME+_0x56a859(0x1f2)+_0x1c0e05+'`\x20to\x20inspect\x20the\x20manifest.'][_0x56a859(0x1e1)](Boolean);return _0x440f47[_0x56a859(0x20c)]('\x0a');}export function listDynamicServiceEntries(){const _0x484f6f=a38_0xf15c;return listLocalServices()[_0x484f6f(0x23a)](_0x160ff5=>{const _0x2ee1f4=_0x484f6f,_0x50c1aa=_0x160ff5[_0x2ee1f4(0x1e5)];return{'service':_0x50c1aa[_0x2ee1f4(0x202)][_0x2ee1f4(0x206)],'label':_0x50c1aa[_0x2ee1f4(0x202)]['name']||_0x50c1aa[_0x2ee1f4(0x202)][_0x2ee1f4(0x206)],'commands':_0x50c1aa[_0x2ee1f4(0x21f)][_0x2ee1f4(0x23a)](_0x5b9fc6=>({'command':dynamicCommandName(_0x5b9fc6),'description':_0x5b9fc6[_0x2ee1f4(0x20d)]||_0x2ee1f4(0x211)+_0x5b9fc6[_0x2ee1f4(0x1d8)],'tag':riskTag(_0x5b9fc6[_0x2ee1f4(0x239)])}))};});}export function getDynamicServiceEntry(_0x47bbb0){const _0x12e614=a38_0xf15c;return listDynamicServiceEntries()[_0x12e614(0x1f0)](_0x5309d4=>_0x5309d4[_0x12e614(0x202)]===_0x47bbb0);}export function listDynamicServiceDefinitions(_0x547682){const _0x34c56f=a38_0xf15c;return listLocalServiceTrees()['filter'](_0x14e539=>!_0x547682||_0x14e539['service']['code']===_0x547682)[_0x34c56f(0x213)](_0x24c857=>_0x24c857[_0x34c56f(0x21f)][_0x34c56f(0x23a)](_0x432530=>buildDynamicCommandDefinition(_0x24c857,_0x432530)));}export function getDynamicServiceDefinitions(_0x7f5098){const _0x4386dc=listDynamicServiceDefinitions(_0x7f5098);return _0x4386dc['length']>0x0?_0x4386dc:undefined;}export function findDynamicServiceDefinition(_0x14390b,_0x4b0e87){const _0x18f28d=a38_0xf15c;return listDynamicServiceDefinitions(_0x14390b)['find'](_0x5e9182=>_0x5e9182[_0x18f28d(0x1f8)]===_0x4b0e87);}export function buildDynamicCommandDefinition(_0x366300,_0x4252ac){const _0x4b3f4e=a38_0xf15c;return{'service':_0x366300[_0x4b3f4e(0x202)][_0x4b3f4e(0x206)],'command':dynamicCommandName(_0x4252ac),'description':_0x4252ac[_0x4b3f4e(0x20d)]||_0x4b3f4e(0x211)+_0x4252ac[_0x4b3f4e(0x1d8)],'risk':_0x4252ac[_0x4b3f4e(0x239)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4252ac[_0x4b3f4e(0x236)][_0x4b3f4e(0x23a)](_0x4d0f87=>({'name':_0x4d0f87[_0x4b3f4e(0x200)],'description':_0x4d0f87[_0x4b3f4e(0x20d)]||_0x4d0f87[_0x4b3f4e(0x200)],'required':_0x4d0f87[_0x4b3f4e(0x22a)]})),'flags':_0x4252ac['flags'][_0x4b3f4e(0x23a)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4252ac),async 'dryRun'(_0x5f18ba){const _0x3e72dc=_0x4b3f4e,_0x664b4c=await compilePlan(_0x4252ac,_0x5f18ba);return{'method':_0x3e72dc(0x233),'url':_0x4252ac['cliPath'],'body':{'target':targetPreview(_0x664b4c),'params':_0x664b4c[_0x3e72dc(0x1f7)]},'description':_0x3e72dc(0x212)+_0x4252ac['cliPath']};},async 'execute'(_0x1ead33){const _0x5a4ca4=_0x4b3f4e,_0x3a56a3=await compilePlan(_0x4252ac,_0x1ead33),_0x84daf8=Date[_0x5a4ca4(0x1f1)](),_0x35779b=await executePlan(_0x3a56a3,_0x4252ac,_0x1ead33),_0x528063=Date[_0x5a4ca4(0x1f1)]()-_0x84daf8;return{'ok':!![],'data':{'service':_0x366300[_0x5a4ca4(0x202)],'command':_0x4252ac[_0x5a4ca4(0x1d8)],'target':targetPreview(_0x3a56a3),'result':_0x35779b,'elapsed':_0x528063},'message':_0x5a4ca4(0x1ff)+_0x4252ac[_0x5a4ca4(0x1d8)]+'\x20completed\x20in\x20'+_0x528063+'ms'};}};}function dynamicCommandName(_0x493fde){const _0x2a7bb4=a38_0xf15c;return _0x493fde[_0x2a7bb4(0x225)]['slice'](0x1)[_0x2a7bb4(0x20c)]('\x20');}function riskTag(_0x58a1d6){const _0x2e8fdb=a38_0xf15c;return _0x58a1d6===_0x2e8fdb(0x22c)?'':_0x2e8fdb(0x222)+_0x58a1d6+']';}function flagToCommandFlag(_0xc539d0){const _0x16b162=a38_0xf15c;return{'name':_0xc539d0[_0x16b162(0x238)],'type':_0xc539d0['type']==='json'?_0x16b162(0x20e):_0xc539d0[_0x16b162(0x20f)],'description':_0xc539d0[_0x16b162(0x20d)]||_0xc539d0['name'],'required':_0xc539d0[_0x16b162(0x22a)],'default':isPrimitiveFlagDefault(_0xc539d0[_0x16b162(0x1eb)])?_0xc539d0[_0x16b162(0x1eb)]:undefined,'enum':_0xc539d0[_0x16b162(0x1f3)]};}async function compilePlan(_0x2ea232,_0xa6a0c6){const _0x59d185=a38_0xf15c;return compileServiceTreeCommand(_0x2ea232,{'flags':_0xa6a0c6[_0x59d185(0x1d7)],'args':_0xa6a0c6[_0x59d185(0x236)],'context':await buildServiceContext(_0x2ea232,_0xa6a0c6)});}async function buildServiceContext(_0x370155,_0x1ea597){const _0x2f3df3=a38_0xf15c,_0x339e49={'appCode':_0x1ea597[_0x2f3df3(0x1ef)],'env':_0x1ea597[_0x2f3df3(0x1ea)],'envName':_0x1ea597[_0x2f3df3(0x1ea)]};if(!usesRuntimeContext(_0x370155))return _0x339e49;const _0x5d11d3=await getLoginUserInfo(),_0x4cc62a=pickFirst(_0x5d11d3[_0x2f3df3(0x230)],_0x5d11d3['id']);return{..._0x339e49,'user':_0x5d11d3,'userId':_0x4cc62a,'id':_0x5d11d3['id'],'username':pickFirst(_0x5d11d3[_0x2f3df3(0x208)],_0x5d11d3[_0x2f3df3(0x229)],_0x5d11d3[_0x2f3df3(0x1dc)]),'userName':_0x5d11d3['userName'],'nickname':pickFirst(_0x5d11d3[_0x2f3df3(0x1e0)],_0x5d11d3[_0x2f3df3(0x224)]),'nickName':_0x5d11d3[_0x2f3df3(0x224)],'tenantCode':_0x5d11d3[_0x2f3df3(0x231)],'employeeId':_0x5d11d3[_0x2f3df3(0x219)]};}function usesRuntimeContext(_0x2dec8b){const _0x461aba=a38_0xf15c;return _0x2dec8b[_0x461aba(0x1da)][_0x461aba(0x1ec)](_0x16f27=>typeof _0x16f27[_0x461aba(0x1d9)]===_0x461aba(0x20e)&&(_0x16f27[_0x461aba(0x1d9)]['startsWith'](_0x461aba(0x234))||_0x16f27[_0x461aba(0x1d9)][_0x461aba(0x1f5)](_0x461aba(0x1f6))));}function pickFirst(..._0xa01dcd){return _0xa01dcd['find'](_0xce2566=>_0xce2566!==undefined&&_0xce2566!==null);}async function executePlan(_0x4e835c,_0x2e787e,_0x4b847d){const _0xff7453=a38_0xf15c;if(_0x4e835c['kind']===_0xff7453(0x218)){const _0x1975bb=await resolveDatasetCode(_0x4e835c,_0x2e787e,_0x4b847d);return executeData(_0x1975bb,_0x4e835c[_0xff7453(0x1f8)],_0x4e835c[_0xff7453(0x1f7)]);}if(_0x4e835c['kind']==='sql'){if(!_0x4e835c['sqlCode'])throw CliErrors[_0xff7453(0x204)]('Service\x20command\x20'+_0x2e787e['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x4e835c[_0xff7453(0x21d)],normalizeScalarParams(_0x4e835c[_0xff7453(0x1f7)]));}if(_0x4e835c[_0xff7453(0x21b)]==='bff'){const _0x5766ad=_0x4e835c[_0xff7453(0x232)]||_0x4e835c[_0xff7453(0x1fb)]||(_0x4e835c[_0xff7453(0x1e7)]==null?'':String(_0x4e835c[_0xff7453(0x1e7)]));if(!_0x5766ad)throw CliErrors['validation'](_0xff7453(0x1ff)+_0x2e787e[_0xff7453(0x1d8)]+_0xff7453(0x20a));return executeSdkBff(_0x5766ad,_0x4e835c[_0xff7453(0x1f7)]);}throw CliErrors[_0xff7453(0x204)](_0xff7453(0x205)+_0x4e835c[_0xff7453(0x21b)]);}async function resolveDatasetCode(_0x4eec81,_0x365398,_0x452a69){const _0x59e03a=a38_0xf15c;if(_0x4eec81['datasetCode'])return _0x4eec81[_0x59e03a(0x215)];if(!_0x4eec81['datatable'])throw CliErrors[_0x59e03a(0x204)]('Service\x20command\x20'+_0x365398[_0x59e03a(0x1d8)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x1dce8f=await listDatasets(_0x452a69[_0x59e03a(0x1ef)]),_0x1822bb=_0x1dce8f[_0x59e03a(0x1f0)](_0x1065bb=>_0x1065bb[_0x59e03a(0x201)]?.[_0x59e03a(0x207)]===_0x4eec81[_0x59e03a(0x1d6)]);if(!_0x1822bb?.[_0x59e03a(0x206)])throw CliErrors[_0x59e03a(0x204)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x4eec81[_0x59e03a(0x1d6)]+_0x59e03a(0x221)+_0x452a69['appCode']+'.',_0x59e03a(0x1ee));return _0x1822bb['code'];}function applyAppBinding(_0x2c0af4,_0x218673,_0x161258){const _0x3bb4be=a38_0xf15c,_0x749536=_0x218673[_0x3bb4be(0x237)][_0x3bb4be(0x21a)];if(!_0x749536)return;const _0x428945=_0x2c0af4[_0x3bb4be(0x1df)][_0x749536];if(!_0x428945)throw CliErrors[_0x3bb4be(0x204)]('Unknown\x20appRef\x20\x22'+_0x749536+'\x22\x20in\x20service\x20command\x20'+_0x218673[_0x3bb4be(0x1d8)]+'.',_0x3bb4be(0x1ed));const _0x35dff7=_0x428945[_0x3bb4be(0x21c)]||_0x428945[_0x3bb4be(0x1ef)];_0x35dff7&&!hasText(_0x161258[_0x3bb4be(0x21c)])&&(_0x161258[_0x3bb4be(0x21c)]=_0x35dff7),_0x428945['app']&&!hasText(_0x161258[_0x3bb4be(0x22b)])&&!hasText(_0x161258[_0x3bb4be(0x21c)])&&(_0x161258[_0x3bb4be(0x22b)]=_0x428945['app']),_0x428945['env']&&!hasText(_0x161258['env'])&&(_0x161258[_0x3bb4be(0x1fe)]=_0x428945[_0x3bb4be(0x1fe)]);}function renderDynamicCommandHelp(_0xd6588b){const _0x3da7d7=a38_0xf15c,_0x2c069f=[_0x3da7d7(0x1e8),_0x3da7d7(0x23b)+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x21b)],'\x20\x20\x20\x20command:\x20'+_0xd6588b[_0x3da7d7(0x237)]['command']];if(_0xd6588b[_0x3da7d7(0x237)]['datasetCode'])_0x2c069f[_0x3da7d7(0x217)]('\x20\x20\x20\x20datasetCode:\x20'+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x215)]);if(_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x1d6)])_0x2c069f['push'](_0x3da7d7(0x228)+_0xd6588b[_0x3da7d7(0x237)]['datatable']);if(_0xd6588b['target'][_0x3da7d7(0x21d)])_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x220)+_0xd6588b[_0x3da7d7(0x237)]['sqlCode']);if(_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x232)])_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x223)+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x232)]);if(_0xd6588b[_0x3da7d7(0x1da)][_0x3da7d7(0x227)]>0x0){_0x2c069f[_0x3da7d7(0x217)]('',_0x3da7d7(0x1db));for(const _0x5ccb9f of _0xd6588b['mapTo']){_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x1e4)+(_0x5ccb9f[_0x3da7d7(0x1d9)]||_0x3da7d7(0x1de))+_0x3da7d7(0x1fd)+_0x5ccb9f[_0x3da7d7(0x237)]+(_0x5ccb9f[_0x3da7d7(0x216)]?'.'+_0x5ccb9f[_0x3da7d7(0x216)]:''));}}return _0x2c069f[_0x3da7d7(0x20c)]('\x0a');}function targetPreview(_0x5ed556){const _0xb0859b=a38_0xf15c;return{'kind':_0x5ed556[_0xb0859b(0x21b)],'command':_0x5ed556['command'],'appRef':_0x5ed556[_0xb0859b(0x21a)],'datasetCode':_0x5ed556[_0xb0859b(0x215)],'datatable':_0x5ed556[_0xb0859b(0x1d6)],'sqlCode':_0x5ed556[_0xb0859b(0x21d)],'bffCode':_0x5ed556[_0xb0859b(0x1fb)],'bffId':_0x5ed556[_0xb0859b(0x1e7)],'scriptName':_0x5ed556[_0xb0859b(0x232)]};}function normalizeScalarParams(_0x8543da){const _0x288876=a38_0xf15c;return Object[_0x288876(0x1e3)](Object[_0x288876(0x20b)](_0x8543da)['filter'](([,_0x5af1e0])=>typeof _0x5af1e0===_0x288876(0x20e)||typeof _0x5af1e0===_0x288876(0x1f4)));}function hasText(_0x30fd18){const _0x35573b=a38_0xf15c;return typeof _0x30fd18==='string'&&_0x30fd18[_0x35573b(0x1e2)]()[_0x35573b(0x227)]>0x0;}function isPrimitiveFlagDefault(_0x48854e){const _0x15a6a9=a38_0xf15c;return _0x48854e===undefined||typeof _0x48854e==='string'||typeof _0x48854e==='number'||typeof _0x48854e===_0x15a6a9(0x22e);}
1
+ (function(_0x4571ec,_0x2b9a4e){const _0xa8ce06=a38_0xde78,_0x2eb1be=_0x4571ec();while(!![]){try{const _0xdfbfa5=parseInt(_0xa8ce06(0x93))/0x1+-parseInt(_0xa8ce06(0x67))/0x2+parseInt(_0xa8ce06(0xad))/0x3*(-parseInt(_0xa8ce06(0x6f))/0x4)+parseInt(_0xa8ce06(0x8d))/0x5*(-parseInt(_0xa8ce06(0x73))/0x6)+-parseInt(_0xa8ce06(0x99))/0x7+-parseInt(_0xa8ce06(0xc8))/0x8*(-parseInt(_0xa8ce06(0xb7))/0x9)+parseInt(_0xa8ce06(0xb6))/0xa;if(_0xdfbfa5===_0x2b9a4e)break;else _0x2eb1be['push'](_0x2eb1be['shift']());}catch(_0x31e85f){_0x2eb1be['push'](_0x2eb1be['shift']());}}}(a38_0x4421,0x87b5e));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a38_0xde78(_0x150ef9,_0x238037){_0x150ef9=_0x150ef9-0x67;const _0x44215f=a38_0x4421();let _0xde78e5=_0x44215f[_0x150ef9];return _0xde78e5;}export function resolveDynamicServiceCommand(_0x530e1c,_0x2eb76a){const _0x4363d7=a38_0xde78,_0x4049fd=listLocalServiceTrees();let _0x59580f;for(const _0xa9f5c1 of _0x4049fd){const _0x1d5151=matchServiceTreeCommand(_0xa9f5c1,_0x530e1c);if(!_0x1d5151)continue;(!_0x59580f||_0x1d5151[_0x4363d7(0xa4)][_0x4363d7(0xbf)][_0x4363d7(0xa7)]>_0x59580f[_0x4363d7(0xa4)][_0x4363d7(0xbf)][_0x4363d7(0xa7)])&&(_0x59580f={'tree':_0xa9f5c1,'command':_0x1d5151[_0x4363d7(0xa4)],'remainingArgs':_0x1d5151[_0x4363d7(0x77)]});}if(!_0x59580f)return undefined;const _0x401c18={..._0x2eb76a};return applyAppBinding(_0x59580f[_0x4363d7(0x8c)],_0x59580f[_0x4363d7(0xa4)],_0x401c18),{'definition':buildDynamicCommandDefinition(_0x59580f[_0x4363d7(0x8c)],_0x59580f['command']),'args':_0x59580f[_0x4363d7(0x77)],'flags':_0x401c18,'tree':_0x59580f[_0x4363d7(0x8c)],'command':_0x59580f['command']};}export function generateDynamicServiceHelp(_0x55251d){const _0x49028d=a38_0xde78,_0x4be0d5=listLocalServiceTrees()['find'](_0x2c1fe0=>_0x2c1fe0['service']['code']===_0x55251d);if(!_0x4be0d5)return undefined;const _0x55f013=[CLI_BIN_NAME+'\x20'+_0x55251d+_0x49028d(0xc4),'',_0x4be0d5[_0x49028d(0xbb)]['name']||_0x55251d,_0x4be0d5[_0x49028d(0xbb)][_0x49028d(0x90)]?'\x20\x20'+_0x4be0d5['service'][_0x49028d(0x90)]:'','',_0x49028d(0x6c),..._0x4be0d5['commands'][_0x49028d(0x7d)](_0x6776f8=>{const _0x535f99=_0x49028d,_0x2e4b75=_0x6776f8['fullPath'][_0x535f99(0x88)](0x1)[_0x535f99(0x6e)]('\x20'),_0x2b3638=_0x6776f8['risk']===_0x535f99(0xa1)?'':'\x20['+_0x6776f8[_0x535f99(0x78)]+']';return'\x20\x20'+_0x2e4b75['padEnd'](0x18)+'\x20'+(_0x6776f8[_0x535f99(0x90)]||'')+_0x2b3638;}),'',_0x49028d(0xb9)+CLI_BIN_NAME+_0x49028d(0x84)+_0x55251d+_0x49028d(0xa6)][_0x49028d(0x97)](Boolean);return _0x55f013[_0x49028d(0x6e)]('\x0a');}export function listDynamicServiceEntries(){const _0xd9f6f9=a38_0xde78;return listLocalServices()[_0xd9f6f9(0x7d)](_0x165118=>{const _0x1aec13=_0xd9f6f9,_0x5451b6=_0x165118[_0x1aec13(0xa5)];return{'service':_0x5451b6['service'][_0x1aec13(0x71)],'label':_0x5451b6['service'][_0x1aec13(0x91)]||_0x5451b6[_0x1aec13(0xbb)]['code'],'commands':_0x5451b6[_0x1aec13(0x9f)][_0x1aec13(0x7d)](_0x16c2aa=>({'command':dynamicCommandName(_0x16c2aa),'description':_0x16c2aa[_0x1aec13(0x90)]||_0x1aec13(0xca)+_0x16c2aa[_0x1aec13(0xc0)],'tag':riskTag(_0x16c2aa[_0x1aec13(0x78)])}))};});}export function getDynamicServiceEntry(_0x32a3c1){const _0x3d29c9=a38_0xde78;return listDynamicServiceEntries()[_0x3d29c9(0xb1)](_0x4244d4=>_0x4244d4[_0x3d29c9(0xbb)]===_0x32a3c1);}export function listDynamicServiceDefinitions(_0x4d19da){const _0x5c5985=a38_0xde78;return listLocalServiceTrees()[_0x5c5985(0x97)](_0x3f6906=>!_0x4d19da||_0x3f6906[_0x5c5985(0xbb)]['code']===_0x4d19da)['flatMap'](_0x1a42cc=>_0x1a42cc[_0x5c5985(0x9f)][_0x5c5985(0x7d)](_0x1919e8=>buildDynamicCommandDefinition(_0x1a42cc,_0x1919e8)));}export function getDynamicServiceDefinitions(_0x4ba2d4){const _0x34f9c2=listDynamicServiceDefinitions(_0x4ba2d4);return _0x34f9c2['length']>0x0?_0x34f9c2:undefined;}export function findDynamicServiceDefinition(_0x39782f,_0x21495c){const _0x41b3ac=a38_0xde78;return listDynamicServiceDefinitions(_0x39782f)[_0x41b3ac(0xb1)](_0x200b29=>_0x200b29['command']===_0x21495c);}export function buildDynamicCommandDefinition(_0x1afa35,_0x38546a){const _0x2c320f=a38_0xde78;return{'service':_0x1afa35[_0x2c320f(0xbb)][_0x2c320f(0x71)],'command':dynamicCommandName(_0x38546a),'description':_0x38546a[_0x2c320f(0x90)]||_0x2c320f(0xca)+_0x38546a['cliPath'],'risk':_0x38546a[_0x2c320f(0x78)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x38546a['args'][_0x2c320f(0x7d)](_0x119788=>({'name':_0x119788[_0x2c320f(0x91)],'description':_0x119788[_0x2c320f(0x90)]||_0x119788[_0x2c320f(0x91)],'required':_0x119788[_0x2c320f(0xc1)]})),'flags':_0x38546a[_0x2c320f(0x9d)][_0x2c320f(0x7d)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x38546a),async 'dryRun'(_0x4bff6d){const _0x44cb0b=_0x2c320f,_0x135a56=await compilePlan(_0x38546a,_0x4bff6d);return{'method':_0x44cb0b(0x7b),'url':_0x38546a[_0x44cb0b(0xc0)],'body':{'target':targetPreview(_0x135a56),'params':_0x135a56[_0x44cb0b(0x6b)]},'description':_0x44cb0b(0xba)+_0x38546a[_0x44cb0b(0xc0)]};},async 'execute'(_0x9c568a){const _0x53888f=_0x2c320f,_0x34705b=await compilePlan(_0x38546a,_0x9c568a),_0x220fb5=Date[_0x53888f(0xbe)](),_0x460593=await executePlan(_0x34705b,_0x38546a,_0x9c568a),_0xee6dcb=Date[_0x53888f(0xbe)]()-_0x220fb5;return{'ok':!![],'data':{'service':_0x1afa35[_0x53888f(0xbb)],'command':_0x38546a[_0x53888f(0xc0)],'target':targetPreview(_0x34705b),'result':_0x460593,'elapsed':_0xee6dcb},'message':_0x53888f(0x80)+_0x38546a[_0x53888f(0xc0)]+'\x20completed\x20in\x20'+_0xee6dcb+'ms'};}};}function dynamicCommandName(_0xc9a12f){const _0x93a30f=a38_0xde78;return _0xc9a12f[_0x93a30f(0xbf)]['slice'](0x1)['join']('\x20');}function riskTag(_0x4ecf2e){const _0x460b3b=a38_0xde78;return _0x4ecf2e===_0x460b3b(0xa1)?'':_0x460b3b(0x94)+_0x4ecf2e+']';}function flagToCommandFlag(_0x18a4bc){const _0x23f3a0=a38_0xde78;return{'name':_0x18a4bc['cliName'],'type':_0x18a4bc[_0x23f3a0(0xa0)]==='json'?_0x23f3a0(0x96):_0x18a4bc[_0x23f3a0(0xa0)],'description':_0x18a4bc[_0x23f3a0(0x90)]||_0x18a4bc[_0x23f3a0(0x91)],'required':_0x18a4bc[_0x23f3a0(0xc1)],'default':isPrimitiveFlagDefault(_0x18a4bc[_0x23f3a0(0x7f)])?_0x18a4bc[_0x23f3a0(0x7f)]:undefined,'enum':_0x18a4bc['enum']};}function a38_0x4421(){const _0x518761=['kind','source','flags','boolean','commands','type','read','\x20\x20SERVICE\x20TREE\x20TARGET','\x20\x20\x20\x20sqlCode:\x20','command','normalizedManifest','`\x20to\x20inspect\x20the\x20manifest.','length','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','loginName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','entries','6873hOyYWT','validation','startsWith','fromEntries','find','\x20requires\x20target.scriptName.','Unsupported\x20service\x20target\x20kind:\x20','appCode','number','6300340BJzGsC','649863gqjNtH','ctx.','Use\x20`','Preview\x20dynamic\x20service\x20command:\x20','service','push','appcode','now','fullPath','cliPath','required','bffCode','trim','\x20<command>\x20[flags]','some','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20MAP\x20TO','72uzUaLO','bff','Run\x20service\x20command\x20','rawFlags','696684glGEgJ','bffId','datasetCode','userName','params','Commands:','sql','join','412WuCOfJ','\x20requires\x20target.sqlCode.','code','scriptName','6JqekWm','const','mapTo','employeeId','remainingArgs','risk','nickname','env','SERVICE_TREE','context.','map','sqlCode','default','Service\x20command\x20','\x20\x20\x20\x20datasetCode:\x20','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','envName','\x20service\x20detail\x20--service\x20','app','dbtableConfig','username','slice','Cannot\x20resolve\x20datatable\x20\x22','tableName','data','tree','2510605YVVgLv','nickName','operator','description','name','datatable','557816OKKxMC','\x20\x20[','appRef','string','filter','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','1367849cGzgLy','target'];a38_0x4421=function(){return _0x518761;};return a38_0x4421();}async function compilePlan(_0x4ff8aa,_0x2e53f8){const _0xbf9221=a38_0xde78;return compileServiceTreeCommand(_0x4ff8aa,{'flags':_0x2e53f8[_0xbf9221(0xcb)],'args':_0x2e53f8['args'],'context':await buildServiceContext(_0x4ff8aa,_0x2e53f8)});}async function buildServiceContext(_0x460315,_0x42a802){const _0x2c4069=a38_0xde78,_0xe1cff3={'appCode':_0x42a802[_0x2c4069(0xb4)],'env':_0x42a802[_0x2c4069(0x83)],'envName':_0x42a802[_0x2c4069(0x83)]};if(!usesRuntimeContext(_0x460315))return _0xe1cff3;const _0x49aa16=await getLoginUserInfo(),_0x2df194=pickFirst(_0x49aa16['userId'],_0x49aa16['id']);return{..._0xe1cff3,'user':_0x49aa16,'userId':_0x2df194,'id':_0x49aa16['id'],'username':pickFirst(_0x49aa16[_0x2c4069(0x87)],_0x49aa16[_0x2c4069(0x6a)],_0x49aa16[_0x2c4069(0xaa)]),'userName':_0x49aa16[_0x2c4069(0x6a)],'nickname':pickFirst(_0x49aa16[_0x2c4069(0x79)],_0x49aa16['nickName']),'nickName':_0x49aa16[_0x2c4069(0x8e)],'tenantCode':_0x49aa16['tenantCode'],'employeeId':_0x49aa16[_0x2c4069(0x76)]};}function usesRuntimeContext(_0x4adb91){const _0x38698e=a38_0xde78;return _0x4adb91[_0x38698e(0x75)][_0x38698e(0xc5)](_0x3c8920=>typeof _0x3c8920[_0x38698e(0x9c)]===_0x38698e(0x96)&&(_0x3c8920[_0x38698e(0x9c)][_0x38698e(0xaf)](_0x38698e(0x7c))||_0x3c8920[_0x38698e(0x9c)][_0x38698e(0xaf)](_0x38698e(0xb8))));}function pickFirst(..._0x589179){const _0x46de43=a38_0xde78;return _0x589179[_0x46de43(0xb1)](_0x51900f=>_0x51900f!==undefined&&_0x51900f!==null);}async function executePlan(_0x4d0863,_0x11e535,_0x121e5f){const _0x4fed4d=a38_0xde78;if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0x8b)){const _0x2f1154=await resolveDatasetCode(_0x4d0863,_0x11e535,_0x121e5f);return executeData(_0x2f1154,_0x4d0863[_0x4fed4d(0xa4)],_0x4d0863[_0x4fed4d(0x6b)]);}if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0x6d)){if(!_0x4d0863[_0x4fed4d(0x7e)])throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0x80)+_0x11e535[_0x4fed4d(0xc0)]+_0x4fed4d(0x70));return executeSdkSql(_0x4d0863['sqlCode'],normalizeScalarParams(_0x4d0863[_0x4fed4d(0x6b)]));}if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0xc9)){const _0x405f72=_0x4d0863[_0x4fed4d(0x72)]||_0x4d0863['bffCode']||(_0x4d0863[_0x4fed4d(0x68)]==null?'':String(_0x4d0863[_0x4fed4d(0x68)]));if(!_0x405f72)throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0x80)+_0x11e535['cliPath']+_0x4fed4d(0xb2));return executeSdkBff(_0x405f72,_0x4d0863[_0x4fed4d(0x6b)]);}throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0xb3)+_0x4d0863[_0x4fed4d(0x9b)]);}async function resolveDatasetCode(_0x3a79fd,_0x322eb9,_0xb4dea6){const _0x212ce7=a38_0xde78;if(_0x3a79fd[_0x212ce7(0x69)])return _0x3a79fd[_0x212ce7(0x69)];if(!_0x3a79fd[_0x212ce7(0x92)])throw CliErrors[_0x212ce7(0xae)](_0x212ce7(0x80)+_0x322eb9[_0x212ce7(0xc0)]+_0x212ce7(0x98));const _0x4857e9=await listDatasets(_0xb4dea6['appCode']),_0x393721=_0x4857e9[_0x212ce7(0xb1)](_0x117616=>_0x117616[_0x212ce7(0x86)]?.[_0x212ce7(0x8a)]===_0x3a79fd[_0x212ce7(0x92)]);if(!_0x393721?.[_0x212ce7(0x71)])throw CliErrors[_0x212ce7(0xae)](_0x212ce7(0x89)+_0x3a79fd['datatable']+_0x212ce7(0xc6)+_0xb4dea6[_0x212ce7(0xb4)]+'.',_0x212ce7(0x82));return _0x393721[_0x212ce7(0x71)];}function applyAppBinding(_0x111c40,_0x2738dc,_0x5db4f3){const _0x5e8d42=a38_0xde78,_0x35fedf=_0x2738dc['target'][_0x5e8d42(0x95)];if(!_0x35fedf)return;const _0xaf7597=_0x111c40['appBindings'][_0x35fedf];if(!_0xaf7597)throw CliErrors[_0x5e8d42(0xae)]('Unknown\x20appRef\x20\x22'+_0x35fedf+'\x22\x20in\x20service\x20command\x20'+_0x2738dc[_0x5e8d42(0xc0)]+'.',_0x5e8d42(0xab));const _0x30005f=_0xaf7597[_0x5e8d42(0xbd)]||_0xaf7597[_0x5e8d42(0xb4)];_0x30005f&&!hasText(_0x5db4f3[_0x5e8d42(0xbd)])&&(_0x5db4f3['appcode']=_0x30005f),_0xaf7597[_0x5e8d42(0x85)]&&!hasText(_0x5db4f3['app'])&&!hasText(_0x5db4f3[_0x5e8d42(0xbd)])&&(_0x5db4f3[_0x5e8d42(0x85)]=_0xaf7597[_0x5e8d42(0x85)]),_0xaf7597[_0x5e8d42(0x7a)]&&!hasText(_0x5db4f3[_0x5e8d42(0x7a)])&&(_0x5db4f3[_0x5e8d42(0x7a)]=_0xaf7597[_0x5e8d42(0x7a)]);}function renderDynamicCommandHelp(_0x454abf){const _0x56c9f4=a38_0xde78,_0xcf12de=[_0x56c9f4(0xa2),_0x56c9f4(0xa9)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x9b)],'\x20\x20\x20\x20command:\x20'+_0x454abf['target'][_0x56c9f4(0xa4)]];if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x69)])_0xcf12de[_0x56c9f4(0xbc)](_0x56c9f4(0x81)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x69)]);if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x92)])_0xcf12de['push'](_0x56c9f4(0xa8)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x92)]);if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x7e)])_0xcf12de[_0x56c9f4(0xbc)](_0x56c9f4(0xa3)+_0x454abf['target'][_0x56c9f4(0x7e)]);if(_0x454abf['target'][_0x56c9f4(0x72)])_0xcf12de[_0x56c9f4(0xbc)]('\x20\x20\x20\x20scriptName:\x20'+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x72)]);if(_0x454abf[_0x56c9f4(0x75)][_0x56c9f4(0xa7)]>0x0){_0xcf12de['push']('',_0x56c9f4(0xc7));for(const _0x191a1a of _0x454abf['mapTo']){_0xcf12de['push']('\x20\x20\x20\x20'+(_0x191a1a['source']||_0x56c9f4(0x74))+'\x20->\x20'+_0x191a1a[_0x56c9f4(0x9a)]+(_0x191a1a[_0x56c9f4(0x8f)]?'.'+_0x191a1a['operator']:''));}}return _0xcf12de[_0x56c9f4(0x6e)]('\x0a');}function targetPreview(_0x3ef3aa){const _0x969cf=a38_0xde78;return{'kind':_0x3ef3aa[_0x969cf(0x9b)],'command':_0x3ef3aa[_0x969cf(0xa4)],'appRef':_0x3ef3aa[_0x969cf(0x95)],'datasetCode':_0x3ef3aa[_0x969cf(0x69)],'datatable':_0x3ef3aa[_0x969cf(0x92)],'sqlCode':_0x3ef3aa[_0x969cf(0x7e)],'bffCode':_0x3ef3aa[_0x969cf(0xc2)],'bffId':_0x3ef3aa[_0x969cf(0x68)],'scriptName':_0x3ef3aa['scriptName']};}function normalizeScalarParams(_0x5816a7){const _0x491142=a38_0xde78;return Object[_0x491142(0xb0)](Object[_0x491142(0xac)](_0x5816a7)[_0x491142(0x97)](([,_0x244790])=>typeof _0x244790===_0x491142(0x96)||typeof _0x244790===_0x491142(0xb5)));}function hasText(_0x34c957){const _0x52b091=a38_0xde78;return typeof _0x34c957===_0x52b091(0x96)&&_0x34c957[_0x52b091(0xc3)]()[_0x52b091(0xa7)]>0x0;}function isPrimitiveFlagDefault(_0x150fdb){const _0xdbd20d=a38_0xde78;return _0x150fdb===undefined||typeof _0x150fdb===_0xdbd20d(0x96)||typeof _0x150fdb===_0xdbd20d(0xb5)||typeof _0x150fdb===_0xdbd20d(0x9e);}
@@ -1 +1 @@
1
- const a39_0xfbde82=a39_0x41ec;function a39_0x41ec(_0x588590,_0x12356d){_0x588590=_0x588590-0x15a;const _0x2df6cf=a39_0x2df6();let _0x41ecd2=_0x2df6cf[_0x588590];return _0x41ecd2;}function a39_0x2df6(){const _0x3ebd5a=['List\x20locally\x20imported\x20Service\x20Tree\x20manifests','report','file','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','errors','Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','filePath','hash','kind','source','commands','imported','list','Service\x20manifest\x20validation\x20passed.','entries','567LxhBdk','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','34446VWcRng','486200ITMiTg','detail','str','Local\x20service\x20code,\x20for\x20example\x20crm','read','manifest','flags','lower\x20kebab-case\x20service\x20code','length','Imported','entry','cliName','remove','map','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','type','serviceCount','description','normalizedManifest','updated','replaced','service','cliPath','target','version','string','\x20service(s).','risk','30906GQstGc','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registryIndex','registry','Exported\x20service\x20','manifests','Service\x20registry\x20validation\x20passed.','\x20service(s),\x20updated\x20','registryPath','warnings','3208UsJNQo','14PmuLsR','260612ZnyhIY','write','import','serviceCode','required','1352055giEfDC','34922xTYcLP','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','WRITE','validate','6993DNIJRL','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest'];a39_0x2df6=function(){return _0x3ebd5a;};return a39_0x2df6();}(function(_0x4f750d,_0x52fe0b){const _0x2a74c9=a39_0x41ec,_0x5cce96=_0x4f750d();while(!![]){try{const _0x1a9178=-parseInt(_0x2a74c9(0x19f))/0x1*(-parseInt(_0x2a74c9(0x15f))/0x2)+-parseInt(_0x2a74c9(0x194))/0x3+-parseInt(_0x2a74c9(0x1a0))/0x4+parseInt(_0x2a74c9(0x15e))/0x5+parseInt(_0x2a74c9(0x177))/0x6*(-parseInt(_0x2a74c9(0x175))/0x7)+-parseInt(_0x2a74c9(0x19e))/0x8*(-parseInt(_0x2a74c9(0x163))/0x9)+-parseInt(_0x2a74c9(0x178))/0xa;if(_0x1a9178===_0x52fe0b)break;else _0x5cce96['push'](_0x5cce96['shift']());}catch(_0x218be0){_0x5cce96['push'](_0x5cce96['shift']());}}}(a39_0x2df6,0x39f22));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0xfbde82(0x167),'type':a39_0xfbde82(0x191),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0xfbde82(0x18d),'type':a39_0xfbde82(0x191),'required':!![],'description':a39_0xfbde82(0x17b),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xfbde82(0x17f)}};function summarizeService(_0x512ab6){const _0x5ef7ef=a39_0xfbde82;return{'serviceCode':_0x512ab6[_0x5ef7ef(0x15c)],'name':_0x512ab6[_0x5ef7ef(0x18a)]['service']['name'],'version':_0x512ab6['version'],'importedAt':_0x512ab6['importedAt'],'source':_0x512ab6[_0x5ef7ef(0x16f)],'commandCount':_0x512ab6[_0x5ef7ef(0x18a)][_0x5ef7ef(0x170)][_0x5ef7ef(0x180)],'commands':_0x512ab6['normalizedManifest'][_0x5ef7ef(0x170)][_0x5ef7ef(0x185)](_0x3cb2e7=>({'path':_0x3cb2e7['cliPath'],'description':_0x3cb2e7[_0x5ef7ef(0x189)],'risk':_0x3cb2e7[_0x5ef7ef(0x193)],'target':_0x3cb2e7[_0x5ef7ef(0x18f)],'flags':_0x3cb2e7[_0x5ef7ef(0x17e)][_0x5ef7ef(0x185)](_0x672497=>({'name':_0x672497['name'],'cliName':_0x672497[_0x5ef7ef(0x183)],'type':_0x672497[_0x5ef7ef(0x187)],'required':_0x672497[_0x5ef7ef(0x15d)]===!![]}))}))};}function summarizeLoadedManifest(_0x460138){const _0x3c2bf3=a39_0xfbde82;return{'service':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x18d)],'version':_0x460138['normalizedManifest']?.[_0x3c2bf3(0x190)],'commandCount':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x170)][_0x3c2bf3(0x180)]??0x0,'commands':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x170)][_0x3c2bf3(0x185)](_0x157731=>({'path':_0x157731[_0x3c2bf3(0x18e)],'risk':_0x157731[_0x3c2bf3(0x193)],'target':_0x157731[_0x3c2bf3(0x18f)]}))??[],'registryIndex':_0x460138[_0x3c2bf3(0x196)],'registryServiceCode':_0x460138['registryServiceCode'],'errors':_0x460138[_0x3c2bf3(0x166)][_0x3c2bf3(0x169)],'warnings':_0x460138['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x162),'description':a39_0xfbde82(0x168),'risk':a39_0xfbde82(0x17c),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4ae283){const _0x56c36a=a39_0xfbde82,_0x4f2f49=loadServiceManifestFromFile(_0x4ae283[_0x56c36a(0x17a)]('file'));if(!_0x4f2f49[_0x56c36a(0x166)]['ok'])return{'ok':![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49[_0x56c36a(0x16d)],'kind':_0x4f2f49[_0x56c36a(0x16e)],'serviceCount':_0x4f2f49['manifests']['length'],'services':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x185)](summarizeLoadedManifest),'errors':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x169)],'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':formatValidationFailure(_0x4f2f49['report'])};if(_0x4f2f49[_0x56c36a(0x16e)]===_0x56c36a(0x197)||_0x4f2f49[_0x56c36a(0x199)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49[_0x56c36a(0x16d)],'kind':_0x4f2f49[_0x56c36a(0x16e)],'serviceCount':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x180)],'commandCount':_0x4f2f49[_0x56c36a(0x199)]['reduce']((_0x2fc362,_0x1b95c7)=>_0x2fc362+(_0x1b95c7[_0x56c36a(0x18a)]?.['commands'][_0x56c36a(0x180)]??0x0),0x0),'services':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x185)](summarizeLoadedManifest),'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':_0x56c36a(0x19a)};return{'ok':!![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49['hash'],'kind':_0x4f2f49[_0x56c36a(0x16e)],'service':_0x4f2f49[_0x56c36a(0x18a)]?.['service'],'version':_0x4f2f49[_0x56c36a(0x18a)]?.[_0x56c36a(0x190)],'commandCount':_0x4f2f49['normalizedManifest']?.['commands'][_0x56c36a(0x180)]??0x0,'commands':_0x4f2f49[_0x56c36a(0x18a)]?.['commands'][_0x56c36a(0x185)](_0x2b12ad=>({'path':_0x2b12ad[_0x56c36a(0x18e)],'risk':_0x2b12ad[_0x56c36a(0x193)],'target':_0x2b12ad[_0x56c36a(0x18f)]})),'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':_0x56c36a(0x173)};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x15b),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x54dac7){const _0x551d8f=a39_0xfbde82,_0x1dfaf9=loadServiceManifestFromFile(_0x54dac7[_0x551d8f(0x17a)](_0x551d8f(0x167)));return{'method':_0x551d8f(0x161),'url':getServiceRegistryPath(),'body':{'file':_0x1dfaf9[_0x551d8f(0x16c)],'hash':_0x1dfaf9[_0x551d8f(0x16d)],'kind':_0x1dfaf9[_0x551d8f(0x16e)],'ok':_0x1dfaf9[_0x551d8f(0x166)]['ok'],'service':_0x1dfaf9[_0x551d8f(0x18a)]?.['service'],'version':_0x1dfaf9[_0x551d8f(0x18a)]?.['version'],'serviceCount':_0x1dfaf9['manifests'][_0x551d8f(0x180)],'services':_0x1dfaf9['manifests'][_0x551d8f(0x185)](_0x5b0055=>({'service':_0x5b0055['normalizedManifest']?.['service'],'version':_0x5b0055['normalizedManifest']?.[_0x551d8f(0x190)],'commandCount':_0x5b0055[_0x551d8f(0x18a)]?.['commands'][_0x551d8f(0x180)]??0x0,'errors':_0x5b0055[_0x551d8f(0x166)][_0x551d8f(0x169)]})),'errors':_0x1dfaf9[_0x551d8f(0x166)][_0x551d8f(0x169)],'commandCount':_0x1dfaf9[_0x551d8f(0x18a)]?.[_0x551d8f(0x170)]['length']??0x0},'description':_0x551d8f(0x186)};},async 'execute'(_0x527618){const _0xd3b217=a39_0xfbde82,_0x4cba31=importServiceManifest(_0x527618['str'](_0xd3b217(0x167)));if(_0x4cba31[_0xd3b217(0x174)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x4cba31['registryPath'],'imported':_0x4cba31[_0xd3b217(0x171)],'updated':_0x4cba31[_0xd3b217(0x18b)],'serviceCount':_0x4cba31[_0xd3b217(0x188)],'services':_0x4cba31[_0xd3b217(0x174)][_0xd3b217(0x185)](summarizeService)},'message':'Imported\x20'+_0x4cba31['imported']+_0xd3b217(0x19b)+_0x4cba31['updated']+_0xd3b217(0x192)};return{'ok':!![],'data':{'registryPath':_0x4cba31['registryPath'],'replaced':_0x4cba31[_0xd3b217(0x18c)],'imported':_0x4cba31[_0xd3b217(0x171)],'updated':_0x4cba31[_0xd3b217(0x18b)],'serviceCount':_0x4cba31[_0xd3b217(0x188)],'service':summarizeService(_0x4cba31[_0xd3b217(0x182)])},'message':(_0x4cba31['replaced']?'Updated':_0xd3b217(0x181))+'\x20service\x20'+_0x4cba31[_0xd3b217(0x182)]['serviceCode']+'.'};}},{'service':a39_0xfbde82(0x18d),'command':'export','description':a39_0xfbde82(0x176),'risk':a39_0xfbde82(0x15a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x27183e){const _0x36c5a8=a39_0xfbde82,_0x4248e3=getLocalServiceEntry(_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x18d)));return{'method':_0x36c5a8(0x161),'url':_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x167)),'body':{'service':_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x18d)),'found':Boolean(_0x4248e3),'version':_0x4248e3?.[_0x36c5a8(0x190)],'source':_0x4248e3?.[_0x36c5a8(0x16f)]},'description':_0x36c5a8(0x160)};},async 'execute'(_0x5146ec){const _0x105dcc=a39_0xfbde82,_0x1ad72e=exportServiceManifest(_0x5146ec['str'](_0x105dcc(0x18d)),_0x5146ec[_0x105dcc(0x17a)](_0x105dcc(0x167)));return{'ok':!![],'data':{'registryPath':_0x1ad72e[_0x105dcc(0x19c)],'file':_0x1ad72e['filePath'],'service':summarizeService(_0x1ad72e[_0x105dcc(0x182)])},'message':_0x105dcc(0x198)+_0x1ad72e[_0x105dcc(0x182)]['serviceCode']+'.'};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x172),'description':a39_0xfbde82(0x165),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2edf93=a39_0xfbde82,_0x2082b7=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2082b7[_0x2edf93(0x180)],'services':_0x2082b7['map'](summarizeService)}};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x184),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0xfbde82(0x15a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x2a2ddf){const _0x47274e=a39_0xfbde82,_0x50fde6=getLocalServiceEntry(_0x2a2ddf['str']('service'));return{'method':_0x47274e(0x161),'url':getServiceRegistryPath(),'body':{'service':_0x2a2ddf[_0x47274e(0x17a)](_0x47274e(0x18d)),'found':Boolean(_0x50fde6),'version':_0x50fde6?.[_0x47274e(0x190)],'source':_0x50fde6?.[_0x47274e(0x16f)]},'description':_0x47274e(0x195)};},async 'execute'(_0x5337da){const _0xc34bcb=a39_0xfbde82,_0x3180fc=removeServiceManifest(_0x5337da[_0xc34bcb(0x17a)]('service'));return{'ok':!![],'data':{'registryPath':_0x3180fc[_0xc34bcb(0x19c)],'serviceCount':_0x3180fc[_0xc34bcb(0x188)],'service':summarizeService(_0x3180fc[_0xc34bcb(0x182)])},'message':_0xc34bcb(0x16a)+_0x3180fc[_0xc34bcb(0x182)][_0xc34bcb(0x15c)]+'.'};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x179),'description':a39_0xfbde82(0x164),'risk':a39_0xfbde82(0x17c),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x329458){const _0x47aa33=a39_0xfbde82,_0x2d3b66=getLocalServiceEntry(_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d)));if(!_0x2d3b66)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d))},'message':_0x47aa33(0x16b)+_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2d3b66),'manifest':_0x2d3b66[_0x47aa33(0x17d)],'normalizedManifest':_0x2d3b66[_0x47aa33(0x18a)]}};}}];
1
+ const a39_0x14c7ef=a39_0x274c;(function(_0x20933f,_0x8fdddd){const _0x329c5f=a39_0x274c,_0x390824=_0x20933f();while(!![]){try{const _0x4191d9=-parseInt(_0x329c5f(0x159))/0x1+parseInt(_0x329c5f(0x15d))/0x2*(parseInt(_0x329c5f(0x163))/0x3)+parseInt(_0x329c5f(0x179))/0x4*(-parseInt(_0x329c5f(0x18f))/0x5)+-parseInt(_0x329c5f(0x185))/0x6+parseInt(_0x329c5f(0x18c))/0x7+-parseInt(_0x329c5f(0x17a))/0x8*(parseInt(_0x329c5f(0x169))/0x9)+parseInt(_0x329c5f(0x170))/0xa;if(_0x4191d9===_0x8fdddd)break;else _0x390824['push'](_0x390824['shift']());}catch(_0x478d83){_0x390824['push'](_0x390824['shift']());}}}(a39_0x1425,0x81c5e));function a39_0x1425(){const _0x26518c=['Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','\x20service(s),\x20updated\x20','file','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','normalizedManifest','registryIndex','risk','import','cliPath','errors','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','export','warnings','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','1061165VSbxwU','manifest','registryPath','string','1687558sGqTIU','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCode','cliName','Updated','WRITE','3mjGSDZ','length','entries','importedAt','updated','type','603gunlEd','write','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','replaced','map','Exported\x20service\x20','12221280feMOgy','Service\x20Tree\x20manifest\x20file\x20path','remove','version','description','registry','Imported','read','service','280DBbeUG','119024yLcKFd','\x20service\x20','imported','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20manifest\x20validation\x20passed.','str','commands','source','flags','hash','report','870918LwhYXw','entry','Local\x20service\x20code,\x20for\x20example\x20crm','filePath','Service\x20registry\x20validation\x20passed.','serviceCount','kind','4919159PyPUQo','validate','manifests','2425IPzFGL'];a39_0x1425=function(){return _0x26518c;};return a39_0x1425();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x274c(_0x27c41e,_0x1b0f5a){_0x27c41e=_0x27c41e-0x157;const _0x14258a=a39_0x1425();let _0x274c32=_0x14258a[_0x27c41e];return _0x274c32;}const FILE_FLAG={'name':'file','type':a39_0x14c7ef(0x15c),'required':!![],'description':a39_0x14c7ef(0x171)},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a39_0x14c7ef(0x187),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x22a6d6){const _0xa96a83=a39_0x14c7ef;return{'serviceCode':_0x22a6d6[_0xa96a83(0x15f)],'name':_0x22a6d6[_0xa96a83(0x195)]['service']['name'],'version':_0x22a6d6['version'],'importedAt':_0x22a6d6[_0xa96a83(0x166)],'source':_0x22a6d6['source'],'commandCount':_0x22a6d6[_0xa96a83(0x195)][_0xa96a83(0x180)][_0xa96a83(0x164)],'commands':_0x22a6d6['normalizedManifest'][_0xa96a83(0x180)][_0xa96a83(0x16e)](_0xf31415=>({'path':_0xf31415[_0xa96a83(0x199)],'description':_0xf31415[_0xa96a83(0x174)],'risk':_0xf31415[_0xa96a83(0x197)],'target':_0xf31415['target'],'flags':_0xf31415[_0xa96a83(0x182)][_0xa96a83(0x16e)](_0x24bd41=>({'name':_0x24bd41['name'],'cliName':_0x24bd41[_0xa96a83(0x160)],'type':_0x24bd41[_0xa96a83(0x168)],'required':_0x24bd41['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5da625){const _0xce1b90=a39_0x14c7ef;return{'service':_0x5da625[_0xce1b90(0x195)]?.[_0xce1b90(0x178)],'version':_0x5da625[_0xce1b90(0x195)]?.[_0xce1b90(0x173)],'commandCount':_0x5da625['normalizedManifest']?.[_0xce1b90(0x180)]['length']??0x0,'commands':_0x5da625[_0xce1b90(0x195)]?.['commands'][_0xce1b90(0x16e)](_0x35e17f=>({'path':_0x35e17f['cliPath'],'risk':_0x35e17f['risk'],'target':_0x35e17f['target']}))??[],'registryIndex':_0x5da625[_0xce1b90(0x196)],'registryServiceCode':_0x5da625['registryServiceCode'],'errors':_0x5da625[_0xce1b90(0x184)]['errors'],'warnings':_0x5da625[_0xce1b90(0x184)][_0xce1b90(0x157)]};}export const serviceDefinitions=[{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x18d),'description':a39_0x14c7ef(0x16c),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x353c62){const _0x477f78=a39_0x14c7ef,_0x232110=loadServiceManifestFromFile(_0x353c62[_0x477f78(0x17f)](_0x477f78(0x193)));if(!_0x232110[_0x477f78(0x184)]['ok'])return{'ok':![],'data':{'file':_0x232110['filePath'],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110[_0x477f78(0x18b)],'serviceCount':_0x232110[_0x477f78(0x18e)][_0x477f78(0x164)],'services':_0x232110[_0x477f78(0x18e)][_0x477f78(0x16e)](summarizeLoadedManifest),'errors':_0x232110[_0x477f78(0x184)][_0x477f78(0x19a)],'warnings':_0x232110['report']['warnings']},'message':formatValidationFailure(_0x232110[_0x477f78(0x184)])};if(_0x232110['kind']===_0x477f78(0x175)||_0x232110[_0x477f78(0x18e)][_0x477f78(0x164)]!==0x1)return{'ok':!![],'data':{'file':_0x232110[_0x477f78(0x188)],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110['kind'],'serviceCount':_0x232110[_0x477f78(0x18e)]['length'],'commandCount':_0x232110['manifests']['reduce']((_0x3b22f9,_0x2baff2)=>_0x3b22f9+(_0x2baff2[_0x477f78(0x195)]?.['commands'][_0x477f78(0x164)]??0x0),0x0),'services':_0x232110[_0x477f78(0x18e)][_0x477f78(0x16e)](summarizeLoadedManifest),'warnings':_0x232110['report']['warnings']},'message':_0x477f78(0x189)};return{'ok':!![],'data':{'file':_0x232110[_0x477f78(0x188)],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110[_0x477f78(0x18b)],'service':_0x232110['normalizedManifest']?.[_0x477f78(0x178)],'version':_0x232110[_0x477f78(0x195)]?.[_0x477f78(0x173)],'commandCount':_0x232110[_0x477f78(0x195)]?.[_0x477f78(0x180)][_0x477f78(0x164)]??0x0,'commands':_0x232110['normalizedManifest']?.[_0x477f78(0x180)][_0x477f78(0x16e)](_0x5e5961=>({'path':_0x5e5961[_0x477f78(0x199)],'risk':_0x5e5961[_0x477f78(0x197)],'target':_0x5e5961['target']})),'warnings':_0x232110[_0x477f78(0x184)][_0x477f78(0x157)]},'message':_0x477f78(0x17e)};}},{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x198),'description':a39_0x14c7ef(0x194),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x36abdc){const _0x535b74=a39_0x14c7ef,_0x3c0eee=loadServiceManifestFromFile(_0x36abdc[_0x535b74(0x17f)]('file'));return{'method':_0x535b74(0x162),'url':getServiceRegistryPath(),'body':{'file':_0x3c0eee[_0x535b74(0x188)],'hash':_0x3c0eee[_0x535b74(0x183)],'kind':_0x3c0eee[_0x535b74(0x18b)],'ok':_0x3c0eee['report']['ok'],'service':_0x3c0eee['normalizedManifest']?.[_0x535b74(0x178)],'version':_0x3c0eee['normalizedManifest']?.[_0x535b74(0x173)],'serviceCount':_0x3c0eee[_0x535b74(0x18e)][_0x535b74(0x164)],'services':_0x3c0eee[_0x535b74(0x18e)][_0x535b74(0x16e)](_0x5dc0f7=>({'service':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x178)],'version':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x173)],'commandCount':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x180)][_0x535b74(0x164)]??0x0,'errors':_0x5dc0f7[_0x535b74(0x184)][_0x535b74(0x19a)]})),'errors':_0x3c0eee['report']['errors'],'commandCount':_0x3c0eee[_0x535b74(0x195)]?.['commands'][_0x535b74(0x164)]??0x0},'description':_0x535b74(0x15e)};},async 'execute'(_0x38cb09){const _0x3918da=a39_0x14c7ef,_0x39c9d4=importServiceManifest(_0x38cb09['str'](_0x3918da(0x193)));if(_0x39c9d4[_0x3918da(0x165)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x39c9d4[_0x3918da(0x15b)],'imported':_0x39c9d4[_0x3918da(0x17c)],'updated':_0x39c9d4[_0x3918da(0x167)],'serviceCount':_0x39c9d4[_0x3918da(0x18a)],'services':_0x39c9d4[_0x3918da(0x165)]['map'](summarizeService)},'message':'Imported\x20'+_0x39c9d4[_0x3918da(0x17c)]+_0x3918da(0x192)+_0x39c9d4[_0x3918da(0x167)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x39c9d4[_0x3918da(0x15b)],'replaced':_0x39c9d4[_0x3918da(0x16d)],'imported':_0x39c9d4[_0x3918da(0x17c)],'updated':_0x39c9d4[_0x3918da(0x167)],'serviceCount':_0x39c9d4[_0x3918da(0x18a)],'service':summarizeService(_0x39c9d4['entry'])},'message':(_0x39c9d4[_0x3918da(0x16d)]?_0x3918da(0x161):_0x3918da(0x176))+_0x3918da(0x17b)+_0x39c9d4[_0x3918da(0x186)][_0x3918da(0x15f)]+'.'};}},{'service':'service','command':a39_0x14c7ef(0x19d),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x14c7ef(0x16a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x55b2bd){const _0x13cf55=a39_0x14c7ef,_0x5acbd5=getLocalServiceEntry(_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x178)));return{'method':'WRITE','url':_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x193)),'body':{'service':_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x178)),'found':Boolean(_0x5acbd5),'version':_0x5acbd5?.[_0x13cf55(0x173)],'source':_0x5acbd5?.[_0x13cf55(0x181)]},'description':_0x13cf55(0x19c)};},async 'execute'(_0x582b65){const _0x4c6c0e=a39_0x14c7ef,_0x2e7555=exportServiceManifest(_0x582b65[_0x4c6c0e(0x17f)](_0x4c6c0e(0x178)),_0x582b65[_0x4c6c0e(0x17f)](_0x4c6c0e(0x193)));return{'ok':!![],'data':{'registryPath':_0x2e7555['registryPath'],'file':_0x2e7555[_0x4c6c0e(0x188)],'service':summarizeService(_0x2e7555[_0x4c6c0e(0x186)])},'message':_0x4c6c0e(0x16f)+_0x2e7555['entry'][_0x4c6c0e(0x15f)]+'.'};}},{'service':a39_0x14c7ef(0x178),'command':'list','description':a39_0x14c7ef(0x158),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5a721f=a39_0x14c7ef,_0x90a193=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x90a193[_0x5a721f(0x164)],'services':_0x90a193[_0x5a721f(0x16e)](summarizeService)}};}},{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x172),'description':a39_0x14c7ef(0x19b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x77d550){const _0x1d83bc=a39_0x14c7ef,_0x48d8f7=getLocalServiceEntry(_0x77d550[_0x1d83bc(0x17f)](_0x1d83bc(0x178)));return{'method':_0x1d83bc(0x162),'url':getServiceRegistryPath(),'body':{'service':_0x77d550[_0x1d83bc(0x17f)](_0x1d83bc(0x178)),'found':Boolean(_0x48d8f7),'version':_0x48d8f7?.[_0x1d83bc(0x173)],'source':_0x48d8f7?.[_0x1d83bc(0x181)]},'description':_0x1d83bc(0x16b)};},async 'execute'(_0x463c59){const _0x4258fe=a39_0x14c7ef,_0x48fb94=removeServiceManifest(_0x463c59['str'](_0x4258fe(0x178)));return{'ok':!![],'data':{'registryPath':_0x48fb94[_0x4258fe(0x15b)],'serviceCount':_0x48fb94[_0x4258fe(0x18a)],'service':summarizeService(_0x48fb94[_0x4258fe(0x186)])},'message':_0x4258fe(0x190)+_0x48fb94[_0x4258fe(0x186)][_0x4258fe(0x15f)]+'.'};}},{'service':'service','command':'detail','description':a39_0x14c7ef(0x17d),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1136ea){const _0x3af788=a39_0x14c7ef,_0x36f21e=getLocalServiceEntry(_0x1136ea[_0x3af788(0x17f)]('service'));if(!_0x36f21e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1136ea[_0x3af788(0x17f)](_0x3af788(0x178))},'message':_0x3af788(0x191)+_0x1136ea[_0x3af788(0x17f)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x36f21e),'manifest':_0x36f21e[_0x3af788(0x15a)],'normalizedManifest':_0x36f21e['normalizedManifest']}};}}];