@lovrabet/rabetbase-cli 2.2.4-beta.6 → 2.2.4

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 (209) 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/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/list.js +1 -1
  87. package/lib/commands/menu/shared/compare-table.js +1 -1
  88. package/lib/commands/menu/shared/index.js +1 -1
  89. package/lib/commands/menu/shared/inquirer.js +1 -1
  90. package/lib/commands/menu/shared/local-pages.js +1 -1
  91. package/lib/commands/menu/shared/logic.js +1 -1
  92. package/lib/commands/menu/shared/service.js +1 -1
  93. package/lib/commands/menu/shared/sync-core.js +1 -1
  94. package/lib/commands/menu/shared/update-core.js +1 -1
  95. package/lib/commands/menu/shared/valid-url.js +1 -1
  96. package/lib/commands/menu/sync.js +1 -1
  97. package/lib/commands/menu/update.js +1 -1
  98. package/lib/commands/page/generate-start.js +1 -1
  99. package/lib/commands/page/generate-status.js +1 -1
  100. package/lib/commands/page/index.js +1 -1
  101. package/lib/commands/page/pull.js +1 -1
  102. package/lib/commands/page/push.js +1 -1
  103. package/lib/commands/page/relation-audit.js +1 -1
  104. package/lib/commands/page/shared.js +1 -1
  105. package/lib/commands/page/standard-page-status.js +1 -1
  106. package/lib/commands/page/sync.js +1 -1
  107. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  108. package/lib/commands/project/create/format-elapsed.js +1 -1
  109. package/lib/commands/project/create/main.js +1 -1
  110. package/lib/commands/project/create/non-interactive.js +1 -1
  111. package/lib/commands/project/create/project-template-path.js +1 -1
  112. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  113. package/lib/commands/project/create/use-format-code.js +1 -1
  114. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  115. package/lib/commands/project/index.js +1 -1
  116. package/lib/commands/project/init.js +1 -1
  117. package/lib/commands/project/upgrade.js +1 -1
  118. package/lib/commands/registry.js +1 -1
  119. package/lib/commands/run/index.js +1 -1
  120. package/lib/commands/schema.js +1 -1
  121. package/lib/commands/skill/index.js +1 -1
  122. package/lib/commands/sql/create.js +1 -1
  123. package/lib/commands/sql/delete.js +1 -1
  124. package/lib/commands/sql/detail.js +1 -1
  125. package/lib/commands/sql/exec.js +1 -1
  126. package/lib/commands/sql/index.js +1 -1
  127. package/lib/commands/sql/list.js +1 -1
  128. package/lib/commands/sql/pull.js +1 -1
  129. package/lib/commands/sql/push.js +1 -1
  130. package/lib/commands/sql/save.js +1 -1
  131. package/lib/commands/sql/shared.js +1 -1
  132. package/lib/commands/sql/status.js +1 -1
  133. package/lib/commands/sql/validate.js +1 -1
  134. package/lib/commands/workspace/index.js +1 -1
  135. package/lib/config/schema.js +1 -1
  136. package/lib/constant/cdn.js +1 -1
  137. package/lib/constant/cli.js +1 -1
  138. package/lib/constant/defaults.js +1 -1
  139. package/lib/constant/domain.js +1 -1
  140. package/lib/constant/env.js +1 -1
  141. package/lib/constant/output.js +1 -1
  142. package/lib/constant/paths.js +1 -1
  143. package/lib/constant/risk.js +1 -1
  144. package/lib/context/app-resolver.js +1 -1
  145. package/lib/context/auth-resolver.js +1 -1
  146. package/lib/context/config-loader.js +1 -1
  147. package/lib/context.js +1 -1
  148. package/lib/core/alias-resolver.js +1 -1
  149. package/lib/core/api-client.js +1 -1
  150. package/lib/core/bff/config.js +1 -1
  151. package/lib/core/bff/file-system.js +1 -1
  152. package/lib/core/bff/hash.js +1 -1
  153. package/lib/core/bff/lock.js +1 -1
  154. package/lib/core/bff/utils.js +1 -1
  155. package/lib/core/db-resolver.js +1 -1
  156. package/lib/core/page/file-system.js +1 -1
  157. package/lib/core/page/hash.js +1 -1
  158. package/lib/core/page/lock.js +1 -1
  159. package/lib/core/sql-sync/config.js +1 -1
  160. package/lib/core/sql-sync/file-system.js +1 -1
  161. package/lib/core/sql-sync/hash.js +1 -1
  162. package/lib/core/sql-sync/lock.js +1 -1
  163. package/lib/core/sql-sync/utils.js +1 -1
  164. package/lib/core/sql-validator.js +1 -1
  165. package/lib/errors.js +1 -1
  166. package/lib/framework/build-all-flags.js +1 -1
  167. package/lib/framework/flags.js +1 -1
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.js +1 -1
  170. package/lib/framework/output.js +1 -1
  171. package/lib/framework/response.js +1 -1
  172. package/lib/framework/runner-alias.js +1 -1
  173. package/lib/framework/runner.js +1 -1
  174. package/lib/framework/schema-export.js +1 -1
  175. package/lib/framework/types.js +1 -1
  176. package/lib/generated/build-info.js +1 -1
  177. package/lib/help.js +1 -1
  178. package/lib/skills/main.js +1 -1
  179. package/lib/skills/npx-skills-add.js +1 -1
  180. package/lib/telemetry/cli-command-trace.js +1 -1
  181. package/lib/telemetry/cli-help-trace.js +1 -1
  182. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  183. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  184. package/lib/telemetry/send-cli-trace-log.js +1 -1
  185. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  186. package/lib/utils/ai_config.js +1 -1
  187. package/lib/utils/apply-jq-filter.js +1 -1
  188. package/lib/utils/cdn-config.js +1 -1
  189. package/lib/utils/check-sdk-version.js +1 -1
  190. package/lib/utils/cli-version-check.js +1 -1
  191. package/lib/utils/cli-version-policy.js +1 -1
  192. package/lib/utils/config.js +1 -1
  193. package/lib/utils/copy-directory.js +1 -1
  194. package/lib/utils/entity-with-id.js +1 -1
  195. package/lib/utils/file-utils.js +1 -1
  196. package/lib/utils/guides-cdn.js +1 -1
  197. package/lib/utils/http-client.js +1 -1
  198. package/lib/utils/is-non-interactive.js +1 -1
  199. package/lib/utils/logger.js +1 -1
  200. package/lib/utils/params.js +1 -1
  201. package/lib/utils/platform.js +1 -1
  202. package/lib/utils/rules-cdn.js +1 -1
  203. package/lib/utils/sleep.js +1 -1
  204. package/lib/utils/template-replacer.js +1 -1
  205. package/lib/utils/update-notice.js +1 -1
  206. package/lib/utils/version.js +1 -1
  207. package/lib/utils/with-active-cookie.js +1 -1
  208. package/lib/utils/write-cli-side-channel.js +1 -1
  209. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x24ebc6,_0x176640){const _0x90663b=a149_0xfb13,_0xfc2ce2=_0x24ebc6();while(!![]){try{const _0x4a5155=parseInt(_0x90663b(0x1aa))/0x1+-parseInt(_0x90663b(0x18e))/0x2*(-parseInt(_0x90663b(0x1b8))/0x3)+-parseInt(_0x90663b(0x159))/0x4+parseInt(_0x90663b(0x1f3))/0x5*(-parseInt(_0x90663b(0x1f2))/0x6)+parseInt(_0x90663b(0x1b4))/0x7*(parseInt(_0x90663b(0x158))/0x8)+parseInt(_0x90663b(0x1db))/0x9+parseInt(_0x90663b(0x15a))/0xa*(parseInt(_0x90663b(0x167))/0xb);if(_0x4a5155===_0x176640)break;else _0xfc2ce2['push'](_0xfc2ce2['shift']());}catch(_0x4470b3){_0xfc2ce2['push'](_0xfc2ce2['shift']());}}}(a149_0xd449,0xb4606));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';function a149_0xfb13(_0x3502be,_0x45c54d){_0x3502be=_0x3502be-0x156;const _0xd44999=a149_0xd449();let _0xfb1399=_0xd44999[_0x3502be];return _0xfb1399;}import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x4b05c2){_activeCookie=_0x4b05c2||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x52df0f,_0x17e4ff){const _0x501a34=a149_0xfb13,_0x35f1c7=_0x17e4ff instanceof Error?_0x17e4ff[_0x501a34(0x1b7)]:String(_0x17e4ff);return CliErrors[_0x501a34(0x1ca)](_0x501a34(0x1cd)+_0x52df0f+(_0x35f1c7?'\x20('+_0x35f1c7+')':''),_0x501a34(0x1d7));}async function apiRequest(_0x38eed1,_0x201f99={}){const _0x30bf01=a149_0xfb13,{method:method='GET',body:_0x32178b,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x201f99,_0x531b74=useRuntime?getRuntimeDomain():getApiDomain(),_0x3e36ed=_activeCookie||getCookie(),_0x2c57a7=''+_0x531b74+_0x38eed1,_0x7c64d4=new AbortController(),_0x44a5d4=setTimeout(()=>_0x7c64d4['abort'](),timeout);try{const _0x2a05d0=await fetch(_0x2c57a7,{'method':method,'headers':{'Content-Type':_0x30bf01(0x1b0),'Cookie':_0x3e36ed,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x32178b?JSON['stringify'](_0x32178b):undefined,'signal':_0x7c64d4['signal']});let _0x20875f;try{_0x20875f=await _0x2a05d0[_0x30bf01(0x1a9)]();}catch{if(_0x2a05d0['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x30bf01(0x1ca)](_0x30bf01(0x1eb)+_0x2a05d0[_0x30bf01(0x1b3)]+')',_0x2a05d0[_0x30bf01(0x1b3)]>=0x190?_0x30bf01(0x1e8):undefined);}if(!_0x2a05d0['ok']||_0x20875f[_0x30bf01(0x1a3)]===![])throw CliErrors[_0x30bf01(0x1ca)](_0x20875f[_0x30bf01(0x16d)]||_0x20875f[_0x30bf01(0x1b7)]||_0x30bf01(0x1e6)+_0x2a05d0[_0x30bf01(0x1b3)],_0x20875f[_0x30bf01(0x1d9)]?'API\x20error\x20code:\x20'+_0x20875f[_0x30bf01(0x1d9)]:undefined);return _0x20875f;}catch(_0x55ec2f){if(_0x55ec2f instanceof CliError)throw _0x55ec2f;if(_0x55ec2f instanceof Error&&_0x55ec2f['name']===_0x30bf01(0x1d5))throw CliErrors['apiError'](_0x30bf01(0x160)+_0x2c57a7);throw createFetchFailureError(_0x2c57a7,_0x55ec2f);}finally{clearTimeout(_0x44a5d4);}}function isAuthFailure(_0xe721ca){const _0x1c73bf=a149_0xfb13,_0x2bfe5e=_0xe721ca[_0x1c73bf(0x16d)]||_0xe721ca['message']||_0xe721ca[_0x1c73bf(0x166)]?.['message']||_0xe721ca['errorMessage']||_0xe721ca[_0x1c73bf(0x1dd)]||'';return _0xe721ca[_0x1c73bf(0x1d9)]===_0x1c73bf(0x19e)||_0xe721ca[_0x1c73bf(0x199)]===0x191||_0xe721ca['code']===_0x1c73bf(0x1ea)||_0x2bfe5e[_0x1c73bf(0x191)]('401')||_0x2bfe5e[_0x1c73bf(0x191)](_0x1c73bf(0x19f))||_0x2bfe5e[_0x1c73bf(0x191)]('登录')||_0x2bfe5e['includes']('认证');}export async function platformFetch(_0x29244f,_0x598669){const _0x57c448=a149_0xfb13;let _0x10d052;try{_0x10d052=await fetch(_0x29244f,{'method':_0x598669[_0x57c448(0x16c)]??'GET','headers':{'Content-Type':_0x57c448(0x1b0),'Cookie':_0x598669['cookie'],'X-Invoke-Source':_0x57c448(0x1c5)},..._0x598669[_0x57c448(0x1c8)]&&{'body':JSON['stringify'](_0x598669['body'])}});}catch(_0x4b690c){throw createFetchFailureError(_0x29244f,_0x4b690c);}if(!_0x10d052['ok']){if(_0x10d052[_0x57c448(0x1b3)]===0x191)throw CliErrors[_0x57c448(0x1c6)]();throw CliErrors[_0x57c448(0x1ca)](_0x598669[_0x57c448(0x18d)]+'\x20failed,\x20HTTP\x20'+_0x10d052[_0x57c448(0x1b3)]);}const _0xa95d33=await _0x10d052['json']();if(_0xa95d33[_0x57c448(0x1a3)]===![]){if(isAuthFailure(_0xa95d33))throw CliErrors[_0x57c448(0x1c6)]();throw CliErrors[_0x57c448(0x1ca)](_0xa95d33[_0x57c448(0x16d)]||_0xa95d33[_0x57c448(0x1b7)]||_0x598669[_0x57c448(0x18d)]+_0x57c448(0x18c));}return _0xa95d33[_0x57c448(0x166)];}export async function listBffScripts(_0x28fc06,_0x338daa,_0x1f79e8){const _0x2dc52b=a149_0xfb13;let _0x5bf7d5='/api/management/library/scripts/list?appCode='+_0x28fc06;if(_0x338daa)_0x5bf7d5+=_0x2dc52b(0x1e4)+_0x338daa;const _0x1032ed=await apiRequest(_0x5bf7d5);let _0x2ded3e=extractList(_0x1032ed['data']);if(_0x1f79e8?.[_0x2dc52b(0x169)]){const _0x4d9c52=_0x1f79e8['scriptName'][_0x2dc52b(0x1f4)]();_0x2ded3e=_0x2ded3e[_0x2dc52b(0x1f1)](_0x53bc4a=>_0x53bc4a[_0x2dc52b(0x17a)]?.[_0x2dc52b(0x1f4)]()[_0x2dc52b(0x191)](_0x4d9c52)||_0x53bc4a[_0x2dc52b(0x161)]?.[_0x2dc52b(0x1f4)]()[_0x2dc52b(0x191)](_0x4d9c52));}return _0x2ded3e;}export async function getBffScriptInfo(_0x2cee46){const _0x4be71c=a149_0xfb13,_0x5d6faa=await apiRequest(_0x4be71c(0x1da)+_0x2cee46);if(!_0x5d6faa[_0x4be71c(0x166)])throw CliErrors[_0x4be71c(0x190)]('BFF\x20script\x20not\x20found:\x20id='+_0x2cee46);return _0x5d6faa[_0x4be71c(0x166)];}export async function saveBffScript(_0x180ad0){const _0x544b8d=a149_0xfb13,_0x4357b9=await apiRequest('/api/management/library/scripts/save',{'method':_0x544b8d(0x187),'body':_0x180ad0}),{id:_0x4774e7,entity:_0x378b5}=normalizeEntityWithIdResponse(_0x4357b9[_0x544b8d(0x166)]);if(_0x4774e7!==undefined){const _0x294d0c=typeof _0x378b5[_0x544b8d(0x17a)]===_0x544b8d(0x1d1)||typeof _0x378b5[_0x544b8d(0x19c)]==='string'?_0x378b5:undefined;return{'id':_0x4774e7,'script':_0x294d0c};}throw CliErrors['apiError'](_0x544b8d(0x172));}export async function deleteBffScript(_0x1be6ed){const _0x2104ae=a149_0xfb13;await apiRequest(_0x2104ae(0x1cf),{'method':_0x2104ae(0x187),'body':{'id':_0x1be6ed}});}export async function getBffScriptStatistics(_0x2a1c24){const _0x16508c=a149_0xfb13,_0x141390=await apiRequest(_0x16508c(0x1e3)+_0x2a1c24);return extractList(_0x141390['data']);}export async function clearBffScriptCache(){const _0x590b66=a149_0xfb13,_0x727f1a=await apiRequest(_0x590b66(0x178),{'method':_0x590b66(0x187),'useRuntime':!![]});return typeof _0x727f1a[_0x590b66(0x166)]===_0x590b66(0x1d1)?_0x727f1a[_0x590b66(0x166)]:'';}export async function listBffDatasetOperations(_0x2ee28a,_0x48c7c0){const _0x51c9d5=a149_0xfb13,_0x52b0a7=await apiRequest(_0x51c9d5(0x19d),{'method':'POST','body':{'appCode':_0x2ee28a,'datasetId':_0x48c7c0}});return _0x52b0a7[_0x51c9d5(0x166)];}export async function listSqlQueries(_0x279c5c,_0x49c5d1){const _0x123ad5=a149_0xfb13,_0x20962e=await apiRequest(_0x123ad5(0x1af),{'method':_0x123ad5(0x187),'body':{'appCode':_0x279c5c,'currentPage':_0x49c5d1?.[_0x123ad5(0x1c7)]??0x1,'pageSize':_0x49c5d1?.[_0x123ad5(0x1fc)]??0x32,'sqlCode':_0x49c5d1?.[_0x123ad5(0x1ae)],'sqlName':_0x49c5d1?.[_0x123ad5(0x193)]}});return _0x20962e[_0x123ad5(0x166)];}export async function getSqlQueryInfo(_0x4d4f00,_0x1a9263){const _0x356244=a149_0xfb13,_0x49e1c7=await listSqlQueries(_0x4d4f00,{'sqlCode':_0x1a9263}),_0x249e20=_0x49e1c7[_0x356244(0x17d)]?.[0x0];if(!_0x249e20)throw CliErrors['validation'](_0x356244(0x16a)+_0x1a9263);return _0x249e20;}export async function getSqlQueryDetail(_0x4dfb7c){const _0x47e366=a149_0xfb13,_0x7f2060=await apiRequest(_0x47e366(0x173)+(_0x47e366(0x1a7)+encodeURIComponent(_0x4dfb7c)));if(!_0x7f2060['data'])throw CliErrors[_0x47e366(0x190)](_0x47e366(0x16a)+_0x4dfb7c);return _0x7f2060['data'];}export async function getSqlQueryDetailById(_0x1b27a1){const _0x292327=a149_0xfb13,_0x3cf0a3=await apiRequest(_0x292327(0x1cb)+_0x1b27a1);if(!_0x3cf0a3[_0x292327(0x166)])throw CliErrors[_0x292327(0x190)](_0x292327(0x15e)+_0x1b27a1);return _0x3cf0a3[_0x292327(0x166)];}export async function createSqlQuery(_0x24f657){const _0x1a1a6c=a149_0xfb13,_0x200509=await apiRequest(_0x1a1a6c(0x1ec),{'method':_0x1a1a6c(0x187),'body':_0x24f657}),{id:_0x111223,entity:_0x25e76d}=normalizeEntityWithIdResponse(_0x200509['data']);if(!(_0x1a1a6c(0x1ae)in _0x25e76d)&&_0x111223)return getSqlQueryDetailById(_0x111223);return normalizeSqlQueryEntity(_0x25e76d);}export async function updateSqlQuery(_0x45ff7a){const _0x529f5f=a149_0xfb13,_0x47ddc1=await apiRequest(_0x529f5f(0x1fb),{'method':_0x529f5f(0x187),'body':_0x45ff7a}),{id:_0x211134,entity:_0x5cf164}=normalizeEntityWithIdResponse(_0x47ddc1[_0x529f5f(0x166)]);if(!(_0x529f5f(0x1ae)in _0x5cf164)){if(_0x45ff7a[_0x529f5f(0x1ae)])return getSqlQueryDetail(_0x45ff7a[_0x529f5f(0x1ae)]);if(_0x211134)return getSqlQueryDetailById(_0x211134);}return normalizeSqlQueryEntity(_0x5cf164);}export async function deleteSqlQuery(_0x5219e8){const _0x3d5523=a149_0xfb13;await apiRequest(_0x3d5523(0x1f8),{'method':_0x3d5523(0x187),'body':_0x5219e8});}export async function saveSqlQuery(_0x22376a){const _0x173756=a149_0xfb13,_0x1ca496=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x173756(0x187),'body':_0x22376a});return _0x1ca496[_0x173756(0x166)];}function normalizeSqlQueryEntity(_0x485279){const _0x4ec3b3=a149_0xfb13;return{..._0x485279,'id':Number(_0x485279['id']),'dbId':_0x485279[_0x4ec3b3(0x1ed)]==null?undefined:Number(_0x485279['dbId']),'version':_0x485279[_0x4ec3b3(0x165)]==null?undefined:Number(_0x485279['version'])};}export async function executeSql(_0xb9b733,_0x36a044,_0x2ff5ae){const _0x37d3da=a149_0xfb13,_0x3e4212=await apiRequest(_0x37d3da(0x1ab),{'method':_0x37d3da(0x187),'body':{'appCode':_0xb9b733,'sqlCode':_0x36a044,..._0x2ff5ae&&{'params':_0x2ff5ae}},'useRuntime':!![]});return _0x3e4212[_0x37d3da(0x166)];}export async function executeDatasetDataOperation(_0x30ecaa,_0x4c99b8,_0x1afe17,_0x3f1394={}){const _0x2de7a9=a149_0xfb13;try{const _0x157785=await apiRequest(_0x2de7a9(0x15c)+_0x30ecaa+'/'+_0x4c99b8+'/'+_0x1afe17,{'method':_0x2de7a9(0x187),'body':_0x3f1394,'useRuntime':!![]});return _0x157785[_0x2de7a9(0x166)];}catch(_0x5b59ce){if(_0x1afe17===_0x2de7a9(0x1ef)&&_0x5b59ce instanceof CliError&&_0x5b59ce[_0x2de7a9(0x199)]==='api_error'&&_0x3f1394['id']!==undefined&&_0x3f1394['id']!==null&&_0x3f1394['id']!==''){const _0x23f26c=await apiRequest('/api/'+_0x30ecaa+'/'+_0x4c99b8+'/filter',{'method':_0x2de7a9(0x187),'body':{'where':{'id':{'$eq':_0x3f1394['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2dbdfb=Array[_0x2de7a9(0x1a0)](_0x23f26c[_0x2de7a9(0x166)]?.[_0x2de7a9(0x17d)])?_0x23f26c[_0x2de7a9(0x166)][_0x2de7a9(0x17d)]:[];return _0x2dbdfb[0x0]??null;}throw _0x5b59ce;}}export async function listDatasets(_0x4da441,_0x458c6f){const _0x194de9=a149_0xfb13,_0x3b4d0a={'appCode':_0x4da441,'deleted':![]};if(_0x458c6f?.[_0x194de9(0x199)])_0x3b4d0a[_0x194de9(0x199)]=_0x458c6f['code'];if(_0x458c6f?.['name'])_0x3b4d0a['name']=_0x458c6f[_0x194de9(0x1ba)];const _0x3326cb=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x194de9(0x187),'body':_0x3b4d0a});return extractList(_0x3326cb['data']);}export async function deleteDataset(_0x5ee688,_0x5f579a){await apiRequest('/smartapi/dataset/delete-dataset',{'method':'POST','body':{'appCode':_0x5ee688,'datasetId':_0x5f579a}});}export async function searchDatasets(_0x3c25dd,_0x387b95){const _0x5ec93a=a149_0xfb13,_0x64d92=await listDatasets(_0x3c25dd,{'name':_0x387b95}),_0x49af7b=_0x387b95[_0x5ec93a(0x1f4)](),_0x57d1e5=new Set(_0x64d92[_0x5ec93a(0x192)](_0xc429fb=>_0xc429fb['id'])),_0x400a48=_0x64d92['filter'](_0x1e152e=>_0x1e152e[_0x5ec93a(0x1e5)]?.['tableName']?.[_0x5ec93a(0x1f4)]()[_0x5ec93a(0x191)](_0x49af7b)||_0x1e152e[_0x5ec93a(0x161)]?.['toLowerCase']()[_0x5ec93a(0x191)](_0x49af7b)),_0x36449f=await listDatasets(_0x3c25dd,{'code':_0x387b95});for(const _0x1b3d3c of _0x36449f){!_0x57d1e5[_0x5ec93a(0x18b)](_0x1b3d3c['id'])&&(_0x64d92[_0x5ec93a(0x1fa)](_0x1b3d3c),_0x57d1e5[_0x5ec93a(0x1e7)](_0x1b3d3c['id']));}return _0x64d92;}export function normalizeDatasetOperations(_0x771313){const _0x3fd96b=a149_0xfb13;if(Array[_0x3fd96b(0x1a0)](_0x771313))return _0x771313[_0x3fd96b(0x1f1)](_0x492bb8=>_0x492bb8!=null&&typeof _0x492bb8===_0x3fd96b(0x1e0));if(_0x771313&&typeof _0x771313===_0x3fd96b(0x1e0))return Object[_0x3fd96b(0x19a)](_0x771313)[_0x3fd96b(0x1f1)](([,_0x5c4f07])=>_0x5c4f07!=null&&typeof _0x5c4f07===_0x3fd96b(0x1e0))[_0x3fd96b(0x192)](([_0x321c5c,_0x51263b])=>({..._0x51263b,'name':_0x51263b['name']??_0x51263b[_0x3fd96b(0x16b)]??_0x321c5c}));return[];}export async function getDatasetDetail(_0x4f5e4f){const _0x5a72aa=a149_0xfb13,_0x435b76=/^\d+$/[_0x5a72aa(0x162)](_0x4f5e4f)?'id':_0x5a72aa(0x199),_0x4f150b=await apiRequest(_0x5a72aa(0x1d4)+_0x435b76+'='+_0x4f5e4f);return _0x4f150b[_0x5a72aa(0x166)];}export async function updateDrivenData(_0x374f7d){const _0x4a7d39=a149_0xfb13,_0x20c450=await apiRequest(_0x4a7d39(0x1d0),{'method':'POST','body':_0x374f7d});return _0x20c450[_0x4a7d39(0x166)];}export async function getDatasetOperations(_0x3b76b0){const _0x5654f4=a149_0xfb13,_0x596f04=await getDatasetDetail(_0x3b76b0),_0x5accfb=normalizeDatasetOperations(_0x596f04[_0x5654f4(0x198)])[_0x5654f4(0x192)](_0x1bc116=>({'name':_0x1bc116[_0x5654f4(0x1ba)]||_0x1bc116[_0x5654f4(0x16b)],'displayName':_0x1bc116[_0x5654f4(0x17f)]||_0x1bc116['name'],'type':_0x1bc116[_0x5654f4(0x1d3)],'method':_0x1bc116[_0x5654f4(0x16c)],'path':_0x1bc116['path'],'enabled':_0x1bc116[_0x5654f4(0x1c4)]??!![],'requestFields':_0x1bc116[_0x5654f4(0x1c3)],'responseFields':_0x1bc116['responseFields']}));return{'dataset':{'id':_0x596f04['id']??_0x596f04['modelId'],'name':_0x596f04[_0x5654f4(0x1ba)],'code':_0x596f04[_0x5654f4(0x199)]||_0x596f04[_0x5654f4(0x17b)],'tableName':_0x596f04['tableName']||_0x596f04[_0x5654f4(0x1e5)]?.['tableName']},'operations':_0x5accfb};}export async function getOperationDetail(_0x4edaac,_0xa26990,_0x40d035){const _0x555659=a149_0xfb13;let _0x5270dd=_0xa26990;if(!/^\d+$/[_0x555659(0x162)](_0xa26990)){const _0x4a932a=await listDatasets(_0x4edaac,{'code':_0xa26990}),_0x2d0b3a=_0x4a932a[_0x555659(0x18f)](_0x5dcacf=>_0x5dcacf['code']===_0xa26990||String(_0x5dcacf['id'])===_0xa26990);if(!_0x2d0b3a)throw CliErrors[_0x555659(0x190)]('Dataset\x20not\x20found:\x20'+_0xa26990);_0x5270dd=String(_0x2d0b3a['id']);}const _0x21ad64=await getDatasetDetail(_0x5270dd),_0x177c63=normalizeDatasetOperations(_0x21ad64['operations'])['find'](_0x21a30e=>(_0x21a30e[_0x555659(0x1ba)]||_0x21a30e['operationName'])===_0x40d035);if(!_0x177c63)throw CliErrors['validation'](_0x555659(0x16f)+_0x40d035+_0x555659(0x1de)+_0xa26990);return{'dataset':{'id':_0x21ad64['id']??_0x21ad64[_0x555659(0x196)],'name':_0x21ad64[_0x555659(0x1ba)],'code':_0x21ad64[_0x555659(0x199)]||_0x21ad64[_0x555659(0x17b)],'tableName':_0x21ad64[_0x555659(0x1a2)]||_0x21ad64['dbtableConfig']?.[_0x555659(0x1a2)]},'operation':_0x177c63};}export async function startGenerateStandardPages(_0x594230,_0x16ef2b,_0x4eef06){const _0x444612=a149_0xfb13,_0x31a9d5=await apiRequest('/smartapi/lovrabet/dataset/'+_0x16ef2b+_0x444612(0x1a4),{'method':_0x444612(0x187),'body':{'appCode':_0x594230,..._0x4eef06?.[_0x444612(0x17e)]?{'clientOperationId':_0x4eef06[_0x444612(0x17e)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x31a9d5[_0x444612(0x166)];}export async function getGenerateStandardPagesStatus(_0x3b1dc1,_0x60f5cc,_0x4265d5){const _0x35d892=a149_0xfb13,_0x585f58=new URLSearchParams({'appCode':_0x3b1dc1});_0x4265d5[_0x35d892(0x1a5)]&&_0x585f58['set'](_0x35d892(0x1a5),_0x4265d5[_0x35d892(0x1a5)]);_0x4265d5[_0x35d892(0x17e)]&&_0x585f58['set'](_0x35d892(0x17e),_0x4265d5['clientOperationId']);const _0x4a4f26=await apiRequest(_0x35d892(0x1c9)+_0x60f5cc+_0x35d892(0x1b1)+_0x585f58[_0x35d892(0x182)]());return _0x4a4f26[_0x35d892(0x166)];}export async function getStandardPageStatus(_0x435c7d,_0x308582){const _0x5181c2=a149_0xfb13,_0x350bea=await apiRequest(_0x5181c2(0x1c9)+_0x308582+_0x5181c2(0x176)+encodeURIComponent(_0x435c7d));return _0x350bea[_0x5181c2(0x166)];}export async function tryGetStandardPageStatus(_0xd6bc5,_0x2e5261){const _0x1bda76=a149_0xfb13;try{return await getStandardPageStatus(_0xd6bc5,_0x2e5261);}catch(_0x2eb491){if(_0x2eb491 instanceof CliError&&_0x2eb491[_0x1bda76(0x199)]==='api_error'&&/404|not found|non-json response/i[_0x1bda76(0x162)](_0x2eb491['message']))return null;throw _0x2eb491;}}export async function syncStandardPages(_0xfad7d,_0x2c79c6){const _0x1df973=a149_0xfb13,_0x256a4c=await apiRequest(_0x1df973(0x1c9)+_0x2c79c6+_0x1df973(0x1c2),{'method':_0x1df973(0x187),'body':{'appCode':_0xfad7d}});return _0x256a4c[_0x1df973(0x166)];}export async function getPageDetail(_0x3c247b){const _0x2ee77b=a149_0xfb13,_0x546f94=await apiRequest(_0x2ee77b(0x188)+_0x3c247b);if(!_0x546f94[_0x2ee77b(0x166)])throw CliErrors[_0x2ee77b(0x190)](_0x2ee77b(0x1ee)+_0x3c247b);return _0x546f94['data'];}export async function updatePage(_0x3bf430,_0x212282,_0x4252e4,_0x246616){const _0x3892c7=a149_0xfb13,_0x3a10ca=await apiRequest(_0x3892c7(0x175),{'method':'POST','body':{'appCode':_0x3bf430,'pageId':_0x212282,'code':_0x4252e4,'datasetIds':_0x246616}});return _0x3a10ca[_0x3892c7(0x166)];}export function generateSdkCode(_0x243d70,_0x37b6b7,_0x575dd1){const _0x301ff4=a149_0xfb13,_0x2e55bf=_0x575dd1?.[_0x301ff4(0x1bc)]??!![],_0x4d4072=_0x301ff4(0x194)+_0x243d70['code']?.[_0x301ff4(0x1b2)](/-/g,'_'),_0x3dfb36=_0x37b6b7[_0x301ff4(0x1ba)]||_0x37b6b7[_0x301ff4(0x16b)]||_0x301ff4(0x1f1),_0x30cec5=[];_0x2e55bf&&_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x171),'',_0x301ff4(0x183),'');_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x1e1)+_0x243d70[_0x301ff4(0x1ba)]+'\x20('+(_0x243d70[_0x301ff4(0x1a2)]||_0x301ff4(0x15b))+')');if(_0x3dfb36==='filter')_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x174)+_0x4d4072+'.filter({',_0x301ff4(0x1f0),'\x20\x20pageSize:\x2020,',_0x301ff4(0x1f5),_0x301ff4(0x189));else{if(_0x3dfb36===_0x301ff4(0x1ef))_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x174)+_0x4d4072+_0x301ff4(0x195));else{if(_0x3dfb36===_0x301ff4(0x1a6))_0x30cec5[_0x301ff4(0x1fa)]('const\x20result\x20=\x20await\x20client.models.'+_0x4d4072+_0x301ff4(0x1d2));else{if(_0x3dfb36===_0x301ff4(0x157))_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x174)+_0x4d4072+_0x301ff4(0x186));else _0x3dfb36===_0x301ff4(0x164)||_0x3dfb36==='remove'?_0x30cec5[_0x301ff4(0x1fa)]('const\x20result\x20=\x20await\x20client.models.'+_0x4d4072+'.remove(id);'):_0x30cec5[_0x301ff4(0x1fa)](_0x301ff4(0x174)+_0x4d4072+'.'+_0x3dfb36+_0x301ff4(0x184));}}}return _0x30cec5[_0x301ff4(0x163)]('\x0a');}export function generateSqlCodeTemplate(_0x3ef99d,_0x2463bd){const _0x503539=a149_0xfb13,_0x39a1bc=_0x2463bd?.[_0x503539(0x18a)]??_0x503539(0x1be),_0x1182a3=_0x2463bd?.['includeImports']??!![],_0x5d6974=[];return _0x5d6974[_0x503539(0x1fa)](_0x503539(0x1ac)+_0x3ef99d[_0x503539(0x193)]+'\x20('+_0x3ef99d[_0x503539(0x1ae)]+')'),_0x39a1bc==='sdk'?(_0x1182a3&&_0x5d6974[_0x503539(0x1fa)](_0x503539(0x171),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x5d6974[_0x503539(0x1fa)](_0x503539(0x156),_0x503539(0x179)+_0x3ef99d['sqlCode']+'\x27,',_0x503539(0x170),_0x503539(0x189),_0x503539(0x15d),_0x503539(0x15f))):_0x5d6974[_0x503539(0x1fa)](_0x503539(0x1b9),_0x503539(0x1bd),_0x503539(0x1ce),_0x503539(0x1e9)+_0x3ef99d[_0x503539(0x1ae)]+'\x27,',_0x503539(0x1ad),_0x503539(0x1f7),_0x503539(0x197),'}'),_0x5d6974[_0x503539(0x163)]('\x0a');}export async function getErConfig(_0x29a60b,_0x169282){const _0x238fae=a149_0xfb13,_0x5b3608=await apiRequest(_0x238fae(0x1df),{'method':_0x238fae(0x187),'body':{'appCode':_0x29a60b,'dblinkId':_0x169282}});return _0x5b3608[_0x238fae(0x166)];}export async function createErRelation(_0x4b94cc){const _0x33878e=a149_0xfb13,_0x2de097=await apiRequest(_0x33878e(0x1bb),{'method':_0x33878e(0x187),'body':_0x4b94cc,'allowNonJsonSuccess':!![]});return _0x2de097[_0x33878e(0x166)];}export async function updateErRelation(_0x3d100a){const _0xbd35fd=a149_0xfb13,_0x45c0a5=await apiRequest(_0xbd35fd(0x1c1),{'method':_0xbd35fd(0x187),'body':_0x3d100a,'allowNonJsonSuccess':!![]});return _0x45c0a5[_0xbd35fd(0x166)];}export async function deleteErRelation(_0xf0f8c3){const _0x55701f=a149_0xfb13,_0x44d596=await apiRequest(_0x55701f(0x1cc),{'method':_0x55701f(0x187),'body':_0xf0f8c3,'allowNonJsonSuccess':!![]});return _0x44d596[_0x55701f(0x166)];}function buildQuery(_0x9fed21){const _0xf2a2d6=a149_0xfb13,_0x139817=new URLSearchParams();for(const [_0x5c8360,_0x3d5641]of Object[_0xf2a2d6(0x19a)](_0x9fed21)){if(_0x3d5641===undefined||_0x3d5641==='')continue;_0x139817[_0xf2a2d6(0x1c0)](_0x5c8360,String(_0x3d5641));}const _0x8c147b=_0x139817['toString']();return _0x8c147b?'?'+_0x8c147b:'';}export async function listDbLinks(_0x35f644,_0x56eb0b){const _0x3822f1=a149_0xfb13,_0x1fa948=await apiRequest(_0x3822f1(0x181),{'method':'POST','body':{'appCode':_0x35f644,'currentPage':_0x56eb0b?.[_0x3822f1(0x1c7)]??0x1,'pageSize':_0x56eb0b?.[_0x3822f1(0x1fc)]??0x64}});return{'items':extractList(_0x1fa948['data']),'paging':extractPaging(_0x1fa948[_0x3822f1(0x166)])};}export async function getDbLinkInfo(_0x5552c6){const _0x463253=a149_0xfb13,_0x23ef5f=await apiRequest(_0x463253(0x1e2)+buildQuery({'id':_0x5552c6}));return _0x23ef5f[_0x463253(0x166)];}export async function createDbLink(_0x11cc7d){const _0x4ac698=a149_0xfb13,_0x107a97=await apiRequest(_0x4ac698(0x177),{'method':_0x4ac698(0x187),'body':_0x11cc7d});return _0x107a97['data'];}export async function updateDbLink(_0x22b75d){const _0x4cc60=a149_0xfb13,_0x2debb1=await apiRequest(_0x4cc60(0x1dc),{'method':_0x4cc60(0x187),'body':_0x22b75d});return _0x2debb1['data'];}export async function deleteDbLink(_0x2a5b6d){const _0x207750=a149_0xfb13;await apiRequest(_0x207750(0x185),{'method':_0x207750(0x187),'body':{'id':_0x2a5b6d}});}export async function testDbLinkConnect(_0x98355e){const _0x38ec9c=a149_0xfb13,_0x3188ee=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x98355e}));return _0x3188ee[_0x38ec9c(0x166)];}export async function startDbAnalysis(_0x388285,_0x512346){const _0xcd18c6=a149_0xfb13,_0x1234eb=await apiRequest(_0xcd18c6(0x1bf),{'method':_0xcd18c6(0x187),'body':{'dbLinkId':_0x388285,..._0x512346&&_0x512346[_0xcd18c6(0x180)]>0x0?{'tableNames':_0x512346}:{}}}),_0x352a9e=_0x1234eb[_0xcd18c6(0x166)];if(typeof _0x352a9e===_0xcd18c6(0x1d1))return _0x352a9e;if(_0x352a9e&&typeof _0x352a9e===_0xcd18c6(0x1e0)&&typeof _0x352a9e[_0xcd18c6(0x1a8)]==='string')return _0x352a9e['planId'];return _0x352a9e!=null?String(_0x352a9e):'';}export async function cancelDbAnalysis(_0x1732e3){const _0x5ba09a=a149_0xfb13;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x1732e3}),{'method':_0x5ba09a(0x187)});}export async function getDbAnalysisStatus(_0x7164aa){const _0x3fa503=a149_0xfb13,_0x918fb8=await apiRequest(_0x3fa503(0x16e)+encodeURIComponent(_0x7164aa));return _0x918fb8[_0x3fa503(0x166)];}export async function getDbAllTableList(_0x127099,_0x3e2e83){const _0x4e50bf=a149_0xfb13,_0x16ba92=await apiRequest(_0x4e50bf(0x1d8)+buildQuery({'appCode':_0x127099,'dbLinkId':_0x3e2e83})),_0xc2695c=_0x16ba92[_0x4e50bf(0x166)];if(Array[_0x4e50bf(0x1a0)](_0xc2695c))return _0xc2695c;return extractList(_0xc2695c);}export async function getDbTableDiff(_0x4c422b,_0x31b50e,_0x5b769f){const _0x5de280=a149_0xfb13,_0x7c3fd9=await apiRequest(_0x5de280(0x168)+buildQuery({'appCode':_0x4c422b,'dbLinkId':_0x31b50e,'pageIndex':_0x5b769f?.[_0x5de280(0x1b6)]??0x1,'pageSize':_0x5b769f?.['pageSize']??0x14,'tableName':_0x5b769f?.[_0x5de280(0x1a2)]})),_0x25f075=_0x7c3fd9[_0x5de280(0x166)];return{'totalCount':_0x25f075?.[_0x5de280(0x1f6)]??0x0,'tableList':Array['isArray'](_0x25f075?.[_0x5de280(0x19b)])?_0x25f075[_0x5de280(0x19b)]:[]};}function a149_0xd449(){const _0x1c2fd5=['/smartapi/db-analysis/status/','Operation\x20\x22','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/custom/getUserCustomSql','const\x20result\x20=\x20await\x20client.models.','/smartapi/lovrabet/update-page','/standard-page-status?appCode=','/smartapi/dblink/create','/api/management/script/cache/clear','\x20\x20sqlCode:\x20\x27','functionName','modelCode','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','tableData','clientOperationId','displayName','length','/smartapi/dblink/getList','toString','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','(/*\x20params\x20*/);','/smartapi/dblink/delete','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','POST','/smartapi/lovrabet/detail?pageId=','});','target','has','\x20failed','label','12836JPpTZu','find','validation','includes','map','sqlName','dataset_','.getOne(id);','modelId','\x20\x20return\x20rows;','operations','code','entries','tableList','scriptType','/smartapi/dataset/get-dataset-operation','UNAUTHORIZED','Unauthorized','isArray','/smartapi/app/getList','tableName','success','/generate-standard-pages/start','operationId','create','?sqlCode=','planId','json','18357WonnSG','/api/custom/executeSql','//\x20SQL:\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','sqlCode','/smartapi/custom/queryUserCustomSqlList','application/json','/generate-standard-pages/status?','replace','status','4543448OCclQH','warn','pageIndex','message','537unQNoi','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','name','/smartapi/question/er-config/erCreate','includeImports','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','sdk','/smartapi/db-analysis/start','set','/smartapi/question/er-config/update-single','/sync-to-pages','requestFields','enabled','cli:rabetbase','authRequired','currentPage','body','/smartapi/lovrabet/dataset/','apiError','/smartapi/custom/getUserCustomSql?id=','/smartapi/question/er-config/erDelete','Request\x20failed:\x20','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/api/management/library/scripts/delete','/smartapi/dataset/update-driven-data','string','.create({\x20/*\x20fields\x20*/\x20});','type','/smartapi/dataset/get-driven-data?','AbortError','\x20apps.\x20','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/dblink/getAllTableList','errorCode','/api/management/library/scripts/info?id=','3085947PWZYsM','/smartapi/dblink/update','error','\x22\x20not\x20found\x20in\x20dataset\x20','/smartapi/question/er-config','object','//\x20','/smartapi/dblink/getOne','/api/management/library/scripts/statistics?appCode=','&type=','dbtableConfig','API\x20error:\x20','add','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','\x20\x20\x20\x20sqlCode:\x20\x27','401','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/custom/saveUserCustomSql','dbId','Page\x20not\x20found:\x20','getOne','\x20\x20where:\x20{},','filter','374286aDSHuw','65qpUdlT','toLowerCase','\x20\x20currentPage:\x201,','totalCount','\x20\x20});','/smartapi/custom/deleteUserCustomSql','\x20of\x20','push','/smartapi/custom/updateUserCustomSql','pageSize','const\x20data\x20=\x20await\x20client.sql.execute({','update','8lbfQhi','3057180DFTTxX','480CqPaSw','table','/api/','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','SQL\x20query\x20not\x20found:\x20id=','const\x20results\x20=\x20data.execResult\x20||\x20[];','Request\x20timeout:\x20','description','test','join','delete','version','data','35508kCsbJp','/smartapi/dblink/getTableDiffV2ByPage','scriptName','SQL\x20query\x20not\x20found:\x20','operationName','method','errorMsg'];a149_0xd449=function(){return _0x1c2fd5;};return a149_0xd449();}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x4da328=a149_0xfb13,_0x2be0d3=await apiRequest(_0x4da328(0x1a1),{'method':_0x4da328(0x187),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x19d98a=extractList(_0x2be0d3[_0x4da328(0x166)]),_0x462a14=extractPaging(_0x2be0d3[_0x4da328(0x166)]);return _0x462a14&&_0x462a14[_0x4da328(0x1f6)]>REMOTE_APP_PAGE_SIZE&&console[_0x4da328(0x1b5)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x4da328(0x1f9)+_0x462a14[_0x4da328(0x1f6)]+_0x4da328(0x1d6)+_0x4da328(0x17c)),_0x19d98a;}
1
+ (function(_0x5e6960,_0x1e78dd){const _0x315c7d=a149_0x25bc,_0x388535=_0x5e6960();while(!![]){try{const _0x57041d=-parseInt(_0x315c7d(0xec))/0x1+parseInt(_0x315c7d(0xce))/0x2*(parseInt(_0x315c7d(0xf8))/0x3)+-parseInt(_0x315c7d(0xbb))/0x4*(parseInt(_0x315c7d(0x122))/0x5)+-parseInt(_0x315c7d(0x10e))/0x6+-parseInt(_0x315c7d(0xfb))/0x7+-parseInt(_0x315c7d(0xe6))/0x8+parseInt(_0x315c7d(0xbe))/0x9;if(_0x57041d===_0x1e78dd)break;else _0x388535['push'](_0x388535['shift']());}catch(_0x545536){_0x388535['push'](_0x388535['shift']());}}}(a149_0x37aa,0x8de1e));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(_0x371875){_activeCookie=_0x371875||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x401b16,_0x4e4ffb){const _0x12f303=a149_0x25bc,_0x3110e8=_0x4e4ffb instanceof Error?_0x4e4ffb[_0x12f303(0xa8)]:String(_0x4e4ffb);return CliErrors[_0x12f303(0xbd)](_0x12f303(0xad)+_0x401b16+(_0x3110e8?'\x20('+_0x3110e8+')':''),_0x12f303(0xe9));}async function apiRequest(_0x48e31a,_0x13a296={}){const _0x1d10c4=a149_0x25bc,{method:method=_0x1d10c4(0xd2),body:_0x50d5d7,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x13a296,_0x134898=useRuntime?getRuntimeDomain():getApiDomain(),_0x19abdc=_activeCookie||getCookie(),_0x40eeba=''+_0x134898+_0x48e31a,_0x320e36=new AbortController(),_0xeaeb61=setTimeout(()=>_0x320e36['abort'](),timeout);try{const _0x205171=await fetch(_0x40eeba,{'method':method,'headers':{'Content-Type':_0x1d10c4(0x129),'Cookie':_0x19abdc,'X-Invoke-Source':_0x1d10c4(0xb1),...headers},'body':_0x50d5d7?JSON[_0x1d10c4(0x97)](_0x50d5d7):undefined,'signal':_0x320e36[_0x1d10c4(0x114)]});let _0x280dbc;try{_0x280dbc=await _0x205171[_0x1d10c4(0xd6)]();}catch{if(_0x205171['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x1d10c4(0xa9)+_0x205171['status']+')',_0x205171['status']>=0x190?_0x1d10c4(0xa7):undefined);}if(!_0x205171['ok']||_0x280dbc[_0x1d10c4(0x8b)]===![])throw CliErrors['apiError'](_0x280dbc['errorMsg']||_0x280dbc[_0x1d10c4(0xa8)]||_0x1d10c4(0xf7)+_0x205171[_0x1d10c4(0xcc)],_0x280dbc['errorCode']?_0x1d10c4(0xdc)+_0x280dbc[_0x1d10c4(0xab)]:undefined);return _0x280dbc;}catch(_0x41cffa){if(_0x41cffa instanceof CliError)throw _0x41cffa;if(_0x41cffa instanceof Error&&_0x41cffa[_0x1d10c4(0xfa)]===_0x1d10c4(0x11e))throw CliErrors[_0x1d10c4(0xbd)]('Request\x20timeout:\x20'+_0x40eeba);throw createFetchFailureError(_0x40eeba,_0x41cffa);}finally{clearTimeout(_0xeaeb61);}}function isAuthFailure(_0x2ac396){const _0x29e40b=a149_0x25bc,_0x33cd81=_0x2ac396[_0x29e40b(0xda)]||_0x2ac396[_0x29e40b(0xa8)]||_0x2ac396['data']?.[_0x29e40b(0xa8)]||_0x2ac396[_0x29e40b(0xb5)]||_0x2ac396[_0x29e40b(0xea)]||'';return _0x2ac396[_0x29e40b(0xab)]==='UNAUTHORIZED'||_0x2ac396['code']===0x191||_0x2ac396['code']==='401'||_0x33cd81['includes']('401')||_0x33cd81[_0x29e40b(0xca)](_0x29e40b(0x108))||_0x33cd81[_0x29e40b(0xca)]('登录')||_0x33cd81[_0x29e40b(0xca)]('认证');}export async function platformFetch(_0x56559f,_0x47c995){const _0x4f0fb3=a149_0x25bc;let _0x90e315;try{_0x90e315=await fetch(_0x56559f,{'method':_0x47c995[_0x4f0fb3(0x100)]??_0x4f0fb3(0xd2),'headers':{'Content-Type':_0x4f0fb3(0x129),'Cookie':_0x47c995[_0x4f0fb3(0x91)],'X-Invoke-Source':'cli:rabetbase'},..._0x47c995[_0x4f0fb3(0x115)]&&{'body':JSON[_0x4f0fb3(0x97)](_0x47c995['body'])}});}catch(_0x15a956){throw createFetchFailureError(_0x56559f,_0x15a956);}if(!_0x90e315['ok']){if(_0x90e315[_0x4f0fb3(0xcc)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x4f0fb3(0xbd)](_0x47c995[_0x4f0fb3(0xa5)]+_0x4f0fb3(0x9c)+_0x90e315['status']);}const _0x344ae9=await _0x90e315[_0x4f0fb3(0xd6)]();if(_0x344ae9['success']===![]){if(isAuthFailure(_0x344ae9))throw CliErrors[_0x4f0fb3(0x8f)]();throw CliErrors[_0x4f0fb3(0xbd)](_0x344ae9[_0x4f0fb3(0xda)]||_0x344ae9[_0x4f0fb3(0xa8)]||_0x47c995[_0x4f0fb3(0xa5)]+'\x20failed');}return _0x344ae9['data'];}export async function listBffScripts(_0x1dfad8,_0x141d34,_0x3b4e1b){const _0x8fde2c=a149_0x25bc;let _0x1f2499=_0x8fde2c(0xc5)+_0x1dfad8;if(_0x141d34)_0x1f2499+=_0x8fde2c(0xb9)+_0x141d34;const _0x2aff85=await apiRequest(_0x1f2499);let _0x1d595f=extractList(_0x2aff85[_0x8fde2c(0x103)]);if(_0x3b4e1b?.[_0x8fde2c(0x105)]){const _0x29a1b9=_0x3b4e1b[_0x8fde2c(0x105)][_0x8fde2c(0x11d)]();_0x1d595f=_0x1d595f[_0x8fde2c(0x10d)](_0x32bd7f=>_0x32bd7f[_0x8fde2c(0xa4)]?.[_0x8fde2c(0x11d)]()[_0x8fde2c(0xca)](_0x29a1b9)||_0x32bd7f[_0x8fde2c(0xac)]?.[_0x8fde2c(0x11d)]()[_0x8fde2c(0xca)](_0x29a1b9));}return _0x1d595f;}export async function getBffScriptInfo(_0x36129b){const _0x529ee6=a149_0x25bc,_0x73fbe7=await apiRequest(_0x529ee6(0xc1)+_0x36129b);if(!_0x73fbe7[_0x529ee6(0x103)])throw CliErrors[_0x529ee6(0x128)](_0x529ee6(0x124)+_0x36129b);return _0x73fbe7[_0x529ee6(0x103)];}export async function saveBffScript(_0x25f5f2){const _0x42bb34=a149_0x25bc,_0x32ea66=await apiRequest('/api/management/library/scripts/save',{'method':_0x42bb34(0x107),'body':_0x25f5f2}),{id:_0x372eaf,entity:_0x572c46}=normalizeEntityWithIdResponse(_0x32ea66[_0x42bb34(0x103)]);if(_0x372eaf!==undefined){const _0x3a248f=typeof _0x572c46[_0x42bb34(0xa4)]===_0x42bb34(0xc2)||typeof _0x572c46[_0x42bb34(0x101)]===_0x42bb34(0xc2)?_0x572c46:undefined;return{'id':_0x372eaf,'script':_0x3a248f};}throw CliErrors['apiError'](_0x42bb34(0x10a));}export async function deleteBffScript(_0x2e896e){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x2e896e}});}export async function getBffScriptStatistics(_0x4e2de0){const _0x531370=a149_0x25bc,_0x1926d5=await apiRequest(_0x531370(0xd7)+_0x4e2de0);return extractList(_0x1926d5[_0x531370(0x103)]);}export async function clearBffScriptCache(){const _0x5d2628=a149_0x25bc,_0x2650f1=await apiRequest('/api/management/script/cache/clear',{'method':_0x5d2628(0x107),'useRuntime':!![]});return typeof _0x2650f1['data']===_0x5d2628(0xc2)?_0x2650f1[_0x5d2628(0x103)]:'';}export async function listBffDatasetOperations(_0x382415,_0x27e7f7){const _0x50368c=a149_0x25bc,_0x369f1d=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x50368c(0x107),'body':{'appCode':_0x382415,'datasetId':_0x27e7f7}});return _0x369f1d['data'];}export async function listSqlQueries(_0x443921,_0xc0fbab){const _0x4efd18=a149_0x25bc,_0x394121=await apiRequest(_0x4efd18(0x94),{'method':_0x4efd18(0x107),'body':{'appCode':_0x443921,'currentPage':_0xc0fbab?.[_0x4efd18(0xe5)]??0x1,'pageSize':_0xc0fbab?.[_0x4efd18(0xdb)]??0x32,'sqlCode':_0xc0fbab?.['sqlCode'],'sqlName':_0xc0fbab?.[_0x4efd18(0x119)]}});return _0x394121[_0x4efd18(0x103)];}export async function getSqlQueryInfo(_0x3f8632,_0x9bd47c){const _0x43b84d=a149_0x25bc,_0x4142c8=await listSqlQueries(_0x3f8632,{'sqlCode':_0x9bd47c}),_0x3201bb=_0x4142c8[_0x43b84d(0x126)]?.[0x0];if(!_0x3201bb)throw CliErrors[_0x43b84d(0x128)](_0x43b84d(0xb2)+_0x9bd47c);return _0x3201bb;}export async function getSqlQueryDetail(_0x22d558){const _0x289f9a=a149_0x25bc,_0x4581d1=await apiRequest(_0x289f9a(0x11a)+('?sqlCode='+encodeURIComponent(_0x22d558)));if(!_0x4581d1[_0x289f9a(0x103)])throw CliErrors['validation'](_0x289f9a(0xb2)+_0x22d558);return _0x4581d1['data'];}export async function getSqlQueryDetailById(_0x402d83){const _0x44b52e=a149_0x25bc,_0xf812b0=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x402d83);if(!_0xf812b0[_0x44b52e(0x103)])throw CliErrors[_0x44b52e(0x128)](_0x44b52e(0x110)+_0x402d83);return _0xf812b0[_0x44b52e(0x103)];}export async function createSqlQuery(_0x2b3a16){const _0x19c2d5=a149_0x25bc,_0x133fb9=await apiRequest(_0x19c2d5(0xa2),{'method':_0x19c2d5(0x107),'body':_0x2b3a16}),{id:_0x3945ca,entity:_0x2660aa}=normalizeEntityWithIdResponse(_0x133fb9[_0x19c2d5(0x103)]);if(!('sqlCode'in _0x2660aa)&&_0x3945ca)return getSqlQueryDetailById(_0x3945ca);return normalizeSqlQueryEntity(_0x2660aa);}export async function updateSqlQuery(_0x1ad60a){const _0x19bd7d=a149_0x25bc,_0x5e6730=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0x19bd7d(0x107),'body':_0x1ad60a}),{id:_0x31a2a5,entity:_0x4816d6}=normalizeEntityWithIdResponse(_0x5e6730[_0x19bd7d(0x103)]);if(!(_0x19bd7d(0x9d)in _0x4816d6)){if(_0x1ad60a['sqlCode'])return getSqlQueryDetail(_0x1ad60a[_0x19bd7d(0x9d)]);if(_0x31a2a5)return getSqlQueryDetailById(_0x31a2a5);}return normalizeSqlQueryEntity(_0x4816d6);}export async function deleteSqlQuery(_0x3f45bd){const _0x554a30=a149_0x25bc;await apiRequest(_0x554a30(0xe3),{'method':_0x554a30(0x107),'body':_0x3f45bd});}export async function saveSqlQuery(_0x371126){const _0x4e1b4f=a149_0x25bc,_0x5e1e61=await apiRequest(_0x4e1b4f(0xeb),{'method':_0x4e1b4f(0x107),'body':_0x371126});return _0x5e1e61[_0x4e1b4f(0x103)];}function normalizeSqlQueryEntity(_0x4a1f13){const _0x3f5970=a149_0x25bc;return{..._0x4a1f13,'id':Number(_0x4a1f13['id']),'dbId':_0x4a1f13[_0x3f5970(0xdf)]==null?undefined:Number(_0x4a1f13[_0x3f5970(0xdf)]),'version':_0x4a1f13[_0x3f5970(0xa1)]==null?undefined:Number(_0x4a1f13[_0x3f5970(0xa1)])};}export async function executeSql(_0xf76dd6,_0x3ffe86,_0x13682b){const _0x458614=a149_0x25bc,_0x5aafee=await apiRequest('/api/custom/executeSql',{'method':_0x458614(0x107),'body':{'appCode':_0xf76dd6,'sqlCode':_0x3ffe86,..._0x13682b&&{'params':_0x13682b}},'useRuntime':!![]});return _0x5aafee[_0x458614(0x103)];}export async function executeDatasetDataOperation(_0x25a11c,_0x26e220,_0x2ac4b1,_0x1235b3={}){const _0x3150d4=a149_0x25bc;try{const _0x13e7c2=await apiRequest(_0x3150d4(0x113)+_0x25a11c+'/'+_0x26e220+'/'+_0x2ac4b1,{'method':_0x3150d4(0x107),'body':_0x1235b3,'useRuntime':!![]});return _0x13e7c2[_0x3150d4(0x103)];}catch(_0x46c027){if(_0x2ac4b1===_0x3150d4(0xde)&&_0x46c027 instanceof CliError&&_0x46c027[_0x3150d4(0xba)]===_0x3150d4(0xef)&&_0x1235b3['id']!==undefined&&_0x1235b3['id']!==null&&_0x1235b3['id']!==''){const _0x20ab16=await apiRequest('/api/'+_0x25a11c+'/'+_0x26e220+_0x3150d4(0x125),{'method':_0x3150d4(0x107),'body':{'where':{'id':{'$eq':_0x1235b3['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x5c713d=Array['isArray'](_0x20ab16[_0x3150d4(0x103)]?.[_0x3150d4(0x126)])?_0x20ab16[_0x3150d4(0x103)]['tableData']:[];return _0x5c713d[0x0]??null;}throw _0x46c027;}}export async function listDatasets(_0xe1d3ab,_0x532b0e){const _0xc2b90b=a149_0x25bc,_0x2b62bd={'appCode':_0xe1d3ab,'deleted':![]};if(_0x532b0e?.[_0xc2b90b(0xba)])_0x2b62bd[_0xc2b90b(0xba)]=_0x532b0e[_0xc2b90b(0xba)];if(_0x532b0e?.[_0xc2b90b(0xfa)])_0x2b62bd['name']=_0x532b0e['name'];const _0x287405=await apiRequest(_0xc2b90b(0xc0),{'method':_0xc2b90b(0x107),'body':_0x2b62bd});return extractList(_0x287405[_0xc2b90b(0x103)]);}export async function deleteDataset(_0xe08c05,_0x5b8194){const _0x2d1822=a149_0x25bc;await apiRequest(_0x2d1822(0x90),{'method':'POST','body':{'appCode':_0xe08c05,'datasetId':_0x5b8194}});}export async function searchDatasets(_0x5e6d76,_0x29e81b){const _0x4f5c59=a149_0x25bc,_0x5388e9=await listDatasets(_0x5e6d76,{'name':_0x29e81b}),_0xe5f9ea=_0x29e81b[_0x4f5c59(0x11d)](),_0x29b9a2=new Set(_0x5388e9['map'](_0x37f228=>_0x37f228['id'])),_0x3600aa=_0x5388e9[_0x4f5c59(0x10d)](_0x297746=>_0x297746[_0x4f5c59(0x8d)]?.['tableName']?.['toLowerCase']()[_0x4f5c59(0xca)](_0xe5f9ea)||_0x297746[_0x4f5c59(0xac)]?.[_0x4f5c59(0x11d)]()[_0x4f5c59(0xca)](_0xe5f9ea)),_0x5b7343=await listDatasets(_0x5e6d76,{'code':_0x29e81b});for(const _0x17c0e1 of _0x5b7343){!_0x29b9a2[_0x4f5c59(0xfe)](_0x17c0e1['id'])&&(_0x5388e9['push'](_0x17c0e1),_0x29b9a2[_0x4f5c59(0xee)](_0x17c0e1['id']));}return _0x5388e9;}export function normalizeDatasetOperations(_0x434705){const _0x4663a0=a149_0x25bc;if(Array[_0x4663a0(0xf2)](_0x434705))return _0x434705['filter'](_0x1b58bf=>_0x1b58bf!=null&&typeof _0x1b58bf==='object');if(_0x434705&&typeof _0x434705===_0x4663a0(0xf9))return Object[_0x4663a0(0x117)](_0x434705)[_0x4663a0(0x10d)](([,_0xc6f554])=>_0xc6f554!=null&&typeof _0xc6f554===_0x4663a0(0xf9))[_0x4663a0(0xe0)](([_0x46752c,_0x18a37c])=>({..._0x18a37c,'name':_0x18a37c[_0x4663a0(0xfa)]??_0x18a37c[_0x4663a0(0xf0)]??_0x46752c}));return[];}export async function getDatasetDetail(_0x2522af){const _0x59c8c5=a149_0x25bc,_0x329e0e=/^\d+$/['test'](_0x2522af)?'id':_0x59c8c5(0xba),_0x33ae58=await apiRequest(_0x59c8c5(0x8c)+_0x329e0e+'='+_0x2522af);return _0x33ae58[_0x59c8c5(0x103)];}export async function updateDrivenData(_0x203ba9){const _0x4312b7=a149_0x25bc,_0x8b5f65=await apiRequest(_0x4312b7(0x11f),{'method':_0x4312b7(0x107),'body':_0x203ba9});return _0x8b5f65[_0x4312b7(0x103)];}export async function getDatasetOperations(_0x2599b5){const _0x260fc0=a149_0x25bc,_0x5169e0=await getDatasetDetail(_0x2599b5),_0x2a4898=normalizeDatasetOperations(_0x5169e0[_0x260fc0(0x8e)])['map'](_0xc9a34f=>({'name':_0xc9a34f[_0x260fc0(0xfa)]||_0xc9a34f['operationName'],'displayName':_0xc9a34f['displayName']||_0xc9a34f[_0x260fc0(0xfa)],'type':_0xc9a34f[_0x260fc0(0xbf)],'method':_0xc9a34f[_0x260fc0(0x100)],'path':_0xc9a34f[_0x260fc0(0xf5)],'enabled':_0xc9a34f[_0x260fc0(0xe1)]??!![],'requestFields':_0xc9a34f['requestFields'],'responseFields':_0xc9a34f[_0x260fc0(0xaf)]}));return{'dataset':{'id':_0x5169e0['id']??_0x5169e0[_0x260fc0(0x96)],'name':_0x5169e0['name'],'code':_0x5169e0[_0x260fc0(0xba)]||_0x5169e0[_0x260fc0(0xa6)],'tableName':_0x5169e0['tableName']||_0x5169e0[_0x260fc0(0x8d)]?.[_0x260fc0(0x12a)]},'operations':_0x2a4898};}export async function getOperationDetail(_0x5f0630,_0x27fd49,_0x281b15){const _0x5ad705=a149_0x25bc;let _0x1b73a6=_0x27fd49;if(!/^\d+$/[_0x5ad705(0xd3)](_0x27fd49)){const _0x5c22db=await listDatasets(_0x5f0630,{'code':_0x27fd49}),_0x573c02=_0x5c22db['find'](_0x2ef818=>_0x2ef818['code']===_0x27fd49||String(_0x2ef818['id'])===_0x27fd49);if(!_0x573c02)throw CliErrors['validation'](_0x5ad705(0x112)+_0x27fd49);_0x1b73a6=String(_0x573c02['id']);}const _0x4dafdd=await getDatasetDetail(_0x1b73a6),_0x35892f=normalizeDatasetOperations(_0x4dafdd[_0x5ad705(0x8e)])[_0x5ad705(0x10f)](_0x1be0ee=>(_0x1be0ee[_0x5ad705(0xfa)]||_0x1be0ee[_0x5ad705(0xf0)])===_0x281b15);if(!_0x35892f)throw CliErrors['validation'](_0x5ad705(0xb6)+_0x281b15+_0x5ad705(0xa0)+_0x27fd49);return{'dataset':{'id':_0x4dafdd['id']??_0x4dafdd[_0x5ad705(0x96)],'name':_0x4dafdd[_0x5ad705(0xfa)],'code':_0x4dafdd[_0x5ad705(0xba)]||_0x4dafdd[_0x5ad705(0xa6)],'tableName':_0x4dafdd[_0x5ad705(0x12a)]||_0x4dafdd[_0x5ad705(0x8d)]?.[_0x5ad705(0x12a)]},'operation':_0x35892f};}export async function startGenerateStandardPages(_0x4f2712,_0x471fa2,_0x20b453){const _0x5b132a=a149_0x25bc,_0x3fb2d3=await apiRequest(_0x5b132a(0xf3)+_0x471fa2+'/generate-standard-pages/start',{'method':'POST','body':{'appCode':_0x4f2712,..._0x20b453?.[_0x5b132a(0x92)]?{'clientOperationId':_0x20b453['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3fb2d3[_0x5b132a(0x103)];}export async function getGenerateStandardPagesStatus(_0xc30d73,_0x2168c7,_0x222581){const _0x2a74e3=a149_0x25bc,_0x2fbe83=new URLSearchParams({'appCode':_0xc30d73});_0x222581[_0x2a74e3(0x116)]&&_0x2fbe83['set'](_0x2a74e3(0x116),_0x222581[_0x2a74e3(0x116)]);_0x222581[_0x2a74e3(0x92)]&&_0x2fbe83[_0x2a74e3(0x98)](_0x2a74e3(0x92),_0x222581[_0x2a74e3(0x92)]);const _0x380761=await apiRequest(_0x2a74e3(0xf3)+_0x2168c7+_0x2a74e3(0xb3)+_0x2fbe83['toString']());return _0x380761['data'];}export async function getStandardPageStatus(_0x636896,_0x2af91f){const _0x31d8fc=a149_0x25bc,_0x20a722=await apiRequest(_0x31d8fc(0xf3)+_0x2af91f+_0x31d8fc(0xe8)+encodeURIComponent(_0x636896));return _0x20a722[_0x31d8fc(0x103)];}export async function tryGetStandardPageStatus(_0x430c21,_0x190df0){const _0x2fe07=a149_0x25bc;try{return await getStandardPageStatus(_0x430c21,_0x190df0);}catch(_0x150042){if(_0x150042 instanceof CliError&&_0x150042['code']===_0x2fe07(0xef)&&/404|not found|non-json response/i['test'](_0x150042['message']))return null;throw _0x150042;}}export async function syncStandardPages(_0x3abdb8,_0x17e80e){const _0x1c48ff=a149_0x25bc,_0xd221c4=await apiRequest(_0x1c48ff(0xf3)+_0x17e80e+_0x1c48ff(0x95),{'method':_0x1c48ff(0x107),'body':{'appCode':_0x3abdb8}});return _0xd221c4['data'];}export async function getPageDetail(_0x4e9979){const _0x7682ed=a149_0x25bc,_0x595396=await apiRequest(_0x7682ed(0xe4)+_0x4e9979);if(!_0x595396[_0x7682ed(0x103)])throw CliErrors['validation'](_0x7682ed(0x104)+_0x4e9979);return _0x595396['data'];}export async function updatePage(_0x258914,_0x1d9c03,_0x26620a,_0x186196){const _0x204ecd=a149_0x25bc,_0x174fe7=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x204ecd(0x107),'body':{'appCode':_0x258914,'pageId':_0x1d9c03,'code':_0x26620a,'datasetIds':_0x186196}});return _0x174fe7[_0x204ecd(0x103)];}export function generateSdkCode(_0x2e48b0,_0x3b4671,_0x10a657){const _0x28891d=a149_0x25bc,_0x140470=_0x10a657?.[_0x28891d(0xc3)]??!![],_0x49b805=_0x28891d(0xc9)+_0x2e48b0[_0x28891d(0xba)]?.[_0x28891d(0xfc)](/-/g,'_'),_0x30af93=_0x3b4671[_0x28891d(0xfa)]||_0x3b4671['operationName']||_0x28891d(0x10d),_0x1194a0=[];_0x140470&&_0x1194a0[_0x28891d(0x109)](_0x28891d(0xa3),'',_0x28891d(0x9f),'');_0x1194a0[_0x28891d(0x109)](_0x28891d(0xc8)+_0x2e48b0['name']+'\x20('+(_0x2e48b0[_0x28891d(0x12a)]||_0x28891d(0x9e))+')');if(_0x30af93==='filter')_0x1194a0[_0x28891d(0x109)](_0x28891d(0xcf)+_0x49b805+_0x28891d(0x93),'\x20\x20where:\x20{},',_0x28891d(0x121),'\x20\x20currentPage:\x201,',_0x28891d(0x9b));else{if(_0x30af93===_0x28891d(0xde))_0x1194a0['push'](_0x28891d(0xcf)+_0x49b805+_0x28891d(0xf4));else{if(_0x30af93==='create')_0x1194a0[_0x28891d(0x109)](_0x28891d(0xcf)+_0x49b805+_0x28891d(0xd0));else{if(_0x30af93===_0x28891d(0xb0))_0x1194a0[_0x28891d(0x109)](_0x28891d(0xcf)+_0x49b805+_0x28891d(0xcd));else _0x30af93===_0x28891d(0xbc)||_0x30af93==='remove'?_0x1194a0[_0x28891d(0x109)](_0x28891d(0xcf)+_0x49b805+_0x28891d(0xf6)):_0x1194a0['push'](_0x28891d(0xcf)+_0x49b805+'.'+_0x30af93+'(/*\x20params\x20*/);');}}}return _0x1194a0[_0x28891d(0xe2)]('\x0a');}export function generateSqlCodeTemplate(_0x558f22,_0x29ca4a){const _0x1ae9de=a149_0x25bc,_0x4dcb7a=_0x29ca4a?.['target']??_0x1ae9de(0xd4),_0x1357ff=_0x29ca4a?.[_0x1ae9de(0xc3)]??!![],_0x2b0b29=[];return _0x2b0b29['push']('//\x20SQL:\x20'+_0x558f22[_0x1ae9de(0x119)]+'\x20('+_0x558f22['sqlCode']+')'),_0x4dcb7a==='sdk'?(_0x1357ff&&_0x2b0b29[_0x1ae9de(0x109)](_0x1ae9de(0xa3),'',_0x1ae9de(0x9f),''),_0x2b0b29[_0x1ae9de(0x109)]('const\x20data\x20=\x20await\x20client.sql.execute({','\x20\x20sqlCode:\x20\x27'+_0x558f22[_0x1ae9de(0x9d)]+'\x27,',_0x1ae9de(0xae),'});',_0x1ae9de(0xf1),_0x1ae9de(0x127))):_0x2b0b29[_0x1ae9de(0x109)](_0x1ae9de(0x120),_0x1ae9de(0xd9),_0x1ae9de(0x10b),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x558f22[_0x1ae9de(0x9d)]+'\x27,',_0x1ae9de(0xdd),_0x1ae9de(0x118),_0x1ae9de(0x99),'}'),_0x2b0b29[_0x1ae9de(0xe2)]('\x0a');}export async function getErConfig(_0x12964c,_0x2d58b6){const _0x561439=a149_0x25bc,_0x57e806=await apiRequest(_0x561439(0xb7),{'method':_0x561439(0x107),'body':{'appCode':_0x12964c,'dblinkId':_0x2d58b6}});return _0x57e806['data'];}export async function createErRelation(_0x50af02){const _0x3b1d43=a149_0x25bc,_0x2e96d7=await apiRequest(_0x3b1d43(0x11c),{'method':_0x3b1d43(0x107),'body':_0x50af02,'allowNonJsonSuccess':!![]});return _0x2e96d7[_0x3b1d43(0x103)];}export async function updateErRelation(_0xaf731a){const _0x23538c=a149_0x25bc,_0x176b22=await apiRequest(_0x23538c(0xc6),{'method':_0x23538c(0x107),'body':_0xaf731a,'allowNonJsonSuccess':!![]});return _0x176b22[_0x23538c(0x103)];}export async function deleteErRelation(_0x4b3b7e){const _0x8c9b51=a149_0x25bc,_0x3c9fa3=await apiRequest(_0x8c9b51(0x9a),{'method':'POST','body':_0x4b3b7e,'allowNonJsonSuccess':!![]});return _0x3c9fa3[_0x8c9b51(0x103)];}function buildQuery(_0x284f1f){const _0x1f4faf=a149_0x25bc,_0x3ae151=new URLSearchParams();for(const [_0x52b44b,_0x2abb7c]of Object[_0x1f4faf(0x117)](_0x284f1f)){if(_0x2abb7c===undefined||_0x2abb7c==='')continue;_0x3ae151['set'](_0x52b44b,String(_0x2abb7c));}const _0x52eacb=_0x3ae151[_0x1f4faf(0x11b)]();return _0x52eacb?'?'+_0x52eacb:'';}export async function listDbLinks(_0x4b3d06,_0x50c562){const _0x181195=a149_0x25bc,_0x4d60d2=await apiRequest(_0x181195(0xc7),{'method':_0x181195(0x107),'body':{'appCode':_0x4b3d06,'currentPage':_0x50c562?.['currentPage']??0x1,'pageSize':_0x50c562?.[_0x181195(0xdb)]??0x64}});return{'items':extractList(_0x4d60d2[_0x181195(0x103)]),'paging':extractPaging(_0x4d60d2[_0x181195(0x103)])};}function a149_0x25bc(_0x390553,_0x18e1c9){_0x390553=_0x390553-0x8b;const _0x37aad1=a149_0x37aa();let _0x25bc06=_0x37aad1[_0x390553];return _0x25bc06;}function a149_0x37aa(){const _0x5d00ca=['/smartapi/dblink/update','BFF\x20script\x20not\x20found:\x20id=','/filter','tableData','const\x20results\x20=\x20data.execResult\x20||\x20[];','validation','application/json','tableName','success','/smartapi/dataset/get-driven-data?','dbtableConfig','operations','authRequired','/smartapi/dataset/delete-dataset','cookie','clientOperationId','.filter({','/smartapi/custom/queryUserCustomSqlList','/sync-to-pages','modelId','stringify','set','\x20\x20return\x20rows;','/smartapi/question/er-config/erDelete','});','\x20failed,\x20HTTP\x20','sqlCode','table','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','version','/smartapi/custom/saveUserCustomSql','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','functionName','label','modelCode','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','message','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','tableList','errorCode','description','Request\x20failed:\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','responseFields','update','cli:rabetbase','SQL\x20query\x20not\x20found:\x20','/generate-standard-pages/status?','/smartapi/db-analysis/status/','errorMessage','Operation\x20\x22','/smartapi/question/er-config','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','&type=','code','86812ZQvgZM','delete','apiError','15567237IIMfWt','type','/smartapi/dataset/get-dataset-list','/api/management/library/scripts/info?id=','string','includeImports','/smartapi/dblink/delete','/api/management/library/scripts/list?appCode=','/smartapi/question/er-config/update-single','/smartapi/dblink/getList','//\x20','dataset_','includes','/smartapi/db-analysis/jobs/cancel','status','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','92cPdrAz','const\x20result\x20=\x20await\x20client.models.','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/dblink/getTableDiffV2ByPage','GET','test','sdk','planId','json','/api/management/library/scripts/statistics?appCode=','/smartapi/app/getList','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','errorMsg','pageSize','API\x20error\x20code:\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','getOne','dbId','map','enabled','join','/smartapi/custom/deleteUserCustomSql','/smartapi/lovrabet/detail?pageId=','currentPage','903312HnYoIt','/smartapi/dblink/getOne','/standard-page-status?appCode=','Check\x20network\x20connectivity\x20and\x20try\x20again.','error','/api/node-toolbox/sql/save','47596SpsMQW','/smartapi/dblink/getAllTableList','add','api_error','operationName','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','isArray','/smartapi/lovrabet/dataset/','.getOne(id);','path','.remove(id);','API\x20error:\x20','58326WUVaJb','object','name','8096137VVufts','replace','warn','has','pageIndex','method','scriptType','totalCount','data','Page\x20not\x20found:\x20','scriptName','/smartapi/dblink/testConnect','POST','Unauthorized','push','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','length','filter','3833772mjWysd','find','SQL\x20query\x20not\x20found:\x20id=','Warning:\x20showing\x20first\x20','Dataset\x20not\x20found:\x20','/api/','signal','body','operationId','entries','\x20\x20});','sqlName','/smartapi/custom/getUserCustomSql','toString','/smartapi/question/er-config/erCreate','toLowerCase','AbortError','/smartapi/dataset/update-driven-data','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','\x20\x20pageSize:\x2020,','20sjVUBc'];a149_0x37aa=function(){return _0x5d00ca;};return a149_0x37aa();}export async function getDbLinkInfo(_0x29b4fe){const _0x2d6f9f=a149_0x25bc,_0x49d306=await apiRequest(_0x2d6f9f(0xe7)+buildQuery({'id':_0x29b4fe}));return _0x49d306[_0x2d6f9f(0x103)];}export async function createDbLink(_0x34390c){const _0x31f62b=a149_0x25bc,_0x493e32=await apiRequest('/smartapi/dblink/create',{'method':_0x31f62b(0x107),'body':_0x34390c});return _0x493e32[_0x31f62b(0x103)];}export async function updateDbLink(_0x2ba0f2){const _0x1cf1da=a149_0x25bc,_0x1b4c23=await apiRequest(_0x1cf1da(0x123),{'method':'POST','body':_0x2ba0f2});return _0x1b4c23[_0x1cf1da(0x103)];}export async function deleteDbLink(_0x122fdc){const _0x228266=a149_0x25bc;await apiRequest(_0x228266(0xc4),{'method':'POST','body':{'id':_0x122fdc}});}export async function testDbLinkConnect(_0x1852a7){const _0x5a03c1=a149_0x25bc,_0x422941=await apiRequest(_0x5a03c1(0x106)+buildQuery({'id':_0x1852a7}));return _0x422941[_0x5a03c1(0x103)];}export async function startDbAnalysis(_0xf700c6,_0x269e26){const _0x173b14=a149_0x25bc,_0x45345d=await apiRequest('/smartapi/db-analysis/start',{'method':_0x173b14(0x107),'body':{'dbLinkId':_0xf700c6,..._0x269e26&&_0x269e26[_0x173b14(0x10c)]>0x0?{'tableNames':_0x269e26}:{}}}),_0xc99716=_0x45345d['data'];if(typeof _0xc99716===_0x173b14(0xc2))return _0xc99716;if(_0xc99716&&typeof _0xc99716===_0x173b14(0xf9)&&typeof _0xc99716[_0x173b14(0xd5)]===_0x173b14(0xc2))return _0xc99716[_0x173b14(0xd5)];return _0xc99716!=null?String(_0xc99716):'';}export async function cancelDbAnalysis(_0x476d4e){const _0x35c372=a149_0x25bc;await apiRequest(_0x35c372(0xcb)+buildQuery({'planId':_0x476d4e}),{'method':_0x35c372(0x107)});}export async function getDbAnalysisStatus(_0x57051c){const _0x246348=a149_0x25bc,_0x454b3a=await apiRequest(_0x246348(0xb4)+encodeURIComponent(_0x57051c));return _0x454b3a[_0x246348(0x103)];}export async function getDbAllTableList(_0x5c3e66,_0x4938c6){const _0x20d608=a149_0x25bc,_0x290ba3=await apiRequest(_0x20d608(0xed)+buildQuery({'appCode':_0x5c3e66,'dbLinkId':_0x4938c6})),_0x5678eb=_0x290ba3[_0x20d608(0x103)];if(Array[_0x20d608(0xf2)](_0x5678eb))return _0x5678eb;return extractList(_0x5678eb);}export async function getDbTableDiff(_0x457272,_0x54548e,_0x5249b8){const _0x39e985=a149_0x25bc,_0x24af30=await apiRequest(_0x39e985(0xd1)+buildQuery({'appCode':_0x457272,'dbLinkId':_0x54548e,'pageIndex':_0x5249b8?.[_0x39e985(0xff)]??0x1,'pageSize':_0x5249b8?.['pageSize']??0x14,'tableName':_0x5249b8?.[_0x39e985(0x12a)]})),_0x5214d8=_0x24af30[_0x39e985(0x103)];return{'totalCount':_0x5214d8?.[_0x39e985(0x102)]??0x0,'tableList':Array[_0x39e985(0xf2)](_0x5214d8?.[_0x39e985(0xaa)])?_0x5214d8[_0x39e985(0xaa)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2a34a0=a149_0x25bc,_0x5c04a2=await apiRequest(_0x2a34a0(0xd8),{'method':_0x2a34a0(0x107),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1874f7=extractList(_0x5c04a2['data']),_0x4c6ce9=extractPaging(_0x5c04a2[_0x2a34a0(0x103)]);return _0x4c6ce9&&_0x4c6ce9[_0x2a34a0(0x102)]>REMOTE_APP_PAGE_SIZE&&console[_0x2a34a0(0xfd)](_0x2a34a0(0x111)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x4c6ce9[_0x2a34a0(0x102)]+'\x20apps.\x20'+_0x2a34a0(0xb8)),_0x1874f7;}
@@ -1 +1 @@
1
- function a150_0x31d9(_0x3d13e0,_0x2667a2){_0x3d13e0=_0x3d13e0-0x137;const _0x38e7a5=a150_0x38e7();let _0x31d94e=_0x38e7a5[_0x3d13e0];return _0x31d94e;}function a150_0x38e7(){const _0x28e8f1=['1306990DfsVOW','20vtRliU','3711175OibXQa','8ZATsLG','11VYvgce','9FtoLEO','bff.lock.json','254848AWwfgD','2198245zKtFfd','511338nyInFZ','9PrRKOs','3867132BuTWns','.rabetbase','2hbkbCf','223122cFMbra'];a150_0x38e7=function(){return _0x28e8f1;};return a150_0x38e7();}const a150_0x4d9563=a150_0x31d9;(function(_0x221370,_0x2a35c7){const _0xf05291=a150_0x31d9,_0x59bc3c=_0x221370();while(!![]){try{const _0x4f800b=-parseInt(_0xf05291(0x13b))/0x1*(-parseInt(_0xf05291(0x13a))/0x2)+parseInt(_0xf05291(0x137))/0x3*(parseInt(_0xf05291(0x143))/0x4)+parseInt(_0xf05291(0x13d))/0x5*(-parseInt(_0xf05291(0x145))/0x6)+-parseInt(_0xf05291(0x144))/0x7*(parseInt(_0xf05291(0x13f))/0x8)+parseInt(_0xf05291(0x141))/0x9*(-parseInt(_0xf05291(0x13c))/0xa)+-parseInt(_0xf05291(0x140))/0xb*(-parseInt(_0xf05291(0x138))/0xc)+parseInt(_0xf05291(0x13e))/0xd;if(_0x4f800b===_0x2a35c7)break;else _0x59bc3c['push'](_0x59bc3c['shift']());}catch(_0x113aa0){_0x59bc3c['push'](_0x59bc3c['shift']());}}}(a150_0x38e7,0x39b50));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a150_0x4d9563(0x139),LOCK_FILE_NAME=a150_0x4d9563(0x142),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x23a568,_0x24c5c0){const _0x4dc28c=resolve(_0x24c5c0??findProjectRootDirectory()),_0x65ee01=DOT_DIR+'/bff',_0x44d790=_0x65ee01+'/'+_0x23a568;return{'projectRoot':_0x4dc28c,'appCode':_0x23a568,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x65ee01,'scriptsRoot':_0x44d790,'scriptsRootDir':resolve(_0x4dc28c,DOT_DIR,'bff',_0x23a568),'lockFilePath':resolve(_0x4dc28c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4dc28c,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a150_0x3739b3=a150_0x2e97;(function(_0x54834f,_0x463bfe){const _0x4f7bfe=a150_0x2e97,_0x2e241a=_0x54834f();while(!![]){try{const _0x49b8e5=-parseInt(_0x4f7bfe(0xb2))/0x1+-parseInt(_0x4f7bfe(0xb0))/0x2+-parseInt(_0x4f7bfe(0xaf))/0x3+parseInt(_0x4f7bfe(0xb3))/0x4*(-parseInt(_0x4f7bfe(0xa7))/0x5)+parseInt(_0x4f7bfe(0xac))/0x6*(-parseInt(_0x4f7bfe(0xab))/0x7)+-parseInt(_0x4f7bfe(0xaa))/0x8*(-parseInt(_0x4f7bfe(0xa9))/0x9)+parseInt(_0x4f7bfe(0xa6))/0xa;if(_0x49b8e5===_0x463bfe)break;else _0x2e241a['push'](_0x2e241a['shift']());}catch(_0x2ed3e0){_0x2e241a['push'](_0x2e241a['shift']());}}}(a150_0x34d4,0x47336));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a150_0x34d4(){const _0x20528f=['210GCiyaB','34596kXHgff','bff','bff-trash','1456896OQhKYA','22884NPjYhO','/bff','55545qumRtx','4HgxuSO','.rabetbase','8836500kYtGSz','2024255cLyKJD','bff.lock.json','9tzIHee','4307504uNAYSd'];a150_0x34d4=function(){return _0x20528f;};return a150_0x34d4();}function a150_0x2e97(_0x40b608,_0x3c59d6){_0x40b608=_0x40b608-0xa6;const _0x34d463=a150_0x34d4();let _0x2e973a=_0x34d463[_0x40b608];return _0x2e973a;}const DOT_DIR=a150_0x3739b3(0xb4),LOCK_FILE_NAME=a150_0x3739b3(0xa8),TRASH_DIR_NAME=a150_0x3739b3(0xae);export function loadBffProjectConfig(_0x4cdc15,_0x527ade){const _0x123feb=a150_0x3739b3,_0x358bc0=resolve(_0x527ade??findProjectRootDirectory()),_0x106b94=DOT_DIR+_0x123feb(0xb1),_0x3525f8=_0x106b94+'/'+_0x4cdc15;return{'projectRoot':_0x358bc0,'appCode':_0x4cdc15,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x106b94,'scriptsRoot':_0x3525f8,'scriptsRootDir':resolve(_0x358bc0,DOT_DIR,_0x123feb(0xad),_0x4cdc15),'lockFilePath':resolve(_0x358bc0,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x358bc0,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- function a151_0x4f40(_0x43ab69,_0xc4944f){_0x43ab69=_0x43ab69-0x152;const _0x4f214d=a151_0x4f21();let _0x4f40ed=_0x4f214d[_0x43ab69];return _0x4f40ed;}const a151_0x52e12d=a151_0x4f40;(function(_0x341c0f,_0x53931a){const _0x1dc4a3=a151_0x4f40,_0x57d3d9=_0x341c0f();while(!![]){try{const _0x54a450=parseInt(_0x1dc4a3(0x154))/0x1+-parseInt(_0x1dc4a3(0x15f))/0x2+-parseInt(_0x1dc4a3(0x164))/0x3*(parseInt(_0x1dc4a3(0x165))/0x4)+parseInt(_0x1dc4a3(0x175))/0x5+parseInt(_0x1dc4a3(0x153))/0x6*(parseInt(_0x1dc4a3(0x16a))/0x7)+-parseInt(_0x1dc4a3(0x160))/0x8+-parseInt(_0x1dc4a3(0x15a))/0x9;if(_0x54a450===_0x53931a)break;else _0x57d3d9['push'](_0x57d3d9['shift']());}catch(_0x1fea71){_0x57d3d9['push'](_0x57d3d9['shift']());}}}(a151_0x4f21,0x348f3));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=[a151_0x52e12d(0x166),a151_0x52e12d(0x178),a151_0x52e12d(0x16c)];export function normalizeBffType(_0x22e0a7){const _0x28215f=a151_0x52e12d;if(!_0x22e0a7)return undefined;const _0x591681=_0x22e0a7['trim']()[_0x28215f(0x15d)]();return SUPPORTED_BFF_TYPES[_0x28215f(0x16f)](_0x591681)?_0x591681:undefined;}async function scanJsFilesRecursively(_0x40899a,_0x4e9270){const _0x1d7165=a151_0x52e12d,_0x298f75=[];try{const _0x4994e3=await readdir(_0x40899a,{'withFileTypes':!![]});for(const _0x5b6e7b of _0x4994e3){const _0x170758=join(_0x40899a,_0x5b6e7b[_0x1d7165(0x171)]);if(_0x5b6e7b[_0x1d7165(0x168)]())_0x298f75[_0x1d7165(0x16b)](...await scanJsFilesRecursively(_0x170758,_0x4e9270+'/'+_0x5b6e7b[_0x1d7165(0x171)]));else _0x5b6e7b[_0x1d7165(0x16e)]()&&_0x5b6e7b[_0x1d7165(0x171)][_0x1d7165(0x170)](_0x1d7165(0x158))&&_0x298f75[_0x1d7165(0x16b)]({'lockKey':_0x4e9270+'/'+_0x5b6e7b[_0x1d7165(0x171)][_0x1d7165(0x169)](/\.js$/,''),'filePath':_0x170758});}}catch(_0x3fbb74){if(_0x3fbb74['code']!==_0x1d7165(0x173))throw _0x3fbb74;}return _0x298f75;}async function scanFlatFunctions(_0x8eec72,_0x41ffa5){const _0x235eea=a151_0x52e12d,_0x30017a=join(_0x8eec72[_0x235eea(0x163)],_0x41ffa5),_0x24944a=await scanJsFilesRecursively(_0x30017a,_0x41ffa5);return _0x24944a[_0x235eea(0x162)](({lockKey:_0x24ce14,filePath:_0x2b6aa6})=>({'type':_0x41ffa5,'name':_0x24ce14[_0x235eea(0x161)]('/')['at'](-0x1)??'','filePath':_0x2b6aa6,'lockKey':_0x24ce14}));}async function scanHookFunctions(_0x16b3db){const _0x5ab587=a151_0x52e12d,_0x409b89=join(_0x16b3db[_0x5ab587(0x163)],'HOOK'),_0x378b8c=[];try{const _0x381ebc=await readdir(_0x409b89,{'withFileTypes':!![]});for(const _0x5ccd1d of _0x381ebc){if(!_0x5ccd1d[_0x5ab587(0x168)]())continue;const _0x467218=_0x5ccd1d['name'],_0x221213=join(_0x409b89,_0x467218),_0x5dabaa=await readdir(_0x221213,{'withFileTypes':!![]});for(const _0x16555c of _0x5dabaa){if(!_0x16555c['isDirectory']())continue;const _0x3fc7f0=_0x16555c[_0x5ab587(0x171)],_0xf285c9=join(_0x221213,_0x3fc7f0),_0x58cdf2=await readdir(_0xf285c9,{'withFileTypes':!![]});for(const _0x430014 of _0x58cdf2){if(!_0x430014[_0x5ab587(0x168)]())continue;const _0x4f986d=_0x430014[_0x5ab587(0x171)],_0x34960b=join(_0xf285c9,_0x4f986d),_0x1966fc=await readdir(_0x34960b,{'withFileTypes':!![]});for(const _0x490d29 of _0x1966fc){if(!_0x490d29[_0x5ab587(0x16e)]()||!_0x490d29[_0x5ab587(0x171)][_0x5ab587(0x170)](_0x5ab587(0x158)))continue;const _0x23bc3c=_0x490d29[_0x5ab587(0x171)][_0x5ab587(0x169)](/\.js$/,'');_0x378b8c['push']({'type':'HOOK','name':_0x23bc3c,'filePath':join(_0x34960b,_0x490d29['name']),'lockKey':'HOOK/'+_0x467218+'/'+_0x3fc7f0+'/'+_0x4f986d+'/'+_0x23bc3c,'alias':_0x467218,'operationType':_0x3fc7f0,'functionNode':_0x4f986d});}}}}}catch(_0x10d12f){if(_0x10d12f[_0x5ab587(0x16d)]!=='ENOENT')throw _0x10d12f;}return _0x378b8c;}export async function scanLocalBffFunctions(_0x194333,_0x19272e){const _0x99de08=a151_0x52e12d;if(_0x19272e===_0x99de08(0x166)||_0x19272e===_0x99de08(0x178))return scanFlatFunctions(_0x194333,_0x19272e);if(_0x19272e===_0x99de08(0x16c))return scanHookFunctions(_0x194333);const [_0xcc4fe9,_0x3d7905,_0x26e735]=await Promise[_0x99de08(0x155)]([scanFlatFunctions(_0x194333,_0x99de08(0x166)),scanFlatFunctions(_0x194333,_0x99de08(0x178)),scanHookFunctions(_0x194333)]);return[..._0xcc4fe9,..._0x3d7905,..._0x26e735];}export function resolveLocalFilePathFromLockKey(_0x4e78c3,_0x260eb5){const _0x39115e=a151_0x52e12d;return join(_0x4e78c3[_0x39115e(0x163)],..._0x260eb5[_0x39115e(0x161)]('/'))+_0x39115e(0x158);}export function createHookLocationMap(_0x56e439){const _0x36c77e=a151_0x52e12d,_0x9b8891=new Map();for(const _0x55bb5c of _0x56e439){_0x55bb5c['beforeScriptId']&&_0x9b8891[_0x36c77e(0x157)](_0x55bb5c[_0x36c77e(0x15e)],{'datasetCode':_0x55bb5c[_0x36c77e(0x156)],'operationType':snakeToCamel(_0x55bb5c['operationType']),'functionNode':'before'}),_0x55bb5c[_0x36c77e(0x177)]&&_0x9b8891['set'](_0x55bb5c['afterScriptId'],{'datasetCode':_0x55bb5c['datasetCode'],'operationType':snakeToCamel(_0x55bb5c[_0x36c77e(0x172)]),'functionNode':_0x36c77e(0x15b)});}return _0x9b8891;}export function resolveRemoteScriptTarget(_0x11c766,_0x2e2567,_0x31c808,_0x2892c3,_0x3616f3){const _0x1595e6=a151_0x52e12d,_0x463233=normalizeBffType(_0x2e2567[_0x1595e6(0x159)]);if(!_0x463233||!_0x2e2567[_0x1595e6(0x174)])return null;if(_0x463233===_0x1595e6(0x16c)){const _0x257d06=(_0x2e2567['id']?_0x31c808[_0x1595e6(0x176)](_0x2e2567['id']):undefined)??findHookLocationByRemoteId(_0x2892c3,_0x2e2567['id']);if(!_0x257d06)return null;const _0x4718ae=_0x257d06[_0x1595e6(0x167)]||_0x3616f3[_0x1595e6(0x176)](_0x257d06[_0x1595e6(0x156)]),_0x226542=_0x4718ae??_0x257d06['datasetCode'],_0xab87f={..._0x257d06,'alias':_0x4718ae},_0x53cd17=_0x1595e6(0x15c)+_0x226542+'/'+_0xab87f[_0x1595e6(0x172)]+'/'+_0xab87f['functionNode']+'/'+_0x2e2567[_0x1595e6(0x174)];return{'lockKey':_0x53cd17,'filePath':resolveLocalFilePathFromLockKey(_0x11c766,_0x53cd17),'type':_0x1595e6(0x16c),'hookLocation':_0xab87f};}const _0x27cc5c=_0x463233+'/'+_0x2e2567[_0x1595e6(0x174)];return{'lockKey':_0x27cc5c,'filePath':resolveLocalFilePathFromLockKey(_0x11c766,_0x27cc5c),'type':_0x463233};}export async function ensureParentDirectory(_0x19caf5){await mkdir(dirname(_0x19caf5),{'recursive':!![]});}function a151_0x4f21(){const _0x34eb2e=['alias','isDirectory','replace','1329062XBISCR','push','HOOK','code','isFile','includes','endsWith','name','operationType','ENOENT','functionName','1851825XDgxbD','get','afterScriptId','ENDPOINT','F_OK','12IQsVUq','212248EVBbPI','all','datasetCode','set','.js','scriptType','1501578khmUVj','after','HOOK/','toUpperCase','beforeScriptId','430760SPHKoU','451936zikrEj','split','map','scriptsRootDir','942aSxOaN','3928iNYwkj','COMMON'];a151_0x4f21=function(){return _0x34eb2e;};return a151_0x4f21();}export async function fileExists(_0x486f8b){const _0x325332=a151_0x52e12d;try{return await access(_0x486f8b,constants[_0x325332(0x152)]),!![];}catch{return![];}}export async function directoryExists(_0x2fad1e){const _0x53781b=a151_0x52e12d;try{const _0x31eab4=await stat(_0x2fad1e);return _0x31eab4[_0x53781b(0x168)]();}catch{return![];}}
1
+ const a151_0x3e616f=a151_0x2ce0;(function(_0x438150,_0x459878){const _0x5a6aa8=a151_0x2ce0,_0x423f07=_0x438150();while(!![]){try{const _0x16757d=-parseInt(_0x5a6aa8(0x114))/0x1+-parseInt(_0x5a6aa8(0x129))/0x2+parseInt(_0x5a6aa8(0x136))/0x3+-parseInt(_0x5a6aa8(0x123))/0x4+parseInt(_0x5a6aa8(0x118))/0x5+parseInt(_0x5a6aa8(0x12e))/0x6+parseInt(_0x5a6aa8(0x139))/0x7*(parseInt(_0x5a6aa8(0x115))/0x8);if(_0x16757d===_0x459878)break;else _0x423f07['push'](_0x423f07['shift']());}catch(_0x352052){_0x423f07['push'](_0x423f07['shift']());}}}(a151_0x39b9,0x43b48));import{access,mkdir,readdir,stat}from'node:fs/promises';function a151_0x39b9(){const _0x303250=['1731664cyyBXi','get','split','before','name','set','583888hebPyF','functionName','afterScriptId','operationType','replace','2784990sTFowS','HOOK/','.js','endsWith','F_OK','toUpperCase','beforeScriptId','scriptsRootDir','748035UbYFjz','includes','scriptType','153601IuMiSd','COMMON','HOOK','513379CNGpep','240DEVBnf','isFile','ENOENT','718795BBveGr','datasetCode','trim','map','after','code','all','alias','isDirectory','ENDPOINT','push'];a151_0x39b9=function(){return _0x303250;};return a151_0x39b9();}import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a151_0x3e616f(0x13a),'ENDPOINT',a151_0x3e616f(0x113)];export function normalizeBffType(_0x447aba){const _0x112246=a151_0x3e616f;if(!_0x447aba)return undefined;const _0xf86f77=_0x447aba[_0x112246(0x11a)]()[_0x112246(0x133)]();return SUPPORTED_BFF_TYPES[_0x112246(0x137)](_0xf86f77)?_0xf86f77:undefined;}async function scanJsFilesRecursively(_0x2371df,_0x305d06){const _0xc62c60=a151_0x3e616f,_0x3359c8=[];try{const _0x588ef5=await readdir(_0x2371df,{'withFileTypes':!![]});for(const _0x391463 of _0x588ef5){const _0x16d0d3=join(_0x2371df,_0x391463[_0xc62c60(0x127)]);if(_0x391463['isDirectory']())_0x3359c8[_0xc62c60(0x122)](...await scanJsFilesRecursively(_0x16d0d3,_0x305d06+'/'+_0x391463[_0xc62c60(0x127)]));else _0x391463[_0xc62c60(0x116)]()&&_0x391463['name']['endsWith'](_0xc62c60(0x130))&&_0x3359c8[_0xc62c60(0x122)]({'lockKey':_0x305d06+'/'+_0x391463['name'][_0xc62c60(0x12d)](/\.js$/,''),'filePath':_0x16d0d3});}}catch(_0x72330f){if(_0x72330f[_0xc62c60(0x11d)]!==_0xc62c60(0x117))throw _0x72330f;}return _0x3359c8;}async function scanFlatFunctions(_0x9f505c,_0x36356a){const _0x53cd6b=a151_0x3e616f,_0xef081a=join(_0x9f505c[_0x53cd6b(0x135)],_0x36356a),_0x404f2c=await scanJsFilesRecursively(_0xef081a,_0x36356a);return _0x404f2c[_0x53cd6b(0x11b)](({lockKey:_0x1e8d95,filePath:_0x3a1196})=>({'type':_0x36356a,'name':_0x1e8d95[_0x53cd6b(0x125)]('/')['at'](-0x1)??'','filePath':_0x3a1196,'lockKey':_0x1e8d95}));}async function scanHookFunctions(_0x28a5e9){const _0x45ef1e=a151_0x3e616f,_0x192b14=join(_0x28a5e9[_0x45ef1e(0x135)],'HOOK'),_0x463101=[];try{const _0x213df2=await readdir(_0x192b14,{'withFileTypes':!![]});for(const _0x578c02 of _0x213df2){if(!_0x578c02['isDirectory']())continue;const _0x49098a=_0x578c02[_0x45ef1e(0x127)],_0x25bdc4=join(_0x192b14,_0x49098a),_0x3abecf=await readdir(_0x25bdc4,{'withFileTypes':!![]});for(const _0x445c80 of _0x3abecf){if(!_0x445c80[_0x45ef1e(0x120)]())continue;const _0x58339b=_0x445c80[_0x45ef1e(0x127)],_0x5150df=join(_0x25bdc4,_0x58339b),_0x442e84=await readdir(_0x5150df,{'withFileTypes':!![]});for(const _0x5619e1 of _0x442e84){if(!_0x5619e1[_0x45ef1e(0x120)]())continue;const _0x518eb9=_0x5619e1[_0x45ef1e(0x127)],_0x9e616c=join(_0x5150df,_0x518eb9),_0x259a74=await readdir(_0x9e616c,{'withFileTypes':!![]});for(const _0x3b2fed of _0x259a74){if(!_0x3b2fed[_0x45ef1e(0x116)]()||!_0x3b2fed[_0x45ef1e(0x127)][_0x45ef1e(0x131)](_0x45ef1e(0x130)))continue;const _0x525b09=_0x3b2fed[_0x45ef1e(0x127)][_0x45ef1e(0x12d)](/\.js$/,'');_0x463101[_0x45ef1e(0x122)]({'type':_0x45ef1e(0x113),'name':_0x525b09,'filePath':join(_0x9e616c,_0x3b2fed['name']),'lockKey':_0x45ef1e(0x12f)+_0x49098a+'/'+_0x58339b+'/'+_0x518eb9+'/'+_0x525b09,'alias':_0x49098a,'operationType':_0x58339b,'functionNode':_0x518eb9});}}}}}catch(_0x4b890d){if(_0x4b890d[_0x45ef1e(0x11d)]!=='ENOENT')throw _0x4b890d;}return _0x463101;}function a151_0x2ce0(_0x4666c9,_0x48a290){_0x4666c9=_0x4666c9-0x113;const _0x39b977=a151_0x39b9();let _0x2ce001=_0x39b977[_0x4666c9];return _0x2ce001;}export async function scanLocalBffFunctions(_0x2130ab,_0x3da61b){const _0x20a6d9=a151_0x3e616f;if(_0x3da61b===_0x20a6d9(0x13a)||_0x3da61b===_0x20a6d9(0x121))return scanFlatFunctions(_0x2130ab,_0x3da61b);if(_0x3da61b===_0x20a6d9(0x113))return scanHookFunctions(_0x2130ab);const [_0x47eb31,_0x2249f5,_0x4eff81]=await Promise[_0x20a6d9(0x11e)]([scanFlatFunctions(_0x2130ab,'COMMON'),scanFlatFunctions(_0x2130ab,'ENDPOINT'),scanHookFunctions(_0x2130ab)]);return[..._0x47eb31,..._0x2249f5,..._0x4eff81];}export function resolveLocalFilePathFromLockKey(_0x13ac94,_0xf65b7){const _0x2d1712=a151_0x3e616f;return join(_0x13ac94[_0x2d1712(0x135)],..._0xf65b7[_0x2d1712(0x125)]('/'))+_0x2d1712(0x130);}export function createHookLocationMap(_0x1f087a){const _0x2b00ed=a151_0x3e616f,_0x278f8b=new Map();for(const _0x141a88 of _0x1f087a){_0x141a88['beforeScriptId']&&_0x278f8b[_0x2b00ed(0x128)](_0x141a88[_0x2b00ed(0x134)],{'datasetCode':_0x141a88['datasetCode'],'operationType':snakeToCamel(_0x141a88['operationType']),'functionNode':_0x2b00ed(0x126)}),_0x141a88[_0x2b00ed(0x12b)]&&_0x278f8b['set'](_0x141a88[_0x2b00ed(0x12b)],{'datasetCode':_0x141a88[_0x2b00ed(0x119)],'operationType':snakeToCamel(_0x141a88[_0x2b00ed(0x12c)]),'functionNode':_0x2b00ed(0x11c)});}return _0x278f8b;}export function resolveRemoteScriptTarget(_0x55849b,_0x3e4adb,_0x54c697,_0x218423,_0x5e6416){const _0x12f880=a151_0x3e616f,_0xd568c8=normalizeBffType(_0x3e4adb[_0x12f880(0x138)]);if(!_0xd568c8||!_0x3e4adb[_0x12f880(0x12a)])return null;if(_0xd568c8===_0x12f880(0x113)){const _0x449114=(_0x3e4adb['id']?_0x54c697['get'](_0x3e4adb['id']):undefined)??findHookLocationByRemoteId(_0x218423,_0x3e4adb['id']);if(!_0x449114)return null;const _0x2862be=_0x449114[_0x12f880(0x11f)]||_0x5e6416[_0x12f880(0x124)](_0x449114[_0x12f880(0x119)]),_0x1b2997=_0x2862be??_0x449114['datasetCode'],_0x38dda2={..._0x449114,'alias':_0x2862be},_0x28055c=_0x12f880(0x12f)+_0x1b2997+'/'+_0x38dda2[_0x12f880(0x12c)]+'/'+_0x38dda2['functionNode']+'/'+_0x3e4adb[_0x12f880(0x12a)];return{'lockKey':_0x28055c,'filePath':resolveLocalFilePathFromLockKey(_0x55849b,_0x28055c),'type':_0x12f880(0x113),'hookLocation':_0x38dda2};}const _0x2ce25c=_0xd568c8+'/'+_0x3e4adb[_0x12f880(0x12a)];return{'lockKey':_0x2ce25c,'filePath':resolveLocalFilePathFromLockKey(_0x55849b,_0x2ce25c),'type':_0xd568c8};}export async function ensureParentDirectory(_0x2b6cd5){await mkdir(dirname(_0x2b6cd5),{'recursive':!![]});}export async function fileExists(_0x38f51f){const _0x4df5fa=a151_0x3e616f;try{return await access(_0x38f51f,constants[_0x4df5fa(0x132)]),!![];}catch{return![];}}export async function directoryExists(_0x5ed4b6){const _0xbca7e6=a151_0x3e616f;try{const _0x4186f3=await stat(_0x5ed4b6);return _0x4186f3[_0xbca7e6(0x120)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x5ec9d1,_0x1a62f4){const _0x4d6f27=a152_0x50c9,_0x7e8d84=_0x5ec9d1();while(!![]){try{const _0x5c1eec=-parseInt(_0x4d6f27(0x82))/0x1+parseInt(_0x4d6f27(0x71))/0x2*(-parseInt(_0x4d6f27(0x7c))/0x3)+-parseInt(_0x4d6f27(0x80))/0x4+parseInt(_0x4d6f27(0x81))/0x5*(parseInt(_0x4d6f27(0x76))/0x6)+parseInt(_0x4d6f27(0x78))/0x7*(parseInt(_0x4d6f27(0x79))/0x8)+parseInt(_0x4d6f27(0x77))/0x9*(-parseInt(_0x4d6f27(0x75))/0xa)+parseInt(_0x4d6f27(0x7f))/0xb*(parseInt(_0x4d6f27(0x73))/0xc);if(_0x5c1eec===_0x1a62f4)break;else _0x7e8d84['push'](_0x7e8d84['shift']());}catch(_0x1a8474){_0x7e8d84['push'](_0x7e8d84['shift']());}}}(a152_0x6f32,0x703b9));function a152_0x50c9(_0x5cbf4c,_0x433180){_0x5cbf4c=_0x5cbf4c-0x71;const _0x6f32eb=a152_0x6f32();let _0x50c990=_0x6f32eb[_0x5cbf4c];return _0x50c990;}import{readFile}from'node:fs/promises';import a152_0x642807 from'node:crypto';export function computeContentHash(_0xe78911){const _0x3bdcb2=a152_0x50c9;return a152_0x642807[_0x3bdcb2(0x7a)](_0x3bdcb2(0x7d))[_0x3bdcb2(0x72)](_0xe78911)[_0x3bdcb2(0x7e)](_0x3bdcb2(0x7b));}function a152_0x6f32(){const _0x721130=['md5','digest','55mDKNgx','3063272nHfFtl','10VBWVUD','490833kNKuJc','226684PhOZEO','update','2427276CHKKRS','utf8','7060ciNiGh','973506yHOpkX','3132cTGgNy','553gDjQBq','74888RlNteE','createHash','hex','3arauyE'];a152_0x6f32=function(){return _0x721130;};return a152_0x6f32();}export async function computeFileHash(_0x564d24){const _0x4ef44f=a152_0x50c9,_0x3a0ae1=await readFile(_0x564d24,_0x4ef44f(0x74));return computeContentHash(_0x3a0ae1);}
1
+ function a152_0xf323(_0x1c007a,_0x24c76f){_0x1c007a=_0x1c007a-0x166;const _0x4bd187=a152_0x4bd1();let _0xf3230e=_0x4bd187[_0x1c007a];return _0xf3230e;}(function(_0x3fcc4e,_0x36bb7e){const _0x28f4b7=a152_0xf323,_0x4e9a71=_0x3fcc4e();while(!![]){try{const _0x11e473=-parseInt(_0x28f4b7(0x173))/0x1+parseInt(_0x28f4b7(0x16a))/0x2+-parseInt(_0x28f4b7(0x168))/0x3*(parseInt(_0x28f4b7(0x16d))/0x4)+-parseInt(_0x28f4b7(0x175))/0x5+parseInt(_0x28f4b7(0x172))/0x6*(-parseInt(_0x28f4b7(0x166))/0x7)+parseInt(_0x28f4b7(0x16f))/0x8*(-parseInt(_0x28f4b7(0x167))/0x9)+-parseInt(_0x28f4b7(0x16c))/0xa*(-parseInt(_0x28f4b7(0x16e))/0xb);if(_0x11e473===_0x36bb7e)break;else _0x4e9a71['push'](_0x4e9a71['shift']());}catch(_0x52089a){_0x4e9a71['push'](_0x4e9a71['shift']());}}}(a152_0x4bd1,0x7dae3));import{readFile}from'node:fs/promises';import a152_0x300766 from'node:crypto';export function computeContentHash(_0x38a98b){const _0xbe2a1d=a152_0xf323;return a152_0x300766['createHash'](_0xbe2a1d(0x16b))[_0xbe2a1d(0x170)](_0x38a98b)[_0xbe2a1d(0x169)](_0xbe2a1d(0x174));}export async function computeFileHash(_0x5a7992){const _0x212b80=a152_0xf323,_0x121217=await readFile(_0x5a7992,_0x212b80(0x171));return computeContentHash(_0x121217);}function a152_0x4bd1(){const _0x3ed1d4=['4842hdeuPZ','2429613gjRNSD','digest','229558pfnsgb','md5','290wauxlP','4hDClMy','1241867lrnirH','3056QgiZOF','update','utf8','1260DnqtbK','790521JTtXzZ','hex','963035cVMATu','29183cGKFxn'];a152_0x4bd1=function(){return _0x3ed1d4;};return a152_0x4bd1();}
@@ -1 +1 @@
1
- function a153_0x23fa(){const _0x1410e3=['Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','5637191MGNpWU','6DVJqxY','code',':\x20scriptsRoot\x20mismatch\x20—\x20','parse','3489345ICADpP','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','lastSync','scriptsRoot','stringify','58285LzQAiD','8JcmzTr','1042253RPXaVB','1181799aSgdRJ','4GmZpLZ','84986gCzrnU','925346JXtjwt','current\x20\x22','2630HAcGrB','object','apps','ENOENT','utf8'];a153_0x23fa=function(){return _0x1410e3;};return a153_0x23fa();}(function(_0x1f72ef,_0x4666c8){const _0x3e5454=a153_0x3cb6,_0xed0eea=_0x1f72ef();while(!![]){try{const _0x540912=-parseInt(_0x3e5454(0x1c0))/0x1+-parseInt(_0x3e5454(0x1c4))/0x2+-parseInt(_0x3e5454(0x1c1))/0x3*(parseInt(_0x3e5454(0x1c2))/0x4)+parseInt(_0x3e5454(0x1be))/0x5*(-parseInt(_0x3e5454(0x1b5))/0x6)+-parseInt(_0x3e5454(0x1b4))/0x7*(-parseInt(_0x3e5454(0x1bf))/0x8)+-parseInt(_0x3e5454(0x1b9))/0x9+-parseInt(_0x3e5454(0x1c6))/0xa*(-parseInt(_0x3e5454(0x1c3))/0xb);if(_0x540912===_0x4666c8)break;else _0xed0eea['push'](_0xed0eea['shift']());}catch(_0x46f4fa){_0xed0eea['push'](_0xed0eea['shift']());}}}(a153_0x23fa,0x83996));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a153_0x3cb6(_0x41c3db,_0x26c5a0){_0x41c3db=_0x41c3db-0x1b0;const _0x23fadf=a153_0x23fa();let _0x3cb6aa=_0x23fadf[_0x41c3db];return _0x3cb6aa;}export function ensureLockScope(_0x5a55ec,_0x569645,_0x52de31,_0x1d79a6){const _0x52d71a=a153_0x3cb6,_0x5765d3={'apps':_0x5a55ec[_0x52d71a(0x1b0)]&&typeof _0x5a55ec[_0x52d71a(0x1b0)]==='object'?_0x5a55ec['apps']:{}};let _0x2fc369=_0x5765d3[_0x52d71a(0x1b0)][_0x569645];if(!_0x2fc369)return _0x2fc369={'scriptsRoot':_0x52de31,'lastSync':'','functions':{}},_0x5765d3[_0x52d71a(0x1b0)][_0x569645]=_0x2fc369,{'lockData':_0x5765d3,'appLock':_0x2fc369};if(!_0x2fc369[_0x52d71a(0x1bc)])_0x2fc369['scriptsRoot']=_0x52de31;else{if(_0x2fc369[_0x52d71a(0x1bc)]!==_0x52de31)throw new Error(_0x1d79a6+_0x52d71a(0x1b7)+(_0x52d71a(0x1c5)+_0x52de31+'\x22\x20vs\x20lock\x20\x22'+_0x2fc369[_0x52d71a(0x1bc)]+'\x22.\x20')+_0x52d71a(0x1b3));}return!_0x2fc369['functions']&&(_0x2fc369['functions']={}),!_0x2fc369['lastSync']&&(_0x2fc369[_0x52d71a(0x1bb)]=''),{'lockData':_0x5765d3,'appLock':_0x2fc369};}export async function readBffLockFile(_0x5dce30){const _0xf77823=a153_0x3cb6;try{const _0x15def1=await readFile(_0x5dce30,_0xf77823(0x1b2)),_0x3e71ee=JSON[_0xf77823(0x1b8)](_0x15def1);return{'apps':_0x3e71ee[_0xf77823(0x1b0)]&&typeof _0x3e71ee[_0xf77823(0x1b0)]===_0xf77823(0x1c7)?_0x3e71ee[_0xf77823(0x1b0)]:{}};}catch(_0x298e49){if(_0x298e49[_0xf77823(0x1b6)]===_0xf77823(0x1b1))return null;throw new Error(_0xf77823(0x1ba)+String(_0x298e49));}}export async function writeBffLockFile(_0xce129c,_0x27612e){const _0x122a83=a153_0x3cb6;await mkdir(dirname(_0xce129c),{'recursive':!![]}),await writeFile(_0xce129c,JSON[_0x122a83(0x1bd)](_0x27612e,null,0x2),'utf8');}
1
+ function a153_0x4329(_0x2d2619,_0x5e2b8c){_0x2d2619=_0x2d2619-0x1ce;const _0x2d3aba=a153_0x2d3a();let _0x43294d=_0x2d3aba[_0x2d2619];return _0x43294d;}(function(_0x3e52a9,_0x3ca283){const _0x543eb6=a153_0x4329,_0x278d31=_0x3e52a9();while(!![]){try{const _0x27dfa2=-parseInt(_0x543eb6(0x1d2))/0x1*(-parseInt(_0x543eb6(0x1dd))/0x2)+-parseInt(_0x543eb6(0x1e1))/0x3+parseInt(_0x543eb6(0x1d0))/0x4+-parseInt(_0x543eb6(0x1d9))/0x5*(-parseInt(_0x543eb6(0x1de))/0x6)+parseInt(_0x543eb6(0x1d6))/0x7+-parseInt(_0x543eb6(0x1db))/0x8*(parseInt(_0x543eb6(0x1d3))/0x9)+-parseInt(_0x543eb6(0x1e0))/0xa;if(_0x27dfa2===_0x3ca283)break;else _0x278d31['push'](_0x278d31['shift']());}catch(_0x32ef4b){_0x278d31['push'](_0x278d31['shift']());}}}(a153_0x2d3a,0xb98c4));function a153_0x2d3a(){const _0x2dff93=['ENOENT','5006752rojZUn','current\x20\x22','109588mRrDfz','81981pQZtqq','lastSync','code','4549720dVksKK','apps','parse','6383025igsMqu','object','608LKJHhn','functions','2dhRCdp','6GUXlAT','utf8','14196570TbgqwE','1247688btJVVQ','stringify','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20',':\x20scriptsRoot\x20mismatch\x20—\x20','scriptsRoot','\x22.\x20'];a153_0x2d3a=function(){return _0x2dff93;};return a153_0x2d3a();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x57a4b6,_0x34c44b,_0x3a2b6b,_0x22bd16){const _0x3906f2=a153_0x4329,_0x19c863={'apps':_0x57a4b6[_0x3906f2(0x1d7)]&&typeof _0x57a4b6[_0x3906f2(0x1d7)]===_0x3906f2(0x1da)?_0x57a4b6[_0x3906f2(0x1d7)]:{}};let _0x3caf3d=_0x19c863[_0x3906f2(0x1d7)][_0x34c44b];if(!_0x3caf3d)return _0x3caf3d={'scriptsRoot':_0x3a2b6b,'lastSync':'','functions':{}},_0x19c863['apps'][_0x34c44b]=_0x3caf3d,{'lockData':_0x19c863,'appLock':_0x3caf3d};if(!_0x3caf3d['scriptsRoot'])_0x3caf3d[_0x3906f2(0x1e6)]=_0x3a2b6b;else{if(_0x3caf3d[_0x3906f2(0x1e6)]!==_0x3a2b6b)throw new Error(_0x22bd16+_0x3906f2(0x1e5)+(_0x3906f2(0x1d1)+_0x3a2b6b+'\x22\x20vs\x20lock\x20\x22'+_0x3caf3d[_0x3906f2(0x1e6)]+_0x3906f2(0x1ce))+_0x3906f2(0x1e3));}return!_0x3caf3d[_0x3906f2(0x1dc)]&&(_0x3caf3d['functions']={}),!_0x3caf3d[_0x3906f2(0x1d4)]&&(_0x3caf3d[_0x3906f2(0x1d4)]=''),{'lockData':_0x19c863,'appLock':_0x3caf3d};}export async function readBffLockFile(_0x26e332){const _0x1fd7aa=a153_0x4329;try{const _0x8933ff=await readFile(_0x26e332,'utf8'),_0x5f5f1e=JSON[_0x1fd7aa(0x1d8)](_0x8933ff);return{'apps':_0x5f5f1e[_0x1fd7aa(0x1d7)]&&typeof _0x5f5f1e[_0x1fd7aa(0x1d7)]===_0x1fd7aa(0x1da)?_0x5f5f1e[_0x1fd7aa(0x1d7)]:{}};}catch(_0x1f6636){if(_0x1f6636[_0x1fd7aa(0x1d5)]===_0x1fd7aa(0x1cf))return null;throw new Error(_0x1fd7aa(0x1e4)+String(_0x1f6636));}}export async function writeBffLockFile(_0x4a2f57,_0x329779){const _0x52e636=a153_0x4329;await mkdir(dirname(_0x4a2f57),{'recursive':!![]}),await writeFile(_0x4a2f57,JSON[_0x52e636(0x1e2)](_0x329779,null,0x2),_0x52e636(0x1df));}
@@ -1 +1 @@
1
- function a155_0x47d4(_0x4e8082,_0xaaec3){_0x4e8082=_0x4e8082-0x196;const _0x477302=a155_0x4773();let _0x47d4c6=_0x477302[_0x4e8082];return _0x47d4c6;}(function(_0x1f1834,_0x4cc592){const _0x15cac5=a155_0x47d4,_0x5414e8=_0x1f1834();while(!![]){try{const _0x268db7=-parseInt(_0x15cac5(0x1a8))/0x1+-parseInt(_0x15cac5(0x19d))/0x2+parseInt(_0x15cac5(0x19b))/0x3*(parseInt(_0x15cac5(0x1a5))/0x4)+parseInt(_0x15cac5(0x1a2))/0x5+parseInt(_0x15cac5(0x196))/0x6*(-parseInt(_0x15cac5(0x19a))/0x7)+-parseInt(_0x15cac5(0x1a6))/0x8+parseInt(_0x15cac5(0x199))/0x9*(parseInt(_0x15cac5(0x1a4))/0xa);if(_0x268db7===_0x4cc592)break;else _0x5414e8['push'](_0x5414e8['shift']());}catch(_0x4b26e4){_0x5414e8['push'](_0x5414e8['shift']());}}}(a155_0x4773,0x83671));export function snakeToCamel(_0x1021dc){const _0x6bb105=a155_0x47d4;return _0x1021dc[_0x6bb105(0x197)]()[_0x6bb105(0x1a1)](/_([a-z])/g,(_0x5a11fe,_0x90ba4d)=>_0x90ba4d[_0x6bb105(0x1a0)]());}export function findHookLocationByRemoteId(_0xac7221,_0x304ba1){const _0x230cd0=a155_0x47d4;if(!_0x304ba1)return undefined;for(const _0x57f7e0 of Object['values'](_0xac7221)){if(_0x57f7e0['remoteId']===_0x304ba1&&_0x57f7e0[_0x230cd0(0x1a9)]&&_0x57f7e0['operationType']&&_0x57f7e0['functionNode'])return{'datasetCode':_0x57f7e0[_0x230cd0(0x1a9)],'operationType':_0x57f7e0[_0x230cd0(0x1a3)],'functionNode':_0x57f7e0[_0x230cd0(0x198)]};}return undefined;}function a155_0x4773(){const _0x4105ae=['520596tQSfFk','2191CZQDzg','325425JxJGXt','before','1802556ZiiNJC','test','match','toUpperCase','replace','2739280ZHTytU','operationType','230mbXwbs','20elvelf','259616DoMhxS','trim','326757xpuxOk','datasetCode','11922bBbpWN','toLowerCase','functionNode'];a155_0x4773=function(){return _0x4105ae;};return a155_0x4773();}export function extractScriptDescription(_0x2a6668){const _0x8bc950=a155_0x47d4,_0x216a18=_0x2a6668[_0x8bc950(0x19f)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x216a18?.[0x1]?.[_0x8bc950(0x1a7)]()||undefined;}export function isValidBffFunctionName(_0x24908d){const _0xc07bf7=a155_0x47d4;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0xc07bf7(0x19e)](_0x24908d);}export function normalizeHookFunctionNode(_0x6b13f){const _0x4e71fa=a155_0x47d4;if(!_0x6b13f)return undefined;const _0x126698=_0x6b13f['trim']()['toLowerCase']();if(_0x126698===_0x4e71fa(0x19c)||_0x126698==='after')return _0x126698;return undefined;}
1
+ (function(_0x145e52,_0x1f4d77){const _0x1a2c2a=a155_0x1c2d,_0x2f1af6=_0x145e52();while(!![]){try{const _0x3d1242=parseInt(_0x1a2c2a(0xb5))/0x1*(-parseInt(_0x1a2c2a(0xaf))/0x2)+parseInt(_0x1a2c2a(0xa5))/0x3*(parseInt(_0x1a2c2a(0xb4))/0x4)+-parseInt(_0x1a2c2a(0xa8))/0x5*(parseInt(_0x1a2c2a(0xac))/0x6)+parseInt(_0x1a2c2a(0xa6))/0x7+parseInt(_0x1a2c2a(0xb7))/0x8*(-parseInt(_0x1a2c2a(0xb3))/0x9)+-parseInt(_0x1a2c2a(0xb1))/0xa*(-parseInt(_0x1a2c2a(0xa3))/0xb)+parseInt(_0x1a2c2a(0xaa))/0xc;if(_0x3d1242===_0x1f4d77)break;else _0x2f1af6['push'](_0x2f1af6['shift']());}catch(_0x2476e6){_0x2f1af6['push'](_0x2f1af6['shift']());}}}(a155_0x4353,0x522d6));export function snakeToCamel(_0x5eefee){const _0x52e7a2=a155_0x1c2d;return _0x5eefee[_0x52e7a2(0xa9)]()[_0x52e7a2(0xa0)](/_([a-z])/g,(_0x1b6f1c,_0x3fd086)=>_0x3fd086[_0x52e7a2(0xb0)]());}function a155_0x1c2d(_0x45314e,_0x45a878){_0x45314e=_0x45314e-0xa0;const _0x435353=a155_0x4353();let _0x1c2d88=_0x435353[_0x45314e];return _0x1c2d88;}export function findHookLocationByRemoteId(_0x363b0c,_0x2bfc03){const _0x2f75a1=a155_0x1c2d;if(!_0x2bfc03)return undefined;for(const _0x3b69d5 of Object[_0x2f75a1(0xb6)](_0x363b0c)){if(_0x3b69d5[_0x2f75a1(0xa7)]===_0x2bfc03&&_0x3b69d5[_0x2f75a1(0xa2)]&&_0x3b69d5[_0x2f75a1(0xb2)]&&_0x3b69d5[_0x2f75a1(0xae)])return{'datasetCode':_0x3b69d5[_0x2f75a1(0xa2)],'operationType':_0x3b69d5[_0x2f75a1(0xb2)],'functionNode':_0x3b69d5[_0x2f75a1(0xae)]};}return undefined;}export function extractScriptDescription(_0x5436d3){const _0x2bc75d=a155_0x1c2d,_0xb970e3=_0x5436d3[_0x2bc75d(0xa4)](/\[\s*脚本描述\s*]\s*(.+)/);return _0xb970e3?.[0x1]?.[_0x2bc75d(0xa1)]()||undefined;}export function isValidBffFunctionName(_0x437e7e){const _0x25bed5=a155_0x1c2d;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x25bed5(0xab)](_0x437e7e);}function a155_0x4353(){const _0x17df0e=['operationType','279VnPiuf','662224ECTUJa','59223WXiCnA','values','1672SCjMHR','replace','trim','datasetCode','70004Kqgmua','match','6AFQGeH','1591828yARQbA','remoteId','30950ehoZVW','toLowerCase','6068784mLArff','test','570MirXcj','after','functionNode','6PLuprN','toUpperCase','70TLsFRN'];a155_0x4353=function(){return _0x17df0e;};return a155_0x4353();}export function normalizeHookFunctionNode(_0x1db2a8){const _0x7ef8ef=a155_0x1c2d;if(!_0x1db2a8)return undefined;const _0x3b96c1=_0x1db2a8[_0x7ef8ef(0xa1)]()['toLowerCase']();if(_0x3b96c1==='before'||_0x3b96c1===_0x7ef8ef(0xad))return _0x3b96c1;return undefined;}
@@ -1 +1 @@
1
- function a156_0x1f3e(){const _0x35b812=['dbName','dbId','7009555TcDobz','map','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','3577236UHBbjC','length','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','set','join','3336486LzayNv','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','entries','includes','isNaN','toLowerCase','1608908VKmDja','3935632dDgyZy','find','\x22.\x20Available:\x20','get','6259310KeWEsQ','1020304XDbAnh','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'];a156_0x1f3e=function(){return _0x35b812;};return a156_0x1f3e();}(function(_0x177a8d,_0x4e46ed){const _0x6d86e=a156_0xab6d,_0x540940=_0x177a8d();while(!![]){try{const _0x23e941=parseInt(_0x6d86e(0x18a))/0x1+-parseInt(_0x6d86e(0x184))/0x2+parseInt(_0x6d86e(0x191))/0x3+-parseInt(_0x6d86e(0x185))/0x4+-parseInt(_0x6d86e(0x189))/0x5+parseInt(_0x6d86e(0x17e))/0x6+parseInt(_0x6d86e(0x18e))/0x7;if(_0x23e941===_0x4e46ed)break;else _0x540940['push'](_0x540940['shift']());}catch(_0x29d662){_0x540940['push'](_0x540940['shift']());}}}(a156_0x1f3e,0xb2352));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x16901f){const _0x35e6c1=a156_0xab6d;if(cache['has'](_0x16901f))return cache[_0x35e6c1(0x188)](_0x16901f);const _0x4c59c6=await listDatasets(_0x16901f),_0x4726db=new Map();for(const _0x257985 of _0x4c59c6){const _0x4056b2=_0x257985['dbtableConfig'];_0x4056b2?.[_0x35e6c1(0x18d)]!=null&&_0x4726db['set'](_0x4056b2[_0x35e6c1(0x18d)],_0x4056b2[_0x35e6c1(0x18c)]??'db-'+_0x4056b2[_0x35e6c1(0x18d)]);}const _0x23d606=[..._0x4726db[_0x35e6c1(0x180)]()]['map'](([_0x230fa4,_0x5a1ab2])=>({'dbId':_0x230fa4,'dbName':_0x5a1ab2}));return cache[_0x35e6c1(0x194)](_0x16901f,_0x23d606),_0x23d606;}export async function resolveDb(_0x2043dd,_0x9ba713){const _0x116c33=a156_0xab6d,_0x36cd51=await listDatabases(_0x2043dd);if(_0x36cd51[_0x116c33(0x192)]===0x0)return{'resolved':[],'error':_0x116c33(0x18b)+_0x2043dd+_0x116c33(0x17f)};if(!_0x9ba713)return{'resolved':_0x36cd51};const _0x3dd617=Number(_0x9ba713);if(!Number[_0x116c33(0x182)](_0x3dd617)){const _0x2ee7ce=_0x36cd51[_0x116c33(0x186)](_0x284b7e=>_0x284b7e[_0x116c33(0x18d)]===_0x3dd617);if(_0x2ee7ce)return{'resolved':[_0x2ee7ce]};}const _0x1579e6=_0x9ba713[_0x116c33(0x183)](),_0x46507c=_0x36cd51['filter'](_0x1f4d33=>_0x1f4d33[_0x116c33(0x18c)][_0x116c33(0x183)]()[_0x116c33(0x181)](_0x1579e6));if(_0x46507c[_0x116c33(0x192)]>0x0)return{'resolved':_0x46507c};const _0x25cf40=_0x36cd51[_0x116c33(0x18f)](_0x381827=>_0x381827['dbName']+'\x20('+_0x381827[_0x116c33(0x18d)]+')')[_0x116c33(0x17d)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x9ba713+'\x22\x20under\x20app\x20\x22'+_0x2043dd+_0x116c33(0x187)+_0x25cf40+_0x116c33(0x190)};}export async function resolveOneDb(_0x2092f5,_0x21b440){const _0x372d6c=a156_0xab6d,{resolved:_0x130051,error:_0x186181}=await resolveDb(_0x2092f5,_0x21b440);if(_0x186181)return{'db':null,'error':_0x186181};if(_0x130051[_0x372d6c(0x192)]===0x1)return{'db':_0x130051[0x0]};if(!_0x21b440){const _0x18e290=_0x130051[_0x372d6c(0x18f)](_0x43f1d4=>_0x43f1d4['dbName']+'\x20('+_0x43f1d4[_0x372d6c(0x18d)]+')')['join'](',\x20');return{'db':null,'error':_0x372d6c(0x193)+_0x18e290};}const _0x5d55ac=_0x130051[_0x372d6c(0x18f)](_0x50a21e=>_0x50a21e[_0x372d6c(0x18c)]+'\x20('+_0x50a21e[_0x372d6c(0x18d)]+')')[_0x372d6c(0x17d)](',\x20');return{'db':null,'error':'\x22'+_0x21b440+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x5d55ac+'.\x20Be\x20more\x20specific.'};}function a156_0xab6d(_0x917ec7,_0x8f7ee0){_0x917ec7=_0x917ec7-0x17d;const _0x1f3ef5=a156_0x1f3e();let _0xab6ddc=_0x1f3ef5[_0x917ec7];return _0xab6ddc;}export async function getDbName(_0x208242,_0x42de2c){const _0x1c7250=a156_0xab6d,_0x325d0c=await listDatabases(_0x208242);return _0x325d0c[_0x1c7250(0x186)](_0x123a4c=>_0x123a4c[_0x1c7250(0x18d)]===_0x42de2c)?.[_0x1c7250(0x18c)];}
1
+ (function(_0x387797,_0x47afb9){const _0x5dbad8=a156_0x33ba,_0x3fcbec=_0x387797();while(!![]){try{const _0x5a7d5a=parseInt(_0x5dbad8(0xeb))/0x1*(-parseInt(_0x5dbad8(0x10a))/0x2)+parseInt(_0x5dbad8(0x106))/0x3+parseInt(_0x5dbad8(0x108))/0x4+parseInt(_0x5dbad8(0xf1))/0x5*(-parseInt(_0x5dbad8(0x10b))/0x6)+-parseInt(_0x5dbad8(0x101))/0x7*(parseInt(_0x5dbad8(0x10c))/0x8)+parseInt(_0x5dbad8(0xef))/0x9*(parseInt(_0x5dbad8(0xfb))/0xa)+-parseInt(_0x5dbad8(0x105))/0xb*(parseInt(_0x5dbad8(0xfa))/0xc);if(_0x5a7d5a===_0x47afb9)break;else _0x3fcbec['push'](_0x3fcbec['shift']());}catch(_0x8a6bc4){_0x3fcbec['push'](_0x3fcbec['shift']());}}}(a156_0x3394,0x5a372));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x513824){const _0x35f552=a156_0x33ba;if(cache[_0x35f552(0xff)](_0x513824))return cache[_0x35f552(0xf9)](_0x513824);const _0x1b0b21=await listDatasets(_0x513824),_0x14c206=new Map();for(const _0x2adbbd of _0x1b0b21){const _0x2745fa=_0x2adbbd['dbtableConfig'];_0x2745fa?.[_0x35f552(0xfc)]!=null&&_0x14c206['set'](_0x2745fa[_0x35f552(0xfc)],_0x2745fa['dbName']??_0x35f552(0x109)+_0x2745fa[_0x35f552(0xfc)]);}const _0x25f5d2=[..._0x14c206[_0x35f552(0xf6)]()][_0x35f552(0xed)](([_0x536a34,_0x17c29d])=>({'dbId':_0x536a34,'dbName':_0x17c29d}));return cache[_0x35f552(0xee)](_0x513824,_0x25f5d2),_0x25f5d2;}function a156_0x3394(){const _0x34ce83=['isNaN','toLowerCase','get','4164CZqduu','2631160YscdyZ','dbId','includes','\x22\x20matches\x20multiple\x20databases:\x20','has','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','751898qUPwjq','\x22\x20under\x20app\x20\x22','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','979fompZb','2077524jYlPET','\x22.\x20Available:\x20','2142760kzWUfK','db-','8solqnZ','293298TBbcTh','40IrTvVl','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','143135cCXkDk','.\x20Be\x20more\x20specific.','map','set','18mEPzZV','filter','25ZUEQAx','length','No\x20database\x20matching\x20\x22','join','find','entries'];a156_0x3394=function(){return _0x34ce83;};return a156_0x3394();}function a156_0x33ba(_0x117ca4,_0x506048){_0x117ca4=_0x117ca4-0xea;const _0x3394ef=a156_0x3394();let _0x33baff=_0x3394ef[_0x117ca4];return _0x33baff;}export async function resolveDb(_0x29cc97,_0x13d7f5){const _0x3955a2=a156_0x33ba,_0x2e96b0=await listDatabases(_0x29cc97);if(_0x2e96b0[_0x3955a2(0xf2)]===0x0)return{'resolved':[],'error':_0x3955a2(0x104)+_0x29cc97+_0x3955a2(0x10d)};if(!_0x13d7f5)return{'resolved':_0x2e96b0};const _0x35d56a=Number(_0x13d7f5);if(!Number[_0x3955a2(0xf7)](_0x35d56a)){const _0x2913e0=_0x2e96b0[_0x3955a2(0xf5)](_0x2c84b5=>_0x2c84b5[_0x3955a2(0xfc)]===_0x35d56a);if(_0x2913e0)return{'resolved':[_0x2913e0]};}const _0x23a8d1=_0x13d7f5[_0x3955a2(0xf8)](),_0x57c700=_0x2e96b0[_0x3955a2(0xf0)](_0x28a243=>_0x28a243['dbName'][_0x3955a2(0xf8)]()[_0x3955a2(0xfd)](_0x23a8d1));if(_0x57c700['length']>0x0)return{'resolved':_0x57c700};const _0x4cef39=_0x2e96b0[_0x3955a2(0xed)](_0x1e03c2=>_0x1e03c2['dbName']+'\x20('+_0x1e03c2[_0x3955a2(0xfc)]+')')[_0x3955a2(0xf4)](',\x20');return{'resolved':[],'error':_0x3955a2(0xf3)+_0x13d7f5+_0x3955a2(0x102)+_0x29cc97+_0x3955a2(0x107)+_0x4cef39+_0x3955a2(0x100)};}export async function resolveOneDb(_0x136bbd,_0x1b11a4){const _0x4e4777=a156_0x33ba,{resolved:_0x654ce9,error:_0x32d61c}=await resolveDb(_0x136bbd,_0x1b11a4);if(_0x32d61c)return{'db':null,'error':_0x32d61c};if(_0x654ce9[_0x4e4777(0xf2)]===0x1)return{'db':_0x654ce9[0x0]};if(!_0x1b11a4){const _0x2423bf=_0x654ce9[_0x4e4777(0xed)](_0x4413d4=>_0x4413d4[_0x4e4777(0x103)]+'\x20('+_0x4413d4[_0x4e4777(0xfc)]+')')[_0x4e4777(0xf4)](',\x20');return{'db':null,'error':_0x4e4777(0xea)+_0x2423bf};}const _0x1a9732=_0x654ce9['map'](_0x3591c9=>_0x3591c9['dbName']+'\x20('+_0x3591c9[_0x4e4777(0xfc)]+')')[_0x4e4777(0xf4)](',\x20');return{'db':null,'error':'\x22'+_0x1b11a4+_0x4e4777(0xfe)+_0x1a9732+_0x4e4777(0xec)};}export async function getDbName(_0x5c62ae,_0x2df261){const _0x4c3cc7=a156_0x33ba,_0x1e0c81=await listDatabases(_0x5c62ae);return _0x1e0c81['find'](_0x144e90=>_0x144e90[_0x4c3cc7(0xfc)]===_0x2df261)?.[_0x4c3cc7(0x103)];}
@@ -1 +1 @@
1
- const a157_0x37ad57=a157_0x53f7;(function(_0x5797ab,_0x280d74){const _0x2682cc=a157_0x53f7,_0x526250=_0x5797ab();while(!![]){try{const _0x3ffdbb=-parseInt(_0x2682cc(0x111))/0x1*(-parseInt(_0x2682cc(0x101))/0x2)+parseInt(_0x2682cc(0x104))/0x3*(parseInt(_0x2682cc(0x110))/0x4)+parseInt(_0x2682cc(0x10d))/0x5*(parseInt(_0x2682cc(0x10c))/0x6)+parseInt(_0x2682cc(0x109))/0x7*(parseInt(_0x2682cc(0x107))/0x8)+-parseInt(_0x2682cc(0x108))/0x9+-parseInt(_0x2682cc(0x10e))/0xa*(parseInt(_0x2682cc(0x105))/0xb)+parseInt(_0x2682cc(0x10b))/0xc*(-parseInt(_0x2682cc(0x106))/0xd);if(_0x3ffdbb===_0x280d74)break;else _0x526250['push'](_0x526250['shift']());}catch(_0x88b808){_0x526250['push'](_0x526250['shift']());}}}(a157_0x4858,0x92c2b));import{constants}from'node:fs';function a157_0x4858(){const _0x2ba7f5=['3489WJonma','2585IqTknS','25873627amYeQy','9446328ttcroq','6158025XCmFgo','7XVPhtY','.rabetbase','12LUkCgR','29286PajPSc','1175FUtZAA','15490NcfQiW','page','3392XLInLd','592luAitU','F_OK','cwd','1100ZobJIj','.json','toUpperCase'];a157_0x4858=function(){return _0x2ba7f5;};return a157_0x4858();}import{access,mkdir}from'node:fs/promises';function a157_0x53f7(_0x5d288f,_0x4fb184){_0x5d288f=_0x5d288f-0x101;const _0x485850=a157_0x4858();let _0x53f7b5=_0x485850[_0x5d288f];return _0x53f7b5;}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x33c0e9,_0x391e6e=process[a157_0x37ad57(0x113)]()){const _0x183662=a157_0x37ad57,_0x32b9f2=resolve(_0x391e6e),_0x44b1ec=join(_0x32b9f2,_0x183662(0x10a),_0x183662(0x10f));return{'projectRoot':_0x32b9f2,'pagesBaseDir':_0x44b1ec,'appPagesDir':join(_0x44b1ec,_0x33c0e9),'lockFilePath':join(_0x32b9f2,_0x183662(0x10a),'page.lock.json')};}export function buildPageFileName(_0x1675d3,_0x4c793e){const _0x356cd6=a157_0x37ad57;return _0x1675d3+'-'+String(_0x4c793e)[_0x356cd6(0x103)]()+_0x356cd6(0x102);}export function resolvePageFilePath(_0x254566,_0x52e555,_0x79436e){return join(_0x254566['appPagesDir'],buildPageFileName(_0x52e555,_0x79436e));}export async function ensureParentDirectory(_0x3b274){await mkdir(dirname(_0x3b274),{'recursive':!![]});}export async function fileExists(_0xe817c4){const _0x2b5ad0=a157_0x37ad57;try{return await access(_0xe817c4,constants[_0x2b5ad0(0x112)]),!![];}catch{return![];}}
1
+ const a157_0x15e483=a157_0x4727;(function(_0x5be314,_0x5ebce8){const _0xb6ae91=a157_0x4727,_0x325728=_0x5be314();while(!![]){try{const _0x1a4d95=parseInt(_0xb6ae91(0x1c7))/0x1+parseInt(_0xb6ae91(0x1c4))/0x2*(-parseInt(_0xb6ae91(0x1d2))/0x3)+-parseInt(_0xb6ae91(0x1cf))/0x4*(parseInt(_0xb6ae91(0x1ca))/0x5)+parseInt(_0xb6ae91(0x1c8))/0x6+parseInt(_0xb6ae91(0x1d0))/0x7+-parseInt(_0xb6ae91(0x1d3))/0x8*(-parseInt(_0xb6ae91(0x1ce))/0x9)+-parseInt(_0xb6ae91(0x1cc))/0xa*(parseInt(_0xb6ae91(0x1c9))/0xb);if(_0x1a4d95===_0x5ebce8)break;else _0x325728['push'](_0x325728['shift']());}catch(_0x269370){_0x325728['push'](_0x325728['shift']());}}}(a157_0x24f1,0xd037f));import{constants}from'node:fs';function a157_0x24f1(){const _0x4421c9=['1407737IMvjYq','62124SOecxQ','207372qDnmlQ','3588990RoiJCi','.json','230yneITT','cwd','639NGtznz','8Qlncpm','3189669AoNnSq','page','185982IcNsyt','102568WCTKzH','2gVaOed','appPagesDir','.rabetbase'];a157_0x24f1=function(){return _0x4421c9;};return a157_0x24f1();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x789ee6,_0x76fa2f=process[a157_0x15e483(0x1cd)]()){const _0x3030d9=a157_0x15e483,_0x5dc10d=resolve(_0x76fa2f),_0x27b5b1=join(_0x5dc10d,_0x3030d9(0x1c6),_0x3030d9(0x1d1));return{'projectRoot':_0x5dc10d,'pagesBaseDir':_0x27b5b1,'appPagesDir':join(_0x27b5b1,_0x789ee6),'lockFilePath':join(_0x5dc10d,_0x3030d9(0x1c6),'page.lock.json')};}function a157_0x4727(_0x32221a,_0x367a00){_0x32221a=_0x32221a-0x1c4;const _0x24f142=a157_0x24f1();let _0x47278c=_0x24f142[_0x32221a];return _0x47278c;}export function buildPageFileName(_0x55313c,_0x24f79c){const _0x1e2e0e=a157_0x15e483;return _0x55313c+'-'+String(_0x24f79c)['toUpperCase']()+_0x1e2e0e(0x1cb);}export function resolvePageFilePath(_0x1781b5,_0x3ff696,_0x3082f5){const _0x57ee0a=a157_0x15e483;return join(_0x1781b5[_0x57ee0a(0x1c5)],buildPageFileName(_0x3ff696,_0x3082f5));}export async function ensureParentDirectory(_0x3005c3){await mkdir(dirname(_0x3005c3),{'recursive':!![]});}export async function fileExists(_0x2f736d){try{return await access(_0x2f736d,constants['F_OK']),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x1a0c28,_0x5c4361){const _0x5c76f9=a158_0x5d50,_0x193338=_0x1a0c28();while(!![]){try{const _0x5c0aad=parseInt(_0x5c76f9(0x1eb))/0x1+parseInt(_0x5c76f9(0x1e8))/0x2+-parseInt(_0x5c76f9(0x1ed))/0x3+parseInt(_0x5c76f9(0x1f0))/0x4+parseInt(_0x5c76f9(0x1f1))/0x5*(-parseInt(_0x5c76f9(0x1ee))/0x6)+parseInt(_0x5c76f9(0x1ec))/0x7+-parseInt(_0x5c76f9(0x1f3))/0x8*(parseInt(_0x5c76f9(0x1ea))/0x9);if(_0x5c0aad===_0x5c4361)break;else _0x193338['push'](_0x193338['shift']());}catch(_0xc66b5a){_0x193338['push'](_0x193338['shift']());}}}(a158_0x4ad1,0x97743));function a158_0x5d50(_0x555fc5,_0x1c162e){_0x555fc5=_0x555fc5-0x1e7;const _0x4ad12c=a158_0x4ad1();let _0x5d5061=_0x4ad12c[_0x555fc5];return _0x5d5061;}import a158_0x207960 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1526a2){const _0x582bd7=a158_0x5d50;return JSON[_0x582bd7(0x1e7)](JSON['parse'](_0x1526a2),null,0x2)+'\x0a';}export function computePageContentHash(_0x374968){const _0x220318=a158_0x5d50;return a158_0x207960[_0x220318(0x1f2)](_0x220318(0x1ef))['update'](_0x374968)['digest']('hex');}export function computeSerializedSchemaHash(_0x554c20){return computePageContentHash(serializePageSchemaForFile(_0x554c20));}function a158_0x4ad1(){const _0x527379=['md5','3346644Jzzfvw','5MjCZUF','createHash','8UEFlPa','stringify','2391434WisLMd','utf8','8055576wVnJtO','519535BdlmSV','506933VBsKhW','2014167vhTHtU','2625144YeWDif'];a158_0x4ad1=function(){return _0x527379;};return a158_0x4ad1();}export async function computePageFileHash(_0x5020a3){const _0xb9d708=a158_0x5d50,_0x13d0c5=await readFile(_0x5020a3,_0xb9d708(0x1e9));return computePageContentHash(_0x13d0c5);}
1
+ (function(_0x286f1d,_0x101c44){const _0x311a69=a158_0xb541,_0x2924e5=_0x286f1d();while(!![]){try{const _0x1197c0=parseInt(_0x311a69(0x10e))/0x1*(parseInt(_0x311a69(0x100))/0x2)+parseInt(_0x311a69(0x111))/0x3+-parseInt(_0x311a69(0x101))/0x4*(parseInt(_0x311a69(0x10d))/0x5)+-parseInt(_0x311a69(0x10c))/0x6+-parseInt(_0x311a69(0x105))/0x7+-parseInt(_0x311a69(0x10b))/0x8*(parseInt(_0x311a69(0x107))/0x9)+parseInt(_0x311a69(0x10a))/0xa;if(_0x1197c0===_0x101c44)break;else _0x2924e5['push'](_0x2924e5['shift']());}catch(_0x2fa941){_0x2924e5['push'](_0x2924e5['shift']());}}}(a158_0x3a8a,0xef0c1));import a158_0x54e3e1 from'node:crypto';function a158_0xb541(_0x1cc676,_0x2abfa1){_0x1cc676=_0x1cc676-0x100;const _0x3a8a23=a158_0x3a8a();let _0xb54107=_0x3a8a23[_0x1cc676];return _0xb54107;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x3abca1){const _0x4054ce=a158_0xb541;return JSON[_0x4054ce(0x10f)](JSON[_0x4054ce(0x108)](_0x3abca1),null,0x2)+'\x0a';}export function computePageContentHash(_0x279ada){const _0x13e63e=a158_0xb541;return a158_0x54e3e1[_0x13e63e(0x109)](_0x13e63e(0x106))[_0x13e63e(0x104)](_0x279ada)[_0x13e63e(0x103)](_0x13e63e(0x102));}export function computeSerializedSchemaHash(_0x56a225){return computePageContentHash(serializePageSchemaForFile(_0x56a225));}export async function computePageFileHash(_0x4e3a05){const _0x4cef60=a158_0xb541,_0x13fc2=await readFile(_0x4e3a05,_0x4cef60(0x110));return computePageContentHash(_0x13fc2);}function a158_0x3a8a(){const _0x59384e=['hex','digest','update','13130866PaFWrd','md5','1110402ruaYoA','parse','createHash','32706680SIBOpu','56ahbCEr','2629470TJIPsD','510585TAHmHe','693102mNuFGN','stringify','utf8','644439NRPPEB','4ljtQlJ','28cLMZDf'];a158_0x3a8a=function(){return _0x59384e;};return a158_0x3a8a();}
@@ -1 +1 @@
1
- (function(_0x4e8910,_0x27b075){const _0x53385d=a159_0x305c,_0x59cf34=_0x4e8910();while(!![]){try{const _0x5f0fc5=parseInt(_0x53385d(0x1a7))/0x1*(-parseInt(_0x53385d(0x1a9))/0x2)+parseInt(_0x53385d(0x1ac))/0x3*(parseInt(_0x53385d(0x1a4))/0x4)+-parseInt(_0x53385d(0x1b4))/0x5*(parseInt(_0x53385d(0x1aa))/0x6)+parseInt(_0x53385d(0x1b6))/0x7*(parseInt(_0x53385d(0x1b2))/0x8)+-parseInt(_0x53385d(0x1b5))/0x9+parseInt(_0x53385d(0x1b0))/0xa+-parseInt(_0x53385d(0x1af))/0xb*(parseInt(_0x53385d(0x1b3))/0xc);if(_0x5f0fc5===_0x27b075)break;else _0x59cf34['push'](_0x59cf34['shift']());}catch(_0x4a82b5){_0x59cf34['push'](_0x59cf34['shift']());}}}(a159_0x163b,0xd3831));import{mkdir,readFile,writeFile}from'node:fs/promises';function a159_0x305c(_0x3c88ec,_0x3bd799){_0x3c88ec=_0x3c88ec-0x1a3;const _0x163bcb=a159_0x163b();let _0x305c19=_0x163bcb[_0x3c88ec];return _0x305c19;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x3c6343,_0x56d5f2){const _0x376143=a159_0x305c,_0x144522={'apps':_0x3c6343['apps']&&typeof _0x3c6343[_0x376143(0x1ad)]===_0x376143(0x1b1)?_0x3c6343[_0x376143(0x1ad)]:{}};let _0x377c5d=_0x144522[_0x376143(0x1ad)][_0x56d5f2];if(!_0x377c5d)return _0x377c5d={'lastSync':'','pages':{}},_0x144522[_0x376143(0x1ad)][_0x56d5f2]=_0x377c5d,{'lockData':_0x144522,'appLock':_0x377c5d};return!_0x377c5d['lastSync']&&(_0x377c5d[_0x376143(0x1a3)]=''),(!_0x377c5d['pages']||typeof _0x377c5d[_0x376143(0x1a8)]!==_0x376143(0x1b1))&&(_0x377c5d['pages']={}),{'lockData':_0x144522,'appLock':_0x377c5d};}export async function readPageLockFile(_0x5cc187){const _0x31e2a6=a159_0x305c;try{const _0x28d4bd=await readFile(_0x5cc187,_0x31e2a6(0x1a6)),_0x108768=JSON[_0x31e2a6(0x1ab)](_0x28d4bd);return{'apps':_0x108768[_0x31e2a6(0x1ad)]&&typeof _0x108768[_0x31e2a6(0x1ad)]===_0x31e2a6(0x1b1)?_0x108768[_0x31e2a6(0x1ad)]:{}};}catch(_0x592127){if(_0x592127['code']===_0x31e2a6(0x1a5))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x592127));}}function a159_0x163b(){const _0x47a0e6=['16eUaOxa','pages','26252UsrsgB','6FntPSP','parse','9237JTwTEq','apps','stringify','3391311noJqTz','12060440iyjomF','object','59832rzFUjj','60KoqlDH','485795zKwcNf','13839687kltYII','1379sMNgSX','lastSync','2044rYjnSz','ENOENT','utf8'];a159_0x163b=function(){return _0x47a0e6;};return a159_0x163b();}export async function writePageLockFile(_0x29cd8f,_0x1d988d){const _0x522522=a159_0x305c;await mkdir(dirname(_0x29cd8f),{'recursive':!![]}),await writeFile(_0x29cd8f,JSON[_0x522522(0x1ae)](_0x1d988d,null,0x2),_0x522522(0x1a6));}
1
+ (function(_0x2b365c,_0x4937ec){const _0x59c854=a159_0xb7f8,_0x1b48b4=_0x2b365c();while(!![]){try{const _0xd50cb7=parseInt(_0x59c854(0x16f))/0x1*(-parseInt(_0x59c854(0x16e))/0x2)+parseInt(_0x59c854(0x175))/0x3*(-parseInt(_0x59c854(0x173))/0x4)+-parseInt(_0x59c854(0x16a))/0x5*(parseInt(_0x59c854(0x176))/0x6)+parseInt(_0x59c854(0x166))/0x7+parseInt(_0x59c854(0x172))/0x8*(-parseInt(_0x59c854(0x169))/0x9)+-parseInt(_0x59c854(0x171))/0xa*(-parseInt(_0x59c854(0x161))/0xb)+parseInt(_0x59c854(0x170))/0xc*(parseInt(_0x59c854(0x16b))/0xd);if(_0xd50cb7===_0x4937ec)break;else _0x1b48b4['push'](_0x1b48b4['shift']());}catch(_0x1aafd9){_0x1b48b4['push'](_0x1b48b4['shift']());}}}(a159_0x4a22,0x5b3f7));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a159_0x4a22(){const _0x3469d4=['1489288Xfgprk','4kyofbt','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1721427XvwMOJ','1008534gBQEbe','pages','1174591CQxzrm','stringify','utf8','parse','lastSync','1224566WXlqCt','ENOENT','apps','9ACQGhp','10jeHCAh','5427227VCtcEZ','code','object','2qcfaJv','64257rGxalk','36GfzrDv','10KfgaCo'];a159_0x4a22=function(){return _0x3469d4;};return a159_0x4a22();}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4687b4,_0x24c68d){const _0x4695e0=a159_0xb7f8,_0x54e632={'apps':_0x4687b4[_0x4695e0(0x168)]&&typeof _0x4687b4[_0x4695e0(0x168)]===_0x4695e0(0x16d)?_0x4687b4[_0x4695e0(0x168)]:{}};let _0x4d9142=_0x54e632[_0x4695e0(0x168)][_0x24c68d];if(!_0x4d9142)return _0x4d9142={'lastSync':'','pages':{}},_0x54e632['apps'][_0x24c68d]=_0x4d9142,{'lockData':_0x54e632,'appLock':_0x4d9142};return!_0x4d9142[_0x4695e0(0x165)]&&(_0x4d9142[_0x4695e0(0x165)]=''),(!_0x4d9142[_0x4695e0(0x160)]||typeof _0x4d9142[_0x4695e0(0x160)]!==_0x4695e0(0x16d))&&(_0x4d9142[_0x4695e0(0x160)]={}),{'lockData':_0x54e632,'appLock':_0x4d9142};}function a159_0xb7f8(_0x27d396,_0x146496){_0x27d396=_0x27d396-0x160;const _0x4a227c=a159_0x4a22();let _0xb7f8e6=_0x4a227c[_0x27d396];return _0xb7f8e6;}export async function readPageLockFile(_0x1bf345){const _0x493759=a159_0xb7f8;try{const _0x1f9aa6=await readFile(_0x1bf345,_0x493759(0x163)),_0x7197e9=JSON[_0x493759(0x164)](_0x1f9aa6);return{'apps':_0x7197e9[_0x493759(0x168)]&&typeof _0x7197e9[_0x493759(0x168)]===_0x493759(0x16d)?_0x7197e9[_0x493759(0x168)]:{}};}catch(_0x2ce2c9){if(_0x2ce2c9[_0x493759(0x16c)]===_0x493759(0x167))return null;throw new Error(_0x493759(0x174)+String(_0x2ce2c9));}}export async function writePageLockFile(_0x22f3ab,_0x5b0223){const _0x4c3b16=a159_0xb7f8;await mkdir(dirname(_0x22f3ab),{'recursive':!![]}),await writeFile(_0x22f3ab,JSON[_0x4c3b16(0x162)](_0x5b0223,null,0x2),_0x4c3b16(0x163));}
@@ -1 +1 @@
1
- const a161_0x2559f5=a161_0x1f70;function a161_0x1f70(_0x375631,_0x2ee957){_0x375631=_0x375631-0xcb;const _0x1c9415=a161_0x1c94();let _0x1f7083=_0x1c9415[_0x375631];return _0x1f7083;}(function(_0x524f74,_0x2f29fa){const _0x11d43e=a161_0x1f70,_0x562c45=_0x524f74();while(!![]){try{const _0x57dc09=-parseInt(_0x11d43e(0xcf))/0x1+parseInt(_0x11d43e(0xd1))/0x2+parseInt(_0x11d43e(0xd2))/0x3+parseInt(_0x11d43e(0xcc))/0x4+-parseInt(_0x11d43e(0xcd))/0x5+-parseInt(_0x11d43e(0xd4))/0x6+-parseInt(_0x11d43e(0xd6))/0x7*(-parseInt(_0x11d43e(0xce))/0x8);if(_0x57dc09===_0x2f29fa)break;else _0x562c45['push'](_0x562c45['shift']());}catch(_0x22e273){_0x562c45['push'](_0x562c45['shift']());}}}(a161_0x1c94,0x86681));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a161_0x2559f5(0xd7),LOCK_FILE_NAME=a161_0x2559f5(0xd3),TRASH_DIR_NAME=a161_0x2559f5(0xcb);function a161_0x1c94(){const _0x2d9638=['/sql','1714592xLHGyn','1568097bXwdfF','sql.lock.json','6299124yXumsd','sql','4732kBjGwP','.rabetbase','sql-trash','3040000YJnGOL','1100530qHnTQK','2824tRpNsZ','558134HYbsxS'];a161_0x1c94=function(){return _0x2d9638;};return a161_0x1c94();}export function loadSqlProjectConfig(_0x47abc3,_0x579d41){const _0x209306=a161_0x2559f5,_0x248b38=resolve(_0x579d41??findProjectRootDirectory()),_0x515b8a=DOT_DIR+_0x209306(0xd0),_0x57a1ed=_0x515b8a+'/'+_0x47abc3;return{'projectRoot':_0x248b38,'appCode':_0x47abc3,'sqlWorkspaceRoot':_0x515b8a,'sqlRoot':_0x57a1ed,'sqlRootDir':resolve(_0x248b38,DOT_DIR,_0x209306(0xd5),_0x47abc3),'lockFilePath':resolve(_0x248b38,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x248b38,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a161_0x1192(_0x26c968,_0x2867f5){_0x26c968=_0x26c968-0xc3;const _0x4a05cd=a161_0x4a05();let _0x119231=_0x4a05cd[_0x26c968];return _0x119231;}const a161_0x71e9b3=a161_0x1192;function a161_0x4a05(){const _0x19d6cd=['8305UySZNe','/sql','2728NLPPdJ','22908gdcVpp','21882lJeybS','10YYXKub','7103940BvgcSg','9423279ZcYczj','61128FqXDdB','4692584ySJzsW','5eAuLeQ','.rabetbase','76llSxck','sql','1464143mytboH'];a161_0x4a05=function(){return _0x19d6cd;};return a161_0x4a05();}(function(_0x150223,_0x554e24){const _0x27e217=a161_0x1192,_0x2edd2a=_0x150223();while(!![]){try{const _0x547270=-parseInt(_0x27e217(0xd1))/0x1+-parseInt(_0x27e217(0xcf))/0x2*(-parseInt(_0x27e217(0xcb))/0x3)+-parseInt(_0x27e217(0xcc))/0x4+parseInt(_0x27e217(0xcd))/0x5*(parseInt(_0x27e217(0xc9))/0x6)+-parseInt(_0x27e217(0xc7))/0x7*(-parseInt(_0x27e217(0xc5))/0x8)+-parseInt(_0x27e217(0xca))/0x9*(parseInt(_0x27e217(0xc8))/0xa)+-parseInt(_0x27e217(0xc3))/0xb*(-parseInt(_0x27e217(0xc6))/0xc);if(_0x547270===_0x554e24)break;else _0x2edd2a['push'](_0x2edd2a['shift']());}catch(_0x1629a3){_0x2edd2a['push'](_0x2edd2a['shift']());}}}(a161_0x4a05,0xbeba3));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a161_0x71e9b3(0xce),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x21de4b,_0x318a15){const _0x2c8273=a161_0x71e9b3,_0x4d50ab=resolve(_0x318a15??findProjectRootDirectory()),_0x403856=DOT_DIR+_0x2c8273(0xc4),_0xb230b8=_0x403856+'/'+_0x21de4b;return{'projectRoot':_0x4d50ab,'appCode':_0x21de4b,'sqlWorkspaceRoot':_0x403856,'sqlRoot':_0xb230b8,'sqlRootDir':resolve(_0x4d50ab,DOT_DIR,_0x2c8273(0xd0),_0x21de4b),'lockFilePath':resolve(_0x4d50ab,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4d50ab,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x74caf3,_0x159d4f){const _0x27edae=a162_0x15e4,_0x2fca46=_0x74caf3();while(!![]){try{const _0xcaf86c=parseInt(_0x27edae(0x10d))/0x1+-parseInt(_0x27edae(0x124))/0x2+parseInt(_0x27edae(0x127))/0x3+-parseInt(_0x27edae(0x117))/0x4*(-parseInt(_0x27edae(0x115))/0x5)+-parseInt(_0x27edae(0x125))/0x6*(-parseInt(_0x27edae(0x128))/0x7)+-parseInt(_0x27edae(0x10f))/0x8+parseInt(_0x27edae(0x11a))/0x9*(-parseInt(_0x27edae(0x109))/0xa);if(_0xcaf86c===_0x159d4f)break;else _0x2fca46['push'](_0x2fca46['shift']());}catch(_0x69ddfd){_0x2fca46['push'](_0x2fca46['shift']());}}}(a162_0x114f,0xe53b6));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a162_0x15e4(_0x440c2e,_0x21d103){_0x440c2e=_0x440c2e-0x109;const _0x114fb5=a162_0x114f();let _0x15e44b=_0x114fb5[_0x440c2e];return _0x15e44b;}function extensionToMode(_0x599180){const _0x456330=a162_0x15e4;if(_0x599180===_0x456330(0x110))return _0x456330(0x126);if(_0x599180===_0x456330(0x11d))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x3bc4e5,_0x461f85){const _0x170043=a162_0x15e4,_0x1a8b63=[];try{const _0x1010f9=await readdir(_0x3bc4e5,{'withFileTypes':!![]});for(const _0x5d7b06 of _0x1010f9){const _0x1f9747=join(_0x3bc4e5,_0x5d7b06[_0x170043(0x11b)]);if(_0x5d7b06[_0x170043(0x11e)]()){_0x1a8b63[_0x170043(0x116)](...await scanSqlFilesRecursively(_0x1f9747,_0x461f85));continue;}if(!_0x5d7b06[_0x170043(0x10a)]())continue;const _0x210687=extname(_0x5d7b06[_0x170043(0x11b)])[_0x170043(0x119)](),_0x42677e=extensionToMode(_0x210687);if(!_0x42677e)continue;const _0x54e571=relative(_0x461f85,_0x1f9747)[_0x170043(0x11f)](/\\/g,'/'),_0x1da1fa=_0x54e571[_0x170043(0x11c)]('/')['filter'](Boolean),_0x18a9d5=parseSqlPath(_0x1da1fa,_0x5d7b06[_0x170043(0x11b)],_0x210687);if(!_0x18a9d5)continue;_0x1a8b63['push']({'sqlCode':_0x18a9d5[_0x170043(0x10b)],'sqlName':_0x18a9d5['sqlName'],'dbDirectory':_0x1da1fa[0x0],'filePath':_0x1f9747,'relativePath':_0x54e571,'lockKey':_0x18a9d5[_0x170043(0x10b)],'mode':_0x42677e});}}catch(_0xe0f1a7){if(_0xe0f1a7[_0x170043(0x112)]!=='ENOENT')throw _0xe0f1a7;}return _0x1a8b63;}export async function scanLocalSqlQueries(_0x11f6b1){const _0x4a84f0=a162_0x15e4;return scanSqlFilesRecursively(_0x11f6b1['sqlRootDir'],_0x11f6b1[_0x4a84f0(0x10c)]);}function a162_0x114f(){const _0x285dc9=['2613620IQuTwn','isFile','sqlCode','sqlRootDir','362983zpQtwK','test','12561368qUhzeW','.sql','length','code','mode','dbId','4380040ZFHiKW','push','4rvgbZv','slice','toLowerCase','36OpmaUi','name','split','.xml','isDirectory','replace','sqlName','indexOf','dbName','path','542928NecVqz','108Bnfvju','sql','5621436Kujfmq','277361WMWNby'];a162_0x114f=function(){return _0x285dc9;};return a162_0x114f();}export function resolveLocalSqlFilePath(_0x4166b3,_0x2a553a,_0x4f4499){const _0xaae530=a162_0x15e4,_0x5b846c=_0x4f4499?.[_0xaae530(0x123)]||(_0x4f4499?.[_0xaae530(0x120)]||_0x4f4499?.[_0xaae530(0x122)]?buildSqlRelativePath(_0x2a553a,_0x4f4499?.[_0xaae530(0x120)],_0x4f4499?.[_0xaae530(0x122)],_0x4f4499?.[_0xaae530(0x113)]||_0xaae530(0x126),_0x4f4499?.[_0xaae530(0x114)]):buildDefaultSqlFileName(_0x2a553a,_0x4f4499?.[_0xaae530(0x113)]||_0xaae530(0x126)));return join(_0x4166b3[_0xaae530(0x10c)],_0x5b846c);}export async function directoryExists(_0xce8b40){const _0x4f4680=a162_0x15e4;try{const _0x54600d=await stat(_0xce8b40);return _0x54600d[_0x4f4680(0x11e)]();}catch{return![];}}function parseSqlPath(_0x1a9f75,_0x4ee7d1,_0x41e33f){const _0x20757a=a162_0x15e4,_0x1ee697=_0x4ee7d1[_0x20757a(0x118)](0x0,-_0x41e33f[_0x20757a(0x111)]);if(_0x1a9f75[_0x20757a(0x111)]<0x2)return null;const _0x4e4f63=_0x1ee697[_0x20757a(0x121)]('_');if(_0x4e4f63<=0x0||_0x4e4f63>=_0x1ee697[_0x20757a(0x111)]-0x1)return null;const _0x1aada6=_0x1ee697[_0x20757a(0x118)](0x0,_0x4e4f63);if(!isLikelySqlCode(_0x1aada6))return null;return{'sqlCode':_0x1aada6,'sqlName':_0x1ee697['slice'](_0x4e4f63+0x1)};}function isLikelySqlCode(_0x652c84){const _0x20842a=a162_0x15e4;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x20842a(0x10e)](_0x652c84);}
1
+ (function(_0x2b77f6,_0x2f6fde){const _0x38dccc=a162_0x419f,_0x54289d=_0x2b77f6();while(!![]){try{const _0x54b161=parseInt(_0x38dccc(0x11f))/0x1*(parseInt(_0x38dccc(0x117))/0x2)+parseInt(_0x38dccc(0x11b))/0x3+-parseInt(_0x38dccc(0x114))/0x4*(-parseInt(_0x38dccc(0x10a))/0x5)+-parseInt(_0x38dccc(0x111))/0x6+-parseInt(_0x38dccc(0x116))/0x7*(-parseInt(_0x38dccc(0x11e))/0x8)+-parseInt(_0x38dccc(0x113))/0x9*(-parseInt(_0x38dccc(0x119))/0xa)+-parseInt(_0x38dccc(0x10c))/0xb;if(_0x54b161===_0x2f6fde)break;else _0x54289d['push'](_0x54289d['shift']());}catch(_0x28e622){_0x54289d['push'](_0x54289d['shift']());}}}(a162_0x5e8a,0xd4066));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x552d8d){const _0x46dccb=a162_0x419f;if(_0x552d8d==='.sql')return _0x46dccb(0x109);if(_0x552d8d==='.xml')return _0x46dccb(0x125);return undefined;}async function scanSqlFilesRecursively(_0x4ada3d,_0x2d9738){const _0x3a5b22=a162_0x419f,_0x554ffb=[];try{const _0x2d82b7=await readdir(_0x4ada3d,{'withFileTypes':!![]});for(const _0x46f1a5 of _0x2d82b7){const _0x206804=join(_0x4ada3d,_0x46f1a5['name']);if(_0x46f1a5[_0x3a5b22(0x112)]()){_0x554ffb[_0x3a5b22(0x11a)](...await scanSqlFilesRecursively(_0x206804,_0x2d9738));continue;}if(!_0x46f1a5[_0x3a5b22(0x115)]())continue;const _0x329dc7=extname(_0x46f1a5[_0x3a5b22(0x122)])['toLowerCase'](),_0xe51631=extensionToMode(_0x329dc7);if(!_0xe51631)continue;const _0x259f2a=relative(_0x2d9738,_0x206804)[_0x3a5b22(0x126)](/\\/g,'/'),_0x6565c7=_0x259f2a[_0x3a5b22(0x124)]('/')[_0x3a5b22(0x10e)](Boolean),_0x2b7aee=parseSqlPath(_0x6565c7,_0x46f1a5[_0x3a5b22(0x122)],_0x329dc7);if(!_0x2b7aee)continue;_0x554ffb[_0x3a5b22(0x11a)]({'sqlCode':_0x2b7aee[_0x3a5b22(0x10d)],'sqlName':_0x2b7aee[_0x3a5b22(0x10f)],'dbDirectory':_0x6565c7[0x0],'filePath':_0x206804,'relativePath':_0x259f2a,'lockKey':_0x2b7aee[_0x3a5b22(0x10d)],'mode':_0xe51631});}}catch(_0x122d7c){if(_0x122d7c[_0x3a5b22(0x121)]!=='ENOENT')throw _0x122d7c;}return _0x554ffb;}export async function scanLocalSqlQueries(_0x3f7ca9){const _0x59a708=a162_0x419f;return scanSqlFilesRecursively(_0x3f7ca9[_0x59a708(0x118)],_0x3f7ca9['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x38f716,_0x37ee34,_0x541441){const _0x191de2=a162_0x419f,_0x5d6259=_0x541441?.['path']||(_0x541441?.['sqlName']||_0x541441?.[_0x191de2(0x123)]?buildSqlRelativePath(_0x37ee34,_0x541441?.['sqlName'],_0x541441?.[_0x191de2(0x123)],_0x541441?.[_0x191de2(0x10b)]||_0x191de2(0x109),_0x541441?.[_0x191de2(0x11d)]):buildDefaultSqlFileName(_0x37ee34,_0x541441?.[_0x191de2(0x10b)]||_0x191de2(0x109)));return join(_0x38f716[_0x191de2(0x118)],_0x5d6259);}export async function directoryExists(_0x3b13de){const _0x1b4835=a162_0x419f;try{const _0x27fa81=await stat(_0x3b13de);return _0x27fa81[_0x1b4835(0x112)]();}catch{return![];}}function parseSqlPath(_0x1822b2,_0x43a169,_0x5748ea){const _0x569a9f=a162_0x419f,_0x581c0e=_0x43a169['slice'](0x0,-_0x5748ea[_0x569a9f(0x120)]);if(_0x1822b2['length']<0x2)return null;const _0x1c4b82=_0x581c0e[_0x569a9f(0x127)]('_');if(_0x1c4b82<=0x0||_0x1c4b82>=_0x581c0e[_0x569a9f(0x120)]-0x1)return null;const _0x2010f7=_0x581c0e[_0x569a9f(0x11c)](0x0,_0x1c4b82);if(!isLikelySqlCode(_0x2010f7))return null;return{'sqlCode':_0x2010f7,'sqlName':_0x581c0e['slice'](_0x1c4b82+0x1)};}function a162_0x5e8a(){const _0x290a6b=['sql','2631235UofbZj','mode','1991803GUDpww','sqlCode','filter','sqlName','test','8933244tODsMb','isDirectory','766242kHAiXU','4NyFZDz','isFile','58947jIcKEi','1301778ieWUFY','sqlRootDir','130syUrJO','push','232890oJvUeO','slice','dbId','168ErCNwq','1ZhgZSi','length','code','name','dbName','split','mybatisXml','replace','indexOf'];a162_0x5e8a=function(){return _0x290a6b;};return a162_0x5e8a();}function a162_0x419f(_0x89030a,_0x2253b7){_0x89030a=_0x89030a-0x109;const _0x5e8a3c=a162_0x5e8a();let _0x419f58=_0x5e8a3c[_0x89030a];return _0x419f58;}function isLikelySqlCode(_0x2607a1){const _0x5c37f2=a162_0x419f;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x5c37f2(0x110)](_0x2607a1);}
@@ -1 +1 @@
1
- (function(_0x167617,_0x5cbfe2){const _0x42e889=a163_0x41e5,_0x24d40a=_0x167617();while(!![]){try{const _0x3c7b52=-parseInt(_0x42e889(0x1c2))/0x1+-parseInt(_0x42e889(0x1bc))/0x2*(parseInt(_0x42e889(0x1c1))/0x3)+-parseInt(_0x42e889(0x1b5))/0x4+-parseInt(_0x42e889(0x1bf))/0x5*(-parseInt(_0x42e889(0x1bd))/0x6)+parseInt(_0x42e889(0x1be))/0x7*(parseInt(_0x42e889(0x1ba))/0x8)+parseInt(_0x42e889(0x1c0))/0x9+parseInt(_0x42e889(0x1b7))/0xa;if(_0x3c7b52===_0x5cbfe2)break;else _0x24d40a['push'](_0x24d40a['shift']());}catch(_0x414270){_0x24d40a['push'](_0x24d40a['shift']());}}}(a163_0x1c07,0xec153));import{readFile}from'node:fs/promises';function a163_0x41e5(_0x4e92e9,_0x48a233){_0x4e92e9=_0x4e92e9-0x1b5;const _0x1c078f=a163_0x1c07();let _0x41e5b3=_0x1c078f[_0x4e92e9];return _0x41e5b3;}import a163_0x2d9e19 from'node:crypto';export function computeSqlContentHash(_0x189a97){const _0x5a9398=a163_0x41e5;return a163_0x2d9e19[_0x5a9398(0x1bb)]('md5')['update'](_0x189a97)[_0x5a9398(0x1b9)](_0x5a9398(0x1b8));}export async function computeSqlFileHash(_0x26c1d9){const _0x2d9d5c=a163_0x41e5,_0x2ca449=await readFile(_0x26c1d9,_0x2d9d5c(0x1b6));return computeSqlContentHash(_0x2ca449);}function a163_0x1c07(){const _0x3e4768=['utf8','6978310dyOkYt','hex','digest','317864HLBHxy','createHash','94vKNxvI','3392322QEAFiS','329HALSEb','5AbzHbW','9706932AokoIf','113628wvtsTy','529257ikXpRy','3731172oeUfyc'];a163_0x1c07=function(){return _0x3e4768;};return a163_0x1c07();}
1
+ (function(_0x255e22,_0x30060b){const _0x235bc3=a163_0xa710,_0xee146d=_0x255e22();while(!![]){try{const _0x6a18b4=-parseInt(_0x235bc3(0xb5))/0x1*(parseInt(_0x235bc3(0xb3))/0x2)+-parseInt(_0x235bc3(0xba))/0x3*(-parseInt(_0x235bc3(0xac))/0x4)+parseInt(_0x235bc3(0xb1))/0x5*(-parseInt(_0x235bc3(0xad))/0x6)+parseInt(_0x235bc3(0xae))/0x7*(parseInt(_0x235bc3(0xaf))/0x8)+parseInt(_0x235bc3(0xbd))/0x9*(-parseInt(_0x235bc3(0xb8))/0xa)+parseInt(_0x235bc3(0xbc))/0xb*(-parseInt(_0x235bc3(0xb6))/0xc)+parseInt(_0x235bc3(0xbb))/0xd;if(_0x6a18b4===_0x30060b)break;else _0xee146d['push'](_0xee146d['shift']());}catch(_0x272c94){_0xee146d['push'](_0xee146d['shift']());}}}(a163_0xdb94,0x9c767));import{readFile}from'node:fs/promises';import a163_0x4defad from'node:crypto';export function computeSqlContentHash(_0x34a53f){const _0x3a6148=a163_0xa710;return a163_0x4defad[_0x3a6148(0xb2)](_0x3a6148(0xb7))[_0x3a6148(0xb4)](_0x34a53f)[_0x3a6148(0xb0)]('hex');}function a163_0xdb94(){const _0x275f71=['2568yFJvcV','md5','565550qEdCnA','utf8','63189uVYjNp','32204341SxrIbJ','47421twBPfh','153NehqRm','152QTbmlp','42gRMolu','19887JOLlWn','1136qWKQit','digest','300505foWyYz','createHash','2wwpEKW','update','735506mbebAv'];a163_0xdb94=function(){return _0x275f71;};return a163_0xdb94();}function a163_0xa710(_0xeb7743,_0x93d087){_0xeb7743=_0xeb7743-0xac;const _0xdb948f=a163_0xdb94();let _0xa710c9=_0xdb948f[_0xeb7743];return _0xa710c9;}export async function computeSqlFileHash(_0x483c37){const _0x95b780=a163_0xa710,_0x16a09a=await readFile(_0x483c37,_0x95b780(0xb9));return computeSqlContentHash(_0x16a09a);}
@@ -1 +1 @@
1
- (function(_0x5b36e6,_0x41a48c){const _0x3f4175=a164_0x11b9,_0x5748b3=_0x5b36e6();while(!![]){try{const _0x2b4b66=parseInt(_0x3f4175(0x93))/0x1*(parseInt(_0x3f4175(0x8e))/0x2)+-parseInt(_0x3f4175(0x94))/0x3+parseInt(_0x3f4175(0x89))/0x4*(parseInt(_0x3f4175(0x8a))/0x5)+parseInt(_0x3f4175(0x8c))/0x6+-parseInt(_0x3f4175(0x92))/0x7*(parseInt(_0x3f4175(0x9a))/0x8)+-parseInt(_0x3f4175(0x99))/0x9*(-parseInt(_0x3f4175(0x98))/0xa)+-parseInt(_0x3f4175(0x91))/0xb;if(_0x2b4b66===_0x41a48c)break;else _0x5748b3['push'](_0x5748b3['shift']());}catch(_0x3283fa){_0x5748b3['push'](_0x5748b3['shift']());}}}(a164_0x48cb,0x6d10a));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x441964,_0x5dcec5,_0x32cb2e,_0x5b90e8){const _0x151925=a164_0x11b9,_0x388438=_0x441964??createEmptySqlLock();let _0x58202e=_0x388438[_0x151925(0x88)][_0x5dcec5];if(!_0x58202e)return _0x58202e={'sqlRoot':_0x32cb2e,'lastSync':'','sqls':{}},_0x388438['apps'][_0x5dcec5]=_0x58202e,{'lockData':_0x388438,'appLock':_0x58202e};if(!_0x58202e[_0x151925(0x90)])_0x58202e[_0x151925(0x90)]=_0x32cb2e;else{if(_0x58202e[_0x151925(0x90)]!==_0x32cb2e)throw new Error(_0x5b90e8+_0x151925(0x95)+_0x32cb2e+'\x22\x20vs\x20lock\x20\x22'+_0x58202e['sqlRoot']+'\x22.\x20'+_0x151925(0x97));}return!_0x58202e['sqls']&&(_0x58202e[_0x151925(0x96)]={}),!_0x58202e['lastSync']&&(_0x58202e[_0x151925(0x8b)]=''),{'lockData':_0x388438,'appLock':_0x58202e};}function a164_0x48cb(){const _0x208f71=['35hxuUoH','lastSync','5299368zQFzvh','code','3074naiadj','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','sqlRoot','14748041inGIfe','7sHCMPX','103BoVTde','574926hTembh',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','sqls','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','12830xmVgov','5715RUrcpp','518096gordNe','stringify','apps','107212AJrMaP'];a164_0x48cb=function(){return _0x208f71;};return a164_0x48cb();}export async function readSqlLockFile(_0x1e9690){const _0x34aa1e=a164_0x11b9;try{const _0x58db15=await readFile(_0x1e9690,'utf8');return JSON['parse'](_0x58db15);}catch(_0x4496a8){if(_0x4496a8[_0x34aa1e(0x8d)]==='ENOENT')return null;throw new Error(_0x34aa1e(0x8f)+String(_0x4496a8));}}function a164_0x11b9(_0x16fdc0,_0x15dfd1){_0x16fdc0=_0x16fdc0-0x87;const _0x48cb9e=a164_0x48cb();let _0x11b979=_0x48cb9e[_0x16fdc0];return _0x11b979;}export async function writeSqlLockFile(_0x169be6,_0x5b1be0){const _0xb150d9=a164_0x11b9;await mkdir(dirname(_0x169be6),{'recursive':!![]}),await writeFile(_0x169be6,JSON[_0xb150d9(0x87)](_0x5b1be0,null,0x2),'utf8');}
1
+ function a164_0xa176(_0x4822e4,_0x53f06b){_0x4822e4=_0x4822e4-0x1c8;const _0x353de9=a164_0x353d();let _0xa17690=_0x353de9[_0x4822e4];return _0xa17690;}(function(_0x58f6a1,_0x40f49f){const _0x520259=a164_0xa176,_0x166fb9=_0x58f6a1();while(!![]){try{const _0x234752=-parseInt(_0x520259(0x1ce))/0x1*(parseInt(_0x520259(0x1d0))/0x2)+parseInt(_0x520259(0x1ca))/0x3*(parseInt(_0x520259(0x1d7))/0x4)+-parseInt(_0x520259(0x1da))/0x5+-parseInt(_0x520259(0x1dd))/0x6*(-parseInt(_0x520259(0x1db))/0x7)+parseInt(_0x520259(0x1cd))/0x8+parseInt(_0x520259(0x1d3))/0x9*(-parseInt(_0x520259(0x1c9))/0xa)+-parseInt(_0x520259(0x1d4))/0xb*(-parseInt(_0x520259(0x1cb))/0xc);if(_0x234752===_0x40f49f)break;else _0x166fb9['push'](_0x166fb9['shift']());}catch(_0x7ff383){_0x166fb9['push'](_0x166fb9['shift']());}}}(a164_0x353d,0x6e1f3));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1a1eb8,_0x2fcce6,_0x20bf92,_0x5c69b5){const _0x366f37=a164_0xa176,_0x3045ff=_0x1a1eb8??createEmptySqlLock();let _0x5a8107=_0x3045ff['apps'][_0x2fcce6];if(!_0x5a8107)return _0x5a8107={'sqlRoot':_0x20bf92,'lastSync':'','sqls':{}},_0x3045ff[_0x366f37(0x1dc)][_0x2fcce6]=_0x5a8107,{'lockData':_0x3045ff,'appLock':_0x5a8107};if(!_0x5a8107[_0x366f37(0x1d9)])_0x5a8107[_0x366f37(0x1d9)]=_0x20bf92;else{if(_0x5a8107[_0x366f37(0x1d9)]!==_0x20bf92)throw new Error(_0x5c69b5+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x20bf92+_0x366f37(0x1d2)+_0x5a8107[_0x366f37(0x1d9)]+'\x22.\x20'+_0x366f37(0x1cf));}return!_0x5a8107[_0x366f37(0x1d5)]&&(_0x5a8107['sqls']={}),!_0x5a8107[_0x366f37(0x1de)]&&(_0x5a8107['lastSync']=''),{'lockData':_0x3045ff,'appLock':_0x5a8107};}export async function readSqlLockFile(_0x1cf18f){const _0x25fc29=a164_0xa176;try{const _0x5f2357=await readFile(_0x1cf18f,_0x25fc29(0x1df));return JSON[_0x25fc29(0x1d6)](_0x5f2357);}catch(_0x299101){if(_0x299101[_0x25fc29(0x1d8)]===_0x25fc29(0x1c8))return null;throw new Error(_0x25fc29(0x1cc)+String(_0x299101));}}function a164_0x353d(){const _0x152cc3=['sqls','parse','3606500jpnMmh','code','sqlRoot','3758240SdxVIM','100261rBYplx','apps','318WjSIen','lastSync','utf8','ENOENT','10RICTLv','3eKnuGW','1300488KfZJCI','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','1757480tKVozz','1WDoaOI','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1223722OUSDtY','stringify','\x22\x20vs\x20lock\x20\x22','4494213hZoqio','44lyzlZc'];a164_0x353d=function(){return _0x152cc3;};return a164_0x353d();}export async function writeSqlLockFile(_0x370716,_0x4a012e){const _0x3c23c8=a164_0xa176;await mkdir(dirname(_0x370716),{'recursive':!![]}),await writeFile(_0x370716,JSON[_0x3c23c8(0x1d1)](_0x4a012e,null,0x2),_0x3c23c8(0x1df));}
@@ -1 +1 @@
1
- (function(_0x56fefe,_0x47c747){const _0x1e01d5=a166_0xc0d6,_0x53fa6d=_0x56fefe();while(!![]){try{const _0x54ba61=parseInt(_0x1e01d5(0xce))/0x1*(parseInt(_0x1e01d5(0xbf))/0x2)+parseInt(_0x1e01d5(0xc4))/0x3*(parseInt(_0x1e01d5(0xc3))/0x4)+parseInt(_0x1e01d5(0xcb))/0x5+parseInt(_0x1e01d5(0xc0))/0x6*(parseInt(_0x1e01d5(0xcc))/0x7)+-parseInt(_0x1e01d5(0xc2))/0x8+-parseInt(_0x1e01d5(0xd1))/0x9*(parseInt(_0x1e01d5(0xc1))/0xa)+parseInt(_0x1e01d5(0xcf))/0xb;if(_0x54ba61===_0x47c747)break;else _0x53fa6d['push'](_0x53fa6d['shift']());}catch(_0xfa8cdb){_0x53fa6d['push'](_0x53fa6d['shift']());}}}(a166_0x4b7a,0x39c08));export function detectSqlMode(_0x59b85a){const _0x2ed7ad=a166_0xc0d6,_0x5d2cd0=_0x59b85a[_0x2ed7ad(0xc7)]();if(/^<(select|insert|update|delete)\b/i[_0x2ed7ad(0xc5)](_0x5d2cd0))return _0x2ed7ad(0xd0);return'sql';}export function getSqlFileExtension(_0x18e1ba){return _0x18e1ba==='mybatisXml'?'.xml':'.sql';}export function buildDefaultSqlFileName(_0x306190,_0x562906){return''+_0x306190+getSqlFileExtension(_0x562906);}function a166_0x4b7a(){const _0x1dac26=['unknown-sql','replace','db-','210875zktWry','7LPxFmY','unknown-db','8605GcjaMQ','4046119QViHdr','mybatisXml','9euKAsl','6hUXocO','757098adolxS','2705020KWqcRx','3773744JDcrAX','20vKewUm','250062jBInQj','test','trim','trimStart'];a166_0x4b7a=function(){return _0x1dac26;};return a166_0x4b7a();}export function sanitizeSqlPathSegment(_0x44ee99,_0x11d510){const _0x2d07ff=a166_0xc0d6,_0x39d063=String(_0x44ee99??'')[_0x2d07ff(0xc6)](),_0x20a753=_0x39d063['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2d07ff(0xc9)](/\s+/g,'-')[_0x2d07ff(0xc9)](/-+/g,'-')[_0x2d07ff(0xc9)](/^\.+/,'')[_0x2d07ff(0xc9)](/\.+$/,'')[_0x2d07ff(0xc9)](/^-+/,'')['replace'](/-+$/,'');return _0x20a753||_0x11d510;}function a166_0xc0d6(_0x43e2a8,_0x3b2031){_0x43e2a8=_0x43e2a8-0xbf;const _0x4b7a39=a166_0x4b7a();let _0xc0d65e=_0x4b7a39[_0x43e2a8];return _0xc0d65e;}export function buildDbDirectoryName(_0x5e04a7,_0x5e21a0){const _0x532eb2=a166_0xc0d6;return sanitizeSqlPathSegment(_0x5e04a7,_0x5e21a0!=null?_0x532eb2(0xca)+_0x5e21a0:_0x532eb2(0xcd));}export function buildSqlRelativePath(_0x47c01b,_0x40e044,_0x15c6e4,_0x2418a8,_0x4cb78b){const _0xa5c363=a166_0xc0d6,_0x185b35=buildDbDirectoryName(_0x15c6e4,_0x4cb78b),_0x55e2fe=sanitizeSqlPathSegment(_0x47c01b,_0xa5c363(0xc8)),_0xfbf046=sanitizeSqlPathSegment(_0x40e044,_0x55e2fe);return _0x185b35+'/'+_0x55e2fe+'_'+_0xfbf046+getSqlFileExtension(_0x2418a8);}
1
+ (function(_0x346e5a,_0x6ef6bb){const _0x2540cd=a166_0x1d62,_0x5e4daf=_0x346e5a();while(!![]){try{const _0x44269d=-parseInt(_0x2540cd(0x1fa))/0x1*(-parseInt(_0x2540cd(0x1fe))/0x2)+parseInt(_0x2540cd(0x1f3))/0x3+-parseInt(_0x2540cd(0x1fc))/0x4*(-parseInt(_0x2540cd(0x1f4))/0x5)+parseInt(_0x2540cd(0x1f9))/0x6+parseInt(_0x2540cd(0x1f2))/0x7+-parseInt(_0x2540cd(0x201))/0x8*(parseInt(_0x2540cd(0x1fb))/0x9)+parseInt(_0x2540cd(0x1f8))/0xa*(-parseInt(_0x2540cd(0x1ee))/0xb);if(_0x44269d===_0x6ef6bb)break;else _0x5e4daf['push'](_0x5e4daf['shift']());}catch(_0xf27fcc){_0x5e4daf['push'](_0x5e4daf['shift']());}}}(a166_0x5238,0xa10ef));export function detectSqlMode(_0x502fdf){const _0x3967b8=a166_0x1d62,_0x118515=_0x502fdf['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x3967b8(0x1f6)](_0x118515))return _0x3967b8(0x1ef);return'sql';}export function getSqlFileExtension(_0x45cde9){const _0x2d8ac5=a166_0x1d62;return _0x45cde9===_0x2d8ac5(0x1ef)?_0x2d8ac5(0x1f1):_0x2d8ac5(0x1f5);}export function buildDefaultSqlFileName(_0x1df8ef,_0x38771a){return''+_0x1df8ef+getSqlFileExtension(_0x38771a);}function a166_0x1d62(_0x42eeec,_0x237b7e){_0x42eeec=_0x42eeec-0x1ee;const _0x5238e0=a166_0x5238();let _0x1d623e=_0x5238e0[_0x42eeec];return _0x1d623e;}export function sanitizeSqlPathSegment(_0x124f73,_0x504a22){const _0x3d0b7b=a166_0x1d62,_0x4ea567=String(_0x124f73??'')[_0x3d0b7b(0x1ff)](),_0x4ece33=_0x4ea567[_0x3d0b7b(0x1fd)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x3d0b7b(0x1fd)](/\s+/g,'-')[_0x3d0b7b(0x1fd)](/-+/g,'-')['replace'](/^\.+/,'')[_0x3d0b7b(0x1fd)](/\.+$/,'')[_0x3d0b7b(0x1fd)](/^-+/,'')['replace'](/-+$/,'');return _0x4ece33||_0x504a22;}export function buildDbDirectoryName(_0x9c9e09,_0x2b4648){const _0x169cc5=a166_0x1d62;return sanitizeSqlPathSegment(_0x9c9e09,_0x2b4648!=null?_0x169cc5(0x1f0)+_0x2b4648:_0x169cc5(0x200));}export function buildSqlRelativePath(_0x165171,_0x6c23f1,_0x30a581,_0xb7cb98,_0x4f0056){const _0x491cf5=a166_0x1d62,_0x24e1b5=buildDbDirectoryName(_0x30a581,_0x4f0056),_0x5673b5=sanitizeSqlPathSegment(_0x165171,_0x491cf5(0x1f7)),_0x52d25d=sanitizeSqlPathSegment(_0x6c23f1,_0x5673b5);return _0x24e1b5+'/'+_0x5673b5+'_'+_0x52d25d+getSqlFileExtension(_0xb7cb98);}function a166_0x5238(){const _0x1ffe95=['2476894MHCBij','trim','unknown-db','8369768uIYERv','55BAjKlk','mybatisXml','db-','.xml','8235626JHzSyp','769323DsDIFI','145HWkfzb','.sql','test','unknown-sql','6281070SlXAPo','7434768ZMFTVU','1uALSjq','9nhhnAr','129092UPpoQL','replace'];a166_0x5238=function(){return _0x1ffe95;};return a166_0x5238();}
@@ -1 +1 @@
1
- function a167_0x592a(_0x455169,_0x10f31e){_0x455169=_0x455169-0x154;const _0x2d1803=a167_0x2d18();let _0x592aed=_0x2d1803[_0x455169];return _0x592aed;}(function(_0xa4189,_0x10a80c){const _0x43d975=a167_0x592a,_0x57831e=_0xa4189();while(!![]){try{const _0x124aba=parseInt(_0x43d975(0x15b))/0x1+parseInt(_0x43d975(0x16e))/0x2*(parseInt(_0x43d975(0x155))/0x3)+-parseInt(_0x43d975(0x157))/0x4*(-parseInt(_0x43d975(0x173))/0x5)+parseInt(_0x43d975(0x162))/0x6*(parseInt(_0x43d975(0x161))/0x7)+-parseInt(_0x43d975(0x172))/0x8+parseInt(_0x43d975(0x16a))/0x9+parseInt(_0x43d975(0x174))/0xa*(-parseInt(_0x43d975(0x15e))/0xb);if(_0x124aba===_0x10a80c)break;else _0x57831e['push'](_0x57831e['shift']());}catch(_0x1d5162){_0x57831e['push'](_0x57831e['shift']());}}}(a167_0x2d18,0x808a6));export function detectSqlType(_0x5853aa){const _0x219d59=a167_0x592a;if(!_0x5853aa?.[_0x219d59(0x16b)]())return{'type':_0x219d59(0x159),'isSelectOnly':![],'isDangerous':![],'reason':_0x219d59(0x16d)};const _0x591674=_0x5853aa[_0x219d59(0x165)](/#\{[^}]*\}/g,'?')[_0x219d59(0x165)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x219d59(0x165)](/\/\*[\s\S]*?\*\//g,'')[_0x219d59(0x16b)](),_0x317a4b=_0x591674[_0x219d59(0x164)]('\x0a');let _0x13a99a='';for(const _0x15fdf7 of _0x317a4b){const _0x5ef860=_0x15fdf7[_0x219d59(0x16b)]();if(!_0x5ef860||_0x5ef860[_0x219d59(0x15d)]('--')||_0x5ef860['startsWith']('/*'))continue;_0x13a99a=_0x5ef860;break;}const _0x1b753f=_0x13a99a[_0x219d59(0x175)]();if(_0x1b753f[_0x219d59(0x15d)]('SELECT')||_0x1b753f['startsWith']('WITH')){const _0x5bfec0=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x219d59(0x178)](_0x591674);return{'type':'SELECT','isSelectOnly':!_0x5bfec0,'isDangerous':_0x5bfec0,'reason':_0x5bfec0?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x1b753f['startsWith'](_0x219d59(0x167)))return{'type':_0x219d59(0x167),'isSelectOnly':![],'isDangerous':![]};if(_0x1b753f['startsWith'](_0x219d59(0x176)))return{'type':_0x219d59(0x176),'isSelectOnly':![],'isDangerous':![]};if(_0x1b753f[_0x219d59(0x15d)](_0x219d59(0x158)))return{'type':_0x219d59(0x158),'isSelectOnly':![],'isDangerous':!![],'reason':_0x219d59(0x15c)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x1b753f))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':_0x219d59(0x16f)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x5ce8ee){const _0x579e64=a167_0x592a,_0x1bb451=_0x5ce8ee[_0x579e64(0x165)](/#\{[^}]*\}/g,'?')[_0x579e64(0x165)](/\$\{[^}]*\}/g,'?')[_0x579e64(0x165)](/'[^']*'/g,'\x27\x27')[_0x579e64(0x165)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x4b2f49=[],_0x103050=_0x1bb451[_0x579e64(0x166)](/FROM\s+([^\s,)(]+)/i);if(_0x103050?.[0x1])_0x4b2f49[_0x579e64(0x163)](_0x103050[0x1][_0x579e64(0x165)](/[`"]/g,''));for(const _0x322613 of _0x1bb451[_0x579e64(0x168)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x153222=_0x322613[0x1]?.[_0x579e64(0x165)](/[`"]/g,'');if(_0x153222&&!_0x4b2f49[_0x579e64(0x15f)](_0x153222))_0x4b2f49['push'](_0x153222);}const _0x21f57a=_0x1bb451['match'](/INTO\s+([^\s(]+)/i);if(_0x21f57a?.[0x1]){const _0x389d04=_0x21f57a[0x1][_0x579e64(0x165)](/[`"]/g,'');if(!_0x4b2f49['includes'](_0x389d04))_0x4b2f49[_0x579e64(0x163)](_0x389d04);}const _0x266c7b=_0x1bb451['match'](/UPDATE\s+([^\s,)(]+)/i);if(_0x266c7b?.[0x1]){const _0x448411=_0x266c7b[0x1][_0x579e64(0x165)](/[`"]/g,'');if(!_0x4b2f49[_0x579e64(0x15f)](_0x448411))_0x4b2f49[_0x579e64(0x163)](_0x448411);}return _0x4b2f49;}function extractParameters(_0x19f8cc){const _0x284d5e=a167_0x592a,_0x53d059=new Set();for(const _0x5c61b7 of _0x19f8cc[_0x284d5e(0x168)](/#\{(\w+)\}/g))if(_0x5c61b7[0x1])_0x53d059[_0x284d5e(0x156)](_0x5c61b7[0x1]);for(const _0x4d4ba5 of _0x19f8cc[_0x284d5e(0x168)](/\$\{(\w+)\}/g))if(_0x4d4ba5[0x1])_0x53d059[_0x284d5e(0x156)](_0x4d4ba5[0x1]);return Array['from'](_0x53d059);}function a167_0x2d18(){const _0x10b481=['add','330088cxjkYK','DELETE','UNKNOWN','unknown\x20table(s)','164006gdyrGM','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','startsWith','1715604vRdXuG','includes','length','91TqUgoA','115326WxrvPf','push','split','replace','match','INSERT','matchAll','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','9321471noTmoz','trim','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','SQL\x20content\x20is\x20empty','426DxBikX','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','isDangerous','type','6924088zzGMce','60yMtOCl','110FrtnmM','toUpperCase','UPDATE','join','test','\x20with\x20parameters:\x20','reason','9405JMnXod'];a167_0x2d18=function(){return _0x10b481;};return a167_0x2d18();}export function validateSql(_0x2404e1){const _0x15ab56=a167_0x592a,_0x3f6708=detectSqlType(_0x2404e1),_0x283d77=extractTables(_0x2404e1),_0x2a7a5d=extractParameters(_0x2404e1);if(_0x3f6708[_0x15ab56(0x170)])return{'valid':![],'sqlType':_0x3f6708,'tables':_0x283d77,'parameters':_0x2a7a5d,'message':_0x3f6708[_0x15ab56(0x154)]||_0x3f6708[_0x15ab56(0x171)]+_0x15ab56(0x169)};if(_0x3f6708[_0x15ab56(0x171)]===_0x15ab56(0x159))return{'valid':![],'sqlType':_0x3f6708,'tables':_0x283d77,'parameters':_0x2a7a5d,'message':_0x15ab56(0x16c)};return{'valid':!![],'sqlType':_0x3f6708,'tables':_0x283d77,'parameters':_0x2a7a5d,'message':_0x3f6708[_0x15ab56(0x171)]+'\x20query\x20targeting\x20'+(_0x283d77[_0x15ab56(0x160)]?_0x283d77[_0x15ab56(0x177)](',\x20'):_0x15ab56(0x15a))+(_0x2a7a5d['length']?_0x15ab56(0x179)+_0x2a7a5d['join'](',\x20'):'')};}
1
+ (function(_0x52676d,_0x15a18c){const _0x4701b0=a167_0x36aa,_0x5ac2fb=_0x52676d();while(!![]){try{const _0x2168c1=-parseInt(_0x4701b0(0x6b))/0x1+parseInt(_0x4701b0(0x6a))/0x2+parseInt(_0x4701b0(0x72))/0x3*(-parseInt(_0x4701b0(0x67))/0x4)+parseInt(_0x4701b0(0x66))/0x5*(-parseInt(_0x4701b0(0x7e))/0x6)+-parseInt(_0x4701b0(0x7c))/0x7+-parseInt(_0x4701b0(0x7d))/0x8+parseInt(_0x4701b0(0x84))/0x9;if(_0x2168c1===_0x15a18c)break;else _0x5ac2fb['push'](_0x5ac2fb['shift']());}catch(_0x3b3574){_0x5ac2fb['push'](_0x5ac2fb['shift']());}}}(a167_0x2327,0x1c035));export function detectSqlType(_0x91d59d){const _0x3a68ab=a167_0x36aa;if(!_0x91d59d?.[_0x3a68ab(0x86)]())return{'type':_0x3a68ab(0x8b),'isSelectOnly':![],'isDangerous':![],'reason':_0x3a68ab(0x7b)};const _0x23bea6=_0x91d59d[_0x3a68ab(0x85)](/#\{[^}]*\}/g,'?')[_0x3a68ab(0x85)](/\$\{[^}]*\}/g,'?')[_0x3a68ab(0x85)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x3a68ab(0x85)](/\/\*[\s\S]*?\*\//g,'')[_0x3a68ab(0x86)](),_0x45deb0=_0x23bea6[_0x3a68ab(0x7f)]('\x0a');let _0x57d558='';for(const _0xa4d06 of _0x45deb0){const _0x365e37=_0xa4d06[_0x3a68ab(0x86)]();if(!_0x365e37||_0x365e37[_0x3a68ab(0x87)]('--')||_0x365e37[_0x3a68ab(0x87)]('/*'))continue;_0x57d558=_0x365e37;break;}const _0x31393f=_0x57d558['toUpperCase']();if(_0x31393f['startsWith']('SELECT')||_0x31393f['startsWith'](_0x3a68ab(0x88))){const _0x555f72=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x3a68ab(0x83)](_0x23bea6);return{'type':'SELECT','isSelectOnly':!_0x555f72,'isDangerous':_0x555f72,'reason':_0x555f72?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x31393f[_0x3a68ab(0x87)]('INSERT'))return{'type':_0x3a68ab(0x77),'isSelectOnly':![],'isDangerous':![]};if(_0x31393f[_0x3a68ab(0x87)]('UPDATE'))return{'type':_0x3a68ab(0x68),'isSelectOnly':![],'isDangerous':![]};if(_0x31393f[_0x3a68ab(0x87)](_0x3a68ab(0x6f)))return{'type':_0x3a68ab(0x6f),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3a68ab(0x89)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x3a68ab(0x83)](_0x31393f))return{'type':_0x3a68ab(0x82),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3a68ab(0x6e)};return{'type':_0x3a68ab(0x8b),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x1101d9){const _0x573072=a167_0x36aa,_0x504462=_0x1101d9['replace'](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x573072(0x85)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x573072(0x85)](/\/\*[\s\S]*?\*\//g,''),_0x28400d=[],_0x1f64ca=_0x504462[_0x573072(0x79)](/FROM\s+([^\s,)(]+)/i);if(_0x1f64ca?.[0x1])_0x28400d[_0x573072(0x76)](_0x1f64ca[0x1][_0x573072(0x85)](/[`"]/g,''));for(const _0x2012d1 of _0x504462['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0xc39cc2=_0x2012d1[0x1]?.[_0x573072(0x85)](/[`"]/g,'');if(_0xc39cc2&&!_0x28400d[_0x573072(0x74)](_0xc39cc2))_0x28400d[_0x573072(0x76)](_0xc39cc2);}const _0xdfb3bb=_0x504462[_0x573072(0x79)](/INTO\s+([^\s(]+)/i);if(_0xdfb3bb?.[0x1]){const _0x4dffa1=_0xdfb3bb[0x1]['replace'](/[`"]/g,'');if(!_0x28400d[_0x573072(0x74)](_0x4dffa1))_0x28400d[_0x573072(0x76)](_0x4dffa1);}const _0x3a2fb7=_0x504462[_0x573072(0x79)](/UPDATE\s+([^\s,)(]+)/i);if(_0x3a2fb7?.[0x1]){const _0x11af18=_0x3a2fb7[0x1][_0x573072(0x85)](/[`"]/g,'');if(!_0x28400d['includes'](_0x11af18))_0x28400d[_0x573072(0x76)](_0x11af18);}return _0x28400d;}function extractParameters(_0x36889b){const _0xf85f4b=a167_0x36aa,_0x39d217=new Set();for(const _0x27868a of _0x36889b['matchAll'](/#\{(\w+)\}/g))if(_0x27868a[0x1])_0x39d217[_0xf85f4b(0x6d)](_0x27868a[0x1]);for(const _0x516875 of _0x36889b[_0xf85f4b(0x71)](/\$\{(\w+)\}/g))if(_0x516875[0x1])_0x39d217[_0xf85f4b(0x6d)](_0x516875[0x1]);return Array[_0xf85f4b(0x69)](_0x39d217);}function a167_0x36aa(_0x5e84f5,_0x22c28c){_0x5e84f5=_0x5e84f5-0x66;const _0x2327a3=a167_0x2327();let _0x36aad2=_0x2327a3[_0x5e84f5];return _0x36aad2;}export function validateSql(_0x4f04ef){const _0x2c5f4a=a167_0x36aa,_0x180133=detectSqlType(_0x4f04ef),_0x5c26b8=extractTables(_0x4f04ef),_0x3b0437=extractParameters(_0x4f04ef);if(_0x180133[_0x2c5f4a(0x81)])return{'valid':![],'sqlType':_0x180133,'tables':_0x5c26b8,'parameters':_0x3b0437,'message':_0x180133[_0x2c5f4a(0x78)]||_0x180133[_0x2c5f4a(0x75)]+_0x2c5f4a(0x6c)};if(_0x180133['type']===_0x2c5f4a(0x8b))return{'valid':![],'sqlType':_0x180133,'tables':_0x5c26b8,'parameters':_0x3b0437,'message':'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x180133,'tables':_0x5c26b8,'parameters':_0x3b0437,'message':_0x180133[_0x2c5f4a(0x75)]+_0x2c5f4a(0x8a)+(_0x5c26b8[_0x2c5f4a(0x73)]?_0x5c26b8['join'](',\x20'):_0x2c5f4a(0x80))+(_0x3b0437[_0x2c5f4a(0x73)]?_0x2c5f4a(0x7a)+_0x3b0437[_0x2c5f4a(0x70)](',\x20'):'')};}function a167_0x2327(){const _0x57d303=['\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','add','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','DELETE','join','matchAll','612501uvgBUA','length','includes','type','push','INSERT','reason','match','\x20with\x20parameters:\x20','SQL\x20content\x20is\x20empty','797475WMmnHD','641064yBtBEI','114kYKXoa','split','unknown\x20table(s)','isDangerous','DDL','test','7184214ZjjqIp','replace','trim','startsWith','WITH','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','\x20query\x20targeting\x20','UNKNOWN','56255QVvJVd','4FuUIpO','UPDATE','from','37402TVRonl','90212kvwQhp'];a167_0x2327=function(){return _0x57d303;};return a167_0x2327();}