@lovrabet/rabetbase-cli 2.0.10 → 2.0.12

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 (138) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/logout.js +1 -1
  11. package/lib/cli-flags.js +1 -1
  12. package/lib/cli.js +1 -1
  13. package/lib/commands/api/doc.js +1 -1
  14. package/lib/commands/api/index.js +1 -1
  15. package/lib/commands/api/list.js +1 -1
  16. package/lib/commands/api/pull.js +1 -1
  17. package/lib/commands/api/shared.js +1 -1
  18. package/lib/commands/app/add.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/remote.js +1 -1
  22. package/lib/commands/app/remove.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app/use.js +1 -1
  25. package/lib/commands/auth/index.js +1 -1
  26. package/lib/commands/bff/delete.js +1 -1
  27. package/lib/commands/bff/detail.js +1 -1
  28. package/lib/commands/bff/index.js +1 -1
  29. package/lib/commands/bff/list.js +1 -1
  30. package/lib/commands/bff/new.js +1 -1
  31. package/lib/commands/bff/pull.js +1 -1
  32. package/lib/commands/bff/push.js +1 -1
  33. package/lib/commands/bff/status.js +1 -1
  34. package/lib/commands/cli-update.js +1 -1
  35. package/lib/commands/codegen/index.js +1 -1
  36. package/lib/commands/codegen/sdk.js +1 -1
  37. package/lib/commands/codegen/sql.js +1 -1
  38. package/lib/commands/common/app-selector.js +1 -1
  39. package/lib/commands/common/flags.js +1 -1
  40. package/lib/commands/common/validate.js +1 -1
  41. package/lib/commands/config/get.js +1 -1
  42. package/lib/commands/config/index.js +1 -1
  43. package/lib/commands/config/list.js +1 -1
  44. package/lib/commands/config/set.js +1 -1
  45. package/lib/commands/config/shared.js +1 -1
  46. package/lib/commands/dataset/detail.js +1 -1
  47. package/lib/commands/dataset/index.js +1 -1
  48. package/lib/commands/dataset/links.js +1 -1
  49. package/lib/commands/dataset/list.js +1 -1
  50. package/lib/commands/dataset/operations.js +1 -1
  51. package/lib/commands/doctor.js +1 -1
  52. package/lib/commands/init/index.js +1 -1
  53. package/lib/commands/logs/index.js +1 -1
  54. package/lib/commands/menu/index.js +1 -1
  55. package/lib/commands/menu/shared/compare-table.js +1 -1
  56. package/lib/commands/menu/shared/index.js +1 -1
  57. package/lib/commands/menu/shared/inquirer.js +1 -1
  58. package/lib/commands/menu/shared/local-pages.js +1 -1
  59. package/lib/commands/menu/shared/logic.js +1 -1
  60. package/lib/commands/menu/shared/service.js +1 -1
  61. package/lib/commands/menu/shared/sync-core.js +1 -1
  62. package/lib/commands/menu/shared/update-core.js +1 -1
  63. package/lib/commands/menu/shared/valid-url.js +1 -1
  64. package/lib/commands/menu/sync.js +1 -1
  65. package/lib/commands/menu/update.js +1 -1
  66. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  67. package/lib/commands/project/create/format-elapsed.js +1 -1
  68. package/lib/commands/project/create/main.js +1 -1
  69. package/lib/commands/project/create/non-interactive.js +1 -1
  70. package/lib/commands/project/create/project-template-path.js +1 -1
  71. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  72. package/lib/commands/project/create/use-format-code.js +1 -1
  73. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  74. package/lib/commands/project/index.js +1 -1
  75. package/lib/commands/project/init.js +1 -1
  76. package/lib/commands/project/upgrade.js +1 -1
  77. package/lib/commands/registry.js +1 -1
  78. package/lib/commands/run/index.js +1 -1
  79. package/lib/commands/schema.js +1 -1
  80. package/lib/commands/skill/index.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/sql/list.js +1 -1
  85. package/lib/commands/sql/save.js +1 -1
  86. package/lib/commands/sql/validate.js +1 -1
  87. package/lib/constant/cli.js +1 -1
  88. package/lib/constant/domain.js +1 -1
  89. package/lib/constant/env.js +1 -1
  90. package/lib/constant/paths.js +1 -1
  91. package/lib/context.js +1 -1
  92. package/lib/core/alias-resolver.js +1 -1
  93. package/lib/core/api-client.js +1 -1
  94. package/lib/core/bff/config.js +1 -1
  95. package/lib/core/bff/file-system.js +1 -1
  96. package/lib/core/bff/hash.js +1 -1
  97. package/lib/core/bff/lock.js +1 -1
  98. package/lib/core/bff/utils.js +1 -1
  99. package/lib/core/db-resolver.js +1 -1
  100. package/lib/core/sql-validator.js +1 -1
  101. package/lib/errors.js +1 -1
  102. package/lib/framework/build-all-flags.js +1 -1
  103. package/lib/framework/flags.js +1 -1
  104. package/lib/framework/help.js +1 -1
  105. package/lib/framework/index.js +1 -1
  106. package/lib/framework/output.js +1 -1
  107. package/lib/framework/response.js +1 -1
  108. package/lib/framework/runner.js +1 -1
  109. package/lib/framework/schema-export.js +1 -1
  110. package/lib/framework/types.js +1 -1
  111. package/lib/generated/build-info.js +1 -1
  112. package/lib/help.js +1 -1
  113. package/lib/skills/main.js +1 -1
  114. package/lib/skills/npx-skills-add.js +1 -1
  115. package/lib/telemetry/cli-command-trace.js +1 -1
  116. package/lib/telemetry/cli-help-trace.js +1 -1
  117. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  118. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  119. package/lib/telemetry/send-cli-trace-log.js +1 -1
  120. package/lib/utils/ai_config.js +1 -1
  121. package/lib/utils/apply-jq-filter.js +1 -1
  122. package/lib/utils/cdn-config.js +1 -1
  123. package/lib/utils/check-sdk-version.js +1 -1
  124. package/lib/utils/cli-version-check.js +1 -1
  125. package/lib/utils/config.js +1 -1
  126. package/lib/utils/copy-directory.js +1 -1
  127. package/lib/utils/file-utils.js +1 -1
  128. package/lib/utils/guides-cdn.js +1 -1
  129. package/lib/utils/http-client.js +1 -1
  130. package/lib/utils/is-non-interactive.js +1 -1
  131. package/lib/utils/logger.js +1 -1
  132. package/lib/utils/platform.js +1 -1
  133. package/lib/utils/rules-cdn.js +1 -1
  134. package/lib/utils/sleep.js +1 -1
  135. package/lib/utils/template-replacer.js +1 -1
  136. package/lib/utils/version.js +1 -1
  137. package/lib/utils/with-active-cookie.js +1 -1
  138. package/package.json +1 -1
@@ -1 +1 @@
1
- const a80_0x306b82=a80_0xf89c;(function(_0x43fbca,_0x183427){const _0x50309e=a80_0xf89c,_0x5f0dcf=_0x43fbca();while(!![]){try{const _0x216927=-parseInt(_0x50309e(0x1b5))/0x1+-parseInt(_0x50309e(0x1b9))/0x2*(parseInt(_0x50309e(0x1b6))/0x3)+parseInt(_0x50309e(0x1c0))/0x4*(parseInt(_0x50309e(0x1ca))/0x5)+-parseInt(_0x50309e(0x1ad))/0x6+-parseInt(_0x50309e(0x1bf))/0x7+-parseInt(_0x50309e(0x1b2))/0x8*(-parseInt(_0x50309e(0x1b4))/0x9)+parseInt(_0x50309e(0x1ae))/0xa;if(_0x216927===_0x183427)break;else _0x5f0dcf['push'](_0x5f0dcf['shift']());}catch(_0x168533){_0x5f0dcf['push'](_0x5f0dcf['shift']());}}}(a80_0x2735,0x43f5e));import{CliErrors}from'../../errors.js';function a80_0xf89c(_0x5d6e76,_0x2929c6){_0x5d6e76=_0x5d6e76-0x1ac;const _0x2735d6=a80_0x2735();let _0xf89c42=_0x2735d6[_0x5d6e76];return _0xf89c42;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':a80_0x306b82(0x1be),'command':a80_0x306b82(0x1c5),'description':a80_0x306b82(0x1ba),'risk':a80_0x306b82(0x1c1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1a57a3){const _0x49be5b=a80_0x306b82;logger['setLogPath'](process[_0x49be5b(0x1b0)]()),logger[_0x49be5b(0x1c4)](_0x49be5b(0x1c8),_0x49be5b(0x1af));const {runNpxSkillsAddGlobal:_0x1cf057}=await import(_0x49be5b(0x1b3)),_0x469f00=_0x1a57a3[_0x49be5b(0x1b7)]?_0x49be5b(0x1bd):_0x49be5b(0x1c3);console[_0x49be5b(0x1b8)](_0x49be5b(0x1c7));const _0x28775b=_0x1cf057(process['cwd'](),_0x49be5b(0x1c9),{'stdio':_0x469f00});if(_0x28775b[_0x49be5b(0x1b1)])console[_0x49be5b(0x1b8)](_0x49be5b(0x1c6));else{if(_0x28775b['ok'])console[_0x49be5b(0x1b8)](CLI_BIN_NAME+_0x49be5b(0x1bc));else throw CliErrors[_0x49be5b(0x1cb)](_0x49be5b(0x1ac)+(_0x28775b[_0x49be5b(0x1c2)]||'unknown'),_0x49be5b(0x1bb));}return{'ok':!![]};}}];function a80_0x2735(){const _0x2afe9e=['11995290RUwQgo','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','cwd','skipped','1409504ODYePz','../../skills/npx-skills-add.js','18PZicYv','555410yAThhZ','261024yFMzvO','nonInteractive','log','8qvelcR','Install\x20developer\x20skill\x20package','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20skill\x20installed','pipe','skill','2350096ZOnFjK','8cROOac','write','error','inherit','info','install','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','skill-install','lovrabet/rabetbase','645595GlVwOl','apiError','npx\x20skills\x20add\x20failed:\x20','1755642bIKhbZ'];a80_0x2735=function(){return _0x2afe9e;};return a80_0x2735();}
1
+ function a80_0x4e22(){const _0x33dd00=['pipe','skipped','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','write','log','\x20skill\x20installed','cwd','install','10mJZLpd','../../skills/npx-skills-add.js','288294JTEOhG','Check\x20network\x20connectivity\x20and\x20try\x20again.','nonInteractive','2795320fBPMoR','558bTcoZz','setLogPath','634130wrIQnW','info','27MNsCOT','npx\x20skills\x20add\x20failed:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','error','41010NLjARx','338074gBbfzZ','inherit','apiError','24bggqFl','skill-install','149680VlzevT','Install\x20developer\x20skill\x20package','8636dhLTMD','lovrabet/rabetbase'];a80_0x4e22=function(){return _0x33dd00;};return a80_0x4e22();}const a80_0x31104e=a80_0x1699;(function(_0x386bd4,_0x44fbfa){const _0x2a019c=a80_0x1699,_0x27296f=_0x386bd4();while(!![]){try{const _0x3d7118=parseInt(_0x2a019c(0x1e7))/0x1+parseInt(_0x2a019c(0x1e2))/0x2+-parseInt(_0x2a019c(0x1dd))/0x3*(parseInt(_0x2a019c(0x1e9))/0x4)+parseInt(_0x2a019c(0x1d3))/0x5*(parseInt(_0x2a019c(0x1d5))/0x6)+parseInt(_0x2a019c(0x1db))/0x7*(parseInt(_0x2a019c(0x1e5))/0x8)+parseInt(_0x2a019c(0x1d9))/0x9*(-parseInt(_0x2a019c(0x1e1))/0xa)+-parseInt(_0x2a019c(0x1d8))/0xb;if(_0x3d7118===_0x44fbfa)break;else _0x27296f['push'](_0x27296f['shift']());}catch(_0x170013){_0x27296f['push'](_0x27296f['shift']());}}}(a80_0x4e22,0x26c34));import{CliErrors}from'../../errors.js';function a80_0x1699(_0x216eb5,_0x5db106){_0x216eb5=_0x216eb5-0x1cd;const _0x4e22ec=a80_0x4e22();let _0x169902=_0x4e22ec[_0x216eb5];return _0x169902;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':'skill','command':a80_0x31104e(0x1d2),'description':a80_0x31104e(0x1e8),'risk':a80_0x31104e(0x1ce),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5ba5e4){const _0xdbaca7=a80_0x31104e;logger[_0xdbaca7(0x1da)](process[_0xdbaca7(0x1d1)]()),logger[_0xdbaca7(0x1dc)](_0xdbaca7(0x1e6),_0xdbaca7(0x1cd));const {runNpxSkillsAddGlobal:_0x10ac2e}=await import(_0xdbaca7(0x1d4)),_0x4bf4dd=_0x5ba5e4[_0xdbaca7(0x1d7)]?_0xdbaca7(0x1eb):_0xdbaca7(0x1e3);console[_0xdbaca7(0x1cf)]('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...');const _0x2d3376=_0x10ac2e(process['cwd'](),_0xdbaca7(0x1ea),{'stdio':_0x4bf4dd});if(_0x2d3376[_0xdbaca7(0x1ec)])console[_0xdbaca7(0x1cf)](_0xdbaca7(0x1df));else{if(_0x2d3376['ok'])console[_0xdbaca7(0x1cf)](CLI_BIN_NAME+_0xdbaca7(0x1d0));else throw CliErrors[_0xdbaca7(0x1e4)](_0xdbaca7(0x1de)+(_0x2d3376[_0xdbaca7(0x1e0)]||'unknown'),_0xdbaca7(0x1d6));}return{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a81_0x4887(_0x131055,_0x31f4c7){_0x131055=_0x131055-0x108;const _0x5c0d7c=a81_0x5c0d();let _0x48875a=_0x5c0d7c[_0x131055];return _0x48875a;}const a81_0x64dff2=a81_0x4887;function a81_0x5c0d(){const _0x25dfa8=['5812839aKFuoQ','str','sqlContent','sqlCode','3349056JdUeBU','appCode','730338lUBSdO','Return\x20full\x20raw\x20SQL\x20query\x20object','10sfmGMO','26289rtqqZC','4QRxVjr','sql','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','description','1079175uyADOE','14766224joojXO','dbId','28jaKOLS','sqlcode','sqlName','bool','4zVubul','verbose','2842795JOcCBU'];a81_0x5c0d=function(){return _0x25dfa8;};return a81_0x5c0d();}(function(_0x1bad96,_0x3f6275){const _0x1ed05a=a81_0x4887,_0x4c9b3c=_0x1bad96();while(!![]){try{const _0xc1bf=parseInt(_0x1ed05a(0x11a))/0x1*(parseInt(_0x1ed05a(0x10e))/0x2)+-parseInt(_0x1ed05a(0x11f))/0x3+parseInt(_0x1ed05a(0x11b))/0x4*(parseInt(_0x1ed05a(0x110))/0x5)+-parseInt(_0x1ed05a(0x117))/0x6*(-parseInt(_0x1ed05a(0x10a))/0x7)+parseInt(_0x1ed05a(0x115))/0x8+-parseInt(_0x1ed05a(0x111))/0x9*(-parseInt(_0x1ed05a(0x119))/0xa)+-parseInt(_0x1ed05a(0x108))/0xb;if(_0xc1bf===_0x3f6275)break;else _0x4c9b3c['push'](_0x4c9b3c['shift']());}catch(_0x4f7c11){_0x4c9b3c['push'](_0x4c9b3c['shift']());}}}(a81_0x5c0d,0x72d97));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a81_0x64dff2(0x11c),'command':'detail','description':a81_0x64dff2(0x11d),'risk':'read','flags':[SQLCODE_FLAG,{'name':a81_0x64dff2(0x10f),'type':'boolean','description':a81_0x64dff2(0x118)}],async 'execute'(_0x3434f6){const _0x3593c5=a81_0x64dff2,_0x5246c2=await getSqlQueryInfo(_0x3434f6[_0x3593c5(0x116)],_0x3434f6[_0x3593c5(0x112)](_0x3593c5(0x10b))),_0x20d3ba=_0x3434f6[_0x3593c5(0x10d)](_0x3593c5(0x10f));if(_0x20d3ba)return{'ok':!![],'data':_0x5246c2};const _0x5f2b31=_0x5246c2[_0x3593c5(0x109)]?await getDbName(_0x3434f6[_0x3593c5(0x116)],_0x5246c2[_0x3593c5(0x109)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x5246c2[_0x3593c5(0x114)],'sqlName':_0x5246c2[_0x3593c5(0x10c)],'db':_0x5f2b31?_0x5f2b31+'\x20('+_0x5246c2[_0x3593c5(0x109)]+')':_0x5246c2[_0x3593c5(0x109)]??'','description':_0x5246c2[_0x3593c5(0x11e)]??'','sqlContent':_0x5246c2[_0x3593c5(0x113)]??''}};}};
1
+ const a81_0x1a940a=a81_0x1f12;(function(_0x4102b6,_0x471c7f){const _0x16debb=a81_0x1f12,_0x34f8c0=_0x4102b6();while(!![]){try{const _0x516537=-parseInt(_0x16debb(0x7c))/0x1*(parseInt(_0x16debb(0x65))/0x2)+-parseInt(_0x16debb(0x6d))/0x3+-parseInt(_0x16debb(0x7a))/0x4+-parseInt(_0x16debb(0x6b))/0x5*(parseInt(_0x16debb(0x71))/0x6)+-parseInt(_0x16debb(0x72))/0x7*(parseInt(_0x16debb(0x66))/0x8)+-parseInt(_0x16debb(0x68))/0x9*(-parseInt(_0x16debb(0x77))/0xa)+-parseInt(_0x16debb(0x73))/0xb*(-parseInt(_0x16debb(0x76))/0xc);if(_0x516537===_0x471c7f)break;else _0x34f8c0['push'](_0x34f8c0['shift']());}catch(_0x3c7c27){_0x34f8c0['push'](_0x34f8c0['shift']());}}}(a81_0x362d,0xb9557));function a81_0x362d(){const _0x1f606d=['1896kOZNMF','130hqzOMR','appCode','sqlName','2240072LxkKTp','str','610424dLLMxu','2naxghd','785904UQOjQE','dbId','790461sBWzqS','read','sqlCode','930QYBCWH','Return\x20full\x20raw\x20SQL\x20query\x20object','3085362Xwvfit','verbose','sql','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','40422acsAnX','91eoaxyu','302599VgvDNV','bool','detail'];a81_0x362d=function(){return _0x1f606d;};return a81_0x362d();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a81_0x1f12(_0x122dff,_0x318015){_0x122dff=_0x122dff-0x65;const _0x362d66=a81_0x362d();let _0x1f12c3=_0x362d66[_0x122dff];return _0x1f12c3;}export const sqlDetail={'service':a81_0x1a940a(0x6f),'command':a81_0x1a940a(0x75),'description':a81_0x1a940a(0x70),'risk':a81_0x1a940a(0x69),'flags':[SQLCODE_FLAG,{'name':a81_0x1a940a(0x6e),'type':'boolean','description':a81_0x1a940a(0x6c)}],async 'execute'(_0x52eb2d){const _0x1873fd=a81_0x1a940a,_0x58a117=await getSqlQueryInfo(_0x52eb2d[_0x1873fd(0x78)],_0x52eb2d[_0x1873fd(0x7b)]('sqlcode')),_0x54f203=_0x52eb2d[_0x1873fd(0x74)](_0x1873fd(0x6e));if(_0x54f203)return{'ok':!![],'data':_0x58a117};const _0xe2587=_0x58a117[_0x1873fd(0x67)]?await getDbName(_0x52eb2d[_0x1873fd(0x78)],_0x58a117['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x58a117[_0x1873fd(0x6a)],'sqlName':_0x58a117[_0x1873fd(0x79)],'db':_0xe2587?_0xe2587+'\x20('+_0x58a117[_0x1873fd(0x67)]+')':_0x58a117['dbId']??'','description':_0x58a117['description']??'','sqlContent':_0x58a117['sqlContent']??''}};}};
@@ -1 +1 @@
1
- function a82_0x5046(_0x51c5e7,_0x3f6bb4){_0x51c5e7=_0x51c5e7-0x183;const _0xf0b5e4=a82_0xf0b5();let _0x5046b7=_0xf0b5e4[_0x51c5e7];return _0x5046b7;}const a82_0x245f76=a82_0x5046;(function(_0x1fc13d,_0x3aba90){const _0x5b5b8b=a82_0x5046,_0x248a44=_0x1fc13d();while(!![]){try{const _0x13ec61=-parseInt(_0x5b5b8b(0x183))/0x1+-parseInt(_0x5b5b8b(0x18b))/0x2*(-parseInt(_0x5b5b8b(0x197))/0x3)+parseInt(_0x5b5b8b(0x186))/0x4*(parseInt(_0x5b5b8b(0x19d))/0x5)+parseInt(_0x5b5b8b(0x19a))/0x6+parseInt(_0x5b5b8b(0x185))/0x7*(-parseInt(_0x5b5b8b(0x199))/0x8)+parseInt(_0x5b5b8b(0x184))/0x9*(-parseInt(_0x5b5b8b(0x189))/0xa)+parseInt(_0x5b5b8b(0x198))/0xb;if(_0x13ec61===_0x3aba90)break;else _0x248a44['push'](_0x248a44['shift']());}catch(_0x54c605){_0x248a44['push'](_0x248a44['shift']());}}}(a82_0xf0b5,0x7d2f2));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a82_0x245f76(0x194),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a82_0x245f76(0x192),'type':a82_0x245f76(0x188),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x4c93ee){const _0x1123d5=a82_0x245f76;let _0x2d80d5;const _0x2a8f81=_0x4c93ee[_0x1123d5(0x195)](_0x1123d5(0x192));if(_0x2a8f81)try{_0x2d80d5=JSON[_0x1123d5(0x19b)](_0x2a8f81);}catch{throw CliErrors[_0x1123d5(0x187)](_0x1123d5(0x190)+_0x2a8f81);}const _0x2043e9=Date[_0x1123d5(0x18f)](),_0x111fc5=await executeSql(_0x4c93ee[_0x1123d5(0x18c)],_0x4c93ee[_0x1123d5(0x195)](_0x1123d5(0x18d)),_0x2d80d5),_0x196f44=Date[_0x1123d5(0x18f)]()-_0x2043e9,_0x2cff2c=_0x111fc5?.['execResult']??_0x111fc5,_0x11c18e=_0x111fc5?.[_0x1123d5(0x196)]??!![];if(!_0x11c18e)return{'ok':![],'data':{'error':_0x111fc5?.['execError']||_0x1123d5(0x193),'elapsed':_0x196f44},'message':_0x1123d5(0x193)};const _0x89f459=Array[_0x1123d5(0x18e)](_0x2cff2c)?_0x2cff2c:[];return{'ok':!![],'data':{'rows':_0x89f459,'rowCount':_0x89f459['length'],'elapsed':_0x196f44},'message':_0x1123d5(0x19c)+_0x89f459[_0x1123d5(0x18a)]+_0x1123d5(0x191)+_0x196f44+'ms'};}};function a82_0xf0b5(){const _0x53f37b=['637062inDbYv','8352JYMsnx','87066dHxMJZ','46712mCwTka','validation','string','4220ZDfKwu','length','976622IfBxEa','appCode','sqlcode','isArray','now','Invalid\x20JSON\x20for\x20--params:\x20','\x20row(s)\x20in\x20','params','SQL\x20execution\x20failed','sql','str','execSuccess','3kJuvNE','1954414KjrTac','96IZYdYW','262506zovSbX','parse','Returned\x20','420JnTbzW'];a82_0xf0b5=function(){return _0x53f37b;};return a82_0xf0b5();}
1
+ const a82_0x1f848a=a82_0x3b3b;(function(_0xabb2d5,_0x7af4a5){const _0x5a7fdf=a82_0x3b3b,_0x368927=_0xabb2d5();while(!![]){try{const _0x1d65bb=parseInt(_0x5a7fdf(0x138))/0x1*(-parseInt(_0x5a7fdf(0x13b))/0x2)+-parseInt(_0x5a7fdf(0x134))/0x3+parseInt(_0x5a7fdf(0x139))/0x4+parseInt(_0x5a7fdf(0x137))/0x5*(-parseInt(_0x5a7fdf(0x130))/0x6)+-parseInt(_0x5a7fdf(0x133))/0x7*(parseInt(_0x5a7fdf(0x136))/0x8)+parseInt(_0x5a7fdf(0x131))/0x9+parseInt(_0x5a7fdf(0x12d))/0xa;if(_0x1d65bb===_0x7af4a5)break;else _0x368927['push'](_0x368927['shift']());}catch(_0x33510b){_0x368927['push'](_0x368927['shift']());}}}(a82_0x4ddc,0xc644a));function a82_0x3b3b(_0x4e6ca4,_0x1a6f30){_0x4e6ca4=_0x4e6ca4-0x126;const _0x4ddcb8=a82_0x4ddc();let _0x3b3bd0=_0x4ddcb8[_0x4e6ca4];return _0x3b3bd0;}function a82_0x4ddc(){const _0x383d30=['100270euCdHx','41AwUpik','3898760AWRJTr','\x20row(s)\x20in\x20','40410zstYZo','sqlcode','execError','parse','execResult','Invalid\x20JSON\x20for\x20--params:\x20','sql','length','execSuccess','str','string','now','validation','read','params','23277340qwKWoT','exec','SQL\x20execution\x20failed','138ZSbFey','7240176HGGmTH','isArray','1883YZCQkb','4660452xpyWcY','appCode','13432AhqiPo'];a82_0x4ddc=function(){return _0x383d30;};return a82_0x4ddc();}import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a82_0x1f848a(0x141),'command':a82_0x1f848a(0x12e),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a82_0x1f848a(0x12b),'flags':[SQLCODE_FLAG,{'name':a82_0x1f848a(0x12c),'type':a82_0x1f848a(0x128),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x346370){const _0x217af1=a82_0x1f848a;let _0x573f66;const _0xf07960=_0x346370[_0x217af1(0x127)](_0x217af1(0x12c));if(_0xf07960)try{_0x573f66=JSON[_0x217af1(0x13e)](_0xf07960);}catch{throw CliErrors[_0x217af1(0x12a)](_0x217af1(0x140)+_0xf07960);}const _0x185e11=Date[_0x217af1(0x129)](),_0x26e283=await executeSql(_0x346370[_0x217af1(0x135)],_0x346370[_0x217af1(0x127)](_0x217af1(0x13c)),_0x573f66),_0xc1ae4b=Date[_0x217af1(0x129)]()-_0x185e11,_0x38f99b=_0x26e283?.[_0x217af1(0x13f)]??_0x26e283,_0xe2d4b7=_0x26e283?.[_0x217af1(0x126)]??!![];if(!_0xe2d4b7)return{'ok':![],'data':{'error':_0x26e283?.[_0x217af1(0x13d)]||_0x217af1(0x12f),'elapsed':_0xc1ae4b},'message':_0x217af1(0x12f)};const _0x3ec59f=Array[_0x217af1(0x132)](_0x38f99b)?_0x38f99b:[];return{'ok':!![],'data':{'rows':_0x3ec59f,'rowCount':_0x3ec59f[_0x217af1(0x142)],'elapsed':_0xc1ae4b},'message':'Returned\x20'+_0x3ec59f[_0x217af1(0x142)]+_0x217af1(0x13a)+_0xc1ae4b+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x2fb1fd,_0x364b44){const _0x240da4=a83_0x228a,_0x25b6fd=_0x2fb1fd();while(!![]){try{const _0x191683=-parseInt(_0x240da4(0xeb))/0x1*(-parseInt(_0x240da4(0xe8))/0x2)+parseInt(_0x240da4(0xea))/0x3+-parseInt(_0x240da4(0xe6))/0x4*(-parseInt(_0x240da4(0xe5))/0x5)+-parseInt(_0x240da4(0xec))/0x6+-parseInt(_0x240da4(0xe4))/0x7+-parseInt(_0x240da4(0xe7))/0x8*(parseInt(_0x240da4(0xe3))/0x9)+-parseInt(_0x240da4(0xe9))/0xa;if(_0x191683===_0x364b44)break;else _0x25b6fd['push'](_0x25b6fd['shift']());}catch(_0x34ff4c){_0x25b6fd['push'](_0x25b6fd['shift']());}}}(a83_0x2952,0x940a6));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';function a83_0x2952(){const _0x176d2d=['2676216SNwheQ','260962PgAmHR','197820cnASBz','606465wNrWJm','2025541GKLuqB','4473060SoqZzz','4hBMuNT','88dOxtkc','4DXNxeq','6386660ZiDKNo'];a83_0x2952=function(){return _0x176d2d;};return a83_0x2952();}function a83_0x228a(_0x286574,_0x54a677){_0x286574=_0x286574-0xe3;const _0x2952c5=a83_0x2952();let _0x228a01=_0x2952c5[_0x286574];return _0x228a01;}import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec];
1
+ (function(_0x595028,_0x394fbf){const _0x1ffe94=a83_0x2c70,_0x2310e9=_0x595028();while(!![]){try{const _0x357430=-parseInt(_0x1ffe94(0x99))/0x1*(-parseInt(_0x1ffe94(0x9c))/0x2)+parseInt(_0x1ffe94(0x97))/0x3+-parseInt(_0x1ffe94(0x9d))/0x4+parseInt(_0x1ffe94(0x9f))/0x5*(-parseInt(_0x1ffe94(0x9b))/0x6)+-parseInt(_0x1ffe94(0x9e))/0x7+-parseInt(_0x1ffe94(0x98))/0x8*(parseInt(_0x1ffe94(0x96))/0x9)+-parseInt(_0x1ffe94(0x9a))/0xa*(-parseInt(_0x1ffe94(0xa0))/0xb);if(_0x357430===_0x394fbf)break;else _0x2310e9['push'](_0x2310e9['shift']());}catch(_0x399e24){_0x2310e9['push'](_0x2310e9['shift']());}}}(a83_0x259b,0xa053f));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a83_0x259b(){const _0x14e30c=['44axegRZ','2310516OaSjiH','1394499LuHcni','32SlrpUG','40088KMfFmU','4945850YDnNCL','732DHnsxR','58yoxzIE','3247676cPEBXY','1176007WTFpyx','38615ytrphW'];a83_0x259b=function(){return _0x14e30c;};return a83_0x259b();}import{sqlValidate}from'../../commands/sql/validate.js';function a83_0x2c70(_0x1a47c0,_0x1c9192){_0x1a47c0=_0x1a47c0-0x96;const _0x259b54=a83_0x259b();let _0x2c70c1=_0x259b54[_0x1a47c0];return _0x2c70c1;}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec];
@@ -1 +1 @@
1
- function a84_0x3876(_0x76b410,_0x134976){_0x76b410=_0x76b410-0x11b;const _0x43557d=a84_0x4355();let _0x387653=_0x43557d[_0x76b410];return _0x387653;}function a84_0x4355(){const _0x5a0557=['num','7741492schUZQ','totalCount','description','name','all','60021PcHHGJ','319326NRZbsQ','914512LVjBzL','1460pejLdD','string','\x20SQL\x20queries\x20(total:\x20','pagesize','1158UDUYNX','3559672mjYLzd','read','sql','bool','sqlName','2637ZeZeZS','number','map','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','str','page','8210YEvdll','Found\x20','tableData','Page\x20number','length','dbId','50ACDYvT','paging','Page\x20size','7qahFyH','sqlCode'];a84_0x4355=function(){return _0x5a0557;};return a84_0x4355();}const a84_0x322728=a84_0x3876;(function(_0x527ad9,_0x3d3b13){const _0x1fbfe3=a84_0x3876,_0x391f26=_0x527ad9();while(!![]){try{const _0x4495f7=parseInt(_0x1fbfe3(0x128))/0x1+-parseInt(_0x1fbfe3(0x12a))/0x2+-parseInt(_0x1fbfe3(0x12f))/0x3*(-parseInt(_0x1fbfe3(0x12b))/0x4)+parseInt(_0x1fbfe3(0x11d))/0x5*(parseInt(_0x1fbfe3(0x129))/0x6)+-parseInt(_0x1fbfe3(0x120))/0x7*(parseInt(_0x1fbfe3(0x130))/0x8)+parseInt(_0x1fbfe3(0x135))/0x9*(-parseInt(_0x1fbfe3(0x13b))/0xa)+parseInt(_0x1fbfe3(0x123))/0xb;if(_0x4495f7===_0x3d3b13)break;else _0x391f26['push'](_0x391f26['shift']());}catch(_0x2372bf){_0x391f26['push'](_0x391f26['shift']());}}}(a84_0x4355,0x47ced));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a84_0x322728(0x132),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a84_0x322728(0x131),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x322728(0x126),'type':a84_0x322728(0x12c),'description':'Filter\x20by\x20SQL\x20name'},{'name':a84_0x322728(0x13a),'type':a84_0x322728(0x136),'description':a84_0x322728(0x13e),'default':0x1},{'name':'pagesize','type':a84_0x322728(0x136),'description':a84_0x322728(0x11f)},{'name':'verbose','type':'boolean','description':a84_0x322728(0x138)}],async 'execute'(_0x304bc8){const _0x58c5f6=a84_0x322728,_0x1e6555=await listSqlQueries(_0x304bc8['appCode'],{'sqlCode':_0x304bc8[_0x58c5f6(0x139)]('sqlcode')||undefined,'sqlName':_0x304bc8['str'](_0x58c5f6(0x126))||undefined,'currentPage':_0x304bc8[_0x58c5f6(0x122)](_0x58c5f6(0x13a)),'pageSize':_0x304bc8[_0x58c5f6(0x122)](_0x58c5f6(0x12e),0x32)}),_0x176a2f=_0x304bc8[_0x58c5f6(0x133)]('verbose'),_0x7eae52=_0x1e6555[_0x58c5f6(0x13d)]??[],_0x780dc=_0x1e6555[_0x58c5f6(0x11e)]?.[_0x58c5f6(0x124)]??_0x7eae52['length'];let _0x37ee90;return _0x176a2f?_0x37ee90=_0x7eae52:_0x37ee90=await Promise[_0x58c5f6(0x127)](_0x7eae52[_0x58c5f6(0x137)](async _0x2128af=>{const _0x1c1a3f=_0x58c5f6,_0x2304d6=_0x2128af[_0x1c1a3f(0x11c)]?await getDbName(_0x304bc8['appCode'],_0x2128af['dbId']):undefined;return{'sqlCode':_0x2128af[_0x1c1a3f(0x121)],'sqlName':_0x2128af[_0x1c1a3f(0x134)],'description':_0x2128af[_0x1c1a3f(0x125)]??'','db':_0x2304d6?_0x2304d6+'\x20('+_0x2128af['dbId']+')':_0x2128af[_0x1c1a3f(0x11c)]??''};})),{'ok':!![],'data':_0x37ee90,'message':_0x7eae52[_0x58c5f6(0x11b)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x58c5f6(0x13c)+_0x7eae52[_0x58c5f6(0x11b)]+_0x58c5f6(0x12d)+_0x780dc+').'};}};
1
+ const a84_0x5a281a=a84_0x1226;(function(_0x188f75,_0x5e814f){const _0x494d9b=a84_0x1226,_0x55676c=_0x188f75();while(!![]){try{const _0x4e4328=parseInt(_0x494d9b(0xdb))/0x1+parseInt(_0x494d9b(0xd3))/0x2*(parseInt(_0x494d9b(0xcc))/0x3)+parseInt(_0x494d9b(0xdd))/0x4+parseInt(_0x494d9b(0xe3))/0x5+-parseInt(_0x494d9b(0xd4))/0x6+parseInt(_0x494d9b(0xe0))/0x7+-parseInt(_0x494d9b(0xcf))/0x8;if(_0x4e4328===_0x5e814f)break;else _0x55676c['push'](_0x55676c['shift']());}catch(_0x3e27c8){_0x55676c['push'](_0x55676c['shift']());}}}(a84_0x4b73,0xc100e));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a84_0x1226(_0x1be0d3,_0x1b1a04){_0x1be0d3=_0x1be0d3-0xcb;const _0x4b73d8=a84_0x4b73();let _0x1226c6=_0x4b73d8[_0x1be0d3];return _0x1226c6;}function a84_0x4b73(){const _0x2213b6=['totalCount','verbose','577560rkVtuI','boolean','all','12268160zJcyeN','appCode','name','str','6mJMxpt','5683866ONyvGl','read','length','Page\x20size','list','sqlcode','sqlCode','191293WWzrZG','page','379220BbRoOm','pagesize','List\x20custom\x20SQL\x20queries','8917832ylmjyM','number','num','5668695WDCEes','sql','Filter\x20by\x20SQL\x20name','paging','description','map','bool','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','\x20SQL\x20queries\x20(total:\x20','tableData','dbId'];a84_0x4b73=function(){return _0x2213b6;};return a84_0x4b73();}export const sqlList={'service':a84_0x5a281a(0xe4),'command':a84_0x5a281a(0xd8),'description':a84_0x5a281a(0xdf),'risk':a84_0x5a281a(0xd5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x5a281a(0xd1),'type':'string','description':a84_0x5a281a(0xe5)},{'name':a84_0x5a281a(0xdc),'type':a84_0x5a281a(0xe1),'description':'Page\x20number','default':0x1},{'name':a84_0x5a281a(0xde),'type':'number','description':a84_0x5a281a(0xd7)},{'name':'verbose','type':a84_0x5a281a(0xcd),'description':a84_0x5a281a(0xea)}],async 'execute'(_0x4adbdf){const _0x2cf8ad=a84_0x5a281a,_0x385bf5=await listSqlQueries(_0x4adbdf[_0x2cf8ad(0xd0)],{'sqlCode':_0x4adbdf[_0x2cf8ad(0xd2)](_0x2cf8ad(0xd9))||undefined,'sqlName':_0x4adbdf[_0x2cf8ad(0xd2)]('name')||undefined,'currentPage':_0x4adbdf[_0x2cf8ad(0xe2)](_0x2cf8ad(0xdc)),'pageSize':_0x4adbdf['num'](_0x2cf8ad(0xde),0x32)}),_0x589be1=_0x4adbdf[_0x2cf8ad(0xe9)](_0x2cf8ad(0xcb)),_0x2c694d=_0x385bf5[_0x2cf8ad(0xec)]??[],_0x4269eb=_0x385bf5[_0x2cf8ad(0xe6)]?.[_0x2cf8ad(0xee)]??_0x2c694d[_0x2cf8ad(0xd6)];let _0x2263dd;return _0x589be1?_0x2263dd=_0x2c694d:_0x2263dd=await Promise[_0x2cf8ad(0xce)](_0x2c694d[_0x2cf8ad(0xe8)](async _0x592d4d=>{const _0x335370=_0x2cf8ad,_0x39c31f=_0x592d4d[_0x335370(0xed)]?await getDbName(_0x4adbdf[_0x335370(0xd0)],_0x592d4d[_0x335370(0xed)]):undefined;return{'sqlCode':_0x592d4d[_0x335370(0xda)],'sqlName':_0x592d4d['sqlName'],'description':_0x592d4d[_0x335370(0xe7)]??'','db':_0x39c31f?_0x39c31f+'\x20('+_0x592d4d[_0x335370(0xed)]+')':_0x592d4d[_0x335370(0xed)]??''};})),{'ok':!![],'data':_0x2263dd,'message':_0x2c694d[_0x2cf8ad(0xd6)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x2c694d[_0x2cf8ad(0xd6)]+_0x2cf8ad(0xeb)+_0x4269eb+').'};}};
@@ -1 +1 @@
1
- const a85_0x27208b=a85_0x4cbd;function a85_0x4cbd(_0x5607fb,_0x38b50a){_0x5607fb=_0x5607fb-0xdd;const _0x2f89c6=a85_0x2f89();let _0x4cbdaa=_0x2f89c6[_0x5607fb];return _0x4cbdaa;}(function(_0x2f71ed,_0x253759){const _0x5f4836=a85_0x4cbd,_0xc0e386=_0x2f71ed();while(!![]){try{const _0x53c3c2=-parseInt(_0x5f4836(0x108))/0x1+parseInt(_0x5f4836(0xfc))/0x2*(parseInt(_0x5f4836(0xff))/0x3)+-parseInt(_0x5f4836(0xe3))/0x4*(-parseInt(_0x5f4836(0x10c))/0x5)+parseInt(_0x5f4836(0xe2))/0x6*(-parseInt(_0x5f4836(0xe9))/0x7)+parseInt(_0x5f4836(0x106))/0x8*(parseInt(_0x5f4836(0x102))/0x9)+-parseInt(_0x5f4836(0x10b))/0xa*(parseInt(_0x5f4836(0x104))/0xb)+-parseInt(_0x5f4836(0xdd))/0xc;if(_0x53c3c2===_0x253759)break;else _0xc0e386['push'](_0xc0e386['shift']());}catch(_0x1355e1){_0xc0e386['push'](_0xc0e386['shift']());}}}(a85_0x2f89,0xd1457));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';function a85_0x2f89(){const _0x214234=['1916211vHUtpZ','description','\x20chars)','18pFUfRg','join','24497zwXLdW','\x20|\x20Params:\x20','5556456NIDkDZ','Created','637995Nbxjop','action','Path\x20to\x20the\x20SQL\x20file','4670LrVULX','55mjysAx','11871576nXgalj','tables','sqlcode','string','valid','4122aDtdIc','573956GJyQLP','sqlName','\x20|\x20Tables:\x20','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','dbId','File\x20not\x20found:\x20','833pPBhSZ','str','sqlType','utf-8','message','POST','dbName','save','validation','appCode','SQL\x20query\x20display\x20name','/api/node-toolbox/sql/save','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','file','cwd','blocked','sqlname','sqlCode','length','2RiOfDJ','sql','Save\x20SQL\x20query\x20from\x20'];a85_0x2f89=function(){return _0x214234;};return a85_0x2f89();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x27208b(0xfd),'command':a85_0x27208b(0xf0),'description':a85_0x27208b(0xf5),'risk':'write','flags':[{'name':'file','type':a85_0x27208b(0xe0),'required':!![],'description':a85_0x27208b(0x10a)},SQLCODE_FLAG_OPTIONAL,{'name':a85_0x27208b(0xf9),'type':'string','description':a85_0x27208b(0xf3)},{'name':'db','type':a85_0x27208b(0xe0),'description':a85_0x27208b(0xe6)},{'name':a85_0x27208b(0x100),'type':a85_0x27208b(0xe0),'description':'SQL\x20query\x20description'}],async 'validate'(_0x25e81a){const _0x2fed12=a85_0x27208b,_0x395085=resolve(process[_0x2fed12(0xf7)](),_0x25e81a[_0x2fed12(0xea)](_0x2fed12(0xf6)));if(!existsSync(_0x395085))throw CliErrors[_0x2fed12(0xf1)](_0x2fed12(0xe8)+_0x395085);const _0x3405c2=readFileSync(_0x395085,_0x2fed12(0xec)),_0x35fed4=validateSql(_0x3405c2);if(!_0x35fed4[_0x2fed12(0xe1)])throw CliErrors['validation']('SQL\x20validation\x20failed:\x20'+_0x35fed4[_0x2fed12(0xed)]);},async 'dryRun'(_0x4e4447){const _0x41b4c9=a85_0x27208b,_0x19bdfe=resolve(process[_0x41b4c9(0xf7)](),_0x4e4447[_0x41b4c9(0xea)]('file')),_0x506258=readFileSync(_0x19bdfe,_0x41b4c9(0xec)),_0x1d2544=validateSql(_0x506258),_0x42f18c=_0x4e4447[_0x41b4c9(0xea)]('db')||undefined,{db:_0x4dbfd7,error:_0x494eba}=await resolveOneDb(_0x4e4447[_0x41b4c9(0xf2)],_0x42f18c);return{'method':_0x41b4c9(0xee),'url':_0x41b4c9(0xf4),'body':{'appCode':_0x4e4447[_0x41b4c9(0xf2)],'sqlContent':'('+_0x506258[_0x41b4c9(0xfb)]+_0x41b4c9(0x101),'sqlCode':_0x4e4447[_0x41b4c9(0xea)](_0x41b4c9(0xdf))||undefined,'sqlName':_0x4e4447[_0x41b4c9(0xea)]('sqlname')||undefined,'db':_0x4dbfd7?_0x4dbfd7[_0x41b4c9(0xef)]+'\x20('+_0x4dbfd7[_0x41b4c9(0xe7)]+')':_0x494eba},'description':[_0x41b4c9(0xfe)+_0x4e4447[_0x41b4c9(0xea)](_0x41b4c9(0xf6)),'Validation:\x20'+_0x1d2544[_0x41b4c9(0xed)],'Type:\x20'+_0x1d2544[_0x41b4c9(0xeb)]['type']+_0x41b4c9(0xe5)+(_0x1d2544[_0x41b4c9(0xde)][_0x41b4c9(0x103)](',\x20')||'N/A')+_0x41b4c9(0x105)+(_0x1d2544['parameters'][_0x41b4c9(0x103)](',\x20')||'none')]['join']('\x0a')};},async 'execute'(_0x3bebbc){const _0x1ba083=a85_0x27208b,_0x3dc8bc=resolve(process['cwd'](),_0x3bebbc[_0x1ba083(0xea)]('file')),_0x1388df=readFileSync(_0x3dc8bc,'utf-8'),_0x2c3f23=_0x3bebbc[_0x1ba083(0xea)]('db')||undefined,{db:_0x41d981,error:_0x4c10f5}=await resolveOneDb(_0x3bebbc[_0x1ba083(0xf2)],_0x2c3f23);if(_0x4c10f5)throw CliErrors['validation'](_0x4c10f5);const _0x2c5e09=await saveSqlQuery({'appCode':_0x3bebbc[_0x1ba083(0xf2)],'sqlContent':_0x1388df,'sqlCode':_0x3bebbc[_0x1ba083(0xea)](_0x1ba083(0xdf))||undefined,'sqlName':_0x3bebbc['str'](_0x1ba083(0xf9))||undefined,'dbId':_0x41d981[_0x1ba083(0xe7)],'description':_0x3bebbc[_0x1ba083(0xea)](_0x1ba083(0x100))||undefined});if(_0x2c5e09[_0x1ba083(0xf8)])return{'ok':![],'data':_0x2c5e09,'message':_0x2c5e09[_0x1ba083(0xed)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0x2c5e09[_0x1ba083(0xfa)],'sqlName':_0x2c5e09[_0x1ba083(0xe4)],'action':_0x2c5e09[_0x1ba083(0x109)]},'message':(_0x2c5e09[_0x1ba083(0x109)]==='created'?_0x1ba083(0x107):'Updated')+'\x20successfully'+(_0x2c5e09[_0x1ba083(0xfa)]?'\x20('+_0x2c5e09[_0x1ba083(0xfa)]+')':'')};}};
1
+ const a85_0x48c8be=a85_0xbba2;(function(_0x10009e,_0x516a3e){const _0x5829c2=a85_0xbba2,_0x28e64f=_0x10009e();while(!![]){try{const _0x452c22=-parseInt(_0x5829c2(0x198))/0x1*(parseInt(_0x5829c2(0x1a4))/0x2)+parseInt(_0x5829c2(0x18a))/0x3+-parseInt(_0x5829c2(0x1b2))/0x4+parseInt(_0x5829c2(0x1b0))/0x5+-parseInt(_0x5829c2(0x1a5))/0x6*(parseInt(_0x5829c2(0x1a2))/0x7)+-parseInt(_0x5829c2(0x18f))/0x8+-parseInt(_0x5829c2(0x189))/0x9*(-parseInt(_0x5829c2(0x1a9))/0xa);if(_0x452c22===_0x516a3e)break;else _0x28e64f['push'](_0x28e64f['shift']());}catch(_0x7bd7cf){_0x28e64f['push'](_0x28e64f['shift']());}}}(a85_0x4811,0x2ec5d));function a85_0x4811(){const _0x533d81=['sqlcode','Path\x20to\x20the\x20SQL\x20file','95855kGcsff','dbId','821040axcgjS','type','action','\x20|\x20Params:\x20','string','SQL\x20query\x20description','sqlType','join','SQL\x20query\x20display\x20name','valid','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','1305aHFnig','158037YJpWsk','none','\x20chars)','str','\x20|\x20Tables:\x20','338728sOPdYT','dbName','Conflict\x20detected','Created','sqlCode','POST','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','/api/node-toolbox/sql/save','appCode','92275mplcxj','file','N/A','save','tables','validation','utf-8','message','Updated','SQL\x20validation\x20failed:\x20','91taOQdM','sqlname','6hmCXGc','172296swkTGP','\x20successfully','sql','parameters','70170ZdxoAO','cwd','blocked','Type:\x20','write'];a85_0x4811=function(){return _0x533d81;};return a85_0x4811();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';function a85_0xbba2(_0x1f105e,_0xe29520){_0x1f105e=_0x1f105e-0x185;const _0x481116=a85_0x4811();let _0xbba24b=_0x481116[_0x1f105e];return _0xbba24b;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x48c8be(0x1a7),'command':a85_0x48c8be(0x19b),'description':a85_0x48c8be(0x188),'risk':a85_0x48c8be(0x1ad),'flags':[{'name':a85_0x48c8be(0x199),'type':a85_0x48c8be(0x1b6),'required':!![],'description':a85_0x48c8be(0x1af)},SQLCODE_FLAG_OPTIONAL,{'name':a85_0x48c8be(0x1a3),'type':'string','description':a85_0x48c8be(0x186)},{'name':'db','type':a85_0x48c8be(0x1b6),'description':a85_0x48c8be(0x195)},{'name':'description','type':a85_0x48c8be(0x1b6),'description':a85_0x48c8be(0x1b7)}],async 'validate'(_0x13cb19){const _0x1c433b=a85_0x48c8be,_0x4e01d3=resolve(process[_0x1c433b(0x1aa)](),_0x13cb19[_0x1c433b(0x18d)](_0x1c433b(0x199)));if(!existsSync(_0x4e01d3))throw CliErrors[_0x1c433b(0x19d)]('File\x20not\x20found:\x20'+_0x4e01d3);const _0xc307e8=readFileSync(_0x4e01d3,'utf-8'),_0x3c79cc=validateSql(_0xc307e8);if(!_0x3c79cc[_0x1c433b(0x187)])throw CliErrors[_0x1c433b(0x19d)](_0x1c433b(0x1a1)+_0x3c79cc['message']);},async 'dryRun'(_0x44c2ce){const _0x4dfd93=a85_0x48c8be,_0x5bda32=resolve(process[_0x4dfd93(0x1aa)](),_0x44c2ce[_0x4dfd93(0x18d)]('file')),_0x596735=readFileSync(_0x5bda32,_0x4dfd93(0x19e)),_0x42550e=validateSql(_0x596735),_0x2ef34b=_0x44c2ce[_0x4dfd93(0x18d)]('db')||undefined,{db:_0x16197f,error:_0x546e4a}=await resolveOneDb(_0x44c2ce['appCode'],_0x2ef34b);return{'method':_0x4dfd93(0x194),'url':_0x4dfd93(0x196),'body':{'appCode':_0x44c2ce['appCode'],'sqlContent':'('+_0x596735['length']+_0x4dfd93(0x18c),'sqlCode':_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x1ae))||undefined,'sqlName':_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x1a3))||undefined,'db':_0x16197f?_0x16197f[_0x4dfd93(0x190)]+'\x20('+_0x16197f[_0x4dfd93(0x1b1)]+')':_0x546e4a},'description':['Save\x20SQL\x20query\x20from\x20'+_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x199)),'Validation:\x20'+_0x42550e[_0x4dfd93(0x19f)],_0x4dfd93(0x1ac)+_0x42550e[_0x4dfd93(0x1b8)][_0x4dfd93(0x1b3)]+_0x4dfd93(0x18e)+(_0x42550e[_0x4dfd93(0x19c)][_0x4dfd93(0x185)](',\x20')||_0x4dfd93(0x19a))+_0x4dfd93(0x1b5)+(_0x42550e[_0x4dfd93(0x1a8)]['join'](',\x20')||_0x4dfd93(0x18b))][_0x4dfd93(0x185)]('\x0a')};},async 'execute'(_0x5152c7){const _0x3c4cb6=a85_0x48c8be,_0x58dfad=resolve(process['cwd'](),_0x5152c7[_0x3c4cb6(0x18d)](_0x3c4cb6(0x199))),_0x118460=readFileSync(_0x58dfad,'utf-8'),_0x1902f5=_0x5152c7[_0x3c4cb6(0x18d)]('db')||undefined,{db:_0x4c7016,error:_0x369009}=await resolveOneDb(_0x5152c7[_0x3c4cb6(0x197)],_0x1902f5);if(_0x369009)throw CliErrors[_0x3c4cb6(0x19d)](_0x369009);const _0x101b6a=await saveSqlQuery({'appCode':_0x5152c7['appCode'],'sqlContent':_0x118460,'sqlCode':_0x5152c7[_0x3c4cb6(0x18d)]('sqlcode')||undefined,'sqlName':_0x5152c7[_0x3c4cb6(0x18d)]('sqlname')||undefined,'dbId':_0x4c7016[_0x3c4cb6(0x1b1)],'description':_0x5152c7[_0x3c4cb6(0x18d)]('description')||undefined});if(_0x101b6a[_0x3c4cb6(0x1ab)])return{'ok':![],'data':_0x101b6a,'message':_0x101b6a['message']||_0x3c4cb6(0x191)};return{'ok':!![],'data':{'sqlCode':_0x101b6a[_0x3c4cb6(0x193)],'sqlName':_0x101b6a['sqlName'],'action':_0x101b6a[_0x3c4cb6(0x1b4)]},'message':(_0x101b6a[_0x3c4cb6(0x1b4)]==='created'?_0x3c4cb6(0x192):_0x3c4cb6(0x1a0))+_0x3c4cb6(0x1a6)+(_0x101b6a[_0x3c4cb6(0x193)]?'\x20('+_0x101b6a['sqlCode']+')':'')};}};
@@ -1 +1 @@
1
- const a86_0x34ea46=a86_0x30ca;(function(_0x4619b6,_0x27ae5f){const _0x3b242a=a86_0x30ca,_0x3886db=_0x4619b6();while(!![]){try{const _0x3ef7c1=-parseInt(_0x3b242a(0x104))/0x1*(parseInt(_0x3b242a(0xe1))/0x2)+parseInt(_0x3b242a(0xd9))/0x3+parseInt(_0x3b242a(0xe3))/0x4*(parseInt(_0x3b242a(0xe2))/0x5)+parseInt(_0x3b242a(0xe8))/0x6+parseInt(_0x3b242a(0xf5))/0x7*(parseInt(_0x3b242a(0xe6))/0x8)+-parseInt(_0x3b242a(0xe9))/0x9+-parseInt(_0x3b242a(0xff))/0xa;if(_0x3ef7c1===_0x27ae5f)break;else _0x3886db['push'](_0x3886db['shift']());}catch(_0x2189f5){_0x3886db['push'](_0x3886db['shift']());}}}(a86_0x5c75,0xc7ee2));import{readFileSync,existsSync}from'node:fs';function a86_0x5c75(){const _0x18ac77=['Provide\x20--file\x20or\x20--sql','validate','cwd','isArray','utf-8','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','10hEUNiq','93315xOibrd','80GtPTPO','\x22\x20not\x20found\x20in\x20any\x20dataset','read','32sJTbYD','valid','3990468LSvYMw','7734681wInfrH','File\x20not\x20found:\x20','push','toLowerCase','string','trim','message','from','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','validation','dbtableConfig','reason','2707187afGpZh','map','str','split','filter','name','sqlType','schemaWarnings','\x22\x20not\x20found\x20or\x20not\x20accessible','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','9580740cVgDWD','type','fields','tableName','parameters','99628juGrnL','file','size','tables','schemas','get','Dataset\x20\x22','flagMissing','Table\x20\x22','appCode','1647705dfwVOx','sql'];a86_0x5c75=function(){return _0x18ac77;};return a86_0x5c75();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a86_0x30ca(_0x108372,_0x3796f2){_0x108372=_0x108372-0xd0;const _0x5c7587=a86_0x5c75();let _0x30ca2b=_0x5c7587[_0x108372];return _0x30ca2b;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a86_0x34ea46(0xda),'command':a86_0x34ea46(0xdc),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a86_0x34ea46(0xe5),'flags':[{'name':a86_0x34ea46(0xd0),'type':a86_0x34ea46(0xed),'description':a86_0x34ea46(0xe0)},{'name':a86_0x34ea46(0xda),'type':a86_0x34ea46(0xed),'description':a86_0x34ea46(0xf1)},{'name':a86_0x34ea46(0xd3),'type':a86_0x34ea46(0xed),'description':a86_0x34ea46(0xfe)}],async 'execute'(_0xaf33df){const _0x19fddd=a86_0x34ea46,_0x5a6219=_0xaf33df[_0x19fddd(0xf7)](_0x19fddd(0xd0)),_0x2f3669=_0xaf33df[_0x19fddd(0xf7)]('sql');if(!_0x5a6219&&!_0x2f3669)throw CliErrors[_0x19fddd(0xd6)](_0x19fddd(0xd0),_0x19fddd(0xdb));let _0x34e355;if(_0x5a6219){const _0x519b13=resolve(process[_0x19fddd(0xdd)](),_0x5a6219);if(!existsSync(_0x519b13))throw CliErrors[_0x19fddd(0xf2)](_0x19fddd(0xea)+_0x519b13);_0x34e355=readFileSync(_0x519b13,_0x19fddd(0xdf));}else _0x34e355=_0x2f3669;const _0x57ae53=validateSql(_0x34e355),_0x15acdc={'valid':_0x57ae53[_0x19fddd(0xe7)],'sqlType':_0x57ae53[_0x19fddd(0xfb)][_0x19fddd(0x100)],'isSelectOnly':_0x57ae53[_0x19fddd(0xfb)]['isSelectOnly'],'isDangerous':_0x57ae53['sqlType']['isDangerous'],'tables':_0x57ae53[_0x19fddd(0xd2)],'parameters':_0x57ae53[_0x19fddd(0x103)],'message':_0x57ae53[_0x19fddd(0xef)]};_0x57ae53['sqlType']['reason']&&(_0x15acdc[_0x19fddd(0xf4)]=_0x57ae53[_0x19fddd(0xfb)][_0x19fddd(0xf4)]);const _0x149e03=_0xaf33df[_0x19fddd(0xf7)]('schemas');if(_0x149e03&&_0x57ae53[_0x19fddd(0xe7)]){const _0x86ab64=_0x149e03[_0x19fddd(0xf8)](',')[_0x19fddd(0xf6)](_0x2a28d5=>_0x2a28d5[_0x19fddd(0xee)]())[_0x19fddd(0xf9)](Boolean),_0x40ed3b=[],_0x33bb08=await listDatasets(_0xaf33df[_0x19fddd(0xd8)]),_0x1405b5=new Map(_0x33bb08[_0x19fddd(0xf6)](_0xef0e10=>[_0xef0e10[_0x19fddd(0xf3)]?.['tableName']?.[_0x19fddd(0xec)](),_0xef0e10]));for(const _0x59db45 of _0x57ae53[_0x19fddd(0xd2)]){const _0xef6d23=_0x1405b5[_0x19fddd(0xd4)](_0x59db45[_0x19fddd(0xec)]());!_0xef6d23&&_0x40ed3b[_0x19fddd(0xeb)](_0x19fddd(0xd7)+_0x59db45+_0x19fddd(0xe4));}for(const _0xadc4 of _0x86ab64){try{const _0xa63e7d=await getDatasetDetail(_0xadc4),_0x3b15a0=Array[_0x19fddd(0xde)](_0xa63e7d[_0x19fddd(0x101)])?_0xa63e7d['fields']:[],_0x56a793=new Set(_0x3b15a0[_0x19fddd(0xf6)](_0x14829f=>_0x14829f[_0x19fddd(0xfa)]?.[_0x19fddd(0xec)]())),_0x52a504=_0xa63e7d[_0x19fddd(0xf3)]?.[_0x19fddd(0x102)]||_0xa63e7d['tableName']||_0xadc4;_0x15acdc['schema:'+_0x52a504]={'code':_0xadc4,'tableName':_0x52a504,'fieldCount':_0x56a793[_0x19fddd(0xd1)],'fields':Array[_0x19fddd(0xf0)](_0x56a793)};}catch{_0x40ed3b[_0x19fddd(0xeb)](_0x19fddd(0xd5)+_0xadc4+_0x19fddd(0xfd));}}_0x40ed3b['length']>0x0&&(_0x15acdc[_0x19fddd(0xfc)]=_0x40ed3b);}return{'ok':_0x57ae53[_0x19fddd(0xe7)],'data':_0x15acdc,'message':_0x57ae53[_0x19fddd(0xef)]};}};
1
+ const a86_0x343c38=a86_0x3ff9;function a86_0x4629(){const _0xc686b4=['filter','split','854676OKSILc','validate','push','valid','string','type','str','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','toLowerCase','File\x20not\x20found:\x20','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','3224OYRiry','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isDangerous','10215NbHaMt','appCode','isArray','22flDfjF','flagMissing','map','9032652XsmJGw','\x22\x20not\x20found\x20in\x20any\x20dataset','sql','dbtableConfig','637076fwQmuE','36GvYMAD','isSelectOnly','validation','Provide\x20--file\x20or\x20--sql','tableName','message','sqlType','read','schemas','tables','name','70ziFIZB','reason','1799718QQjiEj','file','\x22\x20not\x20found\x20or\x20not\x20accessible','29555PeBUmZ','10mabPqu','schema:','utf-8','63846eydfly','fields'];a86_0x4629=function(){return _0xc686b4;};return a86_0x4629();}(function(_0x449447,_0x28e18c){const _0x237d28=a86_0x3ff9,_0xd1319e=_0x449447();while(!![]){try{const _0x51dedf=parseInt(_0x237d28(0x133))/0x1+-parseInt(_0x237d28(0x14f))/0x2*(-parseInt(_0x237d28(0x13a))/0x3)+parseInt(_0x237d28(0x126))/0x4*(-parseInt(_0x237d28(0x136))/0x5)+-parseInt(_0x237d28(0x13e))/0x6*(parseInt(_0x237d28(0x131))/0x7)+-parseInt(_0x237d28(0x149))/0x8*(parseInt(_0x237d28(0x14c))/0x9)+parseInt(_0x237d28(0x137))/0xa*(parseInt(_0x237d28(0x125))/0xb)+parseInt(_0x237d28(0x152))/0xc;if(_0x51dedf===_0x28e18c)break;else _0xd1319e['push'](_0xd1319e['shift']());}catch(_0x5f3d5f){_0xd1319e['push'](_0xd1319e['shift']());}}}(a86_0x4629,0xde051));import{readFileSync,existsSync}from'node:fs';function a86_0x3ff9(_0x1e51fd,_0xf0e7c4){_0x1e51fd=_0x1e51fd-0x122;const _0x462943=a86_0x4629();let _0x3ff9e5=_0x462943[_0x1e51fd];return _0x3ff9e5;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a86_0x343c38(0x123),'command':a86_0x343c38(0x13f),'description':a86_0x343c38(0x148),'risk':a86_0x343c38(0x12d),'flags':[{'name':a86_0x343c38(0x134),'type':a86_0x343c38(0x142),'description':a86_0x343c38(0x145)},{'name':a86_0x343c38(0x123),'type':a86_0x343c38(0x142),'description':a86_0x343c38(0x14a)},{'name':a86_0x343c38(0x12e),'type':a86_0x343c38(0x142),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x172f92){const _0x3c337c=a86_0x343c38,_0x34d596=_0x172f92[_0x3c337c(0x144)](_0x3c337c(0x134)),_0x2ed46d=_0x172f92['str'](_0x3c337c(0x123));if(!_0x34d596&&!_0x2ed46d)throw CliErrors[_0x3c337c(0x150)](_0x3c337c(0x134),_0x3c337c(0x129));let _0x164760;if(_0x34d596){const _0xea32eb=resolve(process['cwd'](),_0x34d596);if(!existsSync(_0xea32eb))throw CliErrors[_0x3c337c(0x128)](_0x3c337c(0x147)+_0xea32eb);_0x164760=readFileSync(_0xea32eb,_0x3c337c(0x139));}else _0x164760=_0x2ed46d;const _0x2bf1e2=validateSql(_0x164760),_0x31c1e0={'valid':_0x2bf1e2[_0x3c337c(0x141)],'sqlType':_0x2bf1e2['sqlType'][_0x3c337c(0x143)],'isSelectOnly':_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x127)],'isDangerous':_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x14b)],'tables':_0x2bf1e2[_0x3c337c(0x12f)],'parameters':_0x2bf1e2['parameters'],'message':_0x2bf1e2['message']};_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x132)]&&(_0x31c1e0['reason']=_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x132)]);const _0x5b2d06=_0x172f92['str']('schemas');if(_0x5b2d06&&_0x2bf1e2[_0x3c337c(0x141)]){const _0x1d4f76=_0x5b2d06[_0x3c337c(0x13d)](',')['map'](_0x31ca23=>_0x31ca23['trim']())[_0x3c337c(0x13c)](Boolean),_0x346b8a=[],_0x2d363e=await listDatasets(_0x172f92[_0x3c337c(0x14d)]),_0xd619d1=new Map(_0x2d363e[_0x3c337c(0x151)](_0x3a310c=>[_0x3a310c[_0x3c337c(0x124)]?.[_0x3c337c(0x12a)]?.[_0x3c337c(0x146)](),_0x3a310c]));for(const _0xab74ec of _0x2bf1e2[_0x3c337c(0x12f)]){const _0x33511c=_0xd619d1['get'](_0xab74ec[_0x3c337c(0x146)]());!_0x33511c&&_0x346b8a[_0x3c337c(0x140)]('Table\x20\x22'+_0xab74ec+_0x3c337c(0x122));}for(const _0x2468f8 of _0x1d4f76){try{const _0x32fd45=await getDatasetDetail(_0x2468f8),_0x1b31b3=Array[_0x3c337c(0x14e)](_0x32fd45[_0x3c337c(0x13b)])?_0x32fd45[_0x3c337c(0x13b)]:[],_0x4c56fc=new Set(_0x1b31b3[_0x3c337c(0x151)](_0x8b03fd=>_0x8b03fd[_0x3c337c(0x130)]?.[_0x3c337c(0x146)]())),_0x1a3b8d=_0x32fd45[_0x3c337c(0x124)]?.[_0x3c337c(0x12a)]||_0x32fd45[_0x3c337c(0x12a)]||_0x2468f8;_0x31c1e0[_0x3c337c(0x138)+_0x1a3b8d]={'code':_0x2468f8,'tableName':_0x1a3b8d,'fieldCount':_0x4c56fc['size'],'fields':Array['from'](_0x4c56fc)};}catch{_0x346b8a[_0x3c337c(0x140)]('Dataset\x20\x22'+_0x2468f8+_0x3c337c(0x135));}}_0x346b8a['length']>0x0&&(_0x31c1e0['schemaWarnings']=_0x346b8a);}return{'ok':_0x2bf1e2[_0x3c337c(0x141)],'data':_0x31c1e0,'message':_0x2bf1e2[_0x3c337c(0x12b)]};}};
@@ -1 +1 @@
1
- const a87_0x186a16=a87_0x182f;(function(_0x14d207,_0x241ad1){const _0xcfd8da=a87_0x182f,_0x212bc1=_0x14d207();while(!![]){try{const _0x3a2c6c=-parseInt(_0xcfd8da(0xa1))/0x1*(-parseInt(_0xcfd8da(0xbb))/0x2)+-parseInt(_0xcfd8da(0xa2))/0x3*(parseInt(_0xcfd8da(0xba))/0x4)+parseInt(_0xcfd8da(0x9c))/0x5+-parseInt(_0xcfd8da(0x89))/0x6*(parseInt(_0xcfd8da(0xb4))/0x7)+parseInt(_0xcfd8da(0x8f))/0x8+parseInt(_0xcfd8da(0x93))/0x9+-parseInt(_0xcfd8da(0xaf))/0xa*(parseInt(_0xcfd8da(0xc5))/0xb);if(_0x3a2c6c===_0x241ad1)break;else _0x212bc1['push'](_0x212bc1['shift']());}catch(_0x9768d0){_0x212bc1['push'](_0x212bc1['shift']());}}}(a87_0x2a58,0xb93dd));export const CLI_BIN_NAME=a87_0x186a16(0xc1);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME=a87_0x186a16(0xb0);export const GLOBAL_FLAGS=[{'name':a87_0x186a16(0xcb),'meowKey':a87_0x186a16(0xcb),'type':a87_0x186a16(0x82),'description':'Override\x20appcode','hint':a87_0x186a16(0xbd)},{'name':a87_0x186a16(0x99),'meowKey':a87_0x186a16(0x99),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0x98),'hint':a87_0x186a16(0x97)},{'name':a87_0x186a16(0x9f),'meowKey':a87_0x186a16(0x9f),'type':'string','description':a87_0x186a16(0x94),'hint':a87_0x186a16(0xb6)},{'name':a87_0x186a16(0xd3),'meowKey':a87_0x186a16(0xd3),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xb5),'hint':a87_0x186a16(0x83)},{'name':'jq','meowKey':'jq','type':'string','description':a87_0x186a16(0xdc),'hint':a87_0x186a16(0x81)},{'name':a87_0x186a16(0xae),'meowKey':a87_0x186a16(0x9a),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x92)},{'name':a87_0x186a16(0xdd),'meowKey':a87_0x186a16(0xdd),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x9d)},{'name':a87_0x186a16(0x96),'meowKey':a87_0x186a16(0xbf),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0xb8)},{'name':'global','meowKey':a87_0x186a16(0x7e),'type':'boolean','description':a87_0x186a16(0xc4)},{'name':'project','meowKey':a87_0x186a16(0xb3),'type':'boolean','description':a87_0x186a16(0xa3)},{'name':'ci','meowKey':'ci','type':a87_0x186a16(0xe2),'description':a87_0x186a16(0xa4),'hidden':!![]},{'name':a87_0x186a16(0x88),'meowKey':a87_0x186a16(0x88),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0xc3)},{'name':a87_0x186a16(0xc2),'meowKey':a87_0x186a16(0xc2),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xa5),'hidden':!![]},{'name':a87_0x186a16(0xb9),'meowKey':a87_0x186a16(0xb9),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x95),'hidden':!![]},{'name':a87_0x186a16(0xe3),'meowKey':a87_0x186a16(0xe3),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x8d),'hidden':!![]},{'name':a87_0x186a16(0xc6),'meowKey':'output','type':a87_0x186a16(0x82),'description':'Output\x20path','hidden':!![]},{'name':a87_0x186a16(0x87),'meowKey':'params','type':a87_0x186a16(0x82),'description':a87_0x186a16(0xc7),'hidden':!![]},{'name':a87_0x186a16(0xac),'meowKey':'datasetcode','type':a87_0x186a16(0x82),'description':a87_0x186a16(0xbc),'hidden':!![]},{'name':a87_0x186a16(0xcc),'meowKey':a87_0x186a16(0xcc),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0xdb),'hidden':!![]},{'name':a87_0x186a16(0xa0),'meowKey':'enableBffSave','type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x8e),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x186a16(0x82),'description':a87_0x186a16(0xc8),'hidden':!![]},{'name':'type','meowKey':a87_0x186a16(0xa8),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xc0),'hidden':!![]},{'name':a87_0x186a16(0xcf),'meowKey':'file','type':a87_0x186a16(0x82),'description':a87_0x186a16(0x85),'hidden':!![]},{'name':a87_0x186a16(0xd9),'meowKey':a87_0x186a16(0xd9),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xdf),'hidden':!![]},{'name':a87_0x186a16(0x7f),'meowKey':'sqlname','type':'string','description':a87_0x186a16(0xa7),'hidden':!![]},{'name':a87_0x186a16(0xd7),'meowKey':a87_0x186a16(0xd7),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xde),'hidden':!![]},{'name':a87_0x186a16(0xd0),'meowKey':a87_0x186a16(0xd0),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xd5),'hidden':!![]},{'name':a87_0x186a16(0xb2),'meowKey':a87_0x186a16(0xb2),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0x8a),'hidden':!![]},{'name':a87_0x186a16(0xe0),'meowKey':a87_0x186a16(0xe0),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xda),'hidden':!![]},{'name':a87_0x186a16(0xce),'meowKey':'keyword','type':a87_0x186a16(0x82),'description':'Keyword\x20filter','hidden':!![]},{'name':a87_0x186a16(0x80),'meowKey':'code','type':a87_0x186a16(0x82),'description':a87_0x186a16(0xc9),'hidden':!![]},{'name':'sql','meowKey':a87_0x186a16(0x86),'type':a87_0x186a16(0x82),'description':'SQL\x20string','hidden':!![]},{'name':'schemas','meowKey':a87_0x186a16(0xd8),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xcd),'hidden':!![]},{'name':a87_0x186a16(0xe1),'meowKey':a87_0x186a16(0xe1),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xb1),'hidden':!![]},{'name':'target','meowKey':a87_0x186a16(0xa6),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xad),'hidden':!![]},{'name':a87_0x186a16(0xa9),'meowKey':a87_0x186a16(0xd2),'type':'boolean','description':a87_0x186a16(0x8b),'hidden':!![]},{'name':a87_0x186a16(0xbe),'meowKey':a87_0x186a16(0xbe),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0xaa),'hidden':!![]},{'name':a87_0x186a16(0xab),'meowKey':a87_0x186a16(0xab),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0x9e),'hidden':!![]},{'name':a87_0x186a16(0xb7),'meowKey':a87_0x186a16(0xb7),'type':a87_0x186a16(0xe2),'description':'Force\x20overwrite','hidden':!![]},{'name':a87_0x186a16(0xd6),'meowKey':a87_0x186a16(0xd6),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x91),'hidden':!![]},{'name':a87_0x186a16(0x9b),'meowKey':a87_0x186a16(0x9b),'type':a87_0x186a16(0xe2),'description':a87_0x186a16(0x84),'hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':a87_0x186a16(0x82),'description':a87_0x186a16(0xb1),'hidden':!![]},{'name':'function-node','meowKey':a87_0x186a16(0xd1),'type':a87_0x186a16(0x82),'description':a87_0x186a16(0x90),'hidden':!![]}];function a87_0x182f(_0x1a2551,_0xdcf8d){_0x1a2551=_0x1a2551-0x7e;const _0x2a5822=a87_0x2a58();let _0x182f78=_0x2a5822[_0x1a2551];return _0x182f78;}function a87_0x2a58(){const _0x527b27=['Page\x20number','Skip\x20import\x20generation','map','Watch\x20mode','Enable\x20BFF\x20save','6622608dnovOv','Function\x20node','Use\x20remote','Preview\x20operation\x20without\x20executing','9013869GrXUni','Environment','Clear','non-interactive','<name>','Select\x20app\x20profile\x20by\x20name','app','dryRun','verbose','6015375ZwZWhe','Skip\x20confirmation\x20for\x20high-risk\x20writes','Config\x20value','env','enable-bff-save','7bvrjqz','3SRakfb','Use\x20project\x20config\x20scope','Alias\x20for\x20--non-interactive','Name','target','SQL\x20name','type','skip-imports','Config\x20key','value','datasetcode','Target\x20path','dry-run','771610kVbMau','@lovrabet/rabetbase-cli','Operation\x20type','page','project','518ERZEiN','Output\x20format','production\x20|\x20daily','force','Force\x20non-interactive\x20mode\x20(CI)','clear','3020604koVNhX','50674RoqpNx','Dataset\x20code','<code>','key','nonInteractive','Type\x20filter','rabetbase','name','Show\x20help','Use\x20global\x20config\x20scope','55gznWCR','output','JSON\x20params','Record\x20ID','Code\x20filter','meowKey','appcode','all','Schemas','keyword','file','description','functionNode','skipImports','format','fromEntries','Description','remote','dbid','schemas','sqlcode','Page\x20size','Apply\x20to\x20all','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','yes','DB\x20ID','SQL\x20code','pagesize','operation','boolean','watch','global','sqlname','code','<expr>','string','json\x20|\x20pretty\x20|\x20compress','Verbose\x20output','File\x20path','sql','params','help','106224ZkboiI'];a87_0x2a58=function(){return _0x527b27;};return a87_0x2a58();}export function buildMeowFlags(){const _0x300028=a87_0x186a16;return Object[_0x300028(0xd4)](GLOBAL_FLAGS[_0x300028(0x8c)](_0x58e641=>[_0x58e641[_0x300028(0xca)],{'type':_0x58e641[_0x300028(0xa8)]}]));}
1
+ const a87_0x3b5edb=a87_0x49eb;function a87_0x49eb(_0x3b3039,_0x2b9d0e){_0x3b3039=_0x3b3039-0xf9;const _0x5a9f2d=a87_0x5a9f();let _0x49eb88=_0x5a9f2d[_0x3b3039];return _0x49eb88;}function a87_0x5a9f(){const _0x8d43f=['env','SQL\x20string','appcode','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','description','File\x20path','yes','86hMTaHT','Show\x20help','format','Force\x20overwrite','dbid','function-node','Override\x20appcode','Environment','skipImports','app','dryRun','operation','pagesize','sqlname','enable-bff-save','10qxAzxB','clear','Config\x20value','Apply\x20to\x20all','Page\x20size','Clear','8DBkIEZ','remote','skip-imports','sqlcode','key','Keyword\x20filter','170TKUFVt','Name','map','value','page','rabetbase','project','Rabetbase\x20CLI','output','target','code','Page\x20number','dry-run','help','Record\x20ID','Preview\x20operation\x20without\x20executing','Enable\x20BFF\x20save','Config\x20key','Output\x20path','meowKey','Alias\x20for\x20--non-interactive','params','verbose','SQL\x20code','Use\x20project\x20config\x20scope','string','functionNode','17961VeYUFw','all','JSON\x20params','Type\x20filter','2594067gcUZCb','sql','3186372uYJpew','<expr>','Schemas','datasetcode','719140mjWIWm','watch','467253JEjqDE','boolean','schemas','<name>','Watch\x20mode','Operation\x20type','non-interactive','Verbose\x20output','file','name','17061363yMvjIW','Function\x20node','2313lnpGzz','Skip\x20import\x20generation','force','Output\x20format','SQL\x20name','keyword'];a87_0x5a9f=function(){return _0x8d43f;};return a87_0x5a9f();}(function(_0x3e317e,_0x54af10){const _0xcf6ba3=a87_0x49eb,_0x9d9205=_0x3e317e();while(!![]){try{const _0x95cec9=parseInt(_0xcf6ba3(0x144))/0x1+parseInt(_0xcf6ba3(0x102))/0x2*(-parseInt(_0xcf6ba3(0x138))/0x3)+-parseInt(_0xcf6ba3(0x142))/0x4*(parseInt(_0xcf6ba3(0x111))/0x5)+-parseInt(_0xcf6ba3(0x13e))/0x6+parseInt(_0xcf6ba3(0x13c))/0x7*(-parseInt(_0xcf6ba3(0x117))/0x8)+-parseInt(_0xcf6ba3(0x150))/0x9*(-parseInt(_0xcf6ba3(0x11d))/0xa)+parseInt(_0xcf6ba3(0x14e))/0xb;if(_0x95cec9===_0x54af10)break;else _0x9d9205['push'](_0x9d9205['shift']());}catch(_0x23cc6e){_0x9d9205['push'](_0x9d9205['shift']());}}}(a87_0x5a9f,0x7b0c1));export const CLI_BIN_NAME=a87_0x3b5edb(0x122);export const CLI_DISPLAY_NAME=a87_0x3b5edb(0x124);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a87_0x3b5edb(0xfd),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x108),'hint':'<code>'},{'name':a87_0x3b5edb(0x10b),'meowKey':a87_0x3b5edb(0x10b),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a87_0x3b5edb(0x147)},{'name':a87_0x3b5edb(0xfb),'meowKey':a87_0x3b5edb(0xfb),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x109),'hint':'production\x20|\x20daily'},{'name':a87_0x3b5edb(0x104),'meowKey':'format','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x153),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0xfe),'hint':a87_0x3b5edb(0x13f)},{'name':a87_0x3b5edb(0x129),'meowKey':a87_0x3b5edb(0x10c),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x12c)},{'name':'yes','meowKey':a87_0x3b5edb(0x101),'type':a87_0x3b5edb(0x145),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a87_0x3b5edb(0x14a),'meowKey':'nonInteractive','type':a87_0x3b5edb(0x145),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':'global','type':a87_0x3b5edb(0x145),'description':'Use\x20global\x20config\x20scope'},{'name':a87_0x3b5edb(0x123),'meowKey':a87_0x3b5edb(0x123),'type':'boolean','description':a87_0x3b5edb(0x135)},{'name':'ci','meowKey':'ci','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x131),'hidden':!![]},{'name':a87_0x3b5edb(0x12a),'meowKey':'help','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x103)},{'name':a87_0x3b5edb(0x14d),'meowKey':a87_0x3b5edb(0x14d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x11e),'hidden':!![]},{'name':a87_0x3b5edb(0x112),'meowKey':a87_0x3b5edb(0x112),'type':'boolean','description':a87_0x3b5edb(0x116),'hidden':!![]},{'name':a87_0x3b5edb(0x143),'meowKey':a87_0x3b5edb(0x143),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x148),'hidden':!![]},{'name':'output','meowKey':a87_0x3b5edb(0x125),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12f),'hidden':!![]},{'name':'params','meowKey':a87_0x3b5edb(0x132),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x13a),'hidden':!![]},{'name':a87_0x3b5edb(0x141),'meowKey':a87_0x3b5edb(0x141),'type':a87_0x3b5edb(0x136),'description':'Dataset\x20code','hidden':!![]},{'name':a87_0x3b5edb(0x139),'meowKey':a87_0x3b5edb(0x139),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x114),'hidden':!![]},{'name':a87_0x3b5edb(0x110),'meowKey':'enableBffSave','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x12d),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12b),'hidden':!![]},{'name':'type','meowKey':'type','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x13b),'hidden':!![]},{'name':a87_0x3b5edb(0x14c),'meowKey':a87_0x3b5edb(0x14c),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x100),'hidden':!![]},{'name':'sqlcode','meowKey':a87_0x3b5edb(0x11a),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x134),'hidden':!![]},{'name':a87_0x3b5edb(0x10f),'meowKey':'sqlname','type':'string','description':a87_0x3b5edb(0xf9),'hidden':!![]},{'name':a87_0x3b5edb(0x106),'meowKey':a87_0x3b5edb(0x106),'type':'string','description':'DB\x20ID','hidden':!![]},{'name':a87_0x3b5edb(0xff),'meowKey':a87_0x3b5edb(0xff),'type':a87_0x3b5edb(0x136),'description':'Description','hidden':!![]},{'name':a87_0x3b5edb(0x121),'meowKey':a87_0x3b5edb(0x121),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x128),'hidden':!![]},{'name':a87_0x3b5edb(0x10e),'meowKey':a87_0x3b5edb(0x10e),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x115),'hidden':!![]},{'name':a87_0x3b5edb(0xfa),'meowKey':a87_0x3b5edb(0xfa),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x11c),'hidden':!![]},{'name':a87_0x3b5edb(0x127),'meowKey':a87_0x3b5edb(0x127),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':'sql','meowKey':a87_0x3b5edb(0x13d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0xfc),'hidden':!![]},{'name':a87_0x3b5edb(0x146),'meowKey':a87_0x3b5edb(0x146),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x140),'hidden':!![]},{'name':a87_0x3b5edb(0x10d),'meowKey':a87_0x3b5edb(0x10d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x149),'hidden':!![]},{'name':a87_0x3b5edb(0x126),'meowKey':'target','type':a87_0x3b5edb(0x136),'description':'Target\x20path','hidden':!![]},{'name':a87_0x3b5edb(0x119),'meowKey':a87_0x3b5edb(0x10a),'type':'boolean','description':a87_0x3b5edb(0x151),'hidden':!![]},{'name':a87_0x3b5edb(0x11b),'meowKey':a87_0x3b5edb(0x11b),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12e),'hidden':!![]},{'name':a87_0x3b5edb(0x120),'meowKey':'value','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x113),'hidden':!![]},{'name':a87_0x3b5edb(0x152),'meowKey':a87_0x3b5edb(0x152),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x105),'hidden':!![]},{'name':'remote','meowKey':a87_0x3b5edb(0x118),'type':a87_0x3b5edb(0x145),'description':'Use\x20remote','hidden':!![]},{'name':a87_0x3b5edb(0x133),'meowKey':'verbose','type':'boolean','description':a87_0x3b5edb(0x14b),'hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':'string','description':a87_0x3b5edb(0x149),'hidden':!![]},{'name':a87_0x3b5edb(0x107),'meowKey':a87_0x3b5edb(0x137),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x14f),'hidden':!![]}];export function buildMeowFlags(){const _0x395a0e=a87_0x3b5edb;return Object['fromEntries'](GLOBAL_FLAGS[_0x395a0e(0x11f)](_0x343161=>[_0x343161[_0x395a0e(0x130)],{'type':_0x343161['type']}]));}
@@ -1 +1 @@
1
- const a88_0x5856b6=a88_0x6f55;(function(_0x5dbf6,_0x48496b){const _0x1ad444=a88_0x6f55,_0x51f396=_0x5dbf6();while(!![]){try{const _0x5ca62e=-parseInt(_0x1ad444(0xb2))/0x1*(parseInt(_0x1ad444(0xab))/0x2)+-parseInt(_0x1ad444(0xb3))/0x3*(parseInt(_0x1ad444(0xb0))/0x4)+-parseInt(_0x1ad444(0xb1))/0x5+-parseInt(_0x1ad444(0xb9))/0x6+-parseInt(_0x1ad444(0xbb))/0x7*(-parseInt(_0x1ad444(0xaf))/0x8)+-parseInt(_0x1ad444(0xb8))/0x9*(parseInt(_0x1ad444(0xb6))/0xa)+parseInt(_0x1ad444(0xac))/0xb*(parseInt(_0x1ad444(0xad))/0xc);if(_0x5ca62e===_0x48496b)break;else _0x51f396['push'](_0x51f396['shift']());}catch(_0xc0baa){_0x51f396['push'](_0x51f396['shift']());}}}(a88_0x59f0,0x25fc8));function a88_0x59f0(){const _0x5d2b32=['167211lqILAp','468BIELdg','https://user-daily.lovrabet.com','56pdsWmz','8EICnpC','327865WYFLWW','106761VftdNQ','52293bzUMCU','https://runtime.lovrabet.com','https://daily-api.lovrabet.com','2564670rFDMDq','https://user.lovrabet.com','9syceZK','100032TRzLjw','apiDomain','149849fFqgSQ','https://api.lovrabet.com','runtimeDomain','production','https://daily-runtime.lovrabet.com','4DlOldI'];a88_0x59f0=function(){return _0x5d2b32;};return a88_0x59f0();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x4294df){const _0x38869e=a88_0x6f55;customApiDomain=_0x4294df?.[_0x38869e(0xba)],customUserDomain=_0x4294df?.['userDomain'],customRuntimeDomain=_0x4294df?.[_0x38869e(0xbd)];}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x5856b6(0xbe)?a88_0x5856b6(0xb7):a88_0x5856b6(0xae));export const getApiDomain=()=>customApiDomain||(getEnv()==='production'?a88_0x5856b6(0xbc):a88_0x5856b6(0xb5));function a88_0x6f55(_0x14affb,_0x2bc969){_0x14affb=_0x14affb-0xab;const _0x59f065=a88_0x59f0();let _0x6f55b4=_0x59f065[_0x14affb];return _0x6f55b4;}export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()==='production'?a88_0x5856b6(0xb4):a88_0x5856b6(0xbf));
1
+ const a88_0x67da57=a88_0x17b7;(function(_0x4f97a6,_0x156868){const _0x3fd175=a88_0x17b7,_0x4beb41=_0x4f97a6();while(!![]){try{const _0x3958bc=-parseInt(_0x3fd175(0x1ef))/0x1*(-parseInt(_0x3fd175(0x1e2))/0x2)+parseInt(_0x3fd175(0x1e8))/0x3*(parseInt(_0x3fd175(0x1ea))/0x4)+-parseInt(_0x3fd175(0x1ee))/0x5+-parseInt(_0x3fd175(0x1e7))/0x6+parseInt(_0x3fd175(0x1f0))/0x7*(-parseInt(_0x3fd175(0x1e1))/0x8)+parseInt(_0x3fd175(0x1f3))/0x9+parseInt(_0x3fd175(0x1e6))/0xa*(parseInt(_0x3fd175(0x1e4))/0xb);if(_0x3958bc===_0x156868)break;else _0x4beb41['push'](_0x4beb41['shift']());}catch(_0x503a49){_0x4beb41['push'](_0x4beb41['shift']());}}}(a88_0x31b4,0x46eb5));function a88_0x31b4(){const _0x259192=['https://daily-api.lovrabet.com','18330XDDezS','3272802hlFzpv','3QCDzRm','https://api.lovrabet.com','288712BbSkxQ','apiDomain','https://runtime.lovrabet.com','https://daily-runtime.lovrabet.com','96595Wbhpql','13mPIout','434RSlINJ','production','runtimeDomain','2205576sLzwiB','11192PToQyy','44794nfffyo','https://user-daily.lovrabet.com','2002kGjCjs'];a88_0x31b4=function(){return _0x259192;};return a88_0x31b4();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x157198){const _0x251c2a=a88_0x17b7;customApiDomain=_0x157198?.[_0x251c2a(0x1eb)],customUserDomain=_0x157198?.['userDomain'],customRuntimeDomain=_0x157198?.[_0x251c2a(0x1f2)];}function a88_0x17b7(_0x310261,_0x50d926){_0x310261=_0x310261-0x1e1;const _0x31b492=a88_0x31b4();let _0x17b7bd=_0x31b492[_0x310261];return _0x17b7bd;}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x67da57(0x1f1)?'https://user.lovrabet.com':a88_0x67da57(0x1e3));export const getApiDomain=()=>customApiDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1e9):a88_0x67da57(0x1e5));export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1ec):a88_0x67da57(0x1ed));
@@ -1 +1 @@
1
- const a89_0x3ce203=a89_0x53ee;(function(_0xc4ca9c,_0x9d8789){const _0x41b89d=a89_0x53ee,_0x455bda=_0xc4ca9c();while(!![]){try{const _0x13a69b=parseInt(_0x41b89d(0x19f))/0x1*(parseInt(_0x41b89d(0x19e))/0x2)+parseInt(_0x41b89d(0x19b))/0x3+-parseInt(_0x41b89d(0x198))/0x4+parseInt(_0x41b89d(0x19a))/0x5+parseInt(_0x41b89d(0x19c))/0x6+-parseInt(_0x41b89d(0x1a1))/0x7*(-parseInt(_0x41b89d(0x199))/0x8)+-parseInt(_0x41b89d(0x197))/0x9;if(_0x13a69b===_0x9d8789)break;else _0x455bda['push'](_0x455bda['shift']());}catch(_0x4536ea){_0x455bda['push'](_0x455bda['shift']());}}}(a89_0x42cb,0xeab3e));function a89_0x53ee(_0x311e53,_0x29a0a7){_0x311e53=_0x311e53-0x197;const _0x42cbd4=a89_0x42cb();let _0x53ee9c=_0x42cbd4[_0x311e53];return _0x53ee9c;}export function normalizeEnv(_0x5dc6c7){const _0x5b613a=a89_0x53ee;return _0x5dc6c7===_0x5b613a(0x1a0)?_0x5b613a(0x19d):_0x5dc6c7;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x3ce203(0x19d));export function getEnv(){return env;}function a89_0x42cb(){const _0x3e6e3b=['8813646AxOLfD','production','409346FRrzTU','8CktADk','online','8966251votbds','31804641rnldqh','3171708VcSiJq','8zunSgU','3226825tNHzoP','766605mXUSrN'];a89_0x42cb=function(){return _0x3e6e3b;};return a89_0x42cb();}export function initEnv(_0x1c551d){env=normalizeEnv(_0x1c551d);}
1
+ const a89_0x4e6af8=a89_0x12fe;(function(_0xc8e41f,_0x3d56d7){const _0x446730=a89_0x12fe,_0x127c95=_0xc8e41f();while(!![]){try{const _0x11a027=-parseInt(_0x446730(0x1f4))/0x1+parseInt(_0x446730(0x1f1))/0x2*(-parseInt(_0x446730(0x1f8))/0x3)+parseInt(_0x446730(0x1f9))/0x4+parseInt(_0x446730(0x1f0))/0x5+parseInt(_0x446730(0x1fa))/0x6+parseInt(_0x446730(0x1f3))/0x7*(parseInt(_0x446730(0x1f2))/0x8)+-parseInt(_0x446730(0x1ef))/0x9*(parseInt(_0x446730(0x1f5))/0xa);if(_0x11a027===_0x3d56d7)break;else _0x127c95['push'](_0x127c95['shift']());}catch(_0x176133){_0x127c95['push'](_0x127c95['shift']());}}}(a89_0x4b28,0x3fa41));export function normalizeEnv(_0x3d1836){const _0xbf5d27=a89_0x12fe;return _0x3d1836===_0xbf5d27(0x1f6)?_0xbf5d27(0x1f7):_0x3d1836;}function a89_0x4b28(){const _0x4043f7=['1430664fyWxla','14IuiYxB','25124zZbVZA','1149460yMfrdu','online','production','48ZTJeJR','658812DqvyeT','2423010SZyBIL','63UsCMRA','1587635zrKXyb','19164xZkwFS'];a89_0x4b28=function(){return _0x4043f7;};return a89_0x4b28();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x4e6af8(0x1f7));function a89_0x12fe(_0x5e163c,_0x494688){_0x5e163c=_0x5e163c-0x1ef;const _0x4b2848=a89_0x4b28();let _0x12fec4=_0x4b2848[_0x5e163c];return _0x12fec4;}export function getEnv(){return env;}export function initEnv(_0x5e9c71){env=normalizeEnv(_0x5e9c71);}
@@ -1 +1 @@
1
- const a90_0x7ba2be=a90_0x2504;function a90_0x2504(_0x532ae5,_0x44cd0f){_0x532ae5=_0x532ae5-0xa9;const _0x34fc89=a90_0x34fc();let _0x25049c=_0x34fc89[_0x532ae5];return _0x25049c;}function a90_0x34fc(){const _0x56cf7b=['15zrLjen','./src/api','7005504iJqQgn','110UvmDju','4857209PBsgmF','178096xBwotU','346602NKFkGK','282laRuxi','1000953sYHrnE','41032NOyaTu','24516xpXply'];a90_0x34fc=function(){return _0x56cf7b;};return a90_0x34fc();}(function(_0x50cb17,_0x562c37){const _0x3012e7=a90_0x2504,_0x52a1db=_0x50cb17();while(!![]){try{const _0x19fffa=-parseInt(_0x3012e7(0xa9))/0x1+-parseInt(_0x3012e7(0xad))/0x2+parseInt(_0x3012e7(0xab))/0x3*(-parseInt(_0x3012e7(0xae))/0x4)+parseInt(_0x3012e7(0xaf))/0x5*(parseInt(_0x3012e7(0xaa))/0x6)+parseInt(_0x3012e7(0xb3))/0x7+-parseInt(_0x3012e7(0xb1))/0x8+parseInt(_0x3012e7(0xac))/0x9*(parseInt(_0x3012e7(0xb2))/0xa);if(_0x19fffa===_0x562c37)break;else _0x52a1db['push'](_0x52a1db['shift']());}catch(_0x22c4b1){_0x52a1db['push'](_0x52a1db['shift']());}}}(a90_0x34fc,0x6b755));export const DEFAULT_API_DIR=a90_0x7ba2be(0xb0);
1
+ const a90_0x558a7d=a90_0x3a40;(function(_0x25a378,_0x15cc68){const _0x2584e0=a90_0x3a40,_0x1fa9f7=_0x25a378();while(!![]){try{const _0x4afb4e=-parseInt(_0x2584e0(0x110))/0x1*(parseInt(_0x2584e0(0x10d))/0x2)+-parseInt(_0x2584e0(0x10e))/0x3+-parseInt(_0x2584e0(0x10f))/0x4*(parseInt(_0x2584e0(0x113))/0x5)+parseInt(_0x2584e0(0x112))/0x6+-parseInt(_0x2584e0(0x10a))/0x7+parseInt(_0x2584e0(0x10c))/0x8+parseInt(_0x2584e0(0x111))/0x9;if(_0x4afb4e===_0x15cc68)break;else _0x1fa9f7['push'](_0x1fa9f7['shift']());}catch(_0x164b04){_0x1fa9f7['push'](_0x1fa9f7['shift']());}}}(a90_0x54e4,0x618aa));function a90_0x3a40(_0x2e009e,_0x4e0a63){_0x2e009e=_0x2e009e-0x10a;const _0x54e424=a90_0x54e4();let _0x3a40c1=_0x54e424[_0x2e009e];return _0x3a40c1;}function a90_0x54e4(){const _0x2f55e8=['2165889eJaJYA','16BTZhSh','28yporNm','13374477cBQEjc','2172066idXEUj','328835mtIxKT','3864560GIGBfO','./src/api','4901672cgIYCs','37438jyvaYp'];a90_0x54e4=function(){return _0x2f55e8;};return a90_0x54e4();}export const DEFAULT_API_DIR=a90_0x558a7d(0x10b);
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- function a91_0x55a9(){const _0x346f5c=['length','./constant/env.js','./utils/is-non-interactive.js','.rabetbase.json','1673usyCPa','read','find','entries','807204GYUlgv','write','trim','apiDomain','authRequired','api.ts','pageSize','APP','locale','stringify','1362255IsCyoD','empty','apiDir','runtimeDomain','7227608HZxuMN','appcode','\x0a\x20\x20','PAGE_SIZE','production','slice','defaultApp','180599KEZGlE','Global','riskLevel','RISK_LEVEL','setLogPath','./auth/get-cookie.js','ACCESS_KEY','userDomain','cwd','keys','Project','APPCODE','object','message','.lovrabet.json','MAX_RISK','COOKIE','true','setRawCommand','maxRisk','join','high-risk-write','status','./constant/domain.js','1687128UuqgEy','env','utf8','string','online','format','missing','VERBOSE','-api.ts','daily','error','en-US','parse','accessKey','app','apps','warn','cookie','15558Uygjtt','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','3024512CGikoq','.lovrabetrc','filter'];a91_0x55a9=function(){return _0x346f5c;};return a91_0x55a9();}const a91_0x1a9cc5=a91_0x52ca;(function(_0xaf6dfe,_0x4ac52d){const _0x36c322=a91_0x52ca,_0x1d9bd5=_0xaf6dfe();while(!![]){try{const _0x350eed=-parseInt(_0x36c322(0x1fe))/0x1+parseInt(_0x36c322(0x1e9))/0x2+-parseInt(_0x36c322(0x216))/0x3+parseInt(_0x36c322(0x1de))/0x4+parseInt(_0x36c322(0x1f3))/0x5+-parseInt(_0x36c322(0x1dc))/0x6*(-parseInt(_0x36c322(0x1e5))/0x7)+-parseInt(_0x36c322(0x1f7))/0x8;if(_0x350eed===_0x4ac52d)break;else _0x1d9bd5['push'](_0x1d9bd5['shift']());}catch(_0x815ce2){_0x1d9bd5['push'](_0x1d9bd5['shift']());}}}(a91_0x55a9,0x62fea));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';function a91_0x52ca(_0x471149,_0x290282){_0x471149=_0x471149-0x1d5;const _0x55a95d=a91_0x55a9();let _0x52ca95=_0x55a95d[_0x471149];return _0x52ca95;}import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x21e0ce){return process.env[`RABETBASE_${_0x21e0ce}`]||process.env[`LOVRABET_${_0x21e0ce}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x1a9cc5(0x1e4);export const CONFIG_NAMES=[a91_0x1a9cc5(0x1e4),a91_0x1a9cc5(0x20c),a91_0x1a9cc5(0x1df)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x1a9cc5(0x1e0)](_0x20cd7e=>_0x20cd7e!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3330d4){for(const _0x5f4660 of CONFIG_NAMES){const _0x2ec503=resolve(_0x3330d4,_0x5f4660);if(existsSync(_0x2ec503))return _0x2ec503;}return undefined;}export async function createContext(_0x4197fd){const _0x99546e=a91_0x1a9cc5,_0x344212=readRawConfig(),_0x1a4a42=buildConfig(_0x344212,_0x4197fd),{initEnv:_0x489742}=await import(_0x99546e(0x1e2));if(_0x1a4a42[_0x99546e(0x217)])_0x489742(_0x1a4a42[_0x99546e(0x217)]);else _0x4197fd[_0x99546e(0x217)]&&typeof _0x4197fd[_0x99546e(0x217)]===_0x99546e(0x219)&&_0x489742(_0x4197fd['env']);const {initDomains:_0x511a5a,getUserDomain:_0xb8c4bc,getApiDomain:_0x4ad0ff}=await import(_0x99546e(0x215));_0x511a5a({'apiDomain':_0x344212[_0x99546e(0x1ec)]||undefined,'userDomain':_0x344212[_0x99546e(0x205)]||undefined,'runtimeDomain':_0x344212[_0x99546e(0x1f6)]||undefined});const _0x95db03={'apiDomain':_0x4ad0ff(),'userDomain':_0xb8c4bc()},_0x1bfe71=await buildAuth(_0x1a4a42);logger[_0x99546e(0x202)](process[_0x99546e(0x206)]());const _0x7657f4=(CLI_BIN_NAME+'\x20'+process['argv'][_0x99546e(0x1fc)](0x2)[_0x99546e(0x212)]('\x20'))[_0x99546e(0x1eb)]();logger[_0x99546e(0x210)](_0x7657f4);const {isNonInteractive:_0x55094b}=await import(_0x99546e(0x1e3)),_0x1ffddf=_0x55094b(_0x4197fd);return{'config':_0x1a4a42,'auth':_0x1bfe71,'logger':logger,'env':_0x95db03,'nonInteractive':_0x1ffddf};}export function buildConfigFromFlags(_0x3e3506){return buildConfig(readRawConfig(),_0x3e3506);}export function getProjectConfigPath(){const _0x1e8452=a91_0x1a9cc5;return resolveConfigPath(process[_0x1e8452(0x206)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4d9b7c){const _0x4e457a=a91_0x1a9cc5;if(!existsSync(_0x4d9b7c))return{'status':_0x4e457a(0x21c)};try{const _0x5886eb=readFileSync(_0x4d9b7c,{'encoding':_0x4e457a(0x218)});if(!_0x5886eb?.['trim']())return{'status':_0x4e457a(0x1f4)};const _0x1a2afb=JSON[_0x4e457a(0x1d6)](_0x5886eb);return{'status':'ok','data':_0x1a2afb};}catch(_0x26e9cc){return{'status':_0x4e457a(0x220),'message':_0x26e9cc instanceof Error?_0x26e9cc[_0x4e457a(0x20b)]:String(_0x26e9cc)};}}function parseCliConfigJsonFile(_0x4f4c88,_0x2b6b2b,_0x39b622){const _0x59f9ad=a91_0x1a9cc5,_0x1c0f1a=inspectCliConfigJsonFile(_0x4f4c88);if(_0x1c0f1a[_0x59f9ad(0x214)]===_0x59f9ad(0x21c)||_0x1c0f1a[_0x59f9ad(0x214)]===_0x59f9ad(0x1f4))return{};if(_0x1c0f1a[_0x59f9ad(0x214)]==='ok')return _0x1c0f1a['data'];return _0x2b6b2b==='warn'&&_0x39b622&&console['error'](CLI_BIN_NAME+':\x20'+_0x39b622+_0x59f9ad(0x1dd)+_0x4f4c88+_0x59f9ad(0x1f9)+_0x1c0f1a[_0x59f9ad(0x20b)]),{};}export function loadRawConfigLayers(_0x4c1f26){const _0x146107=a91_0x1a9cc5;let _0x19c5c1={},_0x1b460e={};const _0x5d0358=resolveConfigPath(homedir());_0x5d0358&&(_0x19c5c1=parseCliConfigJsonFile(_0x5d0358,'warn',_0x146107(0x1ff)));const _0x4e2ea9=_0x4c1f26||process[_0x146107(0x206)](),_0x2da943=resolveConfigPath(_0x4e2ea9);return _0x2da943&&(_0x1b460e=parseCliConfigJsonFile(_0x2da943,_0x146107(0x1da),_0x146107(0x208))),{'globalPath':_0x5d0358,'projectPath':_0x2da943,'globalConfig':_0x19c5c1,'projectConfig':_0x1b460e};}function mergeRawConfigLayers(_0x10954b){const _0x3c4a51=a91_0x1a9cc5,{globalConfig:_0x147d49,projectConfig:_0x195a30}=_0x10954b,_0x6e811b=_0x147d49[_0x3c4a51(0x1d9)]&&typeof _0x147d49[_0x3c4a51(0x1d9)]===_0x3c4a51(0x20a)?_0x147d49[_0x3c4a51(0x1d9)]:{},_0xe26887=_0x195a30[_0x3c4a51(0x1d9)]&&typeof _0x195a30[_0x3c4a51(0x1d9)]==='object'?_0x195a30[_0x3c4a51(0x1d9)]:{},_0xab00d6={..._0x6e811b,..._0xe26887},_0x5786c9={..._0x147d49,..._0x195a30};Object['keys'](_0xab00d6)[_0x3c4a51(0x1e1)]>0x0&&(_0x5786c9['apps']=_0xab00d6);if(_0x3c4a51(0x1fd)in _0x195a30)_0x5786c9[_0x3c4a51(0x1fd)]=_0x195a30[_0x3c4a51(0x1fd)];else{if(_0xe26887&&Object[_0x3c4a51(0x207)](_0xe26887)[_0x3c4a51(0x1e1)]>0x0)_0x5786c9[_0x3c4a51(0x1fd)]=Object['keys'](_0xe26887)[0x0];else _0x147d49[_0x3c4a51(0x1fd)]&&(_0x5786c9[_0x3c4a51(0x1fd)]=_0x147d49['defaultApp']);}return _0x5786c9;}export function readRawConfigWithLayers(_0x299d21){const _0x32a257=loadRawConfigLayers(_0x299d21);return{'config':mergeRawConfigLayers(_0x32a257),'layers':_0x32a257};}export function readRawConfig(_0x5f0a78){return mergeRawConfigLayers(loadRawConfigLayers(_0x5f0a78));}export function readConfigFile(_0x339819){return parseCliConfigJsonFile(_0x339819,'silent');}export function writeConfigFile(_0x528747,_0x263c19){const _0x202ccd=a91_0x1a9cc5,_0x7be52f=dirname(_0x528747);!existsSync(_0x7be52f)&&mkdirSync(_0x7be52f,{'recursive':!![]});const _0x3cea3a=_0x528747+'.tmp';try{writeFileSync(_0x3cea3a,JSON[_0x202ccd(0x1f2)](_0x263c19,null,0x2)+'\x0a',{'encoding':_0x202ccd(0x218),'mode':0x180}),renameSync(_0x3cea3a,_0x528747);}catch(_0x242dce){try{unlinkSync(_0x3cea3a);}catch{}throw _0x242dce;}}export function resolveWriteConfigPath(_0x30bf3f){const _0x483394=a91_0x1a9cc5,_0x281de9=_0x30bf3f==='project'?process[_0x483394(0x206)]():homedir(),_0x9aee05=resolveConfigPath(_0x281de9);return _0x9aee05??resolve(_0x281de9,NEW_CONFIG_NAME);}function buildConfig(_0x5b7705,_0x574070){const _0x34c776=a91_0x1a9cc5,_0x448d5d={};if(_0x5b7705['apps']&&typeof _0x5b7705[_0x34c776(0x1d9)]===_0x34c776(0x20a))for(const [_0x5ac2e0,_0x47eab2]of Object['entries'](_0x5b7705[_0x34c776(0x1d9)])){_0x47eab2&&typeof _0x47eab2==='object'&&_0x47eab2['appcode']&&(_0x448d5d[_0x5ac2e0]=_0x47eab2);}const _0xf4563e=_0x5b7705[_0x34c776(0x1fd)]||undefined,_0x20f0e3=Object[_0x34c776(0x207)](_0x448d5d)[_0x34c776(0x1e1)]>0x0,_0x24d82d=_0x574070[_0x34c776(0x1d8)]||env(_0x34c776(0x1f0))||undefined,_0x55fce4=_0x24d82d||_0xf4563e||undefined,_0x17783d=_0x574070[_0x34c776(0x1f8)]||env(_0x34c776(0x209))||undefined,_0x11e64c=_0x17783d?Object[_0x34c776(0x1e8)](_0x448d5d)['find'](([,_0x57c693])=>_0x57c693?.[_0x34c776(0x1f8)]===_0x17783d):undefined,_0x5d621b=_0x11e64c?.[0x0],_0x1ee70f=_0x11e64c?.[0x1];let _0x1b6ae3=_0x17783d?_0x5d621b:_0x55fce4,_0x3e261d=_0x1b6ae3&&_0x448d5d[_0x1b6ae3]?_0x448d5d[_0x1b6ae3]:undefined;_0x17783d&&_0x1ee70f&&(_0x3e261d=_0x1ee70f);const _0x3d9602=_0x17783d?_0x1ee70f??_0x3e261d:_0x3e261d,_0x581f41=_0x24d82d||(_0x17783d?_0x5d621b:undefined),_0x351adb=_0x17783d||_0x3d9602?.[_0x34c776(0x1f8)]||_0x5b7705['appcode']||_0x5b7705[_0x34c776(0x1d8)]||undefined,_0x3d18cc=_0x574070[_0x34c776(0x217)]||env('ENV')||_0x3d9602?.['env']||_0x5b7705[_0x34c776(0x217)]||_0x34c776(0x1fb),_0x340237=_0x3d9602?.['locale']||_0x5b7705[_0x34c776(0x1f1)]||_0x34c776(0x1d5),_0x382241=env(_0x34c776(0x20e))||_0x3d9602?.[_0x34c776(0x1db)]||_0x5b7705[_0x34c776(0x1db)]||undefined,_0x2a5c7a=env(_0x34c776(0x204))||_0x3d9602?.[_0x34c776(0x1d7)]||_0x5b7705[_0x34c776(0x1d7)]||undefined,_0x3b8cfa=_0x574070[_0x34c776(0x21b)]||env('FORMAT')||_0x3d9602?.[_0x34c776(0x21b)]||_0x5b7705[_0x34c776(0x21b)],_0x39599a=normalizeLegacyOutputFormat(_0x3b8cfa),_0x542fc6=env(_0x34c776(0x1fa))||_0x3d9602?.[_0x34c776(0x1ef)]||_0x5b7705[_0x34c776(0x1ef)],_0x4982b8=_0x542fc6?Number(_0x542fc6)||undefined:undefined,_0x37b802=env(_0x34c776(0x201))||env(_0x34c776(0x20d))||_0x3d9602?.[_0x34c776(0x200)]||_0x5b7705[_0x34c776(0x200)]||_0x5b7705[_0x34c776(0x211)],_0x23103d=_0x37b802===_0x34c776(0x1e6)||_0x37b802===_0x34c776(0x1ea)?_0x37b802:_0x34c776(0x213),_0x235f49=env(_0x34c776(0x21d)),_0x5af83d=_0x235f49==='1'||_0x235f49===_0x34c776(0x20f),_0x3bd942=_0x3d9602?.[_0x34c776(0x1f5)]||_0x5b7705[_0x34c776(0x1f5)]||DEFAULT_API_DIR;return{'appCode':typeof _0x351adb===_0x34c776(0x219)&&_0x351adb[_0x34c776(0x1eb)]()?_0x351adb[_0x34c776(0x1eb)]():undefined,'env':_0x3d18cc===_0x34c776(0x21a)?_0x34c776(0x1fb):_0x3d18cc==='daily'?_0x34c776(0x21f):_0x34c776(0x1fb),'locale':_0x340237,'cookie':_0x382241,'accessKey':_0x2a5c7a,'format':_0x39599a,'pageSize':_0x4982b8,'riskLevel':_0x23103d,'verbose':_0x5af83d,'apiDir':_0x3bd942,'apps':_0x448d5d,'defaultApp':_0xf4563e,'currentApp':_0x20f0e3?_0x1b6ae3:undefined,'explicitAppName':_0x581f41,'raw':_0x5b7705};}async function buildAuth(_0x2cbe7d){const _0x3b1cbe=a91_0x1a9cc5,{getCookie:_0x58dab7}=await import(_0x3b1cbe(0x203)),_0x535087=_0x2cbe7d[_0x3b1cbe(0x1db)]||_0x58dab7(),_0x4f61d2=_0x535087?await getIsSessionValid():![];return{'cookie':_0x535087,'isLoggedIn':_0x4f61d2,async 'getOrLogin'(){const _0x123a0e=_0x3b1cbe;if(_0x535087&&_0x4f61d2)return _0x535087;throw CliErrors[_0x123a0e(0x1ed)]();}};}export function resolveApiFilePath(_0x286386,_0x20ce95){const _0xa360d5=a91_0x1a9cc5,_0x38ac02=resolve(process[_0xa360d5(0x206)](),_0x286386),_0x1057d0=resolve(_0x38ac02,_0xa360d5(0x1ee));if(!_0x20ce95)return _0x1057d0;const _0x45747d=readRawConfig(),_0x53eb07=_0x45747d[_0xa360d5(0x1d9)]&&typeof _0x45747d[_0xa360d5(0x1d9)]==='object'?_0x45747d[_0xa360d5(0x1d9)]:{},_0x43a619=Object['entries'](_0x53eb07)[_0xa360d5(0x1e7)](([,_0x4f9367])=>_0x4f9367?.[_0xa360d5(0x1f8)]===_0x20ce95);if(!_0x43a619)return _0x1057d0;const [_0x7c779d,_0x37095f]=_0x43a619,_0x5c9b5b=typeof _0x45747d['defaultApp']===_0xa360d5(0x219)?_0x45747d[_0xa360d5(0x1fd)]:undefined;if(_0x37095f?.[_0xa360d5(0x1f5)])return _0x1057d0;if(_0x5c9b5b&&_0x7c779d!==_0x5c9b5b)return resolve(_0x38ac02,_0x7c779d+_0xa360d5(0x21e));return _0x1057d0;}
1
+ const a91_0x29b968=a91_0x4b98;(function(_0x2c8317,_0x23af63){const _0x54c875=a91_0x4b98,_0x362be2=_0x2c8317();while(!![]){try{const _0x301e41=parseInt(_0x54c875(0x1b6))/0x1+-parseInt(_0x54c875(0x1de))/0x2+-parseInt(_0x54c875(0x1bf))/0x3+-parseInt(_0x54c875(0x1df))/0x4+-parseInt(_0x54c875(0x1d6))/0x5+parseInt(_0x54c875(0x1cc))/0x6*(parseInt(_0x54c875(0x1db))/0x7)+parseInt(_0x54c875(0x19b))/0x8;if(_0x301e41===_0x23af63)break;else _0x362be2['push'](_0x362be2['shift']());}catch(_0x308a76){_0x362be2['push'](_0x362be2['shift']());}}}(a91_0x4c80,0x9375a));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';function a91_0x4c80(){const _0x1196b6=['.lovrabet.json','defaultApp','userDomain','\x0a\x20\x20','APPCODE','find','argv','api.ts','filter','inherit','true','high-risk-write','./constant/env.js','334169cIhGOl','read','COOKIE','APP','error','online','apiDir','empty','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','1485648cHKjIz','./constant/domain.js','missing','ENV','.rabetbase.json','locale','entries','keys','slice','apps','./utils/is-non-interactive.js','silent','message','1776rCkEeU','object','runtimeDomain','pageSize','utf8','join','cookie','daily','format','production','1983915dHKLPn','maxRisk','authRequired','write','stringify','6475DYjzUj','Global','riskLevel','1570200LJodDe','3323712oRXRJk','./auth/get-cookie.js','.lovrabetrc','-api.ts','setRawCommand','RISK_LEVEL','cwd','length','project','20032416RRWrPd','trim','ACCESS_KEY','MAX_RISK','parse','env','VERBOSE','accessKey','string','en-US','warn','PAGE_SIZE','status','appcode'];a91_0x4c80=function(){return _0x1196b6;};return a91_0x4c80();}import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0xb51c68){return process.env[`RABETBASE_${_0xb51c68}`]||process.env[`LOVRABET_${_0xb51c68}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x29b968(0x1c3);export const CONFIG_NAMES=[a91_0x29b968(0x1c3),a91_0x29b968(0x1a9),a91_0x29b968(0x1e1)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x29b968(0x1b1)](_0x595d11=>_0x595d11!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x548707){for(const _0x1e0707 of CONFIG_NAMES){const _0xffc86d=resolve(_0x548707,_0x1e0707);if(existsSync(_0xffc86d))return _0xffc86d;}return undefined;}export async function createContext(_0x165fc5){const _0x3c9976=a91_0x29b968,_0x5cbcc8=readRawConfig(),_0x39a319=buildConfig(_0x5cbcc8,_0x165fc5),{initEnv:_0x2e671c}=await import(_0x3c9976(0x1b5));if(_0x39a319['env'])_0x2e671c(_0x39a319[_0x3c9976(0x1a0)]);else _0x165fc5[_0x3c9976(0x1a0)]&&typeof _0x165fc5[_0x3c9976(0x1a0)]===_0x3c9976(0x1a3)&&_0x2e671c(_0x165fc5[_0x3c9976(0x1a0)]);const {initDomains:_0x5bddf2,getUserDomain:_0x16b163,getApiDomain:_0x4336ef}=await import(_0x3c9976(0x1c0));_0x5bddf2({'apiDomain':_0x5cbcc8['apiDomain']||undefined,'userDomain':_0x5cbcc8[_0x3c9976(0x1ab)]||undefined,'runtimeDomain':_0x5cbcc8[_0x3c9976(0x1ce)]||undefined});const _0x5a1a37={'apiDomain':_0x4336ef(),'userDomain':_0x16b163()},_0x434056=await buildAuth(_0x39a319);logger['setLogPath'](process[_0x3c9976(0x198)]());const _0x7f0754=(CLI_BIN_NAME+'\x20'+process[_0x3c9976(0x1af)][_0x3c9976(0x1c7)](0x2)[_0x3c9976(0x1d1)]('\x20'))[_0x3c9976(0x19c)]();logger[_0x3c9976(0x196)](_0x7f0754);const {isNonInteractive:_0x31d56b}=await import(_0x3c9976(0x1c9)),_0x182904=_0x31d56b(_0x165fc5);return{'config':_0x39a319,'auth':_0x434056,'logger':logger,'env':_0x5a1a37,'nonInteractive':_0x182904};}export function buildConfigFromFlags(_0x29a6b7){return buildConfig(readRawConfig(),_0x29a6b7);}export function getProjectConfigPath(){const _0x3e430b=a91_0x29b968;return resolveConfigPath(process[_0x3e430b(0x198)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4fb63d){const _0xfb5bce=a91_0x29b968;if(!existsSync(_0x4fb63d))return{'status':'missing'};try{const _0xbd76a8=readFileSync(_0x4fb63d,{'encoding':'utf8'});if(!_0xbd76a8?.[_0xfb5bce(0x19c)]())return{'status':_0xfb5bce(0x1bd)};const _0x54a63a=JSON[_0xfb5bce(0x19f)](_0xbd76a8);return{'status':'ok','data':_0x54a63a};}catch(_0x1be69e){return{'status':_0xfb5bce(0x1ba),'message':_0x1be69e instanceof Error?_0x1be69e[_0xfb5bce(0x1cb)]:String(_0x1be69e)};}}function parseCliConfigJsonFile(_0x5c5b06,_0x1207a2,_0x4b50d6){const _0x28a6ad=a91_0x29b968,_0x128d9b=inspectCliConfigJsonFile(_0x5c5b06);if(_0x128d9b['status']===_0x28a6ad(0x1c1)||_0x128d9b[_0x28a6ad(0x1a7)]===_0x28a6ad(0x1bd))return{};if(_0x128d9b[_0x28a6ad(0x1a7)]==='ok')return _0x128d9b['data'];return _0x1207a2===_0x28a6ad(0x1a5)&&_0x4b50d6&&console[_0x28a6ad(0x1ba)](CLI_BIN_NAME+':\x20'+_0x4b50d6+_0x28a6ad(0x1be)+_0x5c5b06+_0x28a6ad(0x1ac)+_0x128d9b['message']),{};}function a91_0x4b98(_0xdeb1c2,_0x5595f0){_0xdeb1c2=_0xdeb1c2-0x196;const _0x4c80be=a91_0x4c80();let _0x4b989b=_0x4c80be[_0xdeb1c2];return _0x4b989b;}export function loadRawConfigLayers(_0x23a424){const _0x19e673=a91_0x29b968;let _0xe7de52={},_0x45e965={};const _0x3f9457=resolveConfigPath(homedir());_0x3f9457&&(_0xe7de52=parseCliConfigJsonFile(_0x3f9457,_0x19e673(0x1a5),_0x19e673(0x1dc)));const _0x474dfd=_0x23a424||process[_0x19e673(0x198)](),_0x370df4=resolveConfigPath(_0x474dfd);return _0x370df4&&(_0x45e965=parseCliConfigJsonFile(_0x370df4,'warn','Project')),{'globalPath':_0x3f9457,'projectPath':_0x370df4,'globalConfig':_0xe7de52,'projectConfig':_0x45e965};}function mergeRawConfigLayers(_0x212792){const _0x39e50f=a91_0x29b968,{globalConfig:_0x5eff93,projectConfig:_0x2e0f6c}=_0x212792;if(_0x2e0f6c[_0x39e50f(0x1b2)]===![]){const _0x579bc6={..._0x2e0f6c};delete _0x579bc6[_0x39e50f(0x1b2)];const _0x205ad8=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x2e0f6c[_0x39e50f(0x1c8)]:{};Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0?_0x579bc6[_0x39e50f(0x1c8)]=_0x205ad8:delete _0x579bc6[_0x39e50f(0x1c8)];if(_0x39e50f(0x1aa)in _0x2e0f6c)_0x579bc6['defaultApp']=_0x2e0f6c[_0x39e50f(0x1aa)];else Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0&&(_0x579bc6['defaultApp']=Object[_0x39e50f(0x1c6)](_0x205ad8)[0x0]);return _0x579bc6;}const _0x1950ea=_0x5eff93[_0x39e50f(0x1c8)]&&typeof _0x5eff93[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x5eff93['apps']:{},_0x386958=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]==='object'?_0x2e0f6c[_0x39e50f(0x1c8)]:{},_0x124b1a={..._0x1950ea,..._0x386958},_0x38892d={..._0x5eff93,..._0x2e0f6c};Object[_0x39e50f(0x1c6)](_0x124b1a)[_0x39e50f(0x199)]>0x0&&(_0x38892d['apps']=_0x124b1a);if('defaultApp'in _0x2e0f6c)_0x38892d[_0x39e50f(0x1aa)]=_0x2e0f6c[_0x39e50f(0x1aa)];else{if(_0x386958&&Object[_0x39e50f(0x1c6)](_0x386958)[_0x39e50f(0x199)]>0x0)_0x38892d[_0x39e50f(0x1aa)]=Object['keys'](_0x386958)[0x0];else _0x5eff93[_0x39e50f(0x1aa)]&&(_0x38892d['defaultApp']=_0x5eff93[_0x39e50f(0x1aa)]);}return _0x38892d;}export function readRawConfigWithLayers(_0x1c2aff){const _0x374045=loadRawConfigLayers(_0x1c2aff);return{'config':mergeRawConfigLayers(_0x374045),'layers':_0x374045};}export function readRawConfig(_0x429f8f){return mergeRawConfigLayers(loadRawConfigLayers(_0x429f8f));}export function readConfigFile(_0x14367d){const _0x4f1a2f=a91_0x29b968;return parseCliConfigJsonFile(_0x14367d,_0x4f1a2f(0x1ca));}export function writeConfigFile(_0x2c950f,_0x1b35cd){const _0x58a5dd=a91_0x29b968,_0xdd53d0=dirname(_0x2c950f);!existsSync(_0xdd53d0)&&mkdirSync(_0xdd53d0,{'recursive':!![]});const _0x258798=_0x2c950f+'.tmp';try{writeFileSync(_0x258798,JSON[_0x58a5dd(0x1da)](_0x1b35cd,null,0x2)+'\x0a',{'encoding':_0x58a5dd(0x1d0),'mode':0x180}),renameSync(_0x258798,_0x2c950f);}catch(_0x1f84a9){try{unlinkSync(_0x258798);}catch{}throw _0x1f84a9;}}export function resolveWriteConfigPath(_0x36de27){const _0x1e1431=a91_0x29b968,_0x46061c=_0x36de27===_0x1e1431(0x19a)?process[_0x1e1431(0x198)]():homedir(),_0x2800e6=resolveConfigPath(_0x46061c);return _0x2800e6??resolve(_0x46061c,NEW_CONFIG_NAME);}function buildConfig(_0x30d9ae,_0x13d33b){const _0x3de017=a91_0x29b968,_0x341d1d={};if(_0x30d9ae[_0x3de017(0x1c8)]&&typeof _0x30d9ae[_0x3de017(0x1c8)]===_0x3de017(0x1cd))for(const [_0x177621,_0x1eb848]of Object[_0x3de017(0x1c5)](_0x30d9ae['apps'])){_0x1eb848&&typeof _0x1eb848===_0x3de017(0x1cd)&&_0x1eb848[_0x3de017(0x1a8)]&&(_0x341d1d[_0x177621]=_0x1eb848);}const _0x4cf551=_0x30d9ae[_0x3de017(0x1aa)]||undefined,_0xf2f00f=Object[_0x3de017(0x1c6)](_0x341d1d)['length']>0x0,_0x34cd38=_0x13d33b['app']||env(_0x3de017(0x1b9))||undefined,_0x5410d1=_0x34cd38||_0x4cf551||undefined,_0x22ada7=_0x13d33b[_0x3de017(0x1a8)]||env(_0x3de017(0x1ad))||undefined,_0x25949f=_0x22ada7?Object[_0x3de017(0x1c5)](_0x341d1d)[_0x3de017(0x1ae)](([,_0x3d73a7])=>_0x3d73a7?.[_0x3de017(0x1a8)]===_0x22ada7):undefined,_0xa3b7ee=_0x25949f?.[0x0],_0x56b939=_0x25949f?.[0x1];let _0x3ab938=_0x22ada7?_0xa3b7ee:_0x5410d1,_0x300e97=_0x3ab938&&_0x341d1d[_0x3ab938]?_0x341d1d[_0x3ab938]:undefined;_0x22ada7&&_0x56b939&&(_0x300e97=_0x56b939);const _0x7e4933=_0x22ada7?_0x56b939??_0x300e97:_0x300e97,_0x1ddec5=_0x34cd38||(_0x22ada7?_0xa3b7ee:undefined),_0x51cd4d=_0x22ada7||_0x7e4933?.[_0x3de017(0x1a8)]||_0x30d9ae[_0x3de017(0x1a8)]||_0x30d9ae['app']||undefined,_0x27bdd3=_0x13d33b[_0x3de017(0x1a0)]||env(_0x3de017(0x1c2))||_0x7e4933?.['env']||_0x30d9ae['env']||_0x3de017(0x1d5),_0x50c2ab=_0x7e4933?.[_0x3de017(0x1c4)]||_0x30d9ae[_0x3de017(0x1c4)]||_0x3de017(0x1a4),_0x591fa6=env(_0x3de017(0x1b8))||_0x7e4933?.[_0x3de017(0x1d2)]||_0x30d9ae[_0x3de017(0x1d2)]||undefined,_0x2aa2db=env(_0x3de017(0x19d))||_0x7e4933?.[_0x3de017(0x1a2)]||_0x30d9ae[_0x3de017(0x1a2)]||undefined,_0x3c6912=_0x13d33b[_0x3de017(0x1d4)]||env('FORMAT')||_0x7e4933?.[_0x3de017(0x1d4)]||_0x30d9ae[_0x3de017(0x1d4)],_0x450d20=normalizeLegacyOutputFormat(_0x3c6912),_0x4f8102=env(_0x3de017(0x1a6))||_0x7e4933?.[_0x3de017(0x1cf)]||_0x30d9ae[_0x3de017(0x1cf)],_0x883a97=_0x4f8102?Number(_0x4f8102)||undefined:undefined,_0x10d033=env(_0x3de017(0x197))||env(_0x3de017(0x19e))||_0x7e4933?.[_0x3de017(0x1dd)]||_0x30d9ae['riskLevel']||_0x30d9ae[_0x3de017(0x1d7)],_0x41a517=_0x10d033===_0x3de017(0x1b7)||_0x10d033===_0x3de017(0x1d9)?_0x10d033:_0x3de017(0x1b4),_0x2d6460=env(_0x3de017(0x1a1)),_0x9fd9a4=_0x2d6460==='1'||_0x2d6460===_0x3de017(0x1b3),_0x111f6c=_0x7e4933?.[_0x3de017(0x1bc)]||_0x30d9ae[_0x3de017(0x1bc)]||DEFAULT_API_DIR;return{'appCode':typeof _0x51cd4d==='string'&&_0x51cd4d['trim']()?_0x51cd4d['trim']():undefined,'env':_0x27bdd3===_0x3de017(0x1bb)?_0x3de017(0x1d5):_0x27bdd3===_0x3de017(0x1d3)?_0x3de017(0x1d3):_0x3de017(0x1d5),'locale':_0x50c2ab,'cookie':_0x591fa6,'accessKey':_0x2aa2db,'format':_0x450d20,'pageSize':_0x883a97,'riskLevel':_0x41a517,'verbose':_0x9fd9a4,'apiDir':_0x111f6c,'apps':_0x341d1d,'defaultApp':_0x4cf551,'currentApp':_0xf2f00f?_0x3ab938:undefined,'explicitAppName':_0x1ddec5,'raw':_0x30d9ae};}async function buildAuth(_0x52be32){const _0x2f24b7=a91_0x29b968,{getCookie:_0x391060}=await import(_0x2f24b7(0x1e0)),_0x4de79a=_0x52be32[_0x2f24b7(0x1d2)]||_0x391060(),_0x27c160=_0x4de79a?await getIsSessionValid():![];return{'cookie':_0x4de79a,'isLoggedIn':_0x27c160,async 'getOrLogin'(){const _0x549243=_0x2f24b7;if(_0x4de79a&&_0x27c160)return _0x4de79a;throw CliErrors[_0x549243(0x1d8)]();}};}export function resolveApiFilePath(_0x3217c4,_0x140732){const _0x259730=a91_0x29b968,_0x518a08=resolve(process[_0x259730(0x198)](),_0x3217c4),_0x5b11ea=resolve(_0x518a08,_0x259730(0x1b0));if(!_0x140732)return _0x5b11ea;const _0x3ca485=readRawConfig(),_0x85010=_0x3ca485[_0x259730(0x1c8)]&&typeof _0x3ca485[_0x259730(0x1c8)]===_0x259730(0x1cd)?_0x3ca485[_0x259730(0x1c8)]:{},_0xe4cc0d=Object[_0x259730(0x1c5)](_0x85010)[_0x259730(0x1ae)](([,_0xee57c])=>_0xee57c?.[_0x259730(0x1a8)]===_0x140732);if(!_0xe4cc0d)return _0x5b11ea;const [_0x1c0e51,_0x3922a4]=_0xe4cc0d,_0x467218=typeof _0x3ca485['defaultApp']===_0x259730(0x1a3)?_0x3ca485[_0x259730(0x1aa)]:undefined;if(_0x3922a4?.[_0x259730(0x1bc)])return _0x5b11ea;if(_0x467218&&_0x1c0e51!==_0x467218)return resolve(_0x518a08,_0x1c0e51+_0x259730(0x1e2));return _0x5b11ea;}
@@ -1 +1 @@
1
- (function(_0x2b8f24,_0x2ac2e1){const _0x54dce2=a92_0x55da,_0x3ef6b6=_0x2b8f24();while(!![]){try{const _0xf06869=parseInt(_0x54dce2(0x91))/0x1*(-parseInt(_0x54dce2(0x8e))/0x2)+-parseInt(_0x54dce2(0x9a))/0x3*(parseInt(_0x54dce2(0x95))/0x4)+-parseInt(_0x54dce2(0x9b))/0x5+-parseInt(_0x54dce2(0x8f))/0x6*(-parseInt(_0x54dce2(0x96))/0x7)+parseInt(_0x54dce2(0x8a))/0x8+parseInt(_0x54dce2(0x87))/0x9*(-parseInt(_0x54dce2(0x99))/0xa)+parseInt(_0x54dce2(0x98))/0xb*(parseInt(_0x54dce2(0x9c))/0xc);if(_0xf06869===_0x2ac2e1)break;else _0x3ef6b6['push'](_0x3ef6b6['shift']());}catch(_0x271ff2){_0x3ef6b6['push'](_0x3ef6b6['shift']());}}}(a92_0x1361,0x92093));import{readFileSync,existsSync}from'node:fs';function a92_0x55da(_0x4dfb23,_0xae9f86){_0x4dfb23=_0x4dfb23-0x86;const _0x13616e=a92_0x1361();let _0x55daec=_0x13616e[_0x4dfb23];return _0x55daec;}import{resolve}from'node:path';const cache=new Map();function a92_0x1361(){const _0x4d5a3b=['99024XvMwmB','cwd','12239nscuyw','set','find','datasetCode','8mvPHnn','56maLsmi','utf-8','95689vxsoPs','6911690kqxkzo','106374kiGMGJ','1009850VeHcUG','2292fkNHhU','push','9xmbMPl','alias','exec','5590728LAHSTe','has','api.ts','get','152dDCLTX'];a92_0x1361=function(){return _0x4d5a3b;};return a92_0x1361();}function parseApiFile(_0x34c291){const _0x559565=a92_0x55da,_0x555be1=[],_0x3d9b74=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1d8c93;while((_0x1d8c93=_0x3d9b74[_0x559565(0x89)](_0x34c291))!==null){_0x555be1[_0x559565(0x86)]({'datasetCode':_0x1d8c93[0x1],'tableName':_0x1d8c93[0x2],'name':_0x1d8c93[0x3],'alias':_0x1d8c93[0x4]});}return _0x555be1;}export function loadAliasMap(_0x40d085,_0x223820,_0x3bf9e5){const _0x779711=a92_0x55da,_0x2ae0a5=_0x3bf9e5??resolve(process[_0x779711(0x90)](),_0x40d085,_0x779711(0x8c));if(cache[_0x779711(0x8b)](_0x2ae0a5))return cache[_0x779711(0x8d)](_0x2ae0a5);if(!existsSync(_0x2ae0a5))return cache['set'](_0x2ae0a5,[]),[];try{const _0x301451=readFileSync(_0x2ae0a5,_0x779711(0x97)),_0x15810d=parseApiFile(_0x301451);return cache[_0x779711(0x92)](_0x2ae0a5,_0x15810d),_0x15810d;}catch{return cache[_0x779711(0x92)](_0x2ae0a5,[]),[];}}export function resolveAlias(_0x5fdae5,_0x1e3dc4,_0x135bc7,_0x3a051c){const _0x56da93=a92_0x55da;if(!_0x1e3dc4)return undefined;const _0x3a08dc=loadAliasMap(_0x5fdae5,_0x135bc7,_0x3a051c),_0x1c2e4a=_0x3a08dc[_0x56da93(0x93)](_0xfbf145=>_0xfbf145[_0x56da93(0x88)]===_0x1e3dc4);return _0x1c2e4a?.[_0x56da93(0x94)];}export function listAliases(_0x2f3c57,_0x2e8ea0,_0x5852cb){return loadAliasMap(_0x2f3c57,_0x2e8ea0,_0x5852cb);}
1
+ function a92_0x4933(){const _0xda4c37=['cwd','2711380wxlfsj','alias','set','5705bKWkVj','utf-8','744eGgOIU','4144504MnqoYK','128lIFcew','9906530vzjxxb','2915MuoZLN','42926829SfvBal','6366kFvFEm','push','datasetCode','has','3hpexCB','api.ts','exec','558CcRbEF'];a92_0x4933=function(){return _0xda4c37;};return a92_0x4933();}(function(_0x588652,_0x30313a){const _0x1290ce=a92_0xdd0e,_0x1095ce=_0x588652();while(!![]){try{const _0x4d7b0a=-parseInt(_0x1290ce(0xfe))/0x1*(-parseInt(_0x1290ce(0xfc))/0x2)+-parseInt(_0x1290ce(0x104))/0x3*(parseInt(_0x1290ce(0xf5))/0x4)+parseInt(_0x1290ce(0xf8))/0x5*(-parseInt(_0x1290ce(0x100))/0x6)+-parseInt(_0x1290ce(0xfb))/0x7+-parseInt(_0x1290ce(0xfa))/0x8*(-parseInt(_0x1290ce(0x107))/0x9)+-parseInt(_0x1290ce(0xfd))/0xa+parseInt(_0x1290ce(0xff))/0xb;if(_0x4d7b0a===_0x30313a)break;else _0x1095ce['push'](_0x1095ce['shift']());}catch(_0x48dff8){_0x1095ce['push'](_0x1095ce['shift']());}}}(a92_0x4933,0x983ea));import{readFileSync,existsSync}from'node:fs';function a92_0xdd0e(_0x6d8ed6,_0x4a5229){_0x6d8ed6=_0x6d8ed6-0xf4;const _0x493397=a92_0x4933();let _0xdd0e6=_0x493397[_0x6d8ed6];return _0xdd0e6;}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x2c06e3){const _0x13534a=a92_0xdd0e,_0x5c98eb=[],_0x2a88f7=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0xb39b54;while((_0xb39b54=_0x2a88f7[_0x13534a(0x106)](_0x2c06e3))!==null){_0x5c98eb[_0x13534a(0x101)]({'datasetCode':_0xb39b54[0x1],'tableName':_0xb39b54[0x2],'name':_0xb39b54[0x3],'alias':_0xb39b54[0x4]});}return _0x5c98eb;}export function loadAliasMap(_0x2e2e7d,_0x279076,_0x4511eb){const _0x42ec99=a92_0xdd0e,_0x521903=_0x4511eb??resolve(process[_0x42ec99(0xf4)](),_0x2e2e7d,_0x42ec99(0x105));if(cache[_0x42ec99(0x103)](_0x521903))return cache['get'](_0x521903);if(!existsSync(_0x521903))return cache['set'](_0x521903,[]),[];try{const _0xe1994e=readFileSync(_0x521903,_0x42ec99(0xf9)),_0x3a4b64=parseApiFile(_0xe1994e);return cache[_0x42ec99(0xf7)](_0x521903,_0x3a4b64),_0x3a4b64;}catch{return cache[_0x42ec99(0xf7)](_0x521903,[]),[];}}export function resolveAlias(_0x1d667a,_0x1642f6,_0x38dcf1,_0x584fef){const _0x3d0f6a=a92_0xdd0e;if(!_0x1642f6)return undefined;const _0x218efd=loadAliasMap(_0x1d667a,_0x38dcf1,_0x584fef),_0x24ee55=_0x218efd['find'](_0x4af3fd=>_0x4af3fd[_0x3d0f6a(0xf6)]===_0x1642f6);return _0x24ee55?.[_0x3d0f6a(0x102)];}export function listAliases(_0x48af48,_0x1f617f,_0x3584c4){return loadAliasMap(_0x48af48,_0x1f617f,_0x3584c4);}
@@ -1 +1 @@
1
- (function(_0xd6198e,_0x519272){const _0x3e5165=a93_0x27b9,_0x26a89=_0xd6198e();while(!![]){try{const _0x5a2d95=-parseInt(_0x3e5165(0x13d))/0x1*(parseInt(_0x3e5165(0x127))/0x2)+parseInt(_0x3e5165(0x161))/0x3*(parseInt(_0x3e5165(0x15d))/0x4)+-parseInt(_0x3e5165(0x173))/0x5*(parseInt(_0x3e5165(0x10a))/0x6)+-parseInt(_0x3e5165(0x14a))/0x7*(parseInt(_0x3e5165(0x154))/0x8)+parseInt(_0x3e5165(0x11b))/0x9*(-parseInt(_0x3e5165(0x103))/0xa)+-parseInt(_0x3e5165(0x114))/0xb+parseInt(_0x3e5165(0x13e))/0xc*(parseInt(_0x3e5165(0x121))/0xd);if(_0x5a2d95===_0x519272)break;else _0x26a89['push'](_0x26a89['shift']());}catch(_0x4a6483){_0x26a89['push'](_0x26a89['shift']());}}}(a93_0xe262,0x3c23c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';function a93_0x27b9(_0x530c33,_0x12e8ca){_0x530c33=_0x530c33-0x102;const _0xe2627c=a93_0xe262();let _0x27b9ee=_0xe2627c[_0x530c33];return _0x27b9ee;}import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x55fa20){_activeCookie=_0x55fa20||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}function a93_0xe262(){const _0x433622=['body','/smartapi/dataset/get-driven-data?','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','6JJrpnf','dbtableConfig','sqlCode','method','errorCode','operationName','.getOne(id);','Dataset\x20not\x20found:\x20','/smartapi/question/er-config','/api/management/library/scripts/info?id=','3390035uGDzeS','Warning:\x20showing\x20first\x20','//\x20','const\x20data\x20=\x20await\x20client.sql.execute({','join','requestFields','/api/custom/executeSql','9LuKYJN','delete','has','API\x20error:\x20','label','table','13nCXWAr','remove','API\x20error\x20code:\x20','find','POST','\x20\x20\x20\x20sqlCode:\x20\x27','8994krFMSd','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/api/management/library/scripts/delete','\x22\x20not\x20found\x20in\x20dataset\x20','test','//\x20SQL:\x20','&type=','errorMsg','name','.filter({','\x20\x20currentPage:\x201,','Request\x20timeout:\x20','/api/management/library/scripts/statistics?appCode=','create','/smartapi/dataset/get-dataset-list','tableData','totalCount','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','cli:rabetbase','enabled','includeImports','});','19CSJtYS','12859872fFHYfy','sdk','signal','stringify','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','abort','error','sqlName','\x20\x20sqlCode:\x20\x27','\x20failed,\x20HTTP\x20','filter','add','1939iOtskE','description','\x20\x20where:\x20{},','operations','message','code','const\x20results\x20=\x20data.execResult\x20||\x20[];','Unauthorized','AbortError','status','3656XiDbJu','authRequired','success','getOne','toLowerCase','errorMessage','warn','/api/management/library/scripts/save','responseFields','1849884NBcqEB','401','push','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','3TtLRgF','json','\x20failed','includes','path','apiError','validation','BFF\x20script\x20not\x20found:\x20id=','target','data','update','displayName','tableName','application/json','GET','pageSize','type','modelId','1964245anfEAh','object','map','3747290lqHinU','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','const\x20result\x20=\x20await\x20client.models.','replace'];a93_0xe262=function(){return _0x433622;};return a93_0xe262();}async function apiRequest(_0x1c131e,_0x2b99a2={}){const _0x2b2e39=a93_0x27b9,{method:method=_0x2b2e39(0x16f),body:_0x33e7fe,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x2b99a2,_0x51a969=useRuntime?getRuntimeDomain():getApiDomain(),_0x5a04c2=_activeCookie||getCookie(),_0xbf9801=''+_0x51a969+_0x1c131e,_0x3863ad=new AbortController(),_0x343483=setTimeout(()=>_0x3863ad[_0x2b2e39(0x143)](),timeout);try{const _0x469759=await fetch(_0xbf9801,{'method':method,'headers':{'Content-Type':_0x2b2e39(0x16e),'Cookie':_0x5a04c2,'X-Invoke-Source':_0x2b2e39(0x139),...headers},'body':_0x33e7fe?JSON['stringify'](_0x33e7fe):undefined,'signal':_0x3863ad[_0x2b2e39(0x140)]});let _0x373cf3;try{_0x373cf3=await _0x469759['json']();}catch{throw CliErrors[_0x2b2e39(0x166)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x469759['status']+')',_0x469759[_0x2b2e39(0x153)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x469759['ok']||_0x373cf3['success']===![])throw CliErrors[_0x2b2e39(0x166)](_0x373cf3[_0x2b2e39(0x12e)]||_0x373cf3[_0x2b2e39(0x14e)]||_0x2b2e39(0x11e)+_0x469759[_0x2b2e39(0x153)],_0x373cf3[_0x2b2e39(0x10e)]?_0x2b2e39(0x123)+_0x373cf3[_0x2b2e39(0x10e)]:undefined);return _0x373cf3;}catch(_0x16e826){if(_0x16e826 instanceof Error&&_0x16e826[_0x2b2e39(0x12f)]===_0x2b2e39(0x152))throw CliErrors[_0x2b2e39(0x166)](_0x2b2e39(0x132)+_0xbf9801);throw _0x16e826;}finally{clearTimeout(_0x343483);}}function isAuthFailure(_0x4ad8dc){const _0x359eff=a93_0x27b9,_0x7aa1fc=_0x4ad8dc['errorMsg']||_0x4ad8dc['message']||_0x4ad8dc[_0x359eff(0x16a)]?.[_0x359eff(0x14e)]||_0x4ad8dc[_0x359eff(0x159)]||_0x4ad8dc[_0x359eff(0x144)]||'';return _0x4ad8dc[_0x359eff(0x10e)]==='UNAUTHORIZED'||_0x4ad8dc[_0x359eff(0x14f)]===0x191||_0x4ad8dc['code']===_0x359eff(0x15e)||_0x7aa1fc['includes'](_0x359eff(0x15e))||_0x7aa1fc[_0x359eff(0x164)](_0x359eff(0x151))||_0x7aa1fc['includes']('登录')||_0x7aa1fc[_0x359eff(0x164)]('认证');}export async function platformFetch(_0x21a3f8,_0x3fbc17){const _0x5a4ae4=a93_0x27b9,_0x1d6902=await fetch(_0x21a3f8,{'method':_0x3fbc17[_0x5a4ae4(0x10d)]??'GET','headers':{'Content-Type':_0x5a4ae4(0x16e),'Cookie':_0x3fbc17['cookie']},..._0x3fbc17[_0x5a4ae4(0x107)]&&{'body':JSON[_0x5a4ae4(0x141)](_0x3fbc17[_0x5a4ae4(0x107)])}});if(!_0x1d6902['ok']){if(_0x1d6902[_0x5a4ae4(0x153)]===0x191)throw CliErrors[_0x5a4ae4(0x155)]();throw CliErrors[_0x5a4ae4(0x166)](_0x3fbc17[_0x5a4ae4(0x11f)]+_0x5a4ae4(0x147)+_0x1d6902[_0x5a4ae4(0x153)]);}const _0xf6bb97=await _0x1d6902[_0x5a4ae4(0x162)]();if(_0xf6bb97[_0x5a4ae4(0x156)]===![]){if(isAuthFailure(_0xf6bb97))throw CliErrors[_0x5a4ae4(0x155)]();throw CliErrors[_0x5a4ae4(0x166)](_0xf6bb97['errorMsg']||_0xf6bb97[_0x5a4ae4(0x14e)]||_0x3fbc17['label']+_0x5a4ae4(0x163));}return _0xf6bb97['data'];}export async function listBffScripts(_0x149774,_0x578266,_0x4c5e00){const _0x1aa2ad=a93_0x27b9;let _0x4f5fb4='/api/management/library/scripts/list?appCode='+_0x149774;if(_0x578266)_0x4f5fb4+=_0x1aa2ad(0x12d)+_0x578266;const _0x5337e8=await apiRequest(_0x4f5fb4);let _0x35c08f=extractList(_0x5337e8[_0x1aa2ad(0x16a)]);if(_0x4c5e00?.['scriptName']){const _0x420835=_0x4c5e00['scriptName']['toLowerCase']();_0x35c08f=_0x35c08f['filter'](_0x4aad17=>_0x4aad17['functionName']?.[_0x1aa2ad(0x158)]()[_0x1aa2ad(0x164)](_0x420835)||_0x4aad17[_0x1aa2ad(0x14b)]?.[_0x1aa2ad(0x158)]()[_0x1aa2ad(0x164)](_0x420835));}return _0x35c08f;}export async function getBffScriptInfo(_0x2268fa){const _0x5f0989=a93_0x27b9,_0xc8623a=await apiRequest(_0x5f0989(0x113)+_0x2268fa);if(!_0xc8623a[_0x5f0989(0x16a)])throw CliErrors['validation'](_0x5f0989(0x168)+_0x2268fa);return _0xc8623a[_0x5f0989(0x16a)];}export async function saveBffScript(_0x1fdcd3){const _0x417038=a93_0x27b9,_0x3689e3=await apiRequest(_0x417038(0x15b),{'method':'POST','body':_0x1fdcd3});return _0x3689e3[_0x417038(0x16a)];}export async function deleteBffScript(_0x184e89){const _0x2027be=a93_0x27b9;await apiRequest(_0x2027be(0x129),{'method':'POST','body':{'id':_0x184e89}});}export async function getBffScriptStatistics(_0x345d3e){const _0x25a781=a93_0x27b9,_0x5ad7ba=await apiRequest(_0x25a781(0x133)+_0x345d3e);return extractList(_0x5ad7ba['data']);}export async function listBffDatasetOperations(_0x2ed26e,_0x3c056d){const _0x2e939d=a93_0x27b9,_0x2929e0=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x2e939d(0x125),'body':{'appCode':_0x2ed26e,'datasetId':_0x3c056d}});return _0x2929e0['data'];}export async function listSqlQueries(_0x277054,_0x5e7082){const _0x27ae87=a93_0x27b9,_0x321b08=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x277054,'currentPage':_0x5e7082?.['currentPage']??0x1,'pageSize':_0x5e7082?.[_0x27ae87(0x170)]??0x32,'sqlCode':_0x5e7082?.[_0x27ae87(0x10c)],'sqlName':_0x5e7082?.[_0x27ae87(0x145)]}});return _0x321b08[_0x27ae87(0x16a)];}export async function getSqlQueryInfo(_0x11c4fb,_0x5e2d99){const _0x38e908=a93_0x27b9,_0x5cbfc3=await listSqlQueries(_0x11c4fb,{'sqlCode':_0x5e2d99}),_0x2a7083=_0x5cbfc3[_0x38e908(0x136)]?.[0x0];if(!_0x2a7083)throw CliErrors[_0x38e908(0x167)]('SQL\x20query\x20not\x20found:\x20'+_0x5e2d99);return _0x2a7083;}export async function saveSqlQuery(_0x535952){const _0x1360cb=a93_0x27b9,_0x16fbee=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x1360cb(0x125),'body':_0x535952});return _0x16fbee[_0x1360cb(0x16a)];}export async function executeSql(_0x5e0179,_0x42a392,_0x5d6c7){const _0x20f89b=a93_0x27b9,_0x4d78f6=await apiRequest(_0x20f89b(0x11a),{'method':'POST','body':{'appCode':_0x5e0179,'sqlCode':_0x42a392,..._0x5d6c7&&{'params':_0x5d6c7}},'useRuntime':!![]});return _0x4d78f6[_0x20f89b(0x16a)];}export async function listDatasets(_0x421b44,_0xb9e5c2){const _0x54e815=a93_0x27b9,_0x21ffa7={'appCode':_0x421b44,'deleted':![]};if(_0xb9e5c2?.[_0x54e815(0x14f)])_0x21ffa7[_0x54e815(0x14f)]=_0xb9e5c2[_0x54e815(0x14f)];if(_0xb9e5c2?.[_0x54e815(0x12f)])_0x21ffa7[_0x54e815(0x12f)]=_0xb9e5c2[_0x54e815(0x12f)];const _0x33d904=await apiRequest(_0x54e815(0x135),{'method':_0x54e815(0x125),'body':_0x21ffa7});return extractList(_0x33d904['data']);}export async function searchDatasets(_0x2066b9,_0x17ab01){const _0x26258d=a93_0x27b9,_0x5ea3cc=await listDatasets(_0x2066b9,{'name':_0x17ab01}),_0x576050=_0x17ab01[_0x26258d(0x158)](),_0x4729b9=new Set(_0x5ea3cc[_0x26258d(0x102)](_0x5348d5=>_0x5348d5['id'])),_0x4057e5=_0x5ea3cc[_0x26258d(0x148)](_0x43ae97=>_0x43ae97[_0x26258d(0x10b)]?.[_0x26258d(0x16d)]?.[_0x26258d(0x158)]()[_0x26258d(0x164)](_0x576050)||_0x43ae97[_0x26258d(0x14b)]?.[_0x26258d(0x158)]()[_0x26258d(0x164)](_0x576050)),_0x4dae38=await listDatasets(_0x2066b9,{'code':_0x17ab01});for(const _0x1886b8 of _0x4dae38){!_0x4729b9[_0x26258d(0x11d)](_0x1886b8['id'])&&(_0x5ea3cc[_0x26258d(0x15f)](_0x1886b8),_0x4729b9[_0x26258d(0x149)](_0x1886b8['id']));}return _0x5ea3cc;}export function normalizeDatasetOperations(_0x242694){const _0x15e885=a93_0x27b9;if(Array['isArray'](_0x242694))return _0x242694['filter'](_0x665e86=>_0x665e86!=null&&typeof _0x665e86===_0x15e885(0x174));if(_0x242694&&typeof _0x242694===_0x15e885(0x174))return Object['entries'](_0x242694)[_0x15e885(0x148)](([,_0x19f3bf])=>_0x19f3bf!=null&&typeof _0x19f3bf===_0x15e885(0x174))[_0x15e885(0x102)](([_0x31e608,_0x141c93])=>({..._0x141c93,'name':_0x141c93['name']??_0x141c93[_0x15e885(0x10f)]??_0x31e608}));return[];}export async function getDatasetDetail(_0x341f6e){const _0xc5795d=a93_0x27b9,_0x592afc=/^\d+$/['test'](_0x341f6e)?'id':_0xc5795d(0x14f),_0x3dfdbb=await apiRequest(_0xc5795d(0x108)+_0x592afc+'='+_0x341f6e);return _0x3dfdbb[_0xc5795d(0x16a)];}export async function getDatasetOperations(_0x7730f){const _0x224a76=a93_0x27b9,_0x273fe6=await getDatasetDetail(_0x7730f),_0x2b40aa=normalizeDatasetOperations(_0x273fe6['operations'])[_0x224a76(0x102)](_0x17176=>({'name':_0x17176[_0x224a76(0x12f)]||_0x17176[_0x224a76(0x10f)],'displayName':_0x17176[_0x224a76(0x16c)]||_0x17176[_0x224a76(0x12f)],'type':_0x17176[_0x224a76(0x171)],'method':_0x17176['method'],'path':_0x17176[_0x224a76(0x165)],'enabled':_0x17176[_0x224a76(0x13a)]??!![],'requestFields':_0x17176[_0x224a76(0x119)],'responseFields':_0x17176[_0x224a76(0x15c)]}));return{'dataset':{'id':_0x273fe6['id']??_0x273fe6[_0x224a76(0x172)],'name':_0x273fe6[_0x224a76(0x12f)],'code':_0x273fe6[_0x224a76(0x14f)]||_0x273fe6['modelCode'],'tableName':_0x273fe6[_0x224a76(0x16d)]||_0x273fe6[_0x224a76(0x10b)]?.[_0x224a76(0x16d)]},'operations':_0x2b40aa};}export async function getOperationDetail(_0x7f3d65,_0x2ca471,_0x3ea222){const _0x477859=a93_0x27b9;let _0x45d642=_0x2ca471;if(!/^\d+$/[_0x477859(0x12b)](_0x2ca471)){const _0x1e414c=await listDatasets(_0x7f3d65,{'code':_0x2ca471}),_0x103334=_0x1e414c[_0x477859(0x124)](_0x4efc77=>_0x4efc77[_0x477859(0x14f)]===_0x2ca471||String(_0x4efc77['id'])===_0x2ca471);if(!_0x103334)throw CliErrors[_0x477859(0x167)](_0x477859(0x111)+_0x2ca471);_0x45d642=String(_0x103334['id']);}const _0x18be6b=await getDatasetDetail(_0x45d642),_0xb1ef0=normalizeDatasetOperations(_0x18be6b[_0x477859(0x14d)])[_0x477859(0x124)](_0x128ced=>(_0x128ced[_0x477859(0x12f)]||_0x128ced[_0x477859(0x10f)])===_0x3ea222);if(!_0xb1ef0)throw CliErrors['validation']('Operation\x20\x22'+_0x3ea222+_0x477859(0x12a)+_0x2ca471);return{'dataset':{'id':_0x18be6b['id']??_0x18be6b[_0x477859(0x172)],'name':_0x18be6b[_0x477859(0x12f)],'code':_0x18be6b[_0x477859(0x14f)]||_0x18be6b['modelCode'],'tableName':_0x18be6b[_0x477859(0x16d)]||_0x18be6b[_0x477859(0x10b)]?.[_0x477859(0x16d)]},'operation':_0xb1ef0};}export function generateSdkCode(_0x5e76be,_0x4d2f7d,_0x181e3f){const _0x4d76c7=a93_0x27b9,_0x5a96bc=_0x181e3f?.[_0x4d76c7(0x13b)]??!![],_0x582c79='dataset_'+_0x5e76be['code']?.[_0x4d76c7(0x106)](/-/g,'_'),_0x3b6a1d=_0x4d2f7d['name']||_0x4d2f7d['operationName']||_0x4d76c7(0x148),_0x4099c2=[];_0x5a96bc&&_0x4099c2[_0x4d76c7(0x15f)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x4d76c7(0x128),'');_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x116)+_0x5e76be[_0x4d76c7(0x12f)]+'\x20('+(_0x5e76be['tableName']||_0x4d76c7(0x120))+')');if(_0x3b6a1d==='filter')_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x105)+_0x582c79+_0x4d76c7(0x130),_0x4d76c7(0x14c),'\x20\x20pageSize:\x2020,',_0x4d76c7(0x131),_0x4d76c7(0x13c));else{if(_0x3b6a1d===_0x4d76c7(0x157))_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x105)+_0x582c79+_0x4d76c7(0x110));else{if(_0x3b6a1d===_0x4d76c7(0x134))_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x105)+_0x582c79+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x3b6a1d===_0x4d76c7(0x16b))_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x105)+_0x582c79+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x3b6a1d===_0x4d76c7(0x11c)||_0x3b6a1d===_0x4d76c7(0x122)?_0x4099c2[_0x4d76c7(0x15f)](_0x4d76c7(0x105)+_0x582c79+'.remove(id);'):_0x4099c2['push'](_0x4d76c7(0x105)+_0x582c79+'.'+_0x3b6a1d+'(/*\x20params\x20*/);');}}}return _0x4099c2[_0x4d76c7(0x118)]('\x0a');}export function generateSqlCodeTemplate(_0x3353d4,_0x194b5c){const _0x27afe1=a93_0x27b9,_0x262853=_0x194b5c?.[_0x27afe1(0x169)]??'sdk',_0x44391e=_0x194b5c?.['includeImports']??!![],_0x30c372=[];return _0x30c372['push'](_0x27afe1(0x12c)+_0x3353d4['sqlName']+'\x20('+_0x3353d4[_0x27afe1(0x10c)]+')'),_0x262853===_0x27afe1(0x13f)?(_0x44391e&&_0x30c372[_0x27afe1(0x15f)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x27afe1(0x128),''),_0x30c372[_0x27afe1(0x15f)](_0x27afe1(0x117),_0x27afe1(0x146)+_0x3353d4['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});',_0x27afe1(0x109),_0x27afe1(0x150))):_0x30c372['push']('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x27afe1(0x138),_0x27afe1(0x142),_0x27afe1(0x126)+_0x3353d4[_0x27afe1(0x10c)]+'\x27,',_0x27afe1(0x104),'\x20\x20});','\x20\x20return\x20rows;','}'),_0x30c372[_0x27afe1(0x118)]('\x0a');}export async function getErConfig(_0x58d7b8,_0x723437){const _0x1a3437=a93_0x27b9,_0x4f4a36=await apiRequest(_0x1a3437(0x112),{'method':_0x1a3437(0x125),'body':{'appCode':_0x58d7b8,'dblinkId':_0x723437}});return _0x4f4a36[_0x1a3437(0x16a)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0xe133ca=a93_0x27b9,_0x4e0e1b=await apiRequest('/smartapi/app/getList',{'method':_0xe133ca(0x125),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x2b7273=extractList(_0x4e0e1b[_0xe133ca(0x16a)]),_0x573110=extractPaging(_0x4e0e1b['data']);return _0x573110&&_0x573110[_0xe133ca(0x137)]>REMOTE_APP_PAGE_SIZE&&console[_0xe133ca(0x15a)](_0xe133ca(0x115)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x573110[_0xe133ca(0x137)]+'\x20apps.\x20'+_0xe133ca(0x160)),_0x2b7273;}
1
+ (function(_0x261e09,_0x25ad7d){const _0x4f23ae=a93_0x41b7,_0x488058=_0x261e09();while(!![]){try{const _0x408ff9=parseInt(_0x4f23ae(0x18b))/0x1*(parseInt(_0x4f23ae(0x186))/0x2)+parseInt(_0x4f23ae(0x17c))/0x3+-parseInt(_0x4f23ae(0x177))/0x4*(-parseInt(_0x4f23ae(0x192))/0x5)+-parseInt(_0x4f23ae(0x16c))/0x6+-parseInt(_0x4f23ae(0x168))/0x7*(-parseInt(_0x4f23ae(0x1c4))/0x8)+parseInt(_0x4f23ae(0x199))/0x9*(parseInt(_0x4f23ae(0x160))/0xa)+-parseInt(_0x4f23ae(0x15e))/0xb;if(_0x408ff9===_0x25ad7d)break;else _0x488058['push'](_0x488058['shift']());}catch(_0xbf9ba7){_0x488058['push'](_0x488058['shift']());}}}(a93_0x1d59,0x2758c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x607bc7){_activeCookie=_0x607bc7||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x48f58f,_0x23f5ff={}){const _0x39a5e3=a93_0x41b7,{method:method=_0x39a5e3(0x1ad),body:_0x36a44e,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x23f5ff,_0x5a76b3=useRuntime?getRuntimeDomain():getApiDomain(),_0x3d276d=_activeCookie||getCookie(),_0x469979=''+_0x5a76b3+_0x48f58f,_0x5d0e25=new AbortController(),_0x3a013d=setTimeout(()=>_0x5d0e25[_0x39a5e3(0x1b1)](),timeout);try{const _0x375ecf=await fetch(_0x469979,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x3d276d,'X-Invoke-Source':_0x39a5e3(0x15d),...headers},'body':_0x36a44e?JSON[_0x39a5e3(0x15c)](_0x36a44e):undefined,'signal':_0x5d0e25[_0x39a5e3(0x1c9)]});let _0x41f442;try{_0x41f442=await _0x375ecf[_0x39a5e3(0x1bb)]();}catch{throw CliErrors[_0x39a5e3(0x1a2)](_0x39a5e3(0x173)+_0x375ecf[_0x39a5e3(0x1ab)]+')',_0x375ecf[_0x39a5e3(0x1ab)]>=0x190?_0x39a5e3(0x162):undefined);}if(!_0x375ecf['ok']||_0x41f442[_0x39a5e3(0x197)]===![])throw CliErrors[_0x39a5e3(0x1a2)](_0x41f442['errorMsg']||_0x41f442[_0x39a5e3(0x170)]||_0x39a5e3(0x179)+_0x375ecf[_0x39a5e3(0x1ab)],_0x41f442['errorCode']?_0x39a5e3(0x1ba)+_0x41f442['errorCode']:undefined);return _0x41f442;}catch(_0x56b429){if(_0x56b429 instanceof Error&&_0x56b429[_0x39a5e3(0x1b4)]===_0x39a5e3(0x19d))throw CliErrors[_0x39a5e3(0x1a2)]('Request\x20timeout:\x20'+_0x469979);throw _0x56b429;}finally{clearTimeout(_0x3a013d);}}function isAuthFailure(_0x568727){const _0x5c7219=a93_0x41b7,_0x1bcdc4=_0x568727[_0x5c7219(0x17d)]||_0x568727['message']||_0x568727[_0x5c7219(0x156)]?.[_0x5c7219(0x170)]||_0x568727[_0x5c7219(0x158)]||_0x568727[_0x5c7219(0x1a8)]||'';return _0x568727[_0x5c7219(0x1c7)]==='UNAUTHORIZED'||_0x568727[_0x5c7219(0x174)]===0x191||_0x568727[_0x5c7219(0x174)]==='401'||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x188))||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x18c))||_0x1bcdc4[_0x5c7219(0x18a)]('登录')||_0x1bcdc4[_0x5c7219(0x18a)]('认证');}export async function platformFetch(_0xcc0bd9,_0x4ee53b){const _0x596f00=a93_0x41b7,_0x2d82ba=await fetch(_0xcc0bd9,{'method':_0x4ee53b[_0x596f00(0x1bf)]??_0x596f00(0x1ad),'headers':{'Content-Type':_0x596f00(0x18f),'Cookie':_0x4ee53b[_0x596f00(0x1ca)]},..._0x4ee53b[_0x596f00(0x176)]&&{'body':JSON[_0x596f00(0x15c)](_0x4ee53b[_0x596f00(0x176)])}});if(!_0x2d82ba['ok']){if(_0x2d82ba[_0x596f00(0x1ab)]===0x191)throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x4ee53b[_0x596f00(0x195)]+_0x596f00(0x1cd)+_0x2d82ba[_0x596f00(0x1ab)]);}const _0x505d4f=await _0x2d82ba['json']();if(_0x505d4f[_0x596f00(0x197)]===![]){if(isAuthFailure(_0x505d4f))throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x505d4f[_0x596f00(0x17d)]||_0x505d4f['message']||_0x4ee53b[_0x596f00(0x195)]+'\x20failed');}return _0x505d4f['data'];}export async function listBffScripts(_0x26b058,_0x1aca02,_0x537ab9){const _0x350a51=a93_0x41b7;let _0x200b06=_0x350a51(0x1c3)+_0x26b058;if(_0x1aca02)_0x200b06+=_0x350a51(0x18d)+_0x1aca02;const _0x29e4a7=await apiRequest(_0x200b06);let _0x7610ad=extractList(_0x29e4a7[_0x350a51(0x156)]);if(_0x537ab9?.[_0x350a51(0x17b)]){const _0x349610=_0x537ab9[_0x350a51(0x17b)][_0x350a51(0x1a1)]();_0x7610ad=_0x7610ad[_0x350a51(0x169)](_0x4fb82f=>_0x4fb82f[_0x350a51(0x1cc)]?.[_0x350a51(0x1a1)]()['includes'](_0x349610)||_0x4fb82f[_0x350a51(0x193)]?.['toLowerCase']()[_0x350a51(0x18a)](_0x349610));}return _0x7610ad;}export async function getBffScriptInfo(_0xd42847){const _0x2b31c7=a93_0x41b7,_0x2db7a7=await apiRequest(_0x2b31c7(0x19f)+_0xd42847);if(!_0x2db7a7['data'])throw CliErrors['validation']('BFF\x20script\x20not\x20found:\x20id='+_0xd42847);return _0x2db7a7[_0x2b31c7(0x156)];}export async function saveBffScript(_0x1bf575){const _0x5088ef=a93_0x41b7,_0x38d009=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x1bf575});return _0x38d009[_0x5088ef(0x156)];}function a93_0x1d59(){const _0x271b9d=['});','data','tableData','errorMessage','\x20\x20currentPage:\x201,','path','dbtableConfig','stringify','cli:rabetbase','7015602CtDcLq','.getOne(id);','10kREasj','operationName','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','pageSize','authRequired','warn','\x20\x20\x20\x20sqlCode:\x20\x27','table','77evgWcV','filter','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','target','1450446EkcKAt','validation','update','.create({\x20/*\x20fields\x20*/\x20});','message','sqlCode','/smartapi/question/er-config','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','code','\x20apps.\x20','body','66072zjuEgN','remove','API\x20error:\x20','Warning:\x20showing\x20first\x20','scriptName','628929IqkTOk','errorMsg','add','join','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','SQL\x20query\x20not\x20found:\x20','find','\x20\x20pageSize:\x2020,','Dataset\x20not\x20found:\x20','524430DiwhfJ','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','401','sqlName','includes','1JnkWLa','Unauthorized','&type=','modelId','application/json','replace','displayName','75EftRjK','description','/api/node-toolbox/sql/save','label','(/*\x20params\x20*/);','success','/api/management/library/scripts/delete','2297313QtaETW','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','includeImports','totalCount','AbortError','//\x20SQL:\x20','/api/management/library/scripts/info?id=','const\x20data\x20=\x20await\x20client.sql.execute({','toLowerCase','apiError','modelCode','operations','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/app/getList','POST','error','isArray','\x20of\x20','status','currentPage','GET','const\x20results\x20=\x20data.execResult\x20||\x20[];','/api/management/library/scripts/statistics?appCode=','test','abort','.filter({','enabled','name','has','dataset_','Operation\x20\x22','sdk','object','API\x20error\x20code:\x20','json','.remove(id);','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','//\x20','method','map','push','tableName','/api/management/library/scripts/list?appCode=','47856sxTBII','requestFields','create','errorCode','\x20\x20return\x20rows;','signal','cookie','const\x20result\x20=\x20await\x20client.models.','functionName','\x20failed,\x20HTTP\x20'];a93_0x1d59=function(){return _0x271b9d;};return a93_0x1d59();}export async function deleteBffScript(_0x3bece9){const _0x50980f=a93_0x41b7;await apiRequest(_0x50980f(0x198),{'method':'POST','body':{'id':_0x3bece9}});}export async function getBffScriptStatistics(_0xe82af5){const _0x2f5049=a93_0x41b7,_0x4dc155=await apiRequest(_0x2f5049(0x1af)+_0xe82af5);return extractList(_0x4dc155[_0x2f5049(0x156)]);}export async function listBffDatasetOperations(_0x19c70b,_0x2374f2){const _0x45c8e2=a93_0x41b7,_0x289de3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x45c8e2(0x1a7),'body':{'appCode':_0x19c70b,'datasetId':_0x2374f2}});return _0x289de3['data'];}export async function listSqlQueries(_0x1ad1b2,_0x51f6be){const _0x448ff1=a93_0x41b7,_0x2981ae=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x1ad1b2,'currentPage':_0x51f6be?.[_0x448ff1(0x1ac)]??0x1,'pageSize':_0x51f6be?.[_0x448ff1(0x163)]??0x32,'sqlCode':_0x51f6be?.[_0x448ff1(0x171)],'sqlName':_0x51f6be?.[_0x448ff1(0x189)]}});return _0x2981ae[_0x448ff1(0x156)];}function a93_0x41b7(_0xe51fb8,_0x118081){_0xe51fb8=_0xe51fb8-0x156;const _0x1d5924=a93_0x1d59();let _0x41b779=_0x1d5924[_0xe51fb8];return _0x41b779;}export async function getSqlQueryInfo(_0x335cff,_0xde317){const _0x27444f=a93_0x41b7,_0x22d3b5=await listSqlQueries(_0x335cff,{'sqlCode':_0xde317}),_0x245a16=_0x22d3b5[_0x27444f(0x157)]?.[0x0];if(!_0x245a16)throw CliErrors['validation'](_0x27444f(0x182)+_0xde317);return _0x245a16;}export async function saveSqlQuery(_0x44cca7){const _0x5e360c=a93_0x41b7,_0x1c1df1=await apiRequest(_0x5e360c(0x194),{'method':'POST','body':_0x44cca7});return _0x1c1df1[_0x5e360c(0x156)];}export async function executeSql(_0x45fec0,_0x3da69b,_0x3500a8){const _0x1add13=a93_0x41b7,_0x12ab8c=await apiRequest('/api/custom/executeSql',{'method':_0x1add13(0x1a7),'body':{'appCode':_0x45fec0,'sqlCode':_0x3da69b,..._0x3500a8&&{'params':_0x3500a8}},'useRuntime':!![]});return _0x12ab8c[_0x1add13(0x156)];}export async function listDatasets(_0x19f893,_0x15e94e){const _0x36bbcd=a93_0x41b7,_0x366079={'appCode':_0x19f893,'deleted':![]};if(_0x15e94e?.['code'])_0x366079[_0x36bbcd(0x174)]=_0x15e94e[_0x36bbcd(0x174)];if(_0x15e94e?.[_0x36bbcd(0x1b4)])_0x366079['name']=_0x15e94e[_0x36bbcd(0x1b4)];const _0x3be1bb=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x36bbcd(0x1a7),'body':_0x366079});return extractList(_0x3be1bb['data']);}export async function searchDatasets(_0x28dd82,_0xb162cf){const _0x573a08=a93_0x41b7,_0x30eb08=await listDatasets(_0x28dd82,{'name':_0xb162cf}),_0x4a07f7=_0xb162cf['toLowerCase'](),_0x35ce99=new Set(_0x30eb08[_0x573a08(0x1c0)](_0x16d8ae=>_0x16d8ae['id'])),_0x5ccaba=_0x30eb08[_0x573a08(0x169)](_0x1cc134=>_0x1cc134[_0x573a08(0x15b)]?.[_0x573a08(0x1c2)]?.['toLowerCase']()['includes'](_0x4a07f7)||_0x1cc134[_0x573a08(0x193)]?.[_0x573a08(0x1a1)]()[_0x573a08(0x18a)](_0x4a07f7)),_0x1e1d62=await listDatasets(_0x28dd82,{'code':_0xb162cf});for(const _0x28c90b of _0x1e1d62){!_0x35ce99[_0x573a08(0x1b5)](_0x28c90b['id'])&&(_0x30eb08[_0x573a08(0x1c1)](_0x28c90b),_0x35ce99[_0x573a08(0x17e)](_0x28c90b['id']));}return _0x30eb08;}export function normalizeDatasetOperations(_0x7499ca){const _0x4940b8=a93_0x41b7;if(Array[_0x4940b8(0x1a9)](_0x7499ca))return _0x7499ca[_0x4940b8(0x169)](_0xe6e70=>_0xe6e70!=null&&typeof _0xe6e70==='object');if(_0x7499ca&&typeof _0x7499ca===_0x4940b8(0x1b9))return Object['entries'](_0x7499ca)[_0x4940b8(0x169)](([,_0x5461ac])=>_0x5461ac!=null&&typeof _0x5461ac==='object')[_0x4940b8(0x1c0)](([_0x34bca6,_0x3ef539])=>({..._0x3ef539,'name':_0x3ef539['name']??_0x3ef539[_0x4940b8(0x161)]??_0x34bca6}));return[];}export async function getDatasetDetail(_0x7efe7a){const _0x39f93a=a93_0x41b7,_0x275dfb=/^\d+$/[_0x39f93a(0x1b0)](_0x7efe7a)?'id':_0x39f93a(0x174),_0x34f86f=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x275dfb+'='+_0x7efe7a);return _0x34f86f[_0x39f93a(0x156)];}export async function getDatasetOperations(_0x343e3c){const _0x521965=a93_0x41b7,_0x866b1f=await getDatasetDetail(_0x343e3c),_0x3f4248=normalizeDatasetOperations(_0x866b1f[_0x521965(0x1a4)])['map'](_0x3494d2=>({'name':_0x3494d2[_0x521965(0x1b4)]||_0x3494d2[_0x521965(0x161)],'displayName':_0x3494d2[_0x521965(0x191)]||_0x3494d2['name'],'type':_0x3494d2['type'],'method':_0x3494d2[_0x521965(0x1bf)],'path':_0x3494d2[_0x521965(0x15a)],'enabled':_0x3494d2[_0x521965(0x1b3)]??!![],'requestFields':_0x3494d2[_0x521965(0x1c5)],'responseFields':_0x3494d2['responseFields']}));return{'dataset':{'id':_0x866b1f['id']??_0x866b1f[_0x521965(0x18e)],'name':_0x866b1f[_0x521965(0x1b4)],'code':_0x866b1f[_0x521965(0x174)]||_0x866b1f[_0x521965(0x1a3)],'tableName':_0x866b1f[_0x521965(0x1c2)]||_0x866b1f[_0x521965(0x15b)]?.[_0x521965(0x1c2)]},'operations':_0x3f4248};}export async function getOperationDetail(_0x4e8f2b,_0x4d42b1,_0x5165cd){const _0x1bf5cc=a93_0x41b7;let _0x147111=_0x4d42b1;if(!/^\d+$/['test'](_0x4d42b1)){const _0xc7a5aa=await listDatasets(_0x4e8f2b,{'code':_0x4d42b1}),_0x33f994=_0xc7a5aa[_0x1bf5cc(0x183)](_0x36b709=>_0x36b709[_0x1bf5cc(0x174)]===_0x4d42b1||String(_0x36b709['id'])===_0x4d42b1);if(!_0x33f994)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x185)+_0x4d42b1);_0x147111=String(_0x33f994['id']);}const _0x4dd589=await getDatasetDetail(_0x147111),_0x44e4=normalizeDatasetOperations(_0x4dd589[_0x1bf5cc(0x1a4)])['find'](_0x479797=>(_0x479797[_0x1bf5cc(0x1b4)]||_0x479797[_0x1bf5cc(0x161)])===_0x5165cd);if(!_0x44e4)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x1b7)+_0x5165cd+_0x1bf5cc(0x181)+_0x4d42b1);return{'dataset':{'id':_0x4dd589['id']??_0x4dd589[_0x1bf5cc(0x18e)],'name':_0x4dd589[_0x1bf5cc(0x1b4)],'code':_0x4dd589[_0x1bf5cc(0x174)]||_0x4dd589[_0x1bf5cc(0x1a3)],'tableName':_0x4dd589[_0x1bf5cc(0x1c2)]||_0x4dd589[_0x1bf5cc(0x15b)]?.[_0x1bf5cc(0x1c2)]},'operation':_0x44e4};}export function generateSdkCode(_0x46cef5,_0x37d355,_0x4a0a8b){const _0x38cceb=a93_0x41b7,_0x581a08=_0x4a0a8b?.['includeImports']??!![],_0x74b7e2=_0x38cceb(0x1b6)+_0x46cef5[_0x38cceb(0x174)]?.[_0x38cceb(0x190)](/-/g,'_'),_0x616fd3=_0x37d355[_0x38cceb(0x1b4)]||_0x37d355[_0x38cceb(0x161)]||_0x38cceb(0x169),_0x352ca8=[];_0x581a08&&_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x187),'',_0x38cceb(0x16a),'');_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1be)+_0x46cef5[_0x38cceb(0x1b4)]+'\x20('+(_0x46cef5[_0x38cceb(0x1c2)]||_0x38cceb(0x167))+')');if(_0x616fd3===_0x38cceb(0x169))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x1b2),'\x20\x20where:\x20{},',_0x38cceb(0x184),_0x38cceb(0x159),_0x38cceb(0x1ce));else{if(_0x616fd3==='getOne')_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x15f));else{if(_0x616fd3===_0x38cceb(0x1c6))_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x16f));else{if(_0x616fd3===_0x38cceb(0x16e))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x180));else _0x616fd3==='delete'||_0x616fd3===_0x38cceb(0x178)?_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x1bc)):_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+'.'+_0x616fd3+_0x38cceb(0x196));}}}return _0x352ca8[_0x38cceb(0x17f)]('\x0a');}export function generateSqlCodeTemplate(_0x139c17,_0x1aedbc){const _0x35331d=a93_0x41b7,_0x162abc=_0x1aedbc?.[_0x35331d(0x16b)]??_0x35331d(0x1b8),_0x3d9b7d=_0x1aedbc?.[_0x35331d(0x19b)]??!![],_0x1cebe8=[];return _0x1cebe8['push'](_0x35331d(0x19e)+_0x139c17['sqlName']+'\x20('+_0x139c17[_0x35331d(0x171)]+')'),_0x162abc===_0x35331d(0x1b8)?(_0x3d9b7d&&_0x1cebe8['push'](_0x35331d(0x187),'',_0x35331d(0x16a),''),_0x1cebe8[_0x35331d(0x1c1)](_0x35331d(0x1a0),'\x20\x20sqlCode:\x20\x27'+_0x139c17[_0x35331d(0x171)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x35331d(0x1ce),_0x35331d(0x19a),_0x35331d(0x1ae))):_0x1cebe8['push'](_0x35331d(0x1a5),_0x35331d(0x1bd),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x35331d(0x166)+_0x139c17['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x35331d(0x1c8),'}'),_0x1cebe8[_0x35331d(0x17f)]('\x0a');}export async function getErConfig(_0x415b6f,_0x1a30bf){const _0x2043f6=a93_0x41b7,_0x3d8750=await apiRequest(_0x2043f6(0x172),{'method':'POST','body':{'appCode':_0x415b6f,'dblinkId':_0x1a30bf}});return _0x3d8750[_0x2043f6(0x156)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x307362=a93_0x41b7,_0x3bd339=await apiRequest(_0x307362(0x1a6),{'method':_0x307362(0x1a7),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x8cae10=extractList(_0x3bd339[_0x307362(0x156)]),_0x25347e=extractPaging(_0x3bd339[_0x307362(0x156)]);return _0x25347e&&_0x25347e[_0x307362(0x19c)]>REMOTE_APP_PAGE_SIZE&&console[_0x307362(0x165)](_0x307362(0x17a)+REMOTE_APP_PAGE_SIZE+_0x307362(0x1aa)+_0x25347e[_0x307362(0x19c)]+_0x307362(0x175)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x8cae10;}
@@ -1 +1 @@
1
- function a94_0x56ab(_0x194ecf,_0x149e19){_0x194ecf=_0x194ecf-0x65;const _0x5da521=a94_0x5da5();let _0x56abf9=_0x5da521[_0x194ecf];return _0x56abf9;}const a94_0x85fbca=a94_0x56ab;(function(_0x5a41ef,_0xc2bcb){const _0x4b1bf0=a94_0x56ab,_0x54902a=_0x5a41ef();while(!![]){try{const _0x1597c7=parseInt(_0x4b1bf0(0x74))/0x1*(-parseInt(_0x4b1bf0(0x6c))/0x2)+parseInt(_0x4b1bf0(0x77))/0x3*(-parseInt(_0x4b1bf0(0x6a))/0x4)+parseInt(_0x4b1bf0(0x70))/0x5*(parseInt(_0x4b1bf0(0x75))/0x6)+parseInt(_0x4b1bf0(0x65))/0x7*(-parseInt(_0x4b1bf0(0x68))/0x8)+parseInt(_0x4b1bf0(0x71))/0x9*(-parseInt(_0x4b1bf0(0x69))/0xa)+-parseInt(_0x4b1bf0(0x6e))/0xb*(-parseInt(_0x4b1bf0(0x6d))/0xc)+parseInt(_0x4b1bf0(0x72))/0xd;if(_0x1597c7===_0xc2bcb)break;else _0x54902a['push'](_0x54902a['shift']());}catch(_0x126edc){_0x54902a['push'](_0x54902a['shift']());}}}(a94_0x5da5,0xb1b02));import{resolve}from'node:path';function a94_0x5da5(){const _0x8c0609=['3251733BPIpuH','13181mlTzzE','bff.lock.json','bff','1072fiAIbt','10gnuhGO','4ObXYdK','bff-trash','4knMzrY','16380qhdISr','9284BaRlOR','/bff','15310ceYFyk','3254949waGZoN','14967732SGReGm','cwd','598721lQPipt','2586eXlqfN','.rabetbase'];a94_0x5da5=function(){return _0x8c0609;};return a94_0x5da5();}const DOT_DIR=a94_0x85fbca(0x76),LOCK_FILE_NAME=a94_0x85fbca(0x66),TRASH_DIR_NAME=a94_0x85fbca(0x6b);export function loadBffProjectConfig(_0x52db59,_0x5e64ba){const _0x2a1068=a94_0x85fbca,_0x520c8e=resolve(_0x5e64ba??process[_0x2a1068(0x73)]()),_0x2ad0b9=DOT_DIR+_0x2a1068(0x6f),_0x38c9cc=_0x2ad0b9+'/'+_0x52db59;return{'projectRoot':_0x520c8e,'appCode':_0x52db59,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2ad0b9,'scriptsRoot':_0x38c9cc,'scriptsRootDir':resolve(_0x520c8e,DOT_DIR,_0x2a1068(0x67),_0x52db59),'lockFilePath':resolve(_0x520c8e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x520c8e,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a94_0xb064(_0x2012b0,_0x26c50b){_0x2012b0=_0x2012b0-0x1d1;const _0x3943af=a94_0x3943();let _0xb06466=_0x3943af[_0x2012b0];return _0xb06466;}function a94_0x3943(){const _0x1a738c=['1819350SIkQAi','1366320lYVHgQ','4670PmbuhC','18uXkEBq','bff-trash','.rabetbase','bff.lock.json','7KdazOr','cwd','/bff','7lrSivK','3428424XPBlFQ','7371630KHoSji','bff','25586OGryIw','3515168uVotqK','6782jCgALK'];a94_0x3943=function(){return _0x1a738c;};return a94_0x3943();}const a94_0x3cee22=a94_0xb064;(function(_0x5e0b25,_0x10752f){const _0x4bd037=a94_0xb064,_0x5daa9e=_0x5e0b25();while(!![]){try{const _0x1744b3=-parseInt(_0x4bd037(0x1e0))/0x1*(parseInt(_0x4bd037(0x1d8))/0x2)+parseInt(_0x4bd037(0x1d9))/0x3+parseInt(_0x4bd037(0x1d7))/0x4+parseInt(_0x4bd037(0x1da))/0x5*(-parseInt(_0x4bd037(0x1dc))/0x6)+-parseInt(_0x4bd037(0x1d2))/0x7*(parseInt(_0x4bd037(0x1d3))/0x8)+-parseInt(_0x4bd037(0x1d4))/0x9+-parseInt(_0x4bd037(0x1db))/0xa*(-parseInt(_0x4bd037(0x1d6))/0xb);if(_0x1744b3===_0x10752f)break;else _0x5daa9e['push'](_0x5daa9e['shift']());}catch(_0x284f26){_0x5daa9e['push'](_0x5daa9e['shift']());}}}(a94_0x3943,0x7544c));import{resolve}from'node:path';const DOT_DIR=a94_0x3cee22(0x1de),LOCK_FILE_NAME=a94_0x3cee22(0x1df),TRASH_DIR_NAME=a94_0x3cee22(0x1dd);export function loadBffProjectConfig(_0x3e5639,_0x486920){const _0x4f2f54=a94_0x3cee22,_0x461f59=resolve(_0x486920??process[_0x4f2f54(0x1e1)]()),_0x3b85b1=DOT_DIR+_0x4f2f54(0x1d1),_0x11e57e=_0x3b85b1+'/'+_0x3e5639;return{'projectRoot':_0x461f59,'appCode':_0x3e5639,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3b85b1,'scriptsRoot':_0x11e57e,'scriptsRootDir':resolve(_0x461f59,DOT_DIR,_0x4f2f54(0x1d5),_0x3e5639),'lockFilePath':resolve(_0x461f59,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x461f59,DOT_DIR,TRASH_DIR_NAME)};}