@lovrabet/lovrabet-cli 2.1.9 → 2.1.11-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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_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
+ function a30_0x17bb(_0x41669e,_0x417ab2){_0x41669e=_0x41669e-0xc2;const _0x25d803=a30_0x25d8();let _0x17bba3=_0x25d803[_0x41669e];return _0x17bba3;}const a30_0x29c4f8=a30_0x17bb;(function(_0x27357e,_0x2ed1a5){const _0x1469fc=a30_0x17bb,_0x70608e=_0x27357e();while(!![]){try{const _0x449fcd=-parseInt(_0x1469fc(0xe5))/0x1+-parseInt(_0x1469fc(0xd9))/0x2+-parseInt(_0x1469fc(0xdb))/0x3*(parseInt(_0x1469fc(0xd3))/0x4)+-parseInt(_0x1469fc(0xe6))/0x5*(-parseInt(_0x1469fc(0xc4))/0x6)+-parseInt(_0x1469fc(0xda))/0x7*(-parseInt(_0x1469fc(0xc8))/0x8)+-parseInt(_0x1469fc(0xc3))/0x9*(-parseInt(_0x1469fc(0xdd))/0xa)+parseInt(_0x1469fc(0xe4))/0xb;if(_0x449fcd===_0x2ed1a5)break;else _0x70608e['push'](_0x70608e['shift']());}catch(_0x4f3ceb){_0x70608e['push'](_0x70608e['shift']());}}}(a30_0x25d8,0xd587a));function a30_0x25d8(){const _0x530105=['build','1810tkmajG','description','validation','string','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','str','filePath\x20is\x20required.','8412074zwOhSi','341169HEhKRN','4767405lvizST','appCode','write','51201YeMdcO','6xXScTw','Uploaded\x20file.','File','upload','4333768CKeYbn','Preview:\x20upload\x20','query-url','Path\x20to\x20the\x20local\x20file\x20to\x20upload','body','download','/client/uploadFile','filePath','Uploaded\x20file:\x20','POST','filepath','3024312zqbgal','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','trim','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','file','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','2635560MiKxyp','7lKWjyG','3ZKbbrg'];a30_0x25d8=function(){return _0x530105;};return a30_0x25d8();}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_0x29c4f8(0xd7),'type':a30_0x29c4f8(0xe0),'required':!![],'description':a30_0x29c4f8(0xcb)},FILEPATH_FLAG={'name':a30_0x29c4f8(0xd2),'type':a30_0x29c4f8(0xe0),'required':!![],'description':a30_0x29c4f8(0xd6)},DOWNLOAD_FLAG={'name':a30_0x29c4f8(0xcd),'type':'boolean','description':a30_0x29c4f8(0xe1)};function requireFilePath(_0x23fdd9){const _0x19fd95=a30_0x29c4f8,_0x1f2a63=_0x23fdd9[_0x19fd95(0xd5)]();if(!_0x1f2a63)throw CliErrors[_0x19fd95(0xdf)](_0x19fd95(0xe3));return _0x1f2a63;}const fileUpload={'service':'file','command':a30_0x29c4f8(0xc7),'description':a30_0x29c4f8(0xd4),'risk':a30_0x29c4f8(0xc2),'flags':[FILE_FLAG],async 'dryRun'(_0x3c3c03){const _0x59c7b9=a30_0x29c4f8,_0x342154=requireRuntimeUploadFile(_0x3c3c03['str'](_0x59c7b9(0xd7)),'File');return dryRun(_0x59c7b9(0xd1),_0x59c7b9(0xce))[_0x59c7b9(0xcc)]({'appCode':_0x3c3c03[_0x59c7b9(0xe7)],'multipart':{'file':_0x342154}})[_0x59c7b9(0xde)](_0x59c7b9(0xc9)+_0x342154['path']+'\x20to\x20runtime\x20app\x20'+_0x3c3c03[_0x59c7b9(0xe7)])[_0x59c7b9(0xdc)]();},async 'execute'(_0x28a960){const _0x120f04=a30_0x29c4f8,_0x1f3a6e=requireRuntimeUploadFile(_0x28a960[_0x120f04(0xe2)](_0x120f04(0xd7)),_0x120f04(0xc6)),_0x121845=await uploadRuntimeFile(_0x28a960[_0x120f04(0xe7)],_0x1f3a6e['path']);return{'ok':!![],'data':_0x121845,'message':_0x121845[_0x120f04(0xcf)]?_0x120f04(0xd0)+_0x121845[_0x120f04(0xcf)]:_0x120f04(0xc5)};}},fileQueryUrl={'service':a30_0x29c4f8(0xd7),'command':a30_0x29c4f8(0xca),'description':a30_0x29c4f8(0xd8),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x28cb98){const _0x398b85=a30_0x29c4f8,_0x42e95f=requireFilePath(_0x28cb98['str'](_0x398b85(0xd2))),_0xa70882=await queryRuntimeFileUrl(_0x42e95f,{'download':_0x28cb98['bool'](_0x398b85(0xcd))});return{'ok':!![],'data':_0xa70882};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
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
+ const a31_0x2349c7=a31_0x1007;(function(_0x39f54a,_0x394777){const _0x27d3a7=a31_0x1007,_0x53c40a=_0x39f54a();while(!![]){try{const _0x445af9=-parseInt(_0x27d3a7(0x1fe))/0x1*(-parseInt(_0x27d3a7(0x1f6))/0x2)+-parseInt(_0x27d3a7(0x1c6))/0x3*(parseInt(_0x27d3a7(0x202))/0x4)+parseInt(_0x27d3a7(0x1d9))/0x5+parseInt(_0x27d3a7(0x1e6))/0x6+parseInt(_0x27d3a7(0x208))/0x7+parseInt(_0x27d3a7(0x1ec))/0x8*(-parseInt(_0x27d3a7(0x1f7))/0x9)+parseInt(_0x27d3a7(0x1ff))/0xa*(-parseInt(_0x27d3a7(0x1d4))/0xb);if(_0x445af9===_0x394777)break;else _0x53c40a['push'](_0x53c40a['shift']());}catch(_0xcc941a){_0x53c40a['push'](_0x53c40a['shift']());}}}(a31_0x60f7,0xaf6b7));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_0x2349c7(0x1e4),'type':'string','description':a31_0x2349c7(0x201)},{'name':'env','type':'string','description':a31_0x2349c7(0x1e2)+DEFAULT_CONFIG_VALUES[a31_0x2349c7(0x1dd)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e9)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e8),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x2349c7(0x200),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x2349c7(0x1e4),'type':a31_0x2349c7(0x1da),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x2349c7(0x1dd),'type':'string','description':a31_0x2349c7(0x207),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2349c7(0x1f1),'type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e9)+PRODUCT_CONFIG[a31_0x2349c7(0x1c7)]+a31_0x2349c7(0x1fb),'default':![]},{'name':'yes','type':'boolean','description':a31_0x2349c7(0x1e8),'default':![]}];function a31_0x1007(_0x1c0c4e,_0x55fa9f){_0x1c0c4e=_0x1c0c4e-0x1c4;const _0x60f745=a31_0x60f7();let _0x10077c=_0x60f745[_0x1c0c4e];return _0x10077c;}export async function runInit(_0x280e29){const _0x3a0266=a31_0x2349c7,_0x1be77f=isNonInteractiveMode(_0x280e29),_0x122eab=_0x280e29[_0x3a0266(0x1f1)]?_0x3a0266(0x1f1):'project',_0x2543a1=resolveWriteConfigPath(_0x122eab);try{_0x1be77f?await runNonInteractive(_0x280e29,_0x2543a1):await runInteractive(_0x280e29,_0x2543a1);}catch(_0xf832ff){if(_0xf832ff instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0xf832ff;}}export async function runInitImport(_0x4b8b3d){const _0x1ec00c=a31_0x2349c7,_0x599982=_0x4b8b3d[_0x1ec00c(0x1f1)]?'global':_0x1ec00c(0x1d6),_0x30aad0=resolveWriteConfigPath(_0x599982);await runFromImport(_0x4b8b3d,_0x30aad0);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2349c7(0x1c9)]);async function runFromImport(_0x62736c,_0x4ce295){const _0x2ea1fb=a31_0x2349c7,_0x369c7a=resolveFilePath(_0x62736c['file']);if(!existsSync(_0x369c7a))throw CliErrors[_0x2ea1fb(0x1d7)](_0x2ea1fb(0x1fa)+_0x369c7a);const _0x174c1d=readSourceFile(_0x369c7a),_0x21373d=convertToRuntimeConfig(_0x174c1d);_0x62736c[_0x2ea1fb(0x1e4)]&&(_0x21373d[_0x2ea1fb(0x1e4)]=String(_0x62736c[_0x2ea1fb(0x1e4)]));_0x62736c[_0x2ea1fb(0x1dd)]&&(_0x21373d['env']=resolveInitEnv(_0x62736c));if(!_0x21373d[_0x2ea1fb(0x1e4)])throw CliErrors[_0x2ea1fb(0x1d7)](_0x2ea1fb(0x1c8),'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(_0x4ce295,_0x21373d,_0x62736c),console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1df)+_0x369c7a),console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1de)+_0x4ce295),console[_0x2ea1fb(0x1f4)]('\x20\x20appcode:\x20'+_0x21373d[_0x2ea1fb(0x1e4)]);if(_0x21373d[_0x2ea1fb(0x1f3)])console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1d8)+_0x21373d[_0x2ea1fb(0x1f3)]);}function a31_0x60f7(){const _0x59ce33=['File\x20','Invalid\x20env\x20\x22','349050jaSIek','newConfigFileName','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','apiDir','\x20init\x20—\x20Create\x20','object','removeListener','app','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','yes','trim','utf8','stdin','523314bogjNc','message','project','validation','\x20\x20default:\x20','4482555XfItSA','string','race','\x20\x20env:\x20\x20\x20\x20\x20','env','\x20\x20config:\x20\x20','Imported\x20from\x20','SIGINT','name','Target\x20environment\x20(default\x20','Failed\x20to\x20parse\x20source\x20file:\x20','appcode','once','3445212txHhyN','boolean','Skip\x20confirmation\x20when\x20overwriting','Write\x20to\x20global\x20(~/','\x20already\x20exists.\x20Overwrite?','toLowerCase','103776RnwBMZ','entries','AbortPrompt','includes','\x22.\x20Allowed:\x20','global','question','defaultApp','log','App\x20code\x20cannot\x20be\x20empty.','606836absKjq','288mSDNDu','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','riskLevel','Source\x20file\x20not\x20found:\x20',')\x20instead\x20of\x20project','\x20\x20appcode:\x20','stdout','3xDETCc','390VKbFSx','file','App\x20code\x20for\x20the\x20project','20fjDrss','flagMissing','Aborted.','apps','parse','Override\x20imported\x20default\x20env','8328544yiOETw'];a31_0x60f7=function(){return _0x59ce33;};return a31_0x60f7();}function convertToRuntimeConfig(_0x5b7183){const _0x431b0f=a31_0x2349c7;if(_0x5b7183[_0x431b0f(0x205)]&&typeof _0x5b7183[_0x431b0f(0x205)]===_0x431b0f(0x1cb))throw CliErrors[_0x431b0f(0x1d7)](_0x431b0f(0x1ce),_0x431b0f(0x1f8));const _0x27da7d={};for(const _0xa752f1 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5b7183[_0xa752f1]!==undefined&&(_0x27da7d[_0xa752f1]=_0x5b7183[_0xa752f1]);}return!_0x27da7d[_0x431b0f(0x1f9)]&&(_0x27da7d['riskLevel']=DEFAULT_CONFIG_VALUES[_0x431b0f(0x1f9)]),_0x27da7d;}async function runNonInteractive(_0x2f4e4d,_0x38f9be){const _0x20a844=a31_0x2349c7,_0x314a57=_0x2f4e4d[_0x20a844(0x1e4)];if(!_0x314a57)throw CliErrors[_0x20a844(0x203)]('appcode',_0x20a844(0x1cf)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x4b439a=resolveInitEnv(_0x2f4e4d);await writeInitConfig(_0x38f9be,{'appcode':_0x314a57,'env':_0x4b439a},_0x2f4e4d),console['log']('Initialized\x20'+_0x38f9be),console[_0x20a844(0x1f4)](_0x20a844(0x1fc)+_0x314a57),console['log'](_0x20a844(0x1dc)+_0x4b439a);}async function runInteractive(_0x570a90,_0x567a57){const _0x3d9268=a31_0x2349c7,_0x19c77a=loadExisting(_0x567a57),_0x338704=typeof _0x19c77a?.[_0x3d9268(0x1e4)]===_0x3d9268(0x1da)?_0x19c77a['appcode']:'',_0x534147=resolveInitEnv(_0x570a90);console[_0x3d9268(0x1f4)](CLI_BIN_NAME+_0x3d9268(0x1ca)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x567a57)&&!_0x570a90['yes']){const _0x2b08d1=await promptYesNo(_0x3d9268(0x1c4)+_0x567a57+_0x3d9268(0x1ea),![]);if(!_0x2b08d1){console[_0x3d9268(0x1f4)](_0x3d9268(0x204));return;}}const _0x5d1e95=typeof _0x570a90[_0x3d9268(0x1e4)]===_0x3d9268(0x1da)?_0x570a90['appcode'][_0x3d9268(0x1d1)]():'';let _0x40850b=_0x5d1e95;!_0x40850b&&(_0x40850b=await promptInput('App\x20code',_0x338704));if(!_0x40850b['trim']())throw CliErrors[_0x3d9268(0x1d7)](_0x3d9268(0x1f5));await writeInitConfig(_0x567a57,{'appcode':_0x40850b[_0x3d9268(0x1d1)](),'env':_0x534147},_0x570a90),console[_0x3d9268(0x1f4)]('\x0aInitialized\x20'+_0x567a57),console[_0x3d9268(0x1f4)](_0x3d9268(0x1fc)+_0x40850b[_0x3d9268(0x1d1)]()),console[_0x3d9268(0x1f4)](_0x3d9268(0x1dc)+_0x534147);}async function writeInitConfig(_0x2d61cf,_0x3fbe55,_0x2601cc){const _0x44448d=a31_0x2349c7;let _0x4311bb={};existsSync(_0x2d61cf)&&!_0x2601cc['yes']&&(_0x4311bb=readConfigFile(_0x2d61cf));for(const [_0x5bd244,_0x4db7f1]of Object[_0x44448d(0x1ed)](_0x3fbe55)){_0x4db7f1!==undefined&&(_0x4311bb[_0x5bd244]=_0x4db7f1);}if(_0x4311bb[_0x44448d(0x1cd)])delete _0x4311bb['app'];writeConfigFile(_0x2d61cf,_0x4311bb);}class AbortPrompt extends Error{constructor(){const _0x322e3a=a31_0x2349c7;super('User\x20aborted\x20prompt'),this[_0x322e3a(0x1e1)]=_0x322e3a(0x1ee);}}function createSafeRl(){const _0x225ffa=a31_0x2349c7,_0x22e92a=createInterface({'input':process[_0x225ffa(0x1d3)],'output':process[_0x225ffa(0x1fd)]});let _0x20f41f;const _0x5062a1=new Promise((_0x192728,_0x31bf13)=>{const _0x5e4477=_0x225ffa;_0x20f41f=()=>{const _0x10736f=a31_0x1007;_0x20f41f&&(_0x22e92a[_0x10736f(0x1cc)]('SIGINT',_0x20f41f),_0x20f41f=undefined);try{_0x22e92a['close']();}catch{}_0x31bf13(new AbortPrompt());},_0x22e92a[_0x5e4477(0x1e5)](_0x5e4477(0x1e0),_0x20f41f);}),_0x20494f=()=>{const _0x30c2b2=_0x225ffa;_0x20f41f&&(_0x22e92a[_0x30c2b2(0x1cc)](_0x30c2b2(0x1e0),_0x20f41f),_0x20f41f=undefined);try{_0x22e92a['close']();}catch{}};return{'rl':_0x22e92a,'abortPromise':_0x5062a1,'disposeSuccess':_0x20494f};}async function promptInput(_0x4bb83b,_0x85e78f){const {rl:_0xc492be,abortPromise:_0x1074c9,disposeSuccess:_0x3d1d38}=createSafeRl(),_0x118b89=new Promise(_0x22eaae=>{const _0x4c9bd7=a31_0x1007,_0x5df890=_0x85e78f?'\x20\x20'+_0x4bb83b+'\x20('+_0x85e78f+'):\x20':'\x20\x20'+_0x4bb83b+':\x20';_0xc492be[_0x4c9bd7(0x1f2)](_0x5df890,_0x450d30=>{const _0x228524=_0x4c9bd7;_0x3d1d38(),_0x22eaae(_0x450d30[_0x228524(0x1d1)]()||_0x85e78f);});});return Promise['race']([_0x118b89,_0x1074c9]);}async function promptYesNo(_0x2b2a60,_0x300326){const _0x112300=a31_0x2349c7,{rl:_0x185bbb,abortPromise:_0x5c49cc,disposeSuccess:_0x173d57}=createSafeRl(),_0x1a78d7=new Promise(_0x1bf6c3=>{const _0x2c8cf5=_0x300326?'[Y/n]':'[y/N]';_0x185bbb['question']('\x20\x20'+_0x2b2a60+'\x20'+_0x2c8cf5+':\x20',_0x4bfab6=>{const _0x16df6d=a31_0x1007;_0x173d57();const _0x87ac68=_0x4bfab6[_0x16df6d(0x1d1)]()[_0x16df6d(0x1eb)]();if(_0x87ac68==='y'||_0x87ac68===_0x16df6d(0x1d0))_0x1bf6c3(!![]);else{if(_0x87ac68==='n'||_0x87ac68==='no')_0x1bf6c3(![]);else _0x1bf6c3(_0x300326);}});});return Promise[_0x112300(0x1db)]([_0x1a78d7,_0x5c49cc]);}function loadExisting(_0x4edf96){if(!existsSync(_0x4edf96))return null;return readConfigFile(_0x4edf96);}function resolveFilePath(_0x340f20){return isAbsolute(_0x340f20)?_0x340f20:resolve(process['cwd'](),_0x340f20);}function readSourceFile(_0x2232af){const _0x515510=a31_0x2349c7;try{const _0x5a8ceb=readFileSync(_0x2232af,{'encoding':_0x515510(0x1d2)});return JSON[_0x515510(0x206)](_0x5a8ceb);}catch(_0x26c42c){throw CliErrors[_0x515510(0x1d7)](_0x515510(0x1e3)+_0x26c42c[_0x515510(0x1d5)]);}}function resolveInitEnv(_0x50306f){const _0x126fb6=a31_0x2349c7,_0x5bb819=_0x50306f[_0x126fb6(0x1dd)];if(_0x5bb819===undefined||_0x5bb819==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x126fb6(0x1ef)](_0x5bb819))throw CliErrors[_0x126fb6(0x1d7)](_0x126fb6(0x1c5)+_0x5bb819+_0x126fb6(0x1f0)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x5bb819;}
@@ -1 +1 @@
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
+ const a32_0x1ad86f=a32_0xf906;(function(_0x432c87,_0x19abd6){const _0x383e5a=a32_0xf906,_0x284d71=_0x432c87();while(!![]){try{const _0x359982=-parseInt(_0x383e5a(0x1fe))/0x1*(-parseInt(_0x383e5a(0x21a))/0x2)+parseInt(_0x383e5a(0x207))/0x3+-parseInt(_0x383e5a(0x201))/0x4+-parseInt(_0x383e5a(0x1ed))/0x5*(parseInt(_0x383e5a(0x216))/0x6)+parseInt(_0x383e5a(0x218))/0x7+parseInt(_0x383e5a(0x1f9))/0x8+-parseInt(_0x383e5a(0x1f0))/0x9;if(_0x359982===_0x19abd6)break;else _0x284d71['push'](_0x284d71['shift']());}catch(_0x346bf4){_0x284d71['push'](_0x284d71['shift']());}}}(a32_0x3434,0x50904));function a32_0xf906(_0x1bef60,_0x1714c4){_0x1bef60=_0x1bef60-0x1df;const _0x343454=a32_0x3434();let _0xf906e7=_0x343454[_0x1bef60];return _0xf906e7;}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';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x1ad86f(0x1f6),'type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x20e)},FILE_FLAG={'name':'file','type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x20f)},QUERY_FLAG={'name':a32_0x1ad86f(0x217),'type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x213)},TOPK_FLAG={'name':a32_0x1ad86f(0x215),'type':a32_0x1ad86f(0x200),'description':a32_0x1ad86f(0x1ee)};function readKnowledgeFile(_0x1a3597){const _0x132126=a32_0x1ad86f;if(!_0x1a3597)throw CliErrors[_0x132126(0x209)]('File\x20path\x20is\x20required.');if(!existsSync(_0x1a3597))throw CliErrors[_0x132126(0x209)](_0x132126(0x1e8)+_0x1a3597);if(!statSync(_0x1a3597)[_0x132126(0x1e9)]())throw CliErrors['validation'](_0x132126(0x205)+_0x1a3597);return readFileSync(_0x1a3597,_0x132126(0x1f8));}function summarizePersonalItem(_0x5b03aa){const _0x32e3d8=a32_0x1ad86f;return{'id':_0x5b03aa['id'],'title':_0x5b03aa[_0x32e3d8(0x1f6)],'version':_0x5b03aa['version'],'ragStatus':_0x5b03aa[_0x32e3d8(0x1e0)],'ragErrorMessage':_0x5b03aa[_0x32e3d8(0x210)],'updateTime':_0x5b03aa[_0x32e3d8(0x1e4)]};}function a32_0x3434(){const _0x2a6910=['map','userId','9375evembf','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','score','7554825EOyhDl','/client/knowledge-base/personal/','length','createTime','file','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','string','utf8','3858992EQcXpl','read','trim','str','Personal\x20knowledge-base\x20entry\x20ID','17VGETwI','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','number','284772sVATQH','/client/knowledge-base/personal/create','scope','Updated\x20KB\x20entry\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','weightedScore','1375527OXkjKW','version','validation','appCode','POST','Override\x20the\x20existing\x20entry\x20title','detail','Personal\x20knowledge-base\x20entry\x20title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','ragErrorMessage','build','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Created\x20KB\x20entry\x20','topk','1362aADDPc','query','2385061okBMWw','list','45250DtEieT','body','write','ragStatus','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','description','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','updateTime','/update','verbose','num','File\x20not\x20found:\x20','isFile','isFinite'];a32_0x3434=function(){return _0x2a6910;};return a32_0x3434();}function detailPersonalItem(_0x20b69c){const _0x2b1406=a32_0x1ad86f;return{'id':_0x20b69c['id'],'appCode':_0x20b69c[_0x2b1406(0x20a)],'scope':_0x20b69c['scope'],'userId':_0x20b69c[_0x2b1406(0x1ec)],'title':_0x20b69c[_0x2b1406(0x1f6)],'content':_0x20b69c['content']??'','version':_0x20b69c[_0x2b1406(0x208)],'ragStatus':_0x20b69c[_0x2b1406(0x1e0)],'ragErrorMessage':_0x20b69c[_0x2b1406(0x210)],'createTime':_0x20b69c[_0x2b1406(0x1f3)],'updateTime':_0x20b69c['updateTime']};}function summarizeSearchHit(_0x104423){const _0x4b528e=a32_0x1ad86f;return{'scope':_0x104423[_0x4b528e(0x203)],'docId':_0x104423['docId'],'score':_0x104423[_0x4b528e(0x1ef)],'weightedScore':_0x104423[_0x4b528e(0x206)],'content':_0x104423['content'],'metadata':_0x104423['metadata']};}function readTopK(_0x4e5a3d){const _0x2ef794=a32_0x1ad86f,_0xa0410c=_0x4e5a3d['flag'](_0x2ef794(0x215));if(_0xa0410c===undefined||_0xa0410c===null||_0xa0410c==='')return undefined;const _0x2b7a0a=_0x4e5a3d[_0x2ef794(0x1e7)](_0x2ef794(0x215));if(!Number[_0x2ef794(0x1ea)](_0x2b7a0a)||_0x2b7a0a<0x1)throw CliErrors['validation']('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x2b7a0a;}const kbList={'service':'kb','command':a32_0x1ad86f(0x219),'description':a32_0x1ad86f(0x212),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x260035){const _0x59ab41=a32_0x1ad86f,_0x1a85b4=await listPersonalKnowledgeBaseItems(_0x260035['appCode']);if(_0x260035['bool'](_0x59ab41(0x1e6)))return{'ok':!![],'data':{'total':_0x1a85b4[_0x59ab41(0x1f2)],'items':_0x1a85b4}};return{'ok':!![],'data':{'total':_0x1a85b4[_0x59ab41(0x1f2)],'items':_0x1a85b4['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x1ad86f(0x20d),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a32_0x1ad86f(0x1fd)}],async 'execute'(_0x2daad3){const _0x1ce68b=a32_0x1ad86f,_0x3febe1=await getPersonalKnowledgeBaseItem(_0x2daad3['num']('id'),_0x2daad3[_0x1ce68b(0x20a)]);return{'ok':!![],'data':detailPersonalItem(_0x3febe1)};}},kbCreate={'service':'kb','command':'create','description':a32_0x1ad86f(0x1f5),'risk':a32_0x1ad86f(0x1df),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x22486d){const _0xb68362=a32_0x1ad86f,_0x1414ae=_0x22486d[_0xb68362(0x1fc)](_0xb68362(0x1f6)),_0x5adadd=readKnowledgeFile(_0x22486d[_0xb68362(0x1fc)](_0xb68362(0x1f4))),_0x2b0b51=await createPersonalKnowledgeBaseItem(_0x22486d[_0xb68362(0x20a)],{'title':_0x1414ae,'content':_0x5adadd});return{'ok':!![],'data':summarizePersonalItem(_0x2b0b51),'message':_0xb68362(0x214)+_0x2b0b51['id']+'\x20('+_0x2b0b51[_0xb68362(0x1f6)]+')'};},async 'dryRun'(_0x4cf30b){const _0x2b5501=a32_0x1ad86f,_0x3c65d3=_0x4cf30b[_0x2b5501(0x1fc)](_0x2b5501(0x1f6)),_0x286617=readKnowledgeFile(_0x4cf30b['str'](_0x2b5501(0x1f4)));return dryRun(_0x2b5501(0x20b),_0x2b5501(0x202))[_0x2b5501(0x21b)]({'appCode':_0x4cf30b[_0x2b5501(0x20a)],'title':_0x3c65d3,'content':_0x286617})[_0x2b5501(0x1e2)](_0x2b5501(0x1e3)+_0x3c65d3+'\x22')[_0x2b5501(0x211)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x1ad86f(0x1ff),'risk':a32_0x1ad86f(0x1df),'flags':[{...ID_FLAG,'description':a32_0x1ad86f(0x1fd)},{...TITLE_FLAG,'required':![],'description':a32_0x1ad86f(0x20c)},FILE_FLAG],async 'execute'(_0x20781b){const _0x323223=a32_0x1ad86f,_0xa0a63d=_0x20781b[_0x323223(0x1e7)]('id'),_0x94c9e3=readKnowledgeFile(_0x20781b['str'](_0x323223(0x1f4))),_0x14037a=_0x20781b[_0x323223(0x1fc)](_0x323223(0x1f6))||(await getPersonalKnowledgeBaseItem(_0xa0a63d,_0x20781b['appCode']))[_0x323223(0x1f6)],_0x2104fb=await updatePersonalKnowledgeBaseItem(_0xa0a63d,_0x20781b['appCode'],{'title':_0x14037a,'content':_0x94c9e3});return{'ok':!![],'data':summarizePersonalItem(_0x2104fb),'message':_0x323223(0x204)+_0x2104fb['id']+'\x20('+_0x2104fb[_0x323223(0x1f6)]+')'};},async 'dryRun'(_0x22db69){const _0xc7dba8=a32_0x1ad86f,_0x13e18f=_0x22db69[_0xc7dba8(0x1e7)]('id'),_0x38d811=readKnowledgeFile(_0x22db69[_0xc7dba8(0x1fc)]('file')),_0x4c808e=_0x22db69[_0xc7dba8(0x1fc)](_0xc7dba8(0x1f6))||(await getPersonalKnowledgeBaseItem(_0x13e18f,_0x22db69[_0xc7dba8(0x20a)]))[_0xc7dba8(0x1f6)];return dryRun(_0xc7dba8(0x20b),_0xc7dba8(0x1f1)+_0x13e18f+_0xc7dba8(0x1e5))[_0xc7dba8(0x21b)]({'appCode':_0x22db69['appCode'],'title':_0x4c808e,'content':_0x38d811})[_0xc7dba8(0x1e2)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x13e18f)[_0xc7dba8(0x211)]();}},kbSearch={'service':'kb','command':'search','description':a32_0x1ad86f(0x1e1),'risk':a32_0x1ad86f(0x1fa),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x28a352){const _0x3b4bcc=a32_0x1ad86f;if(!_0x28a352[_0x3b4bcc(0x1fc)](_0x3b4bcc(0x217))[_0x3b4bcc(0x1fb)]())throw CliErrors[_0x3b4bcc(0x209)]('Search\x20query\x20is\x20required.');readTopK(_0x28a352);},async 'execute'(_0x6381ab){const _0x55c90a=a32_0x1ad86f,_0x335b2e=_0x6381ab[_0x55c90a(0x1fc)](_0x55c90a(0x217))['trim'](),_0x51bcd2=readTopK(_0x6381ab),_0xfa5c4d=await searchKnowledgeBase(_0x6381ab[_0x55c90a(0x20a)],{'query':_0x335b2e,'topK':_0x51bcd2});return{'ok':!![],'data':{'total':_0xfa5c4d[_0x55c90a(0x1f2)],'hits':_0xfa5c4d[_0x55c90a(0x1eb)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
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
+ function a33_0x5a85(){const _0x631c42=['warn','clear','\x20logs:\x0a','*\x20No\x20logs\x20found','logs','log','timestamp','\x20\x20\x20Time:\x20','details','duration','command','16bOOize','6016090QPqDzG','write','2489988dRunPk','1165746LbhjkW','10016712WKvkEL','View\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','2325uMDsas','stringify','5823405SQnKWn','545184tyseQc','read','1450umZpVg','readLogs','error','length','keys','*\x20Logs\x20cleared','Clear\x20command\x20history\x20logs','level'];a33_0x5a85=function(){return _0x631c42;};return a33_0x5a85();}const a33_0x375462=a33_0x3829;(function(_0x12f322,_0xf6d21d){const _0x5a9db5=a33_0x3829,_0x1f08cd=_0x12f322();while(!![]){try{const _0x2d69dc=parseInt(_0x5a9db5(0x10e))/0x1+-parseInt(_0x5a9db5(0xf7))/0x2*(parseInt(_0x5a9db5(0x112))/0x3)+-parseInt(_0x5a9db5(0x115))/0x4+parseInt(_0x5a9db5(0x10b))/0x5+parseInt(_0x5a9db5(0x10d))/0x6+parseInt(_0x5a9db5(0x114))/0x7+parseInt(_0x5a9db5(0x10a))/0x8*(-parseInt(_0x5a9db5(0x10f))/0x9);if(_0x2d69dc===_0xf6d21d)break;else _0x1f08cd['push'](_0x1f08cd['shift']());}catch(_0x218867){_0x1f08cd['push'](_0x1f08cd['shift']());}}}(a33_0x5a85,0xa8e3a));function a33_0x3829(_0x3b5952,_0x43aa43){_0x3b5952=_0x3b5952-0xf6;const _0x5a859e=a33_0x5a85();let _0x3829d5=_0x5a859e[_0x3b5952];return _0x3829d5;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x25ed43){const _0x205e59=a33_0x3829;if(_0x25ed43[_0x205e59(0xfa)]===0x0){console[_0x205e59(0x104)](_0x205e59(0x102));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x205e59(0x101)),_0x25ed43['forEach']((_0x5893e3,_0x11bdc3)=>{const _0x4beb07=_0x205e59,_0x118d05=new Date(_0x5893e3[_0x4beb07(0x105)])['toLocaleString']('en-US'),_0x1a390b=_0x5893e3[_0x4beb07(0xfe)]==='success'?'√':_0x5893e3[_0x4beb07(0xfe)]===_0x4beb07(0xf9)?'×':_0x5893e3[_0x4beb07(0xfe)]===_0x4beb07(0xff)?'!':'i';console[_0x4beb07(0x104)](_0x11bdc3+0x1+'.\x20'+_0x1a390b+'\x20['+_0x5893e3[_0x4beb07(0x109)]+']\x20'+_0x5893e3['message']),console[_0x4beb07(0x104)](_0x4beb07(0x106)+_0x118d05),_0x5893e3[_0x4beb07(0x108)]&&console[_0x4beb07(0x104)](_0x4beb07(0x111)+_0x5893e3['duration']+'ms'),_0x5893e3['details']&&Object[_0x4beb07(0xfb)](_0x5893e3[_0x4beb07(0x107)])[_0x4beb07(0xfa)]>0x0&&console[_0x4beb07(0x104)]('\x20\x20\x20Details:\x20'+JSON[_0x4beb07(0x113)](_0x5893e3['details'],null,0x2)),console[_0x4beb07(0x104)]('');});}export const logsDefinitions=[{'service':a33_0x375462(0x103),'command':'show','description':a33_0x375462(0x110),'risk':a33_0x375462(0xf6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b9d06){const _0x58275c=a33_0x375462;return printLogs(logger[_0x58275c(0xf8)]()),{'ok':!![]};}},{'service':a33_0x375462(0x103),'command':a33_0x375462(0x100),'description':a33_0x375462(0xfd),'risk':a33_0x375462(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x24c7b2){const _0x3178be=a33_0x375462;return logger['clearLogs'](),console[_0x3178be(0x104)](_0x3178be(0xfc)),{'ok':!![]};}}];
@@ -1 +1 @@
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
+ const a34_0x3b2c37=a34_0x382b;(function(_0x543b1a,_0x496b78){const _0x560a5a=a34_0x382b,_0x207c84=_0x543b1a();while(!![]){try{const _0x4fde49=-parseInt(_0x560a5a(0x115))/0x1+-parseInt(_0x560a5a(0xff))/0x2*(-parseInt(_0x560a5a(0x124))/0x3)+parseInt(_0x560a5a(0x11f))/0x4*(-parseInt(_0x560a5a(0xed))/0x5)+-parseInt(_0x560a5a(0xfb))/0x6+-parseInt(_0x560a5a(0x11c))/0x7+parseInt(_0x560a5a(0x10e))/0x8*(-parseInt(_0x560a5a(0xf8))/0x9)+parseInt(_0x560a5a(0x10d))/0xa;if(_0x4fde49===_0x496b78)break;else _0x207c84['push'](_0x207c84['shift']());}catch(_0x398e9d){_0x207c84['push'](_0x207c84['shift']());}}}(a34_0x307a,0xb9012));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x307a(){const _0x519cd6=['673238FTbDuv','idCard','recognize','invoice','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','fileName','/client/queryFileUrl','5876787iSYVqG','Publicly\x20accessible\x20image\x20or\x20file\x20URL','File\x20URL\x20response\x20missing\x20fileUrl.','452PUQqhA','string','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','appCode','image-file','3261TyBSOr','description','scene','45955cSEvzu','<filePath\x20returned\x20by\x20/client/uploadFile>','imageUrl','idcard','path','\x20OCR','.\x20Supported\x20scenes:\x20','image-url','toLowerCase','form','\x20OCR\x20from\x20URL','3283083jsJfFZ','build','/client/uploadFile','5966262qtOlPb','General','ocr','Invoice','2612wnjgWN','write','/client/ocr','validation','trim','POST','Preview:\x20recognize\x20','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Unsupported\x20OCR\x20scene:\x20','apiError','body','File\x20upload\x20response\x20missing\x20filePath.','imageFile','general','36134690NAMflK','16kzgJDn','IdCard','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','filter','str','filePath','fileUrl'];a34_0x307a=function(){return _0x519cd6;};return a34_0x307a();}import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x3b2c37(0x118),a34_0x3b2c37(0x10c),'form',a34_0x3b2c37(0x116)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3b2c37(0xfe),'general':a34_0x3b2c37(0xfc),'form':'Table','idCard':a34_0x3b2c37(0x10f)},SCENE_FLAG={'name':a34_0x3b2c37(0xec),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x3b2c37(0x123),'type':a34_0x3b2c37(0x120),'description':a34_0x3b2c37(0x106)},IMAGE_URL_FLAG={'name':a34_0x3b2c37(0xf4),'type':a34_0x3b2c37(0x120),'description':a34_0x3b2c37(0x11d)};function normalizeScene(_0x1cf8e8){const _0x192bac=a34_0x3b2c37,_0x45a7fb=_0x1cf8e8['trim']()[_0x192bac(0xf5)]();if(_0x45a7fb===_0x192bac(0xf0))return _0x192bac(0x116);if(_0x45a7fb===_0x192bac(0x118)||_0x45a7fb===_0x192bac(0x10c)||_0x45a7fb===_0x192bac(0xf6))return _0x45a7fb;throw CliErrors[_0x192bac(0x102)](_0x192bac(0x107)+_0x1cf8e8+_0x192bac(0xf3)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x382b(_0x253805,_0x492a74){_0x253805=_0x253805-0xeb;const _0x307a71=a34_0x307a();let _0x382bdc=_0x307a71[_0x253805];return _0x382bdc;}function selectedInputs(_0x40eb70){const _0x7043f=a34_0x3b2c37,_0x26deeb=_0x40eb70[_0x7043f(0x112)]('image-file')[_0x7043f(0x103)](),_0x267a01=_0x40eb70['str'](_0x7043f(0xf4))['trim']();return{'imageFile':_0x26deeb,'imageUrl':_0x267a01,'count':[_0x26deeb,_0x267a01][_0x7043f(0x111)](Boolean)['length']};}function validateInputSelection(_0x353078){const _0x1bb0d2=a34_0x3b2c37,_0x4d29f9=selectedInputs(_0x353078);if(_0x4d29f9['count']!==0x1)throw CliErrors['validation'](_0x1bb0d2(0x119));return _0x4d29f9;}function withScene(_0x5e8d0b,_0x161576,_0x4bbd55){const _0x4e183a=a34_0x3b2c37;return{..._0x5e8d0b,'scene':_0x161576,..._0x4bbd55?{'sourceFile':{'fileName':_0x4bbd55[_0x4e183a(0x11a)],'filePath':_0x4bbd55[_0x4e183a(0x113)]}}:{}};}const ocrRecognize={'service':a34_0x3b2c37(0xfd),'command':a34_0x3b2c37(0x117),'description':a34_0x3b2c37(0x121),'risk':a34_0x3b2c37(0x100),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x569ced){const _0x3dd21e=a34_0x3b2c37,_0x3bdd9c=normalizeScene(_0x569ced[_0x3dd21e(0x112)]('scene')),_0x3cc56c=SCENE_TO_LEGACY_TYPE[_0x3bdd9c],_0x2be46f=validateInputSelection(_0x569ced);if(_0x2be46f[_0x3dd21e(0xef)])return dryRun(_0x3dd21e(0x104),_0x3dd21e(0x101))['body']({'appCode':_0x569ced[_0x3dd21e(0x122)],'url':_0x2be46f[_0x3dd21e(0xef)],'type':_0x3cc56c})[_0x3dd21e(0xeb)](_0x3dd21e(0x105)+_0x3bdd9c+_0x3dd21e(0xf7))[_0x3dd21e(0xf9)]();const _0x19639e=requireRuntimeUploadFile(_0x2be46f[_0x3dd21e(0x10b)],_0x3dd21e(0x123));return dryRun('POST','/client/uploadFile')[_0x3dd21e(0x109)]({'steps':[{'method':'POST','url':_0x3dd21e(0xfa),'body':{'appCode':_0x569ced[_0x3dd21e(0x122)],'multipart':{'file':_0x19639e}}},{'method':_0x3dd21e(0x104),'url':_0x3dd21e(0x11b),'body':{'filePath':_0x3dd21e(0xee),'downloadFlag':![]}},{'method':'POST','url':_0x3dd21e(0x101),'body':{'appCode':_0x569ced[_0x3dd21e(0x122)],'url':_0x3dd21e(0x110),'type':_0x3cc56c}}]})[_0x3dd21e(0xeb)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x3bdd9c+_0x3dd21e(0xf2))['build']();},async 'execute'(_0x440313){const _0x56a47e=a34_0x3b2c37,_0x44099e=normalizeScene(_0x440313['str'](_0x56a47e(0xec))),_0x46fd1f=SCENE_TO_LEGACY_TYPE[_0x44099e],_0x16ebff=validateInputSelection(_0x440313);if(_0x16ebff[_0x56a47e(0xef)]){const _0x208c4a=await recognizeRuntimeOcr(_0x440313['appCode'],{'url':_0x16ebff[_0x56a47e(0xef)],'type':_0x46fd1f});return{'ok':!![],'data':withScene(_0x208c4a,_0x44099e)};}const _0x30d85d=requireRuntimeUploadFile(_0x16ebff['imageFile'],_0x56a47e(0x123)),_0x41dbab=await uploadRuntimeFile(_0x440313[_0x56a47e(0x122)],_0x30d85d[_0x56a47e(0xf1)]);if(!_0x41dbab['filePath'])throw CliErrors[_0x56a47e(0x108)](_0x56a47e(0x10a));const _0x3aa313=await queryRuntimeFileUrl(_0x41dbab[_0x56a47e(0x113)],{'download':![]});if(!_0x3aa313[_0x56a47e(0x114)])throw CliErrors['apiError'](_0x56a47e(0x11e));const _0x25f0aa=await recognizeRuntimeOcr(_0x440313[_0x56a47e(0x122)],{'url':_0x3aa313[_0x56a47e(0x114)],'type':_0x46fd1f});return{'ok':!![],'data':withScene(_0x25f0aa,_0x44099e,_0x41dbab)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
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
+ const a35_0x1b62c1=a35_0x1751;(function(_0x2c656c,_0x188d8d){const _0x2f39cd=a35_0x1751,_0x4e9018=_0x2c656c();while(!![]){try{const _0x4c3d06=-parseInt(_0x2f39cd(0x1b4))/0x1+parseInt(_0x2f39cd(0x1c8))/0x2+-parseInt(_0x2f39cd(0x1a4))/0x3+parseInt(_0x2f39cd(0x1bc))/0x4+-parseInt(_0x2f39cd(0x1c4))/0x5+-parseInt(_0x2f39cd(0x1c6))/0x6+parseInt(_0x2f39cd(0x1a6))/0x7;if(_0x4c3d06===_0x188d8d)break;else _0x4e9018['push'](_0x4e9018['shift']());}catch(_0x32658b){_0x4e9018['push'](_0x4e9018['shift']());}}}(a35_0x5963,0xd8800));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_0x1b62c1(0x1c2),'type':'string','description':a35_0x1b62c1(0x1a3)},FUNCTION_NAME_FLAG={'name':a35_0x1b62c1(0x1ce),'type':a35_0x1b62c1(0x1d0),'required':!![],'description':a35_0x1b62c1(0x1c3)},DESCRIPTION_FLAG={'name':'description','type':a35_0x1b62c1(0x1d0),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x1b62c1(0x1d8),'type':a35_0x1b62c1(0x1d0),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x456c53){const _0xcad87a=a35_0x1b62c1,_0x3cc256=String(_0x456c53||'')[_0xcad87a(0x1de)]();if(!_0x3cc256||!FUNCTION_NAME_PATTERN[_0xcad87a(0x1b1)](_0x3cc256))throw CliErrors[_0xcad87a(0x1c5)](_0xcad87a(0x1ad));return _0x3cc256;}function readScriptFile(_0x3389d6){const _0x18e3a1=a35_0x1b62c1;if(!_0x3389d6)throw CliErrors['validation'](_0x18e3a1(0x1d3));if(!existsSync(_0x3389d6))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x3389d6);if(!statSync(_0x3389d6)['isFile']())throw CliErrors[_0x18e3a1(0x1c5)](_0x18e3a1(0x1b2)+_0x3389d6);const _0x50fd55=readFileSync(_0x3389d6,_0x18e3a1(0x1e2));if(!_0x50fd55['trim']())throw CliErrors[_0x18e3a1(0x1c5)](_0x18e3a1(0x1b0));return _0x50fd55;}function optionalTrimmed(_0x18e83c){const _0x1d2d49=a35_0x1b62c1,_0x17583e=String(_0x18e83c||'')[_0x1d2d49(0x1de)]();return _0x17583e||undefined;}function summarizeBff(_0x30e1b9){const _0x107344=a35_0x1b62c1;return{'id':_0x30e1b9['id'],'appCode':_0x30e1b9[_0x107344(0x1bf)],'functionName':_0x30e1b9[_0x107344(0x1b5)],'description':_0x30e1b9[_0x107344(0x1c0)],'scriptType':_0x30e1b9[_0x107344(0x1b8)],'version':_0x30e1b9[_0x107344(0x1c1)],'gmtModified':_0x30e1b9[_0x107344(0x1ba)],'updateTime':_0x30e1b9[_0x107344(0x1cb)]};}function detailBff(_0x48def4){const _0x351cab=a35_0x1b62c1;return{'id':_0x48def4['id'],'appCode':_0x48def4[_0x351cab(0x1bf)],'functionName':_0x48def4[_0x351cab(0x1b5)],'description':_0x48def4[_0x351cab(0x1c0)],'scriptType':_0x48def4[_0x351cab(0x1b8)],'scriptContent':_0x48def4['scriptContent']??'','config':_0x48def4['config'],'version':_0x48def4[_0x351cab(0x1c1)],'createUserId':_0x48def4[_0x351cab(0x1e4)],'gmtCreate':_0x48def4[_0x351cab(0x1c9)],'gmtModified':_0x48def4[_0x351cab(0x1ba)],'createTime':_0x48def4[_0x351cab(0x1d7)],'updateTime':_0x48def4['updateTime']};}function a35_0x5963(){const _0x3c3281=['flag','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','body','list','Personal\x20BFF\x20script\x20file\x20is\x20blank.','test','File\x20is\x20not\x20a\x20regular\x20file:\x20','Executed\x20personal\x20BFF\x20','721192zQLIvv','functionName','num','Show\x20one\x20personal\x20BFF\x20by\x20id','scriptType','Updated\x20personal\x20BFF\x20','gmtModified','str','3841276ELnhwb','--params\x20must\x20be\x20a\x20JSON\x20object.','exec','appCode','description','version','file','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','3426805xVRUgh','validation','5465952osUfCN','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','3482354CBuhle','gmtCreate','scriptContent','updateTime','params','create','name','Created\x20personal\x20BFF\x20','string','write','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','File\x20path\x20is\x20required.','build','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','read','createTime','source-session-id','personal-bff','isArray','Preview:\x20update\x20personal\x20BFF\x20','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','map','trim','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','bool','POST','utf8','Update\x20a\x20personal\x20BFF\x20by\x20id','createUserId','keys','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','93657iQdpQL','/client/runtime-bff/personal/','3738364ppvWaf','Personal\x20BFF\x20script\x20ID','detail','sourceSessionId','update','/update'];a35_0x5963=function(){return _0x3c3281;};return a35_0x5963();}function buildCreateInput(_0x3c0063){const _0x37dc45=a35_0x1b62c1;return{'functionName':normalizeFunctionName(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1ce))),...optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1c0)))?{'description':optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)]('description'))}:{},'scriptContent':readScriptFile(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1c2))),...optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1d8)))?{'sourceSessionId':optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1d8)))}:{}};}function a35_0x1751(_0x27bd8f,_0xb581e7){_0x27bd8f=_0x27bd8f-0x1a2;const _0x59637c=a35_0x5963();let _0x17516c=_0x59637c[_0x27bd8f];return _0x17516c;}function buildUpdateInput(_0x5e6505){const _0x2876a0=a35_0x1b62c1,_0x3a6d69={};optionalTrimmed(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1ce)))&&(_0x3a6d69['functionName']=normalizeFunctionName(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1ce))));_0x5e6505['flag'](_0x2876a0(0x1c0))!==undefined&&(_0x3a6d69[_0x2876a0(0x1c0)]=_0x5e6505['str'](_0x2876a0(0x1c0)));optionalTrimmed(_0x5e6505['str'](_0x2876a0(0x1c2)))&&(_0x3a6d69[_0x2876a0(0x1ca)]=readScriptFile(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1c2))));_0x5e6505[_0x2876a0(0x1ac)](_0x2876a0(0x1d8))!==undefined&&(_0x3a6d69[_0x2876a0(0x1a9)]=_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1d8)));if(Object[_0x2876a0(0x1a2)](_0x3a6d69)['length']===0x0)throw CliErrors[_0x2876a0(0x1c5)](_0x2876a0(0x1d2));return _0x3a6d69;}function parseExecParams(_0x3e3b59){const _0x182be0=a35_0x1b62c1,_0x12d114=parseJsonParams(_0x3e3b59)??{};if(Array[_0x182be0(0x1da)](_0x12d114))throw CliErrors[_0x182be0(0x1c5)](_0x182be0(0x1bd));return _0x12d114;}const personalBffList={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1af),'description':a35_0x1b62c1(0x1df),'risk':a35_0x1b62c1(0x1d6),'flags':[VERBOSE_FLAG],async 'execute'(_0x2c3346){const _0x312c91=a35_0x1b62c1,_0x542ce5=await listPersonalBffs(_0x2c3346['appCode']);return{'ok':!![],'data':{'total':_0x542ce5['length'],'items':_0x2c3346[_0x312c91(0x1e0)]('verbose')?_0x542ce5:_0x542ce5[_0x312c91(0x1dd)](summarizeBff)}};}},personalBffDetail={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1a8),'description':a35_0x1b62c1(0x1b7),'risk':a35_0x1b62c1(0x1d6),'flags':[{...ID_FLAG,'description':a35_0x1b62c1(0x1a7)}],async 'execute'(_0x5a57bc){const _0xba0f62=a35_0x1b62c1,_0x57cac9=await getPersonalBff(_0x5a57bc[_0xba0f62(0x1b6)]('id'),_0x5a57bc[_0xba0f62(0x1bf)]);return{'ok':!![],'data':detailBff(_0x57cac9)};}},personalBffCreate={'service':'personal-bff','command':a35_0x1b62c1(0x1cd),'description':a35_0x1b62c1(0x1d5),'risk':a35_0x1b62c1(0x1d1),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x57ef10){const _0x5a6ff2=a35_0x1b62c1,_0x44927a=buildCreateInput(_0x57ef10),_0x476bcb=await createPersonalBff(_0x57ef10['appCode'],_0x44927a);return{'ok':!![],'data':detailBff(_0x476bcb),'message':_0x5a6ff2(0x1cf)+_0x476bcb['id']+(_0x476bcb[_0x5a6ff2(0x1b5)]?'\x20('+_0x476bcb['functionName']+')':'')};},async 'dryRun'(_0x4d3c50){const _0x35c4cf=a35_0x1b62c1,_0x3e6142=buildCreateInput(_0x4d3c50);return dryRun(_0x35c4cf(0x1e1),'/client/runtime-bff/personal/create')['body']({'appCode':_0x4d3c50[_0x35c4cf(0x1bf)],..._0x3e6142})['description']('Preview:\x20create\x20personal\x20BFF\x20'+_0x3e6142['functionName'])[_0x35c4cf(0x1d4)]();}},personalBffUpdate={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1aa),'description':a35_0x1b62c1(0x1e3),'risk':a35_0x1b62c1(0x1d1),'flags':[{...ID_FLAG,'description':a35_0x1b62c1(0x1a7)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xed5a21){const _0x333a28=a35_0x1b62c1,_0x2e4d69=_0xed5a21[_0x333a28(0x1b6)]('id'),_0x28a07e=buildUpdateInput(_0xed5a21),_0x22a648=await updatePersonalBff(_0x2e4d69,_0xed5a21[_0x333a28(0x1bf)],_0x28a07e);return{'ok':!![],'data':detailBff(_0x22a648),'message':_0x333a28(0x1b9)+_0x22a648['id']+(_0x22a648[_0x333a28(0x1b5)]?'\x20('+_0x22a648['functionName']+')':'')};},async 'dryRun'(_0x374f20){const _0xc833ce=a35_0x1b62c1,_0x55716a=_0x374f20['num']('id'),_0x3c31c5=buildUpdateInput(_0x374f20);return dryRun(_0xc833ce(0x1e1),_0xc833ce(0x1a5)+_0x55716a+_0xc833ce(0x1ab))[_0xc833ce(0x1ae)]({'appCode':_0x374f20[_0xc833ce(0x1bf)],..._0x3c31c5})['description'](_0xc833ce(0x1db)+_0x55716a)[_0xc833ce(0x1d4)]();}},personalBffExec={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1be),'description':a35_0x1b62c1(0x1dc),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0x1b62c1(0x1c7)}],async 'validate'(_0x42e8dc){const _0x210735=a35_0x1b62c1;parseExecParams(_0x42e8dc[_0x210735(0x1bb)]('params'));},async 'execute'(_0x404e49){const _0x2f0b0f=a35_0x1b62c1,_0x4f11d4=_0x404e49[_0x2f0b0f(0x1b6)]('id'),_0x19c5fe=parseExecParams(_0x404e49['str'](_0x2f0b0f(0x1cc))),_0x8b8944=await executePersonalBff(_0x4f11d4,_0x404e49['appCode'],_0x19c5fe);return{'ok':!![],'data':{'result':_0x8b8944},'message':_0x2f0b0f(0x1b3)+_0x4f11d4};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
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
+ const a36_0x5f51cd=a36_0x1e91;(function(_0x15051a,_0x1bcf48){const _0x472ed4=a36_0x1e91,_0x18ad58=_0x15051a();while(!![]){try{const _0x302767=-parseInt(_0x472ed4(0x98))/0x1*(parseInt(_0x472ed4(0x91))/0x2)+parseInt(_0x472ed4(0x8d))/0x3+parseInt(_0x472ed4(0x97))/0x4*(parseInt(_0x472ed4(0xb3))/0x5)+parseInt(_0x472ed4(0xb2))/0x6+parseInt(_0x472ed4(0xa7))/0x7*(parseInt(_0x472ed4(0xb4))/0x8)+-parseInt(_0x472ed4(0x96))/0x9*(-parseInt(_0x472ed4(0x9c))/0xa)+parseInt(_0x472ed4(0xa6))/0xb*(-parseInt(_0x472ed4(0xb8))/0xc);if(_0x302767===_0x1bcf48)break;else _0x18ad58['push'](_0x18ad58['shift']());}catch(_0x244926){_0x18ad58['push'](_0x18ad58['shift']());}}}(a36_0x4c63,0x3a15f));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';function a36_0x1e91(_0x5a335b,_0x27cb16){_0x5a335b=_0x5a335b-0x8b;const _0x4c6358=a36_0x4c63();let _0x1e9118=_0x4c6358[_0x5a335b];return _0x1e9118;}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';function a36_0x4c63(){const _0x4a67de=['read','description','get','Skills','Runtime\x20App\x20Config','has','from','9157313UDoyNC','14pIoviJ','App\x20Management','install','values','write','\x20\x20[write]','set','Knowledge\x20Base','Service\x20Tree','SQL\x20Queries','list','2475330PHcNMR','28335PlDtmd','270280iwUhWU','OCR','Personal\x20BFF','CLI\x20Built-in\x20Skill','12AfshSk','Self\x20Update','push','1380006mIZdNe','Authentication','Workspace','service','1580rtwglr','isSingleCommand','show','API\x20Documentation','Datasets','18yBMHWC','332hpRFwW','431qbPlUh','login','Configuration','\x20\x20[high-risk-write]','2020RpFihS','File','command'];a36_0x4c63=function(){return _0x4a67de;};return a36_0x4c63();}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 registerDefinitions(_0x543485){const _0x510a40=a36_0x1e91;for(const _0x420b7c of _0x543485){definitions[_0x510a40(0xad)](_0x420b7c[_0x510a40(0x90)]+':'+_0x420b7c[_0x510a40(0x9e)],_0x420b7c);let _0x178de7=serviceGroups[_0x510a40(0xa1)](_0x420b7c[_0x510a40(0x90)]);!_0x178de7&&(_0x178de7=[],serviceGroups[_0x510a40(0xad)](_0x420b7c[_0x510a40(0x90)],_0x178de7)),_0x178de7[_0x510a40(0x8c)](_0x420b7c);}}function registerService(_0xec8459,_0x2c3b02,_0x91fca){const _0x3999ae=a36_0x1e91;registerDefinitions(_0x2c3b02);const _0x24f65c=_0x13daaa=>_0x13daaa===_0x3999ae(0x9f)?'':_0x13daaa===_0x3999ae(0xab)?_0x3999ae(0xac):_0x3999ae(0x9b),_0x409102={'service':_0x2c3b02[0x0]['service'],'label':_0xec8459,'commands':_0x2c3b02['map'](_0x2d7c07=>({'command':_0x2d7c07[_0x3999ae(0x9e)],'description':_0x2d7c07[_0x3999ae(0xa0)],'tag':_0x24f65c(_0x2d7c07['risk'])})),'defaultCommand':_0x91fca?.['defaultCommand']??(_0x91fca?.[_0x3999ae(0x92)]?_0x2c3b02[0x0][_0x3999ae(0x9e)]:undefined),'isSingleCommand':_0x91fca?.[_0x3999ae(0x92)]};serviceRegistry['push'](_0x409102),serviceByName[_0x3999ae(0xad)](_0x409102[_0x3999ae(0x90)],_0x409102);}registerService(a36_0x5f51cd(0x8e),authDefinitions,{'defaultCommand':a36_0x5f51cd(0x99)}),registerService(a36_0x5f51cd(0xa8),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5f51cd(0x8f),workspaceDefinitions),registerService(a36_0x5f51cd(0xa3),appConfigDefinitions),registerService(a36_0x5f51cd(0x9a),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5f51cd(0x94),apiDocDefinitions),registerService(a36_0x5f51cd(0x95),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x5f51cd(0xb0),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0x5f51cd(0xb6),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x5f51cd(0x9d),fileDefinitions),registerService(a36_0x5f51cd(0xb5),ocrDefinitions),registerService(a36_0x5f51cd(0xae),kbDefinitions),registerService(a36_0x5f51cd(0xaf),serviceDefinitions,{'defaultCommand':a36_0x5f51cd(0xb1)}),registerService(a36_0x5f51cd(0xa2),skillDefinitions,{'defaultCommand':a36_0x5f51cd(0xa9)}),registerService(a36_0x5f51cd(0xb7),cliSkillDefinitions,{'defaultCommand':a36_0x5f51cd(0xa9)}),registerService(a36_0x5f51cd(0x8b),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x5f51cd(0x93)});export function findDefinition(_0x16fcba,_0x7b8712){const _0x54337f=a36_0x5f51cd;return definitions[_0x54337f(0xa1)](_0x16fcba+':'+_0x7b8712);}export function isKnownService(_0x1c75ad){const _0x511682=a36_0x5f51cd;return serviceByName[_0x511682(0xa4)](_0x1c75ad);}export function getServiceEntry(_0x13f5ff){const _0x5da45b=a36_0x5f51cd;return serviceByName[_0x5da45b(0xa1)](_0x13f5ff);}export function getAllDefinitions(){const _0x341a2f=a36_0x5f51cd;return Array[_0x341a2f(0xa5)](definitions[_0x341a2f(0xaa)]());}
@@ -1 +1 @@
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
+ const a37_0xce5a01=a37_0x48a5;function a37_0x19f7(){const _0x46cd31=['4524399HacPIo','9pBOToS','32jjxprx','read','1379372qMXlkv','1188075zaqzYX','Export\x20machine-readable\x20command\x20schema\x20(JSON)','50617pAJHPq','1oXNHeb','3XiHYSX','881002XJlRop','schema','5255300MZnHAQ','1200924DjLwqF'];a37_0x19f7=function(){return _0x46cd31;};return a37_0x19f7();}(function(_0x27afd5,_0x3f87d1){const _0x21d302=a37_0x48a5,_0x594f22=_0x27afd5();while(!![]){try{const _0x81f9d9=parseInt(_0x21d302(0xe8))/0x1*(parseInt(_0x21d302(0xea))/0x2)+-parseInt(_0x21d302(0xe9))/0x3*(parseInt(_0x21d302(0xe4))/0x4)+parseInt(_0x21d302(0xe5))/0x5+-parseInt(_0x21d302(0xed))/0x6+parseInt(_0x21d302(0xe7))/0x7*(parseInt(_0x21d302(0xe2))/0x8)+-parseInt(_0x21d302(0xe1))/0x9*(-parseInt(_0x21d302(0xec))/0xa)+-parseInt(_0x21d302(0xee))/0xb;if(_0x81f9d9===_0x3f87d1)break;else _0x594f22['push'](_0x594f22['shift']());}catch(_0x49b205){_0x594f22['push'](_0x594f22['shift']());}}}(a37_0x19f7,0x43728));function a37_0x48a5(_0x3fa983,_0x26de85){_0x3fa983=_0x3fa983-0xe1;const _0x19f765=a37_0x19f7();let _0x48a5bd=_0x19f765[_0x3fa983];return _0x48a5bd;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5a19c1){const _0x151259=await buildSchemaPayload();return{'ok':!![],'data':_0x151259};}export const schemaDefinition={'service':a37_0xce5a01(0xeb),'command':'export','description':a37_0xce5a01(0xe6),'risk':a37_0xce5a01(0xe3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
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
+ (function(_0x590701,_0x2c5c77){const _0x1b097a=a38_0x58ff,_0x27571d=_0x590701();while(!![]){try{const _0x300f50=-parseInt(_0x1b097a(0x11f))/0x1+parseInt(_0x1b097a(0xf8))/0x2*(-parseInt(_0x1b097a(0x138))/0x3)+-parseInt(_0x1b097a(0x121))/0x4+-parseInt(_0x1b097a(0x139))/0x5*(parseInt(_0x1b097a(0x13b))/0x6)+parseInt(_0x1b097a(0xf2))/0x7+-parseInt(_0x1b097a(0x104))/0x8+parseInt(_0x1b097a(0x12f))/0x9;if(_0x300f50===_0x2c5c77)break;else _0x27571d['push'](_0x27571d['shift']());}catch(_0x591e26){_0x27571d['push'](_0x27571d['shift']());}}}(a38_0x4ebf,0xde7a8));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';function a38_0x4ebf(){const _0x169c47=['service','startsWith','sql','name','description','type','\x20\x20\x20\x20kind:\x20\x20\x20\x20','Service\x20command\x20','\x20<command>\x20[flags]','slice','\x20\x20\x20\x20scriptName:\x20','number','join','bffCode','json','\x20\x20\x20\x20datasetCode:\x20','default','\x20\x20\x20\x20command:\x20','\x20\x20\x20\x20','Commands:','\x20completed\x20in\x20','fullPath','code','map','tenantCode','6274737BaRVcA','\x20requires\x20target.scriptName.','bffId','app','Run\x20service\x20command\x20','\x20requires\x20target.sqlCode.','2HzomsC','flatMap','`\x20to\x20inspect\x20the\x20manifest.','userId','context.','required','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','appRef','\x20->\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','appCode','\x20\x20MAP\x20TO','7191320jqcAAL','flags','appBindings','target','length','userName','Preview\x20dynamic\x20service\x20command:\x20','params','nickname','\x22\x20in\x20service\x20command\x20','now','padEnd','cliPath','enum','kind','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','datatable','tree','command','find','Unknown\x20appRef\x20\x22','datasetCode','filter','scriptName','\x20\x20\x20\x20sqlCode:\x20','remainingArgs','commands','573712UtJcwG','sqlCode','439668QjspVN','env','Cannot\x20resolve\x20datatable\x20\x22','normalizedManifest','\x20\x20[','mapTo','SERVICE_TREE','\x20\x20\x20\x20datatable:\x20','appcode','const','dbtableConfig','ctx.','args','cliName','35510328AGVaTD','Use\x20`','bff','boolean','data','username','push','envName','read','5365881wkfOug','2020yJwhsB','source','8310xehQDP','risk','loginName','operator','string','validation','fromEntries','entries'];a38_0x4ebf=function(){return _0x169c47;};return a38_0x4ebf();}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x5b2386,_0x530d73){const _0x3722b6=a38_0x58ff,_0x418d46=listLocalServiceTrees();let _0xea2785;for(const _0x973a91 of _0x418d46){const _0x544402=matchServiceTreeCommand(_0x973a91,_0x5b2386);if(!_0x544402)continue;(!_0xea2785||_0x544402['command']['fullPath'][_0x3722b6(0x108)]>_0xea2785[_0x3722b6(0x116)]['fullPath'][_0x3722b6(0x108)])&&(_0xea2785={'tree':_0x973a91,'command':_0x544402[_0x3722b6(0x116)],'remainingArgs':_0x544402['remainingArgs']});}if(!_0xea2785)return undefined;const _0x1ba228={..._0x530d73};return applyAppBinding(_0xea2785[_0x3722b6(0x115)],_0xea2785[_0x3722b6(0x116)],_0x1ba228),{'definition':buildDynamicCommandDefinition(_0xea2785[_0x3722b6(0x115)],_0xea2785[_0x3722b6(0x116)]),'args':_0xea2785[_0x3722b6(0x11d)],'flags':_0x1ba228,'tree':_0xea2785['tree'],'command':_0xea2785[_0x3722b6(0x116)]};}export function generateDynamicServiceHelp(_0x1aeec5){const _0x32dcb1=a38_0x58ff,_0x219a26=listLocalServiceTrees()[_0x32dcb1(0x117)](_0x164ca6=>_0x164ca6[_0x32dcb1(0x143)][_0x32dcb1(0xef)]===_0x1aeec5);if(!_0x219a26)return undefined;const _0x56637d=[CLI_BIN_NAME+'\x20'+_0x1aeec5+_0x32dcb1(0x14b),'',_0x219a26[_0x32dcb1(0x143)][_0x32dcb1(0x146)]||_0x1aeec5,_0x219a26[_0x32dcb1(0x143)]['description']?'\x20\x20'+_0x219a26['service']['description']:'','',_0x32dcb1(0xec),..._0x219a26['commands']['map'](_0x33d294=>{const _0x116421=_0x32dcb1,_0x47099f=_0x33d294[_0x116421(0xee)][_0x116421(0x14c)](0x1)[_0x116421(0x14f)]('\x20'),_0x4b039e=_0x33d294[_0x116421(0x13c)]===_0x116421(0x137)?'':'\x20['+_0x33d294[_0x116421(0x13c)]+']';return'\x20\x20'+_0x47099f[_0x116421(0x10f)](0x18)+'\x20'+(_0x33d294[_0x116421(0x147)]||'')+_0x4b039e;}),'',_0x32dcb1(0x130)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x1aeec5+_0x32dcb1(0xfa)][_0x32dcb1(0x11a)](Boolean);return _0x56637d['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x51a6fd=>{const _0x2cafdf=a38_0x58ff,_0x56d487=_0x51a6fd[_0x2cafdf(0x124)];return{'service':_0x56d487['service'][_0x2cafdf(0xef)],'label':_0x56d487[_0x2cafdf(0x143)][_0x2cafdf(0x146)]||_0x56d487[_0x2cafdf(0x143)][_0x2cafdf(0xef)],'commands':_0x56d487[_0x2cafdf(0x11e)]['map'](_0x3ff8a0=>({'command':dynamicCommandName(_0x3ff8a0),'description':_0x3ff8a0[_0x2cafdf(0x147)]||_0x2cafdf(0xf6)+_0x3ff8a0[_0x2cafdf(0x110)],'tag':riskTag(_0x3ff8a0[_0x2cafdf(0x13c)])}))};});}export function getDynamicServiceEntry(_0x550b7f){const _0x5d445b=a38_0x58ff;return listDynamicServiceEntries()[_0x5d445b(0x117)](_0x3d5bd7=>_0x3d5bd7[_0x5d445b(0x143)]===_0x550b7f);}export function listDynamicServiceDefinitions(_0x2a6fbf){const _0x310da1=a38_0x58ff;return listLocalServiceTrees()['filter'](_0x23237d=>!_0x2a6fbf||_0x23237d[_0x310da1(0x143)][_0x310da1(0xef)]===_0x2a6fbf)[_0x310da1(0xf9)](_0x457ab8=>_0x457ab8[_0x310da1(0x11e)][_0x310da1(0xf0)](_0x5eafd8=>buildDynamicCommandDefinition(_0x457ab8,_0x5eafd8)));}function a38_0x58ff(_0x2764a0,_0x30c081){_0x2764a0=_0x2764a0-0xeb;const _0x4ebf57=a38_0x4ebf();let _0x58ffc0=_0x4ebf57[_0x2764a0];return _0x58ffc0;}export function getDynamicServiceDefinitions(_0x2892b5){const _0x1d40cb=listDynamicServiceDefinitions(_0x2892b5);return _0x1d40cb['length']>0x0?_0x1d40cb:undefined;}export function findDynamicServiceDefinition(_0x3d64f3,_0x3d4934){const _0x3af4da=a38_0x58ff;return listDynamicServiceDefinitions(_0x3d64f3)[_0x3af4da(0x117)](_0x5518a6=>_0x5518a6[_0x3af4da(0x116)]===_0x3d4934);}export function buildDynamicCommandDefinition(_0x315062,_0x3e0770){const _0x4e9860=a38_0x58ff;return{'service':_0x315062[_0x4e9860(0x143)][_0x4e9860(0xef)],'command':dynamicCommandName(_0x3e0770),'description':_0x3e0770[_0x4e9860(0x147)]||_0x4e9860(0xf6)+_0x3e0770[_0x4e9860(0x110)],'risk':_0x3e0770[_0x4e9860(0x13c)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3e0770[_0x4e9860(0x12d)][_0x4e9860(0xf0)](_0x4b8d43=>({'name':_0x4b8d43[_0x4e9860(0x146)],'description':_0x4b8d43[_0x4e9860(0x147)]||_0x4b8d43[_0x4e9860(0x146)],'required':_0x4b8d43[_0x4e9860(0xfd)]})),'flags':_0x3e0770[_0x4e9860(0x105)][_0x4e9860(0xf0)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3e0770),async 'dryRun'(_0x107645){const _0x4a302e=_0x4e9860,_0x199514=await compilePlan(_0x3e0770,_0x107645);return{'method':_0x4a302e(0x127),'url':_0x3e0770[_0x4a302e(0x110)],'body':{'target':targetPreview(_0x199514),'params':_0x199514[_0x4a302e(0x10b)]},'description':_0x4a302e(0x10a)+_0x3e0770[_0x4a302e(0x110)]};},async 'execute'(_0x3b2cc6){const _0x157e43=_0x4e9860,_0x52a207=await compilePlan(_0x3e0770,_0x3b2cc6),_0x52a3d0=Date[_0x157e43(0x10e)](),_0x51a364=await executePlan(_0x52a207,_0x3e0770,_0x3b2cc6),_0x1a58a5=Date[_0x157e43(0x10e)]()-_0x52a3d0;return{'ok':!![],'data':{'service':_0x315062[_0x157e43(0x143)],'command':_0x3e0770[_0x157e43(0x110)],'target':targetPreview(_0x52a207),'result':_0x51a364,'elapsed':_0x1a58a5},'message':_0x157e43(0x14a)+_0x3e0770[_0x157e43(0x110)]+_0x157e43(0xed)+_0x1a58a5+'ms'};}};}function dynamicCommandName(_0x41aa2e){const _0x14f401=a38_0x58ff;return _0x41aa2e[_0x14f401(0xee)][_0x14f401(0x14c)](0x1)[_0x14f401(0x14f)]('\x20');}function riskTag(_0x2ca060){const _0x5be4e7=a38_0x58ff;return _0x2ca060===_0x5be4e7(0x137)?'':_0x5be4e7(0x125)+_0x2ca060+']';}function flagToCommandFlag(_0x5b1c89){const _0x5d0ca0=a38_0x58ff;return{'name':_0x5b1c89[_0x5d0ca0(0x12e)],'type':_0x5b1c89[_0x5d0ca0(0x148)]===_0x5d0ca0(0x151)?_0x5d0ca0(0x13f):_0x5b1c89[_0x5d0ca0(0x148)],'description':_0x5b1c89[_0x5d0ca0(0x147)]||_0x5b1c89[_0x5d0ca0(0x146)],'required':_0x5b1c89[_0x5d0ca0(0xfd)],'default':isPrimitiveFlagDefault(_0x5b1c89[_0x5d0ca0(0x153)])?_0x5b1c89['default']:undefined,'enum':_0x5b1c89[_0x5d0ca0(0x111)]};}async function compilePlan(_0xcc5a92,_0x9b5fe3){const _0x3579d9=a38_0x58ff;return compileServiceTreeCommand(_0xcc5a92,{'flags':_0x9b5fe3['rawFlags'],'args':_0x9b5fe3[_0x3579d9(0x12d)],'context':await buildServiceContext(_0xcc5a92,_0x9b5fe3)});}async function buildServiceContext(_0x975e0e,_0x5b2b1c){const _0x5eae38=a38_0x58ff,_0x56698c={'appCode':_0x5b2b1c[_0x5eae38(0x102)],'env':_0x5b2b1c['envName'],'envName':_0x5b2b1c[_0x5eae38(0x136)]};if(!usesRuntimeContext(_0x975e0e))return _0x56698c;const _0x3cac2b=await getLoginUserInfo(),_0x1b5a75=pickFirst(_0x3cac2b[_0x5eae38(0xfb)],_0x3cac2b['id']);return{..._0x56698c,'user':_0x3cac2b,'userId':_0x1b5a75,'id':_0x3cac2b['id'],'username':pickFirst(_0x3cac2b[_0x5eae38(0x134)],_0x3cac2b[_0x5eae38(0x109)],_0x3cac2b[_0x5eae38(0x13d)]),'userName':_0x3cac2b[_0x5eae38(0x109)],'nickname':pickFirst(_0x3cac2b[_0x5eae38(0x10c)],_0x3cac2b['nickName']),'nickName':_0x3cac2b['nickName'],'tenantCode':_0x3cac2b[_0x5eae38(0xf1)],'employeeId':_0x3cac2b['employeeId']};}function usesRuntimeContext(_0x3fb6cb){const _0x3f58fb=a38_0x58ff;return _0x3fb6cb['mapTo']['some'](_0x23bfd3=>typeof _0x23bfd3[_0x3f58fb(0x13a)]===_0x3f58fb(0x13f)&&(_0x23bfd3['source'][_0x3f58fb(0x144)](_0x3f58fb(0xfc))||_0x23bfd3[_0x3f58fb(0x13a)][_0x3f58fb(0x144)](_0x3f58fb(0x12c))));}function pickFirst(..._0x5e5f48){const _0x5a0876=a38_0x58ff;return _0x5e5f48[_0x5a0876(0x117)](_0x11cc6a=>_0x11cc6a!==undefined&&_0x11cc6a!==null);}async function executePlan(_0x142dc8,_0x21284e,_0x3b4802){const _0x53c58d=a38_0x58ff;if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x133)){const _0x26584b=await resolveDatasetCode(_0x142dc8,_0x21284e,_0x3b4802);return executeData(_0x26584b,_0x142dc8['command'],_0x142dc8[_0x53c58d(0x10b)]);}if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x145)){if(!_0x142dc8[_0x53c58d(0x120)])throw CliErrors[_0x53c58d(0x140)](_0x53c58d(0x14a)+_0x21284e[_0x53c58d(0x110)]+_0x53c58d(0xf7));return executeSdkSql(_0x142dc8[_0x53c58d(0x120)],normalizeScalarParams(_0x142dc8['params']));}if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x131)){const _0x4d536d=_0x142dc8[_0x53c58d(0x11b)]||_0x142dc8[_0x53c58d(0x150)]||(_0x142dc8['bffId']==null?'':String(_0x142dc8[_0x53c58d(0xf4)]));if(!_0x4d536d)throw CliErrors[_0x53c58d(0x140)](_0x53c58d(0x14a)+_0x21284e[_0x53c58d(0x110)]+_0x53c58d(0xf3));return executeSdkBff(_0x4d536d,_0x142dc8['params']);}throw CliErrors[_0x53c58d(0x140)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x142dc8[_0x53c58d(0x112)]);}async function resolveDatasetCode(_0xb4560a,_0x2c4ef6,_0x587d78){const _0x13150a=a38_0x58ff;if(_0xb4560a[_0x13150a(0x119)])return _0xb4560a['datasetCode'];if(!_0xb4560a[_0x13150a(0x114)])throw CliErrors[_0x13150a(0x140)](_0x13150a(0x14a)+_0x2c4ef6[_0x13150a(0x110)]+_0x13150a(0xfe));const _0x4681a4=await listDatasets(_0x587d78[_0x13150a(0x102)]),_0x2cea9f=_0x4681a4[_0x13150a(0x117)](_0x1988ee=>_0x1988ee[_0x13150a(0x12b)]?.['tableName']===_0xb4560a['datatable']);if(!_0x2cea9f?.['code'])throw CliErrors[_0x13150a(0x140)](_0x13150a(0x123)+_0xb4560a[_0x13150a(0x114)]+_0x13150a(0x101)+_0x587d78[_0x13150a(0x102)]+'.',_0x13150a(0x113));return _0x2cea9f[_0x13150a(0xef)];}function applyAppBinding(_0x5b7fb2,_0x39bc6c,_0x9428af){const _0x6ec439=a38_0x58ff,_0xcc3208=_0x39bc6c[_0x6ec439(0x107)][_0x6ec439(0xff)];if(!_0xcc3208)return;const _0x5be8bf=_0x5b7fb2[_0x6ec439(0x106)][_0xcc3208];if(!_0x5be8bf)throw CliErrors[_0x6ec439(0x140)](_0x6ec439(0x118)+_0xcc3208+_0x6ec439(0x10d)+_0x39bc6c['cliPath']+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x8b73aa=_0x5be8bf['appcode']||_0x5be8bf[_0x6ec439(0x102)];_0x8b73aa&&!hasText(_0x9428af['appcode'])&&(_0x9428af['appcode']=_0x8b73aa),_0x5be8bf[_0x6ec439(0xf5)]&&!hasText(_0x9428af[_0x6ec439(0xf5)])&&!hasText(_0x9428af[_0x6ec439(0x129)])&&(_0x9428af[_0x6ec439(0xf5)]=_0x5be8bf[_0x6ec439(0xf5)]),_0x5be8bf['env']&&!hasText(_0x9428af['env'])&&(_0x9428af[_0x6ec439(0x122)]=_0x5be8bf[_0x6ec439(0x122)]);}function renderDynamicCommandHelp(_0x437bbb){const _0x3a8ff7=a38_0x58ff,_0x337574=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x3a8ff7(0x149)+_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x112)],_0x3a8ff7(0x154)+_0x437bbb['target']['command']];if(_0x437bbb['target'][_0x3a8ff7(0x119)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x152)+_0x437bbb[_0x3a8ff7(0x107)]['datasetCode']);if(_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x114)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x128)+_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x114)]);if(_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x120)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x11c)+_0x437bbb['target'][_0x3a8ff7(0x120)]);if(_0x437bbb['target'][_0x3a8ff7(0x11b)])_0x337574['push'](_0x3a8ff7(0x14d)+_0x437bbb['target'][_0x3a8ff7(0x11b)]);if(_0x437bbb[_0x3a8ff7(0x126)][_0x3a8ff7(0x108)]>0x0){_0x337574[_0x3a8ff7(0x135)]('',_0x3a8ff7(0x103));for(const _0x5597cf of _0x437bbb[_0x3a8ff7(0x126)]){_0x337574['push'](_0x3a8ff7(0xeb)+(_0x5597cf[_0x3a8ff7(0x13a)]||_0x3a8ff7(0x12a))+_0x3a8ff7(0x100)+_0x5597cf[_0x3a8ff7(0x107)]+(_0x5597cf['operator']?'.'+_0x5597cf[_0x3a8ff7(0x13e)]:''));}}return _0x337574[_0x3a8ff7(0x14f)]('\x0a');}function targetPreview(_0x3da482){const _0x49271c=a38_0x58ff;return{'kind':_0x3da482[_0x49271c(0x112)],'command':_0x3da482[_0x49271c(0x116)],'appRef':_0x3da482[_0x49271c(0xff)],'datasetCode':_0x3da482[_0x49271c(0x119)],'datatable':_0x3da482[_0x49271c(0x114)],'sqlCode':_0x3da482[_0x49271c(0x120)],'bffCode':_0x3da482[_0x49271c(0x150)],'bffId':_0x3da482[_0x49271c(0xf4)],'scriptName':_0x3da482[_0x49271c(0x11b)]};}function normalizeScalarParams(_0x40ff5c){const _0x5dd8f2=a38_0x58ff;return Object[_0x5dd8f2(0x141)](Object[_0x5dd8f2(0x142)](_0x40ff5c)[_0x5dd8f2(0x11a)](([,_0x328e18])=>typeof _0x328e18===_0x5dd8f2(0x13f)||typeof _0x328e18===_0x5dd8f2(0x14e)));}function hasText(_0x274242){const _0x452b18=a38_0x58ff;return typeof _0x274242===_0x452b18(0x13f)&&_0x274242['trim']()[_0x452b18(0x108)]>0x0;}function isPrimitiveFlagDefault(_0x362270){const _0x26ff90=a38_0x58ff;return _0x362270===undefined||typeof _0x362270===_0x26ff90(0x13f)||typeof _0x362270==='number'||typeof _0x362270===_0x26ff90(0x132);}
@@ -1 +1 @@
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']}};}}];
1
+ const a39_0x45ec33=a39_0x1d01;(function(_0x4c0007,_0x352cac){const _0x3051a0=a39_0x1d01,_0x278ef3=_0x4c0007();while(!![]){try{const _0x420457=parseInt(_0x3051a0(0xf5))/0x1*(parseInt(_0x3051a0(0xd2))/0x2)+parseInt(_0x3051a0(0xd6))/0x3*(-parseInt(_0x3051a0(0xdb))/0x4)+-parseInt(_0x3051a0(0xca))/0x5+parseInt(_0x3051a0(0xd9))/0x6*(parseInt(_0x3051a0(0xc8))/0x7)+parseInt(_0x3051a0(0x101))/0x8+parseInt(_0x3051a0(0x103))/0x9+-parseInt(_0x3051a0(0x104))/0xa*(parseInt(_0x3051a0(0xf0))/0xb);if(_0x420457===_0x352cac)break;else _0x278ef3['push'](_0x278ef3['shift']());}catch(_0x2eaf3b){_0x278ef3['push'](_0x278ef3['shift']());}}}(a39_0x5eb3,0x3bab5));function a39_0x5eb3(){const _0x4de795=['registryPath','59517OPpmSB','entry','risk','30jXCtZy','serviceCount','80EgrBUW','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','cliPath','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registry','read','hash','Local\x20service\x20code,\x20for\x20example\x20crm','write','export','filePath','registryIndex','manifests','description','Removed\x20service\x20','Service\x20manifest\x20validation\x20passed.','reduce','import','kind','Imported\x20','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','11ybLIwK','normalizedManifest','map','Service\x20registry\x20validation\x20passed.','source','1tSZxxW','\x20service(s).','string','replaced','entries','str','report','commands','serviceCode','imported','list','Service\x20Tree\x20manifest\x20file\x20path','2829672RUwqTc','file','835398eoyAWS','1047070BbztpB','WRITE','importedAt','name','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','type','version','Imported','errors','required','validate','flags','\x20service\x20','updated','135121vWUvTC','service','814555fcpbgu','Updated','warnings','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','length','target','731514gynIfx','detail','Exported\x20service\x20'];a39_0x5eb3=function(){return _0x4de795;};return a39_0x5eb3();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x45ec33(0x102),'type':a39_0x45ec33(0xf7),'required':!![],'description':a39_0x45ec33(0x100)},SERVICE_FLAG={'name':a39_0x45ec33(0xc9),'type':'string','required':!![],'description':a39_0x45ec33(0xe2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function a39_0x1d01(_0x92e3ee,_0x2390c5){_0x92e3ee=_0x92e3ee-0xbf;const _0x5eb343=a39_0x5eb3();let _0x1d019c=_0x5eb343[_0x92e3ee];return _0x1d019c;}function summarizeService(_0x3b6204){const _0x5c62b2=a39_0x45ec33;return{'serviceCode':_0x3b6204[_0x5c62b2(0xfd)],'name':_0x3b6204[_0x5c62b2(0xf1)]['service'][_0x5c62b2(0x107)],'version':_0x3b6204[_0x5c62b2(0xc0)],'importedAt':_0x3b6204[_0x5c62b2(0x106)],'source':_0x3b6204['source'],'commandCount':_0x3b6204['normalizedManifest'][_0x5c62b2(0xfc)]['length'],'commands':_0x3b6204[_0x5c62b2(0xf1)][_0x5c62b2(0xfc)][_0x5c62b2(0xf2)](_0x2c35a3=>({'path':_0x2c35a3[_0x5c62b2(0xdd)],'description':_0x2c35a3[_0x5c62b2(0xe8)],'risk':_0x2c35a3[_0x5c62b2(0xd8)],'target':_0x2c35a3['target'],'flags':_0x2c35a3[_0x5c62b2(0xc5)][_0x5c62b2(0xf2)](_0x3022ba=>({'name':_0x3022ba['name'],'cliName':_0x3022ba['cliName'],'type':_0x3022ba[_0x5c62b2(0xbf)],'required':_0x3022ba[_0x5c62b2(0xc3)]===!![]}))}))};}function summarizeLoadedManifest(_0x39f400){const _0x16637e=a39_0x45ec33;return{'service':_0x39f400[_0x16637e(0xf1)]?.[_0x16637e(0xc9)],'version':_0x39f400['normalizedManifest']?.['version'],'commandCount':_0x39f400['normalizedManifest']?.[_0x16637e(0xfc)][_0x16637e(0xd0)]??0x0,'commands':_0x39f400[_0x16637e(0xf1)]?.[_0x16637e(0xfc)][_0x16637e(0xf2)](_0x1ce41b=>({'path':_0x1ce41b['cliPath'],'risk':_0x1ce41b[_0x16637e(0xd8)],'target':_0x1ce41b[_0x16637e(0xd1)]}))??[],'registryIndex':_0x39f400[_0x16637e(0xe6)],'registryServiceCode':_0x39f400['registryServiceCode'],'errors':_0x39f400[_0x16637e(0xfb)]['errors'],'warnings':_0x39f400['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0x45ec33(0xc9),'command':a39_0x45ec33(0xc4),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4bf309){const _0x5d99c7=a39_0x45ec33,_0x1fe5b1=loadServiceManifestFromFile(_0x4bf309[_0x5d99c7(0xfa)](_0x5d99c7(0x102)));if(!_0x1fe5b1['report']['ok'])return{'ok':![],'data':{'file':_0x1fe5b1[_0x5d99c7(0xe5)],'hash':_0x1fe5b1[_0x5d99c7(0xe1)],'kind':_0x1fe5b1[_0x5d99c7(0xed)],'serviceCount':_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xd0)],'services':_0x1fe5b1['manifests']['map'](summarizeLoadedManifest),'errors':_0x1fe5b1['report'][_0x5d99c7(0xc2)],'warnings':_0x1fe5b1['report']['warnings']},'message':formatValidationFailure(_0x1fe5b1[_0x5d99c7(0xfb)])};if(_0x1fe5b1[_0x5d99c7(0xed)]===_0x5d99c7(0xdf)||_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xd0)]!==0x1)return{'ok':!![],'data':{'file':_0x1fe5b1[_0x5d99c7(0xe5)],'hash':_0x1fe5b1[_0x5d99c7(0xe1)],'kind':_0x1fe5b1['kind'],'serviceCount':_0x1fe5b1['manifests'][_0x5d99c7(0xd0)],'commandCount':_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xeb)]((_0x2a4a94,_0x4fa666)=>_0x2a4a94+(_0x4fa666[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)]['length']??0x0),0x0),'services':_0x1fe5b1['manifests'][_0x5d99c7(0xf2)](summarizeLoadedManifest),'warnings':_0x1fe5b1[_0x5d99c7(0xfb)][_0x5d99c7(0xcc)]},'message':_0x5d99c7(0xf3)};return{'ok':!![],'data':{'file':_0x1fe5b1['filePath'],'hash':_0x1fe5b1['hash'],'kind':_0x1fe5b1[_0x5d99c7(0xed)],'service':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xc9)],'version':_0x1fe5b1['normalizedManifest']?.[_0x5d99c7(0xc0)],'commandCount':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)][_0x5d99c7(0xd0)]??0x0,'commands':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)]['map'](_0x1da149=>({'path':_0x1da149[_0x5d99c7(0xdd)],'risk':_0x1da149['risk'],'target':_0x1da149[_0x5d99c7(0xd1)]})),'warnings':_0x1fe5b1[_0x5d99c7(0xfb)][_0x5d99c7(0xcc)]},'message':_0x5d99c7(0xea)};}},{'service':'service','command':a39_0x45ec33(0xec),'description':a39_0x45ec33(0xef),'risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x23f3bc){const _0x15e5d6=a39_0x45ec33,_0x1bd4a0=loadServiceManifestFromFile(_0x23f3bc[_0x15e5d6(0xfa)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x1bd4a0[_0x15e5d6(0xe5)],'hash':_0x1bd4a0[_0x15e5d6(0xe1)],'kind':_0x1bd4a0[_0x15e5d6(0xed)],'ok':_0x1bd4a0[_0x15e5d6(0xfb)]['ok'],'service':_0x1bd4a0[_0x15e5d6(0xf1)]?.['service'],'version':_0x1bd4a0[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xc0)],'serviceCount':_0x1bd4a0[_0x15e5d6(0xe7)][_0x15e5d6(0xd0)],'services':_0x1bd4a0[_0x15e5d6(0xe7)][_0x15e5d6(0xf2)](_0x388820=>({'service':_0x388820[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xc9)],'version':_0x388820[_0x15e5d6(0xf1)]?.['version'],'commandCount':_0x388820[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xfc)][_0x15e5d6(0xd0)]??0x0,'errors':_0x388820[_0x15e5d6(0xfb)]['errors']})),'errors':_0x1bd4a0[_0x15e5d6(0xfb)][_0x15e5d6(0xc2)],'commandCount':_0x1bd4a0[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xfc)]['length']??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x535ac8){const _0x1c6569=a39_0x45ec33,_0x25e9ff=importServiceManifest(_0x535ac8['str']('file'));if(_0x25e9ff[_0x1c6569(0xf9)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x25e9ff[_0x1c6569(0xd5)],'imported':_0x25e9ff[_0x1c6569(0xfe)],'updated':_0x25e9ff[_0x1c6569(0xc7)],'serviceCount':_0x25e9ff[_0x1c6569(0xda)],'services':_0x25e9ff[_0x1c6569(0xf9)][_0x1c6569(0xf2)](summarizeService)},'message':_0x1c6569(0xee)+_0x25e9ff[_0x1c6569(0xfe)]+'\x20service(s),\x20updated\x20'+_0x25e9ff[_0x1c6569(0xc7)]+_0x1c6569(0xf6)};return{'ok':!![],'data':{'registryPath':_0x25e9ff[_0x1c6569(0xd5)],'replaced':_0x25e9ff[_0x1c6569(0xf8)],'imported':_0x25e9ff[_0x1c6569(0xfe)],'updated':_0x25e9ff[_0x1c6569(0xc7)],'serviceCount':_0x25e9ff[_0x1c6569(0xda)],'service':summarizeService(_0x25e9ff[_0x1c6569(0xd7)])},'message':(_0x25e9ff['replaced']?_0x1c6569(0xcb):_0x1c6569(0xc1))+_0x1c6569(0xc6)+_0x25e9ff[_0x1c6569(0xd7)]['serviceCode']+'.'};}},{'service':a39_0x45ec33(0xc9),'command':a39_0x45ec33(0xe4),'description':a39_0x45ec33(0xcd),'risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x1ec801){const _0x58d116=a39_0x45ec33,_0x4ecdf8=getLocalServiceEntry(_0x1ec801['str'](_0x58d116(0xc9)));return{'method':_0x58d116(0x105),'url':_0x1ec801[_0x58d116(0xfa)]('file'),'body':{'service':_0x1ec801['str']('service'),'found':Boolean(_0x4ecdf8),'version':_0x4ecdf8?.[_0x58d116(0xc0)],'source':_0x4ecdf8?.[_0x58d116(0xf4)]},'description':_0x58d116(0x108)};},async 'execute'(_0xa2f08c){const _0x43b82e=a39_0x45ec33,_0x2de2fb=exportServiceManifest(_0xa2f08c[_0x43b82e(0xfa)](_0x43b82e(0xc9)),_0xa2f08c[_0x43b82e(0xfa)](_0x43b82e(0x102)));return{'ok':!![],'data':{'registryPath':_0x2de2fb[_0x43b82e(0xd5)],'file':_0x2de2fb[_0x43b82e(0xe5)],'service':summarizeService(_0x2de2fb[_0x43b82e(0xd7)])},'message':_0x43b82e(0xd4)+_0x2de2fb[_0x43b82e(0xd7)][_0x43b82e(0xfd)]+'.'};}},{'service':'service','command':a39_0x45ec33(0xff),'description':a39_0x45ec33(0xdc),'risk':a39_0x45ec33(0xe0),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5d28fa=a39_0x45ec33,_0x400099=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x400099[_0x5d28fa(0xd0)],'services':_0x400099[_0x5d28fa(0xf2)](summarizeService)}};}},{'service':'service','command':'remove','description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1e9ef4){const _0x3023d3=a39_0x45ec33,_0x2abaa6=getLocalServiceEntry(_0x1e9ef4['str'](_0x3023d3(0xc9)));return{'method':_0x3023d3(0x105),'url':getServiceRegistryPath(),'body':{'service':_0x1e9ef4[_0x3023d3(0xfa)](_0x3023d3(0xc9)),'found':Boolean(_0x2abaa6),'version':_0x2abaa6?.[_0x3023d3(0xc0)],'source':_0x2abaa6?.[_0x3023d3(0xf4)]},'description':_0x3023d3(0xde)};},async 'execute'(_0x282d9a){const _0x4daf92=a39_0x45ec33,_0xcfe76f=removeServiceManifest(_0x282d9a[_0x4daf92(0xfa)](_0x4daf92(0xc9)));return{'ok':!![],'data':{'registryPath':_0xcfe76f[_0x4daf92(0xd5)],'serviceCount':_0xcfe76f[_0x4daf92(0xda)],'service':summarizeService(_0xcfe76f[_0x4daf92(0xd7)])},'message':_0x4daf92(0xe9)+_0xcfe76f[_0x4daf92(0xd7)][_0x4daf92(0xfd)]+'.'};}},{'service':'service','command':a39_0x45ec33(0xd3),'description':a39_0x45ec33(0xce),'risk':a39_0x45ec33(0xe0),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x13dcf7){const _0x4317e5=a39_0x45ec33,_0x3e8183=getLocalServiceEntry(_0x13dcf7['str'](_0x4317e5(0xc9)));if(!_0x3e8183)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x13dcf7[_0x4317e5(0xfa)](_0x4317e5(0xc9))},'message':_0x4317e5(0xcf)+_0x13dcf7[_0x4317e5(0xfa)](_0x4317e5(0xc9))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3e8183),'manifest':_0x3e8183['manifest'],'normalizedManifest':_0x3e8183[_0x4317e5(0xf1)]}};}}];