@lovrabet/rabetbase-cli 2.3.4 → 2.3.5

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 (239) 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/validate.js +1 -1
  50. package/lib/commands/config/get.js +1 -1
  51. package/lib/commands/config/index.js +1 -1
  52. package/lib/commands/config/list.js +1 -1
  53. package/lib/commands/config/set.js +1 -1
  54. package/lib/commands/config/shared.js +1 -1
  55. package/lib/commands/data/filter.js +1 -1
  56. package/lib/commands/data/getOne.js +1 -1
  57. package/lib/commands/data/index.js +1 -1
  58. package/lib/commands/data/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/capability.js +1 -1
  61. package/lib/commands/dataset/delete.js +1 -1
  62. package/lib/commands/dataset/detail.js +1 -1
  63. package/lib/commands/dataset/extend-update.js +1 -1
  64. package/lib/commands/dataset/field-update.js +1 -1
  65. package/lib/commands/dataset/generate.js +1 -1
  66. package/lib/commands/dataset/index.js +1 -1
  67. package/lib/commands/dataset/list.js +1 -1
  68. package/lib/commands/dataset/operations.js +1 -1
  69. package/lib/commands/dataset/relation-audit.js +1 -1
  70. package/lib/commands/dataset/relation-create.js +1 -1
  71. package/lib/commands/dataset/relation-delete.js +1 -1
  72. package/lib/commands/dataset/relation-shared.js +1 -1
  73. package/lib/commands/dataset/relation-update.js +1 -1
  74. package/lib/commands/dataset/relations.js +1 -1
  75. package/lib/commands/dataset/rename.js +1 -1
  76. package/lib/commands/dataset/restore.js +1 -1
  77. package/lib/commands/db/analyze-cancel.js +1 -1
  78. package/lib/commands/db/analyze-start.js +1 -1
  79. package/lib/commands/db/analyze-status.js +1 -1
  80. package/lib/commands/db/create.js +1 -1
  81. package/lib/commands/db/delete.js +1 -1
  82. package/lib/commands/db/detail.js +1 -1
  83. package/lib/commands/db/diff.js +1 -1
  84. package/lib/commands/db/index.js +1 -1
  85. package/lib/commands/db/list.js +1 -1
  86. package/lib/commands/db/shared.js +1 -1
  87. package/lib/commands/db/tables.js +1 -1
  88. package/lib/commands/db/test.js +1 -1
  89. package/lib/commands/db/update.js +1 -1
  90. package/lib/commands/doctor.js +1 -1
  91. package/lib/commands/init/index.js +1 -1
  92. package/lib/commands/issue/index.js +1 -1
  93. package/lib/commands/issue/nudge.js +1 -1
  94. package/lib/commands/issue/report.js +1 -1
  95. package/lib/commands/issue/shared.js +1 -1
  96. package/lib/commands/logs/index.js +1 -1
  97. package/lib/commands/menu/index.js +1 -1
  98. package/lib/commands/menu/list.js +1 -1
  99. package/lib/commands/menu/shared/compare-table.js +1 -1
  100. package/lib/commands/menu/shared/index.js +1 -1
  101. package/lib/commands/menu/shared/inquirer.js +1 -1
  102. package/lib/commands/menu/shared/local-pages.js +1 -1
  103. package/lib/commands/menu/shared/logic.js +1 -1
  104. package/lib/commands/menu/shared/service.js +1 -1
  105. package/lib/commands/menu/shared/sync-core.js +1 -1
  106. package/lib/commands/menu/shared/update-core.js +1 -1
  107. package/lib/commands/menu/shared/valid-url.js +1 -1
  108. package/lib/commands/menu/sync.js +1 -1
  109. package/lib/commands/menu/update.js +1 -1
  110. package/lib/commands/page/generate-start.js +1 -1
  111. package/lib/commands/page/generate-status.js +1 -1
  112. package/lib/commands/page/index.js +1 -1
  113. package/lib/commands/page/pull.js +1 -1
  114. package/lib/commands/page/push.js +1 -1
  115. package/lib/commands/page/relation-audit.js +1 -1
  116. package/lib/commands/page/shared.js +1 -1
  117. package/lib/commands/page/standard-page-status.js +1 -1
  118. package/lib/commands/page/sync.js +1 -1
  119. package/lib/commands/permit/index.js +1 -1
  120. package/lib/commands/permit/page-get.js +1 -1
  121. package/lib/commands/permit/page-set.js +1 -1
  122. package/lib/commands/permit/role-apis-set.js +1 -1
  123. package/lib/commands/permit/role-menus-set.js +1 -1
  124. package/lib/commands/permit/role-menus.js +1 -1
  125. package/lib/commands/permit/shared.js +1 -1
  126. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  127. package/lib/commands/project/create/format-elapsed.js +1 -1
  128. package/lib/commands/project/create/main.js +1 -1
  129. package/lib/commands/project/create/non-interactive.js +1 -1
  130. package/lib/commands/project/create/project-template-path.js +1 -1
  131. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  132. package/lib/commands/project/create/use-format-code.js +1 -1
  133. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  134. package/lib/commands/project/index.js +1 -1
  135. package/lib/commands/project/init.js +1 -1
  136. package/lib/commands/project/upgrade.js +1 -1
  137. package/lib/commands/registry.js +1 -1
  138. package/lib/commands/role/create.js +1 -1
  139. package/lib/commands/role/delete.js +1 -1
  140. package/lib/commands/role/detail.js +1 -1
  141. package/lib/commands/role/index.js +1 -1
  142. package/lib/commands/role/list.js +1 -1
  143. package/lib/commands/role/shared.js +1 -1
  144. package/lib/commands/role/update.js +1 -1
  145. package/lib/commands/role/user-add.js +1 -1
  146. package/lib/commands/role/user-remove.js +1 -1
  147. package/lib/commands/role/user-resolve.js +1 -1
  148. package/lib/commands/run/index.js +1 -1
  149. package/lib/commands/schema.js +1 -1
  150. package/lib/commands/sql/create.js +1 -1
  151. package/lib/commands/sql/delete.js +1 -1
  152. package/lib/commands/sql/detail.js +1 -1
  153. package/lib/commands/sql/exec.js +1 -1
  154. package/lib/commands/sql/index.js +1 -1
  155. package/lib/commands/sql/list.js +1 -1
  156. package/lib/commands/sql/pull.js +1 -1
  157. package/lib/commands/sql/push.js +1 -1
  158. package/lib/commands/sql/save.js +1 -1
  159. package/lib/commands/sql/shared.js +1 -1
  160. package/lib/commands/sql/status.js +1 -1
  161. package/lib/commands/sql/validate.js +1 -1
  162. package/lib/commands/workspace/add.js +1 -1
  163. package/lib/commands/workspace/index.js +1 -1
  164. package/lib/commands/workspace/remove.js +1 -1
  165. package/lib/config/schema.js +1 -1
  166. package/lib/constant/cdn.js +1 -1
  167. package/lib/constant/cli.js +1 -1
  168. package/lib/constant/defaults.js +1 -1
  169. package/lib/constant/domain.js +1 -1
  170. package/lib/constant/env.js +1 -1
  171. package/lib/constant/output.js +1 -1
  172. package/lib/constant/paths.js +1 -1
  173. package/lib/constant/risk.js +1 -1
  174. package/lib/context/app-resolver.js +1 -1
  175. package/lib/context/auth-resolver.js +1 -1
  176. package/lib/context/config-loader.js +1 -1
  177. package/lib/context.js +1 -1
  178. package/lib/core/alias-resolver.js +1 -1
  179. package/lib/core/api-client.js +1 -1
  180. package/lib/core/bff/config.js +1 -1
  181. package/lib/core/bff/file-system.js +1 -1
  182. package/lib/core/bff/hash.js +1 -1
  183. package/lib/core/bff/lock.js +1 -1
  184. package/lib/core/bff/utils.js +1 -1
  185. package/lib/core/db-resolver.js +1 -1
  186. package/lib/core/page/file-system.js +1 -1
  187. package/lib/core/page/hash.js +1 -1
  188. package/lib/core/page/lock.js +1 -1
  189. package/lib/core/sql-sync/config.js +1 -1
  190. package/lib/core/sql-sync/file-system.js +1 -1
  191. package/lib/core/sql-sync/hash.js +1 -1
  192. package/lib/core/sql-sync/lock.js +1 -1
  193. package/lib/core/sql-sync/utils.js +1 -1
  194. package/lib/core/sql-validator.js +1 -1
  195. package/lib/errors.js +1 -1
  196. package/lib/framework/build-all-flags.js +1 -1
  197. package/lib/framework/flags.js +1 -1
  198. package/lib/framework/help.js +1 -1
  199. package/lib/framework/index.js +1 -1
  200. package/lib/framework/output.js +1 -1
  201. package/lib/framework/response.js +1 -1
  202. package/lib/framework/runner-alias.js +1 -1
  203. package/lib/framework/runner.js +1 -1
  204. package/lib/framework/schema-export.js +1 -1
  205. package/lib/framework/types.js +1 -1
  206. package/lib/generated/build-info.js +1 -1
  207. package/lib/help.js +1 -1
  208. package/lib/skills/main.js +1 -1
  209. package/lib/skills/npx-skills-add.js +1 -1
  210. package/lib/telemetry/cli-command-trace.js +1 -1
  211. package/lib/telemetry/cli-help-trace.js +1 -1
  212. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  213. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  214. package/lib/telemetry/send-cli-trace-log.js +1 -1
  215. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  216. package/lib/utils/ai_config.js +1 -1
  217. package/lib/utils/apply-jq-filter.js +1 -1
  218. package/lib/utils/cdn-config.js +1 -1
  219. package/lib/utils/check-sdk-version.js +1 -1
  220. package/lib/utils/cli-version-check.js +1 -1
  221. package/lib/utils/cli-version-policy.js +1 -1
  222. package/lib/utils/config.js +1 -1
  223. package/lib/utils/copy-directory.js +1 -1
  224. package/lib/utils/entity-with-id.js +1 -1
  225. package/lib/utils/file-utils.js +1 -1
  226. package/lib/utils/guides-cdn.js +1 -1
  227. package/lib/utils/http-client.js +1 -1
  228. package/lib/utils/is-non-interactive.js +1 -1
  229. package/lib/utils/logger.js +1 -1
  230. package/lib/utils/params.js +1 -1
  231. package/lib/utils/platform.js +1 -1
  232. package/lib/utils/rules-cdn.js +1 -1
  233. package/lib/utils/sleep.js +1 -1
  234. package/lib/utils/template-replacer.js +1 -1
  235. package/lib/utils/update-notice.js +1 -1
  236. package/lib/utils/version.js +1 -1
  237. package/lib/utils/with-active-cookie.js +1 -1
  238. package/lib/utils/write-cli-side-channel.js +1 -1
  239. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x374d54,_0x5426a8){const _0x29b47b=a179_0x3a01,_0x1bbf3c=_0x374d54();while(!![]){try{const _0x153527=parseInt(_0x29b47b(0x18c))/0x1+parseInt(_0x29b47b(0x157))/0x2+parseInt(_0x29b47b(0x16b))/0x3*(-parseInt(_0x29b47b(0x1f1))/0x4)+-parseInt(_0x29b47b(0x195))/0x5*(-parseInt(_0x29b47b(0x190))/0x6)+-parseInt(_0x29b47b(0x1d8))/0x7+parseInt(_0x29b47b(0x162))/0x8+parseInt(_0x29b47b(0x192))/0x9*(parseInt(_0x29b47b(0x1be))/0xa);if(_0x153527===_0x5426a8)break;else _0x1bbf3c['push'](_0x1bbf3c['shift']());}catch(_0x240cb2){_0x1bbf3c['push'](_0x1bbf3c['shift']());}}}(a179_0x386f,0x55628));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(_0x3845f7){_activeCookie=_0x3845f7||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(_0x376fa8,_0xc3f452){const _0x35f08e=a179_0x3a01,_0x1452f7=_0xc3f452 instanceof Error?_0xc3f452['message']:String(_0xc3f452);return CliErrors[_0x35f08e(0x16c)](_0x35f08e(0x1e8)+_0x376fa8+(_0x1452f7?'\x20('+_0x1452f7+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x1a1ea2,_0x4309de={}){const _0x2095f9=a179_0x3a01,{method:method='GET',body:_0x45ed54,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4309de,_0x12526c=useRuntime?getRuntimeDomain():getApiDomain(),_0x1abb6f=_activeCookie||getCookie(),_0x2c3b31=''+_0x12526c+_0x1a1ea2,_0x294064=new AbortController(),_0x505734=setTimeout(()=>_0x294064[_0x2095f9(0x1f3)](),timeout);try{const _0x3c546c=await fetch(_0x2c3b31,{'method':method,'headers':{'Content-Type':_0x2095f9(0x1dc),'Cookie':_0x1abb6f,'X-Invoke-Source':_0x2095f9(0x1c9),...headers},'body':_0x45ed54?JSON[_0x2095f9(0x148)](_0x45ed54):undefined,'signal':_0x294064[_0x2095f9(0x183)]});let _0x57ba46;try{_0x57ba46=await _0x3c546c[_0x2095f9(0x150)]();}catch(_0x5dafbd){if(_0x5dafbd instanceof Error&&_0x5dafbd[_0x2095f9(0x20d)]===_0x2095f9(0x1cd))throw CliErrors[_0x2095f9(0x16c)]('Request\x20timeout:\x20'+_0x2c3b31);if(_0x3c546c['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x3c546c['status']+')',_0x3c546c[_0x2095f9(0x15e)]>=0x190?_0x2095f9(0x1da):undefined);}if(!_0x3c546c['ok']||_0x57ba46[_0x2095f9(0x189)]===![])throw CliErrors[_0x2095f9(0x16c)](_0x57ba46[_0x2095f9(0x17d)]||_0x57ba46[_0x2095f9(0x1b7)]||_0x2095f9(0x1d4)+_0x3c546c[_0x2095f9(0x15e)],_0x57ba46[_0x2095f9(0x199)]?_0x2095f9(0x15f)+_0x57ba46['errorCode']:undefined);return _0x57ba46;}catch(_0x1017bb){if(_0x1017bb instanceof CliError)throw _0x1017bb;if(_0x1017bb instanceof Error&&_0x1017bb[_0x2095f9(0x20d)]==='AbortError')throw CliErrors[_0x2095f9(0x16c)](_0x2095f9(0x1f5)+_0x2c3b31);throw createFetchFailureError(_0x2c3b31,_0x1017bb);}finally{clearTimeout(_0x505734);}}function isAuthFailure(_0x15c5c1){const _0x4c7155=a179_0x3a01,_0x4bccc7=_0x15c5c1[_0x4c7155(0x17d)]||_0x15c5c1['message']||_0x15c5c1[_0x4c7155(0x167)]?.[_0x4c7155(0x1b7)]||_0x15c5c1[_0x4c7155(0x1f9)]||_0x15c5c1['error']||'';return _0x15c5c1[_0x4c7155(0x199)]===_0x4c7155(0x1d0)||_0x15c5c1['code']===0x191||_0x15c5c1[_0x4c7155(0x18b)]===_0x4c7155(0x149)||_0x4bccc7[_0x4c7155(0x210)](_0x4c7155(0x149))||_0x4bccc7[_0x4c7155(0x210)](_0x4c7155(0x21a))||_0x4bccc7[_0x4c7155(0x210)]('登录')||_0x4bccc7['includes']('认证');}export async function platformFetch(_0xf028dc,_0x54cacf){const _0x507c76=a179_0x3a01;let _0x1d3580;try{_0x1d3580=await fetch(_0xf028dc,{'method':_0x54cacf[_0x507c76(0x154)]??_0x507c76(0x145),'headers':{'Content-Type':'application/json','Cookie':_0x54cacf[_0x507c76(0x1e2)],'X-Invoke-Source':_0x507c76(0x1c9)},..._0x54cacf[_0x507c76(0x217)]&&{'body':JSON[_0x507c76(0x148)](_0x54cacf[_0x507c76(0x217)])}});}catch(_0x509c33){throw createFetchFailureError(_0xf028dc,_0x509c33);}if(!_0x1d3580['ok']){if(_0x1d3580[_0x507c76(0x15e)]===0x191)throw CliErrors[_0x507c76(0x179)]();throw CliErrors[_0x507c76(0x16c)](_0x54cacf['label']+_0x507c76(0x165)+_0x1d3580[_0x507c76(0x15e)]);}const _0x36d7b8=await _0x1d3580[_0x507c76(0x150)]();if(_0x36d7b8[_0x507c76(0x189)]===![]){if(isAuthFailure(_0x36d7b8))throw CliErrors[_0x507c76(0x179)]();throw CliErrors['apiError'](_0x36d7b8['errorMsg']||_0x36d7b8[_0x507c76(0x1b7)]||_0x54cacf[_0x507c76(0x182)]+_0x507c76(0x153));}return _0x36d7b8[_0x507c76(0x167)];}export async function platformRequest(_0x496f0f,_0xb912af){const _0x46ed29=a179_0x3a01;if(/^https?:\/\//i[_0x46ed29(0x19f)](_0x496f0f))throw CliErrors[_0x46ed29(0x1db)](_0x46ed29(0x1ff)+_0x496f0f,_0x46ed29(0x1a4));const _0x7b221=_0x496f0f['startsWith']('/')?_0x496f0f:'/'+_0x496f0f;return platformFetch(''+getApiDomain()+_0x7b221,_0xb912af);}function cleanNewlines(_0x4f059b){const _0x2be05f=a179_0x3a01;return _0x4f059b[_0x2be05f(0x197)](/[\r\n]+/g,'\x20')[_0x2be05f(0x176)]();}function cleanDatasetName(_0x47ba2c){const _0x311f58=a179_0x3a01;if(!_0x47ba2c[_0x311f58(0x20d)])return _0x47ba2c;return{..._0x47ba2c,'name':cleanNewlines(_0x47ba2c['name'])};}export async function fetchModelList(_0x158f34,_0x17de09){const _0x166d16=a179_0x3a01,_0x5706cb=getEnv(),_0x1b16da=new URLSearchParams({'appcode':_0x158f34,'otype':_0x166d16(0x15c)}),_0x16f5ef=_0x166d16(0x1f8)+_0x1b16da[_0x166d16(0x1af)]();logger['info'](_0x166d16(0x151),_0x166d16(0x1b2)+_0x5706cb+')',{'apiPath':_0x16f5ef});const _0x409d06=await platformRequest(_0x16f5ef,{'cookie':_0x17de09,'label':'Fetch\x20datasets'}),_0x3b0bff=(_0x409d06['configArray']??[])[_0x166d16(0x15d)](cleanDatasetName);return{'configArray':_0x3b0bff,'count':_0x3b0bff[_0x166d16(0x1ae)]};}export async function fetchDatasetDoc(_0x16af76){const _0x42fa0e=a179_0x3a01,{appCode:_0x141274,cookie:_0x23bbcb,datasetCode:_0x493716,datasetId:_0x36996e,extraParams:_0x520383}=_0x16af76,_0x4abdad=await platformRequest(_0x42fa0e(0x172),{'method':_0x42fa0e(0x1e3),'body':{'appCode':_0x141274,'datasetCode':_0x493716,'datasetId':_0x36996e,..._0x520383||{}},'cookie':_0x23bbcb,'label':_0x42fa0e(0x196)+_0x493716+')'});if(!_0x4abdad||typeof _0x4abdad[_0x42fa0e(0x1a0)]!==_0x42fa0e(0x1e6))throw new Error(_0x42fa0e(0x170)+_0x493716+_0x42fa0e(0x15a));return _0x4abdad[_0x42fa0e(0x1a0)];}export async function getMenuTree(_0x53cd99,_0x1f8fc7){const _0x1ab5fe=a179_0x3a01,_0x4875c5=new URLSearchParams({'appCode':_0x53cd99});return platformRequest(_0x1ab5fe(0x19c)+_0x4875c5[_0x1ab5fe(0x1af)](),{'cookie':_0x1f8fc7,'label':_0x1ab5fe(0x19d)});}function a179_0x3a01(_0x1cfc12,_0x272cad){_0x1cfc12=_0x1cfc12-0x13e;const _0x386f23=a179_0x386f();let _0x3a0100=_0x386f23[_0x1cfc12];return _0x3a0100;}export async function createMenuRecord(_0x51f01e,_0x43055a,_0x4e098d){return platformRequest('/smartapi/menu/create',{'method':'POST','body':_0x51f01e,'cookie':_0x43055a,'label':_0x4e098d});}export async function updateMenuRecord(_0x442267,_0x275c56,_0xea1169){const _0x341506=a179_0x3a01;return platformRequest(_0x341506(0x1a5),{'method':_0x341506(0x1e3),'body':_0x442267,'cookie':_0x275c56,'label':_0xea1169});}export async function listBffScripts(_0x609f7e,_0x5b23c4,_0x492d6b){const _0x13fff7=a179_0x3a01;let _0x157841='/api/management/library/scripts/list?appCode='+_0x609f7e;if(_0x5b23c4)_0x157841+='&type='+_0x5b23c4;const _0x11f0f2=await apiRequest(_0x157841);let _0x4af1cd=extractList(_0x11f0f2[_0x13fff7(0x167)]);if(_0x492d6b?.[_0x13fff7(0x164)]){const _0x3fc003=_0x492d6b[_0x13fff7(0x164)][_0x13fff7(0x1fa)]();_0x4af1cd=_0x4af1cd[_0x13fff7(0x1cf)](_0x123f15=>_0x123f15[_0x13fff7(0x1ad)]?.[_0x13fff7(0x1fa)]()['includes'](_0x3fc003)||_0x123f15['description']?.['toLowerCase']()[_0x13fff7(0x210)](_0x3fc003));}return _0x4af1cd;}export async function getBffScriptInfo(_0x1811fe){const _0x1dabaa=a179_0x3a01,_0x1f36ff=await apiRequest(_0x1dabaa(0x213)+_0x1811fe);if(!_0x1f36ff[_0x1dabaa(0x167)])throw CliErrors['validation'](_0x1dabaa(0x208)+_0x1811fe);return _0x1f36ff[_0x1dabaa(0x167)];}export async function saveBffScript(_0x15b783){const _0x4855d2=a179_0x3a01,_0x54b620=await apiRequest(_0x4855d2(0x173),{'method':_0x4855d2(0x1e3),'body':_0x15b783}),{id:_0x42bb70,entity:_0x386a9c}=normalizeEntityWithIdResponse(_0x54b620[_0x4855d2(0x167)]);if(_0x42bb70!==undefined){const _0x5afc1a=typeof _0x386a9c[_0x4855d2(0x1ad)]===_0x4855d2(0x1e6)||typeof _0x386a9c['scriptType']===_0x4855d2(0x1e6)?_0x386a9c:undefined;return{'id':_0x42bb70,'script':_0x5afc1a};}throw CliErrors[_0x4855d2(0x16c)](_0x4855d2(0x1bf));}export async function deleteBffScript(_0x1a5521){const _0x2b0ac4=a179_0x3a01;await apiRequest(_0x2b0ac4(0x1f7),{'method':_0x2b0ac4(0x1e3),'body':{'id':_0x1a5521}});}export async function getBffScriptStatistics(_0x372c51){const _0x4ac09b=a179_0x3a01,_0x542436=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x372c51);return extractList(_0x542436[_0x4ac09b(0x167)]);}export async function clearBffScriptCache(){const _0x33f35a=a179_0x3a01,_0x50f7fa=await apiRequest(_0x33f35a(0x1ee),{'method':'POST','useRuntime':!![]});return typeof _0x50f7fa[_0x33f35a(0x167)]==='string'?_0x50f7fa[_0x33f35a(0x167)]:'';}export async function listBffDatasetOperations(_0x2c5f29,_0x317be4){const _0x4f3f8e=a179_0x3a01,_0x5933ca=await apiRequest(_0x4f3f8e(0x1c5),{'method':'POST','body':{'appCode':_0x2c5f29,'datasetId':_0x317be4}});return _0x5933ca[_0x4f3f8e(0x167)];}export async function listSqlQueries(_0x450acc,_0x14a020){const _0x192af9=a179_0x3a01,_0x3182f3=await apiRequest(_0x192af9(0x1b1),{'method':_0x192af9(0x1e3),'body':{'appCode':_0x450acc,'currentPage':_0x14a020?.[_0x192af9(0x188)]??0x1,'pageSize':_0x14a020?.[_0x192af9(0x20b)]??0x32,'sqlCode':_0x14a020?.['sqlCode'],'sqlName':_0x14a020?.[_0x192af9(0x17b)]}});return _0x3182f3[_0x192af9(0x167)];}export async function getSqlQueryInfo(_0x1a3b35,_0x24d862){const _0x1dd4b7=a179_0x3a01,_0x401799=await listSqlQueries(_0x1a3b35,{'sqlCode':_0x24d862}),_0x1345f1=_0x401799['tableData']?.[0x0];if(!_0x1345f1)throw CliErrors[_0x1dd4b7(0x1db)]('SQL\x20query\x20not\x20found:\x20'+_0x24d862);return _0x1345f1;}function a179_0x386f(){const _0x1be7b3=['/smartapi/dblink/update','list','includes','version','/smartapi/dataset/text-generate/status?','/api/management/library/scripts/info?id=','/userTenant/getByTenantCode','tableList','path','body','datasetTableCount','.create({\x20/*\x20fields\x20*/\x20});','Unauthorized','summary','/filter','deleted','/smartapi/permit/resource/get-api-list','CUSTOM','/smartapi/custom/updateUserCustomSql','planId','GET','\x20\x20return\x20rows;','operationId','stringify','401','appCode','ENABLE','/smartapi/permit/user-role/get-user-list','/smartapi/custom/getUserCustomSql?id=','join','totalCount','json','fetch-model-list','pageIndex','\x20failed','method','Warning:\x20showing\x20first\x20','requirementDescription','92092kHguUi','/api/node-toolbox/sql/save','/smartapi/permit/role/delete','):\x20missing\x20data.markdown\x20field','set','array','map','status','API\x20error\x20code:\x20','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20\x20pageSize:\x2020,','2200832oxEUnD','userId','scriptName','\x20failed,\x20HTTP\x20','push','data','\x20\x20currentPage:\x201,','has','max','793218yfueSe','apiError','/smartapi/permit/resource/get-menu-list','requestFields','responseFields','Invalid\x20response\x20format\x20(','/smartapi/permit/page/get-one','/api/node-toolbox/api-doc-generator','/api/management/library/scripts/save','Page\x20not\x20found:\x20','datasetName','trim','min','dbId','authRequired','/smartapi/dataset/update-driven-data','sqlName','isArray','errorMsg','/smartapi/app-config/getByKey','sqlCode','.remove(id);','/smartapi/lovrabet/update-page','label','signal','\x20\x20});','warn','\x20\x20where:\x20{},','/smartapi/question/er-config/erCreate','currentPage','success','getOne','code','336260KxJuCQ','/smartapi/permit/role/get-permit-list','remark','add','414hmOrzy','needPublic','9QKaote','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','dbtableConfig','36855IOkEnK','Fetch\x20doc\x20(','replace','tableData','errorCode','/smartapi/dataset/text-generate/start','/smartapi/dataset/text-generate/preview','/smartapi/menu/find?','Fetch\x20menu\x20list','type','test','markdown','includeImports','/smartapi/permit/role/get-one','/smartapi/lovrabet/dataset/','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/menu/update','/smartapi/dataset/restore-dataset','roleName','/smartapi/app-config/delete','/smartapi/lovrabet/detail?pageId=','clientOperationId','/generate-standard-pages/start','value','functionName','length','toString','.getOne(id);','/smartapi/custom/queryUserCustomSqlList','正在从服务器拉取模型列表...\x20(环境:\x20','/smartapi/permit/role/get-list','\x20\x20sqlCode:\x20\x27','SQL\x20query\x20not\x20found:\x20','\x20of\x20','message','/smartapi/dblink/create','\x20apps.\x20','avatar','/smartapi/app-config/update','entries','permits','24230gMznSb','BFF\x20save\x20returned\x20no\x20valid\x20id','roleType','/smartapi/question/er-config/update-single','needSelf','/smartapi/dblink/getOne','?sqlCode=','/smartapi/dataset/get-dataset-operation','username','const\x20data\x20=\x20await\x20client.sql.execute({','/smartapi/permit/user-role/update-user-list','cli:rabetbase','tableName','description','/smartapi/dblink/getList','AbortError','key','filter','UNAUTHORIZED','object','dataset_','\x20\x20\x20\x20sqlCode:\x20\x27','API\x20error:\x20','isFinite','const\x20result\x20=\x20await\x20client.models.','/api/','3880030AvhFUa','userTenantRelationList','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','validation','application/json','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','create','/smartapi/db-analysis/jobs/cancel','email','});','cookie','POST','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','string','displayName','Request\x20failed:\x20','delete','/smartapi/dataset/delete-dataset','/smartapi/permit/role/update','\x22\x20not\x20found\x20in\x20dataset\x20','modelId','/api/management/script/cache/clear','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','target','4gUzuAQ','/sync-to-pages','abort','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','Request\x20timeout:\x20','table','/api/management/library/scripts/delete','/api/node-toolbox/dataset/model-list?','errorMessage','toLowerCase','/smartapi/db-analysis/status/','//\x20SQL:\x20','modelCode','tags','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/permit/role/create','nickname','operationName','/generate-standard-pages/status?','.filter({','find','Operation\x20\x22','BFF\x20script\x20not\x20found:\x20id=','/smartapi/custom/getUserCustomSql','/smartapi/db-analysis/start','pageSize','(/*\x20params\x20*/);','name'];a179_0x386f=function(){return _0x1be7b3;};return a179_0x386f();}export async function getSqlQueryDetail(_0x3ad16b){const _0x5b45cb=a179_0x3a01,_0xd9f6e2=await apiRequest(_0x5b45cb(0x209)+(_0x5b45cb(0x1c4)+encodeURIComponent(_0x3ad16b)));if(!_0xd9f6e2['data'])throw CliErrors[_0x5b45cb(0x1db)](_0x5b45cb(0x1b5)+_0x3ad16b);return _0xd9f6e2[_0x5b45cb(0x167)];}export async function getSqlQueryDetailById(_0x376a37){const _0x1d13c6=a179_0x3a01,_0x6ca32f=await apiRequest(_0x1d13c6(0x14d)+_0x376a37);if(!_0x6ca32f[_0x1d13c6(0x167)])throw CliErrors[_0x1d13c6(0x1db)]('SQL\x20query\x20not\x20found:\x20id='+_0x376a37);return _0x6ca32f['data'];}export async function createSqlQuery(_0x1ed3f1){const _0x1c1be2=a179_0x3a01,_0x44494f=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0x1ed3f1}),{id:_0x3c8399,entity:_0x259185}=normalizeEntityWithIdResponse(_0x44494f[_0x1c1be2(0x167)]);if(!(_0x1c1be2(0x17f)in _0x259185)&&_0x3c8399)return getSqlQueryDetailById(_0x3c8399);return normalizeSqlQueryEntity(_0x259185);}export async function updateSqlQuery(_0x67ae6a){const _0x2a5a28=a179_0x3a01,_0x155d2a=await apiRequest(_0x2a5a28(0x143),{'method':_0x2a5a28(0x1e3),'body':_0x67ae6a}),{id:_0x2d6a81,entity:_0x226fb1}=normalizeEntityWithIdResponse(_0x155d2a[_0x2a5a28(0x167)]);if(!('sqlCode'in _0x226fb1)){if(_0x67ae6a[_0x2a5a28(0x17f)])return getSqlQueryDetail(_0x67ae6a[_0x2a5a28(0x17f)]);if(_0x2d6a81)return getSqlQueryDetailById(_0x2d6a81);}return normalizeSqlQueryEntity(_0x226fb1);}export async function deleteSqlQuery(_0x150c20){const _0x5c59b3=a179_0x3a01;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x5c59b3(0x1e3),'body':_0x150c20});}export async function saveSqlQuery(_0x5c4b53){const _0x47bc79=a179_0x3a01,_0xfaf7e6=await apiRequest(_0x47bc79(0x158),{'method':_0x47bc79(0x1e3),'body':_0x5c4b53});return _0xfaf7e6[_0x47bc79(0x167)];}function normalizeSqlQueryEntity(_0x3dbea1){const _0x3b3724=a179_0x3a01;return{..._0x3dbea1,'id':Number(_0x3dbea1['id']),'dbId':_0x3dbea1[_0x3b3724(0x178)]==null?undefined:Number(_0x3dbea1[_0x3b3724(0x178)]),'version':_0x3dbea1[_0x3b3724(0x211)]==null?undefined:Number(_0x3dbea1[_0x3b3724(0x211)])};}export async function executeSql(_0x5d2721,_0x179e43,_0x22fc64){const _0x1f28e4=a179_0x3a01,_0x168fb8=await apiRequest('/api/custom/executeSql',{'method':'POST','body':{'appCode':_0x5d2721,'sqlCode':_0x179e43,..._0x22fc64&&{'params':_0x22fc64}},'useRuntime':!![]});return _0x168fb8[_0x1f28e4(0x167)];}export async function executeDatasetDataOperation(_0x2e0578,_0x1b9921,_0x3b5585,_0x35adef={}){const _0x26ac21=a179_0x3a01;try{const _0x12df67=await apiRequest(_0x26ac21(0x1d7)+_0x2e0578+'/'+_0x1b9921+'/'+_0x3b5585,{'method':_0x26ac21(0x1e3),'body':_0x35adef,'useRuntime':!![]});return _0x12df67[_0x26ac21(0x167)];}catch(_0x150ff6){if(_0x3b5585===_0x26ac21(0x18a)&&_0x150ff6 instanceof CliError&&_0x150ff6[_0x26ac21(0x18b)]==='api_error'&&_0x35adef['id']!==undefined&&_0x35adef['id']!==null&&_0x35adef['id']!==''){const _0x2a62d5=await apiRequest('/api/'+_0x2e0578+'/'+_0x1b9921+_0x26ac21(0x13f),{'method':_0x26ac21(0x1e3),'body':{'where':{'id':{'$eq':_0x35adef['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x303bc1=Array[_0x26ac21(0x17c)](_0x2a62d5['data']?.[_0x26ac21(0x198)])?_0x2a62d5['data'][_0x26ac21(0x198)]:[];return _0x303bc1[0x0]??null;}throw _0x150ff6;}}export async function listDatasets(_0x2b1f7b,_0x35ed66){const _0x4c8231=a179_0x3a01,_0x2c2a95={'appCode':_0x2b1f7b,'deleted':_0x35ed66?.[_0x4c8231(0x140)]??![]};if(_0x35ed66?.[_0x4c8231(0x18b)])_0x2c2a95[_0x4c8231(0x18b)]=_0x35ed66[_0x4c8231(0x18b)];if(_0x35ed66?.[_0x4c8231(0x20d)])_0x2c2a95[_0x4c8231(0x20d)]=_0x35ed66[_0x4c8231(0x20d)];const _0x524410=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x4c8231(0x1e3),'body':_0x2c2a95});return extractList(_0x524410[_0x4c8231(0x167)]);}export async function deleteDataset(_0x51019c,_0x2ef2a8){const _0x2da770=a179_0x3a01;await apiRequest(_0x2da770(0x1ea),{'method':_0x2da770(0x1e3),'body':{'appCode':_0x51019c,'datasetId':_0x2ef2a8}});}export async function restoreDataset(_0x5f4dcc,_0x15a00d){const _0x1919c3=a179_0x3a01;await apiRequest(_0x1919c3(0x1a6),{'method':_0x1919c3(0x1e3),'body':{'appCode':_0x5f4dcc,'datasetId':_0x15a00d}});}export async function previewTextGeneratedDataset(_0x1686ed,_0x20a945){const _0x732136=a179_0x3a01,_0x5c6e64=await apiRequest(_0x732136(0x19b),{'method':_0x732136(0x1e3),'body':{'appCode':_0x1686ed,'datasetName':_0x20a945[_0x732136(0x175)],'requirementDescription':_0x20a945[_0x732136(0x156)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x5c6e64[_0x732136(0x167)];}export async function startTextGeneratedDataset(_0xc64045,_0x285cfb,_0x3264ca){const _0x2b5a9e=a179_0x3a01,_0x38e8ef=await apiRequest(_0x2b5a9e(0x19a),{'method':'POST','body':{'appCode':_0xc64045,..._0x3264ca?.['clientOperationId']?{'clientOperationId':_0x3264ca[_0x2b5a9e(0x1aa)]}:{},'design':_0x285cfb},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x38e8ef[_0x2b5a9e(0x167)];}export async function getTextGeneratedDatasetStatus(_0x2dfa76,_0x64bb75){const _0x154816=a179_0x3a01,_0x2a3259=new URLSearchParams({'appCode':_0x2dfa76});_0x64bb75[_0x154816(0x147)]&&_0x2a3259['set'](_0x154816(0x147),_0x64bb75[_0x154816(0x147)]);_0x64bb75[_0x154816(0x1aa)]&&_0x2a3259[_0x154816(0x15b)]('clientOperationId',_0x64bb75[_0x154816(0x1aa)]);const _0xbb6ebc=await apiRequest(_0x154816(0x212)+_0x2a3259[_0x154816(0x1af)]());return _0xbb6ebc[_0x154816(0x167)];}export async function searchDatasets(_0xf9fcb3,_0x2887f4){const _0x6393a3=a179_0x3a01,_0x4678bb=await listDatasets(_0xf9fcb3,{'name':_0x2887f4}),_0x4ba1fa=_0x2887f4[_0x6393a3(0x1fa)](),_0x386df1=new Set(_0x4678bb[_0x6393a3(0x15d)](_0x47e38a=>_0x47e38a['id'])),_0x52904b=_0x4678bb[_0x6393a3(0x1cf)](_0x433cf9=>_0x433cf9[_0x6393a3(0x194)]?.['tableName']?.[_0x6393a3(0x1fa)]()[_0x6393a3(0x210)](_0x4ba1fa)||_0x433cf9[_0x6393a3(0x1cb)]?.[_0x6393a3(0x1fa)]()[_0x6393a3(0x210)](_0x4ba1fa)),_0x460347=await listDatasets(_0xf9fcb3,{'code':_0x2887f4});for(const _0x4bdb6f of _0x460347){!_0x386df1[_0x6393a3(0x169)](_0x4bdb6f['id'])&&(_0x4678bb[_0x6393a3(0x166)](_0x4bdb6f),_0x386df1[_0x6393a3(0x18f)](_0x4bdb6f['id']));}return _0x4678bb;}export function normalizeDatasetOperations(_0x180278){const _0x11375c=a179_0x3a01;if(Array[_0x11375c(0x17c)](_0x180278))return _0x180278['filter'](_0x1d5ee4=>_0x1d5ee4!=null&&typeof _0x1d5ee4===_0x11375c(0x1d1));if(_0x180278&&typeof _0x180278===_0x11375c(0x1d1))return Object[_0x11375c(0x1bc)](_0x180278)[_0x11375c(0x1cf)](([,_0x47fe81])=>_0x47fe81!=null&&typeof _0x47fe81===_0x11375c(0x1d1))['map'](([_0x1af9fa,_0x3bce4e])=>({..._0x3bce4e,'name':_0x3bce4e[_0x11375c(0x20d)]??_0x3bce4e[_0x11375c(0x203)]??_0x1af9fa}));return[];}export async function getDatasetDetail(_0x49fdef){const _0x16e83a=a179_0x3a01,_0xfd71c1=/^\d+$/[_0x16e83a(0x19f)](_0x49fdef)?'id':_0x16e83a(0x18b),_0x586c81=await apiRequest('/smartapi/dataset/get-driven-data?'+_0xfd71c1+'='+_0x49fdef);return _0x586c81[_0x16e83a(0x167)];}export async function updateDrivenData(_0xfd374c){const _0xbe3765=a179_0x3a01,_0x3ac9b0=await apiRequest(_0xbe3765(0x17a),{'method':_0xbe3765(0x1e3),'body':_0xfd374c});return _0x3ac9b0[_0xbe3765(0x167)];}export async function getDatasetOperations(_0x390014){const _0x5879b1=a179_0x3a01,_0x385414=await getDatasetDetail(_0x390014),_0x278fcc=normalizeDatasetOperations(_0x385414['operations'])[_0x5879b1(0x15d)](_0x17b6af=>({'name':_0x17b6af[_0x5879b1(0x20d)]||_0x17b6af[_0x5879b1(0x203)],'displayName':_0x17b6af[_0x5879b1(0x1e7)]||_0x17b6af[_0x5879b1(0x20d)],'type':_0x17b6af[_0x5879b1(0x19e)],'method':_0x17b6af[_0x5879b1(0x154)],'path':_0x17b6af[_0x5879b1(0x216)],'enabled':_0x17b6af['enabled']??!![],'requestFields':_0x17b6af[_0x5879b1(0x16e)],'responseFields':_0x17b6af[_0x5879b1(0x16f)]}));return{'dataset':{'id':_0x385414['id']??_0x385414[_0x5879b1(0x1ed)],'name':_0x385414[_0x5879b1(0x20d)],'code':_0x385414[_0x5879b1(0x18b)]||_0x385414[_0x5879b1(0x1fd)],'tableName':_0x385414[_0x5879b1(0x1ca)]||_0x385414['dbtableConfig']?.['tableName']},'operations':_0x278fcc};}export async function getOperationDetail(_0x1826a7,_0x406517,_0x9bc202){const _0x68982c=a179_0x3a01;let _0x1ade01=_0x406517;if(!/^\d+$/[_0x68982c(0x19f)](_0x406517)){const _0x352176=await listDatasets(_0x1826a7,{'code':_0x406517}),_0x2fd205=_0x352176[_0x68982c(0x206)](_0x5416fe=>_0x5416fe[_0x68982c(0x18b)]===_0x406517||String(_0x5416fe['id'])===_0x406517);if(!_0x2fd205)throw CliErrors[_0x68982c(0x1db)]('Dataset\x20not\x20found:\x20'+_0x406517);_0x1ade01=String(_0x2fd205['id']);}const _0x2658fd=await getDatasetDetail(_0x1ade01),_0x2696b5=normalizeDatasetOperations(_0x2658fd['operations'])['find'](_0x1a6eee=>(_0x1a6eee[_0x68982c(0x20d)]||_0x1a6eee[_0x68982c(0x203)])===_0x9bc202);if(!_0x2696b5)throw CliErrors[_0x68982c(0x1db)](_0x68982c(0x207)+_0x9bc202+_0x68982c(0x1ec)+_0x406517);return{'dataset':{'id':_0x2658fd['id']??_0x2658fd[_0x68982c(0x1ed)],'name':_0x2658fd[_0x68982c(0x20d)],'code':_0x2658fd[_0x68982c(0x18b)]||_0x2658fd[_0x68982c(0x1fd)],'tableName':_0x2658fd[_0x68982c(0x1ca)]||_0x2658fd[_0x68982c(0x194)]?.[_0x68982c(0x1ca)]},'operation':_0x2696b5};}export async function startGenerateStandardPages(_0x3ef647,_0x41534d,_0x185a48){const _0x4997b1=a179_0x3a01,_0x1350f3=await apiRequest(_0x4997b1(0x1a3)+_0x41534d+_0x4997b1(0x1ab),{'method':'POST','body':{'appCode':_0x3ef647,..._0x185a48?.[_0x4997b1(0x1aa)]?{'clientOperationId':_0x185a48[_0x4997b1(0x1aa)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1350f3[_0x4997b1(0x167)];}export async function getGenerateStandardPagesStatus(_0x40ed42,_0x216029,_0x1ffa6f){const _0x3b3674=a179_0x3a01,_0x4190e1=new URLSearchParams({'appCode':_0x40ed42});_0x1ffa6f[_0x3b3674(0x147)]&&_0x4190e1[_0x3b3674(0x15b)]('operationId',_0x1ffa6f['operationId']);_0x1ffa6f[_0x3b3674(0x1aa)]&&_0x4190e1[_0x3b3674(0x15b)](_0x3b3674(0x1aa),_0x1ffa6f[_0x3b3674(0x1aa)]);const _0x2ef55f=await apiRequest('/smartapi/lovrabet/dataset/'+_0x216029+_0x3b3674(0x204)+_0x4190e1[_0x3b3674(0x1af)]());return _0x2ef55f[_0x3b3674(0x167)];}export async function getStandardPageStatus(_0x78da18,_0x136b4d){const _0x95a3e5=await apiRequest('/smartapi/lovrabet/dataset/'+_0x136b4d+'/standard-page-status?appCode='+encodeURIComponent(_0x78da18));return _0x95a3e5['data'];}export async function tryGetStandardPageStatus(_0x47859d,_0x218f31){const _0x4e7f28=a179_0x3a01;try{return await getStandardPageStatus(_0x47859d,_0x218f31);}catch(_0x4ba6c2){if(_0x4ba6c2 instanceof CliError&&_0x4ba6c2[_0x4e7f28(0x18b)]==='api_error'&&/404|not found|non-json response/i[_0x4e7f28(0x19f)](_0x4ba6c2[_0x4e7f28(0x1b7)]))return null;throw _0x4ba6c2;}}export async function syncStandardPages(_0x34778e,_0x128a7d){const _0x386e5b=a179_0x3a01,_0x2e0df6=await apiRequest(_0x386e5b(0x1a3)+_0x128a7d+_0x386e5b(0x1f2),{'method':'POST','body':{'appCode':_0x34778e}});return _0x2e0df6[_0x386e5b(0x167)];}export async function getPageDetail(_0x39e29b){const _0x160592=a179_0x3a01,_0x23c501=await apiRequest(_0x160592(0x1a9)+_0x39e29b);if(!_0x23c501['data'])throw CliErrors['validation'](_0x160592(0x174)+_0x39e29b);return _0x23c501[_0x160592(0x167)];}export async function updatePage(_0x4749d1,_0x2e28a1,_0x1f3a49,_0x96a0f1){const _0x4651fd=a179_0x3a01,_0x2be029=await apiRequest(_0x4651fd(0x181),{'method':_0x4651fd(0x1e3),'body':{'appCode':_0x4749d1,'pageId':_0x2e28a1,'code':_0x1f3a49,'datasetIds':_0x96a0f1}});return _0x2be029[_0x4651fd(0x167)];}export function generateSdkCode(_0x4b3ffc,_0x45e218,_0x42aa0a){const _0x252bbe=a179_0x3a01,_0xab41b0=_0x42aa0a?.[_0x252bbe(0x1a1)]??!![],_0x4efb96=_0x252bbe(0x1d2)+_0x4b3ffc[_0x252bbe(0x18b)]?.[_0x252bbe(0x197)](/-/g,'_'),_0x59a241=_0x45e218[_0x252bbe(0x20d)]||_0x45e218['operationName']||_0x252bbe(0x1cf),_0x34e530=[];_0xab41b0&&_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1ef),'',_0x252bbe(0x160),'');_0x34e530['push']('//\x20'+_0x4b3ffc[_0x252bbe(0x20d)]+'\x20('+(_0x4b3ffc['tableName']||_0x252bbe(0x1f6))+')');if(_0x59a241==='filter')_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1d6)+_0x4efb96+_0x252bbe(0x205),_0x252bbe(0x186),_0x252bbe(0x161),_0x252bbe(0x168),'});');else{if(_0x59a241===_0x252bbe(0x18a))_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1d6)+_0x4efb96+_0x252bbe(0x1b0));else{if(_0x59a241===_0x252bbe(0x1de))_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1d6)+_0x4efb96+_0x252bbe(0x219));else{if(_0x59a241==='update')_0x34e530[_0x252bbe(0x166)]('const\x20result\x20=\x20await\x20client.models.'+_0x4efb96+_0x252bbe(0x1dd));else _0x59a241===_0x252bbe(0x1e9)||_0x59a241==='remove'?_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1d6)+_0x4efb96+_0x252bbe(0x180)):_0x34e530[_0x252bbe(0x166)](_0x252bbe(0x1d6)+_0x4efb96+'.'+_0x59a241+_0x252bbe(0x20c));}}}return _0x34e530[_0x252bbe(0x14e)]('\x0a');}export function generateSqlCodeTemplate(_0x5313b5,_0x3b7f28){const _0x6371e2=a179_0x3a01,_0x6ff5b2=_0x3b7f28?.[_0x6371e2(0x1f0)]??'sdk',_0xb0407=_0x3b7f28?.[_0x6371e2(0x1a1)]??!![],_0x4911df=[];return _0x4911df['push'](_0x6371e2(0x1fc)+_0x5313b5[_0x6371e2(0x17b)]+'\x20('+_0x5313b5[_0x6371e2(0x17f)]+')'),_0x6ff5b2==='sdk'?(_0xb0407&&_0x4911df[_0x6371e2(0x166)](_0x6371e2(0x1ef),'',_0x6371e2(0x160),''),_0x4911df['push'](_0x6371e2(0x1c7),_0x6371e2(0x1b4)+_0x5313b5[_0x6371e2(0x17f)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x6371e2(0x1e1),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x4911df['push'](_0x6371e2(0x1e4),_0x6371e2(0x193),_0x6371e2(0x1e5),_0x6371e2(0x1d3)+_0x5313b5[_0x6371e2(0x17f)]+'\x27,',_0x6371e2(0x200),_0x6371e2(0x184),_0x6371e2(0x146),'}'),_0x4911df[_0x6371e2(0x14e)]('\x0a');}export async function getErConfig(_0x2c772d,_0x3d039b){const _0x4678d9=a179_0x3a01,_0x4749ad=await apiRequest('/smartapi/question/er-config',{'method':_0x4678d9(0x1e3),'body':{'appCode':_0x2c772d,'dblinkId':_0x3d039b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x4749ad[_0x4678d9(0x167)];}export async function createErRelation(_0xf45efe){const _0x51caac=a179_0x3a01,_0x47fd2c=await apiRequest(_0x51caac(0x187),{'method':'POST','body':_0xf45efe,'allowNonJsonSuccess':!![]});return _0x47fd2c[_0x51caac(0x167)];}export async function updateErRelation(_0x2ab1f4){const _0x2b0570=a179_0x3a01,_0x80a52f=await apiRequest(_0x2b0570(0x1c1),{'method':_0x2b0570(0x1e3),'body':_0x2ab1f4,'allowNonJsonSuccess':!![]});return _0x80a52f[_0x2b0570(0x167)];}export async function deleteErRelation(_0x552fd4){const _0x488c94=a179_0x3a01,_0x370789=await apiRequest('/smartapi/question/er-config/erDelete',{'method':_0x488c94(0x1e3),'body':_0x552fd4,'allowNonJsonSuccess':!![]});return _0x370789['data'];}export async function updateErBusinessGroup(_0x17b6bc){const _0x4ad4cd=a179_0x3a01,_0x18c6e7=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':_0x4ad4cd(0x1e3),'body':_0x17b6bc,'allowNonJsonSuccess':!![]});return _0x18c6e7[_0x4ad4cd(0x167)];}function buildQuery(_0xed6cde){const _0x4c3fec=a179_0x3a01,_0x422407=new URLSearchParams();for(const [_0x4ca7eb,_0x383999]of Object[_0x4c3fec(0x1bc)](_0xed6cde)){if(_0x383999===undefined||_0x383999==='')continue;_0x422407[_0x4c3fec(0x15b)](_0x4ca7eb,String(_0x383999));}const _0x25c92b=_0x422407['toString']();return _0x25c92b?'?'+_0x25c92b:'';}export async function listAppConfigs(_0x2be151,_0x331156){const _0x19aa88=a179_0x3a01,_0xa7933=await apiRequest('/smartapi/app-config/list',{'method':_0x19aa88(0x1e3),'body':{'appCode':_0x2be151,..._0x331156?.[_0x19aa88(0x1ce)]?{'key':_0x331156[_0x19aa88(0x1ce)]}:{},..._0x331156?.[_0x19aa88(0x1fe)]?{'tags':_0x331156[_0x19aa88(0x1fe)]}:{}}});return extractAppConfigList(_0xa7933['data']);}export async function getAppConfigByKey(_0x5b821a,_0x4308f3){const _0x169253=a179_0x3a01,_0x53f9d2=await apiRequest(_0x169253(0x17e)+buildQuery({'appCode':_0x5b821a,'key':_0x4308f3}));return _0x53f9d2['data']??null;}export async function createAppConfig(_0x55f60f){const _0x248f38=a179_0x3a01,_0x2c0066=await apiRequest('/smartapi/app-config/create',{'method':_0x248f38(0x1e3),'body':{'appCode':_0x55f60f['appCode'],'key':_0x55f60f[_0x248f38(0x1ce)],'value':_0x55f60f[_0x248f38(0x1ac)],..._0x55f60f[_0x248f38(0x1fe)]?{'tags':_0x55f60f[_0x248f38(0x1fe)]}:{}}});return _0x2c0066[_0x248f38(0x167)];}export async function updateAppConfig(_0x423b21){const _0x1e2b9a=a179_0x3a01;await apiRequest(_0x1e2b9a(0x1bb),{'method':_0x1e2b9a(0x1e3),'body':{'id':_0x423b21['id'],'appCode':_0x423b21[_0x1e2b9a(0x14a)],'key':_0x423b21['key'],'value':_0x423b21[_0x1e2b9a(0x1ac)],..._0x423b21[_0x1e2b9a(0x1fe)]?{'tags':_0x423b21[_0x1e2b9a(0x1fe)]}:{}}});}export async function deleteAppConfig(_0x252316){const _0x388f61=a179_0x3a01;await apiRequest(_0x388f61(0x1a8),{'method':_0x388f61(0x1e3),'body':_0x252316});}function extractAppConfigList(_0x4eeb56){const _0xd75fc2=a179_0x3a01;if(Array[_0xd75fc2(0x17c)](_0x4eeb56))return _0x4eeb56;if(_0x4eeb56&&typeof _0x4eeb56===_0xd75fc2(0x1d1)&&Array[_0xd75fc2(0x17c)](_0x4eeb56[_0xd75fc2(0x20f)]))return _0x4eeb56[_0xd75fc2(0x20f)];return extractList(_0x4eeb56);}export async function listDbLinks(_0x12d3fa,_0x11df01){const _0x2ac4f8=a179_0x3a01,_0x3355d4=await apiRequest(_0x2ac4f8(0x1cc),{'method':_0x2ac4f8(0x1e3),'body':{'appCode':_0x12d3fa,'currentPage':_0x11df01?.['currentPage']??0x1,'pageSize':_0x11df01?.[_0x2ac4f8(0x20b)]??0x64}});return{'items':extractList(_0x3355d4[_0x2ac4f8(0x167)]),'paging':extractPaging(_0x3355d4[_0x2ac4f8(0x167)])};}export async function getDbLinkInfo(_0x523232){const _0x435c9e=a179_0x3a01,_0x1e4771=await apiRequest(_0x435c9e(0x1c3)+buildQuery({'id':_0x523232}));return _0x1e4771[_0x435c9e(0x167)];}export async function createDbLink(_0x11e7bf){const _0x49f2d2=a179_0x3a01,_0x32af93=await apiRequest(_0x49f2d2(0x1b8),{'method':'POST','body':_0x11e7bf});return _0x32af93[_0x49f2d2(0x167)];}export async function updateDbLink(_0x280daa){const _0x11d749=a179_0x3a01,_0x2f9cf7=await apiRequest(_0x11d749(0x20e),{'method':_0x11d749(0x1e3),'body':_0x280daa});return _0x2f9cf7[_0x11d749(0x167)];}export async function deleteDbLink(_0x574faa){const _0x55d5e9=a179_0x3a01;await apiRequest('/smartapi/dblink/delete',{'method':_0x55d5e9(0x1e3),'body':{'id':_0x574faa}});}export async function testDbLinkConnect(_0x26dd1f){const _0x2a84cc=a179_0x3a01,_0xf7d0fc=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x26dd1f}));return _0xf7d0fc[_0x2a84cc(0x167)];}export async function startDbAnalysis(_0x317c0b,_0x2be5e9){const _0x547840=a179_0x3a01,_0x5da985=await apiRequest(_0x547840(0x20a),{'method':_0x547840(0x1e3),'body':{'dbLinkId':_0x317c0b,..._0x2be5e9&&_0x2be5e9[_0x547840(0x1ae)]>0x0?{'tableNames':_0x2be5e9}:{}}}),_0x298382=_0x5da985[_0x547840(0x167)];if(typeof _0x298382===_0x547840(0x1e6))return _0x298382;if(_0x298382&&typeof _0x298382===_0x547840(0x1d1)&&typeof _0x298382[_0x547840(0x144)]===_0x547840(0x1e6))return _0x298382[_0x547840(0x144)];return _0x298382!=null?String(_0x298382):'';}export async function cancelDbAnalysis(_0x7fb066){const _0x15c091=a179_0x3a01;await apiRequest(_0x15c091(0x1df)+buildQuery({'planId':_0x7fb066}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x31fdd9){const _0x3872b0=a179_0x3a01,_0x179acd=await apiRequest(_0x3872b0(0x1fb)+encodeURIComponent(_0x31fdd9));return _0x179acd['data'];}export async function getDbAllTableList(_0x34ae1a,_0xa9afad){const _0x552903=a179_0x3a01,_0x241ff9=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x34ae1a,'dbLinkId':_0xa9afad})),_0x32adc0=_0x241ff9[_0x552903(0x167)];if(Array[_0x552903(0x17c)](_0x32adc0))return _0x32adc0;return extractList(_0x32adc0);}export async function getDbTableDiff(_0x3d8db8,_0x5539fe,_0x4f39c5){const _0x4b6686=a179_0x3a01,_0x7394b7=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x3d8db8,'dbLinkId':_0x5539fe,'pageIndex':_0x4f39c5?.[_0x4b6686(0x152)]??0x1,'pageSize':_0x4f39c5?.[_0x4b6686(0x20b)]??0x14,'tableName':_0x4f39c5?.[_0x4b6686(0x1ca)]})),_0x78be73=_0x7394b7[_0x4b6686(0x167)];return{'totalCount':_0x78be73?.['totalCount']??0x0,'physicalTableCount':_0x78be73?.['physicalTableCount']??0x0,'datasetTableCount':_0x78be73?.[_0x4b6686(0x218)]??0x0,..._0x78be73?.[_0x4b6686(0x13e)]?{'summary':_0x78be73[_0x4b6686(0x13e)]}:{},'tableList':Array[_0x4b6686(0x17c)](_0x78be73?.[_0x4b6686(0x215)])?_0x78be73[_0x4b6686(0x215)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x45725e=a179_0x3a01,_0x14427e=await apiRequest('/smartapi/app/getList',{'method':_0x45725e(0x1e3),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x407fd4=extractList(_0x14427e[_0x45725e(0x167)]),_0x54f412=extractPaging(_0x14427e[_0x45725e(0x167)]);return _0x54f412&&_0x54f412[_0x45725e(0x14f)]>REMOTE_APP_PAGE_SIZE&&console[_0x45725e(0x185)](_0x45725e(0x155)+REMOTE_APP_PAGE_SIZE+_0x45725e(0x1b6)+_0x54f412[_0x45725e(0x14f)]+_0x45725e(0x1b9)+_0x45725e(0x1f4)),_0x407fd4;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x231fff,_0x61a3b5){const _0x287d59=a179_0x3a01,_0x4614e0=Math[_0x287d59(0x177)](Math[_0x287d59(0x16a)](_0x61a3b5?.[_0x287d59(0x20b)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x301f22=await apiRequest(_0x287d59(0x1b3),{'method':'POST','body':{'appCode':_0x231fff,'currentPage':_0x61a3b5?.[_0x287d59(0x188)]??0x1,'pageSize':_0x4614e0}});return{'items':extractList(_0x301f22[_0x287d59(0x167)]),'paging':extractPaging(_0x301f22['data'])};}export async function getAppRole(_0x3c232b){const _0x365714=a179_0x3a01,_0x4a920f=await apiRequest(_0x365714(0x1a2)+buildQuery({'id':_0x3c232b}));return _0x4a920f[_0x365714(0x167)];}export async function createAppRole(_0x4dfbe3){const _0xd6579e=a179_0x3a01,_0x15d127=await apiRequest(_0xd6579e(0x201),{'method':_0xd6579e(0x1e3),'body':{'appCode':_0x4dfbe3[_0xd6579e(0x14a)],'roleName':_0x4dfbe3['roleName'],'roleType':_0xd6579e(0x142),..._0x4dfbe3[_0xd6579e(0x18e)]?{'remark':_0x4dfbe3['remark']}:{}}});return _0x15d127[_0xd6579e(0x167)];}export async function updateAppRole(_0x363b22){const _0x32e6e0=a179_0x3a01,_0xf5685=await apiRequest(_0x32e6e0(0x1eb),{'method':_0x32e6e0(0x1e3),'body':{'id':_0x363b22['id'],'appCode':_0x363b22[_0x32e6e0(0x14a)],..._0x363b22['roleType']?{'roleType':_0x363b22[_0x32e6e0(0x1c0)]}:{},..._0x363b22[_0x32e6e0(0x1a7)]!==undefined?{'roleName':_0x363b22[_0x32e6e0(0x1a7)]}:{},..._0x363b22['remark']!==undefined?{'remark':_0x363b22[_0x32e6e0(0x18e)]}:{},..._0x363b22[_0x32e6e0(0x1bd)]?{'permits':_0x363b22['permits']}:{}}});return _0xf5685[_0x32e6e0(0x167)];}export async function deleteAppRole(_0x5a3df7){const _0x5dda91=a179_0x3a01;await apiRequest(_0x5dda91(0x159),{'method':_0x5dda91(0x1e3),'body':{'id':_0x5a3df7}});}export async function listPermitRoles(_0x255dbb,_0xd4bcd7){const _0x44205e=a179_0x3a01,_0x558120=await apiRequest(_0x44205e(0x18d),{'method':'POST','body':{'appCode':_0x255dbb,..._0xd4bcd7?.[_0x44205e(0x1c2)]!==undefined?{'needSelf':_0xd4bcd7['needSelf']}:{},..._0xd4bcd7?.[_0x44205e(0x191)]!==undefined?{'needPublic':_0xd4bcd7[_0x44205e(0x191)]}:{}}});return extractList(_0x558120[_0x44205e(0x167)]);}export async function getRoleMenuResources(_0x5a3d3e,_0x59b4ab){const _0x129c31=a179_0x3a01,_0x79d654=await apiRequest(_0x129c31(0x16d),{'method':'POST','body':{'appCode':_0x5a3d3e,'roleId':_0x59b4ab}});return extractList(_0x79d654[_0x129c31(0x167)]);}export async function getRoleApiResources(_0x2d43ba,_0x511473){const _0x158e8b=a179_0x3a01,_0x4e007d=await apiRequest(_0x158e8b(0x141),{'method':_0x158e8b(0x1e3),'body':{'appCode':_0x2d43ba,'roleId':_0x511473}});return extractList(_0x4e007d[_0x158e8b(0x167)]);}export async function listRoleUsers(_0x2c3626){const _0x42a00f=a179_0x3a01,_0x455807=await apiRequest(_0x42a00f(0x14c),{'method':_0x42a00f(0x1e3),'body':{'appCode':_0x2c3626}});return extractList(_0x455807[_0x42a00f(0x167)]);}export async function updateRoleUsers(_0x59e202,_0x560212){const _0x12a9ab=a179_0x3a01;await apiRequest(_0x12a9ab(0x1c8),{'method':_0x12a9ab(0x1e3),'body':{'appCode':_0x59e202,'roleList':_0x560212}});}export async function getPagePermit(_0x5b58b8){const _0x53eb55=a179_0x3a01,_0x2b6b66=await apiRequest(_0x53eb55(0x171)+buildQuery({'menuId':_0x5b58b8}));return _0x2b6b66['data'];}export async function savePagePermit(_0x3c03f9){const _0x1bde94=a179_0x3a01,_0x1c62ef=await apiRequest('/smartapi/permit/page/save',{'method':'POST','body':_0x3c03f9});return _0x1c62ef[_0x1bde94(0x167)];}export async function getTenantMembers(_0x2a5ffa){const _0x3c5f72=a179_0x3a01,_0x4167df=await apiRequest(_0x3c5f72(0x214)+buildQuery({'code':_0x2a5ffa})),_0x148fa4=_0x4167df[_0x3c5f72(0x167)]??{},_0x34763e=Array[_0x3c5f72(0x17c)](_0x148fa4?.[_0x3c5f72(0x1d9)])?_0x148fa4[_0x3c5f72(0x1d9)]:[];return _0x34763e[_0x3c5f72(0x1cf)](_0x2b8cb9=>_0x2b8cb9?.[_0x3c5f72(0x15e)]===_0x3c5f72(0x14b)||_0x2b8cb9?.[_0x3c5f72(0x15e)]===undefined)[_0x3c5f72(0x15d)](_0x1e4626=>({'userId':Number(_0x1e4626[_0x3c5f72(0x163)]??_0x1e4626['id']),'username':_0x1e4626[_0x3c5f72(0x1c6)],'nickname':_0x1e4626[_0x3c5f72(0x202)],'status':_0x1e4626[_0x3c5f72(0x15e)],'email':_0x1e4626[_0x3c5f72(0x1e0)],'mobile':_0x1e4626['mobile'],'avatar':_0x1e4626[_0x3c5f72(0x1ba)]}))[_0x3c5f72(0x1cf)](_0x189f7a=>Number[_0x3c5f72(0x1d5)](_0x189f7a['userId'])&&_0x189f7a[_0x3c5f72(0x163)]>0x0);}
1
+ (function(_0x5a4de6,_0x2c5002){const _0x3aff90=a179_0x31d8,_0x17108a=_0x5a4de6();while(!![]){try{const _0x4997b7=parseInt(_0x3aff90(0x251))/0x1+-parseInt(_0x3aff90(0x1f9))/0x2*(parseInt(_0x3aff90(0x1bc))/0x3)+-parseInt(_0x3aff90(0x1e1))/0x4*(parseInt(_0x3aff90(0x1f7))/0x5)+-parseInt(_0x3aff90(0x206))/0x6+-parseInt(_0x3aff90(0x21f))/0x7*(parseInt(_0x3aff90(0x273))/0x8)+parseInt(_0x3aff90(0x262))/0x9+-parseInt(_0x3aff90(0x235))/0xa*(-parseInt(_0x3aff90(0x264))/0xb);if(_0x4997b7===_0x2c5002)break;else _0x17108a['push'](_0x17108a['shift']());}catch(_0x3477e7){_0x17108a['push'](_0x17108a['shift']());}}}(a179_0x3814,0x36ff8));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';function a179_0x3814(){const _0x2801c3=['totalCount','612234hMxNIt','SQL\x20query\x20not\x20found:\x20id=','/smartapi/permit/role/update','AbortError','\x20failed,\x20HTTP\x20','error','functionName','dbId','/api/','set','/smartapi/app-config/delete','/smartapi/db-analysis/jobs/cancel','sqlName','/smartapi/app-config/getByKey','string','email','tags','/smartapi/custom/getUserCustomSql?id=','ENABLE','modelId','code','isArray','22760FyyoZl','Page\x20not\x20found:\x20','operationId','const\x20data\x20=\x20await\x20client.sql.execute({','/smartapi/permit/user-role/update-user-list','Request\x20failed:\x20','enabled','/smartapi/dblink/getList','\x20\x20where:\x20{},','/smartapi/question/er-config/erDelete','/smartapi/permit/role/get-one','includeImports','length','?sqlCode=','/filter','/api/management/library/scripts/info?id=','planId','clientOperationId','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','mobile','/generate-standard-pages/status?','/sync-to-pages','api_error','/smartapi/dataset/text-generate/start','remark','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/api/node-toolbox/dataset/model-list?','array','410037cOqfyN','table','/smartapi/dataset/text-generate/status?','401','\x20\x20\x20\x20sqlCode:\x20\x27','success','SQL\x20query\x20not\x20found:\x20','scriptName','/smartapi/dataset/get-dataset-operation','/smartapi/permit/user-role/get-user-list','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','version','sdk','/smartapi/lovrabet/detail?pageId=','\x20failed','map','physicalTableCount','1293993oZyvVU','signal','1903dHmtAh','/smartapi/dblink/create','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/permit/role/get-list','currentPage','/smartapi/dataset/get-dataset-list','warn','/api/management/library/scripts/save','/smartapi/permit/role/delete','summary','cli:rabetbase','startsWith','GET','add','/api/management/library/scripts/list?appCode=','16ryUYts','datasetTableCount','label','/api/management/script/cache/clear','/smartapi/lovrabet/update-page','permits','find','});','Check\x20network\x20connectivity\x20and\x20try\x20again.','operationName','POST','BFF\x20save\x20returned\x20no\x20valid\x20id','delete','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','remove','\x20of\x20','min','authRequired','Request\x20timeout:\x20','stringify','entries','errorMessage','/api/custom/executeSql','join','message','modelCode','errorMsg','/smartapi/app/getList','tableList','type','errorCode','/smartapi/custom/getUserCustomSql','/api/management/library/scripts/statistics?appCode=','validation','/smartapi/db-analysis/start','3sJdsAW','object','pageSize','dbtableConfig','Operation\x20\x22','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','nickname','max','body','API\x20error:\x20','needPublic','getOne','/smartapi/question/er-config/business-group/edit','/smartapi/dblink/delete','/smartapi/dataset/restore-dataset','username','\x20\x20pageSize:\x2020,','/smartapi/permit/page/save','operations','\x22\x20not\x20found\x20in\x20dataset\x20','const\x20result\x20=\x20await\x20client.models.','requestFields','application/json','Invalid\x20response\x20format\x20(','path','sqlCode','deleted','\x20apps.\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','isFinite','&type=','configArray','/smartapi/menu/find?','roleName','toString','.remove(id);','roleType','12vMFpvY','create','/smartapi/dataset/get-driven-data?','test','datasetName','\x20\x20return\x20rows;','replace','/smartapi/db-analysis/status/','key','Warning:\x20showing\x20first\x20','/api/management/library/scripts/delete','/smartapi/custom/deleteUserCustomSql','/smartapi/menu/update','json','/generate-standard-pages/start','(/*\x20params\x20*/);','\x20\x20sqlCode:\x20\x27','/smartapi/custom/saveUserCustomSql','list','abort','push','UNAUTHORIZED','329660pbDbwQ','/smartapi/app-config/update','581454gfDlvs','Dataset\x20not\x20found:\x20','markdown','appCode','.getOne(id);','):\x20missing\x20data.markdown\x20field','update','userId','Fetch\x20datasets','name','description','filter','avatar','353058caARTF','needSelf','value','has','/api/node-toolbox/sql/save','/smartapi/dblink/getAllTableList','status','/smartapi/lovrabet/dataset/','method','apiError','tableName','toLowerCase','tableData','Unauthorized','/smartapi/question/er-config/erCreate','cookie','\x20\x20});','data','scriptType','/smartapi/dblink/update','includes','target','正在从服务器拉取模型列表...\x20(环境:\x20','requirementDescription'];a179_0x3814=function(){return _0x2801c3;};return a179_0x3814();}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(_0x18846e){_activeCookie=_0x18846e||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(_0x4e8cb5,_0x8d8482){const _0x4f597d=a179_0x31d8,_0x7a0bb=_0x8d8482 instanceof Error?_0x8d8482[_0x4f597d(0x28b)]:String(_0x8d8482);return CliErrors[_0x4f597d(0x20f)](_0x4f597d(0x23a)+_0x4e8cb5+(_0x7a0bb?'\x20('+_0x7a0bb+')':''),_0x4f597d(0x27b));}async function apiRequest(_0x1d541d,_0x4e7d76={}){const _0x5c14ec=a179_0x31d8,{method:method=_0x5c14ec(0x270),body:_0x39ff1a,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4e7d76,_0xc4b439=useRuntime?getRuntimeDomain():getApiDomain(),_0x21f169=_activeCookie||getCookie(),_0x4fec1a=''+_0xc4b439+_0x1d541d,_0x278c52=new AbortController(),_0x42c020=setTimeout(()=>_0x278c52[_0x5c14ec(0x1f4)](),timeout);try{const _0x74b590=await fetch(_0x4fec1a,{'method':method,'headers':{'Content-Type':_0x5c14ec(0x1d2),'Cookie':_0x21f169,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x39ff1a?JSON[_0x5c14ec(0x286)](_0x39ff1a):undefined,'signal':_0x278c52[_0x5c14ec(0x263)]});let _0x31f433;try{_0x31f433=await _0x74b590[_0x5c14ec(0x1ee)]();}catch(_0x49f741){if(_0x49f741 instanceof Error&&_0x49f741[_0x5c14ec(0x202)]==='AbortError')throw CliErrors[_0x5c14ec(0x20f)](_0x5c14ec(0x285)+_0x4fec1a);if(_0x74b590['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5c14ec(0x20f)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x74b590[_0x5c14ec(0x20c)]+')',_0x74b590[_0x5c14ec(0x20c)]>=0x190?_0x5c14ec(0x280):undefined);}if(!_0x74b590['ok']||_0x31f433['success']===![])throw CliErrors[_0x5c14ec(0x20f)](_0x31f433['errorMsg']||_0x31f433[_0x5c14ec(0x28b)]||_0x5c14ec(0x1c5)+_0x74b590[_0x5c14ec(0x20c)],_0x31f433['errorCode']?'API\x20error\x20code:\x20'+_0x31f433[_0x5c14ec(0x1b7)]:undefined);return _0x31f433;}catch(_0xa41ec8){if(_0xa41ec8 instanceof CliError)throw _0xa41ec8;if(_0xa41ec8 instanceof Error&&_0xa41ec8[_0x5c14ec(0x202)]===_0x5c14ec(0x222))throw CliErrors['apiError'](_0x5c14ec(0x285)+_0x4fec1a);throw createFetchFailureError(_0x4fec1a,_0xa41ec8);}finally{clearTimeout(_0x42c020);}}function isAuthFailure(_0xf33be8){const _0xfddacc=a179_0x31d8,_0x1c620d=_0xf33be8[_0xfddacc(0x28d)]||_0xf33be8[_0xfddacc(0x28b)]||_0xf33be8[_0xfddacc(0x217)]?.[_0xfddacc(0x28b)]||_0xf33be8[_0xfddacc(0x288)]||_0xf33be8[_0xfddacc(0x224)]||'';return _0xf33be8[_0xfddacc(0x1b7)]===_0xfddacc(0x1f6)||_0xf33be8[_0xfddacc(0x233)]===0x191||_0xf33be8[_0xfddacc(0x233)]===_0xfddacc(0x254)||_0x1c620d[_0xfddacc(0x21a)](_0xfddacc(0x254))||_0x1c620d[_0xfddacc(0x21a)](_0xfddacc(0x213))||_0x1c620d['includes']('登录')||_0x1c620d[_0xfddacc(0x21a)]('认证');}export async function platformFetch(_0x411a36,_0x46722d){const _0x2dbf2a=a179_0x31d8;let _0x2e9f47;try{_0x2e9f47=await fetch(_0x411a36,{'method':_0x46722d[_0x2dbf2a(0x20e)]??_0x2dbf2a(0x270),'headers':{'Content-Type':_0x2dbf2a(0x1d2),'Cookie':_0x46722d[_0x2dbf2a(0x215)],'X-Invoke-Source':_0x2dbf2a(0x26e)},..._0x46722d[_0x2dbf2a(0x1c4)]&&{'body':JSON[_0x2dbf2a(0x286)](_0x46722d[_0x2dbf2a(0x1c4)])}});}catch(_0xf624b3){throw createFetchFailureError(_0x411a36,_0xf624b3);}if(!_0x2e9f47['ok']){if(_0x2e9f47[_0x2dbf2a(0x20c)]===0x191)throw CliErrors[_0x2dbf2a(0x284)]();throw CliErrors['apiError'](_0x46722d[_0x2dbf2a(0x275)]+_0x2dbf2a(0x223)+_0x2e9f47[_0x2dbf2a(0x20c)]);}const _0x10d2f4=await _0x2e9f47['json']();if(_0x10d2f4[_0x2dbf2a(0x256)]===![]){if(isAuthFailure(_0x10d2f4))throw CliErrors[_0x2dbf2a(0x284)]();throw CliErrors[_0x2dbf2a(0x20f)](_0x10d2f4['errorMsg']||_0x10d2f4['message']||_0x46722d[_0x2dbf2a(0x275)]+_0x2dbf2a(0x25f));}return _0x10d2f4[_0x2dbf2a(0x217)];}export async function platformRequest(_0x3f3c65,_0x427e50){const _0x38783d=a179_0x31d8;if(/^https?:\/\//i[_0x38783d(0x1e4)](_0x3f3c65))throw CliErrors[_0x38783d(0x1ba)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x3f3c65,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x484138=_0x3f3c65[_0x38783d(0x26f)]('/')?_0x3f3c65:'/'+_0x3f3c65;return platformFetch(''+getApiDomain()+_0x484138,_0x427e50);}function cleanNewlines(_0x57975b){return _0x57975b['replace'](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x840491){const _0x4152ad=a179_0x31d8;if(!_0x840491['name'])return _0x840491;return{..._0x840491,'name':cleanNewlines(_0x840491[_0x4152ad(0x202)])};}export async function fetchModelList(_0x3b1870,_0x5c5583){const _0x3a4760=a179_0x31d8,_0x40b3ef=getEnv(),_0x39b071=new URLSearchParams({'appcode':_0x3b1870,'otype':_0x3a4760(0x250)}),_0x5ef3ee=_0x3a4760(0x24f)+_0x39b071[_0x3a4760(0x1de)]();logger['info']('fetch-model-list',_0x3a4760(0x21c)+_0x40b3ef+')',{'apiPath':_0x5ef3ee});const _0x2e3dba=await platformRequest(_0x5ef3ee,{'cookie':_0x5c5583,'label':_0x3a4760(0x201)}),_0x73909a=(_0x2e3dba[_0x3a4760(0x1db)]??[])[_0x3a4760(0x260)](cleanDatasetName);return{'configArray':_0x73909a,'count':_0x73909a[_0x3a4760(0x241)]};}export async function fetchDatasetDoc(_0x39b273){const _0x1df191=a179_0x31d8,{appCode:_0x160e47,cookie:_0x47c34c,datasetCode:_0x57665f,datasetId:_0xb61300,extraParams:_0x320695}=_0x39b273,_0x33829a=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':_0x1df191(0x27d),'body':{'appCode':_0x160e47,'datasetCode':_0x57665f,'datasetId':_0xb61300,..._0x320695||{}},'cookie':_0x47c34c,'label':'Fetch\x20doc\x20('+_0x57665f+')'});if(!_0x33829a||typeof _0x33829a[_0x1df191(0x1fb)]!==_0x1df191(0x22d))throw new Error(_0x1df191(0x1d3)+_0x57665f+_0x1df191(0x1fe));return _0x33829a[_0x1df191(0x1fb)];}export async function getMenuTree(_0x632b92,_0x5ab355){const _0x195a22=a179_0x31d8,_0x3e6c5a=new URLSearchParams({'appCode':_0x632b92});return platformRequest(_0x195a22(0x1dc)+_0x3e6c5a['toString'](),{'cookie':_0x5ab355,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x57cc6b,_0x2397bb,_0x481db2){return platformRequest('/smartapi/menu/create',{'method':'POST','body':_0x57cc6b,'cookie':_0x2397bb,'label':_0x481db2});}export async function updateMenuRecord(_0x30595c,_0x2c2995,_0x271286){const _0x36c2b5=a179_0x31d8;return platformRequest(_0x36c2b5(0x1ed),{'method':'POST','body':_0x30595c,'cookie':_0x2c2995,'label':_0x271286});}export async function listBffScripts(_0x50c645,_0x5684a2,_0x45443c){const _0x5185d5=a179_0x31d8;let _0x2988bf=_0x5185d5(0x272)+_0x50c645;if(_0x5684a2)_0x2988bf+=_0x5185d5(0x1da)+_0x5684a2;const _0x2f41f0=await apiRequest(_0x2988bf);let _0x3bb61e=extractList(_0x2f41f0[_0x5185d5(0x217)]);if(_0x45443c?.['scriptName']){const _0x274676=_0x45443c[_0x5185d5(0x258)][_0x5185d5(0x211)]();_0x3bb61e=_0x3bb61e[_0x5185d5(0x204)](_0x101a34=>_0x101a34[_0x5185d5(0x225)]?.[_0x5185d5(0x211)]()[_0x5185d5(0x21a)](_0x274676)||_0x101a34[_0x5185d5(0x203)]?.[_0x5185d5(0x211)]()[_0x5185d5(0x21a)](_0x274676));}return _0x3bb61e;}export async function getBffScriptInfo(_0x5a2140){const _0x290818=a179_0x31d8,_0x452093=await apiRequest(_0x290818(0x244)+_0x5a2140);if(!_0x452093[_0x290818(0x217)])throw CliErrors[_0x290818(0x1ba)]('BFF\x20script\x20not\x20found:\x20id='+_0x5a2140);return _0x452093[_0x290818(0x217)];}export async function saveBffScript(_0x4dd204){const _0x107d28=a179_0x31d8,_0x3e49b1=await apiRequest(_0x107d28(0x26b),{'method':_0x107d28(0x27d),'body':_0x4dd204}),{id:_0x5474fc,entity:_0x4e6d73}=normalizeEntityWithIdResponse(_0x3e49b1['data']);if(_0x5474fc!==undefined){const _0x4c029f=typeof _0x4e6d73[_0x107d28(0x225)]==='string'||typeof _0x4e6d73[_0x107d28(0x218)]===_0x107d28(0x22d)?_0x4e6d73:undefined;return{'id':_0x5474fc,'script':_0x4c029f};}throw CliErrors[_0x107d28(0x20f)](_0x107d28(0x27e));}export async function deleteBffScript(_0x4961da){const _0x1b5354=a179_0x31d8;await apiRequest(_0x1b5354(0x1eb),{'method':_0x1b5354(0x27d),'body':{'id':_0x4961da}});}export async function getBffScriptStatistics(_0x1a7449){const _0x3d938e=a179_0x31d8,_0x10d278=await apiRequest(_0x3d938e(0x1b9)+_0x1a7449);return extractList(_0x10d278[_0x3d938e(0x217)]);}export async function clearBffScriptCache(){const _0x575e36=a179_0x31d8,_0x49e89e=await apiRequest(_0x575e36(0x276),{'method':'POST','useRuntime':!![]});return typeof _0x49e89e['data']===_0x575e36(0x22d)?_0x49e89e[_0x575e36(0x217)]:'';}export async function listBffDatasetOperations(_0x327f39,_0x1390a1){const _0x1caf43=a179_0x31d8,_0x364ec5=await apiRequest(_0x1caf43(0x259),{'method':'POST','body':{'appCode':_0x327f39,'datasetId':_0x1390a1}});return _0x364ec5[_0x1caf43(0x217)];}export async function listSqlQueries(_0x558476,_0x35065b){const _0x3e3c9f=a179_0x31d8,_0x43d851=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x558476,'currentPage':_0x35065b?.[_0x3e3c9f(0x268)]??0x1,'pageSize':_0x35065b?.[_0x3e3c9f(0x1be)]??0x32,'sqlCode':_0x35065b?.[_0x3e3c9f(0x1d5)],'sqlName':_0x35065b?.['sqlName']}});return _0x43d851[_0x3e3c9f(0x217)];}export async function getSqlQueryInfo(_0x2af2f8,_0x46a0df){const _0x160779=a179_0x31d8,_0x459e36=await listSqlQueries(_0x2af2f8,{'sqlCode':_0x46a0df}),_0x5e483f=_0x459e36[_0x160779(0x212)]?.[0x0];if(!_0x5e483f)throw CliErrors[_0x160779(0x1ba)](_0x160779(0x257)+_0x46a0df);return _0x5e483f;}export async function getSqlQueryDetail(_0x3f1947){const _0x1d95e5=a179_0x31d8,_0x4ffdf6=await apiRequest(_0x1d95e5(0x1b8)+(_0x1d95e5(0x242)+encodeURIComponent(_0x3f1947)));if(!_0x4ffdf6[_0x1d95e5(0x217)])throw CliErrors[_0x1d95e5(0x1ba)](_0x1d95e5(0x257)+_0x3f1947);return _0x4ffdf6['data'];}export async function getSqlQueryDetailById(_0x66b134){const _0x4087aa=a179_0x31d8,_0x2337dc=await apiRequest(_0x4087aa(0x230)+_0x66b134);if(!_0x2337dc['data'])throw CliErrors[_0x4087aa(0x1ba)](_0x4087aa(0x220)+_0x66b134);return _0x2337dc[_0x4087aa(0x217)];}export async function createSqlQuery(_0x50c126){const _0xa6bdc8=a179_0x31d8,_0x5e417f=await apiRequest(_0xa6bdc8(0x1f2),{'method':_0xa6bdc8(0x27d),'body':_0x50c126}),{id:_0x1ff41f,entity:_0x142e1f}=normalizeEntityWithIdResponse(_0x5e417f['data']);if(!(_0xa6bdc8(0x1d5)in _0x142e1f)&&_0x1ff41f)return getSqlQueryDetailById(_0x1ff41f);return normalizeSqlQueryEntity(_0x142e1f);}export async function updateSqlQuery(_0x3c9617){const _0x1402d5=a179_0x31d8,_0x3f9532=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0x1402d5(0x27d),'body':_0x3c9617}),{id:_0x4bef15,entity:_0x201eb1}=normalizeEntityWithIdResponse(_0x3f9532[_0x1402d5(0x217)]);if(!(_0x1402d5(0x1d5)in _0x201eb1)){if(_0x3c9617[_0x1402d5(0x1d5)])return getSqlQueryDetail(_0x3c9617[_0x1402d5(0x1d5)]);if(_0x4bef15)return getSqlQueryDetailById(_0x4bef15);}return normalizeSqlQueryEntity(_0x201eb1);}export async function deleteSqlQuery(_0xd87772){const _0xbcb06d=a179_0x31d8;await apiRequest(_0xbcb06d(0x1ec),{'method':_0xbcb06d(0x27d),'body':_0xd87772});}export async function saveSqlQuery(_0x25f2cd){const _0x129a91=a179_0x31d8,_0x2f8331=await apiRequest(_0x129a91(0x20a),{'method':_0x129a91(0x27d),'body':_0x25f2cd});return _0x2f8331[_0x129a91(0x217)];}function normalizeSqlQueryEntity(_0x4deb2e){const _0x50327a=a179_0x31d8;return{..._0x4deb2e,'id':Number(_0x4deb2e['id']),'dbId':_0x4deb2e[_0x50327a(0x226)]==null?undefined:Number(_0x4deb2e[_0x50327a(0x226)]),'version':_0x4deb2e[_0x50327a(0x25c)]==null?undefined:Number(_0x4deb2e['version'])};}export async function executeSql(_0x3fbf75,_0x4722c5,_0x254a5e){const _0x1daf4f=a179_0x31d8,_0x13d243=await apiRequest(_0x1daf4f(0x289),{'method':_0x1daf4f(0x27d),'body':{'appCode':_0x3fbf75,'sqlCode':_0x4722c5,..._0x254a5e&&{'params':_0x254a5e}},'useRuntime':!![]});return _0x13d243[_0x1daf4f(0x217)];}export async function executeDatasetDataOperation(_0x50a19e,_0x36c0d2,_0x5e25b5,_0x49e54c={}){const _0x2dade1=a179_0x31d8;try{const _0x294a36=await apiRequest('/api/'+_0x50a19e+'/'+_0x36c0d2+'/'+_0x5e25b5,{'method':_0x2dade1(0x27d),'body':_0x49e54c,'useRuntime':!![]});return _0x294a36[_0x2dade1(0x217)];}catch(_0x56cd6f){if(_0x5e25b5==='getOne'&&_0x56cd6f instanceof CliError&&_0x56cd6f['code']==='api_error'&&_0x49e54c['id']!==undefined&&_0x49e54c['id']!==null&&_0x49e54c['id']!==''){const _0x19211e=await apiRequest(_0x2dade1(0x227)+_0x50a19e+'/'+_0x36c0d2+_0x2dade1(0x243),{'method':_0x2dade1(0x27d),'body':{'where':{'id':{'$eq':_0x49e54c['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x34d5cd=Array[_0x2dade1(0x234)](_0x19211e[_0x2dade1(0x217)]?.[_0x2dade1(0x212)])?_0x19211e['data'][_0x2dade1(0x212)]:[];return _0x34d5cd[0x0]??null;}throw _0x56cd6f;}}export async function listDatasets(_0x51ee64,_0x74c86f){const _0x53a38a=a179_0x31d8,_0x15302b={'appCode':_0x51ee64,'deleted':_0x74c86f?.[_0x53a38a(0x1d6)]??![]};if(_0x74c86f?.['code'])_0x15302b[_0x53a38a(0x233)]=_0x74c86f[_0x53a38a(0x233)];if(_0x74c86f?.[_0x53a38a(0x202)])_0x15302b[_0x53a38a(0x202)]=_0x74c86f['name'];const _0x2d64fb=await apiRequest(_0x53a38a(0x269),{'method':_0x53a38a(0x27d),'body':_0x15302b});return extractList(_0x2d64fb[_0x53a38a(0x217)]);}export async function deleteDataset(_0x1e488d,_0x409fce){const _0x40058a=a179_0x31d8;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x40058a(0x27d),'body':{'appCode':_0x1e488d,'datasetId':_0x409fce}});}export async function restoreDataset(_0x1311c3,_0x1720e4){const _0x225470=a179_0x31d8;await apiRequest(_0x225470(0x1ca),{'method':_0x225470(0x27d),'body':{'appCode':_0x1311c3,'datasetId':_0x1720e4}});}export async function previewTextGeneratedDataset(_0x22c399,_0x345e03){const _0x4291ca=a179_0x31d8,_0xc4e729=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x4291ca(0x27d),'body':{'appCode':_0x22c399,'datasetName':_0x345e03[_0x4291ca(0x1e5)],'requirementDescription':_0x345e03[_0x4291ca(0x21d)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0xc4e729[_0x4291ca(0x217)];}export async function startTextGeneratedDataset(_0x1b4282,_0x2bb54a,_0x5ea148){const _0x58f269=a179_0x31d8,_0x488a31=await apiRequest(_0x58f269(0x24c),{'method':_0x58f269(0x27d),'body':{'appCode':_0x1b4282,..._0x5ea148?.[_0x58f269(0x246)]?{'clientOperationId':_0x5ea148[_0x58f269(0x246)]}:{},'design':_0x2bb54a},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x488a31['data'];}export async function getTextGeneratedDatasetStatus(_0x4996c0,_0x475460){const _0x47c486=a179_0x31d8,_0x3fb1dd=new URLSearchParams({'appCode':_0x4996c0});_0x475460[_0x47c486(0x237)]&&_0x3fb1dd[_0x47c486(0x228)]('operationId',_0x475460['operationId']);_0x475460['clientOperationId']&&_0x3fb1dd[_0x47c486(0x228)](_0x47c486(0x246),_0x475460[_0x47c486(0x246)]);const _0x13d055=await apiRequest(_0x47c486(0x253)+_0x3fb1dd['toString']());return _0x13d055[_0x47c486(0x217)];}function a179_0x31d8(_0x405c99,_0x208195){_0x405c99=_0x405c99-0x1b7;const _0x381428=a179_0x3814();let _0x31d895=_0x381428[_0x405c99];return _0x31d895;}export async function searchDatasets(_0x51ab66,_0x427430){const _0x583f6e=a179_0x31d8,_0x767c75=await listDatasets(_0x51ab66,{'name':_0x427430}),_0x8a4fb=_0x427430[_0x583f6e(0x211)](),_0xb3d0ba=new Set(_0x767c75[_0x583f6e(0x260)](_0xa98661=>_0xa98661['id'])),_0x19d880=_0x767c75[_0x583f6e(0x204)](_0x82a9e6=>_0x82a9e6[_0x583f6e(0x1bf)]?.[_0x583f6e(0x210)]?.[_0x583f6e(0x211)]()[_0x583f6e(0x21a)](_0x8a4fb)||_0x82a9e6['description']?.[_0x583f6e(0x211)]()[_0x583f6e(0x21a)](_0x8a4fb)),_0x37909a=await listDatasets(_0x51ab66,{'code':_0x427430});for(const _0x301693 of _0x37909a){!_0xb3d0ba[_0x583f6e(0x209)](_0x301693['id'])&&(_0x767c75[_0x583f6e(0x1f5)](_0x301693),_0xb3d0ba[_0x583f6e(0x271)](_0x301693['id']));}return _0x767c75;}export function normalizeDatasetOperations(_0x2df065){const _0x3666fb=a179_0x31d8;if(Array[_0x3666fb(0x234)](_0x2df065))return _0x2df065[_0x3666fb(0x204)](_0x1705a0=>_0x1705a0!=null&&typeof _0x1705a0===_0x3666fb(0x1bd));if(_0x2df065&&typeof _0x2df065===_0x3666fb(0x1bd))return Object[_0x3666fb(0x287)](_0x2df065)[_0x3666fb(0x204)](([,_0x26b3b1])=>_0x26b3b1!=null&&typeof _0x26b3b1===_0x3666fb(0x1bd))['map'](([_0x35b135,_0x5f1eef])=>({..._0x5f1eef,'name':_0x5f1eef[_0x3666fb(0x202)]??_0x5f1eef[_0x3666fb(0x27c)]??_0x35b135}));return[];}export async function getDatasetDetail(_0x402e34){const _0x5358ab=a179_0x31d8,_0x4a71ba=/^\d+$/[_0x5358ab(0x1e4)](_0x402e34)?'id':_0x5358ab(0x233),_0x125e29=await apiRequest(_0x5358ab(0x1e3)+_0x4a71ba+'='+_0x402e34);return _0x125e29[_0x5358ab(0x217)];}export async function updateDrivenData(_0x285677){const _0x275830=a179_0x31d8,_0x39dbd1=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x285677});return _0x39dbd1[_0x275830(0x217)];}export async function getDatasetOperations(_0x2de6f2){const _0x51f548=a179_0x31d8,_0xa986f8=await getDatasetDetail(_0x2de6f2),_0x338ad4=normalizeDatasetOperations(_0xa986f8[_0x51f548(0x1ce)])[_0x51f548(0x260)](_0x2801de=>({'name':_0x2801de[_0x51f548(0x202)]||_0x2801de[_0x51f548(0x27c)],'displayName':_0x2801de['displayName']||_0x2801de[_0x51f548(0x202)],'type':_0x2801de[_0x51f548(0x290)],'method':_0x2801de[_0x51f548(0x20e)],'path':_0x2801de[_0x51f548(0x1d4)],'enabled':_0x2801de[_0x51f548(0x23b)]??!![],'requestFields':_0x2801de[_0x51f548(0x1d1)],'responseFields':_0x2801de['responseFields']}));return{'dataset':{'id':_0xa986f8['id']??_0xa986f8[_0x51f548(0x232)],'name':_0xa986f8[_0x51f548(0x202)],'code':_0xa986f8[_0x51f548(0x233)]||_0xa986f8[_0x51f548(0x28c)],'tableName':_0xa986f8[_0x51f548(0x210)]||_0xa986f8[_0x51f548(0x1bf)]?.[_0x51f548(0x210)]},'operations':_0x338ad4};}export async function getOperationDetail(_0x59059a,_0x275f5e,_0x37346e){const _0x40a206=a179_0x31d8;let _0x597a7d=_0x275f5e;if(!/^\d+$/[_0x40a206(0x1e4)](_0x275f5e)){const _0x451542=await listDatasets(_0x59059a,{'code':_0x275f5e}),_0x32612c=_0x451542['find'](_0x206cc1=>_0x206cc1[_0x40a206(0x233)]===_0x275f5e||String(_0x206cc1['id'])===_0x275f5e);if(!_0x32612c)throw CliErrors[_0x40a206(0x1ba)](_0x40a206(0x1fa)+_0x275f5e);_0x597a7d=String(_0x32612c['id']);}const _0x391a23=await getDatasetDetail(_0x597a7d),_0x2e8155=normalizeDatasetOperations(_0x391a23[_0x40a206(0x1ce)])[_0x40a206(0x279)](_0x3f98d1=>(_0x3f98d1[_0x40a206(0x202)]||_0x3f98d1[_0x40a206(0x27c)])===_0x37346e);if(!_0x2e8155)throw CliErrors[_0x40a206(0x1ba)](_0x40a206(0x1c0)+_0x37346e+_0x40a206(0x1cf)+_0x275f5e);return{'dataset':{'id':_0x391a23['id']??_0x391a23[_0x40a206(0x232)],'name':_0x391a23[_0x40a206(0x202)],'code':_0x391a23[_0x40a206(0x233)]||_0x391a23[_0x40a206(0x28c)],'tableName':_0x391a23['tableName']||_0x391a23[_0x40a206(0x1bf)]?.['tableName']},'operation':_0x2e8155};}export async function startGenerateStandardPages(_0x534966,_0x4f020b,_0x1d3deb){const _0x1e0545=a179_0x31d8,_0x466a69=await apiRequest(_0x1e0545(0x20d)+_0x4f020b+_0x1e0545(0x1ef),{'method':_0x1e0545(0x27d),'body':{'appCode':_0x534966,..._0x1d3deb?.['clientOperationId']?{'clientOperationId':_0x1d3deb['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x466a69[_0x1e0545(0x217)];}export async function getGenerateStandardPagesStatus(_0x595e6c,_0x3c0a4c,_0x43ce6d){const _0x384496=a179_0x31d8,_0x5f18c9=new URLSearchParams({'appCode':_0x595e6c});_0x43ce6d[_0x384496(0x237)]&&_0x5f18c9[_0x384496(0x228)]('operationId',_0x43ce6d[_0x384496(0x237)]);_0x43ce6d[_0x384496(0x246)]&&_0x5f18c9['set'](_0x384496(0x246),_0x43ce6d[_0x384496(0x246)]);const _0xd5f96c=await apiRequest(_0x384496(0x20d)+_0x3c0a4c+_0x384496(0x249)+_0x5f18c9[_0x384496(0x1de)]());return _0xd5f96c[_0x384496(0x217)];}export async function getStandardPageStatus(_0x3b93f6,_0x68816a){const _0x536052=a179_0x31d8,_0x3f34ff=await apiRequest(_0x536052(0x20d)+_0x68816a+'/standard-page-status?appCode='+encodeURIComponent(_0x3b93f6));return _0x3f34ff[_0x536052(0x217)];}export async function tryGetStandardPageStatus(_0x484091,_0x408f12){const _0x20e37d=a179_0x31d8;try{return await getStandardPageStatus(_0x484091,_0x408f12);}catch(_0x44a895){if(_0x44a895 instanceof CliError&&_0x44a895['code']===_0x20e37d(0x24b)&&/404|not found|non-json response/i[_0x20e37d(0x1e4)](_0x44a895[_0x20e37d(0x28b)]))return null;throw _0x44a895;}}export async function syncStandardPages(_0x5791ac,_0x93c6e2){const _0x3a89a0=a179_0x31d8,_0x251704=await apiRequest(_0x3a89a0(0x20d)+_0x93c6e2+_0x3a89a0(0x24a),{'method':_0x3a89a0(0x27d),'body':{'appCode':_0x5791ac}});return _0x251704['data'];}export async function getPageDetail(_0xd2b50e){const _0x428c9f=a179_0x31d8,_0x53ea8b=await apiRequest(_0x428c9f(0x25e)+_0xd2b50e);if(!_0x53ea8b[_0x428c9f(0x217)])throw CliErrors[_0x428c9f(0x1ba)](_0x428c9f(0x236)+_0xd2b50e);return _0x53ea8b['data'];}export async function updatePage(_0x446f10,_0x5efb69,_0x394aac,_0x4d1020){const _0x310bc4=a179_0x31d8,_0x2c5629=await apiRequest(_0x310bc4(0x277),{'method':_0x310bc4(0x27d),'body':{'appCode':_0x446f10,'pageId':_0x5efb69,'code':_0x394aac,'datasetIds':_0x4d1020}});return _0x2c5629[_0x310bc4(0x217)];}export function generateSdkCode(_0x46e265,_0x2121aa,_0x360db3){const _0x3ae8c8=a179_0x31d8,_0x576343=_0x360db3?.['includeImports']??!![],_0x314536='dataset_'+_0x46e265[_0x3ae8c8(0x233)]?.[_0x3ae8c8(0x1e7)](/-/g,'_'),_0x4fe565=_0x2121aa[_0x3ae8c8(0x202)]||_0x2121aa[_0x3ae8c8(0x27c)]||_0x3ae8c8(0x204),_0xef3c4f=[];_0x576343&&_0xef3c4f[_0x3ae8c8(0x1f5)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0xef3c4f['push']('//\x20'+_0x46e265[_0x3ae8c8(0x202)]+'\x20('+(_0x46e265['tableName']||_0x3ae8c8(0x252))+')');if(_0x4fe565==='filter')_0xef3c4f['push'](_0x3ae8c8(0x1d0)+_0x314536+'.filter({',_0x3ae8c8(0x23d),_0x3ae8c8(0x1cc),'\x20\x20currentPage:\x201,',_0x3ae8c8(0x27a));else{if(_0x4fe565===_0x3ae8c8(0x1c7))_0xef3c4f['push'](_0x3ae8c8(0x1d0)+_0x314536+_0x3ae8c8(0x1fd));else{if(_0x4fe565===_0x3ae8c8(0x1e2))_0xef3c4f[_0x3ae8c8(0x1f5)](_0x3ae8c8(0x1d0)+_0x314536+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x4fe565===_0x3ae8c8(0x1ff))_0xef3c4f[_0x3ae8c8(0x1f5)](_0x3ae8c8(0x1d0)+_0x314536+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x4fe565===_0x3ae8c8(0x27f)||_0x4fe565===_0x3ae8c8(0x281)?_0xef3c4f[_0x3ae8c8(0x1f5)](_0x3ae8c8(0x1d0)+_0x314536+_0x3ae8c8(0x1df)):_0xef3c4f[_0x3ae8c8(0x1f5)](_0x3ae8c8(0x1d0)+_0x314536+'.'+_0x4fe565+_0x3ae8c8(0x1f0));}}}return _0xef3c4f[_0x3ae8c8(0x28a)]('\x0a');}export function generateSqlCodeTemplate(_0x1f8214,_0x20eb95){const _0x23364d=a179_0x31d8,_0x2d087d=_0x20eb95?.[_0x23364d(0x21b)]??'sdk',_0x5f2b04=_0x20eb95?.[_0x23364d(0x240)]??!![],_0x4257f8=[];return _0x4257f8['push']('//\x20SQL:\x20'+_0x1f8214[_0x23364d(0x22b)]+'\x20('+_0x1f8214['sqlCode']+')'),_0x2d087d===_0x23364d(0x25d)?(_0x5f2b04&&_0x4257f8[_0x23364d(0x1f5)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x23364d(0x24e),''),_0x4257f8['push'](_0x23364d(0x238),_0x23364d(0x1f1)+_0x1f8214[_0x23364d(0x1d5)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});',_0x23364d(0x1c1),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x4257f8[_0x23364d(0x1f5)](_0x23364d(0x247),_0x23364d(0x25b),_0x23364d(0x266),_0x23364d(0x255)+_0x1f8214['sqlCode']+'\x27,',_0x23364d(0x1d8),_0x23364d(0x216),_0x23364d(0x1e6),'}'),_0x4257f8[_0x23364d(0x28a)]('\x0a');}export async function getErConfig(_0x12be04,_0x354d11){const _0x30e366=a179_0x31d8,_0xfb6d7a=await apiRequest('/smartapi/question/er-config',{'method':_0x30e366(0x27d),'body':{'appCode':_0x12be04,'dblinkId':_0x354d11},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0xfb6d7a[_0x30e366(0x217)];}export async function createErRelation(_0x2c3671){const _0x4e8ba7=a179_0x31d8,_0x280419=await apiRequest(_0x4e8ba7(0x214),{'method':_0x4e8ba7(0x27d),'body':_0x2c3671,'allowNonJsonSuccess':!![]});return _0x280419['data'];}export async function updateErRelation(_0x5eb35f){const _0x8c34f=a179_0x31d8,_0x598143=await apiRequest('/smartapi/question/er-config/update-single',{'method':'POST','body':_0x5eb35f,'allowNonJsonSuccess':!![]});return _0x598143[_0x8c34f(0x217)];}export async function deleteErRelation(_0x4b1c0e){const _0x45021f=a179_0x31d8,_0x2f0065=await apiRequest(_0x45021f(0x23e),{'method':_0x45021f(0x27d),'body':_0x4b1c0e,'allowNonJsonSuccess':!![]});return _0x2f0065[_0x45021f(0x217)];}export async function updateErBusinessGroup(_0x26ede7){const _0x2c2a16=a179_0x31d8,_0x3ddbbd=await apiRequest(_0x2c2a16(0x1c8),{'method':_0x2c2a16(0x27d),'body':_0x26ede7,'allowNonJsonSuccess':!![]});return _0x3ddbbd[_0x2c2a16(0x217)];}function buildQuery(_0x3e3a44){const _0x42f3a1=a179_0x31d8,_0x2726fc=new URLSearchParams();for(const [_0x25e6cc,_0x311d78]of Object[_0x42f3a1(0x287)](_0x3e3a44)){if(_0x311d78===undefined||_0x311d78==='')continue;_0x2726fc['set'](_0x25e6cc,String(_0x311d78));}const _0x7e6969=_0x2726fc[_0x42f3a1(0x1de)]();return _0x7e6969?'?'+_0x7e6969:'';}export async function listAppConfigs(_0x3f3168,_0x2e8e8f){const _0x499a5c=a179_0x31d8,_0x31c358=await apiRequest('/smartapi/app-config/list',{'method':'POST','body':{'appCode':_0x3f3168,..._0x2e8e8f?.[_0x499a5c(0x1e9)]?{'key':_0x2e8e8f[_0x499a5c(0x1e9)]}:{},..._0x2e8e8f?.[_0x499a5c(0x22f)]?{'tags':_0x2e8e8f['tags']}:{}}});return extractAppConfigList(_0x31c358['data']);}export async function getAppConfigByKey(_0x5cc9e7,_0xe446cb){const _0x1fc555=a179_0x31d8,_0x507a3c=await apiRequest(_0x1fc555(0x22c)+buildQuery({'appCode':_0x5cc9e7,'key':_0xe446cb}));return _0x507a3c['data']??null;}export async function createAppConfig(_0x5c7606){const _0x15c14d=a179_0x31d8,_0x46bec9=await apiRequest('/smartapi/app-config/create',{'method':'POST','body':{'appCode':_0x5c7606[_0x15c14d(0x1fc)],'key':_0x5c7606['key'],'value':_0x5c7606[_0x15c14d(0x208)],..._0x5c7606[_0x15c14d(0x22f)]?{'tags':_0x5c7606[_0x15c14d(0x22f)]}:{}}});return _0x46bec9[_0x15c14d(0x217)];}export async function updateAppConfig(_0x39c088){const _0x435d14=a179_0x31d8;await apiRequest(_0x435d14(0x1f8),{'method':_0x435d14(0x27d),'body':{'id':_0x39c088['id'],'appCode':_0x39c088['appCode'],'key':_0x39c088[_0x435d14(0x1e9)],'value':_0x39c088[_0x435d14(0x208)],..._0x39c088[_0x435d14(0x22f)]?{'tags':_0x39c088['tags']}:{}}});}export async function deleteAppConfig(_0x24129d){const _0x2579ce=a179_0x31d8;await apiRequest(_0x2579ce(0x229),{'method':_0x2579ce(0x27d),'body':_0x24129d});}function extractAppConfigList(_0x2c78d9){const _0x57ea1b=a179_0x31d8;if(Array['isArray'](_0x2c78d9))return _0x2c78d9;if(_0x2c78d9&&typeof _0x2c78d9===_0x57ea1b(0x1bd)&&Array[_0x57ea1b(0x234)](_0x2c78d9[_0x57ea1b(0x1f3)]))return _0x2c78d9[_0x57ea1b(0x1f3)];return extractList(_0x2c78d9);}export async function listDbLinks(_0x3f12fd,_0x716723){const _0x57fe9d=a179_0x31d8,_0x41adcb=await apiRequest(_0x57fe9d(0x23c),{'method':'POST','body':{'appCode':_0x3f12fd,'currentPage':_0x716723?.[_0x57fe9d(0x268)]??0x1,'pageSize':_0x716723?.[_0x57fe9d(0x1be)]??0x64}});return{'items':extractList(_0x41adcb[_0x57fe9d(0x217)]),'paging':extractPaging(_0x41adcb['data'])};}export async function getDbLinkInfo(_0x41e84e){const _0x1b21ad=a179_0x31d8,_0xb019=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x41e84e}));return _0xb019[_0x1b21ad(0x217)];}export async function createDbLink(_0x1426d6){const _0x4161ea=a179_0x31d8,_0x29b642=await apiRequest(_0x4161ea(0x265),{'method':_0x4161ea(0x27d),'body':_0x1426d6});return _0x29b642[_0x4161ea(0x217)];}export async function updateDbLink(_0x1c13bc){const _0x47adba=a179_0x31d8,_0x424d99=await apiRequest(_0x47adba(0x219),{'method':'POST','body':_0x1c13bc});return _0x424d99[_0x47adba(0x217)];}export async function deleteDbLink(_0x2c6bee){const _0x2c76ba=a179_0x31d8;await apiRequest(_0x2c76ba(0x1c9),{'method':_0x2c76ba(0x27d),'body':{'id':_0x2c6bee}});}export async function testDbLinkConnect(_0x2ae7c1){const _0x19664b=a179_0x31d8,_0x4ef8e2=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x2ae7c1}));return _0x4ef8e2[_0x19664b(0x217)];}export async function startDbAnalysis(_0x1bfa2a,_0x2d0c24){const _0x444564=a179_0x31d8,_0x31227e=await apiRequest(_0x444564(0x1bb),{'method':'POST','body':{'dbLinkId':_0x1bfa2a,..._0x2d0c24&&_0x2d0c24[_0x444564(0x241)]>0x0?{'tableNames':_0x2d0c24}:{}}}),_0x486a07=_0x31227e[_0x444564(0x217)];if(typeof _0x486a07===_0x444564(0x22d))return _0x486a07;if(_0x486a07&&typeof _0x486a07===_0x444564(0x1bd)&&typeof _0x486a07[_0x444564(0x245)]===_0x444564(0x22d))return _0x486a07[_0x444564(0x245)];return _0x486a07!=null?String(_0x486a07):'';}export async function cancelDbAnalysis(_0x502231){const _0x493873=a179_0x31d8;await apiRequest(_0x493873(0x22a)+buildQuery({'planId':_0x502231}),{'method':_0x493873(0x27d)});}export async function getDbAnalysisStatus(_0x3e638f){const _0x21d34a=a179_0x31d8,_0x349d37=await apiRequest(_0x21d34a(0x1e8)+encodeURIComponent(_0x3e638f));return _0x349d37['data'];}export async function getDbAllTableList(_0x36c4dc,_0x232668){const _0x5c11a9=a179_0x31d8,_0x4b292a=await apiRequest(_0x5c11a9(0x20b)+buildQuery({'appCode':_0x36c4dc,'dbLinkId':_0x232668})),_0x48e9a3=_0x4b292a[_0x5c11a9(0x217)];if(Array[_0x5c11a9(0x234)](_0x48e9a3))return _0x48e9a3;return extractList(_0x48e9a3);}export async function getDbTableDiff(_0x13bcbe,_0x337fc2,_0x2b34a3){const _0x4dd2c0=a179_0x31d8,_0x49af96=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x13bcbe,'dbLinkId':_0x337fc2,'pageIndex':_0x2b34a3?.['pageIndex']??0x1,'pageSize':_0x2b34a3?.[_0x4dd2c0(0x1be)]??0x14,'tableName':_0x2b34a3?.[_0x4dd2c0(0x210)]})),_0x175e95=_0x49af96[_0x4dd2c0(0x217)];return{'totalCount':_0x175e95?.[_0x4dd2c0(0x21e)]??0x0,'physicalTableCount':_0x175e95?.[_0x4dd2c0(0x261)]??0x0,'datasetTableCount':_0x175e95?.[_0x4dd2c0(0x274)]??0x0,..._0x175e95?.[_0x4dd2c0(0x26d)]?{'summary':_0x175e95[_0x4dd2c0(0x26d)]}:{},'tableList':Array[_0x4dd2c0(0x234)](_0x175e95?.[_0x4dd2c0(0x28f)])?_0x175e95[_0x4dd2c0(0x28f)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x28c0d8=a179_0x31d8,_0x27d3b8=await apiRequest(_0x28c0d8(0x28e),{'method':_0x28c0d8(0x27d),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0xf89af5=extractList(_0x27d3b8[_0x28c0d8(0x217)]),_0x2b3b2d=extractPaging(_0x27d3b8['data']);return _0x2b3b2d&&_0x2b3b2d[_0x28c0d8(0x21e)]>REMOTE_APP_PAGE_SIZE&&console[_0x28c0d8(0x26a)](_0x28c0d8(0x1ea)+REMOTE_APP_PAGE_SIZE+_0x28c0d8(0x282)+_0x2b3b2d['totalCount']+_0x28c0d8(0x1d7)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0xf89af5;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x5baafd,_0x18d7a9){const _0x503023=a179_0x31d8,_0x165dbb=Math[_0x503023(0x283)](Math[_0x503023(0x1c3)](_0x18d7a9?.[_0x503023(0x1be)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0xf734f0=await apiRequest(_0x503023(0x267),{'method':_0x503023(0x27d),'body':{'appCode':_0x5baafd,'currentPage':_0x18d7a9?.[_0x503023(0x268)]??0x1,'pageSize':_0x165dbb}});return{'items':extractList(_0xf734f0[_0x503023(0x217)]),'paging':extractPaging(_0xf734f0[_0x503023(0x217)])};}export async function getAppRole(_0x148193){const _0x31fd50=a179_0x31d8,_0x5220d4=await apiRequest(_0x31fd50(0x23f)+buildQuery({'id':_0x148193}));return _0x5220d4[_0x31fd50(0x217)];}export async function createAppRole(_0x479e98){const _0x20a5f6=a179_0x31d8,_0x60eb58=await apiRequest('/smartapi/permit/role/create',{'method':'POST','body':{'appCode':_0x479e98[_0x20a5f6(0x1fc)],'roleName':_0x479e98[_0x20a5f6(0x1dd)],'roleType':'CUSTOM',..._0x479e98['remark']?{'remark':_0x479e98['remark']}:{}}});return _0x60eb58['data'];}export async function updateAppRole(_0x34daad){const _0x42bb18=a179_0x31d8,_0x5495fa=await apiRequest(_0x42bb18(0x221),{'method':_0x42bb18(0x27d),'body':{'id':_0x34daad['id'],'appCode':_0x34daad['appCode'],..._0x34daad['roleType']?{'roleType':_0x34daad[_0x42bb18(0x1e0)]}:{},..._0x34daad[_0x42bb18(0x1dd)]!==undefined?{'roleName':_0x34daad[_0x42bb18(0x1dd)]}:{},..._0x34daad[_0x42bb18(0x24d)]!==undefined?{'remark':_0x34daad['remark']}:{},..._0x34daad[_0x42bb18(0x278)]?{'permits':_0x34daad[_0x42bb18(0x278)]}:{}}});return _0x5495fa['data'];}export async function deleteAppRole(_0x10f4c3){const _0x794d2c=a179_0x31d8;await apiRequest(_0x794d2c(0x26c),{'method':_0x794d2c(0x27d),'body':{'id':_0x10f4c3}});}export async function listPermitRoles(_0x530c8a,_0x3395b4){const _0x20e96d=a179_0x31d8,_0x1f50da=await apiRequest('/smartapi/permit/role/get-permit-list',{'method':_0x20e96d(0x27d),'body':{'appCode':_0x530c8a,..._0x3395b4?.[_0x20e96d(0x207)]!==undefined?{'needSelf':_0x3395b4[_0x20e96d(0x207)]}:{},..._0x3395b4?.[_0x20e96d(0x1c6)]!==undefined?{'needPublic':_0x3395b4[_0x20e96d(0x1c6)]}:{}}});return extractList(_0x1f50da[_0x20e96d(0x217)]);}export async function getRoleMenuResources(_0x547935,_0x2d4fea){const _0x20ce47=a179_0x31d8,_0x207b64=await apiRequest('/smartapi/permit/resource/get-menu-list',{'method':_0x20ce47(0x27d),'body':{'appCode':_0x547935,'roleId':_0x2d4fea}});return extractList(_0x207b64[_0x20ce47(0x217)]);}export async function getRoleApiResources(_0x1f77d6,_0x531f4d){const _0x42c237=a179_0x31d8,_0x1d64cb=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x42c237(0x27d),'body':{'appCode':_0x1f77d6,'roleId':_0x531f4d}});return extractList(_0x1d64cb[_0x42c237(0x217)]);}export async function listRoleUsers(_0x6f28d5){const _0x3b4b55=a179_0x31d8,_0x47a97b=await apiRequest(_0x3b4b55(0x25a),{'method':'POST','body':{'appCode':_0x6f28d5}});return extractList(_0x47a97b['data']);}export async function updateRoleUsers(_0x5cf20b,_0x153c48){const _0xe6683b=a179_0x31d8;await apiRequest(_0xe6683b(0x239),{'method':_0xe6683b(0x27d),'body':{'appCode':_0x5cf20b,'roleList':_0x153c48}});}export async function getPagePermit(_0x41e6c6){const _0x2c3787=a179_0x31d8,_0x407c13=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x41e6c6}));return _0x407c13[_0x2c3787(0x217)];}export async function savePagePermit(_0x51c630){const _0x2bad28=a179_0x31d8,_0x3a12cf=await apiRequest(_0x2bad28(0x1cd),{'method':'POST','body':_0x51c630});return _0x3a12cf['data'];}export async function getTenantMembers(_0x2ada44){const _0x11344c=a179_0x31d8,_0x3051a3=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x2ada44})),_0x275d93=_0x3051a3['data']??{},_0x156087=Array[_0x11344c(0x234)](_0x275d93?.['userTenantRelationList'])?_0x275d93['userTenantRelationList']:[];return _0x156087[_0x11344c(0x204)](_0x5d8d27=>_0x5d8d27?.['status']===_0x11344c(0x231)||_0x5d8d27?.['status']===undefined)[_0x11344c(0x260)](_0x392662=>({'userId':Number(_0x392662[_0x11344c(0x200)]??_0x392662['id']),'username':_0x392662[_0x11344c(0x1cb)],'nickname':_0x392662[_0x11344c(0x1c2)],'status':_0x392662[_0x11344c(0x20c)],'email':_0x392662[_0x11344c(0x22e)],'mobile':_0x392662[_0x11344c(0x248)],'avatar':_0x392662[_0x11344c(0x205)]}))['filter'](_0x274992=>Number[_0x11344c(0x1d9)](_0x274992['userId'])&&_0x274992[_0x11344c(0x200)]>0x0);}
@@ -1 +1 @@
1
- const a180_0x2908ef=a180_0x2fdf;(function(_0x4801d4,_0x564ad0){const _0x132596=a180_0x2fdf,_0x225483=_0x4801d4();while(!![]){try{const _0x5a1590=-parseInt(_0x132596(0xb0))/0x1*(-parseInt(_0x132596(0xb1))/0x2)+-parseInt(_0x132596(0xb4))/0x3*(parseInt(_0x132596(0xb7))/0x4)+parseInt(_0x132596(0xab))/0x5*(-parseInt(_0x132596(0xb2))/0x6)+parseInt(_0x132596(0xac))/0x7*(parseInt(_0x132596(0xba))/0x8)+parseInt(_0x132596(0xaf))/0x9*(-parseInt(_0x132596(0xb5))/0xa)+parseInt(_0x132596(0xb3))/0xb+-parseInt(_0x132596(0xb8))/0xc;if(_0x5a1590===_0x564ad0)break;else _0x225483['push'](_0x225483['shift']());}catch(_0x37da56){_0x225483['push'](_0x225483['shift']());}}}(a180_0x42e3,0xc66f7));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a180_0x2fdf(_0x40230b,_0x229ad7){_0x40230b=_0x40230b-0xaa;const _0x42e38c=a180_0x42e3();let _0x2fdf0a=_0x42e38c[_0x40230b];return _0x2fdf0a;}function a180_0x42e3(){const _0x1cbd25=['9465883DrwOJP','bff-trash','/bff','2151WRZNwO','53291DFMrrN','52ILgoEY','12rBCbHF','16148000ybtdhI','3qsSJth','39530dzOUnU','bff.lock.json','5844060REvSgJ','3398856IlmBlu','.rabetbase','8AvFRGs','bff','1760060adobhI'];a180_0x42e3=function(){return _0x1cbd25;};return a180_0x42e3();}const DOT_DIR=a180_0x2908ef(0xb9),LOCK_FILE_NAME=a180_0x2908ef(0xb6),TRASH_DIR_NAME=a180_0x2908ef(0xad);export function loadBffProjectConfig(_0x546e9c,_0x9f012b){const _0x5e1cbc=a180_0x2908ef,_0x30fa53=resolve(_0x9f012b??findProjectRootDirectory()),_0xb45e30=DOT_DIR+_0x5e1cbc(0xae),_0x25977f=_0xb45e30+'/'+_0x546e9c;return{'projectRoot':_0x30fa53,'appCode':_0x546e9c,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0xb45e30,'scriptsRoot':_0x25977f,'scriptsRootDir':resolve(_0x30fa53,DOT_DIR,_0x5e1cbc(0xaa),_0x546e9c),'lockFilePath':resolve(_0x30fa53,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30fa53,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a180_0x3cbf31=a180_0x595b;function a180_0x595b(_0x22f15a,_0x323513){_0x22f15a=_0x22f15a-0x152;const _0x361295=a180_0x3612();let _0x595bea=_0x361295[_0x22f15a];return _0x595bea;}(function(_0x30afe1,_0x19d782){const _0x4be586=a180_0x595b,_0x3c7884=_0x30afe1();while(!![]){try{const _0x3f3e31=parseInt(_0x4be586(0x15d))/0x1*(parseInt(_0x4be586(0x155))/0x2)+parseInt(_0x4be586(0x15a))/0x3+-parseInt(_0x4be586(0x156))/0x4+-parseInt(_0x4be586(0x157))/0x5+-parseInt(_0x4be586(0x15b))/0x6+-parseInt(_0x4be586(0x152))/0x7+parseInt(_0x4be586(0x153))/0x8;if(_0x3f3e31===_0x19d782)break;else _0x3c7884['push'](_0x3c7884['shift']());}catch(_0x35c323){_0x3c7884['push'](_0x3c7884['shift']());}}}(a180_0x3612,0x9ba8d));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a180_0x3612(){const _0x58dde4=['6UWGRnZ','2360264UlKOWH','1338790WZhqWM','bff.lock.json','.rabetbase','1487361WgWBmK','4561296dTXrQY','bff-trash','346421juitvv','bff','1324988XLYRKG','7278840tsYlZH','/bff'];a180_0x3612=function(){return _0x58dde4;};return a180_0x3612();}const DOT_DIR=a180_0x3cbf31(0x159),LOCK_FILE_NAME=a180_0x3cbf31(0x158),TRASH_DIR_NAME=a180_0x3cbf31(0x15c);export function loadBffProjectConfig(_0x8fe84a,_0x3c53f8){const _0x598ec0=a180_0x3cbf31,_0x481b69=resolve(_0x3c53f8??findProjectRootDirectory()),_0x4cbf8f=DOT_DIR+_0x598ec0(0x154),_0x4fed16=_0x4cbf8f+'/'+_0x8fe84a;return{'projectRoot':_0x481b69,'appCode':_0x8fe84a,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4cbf8f,'scriptsRoot':_0x4fed16,'scriptsRootDir':resolve(_0x481b69,DOT_DIR,_0x598ec0(0x15e),_0x8fe84a),'lockFilePath':resolve(_0x481b69,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x481b69,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a181_0x272cd0=a181_0x4c19;(function(_0x4f279b,_0x3636e3){const _0xecd443=a181_0x4c19,_0x1d6361=_0x4f279b();while(!![]){try{const _0x5ed3e8=-parseInt(_0xecd443(0x136))/0x1+parseInt(_0xecd443(0x145))/0x2*(parseInt(_0xecd443(0x139))/0x3)+-parseInt(_0xecd443(0x12e))/0x4*(-parseInt(_0xecd443(0x144))/0x5)+-parseInt(_0xecd443(0x148))/0x6+parseInt(_0xecd443(0x147))/0x7*(-parseInt(_0xecd443(0x141))/0x8)+parseInt(_0xecd443(0x130))/0x9+-parseInt(_0xecd443(0x12d))/0xa*(-parseInt(_0xecd443(0x134))/0xb);if(_0x5ed3e8===_0x3636e3)break;else _0x1d6361['push'](_0x1d6361['shift']());}catch(_0x218b00){_0x1d6361['push'](_0x1d6361['shift']());}}}(a181_0x2115,0x34900));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=[a181_0x272cd0(0x138),'ENDPOINT',a181_0x272cd0(0x123)];export function normalizeBffType(_0x90c537){const _0x313c61=a181_0x272cd0;if(!_0x90c537)return undefined;const _0x225c45=_0x90c537['trim']()[_0x313c61(0x13a)]();return SUPPORTED_BFF_TYPES[_0x313c61(0x132)](_0x225c45)?_0x225c45:undefined;}async function scanJsFilesRecursively(_0x3198c7,_0x5afc17){const _0x1ed909=a181_0x272cd0,_0x19e135=[];try{const _0x5d79aa=await readdir(_0x3198c7,{'withFileTypes':!![]});for(const _0x4d8e06 of _0x5d79aa){const _0x5f5603=join(_0x3198c7,_0x4d8e06['name']);if(_0x4d8e06[_0x1ed909(0x142)]())_0x19e135[_0x1ed909(0x12b)](...await scanJsFilesRecursively(_0x5f5603,_0x5afc17+'/'+_0x4d8e06[_0x1ed909(0x131)]));else _0x4d8e06[_0x1ed909(0x126)]()&&_0x4d8e06[_0x1ed909(0x131)]['endsWith'](_0x1ed909(0x13d))&&_0x19e135[_0x1ed909(0x12b)]({'lockKey':_0x5afc17+'/'+_0x4d8e06[_0x1ed909(0x131)][_0x1ed909(0x12a)](/\.js$/,''),'filePath':_0x5f5603});}}catch(_0x3d5878){if(_0x3d5878['code']!==_0x1ed909(0x127))throw _0x3d5878;}return _0x19e135;}function a181_0x2115(){const _0x5704bd=['ENOENT','operationType','all','replace','push','functionName','18430IqTKpI','1136GCoTVk','beforeScriptId','3000024LKvHHL','name','includes','code','2321cgMOQP','HOOK/','275781WbEpZJ','alias','COMMON','1194999YigNKl','toUpperCase','get','afterScriptId','.js','split','functionNode','datasetCode','2456536otlWpr','isDirectory','ENDPOINT','555infxUh','2OmhnxZ','scriptsRootDir','7YgUeWP','2123532UQWTVo','endsWith','HOOK','map','set','isFile'];a181_0x2115=function(){return _0x5704bd;};return a181_0x2115();}async function scanFlatFunctions(_0x57bd58,_0x3e62bc){const _0x2bfb8e=a181_0x272cd0,_0xb72a3f=join(_0x57bd58[_0x2bfb8e(0x146)],_0x3e62bc),_0xd7b943=await scanJsFilesRecursively(_0xb72a3f,_0x3e62bc);return _0xd7b943[_0x2bfb8e(0x124)](({lockKey:_0x19f618,filePath:_0x5825f9})=>({'type':_0x3e62bc,'name':_0x19f618[_0x2bfb8e(0x13e)]('/')['at'](-0x1)??'','filePath':_0x5825f9,'lockKey':_0x19f618}));}async function scanHookFunctions(_0x3c37d6){const _0x463667=a181_0x272cd0,_0x1ca774=join(_0x3c37d6['scriptsRootDir'],_0x463667(0x123)),_0x539cda=[];try{const _0xaa35a6=await readdir(_0x1ca774,{'withFileTypes':!![]});for(const _0x221230 of _0xaa35a6){if(!_0x221230[_0x463667(0x142)]())continue;const _0x233222=_0x221230[_0x463667(0x131)],_0x54365c=join(_0x1ca774,_0x233222),_0x1e2cfa=await readdir(_0x54365c,{'withFileTypes':!![]});for(const _0x295b2f of _0x1e2cfa){if(!_0x295b2f[_0x463667(0x142)]())continue;const _0x16e144=_0x295b2f[_0x463667(0x131)],_0x1700c7=join(_0x54365c,_0x16e144),_0xf33cd6=await readdir(_0x1700c7,{'withFileTypes':!![]});for(const _0xc9388a of _0xf33cd6){if(!_0xc9388a[_0x463667(0x142)]())continue;const _0x5d2c71=_0xc9388a[_0x463667(0x131)],_0x1ecd41=join(_0x1700c7,_0x5d2c71),_0x4f378c=await readdir(_0x1ecd41,{'withFileTypes':!![]});for(const _0x5e614b of _0x4f378c){if(!_0x5e614b[_0x463667(0x126)]()||!_0x5e614b[_0x463667(0x131)][_0x463667(0x149)](_0x463667(0x13d)))continue;const _0x4638c9=_0x5e614b['name'][_0x463667(0x12a)](/\.js$/,'');_0x539cda['push']({'type':_0x463667(0x123),'name':_0x4638c9,'filePath':join(_0x1ecd41,_0x5e614b[_0x463667(0x131)]),'lockKey':_0x463667(0x135)+_0x233222+'/'+_0x16e144+'/'+_0x5d2c71+'/'+_0x4638c9,'alias':_0x233222,'operationType':_0x16e144,'functionNode':_0x5d2c71});}}}}}catch(_0x1f092b){if(_0x1f092b[_0x463667(0x133)]!==_0x463667(0x127))throw _0x1f092b;}return _0x539cda;}export async function scanLocalBffFunctions(_0xdc7364,_0x2d3e11){const _0x306bfb=a181_0x272cd0;if(_0x2d3e11===_0x306bfb(0x138)||_0x2d3e11==='ENDPOINT')return scanFlatFunctions(_0xdc7364,_0x2d3e11);if(_0x2d3e11===_0x306bfb(0x123))return scanHookFunctions(_0xdc7364);const [_0x267bcd,_0x3e39fd,_0x2c5de0]=await Promise[_0x306bfb(0x129)]([scanFlatFunctions(_0xdc7364,_0x306bfb(0x138)),scanFlatFunctions(_0xdc7364,_0x306bfb(0x143)),scanHookFunctions(_0xdc7364)]);return[..._0x267bcd,..._0x3e39fd,..._0x2c5de0];}export function resolveLocalFilePathFromLockKey(_0x239144,_0x106c53){const _0x426e9c=a181_0x272cd0;return join(_0x239144[_0x426e9c(0x146)],..._0x106c53[_0x426e9c(0x13e)]('/'))+'.js';}export function createHookLocationMap(_0x37beee){const _0x3aa2cb=a181_0x272cd0,_0x4f231d=new Map();for(const _0x47de29 of _0x37beee){_0x47de29[_0x3aa2cb(0x12f)]&&_0x4f231d[_0x3aa2cb(0x125)](_0x47de29[_0x3aa2cb(0x12f)],{'datasetCode':_0x47de29[_0x3aa2cb(0x140)],'operationType':snakeToCamel(_0x47de29[_0x3aa2cb(0x128)]),'functionNode':'before'}),_0x47de29[_0x3aa2cb(0x13c)]&&_0x4f231d[_0x3aa2cb(0x125)](_0x47de29[_0x3aa2cb(0x13c)],{'datasetCode':_0x47de29[_0x3aa2cb(0x140)],'operationType':snakeToCamel(_0x47de29[_0x3aa2cb(0x128)]),'functionNode':'after'});}return _0x4f231d;}export function resolveRemoteScriptTarget(_0x5ab1f9,_0x214fd3,_0x44a5ea,_0x5478da,_0x9126d){const _0x430a11=a181_0x272cd0,_0x58bec9=normalizeBffType(_0x214fd3['scriptType']);if(!_0x58bec9||!_0x214fd3[_0x430a11(0x12c)])return null;if(_0x58bec9===_0x430a11(0x123)){const _0x170391=(_0x214fd3['id']?_0x44a5ea['get'](_0x214fd3['id']):undefined)??findHookLocationByRemoteId(_0x5478da,_0x214fd3['id']);if(!_0x170391)return null;const _0x33cd75=_0x170391[_0x430a11(0x137)]||_0x9126d[_0x430a11(0x13b)](_0x170391[_0x430a11(0x140)]),_0x11eb27=_0x33cd75??_0x170391['datasetCode'],_0xec57e5={..._0x170391,'alias':_0x33cd75},_0x19253d=_0x430a11(0x135)+_0x11eb27+'/'+_0xec57e5[_0x430a11(0x128)]+'/'+_0xec57e5[_0x430a11(0x13f)]+'/'+_0x214fd3[_0x430a11(0x12c)];return{'lockKey':_0x19253d,'filePath':resolveLocalFilePathFromLockKey(_0x5ab1f9,_0x19253d),'type':_0x430a11(0x123),'hookLocation':_0xec57e5};}const _0x216ff1=_0x58bec9+'/'+_0x214fd3['functionName'];return{'lockKey':_0x216ff1,'filePath':resolveLocalFilePathFromLockKey(_0x5ab1f9,_0x216ff1),'type':_0x58bec9};}export async function ensureParentDirectory(_0x53f1f3){await mkdir(dirname(_0x53f1f3),{'recursive':!![]});}export async function fileExists(_0x2a9def){try{return await access(_0x2a9def,constants['F_OK']),!![];}catch{return![];}}function a181_0x4c19(_0xc4fa90,_0xfe5928){_0xc4fa90=_0xc4fa90-0x123;const _0x21155a=a181_0x2115();let _0x4c1916=_0x21155a[_0xc4fa90];return _0x4c1916;}export async function directoryExists(_0x247af0){const _0x38c6be=a181_0x272cd0;try{const _0x430ef9=await stat(_0x247af0);return _0x430ef9[_0x38c6be(0x142)]();}catch{return![];}}
1
+ const a181_0x1f6257=a181_0x4832;function a181_0x4832(_0x1418f6,_0x266b9a){_0x1418f6=_0x1418f6-0x19d;const _0x53c749=a181_0x53c7();let _0x4832ae=_0x53c749[_0x1418f6];return _0x4832ae;}(function(_0x1b0255,_0x137f40){const _0x1c1a78=a181_0x4832,_0x1da540=_0x1b0255();while(!![]){try{const _0x5b765e=-parseInt(_0x1c1a78(0x1ae))/0x1+parseInt(_0x1c1a78(0x19f))/0x2+parseInt(_0x1c1a78(0x1ad))/0x3*(-parseInt(_0x1c1a78(0x1a9))/0x4)+-parseInt(_0x1c1a78(0x1a2))/0x5+parseInt(_0x1c1a78(0x1b5))/0x6+-parseInt(_0x1c1a78(0x1b0))/0x7*(-parseInt(_0x1c1a78(0x1a0))/0x8)+parseInt(_0x1c1a78(0x1ab))/0x9;if(_0x5b765e===_0x137f40)break;else _0x1da540['push'](_0x1da540['shift']());}catch(_0x22e61){_0x1da540['push'](_0x1da540['shift']());}}}(a181_0x53c7,0x4799b));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=[a181_0x1f6257(0x1a4),'ENDPOINT',a181_0x1f6257(0x1bb)];export function normalizeBffType(_0x47e4db){const _0x4bb8a3=a181_0x1f6257;if(!_0x47e4db)return undefined;const _0x2ddca7=_0x47e4db[_0x4bb8a3(0x1a3)]()[_0x4bb8a3(0x1b2)]();return SUPPORTED_BFF_TYPES[_0x4bb8a3(0x1b9)](_0x2ddca7)?_0x2ddca7:undefined;}async function scanJsFilesRecursively(_0x4a5332,_0x4376ed){const _0x52dc2f=a181_0x1f6257,_0x36da51=[];try{const _0xf8153a=await readdir(_0x4a5332,{'withFileTypes':!![]});for(const _0x3b4917 of _0xf8153a){const _0xd452f=join(_0x4a5332,_0x3b4917['name']);if(_0x3b4917[_0x52dc2f(0x1b6)]())_0x36da51[_0x52dc2f(0x1b8)](...await scanJsFilesRecursively(_0xd452f,_0x4376ed+'/'+_0x3b4917[_0x52dc2f(0x1ba)]));else _0x3b4917[_0x52dc2f(0x1bf)]()&&_0x3b4917[_0x52dc2f(0x1ba)][_0x52dc2f(0x1c1)](_0x52dc2f(0x1aa))&&_0x36da51['push']({'lockKey':_0x4376ed+'/'+_0x3b4917[_0x52dc2f(0x1ba)][_0x52dc2f(0x1af)](/\.js$/,''),'filePath':_0xd452f});}}catch(_0x4e22c2){if(_0x4e22c2[_0x52dc2f(0x1c0)]!==_0x52dc2f(0x1c3))throw _0x4e22c2;}return _0x36da51;}async function scanFlatFunctions(_0x4bbd91,_0x2d5eac){const _0x3e3693=a181_0x1f6257,_0x3e5198=join(_0x4bbd91['scriptsRootDir'],_0x2d5eac),_0x39e581=await scanJsFilesRecursively(_0x3e5198,_0x2d5eac);return _0x39e581[_0x3e3693(0x1a6)](({lockKey:_0x2fe950,filePath:_0x2c5411})=>({'type':_0x2d5eac,'name':_0x2fe950['split']('/')['at'](-0x1)??'','filePath':_0x2c5411,'lockKey':_0x2fe950}));}async function scanHookFunctions(_0xe7070d){const _0x551996=a181_0x1f6257,_0x469049=join(_0xe7070d[_0x551996(0x1a5)],_0x551996(0x1bb)),_0x119b5c=[];try{const _0x4c6f8f=await readdir(_0x469049,{'withFileTypes':!![]});for(const _0xb1cb09 of _0x4c6f8f){if(!_0xb1cb09['isDirectory']())continue;const _0x12eec8=_0xb1cb09[_0x551996(0x1ba)],_0x86070c=join(_0x469049,_0x12eec8),_0x21afa2=await readdir(_0x86070c,{'withFileTypes':!![]});for(const _0x40cd35 of _0x21afa2){if(!_0x40cd35[_0x551996(0x1b6)]())continue;const _0x1c2539=_0x40cd35[_0x551996(0x1ba)],_0x1f45cc=join(_0x86070c,_0x1c2539),_0x420549=await readdir(_0x1f45cc,{'withFileTypes':!![]});for(const _0x2c8bdb of _0x420549){if(!_0x2c8bdb[_0x551996(0x1b6)]())continue;const _0x36a093=_0x2c8bdb[_0x551996(0x1ba)],_0x55c803=join(_0x1f45cc,_0x36a093),_0x27dc23=await readdir(_0x55c803,{'withFileTypes':!![]});for(const _0x4bde1 of _0x27dc23){if(!_0x4bde1[_0x551996(0x1bf)]()||!_0x4bde1[_0x551996(0x1ba)]['endsWith'](_0x551996(0x1aa)))continue;const _0x4452f8=_0x4bde1['name'][_0x551996(0x1af)](/\.js$/,'');_0x119b5c['push']({'type':_0x551996(0x1bb),'name':_0x4452f8,'filePath':join(_0x55c803,_0x4bde1[_0x551996(0x1ba)]),'lockKey':_0x551996(0x1ac)+_0x12eec8+'/'+_0x1c2539+'/'+_0x36a093+'/'+_0x4452f8,'alias':_0x12eec8,'operationType':_0x1c2539,'functionNode':_0x36a093});}}}}}catch(_0x5b3a08){if(_0x5b3a08[_0x551996(0x1c0)]!==_0x551996(0x1c3))throw _0x5b3a08;}return _0x119b5c;}export async function scanLocalBffFunctions(_0xcd64af,_0x483947){const _0x19952b=a181_0x1f6257;if(_0x483947===_0x19952b(0x1a4)||_0x483947===_0x19952b(0x1a7))return scanFlatFunctions(_0xcd64af,_0x483947);if(_0x483947==='HOOK')return scanHookFunctions(_0xcd64af);const [_0x5dbabc,_0x34eb31,_0x3ac01b]=await Promise[_0x19952b(0x1bd)]([scanFlatFunctions(_0xcd64af,_0x19952b(0x1a4)),scanFlatFunctions(_0xcd64af,_0x19952b(0x1a7)),scanHookFunctions(_0xcd64af)]);return[..._0x5dbabc,..._0x34eb31,..._0x3ac01b];}export function resolveLocalFilePathFromLockKey(_0x412da0,_0x12e7b1){const _0x235d0e=a181_0x1f6257;return join(_0x412da0[_0x235d0e(0x1a5)],..._0x12e7b1[_0x235d0e(0x1b7)]('/'))+_0x235d0e(0x1aa);}export function createHookLocationMap(_0x4c0513){const _0x24a066=a181_0x1f6257,_0xa8ada7=new Map();for(const _0x3b0098 of _0x4c0513){_0x3b0098[_0x24a066(0x19d)]&&_0xa8ada7[_0x24a066(0x19e)](_0x3b0098[_0x24a066(0x19d)],{'datasetCode':_0x3b0098[_0x24a066(0x1be)],'operationType':snakeToCamel(_0x3b0098[_0x24a066(0x1a8)]),'functionNode':_0x24a066(0x1c2)}),_0x3b0098[_0x24a066(0x1b1)]&&_0xa8ada7[_0x24a066(0x19e)](_0x3b0098[_0x24a066(0x1b1)],{'datasetCode':_0x3b0098[_0x24a066(0x1be)],'operationType':snakeToCamel(_0x3b0098['operationType']),'functionNode':'after'});}return _0xa8ada7;}export function resolveRemoteScriptTarget(_0x1d4e66,_0x55006c,_0x3a65a1,_0x554d5c,_0x20df5b){const _0x393df8=a181_0x1f6257,_0x29fd2c=normalizeBffType(_0x55006c[_0x393df8(0x1bc)]);if(!_0x29fd2c||!_0x55006c[_0x393df8(0x1b3)])return null;if(_0x29fd2c===_0x393df8(0x1bb)){const _0x4ffd1d=(_0x55006c['id']?_0x3a65a1[_0x393df8(0x1a1)](_0x55006c['id']):undefined)??findHookLocationByRemoteId(_0x554d5c,_0x55006c['id']);if(!_0x4ffd1d)return null;const _0x21dd91=_0x4ffd1d['alias']||_0x20df5b[_0x393df8(0x1a1)](_0x4ffd1d['datasetCode']),_0x16ec98=_0x21dd91??_0x4ffd1d['datasetCode'],_0x4e3344={..._0x4ffd1d,'alias':_0x21dd91},_0x41ff66=_0x393df8(0x1ac)+_0x16ec98+'/'+_0x4e3344[_0x393df8(0x1a8)]+'/'+_0x4e3344[_0x393df8(0x1b4)]+'/'+_0x55006c[_0x393df8(0x1b3)];return{'lockKey':_0x41ff66,'filePath':resolveLocalFilePathFromLockKey(_0x1d4e66,_0x41ff66),'type':_0x393df8(0x1bb),'hookLocation':_0x4e3344};}const _0xb99fd3=_0x29fd2c+'/'+_0x55006c['functionName'];return{'lockKey':_0xb99fd3,'filePath':resolveLocalFilePathFromLockKey(_0x1d4e66,_0xb99fd3),'type':_0x29fd2c};}export async function ensureParentDirectory(_0x2113a6){await mkdir(dirname(_0x2113a6),{'recursive':!![]});}export async function fileExists(_0x138bc7){try{return await access(_0x138bc7,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x25fe25){const _0x578dbd=a181_0x1f6257;try{const _0x5938ea=await stat(_0x25fe25);return _0x5938ea[_0x578dbd(0x1b6)]();}catch{return![];}}function a181_0x53c7(){const _0x249c48=['split','push','includes','name','HOOK','scriptType','all','datasetCode','isFile','code','endsWith','before','ENOENT','beforeScriptId','set','735566GfQROm','3985320vckTIk','get','2209275XDFwDS','trim','COMMON','scriptsRootDir','map','ENDPOINT','operationType','1145624HNFYQQ','.js','8741502AutDuu','HOOK/','6hquNyg','540852VCIhIN','replace','7MxNNoV','afterScriptId','toUpperCase','functionName','functionNode','69408YifRrS','isDirectory'];a181_0x53c7=function(){return _0x249c48;};return a181_0x53c7();}
@@ -1 +1 @@
1
- (function(_0x135f7f,_0x33b4fc){const _0x4048e4=a182_0x1298,_0x165b68=_0x135f7f();while(!![]){try{const _0x203c50=parseInt(_0x4048e4(0xea))/0x1+parseInt(_0x4048e4(0xe9))/0x2*(parseInt(_0x4048e4(0xe0))/0x3)+-parseInt(_0x4048e4(0xdf))/0x4*(parseInt(_0x4048e4(0xe5))/0x5)+parseInt(_0x4048e4(0xed))/0x6+-parseInt(_0x4048e4(0xe7))/0x7*(parseInt(_0x4048e4(0xde))/0x8)+parseInt(_0x4048e4(0xe6))/0x9*(-parseInt(_0x4048e4(0xe1))/0xa)+parseInt(_0x4048e4(0xe2))/0xb;if(_0x203c50===_0x33b4fc)break;else _0x165b68['push'](_0x165b68['shift']());}catch(_0x46e6e8){_0x165b68['push'](_0x165b68['shift']());}}}(a182_0x2e71,0x25714));import{readFile}from'node:fs/promises';import a182_0x394072 from'node:crypto';function a182_0x2e71(){const _0x33dc7f=['digest','md5','534966JOihPU','16MAEudL','115564yIacXT','21rIfurL','30WUQseN','460449GYPmpo','utf8','hex','5NGbCxI','738117KPGhhl','83650Ywfntt','update','60022UHfUoA','111097aquHur'];a182_0x2e71=function(){return _0x33dc7f;};return a182_0x2e71();}export function computeContentHash(_0x1bd1f8){const _0x1fd6ed=a182_0x1298;return a182_0x394072['createHash'](_0x1fd6ed(0xec))[_0x1fd6ed(0xe8)](_0x1bd1f8)[_0x1fd6ed(0xeb)](_0x1fd6ed(0xe4));}function a182_0x1298(_0x54ab2c,_0x2a6bc7){_0x54ab2c=_0x54ab2c-0xde;const _0x2e7167=a182_0x2e71();let _0x12983a=_0x2e7167[_0x54ab2c];return _0x12983a;}export async function computeFileHash(_0xb7da37){const _0x29dec1=a182_0x1298,_0x145cbd=await readFile(_0xb7da37,_0x29dec1(0xe3));return computeContentHash(_0x145cbd);}
1
+ function a182_0x377b(_0x3e0530,_0x54864d){_0x3e0530=_0x3e0530-0x7e;const _0x3c8f01=a182_0x3c8f();let _0x377bbb=_0x3c8f01[_0x3e0530];return _0x377bbb;}(function(_0x5948b4,_0xbe9e47){const _0x4fa89f=a182_0x377b,_0x57cdcf=_0x5948b4();while(!![]){try{const _0x28a0ff=-parseInt(_0x4fa89f(0x87))/0x1*(-parseInt(_0x4fa89f(0x8c))/0x2)+parseInt(_0x4fa89f(0x89))/0x3+parseInt(_0x4fa89f(0x8a))/0x4*(parseInt(_0x4fa89f(0x8d))/0x5)+parseInt(_0x4fa89f(0x84))/0x6+parseInt(_0x4fa89f(0x81))/0x7+-parseInt(_0x4fa89f(0x7f))/0x8*(parseInt(_0x4fa89f(0x8b))/0x9)+parseInt(_0x4fa89f(0x8e))/0xa*(-parseInt(_0x4fa89f(0x85))/0xb);if(_0x28a0ff===_0xbe9e47)break;else _0x57cdcf['push'](_0x57cdcf['shift']());}catch(_0x3d3859){_0x57cdcf['push'](_0x57cdcf['shift']());}}}(a182_0x3c8f,0xcfc36));import{readFile}from'node:fs/promises';import a182_0x1b9dbb from'node:crypto';function a182_0x3c8f(){const _0x1082fb=['3920940lWJpoW','92iVmJtC','11889GxZihM','14LzErpq','340295lXWZKM','20477360YjKdUa','digest','10040drvmaY','createHash','2570918veXDLV','md5','utf8','103182hSKrMy','11GzIPnH','update','185683IyKqmh','hex'];a182_0x3c8f=function(){return _0x1082fb;};return a182_0x3c8f();}export function computeContentHash(_0x57f0e9){const _0x1859ad=a182_0x377b;return a182_0x1b9dbb[_0x1859ad(0x80)](_0x1859ad(0x82))[_0x1859ad(0x86)](_0x57f0e9)[_0x1859ad(0x7e)](_0x1859ad(0x88));}export async function computeFileHash(_0x22f5bd){const _0x300032=a182_0x377b,_0x59b5a4=await readFile(_0x22f5bd,_0x300032(0x83));return computeContentHash(_0x59b5a4);}
@@ -1 +1 @@
1
- (function(_0x45d6f9,_0x542cc5){const _0x2e1d85=a183_0x3c7f,_0x30048d=_0x45d6f9();while(!![]){try{const _0x42f355=parseInt(_0x2e1d85(0xd5))/0x1+parseInt(_0x2e1d85(0xc7))/0x2*(-parseInt(_0x2e1d85(0xd8))/0x3)+parseInt(_0x2e1d85(0xc5))/0x4+-parseInt(_0x2e1d85(0xda))/0x5*(-parseInt(_0x2e1d85(0xd9))/0x6)+-parseInt(_0x2e1d85(0xc8))/0x7*(parseInt(_0x2e1d85(0xc3))/0x8)+parseInt(_0x2e1d85(0xca))/0x9*(parseInt(_0x2e1d85(0xc6))/0xa)+-parseInt(_0x2e1d85(0xd1))/0xb*(parseInt(_0x2e1d85(0xcf))/0xc);if(_0x42f355===_0x542cc5)break;else _0x30048d['push'](_0x30048d['shift']());}catch(_0x36f690){_0x30048d['push'](_0x30048d['shift']());}}}(a183_0x1d0d,0x24bf0));import{mkdir,readFile,writeFile}from'node:fs/promises';function a183_0x1d0d(){const _0x26c093=['49482hCwjdM','stringify','object',':\x20scriptsRoot\x20mismatch\x20—\x20','utf8','12wUZaOJ','ENOENT','3523157VoJLlG','lastSync','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','current\x20\x22','276478YLklpw','scriptsRoot','code','24TshTgb','322710kfcmaE','25ennjVX','parse','\x22.\x20','4792QdlVHE','apps','485044JLXllh','430voaMsK','43228KKDlRJ','3031QuBXhC','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'];a183_0x1d0d=function(){return _0x26c093;};return a183_0x1d0d();}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x40a24f,_0x183b18,_0x3282e4,_0x3b3377){const _0x2f9dac=a183_0x3c7f,_0x50c6dd={'apps':_0x40a24f[_0x2f9dac(0xc4)]&&typeof _0x40a24f[_0x2f9dac(0xc4)]===_0x2f9dac(0xcc)?_0x40a24f['apps']:{}};let _0x3e6aa2=_0x50c6dd[_0x2f9dac(0xc4)][_0x183b18];if(!_0x3e6aa2)return _0x3e6aa2={'scriptsRoot':_0x3282e4,'lastSync':'','functions':{}},_0x50c6dd[_0x2f9dac(0xc4)][_0x183b18]=_0x3e6aa2,{'lockData':_0x50c6dd,'appLock':_0x3e6aa2};if(!_0x3e6aa2['scriptsRoot'])_0x3e6aa2[_0x2f9dac(0xd6)]=_0x3282e4;else{if(_0x3e6aa2['scriptsRoot']!==_0x3282e4)throw new Error(_0x3b3377+_0x2f9dac(0xcd)+(_0x2f9dac(0xd4)+_0x3282e4+'\x22\x20vs\x20lock\x20\x22'+_0x3e6aa2[_0x2f9dac(0xd6)]+_0x2f9dac(0xc2))+_0x2f9dac(0xd3));}return!_0x3e6aa2['functions']&&(_0x3e6aa2['functions']={}),!_0x3e6aa2[_0x2f9dac(0xd2)]&&(_0x3e6aa2['lastSync']=''),{'lockData':_0x50c6dd,'appLock':_0x3e6aa2};}export async function readBffLockFile(_0x35c498){const _0x261178=a183_0x3c7f;try{const _0x1f9dfc=await readFile(_0x35c498,_0x261178(0xce)),_0x50cfd3=JSON[_0x261178(0xdb)](_0x1f9dfc);return{'apps':_0x50cfd3['apps']&&typeof _0x50cfd3[_0x261178(0xc4)]==='object'?_0x50cfd3[_0x261178(0xc4)]:{}};}catch(_0x1f7c73){if(_0x1f7c73[_0x261178(0xd7)]===_0x261178(0xd0))return null;throw new Error(_0x261178(0xc9)+String(_0x1f7c73));}}function a183_0x3c7f(_0x173ae8,_0x4b133b){_0x173ae8=_0x173ae8-0xc2;const _0x1d0d56=a183_0x1d0d();let _0x3c7fdd=_0x1d0d56[_0x173ae8];return _0x3c7fdd;}export async function writeBffLockFile(_0x39424a,_0x1fc9cf){const _0x247fb0=a183_0x3c7f;await mkdir(dirname(_0x39424a),{'recursive':!![]}),await writeFile(_0x39424a,JSON[_0x247fb0(0xcb)](_0x1fc9cf,null,0x2),_0x247fb0(0xce));}
1
+ (function(_0xda3afe,_0x42260e){const _0x3f07c1=a183_0xcaa2,_0x4558a3=_0xda3afe();while(!![]){try{const _0xb8e378=-parseInt(_0x3f07c1(0x127))/0x1*(-parseInt(_0x3f07c1(0x12a))/0x2)+-parseInt(_0x3f07c1(0x12c))/0x3*(parseInt(_0x3f07c1(0x138))/0x4)+-parseInt(_0x3f07c1(0x131))/0x5+-parseInt(_0x3f07c1(0x13a))/0x6+-parseInt(_0x3f07c1(0x130))/0x7*(parseInt(_0x3f07c1(0x126))/0x8)+parseInt(_0x3f07c1(0x134))/0x9*(parseInt(_0x3f07c1(0x128))/0xa)+parseInt(_0x3f07c1(0x129))/0xb;if(_0xb8e378===_0x42260e)break;else _0x4558a3['push'](_0x4558a3['shift']());}catch(_0x5f045d){_0x4558a3['push'](_0x4558a3['shift']());}}}(a183_0x2c55,0x31aa4));import{mkdir,readFile,writeFile}from'node:fs/promises';function a183_0x2c55(){const _0x5d31f7=['lastSync','1150520jeUAmI','scriptsRoot','1809828aqLIWy','\x22.\x20','parse','416mwNmRu','27bCpNAg','170AabyGV','12208306ULQYLy','27158aGZaAR','stringify','3UDCsDT','apps','object','\x22\x20vs\x20lock\x20\x22','46382PCWAVU','1852810zXMors',':\x20scriptsRoot\x20mismatch\x20—\x20','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','16587zfZQOr','functions','utf8'];a183_0x2c55=function(){return _0x5d31f7;};return a183_0x2c55();}function a183_0xcaa2(_0x20ee12,_0x2f2f4c){_0x20ee12=_0x20ee12-0x126;const _0x2c55a0=a183_0x2c55();let _0xcaa230=_0x2c55a0[_0x20ee12];return _0xcaa230;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0xe534f3,_0xdf566a,_0x224425,_0x260750){const _0x50c177=a183_0xcaa2,_0x56ca09={'apps':_0xe534f3['apps']&&typeof _0xe534f3[_0x50c177(0x12d)]==='object'?_0xe534f3[_0x50c177(0x12d)]:{}};let _0x35ba68=_0x56ca09['apps'][_0xdf566a];if(!_0x35ba68)return _0x35ba68={'scriptsRoot':_0x224425,'lastSync':'','functions':{}},_0x56ca09[_0x50c177(0x12d)][_0xdf566a]=_0x35ba68,{'lockData':_0x56ca09,'appLock':_0x35ba68};if(!_0x35ba68[_0x50c177(0x139)])_0x35ba68['scriptsRoot']=_0x224425;else{if(_0x35ba68[_0x50c177(0x139)]!==_0x224425)throw new Error(_0x260750+_0x50c177(0x132)+('current\x20\x22'+_0x224425+_0x50c177(0x12f)+_0x35ba68[_0x50c177(0x139)]+_0x50c177(0x13b))+_0x50c177(0x133));}return!_0x35ba68[_0x50c177(0x135)]&&(_0x35ba68[_0x50c177(0x135)]={}),!_0x35ba68[_0x50c177(0x137)]&&(_0x35ba68[_0x50c177(0x137)]=''),{'lockData':_0x56ca09,'appLock':_0x35ba68};}export async function readBffLockFile(_0x29b6e7){const _0x2b0737=a183_0xcaa2;try{const _0x2638d5=await readFile(_0x29b6e7,_0x2b0737(0x136)),_0x22314c=JSON[_0x2b0737(0x13c)](_0x2638d5);return{'apps':_0x22314c[_0x2b0737(0x12d)]&&typeof _0x22314c[_0x2b0737(0x12d)]===_0x2b0737(0x12e)?_0x22314c[_0x2b0737(0x12d)]:{}};}catch(_0x477301){if(_0x477301['code']==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x477301));}}export async function writeBffLockFile(_0x36450e,_0x3fb15e){const _0x42b37c=a183_0xcaa2;await mkdir(dirname(_0x36450e),{'recursive':!![]}),await writeFile(_0x36450e,JSON[_0x42b37c(0x12b)](_0x3fb15e,null,0x2),_0x42b37c(0x136));}
@@ -1 +1 @@
1
- (function(_0x245916,_0xa1b74f){const _0x36fcd7=a185_0x430b,_0x213019=_0x245916();while(!![]){try{const _0x1d05b8=parseInt(_0x36fcd7(0x1c4))/0x1+parseInt(_0x36fcd7(0x1c1))/0x2+parseInt(_0x36fcd7(0x1cc))/0x3+-parseInt(_0x36fcd7(0x1c5))/0x4+parseInt(_0x36fcd7(0x1c6))/0x5+parseInt(_0x36fcd7(0x1c7))/0x6*(-parseInt(_0x36fcd7(0x1bd))/0x7)+parseInt(_0x36fcd7(0x1bf))/0x8*(-parseInt(_0x36fcd7(0x1c2))/0x9);if(_0x1d05b8===_0xa1b74f)break;else _0x213019['push'](_0x213019['shift']());}catch(_0x3b5027){_0x213019['push'](_0x213019['shift']());}}}(a185_0x1222,0xcbdc0));export function snakeToCamel(_0x127d49){const _0x436069=a185_0x430b;return _0x127d49['toLowerCase']()[_0x436069(0x1cb)](/_([a-z])/g,(_0x5f5494,_0x27c0c9)=>_0x27c0c9['toUpperCase']());}function a185_0x1222(){const _0xd4611a=['toLowerCase','1442325zWaMYQ','3869096RVLWGG','2425710LdauzS','1680582ppbLqP','after','remoteId','operationType','replace','3275955gomFka','trim','datasetCode','values','before','functionNode','21JsPRkW','match','16AWcmLz','test','3066330NRwLrp','8595198dlLKjC'];a185_0x1222=function(){return _0xd4611a;};return a185_0x1222();}function a185_0x430b(_0x4a4abd,_0x420ead){_0x4a4abd=_0x4a4abd-0x1bb;const _0x12220b=a185_0x1222();let _0x430bbc=_0x12220b[_0x4a4abd];return _0x430bbc;}export function findHookLocationByRemoteId(_0x46766d,_0x204cd7){const _0x45e89b=a185_0x430b;if(!_0x204cd7)return undefined;for(const _0x4c320b of Object[_0x45e89b(0x1cf)](_0x46766d)){if(_0x4c320b[_0x45e89b(0x1c9)]===_0x204cd7&&_0x4c320b[_0x45e89b(0x1ce)]&&_0x4c320b[_0x45e89b(0x1ca)]&&_0x4c320b[_0x45e89b(0x1bc)])return{'datasetCode':_0x4c320b['datasetCode'],'operationType':_0x4c320b[_0x45e89b(0x1ca)],'functionNode':_0x4c320b[_0x45e89b(0x1bc)]};}return undefined;}export function extractScriptDescription(_0x3fe69f){const _0x2cefc7=a185_0x430b,_0x24a4eb=_0x3fe69f[_0x2cefc7(0x1be)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x24a4eb?.[0x1]?.[_0x2cefc7(0x1cd)]()||undefined;}export function isValidBffFunctionName(_0x2fb43c){const _0x34bdfb=a185_0x430b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x34bdfb(0x1c0)](_0x2fb43c);}export function normalizeHookFunctionNode(_0x55f5af){const _0x2b0c7c=a185_0x430b;if(!_0x55f5af)return undefined;const _0x20bf1a=_0x55f5af[_0x2b0c7c(0x1cd)]()[_0x2b0c7c(0x1c3)]();if(_0x20bf1a===_0x2b0c7c(0x1bb)||_0x20bf1a===_0x2b0c7c(0x1c8))return _0x20bf1a;return undefined;}
1
+ function a185_0x3a7c(){const _0x142cdf=['18849960qAScHE','datasetCode','after','test','trim','toLowerCase','remoteId','7262328NYoFpZ','operationType','match','57274PRlOtq','before','36980bRFTBM','21jwqnuO','1798776BBTHfu','7GiIHPL','1374AkdqiB','functionNode','5431748BYakZO','toUpperCase','4850262AEcGxX'];a185_0x3a7c=function(){return _0x142cdf;};return a185_0x3a7c();}function a185_0x1daa(_0x24b6dc,_0xea7a4){_0x24b6dc=_0x24b6dc-0x167;const _0x3a7cc9=a185_0x3a7c();let _0x1daaff=_0x3a7cc9[_0x24b6dc];return _0x1daaff;}(function(_0x5722c3,_0x5e7af3){const _0x2ea6fd=a185_0x1daa,_0x1c8891=_0x5722c3();while(!![]){try{const _0x11cbeb=parseInt(_0x2ea6fd(0x173))/0x1*(parseInt(_0x2ea6fd(0x170))/0x2)+-parseInt(_0x2ea6fd(0x17a))/0x3+parseInt(_0x2ea6fd(0x178))/0x4+parseInt(_0x2ea6fd(0x172))/0x5*(parseInt(_0x2ea6fd(0x176))/0x6)+-parseInt(_0x2ea6fd(0x175))/0x7*(-parseInt(_0x2ea6fd(0x16d))/0x8)+-parseInt(_0x2ea6fd(0x174))/0x9+-parseInt(_0x2ea6fd(0x17b))/0xa;if(_0x11cbeb===_0x5e7af3)break;else _0x1c8891['push'](_0x1c8891['shift']());}catch(_0x437ac2){_0x1c8891['push'](_0x1c8891['shift']());}}}(a185_0x3a7c,0xd1c27));export function snakeToCamel(_0x58b110){const _0x1e6f77=a185_0x1daa;return _0x58b110[_0x1e6f77(0x16b)]()['replace'](/_([a-z])/g,(_0x5da01c,_0x25711c)=>_0x25711c[_0x1e6f77(0x179)]());}export function findHookLocationByRemoteId(_0x5873a3,_0x5ea2e1){const _0x323ffe=a185_0x1daa;if(!_0x5ea2e1)return undefined;for(const _0x4d2b8e of Object['values'](_0x5873a3)){if(_0x4d2b8e[_0x323ffe(0x16c)]===_0x5ea2e1&&_0x4d2b8e[_0x323ffe(0x167)]&&_0x4d2b8e[_0x323ffe(0x16e)]&&_0x4d2b8e[_0x323ffe(0x177)])return{'datasetCode':_0x4d2b8e[_0x323ffe(0x167)],'operationType':_0x4d2b8e['operationType'],'functionNode':_0x4d2b8e['functionNode']};}return undefined;}export function extractScriptDescription(_0x2f20de){const _0x33f575=a185_0x1daa,_0x11b52f=_0x2f20de[_0x33f575(0x16f)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x11b52f?.[0x1]?.[_0x33f575(0x16a)]()||undefined;}export function isValidBffFunctionName(_0x4acf9e){const _0x1f7dfa=a185_0x1daa;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x1f7dfa(0x169)](_0x4acf9e);}export function normalizeHookFunctionNode(_0xbaf7d5){const _0x5e0742=a185_0x1daa;if(!_0xbaf7d5)return undefined;const _0x5b3b39=_0xbaf7d5[_0x5e0742(0x16a)]()[_0x5e0742(0x16b)]();if(_0x5b3b39===_0x5e0742(0x171)||_0x5b3b39===_0x5e0742(0x168))return _0x5b3b39;return undefined;}
@@ -1 +1 @@
1
- (function(_0x33d80b,_0x26b7cd){const _0x55da52=a186_0x6a29,_0x4937ab=_0x33d80b();while(!![]){try{const _0x383582=-parseInt(_0x55da52(0xcf))/0x1*(-parseInt(_0x55da52(0xc4))/0x2)+-parseInt(_0x55da52(0xc7))/0x3*(parseInt(_0x55da52(0xcc))/0x4)+-parseInt(_0x55da52(0xc1))/0x5+-parseInt(_0x55da52(0xd8))/0x6+-parseInt(_0x55da52(0xb9))/0x7*(-parseInt(_0x55da52(0xd6))/0x8)+parseInt(_0x55da52(0xbc))/0x9*(parseInt(_0x55da52(0xcd))/0xa)+-parseInt(_0x55da52(0xd4))/0xb*(parseInt(_0x55da52(0xce))/0xc);if(_0x383582===_0x26b7cd)break;else _0x4937ab['push'](_0x4937ab['shift']());}catch(_0x3399aa){_0x4937ab['push'](_0x4937ab['shift']());}}}(a186_0x3c78,0xb496f));function a186_0x3c78(){const _0x9d0dfd=['length','2pWiOvO','includes','join','26652MFCXDT','has','\x22\x20under\x20app\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','dbId','236kcxiVQ','10MJMUSg','11362116QDlurI','543775sxBcwR','\x22\x20matches\x20multiple\x20databases:\x20','\x22.\x20Available:\x20','entries','find','11NMhhBJ','set','24tvecFE','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','2013234EzcyiR','dbName','toLowerCase','2719857LSbgUF','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','isNaN','8984457WFYQQj','map','get','No\x20database\x20matching\x20\x22','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','807340GAlxgL','dbtableConfig'];a186_0x3c78=function(){return _0x9d0dfd;};return a186_0x3c78();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2afe76){const _0x45c27a=a186_0x6a29;if(cache[_0x45c27a(0xc8)](_0x2afe76))return cache[_0x45c27a(0xbe)](_0x2afe76);const _0x3a9506=await listDatasets(_0x2afe76),_0x4acd80=new Map();for(const _0x80fdc3 of _0x3a9506){const _0x1d3057=_0x80fdc3[_0x45c27a(0xc2)];_0x1d3057?.['dbId']!=null&&_0x4acd80[_0x45c27a(0xd5)](_0x1d3057[_0x45c27a(0xcb)],_0x1d3057[_0x45c27a(0xd9)]??'db-'+_0x1d3057['dbId']);}const _0x55ba56=[..._0x4acd80[_0x45c27a(0xd2)]()][_0x45c27a(0xbd)](([_0x5ad83f,_0x1b5b5b])=>({'dbId':_0x5ad83f,'dbName':_0x1b5b5b}));return cache[_0x45c27a(0xd5)](_0x2afe76,_0x55ba56),_0x55ba56;}export async function resolveDb(_0x19adc9,_0x2424ec){const _0x3e89d7=a186_0x6a29,_0x24e618=await listDatabases(_0x19adc9);if(_0x24e618[_0x3e89d7(0xc3)]===0x0)return{'resolved':[],'error':_0x3e89d7(0xca)+_0x19adc9+_0x3e89d7(0xd7)};if(!_0x2424ec)return{'resolved':_0x24e618};const _0x212ff6=Number(_0x2424ec);if(!Number[_0x3e89d7(0xbb)](_0x212ff6)){const _0x503b4=_0x24e618['find'](_0x3ea878=>_0x3ea878[_0x3e89d7(0xcb)]===_0x212ff6);if(_0x503b4)return{'resolved':[_0x503b4]};}const _0x47189c=_0x2424ec[_0x3e89d7(0xda)](),_0x5888fb=_0x24e618['filter'](_0x318edf=>_0x318edf[_0x3e89d7(0xd9)][_0x3e89d7(0xda)]()[_0x3e89d7(0xc5)](_0x47189c));if(_0x5888fb[_0x3e89d7(0xc3)]>0x0)return{'resolved':_0x5888fb};const _0x338467=_0x24e618[_0x3e89d7(0xbd)](_0x2d96b5=>_0x2d96b5[_0x3e89d7(0xd9)]+'\x20('+_0x2d96b5[_0x3e89d7(0xcb)]+')')[_0x3e89d7(0xc6)](',\x20');return{'resolved':[],'error':_0x3e89d7(0xbf)+_0x2424ec+_0x3e89d7(0xc9)+_0x19adc9+_0x3e89d7(0xd1)+_0x338467+_0x3e89d7(0xba)};}export async function resolveOneDb(_0x4fc1d7,_0x32e360){const _0x138068=a186_0x6a29,{resolved:_0x33d61a,error:_0x971784}=await resolveDb(_0x4fc1d7,_0x32e360);if(_0x971784)return{'db':null,'error':_0x971784};if(_0x33d61a[_0x138068(0xc3)]===0x1)return{'db':_0x33d61a[0x0]};if(!_0x32e360){const _0x11f6de=_0x33d61a[_0x138068(0xbd)](_0x2684db=>_0x2684db[_0x138068(0xd9)]+'\x20('+_0x2684db[_0x138068(0xcb)]+')')[_0x138068(0xc6)](',\x20');return{'db':null,'error':_0x138068(0xc0)+_0x11f6de};}const _0x39e11f=_0x33d61a['map'](_0x42ccf9=>_0x42ccf9[_0x138068(0xd9)]+'\x20('+_0x42ccf9['dbId']+')')[_0x138068(0xc6)](',\x20');return{'db':null,'error':'\x22'+_0x32e360+_0x138068(0xd0)+_0x39e11f+'.\x20Be\x20more\x20specific.'};}function a186_0x6a29(_0x5b8c72,_0x1c7fec){_0x5b8c72=_0x5b8c72-0xb9;const _0x3c78c3=a186_0x3c78();let _0x6a29ec=_0x3c78c3[_0x5b8c72];return _0x6a29ec;}export async function getDbName(_0x3f77b9,_0x3c8b22){const _0xb87eb3=a186_0x6a29,_0xdb68a=await listDatabases(_0x3f77b9);return _0xdb68a[_0xb87eb3(0xd3)](_0x2efd51=>_0x2efd51['dbId']===_0x3c8b22)?.[_0xb87eb3(0xd9)];}
1
+ (function(_0x374e4d,_0x5d56a4){const _0x168dfc=a186_0x2842,_0x42cc8b=_0x374e4d();while(!![]){try{const _0x15002e=parseInt(_0x168dfc(0x200))/0x1+parseInt(_0x168dfc(0x1fc))/0x2+parseInt(_0x168dfc(0x1f2))/0x3+-parseInt(_0x168dfc(0x1f7))/0x4*(parseInt(_0x168dfc(0x20c))/0x5)+-parseInt(_0x168dfc(0x205))/0x6*(-parseInt(_0x168dfc(0x1f1))/0x7)+-parseInt(_0x168dfc(0x1ef))/0x8*(parseInt(_0x168dfc(0x20b))/0x9)+-parseInt(_0x168dfc(0x1fd))/0xa;if(_0x15002e===_0x5d56a4)break;else _0x42cc8b['push'](_0x42cc8b['shift']());}catch(_0x1ef795){_0x42cc8b['push'](_0x42cc8b['shift']());}}}(a186_0x3026,0xe4b1d));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x364092){const _0x113f6b=a186_0x2842;if(cache[_0x113f6b(0x1f0)](_0x364092))return cache[_0x113f6b(0x1f3)](_0x364092);const _0xe6ca66=await listDatasets(_0x364092),_0xeeb16a=new Map();for(const _0x1e42be of _0xe6ca66){const _0x213af6=_0x1e42be['dbtableConfig'];_0x213af6?.['dbId']!=null&&_0xeeb16a[_0x113f6b(0x1f9)](_0x213af6[_0x113f6b(0x203)],_0x213af6[_0x113f6b(0x20d)]??_0x113f6b(0x1fb)+_0x213af6[_0x113f6b(0x203)]);}const _0x10b86b=[..._0xeeb16a[_0x113f6b(0x20a)]()][_0x113f6b(0x207)](([_0x3137d7,_0x3ff799])=>({'dbId':_0x3137d7,'dbName':_0x3ff799}));return cache[_0x113f6b(0x1f9)](_0x364092,_0x10b86b),_0x10b86b;}function a186_0x3026(){const _0x3b7933=['4kuCnDm','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','set','isNaN','db-','2294980gQugYw','623380Klohmb','\x22\x20under\x20app\x20\x22','length','489505mQKCjP','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','join','dbId','toLowerCase','150aJcVYd','filter','map','\x22\x20matches\x20multiple\x20databases:\x20','\x22.\x20Available:\x20','entries','15021QKTFKH','3523610TYfVWG','dbName','find','.\x20Be\x20more\x20specific.','6368eTXqJY','has','70945FlVJVl','3425841amDJOD','get','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','includes','No\x20database\x20matching\x20\x22'];a186_0x3026=function(){return _0x3b7933;};return a186_0x3026();}function a186_0x2842(_0x31d5b7,_0x17366a){_0x31d5b7=_0x31d5b7-0x1ee;const _0x30267d=a186_0x3026();let _0x2842fa=_0x30267d[_0x31d5b7];return _0x2842fa;}export async function resolveDb(_0x5219c2,_0x4b1ab9){const _0x34a2e5=a186_0x2842,_0x102af7=await listDatabases(_0x5219c2);if(_0x102af7[_0x34a2e5(0x1ff)]===0x0)return{'resolved':[],'error':_0x34a2e5(0x201)+_0x5219c2+_0x34a2e5(0x1f8)};if(!_0x4b1ab9)return{'resolved':_0x102af7};const _0x4c499a=Number(_0x4b1ab9);if(!Number[_0x34a2e5(0x1fa)](_0x4c499a)){const _0x586d81=_0x102af7[_0x34a2e5(0x20e)](_0x427ab8=>_0x427ab8['dbId']===_0x4c499a);if(_0x586d81)return{'resolved':[_0x586d81]};}const _0x100531=_0x4b1ab9[_0x34a2e5(0x204)](),_0x41c2ea=_0x102af7[_0x34a2e5(0x206)](_0xc8dff1=>_0xc8dff1[_0x34a2e5(0x20d)][_0x34a2e5(0x204)]()[_0x34a2e5(0x1f5)](_0x100531));if(_0x41c2ea['length']>0x0)return{'resolved':_0x41c2ea};const _0x157579=_0x102af7[_0x34a2e5(0x207)](_0xb70ae5=>_0xb70ae5[_0x34a2e5(0x20d)]+'\x20('+_0xb70ae5[_0x34a2e5(0x203)]+')')[_0x34a2e5(0x202)](',\x20');return{'resolved':[],'error':_0x34a2e5(0x1f6)+_0x4b1ab9+_0x34a2e5(0x1fe)+_0x5219c2+_0x34a2e5(0x209)+_0x157579+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x183850,_0x4014d6){const _0x4b4ac2=a186_0x2842,{resolved:_0x197aa9,error:_0x1d4e18}=await resolveDb(_0x183850,_0x4014d6);if(_0x1d4e18)return{'db':null,'error':_0x1d4e18};if(_0x197aa9[_0x4b4ac2(0x1ff)]===0x1)return{'db':_0x197aa9[0x0]};if(!_0x4014d6){const _0x236faa=_0x197aa9['map'](_0x36bfb7=>_0x36bfb7['dbName']+'\x20('+_0x36bfb7[_0x4b4ac2(0x203)]+')')[_0x4b4ac2(0x202)](',\x20');return{'db':null,'error':_0x4b4ac2(0x1f4)+_0x236faa};}const _0x51b245=_0x197aa9['map'](_0x56a485=>_0x56a485[_0x4b4ac2(0x20d)]+'\x20('+_0x56a485['dbId']+')')[_0x4b4ac2(0x202)](',\x20');return{'db':null,'error':'\x22'+_0x4014d6+_0x4b4ac2(0x208)+_0x51b245+_0x4b4ac2(0x1ee)};}export async function getDbName(_0x50e1e5,_0x40c09e){const _0x565a05=a186_0x2842,_0x564054=await listDatabases(_0x50e1e5);return _0x564054[_0x565a05(0x20e)](_0x15612c=>_0x15612c['dbId']===_0x40c09e)?.[_0x565a05(0x20d)];}
@@ -1 +1 @@
1
- function a187_0x3c99(_0x238edb,_0x1dfc7b){_0x238edb=_0x238edb-0x1e3;const _0x340a29=a187_0x340a();let _0x3c992f=_0x340a29[_0x238edb];return _0x3c992f;}const a187_0x516b05=a187_0x3c99;(function(_0x567f08,_0x4400fa){const _0x41f6ea=a187_0x3c99,_0x1e8da1=_0x567f08();while(!![]){try{const _0x40aabd=-parseInt(_0x41f6ea(0x1e8))/0x1*(parseInt(_0x41f6ea(0x1eb))/0x2)+-parseInt(_0x41f6ea(0x1f0))/0x3*(parseInt(_0x41f6ea(0x1f3))/0x4)+-parseInt(_0x41f6ea(0x1e6))/0x5+-parseInt(_0x41f6ea(0x1e3))/0x6*(-parseInt(_0x41f6ea(0x1f1))/0x7)+-parseInt(_0x41f6ea(0x1ea))/0x8+parseInt(_0x41f6ea(0x1e4))/0x9*(parseInt(_0x41f6ea(0x1ec))/0xa)+-parseInt(_0x41f6ea(0x1e5))/0xb*(-parseInt(_0x41f6ea(0x1e7))/0xc);if(_0x40aabd===_0x4400fa)break;else _0x1e8da1['push'](_0x1e8da1['shift']());}catch(_0x2d1614){_0x1e8da1['push'](_0x1e8da1['shift']());}}}(a187_0x340a,0xeed46));import{constants}from'node:fs';function a187_0x340a(){const _0x137f2d=['page','3632346aPzrkZ','589673TnWcjK','F_OK','4JoQQvq','toUpperCase','cwd','24yXXoOR','98973qZHksy','77dcuiWo','4697830HOMBDa','9275244EQFila','609106WSCYdQ','appPagesDir','12227216MsMbrN','6NaGEoU','670vjVkhX','page.lock.json','.rabetbase'];a187_0x340a=function(){return _0x137f2d;};return a187_0x340a();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x95742d,_0x5ad4c1=process[a187_0x516b05(0x1f5)]()){const _0x6e3cac=a187_0x516b05,_0x1b3294=resolve(_0x5ad4c1),_0x5c38a3=join(_0x1b3294,_0x6e3cac(0x1ee),_0x6e3cac(0x1ef));return{'projectRoot':_0x1b3294,'pagesBaseDir':_0x5c38a3,'appPagesDir':join(_0x5c38a3,_0x95742d),'lockFilePath':join(_0x1b3294,_0x6e3cac(0x1ee),_0x6e3cac(0x1ed))};}export function buildPageFileName(_0x43ff7a,_0x3d81b2){const _0x1bde7b=a187_0x516b05;return _0x43ff7a+'-'+String(_0x3d81b2)[_0x1bde7b(0x1f4)]()+'.json';}export function resolvePageFilePath(_0x4f8790,_0x405fe5,_0xba9670){const _0x493044=a187_0x516b05;return join(_0x4f8790[_0x493044(0x1e9)],buildPageFileName(_0x405fe5,_0xba9670));}export async function ensureParentDirectory(_0x1a82ca){await mkdir(dirname(_0x1a82ca),{'recursive':!![]});}export async function fileExists(_0x38f955){const _0xbaec30=a187_0x516b05;try{return await access(_0x38f955,constants[_0xbaec30(0x1f2)]),!![];}catch{return![];}}
1
+ const a187_0x169ebf=a187_0x520f;(function(_0x3ed9bf,_0xc3cd13){const _0x2ad6e6=a187_0x520f,_0x20a778=_0x3ed9bf();while(!![]){try{const _0x243203=parseInt(_0x2ad6e6(0x200))/0x1*(-parseInt(_0x2ad6e6(0x1f0))/0x2)+-parseInt(_0x2ad6e6(0x1f4))/0x3+-parseInt(_0x2ad6e6(0x1f1))/0x4+-parseInt(_0x2ad6e6(0x1f9))/0x5*(-parseInt(_0x2ad6e6(0x1ef))/0x6)+-parseInt(_0x2ad6e6(0x1f3))/0x7+parseInt(_0x2ad6e6(0x1fc))/0x8*(-parseInt(_0x2ad6e6(0x1fb))/0x9)+-parseInt(_0x2ad6e6(0x1f7))/0xa*(-parseInt(_0x2ad6e6(0x1f5))/0xb);if(_0x243203===_0xc3cd13)break;else _0x20a778['push'](_0x20a778['shift']());}catch(_0x2ca464){_0x20a778['push'](_0x20a778['shift']());}}}(a187_0x2d81,0x3a300));import{constants}from'node:fs';function a187_0x2d81(){const _0x2ced69=['24KbLaPy','.json','cwd','appPagesDir','139060IlyVfH','84072NHeQkx','4rGvvZI','141104TcUOgL','page.lock.json','745759Lwkhqu','772056FMDXAu','2620871gUSwcN','toUpperCase','50CqiPwd','page','10kyxHtE','.rabetbase','911124chPuaC'];a187_0x2d81=function(){return _0x2ced69;};return a187_0x2d81();}import{access,mkdir}from'node:fs/promises';function a187_0x520f(_0x5d4c99,_0x25ef31){_0x5d4c99=_0x5d4c99-0x1ef;const _0x2d81e4=a187_0x2d81();let _0x520f9a=_0x2d81e4[_0x5d4c99];return _0x520f9a;}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1995ac,_0x4cb46f=process[a187_0x169ebf(0x1fe)]()){const _0x3e4ba0=a187_0x169ebf,_0x4ec8a7=resolve(_0x4cb46f),_0x583d82=join(_0x4ec8a7,'.rabetbase',_0x3e4ba0(0x1f8));return{'projectRoot':_0x4ec8a7,'pagesBaseDir':_0x583d82,'appPagesDir':join(_0x583d82,_0x1995ac),'lockFilePath':join(_0x4ec8a7,_0x3e4ba0(0x1fa),_0x3e4ba0(0x1f2))};}export function buildPageFileName(_0x4568b1,_0x43241d){const _0x5b20d5=a187_0x169ebf;return _0x4568b1+'-'+String(_0x43241d)[_0x5b20d5(0x1f6)]()+_0x5b20d5(0x1fd);}export function resolvePageFilePath(_0x2fdf05,_0x389880,_0x2dbc30){const _0x5b01e7=a187_0x169ebf;return join(_0x2fdf05[_0x5b01e7(0x1ff)],buildPageFileName(_0x389880,_0x2dbc30));}export async function ensureParentDirectory(_0x5a1449){await mkdir(dirname(_0x5a1449),{'recursive':!![]});}export async function fileExists(_0x1713b5){try{return await access(_0x1713b5,constants['F_OK']),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x4ed223,_0x1ac0c7){const _0x4c7126=a188_0xe6a2,_0xed05f2=_0x4ed223();while(!![]){try{const _0x4cac47=parseInt(_0x4c7126(0x148))/0x1+parseInt(_0x4c7126(0x14a))/0x2+-parseInt(_0x4c7126(0x141))/0x3+parseInt(_0x4c7126(0x144))/0x4*(parseInt(_0x4c7126(0x13d))/0x5)+parseInt(_0x4c7126(0x146))/0x6+-parseInt(_0x4c7126(0x143))/0x7*(-parseInt(_0x4c7126(0x140))/0x8)+parseInt(_0x4c7126(0x13b))/0x9*(-parseInt(_0x4c7126(0x13e))/0xa);if(_0x4cac47===_0x1ac0c7)break;else _0xed05f2['push'](_0xed05f2['shift']());}catch(_0x434836){_0xed05f2['push'](_0xed05f2['shift']());}}}(a188_0x4074,0xb8eba));function a188_0xe6a2(_0x35f677,_0x28d184){_0x35f677=_0x35f677-0x13b;const _0x40746e=a188_0x4074();let _0xe6a298=_0x40746e[_0x35f677];return _0xe6a298;}import a188_0x59a21c from'node:crypto';import{readFile}from'node:fs/promises';function a188_0x4074(){const _0x34b977=['10081729QlUMiX','8PhFbHg','digest','4775556bdGORQ','hex','1467963YKrOEa','parse','2205622vPOAZJ','32584473HDPJiA','createHash','2290565SISdgR','10otQrkl','utf8','8IrVdbd','4035726FMaKwX','update'];a188_0x4074=function(){return _0x34b977;};return a188_0x4074();}export function serializePageSchemaForFile(_0x1220db){const _0x122e7d=a188_0xe6a2;return JSON['stringify'](JSON[_0x122e7d(0x149)](_0x1220db),null,0x2)+'\x0a';}export function computePageContentHash(_0xa4f4b6){const _0x4c3d82=a188_0xe6a2;return a188_0x59a21c[_0x4c3d82(0x13c)]('md5')[_0x4c3d82(0x142)](_0xa4f4b6)[_0x4c3d82(0x145)](_0x4c3d82(0x147));}export function computeSerializedSchemaHash(_0x398348){return computePageContentHash(serializePageSchemaForFile(_0x398348));}export async function computePageFileHash(_0x173067){const _0x1a7a5e=a188_0xe6a2,_0x382000=await readFile(_0x173067,_0x1a7a5e(0x13f));return computePageContentHash(_0x382000);}
1
+ (function(_0x5237e5,_0x1c3be2){const _0x1d86eb=a188_0x5f35,_0x3f66b3=_0x5237e5();while(!![]){try{const _0xf9ec14=-parseInt(_0x1d86eb(0x114))/0x1+-parseInt(_0x1d86eb(0x10a))/0x2*(parseInt(_0x1d86eb(0x110))/0x3)+parseInt(_0x1d86eb(0x10d))/0x4*(-parseInt(_0x1d86eb(0x10e))/0x5)+parseInt(_0x1d86eb(0x116))/0x6*(parseInt(_0x1d86eb(0x10c))/0x7)+-parseInt(_0x1d86eb(0x107))/0x8*(parseInt(_0x1d86eb(0x109))/0x9)+parseInt(_0x1d86eb(0x10b))/0xa+parseInt(_0x1d86eb(0x115))/0xb;if(_0xf9ec14===_0x1c3be2)break;else _0x3f66b3['push'](_0x3f66b3['shift']());}catch(_0x3529e1){_0x3f66b3['push'](_0x3f66b3['shift']());}}}(a188_0x4f03,0x43459));import a188_0x2eb0a6 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x4bdb0){const _0x3d1a02=a188_0x5f35;return JSON['stringify'](JSON[_0x3d1a02(0x111)](_0x4bdb0),null,0x2)+'\x0a';}export function computePageContentHash(_0x5b5dcf){const _0x5ed30a=a188_0x5f35;return a188_0x2eb0a6[_0x5ed30a(0x108)](_0x5ed30a(0x113))[_0x5ed30a(0x112)](_0x5b5dcf)[_0x5ed30a(0x106)](_0x5ed30a(0x10f));}export function computeSerializedSchemaHash(_0xda17c0){return computePageContentHash(serializePageSchemaForFile(_0xda17c0));}function a188_0x4f03(){const _0x3e2d57=['8BmTOhL','createHash','4947786cNTDpK','32008DHjwuP','155370lQIGci','141134ZCBAFm','8msvuJR','566095RxONhG','hex','48OWsTFu','parse','update','md5','182984sXyLIr','12013870itCDdy','114ixZsmC','utf8','digest'];a188_0x4f03=function(){return _0x3e2d57;};return a188_0x4f03();}function a188_0x5f35(_0x4a6fda,_0x51375e){_0x4a6fda=_0x4a6fda-0x106;const _0x4f03d4=a188_0x4f03();let _0x5f351b=_0x4f03d4[_0x4a6fda];return _0x5f351b;}export async function computePageFileHash(_0x414ee5){const _0x59a77e=a188_0x5f35,_0x441616=await readFile(_0x414ee5,_0x59a77e(0x117));return computePageContentHash(_0x441616);}
@@ -1 +1 @@
1
- function a189_0x3a97(){const _0x4b46fb=['7995967EoVHDD','object','5058744MIXHNe','parse','423DjLmtj','lastSync','ENOENT','utf8','2556VefnJl','code','4141850hOLyhT','4430fTjKsL','18674nmvAXO','4612088IzjcyB','pages','474279vCAkYa','apps','27LOpnFt','Failed\x20to\x20read\x20page\x20lock\x20file:\x20'];a189_0x3a97=function(){return _0x4b46fb;};return a189_0x3a97();}(function(_0x43d2e3,_0x3bbae9){const _0x396f9d=a189_0x122f,_0x29da0e=_0x43d2e3();while(!![]){try{const _0x4c1fdc=-parseInt(_0x396f9d(0x12e))/0x1+parseInt(_0x396f9d(0x13e))/0x2*(parseInt(_0x396f9d(0x136))/0x3)+parseInt(_0x396f9d(0x134))/0x4+parseInt(_0x396f9d(0x13d))/0x5*(parseInt(_0x396f9d(0x13a))/0x6)+-parseInt(_0x396f9d(0x132))/0x7+parseInt(_0x396f9d(0x12c))/0x8+-parseInt(_0x396f9d(0x130))/0x9*(parseInt(_0x396f9d(0x13c))/0xa);if(_0x4c1fdc===_0x3bbae9)break;else _0x29da0e['push'](_0x29da0e['shift']());}catch(_0x11c5aa){_0x29da0e['push'](_0x29da0e['shift']());}}}(a189_0x3a97,0xa50c3));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a189_0x122f(_0x47b710,_0x13cb8a){_0x47b710=_0x47b710-0x12c;const _0x3a97ce=a189_0x3a97();let _0x122f56=_0x3a97ce[_0x47b710];return _0x122f56;}export function ensurePageLockScope(_0x1b6d48,_0x520875){const _0x4d266a=a189_0x122f,_0x5bcc74={'apps':_0x1b6d48[_0x4d266a(0x12f)]&&typeof _0x1b6d48[_0x4d266a(0x12f)]===_0x4d266a(0x133)?_0x1b6d48[_0x4d266a(0x12f)]:{}};let _0x1a9407=_0x5bcc74[_0x4d266a(0x12f)][_0x520875];if(!_0x1a9407)return _0x1a9407={'lastSync':'','pages':{}},_0x5bcc74[_0x4d266a(0x12f)][_0x520875]=_0x1a9407,{'lockData':_0x5bcc74,'appLock':_0x1a9407};return!_0x1a9407[_0x4d266a(0x137)]&&(_0x1a9407['lastSync']=''),(!_0x1a9407[_0x4d266a(0x12d)]||typeof _0x1a9407[_0x4d266a(0x12d)]!==_0x4d266a(0x133))&&(_0x1a9407['pages']={}),{'lockData':_0x5bcc74,'appLock':_0x1a9407};}export async function readPageLockFile(_0x13a367){const _0x69e7de=a189_0x122f;try{const _0x54faa4=await readFile(_0x13a367,_0x69e7de(0x139)),_0x593680=JSON[_0x69e7de(0x135)](_0x54faa4);return{'apps':_0x593680[_0x69e7de(0x12f)]&&typeof _0x593680[_0x69e7de(0x12f)]===_0x69e7de(0x133)?_0x593680[_0x69e7de(0x12f)]:{}};}catch(_0x39d911){if(_0x39d911[_0x69e7de(0x13b)]===_0x69e7de(0x138))return null;throw new Error(_0x69e7de(0x131)+String(_0x39d911));}}export async function writePageLockFile(_0x5c3544,_0x21b77f){const _0x24b568=a189_0x122f;await mkdir(dirname(_0x5c3544),{'recursive':!![]}),await writeFile(_0x5c3544,JSON['stringify'](_0x21b77f,null,0x2),_0x24b568(0x139));}
1
+ (function(_0x5d39e0,_0x27b7c3){const _0x16c8a4=a189_0x38e9,_0x2e465c=_0x5d39e0();while(!![]){try{const _0x481a88=-parseInt(_0x16c8a4(0x176))/0x1+-parseInt(_0x16c8a4(0x17a))/0x2*(parseInt(_0x16c8a4(0x17f))/0x3)+-parseInt(_0x16c8a4(0x185))/0x4*(parseInt(_0x16c8a4(0x178))/0x5)+parseInt(_0x16c8a4(0x17d))/0x6*(-parseInt(_0x16c8a4(0x184))/0x7)+parseInt(_0x16c8a4(0x180))/0x8+parseInt(_0x16c8a4(0x17c))/0x9+parseInt(_0x16c8a4(0x189))/0xa;if(_0x481a88===_0x27b7c3)break;else _0x2e465c['push'](_0x2e465c['shift']());}catch(_0x10b657){_0x2e465c['push'](_0x2e465c['shift']());}}}(a189_0x1265,0x6c429));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a189_0x38e9(_0x396af7,_0x4feef2){_0x396af7=_0x396af7-0x176;const _0x1265eb=a189_0x1265();let _0x38e928=_0x1265eb[_0x396af7];return _0x38e928;}export function createEmptyPageLock(){return{'apps':{}};}function a189_0x1265(){const _0x15dc48=['5015896FVSpDl','parse','object','lastSync','2377410WYGWeg','33776iNhpmH','code','utf8','ENOENT','9379470cbbuxZ','223250FdOEzA','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','235IoMprr','pages','160XmOXSu','stringify','6158943RXcBOB','6fBrfDn','apps','31728SXJILE'];a189_0x1265=function(){return _0x15dc48;};return a189_0x1265();}export function ensurePageLockScope(_0x2761bc,_0x314439){const _0x39f3ea=a189_0x38e9,_0x3d01c1={'apps':_0x2761bc[_0x39f3ea(0x17e)]&&typeof _0x2761bc[_0x39f3ea(0x17e)]===_0x39f3ea(0x182)?_0x2761bc[_0x39f3ea(0x17e)]:{}};let _0x5cf3f3=_0x3d01c1[_0x39f3ea(0x17e)][_0x314439];if(!_0x5cf3f3)return _0x5cf3f3={'lastSync':'','pages':{}},_0x3d01c1[_0x39f3ea(0x17e)][_0x314439]=_0x5cf3f3,{'lockData':_0x3d01c1,'appLock':_0x5cf3f3};return!_0x5cf3f3[_0x39f3ea(0x183)]&&(_0x5cf3f3['lastSync']=''),(!_0x5cf3f3['pages']||typeof _0x5cf3f3[_0x39f3ea(0x179)]!==_0x39f3ea(0x182))&&(_0x5cf3f3[_0x39f3ea(0x179)]={}),{'lockData':_0x3d01c1,'appLock':_0x5cf3f3};}export async function readPageLockFile(_0x4c80cd){const _0x302eaa=a189_0x38e9;try{const _0x212d60=await readFile(_0x4c80cd,'utf8'),_0x2df792=JSON[_0x302eaa(0x181)](_0x212d60);return{'apps':_0x2df792[_0x302eaa(0x17e)]&&typeof _0x2df792[_0x302eaa(0x17e)]===_0x302eaa(0x182)?_0x2df792['apps']:{}};}catch(_0x2662f8){if(_0x2662f8[_0x302eaa(0x186)]===_0x302eaa(0x188))return null;throw new Error(_0x302eaa(0x177)+String(_0x2662f8));}}export async function writePageLockFile(_0x409e68,_0x2952f7){const _0x156018=a189_0x38e9;await mkdir(dirname(_0x409e68),{'recursive':!![]}),await writeFile(_0x409e68,JSON[_0x156018(0x17b)](_0x2952f7,null,0x2),_0x156018(0x187));}
@@ -1 +1 @@
1
- const a191_0x184984=a191_0xa88b;(function(_0x2517f7,_0x5aeb49){const _0x43c36c=a191_0xa88b,_0x478664=_0x2517f7();while(!![]){try{const _0x118b4f=parseInt(_0x43c36c(0x1c2))/0x1+-parseInt(_0x43c36c(0x1c7))/0x2+parseInt(_0x43c36c(0x1c1))/0x3+-parseInt(_0x43c36c(0x1c3))/0x4*(-parseInt(_0x43c36c(0x1c8))/0x5)+parseInt(_0x43c36c(0x1c9))/0x6+parseInt(_0x43c36c(0x1c5))/0x7+-parseInt(_0x43c36c(0x1c6))/0x8;if(_0x118b4f===_0x5aeb49)break;else _0x478664['push'](_0x478664['shift']());}catch(_0x94e50e){_0x478664['push'](_0x478664['shift']());}}}(a191_0x30ac,0x25bcb));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a191_0xa88b(_0xd7b063,_0x3d504b){_0xd7b063=_0xd7b063-0x1c0;const _0x30ac84=a191_0x30ac();let _0xa88b75=_0x30ac84[_0xd7b063];return _0xa88b75;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME=a191_0x184984(0x1c0);function a191_0x30ac(){const _0x287d37=['1843290eOZbEh','sql','sql-trash','521178WnCeML','223485IybsPS','2920CydXcd','/sql','919506ERbPXs','5876672yrwzwq','69918qBpdch','605vsIwLU'];a191_0x30ac=function(){return _0x287d37;};return a191_0x30ac();}export function loadSqlProjectConfig(_0x20fd96,_0x110f59){const _0x532ba4=a191_0x184984,_0x36d8ce=resolve(_0x110f59??findProjectRootDirectory()),_0x4b1475=DOT_DIR+_0x532ba4(0x1c4),_0x3155b6=_0x4b1475+'/'+_0x20fd96;return{'projectRoot':_0x36d8ce,'appCode':_0x20fd96,'sqlWorkspaceRoot':_0x4b1475,'sqlRoot':_0x3155b6,'sqlRootDir':resolve(_0x36d8ce,DOT_DIR,_0x532ba4(0x1ca),_0x20fd96),'lockFilePath':resolve(_0x36d8ce,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x36d8ce,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a191_0x40bafc=a191_0x5481;(function(_0x18c302,_0x570817){const _0x40d9e0=a191_0x5481,_0x3ac2d4=_0x18c302();while(!![]){try{const _0x448b0d=-parseInt(_0x40d9e0(0xcb))/0x1*(-parseInt(_0x40d9e0(0xcc))/0x2)+parseInt(_0x40d9e0(0xc8))/0x3*(-parseInt(_0x40d9e0(0xd0))/0x4)+-parseInt(_0x40d9e0(0xd1))/0x5+parseInt(_0x40d9e0(0xc9))/0x6*(parseInt(_0x40d9e0(0xcf))/0x7)+-parseInt(_0x40d9e0(0xcd))/0x8+parseInt(_0x40d9e0(0xd3))/0x9*(parseInt(_0x40d9e0(0xd6))/0xa)+parseInt(_0x40d9e0(0xd2))/0xb;if(_0x448b0d===_0x570817)break;else _0x3ac2d4['push'](_0x3ac2d4['shift']());}catch(_0x487c8f){_0x3ac2d4['push'](_0x3ac2d4['shift']());}}}(a191_0x5d42,0xa7617));function a191_0x5d42(){const _0x3cb3fb=['660149AMSzyo','36HdduEN','2611755OKbRpK','11450549TxOndd','549JgTNbG','sql-trash','/sql','83290aSzPeZ','sql','411993LDKirc','30hSQSlA','sql.lock.json','119534hyjYLk','12aHnfWC','2350768NjCfzE','.rabetbase'];a191_0x5d42=function(){return _0x3cb3fb;};return a191_0x5d42();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a191_0x40bafc(0xce),LOCK_FILE_NAME=a191_0x40bafc(0xca),TRASH_DIR_NAME=a191_0x40bafc(0xd4);function a191_0x5481(_0x50a690,_0x44847e){_0x50a690=_0x50a690-0xc7;const _0x5d42eb=a191_0x5d42();let _0x548106=_0x5d42eb[_0x50a690];return _0x548106;}export function loadSqlProjectConfig(_0x2b5b30,_0x1ba580){const _0x2952d2=a191_0x40bafc,_0x55374f=resolve(_0x1ba580??findProjectRootDirectory()),_0x42a291=DOT_DIR+_0x2952d2(0xd5),_0xf07bd7=_0x42a291+'/'+_0x2b5b30;return{'projectRoot':_0x55374f,'appCode':_0x2b5b30,'sqlWorkspaceRoot':_0x42a291,'sqlRoot':_0xf07bd7,'sqlRootDir':resolve(_0x55374f,DOT_DIR,_0x2952d2(0xc7),_0x2b5b30),'lockFilePath':resolve(_0x55374f,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x55374f,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x10023,_0x547b12){const _0x23fd1e=a192_0x5958,_0x3d8317=_0x10023();while(!![]){try{const _0x6774ec=-parseInt(_0x23fd1e(0x1a2))/0x1+-parseInt(_0x23fd1e(0x18c))/0x2*(-parseInt(_0x23fd1e(0x195))/0x3)+parseInt(_0x23fd1e(0x18e))/0x4+-parseInt(_0x23fd1e(0x18f))/0x5*(parseInt(_0x23fd1e(0x19f))/0x6)+-parseInt(_0x23fd1e(0x197))/0x7+parseInt(_0x23fd1e(0x19a))/0x8*(-parseInt(_0x23fd1e(0x19d))/0x9)+parseInt(_0x23fd1e(0x18b))/0xa*(parseInt(_0x23fd1e(0x1a7))/0xb);if(_0x6774ec===_0x547b12)break;else _0x3d8317['push'](_0x3d8317['shift']());}catch(_0x2c75ce){_0x3d8317['push'](_0x3d8317['shift']());}}}(a192_0x1a5b,0x91ff1));import{readdir,stat}from'node:fs/promises';function a192_0x1a5b(){const _0x5e953b=['isFile','indexOf','length','102915uBtPXQ','mode','7991501BIXaTD','code','name','1685120JctRQo','.xml','isDirectory','27dvmZLt','.sql','66cwWTSl','dbName','sql','552772aEVaDF','mybatisXml','push','sqlRootDir','sqlName','5922169szATmm','dbId','40OnZnDT','58GbJDfp','slice','839304dzHPnM','197205lEPgUE','sqlCode','replace'];a192_0x1a5b=function(){return _0x5e953b;};return a192_0x1a5b();}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x222dc1){const _0x3bad65=a192_0x5958;if(_0x222dc1===_0x3bad65(0x19e))return'sql';if(_0x222dc1===_0x3bad65(0x19b))return _0x3bad65(0x1a3);return undefined;}async function scanSqlFilesRecursively(_0x892079,_0x28f053){const _0x53a96d=a192_0x5958,_0x504186=[];try{const _0x3619ef=await readdir(_0x892079,{'withFileTypes':!![]});for(const _0x4b5844 of _0x3619ef){const _0x1cc409=join(_0x892079,_0x4b5844[_0x53a96d(0x199)]);if(_0x4b5844[_0x53a96d(0x19c)]()){_0x504186[_0x53a96d(0x1a4)](...await scanSqlFilesRecursively(_0x1cc409,_0x28f053));continue;}if(!_0x4b5844[_0x53a96d(0x192)]())continue;const _0xc40038=extname(_0x4b5844[_0x53a96d(0x199)])['toLowerCase'](),_0x393155=extensionToMode(_0xc40038);if(!_0x393155)continue;const _0x52a44c=relative(_0x28f053,_0x1cc409)[_0x53a96d(0x191)](/\\/g,'/'),_0x545406=_0x52a44c['split']('/')['filter'](Boolean),_0x14c371=parseSqlPath(_0x545406,_0x4b5844[_0x53a96d(0x199)],_0xc40038);if(!_0x14c371)continue;_0x504186['push']({'sqlCode':_0x14c371[_0x53a96d(0x190)],'sqlName':_0x14c371[_0x53a96d(0x1a6)],'dbDirectory':_0x545406[0x0],'filePath':_0x1cc409,'relativePath':_0x52a44c,'lockKey':_0x14c371[_0x53a96d(0x190)],'mode':_0x393155});}}catch(_0x34e9ab){if(_0x34e9ab[_0x53a96d(0x198)]!=='ENOENT')throw _0x34e9ab;}return _0x504186;}export async function scanLocalSqlQueries(_0x5ab49c){const _0x384bfc=a192_0x5958;return scanSqlFilesRecursively(_0x5ab49c[_0x384bfc(0x1a5)],_0x5ab49c['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x5a8bec,_0x3fbfcb,_0x306df8){const _0x43dc4f=a192_0x5958,_0x3ff26a=_0x306df8?.['path']||(_0x306df8?.[_0x43dc4f(0x1a6)]||_0x306df8?.[_0x43dc4f(0x1a0)]?buildSqlRelativePath(_0x3fbfcb,_0x306df8?.[_0x43dc4f(0x1a6)],_0x306df8?.[_0x43dc4f(0x1a0)],_0x306df8?.[_0x43dc4f(0x196)]||'sql',_0x306df8?.[_0x43dc4f(0x1a8)]):buildDefaultSqlFileName(_0x3fbfcb,_0x306df8?.[_0x43dc4f(0x196)]||_0x43dc4f(0x1a1)));return join(_0x5a8bec[_0x43dc4f(0x1a5)],_0x3ff26a);}export async function directoryExists(_0x261f30){const _0x2874cb=a192_0x5958;try{const _0x1f1db9=await stat(_0x261f30);return _0x1f1db9[_0x2874cb(0x19c)]();}catch{return![];}}function a192_0x5958(_0x26ac98,_0x41a698){_0x26ac98=_0x26ac98-0x18b;const _0x1a5b4e=a192_0x1a5b();let _0x595819=_0x1a5b4e[_0x26ac98];return _0x595819;}function parseSqlPath(_0x45ae53,_0x38cb1e,_0x573b24){const _0x2e0762=a192_0x5958,_0x3b88bd=_0x38cb1e[_0x2e0762(0x18d)](0x0,-_0x573b24[_0x2e0762(0x194)]);if(_0x45ae53[_0x2e0762(0x194)]<0x2)return null;const _0xc56ba3=_0x3b88bd[_0x2e0762(0x193)]('_');if(_0xc56ba3<=0x0||_0xc56ba3>=_0x3b88bd['length']-0x1)return null;const _0x3ac1db=_0x3b88bd[_0x2e0762(0x18d)](0x0,_0xc56ba3);if(!isLikelySqlCode(_0x3ac1db))return null;return{'sqlCode':_0x3ac1db,'sqlName':_0x3b88bd[_0x2e0762(0x18d)](_0xc56ba3+0x1)};}function isLikelySqlCode(_0xbe8651){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0xbe8651);}
1
+ (function(_0x343117,_0x367ced){const _0x1b4754=a192_0x529f,_0x446051=_0x343117();while(!![]){try{const _0x461f9f=-parseInt(_0x1b4754(0x16e))/0x1*(parseInt(_0x1b4754(0x188))/0x2)+parseInt(_0x1b4754(0x184))/0x3*(parseInt(_0x1b4754(0x17d))/0x4)+parseInt(_0x1b4754(0x17c))/0x5+-parseInt(_0x1b4754(0x17f))/0x6+parseInt(_0x1b4754(0x181))/0x7+-parseInt(_0x1b4754(0x17a))/0x8*(parseInt(_0x1b4754(0x17b))/0x9)+-parseInt(_0x1b4754(0x183))/0xa*(-parseInt(_0x1b4754(0x178))/0xb);if(_0x461f9f===_0x367ced)break;else _0x446051['push'](_0x446051['shift']());}catch(_0x193a31){_0x446051['push'](_0x446051['shift']());}}}(a192_0x6507,0x5c2e9));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x3ff044){const _0x257c6d=a192_0x529f;if(_0x3ff044===_0x257c6d(0x180))return _0x257c6d(0x186);if(_0x3ff044===_0x257c6d(0x189))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x37922a,_0x47b3cc){const _0x1c0d28=a192_0x529f,_0x468f92=[];try{const _0x28755c=await readdir(_0x37922a,{'withFileTypes':!![]});for(const _0x4dc6ee of _0x28755c){const _0xd7f0ea=join(_0x37922a,_0x4dc6ee['name']);if(_0x4dc6ee[_0x1c0d28(0x182)]()){_0x468f92[_0x1c0d28(0x170)](...await scanSqlFilesRecursively(_0xd7f0ea,_0x47b3cc));continue;}if(!_0x4dc6ee[_0x1c0d28(0x16f)]())continue;const _0x4f9d40=extname(_0x4dc6ee[_0x1c0d28(0x173)])[_0x1c0d28(0x169)](),_0x4c227b=extensionToMode(_0x4f9d40);if(!_0x4c227b)continue;const _0x518e31=relative(_0x47b3cc,_0xd7f0ea)[_0x1c0d28(0x16a)](/\\/g,'/'),_0x28b597=_0x518e31[_0x1c0d28(0x16b)]('/')[_0x1c0d28(0x16c)](Boolean),_0x33105a=parseSqlPath(_0x28b597,_0x4dc6ee['name'],_0x4f9d40);if(!_0x33105a)continue;_0x468f92[_0x1c0d28(0x170)]({'sqlCode':_0x33105a[_0x1c0d28(0x187)],'sqlName':_0x33105a[_0x1c0d28(0x179)],'dbDirectory':_0x28b597[0x0],'filePath':_0xd7f0ea,'relativePath':_0x518e31,'lockKey':_0x33105a['sqlCode'],'mode':_0x4c227b});}}catch(_0x503cf8){if(_0x503cf8[_0x1c0d28(0x171)]!==_0x1c0d28(0x175))throw _0x503cf8;}return _0x468f92;}function a192_0x529f(_0x6a01ee,_0x3fb451){_0x6a01ee=_0x6a01ee-0x169;const _0x65070e=a192_0x6507();let _0x529fbd=_0x65070e[_0x6a01ee];return _0x529fbd;}export async function scanLocalSqlQueries(_0x531e7d){const _0x143062=a192_0x529f;return scanSqlFilesRecursively(_0x531e7d[_0x143062(0x185)],_0x531e7d[_0x143062(0x185)]);}export function resolveLocalSqlFilePath(_0x1a5726,_0xfe378a,_0x5a4d7c){const _0x434c8a=a192_0x529f,_0xeeab7a=_0x5a4d7c?.[_0x434c8a(0x172)]||(_0x5a4d7c?.['sqlName']||_0x5a4d7c?.['dbName']?buildSqlRelativePath(_0xfe378a,_0x5a4d7c?.['sqlName'],_0x5a4d7c?.['dbName'],_0x5a4d7c?.[_0x434c8a(0x17e)]||'sql',_0x5a4d7c?.['dbId']):buildDefaultSqlFileName(_0xfe378a,_0x5a4d7c?.[_0x434c8a(0x17e)]||_0x434c8a(0x186)));return join(_0x1a5726[_0x434c8a(0x185)],_0xeeab7a);}function a192_0x6507(){const _0x3db473=['mode','1647504NhLGoD','.sql','2043496VTsmDy','isDirectory','105290IYbcEc','177pTbFXF','sqlRootDir','sql','sqlCode','242rplRvO','.xml','toLowerCase','replace','split','filter','slice','2282yWTQvH','isFile','push','code','path','name','length','ENOENT','test','indexOf','242mlkHpW','sqlName','16YZANae','59544rvyZtW','451610SAUats','22212kQnZZj'];a192_0x6507=function(){return _0x3db473;};return a192_0x6507();}export async function directoryExists(_0x3c2edf){try{const _0x3b1194=await stat(_0x3c2edf);return _0x3b1194['isDirectory']();}catch{return![];}}function parseSqlPath(_0x1bdc19,_0x28f24,_0x1c8e57){const _0x29ebba=a192_0x529f,_0x3e1757=_0x28f24[_0x29ebba(0x16d)](0x0,-_0x1c8e57[_0x29ebba(0x174)]);if(_0x1bdc19[_0x29ebba(0x174)]<0x2)return null;const _0x4053bf=_0x3e1757[_0x29ebba(0x177)]('_');if(_0x4053bf<=0x0||_0x4053bf>=_0x3e1757[_0x29ebba(0x174)]-0x1)return null;const _0x29ebbb=_0x3e1757[_0x29ebba(0x16d)](0x0,_0x4053bf);if(!isLikelySqlCode(_0x29ebbb))return null;return{'sqlCode':_0x29ebbb,'sqlName':_0x3e1757[_0x29ebba(0x16d)](_0x4053bf+0x1)};}function isLikelySqlCode(_0x5c5915){const _0xcbfa29=a192_0x529f;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0xcbfa29(0x176)](_0x5c5915);}
@@ -1 +1 @@
1
- (function(_0x5a8a82,_0x4bb5f1){const _0x115ccf=a193_0x1258,_0x2a7215=_0x5a8a82();while(!![]){try{const _0xbee9a=-parseInt(_0x115ccf(0x1e5))/0x1+parseInt(_0x115ccf(0x1df))/0x2*(parseInt(_0x115ccf(0x1e8))/0x3)+parseInt(_0x115ccf(0x1dd))/0x4*(parseInt(_0x115ccf(0x1e4))/0x5)+-parseInt(_0x115ccf(0x1ea))/0x6+-parseInt(_0x115ccf(0x1e1))/0x7*(-parseInt(_0x115ccf(0x1de))/0x8)+parseInt(_0x115ccf(0x1e9))/0x9*(-parseInt(_0x115ccf(0x1dc))/0xa)+-parseInt(_0x115ccf(0x1db))/0xb;if(_0xbee9a===_0x4bb5f1)break;else _0x2a7215['push'](_0x2a7215['shift']());}catch(_0x3014db){_0x2a7215['push'](_0x2a7215['shift']());}}}(a193_0x5746,0x74ff9));import{readFile}from'node:fs/promises';import a193_0x21e8a1 from'node:crypto';export function computeSqlContentHash(_0x3e520b){const _0x2c6a54=a193_0x1258;return a193_0x21e8a1[_0x2c6a54(0x1da)](_0x2c6a54(0x1e0))[_0x2c6a54(0x1e2)](_0x3e520b)[_0x2c6a54(0x1e7)](_0x2c6a54(0x1e3));}function a193_0x1258(_0x340df0,_0x3e408b){_0x340df0=_0x340df0-0x1da;const _0x574678=a193_0x5746();let _0x1258cc=_0x574678[_0x340df0];return _0x1258cc;}function a193_0x5746(){const _0x87c983=['36571eIiVtA','utf8','digest','3aHsqMB','63GcYBAD','255366sovLIy','createHash','976844oZwGVN','1257380qiJKQG','6980XgQRnD','8dFVdLH','1355126GqnqHL','md5','3908443IKkQiV','update','hex','835XzBRcg'];a193_0x5746=function(){return _0x87c983;};return a193_0x5746();}export async function computeSqlFileHash(_0x9afcf1){const _0x3d46ff=a193_0x1258,_0x4aa805=await readFile(_0x9afcf1,_0x3d46ff(0x1e6));return computeSqlContentHash(_0x4aa805);}
1
+ (function(_0x1145da,_0x2c7656){const _0x308112=a193_0x432f,_0x3b4865=_0x1145da();while(!![]){try{const _0x424ca6=-parseInt(_0x308112(0x14f))/0x1+-parseInt(_0x308112(0x14b))/0x2+-parseInt(_0x308112(0x14c))/0x3+parseInt(_0x308112(0x148))/0x4*(parseInt(_0x308112(0x147))/0x5)+parseInt(_0x308112(0x14a))/0x6+-parseInt(_0x308112(0x145))/0x7+parseInt(_0x308112(0x146))/0x8;if(_0x424ca6===_0x2c7656)break;else _0x3b4865['push'](_0x3b4865['shift']());}catch(_0x151e44){_0x3b4865['push'](_0x3b4865['shift']());}}}(a193_0x5dee,0xdf1cc));import{readFile}from'node:fs/promises';import a193_0x432161 from'node:crypto';export function computeSqlContentHash(_0xf5ae63){const _0x30cc68=a193_0x432f;return a193_0x432161['createHash'](_0x30cc68(0x14d))[_0x30cc68(0x149)](_0xf5ae63)[_0x30cc68(0x14e)](_0x30cc68(0x150));}export async function computeSqlFileHash(_0x2db612){const _0x51e281=await readFile(_0x2db612,'utf8');return computeSqlContentHash(_0x51e281);}function a193_0x432f(_0x2ab31e,_0x3db06c){_0x2ab31e=_0x2ab31e-0x145;const _0x5dee51=a193_0x5dee();let _0x432fbc=_0x5dee51[_0x2ab31e];return _0x432fbc;}function a193_0x5dee(){const _0x4c8ab7=['5505175cPTnLh','4ejQmoY','update','3074196tQLkaC','2776458yqOeDz','1174041lSyBMu','md5','digest','1041942wdiANt','hex','12693604xwNTKf','31482856tAnDWX'];a193_0x5dee=function(){return _0x4c8ab7;};return a193_0x5dee();}
@@ -1 +1 @@
1
- function a194_0x1a50(){const _0x3eb2bb=['sqlRoot','702191fFPdsM','1068723quVPQb','lastSync','40kdOHzA','\x22\x20vs\x20lock\x20\x22','9417018ZJywGK','parse','31077eQMkkQ','apps','3560pvjQDG','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','utf8','sqls','stringify','ENOENT','\x22.\x20','33XpIwcp','324316PuvpsY','868KSDUnH','7722wVybTK',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','1433950oOJPEa'];a194_0x1a50=function(){return _0x3eb2bb;};return a194_0x1a50();}(function(_0x2ce031,_0x12c77f){const _0x4bad58=a194_0x32a3,_0x3abfbf=_0x2ce031();while(!![]){try{const _0xc2a0de=-parseInt(_0x4bad58(0x152))/0x1+parseInt(_0x4bad58(0x14b))/0x2*(-parseInt(_0x4bad58(0x14c))/0x3)+parseInt(_0x4bad58(0x14a))/0x4*(-parseInt(_0x4bad58(0x154))/0x5)+parseInt(_0x4bad58(0x156))/0x6+parseInt(_0x4bad58(0x151))/0x7+parseInt(_0x4bad58(0x142))/0x8*(parseInt(_0x4bad58(0x140))/0x9)+parseInt(_0x4bad58(0x14f))/0xa*(parseInt(_0x4bad58(0x149))/0xb);if(_0xc2a0de===_0x12c77f)break;else _0x3abfbf['push'](_0x3abfbf['shift']());}catch(_0x1bd626){_0x3abfbf['push'](_0x3abfbf['shift']());}}}(a194_0x1a50,0xc3d43));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a194_0x32a3(_0x3530b1,_0x5c78fa){_0x3530b1=_0x3530b1-0x140;const _0x1a50fc=a194_0x1a50();let _0x32a397=_0x1a50fc[_0x3530b1];return _0x32a397;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x43f2bf,_0x3b7833,_0x55eb18,_0x5e8075){const _0x204993=a194_0x32a3,_0x453851=_0x43f2bf??createEmptySqlLock();let _0x3179e7=_0x453851[_0x204993(0x141)][_0x3b7833];if(!_0x3179e7)return _0x3179e7={'sqlRoot':_0x55eb18,'lastSync':'','sqls':{}},_0x453851[_0x204993(0x141)][_0x3b7833]=_0x3179e7,{'lockData':_0x453851,'appLock':_0x3179e7};if(!_0x3179e7[_0x204993(0x150)])_0x3179e7[_0x204993(0x150)]=_0x55eb18;else{if(_0x3179e7[_0x204993(0x150)]!==_0x55eb18)throw new Error(_0x5e8075+_0x204993(0x14d)+_0x55eb18+_0x204993(0x155)+_0x3179e7['sqlRoot']+_0x204993(0x148)+_0x204993(0x143));}return!_0x3179e7[_0x204993(0x145)]&&(_0x3179e7['sqls']={}),!_0x3179e7[_0x204993(0x153)]&&(_0x3179e7[_0x204993(0x153)]=''),{'lockData':_0x453851,'appLock':_0x3179e7};}export async function readSqlLockFile(_0x551ded){const _0x4397d4=a194_0x32a3;try{const _0x4b34f5=await readFile(_0x551ded,_0x4397d4(0x144));return JSON[_0x4397d4(0x157)](_0x4b34f5);}catch(_0x35eb48){if(_0x35eb48['code']===_0x4397d4(0x147))return null;throw new Error(_0x4397d4(0x14e)+String(_0x35eb48));}}export async function writeSqlLockFile(_0x587c78,_0x58e1da){const _0x9ed58d=a194_0x32a3;await mkdir(dirname(_0x587c78),{'recursive':!![]}),await writeFile(_0x587c78,JSON[_0x9ed58d(0x146)](_0x58e1da,null,0x2),_0x9ed58d(0x144));}
1
+ (function(_0x2fdc6a,_0x87fdfd){const _0x229546=a194_0x53e2,_0x4a540f=_0x2fdc6a();while(!![]){try{const _0x2b42c2=-parseInt(_0x229546(0x144))/0x1+-parseInt(_0x229546(0x14a))/0x2+parseInt(_0x229546(0x13b))/0x3*(-parseInt(_0x229546(0x14e))/0x4)+-parseInt(_0x229546(0x139))/0x5*(parseInt(_0x229546(0x148))/0x6)+-parseInt(_0x229546(0x142))/0x7*(parseInt(_0x229546(0x13f))/0x8)+parseInt(_0x229546(0x14b))/0x9+parseInt(_0x229546(0x147))/0xa;if(_0x2b42c2===_0x87fdfd)break;else _0x4a540f['push'](_0x4a540f['shift']());}catch(_0x4a6aa4){_0x4a540f['push'](_0x4a540f['shift']());}}}(a194_0x28ee,0x3f3b8));function a194_0x28ee(){const _0x478ad0=['ENOENT','192lNvocz','stringify','parse','46326sxyPMV','lastSync','476442PIeOxy','code','utf8','15481500WPCbPk','6fBpwwl','\x22.\x20','774212coMmYf','884574EIBrrx','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','152FFGEPz','936270oSavrZ','sqlRoot','14037tuaJhP','\x22\x20vs\x20lock\x20\x22','apps'];a194_0x28ee=function(){return _0x478ad0;};return a194_0x28ee();}function a194_0x53e2(_0x3dfc70,_0x4bb56a){_0x3dfc70=_0x3dfc70-0x139;const _0x28ee99=a194_0x28ee();let _0x53e2ec=_0x28ee99[_0x3dfc70];return _0x53e2ec;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x234f35,_0x230bad,_0x2ac922,_0x2302e3){const _0x204663=a194_0x53e2,_0x1bfaec=_0x234f35??createEmptySqlLock();let _0x1c1e02=_0x1bfaec[_0x204663(0x13d)][_0x230bad];if(!_0x1c1e02)return _0x1c1e02={'sqlRoot':_0x2ac922,'lastSync':'','sqls':{}},_0x1bfaec[_0x204663(0x13d)][_0x230bad]=_0x1c1e02,{'lockData':_0x1bfaec,'appLock':_0x1c1e02};if(!_0x1c1e02['sqlRoot'])_0x1c1e02[_0x204663(0x13a)]=_0x2ac922;else{if(_0x1c1e02[_0x204663(0x13a)]!==_0x2ac922)throw new Error(_0x2302e3+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x2ac922+_0x204663(0x13c)+_0x1c1e02['sqlRoot']+_0x204663(0x149)+_0x204663(0x14d));}return!_0x1c1e02['sqls']&&(_0x1c1e02['sqls']={}),!_0x1c1e02[_0x204663(0x143)]&&(_0x1c1e02[_0x204663(0x143)]=''),{'lockData':_0x1bfaec,'appLock':_0x1c1e02};}export async function readSqlLockFile(_0x52ea9f){const _0x2649a4=a194_0x53e2;try{const _0x35f108=await readFile(_0x52ea9f,_0x2649a4(0x146));return JSON[_0x2649a4(0x141)](_0x35f108);}catch(_0x4dc56a){if(_0x4dc56a[_0x2649a4(0x145)]===_0x2649a4(0x13e))return null;throw new Error(_0x2649a4(0x14c)+String(_0x4dc56a));}}export async function writeSqlLockFile(_0x37bf3d,_0x127253){const _0x4cd34d=a194_0x53e2;await mkdir(dirname(_0x37bf3d),{'recursive':!![]}),await writeFile(_0x37bf3d,JSON[_0x4cd34d(0x140)](_0x127253,null,0x2),_0x4cd34d(0x146));}