@lovrabet/rabetbase-cli 2.0.12 → 2.1.1-beta.0

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 (155) hide show
  1. package/README.md +2 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/doc.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -0
  53. package/lib/commands/db/analyze-start.js +1 -0
  54. package/lib/commands/db/analyze-status.js +1 -0
  55. package/lib/commands/db/create.js +1 -0
  56. package/lib/commands/db/delete.js +1 -0
  57. package/lib/commands/db/detail.js +1 -0
  58. package/lib/commands/db/diff.js +1 -0
  59. package/lib/commands/db/index.js +1 -0
  60. package/lib/commands/db/list.js +1 -0
  61. package/lib/commands/db/shared.js +1 -0
  62. package/lib/commands/db/tables.js +1 -0
  63. package/lib/commands/db/test.js +1 -0
  64. package/lib/commands/db/update.js +1 -0
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -0
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -0
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/constant/cli.js +1 -1
  104. package/lib/constant/domain.js +1 -1
  105. package/lib/constant/env.js +1 -1
  106. package/lib/constant/paths.js +1 -1
  107. package/lib/context.js +1 -1
  108. package/lib/core/alias-resolver.js +1 -1
  109. package/lib/core/api-client.js +1 -1
  110. package/lib/core/bff/config.js +1 -1
  111. package/lib/core/bff/file-system.js +1 -1
  112. package/lib/core/bff/hash.js +1 -1
  113. package/lib/core/bff/lock.js +1 -1
  114. package/lib/core/bff/utils.js +1 -1
  115. package/lib/core/db-resolver.js +1 -1
  116. package/lib/core/sql-validator.js +1 -1
  117. package/lib/errors.js +1 -1
  118. package/lib/framework/build-all-flags.js +1 -1
  119. package/lib/framework/flags.js +1 -1
  120. package/lib/framework/help.js +1 -1
  121. package/lib/framework/index.js +1 -1
  122. package/lib/framework/output.js +1 -1
  123. package/lib/framework/response.js +1 -1
  124. package/lib/framework/runner.js +1 -1
  125. package/lib/framework/schema-export.js +1 -1
  126. package/lib/framework/types.js +1 -1
  127. package/lib/generated/build-info.js +1 -1
  128. package/lib/help.js +1 -1
  129. package/lib/skills/main.js +1 -1
  130. package/lib/skills/npx-skills-add.js +1 -1
  131. package/lib/telemetry/cli-command-trace.js +1 -1
  132. package/lib/telemetry/cli-help-trace.js +1 -1
  133. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  134. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  135. package/lib/telemetry/send-cli-trace-log.js +1 -1
  136. package/lib/utils/ai_config.js +1 -1
  137. package/lib/utils/apply-jq-filter.js +1 -1
  138. package/lib/utils/cdn-config.js +1 -1
  139. package/lib/utils/check-sdk-version.js +1 -1
  140. package/lib/utils/cli-version-check.js +1 -1
  141. package/lib/utils/config.js +1 -1
  142. package/lib/utils/copy-directory.js +1 -1
  143. package/lib/utils/file-utils.js +1 -1
  144. package/lib/utils/guides-cdn.js +1 -1
  145. package/lib/utils/http-client.js +1 -1
  146. package/lib/utils/is-non-interactive.js +1 -1
  147. package/lib/utils/logger.js +1 -1
  148. package/lib/utils/platform.js +1 -1
  149. package/lib/utils/rules-cdn.js +1 -1
  150. package/lib/utils/sleep.js +1 -1
  151. package/lib/utils/template-replacer.js +1 -1
  152. package/lib/utils/version.js +1 -1
  153. package/lib/utils/with-active-cookie.js +1 -1
  154. package/lib/utils/write-cli-side-channel.js +1 -0
  155. package/package.json +1 -1
@@ -1 +1 @@
1
- const a88_0x67da57=a88_0x17b7;(function(_0x4f97a6,_0x156868){const _0x3fd175=a88_0x17b7,_0x4beb41=_0x4f97a6();while(!![]){try{const _0x3958bc=-parseInt(_0x3fd175(0x1ef))/0x1*(-parseInt(_0x3fd175(0x1e2))/0x2)+parseInt(_0x3fd175(0x1e8))/0x3*(parseInt(_0x3fd175(0x1ea))/0x4)+-parseInt(_0x3fd175(0x1ee))/0x5+-parseInt(_0x3fd175(0x1e7))/0x6+parseInt(_0x3fd175(0x1f0))/0x7*(-parseInt(_0x3fd175(0x1e1))/0x8)+parseInt(_0x3fd175(0x1f3))/0x9+parseInt(_0x3fd175(0x1e6))/0xa*(parseInt(_0x3fd175(0x1e4))/0xb);if(_0x3958bc===_0x156868)break;else _0x4beb41['push'](_0x4beb41['shift']());}catch(_0x503a49){_0x4beb41['push'](_0x4beb41['shift']());}}}(a88_0x31b4,0x46eb5));function a88_0x31b4(){const _0x259192=['https://daily-api.lovrabet.com','18330XDDezS','3272802hlFzpv','3QCDzRm','https://api.lovrabet.com','288712BbSkxQ','apiDomain','https://runtime.lovrabet.com','https://daily-runtime.lovrabet.com','96595Wbhpql','13mPIout','434RSlINJ','production','runtimeDomain','2205576sLzwiB','11192PToQyy','44794nfffyo','https://user-daily.lovrabet.com','2002kGjCjs'];a88_0x31b4=function(){return _0x259192;};return a88_0x31b4();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x157198){const _0x251c2a=a88_0x17b7;customApiDomain=_0x157198?.[_0x251c2a(0x1eb)],customUserDomain=_0x157198?.['userDomain'],customRuntimeDomain=_0x157198?.[_0x251c2a(0x1f2)];}function a88_0x17b7(_0x310261,_0x50d926){_0x310261=_0x310261-0x1e1;const _0x31b492=a88_0x31b4();let _0x17b7bd=_0x31b492[_0x310261];return _0x17b7bd;}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x67da57(0x1f1)?'https://user.lovrabet.com':a88_0x67da57(0x1e3));export const getApiDomain=()=>customApiDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1e9):a88_0x67da57(0x1e5));export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1ec):a88_0x67da57(0x1ed));
1
+ function a103_0x4f5d(){const _0x7a833a=['2427805kLpnwq','8bZiPnY','https://daily-runtime.lovrabet.com','7659281VNIHTI','2rsSISz','2893GHQEeD','6684576hXJLkb','https://daily-api.lovrabet.com','userDomain','https://user.lovrabet.com','6NCJQIp','https://user-daily.lovrabet.com','63620LhsHTP','1051200jhUbDw','https://api.lovrabet.com','10431000rKyEyn','948254MTPJUb'];a103_0x4f5d=function(){return _0x7a833a;};return a103_0x4f5d();}const a103_0x14ae0c=a103_0x42b0;(function(_0x562264,_0x537fcb){const _0x332125=a103_0x42b0,_0x21e44e=_0x562264();while(!![]){try{const _0x1b44ec=parseInt(_0x332125(0xee))/0x1*(parseInt(_0x332125(0xf3))/0x2)+parseInt(_0x332125(0xeb))/0x3*(-parseInt(_0x332125(0xf0))/0x4)+-parseInt(_0x332125(0xef))/0x5+-parseInt(_0x332125(0xe8))/0x6*(parseInt(_0x332125(0xf2))/0x7)+-parseInt(_0x332125(0xf5))/0x8+parseInt(_0x332125(0xed))/0x9+-parseInt(_0x332125(0xea))/0xa*(-parseInt(_0x332125(0xf4))/0xb);if(_0x1b44ec===_0x537fcb)break;else _0x21e44e['push'](_0x21e44e['shift']());}catch(_0x5df476){_0x21e44e['push'](_0x21e44e['shift']());}}}(a103_0x4f5d,0xa2318));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2d2385){const _0x17f858=a103_0x42b0;customApiDomain=_0x2d2385?.['apiDomain'],customUserDomain=_0x2d2385?.[_0x17f858(0xf7)],customRuntimeDomain=_0x2d2385?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a103_0x14ae0c(0xe7):a103_0x14ae0c(0xe9));function a103_0x42b0(_0x45d8e5,_0x5752a6){_0x45d8e5=_0x45d8e5-0xe7;const _0x4f5d6a=a103_0x4f5d();let _0x42b079=_0x4f5d6a[_0x45d8e5];return _0x42b079;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a103_0x14ae0c(0xec):a103_0x14ae0c(0xf6));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a103_0x14ae0c(0xf1));
@@ -1 +1 @@
1
- const a89_0x4e6af8=a89_0x12fe;(function(_0xc8e41f,_0x3d56d7){const _0x446730=a89_0x12fe,_0x127c95=_0xc8e41f();while(!![]){try{const _0x11a027=-parseInt(_0x446730(0x1f4))/0x1+parseInt(_0x446730(0x1f1))/0x2*(-parseInt(_0x446730(0x1f8))/0x3)+parseInt(_0x446730(0x1f9))/0x4+parseInt(_0x446730(0x1f0))/0x5+parseInt(_0x446730(0x1fa))/0x6+parseInt(_0x446730(0x1f3))/0x7*(parseInt(_0x446730(0x1f2))/0x8)+-parseInt(_0x446730(0x1ef))/0x9*(parseInt(_0x446730(0x1f5))/0xa);if(_0x11a027===_0x3d56d7)break;else _0x127c95['push'](_0x127c95['shift']());}catch(_0x176133){_0x127c95['push'](_0x127c95['shift']());}}}(a89_0x4b28,0x3fa41));export function normalizeEnv(_0x3d1836){const _0xbf5d27=a89_0x12fe;return _0x3d1836===_0xbf5d27(0x1f6)?_0xbf5d27(0x1f7):_0x3d1836;}function a89_0x4b28(){const _0x4043f7=['1430664fyWxla','14IuiYxB','25124zZbVZA','1149460yMfrdu','online','production','48ZTJeJR','658812DqvyeT','2423010SZyBIL','63UsCMRA','1587635zrKXyb','19164xZkwFS'];a89_0x4b28=function(){return _0x4043f7;};return a89_0x4b28();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x4e6af8(0x1f7));function a89_0x12fe(_0x5e163c,_0x494688){_0x5e163c=_0x5e163c-0x1ef;const _0x4b2848=a89_0x4b28();let _0x12fec4=_0x4b2848[_0x5e163c];return _0x12fec4;}export function getEnv(){return env;}export function initEnv(_0x5e9c71){env=normalizeEnv(_0x5e9c71);}
1
+ function a104_0x548b(_0x37bcab,_0x286b55){_0x37bcab=_0x37bcab-0x14e;const _0x2b80b7=a104_0x2b80();let _0x548bc3=_0x2b80b7[_0x37bcab];return _0x548bc3;}const a104_0x17d00a=a104_0x548b;(function(_0x22f742,_0x295441){const _0x760b73=a104_0x548b,_0xccf654=_0x22f742();while(!![]){try{const _0x4b8dd2=-parseInt(_0x760b73(0x155))/0x1*(-parseInt(_0x760b73(0x14f))/0x2)+-parseInt(_0x760b73(0x158))/0x3*(parseInt(_0x760b73(0x154))/0x4)+-parseInt(_0x760b73(0x15c))/0x5+-parseInt(_0x760b73(0x157))/0x6*(-parseInt(_0x760b73(0x156))/0x7)+parseInt(_0x760b73(0x152))/0x8+-parseInt(_0x760b73(0x159))/0x9+parseInt(_0x760b73(0x14e))/0xa;if(_0x4b8dd2===_0x295441)break;else _0xccf654['push'](_0xccf654['shift']());}catch(_0x18b4c9){_0xccf654['push'](_0xccf654['shift']());}}}(a104_0x2b80,0xc623d));export function normalizeEnv(_0x5cd3e1){const _0x3c7577=a104_0x548b;return _0x5cd3e1===_0x3c7577(0x153)?_0x3c7577(0x15a):_0x5cd3e1;}export function isProduction(_0x5a371a){const _0x2bf22d=a104_0x548b;return normalizeEnv(_0x5a371a)===_0x2bf22d(0x15a);}export function isDaily(_0x192f14){const _0x1da93d=a104_0x548b;return normalizeEnv(_0x192f14)===_0x1da93d(0x150);}export function isDev(_0x42079b){const _0x58f3df=a104_0x548b,_0x1f10df=normalizeEnv(_0x42079b);return _0x1f10df===_0x58f3df(0x151)||_0x1f10df===_0x58f3df(0x15b);}function a104_0x2b80(){const _0x393004=['2811472FzguJf','online','4jKOpuv','31643DPQFII','28GFIjnt','661116HUeqJU','3328734QuiGTG','11920347AaxOOo','production','dev','946095GJPztF','12820340FYeppm','86hRZOdw','daily','development'];a104_0x2b80=function(){return _0x393004;};return a104_0x2b80();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a104_0x17d00a(0x15a));export function getEnv(){return env;}export function initEnv(_0x255b15){env=normalizeEnv(_0x255b15);}
@@ -1 +1 @@
1
- const a90_0x558a7d=a90_0x3a40;(function(_0x25a378,_0x15cc68){const _0x2584e0=a90_0x3a40,_0x1fa9f7=_0x25a378();while(!![]){try{const _0x4afb4e=-parseInt(_0x2584e0(0x110))/0x1*(parseInt(_0x2584e0(0x10d))/0x2)+-parseInt(_0x2584e0(0x10e))/0x3+-parseInt(_0x2584e0(0x10f))/0x4*(parseInt(_0x2584e0(0x113))/0x5)+parseInt(_0x2584e0(0x112))/0x6+-parseInt(_0x2584e0(0x10a))/0x7+parseInt(_0x2584e0(0x10c))/0x8+parseInt(_0x2584e0(0x111))/0x9;if(_0x4afb4e===_0x15cc68)break;else _0x1fa9f7['push'](_0x1fa9f7['shift']());}catch(_0x164b04){_0x1fa9f7['push'](_0x1fa9f7['shift']());}}}(a90_0x54e4,0x618aa));function a90_0x3a40(_0x2e009e,_0x4e0a63){_0x2e009e=_0x2e009e-0x10a;const _0x54e424=a90_0x54e4();let _0x3a40c1=_0x54e424[_0x2e009e];return _0x3a40c1;}function a90_0x54e4(){const _0x2f55e8=['2165889eJaJYA','16BTZhSh','28yporNm','13374477cBQEjc','2172066idXEUj','328835mtIxKT','3864560GIGBfO','./src/api','4901672cgIYCs','37438jyvaYp'];a90_0x54e4=function(){return _0x2f55e8;};return a90_0x54e4();}export const DEFAULT_API_DIR=a90_0x558a7d(0x10b);
1
+ const a105_0x31794b=a105_0x22af;(function(_0x1d1aa7,_0x2b1d4e){const _0x463eb3=a105_0x22af,_0x338891=_0x1d1aa7();while(!![]){try{const _0x25644a=-parseInt(_0x463eb3(0xa4))/0x1*(parseInt(_0x463eb3(0xab))/0x2)+-parseInt(_0x463eb3(0xa9))/0x3*(parseInt(_0x463eb3(0xa8))/0x4)+parseInt(_0x463eb3(0xa7))/0x5+parseInt(_0x463eb3(0xac))/0x6*(-parseInt(_0x463eb3(0xae))/0x7)+parseInt(_0x463eb3(0xaa))/0x8+parseInt(_0x463eb3(0xb0))/0x9*(parseInt(_0x463eb3(0xaf))/0xa)+-parseInt(_0x463eb3(0xa5))/0xb*(-parseInt(_0x463eb3(0xad))/0xc);if(_0x25644a===_0x2b1d4e)break;else _0x338891['push'](_0x338891['shift']());}catch(_0x579814){_0x338891['push'](_0x338891['shift']());}}}(a105_0x3ccb,0xe2a5c));function a105_0x22af(_0x45d11d,_0x35c7fc){_0x45d11d=_0x45d11d-0xa4;const _0x3ccb26=a105_0x3ccb();let _0x22afc5=_0x3ccb26[_0x45d11d];return _0x22afc5;}export const DEFAULT_API_DIR=a105_0x31794b(0xa6);function a105_0x3ccb(){const _0x4238e1=['1936DGHQHt','./src/api','6521785ugpLpl','4kuMrtV','1169667LFKtrG','2943032EGAnct','31718PrHvaa','100692GQcKED','167244syGFtt','763MAkshl','30WHVnON','2205297oqeGxl','108xfclmh'];a105_0x3ccb=function(){return _0x4238e1;};return a105_0x3ccb();}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a91_0x29b968=a91_0x4b98;(function(_0x2c8317,_0x23af63){const _0x54c875=a91_0x4b98,_0x362be2=_0x2c8317();while(!![]){try{const _0x301e41=parseInt(_0x54c875(0x1b6))/0x1+-parseInt(_0x54c875(0x1de))/0x2+-parseInt(_0x54c875(0x1bf))/0x3+-parseInt(_0x54c875(0x1df))/0x4+-parseInt(_0x54c875(0x1d6))/0x5+parseInt(_0x54c875(0x1cc))/0x6*(parseInt(_0x54c875(0x1db))/0x7)+parseInt(_0x54c875(0x19b))/0x8;if(_0x301e41===_0x23af63)break;else _0x362be2['push'](_0x362be2['shift']());}catch(_0x308a76){_0x362be2['push'](_0x362be2['shift']());}}}(a91_0x4c80,0x9375a));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';function a91_0x4c80(){const _0x1196b6=['.lovrabet.json','defaultApp','userDomain','\x0a\x20\x20','APPCODE','find','argv','api.ts','filter','inherit','true','high-risk-write','./constant/env.js','334169cIhGOl','read','COOKIE','APP','error','online','apiDir','empty','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','1485648cHKjIz','./constant/domain.js','missing','ENV','.rabetbase.json','locale','entries','keys','slice','apps','./utils/is-non-interactive.js','silent','message','1776rCkEeU','object','runtimeDomain','pageSize','utf8','join','cookie','daily','format','production','1983915dHKLPn','maxRisk','authRequired','write','stringify','6475DYjzUj','Global','riskLevel','1570200LJodDe','3323712oRXRJk','./auth/get-cookie.js','.lovrabetrc','-api.ts','setRawCommand','RISK_LEVEL','cwd','length','project','20032416RRWrPd','trim','ACCESS_KEY','MAX_RISK','parse','env','VERBOSE','accessKey','string','en-US','warn','PAGE_SIZE','status','appcode'];a91_0x4c80=function(){return _0x1196b6;};return a91_0x4c80();}import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0xb51c68){return process.env[`RABETBASE_${_0xb51c68}`]||process.env[`LOVRABET_${_0xb51c68}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x29b968(0x1c3);export const CONFIG_NAMES=[a91_0x29b968(0x1c3),a91_0x29b968(0x1a9),a91_0x29b968(0x1e1)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x29b968(0x1b1)](_0x595d11=>_0x595d11!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x548707){for(const _0x1e0707 of CONFIG_NAMES){const _0xffc86d=resolve(_0x548707,_0x1e0707);if(existsSync(_0xffc86d))return _0xffc86d;}return undefined;}export async function createContext(_0x165fc5){const _0x3c9976=a91_0x29b968,_0x5cbcc8=readRawConfig(),_0x39a319=buildConfig(_0x5cbcc8,_0x165fc5),{initEnv:_0x2e671c}=await import(_0x3c9976(0x1b5));if(_0x39a319['env'])_0x2e671c(_0x39a319[_0x3c9976(0x1a0)]);else _0x165fc5[_0x3c9976(0x1a0)]&&typeof _0x165fc5[_0x3c9976(0x1a0)]===_0x3c9976(0x1a3)&&_0x2e671c(_0x165fc5[_0x3c9976(0x1a0)]);const {initDomains:_0x5bddf2,getUserDomain:_0x16b163,getApiDomain:_0x4336ef}=await import(_0x3c9976(0x1c0));_0x5bddf2({'apiDomain':_0x5cbcc8['apiDomain']||undefined,'userDomain':_0x5cbcc8[_0x3c9976(0x1ab)]||undefined,'runtimeDomain':_0x5cbcc8[_0x3c9976(0x1ce)]||undefined});const _0x5a1a37={'apiDomain':_0x4336ef(),'userDomain':_0x16b163()},_0x434056=await buildAuth(_0x39a319);logger['setLogPath'](process[_0x3c9976(0x198)]());const _0x7f0754=(CLI_BIN_NAME+'\x20'+process[_0x3c9976(0x1af)][_0x3c9976(0x1c7)](0x2)[_0x3c9976(0x1d1)]('\x20'))[_0x3c9976(0x19c)]();logger[_0x3c9976(0x196)](_0x7f0754);const {isNonInteractive:_0x31d56b}=await import(_0x3c9976(0x1c9)),_0x182904=_0x31d56b(_0x165fc5);return{'config':_0x39a319,'auth':_0x434056,'logger':logger,'env':_0x5a1a37,'nonInteractive':_0x182904};}export function buildConfigFromFlags(_0x29a6b7){return buildConfig(readRawConfig(),_0x29a6b7);}export function getProjectConfigPath(){const _0x3e430b=a91_0x29b968;return resolveConfigPath(process[_0x3e430b(0x198)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4fb63d){const _0xfb5bce=a91_0x29b968;if(!existsSync(_0x4fb63d))return{'status':'missing'};try{const _0xbd76a8=readFileSync(_0x4fb63d,{'encoding':'utf8'});if(!_0xbd76a8?.[_0xfb5bce(0x19c)]())return{'status':_0xfb5bce(0x1bd)};const _0x54a63a=JSON[_0xfb5bce(0x19f)](_0xbd76a8);return{'status':'ok','data':_0x54a63a};}catch(_0x1be69e){return{'status':_0xfb5bce(0x1ba),'message':_0x1be69e instanceof Error?_0x1be69e[_0xfb5bce(0x1cb)]:String(_0x1be69e)};}}function parseCliConfigJsonFile(_0x5c5b06,_0x1207a2,_0x4b50d6){const _0x28a6ad=a91_0x29b968,_0x128d9b=inspectCliConfigJsonFile(_0x5c5b06);if(_0x128d9b['status']===_0x28a6ad(0x1c1)||_0x128d9b[_0x28a6ad(0x1a7)]===_0x28a6ad(0x1bd))return{};if(_0x128d9b[_0x28a6ad(0x1a7)]==='ok')return _0x128d9b['data'];return _0x1207a2===_0x28a6ad(0x1a5)&&_0x4b50d6&&console[_0x28a6ad(0x1ba)](CLI_BIN_NAME+':\x20'+_0x4b50d6+_0x28a6ad(0x1be)+_0x5c5b06+_0x28a6ad(0x1ac)+_0x128d9b['message']),{};}function a91_0x4b98(_0xdeb1c2,_0x5595f0){_0xdeb1c2=_0xdeb1c2-0x196;const _0x4c80be=a91_0x4c80();let _0x4b989b=_0x4c80be[_0xdeb1c2];return _0x4b989b;}export function loadRawConfigLayers(_0x23a424){const _0x19e673=a91_0x29b968;let _0xe7de52={},_0x45e965={};const _0x3f9457=resolveConfigPath(homedir());_0x3f9457&&(_0xe7de52=parseCliConfigJsonFile(_0x3f9457,_0x19e673(0x1a5),_0x19e673(0x1dc)));const _0x474dfd=_0x23a424||process[_0x19e673(0x198)](),_0x370df4=resolveConfigPath(_0x474dfd);return _0x370df4&&(_0x45e965=parseCliConfigJsonFile(_0x370df4,'warn','Project')),{'globalPath':_0x3f9457,'projectPath':_0x370df4,'globalConfig':_0xe7de52,'projectConfig':_0x45e965};}function mergeRawConfigLayers(_0x212792){const _0x39e50f=a91_0x29b968,{globalConfig:_0x5eff93,projectConfig:_0x2e0f6c}=_0x212792;if(_0x2e0f6c[_0x39e50f(0x1b2)]===![]){const _0x579bc6={..._0x2e0f6c};delete _0x579bc6[_0x39e50f(0x1b2)];const _0x205ad8=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x2e0f6c[_0x39e50f(0x1c8)]:{};Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0?_0x579bc6[_0x39e50f(0x1c8)]=_0x205ad8:delete _0x579bc6[_0x39e50f(0x1c8)];if(_0x39e50f(0x1aa)in _0x2e0f6c)_0x579bc6['defaultApp']=_0x2e0f6c[_0x39e50f(0x1aa)];else Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0&&(_0x579bc6['defaultApp']=Object[_0x39e50f(0x1c6)](_0x205ad8)[0x0]);return _0x579bc6;}const _0x1950ea=_0x5eff93[_0x39e50f(0x1c8)]&&typeof _0x5eff93[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x5eff93['apps']:{},_0x386958=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]==='object'?_0x2e0f6c[_0x39e50f(0x1c8)]:{},_0x124b1a={..._0x1950ea,..._0x386958},_0x38892d={..._0x5eff93,..._0x2e0f6c};Object[_0x39e50f(0x1c6)](_0x124b1a)[_0x39e50f(0x199)]>0x0&&(_0x38892d['apps']=_0x124b1a);if('defaultApp'in _0x2e0f6c)_0x38892d[_0x39e50f(0x1aa)]=_0x2e0f6c[_0x39e50f(0x1aa)];else{if(_0x386958&&Object[_0x39e50f(0x1c6)](_0x386958)[_0x39e50f(0x199)]>0x0)_0x38892d[_0x39e50f(0x1aa)]=Object['keys'](_0x386958)[0x0];else _0x5eff93[_0x39e50f(0x1aa)]&&(_0x38892d['defaultApp']=_0x5eff93[_0x39e50f(0x1aa)]);}return _0x38892d;}export function readRawConfigWithLayers(_0x1c2aff){const _0x374045=loadRawConfigLayers(_0x1c2aff);return{'config':mergeRawConfigLayers(_0x374045),'layers':_0x374045};}export function readRawConfig(_0x429f8f){return mergeRawConfigLayers(loadRawConfigLayers(_0x429f8f));}export function readConfigFile(_0x14367d){const _0x4f1a2f=a91_0x29b968;return parseCliConfigJsonFile(_0x14367d,_0x4f1a2f(0x1ca));}export function writeConfigFile(_0x2c950f,_0x1b35cd){const _0x58a5dd=a91_0x29b968,_0xdd53d0=dirname(_0x2c950f);!existsSync(_0xdd53d0)&&mkdirSync(_0xdd53d0,{'recursive':!![]});const _0x258798=_0x2c950f+'.tmp';try{writeFileSync(_0x258798,JSON[_0x58a5dd(0x1da)](_0x1b35cd,null,0x2)+'\x0a',{'encoding':_0x58a5dd(0x1d0),'mode':0x180}),renameSync(_0x258798,_0x2c950f);}catch(_0x1f84a9){try{unlinkSync(_0x258798);}catch{}throw _0x1f84a9;}}export function resolveWriteConfigPath(_0x36de27){const _0x1e1431=a91_0x29b968,_0x46061c=_0x36de27===_0x1e1431(0x19a)?process[_0x1e1431(0x198)]():homedir(),_0x2800e6=resolveConfigPath(_0x46061c);return _0x2800e6??resolve(_0x46061c,NEW_CONFIG_NAME);}function buildConfig(_0x30d9ae,_0x13d33b){const _0x3de017=a91_0x29b968,_0x341d1d={};if(_0x30d9ae[_0x3de017(0x1c8)]&&typeof _0x30d9ae[_0x3de017(0x1c8)]===_0x3de017(0x1cd))for(const [_0x177621,_0x1eb848]of Object[_0x3de017(0x1c5)](_0x30d9ae['apps'])){_0x1eb848&&typeof _0x1eb848===_0x3de017(0x1cd)&&_0x1eb848[_0x3de017(0x1a8)]&&(_0x341d1d[_0x177621]=_0x1eb848);}const _0x4cf551=_0x30d9ae[_0x3de017(0x1aa)]||undefined,_0xf2f00f=Object[_0x3de017(0x1c6)](_0x341d1d)['length']>0x0,_0x34cd38=_0x13d33b['app']||env(_0x3de017(0x1b9))||undefined,_0x5410d1=_0x34cd38||_0x4cf551||undefined,_0x22ada7=_0x13d33b[_0x3de017(0x1a8)]||env(_0x3de017(0x1ad))||undefined,_0x25949f=_0x22ada7?Object[_0x3de017(0x1c5)](_0x341d1d)[_0x3de017(0x1ae)](([,_0x3d73a7])=>_0x3d73a7?.[_0x3de017(0x1a8)]===_0x22ada7):undefined,_0xa3b7ee=_0x25949f?.[0x0],_0x56b939=_0x25949f?.[0x1];let _0x3ab938=_0x22ada7?_0xa3b7ee:_0x5410d1,_0x300e97=_0x3ab938&&_0x341d1d[_0x3ab938]?_0x341d1d[_0x3ab938]:undefined;_0x22ada7&&_0x56b939&&(_0x300e97=_0x56b939);const _0x7e4933=_0x22ada7?_0x56b939??_0x300e97:_0x300e97,_0x1ddec5=_0x34cd38||(_0x22ada7?_0xa3b7ee:undefined),_0x51cd4d=_0x22ada7||_0x7e4933?.[_0x3de017(0x1a8)]||_0x30d9ae[_0x3de017(0x1a8)]||_0x30d9ae['app']||undefined,_0x27bdd3=_0x13d33b[_0x3de017(0x1a0)]||env(_0x3de017(0x1c2))||_0x7e4933?.['env']||_0x30d9ae['env']||_0x3de017(0x1d5),_0x50c2ab=_0x7e4933?.[_0x3de017(0x1c4)]||_0x30d9ae[_0x3de017(0x1c4)]||_0x3de017(0x1a4),_0x591fa6=env(_0x3de017(0x1b8))||_0x7e4933?.[_0x3de017(0x1d2)]||_0x30d9ae[_0x3de017(0x1d2)]||undefined,_0x2aa2db=env(_0x3de017(0x19d))||_0x7e4933?.[_0x3de017(0x1a2)]||_0x30d9ae[_0x3de017(0x1a2)]||undefined,_0x3c6912=_0x13d33b[_0x3de017(0x1d4)]||env('FORMAT')||_0x7e4933?.[_0x3de017(0x1d4)]||_0x30d9ae[_0x3de017(0x1d4)],_0x450d20=normalizeLegacyOutputFormat(_0x3c6912),_0x4f8102=env(_0x3de017(0x1a6))||_0x7e4933?.[_0x3de017(0x1cf)]||_0x30d9ae[_0x3de017(0x1cf)],_0x883a97=_0x4f8102?Number(_0x4f8102)||undefined:undefined,_0x10d033=env(_0x3de017(0x197))||env(_0x3de017(0x19e))||_0x7e4933?.[_0x3de017(0x1dd)]||_0x30d9ae['riskLevel']||_0x30d9ae[_0x3de017(0x1d7)],_0x41a517=_0x10d033===_0x3de017(0x1b7)||_0x10d033===_0x3de017(0x1d9)?_0x10d033:_0x3de017(0x1b4),_0x2d6460=env(_0x3de017(0x1a1)),_0x9fd9a4=_0x2d6460==='1'||_0x2d6460===_0x3de017(0x1b3),_0x111f6c=_0x7e4933?.[_0x3de017(0x1bc)]||_0x30d9ae[_0x3de017(0x1bc)]||DEFAULT_API_DIR;return{'appCode':typeof _0x51cd4d==='string'&&_0x51cd4d['trim']()?_0x51cd4d['trim']():undefined,'env':_0x27bdd3===_0x3de017(0x1bb)?_0x3de017(0x1d5):_0x27bdd3===_0x3de017(0x1d3)?_0x3de017(0x1d3):_0x3de017(0x1d5),'locale':_0x50c2ab,'cookie':_0x591fa6,'accessKey':_0x2aa2db,'format':_0x450d20,'pageSize':_0x883a97,'riskLevel':_0x41a517,'verbose':_0x9fd9a4,'apiDir':_0x111f6c,'apps':_0x341d1d,'defaultApp':_0x4cf551,'currentApp':_0xf2f00f?_0x3ab938:undefined,'explicitAppName':_0x1ddec5,'raw':_0x30d9ae};}async function buildAuth(_0x52be32){const _0x2f24b7=a91_0x29b968,{getCookie:_0x391060}=await import(_0x2f24b7(0x1e0)),_0x4de79a=_0x52be32[_0x2f24b7(0x1d2)]||_0x391060(),_0x27c160=_0x4de79a?await getIsSessionValid():![];return{'cookie':_0x4de79a,'isLoggedIn':_0x27c160,async 'getOrLogin'(){const _0x549243=_0x2f24b7;if(_0x4de79a&&_0x27c160)return _0x4de79a;throw CliErrors[_0x549243(0x1d8)]();}};}export function resolveApiFilePath(_0x3217c4,_0x140732){const _0x259730=a91_0x29b968,_0x518a08=resolve(process[_0x259730(0x198)](),_0x3217c4),_0x5b11ea=resolve(_0x518a08,_0x259730(0x1b0));if(!_0x140732)return _0x5b11ea;const _0x3ca485=readRawConfig(),_0x85010=_0x3ca485[_0x259730(0x1c8)]&&typeof _0x3ca485[_0x259730(0x1c8)]===_0x259730(0x1cd)?_0x3ca485[_0x259730(0x1c8)]:{},_0xe4cc0d=Object[_0x259730(0x1c5)](_0x85010)[_0x259730(0x1ae)](([,_0xee57c])=>_0xee57c?.[_0x259730(0x1a8)]===_0x140732);if(!_0xe4cc0d)return _0x5b11ea;const [_0x1c0e51,_0x3922a4]=_0xe4cc0d,_0x467218=typeof _0x3ca485['defaultApp']===_0x259730(0x1a3)?_0x3ca485[_0x259730(0x1aa)]:undefined;if(_0x3922a4?.[_0x259730(0x1bc)])return _0x5b11ea;if(_0x467218&&_0x1c0e51!==_0x467218)return resolve(_0x518a08,_0x1c0e51+_0x259730(0x1e2));return _0x5b11ea;}
1
+ const a106_0x1e7077=a106_0x5aa6;(function(_0x9953e6,_0x58f894){const _0x34c4a1=a106_0x5aa6,_0xe767b=_0x9953e6();while(!![]){try{const _0x35558a=-parseInt(_0x34c4a1(0x125))/0x1*(-parseInt(_0x34c4a1(0xe8))/0x2)+parseInt(_0x34c4a1(0x112))/0x3+parseInt(_0x34c4a1(0xec))/0x4+parseInt(_0x34c4a1(0xf2))/0x5*(parseInt(_0x34c4a1(0x12f))/0x6)+parseInt(_0x34c4a1(0x10b))/0x7+-parseInt(_0x34c4a1(0x11d))/0x8+-parseInt(_0x34c4a1(0x106))/0x9*(parseInt(_0x34c4a1(0x115))/0xa);if(_0x35558a===_0x58f894)break;else _0xe767b['push'](_0xe767b['shift']());}catch(_0x4ba1aa){_0xe767b['push'](_0xe767b['shift']());}}}(a106_0xa1ba,0x21129));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}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{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x10f72f){return process.env[`RABETBASE_${_0x10f72f}`]||process.env[`LOVRABET_${_0x10f72f}`]||undefined;}export const NEW_CONFIG_NAME=a106_0x1e7077(0x114);export const CONFIG_NAMES=[a106_0x1e7077(0x114),'.lovrabet.json',a106_0x1e7077(0x10f)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x52d656=>_0x52d656!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3bc2b4){for(const _0x1b9f1e of CONFIG_NAMES){const _0x2cb485=resolve(_0x3bc2b4,_0x1b9f1e);if(existsSync(_0x2cb485))return _0x2cb485;}return undefined;}export function findProjectRootDirectory(_0x32f29e=process[a106_0x1e7077(0x10a)]()){let _0x49ae3c=resolve(_0x32f29e);const {root:_0x249ec4}=parse(_0x49ae3c),_0x3fb18c=homedir();while(!![]){if(resolveConfigPath(_0x49ae3c)){if(_0x49ae3c===_0x3fb18c)break;return _0x49ae3c;}if(_0x49ae3c===_0x249ec4||_0x49ae3c===_0x3fb18c)break;const _0x9c0de7=dirname(_0x49ae3c);if(_0x9c0de7===_0x49ae3c)break;_0x49ae3c=_0x9c0de7;}return resolve(_0x32f29e);}export async function createContext(_0x20566e){const _0xdcb2d9=a106_0x1e7077,_0x41ffa0=readRawConfig(),_0x771bcf=buildConfig(_0x41ffa0,_0x20566e),{initEnv:_0xe6d389}=await import('./constant/env.js');if(_0x771bcf[_0xdcb2d9(0xfd)])_0xe6d389(_0x771bcf[_0xdcb2d9(0xfd)]);else _0x20566e[_0xdcb2d9(0xfd)]&&typeof _0x20566e[_0xdcb2d9(0xfd)]===_0xdcb2d9(0x123)&&_0xe6d389(_0x20566e[_0xdcb2d9(0xfd)]);const {initDomains:_0xbed30b,getUserDomain:_0x2dd6d4,getApiDomain:_0x24d58e}=await import(_0xdcb2d9(0x12e));_0xbed30b({'apiDomain':_0x41ffa0[_0xdcb2d9(0x127)]||undefined,'userDomain':_0x41ffa0[_0xdcb2d9(0xe9)]||undefined,'runtimeDomain':_0x41ffa0[_0xdcb2d9(0x102)]||undefined});const _0x4faee3={'apiDomain':_0x24d58e(),'userDomain':_0x2dd6d4()},_0x374af8=await buildAuth(_0x771bcf);logger[_0xdcb2d9(0x113)](process['cwd']());const _0x1779a9=(CLI_BIN_NAME+'\x20'+process[_0xdcb2d9(0x111)]['slice'](0x2)[_0xdcb2d9(0x131)]('\x20'))['trim']();logger[_0xdcb2d9(0x126)](_0x1779a9);const {isNonInteractive:_0xc75f74}=await import(_0xdcb2d9(0x108)),_0x52823b=_0xc75f74(_0x20566e);return{'config':_0x771bcf,'auth':_0x374af8,'logger':logger,'env':_0x4faee3,'nonInteractive':_0x52823b};}function a106_0x5aa6(_0x3c7632,_0x2f0c73){_0x3c7632=_0x3c7632-0xe7;const _0xa1ba15=a106_0xa1ba();let _0x5aa6d3=_0xa1ba15[_0x3c7632];return _0x5aa6d3;}export function buildConfigFromFlags(_0x526617){return buildConfig(readRawConfig(),_0x526617);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x5e572c){const _0x55a413=a106_0x1e7077;if(!existsSync(_0x5e572c))return{'status':'missing'};try{const _0x2f8b4a=readFileSync(_0x5e572c,{'encoding':_0x55a413(0x117)});if(!_0x2f8b4a?.[_0x55a413(0xf6)]())return{'status':_0x55a413(0x12d)};const _0x5d3a87=JSON[_0x55a413(0x11c)](_0x2f8b4a);return{'status':'ok','data':_0x5d3a87};}catch(_0x42ff1d){return{'status':'error','message':_0x42ff1d instanceof Error?_0x42ff1d[_0x55a413(0x105)]:String(_0x42ff1d)};}}function parseCliConfigJsonFile(_0x3b2bf2,_0x378edd,_0x226049){const _0x54fd4c=a106_0x1e7077,_0x5e0259=inspectCliConfigJsonFile(_0x3b2bf2);if(_0x5e0259['status']===_0x54fd4c(0xe7)||_0x5e0259['status']===_0x54fd4c(0x12d))return{};if(_0x5e0259[_0x54fd4c(0xf4)]==='ok')return _0x5e0259['data'];return _0x378edd===_0x54fd4c(0xf3)&&_0x226049&&console['error'](CLI_BIN_NAME+':\x20'+_0x226049+_0x54fd4c(0x12b)+_0x3b2bf2+_0x54fd4c(0xfa)+_0x5e0259['message']),{};}export function loadRawConfigLayers(_0x19ad69){const _0x4b774c=a106_0x1e7077;let _0x57d8d2={},_0x217b0c={};const _0xf368ea=resolveConfigPath(homedir());_0xf368ea&&(_0x57d8d2=parseCliConfigJsonFile(_0xf368ea,_0x4b774c(0xf3),_0x4b774c(0x118)));const _0x53bef7=_0x19ad69??findProjectRootDirectory(),_0x3bd959=resolveConfigPath(_0x53bef7);return _0x3bd959&&(_0x217b0c=parseCliConfigJsonFile(_0x3bd959,_0x4b774c(0xf3),_0x4b774c(0x104))),{'globalPath':_0xf368ea,'projectPath':_0x3bd959,'globalConfig':_0x57d8d2,'projectConfig':_0x217b0c};}function mergeRawConfigLayers(_0x17eda0){const _0x397ae2=a106_0x1e7077,{globalConfig:_0x5173d2,projectConfig:_0x9ef696}=_0x17eda0;if(_0x9ef696[_0x397ae2(0xea)]===![]){const _0x3b7e9a={..._0x9ef696};delete _0x3b7e9a[_0x397ae2(0xea)];const _0x5991ea=_0x9ef696[_0x397ae2(0xf0)]&&typeof _0x9ef696['apps']==='object'?_0x9ef696[_0x397ae2(0xf0)]:{};Object[_0x397ae2(0xf7)](_0x5991ea)[_0x397ae2(0x11b)]>0x0?_0x3b7e9a[_0x397ae2(0xf0)]=_0x5991ea:delete _0x3b7e9a[_0x397ae2(0xf0)];if(_0x397ae2(0x129)in _0x9ef696)_0x3b7e9a[_0x397ae2(0x129)]=_0x9ef696[_0x397ae2(0x129)];else Object[_0x397ae2(0xf7)](_0x5991ea)[_0x397ae2(0x11b)]>0x0&&(_0x3b7e9a[_0x397ae2(0x129)]=Object[_0x397ae2(0xf7)](_0x5991ea)[0x0]);return _0x3b7e9a;}const _0x33e0f9=_0x5173d2[_0x397ae2(0xf0)]&&typeof _0x5173d2[_0x397ae2(0xf0)]===_0x397ae2(0x116)?_0x5173d2[_0x397ae2(0xf0)]:{},_0x41cdbb=_0x9ef696[_0x397ae2(0xf0)]&&typeof _0x9ef696[_0x397ae2(0xf0)]==='object'?_0x9ef696[_0x397ae2(0xf0)]:{},_0x305fa2={..._0x33e0f9,..._0x41cdbb},_0x106400={..._0x5173d2,..._0x9ef696};Object[_0x397ae2(0xf7)](_0x305fa2)[_0x397ae2(0x11b)]>0x0&&(_0x106400[_0x397ae2(0xf0)]=_0x305fa2);if('defaultApp'in _0x9ef696)_0x106400['defaultApp']=_0x9ef696[_0x397ae2(0x129)];else{if(_0x41cdbb&&Object[_0x397ae2(0xf7)](_0x41cdbb)[_0x397ae2(0x11b)]>0x0)_0x106400[_0x397ae2(0x129)]=Object['keys'](_0x41cdbb)[0x0];else{if(_0x5173d2[_0x397ae2(0x129)]){const _0x524ee5=Boolean(_0x9ef696[_0x397ae2(0x103)]||_0x9ef696['app']);_0x524ee5?delete _0x106400['defaultApp']:_0x106400['defaultApp']=_0x5173d2['defaultApp'];}}}return _0x106400;}export function readRawConfigWithLayers(_0x5a5fda){const _0xe06a4d=loadRawConfigLayers(_0x5a5fda);return{'config':mergeRawConfigLayers(_0xe06a4d),'layers':_0xe06a4d};}export function readRawConfig(_0x7d26cb){return mergeRawConfigLayers(loadRawConfigLayers(_0x7d26cb));}export function readConfigFile(_0x2cf51c){const _0x735f51=a106_0x1e7077;return parseCliConfigJsonFile(_0x2cf51c,_0x735f51(0xef));}export function writeConfigFile(_0x6c6f5d,_0x3211a0){const _0xee3495=a106_0x1e7077,_0x4bc4ac=dirname(_0x6c6f5d);!existsSync(_0x4bc4ac)&&mkdirSync(_0x4bc4ac,{'recursive':!![]});const _0x3f95c2=_0x6c6f5d+_0xee3495(0x110);try{writeFileSync(_0x3f95c2,JSON['stringify'](_0x3211a0,null,0x2)+'\x0a',{'encoding':_0xee3495(0x117),'mode':0x180}),renameSync(_0x3f95c2,_0x6c6f5d);}catch(_0x1a9a15){try{unlinkSync(_0x3f95c2);}catch{}throw _0x1a9a15;}}function a106_0xa1ba(){const _0x396aea=['daily','format','runtimeDomain','appcode','Project','message','9vtUCMo','find','./utils/is-non-interactive.js','APPCODE','cwd','696087xlYhJn','locale','riskLevel','app','.lovrabetrc','.tmp','argv','607290QgZjIq','setLogPath','.rabetbase.json','3287210fQzGKL','object','utf8','Global','pageSize','ENV','length','parse','531992HmcgcE','apiDir','cookie','RISK_LEVEL','MAX_RISK','APP','string','high-risk-write','3yWfoOc','setRawCommand','apiDomain','read','defaultApp','accessKey','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','maxRisk','empty','./constant/domain.js','6LJUgsH','write','join','missing','5942EOqHmM','userDomain','inherit','api.ts','852536ScZQHu','VERBOSE','./auth/get-cookie.js','silent','apps','project','33835IZKAVa','warn','status','en-US','trim','keys','true','authRequired','\x0a\x20\x20','production','FORMAT','env','entries','COOKIE'];a106_0xa1ba=function(){return _0x396aea;};return a106_0xa1ba();}export function resolveWriteConfigPath(_0x49a38c){const _0x3adf5c=a106_0x1e7077,_0x2ca48f=_0x49a38c===_0x3adf5c(0xf1)?process[_0x3adf5c(0x10a)]():homedir(),_0x4525f9=resolveConfigPath(_0x2ca48f);return _0x4525f9??resolve(_0x2ca48f,NEW_CONFIG_NAME);}function buildConfig(_0x352562,_0x1d3cc9){const _0x55ed9f=a106_0x1e7077,_0x353fef={};if(_0x352562[_0x55ed9f(0xf0)]&&typeof _0x352562[_0x55ed9f(0xf0)]===_0x55ed9f(0x116))for(const [_0x4ab925,_0x5d673b]of Object['entries'](_0x352562[_0x55ed9f(0xf0)])){_0x5d673b&&typeof _0x5d673b===_0x55ed9f(0x116)&&_0x5d673b['appcode']&&(_0x353fef[_0x4ab925]=_0x5d673b);}const _0x682d04=_0x352562['defaultApp']||undefined,_0x29deee=Object[_0x55ed9f(0xf7)](_0x353fef)[_0x55ed9f(0x11b)]>0x0,_0x29c753=_0x1d3cc9['app']||env(_0x55ed9f(0x122))||undefined,_0x4c9fae=_0x29c753||_0x682d04||undefined,_0x107dc3=_0x1d3cc9[_0x55ed9f(0x103)]||env(_0x55ed9f(0x109))||undefined,_0x50b198=_0x107dc3?Object[_0x55ed9f(0xfe)](_0x353fef)[_0x55ed9f(0x107)](([,_0x4f57fa])=>_0x4f57fa?.[_0x55ed9f(0x103)]===_0x107dc3):undefined,_0x36677e=_0x50b198?.[0x0],_0x2ad757=_0x50b198?.[0x1];let _0x29b3e1=_0x107dc3?_0x36677e:_0x4c9fae,_0x5a52d3=_0x29b3e1&&_0x353fef[_0x29b3e1]?_0x353fef[_0x29b3e1]:undefined;_0x107dc3&&_0x2ad757&&(_0x5a52d3=_0x2ad757);const _0x3f54f3=_0x107dc3?_0x2ad757??_0x5a52d3:_0x5a52d3,_0x146ba1=_0x29c753||(_0x107dc3?_0x36677e:undefined),_0x2c2a09=_0x107dc3||_0x3f54f3?.['appcode']||_0x352562[_0x55ed9f(0x103)]||_0x352562[_0x55ed9f(0x10e)]||undefined,_0x4a0d76=_0x1d3cc9[_0x55ed9f(0xfd)]||env(_0x55ed9f(0x11a))||_0x3f54f3?.[_0x55ed9f(0xfd)]||_0x352562[_0x55ed9f(0xfd)]||_0x55ed9f(0xfb),_0x54d378=_0x3f54f3?.[_0x55ed9f(0x10c)]||_0x352562[_0x55ed9f(0x10c)]||_0x55ed9f(0xf5),_0x3942c6=env(_0x55ed9f(0xff))||_0x3f54f3?.['cookie']||_0x352562[_0x55ed9f(0x11f)]||undefined,_0x27e11f=env('ACCESS_KEY')||_0x3f54f3?.[_0x55ed9f(0x12a)]||_0x352562[_0x55ed9f(0x12a)]||undefined,_0xcaf411=_0x1d3cc9[_0x55ed9f(0x101)]||env(_0x55ed9f(0xfc))||_0x3f54f3?.[_0x55ed9f(0x101)]||_0x352562[_0x55ed9f(0x101)],_0x36c991=normalizeLegacyOutputFormat(_0xcaf411),_0x340444=env('PAGE_SIZE')||_0x3f54f3?.[_0x55ed9f(0x119)]||_0x352562[_0x55ed9f(0x119)],_0x538c54=_0x340444?Number(_0x340444)||undefined:undefined,_0x5b46a9=env(_0x55ed9f(0x120))||env(_0x55ed9f(0x121))||_0x3f54f3?.[_0x55ed9f(0x10d)]||_0x352562['riskLevel']||_0x352562[_0x55ed9f(0x12c)],_0x41020c=_0x5b46a9===_0x55ed9f(0x128)||_0x5b46a9===_0x55ed9f(0x130)?_0x5b46a9:_0x55ed9f(0x124),_0x34f07f=env(_0x55ed9f(0xed)),_0x2d2b57=_0x34f07f==='1'||_0x34f07f===_0x55ed9f(0xf8),_0x4f8099=_0x3f54f3?.[_0x55ed9f(0x11e)]||_0x352562[_0x55ed9f(0x11e)]||DEFAULT_API_DIR,_0x438fbc=isDaily(normalizeEnv(String(_0x4a0d76)))?_0x55ed9f(0x100):_0x55ed9f(0xfb);return{'appCode':typeof _0x2c2a09===_0x55ed9f(0x123)&&_0x2c2a09[_0x55ed9f(0xf6)]()?_0x2c2a09[_0x55ed9f(0xf6)]():undefined,'env':_0x438fbc,'locale':_0x54d378,'cookie':_0x3942c6,'accessKey':_0x27e11f,'format':_0x36c991,'pageSize':_0x538c54,'riskLevel':_0x41020c,'verbose':_0x2d2b57,'apiDir':_0x4f8099,'apps':_0x353fef,'defaultApp':_0x682d04,'currentApp':_0x29deee?_0x29b3e1:undefined,'explicitAppName':_0x146ba1,'raw':_0x352562};}async function buildAuth(_0x571841){const _0x2fdd27=a106_0x1e7077,{getCookie:_0x226a2a}=await import(_0x2fdd27(0xee)),_0x32e375=_0x571841[_0x2fdd27(0x11f)]||_0x226a2a(),_0x537e87=_0x32e375?await getIsSessionValid():![];return{'cookie':_0x32e375,'isLoggedIn':_0x537e87,async 'getOrLogin'(){const _0x2b466c=_0x2fdd27;if(_0x32e375&&_0x537e87)return _0x32e375;throw CliErrors[_0x2b466c(0xf9)]();}};}export function resolveApiFilePath(_0x94a954,_0x1634a3){const _0x88226f=a106_0x1e7077,_0x221e5e=resolve(process['cwd'](),_0x94a954),_0x24c023=resolve(_0x221e5e,_0x88226f(0xeb));if(!_0x1634a3)return _0x24c023;const _0x68f193=readRawConfig(),_0x29c619=_0x68f193['apps']&&typeof _0x68f193['apps']===_0x88226f(0x116)?_0x68f193[_0x88226f(0xf0)]:{},_0x498a91=Object['entries'](_0x29c619)['find'](([,_0x506a06])=>_0x506a06?.[_0x88226f(0x103)]===_0x1634a3);if(!_0x498a91)return _0x24c023;const [_0x2371c3,_0x1b88ad]=_0x498a91,_0x4785a8=typeof _0x68f193[_0x88226f(0x129)]===_0x88226f(0x123)?_0x68f193[_0x88226f(0x129)]:undefined;if(_0x1b88ad?.['apiDir'])return _0x24c023;if(_0x4785a8&&_0x2371c3!==_0x4785a8)return resolve(_0x221e5e,_0x2371c3+'-api.ts');return _0x24c023;}
@@ -1 +1 @@
1
- function a92_0x4933(){const _0xda4c37=['cwd','2711380wxlfsj','alias','set','5705bKWkVj','utf-8','744eGgOIU','4144504MnqoYK','128lIFcew','9906530vzjxxb','2915MuoZLN','42926829SfvBal','6366kFvFEm','push','datasetCode','has','3hpexCB','api.ts','exec','558CcRbEF'];a92_0x4933=function(){return _0xda4c37;};return a92_0x4933();}(function(_0x588652,_0x30313a){const _0x1290ce=a92_0xdd0e,_0x1095ce=_0x588652();while(!![]){try{const _0x4d7b0a=-parseInt(_0x1290ce(0xfe))/0x1*(-parseInt(_0x1290ce(0xfc))/0x2)+-parseInt(_0x1290ce(0x104))/0x3*(parseInt(_0x1290ce(0xf5))/0x4)+parseInt(_0x1290ce(0xf8))/0x5*(-parseInt(_0x1290ce(0x100))/0x6)+-parseInt(_0x1290ce(0xfb))/0x7+-parseInt(_0x1290ce(0xfa))/0x8*(-parseInt(_0x1290ce(0x107))/0x9)+-parseInt(_0x1290ce(0xfd))/0xa+parseInt(_0x1290ce(0xff))/0xb;if(_0x4d7b0a===_0x30313a)break;else _0x1095ce['push'](_0x1095ce['shift']());}catch(_0x48dff8){_0x1095ce['push'](_0x1095ce['shift']());}}}(a92_0x4933,0x983ea));import{readFileSync,existsSync}from'node:fs';function a92_0xdd0e(_0x6d8ed6,_0x4a5229){_0x6d8ed6=_0x6d8ed6-0xf4;const _0x493397=a92_0x4933();let _0xdd0e6=_0x493397[_0x6d8ed6];return _0xdd0e6;}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x2c06e3){const _0x13534a=a92_0xdd0e,_0x5c98eb=[],_0x2a88f7=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0xb39b54;while((_0xb39b54=_0x2a88f7[_0x13534a(0x106)](_0x2c06e3))!==null){_0x5c98eb[_0x13534a(0x101)]({'datasetCode':_0xb39b54[0x1],'tableName':_0xb39b54[0x2],'name':_0xb39b54[0x3],'alias':_0xb39b54[0x4]});}return _0x5c98eb;}export function loadAliasMap(_0x2e2e7d,_0x279076,_0x4511eb){const _0x42ec99=a92_0xdd0e,_0x521903=_0x4511eb??resolve(process[_0x42ec99(0xf4)](),_0x2e2e7d,_0x42ec99(0x105));if(cache[_0x42ec99(0x103)](_0x521903))return cache['get'](_0x521903);if(!existsSync(_0x521903))return cache['set'](_0x521903,[]),[];try{const _0xe1994e=readFileSync(_0x521903,_0x42ec99(0xf9)),_0x3a4b64=parseApiFile(_0xe1994e);return cache[_0x42ec99(0xf7)](_0x521903,_0x3a4b64),_0x3a4b64;}catch{return cache[_0x42ec99(0xf7)](_0x521903,[]),[];}}export function resolveAlias(_0x1d667a,_0x1642f6,_0x38dcf1,_0x584fef){const _0x3d0f6a=a92_0xdd0e;if(!_0x1642f6)return undefined;const _0x218efd=loadAliasMap(_0x1d667a,_0x38dcf1,_0x584fef),_0x24ee55=_0x218efd['find'](_0x4af3fd=>_0x4af3fd[_0x3d0f6a(0xf6)]===_0x1642f6);return _0x24ee55?.[_0x3d0f6a(0x102)];}export function listAliases(_0x48af48,_0x1f617f,_0x3584c4){return loadAliasMap(_0x48af48,_0x1f617f,_0x3584c4);}
1
+ (function(_0xbf7b7,_0x3fc796){const _0x441556=a107_0x1789,_0x5a5ab1=_0xbf7b7();while(!![]){try{const _0x4f631c=-parseInt(_0x441556(0x1c6))/0x1+parseInt(_0x441556(0x1c5))/0x2+parseInt(_0x441556(0x1c2))/0x3*(parseInt(_0x441556(0x1c9))/0x4)+parseInt(_0x441556(0x1c7))/0x5+parseInt(_0x441556(0x1cc))/0x6*(-parseInt(_0x441556(0x1bf))/0x7)+parseInt(_0x441556(0x1c3))/0x8+parseInt(_0x441556(0x1c8))/0x9*(-parseInt(_0x441556(0x1c1))/0xa);if(_0x4f631c===_0x3fc796)break;else _0x5a5ab1['push'](_0x5a5ab1['shift']());}catch(_0x57a34e){_0x5a5ab1['push'](_0x5a5ab1['shift']());}}}(a107_0x41a2,0xb0117));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a107_0x41a2(){const _0x5b07d3=['exec','datasetCode','get','has','330435oxbtJT','cwd','6183370lrptzu','9096tpBmBk','7047864HbfjYg','push','1900508BOwxKK','1200695cBqzwp','3345415CMAkqq','9lsyGyE','364WnHnZJ','find','set','30uAzxZr','alias','utf-8'];a107_0x41a2=function(){return _0x5b07d3;};return a107_0x41a2();}const cache=new Map();function a107_0x1789(_0x5a667f,_0x28edd7){_0x5a667f=_0x5a667f-0x1bd;const _0x41a2dd=a107_0x41a2();let _0x1789d0=_0x41a2dd[_0x5a667f];return _0x1789d0;}function parseApiFile(_0x37d4f3){const _0x37fed3=a107_0x1789,_0x3a6525=[],_0xb771d3=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1e423a;while((_0x1e423a=_0xb771d3[_0x37fed3(0x1cf)](_0x37d4f3))!==null){_0x3a6525[_0x37fed3(0x1c4)]({'datasetCode':_0x1e423a[0x1],'tableName':_0x1e423a[0x2],'name':_0x1e423a[0x3],'alias':_0x1e423a[0x4]});}return _0x3a6525;}export function loadAliasMap(_0x50d778,_0x1f2811,_0x60a1c6){const _0x54d809=a107_0x1789,_0x34b466=_0x60a1c6??resolve(process[_0x54d809(0x1c0)](),_0x50d778,'api.ts');if(cache[_0x54d809(0x1be)](_0x34b466))return cache[_0x54d809(0x1bd)](_0x34b466);if(!existsSync(_0x34b466))return cache[_0x54d809(0x1cb)](_0x34b466,[]),[];try{const _0xd75085=readFileSync(_0x34b466,_0x54d809(0x1ce)),_0x2f0cae=parseApiFile(_0xd75085);return cache['set'](_0x34b466,_0x2f0cae),_0x2f0cae;}catch{return cache[_0x54d809(0x1cb)](_0x34b466,[]),[];}}export function resolveAlias(_0x5ae926,_0x3d341d,_0x11907d,_0x7d6d79){const _0x3ae3e1=a107_0x1789;if(!_0x3d341d)return undefined;const _0x3b517c=loadAliasMap(_0x5ae926,_0x11907d,_0x7d6d79),_0x4777ee=_0x3b517c[_0x3ae3e1(0x1ca)](_0x413b0b=>_0x413b0b[_0x3ae3e1(0x1cd)]===_0x3d341d);return _0x4777ee?.[_0x3ae3e1(0x1d0)];}export function listAliases(_0x4bee8b,_0x3ef9ef,_0x12d19f){return loadAliasMap(_0x4bee8b,_0x3ef9ef,_0x12d19f);}
@@ -1 +1 @@
1
- (function(_0x261e09,_0x25ad7d){const _0x4f23ae=a93_0x41b7,_0x488058=_0x261e09();while(!![]){try{const _0x408ff9=parseInt(_0x4f23ae(0x18b))/0x1*(parseInt(_0x4f23ae(0x186))/0x2)+parseInt(_0x4f23ae(0x17c))/0x3+-parseInt(_0x4f23ae(0x177))/0x4*(-parseInt(_0x4f23ae(0x192))/0x5)+-parseInt(_0x4f23ae(0x16c))/0x6+-parseInt(_0x4f23ae(0x168))/0x7*(-parseInt(_0x4f23ae(0x1c4))/0x8)+parseInt(_0x4f23ae(0x199))/0x9*(parseInt(_0x4f23ae(0x160))/0xa)+-parseInt(_0x4f23ae(0x15e))/0xb;if(_0x408ff9===_0x25ad7d)break;else _0x488058['push'](_0x488058['shift']());}catch(_0xbf9ba7){_0x488058['push'](_0x488058['shift']());}}}(a93_0x1d59,0x2758c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x607bc7){_activeCookie=_0x607bc7||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x48f58f,_0x23f5ff={}){const _0x39a5e3=a93_0x41b7,{method:method=_0x39a5e3(0x1ad),body:_0x36a44e,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x23f5ff,_0x5a76b3=useRuntime?getRuntimeDomain():getApiDomain(),_0x3d276d=_activeCookie||getCookie(),_0x469979=''+_0x5a76b3+_0x48f58f,_0x5d0e25=new AbortController(),_0x3a013d=setTimeout(()=>_0x5d0e25[_0x39a5e3(0x1b1)](),timeout);try{const _0x375ecf=await fetch(_0x469979,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x3d276d,'X-Invoke-Source':_0x39a5e3(0x15d),...headers},'body':_0x36a44e?JSON[_0x39a5e3(0x15c)](_0x36a44e):undefined,'signal':_0x5d0e25[_0x39a5e3(0x1c9)]});let _0x41f442;try{_0x41f442=await _0x375ecf[_0x39a5e3(0x1bb)]();}catch{throw CliErrors[_0x39a5e3(0x1a2)](_0x39a5e3(0x173)+_0x375ecf[_0x39a5e3(0x1ab)]+')',_0x375ecf[_0x39a5e3(0x1ab)]>=0x190?_0x39a5e3(0x162):undefined);}if(!_0x375ecf['ok']||_0x41f442[_0x39a5e3(0x197)]===![])throw CliErrors[_0x39a5e3(0x1a2)](_0x41f442['errorMsg']||_0x41f442[_0x39a5e3(0x170)]||_0x39a5e3(0x179)+_0x375ecf[_0x39a5e3(0x1ab)],_0x41f442['errorCode']?_0x39a5e3(0x1ba)+_0x41f442['errorCode']:undefined);return _0x41f442;}catch(_0x56b429){if(_0x56b429 instanceof Error&&_0x56b429[_0x39a5e3(0x1b4)]===_0x39a5e3(0x19d))throw CliErrors[_0x39a5e3(0x1a2)]('Request\x20timeout:\x20'+_0x469979);throw _0x56b429;}finally{clearTimeout(_0x3a013d);}}function isAuthFailure(_0x568727){const _0x5c7219=a93_0x41b7,_0x1bcdc4=_0x568727[_0x5c7219(0x17d)]||_0x568727['message']||_0x568727[_0x5c7219(0x156)]?.[_0x5c7219(0x170)]||_0x568727[_0x5c7219(0x158)]||_0x568727[_0x5c7219(0x1a8)]||'';return _0x568727[_0x5c7219(0x1c7)]==='UNAUTHORIZED'||_0x568727[_0x5c7219(0x174)]===0x191||_0x568727[_0x5c7219(0x174)]==='401'||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x188))||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x18c))||_0x1bcdc4[_0x5c7219(0x18a)]('登录')||_0x1bcdc4[_0x5c7219(0x18a)]('认证');}export async function platformFetch(_0xcc0bd9,_0x4ee53b){const _0x596f00=a93_0x41b7,_0x2d82ba=await fetch(_0xcc0bd9,{'method':_0x4ee53b[_0x596f00(0x1bf)]??_0x596f00(0x1ad),'headers':{'Content-Type':_0x596f00(0x18f),'Cookie':_0x4ee53b[_0x596f00(0x1ca)]},..._0x4ee53b[_0x596f00(0x176)]&&{'body':JSON[_0x596f00(0x15c)](_0x4ee53b[_0x596f00(0x176)])}});if(!_0x2d82ba['ok']){if(_0x2d82ba[_0x596f00(0x1ab)]===0x191)throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x4ee53b[_0x596f00(0x195)]+_0x596f00(0x1cd)+_0x2d82ba[_0x596f00(0x1ab)]);}const _0x505d4f=await _0x2d82ba['json']();if(_0x505d4f[_0x596f00(0x197)]===![]){if(isAuthFailure(_0x505d4f))throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x505d4f[_0x596f00(0x17d)]||_0x505d4f['message']||_0x4ee53b[_0x596f00(0x195)]+'\x20failed');}return _0x505d4f['data'];}export async function listBffScripts(_0x26b058,_0x1aca02,_0x537ab9){const _0x350a51=a93_0x41b7;let _0x200b06=_0x350a51(0x1c3)+_0x26b058;if(_0x1aca02)_0x200b06+=_0x350a51(0x18d)+_0x1aca02;const _0x29e4a7=await apiRequest(_0x200b06);let _0x7610ad=extractList(_0x29e4a7[_0x350a51(0x156)]);if(_0x537ab9?.[_0x350a51(0x17b)]){const _0x349610=_0x537ab9[_0x350a51(0x17b)][_0x350a51(0x1a1)]();_0x7610ad=_0x7610ad[_0x350a51(0x169)](_0x4fb82f=>_0x4fb82f[_0x350a51(0x1cc)]?.[_0x350a51(0x1a1)]()['includes'](_0x349610)||_0x4fb82f[_0x350a51(0x193)]?.['toLowerCase']()[_0x350a51(0x18a)](_0x349610));}return _0x7610ad;}export async function getBffScriptInfo(_0xd42847){const _0x2b31c7=a93_0x41b7,_0x2db7a7=await apiRequest(_0x2b31c7(0x19f)+_0xd42847);if(!_0x2db7a7['data'])throw CliErrors['validation']('BFF\x20script\x20not\x20found:\x20id='+_0xd42847);return _0x2db7a7[_0x2b31c7(0x156)];}export async function saveBffScript(_0x1bf575){const _0x5088ef=a93_0x41b7,_0x38d009=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x1bf575});return _0x38d009[_0x5088ef(0x156)];}function a93_0x1d59(){const _0x271b9d=['});','data','tableData','errorMessage','\x20\x20currentPage:\x201,','path','dbtableConfig','stringify','cli:rabetbase','7015602CtDcLq','.getOne(id);','10kREasj','operationName','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','pageSize','authRequired','warn','\x20\x20\x20\x20sqlCode:\x20\x27','table','77evgWcV','filter','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','target','1450446EkcKAt','validation','update','.create({\x20/*\x20fields\x20*/\x20});','message','sqlCode','/smartapi/question/er-config','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','code','\x20apps.\x20','body','66072zjuEgN','remove','API\x20error:\x20','Warning:\x20showing\x20first\x20','scriptName','628929IqkTOk','errorMsg','add','join','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','SQL\x20query\x20not\x20found:\x20','find','\x20\x20pageSize:\x2020,','Dataset\x20not\x20found:\x20','524430DiwhfJ','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','401','sqlName','includes','1JnkWLa','Unauthorized','&type=','modelId','application/json','replace','displayName','75EftRjK','description','/api/node-toolbox/sql/save','label','(/*\x20params\x20*/);','success','/api/management/library/scripts/delete','2297313QtaETW','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','includeImports','totalCount','AbortError','//\x20SQL:\x20','/api/management/library/scripts/info?id=','const\x20data\x20=\x20await\x20client.sql.execute({','toLowerCase','apiError','modelCode','operations','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/app/getList','POST','error','isArray','\x20of\x20','status','currentPage','GET','const\x20results\x20=\x20data.execResult\x20||\x20[];','/api/management/library/scripts/statistics?appCode=','test','abort','.filter({','enabled','name','has','dataset_','Operation\x20\x22','sdk','object','API\x20error\x20code:\x20','json','.remove(id);','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','//\x20','method','map','push','tableName','/api/management/library/scripts/list?appCode=','47856sxTBII','requestFields','create','errorCode','\x20\x20return\x20rows;','signal','cookie','const\x20result\x20=\x20await\x20client.models.','functionName','\x20failed,\x20HTTP\x20'];a93_0x1d59=function(){return _0x271b9d;};return a93_0x1d59();}export async function deleteBffScript(_0x3bece9){const _0x50980f=a93_0x41b7;await apiRequest(_0x50980f(0x198),{'method':'POST','body':{'id':_0x3bece9}});}export async function getBffScriptStatistics(_0xe82af5){const _0x2f5049=a93_0x41b7,_0x4dc155=await apiRequest(_0x2f5049(0x1af)+_0xe82af5);return extractList(_0x4dc155[_0x2f5049(0x156)]);}export async function listBffDatasetOperations(_0x19c70b,_0x2374f2){const _0x45c8e2=a93_0x41b7,_0x289de3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x45c8e2(0x1a7),'body':{'appCode':_0x19c70b,'datasetId':_0x2374f2}});return _0x289de3['data'];}export async function listSqlQueries(_0x1ad1b2,_0x51f6be){const _0x448ff1=a93_0x41b7,_0x2981ae=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x1ad1b2,'currentPage':_0x51f6be?.[_0x448ff1(0x1ac)]??0x1,'pageSize':_0x51f6be?.[_0x448ff1(0x163)]??0x32,'sqlCode':_0x51f6be?.[_0x448ff1(0x171)],'sqlName':_0x51f6be?.[_0x448ff1(0x189)]}});return _0x2981ae[_0x448ff1(0x156)];}function a93_0x41b7(_0xe51fb8,_0x118081){_0xe51fb8=_0xe51fb8-0x156;const _0x1d5924=a93_0x1d59();let _0x41b779=_0x1d5924[_0xe51fb8];return _0x41b779;}export async function getSqlQueryInfo(_0x335cff,_0xde317){const _0x27444f=a93_0x41b7,_0x22d3b5=await listSqlQueries(_0x335cff,{'sqlCode':_0xde317}),_0x245a16=_0x22d3b5[_0x27444f(0x157)]?.[0x0];if(!_0x245a16)throw CliErrors['validation'](_0x27444f(0x182)+_0xde317);return _0x245a16;}export async function saveSqlQuery(_0x44cca7){const _0x5e360c=a93_0x41b7,_0x1c1df1=await apiRequest(_0x5e360c(0x194),{'method':'POST','body':_0x44cca7});return _0x1c1df1[_0x5e360c(0x156)];}export async function executeSql(_0x45fec0,_0x3da69b,_0x3500a8){const _0x1add13=a93_0x41b7,_0x12ab8c=await apiRequest('/api/custom/executeSql',{'method':_0x1add13(0x1a7),'body':{'appCode':_0x45fec0,'sqlCode':_0x3da69b,..._0x3500a8&&{'params':_0x3500a8}},'useRuntime':!![]});return _0x12ab8c[_0x1add13(0x156)];}export async function listDatasets(_0x19f893,_0x15e94e){const _0x36bbcd=a93_0x41b7,_0x366079={'appCode':_0x19f893,'deleted':![]};if(_0x15e94e?.['code'])_0x366079[_0x36bbcd(0x174)]=_0x15e94e[_0x36bbcd(0x174)];if(_0x15e94e?.[_0x36bbcd(0x1b4)])_0x366079['name']=_0x15e94e[_0x36bbcd(0x1b4)];const _0x3be1bb=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x36bbcd(0x1a7),'body':_0x366079});return extractList(_0x3be1bb['data']);}export async function searchDatasets(_0x28dd82,_0xb162cf){const _0x573a08=a93_0x41b7,_0x30eb08=await listDatasets(_0x28dd82,{'name':_0xb162cf}),_0x4a07f7=_0xb162cf['toLowerCase'](),_0x35ce99=new Set(_0x30eb08[_0x573a08(0x1c0)](_0x16d8ae=>_0x16d8ae['id'])),_0x5ccaba=_0x30eb08[_0x573a08(0x169)](_0x1cc134=>_0x1cc134[_0x573a08(0x15b)]?.[_0x573a08(0x1c2)]?.['toLowerCase']()['includes'](_0x4a07f7)||_0x1cc134[_0x573a08(0x193)]?.[_0x573a08(0x1a1)]()[_0x573a08(0x18a)](_0x4a07f7)),_0x1e1d62=await listDatasets(_0x28dd82,{'code':_0xb162cf});for(const _0x28c90b of _0x1e1d62){!_0x35ce99[_0x573a08(0x1b5)](_0x28c90b['id'])&&(_0x30eb08[_0x573a08(0x1c1)](_0x28c90b),_0x35ce99[_0x573a08(0x17e)](_0x28c90b['id']));}return _0x30eb08;}export function normalizeDatasetOperations(_0x7499ca){const _0x4940b8=a93_0x41b7;if(Array[_0x4940b8(0x1a9)](_0x7499ca))return _0x7499ca[_0x4940b8(0x169)](_0xe6e70=>_0xe6e70!=null&&typeof _0xe6e70==='object');if(_0x7499ca&&typeof _0x7499ca===_0x4940b8(0x1b9))return Object['entries'](_0x7499ca)[_0x4940b8(0x169)](([,_0x5461ac])=>_0x5461ac!=null&&typeof _0x5461ac==='object')[_0x4940b8(0x1c0)](([_0x34bca6,_0x3ef539])=>({..._0x3ef539,'name':_0x3ef539['name']??_0x3ef539[_0x4940b8(0x161)]??_0x34bca6}));return[];}export async function getDatasetDetail(_0x7efe7a){const _0x39f93a=a93_0x41b7,_0x275dfb=/^\d+$/[_0x39f93a(0x1b0)](_0x7efe7a)?'id':_0x39f93a(0x174),_0x34f86f=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x275dfb+'='+_0x7efe7a);return _0x34f86f[_0x39f93a(0x156)];}export async function getDatasetOperations(_0x343e3c){const _0x521965=a93_0x41b7,_0x866b1f=await getDatasetDetail(_0x343e3c),_0x3f4248=normalizeDatasetOperations(_0x866b1f[_0x521965(0x1a4)])['map'](_0x3494d2=>({'name':_0x3494d2[_0x521965(0x1b4)]||_0x3494d2[_0x521965(0x161)],'displayName':_0x3494d2[_0x521965(0x191)]||_0x3494d2['name'],'type':_0x3494d2['type'],'method':_0x3494d2[_0x521965(0x1bf)],'path':_0x3494d2[_0x521965(0x15a)],'enabled':_0x3494d2[_0x521965(0x1b3)]??!![],'requestFields':_0x3494d2[_0x521965(0x1c5)],'responseFields':_0x3494d2['responseFields']}));return{'dataset':{'id':_0x866b1f['id']??_0x866b1f[_0x521965(0x18e)],'name':_0x866b1f[_0x521965(0x1b4)],'code':_0x866b1f[_0x521965(0x174)]||_0x866b1f[_0x521965(0x1a3)],'tableName':_0x866b1f[_0x521965(0x1c2)]||_0x866b1f[_0x521965(0x15b)]?.[_0x521965(0x1c2)]},'operations':_0x3f4248};}export async function getOperationDetail(_0x4e8f2b,_0x4d42b1,_0x5165cd){const _0x1bf5cc=a93_0x41b7;let _0x147111=_0x4d42b1;if(!/^\d+$/['test'](_0x4d42b1)){const _0xc7a5aa=await listDatasets(_0x4e8f2b,{'code':_0x4d42b1}),_0x33f994=_0xc7a5aa[_0x1bf5cc(0x183)](_0x36b709=>_0x36b709[_0x1bf5cc(0x174)]===_0x4d42b1||String(_0x36b709['id'])===_0x4d42b1);if(!_0x33f994)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x185)+_0x4d42b1);_0x147111=String(_0x33f994['id']);}const _0x4dd589=await getDatasetDetail(_0x147111),_0x44e4=normalizeDatasetOperations(_0x4dd589[_0x1bf5cc(0x1a4)])['find'](_0x479797=>(_0x479797[_0x1bf5cc(0x1b4)]||_0x479797[_0x1bf5cc(0x161)])===_0x5165cd);if(!_0x44e4)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x1b7)+_0x5165cd+_0x1bf5cc(0x181)+_0x4d42b1);return{'dataset':{'id':_0x4dd589['id']??_0x4dd589[_0x1bf5cc(0x18e)],'name':_0x4dd589[_0x1bf5cc(0x1b4)],'code':_0x4dd589[_0x1bf5cc(0x174)]||_0x4dd589[_0x1bf5cc(0x1a3)],'tableName':_0x4dd589[_0x1bf5cc(0x1c2)]||_0x4dd589[_0x1bf5cc(0x15b)]?.[_0x1bf5cc(0x1c2)]},'operation':_0x44e4};}export function generateSdkCode(_0x46cef5,_0x37d355,_0x4a0a8b){const _0x38cceb=a93_0x41b7,_0x581a08=_0x4a0a8b?.['includeImports']??!![],_0x74b7e2=_0x38cceb(0x1b6)+_0x46cef5[_0x38cceb(0x174)]?.[_0x38cceb(0x190)](/-/g,'_'),_0x616fd3=_0x37d355[_0x38cceb(0x1b4)]||_0x37d355[_0x38cceb(0x161)]||_0x38cceb(0x169),_0x352ca8=[];_0x581a08&&_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x187),'',_0x38cceb(0x16a),'');_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1be)+_0x46cef5[_0x38cceb(0x1b4)]+'\x20('+(_0x46cef5[_0x38cceb(0x1c2)]||_0x38cceb(0x167))+')');if(_0x616fd3===_0x38cceb(0x169))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x1b2),'\x20\x20where:\x20{},',_0x38cceb(0x184),_0x38cceb(0x159),_0x38cceb(0x1ce));else{if(_0x616fd3==='getOne')_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x15f));else{if(_0x616fd3===_0x38cceb(0x1c6))_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x16f));else{if(_0x616fd3===_0x38cceb(0x16e))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x180));else _0x616fd3==='delete'||_0x616fd3===_0x38cceb(0x178)?_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x1bc)):_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+'.'+_0x616fd3+_0x38cceb(0x196));}}}return _0x352ca8[_0x38cceb(0x17f)]('\x0a');}export function generateSqlCodeTemplate(_0x139c17,_0x1aedbc){const _0x35331d=a93_0x41b7,_0x162abc=_0x1aedbc?.[_0x35331d(0x16b)]??_0x35331d(0x1b8),_0x3d9b7d=_0x1aedbc?.[_0x35331d(0x19b)]??!![],_0x1cebe8=[];return _0x1cebe8['push'](_0x35331d(0x19e)+_0x139c17['sqlName']+'\x20('+_0x139c17[_0x35331d(0x171)]+')'),_0x162abc===_0x35331d(0x1b8)?(_0x3d9b7d&&_0x1cebe8['push'](_0x35331d(0x187),'',_0x35331d(0x16a),''),_0x1cebe8[_0x35331d(0x1c1)](_0x35331d(0x1a0),'\x20\x20sqlCode:\x20\x27'+_0x139c17[_0x35331d(0x171)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x35331d(0x1ce),_0x35331d(0x19a),_0x35331d(0x1ae))):_0x1cebe8['push'](_0x35331d(0x1a5),_0x35331d(0x1bd),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x35331d(0x166)+_0x139c17['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x35331d(0x1c8),'}'),_0x1cebe8[_0x35331d(0x17f)]('\x0a');}export async function getErConfig(_0x415b6f,_0x1a30bf){const _0x2043f6=a93_0x41b7,_0x3d8750=await apiRequest(_0x2043f6(0x172),{'method':'POST','body':{'appCode':_0x415b6f,'dblinkId':_0x1a30bf}});return _0x3d8750[_0x2043f6(0x156)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x307362=a93_0x41b7,_0x3bd339=await apiRequest(_0x307362(0x1a6),{'method':_0x307362(0x1a7),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x8cae10=extractList(_0x3bd339[_0x307362(0x156)]),_0x25347e=extractPaging(_0x3bd339[_0x307362(0x156)]);return _0x25347e&&_0x25347e[_0x307362(0x19c)]>REMOTE_APP_PAGE_SIZE&&console[_0x307362(0x165)](_0x307362(0x17a)+REMOTE_APP_PAGE_SIZE+_0x307362(0x1aa)+_0x25347e[_0x307362(0x19c)]+_0x307362(0x175)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x8cae10;}
1
+ (function(_0x17cded,_0x332034){const _0x4e78fa=a108_0x4602,_0x453f56=_0x17cded();while(!![]){try{const _0x5a1fa1=-parseInt(_0x4e78fa(0xaf))/0x1+parseInt(_0x4e78fa(0xb0))/0x2+-parseInt(_0x4e78fa(0xca))/0x3+parseInt(_0x4e78fa(0xf3))/0x4*(-parseInt(_0x4e78fa(0xd0))/0x5)+parseInt(_0x4e78fa(0xf8))/0x6*(parseInt(_0x4e78fa(0xcd))/0x7)+parseInt(_0x4e78fa(0xe9))/0x8+parseInt(_0x4e78fa(0x97))/0x9;if(_0x5a1fa1===_0x332034)break;else _0x453f56['push'](_0x453f56['shift']());}catch(_0x26d695){_0x453f56['push'](_0x453f56['shift']());}}}(a108_0x3159,0x3a773));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(_0xea965b){_activeCookie=_0xea965b||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x2d1147,_0x36904d={}){const _0x496ce5=a108_0x4602,{method:method=_0x496ce5(0x9e),body:_0x587473,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x36904d,_0x4eb5b6=useRuntime?getRuntimeDomain():getApiDomain(),_0x231e53=_activeCookie||getCookie(),_0x559e03=''+_0x4eb5b6+_0x2d1147,_0x28bc31=new AbortController(),_0x2c61fe=setTimeout(()=>_0x28bc31['abort'](),timeout);try{const _0x18bac2=await fetch(_0x559e03,{'method':method,'headers':{'Content-Type':_0x496ce5(0xfb),'Cookie':_0x231e53,'X-Invoke-Source':_0x496ce5(0xb3),...headers},'body':_0x587473?JSON[_0x496ce5(0x9b)](_0x587473):undefined,'signal':_0x28bc31[_0x496ce5(0xdb)]});let _0x1e5a28;try{_0x1e5a28=await _0x18bac2['json']();}catch{throw CliErrors['apiError'](_0x496ce5(0xec)+_0x18bac2[_0x496ce5(0x8a)]+')',_0x18bac2[_0x496ce5(0x8a)]>=0x190?_0x496ce5(0xe0):undefined);}if(!_0x18bac2['ok']||_0x1e5a28[_0x496ce5(0xc3)]===![])throw CliErrors[_0x496ce5(0x8f)](_0x1e5a28[_0x496ce5(0xdc)]||_0x1e5a28[_0x496ce5(0xa3)]||'API\x20error:\x20'+_0x18bac2['status'],_0x1e5a28[_0x496ce5(0x9f)]?_0x496ce5(0xc0)+_0x1e5a28[_0x496ce5(0x9f)]:undefined);return _0x1e5a28;}catch(_0x677827){if(_0x677827 instanceof Error&&_0x677827[_0x496ce5(0xa6)]==='AbortError')throw CliErrors[_0x496ce5(0x8f)](_0x496ce5(0xf6)+_0x559e03);throw _0x677827;}finally{clearTimeout(_0x2c61fe);}}function isAuthFailure(_0x51b326){const _0x30be14=a108_0x4602,_0x37f278=_0x51b326[_0x30be14(0xdc)]||_0x51b326['message']||_0x51b326[_0x30be14(0xd3)]?.[_0x30be14(0xa3)]||_0x51b326['errorMessage']||_0x51b326['error']||'';return _0x51b326[_0x30be14(0x9f)]===_0x30be14(0x91)||_0x51b326['code']===0x191||_0x51b326[_0x30be14(0xd2)]===_0x30be14(0xee)||_0x37f278[_0x30be14(0xba)]('401')||_0x37f278['includes'](_0x30be14(0xd8))||_0x37f278['includes']('登录')||_0x37f278[_0x30be14(0xba)]('认证');}export async function platformFetch(_0x377612,_0x3fdc35){const _0xe08dbd=a108_0x4602,_0x510580=await fetch(_0x377612,{'method':_0x3fdc35['method']??'GET','headers':{'Content-Type':_0xe08dbd(0xfb),'Cookie':_0x3fdc35[_0xe08dbd(0xe2)]},..._0x3fdc35['body']&&{'body':JSON['stringify'](_0x3fdc35[_0xe08dbd(0xe5)])}});if(!_0x510580['ok']){if(_0x510580['status']===0x191)throw CliErrors[_0xe08dbd(0xef)]();throw CliErrors[_0xe08dbd(0x8f)](_0x3fdc35[_0xe08dbd(0xd9)]+_0xe08dbd(0x8b)+_0x510580[_0xe08dbd(0x8a)]);}const _0x5c521d=await _0x510580['json']();if(_0x5c521d['success']===![]){if(isAuthFailure(_0x5c521d))throw CliErrors['authRequired']();throw CliErrors['apiError'](_0x5c521d[_0xe08dbd(0xdc)]||_0x5c521d['message']||_0x3fdc35[_0xe08dbd(0xd9)]+'\x20failed');}return _0x5c521d['data'];}export async function listBffScripts(_0x37484a,_0x4570fc,_0x562f35){const _0x280daf=a108_0x4602;let _0x24b8a8=_0x280daf(0xae)+_0x37484a;if(_0x4570fc)_0x24b8a8+=_0x280daf(0x8e)+_0x4570fc;const _0x58b279=await apiRequest(_0x24b8a8);let _0xd13fae=extractList(_0x58b279['data']);if(_0x562f35?.[_0x280daf(0xb7)]){const _0x981e10=_0x562f35[_0x280daf(0xb7)]['toLowerCase']();_0xd13fae=_0xd13fae[_0x280daf(0xc8)](_0x5b80b1=>_0x5b80b1['functionName']?.[_0x280daf(0x80)]()[_0x280daf(0xba)](_0x981e10)||_0x5b80b1['description']?.[_0x280daf(0x80)]()[_0x280daf(0xba)](_0x981e10));}return _0xd13fae;}export async function getBffScriptInfo(_0x4660a8){const _0x453a3c=a108_0x4602,_0x5c9816=await apiRequest(_0x453a3c(0xc1)+_0x4660a8);if(!_0x5c9816['data'])throw CliErrors[_0x453a3c(0x84)](_0x453a3c(0xa9)+_0x4660a8);return _0x5c9816[_0x453a3c(0xd3)];}export async function saveBffScript(_0x7fd2a2){const _0x39fb2a=a108_0x4602,_0x50a11f=await apiRequest('/api/management/library/scripts/save',{'method':_0x39fb2a(0x95),'body':_0x7fd2a2});return _0x50a11f[_0x39fb2a(0xd3)];}export async function deleteBffScript(_0x8ee4f1){const _0x4085e1=a108_0x4602;await apiRequest('/api/management/library/scripts/delete',{'method':_0x4085e1(0x95),'body':{'id':_0x8ee4f1}});}export async function getBffScriptStatistics(_0x1a3f95){const _0x2862a9=a108_0x4602,_0x1aad48=await apiRequest(_0x2862a9(0xd5)+_0x1a3f95);return extractList(_0x1aad48['data']);}export async function listBffDatasetOperations(_0x40d6ab,_0x136743){const _0x87fdd7=a108_0x4602,_0x1c4f8a=await apiRequest(_0x87fdd7(0xcc),{'method':_0x87fdd7(0x95),'body':{'appCode':_0x40d6ab,'datasetId':_0x136743}});return _0x1c4f8a[_0x87fdd7(0xd3)];}export async function listSqlQueries(_0x5882e8,_0x57c164){const _0xd2b205=a108_0x4602,_0x5f5b61=await apiRequest(_0xd2b205(0x8c),{'method':_0xd2b205(0x95),'body':{'appCode':_0x5882e8,'currentPage':_0x57c164?.[_0xd2b205(0xf2)]??0x1,'pageSize':_0x57c164?.[_0xd2b205(0xbe)]??0x32,'sqlCode':_0x57c164?.[_0xd2b205(0x81)],'sqlName':_0x57c164?.['sqlName']}});return _0x5f5b61[_0xd2b205(0xd3)];}export async function getSqlQueryInfo(_0x26fee4,_0x48f7ab){const _0x36fe7e=a108_0x4602,_0x3a9532=await listSqlQueries(_0x26fee4,{'sqlCode':_0x48f7ab}),_0x480287=_0x3a9532['tableData']?.[0x0];if(!_0x480287)throw CliErrors[_0x36fe7e(0x84)](_0x36fe7e(0xd1)+_0x48f7ab);return _0x480287;}export async function saveSqlQuery(_0x90e5f6){const _0x41547d=a108_0x4602,_0x219c95=await apiRequest(_0x41547d(0xd4),{'method':_0x41547d(0x95),'body':_0x90e5f6});return _0x219c95[_0x41547d(0xd3)];}export async function executeSql(_0x50a6cd,_0xc6b516,_0x168642){const _0x20ba8e=a108_0x4602,_0x50749a=await apiRequest(_0x20ba8e(0xa2),{'method':_0x20ba8e(0x95),'body':{'appCode':_0x50a6cd,'sqlCode':_0xc6b516,..._0x168642&&{'params':_0x168642}},'useRuntime':!![]});return _0x50749a['data'];}export async function listDatasets(_0x4ec6f2,_0x400c00){const _0xca87f=a108_0x4602,_0x1dbcf9={'appCode':_0x4ec6f2,'deleted':![]};if(_0x400c00?.['code'])_0x1dbcf9[_0xca87f(0xd2)]=_0x400c00[_0xca87f(0xd2)];if(_0x400c00?.[_0xca87f(0xa6)])_0x1dbcf9[_0xca87f(0xa6)]=_0x400c00['name'];const _0x3452c5=await apiRequest(_0xca87f(0xb1),{'method':_0xca87f(0x95),'body':_0x1dbcf9});return extractList(_0x3452c5[_0xca87f(0xd3)]);}export async function searchDatasets(_0x569917,_0x2aaebd){const _0x4f7930=a108_0x4602,_0x46eea2=await listDatasets(_0x569917,{'name':_0x2aaebd}),_0x471048=_0x2aaebd[_0x4f7930(0x80)](),_0x1de341=new Set(_0x46eea2['map'](_0x2a4478=>_0x2a4478['id'])),_0x2ad86c=_0x46eea2[_0x4f7930(0xc8)](_0x4c1904=>_0x4c1904[_0x4f7930(0xe8)]?.['tableName']?.[_0x4f7930(0x80)]()[_0x4f7930(0xba)](_0x471048)||_0x4c1904['description']?.[_0x4f7930(0x80)]()[_0x4f7930(0xba)](_0x471048)),_0x37917f=await listDatasets(_0x569917,{'code':_0x2aaebd});for(const _0x43216e of _0x37917f){!_0x1de341[_0x4f7930(0xfd)](_0x43216e['id'])&&(_0x46eea2[_0x4f7930(0xa8)](_0x43216e),_0x1de341[_0x4f7930(0xe7)](_0x43216e['id']));}return _0x46eea2;}export function normalizeDatasetOperations(_0x1e1a38){const _0x35178c=a108_0x4602;if(Array[_0x35178c(0xe6)](_0x1e1a38))return _0x1e1a38['filter'](_0x8876b6=>_0x8876b6!=null&&typeof _0x8876b6==='object');if(_0x1e1a38&&typeof _0x1e1a38==='object')return Object['entries'](_0x1e1a38)[_0x35178c(0xc8)](([,_0x597b57])=>_0x597b57!=null&&typeof _0x597b57===_0x35178c(0xcb))['map'](([_0x22d0fc,_0x5eb52f])=>({..._0x5eb52f,'name':_0x5eb52f[_0x35178c(0xa6)]??_0x5eb52f[_0x35178c(0xb4)]??_0x22d0fc}));return[];}export async function getDatasetDetail(_0x275db8){const _0x5611d8=a108_0x4602,_0x54497f=/^\d+$/['test'](_0x275db8)?'id':'code',_0x3440eb=await apiRequest(_0x5611d8(0x8d)+_0x54497f+'='+_0x275db8);return _0x3440eb[_0x5611d8(0xd3)];}function a108_0x3159(){const _0x3673b1=['operations','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','toLowerCase','sqlCode','displayName','tableName','validation','\x20\x20where:\x20{},','\x20\x20\x20\x20sqlCode:\x20\x27','entries','find','update','status','\x20failed,\x20HTTP\x20','/smartapi/custom/queryUserCustomSqlList','/smartapi/dataset/get-driven-data?','&type=','apiError','enabled','UNAUTHORIZED','/smartapi/db-analysis/start','target','\x20\x20});','POST','method','8256825BnyRAc','/smartapi/dblink/getList','create','\x20\x20sqlCode:\x20\x27','stringify','dataset_','pageIndex','GET','errorCode','\x20\x20return\x20rows;','Operation\x20\x22','/api/custom/executeSql','message','modelId','Warning:\x20showing\x20first\x20','name','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','push','BFF\x20script\x20not\x20found:\x20id=','\x20apps.\x20','table','\x20\x20currentPage:\x201,','responseFields','/api/management/library/scripts/list?appCode=','333726EMQNTk','272026RuetPl','/smartapi/dataset/get-dataset-list','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','cli:rabetbase','operationName','modelCode','join','scriptName','type','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','includes','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','sqlName','\x20of\x20','pageSize','warn','API\x20error\x20code:\x20','/api/management/library/scripts/info?id=','toString','success','map','.create({\x20/*\x20fields\x20*/\x20});','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','const\x20result\x20=\x20await\x20client.models.','filter','replace','782622ZcAFAf','object','/smartapi/dataset/get-dataset-operation','7RlidAY','getOne','/smartapi/question/er-config','1592330dQXNFz','SQL\x20query\x20not\x20found:\x20','code','data','/api/node-toolbox/sql/save','/api/management/library/scripts/statistics?appCode=','planId','\x20\x20pageSize:\x2020,','Unauthorized','label','.remove(id);','signal','errorMsg','/smartapi/dblink/getOne','length','\x22\x20not\x20found\x20in\x20dataset\x20','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','});','cookie','delete','totalCount','body','isArray','add','dbtableConfig','782872TAYygP','/smartapi/dblink/testConnect','/smartapi/db-analysis/status/','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','sdk','401','authRequired','/smartapi/app/getList','/smartapi/dblink/delete','currentPage','4fOuskY','//\x20','/smartapi/dblink/create','Request\x20timeout:\x20','.getOne(id);','7464VWbuLu','requestFields','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','application/json','string','has','/smartapi/dblink/update'];a108_0x3159=function(){return _0x3673b1;};return a108_0x3159();}export async function getDatasetOperations(_0x382031){const _0x4ce77c=a108_0x4602,_0x25ec38=await getDatasetDetail(_0x382031),_0x3c2ee2=normalizeDatasetOperations(_0x25ec38[_0x4ce77c(0xff)])[_0x4ce77c(0xc4)](_0x7f7ac3=>({'name':_0x7f7ac3[_0x4ce77c(0xa6)]||_0x7f7ac3['operationName'],'displayName':_0x7f7ac3[_0x4ce77c(0x82)]||_0x7f7ac3[_0x4ce77c(0xa6)],'type':_0x7f7ac3[_0x4ce77c(0xb8)],'method':_0x7f7ac3[_0x4ce77c(0x96)],'path':_0x7f7ac3['path'],'enabled':_0x7f7ac3[_0x4ce77c(0x90)]??!![],'requestFields':_0x7f7ac3[_0x4ce77c(0xf9)],'responseFields':_0x7f7ac3[_0x4ce77c(0xad)]}));return{'dataset':{'id':_0x25ec38['id']??_0x25ec38[_0x4ce77c(0xa4)],'name':_0x25ec38[_0x4ce77c(0xa6)],'code':_0x25ec38[_0x4ce77c(0xd2)]||_0x25ec38[_0x4ce77c(0xb5)],'tableName':_0x25ec38[_0x4ce77c(0x83)]||_0x25ec38['dbtableConfig']?.[_0x4ce77c(0x83)]},'operations':_0x3c2ee2};}export async function getOperationDetail(_0x26a1d6,_0x4e6f7b,_0x27a27c){const _0x5254ef=a108_0x4602;let _0x5b9233=_0x4e6f7b;if(!/^\d+$/['test'](_0x4e6f7b)){const _0x13179e=await listDatasets(_0x26a1d6,{'code':_0x4e6f7b}),_0x2b5797=_0x13179e[_0x5254ef(0x88)](_0x201122=>_0x201122[_0x5254ef(0xd2)]===_0x4e6f7b||String(_0x201122['id'])===_0x4e6f7b);if(!_0x2b5797)throw CliErrors[_0x5254ef(0x84)]('Dataset\x20not\x20found:\x20'+_0x4e6f7b);_0x5b9233=String(_0x2b5797['id']);}const _0x38f2d3=await getDatasetDetail(_0x5b9233),_0x3d4331=normalizeDatasetOperations(_0x38f2d3[_0x5254ef(0xff)])[_0x5254ef(0x88)](_0x56b599=>(_0x56b599[_0x5254ef(0xa6)]||_0x56b599[_0x5254ef(0xb4)])===_0x27a27c);if(!_0x3d4331)throw CliErrors[_0x5254ef(0x84)](_0x5254ef(0xa1)+_0x27a27c+_0x5254ef(0xdf)+_0x4e6f7b);return{'dataset':{'id':_0x38f2d3['id']??_0x38f2d3['modelId'],'name':_0x38f2d3[_0x5254ef(0xa6)],'code':_0x38f2d3['code']||_0x38f2d3[_0x5254ef(0xb5)],'tableName':_0x38f2d3['tableName']||_0x38f2d3[_0x5254ef(0xe8)]?.[_0x5254ef(0x83)]},'operation':_0x3d4331};}export function generateSdkCode(_0x505afc,_0x2dca88,_0x3fb0e5){const _0x130556=a108_0x4602,_0x21040f=_0x3fb0e5?.['includeImports']??!![],_0x4a9472=_0x130556(0x9c)+_0x505afc[_0x130556(0xd2)]?.[_0x130556(0xc9)](/-/g,'_'),_0x58a920=_0x2dca88[_0x130556(0xa6)]||_0x2dca88[_0x130556(0xb4)]||_0x130556(0xc8),_0x4088e1=[];_0x21040f&&_0x4088e1[_0x130556(0xa8)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x130556(0xbb),'');_0x4088e1['push'](_0x130556(0xf4)+_0x505afc[_0x130556(0xa6)]+'\x20('+(_0x505afc[_0x130556(0x83)]||_0x130556(0xab))+')');if(_0x58a920===_0x130556(0xc8))_0x4088e1[_0x130556(0xa8)](_0x130556(0xc7)+_0x4a9472+'.filter({',_0x130556(0x85),_0x130556(0xd7),_0x130556(0xac),_0x130556(0xe1));else{if(_0x58a920===_0x130556(0xce))_0x4088e1['push'](_0x130556(0xc7)+_0x4a9472+_0x130556(0xf7));else{if(_0x58a920===_0x130556(0x99))_0x4088e1[_0x130556(0xa8)]('const\x20result\x20=\x20await\x20client.models.'+_0x4a9472+_0x130556(0xc5));else{if(_0x58a920===_0x130556(0x89))_0x4088e1[_0x130556(0xa8)](_0x130556(0xc7)+_0x4a9472+_0x130556(0xb2));else _0x58a920===_0x130556(0xe3)||_0x58a920==='remove'?_0x4088e1['push'](_0x130556(0xc7)+_0x4a9472+_0x130556(0xda)):_0x4088e1[_0x130556(0xa8)]('const\x20result\x20=\x20await\x20client.models.'+_0x4a9472+'.'+_0x58a920+'(/*\x20params\x20*/);');}}}return _0x4088e1[_0x130556(0xb6)]('\x0a');}export function generateSqlCodeTemplate(_0x354129,_0x42f757){const _0x4ac000=a108_0x4602,_0x3c6554=_0x42f757?.[_0x4ac000(0x93)]??'sdk',_0x4a173b=_0x42f757?.['includeImports']??!![],_0x536f9d=[];return _0x536f9d['push']('//\x20SQL:\x20'+_0x354129[_0x4ac000(0xbc)]+'\x20('+_0x354129[_0x4ac000(0x81)]+')'),_0x3c6554===_0x4ac000(0xed)?(_0x4a173b&&_0x536f9d[_0x4ac000(0xa8)](_0x4ac000(0xb9),'',_0x4ac000(0xbb),''),_0x536f9d['push']('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4ac000(0x9a)+_0x354129['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x4ac000(0xe1),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x536f9d[_0x4ac000(0xa8)](_0x4ac000(0xa7),_0x4ac000(0xc6),_0x4ac000(0x7f),_0x4ac000(0x86)+_0x354129[_0x4ac000(0x81)]+'\x27,',_0x4ac000(0xfa),_0x4ac000(0x94),_0x4ac000(0xa0),'}'),_0x536f9d[_0x4ac000(0xb6)]('\x0a');}export async function getErConfig(_0x4c1405,_0x41dc14){const _0x517750=a108_0x4602,_0xf3eea3=await apiRequest(_0x517750(0xcf),{'method':'POST','body':{'appCode':_0x4c1405,'dblinkId':_0x41dc14}});return _0xf3eea3[_0x517750(0xd3)];}function buildQuery(_0x419b9b){const _0x374c12=a108_0x4602,_0x53e6d6=new URLSearchParams();for(const [_0x2e88e1,_0x4f4373]of Object[_0x374c12(0x87)](_0x419b9b)){if(_0x4f4373===undefined||_0x4f4373==='')continue;_0x53e6d6['set'](_0x2e88e1,String(_0x4f4373));}const _0xadbac6=_0x53e6d6[_0x374c12(0xc2)]();return _0xadbac6?'?'+_0xadbac6:'';}export async function listDbLinks(_0x2e6d58,_0x3fb1e8){const _0x18703d=a108_0x4602,_0x5cc36a=await apiRequest(_0x18703d(0x98),{'method':'POST','body':{'appCode':_0x2e6d58,'currentPage':_0x3fb1e8?.[_0x18703d(0xf2)]??0x1,'pageSize':_0x3fb1e8?.[_0x18703d(0xbe)]??0x64}});return{'items':extractList(_0x5cc36a[_0x18703d(0xd3)]),'paging':extractPaging(_0x5cc36a[_0x18703d(0xd3)])};}export async function getDbLinkInfo(_0x595dbd){const _0x5cb325=a108_0x4602,_0x362b61=await apiRequest(_0x5cb325(0xdd)+buildQuery({'id':_0x595dbd}));return _0x362b61[_0x5cb325(0xd3)];}export async function createDbLink(_0x10c0f7){const _0xfda180=a108_0x4602,_0x36c247=await apiRequest(_0xfda180(0xf5),{'method':_0xfda180(0x95),'body':_0x10c0f7});return _0x36c247[_0xfda180(0xd3)];}export async function updateDbLink(_0x214de5){const _0xd7e7b1=a108_0x4602,_0x4afda4=await apiRequest(_0xd7e7b1(0xfe),{'method':_0xd7e7b1(0x95),'body':_0x214de5});return _0x4afda4[_0xd7e7b1(0xd3)];}export async function deleteDbLink(_0x5e2b85){const _0xff8d67=a108_0x4602;await apiRequest(_0xff8d67(0xf1),{'method':'POST','body':{'id':_0x5e2b85}});}export async function testDbLinkConnect(_0x5f541b){const _0x4b3c21=a108_0x4602,_0x2dbad6=await apiRequest(_0x4b3c21(0xea)+buildQuery({'id':_0x5f541b}));return _0x2dbad6[_0x4b3c21(0xd3)];}export async function startDbAnalysis(_0x35577f,_0x2e267e){const _0x24d004=a108_0x4602,_0x3b66d4=await apiRequest(_0x24d004(0x92),{'method':_0x24d004(0x95),'body':{'dbLinkId':_0x35577f,..._0x2e267e&&_0x2e267e[_0x24d004(0xde)]>0x0?{'tableNames':_0x2e267e}:{}}}),_0x25d4e5=_0x3b66d4[_0x24d004(0xd3)];if(typeof _0x25d4e5==='string')return _0x25d4e5;if(_0x25d4e5&&typeof _0x25d4e5===_0x24d004(0xcb)&&typeof _0x25d4e5[_0x24d004(0xd6)]===_0x24d004(0xfc))return _0x25d4e5['planId'];return _0x25d4e5!=null?String(_0x25d4e5):'';}export async function cancelDbAnalysis(_0x58d761){const _0x38b61c=a108_0x4602;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x58d761}),{'method':_0x38b61c(0x95)});}function a108_0x4602(_0x401e2c,_0x3513cf){_0x401e2c=_0x401e2c-0x7f;const _0x3159fc=a108_0x3159();let _0x4602c9=_0x3159fc[_0x401e2c];return _0x4602c9;}export async function getDbAnalysisStatus(_0x9cd68d){const _0x485e6d=a108_0x4602,_0x6fcf2d=await apiRequest(_0x485e6d(0xeb)+encodeURIComponent(_0x9cd68d));return _0x6fcf2d['data'];}export async function getDbAllTableList(_0x3bffd4,_0x20257b){const _0x1423e4=a108_0x4602,_0x26da7e=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x3bffd4,'dbLinkId':_0x20257b})),_0x4abc10=_0x26da7e[_0x1423e4(0xd3)];if(Array[_0x1423e4(0xe6)](_0x4abc10))return _0x4abc10;return extractList(_0x4abc10);}export async function getDbTableDiff(_0x55c76d,_0x228a1a,_0x5104f1){const _0x1ce78d=a108_0x4602,_0x4a4c4d=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x55c76d,'dbLinkId':_0x228a1a,'pageIndex':_0x5104f1?.[_0x1ce78d(0x9d)]??0x1,'pageSize':_0x5104f1?.['pageSize']??0x14,'tableName':_0x5104f1?.['tableName']})),_0x1727a1=_0x4a4c4d[_0x1ce78d(0xd3)];return{'totalCount':_0x1727a1?.[_0x1ce78d(0xe4)]??0x0,'tableList':Array[_0x1ce78d(0xe6)](_0x1727a1?.['tableList'])?_0x1727a1['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x47d4d5=a108_0x4602,_0x15caf5=await apiRequest(_0x47d4d5(0xf0),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x17185c=extractList(_0x15caf5[_0x47d4d5(0xd3)]),_0xa1ddd2=extractPaging(_0x15caf5['data']);return _0xa1ddd2&&_0xa1ddd2['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x47d4d5(0xbf)](_0x47d4d5(0xa5)+REMOTE_APP_PAGE_SIZE+_0x47d4d5(0xbd)+_0xa1ddd2[_0x47d4d5(0xe4)]+_0x47d4d5(0xaa)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x17185c;}
@@ -1 +1 @@
1
- function a94_0xb064(_0x2012b0,_0x26c50b){_0x2012b0=_0x2012b0-0x1d1;const _0x3943af=a94_0x3943();let _0xb06466=_0x3943af[_0x2012b0];return _0xb06466;}function a94_0x3943(){const _0x1a738c=['1819350SIkQAi','1366320lYVHgQ','4670PmbuhC','18uXkEBq','bff-trash','.rabetbase','bff.lock.json','7KdazOr','cwd','/bff','7lrSivK','3428424XPBlFQ','7371630KHoSji','bff','25586OGryIw','3515168uVotqK','6782jCgALK'];a94_0x3943=function(){return _0x1a738c;};return a94_0x3943();}const a94_0x3cee22=a94_0xb064;(function(_0x5e0b25,_0x10752f){const _0x4bd037=a94_0xb064,_0x5daa9e=_0x5e0b25();while(!![]){try{const _0x1744b3=-parseInt(_0x4bd037(0x1e0))/0x1*(parseInt(_0x4bd037(0x1d8))/0x2)+parseInt(_0x4bd037(0x1d9))/0x3+parseInt(_0x4bd037(0x1d7))/0x4+parseInt(_0x4bd037(0x1da))/0x5*(-parseInt(_0x4bd037(0x1dc))/0x6)+-parseInt(_0x4bd037(0x1d2))/0x7*(parseInt(_0x4bd037(0x1d3))/0x8)+-parseInt(_0x4bd037(0x1d4))/0x9+-parseInt(_0x4bd037(0x1db))/0xa*(-parseInt(_0x4bd037(0x1d6))/0xb);if(_0x1744b3===_0x10752f)break;else _0x5daa9e['push'](_0x5daa9e['shift']());}catch(_0x284f26){_0x5daa9e['push'](_0x5daa9e['shift']());}}}(a94_0x3943,0x7544c));import{resolve}from'node:path';const DOT_DIR=a94_0x3cee22(0x1de),LOCK_FILE_NAME=a94_0x3cee22(0x1df),TRASH_DIR_NAME=a94_0x3cee22(0x1dd);export function loadBffProjectConfig(_0x3e5639,_0x486920){const _0x4f2f54=a94_0x3cee22,_0x461f59=resolve(_0x486920??process[_0x4f2f54(0x1e1)]()),_0x3b85b1=DOT_DIR+_0x4f2f54(0x1d1),_0x11e57e=_0x3b85b1+'/'+_0x3e5639;return{'projectRoot':_0x461f59,'appCode':_0x3e5639,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3b85b1,'scriptsRoot':_0x11e57e,'scriptsRootDir':resolve(_0x461f59,DOT_DIR,_0x4f2f54(0x1d5),_0x3e5639),'lockFilePath':resolve(_0x461f59,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x461f59,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a109_0x4e5654=a109_0x2aa1;(function(_0x4c2eba,_0x3ca0ef){const _0x47a34f=a109_0x2aa1,_0x5b3fcf=_0x4c2eba();while(!![]){try{const _0x35a142=parseInt(_0x47a34f(0xc7))/0x1+-parseInt(_0x47a34f(0xc8))/0x2*(parseInt(_0x47a34f(0xc0))/0x3)+-parseInt(_0x47a34f(0xc4))/0x4*(-parseInt(_0x47a34f(0xc5))/0x5)+parseInt(_0x47a34f(0xca))/0x6*(-parseInt(_0x47a34f(0xbe))/0x7)+parseInt(_0x47a34f(0xbf))/0x8*(-parseInt(_0x47a34f(0xc9))/0x9)+-parseInt(_0x47a34f(0xc3))/0xa*(-parseInt(_0x47a34f(0xcb))/0xb)+-parseInt(_0x47a34f(0xc6))/0xc;if(_0x35a142===_0x3ca0ef)break;else _0x5b3fcf['push'](_0x5b3fcf['shift']());}catch(_0xc5c0ff){_0x5b3fcf['push'](_0x5b3fcf['shift']());}}}(a109_0x14f3,0x81c2d));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a109_0x14f3(){const _0x42f449=['1644810KDVEKJ','4desSyA','4310675nzyExI','7655832jfzHKp','841338zRhdEn','8914NTMEoP','91971SgSebu','54esSpnh','33tGbxwt','/bff','386575vFhkKC','328IOIeiT','75mSQhYU','bff-trash','bff.lock.json'];a109_0x14f3=function(){return _0x42f449;};return a109_0x14f3();}function a109_0x2aa1(_0x11fda0,_0x2a6e66){_0x11fda0=_0x11fda0-0xbd;const _0x14f3ab=a109_0x14f3();let _0x2aa1c9=_0x14f3ab[_0x11fda0];return _0x2aa1c9;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a109_0x4e5654(0xc2),TRASH_DIR_NAME=a109_0x4e5654(0xc1);export function loadBffProjectConfig(_0x3c57b4,_0x18a2ed){const _0x101db2=a109_0x4e5654,_0x306163=resolve(_0x18a2ed??findProjectRootDirectory()),_0x20c882=DOT_DIR+_0x101db2(0xbd),_0x1da372=_0x20c882+'/'+_0x3c57b4;return{'projectRoot':_0x306163,'appCode':_0x3c57b4,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x20c882,'scriptsRoot':_0x1da372,'scriptsRootDir':resolve(_0x306163,DOT_DIR,'bff',_0x3c57b4),'lockFilePath':resolve(_0x306163,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x306163,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a95_0x286ad=a95_0x3606;(function(_0x132814,_0x489092){const _0x3f3fa4=a95_0x3606,_0x2804c8=_0x132814();while(!![]){try{const _0x165a7c=parseInt(_0x3f3fa4(0x137))/0x1*(-parseInt(_0x3f3fa4(0x132))/0x2)+-parseInt(_0x3f3fa4(0x14c))/0x3*(parseInt(_0x3f3fa4(0x13b))/0x4)+parseInt(_0x3f3fa4(0x139))/0x5+parseInt(_0x3f3fa4(0x14e))/0x6+-parseInt(_0x3f3fa4(0x12f))/0x7*(-parseInt(_0x3f3fa4(0x141))/0x8)+parseInt(_0x3f3fa4(0x143))/0x9+-parseInt(_0x3f3fa4(0x140))/0xa;if(_0x165a7c===_0x489092)break;else _0x2804c8['push'](_0x2804c8['shift']());}catch(_0xc15be6){_0x2804c8['push'](_0x2804c8['shift']());}}}(a95_0x1ff9,0xac811));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a95_0x1ff9(){const _0xabb06b=['functionName','set','endsWith','code','all','get','trim','6261HnldTD','after','6872532CKdljK','isFile','COMMON','HOOK/','before','replace','name','2821721vGjNVM','HOOK','isDirectory','4154RiAIQW','toUpperCase','push','scriptsRootDir','split','251LRIVvk','operationType','3795450bARgYR','functionNode','180BYTxKS','datasetCode','map','ENDPOINT','includes','21229170vfyIdN','24FeYVCH','alias','2978235DhlooD','afterScriptId'];a95_0x1ff9=function(){return _0xabb06b;};return a95_0x1ff9();}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a95_0x286ad(0x150),a95_0x286ad(0x13e),a95_0x286ad(0x130)];export function normalizeBffType(_0x481d29){const _0x2a0451=a95_0x286ad;if(!_0x481d29)return undefined;const _0x3bbbd5=_0x481d29[_0x2a0451(0x14b)]()[_0x2a0451(0x133)]();return SUPPORTED_BFF_TYPES[_0x2a0451(0x13f)](_0x3bbbd5)?_0x3bbbd5:undefined;}function a95_0x3606(_0x36cac3,_0x6e6f1){_0x36cac3=_0x36cac3-0x12e;const _0x1ff98c=a95_0x1ff9();let _0x360643=_0x1ff98c[_0x36cac3];return _0x360643;}async function scanJsFilesRecursively(_0x48f83f,_0x207410){const _0x29dd24=a95_0x286ad,_0x301207=[];try{const _0x2c098b=await readdir(_0x48f83f,{'withFileTypes':!![]});for(const _0x42df48 of _0x2c098b){const _0x4c6102=join(_0x48f83f,_0x42df48['name']);if(_0x42df48['isDirectory']())_0x301207[_0x29dd24(0x134)](...await scanJsFilesRecursively(_0x4c6102,_0x207410+'/'+_0x42df48[_0x29dd24(0x12e)]));else _0x42df48[_0x29dd24(0x14f)]()&&_0x42df48[_0x29dd24(0x12e)][_0x29dd24(0x147)]('.js')&&_0x301207[_0x29dd24(0x134)]({'lockKey':_0x207410+'/'+_0x42df48['name'][_0x29dd24(0x153)](/\.js$/,''),'filePath':_0x4c6102});}}catch(_0xa3f3){if(_0xa3f3[_0x29dd24(0x148)]!=='ENOENT')throw _0xa3f3;}return _0x301207;}async function scanFlatFunctions(_0x3f008e,_0x4f2a90){const _0x4d2fcc=a95_0x286ad,_0x33f9f9=join(_0x3f008e[_0x4d2fcc(0x135)],_0x4f2a90),_0xf68b4e=await scanJsFilesRecursively(_0x33f9f9,_0x4f2a90);return _0xf68b4e[_0x4d2fcc(0x13d)](({lockKey:_0x29f532,filePath:_0x560f20})=>({'type':_0x4f2a90,'name':_0x29f532[_0x4d2fcc(0x136)]('/')['at'](-0x1)??'','filePath':_0x560f20,'lockKey':_0x29f532}));}async function scanHookFunctions(_0x4c9f82){const _0x38e15f=a95_0x286ad,_0x6944ff=join(_0x4c9f82[_0x38e15f(0x135)],_0x38e15f(0x130)),_0x239acb=[];try{const _0x183a5=await readdir(_0x6944ff,{'withFileTypes':!![]});for(const _0x1939db of _0x183a5){if(!_0x1939db['isDirectory']())continue;const _0x3a8769=_0x1939db[_0x38e15f(0x12e)],_0x557d62=join(_0x6944ff,_0x3a8769),_0xb3b13=await readdir(_0x557d62,{'withFileTypes':!![]});for(const _0x26bd98 of _0xb3b13){if(!_0x26bd98[_0x38e15f(0x131)]())continue;const _0x34075a=_0x26bd98[_0x38e15f(0x12e)],_0x488e4d=join(_0x557d62,_0x34075a),_0x1338ba=await readdir(_0x488e4d,{'withFileTypes':!![]});for(const _0x4fa1f8 of _0x1338ba){if(!_0x4fa1f8[_0x38e15f(0x131)]())continue;const _0x38743f=_0x4fa1f8[_0x38e15f(0x12e)],_0x2cf3cc=join(_0x488e4d,_0x38743f),_0x4be6e0=await readdir(_0x2cf3cc,{'withFileTypes':!![]});for(const _0x150831 of _0x4be6e0){if(!_0x150831['isFile']()||!_0x150831[_0x38e15f(0x12e)][_0x38e15f(0x147)]('.js'))continue;const _0x3ff65c=_0x150831[_0x38e15f(0x12e)]['replace'](/\.js$/,'');_0x239acb[_0x38e15f(0x134)]({'type':_0x38e15f(0x130),'name':_0x3ff65c,'filePath':join(_0x2cf3cc,_0x150831[_0x38e15f(0x12e)]),'lockKey':_0x38e15f(0x151)+_0x3a8769+'/'+_0x34075a+'/'+_0x38743f+'/'+_0x3ff65c,'alias':_0x3a8769,'operationType':_0x34075a,'functionNode':_0x38743f});}}}}}catch(_0x2486fa){if(_0x2486fa[_0x38e15f(0x148)]!=='ENOENT')throw _0x2486fa;}return _0x239acb;}export async function scanLocalBffFunctions(_0x12d4db,_0x4b899c){const _0x3e1af8=a95_0x286ad;if(_0x4b899c===_0x3e1af8(0x150)||_0x4b899c===_0x3e1af8(0x13e))return scanFlatFunctions(_0x12d4db,_0x4b899c);if(_0x4b899c===_0x3e1af8(0x130))return scanHookFunctions(_0x12d4db);const [_0x32d119,_0x16d29c,_0xf97a45]=await Promise[_0x3e1af8(0x149)]([scanFlatFunctions(_0x12d4db,_0x3e1af8(0x150)),scanFlatFunctions(_0x12d4db,_0x3e1af8(0x13e)),scanHookFunctions(_0x12d4db)]);return[..._0x32d119,..._0x16d29c,..._0xf97a45];}export function resolveLocalFilePathFromLockKey(_0x6c4cac,_0x3dd4d0){const _0x5c11c5=a95_0x286ad;return join(_0x6c4cac[_0x5c11c5(0x135)],..._0x3dd4d0[_0x5c11c5(0x136)]('/'))+'.js';}export function createHookLocationMap(_0x1f23c9){const _0x1d2915=a95_0x286ad,_0x43ee5b=new Map();for(const _0xf7004 of _0x1f23c9){_0xf7004['beforeScriptId']&&_0x43ee5b[_0x1d2915(0x146)](_0xf7004['beforeScriptId'],{'datasetCode':_0xf7004['datasetCode'],'operationType':snakeToCamel(_0xf7004[_0x1d2915(0x138)]),'functionNode':_0x1d2915(0x152)}),_0xf7004[_0x1d2915(0x144)]&&_0x43ee5b[_0x1d2915(0x146)](_0xf7004[_0x1d2915(0x144)],{'datasetCode':_0xf7004[_0x1d2915(0x13c)],'operationType':snakeToCamel(_0xf7004['operationType']),'functionNode':_0x1d2915(0x14d)});}return _0x43ee5b;}export function resolveRemoteScriptTarget(_0x2ebd4e,_0x2866e1,_0x1ade6a,_0x252dca,_0x2d066f){const _0x7b298b=a95_0x286ad,_0x5e0056=normalizeBffType(_0x2866e1['scriptType']);if(!_0x5e0056||!_0x2866e1[_0x7b298b(0x145)])return null;if(_0x5e0056==='HOOK'){const _0x4d325b=(_0x2866e1['id']?_0x1ade6a['get'](_0x2866e1['id']):undefined)??findHookLocationByRemoteId(_0x252dca,_0x2866e1['id']);if(!_0x4d325b)return null;const _0x49cd7a=_0x4d325b[_0x7b298b(0x142)]||_0x2d066f[_0x7b298b(0x14a)](_0x4d325b[_0x7b298b(0x13c)]),_0x237478=_0x49cd7a??_0x4d325b[_0x7b298b(0x13c)],_0x14d60a={..._0x4d325b,'alias':_0x49cd7a},_0x3075b1=_0x7b298b(0x151)+_0x237478+'/'+_0x14d60a[_0x7b298b(0x138)]+'/'+_0x14d60a[_0x7b298b(0x13a)]+'/'+_0x2866e1[_0x7b298b(0x145)];return{'lockKey':_0x3075b1,'filePath':resolveLocalFilePathFromLockKey(_0x2ebd4e,_0x3075b1),'type':'HOOK','hookLocation':_0x14d60a};}const _0x209a54=_0x5e0056+'/'+_0x2866e1['functionName'];return{'lockKey':_0x209a54,'filePath':resolveLocalFilePathFromLockKey(_0x2ebd4e,_0x209a54),'type':_0x5e0056};}export async function ensureParentDirectory(_0x5719d7){await mkdir(dirname(_0x5719d7),{'recursive':!![]});}export async function fileExists(_0xd843fa){try{return await access(_0xd843fa,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x3ebeda){try{const _0x24f93b=await stat(_0x3ebeda);return _0x24f93b['isDirectory']();}catch{return![];}}
1
+ const a110_0x5c819a=a110_0xe269;(function(_0x2706dc,_0x4f166a){const _0x55fb54=a110_0xe269,_0x5cd03e=_0x2706dc();while(!![]){try{const _0x41f742=-parseInt(_0x55fb54(0x11a))/0x1*(parseInt(_0x55fb54(0x130))/0x2)+-parseInt(_0x55fb54(0x132))/0x3*(-parseInt(_0x55fb54(0x13e))/0x4)+parseInt(_0x55fb54(0x13f))/0x5*(parseInt(_0x55fb54(0x13a))/0x6)+parseInt(_0x55fb54(0x140))/0x7+parseInt(_0x55fb54(0x12d))/0x8+-parseInt(_0x55fb54(0x121))/0x9+-parseInt(_0x55fb54(0x131))/0xa;if(_0x41f742===_0x4f166a)break;else _0x5cd03e['push'](_0x5cd03e['shift']());}catch(_0x42a2c2){_0x5cd03e['push'](_0x5cd03e['shift']());}}}(a110_0x4377,0x4ee4a));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=[a110_0x5c819a(0x11d),a110_0x5c819a(0x118),a110_0x5c819a(0x12c)];export function normalizeBffType(_0x83fab4){const _0x5ea50c=a110_0x5c819a;if(!_0x83fab4)return undefined;const _0x3de232=_0x83fab4[_0x5ea50c(0x13c)]()[_0x5ea50c(0x129)]();return SUPPORTED_BFF_TYPES[_0x5ea50c(0x138)](_0x3de232)?_0x3de232:undefined;}async function scanJsFilesRecursively(_0x34f9cb,_0x253f1b){const _0x416461=a110_0x5c819a,_0x61b6e1=[];try{const _0x3b1d5f=await readdir(_0x34f9cb,{'withFileTypes':!![]});for(const _0x2968a9 of _0x3b1d5f){const _0x32cb18=join(_0x34f9cb,_0x2968a9['name']);if(_0x2968a9[_0x416461(0x12b)]())_0x61b6e1[_0x416461(0x11f)](...await scanJsFilesRecursively(_0x32cb18,_0x253f1b+'/'+_0x2968a9[_0x416461(0x123)]));else _0x2968a9[_0x416461(0x137)]()&&_0x2968a9['name'][_0x416461(0x12a)]('.js')&&_0x61b6e1[_0x416461(0x11f)]({'lockKey':_0x253f1b+'/'+_0x2968a9[_0x416461(0x123)][_0x416461(0x13d)](/\.js$/,''),'filePath':_0x32cb18});}}catch(_0x40a80e){if(_0x40a80e[_0x416461(0x120)]!=='ENOENT')throw _0x40a80e;}return _0x61b6e1;}async function scanFlatFunctions(_0x468e4b,_0x25ddf0){const _0xc5a399=a110_0x5c819a,_0x1ea465=join(_0x468e4b[_0xc5a399(0x12e)],_0x25ddf0),_0x156257=await scanJsFilesRecursively(_0x1ea465,_0x25ddf0);return _0x156257[_0xc5a399(0x12f)](({lockKey:_0x3828c3,filePath:_0x2e9785})=>({'type':_0x25ddf0,'name':_0x3828c3[_0xc5a399(0x127)]('/')['at'](-0x1)??'','filePath':_0x2e9785,'lockKey':_0x3828c3}));}function a110_0xe269(_0x3f8df0,_0x3100b0){_0x3f8df0=_0x3f8df0-0x118;const _0x437759=a110_0x4377();let _0xe26917=_0x437759[_0x3f8df0];return _0xe26917;}async function scanHookFunctions(_0x1a06f0){const _0x1207ed=a110_0x5c819a,_0x28f3bf=join(_0x1a06f0[_0x1207ed(0x12e)],_0x1207ed(0x12c)),_0x159a45=[];try{const _0x417b30=await readdir(_0x28f3bf,{'withFileTypes':!![]});for(const _0x53ace1 of _0x417b30){if(!_0x53ace1[_0x1207ed(0x12b)]())continue;const _0x2ed1c3=_0x53ace1[_0x1207ed(0x123)],_0x503a74=join(_0x28f3bf,_0x2ed1c3),_0x2540ba=await readdir(_0x503a74,{'withFileTypes':!![]});for(const _0x5cfb9e of _0x2540ba){if(!_0x5cfb9e[_0x1207ed(0x12b)]())continue;const _0x38c609=_0x5cfb9e[_0x1207ed(0x123)],_0x5de8b2=join(_0x503a74,_0x38c609),_0x1e3115=await readdir(_0x5de8b2,{'withFileTypes':!![]});for(const _0x5e6478 of _0x1e3115){if(!_0x5e6478['isDirectory']())continue;const _0x2b5a04=_0x5e6478[_0x1207ed(0x123)],_0x5e5bbc=join(_0x5de8b2,_0x2b5a04),_0x211934=await readdir(_0x5e5bbc,{'withFileTypes':!![]});for(const _0x191ebe of _0x211934){if(!_0x191ebe['isFile']()||!_0x191ebe['name'][_0x1207ed(0x12a)](_0x1207ed(0x124)))continue;const _0x340826=_0x191ebe[_0x1207ed(0x123)][_0x1207ed(0x13d)](/\.js$/,'');_0x159a45[_0x1207ed(0x11f)]({'type':_0x1207ed(0x12c),'name':_0x340826,'filePath':join(_0x5e5bbc,_0x191ebe[_0x1207ed(0x123)]),'lockKey':_0x1207ed(0x135)+_0x2ed1c3+'/'+_0x38c609+'/'+_0x2b5a04+'/'+_0x340826,'alias':_0x2ed1c3,'operationType':_0x38c609,'functionNode':_0x2b5a04});}}}}}catch(_0x513764){if(_0x513764[_0x1207ed(0x120)]!==_0x1207ed(0x128))throw _0x513764;}return _0x159a45;}export async function scanLocalBffFunctions(_0x4f0fda,_0x425c75){const _0x4852c5=a110_0x5c819a;if(_0x425c75===_0x4852c5(0x11d)||_0x425c75===_0x4852c5(0x118))return scanFlatFunctions(_0x4f0fda,_0x425c75);if(_0x425c75===_0x4852c5(0x12c))return scanHookFunctions(_0x4f0fda);const [_0x4c0f14,_0x2fd606,_0xfcfa2c]=await Promise[_0x4852c5(0x13b)]([scanFlatFunctions(_0x4f0fda,'COMMON'),scanFlatFunctions(_0x4f0fda,'ENDPOINT'),scanHookFunctions(_0x4f0fda)]);return[..._0x4c0f14,..._0x2fd606,..._0xfcfa2c];}export function resolveLocalFilePathFromLockKey(_0x285d4e,_0x4e47ca){const _0xbe2a38=a110_0x5c819a;return join(_0x285d4e['scriptsRootDir'],..._0x4e47ca[_0xbe2a38(0x127)]('/'))+'.js';}export function createHookLocationMap(_0x321d16){const _0x44c30f=a110_0x5c819a,_0x219501=new Map();for(const _0x2a8b0b of _0x321d16){_0x2a8b0b[_0x44c30f(0x125)]&&_0x219501[_0x44c30f(0x126)](_0x2a8b0b['beforeScriptId'],{'datasetCode':_0x2a8b0b[_0x44c30f(0x122)],'operationType':snakeToCamel(_0x2a8b0b[_0x44c30f(0x11b)]),'functionNode':'before'}),_0x2a8b0b[_0x44c30f(0x119)]&&_0x219501[_0x44c30f(0x126)](_0x2a8b0b[_0x44c30f(0x119)],{'datasetCode':_0x2a8b0b[_0x44c30f(0x122)],'operationType':snakeToCamel(_0x2a8b0b[_0x44c30f(0x11b)]),'functionNode':_0x44c30f(0x139)});}return _0x219501;}export function resolveRemoteScriptTarget(_0x199664,_0x31d7f8,_0x795e66,_0x2fc0eb,_0x26f140){const _0x30e776=a110_0x5c819a,_0x2ed1df=normalizeBffType(_0x31d7f8[_0x30e776(0x11e)]);if(!_0x2ed1df||!_0x31d7f8['functionName'])return null;if(_0x2ed1df===_0x30e776(0x12c)){const _0x5350d5=(_0x31d7f8['id']?_0x795e66[_0x30e776(0x134)](_0x31d7f8['id']):undefined)??findHookLocationByRemoteId(_0x2fc0eb,_0x31d7f8['id']);if(!_0x5350d5)return null;const _0x264e73=_0x5350d5[_0x30e776(0x133)]||_0x26f140[_0x30e776(0x134)](_0x5350d5[_0x30e776(0x122)]),_0x2543be=_0x264e73??_0x5350d5[_0x30e776(0x122)],_0x45e00a={..._0x5350d5,'alias':_0x264e73},_0x38ba1e=_0x30e776(0x135)+_0x2543be+'/'+_0x45e00a[_0x30e776(0x11b)]+'/'+_0x45e00a['functionNode']+'/'+_0x31d7f8['functionName'];return{'lockKey':_0x38ba1e,'filePath':resolveLocalFilePathFromLockKey(_0x199664,_0x38ba1e),'type':'HOOK','hookLocation':_0x45e00a};}const _0x4466ce=_0x2ed1df+'/'+_0x31d7f8[_0x30e776(0x136)];return{'lockKey':_0x4466ce,'filePath':resolveLocalFilePathFromLockKey(_0x199664,_0x4466ce),'type':_0x2ed1df};}export async function ensureParentDirectory(_0x257108){await mkdir(dirname(_0x257108),{'recursive':!![]});}function a110_0x4377(){const _0x195592=['after','2467050acZtwH','all','trim','replace','128236zSgefo','5enFWEt','4414935dYswVN','ENDPOINT','afterScriptId','1mJDoBr','operationType','F_OK','COMMON','scriptType','push','code','2373642PKBahK','datasetCode','name','.js','beforeScriptId','set','split','ENOENT','toUpperCase','endsWith','isDirectory','HOOK','1523208pSvzXd','scriptsRootDir','map','470138KzRbpM','7629770vMmnaG','33nmfJJt','alias','get','HOOK/','functionName','isFile','includes'];a110_0x4377=function(){return _0x195592;};return a110_0x4377();}export async function fileExists(_0xdc98e3){const _0x759b3d=a110_0x5c819a;try{return await access(_0xdc98e3,constants[_0x759b3d(0x11c)]),!![];}catch{return![];}}export async function directoryExists(_0x2c73d5){const _0x40fe49=a110_0x5c819a;try{const _0x4c1b50=await stat(_0x2c73d5);return _0x4c1b50[_0x40fe49(0x12b)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2b5792,_0x1cac66){const _0xe70c9=a96_0x46f8,_0x257358=_0x2b5792();while(!![]){try{const _0x57fb6d=parseInt(_0xe70c9(0xd5))/0x1*(-parseInt(_0xe70c9(0xda))/0x2)+-parseInt(_0xe70c9(0xd2))/0x3*(-parseInt(_0xe70c9(0xd9))/0x4)+-parseInt(_0xe70c9(0xde))/0x5+-parseInt(_0xe70c9(0xdb))/0x6*(-parseInt(_0xe70c9(0xdd))/0x7)+parseInt(_0xe70c9(0xd0))/0x8*(-parseInt(_0xe70c9(0xd7))/0x9)+parseInt(_0xe70c9(0xdc))/0xa*(parseInt(_0xe70c9(0xd6))/0xb)+parseInt(_0xe70c9(0xd4))/0xc;if(_0x57fb6d===_0x1cac66)break;else _0x257358['push'](_0x257358['shift']());}catch(_0x229976){_0x257358['push'](_0x257358['shift']());}}}(a96_0x47b4,0xc0b3b));function a96_0x47b4(){const _0x1bdef5=['3186198QrrFGQ','update','2321644lHZglR','6LRoVgQ','59178KnKbKe','40HqUVqA','490MhkAYO','2778605RukGxu','createHash','24GGpVpr','hex','3bzUDTL','utf8','1061328nZdmmc','31781UUJhdF','3143723pXWHvZ'];a96_0x47b4=function(){return _0x1bdef5;};return a96_0x47b4();}import{readFile}from'node:fs/promises';import a96_0x492174 from'node:crypto';export function computeContentHash(_0x18793e){const _0x1e4ee2=a96_0x46f8;return a96_0x492174[_0x1e4ee2(0xdf)]('md5')[_0x1e4ee2(0xd8)](_0x18793e)['digest'](_0x1e4ee2(0xd1));}function a96_0x46f8(_0x1c3f53,_0x4cfacc){_0x1c3f53=_0x1c3f53-0xd0;const _0x47b4c5=a96_0x47b4();let _0x46f837=_0x47b4c5[_0x1c3f53];return _0x46f837;}export async function computeFileHash(_0x1573a8){const _0x31f061=a96_0x46f8,_0x27df12=await readFile(_0x1573a8,_0x31f061(0xd3));return computeContentHash(_0x27df12);}
1
+ (function(_0x2426b6,_0x3c3150){const _0x2b9382=a111_0x43c9,_0x5a5fac=_0x2426b6();while(!![]){try{const _0x274600=-parseInt(_0x2b9382(0xb2))/0x1*(-parseInt(_0x2b9382(0xbc))/0x2)+parseInt(_0x2b9382(0xbf))/0x3*(parseInt(_0x2b9382(0xb8))/0x4)+-parseInt(_0x2b9382(0xb3))/0x5*(-parseInt(_0x2b9382(0xb9))/0x6)+parseInt(_0x2b9382(0xbe))/0x7+-parseInt(_0x2b9382(0xb5))/0x8*(-parseInt(_0x2b9382(0xb6))/0x9)+parseInt(_0x2b9382(0xba))/0xa*(-parseInt(_0x2b9382(0xb7))/0xb)+-parseInt(_0x2b9382(0xbb))/0xc;if(_0x274600===_0x3c3150)break;else _0x5a5fac['push'](_0x5a5fac['shift']());}catch(_0x22fa74){_0x5a5fac['push'](_0x5a5fac['shift']());}}}(a111_0x3a19,0xe3cda));function a111_0x43c9(_0x4c340f,_0x510552){_0x4c340f=_0x4c340f-0xb2;const _0x3a1923=a111_0x3a19();let _0x43c967=_0x3a1923[_0x4c340f];return _0x43c967;}import{readFile}from'node:fs/promises';import a111_0x14c4e1 from'node:crypto';function a111_0x3a19(){const _0x424f36=['41164464yygFfu','746qDLzFK','digest','12101985oicQdB','106611Eoqrwi','2251ksPgBZ','5fQtddg','md5','72pSAAsn','1099341vWLkgk','4663362UxZYvX','88glnodE','7113882nZdrER','30dRmkdJ'];a111_0x3a19=function(){return _0x424f36;};return a111_0x3a19();}export function computeContentHash(_0x47e226){const _0x52644e=a111_0x43c9;return a111_0x14c4e1['createHash'](_0x52644e(0xb4))['update'](_0x47e226)[_0x52644e(0xbd)]('hex');}export async function computeFileHash(_0xca9eb2){const _0x59216e=await readFile(_0xca9eb2,'utf8');return computeContentHash(_0x59216e);}
@@ -1 +1 @@
1
- function a97_0x4251(){const _0x54510e=['215KjuoDs','320NazSGy','\x22.\x20','369jADIKc','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','5012ZzUmqy','current\x20\x22','1200836zkZLYq','3194364VZqJUg','object','11KRLjvv','ENOENT','scriptsRoot','stringify','11hcnWSh','utf8','\x22\x20vs\x20lock\x20\x22','apps','20529lLazVp','1774230FMPqjx','41836iEqJZH','lastSync','21540qaZMzC','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','functions',':\x20scriptsRoot\x20mismatch\x20—\x20'];a97_0x4251=function(){return _0x54510e;};return a97_0x4251();}(function(_0x40202a,_0x596bdc){const _0x1856c3=a97_0x9bfc,_0x3d1c6f=_0x40202a();while(!![]){try{const _0x445a86=-parseInt(_0x1856c3(0x1d9))/0x1*(parseInt(_0x1856c3(0x1df))/0x2)+parseInt(_0x1856c3(0x1e8))/0x3*(parseInt(_0x1856c3(0x1ea))/0x4)+parseInt(_0x1856c3(0x1e5))/0x5*(-parseInt(_0x1856c3(0x1e1))/0x6)+parseInt(_0x1856c3(0x1d2))/0x7+parseInt(_0x1856c3(0x1e6))/0x8*(parseInt(_0x1856c3(0x1dd))/0x9)+-parseInt(_0x1856c3(0x1de))/0xa+-parseInt(_0x1856c3(0x1d5))/0xb*(-parseInt(_0x1856c3(0x1d3))/0xc);if(_0x445a86===_0x596bdc)break;else _0x3d1c6f['push'](_0x3d1c6f['shift']());}catch(_0x1e5c7d){_0x3d1c6f['push'](_0x3d1c6f['shift']());}}}(a97_0x4251,0x1d97d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a97_0x9bfc(_0x3b191a,_0x559ea5){_0x3b191a=_0x3b191a-0x1d2;const _0x42511f=a97_0x4251();let _0x9bfc28=_0x42511f[_0x3b191a];return _0x9bfc28;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1d2e91,_0x4c6225,_0x382d78,_0x8075b4){const _0xe1ad48=a97_0x9bfc,_0x39057f={'apps':_0x1d2e91['apps']&&typeof _0x1d2e91[_0xe1ad48(0x1dc)]===_0xe1ad48(0x1d4)?_0x1d2e91[_0xe1ad48(0x1dc)]:{}};let _0x2dc839=_0x39057f[_0xe1ad48(0x1dc)][_0x4c6225];if(!_0x2dc839)return _0x2dc839={'scriptsRoot':_0x382d78,'lastSync':'','functions':{}},_0x39057f['apps'][_0x4c6225]=_0x2dc839,{'lockData':_0x39057f,'appLock':_0x2dc839};if(!_0x2dc839[_0xe1ad48(0x1d7)])_0x2dc839[_0xe1ad48(0x1d7)]=_0x382d78;else{if(_0x2dc839[_0xe1ad48(0x1d7)]!==_0x382d78)throw new Error(_0x8075b4+_0xe1ad48(0x1e4)+(_0xe1ad48(0x1eb)+_0x382d78+_0xe1ad48(0x1db)+_0x2dc839[_0xe1ad48(0x1d7)]+_0xe1ad48(0x1e7))+_0xe1ad48(0x1e2));}return!_0x2dc839[_0xe1ad48(0x1e3)]&&(_0x2dc839[_0xe1ad48(0x1e3)]={}),!_0x2dc839[_0xe1ad48(0x1e0)]&&(_0x2dc839[_0xe1ad48(0x1e0)]=''),{'lockData':_0x39057f,'appLock':_0x2dc839};}export async function readBffLockFile(_0x24c36b){const _0x276ea6=a97_0x9bfc;try{const _0x4533e1=await readFile(_0x24c36b,_0x276ea6(0x1da)),_0x19be50=JSON['parse'](_0x4533e1);return{'apps':_0x19be50[_0x276ea6(0x1dc)]&&typeof _0x19be50['apps']==='object'?_0x19be50[_0x276ea6(0x1dc)]:{}};}catch(_0x347432){if(_0x347432['code']===_0x276ea6(0x1d6))return null;throw new Error(_0x276ea6(0x1e9)+String(_0x347432));}}export async function writeBffLockFile(_0x37750d,_0x5d1d8e){const _0x23253f=a97_0x9bfc;await mkdir(dirname(_0x37750d),{'recursive':!![]}),await writeFile(_0x37750d,JSON[_0x23253f(0x1d8)](_0x5d1d8e,null,0x2),_0x23253f(0x1da));}
1
+ function a112_0x543b(){const _0x4c438d=['\x22\x20vs\x20lock\x20\x22','6519087lhsTXK','12QTVDyP','parse','188896NNhMwi','current\x20\x22','utf8','lastSync','functions','stringify','196EormsK','24VunjFL','object','apps','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','5895ynfODK','ENOENT','28ZpmDhC',':\x20scriptsRoot\x20mismatch\x20—\x20','3326604ksHROs','scriptsRoot','code','88945oyVOGa','5789432QOkHNM','10lPokmi','115634sqaxNV','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.'];a112_0x543b=function(){return _0x4c438d;};return a112_0x543b();}(function(_0x316aa2,_0x26ab48){const _0x49743b=a112_0x13f6,_0x54419b=_0x316aa2();while(!![]){try{const _0x25139a=parseInt(_0x49743b(0x112))/0x1+parseInt(_0x49743b(0x103))/0x2*(-parseInt(_0x49743b(0x108))/0x3)+-parseInt(_0x49743b(0x10c))/0x4+parseInt(_0x49743b(0x10f))/0x5*(parseInt(_0x49743b(0x104))/0x6)+parseInt(_0x49743b(0x10a))/0x7*(parseInt(_0x49743b(0x118))/0x8)+-parseInt(_0x49743b(0x115))/0x9*(-parseInt(_0x49743b(0x111))/0xa)+-parseInt(_0x49743b(0x110))/0xb*(-parseInt(_0x49743b(0x116))/0xc);if(_0x25139a===_0x26ab48)break;else _0x54419b['push'](_0x54419b['shift']());}catch(_0xfd0ae8){_0x54419b['push'](_0x54419b['shift']());}}}(a112_0x543b,0x7bf18));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a112_0x13f6(_0x123b52,_0x5dbd8d){_0x123b52=_0x123b52-0xff;const _0x543ba7=a112_0x543b();let _0x13f6f0=_0x543ba7[_0x123b52];return _0x13f6f0;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x516712,_0x4c5e47,_0x4f1b75,_0xc4a33f){const _0x4224de=a112_0x13f6,_0x385fbd={'apps':_0x516712['apps']&&typeof _0x516712[_0x4224de(0x106)]==='object'?_0x516712[_0x4224de(0x106)]:{}};let _0x3253fe=_0x385fbd[_0x4224de(0x106)][_0x4c5e47];if(!_0x3253fe)return _0x3253fe={'scriptsRoot':_0x4f1b75,'lastSync':'','functions':{}},_0x385fbd[_0x4224de(0x106)][_0x4c5e47]=_0x3253fe,{'lockData':_0x385fbd,'appLock':_0x3253fe};if(!_0x3253fe['scriptsRoot'])_0x3253fe[_0x4224de(0x10d)]=_0x4f1b75;else{if(_0x3253fe['scriptsRoot']!==_0x4f1b75)throw new Error(_0xc4a33f+_0x4224de(0x10b)+(_0x4224de(0x119)+_0x4f1b75+_0x4224de(0x114)+_0x3253fe[_0x4224de(0x10d)]+'\x22.\x20')+_0x4224de(0x113));}return!_0x3253fe[_0x4224de(0x101)]&&(_0x3253fe[_0x4224de(0x101)]={}),!_0x3253fe[_0x4224de(0x100)]&&(_0x3253fe[_0x4224de(0x100)]=''),{'lockData':_0x385fbd,'appLock':_0x3253fe};}export async function readBffLockFile(_0x2bf63e){const _0x1a44f5=a112_0x13f6;try{const _0x3dc9ae=await readFile(_0x2bf63e,_0x1a44f5(0xff)),_0x51e222=JSON[_0x1a44f5(0x117)](_0x3dc9ae);return{'apps':_0x51e222[_0x1a44f5(0x106)]&&typeof _0x51e222[_0x1a44f5(0x106)]===_0x1a44f5(0x105)?_0x51e222[_0x1a44f5(0x106)]:{}};}catch(_0x26c776){if(_0x26c776[_0x1a44f5(0x10e)]===_0x1a44f5(0x109))return null;throw new Error(_0x1a44f5(0x107)+String(_0x26c776));}}export async function writeBffLockFile(_0x245806,_0x5c43c9){const _0x254137=a112_0x13f6;await mkdir(dirname(_0x245806),{'recursive':!![]}),await writeFile(_0x245806,JSON[_0x254137(0x102)](_0x5c43c9,null,0x2),_0x254137(0xff));}
@@ -1 +1 @@
1
- (function(_0x2c9d5c,_0x2d4309){const _0x3859b5=a99_0x1667,_0x3f8330=_0x2c9d5c();while(!![]){try{const _0x571865=parseInt(_0x3859b5(0x13b))/0x1*(-parseInt(_0x3859b5(0x13c))/0x2)+-parseInt(_0x3859b5(0x140))/0x3*(parseInt(_0x3859b5(0x13d))/0x4)+parseInt(_0x3859b5(0x141))/0x5+-parseInt(_0x3859b5(0x147))/0x6*(-parseInt(_0x3859b5(0x136))/0x7)+-parseInt(_0x3859b5(0x145))/0x8*(parseInt(_0x3859b5(0x146))/0x9)+parseInt(_0x3859b5(0x143))/0xa*(-parseInt(_0x3859b5(0x144))/0xb)+parseInt(_0x3859b5(0x13f))/0xc*(parseInt(_0x3859b5(0x137))/0xd);if(_0x571865===_0x2d4309)break;else _0x3f8330['push'](_0x3f8330['shift']());}catch(_0x322199){_0x3f8330['push'](_0x3f8330['shift']());}}}(a99_0x57ba,0xa8670));export function snakeToCamel(_0x43d9e0){const _0x428787=a99_0x1667;return _0x43d9e0[_0x428787(0x138)]()[_0x428787(0x142)](/_([a-z])/g,(_0x315344,_0x1f619d)=>_0x1f619d[_0x428787(0x139)]());}function a99_0x1667(_0x19e0e3,_0x1678fb){_0x19e0e3=_0x19e0e3-0x135;const _0x57ba52=a99_0x57ba();let _0x1667be=_0x57ba52[_0x19e0e3];return _0x1667be;}export function findHookLocationByRemoteId(_0x5268dc,_0x3d16a8){const _0x59b656=a99_0x1667;if(!_0x3d16a8)return undefined;for(const _0x1fe1db of Object['values'](_0x5268dc)){if(_0x1fe1db['remoteId']===_0x3d16a8&&_0x1fe1db[_0x59b656(0x14b)]&&_0x1fe1db[_0x59b656(0x148)]&&_0x1fe1db[_0x59b656(0x13e)])return{'datasetCode':_0x1fe1db[_0x59b656(0x14b)],'operationType':_0x1fe1db[_0x59b656(0x148)],'functionNode':_0x1fe1db[_0x59b656(0x13e)]};}return undefined;}export function extractScriptDescription(_0x35ce17){const _0x2c0cbf=a99_0x1667,_0x3bc78d=_0x35ce17[_0x2c0cbf(0x135)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x3bc78d?.[0x1]?.[_0x2c0cbf(0x149)]()||undefined;}function a99_0x57ba(){const _0x3e02f2=['568610jEEkcV','33OcEJqn','5065936iwMKFj','9eOaSug','2043162SpqXUU','operationType','trim','before','datasetCode','match','21QOEcOd','689eyRVpG','toLowerCase','toUpperCase','after','332740ajTAYA','8yjiahT','4zYUdeU','functionNode','287556eUYxPb','1350390DxwCxk','4915355zuwNcj','replace'];a99_0x57ba=function(){return _0x3e02f2;};return a99_0x57ba();}export function isValidBffFunctionName(_0x176fbd){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x176fbd);}export function normalizeHookFunctionNode(_0x51850f){const _0x51404b=a99_0x1667;if(!_0x51850f)return undefined;const _0x239961=_0x51850f[_0x51404b(0x149)]()[_0x51404b(0x138)]();if(_0x239961===_0x51404b(0x14a)||_0x239961===_0x51404b(0x13a))return _0x239961;return undefined;}
1
+ function a114_0x333a(_0x5e8e5a,_0x1b64b5){_0x5e8e5a=_0x5e8e5a-0x1cd;const _0x404d5c=a114_0x404d();let _0x333adb=_0x404d5c[_0x5e8e5a];return _0x333adb;}(function(_0x583c2e,_0x12c353){const _0x416f8d=a114_0x333a,_0x288240=_0x583c2e();while(!![]){try{const _0x47ce84=-parseInt(_0x416f8d(0x1d8))/0x1+parseInt(_0x416f8d(0x1d2))/0x2*(parseInt(_0x416f8d(0x1dc))/0x3)+-parseInt(_0x416f8d(0x1d9))/0x4*(-parseInt(_0x416f8d(0x1d1))/0x5)+-parseInt(_0x416f8d(0x1d3))/0x6*(-parseInt(_0x416f8d(0x1d0))/0x7)+parseInt(_0x416f8d(0x1e0))/0x8+parseInt(_0x416f8d(0x1cf))/0x9+-parseInt(_0x416f8d(0x1d6))/0xa;if(_0x47ce84===_0x12c353)break;else _0x288240['push'](_0x288240['shift']());}catch(_0xf0efd8){_0x288240['push'](_0x288240['shift']());}}}(a114_0x404d,0x84374));export function snakeToCamel(_0x3cf8f0){const _0xdff581=a114_0x333a;return _0x3cf8f0[_0xdff581(0x1ce)]()['replace'](/_([a-z])/g,(_0x5ea608,_0x2ac5ad)=>_0x2ac5ad['toUpperCase']());}export function findHookLocationByRemoteId(_0x28bac8,_0x4d815f){const _0x58591c=a114_0x333a;if(!_0x4d815f)return undefined;for(const _0x3dbc56 of Object[_0x58591c(0x1d5)](_0x28bac8)){if(_0x3dbc56['remoteId']===_0x4d815f&&_0x3dbc56['datasetCode']&&_0x3dbc56[_0x58591c(0x1de)]&&_0x3dbc56[_0x58591c(0x1d7)])return{'datasetCode':_0x3dbc56[_0x58591c(0x1da)],'operationType':_0x3dbc56['operationType'],'functionNode':_0x3dbc56[_0x58591c(0x1d7)]};}return undefined;}export function extractScriptDescription(_0x25537d){const _0x3456d1=a114_0x333a,_0x5ceac5=_0x25537d[_0x3456d1(0x1cd)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5ceac5?.[0x1]?.[_0x3456d1(0x1dd)]()||undefined;}export function isValidBffFunctionName(_0x113fba){const _0xb83b96=a114_0x333a;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0xb83b96(0x1db)](_0x113fba);}function a114_0x404d(){const _0x2d9f3a=['after','6972408WEEpkI','match','toLowerCase','2376612OYyuAy','7usiPqu','1521785wTapBx','1154182OqpXJU','1067502pWJrnb','before','values','16987090tOIRRw','functionNode','563433bmpGnO','12RdzPcy','datasetCode','test','3XjYwve','trim','operationType'];a114_0x404d=function(){return _0x2d9f3a;};return a114_0x404d();}export function normalizeHookFunctionNode(_0x338865){const _0x398b91=a114_0x333a;if(!_0x338865)return undefined;const _0x369521=_0x338865[_0x398b91(0x1dd)]()[_0x398b91(0x1ce)]();if(_0x369521===_0x398b91(0x1d4)||_0x369521===_0x398b91(0x1df))return _0x369521;return undefined;}
@@ -1 +1 @@
1
- (function(_0x492259,_0x83807){const _0x160d41=a100_0x5389,_0x44618d=_0x492259();while(!![]){try{const _0x4bba6a=-parseInt(_0x160d41(0x1b3))/0x1*(-parseInt(_0x160d41(0x1a3))/0x2)+parseInt(_0x160d41(0x1a1))/0x3+-parseInt(_0x160d41(0x1bd))/0x4*(-parseInt(_0x160d41(0x1b6))/0x5)+-parseInt(_0x160d41(0x1b7))/0x6*(parseInt(_0x160d41(0x1ae))/0x7)+-parseInt(_0x160d41(0x1b2))/0x8+parseInt(_0x160d41(0x1b0))/0x9*(-parseInt(_0x160d41(0x1b9))/0xa)+-parseInt(_0x160d41(0x1bf))/0xb*(-parseInt(_0x160d41(0x1bc))/0xc);if(_0x4bba6a===_0x83807)break;else _0x44618d['push'](_0x44618d['shift']());}catch(_0x1dc7d9){_0x44618d['push'](_0x44618d['shift']());}}}(a100_0x1eab,0x8fcbd));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x5bec59){const _0x6282a6=a100_0x5389;if(cache[_0x6282a6(0x1a6)](_0x5bec59))return cache[_0x6282a6(0x1ba)](_0x5bec59);const _0x3831b8=await listDatasets(_0x5bec59),_0x4381c8=new Map();for(const _0x4ef5b0 of _0x3831b8){const _0x26ea86=_0x4ef5b0[_0x6282a6(0x1a7)];_0x26ea86?.[_0x6282a6(0x1b8)]!=null&&_0x4381c8[_0x6282a6(0x1af)](_0x26ea86[_0x6282a6(0x1b8)],_0x26ea86['dbName']??_0x6282a6(0x1b4)+_0x26ea86['dbId']);}const _0x3aa27c=[..._0x4381c8[_0x6282a6(0x1a2)]()][_0x6282a6(0x1ab)](([_0x501352,_0x3c9ed8])=>({'dbId':_0x501352,'dbName':_0x3c9ed8}));return cache[_0x6282a6(0x1af)](_0x5bec59,_0x3aa27c),_0x3aa27c;}export async function resolveDb(_0x191198,_0xe52f17){const _0x75cff6=a100_0x5389,_0x976258=await listDatabases(_0x191198);if(_0x976258[_0x75cff6(0x1b1)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0xe52f17)return{'resolved':_0x976258};const _0x29240f=Number(_0xe52f17);if(!Number[_0x75cff6(0x1b5)](_0x29240f)){const _0xbc7149=_0x976258[_0x75cff6(0x1a0)](_0x26ae65=>_0x26ae65[_0x75cff6(0x1b8)]===_0x29240f);if(_0xbc7149)return{'resolved':[_0xbc7149]};}const _0x3ac41e=_0xe52f17[_0x75cff6(0x1a9)](),_0x53a9ef=_0x976258[_0x75cff6(0x1ac)](_0xd57aa1=>_0xd57aa1[_0x75cff6(0x1a8)][_0x75cff6(0x1a9)]()[_0x75cff6(0x1ad)](_0x3ac41e));if(_0x53a9ef[_0x75cff6(0x1b1)]>0x0)return{'resolved':_0x53a9ef};const _0x214add=_0x976258['map'](_0x1e0478=>_0x1e0478['dbName']+'\x20('+_0x1e0478[_0x75cff6(0x1b8)]+')')[_0x75cff6(0x1be)](',\x20');return{'resolved':[],'error':_0x75cff6(0x1bb)+_0xe52f17+_0x75cff6(0x1a5)+_0x214add};}export async function resolveOneDb(_0x566808,_0x1d4fda){const _0x36f099=a100_0x5389,{resolved:_0x1b2550,error:_0x57c874}=await resolveDb(_0x566808,_0x1d4fda);if(_0x57c874)return{'db':null,'error':_0x57c874};if(_0x1b2550[_0x36f099(0x1b1)]===0x1)return{'db':_0x1b2550[0x0]};if(!_0x1d4fda){const _0x4897e5=_0x1b2550[_0x36f099(0x1ab)](_0xeb9457=>_0xeb9457[_0x36f099(0x1a8)]+'\x20('+_0xeb9457[_0x36f099(0x1b8)]+')')[_0x36f099(0x1be)](',\x20');return{'db':null,'error':_0x36f099(0x1a4)+_0x4897e5};}const _0x29ee60=_0x1b2550[_0x36f099(0x1ab)](_0x245308=>_0x245308['dbName']+'\x20('+_0x245308['dbId']+')')[_0x36f099(0x1be)](',\x20');return{'db':null,'error':'\x22'+_0x1d4fda+_0x36f099(0x1aa)+_0x29ee60+'.\x20Be\x20more\x20specific.'};}function a100_0x5389(_0x1478ec,_0x5e936d){_0x1478ec=_0x1478ec-0x1a0;const _0x1eabe0=a100_0x1eab();let _0x53896e=_0x1eabe0[_0x1478ec];return _0x53896e;}function a100_0x1eab(){const _0x4a7a19=['set','279tIUPRl','length','4203384VXQoRl','250GZYwEN','db-','isNaN','5bNSXZC','36zWqOKy','dbId','294700MVeGDd','get','No\x20database\x20matching\x20\x22','14737116arOJOl','695696ClcIcQ','join','11QRUUgS','find','868455sEHyBe','entries','4794oJmpYy','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22.\x20Available:\x20','has','dbtableConfig','dbName','toLowerCase','\x22\x20matches\x20multiple\x20databases:\x20','map','filter','includes','306565Rupfwb'];a100_0x1eab=function(){return _0x4a7a19;};return a100_0x1eab();}export async function getDbName(_0x574467,_0x45aa85){const _0x5434ba=a100_0x5389,_0x149611=await listDatabases(_0x574467);return _0x149611[_0x5434ba(0x1a0)](_0xf7cf92=>_0xf7cf92[_0x5434ba(0x1b8)]===_0x45aa85)?.[_0x5434ba(0x1a8)];}
1
+ (function(_0x533697,_0x244fc3){const _0x1d7a23=a115_0x53de,_0x2b6b51=_0x533697();while(!![]){try{const _0x2ae9e4=parseInt(_0x1d7a23(0x1c5))/0x1+-parseInt(_0x1d7a23(0x1da))/0x2+-parseInt(_0x1d7a23(0x1c6))/0x3*(-parseInt(_0x1d7a23(0x1d1))/0x4)+-parseInt(_0x1d7a23(0x1c4))/0x5+-parseInt(_0x1d7a23(0x1c1))/0x6*(-parseInt(_0x1d7a23(0x1be))/0x7)+parseInt(_0x1d7a23(0x1ca))/0x8+-parseInt(_0x1d7a23(0x1c3))/0x9*(-parseInt(_0x1d7a23(0x1d5))/0xa);if(_0x2ae9e4===_0x244fc3)break;else _0x2b6b51['push'](_0x2b6b51['shift']());}catch(_0x1322a2){_0x2b6b51['push'](_0x2b6b51['shift']());}}}(a115_0x4034,0x1a454));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a115_0x53de(_0x156612,_0x3ae15f){_0x156612=_0x156612-0x1bd;const _0x403420=a115_0x4034();let _0x53de7a=_0x403420[_0x156612];return _0x53de7a;}export async function listDatabases(_0x4e6cd9){const _0x2c5122=a115_0x53de;if(cache[_0x2c5122(0x1d2)](_0x4e6cd9))return cache[_0x2c5122(0x1cd)](_0x4e6cd9);const _0x5ca191=await listDatasets(_0x4e6cd9),_0x5da647=new Map();for(const _0x55b9d1 of _0x5ca191){const _0x3e693d=_0x55b9d1[_0x2c5122(0x1d3)];_0x3e693d?.[_0x2c5122(0x1c2)]!=null&&_0x5da647[_0x2c5122(0x1c9)](_0x3e693d[_0x2c5122(0x1c2)],_0x3e693d[_0x2c5122(0x1bd)]??_0x2c5122(0x1c8)+_0x3e693d[_0x2c5122(0x1c2)]);}const _0x1b37c1=[..._0x5da647[_0x2c5122(0x1c7)]()][_0x2c5122(0x1ce)](([_0x1a8fc0,_0x3b5ed2])=>({'dbId':_0x1a8fc0,'dbName':_0x3b5ed2}));return cache[_0x2c5122(0x1c9)](_0x4e6cd9,_0x1b37c1),_0x1b37c1;}export async function resolveDb(_0x43e1b3,_0x4c5123){const _0x12b5da=a115_0x53de,_0x431413=await listDatabases(_0x43e1b3);if(_0x431413[_0x12b5da(0x1d4)]===0x0)return{'resolved':[],'error':_0x12b5da(0x1cf)};if(!_0x4c5123)return{'resolved':_0x431413};const _0x56a75a=Number(_0x4c5123);if(!Number[_0x12b5da(0x1d7)](_0x56a75a)){const _0xa4965=_0x431413['find'](_0x41a524=>_0x41a524[_0x12b5da(0x1c2)]===_0x56a75a);if(_0xa4965)return{'resolved':[_0xa4965]};}const _0x251b37=_0x4c5123['toLowerCase'](),_0xced4c8=_0x431413[_0x12b5da(0x1bf)](_0x25fe0e=>_0x25fe0e['dbName'][_0x12b5da(0x1d6)]()['includes'](_0x251b37));if(_0xced4c8['length']>0x0)return{'resolved':_0xced4c8};const _0x280dbe=_0x431413[_0x12b5da(0x1ce)](_0x341142=>_0x341142['dbName']+'\x20('+_0x341142[_0x12b5da(0x1c2)]+')')[_0x12b5da(0x1d9)](',\x20');return{'resolved':[],'error':_0x12b5da(0x1cb)+_0x4c5123+_0x12b5da(0x1db)+_0x280dbe};}export async function resolveOneDb(_0x167a28,_0x357a6f){const _0x58eb41=a115_0x53de,{resolved:_0x5746a3,error:_0x50855c}=await resolveDb(_0x167a28,_0x357a6f);if(_0x50855c)return{'db':null,'error':_0x50855c};if(_0x5746a3['length']===0x1)return{'db':_0x5746a3[0x0]};if(!_0x357a6f){const _0xf3bd0c=_0x5746a3[_0x58eb41(0x1ce)](_0x20ee33=>_0x20ee33[_0x58eb41(0x1bd)]+'\x20('+_0x20ee33[_0x58eb41(0x1c2)]+')')[_0x58eb41(0x1d9)](',\x20');return{'db':null,'error':_0x58eb41(0x1cc)+_0xf3bd0c};}const _0x58f3f5=_0x5746a3['map'](_0x2aab09=>_0x2aab09[_0x58eb41(0x1bd)]+'\x20('+_0x2aab09[_0x58eb41(0x1c2)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x357a6f+_0x58eb41(0x1d0)+_0x58f3f5+_0x58eb41(0x1d8)};}export async function getDbName(_0x178da2,_0x279d64){const _0x4f19b3=a115_0x53de,_0x125716=await listDatabases(_0x178da2);return _0x125716[_0x4f19b3(0x1c0)](_0x59c734=>_0x59c734[_0x4f19b3(0x1c2)]===_0x279d64)?.[_0x4f19b3(0x1bd)];}function a115_0x4034(){const _0x41f428=['31389zWFXMV','entries','db-','set','559512czpDIP','No\x20database\x20matching\x20\x22','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','get','map','No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','4NoaLmF','has','dbtableConfig','length','10slWkHb','toLowerCase','isNaN','.\x20Be\x20more\x20specific.','join','160904TrHEue','\x22.\x20Available:\x20','dbName','252077fRjKZy','filter','find','6FPaFoX','dbId','467793AZkvpB','891895rbjgGf','198045TSxkEs'];a115_0x4034=function(){return _0x41f428;};return a115_0x4034();}
@@ -1 +1 @@
1
- (function(_0x328cb3,_0x3751ef){const _0x420621=a101_0x28d9,_0x1b555f=_0x328cb3();while(!![]){try{const _0x324f55=-parseInt(_0x420621(0x147))/0x1+-parseInt(_0x420621(0x138))/0x2*(parseInt(_0x420621(0x140))/0x3)+parseInt(_0x420621(0x141))/0x4+parseInt(_0x420621(0x13f))/0x5*(parseInt(_0x420621(0x14b))/0x6)+parseInt(_0x420621(0x132))/0x7*(-parseInt(_0x420621(0x137))/0x8)+-parseInt(_0x420621(0x142))/0x9*(-parseInt(_0x420621(0x12c))/0xa)+-parseInt(_0x420621(0x130))/0xb*(-parseInt(_0x420621(0x131))/0xc);if(_0x324f55===_0x3751ef)break;else _0x1b555f['push'](_0x1b555f['shift']());}catch(_0x184107){_0x1b555f['push'](_0x1b555f['shift']());}}}(a101_0x40a0,0x68ebf));function a101_0x40a0(){const _0x1675c6=['DDL','isDangerous','11PpdOIs','17582268fXrkyu','58723hRUxHV','join','SELECT','DELETE','replace','736vcMxkN','394aQCvsk','trim','startsWith','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','reason','toUpperCase','SQL\x20content\x20is\x20empty','899985aAUPGR','12132LQNlZr','660008kcBXjE','286245uuXdAO','\x20query\x20targeting\x20','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','length','push','479184ReBPtc','WITH','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','UPDATE','24DgZUqX','from','match','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','test','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','add','INSERT','\x20with\x20parameters:\x20','UNKNOWN','type','matchAll','40XAfQBp','includes'];a101_0x40a0=function(){return _0x1675c6;};return a101_0x40a0();}export function detectSqlType(_0xf386b9){const _0x43bcdf=a101_0x28d9;if(!_0xf386b9?.[_0x43bcdf(0x139)]())return{'type':_0x43bcdf(0x129),'isSelectOnly':![],'isDangerous':![],'reason':_0x43bcdf(0x13e)};const _0x208e96=_0xf386b9[_0x43bcdf(0x136)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x43bcdf(0x136)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x43bcdf(0x136)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x13a560=_0x208e96['split']('\x0a');let _0x3868a2='';for(const _0x4209fb of _0x13a560){const _0xb0024a=_0x4209fb[_0x43bcdf(0x139)]();if(!_0xb0024a||_0xb0024a['startsWith']('--')||_0xb0024a['startsWith']('/*'))continue;_0x3868a2=_0xb0024a;break;}const _0x46a807=_0x3868a2[_0x43bcdf(0x13d)]();if(_0x46a807['startsWith'](_0x43bcdf(0x134))||_0x46a807[_0x43bcdf(0x13a)](_0x43bcdf(0x148))){const _0x1eaa30=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x43bcdf(0x124)](_0x208e96);return{'type':_0x43bcdf(0x134),'isSelectOnly':!_0x1eaa30,'isDangerous':_0x1eaa30,'reason':_0x1eaa30?_0x43bcdf(0x144):undefined};}if(_0x46a807[_0x43bcdf(0x13a)](_0x43bcdf(0x127)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':![]};if(_0x46a807[_0x43bcdf(0x13a)](_0x43bcdf(0x14a)))return{'type':_0x43bcdf(0x14a),'isSelectOnly':![],'isDangerous':![]};if(_0x46a807['startsWith'](_0x43bcdf(0x135)))return{'type':_0x43bcdf(0x135),'isSelectOnly':![],'isDangerous':!![],'reason':_0x43bcdf(0x125)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x43bcdf(0x124)](_0x46a807))return{'type':_0x43bcdf(0x12e),'isSelectOnly':![],'isDangerous':!![],'reason':_0x43bcdf(0x123)};return{'type':_0x43bcdf(0x129),'isSelectOnly':![],'isDangerous':![]};}function a101_0x28d9(_0x9e1669,_0x4ebfb0){_0x9e1669=_0x9e1669-0x123;const _0x40a031=a101_0x40a0();let _0x28d980=_0x40a031[_0x9e1669];return _0x28d980;}function extractTables(_0x35f7d2){const _0x3b85a1=a101_0x28d9,_0x5a86ad=_0x35f7d2['replace'](/#\{[^}]*\}/g,'?')[_0x3b85a1(0x136)](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x559cf8=[],_0x336c6f=_0x5a86ad[_0x3b85a1(0x14d)](/FROM\s+([^\s,)(]+)/i);if(_0x336c6f?.[0x1])_0x559cf8[_0x3b85a1(0x146)](_0x336c6f[0x1]['replace'](/[`"]/g,''));for(const _0x4faddd of _0x5a86ad[_0x3b85a1(0x12b)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x17ccb8=_0x4faddd[0x1]?.[_0x3b85a1(0x136)](/[`"]/g,'');if(_0x17ccb8&&!_0x559cf8[_0x3b85a1(0x12d)](_0x17ccb8))_0x559cf8[_0x3b85a1(0x146)](_0x17ccb8);}const _0x59dccf=_0x5a86ad[_0x3b85a1(0x14d)](/INTO\s+([^\s(]+)/i);if(_0x59dccf?.[0x1]){const _0x4390fd=_0x59dccf[0x1][_0x3b85a1(0x136)](/[`"]/g,'');if(!_0x559cf8[_0x3b85a1(0x12d)](_0x4390fd))_0x559cf8[_0x3b85a1(0x146)](_0x4390fd);}const _0x3de215=_0x5a86ad[_0x3b85a1(0x14d)](/UPDATE\s+([^\s,)(]+)/i);if(_0x3de215?.[0x1]){const _0x360570=_0x3de215[0x1][_0x3b85a1(0x136)](/[`"]/g,'');if(!_0x559cf8[_0x3b85a1(0x12d)](_0x360570))_0x559cf8[_0x3b85a1(0x146)](_0x360570);}return _0x559cf8;}function extractParameters(_0x54fa10){const _0x9f0c6f=a101_0x28d9,_0xe059a7=new Set();for(const _0x36fc33 of _0x54fa10[_0x9f0c6f(0x12b)](/#\{(\w+)\}/g))if(_0x36fc33[0x1])_0xe059a7[_0x9f0c6f(0x126)](_0x36fc33[0x1]);for(const _0x56d476 of _0x54fa10[_0x9f0c6f(0x12b)](/\$\{(\w+)\}/g))if(_0x56d476[0x1])_0xe059a7[_0x9f0c6f(0x126)](_0x56d476[0x1]);return Array[_0x9f0c6f(0x14c)](_0xe059a7);}export function validateSql(_0x10f0c7){const _0x2a5ba3=a101_0x28d9,_0x5c3dbe=detectSqlType(_0x10f0c7),_0x46adf5=extractTables(_0x10f0c7),_0x39560c=extractParameters(_0x10f0c7);if(_0x5c3dbe[_0x2a5ba3(0x12f)])return{'valid':![],'sqlType':_0x5c3dbe,'tables':_0x46adf5,'parameters':_0x39560c,'message':_0x5c3dbe[_0x2a5ba3(0x13c)]||_0x5c3dbe['type']+_0x2a5ba3(0x13b)};if(_0x5c3dbe[_0x2a5ba3(0x12a)]===_0x2a5ba3(0x129))return{'valid':![],'sqlType':_0x5c3dbe,'tables':_0x46adf5,'parameters':_0x39560c,'message':_0x2a5ba3(0x149)};return{'valid':!![],'sqlType':_0x5c3dbe,'tables':_0x46adf5,'parameters':_0x39560c,'message':_0x5c3dbe[_0x2a5ba3(0x12a)]+_0x2a5ba3(0x143)+(_0x46adf5[_0x2a5ba3(0x145)]?_0x46adf5[_0x2a5ba3(0x133)](',\x20'):'unknown\x20table(s)')+(_0x39560c['length']?_0x2a5ba3(0x128)+_0x39560c[_0x2a5ba3(0x133)](',\x20'):'')};}
1
+ (function(_0x372456,_0x4d8ed8){const _0xb7e2dc=a116_0x34fa,_0x52574a=_0x372456();while(!![]){try{const _0x327448=-parseInt(_0xb7e2dc(0x1be))/0x1*(-parseInt(_0xb7e2dc(0x1df))/0x2)+parseInt(_0xb7e2dc(0x1e1))/0x3*(parseInt(_0xb7e2dc(0x1c6))/0x4)+-parseInt(_0xb7e2dc(0x1e4))/0x5+-parseInt(_0xb7e2dc(0x1d8))/0x6+-parseInt(_0xb7e2dc(0x1bd))/0x7+parseInt(_0xb7e2dc(0x1d5))/0x8*(parseInt(_0xb7e2dc(0x1de))/0x9)+parseInt(_0xb7e2dc(0x1c8))/0xa;if(_0x327448===_0x4d8ed8)break;else _0x52574a['push'](_0x52574a['shift']());}catch(_0xa8cece){_0x52574a['push'](_0x52574a['shift']());}}}(a116_0x11c3,0x35c37));export function detectSqlType(_0x3e1dd0){const _0x27d6a5=a116_0x34fa;if(!_0x3e1dd0?.[_0x27d6a5(0x1c3)]())return{'type':_0x27d6a5(0x1c9),'isSelectOnly':![],'isDangerous':![],'reason':_0x27d6a5(0x1d7)};const _0x197cd0=_0x3e1dd0[_0x27d6a5(0x1bf)](/#\{[^}]*\}/g,'?')[_0x27d6a5(0x1bf)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x27d6a5(0x1bf)](/\/\*[\s\S]*?\*\//g,'')[_0x27d6a5(0x1c3)](),_0x3fc275=_0x197cd0[_0x27d6a5(0x1d2)]('\x0a');let _0x4c638d='';for(const _0x2a357b of _0x3fc275){const _0x581b2b=_0x2a357b[_0x27d6a5(0x1c3)]();if(!_0x581b2b||_0x581b2b[_0x27d6a5(0x1d9)]('--')||_0x581b2b['startsWith']('/*'))continue;_0x4c638d=_0x581b2b;break;}const _0x40ebc1=_0x4c638d[_0x27d6a5(0x1cd)]();if(_0x40ebc1['startsWith']('SELECT')||_0x40ebc1['startsWith'](_0x27d6a5(0x1cf))){const _0x31841f=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x27d6a5(0x1dc)](_0x197cd0);return{'type':_0x27d6a5(0x1d4),'isSelectOnly':!_0x31841f,'isDangerous':_0x31841f,'reason':_0x31841f?_0x27d6a5(0x1e2):undefined};}if(_0x40ebc1['startsWith'](_0x27d6a5(0x1ce)))return{'type':_0x27d6a5(0x1ce),'isSelectOnly':![],'isDangerous':![]};if(_0x40ebc1[_0x27d6a5(0x1d9)](_0x27d6a5(0x1ca)))return{'type':_0x27d6a5(0x1ca),'isSelectOnly':![],'isDangerous':![]};if(_0x40ebc1[_0x27d6a5(0x1d9)](_0x27d6a5(0x1dd)))return{'type':_0x27d6a5(0x1dd),'isSelectOnly':![],'isDangerous':!![],'reason':_0x27d6a5(0x1db)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x27d6a5(0x1dc)](_0x40ebc1))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':_0x27d6a5(0x1c0)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x1997f7){const _0xf0fbf0=a116_0x34fa,_0x228c88=_0x1997f7[_0xf0fbf0(0x1bf)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0xf0fbf0(0x1bf)](/--.*$/gm,'')[_0xf0fbf0(0x1bf)](/\/\*[\s\S]*?\*\//g,''),_0xba8768=[],_0x1f5820=_0x228c88[_0xf0fbf0(0x1c4)](/FROM\s+([^\s,)(]+)/i);if(_0x1f5820?.[0x1])_0xba8768[_0xf0fbf0(0x1c7)](_0x1f5820[0x1][_0xf0fbf0(0x1bf)](/[`"]/g,''));for(const _0x35566c of _0x228c88['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x4bfc90=_0x35566c[0x1]?.[_0xf0fbf0(0x1bf)](/[`"]/g,'');if(_0x4bfc90&&!_0xba8768[_0xf0fbf0(0x1d3)](_0x4bfc90))_0xba8768[_0xf0fbf0(0x1c7)](_0x4bfc90);}const _0x58676d=_0x228c88['match'](/INTO\s+([^\s(]+)/i);if(_0x58676d?.[0x1]){const _0xfcb967=_0x58676d[0x1][_0xf0fbf0(0x1bf)](/[`"]/g,'');if(!_0xba8768[_0xf0fbf0(0x1d3)](_0xfcb967))_0xba8768['push'](_0xfcb967);}const _0x4dc9fc=_0x228c88['match'](/UPDATE\s+([^\s,)(]+)/i);if(_0x4dc9fc?.[0x1]){const _0x1a4e93=_0x4dc9fc[0x1][_0xf0fbf0(0x1bf)](/[`"]/g,'');if(!_0xba8768[_0xf0fbf0(0x1d3)](_0x1a4e93))_0xba8768[_0xf0fbf0(0x1c7)](_0x1a4e93);}return _0xba8768;}function extractParameters(_0x5215f1){const _0x4ae050=a116_0x34fa,_0x4309af=new Set();for(const _0x48ffe7 of _0x5215f1[_0x4ae050(0x1c5)](/#\{(\w+)\}/g))if(_0x48ffe7[0x1])_0x4309af[_0x4ae050(0x1bc)](_0x48ffe7[0x1]);for(const _0x1d7420 of _0x5215f1[_0x4ae050(0x1c5)](/\$\{(\w+)\}/g))if(_0x1d7420[0x1])_0x4309af[_0x4ae050(0x1bc)](_0x1d7420[0x1]);return Array[_0x4ae050(0x1c1)](_0x4309af);}export function validateSql(_0x2b612d){const _0x2a4776=a116_0x34fa,_0x17aec6=detectSqlType(_0x2b612d),_0x440c3d=extractTables(_0x2b612d),_0x41be6f=extractParameters(_0x2b612d);if(_0x17aec6[_0x2a4776(0x1e0)])return{'valid':![],'sqlType':_0x17aec6,'tables':_0x440c3d,'parameters':_0x41be6f,'message':_0x17aec6[_0x2a4776(0x1da)]||_0x17aec6[_0x2a4776(0x1e3)]+_0x2a4776(0x1c2)};if(_0x17aec6[_0x2a4776(0x1e3)]==='UNKNOWN')return{'valid':![],'sqlType':_0x17aec6,'tables':_0x440c3d,'parameters':_0x41be6f,'message':_0x2a4776(0x1d6)};return{'valid':!![],'sqlType':_0x17aec6,'tables':_0x440c3d,'parameters':_0x41be6f,'message':_0x17aec6['type']+_0x2a4776(0x1cb)+(_0x440c3d[_0x2a4776(0x1d1)]?_0x440c3d[_0x2a4776(0x1cc)](',\x20'):'unknown\x20table(s)')+(_0x41be6f[_0x2a4776(0x1d1)]?_0x2a4776(0x1d0)+_0x41be6f[_0x2a4776(0x1cc)](',\x20'):'')};}function a116_0x34fa(_0x529495,_0x1be4d3){_0x529495=_0x529495-0x1bc;const _0x11c3f0=a116_0x11c3();let _0x34fa83=_0x11c3f0[_0x529495];return _0x34fa83;}function a116_0x11c3(){const _0x4b52f6=['from','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','trim','match','matchAll','76QVqWhA','push','3685020rzpbCr','UNKNOWN','UPDATE','\x20query\x20targeting\x20','join','toUpperCase','INSERT','WITH','\x20with\x20parameters:\x20','length','split','includes','SELECT','101944juvyon','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','SQL\x20content\x20is\x20empty','374760eUAwiT','startsWith','reason','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','test','DELETE','27kwyrgY','387282jrlUoD','isDangerous','31830GciNZN','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','type','2083020DNeGkW','add','718781ydECeK','1GGiFPj','replace','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'];a116_0x11c3=function(){return _0x4b52f6;};return a116_0x11c3();}
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- const a102_0x274931=a102_0x36ab;(function(_0x25ec69,_0x2731be){const _0x17c7b6=a102_0x36ab,_0x269557=_0x25ec69();while(!![]){try{const _0xe46663=-parseInt(_0x17c7b6(0x105))/0x1*(parseInt(_0x17c7b6(0xf9))/0x2)+-parseInt(_0x17c7b6(0x116))/0x3+parseInt(_0x17c7b6(0xfc))/0x4+-parseInt(_0x17c7b6(0x112))/0x5*(parseInt(_0x17c7b6(0x10c))/0x6)+-parseInt(_0x17c7b6(0xfe))/0x7+parseInt(_0x17c7b6(0x113))/0x8+parseInt(_0x17c7b6(0x102))/0x9;if(_0xe46663===_0x2731be)break;else _0x269557['push'](_0x269557['shift']());}catch(_0x5b30f2){_0x269557['push'](_0x269557['shift']());}}}(a102_0x1be8,0xb80c8));import{CLI_BIN_NAME}from'./constant/cli.js';export class CliError extends Error{['code'];['exitCode'];[a102_0x274931(0x10e)];constructor(_0x3f6cfd,_0x25fb43,_0x391c4c,_0x265e88){const _0x440984=a102_0x274931;super(_0x391c4c),this[_0x440984(0xfa)]=_0x440984(0x107),this['code']=_0x3f6cfd,this['exitCode']=_0x25fb43,this[_0x440984(0x10e)]=_0x265e88;}}function a102_0x36ab(_0x3bcc43,_0x6023df){_0x3bcc43=_0x3bcc43-0xf9;const _0x1be88a=a102_0x1be8();let _0x36ab4e=_0x1be88a[_0x3bcc43];return _0x36ab4e;}export const CliErrors={'authRequired':_0x3f75c2=>new CliError(a102_0x274931(0x104),0x1,'Authentication\x20required',_0x3f75c2??a102_0x274931(0x11a)+CLI_BIN_NAME+a102_0x274931(0x109)),'configMissing':_0x2dbabb=>new CliError(a102_0x274931(0x108),0x1,'Configuration\x20file\x20not\x20found',_0x2dbabb??[a102_0x274931(0x114)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.',a102_0x274931(0x10f)+CLI_BIN_NAME+a102_0x274931(0x119)][a102_0x274931(0x111)](a102_0x274931(0x101))),'notInProject':()=>new CliError(a102_0x274931(0xfb),0x1,'Not\x20in\x20a\x20'+CLI_BIN_NAME+a102_0x274931(0x11b),a102_0x274931(0x117)),'apiError':(_0xf790bf,_0x4c6c8f)=>new CliError(a102_0x274931(0x106),0x2,_0xf790bf,_0x4c6c8f),'networkError':_0x2feb5d=>new CliError(a102_0x274931(0x10b),0x2,a102_0x274931(0x100)+_0x2feb5d,a102_0x274931(0x110)),'unknownCommand':_0x578c79=>new CliError('unknown_command',0x1,a102_0x274931(0x103)+_0x578c79,a102_0x274931(0x11a)+CLI_BIN_NAME+a102_0x274931(0xff)),'flagMissing':(_0x420c2c,_0x5f0f59)=>new CliError(a102_0x274931(0x10d),0x1,a102_0x274931(0x10a)+_0x420c2c,_0x5f0f59),'validation':(_0x5107e3,_0x5db94a)=>new CliError(a102_0x274931(0xfd),0x1,_0x5107e3,_0x5db94a),'cancelled':_0x33de9d=>new CliError(a102_0x274931(0x115),0x0,_0x33de9d??a102_0x274931(0x118),undefined)};function a102_0x1be8(){const _0x240dbf=['3806550RTgALs','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','Operation\x20cancelled.','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','Run\x20`','\x20project\x20directory','194OxInFD','name','not_in_project','3922296lrEWMY','validation_error','2325351PSMWaF','\x20--help`\x20to\x20see\x20available\x20commands.','Network\x20error:\x20','\x0a\x20\x20\x20\x20\x20\x20\x20','20886219SrqmIV','Unknown\x20command:\x20','auth_required','10826aYveZd','api_error','CliError','config_missing','\x20auth`\x20to\x20login\x20first.','Missing\x20required\x20flag:\x20--','network_error','160302LYYNDK','flag_missing','hint','Tip:\x20`','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','join','35cHftfH','2326264crReZb','Set\x20appcode\x20via\x20`','cancelled'];a102_0x1be8=function(){return _0x240dbf;};return a102_0x1be8();}
1
+ function a117_0x2a17(){const _0x1d787b=['\x20auth`\x20to\x20login\x20first.','validation_error','Not\x20in\x20a\x20','49encyKh','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','CliError','\x0a\x20\x20\x20\x20\x20\x20\x20','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','308565nhVdFH','join','Missing\x20required\x20flag:\x20--','99948iMKTZZ','84006wzYSkE','Network\x20error:\x20','exitCode','Run\x20`','config_missing','Tip:\x20`','\x20project\x20directory','Authentication\x20required','network_error','253cOvywv','Set\x20appcode\x20via\x20`','10yrzApl','65168JqEEgo','\x20--help`\x20to\x20see\x20available\x20commands.','92lOFfuE','2SboWsf','2033262vsYpAc','code','not_in_project','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','hint','flag_missing','cancelled','Unknown\x20command:\x20','name','49855qTHZZd','auth_required','unknown_command','Configuration\x20file\x20not\x20found','29847EyQzCo'];a117_0x2a17=function(){return _0x1d787b;};return a117_0x2a17();}const a117_0xdfad7b=a117_0x44b2;(function(_0x32c2c0,_0x1a1949){const _0x490d2f=a117_0x44b2,_0x124f0f=_0x32c2c0();while(!![]){try{const _0x59b52a=parseInt(_0x490d2f(0x103))/0x1*(-parseInt(_0x490d2f(0xf4))/0x2)+parseInt(_0x490d2f(0x110))/0x3+-parseInt(_0x490d2f(0xf3))/0x4*(-parseInt(_0x490d2f(0xff))/0x5)+-parseInt(_0x490d2f(0xf5))/0x6+-parseInt(_0x490d2f(0x107))/0x7*(-parseInt(_0x490d2f(0xf1))/0x8)+parseInt(_0x490d2f(0x10c))/0x9*(parseInt(_0x490d2f(0xf0))/0xa)+parseInt(_0x490d2f(0xee))/0xb*(parseInt(_0x490d2f(0x10f))/0xc);if(_0x59b52a===_0x1a1949)break;else _0x124f0f['push'](_0x124f0f['shift']());}catch(_0x63befa){_0x124f0f['push'](_0x124f0f['shift']());}}}(a117_0x2a17,0x29ddd));import{CLI_BIN_NAME}from'./constant/cli.js';function a117_0x44b2(_0x28a007,_0x8d172c){_0x28a007=_0x28a007-0xe7;const _0x2a17f5=a117_0x2a17();let _0x44b28f=_0x2a17f5[_0x28a007];return _0x44b28f;}export class CliError extends Error{[a117_0xdfad7b(0xf6)];['exitCode'];[a117_0xdfad7b(0xfa)];constructor(_0x17e49f,_0x9bcd2,_0x1cffd2,_0x119b8c){const _0x27a75b=a117_0xdfad7b;super(_0x1cffd2),this[_0x27a75b(0xfe)]=_0x27a75b(0x109),this[_0x27a75b(0xf6)]=_0x17e49f,this[_0x27a75b(0xe7)]=_0x9bcd2,this['hint']=_0x119b8c;}}export const CliErrors={'authRequired':_0x1179ea=>new CliError(a117_0xdfad7b(0x100),0x1,a117_0xdfad7b(0xec),_0x1179ea??a117_0xdfad7b(0xe8)+CLI_BIN_NAME+a117_0xdfad7b(0x104)),'configMissing':_0x3e0c19=>new CliError(a117_0xdfad7b(0xe9),0x1,a117_0xdfad7b(0x102),_0x3e0c19??[a117_0xdfad7b(0xef)+CLI_BIN_NAME+a117_0xdfad7b(0xf8),a117_0xdfad7b(0xea)+CLI_BIN_NAME+a117_0xdfad7b(0x108)][a117_0xdfad7b(0x10d)](a117_0xdfad7b(0x10a))),'notInProject':()=>new CliError(a117_0xdfad7b(0xf7),0x1,a117_0xdfad7b(0x106)+CLI_BIN_NAME+a117_0xdfad7b(0xeb),a117_0xdfad7b(0xf9)),'apiError':(_0x1b12ff,_0x88d1f5)=>new CliError('api_error',0x2,_0x1b12ff,_0x88d1f5),'networkError':_0x4246fc=>new CliError(a117_0xdfad7b(0xed),0x2,a117_0xdfad7b(0x111)+_0x4246fc,a117_0xdfad7b(0x10b)),'unknownCommand':_0x278b6e=>new CliError(a117_0xdfad7b(0x101),0x1,a117_0xdfad7b(0xfd)+_0x278b6e,a117_0xdfad7b(0xe8)+CLI_BIN_NAME+a117_0xdfad7b(0xf2)),'flagMissing':(_0x321d75,_0x5c8e0a)=>new CliError(a117_0xdfad7b(0xfb),0x1,a117_0xdfad7b(0x10e)+_0x321d75,_0x5c8e0a),'validation':(_0x2c8ae9,_0x27b7c8)=>new CliError(a117_0xdfad7b(0x105),0x1,_0x2c8ae9,_0x27b7c8),'cancelled':_0x30bf2e=>new CliError(a117_0xdfad7b(0xfc),0x0,_0x30bf2e??'Operation\x20cancelled.',undefined)};
@@ -1 +1 @@
1
- function a103_0x3c49(_0x3978e3,_0x52cf81){_0x3978e3=_0x3978e3-0x8c;const _0x91602d=a103_0x9160();let _0x3c49e4=_0x91602d[_0x3978e3];return _0x3c49e4;}(function(_0x2490a6,_0x4be9c4){const _0x2e672e=a103_0x3c49,_0x538325=_0x2490a6();while(!![]){try{const _0xe6705b=-parseInt(_0x2e672e(0x90))/0x1*(parseInt(_0x2e672e(0x97))/0x2)+parseInt(_0x2e672e(0x8c))/0x3+parseInt(_0x2e672e(0x9c))/0x4+parseInt(_0x2e672e(0x94))/0x5+-parseInt(_0x2e672e(0x96))/0x6+-parseInt(_0x2e672e(0x91))/0x7*(-parseInt(_0x2e672e(0x99))/0x8)+-parseInt(_0x2e672e(0x95))/0x9;if(_0xe6705b===_0x4be9c4)break;else _0x538325['push'](_0x538325['shift']());}catch(_0x57ddf3){_0x538325['push'](_0x538325['shift']());}}}(a103_0x9160,0x1a2b4));export function buildAllFlags(_0x5e0ce9){const _0x16d457=a103_0x3c49,_0x1ee8a4=[..._0x5e0ce9['flags']];return _0x5e0ce9[_0x16d457(0x9f)]&&_0x1ee8a4[_0x16d457(0xa1)]({'name':'dry-run','type':_0x16d457(0x8e),'description':_0x16d457(0x8f)}),_0x5e0ce9[_0x16d457(0x92)]!==![]&&_0x1ee8a4[_0x16d457(0xa1)]({'name':_0x16d457(0x8d),'type':_0x16d457(0x93),'default':_0x5e0ce9['defaultOutputFormat']??_0x16d457(0x9e),'enum':[_0x16d457(0x9b),_0x16d457(0x9e),_0x16d457(0x98)],'description':'Output\x20format'}),_0x5e0ce9[_0x16d457(0x9a)]===_0x16d457(0xa0)&&_0x1ee8a4[_0x16d457(0xa1)]({'name':'yes','type':_0x16d457(0x8e),'description':_0x16d457(0x9d)}),_0x1ee8a4;}function a103_0x9160(){const _0x2aaffc=['Preview\x20the\x20operation\x20without\x20executing','62oetXSw','7STYczu','hasFormat','string','122045CAYsSj','206640KMKXGu','1027578TYROwR','1884suiMiZ','compress','1152304LIgnsM','risk','json','387484DuebJr','Skip\x20confirmation\x20prompt','pretty','dryRun','high-risk-write','push','283491lAhyMe','format','boolean'];a103_0x9160=function(){return _0x2aaffc;};return a103_0x9160();}
1
+ (function(_0x5395ea,_0x4481ae){const _0x55375b=a118_0x284d,_0x1aaa57=_0x5395ea();while(!![]){try{const _0x37b23e=-parseInt(_0x55375b(0x173))/0x1+-parseInt(_0x55375b(0x170))/0x2*(parseInt(_0x55375b(0x179))/0x3)+parseInt(_0x55375b(0x17c))/0x4+parseInt(_0x55375b(0x17b))/0x5*(parseInt(_0x55375b(0x17f))/0x6)+parseInt(_0x55375b(0x188))/0x7*(-parseInt(_0x55375b(0x17e))/0x8)+parseInt(_0x55375b(0x177))/0x9*(parseInt(_0x55375b(0x175))/0xa)+-parseInt(_0x55375b(0x182))/0xb;if(_0x37b23e===_0x4481ae)break;else _0x1aaa57['push'](_0x1aaa57['shift']());}catch(_0x349417){_0x1aaa57['push'](_0x1aaa57['shift']());}}}(a118_0x58d7,0x1e2d0));function a118_0x58d7(){const _0x22835c=['dry-run','Output\x20format','boolean','2502ucvTxN','Preview\x20the\x20operation\x20without\x20executing','defaultOutputFormat','35313qlVSjN','yes','50dFAPAS','push','280143fTmvGX','pretty','51RVBRmf','compress','35xpJBPk','525044cgcmUz','json','8BMktFg','190668qOrAaE','Skip\x20confirmation\x20prompt','dryRun','2172005mZPKhO','flags','format','string','risk','hasFormat','921949MgQqmC'];a118_0x58d7=function(){return _0x22835c;};return a118_0x58d7();}function a118_0x284d(_0x1a00a2,_0x1fe63e){_0x1a00a2=_0x1a00a2-0x170;const _0x58d7ef=a118_0x58d7();let _0x284db1=_0x58d7ef[_0x1a00a2];return _0x284db1;}export function buildAllFlags(_0xff28d9){const _0x6903ad=a118_0x284d,_0x3ef88d=[..._0xff28d9[_0x6903ad(0x183)]];return _0xff28d9[_0x6903ad(0x181)]&&_0x3ef88d[_0x6903ad(0x176)]({'name':_0x6903ad(0x189),'type':_0x6903ad(0x18b),'description':_0x6903ad(0x171)}),_0xff28d9[_0x6903ad(0x187)]!==![]&&_0x3ef88d['push']({'name':_0x6903ad(0x184),'type':_0x6903ad(0x185),'default':_0xff28d9[_0x6903ad(0x172)]??_0x6903ad(0x178),'enum':[_0x6903ad(0x17d),_0x6903ad(0x178),_0x6903ad(0x17a)],'description':_0x6903ad(0x18a)}),_0xff28d9[_0x6903ad(0x186)]==='high-risk-write'&&_0x3ef88d[_0x6903ad(0x176)]({'name':_0x6903ad(0x174),'type':'boolean','description':_0x6903ad(0x180)}),_0x3ef88d;}
@@ -1 +1 @@
1
- (function(_0x98b98f,_0x29ce27){const _0x3047b2=a104_0x14fb,_0x23c024=_0x98b98f();while(!![]){try{const _0xd6841e=-parseInt(_0x3047b2(0x151))/0x1*(-parseInt(_0x3047b2(0x13d))/0x2)+parseInt(_0x3047b2(0x148))/0x3+parseInt(_0x3047b2(0x135))/0x4*(-parseInt(_0x3047b2(0x156))/0x5)+parseInt(_0x3047b2(0x144))/0x6*(parseInt(_0x3047b2(0x149))/0x7)+parseInt(_0x3047b2(0x137))/0x8+parseInt(_0x3047b2(0x14a))/0x9+-parseInt(_0x3047b2(0x136))/0xa;if(_0xd6841e===_0x29ce27)break;else _0x23c024['push'](_0x23c024['shift']());}catch(_0x269bab){_0x23c024['push'](_0x23c024['shift']());}}}(a104_0x97aa,0xbb858));import{CliErrors}from'../errors.js';export function parseFlags(_0x441b36,_0x16f9c9){const _0x13a0d7=a104_0x14fb,_0x2549d1={};for(const _0x39e023 of _0x441b36){const _0xd1a4b3=_0x16f9c9[_0x39e023[_0x13a0d7(0x157)]]??_0x16f9c9[toCamelCase(_0x39e023[_0x13a0d7(0x157)])];if(_0xd1a4b3===undefined||_0xd1a4b3===null){_0x39e023[_0x13a0d7(0x13f)]!==undefined&&(_0x2549d1[_0x39e023[_0x13a0d7(0x157)]]=_0x39e023[_0x13a0d7(0x13f)]);continue;}_0x2549d1[_0x39e023[_0x13a0d7(0x157)]]=coerce(_0x39e023,_0xd1a4b3);}for(const _0x4f0e1c of[_0x13a0d7(0x13c),'dryRun',_0x13a0d7(0x140),_0x13a0d7(0x150),'jq']){const _0xa81d84=_0x16f9c9[_0x4f0e1c];if(_0xa81d84!==undefined){const _0x247a89=_0x4f0e1c===_0x13a0d7(0x146)?_0x13a0d7(0x13c):_0x4f0e1c;_0x2549d1[_0x247a89]=_0xa81d84;}}return _0x2549d1;}function a104_0x14fb(_0x3de4ed,_0x50aa07){_0x3de4ed=_0x3de4ed-0x135;const _0x97aaae=a104_0x97aa();let _0x14fb97=_0x97aaae[_0x3de4ed];return _0x14fb97;}export function validateFlags(_0x577409,_0x17e616,_0x187b61){const _0x2e553e=a104_0x14fb;for(const _0x3dc16b of _0x577409){const _0x433075=_0x17e616[_0x3dc16b[_0x2e553e(0x157)]];if(_0x3dc16b[_0x2e553e(0x155)]&&(_0x433075===undefined||_0x433075===''))throw CliErrors[_0x2e553e(0x142)](_0x3dc16b[_0x2e553e(0x157)],'--'+_0x3dc16b['name']+_0x2e553e(0x152)+_0x187b61+'`.');if(_0x3dc16b[_0x2e553e(0x143)]&&_0x3dc16b[_0x2e553e(0x143)]['length']>0x0&&_0x433075!==undefined&&_0x433075!==''){if(!_0x3dc16b[_0x2e553e(0x143)]['includes'](String(_0x433075)))throw CliErrors['validation'](_0x2e553e(0x154)+_0x433075+_0x2e553e(0x153)+_0x3dc16b['name']+_0x2e553e(0x14e)+_0x3dc16b[_0x2e553e(0x143)][_0x2e553e(0x14d)](',\x20'));}if(_0x3dc16b['pattern']&&_0x433075!==undefined&&_0x433075!==''){if(!_0x3dc16b[_0x2e553e(0x13e)][_0x2e553e(0x141)][_0x2e553e(0x13a)](String(_0x433075)))throw CliErrors[_0x2e553e(0x14b)]('Invalid\x20--'+_0x3dc16b['name']+':\x20expected\x20'+_0x3dc16b['pattern'][_0x2e553e(0x139)]+_0x2e553e(0x14f)+_0x433075+'\x22.');}}}function a104_0x97aa(){const _0x234a53=['format','1743MutsUN','\x20is\x20required\x20for\x20`','\x22\x20for\x20--','Invalid\x20value\x20\x22','required','65930Nxubbx','name','128vEqCqi','25467480dTEqvr','12191080TOkemb','number','description','test','\x20expects\x20a\x20number,\x20got\x20\x22','dry-run','186EiSKHW','pattern','default','yes','regex','flagMissing','enum','103254tzZwvR','boolean','dryRun','replace','1801734HJgpMH','21oknUMI','12587391rvPUDE','validation','true','join','.\x20Allowed:\x20',',\x20got\x20\x22'];a104_0x97aa=function(){return _0x234a53;};return a104_0x97aa();}function coerce(_0x460aaf,_0x385d0c){const _0x50e633=a104_0x14fb;switch(_0x460aaf['type']){case _0x50e633(0x145):return _0x385d0c===!![]||_0x385d0c===_0x50e633(0x14c);case _0x50e633(0x138):{const _0x282c84=Number(_0x385d0c);if(isNaN(_0x282c84))throw CliErrors[_0x50e633(0x14b)]('--'+_0x460aaf[_0x50e633(0x157)]+_0x50e633(0x13b)+_0x385d0c+'\x22');return _0x282c84;}default:return String(_0x385d0c);}}function toCamelCase(_0x6e7301){const _0x12df52=a104_0x14fb;return _0x6e7301[_0x12df52(0x147)](/-([a-z])/g,(_0x17fba1,_0x1d6cf5)=>_0x1d6cf5['toUpperCase']());}
1
+ (function(_0xcf991,_0x3d7ddd){const _0x54e626=a119_0x22a5,_0x105475=_0xcf991();while(!![]){try{const _0x5e200d=parseInt(_0x54e626(0x1cd))/0x1+-parseInt(_0x54e626(0x1c8))/0x2+-parseInt(_0x54e626(0x1c4))/0x3*(parseInt(_0x54e626(0x1d9))/0x4)+-parseInt(_0x54e626(0x1d0))/0x5*(-parseInt(_0x54e626(0x1d2))/0x6)+-parseInt(_0x54e626(0x1cb))/0x7*(-parseInt(_0x54e626(0x1ce))/0x8)+parseInt(_0x54e626(0x1c5))/0x9*(-parseInt(_0x54e626(0x1bf))/0xa)+parseInt(_0x54e626(0x1bc))/0xb*(parseInt(_0x54e626(0x1bd))/0xc);if(_0x5e200d===_0x3d7ddd)break;else _0x105475['push'](_0x105475['shift']());}catch(_0x246296){_0x105475['push'](_0x105475['shift']());}}}(a119_0x1c75,0x55978));import{CliErrors}from'../errors.js';function a119_0x1c75(){const _0x207de8=['default','dryRun','boolean','\x20expects\x20a\x20number,\x20got\x20\x22','7172aZmNpc','enum',',\x20got\x20\x22','required','toUpperCase',':\x20expected\x20','validation','17831xRyxtW','3636zGcisn','includes','7860aUNYeE','pattern','\x20is\x20required\x20for\x20`','test','length','957YGKjcT','1467HcxNPf','Invalid\x20--','name','486542FvRBib','true','dry-run','7QemuNG','type','530855IaEsDZ','85304HAiNiK','flagMissing','1306295DbgpYS','regex','6sDkemQ','Invalid\x20value\x20\x22','number'];a119_0x1c75=function(){return _0x207de8;};return a119_0x1c75();}export function parseFlags(_0xb854d4,_0x1fc94b){const _0x231cdc=a119_0x22a5,_0x499295={};for(const _0x14f1eb of _0xb854d4){const _0x25ae0d=_0x1fc94b[_0x14f1eb[_0x231cdc(0x1c7)]]??_0x1fc94b[toCamelCase(_0x14f1eb[_0x231cdc(0x1c7)])];if(_0x25ae0d===undefined||_0x25ae0d===null){_0x14f1eb['default']!==undefined&&(_0x499295[_0x14f1eb[_0x231cdc(0x1c7)]]=_0x14f1eb[_0x231cdc(0x1d5)]);continue;}_0x499295[_0x14f1eb[_0x231cdc(0x1c7)]]=coerce(_0x14f1eb,_0x25ae0d);}for(const _0x507705 of[_0x231cdc(0x1ca),_0x231cdc(0x1d6),'yes','format','jq']){const _0x1970a5=_0x1fc94b[_0x507705];if(_0x1970a5!==undefined){const _0x19e7cd=_0x507705==='dryRun'?_0x231cdc(0x1ca):_0x507705;_0x499295[_0x19e7cd]=_0x1970a5;}}return _0x499295;}export function validateFlags(_0x594bf5,_0x22c9bf,_0x552d81){const _0x52da43=a119_0x22a5;for(const _0x56ca8f of _0x594bf5){const _0x53fddb=_0x22c9bf[_0x56ca8f[_0x52da43(0x1c7)]];if(_0x56ca8f[_0x52da43(0x1dc)]&&(_0x53fddb===undefined||_0x53fddb===''))throw CliErrors[_0x52da43(0x1cf)](_0x56ca8f[_0x52da43(0x1c7)],'--'+_0x56ca8f[_0x52da43(0x1c7)]+_0x52da43(0x1c1)+_0x552d81+'`.');if(_0x56ca8f[_0x52da43(0x1da)]&&_0x56ca8f['enum'][_0x52da43(0x1c3)]>0x0&&_0x53fddb!==undefined&&_0x53fddb!==''){if(!_0x56ca8f[_0x52da43(0x1da)][_0x52da43(0x1be)](String(_0x53fddb)))throw CliErrors[_0x52da43(0x1bb)](_0x52da43(0x1d3)+_0x53fddb+'\x22\x20for\x20--'+_0x56ca8f[_0x52da43(0x1c7)]+'.\x20Allowed:\x20'+_0x56ca8f[_0x52da43(0x1da)]['join'](',\x20'));}if(_0x56ca8f['pattern']&&_0x53fddb!==undefined&&_0x53fddb!==''){if(!_0x56ca8f['pattern'][_0x52da43(0x1d1)][_0x52da43(0x1c2)](String(_0x53fddb)))throw CliErrors[_0x52da43(0x1bb)](_0x52da43(0x1c6)+_0x56ca8f[_0x52da43(0x1c7)]+_0x52da43(0x1ba)+_0x56ca8f[_0x52da43(0x1c0)]['description']+_0x52da43(0x1db)+_0x53fddb+'\x22.');}}}function coerce(_0x5dbb7e,_0x4d47f4){const _0x2dd648=a119_0x22a5;switch(_0x5dbb7e[_0x2dd648(0x1cc)]){case _0x2dd648(0x1d7):return _0x4d47f4===!![]||_0x4d47f4===_0x2dd648(0x1c9);case _0x2dd648(0x1d4):{const _0x15380f=Number(_0x4d47f4);if(isNaN(_0x15380f))throw CliErrors['validation']('--'+_0x5dbb7e[_0x2dd648(0x1c7)]+_0x2dd648(0x1d8)+_0x4d47f4+'\x22');return _0x15380f;}default:return String(_0x4d47f4);}}function a119_0x22a5(_0x9485a9,_0x5f5a7c){_0x9485a9=_0x9485a9-0x1ba;const _0x1c755b=a119_0x1c75();let _0x22a5d3=_0x1c755b[_0x9485a9];return _0x22a5d3;}function toCamelCase(_0x2ad0cf){const _0x2b1b4d=a119_0x22a5;return _0x2ad0cf['replace'](/-([a-z])/g,(_0x261ee3,_0x2c56d6)=>_0x2c56d6[_0x2b1b4d(0x1dd)]());}