@lovrabet/rabetbase-cli 2.3.8-beta.1 → 2.3.8

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 (245) 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/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.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-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/notification/config-list.js +1 -1
  115. package/lib/commands/notification/index.js +1 -1
  116. package/lib/commands/page/generate-start.js +1 -1
  117. package/lib/commands/page/generate-status.js +1 -1
  118. package/lib/commands/page/index.js +1 -1
  119. package/lib/commands/page/pull.js +1 -1
  120. package/lib/commands/page/push.js +1 -1
  121. package/lib/commands/page/relation-audit.js +1 -1
  122. package/lib/commands/page/shared.js +1 -1
  123. package/lib/commands/page/standard-page-status.js +1 -1
  124. package/lib/commands/page/sync.js +1 -1
  125. package/lib/commands/permit/index.js +1 -1
  126. package/lib/commands/permit/page-get.js +1 -1
  127. package/lib/commands/permit/page-set.js +1 -1
  128. package/lib/commands/permit/role-apis-set.js +1 -1
  129. package/lib/commands/permit/role-menus-set.js +1 -1
  130. package/lib/commands/permit/role-menus.js +1 -1
  131. package/lib/commands/permit/shared.js +1 -1
  132. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  133. package/lib/commands/project/create/format-elapsed.js +1 -1
  134. package/lib/commands/project/create/main.js +1 -1
  135. package/lib/commands/project/create/non-interactive.js +1 -1
  136. package/lib/commands/project/create/project-template-path.js +1 -1
  137. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  138. package/lib/commands/project/create/use-format-code.js +1 -1
  139. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  140. package/lib/commands/project/index.js +1 -1
  141. package/lib/commands/project/init.js +1 -1
  142. package/lib/commands/project/upgrade.js +1 -1
  143. package/lib/commands/registry.js +1 -1
  144. package/lib/commands/role/create.js +1 -1
  145. package/lib/commands/role/delete.js +1 -1
  146. package/lib/commands/role/detail.js +1 -1
  147. package/lib/commands/role/index.js +1 -1
  148. package/lib/commands/role/list.js +1 -1
  149. package/lib/commands/role/shared.js +1 -1
  150. package/lib/commands/role/update.js +1 -1
  151. package/lib/commands/role/user-add.js +1 -1
  152. package/lib/commands/role/user-remove.js +1 -1
  153. package/lib/commands/role/user-resolve.js +1 -1
  154. package/lib/commands/run/index.js +1 -1
  155. package/lib/commands/schema.js +1 -1
  156. package/lib/commands/sql/create.js +1 -1
  157. package/lib/commands/sql/delete.js +1 -1
  158. package/lib/commands/sql/detail.js +1 -1
  159. package/lib/commands/sql/exec.js +1 -1
  160. package/lib/commands/sql/index.js +1 -1
  161. package/lib/commands/sql/list.js +1 -1
  162. package/lib/commands/sql/pull.js +1 -1
  163. package/lib/commands/sql/push.js +1 -1
  164. package/lib/commands/sql/save.js +1 -1
  165. package/lib/commands/sql/shared.js +1 -1
  166. package/lib/commands/sql/status.js +1 -1
  167. package/lib/commands/sql/validate.js +1 -1
  168. package/lib/commands/workspace/add.js +1 -1
  169. package/lib/commands/workspace/index.js +1 -1
  170. package/lib/commands/workspace/remove.js +1 -1
  171. package/lib/config/schema.js +1 -1
  172. package/lib/constant/cdn.js +1 -1
  173. package/lib/constant/cli.js +1 -1
  174. package/lib/constant/defaults.js +1 -1
  175. package/lib/constant/domain.js +1 -1
  176. package/lib/constant/env.js +1 -1
  177. package/lib/constant/output.js +1 -1
  178. package/lib/constant/paths.js +1 -1
  179. package/lib/constant/risk.js +1 -1
  180. package/lib/context/app-resolver.js +1 -1
  181. package/lib/context/auth-resolver.js +1 -1
  182. package/lib/context/config-loader.js +1 -1
  183. package/lib/context.js +1 -1
  184. package/lib/core/alias-resolver.js +1 -1
  185. package/lib/core/api-client.js +1 -1
  186. package/lib/core/bff/config.js +1 -1
  187. package/lib/core/bff/file-system.js +1 -1
  188. package/lib/core/bff/hash.js +1 -1
  189. package/lib/core/bff/lock.js +1 -1
  190. package/lib/core/bff/utils.js +1 -1
  191. package/lib/core/db-resolver.js +1 -1
  192. package/lib/core/page/file-system.js +1 -1
  193. package/lib/core/page/hash.js +1 -1
  194. package/lib/core/page/lock.js +1 -1
  195. package/lib/core/sql-sync/config.js +1 -1
  196. package/lib/core/sql-sync/file-system.js +1 -1
  197. package/lib/core/sql-sync/hash.js +1 -1
  198. package/lib/core/sql-sync/lock.js +1 -1
  199. package/lib/core/sql-sync/utils.js +1 -1
  200. package/lib/core/sql-validator.js +1 -1
  201. package/lib/errors.js +1 -1
  202. package/lib/framework/build-all-flags.js +1 -1
  203. package/lib/framework/flags.js +1 -1
  204. package/lib/framework/help.js +1 -1
  205. package/lib/framework/index.js +1 -1
  206. package/lib/framework/output.js +1 -1
  207. package/lib/framework/response.js +1 -1
  208. package/lib/framework/runner-alias.js +1 -1
  209. package/lib/framework/runner.js +1 -1
  210. package/lib/framework/schema-export.js +1 -1
  211. package/lib/framework/types.js +1 -1
  212. package/lib/generated/build-info.js +1 -1
  213. package/lib/help.js +1 -1
  214. package/lib/skills/main.js +1 -1
  215. package/lib/skills/npx-skills-add.js +1 -1
  216. package/lib/telemetry/cli-command-trace.js +1 -1
  217. package/lib/telemetry/cli-help-trace.js +1 -1
  218. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  219. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  220. package/lib/telemetry/send-cli-trace-log.js +1 -1
  221. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  222. package/lib/utils/ai_config.js +1 -1
  223. package/lib/utils/apply-jq-filter.js +1 -1
  224. package/lib/utils/cdn-config.js +1 -1
  225. package/lib/utils/check-sdk-version.js +1 -1
  226. package/lib/utils/cli-version-check.js +1 -1
  227. package/lib/utils/cli-version-policy.js +1 -1
  228. package/lib/utils/config.js +1 -1
  229. package/lib/utils/copy-directory.js +1 -1
  230. package/lib/utils/entity-with-id.js +1 -1
  231. package/lib/utils/file-utils.js +1 -1
  232. package/lib/utils/guides-cdn.js +1 -1
  233. package/lib/utils/http-client.js +1 -1
  234. package/lib/utils/is-non-interactive.js +1 -1
  235. package/lib/utils/logger.js +1 -1
  236. package/lib/utils/params.js +1 -1
  237. package/lib/utils/platform.js +1 -1
  238. package/lib/utils/rules-cdn.js +1 -1
  239. package/lib/utils/sleep.js +1 -1
  240. package/lib/utils/template-replacer.js +1 -1
  241. package/lib/utils/update-notice.js +1 -1
  242. package/lib/utils/version.js +1 -1
  243. package/lib/utils/with-active-cookie.js +1 -1
  244. package/lib/utils/write-cli-side-channel.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0xd0f9cc,_0x353b5c){const _0x10fc48=a185_0x163b,_0x195b67=_0xd0f9cc();while(!![]){try{const _0x462697=-parseInt(_0x10fc48(0x1c5))/0x1*(-parseInt(_0x10fc48(0x1f3))/0x2)+-parseInt(_0x10fc48(0x206))/0x3*(-parseInt(_0x10fc48(0x1ce))/0x4)+parseInt(_0x10fc48(0x176))/0x5*(parseInt(_0x10fc48(0x138))/0x6)+parseInt(_0x10fc48(0x173))/0x7*(-parseInt(_0x10fc48(0x204))/0x8)+parseInt(_0x10fc48(0x1ad))/0x9*(parseInt(_0x10fc48(0x1e8))/0xa)+parseInt(_0x10fc48(0x15e))/0xb+-parseInt(_0x10fc48(0x1af))/0xc;if(_0x462697===_0x353b5c)break;else _0x195b67['push'](_0x195b67['shift']());}catch(_0x1c87b2){_0x195b67['push'](_0x195b67['shift']());}}}(a185_0x1e9e,0x687de));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x1ebe75){_activeCookie=_0x1ebe75||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x3e76e9,_0x4db773){const _0xd766ce=a185_0x163b,_0xf78be4=_0x4db773 instanceof Error?_0x4db773[_0xd766ce(0x1db)]:String(_0x4db773);return CliErrors[_0xd766ce(0x171)](_0xd766ce(0x1e1)+_0x3e76e9+(_0xf78be4?'\x20('+_0xf78be4+')':''),_0xd766ce(0x13d));}async function apiRequest(_0x305518,_0x50479c={}){const _0x45b1aa=a185_0x163b,{method:method=_0x45b1aa(0x18d),body:_0x17113b,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x50479c,_0x1c6ca3=useRuntime?getRuntimeDomain():getApiDomain(),_0x262c35=_activeCookie||getCookie(),_0x4e5ce1=''+_0x1c6ca3+_0x305518,_0x48326e=new AbortController(),_0x23a715=setTimeout(()=>_0x48326e[_0x45b1aa(0x1e0)](),timeout);try{const _0x33beb8=await fetch(_0x4e5ce1,{'method':method,'headers':{'Content-Type':_0x45b1aa(0x196),'Cookie':_0x262c35,'X-Invoke-Source':_0x45b1aa(0x1eb),...headers},'body':_0x17113b?JSON[_0x45b1aa(0x187)](_0x17113b):undefined,'signal':_0x48326e[_0x45b1aa(0x168)]});let _0x4505ed;try{_0x4505ed=await _0x33beb8[_0x45b1aa(0x14f)]();}catch(_0x3b4a23){if(_0x3b4a23 instanceof Error&&_0x3b4a23[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors[_0x45b1aa(0x171)](_0x45b1aa(0x169)+_0x4e5ce1);if(_0x33beb8['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x45b1aa(0x1bd)+_0x33beb8[_0x45b1aa(0x167)]+')',_0x33beb8['status']>=0x190?_0x45b1aa(0x137):undefined);}if(!_0x33beb8['ok']||_0x4505ed[_0x45b1aa(0x1d8)]===![])throw CliErrors['apiError'](_0x4505ed[_0x45b1aa(0x17f)]||_0x4505ed[_0x45b1aa(0x1db)]||_0x45b1aa(0x172)+_0x33beb8[_0x45b1aa(0x167)],_0x4505ed[_0x45b1aa(0x179)]?_0x45b1aa(0x141)+_0x4505ed[_0x45b1aa(0x179)]:undefined);return _0x4505ed;}catch(_0x31ebda){if(_0x31ebda instanceof CliError)throw _0x31ebda;if(_0x31ebda instanceof Error&&_0x31ebda[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors['apiError'](_0x45b1aa(0x169)+_0x4e5ce1);throw createFetchFailureError(_0x4e5ce1,_0x31ebda);}finally{clearTimeout(_0x23a715);}}async function apiFormRequest(_0x4038b5,_0x483183,_0x123ee4={}){const _0x4c71d9=a185_0x163b,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x123ee4,_0x3af7da=_activeCookie||getCookie(),_0x3d98b4=''+getApiDomain()+_0x4038b5,_0x32b3a3=new AbortController(),_0x1a22e6=setTimeout(()=>_0x32b3a3['abort'](),timeout);try{const _0x5f3b7e=await fetch(_0x3d98b4,{'method':_0x4c71d9(0x158),'headers':{'Cookie':_0x3af7da,'X-Invoke-Source':_0x4c71d9(0x1eb)},'body':_0x483183,'signal':_0x32b3a3[_0x4c71d9(0x168)]});let _0x510294;try{_0x510294=await _0x5f3b7e[_0x4c71d9(0x14f)]();}catch(_0x4bb727){if(_0x4bb727 instanceof Error&&_0x4bb727[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x3d98b4);throw CliErrors['apiError'](_0x4c71d9(0x1bd)+_0x5f3b7e[_0x4c71d9(0x167)]+')',_0x5f3b7e[_0x4c71d9(0x167)]>=0x190?_0x4c71d9(0x137):undefined);}if(!_0x5f3b7e['ok']||_0x510294['success']===![])throw CliErrors['apiError'](_0x510294[_0x4c71d9(0x17f)]||_0x510294[_0x4c71d9(0x1db)]||_0x4c71d9(0x172)+_0x5f3b7e[_0x4c71d9(0x167)],_0x510294['errorCode']?_0x4c71d9(0x141)+_0x510294[_0x4c71d9(0x179)]:undefined);return _0x510294;}catch(_0x13cdf5){if(_0x13cdf5 instanceof CliError)throw _0x13cdf5;if(_0x13cdf5 instanceof Error&&_0x13cdf5[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors[_0x4c71d9(0x171)](_0x4c71d9(0x169)+_0x3d98b4);throw createFetchFailureError(_0x3d98b4,_0x13cdf5);}finally{clearTimeout(_0x1a22e6);}}export async function uploadDevelopmentFile(_0x16e318,_0x3d1dd9){const _0x170f7b=a185_0x163b,_0x8d0573=await readFile(_0x3d1dd9),_0xe2b822=new FormData();_0xe2b822['append'](_0x170f7b(0x133),_0x16e318),_0xe2b822['append'](_0x170f7b(0x1e2),new Blob([new Uint8Array(_0x8d0573)]),basename(_0x3d1dd9));const _0x382206=await apiFormRequest('/smartapi/common/uploadFile',_0xe2b822);return _0x382206[_0x170f7b(0x208)];}export async function queryDevelopmentFileUrl(_0x42a17f,_0x2b3ca2={}){const _0x51573a=a185_0x163b,_0x476268=await apiRequest(_0x51573a(0x134),{'method':_0x51573a(0x158),'body':{'filePath':_0x42a17f,'downloadFlag':_0x2b3ca2['download']??![],..._0x2b3ca2[_0x51573a(0x18e)]?{'longTerm':!![]}:{}}});return _0x476268['data'];}function isAuthFailure(_0x345950){const _0x157e49=a185_0x163b,_0x587559=_0x345950['errorMsg']||_0x345950[_0x157e49(0x1db)]||_0x345950['data']?.[_0x157e49(0x1db)]||_0x345950[_0x157e49(0x14c)]||_0x345950[_0x157e49(0x1d9)]||'';return _0x345950['errorCode']===_0x157e49(0x1cf)||_0x345950[_0x157e49(0x193)]===0x191||_0x345950[_0x157e49(0x193)]===_0x157e49(0x1f9)||_0x587559['includes'](_0x157e49(0x1f9))||_0x587559['includes']('Unauthorized')||_0x587559['includes']('登录')||_0x587559[_0x157e49(0x16d)]('认证');}export async function platformFetch(_0x94d6f6,_0x584a1e){const _0xca14ca=a185_0x163b;let _0x123575;try{_0x123575=await fetch(_0x94d6f6,{'method':_0x584a1e[_0xca14ca(0x188)]??_0xca14ca(0x18d),'headers':{'Content-Type':_0xca14ca(0x196),'Cookie':_0x584a1e[_0xca14ca(0x153)],'X-Invoke-Source':'cli:rabetbase'},..._0x584a1e[_0xca14ca(0x1b1)]&&{'body':JSON[_0xca14ca(0x187)](_0x584a1e['body'])}});}catch(_0xce7993){throw createFetchFailureError(_0x94d6f6,_0xce7993);}if(!_0x123575['ok']){if(_0x123575[_0xca14ca(0x167)]===0x191)throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x156)+_0x123575[_0xca14ca(0x167)]);}const _0x276a11=await _0x123575[_0xca14ca(0x14f)]();if(_0x276a11['success']===![]){if(isAuthFailure(_0x276a11))throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x276a11[_0xca14ca(0x17f)]||_0x276a11[_0xca14ca(0x1db)]||_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x128));}return _0x276a11['data'];}export async function platformRequest(_0x56138e,_0x5e4235){const _0x518f2a=a185_0x163b;if(/^https?:\/\//i[_0x518f2a(0x13a)](_0x56138e))throw CliErrors[_0x518f2a(0x1aa)](_0x518f2a(0x150)+_0x56138e,_0x518f2a(0x1f6));const _0x5d8c76=_0x56138e[_0x518f2a(0x1be)]('/')?_0x56138e:'/'+_0x56138e;return platformFetch(''+getApiDomain()+_0x5d8c76,_0x5e4235);}function cleanNewlines(_0x15bb60){const _0x574efd=a185_0x163b;return _0x15bb60[_0x574efd(0x1c2)](/[\r\n]+/g,'\x20')[_0x574efd(0x1ac)]();}function cleanDatasetName(_0x44e195){const _0x1ec60b=a185_0x163b;if(!_0x44e195['name'])return _0x44e195;return{..._0x44e195,'name':cleanNewlines(_0x44e195[_0x1ec60b(0x1b5)])};}export async function fetchModelList(_0x249ceb,_0x22988e){const _0x49c354=a185_0x163b,_0x5e1119=getEnv(),_0x1af3aa=new URLSearchParams({'appcode':_0x249ceb,'otype':'array'}),_0x1f9da7='/api/node-toolbox/dataset/model-list?'+_0x1af3aa[_0x49c354(0x1e5)]();logger[_0x49c354(0x1f0)](_0x49c354(0x175),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x5e1119+')',{'apiPath':_0x1f9da7});const _0x3dc0f8=await platformRequest(_0x1f9da7,{'cookie':_0x22988e,'label':_0x49c354(0x1a7)}),_0x5b02f5=(_0x3dc0f8[_0x49c354(0x1f5)]??[])[_0x49c354(0x1d0)](cleanDatasetName);return{'configArray':_0x5b02f5,'count':_0x5b02f5[_0x49c354(0x1d5)]};}export async function fetchDatasetDoc(_0x168ec1){const _0x305b69=a185_0x163b,{appCode:_0xc345b9,cookie:_0x3218b8,datasetCode:_0x4f2478,datasetId:_0x42cf64,extraParams:_0x25fc3b}=_0x168ec1,_0x2e5511=await platformRequest(_0x305b69(0x194),{'method':_0x305b69(0x158),'body':{'appCode':_0xc345b9,'datasetCode':_0x4f2478,'datasetId':_0x42cf64,..._0x25fc3b||{}},'cookie':_0x3218b8,'label':_0x305b69(0x164)+_0x4f2478+')'});if(!_0x2e5511||typeof _0x2e5511[_0x305b69(0x1ae)]!==_0x305b69(0x1b0))throw new Error(_0x305b69(0x12d)+_0x4f2478+_0x305b69(0x13e));return _0x2e5511['markdown'];}export async function getMenuTree(_0x2c0706,_0x24e2b8){const _0x512312=a185_0x163b,_0x198ff5=new URLSearchParams({'appCode':_0x2c0706});return platformRequest(_0x512312(0x186)+_0x198ff5[_0x512312(0x1e5)](),{'cookie':_0x24e2b8,'label':_0x512312(0x1c8)});}export async function createMenuRecord(_0x369898,_0x1d89be,_0x66a067){const _0x54b8e6=a185_0x163b;return platformRequest(_0x54b8e6(0x1dd),{'method':_0x54b8e6(0x158),'body':_0x369898,'cookie':_0x1d89be,'label':_0x66a067});}export async function updateMenuRecord(_0x50a422,_0x162aa9,_0x5266ca){return platformRequest('/smartapi/menu/update',{'method':'POST','body':_0x50a422,'cookie':_0x162aa9,'label':_0x5266ca});}export async function listBffScripts(_0x36214a,_0x1e9ff5,_0x37520a){const _0x98fbe5=a185_0x163b;let _0x240dc8=_0x98fbe5(0x19f)+_0x36214a;if(_0x1e9ff5)_0x240dc8+='&type='+_0x1e9ff5;const _0x2cdbf0=await apiRequest(_0x240dc8);let _0x144291=extractList(_0x2cdbf0[_0x98fbe5(0x208)]);if(_0x37520a?.['scriptName']){const _0x2da6d8=_0x37520a[_0x98fbe5(0x203)]['toLowerCase']();_0x144291=_0x144291[_0x98fbe5(0x190)](_0x39696d=>_0x39696d[_0x98fbe5(0x16e)]?.[_0x98fbe5(0x1a8)]()[_0x98fbe5(0x16d)](_0x2da6d8)||_0x39696d['description']?.[_0x98fbe5(0x1a8)]()['includes'](_0x2da6d8));}return _0x144291;}export async function getBffScriptInfo(_0x1e919b){const _0x2a3930=a185_0x163b,_0x5a43de=await apiRequest('/api/management/library/scripts/info?id='+_0x1e919b);if(!_0x5a43de[_0x2a3930(0x208)])throw CliErrors[_0x2a3930(0x1aa)]('BFF\x20script\x20not\x20found:\x20id='+_0x1e919b);return _0x5a43de[_0x2a3930(0x208)];}export async function saveBffScript(_0x2787ad){const _0x41b304=a185_0x163b,_0x58cce4=await apiRequest(_0x41b304(0x12f),{'method':'POST','body':_0x2787ad}),{id:_0x4d80d8,entity:_0x3ad8cd}=normalizeEntityWithIdResponse(_0x58cce4[_0x41b304(0x208)]);if(_0x4d80d8!==undefined){const _0x2806ae=typeof _0x3ad8cd['functionName']===_0x41b304(0x1b0)||typeof _0x3ad8cd[_0x41b304(0x161)]===_0x41b304(0x1b0)?_0x3ad8cd:undefined;return{'id':_0x4d80d8,'script':_0x2806ae};}throw CliErrors['apiError'](_0x41b304(0x148));}export async function deleteBffScript(_0x3e0e32){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x3e0e32}});}export async function getBffScriptStatistics(_0x225170){const _0x54e38d=a185_0x163b,_0x4bf7bf=await apiRequest(_0x54e38d(0x18b)+_0x225170);return extractList(_0x4bf7bf['data']);}export async function clearBffScriptCache(){const _0x402ca7=a185_0x163b,_0x37b275=await apiRequest(_0x402ca7(0x19e),{'method':'POST','useRuntime':!![]});return typeof _0x37b275[_0x402ca7(0x208)]===_0x402ca7(0x1b0)?_0x37b275[_0x402ca7(0x208)]:'';}export async function listBffDatasetOperations(_0x1054f1,_0x8a232b){const _0x3d9496=a185_0x163b,_0xb3e3a3=await apiRequest(_0x3d9496(0x12b),{'method':_0x3d9496(0x158),'body':{'appCode':_0x1054f1,'datasetId':_0x8a232b}});return _0xb3e3a3[_0x3d9496(0x208)];}export async function listSqlQueries(_0x317e5f,_0x30d65f){const _0x3b9f3c=a185_0x163b,_0x4281fc=await apiRequest(_0x3b9f3c(0x192),{'method':_0x3b9f3c(0x158),'body':{'appCode':_0x317e5f,'currentPage':_0x30d65f?.[_0x3b9f3c(0x1e3)]??0x1,'pageSize':_0x30d65f?.['pageSize']??0x32,'sqlCode':_0x30d65f?.[_0x3b9f3c(0x1a4)],'sqlName':_0x30d65f?.[_0x3b9f3c(0x1e9)]}});return _0x4281fc['data'];}export async function getSqlQueryInfo(_0x1b9382,_0x1d5fdf){const _0x51e43d=a185_0x163b,_0x11fcb5=await listSqlQueries(_0x1b9382,{'sqlCode':_0x1d5fdf}),_0x2619cb=_0x11fcb5[_0x51e43d(0x146)]?.[0x0];if(!_0x2619cb)throw CliErrors[_0x51e43d(0x1aa)](_0x51e43d(0x147)+_0x1d5fdf);return _0x2619cb;}export async function getSqlQueryDetail(_0x18912a){const _0x2e86d7=a185_0x163b,_0x578db5=await apiRequest(_0x2e86d7(0x183)+(_0x2e86d7(0x1d4)+encodeURIComponent(_0x18912a)));if(!_0x578db5[_0x2e86d7(0x208)])throw CliErrors['validation'](_0x2e86d7(0x147)+_0x18912a);return _0x578db5[_0x2e86d7(0x208)];}export async function getSqlQueryDetailById(_0x261e7c){const _0x29feb5=a185_0x163b,_0x2d224a=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x261e7c);if(!_0x2d224a['data'])throw CliErrors[_0x29feb5(0x1aa)]('SQL\x20query\x20not\x20found:\x20id='+_0x261e7c);return _0x2d224a['data'];}export async function createSqlQuery(_0x521290){const _0x3a31f6=a185_0x163b,_0x358fbe=await apiRequest(_0x3a31f6(0x15f),{'method':'POST','body':_0x521290}),{id:_0x366f73,entity:_0x1c5921}=normalizeEntityWithIdResponse(_0x358fbe['data']);if(!(_0x3a31f6(0x1a4)in _0x1c5921)&&_0x366f73)return getSqlQueryDetailById(_0x366f73);return normalizeSqlQueryEntity(_0x1c5921);}export async function updateSqlQuery(_0x5cd4e7){const _0x43e222=a185_0x163b,_0x2ac89e=await apiRequest(_0x43e222(0x144),{'method':_0x43e222(0x158),'body':_0x5cd4e7}),{id:_0x11bce8,entity:_0x4aee80}=normalizeEntityWithIdResponse(_0x2ac89e[_0x43e222(0x208)]);if(!(_0x43e222(0x1a4)in _0x4aee80)){if(_0x5cd4e7[_0x43e222(0x1a4)])return getSqlQueryDetail(_0x5cd4e7['sqlCode']);if(_0x11bce8)return getSqlQueryDetailById(_0x11bce8);}return normalizeSqlQueryEntity(_0x4aee80);}export async function deleteSqlQuery(_0x124283){const _0x657ebb=a185_0x163b;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x657ebb(0x158),'body':_0x124283});}function a185_0x163b(_0x40b67a,_0xdd4c5f){_0x40b67a=_0x40b67a-0x126;const _0x1e9e38=a185_0x1e9e();let _0x163ba4=_0x1e9e38[_0x40b67a];return _0x163ba4;}export async function saveSqlQuery(_0x1e246b){const _0x44cc88=a185_0x163b,_0xd4140b=await apiRequest(_0x44cc88(0x1a5),{'method':_0x44cc88(0x158),'body':_0x1e246b});return _0xd4140b[_0x44cc88(0x208)];}function normalizeSqlQueryEntity(_0x1178b2){const _0x249f92=a185_0x163b;return{..._0x1178b2,'id':Number(_0x1178b2['id']),'dbId':_0x1178b2[_0x249f92(0x15d)]==null?undefined:Number(_0x1178b2[_0x249f92(0x15d)]),'version':_0x1178b2[_0x249f92(0x19a)]==null?undefined:Number(_0x1178b2[_0x249f92(0x19a)])};}export async function executeSql(_0x6cadd6,_0x548030,_0x26b14a){const _0x15388f=a185_0x163b,_0x3e98e8=await apiRequest(_0x15388f(0x1d6),{'method':_0x15388f(0x158),'body':{'appCode':_0x6cadd6,'sqlCode':_0x548030,..._0x26b14a&&{'params':_0x26b14a}},'useRuntime':!![]});return _0x3e98e8['data'];}export async function executeDatasetDataOperation(_0x2e0e9a,_0x286587,_0x31a140,_0x1cc752={}){const _0x11f47d=a185_0x163b;try{const _0x1329c0=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+'/'+_0x31a140,{'method':_0x11f47d(0x158),'body':_0x1cc752,'useRuntime':!![]});return _0x1329c0['data'];}catch(_0x481d4d){if(_0x31a140===_0x11f47d(0x1da)&&_0x481d4d instanceof CliError&&_0x481d4d[_0x11f47d(0x193)]==='api_error'&&_0x1cc752['id']!==undefined&&_0x1cc752['id']!==null&&_0x1cc752['id']!==''){const _0x2c7b6a=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+_0x11f47d(0x1c9),{'method':_0x11f47d(0x158),'body':{'where':{'id':{'$eq':_0x1cc752['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x54a9b7=Array['isArray'](_0x2c7b6a['data']?.['tableData'])?_0x2c7b6a[_0x11f47d(0x208)][_0x11f47d(0x146)]:[];return _0x54a9b7[0x0]??null;}throw _0x481d4d;}}export async function listDatasets(_0x5dff09,_0x48abf5){const _0x585f56=a185_0x163b,_0x5a463a={'appCode':_0x5dff09,'deleted':_0x48abf5?.[_0x585f56(0x16c)]??![]};if(_0x48abf5?.[_0x585f56(0x193)])_0x5a463a['code']=_0x48abf5[_0x585f56(0x193)];if(_0x48abf5?.['name'])_0x5a463a[_0x585f56(0x1b5)]=_0x48abf5[_0x585f56(0x1b5)];const _0x364123=await apiRequest(_0x585f56(0x1f8),{'method':_0x585f56(0x158),'body':_0x5a463a});return extractList(_0x364123[_0x585f56(0x208)]);}export async function deleteDataset(_0x35b8e3,_0x3f2a51){const _0x4cc886=a185_0x163b;await apiRequest(_0x4cc886(0x1c6),{'method':'POST','body':{'appCode':_0x35b8e3,'datasetId':_0x3f2a51}});}export async function restoreDataset(_0x4a56ab,_0x2fece4){const _0x4278d2=a185_0x163b;await apiRequest(_0x4278d2(0x1e4),{'method':_0x4278d2(0x158),'body':{'appCode':_0x4a56ab,'datasetId':_0x2fece4}});}export async function previewTextGeneratedDataset(_0x1a0b81,_0x353206){const _0x4d8db1=a185_0x163b,_0x4dc941=await apiRequest(_0x4d8db1(0x16a),{'method':_0x4d8db1(0x158),'body':{'appCode':_0x1a0b81,'datasetName':_0x353206[_0x4d8db1(0x1f2)],'requirementDescription':_0x353206['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4dc941['data'];}export async function startTextGeneratedDataset(_0x152006,_0x60a48d,_0x614d0c){const _0x105054=a185_0x163b,_0x572d10=await apiRequest(_0x105054(0x1ed),{'method':_0x105054(0x158),'body':{'appCode':_0x152006,..._0x614d0c?.[_0x105054(0x1b4)]?{'clientOperationId':_0x614d0c['clientOperationId']}:{},'design':_0x60a48d},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x572d10[_0x105054(0x208)];}export async function getTextGeneratedDatasetStatus(_0x13a508,_0x140776){const _0xc58936=a185_0x163b,_0xcacd56=new URLSearchParams({'appCode':_0x13a508});_0x140776[_0xc58936(0x1fb)]&&_0xcacd56[_0xc58936(0x197)]('operationId',_0x140776[_0xc58936(0x1fb)]);_0x140776[_0xc58936(0x1b4)]&&_0xcacd56[_0xc58936(0x197)](_0xc58936(0x1b4),_0x140776[_0xc58936(0x1b4)]);const _0xe343ec=await apiRequest(_0xc58936(0x20a)+_0xcacd56[_0xc58936(0x1e5)]());return _0xe343ec[_0xc58936(0x208)];}export async function searchDatasets(_0x521985,_0x4d8e00){const _0x5e6c15=a185_0x163b,_0x65a2e0=await listDatasets(_0x521985,{'name':_0x4d8e00}),_0x50688b=_0x4d8e00['toLowerCase'](),_0x56bfed=new Set(_0x65a2e0[_0x5e6c15(0x1d0)](_0x23b15e=>_0x23b15e['id'])),_0x40b18b=_0x65a2e0['filter'](_0x5c9483=>_0x5c9483['dbtableConfig']?.[_0x5e6c15(0x165)]?.['toLowerCase']()['includes'](_0x50688b)||_0x5c9483[_0x5e6c15(0x1a6)]?.[_0x5e6c15(0x1a8)]()[_0x5e6c15(0x16d)](_0x50688b)),_0x39329e=await listDatasets(_0x521985,{'code':_0x4d8e00});for(const _0x522faa of _0x39329e){!_0x56bfed['has'](_0x522faa['id'])&&(_0x65a2e0[_0x5e6c15(0x17d)](_0x522faa),_0x56bfed[_0x5e6c15(0x181)](_0x522faa['id']));}return _0x65a2e0;}export function normalizeDatasetOperations(_0x3e97d4){const _0x2f4660=a185_0x163b;if(Array[_0x2f4660(0x189)](_0x3e97d4))return _0x3e97d4['filter'](_0x172a78=>_0x172a78!=null&&typeof _0x172a78===_0x2f4660(0x182));if(_0x3e97d4&&typeof _0x3e97d4===_0x2f4660(0x182))return Object[_0x2f4660(0x12e)](_0x3e97d4)[_0x2f4660(0x190)](([,_0x58e0db])=>_0x58e0db!=null&&typeof _0x58e0db===_0x2f4660(0x182))['map'](([_0x5aec1f,_0x4a9c9])=>({..._0x4a9c9,'name':_0x4a9c9[_0x2f4660(0x1b5)]??_0x4a9c9[_0x2f4660(0x180)]??_0x5aec1f}));return[];}export async function getDatasetDetail(_0x434e7b){const _0x1ae7ae=a185_0x163b,_0x4ea690=/^\d+$/[_0x1ae7ae(0x13a)](_0x434e7b)?'id':_0x1ae7ae(0x193),_0x241cdb=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x4ea690+'='+_0x434e7b);return _0x241cdb['data'];}function a185_0x1e9e(){const _0x26b779=['label','/smartapi/question/er-config/business-group/edit','apiError','API\x20error:\x20','15148HBmWAq','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','fetch-model-list','10lyQekw','create','ER\x20relation\x20does\x20not\x20exist','errorCode','/smartapi/db-analysis/jobs/cancel','.getOne(id);','authRequired','push','Operation\x20\x22','errorMsg','operationName','add','object','/smartapi/custom/getUserCustomSql','/smartapi/question/er-config/cli/update-single','/smartapi/question/er-config/cli/delete-single','/smartapi/menu/find?','stringify','method','isArray','/smartapi/dblink/testConnect','/api/management/library/scripts/statistics?appCode=','/smartapi/permit/resource/get-menu-list','GET','longTerm','avatar','filter','modelCode','/smartapi/custom/queryUserCustomSqlList','code','/api/node-toolbox/api-doc-generator','ENABLE','application/json','set','userTenantRelationList','const\x20results\x20=\x20data.execResult\x20||\x20[];','version','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','email','warn','/api/management/script/cache/clear','/api/management/library/scripts/list?appCode=','enabled','CUSTOM','AbortError','min','sqlCode','/api/node-toolbox/sql/save','description','Fetch\x20datasets','toLowerCase','remark','validation','/smartapi/lovrabet/detail?pageId=','trim','5904CQBieP','markdown','19016436rPBRmp','string','body','update','table','clientOperationId','name','tags','pageSize','join','.create({\x20/*\x20fields\x20*/\x20});','value','/userTenant/getByTenantCode','/smartapi/permit/user-role/get-user-list','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','startsWith','/smartapi/permit/role/delete','/smartapi/app-config/getByKey','/smartapi/lovrabet/dataset/','replace','list','/smartapi/app-config/update','830353OlFxYs','/smartapi/dataset/delete-dataset','remove','Fetch\x20menu\x20list','/filter','isFinite','\x20\x20currentPage:\x201,','/smartapi/dataset/update-driven-data','/smartapi/app-config/delete','95540jvxdoW','UNAUTHORIZED','map','//\x20SQL:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','hint','?sqlCode=','length','/api/custom/executeSql','totalCount','success','error','getOne','message','summary','/smartapi/menu/create','/notification/channel-config/list','/smartapi/permit/role/get-permit-list','abort','Request\x20failed:\x20','file','currentPage','/smartapi/dataset/restore-dataset','toString','type','nickname','7150IBpdfG','sqlName','dataset_','cli:rabetbase','\x20\x20where:\x20{},','/smartapi/dataset/text-generate/start','/smartapi/db-analysis/status/','/smartapi/question/er-config/cli/detail?','info','modelId','datasetName','2ONWsEb','needPublic','configArray','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','\x20of\x20','/smartapi/dataset/get-dataset-list','401','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','operationId','//\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/update','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','includeImports','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','username','scriptName','856QNIquV','/smartapi/dblink/getList','57LNLusU','requestFields','data','tableList','/smartapi/dataset/text-generate/status?','/smartapi/permit/role/update','key','\x20failed','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','dbtableConfig','/smartapi/dataset/get-dataset-operation','physicalTableCount','Invalid\x20response\x20format\x20(','entries','/api/management/library/scripts/save','/smartapi/app-config/create','sdk','.remove(id);','appCode','/smartapi/common/queryFileUrl','Dataset\x20not\x20found:\x20','DATA_NOT_EXIST','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','363174fqxflj','const\x20result\x20=\x20await\x20client.models.','test','needSelf','datasetTableCount','Check\x20network\x20connectivity\x20and\x20try\x20again.','):\x20missing\x20data.markdown\x20field','relation','\x20\x20sqlCode:\x20\x27','API\x20error\x20code:\x20','\x20apps.\x20','roleType','/smartapi/custom/updateUserCustomSql','.filter({','tableData','SQL\x20query\x20not\x20found:\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','/api/','/smartapi/question/er-config','/smartapi/permit/resource/get-api-list','errorMessage','/standard-page-status?appCode=','operations','json','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','permits','Page\x20not\x20found:\x20','cookie','\x20\x20});','\x20\x20return\x20rows;','\x20failed,\x20HTTP\x20','roleName','POST','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','userId','/smartapi/app/getList','/smartapi/dblink/delete','dbId','4069813WeMLVP','/smartapi/custom/saveUserCustomSql','(/*\x20params\x20*/);','scriptType','/generate-standard-pages/start','mobile','Fetch\x20doc\x20(','tableName','\x20\x20\x20\x20sqlCode:\x20\x27','status','signal','Request\x20timeout:\x20','/smartapi/dataset/text-generate/preview','/smartapi/lovrabet/update-page','deleted','includes','functionName'];a185_0x1e9e=function(){return _0x26b779;};return a185_0x1e9e();}export async function updateDrivenData(_0x18a21a){const _0x1cc4b7=a185_0x163b,_0x1ef8c6=await apiRequest(_0x1cc4b7(0x1cc),{'method':_0x1cc4b7(0x158),'body':_0x18a21a});return _0x1ef8c6['data'];}export async function getDatasetOperations(_0x3cf590){const _0x1133ed=a185_0x163b,_0x614f9a=await getDatasetDetail(_0x3cf590),_0x1524ce=normalizeDatasetOperations(_0x614f9a[_0x1133ed(0x14e)])[_0x1133ed(0x1d0)](_0xa105c6=>({'name':_0xa105c6['name']||_0xa105c6['operationName'],'displayName':_0xa105c6['displayName']||_0xa105c6[_0x1133ed(0x1b5)],'type':_0xa105c6[_0x1133ed(0x1e6)],'method':_0xa105c6[_0x1133ed(0x188)],'path':_0xa105c6['path'],'enabled':_0xa105c6[_0x1133ed(0x1a0)]??!![],'requestFields':_0xa105c6[_0x1133ed(0x207)],'responseFields':_0xa105c6['responseFields']}));return{'dataset':{'id':_0x614f9a['id']??_0x614f9a[_0x1133ed(0x1f1)],'name':_0x614f9a['name'],'code':_0x614f9a[_0x1133ed(0x193)]||_0x614f9a[_0x1133ed(0x191)],'tableName':_0x614f9a[_0x1133ed(0x165)]||_0x614f9a[_0x1133ed(0x12a)]?.[_0x1133ed(0x165)]},'operations':_0x1524ce};}export async function getOperationDetail(_0x549cc1,_0x3b2305,_0x1a80ab){const _0x495265=a185_0x163b;let _0x404ca0=_0x3b2305;if(!/^\d+$/['test'](_0x3b2305)){const _0x118d9d=await listDatasets(_0x549cc1,{'code':_0x3b2305}),_0x115ebd=_0x118d9d['find'](_0x1b2c1c=>_0x1b2c1c[_0x495265(0x193)]===_0x3b2305||String(_0x1b2c1c['id'])===_0x3b2305);if(!_0x115ebd)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x135)+_0x3b2305);_0x404ca0=String(_0x115ebd['id']);}const _0x47b61d=await getDatasetDetail(_0x404ca0),_0x4e2a42=normalizeDatasetOperations(_0x47b61d[_0x495265(0x14e)])['find'](_0x16bd4e=>(_0x16bd4e[_0x495265(0x1b5)]||_0x16bd4e[_0x495265(0x180)])===_0x1a80ab);if(!_0x4e2a42)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x17e)+_0x1a80ab+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x3b2305);return{'dataset':{'id':_0x47b61d['id']??_0x47b61d['modelId'],'name':_0x47b61d[_0x495265(0x1b5)],'code':_0x47b61d[_0x495265(0x193)]||_0x47b61d[_0x495265(0x191)],'tableName':_0x47b61d['tableName']||_0x47b61d['dbtableConfig']?.['tableName']},'operation':_0x4e2a42};}export async function startGenerateStandardPages(_0x691121,_0x57af6d,_0x521357){const _0x454e05=a185_0x163b,_0x940f62=await apiRequest(_0x454e05(0x1c1)+_0x57af6d+_0x454e05(0x162),{'method':_0x454e05(0x158),'body':{'appCode':_0x691121,..._0x521357?.['clientOperationId']?{'clientOperationId':_0x521357['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x940f62[_0x454e05(0x208)];}export async function getGenerateStandardPagesStatus(_0x4d172e,_0x5d41d8,_0x52e891){const _0x18c02d=a185_0x163b,_0x1423f1=new URLSearchParams({'appCode':_0x4d172e});_0x52e891[_0x18c02d(0x1fb)]&&_0x1423f1[_0x18c02d(0x197)]('operationId',_0x52e891['operationId']);_0x52e891['clientOperationId']&&_0x1423f1[_0x18c02d(0x197)]('clientOperationId',_0x52e891[_0x18c02d(0x1b4)]);const _0x2e2c5f=await apiRequest(_0x18c02d(0x1c1)+_0x5d41d8+'/generate-standard-pages/status?'+_0x1423f1[_0x18c02d(0x1e5)]());return _0x2e2c5f['data'];}export async function getStandardPageStatus(_0x23b7c0,_0xd4ff26){const _0x1bef78=a185_0x163b,_0x2af3d0=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd4ff26+_0x1bef78(0x14d)+encodeURIComponent(_0x23b7c0));return _0x2af3d0[_0x1bef78(0x208)];}export async function tryGetStandardPageStatus(_0x383167,_0x154c7c){const _0x26e2cb=a185_0x163b;try{return await getStandardPageStatus(_0x383167,_0x154c7c);}catch(_0x286ad7){if(_0x286ad7 instanceof CliError&&_0x286ad7[_0x26e2cb(0x193)]==='api_error'&&/404|not found|non-json response/i[_0x26e2cb(0x13a)](_0x286ad7[_0x26e2cb(0x1db)]))return null;throw _0x286ad7;}}export async function syncStandardPages(_0x3aad2b,_0x15bba6){const _0x1f4a87=a185_0x163b,_0x9bc83d=await apiRequest('/smartapi/lovrabet/dataset/'+_0x15bba6+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x3aad2b}});return _0x9bc83d[_0x1f4a87(0x208)];}export async function getPageDetail(_0x1428f1){const _0x42f686=a185_0x163b,_0x20a647=await apiRequest(_0x42f686(0x1ab)+_0x1428f1);if(!_0x20a647[_0x42f686(0x208)])throw CliErrors[_0x42f686(0x1aa)](_0x42f686(0x152)+_0x1428f1);return _0x20a647['data'];}export async function updatePage(_0x14f7e3,_0x553edf,_0x4de5b3,_0x40c803){const _0x11d9e5=a185_0x163b,_0x3cf66f=await apiRequest(_0x11d9e5(0x16b),{'method':'POST','body':{'appCode':_0x14f7e3,'pageId':_0x553edf,'code':_0x4de5b3,'datasetIds':_0x40c803}});return _0x3cf66f['data'];}export function generateSdkCode(_0x3fe3ae,_0x37d290,_0x44a1a4){const _0x191757=a185_0x163b,_0x186060=_0x44a1a4?.['includeImports']??!![],_0x2a28bd=_0x191757(0x1ea)+_0x3fe3ae[_0x191757(0x193)]?.[_0x191757(0x1c2)](/-/g,'_'),_0x134057=_0x37d290['name']||_0x37d290[_0x191757(0x180)]||_0x191757(0x190),_0x31a521=[];_0x186060&&_0x31a521[_0x191757(0x17d)](_0x191757(0x1d2),'',_0x191757(0x1ff),'');_0x31a521[_0x191757(0x17d)](_0x191757(0x1fc)+_0x3fe3ae[_0x191757(0x1b5)]+'\x20('+(_0x3fe3ae['tableName']||_0x191757(0x1b3))+')');if(_0x134057===_0x191757(0x190))_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x145),_0x191757(0x1ec),'\x20\x20pageSize:\x2020,',_0x191757(0x1cb),'});');else{if(_0x134057==='getOne')_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x17b));else{if(_0x134057===_0x191757(0x177))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x1b9));else{if(_0x134057===_0x191757(0x1b2))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x201));else _0x134057==='delete'||_0x134057===_0x191757(0x1c7)?_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x132)):_0x31a521[_0x191757(0x17d)](_0x191757(0x139)+_0x2a28bd+'.'+_0x134057+_0x191757(0x160));}}}return _0x31a521[_0x191757(0x1b8)]('\x0a');}export function generateSqlCodeTemplate(_0x1da46d,_0x5a9849){const _0x219715=a185_0x163b,_0x264e22=_0x5a9849?.['target']??_0x219715(0x131),_0x4c24ab=_0x5a9849?.[_0x219715(0x200)]??!![],_0x3d7c19=[];return _0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d1)+_0x1da46d[_0x219715(0x1e9)]+'\x20('+_0x1da46d[_0x219715(0x1a4)]+')'),_0x264e22===_0x219715(0x131)?(_0x4c24ab&&_0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d2),'',_0x219715(0x1ff),''),_0x3d7c19[_0x219715(0x17d)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x219715(0x140)+_0x1da46d['sqlCode']+'\x27,',_0x219715(0x129),'});',_0x219715(0x159),_0x219715(0x199))):_0x3d7c19[_0x219715(0x17d)](_0x219715(0x174),_0x219715(0x19b),_0x219715(0x1fa),_0x219715(0x166)+_0x1da46d[_0x219715(0x1a4)]+'\x27,',_0x219715(0x1fd),_0x219715(0x154),_0x219715(0x155),'}'),_0x3d7c19[_0x219715(0x1b8)]('\x0a');}export async function getErConfig(_0x1b16dc,_0xbbf09e){const _0x2244af=a185_0x163b,_0x298fae=await apiRequest(_0x2244af(0x14a),{'method':_0x2244af(0x158),'body':{'appCode':_0x1b16dc,'dblinkId':_0xbbf09e},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x298fae[_0x2244af(0x208)];}export async function getErRelationDetail(_0x308428,_0x12e9d4){const _0x2b8958=a185_0x163b,_0x2e04c1=new URLSearchParams({'appCode':_0x308428,'relationId':String(_0x12e9d4)});try{const _0xea7fbb=await apiRequest(_0x2b8958(0x1ef)+_0x2e04c1[_0x2b8958(0x1e5)]());return _0xea7fbb[_0x2b8958(0x208)]?.[_0x2b8958(0x13f)]??null;}catch(_0xbb912){if(_0xbb912 instanceof CliError&&_0xbb912[_0x2b8958(0x193)]==='api_error'&&(_0xbb912[_0x2b8958(0x1d3)]?.['includes'](_0x2b8958(0x136))||_0xbb912[_0x2b8958(0x1d3)]==='API\x20error\x20code:\x20306'&&_0xbb912[_0x2b8958(0x1db)]===_0x2b8958(0x178)))return null;throw _0xbb912;}}export async function createErRelation(_0x462772){const _0x3d3354=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':'POST','body':_0x462772,'allowNonJsonSuccess':!![]});return _0x3d3354['data'];}export async function updateErRelation(_0x3025ca){const _0xd3c203=a185_0x163b,_0x3abd3f=await apiRequest(_0xd3c203(0x184),{'method':_0xd3c203(0x158),'body':_0x3025ca,'allowNonJsonSuccess':!![]});return _0x3abd3f[_0xd3c203(0x208)];}export async function deleteErRelation(_0x29a8e9){const _0xb85b54=a185_0x163b,_0x3abbe1=await apiRequest(_0xb85b54(0x185),{'method':_0xb85b54(0x158),'body':_0x29a8e9,'allowNonJsonSuccess':!![]});return _0x3abbe1[_0xb85b54(0x208)];}export async function updateErBusinessGroup(_0x13fe38){const _0xc2a04=a185_0x163b,_0x13ac86=await apiRequest(_0xc2a04(0x170),{'method':'POST','body':_0x13fe38,'allowNonJsonSuccess':!![]});return _0x13ac86[_0xc2a04(0x208)];}function buildQuery(_0x4af873){const _0x510377=a185_0x163b,_0x2846f4=new URLSearchParams();for(const [_0x2b9ff0,_0x486b88]of Object[_0x510377(0x12e)](_0x4af873)){if(_0x486b88===undefined||_0x486b88==='')continue;_0x2846f4['set'](_0x2b9ff0,String(_0x486b88));}const _0x3ee393=_0x2846f4[_0x510377(0x1e5)]();return _0x3ee393?'?'+_0x3ee393:'';}export async function listNotificationChannelConfigs(_0x2ff84c,_0x5f3522){const _0x1933d2=a185_0x163b,_0x53bb53=await apiRequest(_0x1933d2(0x1de)+buildQuery({'appCode':_0x2ff84c,'channelType':_0x5f3522}));return Array[_0x1933d2(0x189)](_0x53bb53[_0x1933d2(0x208)])?_0x53bb53['data']:[];}export async function listAppConfigs(_0xf4cec6,_0x1ecdfb){const _0x18ea54=a185_0x163b,_0xf76945=await apiRequest('/smartapi/app-config/list',{'method':_0x18ea54(0x158),'body':{'appCode':_0xf4cec6,..._0x1ecdfb?.[_0x18ea54(0x127)]?{'key':_0x1ecdfb[_0x18ea54(0x127)]}:{},..._0x1ecdfb?.[_0x18ea54(0x1b6)]?{'tags':_0x1ecdfb[_0x18ea54(0x1b6)]}:{}}});return extractAppConfigList(_0xf76945[_0x18ea54(0x208)]);}export async function getAppConfigByKey(_0xe675bd,_0x228010){const _0x162180=a185_0x163b,_0x147e5b=await apiRequest(_0x162180(0x1c0)+buildQuery({'appCode':_0xe675bd,'key':_0x228010}));return _0x147e5b[_0x162180(0x208)]??null;}export async function createAppConfig(_0x204dc3){const _0x3efd60=a185_0x163b,_0x54fa7a=await apiRequest(_0x3efd60(0x130),{'method':'POST','body':{'appCode':_0x204dc3[_0x3efd60(0x133)],'key':_0x204dc3[_0x3efd60(0x127)],'value':_0x204dc3['value'],..._0x204dc3[_0x3efd60(0x1b6)]?{'tags':_0x204dc3[_0x3efd60(0x1b6)]}:{}}});return _0x54fa7a[_0x3efd60(0x208)];}export async function updateAppConfig(_0x17b8d1){const _0x196ac0=a185_0x163b;await apiRequest(_0x196ac0(0x1c4),{'method':_0x196ac0(0x158),'body':{'id':_0x17b8d1['id'],'appCode':_0x17b8d1[_0x196ac0(0x133)],'key':_0x17b8d1[_0x196ac0(0x127)],'value':_0x17b8d1[_0x196ac0(0x1ba)],..._0x17b8d1[_0x196ac0(0x1b6)]?{'tags':_0x17b8d1[_0x196ac0(0x1b6)]}:{}}});}export async function deleteAppConfig(_0x2c0099){const _0x5e5bd9=a185_0x163b;await apiRequest(_0x5e5bd9(0x1cd),{'method':_0x5e5bd9(0x158),'body':_0x2c0099});}function extractAppConfigList(_0x2a08f6){const _0x45c16b=a185_0x163b;if(Array[_0x45c16b(0x189)](_0x2a08f6))return _0x2a08f6;if(_0x2a08f6&&typeof _0x2a08f6===_0x45c16b(0x182)&&Array['isArray'](_0x2a08f6[_0x45c16b(0x1c3)]))return _0x2a08f6[_0x45c16b(0x1c3)];return extractList(_0x2a08f6);}export async function listDbLinks(_0x51bed4,_0x53bbc9){const _0x30cdc=a185_0x163b,_0x1bc4d4=await apiRequest(_0x30cdc(0x205),{'method':'POST','body':{'appCode':_0x51bed4,'currentPage':_0x53bbc9?.[_0x30cdc(0x1e3)]??0x1,'pageSize':_0x53bbc9?.[_0x30cdc(0x1b7)]??0x64}});return{'items':extractList(_0x1bc4d4[_0x30cdc(0x208)]),'paging':extractPaging(_0x1bc4d4[_0x30cdc(0x208)])};}export async function getDbLinkInfo(_0x1d07c3){const _0x431820=a185_0x163b,_0x2383bd=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x1d07c3}));return _0x2383bd[_0x431820(0x208)];}export async function createDbLink(_0x5480d5){const _0x9d53d3=a185_0x163b,_0x3fede7=await apiRequest('/smartapi/dblink/create',{'method':_0x9d53d3(0x158),'body':_0x5480d5});return _0x3fede7[_0x9d53d3(0x208)];}export async function updateDbLink(_0x36c4a1){const _0x261f66=a185_0x163b,_0x162261=await apiRequest(_0x261f66(0x1fe),{'method':'POST','body':_0x36c4a1});return _0x162261[_0x261f66(0x208)];}export async function deleteDbLink(_0x4d01f5){const _0x421c6b=a185_0x163b;await apiRequest(_0x421c6b(0x15c),{'method':_0x421c6b(0x158),'body':{'id':_0x4d01f5}});}export async function testDbLinkConnect(_0x557958){const _0x1956f8=a185_0x163b,_0x2ef4dd=await apiRequest(_0x1956f8(0x18a)+buildQuery({'id':_0x557958}));return _0x2ef4dd[_0x1956f8(0x208)];}export async function startDbAnalysis(_0x4dbd5e,_0x313ece){const _0x5385fa=a185_0x163b,_0x1add33=await apiRequest('/smartapi/db-analysis/start',{'method':_0x5385fa(0x158),'body':{'dbLinkId':_0x4dbd5e,..._0x313ece&&_0x313ece[_0x5385fa(0x1d5)]>0x0?{'tableNames':_0x313ece}:{}}});return _0x1add33[_0x5385fa(0x208)];}export async function cancelDbAnalysis(_0x41bf77){const _0x492ff7=a185_0x163b;await apiRequest(_0x492ff7(0x17a)+buildQuery({'planId':_0x41bf77}),{'method':_0x492ff7(0x158)});}export async function getDbAnalysisStatus(_0x9d3d1d){const _0xd3cad7=a185_0x163b,_0x198ab7=await apiRequest(_0xd3cad7(0x1ee)+encodeURIComponent(_0x9d3d1d));return _0x198ab7[_0xd3cad7(0x208)];}export async function getDbAllTableList(_0x2ceec8,_0x18eae0){const _0x2f8d45=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x2ceec8,'dbLinkId':_0x18eae0})),_0x3ab394=_0x2f8d45['data'];if(Array['isArray'](_0x3ab394))return _0x3ab394;return extractList(_0x3ab394);}export async function getDbTableDiff(_0x2976dc,_0x3fd853,_0x5bed7c){const _0x3be7fe=a185_0x163b,_0x11389c=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x2976dc,'dbLinkId':_0x3fd853,'pageIndex':_0x5bed7c?.['pageIndex']??0x1,'pageSize':_0x5bed7c?.[_0x3be7fe(0x1b7)]??0x14,'tableName':_0x5bed7c?.['tableName']})),_0x4792e6=_0x11389c[_0x3be7fe(0x208)];return{'totalCount':_0x4792e6?.[_0x3be7fe(0x1d7)]??0x0,'physicalTableCount':_0x4792e6?.[_0x3be7fe(0x12c)]??0x0,'datasetTableCount':_0x4792e6?.[_0x3be7fe(0x13c)]??0x0,..._0x4792e6?.[_0x3be7fe(0x1dc)]?{'summary':_0x4792e6[_0x3be7fe(0x1dc)]}:{},'tableList':Array[_0x3be7fe(0x189)](_0x4792e6?.[_0x3be7fe(0x209)])?_0x4792e6['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x595f11=a185_0x163b,_0x229f8c=await apiRequest(_0x595f11(0x15b),{'method':_0x595f11(0x158),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x56b1b6=extractList(_0x229f8c[_0x595f11(0x208)]),_0x4e6a19=extractPaging(_0x229f8c[_0x595f11(0x208)]);return _0x4e6a19&&_0x4e6a19['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x595f11(0x19d)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x595f11(0x1f7)+_0x4e6a19[_0x595f11(0x1d7)]+_0x595f11(0x142)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x56b1b6;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x120e58,_0x100dcd){const _0x330aad=a185_0x163b,_0x1d4dfd=Math[_0x330aad(0x1a3)](Math['max'](_0x100dcd?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x27fb2e=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x330aad(0x158),'body':{'appCode':_0x120e58,'currentPage':_0x100dcd?.[_0x330aad(0x1e3)]??0x1,'pageSize':_0x1d4dfd}});return{'items':extractList(_0x27fb2e[_0x330aad(0x208)]),'paging':extractPaging(_0x27fb2e[_0x330aad(0x208)])};}export async function getAppRole(_0x67770){const _0x1a6ec4=a185_0x163b,_0x4edada=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x67770}));return _0x4edada[_0x1a6ec4(0x208)];}export async function createAppRole(_0x1bc6d1){const _0x56c1a9=a185_0x163b,_0x4333f0=await apiRequest('/smartapi/permit/role/create',{'method':_0x56c1a9(0x158),'body':{'appCode':_0x1bc6d1[_0x56c1a9(0x133)],'roleName':_0x1bc6d1[_0x56c1a9(0x157)],'roleType':_0x56c1a9(0x1a1),..._0x1bc6d1[_0x56c1a9(0x1a9)]?{'remark':_0x1bc6d1[_0x56c1a9(0x1a9)]}:{}}});return _0x4333f0['data'];}export async function updateAppRole(_0x39e6bc){const _0x33f61d=a185_0x163b,_0x2faf37=await apiRequest(_0x33f61d(0x126),{'method':_0x33f61d(0x158),'body':{'id':_0x39e6bc['id'],'appCode':_0x39e6bc[_0x33f61d(0x133)],..._0x39e6bc[_0x33f61d(0x143)]?{'roleType':_0x39e6bc['roleType']}:{},..._0x39e6bc[_0x33f61d(0x157)]!==undefined?{'roleName':_0x39e6bc['roleName']}:{},..._0x39e6bc['remark']!==undefined?{'remark':_0x39e6bc[_0x33f61d(0x1a9)]}:{},..._0x39e6bc[_0x33f61d(0x151)]?{'permits':_0x39e6bc['permits']}:{}}});return _0x2faf37[_0x33f61d(0x208)];}export async function deleteAppRole(_0x5edf84){const _0x20a15b=a185_0x163b;await apiRequest(_0x20a15b(0x1bf),{'method':'POST','body':{'id':_0x5edf84}});}export async function listPermitRoles(_0x198462,_0x129ddb){const _0x51ec6c=a185_0x163b,_0x162348=await apiRequest(_0x51ec6c(0x1df),{'method':_0x51ec6c(0x158),'body':{'appCode':_0x198462,..._0x129ddb?.[_0x51ec6c(0x13b)]!==undefined?{'needSelf':_0x129ddb[_0x51ec6c(0x13b)]}:{},..._0x129ddb?.[_0x51ec6c(0x1f4)]!==undefined?{'needPublic':_0x129ddb[_0x51ec6c(0x1f4)]}:{}}});return extractList(_0x162348[_0x51ec6c(0x208)]);}export async function getRoleMenuResources(_0xe5738b,_0x1d7923){const _0x144e5d=a185_0x163b,_0xde9890=await apiRequest(_0x144e5d(0x18c),{'method':_0x144e5d(0x158),'body':{'appCode':_0xe5738b,'roleId':_0x1d7923}});return extractList(_0xde9890[_0x144e5d(0x208)]);}export async function getRoleApiResources(_0x3808e9,_0x2ecda9){const _0x309b4f=a185_0x163b,_0x231f31=await apiRequest(_0x309b4f(0x14b),{'method':'POST','body':{'appCode':_0x3808e9,'roleId':_0x2ecda9}});return extractList(_0x231f31['data']);}export async function listRoleUsers(_0x2ec5e5){const _0x562d93=a185_0x163b,_0xf257b5=await apiRequest(_0x562d93(0x1bc),{'method':_0x562d93(0x158),'body':{'appCode':_0x2ec5e5}});return extractList(_0xf257b5[_0x562d93(0x208)]);}export async function updateRoleUsers(_0x5c1a11,_0x1e4ce5){const _0x5dfc00=a185_0x163b;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x5dfc00(0x158),'body':{'appCode':_0x5c1a11,'roleList':_0x1e4ce5}});}export async function getPagePermit(_0x4af800){const _0x42e471=a185_0x163b,_0x4111d9=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x4af800}));return _0x4111d9[_0x42e471(0x208)];}export async function savePagePermit(_0xb6af92){const _0x4f776b=a185_0x163b,_0xf768af=await apiRequest('/smartapi/permit/page/save',{'method':_0x4f776b(0x158),'body':_0xb6af92});return _0xf768af[_0x4f776b(0x208)];}export async function getTenantMembers(_0x284437){const _0x12b119=a185_0x163b,_0x3bda99=await apiRequest(_0x12b119(0x1bb)+buildQuery({'code':_0x284437})),_0x18e550=_0x3bda99['data']??{},_0x4fb3b9=Array[_0x12b119(0x189)](_0x18e550?.[_0x12b119(0x198)])?_0x18e550[_0x12b119(0x198)]:[];return _0x4fb3b9[_0x12b119(0x190)](_0x3745ed=>_0x3745ed?.[_0x12b119(0x167)]===_0x12b119(0x195)||_0x3745ed?.[_0x12b119(0x167)]===undefined)['map'](_0x172de9=>({'userId':Number(_0x172de9[_0x12b119(0x15a)]??_0x172de9['id']),'username':_0x172de9[_0x12b119(0x202)],'nickname':_0x172de9[_0x12b119(0x1e7)],'status':_0x172de9[_0x12b119(0x167)],'email':_0x172de9[_0x12b119(0x19c)],'mobile':_0x172de9[_0x12b119(0x163)],'avatar':_0x172de9[_0x12b119(0x18f)]}))[_0x12b119(0x190)](_0x26bb7d=>Number[_0x12b119(0x1ca)](_0x26bb7d['userId'])&&_0x26bb7d[_0x12b119(0x15a)]>0x0);}
1
+ (function(_0x27a909,_0x25bc3d){const _0x1213ad=a185_0x26a8,_0x2807dc=_0x27a909();while(!![]){try{const _0x4b80af=-parseInt(_0x1213ad(0xb9))/0x1*(parseInt(_0x1213ad(0x13c))/0x2)+-parseInt(_0x1213ad(0xcd))/0x3+-parseInt(_0x1213ad(0x144))/0x4+parseInt(_0x1213ad(0x112))/0x5+-parseInt(_0x1213ad(0xb3))/0x6*(parseInt(_0x1213ad(0xae))/0x7)+-parseInt(_0x1213ad(0xa4))/0x8*(-parseInt(_0x1213ad(0x8d))/0x9)+parseInt(_0x1213ad(0x122))/0xa;if(_0x4b80af===_0x25bc3d)break;else _0x2807dc['push'](_0x2807dc['shift']());}catch(_0x59bde3){_0x2807dc['push'](_0x2807dc['shift']());}}}(a185_0x13df,0x5ae6e));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x1435bf){_activeCookie=_0x1435bf||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x2db618,_0x572030){const _0x4eabf7=a185_0x26a8,_0x48028d=_0x572030 instanceof Error?_0x572030[_0x4eabf7(0x9e)]:String(_0x572030);return CliErrors['apiError'](_0x4eabf7(0x113)+_0x2db618+(_0x48028d?'\x20('+_0x48028d+')':''),_0x4eabf7(0x14f));}async function apiRequest(_0x544e95,_0x3a8739={}){const _0x18bf20=a185_0x26a8,{method:method='GET',body:_0x1ba815,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x3a8739,_0x5e4c64=useRuntime?getRuntimeDomain():getApiDomain(),_0xd01fe3=_activeCookie||getCookie(),_0x2094a1=''+_0x5e4c64+_0x544e95,_0x44d1ca=new AbortController(),_0x982b74=setTimeout(()=>_0x44d1ca[_0x18bf20(0x11a)](),timeout);try{const _0x4f25a6=await fetch(_0x2094a1,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0xd01fe3,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x1ba815?JSON[_0x18bf20(0x124)](_0x1ba815):undefined,'signal':_0x44d1ca['signal']});let _0x916ed8;try{_0x916ed8=await _0x4f25a6[_0x18bf20(0x9d)]();}catch(_0x310883){if(_0x310883 instanceof Error&&_0x310883['name']===_0x18bf20(0xaa))throw CliErrors[_0x18bf20(0xad)](_0x18bf20(0x12d)+_0x2094a1);if(_0x4f25a6['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x18bf20(0x116)+_0x4f25a6[_0x18bf20(0x15d)]+')',_0x4f25a6[_0x18bf20(0x15d)]>=0x190?_0x18bf20(0x154):undefined);}if(!_0x4f25a6['ok']||_0x916ed8['success']===![])throw CliErrors[_0x18bf20(0xad)](_0x916ed8[_0x18bf20(0xa2)]||_0x916ed8[_0x18bf20(0x9e)]||'API\x20error:\x20'+_0x4f25a6[_0x18bf20(0x15d)],_0x916ed8[_0x18bf20(0xc1)]?'API\x20error\x20code:\x20'+_0x916ed8[_0x18bf20(0xc1)]:undefined);return _0x916ed8;}catch(_0x43b94f){if(_0x43b94f instanceof CliError)throw _0x43b94f;if(_0x43b94f instanceof Error&&_0x43b94f[_0x18bf20(0xa5)]===_0x18bf20(0xaa))throw CliErrors[_0x18bf20(0xad)]('Request\x20timeout:\x20'+_0x2094a1);throw createFetchFailureError(_0x2094a1,_0x43b94f);}finally{clearTimeout(_0x982b74);}}async function apiFormRequest(_0xf9f52f,_0x2ec3f9,_0x729718={}){const _0x4aac0a=a185_0x26a8,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x729718,_0x571cf5=_activeCookie||getCookie(),_0x2d6784=''+getApiDomain()+_0xf9f52f,_0x3d640f=new AbortController(),_0x431b81=setTimeout(()=>_0x3d640f[_0x4aac0a(0x11a)](),timeout);try{const _0x1ae551=await fetch(_0x2d6784,{'method':_0x4aac0a(0x15f),'headers':{'Cookie':_0x571cf5,'X-Invoke-Source':'cli:rabetbase'},'body':_0x2ec3f9,'signal':_0x3d640f[_0x4aac0a(0x127)]});let _0x494d40;try{_0x494d40=await _0x1ae551[_0x4aac0a(0x9d)]();}catch(_0x2883ec){if(_0x2883ec instanceof Error&&_0x2883ec[_0x4aac0a(0xa5)]===_0x4aac0a(0xaa))throw CliErrors['apiError'](_0x4aac0a(0x12d)+_0x2d6784);throw CliErrors['apiError'](_0x4aac0a(0x116)+_0x1ae551[_0x4aac0a(0x15d)]+')',_0x1ae551[_0x4aac0a(0x15d)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x1ae551['ok']||_0x494d40['success']===![])throw CliErrors[_0x4aac0a(0xad)](_0x494d40[_0x4aac0a(0xa2)]||_0x494d40['message']||_0x4aac0a(0xa8)+_0x1ae551[_0x4aac0a(0x15d)],_0x494d40[_0x4aac0a(0xc1)]?'API\x20error\x20code:\x20'+_0x494d40['errorCode']:undefined);return _0x494d40;}catch(_0x2fa96c){if(_0x2fa96c instanceof CliError)throw _0x2fa96c;if(_0x2fa96c instanceof Error&&_0x2fa96c['name']===_0x4aac0a(0xaa))throw CliErrors[_0x4aac0a(0xad)](_0x4aac0a(0x12d)+_0x2d6784);throw createFetchFailureError(_0x2d6784,_0x2fa96c);}finally{clearTimeout(_0x431b81);}}export async function uploadDevelopmentFile(_0x4cb98a,_0x89e795){const _0x5102bb=a185_0x26a8,_0x4f18a1=await readFile(_0x89e795),_0x242e00=new FormData();_0x242e00['append'](_0x5102bb(0x13f),_0x4cb98a),_0x242e00['append'](_0x5102bb(0xfa),new Blob([new Uint8Array(_0x4f18a1)]),basename(_0x89e795));const _0x427c42=await apiFormRequest(_0x5102bb(0x100),_0x242e00);return _0x427c42[_0x5102bb(0x90)];}export async function queryDevelopmentFileUrl(_0x5558e5,_0x52baf0={}){const _0x38dbe3=a185_0x26a8,_0x5f1993=await apiRequest(_0x38dbe3(0xc3),{'method':_0x38dbe3(0x15f),'body':{'filePath':_0x5558e5,'downloadFlag':_0x52baf0[_0x38dbe3(0xf6)]??![],..._0x52baf0[_0x38dbe3(0x11f)]?{'longTerm':!![]}:{}}});return _0x5f1993[_0x38dbe3(0x90)];}function isAuthFailure(_0x552772){const _0x401514=a185_0x26a8,_0x247cb7=_0x552772[_0x401514(0xa2)]||_0x552772[_0x401514(0x9e)]||_0x552772['data']?.[_0x401514(0x9e)]||_0x552772[_0x401514(0x12e)]||_0x552772[_0x401514(0xbc)]||'';return _0x552772[_0x401514(0xc1)]===_0x401514(0xd2)||_0x552772[_0x401514(0xf7)]===0x191||_0x552772[_0x401514(0xf7)]===_0x401514(0x10e)||_0x247cb7[_0x401514(0xe3)](_0x401514(0x10e))||_0x247cb7['includes'](_0x401514(0xe4))||_0x247cb7['includes']('登录')||_0x247cb7['includes']('认证');}export async function platformFetch(_0x2d127f,_0x2203ca){const _0x6e873b=a185_0x26a8;let _0x2a308a;try{_0x2a308a=await fetch(_0x2d127f,{'method':_0x2203ca[_0x6e873b(0xf0)]??'GET','headers':{'Content-Type':_0x6e873b(0x109),'Cookie':_0x2203ca[_0x6e873b(0x148)],'X-Invoke-Source':_0x6e873b(0x149)},..._0x2203ca[_0x6e873b(0x166)]&&{'body':JSON[_0x6e873b(0x124)](_0x2203ca[_0x6e873b(0x166)])}});}catch(_0x55f08f){throw createFetchFailureError(_0x2d127f,_0x55f08f);}if(!_0x2a308a['ok']){if(_0x2a308a[_0x6e873b(0x15d)]===0x191)throw CliErrors[_0x6e873b(0xd1)]();throw CliErrors[_0x6e873b(0xad)](_0x2203ca[_0x6e873b(0xbe)]+_0x6e873b(0x9f)+_0x2a308a[_0x6e873b(0x15d)]);}const _0x3c6f1d=await _0x2a308a[_0x6e873b(0x9d)]();if(_0x3c6f1d[_0x6e873b(0x143)]===![]){if(isAuthFailure(_0x3c6f1d))throw CliErrors[_0x6e873b(0xd1)]();throw CliErrors[_0x6e873b(0xad)](_0x3c6f1d[_0x6e873b(0xa2)]||_0x3c6f1d[_0x6e873b(0x9e)]||_0x2203ca[_0x6e873b(0xbe)]+_0x6e873b(0x114));}return _0x3c6f1d[_0x6e873b(0x90)];}export async function platformRequest(_0x36b829,_0x1ac875){const _0xbfafaf=a185_0x26a8;if(/^https?:\/\//i['test'](_0x36b829))throw CliErrors['validation'](_0xbfafaf(0xfd)+_0x36b829,_0xbfafaf(0xd7));const _0x53e7a9=_0x36b829[_0xbfafaf(0x160)]('/')?_0x36b829:'/'+_0x36b829;return platformFetch(''+getApiDomain()+_0x53e7a9,_0x1ac875);}function cleanNewlines(_0x2deccc){const _0xf840fb=a185_0x26a8;return _0x2deccc[_0xf840fb(0xc0)](/[\r\n]+/g,'\x20')[_0xf840fb(0x117)]();}function cleanDatasetName(_0x5e584e){const _0x5c1736=a185_0x26a8;if(!_0x5e584e[_0x5c1736(0xa5)])return _0x5e584e;return{..._0x5e584e,'name':cleanNewlines(_0x5e584e[_0x5c1736(0xa5)])};}export async function fetchModelList(_0x1bb6b0,_0x3eab90){const _0x208766=a185_0x26a8,_0x125afe=getEnv(),_0x4f28e2=new URLSearchParams({'appcode':_0x1bb6b0,'otype':_0x208766(0x14a)}),_0x574e29='/api/node-toolbox/dataset/model-list?'+_0x4f28e2[_0x208766(0x108)]();logger[_0x208766(0xf1)](_0x208766(0xf8),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x125afe+')',{'apiPath':_0x574e29});const _0x14e4d8=await platformRequest(_0x574e29,{'cookie':_0x3eab90,'label':'Fetch\x20datasets'}),_0x399ffc=(_0x14e4d8[_0x208766(0x101)]??[])[_0x208766(0xfc)](cleanDatasetName);return{'configArray':_0x399ffc,'count':_0x399ffc[_0x208766(0xed)]};}export async function fetchDatasetDoc(_0x12672f){const _0x27fc61=a185_0x26a8,{appCode:_0x47dd79,cookie:_0x3463c1,datasetCode:_0x3464c6,datasetId:_0x5ea6e6,extraParams:_0x34ded2}=_0x12672f,_0x332004=await platformRequest(_0x27fc61(0xb5),{'method':'POST','body':{'appCode':_0x47dd79,'datasetCode':_0x3464c6,'datasetId':_0x5ea6e6,..._0x34ded2||{}},'cookie':_0x3463c1,'label':_0x27fc61(0x139)+_0x3464c6+')'});if(!_0x332004||typeof _0x332004[_0x27fc61(0x12b)]!==_0x27fc61(0xea))throw new Error('Invalid\x20response\x20format\x20('+_0x3464c6+_0x27fc61(0x121));return _0x332004[_0x27fc61(0x12b)];}export async function getMenuTree(_0x2cb5b7,_0x15ebde){const _0x561c39=a185_0x26a8,_0x14c8c7=new URLSearchParams({'appCode':_0x2cb5b7});return platformRequest('/smartapi/menu/find?'+_0x14c8c7[_0x561c39(0x108)](),{'cookie':_0x15ebde,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x26f59a,_0x30a80a,_0x38c1e7){const _0x1930de=a185_0x26a8;return platformRequest('/smartapi/menu/create',{'method':_0x1930de(0x15f),'body':_0x26f59a,'cookie':_0x30a80a,'label':_0x38c1e7});}export async function updateMenuRecord(_0x42caf4,_0xfce9e9,_0x77fc41){const _0x24f3e2=a185_0x26a8;return platformRequest('/smartapi/menu/update',{'method':_0x24f3e2(0x15f),'body':_0x42caf4,'cookie':_0xfce9e9,'label':_0x77fc41});}export async function listBffScripts(_0x4d6b99,_0x118a5d,_0x5896e4){const _0x58ac32=a185_0x26a8;let _0x359a29=_0x58ac32(0x13a)+_0x4d6b99;if(_0x118a5d)_0x359a29+=_0x58ac32(0x11e)+_0x118a5d;const _0x47132c=await apiRequest(_0x359a29);let _0x41c73d=extractList(_0x47132c[_0x58ac32(0x90)]);if(_0x5896e4?.[_0x58ac32(0xc4)]){const _0x481dda=_0x5896e4[_0x58ac32(0xc4)][_0x58ac32(0x92)]();_0x41c73d=_0x41c73d[_0x58ac32(0x135)](_0x21e4d2=>_0x21e4d2[_0x58ac32(0xd8)]?.[_0x58ac32(0x92)]()[_0x58ac32(0xe3)](_0x481dda)||_0x21e4d2[_0x58ac32(0x12a)]?.[_0x58ac32(0x92)]()['includes'](_0x481dda));}return _0x41c73d;}export async function getBffScriptInfo(_0x952996){const _0x18324b=a185_0x26a8,_0x4d44af=await apiRequest('/api/management/library/scripts/info?id='+_0x952996);if(!_0x4d44af[_0x18324b(0x90)])throw CliErrors['validation'](_0x18324b(0xd5)+_0x952996);return _0x4d44af['data'];}export async function saveBffScript(_0x7e1434){const _0x3200db=a185_0x26a8,_0x5cb260=await apiRequest(_0x3200db(0x128),{'method':_0x3200db(0x15f),'body':_0x7e1434}),{id:_0x8f6966,entity:_0x2fe819}=normalizeEntityWithIdResponse(_0x5cb260[_0x3200db(0x90)]);if(_0x8f6966!==undefined){const _0x22378c=typeof _0x2fe819[_0x3200db(0xd8)]===_0x3200db(0xea)||typeof _0x2fe819[_0x3200db(0xc6)]==='string'?_0x2fe819:undefined;return{'id':_0x8f6966,'script':_0x22378c};}throw CliErrors['apiError'](_0x3200db(0xab));}export async function deleteBffScript(_0x464347){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x464347}});}export async function getBffScriptStatistics(_0x214e1f){const _0x3c69ab=a185_0x26a8,_0x118e43=await apiRequest(_0x3c69ab(0x10c)+_0x214e1f);return extractList(_0x118e43[_0x3c69ab(0x90)]);}export async function clearBffScriptCache(){const _0x22156d=a185_0x26a8,_0x35bd4f=await apiRequest(_0x22156d(0xdc),{'method':_0x22156d(0x15f),'useRuntime':!![]});return typeof _0x35bd4f[_0x22156d(0x90)]===_0x22156d(0xea)?_0x35bd4f[_0x22156d(0x90)]:'';}export async function listBffDatasetOperations(_0x410d3c,_0x227e68){const _0x1d3fd4=a185_0x26a8,_0x48cf03=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x1d3fd4(0x15f),'body':{'appCode':_0x410d3c,'datasetId':_0x227e68}});return _0x48cf03['data'];}export async function listSqlQueries(_0x3415f2,_0x5efd93){const _0x4a9fe4=a185_0x26a8,_0x2dc443=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x4a9fe4(0x15f),'body':{'appCode':_0x3415f2,'currentPage':_0x5efd93?.['currentPage']??0x1,'pageSize':_0x5efd93?.[_0x4a9fe4(0x140)]??0x32,'sqlCode':_0x5efd93?.[_0x4a9fe4(0xe7)],'sqlName':_0x5efd93?.[_0x4a9fe4(0x15e)]}});return _0x2dc443['data'];}export async function getSqlQueryInfo(_0x12435a,_0x8796dd){const _0xbf5063=a185_0x26a8,_0x3fe33b=await listSqlQueries(_0x12435a,{'sqlCode':_0x8796dd}),_0xab476b=_0x3fe33b[_0xbf5063(0x150)]?.[0x0];if(!_0xab476b)throw CliErrors[_0xbf5063(0xe0)](_0xbf5063(0xd4)+_0x8796dd);return _0xab476b;}export async function getSqlQueryDetail(_0x46aeae){const _0x1849fa=a185_0x26a8,_0x3f388c=await apiRequest(_0x1849fa(0x164)+(_0x1849fa(0xe6)+encodeURIComponent(_0x46aeae)));if(!_0x3f388c[_0x1849fa(0x90)])throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x46aeae);return _0x3f388c['data'];}export async function getSqlQueryDetailById(_0x4e74a0){const _0x3485d7=a185_0x26a8,_0x2b081a=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x4e74a0);if(!_0x2b081a[_0x3485d7(0x90)])throw CliErrors[_0x3485d7(0xe0)](_0x3485d7(0xfb)+_0x4e74a0);return _0x2b081a[_0x3485d7(0x90)];}export async function createSqlQuery(_0x5b8e01){const _0x2fb3b1=a185_0x26a8,_0x5d0f18=await apiRequest(_0x2fb3b1(0x91),{'method':_0x2fb3b1(0x15f),'body':_0x5b8e01}),{id:_0x95872e,entity:_0x3d579b}=normalizeEntityWithIdResponse(_0x5d0f18[_0x2fb3b1(0x90)]);if(!(_0x2fb3b1(0xe7)in _0x3d579b)&&_0x95872e)return getSqlQueryDetailById(_0x95872e);return normalizeSqlQueryEntity(_0x3d579b);}export async function updateSqlQuery(_0x4238e4){const _0x337304=a185_0x26a8,_0x14f5f2=await apiRequest(_0x337304(0x107),{'method':_0x337304(0x15f),'body':_0x4238e4}),{id:_0x46a8bf,entity:_0x162029}=normalizeEntityWithIdResponse(_0x14f5f2[_0x337304(0x90)]);if(!(_0x337304(0xe7)in _0x162029)){if(_0x4238e4[_0x337304(0xe7)])return getSqlQueryDetail(_0x4238e4[_0x337304(0xe7)]);if(_0x46a8bf)return getSqlQueryDetailById(_0x46a8bf);}return normalizeSqlQueryEntity(_0x162029);}export async function deleteSqlQuery(_0x21b6fa){const _0x16d222=a185_0x26a8;await apiRequest(_0x16d222(0x99),{'method':'POST','body':_0x21b6fa});}function a185_0x13df(){const _0x330d0e=['12MLJcpo','needSelf','/api/node-toolbox/api-doc-generator','operationId','object','/smartapi/dataset/restore-dataset','122AaLLVS','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/permit/role/create','error','datasetTableCount','label','/smartapi/question/er-config/cli/detail?','replace','errorCode','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/common/queryFileUrl','scriptName','type','scriptType','/smartapi/question/er-config/cli/erCreate','/smartapi/permit/page/save','list','/smartapi/permit/resource/get-menu-list','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','has','510798erhDlR','set','includeImports','\x20\x20sqlCode:\x20\x27','authRequired','UNAUTHORIZED','Warning:\x20showing\x20first\x20','SQL\x20query\x20not\x20found:\x20','BFF\x20script\x20not\x20found:\x20id=','summary','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','functionName','/smartapi/app-config/update','hint','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/management/script/cache/clear','username','/smartapi/dblink/getOne','test','validation','tableList','/api/','includes','Unauthorized','modelId','?sqlCode=','sqlCode','/notification/channel-config/list','/smartapi/dblink/getAllTableList','string','Page\x20not\x20found:\x20','/smartapi/dblink/getTableDiffV2ByPage','length','/smartapi/lovrabet/update-page','//\x20','method','info','/smartapi/dataset/text-generate/preview','/smartapi/permit/role/get-one','DATA_NOT_EXIST','\x20\x20\x20\x20sqlCode:\x20\x27','download','code','fetch-model-list','email','file','SQL\x20query\x20not\x20found:\x20id=','map','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','sdk','max','/smartapi/common/uploadFile','configArray','tableName','path','.getOne(id);','/smartapi/dataset/delete-dataset','/smartapi/app-config/create','/smartapi/custom/updateUserCustomSql','toString','application/json','dataset_','version','/api/management/library/scripts/statistics?appCode=','/generate-standard-pages/status?','401','datasetName','remove','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','3348035WmQyRM','Request\x20failed:\x20','\x20failed','key','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','trim','\x22\x20not\x20found\x20in\x20dataset\x20','/smartapi/app-config/delete','abort','/smartapi/dblink/getList','.filter({','tags','&type=','longTerm','update','):\x20missing\x20data.markdown\x20field','1587140GwtWGf','/smartapi/permit/role/delete','stringify','userTenantRelationList','requirementDescription','signal','/api/management/library/scripts/save','/smartapi/question/er-config/business-group/edit','description','markdown','permits','Request\x20timeout:\x20','errorMessage','API\x20error\x20code:\x20306','value','const\x20data\x20=\x20await\x20client.sql.execute({','CUSTOM','nickname','/smartapi/permit/user-role/update-user-list','filter','relation','const\x20result\x20=\x20await\x20client.models.','find','Fetch\x20doc\x20(','/api/management/library/scripts/list?appCode=','entries','11794MKCsUY','/smartapi/db-analysis/start','\x20\x20return\x20rows;','appCode','pageSize','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','needPublic','success','313300fikhtg','operations','/smartapi/dataset/get-dataset-list','/smartapi/lovrabet/dataset/','cookie','cli:rabetbase','array','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','operationName','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','roleType','Check\x20network\x20connectivity\x20and\x20try\x20again.','tableData','/smartapi/app/getList','modelCode','userId','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/dataset/get-driven-data?','/userTenant/getByTenantCode','remark','\x20\x20where:\x20{},','/smartapi/question/er-config/cli/update-single','dbtableConfig','getOne','/smartapi/question/er-config','status','sqlName','POST','startsWith','roleName','/smartapi/permit/role/get-permit-list','});','/smartapi/custom/getUserCustomSql','/sync-to-pages','body','min','/smartapi/dblink/update','isArray','/filter','target','/generate-standard-pages/start','\x20\x20currentPage:\x201,','/smartapi/permit/role/update','/smartapi/db-analysis/status/','196677yjETqu','totalCount','join','data','/smartapi/custom/saveUserCustomSql','toLowerCase','/smartapi/app-config/list','dbId','/smartapi/app-config/getByKey','physicalTableCount','currentPage','isFinite','/smartapi/custom/deleteUserCustomSql','clientOperationId','/api/node-toolbox/sql/save','add','json','message','\x20failed,\x20HTTP\x20','api_error','Operation\x20\x22','errorMsg','push','192heHVkW','name','pageIndex','//\x20SQL:\x20','API\x20error:\x20','avatar','AbortError','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20\x20});','apiError','43519YUyQju','\x20\x20pageSize:\x2020,','deleted','/smartapi/dblink/delete','.update(id,\x20{\x20/*\x20fields\x20*/\x20});'];a185_0x13df=function(){return _0x330d0e;};return a185_0x13df();}export async function saveSqlQuery(_0x1ae604){const _0x5ccee1=a185_0x26a8,_0x1b2111=await apiRequest(_0x5ccee1(0x9b),{'method':_0x5ccee1(0x15f),'body':_0x1ae604});return _0x1b2111[_0x5ccee1(0x90)];}function normalizeSqlQueryEntity(_0x21edae){const _0x5f1512=a185_0x26a8;return{..._0x21edae,'id':Number(_0x21edae['id']),'dbId':_0x21edae['dbId']==null?undefined:Number(_0x21edae[_0x5f1512(0x94)]),'version':_0x21edae[_0x5f1512(0x10b)]==null?undefined:Number(_0x21edae[_0x5f1512(0x10b)])};}export async function executeSql(_0x3fc440,_0x32029d,_0xbcf8){const _0x135120=a185_0x26a8,_0x19f922=await apiRequest('/api/custom/executeSql',{'method':_0x135120(0x15f),'body':{'appCode':_0x3fc440,'sqlCode':_0x32029d,..._0xbcf8&&{'params':_0xbcf8}},'useRuntime':!![]});return _0x19f922['data'];}export async function executeDatasetDataOperation(_0x15c7b0,_0x1dee97,_0x4f786a,_0xde8510={}){const _0x5eb900=a185_0x26a8;try{const _0x1b5e03=await apiRequest(_0x5eb900(0xe2)+_0x15c7b0+'/'+_0x1dee97+'/'+_0x4f786a,{'method':'POST','body':_0xde8510,'useRuntime':!![]});return _0x1b5e03[_0x5eb900(0x90)];}catch(_0x3900b8){if(_0x4f786a===_0x5eb900(0x15b)&&_0x3900b8 instanceof CliError&&_0x3900b8[_0x5eb900(0xf7)]===_0x5eb900(0xa0)&&_0xde8510['id']!==undefined&&_0xde8510['id']!==null&&_0xde8510['id']!==''){const _0x594283=await apiRequest('/api/'+_0x15c7b0+'/'+_0x1dee97+_0x5eb900(0x16a),{'method':_0x5eb900(0x15f),'body':{'where':{'id':{'$eq':_0xde8510['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x1d4dab=Array['isArray'](_0x594283[_0x5eb900(0x90)]?.[_0x5eb900(0x150)])?_0x594283[_0x5eb900(0x90)][_0x5eb900(0x150)]:[];return _0x1d4dab[0x0]??null;}throw _0x3900b8;}}export async function listDatasets(_0x26ecb9,_0x1d1e5b){const _0x52d7ff=a185_0x26a8,_0x4bedda={'appCode':_0x26ecb9,'deleted':_0x1d1e5b?.[_0x52d7ff(0xb0)]??![]};if(_0x1d1e5b?.[_0x52d7ff(0xf7)])_0x4bedda[_0x52d7ff(0xf7)]=_0x1d1e5b[_0x52d7ff(0xf7)];if(_0x1d1e5b?.['name'])_0x4bedda[_0x52d7ff(0xa5)]=_0x1d1e5b['name'];const _0x225373=await apiRequest(_0x52d7ff(0x146),{'method':_0x52d7ff(0x15f),'body':_0x4bedda});return extractList(_0x225373[_0x52d7ff(0x90)]);}export async function deleteDataset(_0x4cc8b5,_0x4031f0){const _0x9f9aa5=a185_0x26a8;await apiRequest(_0x9f9aa5(0x105),{'method':'POST','body':{'appCode':_0x4cc8b5,'datasetId':_0x4031f0}});}export async function restoreDataset(_0x5364ba,_0x3f394d){const _0x84a18=a185_0x26a8;await apiRequest(_0x84a18(0xb8),{'method':_0x84a18(0x15f),'body':{'appCode':_0x5364ba,'datasetId':_0x3f394d}});}export async function previewTextGeneratedDataset(_0x4aabb7,_0xe7e684){const _0x27bba2=a185_0x26a8,_0x2e7111=await apiRequest(_0x27bba2(0xf2),{'method':'POST','body':{'appCode':_0x4aabb7,'datasetName':_0xe7e684[_0x27bba2(0x10f)],'requirementDescription':_0xe7e684[_0x27bba2(0x126)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x2e7111['data'];}export async function startTextGeneratedDataset(_0x3db942,_0x1d3997,_0x54656c){const _0xafe092=a185_0x26a8,_0x25366b=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0xafe092(0x15f),'body':{'appCode':_0x3db942,..._0x54656c?.[_0xafe092(0x9a)]?{'clientOperationId':_0x54656c[_0xafe092(0x9a)]}:{},'design':_0x1d3997},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x25366b[_0xafe092(0x90)];}export async function getTextGeneratedDatasetStatus(_0xa7031c,_0x5c0e17){const _0x3cd046=a185_0x26a8,_0x2d29e4=new URLSearchParams({'appCode':_0xa7031c});_0x5c0e17[_0x3cd046(0xb6)]&&_0x2d29e4[_0x3cd046(0xce)](_0x3cd046(0xb6),_0x5c0e17['operationId']);_0x5c0e17['clientOperationId']&&_0x2d29e4[_0x3cd046(0xce)](_0x3cd046(0x9a),_0x5c0e17[_0x3cd046(0x9a)]);const _0x6f220a=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x2d29e4['toString']());return _0x6f220a[_0x3cd046(0x90)];}export async function searchDatasets(_0x1eb539,_0x2aeb8e){const _0x4e415c=a185_0x26a8,_0x25d9cb=await listDatasets(_0x1eb539,{'name':_0x2aeb8e}),_0xd6f951=_0x2aeb8e[_0x4e415c(0x92)](),_0x2cc59c=new Set(_0x25d9cb[_0x4e415c(0xfc)](_0x631558=>_0x631558['id'])),_0x477736=_0x25d9cb['filter'](_0x5f3a8e=>_0x5f3a8e[_0x4e415c(0x15a)]?.['tableName']?.[_0x4e415c(0x92)]()[_0x4e415c(0xe3)](_0xd6f951)||_0x5f3a8e[_0x4e415c(0x12a)]?.[_0x4e415c(0x92)]()['includes'](_0xd6f951)),_0x2791ae=await listDatasets(_0x1eb539,{'code':_0x2aeb8e});for(const _0x254c26 of _0x2791ae){!_0x2cc59c[_0x4e415c(0xcc)](_0x254c26['id'])&&(_0x25d9cb[_0x4e415c(0xa3)](_0x254c26),_0x2cc59c[_0x4e415c(0x9c)](_0x254c26['id']));}return _0x25d9cb;}export function normalizeDatasetOperations(_0x37155e){const _0x2960d8=a185_0x26a8;if(Array[_0x2960d8(0x169)](_0x37155e))return _0x37155e[_0x2960d8(0x135)](_0x339f7c=>_0x339f7c!=null&&typeof _0x339f7c===_0x2960d8(0xb7));if(_0x37155e&&typeof _0x37155e==='object')return Object[_0x2960d8(0x13b)](_0x37155e)[_0x2960d8(0x135)](([,_0x1d5aee])=>_0x1d5aee!=null&&typeof _0x1d5aee===_0x2960d8(0xb7))[_0x2960d8(0xfc)](([_0x33591b,_0x4ce789])=>({..._0x4ce789,'name':_0x4ce789['name']??_0x4ce789['operationName']??_0x33591b}));return[];}export async function getDatasetDetail(_0x43c420){const _0x24cfdb=a185_0x26a8,_0xd41846=/^\d+$/[_0x24cfdb(0xdf)](_0x43c420)?'id':_0x24cfdb(0xf7),_0x167d7b=await apiRequest(_0x24cfdb(0x155)+_0xd41846+'='+_0x43c420);return _0x167d7b['data'];}export async function updateDrivenData(_0x343f5e){const _0x52726d=a185_0x26a8,_0x54b656=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x343f5e});return _0x54b656[_0x52726d(0x90)];}export async function getDatasetOperations(_0x8a5936){const _0x1b66d5=a185_0x26a8,_0x1038b6=await getDatasetDetail(_0x8a5936),_0x495ed0=normalizeDatasetOperations(_0x1038b6['operations'])['map'](_0x4eb7f3=>({'name':_0x4eb7f3[_0x1b66d5(0xa5)]||_0x4eb7f3[_0x1b66d5(0x14c)],'displayName':_0x4eb7f3['displayName']||_0x4eb7f3[_0x1b66d5(0xa5)],'type':_0x4eb7f3[_0x1b66d5(0xc5)],'method':_0x4eb7f3['method'],'path':_0x4eb7f3[_0x1b66d5(0x103)],'enabled':_0x4eb7f3['enabled']??!![],'requestFields':_0x4eb7f3['requestFields'],'responseFields':_0x4eb7f3['responseFields']}));return{'dataset':{'id':_0x1038b6['id']??_0x1038b6[_0x1b66d5(0xe5)],'name':_0x1038b6[_0x1b66d5(0xa5)],'code':_0x1038b6['code']||_0x1038b6[_0x1b66d5(0x152)],'tableName':_0x1038b6[_0x1b66d5(0x102)]||_0x1038b6[_0x1b66d5(0x15a)]?.[_0x1b66d5(0x102)]},'operations':_0x495ed0};}export async function getOperationDetail(_0x2f2201,_0x41ff84,_0x3f466a){const _0x32b3f4=a185_0x26a8;let _0x22af7e=_0x41ff84;if(!/^\d+$/[_0x32b3f4(0xdf)](_0x41ff84)){const _0x390930=await listDatasets(_0x2f2201,{'code':_0x41ff84}),_0x2a090c=_0x390930['find'](_0x5afc6b=>_0x5afc6b[_0x32b3f4(0xf7)]===_0x41ff84||String(_0x5afc6b['id'])===_0x41ff84);if(!_0x2a090c)throw CliErrors[_0x32b3f4(0xe0)]('Dataset\x20not\x20found:\x20'+_0x41ff84);_0x22af7e=String(_0x2a090c['id']);}const _0x18b5b5=await getDatasetDetail(_0x22af7e),_0x465350=normalizeDatasetOperations(_0x18b5b5[_0x32b3f4(0x145)])[_0x32b3f4(0x138)](_0x25b906=>(_0x25b906[_0x32b3f4(0xa5)]||_0x25b906['operationName'])===_0x3f466a);if(!_0x465350)throw CliErrors[_0x32b3f4(0xe0)](_0x32b3f4(0xa1)+_0x3f466a+_0x32b3f4(0x118)+_0x41ff84);return{'dataset':{'id':_0x18b5b5['id']??_0x18b5b5[_0x32b3f4(0xe5)],'name':_0x18b5b5[_0x32b3f4(0xa5)],'code':_0x18b5b5['code']||_0x18b5b5[_0x32b3f4(0x152)],'tableName':_0x18b5b5['tableName']||_0x18b5b5['dbtableConfig']?.[_0x32b3f4(0x102)]},'operation':_0x465350};}export async function startGenerateStandardPages(_0xa2acb,_0x3f744d,_0xadbc0a){const _0x5141c3=a185_0x26a8,_0x1db419=await apiRequest(_0x5141c3(0x147)+_0x3f744d+_0x5141c3(0x16c),{'method':_0x5141c3(0x15f),'body':{'appCode':_0xa2acb,..._0xadbc0a?.[_0x5141c3(0x9a)]?{'clientOperationId':_0xadbc0a['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1db419[_0x5141c3(0x90)];}export async function getGenerateStandardPagesStatus(_0x25280e,_0x10ecbd,_0x4e7d17){const _0x21d590=a185_0x26a8,_0x250cf3=new URLSearchParams({'appCode':_0x25280e});_0x4e7d17[_0x21d590(0xb6)]&&_0x250cf3[_0x21d590(0xce)]('operationId',_0x4e7d17[_0x21d590(0xb6)]);_0x4e7d17[_0x21d590(0x9a)]&&_0x250cf3[_0x21d590(0xce)]('clientOperationId',_0x4e7d17[_0x21d590(0x9a)]);const _0x3711cb=await apiRequest(_0x21d590(0x147)+_0x10ecbd+_0x21d590(0x10d)+_0x250cf3['toString']());return _0x3711cb[_0x21d590(0x90)];}export async function getStandardPageStatus(_0x3d9eea,_0xff1d2){const _0x5e0e10=a185_0x26a8,_0x1395df=await apiRequest(_0x5e0e10(0x147)+_0xff1d2+'/standard-page-status?appCode='+encodeURIComponent(_0x3d9eea));return _0x1395df[_0x5e0e10(0x90)];}export async function tryGetStandardPageStatus(_0x4034e0,_0x52a15c){const _0x1dd0be=a185_0x26a8;try{return await getStandardPageStatus(_0x4034e0,_0x52a15c);}catch(_0x1de395){if(_0x1de395 instanceof CliError&&_0x1de395['code']===_0x1dd0be(0xa0)&&/404|not found|non-json response/i[_0x1dd0be(0xdf)](_0x1de395[_0x1dd0be(0x9e)]))return null;throw _0x1de395;}}export async function syncStandardPages(_0x2dd996,_0x1ad60f){const _0x2024f7=a185_0x26a8,_0x1f4a4d=await apiRequest(_0x2024f7(0x147)+_0x1ad60f+_0x2024f7(0x165),{'method':_0x2024f7(0x15f),'body':{'appCode':_0x2dd996}});return _0x1f4a4d[_0x2024f7(0x90)];}export async function getPageDetail(_0x42f489){const _0x90293f=a185_0x26a8,_0x5f011a=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x42f489);if(!_0x5f011a[_0x90293f(0x90)])throw CliErrors[_0x90293f(0xe0)](_0x90293f(0xeb)+_0x42f489);return _0x5f011a['data'];}export async function updatePage(_0x35fc2a,_0xa85cf8,_0x1817d3,_0x36058c){const _0x369459=a185_0x26a8,_0x34c506=await apiRequest(_0x369459(0xee),{'method':_0x369459(0x15f),'body':{'appCode':_0x35fc2a,'pageId':_0xa85cf8,'code':_0x1817d3,'datasetIds':_0x36058c}});return _0x34c506[_0x369459(0x90)];}export function generateSdkCode(_0x27ac6b,_0x165045,_0x239c51){const _0x18249e=a185_0x26a8,_0x9e9767=_0x239c51?.[_0x18249e(0xcf)]??!![],_0x158f16=_0x18249e(0x10a)+_0x27ac6b[_0x18249e(0xf7)]?.[_0x18249e(0xc0)](/-/g,'_'),_0x29676b=_0x165045['name']||_0x165045['operationName']||_0x18249e(0x135),_0x493442=[];_0x9e9767&&_0x493442[_0x18249e(0xa3)](_0x18249e(0x14b),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x493442['push'](_0x18249e(0xef)+_0x27ac6b[_0x18249e(0xa5)]+'\x20('+(_0x27ac6b[_0x18249e(0x102)]||'table')+')');if(_0x29676b===_0x18249e(0x135))_0x493442[_0x18249e(0xa3)]('const\x20result\x20=\x20await\x20client.models.'+_0x158f16+_0x18249e(0x11c),_0x18249e(0x158),_0x18249e(0xaf),_0x18249e(0x16d),'});');else{if(_0x29676b===_0x18249e(0x15b))_0x493442[_0x18249e(0xa3)](_0x18249e(0x137)+_0x158f16+_0x18249e(0x104));else{if(_0x29676b==='create')_0x493442['push'](_0x18249e(0x137)+_0x158f16+_0x18249e(0xba));else{if(_0x29676b===_0x18249e(0x120))_0x493442['push'](_0x18249e(0x137)+_0x158f16+_0x18249e(0xb2));else _0x29676b==='delete'||_0x29676b===_0x18249e(0x110)?_0x493442[_0x18249e(0xa3)](_0x18249e(0x137)+_0x158f16+'.remove(id);'):_0x493442['push']('const\x20result\x20=\x20await\x20client.models.'+_0x158f16+'.'+_0x29676b+'(/*\x20params\x20*/);');}}}return _0x493442[_0x18249e(0x8f)]('\x0a');}export function generateSqlCodeTemplate(_0x323170,_0x360837){const _0x5ce6b0=a185_0x26a8,_0x415a99=_0x360837?.[_0x5ce6b0(0x16b)]??'sdk',_0x33bf46=_0x360837?.['includeImports']??!![],_0x15dc76=[];return _0x15dc76[_0x5ce6b0(0xa3)](_0x5ce6b0(0xa7)+_0x323170[_0x5ce6b0(0x15e)]+'\x20('+_0x323170[_0x5ce6b0(0xe7)]+')'),_0x415a99===_0x5ce6b0(0xfe)?(_0x33bf46&&_0x15dc76[_0x5ce6b0(0xa3)](_0x5ce6b0(0x14b),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x15dc76[_0x5ce6b0(0xa3)](_0x5ce6b0(0x131),_0x5ce6b0(0xd0)+_0x323170['sqlCode']+'\x27,',_0x5ce6b0(0xdb),_0x5ce6b0(0x163),_0x5ce6b0(0x141),_0x5ce6b0(0xc2))):_0x15dc76[_0x5ce6b0(0xa3)](_0x5ce6b0(0x14d),_0x5ce6b0(0xcb),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x5ce6b0(0xf5)+_0x323170[_0x5ce6b0(0xe7)]+'\x27,',_0x5ce6b0(0x111),_0x5ce6b0(0xac),_0x5ce6b0(0x13e),'}'),_0x15dc76[_0x5ce6b0(0x8f)]('\x0a');}export async function getErConfig(_0x1325e1,_0x1809de){const _0x38242c=a185_0x26a8,_0x19e257=await apiRequest(_0x38242c(0x15c),{'method':'POST','body':{'appCode':_0x1325e1,'dblinkId':_0x1809de},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x19e257[_0x38242c(0x90)];}export async function getErRelationDetail(_0x47c01c,_0x1e5621){const _0x269290=a185_0x26a8,_0x34e90f=new URLSearchParams({'appCode':_0x47c01c,'relationId':String(_0x1e5621)});try{const _0x344973=await apiRequest(_0x269290(0xbf)+_0x34e90f['toString']());return _0x344973['data']?.[_0x269290(0x136)]??null;}catch(_0x1779b1){if(_0x1779b1 instanceof CliError&&_0x1779b1[_0x269290(0xf7)]===_0x269290(0xa0)&&(_0x1779b1[_0x269290(0xda)]?.[_0x269290(0xe3)](_0x269290(0xf4))||_0x1779b1[_0x269290(0xda)]===_0x269290(0x12f)&&_0x1779b1[_0x269290(0x9e)]==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x1779b1;}}export async function createErRelation(_0x353517){const _0x3cf0d5=a185_0x26a8,_0x48513f=await apiRequest(_0x3cf0d5(0xc7),{'method':_0x3cf0d5(0x15f),'body':_0x353517,'allowNonJsonSuccess':!![]});return _0x48513f['data'];}export async function updateErRelation(_0x1bea0c){const _0x392f06=a185_0x26a8,_0x5539a4=await apiRequest(_0x392f06(0x159),{'method':'POST','body':_0x1bea0c,'allowNonJsonSuccess':!![]});return _0x5539a4['data'];}export async function deleteErRelation(_0x15fcd2){const _0x18cdfe=await apiRequest('/smartapi/question/er-config/cli/delete-single',{'method':'POST','body':_0x15fcd2,'allowNonJsonSuccess':!![]});return _0x18cdfe['data'];}export async function updateErBusinessGroup(_0x585cc2){const _0x3026d3=a185_0x26a8,_0x3fc493=await apiRequest(_0x3026d3(0x129),{'method':'POST','body':_0x585cc2,'allowNonJsonSuccess':!![]});return _0x3fc493[_0x3026d3(0x90)];}function buildQuery(_0x4b94c9){const _0x594b08=a185_0x26a8,_0x53f97d=new URLSearchParams();for(const [_0x3f7a67,_0x4ab7e8]of Object['entries'](_0x4b94c9)){if(_0x4ab7e8===undefined||_0x4ab7e8==='')continue;_0x53f97d[_0x594b08(0xce)](_0x3f7a67,String(_0x4ab7e8));}const _0x91767b=_0x53f97d[_0x594b08(0x108)]();return _0x91767b?'?'+_0x91767b:'';}export async function listNotificationChannelConfigs(_0x500a70,_0x14bd1b){const _0x19331d=a185_0x26a8,_0x46ba4c=await apiRequest(_0x19331d(0xe8)+buildQuery({'appCode':_0x500a70,'channelType':_0x14bd1b}));return Array['isArray'](_0x46ba4c[_0x19331d(0x90)])?_0x46ba4c['data']:[];}export async function listAppConfigs(_0x127b39,_0x19b6d6){const _0x2451bf=a185_0x26a8,_0x54d15b=await apiRequest(_0x2451bf(0x93),{'method':_0x2451bf(0x15f),'body':{'appCode':_0x127b39,..._0x19b6d6?.['key']?{'key':_0x19b6d6['key']}:{},..._0x19b6d6?.[_0x2451bf(0x11d)]?{'tags':_0x19b6d6[_0x2451bf(0x11d)]}:{}}});return extractAppConfigList(_0x54d15b[_0x2451bf(0x90)]);}export async function getAppConfigByKey(_0x3f9a9c,_0x2a10c5){const _0x273e1d=a185_0x26a8,_0x4eb24f=await apiRequest(_0x273e1d(0x95)+buildQuery({'appCode':_0x3f9a9c,'key':_0x2a10c5}));return _0x4eb24f[_0x273e1d(0x90)]??null;}export async function createAppConfig(_0x1b590b){const _0x56a830=a185_0x26a8,_0x5de585=await apiRequest(_0x56a830(0x106),{'method':_0x56a830(0x15f),'body':{'appCode':_0x1b590b[_0x56a830(0x13f)],'key':_0x1b590b[_0x56a830(0x115)],'value':_0x1b590b[_0x56a830(0x130)],..._0x1b590b[_0x56a830(0x11d)]?{'tags':_0x1b590b['tags']}:{}}});return _0x5de585[_0x56a830(0x90)];}export async function updateAppConfig(_0x20481e){const _0x10f6da=a185_0x26a8;await apiRequest(_0x10f6da(0xd9),{'method':_0x10f6da(0x15f),'body':{'id':_0x20481e['id'],'appCode':_0x20481e['appCode'],'key':_0x20481e[_0x10f6da(0x115)],'value':_0x20481e[_0x10f6da(0x130)],..._0x20481e[_0x10f6da(0x11d)]?{'tags':_0x20481e[_0x10f6da(0x11d)]}:{}}});}export async function deleteAppConfig(_0x4f2be3){const _0x4fe229=a185_0x26a8;await apiRequest(_0x4fe229(0x119),{'method':_0x4fe229(0x15f),'body':_0x4f2be3});}function extractAppConfigList(_0x3862a7){const _0x187126=a185_0x26a8;if(Array[_0x187126(0x169)](_0x3862a7))return _0x3862a7;if(_0x3862a7&&typeof _0x3862a7==='object'&&Array[_0x187126(0x169)](_0x3862a7['list']))return _0x3862a7[_0x187126(0xc9)];return extractList(_0x3862a7);}export async function listDbLinks(_0x2e3d98,_0x233e87){const _0x4660a9=a185_0x26a8,_0xb53908=await apiRequest(_0x4660a9(0x11b),{'method':_0x4660a9(0x15f),'body':{'appCode':_0x2e3d98,'currentPage':_0x233e87?.['currentPage']??0x1,'pageSize':_0x233e87?.[_0x4660a9(0x140)]??0x64}});return{'items':extractList(_0xb53908[_0x4660a9(0x90)]),'paging':extractPaging(_0xb53908[_0x4660a9(0x90)])};}export async function getDbLinkInfo(_0x2b83de){const _0x5e882a=a185_0x26a8,_0x8fca5e=await apiRequest(_0x5e882a(0xde)+buildQuery({'id':_0x2b83de}));return _0x8fca5e[_0x5e882a(0x90)];}export async function createDbLink(_0x2d529d){const _0x3b4464=a185_0x26a8,_0x4c54d6=await apiRequest('/smartapi/dblink/create',{'method':_0x3b4464(0x15f),'body':_0x2d529d});return _0x4c54d6[_0x3b4464(0x90)];}export async function updateDbLink(_0x2e9c74){const _0x22a0c3=a185_0x26a8,_0x78d439=await apiRequest(_0x22a0c3(0x168),{'method':'POST','body':_0x2e9c74});return _0x78d439['data'];}export async function deleteDbLink(_0x51e1db){const _0x1e6707=a185_0x26a8;await apiRequest(_0x1e6707(0xb1),{'method':_0x1e6707(0x15f),'body':{'id':_0x51e1db}});}export async function testDbLinkConnect(_0x589f84){const _0x6c230b=a185_0x26a8,_0x49d093=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x589f84}));return _0x49d093[_0x6c230b(0x90)];}export async function startDbAnalysis(_0x330027,_0x57aa52){const _0x3698ec=a185_0x26a8,_0x13c9da=await apiRequest(_0x3698ec(0x13d),{'method':'POST','body':{'dbLinkId':_0x330027,..._0x57aa52&&_0x57aa52[_0x3698ec(0xed)]>0x0?{'tableNames':_0x57aa52}:{}}});return _0x13c9da[_0x3698ec(0x90)];}export async function cancelDbAnalysis(_0x56107a){const _0x5d1b27=a185_0x26a8;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x56107a}),{'method':_0x5d1b27(0x15f)});}export async function getDbAnalysisStatus(_0x1010da){const _0x3d8a8d=a185_0x26a8,_0x352938=await apiRequest(_0x3d8a8d(0x8c)+encodeURIComponent(_0x1010da));return _0x352938[_0x3d8a8d(0x90)];}export async function getDbAllTableList(_0x542ab3,_0x337f4c){const _0x299a26=a185_0x26a8,_0x581b3f=await apiRequest(_0x299a26(0xe9)+buildQuery({'appCode':_0x542ab3,'dbLinkId':_0x337f4c})),_0x102caa=_0x581b3f[_0x299a26(0x90)];if(Array[_0x299a26(0x169)](_0x102caa))return _0x102caa;return extractList(_0x102caa);}export async function getDbTableDiff(_0x587272,_0x44ab43,_0x2aca6f){const _0x239665=a185_0x26a8,_0x317ffb=await apiRequest(_0x239665(0xec)+buildQuery({'appCode':_0x587272,'dbLinkId':_0x44ab43,'pageIndex':_0x2aca6f?.[_0x239665(0xa6)]??0x1,'pageSize':_0x2aca6f?.['pageSize']??0x14,'tableName':_0x2aca6f?.[_0x239665(0x102)]})),_0x2cc141=_0x317ffb['data'];return{'totalCount':_0x2cc141?.['totalCount']??0x0,'physicalTableCount':_0x2cc141?.[_0x239665(0x96)]??0x0,'datasetTableCount':_0x2cc141?.[_0x239665(0xbd)]??0x0,..._0x2cc141?.[_0x239665(0xd6)]?{'summary':_0x2cc141[_0x239665(0xd6)]}:{},'tableList':Array[_0x239665(0x169)](_0x2cc141?.[_0x239665(0xe1)])?_0x2cc141[_0x239665(0xe1)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x49cc92=a185_0x26a8,_0x13195c=await apiRequest(_0x49cc92(0x151),{'method':_0x49cc92(0x15f),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x939c4a=extractList(_0x13195c[_0x49cc92(0x90)]),_0x2eebe6=extractPaging(_0x13195c['data']);return _0x2eebe6&&_0x2eebe6[_0x49cc92(0x8e)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x49cc92(0xd3)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x2eebe6['totalCount']+'\x20apps.\x20'+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x939c4a;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x3af007,_0x13b5c9){const _0x382852=a185_0x26a8,_0x548b52=Math[_0x382852(0x167)](Math[_0x382852(0xff)](_0x13b5c9?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3d45f3=await apiRequest('/smartapi/permit/role/get-list',{'method':'POST','body':{'appCode':_0x3af007,'currentPage':_0x13b5c9?.[_0x382852(0x97)]??0x1,'pageSize':_0x548b52}});return{'items':extractList(_0x3d45f3[_0x382852(0x90)]),'paging':extractPaging(_0x3d45f3[_0x382852(0x90)])};}export async function getAppRole(_0x4eed34){const _0x426a0c=a185_0x26a8,_0xfb519c=await apiRequest(_0x426a0c(0xf3)+buildQuery({'id':_0x4eed34}));return _0xfb519c[_0x426a0c(0x90)];}function a185_0x26a8(_0x5c27e5,_0x5c2d59){_0x5c27e5=_0x5c27e5-0x8b;const _0x13df9e=a185_0x13df();let _0x26a852=_0x13df9e[_0x5c27e5];return _0x26a852;}export async function createAppRole(_0x4bdc36){const _0x3b5889=a185_0x26a8,_0x1f9078=await apiRequest(_0x3b5889(0xbb),{'method':_0x3b5889(0x15f),'body':{'appCode':_0x4bdc36[_0x3b5889(0x13f)],'roleName':_0x4bdc36[_0x3b5889(0x161)],'roleType':_0x3b5889(0x132),..._0x4bdc36['remark']?{'remark':_0x4bdc36[_0x3b5889(0x157)]}:{}}});return _0x1f9078[_0x3b5889(0x90)];}export async function updateAppRole(_0x16d376){const _0x21fd05=a185_0x26a8,_0x3ac01b=await apiRequest(_0x21fd05(0x8b),{'method':_0x21fd05(0x15f),'body':{'id':_0x16d376['id'],'appCode':_0x16d376[_0x21fd05(0x13f)],..._0x16d376['roleType']?{'roleType':_0x16d376[_0x21fd05(0x14e)]}:{},..._0x16d376[_0x21fd05(0x161)]!==undefined?{'roleName':_0x16d376[_0x21fd05(0x161)]}:{},..._0x16d376[_0x21fd05(0x157)]!==undefined?{'remark':_0x16d376[_0x21fd05(0x157)]}:{},..._0x16d376[_0x21fd05(0x12c)]?{'permits':_0x16d376[_0x21fd05(0x12c)]}:{}}});return _0x3ac01b[_0x21fd05(0x90)];}export async function deleteAppRole(_0x3e5564){const _0x4e9bfc=a185_0x26a8;await apiRequest(_0x4e9bfc(0x123),{'method':_0x4e9bfc(0x15f),'body':{'id':_0x3e5564}});}export async function listPermitRoles(_0x13a2da,_0x5aa2e0){const _0x511b4e=a185_0x26a8,_0x57f463=await apiRequest(_0x511b4e(0x162),{'method':_0x511b4e(0x15f),'body':{'appCode':_0x13a2da,..._0x5aa2e0?.[_0x511b4e(0xb4)]!==undefined?{'needSelf':_0x5aa2e0[_0x511b4e(0xb4)]}:{},..._0x5aa2e0?.[_0x511b4e(0x142)]!==undefined?{'needPublic':_0x5aa2e0[_0x511b4e(0x142)]}:{}}});return extractList(_0x57f463[_0x511b4e(0x90)]);}export async function getRoleMenuResources(_0x9e7897,_0x989a5c){const _0x408b88=a185_0x26a8,_0x56071a=await apiRequest(_0x408b88(0xca),{'method':_0x408b88(0x15f),'body':{'appCode':_0x9e7897,'roleId':_0x989a5c}});return extractList(_0x56071a[_0x408b88(0x90)]);}export async function getRoleApiResources(_0x243e80,_0x5cf2d5){const _0x6fd572=a185_0x26a8,_0xfdc828=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x6fd572(0x15f),'body':{'appCode':_0x243e80,'roleId':_0x5cf2d5}});return extractList(_0xfdc828['data']);}export async function listRoleUsers(_0x389ca0){const _0x3d260b=a185_0x26a8,_0x5613de=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':'POST','body':{'appCode':_0x389ca0}});return extractList(_0x5613de[_0x3d260b(0x90)]);}export async function updateRoleUsers(_0x32d515,_0x2bf2dd){const _0x7546fb=a185_0x26a8;await apiRequest(_0x7546fb(0x134),{'method':_0x7546fb(0x15f),'body':{'appCode':_0x32d515,'roleList':_0x2bf2dd}});}export async function getPagePermit(_0x467e6c){const _0x14efab=a185_0x26a8,_0x8177de=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x467e6c}));return _0x8177de[_0x14efab(0x90)];}export async function savePagePermit(_0x3ffe4a){const _0xe80a9=a185_0x26a8,_0x2f7d6c=await apiRequest(_0xe80a9(0xc8),{'method':_0xe80a9(0x15f),'body':_0x3ffe4a});return _0x2f7d6c[_0xe80a9(0x90)];}export async function getTenantMembers(_0x4e753f){const _0x4c80a3=a185_0x26a8,_0x32cdbf=await apiRequest(_0x4c80a3(0x156)+buildQuery({'code':_0x4e753f})),_0xdd51c5=_0x32cdbf[_0x4c80a3(0x90)]??{},_0x3ae246=Array[_0x4c80a3(0x169)](_0xdd51c5?.['userTenantRelationList'])?_0xdd51c5[_0x4c80a3(0x125)]:[];return _0x3ae246[_0x4c80a3(0x135)](_0x3a82b4=>_0x3a82b4?.[_0x4c80a3(0x15d)]==='ENABLE'||_0x3a82b4?.[_0x4c80a3(0x15d)]===undefined)[_0x4c80a3(0xfc)](_0x225ec6=>({'userId':Number(_0x225ec6[_0x4c80a3(0x153)]??_0x225ec6['id']),'username':_0x225ec6[_0x4c80a3(0xdd)],'nickname':_0x225ec6[_0x4c80a3(0x133)],'status':_0x225ec6['status'],'email':_0x225ec6[_0x4c80a3(0xf9)],'mobile':_0x225ec6['mobile'],'avatar':_0x225ec6[_0x4c80a3(0xa9)]}))[_0x4c80a3(0x135)](_0x470086=>Number[_0x4c80a3(0x98)](_0x470086[_0x4c80a3(0x153)])&&_0x470086[_0x4c80a3(0x153)]>0x0);}
@@ -1 +1 @@
1
- const a186_0x58f6e6=a186_0x37ec;function a186_0x37ec(_0x58bd16,_0x1d402e){_0x58bd16=_0x58bd16-0xa1;const _0x121fe3=a186_0x121f();let _0x37ec88=_0x121fe3[_0x58bd16];return _0x37ec88;}(function(_0x55e236,_0x2397b5){const _0x9ac464=a186_0x37ec,_0x1a3f09=_0x55e236();while(!![]){try{const _0x1e99dc=parseInt(_0x9ac464(0xa7))/0x1*(parseInt(_0x9ac464(0xab))/0x2)+-parseInt(_0x9ac464(0xac))/0x3*(parseInt(_0x9ac464(0xa5))/0x4)+parseInt(_0x9ac464(0xa9))/0x5+parseInt(_0x9ac464(0xa2))/0x6*(-parseInt(_0x9ac464(0xaa))/0x7)+parseInt(_0x9ac464(0xa6))/0x8*(parseInt(_0x9ac464(0xaf))/0x9)+parseInt(_0x9ac464(0xa4))/0xa+-parseInt(_0x9ac464(0xb0))/0xb*(parseInt(_0x9ac464(0xad))/0xc);if(_0x1e99dc===_0x2397b5)break;else _0x1a3f09['push'](_0x1a3f09['shift']());}catch(_0x55ada3){_0x1a3f09['push'](_0x1a3f09['shift']());}}}(a186_0x121f,0x71854));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a186_0x121f(){const _0x113bba=['2209976NbmJmE','36071YdUWmc','bff.lock.json','3492595zQCavw','2422YZkkIY','30rsflOR','1155849fzTzwn','24idlqdA','.rabetbase','9ZFcAdf','4706746jGcwOh','bff','10626RjWrdt','bff-trash','8029700WTOvkp','4OVrcbx'];a186_0x121f=function(){return _0x113bba;};return a186_0x121f();}const DOT_DIR=a186_0x58f6e6(0xae),LOCK_FILE_NAME=a186_0x58f6e6(0xa8),TRASH_DIR_NAME=a186_0x58f6e6(0xa3);export function loadBffProjectConfig(_0x9e1442,_0x158114){const _0x2fa4e6=a186_0x58f6e6,_0x30de13=resolve(_0x158114??findProjectRootDirectory()),_0x38087e=DOT_DIR+'/bff',_0x4c91cb=_0x38087e+'/'+_0x9e1442;return{'projectRoot':_0x30de13,'appCode':_0x9e1442,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x38087e,'scriptsRoot':_0x4c91cb,'scriptsRootDir':resolve(_0x30de13,DOT_DIR,_0x2fa4e6(0xa1),_0x9e1442),'lockFilePath':resolve(_0x30de13,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30de13,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a186_0x4c1b7e=a186_0x2e6a;(function(_0x41c69f,_0x302375){const _0x197045=a186_0x2e6a,_0x226d0d=_0x41c69f();while(!![]){try{const _0x54ee44=-parseInt(_0x197045(0xff))/0x1*(parseInt(_0x197045(0xfe))/0x2)+-parseInt(_0x197045(0x103))/0x3*(-parseInt(_0x197045(0x102))/0x4)+-parseInt(_0x197045(0x105))/0x5+parseInt(_0x197045(0x100))/0x6+parseInt(_0x197045(0x106))/0x7*(-parseInt(_0x197045(0x104))/0x8)+parseInt(_0x197045(0x107))/0x9+-parseInt(_0x197045(0xfd))/0xa;if(_0x54ee44===_0x302375)break;else _0x226d0d['push'](_0x226d0d['shift']());}catch(_0x1c9b3c){_0x226d0d['push'](_0x226d0d['shift']());}}}(a186_0x332e,0xb9757));function a186_0x2e6a(_0xd68ba1,_0x29275c){_0xd68ba1=_0xd68ba1-0xfd;const _0x332e42=a186_0x332e();let _0x2e6a06=_0x332e42[_0xd68ba1];return _0x2e6a06;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a186_0x4c1b7e(0x101),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x444310,_0x12b3ee){const _0x25455a=resolve(_0x12b3ee??findProjectRootDirectory()),_0x293177=DOT_DIR+'/bff',_0x1c1183=_0x293177+'/'+_0x444310;return{'projectRoot':_0x25455a,'appCode':_0x444310,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x293177,'scriptsRoot':_0x1c1183,'scriptsRootDir':resolve(_0x25455a,DOT_DIR,'bff',_0x444310),'lockFilePath':resolve(_0x25455a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x25455a,DOT_DIR,TRASH_DIR_NAME)};}function a186_0x332e(){const _0x350a3f=['5431428IvEWtd','.rabetbase','4RleeHi','4419279dGrfOv','17968dLvQtz','3576225srpwBZ','1211mNTxCi','11790720cKKlVb','11201170JdhhwJ','352426ylzOCR','4BKClZz'];a186_0x332e=function(){return _0x350a3f;};return a186_0x332e();}
@@ -1 +1 @@
1
- const a187_0x1f997c=a187_0xef5f;(function(_0x423d6a,_0x267dd8){const _0x39cfe5=a187_0xef5f,_0x1ea220=_0x423d6a();while(!![]){try{const _0x438a65=parseInt(_0x39cfe5(0x7a))/0x1+-parseInt(_0x39cfe5(0x90))/0x2*(-parseInt(_0x39cfe5(0x95))/0x3)+-parseInt(_0x39cfe5(0x99))/0x4+parseInt(_0x39cfe5(0x7c))/0x5+parseInt(_0x39cfe5(0x94))/0x6*(-parseInt(_0x39cfe5(0x9b))/0x7)+parseInt(_0x39cfe5(0x92))/0x8*(parseInt(_0x39cfe5(0x7d))/0x9)+-parseInt(_0x39cfe5(0x78))/0xa*(parseInt(_0x39cfe5(0x91))/0xb);if(_0x438a65===_0x267dd8)break;else _0x1ea220['push'](_0x1ea220['shift']());}catch(_0x1813b8){_0x1ea220['push'](_0x1ea220['shift']());}}}(a187_0x4cf5,0x59ca9));function a187_0x4cf5(){const _0x58f83f=['319FKzbgD','16oFhokb','COMMON','27138jcuSrO','63hjhnLw','ENDPOINT','ENOENT','push','2860168QdWMyp','includes','14SAPYiq','scriptType','code','after','split','map','138290RpTkPS','trim','229837GLBGqi','isDirectory','3413420eVRquk','137853vbAKRH','HOOK','alias','all','beforeScriptId','toUpperCase','functionName','.js','endsWith','get','HOOK/','replace','set','operationType','afterScriptId','isFile','name','scriptsRootDir','datasetCode','52358vYmCDl'];a187_0x4cf5=function(){return _0x58f83f;};return a187_0x4cf5();}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';function a187_0xef5f(_0x4635ec,_0xcd6af4){_0x4635ec=_0x4635ec-0x78;const _0x4cf508=a187_0x4cf5();let _0xef5f18=_0x4cf508[_0x4635ec];return _0xef5f18;}export const SUPPORTED_BFF_TYPES=[a187_0x1f997c(0x93),a187_0x1f997c(0x96),a187_0x1f997c(0x7e)];export function normalizeBffType(_0x4f710a){const _0x18f5f9=a187_0x1f997c;if(!_0x4f710a)return undefined;const _0x73c223=_0x4f710a[_0x18f5f9(0x79)]()[_0x18f5f9(0x82)]();return SUPPORTED_BFF_TYPES[_0x18f5f9(0x9a)](_0x73c223)?_0x73c223:undefined;}async function scanJsFilesRecursively(_0x33a18b,_0x29551b){const _0x52c009=a187_0x1f997c,_0x21a365=[];try{const _0x52d557=await readdir(_0x33a18b,{'withFileTypes':!![]});for(const _0x32d1a4 of _0x52d557){const _0x1da90c=join(_0x33a18b,_0x32d1a4[_0x52c009(0x8d)]);if(_0x32d1a4[_0x52c009(0x7b)]())_0x21a365[_0x52c009(0x98)](...await scanJsFilesRecursively(_0x1da90c,_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)]));else _0x32d1a4['isFile']()&&_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x85)](_0x52c009(0x84))&&_0x21a365[_0x52c009(0x98)]({'lockKey':_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x88)](/\.js$/,''),'filePath':_0x1da90c});}}catch(_0x4e64a6){if(_0x4e64a6[_0x52c009(0x9d)]!==_0x52c009(0x97))throw _0x4e64a6;}return _0x21a365;}async function scanFlatFunctions(_0x3195f3,_0x1eb66f){const _0x42c88e=a187_0x1f997c,_0xa13f09=join(_0x3195f3[_0x42c88e(0x8e)],_0x1eb66f),_0x13795b=await scanJsFilesRecursively(_0xa13f09,_0x1eb66f);return _0x13795b[_0x42c88e(0xa0)](({lockKey:_0x1291cc,filePath:_0x54a39d})=>({'type':_0x1eb66f,'name':_0x1291cc['split']('/')['at'](-0x1)??'','filePath':_0x54a39d,'lockKey':_0x1291cc}));}async function scanHookFunctions(_0x741bed){const _0x1bed4f=a187_0x1f997c,_0xf90343=join(_0x741bed['scriptsRootDir'],_0x1bed4f(0x7e)),_0x4f327e=[];try{const _0x4cc463=await readdir(_0xf90343,{'withFileTypes':!![]});for(const _0x53cdb7 of _0x4cc463){if(!_0x53cdb7['isDirectory']())continue;const _0x24ae9e=_0x53cdb7[_0x1bed4f(0x8d)],_0x561299=join(_0xf90343,_0x24ae9e),_0x2112af=await readdir(_0x561299,{'withFileTypes':!![]});for(const _0x3510d7 of _0x2112af){if(!_0x3510d7[_0x1bed4f(0x7b)]())continue;const _0x43f660=_0x3510d7['name'],_0x40f6bb=join(_0x561299,_0x43f660),_0x5fd6f7=await readdir(_0x40f6bb,{'withFileTypes':!![]});for(const _0x233752 of _0x5fd6f7){if(!_0x233752[_0x1bed4f(0x7b)]())continue;const _0x241c8b=_0x233752[_0x1bed4f(0x8d)],_0x4b2fa0=join(_0x40f6bb,_0x241c8b),_0x544c8b=await readdir(_0x4b2fa0,{'withFileTypes':!![]});for(const _0x5d5f9f of _0x544c8b){if(!_0x5d5f9f[_0x1bed4f(0x8c)]()||!_0x5d5f9f[_0x1bed4f(0x8d)]['endsWith']('.js'))continue;const _0x30cec0=_0x5d5f9f[_0x1bed4f(0x8d)][_0x1bed4f(0x88)](/\.js$/,'');_0x4f327e[_0x1bed4f(0x98)]({'type':_0x1bed4f(0x7e),'name':_0x30cec0,'filePath':join(_0x4b2fa0,_0x5d5f9f['name']),'lockKey':'HOOK/'+_0x24ae9e+'/'+_0x43f660+'/'+_0x241c8b+'/'+_0x30cec0,'alias':_0x24ae9e,'operationType':_0x43f660,'functionNode':_0x241c8b});}}}}}catch(_0x9f3a64){if(_0x9f3a64[_0x1bed4f(0x9d)]!=='ENOENT')throw _0x9f3a64;}return _0x4f327e;}export async function scanLocalBffFunctions(_0x38f4bb,_0x4d454b){const _0x4d233f=a187_0x1f997c;if(_0x4d454b===_0x4d233f(0x93)||_0x4d454b===_0x4d233f(0x96))return scanFlatFunctions(_0x38f4bb,_0x4d454b);if(_0x4d454b===_0x4d233f(0x7e))return scanHookFunctions(_0x38f4bb);const [_0x467051,_0x5296e5,_0x42ecee]=await Promise[_0x4d233f(0x80)]([scanFlatFunctions(_0x38f4bb,_0x4d233f(0x93)),scanFlatFunctions(_0x38f4bb,_0x4d233f(0x96)),scanHookFunctions(_0x38f4bb)]);return[..._0x467051,..._0x5296e5,..._0x42ecee];}export function resolveLocalFilePathFromLockKey(_0x7f2fb6,_0x548657){const _0x3ae176=a187_0x1f997c;return join(_0x7f2fb6[_0x3ae176(0x8e)],..._0x548657[_0x3ae176(0x9f)]('/'))+'.js';}export function createHookLocationMap(_0x59540c){const _0x21bb34=a187_0x1f997c,_0x1f00b2=new Map();for(const _0x4ecc40 of _0x59540c){_0x4ecc40[_0x21bb34(0x81)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40['beforeScriptId'],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40[_0x21bb34(0x8a)]),'functionNode':'before'}),_0x4ecc40[_0x21bb34(0x8b)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40[_0x21bb34(0x8b)],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40['operationType']),'functionNode':_0x21bb34(0x9e)});}return _0x1f00b2;}export function resolveRemoteScriptTarget(_0x5dd399,_0xe82ee6,_0x424c94,_0x38c167,_0xb43ba0){const _0x52ab08=a187_0x1f997c,_0x361a9e=normalizeBffType(_0xe82ee6[_0x52ab08(0x9c)]);if(!_0x361a9e||!_0xe82ee6['functionName'])return null;if(_0x361a9e===_0x52ab08(0x7e)){const _0x4bd72e=(_0xe82ee6['id']?_0x424c94[_0x52ab08(0x86)](_0xe82ee6['id']):undefined)??findHookLocationByRemoteId(_0x38c167,_0xe82ee6['id']);if(!_0x4bd72e)return null;const _0x23b1d3=_0x4bd72e[_0x52ab08(0x7f)]||_0xb43ba0[_0x52ab08(0x86)](_0x4bd72e[_0x52ab08(0x8f)]),_0xec217b=_0x23b1d3??_0x4bd72e['datasetCode'],_0xe1d413={..._0x4bd72e,'alias':_0x23b1d3},_0x3779dd=_0x52ab08(0x87)+_0xec217b+'/'+_0xe1d413[_0x52ab08(0x8a)]+'/'+_0xe1d413['functionNode']+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x3779dd,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x3779dd),'type':_0x52ab08(0x7e),'hookLocation':_0xe1d413};}const _0x5d9ed8=_0x361a9e+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x5d9ed8,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x5d9ed8),'type':_0x361a9e};}export async function ensureParentDirectory(_0x1644ec){await mkdir(dirname(_0x1644ec),{'recursive':!![]});}export async function fileExists(_0x357a51){try{return await access(_0x357a51,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x23a83c){try{const _0x85dcdb=await stat(_0x23a83c);return _0x85dcdb['isDirectory']();}catch{return![];}}
1
+ function a187_0x3d56(){const _0x41fb7c=['2135068IKhYSz','scriptsRootDir','HOOK','name','code','6188728zvwsVJ','trim','after','isDirectory','functionName','endsWith','before','HOOK/','includes','split','toUpperCase','COMMON','1240260uvEYOF','ENDPOINT','afterScriptId','110146ysFmmu','alias','push','134379QxOMHh','329376jCfOtR','4908085yaTOBc','scriptType','21RorUoL','.js','set','beforeScriptId','datasetCode','isFile','ENOENT','get','operationType','replace'];a187_0x3d56=function(){return _0x41fb7c;};return a187_0x3d56();}const a187_0x430065=a187_0x23a9;(function(_0x199518,_0x7c51a0){const _0xe1d48=a187_0x23a9,_0x3d0044=_0x199518();while(!![]){try{const _0x562dc9=-parseInt(_0xe1d48(0x112))/0x1+-parseInt(_0xe1d48(0x10f))/0x2*(parseInt(_0xe1d48(0x116))/0x3)+-parseInt(_0xe1d48(0x120))/0x4+parseInt(_0xe1d48(0x10c))/0x5+parseInt(_0xe1d48(0x113))/0x6+parseInt(_0xe1d48(0x114))/0x7+parseInt(_0xe1d48(0x125))/0x8;if(_0x562dc9===_0x7c51a0)break;else _0x3d0044['push'](_0x3d0044['shift']());}catch(_0x728eb){_0x3d0044['push'](_0x3d0044['shift']());}}}(a187_0x3d56,0xb0c45));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=[a187_0x430065(0x10b),a187_0x430065(0x10d),a187_0x430065(0x122)];export function normalizeBffType(_0x33aa82){const _0xc83d13=a187_0x430065;if(!_0x33aa82)return undefined;const _0xc58b80=_0x33aa82[_0xc83d13(0x126)]()[_0xc83d13(0x10a)]();return SUPPORTED_BFF_TYPES[_0xc83d13(0x108)](_0xc58b80)?_0xc58b80:undefined;}async function scanJsFilesRecursively(_0x3b053c,_0x4113d9){const _0x13407f=a187_0x430065,_0x3fc41f=[];try{const _0x464eb5=await readdir(_0x3b053c,{'withFileTypes':!![]});for(const _0x540800 of _0x464eb5){const _0x160d4c=join(_0x3b053c,_0x540800[_0x13407f(0x123)]);if(_0x540800[_0x13407f(0x128)]())_0x3fc41f[_0x13407f(0x111)](...await scanJsFilesRecursively(_0x160d4c,_0x4113d9+'/'+_0x540800[_0x13407f(0x123)]));else _0x540800[_0x13407f(0x11b)]()&&_0x540800[_0x13407f(0x123)][_0x13407f(0x12a)](_0x13407f(0x117))&&_0x3fc41f[_0x13407f(0x111)]({'lockKey':_0x4113d9+'/'+_0x540800[_0x13407f(0x123)]['replace'](/\.js$/,''),'filePath':_0x160d4c});}}catch(_0x1ecab7){if(_0x1ecab7['code']!==_0x13407f(0x11c))throw _0x1ecab7;}return _0x3fc41f;}async function scanFlatFunctions(_0x49e7da,_0x3913c6){const _0x24d372=a187_0x430065,_0x4de1e1=join(_0x49e7da[_0x24d372(0x121)],_0x3913c6),_0x56d131=await scanJsFilesRecursively(_0x4de1e1,_0x3913c6);return _0x56d131['map'](({lockKey:_0x5a88e3,filePath:_0x4af7e0})=>({'type':_0x3913c6,'name':_0x5a88e3['split']('/')['at'](-0x1)??'','filePath':_0x4af7e0,'lockKey':_0x5a88e3}));}async function scanHookFunctions(_0x3dfbb1){const _0x55154b=a187_0x430065,_0x23deba=join(_0x3dfbb1[_0x55154b(0x121)],'HOOK'),_0x5770af=[];try{const _0x45b747=await readdir(_0x23deba,{'withFileTypes':!![]});for(const _0x38e1b3 of _0x45b747){if(!_0x38e1b3[_0x55154b(0x128)]())continue;const _0x523f03=_0x38e1b3[_0x55154b(0x123)],_0x4827fc=join(_0x23deba,_0x523f03),_0x130cca=await readdir(_0x4827fc,{'withFileTypes':!![]});for(const _0x42bae6 of _0x130cca){if(!_0x42bae6[_0x55154b(0x128)]())continue;const _0x320ab9=_0x42bae6['name'],_0x1201c8=join(_0x4827fc,_0x320ab9),_0x2755ac=await readdir(_0x1201c8,{'withFileTypes':!![]});for(const _0x3a20b2 of _0x2755ac){if(!_0x3a20b2[_0x55154b(0x128)]())continue;const _0x1166f2=_0x3a20b2[_0x55154b(0x123)],_0x409ad1=join(_0x1201c8,_0x1166f2),_0x662494=await readdir(_0x409ad1,{'withFileTypes':!![]});for(const _0x46b32c of _0x662494){if(!_0x46b32c[_0x55154b(0x11b)]()||!_0x46b32c['name'][_0x55154b(0x12a)]('.js'))continue;const _0x350af1=_0x46b32c[_0x55154b(0x123)][_0x55154b(0x11f)](/\.js$/,'');_0x5770af[_0x55154b(0x111)]({'type':_0x55154b(0x122),'name':_0x350af1,'filePath':join(_0x409ad1,_0x46b32c[_0x55154b(0x123)]),'lockKey':_0x55154b(0x107)+_0x523f03+'/'+_0x320ab9+'/'+_0x1166f2+'/'+_0x350af1,'alias':_0x523f03,'operationType':_0x320ab9,'functionNode':_0x1166f2});}}}}}catch(_0x3cb33f){if(_0x3cb33f[_0x55154b(0x124)]!==_0x55154b(0x11c))throw _0x3cb33f;}return _0x5770af;}export async function scanLocalBffFunctions(_0xa4bcec,_0x320cbe){const _0x2b7fc4=a187_0x430065;if(_0x320cbe==='COMMON'||_0x320cbe===_0x2b7fc4(0x10d))return scanFlatFunctions(_0xa4bcec,_0x320cbe);if(_0x320cbe===_0x2b7fc4(0x122))return scanHookFunctions(_0xa4bcec);const [_0x295eaa,_0x1b7e88,_0x383d99]=await Promise['all']([scanFlatFunctions(_0xa4bcec,'COMMON'),scanFlatFunctions(_0xa4bcec,'ENDPOINT'),scanHookFunctions(_0xa4bcec)]);return[..._0x295eaa,..._0x1b7e88,..._0x383d99];}export function resolveLocalFilePathFromLockKey(_0x4e3112,_0x444d57){const _0x33d544=a187_0x430065;return join(_0x4e3112[_0x33d544(0x121)],..._0x444d57[_0x33d544(0x109)]('/'))+_0x33d544(0x117);}export function createHookLocationMap(_0x3801dd){const _0x1d58c0=a187_0x430065,_0x4b71c9=new Map();for(const _0x188d91 of _0x3801dd){_0x188d91['beforeScriptId']&&_0x4b71c9[_0x1d58c0(0x118)](_0x188d91[_0x1d58c0(0x119)],{'datasetCode':_0x188d91['datasetCode'],'operationType':snakeToCamel(_0x188d91[_0x1d58c0(0x11e)]),'functionNode':_0x1d58c0(0x106)}),_0x188d91['afterScriptId']&&_0x4b71c9[_0x1d58c0(0x118)](_0x188d91[_0x1d58c0(0x10e)],{'datasetCode':_0x188d91['datasetCode'],'operationType':snakeToCamel(_0x188d91[_0x1d58c0(0x11e)]),'functionNode':_0x1d58c0(0x127)});}return _0x4b71c9;}export function resolveRemoteScriptTarget(_0x463f15,_0x2849b8,_0x5a7321,_0x3bb925,_0x20799e){const _0x306db4=a187_0x430065,_0x24847a=normalizeBffType(_0x2849b8[_0x306db4(0x115)]);if(!_0x24847a||!_0x2849b8['functionName'])return null;if(_0x24847a===_0x306db4(0x122)){const _0x42ca36=(_0x2849b8['id']?_0x5a7321[_0x306db4(0x11d)](_0x2849b8['id']):undefined)??findHookLocationByRemoteId(_0x3bb925,_0x2849b8['id']);if(!_0x42ca36)return null;const _0x155966=_0x42ca36[_0x306db4(0x110)]||_0x20799e['get'](_0x42ca36[_0x306db4(0x11a)]),_0x3baff4=_0x155966??_0x42ca36[_0x306db4(0x11a)],_0x22e955={..._0x42ca36,'alias':_0x155966},_0x365eaf=_0x306db4(0x107)+_0x3baff4+'/'+_0x22e955[_0x306db4(0x11e)]+'/'+_0x22e955['functionNode']+'/'+_0x2849b8[_0x306db4(0x129)];return{'lockKey':_0x365eaf,'filePath':resolveLocalFilePathFromLockKey(_0x463f15,_0x365eaf),'type':_0x306db4(0x122),'hookLocation':_0x22e955};}const _0x134227=_0x24847a+'/'+_0x2849b8[_0x306db4(0x129)];return{'lockKey':_0x134227,'filePath':resolveLocalFilePathFromLockKey(_0x463f15,_0x134227),'type':_0x24847a};}export async function ensureParentDirectory(_0x5ce220){await mkdir(dirname(_0x5ce220),{'recursive':!![]});}function a187_0x23a9(_0x136612,_0x669d19){_0x136612=_0x136612-0x106;const _0x3d5622=a187_0x3d56();let _0x23a9e3=_0x3d5622[_0x136612];return _0x23a9e3;}export async function fileExists(_0x149ea5){try{return await access(_0x149ea5,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x2e53de){const _0x2a1969=a187_0x430065;try{const _0x591d5f=await stat(_0x2e53de);return _0x591d5f[_0x2a1969(0x128)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2179a9,_0x28d9bc){const _0x2d7b88=a188_0x2868,_0x476c25=_0x2179a9();while(!![]){try{const _0x5a2849=parseInt(_0x2d7b88(0xef))/0x1*(-parseInt(_0x2d7b88(0xee))/0x2)+parseInt(_0x2d7b88(0xf0))/0x3*(-parseInt(_0x2d7b88(0xf8))/0x4)+parseInt(_0x2d7b88(0xf4))/0x5+-parseInt(_0x2d7b88(0xfc))/0x6*(parseInt(_0x2d7b88(0xf5))/0x7)+parseInt(_0x2d7b88(0xf3))/0x8+parseInt(_0x2d7b88(0xf7))/0x9+-parseInt(_0x2d7b88(0xf2))/0xa*(-parseInt(_0x2d7b88(0xfd))/0xb);if(_0x5a2849===_0x28d9bc)break;else _0x476c25['push'](_0x476c25['shift']());}catch(_0x1c88e1){_0x476c25['push'](_0x476c25['shift']());}}}(a188_0x211b,0x5ee50));function a188_0x2868(_0xc77b2e,_0x13b93a){_0xc77b2e=_0xc77b2e-0xee;const _0x211b2a=a188_0x211b();let _0x2868cc=_0x211b2a[_0xc77b2e];return _0x2868cc;}import{readFile}from'node:fs/promises';function a188_0x211b(){const _0x310741=['1812340EofUsG','4579864NDIYFy','3828280EdOBHk','763kycteb','digest','2484171RLPcdd','1309972SQTVrX','hex','createHash','update','14874WcShdT','11HxAwOw','74078yTBvPf','13TJWrdv','6wSVaiu','md5'];a188_0x211b=function(){return _0x310741;};return a188_0x211b();}import a188_0x2b2288 from'node:crypto';export function computeContentHash(_0x4a0a89){const _0x3493d2=a188_0x2868;return a188_0x2b2288[_0x3493d2(0xfa)](_0x3493d2(0xf1))[_0x3493d2(0xfb)](_0x4a0a89)[_0x3493d2(0xf6)](_0x3493d2(0xf9));}export async function computeFileHash(_0x5e95ea){const _0x1a5d98=await readFile(_0x5e95ea,'utf8');return computeContentHash(_0x1a5d98);}
1
+ (function(_0x52a9df,_0x5118c4){const _0xd1a14=a188_0x2c94,_0x46fcbc=_0x52a9df();while(!![]){try{const _0x1fc1e9=-parseInt(_0xd1a14(0x1d7))/0x1*(-parseInt(_0xd1a14(0x1de))/0x2)+-parseInt(_0xd1a14(0x1e2))/0x3+parseInt(_0xd1a14(0x1e1))/0x4+parseInt(_0xd1a14(0x1e0))/0x5+parseInt(_0xd1a14(0x1e3))/0x6*(parseInt(_0xd1a14(0x1e4))/0x7)+-parseInt(_0xd1a14(0x1d9))/0x8*(-parseInt(_0xd1a14(0x1d6))/0x9)+-parseInt(_0xd1a14(0x1dd))/0xa*(parseInt(_0xd1a14(0x1d5))/0xb);if(_0x1fc1e9===_0x5118c4)break;else _0x46fcbc['push'](_0x46fcbc['shift']());}catch(_0x5c3576){_0x46fcbc['push'](_0x46fcbc['shift']());}}}(a188_0x185a,0x4927e));import{readFile}from'node:fs/promises';function a188_0x2c94(_0x4d555d,_0x10d81b){_0x4d555d=_0x4d555d-0x1d5;const _0x185aed=a188_0x185a();let _0x2c949f=_0x185aed[_0x4d555d];return _0x2c949f;}import a188_0x1cf704 from'node:crypto';function a188_0x185a(){const _0x6c9ef8=['hex','digest','80MkLIsL','50ONygPU','utf8','870780CXYDUK','927124ghOCah','709887VXHqRs','584478APmHod','42IWOaGo','1753609SGSfey','666TNsBHi','22746kXJMQZ','md5','27304heIxZU','update'];a188_0x185a=function(){return _0x6c9ef8;};return a188_0x185a();}export function computeContentHash(_0x57dd74){const _0x271fce=a188_0x2c94;return a188_0x1cf704['createHash'](_0x271fce(0x1d8))[_0x271fce(0x1da)](_0x57dd74)[_0x271fce(0x1dc)](_0x271fce(0x1db));}export async function computeFileHash(_0x40d098){const _0x5a5d64=a188_0x2c94,_0x3498eb=await readFile(_0x40d098,_0x5a5d64(0x1df));return computeContentHash(_0x3498eb);}
@@ -1 +1 @@
1
- (function(_0x48168f,_0x2a7c7c){const _0x432232=a189_0x5901,_0x426cd1=_0x48168f();while(!![]){try{const _0x4ab67d=-parseInt(_0x432232(0x99))/0x1+parseInt(_0x432232(0x93))/0x2*(-parseInt(_0x432232(0x8a))/0x3)+-parseInt(_0x432232(0x94))/0x4*(-parseInt(_0x432232(0x8e))/0x5)+parseInt(_0x432232(0x91))/0x6*(-parseInt(_0x432232(0x9a))/0x7)+parseInt(_0x432232(0x9b))/0x8+parseInt(_0x432232(0x9c))/0x9+parseInt(_0x432232(0x86))/0xa;if(_0x4ab67d===_0x2a7c7c)break;else _0x426cd1['push'](_0x426cd1['shift']());}catch(_0xbaa5e6){_0x426cd1['push'](_0x426cd1['shift']());}}}(a189_0x41a7,0xb665e));import{mkdir,readFile,writeFile}from'node:fs/promises';function a189_0x41a7(){const _0x1eed24=['utf8','code','scriptsRoot','940085pFmQtR','240562GCxkeB','10099904sfWDiM','2453175YmoRwn','current\x20\x22','6490480kdyOYR',':\x20scriptsRoot\x20mismatch\x20—\x20','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22.\x20','6cJlgIV','apps','object','lastSync','20JNRmpi','ENOENT','functions','186XoPkGT','parse','870518Dctktj','1438940MPCDMP','stringify'];a189_0x41a7=function(){return _0x1eed24;};return a189_0x41a7();}import{dirname}from'node:path';function a189_0x5901(_0x5f3a67,_0x739e3d){_0x5f3a67=_0x5f3a67-0x86;const _0x41a7d3=a189_0x41a7();let _0x5901a2=_0x41a7d3[_0x5f3a67];return _0x5901a2;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x51313e,_0x21ca8d,_0x2b20c7,_0x3d22e2){const _0x34f57c=a189_0x5901,_0x35b987={'apps':_0x51313e[_0x34f57c(0x8b)]&&typeof _0x51313e['apps']===_0x34f57c(0x8c)?_0x51313e[_0x34f57c(0x8b)]:{}};let _0x67081c=_0x35b987[_0x34f57c(0x8b)][_0x21ca8d];if(!_0x67081c)return _0x67081c={'scriptsRoot':_0x2b20c7,'lastSync':'','functions':{}},_0x35b987[_0x34f57c(0x8b)][_0x21ca8d]=_0x67081c,{'lockData':_0x35b987,'appLock':_0x67081c};if(!_0x67081c[_0x34f57c(0x98)])_0x67081c[_0x34f57c(0x98)]=_0x2b20c7;else{if(_0x67081c[_0x34f57c(0x98)]!==_0x2b20c7)throw new Error(_0x3d22e2+_0x34f57c(0x87)+(_0x34f57c(0x9d)+_0x2b20c7+'\x22\x20vs\x20lock\x20\x22'+_0x67081c[_0x34f57c(0x98)]+_0x34f57c(0x89))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x67081c['functions']&&(_0x67081c[_0x34f57c(0x90)]={}),!_0x67081c[_0x34f57c(0x8d)]&&(_0x67081c[_0x34f57c(0x8d)]=''),{'lockData':_0x35b987,'appLock':_0x67081c};}export async function readBffLockFile(_0x58e064){const _0x17ca76=a189_0x5901;try{const _0x226a97=await readFile(_0x58e064,_0x17ca76(0x96)),_0x5e5f9a=JSON[_0x17ca76(0x92)](_0x226a97);return{'apps':_0x5e5f9a[_0x17ca76(0x8b)]&&typeof _0x5e5f9a[_0x17ca76(0x8b)]===_0x17ca76(0x8c)?_0x5e5f9a['apps']:{}};}catch(_0x267b67){if(_0x267b67[_0x17ca76(0x97)]===_0x17ca76(0x8f))return null;throw new Error(_0x17ca76(0x88)+String(_0x267b67));}}export async function writeBffLockFile(_0x1cf1ba,_0x4cac96){const _0x214b8d=a189_0x5901;await mkdir(dirname(_0x1cf1ba),{'recursive':!![]}),await writeFile(_0x1cf1ba,JSON[_0x214b8d(0x95)](_0x4cac96,null,0x2),_0x214b8d(0x96));}
1
+ (function(_0x422dc9,_0x395e09){const _0x51a5c0=a189_0x4f3f,_0x289326=_0x422dc9();while(!![]){try{const _0xb6037b=-parseInt(_0x51a5c0(0xce))/0x1+-parseInt(_0x51a5c0(0xdf))/0x2+-parseInt(_0x51a5c0(0xdd))/0x3+parseInt(_0x51a5c0(0xd4))/0x4+parseInt(_0x51a5c0(0xdb))/0x5*(-parseInt(_0x51a5c0(0xd9))/0x6)+-parseInt(_0x51a5c0(0xd2))/0x7*(parseInt(_0x51a5c0(0xd5))/0x8)+-parseInt(_0x51a5c0(0xcf))/0x9*(-parseInt(_0x51a5c0(0xd1))/0xa);if(_0xb6037b===_0x395e09)break;else _0x289326['push'](_0x289326['shift']());}catch(_0x2e8c0e){_0x289326['push'](_0x289326['shift']());}}}(a189_0xc696,0x76973));function a189_0x4f3f(_0x1645b8,_0x5bdf4a){_0x1645b8=_0x1645b8-0xce;const _0xc696a2=a189_0xc696();let _0x4f3faf=_0xc696a2[_0x1645b8];return _0x4f3faf;}function a189_0xc696(){const _0x1e4920=['468LvPDad','apps','36055bWfHWq','functions','849762cRcCfV','utf8','1386282GDfbnM','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22\x20vs\x20lock\x20\x22','object','308361BIiZzi','2586042cSzaMc','scriptsRoot','70SUnRrA','791gVgLOB','stringify','2613904FiFumf','23496wTcrFt','lastSync',':\x20scriptsRoot\x20mismatch\x20—\x20','\x22.\x20'];a189_0xc696=function(){return _0x1e4920;};return a189_0xc696();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x136b30,_0x46db49,_0x4eb409,_0x36d90a){const _0x5a9031=a189_0x4f3f,_0x214564={'apps':_0x136b30[_0x5a9031(0xda)]&&typeof _0x136b30[_0x5a9031(0xda)]==='object'?_0x136b30[_0x5a9031(0xda)]:{}};let _0x3e095e=_0x214564[_0x5a9031(0xda)][_0x46db49];if(!_0x3e095e)return _0x3e095e={'scriptsRoot':_0x4eb409,'lastSync':'','functions':{}},_0x214564[_0x5a9031(0xda)][_0x46db49]=_0x3e095e,{'lockData':_0x214564,'appLock':_0x3e095e};if(!_0x3e095e[_0x5a9031(0xd0)])_0x3e095e[_0x5a9031(0xd0)]=_0x4eb409;else{if(_0x3e095e[_0x5a9031(0xd0)]!==_0x4eb409)throw new Error(_0x36d90a+_0x5a9031(0xd7)+('current\x20\x22'+_0x4eb409+_0x5a9031(0xe1)+_0x3e095e[_0x5a9031(0xd0)]+_0x5a9031(0xd8))+_0x5a9031(0xe0));}return!_0x3e095e[_0x5a9031(0xdc)]&&(_0x3e095e[_0x5a9031(0xdc)]={}),!_0x3e095e[_0x5a9031(0xd6)]&&(_0x3e095e['lastSync']=''),{'lockData':_0x214564,'appLock':_0x3e095e};}export async function readBffLockFile(_0x15bdc8){const _0x37801b=a189_0x4f3f;try{const _0x443605=await readFile(_0x15bdc8,_0x37801b(0xde)),_0x46076d=JSON['parse'](_0x443605);return{'apps':_0x46076d['apps']&&typeof _0x46076d[_0x37801b(0xda)]===_0x37801b(0xe2)?_0x46076d[_0x37801b(0xda)]:{}};}catch(_0x1a30df){if(_0x1a30df['code']==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x1a30df));}}export async function writeBffLockFile(_0x53e15f,_0x2b1d2c){const _0x3a1add=a189_0x4f3f;await mkdir(dirname(_0x53e15f),{'recursive':!![]}),await writeFile(_0x53e15f,JSON[_0x3a1add(0xd3)](_0x2b1d2c,null,0x2),_0x3a1add(0xde));}
@@ -1 +1 @@
1
- (function(_0x36bdbe,_0xcec665){const _0x11206e=a191_0x230a,_0x33892e=_0x36bdbe();while(!![]){try{const _0x243770=-parseInt(_0x11206e(0x161))/0x1*(parseInt(_0x11206e(0x15f))/0x2)+parseInt(_0x11206e(0x160))/0x3+-parseInt(_0x11206e(0x15b))/0x4*(parseInt(_0x11206e(0x158))/0x5)+parseInt(_0x11206e(0x16c))/0x6+parseInt(_0x11206e(0x16e))/0x7*(parseInt(_0x11206e(0x168))/0x8)+parseInt(_0x11206e(0x166))/0x9*(parseInt(_0x11206e(0x15d))/0xa)+-parseInt(_0x11206e(0x159))/0xb*(parseInt(_0x11206e(0x15e))/0xc);if(_0x243770===_0xcec665)break;else _0x33892e['push'](_0x33892e['shift']());}catch(_0x4d2686){_0x33892e['push'](_0x33892e['shift']());}}}(a191_0x23ea,0x97ac2));export function snakeToCamel(_0x40e152){const _0x222f38=a191_0x230a;return _0x40e152[_0x222f38(0x167)]()[_0x222f38(0x15a)](/_([a-z])/g,(_0x3245a3,_0x874d7e)=>_0x874d7e[_0x222f38(0x165)]());}function a191_0x230a(_0x243242,_0x8bf18e){_0x243242=_0x243242-0x157;const _0x23ea82=a191_0x23ea();let _0x230aa0=_0x23ea82[_0x243242];return _0x230aa0;}export function findHookLocationByRemoteId(_0x530d33,_0x162a45){const _0x32d6d7=a191_0x230a;if(!_0x162a45)return undefined;for(const _0x4fbb8b of Object[_0x32d6d7(0x15c)](_0x530d33)){if(_0x4fbb8b[_0x32d6d7(0x16d)]===_0x162a45&&_0x4fbb8b['datasetCode']&&_0x4fbb8b[_0x32d6d7(0x157)]&&_0x4fbb8b[_0x32d6d7(0x169)])return{'datasetCode':_0x4fbb8b[_0x32d6d7(0x16a)],'operationType':_0x4fbb8b[_0x32d6d7(0x157)],'functionNode':_0x4fbb8b[_0x32d6d7(0x169)]};}return undefined;}export function extractScriptDescription(_0x4debd1){const _0x2c2684=a191_0x230a,_0x4ca502=_0x4debd1['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x4ca502?.[0x1]?.[_0x2c2684(0x163)]()||undefined;}export function isValidBffFunctionName(_0x4820bd){const _0x541da7=a191_0x230a;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x541da7(0x162)](_0x4820bd);}function a191_0x23ea(){const _0x471ad7=['remoteId','50099NtqUHw','operationType','1044275bjXEKz','33eOuVuE','replace','20ZVHDtI','values','66160pIBLNz','2067732mEnPHH','4szQlvW','3670011AUSvxO','380131AFsIjz','test','trim','before','toUpperCase','1080PXuEAm','toLowerCase','376GyxjYh','functionNode','datasetCode','after','3534504tbixEf'];a191_0x23ea=function(){return _0x471ad7;};return a191_0x23ea();}export function normalizeHookFunctionNode(_0x5c1b6){const _0x3a7ff4=a191_0x230a;if(!_0x5c1b6)return undefined;const _0x2e2973=_0x5c1b6[_0x3a7ff4(0x163)]()[_0x3a7ff4(0x167)]();if(_0x2e2973===_0x3a7ff4(0x164)||_0x2e2973===_0x3a7ff4(0x16b))return _0x2e2973;return undefined;}
1
+ function a191_0x424b(){const _0x4b5e70=['test','4460502SZjrHH','trim','before','6353768eoUdtQ','1kgnwUX','7TmorOV','remoteId','2786814BvUXSs','replace','functionNode','50IeQVej','8JXziSm','operationType','toLowerCase','6121585YwDxVZ','match','2397706rUIQCi','datasetCode','after','22393624OwjhLM','1780761gQGLNd'];a191_0x424b=function(){return _0x4b5e70;};return a191_0x424b();}function a191_0x4c8b(_0x5f833d,_0x1fcec7){_0x5f833d=_0x5f833d-0x6d;const _0x424b98=a191_0x424b();let _0x4c8baa=_0x424b98[_0x5f833d];return _0x4c8baa;}(function(_0x206fb6,_0x1ffb91){const _0x50aa3c=a191_0x4c8b,_0xe5a021=_0x206fb6();while(!![]){try{const _0x389611=-parseInt(_0x50aa3c(0x72))/0x1*(-parseInt(_0x50aa3c(0x7e))/0x2)+parseInt(_0x50aa3c(0x82))/0x3*(-parseInt(_0x50aa3c(0x79))/0x4)+-parseInt(_0x50aa3c(0x7c))/0x5+parseInt(_0x50aa3c(0x6e))/0x6*(parseInt(_0x50aa3c(0x73))/0x7)+parseInt(_0x50aa3c(0x71))/0x8+-parseInt(_0x50aa3c(0x75))/0x9*(parseInt(_0x50aa3c(0x78))/0xa)+parseInt(_0x50aa3c(0x81))/0xb;if(_0x389611===_0x1ffb91)break;else _0xe5a021['push'](_0xe5a021['shift']());}catch(_0x67e918){_0xe5a021['push'](_0xe5a021['shift']());}}}(a191_0x424b,0xc660a));export function snakeToCamel(_0x3486a9){const _0x583387=a191_0x4c8b;return _0x3486a9[_0x583387(0x7b)]()[_0x583387(0x76)](/_([a-z])/g,(_0x584c96,_0x45f1e1)=>_0x45f1e1['toUpperCase']());}export function findHookLocationByRemoteId(_0x14deb3,_0xbfbe38){const _0x3e6908=a191_0x4c8b;if(!_0xbfbe38)return undefined;for(const _0x3d9b72 of Object['values'](_0x14deb3)){if(_0x3d9b72[_0x3e6908(0x74)]===_0xbfbe38&&_0x3d9b72[_0x3e6908(0x7f)]&&_0x3d9b72[_0x3e6908(0x7a)]&&_0x3d9b72[_0x3e6908(0x77)])return{'datasetCode':_0x3d9b72[_0x3e6908(0x7f)],'operationType':_0x3d9b72[_0x3e6908(0x7a)],'functionNode':_0x3d9b72[_0x3e6908(0x77)]};}return undefined;}export function extractScriptDescription(_0x2f90cf){const _0x3c66e7=a191_0x4c8b,_0x19968c=_0x2f90cf[_0x3c66e7(0x7d)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x19968c?.[0x1]?.[_0x3c66e7(0x6f)]()||undefined;}export function isValidBffFunctionName(_0xa0d4e6){const _0x56c683=a191_0x4c8b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x56c683(0x6d)](_0xa0d4e6);}export function normalizeHookFunctionNode(_0x23d6ba){const _0x38fbb7=a191_0x4c8b;if(!_0x23d6ba)return undefined;const _0x5a5e04=_0x23d6ba[_0x38fbb7(0x6f)]()['toLowerCase']();if(_0x5a5e04===_0x38fbb7(0x70)||_0x5a5e04===_0x38fbb7(0x80))return _0x5a5e04;return undefined;}
@@ -1 +1 @@
1
- function a192_0x71b6(_0x3d805a,_0x1ebf13){_0x3d805a=_0x3d805a-0x1cd;const _0x15e54d=a192_0x15e5();let _0x71b650=_0x15e54d[_0x3d805a];return _0x71b650;}(function(_0x47c5e5,_0x415483){const _0x186afc=a192_0x71b6,_0x2c70d2=_0x47c5e5();while(!![]){try{const _0x6af745=parseInt(_0x186afc(0x1e3))/0x1*(parseInt(_0x186afc(0x1de))/0x2)+parseInt(_0x186afc(0x1db))/0x3+parseInt(_0x186afc(0x1d7))/0x4*(parseInt(_0x186afc(0x1d1))/0x5)+-parseInt(_0x186afc(0x1dc))/0x6*(-parseInt(_0x186afc(0x1ea))/0x7)+parseInt(_0x186afc(0x1da))/0x8+-parseInt(_0x186afc(0x1e9))/0x9+-parseInt(_0x186afc(0x1cf))/0xa;if(_0x6af745===_0x415483)break;else _0x2c70d2['push'](_0x2c70d2['shift']());}catch(_0x42d38d){_0x2c70d2['push'](_0x2c70d2['shift']());}}}(a192_0x15e5,0x70ac9));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x5c9ff2){const _0x2fb49e=a192_0x71b6;if(cache[_0x2fb49e(0x1d2)](_0x5c9ff2))return cache[_0x2fb49e(0x1e6)](_0x5c9ff2);const _0x4dae3b=await listDatasets(_0x5c9ff2),_0x13b7c8=new Map();for(const _0x56966d of _0x4dae3b){const _0x1a54f3=_0x56966d[_0x2fb49e(0x1e8)];_0x1a54f3?.['dbId']!=null&&_0x13b7c8[_0x2fb49e(0x1e4)](_0x1a54f3[_0x2fb49e(0x1dd)],_0x1a54f3[_0x2fb49e(0x1e2)]??'db-'+_0x1a54f3[_0x2fb49e(0x1dd)]);}const _0x2a106a=[..._0x13b7c8['entries']()][_0x2fb49e(0x1ce)](([_0x5e7399,_0x19813f])=>({'dbId':_0x5e7399,'dbName':_0x19813f}));return cache[_0x2fb49e(0x1e4)](_0x5c9ff2,_0x2a106a),_0x2a106a;}export async function resolveDb(_0x17ec62,_0x55a265){const _0x53c4de=a192_0x71b6,_0x49726d=await listDatabases(_0x17ec62);if(_0x49726d[_0x53c4de(0x1d8)]===0x0)return{'resolved':[],'error':_0x53c4de(0x1cd)+_0x17ec62+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x55a265)return{'resolved':_0x49726d};const _0x4f402f=Number(_0x55a265);if(!Number['isNaN'](_0x4f402f)){const _0x3b3e42=_0x49726d['find'](_0x5a6b3a=>_0x5a6b3a['dbId']===_0x4f402f);if(_0x3b3e42)return{'resolved':[_0x3b3e42]};}const _0xc46c29=_0x55a265[_0x53c4de(0x1e5)](),_0xf4fb99=_0x49726d[_0x53c4de(0x1d3)](_0x561b75=>_0x561b75['dbName']['toLowerCase']()[_0x53c4de(0x1d4)](_0xc46c29));if(_0xf4fb99['length']>0x0)return{'resolved':_0xf4fb99};const _0x1bbb76=_0x49726d['map'](_0x13d90=>_0x13d90[_0x53c4de(0x1e2)]+'\x20('+_0x13d90[_0x53c4de(0x1dd)]+')')[_0x53c4de(0x1d5)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x55a265+_0x53c4de(0x1d9)+_0x17ec62+_0x53c4de(0x1e7)+_0x1bbb76+_0x53c4de(0x1d0)};}export async function resolveOneDb(_0x3933e2,_0x3d3cde){const _0x4c2ed6=a192_0x71b6,{resolved:_0x5d613b,error:_0x5075b4}=await resolveDb(_0x3933e2,_0x3d3cde);if(_0x5075b4)return{'db':null,'error':_0x5075b4};if(_0x5d613b['length']===0x1)return{'db':_0x5d613b[0x0]};if(!_0x3d3cde){const _0xa940ed=_0x5d613b[_0x4c2ed6(0x1ce)](_0x1c46b9=>_0x1c46b9[_0x4c2ed6(0x1e2)]+'\x20('+_0x1c46b9[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':_0x4c2ed6(0x1e1)+_0xa940ed};}const _0x7c42f7=_0x5d613b[_0x4c2ed6(0x1ce)](_0x405d89=>_0x405d89['dbName']+'\x20('+_0x405d89[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':'\x22'+_0x3d3cde+_0x4c2ed6(0x1e0)+_0x7c42f7+_0x4c2ed6(0x1d6)};}export async function getDbName(_0x3db250,_0x1332ff){const _0x59bb26=a192_0x71b6,_0x222b11=await listDatabases(_0x3db250);return _0x222b11[_0x59bb26(0x1df)](_0x559052=>_0x559052[_0x59bb26(0x1dd)]===_0x1332ff)?.[_0x59bb26(0x1e2)];}function a192_0x15e5(){const _0x2878c2=['2747025TeeloL','421734OxIuTu','dbId','122914msgiAU','find','\x22\x20matches\x20multiple\x20databases:\x20','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbName','15VUrLnW','set','toLowerCase','get','\x22.\x20Available:\x20','dbtableConfig','6395760hnKPmt','21eKVQNN','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','17098930bjyvzp','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','145085BgcUJA','has','filter','includes','join','.\x20Be\x20more\x20specific.','20GMkbbV','length','\x22\x20under\x20app\x20\x22','5508512ffqIHP'];a192_0x15e5=function(){return _0x2878c2;};return a192_0x15e5();}
1
+ (function(_0x1b1a1b,_0x57706c){const _0x337f13=a192_0x142f,_0xe6ad35=_0x1b1a1b();while(!![]){try{const _0x47446d=-parseInt(_0x337f13(0x1a2))/0x1*(parseInt(_0x337f13(0x19a))/0x2)+-parseInt(_0x337f13(0x198))/0x3+-parseInt(_0x337f13(0x19f))/0x4*(parseInt(_0x337f13(0x19d))/0x5)+-parseInt(_0x337f13(0x1af))/0x6+-parseInt(_0x337f13(0x1a9))/0x7*(-parseInt(_0x337f13(0x1a4))/0x8)+-parseInt(_0x337f13(0x1ad))/0x9+parseInt(_0x337f13(0x197))/0xa;if(_0x47446d===_0x57706c)break;else _0xe6ad35['push'](_0xe6ad35['shift']());}catch(_0x1e0620){_0xe6ad35['push'](_0xe6ad35['shift']());}}}(a192_0x5b9c,0x32bde));import{listDatasets}from'../core/api-client.js';function a192_0x5b9c(){const _0x353b42=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','toLowerCase','has','7WuHgtK','find','length','\x22\x20matches\x20multiple\x20databases:\x20','3057507CtKztf','join','2073618Wfemjt','isNaN','set','14327050hfTiup','1077957NtOouh','dbtableConfig','8hTFDDB','dbId','\x22.\x20Available:\x20','105DyQglK','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','34644CHfYeZ','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','69262nKLEEl','entries','2229656REVcSl','dbName'];a192_0x5b9c=function(){return _0x353b42;};return a192_0x5b9c();}const cache=new Map();function a192_0x142f(_0x4e435c,_0x472c90){_0x4e435c=_0x4e435c-0x197;const _0x5b9ce7=a192_0x5b9c();let _0x142f12=_0x5b9ce7[_0x4e435c];return _0x142f12;}export async function listDatabases(_0xb34ce3){const _0x2c6155=a192_0x142f;if(cache[_0x2c6155(0x1a8)](_0xb34ce3))return cache['get'](_0xb34ce3);const _0x46d392=await listDatasets(_0xb34ce3),_0x2d6bcc=new Map();for(const _0x1c667e of _0x46d392){const _0x47ffb5=_0x1c667e[_0x2c6155(0x199)];_0x47ffb5?.[_0x2c6155(0x19b)]!=null&&_0x2d6bcc['set'](_0x47ffb5[_0x2c6155(0x19b)],_0x47ffb5[_0x2c6155(0x1a5)]??'db-'+_0x47ffb5[_0x2c6155(0x19b)]);}const _0x364f23=[..._0x2d6bcc[_0x2c6155(0x1a3)]()][_0x2c6155(0x1a1)](([_0xaa1c26,_0x3be8e1])=>({'dbId':_0xaa1c26,'dbName':_0x3be8e1}));return cache[_0x2c6155(0x1b1)](_0xb34ce3,_0x364f23),_0x364f23;}export async function resolveDb(_0x444dae,_0x251352){const _0x18306b=a192_0x142f,_0x250741=await listDatabases(_0x444dae);if(_0x250741[_0x18306b(0x1ab)]===0x0)return{'resolved':[],'error':_0x18306b(0x1a0)+_0x444dae+_0x18306b(0x19e)};if(!_0x251352)return{'resolved':_0x250741};const _0xe636d=Number(_0x251352);if(!Number[_0x18306b(0x1b0)](_0xe636d)){const _0x24e9dd=_0x250741[_0x18306b(0x1aa)](_0x5370cc=>_0x5370cc[_0x18306b(0x19b)]===_0xe636d);if(_0x24e9dd)return{'resolved':[_0x24e9dd]};}const _0x395f42=_0x251352['toLowerCase'](),_0x2d1278=_0x250741['filter'](_0x2d09c2=>_0x2d09c2[_0x18306b(0x1a5)][_0x18306b(0x1a7)]()['includes'](_0x395f42));if(_0x2d1278['length']>0x0)return{'resolved':_0x2d1278};const _0x11d665=_0x250741[_0x18306b(0x1a1)](_0x3a659a=>_0x3a659a[_0x18306b(0x1a5)]+'\x20('+_0x3a659a[_0x18306b(0x19b)]+')')[_0x18306b(0x1ae)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x251352+'\x22\x20under\x20app\x20\x22'+_0x444dae+_0x18306b(0x19c)+_0x11d665+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x46a628,_0x28558d){const _0x22f9dd=a192_0x142f,{resolved:_0x33393d,error:_0x36a2f5}=await resolveDb(_0x46a628,_0x28558d);if(_0x36a2f5)return{'db':null,'error':_0x36a2f5};if(_0x33393d['length']===0x1)return{'db':_0x33393d[0x0]};if(!_0x28558d){const _0x17d8c2=_0x33393d['map'](_0x5c6c60=>_0x5c6c60['dbName']+'\x20('+_0x5c6c60['dbId']+')')[_0x22f9dd(0x1ae)](',\x20');return{'db':null,'error':_0x22f9dd(0x1a6)+_0x17d8c2};}const _0x67ec3f=_0x33393d['map'](_0x37fa12=>_0x37fa12[_0x22f9dd(0x1a5)]+'\x20('+_0x37fa12[_0x22f9dd(0x19b)]+')')[_0x22f9dd(0x1ae)](',\x20');return{'db':null,'error':'\x22'+_0x28558d+_0x22f9dd(0x1ac)+_0x67ec3f+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0xe9c5a0,_0x2cd4a9){const _0x4a7f08=a192_0x142f,_0x3704ea=await listDatabases(_0xe9c5a0);return _0x3704ea['find'](_0x55ee19=>_0x55ee19[_0x4a7f08(0x19b)]===_0x2cd4a9)?.[_0x4a7f08(0x1a5)];}
@@ -1 +1 @@
1
- const a193_0x47c4db=a193_0x2eb7;(function(_0x2bcaa2,_0x20a65e){const _0x46588b=a193_0x2eb7,_0xa62038=_0x2bcaa2();while(!![]){try{const _0x21f547=-parseInt(_0x46588b(0xc8))/0x1*(parseInt(_0x46588b(0xc9))/0x2)+-parseInt(_0x46588b(0xc1))/0x3+-parseInt(_0x46588b(0xc7))/0x4*(-parseInt(_0x46588b(0xbe))/0x5)+-parseInt(_0x46588b(0xc3))/0x6*(-parseInt(_0x46588b(0xc0))/0x7)+-parseInt(_0x46588b(0xcb))/0x8*(parseInt(_0x46588b(0xc6))/0x9)+parseInt(_0x46588b(0xca))/0xa+parseInt(_0x46588b(0xbf))/0xb*(parseInt(_0x46588b(0xc2))/0xc);if(_0x21f547===_0x20a65e)break;else _0xa62038['push'](_0xa62038['shift']());}catch(_0x23d472){_0xa62038['push'](_0xa62038['shift']());}}}(a193_0x4df1,0xb88d8));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a193_0x4df1(){const _0x18d3ad=['11UarmBy','1522801tjmInv','1618668aebAXJ','17092392lpyCwS','6uicVOF','page','.json','2492181HLMoCC','141608xsPqgA','188553siVLDt','8KtGuFX','2535650FyJvDq','16mxjKqM','appPagesDir','cwd','F_OK','100yrHZPE'];a193_0x4df1=function(){return _0x18d3ad;};return a193_0x4df1();}export function loadPageProjectConfig(_0x260ad1,_0x5b247d=process[a193_0x47c4db(0xbc)]()){const _0x2b0371=a193_0x47c4db,_0x2f2a1b=resolve(_0x5b247d),_0xaabf14=join(_0x2f2a1b,'.rabetbase',_0x2b0371(0xc4));return{'projectRoot':_0x2f2a1b,'pagesBaseDir':_0xaabf14,'appPagesDir':join(_0xaabf14,_0x260ad1),'lockFilePath':join(_0x2f2a1b,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x306cc5,_0x67da04){const _0x163737=a193_0x47c4db;return _0x306cc5+'-'+String(_0x67da04)['toUpperCase']()+_0x163737(0xc5);}export function resolvePageFilePath(_0x5cd263,_0x3ce340,_0x498e87){const _0x4f2cd5=a193_0x47c4db;return join(_0x5cd263[_0x4f2cd5(0xcc)],buildPageFileName(_0x3ce340,_0x498e87));}export async function ensureParentDirectory(_0x412a8a){await mkdir(dirname(_0x412a8a),{'recursive':!![]});}function a193_0x2eb7(_0x5941aa,_0x576ecd){_0x5941aa=_0x5941aa-0xbc;const _0x4df189=a193_0x4df1();let _0x2eb754=_0x4df189[_0x5941aa];return _0x2eb754;}export async function fileExists(_0x1da274){const _0x48eebe=a193_0x47c4db;try{return await access(_0x1da274,constants[_0x48eebe(0xbd)]),!![];}catch{return![];}}
1
+ const a193_0x7f2de2=a193_0x3d7a;(function(_0x364037,_0x5222a8){const _0x12719d=a193_0x3d7a,_0x444717=_0x364037();while(!![]){try{const _0x2e2d09=-parseInt(_0x12719d(0x170))/0x1*(parseInt(_0x12719d(0x16c))/0x2)+parseInt(_0x12719d(0x16e))/0x3+parseInt(_0x12719d(0x16a))/0x4+parseInt(_0x12719d(0x16b))/0x5+parseInt(_0x12719d(0x171))/0x6+parseInt(_0x12719d(0x16d))/0x7*(-parseInt(_0x12719d(0x175))/0x8)+parseInt(_0x12719d(0x176))/0x9*(-parseInt(_0x12719d(0x173))/0xa);if(_0x2e2d09===_0x5222a8)break;else _0x444717['push'](_0x444717['shift']());}catch(_0x3d8045){_0x444717['push'](_0x444717['shift']());}}}(a193_0x5e87,0xac38b));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a193_0x5e87(){const _0xe7d8b5=['24110tyMOAp','602SjJgWl','3735183vpvCxC','appPagesDir','115XSXRRu','7457142tLLPKa','cwd','80uLEuer','.json','72056vcXKzj','39519COXZmf','.rabetbase','1145116gVTsCt','636385YTINsr'];a193_0x5e87=function(){return _0xe7d8b5;};return a193_0x5e87();}export function loadPageProjectConfig(_0x92a90b,_0x2df4c6=process[a193_0x7f2de2(0x172)]()){const _0x1a2f8d=a193_0x7f2de2,_0x3c0314=resolve(_0x2df4c6),_0x43d8b5=join(_0x3c0314,_0x1a2f8d(0x177),'page');return{'projectRoot':_0x3c0314,'pagesBaseDir':_0x43d8b5,'appPagesDir':join(_0x43d8b5,_0x92a90b),'lockFilePath':join(_0x3c0314,_0x1a2f8d(0x177),'page.lock.json')};}function a193_0x3d7a(_0x2785b9,_0x34e135){_0x2785b9=_0x2785b9-0x16a;const _0x5e87c2=a193_0x5e87();let _0x3d7a49=_0x5e87c2[_0x2785b9];return _0x3d7a49;}export function buildPageFileName(_0x5ce3cb,_0x41edbd){const _0x354529=a193_0x7f2de2;return _0x5ce3cb+'-'+String(_0x41edbd)['toUpperCase']()+_0x354529(0x174);}export function resolvePageFilePath(_0x2aee78,_0x46de96,_0x3ca564){const _0x1effbe=a193_0x7f2de2;return join(_0x2aee78[_0x1effbe(0x16f)],buildPageFileName(_0x46de96,_0x3ca564));}export async function ensureParentDirectory(_0x497407){await mkdir(dirname(_0x497407),{'recursive':!![]});}export async function fileExists(_0x126363){try{return await access(_0x126363,constants['F_OK']),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x13b63a,_0x49cdc6){const _0x4eaa7c=a194_0x590b,_0xc410e=_0x13b63a();while(!![]){try{const _0x783483=-parseInt(_0x4eaa7c(0x9d))/0x1*(parseInt(_0x4eaa7c(0xa8))/0x2)+parseInt(_0x4eaa7c(0xa0))/0x3*(-parseInt(_0x4eaa7c(0xa4))/0x4)+-parseInt(_0x4eaa7c(0xa1))/0x5*(-parseInt(_0x4eaa7c(0xac))/0x6)+-parseInt(_0x4eaa7c(0xaa))/0x7+parseInt(_0x4eaa7c(0x9f))/0x8*(parseInt(_0x4eaa7c(0x9e))/0x9)+parseInt(_0x4eaa7c(0xa3))/0xa+parseInt(_0x4eaa7c(0xa7))/0xb*(parseInt(_0x4eaa7c(0xa9))/0xc);if(_0x783483===_0x49cdc6)break;else _0xc410e['push'](_0xc410e['shift']());}catch(_0x1b5f33){_0xc410e['push'](_0xc410e['shift']());}}}(a194_0xbc69,0x22e48));import a194_0x1bb3a0 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x38740b){return JSON['stringify'](JSON['parse'](_0x38740b),null,0x2)+'\x0a';}export function computePageContentHash(_0xc85902){const _0x1d5b33=a194_0x590b;return a194_0x1bb3a0[_0x1d5b33(0xa6)](_0x1d5b33(0xad))[_0x1d5b33(0xab)](_0xc85902)['digest'](_0x1d5b33(0xa2));}export function computeSerializedSchemaHash(_0x3681eb){return computePageContentHash(serializePageSchemaForFile(_0x3681eb));}function a194_0x590b(_0x2bd10d,_0x45cd73){_0x2bd10d=_0x2bd10d-0x9d;const _0xbc6945=a194_0xbc69();let _0x590bce=_0xbc6945[_0x2bd10d];return _0x590bce;}function a194_0xbc69(){const _0x2df9b1=['1610714aknmfB','update','822DOBiBA','md5','3pJsmnT','9NpZojs','1110344fkBjJm','32979JioyLC','4135kKSdfv','hex','170010biToRy','52GrZxla','utf8','createHash','11SFozsi','75702MuSyOc','4324692mkXKLN'];a194_0xbc69=function(){return _0x2df9b1;};return a194_0xbc69();}export async function computePageFileHash(_0x3d69c9){const _0x44327c=a194_0x590b,_0x1adde3=await readFile(_0x3d69c9,_0x44327c(0xa5));return computePageContentHash(_0x1adde3);}
1
+ (function(_0xad0af6,_0x47ce5b){const _0x241f74=a194_0x960f,_0x4f9151=_0xad0af6();while(!![]){try{const _0x1c80cc=-parseInt(_0x241f74(0x119))/0x1+-parseInt(_0x241f74(0x10b))/0x2+-parseInt(_0x241f74(0x114))/0x3+-parseInt(_0x241f74(0x115))/0x4*(-parseInt(_0x241f74(0x10c))/0x5)+-parseInt(_0x241f74(0x118))/0x6+-parseInt(_0x241f74(0x11a))/0x7*(-parseInt(_0x241f74(0x116))/0x8)+-parseInt(_0x241f74(0x112))/0x9*(-parseInt(_0x241f74(0x110))/0xa);if(_0x1c80cc===_0x47ce5b)break;else _0x4f9151['push'](_0x4f9151['shift']());}catch(_0x371c10){_0x4f9151['push'](_0x4f9151['shift']());}}}(a194_0x1e9d,0xb6647));import a194_0x2c80bf from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x16b830){const _0x1b3ef3=a194_0x960f;return JSON[_0x1b3ef3(0x10f)](JSON['parse'](_0x16b830),null,0x2)+'\x0a';}export function computePageContentHash(_0x1cf78c){const _0x1f400a=a194_0x960f;return a194_0x2c80bf[_0x1f400a(0x10e)](_0x1f400a(0x111))[_0x1f400a(0x113)](_0x1cf78c)['digest'](_0x1f400a(0x117));}export function computeSerializedSchemaHash(_0x28b2b8){return computePageContentHash(serializePageSchemaForFile(_0x28b2b8));}function a194_0x960f(_0x2ccf40,_0xa139b0){_0x2ccf40=_0x2ccf40-0x10b;const _0x1e9d72=a194_0x1e9d();let _0x960f1f=_0x1e9d72[_0x2ccf40];return _0x960f1f;}function a194_0x1e9d(){const _0x324372=['update','368037QkAaQY','3933340mUkzHf','3240sPxKNV','hex','2622468gNjohB','1376049JNWvJm','20881qIPkqj','621840tphlDe','5zOLhXn','utf8','createHash','stringify','50kEXWvA','md5','1444239EGeaYC'];a194_0x1e9d=function(){return _0x324372;};return a194_0x1e9d();}export async function computePageFileHash(_0xa48305){const _0x52124a=a194_0x960f,_0x3b45c0=await readFile(_0xa48305,_0x52124a(0x10d));return computePageContentHash(_0x3b45c0);}
@@ -1 +1 @@
1
- (function(_0x136588,_0x335f7a){const _0x4a3b1b=a195_0x4554,_0x52f9e7=_0x136588();while(!![]){try{const _0x510efc=parseInt(_0x4a3b1b(0x176))/0x1*(parseInt(_0x4a3b1b(0x17b))/0x2)+parseInt(_0x4a3b1b(0x185))/0x3*(-parseInt(_0x4a3b1b(0x174))/0x4)+parseInt(_0x4a3b1b(0x182))/0x5+-parseInt(_0x4a3b1b(0x17e))/0x6+parseInt(_0x4a3b1b(0x178))/0x7+parseInt(_0x4a3b1b(0x184))/0x8+-parseInt(_0x4a3b1b(0x179))/0x9*(-parseInt(_0x4a3b1b(0x17d))/0xa);if(_0x510efc===_0x335f7a)break;else _0x52f9e7['push'](_0x52f9e7['shift']());}catch(_0x2fc595){_0x52f9e7['push'](_0x52f9e7['shift']());}}}(a195_0x1905,0xea01d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x793d4d,_0x438eda){const _0xc325dd=a195_0x4554,_0x321f4c={'apps':_0x793d4d[_0xc325dd(0x181)]&&typeof _0x793d4d[_0xc325dd(0x181)]==='object'?_0x793d4d['apps']:{}};let _0x467b5d=_0x321f4c['apps'][_0x438eda];if(!_0x467b5d)return _0x467b5d={'lastSync':'','pages':{}},_0x321f4c[_0xc325dd(0x181)][_0x438eda]=_0x467b5d,{'lockData':_0x321f4c,'appLock':_0x467b5d};return!_0x467b5d['lastSync']&&(_0x467b5d[_0xc325dd(0x180)]=''),(!_0x467b5d['pages']||typeof _0x467b5d[_0xc325dd(0x183)]!==_0xc325dd(0x175))&&(_0x467b5d[_0xc325dd(0x183)]={}),{'lockData':_0x321f4c,'appLock':_0x467b5d};}function a195_0x4554(_0x4233b9,_0x44fd9d){_0x4233b9=_0x4233b9-0x174;const _0x190592=a195_0x1905();let _0x4554c0=_0x190592[_0x4233b9];return _0x4554c0;}export async function readPageLockFile(_0x276b41){const _0x414346=a195_0x4554;try{const _0x446348=await readFile(_0x276b41,'utf8'),_0x109079=JSON[_0x414346(0x17f)](_0x446348);return{'apps':_0x109079[_0x414346(0x181)]&&typeof _0x109079[_0x414346(0x181)]===_0x414346(0x175)?_0x109079['apps']:{}};}catch(_0x3be0cd){if(_0x3be0cd['code']===_0x414346(0x177))return null;throw new Error(_0x414346(0x17c)+String(_0x3be0cd));}}function a195_0x1905(){const _0x18cff7=['Failed\x20to\x20read\x20page\x20lock\x20file:\x20','60090PEobBG','5339400zeXdrA','parse','lastSync','apps','943045DzDDnX','pages','5839632uffZHn','4647nwwYcw','3868atFElY','object','2485ERjDjX','ENOENT','8790523RuyOph','99BMMlvh','utf8','890JQRWXr'];a195_0x1905=function(){return _0x18cff7;};return a195_0x1905();}export async function writePageLockFile(_0x58b7da,_0x4b6307){const _0x2f0fb3=a195_0x4554;await mkdir(dirname(_0x58b7da),{'recursive':!![]}),await writeFile(_0x58b7da,JSON['stringify'](_0x4b6307,null,0x2),_0x2f0fb3(0x17a));}
1
+ (function(_0x3d0455,_0x520e31){const _0x14441b=a195_0x48fa,_0x445f10=_0x3d0455();while(!![]){try{const _0xe1dde2=parseInt(_0x14441b(0xd3))/0x1+-parseInt(_0x14441b(0xd2))/0x2*(-parseInt(_0x14441b(0xd5))/0x3)+-parseInt(_0x14441b(0xd7))/0x4+-parseInt(_0x14441b(0xdc))/0x5+-parseInt(_0x14441b(0xe1))/0x6+parseInt(_0x14441b(0xda))/0x7+parseInt(_0x14441b(0xd8))/0x8;if(_0xe1dde2===_0x520e31)break;else _0x445f10['push'](_0x445f10['shift']());}catch(_0x4e9afc){_0x445f10['push'](_0x445f10['shift']());}}}(a195_0x5d5a,0xcfd97));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x2fdf32,_0x11bf1d){const _0x404f3b=a195_0x48fa,_0x389b00={'apps':_0x2fdf32[_0x404f3b(0xd4)]&&typeof _0x2fdf32[_0x404f3b(0xd4)]==='object'?_0x2fdf32[_0x404f3b(0xd4)]:{}};let _0x4737fd=_0x389b00[_0x404f3b(0xd4)][_0x11bf1d];if(!_0x4737fd)return _0x4737fd={'lastSync':'','pages':{}},_0x389b00[_0x404f3b(0xd4)][_0x11bf1d]=_0x4737fd,{'lockData':_0x389b00,'appLock':_0x4737fd};return!_0x4737fd[_0x404f3b(0xd9)]&&(_0x4737fd['lastSync']=''),(!_0x4737fd['pages']||typeof _0x4737fd[_0x404f3b(0xdf)]!==_0x404f3b(0xdd))&&(_0x4737fd[_0x404f3b(0xdf)]={}),{'lockData':_0x389b00,'appLock':_0x4737fd};}export async function readPageLockFile(_0x262908){const _0x32ccf2=a195_0x48fa;try{const _0xdfdbaf=await readFile(_0x262908,_0x32ccf2(0xe0)),_0x6d7373=JSON[_0x32ccf2(0xd6)](_0xdfdbaf);return{'apps':_0x6d7373[_0x32ccf2(0xd4)]&&typeof _0x6d7373[_0x32ccf2(0xd4)]==='object'?_0x6d7373[_0x32ccf2(0xd4)]:{}};}catch(_0x5c9dab){if(_0x5c9dab['code']===_0x32ccf2(0xde))return null;throw new Error(_0x32ccf2(0xdb)+String(_0x5c9dab));}}function a195_0x5d5a(){const _0x4b8866=['669pKOnRJ','parse','3740420Rwprzn','8601064LAQXjH','lastSync','8854769fGRngy','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','2603885cQFXhc','object','ENOENT','pages','utf8','3677844RGNVEq','4960FdnkLO','27067iNdAfx','apps'];a195_0x5d5a=function(){return _0x4b8866;};return a195_0x5d5a();}function a195_0x48fa(_0xd4b7d9,_0x167219){_0xd4b7d9=_0xd4b7d9-0xd2;const _0x5d5aae=a195_0x5d5a();let _0x48fab4=_0x5d5aae[_0xd4b7d9];return _0x48fab4;}export async function writePageLockFile(_0x415c34,_0x53eb78){const _0x55c17c=a195_0x48fa;await mkdir(dirname(_0x415c34),{'recursive':!![]}),await writeFile(_0x415c34,JSON['stringify'](_0x53eb78,null,0x2),_0x55c17c(0xe0));}
@@ -1 +1 @@
1
- function a197_0x25ef(){const _0x2ca42c=['1925RohdXC','28092jIZXTv','243336LCXZUR','1966NEZrKN','140VUIlOv','.rabetbase','44628royNZQ','675510mJpnEg','70JlDmJn','657nohPEx','29505vrdveu','sql','63GoLWtF','173518gimtUj','sql.lock.json'];a197_0x25ef=function(){return _0x2ca42c;};return a197_0x25ef();}const a197_0x147be9=a197_0x2092;(function(_0x5e629a,_0x4702bb){const _0x2e1ba3=a197_0x2092,_0x2670f3=_0x5e629a();while(!![]){try{const _0xf3a328=-parseInt(_0x2e1ba3(0x8a))/0x1+-parseInt(_0x2e1ba3(0x8f))/0x2*(parseInt(_0x2e1ba3(0x86))/0x3)+parseInt(_0x2e1ba3(0x90))/0x4*(-parseInt(_0x2e1ba3(0x87))/0x5)+parseInt(_0x2e1ba3(0x8d))/0x6*(-parseInt(_0x2e1ba3(0x85))/0x7)+-parseInt(_0x2e1ba3(0x8e))/0x8*(-parseInt(_0x2e1ba3(0x89))/0x9)+-parseInt(_0x2e1ba3(0x84))/0xa+-parseInt(_0x2e1ba3(0x8c))/0xb*(-parseInt(_0x2e1ba3(0x92))/0xc);if(_0xf3a328===_0x4702bb)break;else _0x2670f3['push'](_0x2670f3['shift']());}catch(_0x3cfff4){_0x2670f3['push'](_0x2670f3['shift']());}}}(a197_0x25ef,0x259bb));import{resolve}from'node:path';function a197_0x2092(_0x3d9641,_0x31541d){_0x3d9641=_0x3d9641-0x84;const _0x25efd1=a197_0x25ef();let _0x209289=_0x25efd1[_0x3d9641];return _0x209289;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a197_0x147be9(0x91),LOCK_FILE_NAME=a197_0x147be9(0x8b),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x349643,_0x340bff){const _0x12b277=a197_0x147be9,_0x49fbe1=resolve(_0x340bff??findProjectRootDirectory()),_0xb3126f=DOT_DIR+'/sql',_0x453dd1=_0xb3126f+'/'+_0x349643;return{'projectRoot':_0x49fbe1,'appCode':_0x349643,'sqlWorkspaceRoot':_0xb3126f,'sqlRoot':_0x453dd1,'sqlRootDir':resolve(_0x49fbe1,DOT_DIR,_0x12b277(0x88),_0x349643),'lockFilePath':resolve(_0x49fbe1,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x49fbe1,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a197_0x1fb51a=a197_0x5f20;(function(_0x3fd264,_0x20a9f1){const _0x4c1017=a197_0x5f20,_0x195b65=_0x3fd264();while(!![]){try{const _0x138a07=-parseInt(_0x4c1017(0x139))/0x1+parseInt(_0x4c1017(0x13a))/0x2+parseInt(_0x4c1017(0x136))/0x3+parseInt(_0x4c1017(0x138))/0x4*(-parseInt(_0x4c1017(0x131))/0x5)+-parseInt(_0x4c1017(0x133))/0x6*(-parseInt(_0x4c1017(0x132))/0x7)+-parseInt(_0x4c1017(0x13b))/0x8+parseInt(_0x4c1017(0x13c))/0x9;if(_0x138a07===_0x20a9f1)break;else _0x195b65['push'](_0x195b65['shift']());}catch(_0x1f64b5){_0x195b65['push'](_0x195b65['shift']());}}}(a197_0x379f,0x381a3));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a197_0x5f20(_0x2b8ac4,_0x5e1208){_0x2b8ac4=_0x2b8ac4-0x131;const _0x379fd9=a197_0x379f();let _0x5f2054=_0x379fd9[_0x2b8ac4];return _0x5f2054;}function a197_0x379f(){const _0x5ecdef=['1880658FybbHJ','sql-trash','309555aWceXm','44401uEufjZ','366JnbFET','/sql','.rabetbase','54201HUVgQw','sql.lock.json','4MArQqO','371054XllHdv','579276bwnoCC','1926640mCqDyt'];a197_0x379f=function(){return _0x5ecdef;};return a197_0x379f();}const DOT_DIR=a197_0x1fb51a(0x135),LOCK_FILE_NAME=a197_0x1fb51a(0x137),TRASH_DIR_NAME=a197_0x1fb51a(0x13d);export function loadSqlProjectConfig(_0x50f7d7,_0x304f80){const _0x2e3f07=a197_0x1fb51a,_0x581189=resolve(_0x304f80??findProjectRootDirectory()),_0x39e83d=DOT_DIR+_0x2e3f07(0x134),_0x41e277=_0x39e83d+'/'+_0x50f7d7;return{'projectRoot':_0x581189,'appCode':_0x50f7d7,'sqlWorkspaceRoot':_0x39e83d,'sqlRoot':_0x41e277,'sqlRootDir':resolve(_0x581189,DOT_DIR,'sql',_0x50f7d7),'lockFilePath':resolve(_0x581189,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x581189,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x228894,_0x427c10){const _0x54b007=a198_0x31a9,_0x1f6363=_0x228894();while(!![]){try{const _0x55d8c7=-parseInt(_0x54b007(0x11e))/0x1+parseInt(_0x54b007(0x123))/0x2+-parseInt(_0x54b007(0x119))/0x3*(parseInt(_0x54b007(0x111))/0x4)+parseInt(_0x54b007(0x11d))/0x5*(-parseInt(_0x54b007(0x117))/0x6)+-parseInt(_0x54b007(0x11c))/0x7*(parseInt(_0x54b007(0x110))/0x8)+-parseInt(_0x54b007(0x10f))/0x9*(parseInt(_0x54b007(0x115))/0xa)+parseInt(_0x54b007(0x108))/0xb*(parseInt(_0x54b007(0x109))/0xc);if(_0x55d8c7===_0x427c10)break;else _0x1f6363['push'](_0x1f6363['shift']());}catch(_0x104367){_0x1f6363['push'](_0x1f6363['shift']());}}}(a198_0x49b1,0xf3665));import{readdir,stat}from'node:fs/promises';function a198_0x31a9(_0x5696e0,_0x6bb7df){_0x5696e0=_0x5696e0-0x105;const _0x49b122=a198_0x49b1();let _0x31a965=_0x49b122[_0x5696e0];return _0x31a965;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2fc128){const _0x205053=a198_0x31a9;if(_0x2fc128==='.sql')return _0x205053(0x10e);if(_0x2fc128==='.xml')return _0x205053(0x105);return undefined;}async function scanSqlFilesRecursively(_0x43c196,_0x967f8e){const _0x1f3bf3=a198_0x31a9,_0x524dd4=[];try{const _0x5356ef=await readdir(_0x43c196,{'withFileTypes':!![]});for(const _0x1f43fe of _0x5356ef){const _0x3f715d=join(_0x43c196,_0x1f43fe[_0x1f3bf3(0x10b)]);if(_0x1f43fe[_0x1f3bf3(0x122)]()){_0x524dd4['push'](...await scanSqlFilesRecursively(_0x3f715d,_0x967f8e));continue;}if(!_0x1f43fe['isFile']())continue;const _0x1fba2c=extname(_0x1f43fe[_0x1f3bf3(0x10b)])[_0x1f3bf3(0x10a)](),_0x4f6deb=extensionToMode(_0x1fba2c);if(!_0x4f6deb)continue;const _0x5e9d18=relative(_0x967f8e,_0x3f715d)[_0x1f3bf3(0x106)](/\\/g,'/'),_0x212e5=_0x5e9d18[_0x1f3bf3(0x107)]('/')[_0x1f3bf3(0x10c)](Boolean),_0x395ebf=parseSqlPath(_0x212e5,_0x1f43fe[_0x1f3bf3(0x10b)],_0x1fba2c);if(!_0x395ebf)continue;_0x524dd4[_0x1f3bf3(0x10d)]({'sqlCode':_0x395ebf['sqlCode'],'sqlName':_0x395ebf['sqlName'],'dbDirectory':_0x212e5[0x0],'filePath':_0x3f715d,'relativePath':_0x5e9d18,'lockKey':_0x395ebf['sqlCode'],'mode':_0x4f6deb});}}catch(_0x4301a8){if(_0x4301a8[_0x1f3bf3(0x113)]!==_0x1f3bf3(0x112))throw _0x4301a8;}return _0x524dd4;}export async function scanLocalSqlQueries(_0x263cf9){const _0x43c669=a198_0x31a9;return scanSqlFilesRecursively(_0x263cf9[_0x43c669(0x11a)],_0x263cf9['sqlRootDir']);}function a198_0x49b1(){const _0x498057=['8068dRMxmk','ENOENT','code','sqlName','10vwnLxY','mode','60FCjIFT','dbName','2856frcTfc','sqlRootDir','test','7zuDzLH','70765TGITwy','1752506tslESG','slice','length','indexOf','isDirectory','799778hJJenZ','mybatisXml','replace','split','110VQIRzc','7447152rdvdqB','toLowerCase','name','filter','push','sql','4276287lwyKzw','10556168JfmSnv'];a198_0x49b1=function(){return _0x498057;};return a198_0x49b1();}export function resolveLocalSqlFilePath(_0x2ccc20,_0x2e1867,_0x2b2ed8){const _0x1ceb7e=a198_0x31a9,_0x451ba8=_0x2b2ed8?.['path']||(_0x2b2ed8?.[_0x1ceb7e(0x114)]||_0x2b2ed8?.[_0x1ceb7e(0x118)]?buildSqlRelativePath(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x114)],_0x2b2ed8?.[_0x1ceb7e(0x118)],_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e),_0x2b2ed8?.['dbId']):buildDefaultSqlFileName(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e)));return join(_0x2ccc20[_0x1ceb7e(0x11a)],_0x451ba8);}export async function directoryExists(_0x1a746b){const _0x36b187=a198_0x31a9;try{const _0x29a0bc=await stat(_0x1a746b);return _0x29a0bc[_0x36b187(0x122)]();}catch{return![];}}function parseSqlPath(_0x131059,_0x133520,_0x1c70d7){const _0x471da2=a198_0x31a9,_0x41c39f=_0x133520[_0x471da2(0x11f)](0x0,-_0x1c70d7[_0x471da2(0x120)]);if(_0x131059[_0x471da2(0x120)]<0x2)return null;const _0x21b646=_0x41c39f[_0x471da2(0x121)]('_');if(_0x21b646<=0x0||_0x21b646>=_0x41c39f[_0x471da2(0x120)]-0x1)return null;const _0x32682b=_0x41c39f[_0x471da2(0x11f)](0x0,_0x21b646);if(!isLikelySqlCode(_0x32682b))return null;return{'sqlCode':_0x32682b,'sqlName':_0x41c39f[_0x471da2(0x11f)](_0x21b646+0x1)};}function isLikelySqlCode(_0x3e1e39){const _0xb19564=a198_0x31a9;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0xb19564(0x11b)](_0x3e1e39);}
1
+ (function(_0x32230f,_0x3815bd){const _0x44fb9c=a198_0x26d5,_0x33d9b9=_0x32230f();while(!![]){try{const _0x15f8aa=parseInt(_0x44fb9c(0xc4))/0x1*(parseInt(_0x44fb9c(0xbd))/0x2)+parseInt(_0x44fb9c(0xaa))/0x3*(-parseInt(_0x44fb9c(0xaf))/0x4)+parseInt(_0x44fb9c(0xb4))/0x5+parseInt(_0x44fb9c(0xb0))/0x6*(parseInt(_0x44fb9c(0xb3))/0x7)+-parseInt(_0x44fb9c(0xb1))/0x8+parseInt(_0x44fb9c(0xbf))/0x9*(parseInt(_0x44fb9c(0xb6))/0xa)+-parseInt(_0x44fb9c(0xb2))/0xb*(parseInt(_0x44fb9c(0xb5))/0xc);if(_0x15f8aa===_0x3815bd)break;else _0x33d9b9['push'](_0x33d9b9['shift']());}catch(_0x4d8c45){_0x33d9b9['push'](_0x33d9b9['shift']());}}}(a198_0x2123,0x266a5));function a198_0x26d5(_0x2c1c0d,_0x1d725e){_0x2c1c0d=_0x2c1c0d-0xaa;const _0x21232e=a198_0x2123();let _0x26d56e=_0x21232e[_0x2c1c0d];return _0x26d56e;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x56b094){const _0x25d03a=a198_0x26d5;if(_0x56b094===_0x25d03a(0xc9))return _0x25d03a(0xac);if(_0x56b094===_0x25d03a(0xc5))return _0x25d03a(0xcc);return undefined;}async function scanSqlFilesRecursively(_0x451f8c,_0x33b49c){const _0x5be6ab=a198_0x26d5,_0x4382ec=[];try{const _0x5bc95e=await readdir(_0x451f8c,{'withFileTypes':!![]});for(const _0x1c06cb of _0x5bc95e){const _0x17181d=join(_0x451f8c,_0x1c06cb['name']);if(_0x1c06cb[_0x5be6ab(0xbc)]()){_0x4382ec['push'](...await scanSqlFilesRecursively(_0x17181d,_0x33b49c));continue;}if(!_0x1c06cb[_0x5be6ab(0xc6)]())continue;const _0x40a9ec=extname(_0x1c06cb[_0x5be6ab(0xb9)])['toLowerCase'](),_0x42084c=extensionToMode(_0x40a9ec);if(!_0x42084c)continue;const _0x6b9aad=relative(_0x33b49c,_0x17181d)['replace'](/\\/g,'/'),_0x2e6117=_0x6b9aad[_0x5be6ab(0xad)]('/')[_0x5be6ab(0xae)](Boolean),_0x3ae726=parseSqlPath(_0x2e6117,_0x1c06cb['name'],_0x40a9ec);if(!_0x3ae726)continue;_0x4382ec[_0x5be6ab(0xb7)]({'sqlCode':_0x3ae726['sqlCode'],'sqlName':_0x3ae726[_0x5be6ab(0xc7)],'dbDirectory':_0x2e6117[0x0],'filePath':_0x17181d,'relativePath':_0x6b9aad,'lockKey':_0x3ae726[_0x5be6ab(0xba)],'mode':_0x42084c});}}catch(_0xa096db){if(_0xa096db[_0x5be6ab(0xc2)]!==_0x5be6ab(0xc3))throw _0xa096db;}return _0x4382ec;}export async function scanLocalSqlQueries(_0x2819de){const _0x4303cc=a198_0x26d5;return scanSqlFilesRecursively(_0x2819de[_0x4303cc(0xca)],_0x2819de['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x207718,_0xb83353,_0x2ef6a3){const _0x4df8cf=a198_0x26d5,_0x4a67d1=_0x2ef6a3?.[_0x4df8cf(0xc0)]||(_0x2ef6a3?.[_0x4df8cf(0xc7)]||_0x2ef6a3?.[_0x4df8cf(0xbb)]?buildSqlRelativePath(_0xb83353,_0x2ef6a3?.[_0x4df8cf(0xc7)],_0x2ef6a3?.[_0x4df8cf(0xbb)],_0x2ef6a3?.[_0x4df8cf(0xcb)]||'sql',_0x2ef6a3?.[_0x4df8cf(0xbe)]):buildDefaultSqlFileName(_0xb83353,_0x2ef6a3?.[_0x4df8cf(0xcb)]||'sql'));return join(_0x207718[_0x4df8cf(0xca)],_0x4a67d1);}function a198_0x2123(){const _0x53f876=['dbName','isDirectory','1402tNGpJm','dbId','265176iaECrP','path','length','code','ENOENT','321deLfIb','.xml','isFile','sqlName','test','.sql','sqlRootDir','mode','mybatisXml','74487YvNjlF','indexOf','sql','split','filter','4Nbpghp','265902iOYnrD','1391960SZmMSb','7997Bgpclo','7ooGyzK','968110HYHeyj','3708qFFNag','40uTHUuK','push','slice','name','sqlCode'];a198_0x2123=function(){return _0x53f876;};return a198_0x2123();}export async function directoryExists(_0x1c1627){const _0x10ff6f=a198_0x26d5;try{const _0xd48160=await stat(_0x1c1627);return _0xd48160[_0x10ff6f(0xbc)]();}catch{return![];}}function parseSqlPath(_0x12a30f,_0xa1cb9f,_0x4ec040){const _0x5bfe8d=a198_0x26d5,_0x4b8f42=_0xa1cb9f[_0x5bfe8d(0xb8)](0x0,-_0x4ec040[_0x5bfe8d(0xc1)]);if(_0x12a30f['length']<0x2)return null;const _0x27a1e0=_0x4b8f42[_0x5bfe8d(0xab)]('_');if(_0x27a1e0<=0x0||_0x27a1e0>=_0x4b8f42[_0x5bfe8d(0xc1)]-0x1)return null;const _0x428b8f=_0x4b8f42[_0x5bfe8d(0xb8)](0x0,_0x27a1e0);if(!isLikelySqlCode(_0x428b8f))return null;return{'sqlCode':_0x428b8f,'sqlName':_0x4b8f42[_0x5bfe8d(0xb8)](_0x27a1e0+0x1)};}function isLikelySqlCode(_0x58a5ea){const _0x2b793e=a198_0x26d5;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2b793e(0xc8)](_0x58a5ea);}
@@ -1 +1 @@
1
- (function(_0x31d1d6,_0x5b268c){const _0x421ba5=a199_0x5a8d,_0x5a5581=_0x31d1d6();while(!![]){try{const _0x518d6c=-parseInt(_0x421ba5(0x127))/0x1+parseInt(_0x421ba5(0x128))/0x2+parseInt(_0x421ba5(0x124))/0x3*(parseInt(_0x421ba5(0x129))/0x4)+-parseInt(_0x421ba5(0x12c))/0x5*(parseInt(_0x421ba5(0x11f))/0x6)+parseInt(_0x421ba5(0x126))/0x7+parseInt(_0x421ba5(0x11d))/0x8+parseInt(_0x421ba5(0x122))/0x9*(-parseInt(_0x421ba5(0x121))/0xa);if(_0x518d6c===_0x5b268c)break;else _0x5a5581['push'](_0x5a5581['shift']());}catch(_0x544e3a){_0x5a5581['push'](_0x5a5581['shift']());}}}(a199_0x4e89,0xd008f));import{readFile}from'node:fs/promises';function a199_0x5a8d(_0x2715d7,_0x2711d8){_0x2715d7=_0x2715d7-0x11d;const _0x4e89b7=a199_0x4e89();let _0x5a8d95=_0x4e89b7[_0x2715d7];return _0x5a8d95;}import a199_0x338806 from'node:crypto';export function computeSqlContentHash(_0x1272a0){const _0x90c585=a199_0x5a8d;return a199_0x338806[_0x90c585(0x125)](_0x90c585(0x120))[_0x90c585(0x12a)](_0x1272a0)[_0x90c585(0x12b)](_0x90c585(0x11e));}function a199_0x4e89(){const _0x3de24d=['32KcZBMr','update','digest','6605kyfjJB','12555976RlHFjT','hex','3414MkxhKn','md5','10ShPBeN','7527951tjuwMt','utf8','1242zykPRS','createHash','6023822psoFmx','122656AmuUBA','259000cZiwcg'];a199_0x4e89=function(){return _0x3de24d;};return a199_0x4e89();}export async function computeSqlFileHash(_0x3dc21c){const _0x486352=a199_0x5a8d,_0x224892=await readFile(_0x3dc21c,_0x486352(0x123));return computeSqlContentHash(_0x224892);}
1
+ (function(_0x186cec,_0x272ef4){const _0x5c1092=a199_0x3e88,_0x6aca64=_0x186cec();while(!![]){try{const _0x9f701c=parseInt(_0x5c1092(0x1ba))/0x1+-parseInt(_0x5c1092(0x1bc))/0x2*(parseInt(_0x5c1092(0x1bf))/0x3)+-parseInt(_0x5c1092(0x1be))/0x4+-parseInt(_0x5c1092(0x1bd))/0x5+-parseInt(_0x5c1092(0x1c2))/0x6+-parseInt(_0x5c1092(0x1bb))/0x7+parseInt(_0x5c1092(0x1c1))/0x8;if(_0x9f701c===_0x272ef4)break;else _0x6aca64['push'](_0x6aca64['shift']());}catch(_0x340590){_0x6aca64['push'](_0x6aca64['shift']());}}}(a199_0x16e5,0x4ac4b));import{readFile}from'node:fs/promises';import a199_0x3896a4 from'node:crypto';export function computeSqlContentHash(_0x4a3bd4){const _0x8a0fda=a199_0x3e88;return a199_0x3896a4['createHash']('md5')['update'](_0x4a3bd4)[_0x8a0fda(0x1c0)]('hex');}export async function computeSqlFileHash(_0x535be1){const _0x16aa37=await readFile(_0x535be1,'utf8');return computeSqlContentHash(_0x16aa37);}function a199_0x3e88(_0x48cf51,_0x571417){_0x48cf51=_0x48cf51-0x1ba;const _0x16e583=a199_0x16e5();let _0x3e88e7=_0x16e583[_0x48cf51];return _0x3e88e7;}function a199_0x16e5(){const _0x571dd5=['2612724gySzFN','203598Wsozgb','919961mZwiRT','254wRjLsf','33640NfgVTU','723564kJppfp','10029nzcbzX','digest','10253680yVkEJq'];a199_0x16e5=function(){return _0x571dd5;};return a199_0x16e5();}
@@ -1 +1 @@
1
- function a200_0x5d02(){const _0x22b401=['7rGElfp','99zBTgOk','code','3579392ceFuwq','188775XnjtEz','5849178aSIMKh','892isfZKO','100GnpPDM','lastSync','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','51280493CtPUii','\x22.\x20','908240ThMYyS',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','parse','\x22\x20vs\x20lock\x20\x22','ENOENT','stringify','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1324vlBFjh','apps','304497ECYUfr','sqls','sqlRoot','utf8'];a200_0x5d02=function(){return _0x22b401;};return a200_0x5d02();}(function(_0x37cb89,_0x2d4749){const _0x46c84d=a200_0x349a,_0x5ca5f1=_0x37cb89();while(!![]){try{const _0x1a01f3=-parseInt(_0x46c84d(0x156))/0x1*(parseInt(_0x46c84d(0x14a))/0x2)+parseInt(_0x46c84d(0x14c))/0x3+-parseInt(_0x46c84d(0x157))/0x4*(parseInt(_0x46c84d(0x154))/0x5)+parseInt(_0x46c84d(0x155))/0x6*(-parseInt(_0x46c84d(0x150))/0x7)+-parseInt(_0x46c84d(0x153))/0x8+-parseInt(_0x46c84d(0x151))/0x9*(parseInt(_0x46c84d(0x143))/0xa)+parseInt(_0x46c84d(0x15a))/0xb;if(_0x1a01f3===_0x2d4749)break;else _0x5ca5f1['push'](_0x5ca5f1['shift']());}catch(_0x531441){_0x5ca5f1['push'](_0x5ca5f1['shift']());}}}(a200_0x5d02,0xc52d0));function a200_0x349a(_0x27d365,_0x3f0e44){_0x27d365=_0x27d365-0x143;const _0x5d02c7=a200_0x5d02();let _0x349a5d=_0x5d02c7[_0x27d365];return _0x349a5d;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x28db97,_0x439164,_0x239500,_0x252acb){const _0x1da625=a200_0x349a,_0x548ab5=_0x28db97??createEmptySqlLock();let _0x2dedde=_0x548ab5[_0x1da625(0x14b)][_0x439164];if(!_0x2dedde)return _0x2dedde={'sqlRoot':_0x239500,'lastSync':'','sqls':{}},_0x548ab5[_0x1da625(0x14b)][_0x439164]=_0x2dedde,{'lockData':_0x548ab5,'appLock':_0x2dedde};if(!_0x2dedde[_0x1da625(0x14e)])_0x2dedde[_0x1da625(0x14e)]=_0x239500;else{if(_0x2dedde[_0x1da625(0x14e)]!==_0x239500)throw new Error(_0x252acb+_0x1da625(0x144)+_0x239500+_0x1da625(0x146)+_0x2dedde[_0x1da625(0x14e)]+_0x1da625(0x15b)+_0x1da625(0x149));}return!_0x2dedde[_0x1da625(0x14d)]&&(_0x2dedde[_0x1da625(0x14d)]={}),!_0x2dedde['lastSync']&&(_0x2dedde[_0x1da625(0x158)]=''),{'lockData':_0x548ab5,'appLock':_0x2dedde};}export async function readSqlLockFile(_0x191357){const _0x5e060e=a200_0x349a;try{const _0x32568a=await readFile(_0x191357,_0x5e060e(0x14f));return JSON[_0x5e060e(0x145)](_0x32568a);}catch(_0x1d4891){if(_0x1d4891[_0x5e060e(0x152)]===_0x5e060e(0x147))return null;throw new Error(_0x5e060e(0x159)+String(_0x1d4891));}}export async function writeSqlLockFile(_0x17b27a,_0x571fa5){const _0x2eeca3=a200_0x349a;await mkdir(dirname(_0x17b27a),{'recursive':!![]}),await writeFile(_0x17b27a,JSON[_0x2eeca3(0x148)](_0x571fa5,null,0x2),_0x2eeca3(0x14f));}
1
+ function a200_0xd58d(_0x358a08,_0x248f57){_0x358a08=_0x358a08-0x148;const _0xf239dd=a200_0xf239();let _0xd58da8=_0xf239dd[_0x358a08];return _0xd58da8;}function a200_0xf239(){const _0x485f3a=['125lytaMG','9929060lMLgeu','31982159NZpEnX','24KqZgMZ','\x22\x20vs\x20lock\x20\x22','137095IrXvoB','74012ZBkqkH','683263MupTGV','48sKGhZS','1780696EbrXzT',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','parse','code','17506XYxaRJ','sqls','sqlRoot','45FngVgN','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','utf8','\x22.\x20','apps','ENOENT','159ndrjJX','lastSync'];a200_0xf239=function(){return _0x485f3a;};return a200_0xf239();}(function(_0x3d74fa,_0x16560c){const _0xac3f7c=a200_0xd58d,_0x33d0cd=_0x3d74fa();while(!![]){try{const _0x34ad9f=-parseInt(_0xac3f7c(0x158))/0x1*(parseInt(_0xac3f7c(0x14d))/0x2)+-parseInt(_0xac3f7c(0x156))/0x3*(parseInt(_0xac3f7c(0x15e))/0x4)+parseInt(_0xac3f7c(0x15d))/0x5+-parseInt(_0xac3f7c(0x148))/0x6*(parseInt(_0xac3f7c(0x15f))/0x7)+parseInt(_0xac3f7c(0x149))/0x8*(-parseInt(_0xac3f7c(0x150))/0x9)+-parseInt(_0xac3f7c(0x159))/0xa+-parseInt(_0xac3f7c(0x15a))/0xb*(-parseInt(_0xac3f7c(0x15b))/0xc);if(_0x34ad9f===_0x16560c)break;else _0x33d0cd['push'](_0x33d0cd['shift']());}catch(_0x241c48){_0x33d0cd['push'](_0x33d0cd['shift']());}}}(a200_0xf239,0xd70dc));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x9656e4,_0x1c5369,_0x8ed0b2,_0xf13c0b){const _0x2c8cec=a200_0xd58d,_0x24d4e4=_0x9656e4??createEmptySqlLock();let _0x1d1408=_0x24d4e4[_0x2c8cec(0x154)][_0x1c5369];if(!_0x1d1408)return _0x1d1408={'sqlRoot':_0x8ed0b2,'lastSync':'','sqls':{}},_0x24d4e4[_0x2c8cec(0x154)][_0x1c5369]=_0x1d1408,{'lockData':_0x24d4e4,'appLock':_0x1d1408};if(!_0x1d1408[_0x2c8cec(0x14f)])_0x1d1408[_0x2c8cec(0x14f)]=_0x8ed0b2;else{if(_0x1d1408[_0x2c8cec(0x14f)]!==_0x8ed0b2)throw new Error(_0xf13c0b+_0x2c8cec(0x14a)+_0x8ed0b2+_0x2c8cec(0x15c)+_0x1d1408[_0x2c8cec(0x14f)]+_0x2c8cec(0x153)+_0x2c8cec(0x151));}return!_0x1d1408[_0x2c8cec(0x14e)]&&(_0x1d1408['sqls']={}),!_0x1d1408[_0x2c8cec(0x157)]&&(_0x1d1408[_0x2c8cec(0x157)]=''),{'lockData':_0x24d4e4,'appLock':_0x1d1408};}export async function readSqlLockFile(_0x3f7d63){const _0x26ac03=a200_0xd58d;try{const _0x104bb4=await readFile(_0x3f7d63,_0x26ac03(0x152));return JSON[_0x26ac03(0x14b)](_0x104bb4);}catch(_0x4adabf){if(_0x4adabf[_0x26ac03(0x14c)]===_0x26ac03(0x155))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x4adabf));}}export async function writeSqlLockFile(_0x519570,_0x37cec2){const _0x52296e=a200_0xd58d;await mkdir(dirname(_0x519570),{'recursive':!![]}),await writeFile(_0x519570,JSON['stringify'](_0x37cec2,null,0x2),_0x52296e(0x152));}