@lovrabet/rabetbase-cli 2.3.2 → 2.3.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.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/generate.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/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.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/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/flags.js +1 -1
  48. package/lib/commands/common/validate.js +1 -1
  49. package/lib/commands/config/get.js +1 -1
  50. package/lib/commands/config/index.js +1 -1
  51. package/lib/commands/config/list.js +1 -1
  52. package/lib/commands/config/set.js +1 -1
  53. package/lib/commands/config/shared.js +1 -1
  54. package/lib/commands/data/filter.js +1 -1
  55. package/lib/commands/data/getOne.js +1 -1
  56. package/lib/commands/data/index.js +1 -1
  57. package/lib/commands/data/shared.js +1 -1
  58. package/lib/commands/dataset/business-group-update.js +1 -1
  59. package/lib/commands/dataset/capability.js +1 -1
  60. package/lib/commands/dataset/delete.js +1 -1
  61. package/lib/commands/dataset/detail.js +1 -1
  62. package/lib/commands/dataset/extend-update.js +1 -1
  63. package/lib/commands/dataset/field-update.js +1 -1
  64. package/lib/commands/dataset/generate.js +1 -0
  65. package/lib/commands/dataset/index.js +1 -1
  66. package/lib/commands/dataset/list.js +1 -1
  67. package/lib/commands/dataset/operations.js +1 -1
  68. package/lib/commands/dataset/relation-audit.js +1 -1
  69. package/lib/commands/dataset/relation-create.js +1 -1
  70. package/lib/commands/dataset/relation-delete.js +1 -1
  71. package/lib/commands/dataset/relation-shared.js +1 -1
  72. package/lib/commands/dataset/relation-update.js +1 -1
  73. package/lib/commands/dataset/relations.js +1 -1
  74. package/lib/commands/dataset/rename.js +1 -1
  75. package/lib/commands/dataset/restore.js +1 -1
  76. package/lib/commands/db/analyze-cancel.js +1 -1
  77. package/lib/commands/db/analyze-start.js +1 -1
  78. package/lib/commands/db/analyze-status.js +1 -1
  79. package/lib/commands/db/create.js +1 -1
  80. package/lib/commands/db/delete.js +1 -1
  81. package/lib/commands/db/detail.js +1 -1
  82. package/lib/commands/db/diff.js +1 -1
  83. package/lib/commands/db/index.js +1 -1
  84. package/lib/commands/db/list.js +1 -1
  85. package/lib/commands/db/shared.js +1 -1
  86. package/lib/commands/db/tables.js +1 -1
  87. package/lib/commands/db/test.js +1 -1
  88. package/lib/commands/db/update.js +1 -1
  89. package/lib/commands/doctor.js +1 -1
  90. package/lib/commands/init/index.js +1 -1
  91. package/lib/commands/issue/index.js +1 -1
  92. package/lib/commands/issue/nudge.js +1 -1
  93. package/lib/commands/issue/report.js +1 -1
  94. package/lib/commands/issue/shared.js +1 -1
  95. package/lib/commands/logs/index.js +1 -1
  96. package/lib/commands/menu/index.js +1 -1
  97. package/lib/commands/menu/list.js +1 -1
  98. package/lib/commands/menu/shared/compare-table.js +1 -1
  99. package/lib/commands/menu/shared/index.js +1 -1
  100. package/lib/commands/menu/shared/inquirer.js +1 -1
  101. package/lib/commands/menu/shared/local-pages.js +1 -1
  102. package/lib/commands/menu/shared/logic.js +1 -1
  103. package/lib/commands/menu/shared/service.js +1 -1
  104. package/lib/commands/menu/shared/sync-core.js +1 -1
  105. package/lib/commands/menu/shared/update-core.js +1 -1
  106. package/lib/commands/menu/shared/valid-url.js +1 -1
  107. package/lib/commands/menu/sync.js +1 -1
  108. package/lib/commands/menu/update.js +1 -1
  109. package/lib/commands/page/generate-start.js +1 -1
  110. package/lib/commands/page/generate-status.js +1 -1
  111. package/lib/commands/page/index.js +1 -1
  112. package/lib/commands/page/pull.js +1 -1
  113. package/lib/commands/page/push.js +1 -1
  114. package/lib/commands/page/relation-audit.js +1 -1
  115. package/lib/commands/page/shared.js +1 -1
  116. package/lib/commands/page/standard-page-status.js +1 -1
  117. package/lib/commands/page/sync.js +1 -1
  118. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  119. package/lib/commands/project/create/format-elapsed.js +1 -1
  120. package/lib/commands/project/create/main.js +1 -1
  121. package/lib/commands/project/create/non-interactive.js +1 -1
  122. package/lib/commands/project/create/project-template-path.js +1 -1
  123. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  124. package/lib/commands/project/create/use-format-code.js +1 -1
  125. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  126. package/lib/commands/project/index.js +1 -1
  127. package/lib/commands/project/init.js +1 -1
  128. package/lib/commands/project/upgrade.js +1 -1
  129. package/lib/commands/registry.js +1 -1
  130. package/lib/commands/run/index.js +1 -1
  131. package/lib/commands/schema.js +1 -1
  132. package/lib/commands/sql/create.js +1 -1
  133. package/lib/commands/sql/delete.js +1 -1
  134. package/lib/commands/sql/detail.js +1 -1
  135. package/lib/commands/sql/exec.js +1 -1
  136. package/lib/commands/sql/index.js +1 -1
  137. package/lib/commands/sql/list.js +1 -1
  138. package/lib/commands/sql/pull.js +1 -1
  139. package/lib/commands/sql/push.js +1 -1
  140. package/lib/commands/sql/save.js +1 -1
  141. package/lib/commands/sql/shared.js +1 -1
  142. package/lib/commands/sql/status.js +1 -1
  143. package/lib/commands/sql/validate.js +1 -1
  144. package/lib/commands/workspace/index.js +1 -1
  145. package/lib/config/schema.js +1 -1
  146. package/lib/constant/cdn.js +1 -1
  147. package/lib/constant/cli.js +1 -1
  148. package/lib/constant/defaults.js +1 -1
  149. package/lib/constant/domain.js +1 -1
  150. package/lib/constant/env.js +1 -1
  151. package/lib/constant/output.js +1 -1
  152. package/lib/constant/paths.js +1 -1
  153. package/lib/constant/risk.js +1 -1
  154. package/lib/context/app-resolver.js +1 -1
  155. package/lib/context/auth-resolver.js +1 -1
  156. package/lib/context/config-loader.js +1 -1
  157. package/lib/context.js +1 -1
  158. package/lib/core/alias-resolver.js +1 -1
  159. package/lib/core/api-client.js +1 -1
  160. package/lib/core/bff/config.js +1 -1
  161. package/lib/core/bff/file-system.js +1 -1
  162. package/lib/core/bff/hash.js +1 -1
  163. package/lib/core/bff/lock.js +1 -1
  164. package/lib/core/bff/utils.js +1 -1
  165. package/lib/core/db-resolver.js +1 -1
  166. package/lib/core/page/file-system.js +1 -1
  167. package/lib/core/page/hash.js +1 -1
  168. package/lib/core/page/lock.js +1 -1
  169. package/lib/core/sql-sync/config.js +1 -1
  170. package/lib/core/sql-sync/file-system.js +1 -1
  171. package/lib/core/sql-sync/hash.js +1 -1
  172. package/lib/core/sql-sync/lock.js +1 -1
  173. package/lib/core/sql-sync/utils.js +1 -1
  174. package/lib/core/sql-validator.js +1 -1
  175. package/lib/errors.js +1 -1
  176. package/lib/framework/build-all-flags.js +1 -1
  177. package/lib/framework/flags.js +1 -1
  178. package/lib/framework/help.js +1 -1
  179. package/lib/framework/index.js +1 -1
  180. package/lib/framework/output.js +1 -1
  181. package/lib/framework/response.js +1 -1
  182. package/lib/framework/runner-alias.js +1 -1
  183. package/lib/framework/runner.js +1 -1
  184. package/lib/framework/schema-export.js +1 -1
  185. package/lib/framework/types.js +1 -1
  186. package/lib/generated/build-info.js +1 -1
  187. package/lib/help.js +1 -1
  188. package/lib/skills/main.js +1 -1
  189. package/lib/skills/npx-skills-add.js +1 -1
  190. package/lib/telemetry/cli-command-trace.js +1 -1
  191. package/lib/telemetry/cli-help-trace.js +1 -1
  192. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  193. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  194. package/lib/telemetry/send-cli-trace-log.js +1 -1
  195. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  196. package/lib/utils/ai_config.js +1 -1
  197. package/lib/utils/apply-jq-filter.js +1 -1
  198. package/lib/utils/cdn-config.js +1 -1
  199. package/lib/utils/check-sdk-version.js +1 -1
  200. package/lib/utils/cli-version-check.js +1 -1
  201. package/lib/utils/cli-version-policy.js +1 -1
  202. package/lib/utils/config.js +1 -1
  203. package/lib/utils/copy-directory.js +1 -1
  204. package/lib/utils/entity-with-id.js +1 -1
  205. package/lib/utils/file-utils.js +1 -1
  206. package/lib/utils/guides-cdn.js +1 -1
  207. package/lib/utils/http-client.js +1 -1
  208. package/lib/utils/is-non-interactive.js +1 -1
  209. package/lib/utils/logger.js +1 -1
  210. package/lib/utils/params.js +1 -1
  211. package/lib/utils/platform.js +1 -1
  212. package/lib/utils/rules-cdn.js +1 -1
  213. package/lib/utils/sleep.js +1 -1
  214. package/lib/utils/template-replacer.js +1 -1
  215. package/lib/utils/update-notice.js +1 -1
  216. package/lib/utils/version.js +1 -1
  217. package/lib/utils/with-active-cookie.js +1 -1
  218. package/lib/utils/write-cli-side-channel.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a149_0x8d0c8b=a149_0x1bf3;(function(_0x1d1feb,_0x2e8b35){const _0x58c23f=a149_0x1bf3,_0x59e0f9=_0x1d1feb();while(!![]){try{const _0x366098=-parseInt(_0x58c23f(0x183))/0x1*(-parseInt(_0x58c23f(0x188))/0x2)+parseInt(_0x58c23f(0x17a))/0x3+parseInt(_0x58c23f(0x187))/0x4*(parseInt(_0x58c23f(0x17f))/0x5)+-parseInt(_0x58c23f(0x184))/0x6+-parseInt(_0x58c23f(0x186))/0x7*(parseInt(_0x58c23f(0x17b))/0x8)+parseInt(_0x58c23f(0x182))/0x9*(parseInt(_0x58c23f(0x185))/0xa)+-parseInt(_0x58c23f(0x17e))/0xb*(parseInt(_0x58c23f(0x181))/0xc);if(_0x366098===_0x2e8b35)break;else _0x59e0f9['push'](_0x59e0f9['shift']());}catch(_0xb77fbb){_0x59e0f9['push'](_0x59e0f9['shift']());}}}(a149_0x4b1c,0x5cd79));function a149_0x1bf3(_0xde9b7,_0x32a49a){_0xde9b7=_0xde9b7-0x17a;const _0x4b1c52=a149_0x4b1c();let _0x1bf3a8=_0x4b1c52[_0xde9b7];return _0x1bf3a8;}export const RABETBASE_ENV_VALUES=[a149_0x8d0c8b(0x17d),a149_0x8d0c8b(0x17c)];function a149_0x4b1c(){const _0x179e6d=['production','48103hQRGAT','15rVMvOk','online','1572tITdQD','126kqAhsU','2315xiDFWL','2443170uSYlej','162510kLiDRj','14rNkDYr','448924nUTXjD','212rgtihk','development','1916886jRPPrx','352880QNgRBU','daily'];a149_0x4b1c=function(){return _0x179e6d;};return a149_0x4b1c();}export function normalizeEnv(_0x448f5b){const _0x2a8c2a=a149_0x8d0c8b;return _0x448f5b===_0x2a8c2a(0x180)?'production':_0x448f5b;}export function isProduction(_0x4356c0){return normalizeEnv(_0x4356c0)==='production';}export function isDaily(_0x4efa3a){const _0x32320a=a149_0x8d0c8b;return normalizeEnv(_0x4efa3a)===_0x32320a(0x17c);}export function isDev(_0x293ced){const _0x78016=a149_0x8d0c8b,_0x29e642=normalizeEnv(_0x293ced);return _0x29e642===_0x78016(0x189)||_0x29e642==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a149_0x8d0c8b(0x17d));export function getEnv(){return env;}export function initEnv(_0x42c46e){env=normalizeEnv(_0x42c46e);}
1
+ const a150_0x354d29=a150_0x4e62;(function(_0x150a69,_0x17f94e){const _0x32e3c1=a150_0x4e62,_0x1cb49d=_0x150a69();while(!![]){try{const _0x17575f=-parseInt(_0x32e3c1(0x13e))/0x1*(parseInt(_0x32e3c1(0x140))/0x2)+parseInt(_0x32e3c1(0x13f))/0x3*(-parseInt(_0x32e3c1(0x139))/0x4)+-parseInt(_0x32e3c1(0x143))/0x5*(parseInt(_0x32e3c1(0x13b))/0x6)+-parseInt(_0x32e3c1(0x142))/0x7+parseInt(_0x32e3c1(0x138))/0x8*(-parseInt(_0x32e3c1(0x137))/0x9)+-parseInt(_0x32e3c1(0x13a))/0xa+parseInt(_0x32e3c1(0x13c))/0xb;if(_0x17575f===_0x17f94e)break;else _0x1cb49d['push'](_0x1cb49d['shift']());}catch(_0x4a34d6){_0x1cb49d['push'](_0x1cb49d['shift']());}}}(a150_0x5be1,0x3039d));export const RABETBASE_ENV_VALUES=['production',a150_0x354d29(0x13d)];export function normalizeEnv(_0x116a3c){const _0x1383bd=a150_0x354d29;return _0x116a3c===_0x1383bd(0x145)?_0x1383bd(0x144):_0x116a3c;}export function isProduction(_0x412ede){const _0xb2e387=a150_0x354d29;return normalizeEnv(_0x412ede)===_0xb2e387(0x144);}function a150_0x5be1(){const _0x20cadc=['68330TUKefA','production','online','dev','673569BLpeRk','8ySHkfh','1576eoLIlr','1759270CfyKhz','138EEZssx','10636670VNepCd','daily','7889KNuYUx','843FHSaXd','10wpBVeY','development','379344ntYMNh'];a150_0x5be1=function(){return _0x20cadc;};return a150_0x5be1();}function a150_0x4e62(_0x53b6d3,_0x5e173b){_0x53b6d3=_0x53b6d3-0x136;const _0x5be1b0=a150_0x5be1();let _0x4e62c3=_0x5be1b0[_0x53b6d3];return _0x4e62c3;}export function isDaily(_0x2119f8){const _0x76803c=a150_0x354d29;return normalizeEnv(_0x2119f8)===_0x76803c(0x13d);}export function isDev(_0x38e431){const _0x1160ff=a150_0x354d29,_0x972775=normalizeEnv(_0x38e431);return _0x972775===_0x1160ff(0x141)||_0x972775===_0x1160ff(0x136);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a150_0x354d29(0x144));export function getEnv(){return env;}export function initEnv(_0x2ee1c6){env=normalizeEnv(_0x2ee1c6);}
@@ -1 +1 @@
1
- const a150_0x54e3f5=a150_0xb2a7;function a150_0xb2a7(_0x17426a,_0x74044f){_0x17426a=_0x17426a-0x138;const _0x2ea631=a150_0x2ea6();let _0xb2a7fe=_0x2ea631[_0x17426a];return _0xb2a7fe;}(function(_0x216528,_0x3aab6d){const _0x4b9cd1=a150_0xb2a7,_0x3c0da0=_0x216528();while(!![]){try{const _0x3d00e7=parseInt(_0x4b9cd1(0x138))/0x1+-parseInt(_0x4b9cd1(0x13f))/0x2*(-parseInt(_0x4b9cd1(0x13d))/0x3)+-parseInt(_0x4b9cd1(0x13c))/0x4+parseInt(_0x4b9cd1(0x144))/0x5*(-parseInt(_0x4b9cd1(0x143))/0x6)+parseInt(_0x4b9cd1(0x142))/0x7+parseInt(_0x4b9cd1(0x13b))/0x8*(parseInt(_0x4b9cd1(0x139))/0x9)+-parseInt(_0x4b9cd1(0x13a))/0xa*(parseInt(_0x4b9cd1(0x140))/0xb);if(_0x3d00e7===_0x3aab6d)break;else _0x3c0da0['push'](_0x3c0da0['shift']());}catch(_0x2dbf0f){_0x3c0da0['push'](_0x3c0da0['shift']());}}}(a150_0x2ea6,0x5e04c));function a150_0x2ea6(){const _0x2df0e7=['json','1726tFgBxB','22EDcYna','pretty','2797095RDkNlM','6OKvYnz','3377595rHmyFL','123700Hypszq','18OKVkmE','168930KYztXv','3041608ZfIRtY','1205888gxoryX','390QdVavF'];a150_0x2ea6=function(){return _0x2df0e7;};return a150_0x2ea6();}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a150_0x54e3f5(0x13e),a150_0x54e3f5(0x141),'compress'];
1
+ const a151_0x5eed62=a151_0x3453;(function(_0x41c752,_0x3ae22b){const _0x1cd348=a151_0x3453,_0x2c08be=_0x41c752();while(!![]){try{const _0x3be810=parseInt(_0x1cd348(0xa6))/0x1*(-parseInt(_0x1cd348(0xad))/0x2)+parseInt(_0x1cd348(0xaa))/0x3+-parseInt(_0x1cd348(0xac))/0x4+parseInt(_0x1cd348(0xae))/0x5+parseInt(_0x1cd348(0xb0))/0x6*(-parseInt(_0x1cd348(0xa8))/0x7)+parseInt(_0x1cd348(0xaf))/0x8*(parseInt(_0x1cd348(0xa7))/0x9)+parseInt(_0x1cd348(0xab))/0xa;if(_0x3be810===_0x3ae22b)break;else _0x2c08be['push'](_0x2c08be['shift']());}catch(_0x50e95c){_0x2c08be['push'](_0x2c08be['shift']());}}}(a151_0x14ff,0xf14f9));function a151_0x3453(_0x35c654,_0x2f1a30){_0x35c654=_0x35c654-0xa5;const _0x14ff8f=a151_0x14ff();let _0x345383=_0x14ff8f[_0x35c654];return _0x345383;}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a151_0x5eed62(0xb1),a151_0x5eed62(0xa5),a151_0x5eed62(0xa9)];function a151_0x14ff(){const _0x34fdc3=['json','pretty','7uibJDF','63oKQhSI','1031807nvRiVU','compress','3791616YGtWEB','16501730GSvOMY','6698984uIxsUj','345980bvcwif','7695585WJCkBf','685864tflROe','48yMMZEe'];a151_0x14ff=function(){return _0x34fdc3;};return a151_0x14ff();}
@@ -1 +1 @@
1
- function a151_0xd490(_0x5aeb6c,_0x384ed1){_0x5aeb6c=_0x5aeb6c-0x17f;const _0x5df149=a151_0x5df1();let _0xd4900b=_0x5df149[_0x5aeb6c];return _0xd4900b;}const a151_0x35e154=a151_0xd490;function a151_0x5df1(){const _0x4f5a45=['9653445BAOWee','2MGuylP','2737644IiMIlP','245RueaHw','207039jOhBwU','936483zLjuJJ','2593086pcFOdm','540vjjdXz','2353000dViwrP','./src/api'];a151_0x5df1=function(){return _0x4f5a45;};return a151_0x5df1();}(function(_0x333b6c,_0x40d843){const _0xdd91e4=a151_0xd490,_0x47187b=_0x333b6c();while(!![]){try{const _0x281122=-parseInt(_0xdd91e4(0x180))/0x1+parseInt(_0xdd91e4(0x187))/0x2*(-parseInt(_0xdd91e4(0x181))/0x3)+parseInt(_0xdd91e4(0x183))/0x4*(parseInt(_0xdd91e4(0x17f))/0x5)+-parseInt(_0xdd91e4(0x182))/0x6+parseInt(_0xdd91e4(0x188))/0x7+-parseInt(_0xdd91e4(0x184))/0x8+parseInt(_0xdd91e4(0x186))/0x9;if(_0x281122===_0x40d843)break;else _0x47187b['push'](_0x47187b['shift']());}catch(_0x24c1a8){_0x47187b['push'](_0x47187b['shift']());}}}(a151_0x5df1,0x36e26));export const DEFAULT_API_DIR=a151_0x35e154(0x185);
1
+ const a152_0x219cc8=a152_0x53b9;function a152_0x36ef(){const _0x322dbc=['388173zZLtKb','2558946wfimQm','2457768RTlqKZ','53810jxoXAR','1179owULSw','56efNysm','./src/api','1014VUxpJS','7YcpyaY','2144934jWdsYx','20qBxsaw','7979367IdGYeZ'];a152_0x36ef=function(){return _0x322dbc;};return a152_0x36ef();}function a152_0x53b9(_0x573c34,_0x5cbc02){_0x573c34=_0x573c34-0xd2;const _0x36efa0=a152_0x36ef();let _0x53b9c2=_0x36efa0[_0x573c34];return _0x53b9c2;}(function(_0x4abb7a,_0x40404a){const _0x2fedc4=a152_0x53b9,_0x4a4515=_0x4abb7a();while(!![]){try{const _0x2402dd=-parseInt(_0x2fedc4(0xdd))/0x1+-parseInt(_0x2fedc4(0xd8))/0x2*(parseInt(_0x2fedc4(0xd5))/0x3)+parseInt(_0x2fedc4(0xd6))/0x4*(-parseInt(_0x2fedc4(0xd4))/0x5)+-parseInt(_0x2fedc4(0xd2))/0x6*(parseInt(_0x2fedc4(0xd9))/0x7)+-parseInt(_0x2fedc4(0xd3))/0x8+parseInt(_0x2fedc4(0xda))/0x9+parseInt(_0x2fedc4(0xdb))/0xa*(parseInt(_0x2fedc4(0xdc))/0xb);if(_0x2402dd===_0x40404a)break;else _0x4a4515['push'](_0x4a4515['shift']());}catch(_0x2d41d6){_0x4a4515['push'](_0x4a4515['shift']());}}}(a152_0x36ef,0x350e4));export const DEFAULT_API_DIR=a152_0x219cc8(0xd7);
@@ -1 +1 @@
1
- const a152_0x39c350=a152_0x3b73;function a152_0x467e(){const _0x23348c=['34242AdWyRp','105075EDVkZh','324208XosnmE','read','20ItRubS','694225QDYjTp','write','34YYdSFJ','154885QGigAi','177669uXQvVs','770qigxsT','792972jJsFzW','high-risk-write'];a152_0x467e=function(){return _0x23348c;};return a152_0x467e();}function a152_0x3b73(_0x4e8bc8,_0x5d16a){_0x4e8bc8=_0x4e8bc8-0x175;const _0x467e57=a152_0x467e();let _0x3b73f8=_0x467e57[_0x4e8bc8];return _0x3b73f8;}(function(_0x42d020,_0x43952d){const _0x1584c8=a152_0x3b73,_0x3ca7f6=_0x42d020();while(!![]){try{const _0x59c597=-parseInt(_0x1584c8(0x17b))/0x1+-parseInt(_0x1584c8(0x179))/0x2*(parseInt(_0x1584c8(0x17f))/0x3)+-parseInt(_0x1584c8(0x176))/0x4*(parseInt(_0x1584c8(0x17a))/0x5)+-parseInt(_0x1584c8(0x17d))/0x6+-parseInt(_0x1584c8(0x177))/0x7+-parseInt(_0x1584c8(0x181))/0x8+-parseInt(_0x1584c8(0x180))/0x9*(-parseInt(_0x1584c8(0x17c))/0xa);if(_0x59c597===_0x43952d)break;else _0x3ca7f6['push'](_0x3ca7f6['shift']());}catch(_0x576f67){_0x3ca7f6['push'](_0x3ca7f6['shift']());}}}(a152_0x467e,0x188a8));export const RISK_LEVEL_VALUES=[a152_0x39c350(0x175),a152_0x39c350(0x178),a152_0x39c350(0x17e)];
1
+ const a153_0x1fc622=a153_0x5992;(function(_0xa3ed26,_0x299602){const _0x32d71b=a153_0x5992,_0x56f5dd=_0xa3ed26();while(!![]){try{const _0x3fc589=parseInt(_0x32d71b(0xfd))/0x1+parseInt(_0x32d71b(0xfb))/0x2+-parseInt(_0x32d71b(0xfe))/0x3+-parseInt(_0x32d71b(0xf8))/0x4*(parseInt(_0x32d71b(0xfa))/0x5)+parseInt(_0x32d71b(0xff))/0x6+parseInt(_0x32d71b(0xf7))/0x7+-parseInt(_0x32d71b(0x100))/0x8;if(_0x3fc589===_0x299602)break;else _0x56f5dd['push'](_0x56f5dd['shift']());}catch(_0x415db9){_0x56f5dd['push'](_0x56f5dd['shift']());}}}(a153_0x2bf7,0x31bc0));function a153_0x2bf7(){const _0x35a688=['write','116130UWzYKy','479502ZvPSoh','2279358bsZWXg','1674736ixwoEw','read','847476EaZoyD','4UJrAmv','high-risk-write','1138315pSMIut','366920HWTJYr'];a153_0x2bf7=function(){return _0x35a688;};return a153_0x2bf7();}function a153_0x5992(_0x5b44a7,_0x513fff){_0x5b44a7=_0x5b44a7-0xf7;const _0x2bf70b=a153_0x2bf7();let _0x5992a5=_0x2bf70b[_0x5b44a7];return _0x5992a5;}export const RISK_LEVEL_VALUES=[a153_0x1fc622(0x101),a153_0x1fc622(0xfc),a153_0x1fc622(0xf9)];
@@ -1 +1 @@
1
- (function(_0x4adfdf,_0x1e2654){const _0xf1cb38=a153_0x34eb,_0x5c5461=_0x4adfdf();while(!![]){try{const _0x1304d8=parseInt(_0xf1cb38(0x15a))/0x1+-parseInt(_0xf1cb38(0x15d))/0x2*(parseInt(_0xf1cb38(0x178))/0x3)+-parseInt(_0xf1cb38(0x155))/0x4+parseInt(_0xf1cb38(0x156))/0x5+parseInt(_0xf1cb38(0x151))/0x6+-parseInt(_0xf1cb38(0x16b))/0x7+parseInt(_0xf1cb38(0x165))/0x8;if(_0x1304d8===_0x1e2654)break;else _0x5c5461['push'](_0x5c5461['shift']());}catch(_0x205d3c){_0x5c5461['push'](_0x5c5461['shift']());}}}(a153_0x19c8,0xb2789));function a153_0x19c8(){const _0x1164b8=['format','VERBOSE','RISK_LEVEL','riskLevel','daily','10337696WhpaJy','object','inherit','ENV','PAGE_SIZE','defaultApp','5082350LKPjiA','MAX_RISK','APP','globalConfig','projectConfig','entries','keys','apiDir','true','accessKey','string','cookie','maxRisk','3zkZiks','appcode','ACCESS_KEY','5326248oAnHkg','trim','locale','length','1780YyPTdk','1239555klNwZX','production','find','env','81320hFfJvC','app','apps','2103278mfdGsx','pageSize','COOKIE'];a153_0x19c8=function(){return _0x1164b8;};return a153_0x19c8();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x3520e5){const _0x4c6e78=a153_0x34eb;return typeof _0x3520e5===_0x4c6e78(0x175)&&_0x3520e5[_0x4c6e78(0x152)]()?_0x3520e5[_0x4c6e78(0x152)]():undefined;}function appProfiles(_0x20cfd2){const _0x4147c6=a153_0x34eb;return _0x20cfd2[_0x4147c6(0x15c)]&&typeof _0x20cfd2[_0x4147c6(0x15c)]===_0x4147c6(0x166)?_0x20cfd2['apps']:{};}function a153_0x34eb(_0x46bb3a,_0x375e02){_0x46bb3a=_0x46bb3a-0x151;const _0x19c881=a153_0x19c8();let _0x34ebaa=_0x19c881[_0x46bb3a];return _0x34ebaa;}function resolveDefaultAppName(_0x4c9e3c){const _0x57e8dd=a153_0x34eb,_0x3916df=stringConfigValue(_0x4c9e3c[_0x57e8dd(0x16a)]);if(_0x3916df)return _0x3916df;return Object[_0x57e8dd(0x171)](appProfiles(_0x4c9e3c))[0x0];}function resolveTopLevelAppCode(_0xd486df){const _0x35eea1=a153_0x34eb;return stringConfigValue(_0xd486df[_0x35eea1(0x179)])||stringConfigValue(_0xd486df[_0x35eea1(0x15b)]);}export function resolveAppConfig({raw:_0x25214e,flags:_0x239e6e,layers:_0x29aab2,readEnv:_0x167c93}){const _0x23b160=a153_0x34eb,_0x5a2d5e=_0x29aab2?.[_0x23b160(0x16f)]??{},_0x4dde72=_0x29aab2?.[_0x23b160(0x16e)]??{},_0x214e43=Object[_0x23b160(0x171)](_0x5a2d5e)[_0x23b160(0x154)]>0x0,_0x1e627d=!_0x214e43||_0x5a2d5e[_0x23b160(0x167)]===!![],_0x1d5779=_0x214e43?resolveDefaultAppName(_0x5a2d5e):undefined,_0x287db3=_0x1e627d?resolveDefaultAppName(_0x4dde72):undefined,_0x27fa84=stringConfigValue(_0x239e6e[_0x23b160(0x15b)]),_0x438e17=_0x167c93(_0x23b160(0x16d)),_0x5e0611={};if(_0x25214e['apps']&&typeof _0x25214e[_0x23b160(0x15c)]===_0x23b160(0x166))for(const [_0x3c8ba0,_0x3ad788]of Object['entries'](_0x25214e[_0x23b160(0x15c)])){_0x3ad788&&typeof _0x3ad788===_0x23b160(0x166)&&_0x3ad788[_0x23b160(0x179)]&&(_0x5e0611[_0x3c8ba0]=_0x3ad788);}const _0x506fc5=_0x25214e['defaultApp']||undefined,_0x38d93f=Object[_0x23b160(0x171)](_0x5e0611)[_0x23b160(0x154)]>0x0,_0x179972=_0x27fa84||_0x1d5779||_0x438e17||_0x287db3||_0x506fc5||undefined,_0xd52b37=stringConfigValue(_0x239e6e['appcode']),_0x3c5fd1=_0xd52b37?Object[_0x23b160(0x170)](_0x5e0611)[_0x23b160(0x158)](([,_0x49b46b])=>_0x49b46b?.['appcode']===_0xd52b37):undefined,_0x321c2b=_0x3c5fd1?.[0x0],_0x487ada=_0x3c5fd1?.[0x1],_0x1b3471=_0xd52b37?_0x321c2b:_0x179972;let _0x341d9f=_0x1b3471&&_0x5e0611[_0x1b3471]?_0x5e0611[_0x1b3471]:undefined;_0xd52b37&&_0x487ada&&(_0x341d9f=_0x487ada);const _0x56d71c=_0xd52b37?_0x487ada??_0x341d9f:_0x341d9f,_0x4526ff=!_0x27fa84&&!_0x1d5779&&_0x438e17&&_0x1b3471===_0x438e17,_0x415f3d=_0x27fa84||(_0x4526ff?_0x438e17:undefined)||(_0xd52b37?_0x321c2b:undefined),_0x534da3=_0x56d71c?.[_0x23b160(0x179)],_0x50be81=_0x214e43?resolveTopLevelAppCode(_0x5a2d5e):undefined,_0x27f7fc=_0x1e627d?resolveTopLevelAppCode(_0x4dde72):undefined,_0x5b8595=_0x27fa84||_0x1d5779?_0x534da3:undefined,_0x366ada=!_0x27fa84&&!_0x1d5779?_0x534da3:undefined,_0x3c94c2=_0xd52b37||_0x5b8595||_0x50be81||_0x366ada||_0x27f7fc||undefined,_0x3d1386=_0x214e43?stringConfigValue(_0x5a2d5e['env']):undefined,_0x35a710=_0x1e627d?stringConfigValue(_0x4dde72[_0x23b160(0x159)]):undefined,_0x24c3af=_0x239e6e[_0x23b160(0x159)]||_0x56d71c?.[_0x23b160(0x159)]||_0x3d1386||_0x167c93(_0x23b160(0x168))||_0x35a710||_0x25214e[_0x23b160(0x159)]||DEFAULT_CONFIG_VALUES[_0x23b160(0x159)],_0x13ff2b=_0x56d71c?.[_0x23b160(0x153)]||_0x25214e[_0x23b160(0x153)]||DEFAULT_CONFIG_VALUES['locale'],_0xf89c43=_0x167c93(_0x23b160(0x15f))||_0x56d71c?.[_0x23b160(0x176)]||_0x25214e[_0x23b160(0x176)]||undefined,_0x252e3b=_0x167c93(_0x23b160(0x17a))||_0x56d71c?.['accessKey']||_0x25214e[_0x23b160(0x174)]||undefined,_0x11fbf4=_0x239e6e['format']||_0x167c93('FORMAT')||_0x56d71c?.[_0x23b160(0x160)]||_0x25214e[_0x23b160(0x160)],_0x542095=normalizeLegacyOutputFormat(_0x11fbf4),_0x2307e6=_0x167c93(_0x23b160(0x169))||_0x56d71c?.[_0x23b160(0x15e)]||_0x25214e[_0x23b160(0x15e)],_0x459e5c=_0x2307e6?Number(_0x2307e6)||undefined:undefined,_0x5961ac=_0x167c93(_0x23b160(0x162))||_0x167c93(_0x23b160(0x16c))||_0x56d71c?.[_0x23b160(0x163)]||_0x25214e[_0x23b160(0x163)]||_0x25214e[_0x23b160(0x177)],_0x3fe7ed=_0x5961ac==='read'||_0x5961ac==='write'?_0x5961ac:DEFAULT_CONFIG_VALUES['riskLevel'],_0x43cbc2=_0x167c93(_0x23b160(0x161)),_0x59c551=_0x43cbc2==='1'||_0x43cbc2===_0x23b160(0x173),_0x5bc515=_0x56d71c?.[_0x23b160(0x172)]||_0x25214e[_0x23b160(0x172)]||DEFAULT_CONFIG_VALUES[_0x23b160(0x172)],_0x49df52=isDaily(normalizeEnv(String(_0x24c3af)))?_0x23b160(0x164):_0x23b160(0x157);return{'appCode':typeof _0x3c94c2==='string'&&_0x3c94c2[_0x23b160(0x152)]()?_0x3c94c2[_0x23b160(0x152)]():undefined,'env':_0x49df52,'locale':_0x13ff2b,'cookie':_0xf89c43,'accessKey':_0x252e3b,'format':_0x542095,'pageSize':_0x459e5c,'riskLevel':_0x3fe7ed,'verbose':_0x59c551,'apiDir':_0x5bc515,'apps':_0x5e0611,'defaultApp':_0x506fc5,'currentApp':_0x38d93f?_0x1b3471:undefined,'explicitAppName':_0x415f3d};}
1
+ (function(_0x499569,_0x38bb46){const _0x59c8c8=a154_0x3d92,_0x4def13=_0x499569();while(!![]){try{const _0x3aef80=parseInt(_0x59c8c8(0x1da))/0x1+parseInt(_0x59c8c8(0x1e0))/0x2*(parseInt(_0x59c8c8(0x1e1))/0x3)+-parseInt(_0x59c8c8(0x1dd))/0x4*(-parseInt(_0x59c8c8(0x1e7))/0x5)+parseInt(_0x59c8c8(0x1f2))/0x6+parseInt(_0x59c8c8(0x1e5))/0x7*(-parseInt(_0x59c8c8(0x1f1))/0x8)+-parseInt(_0x59c8c8(0x1d9))/0x9*(-parseInt(_0x59c8c8(0x1dc))/0xa)+-parseInt(_0x59c8c8(0x1f6))/0xb;if(_0x3aef80===_0x38bb46)break;else _0x4def13['push'](_0x4def13['shift']());}catch(_0x5c559b){_0x4def13['push'](_0x4def13['shift']());}}}(a154_0x4460,0x2fc22));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';function a154_0x4460(){const _0x3be999=['find','trim','true','8157908RNsLEe','RISK_LEVEL','accessKey','apiDir','length','entries','apps','string','env','maxRisk','inherit','397143PAvtUz','197066gcaUvu','cookie','50EACPnJ','7240aPeQvp','PAGE_SIZE','locale','26hcxwId','51915rnmXYc','keys','production','defaultApp','297241jdWUXc','appcode','1005rzxfPm','daily','riskLevel','format','app','read','VERBOSE','globalConfig','object','write','48rpInmO','1113288ScMeOh'];a154_0x4460=function(){return _0x3be999;};return a154_0x4460();}import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x7393b6){const _0xac4efb=a154_0x3d92;return typeof _0x7393b6===_0xac4efb(0x1fd)&&_0x7393b6['trim']()?_0x7393b6[_0xac4efb(0x1f4)]():undefined;}function appProfiles(_0x340604){const _0x283410=a154_0x3d92;return _0x340604[_0x283410(0x1fc)]&&typeof _0x340604[_0x283410(0x1fc)]===_0x283410(0x1ef)?_0x340604['apps']:{};}function a154_0x3d92(_0x3881d4,_0x6226d2){_0x3881d4=_0x3881d4-0x1d8;const _0x44605e=a154_0x4460();let _0x3d92d8=_0x44605e[_0x3881d4];return _0x3d92d8;}function resolveDefaultAppName(_0x352582){const _0x61bc50=a154_0x3d92,_0x2c095f=stringConfigValue(_0x352582[_0x61bc50(0x1e4)]);if(_0x2c095f)return _0x2c095f;return Object[_0x61bc50(0x1e2)](appProfiles(_0x352582))[0x0];}function resolveTopLevelAppCode(_0xe07747){const _0x3dffa1=a154_0x3d92;return stringConfigValue(_0xe07747[_0x3dffa1(0x1e6)])||stringConfigValue(_0xe07747[_0x3dffa1(0x1eb)]);}export function resolveAppConfig({raw:_0x1bf3cf,flags:_0x24ecf4,layers:_0x13ecb0,readEnv:_0x281d43}){const _0x870bba=a154_0x3d92,_0x1ac077=_0x13ecb0?.['projectConfig']??{},_0x305d70=_0x13ecb0?.[_0x870bba(0x1ee)]??{},_0x477836=Object['keys'](_0x1ac077)[_0x870bba(0x1fa)]>0x0,_0x479674=!_0x477836||_0x1ac077[_0x870bba(0x1d8)]===!![],_0x5d2ff5=_0x477836?resolveDefaultAppName(_0x1ac077):undefined,_0x418890=_0x479674?resolveDefaultAppName(_0x305d70):undefined,_0x41e86b=stringConfigValue(_0x24ecf4['app']),_0x5a60c6=_0x281d43('APP'),_0x12c563={};if(_0x1bf3cf[_0x870bba(0x1fc)]&&typeof _0x1bf3cf[_0x870bba(0x1fc)]===_0x870bba(0x1ef))for(const [_0x1a57f9,_0x1d7737]of Object[_0x870bba(0x1fb)](_0x1bf3cf[_0x870bba(0x1fc)])){_0x1d7737&&typeof _0x1d7737===_0x870bba(0x1ef)&&_0x1d7737[_0x870bba(0x1e6)]&&(_0x12c563[_0x1a57f9]=_0x1d7737);}const _0x4da536=_0x1bf3cf[_0x870bba(0x1e4)]||undefined,_0x1a1945=Object[_0x870bba(0x1e2)](_0x12c563)[_0x870bba(0x1fa)]>0x0,_0x451920=_0x41e86b||_0x5d2ff5||_0x5a60c6||_0x418890||_0x4da536||undefined,_0x38ea82=stringConfigValue(_0x24ecf4[_0x870bba(0x1e6)]),_0x5afc31=_0x38ea82?Object['entries'](_0x12c563)[_0x870bba(0x1f3)](([,_0x54fee0])=>_0x54fee0?.[_0x870bba(0x1e6)]===_0x38ea82):undefined,_0x579d6c=_0x5afc31?.[0x0],_0x1c6635=_0x5afc31?.[0x1],_0xb43929=_0x38ea82?_0x579d6c:_0x451920;let _0x417c7a=_0xb43929&&_0x12c563[_0xb43929]?_0x12c563[_0xb43929]:undefined;_0x38ea82&&_0x1c6635&&(_0x417c7a=_0x1c6635);const _0x281bdf=_0x38ea82?_0x1c6635??_0x417c7a:_0x417c7a,_0x2ec7f1=!_0x41e86b&&!_0x5d2ff5&&_0x5a60c6&&_0xb43929===_0x5a60c6,_0x3d6e67=_0x41e86b||(_0x2ec7f1?_0x5a60c6:undefined)||(_0x38ea82?_0x579d6c:undefined),_0x5cd073=_0x281bdf?.[_0x870bba(0x1e6)],_0x547c2b=_0x477836?resolveTopLevelAppCode(_0x1ac077):undefined,_0x16a662=_0x479674?resolveTopLevelAppCode(_0x305d70):undefined,_0x869a24=_0x41e86b||_0x5d2ff5?_0x5cd073:undefined,_0x1cee83=!_0x41e86b&&!_0x5d2ff5?_0x5cd073:undefined,_0x1fb69b=_0x38ea82||_0x869a24||_0x547c2b||_0x1cee83||_0x16a662||undefined,_0x25afac=_0x477836?stringConfigValue(_0x1ac077[_0x870bba(0x1fe)]):undefined,_0x1a934e=_0x479674?stringConfigValue(_0x305d70[_0x870bba(0x1fe)]):undefined,_0x4e0686=_0x24ecf4['env']||_0x281bdf?.[_0x870bba(0x1fe)]||_0x25afac||_0x281d43('ENV')||_0x1a934e||_0x1bf3cf['env']||DEFAULT_CONFIG_VALUES['env'],_0x265291=_0x281bdf?.[_0x870bba(0x1df)]||_0x1bf3cf['locale']||DEFAULT_CONFIG_VALUES[_0x870bba(0x1df)],_0x14cb29=_0x281d43('COOKIE')||_0x281bdf?.[_0x870bba(0x1db)]||_0x1bf3cf[_0x870bba(0x1db)]||undefined,_0xe7e284=_0x281d43('ACCESS_KEY')||_0x281bdf?.[_0x870bba(0x1f8)]||_0x1bf3cf[_0x870bba(0x1f8)]||undefined,_0x34b4a5=_0x24ecf4[_0x870bba(0x1ea)]||_0x281d43('FORMAT')||_0x281bdf?.['format']||_0x1bf3cf[_0x870bba(0x1ea)],_0x286be4=normalizeLegacyOutputFormat(_0x34b4a5),_0x2ce4b3=_0x281d43(_0x870bba(0x1de))||_0x281bdf?.['pageSize']||_0x1bf3cf['pageSize'],_0x59abe9=_0x2ce4b3?Number(_0x2ce4b3)||undefined:undefined,_0x56478d=_0x281d43(_0x870bba(0x1f7))||_0x281d43('MAX_RISK')||_0x281bdf?.[_0x870bba(0x1e9)]||_0x1bf3cf['riskLevel']||_0x1bf3cf[_0x870bba(0x1ff)],_0x4da9c5=_0x56478d===_0x870bba(0x1ec)||_0x56478d===_0x870bba(0x1f0)?_0x56478d:DEFAULT_CONFIG_VALUES[_0x870bba(0x1e9)],_0x1266f2=_0x281d43(_0x870bba(0x1ed)),_0x48cc47=_0x1266f2==='1'||_0x1266f2===_0x870bba(0x1f5),_0x5959b1=_0x281bdf?.[_0x870bba(0x1f9)]||_0x1bf3cf[_0x870bba(0x1f9)]||DEFAULT_CONFIG_VALUES[_0x870bba(0x1f9)],_0x485c60=isDaily(normalizeEnv(String(_0x4e0686)))?_0x870bba(0x1e8):_0x870bba(0x1e3);return{'appCode':typeof _0x1fb69b==='string'&&_0x1fb69b[_0x870bba(0x1f4)]()?_0x1fb69b[_0x870bba(0x1f4)]():undefined,'env':_0x485c60,'locale':_0x265291,'cookie':_0x14cb29,'accessKey':_0xe7e284,'format':_0x286be4,'pageSize':_0x59abe9,'riskLevel':_0x4da9c5,'verbose':_0x48cc47,'apiDir':_0x5959b1,'apps':_0x12c563,'defaultApp':_0x4da536,'currentApp':_0x1a1945?_0xb43929:undefined,'explicitAppName':_0x3d6e67};}
@@ -1 +1 @@
1
- (function(_0x2f3c1e,_0x1c9e30){const _0x19ddf2=a154_0x5b88,_0x17d6ac=_0x2f3c1e();while(!![]){try{const _0x316a16=-parseInt(_0x19ddf2(0x9b))/0x1+-parseInt(_0x19ddf2(0x99))/0x2+parseInt(_0x19ddf2(0x9d))/0x3*(parseInt(_0x19ddf2(0x98))/0x4)+parseInt(_0x19ddf2(0x96))/0x5+-parseInt(_0x19ddf2(0x9c))/0x6+parseInt(_0x19ddf2(0xa0))/0x7*(-parseInt(_0x19ddf2(0x9a))/0x8)+parseInt(_0x19ddf2(0x9e))/0x9*(parseInt(_0x19ddf2(0xa1))/0xa);if(_0x316a16===_0x1c9e30)break;else _0x17d6ac['push'](_0x17d6ac['shift']());}catch(_0x480f66){_0x17d6ac['push'](_0x17d6ac['shift']());}}}(a154_0x16df,0xa8d33));function a154_0x5b88(_0x13dcae,_0x470f1d){_0x13dcae=_0x13dcae-0x96;const _0x16df85=a154_0x16df();let _0x5b88e1=_0x16df85[_0x13dcae];return _0x5b88e1;}function a154_0x16df(){const _0x2536ba=['../auth/get-cookie.js','28ZPYmeK','699878WZEuwN','24icpqTn','973724JcMGDG','4803924jWjfdA','274728pZKVUf','21314160vnxaob','cookie','2907436BqVsnV','10gZWYvu','5262980JjTeUw'];a154_0x16df=function(){return _0x2536ba;};return a154_0x16df();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';export async function buildAuth(_0x114e61){const _0xae813e=a154_0x5b88,{getCookie:_0x51cc34}=await import(_0xae813e(0x97)),_0x2852ca=_0x114e61[_0xae813e(0x9f)]||_0x51cc34(),_0x2c4494=_0x2852ca?await getIsSessionValid():![];return{'cookie':_0x2852ca,'isLoggedIn':_0x2c4494,async 'getOrLogin'(){if(_0x2852ca&&_0x2c4494)return _0x2852ca;throw CliErrors['authRequired']();}};}
1
+ function a155_0x28a2(_0x1e78f0,_0x5794ea){_0x1e78f0=_0x1e78f0-0x143;const _0x5e4f92=a155_0x5e4f();let _0x28a248=_0x5e4f92[_0x1e78f0];return _0x28a248;}(function(_0x1d93d4,_0x7ef495){const _0x325830=a155_0x28a2,_0x4cae16=_0x1d93d4();while(!![]){try{const _0x1a29c5=parseInt(_0x325830(0x14a))/0x1+-parseInt(_0x325830(0x149))/0x2+-parseInt(_0x325830(0x143))/0x3*(-parseInt(_0x325830(0x146))/0x4)+-parseInt(_0x325830(0x14c))/0x5*(parseInt(_0x325830(0x14f))/0x6)+parseInt(_0x325830(0x145))/0x7+-parseInt(_0x325830(0x14b))/0x8*(parseInt(_0x325830(0x148))/0x9)+-parseInt(_0x325830(0x144))/0xa*(-parseInt(_0x325830(0x14e))/0xb);if(_0x1a29c5===_0x7ef495)break;else _0x4cae16['push'](_0x4cae16['shift']());}catch(_0xb64fb5){_0x4cae16['push'](_0x4cae16['shift']());}}}(a155_0x5e4f,0xa9e9c));import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';function a155_0x5e4f(){const _0x437024=['authRequired','495GnCEAB','1078302GRAxEv','17379yecGXp','255540egRmYU','141421tIwbel','92mHsYRl','cookie','1848843KnQHKg','1409428sayJqU','1201318rVtBCk','8MeTKhy','25UfRbEk'];a155_0x5e4f=function(){return _0x437024;};return a155_0x5e4f();}export async function buildAuth(_0x4deadd){const _0x4ca566=a155_0x28a2,{getCookie:_0x5d4855}=await import('../auth/get-cookie.js'),_0xc06141=_0x4deadd[_0x4ca566(0x147)]||_0x5d4855(),_0x525d68=_0xc06141?await getIsSessionValid():![];return{'cookie':_0xc06141,'isLoggedIn':_0x525d68,async 'getOrLogin'(){const _0x1ce043=_0x4ca566;if(_0xc06141&&_0x525d68)return _0xc06141;throw CliErrors[_0x1ce043(0x14d)]();}};}
@@ -1 +1 @@
1
- const a155_0x2b0672=a155_0x2c53;(function(_0x10de5d,_0x118291){const _0x51db47=a155_0x2c53,_0x2b2190=_0x10de5d();while(!![]){try{const _0x2018f7=parseInt(_0x51db47(0x176))/0x1+parseInt(_0x51db47(0x181))/0x2*(-parseInt(_0x51db47(0x188))/0x3)+-parseInt(_0x51db47(0x177))/0x4+-parseInt(_0x51db47(0x18a))/0x5+-parseInt(_0x51db47(0x1a6))/0x6*(parseInt(_0x51db47(0x187))/0x7)+parseInt(_0x51db47(0x18b))/0x8+parseInt(_0x51db47(0x196))/0x9;if(_0x2018f7===_0x118291)break;else _0x2b2190['push'](_0x2b2190['shift']());}catch(_0x33315c){_0x2b2190['push'](_0x2b2190['shift']());}}}(a155_0x3fb3,0x9cff9));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a155_0x2b0672(0x1a0),a155_0x2b0672(0x17a),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a155_0x2b0672(0x18d)](_0x3fe9ad=>_0x3fe9ad!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x3d67f6){for(const _0x56e520 of CONFIG_NAMES){const _0x3d6c43=resolve(_0x3d67f6,_0x56e520);if(existsSync(_0x3d6c43))return _0x3d6c43;}return undefined;}export function findProjectRootDirectory(_0x373e62=process[a155_0x2b0672(0x179)]()){let _0x4cf9ee=resolve(_0x373e62);const {root:_0x30e7ff}=parse(_0x4cf9ee),_0x38b395=homedir();while(!![]){if(resolveConfigPath(_0x4cf9ee)){if(_0x4cf9ee===_0x38b395)break;return _0x4cf9ee;}if(_0x4cf9ee===_0x30e7ff||_0x4cf9ee===_0x38b395)break;const _0x73c3d5=dirname(_0x4cf9ee);if(_0x73c3d5===_0x4cf9ee)break;_0x4cf9ee=_0x73c3d5;}return resolve(_0x373e62);}export function getProjectConfigPath(){const _0x325149=a155_0x2b0672;return resolveConfigPath(process[_0x325149(0x179)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a155_0x2c53(_0x2b65ec,_0x894f09){_0x2b65ec=_0x2b65ec-0x176;const _0x3fb38b=a155_0x3fb3();let _0x2c53cb=_0x3fb38b[_0x2b65ec];return _0x2c53cb;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x1b6a8e){const _0x3592b8=a155_0x2b0672;if(!existsSync(_0x1b6a8e))return{'status':_0x3592b8(0x17b)};try{const _0x21a712=readFileSync(_0x1b6a8e,{'encoding':_0x3592b8(0x192)});if(!_0x21a712?.[_0x3592b8(0x1a4)]())return{'status':'empty'};const _0x2b7c22=JSON[_0x3592b8(0x17d)](_0x21a712);return{'status':'ok','data':_0x2b7c22};}catch(_0x4c0dba){return{'status':_0x3592b8(0x180),'message':_0x4c0dba instanceof Error?_0x4c0dba[_0x3592b8(0x186)]:String(_0x4c0dba)};}}function parseCliConfigJsonFile(_0x11a473,_0x163c21,_0x1ed573){const _0x397718=a155_0x2b0672,_0x4630ad=inspectCliConfigJsonFile(_0x11a473);if(_0x4630ad[_0x397718(0x178)]===_0x397718(0x17b)||_0x4630ad[_0x397718(0x178)]===_0x397718(0x18f))return{};if(_0x4630ad[_0x397718(0x178)]==='ok')return _0x4630ad[_0x397718(0x189)];return _0x163c21===_0x397718(0x1a7)&&_0x1ed573&&console[_0x397718(0x180)](CLI_BIN_NAME+':\x20'+_0x1ed573+_0x397718(0x199)+_0x11a473+_0x397718(0x1a3)+_0x4630ad[_0x397718(0x186)]),{};}function normalizeLegacyConfigShape(_0x1e6d6f){const _0xa6435e=a155_0x2b0672;if(!_0x1e6d6f||typeof _0x1e6d6f!==_0xa6435e(0x19f))return{'config':{},'migrated':![]};const _0x3c48aa={..._0x1e6d6f},_0xf30f2c=_0x3c48aa['apps']&&typeof _0x3c48aa[_0xa6435e(0x19c)]===_0xa6435e(0x19f)?{..._0x3c48aa[_0xa6435e(0x19c)]}:{},_0x3bdbec=Object['keys'](_0xf30f2c)[_0xa6435e(0x195)],_0x4bce06=_0x3c48aa[_0xa6435e(0x1a2)]||_0x3c48aa['app'];let _0x5c8cb8=![];if(_0x4bce06&&_0x3bdbec===0x0){const _0x5d8d42=typeof _0x3c48aa[_0xa6435e(0x17f)]===_0xa6435e(0x191)&&_0x3c48aa[_0xa6435e(0x17f)][_0xa6435e(0x1a4)]()?_0x3c48aa[_0xa6435e(0x17f)]:String(_0x4bce06)[_0xa6435e(0x1a4)]();_0xf30f2c[_0x5d8d42]={'appcode':String(_0x4bce06)['trim'](),..._0x3c48aa['env']!=null?{'env':_0x3c48aa[_0xa6435e(0x183)]}:{},..._0x3c48aa[_0xa6435e(0x17c)]!=null?{'apiDir':_0x3c48aa[_0xa6435e(0x17c)]}:{},..._0x3c48aa[_0xa6435e(0x19b)]!=null?{'cookie':_0x3c48aa[_0xa6435e(0x19b)]}:{},..._0x3c48aa[_0xa6435e(0x184)]!=null?{'accessKey':_0x3c48aa[_0xa6435e(0x184)]}:{},..._0x3c48aa['format']!=null?{'format':_0x3c48aa[_0xa6435e(0x17e)]}:{},..._0x3c48aa[_0xa6435e(0x182)]!=null?{'pageSize':_0x3c48aa[_0xa6435e(0x182)]}:{},..._0x3c48aa['riskLevel']!=null?{'riskLevel':_0x3c48aa[_0xa6435e(0x18c)]}:{},..._0x3c48aa[_0xa6435e(0x1a5)]!=null?{'locale':_0x3c48aa[_0xa6435e(0x1a5)]}:{}},_0x3c48aa['apps']=_0xf30f2c;if(!_0x3c48aa['defaultApp'])_0x3c48aa['defaultApp']=_0x5d8d42;_0x5c8cb8=!![];}return(_0xa6435e(0x1a2)in _0x3c48aa||_0xa6435e(0x1a1)in _0x3c48aa)&&(delete _0x3c48aa['appcode'],delete _0x3c48aa[_0xa6435e(0x1a1)],_0x5c8cb8=!![]),{'config':_0x3c48aa,'migrated':_0x5c8cb8};}function writeNormalizedConfigIfNeeded(_0x448176,_0x40328c){const _0x3361b7=a155_0x2b0672,_0x5097dd=JSON[_0x3361b7(0x197)](_0x40328c,null,0x2)+'\x0a';if(normalizedWriteCache[_0x3361b7(0x194)](_0x448176)===_0x5097dd)return;writeConfigFile(_0x448176,_0x40328c),normalizedWriteCache[_0x3361b7(0x190)](_0x448176,_0x5097dd);}function parseAndNormalizeConfig(_0x2902c7,_0x2e738b,_0xac98c1){const _0x130493=a155_0x2b0672,_0x27584c=parseCliConfigJsonFile(_0x2902c7,_0x2e738b,_0xac98c1),_0x411148=normalizeLegacyConfigShape(_0x27584c);if(_0x411148[_0x130493(0x198)])try{writeNormalizedConfigIfNeeded(_0x2902c7,_0x411148['config']);}catch{}return _0x411148[_0x130493(0x19a)];}export function loadRawConfigLayers(_0x16c53a){const _0x287d31=a155_0x2b0672;let _0x5aaae9={},_0x2d7905={};const _0x4e5c8b=resolveConfigPath(homedir());_0x4e5c8b&&(_0x5aaae9=parseAndNormalizeConfig(_0x4e5c8b,_0x287d31(0x1a7),'Global'));const _0x4258c8=_0x16c53a??findProjectRootDirectory(),_0x45d3f6=resolveConfigPath(_0x4258c8);return _0x45d3f6&&(_0x2d7905=parseAndNormalizeConfig(_0x45d3f6,_0x287d31(0x1a7),_0x287d31(0x185))),{'globalPath':_0x4e5c8b,'projectPath':_0x45d3f6,'globalConfig':_0x5aaae9,'projectConfig':_0x2d7905};}function a155_0x3fb3(){const _0x4729d2=['app','appcode','\x0a\x20\x20','trim','locale','2595534UBcvZw','warn','1225598kkADBr','4476068OLbqcI','status','cwd','.lovrabet.json','missing','apiDir','parse','format','defaultApp','error','2PMqYjc','pageSize','env','accessKey','Project','message','14KsGGdf','321831MOJCmG','data','5179845MfOdUO','9362392AjbaoR','riskLevel','filter','silent','empty','set','string','utf8','keys','get','length','12371481daUUIL','stringify','migrated','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','config','cookie','apps','inherit','project','object','.rabetbase.json'];a155_0x3fb3=function(){return _0x4729d2;};return a155_0x3fb3();}const INHERIT_WHITELIST=[a155_0x2b0672(0x19b),a155_0x2b0672(0x184),a155_0x2b0672(0x1a5),'format',a155_0x2b0672(0x18c),'pageSize'];export function mergeRawConfigLayers(_0x268c53){const _0x48db6a=a155_0x2b0672,{globalConfig:_0x4165e7,projectConfig:_0xe00d78}=_0x268c53,_0x17e998=Object[_0x48db6a(0x193)](_0xe00d78)['length']>0x0;if(!_0x17e998)return mergeGlobalOnly(_0x4165e7);if(_0xe00d78[_0x48db6a(0x19d)]===!![])return mergeFullInherit(_0x4165e7,_0xe00d78);if(_0xe00d78['inherit']===![])return mergeIsolated(_0xe00d78);return mergeProjectFirst(_0x4165e7,_0xe00d78);}function mergeGlobalOnly(_0x51ade8){const _0x88dcf8=a155_0x2b0672,_0x1f6367={..._0x51ade8},_0x3517f8=_0x51ade8[_0x88dcf8(0x19c)]&&typeof _0x51ade8['apps']===_0x88dcf8(0x19f)?_0x51ade8[_0x88dcf8(0x19c)]:{};if(Object[_0x88dcf8(0x193)](_0x3517f8)[_0x88dcf8(0x195)]>0x0)_0x1f6367[_0x88dcf8(0x19c)]=_0x3517f8;if(_0x51ade8[_0x88dcf8(0x17f)])_0x1f6367[_0x88dcf8(0x17f)]=_0x51ade8[_0x88dcf8(0x17f)];else{const _0x4253f7=Object[_0x88dcf8(0x193)](_0x3517f8);if(_0x4253f7[_0x88dcf8(0x195)]>0x0)_0x1f6367['defaultApp']=_0x4253f7[0x0];}return _0x1f6367;}function mergeIsolated(_0x1f7e0e){const _0x269494=a155_0x2b0672,_0x19d4c3={..._0x1f7e0e};delete _0x19d4c3[_0x269494(0x19d)];const _0x599250=_0x1f7e0e['apps']&&typeof _0x1f7e0e[_0x269494(0x19c)]===_0x269494(0x19f)?_0x1f7e0e[_0x269494(0x19c)]:{};Object[_0x269494(0x193)](_0x599250)[_0x269494(0x195)]>0x0?_0x19d4c3['apps']=_0x599250:delete _0x19d4c3[_0x269494(0x19c)];if(_0x269494(0x17f)in _0x1f7e0e)_0x19d4c3['defaultApp']=_0x1f7e0e['defaultApp'];else Object['keys'](_0x599250)[_0x269494(0x195)]>0x0?_0x19d4c3[_0x269494(0x17f)]=Object['keys'](_0x599250)[0x0]:delete _0x19d4c3[_0x269494(0x17f)];return _0x19d4c3;}function mergeProjectFirst(_0x2d4642,_0xb4526a){const _0x53e62f=a155_0x2b0672,_0x2d512a={..._0xb4526a};delete _0x2d512a[_0x53e62f(0x19d)];for(const _0x3276da of INHERIT_WHITELIST){!(_0x3276da in _0x2d512a)&&_0x3276da in _0x2d4642&&(_0x2d512a[_0x3276da]=_0x2d4642[_0x3276da]);}const _0x2048f5=_0xb4526a['apps']&&typeof _0xb4526a[_0x53e62f(0x19c)]===_0x53e62f(0x19f)?_0xb4526a[_0x53e62f(0x19c)]:{};Object[_0x53e62f(0x193)](_0x2048f5)[_0x53e62f(0x195)]>0x0?_0x2d512a['apps']=_0x2048f5:delete _0x2d512a[_0x53e62f(0x19c)];if(_0x53e62f(0x17f)in _0xb4526a)_0x2d512a[_0x53e62f(0x17f)]=_0xb4526a[_0x53e62f(0x17f)];else Object[_0x53e62f(0x193)](_0x2048f5)[_0x53e62f(0x195)]>0x0?_0x2d512a[_0x53e62f(0x17f)]=Object['keys'](_0x2048f5)[0x0]:delete _0x2d512a[_0x53e62f(0x17f)];return _0x2d512a;}function mergeFullInherit(_0x58e860,_0xc94bba){const _0x41ebcb=a155_0x2b0672,_0x529a7b=_0x58e860['apps']&&typeof _0x58e860['apps']===_0x41ebcb(0x19f)?_0x58e860[_0x41ebcb(0x19c)]:{},_0x305f17=_0xc94bba[_0x41ebcb(0x19c)]&&typeof _0xc94bba[_0x41ebcb(0x19c)]===_0x41ebcb(0x19f)?_0xc94bba[_0x41ebcb(0x19c)]:{},_0x443116={..._0x529a7b,..._0x305f17},_0x5b4781={..._0x58e860,..._0xc94bba};delete _0x5b4781[_0x41ebcb(0x19d)];if(Object['keys'](_0x443116)[_0x41ebcb(0x195)]>0x0)_0x5b4781[_0x41ebcb(0x19c)]=_0x443116;if(_0x41ebcb(0x17f)in _0xc94bba)_0x5b4781[_0x41ebcb(0x17f)]=_0xc94bba['defaultApp'];else{if(Object['keys'](_0x305f17)[_0x41ebcb(0x195)]>0x0)_0x5b4781[_0x41ebcb(0x17f)]=Object[_0x41ebcb(0x193)](_0x305f17)[0x0];else{if(_0x58e860['defaultApp'])_0x5b4781[_0x41ebcb(0x17f)]=_0x58e860[_0x41ebcb(0x17f)];else{const _0xd13dec=Object[_0x41ebcb(0x193)](_0x529a7b);if(_0xd13dec[_0x41ebcb(0x195)]>0x0)_0x5b4781['defaultApp']=_0xd13dec[0x0];}}}return _0x5b4781;}export function readRawConfigWithLayers(_0x23cf73){const _0x2df5e0=loadRawConfigLayers(_0x23cf73);return{'config':mergeRawConfigLayers(_0x2df5e0),'layers':_0x2df5e0};}export function readRawConfig(_0x3996a8){return mergeRawConfigLayers(loadRawConfigLayers(_0x3996a8));}export function readConfigFile(_0x2c9aac){const _0x29a019=a155_0x2b0672;return parseAndNormalizeConfig(_0x2c9aac,_0x29a019(0x18e));}export function writeConfigFile(_0x4a7347,_0x2258f1){const _0x564ca4=a155_0x2b0672,_0x4e96ba=dirname(_0x4a7347);!existsSync(_0x4e96ba)&&mkdirSync(_0x4e96ba,{'recursive':!![]});const _0x44aad8=_0x4a7347+'.tmp';try{writeFileSync(_0x44aad8,JSON[_0x564ca4(0x197)](_0x2258f1,null,0x2)+'\x0a',{'encoding':_0x564ca4(0x192),'mode':0x180}),renameSync(_0x44aad8,_0x4a7347);}catch(_0x2cb2ed){try{unlinkSync(_0x44aad8);}catch{}throw _0x2cb2ed;}}export function resolveWriteConfigPath(_0x127361){const _0x2b08bc=a155_0x2b0672,_0xa6c1da=_0x127361===_0x2b08bc(0x19e)?process[_0x2b08bc(0x179)]():homedir(),_0x1ebbc1=resolveConfigPath(_0xa6c1da);return _0x1ebbc1??resolve(_0xa6c1da,NEW_CONFIG_NAME);}
1
+ const a156_0x310183=a156_0x2de8;(function(_0x1b5e83,_0x57e30e){const _0x1cad53=a156_0x2de8,_0x58b2f2=_0x1b5e83();while(!![]){try{const _0xb4f49e=-parseInt(_0x1cad53(0x7f))/0x1+parseInt(_0x1cad53(0x96))/0x2+-parseInt(_0x1cad53(0x98))/0x3*(parseInt(_0x1cad53(0x87))/0x4)+-parseInt(_0x1cad53(0x84))/0x5+parseInt(_0x1cad53(0x86))/0x6*(parseInt(_0x1cad53(0x71))/0x7)+-parseInt(_0x1cad53(0x76))/0x8*(parseInt(_0x1cad53(0x8a))/0x9)+parseInt(_0x1cad53(0x68))/0xa*(parseInt(_0x1cad53(0x83))/0xb);if(_0xb4f49e===_0x57e30e)break;else _0x58b2f2['push'](_0x58b2f2['shift']());}catch(_0x5d2eac){_0x58b2f2['push'](_0x58b2f2['shift']());}}}(a156_0x46d1,0x26ccc));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a156_0x310183(0x85);function a156_0x2de8(_0x42de31,_0x3a9eb4){_0x42de31=_0x42de31-0x68;const _0x46d118=a156_0x46d1();let _0x2de8a8=_0x46d118[_0x42de31];return _0x2de8a8;}export const CONFIG_NAMES=[a156_0x310183(0x85),a156_0x310183(0x6b),a156_0x310183(0x80)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a156_0x310183(0x6e)](_0x57936d=>_0x57936d!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x5a6312){for(const _0x250a14 of CONFIG_NAMES){const _0x965a8d=resolve(_0x5a6312,_0x250a14);if(existsSync(_0x965a8d))return _0x965a8d;}return undefined;}export function findProjectRootDirectory(_0x4b4e76=process['cwd']()){let _0x307ccc=resolve(_0x4b4e76);const {root:_0x458876}=parse(_0x307ccc),_0x5cb80d=homedir();while(!![]){if(resolveConfigPath(_0x307ccc)){if(_0x307ccc===_0x5cb80d)break;return _0x307ccc;}if(_0x307ccc===_0x458876||_0x307ccc===_0x5cb80d)break;const _0x4285be=dirname(_0x307ccc);if(_0x4285be===_0x307ccc)break;_0x307ccc=_0x4285be;}return resolve(_0x4b4e76);}export function getProjectConfigPath(){const _0x11a2b6=a156_0x310183;return resolveConfigPath(process[_0x11a2b6(0x81)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3c208e){const _0x1e412b=a156_0x310183;if(!existsSync(_0x3c208e))return{'status':'missing'};try{const _0x19c41d=readFileSync(_0x3c208e,{'encoding':_0x1e412b(0x75)});if(!_0x19c41d?.[_0x1e412b(0x88)]())return{'status':_0x1e412b(0x93)};const _0x44ffe9=JSON[_0x1e412b(0x7b)](_0x19c41d);return{'status':'ok','data':_0x44ffe9};}catch(_0x23cbe8){return{'status':_0x1e412b(0x8d),'message':_0x23cbe8 instanceof Error?_0x23cbe8['message']:String(_0x23cbe8)};}}function parseCliConfigJsonFile(_0x27e39f,_0x38ed92,_0x296be5){const _0x36749f=a156_0x310183,_0x5aedcc=inspectCliConfigJsonFile(_0x27e39f);if(_0x5aedcc['status']==='missing'||_0x5aedcc[_0x36749f(0x6d)]===_0x36749f(0x93))return{};if(_0x5aedcc[_0x36749f(0x6d)]==='ok')return _0x5aedcc[_0x36749f(0x92)];return _0x38ed92===_0x36749f(0x7a)&&_0x296be5&&console['error'](CLI_BIN_NAME+':\x20'+_0x296be5+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x27e39f+_0x36749f(0x7d)+_0x5aedcc[_0x36749f(0x91)]),{};}function normalizeLegacyConfigShape(_0x20854f){const _0x3d0087=a156_0x310183;if(!_0x20854f||typeof _0x20854f!==_0x3d0087(0x6a))return{'config':{},'migrated':![]};const _0x5d1597={..._0x20854f},_0x121f29=_0x5d1597['apps']&&typeof _0x5d1597[_0x3d0087(0x78)]===_0x3d0087(0x6a)?{..._0x5d1597['apps']}:{},_0x186280=Object['keys'](_0x121f29)[_0x3d0087(0x72)],_0x31b953=_0x5d1597[_0x3d0087(0x8b)]||_0x5d1597[_0x3d0087(0x69)];let _0x5051ea=![];if(_0x31b953&&_0x186280===0x0){const _0xb049d3=typeof _0x5d1597[_0x3d0087(0x89)]===_0x3d0087(0x94)&&_0x5d1597[_0x3d0087(0x89)][_0x3d0087(0x88)]()?_0x5d1597[_0x3d0087(0x89)]:String(_0x31b953)['trim']();_0x121f29[_0xb049d3]={'appcode':String(_0x31b953)[_0x3d0087(0x88)](),..._0x5d1597['env']!=null?{'env':_0x5d1597[_0x3d0087(0x8e)]}:{},..._0x5d1597['apiDir']!=null?{'apiDir':_0x5d1597['apiDir']}:{},..._0x5d1597[_0x3d0087(0x7e)]!=null?{'cookie':_0x5d1597[_0x3d0087(0x7e)]}:{},..._0x5d1597[_0x3d0087(0x95)]!=null?{'accessKey':_0x5d1597[_0x3d0087(0x95)]}:{},..._0x5d1597[_0x3d0087(0x74)]!=null?{'format':_0x5d1597[_0x3d0087(0x74)]}:{},..._0x5d1597[_0x3d0087(0x90)]!=null?{'pageSize':_0x5d1597['pageSize']}:{},..._0x5d1597['riskLevel']!=null?{'riskLevel':_0x5d1597[_0x3d0087(0x8f)]}:{},..._0x5d1597['locale']!=null?{'locale':_0x5d1597[_0x3d0087(0x73)]}:{}},_0x5d1597[_0x3d0087(0x78)]=_0x121f29;if(!_0x5d1597[_0x3d0087(0x89)])_0x5d1597[_0x3d0087(0x89)]=_0xb049d3;_0x5051ea=!![];}return(_0x3d0087(0x8b)in _0x5d1597||_0x3d0087(0x69)in _0x5d1597)&&(delete _0x5d1597[_0x3d0087(0x8b)],delete _0x5d1597[_0x3d0087(0x69)],_0x5051ea=!![]),{'config':_0x5d1597,'migrated':_0x5051ea};}function writeNormalizedConfigIfNeeded(_0x17d2ec,_0x345ab5){const _0x44ebcb=a156_0x310183,_0x4506aa=JSON['stringify'](_0x345ab5,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x17d2ec)===_0x4506aa)return;writeConfigFile(_0x17d2ec,_0x345ab5),normalizedWriteCache[_0x44ebcb(0x79)](_0x17d2ec,_0x4506aa);}function parseAndNormalizeConfig(_0x1b6e71,_0x360db5,_0x5acf09){const _0x9ebda9=a156_0x310183,_0x4e93ac=parseCliConfigJsonFile(_0x1b6e71,_0x360db5,_0x5acf09),_0x557708=normalizeLegacyConfigShape(_0x4e93ac);if(_0x557708[_0x9ebda9(0x77)])try{writeNormalizedConfigIfNeeded(_0x1b6e71,_0x557708['config']);}catch{}return _0x557708['config'];}export function loadRawConfigLayers(_0x1fd095){const _0x5bf42e=a156_0x310183;let _0x3e28e8={},_0x30d3a4={};const _0x91f2e6=resolveConfigPath(homedir());_0x91f2e6&&(_0x3e28e8=parseAndNormalizeConfig(_0x91f2e6,_0x5bf42e(0x7a),_0x5bf42e(0x99)));const _0x56fe47=_0x1fd095??findProjectRootDirectory(),_0x5ab7ce=resolveConfigPath(_0x56fe47);return _0x5ab7ce&&(_0x30d3a4=parseAndNormalizeConfig(_0x5ab7ce,_0x5bf42e(0x7a),_0x5bf42e(0x97))),{'globalPath':_0x91f2e6,'projectPath':_0x5ab7ce,'globalConfig':_0x3e28e8,'projectConfig':_0x30d3a4};}const INHERIT_WHITELIST=['cookie',a156_0x310183(0x95),a156_0x310183(0x73),a156_0x310183(0x74),'riskLevel',a156_0x310183(0x90)];function a156_0x46d1(){const _0x201bfc=['54671DTbjgZ','.lovrabetrc','cwd','.tmp','33frBtTS','1491535SkEYjv','.rabetbase.json','19572DlowCj','4KswfGs','trim','defaultApp','18SUXbAD','appcode','stringify','error','env','riskLevel','pageSize','message','data','empty','string','accessKey','277982LtNrbO','Project','165489TudJMR','Global','1861780lOEwIO','app','object','.lovrabet.json','inherit','status','filter','keys','project','357UljJZg','length','locale','format','utf8','1187288yCIWWY','migrated','apps','set','warn','parse','silent','\x0a\x20\x20','cookie'];a156_0x46d1=function(){return _0x201bfc;};return a156_0x46d1();}export function mergeRawConfigLayers(_0x4432b7){const _0x35e97c=a156_0x310183,{globalConfig:_0x3e5c10,projectConfig:_0x2de6f9}=_0x4432b7,_0x2975b6=Object['keys'](_0x2de6f9)[_0x35e97c(0x72)]>0x0;if(!_0x2975b6)return mergeGlobalOnly(_0x3e5c10);if(_0x2de6f9[_0x35e97c(0x6c)]===!![])return mergeFullInherit(_0x3e5c10,_0x2de6f9);if(_0x2de6f9[_0x35e97c(0x6c)]===![])return mergeIsolated(_0x2de6f9);return mergeProjectFirst(_0x3e5c10,_0x2de6f9);}function mergeGlobalOnly(_0x32a0bd){const _0x471450=a156_0x310183,_0x1c4594={..._0x32a0bd},_0x5d0c88=_0x32a0bd['apps']&&typeof _0x32a0bd['apps']===_0x471450(0x6a)?_0x32a0bd[_0x471450(0x78)]:{};if(Object[_0x471450(0x6f)](_0x5d0c88)[_0x471450(0x72)]>0x0)_0x1c4594[_0x471450(0x78)]=_0x5d0c88;if(_0x32a0bd[_0x471450(0x89)])_0x1c4594[_0x471450(0x89)]=_0x32a0bd['defaultApp'];else{const _0x386a04=Object[_0x471450(0x6f)](_0x5d0c88);if(_0x386a04[_0x471450(0x72)]>0x0)_0x1c4594[_0x471450(0x89)]=_0x386a04[0x0];}return _0x1c4594;}function mergeIsolated(_0x1c81d0){const _0x485e43=a156_0x310183,_0x437013={..._0x1c81d0};delete _0x437013['inherit'];const _0x5e4047=_0x1c81d0[_0x485e43(0x78)]&&typeof _0x1c81d0['apps']==='object'?_0x1c81d0['apps']:{};Object[_0x485e43(0x6f)](_0x5e4047)[_0x485e43(0x72)]>0x0?_0x437013[_0x485e43(0x78)]=_0x5e4047:delete _0x437013[_0x485e43(0x78)];if(_0x485e43(0x89)in _0x1c81d0)_0x437013[_0x485e43(0x89)]=_0x1c81d0[_0x485e43(0x89)];else Object['keys'](_0x5e4047)[_0x485e43(0x72)]>0x0?_0x437013['defaultApp']=Object[_0x485e43(0x6f)](_0x5e4047)[0x0]:delete _0x437013[_0x485e43(0x89)];return _0x437013;}function mergeProjectFirst(_0xe5fbcc,_0x302481){const _0x5763a9=a156_0x310183,_0x57b26a={..._0x302481};delete _0x57b26a['inherit'];for(const _0x2ce3fb of INHERIT_WHITELIST){!(_0x2ce3fb in _0x57b26a)&&_0x2ce3fb in _0xe5fbcc&&(_0x57b26a[_0x2ce3fb]=_0xe5fbcc[_0x2ce3fb]);}const _0x5d546f=_0x302481['apps']&&typeof _0x302481[_0x5763a9(0x78)]===_0x5763a9(0x6a)?_0x302481['apps']:{};Object[_0x5763a9(0x6f)](_0x5d546f)[_0x5763a9(0x72)]>0x0?_0x57b26a['apps']=_0x5d546f:delete _0x57b26a[_0x5763a9(0x78)];if(_0x5763a9(0x89)in _0x302481)_0x57b26a['defaultApp']=_0x302481[_0x5763a9(0x89)];else Object[_0x5763a9(0x6f)](_0x5d546f)[_0x5763a9(0x72)]>0x0?_0x57b26a[_0x5763a9(0x89)]=Object[_0x5763a9(0x6f)](_0x5d546f)[0x0]:delete _0x57b26a[_0x5763a9(0x89)];return _0x57b26a;}function mergeFullInherit(_0x3d23af,_0x44a2e1){const _0x6bf830=a156_0x310183,_0x1f18bc=_0x3d23af[_0x6bf830(0x78)]&&typeof _0x3d23af['apps']===_0x6bf830(0x6a)?_0x3d23af[_0x6bf830(0x78)]:{},_0x5b5fcc=_0x44a2e1[_0x6bf830(0x78)]&&typeof _0x44a2e1['apps']===_0x6bf830(0x6a)?_0x44a2e1[_0x6bf830(0x78)]:{},_0x4419a5={..._0x1f18bc,..._0x5b5fcc},_0x575963={..._0x3d23af,..._0x44a2e1};delete _0x575963[_0x6bf830(0x6c)];if(Object[_0x6bf830(0x6f)](_0x4419a5)[_0x6bf830(0x72)]>0x0)_0x575963[_0x6bf830(0x78)]=_0x4419a5;if('defaultApp'in _0x44a2e1)_0x575963['defaultApp']=_0x44a2e1[_0x6bf830(0x89)];else{if(Object['keys'](_0x5b5fcc)[_0x6bf830(0x72)]>0x0)_0x575963[_0x6bf830(0x89)]=Object[_0x6bf830(0x6f)](_0x5b5fcc)[0x0];else{if(_0x3d23af['defaultApp'])_0x575963['defaultApp']=_0x3d23af[_0x6bf830(0x89)];else{const _0x418c96=Object[_0x6bf830(0x6f)](_0x1f18bc);if(_0x418c96['length']>0x0)_0x575963[_0x6bf830(0x89)]=_0x418c96[0x0];}}}return _0x575963;}export function readRawConfigWithLayers(_0x4ace23){const _0x36c44b=loadRawConfigLayers(_0x4ace23);return{'config':mergeRawConfigLayers(_0x36c44b),'layers':_0x36c44b};}export function readRawConfig(_0x5894ff){return mergeRawConfigLayers(loadRawConfigLayers(_0x5894ff));}export function readConfigFile(_0x400ccb){const _0x24a025=a156_0x310183;return parseAndNormalizeConfig(_0x400ccb,_0x24a025(0x7c));}export function writeConfigFile(_0x492bec,_0x51a478){const _0x1850ff=a156_0x310183,_0x511be0=dirname(_0x492bec);!existsSync(_0x511be0)&&mkdirSync(_0x511be0,{'recursive':!![]});const _0x47a792=_0x492bec+_0x1850ff(0x82);try{writeFileSync(_0x47a792,JSON[_0x1850ff(0x8c)](_0x51a478,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x47a792,_0x492bec);}catch(_0x3cf166){try{unlinkSync(_0x47a792);}catch{}throw _0x3cf166;}}export function resolveWriteConfigPath(_0x3c8d86){const _0x3ae112=a156_0x310183,_0x4e0195=_0x3c8d86===_0x3ae112(0x70)?process['cwd']():homedir(),_0x44a7b9=resolveConfigPath(_0x4e0195);return _0x44a7b9??resolve(_0x4e0195,NEW_CONFIG_NAME);}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- function a156_0x327c(_0x380067,_0xd7f3f9){_0x380067=_0x380067-0x19d;const _0x5cbce7=a156_0x5cbc();let _0x327c94=_0x5cbce7[_0x380067];return _0x327c94;}const a156_0x180b5e=a156_0x327c;(function(_0x12b1f9,_0x4f1342){const _0x1c8ff4=a156_0x327c,_0x4735e5=_0x12b1f9();while(!![]){try{const _0x4b7f7e=-parseInt(_0x1c8ff4(0x1b0))/0x1+parseInt(_0x1c8ff4(0x1aa))/0x2+-parseInt(_0x1c8ff4(0x1af))/0x3+parseInt(_0x1c8ff4(0x1b5))/0x4*(parseInt(_0x1c8ff4(0x1a7))/0x5)+parseInt(_0x1c8ff4(0x1ae))/0x6+-parseInt(_0x1c8ff4(0x1bd))/0x7+parseInt(_0x1c8ff4(0x1a3))/0x8;if(_0x4b7f7e===_0x4f1342)break;else _0x4735e5['push'](_0x4735e5['shift']());}catch(_0xf0125d){_0x4735e5['push'](_0x4735e5['shift']());}}}(a156_0x5cbc,0x91327));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0xf6c799){return process.env[`RABETBASE_${_0xf6c799}`]||process.env[`LOVRABET_${_0xf6c799}`]||undefined;}export async function createContext(_0x2f1e7c){const _0x5a1d4b=a156_0x327c,{config:_0x2a94be,layers:_0x1a8c77}=readRawConfigWithLayers(),_0x2369b1=buildConfig(_0x2a94be,_0x2f1e7c,_0x1a8c77),{initEnv:_0x4bda31}=await import(_0x5a1d4b(0x1a4));if(_0x2369b1[_0x5a1d4b(0x19f)])_0x4bda31(_0x2369b1['env']);else _0x2f1e7c[_0x5a1d4b(0x19f)]&&typeof _0x2f1e7c['env']==='string'&&_0x4bda31(_0x2f1e7c['env']);const {initDomains:_0x4c27fb,getUserDomain:_0x3fc926,getApiDomain:_0x41a046}=await import(_0x5a1d4b(0x1b1));_0x4c27fb({'apiDomain':_0x2a94be[_0x5a1d4b(0x1bc)]||undefined,'userDomain':_0x2a94be[_0x5a1d4b(0x1c5)]||undefined,'runtimeDomain':_0x2a94be[_0x5a1d4b(0x1bf)]||undefined});const _0x4fadd9={'apiDomain':_0x41a046(),'userDomain':_0x3fc926()},_0x447eac=await buildAuth(_0x2369b1);logger[_0x5a1d4b(0x1a1)](process[_0x5a1d4b(0x1c1)]());const _0x24897b=(CLI_BIN_NAME+'\x20'+process[_0x5a1d4b(0x1a8)][_0x5a1d4b(0x1b8)](0x2)['join']('\x20'))[_0x5a1d4b(0x1b7)]();logger['setRawCommand'](_0x24897b);const {isNonInteractive:_0x310cd2}=await import(_0x5a1d4b(0x1c0)),_0x5ce6c3=_0x310cd2(_0x2f1e7c);return{'config':_0x2369b1,'auth':_0x447eac,'logger':logger,'env':_0x4fadd9,'nonInteractive':_0x5ce6c3};}export function buildConfigFromFlags(_0x68cc0){const {config:_0xd1ee8d,layers:_0xd38615}=readRawConfigWithLayers();return buildConfig(_0xd1ee8d,_0x68cc0,_0xd38615);}export function getConfigAppCode(_0x1451c9){const _0x2f7015=a156_0x327c,_0x3cdd42=readRawConfig(_0x1451c9);if(_0x3cdd42[_0x2f7015(0x1ad)]&&typeof _0x3cdd42[_0x2f7015(0x1ad)]===_0x2f7015(0x1bb)){const _0x2c6527=_0x3cdd42[_0x2f7015(0x1ba)];if(_0x2c6527&&_0x3cdd42[_0x2f7015(0x1ad)][_0x2c6527]?.[_0x2f7015(0x1c3)])return String(_0x3cdd42[_0x2f7015(0x1ad)][_0x2c6527][_0x2f7015(0x1c3)])[_0x2f7015(0x1b7)]();const _0x4cd912=Object[_0x2f7015(0x1b3)](_0x3cdd42[_0x2f7015(0x1ad)])[0x0];if(_0x4cd912?.[_0x2f7015(0x1c3)])return String(_0x4cd912[_0x2f7015(0x1c3)])['trim']();}const _0x920112=_0x3cdd42[_0x2f7015(0x1c3)]||_0x3cdd42['app'];if(typeof _0x920112!==_0x2f7015(0x1b6)||_0x920112[_0x2f7015(0x1b7)]()==='')return undefined;return _0x920112['trim']();}export function getMultiAppConfigs(_0x28b40b=a156_0x180b5e(0x1a9),_0x12f7a0){const _0x454fc6=a156_0x180b5e,_0x3073c5=loadRawConfigLayers(_0x12f7a0);let _0x167cb1,_0x49d421;if(_0x28b40b===_0x454fc6(0x1b2)){const _0x5c962a=_0x3073c5[_0x454fc6(0x19e)][_0x454fc6(0x1ad)]&&typeof _0x3073c5['globalConfig'][_0x454fc6(0x1ad)]===_0x454fc6(0x1bb)?_0x3073c5[_0x454fc6(0x19e)]['apps']:{},_0x42b995=_0x3073c5[_0x454fc6(0x1ac)][_0x454fc6(0x1ad)]&&typeof _0x3073c5[_0x454fc6(0x1ac)]['apps']===_0x454fc6(0x1bb)?_0x3073c5[_0x454fc6(0x1ac)]['apps']:{};_0x167cb1={..._0x5c962a,..._0x42b995};const _0xf1a35c=readRawConfig(_0x12f7a0);_0x49d421=_0xf1a35c[_0x454fc6(0x1ba)];}else _0x167cb1=_0x3073c5[_0x454fc6(0x1ac)]['apps'],_0x49d421=_0x3073c5[_0x454fc6(0x1ac)][_0x454fc6(0x1ba)];if(!_0x167cb1||typeof _0x167cb1!=='object'||Object[_0x454fc6(0x1a0)](_0x167cb1)[_0x454fc6(0x1ab)]===0x0)return null;return Object[_0x454fc6(0x1a6)](_0x167cb1)[_0x454fc6(0x1b4)](([_0x5f39d2,_0x1f66c7])=>({'name':_0x5f39d2,'appcode':_0x1f66c7?.[_0x454fc6(0x1c3)]||'','isDefault':_0x5f39d2===_0x49d421,'env':_0x1f66c7?.[_0x454fc6(0x19f)],'apiDir':_0x1f66c7?.[_0x454fc6(0x1be)],'cookie':_0x1f66c7?.[_0x454fc6(0x1c4)]||undefined}))[_0x454fc6(0x1a2)](_0xeb7a06=>_0xeb7a06['appcode']);}export function getTemplateBaseUrl(_0x405672){const _0x54aa41=a156_0x180b5e,_0x286d69=readRawConfig(_0x405672);if(_0x286d69[_0x54aa41(0x1a5)]&&typeof _0x286d69[_0x54aa41(0x1a5)]===_0x54aa41(0x1b6))return _0x286d69[_0x54aa41(0x1a5)][_0x54aa41(0x19d)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}function buildConfig(_0x28976a,_0xb0c344,_0x4b1dd7){return{...resolveAppConfig({'raw':_0x28976a,'flags':_0xb0c344,'layers':_0x4b1dd7,'readEnv':env}),'raw':_0x28976a};}export function resolveApiFilePath(_0x588b33,_0x315c9a){const _0x3d457f=a156_0x180b5e,_0x3e296b=resolve(process[_0x3d457f(0x1c1)](),_0x588b33),_0xd3cae2=resolve(_0x3e296b,_0x3d457f(0x1c2));if(!_0x315c9a)return _0xd3cae2;const _0x3d75a5=readRawConfig(),_0x83fa62=_0x3d75a5[_0x3d457f(0x1ad)]&&typeof _0x3d75a5[_0x3d457f(0x1ad)]==='object'?_0x3d75a5[_0x3d457f(0x1ad)]:{},_0x2a5c9d=Object[_0x3d457f(0x1a6)](_0x83fa62)['find'](([,_0x181e90])=>_0x181e90?.['appcode']===_0x315c9a);if(!_0x2a5c9d)return _0xd3cae2;const [_0x17665a,_0x8e3b9]=_0x2a5c9d,_0x3b3d1b=typeof _0x3d75a5[_0x3d457f(0x1ba)]===_0x3d457f(0x1b6)?_0x3d75a5[_0x3d457f(0x1ba)]:undefined;if(_0x8e3b9?.[_0x3d457f(0x1be)])return _0xd3cae2;if(_0x3b3d1b&&_0x17665a!==_0x3b3d1b)return resolve(_0x3e296b,_0x17665a+_0x3d457f(0x1b9));return _0xd3cae2;}function a156_0x5cbc(){const _0x4ced8f=['apiDir','runtimeDomain','./utils/is-non-interactive.js','cwd','api.ts','appcode','cookie','userDomain','replace','globalConfig','env','keys','setLogPath','filter','7373552wrGnRK','./constant/env.js','template_base_url','entries','24100idjVAT','argv','project','692772JLASPc','length','projectConfig','apps','3207852qihOjo','754698SNjUrX','609981fCZSLK','./constant/domain.js','merged','values','map','304sdhGar','string','trim','slice','-api.ts','defaultApp','object','apiDomain','4989376tDNuZB'];a156_0x5cbc=function(){return _0x4ced8f;};return a156_0x5cbc();}
1
+ const a157_0x47a550=a157_0xe694;(function(_0x1008f8,_0x32b492){const _0x3380e3=a157_0xe694,_0x367f3e=_0x1008f8();while(!![]){try{const _0x5ccfe8=parseInt(_0x3380e3(0x14f))/0x1*(parseInt(_0x3380e3(0x145))/0x2)+-parseInt(_0x3380e3(0x143))/0x3*(-parseInt(_0x3380e3(0x148))/0x4)+parseInt(_0x3380e3(0x149))/0x5+-parseInt(_0x3380e3(0x162))/0x6+parseInt(_0x3380e3(0x146))/0x7*(-parseInt(_0x3380e3(0x16a))/0x8)+-parseInt(_0x3380e3(0x153))/0x9+parseInt(_0x3380e3(0x163))/0xa*(parseInt(_0x3380e3(0x169))/0xb);if(_0x5ccfe8===_0x32b492)break;else _0x367f3e['push'](_0x367f3e['shift']());}catch(_0x519209){_0x367f3e['push'](_0x367f3e['shift']());}}}(a157_0x587e,0xc1d8c));import{resolve}from'node:path';function a157_0xe694(_0x249648,_0x523345){_0x249648=_0x249648-0x141;const _0x587e8d=a157_0x587e();let _0xe694cc=_0x587e8d[_0x249648];return _0xe694cc;}import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';function a157_0x587e(){const _0x2c3556=['https://g.lovrabet.com/dist/lovrabet-skill','./constant/domain.js','defaultApp','1WblmAr','setRawCommand','values','entries','10781748DOPGan','project','./constant/env.js','app','globalConfig','merged','object','find','env','setLogPath','slice','api.ts','string','cookie','template_base_url','5186688MFSrOn','13524150CaZAtP','apps','length','apiDir','cwd','filter','22BZlaek','72fcmitX','-api.ts','appcode','replace','keys','6tUJcjS','argv','597482PqabHa','965293yeUMiX','trim','789472lSLjKw','3496000zVdUwV','projectConfig','map'];a157_0x587e=function(){return _0x2c3556;};return a157_0x587e();}import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0xc2a89b){return process.env[`RABETBASE_${_0xc2a89b}`]||process.env[`LOVRABET_${_0xc2a89b}`]||undefined;}export async function createContext(_0x5a5cac){const _0x304983=a157_0xe694,{config:_0x283bdf,layers:_0x5ee380}=readRawConfigWithLayers(),_0x55f65f=buildConfig(_0x283bdf,_0x5a5cac,_0x5ee380),{initEnv:_0xb928b1}=await import(_0x304983(0x155));if(_0x55f65f['env'])_0xb928b1(_0x55f65f[_0x304983(0x15b)]);else _0x5a5cac['env']&&typeof _0x5a5cac[_0x304983(0x15b)]===_0x304983(0x15f)&&_0xb928b1(_0x5a5cac[_0x304983(0x15b)]);const {initDomains:_0x40be17,getUserDomain:_0xbb0093,getApiDomain:_0x122187}=await import(_0x304983(0x14d));_0x40be17({'apiDomain':_0x283bdf['apiDomain']||undefined,'userDomain':_0x283bdf['userDomain']||undefined,'runtimeDomain':_0x283bdf['runtimeDomain']||undefined});const _0x5bb93f={'apiDomain':_0x122187(),'userDomain':_0xbb0093()},_0x255a54=await buildAuth(_0x55f65f);logger[_0x304983(0x15c)](process['cwd']());const _0x115dce=(CLI_BIN_NAME+'\x20'+process[_0x304983(0x144)][_0x304983(0x15d)](0x2)['join']('\x20'))['trim']();logger[_0x304983(0x150)](_0x115dce);const {isNonInteractive:_0x46cc7b}=await import('./utils/is-non-interactive.js'),_0x31a7b5=_0x46cc7b(_0x5a5cac);return{'config':_0x55f65f,'auth':_0x255a54,'logger':logger,'env':_0x5bb93f,'nonInteractive':_0x31a7b5};}export function buildConfigFromFlags(_0x571a87){const {config:_0x36addd,layers:_0x280a1e}=readRawConfigWithLayers();return buildConfig(_0x36addd,_0x571a87,_0x280a1e);}export function getConfigAppCode(_0x3754b6){const _0x358142=a157_0xe694,_0x50c2ef=readRawConfig(_0x3754b6);if(_0x50c2ef[_0x358142(0x164)]&&typeof _0x50c2ef['apps']===_0x358142(0x159)){const _0x47f891=_0x50c2ef['defaultApp'];if(_0x47f891&&_0x50c2ef[_0x358142(0x164)][_0x47f891]?.[_0x358142(0x16c)])return String(_0x50c2ef[_0x358142(0x164)][_0x47f891][_0x358142(0x16c)])[_0x358142(0x147)]();const _0x329a67=Object[_0x358142(0x151)](_0x50c2ef[_0x358142(0x164)])[0x0];if(_0x329a67?.[_0x358142(0x16c)])return String(_0x329a67[_0x358142(0x16c)])[_0x358142(0x147)]();}const _0x4309c7=_0x50c2ef[_0x358142(0x16c)]||_0x50c2ef[_0x358142(0x156)];if(typeof _0x4309c7!==_0x358142(0x15f)||_0x4309c7[_0x358142(0x147)]()==='')return undefined;return _0x4309c7[_0x358142(0x147)]();}export function getMultiAppConfigs(_0x28da50=a157_0x47a550(0x154),_0x4c7556){const _0xfb85d3=a157_0x47a550,_0x1690ad=loadRawConfigLayers(_0x4c7556);let _0x576390,_0x17455a;if(_0x28da50===_0xfb85d3(0x158)){const _0x4c8c66=_0x1690ad[_0xfb85d3(0x157)][_0xfb85d3(0x164)]&&typeof _0x1690ad[_0xfb85d3(0x157)]['apps']==='object'?_0x1690ad['globalConfig'][_0xfb85d3(0x164)]:{},_0x418d0d=_0x1690ad[_0xfb85d3(0x14a)][_0xfb85d3(0x164)]&&typeof _0x1690ad[_0xfb85d3(0x14a)][_0xfb85d3(0x164)]===_0xfb85d3(0x159)?_0x1690ad[_0xfb85d3(0x14a)][_0xfb85d3(0x164)]:{};_0x576390={..._0x4c8c66,..._0x418d0d};const _0x1a0804=readRawConfig(_0x4c7556);_0x17455a=_0x1a0804[_0xfb85d3(0x14e)];}else _0x576390=_0x1690ad[_0xfb85d3(0x14a)]['apps'],_0x17455a=_0x1690ad[_0xfb85d3(0x14a)][_0xfb85d3(0x14e)];if(!_0x576390||typeof _0x576390!==_0xfb85d3(0x159)||Object[_0xfb85d3(0x142)](_0x576390)[_0xfb85d3(0x165)]===0x0)return null;return Object[_0xfb85d3(0x152)](_0x576390)[_0xfb85d3(0x14b)](([_0x3f748d,_0x4ac9e6])=>({'name':_0x3f748d,'appcode':_0x4ac9e6?.[_0xfb85d3(0x16c)]||'','isDefault':_0x3f748d===_0x17455a,'env':_0x4ac9e6?.[_0xfb85d3(0x15b)],'apiDir':_0x4ac9e6?.[_0xfb85d3(0x166)],'cookie':_0x4ac9e6?.[_0xfb85d3(0x160)]||undefined}))[_0xfb85d3(0x168)](_0x13e987=>_0x13e987[_0xfb85d3(0x16c)]);}export function getTemplateBaseUrl(_0x2eae2b){const _0x5034b2=a157_0x47a550,_0x5629bb=readRawConfig(_0x2eae2b);if(_0x5629bb[_0x5034b2(0x161)]&&typeof _0x5629bb[_0x5034b2(0x161)]===_0x5034b2(0x15f))return _0x5629bb['template_base_url'][_0x5034b2(0x141)](/\/$/,'');return _0x5034b2(0x14c);}function buildConfig(_0x2be5bf,_0x26aac4,_0x4cc4d5){return{...resolveAppConfig({'raw':_0x2be5bf,'flags':_0x26aac4,'layers':_0x4cc4d5,'readEnv':env}),'raw':_0x2be5bf};}export function resolveApiFilePath(_0x587ade,_0x5e5376){const _0x3a6e42=a157_0x47a550,_0x36b220=resolve(process[_0x3a6e42(0x167)](),_0x587ade),_0x3f8023=resolve(_0x36b220,_0x3a6e42(0x15e));if(!_0x5e5376)return _0x3f8023;const _0x21dc93=readRawConfig(),_0x45eab7=_0x21dc93[_0x3a6e42(0x164)]&&typeof _0x21dc93['apps']===_0x3a6e42(0x159)?_0x21dc93[_0x3a6e42(0x164)]:{},_0x4a85c9=Object[_0x3a6e42(0x152)](_0x45eab7)[_0x3a6e42(0x15a)](([,_0x37f44a])=>_0x37f44a?.[_0x3a6e42(0x16c)]===_0x5e5376);if(!_0x4a85c9)return _0x3f8023;const [_0x3e98f,_0x135f82]=_0x4a85c9,_0x2f3388=typeof _0x21dc93[_0x3a6e42(0x14e)]===_0x3a6e42(0x15f)?_0x21dc93[_0x3a6e42(0x14e)]:undefined;if(_0x135f82?.[_0x3a6e42(0x166)])return _0x3f8023;if(_0x2f3388&&_0x3e98f!==_0x2f3388)return resolve(_0x36b220,_0x3e98f+_0x3a6e42(0x16b));return _0x3f8023;}
@@ -1 +1 @@
1
- function a157_0x5535(_0x2bab55,_0x4bf61c){_0x2bab55=_0x2bab55-0xd8;const _0x2a6dbc=a157_0x2a6d();let _0x55354d=_0x2a6dbc[_0x2bab55];return _0x55354d;}(function(_0x438743,_0x5e5c19){const _0x77e2d1=a157_0x5535,_0x5dd863=_0x438743();while(!![]){try{const _0x60a72a=parseInt(_0x77e2d1(0xe9))/0x1*(-parseInt(_0x77e2d1(0xdf))/0x2)+parseInt(_0x77e2d1(0xe1))/0x3+-parseInt(_0x77e2d1(0xdc))/0x4*(-parseInt(_0x77e2d1(0xdd))/0x5)+-parseInt(_0x77e2d1(0xe2))/0x6+-parseInt(_0x77e2d1(0xea))/0x7+parseInt(_0x77e2d1(0xd8))/0x8+parseInt(_0x77e2d1(0xe3))/0x9*(parseInt(_0x77e2d1(0xe0))/0xa);if(_0x60a72a===_0x5e5c19)break;else _0x5dd863['push'](_0x5dd863['shift']());}catch(_0x1c7e12){_0x5dd863['push'](_0x5dd863['shift']());}}}(a157_0x2a6d,0xbf535));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x24d7b5){const _0x54675b=a157_0x5535,_0x526a7e=[],_0x380ac1=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x4f3f12;while((_0x4f3f12=_0x380ac1[_0x54675b(0xda)](_0x24d7b5))!==null){_0x526a7e[_0x54675b(0xe7)]({'datasetCode':_0x4f3f12[0x1],'tableName':_0x4f3f12[0x2],'name':_0x4f3f12[0x3],'alias':_0x4f3f12[0x4]});}return _0x526a7e;}export function loadAliasMap(_0x36b417,_0x38fa04,_0xef1c30){const _0xc9f9df=a157_0x5535,_0x1c6a68=_0xef1c30??resolve(process[_0xc9f9df(0xdb)](),_0x36b417,_0xc9f9df(0xe6));if(cache['has'](_0x1c6a68))return cache[_0xc9f9df(0xe5)](_0x1c6a68);if(!existsSync(_0x1c6a68))return cache[_0xc9f9df(0xd9)](_0x1c6a68,[]),[];try{const _0x454140=readFileSync(_0x1c6a68,_0xc9f9df(0xe8)),_0x2aa988=parseApiFile(_0x454140);return cache['set'](_0x1c6a68,_0x2aa988),_0x2aa988;}catch{return cache[_0xc9f9df(0xd9)](_0x1c6a68,[]),[];}}export function resolveAlias(_0x5dbbff,_0x5359c7,_0x49f70b,_0x17c6e6){const _0x123816=a157_0x5535;if(!_0x5359c7)return undefined;const _0x2d5974=loadAliasMap(_0x5dbbff,_0x49f70b,_0x17c6e6),_0x1f2511=_0x2d5974[_0x123816(0xde)](_0x5955ae=>_0x5955ae['alias']===_0x5359c7);return _0x1f2511?.[_0x123816(0xe4)];}export function listAliases(_0x5035ce,_0x34ed44,_0x55b4b1){return loadAliasMap(_0x5035ce,_0x34ed44,_0x55b4b1);}function a157_0x2a6d(){const _0x5597c2=['push','utf-8','347EDfDyH','3041514fRtPZE','12412232AxLPtU','set','exec','cwd','4FJGPqL','1890955TzWNGP','find','4282NNlqRD','1420LWTxgZ','4117692fQGPpo','8676744zHDWAZ','6651XGZEYx','datasetCode','get','api.ts'];a157_0x2a6d=function(){return _0x5597c2;};return a157_0x2a6d();}
1
+ (function(_0x3b5035,_0x4da7b0){const _0x390c3e=a158_0x2c56,_0x5cc2b2=_0x3b5035();while(!![]){try{const _0x14a60a=parseInt(_0x390c3e(0xa8))/0x1*(-parseInt(_0x390c3e(0xac))/0x2)+parseInt(_0x390c3e(0xab))/0x3*(-parseInt(_0x390c3e(0xa6))/0x4)+-parseInt(_0x390c3e(0xa0))/0x5*(-parseInt(_0x390c3e(0xaa))/0x6)+parseInt(_0x390c3e(0x9d))/0x7+-parseInt(_0x390c3e(0xa7))/0x8+parseInt(_0x390c3e(0xa2))/0x9*(-parseInt(_0x390c3e(0xa5))/0xa)+parseInt(_0x390c3e(0xa3))/0xb;if(_0x14a60a===_0x4da7b0)break;else _0x5cc2b2['push'](_0x5cc2b2['shift']());}catch(_0x261f43){_0x5cc2b2['push'](_0x5cc2b2['shift']());}}}(a158_0x306f,0x41702));function a158_0x2c56(_0xc149c1,_0x4680c1){_0xc149c1=_0xc149c1-0x9d;const _0x306f4f=a158_0x306f();let _0x2c5624=_0x306f4f[_0xc149c1];return _0x2c5624;}function a158_0x306f(){const _0x39f8ff=['utf-8','916650gGVvGc','find','set','1555jwICNi','api.ts','130626YNVyCU','10823395bIxZzP','cwd','70ZYSJdd','65828VRnIuY','3867512MgOjHW','15853EhTDMh','push','5298Qyyouf','66WibPYr','22SshWWj'];a158_0x306f=function(){return _0x39f8ff;};return a158_0x306f();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x217f88){const _0x1ad893=a158_0x2c56,_0x30074f=[],_0x30ee10=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1bdd01;while((_0x1bdd01=_0x30ee10['exec'](_0x217f88))!==null){_0x30074f[_0x1ad893(0xa9)]({'datasetCode':_0x1bdd01[0x1],'tableName':_0x1bdd01[0x2],'name':_0x1bdd01[0x3],'alias':_0x1bdd01[0x4]});}return _0x30074f;}export function loadAliasMap(_0x4aa3b9,_0x437bb4,_0x237805){const _0x45ee04=a158_0x2c56,_0x3d37a1=_0x237805??resolve(process[_0x45ee04(0xa4)](),_0x4aa3b9,_0x45ee04(0xa1));if(cache['has'](_0x3d37a1))return cache['get'](_0x3d37a1);if(!existsSync(_0x3d37a1))return cache[_0x45ee04(0x9f)](_0x3d37a1,[]),[];try{const _0x272739=readFileSync(_0x3d37a1,_0x45ee04(0xad)),_0x488a03=parseApiFile(_0x272739);return cache[_0x45ee04(0x9f)](_0x3d37a1,_0x488a03),_0x488a03;}catch{return cache[_0x45ee04(0x9f)](_0x3d37a1,[]),[];}}export function resolveAlias(_0xfd1a0e,_0x767bb3,_0x52e069,_0x1375ac){const _0x474d60=a158_0x2c56;if(!_0x767bb3)return undefined;const _0x14203e=loadAliasMap(_0xfd1a0e,_0x52e069,_0x1375ac),_0x5bab19=_0x14203e[_0x474d60(0x9e)](_0x1a5808=>_0x1a5808['alias']===_0x767bb3);return _0x5bab19?.['datasetCode'];}export function listAliases(_0x2f65be,_0x5a62b3,_0x4296f4){return loadAliasMap(_0x2f65be,_0x5a62b3,_0x4296f4);}
@@ -1 +1 @@
1
- (function(_0xeaa081,_0x37e350){const _0x455ea0=a158_0x2fe6,_0x15de73=_0xeaa081();while(!![]){try{const _0xba9fab=-parseInt(_0x455ea0(0x21f))/0x1+-parseInt(_0x455ea0(0x1ed))/0x2*(-parseInt(_0x455ea0(0x196))/0x3)+parseInt(_0x455ea0(0x216))/0x4*(-parseInt(_0x455ea0(0x1a7))/0x5)+parseInt(_0x455ea0(0x1b8))/0x6+-parseInt(_0x455ea0(0x20d))/0x7*(parseInt(_0x455ea0(0x199))/0x8)+-parseInt(_0x455ea0(0x1d1))/0x9+-parseInt(_0x455ea0(0x1b3))/0xa*(-parseInt(_0x455ea0(0x1e6))/0xb);if(_0xba9fab===_0x37e350)break;else _0x15de73['push'](_0x15de73['shift']());}catch(_0x17e485){_0x15de73['push'](_0x15de73['shift']());}}}(a158_0x4b14,0x27408));function a158_0x4b14(){const _0x2f015d=['/standard-page-status?appCode=','/smartapi/lovrabet/update-page','/smartapi/custom/getUserCustomSql?id=','scriptType','78620JoSegK','enabled','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','functionName','string','754230xFrpbD','responseFields','/smartapi/dblink/getAllTableList','physicalTableCount','/smartapi/custom/queryUserCustomSqlList','(/*\x20params\x20*/);','/smartapi/question/er-config/erCreate','.getOne(id);','/smartapi/question/er-config/erDelete','SQL\x20query\x20not\x20found:\x20','data','length','\x20failed','name','authRequired','key','/smartapi/dataset/get-dataset-list','BFF\x20script\x20not\x20found:\x20id=','Request\x20timeout:\x20','application/json','code','isArray','const\x20result\x20=\x20await\x20client.models.','label','set','938259nrXmCB','\x20\x20\x20\x20sqlCode:\x20\x27','deleted','/generate-standard-pages/status?','toString','requestFields','/smartapi/app-config/delete','object','cli:rabetbase','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','const\x20results\x20=\x20data.execResult\x20||\x20[];','has','warn','\x20apps.\x20','UNAUTHORIZED','/smartapi/dblink/getList','Request\x20failed:\x20','push','/api/management/library/scripts/save','dbtableConfig','sqlName','209fJGxkI','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-operation','includeImports','/smartapi/question/er-config','api_error','/smartapi/lovrabet/detail?pageId=','5382CYENhf','/api/management/script/cache/clear','401','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','POST','entries','/api/management/library/scripts/list?appCode=','/api/management/library/scripts/statistics?appCode=','tableData','modelCode','/smartapi/custom/updateUserCustomSql','/smartapi/question/er-config/update-single','tableList','json','/smartapi/custom/getUserCustomSql','replace','dbId','/smartapi/db-analysis/start','/sync-to-pages','\x20\x20pageSize:\x2020,','validation','toLowerCase','displayName','Operation\x20\x22','body','totalCount','create','Page\x20not\x20found:\x20','/api/','/api/custom/executeSql','const\x20data\x20=\x20await\x20client.sql.execute({','getOne','21AVlesm','\x20\x20currentPage:\x201,','/smartapi/app-config/list','/smartapi/dblink/getTableDiffV2ByPage','//\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','pageSize','stringify','/smartapi/app-config/create','8pdQuLm','Unauthorized','GET','status','operations','errorCode','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','test','100462XTATFg','/smartapi/lovrabet/dataset/','errorMsg','/api/management/library/scripts/delete','datasetTableCount','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','value','sdk','apiError','map','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/question/er-config/business-group/edit','operationName','\x20\x20return\x20rows;','join','sqlCode','\x20\x20where:\x20{},','modelId','find','filter','/api/management/library/scripts/info?id=','/smartapi/app-config/update','clientOperationId','/smartapi/app-config/getByKey','operationId','\x20\x20});','signal','description','API\x20error\x20code:\x20','tableName','currentPage','/smartapi/dblink/create','dataset_','309qNpktZ','/generate-standard-pages/start','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','57784JFyaQi','Warning:\x20showing\x20first\x20','method','includes','message','errorMessage','pageIndex','//\x20SQL:\x20','list','error','/filter','});','planId','tags','412745PQdQAp','scriptName','/smartapi/dblink/testConnect','success','Check\x20network\x20connectivity\x20and\x20try\x20again.','SQL\x20query\x20not\x20found:\x20id=','/api/node-toolbox/sql/save','\x20of\x20'];a158_0x4b14=function(){return _0x2f015d;};return a158_0x4b14();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0xb12eb3){_activeCookie=_0xb12eb3||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0;function createFetchFailureError(_0x312b7c,_0x3e8ddc){const _0x215020=a158_0x2fe6,_0x3ff46b=_0x3e8ddc instanceof Error?_0x3e8ddc[_0x215020(0x19d)]:String(_0x3e8ddc);return CliErrors[_0x215020(0x17d)](_0x215020(0x1e1)+_0x312b7c+(_0x3ff46b?'\x20('+_0x3ff46b+')':''),_0x215020(0x1ab));}async function apiRequest(_0x2b221d,_0xf51aa0={}){const _0x270efc=a158_0x2fe6,{method:method='GET',body:_0x10f381,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xf51aa0,_0x29996d=useRuntime?getRuntimeDomain():getApiDomain(),_0x2f921f=_activeCookie||getCookie(),_0xdc0cb6=''+_0x29996d+_0x2b221d,_0xf8389e=new AbortController(),_0x4d8d61=setTimeout(()=>_0xf8389e['abort'](),timeout);try{const _0x49a345=await fetch(_0xdc0cb6,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x2f921f,'X-Invoke-Source':_0x270efc(0x1d9),...headers},'body':_0x10f381?JSON[_0x270efc(0x214)](_0x10f381):undefined,'signal':_0xf8389e[_0x270efc(0x18f)]});let _0x32bac0;try{_0x32bac0=await _0x49a345['json']();}catch(_0x3d61a8){if(_0x3d61a8 instanceof Error&&_0x3d61a8['name']==='AbortError')throw CliErrors['apiError'](_0x270efc(0x1ca)+_0xdc0cb6);if(_0x49a345['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x270efc(0x17d)](_0x270efc(0x1f0)+_0x49a345[_0x270efc(0x219)]+')',_0x49a345['status']>=0x190?_0x270efc(0x17a):undefined);}if(!_0x49a345['ok']||_0x32bac0[_0x270efc(0x1aa)]===![])throw CliErrors[_0x270efc(0x17d)](_0x32bac0[_0x270efc(0x221)]||_0x32bac0[_0x270efc(0x19d)]||'API\x20error:\x20'+_0x49a345[_0x270efc(0x219)],_0x32bac0['errorCode']?_0x270efc(0x191)+_0x32bac0[_0x270efc(0x21b)]:undefined);return _0x32bac0;}catch(_0x46222e){if(_0x46222e instanceof CliError)throw _0x46222e;if(_0x46222e instanceof Error&&_0x46222e['name']==='AbortError')throw CliErrors[_0x270efc(0x17d)]('Request\x20timeout:\x20'+_0xdc0cb6);throw createFetchFailureError(_0xdc0cb6,_0x46222e);}finally{clearTimeout(_0x4d8d61);}}function isAuthFailure(_0x220ee5){const _0x531e86=a158_0x2fe6,_0x2dd981=_0x220ee5[_0x531e86(0x221)]||_0x220ee5[_0x531e86(0x19d)]||_0x220ee5[_0x531e86(0x1c2)]?.[_0x531e86(0x19d)]||_0x220ee5[_0x531e86(0x19e)]||_0x220ee5[_0x531e86(0x1a2)]||'';return _0x220ee5[_0x531e86(0x21b)]===_0x531e86(0x1df)||_0x220ee5[_0x531e86(0x1cc)]===0x191||_0x220ee5['code']==='401'||_0x2dd981['includes'](_0x531e86(0x1ef))||_0x2dd981[_0x531e86(0x19c)](_0x531e86(0x217))||_0x2dd981[_0x531e86(0x19c)]('登录')||_0x2dd981['includes']('认证');}export async function platformFetch(_0x1ea523,_0x334d24){const _0x1208e0=a158_0x2fe6;let _0x45fc3d;try{_0x45fc3d=await fetch(_0x1ea523,{'method':_0x334d24[_0x1208e0(0x19b)]??_0x1208e0(0x218),'headers':{'Content-Type':_0x1208e0(0x1cb),'Cookie':_0x334d24['cookie'],'X-Invoke-Source':_0x1208e0(0x1d9)},..._0x334d24[_0x1208e0(0x205)]&&{'body':JSON['stringify'](_0x334d24['body'])}});}catch(_0x4442c0){throw createFetchFailureError(_0x1ea523,_0x4442c0);}if(!_0x45fc3d['ok']){if(_0x45fc3d[_0x1208e0(0x219)]===0x191)throw CliErrors[_0x1208e0(0x1c6)]();throw CliErrors[_0x1208e0(0x17d)](_0x334d24['label']+'\x20failed,\x20HTTP\x20'+_0x45fc3d[_0x1208e0(0x219)]);}const _0x51696c=await _0x45fc3d[_0x1208e0(0x1fa)]();if(_0x51696c['success']===![]){if(isAuthFailure(_0x51696c))throw CliErrors['authRequired']();throw CliErrors[_0x1208e0(0x17d)](_0x51696c[_0x1208e0(0x221)]||_0x51696c['message']||_0x334d24[_0x1208e0(0x1cf)]+_0x1208e0(0x1c4));}return _0x51696c['data'];}export async function listBffScripts(_0x52a7f0,_0xcf92b7,_0x3d13f0){const _0x594de6=a158_0x2fe6;let _0x1cce9a=_0x594de6(0x1f3)+_0x52a7f0;if(_0xcf92b7)_0x1cce9a+='&type='+_0xcf92b7;const _0x59198b=await apiRequest(_0x1cce9a);let _0x645d4d=extractList(_0x59198b[_0x594de6(0x1c2)]);if(_0x3d13f0?.[_0x594de6(0x1a8)]){const _0x516f03=_0x3d13f0['scriptName']['toLowerCase']();_0x645d4d=_0x645d4d[_0x594de6(0x188)](_0x3b0e92=>_0x3b0e92['functionName']?.['toLowerCase']()[_0x594de6(0x19c)](_0x516f03)||_0x3b0e92[_0x594de6(0x190)]?.['toLowerCase']()['includes'](_0x516f03));}return _0x645d4d;}export async function getBffScriptInfo(_0xe96742){const _0x374c12=a158_0x2fe6,_0x23dbbe=await apiRequest(_0x374c12(0x189)+_0xe96742);if(!_0x23dbbe[_0x374c12(0x1c2)])throw CliErrors[_0x374c12(0x201)](_0x374c12(0x1c9)+_0xe96742);return _0x23dbbe[_0x374c12(0x1c2)];}export async function saveBffScript(_0x545cec){const _0x96e178=a158_0x2fe6,_0x287af8=await apiRequest(_0x96e178(0x1e3),{'method':'POST','body':_0x545cec}),{id:_0x5eed57,entity:_0x53bedc}=normalizeEntityWithIdResponse(_0x287af8[_0x96e178(0x1c2)]);if(_0x5eed57!==undefined){const _0x3175b7=typeof _0x53bedc[_0x96e178(0x1b6)]===_0x96e178(0x1b7)||typeof _0x53bedc[_0x96e178(0x1b2)]===_0x96e178(0x1b7)?_0x53bedc:undefined;return{'id':_0x5eed57,'script':_0x3175b7};}throw CliErrors[_0x96e178(0x17d)](_0x96e178(0x212));}export async function deleteBffScript(_0x33e2d7){const _0x11634c=a158_0x2fe6;await apiRequest(_0x11634c(0x222),{'method':_0x11634c(0x1f1),'body':{'id':_0x33e2d7}});}export async function getBffScriptStatistics(_0x38535c){const _0x5382ba=a158_0x2fe6,_0x557e81=await apiRequest(_0x5382ba(0x1f4)+_0x38535c);return extractList(_0x557e81['data']);}export async function clearBffScriptCache(){const _0x2f3c98=a158_0x2fe6,_0x23fccd=await apiRequest(_0x2f3c98(0x1ee),{'method':_0x2f3c98(0x1f1),'useRuntime':!![]});return typeof _0x23fccd[_0x2f3c98(0x1c2)]==='string'?_0x23fccd[_0x2f3c98(0x1c2)]:'';}export async function listBffDatasetOperations(_0x10ff6d,_0x137987){const _0x2d8320=a158_0x2fe6,_0x191864=await apiRequest(_0x2d8320(0x1e8),{'method':_0x2d8320(0x1f1),'body':{'appCode':_0x10ff6d,'datasetId':_0x137987}});return _0x191864[_0x2d8320(0x1c2)];}export async function listSqlQueries(_0x5c0645,_0xe41f2d){const _0x38c747=a158_0x2fe6,_0xb0be94=await apiRequest(_0x38c747(0x1bc),{'method':_0x38c747(0x1f1),'body':{'appCode':_0x5c0645,'currentPage':_0xe41f2d?.['currentPage']??0x1,'pageSize':_0xe41f2d?.[_0x38c747(0x213)]??0x32,'sqlCode':_0xe41f2d?.['sqlCode'],'sqlName':_0xe41f2d?.[_0x38c747(0x1e5)]}});return _0xb0be94[_0x38c747(0x1c2)];}export async function getSqlQueryInfo(_0x389404,_0x2ccd18){const _0x19a448=a158_0x2fe6,_0x6a30c3=await listSqlQueries(_0x389404,{'sqlCode':_0x2ccd18}),_0x43d82c=_0x6a30c3['tableData']?.[0x0];if(!_0x43d82c)throw CliErrors[_0x19a448(0x201)](_0x19a448(0x1c1)+_0x2ccd18);return _0x43d82c;}export async function getSqlQueryDetail(_0x22df43){const _0xa7fa65=a158_0x2fe6,_0x3421e4=await apiRequest(_0xa7fa65(0x1fb)+('?sqlCode='+encodeURIComponent(_0x22df43)));if(!_0x3421e4['data'])throw CliErrors[_0xa7fa65(0x201)]('SQL\x20query\x20not\x20found:\x20'+_0x22df43);return _0x3421e4[_0xa7fa65(0x1c2)];}export async function getSqlQueryDetailById(_0x12f375){const _0x37cb98=a158_0x2fe6,_0x55c3f0=await apiRequest(_0x37cb98(0x1b1)+_0x12f375);if(!_0x55c3f0['data'])throw CliErrors[_0x37cb98(0x201)](_0x37cb98(0x1ac)+_0x12f375);return _0x55c3f0[_0x37cb98(0x1c2)];}export async function createSqlQuery(_0x22ed5b){const _0x46d143=a158_0x2fe6,_0x1d7b93=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x46d143(0x1f1),'body':_0x22ed5b}),{id:_0x22cdc9,entity:_0x2dcd63}=normalizeEntityWithIdResponse(_0x1d7b93[_0x46d143(0x1c2)]);if(!(_0x46d143(0x184)in _0x2dcd63)&&_0x22cdc9)return getSqlQueryDetailById(_0x22cdc9);return normalizeSqlQueryEntity(_0x2dcd63);}export async function updateSqlQuery(_0x3d4b2f){const _0x59accc=a158_0x2fe6,_0x216115=await apiRequest(_0x59accc(0x1f7),{'method':_0x59accc(0x1f1),'body':_0x3d4b2f}),{id:_0x14d347,entity:_0x562ea4}=normalizeEntityWithIdResponse(_0x216115[_0x59accc(0x1c2)]);if(!(_0x59accc(0x184)in _0x562ea4)){if(_0x3d4b2f[_0x59accc(0x184)])return getSqlQueryDetail(_0x3d4b2f[_0x59accc(0x184)]);if(_0x14d347)return getSqlQueryDetailById(_0x14d347);}return normalizeSqlQueryEntity(_0x562ea4);}export async function deleteSqlQuery(_0x595849){const _0x55d32a=a158_0x2fe6;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x55d32a(0x1f1),'body':_0x595849});}export async function saveSqlQuery(_0x500510){const _0x55bd74=a158_0x2fe6,_0x536e93=await apiRequest(_0x55bd74(0x1ad),{'method':_0x55bd74(0x1f1),'body':_0x500510});return _0x536e93[_0x55bd74(0x1c2)];}function normalizeSqlQueryEntity(_0xc97505){const _0x1a6831=a158_0x2fe6;return{..._0xc97505,'id':Number(_0xc97505['id']),'dbId':_0xc97505[_0x1a6831(0x1fd)]==null?undefined:Number(_0xc97505[_0x1a6831(0x1fd)]),'version':_0xc97505['version']==null?undefined:Number(_0xc97505['version'])};}export async function executeSql(_0x245b16,_0xe6404d,_0x3ddac2){const _0x574a76=a158_0x2fe6,_0x3bb6ee=await apiRequest(_0x574a76(0x20a),{'method':'POST','body':{'appCode':_0x245b16,'sqlCode':_0xe6404d,..._0x3ddac2&&{'params':_0x3ddac2}},'useRuntime':!![]});return _0x3bb6ee[_0x574a76(0x1c2)];}export async function executeDatasetDataOperation(_0xc38cf0,_0x2a695a,_0x521f1b,_0x4b3621={}){const _0x5add95=a158_0x2fe6;try{const _0x4960d8=await apiRequest(_0x5add95(0x209)+_0xc38cf0+'/'+_0x2a695a+'/'+_0x521f1b,{'method':'POST','body':_0x4b3621,'useRuntime':!![]});return _0x4960d8[_0x5add95(0x1c2)];}catch(_0x4f737b){if(_0x521f1b===_0x5add95(0x20c)&&_0x4f737b instanceof CliError&&_0x4f737b[_0x5add95(0x1cc)]==='api_error'&&_0x4b3621['id']!==undefined&&_0x4b3621['id']!==null&&_0x4b3621['id']!==''){const _0x508a08=await apiRequest(_0x5add95(0x209)+_0xc38cf0+'/'+_0x2a695a+_0x5add95(0x1a3),{'method':_0x5add95(0x1f1),'body':{'where':{'id':{'$eq':_0x4b3621['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2e8546=Array[_0x5add95(0x1cd)](_0x508a08[_0x5add95(0x1c2)]?.[_0x5add95(0x1f5)])?_0x508a08['data'][_0x5add95(0x1f5)]:[];return _0x2e8546[0x0]??null;}throw _0x4f737b;}}export async function listDatasets(_0x53fc52,_0x11c178){const _0x116683=a158_0x2fe6,_0x418f6e={'appCode':_0x53fc52,'deleted':_0x11c178?.[_0x116683(0x1d3)]??![]};if(_0x11c178?.['code'])_0x418f6e[_0x116683(0x1cc)]=_0x11c178[_0x116683(0x1cc)];if(_0x11c178?.[_0x116683(0x1c5)])_0x418f6e[_0x116683(0x1c5)]=_0x11c178[_0x116683(0x1c5)];const _0x5ebec1=await apiRequest(_0x116683(0x1c8),{'method':_0x116683(0x1f1),'body':_0x418f6e});return extractList(_0x5ebec1[_0x116683(0x1c2)]);}export async function deleteDataset(_0x247a40,_0x4d14a0){const _0x226520=a158_0x2fe6;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x226520(0x1f1),'body':{'appCode':_0x247a40,'datasetId':_0x4d14a0}});}export async function restoreDataset(_0x34c30d,_0x1e8234){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x34c30d,'datasetId':_0x1e8234}});}export async function searchDatasets(_0x1a1a72,_0x4412f8){const _0x468ff0=a158_0x2fe6,_0x24a2b6=await listDatasets(_0x1a1a72,{'name':_0x4412f8}),_0x1d4dfe=_0x4412f8[_0x468ff0(0x202)](),_0x230a26=new Set(_0x24a2b6[_0x468ff0(0x17e)](_0xc6dbc7=>_0xc6dbc7['id'])),_0x125efc=_0x24a2b6[_0x468ff0(0x188)](_0x2138dd=>_0x2138dd['dbtableConfig']?.[_0x468ff0(0x192)]?.['toLowerCase']()['includes'](_0x1d4dfe)||_0x2138dd[_0x468ff0(0x190)]?.[_0x468ff0(0x202)]()[_0x468ff0(0x19c)](_0x1d4dfe)),_0x27078f=await listDatasets(_0x1a1a72,{'code':_0x4412f8});for(const _0x55b065 of _0x27078f){!_0x230a26[_0x468ff0(0x1dc)](_0x55b065['id'])&&(_0x24a2b6[_0x468ff0(0x1e2)](_0x55b065),_0x230a26['add'](_0x55b065['id']));}return _0x24a2b6;}export function normalizeDatasetOperations(_0x5af014){const _0x4603c4=a158_0x2fe6;if(Array[_0x4603c4(0x1cd)](_0x5af014))return _0x5af014[_0x4603c4(0x188)](_0x10e56e=>_0x10e56e!=null&&typeof _0x10e56e===_0x4603c4(0x1d8));if(_0x5af014&&typeof _0x5af014===_0x4603c4(0x1d8))return Object[_0x4603c4(0x1f2)](_0x5af014)[_0x4603c4(0x188)](([,_0x312425])=>_0x312425!=null&&typeof _0x312425==='object')[_0x4603c4(0x17e)](([_0x1bfa30,_0x128d4a])=>({..._0x128d4a,'name':_0x128d4a[_0x4603c4(0x1c5)]??_0x128d4a[_0x4603c4(0x181)]??_0x1bfa30}));return[];}export async function getDatasetDetail(_0x1272ab){const _0x1a9f42=a158_0x2fe6,_0x2a7583=/^\d+$/[_0x1a9f42(0x21e)](_0x1272ab)?'id':_0x1a9f42(0x1cc),_0x1ed041=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x2a7583+'='+_0x1272ab);return _0x1ed041[_0x1a9f42(0x1c2)];}export async function updateDrivenData(_0x892c54){const _0x118260=a158_0x2fe6,_0x356f50=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x892c54});return _0x356f50[_0x118260(0x1c2)];}export async function getDatasetOperations(_0x448bda){const _0xba94d1=a158_0x2fe6,_0x7286ad=await getDatasetDetail(_0x448bda),_0x2528cc=normalizeDatasetOperations(_0x7286ad[_0xba94d1(0x21a)])[_0xba94d1(0x17e)](_0x5e895c=>({'name':_0x5e895c[_0xba94d1(0x1c5)]||_0x5e895c['operationName'],'displayName':_0x5e895c[_0xba94d1(0x203)]||_0x5e895c[_0xba94d1(0x1c5)],'type':_0x5e895c['type'],'method':_0x5e895c[_0xba94d1(0x19b)],'path':_0x5e895c['path'],'enabled':_0x5e895c[_0xba94d1(0x1b4)]??!![],'requestFields':_0x5e895c[_0xba94d1(0x1d6)],'responseFields':_0x5e895c[_0xba94d1(0x1b9)]}));return{'dataset':{'id':_0x7286ad['id']??_0x7286ad[_0xba94d1(0x186)],'name':_0x7286ad[_0xba94d1(0x1c5)],'code':_0x7286ad[_0xba94d1(0x1cc)]||_0x7286ad['modelCode'],'tableName':_0x7286ad[_0xba94d1(0x192)]||_0x7286ad[_0xba94d1(0x1e4)]?.[_0xba94d1(0x192)]},'operations':_0x2528cc};}export async function getOperationDetail(_0x3c2743,_0x23b8c4,_0x5b12c7){const _0x2a738f=a158_0x2fe6;let _0x366c7e=_0x23b8c4;if(!/^\d+$/[_0x2a738f(0x21e)](_0x23b8c4)){const _0x28cb26=await listDatasets(_0x3c2743,{'code':_0x23b8c4}),_0x23bc53=_0x28cb26[_0x2a738f(0x187)](_0x41bd8e=>_0x41bd8e[_0x2a738f(0x1cc)]===_0x23b8c4||String(_0x41bd8e['id'])===_0x23b8c4);if(!_0x23bc53)throw CliErrors[_0x2a738f(0x201)]('Dataset\x20not\x20found:\x20'+_0x23b8c4);_0x366c7e=String(_0x23bc53['id']);}const _0x54d51f=await getDatasetDetail(_0x366c7e),_0x44c12a=normalizeDatasetOperations(_0x54d51f[_0x2a738f(0x21a)])[_0x2a738f(0x187)](_0x3ae1c6=>(_0x3ae1c6[_0x2a738f(0x1c5)]||_0x3ae1c6[_0x2a738f(0x181)])===_0x5b12c7);if(!_0x44c12a)throw CliErrors[_0x2a738f(0x201)](_0x2a738f(0x204)+_0x5b12c7+_0x2a738f(0x21d)+_0x23b8c4);return{'dataset':{'id':_0x54d51f['id']??_0x54d51f[_0x2a738f(0x186)],'name':_0x54d51f['name'],'code':_0x54d51f[_0x2a738f(0x1cc)]||_0x54d51f[_0x2a738f(0x1f6)],'tableName':_0x54d51f[_0x2a738f(0x192)]||_0x54d51f[_0x2a738f(0x1e4)]?.['tableName']},'operation':_0x44c12a};}export async function startGenerateStandardPages(_0x990d85,_0x102060,_0x112a1c){const _0x2f0fe7=a158_0x2fe6,_0x20f063=await apiRequest(_0x2f0fe7(0x220)+_0x102060+_0x2f0fe7(0x197),{'method':_0x2f0fe7(0x1f1),'body':{'appCode':_0x990d85,..._0x112a1c?.[_0x2f0fe7(0x18b)]?{'clientOperationId':_0x112a1c[_0x2f0fe7(0x18b)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x20f063[_0x2f0fe7(0x1c2)];}export async function getGenerateStandardPagesStatus(_0x3814d5,_0x3d0de8,_0x5db3b9){const _0x26c001=a158_0x2fe6,_0x4d46ae=new URLSearchParams({'appCode':_0x3814d5});_0x5db3b9[_0x26c001(0x18d)]&&_0x4d46ae[_0x26c001(0x1d0)](_0x26c001(0x18d),_0x5db3b9[_0x26c001(0x18d)]);_0x5db3b9['clientOperationId']&&_0x4d46ae[_0x26c001(0x1d0)](_0x26c001(0x18b),_0x5db3b9[_0x26c001(0x18b)]);const _0x5c7118=await apiRequest(_0x26c001(0x220)+_0x3d0de8+_0x26c001(0x1d4)+_0x4d46ae['toString']());return _0x5c7118['data'];}export async function getStandardPageStatus(_0x4a27f7,_0x3e9b35){const _0x280cae=a158_0x2fe6,_0x5dee40=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3e9b35+_0x280cae(0x1af)+encodeURIComponent(_0x4a27f7));return _0x5dee40[_0x280cae(0x1c2)];}export async function tryGetStandardPageStatus(_0x30f490,_0x148be8){const _0x6fc9b2=a158_0x2fe6;try{return await getStandardPageStatus(_0x30f490,_0x148be8);}catch(_0x3247fd){if(_0x3247fd instanceof CliError&&_0x3247fd[_0x6fc9b2(0x1cc)]===_0x6fc9b2(0x1eb)&&/404|not found|non-json response/i[_0x6fc9b2(0x21e)](_0x3247fd[_0x6fc9b2(0x19d)]))return null;throw _0x3247fd;}}export async function syncStandardPages(_0x5230ee,_0x19804b){const _0x20372a=a158_0x2fe6,_0x2c2a9e=await apiRequest(_0x20372a(0x220)+_0x19804b+_0x20372a(0x1ff),{'method':_0x20372a(0x1f1),'body':{'appCode':_0x5230ee}});return _0x2c2a9e[_0x20372a(0x1c2)];}export async function getPageDetail(_0xeb2a8a){const _0x517ca6=a158_0x2fe6,_0x5d5b25=await apiRequest(_0x517ca6(0x1ec)+_0xeb2a8a);if(!_0x5d5b25['data'])throw CliErrors[_0x517ca6(0x201)](_0x517ca6(0x208)+_0xeb2a8a);return _0x5d5b25['data'];}export async function updatePage(_0x2057ae,_0x5f3fe6,_0x8cab67,_0x1e4d45){const _0x5aabe9=a158_0x2fe6,_0x495dc7=await apiRequest(_0x5aabe9(0x1b0),{'method':_0x5aabe9(0x1f1),'body':{'appCode':_0x2057ae,'pageId':_0x5f3fe6,'code':_0x8cab67,'datasetIds':_0x1e4d45}});return _0x495dc7[_0x5aabe9(0x1c2)];}export function generateSdkCode(_0x10ab95,_0x5af37c,_0x5359b4){const _0x3f89cd=a158_0x2fe6,_0x510d62=_0x5359b4?.[_0x3f89cd(0x1e9)]??!![],_0x136979=_0x3f89cd(0x195)+_0x10ab95[_0x3f89cd(0x1cc)]?.[_0x3f89cd(0x1fc)](/-/g,'_'),_0x2271db=_0x5af37c[_0x3f89cd(0x1c5)]||_0x5af37c[_0x3f89cd(0x181)]||_0x3f89cd(0x188),_0x42be29=[];_0x510d62&&_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x17f),'',_0x3f89cd(0x21c),'');_0x42be29['push'](_0x3f89cd(0x211)+_0x10ab95[_0x3f89cd(0x1c5)]+'\x20('+(_0x10ab95[_0x3f89cd(0x192)]||'table')+')');if(_0x2271db===_0x3f89cd(0x188))_0x42be29[_0x3f89cd(0x1e2)]('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.filter({',_0x3f89cd(0x185),_0x3f89cd(0x200),_0x3f89cd(0x20e),_0x3f89cd(0x1a4));else{if(_0x2271db==='getOne')_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+_0x3f89cd(0x1bf));else{if(_0x2271db===_0x3f89cd(0x207))_0x42be29['push']('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x2271db==='update')_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+_0x3f89cd(0x1e7));else _0x2271db==='delete'||_0x2271db==='remove'?_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+'.remove(id);'):_0x42be29[_0x3f89cd(0x1e2)]('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.'+_0x2271db+_0x3f89cd(0x1bd));}}}return _0x42be29[_0x3f89cd(0x183)]('\x0a');}export function generateSqlCodeTemplate(_0x225a95,_0x5416c0){const _0x1ba8b0=a158_0x2fe6,_0x5a5867=_0x5416c0?.['target']??_0x1ba8b0(0x17c),_0x506bda=_0x5416c0?.[_0x1ba8b0(0x1e9)]??!![],_0x53cfbe=[];return _0x53cfbe[_0x1ba8b0(0x1e2)](_0x1ba8b0(0x1a0)+_0x225a95[_0x1ba8b0(0x1e5)]+'\x20('+_0x225a95[_0x1ba8b0(0x184)]+')'),_0x5a5867===_0x1ba8b0(0x17c)?(_0x506bda&&_0x53cfbe[_0x1ba8b0(0x1e2)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1ba8b0(0x21c),''),_0x53cfbe[_0x1ba8b0(0x1e2)](_0x1ba8b0(0x20b),'\x20\x20sqlCode:\x20\x27'+_0x225a95['sqlCode']+'\x27,',_0x1ba8b0(0x224),'});',_0x1ba8b0(0x198),_0x1ba8b0(0x1db))):_0x53cfbe['push']('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x1ba8b0(0x1b5),_0x1ba8b0(0x1d2)+_0x225a95[_0x1ba8b0(0x184)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x1ba8b0(0x18e),_0x1ba8b0(0x182),'}'),_0x53cfbe[_0x1ba8b0(0x183)]('\x0a');}export async function getErConfig(_0x3f39dd,_0x244c0b){const _0x420995=a158_0x2fe6,_0x2b5a49=await apiRequest(_0x420995(0x1ea),{'method':_0x420995(0x1f1),'body':{'appCode':_0x3f39dd,'dblinkId':_0x244c0b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x2b5a49[_0x420995(0x1c2)];}export async function createErRelation(_0x3a669c){const _0x5586c4=a158_0x2fe6,_0x52ab9d=await apiRequest(_0x5586c4(0x1be),{'method':'POST','body':_0x3a669c,'allowNonJsonSuccess':!![]});return _0x52ab9d[_0x5586c4(0x1c2)];}export async function updateErRelation(_0x10a067){const _0x30945c=a158_0x2fe6,_0x3200e5=await apiRequest(_0x30945c(0x1f8),{'method':_0x30945c(0x1f1),'body':_0x10a067,'allowNonJsonSuccess':!![]});return _0x3200e5[_0x30945c(0x1c2)];}export async function deleteErRelation(_0x2b70f6){const _0x537fd9=a158_0x2fe6,_0x557938=await apiRequest(_0x537fd9(0x1c0),{'method':'POST','body':_0x2b70f6,'allowNonJsonSuccess':!![]});return _0x557938[_0x537fd9(0x1c2)];}function a158_0x2fe6(_0x352854,_0x5b188f){_0x352854=_0x352854-0x17a;const _0x4b14be=a158_0x4b14();let _0x2fe64f=_0x4b14be[_0x352854];return _0x2fe64f;}export async function updateErBusinessGroup(_0x4110df){const _0x3ea41b=a158_0x2fe6,_0x3bcfc1=await apiRequest(_0x3ea41b(0x180),{'method':_0x3ea41b(0x1f1),'body':_0x4110df,'allowNonJsonSuccess':!![]});return _0x3bcfc1[_0x3ea41b(0x1c2)];}function buildQuery(_0x9d800b){const _0x584234=a158_0x2fe6,_0x2dfa9e=new URLSearchParams();for(const [_0x1e0f0e,_0x4421d8]of Object['entries'](_0x9d800b)){if(_0x4421d8===undefined||_0x4421d8==='')continue;_0x2dfa9e[_0x584234(0x1d0)](_0x1e0f0e,String(_0x4421d8));}const _0x39ee95=_0x2dfa9e[_0x584234(0x1d5)]();return _0x39ee95?'?'+_0x39ee95:'';}export async function listAppConfigs(_0x5d5542,_0x30ab7d){const _0x468dc0=a158_0x2fe6,_0x3c3ebe=await apiRequest(_0x468dc0(0x20f),{'method':_0x468dc0(0x1f1),'body':{'appCode':_0x5d5542,..._0x30ab7d?.[_0x468dc0(0x1c7)]?{'key':_0x30ab7d[_0x468dc0(0x1c7)]}:{},..._0x30ab7d?.['tags']?{'tags':_0x30ab7d[_0x468dc0(0x1a6)]}:{}}});return extractAppConfigList(_0x3c3ebe[_0x468dc0(0x1c2)]);}export async function getAppConfigByKey(_0x68902b,_0x117f03){const _0x2ce98e=a158_0x2fe6,_0x5a6f10=await apiRequest(_0x2ce98e(0x18c)+buildQuery({'appCode':_0x68902b,'key':_0x117f03}));return _0x5a6f10[_0x2ce98e(0x1c2)]??null;}export async function createAppConfig(_0x21af6a){const _0x24d255=a158_0x2fe6,_0x2ed9e3=await apiRequest(_0x24d255(0x215),{'method':_0x24d255(0x1f1),'body':{'appCode':_0x21af6a['appCode'],'key':_0x21af6a[_0x24d255(0x1c7)],'value':_0x21af6a[_0x24d255(0x17b)],..._0x21af6a[_0x24d255(0x1a6)]?{'tags':_0x21af6a['tags']}:{}}});return _0x2ed9e3[_0x24d255(0x1c2)];}export async function updateAppConfig(_0x2c29c8){const _0x48eb91=a158_0x2fe6;await apiRequest(_0x48eb91(0x18a),{'method':_0x48eb91(0x1f1),'body':{'id':_0x2c29c8['id'],'appCode':_0x2c29c8['appCode'],'key':_0x2c29c8[_0x48eb91(0x1c7)],'value':_0x2c29c8[_0x48eb91(0x17b)],..._0x2c29c8[_0x48eb91(0x1a6)]?{'tags':_0x2c29c8[_0x48eb91(0x1a6)]}:{}}});}export async function deleteAppConfig(_0x592138){const _0x3028bd=a158_0x2fe6;await apiRequest(_0x3028bd(0x1d7),{'method':_0x3028bd(0x1f1),'body':_0x592138});}function extractAppConfigList(_0x538203){const _0x935018=a158_0x2fe6;if(Array[_0x935018(0x1cd)](_0x538203))return _0x538203;if(_0x538203&&typeof _0x538203===_0x935018(0x1d8)&&Array['isArray'](_0x538203[_0x935018(0x1a1)]))return _0x538203[_0x935018(0x1a1)];return extractList(_0x538203);}export async function listDbLinks(_0x220680,_0x368f32){const _0x592b21=a158_0x2fe6,_0x40d72c=await apiRequest(_0x592b21(0x1e0),{'method':'POST','body':{'appCode':_0x220680,'currentPage':_0x368f32?.[_0x592b21(0x193)]??0x1,'pageSize':_0x368f32?.['pageSize']??0x64}});return{'items':extractList(_0x40d72c['data']),'paging':extractPaging(_0x40d72c[_0x592b21(0x1c2)])};}export async function getDbLinkInfo(_0x1d1091){const _0x570e2f=a158_0x2fe6,_0x5b5b23=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x1d1091}));return _0x5b5b23[_0x570e2f(0x1c2)];}export async function createDbLink(_0xc3a789){const _0x416949=a158_0x2fe6,_0xcbd7f9=await apiRequest(_0x416949(0x194),{'method':_0x416949(0x1f1),'body':_0xc3a789});return _0xcbd7f9[_0x416949(0x1c2)];}export async function updateDbLink(_0x4f66b6){const _0x2f1814=a158_0x2fe6,_0x230c36=await apiRequest('/smartapi/dblink/update',{'method':_0x2f1814(0x1f1),'body':_0x4f66b6});return _0x230c36[_0x2f1814(0x1c2)];}export async function deleteDbLink(_0x911511){await apiRequest('/smartapi/dblink/delete',{'method':'POST','body':{'id':_0x911511}});}export async function testDbLinkConnect(_0x18d810){const _0x2c14c1=a158_0x2fe6,_0x4f7faa=await apiRequest(_0x2c14c1(0x1a9)+buildQuery({'id':_0x18d810}));return _0x4f7faa[_0x2c14c1(0x1c2)];}export async function startDbAnalysis(_0x42e178,_0x1fdded){const _0x4151c8=a158_0x2fe6,_0x2c097f=await apiRequest(_0x4151c8(0x1fe),{'method':_0x4151c8(0x1f1),'body':{'dbLinkId':_0x42e178,..._0x1fdded&&_0x1fdded[_0x4151c8(0x1c3)]>0x0?{'tableNames':_0x1fdded}:{}}}),_0x5081ac=_0x2c097f[_0x4151c8(0x1c2)];if(typeof _0x5081ac===_0x4151c8(0x1b7))return _0x5081ac;if(_0x5081ac&&typeof _0x5081ac===_0x4151c8(0x1d8)&&typeof _0x5081ac['planId']===_0x4151c8(0x1b7))return _0x5081ac[_0x4151c8(0x1a5)];return _0x5081ac!=null?String(_0x5081ac):'';}export async function cancelDbAnalysis(_0x543138){const _0xbcf786=a158_0x2fe6;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x543138}),{'method':_0xbcf786(0x1f1)});}export async function getDbAnalysisStatus(_0x5650a9){const _0x381431=a158_0x2fe6,_0x4197be=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x5650a9));return _0x4197be[_0x381431(0x1c2)];}export async function getDbAllTableList(_0x32b4ca,_0xfc1977){const _0x4d5a8b=a158_0x2fe6,_0x4db156=await apiRequest(_0x4d5a8b(0x1ba)+buildQuery({'appCode':_0x32b4ca,'dbLinkId':_0xfc1977})),_0x320cb6=_0x4db156['data'];if(Array[_0x4d5a8b(0x1cd)](_0x320cb6))return _0x320cb6;return extractList(_0x320cb6);}export async function getDbTableDiff(_0x640769,_0xbfdc57,_0x45ef5d){const _0x3d1b69=a158_0x2fe6,_0x4b4e34=await apiRequest(_0x3d1b69(0x210)+buildQuery({'appCode':_0x640769,'dbLinkId':_0xbfdc57,'pageIndex':_0x45ef5d?.[_0x3d1b69(0x19f)]??0x1,'pageSize':_0x45ef5d?.[_0x3d1b69(0x213)]??0x14,'tableName':_0x45ef5d?.[_0x3d1b69(0x192)]})),_0x742d3c=_0x4b4e34['data'];return{'totalCount':_0x742d3c?.[_0x3d1b69(0x206)]??0x0,'physicalTableCount':_0x742d3c?.[_0x3d1b69(0x1bb)]??0x0,'datasetTableCount':_0x742d3c?.[_0x3d1b69(0x223)]??0x0,..._0x742d3c?.['summary']?{'summary':_0x742d3c['summary']}:{},'tableList':Array[_0x3d1b69(0x1cd)](_0x742d3c?.[_0x3d1b69(0x1f9)])?_0x742d3c['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1e38d8=a158_0x2fe6,_0x47e156=await apiRequest('/smartapi/app/getList',{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x26e93d=extractList(_0x47e156['data']),_0x415ca0=extractPaging(_0x47e156[_0x1e38d8(0x1c2)]);return _0x415ca0&&_0x415ca0[_0x1e38d8(0x206)]>REMOTE_APP_PAGE_SIZE&&console[_0x1e38d8(0x1dd)](_0x1e38d8(0x19a)+REMOTE_APP_PAGE_SIZE+_0x1e38d8(0x1ae)+_0x415ca0[_0x1e38d8(0x206)]+_0x1e38d8(0x1de)+_0x1e38d8(0x1da)),_0x26e93d;}
1
+ (function(_0x3070bd,_0x4d8e60){const _0x8bbad0=a159_0x4a24,_0x9d3fc6=_0x3070bd();while(!![]){try{const _0x1eeeb3=-parseInt(_0x8bbad0(0x1ab))/0x1*(-parseInt(_0x8bbad0(0x15d))/0x2)+-parseInt(_0x8bbad0(0x162))/0x3+-parseInt(_0x8bbad0(0x180))/0x4*(parseInt(_0x8bbad0(0x117))/0x5)+-parseInt(_0x8bbad0(0x1a3))/0x6*(-parseInt(_0x8bbad0(0x169))/0x7)+parseInt(_0x8bbad0(0x159))/0x8*(-parseInt(_0x8bbad0(0x19b))/0x9)+-parseInt(_0x8bbad0(0x150))/0xa*(parseInt(_0x8bbad0(0x125))/0xb)+parseInt(_0x8bbad0(0x175))/0xc*(parseInt(_0x8bbad0(0x15c))/0xd);if(_0x1eeeb3===_0x4d8e60)break;else _0x9d3fc6['push'](_0x9d3fc6['shift']());}catch(_0x4164ed){_0x9d3fc6['push'](_0x9d3fc6['shift']());}}}(a159_0x1315,0xa9038));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x154ddd){_activeCookie=_0x154ddd||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}function a159_0x1315(){const _0x7a5ba1=['sqlName','appCode','/smartapi/dataset/restore-dataset','/smartapi/app-config/list','includes','\x20\x20currentPage:\x201,','responseFields','.getOne(id);','/smartapi/question/er-config/erCreate','json','/smartapi/db-analysis/jobs/cancel','datasetName','/smartapi/lovrabet/update-page','summary','Unauthorized','errorCode','/api/management/script/cache/clear','status','/smartapi/custom/getUserCustomSql','\x20\x20sqlCode:\x20\x27','/smartapi/dataset/text-generate/start','authRequired','API\x20error:\x20','/smartapi/lovrabet/dataset/','/smartapi/app-config/update','object','AbortError','filter','/smartapi/dblink/getAllTableList','physicalTableCount','/smartapi/dblink/testConnect','/api/node-toolbox/sql/save','8255770pwuMwv','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','operationId','table','GET','currentPage','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','errorMsg','/smartapi/dblink/getList','8pGSUQw','/smartapi/app/getList','name','871cLcZEs','28TpaLZm','dbId','/smartapi/app-config/create','/smartapi/custom/queryUserCustomSqlList','operations','174369IoACvV','/smartapi/lovrabet/detail?pageId=','sdk','push','displayName','.filter({','signal','154ZQohLI','\x20failed','});','test','isArray','tags','/smartapi/dataset/update-driven-data','sqlCode','toString','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/deleteUserCustomSql','/api/management/library/scripts/list?appCode=','230712yJQQZj','map','401','value','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','set','api_error','method','pageSize','join','planId','862644ALdogI','/smartapi/dblink/getOne','delete','/smartapi/dataset/get-dataset-operation','message','/api/','\x20\x20});','getOne','/api/management/library/scripts/statistics?appCode=','dbtableConfig','tableList','type','/api/management/library/scripts/info?id=','modelId','/smartapi/custom/updateUserCustomSql','BFF\x20script\x20not\x20found:\x20id=','functionName','const\x20result\x20=\x20await\x20client.models.','requirementDescription','list','\x22\x20not\x20found\x20in\x20dataset\x20','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','body','POST','validation','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','UNAUTHORIZED','5560281azevMQ','length','label','code','success','/smartapi/dblink/delete','/smartapi/custom/getUserCustomSql?id=','error','308922AlVNDX','update','version','key','modelCode','data','find','/smartapi/custom/saveUserCustomSql','29994wgsmIB','cookie','const\x20data\x20=\x20await\x20client.sql.execute({','/api/custom/executeSql','/smartapi/app-config/getByKey','/smartapi/app-config/delete','cli:rabetbase','operationName','toLowerCase','includeImports','/smartapi/dataset/delete-dataset','tableName','&type=','/smartapi/dataset/get-driven-data?','apiError','enabled','/smartapi/dataset/text-generate/status?','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dataset/text-generate/preview','/smartapi/dblink/getTableDiffV2ByPage','clientOperationId','Request\x20timeout:\x20','application/json','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20apps.\x20','string','totalCount','\x20\x20return\x20rows;','/smartapi/dataset/get-dataset-list','15gUagLc','.remove(id);','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','Request\x20failed:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','has','deleted','/sync-to-pages','Warning:\x20showing\x20first\x20','requestFields','Dataset\x20not\x20found:\x20','stringify','entries','?sqlCode=','11yuUpRQ','/smartapi/dblink/update','/filter','tableData','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','description','//\x20SQL:\x20','/standard-page-status?appCode=','target','\x20of\x20','(/*\x20params\x20*/);'];a159_0x1315=function(){return _0x7a5ba1;};return a159_0x1315();}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0xcf5b1,_0x52a70a){const _0x54bf8f=a159_0x4a24,_0x34418e=_0x52a70a instanceof Error?_0x52a70a[_0x54bf8f(0x184)]:String(_0x52a70a);return CliErrors[_0x54bf8f(0x108)](_0x54bf8f(0x11a)+_0xcf5b1+(_0x34418e?'\x20('+_0x34418e+')':''),_0x54bf8f(0x111));}async function apiRequest(_0x596c17,_0x2e6641={}){const _0x921d10=a159_0x4a24,{method:method=_0x921d10(0x154),body:_0x550858,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x2e6641,_0x668821=useRuntime?getRuntimeDomain():getApiDomain(),_0x1b61dc=_activeCookie||getCookie(),_0xab2df5=''+_0x668821+_0x596c17,_0x4891c8=new AbortController(),_0x56f898=setTimeout(()=>_0x4891c8['abort'](),timeout);try{const _0x1da35d=await fetch(_0xab2df5,{'method':method,'headers':{'Content-Type':_0x921d10(0x110),'Cookie':_0x1b61dc,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x550858?JSON['stringify'](_0x550858):undefined,'signal':_0x4891c8[_0x921d10(0x168)]});let _0x1ebfb9;try{_0x1ebfb9=await _0x1da35d[_0x921d10(0x139)]();}catch(_0x55d155){if(_0x55d155 instanceof Error&&_0x55d155[_0x921d10(0x15b)]===_0x921d10(0x14a))throw CliErrors[_0x921d10(0x108)](_0x921d10(0x10f)+_0xab2df5);if(_0x1da35d['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x921d10(0x108)](_0x921d10(0x11b)+_0x1da35d[_0x921d10(0x141)]+')',_0x1da35d['status']>=0x190?_0x921d10(0x179):undefined);}if(!_0x1da35d['ok']||_0x1ebfb9[_0x921d10(0x19f)]===![])throw CliErrors[_0x921d10(0x108)](_0x1ebfb9[_0x921d10(0x157)]||_0x1ebfb9[_0x921d10(0x184)]||_0x921d10(0x146)+_0x1da35d[_0x921d10(0x141)],_0x1ebfb9[_0x921d10(0x13f)]?'API\x20error\x20code:\x20'+_0x1ebfb9[_0x921d10(0x13f)]:undefined);return _0x1ebfb9;}catch(_0xc1ad2f){if(_0xc1ad2f instanceof CliError)throw _0xc1ad2f;if(_0xc1ad2f instanceof Error&&_0xc1ad2f[_0x921d10(0x15b)]===_0x921d10(0x14a))throw CliErrors[_0x921d10(0x108)](_0x921d10(0x10f)+_0xab2df5);throw createFetchFailureError(_0xab2df5,_0xc1ad2f);}finally{clearTimeout(_0x56f898);}}function isAuthFailure(_0x1dcaad){const _0x620044=a159_0x4a24,_0x1294e4=_0x1dcaad['errorMsg']||_0x1dcaad[_0x620044(0x184)]||_0x1dcaad['data']?.[_0x620044(0x184)]||_0x1dcaad['errorMessage']||_0x1dcaad[_0x620044(0x1a2)]||'';return _0x1dcaad[_0x620044(0x13f)]===_0x620044(0x19a)||_0x1dcaad[_0x620044(0x19e)]===0x191||_0x1dcaad[_0x620044(0x19e)]==='401'||_0x1294e4[_0x620044(0x134)](_0x620044(0x177))||_0x1294e4[_0x620044(0x134)](_0x620044(0x13e))||_0x1294e4['includes']('登录')||_0x1294e4[_0x620044(0x134)]('认证');}export async function platformFetch(_0x1e790b,_0x255f05){const _0x5793fd=a159_0x4a24;let _0x6b3ec7;try{_0x6b3ec7=await fetch(_0x1e790b,{'method':_0x255f05[_0x5793fd(0x17c)]??_0x5793fd(0x154),'headers':{'Content-Type':_0x5793fd(0x110),'Cookie':_0x255f05[_0x5793fd(0x1ac)],'X-Invoke-Source':_0x5793fd(0x100)},..._0x255f05[_0x5793fd(0x196)]&&{'body':JSON[_0x5793fd(0x122)](_0x255f05['body'])}});}catch(_0x151e20){throw createFetchFailureError(_0x1e790b,_0x151e20);}if(!_0x6b3ec7['ok']){if(_0x6b3ec7['status']===0x191)throw CliErrors[_0x5793fd(0x145)]();throw CliErrors[_0x5793fd(0x108)](_0x255f05[_0x5793fd(0x19d)]+'\x20failed,\x20HTTP\x20'+_0x6b3ec7[_0x5793fd(0x141)]);}const _0x279d22=await _0x6b3ec7[_0x5793fd(0x139)]();if(_0x279d22[_0x5793fd(0x19f)]===![]){if(isAuthFailure(_0x279d22))throw CliErrors[_0x5793fd(0x145)]();throw CliErrors[_0x5793fd(0x108)](_0x279d22['errorMsg']||_0x279d22['message']||_0x255f05[_0x5793fd(0x19d)]+_0x5793fd(0x16a));}return _0x279d22[_0x5793fd(0x1a8)];}export async function listBffScripts(_0x3cfd0a,_0x29105d,_0x5eccdc){const _0x1b835a=a159_0x4a24;let _0x2485fc=_0x1b835a(0x174)+_0x3cfd0a;if(_0x29105d)_0x2485fc+=_0x1b835a(0x106)+_0x29105d;const _0x568000=await apiRequest(_0x2485fc);let _0x42b911=extractList(_0x568000[_0x1b835a(0x1a8)]);if(_0x5eccdc?.['scriptName']){const _0x328641=_0x5eccdc['scriptName']['toLowerCase']();_0x42b911=_0x42b911['filter'](_0x449956=>_0x449956[_0x1b835a(0x190)]?.[_0x1b835a(0x102)]()['includes'](_0x328641)||_0x449956[_0x1b835a(0x12a)]?.[_0x1b835a(0x102)]()[_0x1b835a(0x134)](_0x328641));}return _0x42b911;}export async function getBffScriptInfo(_0x1c78d4){const _0xbbb52=a159_0x4a24,_0x5415a9=await apiRequest(_0xbbb52(0x18c)+_0x1c78d4);if(!_0x5415a9['data'])throw CliErrors['validation'](_0xbbb52(0x18f)+_0x1c78d4);return _0x5415a9[_0xbbb52(0x1a8)];}export async function saveBffScript(_0x101902){const _0x1c9aa1=a159_0x4a24,_0x42864c=await apiRequest('/api/management/library/scripts/save',{'method':_0x1c9aa1(0x197),'body':_0x101902}),{id:_0x4ee0d3,entity:_0x494ef1}=normalizeEntityWithIdResponse(_0x42864c[_0x1c9aa1(0x1a8)]);if(_0x4ee0d3!==undefined){const _0x1d6383=typeof _0x494ef1['functionName']==='string'||typeof _0x494ef1['scriptType']===_0x1c9aa1(0x113)?_0x494ef1:undefined;return{'id':_0x4ee0d3,'script':_0x1d6383};}throw CliErrors[_0x1c9aa1(0x108)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x351457){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x351457}});}export async function getBffScriptStatistics(_0x11c02c){const _0x301748=a159_0x4a24,_0x5c2ff9=await apiRequest(_0x301748(0x188)+_0x11c02c);return extractList(_0x5c2ff9['data']);}export async function clearBffScriptCache(){const _0x50b549=a159_0x4a24,_0x2d6390=await apiRequest(_0x50b549(0x140),{'method':'POST','useRuntime':!![]});return typeof _0x2d6390[_0x50b549(0x1a8)]===_0x50b549(0x113)?_0x2d6390['data']:'';}export async function listBffDatasetOperations(_0x3e46da,_0x4353bc){const _0x512cb0=a159_0x4a24,_0x26fba9=await apiRequest(_0x512cb0(0x183),{'method':_0x512cb0(0x197),'body':{'appCode':_0x3e46da,'datasetId':_0x4353bc}});return _0x26fba9[_0x512cb0(0x1a8)];}export async function listSqlQueries(_0xb07572,_0x11578e){const _0x5ce35e=a159_0x4a24,_0x169dcb=await apiRequest(_0x5ce35e(0x160),{'method':'POST','body':{'appCode':_0xb07572,'currentPage':_0x11578e?.[_0x5ce35e(0x155)]??0x1,'pageSize':_0x11578e?.['pageSize']??0x32,'sqlCode':_0x11578e?.[_0x5ce35e(0x170)],'sqlName':_0x11578e?.['sqlName']}});return _0x169dcb[_0x5ce35e(0x1a8)];}export async function getSqlQueryInfo(_0x444e70,_0x2f14cf){const _0x4bf48a=a159_0x4a24,_0x13b45f=await listSqlQueries(_0x444e70,{'sqlCode':_0x2f14cf}),_0x25e718=_0x13b45f[_0x4bf48a(0x128)]?.[0x0];if(!_0x25e718)throw CliErrors[_0x4bf48a(0x198)](_0x4bf48a(0x172)+_0x2f14cf);return _0x25e718;}export async function getSqlQueryDetail(_0x202661){const _0x1944a5=a159_0x4a24,_0x5db148=await apiRequest(_0x1944a5(0x142)+(_0x1944a5(0x124)+encodeURIComponent(_0x202661)));if(!_0x5db148[_0x1944a5(0x1a8)])throw CliErrors[_0x1944a5(0x198)](_0x1944a5(0x172)+_0x202661);return _0x5db148[_0x1944a5(0x1a8)];}export async function getSqlQueryDetailById(_0x149414){const _0xde075=a159_0x4a24,_0x1572b2=await apiRequest(_0xde075(0x1a1)+_0x149414);if(!_0x1572b2[_0xde075(0x1a8)])throw CliErrors[_0xde075(0x198)]('SQL\x20query\x20not\x20found:\x20id='+_0x149414);return _0x1572b2['data'];}export async function createSqlQuery(_0x2b379e){const _0x358613=a159_0x4a24,_0x558364=await apiRequest(_0x358613(0x1aa),{'method':_0x358613(0x197),'body':_0x2b379e}),{id:_0x5e0975,entity:_0x71e430}=normalizeEntityWithIdResponse(_0x558364[_0x358613(0x1a8)]);if(!(_0x358613(0x170)in _0x71e430)&&_0x5e0975)return getSqlQueryDetailById(_0x5e0975);return normalizeSqlQueryEntity(_0x71e430);}export async function updateSqlQuery(_0x8854f2){const _0x104925=a159_0x4a24,_0x2d4eea=await apiRequest(_0x104925(0x18e),{'method':_0x104925(0x197),'body':_0x8854f2}),{id:_0x286286,entity:_0x269f23}=normalizeEntityWithIdResponse(_0x2d4eea['data']);if(!('sqlCode'in _0x269f23)){if(_0x8854f2[_0x104925(0x170)])return getSqlQueryDetail(_0x8854f2[_0x104925(0x170)]);if(_0x286286)return getSqlQueryDetailById(_0x286286);}return normalizeSqlQueryEntity(_0x269f23);}export async function deleteSqlQuery(_0x2a46bb){const _0x11aee9=a159_0x4a24;await apiRequest(_0x11aee9(0x173),{'method':_0x11aee9(0x197),'body':_0x2a46bb});}export async function saveSqlQuery(_0x971bd8){const _0x25ffa9=a159_0x4a24,_0xc0995c=await apiRequest(_0x25ffa9(0x14f),{'method':_0x25ffa9(0x197),'body':_0x971bd8});return _0xc0995c[_0x25ffa9(0x1a8)];}function normalizeSqlQueryEntity(_0x576ab8){const _0x1caa16=a159_0x4a24;return{..._0x576ab8,'id':Number(_0x576ab8['id']),'dbId':_0x576ab8[_0x1caa16(0x15e)]==null?undefined:Number(_0x576ab8[_0x1caa16(0x15e)]),'version':_0x576ab8[_0x1caa16(0x1a5)]==null?undefined:Number(_0x576ab8[_0x1caa16(0x1a5)])};}export async function executeSql(_0x4970d5,_0x26358e,_0x58f0d4){const _0x2d25fb=a159_0x4a24,_0x28a0fe=await apiRequest(_0x2d25fb(0xfd),{'method':_0x2d25fb(0x197),'body':{'appCode':_0x4970d5,'sqlCode':_0x26358e,..._0x58f0d4&&{'params':_0x58f0d4}},'useRuntime':!![]});return _0x28a0fe[_0x2d25fb(0x1a8)];}export async function executeDatasetDataOperation(_0x108efc,_0x1088a8,_0x33f36a,_0x1bcdb2={}){const _0x51e25f=a159_0x4a24;try{const _0x55a7ac=await apiRequest(_0x51e25f(0x185)+_0x108efc+'/'+_0x1088a8+'/'+_0x33f36a,{'method':_0x51e25f(0x197),'body':_0x1bcdb2,'useRuntime':!![]});return _0x55a7ac[_0x51e25f(0x1a8)];}catch(_0x20a8ba){if(_0x33f36a==='getOne'&&_0x20a8ba instanceof CliError&&_0x20a8ba[_0x51e25f(0x19e)]===_0x51e25f(0x17b)&&_0x1bcdb2['id']!==undefined&&_0x1bcdb2['id']!==null&&_0x1bcdb2['id']!==''){const _0xf4f393=await apiRequest('/api/'+_0x108efc+'/'+_0x1088a8+_0x51e25f(0x127),{'method':_0x51e25f(0x197),'body':{'where':{'id':{'$eq':_0x1bcdb2['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2406cf=Array['isArray'](_0xf4f393[_0x51e25f(0x1a8)]?.['tableData'])?_0xf4f393['data'][_0x51e25f(0x128)]:[];return _0x2406cf[0x0]??null;}throw _0x20a8ba;}}export async function listDatasets(_0x1bdacf,_0xbf1008){const _0x5e488a=a159_0x4a24,_0x1f54b6={'appCode':_0x1bdacf,'deleted':_0xbf1008?.[_0x5e488a(0x11d)]??![]};if(_0xbf1008?.[_0x5e488a(0x19e)])_0x1f54b6['code']=_0xbf1008[_0x5e488a(0x19e)];if(_0xbf1008?.['name'])_0x1f54b6[_0x5e488a(0x15b)]=_0xbf1008[_0x5e488a(0x15b)];const _0x217e5b=await apiRequest(_0x5e488a(0x116),{'method':_0x5e488a(0x197),'body':_0x1f54b6});return extractList(_0x217e5b[_0x5e488a(0x1a8)]);}export async function deleteDataset(_0x4c1e2c,_0x4c3f41){const _0x5018d4=a159_0x4a24;await apiRequest(_0x5018d4(0x104),{'method':'POST','body':{'appCode':_0x4c1e2c,'datasetId':_0x4c3f41}});}export async function restoreDataset(_0x290bf8,_0x42a8c7){const _0x268f49=a159_0x4a24;await apiRequest(_0x268f49(0x132),{'method':_0x268f49(0x197),'body':{'appCode':_0x290bf8,'datasetId':_0x42a8c7}});}export async function previewTextGeneratedDataset(_0xa36812,_0x276b03){const _0x159d30=a159_0x4a24,_0x214cdc=await apiRequest(_0x159d30(0x10c),{'method':_0x159d30(0x197),'body':{'appCode':_0xa36812,'datasetName':_0x276b03[_0x159d30(0x13b)],'requirementDescription':_0x276b03[_0x159d30(0x192)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x214cdc[_0x159d30(0x1a8)];}export async function startTextGeneratedDataset(_0x5e3f2f,_0x4e33ca,_0x5e5706){const _0x5ef6df=a159_0x4a24,_0x403a70=await apiRequest(_0x5ef6df(0x144),{'method':'POST','body':{'appCode':_0x5e3f2f,..._0x5e5706?.[_0x5ef6df(0x10e)]?{'clientOperationId':_0x5e5706[_0x5ef6df(0x10e)]}:{},'design':_0x4e33ca},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x403a70['data'];}export async function getTextGeneratedDatasetStatus(_0x3294b5,_0x264b87){const _0x2f22bd=a159_0x4a24,_0x5a9e91=new URLSearchParams({'appCode':_0x3294b5});_0x264b87['operationId']&&_0x5a9e91[_0x2f22bd(0x17a)](_0x2f22bd(0x152),_0x264b87[_0x2f22bd(0x152)]);_0x264b87[_0x2f22bd(0x10e)]&&_0x5a9e91['set'](_0x2f22bd(0x10e),_0x264b87[_0x2f22bd(0x10e)]);const _0x4ab180=await apiRequest(_0x2f22bd(0x10a)+_0x5a9e91[_0x2f22bd(0x171)]());return _0x4ab180[_0x2f22bd(0x1a8)];}export async function searchDatasets(_0x45a9cc,_0x133c44){const _0x36dddd=a159_0x4a24,_0x520c6d=await listDatasets(_0x45a9cc,{'name':_0x133c44}),_0x297198=_0x133c44[_0x36dddd(0x102)](),_0x522539=new Set(_0x520c6d[_0x36dddd(0x176)](_0x4fe3a7=>_0x4fe3a7['id'])),_0x43fcd5=_0x520c6d[_0x36dddd(0x14b)](_0x26ca91=>_0x26ca91[_0x36dddd(0x189)]?.[_0x36dddd(0x105)]?.[_0x36dddd(0x102)]()[_0x36dddd(0x134)](_0x297198)||_0x26ca91[_0x36dddd(0x12a)]?.['toLowerCase']()[_0x36dddd(0x134)](_0x297198)),_0x17e94b=await listDatasets(_0x45a9cc,{'code':_0x133c44});for(const _0x437066 of _0x17e94b){!_0x522539[_0x36dddd(0x11c)](_0x437066['id'])&&(_0x520c6d[_0x36dddd(0x165)](_0x437066),_0x522539['add'](_0x437066['id']));}return _0x520c6d;}export function normalizeDatasetOperations(_0x1869ea){const _0x5db71f=a159_0x4a24;if(Array[_0x5db71f(0x16d)](_0x1869ea))return _0x1869ea[_0x5db71f(0x14b)](_0x2980e6=>_0x2980e6!=null&&typeof _0x2980e6===_0x5db71f(0x149));if(_0x1869ea&&typeof _0x1869ea===_0x5db71f(0x149))return Object[_0x5db71f(0x123)](_0x1869ea)[_0x5db71f(0x14b)](([,_0x449517])=>_0x449517!=null&&typeof _0x449517===_0x5db71f(0x149))[_0x5db71f(0x176)](([_0x1172af,_0x469d4e])=>({..._0x469d4e,'name':_0x469d4e[_0x5db71f(0x15b)]??_0x469d4e[_0x5db71f(0x101)]??_0x1172af}));return[];}export async function getDatasetDetail(_0x16669b){const _0x35d050=a159_0x4a24,_0x547c84=/^\d+$/['test'](_0x16669b)?'id':_0x35d050(0x19e),_0x2fdfce=await apiRequest(_0x35d050(0x107)+_0x547c84+'='+_0x16669b);return _0x2fdfce[_0x35d050(0x1a8)];}export async function updateDrivenData(_0x290c17){const _0x369ea2=a159_0x4a24,_0x4a1c7d=await apiRequest(_0x369ea2(0x16f),{'method':_0x369ea2(0x197),'body':_0x290c17});return _0x4a1c7d[_0x369ea2(0x1a8)];}export async function getDatasetOperations(_0x142d07){const _0x33a0b=a159_0x4a24,_0x4fa9c2=await getDatasetDetail(_0x142d07),_0x30af82=normalizeDatasetOperations(_0x4fa9c2[_0x33a0b(0x161)])['map'](_0x85dbc7=>({'name':_0x85dbc7[_0x33a0b(0x15b)]||_0x85dbc7[_0x33a0b(0x101)],'displayName':_0x85dbc7[_0x33a0b(0x166)]||_0x85dbc7[_0x33a0b(0x15b)],'type':_0x85dbc7[_0x33a0b(0x18b)],'method':_0x85dbc7[_0x33a0b(0x17c)],'path':_0x85dbc7['path'],'enabled':_0x85dbc7[_0x33a0b(0x109)]??!![],'requestFields':_0x85dbc7[_0x33a0b(0x120)],'responseFields':_0x85dbc7[_0x33a0b(0x136)]}));return{'dataset':{'id':_0x4fa9c2['id']??_0x4fa9c2[_0x33a0b(0x18d)],'name':_0x4fa9c2[_0x33a0b(0x15b)],'code':_0x4fa9c2[_0x33a0b(0x19e)]||_0x4fa9c2[_0x33a0b(0x1a7)],'tableName':_0x4fa9c2['tableName']||_0x4fa9c2['dbtableConfig']?.[_0x33a0b(0x105)]},'operations':_0x30af82};}export async function getOperationDetail(_0x10acf7,_0x328ff6,_0x112b36){const _0x588459=a159_0x4a24;let _0x1b293f=_0x328ff6;if(!/^\d+$/[_0x588459(0x16c)](_0x328ff6)){const _0x55c5a5=await listDatasets(_0x10acf7,{'code':_0x328ff6}),_0x27d0da=_0x55c5a5[_0x588459(0x1a9)](_0x3278d2=>_0x3278d2[_0x588459(0x19e)]===_0x328ff6||String(_0x3278d2['id'])===_0x328ff6);if(!_0x27d0da)throw CliErrors[_0x588459(0x198)](_0x588459(0x121)+_0x328ff6);_0x1b293f=String(_0x27d0da['id']);}const _0x29238a=await getDatasetDetail(_0x1b293f),_0x5240ff=normalizeDatasetOperations(_0x29238a[_0x588459(0x161)])[_0x588459(0x1a9)](_0x29a3f8=>(_0x29a3f8[_0x588459(0x15b)]||_0x29a3f8[_0x588459(0x101)])===_0x112b36);if(!_0x5240ff)throw CliErrors[_0x588459(0x198)]('Operation\x20\x22'+_0x112b36+_0x588459(0x194)+_0x328ff6);return{'dataset':{'id':_0x29238a['id']??_0x29238a[_0x588459(0x18d)],'name':_0x29238a[_0x588459(0x15b)],'code':_0x29238a['code']||_0x29238a['modelCode'],'tableName':_0x29238a[_0x588459(0x105)]||_0x29238a[_0x588459(0x189)]?.['tableName']},'operation':_0x5240ff};}export async function startGenerateStandardPages(_0x231f6a,_0x5af569,_0x2b48d0){const _0x273626=a159_0x4a24,_0x1dbd6c=await apiRequest(_0x273626(0x147)+_0x5af569+'/generate-standard-pages/start',{'method':'POST','body':{'appCode':_0x231f6a,..._0x2b48d0?.[_0x273626(0x10e)]?{'clientOperationId':_0x2b48d0['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1dbd6c[_0x273626(0x1a8)];}export async function getGenerateStandardPagesStatus(_0x2a391f,_0x193551,_0x559cee){const _0x2f2bae=a159_0x4a24,_0x1d1e52=new URLSearchParams({'appCode':_0x2a391f});_0x559cee[_0x2f2bae(0x152)]&&_0x1d1e52[_0x2f2bae(0x17a)](_0x2f2bae(0x152),_0x559cee[_0x2f2bae(0x152)]);_0x559cee['clientOperationId']&&_0x1d1e52[_0x2f2bae(0x17a)]('clientOperationId',_0x559cee['clientOperationId']);const _0x2dbf1a=await apiRequest('/smartapi/lovrabet/dataset/'+_0x193551+'/generate-standard-pages/status?'+_0x1d1e52[_0x2f2bae(0x171)]());return _0x2dbf1a[_0x2f2bae(0x1a8)];}export async function getStandardPageStatus(_0x2ccb59,_0x36a7d0){const _0x5d6351=a159_0x4a24,_0x29a2e8=await apiRequest(_0x5d6351(0x147)+_0x36a7d0+_0x5d6351(0x12c)+encodeURIComponent(_0x2ccb59));return _0x29a2e8['data'];}export async function tryGetStandardPageStatus(_0x29fb44,_0x5d0497){const _0x355219=a159_0x4a24;try{return await getStandardPageStatus(_0x29fb44,_0x5d0497);}catch(_0x31f037){if(_0x31f037 instanceof CliError&&_0x31f037['code']===_0x355219(0x17b)&&/404|not found|non-json response/i[_0x355219(0x16c)](_0x31f037[_0x355219(0x184)]))return null;throw _0x31f037;}}export async function syncStandardPages(_0x77b204,_0xcc097b){const _0x6e6e90=a159_0x4a24,_0x567e21=await apiRequest('/smartapi/lovrabet/dataset/'+_0xcc097b+_0x6e6e90(0x11e),{'method':_0x6e6e90(0x197),'body':{'appCode':_0x77b204}});return _0x567e21[_0x6e6e90(0x1a8)];}export async function getPageDetail(_0x226dbb){const _0x25ead0=a159_0x4a24,_0x1928b1=await apiRequest(_0x25ead0(0x163)+_0x226dbb);if(!_0x1928b1[_0x25ead0(0x1a8)])throw CliErrors[_0x25ead0(0x198)]('Page\x20not\x20found:\x20'+_0x226dbb);return _0x1928b1[_0x25ead0(0x1a8)];}export async function updatePage(_0x5aadac,_0x32ec88,_0x321531,_0x494134){const _0x5a0bf7=a159_0x4a24,_0x98517e=await apiRequest(_0x5a0bf7(0x13c),{'method':'POST','body':{'appCode':_0x5aadac,'pageId':_0x32ec88,'code':_0x321531,'datasetIds':_0x494134}});return _0x98517e[_0x5a0bf7(0x1a8)];}export function generateSdkCode(_0x374eaf,_0x14228a,_0x615b32){const _0x35e5c6=a159_0x4a24,_0x1897a8=_0x615b32?.[_0x35e5c6(0x103)]??!![],_0x1ec489='dataset_'+_0x374eaf['code']?.['replace'](/-/g,'_'),_0x313b15=_0x14228a[_0x35e5c6(0x15b)]||_0x14228a['operationName']||'filter',_0x9c9ed1=[];_0x1897a8&&_0x9c9ed1['push'](_0x35e5c6(0x156),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x9c9ed1[_0x35e5c6(0x165)]('//\x20'+_0x374eaf[_0x35e5c6(0x15b)]+'\x20('+(_0x374eaf[_0x35e5c6(0x105)]||_0x35e5c6(0x153))+')');if(_0x313b15==='filter')_0x9c9ed1[_0x35e5c6(0x165)](_0x35e5c6(0x191)+_0x1ec489+_0x35e5c6(0x167),'\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x35e5c6(0x135),'});');else{if(_0x313b15===_0x35e5c6(0x187))_0x9c9ed1['push']('const\x20result\x20=\x20await\x20client.models.'+_0x1ec489+_0x35e5c6(0x137));else{if(_0x313b15==='create')_0x9c9ed1[_0x35e5c6(0x165)](_0x35e5c6(0x191)+_0x1ec489+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x313b15===_0x35e5c6(0x1a4))_0x9c9ed1[_0x35e5c6(0x165)](_0x35e5c6(0x191)+_0x1ec489+_0x35e5c6(0x195));else _0x313b15===_0x35e5c6(0x182)||_0x313b15==='remove'?_0x9c9ed1[_0x35e5c6(0x165)](_0x35e5c6(0x191)+_0x1ec489+_0x35e5c6(0x118)):_0x9c9ed1[_0x35e5c6(0x165)](_0x35e5c6(0x191)+_0x1ec489+'.'+_0x313b15+_0x35e5c6(0x12f));}}}return _0x9c9ed1[_0x35e5c6(0x17e)]('\x0a');}export function generateSqlCodeTemplate(_0x1a6837,_0x19c456){const _0x46fd9e=a159_0x4a24,_0x4f205d=_0x19c456?.[_0x46fd9e(0x12d)]??_0x46fd9e(0x164),_0x5b0dc3=_0x19c456?.['includeImports']??!![],_0x646a73=[];return _0x646a73[_0x46fd9e(0x165)](_0x46fd9e(0x12b)+_0x1a6837[_0x46fd9e(0x130)]+'\x20('+_0x1a6837[_0x46fd9e(0x170)]+')'),_0x4f205d===_0x46fd9e(0x164)?(_0x5b0dc3&&_0x646a73[_0x46fd9e(0x165)](_0x46fd9e(0x156),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x646a73[_0x46fd9e(0x165)](_0x46fd9e(0x1ad),_0x46fd9e(0x143)+_0x1a6837['sqlCode']+'\x27,',_0x46fd9e(0x151),_0x46fd9e(0x16b),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x46fd9e(0x10b))):_0x646a73['push']('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x46fd9e(0x119),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','\x20\x20\x20\x20sqlCode:\x20\x27'+_0x1a6837[_0x46fd9e(0x170)]+'\x27,',_0x46fd9e(0x129),_0x46fd9e(0x186),_0x46fd9e(0x115),'}'),_0x646a73[_0x46fd9e(0x17e)]('\x0a');}export async function getErConfig(_0x5d0a0b,_0x5a0e03){const _0x30aead=a159_0x4a24,_0xcac9f6=await apiRequest('/smartapi/question/er-config',{'method':_0x30aead(0x197),'body':{'appCode':_0x5d0a0b,'dblinkId':_0x5a0e03},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0xcac9f6[_0x30aead(0x1a8)];}export async function createErRelation(_0x2624a3){const _0x108dc0=a159_0x4a24,_0xa73e30=await apiRequest(_0x108dc0(0x138),{'method':_0x108dc0(0x197),'body':_0x2624a3,'allowNonJsonSuccess':!![]});return _0xa73e30[_0x108dc0(0x1a8)];}function a159_0x4a24(_0x2228cf,_0x20efd4){_0x2228cf=_0x2228cf-0xfd;const _0x1315e3=a159_0x1315();let _0x4a24fd=_0x1315e3[_0x2228cf];return _0x4a24fd;}export async function updateErRelation(_0x5b4ac6){const _0x33edcc=a159_0x4a24,_0x519ae2=await apiRequest('/smartapi/question/er-config/update-single',{'method':_0x33edcc(0x197),'body':_0x5b4ac6,'allowNonJsonSuccess':!![]});return _0x519ae2[_0x33edcc(0x1a8)];}export async function deleteErRelation(_0x4e1846){const _0x4a1f1f=a159_0x4a24,_0x139f36=await apiRequest('/smartapi/question/er-config/erDelete',{'method':_0x4a1f1f(0x197),'body':_0x4e1846,'allowNonJsonSuccess':!![]});return _0x139f36['data'];}export async function updateErBusinessGroup(_0x54ee3d){const _0xd7dddd=a159_0x4a24,_0x43597d=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':_0xd7dddd(0x197),'body':_0x54ee3d,'allowNonJsonSuccess':!![]});return _0x43597d[_0xd7dddd(0x1a8)];}function buildQuery(_0x39bf92){const _0x4879b0=a159_0x4a24,_0x34e615=new URLSearchParams();for(const [_0x19063a,_0x4dc12f]of Object[_0x4879b0(0x123)](_0x39bf92)){if(_0x4dc12f===undefined||_0x4dc12f==='')continue;_0x34e615['set'](_0x19063a,String(_0x4dc12f));}const _0x53e198=_0x34e615[_0x4879b0(0x171)]();return _0x53e198?'?'+_0x53e198:'';}export async function listAppConfigs(_0x549a70,_0x5e8c9c){const _0x417b5c=a159_0x4a24,_0x1f33c5=await apiRequest(_0x417b5c(0x133),{'method':_0x417b5c(0x197),'body':{'appCode':_0x549a70,..._0x5e8c9c?.[_0x417b5c(0x1a6)]?{'key':_0x5e8c9c[_0x417b5c(0x1a6)]}:{},..._0x5e8c9c?.[_0x417b5c(0x16e)]?{'tags':_0x5e8c9c[_0x417b5c(0x16e)]}:{}}});return extractAppConfigList(_0x1f33c5[_0x417b5c(0x1a8)]);}export async function getAppConfigByKey(_0x24847c,_0x49ab56){const _0x3581a2=a159_0x4a24,_0x4e6f93=await apiRequest(_0x3581a2(0xfe)+buildQuery({'appCode':_0x24847c,'key':_0x49ab56}));return _0x4e6f93[_0x3581a2(0x1a8)]??null;}export async function createAppConfig(_0x4ac636){const _0x3ead48=a159_0x4a24,_0x2fe3df=await apiRequest(_0x3ead48(0x15f),{'method':_0x3ead48(0x197),'body':{'appCode':_0x4ac636['appCode'],'key':_0x4ac636[_0x3ead48(0x1a6)],'value':_0x4ac636['value'],..._0x4ac636[_0x3ead48(0x16e)]?{'tags':_0x4ac636[_0x3ead48(0x16e)]}:{}}});return _0x2fe3df[_0x3ead48(0x1a8)];}export async function updateAppConfig(_0x1c6301){const _0x12ee86=a159_0x4a24;await apiRequest(_0x12ee86(0x148),{'method':'POST','body':{'id':_0x1c6301['id'],'appCode':_0x1c6301[_0x12ee86(0x131)],'key':_0x1c6301[_0x12ee86(0x1a6)],'value':_0x1c6301[_0x12ee86(0x178)],..._0x1c6301[_0x12ee86(0x16e)]?{'tags':_0x1c6301[_0x12ee86(0x16e)]}:{}}});}export async function deleteAppConfig(_0x408305){const _0x3ee854=a159_0x4a24;await apiRequest(_0x3ee854(0xff),{'method':_0x3ee854(0x197),'body':_0x408305});}function extractAppConfigList(_0x581047){const _0x1ef24a=a159_0x4a24;if(Array[_0x1ef24a(0x16d)](_0x581047))return _0x581047;if(_0x581047&&typeof _0x581047===_0x1ef24a(0x149)&&Array[_0x1ef24a(0x16d)](_0x581047[_0x1ef24a(0x193)]))return _0x581047[_0x1ef24a(0x193)];return extractList(_0x581047);}export async function listDbLinks(_0x599b11,_0x1f2e96){const _0x2f355e=a159_0x4a24,_0x1fb485=await apiRequest(_0x2f355e(0x158),{'method':_0x2f355e(0x197),'body':{'appCode':_0x599b11,'currentPage':_0x1f2e96?.[_0x2f355e(0x155)]??0x1,'pageSize':_0x1f2e96?.[_0x2f355e(0x17d)]??0x64}});return{'items':extractList(_0x1fb485[_0x2f355e(0x1a8)]),'paging':extractPaging(_0x1fb485[_0x2f355e(0x1a8)])};}export async function getDbLinkInfo(_0x166f97){const _0x1f26d8=a159_0x4a24,_0x291b61=await apiRequest(_0x1f26d8(0x181)+buildQuery({'id':_0x166f97}));return _0x291b61[_0x1f26d8(0x1a8)];}export async function createDbLink(_0x48f2f2){const _0x5241de=a159_0x4a24,_0x2ecfb4=await apiRequest('/smartapi/dblink/create',{'method':_0x5241de(0x197),'body':_0x48f2f2});return _0x2ecfb4[_0x5241de(0x1a8)];}export async function updateDbLink(_0x3250fe){const _0xdcfe5f=a159_0x4a24,_0x138f74=await apiRequest(_0xdcfe5f(0x126),{'method':_0xdcfe5f(0x197),'body':_0x3250fe});return _0x138f74['data'];}export async function deleteDbLink(_0x4a3d6d){const _0x320ba5=a159_0x4a24;await apiRequest(_0x320ba5(0x1a0),{'method':_0x320ba5(0x197),'body':{'id':_0x4a3d6d}});}export async function testDbLinkConnect(_0x3081d2){const _0x1557e7=a159_0x4a24,_0x40d455=await apiRequest(_0x1557e7(0x14e)+buildQuery({'id':_0x3081d2}));return _0x40d455[_0x1557e7(0x1a8)];}export async function startDbAnalysis(_0x28a22c,_0x9a3f5e){const _0x18d3ac=a159_0x4a24,_0x544524=await apiRequest('/smartapi/db-analysis/start',{'method':_0x18d3ac(0x197),'body':{'dbLinkId':_0x28a22c,..._0x9a3f5e&&_0x9a3f5e[_0x18d3ac(0x19c)]>0x0?{'tableNames':_0x9a3f5e}:{}}}),_0x4e6077=_0x544524[_0x18d3ac(0x1a8)];if(typeof _0x4e6077==='string')return _0x4e6077;if(_0x4e6077&&typeof _0x4e6077===_0x18d3ac(0x149)&&typeof _0x4e6077[_0x18d3ac(0x17f)]==='string')return _0x4e6077['planId'];return _0x4e6077!=null?String(_0x4e6077):'';}export async function cancelDbAnalysis(_0x2cdace){const _0x11bcca=a159_0x4a24;await apiRequest(_0x11bcca(0x13a)+buildQuery({'planId':_0x2cdace}),{'method':_0x11bcca(0x197)});}export async function getDbAnalysisStatus(_0x3a8a72){const _0x257e7c=a159_0x4a24,_0x477fa9=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x3a8a72));return _0x477fa9[_0x257e7c(0x1a8)];}export async function getDbAllTableList(_0x154f43,_0x478794){const _0x2774bc=a159_0x4a24,_0x77a0b7=await apiRequest(_0x2774bc(0x14c)+buildQuery({'appCode':_0x154f43,'dbLinkId':_0x478794})),_0x18f180=_0x77a0b7[_0x2774bc(0x1a8)];if(Array[_0x2774bc(0x16d)](_0x18f180))return _0x18f180;return extractList(_0x18f180);}export async function getDbTableDiff(_0x47a5df,_0x141e4c,_0x5cd7e4){const _0x314a90=a159_0x4a24,_0x2b97ac=await apiRequest(_0x314a90(0x10d)+buildQuery({'appCode':_0x47a5df,'dbLinkId':_0x141e4c,'pageIndex':_0x5cd7e4?.['pageIndex']??0x1,'pageSize':_0x5cd7e4?.[_0x314a90(0x17d)]??0x14,'tableName':_0x5cd7e4?.[_0x314a90(0x105)]})),_0x27379e=_0x2b97ac[_0x314a90(0x1a8)];return{'totalCount':_0x27379e?.[_0x314a90(0x114)]??0x0,'physicalTableCount':_0x27379e?.[_0x314a90(0x14d)]??0x0,'datasetTableCount':_0x27379e?.['datasetTableCount']??0x0,..._0x27379e?.[_0x314a90(0x13d)]?{'summary':_0x27379e['summary']}:{},'tableList':Array[_0x314a90(0x16d)](_0x27379e?.['tableList'])?_0x27379e[_0x314a90(0x18a)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2cfad6=a159_0x4a24,_0xe542d8=await apiRequest(_0x2cfad6(0x15a),{'method':_0x2cfad6(0x197),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x519a13=extractList(_0xe542d8[_0x2cfad6(0x1a8)]),_0x1a5a71=extractPaging(_0xe542d8[_0x2cfad6(0x1a8)]);return _0x1a5a71&&_0x1a5a71[_0x2cfad6(0x114)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x2cfad6(0x11f)+REMOTE_APP_PAGE_SIZE+_0x2cfad6(0x12e)+_0x1a5a71['totalCount']+_0x2cfad6(0x112)+_0x2cfad6(0x199)),_0x519a13;}
@@ -1 +1 @@
1
- const a159_0x536ca9=a159_0x2706;(function(_0x1b3796,_0x27e632){const _0x5815a2=a159_0x2706,_0xf70e1b=_0x1b3796();while(!![]){try{const _0x59078e=-parseInt(_0x5815a2(0x156))/0x1+parseInt(_0x5815a2(0x14e))/0x2+-parseInt(_0x5815a2(0x151))/0x3*(-parseInt(_0x5815a2(0x152))/0x4)+parseInt(_0x5815a2(0x157))/0x5+parseInt(_0x5815a2(0x153))/0x6+-parseInt(_0x5815a2(0x154))/0x7+parseInt(_0x5815a2(0x158))/0x8*(-parseInt(_0x5815a2(0x155))/0x9);if(_0x59078e===_0x27e632)break;else _0xf70e1b['push'](_0xf70e1b['shift']());}catch(_0x161761){_0xf70e1b['push'](_0xf70e1b['shift']());}}}(a159_0xe878,0x6adb2));import{resolve}from'node:path';function a159_0xe878(){const _0x79ba24=['1762364sSzrOv','3431298YGXeIY','4831750JqXLjv','273825zyyRAs','582968ANZdAK','1056290TnpLma','56zXvHgQ','.rabetbase','1400286tIsidU','/bff','bff','3kGrsir'];a159_0xe878=function(){return _0x79ba24;};return a159_0xe878();}function a159_0x2706(_0x5afe38,_0x24e71e){_0x5afe38=_0x5afe38-0x14e;const _0xe878b3=a159_0xe878();let _0x2706d3=_0xe878b3[_0x5afe38];return _0x2706d3;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a159_0x536ca9(0x159),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0xb39713,_0x8bf120){const _0x2fc350=a159_0x536ca9,_0xadf60c=resolve(_0x8bf120??findProjectRootDirectory()),_0x2fd0e7=DOT_DIR+_0x2fc350(0x14f),_0x16fcd0=_0x2fd0e7+'/'+_0xb39713;return{'projectRoot':_0xadf60c,'appCode':_0xb39713,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2fd0e7,'scriptsRoot':_0x16fcd0,'scriptsRootDir':resolve(_0xadf60c,DOT_DIR,_0x2fc350(0x150),_0xb39713),'lockFilePath':resolve(_0xadf60c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xadf60c,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a160_0x4f5def=a160_0x3621;(function(_0x57e49e,_0x369b0b){const _0x442dd0=a160_0x3621,_0x2c36ac=_0x57e49e();while(!![]){try{const _0x33dc68=-parseInt(_0x442dd0(0x6a))/0x1+parseInt(_0x442dd0(0x73))/0x2+-parseInt(_0x442dd0(0x72))/0x3+parseInt(_0x442dd0(0x69))/0x4+-parseInt(_0x442dd0(0x71))/0x5*(parseInt(_0x442dd0(0x68))/0x6)+parseInt(_0x442dd0(0x6d))/0x7+parseInt(_0x442dd0(0x70))/0x8;if(_0x33dc68===_0x369b0b)break;else _0x2c36ac['push'](_0x2c36ac['shift']());}catch(_0x48ed39){_0x2c36ac['push'](_0x2c36ac['shift']());}}}(a160_0x4558,0x80cf1));import{resolve}from'node:path';function a160_0x4558(){const _0x3d5e95=['/bff','573656CMHalR','140725iVCIps','3022959YZZTYr','1928964tbVOUj','bff-trash','120oIMggi','3306496ayxjQm','812244ExUZra','bff.lock.json','bff','7333095ahWPra','.rabetbase'];a160_0x4558=function(){return _0x3d5e95;};return a160_0x4558();}function a160_0x3621(_0x18a062,_0x4b931d){_0x18a062=_0x18a062-0x67;const _0x455835=a160_0x4558();let _0x3621d3=_0x455835[_0x18a062];return _0x3621d3;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a160_0x4f5def(0x6e),LOCK_FILE_NAME=a160_0x4f5def(0x6b),TRASH_DIR_NAME=a160_0x4f5def(0x67);export function loadBffProjectConfig(_0x345ec3,_0xdcc7dd){const _0x5617bb=a160_0x4f5def,_0x406ad6=resolve(_0xdcc7dd??findProjectRootDirectory()),_0x293899=DOT_DIR+_0x5617bb(0x6f),_0x5d919e=_0x293899+'/'+_0x345ec3;return{'projectRoot':_0x406ad6,'appCode':_0x345ec3,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x293899,'scriptsRoot':_0x5d919e,'scriptsRootDir':resolve(_0x406ad6,DOT_DIR,_0x5617bb(0x6c),_0x345ec3),'lockFilePath':resolve(_0x406ad6,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x406ad6,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a160_0x3ea255=a160_0x2375;(function(_0x37cd51,_0x5390a1){const _0x1e0d7e=a160_0x2375,_0x5028b1=_0x37cd51();while(!![]){try{const _0x4e4875=-parseInt(_0x1e0d7e(0x10f))/0x1*(-parseInt(_0x1e0d7e(0x10d))/0x2)+-parseInt(_0x1e0d7e(0xfc))/0x3+parseInt(_0x1e0d7e(0x10e))/0x4*(-parseInt(_0x1e0d7e(0xf9))/0x5)+-parseInt(_0x1e0d7e(0xfd))/0x6*(parseInt(_0x1e0d7e(0xf7))/0x7)+-parseInt(_0x1e0d7e(0xfb))/0x8*(parseInt(_0x1e0d7e(0x100))/0x9)+parseInt(_0x1e0d7e(0xe6))/0xa+parseInt(_0x1e0d7e(0xee))/0xb*(parseInt(_0x1e0d7e(0xea))/0xc);if(_0x4e4875===_0x5390a1)break;else _0x5028b1['push'](_0x5028b1['shift']());}catch(_0x452859){_0x5028b1['push'](_0x5028b1['shift']());}}}(a160_0x566b,0x8c2cf));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a160_0x2375(_0x3fb5da,_0x509f31){_0x3fb5da=_0x3fb5da-0xe6;const _0x566b6f=a160_0x566b();let _0x2375a7=_0x566b6f[_0x3fb5da];return _0x2375a7;}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x3ea255(0x102),a160_0x3ea255(0x10c),a160_0x3ea255(0xfa)];export function normalizeBffType(_0x55ac92){const _0x3210ed=a160_0x3ea255;if(!_0x55ac92)return undefined;const _0x524fb4=_0x55ac92[_0x3210ed(0x104)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x3210ed(0xf6)](_0x524fb4)?_0x524fb4:undefined;}async function scanJsFilesRecursively(_0x86c198,_0x5dcf7a){const _0x438e5f=a160_0x3ea255,_0x524497=[];try{const _0x373293=await readdir(_0x86c198,{'withFileTypes':!![]});for(const _0x6d1b7b of _0x373293){const _0x13df80=join(_0x86c198,_0x6d1b7b['name']);if(_0x6d1b7b[_0x438e5f(0xf3)]())_0x524497['push'](...await scanJsFilesRecursively(_0x13df80,_0x5dcf7a+'/'+_0x6d1b7b[_0x438e5f(0x106)]));else _0x6d1b7b[_0x438e5f(0xe8)]()&&_0x6d1b7b[_0x438e5f(0x106)][_0x438e5f(0xf5)](_0x438e5f(0xef))&&_0x524497[_0x438e5f(0x101)]({'lockKey':_0x5dcf7a+'/'+_0x6d1b7b['name'][_0x438e5f(0xe7)](/\.js$/,''),'filePath':_0x13df80});}}catch(_0x24a8e8){if(_0x24a8e8['code']!==_0x438e5f(0x10b))throw _0x24a8e8;}return _0x524497;}async function scanFlatFunctions(_0x1f9f50,_0x3245c3){const _0x3fb906=a160_0x3ea255,_0x1c5761=join(_0x1f9f50[_0x3fb906(0xe9)],_0x3245c3),_0x5f4686=await scanJsFilesRecursively(_0x1c5761,_0x3245c3);return _0x5f4686[_0x3fb906(0xeb)](({lockKey:_0x347bc6,filePath:_0x4d45ea})=>({'type':_0x3245c3,'name':_0x347bc6[_0x3fb906(0x107)]('/')['at'](-0x1)??'','filePath':_0x4d45ea,'lockKey':_0x347bc6}));}async function scanHookFunctions(_0x58289b){const _0xd7776e=a160_0x3ea255,_0x37560b=join(_0x58289b[_0xd7776e(0xe9)],_0xd7776e(0xfa)),_0x46726e=[];try{const _0x53631b=await readdir(_0x37560b,{'withFileTypes':!![]});for(const _0x44d6be of _0x53631b){if(!_0x44d6be[_0xd7776e(0xf3)]())continue;const _0x5576af=_0x44d6be[_0xd7776e(0x106)],_0x515078=join(_0x37560b,_0x5576af),_0x4fab0c=await readdir(_0x515078,{'withFileTypes':!![]});for(const _0x5165cd of _0x4fab0c){if(!_0x5165cd[_0xd7776e(0xf3)]())continue;const _0x959fd5=_0x5165cd[_0xd7776e(0x106)],_0x542149=join(_0x515078,_0x959fd5),_0x3fe32f=await readdir(_0x542149,{'withFileTypes':!![]});for(const _0x413d73 of _0x3fe32f){if(!_0x413d73[_0xd7776e(0xf3)]())continue;const _0x25eb98=_0x413d73[_0xd7776e(0x106)],_0x1846ad=join(_0x542149,_0x25eb98),_0x37b8d9=await readdir(_0x1846ad,{'withFileTypes':!![]});for(const _0x2ff681 of _0x37b8d9){if(!_0x2ff681[_0xd7776e(0xe8)]()||!_0x2ff681[_0xd7776e(0x106)][_0xd7776e(0xf5)](_0xd7776e(0xef)))continue;const _0x1278a9=_0x2ff681['name']['replace'](/\.js$/,'');_0x46726e[_0xd7776e(0x101)]({'type':_0xd7776e(0xfa),'name':_0x1278a9,'filePath':join(_0x1846ad,_0x2ff681[_0xd7776e(0x106)]),'lockKey':_0xd7776e(0x110)+_0x5576af+'/'+_0x959fd5+'/'+_0x25eb98+'/'+_0x1278a9,'alias':_0x5576af,'operationType':_0x959fd5,'functionNode':_0x25eb98});}}}}}catch(_0x4923f4){if(_0x4923f4[_0xd7776e(0xfe)]!=='ENOENT')throw _0x4923f4;}return _0x46726e;}export async function scanLocalBffFunctions(_0x4fce0d,_0x10f0ea){const _0x5afdf4=a160_0x3ea255;if(_0x10f0ea==='COMMON'||_0x10f0ea===_0x5afdf4(0x10c))return scanFlatFunctions(_0x4fce0d,_0x10f0ea);if(_0x10f0ea===_0x5afdf4(0xfa))return scanHookFunctions(_0x4fce0d);const [_0x251037,_0x4b9c8f,_0x2812b2]=await Promise[_0x5afdf4(0x108)]([scanFlatFunctions(_0x4fce0d,_0x5afdf4(0x102)),scanFlatFunctions(_0x4fce0d,_0x5afdf4(0x10c)),scanHookFunctions(_0x4fce0d)]);return[..._0x251037,..._0x4b9c8f,..._0x2812b2];}export function resolveLocalFilePathFromLockKey(_0x1567da,_0x1f141b){const _0x57c810=a160_0x3ea255;return join(_0x1567da['scriptsRootDir'],..._0x1f141b['split']('/'))+_0x57c810(0xef);}export function createHookLocationMap(_0x1458e3){const _0x2afb4f=a160_0x3ea255,_0xf9bf0=new Map();for(const _0x1071ef of _0x1458e3){_0x1071ef[_0x2afb4f(0x10a)]&&_0xf9bf0[_0x2afb4f(0xff)](_0x1071ef[_0x2afb4f(0x10a)],{'datasetCode':_0x1071ef[_0x2afb4f(0xf2)],'operationType':snakeToCamel(_0x1071ef[_0x2afb4f(0xf0)]),'functionNode':_0x2afb4f(0xf4)}),_0x1071ef['afterScriptId']&&_0xf9bf0[_0x2afb4f(0xff)](_0x1071ef[_0x2afb4f(0xed)],{'datasetCode':_0x1071ef[_0x2afb4f(0xf2)],'operationType':snakeToCamel(_0x1071ef[_0x2afb4f(0xf0)]),'functionNode':_0x2afb4f(0xf1)});}return _0xf9bf0;}function a160_0x566b(){const _0x49f071=['get','name','split','all','functionNode','beforeScriptId','ENOENT','ENDPOINT','470gHZBCu','4eFaayN','4265BjmNzO','HOOK/','3362640VeAdbv','replace','isFile','scriptsRootDir','20451684kbKEjK','map','alias','afterScriptId','11vvYWEn','.js','operationType','after','datasetCode','isDirectory','before','endsWith','includes','7tFUWCn','functionName','2917205VYKMyC','HOOK','8273336ggVoSc','1791966yCdDkc','1522542GpYOeA','code','set','9ZvdeDA','push','COMMON','F_OK','trim'];a160_0x566b=function(){return _0x49f071;};return a160_0x566b();}export function resolveRemoteScriptTarget(_0x1a37ff,_0x273b81,_0x3a5d08,_0x544dc6,_0x2eacad){const _0x68e163=a160_0x3ea255,_0xfb7e8f=normalizeBffType(_0x273b81['scriptType']);if(!_0xfb7e8f||!_0x273b81[_0x68e163(0xf8)])return null;if(_0xfb7e8f===_0x68e163(0xfa)){const _0x2a26eb=(_0x273b81['id']?_0x3a5d08[_0x68e163(0x105)](_0x273b81['id']):undefined)??findHookLocationByRemoteId(_0x544dc6,_0x273b81['id']);if(!_0x2a26eb)return null;const _0x1b8b5e=_0x2a26eb[_0x68e163(0xec)]||_0x2eacad[_0x68e163(0x105)](_0x2a26eb[_0x68e163(0xf2)]),_0x2019f5=_0x1b8b5e??_0x2a26eb[_0x68e163(0xf2)],_0x25c31e={..._0x2a26eb,'alias':_0x1b8b5e},_0x11328b='HOOK/'+_0x2019f5+'/'+_0x25c31e[_0x68e163(0xf0)]+'/'+_0x25c31e[_0x68e163(0x109)]+'/'+_0x273b81['functionName'];return{'lockKey':_0x11328b,'filePath':resolveLocalFilePathFromLockKey(_0x1a37ff,_0x11328b),'type':_0x68e163(0xfa),'hookLocation':_0x25c31e};}const _0x3357e7=_0xfb7e8f+'/'+_0x273b81[_0x68e163(0xf8)];return{'lockKey':_0x3357e7,'filePath':resolveLocalFilePathFromLockKey(_0x1a37ff,_0x3357e7),'type':_0xfb7e8f};}export async function ensureParentDirectory(_0x3ef9f9){await mkdir(dirname(_0x3ef9f9),{'recursive':!![]});}export async function fileExists(_0x4ef453){const _0x1403e5=a160_0x3ea255;try{return await access(_0x4ef453,constants[_0x1403e5(0x103)]),!![];}catch{return![];}}export async function directoryExists(_0x4992df){const _0x569316=a160_0x3ea255;try{const _0x1964a3=await stat(_0x4992df);return _0x1964a3[_0x569316(0xf3)]();}catch{return![];}}
1
+ const a161_0x2d359d=a161_0xf6b5;(function(_0x18b014,_0x350443){const _0x7efc25=a161_0xf6b5,_0x5b72ed=_0x18b014();while(!![]){try{const _0x592df6=-parseInt(_0x7efc25(0x12d))/0x1+-parseInt(_0x7efc25(0x120))/0x2*(-parseInt(_0x7efc25(0x146))/0x3)+parseInt(_0x7efc25(0x12a))/0x4+-parseInt(_0x7efc25(0x124))/0x5*(-parseInt(_0x7efc25(0x130))/0x6)+parseInt(_0x7efc25(0x13d))/0x7*(-parseInt(_0x7efc25(0x137))/0x8)+-parseInt(_0x7efc25(0x129))/0x9*(-parseInt(_0x7efc25(0x12b))/0xa)+-parseInt(_0x7efc25(0x138))/0xb;if(_0x592df6===_0x350443)break;else _0x5b72ed['push'](_0x5b72ed['shift']());}catch(_0x16e4f2){_0x5b72ed['push'](_0x5b72ed['shift']());}}}(a161_0x36c5,0xc1343));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=['COMMON',a161_0x2d359d(0x13c),'HOOK'];export function normalizeBffType(_0x1cd352){const _0x1c32f4=a161_0x2d359d;if(!_0x1cd352)return undefined;const _0x42f75b=_0x1cd352[_0x1c32f4(0x13b)]()[_0x1c32f4(0x140)]();return SUPPORTED_BFF_TYPES['includes'](_0x42f75b)?_0x42f75b:undefined;}async function scanJsFilesRecursively(_0x5b33db,_0x18d982){const _0x30b735=a161_0x2d359d,_0x549f03=[];try{const _0x3622d5=await readdir(_0x5b33db,{'withFileTypes':!![]});for(const _0x28cc1b of _0x3622d5){const _0x5317bb=join(_0x5b33db,_0x28cc1b['name']);if(_0x28cc1b[_0x30b735(0x143)]())_0x549f03[_0x30b735(0x123)](...await scanJsFilesRecursively(_0x5317bb,_0x18d982+'/'+_0x28cc1b['name']));else _0x28cc1b[_0x30b735(0x141)]()&&_0x28cc1b[_0x30b735(0x131)]['endsWith'](_0x30b735(0x136))&&_0x549f03[_0x30b735(0x123)]({'lockKey':_0x18d982+'/'+_0x28cc1b[_0x30b735(0x131)][_0x30b735(0x122)](/\.js$/,''),'filePath':_0x5317bb});}}catch(_0x5a2c92){if(_0x5a2c92[_0x30b735(0x128)]!==_0x30b735(0x13a))throw _0x5a2c92;}return _0x549f03;}async function scanFlatFunctions(_0x500d18,_0xecee07){const _0x439412=a161_0x2d359d,_0x1a09e2=join(_0x500d18[_0x439412(0x144)],_0xecee07),_0xa41181=await scanJsFilesRecursively(_0x1a09e2,_0xecee07);return _0xa41181[_0x439412(0x139)](({lockKey:_0x10f1a3,filePath:_0x5b3b3f})=>({'type':_0xecee07,'name':_0x10f1a3[_0x439412(0x13e)]('/')['at'](-0x1)??'','filePath':_0x5b3b3f,'lockKey':_0x10f1a3}));}async function scanHookFunctions(_0x3a5b48){const _0x43ef7f=a161_0x2d359d,_0xa63819=join(_0x3a5b48[_0x43ef7f(0x144)],'HOOK'),_0x40581c=[];try{const _0x2c0795=await readdir(_0xa63819,{'withFileTypes':!![]});for(const _0x57225c of _0x2c0795){if(!_0x57225c[_0x43ef7f(0x143)]())continue;const _0x55316a=_0x57225c['name'],_0x24a735=join(_0xa63819,_0x55316a),_0x132f5d=await readdir(_0x24a735,{'withFileTypes':!![]});for(const _0xe1bb15 of _0x132f5d){if(!_0xe1bb15['isDirectory']())continue;const _0x52a9f8=_0xe1bb15[_0x43ef7f(0x131)],_0x31bd2f=join(_0x24a735,_0x52a9f8),_0x8b2786=await readdir(_0x31bd2f,{'withFileTypes':!![]});for(const _0x111188 of _0x8b2786){if(!_0x111188[_0x43ef7f(0x143)]())continue;const _0x36b2ab=_0x111188[_0x43ef7f(0x131)],_0x36b5f9=join(_0x31bd2f,_0x36b2ab),_0x1c52b3=await readdir(_0x36b5f9,{'withFileTypes':!![]});for(const _0x5a2a16 of _0x1c52b3){if(!_0x5a2a16['isFile']()||!_0x5a2a16[_0x43ef7f(0x131)][_0x43ef7f(0x13f)]('.js'))continue;const _0x586671=_0x5a2a16[_0x43ef7f(0x131)][_0x43ef7f(0x122)](/\.js$/,'');_0x40581c[_0x43ef7f(0x123)]({'type':'HOOK','name':_0x586671,'filePath':join(_0x36b5f9,_0x5a2a16[_0x43ef7f(0x131)]),'lockKey':_0x43ef7f(0x145)+_0x55316a+'/'+_0x52a9f8+'/'+_0x36b2ab+'/'+_0x586671,'alias':_0x55316a,'operationType':_0x52a9f8,'functionNode':_0x36b2ab});}}}}}catch(_0x1f27bf){if(_0x1f27bf[_0x43ef7f(0x128)]!=='ENOENT')throw _0x1f27bf;}return _0x40581c;}export async function scanLocalBffFunctions(_0x493b07,_0x37078f){const _0x191800=a161_0x2d359d;if(_0x37078f===_0x191800(0x134)||_0x37078f==='ENDPOINT')return scanFlatFunctions(_0x493b07,_0x37078f);if(_0x37078f==='HOOK')return scanHookFunctions(_0x493b07);const [_0x53abba,_0x1549e9,_0x4d02e1]=await Promise[_0x191800(0x125)]([scanFlatFunctions(_0x493b07,_0x191800(0x134)),scanFlatFunctions(_0x493b07,_0x191800(0x13c)),scanHookFunctions(_0x493b07)]);return[..._0x53abba,..._0x1549e9,..._0x4d02e1];}export function resolveLocalFilePathFromLockKey(_0x249ee3,_0xfeb694){const _0x1d0903=a161_0x2d359d;return join(_0x249ee3[_0x1d0903(0x144)],..._0xfeb694[_0x1d0903(0x13e)]('/'))+_0x1d0903(0x136);}export function createHookLocationMap(_0x2725cd){const _0x17eb0d=a161_0x2d359d,_0x538566=new Map();for(const _0x6b34c4 of _0x2725cd){_0x6b34c4[_0x17eb0d(0x135)]&&_0x538566[_0x17eb0d(0x127)](_0x6b34c4[_0x17eb0d(0x135)],{'datasetCode':_0x6b34c4['datasetCode'],'operationType':snakeToCamel(_0x6b34c4[_0x17eb0d(0x147)]),'functionNode':_0x17eb0d(0x12c)}),_0x6b34c4['afterScriptId']&&_0x538566[_0x17eb0d(0x127)](_0x6b34c4[_0x17eb0d(0x133)],{'datasetCode':_0x6b34c4['datasetCode'],'operationType':snakeToCamel(_0x6b34c4['operationType']),'functionNode':_0x17eb0d(0x12f)});}return _0x538566;}export function resolveRemoteScriptTarget(_0x4dc5b8,_0x56a2ee,_0x38310e,_0x2dfe97,_0x1a604e){const _0x1f1be3=a161_0x2d359d,_0x2da891=normalizeBffType(_0x56a2ee[_0x1f1be3(0x142)]);if(!_0x2da891||!_0x56a2ee['functionName'])return null;if(_0x2da891==='HOOK'){const _0x829376=(_0x56a2ee['id']?_0x38310e['get'](_0x56a2ee['id']):undefined)??findHookLocationByRemoteId(_0x2dfe97,_0x56a2ee['id']);if(!_0x829376)return null;const _0x1a93da=_0x829376[_0x1f1be3(0x12e)]||_0x1a604e[_0x1f1be3(0x148)](_0x829376[_0x1f1be3(0x132)]),_0x206838=_0x1a93da??_0x829376[_0x1f1be3(0x132)],_0xcfb576={..._0x829376,'alias':_0x1a93da},_0x14b42e=_0x1f1be3(0x145)+_0x206838+'/'+_0xcfb576[_0x1f1be3(0x147)]+'/'+_0xcfb576[_0x1f1be3(0x126)]+'/'+_0x56a2ee['functionName'];return{'lockKey':_0x14b42e,'filePath':resolveLocalFilePathFromLockKey(_0x4dc5b8,_0x14b42e),'type':'HOOK','hookLocation':_0xcfb576};}const _0x581945=_0x2da891+'/'+_0x56a2ee['functionName'];return{'lockKey':_0x581945,'filePath':resolveLocalFilePathFromLockKey(_0x4dc5b8,_0x581945),'type':_0x2da891};}export async function ensureParentDirectory(_0x202897){await mkdir(dirname(_0x202897),{'recursive':!![]});}function a161_0xf6b5(_0x386cf8,_0x5a078b){_0x386cf8=_0x386cf8-0x120;const _0x36c5f5=a161_0x36c5();let _0xf6b5d2=_0x36c5f5[_0x386cf8];return _0xf6b5d2;}export async function fileExists(_0x3934d8){const _0x473ca3=a161_0x2d359d;try{return await access(_0x3934d8,constants[_0x473ca3(0x121)]),!![];}catch{return![];}}function a161_0x36c5(){const _0x1587f9=['split','endsWith','toUpperCase','isFile','scriptType','isDirectory','scriptsRootDir','HOOK/','9eBEyQr','operationType','get','824350FaUGKb','F_OK','replace','push','2575855JXldKE','all','functionNode','set','code','36XRBfUM','4243728IZKNXt','3186000ebUzAc','before','73610VIGPlH','alias','after','12QvqInW','name','datasetCode','afterScriptId','COMMON','beforeScriptId','.js','11640yASroK','34355376AvsXtG','map','ENOENT','trim','ENDPOINT','2954FjsFnv'];a161_0x36c5=function(){return _0x1587f9;};return a161_0x36c5();}export async function directoryExists(_0x4fe987){const _0x34bbe2=a161_0x2d359d;try{const _0xf62b15=await stat(_0x4fe987);return _0xf62b15[_0x34bbe2(0x143)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x541bb3,_0x1769d4){const _0x2b8732=a161_0x4642,_0x232c59=_0x541bb3();while(!![]){try{const _0x3a6886=parseInt(_0x2b8732(0x132))/0x1+parseInt(_0x2b8732(0x127))/0x2*(-parseInt(_0x2b8732(0x130))/0x3)+parseInt(_0x2b8732(0x125))/0x4*(parseInt(_0x2b8732(0x126))/0x5)+-parseInt(_0x2b8732(0x12c))/0x6*(-parseInt(_0x2b8732(0x12d))/0x7)+parseInt(_0x2b8732(0x133))/0x8*(parseInt(_0x2b8732(0x12b))/0x9)+-parseInt(_0x2b8732(0x12e))/0xa+-parseInt(_0x2b8732(0x129))/0xb;if(_0x3a6886===_0x1769d4)break;else _0x232c59['push'](_0x232c59['shift']());}catch(_0x1a3837){_0x232c59['push'](_0x232c59['shift']());}}}(a161_0x2899,0xbebde));import{readFile}from'node:fs/promises';import a161_0xded2d9 from'node:crypto';export function computeContentHash(_0x24699e){const _0x3a75c4=a161_0x4642;return a161_0xded2d9[_0x3a75c4(0x12a)]('md5')[_0x3a75c4(0x131)](_0x24699e)[_0x3a75c4(0x128)](_0x3a75c4(0x12f));}function a161_0x2899(){const _0x32e04e=['7423449PzMUbL','createHash','6543GQTJnP','54TVzoHL','804909YmrCyW','1913240WLiAtz','hex','3ANWVuQ','update','302315iwMALw','10952haWcxj','135896BCbcwi','50dSvmxG','2049480bvyVOL','digest'];a161_0x2899=function(){return _0x32e04e;};return a161_0x2899();}function a161_0x4642(_0x15b1d9,_0x48512c){_0x15b1d9=_0x15b1d9-0x125;const _0x2899f9=a161_0x2899();let _0x4642fd=_0x2899f9[_0x15b1d9];return _0x4642fd;}export async function computeFileHash(_0x3282e5){const _0x522bbd=await readFile(_0x3282e5,'utf8');return computeContentHash(_0x522bbd);}
1
+ (function(_0x2e9dfa,_0x5dce07){const _0x15ad81=a162_0x5bc4,_0x38c6a9=_0x2e9dfa();while(!![]){try{const _0x5c2bb0=parseInt(_0x15ad81(0xea))/0x1*(parseInt(_0x15ad81(0xf0))/0x2)+parseInt(_0x15ad81(0xeb))/0x3+-parseInt(_0x15ad81(0xe7))/0x4*(parseInt(_0x15ad81(0xf6))/0x5)+parseInt(_0x15ad81(0xee))/0x6*(parseInt(_0x15ad81(0xf4))/0x7)+parseInt(_0x15ad81(0xf1))/0x8*(-parseInt(_0x15ad81(0xf7))/0x9)+-parseInt(_0x15ad81(0xec))/0xa*(-parseInt(_0x15ad81(0xed))/0xb)+parseInt(_0x15ad81(0xe9))/0xc*(-parseInt(_0x15ad81(0xef))/0xd);if(_0x5c2bb0===_0x5dce07)break;else _0x38c6a9['push'](_0x38c6a9['shift']());}catch(_0x5280a1){_0x38c6a9['push'](_0x38c6a9['shift']());}}}(a162_0x2f27,0x68d79));function a162_0x5bc4(_0x2da335,_0x4c93fa){_0x2da335=_0x2da335-0xe7;const _0x2f27c1=a162_0x2f27();let _0x5bc49d=_0x2f27c1[_0x2da335];return _0x5bc49d;}import{readFile}from'node:fs/promises';function a162_0x2f27(){const _0x32cc08=['172704sifWBF','164006JtrvVx','1040850tYuHJD','270NxAIGO','283019oSHBSZ','18534NMXxOG','442KdSHXE','8dZRTUW','344792ndFsna','hex','createHash','805vEcudV','md5','717305NIImsR','117OgsqEZ','16fPTDTC','digest'];a162_0x2f27=function(){return _0x32cc08;};return a162_0x2f27();}import a162_0x3e7ca6 from'node:crypto';export function computeContentHash(_0x3cac85){const _0x450581=a162_0x5bc4;return a162_0x3e7ca6[_0x450581(0xf3)](_0x450581(0xf5))['update'](_0x3cac85)[_0x450581(0xe8)](_0x450581(0xf2));}export async function computeFileHash(_0x294542){const _0x24fd82=await readFile(_0x294542,'utf8');return computeContentHash(_0x24fd82);}
@@ -1 +1 @@
1
- (function(_0x127527,_0x41e5a4){const _0x2dd014=a162_0x558b,_0x5c5607=_0x127527();while(!![]){try{const _0x142fc2=-parseInt(_0x2dd014(0xb7))/0x1*(parseInt(_0x2dd014(0xb5))/0x2)+parseInt(_0x2dd014(0xb1))/0x3*(-parseInt(_0x2dd014(0xa4))/0x4)+-parseInt(_0x2dd014(0xab))/0x5+-parseInt(_0x2dd014(0xa2))/0x6+-parseInt(_0x2dd014(0xac))/0x7+parseInt(_0x2dd014(0xb6))/0x8*(-parseInt(_0x2dd014(0xa3))/0x9)+-parseInt(_0x2dd014(0xa5))/0xa*(-parseInt(_0x2dd014(0xa6))/0xb);if(_0x142fc2===_0x41e5a4)break;else _0x5c5607['push'](_0x5c5607['shift']());}catch(_0x2efb40){_0x5c5607['push'](_0x5c5607['shift']());}}}(a162_0x3a04,0xc9e42));function a162_0x558b(_0x7988d6,_0x32f85b){_0x7988d6=_0x7988d6-0xa2;const _0x3a04a7=a162_0x3a04();let _0x558b1c=_0x3a04a7[_0x7988d6];return _0x558b1c;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1e5414,_0x5180be,_0x5d1b47,_0x488ebb){const _0x5a3bbf=a162_0x558b,_0x59294a={'apps':_0x1e5414[_0x5a3bbf(0xae)]&&typeof _0x1e5414[_0x5a3bbf(0xae)]===_0x5a3bbf(0xa9)?_0x1e5414['apps']:{}};let _0x1c86f6=_0x59294a[_0x5a3bbf(0xae)][_0x5180be];if(!_0x1c86f6)return _0x1c86f6={'scriptsRoot':_0x5d1b47,'lastSync':'','functions':{}},_0x59294a[_0x5a3bbf(0xae)][_0x5180be]=_0x1c86f6,{'lockData':_0x59294a,'appLock':_0x1c86f6};if(!_0x1c86f6[_0x5a3bbf(0xb2)])_0x1c86f6[_0x5a3bbf(0xb2)]=_0x5d1b47;else{if(_0x1c86f6['scriptsRoot']!==_0x5d1b47)throw new Error(_0x488ebb+_0x5a3bbf(0xa8)+(_0x5a3bbf(0xad)+_0x5d1b47+_0x5a3bbf(0xb4)+_0x1c86f6[_0x5a3bbf(0xb2)]+'\x22.\x20')+_0x5a3bbf(0xb0));}return!_0x1c86f6['functions']&&(_0x1c86f6['functions']={}),!_0x1c86f6[_0x5a3bbf(0xaa)]&&(_0x1c86f6['lastSync']=''),{'lockData':_0x59294a,'appLock':_0x1c86f6};}export async function readBffLockFile(_0x131493){const _0x3645e8=a162_0x558b;try{const _0x46e16b=await readFile(_0x131493,_0x3645e8(0xa7)),_0x1045f7=JSON['parse'](_0x46e16b);return{'apps':_0x1045f7[_0x3645e8(0xae)]&&typeof _0x1045f7[_0x3645e8(0xae)]==='object'?_0x1045f7[_0x3645e8(0xae)]:{}};}catch(_0x2ef024){if(_0x2ef024['code']===_0x3645e8(0xaf))return null;throw new Error(_0x3645e8(0xb3)+String(_0x2ef024));}}function a162_0x3a04(){const _0x36126b=['9xeVPAI','89444WvLYvA','59088430JaNcqy','11QCKeNI','utf8',':\x20scriptsRoot\x20mismatch\x20—\x20','object','lastSync','4777145laWkEM','10646174QcUiXx','current\x20\x22','apps','ENOENT','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','111OKXwZb','scriptsRoot','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','198kDfsPL','1504720LfwaVB','1899lVqMYz','stringify','8412828qdtruB'];a162_0x3a04=function(){return _0x36126b;};return a162_0x3a04();}export async function writeBffLockFile(_0x2783a9,_0x1993ee){const _0x359c3d=a162_0x558b;await mkdir(dirname(_0x2783a9),{'recursive':!![]}),await writeFile(_0x2783a9,JSON[_0x359c3d(0xb8)](_0x1993ee,null,0x2),_0x359c3d(0xa7));}
1
+ (function(_0x47e0b0,_0x573092){const _0x2063d7=a163_0x1134,_0x4cbd04=_0x47e0b0();while(!![]){try{const _0xe8736a=-parseInt(_0x2063d7(0x110))/0x1*(parseInt(_0x2063d7(0x128))/0x2)+parseInt(_0x2063d7(0x11b))/0x3*(parseInt(_0x2063d7(0x129))/0x4)+-parseInt(_0x2063d7(0x124))/0x5+parseInt(_0x2063d7(0x115))/0x6*(-parseInt(_0x2063d7(0x117))/0x7)+parseInt(_0x2063d7(0x122))/0x8+-parseInt(_0x2063d7(0x114))/0x9*(-parseInt(_0x2063d7(0x111))/0xa)+-parseInt(_0x2063d7(0x125))/0xb*(-parseInt(_0x2063d7(0x113))/0xc);if(_0xe8736a===_0x573092)break;else _0x4cbd04['push'](_0x4cbd04['shift']());}catch(_0x4413ce){_0x4cbd04['push'](_0x4cbd04['shift']());}}}(a163_0x2f57,0x9d27c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a163_0x2f57(){const _0x390707=['parse','742TfbLMU','10hGBWHv','stringify','1068KoaEuY','6749469xTPXWI','348tlgUrx','\x22\x20vs\x20lock\x20\x22','141715HBfeqx','utf8','functions','scriptsRoot','256188yALrwF','lastSync','apps','current\x20\x22',':\x20scriptsRoot\x20mismatch\x20—\x20','\x22.\x20','object','191944JtYQVH','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1678665uKnlTv','196207jneDiN','code','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','3092FqPBhO','44JYxGuc'];a163_0x2f57=function(){return _0x390707;};return a163_0x2f57();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x13c5f8,_0x52c008,_0x4f3b28,_0x49d30b){const _0x4e0ef9=a163_0x1134,_0x288607={'apps':_0x13c5f8[_0x4e0ef9(0x11d)]&&typeof _0x13c5f8[_0x4e0ef9(0x11d)]===_0x4e0ef9(0x121)?_0x13c5f8[_0x4e0ef9(0x11d)]:{}};let _0x23780f=_0x288607[_0x4e0ef9(0x11d)][_0x52c008];if(!_0x23780f)return _0x23780f={'scriptsRoot':_0x4f3b28,'lastSync':'','functions':{}},_0x288607[_0x4e0ef9(0x11d)][_0x52c008]=_0x23780f,{'lockData':_0x288607,'appLock':_0x23780f};if(!_0x23780f[_0x4e0ef9(0x11a)])_0x23780f[_0x4e0ef9(0x11a)]=_0x4f3b28;else{if(_0x23780f[_0x4e0ef9(0x11a)]!==_0x4f3b28)throw new Error(_0x49d30b+_0x4e0ef9(0x11f)+(_0x4e0ef9(0x11e)+_0x4f3b28+_0x4e0ef9(0x116)+_0x23780f[_0x4e0ef9(0x11a)]+_0x4e0ef9(0x120))+_0x4e0ef9(0x123));}return!_0x23780f['functions']&&(_0x23780f[_0x4e0ef9(0x119)]={}),!_0x23780f[_0x4e0ef9(0x11c)]&&(_0x23780f[_0x4e0ef9(0x11c)]=''),{'lockData':_0x288607,'appLock':_0x23780f};}export async function readBffLockFile(_0x339b80){const _0x43a472=a163_0x1134;try{const _0x54d5d1=await readFile(_0x339b80,_0x43a472(0x118)),_0x32ac5a=JSON[_0x43a472(0x10f)](_0x54d5d1);return{'apps':_0x32ac5a[_0x43a472(0x11d)]&&typeof _0x32ac5a[_0x43a472(0x11d)]===_0x43a472(0x121)?_0x32ac5a[_0x43a472(0x11d)]:{}};}catch(_0x23c2e5){if(_0x23c2e5[_0x43a472(0x126)]==='ENOENT')return null;throw new Error(_0x43a472(0x127)+String(_0x23c2e5));}}function a163_0x1134(_0xc818a,_0x4fb5b3){_0xc818a=_0xc818a-0x10f;const _0x2f57f7=a163_0x2f57();let _0x1134c1=_0x2f57f7[_0xc818a];return _0x1134c1;}export async function writeBffLockFile(_0x548e5d,_0x15f2cd){const _0x17effa=a163_0x1134;await mkdir(dirname(_0x548e5d),{'recursive':!![]}),await writeFile(_0x548e5d,JSON[_0x17effa(0x112)](_0x15f2cd,null,0x2),'utf8');}