@lovrabet/rabetbase-cli 2.1.7-beta.3 → 2.1.7-beta.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 (196) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/delete.js +1 -1
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.js +1 -1
  54. package/lib/commands/dataset/link-create.js +1 -1
  55. package/lib/commands/dataset/link-delete.js +1 -1
  56. package/lib/commands/dataset/link-shared.js +1 -1
  57. package/lib/commands/dataset/link-update.js +1 -1
  58. package/lib/commands/dataset/links.js +1 -1
  59. package/lib/commands/dataset/list.js +1 -1
  60. package/lib/commands/dataset/operations.js +1 -1
  61. package/lib/commands/db/analyze-cancel.js +1 -1
  62. package/lib/commands/db/analyze-start.js +1 -1
  63. package/lib/commands/db/analyze-status.js +1 -1
  64. package/lib/commands/db/create.js +1 -1
  65. package/lib/commands/db/delete.js +1 -1
  66. package/lib/commands/db/detail.js +1 -1
  67. package/lib/commands/db/diff.js +1 -1
  68. package/lib/commands/db/index.js +1 -1
  69. package/lib/commands/db/list.js +1 -1
  70. package/lib/commands/db/shared.js +1 -1
  71. package/lib/commands/db/tables.js +1 -1
  72. package/lib/commands/db/test.js +1 -1
  73. package/lib/commands/db/update.js +1 -1
  74. package/lib/commands/doctor.js +1 -1
  75. package/lib/commands/init/index.js +1 -1
  76. package/lib/commands/issue/index.js +1 -1
  77. package/lib/commands/issue/report.js +1 -1
  78. package/lib/commands/logs/index.js +1 -1
  79. package/lib/commands/menu/index.js +1 -1
  80. package/lib/commands/menu/shared/compare-table.js +1 -1
  81. package/lib/commands/menu/shared/index.js +1 -1
  82. package/lib/commands/menu/shared/inquirer.js +1 -1
  83. package/lib/commands/menu/shared/local-pages.js +1 -1
  84. package/lib/commands/menu/shared/logic.js +1 -1
  85. package/lib/commands/menu/shared/service.js +1 -1
  86. package/lib/commands/menu/shared/sync-core.js +1 -1
  87. package/lib/commands/menu/shared/update-core.js +1 -1
  88. package/lib/commands/menu/shared/valid-url.js +1 -1
  89. package/lib/commands/menu/sync.js +1 -1
  90. package/lib/commands/menu/update.js +1 -1
  91. package/lib/commands/page/generate-start.js +1 -1
  92. package/lib/commands/page/generate-status.js +1 -1
  93. package/lib/commands/page/index.js +1 -1
  94. package/lib/commands/page/pull.js +1 -1
  95. package/lib/commands/page/push.js +1 -1
  96. package/lib/commands/page/shared.js +1 -1
  97. package/lib/commands/page/standard-page-status.js +1 -1
  98. package/lib/commands/page/sync.js +1 -1
  99. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  100. package/lib/commands/project/create/format-elapsed.js +1 -1
  101. package/lib/commands/project/create/main.js +1 -1
  102. package/lib/commands/project/create/non-interactive.js +1 -1
  103. package/lib/commands/project/create/project-template-path.js +1 -1
  104. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  105. package/lib/commands/project/create/use-format-code.js +1 -1
  106. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  107. package/lib/commands/project/index.js +1 -1
  108. package/lib/commands/project/init.js +1 -1
  109. package/lib/commands/project/upgrade.js +1 -1
  110. package/lib/commands/registry.js +1 -1
  111. package/lib/commands/run/index.js +1 -1
  112. package/lib/commands/schema.js +1 -1
  113. package/lib/commands/skill/index.js +1 -1
  114. package/lib/commands/sql/create.js +1 -1
  115. package/lib/commands/sql/delete.js +1 -1
  116. package/lib/commands/sql/detail.js +1 -1
  117. package/lib/commands/sql/exec.js +1 -1
  118. package/lib/commands/sql/index.js +1 -1
  119. package/lib/commands/sql/list.js +1 -1
  120. package/lib/commands/sql/pull.js +1 -1
  121. package/lib/commands/sql/push.js +1 -1
  122. package/lib/commands/sql/save.js +1 -1
  123. package/lib/commands/sql/shared.js +1 -1
  124. package/lib/commands/sql/status.js +1 -1
  125. package/lib/commands/sql/validate.js +1 -1
  126. package/lib/config/schema.js +1 -1
  127. package/lib/constant/cdn.js +1 -1
  128. package/lib/constant/cli.js +1 -1
  129. package/lib/constant/defaults.js +1 -1
  130. package/lib/constant/domain.js +1 -1
  131. package/lib/constant/env.js +1 -1
  132. package/lib/constant/output.js +1 -1
  133. package/lib/constant/paths.js +1 -1
  134. package/lib/constant/risk.js +1 -1
  135. package/lib/context.js +1 -1
  136. package/lib/core/alias-resolver.js +1 -1
  137. package/lib/core/api-client.js +1 -1
  138. package/lib/core/bff/config.js +1 -1
  139. package/lib/core/bff/file-system.js +1 -1
  140. package/lib/core/bff/hash.js +1 -1
  141. package/lib/core/bff/lock.js +1 -1
  142. package/lib/core/bff/utils.js +1 -1
  143. package/lib/core/db-resolver.js +1 -1
  144. package/lib/core/page/file-system.js +1 -1
  145. package/lib/core/page/hash.js +1 -1
  146. package/lib/core/page/lock.js +1 -1
  147. package/lib/core/sql-sync/config.js +1 -1
  148. package/lib/core/sql-sync/file-system.js +1 -1
  149. package/lib/core/sql-sync/hash.js +1 -1
  150. package/lib/core/sql-sync/lock.js +1 -1
  151. package/lib/core/sql-sync/utils.js +1 -1
  152. package/lib/core/sql-validator.js +1 -1
  153. package/lib/errors.js +1 -1
  154. package/lib/framework/build-all-flags.js +1 -1
  155. package/lib/framework/flags.js +1 -1
  156. package/lib/framework/help.js +1 -1
  157. package/lib/framework/index.js +1 -1
  158. package/lib/framework/output.js +1 -1
  159. package/lib/framework/response.js +1 -1
  160. package/lib/framework/runner-alias.js +1 -1
  161. package/lib/framework/runner.js +1 -1
  162. package/lib/framework/schema-export.js +1 -1
  163. package/lib/framework/types.js +1 -1
  164. package/lib/generated/build-info.js +1 -1
  165. package/lib/help.js +1 -1
  166. package/lib/skills/main.js +1 -1
  167. package/lib/skills/npx-skills-add.js +1 -1
  168. package/lib/telemetry/cli-command-trace.js +1 -1
  169. package/lib/telemetry/cli-help-trace.js +1 -1
  170. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  171. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  172. package/lib/telemetry/send-cli-trace-log.js +1 -1
  173. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  174. package/lib/utils/ai_config.js +1 -1
  175. package/lib/utils/apply-jq-filter.js +1 -1
  176. package/lib/utils/cdn-config.js +1 -1
  177. package/lib/utils/check-sdk-version.js +1 -1
  178. package/lib/utils/cli-version-check.js +1 -1
  179. package/lib/utils/cli-version-policy.js +1 -1
  180. package/lib/utils/config.js +1 -1
  181. package/lib/utils/copy-directory.js +1 -1
  182. package/lib/utils/entity-with-id.js +1 -1
  183. package/lib/utils/file-utils.js +1 -1
  184. package/lib/utils/guides-cdn.js +1 -1
  185. package/lib/utils/http-client.js +1 -1
  186. package/lib/utils/is-non-interactive.js +1 -1
  187. package/lib/utils/logger.js +1 -1
  188. package/lib/utils/params.js +1 -1
  189. package/lib/utils/platform.js +1 -1
  190. package/lib/utils/rules-cdn.js +1 -1
  191. package/lib/utils/sleep.js +1 -1
  192. package/lib/utils/template-replacer.js +1 -1
  193. package/lib/utils/version.js +1 -1
  194. package/lib/utils/with-active-cookie.js +1 -1
  195. package/lib/utils/write-cli-side-channel.js +1 -1
  196. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x44cfbc,_0x5e4963){const _0x3b6c71=a136_0x4500,_0x7415f=_0x44cfbc();while(!![]){try{const _0x1417db=parseInt(_0x3b6c71(0x1f8))/0x1+parseInt(_0x3b6c71(0x1f9))/0x2+parseInt(_0x3b6c71(0x1f1))/0x3+-parseInt(_0x3b6c71(0x1f7))/0x4+-parseInt(_0x3b6c71(0x1ec))/0x5*(parseInt(_0x3b6c71(0x1eb))/0x6)+parseInt(_0x3b6c71(0x1f3))/0x7+-parseInt(_0x3b6c71(0x1f4))/0x8*(parseInt(_0x3b6c71(0x1fa))/0x9);if(_0x1417db===_0x5e4963)break;else _0x7415f['push'](_0x7415f['shift']());}catch(_0xdd0a1a){_0x7415f['push'](_0x7415f['shift']());}}}(a136_0x2878,0xd52da));function a136_0x4500(_0x229a92,_0x11eadd){_0x229a92=_0x229a92-0x1eb;const _0x28784d=a136_0x2878();let _0x450072=_0x28784d[_0x229a92];return _0x450072;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x51c5c0){const _0x180a62=a136_0x4500,_0x47717c=[],_0x1a207d=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x219aa4;while((_0x219aa4=_0x1a207d['exec'](_0x51c5c0))!==null){_0x47717c[_0x180a62(0x1f0)]({'datasetCode':_0x219aa4[0x1],'tableName':_0x219aa4[0x2],'name':_0x219aa4[0x3],'alias':_0x219aa4[0x4]});}return _0x47717c;}export function loadAliasMap(_0x3e11ed,_0x104ec0,_0xff61a4){const _0x2d3298=a136_0x4500,_0x54d335=_0xff61a4??resolve(process[_0x2d3298(0x1ed)](),_0x3e11ed,_0x2d3298(0x1ee));if(cache['has'](_0x54d335))return cache[_0x2d3298(0x1f5)](_0x54d335);if(!existsSync(_0x54d335))return cache[_0x2d3298(0x1ef)](_0x54d335,[]),[];try{const _0x259c17=readFileSync(_0x54d335,_0x2d3298(0x1f6)),_0x7b3683=parseApiFile(_0x259c17);return cache[_0x2d3298(0x1ef)](_0x54d335,_0x7b3683),_0x7b3683;}catch{return cache['set'](_0x54d335,[]),[];}}export function resolveAlias(_0x55da18,_0x3be3c0,_0x5eca60,_0x1b3a1d){const _0x20c5ee=a136_0x4500;if(!_0x3be3c0)return undefined;const _0x288da2=loadAliasMap(_0x55da18,_0x5eca60,_0x1b3a1d),_0x1840ad=_0x288da2[_0x20c5ee(0x1f2)](_0x141576=>_0x141576[_0x20c5ee(0x1fb)]===_0x3be3c0);return _0x1840ad?.['datasetCode'];}function a136_0x2878(){const _0x480527=['6552351NDvyVo','alias','256794iuqPrk','70QZgReb','cwd','api.ts','set','push','657525zTvEMJ','find','9504334wSnWsa','8SJusDK','get','utf-8','2196672hyIYGY','137760UrLCOG','2069748QAXvjp'];a136_0x2878=function(){return _0x480527;};return a136_0x2878();}export function listAliases(_0x160cdc,_0x1e488e,_0x13c979){return loadAliasMap(_0x160cdc,_0x1e488e,_0x13c979);}
1
+ function a136_0x4449(_0x4b9796,_0x13091b){_0x4b9796=_0x4b9796-0x8f;const _0x125a48=a136_0x125a();let _0x444966=_0x125a48[_0x4b9796];return _0x444966;}(function(_0x4edb11,_0x111d57){const _0x117abc=a136_0x4449,_0x55490c=_0x4edb11();while(!![]){try{const _0x31cef1=-parseInt(_0x117abc(0x9a))/0x1*(-parseInt(_0x117abc(0x90))/0x2)+parseInt(_0x117abc(0x9d))/0x3*(-parseInt(_0x117abc(0xa2))/0x4)+-parseInt(_0x117abc(0x99))/0x5+parseInt(_0x117abc(0x92))/0x6+parseInt(_0x117abc(0x9e))/0x7+-parseInt(_0x117abc(0x9f))/0x8*(parseInt(_0x117abc(0x94))/0x9)+-parseInt(_0x117abc(0x9b))/0xa*(parseInt(_0x117abc(0xa0))/0xb);if(_0x31cef1===_0x111d57)break;else _0x55490c['push'](_0x55490c['shift']());}catch(_0x357056){_0x55490c['push'](_0x55490c['shift']());}}}(a136_0x125a,0x99da0));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x3b1d85){const _0x5bf54=a136_0x4449,_0x5134ce=[],_0x1d14bc=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x29d4ad;while((_0x29d4ad=_0x1d14bc[_0x5bf54(0x91)](_0x3b1d85))!==null){_0x5134ce[_0x5bf54(0x95)]({'datasetCode':_0x29d4ad[0x1],'tableName':_0x29d4ad[0x2],'name':_0x29d4ad[0x3],'alias':_0x29d4ad[0x4]});}return _0x5134ce;}function a136_0x125a(){const _0x24f282=['1085348lGWVDy','exec','1670814ApTDZM','utf-8','18WdKPzz','push','alias','set','find','2023285BbMQPG','2GDLJtX','12530ABvJJl','cwd','579XMjTJn','5480580cuisPv','1088688GTHpyn','6303tutXUL','api.ts','2524ZSlOhR','has'];a136_0x125a=function(){return _0x24f282;};return a136_0x125a();}export function loadAliasMap(_0x2f44d2,_0x3e2e3e,_0x167ff0){const _0x436c01=a136_0x4449,_0x2dc77b=_0x167ff0??resolve(process[_0x436c01(0x9c)](),_0x2f44d2,_0x436c01(0xa1));if(cache[_0x436c01(0x8f)](_0x2dc77b))return cache['get'](_0x2dc77b);if(!existsSync(_0x2dc77b))return cache[_0x436c01(0x97)](_0x2dc77b,[]),[];try{const _0x5c65d4=readFileSync(_0x2dc77b,_0x436c01(0x93)),_0x4f8cd9=parseApiFile(_0x5c65d4);return cache[_0x436c01(0x97)](_0x2dc77b,_0x4f8cd9),_0x4f8cd9;}catch{return cache[_0x436c01(0x97)](_0x2dc77b,[]),[];}}export function resolveAlias(_0x9433c,_0x5bba0a,_0x48e11b,_0x243c0e){const _0x58613a=a136_0x4449;if(!_0x5bba0a)return undefined;const _0x1b47f7=loadAliasMap(_0x9433c,_0x48e11b,_0x243c0e),_0x24d0cc=_0x1b47f7[_0x58613a(0x98)](_0x45fd39=>_0x45fd39[_0x58613a(0x96)]===_0x5bba0a);return _0x24d0cc?.['datasetCode'];}export function listAliases(_0x575991,_0x5acae5,_0x168497){return loadAliasMap(_0x575991,_0x5acae5,_0x168497);}
@@ -1 +1 @@
1
- (function(_0x357a7e,_0x9504ee){const _0x55198f=a137_0x6022,_0xf145d8=_0x357a7e();while(!![]){try{const _0x2703b7=-parseInt(_0x55198f(0x160))/0x1*(-parseInt(_0x55198f(0x108))/0x2)+-parseInt(_0x55198f(0x155))/0x3*(parseInt(_0x55198f(0xf7))/0x4)+-parseInt(_0x55198f(0xee))/0x5+-parseInt(_0x55198f(0x15a))/0x6*(parseInt(_0x55198f(0x120))/0x7)+-parseInt(_0x55198f(0x162))/0x8+parseInt(_0x55198f(0xd9))/0x9+parseInt(_0x55198f(0x168))/0xa;if(_0x2703b7===_0x9504ee)break;else _0xf145d8['push'](_0xf145d8['shift']());}catch(_0x1a27e9){_0xf145d8['push'](_0xf145d8['shift']());}}}(a137_0x3a0e,0x569fc));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x516e82){_activeCookie=_0x516e82||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;async function apiRequest(_0x23a52e,_0x709612={}){const _0x3c3188=a137_0x6022,{method:method='GET',body:_0x9e825f,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x709612,_0x38b928=useRuntime?getRuntimeDomain():getApiDomain(),_0x1d6d54=_activeCookie||getCookie(),_0x4699a2=''+_0x38b928+_0x23a52e,_0x2c27e6=new AbortController(),_0x4bbaad=setTimeout(()=>_0x2c27e6['abort'](),timeout);try{const _0xb05de4=await fetch(_0x4699a2,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x1d6d54,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x9e825f?JSON[_0x3c3188(0xdb)](_0x9e825f):undefined,'signal':_0x2c27e6[_0x3c3188(0xed)]});let _0x5bb411;try{_0x5bb411=await _0xb05de4[_0x3c3188(0x142)]();}catch{throw CliErrors[_0x3c3188(0x149)](_0x3c3188(0xdc)+_0xb05de4[_0x3c3188(0xf1)]+')',_0xb05de4[_0x3c3188(0xf1)]>=0x190?_0x3c3188(0x154):undefined);}if(!_0xb05de4['ok']||_0x5bb411[_0x3c3188(0x134)]===![])throw CliErrors[_0x3c3188(0x149)](_0x5bb411['errorMsg']||_0x5bb411[_0x3c3188(0xfd)]||'API\x20error:\x20'+_0xb05de4['status'],_0x5bb411[_0x3c3188(0xdf)]?_0x3c3188(0x144)+_0x5bb411['errorCode']:undefined);return _0x5bb411;}catch(_0x50f8ef){if(_0x50f8ef instanceof Error&&_0x50f8ef[_0x3c3188(0x150)]===_0x3c3188(0x128))throw CliErrors[_0x3c3188(0x149)](_0x3c3188(0xde)+_0x4699a2);throw _0x50f8ef;}finally{clearTimeout(_0x4bbaad);}}function isAuthFailure(_0x43d80f){const _0x2be664=a137_0x6022,_0x18820f=_0x43d80f[_0x2be664(0x16a)]||_0x43d80f[_0x2be664(0xfd)]||_0x43d80f[_0x2be664(0x167)]?.['message']||_0x43d80f['errorMessage']||_0x43d80f[_0x2be664(0x121)]||'';return _0x43d80f[_0x2be664(0xdf)]==='UNAUTHORIZED'||_0x43d80f[_0x2be664(0xf0)]===0x191||_0x43d80f[_0x2be664(0xf0)]===_0x2be664(0xe0)||_0x18820f[_0x2be664(0x106)](_0x2be664(0xe0))||_0x18820f[_0x2be664(0x106)](_0x2be664(0x172))||_0x18820f[_0x2be664(0x106)]('登录')||_0x18820f[_0x2be664(0x106)]('认证');}export async function platformFetch(_0x23d9ee,_0x3f0e50){const _0x54b810=a137_0x6022,_0x168f9b=await fetch(_0x23d9ee,{'method':_0x3f0e50['method']??_0x54b810(0x14a),'headers':{'Content-Type':_0x54b810(0x103),'Cookie':_0x3f0e50['cookie']},..._0x3f0e50[_0x54b810(0xfe)]&&{'body':JSON['stringify'](_0x3f0e50['body'])}});if(!_0x168f9b['ok']){if(_0x168f9b[_0x54b810(0xf1)]===0x191)throw CliErrors[_0x54b810(0x114)]();throw CliErrors['apiError'](_0x3f0e50[_0x54b810(0xfb)]+_0x54b810(0x102)+_0x168f9b[_0x54b810(0xf1)]);}const _0x3fe767=await _0x168f9b[_0x54b810(0x142)]();if(_0x3fe767[_0x54b810(0x134)]===![]){if(isAuthFailure(_0x3fe767))throw CliErrors[_0x54b810(0x114)]();throw CliErrors[_0x54b810(0x149)](_0x3fe767[_0x54b810(0x16a)]||_0x3fe767[_0x54b810(0xfd)]||_0x3f0e50[_0x54b810(0xfb)]+_0x54b810(0x130));}return _0x3fe767[_0x54b810(0x167)];}export async function listBffScripts(_0x1ca7d2,_0x5e2d0e,_0x581dae){const _0x5b6229=a137_0x6022;let _0x49b7b0=_0x5b6229(0xf9)+_0x1ca7d2;if(_0x5e2d0e)_0x49b7b0+='&type='+_0x5e2d0e;const _0x208575=await apiRequest(_0x49b7b0);let _0x1873a5=extractList(_0x208575['data']);if(_0x581dae?.[_0x5b6229(0x16e)]){const _0x3bae7b=_0x581dae[_0x5b6229(0x16e)]['toLowerCase']();_0x1873a5=_0x1873a5['filter'](_0x44234a=>_0x44234a[_0x5b6229(0x148)]?.[_0x5b6229(0xf3)]()[_0x5b6229(0x106)](_0x3bae7b)||_0x44234a[_0x5b6229(0x12f)]?.['toLowerCase']()[_0x5b6229(0x106)](_0x3bae7b));}return _0x1873a5;}export async function getBffScriptInfo(_0x54af54){const _0x228826=a137_0x6022,_0x37a30b=await apiRequest(_0x228826(0x16d)+_0x54af54);if(!_0x37a30b[_0x228826(0x167)])throw CliErrors[_0x228826(0x113)](_0x228826(0x125)+_0x54af54);return _0x37a30b['data'];}export async function saveBffScript(_0x4e553c){const _0x2fbb00=a137_0x6022,_0x81a737=await apiRequest(_0x2fbb00(0x11b),{'method':'POST','body':_0x4e553c}),{id:_0x32cd42,entity:_0x255528}=normalizeEntityWithIdResponse(_0x81a737[_0x2fbb00(0x167)]);if(_0x32cd42!==undefined){const _0x243284=typeof _0x255528['functionName']===_0x2fbb00(0xfa)||typeof _0x255528[_0x2fbb00(0x118)]===_0x2fbb00(0xfa)?_0x255528:undefined;return{'id':_0x32cd42,'script':_0x243284};}throw CliErrors['apiError'](_0x2fbb00(0x178));}export async function deleteBffScript(_0x4f47dd){const _0x43bf1d=a137_0x6022;await apiRequest(_0x43bf1d(0x13f),{'method':_0x43bf1d(0x12d),'body':{'id':_0x4f47dd}});}export async function getBffScriptStatistics(_0x29fdef){const _0x41f4df=a137_0x6022,_0xcbf81c=await apiRequest(_0x41f4df(0xda)+_0x29fdef);return extractList(_0xcbf81c[_0x41f4df(0x167)]);}function a137_0x6022(_0x4892e0,_0x589589){_0x4892e0=_0x4892e0-0xd6;const _0x3a0e83=a137_0x3a0e();let _0x602275=_0x3a0e83[_0x4892e0];return _0x602275;}export async function listBffDatasetOperations(_0x389b79,_0x4d57ab){const _0xcc747f=a137_0x6022,_0x3b5240=await apiRequest(_0xcc747f(0x10c),{'method':_0xcc747f(0x12d),'body':{'appCode':_0x389b79,'datasetId':_0x4d57ab}});return _0x3b5240[_0xcc747f(0x167)];}export async function listSqlQueries(_0x16c509,_0x5923d7){const _0x2e7496=a137_0x6022,_0x5131f6=await apiRequest(_0x2e7496(0x13b),{'method':'POST','body':{'appCode':_0x16c509,'currentPage':_0x5923d7?.[_0x2e7496(0xe6)]??0x1,'pageSize':_0x5923d7?.[_0x2e7496(0x13c)]??0x32,'sqlCode':_0x5923d7?.[_0x2e7496(0x112)],'sqlName':_0x5923d7?.['sqlName']}});return _0x5131f6[_0x2e7496(0x167)];}export async function getSqlQueryInfo(_0x59f100,_0x27988e){const _0x2d8dc3=a137_0x6022,_0x5cc826=await listSqlQueries(_0x59f100,{'sqlCode':_0x27988e}),_0x460021=_0x5cc826[_0x2d8dc3(0x15d)]?.[0x0];if(!_0x460021)throw CliErrors[_0x2d8dc3(0x113)]('SQL\x20query\x20not\x20found:\x20'+_0x27988e);return _0x460021;}export async function getSqlQueryDetail(_0xdce28b){const _0x27efba=a137_0x6022,_0x1f41e2=await apiRequest(_0x27efba(0x14d)+('?sqlCode='+encodeURIComponent(_0xdce28b)));if(!_0x1f41e2[_0x27efba(0x167)])throw CliErrors[_0x27efba(0x113)](_0x27efba(0xe3)+_0xdce28b);return _0x1f41e2[_0x27efba(0x167)];}export async function getSqlQueryDetailById(_0x14e0b2){const _0x4b6d94=a137_0x6022,_0x1851db=await apiRequest(_0x4b6d94(0xe8)+_0x14e0b2);if(!_0x1851db[_0x4b6d94(0x167)])throw CliErrors[_0x4b6d94(0x113)](_0x4b6d94(0x145)+_0x14e0b2);return _0x1851db['data'];}export async function createSqlQuery(_0x2e489b){const _0x25362b=a137_0x6022,_0x517f4f=await apiRequest(_0x25362b(0x14e),{'method':_0x25362b(0x12d),'body':_0x2e489b}),{id:_0x4720a9,entity:_0x356c6b}=normalizeEntityWithIdResponse(_0x517f4f[_0x25362b(0x167)]);if(!(_0x25362b(0x112)in _0x356c6b)&&_0x4720a9)return getSqlQueryDetailById(_0x4720a9);return normalizeSqlQueryEntity(_0x356c6b);}export async function updateSqlQuery(_0x2bd371){const _0x5adbe2=a137_0x6022,_0x64e0c3=await apiRequest(_0x5adbe2(0x14b),{'method':_0x5adbe2(0x12d),'body':_0x2bd371}),{id:_0x1886ed,entity:_0x2de264}=normalizeEntityWithIdResponse(_0x64e0c3['data']);if(!(_0x5adbe2(0x112)in _0x2de264)){if(_0x2bd371[_0x5adbe2(0x112)])return getSqlQueryDetail(_0x2bd371[_0x5adbe2(0x112)]);if(_0x1886ed)return getSqlQueryDetailById(_0x1886ed);}return normalizeSqlQueryEntity(_0x2de264);}export async function deleteSqlQuery(_0x3d246c){const _0x5b1934=a137_0x6022;await apiRequest(_0x5b1934(0x110),{'method':_0x5b1934(0x12d),'body':_0x3d246c});}export async function saveSqlQuery(_0x348175){const _0x4f14cf=a137_0x6022,_0x1f207a=await apiRequest(_0x4f14cf(0x12e),{'method':_0x4f14cf(0x12d),'body':_0x348175});return _0x1f207a['data'];}function normalizeSqlQueryEntity(_0x2d4c7b){const _0xe4a778=a137_0x6022;return{..._0x2d4c7b,'id':Number(_0x2d4c7b['id']),'dbId':_0x2d4c7b[_0xe4a778(0x153)]==null?undefined:Number(_0x2d4c7b[_0xe4a778(0x153)]),'version':_0x2d4c7b['version']==null?undefined:Number(_0x2d4c7b[_0xe4a778(0xec)])};}export async function executeSql(_0x358fae,_0x18eb0a,_0x4606dc){const _0x1554d4=a137_0x6022,_0x558ac8=await apiRequest(_0x1554d4(0x12c),{'method':_0x1554d4(0x12d),'body':{'appCode':_0x358fae,'sqlCode':_0x18eb0a,..._0x4606dc&&{'params':_0x4606dc}},'useRuntime':!![]});return _0x558ac8[_0x1554d4(0x167)];}export async function executeDatasetDataOperation(_0x4ac7e7,_0xe874a8,_0xac016b,_0x5471b6={}){const _0x2e7746=a137_0x6022;try{const _0x344b67=await apiRequest(_0x2e7746(0x11a)+_0x4ac7e7+'/'+_0xe874a8+'/'+_0xac016b,{'method':_0x2e7746(0x12d),'body':_0x5471b6,'useRuntime':!![]});return _0x344b67[_0x2e7746(0x167)];}catch(_0x3ffe2a){if(_0xac016b===_0x2e7746(0x15c)&&_0x3ffe2a instanceof CliError&&_0x3ffe2a[_0x2e7746(0xf0)]===_0x2e7746(0x16b)&&_0x5471b6['id']!==undefined&&_0x5471b6['id']!==null&&_0x5471b6['id']!==''){const _0x50d155=await apiRequest('/api/'+_0x4ac7e7+'/'+_0xe874a8+_0x2e7746(0x16f),{'method':_0x2e7746(0x12d),'body':{'where':{'id':{'$eq':_0x5471b6['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x39d99e=Array[_0x2e7746(0x14c)](_0x50d155[_0x2e7746(0x167)]?.[_0x2e7746(0x15d)])?_0x50d155[_0x2e7746(0x167)][_0x2e7746(0x15d)]:[];return _0x39d99e[0x0]??null;}throw _0x3ffe2a;}}export async function listDatasets(_0xadd62,_0xfc7f0d){const _0x4ec7bd=a137_0x6022,_0x53701c={'appCode':_0xadd62,'deleted':![]};if(_0xfc7f0d?.['code'])_0x53701c[_0x4ec7bd(0xf0)]=_0xfc7f0d['code'];if(_0xfc7f0d?.['name'])_0x53701c[_0x4ec7bd(0x150)]=_0xfc7f0d[_0x4ec7bd(0x150)];const _0x4d8bb8=await apiRequest(_0x4ec7bd(0x117),{'method':_0x4ec7bd(0x12d),'body':_0x53701c});return extractList(_0x4d8bb8[_0x4ec7bd(0x167)]);}export async function deleteDataset(_0x1a28b4,_0x248caa){const _0x55ea56=a137_0x6022;await apiRequest(_0x55ea56(0x115),{'method':_0x55ea56(0x12d),'body':{'appCode':_0x1a28b4,'datasetId':_0x248caa}});}export async function searchDatasets(_0xce36c1,_0x1a86c7){const _0x54f1ac=a137_0x6022,_0x5b3396=await listDatasets(_0xce36c1,{'name':_0x1a86c7}),_0x45bbc3=_0x1a86c7['toLowerCase'](),_0x2a17cd=new Set(_0x5b3396['map'](_0x53f89b=>_0x53f89b['id'])),_0x4bca8c=_0x5b3396[_0x54f1ac(0x12a)](_0x24f8d1=>_0x24f8d1[_0x54f1ac(0x124)]?.[_0x54f1ac(0xef)]?.[_0x54f1ac(0xf3)]()[_0x54f1ac(0x106)](_0x45bbc3)||_0x24f8d1['description']?.[_0x54f1ac(0xf3)]()['includes'](_0x45bbc3)),_0x3dbc1d=await listDatasets(_0xce36c1,{'code':_0x1a86c7});for(const _0x32c6b7 of _0x3dbc1d){!_0x2a17cd[_0x54f1ac(0x157)](_0x32c6b7['id'])&&(_0x5b3396[_0x54f1ac(0x14f)](_0x32c6b7),_0x2a17cd['add'](_0x32c6b7['id']));}return _0x5b3396;}export function normalizeDatasetOperations(_0x13ef89){const _0x5d884d=a137_0x6022;if(Array[_0x5d884d(0x14c)](_0x13ef89))return _0x13ef89['filter'](_0x4c2ff5=>_0x4c2ff5!=null&&typeof _0x4c2ff5==='object');if(_0x13ef89&&typeof _0x13ef89===_0x5d884d(0xe9))return Object['entries'](_0x13ef89)[_0x5d884d(0x12a)](([,_0x2ac5d3])=>_0x2ac5d3!=null&&typeof _0x2ac5d3==='object')[_0x5d884d(0x15e)](([_0x48d68f,_0x170810])=>({..._0x170810,'name':_0x170810[_0x5d884d(0x150)]??_0x170810[_0x5d884d(0x11f)]??_0x48d68f}));return[];}export async function getDatasetDetail(_0x28fc80){const _0x2bc62a=a137_0x6022,_0x26d8a9=/^\d+$/[_0x2bc62a(0xdd)](_0x28fc80)?'id':_0x2bc62a(0xf0),_0x1a9b8f=await apiRequest(_0x2bc62a(0x100)+_0x26d8a9+'='+_0x28fc80);return _0x1a9b8f[_0x2bc62a(0x167)];}export async function getDatasetOperations(_0x202e49){const _0x157daf=a137_0x6022,_0x3ea735=await getDatasetDetail(_0x202e49),_0x224c0f=normalizeDatasetOperations(_0x3ea735[_0x157daf(0xfc)])[_0x157daf(0x15e)](_0x241c7f=>({'name':_0x241c7f[_0x157daf(0x150)]||_0x241c7f[_0x157daf(0x11f)],'displayName':_0x241c7f[_0x157daf(0x13d)]||_0x241c7f[_0x157daf(0x150)],'type':_0x241c7f[_0x157daf(0x127)],'method':_0x241c7f[_0x157daf(0x123)],'path':_0x241c7f[_0x157daf(0x15f)],'enabled':_0x241c7f[_0x157daf(0x13e)]??!![],'requestFields':_0x241c7f[_0x157daf(0x166)],'responseFields':_0x241c7f[_0x157daf(0x171)]}));return{'dataset':{'id':_0x3ea735['id']??_0x3ea735[_0x157daf(0x139)],'name':_0x3ea735[_0x157daf(0x150)],'code':_0x3ea735[_0x157daf(0xf0)]||_0x3ea735[_0x157daf(0xe1)],'tableName':_0x3ea735[_0x157daf(0xef)]||_0x3ea735[_0x157daf(0x124)]?.[_0x157daf(0xef)]},'operations':_0x224c0f};}export async function getOperationDetail(_0x20680e,_0x2ae5fa,_0x1806ef){const _0x41a001=a137_0x6022;let _0x57affb=_0x2ae5fa;if(!/^\d+$/[_0x41a001(0xdd)](_0x2ae5fa)){const _0xcbe4e8=await listDatasets(_0x20680e,{'code':_0x2ae5fa}),_0x14ac3a=_0xcbe4e8[_0x41a001(0x133)](_0x5a7897=>_0x5a7897[_0x41a001(0xf0)]===_0x2ae5fa||String(_0x5a7897['id'])===_0x2ae5fa);if(!_0x14ac3a)throw CliErrors[_0x41a001(0x113)](_0x41a001(0x138)+_0x2ae5fa);_0x57affb=String(_0x14ac3a['id']);}const _0x23cc28=await getDatasetDetail(_0x57affb),_0x252e2e=normalizeDatasetOperations(_0x23cc28['operations'])['find'](_0x1c118d=>(_0x1c118d[_0x41a001(0x150)]||_0x1c118d['operationName'])===_0x1806ef);if(!_0x252e2e)throw CliErrors['validation']('Operation\x20\x22'+_0x1806ef+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x2ae5fa);return{'dataset':{'id':_0x23cc28['id']??_0x23cc28['modelId'],'name':_0x23cc28[_0x41a001(0x150)],'code':_0x23cc28[_0x41a001(0xf0)]||_0x23cc28[_0x41a001(0xe1)],'tableName':_0x23cc28[_0x41a001(0xef)]||_0x23cc28[_0x41a001(0x124)]?.['tableName']},'operation':_0x252e2e};}export async function startGenerateStandardPages(_0x2a01e7,_0x21b47b,_0x3251cf){const _0x1910db=a137_0x6022,_0x5a6a28=await apiRequest(_0x1910db(0x11c)+_0x21b47b+_0x1910db(0xf2),{'method':'POST','body':{'appCode':_0x2a01e7,..._0x3251cf?.[_0x1910db(0x107)]?{'clientOperationId':_0x3251cf['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5a6a28[_0x1910db(0x167)];}export async function getGenerateStandardPagesStatus(_0x35fe30,_0x5b86e9,_0x2810b9){const _0x352c52=a137_0x6022,_0x3d5476=new URLSearchParams({'appCode':_0x35fe30});_0x2810b9[_0x352c52(0x105)]&&_0x3d5476[_0x352c52(0xff)](_0x352c52(0x105),_0x2810b9[_0x352c52(0x105)]);_0x2810b9[_0x352c52(0x107)]&&_0x3d5476[_0x352c52(0xff)](_0x352c52(0x107),_0x2810b9['clientOperationId']);const _0x5ae8ee=await apiRequest(_0x352c52(0x11c)+_0x5b86e9+_0x352c52(0xd8)+_0x3d5476[_0x352c52(0x163)]());return _0x5ae8ee[_0x352c52(0x167)];}export async function getStandardPageStatus(_0x1fa287,_0xedc4e4){const _0x11b388=a137_0x6022,_0x51c449=await apiRequest(_0x11b388(0x11c)+_0xedc4e4+'/standard-page-status?appCode='+encodeURIComponent(_0x1fa287));return _0x51c449[_0x11b388(0x167)];}export async function tryGetStandardPageStatus(_0x2364cf,_0x159f52){const _0x27e6d9=a137_0x6022;try{return await getStandardPageStatus(_0x2364cf,_0x159f52);}catch(_0x2be3e1){if(_0x2be3e1 instanceof CliError&&_0x2be3e1[_0x27e6d9(0xf0)]===_0x27e6d9(0x16b)&&/404|not found|non-json response/i[_0x27e6d9(0xdd)](_0x2be3e1[_0x27e6d9(0xfd)]))return null;throw _0x2be3e1;}}export async function syncStandardPages(_0x3041fe,_0x5586fb){const _0x3382c1=a137_0x6022,_0x3b8036=await apiRequest(_0x3382c1(0x11c)+_0x5586fb+_0x3382c1(0x175),{'method':_0x3382c1(0x12d),'body':{'appCode':_0x3041fe}});return _0x3b8036['data'];}export async function getPageDetail(_0xe35d2f){const _0x1499e9=a137_0x6022,_0x52f1c0=await apiRequest(_0x1499e9(0x109)+_0xe35d2f);if(!_0x52f1c0['data'])throw CliErrors['validation'](_0x1499e9(0x173)+_0xe35d2f);return _0x52f1c0[_0x1499e9(0x167)];}export async function updatePage(_0x140c10,_0x436564,_0x5d4249,_0xaf06b7){const _0x40a73a=a137_0x6022,_0x122c1e=await apiRequest(_0x40a73a(0x165),{'method':_0x40a73a(0x12d),'body':{'appCode':_0x140c10,'pageId':_0x436564,'code':_0x5d4249,'datasetIds':_0xaf06b7}});return _0x122c1e[_0x40a73a(0x167)];}export function generateSdkCode(_0x5901ae,_0x3b64c0,_0x276de1){const _0x25aa68=a137_0x6022,_0xacb04e=_0x276de1?.['includeImports']??!![],_0x78ab7f=_0x25aa68(0x151)+_0x5901ae[_0x25aa68(0xf0)]?.[_0x25aa68(0x11d)](/-/g,'_'),_0x1e8c4d=_0x3b64c0[_0x25aa68(0x150)]||_0x3b64c0['operationName']||'filter',_0x40d06e=[];_0xacb04e&&_0x40d06e['push'](_0x25aa68(0x11e),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x40d06e['push'](_0x25aa68(0x15b)+_0x5901ae[_0x25aa68(0x150)]+'\x20('+(_0x5901ae['tableName']||_0x25aa68(0xe2))+')');if(_0x1e8c4d===_0x25aa68(0x12a))_0x40d06e['push'](_0x25aa68(0x169)+_0x78ab7f+_0x25aa68(0x119),_0x25aa68(0x158),_0x25aa68(0x136),_0x25aa68(0x156),_0x25aa68(0x10f));else{if(_0x1e8c4d===_0x25aa68(0x15c))_0x40d06e[_0x25aa68(0x14f)]('const\x20result\x20=\x20await\x20client.models.'+_0x78ab7f+_0x25aa68(0xf4));else{if(_0x1e8c4d===_0x25aa68(0xf8))_0x40d06e[_0x25aa68(0x14f)](_0x25aa68(0x169)+_0x78ab7f+_0x25aa68(0x137));else{if(_0x1e8c4d==='update')_0x40d06e['push'](_0x25aa68(0x169)+_0x78ab7f+_0x25aa68(0x116));else _0x1e8c4d===_0x25aa68(0x13a)||_0x1e8c4d===_0x25aa68(0x111)?_0x40d06e[_0x25aa68(0x14f)](_0x25aa68(0x169)+_0x78ab7f+_0x25aa68(0x140)):_0x40d06e[_0x25aa68(0x14f)](_0x25aa68(0x169)+_0x78ab7f+'.'+_0x1e8c4d+_0x25aa68(0x164));}}}return _0x40d06e[_0x25aa68(0xe5)]('\x0a');}function a137_0x3a0e(){const _0x3b0bbe=['/api/node-toolbox/sql/save','description','\x20failed','\x20\x20});','/smartapi/db-analysis/start','find','success','/smartapi/app/getList','\x20\x20pageSize:\x2020,','.create({\x20/*\x20fields\x20*/\x20});','Dataset\x20not\x20found:\x20','modelId','delete','/smartapi/custom/queryUserCustomSqlList','pageSize','displayName','enabled','/api/management/library/scripts/delete','.remove(id);','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','json','/smartapi/question/er-config/erDelete','API\x20error\x20code:\x20','SQL\x20query\x20not\x20found:\x20id=','sqlName','tableList','functionName','apiError','GET','/smartapi/custom/updateUserCustomSql','isArray','/smartapi/custom/getUserCustomSql','/smartapi/custom/saveUserCustomSql','push','name','dataset_','/smartapi/dblink/delete','dbId','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','1317RaYQIm','\x20\x20currentPage:\x201,','has','\x20\x20where:\x20{},','planId','402DvDYhO','//\x20','getOne','tableData','map','path','1CebslU','\x20apps.\x20','1341264RDeEzc','toString','(/*\x20params\x20*/);','/smartapi/lovrabet/update-page','requestFields','data','2397020QZYQiV','const\x20result\x20=\x20await\x20client.models.','errorMsg','api_error','const\x20results\x20=\x20data.execResult\x20||\x20[];','/api/management/library/scripts/info?id=','scriptName','/filter','Warning:\x20showing\x20first\x20','responseFields','Unauthorized','Page\x20not\x20found:\x20','length','/sync-to-pages','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20\x20return\x20rows;','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/db-analysis/jobs/cancel','/smartapi/dblink/create','/generate-standard-pages/status?','4084830uCBdfv','/api/management/library/scripts/statistics?appCode=','stringify','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','test','Request\x20timeout:\x20','errorCode','401','modelCode','table','SQL\x20query\x20not\x20found:\x20','/smartapi/dblink/getTableDiffV2ByPage','join','currentPage','totalCount','/smartapi/custom/getUserCustomSql?id=','object','target','/smartapi/dblink/getList','version','signal','158925qIAOKP','tableName','code','status','/generate-standard-pages/start','toLowerCase','.getOne(id);','pageIndex','/smartapi/dblink/testConnect','5444xlPefi','create','/api/management/library/scripts/list?appCode=','string','label','operations','message','body','set','/smartapi/dataset/get-driven-data?','\x20\x20\x20\x20sqlCode:\x20\x27','\x20failed,\x20HTTP\x20','application/json','includeImports','operationId','includes','clientOperationId','1021782pvokUF','/smartapi/lovrabet/detail?pageId=','/smartapi/question/er-config','sdk','/smartapi/dataset/get-dataset-operation','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','entries','});','/smartapi/custom/deleteUserCustomSql','remove','sqlCode','validation','authRequired','/smartapi/dataset/delete-dataset','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-list','scriptType','.filter({','/api/','/api/management/library/scripts/save','/smartapi/lovrabet/dataset/','replace','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','operationName','5509TkRhtQ','error','\x20of\x20','method','dbtableConfig','BFF\x20script\x20not\x20found:\x20id=','\x20\x20sqlCode:\x20\x27','type','AbortError','warn','filter','/smartapi/dblink/update','/api/custom/executeSql','POST'];a137_0x3a0e=function(){return _0x3b0bbe;};return a137_0x3a0e();}export function generateSqlCodeTemplate(_0x350df3,_0x473906){const _0x74746e=a137_0x6022,_0x20ad28=_0x473906?.[_0x74746e(0xea)]??_0x74746e(0x10b),_0x2dc689=_0x473906?.[_0x74746e(0x104)]??!![],_0x3ef4d9=[];return _0x3ef4d9[_0x74746e(0x14f)]('//\x20SQL:\x20'+_0x350df3[_0x74746e(0x146)]+'\x20('+_0x350df3['sqlCode']+')'),_0x20ad28===_0x74746e(0x10b)?(_0x2dc689&&_0x3ef4d9[_0x74746e(0x14f)](_0x74746e(0x11e),'',_0x74746e(0x176),''),_0x3ef4d9[_0x74746e(0x14f)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x74746e(0x126)+_0x350df3['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x74746e(0x10f),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x74746e(0x16c))):_0x3ef4d9[_0x74746e(0x14f)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x74746e(0x10d),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x74746e(0x101)+_0x350df3[_0x74746e(0x112)]+'\x27,',_0x74746e(0x141),_0x74746e(0x131),_0x74746e(0x177),'}'),_0x3ef4d9[_0x74746e(0xe5)]('\x0a');}export async function getErConfig(_0x3247e2,_0x334867){const _0x11f58e=a137_0x6022,_0x3196a5=await apiRequest(_0x11f58e(0x10a),{'method':_0x11f58e(0x12d),'body':{'appCode':_0x3247e2,'dblinkId':_0x334867}});return _0x3196a5[_0x11f58e(0x167)];}export async function createErRelation(_0x438ce5){const _0x742c24=a137_0x6022,_0x544fd2=await apiRequest('/smartapi/question/er-config/erCreate',{'method':_0x742c24(0x12d),'body':_0x438ce5});return _0x544fd2[_0x742c24(0x167)];}export async function updateErRelation(_0x5583a5){const _0x7492a9=a137_0x6022,_0x11a8f3=await apiRequest('/smartapi/question/er-config/update-single',{'method':_0x7492a9(0x12d),'body':_0x5583a5});return _0x11a8f3[_0x7492a9(0x167)];}export async function deleteErRelation(_0xb23036){const _0x15c7ae=a137_0x6022,_0x2d134d=await apiRequest(_0x15c7ae(0x143),{'method':_0x15c7ae(0x12d),'body':_0xb23036});return _0x2d134d[_0x15c7ae(0x167)];}function buildQuery(_0x1b3dbc){const _0x1fcca7=a137_0x6022,_0x230b02=new URLSearchParams();for(const [_0x1db652,_0x3af035]of Object[_0x1fcca7(0x10e)](_0x1b3dbc)){if(_0x3af035===undefined||_0x3af035==='')continue;_0x230b02[_0x1fcca7(0xff)](_0x1db652,String(_0x3af035));}const _0x49565b=_0x230b02[_0x1fcca7(0x163)]();return _0x49565b?'?'+_0x49565b:'';}export async function listDbLinks(_0x136bab,_0x5e48fd){const _0x541849=a137_0x6022,_0x45ef99=await apiRequest(_0x541849(0xeb),{'method':_0x541849(0x12d),'body':{'appCode':_0x136bab,'currentPage':_0x5e48fd?.['currentPage']??0x1,'pageSize':_0x5e48fd?.[_0x541849(0x13c)]??0x64}});return{'items':extractList(_0x45ef99['data']),'paging':extractPaging(_0x45ef99[_0x541849(0x167)])};}export async function getDbLinkInfo(_0x56e819){const _0x2f70d9=a137_0x6022,_0x324683=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x56e819}));return _0x324683[_0x2f70d9(0x167)];}export async function createDbLink(_0xfb3539){const _0xec22c6=a137_0x6022,_0x4f12d4=await apiRequest(_0xec22c6(0xd7),{'method':_0xec22c6(0x12d),'body':_0xfb3539});return _0x4f12d4[_0xec22c6(0x167)];}export async function updateDbLink(_0x405cc9){const _0x528049=a137_0x6022,_0x3a8374=await apiRequest(_0x528049(0x12b),{'method':'POST','body':_0x405cc9});return _0x3a8374[_0x528049(0x167)];}export async function deleteDbLink(_0x22a906){const _0x358589=a137_0x6022;await apiRequest(_0x358589(0x152),{'method':_0x358589(0x12d),'body':{'id':_0x22a906}});}export async function testDbLinkConnect(_0x4e518f){const _0x4bff06=a137_0x6022,_0x279857=await apiRequest(_0x4bff06(0xf6)+buildQuery({'id':_0x4e518f}));return _0x279857[_0x4bff06(0x167)];}export async function startDbAnalysis(_0x3aae79,_0x1ba7bf){const _0x563c9b=a137_0x6022,_0x3e3a3e=await apiRequest(_0x563c9b(0x132),{'method':_0x563c9b(0x12d),'body':{'dbLinkId':_0x3aae79,..._0x1ba7bf&&_0x1ba7bf[_0x563c9b(0x174)]>0x0?{'tableNames':_0x1ba7bf}:{}}}),_0x40cba4=_0x3e3a3e[_0x563c9b(0x167)];if(typeof _0x40cba4===_0x563c9b(0xfa))return _0x40cba4;if(_0x40cba4&&typeof _0x40cba4===_0x563c9b(0xe9)&&typeof _0x40cba4[_0x563c9b(0x159)]===_0x563c9b(0xfa))return _0x40cba4[_0x563c9b(0x159)];return _0x40cba4!=null?String(_0x40cba4):'';}export async function cancelDbAnalysis(_0x27389f){const _0x354c4a=a137_0x6022;await apiRequest(_0x354c4a(0xd6)+buildQuery({'planId':_0x27389f}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x1542a7){const _0x31f1f4=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x1542a7));return _0x31f1f4['data'];}export async function getDbAllTableList(_0x17e459,_0x2e48ac){const _0x1fa496=a137_0x6022,_0x2b9845=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x17e459,'dbLinkId':_0x2e48ac})),_0x1057a9=_0x2b9845[_0x1fa496(0x167)];if(Array['isArray'](_0x1057a9))return _0x1057a9;return extractList(_0x1057a9);}export async function getDbTableDiff(_0x2beb22,_0x32102f,_0x19d3d8){const _0xd26bab=a137_0x6022,_0x2ee860=await apiRequest(_0xd26bab(0xe4)+buildQuery({'appCode':_0x2beb22,'dbLinkId':_0x32102f,'pageIndex':_0x19d3d8?.[_0xd26bab(0xf5)]??0x1,'pageSize':_0x19d3d8?.[_0xd26bab(0x13c)]??0x14,'tableName':_0x19d3d8?.['tableName']})),_0x290cac=_0x2ee860['data'];return{'totalCount':_0x290cac?.[_0xd26bab(0xe7)]??0x0,'tableList':Array[_0xd26bab(0x14c)](_0x290cac?.[_0xd26bab(0x147)])?_0x290cac[_0xd26bab(0x147)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x5b587a=a137_0x6022,_0x4e0cf9=await apiRequest(_0x5b587a(0x135),{'method':_0x5b587a(0x12d),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x46c226=extractList(_0x4e0cf9[_0x5b587a(0x167)]),_0xa0cb6e=extractPaging(_0x4e0cf9[_0x5b587a(0x167)]);return _0xa0cb6e&&_0xa0cb6e['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x5b587a(0x129)](_0x5b587a(0x170)+REMOTE_APP_PAGE_SIZE+_0x5b587a(0x122)+_0xa0cb6e[_0x5b587a(0xe7)]+_0x5b587a(0x161)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x46c226;}
1
+ (function(_0x16cca8,_0x154af3){const _0x420d06=a137_0x1577,_0x53d5a7=_0x16cca8();while(!![]){try{const _0x300b84=parseInt(_0x420d06(0x132))/0x1+parseInt(_0x420d06(0xdb))/0x2*(-parseInt(_0x420d06(0x148))/0x3)+parseInt(_0x420d06(0x14b))/0x4+-parseInt(_0x420d06(0xef))/0x5+-parseInt(_0x420d06(0x115))/0x6+parseInt(_0x420d06(0x112))/0x7+-parseInt(_0x420d06(0xc0))/0x8*(-parseInt(_0x420d06(0x110))/0x9);if(_0x300b84===_0x154af3)break;else _0x53d5a7['push'](_0x53d5a7['shift']());}catch(_0x3452ce){_0x53d5a7['push'](_0x53d5a7['shift']());}}}(a137_0xfdec,0x4f264));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x5cce0d){_activeCookie=_0x5cce0d||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;async function apiRequest(_0x4f1ae1,_0x4dc36c={}){const _0x4bfbc2=a137_0x1577,{method:method=_0x4bfbc2(0x126),body:_0x3bb4be,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x4dc36c,_0x1df79d=useRuntime?getRuntimeDomain():getApiDomain(),_0x218b67=_activeCookie||getCookie(),_0x4ffe89=''+_0x1df79d+_0x4f1ae1,_0x214b9f=new AbortController(),_0x1cf1da=setTimeout(()=>_0x214b9f[_0x4bfbc2(0xe6)](),timeout);try{const _0x538afd=await fetch(_0x4ffe89,{'method':method,'headers':{'Content-Type':_0x4bfbc2(0xb7),'Cookie':_0x218b67,'X-Invoke-Source':_0x4bfbc2(0xf4),...headers},'body':_0x3bb4be?JSON[_0x4bfbc2(0x12d)](_0x3bb4be):undefined,'signal':_0x214b9f[_0x4bfbc2(0x117)]});let _0xed60a2;try{_0xed60a2=await _0x538afd[_0x4bfbc2(0xb5)]();}catch{throw CliErrors['apiError'](_0x4bfbc2(0xdf)+_0x538afd['status']+')',_0x538afd[_0x4bfbc2(0x134)]>=0x190?_0x4bfbc2(0xd9):undefined);}if(!_0x538afd['ok']||_0xed60a2[_0x4bfbc2(0x12e)]===![])throw CliErrors['apiError'](_0xed60a2[_0x4bfbc2(0xec)]||_0xed60a2[_0x4bfbc2(0xe8)]||_0x4bfbc2(0x133)+_0x538afd[_0x4bfbc2(0x134)],_0xed60a2[_0x4bfbc2(0xcc)]?'API\x20error\x20code:\x20'+_0xed60a2['errorCode']:undefined);return _0xed60a2;}catch(_0x301178){if(_0x301178 instanceof Error&&_0x301178[_0x4bfbc2(0x138)]===_0x4bfbc2(0xce))throw CliErrors[_0x4bfbc2(0xfb)]('Request\x20timeout:\x20'+_0x4ffe89);throw _0x301178;}finally{clearTimeout(_0x1cf1da);}}function isAuthFailure(_0x1fc70c){const _0x33fb7b=a137_0x1577,_0x4545fb=_0x1fc70c[_0x33fb7b(0xec)]||_0x1fc70c['message']||_0x1fc70c['data']?.[_0x33fb7b(0xe8)]||_0x1fc70c[_0x33fb7b(0xc3)]||_0x1fc70c['error']||'';return _0x1fc70c[_0x33fb7b(0xcc)]===_0x33fb7b(0xcb)||_0x1fc70c[_0x33fb7b(0xf9)]===0x191||_0x1fc70c[_0x33fb7b(0xf9)]===_0x33fb7b(0xb9)||_0x4545fb['includes'](_0x33fb7b(0xb9))||_0x4545fb[_0x33fb7b(0x12c)]('Unauthorized')||_0x4545fb[_0x33fb7b(0x12c)]('登录')||_0x4545fb['includes']('认证');}export async function platformFetch(_0x24d9e3,_0xa695f9){const _0x2bf515=a137_0x1577,_0x389e3b=await fetch(_0x24d9e3,{'method':_0xa695f9[_0x2bf515(0x11f)]??_0x2bf515(0x126),'headers':{'Content-Type':_0x2bf515(0xb7),'Cookie':_0xa695f9[_0x2bf515(0x124)]},..._0xa695f9[_0x2bf515(0xf1)]&&{'body':JSON[_0x2bf515(0x12d)](_0xa695f9[_0x2bf515(0xf1)])}});if(!_0x389e3b['ok']){if(_0x389e3b['status']===0x191)throw CliErrors['authRequired']();throw CliErrors['apiError'](_0xa695f9['label']+_0x2bf515(0xca)+_0x389e3b['status']);}const _0xce6fc6=await _0x389e3b[_0x2bf515(0xb5)]();if(_0xce6fc6[_0x2bf515(0x12e)]===![]){if(isAuthFailure(_0xce6fc6))throw CliErrors[_0x2bf515(0xc4)]();throw CliErrors[_0x2bf515(0xfb)](_0xce6fc6['errorMsg']||_0xce6fc6['message']||_0xa695f9['label']+_0x2bf515(0xb3));}return _0xce6fc6[_0x2bf515(0x13b)];}export async function listBffScripts(_0xe640f,_0x236a5d,_0x1215f4){const _0x17ae98=a137_0x1577;let _0x530026='/api/management/library/scripts/list?appCode='+_0xe640f;if(_0x236a5d)_0x530026+=_0x17ae98(0xe9)+_0x236a5d;const _0xe9798f=await apiRequest(_0x530026);let _0x3dd186=extractList(_0xe9798f[_0x17ae98(0x13b)]);if(_0x1215f4?.[_0x17ae98(0xfc)]){const _0x58038c=_0x1215f4[_0x17ae98(0xfc)]['toLowerCase']();_0x3dd186=_0x3dd186[_0x17ae98(0x14a)](_0x3f256a=>_0x3f256a[_0x17ae98(0x11a)]?.[_0x17ae98(0xd4)]()[_0x17ae98(0x12c)](_0x58038c)||_0x3f256a[_0x17ae98(0x105)]?.[_0x17ae98(0xd4)]()['includes'](_0x58038c));}return _0x3dd186;}export async function getBffScriptInfo(_0x242e7a){const _0x53db60=a137_0x1577,_0x17c2ed=await apiRequest(_0x53db60(0x102)+_0x242e7a);if(!_0x17c2ed[_0x53db60(0x13b)])throw CliErrors['validation'](_0x53db60(0xe2)+_0x242e7a);return _0x17c2ed[_0x53db60(0x13b)];}function a137_0xfdec(){const _0x52dab5=['operationName','dataset_','includes','stringify','success','target','/smartapi/custom/saveUserCustomSql','/api/management/library/scripts/statistics?appCode=','472406uMyYxG','API\x20error:\x20','status','/smartapi/dblink/getTableDiffV2ByPage','update','/smartapi/db-analysis/start','name','has','Page\x20not\x20found:\x20','data','\x20apps.\x20','totalCount','Warning:\x20showing\x20first\x20','replace','set','/smartapi/custom/queryUserCustomSqlList','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20\x20\x20\x20sqlCode:\x20\x27','dbtableConfig','tableList','/smartapi/dblink/getAllTableList','/smartapi/db-analysis/status/','972wYKbpl','.filter({','filter','1940064xABtSA','sqlName','/smartapi/dblink/getOne','/smartapi/custom/getUserCustomSql','\x20failed','entries','json','test','application/json','enabled','401','pageSize','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','/generate-standard-pages/status?','includeImports','Dataset\x20not\x20found:\x20','/smartapi/question/er-config/erCreate','22888ICPNbu','SQL\x20query\x20not\x20found:\x20','/api/node-toolbox/sql/save','errorMessage','authRequired','\x20\x20return\x20rows;','operations','dbId','\x20\x20pageSize:\x2020,','(/*\x20params\x20*/);','\x20failed,\x20HTTP\x20','UNAUTHORIZED','errorCode','create','AbortError','find','modelCode','\x22\x20not\x20found\x20in\x20dataset\x20','/generate-standard-pages/start','/smartapi/dblink/testConnect','toLowerCase','/api/management/library/scripts/delete','/smartapi/db-analysis/jobs/cancel','?sqlCode=','sqlCode','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','map','1192iUEQGK','/smartapi/dataset/delete-dataset','/sync-to-pages','pageIndex','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','delete','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','BFF\x20script\x20not\x20found:\x20id=','\x20\x20});','currentPage','displayName','abort','type','message','&type=','string','/smartapi/dblink/delete','errorMsg','join','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','2389710dtWFET','const\x20result\x20=\x20await\x20client.models.','body','SQL\x20query\x20not\x20found:\x20id=','getOne','cli:rabetbase','planId','/smartapi/lovrabet/detail?pageId=','push','/standard-page-status?appCode=','code','tableName','apiError','scriptName','operationId','validation','/smartapi/dblink/update','\x20\x20where:\x20{},','.getOne(id);','/api/management/library/scripts/info?id=','requestFields','/smartapi/lovrabet/dataset/','description','const\x20data\x20=\x20await\x20client.sql.execute({','tableData','POST','clientOperationId','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','modelId','api_error','version','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/dblink/getList','1053kEccHZ','/smartapi/dblink/create','1851297ZdgBNL','});','object','3368328cuEZcP','/api/','signal','/smartapi/question/er-config/update-single','length','functionName','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/app/getList','isArray','/smartapi/question/er-config','method','const\x20results\x20=\x20data.execResult\x20||\x20[];','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','sdk','toString','cookie','/smartapi/custom/deleteUserCustomSql','GET','\x20\x20currentPage:\x201,','/filter','.create({\x20/*\x20fields\x20*/\x20});'];a137_0xfdec=function(){return _0x52dab5;};return a137_0xfdec();}export async function saveBffScript(_0x49241a){const _0x11ccda=a137_0x1577,_0x10732=await apiRequest('/api/management/library/scripts/save',{'method':_0x11ccda(0x108),'body':_0x49241a}),{id:_0x3b9be4,entity:_0x112225}=normalizeEntityWithIdResponse(_0x10732[_0x11ccda(0x13b)]);if(_0x3b9be4!==undefined){const _0x1ed52d=typeof _0x112225['functionName']==='string'||typeof _0x112225['scriptType']===_0x11ccda(0xea)?_0x112225:undefined;return{'id':_0x3b9be4,'script':_0x1ed52d};}throw CliErrors[_0x11ccda(0xfb)](_0x11ccda(0x142));}export async function deleteBffScript(_0x29b501){const _0x5a4897=a137_0x1577;await apiRequest(_0x5a4897(0xd5),{'method':_0x5a4897(0x108),'body':{'id':_0x29b501}});}export async function getBffScriptStatistics(_0x6240db){const _0x4ac5bf=a137_0x1577,_0x867a6a=await apiRequest(_0x4ac5bf(0x131)+_0x6240db);return extractList(_0x867a6a[_0x4ac5bf(0x13b)]);}export async function listBffDatasetOperations(_0x9a2955,_0x34c548){const _0xca7c81=a137_0x1577,_0x5ce996=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0xca7c81(0x108),'body':{'appCode':_0x9a2955,'datasetId':_0x34c548}});return _0x5ce996[_0xca7c81(0x13b)];}export async function listSqlQueries(_0xc7d025,_0x35c34d){const _0x228138=a137_0x1577,_0x495f5e=await apiRequest(_0x228138(0x141),{'method':_0x228138(0x108),'body':{'appCode':_0xc7d025,'currentPage':_0x35c34d?.[_0x228138(0xe4)]??0x1,'pageSize':_0x35c34d?.[_0x228138(0xba)]??0x32,'sqlCode':_0x35c34d?.[_0x228138(0xd8)],'sqlName':_0x35c34d?.[_0x228138(0xb0)]}});return _0x495f5e[_0x228138(0x13b)];}export async function getSqlQueryInfo(_0x4069ca,_0xdb0c91){const _0x1f0a34=a137_0x1577,_0x46b92f=await listSqlQueries(_0x4069ca,{'sqlCode':_0xdb0c91}),_0x30c002=_0x46b92f[_0x1f0a34(0x107)]?.[0x0];if(!_0x30c002)throw CliErrors[_0x1f0a34(0xfe)](_0x1f0a34(0xc1)+_0xdb0c91);return _0x30c002;}export async function getSqlQueryDetail(_0x6e573e){const _0x27a684=a137_0x1577,_0x289896=await apiRequest(_0x27a684(0xb2)+(_0x27a684(0xd7)+encodeURIComponent(_0x6e573e)));if(!_0x289896['data'])throw CliErrors['validation'](_0x27a684(0xc1)+_0x6e573e);return _0x289896[_0x27a684(0x13b)];}export async function getSqlQueryDetailById(_0x4633f9){const _0x215e48=a137_0x1577,_0x2f1470=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x4633f9);if(!_0x2f1470[_0x215e48(0x13b)])throw CliErrors[_0x215e48(0xfe)](_0x215e48(0xf2)+_0x4633f9);return _0x2f1470[_0x215e48(0x13b)];}export async function createSqlQuery(_0x26dd53){const _0x278fdd=a137_0x1577,_0x85b8d7=await apiRequest(_0x278fdd(0x130),{'method':'POST','body':_0x26dd53}),{id:_0x3172d3,entity:_0x2b4147}=normalizeEntityWithIdResponse(_0x85b8d7[_0x278fdd(0x13b)]);if(!(_0x278fdd(0xd8)in _0x2b4147)&&_0x3172d3)return getSqlQueryDetailById(_0x3172d3);return normalizeSqlQueryEntity(_0x2b4147);}export async function updateSqlQuery(_0x4c68a9){const _0x1fb9aa=a137_0x1577,_0x22ae73=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':'POST','body':_0x4c68a9}),{id:_0x169f41,entity:_0x27e779}=normalizeEntityWithIdResponse(_0x22ae73['data']);if(!(_0x1fb9aa(0xd8)in _0x27e779)){if(_0x4c68a9['sqlCode'])return getSqlQueryDetail(_0x4c68a9['sqlCode']);if(_0x169f41)return getSqlQueryDetailById(_0x169f41);}return normalizeSqlQueryEntity(_0x27e779);}export async function deleteSqlQuery(_0x3c53ec){const _0x10f487=a137_0x1577;await apiRequest(_0x10f487(0x125),{'method':_0x10f487(0x108),'body':_0x3c53ec});}export async function saveSqlQuery(_0x569e63){const _0x38b57f=a137_0x1577,_0x36cdda=await apiRequest(_0x38b57f(0xc2),{'method':'POST','body':_0x569e63});return _0x36cdda['data'];}function normalizeSqlQueryEntity(_0x1b0c34){const _0x20c28e=a137_0x1577;return{..._0x1b0c34,'id':Number(_0x1b0c34['id']),'dbId':_0x1b0c34[_0x20c28e(0xc7)]==null?undefined:Number(_0x1b0c34['dbId']),'version':_0x1b0c34[_0x20c28e(0x10d)]==null?undefined:Number(_0x1b0c34['version'])};}export async function executeSql(_0x288b93,_0x3cbe92,_0x8deb35){const _0x19addf=a137_0x1577,_0x10c877=await apiRequest('/api/custom/executeSql',{'method':_0x19addf(0x108),'body':{'appCode':_0x288b93,'sqlCode':_0x3cbe92,..._0x8deb35&&{'params':_0x8deb35}},'useRuntime':!![]});return _0x10c877['data'];}export async function executeDatasetDataOperation(_0x979076,_0xb70fb7,_0x16f09b,_0x4414fd={}){const _0x36a983=a137_0x1577;try{const _0x3125db=await apiRequest(_0x36a983(0x116)+_0x979076+'/'+_0xb70fb7+'/'+_0x16f09b,{'method':_0x36a983(0x108),'body':_0x4414fd,'useRuntime':!![]});return _0x3125db[_0x36a983(0x13b)];}catch(_0x1cdeb2){if(_0x16f09b===_0x36a983(0xf3)&&_0x1cdeb2 instanceof CliError&&_0x1cdeb2[_0x36a983(0xf9)]===_0x36a983(0x10c)&&_0x4414fd['id']!==undefined&&_0x4414fd['id']!==null&&_0x4414fd['id']!==''){const _0xc09f6e=await apiRequest('/api/'+_0x979076+'/'+_0xb70fb7+_0x36a983(0x128),{'method':_0x36a983(0x108),'body':{'where':{'id':{'$eq':_0x4414fd['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x5e9823=Array[_0x36a983(0x11d)](_0xc09f6e['data']?.[_0x36a983(0x107)])?_0xc09f6e['data'][_0x36a983(0x107)]:[];return _0x5e9823[0x0]??null;}throw _0x1cdeb2;}}export async function listDatasets(_0x5bd442,_0x349a89){const _0x41a906=a137_0x1577,_0xd32dc4={'appCode':_0x5bd442,'deleted':![]};if(_0x349a89?.[_0x41a906(0xf9)])_0xd32dc4[_0x41a906(0xf9)]=_0x349a89[_0x41a906(0xf9)];if(_0x349a89?.[_0x41a906(0x138)])_0xd32dc4[_0x41a906(0x138)]=_0x349a89['name'];const _0x15fff4=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x41a906(0x108),'body':_0xd32dc4});return extractList(_0x15fff4[_0x41a906(0x13b)]);}export async function deleteDataset(_0x5a07bc,_0x3b2ad2){const _0x4208c4=a137_0x1577;await apiRequest(_0x4208c4(0xdc),{'method':_0x4208c4(0x108),'body':{'appCode':_0x5a07bc,'datasetId':_0x3b2ad2}});}export async function searchDatasets(_0x81b53d,_0x96c4d6){const _0x1ddbff=a137_0x1577,_0x52c11f=await listDatasets(_0x81b53d,{'name':_0x96c4d6}),_0xb4da88=_0x96c4d6[_0x1ddbff(0xd4)](),_0x2703d4=new Set(_0x52c11f[_0x1ddbff(0xda)](_0x1fd058=>_0x1fd058['id'])),_0x53d0d2=_0x52c11f[_0x1ddbff(0x14a)](_0x3d7b2c=>_0x3d7b2c['dbtableConfig']?.[_0x1ddbff(0xfa)]?.[_0x1ddbff(0xd4)]()[_0x1ddbff(0x12c)](_0xb4da88)||_0x3d7b2c[_0x1ddbff(0x105)]?.['toLowerCase']()[_0x1ddbff(0x12c)](_0xb4da88)),_0x4928bb=await listDatasets(_0x81b53d,{'code':_0x96c4d6});for(const _0x3d1491 of _0x4928bb){!_0x2703d4[_0x1ddbff(0x139)](_0x3d1491['id'])&&(_0x52c11f[_0x1ddbff(0xf7)](_0x3d1491),_0x2703d4['add'](_0x3d1491['id']));}return _0x52c11f;}export function normalizeDatasetOperations(_0x598c7b){const _0x20a04c=a137_0x1577;if(Array[_0x20a04c(0x11d)](_0x598c7b))return _0x598c7b[_0x20a04c(0x14a)](_0x2e21c2=>_0x2e21c2!=null&&typeof _0x2e21c2===_0x20a04c(0x114));if(_0x598c7b&&typeof _0x598c7b===_0x20a04c(0x114))return Object[_0x20a04c(0xb4)](_0x598c7b)['filter'](([,_0x5a3722])=>_0x5a3722!=null&&typeof _0x5a3722===_0x20a04c(0x114))[_0x20a04c(0xda)](([_0x14e054,_0x5bbd0e])=>({..._0x5bbd0e,'name':_0x5bbd0e[_0x20a04c(0x138)]??_0x5bbd0e[_0x20a04c(0x12a)]??_0x14e054}));return[];}export async function getDatasetDetail(_0x475d53){const _0x38f252=a137_0x1577,_0x2bcc9f=/^\d+$/[_0x38f252(0xb6)](_0x475d53)?'id':_0x38f252(0xf9),_0x64ad92=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x2bcc9f+'='+_0x475d53);return _0x64ad92[_0x38f252(0x13b)];}export async function getDatasetOperations(_0x1a0ec6){const _0x52ff2b=a137_0x1577,_0x4bd90d=await getDatasetDetail(_0x1a0ec6),_0x325e5f=normalizeDatasetOperations(_0x4bd90d[_0x52ff2b(0xc6)])[_0x52ff2b(0xda)](_0x2070b1=>({'name':_0x2070b1['name']||_0x2070b1['operationName'],'displayName':_0x2070b1[_0x52ff2b(0xe5)]||_0x2070b1[_0x52ff2b(0x138)],'type':_0x2070b1[_0x52ff2b(0xe7)],'method':_0x2070b1[_0x52ff2b(0x11f)],'path':_0x2070b1['path'],'enabled':_0x2070b1[_0x52ff2b(0xb8)]??!![],'requestFields':_0x2070b1[_0x52ff2b(0x103)],'responseFields':_0x2070b1['responseFields']}));return{'dataset':{'id':_0x4bd90d['id']??_0x4bd90d[_0x52ff2b(0x10b)],'name':_0x4bd90d[_0x52ff2b(0x138)],'code':_0x4bd90d[_0x52ff2b(0xf9)]||_0x4bd90d[_0x52ff2b(0xd0)],'tableName':_0x4bd90d[_0x52ff2b(0xfa)]||_0x4bd90d[_0x52ff2b(0x144)]?.[_0x52ff2b(0xfa)]},'operations':_0x325e5f};}export async function getOperationDetail(_0x3b3ff6,_0x581a78,_0x10e965){const _0x1c76df=a137_0x1577;let _0x3e4ac8=_0x581a78;if(!/^\d+$/[_0x1c76df(0xb6)](_0x581a78)){const _0x52cb5a=await listDatasets(_0x3b3ff6,{'code':_0x581a78}),_0x51d218=_0x52cb5a[_0x1c76df(0xcf)](_0x4f2d67=>_0x4f2d67[_0x1c76df(0xf9)]===_0x581a78||String(_0x4f2d67['id'])===_0x581a78);if(!_0x51d218)throw CliErrors[_0x1c76df(0xfe)](_0x1c76df(0xbe)+_0x581a78);_0x3e4ac8=String(_0x51d218['id']);}const _0x298e8b=await getDatasetDetail(_0x3e4ac8),_0x4b899c=normalizeDatasetOperations(_0x298e8b[_0x1c76df(0xc6)])['find'](_0x23127a=>(_0x23127a[_0x1c76df(0x138)]||_0x23127a[_0x1c76df(0x12a)])===_0x10e965);if(!_0x4b899c)throw CliErrors[_0x1c76df(0xfe)]('Operation\x20\x22'+_0x10e965+_0x1c76df(0xd1)+_0x581a78);return{'dataset':{'id':_0x298e8b['id']??_0x298e8b[_0x1c76df(0x10b)],'name':_0x298e8b[_0x1c76df(0x138)],'code':_0x298e8b[_0x1c76df(0xf9)]||_0x298e8b['modelCode'],'tableName':_0x298e8b['tableName']||_0x298e8b[_0x1c76df(0x144)]?.[_0x1c76df(0xfa)]},'operation':_0x4b899c};}export async function startGenerateStandardPages(_0x6e9ca,_0x2a69ef,_0x216d70){const _0x45e49e=a137_0x1577,_0x4ee7b9=await apiRequest(_0x45e49e(0x104)+_0x2a69ef+_0x45e49e(0xd2),{'method':'POST','body':{'appCode':_0x6e9ca,..._0x216d70?.[_0x45e49e(0x109)]?{'clientOperationId':_0x216d70[_0x45e49e(0x109)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4ee7b9[_0x45e49e(0x13b)];}function a137_0x1577(_0x52e8a8,_0xc9902f){_0x52e8a8=_0x52e8a8-0xb0;const _0xfdecf1=a137_0xfdec();let _0x1577a6=_0xfdecf1[_0x52e8a8];return _0x1577a6;}export async function getGenerateStandardPagesStatus(_0x565883,_0x40bb03,_0x55d7b2){const _0xe8cfd2=a137_0x1577,_0x161b08=new URLSearchParams({'appCode':_0x565883});_0x55d7b2['operationId']&&_0x161b08['set']('operationId',_0x55d7b2[_0xe8cfd2(0xfd)]);_0x55d7b2[_0xe8cfd2(0x109)]&&_0x161b08['set'](_0xe8cfd2(0x109),_0x55d7b2[_0xe8cfd2(0x109)]);const _0x5c25e8=await apiRequest(_0xe8cfd2(0x104)+_0x40bb03+_0xe8cfd2(0xbc)+_0x161b08[_0xe8cfd2(0x123)]());return _0x5c25e8[_0xe8cfd2(0x13b)];}export async function getStandardPageStatus(_0x269b28,_0x17e0e2){const _0x1959e8=a137_0x1577,_0x35471c=await apiRequest(_0x1959e8(0x104)+_0x17e0e2+_0x1959e8(0xf8)+encodeURIComponent(_0x269b28));return _0x35471c[_0x1959e8(0x13b)];}export async function tryGetStandardPageStatus(_0x29be24,_0x428cc7){const _0x557172=a137_0x1577;try{return await getStandardPageStatus(_0x29be24,_0x428cc7);}catch(_0x5bd861){if(_0x5bd861 instanceof CliError&&_0x5bd861[_0x557172(0xf9)]==='api_error'&&/404|not found|non-json response/i[_0x557172(0xb6)](_0x5bd861[_0x557172(0xe8)]))return null;throw _0x5bd861;}}export async function syncStandardPages(_0x59f5c6,_0x323390){const _0x2e30e3=a137_0x1577,_0x4ea023=await apiRequest(_0x2e30e3(0x104)+_0x323390+_0x2e30e3(0xdd),{'method':_0x2e30e3(0x108),'body':{'appCode':_0x59f5c6}});return _0x4ea023[_0x2e30e3(0x13b)];}export async function getPageDetail(_0x91738f){const _0x333e3b=a137_0x1577,_0x4a7621=await apiRequest(_0x333e3b(0xf6)+_0x91738f);if(!_0x4a7621['data'])throw CliErrors[_0x333e3b(0xfe)](_0x333e3b(0x13a)+_0x91738f);return _0x4a7621[_0x333e3b(0x13b)];}export async function updatePage(_0x2433dd,_0x468b72,_0x1a3416,_0x13d0d2){const _0x2d3518=await apiRequest('/smartapi/lovrabet/update-page',{'method':'POST','body':{'appCode':_0x2433dd,'pageId':_0x468b72,'code':_0x1a3416,'datasetIds':_0x13d0d2}});return _0x2d3518['data'];}export function generateSdkCode(_0xcf408f,_0x5f4487,_0xac30ee){const _0x154963=a137_0x1577,_0x54039e=_0xac30ee?.[_0x154963(0xbd)]??!![],_0x3c8740=_0x154963(0x12b)+_0xcf408f[_0x154963(0xf9)]?.[_0x154963(0x13f)](/-/g,'_'),_0x16749b=_0x5f4487[_0x154963(0x138)]||_0x5f4487[_0x154963(0x12a)]||_0x154963(0x14a),_0x409485=[];_0x54039e&&_0x409485['push'](_0x154963(0x10e),'',_0x154963(0x121),'');_0x409485['push']('//\x20'+_0xcf408f[_0x154963(0x138)]+'\x20('+(_0xcf408f[_0x154963(0xfa)]||'table')+')');if(_0x16749b===_0x154963(0x14a))_0x409485[_0x154963(0xf7)]('const\x20result\x20=\x20await\x20client.models.'+_0x3c8740+_0x154963(0x149),_0x154963(0x100),_0x154963(0xc8),_0x154963(0x127),'});');else{if(_0x16749b===_0x154963(0xf3))_0x409485[_0x154963(0xf7)](_0x154963(0xf0)+_0x3c8740+_0x154963(0x101));else{if(_0x16749b===_0x154963(0xcd))_0x409485[_0x154963(0xf7)](_0x154963(0xf0)+_0x3c8740+_0x154963(0x129));else{if(_0x16749b===_0x154963(0x136))_0x409485['push'](_0x154963(0xf0)+_0x3c8740+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x16749b===_0x154963(0xe0)||_0x16749b==='remove'?_0x409485['push'](_0x154963(0xf0)+_0x3c8740+'.remove(id);'):_0x409485[_0x154963(0xf7)]('const\x20result\x20=\x20await\x20client.models.'+_0x3c8740+'.'+_0x16749b+_0x154963(0xc9));}}}return _0x409485[_0x154963(0xed)]('\x0a');}export function generateSqlCodeTemplate(_0x3a018a,_0x587e11){const _0x303162=a137_0x1577,_0x245414=_0x587e11?.[_0x303162(0x12f)]??_0x303162(0x122),_0x29e573=_0x587e11?.[_0x303162(0xbd)]??!![],_0x52de03=[];return _0x52de03['push']('//\x20SQL:\x20'+_0x3a018a[_0x303162(0xb0)]+'\x20('+_0x3a018a[_0x303162(0xd8)]+')'),_0x245414==='sdk'?(_0x29e573&&_0x52de03[_0x303162(0xf7)](_0x303162(0x10e),'',_0x303162(0x121),''),_0x52de03[_0x303162(0xf7)](_0x303162(0x106),'\x20\x20sqlCode:\x20\x27'+_0x3a018a[_0x303162(0xd8)]+'\x27,',_0x303162(0x11b),_0x303162(0x113),_0x303162(0xbb),_0x303162(0x120))):_0x52de03[_0x303162(0xf7)](_0x303162(0xee),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x303162(0xe1),_0x303162(0x143)+_0x3a018a[_0x303162(0xd8)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x303162(0xe3),_0x303162(0xc5),'}'),_0x52de03[_0x303162(0xed)]('\x0a');}export async function getErConfig(_0x3310d6,_0xd209c0){const _0xc4c45d=a137_0x1577,_0x32fc0f=await apiRequest(_0xc4c45d(0x11e),{'method':_0xc4c45d(0x108),'body':{'appCode':_0x3310d6,'dblinkId':_0xd209c0}});return _0x32fc0f[_0xc4c45d(0x13b)];}export async function createErRelation(_0xacba52){const _0x31e46b=a137_0x1577,_0x3df5ba=await apiRequest(_0x31e46b(0xbf),{'method':_0x31e46b(0x108),'body':_0xacba52});return _0x3df5ba[_0x31e46b(0x13b)];}export async function updateErRelation(_0x9d1350){const _0x1800e8=a137_0x1577,_0x3f6c2b=await apiRequest(_0x1800e8(0x118),{'method':_0x1800e8(0x108),'body':_0x9d1350});return _0x3f6c2b[_0x1800e8(0x13b)];}export async function deleteErRelation(_0x55919b){const _0x27f102=a137_0x1577,_0x264ca3=await apiRequest('/smartapi/question/er-config/erDelete',{'method':_0x27f102(0x108),'body':_0x55919b});return _0x264ca3[_0x27f102(0x13b)];}function buildQuery(_0x5b732c){const _0x488677=a137_0x1577,_0x34acd7=new URLSearchParams();for(const [_0x1b5b0f,_0x1d2d50]of Object['entries'](_0x5b732c)){if(_0x1d2d50===undefined||_0x1d2d50==='')continue;_0x34acd7[_0x488677(0x140)](_0x1b5b0f,String(_0x1d2d50));}const _0x5f4d6d=_0x34acd7[_0x488677(0x123)]();return _0x5f4d6d?'?'+_0x5f4d6d:'';}export async function listDbLinks(_0x4cf6d6,_0x755960){const _0x306db8=a137_0x1577,_0x5115d2=await apiRequest(_0x306db8(0x10f),{'method':_0x306db8(0x108),'body':{'appCode':_0x4cf6d6,'currentPage':_0x755960?.[_0x306db8(0xe4)]??0x1,'pageSize':_0x755960?.[_0x306db8(0xba)]??0x64}});return{'items':extractList(_0x5115d2[_0x306db8(0x13b)]),'paging':extractPaging(_0x5115d2[_0x306db8(0x13b)])};}export async function getDbLinkInfo(_0x4ec769){const _0x49ffab=a137_0x1577,_0x220fc1=await apiRequest(_0x49ffab(0xb1)+buildQuery({'id':_0x4ec769}));return _0x220fc1[_0x49ffab(0x13b)];}export async function createDbLink(_0x3b2a6b){const _0x36da25=a137_0x1577,_0x3599ad=await apiRequest(_0x36da25(0x111),{'method':_0x36da25(0x108),'body':_0x3b2a6b});return _0x3599ad[_0x36da25(0x13b)];}export async function updateDbLink(_0x5adcdf){const _0x21416b=a137_0x1577,_0xcfef41=await apiRequest(_0x21416b(0xff),{'method':_0x21416b(0x108),'body':_0x5adcdf});return _0xcfef41[_0x21416b(0x13b)];}export async function deleteDbLink(_0x492744){const _0xfedbd6=a137_0x1577;await apiRequest(_0xfedbd6(0xeb),{'method':_0xfedbd6(0x108),'body':{'id':_0x492744}});}export async function testDbLinkConnect(_0x4bbb49){const _0x318c3e=a137_0x1577,_0x388793=await apiRequest(_0x318c3e(0xd3)+buildQuery({'id':_0x4bbb49}));return _0x388793['data'];}export async function startDbAnalysis(_0x3bac2c,_0x527041){const _0x31a67b=a137_0x1577,_0x2de363=await apiRequest(_0x31a67b(0x137),{'method':_0x31a67b(0x108),'body':{'dbLinkId':_0x3bac2c,..._0x527041&&_0x527041[_0x31a67b(0x119)]>0x0?{'tableNames':_0x527041}:{}}}),_0x3f2b8f=_0x2de363['data'];if(typeof _0x3f2b8f==='string')return _0x3f2b8f;if(_0x3f2b8f&&typeof _0x3f2b8f===_0x31a67b(0x114)&&typeof _0x3f2b8f[_0x31a67b(0xf5)]===_0x31a67b(0xea))return _0x3f2b8f[_0x31a67b(0xf5)];return _0x3f2b8f!=null?String(_0x3f2b8f):'';}export async function cancelDbAnalysis(_0x106804){const _0x217178=a137_0x1577;await apiRequest(_0x217178(0xd6)+buildQuery({'planId':_0x106804}),{'method':_0x217178(0x108)});}export async function getDbAnalysisStatus(_0x1e94f4){const _0x467edc=a137_0x1577,_0x2b5dbe=await apiRequest(_0x467edc(0x147)+encodeURIComponent(_0x1e94f4));return _0x2b5dbe[_0x467edc(0x13b)];}export async function getDbAllTableList(_0x4d1724,_0x5c752c){const _0x3b76dd=a137_0x1577,_0x3e2450=await apiRequest(_0x3b76dd(0x146)+buildQuery({'appCode':_0x4d1724,'dbLinkId':_0x5c752c})),_0x4eb370=_0x3e2450[_0x3b76dd(0x13b)];if(Array[_0x3b76dd(0x11d)](_0x4eb370))return _0x4eb370;return extractList(_0x4eb370);}export async function getDbTableDiff(_0x3434e3,_0x1d1ea8,_0x2faeb4){const _0x235409=a137_0x1577,_0x2594b7=await apiRequest(_0x235409(0x135)+buildQuery({'appCode':_0x3434e3,'dbLinkId':_0x1d1ea8,'pageIndex':_0x2faeb4?.[_0x235409(0xde)]??0x1,'pageSize':_0x2faeb4?.['pageSize']??0x14,'tableName':_0x2faeb4?.[_0x235409(0xfa)]})),_0x324e65=_0x2594b7[_0x235409(0x13b)];return{'totalCount':_0x324e65?.[_0x235409(0x13d)]??0x0,'tableList':Array[_0x235409(0x11d)](_0x324e65?.[_0x235409(0x145)])?_0x324e65[_0x235409(0x145)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x421773=a137_0x1577,_0x197fd3=await apiRequest(_0x421773(0x11c),{'method':_0x421773(0x108),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1435d5=extractList(_0x197fd3['data']),_0x49d86c=extractPaging(_0x197fd3[_0x421773(0x13b)]);return _0x49d86c&&_0x49d86c[_0x421773(0x13d)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x421773(0x13e)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x49d86c[_0x421773(0x13d)]+_0x421773(0x13c)+_0x421773(0x10a)),_0x1435d5;}
@@ -1 +1 @@
1
- function a138_0x560c(_0x25b39c,_0x1e7ca1){_0x25b39c=_0x25b39c-0xf3;const _0x4dee5c=a138_0x4dee();let _0x560c66=_0x4dee5c[_0x25b39c];return _0x560c66;}const a138_0x3cfa9f=a138_0x560c;(function(_0x3f5743,_0x3e63b1){const _0x46efa0=a138_0x560c,_0x49a48c=_0x3f5743();while(!![]){try{const _0x170a55=parseInt(_0x46efa0(0xf8))/0x1*(-parseInt(_0x46efa0(0xf6))/0x2)+-parseInt(_0x46efa0(0xf5))/0x3*(parseInt(_0x46efa0(0xfa))/0x4)+-parseInt(_0x46efa0(0xf7))/0x5*(-parseInt(_0x46efa0(0x100))/0x6)+-parseInt(_0x46efa0(0xfb))/0x7+-parseInt(_0x46efa0(0xfc))/0x8+-parseInt(_0x46efa0(0xfe))/0x9*(parseInt(_0x46efa0(0xf3))/0xa)+parseInt(_0x46efa0(0x102))/0xb*(parseInt(_0x46efa0(0xfd))/0xc);if(_0x170a55===_0x3e63b1)break;else _0x49a48c['push'](_0x49a48c['shift']());}catch(_0x448cea){_0x49a48c['push'](_0x49a48c['shift']());}}}(a138_0x4dee,0x7e8ff));import{resolve}from'node:path';function a138_0x4dee(){const _0x16fe62=['bff-trash','2901lslXnT','2NFSNDE','25SNglAG','241079yjLdOr','/bff','572jqMWOh','5768889WQhHWp','1381144VrrARI','144eQTmAo','27OZZUDF','.rabetbase','244356ydvAdn','bff','1744655NyrsLy','707870bUsbFy'];a138_0x4dee=function(){return _0x16fe62;};return a138_0x4dee();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a138_0x3cfa9f(0xff),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME=a138_0x3cfa9f(0xf4);export function loadBffProjectConfig(_0x44fd7f,_0x28a686){const _0x189fca=a138_0x3cfa9f,_0x3eb851=resolve(_0x28a686??findProjectRootDirectory()),_0x3db3ee=DOT_DIR+_0x189fca(0xf9),_0x5ddb0e=_0x3db3ee+'/'+_0x44fd7f;return{'projectRoot':_0x3eb851,'appCode':_0x44fd7f,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3db3ee,'scriptsRoot':_0x5ddb0e,'scriptsRootDir':resolve(_0x3eb851,DOT_DIR,_0x189fca(0x101),_0x44fd7f),'lockFilePath':resolve(_0x3eb851,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3eb851,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a138_0x1d47(){const _0x22372d=['2YvnHiu','109290onBIJx','.rabetbase','bff','3496nhNivu','4088544LpJkZr','bff-trash','200AYmYMk','5029375YkoOvN','5679qNSnhI','209949cjFiUz','119QZTBpQ','bff.lock.json','/bff','1190287PSkCqX','142934JzOEdi'];a138_0x1d47=function(){return _0x22372d;};return a138_0x1d47();}const a138_0xf2fccf=a138_0x13a4;(function(_0x15163b,_0x3a797f){const _0x5e8328=a138_0x13a4,_0x5bb02f=_0x15163b();while(!![]){try{const _0x1c29d=parseInt(_0x5e8328(0x1c4))/0x1*(parseInt(_0x5e8328(0x1b6))/0x2)+-parseInt(_0x5e8328(0x1c0))/0x3+-parseInt(_0x5e8328(0x1bb))/0x4+parseInt(_0x5e8328(0x1be))/0x5+parseInt(_0x5e8328(0x1b7))/0x6*(-parseInt(_0x5e8328(0x1c1))/0x7)+parseInt(_0x5e8328(0x1ba))/0x8*(-parseInt(_0x5e8328(0x1bf))/0x9)+parseInt(_0x5e8328(0x1bd))/0xa*(parseInt(_0x5e8328(0x1c5))/0xb);if(_0x1c29d===_0x3a797f)break;else _0x5bb02f['push'](_0x5bb02f['shift']());}catch(_0x4f8872){_0x5bb02f['push'](_0x5bb02f['shift']());}}}(a138_0x1d47,0xbe119));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a138_0xf2fccf(0x1b8),LOCK_FILE_NAME=a138_0xf2fccf(0x1c2),TRASH_DIR_NAME=a138_0xf2fccf(0x1bc);function a138_0x13a4(_0x58060e,_0x46aa2e){_0x58060e=_0x58060e-0x1b6;const _0x1d473b=a138_0x1d47();let _0x13a4c3=_0x1d473b[_0x58060e];return _0x13a4c3;}export function loadBffProjectConfig(_0x37aec7,_0x4e8c9b){const _0x522fc4=a138_0xf2fccf,_0x4e1e4d=resolve(_0x4e8c9b??findProjectRootDirectory()),_0x4ad860=DOT_DIR+_0x522fc4(0x1c3),_0x343e7e=_0x4ad860+'/'+_0x37aec7;return{'projectRoot':_0x4e1e4d,'appCode':_0x37aec7,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4ad860,'scriptsRoot':_0x343e7e,'scriptsRootDir':resolve(_0x4e1e4d,DOT_DIR,_0x522fc4(0x1b9),_0x37aec7),'lockFilePath':resolve(_0x4e1e4d,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4e1e4d,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a139_0x25a0ae=a139_0x917c;(function(_0x4eae3a,_0x5a467a){const _0x4c3c8c=a139_0x917c,_0x54f20f=_0x4eae3a();while(!![]){try{const _0x4b7952=parseInt(_0x4c3c8c(0x11b))/0x1*(-parseInt(_0x4c3c8c(0x123))/0x2)+-parseInt(_0x4c3c8c(0x140))/0x3*(-parseInt(_0x4c3c8c(0x134))/0x4)+parseInt(_0x4c3c8c(0x120))/0x5+parseInt(_0x4c3c8c(0x130))/0x6+-parseInt(_0x4c3c8c(0x131))/0x7*(-parseInt(_0x4c3c8c(0x129))/0x8)+-parseInt(_0x4c3c8c(0x119))/0x9*(parseInt(_0x4c3c8c(0x13a))/0xa)+-parseInt(_0x4c3c8c(0x11d))/0xb;if(_0x4b7952===_0x5a467a)break;else _0x54f20f['push'](_0x54f20f['shift']());}catch(_0x322680){_0x54f20f['push'](_0x54f20f['shift']());}}}(a139_0x1d6a,0xae295));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=[a139_0x25a0ae(0x11c),a139_0x25a0ae(0x128),a139_0x25a0ae(0x13c)];export function normalizeBffType(_0x1e8edb){const _0x2cfa08=a139_0x25a0ae;if(!_0x1e8edb)return undefined;const _0x5a2555=_0x1e8edb[_0x2cfa08(0x135)]()[_0x2cfa08(0x126)]();return SUPPORTED_BFF_TYPES[_0x2cfa08(0x12e)](_0x5a2555)?_0x5a2555:undefined;}async function scanJsFilesRecursively(_0x27cc71,_0xa35435){const _0x2b8f59=a139_0x25a0ae,_0x3d5ecf=[];try{const _0x1afde4=await readdir(_0x27cc71,{'withFileTypes':!![]});for(const _0xe2310f of _0x1afde4){const _0x4a9f46=join(_0x27cc71,_0xe2310f[_0x2b8f59(0x125)]);if(_0xe2310f[_0x2b8f59(0x137)]())_0x3d5ecf[_0x2b8f59(0x122)](...await scanJsFilesRecursively(_0x4a9f46,_0xa35435+'/'+_0xe2310f['name']));else _0xe2310f['isFile']()&&_0xe2310f[_0x2b8f59(0x125)][_0x2b8f59(0x12a)]('.js')&&_0x3d5ecf[_0x2b8f59(0x122)]({'lockKey':_0xa35435+'/'+_0xe2310f[_0x2b8f59(0x125)][_0x2b8f59(0x138)](/\.js$/,''),'filePath':_0x4a9f46});}}catch(_0x132bdb){if(_0x132bdb['code']!==_0x2b8f59(0x13f))throw _0x132bdb;}return _0x3d5ecf;}async function scanFlatFunctions(_0x23763e,_0x11b129){const _0x92f044=a139_0x25a0ae,_0x258519=join(_0x23763e[_0x92f044(0x11f)],_0x11b129),_0x410c0d=await scanJsFilesRecursively(_0x258519,_0x11b129);return _0x410c0d[_0x92f044(0x13b)](({lockKey:_0x41ac84,filePath:_0x14b731})=>({'type':_0x11b129,'name':_0x41ac84['split']('/')['at'](-0x1)??'','filePath':_0x14b731,'lockKey':_0x41ac84}));}function a139_0x917c(_0x5a87c2,_0x34466e){_0x5a87c2=_0x5a87c2-0x119;const _0x1d6a35=a139_0x1d6a();let _0x917c15=_0x1d6a35[_0x5a87c2];return _0x917c15;}async function scanHookFunctions(_0x2c0155){const _0x5f5b45=a139_0x25a0ae,_0x5c254a=join(_0x2c0155[_0x5f5b45(0x11f)],_0x5f5b45(0x13c)),_0xab600b=[];try{const _0x56ce16=await readdir(_0x5c254a,{'withFileTypes':!![]});for(const _0x54cd03 of _0x56ce16){if(!_0x54cd03[_0x5f5b45(0x137)]())continue;const _0x4a5547=_0x54cd03[_0x5f5b45(0x125)],_0x5308f8=join(_0x5c254a,_0x4a5547),_0x15b1fc=await readdir(_0x5308f8,{'withFileTypes':!![]});for(const _0x2e67c5 of _0x15b1fc){if(!_0x2e67c5[_0x5f5b45(0x137)]())continue;const _0x47431f=_0x2e67c5['name'],_0x6ec131=join(_0x5308f8,_0x47431f),_0x4003f1=await readdir(_0x6ec131,{'withFileTypes':!![]});for(const _0x5cc45c of _0x4003f1){if(!_0x5cc45c['isDirectory']())continue;const _0x4585f1=_0x5cc45c[_0x5f5b45(0x125)],_0x46d0da=join(_0x6ec131,_0x4585f1),_0x4fed73=await readdir(_0x46d0da,{'withFileTypes':!![]});for(const _0x28f943 of _0x4fed73){if(!_0x28f943['isFile']()||!_0x28f943[_0x5f5b45(0x125)][_0x5f5b45(0x12a)](_0x5f5b45(0x133)))continue;const _0x1d9090=_0x28f943['name'][_0x5f5b45(0x138)](/\.js$/,'');_0xab600b[_0x5f5b45(0x122)]({'type':_0x5f5b45(0x13c),'name':_0x1d9090,'filePath':join(_0x46d0da,_0x28f943[_0x5f5b45(0x125)]),'lockKey':'HOOK/'+_0x4a5547+'/'+_0x47431f+'/'+_0x4585f1+'/'+_0x1d9090,'alias':_0x4a5547,'operationType':_0x47431f,'functionNode':_0x4585f1});}}}}}catch(_0x2a1ae8){if(_0x2a1ae8[_0x5f5b45(0x11e)]!=='ENOENT')throw _0x2a1ae8;}return _0xab600b;}export async function scanLocalBffFunctions(_0x4e942d,_0x2386e0){const _0x1ff053=a139_0x25a0ae;if(_0x2386e0===_0x1ff053(0x11c)||_0x2386e0===_0x1ff053(0x128))return scanFlatFunctions(_0x4e942d,_0x2386e0);if(_0x2386e0===_0x1ff053(0x13c))return scanHookFunctions(_0x4e942d);const [_0x1dc29,_0x4fddc7,_0x1e7d85]=await Promise['all']([scanFlatFunctions(_0x4e942d,_0x1ff053(0x11c)),scanFlatFunctions(_0x4e942d,'ENDPOINT'),scanHookFunctions(_0x4e942d)]);return[..._0x1dc29,..._0x4fddc7,..._0x1e7d85];}export function resolveLocalFilePathFromLockKey(_0x15f2ab,_0x3a4081){const _0x12d662=a139_0x25a0ae;return join(_0x15f2ab[_0x12d662(0x11f)],..._0x3a4081['split']('/'))+_0x12d662(0x133);}export function createHookLocationMap(_0x27aec1){const _0x9fd414=a139_0x25a0ae,_0x4b25b7=new Map();for(const _0x597770 of _0x27aec1){_0x597770[_0x9fd414(0x12d)]&&_0x4b25b7['set'](_0x597770[_0x9fd414(0x12d)],{'datasetCode':_0x597770[_0x9fd414(0x127)],'operationType':snakeToCamel(_0x597770['operationType']),'functionNode':_0x9fd414(0x132)}),_0x597770[_0x9fd414(0x13d)]&&_0x4b25b7[_0x9fd414(0x11a)](_0x597770[_0x9fd414(0x13d)],{'datasetCode':_0x597770[_0x9fd414(0x127)],'operationType':snakeToCamel(_0x597770[_0x9fd414(0x12b)]),'functionNode':_0x9fd414(0x12f)});}return _0x4b25b7;}export function resolveRemoteScriptTarget(_0x8cf614,_0x222f29,_0x1d9b8c,_0x81ee50,_0x1c4545){const _0x48e2bc=a139_0x25a0ae,_0x3593c2=normalizeBffType(_0x222f29[_0x48e2bc(0x124)]);if(!_0x3593c2||!_0x222f29[_0x48e2bc(0x12c)])return null;if(_0x3593c2===_0x48e2bc(0x13c)){const _0x4b20fc=(_0x222f29['id']?_0x1d9b8c['get'](_0x222f29['id']):undefined)??findHookLocationByRemoteId(_0x81ee50,_0x222f29['id']);if(!_0x4b20fc)return null;const _0x4eb0c0=_0x4b20fc[_0x48e2bc(0x13e)]||_0x1c4545[_0x48e2bc(0x121)](_0x4b20fc[_0x48e2bc(0x127)]),_0x3518dc=_0x4eb0c0??_0x4b20fc['datasetCode'],_0x45eac3={..._0x4b20fc,'alias':_0x4eb0c0},_0x35e13c=_0x48e2bc(0x139)+_0x3518dc+'/'+_0x45eac3['operationType']+'/'+_0x45eac3['functionNode']+'/'+_0x222f29['functionName'];return{'lockKey':_0x35e13c,'filePath':resolveLocalFilePathFromLockKey(_0x8cf614,_0x35e13c),'type':_0x48e2bc(0x13c),'hookLocation':_0x45eac3};}const _0x1394d3=_0x3593c2+'/'+_0x222f29[_0x48e2bc(0x12c)];return{'lockKey':_0x1394d3,'filePath':resolveLocalFilePathFromLockKey(_0x8cf614,_0x1394d3),'type':_0x3593c2};}export async function ensureParentDirectory(_0x23b9e3){await mkdir(dirname(_0x23b9e3),{'recursive':!![]});}export async function fileExists(_0x451f9b){const _0x57028c=a139_0x25a0ae;try{return await access(_0x451f9b,constants[_0x57028c(0x136)]),!![];}catch{return![];}}function a139_0x1d6a(){const _0x359920=['datasetCode','ENDPOINT','8EFnSvg','endsWith','operationType','functionName','beforeScriptId','includes','after','1506150oreuHk','1047067tDMzcf','before','.js','31808RfEUXM','trim','F_OK','isDirectory','replace','HOOK/','10CShRER','map','HOOK','afterScriptId','alias','ENOENT','468RMTjDa','9897489ZLqhXp','set','1793Fumxcg','COMMON','3508780cLxQxL','code','scriptsRootDir','6345550kmTFMh','get','push','868fZvkBz','scriptType','name','toUpperCase'];a139_0x1d6a=function(){return _0x359920;};return a139_0x1d6a();}export async function directoryExists(_0x202b59){const _0x3e1ee0=a139_0x25a0ae;try{const _0x57e05f=await stat(_0x202b59);return _0x57e05f[_0x3e1ee0(0x137)]();}catch{return![];}}
1
+ function a139_0x3a1c(_0x4c954a,_0x33b886){_0x4c954a=_0x4c954a-0xda;const _0x2742ed=a139_0x2742();let _0x3a1ce6=_0x2742ed[_0x4c954a];return _0x3a1ce6;}const a139_0x5bec16=a139_0x3a1c;(function(_0x2473d6,_0x2c2a5b){const _0x169b22=a139_0x3a1c,_0x3d53cf=_0x2473d6();while(!![]){try{const _0x1bade1=parseInt(_0x169b22(0xdd))/0x1+parseInt(_0x169b22(0xe2))/0x2+-parseInt(_0x169b22(0xee))/0x3+parseInt(_0x169b22(0xe7))/0x4+-parseInt(_0x169b22(0xf2))/0x5+parseInt(_0x169b22(0xf5))/0x6+-parseInt(_0x169b22(0xe0))/0x7;if(_0x1bade1===_0x2c2a5b)break;else _0x3d53cf['push'](_0x3d53cf['shift']());}catch(_0x353ff3){_0x3d53cf['push'](_0x3d53cf['shift']());}}}(a139_0x2742,0xa7249));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';function a139_0x2742(){const _0xe6976e=['beforeScriptId','34205fMmtXf','HOOK','scriptType','9600822JdFfTe','before','2573124scYbCY','split','toUpperCase','HOOK/','endsWith','4447784xJqHde','name','isDirectory','operationType','get','functionName','all','3918288bFAWRf','ENOENT','map','replace','1741865GqcNIM','isFile','ENDPOINT','7667514zpNIwa','set','.js','afterScriptId','F_OK','scriptsRootDir','after','COMMON','datasetCode','push'];a139_0x2742=function(){return _0xe6976e;};return a139_0x2742();}import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a139_0x5bec16(0xfc),a139_0x5bec16(0xf4),a139_0x5bec16(0xde)];export function normalizeBffType(_0x92fd09){const _0x6aa518=a139_0x5bec16;if(!_0x92fd09)return undefined;const _0x57d813=_0x92fd09['trim']()[_0x6aa518(0xe4)]();return SUPPORTED_BFF_TYPES['includes'](_0x57d813)?_0x57d813:undefined;}async function scanJsFilesRecursively(_0x49dda7,_0x5a3fc5){const _0x39cf2b=a139_0x5bec16,_0xe41de1=[];try{const _0x3ea1ba=await readdir(_0x49dda7,{'withFileTypes':!![]});for(const _0x14ab17 of _0x3ea1ba){const _0x366394=join(_0x49dda7,_0x14ab17[_0x39cf2b(0xe8)]);if(_0x14ab17[_0x39cf2b(0xe9)]())_0xe41de1[_0x39cf2b(0xdb)](...await scanJsFilesRecursively(_0x366394,_0x5a3fc5+'/'+_0x14ab17[_0x39cf2b(0xe8)]));else _0x14ab17[_0x39cf2b(0xf3)]()&&_0x14ab17[_0x39cf2b(0xe8)][_0x39cf2b(0xe6)](_0x39cf2b(0xf7))&&_0xe41de1[_0x39cf2b(0xdb)]({'lockKey':_0x5a3fc5+'/'+_0x14ab17[_0x39cf2b(0xe8)][_0x39cf2b(0xf1)](/\.js$/,''),'filePath':_0x366394});}}catch(_0x148429){if(_0x148429['code']!==_0x39cf2b(0xef))throw _0x148429;}return _0xe41de1;}async function scanFlatFunctions(_0x41cd8f,_0x468ffd){const _0x2fe224=a139_0x5bec16,_0xdbc7fd=join(_0x41cd8f['scriptsRootDir'],_0x468ffd),_0x3a2a65=await scanJsFilesRecursively(_0xdbc7fd,_0x468ffd);return _0x3a2a65[_0x2fe224(0xf0)](({lockKey:_0x2e11f5,filePath:_0x1a47f3})=>({'type':_0x468ffd,'name':_0x2e11f5[_0x2fe224(0xe3)]('/')['at'](-0x1)??'','filePath':_0x1a47f3,'lockKey':_0x2e11f5}));}async function scanHookFunctions(_0x21fef0){const _0x271524=a139_0x5bec16,_0xe2d2ee=join(_0x21fef0[_0x271524(0xfa)],_0x271524(0xde)),_0x3a1b42=[];try{const _0x3bdb1e=await readdir(_0xe2d2ee,{'withFileTypes':!![]});for(const _0x2ebbca of _0x3bdb1e){if(!_0x2ebbca[_0x271524(0xe9)]())continue;const _0x28c6b3=_0x2ebbca[_0x271524(0xe8)],_0x4ba8f9=join(_0xe2d2ee,_0x28c6b3),_0x12c0c2=await readdir(_0x4ba8f9,{'withFileTypes':!![]});for(const _0x192b33 of _0x12c0c2){if(!_0x192b33[_0x271524(0xe9)]())continue;const _0x55ecf0=_0x192b33[_0x271524(0xe8)],_0x2e0755=join(_0x4ba8f9,_0x55ecf0),_0x12e97=await readdir(_0x2e0755,{'withFileTypes':!![]});for(const _0x360a24 of _0x12e97){if(!_0x360a24['isDirectory']())continue;const _0x32ad13=_0x360a24[_0x271524(0xe8)],_0x44f4c2=join(_0x2e0755,_0x32ad13),_0x415c91=await readdir(_0x44f4c2,{'withFileTypes':!![]});for(const _0x3c0c0a of _0x415c91){if(!_0x3c0c0a['isFile']()||!_0x3c0c0a[_0x271524(0xe8)]['endsWith']('.js'))continue;const _0x1d6344=_0x3c0c0a['name'][_0x271524(0xf1)](/\.js$/,'');_0x3a1b42[_0x271524(0xdb)]({'type':_0x271524(0xde),'name':_0x1d6344,'filePath':join(_0x44f4c2,_0x3c0c0a[_0x271524(0xe8)]),'lockKey':_0x271524(0xe5)+_0x28c6b3+'/'+_0x55ecf0+'/'+_0x32ad13+'/'+_0x1d6344,'alias':_0x28c6b3,'operationType':_0x55ecf0,'functionNode':_0x32ad13});}}}}}catch(_0x2545f1){if(_0x2545f1['code']!==_0x271524(0xef))throw _0x2545f1;}return _0x3a1b42;}export async function scanLocalBffFunctions(_0x5bec2b,_0x28ce0a){const _0x189653=a139_0x5bec16;if(_0x28ce0a===_0x189653(0xfc)||_0x28ce0a===_0x189653(0xf4))return scanFlatFunctions(_0x5bec2b,_0x28ce0a);if(_0x28ce0a==='HOOK')return scanHookFunctions(_0x5bec2b);const [_0x1d9c91,_0x3a3280,_0x151f8c]=await Promise[_0x189653(0xed)]([scanFlatFunctions(_0x5bec2b,'COMMON'),scanFlatFunctions(_0x5bec2b,_0x189653(0xf4)),scanHookFunctions(_0x5bec2b)]);return[..._0x1d9c91,..._0x3a3280,..._0x151f8c];}export function resolveLocalFilePathFromLockKey(_0x2a00c7,_0x5f414e){const _0x54375e=a139_0x5bec16;return join(_0x2a00c7['scriptsRootDir'],..._0x5f414e[_0x54375e(0xe3)]('/'))+_0x54375e(0xf7);}export function createHookLocationMap(_0x3ea211){const _0x280ce8=a139_0x5bec16,_0x33af47=new Map();for(const _0x52caea of _0x3ea211){_0x52caea[_0x280ce8(0xdc)]&&_0x33af47['set'](_0x52caea['beforeScriptId'],{'datasetCode':_0x52caea['datasetCode'],'operationType':snakeToCamel(_0x52caea['operationType']),'functionNode':_0x280ce8(0xe1)}),_0x52caea[_0x280ce8(0xf8)]&&_0x33af47[_0x280ce8(0xf6)](_0x52caea[_0x280ce8(0xf8)],{'datasetCode':_0x52caea[_0x280ce8(0xda)],'operationType':snakeToCamel(_0x52caea[_0x280ce8(0xea)]),'functionNode':_0x280ce8(0xfb)});}return _0x33af47;}export function resolveRemoteScriptTarget(_0x2fb8fc,_0x401aa1,_0xa418b2,_0x4b1b75,_0x57b9a3){const _0x45aceb=a139_0x5bec16,_0x146b3e=normalizeBffType(_0x401aa1[_0x45aceb(0xdf)]);if(!_0x146b3e||!_0x401aa1[_0x45aceb(0xec)])return null;if(_0x146b3e===_0x45aceb(0xde)){const _0x1f1517=(_0x401aa1['id']?_0xa418b2[_0x45aceb(0xeb)](_0x401aa1['id']):undefined)??findHookLocationByRemoteId(_0x4b1b75,_0x401aa1['id']);if(!_0x1f1517)return null;const _0x41fead=_0x1f1517['alias']||_0x57b9a3[_0x45aceb(0xeb)](_0x1f1517[_0x45aceb(0xda)]),_0x1f5a3e=_0x41fead??_0x1f1517[_0x45aceb(0xda)],_0x2d942e={..._0x1f1517,'alias':_0x41fead},_0x1a1aab=_0x45aceb(0xe5)+_0x1f5a3e+'/'+_0x2d942e['operationType']+'/'+_0x2d942e['functionNode']+'/'+_0x401aa1['functionName'];return{'lockKey':_0x1a1aab,'filePath':resolveLocalFilePathFromLockKey(_0x2fb8fc,_0x1a1aab),'type':_0x45aceb(0xde),'hookLocation':_0x2d942e};}const _0x6dc6b3=_0x146b3e+'/'+_0x401aa1[_0x45aceb(0xec)];return{'lockKey':_0x6dc6b3,'filePath':resolveLocalFilePathFromLockKey(_0x2fb8fc,_0x6dc6b3),'type':_0x146b3e};}export async function ensureParentDirectory(_0x45bb0f){await mkdir(dirname(_0x45bb0f),{'recursive':!![]});}export async function fileExists(_0x23e17d){const _0x5d9d24=a139_0x5bec16;try{return await access(_0x23e17d,constants[_0x5d9d24(0xf9)]),!![];}catch{return![];}}export async function directoryExists(_0x7266ac){const _0x54e29b=a139_0x5bec16;try{const _0x5dcbac=await stat(_0x7266ac);return _0x5dcbac[_0x54e29b(0xe9)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2b40ea,_0x1874f1){const _0x3c8816=a140_0x37d1,_0x3fb6cd=_0x2b40ea();while(!![]){try{const _0x5d1e3f=-parseInt(_0x3c8816(0x1cd))/0x1+parseInt(_0x3c8816(0x1c9))/0x2+parseInt(_0x3c8816(0x1cb))/0x3+-parseInt(_0x3c8816(0x1c3))/0x4+parseInt(_0x3c8816(0x1c8))/0x5*(-parseInt(_0x3c8816(0x1c5))/0x6)+-parseInt(_0x3c8816(0x1c7))/0x7+parseInt(_0x3c8816(0x1cc))/0x8*(parseInt(_0x3c8816(0x1c6))/0x9);if(_0x5d1e3f===_0x1874f1)break;else _0x3fb6cd['push'](_0x3fb6cd['shift']());}catch(_0x2cd1ff){_0x3fb6cd['push'](_0x3fb6cd['shift']());}}}(a140_0x3b2f,0x1e792));import{readFile}from'node:fs/promises';function a140_0x37d1(_0x477576,_0x35e086){_0x477576=_0x477576-0x1c0;const _0x3b2fae=a140_0x3b2f();let _0x37d1bb=_0x3b2fae[_0x477576];return _0x37d1bb;}import a140_0x98e354 from'node:crypto';export function computeContentHash(_0x4fb4af){const _0xf04285=a140_0x37d1;return a140_0x98e354[_0xf04285(0x1ca)](_0xf04285(0x1c4))[_0xf04285(0x1c0)](_0x4fb4af)[_0xf04285(0x1c1)]('hex');}function a140_0x3b2f(){const _0x85c3ad=['85TMutoX','482414vcmhWa','createHash','253581kScRAD','8JtHQVP','47773uddkSp','update','digest','utf8','104452pZAGES','md5','4206VvbbuG','138537Hffpqh','913542QLlzrc'];a140_0x3b2f=function(){return _0x85c3ad;};return a140_0x3b2f();}export async function computeFileHash(_0x45544b){const _0x33456b=a140_0x37d1,_0x2b8398=await readFile(_0x45544b,_0x33456b(0x1c2));return computeContentHash(_0x2b8398);}
1
+ (function(_0x49bf1e,_0x2414f8){const _0x3f3a9f=a140_0x2279,_0x1cc9f7=_0x49bf1e();while(!![]){try{const _0x105d05=parseInt(_0x3f3a9f(0x119))/0x1+parseInt(_0x3f3a9f(0x112))/0x2+parseInt(_0x3f3a9f(0x117))/0x3+parseInt(_0x3f3a9f(0x115))/0x4*(-parseInt(_0x3f3a9f(0x10f))/0x5)+-parseInt(_0x3f3a9f(0x110))/0x6+parseInt(_0x3f3a9f(0x116))/0x7*(-parseInt(_0x3f3a9f(0x10e))/0x8)+-parseInt(_0x3f3a9f(0x11b))/0x9*(parseInt(_0x3f3a9f(0x118))/0xa);if(_0x105d05===_0x2414f8)break;else _0x1cc9f7['push'](_0x1cc9f7['shift']());}catch(_0x45d73b){_0x1cc9f7['push'](_0x1cc9f7['shift']());}}}(a140_0x38ec,0xd3a1e));import{readFile}from'node:fs/promises';import a140_0x1d43e2 from'node:crypto';export function computeContentHash(_0x43f118){const _0x2bb8f4=a140_0x2279;return a140_0x1d43e2[_0x2bb8f4(0x114)]('md5')[_0x2bb8f4(0x111)](_0x43f118)[_0x2bb8f4(0x113)](_0x2bb8f4(0x11a));}function a140_0x38ec(){const _0x562604=['update','901092DxjswR','digest','createHash','152vjstyv','2606429MQAwhz','3604623GIoXzl','1377910CouqQY','1005092uMEIcu','hex','45KdJrmy','8IqXsyp','79770lEsdmF','736674BDlPts'];a140_0x38ec=function(){return _0x562604;};return a140_0x38ec();}function a140_0x2279(_0x1ce0f1,_0x5e7e63){_0x1ce0f1=_0x1ce0f1-0x10e;const _0x38ec48=a140_0x38ec();let _0x227965=_0x38ec48[_0x1ce0f1];return _0x227965;}export async function computeFileHash(_0x2526cc){const _0x1787ec=await readFile(_0x2526cc,'utf8');return computeContentHash(_0x1787ec);}
@@ -1 +1 @@
1
- (function(_0xc82b86,_0x287313){const _0x3e3053=a141_0x2570,_0xe210e7=_0xc82b86();while(!![]){try{const _0x2e99b3=-parseInt(_0x3e3053(0xc7))/0x1*(parseInt(_0x3e3053(0xd2))/0x2)+-parseInt(_0x3e3053(0xd0))/0x3*(parseInt(_0x3e3053(0xd6))/0x4)+parseInt(_0x3e3053(0xc1))/0x5+parseInt(_0x3e3053(0xcd))/0x6+parseInt(_0x3e3053(0xc9))/0x7*(-parseInt(_0x3e3053(0xc6))/0x8)+-parseInt(_0x3e3053(0xc4))/0x9+parseInt(_0x3e3053(0xcf))/0xa;if(_0x2e99b3===_0x287313)break;else _0xe210e7['push'](_0xe210e7['shift']());}catch(_0x47942a){_0xe210e7['push'](_0xe210e7['shift']());}}}(a141_0x1640,0x24a23));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a141_0x2570(_0xcb2e25,_0x55de7f){_0xcb2e25=_0xcb2e25-0xc1;const _0x1640c5=a141_0x1640();let _0x257003=_0x1640c5[_0xcb2e25];return _0x257003;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x3e5011,_0x3dfbc3,_0x424be6,_0x10991a){const _0x31d1ba=a141_0x2570,_0x467a7a={'apps':_0x3e5011[_0x31d1ba(0xc5)]&&typeof _0x3e5011[_0x31d1ba(0xc5)]===_0x31d1ba(0xd5)?_0x3e5011['apps']:{}};let _0x58cf89=_0x467a7a[_0x31d1ba(0xc5)][_0x3dfbc3];if(!_0x58cf89)return _0x58cf89={'scriptsRoot':_0x424be6,'lastSync':'','functions':{}},_0x467a7a[_0x31d1ba(0xc5)][_0x3dfbc3]=_0x58cf89,{'lockData':_0x467a7a,'appLock':_0x58cf89};if(!_0x58cf89[_0x31d1ba(0xd7)])_0x58cf89[_0x31d1ba(0xd7)]=_0x424be6;else{if(_0x58cf89['scriptsRoot']!==_0x424be6)throw new Error(_0x10991a+_0x31d1ba(0xd1)+(_0x31d1ba(0xd8)+_0x424be6+_0x31d1ba(0xd3)+_0x58cf89[_0x31d1ba(0xd7)]+_0x31d1ba(0xce))+_0x31d1ba(0xc8));}return!_0x58cf89[_0x31d1ba(0xca)]&&(_0x58cf89[_0x31d1ba(0xca)]={}),!_0x58cf89[_0x31d1ba(0xc3)]&&(_0x58cf89[_0x31d1ba(0xc3)]=''),{'lockData':_0x467a7a,'appLock':_0x58cf89};}export async function readBffLockFile(_0x5934e2){const _0x2742ba=a141_0x2570;try{const _0x413a2e=await readFile(_0x5934e2,_0x2742ba(0xcc)),_0x49976b=JSON[_0x2742ba(0xd4)](_0x413a2e);return{'apps':_0x49976b[_0x2742ba(0xc5)]&&typeof _0x49976b['apps']===_0x2742ba(0xd5)?_0x49976b[_0x2742ba(0xc5)]:{}};}catch(_0x47ce5c){if(_0x47ce5c[_0x2742ba(0xc2)]==='ENOENT')return null;throw new Error(_0x2742ba(0xcb)+String(_0x47ce5c));}}function a141_0x1640(){const _0x3ba632=['6252990ZoliIB','21jJkPyX',':\x20scriptsRoot\x20mismatch\x20—\x20','114juycgO','\x22\x20vs\x20lock\x20\x22','parse','object','116804sVaJzK','scriptsRoot','current\x20\x22','388130BtjUOK','code','lastSync','172386uZgMvP','apps','16sCNwSD','1533cFGnhP','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','975037pigafe','functions','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','utf8','219900cAecpq','\x22.\x20'];a141_0x1640=function(){return _0x3ba632;};return a141_0x1640();}export async function writeBffLockFile(_0x153839,_0x4b7d31){const _0x17568c=a141_0x2570;await mkdir(dirname(_0x153839),{'recursive':!![]}),await writeFile(_0x153839,JSON['stringify'](_0x4b7d31,null,0x2),_0x17568c(0xcc));}
1
+ function a141_0x2df4(_0x2f843c,_0x3d8973){_0x2f843c=_0x2f843c-0x1d9;const _0x43f3bc=a141_0x43f3();let _0x2df4a8=_0x43f3bc[_0x2f843c];return _0x2df4a8;}(function(_0x1009ed,_0x2bf1ee){const _0x156bb3=a141_0x2df4,_0x257c5b=_0x1009ed();while(!![]){try{const _0x341bde=-parseInt(_0x156bb3(0x1e7))/0x1+parseInt(_0x156bb3(0x1d9))/0x2+parseInt(_0x156bb3(0x1ea))/0x3*(parseInt(_0x156bb3(0x1db))/0x4)+parseInt(_0x156bb3(0x1dd))/0x5+-parseInt(_0x156bb3(0x1e1))/0x6*(parseInt(_0x156bb3(0x1ed))/0x7)+parseInt(_0x156bb3(0x1e3))/0x8+-parseInt(_0x156bb3(0x1ec))/0x9*(parseInt(_0x156bb3(0x1e5))/0xa);if(_0x341bde===_0x2bf1ee)break;else _0x257c5b['push'](_0x257c5b['shift']());}catch(_0x9ae75f){_0x257c5b['push'](_0x257c5b['shift']());}}}(a141_0x43f3,0xb8dc7));import{mkdir,readFile,writeFile}from'node:fs/promises';function a141_0x43f3(){const _0x543b6b=['2689194LkYWQU','lastSync','124hwgiuT','\x22.\x20','4042920tzeGYu','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','scriptsRoot','code','2670GWeWFN','object','805744yoxqvL','functions','1500euAwML','utf8','571135soBWsq','parse','apps','11796mCfXCA',':\x20scriptsRoot\x20mismatch\x20—\x20','30087lYSvcs','8589UATxjo'];a141_0x43f3=function(){return _0x543b6b;};return a141_0x43f3();}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x533a6f,_0x7d81bb,_0x22dfc7,_0x24e6cc){const _0xf78255=a141_0x2df4,_0x1219bf={'apps':_0x533a6f['apps']&&typeof _0x533a6f[_0xf78255(0x1e9)]===_0xf78255(0x1e2)?_0x533a6f[_0xf78255(0x1e9)]:{}};let _0x45648b=_0x1219bf['apps'][_0x7d81bb];if(!_0x45648b)return _0x45648b={'scriptsRoot':_0x22dfc7,'lastSync':'','functions':{}},_0x1219bf['apps'][_0x7d81bb]=_0x45648b,{'lockData':_0x1219bf,'appLock':_0x45648b};if(!_0x45648b['scriptsRoot'])_0x45648b[_0xf78255(0x1df)]=_0x22dfc7;else{if(_0x45648b[_0xf78255(0x1df)]!==_0x22dfc7)throw new Error(_0x24e6cc+_0xf78255(0x1eb)+('current\x20\x22'+_0x22dfc7+'\x22\x20vs\x20lock\x20\x22'+_0x45648b['scriptsRoot']+_0xf78255(0x1dc))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x45648b[_0xf78255(0x1e4)]&&(_0x45648b[_0xf78255(0x1e4)]={}),!_0x45648b['lastSync']&&(_0x45648b[_0xf78255(0x1da)]=''),{'lockData':_0x1219bf,'appLock':_0x45648b};}export async function readBffLockFile(_0x164fe7){const _0x40bc97=a141_0x2df4;try{const _0x2e9bde=await readFile(_0x164fe7,_0x40bc97(0x1e6)),_0x3ec4de=JSON[_0x40bc97(0x1e8)](_0x2e9bde);return{'apps':_0x3ec4de[_0x40bc97(0x1e9)]&&typeof _0x3ec4de['apps']===_0x40bc97(0x1e2)?_0x3ec4de[_0x40bc97(0x1e9)]:{}};}catch(_0x3df4f9){if(_0x3df4f9[_0x40bc97(0x1e0)]==='ENOENT')return null;throw new Error(_0x40bc97(0x1de)+String(_0x3df4f9));}}export async function writeBffLockFile(_0x2e891d,_0x3368c9){const _0x56dc43=a141_0x2df4;await mkdir(dirname(_0x2e891d),{'recursive':!![]}),await writeFile(_0x2e891d,JSON['stringify'](_0x3368c9,null,0x2),_0x56dc43(0x1e6));}
@@ -1 +1 @@
1
- (function(_0x27a265,_0x35d9ce){const _0x2a974b=a143_0x2c1b,_0x215c2f=_0x27a265();while(!![]){try{const _0x154601=-parseInt(_0x2a974b(0x136))/0x1*(-parseInt(_0x2a974b(0x13b))/0x2)+parseInt(_0x2a974b(0x139))/0x3*(-parseInt(_0x2a974b(0x13c))/0x4)+parseInt(_0x2a974b(0x143))/0x5+parseInt(_0x2a974b(0x134))/0x6+-parseInt(_0x2a974b(0x135))/0x7+parseInt(_0x2a974b(0x13a))/0x8+-parseInt(_0x2a974b(0x137))/0x9;if(_0x154601===_0x35d9ce)break;else _0x215c2f['push'](_0x215c2f['shift']());}catch(_0x438762){_0x215c2f['push'](_0x215c2f['shift']());}}}(a143_0xcfc0,0x5312c));export function snakeToCamel(_0x51dde6){const _0x100b83=a143_0x2c1b;return _0x51dde6[_0x100b83(0x13f)]()[_0x100b83(0x142)](/_([a-z])/g,(_0x5d7dc1,_0x3ffffb)=>_0x3ffffb[_0x100b83(0x13d)]());}function a143_0x2c1b(_0x5d947c,_0x1e11e){_0x5d947c=_0x5d947c-0x133;const _0xcfc041=a143_0xcfc0();let _0x2c1b42=_0xcfc041[_0x5d947c];return _0x2c1b42;}export function findHookLocationByRemoteId(_0xbca79,_0x26f9a2){const _0x4f7243=a143_0x2c1b;if(!_0x26f9a2)return undefined;for(const _0x22efe5 of Object['values'](_0xbca79)){if(_0x22efe5[_0x4f7243(0x133)]===_0x26f9a2&&_0x22efe5['datasetCode']&&_0x22efe5[_0x4f7243(0x138)]&&_0x22efe5[_0x4f7243(0x144)])return{'datasetCode':_0x22efe5['datasetCode'],'operationType':_0x22efe5[_0x4f7243(0x138)],'functionNode':_0x22efe5[_0x4f7243(0x144)]};}return undefined;}function a143_0xcfc0(){const _0x104a68=['2026734Ghyzla','1595153Cmrngn','70216zIbpFz','8179470xUewjQ','operationType','3yRaSjh','5170616NwEYnB','10lLSdqK','1387268RmpWkl','toUpperCase','match','toLowerCase','before','after','replace','2442990psCiej','functionNode','remoteId'];a143_0xcfc0=function(){return _0x104a68;};return a143_0xcfc0();}export function extractScriptDescription(_0x20dada){const _0x5082a0=a143_0x2c1b,_0x1b47cf=_0x20dada[_0x5082a0(0x13e)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x1b47cf?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x2523e0){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x2523e0);}export function normalizeHookFunctionNode(_0x58fb2f){const _0x2bd9ca=a143_0x2c1b;if(!_0x58fb2f)return undefined;const _0x31e7dd=_0x58fb2f['trim']()[_0x2bd9ca(0x13f)]();if(_0x31e7dd===_0x2bd9ca(0x140)||_0x31e7dd===_0x2bd9ca(0x141))return _0x31e7dd;return undefined;}
1
+ (function(_0x217807,_0x20306b){const _0x4a5021=a143_0x14cd,_0x1c532e=_0x217807();while(!![]){try{const _0x4a68f1=parseInt(_0x4a5021(0x1a6))/0x1*(parseInt(_0x4a5021(0x1ab))/0x2)+parseInt(_0x4a5021(0x1b3))/0x3*(-parseInt(_0x4a5021(0x1a2))/0x4)+-parseInt(_0x4a5021(0x1b4))/0x5*(-parseInt(_0x4a5021(0x1aa))/0x6)+-parseInt(_0x4a5021(0x1a5))/0x7*(-parseInt(_0x4a5021(0x1b0))/0x8)+parseInt(_0x4a5021(0x1ad))/0x9+-parseInt(_0x4a5021(0x1a1))/0xa+-parseInt(_0x4a5021(0x1af))/0xb*(parseInt(_0x4a5021(0x19f))/0xc);if(_0x4a68f1===_0x20306b)break;else _0x1c532e['push'](_0x1c532e['shift']());}catch(_0x33668e){_0x1c532e['push'](_0x1c532e['shift']());}}}(a143_0x4357,0x42d1c));export function snakeToCamel(_0x5460c6){const _0xe416ee=a143_0x14cd;return _0x5460c6[_0xe416ee(0x1ac)]()[_0xe416ee(0x1ae)](/_([a-z])/g,(_0x3995d5,_0x4bd993)=>_0x4bd993[_0xe416ee(0x1b2)]());}export function findHookLocationByRemoteId(_0x547aff,_0x34cd3a){const _0x1009b4=a143_0x14cd;if(!_0x34cd3a)return undefined;for(const _0x2663cb of Object['values'](_0x547aff)){if(_0x2663cb[_0x1009b4(0x1a4)]===_0x34cd3a&&_0x2663cb[_0x1009b4(0x1b5)]&&_0x2663cb[_0x1009b4(0x1a8)]&&_0x2663cb[_0x1009b4(0x1b1)])return{'datasetCode':_0x2663cb['datasetCode'],'operationType':_0x2663cb[_0x1009b4(0x1a8)],'functionNode':_0x2663cb[_0x1009b4(0x1b1)]};}return undefined;}function a143_0x14cd(_0x1ac063,_0x46dafb){_0x1ac063=_0x1ac063-0x19f;const _0x435782=a143_0x4357();let _0x14cdcc=_0x435782[_0x1ac063];return _0x14cdcc;}export function extractScriptDescription(_0xb98134){const _0x36023d=a143_0x14cd,_0x1575f9=_0xb98134[_0x36023d(0x1a9)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x1575f9?.[0x1]?.[_0x36023d(0x1a7)]()||undefined;}function a143_0x4357(){const _0x1dc798=['remoteId','115157JAmpFt','691FQBycL','trim','operationType','match','6wCAxhn','2IpbOkV','toLowerCase','4777524dsTftL','replace','22BqgWRH','200MgNqTu','functionNode','toUpperCase','39WfMzbe','2335990LZqHSj','datasetCode','4357656brdkLo','test','2139530HYAELr','60332hfZFhH','after'];a143_0x4357=function(){return _0x1dc798;};return a143_0x4357();}export function isValidBffFunctionName(_0x3a8e74){const _0x4dd9d5=a143_0x14cd;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x4dd9d5(0x1a0)](_0x3a8e74);}export function normalizeHookFunctionNode(_0x334d28){const _0x4861b2=a143_0x14cd;if(!_0x334d28)return undefined;const _0x43e841=_0x334d28[_0x4861b2(0x1a7)]()[_0x4861b2(0x1ac)]();if(_0x43e841==='before'||_0x43e841===_0x4861b2(0x1a3))return _0x43e841;return undefined;}
@@ -1 +1 @@
1
- (function(_0x21d48b,_0x45da51){const _0x122a42=a144_0x4427,_0x20c6b1=_0x21d48b();while(!![]){try{const _0x3dcea2=parseInt(_0x122a42(0x128))/0x1*(parseInt(_0x122a42(0x13c))/0x2)+-parseInt(_0x122a42(0x134))/0x3*(parseInt(_0x122a42(0x13e))/0x4)+-parseInt(_0x122a42(0x135))/0x5+-parseInt(_0x122a42(0x125))/0x6+-parseInt(_0x122a42(0x130))/0x7+parseInt(_0x122a42(0x137))/0x8+parseInt(_0x122a42(0x12a))/0x9;if(_0x3dcea2===_0x45da51)break;else _0x20c6b1['push'](_0x20c6b1['shift']());}catch(_0x3d964d){_0x20c6b1['push'](_0x20c6b1['shift']());}}}(a144_0x3457,0x82697));import{listDatasets}from'../core/api-client.js';function a144_0x4427(_0x10b706,_0x1d9263){_0x10b706=_0x10b706-0x125;const _0x34578b=a144_0x3457();let _0x442750=_0x34578b[_0x10b706];return _0x442750;}const cache=new Map();function a144_0x3457(){const _0xccb21b=['270124EcnQsO','3014100zfWXaO','toLowerCase','find','1303EuHXYk','join','8426214DNzgBM','.\x20Be\x20more\x20specific.','map','has','get','\x22\x20matches\x20multiple\x20databases:\x20','4371612JNXjyC','includes','length','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','12BAAbhn','173975Lvoiko','dbId','4933240aJUzdn','dbName','set','\x22.\x20Available:\x20','No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','634QtiDsd','entries'];a144_0x3457=function(){return _0xccb21b;};return a144_0x3457();}export async function listDatabases(_0x16153c){const _0xcaf3f6=a144_0x4427;if(cache[_0xcaf3f6(0x12d)](_0x16153c))return cache[_0xcaf3f6(0x12e)](_0x16153c);const _0x299929=await listDatasets(_0x16153c),_0x5afcbb=new Map();for(const _0x417fb0 of _0x299929){const _0x2ddff7=_0x417fb0['dbtableConfig'];_0x2ddff7?.[_0xcaf3f6(0x136)]!=null&&_0x5afcbb[_0xcaf3f6(0x139)](_0x2ddff7['dbId'],_0x2ddff7['dbName']??'db-'+_0x2ddff7['dbId']);}const _0x44d573=[..._0x5afcbb[_0xcaf3f6(0x13d)]()][_0xcaf3f6(0x12c)](([_0x2bdd5b,_0x58cb91])=>({'dbId':_0x2bdd5b,'dbName':_0x58cb91}));return cache[_0xcaf3f6(0x139)](_0x16153c,_0x44d573),_0x44d573;}export async function resolveDb(_0x235a31,_0x346dce){const _0x31c910=a144_0x4427,_0x5aa15d=await listDatabases(_0x235a31);if(_0x5aa15d[_0x31c910(0x132)]===0x0)return{'resolved':[],'error':_0x31c910(0x13b)};if(!_0x346dce)return{'resolved':_0x5aa15d};const _0x52d7a6=Number(_0x346dce);if(!Number['isNaN'](_0x52d7a6)){const _0x5239a5=_0x5aa15d[_0x31c910(0x127)](_0x518040=>_0x518040[_0x31c910(0x136)]===_0x52d7a6);if(_0x5239a5)return{'resolved':[_0x5239a5]};}const _0x160088=_0x346dce[_0x31c910(0x126)](),_0x6349fa=_0x5aa15d['filter'](_0x263dc3=>_0x263dc3['dbName']['toLowerCase']()[_0x31c910(0x131)](_0x160088));if(_0x6349fa[_0x31c910(0x132)]>0x0)return{'resolved':_0x6349fa};const _0x66e2e2=_0x5aa15d[_0x31c910(0x12c)](_0x2e264b=>_0x2e264b[_0x31c910(0x138)]+'\x20('+_0x2e264b[_0x31c910(0x136)]+')')[_0x31c910(0x129)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x346dce+_0x31c910(0x13a)+_0x66e2e2};}export async function resolveOneDb(_0x1a4b58,_0x422c48){const _0xe6a3ef=a144_0x4427,{resolved:_0x3d468c,error:_0x467dfa}=await resolveDb(_0x1a4b58,_0x422c48);if(_0x467dfa)return{'db':null,'error':_0x467dfa};if(_0x3d468c[_0xe6a3ef(0x132)]===0x1)return{'db':_0x3d468c[0x0]};if(!_0x422c48){const _0x34cd42=_0x3d468c[_0xe6a3ef(0x12c)](_0x4cf9ea=>_0x4cf9ea[_0xe6a3ef(0x138)]+'\x20('+_0x4cf9ea['dbId']+')')[_0xe6a3ef(0x129)](',\x20');return{'db':null,'error':_0xe6a3ef(0x133)+_0x34cd42};}const _0x2d5646=_0x3d468c[_0xe6a3ef(0x12c)](_0x36193f=>_0x36193f[_0xe6a3ef(0x138)]+'\x20('+_0x36193f[_0xe6a3ef(0x136)]+')')[_0xe6a3ef(0x129)](',\x20');return{'db':null,'error':'\x22'+_0x422c48+_0xe6a3ef(0x12f)+_0x2d5646+_0xe6a3ef(0x12b)};}export async function getDbName(_0xee0af,_0x59bcba){const _0x38ef8a=a144_0x4427,_0x3ad849=await listDatabases(_0xee0af);return _0x3ad849[_0x38ef8a(0x127)](_0x28371a=>_0x28371a[_0x38ef8a(0x136)]===_0x59bcba)?.[_0x38ef8a(0x138)];}
1
+ (function(_0x31ca5a,_0x8bf2b2){const _0x2da84b=a144_0x4bc9,_0x234e73=_0x31ca5a();while(!![]){try{const _0x3feec5=-parseInt(_0x2da84b(0x1a0))/0x1*(parseInt(_0x2da84b(0x1b3))/0x2)+parseInt(_0x2da84b(0x19c))/0x3+-parseInt(_0x2da84b(0x1a1))/0x4*(parseInt(_0x2da84b(0x19d))/0x5)+parseInt(_0x2da84b(0x1a9))/0x6*(-parseInt(_0x2da84b(0x1a8))/0x7)+parseInt(_0x2da84b(0x1b4))/0x8*(parseInt(_0x2da84b(0x1b0))/0x9)+-parseInt(_0x2da84b(0x1af))/0xa+parseInt(_0x2da84b(0x1aa))/0xb;if(_0x3feec5===_0x8bf2b2)break;else _0x234e73['push'](_0x234e73['shift']());}catch(_0x3c2574){_0x234e73['push'](_0x234e73['shift']());}}}(a144_0x2a44,0x8efd5));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x787642){const _0x3fb0d1=a144_0x4bc9;if(cache['has'](_0x787642))return cache[_0x3fb0d1(0x19f)](_0x787642);const _0x3693fe=await listDatasets(_0x787642),_0x2687fb=new Map();for(const _0x460a4e of _0x3693fe){const _0x4e43e9=_0x460a4e['dbtableConfig'];_0x4e43e9?.['dbId']!=null&&_0x2687fb[_0x3fb0d1(0x1b7)](_0x4e43e9['dbId'],_0x4e43e9[_0x3fb0d1(0x1a6)]??_0x3fb0d1(0x1a4)+_0x4e43e9[_0x3fb0d1(0x1a7)]);}const _0x16e089=[..._0x2687fb[_0x3fb0d1(0x1a5)]()]['map'](([_0x1a24a5,_0x190b15])=>({'dbId':_0x1a24a5,'dbName':_0x190b15}));return cache['set'](_0x787642,_0x16e089),_0x16e089;}export async function resolveDb(_0x404598,_0xe5296b){const _0x52ef0a=a144_0x4bc9,_0x178bb2=await listDatabases(_0x404598);if(_0x178bb2[_0x52ef0a(0x19b)]===0x0)return{'resolved':[],'error':_0x52ef0a(0x1ae)};if(!_0xe5296b)return{'resolved':_0x178bb2};const _0x3f86ca=Number(_0xe5296b);if(!Number[_0x52ef0a(0x1b1)](_0x3f86ca)){const _0x50835e=_0x178bb2[_0x52ef0a(0x1b2)](_0x4b110a=>_0x4b110a['dbId']===_0x3f86ca);if(_0x50835e)return{'resolved':[_0x50835e]};}const _0x3c380e=_0xe5296b['toLowerCase'](),_0x21f903=_0x178bb2['filter'](_0x42c2c9=>_0x42c2c9[_0x52ef0a(0x1a6)][_0x52ef0a(0x1a3)]()[_0x52ef0a(0x1ac)](_0x3c380e));if(_0x21f903['length']>0x0)return{'resolved':_0x21f903};const _0x34b22f=_0x178bb2[_0x52ef0a(0x1b5)](_0x1dbd48=>_0x1dbd48[_0x52ef0a(0x1a6)]+'\x20('+_0x1dbd48[_0x52ef0a(0x1a7)]+')')['join'](',\x20');return{'resolved':[],'error':_0x52ef0a(0x19e)+_0xe5296b+_0x52ef0a(0x1ad)+_0x34b22f};}export async function resolveOneDb(_0x56930f,_0x47862f){const _0x4fa497=a144_0x4bc9,{resolved:_0x2363d0,error:_0x59c305}=await resolveDb(_0x56930f,_0x47862f);if(_0x59c305)return{'db':null,'error':_0x59c305};if(_0x2363d0[_0x4fa497(0x19b)]===0x1)return{'db':_0x2363d0[0x0]};if(!_0x47862f){const _0x52a084=_0x2363d0[_0x4fa497(0x1b5)](_0xfa0b98=>_0xfa0b98[_0x4fa497(0x1a6)]+'\x20('+_0xfa0b98[_0x4fa497(0x1a7)]+')')[_0x4fa497(0x1b6)](',\x20');return{'db':null,'error':_0x4fa497(0x1a2)+_0x52a084};}const _0x3ff64a=_0x2363d0[_0x4fa497(0x1b5)](_0x360a4f=>_0x360a4f[_0x4fa497(0x1a6)]+'\x20('+_0x360a4f['dbId']+')')[_0x4fa497(0x1b6)](',\x20');return{'db':null,'error':'\x22'+_0x47862f+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x3ff64a+_0x4fa497(0x1ab)};}function a144_0x4bc9(_0x54564d,_0x382e1d){_0x54564d=_0x54564d-0x19b;const _0x2a4480=a144_0x2a44();let _0x4bc9ae=_0x2a4480[_0x54564d];return _0x4bc9ae;}export async function getDbName(_0x181ad6,_0x291755){const _0x3ad52d=a144_0x4bc9,_0x462f8d=await listDatabases(_0x181ad6);return _0x462f8d['find'](_0x3090e4=>_0x3090e4[_0x3ad52d(0x1a7)]===_0x291755)?.[_0x3ad52d(0x1a6)];}function a144_0x2a44(){const _0x5d1941=['73809PKtBej','isNaN','find','2ciUPzQ','1064IIANeo','map','join','set','length','420501gHKyBt','750lAEtdC','No\x20database\x20matching\x20\x22','get','992841PMWgry','2436KHtOrU','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','toLowerCase','db-','entries','dbName','dbId','3353mHdzGq','5988ttMjHT','12873872zkwOvs','.\x20Be\x20more\x20specific.','includes','\x22.\x20Available:\x20','No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','2533340XYRuCv'];a144_0x2a44=function(){return _0x5d1941;};return a144_0x2a44();}
@@ -1 +1 @@
1
- (function(_0x1189bb,_0x5e256c){const _0x112d21=a145_0xace8,_0x3efb27=_0x1189bb();while(!![]){try{const _0x389670=-parseInt(_0x112d21(0x1df))/0x1+-parseInt(_0x112d21(0x1ec))/0x2*(-parseInt(_0x112d21(0x1de))/0x3)+-parseInt(_0x112d21(0x1dd))/0x4*(parseInt(_0x112d21(0x1e3))/0x5)+-parseInt(_0x112d21(0x1e1))/0x6*(-parseInt(_0x112d21(0x1ea))/0x7)+-parseInt(_0x112d21(0x1e8))/0x8+parseInt(_0x112d21(0x1e4))/0x9*(-parseInt(_0x112d21(0x1e5))/0xa)+parseInt(_0x112d21(0x1e2))/0xb;if(_0x389670===_0x5e256c)break;else _0x3efb27['push'](_0x3efb27['shift']());}catch(_0x11e49f){_0x3efb27['push'](_0x3efb27['shift']());}}}(a145_0x45ed,0x23ca9));function a145_0xace8(_0x4fbdd6,_0x3b1291){_0x4fbdd6=_0x4fbdd6-0x1db;const _0x45ed76=a145_0x45ed();let _0xace8cf=_0x45ed76[_0x4fbdd6];return _0xace8cf;}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1ed03e,_0x1ad84b=process['cwd']()){const _0x238772=a145_0xace8,_0x4fee75=resolve(_0x1ad84b),_0x2068cc=join(_0x4fee75,'.rabetbase',_0x238772(0x1e7));return{'projectRoot':_0x4fee75,'pagesBaseDir':_0x2068cc,'appPagesDir':join(_0x2068cc,_0x1ed03e),'lockFilePath':join(_0x4fee75,_0x238772(0x1db),_0x238772(0x1e0))};}export function buildPageFileName(_0x38d63b,_0x585f40){const _0x3cc306=a145_0xace8;return _0x38d63b+'-'+String(_0x585f40)[_0x3cc306(0x1eb)]()+_0x3cc306(0x1e6);}export function resolvePageFilePath(_0x5b73dd,_0x38046a,_0x370fc6){const _0x4f2c13=a145_0xace8;return join(_0x5b73dd[_0x4f2c13(0x1dc)],buildPageFileName(_0x38046a,_0x370fc6));}export async function ensureParentDirectory(_0x211aad){await mkdir(dirname(_0x211aad),{'recursive':!![]});}export async function fileExists(_0x2f4083){const _0x11660f=a145_0xace8;try{return await access(_0x2f4083,constants[_0x11660f(0x1e9)]),!![];}catch{return![];}}function a145_0x45ed(){const _0x523497=['.rabetbase','appPagesDir','180TRrDAe','183NGYseE','24256kYqyNl','page.lock.json','6FDPcta','1082070nXTwjQ','9365NvVGhs','863883bHXhkZ','10mFwaUt','.json','page','2011224VPrHxP','F_OK','1642221CxcvgK','toUpperCase','8838yMeHFG'];a145_0x45ed=function(){return _0x523497;};return a145_0x45ed();}
1
+ const a145_0x79c4b4=a145_0x3628;(function(_0xebeb79,_0x12e20e){const _0x9cce2a=a145_0x3628,_0x3d166e=_0xebeb79();while(!![]){try{const _0x161057=-parseInt(_0x9cce2a(0x1ba))/0x1+-parseInt(_0x9cce2a(0x1c7))/0x2+-parseInt(_0x9cce2a(0x1b8))/0x3+-parseInt(_0x9cce2a(0x1c0))/0x4+parseInt(_0x9cce2a(0x1c6))/0x5*(-parseInt(_0x9cce2a(0x1c1))/0x6)+parseInt(_0x9cce2a(0x1bc))/0x7*(-parseInt(_0x9cce2a(0x1bd))/0x8)+-parseInt(_0x9cce2a(0x1be))/0x9*(-parseInt(_0x9cce2a(0x1c4))/0xa);if(_0x161057===_0x12e20e)break;else _0x3d166e['push'](_0x3d166e['shift']());}catch(_0x1b763d){_0x3d166e['push'](_0x3d166e['shift']());}}}(a145_0x2c05,0x50588));import{constants}from'node:fs';function a145_0x3628(_0x5a3d8f,_0x385531){_0x5a3d8f=_0x5a3d8f-0x1b8;const _0x2c0509=a145_0x2c05();let _0x36288e=_0x2c0509[_0x5a3d8f];return _0x36288e;}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x546de2,_0x5f5270=process[a145_0x79c4b4(0x1bb)]()){const _0x4bea0b=a145_0x79c4b4,_0x587c02=resolve(_0x5f5270),_0x9e341a=join(_0x587c02,_0x4bea0b(0x1c2),_0x4bea0b(0x1bf));return{'projectRoot':_0x587c02,'pagesBaseDir':_0x9e341a,'appPagesDir':join(_0x9e341a,_0x546de2),'lockFilePath':join(_0x587c02,'.rabetbase',_0x4bea0b(0x1c5))};}export function buildPageFileName(_0x592743,_0x212aa6){const _0x2d7e8e=a145_0x79c4b4;return _0x592743+'-'+String(_0x212aa6)[_0x2d7e8e(0x1c3)]()+'.json';}function a145_0x2c05(){const _0x1bbb65=['.rabetbase','toUpperCase','1435590gBHPwt','page.lock.json','5915EGuLkZ','348570cMoaZj','1677822GNLLED','F_OK','166729sszBmH','cwd','7tslxnM','2137816HyTJuL','117QWWLGd','page','139468OTboIg','1698vmmNOe'];a145_0x2c05=function(){return _0x1bbb65;};return a145_0x2c05();}export function resolvePageFilePath(_0x5926ff,_0x157725,_0x58dffa){return join(_0x5926ff['appPagesDir'],buildPageFileName(_0x157725,_0x58dffa));}export async function ensureParentDirectory(_0x415d44){await mkdir(dirname(_0x415d44),{'recursive':!![]});}export async function fileExists(_0x12a9cc){const _0x241380=a145_0x79c4b4;try{return await access(_0x12a9cc,constants[_0x241380(0x1b9)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x18a624,_0x2a0e4e){const _0x31456a=a146_0x19d4,_0x32ce7f=_0x18a624();while(!![]){try{const _0x5891e7=parseInt(_0x31456a(0x157))/0x1*(parseInt(_0x31456a(0x14a))/0x2)+-parseInt(_0x31456a(0x156))/0x3+parseInt(_0x31456a(0x150))/0x4*(parseInt(_0x31456a(0x14d))/0x5)+parseInt(_0x31456a(0x152))/0x6*(parseInt(_0x31456a(0x14c))/0x7)+parseInt(_0x31456a(0x158))/0x8*(-parseInt(_0x31456a(0x151))/0x9)+-parseInt(_0x31456a(0x159))/0xa*(parseInt(_0x31456a(0x148))/0xb)+-parseInt(_0x31456a(0x154))/0xc;if(_0x5891e7===_0x2a0e4e)break;else _0x32ce7f['push'](_0x32ce7f['shift']());}catch(_0x43f409){_0x32ce7f['push'](_0x32ce7f['shift']());}}}(a146_0x5b09,0xe25ca));import a146_0x56a6d2 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0xdaea02){const _0x5e3cc3=a146_0x19d4;return JSON[_0x5e3cc3(0x14f)](JSON['parse'](_0xdaea02),null,0x2)+'\x0a';}function a146_0x19d4(_0x17e8a3,_0x2ce23d){_0x17e8a3=_0x17e8a3-0x147;const _0x5b0986=a146_0x5b09();let _0x19d40c=_0x5b0986[_0x17e8a3];return _0x19d40c;}export function computePageContentHash(_0x2957d3){const _0x1f4b70=a146_0x19d4;return a146_0x56a6d2[_0x1f4b70(0x14b)](_0x1f4b70(0x153))[_0x1f4b70(0x14e)](_0x2957d3)[_0x1f4b70(0x147)](_0x1f4b70(0x149));}export function computeSerializedSchemaHash(_0x29d187){return computePageContentHash(serializePageSchemaForFile(_0x29d187));}function a146_0x5b09(){const _0x538276=['createHash','117075mnCEWG','7083515IoMfuw','update','stringify','4SMWNTF','2996415phBIfs','222qfxJKq','md5','7255488fKcnvM','utf8','4033719ACNuXE','7513dCEuuF','8vwFaCe','30JwNxpl','digest','1949453vNwDmy','hex','454JeNLQd'];a146_0x5b09=function(){return _0x538276;};return a146_0x5b09();}export async function computePageFileHash(_0x539996){const _0x17e8e4=a146_0x19d4,_0x27690e=await readFile(_0x539996,_0x17e8e4(0x155));return computePageContentHash(_0x27690e);}
1
+ function a146_0x29f0(_0x1446c9,_0x2d9ab1){_0x1446c9=_0x1446c9-0x1a3;const _0x272708=a146_0x2727();let _0x29f0ca=_0x272708[_0x1446c9];return _0x29f0ca;}(function(_0x5b7b11,_0x379bad){const _0x18d2b6=a146_0x29f0,_0x126f28=_0x5b7b11();while(!![]){try{const _0x8ce121=parseInt(_0x18d2b6(0x1a7))/0x1+-parseInt(_0x18d2b6(0x1ab))/0x2+-parseInt(_0x18d2b6(0x1ae))/0x3*(-parseInt(_0x18d2b6(0x1a9))/0x4)+parseInt(_0x18d2b6(0x1ad))/0x5+parseInt(_0x18d2b6(0x1aa))/0x6+parseInt(_0x18d2b6(0x1af))/0x7+-parseInt(_0x18d2b6(0x1a4))/0x8*(parseInt(_0x18d2b6(0x1a3))/0x9);if(_0x8ce121===_0x379bad)break;else _0x126f28['push'](_0x126f28['shift']());}catch(_0x403e95){_0x126f28['push'](_0x126f28['shift']());}}}(a146_0x2727,0xa882a));import a146_0xe9d020 from'node:crypto';import{readFile}from'node:fs/promises';function a146_0x2727(){const _0x185a33=['update','703539nhMgPM','md5','380STrgkr','4766364VPLDyL','2290102rdOTeS','digest','3793045LXqGOX','31362JZGTFa','4304657ImwGIa','18264186sLYjHI','8rSqHWz','hex'];a146_0x2727=function(){return _0x185a33;};return a146_0x2727();}export function serializePageSchemaForFile(_0x2ad31e){return JSON['stringify'](JSON['parse'](_0x2ad31e),null,0x2)+'\x0a';}export function computePageContentHash(_0x5d4df7){const _0x19dea9=a146_0x29f0;return a146_0xe9d020['createHash'](_0x19dea9(0x1a8))[_0x19dea9(0x1a6)](_0x5d4df7)[_0x19dea9(0x1ac)](_0x19dea9(0x1a5));}export function computeSerializedSchemaHash(_0xbb6ae){return computePageContentHash(serializePageSchemaForFile(_0xbb6ae));}export async function computePageFileHash(_0x3452f4){const _0x19d58e=await readFile(_0x3452f4,'utf8');return computePageContentHash(_0x19d58e);}
@@ -1 +1 @@
1
- (function(_0x52a0aa,_0x4a9b4d){const _0x671557=a147_0x2af7,_0x5e2983=_0x52a0aa();while(!![]){try{const _0x37d917=-parseInt(_0x671557(0x1b9))/0x1*(-parseInt(_0x671557(0x1c8))/0x2)+parseInt(_0x671557(0x1bd))/0x3+-parseInt(_0x671557(0x1bb))/0x4*(parseInt(_0x671557(0x1c1))/0x5)+parseInt(_0x671557(0x1c3))/0x6*(-parseInt(_0x671557(0x1c2))/0x7)+-parseInt(_0x671557(0x1bf))/0x8*(-parseInt(_0x671557(0x1c6))/0x9)+-parseInt(_0x671557(0x1c4))/0xa+parseInt(_0x671557(0x1c0))/0xb*(-parseInt(_0x671557(0x1bc))/0xc);if(_0x37d917===_0x4a9b4d)break;else _0x5e2983['push'](_0x5e2983['shift']());}catch(_0x5f22a9){_0x5e2983['push'](_0x5e2983['shift']());}}}(a147_0x11c1,0xbe09c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a147_0x2af7(_0x54df47,_0x3fcf14){_0x54df47=_0x54df47-0x1b5;const _0x11c1b8=a147_0x11c1();let _0x2af757=_0x11c1b8[_0x54df47];return _0x2af757;}function a147_0x11c1(){const _0x2af755=['790776QftscZ','9061080zoeKzR','2600793ndgFBj','lastSync','12736CLcnPl','11EcTOnT','25MqbEgD','3640uUTLNV','6414ciCWGS','3611960ZzSUGL','utf8','7362xWHSkg','object','2539690IfmmrS','code','pages','apps','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1PJpTvZ','parse'];a147_0x11c1=function(){return _0x2af755;};return a147_0x11c1();}export function ensurePageLockScope(_0x3a80a4,_0x5381a4){const _0x3304d1=a147_0x2af7,_0x165adc={'apps':_0x3a80a4['apps']&&typeof _0x3a80a4[_0x3304d1(0x1b7)]===_0x3304d1(0x1c7)?_0x3a80a4['apps']:{}};let _0x35fdf3=_0x165adc[_0x3304d1(0x1b7)][_0x5381a4];if(!_0x35fdf3)return _0x35fdf3={'lastSync':'','pages':{}},_0x165adc['apps'][_0x5381a4]=_0x35fdf3,{'lockData':_0x165adc,'appLock':_0x35fdf3};return!_0x35fdf3[_0x3304d1(0x1be)]&&(_0x35fdf3['lastSync']=''),(!_0x35fdf3['pages']||typeof _0x35fdf3[_0x3304d1(0x1b6)]!==_0x3304d1(0x1c7))&&(_0x35fdf3[_0x3304d1(0x1b6)]={}),{'lockData':_0x165adc,'appLock':_0x35fdf3};}export async function readPageLockFile(_0x445b95){const _0x74fdee=a147_0x2af7;try{const _0x3ab201=await readFile(_0x445b95,_0x74fdee(0x1c5)),_0x130653=JSON[_0x74fdee(0x1ba)](_0x3ab201);return{'apps':_0x130653['apps']&&typeof _0x130653['apps']===_0x74fdee(0x1c7)?_0x130653['apps']:{}};}catch(_0x3cba12){if(_0x3cba12[_0x74fdee(0x1b5)]==='ENOENT')return null;throw new Error(_0x74fdee(0x1b8)+String(_0x3cba12));}}export async function writePageLockFile(_0x9c68d4,_0x435bd1){const _0x15e948=a147_0x2af7;await mkdir(dirname(_0x9c68d4),{'recursive':!![]}),await writeFile(_0x9c68d4,JSON['stringify'](_0x435bd1,null,0x2),_0x15e948(0x1c5));}
1
+ function a147_0x192b(){const _0x51dc93=['ENOENT','798639HwWVaA','stringify','99YlWTyx','object','5294812rDEudr','511YKZVkz','apps','33gBtCwb','lastSync','15342FpkCiX','1930DMyMAt','943404wYvhzM','utf8','149792helNwP','943980SiGTnR','pages','3MlcMYy','552630PuktYT'];a147_0x192b=function(){return _0x51dc93;};return a147_0x192b();}function a147_0x446e(_0x14b925,_0x26521f){_0x14b925=_0x14b925-0x166;const _0x192b40=a147_0x192b();let _0x446eff=_0x192b40[_0x14b925];return _0x446eff;}(function(_0x3bf949,_0x532871){const _0x2ec388=a147_0x446e,_0x16c7da=_0x3bf949();while(!![]){try{const _0x392580=parseInt(_0x2ec388(0x171))/0x1+-parseInt(_0x2ec388(0x16f))/0x2*(parseInt(_0x2ec388(0x16e))/0x3)+parseInt(_0x2ec388(0x175))/0x4+-parseInt(_0x2ec388(0x168))/0x5*(parseInt(_0x2ec388(0x167))/0x6)+parseInt(_0x2ec388(0x176))/0x7*(-parseInt(_0x2ec388(0x16b))/0x8)+parseInt(_0x2ec388(0x173))/0x9*(parseInt(_0x2ec388(0x16c))/0xa)+-parseInt(_0x2ec388(0x178))/0xb*(-parseInt(_0x2ec388(0x169))/0xc);if(_0x392580===_0x532871)break;else _0x16c7da['push'](_0x16c7da['shift']());}catch(_0x242ef5){_0x16c7da['push'](_0x16c7da['shift']());}}}(a147_0x192b,0xbb1c2));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x5317d1,_0x15d435){const _0x151ea2=a147_0x446e,_0x58b34d={'apps':_0x5317d1[_0x151ea2(0x177)]&&typeof _0x5317d1[_0x151ea2(0x177)]===_0x151ea2(0x174)?_0x5317d1[_0x151ea2(0x177)]:{}};let _0x3355df=_0x58b34d[_0x151ea2(0x177)][_0x15d435];if(!_0x3355df)return _0x3355df={'lastSync':'','pages':{}},_0x58b34d['apps'][_0x15d435]=_0x3355df,{'lockData':_0x58b34d,'appLock':_0x3355df};return!_0x3355df[_0x151ea2(0x166)]&&(_0x3355df[_0x151ea2(0x166)]=''),(!_0x3355df[_0x151ea2(0x16d)]||typeof _0x3355df[_0x151ea2(0x16d)]!==_0x151ea2(0x174))&&(_0x3355df['pages']={}),{'lockData':_0x58b34d,'appLock':_0x3355df};}export async function readPageLockFile(_0x4f48f6){const _0x5ebd7b=a147_0x446e;try{const _0x2343f1=await readFile(_0x4f48f6,_0x5ebd7b(0x16a)),_0x27d8ba=JSON['parse'](_0x2343f1);return{'apps':_0x27d8ba[_0x5ebd7b(0x177)]&&typeof _0x27d8ba[_0x5ebd7b(0x177)]==='object'?_0x27d8ba[_0x5ebd7b(0x177)]:{}};}catch(_0x47ad10){if(_0x47ad10['code']===_0x5ebd7b(0x170))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x47ad10));}}export async function writePageLockFile(_0xb8f973,_0x137d62){const _0xf3552b=a147_0x446e;await mkdir(dirname(_0xb8f973),{'recursive':!![]}),await writeFile(_0xb8f973,JSON[_0xf3552b(0x172)](_0x137d62,null,0x2),_0xf3552b(0x16a));}
@@ -1 +1 @@
1
- const a149_0x91466=a149_0x52e6;function a149_0x52e6(_0x50d6ab,_0x57f86b){_0x50d6ab=_0x50d6ab-0x165;const _0x174a29=a149_0x174a();let _0x52e678=_0x174a29[_0x50d6ab];return _0x52e678;}function a149_0x174a(){const _0x521f36=['3545610KsFEbM','7YoPwSs','24CuaYMZ','1156982CpoOlh','130IMTpSW','1215608ERIuWq','2693709JsydSO','.rabetbase','1497744FiJQHw','9183210hOGGJM','423365CyTlne'];a149_0x174a=function(){return _0x521f36;};return a149_0x174a();}(function(_0x5edc53,_0x442afb){const _0x99e03f=a149_0x52e6,_0x4290d6=_0x5edc53();while(!![]){try{const _0x12669c=-parseInt(_0x99e03f(0x16d))/0x1+parseInt(_0x99e03f(0x168))/0x2+-parseInt(_0x99e03f(0x165))/0x3+-parseInt(_0x99e03f(0x167))/0x4*(-parseInt(_0x99e03f(0x16f))/0x5)+-parseInt(_0x99e03f(0x16e))/0x6+-parseInt(_0x99e03f(0x166))/0x7*(-parseInt(_0x99e03f(0x16a))/0x8)+parseInt(_0x99e03f(0x16b))/0x9*(parseInt(_0x99e03f(0x169))/0xa);if(_0x12669c===_0x442afb)break;else _0x4290d6['push'](_0x4290d6['shift']());}catch(_0x370ac8){_0x4290d6['push'](_0x4290d6['shift']());}}}(a149_0x174a,0xe06cc));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a149_0x91466(0x16c),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x21d4e8,_0x360ec1){const _0x53a12c=resolve(_0x360ec1??findProjectRootDirectory()),_0x38b4b1=DOT_DIR+'/sql',_0x2a27b2=_0x38b4b1+'/'+_0x21d4e8;return{'projectRoot':_0x53a12c,'appCode':_0x21d4e8,'sqlWorkspaceRoot':_0x38b4b1,'sqlRoot':_0x2a27b2,'sqlRootDir':resolve(_0x53a12c,DOT_DIR,'sql',_0x21d4e8),'lockFilePath':resolve(_0x53a12c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x53a12c,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a149_0x2f2389=a149_0x4571;function a149_0x853b(){const _0x2dc30b=['70173eakFTz','/sql','28ZCwJrG','56OaGlzz','227916lkXlzJ','sql.lock.json','9553632KXOwgx','6813640wGMLqC','1498pteScP','52073YAbHYK','407605Uwejeh','9708iUqtdK','1573NtKJlj','sql-trash','9qZVaPd'];a149_0x853b=function(){return _0x2dc30b;};return a149_0x853b();}(function(_0x3ccfe4,_0x15f7b1){const _0xccee1c=a149_0x4571,_0x41f696=_0x3ccfe4();while(!![]){try{const _0x3ae39b=parseInt(_0xccee1c(0xc4))/0x1*(parseInt(_0xccee1c(0xcc))/0x2)+-parseInt(_0xccee1c(0xca))/0x3+parseInt(_0xccee1c(0xcd))/0x4*(parseInt(_0xccee1c(0xc5))/0x5)+-parseInt(_0xccee1c(0xc6))/0x6*(parseInt(_0xccee1c(0xc3))/0x7)+parseInt(_0xccee1c(0xd0))/0x8+parseInt(_0xccee1c(0xc9))/0x9*(parseInt(_0xccee1c(0xd1))/0xa)+-parseInt(_0xccee1c(0xc7))/0xb*(parseInt(_0xccee1c(0xce))/0xc);if(_0x3ae39b===_0x15f7b1)break;else _0x41f696['push'](_0x41f696['shift']());}catch(_0x1fc0e0){_0x41f696['push'](_0x41f696['shift']());}}}(a149_0x853b,0xa1312));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a149_0x4571(_0x2068c4,_0x2197cf){_0x2068c4=_0x2068c4-0xc3;const _0x853b89=a149_0x853b();let _0x45711c=_0x853b89[_0x2068c4];return _0x45711c;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a149_0x2f2389(0xcf),TRASH_DIR_NAME=a149_0x2f2389(0xc8);export function loadSqlProjectConfig(_0x5abcc4,_0x59e473){const _0x5b03bd=a149_0x2f2389,_0x3b0a7e=resolve(_0x59e473??findProjectRootDirectory()),_0x53dfed=DOT_DIR+_0x5b03bd(0xcb),_0x5d69e6=_0x53dfed+'/'+_0x5abcc4;return{'projectRoot':_0x3b0a7e,'appCode':_0x5abcc4,'sqlWorkspaceRoot':_0x53dfed,'sqlRoot':_0x5d69e6,'sqlRootDir':resolve(_0x3b0a7e,DOT_DIR,'sql',_0x5abcc4),'lockFilePath':resolve(_0x3b0a7e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3b0a7e,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x149a03,_0x193ae8){const _0x294038=a150_0x2d46,_0x2848c3=_0x149a03();while(!![]){try{const _0x536150=parseInt(_0x294038(0xcf))/0x1+-parseInt(_0x294038(0xe5))/0x2*(-parseInt(_0x294038(0xea))/0x3)+parseInt(_0x294038(0xe8))/0x4*(-parseInt(_0x294038(0xdb))/0x5)+parseInt(_0x294038(0xe2))/0x6*(-parseInt(_0x294038(0xec))/0x7)+parseInt(_0x294038(0xdd))/0x8+parseInt(_0x294038(0xd9))/0x9+parseInt(_0x294038(0xd0))/0xa*(-parseInt(_0x294038(0xd5))/0xb);if(_0x536150===_0x193ae8)break;else _0x2848c3['push'](_0x2848c3['shift']());}catch(_0x5e75ac){_0x2848c3['push'](_0x2848c3['shift']());}}}(a150_0x4713,0x22d44));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x37afe0){const _0x282678=a150_0x2d46;if(_0x37afe0==='.sql')return _0x282678(0xd6);if(_0x37afe0==='.xml')return _0x282678(0xe3);return undefined;}async function scanSqlFilesRecursively(_0x3c7a89,_0x2df164){const _0x213275=a150_0x2d46,_0x3c2dd1=[];try{const _0xb02c32=await readdir(_0x3c7a89,{'withFileTypes':!![]});for(const _0x90176a of _0xb02c32){const _0x4bc3f6=join(_0x3c7a89,_0x90176a[_0x213275(0xd8)]);if(_0x90176a[_0x213275(0xd4)]()){_0x3c2dd1[_0x213275(0xda)](...await scanSqlFilesRecursively(_0x4bc3f6,_0x2df164));continue;}if(!_0x90176a['isFile']())continue;const _0x2ac4c4=extname(_0x90176a['name'])[_0x213275(0xce)](),_0x5be6f=extensionToMode(_0x2ac4c4);if(!_0x5be6f)continue;const _0x54615e=relative(_0x2df164,_0x4bc3f6)[_0x213275(0xd1)](/\\/g,'/'),_0x4db36a=_0x54615e[_0x213275(0xe0)]('/')[_0x213275(0xe6)](Boolean),_0x3ccd9a=parseSqlPath(_0x4db36a,_0x90176a[_0x213275(0xd8)],_0x2ac4c4);if(!_0x3ccd9a)continue;_0x3c2dd1[_0x213275(0xda)]({'sqlCode':_0x3ccd9a[_0x213275(0xe9)],'sqlName':_0x3ccd9a[_0x213275(0xdc)],'dbDirectory':_0x4db36a[0x0],'filePath':_0x4bc3f6,'relativePath':_0x54615e,'lockKey':_0x3ccd9a['sqlCode'],'mode':_0x5be6f});}}catch(_0x7cf540){if(_0x7cf540[_0x213275(0xe7)]!=='ENOENT')throw _0x7cf540;}return _0x3c2dd1;}export async function scanLocalSqlQueries(_0x324cb0){const _0x48c479=a150_0x2d46;return scanSqlFilesRecursively(_0x324cb0['sqlRootDir'],_0x324cb0[_0x48c479(0xd3)]);}function a150_0x4713(){const _0x435edf=['4GOjjVN','sqlCode','2358OMHTIW','path','7VMfCUZ','toLowerCase','120821WqkeHb','1550AWniCb','replace','dbId','sqlRootDir','isDirectory','12441DjhQEN','sql','slice','name','1725030LlmOYM','push','1047715KpCkeG','sqlName','2152416LBNPhG','length','indexOf','split','dbName','1328718FeJZHN','mybatisXml','test','426ofGibG','filter','code'];a150_0x4713=function(){return _0x435edf;};return a150_0x4713();}export function resolveLocalSqlFilePath(_0x24f897,_0x4acc85,_0x22f923){const _0x4c55c9=a150_0x2d46,_0x41e98a=_0x22f923?.[_0x4c55c9(0xeb)]||(_0x22f923?.[_0x4c55c9(0xdc)]||_0x22f923?.[_0x4c55c9(0xe1)]?buildSqlRelativePath(_0x4acc85,_0x22f923?.[_0x4c55c9(0xdc)],_0x22f923?.['dbName'],_0x22f923?.['mode']||_0x4c55c9(0xd6),_0x22f923?.[_0x4c55c9(0xd2)]):buildDefaultSqlFileName(_0x4acc85,_0x22f923?.['mode']||'sql'));return join(_0x24f897[_0x4c55c9(0xd3)],_0x41e98a);}function a150_0x2d46(_0x5ae5f2,_0xe84793){_0x5ae5f2=_0x5ae5f2-0xce;const _0x4713e5=a150_0x4713();let _0x2d462c=_0x4713e5[_0x5ae5f2];return _0x2d462c;}export async function directoryExists(_0x2717d1){try{const _0x503b0b=await stat(_0x2717d1);return _0x503b0b['isDirectory']();}catch{return![];}}function parseSqlPath(_0x32ed30,_0x595b5b,_0x5dfd75){const _0x447eec=a150_0x2d46,_0x555f88=_0x595b5b[_0x447eec(0xd7)](0x0,-_0x5dfd75[_0x447eec(0xde)]);if(_0x32ed30[_0x447eec(0xde)]<0x2)return null;const _0xcd49b1=_0x555f88[_0x447eec(0xdf)]('_');if(_0xcd49b1<=0x0||_0xcd49b1>=_0x555f88['length']-0x1)return null;const _0x4bdd9d=_0x555f88[_0x447eec(0xd7)](0x0,_0xcd49b1);if(!isLikelySqlCode(_0x4bdd9d))return null;return{'sqlCode':_0x4bdd9d,'sqlName':_0x555f88[_0x447eec(0xd7)](_0xcd49b1+0x1)};}function isLikelySqlCode(_0x15d15d){const _0x598b6b=a150_0x2d46;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x598b6b(0xe4)](_0x15d15d);}
1
+ (function(_0x1b5302,_0x39d280){const _0x307c72=a150_0x1f1d,_0x2c955d=_0x1b5302();while(!![]){try{const _0x39fbc4=-parseInt(_0x307c72(0x1e9))/0x1+-parseInt(_0x307c72(0x1e3))/0x2*(parseInt(_0x307c72(0x1f2))/0x3)+parseInt(_0x307c72(0x1ff))/0x4+-parseInt(_0x307c72(0x1e7))/0x5+parseInt(_0x307c72(0x1eb))/0x6*(parseInt(_0x307c72(0x1f3))/0x7)+-parseInt(_0x307c72(0x1f8))/0x8*(parseInt(_0x307c72(0x1e4))/0x9)+parseInt(_0x307c72(0x1e5))/0xa;if(_0x39fbc4===_0x39d280)break;else _0x2c955d['push'](_0x2c955d['shift']());}catch(_0x5f4fa0){_0x2c955d['push'](_0x2c955d['shift']());}}}(a150_0x299a,0xc482e));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x74b378){const _0x12c48b=a150_0x1f1d;if(_0x74b378==='.sql')return _0x12c48b(0x1ea);if(_0x74b378===_0x12c48b(0x1f9))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x174793,_0x33ccba){const _0x451c92=a150_0x1f1d,_0x43366b=[];try{const _0x5e5c47=await readdir(_0x174793,{'withFileTypes':!![]});for(const _0x5a53c6 of _0x5e5c47){const _0x45a1b3=join(_0x174793,_0x5a53c6[_0x451c92(0x1fe)]);if(_0x5a53c6[_0x451c92(0x1e0)]()){_0x43366b[_0x451c92(0x1e2)](...await scanSqlFilesRecursively(_0x45a1b3,_0x33ccba));continue;}if(!_0x5a53c6[_0x451c92(0x1f0)]())continue;const _0x1a2454=extname(_0x5a53c6[_0x451c92(0x1fe)])[_0x451c92(0x1f6)](),_0x2f48e3=extensionToMode(_0x1a2454);if(!_0x2f48e3)continue;const _0x2869fa=relative(_0x33ccba,_0x45a1b3)[_0x451c92(0x1ef)](/\\/g,'/'),_0x1b38f4=_0x2869fa[_0x451c92(0x1e1)]('/')[_0x451c92(0x1ed)](Boolean),_0x4f3b5c=parseSqlPath(_0x1b38f4,_0x5a53c6[_0x451c92(0x1fe)],_0x1a2454);if(!_0x4f3b5c)continue;_0x43366b[_0x451c92(0x1e2)]({'sqlCode':_0x4f3b5c[_0x451c92(0x1fd)],'sqlName':_0x4f3b5c['sqlName'],'dbDirectory':_0x1b38f4[0x0],'filePath':_0x45a1b3,'relativePath':_0x2869fa,'lockKey':_0x4f3b5c[_0x451c92(0x1fd)],'mode':_0x2f48e3});}}catch(_0x18a24b){if(_0x18a24b[_0x451c92(0x1ec)]!==_0x451c92(0x1fb))throw _0x18a24b;}return _0x43366b;}function a150_0x1f1d(_0x3b264a,_0x262f70){_0x3b264a=_0x3b264a-0x1e0;const _0x299aa5=a150_0x299a();let _0x1f1d0b=_0x299aa5[_0x3b264a];return _0x1f1d0b;}export async function scanLocalSqlQueries(_0xe13e60){const _0x4d01c7=a150_0x1f1d;return scanSqlFilesRecursively(_0xe13e60[_0x4d01c7(0x1ee)],_0xe13e60[_0x4d01c7(0x1ee)]);}export function resolveLocalSqlFilePath(_0x42b99d,_0x2e1e2e,_0x9cc79a){const _0x19f7a4=a150_0x1f1d,_0x4172a7=_0x9cc79a?.['path']||(_0x9cc79a?.[_0x19f7a4(0x1fa)]||_0x9cc79a?.[_0x19f7a4(0x1f7)]?buildSqlRelativePath(_0x2e1e2e,_0x9cc79a?.['sqlName'],_0x9cc79a?.['dbName'],_0x9cc79a?.[_0x19f7a4(0x1f1)]||_0x19f7a4(0x1ea),_0x9cc79a?.[_0x19f7a4(0x1f5)]):buildDefaultSqlFileName(_0x2e1e2e,_0x9cc79a?.['mode']||'sql'));return join(_0x42b99d['sqlRootDir'],_0x4172a7);}export async function directoryExists(_0x57ef98){const _0x533ca1=a150_0x1f1d;try{const _0x54df5d=await stat(_0x57ef98);return _0x54df5d[_0x533ca1(0x1e0)]();}catch{return![];}}function parseSqlPath(_0x3c3143,_0x90885f,_0x527b26){const _0x2e0e09=a150_0x1f1d,_0x4aa6c2=_0x90885f[_0x2e0e09(0x1e8)](0x0,-_0x527b26['length']);if(_0x3c3143[_0x2e0e09(0x1fc)]<0x2)return null;const _0x2ac053=_0x4aa6c2[_0x2e0e09(0x1f4)]('_');if(_0x2ac053<=0x0||_0x2ac053>=_0x4aa6c2[_0x2e0e09(0x1fc)]-0x1)return null;const _0x2a1c5b=_0x4aa6c2[_0x2e0e09(0x1e8)](0x0,_0x2ac053);if(!isLikelySqlCode(_0x2a1c5b))return null;return{'sqlCode':_0x2a1c5b,'sqlName':_0x4aa6c2[_0x2e0e09(0x1e8)](_0x2ac053+0x1)};}function a150_0x299a(){const _0x325e9c=['279ZaBUZb','31423JAzUWP','indexOf','dbId','toLowerCase','dbName','16BKZpEG','.xml','sqlName','ENOENT','length','sqlCode','name','1279220PHewgD','isDirectory','split','push','21214Lsuush','2688462TtLQfR','37190540JRPbKf','test','3288505PWCOfR','slice','1185388Nxipyt','sql','258QLdUUa','code','filter','sqlRootDir','replace','isFile','mode'];a150_0x299a=function(){return _0x325e9c;};return a150_0x299a();}function isLikelySqlCode(_0xd4b544){const _0x2913d5=a150_0x1f1d;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2913d5(0x1e6)](_0xd4b544);}
@@ -1 +1 @@
1
- (function(_0x38855b,_0xc2db76){const _0x2666be=a151_0x59e2,_0x36b691=_0x38855b();while(!![]){try{const _0x1013c7=-parseInt(_0x2666be(0x130))/0x1*(-parseInt(_0x2666be(0x135))/0x2)+parseInt(_0x2666be(0x131))/0x3*(-parseInt(_0x2666be(0x12d))/0x4)+-parseInt(_0x2666be(0x139))/0x5+parseInt(_0x2666be(0x12b))/0x6*(-parseInt(_0x2666be(0x134))/0x7)+parseInt(_0x2666be(0x133))/0x8*(-parseInt(_0x2666be(0x132))/0x9)+parseInt(_0x2666be(0x13b))/0xa+parseInt(_0x2666be(0x137))/0xb*(parseInt(_0x2666be(0x12e))/0xc);if(_0x1013c7===_0xc2db76)break;else _0x36b691['push'](_0x36b691['shift']());}catch(_0x4d5ebd){_0x36b691['push'](_0x36b691['shift']());}}}(a151_0x5713,0x5d8cc));import{readFile}from'node:fs/promises';import a151_0x3026d8 from'node:crypto';function a151_0x5713(){const _0x323630=['md5','77hynmqR','update','3598950Nkghod','createHash','4191860GGTcCi','282sljNKV','digest','28ZcEnId','1254936pXjTqh','hex','755917ciEenY','310314uDlCwr','459rXVBdN','144AyBgWr','11795zMBBET','2NCkzef'];a151_0x5713=function(){return _0x323630;};return a151_0x5713();}function a151_0x59e2(_0xc264b6,_0x181075){_0xc264b6=_0xc264b6-0x12b;const _0x57135d=a151_0x5713();let _0x59e23b=_0x57135d[_0xc264b6];return _0x59e23b;}export function computeSqlContentHash(_0x1cc2a0){const _0x553ab6=a151_0x59e2;return a151_0x3026d8[_0x553ab6(0x13a)](_0x553ab6(0x136))[_0x553ab6(0x138)](_0x1cc2a0)[_0x553ab6(0x12c)](_0x553ab6(0x12f));}export async function computeSqlFileHash(_0x4c7237){const _0x1a09f5=await readFile(_0x4c7237,'utf8');return computeSqlContentHash(_0x1a09f5);}
1
+ (function(_0x5e6056,_0x1fa1bd){const _0x13313f=a151_0x21e3,_0x4d7a8b=_0x5e6056();while(!![]){try{const _0x2db066=parseInt(_0x13313f(0x142))/0x1+parseInt(_0x13313f(0x13a))/0x2+-parseInt(_0x13313f(0x13d))/0x3*(parseInt(_0x13313f(0x141))/0x4)+parseInt(_0x13313f(0x143))/0x5+-parseInt(_0x13313f(0x13e))/0x6+-parseInt(_0x13313f(0x13b))/0x7+parseInt(_0x13313f(0x13f))/0x8;if(_0x2db066===_0x1fa1bd)break;else _0x4d7a8b['push'](_0x4d7a8b['shift']());}catch(_0x29900e){_0x4d7a8b['push'](_0x4d7a8b['shift']());}}}(a151_0x2660,0xc9688));import{readFile}from'node:fs/promises';function a151_0x21e3(_0x1b403c,_0x5a00b4){_0x1b403c=_0x1b403c-0x138;const _0x266020=a151_0x2660();let _0x21e3f0=_0x266020[_0x1b403c];return _0x21e3f0;}import a151_0x537ded from'node:crypto';export function computeSqlContentHash(_0x7d5742){const _0x4a9299=a151_0x21e3;return a151_0x537ded[_0x4a9299(0x139)]('md5')['update'](_0x7d5742)[_0x4a9299(0x13c)](_0x4a9299(0x138));}function a151_0x2660(){const _0x8a69f2=['utf8','4180yvNXtv','582103qDUQZm','2241705YIufzL','hex','createHash','3194976bZXUNd','7331667GbCDkT','digest','3972XqOaHF','7620096CzpsXA','15184104nnIzER'];a151_0x2660=function(){return _0x8a69f2;};return a151_0x2660();}export async function computeSqlFileHash(_0x3d89d3){const _0x2dd804=a151_0x21e3,_0x27972f=await readFile(_0x3d89d3,_0x2dd804(0x140));return computeSqlContentHash(_0x27972f);}
@@ -1 +1 @@
1
- (function(_0x4ca3b6,_0x5b4ffa){const _0x34e2b5=a152_0x4c4e,_0x5e3266=_0x4ca3b6();while(!![]){try{const _0x2634f1=-parseInt(_0x34e2b5(0xbf))/0x1+-parseInt(_0x34e2b5(0xc7))/0x2*(parseInt(_0x34e2b5(0xc5))/0x3)+-parseInt(_0x34e2b5(0xb7))/0x4*(-parseInt(_0x34e2b5(0xbe))/0x5)+-parseInt(_0x34e2b5(0xc4))/0x6+-parseInt(_0x34e2b5(0xc6))/0x7+parseInt(_0x34e2b5(0xb8))/0x8*(-parseInt(_0x34e2b5(0xbc))/0x9)+-parseInt(_0x34e2b5(0xc3))/0xa*(-parseInt(_0x34e2b5(0xbb))/0xb);if(_0x2634f1===_0x5b4ffa)break;else _0x5e3266['push'](_0x5e3266['shift']());}catch(_0x1202d1){_0x5e3266['push'](_0x5e3266['shift']());}}}(a152_0x1d66,0x5e890));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a152_0x4c4e(_0x42be10,_0x3d2012){_0x42be10=_0x42be10-0xb7;const _0x1d6691=a152_0x1d66();let _0x4c4e81=_0x1d6691[_0x42be10];return _0x4c4e81;}export function ensureSqlLockScope(_0x248225,_0x20fa1a,_0x5adf28,_0x4f7dc8){const _0x50c9a5=a152_0x4c4e,_0x54422b=_0x248225??createEmptySqlLock();let _0xa49743=_0x54422b['apps'][_0x20fa1a];if(!_0xa49743)return _0xa49743={'sqlRoot':_0x5adf28,'lastSync':'','sqls':{}},_0x54422b['apps'][_0x20fa1a]=_0xa49743,{'lockData':_0x54422b,'appLock':_0xa49743};if(!_0xa49743[_0x50c9a5(0xc1)])_0xa49743[_0x50c9a5(0xc1)]=_0x5adf28;else{if(_0xa49743[_0x50c9a5(0xc1)]!==_0x5adf28)throw new Error(_0x4f7dc8+_0x50c9a5(0xc0)+_0x5adf28+'\x22\x20vs\x20lock\x20\x22'+_0xa49743['sqlRoot']+'\x22.\x20'+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0xa49743[_0x50c9a5(0xc2)]&&(_0xa49743[_0x50c9a5(0xc2)]={}),!_0xa49743['lastSync']&&(_0xa49743[_0x50c9a5(0xb9)]=''),{'lockData':_0x54422b,'appLock':_0xa49743};}export async function readSqlLockFile(_0x1ddd58){const _0x548fdb=a152_0x4c4e;try{const _0xbc042b=await readFile(_0x1ddd58,'utf8');return JSON[_0x548fdb(0xc8)](_0xbc042b);}catch(_0x303c3b){if(_0x303c3b[_0x548fdb(0xbd)]===_0x548fdb(0xba))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x303c3b));}}export async function writeSqlLockFile(_0x481554,_0x315dbf){const _0x3b65ce=a152_0x4c4e;await mkdir(dirname(_0x481554),{'recursive':!![]}),await writeFile(_0x481554,JSON[_0x3b65ce(0xc9)](_0x315dbf,null,0x2),_0x3b65ce(0xca));}function a152_0x1d66(){const _0x244116=['utf8','20kvByAE','1109288drOQkU','lastSync','ENOENT','11LPFhxJ','9WaSPFO','code','212540xKAXHq','669299EHwUVq',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','sqlRoot','sqls','22615130WcrFAq','314256Eyfuij','1689kQsVGT','4786383XxefOF','1928KgbRAb','parse','stringify'];a152_0x1d66=function(){return _0x244116;};return a152_0x1d66();}
1
+ (function(_0x17747d,_0x3f1666){const _0x2fe299=a152_0x5aa9,_0x539acd=_0x17747d();while(!![]){try{const _0x142057=parseInt(_0x2fe299(0xa8))/0x1*(-parseInt(_0x2fe299(0xb6))/0x2)+-parseInt(_0x2fe299(0xac))/0x3+-parseInt(_0x2fe299(0xb1))/0x4*(parseInt(_0x2fe299(0xb0))/0x5)+-parseInt(_0x2fe299(0xb5))/0x6*(-parseInt(_0x2fe299(0xab))/0x7)+-parseInt(_0x2fe299(0xaa))/0x8+-parseInt(_0x2fe299(0xb7))/0x9*(-parseInt(_0x2fe299(0xa6))/0xa)+parseInt(_0x2fe299(0xb4))/0xb;if(_0x142057===_0x3f1666)break;else _0x539acd['push'](_0x539acd['shift']());}catch(_0x23780d){_0x539acd['push'](_0x539acd['shift']());}}}(a152_0x4ad9,0xc1b13));function a152_0x5aa9(_0x1b71f2,_0x509a32){_0x1b71f2=_0x1b71f2-0xa3;const _0x4ad912=a152_0x4ad9();let _0x5aa987=_0x4ad912[_0x1b71f2];return _0x5aa987;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x14b797,_0x451b0d,_0x206fd6,_0x159f84){const _0x15e40a=a152_0x5aa9,_0x5a1b51=_0x14b797??createEmptySqlLock();let _0x4897b2=_0x5a1b51['apps'][_0x451b0d];if(!_0x4897b2)return _0x4897b2={'sqlRoot':_0x206fd6,'lastSync':'','sqls':{}},_0x5a1b51[_0x15e40a(0xb8)][_0x451b0d]=_0x4897b2,{'lockData':_0x5a1b51,'appLock':_0x4897b2};if(!_0x4897b2['sqlRoot'])_0x4897b2[_0x15e40a(0xb2)]=_0x206fd6;else{if(_0x4897b2[_0x15e40a(0xb2)]!==_0x206fd6)throw new Error(_0x159f84+_0x15e40a(0xa3)+_0x206fd6+_0x15e40a(0xad)+_0x4897b2[_0x15e40a(0xb2)]+_0x15e40a(0xb9)+_0x15e40a(0xae));}return!_0x4897b2['sqls']&&(_0x4897b2[_0x15e40a(0xaf)]={}),!_0x4897b2['lastSync']&&(_0x4897b2[_0x15e40a(0xa9)]=''),{'lockData':_0x5a1b51,'appLock':_0x4897b2};}export async function readSqlLockFile(_0x396f4e){const _0x4f7d49=a152_0x5aa9;try{const _0x3c1474=await readFile(_0x396f4e,_0x4f7d49(0xa5));return JSON[_0x4f7d49(0xb3)](_0x3c1474);}catch(_0x4d185d){if(_0x4d185d[_0x4f7d49(0xa7)]===_0x4f7d49(0xa4))return null;throw new Error(_0x4f7d49(0xba)+String(_0x4d185d));}}function a152_0x4ad9(){const _0x449db5=['3614895aFLMqg','\x22\x20vs\x20lock\x20\x22','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','sqls','2773415tDlIZj','4mOQBhv','sqlRoot','parse','17906856uNStOo','1230FsRCtf','1659984HAwVvw','117UaiYTi','apps','\x22.\x20','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','ENOENT','utf8','611790iejZHZ','code','1SrMfaI','lastSync','123240iuPbDd','33299FHTUGp'];a152_0x4ad9=function(){return _0x449db5;};return a152_0x4ad9();}export async function writeSqlLockFile(_0x26b3c4,_0x225b04){await mkdir(dirname(_0x26b3c4),{'recursive':!![]}),await writeFile(_0x26b3c4,JSON['stringify'](_0x225b04,null,0x2),'utf8');}
@@ -1 +1 @@
1
- (function(_0x56ae09,_0x5dd8e9){const _0xd1e598=a154_0x594b,_0x47340b=_0x56ae09();while(!![]){try{const _0x547805=parseInt(_0xd1e598(0x19c))/0x1+parseInt(_0xd1e598(0x19a))/0x2+-parseInt(_0xd1e598(0x196))/0x3*(parseInt(_0xd1e598(0x19f))/0x4)+-parseInt(_0xd1e598(0x1a2))/0x5+-parseInt(_0xd1e598(0x194))/0x6+parseInt(_0xd1e598(0x19d))/0x7+-parseInt(_0xd1e598(0x1a1))/0x8;if(_0x547805===_0x5dd8e9)break;else _0x47340b['push'](_0x47340b['shift']());}catch(_0x4bdd53){_0x47340b['push'](_0x47340b['shift']());}}}(a154_0x2622,0xcde19));export function detectSqlMode(_0x21a66f){const _0x123c2c=a154_0x594b,_0x9ef429=_0x21a66f[_0x123c2c(0x1a4)]();if(/^<(select|insert|update|delete)\b/i[_0x123c2c(0x19e)](_0x9ef429))return _0x123c2c(0x198);return _0x123c2c(0x195);}function a154_0x2622(){const _0x4369d9=['mybatisXml','trim','49530yCNRQa','replace','1110000UViGZg','7349615ZlgShJ','test','83096PtLzUy','unknown-sql','1760208tmXnUP','2594940whfAld','db-','trimStart','unknown-db','3365154RPLYex','sql','6aUricf','.sql'];a154_0x2622=function(){return _0x4369d9;};return a154_0x2622();}export function getSqlFileExtension(_0x155692){const _0x6e29b1=a154_0x594b;return _0x155692===_0x6e29b1(0x198)?'.xml':_0x6e29b1(0x197);}export function buildDefaultSqlFileName(_0x29b696,_0x15bd3b){return''+_0x29b696+getSqlFileExtension(_0x15bd3b);}export function sanitizeSqlPathSegment(_0x578892,_0x59ddbf){const _0x56d0a5=a154_0x594b,_0x4ea31c=String(_0x578892??'')[_0x56d0a5(0x199)](),_0xe76a21=_0x4ea31c['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x56d0a5(0x19b)](/-+/g,'-')[_0x56d0a5(0x19b)](/^\.+/,'')['replace'](/\.+$/,'')[_0x56d0a5(0x19b)](/^-+/,'')[_0x56d0a5(0x19b)](/-+$/,'');return _0xe76a21||_0x59ddbf;}function a154_0x594b(_0x4f6451,_0x4718a9){_0x4f6451=_0x4f6451-0x193;const _0x262226=a154_0x2622();let _0x594b08=_0x262226[_0x4f6451];return _0x594b08;}export function buildDbDirectoryName(_0x3c8465,_0x2dd221){const _0x51bb4c=a154_0x594b;return sanitizeSqlPathSegment(_0x3c8465,_0x2dd221!=null?_0x51bb4c(0x1a3)+_0x2dd221:_0x51bb4c(0x193));}export function buildSqlRelativePath(_0x4435a5,_0x3d1308,_0x3f805d,_0xba5547,_0x3fd3bc){const _0x20b67d=a154_0x594b,_0x14c810=buildDbDirectoryName(_0x3f805d,_0x3fd3bc),_0xf1d090=sanitizeSqlPathSegment(_0x4435a5,_0x20b67d(0x1a0)),_0x88265a=sanitizeSqlPathSegment(_0x3d1308,_0xf1d090);return _0x14c810+'/'+_0xf1d090+'_'+_0x88265a+getSqlFileExtension(_0xba5547);}
1
+ (function(_0x1ae72c,_0x3262aa){const _0x4b0ab8=a154_0x254f,_0x3321ae=_0x1ae72c();while(!![]){try{const _0x2371e0=parseInt(_0x4b0ab8(0x1e9))/0x1*(parseInt(_0x4b0ab8(0x1e7))/0x2)+-parseInt(_0x4b0ab8(0x1ec))/0x3*(-parseInt(_0x4b0ab8(0x1ed))/0x4)+parseInt(_0x4b0ab8(0x1e1))/0x5*(parseInt(_0x4b0ab8(0x1df))/0x6)+parseInt(_0x4b0ab8(0x1e8))/0x7+parseInt(_0x4b0ab8(0x1f0))/0x8+parseInt(_0x4b0ab8(0x1ef))/0x9+parseInt(_0x4b0ab8(0x1dd))/0xa*(-parseInt(_0x4b0ab8(0x1eb))/0xb);if(_0x2371e0===_0x3262aa)break;else _0x3321ae['push'](_0x3321ae['shift']());}catch(_0x5ac9b4){_0x3321ae['push'](_0x3321ae['shift']());}}}(a154_0x521b,0x97e3d));export function detectSqlMode(_0x13b294){const _0x133dbd=a154_0x254f,_0x2b77c9=_0x13b294['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x133dbd(0x1ea)](_0x2b77c9))return _0x133dbd(0x1e5);return'sql';}export function getSqlFileExtension(_0x2c5189){const _0x522880=a154_0x254f;return _0x2c5189===_0x522880(0x1e5)?_0x522880(0x1de):_0x522880(0x1e2);}function a154_0x254f(_0x138dd5,_0x909c9){_0x138dd5=_0x138dd5-0x1dd;const _0x521be3=a154_0x521b();let _0x254fc4=_0x521be3[_0x138dd5];return _0x254fc4;}export function buildDefaultSqlFileName(_0x458411,_0x7c461d){return''+_0x458411+getSqlFileExtension(_0x7c461d);}function a154_0x521b(){const _0x1bd23b=['10BPJEIO','.xml','18pWHjzC','unknown-sql','43905thstHd','.sql','db-','unknown-db','mybatisXml','replace','1131022rJDOhC','6308848ZNwmGB','1EDkfPe','test','42329265XsXgoX','3PnkxCa','3625164vxKToZ','trim','8397486LGHmpS','9102344OQNejs'];a154_0x521b=function(){return _0x1bd23b;};return a154_0x521b();}export function sanitizeSqlPathSegment(_0x1831d3,_0x4b36bc){const _0x4510be=a154_0x254f,_0x4f32bb=String(_0x1831d3??'')[_0x4510be(0x1ee)](),_0xfc6777=_0x4f32bb[_0x4510be(0x1e6)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x4510be(0x1e6)](/-+/g,'-')['replace'](/^\.+/,'')[_0x4510be(0x1e6)](/\.+$/,'')['replace'](/^-+/,'')[_0x4510be(0x1e6)](/-+$/,'');return _0xfc6777||_0x4b36bc;}export function buildDbDirectoryName(_0x17cdc9,_0x488abf){const _0x17d7df=a154_0x254f;return sanitizeSqlPathSegment(_0x17cdc9,_0x488abf!=null?_0x17d7df(0x1e3)+_0x488abf:_0x17d7df(0x1e4));}export function buildSqlRelativePath(_0x4035fe,_0x1047ed,_0x175f45,_0x1e935b,_0x2c3948){const _0x873322=a154_0x254f,_0x49ccf9=buildDbDirectoryName(_0x175f45,_0x2c3948),_0x165fc6=sanitizeSqlPathSegment(_0x4035fe,_0x873322(0x1e0)),_0x15168d=sanitizeSqlPathSegment(_0x1047ed,_0x165fc6);return _0x49ccf9+'/'+_0x165fc6+'_'+_0x15168d+getSqlFileExtension(_0x1e935b);}
@@ -1 +1 @@
1
- (function(_0x35032f,_0x9ba3cb){const _0xa2d5d9=a155_0x3d83,_0x3a9cf0=_0x35032f();while(!![]){try{const _0x2bc2b3=-parseInt(_0xa2d5d9(0x189))/0x1*(-parseInt(_0xa2d5d9(0x184))/0x2)+-parseInt(_0xa2d5d9(0x177))/0x3*(-parseInt(_0xa2d5d9(0x16c))/0x4)+parseInt(_0xa2d5d9(0x176))/0x5+parseInt(_0xa2d5d9(0x186))/0x6+parseInt(_0xa2d5d9(0x16f))/0x7+parseInt(_0xa2d5d9(0x188))/0x8*(-parseInt(_0xa2d5d9(0x17f))/0x9)+-parseInt(_0xa2d5d9(0x181))/0xa*(parseInt(_0xa2d5d9(0x17a))/0xb);if(_0x2bc2b3===_0x9ba3cb)break;else _0x3a9cf0['push'](_0x3a9cf0['shift']());}catch(_0x56e740){_0x3a9cf0['push'](_0x3a9cf0['shift']());}}}(a155_0x54c3,0x4972a));function a155_0x54c3(){const _0x4074bf=['reason','293026hvlGJR','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','2377350ejLLlN','test','8OiORER','3oYSudQ','isDangerous','add','UPDATE','SELECT','toUpperCase','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','length','DDL','push','4nsSxqi','SQL\x20content\x20is\x20empty','trim','4128215GRjilq','replace','WITH','includes','INSERT','match','unknown\x20table(s)','319070DdvzVH','981957ZXWbWC','startsWith','UNKNOWN','10351121wFaEQy','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','matchAll','type','from','5173101caYsbJ','DELETE','10pSZqer','join'];a155_0x54c3=function(){return _0x4074bf;};return a155_0x54c3();}export function detectSqlType(_0x19ad98){const _0x1a17b1=a155_0x3d83;if(!_0x19ad98?.[_0x1a17b1(0x16e)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x1a17b1(0x16d)};const _0x3a1f1f=_0x19ad98[_0x1a17b1(0x170)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x1a17b1(0x170)](/@[^(\s]+(\([^)]*\))?/g,'')['replace'](/\/\*[\s\S]*?\*\//g,'')[_0x1a17b1(0x16e)](),_0x16c666=_0x3a1f1f['split']('\x0a');let _0x4b7ee1='';for(const _0x1b0218 of _0x16c666){const _0x2d010f=_0x1b0218[_0x1a17b1(0x16e)]();if(!_0x2d010f||_0x2d010f[_0x1a17b1(0x178)]('--')||_0x2d010f[_0x1a17b1(0x178)]('/*'))continue;_0x4b7ee1=_0x2d010f;break;}const _0x543142=_0x4b7ee1[_0x1a17b1(0x167)]();if(_0x543142['startsWith']('SELECT')||_0x543142['startsWith'](_0x1a17b1(0x171))){const _0x5f3007=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x1a17b1(0x187)](_0x3a1f1f);return{'type':_0x1a17b1(0x18d),'isSelectOnly':!_0x5f3007,'isDangerous':_0x5f3007,'reason':_0x5f3007?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x543142[_0x1a17b1(0x178)](_0x1a17b1(0x173)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':![]};if(_0x543142[_0x1a17b1(0x178)](_0x1a17b1(0x18c)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':![]};if(_0x543142[_0x1a17b1(0x178)]('DELETE'))return{'type':_0x1a17b1(0x180),'isSelectOnly':![],'isDangerous':!![],'reason':_0x1a17b1(0x168)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x1a17b1(0x187)](_0x543142))return{'type':_0x1a17b1(0x16a),'isSelectOnly':![],'isDangerous':!![],'reason':_0x1a17b1(0x185)};return{'type':_0x1a17b1(0x179),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x265e2e){const _0xccb192=a155_0x3d83,_0x139e1c=_0x265e2e['replace'](/#\{[^}]*\}/g,'?')[_0xccb192(0x170)](/\$\{[^}]*\}/g,'?')[_0xccb192(0x170)](/'[^']*'/g,'\x27\x27')[_0xccb192(0x170)](/--.*$/gm,'')[_0xccb192(0x170)](/\/\*[\s\S]*?\*\//g,''),_0xa75361=[],_0x4dc687=_0x139e1c[_0xccb192(0x174)](/FROM\s+([^\s,)(]+)/i);if(_0x4dc687?.[0x1])_0xa75361['push'](_0x4dc687[0x1][_0xccb192(0x170)](/[`"]/g,''));for(const _0x4b5cf0 of _0x139e1c['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x5d2403=_0x4b5cf0[0x1]?.[_0xccb192(0x170)](/[`"]/g,'');if(_0x5d2403&&!_0xa75361['includes'](_0x5d2403))_0xa75361[_0xccb192(0x16b)](_0x5d2403);}const _0x5f1e30=_0x139e1c[_0xccb192(0x174)](/INTO\s+([^\s(]+)/i);if(_0x5f1e30?.[0x1]){const _0xdd0daa=_0x5f1e30[0x1]['replace'](/[`"]/g,'');if(!_0xa75361[_0xccb192(0x172)](_0xdd0daa))_0xa75361['push'](_0xdd0daa);}const _0x338da9=_0x139e1c['match'](/UPDATE\s+([^\s,)(]+)/i);if(_0x338da9?.[0x1]){const _0x520f46=_0x338da9[0x1][_0xccb192(0x170)](/[`"]/g,'');if(!_0xa75361[_0xccb192(0x172)](_0x520f46))_0xa75361[_0xccb192(0x16b)](_0x520f46);}return _0xa75361;}function extractParameters(_0x14063d){const _0x3bd4be=a155_0x3d83,_0x3ad26a=new Set();for(const _0x35fe22 of _0x14063d['matchAll'](/#\{(\w+)\}/g))if(_0x35fe22[0x1])_0x3ad26a[_0x3bd4be(0x18b)](_0x35fe22[0x1]);for(const _0x1d7e59 of _0x14063d[_0x3bd4be(0x17c)](/\$\{(\w+)\}/g))if(_0x1d7e59[0x1])_0x3ad26a[_0x3bd4be(0x18b)](_0x1d7e59[0x1]);return Array[_0x3bd4be(0x17e)](_0x3ad26a);}function a155_0x3d83(_0x2b8e12,_0x27df59){_0x2b8e12=_0x2b8e12-0x167;const _0x54c38e=a155_0x54c3();let _0x3d8315=_0x54c38e[_0x2b8e12];return _0x3d8315;}export function validateSql(_0x4fd2c8){const _0x41d846=a155_0x3d83,_0x5e5dba=detectSqlType(_0x4fd2c8),_0x41ca1b=extractTables(_0x4fd2c8),_0x5d4b91=extractParameters(_0x4fd2c8);if(_0x5e5dba[_0x41d846(0x18a)])return{'valid':![],'sqlType':_0x5e5dba,'tables':_0x41ca1b,'parameters':_0x5d4b91,'message':_0x5e5dba[_0x41d846(0x183)]||_0x5e5dba[_0x41d846(0x17d)]+_0x41d846(0x17b)};if(_0x5e5dba[_0x41d846(0x17d)]==='UNKNOWN')return{'valid':![],'sqlType':_0x5e5dba,'tables':_0x41ca1b,'parameters':_0x5d4b91,'message':'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x5e5dba,'tables':_0x41ca1b,'parameters':_0x5d4b91,'message':_0x5e5dba[_0x41d846(0x17d)]+'\x20query\x20targeting\x20'+(_0x41ca1b[_0x41d846(0x169)]?_0x41ca1b[_0x41d846(0x182)](',\x20'):_0x41d846(0x175))+(_0x5d4b91[_0x41d846(0x169)]?'\x20with\x20parameters:\x20'+_0x5d4b91[_0x41d846(0x182)](',\x20'):'')};}
1
+ function a155_0x3d72(){const _0x4b602f=['6410HtnShQ','56424MWhXsH','join','844484nZSXBt','DDL','type','\x20query\x20targeting\x20','split','from','includes','2868525tDZYRQ','UNKNOWN','replace','match','reason','length','\x20with\x20parameters:\x20','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','DELETE','test','85147ZbRsmX','UPDATE','add','matchAll','unknown\x20table(s)','1866GDnxaV','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','INSERT','push','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','205093SiLGRo','SELECT','6HYLiLo','toUpperCase','152WHKvNb','580443AOzhYq','trim','3685sWyvIe','startsWith','10VccQpu'];a155_0x3d72=function(){return _0x4b602f;};return a155_0x3d72();}(function(_0x3dbd07,_0x527a5d){const _0x5ceee2=a155_0x57cb,_0x279582=_0x3dbd07();while(!![]){try{const _0x1e1019=-parseInt(_0x5ceee2(0x129))/0x1*(parseInt(_0x5ceee2(0x135))/0x2)+-parseInt(_0x5ceee2(0x138))/0x3+-parseInt(_0x5ceee2(0x140))/0x4+-parseInt(_0x5ceee2(0x13d))/0x5*(-parseInt(_0x5ceee2(0x12e))/0x6)+-parseInt(_0x5ceee2(0x133))/0x7*(parseInt(_0x5ceee2(0x137))/0x8)+parseInt(_0x5ceee2(0x11f))/0x9*(-parseInt(_0x5ceee2(0x13c))/0xa)+-parseInt(_0x5ceee2(0x13a))/0xb*(-parseInt(_0x5ceee2(0x13e))/0xc);if(_0x1e1019===_0x527a5d)break;else _0x279582['push'](_0x279582['shift']());}catch(_0x4158db){_0x279582['push'](_0x279582['shift']());}}}(a155_0x3d72,0x6b097));function a155_0x57cb(_0x322840,_0x24a0aa){_0x322840=_0x322840-0x11a;const _0x3d728=a155_0x3d72();let _0x57cb91=_0x3d728[_0x322840];return _0x57cb91;}export function detectSqlType(_0x418f15){const _0x2bdae3=a155_0x57cb;if(!_0x418f15?.[_0x2bdae3(0x139)]())return{'type':_0x2bdae3(0x120),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0xaec41a=_0x418f15[_0x2bdae3(0x121)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x2bdae3(0x121)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2bdae3(0x121)](/\/\*[\s\S]*?\*\//g,'')[_0x2bdae3(0x139)](),_0x15ea47=_0xaec41a[_0x2bdae3(0x11c)]('\x0a');let _0x23f76b='';for(const _0x2b880b of _0x15ea47){const _0x131595=_0x2b880b[_0x2bdae3(0x139)]();if(!_0x131595||_0x131595[_0x2bdae3(0x13b)]('--')||_0x131595[_0x2bdae3(0x13b)]('/*'))continue;_0x23f76b=_0x131595;break;}const _0x1f1af9=_0x23f76b[_0x2bdae3(0x136)]();if(_0x1f1af9[_0x2bdae3(0x13b)](_0x2bdae3(0x134))||_0x1f1af9['startsWith']('WITH')){const _0x16efba=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2bdae3(0x128)](_0xaec41a);return{'type':_0x2bdae3(0x134),'isSelectOnly':!_0x16efba,'isDangerous':_0x16efba,'reason':_0x16efba?_0x2bdae3(0x132):undefined};}if(_0x1f1af9[_0x2bdae3(0x13b)]('INSERT'))return{'type':_0x2bdae3(0x130),'isSelectOnly':![],'isDangerous':![]};if(_0x1f1af9[_0x2bdae3(0x13b)](_0x2bdae3(0x12a)))return{'type':_0x2bdae3(0x12a),'isSelectOnly':![],'isDangerous':![]};if(_0x1f1af9[_0x2bdae3(0x13b)](_0x2bdae3(0x127)))return{'type':_0x2bdae3(0x127),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x2bdae3(0x128)](_0x1f1af9))return{'type':_0x2bdae3(0x141),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2bdae3(0x12f)};return{'type':_0x2bdae3(0x120),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x39d643){const _0x34bd5b=a155_0x57cb,_0xee480=_0x39d643[_0x34bd5b(0x121)](/#\{[^}]*\}/g,'?')[_0x34bd5b(0x121)](/\$\{[^}]*\}/g,'?')[_0x34bd5b(0x121)](/'[^']*'/g,'\x27\x27')[_0x34bd5b(0x121)](/--.*$/gm,'')[_0x34bd5b(0x121)](/\/\*[\s\S]*?\*\//g,''),_0x1b7625=[],_0x470cb8=_0xee480[_0x34bd5b(0x122)](/FROM\s+([^\s,)(]+)/i);if(_0x470cb8?.[0x1])_0x1b7625[_0x34bd5b(0x131)](_0x470cb8[0x1][_0x34bd5b(0x121)](/[`"]/g,''));for(const _0x1aadc0 of _0xee480[_0x34bd5b(0x12c)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x4d3589=_0x1aadc0[0x1]?.[_0x34bd5b(0x121)](/[`"]/g,'');if(_0x4d3589&&!_0x1b7625[_0x34bd5b(0x11e)](_0x4d3589))_0x1b7625[_0x34bd5b(0x131)](_0x4d3589);}const _0x257ad6=_0xee480[_0x34bd5b(0x122)](/INTO\s+([^\s(]+)/i);if(_0x257ad6?.[0x1]){const _0x48b2cf=_0x257ad6[0x1][_0x34bd5b(0x121)](/[`"]/g,'');if(!_0x1b7625[_0x34bd5b(0x11e)](_0x48b2cf))_0x1b7625[_0x34bd5b(0x131)](_0x48b2cf);}const _0x152440=_0xee480[_0x34bd5b(0x122)](/UPDATE\s+([^\s,)(]+)/i);if(_0x152440?.[0x1]){const _0x1c2db5=_0x152440[0x1][_0x34bd5b(0x121)](/[`"]/g,'');if(!_0x1b7625[_0x34bd5b(0x11e)](_0x1c2db5))_0x1b7625['push'](_0x1c2db5);}return _0x1b7625;}function extractParameters(_0x2c7e3d){const _0x5406ee=a155_0x57cb,_0x4e8d91=new Set();for(const _0x32aee5 of _0x2c7e3d['matchAll'](/#\{(\w+)\}/g))if(_0x32aee5[0x1])_0x4e8d91[_0x5406ee(0x12b)](_0x32aee5[0x1]);for(const _0x3558b9 of _0x2c7e3d[_0x5406ee(0x12c)](/\$\{(\w+)\}/g))if(_0x3558b9[0x1])_0x4e8d91[_0x5406ee(0x12b)](_0x3558b9[0x1]);return Array[_0x5406ee(0x11d)](_0x4e8d91);}export function validateSql(_0x260691){const _0x3f8eb1=a155_0x57cb,_0x2b85c1=detectSqlType(_0x260691),_0x1e04bf=extractTables(_0x260691),_0x151bce=extractParameters(_0x260691);if(_0x2b85c1['isDangerous'])return{'valid':![],'sqlType':_0x2b85c1,'tables':_0x1e04bf,'parameters':_0x151bce,'message':_0x2b85c1[_0x3f8eb1(0x123)]||_0x2b85c1[_0x3f8eb1(0x11a)]+_0x3f8eb1(0x126)};if(_0x2b85c1['type']===_0x3f8eb1(0x120))return{'valid':![],'sqlType':_0x2b85c1,'tables':_0x1e04bf,'parameters':_0x151bce,'message':'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x2b85c1,'tables':_0x1e04bf,'parameters':_0x151bce,'message':_0x2b85c1[_0x3f8eb1(0x11a)]+_0x3f8eb1(0x11b)+(_0x1e04bf['length']?_0x1e04bf['join'](',\x20'):_0x3f8eb1(0x12d))+(_0x151bce[_0x3f8eb1(0x124)]?_0x3f8eb1(0x125)+_0x151bce[_0x3f8eb1(0x13f)](',\x20'):'')};}