@lovrabet/rabetbase-cli 2.0.9 → 2.0.11

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 -0
  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 +2 -2
@@ -1 +1 @@
1
- const a81_0x1fc4a5=a81_0x57d2;function a81_0x57d2(_0x3a18d6,_0x366edf){_0x3a18d6=_0x3a18d6-0x1ea;const _0x6ca37c=a81_0x6ca3();let _0x57d2f3=_0x6ca37c[_0x3a18d6];return _0x57d2f3;}(function(_0x8d7ea1,_0x1155c2){const _0x3236cd=a81_0x57d2,_0x316ce2=_0x8d7ea1();while(!![]){try{const _0x401c86=parseInt(_0x3236cd(0x1f7))/0x1+parseInt(_0x3236cd(0x1f2))/0x2*(-parseInt(_0x3236cd(0x1ff))/0x3)+parseInt(_0x3236cd(0x1fb))/0x4*(parseInt(_0x3236cd(0x1f9))/0x5)+-parseInt(_0x3236cd(0x1f1))/0x6+-parseInt(_0x3236cd(0x1ee))/0x7+-parseInt(_0x3236cd(0x1f3))/0x8*(-parseInt(_0x3236cd(0x1f8))/0x9)+parseInt(_0x3236cd(0x1fe))/0xa;if(_0x401c86===_0x1155c2)break;else _0x316ce2['push'](_0x316ce2['shift']());}catch(_0x338682){_0x316ce2['push'](_0x316ce2['shift']());}}}(a81_0x6ca3,0x774e3));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a81_0x6ca3(){const _0x1ddede=['sqlCode','1272870ASUrkq','969694RylTQx','8JnechQ','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','dbId','582223nSRDco','4248468yRUIPk','5kXrguE','sql','346348ivzlVB','verbose','sqlContent','12514900tfgyLw','6QSNyLv','bool','description','str','read','detail','5052866DCtwhw','Return\x20full\x20raw\x20SQL\x20query\x20object'];a81_0x6ca3=function(){return _0x1ddede;};return a81_0x6ca3();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a81_0x1fc4a5(0x1fa),'command':a81_0x1fc4a5(0x1ed),'description':a81_0x1fc4a5(0x1f5),'risk':a81_0x1fc4a5(0x1ec),'flags':[SQLCODE_FLAG,{'name':'verbose','type':'boolean','description':a81_0x1fc4a5(0x1ef)}],async 'execute'(_0x1729be){const _0x3ab867=a81_0x1fc4a5,_0x4f9fac=await getSqlQueryInfo(_0x1729be['appCode'],_0x1729be[_0x3ab867(0x1eb)](_0x3ab867(0x1f4))),_0x2de466=_0x1729be[_0x3ab867(0x200)](_0x3ab867(0x1fc));if(_0x2de466)return{'ok':!![],'data':_0x4f9fac};const _0x168ac0=_0x4f9fac['dbId']?await getDbName(_0x1729be['appCode'],_0x4f9fac[_0x3ab867(0x1f6)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4f9fac[_0x3ab867(0x1f0)],'sqlName':_0x4f9fac['sqlName'],'db':_0x168ac0?_0x168ac0+'\x20('+_0x4f9fac[_0x3ab867(0x1f6)]+')':_0x4f9fac[_0x3ab867(0x1f6)]??'','description':_0x4f9fac[_0x3ab867(0x1ea)]??'','sqlContent':_0x4f9fac[_0x3ab867(0x1fd)]??''}};}};
1
+ function a81_0x4309(_0x385cf0,_0xcf4ebc){_0x385cf0=_0x385cf0-0x1f0;const _0x592f76=a81_0x592f();let _0x430964=_0x592f76[_0x385cf0];return _0x430964;}const a81_0x4e3c95=a81_0x4309;(function(_0x118a0c,_0x11e10a){const _0x34aaed=a81_0x4309,_0x12b398=_0x118a0c();while(!![]){try{const _0x51034b=-parseInt(_0x34aaed(0x1ff))/0x1*(-parseInt(_0x34aaed(0x1fe))/0x2)+parseInt(_0x34aaed(0x206))/0x3*(-parseInt(_0x34aaed(0x1fd))/0x4)+-parseInt(_0x34aaed(0x209))/0x5*(parseInt(_0x34aaed(0x201))/0x6)+-parseInt(_0x34aaed(0x205))/0x7+-parseInt(_0x34aaed(0x1fa))/0x8*(parseInt(_0x34aaed(0x1f5))/0x9)+parseInt(_0x34aaed(0x1f3))/0xa*(-parseInt(_0x34aaed(0x1f2))/0xb)+parseInt(_0x34aaed(0x204))/0xc;if(_0x51034b===_0x11e10a)break;else _0x12b398['push'](_0x12b398['shift']());}catch(_0x16932e){_0x12b398['push'](_0x12b398['shift']());}}}(a81_0x592f,0x43a48));import{getSqlQueryInfo}from'../../core/api-client.js';function a81_0x592f(){const _0x376677=['1360653TSIVXo','sqlName','sql','5BkGYUs','dbId','sqlContent','619465xoFjGn','70uwijEE','boolean','2060919zeEjma','description','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','bool','16mfHHYb','sqlCode','detail','4ezgYRC','20wjWHOJ','25349KqjCPu','read','2554800FpiAdW','appCode','Return\x20full\x20raw\x20SQL\x20query\x20object','26187468QAlDKV','2990239QnTnRM'];a81_0x592f=function(){return _0x376677;};return a81_0x592f();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a81_0x4e3c95(0x208),'command':a81_0x4e3c95(0x1fc),'description':a81_0x4e3c95(0x1f8),'risk':a81_0x4e3c95(0x200),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a81_0x4e3c95(0x1f4),'description':a81_0x4e3c95(0x203)}],async 'execute'(_0x278a4c){const _0x142a2d=a81_0x4e3c95,_0x393f97=await getSqlQueryInfo(_0x278a4c[_0x142a2d(0x202)],_0x278a4c['str'](_0x142a2d(0x1f7))),_0x42a72a=_0x278a4c[_0x142a2d(0x1f9)]('verbose');if(_0x42a72a)return{'ok':!![],'data':_0x393f97};const _0x26a1ff=_0x393f97[_0x142a2d(0x1f0)]?await getDbName(_0x278a4c[_0x142a2d(0x202)],_0x393f97[_0x142a2d(0x1f0)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x393f97[_0x142a2d(0x1fb)],'sqlName':_0x393f97[_0x142a2d(0x207)],'db':_0x26a1ff?_0x26a1ff+'\x20('+_0x393f97[_0x142a2d(0x1f0)]+')':_0x393f97[_0x142a2d(0x1f0)]??'','description':_0x393f97[_0x142a2d(0x1f6)]??'','sqlContent':_0x393f97[_0x142a2d(0x1f1)]??''}};}};
@@ -1 +1 @@
1
- const a82_0x17cb7d=a82_0x55df;(function(_0x1c5fce,_0x104a9a){const _0x7ceb05=a82_0x55df,_0x294a0d=_0x1c5fce();while(!![]){try{const _0x2fe2a5=parseInt(_0x7ceb05(0x1e1))/0x1+-parseInt(_0x7ceb05(0x1f5))/0x2+parseInt(_0x7ceb05(0x1e7))/0x3+parseInt(_0x7ceb05(0x1f1))/0x4*(parseInt(_0x7ceb05(0x1f8))/0x5)+-parseInt(_0x7ceb05(0x1e5))/0x6*(-parseInt(_0x7ceb05(0x1e8))/0x7)+parseInt(_0x7ceb05(0x1e4))/0x8*(-parseInt(_0x7ceb05(0x1ef))/0x9)+-parseInt(_0x7ceb05(0x1f2))/0xa;if(_0x2fe2a5===_0x104a9a)break;else _0x294a0d['push'](_0x294a0d['shift']());}catch(_0x272de3){_0x294a0d['push'](_0x294a0d['shift']());}}}(a82_0x4581,0x5c94c));function a82_0x55df(_0x24691f,_0x24c431){_0x24691f=_0x24691f-0x1e1;const _0x45812c=a82_0x4581();let _0x55df2b=_0x45812c[_0x24691f];return _0x55df2b;}function a82_0x4581(){const _0x540e84=['sqlcode','str','execResult','validation','exec','14607TiljVX','\x20row(s)\x20in\x20','4uYytQP','3216460TiYwuI','params','length','1281742zqaTVr','appCode','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','2269780XWpjko','execError','now','execSuccess','sql','674404EkXTNr','isArray','SQL\x20execution\x20failed','2648Sakiqz','6GVGzVp','string','325464yeJVVo','4494658uOsFUF','Invalid\x20JSON\x20for\x20--params:\x20'];a82_0x4581=function(){return _0x540e84;};return a82_0x4581();}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_0x17cb7d(0x1fc),'command':a82_0x17cb7d(0x1ee),'description':a82_0x17cb7d(0x1f7),'risk':'read','flags':[SQLCODE_FLAG,{'name':a82_0x17cb7d(0x1f3),'type':a82_0x17cb7d(0x1e6),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x38585d){const _0xf390a=a82_0x17cb7d;let _0x4133b2;const _0x5e7b75=_0x38585d[_0xf390a(0x1eb)]('params');if(_0x5e7b75)try{_0x4133b2=JSON['parse'](_0x5e7b75);}catch{throw CliErrors[_0xf390a(0x1ed)](_0xf390a(0x1e9)+_0x5e7b75);}const _0x3894da=Date[_0xf390a(0x1fa)](),_0x24b219=await executeSql(_0x38585d[_0xf390a(0x1f6)],_0x38585d[_0xf390a(0x1eb)](_0xf390a(0x1ea)),_0x4133b2),_0x3f5db4=Date[_0xf390a(0x1fa)]()-_0x3894da,_0x54bfe4=_0x24b219?.[_0xf390a(0x1ec)]??_0x24b219,_0x3a6cf9=_0x24b219?.[_0xf390a(0x1fb)]??!![];if(!_0x3a6cf9)return{'ok':![],'data':{'error':_0x24b219?.[_0xf390a(0x1f9)]||'SQL\x20execution\x20failed','elapsed':_0x3f5db4},'message':_0xf390a(0x1e3)};const _0xf4fb18=Array[_0xf390a(0x1e2)](_0x54bfe4)?_0x54bfe4:[];return{'ok':!![],'data':{'rows':_0xf4fb18,'rowCount':_0xf4fb18[_0xf390a(0x1f4)],'elapsed':_0x3f5db4},'message':'Returned\x20'+_0xf4fb18['length']+_0xf390a(0x1f0)+_0x3f5db4+'ms'};}};
1
+ const a82_0x104b23=a82_0x5697;(function(_0x34090b,_0x5020f7){const _0xe5d720=a82_0x5697,_0x41ea98=_0x34090b();while(!![]){try{const _0x2207f9=parseInt(_0xe5d720(0xd6))/0x1+-parseInt(_0xe5d720(0xd4))/0x2+-parseInt(_0xe5d720(0xcb))/0x3*(-parseInt(_0xe5d720(0xbf))/0x4)+parseInt(_0xe5d720(0xc0))/0x5+-parseInt(_0xe5d720(0xc1))/0x6+-parseInt(_0xe5d720(0xcf))/0x7*(-parseInt(_0xe5d720(0xc8))/0x8)+-parseInt(_0xe5d720(0xbe))/0x9*(parseInt(_0xe5d720(0xd1))/0xa);if(_0x2207f9===_0x5020f7)break;else _0x41ea98['push'](_0x41ea98['shift']());}catch(_0xc865d4){_0x41ea98['push'](_0x41ea98['shift']());}}}(a82_0x7efb,0x9903b));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a82_0x7efb(){const _0x26d614=['Invalid\x20JSON\x20for\x20--params:\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','parse','string','execError','4890744tVzmto','isArray','appCode','2697BwNDTG','length','validation','sql','14uUJvSG','str','10RktTgA','execSuccess','params','411152VRKpgS','execResult','774441uKwTBb','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','now','Returned\x20','exec','19006398nYgABi','1448Ymgekp','4301660QmiWVV','1432512aZOBWG','SQL\x20execution\x20failed'];a82_0x7efb=function(){return _0x26d614;};return a82_0x7efb();}function a82_0x5697(_0x180a90,_0x14b9df){_0x180a90=_0x180a90-0xbb;const _0x7efbd0=a82_0x7efb();let _0x5697a9=_0x7efbd0[_0x180a90];return _0x5697a9;}export const sqlExec={'service':a82_0x104b23(0xce),'command':a82_0x104b23(0xbd),'description':a82_0x104b23(0xd7),'risk':'read','flags':[SQLCODE_FLAG,{'name':'params','type':a82_0x104b23(0xc6),'description':a82_0x104b23(0xc4)}],async 'execute'(_0x324cd6){const _0x56ceb5=a82_0x104b23;let _0x18f65d;const _0x36930d=_0x324cd6[_0x56ceb5(0xd0)](_0x56ceb5(0xd3));if(_0x36930d)try{_0x18f65d=JSON[_0x56ceb5(0xc5)](_0x36930d);}catch{throw CliErrors[_0x56ceb5(0xcd)](_0x56ceb5(0xc3)+_0x36930d);}const _0x2f10c8=Date[_0x56ceb5(0xbb)](),_0x31f6b2=await executeSql(_0x324cd6[_0x56ceb5(0xca)],_0x324cd6['str']('sqlcode'),_0x18f65d),_0x2922c1=Date[_0x56ceb5(0xbb)]()-_0x2f10c8,_0x3fe41d=_0x31f6b2?.[_0x56ceb5(0xd5)]??_0x31f6b2,_0x2b11d7=_0x31f6b2?.[_0x56ceb5(0xd2)]??!![];if(!_0x2b11d7)return{'ok':![],'data':{'error':_0x31f6b2?.[_0x56ceb5(0xc7)]||_0x56ceb5(0xc2),'elapsed':_0x2922c1},'message':_0x56ceb5(0xc2)};const _0x299cc1=Array[_0x56ceb5(0xc9)](_0x3fe41d)?_0x3fe41d:[];return{'ok':!![],'data':{'rows':_0x299cc1,'rowCount':_0x299cc1[_0x56ceb5(0xcc)],'elapsed':_0x2922c1},'message':_0x56ceb5(0xbc)+_0x299cc1['length']+'\x20row(s)\x20in\x20'+_0x2922c1+'ms'};}};
@@ -1 +1 @@
1
- function a83_0x29ca(_0x241729,_0x546266){_0x241729=_0x241729-0x148;const _0x5750be=a83_0x5750();let _0x29caec=_0x5750be[_0x241729];return _0x29caec;}(function(_0x1cacfe,_0x9ce883){const _0x5b2c91=a83_0x29ca,_0x9ad45d=_0x1cacfe();while(!![]){try{const _0x29926a=parseInt(_0x5b2c91(0x14a))/0x1*(parseInt(_0x5b2c91(0x151))/0x2)+-parseInt(_0x5b2c91(0x148))/0x3+-parseInt(_0x5b2c91(0x14f))/0x4*(-parseInt(_0x5b2c91(0x14d))/0x5)+parseInt(_0x5b2c91(0x14c))/0x6+parseInt(_0x5b2c91(0x150))/0x7+-parseInt(_0x5b2c91(0x14b))/0x8*(parseInt(_0x5b2c91(0x149))/0x9)+-parseInt(_0x5b2c91(0x14e))/0xa;if(_0x29926a===_0x9ce883)break;else _0x9ad45d['push'](_0x9ad45d['shift']());}catch(_0x384429){_0x9ad45d['push'](_0x9ad45d['shift']());}}}(a83_0x5750,0x67fc0));function a83_0x5750(){const _0x2c5f1f=['49856IovSSd','1459619zJeGBh','6oBzvYO','67758mslhVu','90JUpUit','113268sxlGad','300048Vtakqm','3595956YjTqdN','10zbGBhA','3490090GDfGBI'];a83_0x5750=function(){return _0x2c5f1f;};return a83_0x5750();}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';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec];
1
+ (function(_0x5cf007,_0x1f93a2){const _0x5011c2=a83_0x3c3c,_0x6d5ea3=_0x5cf007();while(!![]){try{const _0xf7e595=parseInt(_0x5011c2(0x7b))/0x1+parseInt(_0x5011c2(0x74))/0x2*(-parseInt(_0x5011c2(0x76))/0x3)+-parseInt(_0x5011c2(0x7a))/0x4+parseInt(_0x5011c2(0x77))/0x5*(-parseInt(_0x5011c2(0x79))/0x6)+-parseInt(_0x5011c2(0x7c))/0x7+parseInt(_0x5011c2(0x78))/0x8+parseInt(_0x5011c2(0x75))/0x9;if(_0xf7e595===_0x1f93a2)break;else _0x6d5ea3['push'](_0x6d5ea3['shift']());}catch(_0x492f09){_0x6d5ea3['push'](_0x6d5ea3['shift']());}}}(a83_0x43fd,0x94dc3));import{sqlList}from'../../commands/sql/list.js';function a83_0x43fd(){const _0x394678=['3064128mxaYXt','326604jcpBRb','2673812pGBwEt','504102NRpiea','6732341mtMAOP','1456620CUarnY','19220157OMDyqw','3yiqdcD','5wLAMfd'];a83_0x43fd=function(){return _0x394678;};return a83_0x43fd();}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a83_0x3c3c(_0x1703d3,_0x5d383e){_0x1703d3=_0x1703d3-0x74;const _0x43fde2=a83_0x43fd();let _0x3c3c47=_0x43fde2[_0x1703d3];return _0x3c3c47;}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
- const a84_0x3c6129=a84_0x46a1;(function(_0x359046,_0x5006a7){const _0x155ec7=a84_0x46a1,_0x20f4e2=_0x359046();while(!![]){try{const _0x233b64=parseInt(_0x155ec7(0x198))/0x1+parseInt(_0x155ec7(0x18e))/0x2*(-parseInt(_0x155ec7(0x18d))/0x3)+parseInt(_0x155ec7(0x197))/0x4+-parseInt(_0x155ec7(0x196))/0x5*(-parseInt(_0x155ec7(0x178))/0x6)+-parseInt(_0x155ec7(0x183))/0x7*(parseInt(_0x155ec7(0x185))/0x8)+parseInt(_0x155ec7(0x195))/0x9*(-parseInt(_0x155ec7(0x181))/0xa)+-parseInt(_0x155ec7(0x191))/0xb*(-parseInt(_0x155ec7(0x17a))/0xc);if(_0x233b64===_0x5006a7)break;else _0x20f4e2['push'](_0x20f4e2['shift']());}catch(_0x3d828e){_0x20f4e2['push'](_0x20f4e2['shift']());}}}(a84_0x27fa,0xe1024));import{listSqlQueries}from'../../core/api-client.js';function a84_0x46a1(_0x3a223f,_0x5307a2){_0x3a223f=_0x3a223f-0x174;const _0x27fa36=a84_0x27fa();let _0x46a171=_0x27fa36[_0x3a223f];return _0x46a171;}import{getDbName}from'../../core/db-resolver.js';function a84_0x27fa(){const _0xfbee00=['No\x20custom\x20SQL\x20queries\x20found.','Found\x20','593769Aepvpf','dbId','sqlName','paging','146475wUoiVh','34135ufPxJL','1599040ZlrTxX','911722zOIzMt','tableData','sqlCode','\x20SQL\x20queries\x20(total:\x20','sql','name','bool','read','1464zEnqPr','appCode','396WQagni','verbose','pagesize','str','sqlcode','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','description','580azEUma','Page\x20size','7724479JbGSrA','Page\x20number','8CllVST','number','length','string','Filter\x20by\x20SQL\x20name','page','totalCount','num','5368482fVReOl','2zWjSDk'];a84_0x27fa=function(){return _0xfbee00;};return a84_0x27fa();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a84_0x3c6129(0x174),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a84_0x3c6129(0x177),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x3c6129(0x175),'type':a84_0x3c6129(0x188),'description':a84_0x3c6129(0x189)},{'name':a84_0x3c6129(0x18a),'type':a84_0x3c6129(0x186),'description':a84_0x3c6129(0x184),'default':0x1},{'name':a84_0x3c6129(0x17c),'type':a84_0x3c6129(0x186),'description':a84_0x3c6129(0x182)},{'name':'verbose','type':'boolean','description':a84_0x3c6129(0x17f)}],async 'execute'(_0xc03812){const _0x18a130=a84_0x3c6129,_0x345ce5=await listSqlQueries(_0xc03812[_0x18a130(0x179)],{'sqlCode':_0xc03812[_0x18a130(0x17d)](_0x18a130(0x17e))||undefined,'sqlName':_0xc03812['str']('name')||undefined,'currentPage':_0xc03812[_0x18a130(0x18c)]('page'),'pageSize':_0xc03812['num'](_0x18a130(0x17c),0x32)}),_0x4e038e=_0xc03812[_0x18a130(0x176)](_0x18a130(0x17b)),_0x989a1c=_0x345ce5[_0x18a130(0x199)]??[],_0x353565=_0x345ce5[_0x18a130(0x194)]?.[_0x18a130(0x18b)]??_0x989a1c[_0x18a130(0x187)];let _0x4f709e;return _0x4e038e?_0x4f709e=_0x989a1c:_0x4f709e=await Promise['all'](_0x989a1c['map'](async _0x247285=>{const _0x55cf42=_0x18a130,_0x471b86=_0x247285[_0x55cf42(0x192)]?await getDbName(_0xc03812[_0x55cf42(0x179)],_0x247285[_0x55cf42(0x192)]):undefined;return{'sqlCode':_0x247285[_0x55cf42(0x19a)],'sqlName':_0x247285[_0x55cf42(0x193)],'description':_0x247285[_0x55cf42(0x180)]??'','db':_0x471b86?_0x471b86+'\x20('+_0x247285[_0x55cf42(0x192)]+')':_0x247285[_0x55cf42(0x192)]??''};})),{'ok':!![],'data':_0x4f709e,'message':_0x989a1c['length']===0x0?_0x18a130(0x18f):_0x18a130(0x190)+_0x989a1c['length']+_0x18a130(0x19b)+_0x353565+').'};}};
1
+ const a84_0x3cc2d9=a84_0x23ad;function a84_0x23ad(_0x18ed19,_0x35ce21){_0x18ed19=_0x18ed19-0xda;const _0x1ab13a=a84_0x1ab1();let _0x23ad14=_0x1ab13a[_0x18ed19];return _0x23ad14;}function a84_0x1ab1(){const _0x26587f=['5802962CFJsuw','sqlName','bool','2988bHlYBe','sqlcode','Found\x20','pagesize','2172527iqcdJt','str','39411GGAElS','page','num','name','35256LpEeeX','List\x20custom\x20SQL\x20queries','2670TXYugd','string','list','3222npvIPW','\x20SQL\x20queries\x20(total:\x20','number','totalCount','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','appCode','sqlCode','Filter\x20by\x20SQL\x20name','dbId','14065nrKlGB','5565856TeeaKP','Page\x20size','length','105236xGbFOn','boolean','3EdUxse','map','tableData','27RRhXcL','8jSwMKu','verbose','No\x20custom\x20SQL\x20queries\x20found.','sql'];a84_0x1ab1=function(){return _0x26587f;};return a84_0x1ab1();}(function(_0x3d2e39,_0x1c65e4){const _0x388bd7=a84_0x23ad,_0x3c1860=_0x3d2e39();while(!![]){try{const _0x4011e5=parseInt(_0x388bd7(0xf0))/0x1*(-parseInt(_0x388bd7(0xeb))/0x2)+parseInt(_0x388bd7(0xed))/0x3*(parseInt(_0x388bd7(0xe8))/0x4)+parseInt(_0x388bd7(0xe7))/0x5*(parseInt(_0x388bd7(0xde))/0x6)+-parseInt(_0x388bd7(0xfc))/0x7*(-parseInt(_0x388bd7(0xf1))/0x8)+-parseInt(_0x388bd7(0xfe))/0x9*(parseInt(_0x388bd7(0xdb))/0xa)+-parseInt(_0x388bd7(0xf5))/0xb+-parseInt(_0x388bd7(0xf8))/0xc*(-parseInt(_0x388bd7(0x102))/0xd);if(_0x4011e5===_0x1c65e4)break;else _0x3c1860['push'](_0x3c1860['shift']());}catch(_0x2891fa){_0x3c1860['push'](_0x3c1860['shift']());}}}(a84_0x1ab1,0xbc0e1));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_0x3cc2d9(0xf4),'command':a84_0x3cc2d9(0xdd),'description':a84_0x3cc2d9(0xda),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x3cc2d9(0x101),'type':a84_0x3cc2d9(0xdc),'description':a84_0x3cc2d9(0xe5)},{'name':'page','type':a84_0x3cc2d9(0xe0),'description':'Page\x20number','default':0x1},{'name':a84_0x3cc2d9(0xfb),'type':a84_0x3cc2d9(0xe0),'description':a84_0x3cc2d9(0xe9)},{'name':a84_0x3cc2d9(0xf2),'type':a84_0x3cc2d9(0xec),'description':a84_0x3cc2d9(0xe2)}],async 'execute'(_0x57b16c){const _0x8931fb=a84_0x3cc2d9,_0xa8aaa3=await listSqlQueries(_0x57b16c[_0x8931fb(0xe3)],{'sqlCode':_0x57b16c[_0x8931fb(0xfd)](_0x8931fb(0xf9))||undefined,'sqlName':_0x57b16c[_0x8931fb(0xfd)](_0x8931fb(0x101))||undefined,'currentPage':_0x57b16c[_0x8931fb(0x100)](_0x8931fb(0xff)),'pageSize':_0x57b16c['num']('pagesize',0x32)}),_0x492c9c=_0x57b16c[_0x8931fb(0xf7)](_0x8931fb(0xf2)),_0x229b63=_0xa8aaa3[_0x8931fb(0xef)]??[],_0x437e4f=_0xa8aaa3['paging']?.[_0x8931fb(0xe1)]??_0x229b63[_0x8931fb(0xea)];let _0x2a635e;return _0x492c9c?_0x2a635e=_0x229b63:_0x2a635e=await Promise['all'](_0x229b63[_0x8931fb(0xee)](async _0x4bbc7a=>{const _0x27ff8c=_0x8931fb,_0x2a6f14=_0x4bbc7a[_0x27ff8c(0xe6)]?await getDbName(_0x57b16c[_0x27ff8c(0xe3)],_0x4bbc7a[_0x27ff8c(0xe6)]):undefined;return{'sqlCode':_0x4bbc7a[_0x27ff8c(0xe4)],'sqlName':_0x4bbc7a[_0x27ff8c(0xf6)],'description':_0x4bbc7a['description']??'','db':_0x2a6f14?_0x2a6f14+'\x20('+_0x4bbc7a[_0x27ff8c(0xe6)]+')':_0x4bbc7a[_0x27ff8c(0xe6)]??''};})),{'ok':!![],'data':_0x2a635e,'message':_0x229b63[_0x8931fb(0xea)]===0x0?_0x8931fb(0xf3):_0x8931fb(0xfa)+_0x229b63[_0x8931fb(0xea)]+_0x8931fb(0xdf)+_0x437e4f+').'};}};
@@ -1 +1 @@
1
- const a85_0x2b6578=a85_0x2db0;(function(_0x191bc9,_0x500fa1){const _0x24b3db=a85_0x2db0,_0x2785fd=_0x191bc9();while(!![]){try{const _0x167b89=-parseInt(_0x24b3db(0x196))/0x1+parseInt(_0x24b3db(0x1b7))/0x2+parseInt(_0x24b3db(0x194))/0x3*(-parseInt(_0x24b3db(0x1ad))/0x4)+-parseInt(_0x24b3db(0x19b))/0x5+-parseInt(_0x24b3db(0x1a3))/0x6+parseInt(_0x24b3db(0x19a))/0x7+parseInt(_0x24b3db(0x1b6))/0x8;if(_0x167b89===_0x500fa1)break;else _0x2785fd['push'](_0x2785fd['shift']());}catch(_0x549c00){_0x2785fd['push'](_0x2785fd['shift']());}}}(a85_0x58da,0x31b32));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';function a85_0x58da(){const _0x57146f=['213TgoDhY','tables','296439DXRSNS','Created','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','sqlName','1513575icMrQW','1010490kUODry','\x20|\x20Params:\x20','parameters','sqlcode','dbId','Path\x20to\x20the\x20SQL\x20file','\x20chars)','SQL\x20query\x20display\x20name','1303308IxkWgu','Type:\x20','type','message','SQL\x20validation\x20failed:\x20','\x20|\x20Tables:\x20','length','sql','File\x20not\x20found:\x20','utf-8','5732Mwdnjv','save','str','none','N/A','join','validation','description','appCode','3847344vNVnfZ','647850jAAPcv','sqlname','Updated','sqlType','cwd','string','dbName','action','Validation:\x20','Conflict\x20detected','\x20successfully','file','write','/api/node-toolbox/sql/save','sqlCode'];a85_0x58da=function(){return _0x57146f;};return a85_0x58da();}import{CliErrors}from'../../errors.js';function a85_0x2db0(_0x41d308,_0x5ad2c3){_0x41d308=_0x41d308-0x188;const _0x58daca=a85_0x58da();let _0x2db0f3=_0x58daca[_0x41d308];return _0x2db0f3;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x2b6578(0x1aa),'command':a85_0x2b6578(0x1ae),'description':a85_0x2b6578(0x198),'risk':a85_0x2b6578(0x191),'flags':[{'name':a85_0x2b6578(0x190),'type':a85_0x2b6578(0x18a),'required':!![],'description':a85_0x2b6578(0x1a0)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a85_0x2b6578(0x18a),'description':a85_0x2b6578(0x1a2)},{'name':'db','type':a85_0x2b6578(0x18a),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a85_0x2b6578(0x1b4),'type':a85_0x2b6578(0x18a),'description':'SQL\x20query\x20description'}],async 'validate'(_0x3fda45){const _0x4eee87=a85_0x2b6578,_0x4b7e50=resolve(process[_0x4eee87(0x189)](),_0x3fda45[_0x4eee87(0x1af)](_0x4eee87(0x190)));if(!existsSync(_0x4b7e50))throw CliErrors[_0x4eee87(0x1b3)](_0x4eee87(0x1ab)+_0x4b7e50);const _0x2501ed=readFileSync(_0x4b7e50,_0x4eee87(0x1ac)),_0x9636ef=validateSql(_0x2501ed);if(!_0x9636ef['valid'])throw CliErrors[_0x4eee87(0x1b3)](_0x4eee87(0x1a7)+_0x9636ef['message']);},async 'dryRun'(_0x357b69){const _0x4076a3=a85_0x2b6578,_0x4ac63d=resolve(process[_0x4076a3(0x189)](),_0x357b69[_0x4076a3(0x1af)]('file')),_0x261571=readFileSync(_0x4ac63d,'utf-8'),_0x4dae9a=validateSql(_0x261571),_0x516790=_0x357b69[_0x4076a3(0x1af)]('db')||undefined,{db:_0x3d94cb,error:_0x30f2e4}=await resolveOneDb(_0x357b69[_0x4076a3(0x1b5)],_0x516790);return{'method':'POST','url':_0x4076a3(0x192),'body':{'appCode':_0x357b69[_0x4076a3(0x1b5)],'sqlContent':'('+_0x261571[_0x4076a3(0x1a9)]+_0x4076a3(0x1a1),'sqlCode':_0x357b69[_0x4076a3(0x1af)](_0x4076a3(0x19e))||undefined,'sqlName':_0x357b69[_0x4076a3(0x1af)](_0x4076a3(0x1b8))||undefined,'db':_0x3d94cb?_0x3d94cb[_0x4076a3(0x18b)]+'\x20('+_0x3d94cb[_0x4076a3(0x19f)]+')':_0x30f2e4},'description':['Save\x20SQL\x20query\x20from\x20'+_0x357b69[_0x4076a3(0x1af)](_0x4076a3(0x190)),_0x4076a3(0x18d)+_0x4dae9a[_0x4076a3(0x1a6)],_0x4076a3(0x1a4)+_0x4dae9a[_0x4076a3(0x188)][_0x4076a3(0x1a5)]+_0x4076a3(0x1a8)+(_0x4dae9a[_0x4076a3(0x195)]['join'](',\x20')||_0x4076a3(0x1b1))+_0x4076a3(0x19c)+(_0x4dae9a[_0x4076a3(0x19d)][_0x4076a3(0x1b2)](',\x20')||_0x4076a3(0x1b0))][_0x4076a3(0x1b2)]('\x0a')};},async 'execute'(_0x18f440){const _0x1e0232=a85_0x2b6578,_0x229011=resolve(process[_0x1e0232(0x189)](),_0x18f440[_0x1e0232(0x1af)](_0x1e0232(0x190))),_0x323af3=readFileSync(_0x229011,_0x1e0232(0x1ac)),_0x416bd7=_0x18f440[_0x1e0232(0x1af)]('db')||undefined,{db:_0x1e7297,error:_0x4cd42e}=await resolveOneDb(_0x18f440['appCode'],_0x416bd7);if(_0x4cd42e)throw CliErrors[_0x1e0232(0x1b3)](_0x4cd42e);const _0x3a9083=await saveSqlQuery({'appCode':_0x18f440[_0x1e0232(0x1b5)],'sqlContent':_0x323af3,'sqlCode':_0x18f440[_0x1e0232(0x1af)](_0x1e0232(0x19e))||undefined,'sqlName':_0x18f440[_0x1e0232(0x1af)](_0x1e0232(0x1b8))||undefined,'dbId':_0x1e7297[_0x1e0232(0x19f)],'description':_0x18f440['str']('description')||undefined});if(_0x3a9083['blocked'])return{'ok':![],'data':_0x3a9083,'message':_0x3a9083[_0x1e0232(0x1a6)]||_0x1e0232(0x18e)};return{'ok':!![],'data':{'sqlCode':_0x3a9083[_0x1e0232(0x193)],'sqlName':_0x3a9083[_0x1e0232(0x199)],'action':_0x3a9083['action']},'message':(_0x3a9083[_0x1e0232(0x18c)]==='created'?_0x1e0232(0x197):_0x1e0232(0x1b9))+_0x1e0232(0x18f)+(_0x3a9083['sqlCode']?'\x20('+_0x3a9083[_0x1e0232(0x193)]+')':'')};}};
1
+ const a85_0x12138d=a85_0x174a;(function(_0x488153,_0x89bfbf){const _0x2f2145=a85_0x174a,_0x58fdd8=_0x488153();while(!![]){try{const _0x2befb3=-parseInt(_0x2f2145(0x177))/0x1*(-parseInt(_0x2f2145(0x19e))/0x2)+parseInt(_0x2f2145(0x17e))/0x3*(parseInt(_0x2f2145(0x193))/0x4)+parseInt(_0x2f2145(0x180))/0x5+parseInt(_0x2f2145(0x195))/0x6*(-parseInt(_0x2f2145(0x181))/0x7)+-parseInt(_0x2f2145(0x18f))/0x8*(parseInt(_0x2f2145(0x19f))/0x9)+-parseInt(_0x2f2145(0x174))/0xa*(parseInt(_0x2f2145(0x17b))/0xb)+parseInt(_0x2f2145(0x185))/0xc*(-parseInt(_0x2f2145(0x173))/0xd);if(_0x2befb3===_0x89bfbf)break;else _0x58fdd8['push'](_0x58fdd8['shift']());}catch(_0x1c34eb){_0x58fdd8['push'](_0x58fdd8['shift']());}}}(a85_0x3364,0x4b26a));import{readFileSync,existsSync}from'node:fs';function a85_0x174a(_0x5b7c90,_0x163283){_0x5b7c90=_0x5b7c90-0x171;const _0x33643a=a85_0x3364();let _0x174ab2=_0x33643a[_0x5b7c90];return _0x174ab2;}import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';function a85_0x3364(){const _0x4bcfc3=['1195RxBmJh','validation','parameters','type','110wwjVCH','appCode','Created','9jjmxYd','SQL\x20query\x20description','2465695knGSpI','92953kgiDth','utf-8','Updated','sqlcode','2579244PTQWpw','valid','SQL\x20validation\x20failed:\x20','cwd','action','tables','sqlname','Type:\x20','string','sql','16RvSacp','description','message','dbId','378824sJjQbh','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','30IdcfxU','POST','file','dbName','Path\x20to\x20the\x20SQL\x20file','sqlType','Conflict\x20detected','SQL\x20query\x20display\x20name','sqlCode','802mfGcdN','2500704skDkNo','save','\x20successfully','13iBwgoF','111590iqZEPg','str','join'];a85_0x3364=function(){return _0x4bcfc3;};return a85_0x3364();}import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x12138d(0x18e),'command':a85_0x12138d(0x171),'description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','risk':'write','flags':[{'name':a85_0x12138d(0x197),'type':'string','required':!![],'description':a85_0x12138d(0x199)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x19c)},{'name':'db','type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x194)},{'name':a85_0x12138d(0x190),'type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x17f)}],async 'validate'(_0xcf1944){const _0x411909=a85_0x12138d,_0x13ec96=resolve(process[_0x411909(0x188)](),_0xcf1944[_0x411909(0x175)](_0x411909(0x197)));if(!existsSync(_0x13ec96))throw CliErrors[_0x411909(0x178)]('File\x20not\x20found:\x20'+_0x13ec96);const _0xfc1f07=readFileSync(_0x13ec96,_0x411909(0x182)),_0x80112=validateSql(_0xfc1f07);if(!_0x80112[_0x411909(0x186)])throw CliErrors[_0x411909(0x178)](_0x411909(0x187)+_0x80112[_0x411909(0x191)]);},async 'dryRun'(_0x1375fe){const _0x241ed8=a85_0x12138d,_0x19cb07=resolve(process[_0x241ed8(0x188)](),_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x197))),_0xe2cbfa=readFileSync(_0x19cb07,_0x241ed8(0x182)),_0x913ee7=validateSql(_0xe2cbfa),_0x4e3c30=_0x1375fe['str']('db')||undefined,{db:_0x3f6164,error:_0x527ef7}=await resolveOneDb(_0x1375fe[_0x241ed8(0x17c)],_0x4e3c30);return{'method':_0x241ed8(0x196),'url':'/api/node-toolbox/sql/save','body':{'appCode':_0x1375fe[_0x241ed8(0x17c)],'sqlContent':'('+_0xe2cbfa['length']+'\x20chars)','sqlCode':_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x184))||undefined,'sqlName':_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x18b))||undefined,'db':_0x3f6164?_0x3f6164[_0x241ed8(0x198)]+'\x20('+_0x3f6164[_0x241ed8(0x192)]+')':_0x527ef7},'description':['Save\x20SQL\x20query\x20from\x20'+_0x1375fe[_0x241ed8(0x175)]('file'),'Validation:\x20'+_0x913ee7[_0x241ed8(0x191)],_0x241ed8(0x18c)+_0x913ee7[_0x241ed8(0x19a)][_0x241ed8(0x17a)]+'\x20|\x20Tables:\x20'+(_0x913ee7[_0x241ed8(0x18a)]['join'](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x913ee7[_0x241ed8(0x179)][_0x241ed8(0x176)](',\x20')||'none')][_0x241ed8(0x176)]('\x0a')};},async 'execute'(_0x3096fd){const _0x44e4e7=a85_0x12138d,_0x2255e4=resolve(process['cwd'](),_0x3096fd['str'](_0x44e4e7(0x197))),_0x254a79=readFileSync(_0x2255e4,_0x44e4e7(0x182)),_0x17ccd6=_0x3096fd[_0x44e4e7(0x175)]('db')||undefined,{db:_0x14d36d,error:_0x9c534b}=await resolveOneDb(_0x3096fd[_0x44e4e7(0x17c)],_0x17ccd6);if(_0x9c534b)throw CliErrors['validation'](_0x9c534b);const _0x2d2d53=await saveSqlQuery({'appCode':_0x3096fd[_0x44e4e7(0x17c)],'sqlContent':_0x254a79,'sqlCode':_0x3096fd[_0x44e4e7(0x175)](_0x44e4e7(0x184))||undefined,'sqlName':_0x3096fd[_0x44e4e7(0x175)](_0x44e4e7(0x18b))||undefined,'dbId':_0x14d36d['dbId'],'description':_0x3096fd[_0x44e4e7(0x175)]('description')||undefined});if(_0x2d2d53['blocked'])return{'ok':![],'data':_0x2d2d53,'message':_0x2d2d53[_0x44e4e7(0x191)]||_0x44e4e7(0x19b)};return{'ok':!![],'data':{'sqlCode':_0x2d2d53[_0x44e4e7(0x19d)],'sqlName':_0x2d2d53['sqlName'],'action':_0x2d2d53['action']},'message':(_0x2d2d53[_0x44e4e7(0x189)]==='created'?_0x44e4e7(0x17d):_0x44e4e7(0x183))+_0x44e4e7(0x172)+(_0x2d2d53[_0x44e4e7(0x19d)]?'\x20('+_0x2d2d53['sqlCode']+')':'')};}};
@@ -1 +1 @@
1
- const a86_0x5b8092=a86_0x116e;(function(_0x32296c,_0x491fa1){const _0x22a46a=a86_0x116e,_0x2970b5=_0x32296c();while(!![]){try{const _0x51c000=parseInt(_0x22a46a(0xc3))/0x1+parseInt(_0x22a46a(0xbe))/0x2+parseInt(_0x22a46a(0xd1))/0x3+-parseInt(_0x22a46a(0xe4))/0x4*(parseInt(_0x22a46a(0xc6))/0x5)+-parseInt(_0x22a46a(0xe6))/0x6*(-parseInt(_0x22a46a(0xe0))/0x7)+parseInt(_0x22a46a(0xdd))/0x8+-parseInt(_0x22a46a(0xed))/0x9*(parseInt(_0x22a46a(0xf0))/0xa);if(_0x51c000===_0x491fa1)break;else _0x2970b5['push'](_0x2970b5['shift']());}catch(_0x51bc50){_0x2970b5['push'](_0x2970b5['shift']());}}}(a86_0x484d,0x9c0a3));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a86_0x484d(){const _0x281c2d=['Provide\x20--file\x20or\x20--sql','63SlTDtU','length','schemas','tableName','2956RanpGa','string','641766XmKMsq','map','name','push','message','from','validate','27FuDtly','file','sqlType','3621790NwEcfx','read','1355230BjBvrT','File\x20not\x20found:\x20','isArray','size','isDangerous','124608RgeeOa','\x22\x20not\x20found\x20or\x20not\x20accessible','\x22\x20not\x20found\x20in\x20any\x20dataset','7990ZBEWaA','schemaWarnings','utf-8','isSelectOnly','valid','split','dbtableConfig','validation','trim','str','parameters','1211895kjOsbS','schema:','get','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','fields','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','toLowerCase','filter','type','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','reason','sql','5902088ggJnFr','tables'];a86_0x484d=function(){return _0x281c2d;};return a86_0x484d();}import{validateSql}from'../../core/sql-validator.js';function a86_0x116e(_0x5f2a28,_0x281449){_0x5f2a28=_0x5f2a28-0xbe;const _0x484d2c=a86_0x484d();let _0x116e9=_0x484d2c[_0x5f2a28];return _0x116e9;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':'sql','command':a86_0x5b8092(0xec),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a86_0x5b8092(0xf1),'flags':[{'name':'file','type':a86_0x5b8092(0xe5),'description':a86_0x5b8092(0xd6)},{'name':a86_0x5b8092(0xdc),'type':a86_0x5b8092(0xe5),'description':a86_0x5b8092(0xd4)},{'name':a86_0x5b8092(0xe2),'type':'string','description':a86_0x5b8092(0xda)}],async 'execute'(_0x33d07e){const _0x3fe7fa=a86_0x5b8092,_0x20a4b1=_0x33d07e[_0x3fe7fa(0xcf)]('file'),_0x566997=_0x33d07e[_0x3fe7fa(0xcf)](_0x3fe7fa(0xdc));if(!_0x20a4b1&&!_0x566997)throw CliErrors['flagMissing'](_0x3fe7fa(0xee),_0x3fe7fa(0xdf));let _0x375190;if(_0x20a4b1){const _0x5a46d0=resolve(process['cwd'](),_0x20a4b1);if(!existsSync(_0x5a46d0))throw CliErrors[_0x3fe7fa(0xcd)](_0x3fe7fa(0xbf)+_0x5a46d0);_0x375190=readFileSync(_0x5a46d0,_0x3fe7fa(0xc8));}else _0x375190=_0x566997;const _0x5843da=validateSql(_0x375190),_0x325a35={'valid':_0x5843da['valid'],'sqlType':_0x5843da[_0x3fe7fa(0xef)][_0x3fe7fa(0xd9)],'isSelectOnly':_0x5843da['sqlType'][_0x3fe7fa(0xc9)],'isDangerous':_0x5843da[_0x3fe7fa(0xef)][_0x3fe7fa(0xc2)],'tables':_0x5843da['tables'],'parameters':_0x5843da[_0x3fe7fa(0xd0)],'message':_0x5843da[_0x3fe7fa(0xea)]};_0x5843da[_0x3fe7fa(0xef)][_0x3fe7fa(0xdb)]&&(_0x325a35['reason']=_0x5843da[_0x3fe7fa(0xef)][_0x3fe7fa(0xdb)]);const _0x299210=_0x33d07e[_0x3fe7fa(0xcf)](_0x3fe7fa(0xe2));if(_0x299210&&_0x5843da[_0x3fe7fa(0xca)]){const _0x2716af=_0x299210[_0x3fe7fa(0xcb)](',')['map'](_0x33596a=>_0x33596a[_0x3fe7fa(0xce)]())[_0x3fe7fa(0xd8)](Boolean),_0x436f81=[],_0x131591=await listDatasets(_0x33d07e['appCode']),_0x38e2e7=new Map(_0x131591[_0x3fe7fa(0xe7)](_0x1e20b0=>[_0x1e20b0[_0x3fe7fa(0xcc)]?.[_0x3fe7fa(0xe3)]?.[_0x3fe7fa(0xd7)](),_0x1e20b0]));for(const _0x35896e of _0x5843da[_0x3fe7fa(0xde)]){const _0x5a7bde=_0x38e2e7[_0x3fe7fa(0xd3)](_0x35896e['toLowerCase']());!_0x5a7bde&&_0x436f81[_0x3fe7fa(0xe9)]('Table\x20\x22'+_0x35896e+_0x3fe7fa(0xc5));}for(const _0x4a0b8c of _0x2716af){try{const _0x290d18=await getDatasetDetail(_0x4a0b8c),_0x50939c=Array[_0x3fe7fa(0xc0)](_0x290d18[_0x3fe7fa(0xd5)])?_0x290d18[_0x3fe7fa(0xd5)]:[],_0x4d8a93=new Set(_0x50939c[_0x3fe7fa(0xe7)](_0x39cdf6=>_0x39cdf6[_0x3fe7fa(0xe8)]?.['toLowerCase']())),_0x15f47e=_0x290d18[_0x3fe7fa(0xcc)]?.['tableName']||_0x290d18['tableName']||_0x4a0b8c;_0x325a35[_0x3fe7fa(0xd2)+_0x15f47e]={'code':_0x4a0b8c,'tableName':_0x15f47e,'fieldCount':_0x4d8a93[_0x3fe7fa(0xc1)],'fields':Array[_0x3fe7fa(0xeb)](_0x4d8a93)};}catch{_0x436f81[_0x3fe7fa(0xe9)]('Dataset\x20\x22'+_0x4a0b8c+_0x3fe7fa(0xc4));}}_0x436f81[_0x3fe7fa(0xe1)]>0x0&&(_0x325a35[_0x3fe7fa(0xc7)]=_0x436f81);}return{'ok':_0x5843da[_0x3fe7fa(0xca)],'data':_0x325a35,'message':_0x5843da[_0x3fe7fa(0xea)]};}};
1
+ const a86_0x2558ec=a86_0x2129;(function(_0x89220a,_0x369dca){const _0x459705=a86_0x2129,_0x442e4f=_0x89220a();while(!![]){try{const _0x43d8c3=parseInt(_0x459705(0x193))/0x1*(-parseInt(_0x459705(0x177))/0x2)+-parseInt(_0x459705(0x16b))/0x3+parseInt(_0x459705(0x16a))/0x4+-parseInt(_0x459705(0x184))/0x5*(parseInt(_0x459705(0x189))/0x6)+parseInt(_0x459705(0x178))/0x7+parseInt(_0x459705(0x18a))/0x8*(parseInt(_0x459705(0x17e))/0x9)+parseInt(_0x459705(0x179))/0xa;if(_0x43d8c3===_0x369dca)break;else _0x442e4f['push'](_0x442e4f['shift']());}catch(_0x2b57db){_0x442e4f['push'](_0x442e4f['shift']());}}}(a86_0x30e8,0x2dfcf));import{readFileSync,existsSync}from'node:fs';function a86_0x30e8(){const _0x5d8d10=['message','valid','227916XxTdEn','tables','schema:','split','file','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','335LXMTmJ','sqlType','Table\x20\x22','tableName','toLowerCase','5706cDANeX','64RhswVX','cwd','str','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isSelectOnly','size','\x22\x20not\x20found\x20in\x20any\x20dataset','push','isDangerous','920gWnvwm','map','trim','sql','filter','schemas','Provide\x20--file\x20or\x20--sql','string','length','dbtableConfig','1344032uVjlUO','557901ujGFlL','validate','File\x20not\x20found:\x20','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','parameters','read','fields','flagMissing','schemaWarnings','reason','get','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','770WVlxxO','86506bDqZPo','2412930zTtFCv','from','type'];a86_0x30e8=function(){return _0x5d8d10;};return a86_0x30e8();}import{resolve}from'node:path';function a86_0x2129(_0x20cc70,_0x125632){_0x20cc70=_0x20cc70-0x165;const _0x30e80b=a86_0x30e8();let _0x212969=_0x30e80b[_0x20cc70];return _0x212969;}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_0x2558ec(0x196),'command':a86_0x2558ec(0x16c),'description':a86_0x2558ec(0x176),'risk':a86_0x2558ec(0x170),'flags':[{'name':a86_0x2558ec(0x182),'type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x16e)},{'name':'sql','type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x18d)},{'name':a86_0x2558ec(0x165),'type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x183)}],async 'execute'(_0x419f37){const _0xedf647=a86_0x2558ec,_0x7a9d09=_0x419f37['str'](_0xedf647(0x182)),_0x2ab195=_0x419f37[_0xedf647(0x18c)](_0xedf647(0x196));if(!_0x7a9d09&&!_0x2ab195)throw CliErrors[_0xedf647(0x172)](_0xedf647(0x182),_0xedf647(0x166));let _0x3fa75e;if(_0x7a9d09){const _0x514f64=resolve(process[_0xedf647(0x18b)](),_0x7a9d09);if(!existsSync(_0x514f64))throw CliErrors['validation'](_0xedf647(0x16d)+_0x514f64);_0x3fa75e=readFileSync(_0x514f64,'utf-8');}else _0x3fa75e=_0x2ab195;const _0x118517=validateSql(_0x3fa75e),_0x19bd44={'valid':_0x118517[_0xedf647(0x17d)],'sqlType':_0x118517[_0xedf647(0x185)][_0xedf647(0x17b)],'isSelectOnly':_0x118517[_0xedf647(0x185)][_0xedf647(0x18e)],'isDangerous':_0x118517['sqlType'][_0xedf647(0x192)],'tables':_0x118517[_0xedf647(0x17f)],'parameters':_0x118517[_0xedf647(0x16f)],'message':_0x118517['message']};_0x118517[_0xedf647(0x185)][_0xedf647(0x174)]&&(_0x19bd44[_0xedf647(0x174)]=_0x118517[_0xedf647(0x185)][_0xedf647(0x174)]);const _0x46dc4d=_0x419f37[_0xedf647(0x18c)](_0xedf647(0x165));if(_0x46dc4d&&_0x118517[_0xedf647(0x17d)]){const _0x3665f7=_0x46dc4d[_0xedf647(0x181)](',')[_0xedf647(0x194)](_0x3447de=>_0x3447de[_0xedf647(0x195)]())[_0xedf647(0x197)](Boolean),_0x44bdf8=[],_0x1aced4=await listDatasets(_0x419f37['appCode']),_0x13d3ca=new Map(_0x1aced4[_0xedf647(0x194)](_0x52da8a=>[_0x52da8a['dbtableConfig']?.[_0xedf647(0x187)]?.[_0xedf647(0x188)](),_0x52da8a]));for(const _0x5d0ee8 of _0x118517[_0xedf647(0x17f)]){const _0x174f9f=_0x13d3ca[_0xedf647(0x175)](_0x5d0ee8[_0xedf647(0x188)]());!_0x174f9f&&_0x44bdf8[_0xedf647(0x191)](_0xedf647(0x186)+_0x5d0ee8+_0xedf647(0x190));}for(const _0x480394 of _0x3665f7){try{const _0x260959=await getDatasetDetail(_0x480394),_0x56ea34=Array['isArray'](_0x260959[_0xedf647(0x171)])?_0x260959[_0xedf647(0x171)]:[],_0x4384a1=new Set(_0x56ea34['map'](_0x2a852a=>_0x2a852a['name']?.['toLowerCase']())),_0x2cdbf8=_0x260959[_0xedf647(0x169)]?.[_0xedf647(0x187)]||_0x260959[_0xedf647(0x187)]||_0x480394;_0x19bd44[_0xedf647(0x180)+_0x2cdbf8]={'code':_0x480394,'tableName':_0x2cdbf8,'fieldCount':_0x4384a1[_0xedf647(0x18f)],'fields':Array[_0xedf647(0x17a)](_0x4384a1)};}catch{_0x44bdf8[_0xedf647(0x191)]('Dataset\x20\x22'+_0x480394+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x44bdf8[_0xedf647(0x168)]>0x0&&(_0x19bd44[_0xedf647(0x173)]=_0x44bdf8);}return{'ok':_0x118517['valid'],'data':_0x19bd44,'message':_0x118517[_0xedf647(0x17c)]};}};
@@ -1 +1 @@
1
- const a87_0x400a0d=a87_0x26ae;(function(_0xc3730f,_0x198b8){const _0x2f330d=a87_0x26ae,_0x59f941=_0xc3730f();while(!![]){try{const _0x4d4ff0=parseInt(_0x2f330d(0x1de))/0x1*(parseInt(_0x2f330d(0x213))/0x2)+-parseInt(_0x2f330d(0x1e2))/0x3+parseInt(_0x2f330d(0x1cb))/0x4+-parseInt(_0x2f330d(0x1c3))/0x5+-parseInt(_0x2f330d(0x1e0))/0x6+parseInt(_0x2f330d(0x1cf))/0x7+parseInt(_0x2f330d(0x1dd))/0x8;if(_0x4d4ff0===_0x198b8)break;else _0x59f941['push'](_0x59f941['shift']());}catch(_0x8d4c18){_0x59f941['push'](_0x59f941['shift']());}}}(a87_0x1128,0xd673e));export const CLI_BIN_NAME=a87_0x400a0d(0x1cd);function a87_0x26ae(_0x15a31e,_0x208a16){_0x15a31e=_0x15a31e-0x1b9;const _0x112815=a87_0x1128();let _0x26aea3=_0x112815[_0x15a31e];return _0x26aea3;}export const CLI_DISPLAY_NAME=a87_0x400a0d(0x1c0);export const NPM_PACKAGE_NAME=a87_0x400a0d(0x1f7);function a87_0x1128(){const _0x502f98=['Page\x20size','Output\x20path','dbid','Dataset\x20code','Use\x20remote','output','<expr>','skipImports','16377072lEZSfK','420467RLXycO','all','10404006ZpKtBZ','params','3010632wQkgyb','code','Operation\x20type','JSON\x20params','project','pagesize','keyword','production\x20|\x20daily','enableBffSave','dryRun','watch','Function\x20node','fromEntries','Output\x20format','value','env','sql','global','verbose','type','Config\x20value','@lovrabet/rabetbase-cli','key','meowKey','appcode','description','format','Show\x20help','string','Alias\x20for\x20--non-interactive','function-node','target','Force\x20overwrite','Code\x20filter','Schemas','force','datasetcode','Select\x20app\x20profile\x20by\x20name','skip-imports','File\x20path','enable-bff-save','map','operation-type','non-interactive','SQL\x20name','sqlname','Skip\x20confirmation\x20for\x20high-risk\x20writes','sqlcode','Config\x20key','6rhAjKv','page','Name','Environment','Enable\x20BFF\x20save','Force\x20non-interactive\x20mode\x20(CI)','Use\x20project\x20config\x20scope','schemas','Rabetbase\x20CLI','<code>','dry-run','4622050FqiMfy','clear','DB\x20ID','Preview\x20operation\x20without\x20executing','name','Clear','Description','remote','148028LKZwEp','Keyword\x20filter','rabetbase','json\x20|\x20pretty\x20|\x20compress','8363677YyCIqP','Skip\x20import\x20generation','help','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','boolean','Use\x20global\x20config\x20scope'];a87_0x1128=function(){return _0x502f98;};return a87_0x1128();}export const GLOBAL_FLAGS=[{'name':a87_0x400a0d(0x1fa),'meowKey':a87_0x400a0d(0x1fa),'type':a87_0x400a0d(0x1fe),'description':'Override\x20appcode','hint':a87_0x400a0d(0x1c1)},{'name':'app','meowKey':'app','type':'string','description':a87_0x400a0d(0x207),'hint':'<name>'},{'name':a87_0x400a0d(0x1f1),'meowKey':a87_0x400a0d(0x1f1),'type':'string','description':a87_0x400a0d(0x1bb),'hint':a87_0x400a0d(0x1e9)},{'name':a87_0x400a0d(0x1fc),'meowKey':'format','type':'string','description':a87_0x400a0d(0x1ef),'hint':a87_0x400a0d(0x1ce)},{'name':'jq','meowKey':'jq','type':'string','description':a87_0x400a0d(0x1d2),'hint':a87_0x400a0d(0x1db)},{'name':a87_0x400a0d(0x1c2),'meowKey':a87_0x400a0d(0x1eb),'type':'boolean','description':a87_0x400a0d(0x1c6)},{'name':'yes','meowKey':'yes','type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x210)},{'name':a87_0x400a0d(0x20d),'meowKey':'nonInteractive','type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1bd)},{'name':a87_0x400a0d(0x1f3),'meowKey':'global','type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1d4)},{'name':a87_0x400a0d(0x1e6),'meowKey':a87_0x400a0d(0x1e6),'type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1be)},{'name':'ci','meowKey':'ci','type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1ff),'hidden':!![]},{'name':'help','meowKey':a87_0x400a0d(0x1d1),'type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1fd)},{'name':'name','meowKey':a87_0x400a0d(0x1c7),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1ba),'hidden':!![]},{'name':a87_0x400a0d(0x1c4),'meowKey':a87_0x400a0d(0x1c4),'type':'boolean','description':a87_0x400a0d(0x1c8),'hidden':!![]},{'name':a87_0x400a0d(0x1ec),'meowKey':a87_0x400a0d(0x1ec),'type':'boolean','description':'Watch\x20mode','hidden':!![]},{'name':a87_0x400a0d(0x1da),'meowKey':a87_0x400a0d(0x1da),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1d6),'hidden':!![]},{'name':'params','meowKey':a87_0x400a0d(0x1e1),'type':'string','description':a87_0x400a0d(0x1e5),'hidden':!![]},{'name':'datasetcode','meowKey':a87_0x400a0d(0x206),'type':'string','description':a87_0x400a0d(0x1d8),'hidden':!![]},{'name':a87_0x400a0d(0x1df),'meowKey':a87_0x400a0d(0x1df),'type':a87_0x400a0d(0x1d3),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a87_0x400a0d(0x20a),'meowKey':a87_0x400a0d(0x1ea),'type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1bc),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x400a0d(0x1fe),'description':'Record\x20ID','hidden':!![]},{'name':a87_0x400a0d(0x1f5),'meowKey':a87_0x400a0d(0x1f5),'type':a87_0x400a0d(0x1fe),'description':'Type\x20filter','hidden':!![]},{'name':'file','meowKey':'file','type':'string','description':a87_0x400a0d(0x209),'hidden':!![]},{'name':a87_0x400a0d(0x211),'meowKey':a87_0x400a0d(0x211),'type':'string','description':'SQL\x20code','hidden':!![]},{'name':'sqlname','meowKey':a87_0x400a0d(0x20f),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x20e),'hidden':!![]},{'name':'dbid','meowKey':a87_0x400a0d(0x1d7),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1c5),'hidden':!![]},{'name':a87_0x400a0d(0x1fb),'meowKey':'description','type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1c9),'hidden':!![]},{'name':a87_0x400a0d(0x1b9),'meowKey':a87_0x400a0d(0x1b9),'type':a87_0x400a0d(0x1fe),'description':'Page\x20number','hidden':!![]},{'name':a87_0x400a0d(0x1e7),'meowKey':a87_0x400a0d(0x1e7),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1d5),'hidden':!![]},{'name':a87_0x400a0d(0x1e8),'meowKey':a87_0x400a0d(0x1e8),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1cc),'hidden':!![]},{'name':a87_0x400a0d(0x1e3),'meowKey':a87_0x400a0d(0x1e3),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x203),'hidden':!![]},{'name':a87_0x400a0d(0x1f2),'meowKey':a87_0x400a0d(0x1f2),'type':'string','description':'SQL\x20string','hidden':!![]},{'name':a87_0x400a0d(0x1bf),'meowKey':a87_0x400a0d(0x1bf),'type':'string','description':a87_0x400a0d(0x204),'hidden':!![]},{'name':'operation','meowKey':'operation','type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1e4),'hidden':!![]},{'name':'target','meowKey':a87_0x400a0d(0x201),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a87_0x400a0d(0x208),'meowKey':a87_0x400a0d(0x1dc),'type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x1d0),'hidden':!![]},{'name':a87_0x400a0d(0x1f8),'meowKey':a87_0x400a0d(0x1f8),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x212),'hidden':!![]},{'name':'value','meowKey':a87_0x400a0d(0x1f0),'type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1f6),'hidden':!![]},{'name':'force','meowKey':a87_0x400a0d(0x205),'type':a87_0x400a0d(0x1d3),'description':a87_0x400a0d(0x202),'hidden':!![]},{'name':a87_0x400a0d(0x1ca),'meowKey':a87_0x400a0d(0x1ca),'type':'boolean','description':a87_0x400a0d(0x1d9),'hidden':!![]},{'name':a87_0x400a0d(0x1f4),'meowKey':'verbose','type':a87_0x400a0d(0x1d3),'description':'Verbose\x20output','hidden':!![]},{'name':a87_0x400a0d(0x20c),'meowKey':'operationType','type':'string','description':a87_0x400a0d(0x1e4),'hidden':!![]},{'name':a87_0x400a0d(0x200),'meowKey':'functionNode','type':a87_0x400a0d(0x1fe),'description':a87_0x400a0d(0x1ed),'hidden':!![]}];export function buildMeowFlags(){const _0x195ffa=a87_0x400a0d;return Object[_0x195ffa(0x1ee)](GLOBAL_FLAGS[_0x195ffa(0x20b)](_0x30c9b0=>[_0x30c9b0[_0x195ffa(0x1f9)],{'type':_0x30c9b0['type']}]));}
1
+ function a87_0x3e12(_0x449c9b,_0x564204){_0x449c9b=_0x449c9b-0x19c;const _0x71f931=a87_0x71f9();let _0x3e1265=_0x71f931[_0x449c9b];return _0x3e1265;}const a87_0x2abbeb=a87_0x3e12;(function(_0x53d2ea,_0x4ea3d6){const _0x16b9f3=a87_0x3e12,_0x2309b4=_0x53d2ea();while(!![]){try{const _0x2348ae=parseInt(_0x16b9f3(0x1f0))/0x1+-parseInt(_0x16b9f3(0x1da))/0x2+-parseInt(_0x16b9f3(0x1e7))/0x3+parseInt(_0x16b9f3(0x1f9))/0x4+parseInt(_0x16b9f3(0x1d0))/0x5*(-parseInt(_0x16b9f3(0x1a4))/0x6)+-parseInt(_0x16b9f3(0x1e9))/0x7*(-parseInt(_0x16b9f3(0x1a9))/0x8)+parseInt(_0x16b9f3(0x1a2))/0x9*(parseInt(_0x16b9f3(0x1f8))/0xa);if(_0x2348ae===_0x4ea3d6)break;else _0x2309b4['push'](_0x2309b4['shift']());}catch(_0x5a59a6){_0x2309b4['push'](_0x2309b4['shift']());}}}(a87_0x71f9,0x2af27));export const CLI_BIN_NAME=a87_0x2abbeb(0x1de);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':'appcode','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1fb),'hint':a87_0x2abbeb(0x1c5)},{'name':a87_0x2abbeb(0x1c2),'meowKey':a87_0x2abbeb(0x1c2),'type':'string','description':a87_0x2abbeb(0x1e0),'hint':a87_0x2abbeb(0x1ca)},{'name':a87_0x2abbeb(0x1c1),'meowKey':a87_0x2abbeb(0x1c1),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a5),'hint':'production\x20|\x20daily'},{'name':a87_0x2abbeb(0x1ea),'meowKey':'format','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1dc),'hint':a87_0x2abbeb(0x1b9)},{'name':'jq','meowKey':'jq','type':'string','description':a87_0x2abbeb(0x1be),'hint':a87_0x2abbeb(0x1b4)},{'name':'dry-run','meowKey':a87_0x2abbeb(0x1e8),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1e6)},{'name':a87_0x2abbeb(0x1a8),'meowKey':a87_0x2abbeb(0x1a8),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1ad)},{'name':'non-interactive','meowKey':a87_0x2abbeb(0x19c),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x19e)},{'name':a87_0x2abbeb(0x1ce),'meowKey':'global','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x19d)},{'name':a87_0x2abbeb(0x1bc),'meowKey':a87_0x2abbeb(0x1bc),'type':'boolean','description':a87_0x2abbeb(0x1bb)},{'name':'ci','meowKey':'ci','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1b6),'hidden':!![]},{'name':a87_0x2abbeb(0x1ac),'meowKey':a87_0x2abbeb(0x1ac),'type':'boolean','description':'Show\x20help'},{'name':'name','meowKey':a87_0x2abbeb(0x1d6),'type':'string','description':a87_0x2abbeb(0x1d2),'hidden':!![]},{'name':a87_0x2abbeb(0x1c9),'meowKey':a87_0x2abbeb(0x1c9),'type':a87_0x2abbeb(0x1db),'description':'Clear','hidden':!![]},{'name':a87_0x2abbeb(0x1ef),'meowKey':'watch','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1d7),'hidden':!![]},{'name':a87_0x2abbeb(0x1cc),'meowKey':a87_0x2abbeb(0x1cc),'type':'string','description':'Output\x20path','hidden':!![]},{'name':a87_0x2abbeb(0x1df),'meowKey':a87_0x2abbeb(0x1df),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1f7),'hidden':!![]},{'name':'datasetcode','meowKey':a87_0x2abbeb(0x1f4),'type':a87_0x2abbeb(0x1b5),'description':'Dataset\x20code','hidden':!![]},{'name':a87_0x2abbeb(0x1f1),'meowKey':'all','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1b7),'hidden':!![]},{'name':a87_0x2abbeb(0x1b1),'meowKey':a87_0x2abbeb(0x1b3),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1d1),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1fa),'hidden':!![]},{'name':'type','meowKey':a87_0x2abbeb(0x1d9),'type':'string','description':a87_0x2abbeb(0x1c7),'hidden':!![]},{'name':a87_0x2abbeb(0x1aa),'meowKey':a87_0x2abbeb(0x1aa),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1eb),'hidden':!![]},{'name':a87_0x2abbeb(0x1ec),'meowKey':'sqlcode','type':'string','description':a87_0x2abbeb(0x1c8),'hidden':!![]},{'name':'sqlname','meowKey':a87_0x2abbeb(0x1b2),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1bf),'hidden':!![]},{'name':a87_0x2abbeb(0x1f2),'meowKey':a87_0x2abbeb(0x1f2),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ba),'hidden':!![]},{'name':a87_0x2abbeb(0x1b8),'meowKey':a87_0x2abbeb(0x1b8),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a3),'hidden':!![]},{'name':a87_0x2abbeb(0x1f5),'meowKey':a87_0x2abbeb(0x1f5),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ed),'hidden':!![]},{'name':a87_0x2abbeb(0x1e5),'meowKey':a87_0x2abbeb(0x1e5),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a1),'hidden':!![]},{'name':a87_0x2abbeb(0x1a0),'meowKey':a87_0x2abbeb(0x1a0),'type':a87_0x2abbeb(0x1b5),'description':'Keyword\x20filter','hidden':!![]},{'name':a87_0x2abbeb(0x1c3),'meowKey':a87_0x2abbeb(0x1c3),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1cb),'hidden':!![]},{'name':a87_0x2abbeb(0x1e2),'meowKey':a87_0x2abbeb(0x1e2),'type':a87_0x2abbeb(0x1b5),'description':'SQL\x20string','hidden':!![]},{'name':a87_0x2abbeb(0x1f6),'meowKey':a87_0x2abbeb(0x1f6),'type':'string','description':a87_0x2abbeb(0x1e4),'hidden':!![]},{'name':a87_0x2abbeb(0x1c4),'meowKey':a87_0x2abbeb(0x1c4),'type':a87_0x2abbeb(0x1b5),'description':'Operation\x20type','hidden':!![]},{'name':a87_0x2abbeb(0x1b0),'meowKey':a87_0x2abbeb(0x1b0),'type':'string','description':a87_0x2abbeb(0x1e3),'hidden':!![]},{'name':'skip-imports','meowKey':a87_0x2abbeb(0x1a7),'type':'boolean','description':'Skip\x20import\x20generation','hidden':!![]},{'name':a87_0x2abbeb(0x1cf),'meowKey':a87_0x2abbeb(0x1cf),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x19f),'hidden':!![]},{'name':a87_0x2abbeb(0x1cd),'meowKey':a87_0x2abbeb(0x1cd),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ab),'hidden':!![]},{'name':a87_0x2abbeb(0x1d5),'meowKey':'force','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1f3),'hidden':!![]},{'name':'remote','meowKey':a87_0x2abbeb(0x1ae),'type':'boolean','description':a87_0x2abbeb(0x1d4),'hidden':!![]},{'name':a87_0x2abbeb(0x1c6),'meowKey':a87_0x2abbeb(0x1c6),'type':'boolean','description':a87_0x2abbeb(0x1a6),'hidden':!![]},{'name':a87_0x2abbeb(0x1ee),'meowKey':a87_0x2abbeb(0x1c0),'type':a87_0x2abbeb(0x1b5),'description':'Operation\x20type','hidden':!![]},{'name':a87_0x2abbeb(0x1d3),'meowKey':a87_0x2abbeb(0x1dd),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1af),'hidden':!![]}];function a87_0x71f9(){const _0x552c2c=['File\x20path','sqlcode','Page\x20number','operation-type','watch','120298eFdhxB','all','dbid','Force\x20overwrite','datasetcode','page','schemas','JSON\x20params','670OvYfmt','545220ZKYlxb','Record\x20ID','Override\x20appcode','nonInteractive','Use\x20global\x20config\x20scope','Force\x20non-interactive\x20mode\x20(CI)','Config\x20key','keyword','Page\x20size','87201pMHYJH','Description','119772svPlCZ','Environment','Verbose\x20output','skipImports','yes','500728jkJILW','file','Config\x20value','help','Skip\x20confirmation\x20for\x20high-risk\x20writes','remote','Function\x20node','target','enable-bff-save','sqlname','enableBffSave','<expr>','string','Alias\x20for\x20--non-interactive','Apply\x20to\x20all','description','json\x20|\x20pretty\x20|\x20compress','DB\x20ID','Use\x20project\x20config\x20scope','project','map','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','SQL\x20name','operationType','env','app','code','operation','<code>','verbose','Type\x20filter','SQL\x20code','clear','<name>','Code\x20filter','output','value','global','key','45JfjzCp','Enable\x20BFF\x20save','Name','function-node','Use\x20remote','force','name','Watch\x20mode','fromEntries','type','555538iDNmUV','boolean','Output\x20format','functionNode','rabetbase','params','Select\x20app\x20profile\x20by\x20name','meowKey','sql','Target\x20path','Schemas','pagesize','Preview\x20operation\x20without\x20executing','1005057fLHngZ','dryRun','7ZhEvPX','format'];a87_0x71f9=function(){return _0x552c2c;};return a87_0x71f9();}export function buildMeowFlags(){const _0x2c237e=a87_0x2abbeb;return Object[_0x2c237e(0x1d8)](GLOBAL_FLAGS[_0x2c237e(0x1bd)](_0x4ac82c=>[_0x4ac82c[_0x2c237e(0x1e1)],{'type':_0x4ac82c['type']}]));}
@@ -1 +1 @@
1
- function a88_0x1acb(){const _0x4a4d2c=['https://runtime.lovrabet.com','11360792taUXNW','10400463IVGHzA','21781210ZNmGDq','https://api.lovrabet.com','15fFQRaV','userDomain','2897988gnyEab','https://user.lovrabet.com','56807cywCno','64ypDCZV','5664330XiHvMe','https://daily-runtime.lovrabet.com','4mfZCus','apiDomain','5158611RhUnZe'];a88_0x1acb=function(){return _0x4a4d2c;};return a88_0x1acb();}const a88_0x47850f=a88_0x386a;(function(_0x1ee6d7,_0x3e3e9f){const _0x715f55=a88_0x386a,_0x403f78=_0x1ee6d7();while(!![]){try{const _0x255524=parseInt(_0x715f55(0x1c8))/0x1*(-parseInt(_0x715f55(0x1c9))/0x2)+-parseInt(_0x715f55(0x1be))/0x3*(-parseInt(_0x715f55(0x1bc))/0x4)+parseInt(_0x715f55(0x1c4))/0x5*(parseInt(_0x715f55(0x1c6))/0x6)+-parseInt(_0x715f55(0x1ca))/0x7+parseInt(_0x715f55(0x1c0))/0x8+parseInt(_0x715f55(0x1c1))/0x9+-parseInt(_0x715f55(0x1c2))/0xa;if(_0x255524===_0x3e3e9f)break;else _0x403f78['push'](_0x403f78['shift']());}catch(_0x38d07a){_0x403f78['push'](_0x403f78['shift']());}}}(a88_0x1acb,0xe545e));function a88_0x386a(_0x3756a7,_0x46a304){_0x3756a7=_0x3756a7-0x1bc;const _0x1acb4d=a88_0x1acb();let _0x386aae=_0x1acb4d[_0x3756a7];return _0x386aae;}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x4ef1e0){const _0xc6f464=a88_0x386a;customApiDomain=_0x4ef1e0?.[_0xc6f464(0x1bd)],customUserDomain=_0x4ef1e0?.[_0xc6f464(0x1c5)],customRuntimeDomain=_0x4ef1e0?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(getEnv()==='production'?a88_0x47850f(0x1c7):'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(getEnv()==='production'?a88_0x47850f(0x1c3):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()==='production'?a88_0x47850f(0x1bf):a88_0x47850f(0x1cb));
1
+ const a88_0x2b2721=a88_0x1a6e;(function(_0x391f3e,_0x19a149){const _0x3b6e2c=a88_0x1a6e,_0x13dd67=_0x391f3e();while(!![]){try{const _0x168490=parseInt(_0x3b6e2c(0x67))/0x1*(-parseInt(_0x3b6e2c(0x6a))/0x2)+parseInt(_0x3b6e2c(0x6b))/0x3+parseInt(_0x3b6e2c(0x6d))/0x4+parseInt(_0x3b6e2c(0x68))/0x5*(parseInt(_0x3b6e2c(0x74))/0x6)+parseInt(_0x3b6e2c(0x6e))/0x7+-parseInt(_0x3b6e2c(0x72))/0x8*(-parseInt(_0x3b6e2c(0x69))/0x9)+-parseInt(_0x3b6e2c(0x6f))/0xa;if(_0x168490===_0x19a149)break;else _0x13dd67['push'](_0x13dd67['shift']());}catch(_0x3e4d2a){_0x13dd67['push'](_0x13dd67['shift']());}}}(a88_0x293b,0x7a34a));function a88_0x293b(){const _0x28ae7e=['9WugSVp','1891784Aalrmq','2702751tAaJCF','https://runtime.lovrabet.com','2085296xVvCNE','6257139yNmlOx','15574970STiMUU','https://api.lovrabet.com','runtimeDomain','2347832YyGVTS','userDomain','12nEFQKZ','apiDomain','https://user-daily.lovrabet.com','production','1PkEXEj','985865ecuPXK'];a88_0x293b=function(){return _0x28ae7e;};return a88_0x293b();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a88_0x1a6e(_0x54237d,_0x214fae){_0x54237d=_0x54237d-0x65;const _0x293b22=a88_0x293b();let _0x1a6ec7=_0x293b22[_0x54237d];return _0x1a6ec7;}export function initDomains(_0x5533d9){const _0x5658e5=a88_0x1a6e;customApiDomain=_0x5533d9?.[_0x5658e5(0x75)],customUserDomain=_0x5533d9?.[_0x5658e5(0x73)],customRuntimeDomain=_0x5533d9?.[_0x5658e5(0x71)];}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x2b2721(0x66)?'https://user.lovrabet.com':a88_0x2b2721(0x65));export const getApiDomain=()=>customApiDomain||(getEnv()===a88_0x2b2721(0x66)?a88_0x2b2721(0x70):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a88_0x2b2721(0x66)?a88_0x2b2721(0x6c):'https://daily-runtime.lovrabet.com');
@@ -1 +1 @@
1
- const a89_0x118d1a=a89_0x1b2b;(function(_0x8cf318,_0x4db599){const _0xa19af3=a89_0x1b2b,_0x212416=_0x8cf318();while(!![]){try{const _0x188c23=-parseInt(_0xa19af3(0x1e4))/0x1*(-parseInt(_0xa19af3(0x1eb))/0x2)+parseInt(_0xa19af3(0x1e6))/0x3+parseInt(_0xa19af3(0x1e9))/0x4*(-parseInt(_0xa19af3(0x1e7))/0x5)+-parseInt(_0xa19af3(0x1e8))/0x6*(-parseInt(_0xa19af3(0x1ec))/0x7)+parseInt(_0xa19af3(0x1e2))/0x8+-parseInt(_0xa19af3(0x1ed))/0x9+-parseInt(_0xa19af3(0x1e5))/0xa;if(_0x188c23===_0x4db599)break;else _0x212416['push'](_0x212416['shift']());}catch(_0x56d6e2){_0x212416['push'](_0x212416['shift']());}}}(a89_0x54d3,0x255d1));function a89_0x1b2b(_0x55a03a,_0x5d5a38){_0x55a03a=_0x55a03a-0x1e2;const _0x54d36a=a89_0x54d3();let _0x1b2b5c=_0x54d36a[_0x55a03a];return _0x1b2b5c;}export function normalizeEnv(_0xbae21d){const _0x228570=a89_0x1b2b;return _0xbae21d===_0x228570(0x1e3)?'production':_0xbae21d;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x118d1a(0x1ea));export function getEnv(){return env;}function a89_0x54d3(){const _0x572a9a=['68244bFoBqq','16110zuWynh','62994izYFZd','268vEJrnC','production','2PPNIQR','84SLEsTF','903447iJdUIZ','953376KhSwwX','online','253240gtMtvL','518500keMqXW'];a89_0x54d3=function(){return _0x572a9a;};return a89_0x54d3();}export function initEnv(_0x291424){env=normalizeEnv(_0x291424);}
1
+ const a89_0x10b161=a89_0x7bff;(function(_0x1ab5b5,_0x4f9ae8){const _0x538e80=a89_0x7bff,_0x10f934=_0x1ab5b5();while(!![]){try{const _0xd444c4=parseInt(_0x538e80(0x92))/0x1*(-parseInt(_0x538e80(0x95))/0x2)+parseInt(_0x538e80(0x93))/0x3+parseInt(_0x538e80(0x9c))/0x4*(-parseInt(_0x538e80(0x96))/0x5)+parseInt(_0x538e80(0x9b))/0x6+parseInt(_0x538e80(0x97))/0x7*(-parseInt(_0x538e80(0x94))/0x8)+-parseInt(_0x538e80(0x99))/0x9*(parseInt(_0x538e80(0x9d))/0xa)+parseInt(_0x538e80(0x98))/0xb;if(_0xd444c4===_0x4f9ae8)break;else _0x10f934['push'](_0x10f934['shift']());}catch(_0x1e6e80){_0x10f934['push'](_0x10f934['shift']());}}}(a89_0x447a,0xe2eca));export function normalizeEnv(_0x498923){const _0x4a3615=a89_0x7bff;return _0x498923===_0x4a3615(0x9e)?_0x4a3615(0x9a):_0x498923;}function a89_0x7bff(_0x3e6684,_0x22675d){_0x3e6684=_0x3e6684-0x92;const _0x447ae9=a89_0x447a();let _0x7bff28=_0x447ae9[_0x3e6684];return _0x7bff28;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x10b161(0x9a));function a89_0x447a(){const _0x476390=['144mSyxlU','3710EAeRjH','5FrReIs','266518QoplVY','26768148grafzy','18jxhuAg','production','2554650PhqPzk','5760116rQNaGa','2120490MwtrEP','online','101DUYHer','2421159fqbOWI'];a89_0x447a=function(){return _0x476390;};return a89_0x447a();}export function getEnv(){return env;}export function initEnv(_0x1155c6){env=normalizeEnv(_0x1155c6);}
@@ -0,0 +1 @@
1
+ function a90_0x4c4e(){const _0x493f62=['410271DVFqSw','3165600XATXKP','3163YcwEIz','./src/api','15959688wCoxhi','106OCwvkz','98832KGZHgG','916872HAQkZF','5521502inIRKl'];a90_0x4c4e=function(){return _0x493f62;};return a90_0x4c4e();}function a90_0x21c3(_0x97cd6,_0x45fc13){_0x97cd6=_0x97cd6-0x1e2;const _0x4c4e0c=a90_0x4c4e();let _0x21c3f1=_0x4c4e0c[_0x97cd6];return _0x21c3f1;}const a90_0x2e1605=a90_0x21c3;(function(_0x184474,_0x56bebf){const _0x55c44c=a90_0x21c3,_0x332b69=_0x184474();while(!![]){try{const _0x40b995=-parseInt(_0x55c44c(0x1e2))/0x1*(parseInt(_0x55c44c(0x1e5))/0x2)+-parseInt(_0x55c44c(0x1e9))/0x3+-parseInt(_0x55c44c(0x1e6))/0x4+-parseInt(_0x55c44c(0x1ea))/0x5+parseInt(_0x55c44c(0x1e7))/0x6+-parseInt(_0x55c44c(0x1e8))/0x7+parseInt(_0x55c44c(0x1e4))/0x8;if(_0x40b995===_0x56bebf)break;else _0x332b69['push'](_0x332b69['shift']());}catch(_0x58f0a6){_0x332b69['push'](_0x332b69['shift']());}}}(a90_0x4c4e,0x60ddb));export const DEFAULT_API_DIR=a90_0x2e1605(0x1e3);
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a90_0x5f23ce=a90_0x17b1;(function(_0x12b043,_0x3249bd){const _0x10d1da=a90_0x17b1,_0x1ab14f=_0x12b043();while(!![]){try{const _0x194b91=parseInt(_0x10d1da(0x1a1))/0x1+parseInt(_0x10d1da(0x1ad))/0x2*(parseInt(_0x10d1da(0x1be))/0x3)+-parseInt(_0x10d1da(0x188))/0x4+parseInt(_0x10d1da(0x19a))/0x5*(parseInt(_0x10d1da(0x1a7))/0x6)+parseInt(_0x10d1da(0x1bb))/0x7+parseInt(_0x10d1da(0x17c))/0x8*(-parseInt(_0x10d1da(0x173))/0x9)+-parseInt(_0x10d1da(0x1ab))/0xa;if(_0x194b91===_0x3249bd)break;else _0x1ab14f['push'](_0x1ab14f['shift']());}catch(_0x67bf04){_0x1ab14f['push'](_0x1ab14f['shift']());}}}(a90_0x51dd,0x85a79));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';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x2344cc){return process.env[`RABETBASE_${_0x2344cc}`]||process.env[`LOVRABET_${_0x2344cc}`]||undefined;}export const NEW_CONFIG_NAME=a90_0x5f23ce(0x184);export const CONFIG_NAMES=[a90_0x5f23ce(0x184),'.lovrabet.json',a90_0x5f23ce(0x18c)];function a90_0x17b1(_0x50723a,_0x191060){_0x50723a=_0x50723a-0x171;const _0x51dd1e=a90_0x51dd();let _0x17b1ef=_0x51dd1e[_0x50723a];return _0x17b1ef;}export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a90_0x5f23ce(0x185)](_0x4d115e=>_0x4d115e!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x4ec5c1){for(const _0x492004 of CONFIG_NAMES){const _0x5b5051=resolve(_0x4ec5c1,_0x492004);if(existsSync(_0x5b5051))return _0x5b5051;}return undefined;}export async function createContext(_0x3616e3){const _0x5dd416=a90_0x5f23ce,_0x86b968=readRawConfig(),_0x56f390=buildConfig(_0x86b968,_0x3616e3),{initEnv:_0x1b6af4}=await import(_0x5dd416(0x187));if(_0x56f390['env'])_0x1b6af4(_0x56f390['env']);else _0x3616e3[_0x5dd416(0x1b5)]&&typeof _0x3616e3[_0x5dd416(0x1b5)]==='string'&&_0x1b6af4(_0x3616e3['env']);const {initDomains:_0x20f669,getUserDomain:_0x1ea067,getApiDomain:_0x2b027d}=await import(_0x5dd416(0x1a9));_0x20f669({'apiDomain':_0x86b968[_0x5dd416(0x196)]||undefined,'userDomain':_0x86b968[_0x5dd416(0x17d)]||undefined,'runtimeDomain':_0x86b968['runtimeDomain']||undefined});const _0x33ab7c={'apiDomain':_0x2b027d(),'userDomain':_0x1ea067()},_0x2ffa50=await buildAuth(_0x56f390);logger[_0x5dd416(0x19b)](process[_0x5dd416(0x189)]());const _0x49e173=(CLI_BIN_NAME+'\x20'+process[_0x5dd416(0x1a0)][_0x5dd416(0x18d)](0x2)[_0x5dd416(0x1b6)]('\x20'))[_0x5dd416(0x194)]();logger[_0x5dd416(0x18e)](_0x49e173);const {isNonInteractive:_0x67906}=await import(_0x5dd416(0x1b3)),_0x3bde4d=_0x67906(_0x3616e3);return{'config':_0x56f390,'auth':_0x2ffa50,'logger':logger,'env':_0x33ab7c,'nonInteractive':_0x3bde4d};}export function buildConfigFromFlags(_0x3b6774){return buildConfig(readRawConfig(),_0x3b6774);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x220745){const _0x2e7326=a90_0x5f23ce;if(!existsSync(_0x220745))return{'status':_0x2e7326(0x193)};try{const _0x37e490=readFileSync(_0x220745,{'encoding':_0x2e7326(0x1aa)});if(!_0x37e490?.[_0x2e7326(0x194)]())return{'status':_0x2e7326(0x191)};const _0x1b7bc3=JSON[_0x2e7326(0x1b7)](_0x37e490);return{'status':'ok','data':_0x1b7bc3};}catch(_0x1b555f){return{'status':'error','message':_0x1b555f instanceof Error?_0x1b555f['message']:String(_0x1b555f)};}}function parseCliConfigJsonFile(_0x130eed,_0x18bc36,_0x5c6b85){const _0x3075bb=a90_0x5f23ce,_0x4ddf69=inspectCliConfigJsonFile(_0x130eed);if(_0x4ddf69[_0x3075bb(0x174)]===_0x3075bb(0x193)||_0x4ddf69[_0x3075bb(0x174)]===_0x3075bb(0x191))return{};if(_0x4ddf69[_0x3075bb(0x174)]==='ok')return _0x4ddf69[_0x3075bb(0x1b9)];return _0x18bc36===_0x3075bb(0x1ba)&&_0x5c6b85&&console['error'](CLI_BIN_NAME+':\x20'+_0x5c6b85+_0x3075bb(0x183)+_0x130eed+_0x3075bb(0x1b2)+_0x4ddf69['message']),{};}export function loadRawConfigLayers(_0x219b12){const _0x2b2052=a90_0x5f23ce;let _0x717c6b={},_0x58c066={};const _0x46dff2=resolveConfigPath(homedir());_0x46dff2&&(_0x717c6b=parseCliConfigJsonFile(_0x46dff2,_0x2b2052(0x1ba),_0x2b2052(0x182)));const _0x139aa4=_0x219b12||process['cwd'](),_0x2421b9=resolveConfigPath(_0x139aa4);return _0x2421b9&&(_0x58c066=parseCliConfigJsonFile(_0x2421b9,_0x2b2052(0x1ba),_0x2b2052(0x177))),{'globalPath':_0x46dff2,'projectPath':_0x2421b9,'globalConfig':_0x717c6b,'projectConfig':_0x58c066};}function mergeRawConfigLayers(_0x45c55b){const _0x1359af=a90_0x5f23ce,{globalConfig:_0x122148,projectConfig:_0x3e5be6}=_0x45c55b,_0x5a6bf5=_0x122148['apps']&&typeof _0x122148['apps']===_0x1359af(0x1bd)?_0x122148[_0x1359af(0x1ae)]:{},_0xd5b5b2=_0x3e5be6['apps']&&typeof _0x3e5be6[_0x1359af(0x1ae)]==='object'?_0x3e5be6[_0x1359af(0x1ae)]:{},_0x21251f={..._0x5a6bf5,..._0xd5b5b2},_0x5b07f3={..._0x122148,..._0x3e5be6};Object['keys'](_0x21251f)[_0x1359af(0x1a4)]>0x0&&(_0x5b07f3[_0x1359af(0x1ae)]=_0x21251f);if(_0x1359af(0x172)in _0x3e5be6)_0x5b07f3[_0x1359af(0x172)]=_0x3e5be6['defaultApp'];else{if(_0xd5b5b2&&Object['keys'](_0xd5b5b2)[_0x1359af(0x1a4)]>0x0)_0x5b07f3[_0x1359af(0x172)]=Object['keys'](_0xd5b5b2)[0x0];else _0x122148['defaultApp']&&(_0x5b07f3['defaultApp']=_0x122148['defaultApp']);}return _0x5b07f3;}export function readRawConfigWithLayers(_0x351cfc){const _0x25bbaa=loadRawConfigLayers(_0x351cfc);return{'config':mergeRawConfigLayers(_0x25bbaa),'layers':_0x25bbaa};}function a90_0x51dd(){const _0x52be1d=['./auth/get-cookie.js','apiDir','5816598VaucAV','riskLevel','./constant/domain.js','utf8','14284830NozalM','APPCODE','6nLlfYe','apps','authRequired','production','string','\x0a\x20\x20','./utils/is-non-interactive.js','.tmp','env','join','parse','high-risk-write','data','warn','3572786qjKzyH','api.ts','object','957975oQPjMG','./src/api','defaultApp','819ucBylK','status','accessKey','cookie','Project','format','entries','find','daily','31544hYxvEo','userDomain','pageSize','en-US','true','keys','Global','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','.rabetbase.json','filter','MAX_RISK','./constant/env.js','1113628OzeOTo','cwd','project','appcode','.lovrabetrc','slice','setRawCommand','online','app','empty','COOKIE','missing','trim','maxRisk','apiDomain','ACCESS_KEY','silent','locale','5xbzRaa','setLogPath','read','write','stringify','APP','argv','175346jMqnrq','VERBOSE','FORMAT','length'];a90_0x51dd=function(){return _0x52be1d;};return a90_0x51dd();}export function readRawConfig(_0x7382d2){return mergeRawConfigLayers(loadRawConfigLayers(_0x7382d2));}export function readConfigFile(_0x4127ad){const _0x5c1634=a90_0x5f23ce;return parseCliConfigJsonFile(_0x4127ad,_0x5c1634(0x198));}export function writeConfigFile(_0x5f234f,_0x59c13c){const _0x34aafa=a90_0x5f23ce,_0x3a6b96=dirname(_0x5f234f);!existsSync(_0x3a6b96)&&mkdirSync(_0x3a6b96,{'recursive':!![]});const _0x2ac725=_0x5f234f+_0x34aafa(0x1b4);try{writeFileSync(_0x2ac725,JSON[_0x34aafa(0x19e)](_0x59c13c,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x2ac725,_0x5f234f);}catch(_0x3aed15){try{unlinkSync(_0x2ac725);}catch{}throw _0x3aed15;}}export function resolveWriteConfigPath(_0x57c5b2){const _0x2cc44c=a90_0x5f23ce,_0x4008cb=_0x57c5b2===_0x2cc44c(0x18a)?process[_0x2cc44c(0x189)]():homedir(),_0x4ccfb2=resolveConfigPath(_0x4008cb);return _0x4ccfb2??resolve(_0x4008cb,NEW_CONFIG_NAME);}function buildConfig(_0x208e57,_0x362539){const _0x22103a=a90_0x5f23ce,_0x6c4557={};if(_0x208e57[_0x22103a(0x1ae)]&&typeof _0x208e57[_0x22103a(0x1ae)]===_0x22103a(0x1bd))for(const [_0x360253,_0x1eb295]of Object[_0x22103a(0x179)](_0x208e57[_0x22103a(0x1ae)])){_0x1eb295&&typeof _0x1eb295==='object'&&_0x1eb295[_0x22103a(0x18b)]&&(_0x6c4557[_0x360253]=_0x1eb295);}const _0x45aeaa=_0x208e57[_0x22103a(0x172)]||undefined,_0x111e41=Object[_0x22103a(0x181)](_0x6c4557)[_0x22103a(0x1a4)]>0x0,_0x2adb29=_0x362539[_0x22103a(0x190)]||env(_0x22103a(0x19f))||undefined,_0x11b248=_0x2adb29||_0x45aeaa||undefined,_0x1ac14e=_0x362539[_0x22103a(0x18b)]||env(_0x22103a(0x1ac))||undefined,_0x26d438=_0x1ac14e?Object[_0x22103a(0x179)](_0x6c4557)[_0x22103a(0x17a)](([,_0x54b13f])=>_0x54b13f?.[_0x22103a(0x18b)]===_0x1ac14e):undefined,_0x5db26a=_0x26d438?.[0x0],_0x5cb323=_0x26d438?.[0x1];let _0x503871=_0x1ac14e?_0x5db26a:_0x11b248,_0x249d78=_0x503871&&_0x6c4557[_0x503871]?_0x6c4557[_0x503871]:undefined;_0x1ac14e&&_0x5cb323&&(_0x249d78=_0x5cb323);const _0xaa0690=_0x1ac14e?_0x5cb323??_0x249d78:_0x249d78,_0x531f20=_0x2adb29||(_0x1ac14e?_0x5db26a:undefined),_0x136703=_0x1ac14e||_0xaa0690?.[_0x22103a(0x18b)]||_0x208e57[_0x22103a(0x18b)]||_0x208e57[_0x22103a(0x190)]||undefined,_0x5248e4=_0x362539['env']||env('ENV')||_0xaa0690?.['env']||_0x208e57['env']||'production',_0x396de5=_0xaa0690?.[_0x22103a(0x199)]||_0x208e57[_0x22103a(0x199)]||_0x22103a(0x17f),_0x19b3fd=env(_0x22103a(0x192))||_0xaa0690?.['cookie']||_0x208e57[_0x22103a(0x176)]||undefined,_0x1eb741=env(_0x22103a(0x197))||_0xaa0690?.[_0x22103a(0x175)]||_0x208e57[_0x22103a(0x175)]||undefined,_0x1ea174=_0x362539['format']||env(_0x22103a(0x1a3))||_0xaa0690?.[_0x22103a(0x178)]||_0x208e57[_0x22103a(0x178)],_0x12e219=normalizeLegacyOutputFormat(_0x1ea174),_0x518933=env('PAGE_SIZE')||_0xaa0690?.[_0x22103a(0x17e)]||_0x208e57[_0x22103a(0x17e)],_0x33d5fd=_0x518933?Number(_0x518933)||undefined:undefined,_0x1d7487=env('RISK_LEVEL')||env(_0x22103a(0x186))||_0xaa0690?.[_0x22103a(0x1a8)]||_0x208e57['riskLevel']||_0x208e57[_0x22103a(0x195)],_0x12f2ff=_0x1d7487===_0x22103a(0x19c)||_0x1d7487===_0x22103a(0x19d)?_0x1d7487:_0x22103a(0x1b8),_0x10cb71=env(_0x22103a(0x1a2)),_0x4d86ae=_0x10cb71==='1'||_0x10cb71===_0x22103a(0x180),_0x404692=_0xaa0690?.[_0x22103a(0x1a6)]||_0x208e57['apiDir']||_0x22103a(0x171);return{'appCode':typeof _0x136703===_0x22103a(0x1b1)&&_0x136703[_0x22103a(0x194)]()?_0x136703[_0x22103a(0x194)]():undefined,'env':_0x5248e4===_0x22103a(0x18f)?_0x22103a(0x1b0):_0x5248e4===_0x22103a(0x17b)?_0x22103a(0x17b):_0x22103a(0x1b0),'locale':_0x396de5,'cookie':_0x19b3fd,'accessKey':_0x1eb741,'format':_0x12e219,'pageSize':_0x33d5fd,'riskLevel':_0x12f2ff,'verbose':_0x4d86ae,'apiDir':_0x404692,'apps':_0x6c4557,'defaultApp':_0x45aeaa,'currentApp':_0x111e41?_0x503871:undefined,'explicitAppName':_0x531f20,'raw':_0x208e57};}async function buildAuth(_0x2efc0c){const _0x3d2b42=a90_0x5f23ce,{getCookie:_0x4b618a}=await import(_0x3d2b42(0x1a5)),_0x35de41=_0x2efc0c[_0x3d2b42(0x176)]||_0x4b618a(),_0x345a59=_0x35de41?await getIsSessionValid():![];return{'cookie':_0x35de41,'isLoggedIn':_0x345a59,async 'getOrLogin'(){const _0x57d60e=_0x3d2b42;if(_0x35de41&&_0x345a59)return _0x35de41;throw CliErrors[_0x57d60e(0x1af)]();}};}export function resolveApiFilePath(_0x479bf7,_0x4aa433){const _0x5a7709=a90_0x5f23ce,_0x50f66c=resolve(process[_0x5a7709(0x189)](),_0x479bf7),_0x49a76a=resolve(_0x50f66c,_0x5a7709(0x1bc));if(!_0x4aa433)return _0x49a76a;const _0x57c7e5=readRawConfig(),_0x157a75=_0x57c7e5[_0x5a7709(0x1ae)]&&typeof _0x57c7e5[_0x5a7709(0x1ae)]===_0x5a7709(0x1bd)?_0x57c7e5[_0x5a7709(0x1ae)]:{},_0x1ff5f6=Object['entries'](_0x157a75)[_0x5a7709(0x17a)](([,_0x2f6f99])=>_0x2f6f99?.[_0x5a7709(0x18b)]===_0x4aa433);if(!_0x1ff5f6)return _0x49a76a;const [_0x2e5054,_0x5e2677]=_0x1ff5f6,_0x2268b8=typeof _0x57c7e5[_0x5a7709(0x172)]==='string'?_0x57c7e5[_0x5a7709(0x172)]:undefined;if(_0x5e2677?.['apiDir'])return _0x49a76a;if(_0x2268b8&&_0x2e5054!==_0x2268b8)return resolve(_0x50f66c,_0x2e5054+'-api.ts');return _0x49a76a;}
1
+ const a91_0x50add3=a91_0x2cf3;(function(_0x2f75b7,_0x50c86f){const _0x121bf3=a91_0x2cf3,_0x4cc0cc=_0x2f75b7();while(!![]){try{const _0x2a33c0=-parseInt(_0x121bf3(0x205))/0x1+-parseInt(_0x121bf3(0x234))/0x2+-parseInt(_0x121bf3(0x22e))/0x3*(-parseInt(_0x121bf3(0x216))/0x4)+-parseInt(_0x121bf3(0x220))/0x5*(-parseInt(_0x121bf3(0x206))/0x6)+parseInt(_0x121bf3(0x22b))/0x7*(parseInt(_0x121bf3(0x1f5))/0x8)+parseInt(_0x121bf3(0x200))/0x9+parseInt(_0x121bf3(0x212))/0xa*(-parseInt(_0x121bf3(0x1f7))/0xb);if(_0x2a33c0===_0x50c86f)break;else _0x4cc0cc['push'](_0x4cc0cc['shift']());}catch(_0x128734){_0x4cc0cc['push'](_0x4cc0cc['shift']());}}}(a91_0x1358,0x46457));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_0x1358(){const _0x28f506=['setLogPath','project','warn','1422065cUXwEC','.lovrabet.json','find','high-risk-write','read','utf8','\x0a\x20\x20','cookie','format','write','en-US','1770167khMMpb','./auth/get-cookie.js','ACCESS_KEY','209847trSiWH','PAGE_SIZE','accessKey','daily','riskLevel','object','1096562IZbVhb','.rabetbase.json','-api.ts','env','./constant/env.js','Global','cwd','MAX_RISK','COOKIE','VERBOSE','production','silent','appcode','16deyeDZ','apiDir','197571OawQTs','missing','keys','locale','userDomain','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','pageSize','length','true','2843136AgOvHr','slice','apps','filter','api.ts','476024vcwryw','6fNntXc','app','.tmp','ENV','error','join','stringify','RISK_LEVEL','empty','defaultApp','Project','data','80bybUHe','trim','./utils/is-non-interactive.js','entries','20julCgm','string','authRequired','message','online','runtimeDomain','APPCODE'];a91_0x1358=function(){return _0x28f506;};return a91_0x1358();}import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x40b51b){return process.env[`RABETBASE_${_0x40b51b}`]||process.env[`LOVRABET_${_0x40b51b}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x50add3(0x235);export const CONFIG_NAMES=['.rabetbase.json',a91_0x50add3(0x221),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x50add3(0x203)](_0xe53972=>_0xe53972!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x40a6a6){for(const _0x5c5dc4 of CONFIG_NAMES){const _0x31b807=resolve(_0x40a6a6,_0x5c5dc4);if(existsSync(_0x31b807))return _0x31b807;}return undefined;}export async function createContext(_0x1e9aa9){const _0x4bb9a7=a91_0x50add3,_0x19c09c=readRawConfig(),_0x54e8b5=buildConfig(_0x19c09c,_0x1e9aa9),{initEnv:_0x51298d}=await import(_0x4bb9a7(0x1ec));if(_0x54e8b5[_0x4bb9a7(0x1eb)])_0x51298d(_0x54e8b5['env']);else _0x1e9aa9[_0x4bb9a7(0x1eb)]&&typeof _0x1e9aa9[_0x4bb9a7(0x1eb)]==='string'&&_0x51298d(_0x1e9aa9[_0x4bb9a7(0x1eb)]);const {initDomains:_0x779c96,getUserDomain:_0x3311d4,getApiDomain:_0x2e9929}=await import('./constant/domain.js');_0x779c96({'apiDomain':_0x19c09c['apiDomain']||undefined,'userDomain':_0x19c09c[_0x4bb9a7(0x1fb)]||undefined,'runtimeDomain':_0x19c09c[_0x4bb9a7(0x21b)]||undefined});const _0x393e27={'apiDomain':_0x2e9929(),'userDomain':_0x3311d4()},_0x543258=await buildAuth(_0x54e8b5);logger[_0x4bb9a7(0x21d)](process['cwd']());const _0x346833=(CLI_BIN_NAME+'\x20'+process['argv'][_0x4bb9a7(0x201)](0x2)[_0x4bb9a7(0x20b)]('\x20'))[_0x4bb9a7(0x213)]();logger['setRawCommand'](_0x346833);const {isNonInteractive:_0x393d98}=await import(_0x4bb9a7(0x214)),_0x2da333=_0x393d98(_0x1e9aa9);return{'config':_0x54e8b5,'auth':_0x543258,'logger':logger,'env':_0x393e27,'nonInteractive':_0x2da333};}export function buildConfigFromFlags(_0x34ea80){return buildConfig(readRawConfig(),_0x34ea80);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a91_0x2cf3(_0x3f1f2c,_0x54ccec){_0x3f1f2c=_0x3f1f2c-0x1ea;const _0x1358a5=a91_0x1358();let _0x2cf325=_0x1358a5[_0x3f1f2c];return _0x2cf325;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3cf7b2){const _0xfd8e74=a91_0x50add3;if(!existsSync(_0x3cf7b2))return{'status':_0xfd8e74(0x1f8)};try{const _0x59887c=readFileSync(_0x3cf7b2,{'encoding':'utf8'});if(!_0x59887c?.[_0xfd8e74(0x213)]())return{'status':'empty'};const _0x5e69ea=JSON['parse'](_0x59887c);return{'status':'ok','data':_0x5e69ea};}catch(_0x4b6afa){return{'status':_0xfd8e74(0x20a),'message':_0x4b6afa instanceof Error?_0x4b6afa['message']:String(_0x4b6afa)};}}function parseCliConfigJsonFile(_0x361ee7,_0x18e652,_0x274f20){const _0x310e6a=a91_0x50add3,_0x361eae=inspectCliConfigJsonFile(_0x361ee7);if(_0x361eae['status']===_0x310e6a(0x1f8)||_0x361eae['status']===_0x310e6a(0x20e))return{};if(_0x361eae['status']==='ok')return _0x361eae[_0x310e6a(0x211)];return _0x18e652===_0x310e6a(0x21f)&&_0x274f20&&console['error'](CLI_BIN_NAME+':\x20'+_0x274f20+_0x310e6a(0x1fc)+_0x361ee7+_0x310e6a(0x226)+_0x361eae[_0x310e6a(0x219)]),{};}export function loadRawConfigLayers(_0x5cf02a){const _0x8c768d=a91_0x50add3;let _0x1f0dd1={},_0x3b9460={};const _0x55a439=resolveConfigPath(homedir());_0x55a439&&(_0x1f0dd1=parseCliConfigJsonFile(_0x55a439,_0x8c768d(0x21f),_0x8c768d(0x1ed)));const _0x3f291a=_0x5cf02a||process[_0x8c768d(0x1ee)](),_0x5407ad=resolveConfigPath(_0x3f291a);return _0x5407ad&&(_0x3b9460=parseCliConfigJsonFile(_0x5407ad,'warn',_0x8c768d(0x210))),{'globalPath':_0x55a439,'projectPath':_0x5407ad,'globalConfig':_0x1f0dd1,'projectConfig':_0x3b9460};}function mergeRawConfigLayers(_0x663a0d){const _0x301e14=a91_0x50add3,{globalConfig:_0x775a98,projectConfig:_0x23f1e7}=_0x663a0d,_0x5c747b=_0x775a98[_0x301e14(0x202)]&&typeof _0x775a98[_0x301e14(0x202)]===_0x301e14(0x233)?_0x775a98[_0x301e14(0x202)]:{},_0x1ea6b9=_0x23f1e7['apps']&&typeof _0x23f1e7[_0x301e14(0x202)]===_0x301e14(0x233)?_0x23f1e7[_0x301e14(0x202)]:{},_0x108d7b={..._0x5c747b,..._0x1ea6b9},_0x56cec8={..._0x775a98,..._0x23f1e7};Object[_0x301e14(0x1f9)](_0x108d7b)[_0x301e14(0x1fe)]>0x0&&(_0x56cec8[_0x301e14(0x202)]=_0x108d7b);if(_0x301e14(0x20f)in _0x23f1e7)_0x56cec8['defaultApp']=_0x23f1e7[_0x301e14(0x20f)];else{if(_0x1ea6b9&&Object[_0x301e14(0x1f9)](_0x1ea6b9)[_0x301e14(0x1fe)]>0x0)_0x56cec8['defaultApp']=Object[_0x301e14(0x1f9)](_0x1ea6b9)[0x0];else _0x775a98['defaultApp']&&(_0x56cec8[_0x301e14(0x20f)]=_0x775a98[_0x301e14(0x20f)]);}return _0x56cec8;}export function readRawConfigWithLayers(_0x41e480){const _0x286f4c=loadRawConfigLayers(_0x41e480);return{'config':mergeRawConfigLayers(_0x286f4c),'layers':_0x286f4c};}export function readRawConfig(_0x29d221){return mergeRawConfigLayers(loadRawConfigLayers(_0x29d221));}export function readConfigFile(_0x3e75da){const _0x357559=a91_0x50add3;return parseCliConfigJsonFile(_0x3e75da,_0x357559(0x1f3));}export function writeConfigFile(_0x57b40b,_0x3b111f){const _0x3914b0=a91_0x50add3,_0x1520e4=dirname(_0x57b40b);!existsSync(_0x1520e4)&&mkdirSync(_0x1520e4,{'recursive':!![]});const _0x3d18da=_0x57b40b+_0x3914b0(0x208);try{writeFileSync(_0x3d18da,JSON[_0x3914b0(0x20c)](_0x3b111f,null,0x2)+'\x0a',{'encoding':_0x3914b0(0x225),'mode':0x180}),renameSync(_0x3d18da,_0x57b40b);}catch(_0x4a6199){try{unlinkSync(_0x3d18da);}catch{}throw _0x4a6199;}}export function resolveWriteConfigPath(_0xd66ccb){const _0x2d4b24=a91_0x50add3,_0x4ddee2=_0xd66ccb===_0x2d4b24(0x21e)?process[_0x2d4b24(0x1ee)]():homedir(),_0x37b99c=resolveConfigPath(_0x4ddee2);return _0x37b99c??resolve(_0x4ddee2,NEW_CONFIG_NAME);}function buildConfig(_0x4e0753,_0x1beabb){const _0x4cb7a4=a91_0x50add3,_0x4e3c18={};if(_0x4e0753[_0x4cb7a4(0x202)]&&typeof _0x4e0753[_0x4cb7a4(0x202)]===_0x4cb7a4(0x233))for(const [_0x1d41d3,_0xd6015c]of Object['entries'](_0x4e0753[_0x4cb7a4(0x202)])){_0xd6015c&&typeof _0xd6015c==='object'&&_0xd6015c['appcode']&&(_0x4e3c18[_0x1d41d3]=_0xd6015c);}const _0x5c7b2b=_0x4e0753[_0x4cb7a4(0x20f)]||undefined,_0x14775d=Object[_0x4cb7a4(0x1f9)](_0x4e3c18)['length']>0x0,_0x7c623c=_0x1beabb[_0x4cb7a4(0x207)]||env('APP')||undefined,_0x513390=_0x7c623c||_0x5c7b2b||undefined,_0x50cc51=_0x1beabb['appcode']||env(_0x4cb7a4(0x21c))||undefined,_0x191bf5=_0x50cc51?Object[_0x4cb7a4(0x215)](_0x4e3c18)['find'](([,_0x43d684])=>_0x43d684?.[_0x4cb7a4(0x1f4)]===_0x50cc51):undefined,_0x318ca4=_0x191bf5?.[0x0],_0x52d6a8=_0x191bf5?.[0x1];let _0x791d8f=_0x50cc51?_0x318ca4:_0x513390,_0x5d03b3=_0x791d8f&&_0x4e3c18[_0x791d8f]?_0x4e3c18[_0x791d8f]:undefined;_0x50cc51&&_0x52d6a8&&(_0x5d03b3=_0x52d6a8);const _0x53dd0a=_0x50cc51?_0x52d6a8??_0x5d03b3:_0x5d03b3,_0x4809e1=_0x7c623c||(_0x50cc51?_0x318ca4:undefined),_0x546ee5=_0x50cc51||_0x53dd0a?.['appcode']||_0x4e0753[_0x4cb7a4(0x1f4)]||_0x4e0753[_0x4cb7a4(0x207)]||undefined,_0x23e888=_0x1beabb[_0x4cb7a4(0x1eb)]||env(_0x4cb7a4(0x209))||_0x53dd0a?.[_0x4cb7a4(0x1eb)]||_0x4e0753[_0x4cb7a4(0x1eb)]||_0x4cb7a4(0x1f2),_0x1880e8=_0x53dd0a?.[_0x4cb7a4(0x1fa)]||_0x4e0753[_0x4cb7a4(0x1fa)]||_0x4cb7a4(0x22a),_0x45a84b=env(_0x4cb7a4(0x1f0))||_0x53dd0a?.['cookie']||_0x4e0753['cookie']||undefined,_0x42c441=env(_0x4cb7a4(0x22d))||_0x53dd0a?.[_0x4cb7a4(0x230)]||_0x4e0753[_0x4cb7a4(0x230)]||undefined,_0x41c28e=_0x1beabb[_0x4cb7a4(0x228)]||env('FORMAT')||_0x53dd0a?.[_0x4cb7a4(0x228)]||_0x4e0753[_0x4cb7a4(0x228)],_0x445103=normalizeLegacyOutputFormat(_0x41c28e),_0xa0f192=env(_0x4cb7a4(0x22f))||_0x53dd0a?.[_0x4cb7a4(0x1fd)]||_0x4e0753['pageSize'],_0x53d9ac=_0xa0f192?Number(_0xa0f192)||undefined:undefined,_0x31c230=env(_0x4cb7a4(0x20d))||env(_0x4cb7a4(0x1ef))||_0x53dd0a?.['riskLevel']||_0x4e0753[_0x4cb7a4(0x232)]||_0x4e0753['maxRisk'],_0x105c97=_0x31c230===_0x4cb7a4(0x224)||_0x31c230===_0x4cb7a4(0x229)?_0x31c230:_0x4cb7a4(0x223),_0x2a759f=env(_0x4cb7a4(0x1f1)),_0x2c7e06=_0x2a759f==='1'||_0x2a759f===_0x4cb7a4(0x1ff),_0x885e8=_0x53dd0a?.[_0x4cb7a4(0x1f6)]||_0x4e0753[_0x4cb7a4(0x1f6)]||DEFAULT_API_DIR;return{'appCode':typeof _0x546ee5===_0x4cb7a4(0x217)&&_0x546ee5[_0x4cb7a4(0x213)]()?_0x546ee5[_0x4cb7a4(0x213)]():undefined,'env':_0x23e888===_0x4cb7a4(0x21a)?_0x4cb7a4(0x1f2):_0x23e888===_0x4cb7a4(0x231)?_0x4cb7a4(0x231):'production','locale':_0x1880e8,'cookie':_0x45a84b,'accessKey':_0x42c441,'format':_0x445103,'pageSize':_0x53d9ac,'riskLevel':_0x105c97,'verbose':_0x2c7e06,'apiDir':_0x885e8,'apps':_0x4e3c18,'defaultApp':_0x5c7b2b,'currentApp':_0x14775d?_0x791d8f:undefined,'explicitAppName':_0x4809e1,'raw':_0x4e0753};}async function buildAuth(_0x207b2c){const _0x1c8ac0=a91_0x50add3,{getCookie:_0x33e985}=await import(_0x1c8ac0(0x22c)),_0x26ab3f=_0x207b2c[_0x1c8ac0(0x227)]||_0x33e985(),_0x3d8679=_0x26ab3f?await getIsSessionValid():![];return{'cookie':_0x26ab3f,'isLoggedIn':_0x3d8679,async 'getOrLogin'(){const _0x495ab9=_0x1c8ac0;if(_0x26ab3f&&_0x3d8679)return _0x26ab3f;throw CliErrors[_0x495ab9(0x218)]();}};}export function resolveApiFilePath(_0x4187e2,_0x38e08d){const _0xdb3f6d=a91_0x50add3,_0x244825=resolve(process[_0xdb3f6d(0x1ee)](),_0x4187e2),_0x267c03=resolve(_0x244825,_0xdb3f6d(0x204));if(!_0x38e08d)return _0x267c03;const _0x37ccb9=readRawConfig(),_0xe1d64e=_0x37ccb9['apps']&&typeof _0x37ccb9['apps']==='object'?_0x37ccb9[_0xdb3f6d(0x202)]:{},_0x1f32b8=Object[_0xdb3f6d(0x215)](_0xe1d64e)[_0xdb3f6d(0x222)](([,_0x38463f])=>_0x38463f?.[_0xdb3f6d(0x1f4)]===_0x38e08d);if(!_0x1f32b8)return _0x267c03;const [_0x53c235,_0x2687a9]=_0x1f32b8,_0x933e2e=typeof _0x37ccb9[_0xdb3f6d(0x20f)]==='string'?_0x37ccb9[_0xdb3f6d(0x20f)]:undefined;if(_0x2687a9?.[_0xdb3f6d(0x1f6)])return _0x267c03;if(_0x933e2e&&_0x53c235!==_0x933e2e)return resolve(_0x244825,_0x53c235+_0xdb3f6d(0x1ea));return _0x267c03;}
@@ -1 +1 @@
1
- (function(_0x45f1c9,_0x2bf8ec){const _0x50c6d2=a91_0x4d0b,_0x527c67=_0x45f1c9();while(!![]){try{const _0x55bca4=-parseInt(_0x50c6d2(0x112))/0x1*(-parseInt(_0x50c6d2(0x116))/0x2)+parseInt(_0x50c6d2(0x117))/0x3+parseInt(_0x50c6d2(0x118))/0x4*(parseInt(_0x50c6d2(0x109))/0x5)+-parseInt(_0x50c6d2(0x10e))/0x6*(-parseInt(_0x50c6d2(0x10c))/0x7)+-parseInt(_0x50c6d2(0x108))/0x8+-parseInt(_0x50c6d2(0x111))/0x9+-parseInt(_0x50c6d2(0x115))/0xa*(parseInt(_0x50c6d2(0x10b))/0xb);if(_0x55bca4===_0x2bf8ec)break;else _0x527c67['push'](_0x527c67['shift']());}catch(_0x5af549){_0x527c67['push'](_0x527c67['shift']());}}}(a91_0xf81b,0xd1651));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a91_0x4d0b(_0x43b306,_0x49cb1e){_0x43b306=_0x43b306-0x105;const _0xf81b01=a91_0xf81b();let _0x4d0b3a=_0xf81b01[_0x43b306];return _0x4d0b3a;}const cache=new Map();function parseApiFile(_0x3eab77){const _0x247694=a91_0x4d0b,_0x433894=[],_0x1cdedd=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x50b055;while((_0x50b055=_0x1cdedd[_0x247694(0x105)](_0x3eab77))!==null){_0x433894[_0x247694(0x10d)]({'datasetCode':_0x50b055[0x1],'tableName':_0x50b055[0x2],'name':_0x50b055[0x3],'alias':_0x50b055[0x4]});}return _0x433894;}export function loadAliasMap(_0xdbed6e,_0x30cc15,_0x3cf2f9){const _0x145238=a91_0x4d0b,_0x420f2d=_0x3cf2f9??resolve(process[_0x145238(0x10a)](),_0xdbed6e,_0x145238(0x113));if(cache['has'](_0x420f2d))return cache[_0x145238(0x110)](_0x420f2d);if(!existsSync(_0x420f2d))return cache[_0x145238(0x10f)](_0x420f2d,[]),[];try{const _0x4110f3=readFileSync(_0x420f2d,_0x145238(0x106)),_0x3bed79=parseApiFile(_0x4110f3);return cache['set'](_0x420f2d,_0x3bed79),_0x3bed79;}catch{return cache['set'](_0x420f2d,[]),[];}}export function resolveAlias(_0xf1c728,_0x3bdea2,_0x47ccc0,_0x3d4591){const _0x3b6941=a91_0x4d0b;if(!_0x3bdea2)return undefined;const _0x5d83a5=loadAliasMap(_0xf1c728,_0x47ccc0,_0x3d4591),_0x2ad454=_0x5d83a5[_0x3b6941(0x107)](_0x58a8a2=>_0x58a8a2[_0x3b6941(0x114)]===_0x3bdea2);return _0x2ad454?.['datasetCode'];}function a91_0xf81b(){const _0x38a46f=['49379saTaBV','63XRUbvF','push','391578TqzaEl','set','get','1007982SqUhzQ','1LArtYw','api.ts','alias','5770INVngX','2478154EboKDE','3277926wflXiN','4EKlKcQ','exec','utf-8','find','7692440LnjxSQ','8011505aegOWs','cwd'];a91_0xf81b=function(){return _0x38a46f;};return a91_0xf81b();}export function listAliases(_0x182d6b,_0x462946,_0x1a4d98){return loadAliasMap(_0x182d6b,_0x462946,_0x1a4d98);}
1
+ (function(_0x14827f,_0x5af67b){const _0x574ec7=a92_0x301c,_0x86010=_0x14827f();while(!![]){try{const _0x24e88e=parseInt(_0x574ec7(0x74))/0x1*(parseInt(_0x574ec7(0x7e))/0x2)+-parseInt(_0x574ec7(0x80))/0x3*(parseInt(_0x574ec7(0x79))/0x4)+parseInt(_0x574ec7(0x73))/0x5*(parseInt(_0x574ec7(0x7b))/0x6)+parseInt(_0x574ec7(0x76))/0x7*(-parseInt(_0x574ec7(0x77))/0x8)+-parseInt(_0x574ec7(0x7a))/0x9+parseInt(_0x574ec7(0x7c))/0xa*(parseInt(_0x574ec7(0x82))/0xb)+-parseInt(_0x574ec7(0x6f))/0xc*(-parseInt(_0x574ec7(0x72))/0xd);if(_0x24e88e===_0x5af67b)break;else _0x86010['push'](_0x86010['shift']());}catch(_0x42cb88){_0x86010['push'](_0x86010['shift']());}}}(a92_0x4981,0xd3cbe));function a92_0x4981(){const _0x2579d0=['set','21518tphPyV','3816rdiSdH','cwd','36ELgyYh','14643963pXfMUh','1668vnQXAP','2606980IXdXwJ','api.ts','10DNwIgF','datasetCode','30153Omnlyy','alias','33gTXbhi','find','60BMgizp','has','exec','1709461pOBEAB','17705RGRcxv','325481cpHyUs'];a92_0x4981=function(){return _0x2579d0;};return a92_0x4981();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x47b287){const _0x47faf3=a92_0x301c,_0x4c4c1a=[],_0x2d6be2=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x31b85e;while((_0x31b85e=_0x2d6be2[_0x47faf3(0x71)](_0x47b287))!==null){_0x4c4c1a['push']({'datasetCode':_0x31b85e[0x1],'tableName':_0x31b85e[0x2],'name':_0x31b85e[0x3],'alias':_0x31b85e[0x4]});}return _0x4c4c1a;}function a92_0x301c(_0x45341c,_0x54c0f7){_0x45341c=_0x45341c-0x6e;const _0x498115=a92_0x4981();let _0x301c9c=_0x498115[_0x45341c];return _0x301c9c;}export function loadAliasMap(_0x5ed398,_0x3d9ed1,_0x5748fb){const _0x57924e=a92_0x301c,_0xbee92e=_0x5748fb??resolve(process[_0x57924e(0x78)](),_0x5ed398,_0x57924e(0x7d));if(cache[_0x57924e(0x70)](_0xbee92e))return cache['get'](_0xbee92e);if(!existsSync(_0xbee92e))return cache[_0x57924e(0x75)](_0xbee92e,[]),[];try{const _0x367fef=readFileSync(_0xbee92e,'utf-8'),_0x277d2c=parseApiFile(_0x367fef);return cache[_0x57924e(0x75)](_0xbee92e,_0x277d2c),_0x277d2c;}catch{return cache['set'](_0xbee92e,[]),[];}}export function resolveAlias(_0x2064ea,_0x39465e,_0x3433d1,_0x4c7d02){const _0x42557a=a92_0x301c;if(!_0x39465e)return undefined;const _0xd82907=loadAliasMap(_0x2064ea,_0x3433d1,_0x4c7d02),_0x151240=_0xd82907[_0x42557a(0x6e)](_0xc878e5=>_0xc878e5[_0x42557a(0x81)]===_0x39465e);return _0x151240?.[_0x42557a(0x7f)];}export function listAliases(_0x4091fe,_0x6f2005,_0xae1c6d){return loadAliasMap(_0x4091fe,_0x6f2005,_0xae1c6d);}
@@ -1 +1 @@
1
- function a92_0x4936(){const _0x5dc4d4=['enabled','type','isArray','responseFields','const\x20result\x20=\x20await\x20client.models.','GET','54mCGrUf','pageSize','//\x20SQL:\x20','path','remove','warn','cookie','tableData','modelCode','350912eMkxWO','errorCode','name','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','validation','sdk','BFF\x20script\x20not\x20found:\x20id=','\x20\x20return\x20rows;','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','277039sgLrVj','/api/node-toolbox/sql/save','push','success','UNAUTHORIZED','84312HxkGiX','\x20of\x20','status','stringify','/api/management/library/scripts/delete','filter','operationName','data','\x22\x20not\x20found\x20in\x20dataset\x20','401','dbtableConfig','displayName','25KmsPNk','170228fQMTZK','description','.create({\x20/*\x20fields\x20*/\x20});','sqlName','.getOne(id);','includeImports','getOne','(/*\x20params\x20*/);','\x20\x20currentPage:\x201,','/smartapi/app/getList','Request\x20timeout:\x20','has','table','join','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','functionName','/api/custom/executeSql','/smartapi/question/er-config','find','scriptName','\x20\x20pageSize:\x2020,','/api/management/library/scripts/info?id=','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','const\x20data\x20=\x20await\x20client.sql.execute({','.remove(id);','sqlCode','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','operations','apiError','target','AbortError','map','7758756fMYwHc','totalCount','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','currentPage','modelId','781jEMDPo','cli:rabetbase','/smartapi/dataset/get-dataset-list','const\x20results\x20=\x20data.execResult\x20||\x20[];','application/json','Operation\x20\x22','body','/api/management/library/scripts/statistics?appCode=','add','POST','56mvsAaz','delete','\x20\x20where:\x20{},','toLowerCase','36039oJFoCO','json','\x20\x20});','Unauthorized','API\x20error:\x20','\x20\x20\x20\x20sqlCode:\x20\x27','tableName','38630YHVwPh','authRequired','errorMsg','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','create','/smartapi/dataset/get-dataset-operation','requestFields','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20failed,\x20HTTP\x20','message','entries','label','error','object','&type=','method','/api/management/library/scripts/list?appCode=','includes','//\x20','/smartapi/dataset/get-driven-data?','code','update','26uDcDQD'];a92_0x4936=function(){return _0x5dc4d4;};return a92_0x4936();}(function(_0x4a2ef2,_0x2112fd){const _0x313914=a92_0x2c13,_0x2183f7=_0x4a2ef2();while(!![]){try{const _0xbda878=parseInt(_0x313914(0xaf))/0x1+-parseInt(_0x313914(0x9f))/0x2*(-parseInt(_0x313914(0x82))/0x3)+parseInt(_0x313914(0xca))/0x4*(-parseInt(_0x313914(0xc9))/0x5)+-parseInt(_0x313914(0xa6))/0x6*(-parseInt(_0x313914(0xb8))/0x7)+parseInt(_0x313914(0x7e))/0x8*(-parseInt(_0x313914(0xbd))/0x9)+parseInt(_0x313914(0x89))/0xa*(parseInt(_0x313914(0xef))/0xb)+-parseInt(_0x313914(0xea))/0xc;if(_0xbda878===_0x2112fd)break;else _0x2183f7['push'](_0x2183f7['shift']());}catch(_0x2ad374){_0x2183f7['push'](_0x2183f7['shift']());}}}(a92_0x4936,0x33e8f));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(_0x18e989){_activeCookie=_0x18e989||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x47ba9d,_0x414bc7={}){const _0x195330=a92_0x2c13,{method:method=_0x195330(0xa5),body:_0x572e3e,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x414bc7,_0x227c6a=useRuntime?getRuntimeDomain():getApiDomain(),_0xb5b3b=_activeCookie||getCookie(),_0x499d5e=''+_0x227c6a+_0x47ba9d,_0x3c6149=new AbortController(),_0x4ed961=setTimeout(()=>_0x3c6149['abort'](),timeout);try{const _0x3d0b99=await fetch(_0x499d5e,{'method':method,'headers':{'Content-Type':_0x195330(0xf3),'Cookie':_0xb5b3b,'X-Invoke-Source':_0x195330(0xf0),...headers},'body':_0x572e3e?JSON[_0x195330(0xc0)](_0x572e3e):undefined,'signal':_0x3c6149['signal']});let _0x428160;try{_0x428160=await _0x3d0b99[_0x195330(0x83)]();}catch{throw CliErrors[_0x195330(0xe6)](_0x195330(0xd8)+_0x3d0b99[_0x195330(0xbf)]+')',_0x3d0b99['status']>=0x190?_0x195330(0xe4):undefined);}if(!_0x3d0b99['ok']||_0x428160[_0x195330(0xbb)]===![])throw CliErrors[_0x195330(0xe6)](_0x428160[_0x195330(0x8b)]||_0x428160[_0x195330(0x92)]||_0x195330(0x86)+_0x3d0b99[_0x195330(0xbf)],_0x428160[_0x195330(0xb0)]?'API\x20error\x20code:\x20'+_0x428160[_0x195330(0xb0)]:undefined);return _0x428160;}catch(_0x598e9c){if(_0x598e9c instanceof Error&&_0x598e9c[_0x195330(0xb1)]===_0x195330(0xe8))throw CliErrors[_0x195330(0xe6)](_0x195330(0xd4)+_0x499d5e);throw _0x598e9c;}finally{clearTimeout(_0x4ed961);}}function isAuthFailure(_0x493cdb){const _0x7eba69=a92_0x2c13,_0x542421=_0x493cdb[_0x7eba69(0x8b)]||_0x493cdb['message']||_0x493cdb['data']?.[_0x7eba69(0x92)]||_0x493cdb['errorMessage']||_0x493cdb[_0x7eba69(0x95)]||'';return _0x493cdb[_0x7eba69(0xb0)]===_0x7eba69(0xbc)||_0x493cdb[_0x7eba69(0x9d)]===0x191||_0x493cdb[_0x7eba69(0x9d)]==='401'||_0x542421['includes'](_0x7eba69(0xc6))||_0x542421[_0x7eba69(0x9a)](_0x7eba69(0x85))||_0x542421[_0x7eba69(0x9a)]('登录')||_0x542421[_0x7eba69(0x9a)]('认证');}export async function platformFetch(_0x58afd2,_0x1b90a9){const _0x547960=a92_0x2c13,_0x5432c4=await fetch(_0x58afd2,{'method':_0x1b90a9['method']??'GET','headers':{'Content-Type':_0x547960(0xf3),'Cookie':_0x1b90a9[_0x547960(0xac)]},..._0x1b90a9['body']&&{'body':JSON['stringify'](_0x1b90a9[_0x547960(0xf5)])}});if(!_0x5432c4['ok']){if(_0x5432c4[_0x547960(0xbf)]===0x191)throw CliErrors[_0x547960(0x8a)]();throw CliErrors[_0x547960(0xe6)](_0x1b90a9[_0x547960(0x94)]+_0x547960(0x91)+_0x5432c4[_0x547960(0xbf)]);}const _0x4f5adf=await _0x5432c4[_0x547960(0x83)]();if(_0x4f5adf[_0x547960(0xbb)]===![]){if(isAuthFailure(_0x4f5adf))throw CliErrors[_0x547960(0x8a)]();throw CliErrors[_0x547960(0xe6)](_0x4f5adf[_0x547960(0x8b)]||_0x4f5adf[_0x547960(0x92)]||_0x1b90a9[_0x547960(0x94)]+'\x20failed');}return _0x4f5adf[_0x547960(0xc4)];}function a92_0x2c13(_0x112f94,_0x43ef28){_0x112f94=_0x112f94-0x7d;const _0x49360f=a92_0x4936();let _0x2c13cd=_0x49360f[_0x112f94];return _0x2c13cd;}export async function listBffScripts(_0x36e207,_0x5a0092,_0x5ee6fe){const _0x25218e=a92_0x2c13;let _0x5cbab3=_0x25218e(0x99)+_0x36e207;if(_0x5a0092)_0x5cbab3+=_0x25218e(0x97)+_0x5a0092;const _0x38146a=await apiRequest(_0x5cbab3);let _0x5b259b=extractList(_0x38146a[_0x25218e(0xc4)]);if(_0x5ee6fe?.[_0x25218e(0xdd)]){const _0x247ef0=_0x5ee6fe[_0x25218e(0xdd)][_0x25218e(0x81)]();_0x5b259b=_0x5b259b['filter'](_0x31cf8c=>_0x31cf8c[_0x25218e(0xd9)]?.[_0x25218e(0x81)]()[_0x25218e(0x9a)](_0x247ef0)||_0x31cf8c['description']?.[_0x25218e(0x81)]()[_0x25218e(0x9a)](_0x247ef0));}return _0x5b259b;}export async function getBffScriptInfo(_0x1d904e){const _0x42fe36=a92_0x2c13,_0x317aa3=await apiRequest(_0x42fe36(0xdf)+_0x1d904e);if(!_0x317aa3[_0x42fe36(0xc4)])throw CliErrors[_0x42fe36(0xb3)](_0x42fe36(0xb5)+_0x1d904e);return _0x317aa3['data'];}export async function saveBffScript(_0x245160){const _0x5f0233=a92_0x2c13,_0xb7c26d=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x245160});return _0xb7c26d[_0x5f0233(0xc4)];}export async function deleteBffScript(_0x3b60d2){const _0x5b6f06=a92_0x2c13;await apiRequest(_0x5b6f06(0xc1),{'method':'POST','body':{'id':_0x3b60d2}});}export async function getBffScriptStatistics(_0x9fbe14){const _0x3bfd65=a92_0x2c13,_0x7c7902=await apiRequest(_0x3bfd65(0xf6)+_0x9fbe14);return extractList(_0x7c7902[_0x3bfd65(0xc4)]);}export async function listBffDatasetOperations(_0x5536a0,_0x840cb1){const _0xebfc=a92_0x2c13,_0x56b966=await apiRequest(_0xebfc(0x8e),{'method':_0xebfc(0x7d),'body':{'appCode':_0x5536a0,'datasetId':_0x840cb1}});return _0x56b966[_0xebfc(0xc4)];}export async function listSqlQueries(_0x433f19,_0x108b6a){const _0x3888e5=a92_0x2c13,_0x2dd686=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x433f19,'currentPage':_0x108b6a?.[_0x3888e5(0xed)]??0x1,'pageSize':_0x108b6a?.[_0x3888e5(0xa7)]??0x32,'sqlCode':_0x108b6a?.['sqlCode'],'sqlName':_0x108b6a?.[_0x3888e5(0xcd)]}});return _0x2dd686[_0x3888e5(0xc4)];}export async function getSqlQueryInfo(_0x4ced76,_0x544f85){const _0x3351db=a92_0x2c13,_0x26bacf=await listSqlQueries(_0x4ced76,{'sqlCode':_0x544f85}),_0x9b4f5=_0x26bacf[_0x3351db(0xad)]?.[0x0];if(!_0x9b4f5)throw CliErrors[_0x3351db(0xb3)]('SQL\x20query\x20not\x20found:\x20'+_0x544f85);return _0x9b4f5;}export async function saveSqlQuery(_0x38e472){const _0x26c13b=a92_0x2c13,_0x2ef8ac=await apiRequest(_0x26c13b(0xb9),{'method':_0x26c13b(0x7d),'body':_0x38e472});return _0x2ef8ac[_0x26c13b(0xc4)];}export async function executeSql(_0x3087ea,_0x125c9e,_0x411198){const _0x442970=a92_0x2c13,_0x161de5=await apiRequest(_0x442970(0xda),{'method':_0x442970(0x7d),'body':{'appCode':_0x3087ea,'sqlCode':_0x125c9e,..._0x411198&&{'params':_0x411198}},'useRuntime':!![]});return _0x161de5['data'];}export async function listDatasets(_0x5837b8,_0x5107b9){const _0x40b3a1=a92_0x2c13,_0x43e1a0={'appCode':_0x5837b8,'deleted':![]};if(_0x5107b9?.[_0x40b3a1(0x9d)])_0x43e1a0['code']=_0x5107b9[_0x40b3a1(0x9d)];if(_0x5107b9?.[_0x40b3a1(0xb1)])_0x43e1a0[_0x40b3a1(0xb1)]=_0x5107b9[_0x40b3a1(0xb1)];const _0x4a1ccd=await apiRequest(_0x40b3a1(0xf1),{'method':_0x40b3a1(0x7d),'body':_0x43e1a0});return extractList(_0x4a1ccd[_0x40b3a1(0xc4)]);}export async function searchDatasets(_0x4077eb,_0x517109){const _0x3d4cef=a92_0x2c13,_0x465ff7=await listDatasets(_0x4077eb,{'name':_0x517109}),_0x2e681e=_0x517109[_0x3d4cef(0x81)](),_0x428526=new Set(_0x465ff7['map'](_0xca296a=>_0xca296a['id'])),_0x4ce8dd=_0x465ff7[_0x3d4cef(0xc2)](_0x145314=>_0x145314[_0x3d4cef(0xc7)]?.['tableName']?.[_0x3d4cef(0x81)]()['includes'](_0x2e681e)||_0x145314[_0x3d4cef(0xcb)]?.[_0x3d4cef(0x81)]()['includes'](_0x2e681e)),_0x29f966=await listDatasets(_0x4077eb,{'code':_0x517109});for(const _0x375198 of _0x29f966){!_0x428526[_0x3d4cef(0xd5)](_0x375198['id'])&&(_0x465ff7[_0x3d4cef(0xba)](_0x375198),_0x428526[_0x3d4cef(0xf7)](_0x375198['id']));}return _0x465ff7;}export function normalizeDatasetOperations(_0x4aba89){const _0xed26af=a92_0x2c13;if(Array[_0xed26af(0xa2)](_0x4aba89))return _0x4aba89[_0xed26af(0xc2)](_0x20da74=>_0x20da74!=null&&typeof _0x20da74===_0xed26af(0x96));if(_0x4aba89&&typeof _0x4aba89===_0xed26af(0x96))return Object[_0xed26af(0x93)](_0x4aba89)['filter'](([,_0x345c63])=>_0x345c63!=null&&typeof _0x345c63==='object')[_0xed26af(0xe9)](([_0x1226b1,_0x103d35])=>({..._0x103d35,'name':_0x103d35['name']??_0x103d35['operationName']??_0x1226b1}));return[];}export async function getDatasetDetail(_0x4cbb39){const _0x53d52b=a92_0x2c13,_0x319918=/^\d+$/['test'](_0x4cbb39)?'id':_0x53d52b(0x9d),_0x58f441=await apiRequest(_0x53d52b(0x9c)+_0x319918+'='+_0x4cbb39);return _0x58f441[_0x53d52b(0xc4)];}export async function getDatasetOperations(_0x584c54){const _0x17cb83=a92_0x2c13,_0x3f76f8=await getDatasetDetail(_0x584c54),_0x224eaf=normalizeDatasetOperations(_0x3f76f8[_0x17cb83(0xe5)])['map'](_0x58b697=>({'name':_0x58b697['name']||_0x58b697[_0x17cb83(0xc3)],'displayName':_0x58b697[_0x17cb83(0xc8)]||_0x58b697[_0x17cb83(0xb1)],'type':_0x58b697[_0x17cb83(0xa1)],'method':_0x58b697[_0x17cb83(0x98)],'path':_0x58b697[_0x17cb83(0xa9)],'enabled':_0x58b697[_0x17cb83(0xa0)]??!![],'requestFields':_0x58b697[_0x17cb83(0x8f)],'responseFields':_0x58b697[_0x17cb83(0xa3)]}));return{'dataset':{'id':_0x3f76f8['id']??_0x3f76f8[_0x17cb83(0xee)],'name':_0x3f76f8['name'],'code':_0x3f76f8[_0x17cb83(0x9d)]||_0x3f76f8[_0x17cb83(0xae)],'tableName':_0x3f76f8['tableName']||_0x3f76f8[_0x17cb83(0xc7)]?.[_0x17cb83(0x88)]},'operations':_0x224eaf};}export async function getOperationDetail(_0x12b2ec,_0x32dbeb,_0x375354){const _0xdc04bc=a92_0x2c13;let _0x29fdd0=_0x32dbeb;if(!/^\d+$/['test'](_0x32dbeb)){const _0x510671=await listDatasets(_0x12b2ec,{'code':_0x32dbeb}),_0x17f69f=_0x510671[_0xdc04bc(0xdc)](_0x35ad28=>_0x35ad28[_0xdc04bc(0x9d)]===_0x32dbeb||String(_0x35ad28['id'])===_0x32dbeb);if(!_0x17f69f)throw CliErrors['validation']('Dataset\x20not\x20found:\x20'+_0x32dbeb);_0x29fdd0=String(_0x17f69f['id']);}const _0x393ce4=await getDatasetDetail(_0x29fdd0),_0x190762=normalizeDatasetOperations(_0x393ce4[_0xdc04bc(0xe5)])[_0xdc04bc(0xdc)](_0x4b9c85=>(_0x4b9c85['name']||_0x4b9c85[_0xdc04bc(0xc3)])===_0x375354);if(!_0x190762)throw CliErrors[_0xdc04bc(0xb3)](_0xdc04bc(0xf4)+_0x375354+_0xdc04bc(0xc5)+_0x32dbeb);return{'dataset':{'id':_0x393ce4['id']??_0x393ce4[_0xdc04bc(0xee)],'name':_0x393ce4[_0xdc04bc(0xb1)],'code':_0x393ce4['code']||_0x393ce4[_0xdc04bc(0xae)],'tableName':_0x393ce4[_0xdc04bc(0x88)]||_0x393ce4[_0xdc04bc(0xc7)]?.[_0xdc04bc(0x88)]},'operation':_0x190762};}export function generateSdkCode(_0x5b9997,_0x40b7e9,_0x54159d){const _0x14c350=a92_0x2c13,_0x4e0b76=_0x54159d?.['includeImports']??!![],_0x3d4dda='dataset_'+_0x5b9997[_0x14c350(0x9d)]?.['replace'](/-/g,'_'),_0x20a038=_0x40b7e9[_0x14c350(0xb1)]||_0x40b7e9['operationName']||_0x14c350(0xc2),_0x4ff3ba=[];_0x4e0b76&&_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xec),'',_0x14c350(0x90),'');_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0x9b)+_0x5b9997['name']+'\x20('+(_0x5b9997[_0x14c350(0x88)]||_0x14c350(0xd6))+')');if(_0x20a038===_0x14c350(0xc2))_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xa4)+_0x3d4dda+'.filter({',_0x14c350(0x80),_0x14c350(0xde),_0x14c350(0xd2),'});');else{if(_0x20a038===_0x14c350(0xd0))_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xa4)+_0x3d4dda+_0x14c350(0xce));else{if(_0x20a038===_0x14c350(0x8d))_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xa4)+_0x3d4dda+_0x14c350(0xcc));else{if(_0x20a038===_0x14c350(0x9e))_0x4ff3ba[_0x14c350(0xba)]('const\x20result\x20=\x20await\x20client.models.'+_0x3d4dda+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x20a038===_0x14c350(0x7f)||_0x20a038===_0x14c350(0xaa)?_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xa4)+_0x3d4dda+_0x14c350(0xe2)):_0x4ff3ba[_0x14c350(0xba)](_0x14c350(0xa4)+_0x3d4dda+'.'+_0x20a038+_0x14c350(0xd1));}}}return _0x4ff3ba[_0x14c350(0xd7)]('\x0a');}export function generateSqlCodeTemplate(_0x4e935e,_0x38ef42){const _0x592644=a92_0x2c13,_0x225fd6=_0x38ef42?.[_0x592644(0xe7)]??_0x592644(0xb4),_0x165ad3=_0x38ef42?.[_0x592644(0xcf)]??!![],_0x27f32b=[];return _0x27f32b[_0x592644(0xba)](_0x592644(0xa8)+_0x4e935e[_0x592644(0xcd)]+'\x20('+_0x4e935e[_0x592644(0xe3)]+')'),_0x225fd6===_0x592644(0xb4)?(_0x165ad3&&_0x27f32b[_0x592644(0xba)](_0x592644(0xec),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x27f32b[_0x592644(0xba)](_0x592644(0xe1),'\x20\x20sqlCode:\x20\x27'+_0x4e935e[_0x592644(0xe3)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});',_0x592644(0xb7),_0x592644(0xf2))):_0x27f32b[_0x592644(0xba)](_0x592644(0xb2),_0x592644(0xe0),_0x592644(0x8c),_0x592644(0x87)+_0x4e935e['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x592644(0x84),_0x592644(0xb6),'}'),_0x27f32b[_0x592644(0xd7)]('\x0a');}export async function getErConfig(_0x191382,_0x5c706c){const _0x4c530f=a92_0x2c13,_0x4cd2a4=await apiRequest(_0x4c530f(0xdb),{'method':_0x4c530f(0x7d),'body':{'appCode':_0x191382,'dblinkId':_0x5c706c}});return _0x4cd2a4[_0x4c530f(0xc4)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x3a3222=a92_0x2c13,_0x2f8787=await apiRequest(_0x3a3222(0xd3),{'method':_0x3a3222(0x7d),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x49f297=extractList(_0x2f8787[_0x3a3222(0xc4)]),_0x12eaa7=extractPaging(_0x2f8787['data']);return _0x12eaa7&&_0x12eaa7[_0x3a3222(0xeb)]>REMOTE_APP_PAGE_SIZE&&console[_0x3a3222(0xab)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x3a3222(0xbe)+_0x12eaa7[_0x3a3222(0xeb)]+'\x20apps.\x20'+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x49f297;}
1
+ (function(_0x2b1768,_0xb0152e){const _0xe48500=a93_0x39be,_0x2f1610=_0x2b1768();while(!![]){try{const _0x554d0a=-parseInt(_0xe48500(0x1fa))/0x1+-parseInt(_0xe48500(0x236))/0x2+-parseInt(_0xe48500(0x201))/0x3*(parseInt(_0xe48500(0x229))/0x4)+-parseInt(_0xe48500(0x1fb))/0x5+parseInt(_0xe48500(0x20c))/0x6*(-parseInt(_0xe48500(0x221))/0x7)+-parseInt(_0xe48500(0x22c))/0x8+parseInt(_0xe48500(0x20a))/0x9*(parseInt(_0xe48500(0x24b))/0xa);if(_0x554d0a===_0xb0152e)break;else _0x2f1610['push'](_0x2f1610['shift']());}catch(_0x5f3d74){_0x2f1610['push'](_0x2f1610['shift']());}}}(a93_0x1567,0x8c6dd));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(_0x3f8ec8){_activeCookie=_0x3f8ec8||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x509775,_0x2c9a71={}){const _0x1ee4d8=a93_0x39be,{method:method=_0x1ee4d8(0x1f8),body:_0xd5ffee,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x2c9a71,_0x4734c2=useRuntime?getRuntimeDomain():getApiDomain(),_0x1ff702=_activeCookie||getCookie(),_0x1e6225=''+_0x4734c2+_0x509775,_0x393627=new AbortController(),_0x2ddefc=setTimeout(()=>_0x393627['abort'](),timeout);try{const _0x28871e=await fetch(_0x1e6225,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x1ff702,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0xd5ffee?JSON[_0x1ee4d8(0x1f4)](_0xd5ffee):undefined,'signal':_0x393627[_0x1ee4d8(0x250)]});let _0x17fbda;try{_0x17fbda=await _0x28871e[_0x1ee4d8(0x213)]();}catch{throw CliErrors[_0x1ee4d8(0x22b)](_0x1ee4d8(0x248)+_0x28871e[_0x1ee4d8(0x1f1)]+')',_0x28871e[_0x1ee4d8(0x1f1)]>=0x190?_0x1ee4d8(0x253):undefined);}if(!_0x28871e['ok']||_0x17fbda[_0x1ee4d8(0x225)]===![])throw CliErrors['apiError'](_0x17fbda[_0x1ee4d8(0x208)]||_0x17fbda[_0x1ee4d8(0x20b)]||'API\x20error:\x20'+_0x28871e['status'],_0x17fbda['errorCode']?_0x1ee4d8(0x267)+_0x17fbda[_0x1ee4d8(0x200)]:undefined);return _0x17fbda;}catch(_0x12b321){if(_0x12b321 instanceof Error&&_0x12b321['name']==='AbortError')throw CliErrors['apiError'](_0x1ee4d8(0x21f)+_0x1e6225);throw _0x12b321;}finally{clearTimeout(_0x2ddefc);}}function isAuthFailure(_0x394a65){const _0x36b03f=a93_0x39be,_0x593322=_0x394a65[_0x36b03f(0x208)]||_0x394a65['message']||_0x394a65[_0x36b03f(0x209)]?.['message']||_0x394a65[_0x36b03f(0x216)]||_0x394a65[_0x36b03f(0x245)]||'';return _0x394a65[_0x36b03f(0x200)]===_0x36b03f(0x23b)||_0x394a65['code']===0x191||_0x394a65[_0x36b03f(0x24a)]==='401'||_0x593322['includes'](_0x36b03f(0x257))||_0x593322['includes'](_0x36b03f(0x240))||_0x593322[_0x36b03f(0x228)]('登录')||_0x593322[_0x36b03f(0x228)]('认证');}export async function platformFetch(_0x2a579d,_0x4b7bd3){const _0x96a422=a93_0x39be,_0x590aae=await fetch(_0x2a579d,{'method':_0x4b7bd3['method']??_0x96a422(0x1f8),'headers':{'Content-Type':'application/json','Cookie':_0x4b7bd3[_0x96a422(0x1ef)]},..._0x4b7bd3['body']&&{'body':JSON[_0x96a422(0x1f4)](_0x4b7bd3[_0x96a422(0x210)])}});if(!_0x590aae['ok']){if(_0x590aae[_0x96a422(0x1f1)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x96a422(0x22b)](_0x4b7bd3['label']+_0x96a422(0x1f9)+_0x590aae[_0x96a422(0x1f1)]);}const _0x4b2168=await _0x590aae[_0x96a422(0x213)]();if(_0x4b2168[_0x96a422(0x225)]===![]){if(isAuthFailure(_0x4b2168))throw CliErrors[_0x96a422(0x252)]();throw CliErrors[_0x96a422(0x22b)](_0x4b2168['errorMsg']||_0x4b2168['message']||_0x4b7bd3[_0x96a422(0x215)]+_0x96a422(0x244));}return _0x4b2168[_0x96a422(0x209)];}export async function listBffScripts(_0x1de149,_0x237dc6,_0x2dbb56){const _0xfb28bc=a93_0x39be;let _0x354ce8=_0xfb28bc(0x21c)+_0x1de149;if(_0x237dc6)_0x354ce8+=_0xfb28bc(0x246)+_0x237dc6;const _0x579b45=await apiRequest(_0x354ce8);let _0x268369=extractList(_0x579b45['data']);if(_0x2dbb56?.['scriptName']){const _0x579082=_0x2dbb56[_0xfb28bc(0x247)][_0xfb28bc(0x1f0)]();_0x268369=_0x268369[_0xfb28bc(0x262)](_0xd9c02e=>_0xd9c02e[_0xfb28bc(0x22e)]?.[_0xfb28bc(0x1f0)]()['includes'](_0x579082)||_0xd9c02e[_0xfb28bc(0x259)]?.[_0xfb28bc(0x1f0)]()[_0xfb28bc(0x228)](_0x579082));}return _0x268369;}export async function getBffScriptInfo(_0x23faf4){const _0x31f434=a93_0x39be,_0x10cf0e=await apiRequest(_0x31f434(0x260)+_0x23faf4);if(!_0x10cf0e[_0x31f434(0x209)])throw CliErrors['validation'](_0x31f434(0x1fd)+_0x23faf4);return _0x10cf0e[_0x31f434(0x209)];}export async function saveBffScript(_0x12568d){const _0x2ad54a=a93_0x39be,_0x2ea0db=await apiRequest(_0x2ad54a(0x21b),{'method':'POST','body':_0x12568d});return _0x2ea0db[_0x2ad54a(0x209)];}export async function deleteBffScript(_0x30ef57){const _0x236926=a93_0x39be;await apiRequest(_0x236926(0x24d),{'method':_0x236926(0x212),'body':{'id':_0x30ef57}});}export async function getBffScriptStatistics(_0x498280){const _0x29d2c7=a93_0x39be,_0x278dba=await apiRequest(_0x29d2c7(0x249)+_0x498280);return extractList(_0x278dba[_0x29d2c7(0x209)]);}export async function listBffDatasetOperations(_0x75a8eb,_0x56cc08){const _0x3aeac7=a93_0x39be,_0x306a7b=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x3aeac7(0x212),'body':{'appCode':_0x75a8eb,'datasetId':_0x56cc08}});return _0x306a7b['data'];}export async function listSqlQueries(_0x285be2,_0x58b5f0){const _0x224939=a93_0x39be,_0x46de56=await apiRequest(_0x224939(0x25f),{'method':_0x224939(0x212),'body':{'appCode':_0x285be2,'currentPage':_0x58b5f0?.[_0x224939(0x21d)]??0x1,'pageSize':_0x58b5f0?.[_0x224939(0x20f)]??0x32,'sqlCode':_0x58b5f0?.[_0x224939(0x1f2)],'sqlName':_0x58b5f0?.[_0x224939(0x230)]}});return _0x46de56[_0x224939(0x209)];}export async function getSqlQueryInfo(_0x1fcfd6,_0x2fdbf4){const _0x588520=a93_0x39be,_0x53a7f8=await listSqlQueries(_0x1fcfd6,{'sqlCode':_0x2fdbf4}),_0x429234=_0x53a7f8[_0x588520(0x232)]?.[0x0];if(!_0x429234)throw CliErrors[_0x588520(0x231)](_0x588520(0x258)+_0x2fdbf4);return _0x429234;}export async function saveSqlQuery(_0x3d967e){const _0x58a642=a93_0x39be,_0x2bffee=await apiRequest(_0x58a642(0x20e),{'method':_0x58a642(0x212),'body':_0x3d967e});return _0x2bffee[_0x58a642(0x209)];}export async function executeSql(_0xd295fa,_0x16a8d6,_0x2c7b25){const _0x3fbf6e=a93_0x39be,_0x4f17ca=await apiRequest(_0x3fbf6e(0x25c),{'method':_0x3fbf6e(0x212),'body':{'appCode':_0xd295fa,'sqlCode':_0x16a8d6,..._0x2c7b25&&{'params':_0x2c7b25}},'useRuntime':!![]});return _0x4f17ca[_0x3fbf6e(0x209)];}export async function listDatasets(_0x3cc323,_0x56632b){const _0x41ecf7=a93_0x39be,_0x48c7eb={'appCode':_0x3cc323,'deleted':![]};if(_0x56632b?.['code'])_0x48c7eb['code']=_0x56632b[_0x41ecf7(0x24a)];if(_0x56632b?.[_0x41ecf7(0x1f6)])_0x48c7eb[_0x41ecf7(0x1f6)]=_0x56632b[_0x41ecf7(0x1f6)];const _0xdbd8ef=await apiRequest(_0x41ecf7(0x223),{'method':'POST','body':_0x48c7eb});return extractList(_0xdbd8ef[_0x41ecf7(0x209)]);}export async function searchDatasets(_0x96b487,_0x2240a0){const _0xae3a23=a93_0x39be,_0x5d0346=await listDatasets(_0x96b487,{'name':_0x2240a0}),_0x23167e=_0x2240a0['toLowerCase'](),_0x5d58f1=new Set(_0x5d0346['map'](_0x21ca40=>_0x21ca40['id'])),_0x5ed7ab=_0x5d0346[_0xae3a23(0x262)](_0x4c13fd=>_0x4c13fd[_0xae3a23(0x24e)]?.[_0xae3a23(0x22f)]?.['toLowerCase']()[_0xae3a23(0x228)](_0x23167e)||_0x4c13fd[_0xae3a23(0x259)]?.[_0xae3a23(0x1f0)]()[_0xae3a23(0x228)](_0x23167e)),_0x2e95a2=await listDatasets(_0x96b487,{'code':_0x2240a0});for(const _0xc80d83 of _0x2e95a2){!_0x5d58f1['has'](_0xc80d83['id'])&&(_0x5d0346['push'](_0xc80d83),_0x5d58f1[_0xae3a23(0x20d)](_0xc80d83['id']));}return _0x5d0346;}export function normalizeDatasetOperations(_0x26b26d){const _0x112e4d=a93_0x39be;if(Array[_0x112e4d(0x235)](_0x26b26d))return _0x26b26d[_0x112e4d(0x262)](_0x32b0b8=>_0x32b0b8!=null&&typeof _0x32b0b8===_0x112e4d(0x218));if(_0x26b26d&&typeof _0x26b26d==='object')return Object['entries'](_0x26b26d)[_0x112e4d(0x262)](([,_0x1a23e1])=>_0x1a23e1!=null&&typeof _0x1a23e1===_0x112e4d(0x218))[_0x112e4d(0x224)](([_0x50c097,_0xeca100])=>({..._0xeca100,'name':_0xeca100[_0x112e4d(0x1f6)]??_0xeca100['operationName']??_0x50c097}));return[];}export async function getDatasetDetail(_0x421c35){const _0x2fc690=a93_0x39be,_0x142930=/^\d+$/[_0x2fc690(0x243)](_0x421c35)?'id':'code',_0x28f5bf=await apiRequest(_0x2fc690(0x220)+_0x142930+'='+_0x421c35);return _0x28f5bf[_0x2fc690(0x209)];}export async function getDatasetOperations(_0x1f438e){const _0x5847ad=a93_0x39be,_0x3b01e4=await getDatasetDetail(_0x1f438e),_0x34dc3d=normalizeDatasetOperations(_0x3b01e4[_0x5847ad(0x219)])[_0x5847ad(0x224)](_0x2fa515=>({'name':_0x2fa515[_0x5847ad(0x1f6)]||_0x2fa515[_0x5847ad(0x1ff)],'displayName':_0x2fa515[_0x5847ad(0x23d)]||_0x2fa515[_0x5847ad(0x1f6)],'type':_0x2fa515['type'],'method':_0x2fa515[_0x5847ad(0x25e)],'path':_0x2fa515[_0x5847ad(0x25b)],'enabled':_0x2fa515['enabled']??!![],'requestFields':_0x2fa515[_0x5847ad(0x234)],'responseFields':_0x2fa515[_0x5847ad(0x1fc)]}));return{'dataset':{'id':_0x3b01e4['id']??_0x3b01e4[_0x5847ad(0x268)],'name':_0x3b01e4[_0x5847ad(0x1f6)],'code':_0x3b01e4[_0x5847ad(0x24a)]||_0x3b01e4[_0x5847ad(0x239)],'tableName':_0x3b01e4[_0x5847ad(0x22f)]||_0x3b01e4[_0x5847ad(0x24e)]?.['tableName']},'operations':_0x34dc3d};}export async function getOperationDetail(_0x4cd7b2,_0x54364e,_0x4ee2e9){const _0x165afe=a93_0x39be;let _0x2751ca=_0x54364e;if(!/^\d+$/[_0x165afe(0x243)](_0x54364e)){const _0x5506c0=await listDatasets(_0x4cd7b2,{'code':_0x54364e}),_0x1caa7c=_0x5506c0[_0x165afe(0x214)](_0x1d2f31=>_0x1d2f31[_0x165afe(0x24a)]===_0x54364e||String(_0x1d2f31['id'])===_0x54364e);if(!_0x1caa7c)throw CliErrors[_0x165afe(0x231)](_0x165afe(0x264)+_0x54364e);_0x2751ca=String(_0x1caa7c['id']);}const _0x543085=await getDatasetDetail(_0x2751ca),_0x227dcf=normalizeDatasetOperations(_0x543085['operations'])[_0x165afe(0x214)](_0x19d21e=>(_0x19d21e[_0x165afe(0x1f6)]||_0x19d21e[_0x165afe(0x1ff)])===_0x4ee2e9);if(!_0x227dcf)throw CliErrors['validation'](_0x165afe(0x22a)+_0x4ee2e9+_0x165afe(0x21a)+_0x54364e);return{'dataset':{'id':_0x543085['id']??_0x543085[_0x165afe(0x268)],'name':_0x543085[_0x165afe(0x1f6)],'code':_0x543085[_0x165afe(0x24a)]||_0x543085[_0x165afe(0x239)],'tableName':_0x543085[_0x165afe(0x22f)]||_0x543085['dbtableConfig']?.[_0x165afe(0x22f)]},'operation':_0x227dcf};}export function generateSdkCode(_0x122dde,_0x28a205,_0x1c4401){const _0x56cf23=a93_0x39be,_0x3e85bb=_0x1c4401?.[_0x56cf23(0x23f)]??!![],_0x350e7c=_0x56cf23(0x24c)+_0x122dde[_0x56cf23(0x24a)]?.[_0x56cf23(0x227)](/-/g,'_'),_0x20bbba=_0x28a205['name']||_0x28a205[_0x56cf23(0x1ff)]||_0x56cf23(0x262),_0x1583e8=[];_0x3e85bb&&_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x24f),'',_0x56cf23(0x241),'');_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x1f7)+_0x122dde['name']+'\x20('+(_0x122dde[_0x56cf23(0x22f)]||_0x56cf23(0x237))+')');if(_0x20bbba==='filter')_0x1583e8[_0x56cf23(0x242)]('const\x20result\x20=\x20await\x20client.models.'+_0x350e7c+_0x56cf23(0x222),'\x20\x20where:\x20{},',_0x56cf23(0x23a),_0x56cf23(0x1f3),_0x56cf23(0x266));else{if(_0x20bbba==='getOne')_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x25a));else{if(_0x20bbba===_0x56cf23(0x21e))_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x254));else{if(_0x20bbba===_0x56cf23(0x23e))_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x203));else _0x20bbba===_0x56cf23(0x204)||_0x20bbba===_0x56cf23(0x25d)?_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x22d)):_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+'.'+_0x20bbba+'(/*\x20params\x20*/);');}}}return _0x1583e8['join']('\x0a');}export function generateSqlCodeTemplate(_0x26b236,_0x70db25){const _0x311041=a93_0x39be,_0x44cfe6=_0x70db25?.[_0x311041(0x1fe)]??_0x311041(0x251),_0x504892=_0x70db25?.[_0x311041(0x23f)]??!![],_0x2a195c=[];return _0x2a195c[_0x311041(0x242)]('//\x20SQL:\x20'+_0x26b236[_0x311041(0x230)]+'\x20('+_0x26b236[_0x311041(0x1f2)]+')'),_0x44cfe6==='sdk'?(_0x504892&&_0x2a195c[_0x311041(0x242)](_0x311041(0x24f),'',_0x311041(0x241),''),_0x2a195c[_0x311041(0x242)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x311041(0x217)+_0x26b236['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x311041(0x211))):_0x2a195c[_0x311041(0x242)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x311041(0x261),_0x311041(0x238)+_0x26b236[_0x311041(0x1f2)]+'\x27,',_0x311041(0x205),_0x311041(0x207),_0x311041(0x1f5),'}'),_0x2a195c[_0x311041(0x202)]('\x0a');}function a93_0x39be(_0x5a2128,_0x971bdf){_0x5a2128=_0x5a2128-0x1ef;const _0x156709=a93_0x1567();let _0x39be11=_0x156709[_0x5a2128];return _0x39be11;}function a93_0x1567(){const _0x4ef85a=['\x20failed,\x20HTTP\x20','916935WBdWjt','713570KlfMPW','responseFields','BFF\x20script\x20not\x20found:\x20id=','target','operationName','errorCode','345669HyPzZw','join','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','delete','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/app/getList','\x20\x20});','errorMsg','data','9GCvJUF','message','2166mXlFWX','add','/api/node-toolbox/sql/save','pageSize','body','const\x20results\x20=\x20data.execResult\x20||\x20[];','POST','json','find','label','errorMessage','\x20\x20sqlCode:\x20\x27','object','operations','\x22\x20not\x20found\x20in\x20dataset\x20','/api/management/library/scripts/save','/api/management/library/scripts/list?appCode=','currentPage','create','Request\x20timeout:\x20','/smartapi/dataset/get-driven-data?','3199OvRMiW','.filter({','/smartapi/dataset/get-dataset-list','map','success','Warning:\x20showing\x20first\x20','replace','includes','16wFLTKh','Operation\x20\x22','apiError','3506760oiJBFS','.remove(id);','functionName','tableName','sqlName','validation','tableData','warn','requestFields','isArray','92398EpoAxw','table','\x20\x20\x20\x20sqlCode:\x20\x27','modelCode','\x20\x20pageSize:\x2020,','UNAUTHORIZED','/smartapi/question/er-config','displayName','update','includeImports','Unauthorized','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','push','test','\x20failed','error','&type=','scriptName','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/api/management/library/scripts/statistics?appCode=','code','27452590TcucRg','dataset_','/api/management/library/scripts/delete','dbtableConfig','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','signal','sdk','authRequired','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','.create({\x20/*\x20fields\x20*/\x20});','const\x20result\x20=\x20await\x20client.models.','totalCount','401','SQL\x20query\x20not\x20found:\x20','description','.getOne(id);','path','/api/custom/executeSql','remove','method','/smartapi/custom/queryUserCustomSqlList','/api/management/library/scripts/info?id=','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','filter','\x20apps.\x20','Dataset\x20not\x20found:\x20','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','});','API\x20error\x20code:\x20','modelId','cookie','toLowerCase','status','sqlCode','\x20\x20currentPage:\x201,','stringify','\x20\x20return\x20rows;','name','//\x20','GET'];a93_0x1567=function(){return _0x4ef85a;};return a93_0x1567();}export async function getErConfig(_0x5a2c0a,_0x15766e){const _0x569e4b=a93_0x39be,_0x39c562=await apiRequest(_0x569e4b(0x23c),{'method':'POST','body':{'appCode':_0x5a2c0a,'dblinkId':_0x15766e}});return _0x39c562['data'];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x39602a=a93_0x39be,_0x118668=await apiRequest(_0x39602a(0x206),{'method':_0x39602a(0x212),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4fc17b=extractList(_0x118668[_0x39602a(0x209)]),_0x138997=extractPaging(_0x118668[_0x39602a(0x209)]);return _0x138997&&_0x138997['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x39602a(0x233)](_0x39602a(0x226)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x138997[_0x39602a(0x256)]+_0x39602a(0x263)+_0x39602a(0x265)),_0x4fc17b;}
@@ -1 +1 @@
1
- const a93_0x29975f=a93_0x2aca;(function(_0x2027e3,_0x2a0be3){const _0x2d5a5d=a93_0x2aca,_0x57e6e5=_0x2027e3();while(!![]){try{const _0x1953eb=parseInt(_0x2d5a5d(0x123))/0x1*(parseInt(_0x2d5a5d(0x11d))/0x2)+parseInt(_0x2d5a5d(0x11f))/0x3*(-parseInt(_0x2d5a5d(0x128))/0x4)+parseInt(_0x2d5a5d(0x12a))/0x5+parseInt(_0x2d5a5d(0x124))/0x6*(parseInt(_0x2d5a5d(0x125))/0x7)+-parseInt(_0x2d5a5d(0x11b))/0x8+parseInt(_0x2d5a5d(0x122))/0x9*(-parseInt(_0x2d5a5d(0x127))/0xa)+parseInt(_0x2d5a5d(0x11a))/0xb*(parseInt(_0x2d5a5d(0x126))/0xc);if(_0x1953eb===_0x2a0be3)break;else _0x57e6e5['push'](_0x57e6e5['shift']());}catch(_0x1ccf53){_0x57e6e5['push'](_0x57e6e5['shift']());}}}(a93_0x4646,0x8dfb4));import{resolve}from'node:path';const DOT_DIR=a93_0x29975f(0x121),LOCK_FILE_NAME=a93_0x29975f(0x11c),TRASH_DIR_NAME=a93_0x29975f(0x120);function a93_0x2aca(_0x5e8969,_0x32c83f){_0x5e8969=_0x5e8969-0x119;const _0x464688=a93_0x4646();let _0x2acaf1=_0x464688[_0x5e8969];return _0x2acaf1;}export function loadBffProjectConfig(_0x164a13,_0x5147b8){const _0x5867d7=a93_0x29975f,_0x2fce3f=resolve(_0x5147b8??process[_0x5867d7(0x119)]()),_0x879637=DOT_DIR+_0x5867d7(0x129),_0xa4b4e3=_0x879637+'/'+_0x164a13;return{'projectRoot':_0x2fce3f,'appCode':_0x164a13,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x879637,'scriptsRoot':_0xa4b4e3,'scriptsRootDir':resolve(_0x2fce3f,DOT_DIR,_0x5867d7(0x11e),_0x164a13),'lockFilePath':resolve(_0x2fce3f,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2fce3f,DOT_DIR,TRASH_DIR_NAME)};}function a93_0x4646(){const _0x47ada5=['2413100HjWwwN','cwd','1441OYfBkv','1187520KiDPHK','bff.lock.json','1793054KfjGpf','bff','3fOzUdC','bff-trash','.rabetbase','5354361QzUXkf','1uBYnXn','502134fFRKFp','35aTmErs','4440ymhdCv','10GGMHsC','2084548BTPkNV','/bff'];a93_0x4646=function(){return _0x47ada5;};return a93_0x4646();}
1
+ const a94_0x1a7318=a94_0x1d73;(function(_0x3f5383,_0x15ded3){const _0x229376=a94_0x1d73,_0x14363a=_0x3f5383();while(!![]){try{const _0x4a9f90=parseInt(_0x229376(0x1c7))/0x1*(-parseInt(_0x229376(0x1cc))/0x2)+-parseInt(_0x229376(0x1c6))/0x3*(-parseInt(_0x229376(0x1c8))/0x4)+parseInt(_0x229376(0x1d3))/0x5*(-parseInt(_0x229376(0x1ca))/0x6)+parseInt(_0x229376(0x1cb))/0x7*(-parseInt(_0x229376(0x1d1))/0x8)+-parseInt(_0x229376(0x1c9))/0x9+-parseInt(_0x229376(0x1d0))/0xa*(parseInt(_0x229376(0x1ce))/0xb)+parseInt(_0x229376(0x1cd))/0xc;if(_0x4a9f90===_0x15ded3)break;else _0x14363a['push'](_0x14363a['shift']());}catch(_0x4a4f07){_0x14363a['push'](_0x14363a['shift']());}}}(a94_0x19aa,0x9bc28));import{resolve}from'node:path';const DOT_DIR=a94_0x1a7318(0x1c5),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME='bff-trash';function a94_0x1d73(_0x4a1386,_0x4a45f9){_0x4a1386=_0x4a1386-0x1c5;const _0x19aabb=a94_0x19aa();let _0x1d73be=_0x19aabb[_0x4a1386];return _0x1d73be;}export function loadBffProjectConfig(_0xa8acb2,_0x14811e){const _0x5c8d24=a94_0x1a7318,_0x20f41a=resolve(_0x14811e??process[_0x5c8d24(0x1d2)]()),_0x2b6c9c=DOT_DIR+_0x5c8d24(0x1cf),_0x1b549e=_0x2b6c9c+'/'+_0xa8acb2;return{'projectRoot':_0x20f41a,'appCode':_0xa8acb2,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2b6c9c,'scriptsRoot':_0x1b549e,'scriptsRootDir':resolve(_0x20f41a,DOT_DIR,'bff',_0xa8acb2),'lockFilePath':resolve(_0x20f41a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x20f41a,DOT_DIR,TRASH_DIR_NAME)};}function a94_0x19aa(){const _0x1691b9=['12JmdzTA','6442578aEHKpp','84678PdgVLF','7kUwZmx','2478fwSSNp','34701072MFvEen','3553QNNSTo','/bff','37670mpmOBV','651368PoRKgQ','cwd','195UYsLRK','.rabetbase','567120yuJRkj','207kQTsMo'];a94_0x19aa=function(){return _0x1691b9;};return a94_0x19aa();}
@@ -1 +1 @@
1
- const a94_0x5ae06b=a94_0x55f7;(function(_0x24019b,_0x29cba9){const _0xdd3a11=a94_0x55f7,_0x1f67c3=_0x24019b();while(!![]){try{const _0xfc5eef=parseInt(_0xdd3a11(0x1b9))/0x1*(parseInt(_0xdd3a11(0x1bb))/0x2)+-parseInt(_0xdd3a11(0x1b1))/0x3+parseInt(_0xdd3a11(0x1af))/0x4*(parseInt(_0xdd3a11(0x1a7))/0x5)+-parseInt(_0xdd3a11(0x1b7))/0x6+-parseInt(_0xdd3a11(0x1c7))/0x7+parseInt(_0xdd3a11(0x1a1))/0x8*(parseInt(_0xdd3a11(0x1a2))/0x9)+-parseInt(_0xdd3a11(0x1b5))/0xa*(-parseInt(_0xdd3a11(0x1c6))/0xb);if(_0xfc5eef===_0x29cba9)break;else _0x1f67c3['push'](_0x1f67c3['shift']());}catch(_0x38cb61){_0x1f67c3['push'](_0x1f67c3['shift']());}}}(a94_0x2221,0x99e62));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';function a94_0x2221(){const _0x5ae7e1=['42324YkoJKE','scriptsRootDir','datasetCode','split','2030PuXfcY','operationType','628758cNmybl','name','5162Uqfwwf','.js','130mmlzeY','code','afterScriptId','HOOK','functionName','ENDPOINT','scriptType','set','toUpperCase','functionNode','isFile','19206gopBCk','6872425hlchXe','HOOK/','ENOENT','24AELIUr','621981wrnNzd','isDirectory','beforeScriptId','F_OK','replace','1389585EDSTah','COMMON','trim','all','includes','map','get','push','12Ebynzi','alias'];a94_0x2221=function(){return _0x5ae7e1;};return a94_0x2221();}function a94_0x55f7(_0x4f3ca8,_0x26c581){_0x4f3ca8=_0x4f3ca8-0x1a0;const _0x222103=a94_0x2221();let _0x55f7e8=_0x222103[_0x4f3ca8];return _0x55f7e8;}import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a94_0x5ae06b(0x1a8),a94_0x5ae06b(0x1c0),a94_0x5ae06b(0x1be)];export function normalizeBffType(_0xbaba2c){const _0x4aa364=a94_0x5ae06b;if(!_0xbaba2c)return undefined;const _0x225451=_0xbaba2c[_0x4aa364(0x1a9)]()[_0x4aa364(0x1c3)]();return SUPPORTED_BFF_TYPES[_0x4aa364(0x1ab)](_0x225451)?_0x225451:undefined;}async function scanJsFilesRecursively(_0x437266,_0x486137){const _0x5d444c=a94_0x5ae06b,_0x6f715a=[];try{const _0x32bfa9=await readdir(_0x437266,{'withFileTypes':!![]});for(const _0x47b85e of _0x32bfa9){const _0x3777d8=join(_0x437266,_0x47b85e[_0x5d444c(0x1b8)]);if(_0x47b85e[_0x5d444c(0x1a3)]())_0x6f715a[_0x5d444c(0x1ae)](...await scanJsFilesRecursively(_0x3777d8,_0x486137+'/'+_0x47b85e[_0x5d444c(0x1b8)]));else _0x47b85e['isFile']()&&_0x47b85e[_0x5d444c(0x1b8)]['endsWith'](_0x5d444c(0x1ba))&&_0x6f715a['push']({'lockKey':_0x486137+'/'+_0x47b85e[_0x5d444c(0x1b8)][_0x5d444c(0x1a6)](/\.js$/,''),'filePath':_0x3777d8});}}catch(_0x206f70){if(_0x206f70[_0x5d444c(0x1bc)]!==_0x5d444c(0x1a0))throw _0x206f70;}return _0x6f715a;}async function scanFlatFunctions(_0x5174e9,_0x5c7aa5){const _0x140f24=a94_0x5ae06b,_0x1c1e9a=join(_0x5174e9[_0x140f24(0x1b2)],_0x5c7aa5),_0x5485c9=await scanJsFilesRecursively(_0x1c1e9a,_0x5c7aa5);return _0x5485c9[_0x140f24(0x1ac)](({lockKey:_0x162db7,filePath:_0x11aa9b})=>({'type':_0x5c7aa5,'name':_0x162db7[_0x140f24(0x1b4)]('/')['at'](-0x1)??'','filePath':_0x11aa9b,'lockKey':_0x162db7}));}async function scanHookFunctions(_0xed621b){const _0x1988fd=a94_0x5ae06b,_0x1e0f7a=join(_0xed621b[_0x1988fd(0x1b2)],_0x1988fd(0x1be)),_0x401736=[];try{const _0x28eec0=await readdir(_0x1e0f7a,{'withFileTypes':!![]});for(const _0x33e735 of _0x28eec0){if(!_0x33e735[_0x1988fd(0x1a3)]())continue;const _0x4eb8cd=_0x33e735[_0x1988fd(0x1b8)],_0x464195=join(_0x1e0f7a,_0x4eb8cd),_0x1ca5ed=await readdir(_0x464195,{'withFileTypes':!![]});for(const _0x2b191a of _0x1ca5ed){if(!_0x2b191a[_0x1988fd(0x1a3)]())continue;const _0x129905=_0x2b191a[_0x1988fd(0x1b8)],_0x1cfe53=join(_0x464195,_0x129905),_0x7cc2d5=await readdir(_0x1cfe53,{'withFileTypes':!![]});for(const _0x3d958f of _0x7cc2d5){if(!_0x3d958f[_0x1988fd(0x1a3)]())continue;const _0x9078ba=_0x3d958f['name'],_0x1294a9=join(_0x1cfe53,_0x9078ba),_0xbd5474=await readdir(_0x1294a9,{'withFileTypes':!![]});for(const _0xb4d227 of _0xbd5474){if(!_0xb4d227[_0x1988fd(0x1c5)]()||!_0xb4d227[_0x1988fd(0x1b8)]['endsWith'](_0x1988fd(0x1ba)))continue;const _0x6b5ed=_0xb4d227[_0x1988fd(0x1b8)][_0x1988fd(0x1a6)](/\.js$/,'');_0x401736[_0x1988fd(0x1ae)]({'type':'HOOK','name':_0x6b5ed,'filePath':join(_0x1294a9,_0xb4d227[_0x1988fd(0x1b8)]),'lockKey':'HOOK/'+_0x4eb8cd+'/'+_0x129905+'/'+_0x9078ba+'/'+_0x6b5ed,'alias':_0x4eb8cd,'operationType':_0x129905,'functionNode':_0x9078ba});}}}}}catch(_0x247af1){if(_0x247af1['code']!==_0x1988fd(0x1a0))throw _0x247af1;}return _0x401736;}export async function scanLocalBffFunctions(_0x47972b,_0x597acf){const _0x1fb25f=a94_0x5ae06b;if(_0x597acf===_0x1fb25f(0x1a8)||_0x597acf===_0x1fb25f(0x1c0))return scanFlatFunctions(_0x47972b,_0x597acf);if(_0x597acf===_0x1fb25f(0x1be))return scanHookFunctions(_0x47972b);const [_0x3ea592,_0x3bbd71,_0x1fa5b2]=await Promise[_0x1fb25f(0x1aa)]([scanFlatFunctions(_0x47972b,_0x1fb25f(0x1a8)),scanFlatFunctions(_0x47972b,_0x1fb25f(0x1c0)),scanHookFunctions(_0x47972b)]);return[..._0x3ea592,..._0x3bbd71,..._0x1fa5b2];}export function resolveLocalFilePathFromLockKey(_0x145c7a,_0xfe8227){const _0x3233b4=a94_0x5ae06b;return join(_0x145c7a['scriptsRootDir'],..._0xfe8227[_0x3233b4(0x1b4)]('/'))+'.js';}export function createHookLocationMap(_0x2397d8){const _0x3f42e2=a94_0x5ae06b,_0x578675=new Map();for(const _0x3d0f8e of _0x2397d8){_0x3d0f8e[_0x3f42e2(0x1a4)]&&_0x578675[_0x3f42e2(0x1c2)](_0x3d0f8e[_0x3f42e2(0x1a4)],{'datasetCode':_0x3d0f8e['datasetCode'],'operationType':snakeToCamel(_0x3d0f8e[_0x3f42e2(0x1b6)]),'functionNode':'before'}),_0x3d0f8e[_0x3f42e2(0x1bd)]&&_0x578675[_0x3f42e2(0x1c2)](_0x3d0f8e[_0x3f42e2(0x1bd)],{'datasetCode':_0x3d0f8e[_0x3f42e2(0x1b3)],'operationType':snakeToCamel(_0x3d0f8e['operationType']),'functionNode':'after'});}return _0x578675;}export function resolveRemoteScriptTarget(_0x1b25ca,_0x196ea1,_0x8b6148,_0x4a3321,_0x4e4219){const _0xd36194=a94_0x5ae06b,_0x1b2489=normalizeBffType(_0x196ea1[_0xd36194(0x1c1)]);if(!_0x1b2489||!_0x196ea1[_0xd36194(0x1bf)])return null;if(_0x1b2489===_0xd36194(0x1be)){const _0x4875d4=(_0x196ea1['id']?_0x8b6148['get'](_0x196ea1['id']):undefined)??findHookLocationByRemoteId(_0x4a3321,_0x196ea1['id']);if(!_0x4875d4)return null;const _0x2fcf91=_0x4875d4[_0xd36194(0x1b0)]||_0x4e4219[_0xd36194(0x1ad)](_0x4875d4[_0xd36194(0x1b3)]),_0x8eacbd=_0x2fcf91??_0x4875d4[_0xd36194(0x1b3)],_0x3fe808={..._0x4875d4,'alias':_0x2fcf91},_0x26ad12=_0xd36194(0x1c8)+_0x8eacbd+'/'+_0x3fe808[_0xd36194(0x1b6)]+'/'+_0x3fe808[_0xd36194(0x1c4)]+'/'+_0x196ea1[_0xd36194(0x1bf)];return{'lockKey':_0x26ad12,'filePath':resolveLocalFilePathFromLockKey(_0x1b25ca,_0x26ad12),'type':_0xd36194(0x1be),'hookLocation':_0x3fe808};}const _0x5534d9=_0x1b2489+'/'+_0x196ea1[_0xd36194(0x1bf)];return{'lockKey':_0x5534d9,'filePath':resolveLocalFilePathFromLockKey(_0x1b25ca,_0x5534d9),'type':_0x1b2489};}export async function ensureParentDirectory(_0x340da7){await mkdir(dirname(_0x340da7),{'recursive':!![]});}export async function fileExists(_0x3c408f){const _0x4316f0=a94_0x5ae06b;try{return await access(_0x3c408f,constants[_0x4316f0(0x1a5)]),!![];}catch{return![];}}export async function directoryExists(_0x3f9c83){const _0x2ca2a7=a94_0x5ae06b;try{const _0x4a4356=await stat(_0x3f9c83);return _0x4a4356[_0x2ca2a7(0x1a3)]();}catch{return![];}}
1
+ const a95_0x1bdd27=a95_0x4171;(function(_0x5db462,_0x1b934f){const _0x1a33f0=a95_0x4171,_0x5aec2c=_0x5db462();while(!![]){try{const _0x455b77=parseInt(_0x1a33f0(0x1d5))/0x1*(-parseInt(_0x1a33f0(0x1c2))/0x2)+-parseInt(_0x1a33f0(0x1b5))/0x3*(parseInt(_0x1a33f0(0x1b2))/0x4)+-parseInt(_0x1a33f0(0x1bc))/0x5+-parseInt(_0x1a33f0(0x1d3))/0x6+-parseInt(_0x1a33f0(0x1c4))/0x7*(-parseInt(_0x1a33f0(0x1c9))/0x8)+parseInt(_0x1a33f0(0x1c7))/0x9*(parseInt(_0x1a33f0(0x1c5))/0xa)+parseInt(_0x1a33f0(0x1cf))/0xb;if(_0x455b77===_0x1b934f)break;else _0x5aec2c['push'](_0x5aec2c['shift']());}catch(_0xfc3245){_0x5aec2c['push'](_0x5aec2c['shift']());}}}(a95_0x2da3,0x8b455));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a95_0x1bdd27(0x1d1),'ENDPOINT',a95_0x1bdd27(0x1b0)];export function normalizeBffType(_0x12d491){const _0x1f5a39=a95_0x1bdd27;if(!_0x12d491)return undefined;const _0x34ebbd=_0x12d491[_0x1f5a39(0x1b8)]()[_0x1f5a39(0x1b1)]();return SUPPORTED_BFF_TYPES[_0x1f5a39(0x1c1)](_0x34ebbd)?_0x34ebbd:undefined;}async function scanJsFilesRecursively(_0xffe098,_0x3b1e74){const _0x4cd08d=a95_0x1bdd27,_0x3a1b47=[];try{const _0x51a872=await readdir(_0xffe098,{'withFileTypes':!![]});for(const _0x2d565e of _0x51a872){const _0x5d46a7=join(_0xffe098,_0x2d565e[_0x4cd08d(0x1b7)]);if(_0x2d565e[_0x4cd08d(0x1bd)]())_0x3a1b47['push'](...await scanJsFilesRecursively(_0x5d46a7,_0x3b1e74+'/'+_0x2d565e[_0x4cd08d(0x1b7)]));else _0x2d565e[_0x4cd08d(0x1c6)]()&&_0x2d565e[_0x4cd08d(0x1b7)]['endsWith'](_0x4cd08d(0x1d2))&&_0x3a1b47[_0x4cd08d(0x1bb)]({'lockKey':_0x3b1e74+'/'+_0x2d565e[_0x4cd08d(0x1b7)]['replace'](/\.js$/,''),'filePath':_0x5d46a7});}}catch(_0x2f3205){if(_0x2f3205[_0x4cd08d(0x1d0)]!=='ENOENT')throw _0x2f3205;}return _0x3a1b47;}async function scanFlatFunctions(_0x2673e0,_0x2908ac){const _0x1015d5=a95_0x1bdd27,_0xee23b0=join(_0x2673e0[_0x1015d5(0x1d4)],_0x2908ac),_0x324779=await scanJsFilesRecursively(_0xee23b0,_0x2908ac);return _0x324779[_0x1015d5(0x1ba)](({lockKey:_0x18b99c,filePath:_0x581ccc})=>({'type':_0x2908ac,'name':_0x18b99c[_0x1015d5(0x1b6)]('/')['at'](-0x1)??'','filePath':_0x581ccc,'lockKey':_0x18b99c}));}async function scanHookFunctions(_0x668737){const _0x42c211=a95_0x1bdd27,_0x28f450=join(_0x668737[_0x42c211(0x1d4)],_0x42c211(0x1b0)),_0x8705dc=[];try{const _0x469717=await readdir(_0x28f450,{'withFileTypes':!![]});for(const _0xa371a2 of _0x469717){if(!_0xa371a2[_0x42c211(0x1bd)]())continue;const _0x2c8c9f=_0xa371a2[_0x42c211(0x1b7)],_0x3199f1=join(_0x28f450,_0x2c8c9f),_0x40e8ea=await readdir(_0x3199f1,{'withFileTypes':!![]});for(const _0x1dca6a of _0x40e8ea){if(!_0x1dca6a[_0x42c211(0x1bd)]())continue;const _0x46ada4=_0x1dca6a[_0x42c211(0x1b7)],_0x379349=join(_0x3199f1,_0x46ada4),_0x1dbd79=await readdir(_0x379349,{'withFileTypes':!![]});for(const _0x37371c of _0x1dbd79){if(!_0x37371c[_0x42c211(0x1bd)]())continue;const _0xd4d614=_0x37371c[_0x42c211(0x1b7)],_0xfe7e96=join(_0x379349,_0xd4d614),_0x2acc79=await readdir(_0xfe7e96,{'withFileTypes':!![]});for(const _0xd67583 of _0x2acc79){if(!_0xd67583['isFile']()||!_0xd67583['name'][_0x42c211(0x1d6)]('.js'))continue;const _0x29c3e7=_0xd67583['name'][_0x42c211(0x1ca)](/\.js$/,'');_0x8705dc['push']({'type':_0x42c211(0x1b0),'name':_0x29c3e7,'filePath':join(_0xfe7e96,_0xd67583[_0x42c211(0x1b7)]),'lockKey':_0x42c211(0x1c0)+_0x2c8c9f+'/'+_0x46ada4+'/'+_0xd4d614+'/'+_0x29c3e7,'alias':_0x2c8c9f,'operationType':_0x46ada4,'functionNode':_0xd4d614});}}}}}catch(_0x232d18){if(_0x232d18[_0x42c211(0x1d0)]!=='ENOENT')throw _0x232d18;}return _0x8705dc;}export async function scanLocalBffFunctions(_0x8034c5,_0x12d32a){const _0xe7ab10=a95_0x1bdd27;if(_0x12d32a===_0xe7ab10(0x1d1)||_0x12d32a===_0xe7ab10(0x1d7))return scanFlatFunctions(_0x8034c5,_0x12d32a);if(_0x12d32a===_0xe7ab10(0x1b0))return scanHookFunctions(_0x8034c5);const [_0x16382a,_0x49d091,_0x29f751]=await Promise[_0xe7ab10(0x1c3)]([scanFlatFunctions(_0x8034c5,_0xe7ab10(0x1d1)),scanFlatFunctions(_0x8034c5,_0xe7ab10(0x1d7)),scanHookFunctions(_0x8034c5)]);return[..._0x16382a,..._0x49d091,..._0x29f751];}export function resolveLocalFilePathFromLockKey(_0x53d92d,_0x22b875){const _0x283423=a95_0x1bdd27;return join(_0x53d92d[_0x283423(0x1d4)],..._0x22b875[_0x283423(0x1b6)]('/'))+_0x283423(0x1d2);}export function createHookLocationMap(_0x187f22){const _0x1bfa43=a95_0x1bdd27,_0x2fac52=new Map();for(const _0xc29d39 of _0x187f22){_0xc29d39[_0x1bfa43(0x1ce)]&&_0x2fac52[_0x1bfa43(0x1be)](_0xc29d39[_0x1bfa43(0x1ce)],{'datasetCode':_0xc29d39[_0x1bfa43(0x1cc)],'operationType':snakeToCamel(_0xc29d39['operationType']),'functionNode':_0x1bfa43(0x1cb)}),_0xc29d39['afterScriptId']&&_0x2fac52[_0x1bfa43(0x1be)](_0xc29d39['afterScriptId'],{'datasetCode':_0xc29d39[_0x1bfa43(0x1cc)],'operationType':snakeToCamel(_0xc29d39[_0x1bfa43(0x1b3)]),'functionNode':_0x1bfa43(0x1bf)});}return _0x2fac52;}function a95_0x4171(_0x598ed9,_0x4558c7){_0x598ed9=_0x598ed9-0x1b0;const _0x2da3bb=a95_0x2da3();let _0x4171f1=_0x2da3bb[_0x598ed9];return _0x4171f1;}export function resolveRemoteScriptTarget(_0x853bd3,_0x4c696a,_0x11378a,_0x5aa07f,_0x872a43){const _0x2fd841=a95_0x1bdd27,_0xc85e4d=normalizeBffType(_0x4c696a['scriptType']);if(!_0xc85e4d||!_0x4c696a[_0x2fd841(0x1cd)])return null;if(_0xc85e4d===_0x2fd841(0x1b0)){const _0x4e8d43=(_0x4c696a['id']?_0x11378a[_0x2fd841(0x1b4)](_0x4c696a['id']):undefined)??findHookLocationByRemoteId(_0x5aa07f,_0x4c696a['id']);if(!_0x4e8d43)return null;const _0x5b6f27=_0x4e8d43['alias']||_0x872a43[_0x2fd841(0x1b4)](_0x4e8d43[_0x2fd841(0x1cc)]),_0x4ef619=_0x5b6f27??_0x4e8d43['datasetCode'],_0x764f11={..._0x4e8d43,'alias':_0x5b6f27},_0x113ef2=_0x2fd841(0x1c0)+_0x4ef619+'/'+_0x764f11['operationType']+'/'+_0x764f11[_0x2fd841(0x1c8)]+'/'+_0x4c696a[_0x2fd841(0x1cd)];return{'lockKey':_0x113ef2,'filePath':resolveLocalFilePathFromLockKey(_0x853bd3,_0x113ef2),'type':_0x2fd841(0x1b0),'hookLocation':_0x764f11};}const _0x5182e9=_0xc85e4d+'/'+_0x4c696a['functionName'];return{'lockKey':_0x5182e9,'filePath':resolveLocalFilePathFromLockKey(_0x853bd3,_0x5182e9),'type':_0xc85e4d};}function a95_0x2da3(){const _0x24f37f=['HOOK/','includes','158gXxEck','all','1165227rrtzCa','796730aLgGRZ','isFile','117rxUQMl','functionNode','24mjgbja','replace','before','datasetCode','functionName','beforeScriptId','14838846hoGNvJ','code','COMMON','.js','6152892IBUuOH','scriptsRootDir','1293bajmZF','endsWith','ENDPOINT','HOOK','toUpperCase','2235476dpsXly','operationType','get','3eZdcTd','split','name','trim','F_OK','map','push','3135835GcwWzd','isDirectory','set','after'];a95_0x2da3=function(){return _0x24f37f;};return a95_0x2da3();}export async function ensureParentDirectory(_0xa82b29){await mkdir(dirname(_0xa82b29),{'recursive':!![]});}export async function fileExists(_0x1dc467){const _0x85c6ae=a95_0x1bdd27;try{return await access(_0x1dc467,constants[_0x85c6ae(0x1b9)]),!![];}catch{return![];}}export async function directoryExists(_0x335a0d){try{const _0x157fa3=await stat(_0x335a0d);return _0x157fa3['isDirectory']();}catch{return![];}}