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

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 (204) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/shared/compare-table.js +1 -1
  87. package/lib/commands/menu/shared/index.js +1 -1
  88. package/lib/commands/menu/shared/inquirer.js +1 -1
  89. package/lib/commands/menu/shared/local-pages.js +1 -1
  90. package/lib/commands/menu/shared/logic.js +1 -1
  91. package/lib/commands/menu/shared/service.js +1 -1
  92. package/lib/commands/menu/shared/sync-core.js +1 -1
  93. package/lib/commands/menu/shared/update-core.js +1 -1
  94. package/lib/commands/menu/shared/valid-url.js +1 -1
  95. package/lib/commands/menu/sync.js +1 -1
  96. package/lib/commands/menu/update.js +1 -1
  97. package/lib/commands/page/generate-start.js +1 -1
  98. package/lib/commands/page/generate-status.js +1 -1
  99. package/lib/commands/page/index.js +1 -1
  100. package/lib/commands/page/pull.js +1 -1
  101. package/lib/commands/page/push.js +1 -1
  102. package/lib/commands/page/relation-audit.js +1 -1
  103. package/lib/commands/page/shared.js +1 -1
  104. package/lib/commands/page/standard-page-status.js +1 -1
  105. package/lib/commands/page/sync.js +1 -1
  106. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  107. package/lib/commands/project/create/format-elapsed.js +1 -1
  108. package/lib/commands/project/create/main.js +1 -1
  109. package/lib/commands/project/create/non-interactive.js +1 -1
  110. package/lib/commands/project/create/project-template-path.js +1 -1
  111. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  112. package/lib/commands/project/create/use-format-code.js +1 -1
  113. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  114. package/lib/commands/project/index.js +1 -1
  115. package/lib/commands/project/init.js +1 -1
  116. package/lib/commands/project/upgrade.js +1 -1
  117. package/lib/commands/registry.js +1 -1
  118. package/lib/commands/run/index.js +1 -1
  119. package/lib/commands/schema.js +1 -1
  120. package/lib/commands/skill/index.js +1 -1
  121. package/lib/commands/sql/create.js +1 -1
  122. package/lib/commands/sql/delete.js +1 -1
  123. package/lib/commands/sql/detail.js +1 -1
  124. package/lib/commands/sql/exec.js +1 -1
  125. package/lib/commands/sql/index.js +1 -1
  126. package/lib/commands/sql/list.js +1 -1
  127. package/lib/commands/sql/pull.js +1 -1
  128. package/lib/commands/sql/push.js +1 -1
  129. package/lib/commands/sql/save.js +1 -1
  130. package/lib/commands/sql/shared.js +1 -1
  131. package/lib/commands/sql/status.js +1 -1
  132. package/lib/commands/sql/validate.js +1 -1
  133. package/lib/config/schema.js +1 -1
  134. package/lib/constant/cdn.js +1 -1
  135. package/lib/constant/cli.js +1 -1
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/domain.js +1 -1
  138. package/lib/constant/env.js +1 -1
  139. package/lib/constant/output.js +1 -1
  140. package/lib/constant/paths.js +1 -1
  141. package/lib/constant/risk.js +1 -1
  142. package/lib/context.js +1 -1
  143. package/lib/core/alias-resolver.js +1 -1
  144. package/lib/core/api-client.js +1 -1
  145. package/lib/core/bff/config.js +1 -1
  146. package/lib/core/bff/file-system.js +1 -1
  147. package/lib/core/bff/hash.js +1 -1
  148. package/lib/core/bff/lock.js +1 -1
  149. package/lib/core/bff/utils.js +1 -1
  150. package/lib/core/db-resolver.js +1 -1
  151. package/lib/core/page/file-system.js +1 -1
  152. package/lib/core/page/hash.js +1 -1
  153. package/lib/core/page/lock.js +1 -1
  154. package/lib/core/sql-sync/config.js +1 -1
  155. package/lib/core/sql-sync/file-system.js +1 -1
  156. package/lib/core/sql-sync/hash.js +1 -1
  157. package/lib/core/sql-sync/lock.js +1 -1
  158. package/lib/core/sql-sync/utils.js +1 -1
  159. package/lib/core/sql-validator.js +1 -1
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.js +1 -1
  162. package/lib/framework/flags.js +1 -1
  163. package/lib/framework/help.js +1 -1
  164. package/lib/framework/index.js +1 -1
  165. package/lib/framework/output.js +1 -1
  166. package/lib/framework/response.js +1 -1
  167. package/lib/framework/runner-alias.js +1 -1
  168. package/lib/framework/runner.js +1 -1
  169. package/lib/framework/schema-export.js +1 -1
  170. package/lib/framework/types.js +1 -1
  171. package/lib/generated/build-info.js +1 -1
  172. package/lib/help.js +1 -1
  173. package/lib/skills/main.js +1 -1
  174. package/lib/skills/npx-skills-add.js +1 -1
  175. package/lib/telemetry/cli-command-trace.js +1 -1
  176. package/lib/telemetry/cli-help-trace.js +1 -1
  177. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  178. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  179. package/lib/telemetry/send-cli-trace-log.js +1 -1
  180. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  181. package/lib/utils/ai_config.js +1 -1
  182. package/lib/utils/apply-jq-filter.js +1 -1
  183. package/lib/utils/cdn-config.js +1 -1
  184. package/lib/utils/check-sdk-version.js +1 -1
  185. package/lib/utils/cli-version-check.js +1 -1
  186. package/lib/utils/cli-version-policy.js +1 -1
  187. package/lib/utils/config.js +1 -1
  188. package/lib/utils/copy-directory.js +1 -1
  189. package/lib/utils/entity-with-id.js +1 -1
  190. package/lib/utils/file-utils.js +1 -1
  191. package/lib/utils/guides-cdn.js +1 -1
  192. package/lib/utils/http-client.js +1 -1
  193. package/lib/utils/is-non-interactive.js +1 -1
  194. package/lib/utils/logger.js +1 -1
  195. package/lib/utils/params.js +1 -1
  196. package/lib/utils/platform.js +1 -1
  197. package/lib/utils/rules-cdn.js +1 -1
  198. package/lib/utils/sleep.js +1 -1
  199. package/lib/utils/template-replacer.js +1 -1
  200. package/lib/utils/update-notice.js +1 -1
  201. package/lib/utils/version.js +1 -1
  202. package/lib/utils/with-active-cookie.js +1 -1
  203. package/lib/utils/write-cli-side-channel.js +1 -1
  204. package/package.json +1 -1
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a142_0x113297=a142_0x297b;(function(_0xec3245,_0x442d8c){const _0x32147e=a142_0x297b,_0x292ed2=_0xec3245();while(!![]){try{const _0x5b1df4=parseInt(_0x32147e(0xb9))/0x1*(-parseInt(_0x32147e(0x9f))/0x2)+-parseInt(_0x32147e(0x9c))/0x3*(parseInt(_0x32147e(0xbb))/0x4)+-parseInt(_0x32147e(0xbe))/0x5+-parseInt(_0x32147e(0xc8))/0x6*(-parseInt(_0x32147e(0xd8))/0x7)+-parseInt(_0x32147e(0xd2))/0x8*(-parseInt(_0x32147e(0xb3))/0x9)+parseInt(_0x32147e(0xd9))/0xa*(parseInt(_0x32147e(0xb4))/0xb)+-parseInt(_0x32147e(0xb6))/0xc*(-parseInt(_0x32147e(0xc4))/0xd);if(_0x5b1df4===_0x442d8c)break;else _0x292ed2['push'](_0x292ed2['shift']());}catch(_0x2d405b){_0x292ed2['push'](_0x292ed2['shift']());}}}(a142_0x19c8,0x1d8a5));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';function a142_0x297b(_0x461926,_0x45e732){_0x461926=_0x461926-0x8c;const _0x19c863=a142_0x19c8();let _0x297bfd=_0x19c863[_0x461926];return _0x297bfd;}import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x4813e6){return process.env[`RABETBASE_${_0x4813e6}`]||process.env[`LOVRABET_${_0x4813e6}`]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a142_0x113297(0xc6),a142_0x113297(0x98),a142_0x113297(0x8e)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x113297(0xb1)](_0x3e5fe2=>_0x3e5fe2!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x11fde4){for(const _0x1d4f80 of CONFIG_NAMES){const _0x158e8b=resolve(_0x11fde4,_0x1d4f80);if(existsSync(_0x158e8b))return _0x158e8b;}return undefined;}export function findProjectRootDirectory(_0x5006ee=process[a142_0x113297(0xd7)]()){let _0x13535d=resolve(_0x5006ee);const {root:_0x183cb6}=parse(_0x13535d),_0x5aab76=homedir();while(!![]){if(resolveConfigPath(_0x13535d)){if(_0x13535d===_0x5aab76)break;return _0x13535d;}if(_0x13535d===_0x183cb6||_0x13535d===_0x5aab76)break;const _0x430ad8=dirname(_0x13535d);if(_0x430ad8===_0x13535d)break;_0x13535d=_0x430ad8;}return resolve(_0x5006ee);}export async function createContext(_0x46550c){const _0x4b36a0=a142_0x113297,_0x33e78d=readRawConfig(),_0x46be8a=buildConfig(_0x33e78d,_0x46550c),{initEnv:_0x391b77}=await import(_0x4b36a0(0xdb));if(_0x46be8a[_0x4b36a0(0x94)])_0x391b77(_0x46be8a[_0x4b36a0(0x94)]);else _0x46550c[_0x4b36a0(0x94)]&&typeof _0x46550c[_0x4b36a0(0x94)]===_0x4b36a0(0xc3)&&_0x391b77(_0x46550c[_0x4b36a0(0x94)]);const {initDomains:_0x555d6b,getUserDomain:_0x5b0ed0,getApiDomain:_0x115b5f}=await import('./constant/domain.js');_0x555d6b({'apiDomain':_0x33e78d[_0x4b36a0(0xa4)]||undefined,'userDomain':_0x33e78d[_0x4b36a0(0xa7)]||undefined,'runtimeDomain':_0x33e78d[_0x4b36a0(0xb5)]||undefined});const _0x3de7db={'apiDomain':_0x115b5f(),'userDomain':_0x5b0ed0()},_0x18c027=await buildAuth(_0x46be8a);logger['setLogPath'](process[_0x4b36a0(0xd7)]());const _0x204824=(CLI_BIN_NAME+'\x20'+process[_0x4b36a0(0xaf)][_0x4b36a0(0x99)](0x2)['join']('\x20'))[_0x4b36a0(0x92)]();logger['setRawCommand'](_0x204824);const {isNonInteractive:_0x3044f3}=await import(_0x4b36a0(0xcc)),_0x17c632=_0x3044f3(_0x46550c);return{'config':_0x46be8a,'auth':_0x18c027,'logger':logger,'env':_0x3de7db,'nonInteractive':_0x17c632};}export function buildConfigFromFlags(_0x8807c1){return buildConfig(readRawConfig(),_0x8807c1);}function a142_0x19c8(){const _0xbab884=['runtimeDomain','12kIBjBN','locale','keys','21448htNmfF','warn','116276GUsCRK','message','daily','385075VSSQSV','ENV','format','.tmp','find','string','1122277iyaJrY','MAX_RISK','.rabetbase.json','project','18ZUQbxe','true','apiDir','pageSize','./utils/is-non-interactive.js','error','entries','template_base_url','authRequired','stringify','376wFlXSe','migrated','read','empty','projectConfig','cwd','30037YkMXrj','1288640eYjGxP','defaultApp','./constant/env.js','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','set','ACCESS_KEY','appcode','RISK_LEVEL','object','.lovrabetrc','COOKIE','APP','riskLevel','trim','merged','env','-api.ts','app','get','.lovrabet.json','slice','cookie','apps','21tpRoYT','./auth/get-cookie.js','data','6iUmmYm','parse','status','length','APPCODE','apiDomain','FORMAT','utf8','userDomain','missing','PAGE_SIZE','config','VERBOSE','silent','globalConfig','inherit','argv','accessKey','filter','production','45531PteNDy','11IqNKTL'];a142_0x19c8=function(){return _0xbab884;};return a142_0x19c8();}export function getProjectConfigPath(){const _0x4a22a1=a142_0x113297;return resolveConfigPath(process[_0x4a22a1(0xd7)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x16d789){const _0x2b3f87=a142_0x113297;if(!existsSync(_0x16d789))return{'status':_0x2b3f87(0xa8)};try{const _0x3ddd30=readFileSync(_0x16d789,{'encoding':_0x2b3f87(0xa6)});if(!_0x3ddd30?.[_0x2b3f87(0x92)]())return{'status':'empty'};const _0x5f49b5=JSON[_0x2b3f87(0xa0)](_0x3ddd30);return{'status':'ok','data':_0x5f49b5};}catch(_0x2d7955){return{'status':_0x2b3f87(0xcd),'message':_0x2d7955 instanceof Error?_0x2d7955[_0x2b3f87(0xbc)]:String(_0x2d7955)};}}function parseCliConfigJsonFile(_0x17ca64,_0x53281d,_0x1a2eb5){const _0x32c604=a142_0x113297,_0x5837e0=inspectCliConfigJsonFile(_0x17ca64);if(_0x5837e0['status']==='missing'||_0x5837e0['status']===_0x32c604(0xd5))return{};if(_0x5837e0[_0x32c604(0xa1)]==='ok')return _0x5837e0[_0x32c604(0x9e)];return _0x53281d===_0x32c604(0xba)&&_0x1a2eb5&&console[_0x32c604(0xcd)](CLI_BIN_NAME+':\x20'+_0x1a2eb5+_0x32c604(0xdc)+_0x17ca64+'\x0a\x20\x20'+_0x5837e0[_0x32c604(0xbc)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x36c324){const _0x80861c=a142_0x113297;if(!_0x36c324||typeof _0x36c324!==_0x80861c(0x8d))return{'config':{},'migrated':![]};const _0x3b589e={..._0x36c324},_0xcf827=_0x3b589e[_0x80861c(0x9b)]&&typeof _0x3b589e[_0x80861c(0x9b)]===_0x80861c(0x8d)?{..._0x3b589e[_0x80861c(0x9b)]}:{},_0x1dc011=Object[_0x80861c(0xb8)](_0xcf827)[_0x80861c(0xa2)],_0xe4fad=_0x3b589e[_0x80861c(0xdf)]||_0x3b589e['app'];let _0x4e5d93=![];if(_0xe4fad&&_0x1dc011===0x0){const _0x444dc0=typeof _0x3b589e['defaultApp']===_0x80861c(0xc3)&&_0x3b589e['defaultApp'][_0x80861c(0x92)]()?_0x3b589e[_0x80861c(0xda)]:String(_0xe4fad)[_0x80861c(0x92)]();_0xcf827[_0x444dc0]={'appcode':String(_0xe4fad)[_0x80861c(0x92)](),..._0x3b589e[_0x80861c(0x94)]!=null?{'env':_0x3b589e[_0x80861c(0x94)]}:{},..._0x3b589e[_0x80861c(0xca)]!=null?{'apiDir':_0x3b589e[_0x80861c(0xca)]}:{},..._0x3b589e[_0x80861c(0x9a)]!=null?{'cookie':_0x3b589e[_0x80861c(0x9a)]}:{},..._0x3b589e[_0x80861c(0xb0)]!=null?{'accessKey':_0x3b589e[_0x80861c(0xb0)]}:{},..._0x3b589e[_0x80861c(0xc0)]!=null?{'format':_0x3b589e[_0x80861c(0xc0)]}:{},..._0x3b589e[_0x80861c(0xcb)]!=null?{'pageSize':_0x3b589e[_0x80861c(0xcb)]}:{},..._0x3b589e[_0x80861c(0x91)]!=null?{'riskLevel':_0x3b589e[_0x80861c(0x91)]}:{},..._0x3b589e[_0x80861c(0xb7)]!=null?{'locale':_0x3b589e[_0x80861c(0xb7)]}:{}},_0x3b589e['apps']=_0xcf827;if(!_0x3b589e['defaultApp'])_0x3b589e['defaultApp']=_0x444dc0;_0x4e5d93=!![];}return(_0x80861c(0xdf)in _0x3b589e||_0x80861c(0x96)in _0x3b589e)&&(delete _0x3b589e[_0x80861c(0xdf)],delete _0x3b589e[_0x80861c(0x96)],_0x4e5d93=!![]),{'config':_0x3b589e,'migrated':_0x4e5d93};}function writeNormalizedConfigIfNeeded(_0x51a33c,_0x780e55){const _0x2ae108=a142_0x113297,_0x297c7c=JSON[_0x2ae108(0xd1)](_0x780e55,null,0x2)+'\x0a';if(normalizedWriteCache[_0x2ae108(0x97)](_0x51a33c)===_0x297c7c)return;writeConfigFile(_0x51a33c,_0x780e55),normalizedWriteCache[_0x2ae108(0xdd)](_0x51a33c,_0x297c7c);}function parseAndNormalizeConfig(_0x301a05,_0x1f980f,_0x491a18){const _0x3d7769=a142_0x113297,_0x5559ac=parseCliConfigJsonFile(_0x301a05,_0x1f980f,_0x491a18),_0x5cdb9f=normalizeLegacyConfigShape(_0x5559ac);if(_0x5cdb9f[_0x3d7769(0xd3)])try{writeNormalizedConfigIfNeeded(_0x301a05,_0x5cdb9f['config']);}catch{}return _0x5cdb9f[_0x3d7769(0xaa)];}export function loadRawConfigLayers(_0x538453){const _0x1832a0=a142_0x113297;let _0x2363d5={},_0x4010bc={};const _0x4526b1=resolveConfigPath(homedir());_0x4526b1&&(_0x2363d5=parseAndNormalizeConfig(_0x4526b1,_0x1832a0(0xba),'Global'));const _0x24d3e7=_0x538453??findProjectRootDirectory(),_0x272b40=resolveConfigPath(_0x24d3e7);return _0x272b40&&(_0x4010bc=parseAndNormalizeConfig(_0x272b40,_0x1832a0(0xba),'Project')),{'globalPath':_0x4526b1,'projectPath':_0x272b40,'globalConfig':_0x2363d5,'projectConfig':_0x4010bc};}const INHERIT_WHITELIST=[a142_0x113297(0x9a),a142_0x113297(0xb0),'locale',a142_0x113297(0xc0),'riskLevel',a142_0x113297(0xcb)];function mergeRawConfigLayers(_0x383e75){const _0x5c14dd=a142_0x113297,{globalConfig:_0x563202,projectConfig:_0x3fc42c}=_0x383e75,_0x22278f=Object['keys'](_0x3fc42c)[_0x5c14dd(0xa2)]>0x0;if(!_0x22278f)return mergeGlobalOnly(_0x563202);if(_0x3fc42c[_0x5c14dd(0xae)]===!![])return mergeFullInherit(_0x563202,_0x3fc42c);if(_0x3fc42c[_0x5c14dd(0xae)]===![])return mergeIsolated(_0x3fc42c);return mergeProjectFirst(_0x563202,_0x3fc42c);}function mergeGlobalOnly(_0x123444){const _0x12bfa4=a142_0x113297,_0x32fc00={..._0x123444},_0x2bd78f=_0x123444[_0x12bfa4(0x9b)]&&typeof _0x123444['apps']===_0x12bfa4(0x8d)?_0x123444[_0x12bfa4(0x9b)]:{};Object[_0x12bfa4(0xb8)](_0x2bd78f)[_0x12bfa4(0xa2)]>0x0&&(_0x32fc00[_0x12bfa4(0x9b)]=_0x2bd78f);if(_0x123444[_0x12bfa4(0xda)])_0x32fc00[_0x12bfa4(0xda)]=_0x123444[_0x12bfa4(0xda)];else{const _0x8b0e3f=Object[_0x12bfa4(0xb8)](_0x2bd78f);if(_0x8b0e3f[_0x12bfa4(0xa2)]>0x0)_0x32fc00[_0x12bfa4(0xda)]=_0x8b0e3f[0x0];}return _0x32fc00;}function mergeIsolated(_0x2a01fe){const _0x211f1c=a142_0x113297,_0x33ecfe={..._0x2a01fe};delete _0x33ecfe[_0x211f1c(0xae)];const _0x12b5d5=_0x2a01fe[_0x211f1c(0x9b)]&&typeof _0x2a01fe['apps']==='object'?_0x2a01fe[_0x211f1c(0x9b)]:{};Object['keys'](_0x12b5d5)[_0x211f1c(0xa2)]>0x0?_0x33ecfe[_0x211f1c(0x9b)]=_0x12b5d5:delete _0x33ecfe['apps'];if(_0x211f1c(0xda)in _0x2a01fe)_0x33ecfe[_0x211f1c(0xda)]=_0x2a01fe[_0x211f1c(0xda)];else Object['keys'](_0x12b5d5)['length']>0x0?_0x33ecfe[_0x211f1c(0xda)]=Object[_0x211f1c(0xb8)](_0x12b5d5)[0x0]:delete _0x33ecfe['defaultApp'];return _0x33ecfe;}function mergeProjectFirst(_0x1f06f9,_0x227c74){const _0x57666e=a142_0x113297,_0xe2cf64={..._0x227c74};delete _0xe2cf64[_0x57666e(0xae)];for(const _0x341cfb of INHERIT_WHITELIST){!(_0x341cfb in _0xe2cf64)&&_0x341cfb in _0x1f06f9&&(_0xe2cf64[_0x341cfb]=_0x1f06f9[_0x341cfb]);}const _0x48ed9c=_0x227c74[_0x57666e(0x9b)]&&typeof _0x227c74[_0x57666e(0x9b)]===_0x57666e(0x8d)?_0x227c74[_0x57666e(0x9b)]:{};Object[_0x57666e(0xb8)](_0x48ed9c)['length']>0x0?_0xe2cf64['apps']=_0x48ed9c:delete _0xe2cf64[_0x57666e(0x9b)];if('defaultApp'in _0x227c74)_0xe2cf64[_0x57666e(0xda)]=_0x227c74['defaultApp'];else Object[_0x57666e(0xb8)](_0x48ed9c)['length']>0x0?_0xe2cf64['defaultApp']=Object[_0x57666e(0xb8)](_0x48ed9c)[0x0]:delete _0xe2cf64[_0x57666e(0xda)];return _0xe2cf64;}function mergeFullInherit(_0x2f3d5b,_0x356dfa){const _0x51e0a0=a142_0x113297,_0x1a38cb=_0x2f3d5b['apps']&&typeof _0x2f3d5b[_0x51e0a0(0x9b)]==='object'?_0x2f3d5b['apps']:{},_0x1ace4d=_0x356dfa[_0x51e0a0(0x9b)]&&typeof _0x356dfa['apps']===_0x51e0a0(0x8d)?_0x356dfa[_0x51e0a0(0x9b)]:{},_0x55d1bc={..._0x1a38cb,..._0x1ace4d},_0xf45a1f={..._0x2f3d5b,..._0x356dfa};delete _0xf45a1f[_0x51e0a0(0xae)];Object[_0x51e0a0(0xb8)](_0x55d1bc)[_0x51e0a0(0xa2)]>0x0&&(_0xf45a1f[_0x51e0a0(0x9b)]=_0x55d1bc);if(_0x51e0a0(0xda)in _0x356dfa)_0xf45a1f[_0x51e0a0(0xda)]=_0x356dfa[_0x51e0a0(0xda)];else{if(Object[_0x51e0a0(0xb8)](_0x1ace4d)['length']>0x0)_0xf45a1f['defaultApp']=Object[_0x51e0a0(0xb8)](_0x1ace4d)[0x0];else{if(_0x2f3d5b[_0x51e0a0(0xda)])_0xf45a1f[_0x51e0a0(0xda)]=_0x2f3d5b[_0x51e0a0(0xda)];else{const _0x1fd3ed=Object[_0x51e0a0(0xb8)](_0x1a38cb);if(_0x1fd3ed['length']>0x0)_0xf45a1f['defaultApp']=_0x1fd3ed[0x0];}}}return _0xf45a1f;}export function readRawConfigWithLayers(_0x3d34df){const _0x1335b9=loadRawConfigLayers(_0x3d34df);return{'config':mergeRawConfigLayers(_0x1335b9),'layers':_0x1335b9};}export function readRawConfig(_0x407207){return mergeRawConfigLayers(loadRawConfigLayers(_0x407207));}export function getConfigAppCode(_0x362b5f){const _0x3baec9=a142_0x113297,_0x282840=readRawConfig(_0x362b5f);if(_0x282840[_0x3baec9(0x9b)]&&typeof _0x282840[_0x3baec9(0x9b)]===_0x3baec9(0x8d)){const _0x37fc46=_0x282840['defaultApp'];if(_0x37fc46&&_0x282840['apps'][_0x37fc46]?.[_0x3baec9(0xdf)])return String(_0x282840['apps'][_0x37fc46][_0x3baec9(0xdf)])['trim']();const _0x5061b1=Object['values'](_0x282840['apps'])[0x0];if(_0x5061b1?.[_0x3baec9(0xdf)])return String(_0x5061b1[_0x3baec9(0xdf)])[_0x3baec9(0x92)]();}const _0x1176f9=_0x282840[_0x3baec9(0xdf)]||_0x282840[_0x3baec9(0x96)];if(typeof _0x1176f9!==_0x3baec9(0xc3)||_0x1176f9['trim']()==='')return undefined;return _0x1176f9[_0x3baec9(0x92)]();}export function getMultiAppConfigs(_0x1c7f05=a142_0x113297(0xc7),_0x171dfe){const _0x15275e=a142_0x113297,_0x22b93c=loadRawConfigLayers(_0x171dfe);let _0x159a6f,_0x4bf29f;if(_0x1c7f05===_0x15275e(0x93)){const _0x4472d8=_0x22b93c[_0x15275e(0xad)][_0x15275e(0x9b)]&&typeof _0x22b93c[_0x15275e(0xad)][_0x15275e(0x9b)]===_0x15275e(0x8d)?_0x22b93c[_0x15275e(0xad)][_0x15275e(0x9b)]:{},_0x5d8c01=_0x22b93c[_0x15275e(0xd6)][_0x15275e(0x9b)]&&typeof _0x22b93c['projectConfig']['apps']===_0x15275e(0x8d)?_0x22b93c['projectConfig'][_0x15275e(0x9b)]:{};_0x159a6f={..._0x4472d8,..._0x5d8c01};const _0x170e9d=readRawConfig(_0x171dfe);_0x4bf29f=_0x170e9d[_0x15275e(0xda)];}else _0x159a6f=_0x22b93c['projectConfig']['apps'],_0x4bf29f=_0x22b93c['projectConfig'][_0x15275e(0xda)];if(!_0x159a6f||typeof _0x159a6f!==_0x15275e(0x8d)||Object[_0x15275e(0xb8)](_0x159a6f)[_0x15275e(0xa2)]===0x0)return null;return Object['entries'](_0x159a6f)['map'](([_0x5c25e7,_0x17af4e])=>({'name':_0x5c25e7,'appcode':_0x17af4e?.[_0x15275e(0xdf)]||'','isDefault':_0x5c25e7===_0x4bf29f,'env':_0x17af4e?.['env'],'apiDir':_0x17af4e?.[_0x15275e(0xca)],'cookie':_0x17af4e?.['cookie']||undefined}))[_0x15275e(0xb1)](_0x5c3060=>_0x5c3060['appcode']);}export function getTemplateBaseUrl(_0x1ec999){const _0x5bb41c=a142_0x113297,_0x586817=readRawConfig(_0x1ec999);if(_0x586817[_0x5bb41c(0xcf)]&&typeof _0x586817[_0x5bb41c(0xcf)]===_0x5bb41c(0xc3))return _0x586817['template_base_url']['replace'](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}export function readConfigFile(_0x1d67d4){const _0x14d207=a142_0x113297;return parseAndNormalizeConfig(_0x1d67d4,_0x14d207(0xac));}export function writeConfigFile(_0xdc6dee,_0xbdc109){const _0x158a7c=a142_0x113297,_0x2d4a18=dirname(_0xdc6dee);!existsSync(_0x2d4a18)&&mkdirSync(_0x2d4a18,{'recursive':!![]});const _0x7ab879=_0xdc6dee+_0x158a7c(0xc1);try{writeFileSync(_0x7ab879,JSON[_0x158a7c(0xd1)](_0xbdc109,null,0x2)+'\x0a',{'encoding':_0x158a7c(0xa6),'mode':0x180}),renameSync(_0x7ab879,_0xdc6dee);}catch(_0x230abd){try{unlinkSync(_0x7ab879);}catch{}throw _0x230abd;}}export function resolveWriteConfigPath(_0x377df7){const _0x2342a8=a142_0x113297,_0xdcf980=_0x377df7===_0x2342a8(0xc7)?process[_0x2342a8(0xd7)]():homedir(),_0x327bb2=resolveConfigPath(_0xdcf980);return _0x327bb2??resolve(_0xdcf980,NEW_CONFIG_NAME);}function buildConfig(_0x2f7bc7,_0xc54a32){const _0x3ce2af=a142_0x113297,_0x59b765={};if(_0x2f7bc7[_0x3ce2af(0x9b)]&&typeof _0x2f7bc7[_0x3ce2af(0x9b)]===_0x3ce2af(0x8d))for(const [_0x36fe29,_0x2662aa]of Object[_0x3ce2af(0xce)](_0x2f7bc7[_0x3ce2af(0x9b)])){_0x2662aa&&typeof _0x2662aa===_0x3ce2af(0x8d)&&_0x2662aa[_0x3ce2af(0xdf)]&&(_0x59b765[_0x36fe29]=_0x2662aa);}const _0x3a60d8=_0x2f7bc7[_0x3ce2af(0xda)]||undefined,_0x49b58b=Object[_0x3ce2af(0xb8)](_0x59b765)[_0x3ce2af(0xa2)]>0x0,_0x24dabb=_0xc54a32[_0x3ce2af(0x96)]||env(_0x3ce2af(0x90))||undefined,_0x56dc7a=_0x24dabb||_0x3a60d8||undefined,_0x6b6d81=_0xc54a32['appcode']||env(_0x3ce2af(0xa3))||undefined,_0x2bed0b=_0x6b6d81?Object[_0x3ce2af(0xce)](_0x59b765)[_0x3ce2af(0xc2)](([,_0x5d252a])=>_0x5d252a?.[_0x3ce2af(0xdf)]===_0x6b6d81):undefined,_0x44c929=_0x2bed0b?.[0x0],_0x1a12ad=_0x2bed0b?.[0x1];let _0x1bba1d=_0x6b6d81?_0x44c929:_0x56dc7a,_0x31b59d=_0x1bba1d&&_0x59b765[_0x1bba1d]?_0x59b765[_0x1bba1d]:undefined;_0x6b6d81&&_0x1a12ad&&(_0x31b59d=_0x1a12ad);const _0x21f652=_0x6b6d81?_0x1a12ad??_0x31b59d:_0x31b59d,_0x347a58=_0x24dabb||(_0x6b6d81?_0x44c929:undefined),_0x53a033=_0x6b6d81||_0x21f652?.[_0x3ce2af(0xdf)]||undefined,_0x149047=_0xc54a32[_0x3ce2af(0x94)]||env(_0x3ce2af(0xbf))||_0x21f652?.[_0x3ce2af(0x94)]||_0x2f7bc7[_0x3ce2af(0x94)]||DEFAULT_CONFIG_VALUES[_0x3ce2af(0x94)],_0x21f2e0=_0x21f652?.[_0x3ce2af(0xb7)]||_0x2f7bc7[_0x3ce2af(0xb7)]||DEFAULT_CONFIG_VALUES[_0x3ce2af(0xb7)],_0x5e3c5f=env(_0x3ce2af(0x8f))||_0x21f652?.[_0x3ce2af(0x9a)]||_0x2f7bc7[_0x3ce2af(0x9a)]||undefined,_0x4dc56c=env(_0x3ce2af(0xde))||_0x21f652?.['accessKey']||_0x2f7bc7[_0x3ce2af(0xb0)]||undefined,_0x191395=_0xc54a32['format']||env(_0x3ce2af(0xa5))||_0x21f652?.[_0x3ce2af(0xc0)]||_0x2f7bc7['format'],_0x2a120d=normalizeLegacyOutputFormat(_0x191395),_0x366288=env(_0x3ce2af(0xa9))||_0x21f652?.[_0x3ce2af(0xcb)]||_0x2f7bc7['pageSize'],_0x14ebcd=_0x366288?Number(_0x366288)||undefined:undefined,_0x470b9c=env(_0x3ce2af(0x8c))||env(_0x3ce2af(0xc5))||_0x21f652?.[_0x3ce2af(0x91)]||_0x2f7bc7[_0x3ce2af(0x91)]||_0x2f7bc7['maxRisk'],_0x4cd0ac=_0x470b9c===_0x3ce2af(0xd4)||_0x470b9c==='write'?_0x470b9c:DEFAULT_CONFIG_VALUES['riskLevel'],_0x3d3c2a=env(_0x3ce2af(0xab)),_0x48f26f=_0x3d3c2a==='1'||_0x3d3c2a===_0x3ce2af(0xc9),_0x4954f4=_0x21f652?.[_0x3ce2af(0xca)]||_0x2f7bc7['apiDir']||DEFAULT_CONFIG_VALUES['apiDir'],_0x16fe06=isDaily(normalizeEnv(String(_0x149047)))?_0x3ce2af(0xbd):_0x3ce2af(0xb2);return{'appCode':typeof _0x53a033==='string'&&_0x53a033['trim']()?_0x53a033[_0x3ce2af(0x92)]():undefined,'env':_0x16fe06,'locale':_0x21f2e0,'cookie':_0x5e3c5f,'accessKey':_0x4dc56c,'format':_0x2a120d,'pageSize':_0x14ebcd,'riskLevel':_0x4cd0ac,'verbose':_0x48f26f,'apiDir':_0x4954f4,'apps':_0x59b765,'defaultApp':_0x3a60d8,'currentApp':_0x49b58b?_0x1bba1d:undefined,'explicitAppName':_0x347a58,'raw':_0x2f7bc7};}async function buildAuth(_0x275a72){const _0x364a7d=a142_0x113297,{getCookie:_0xd5c7b5}=await import(_0x364a7d(0x9d)),_0x56b20f=_0x275a72[_0x364a7d(0x9a)]||_0xd5c7b5(),_0x69495f=_0x56b20f?await getIsSessionValid():![];return{'cookie':_0x56b20f,'isLoggedIn':_0x69495f,async 'getOrLogin'(){const _0x5912ab=_0x364a7d;if(_0x56b20f&&_0x69495f)return _0x56b20f;throw CliErrors[_0x5912ab(0xd0)]();}};}export function resolveApiFilePath(_0x2d931e,_0x59fc69){const _0x303dd7=a142_0x113297,_0x3ed7cc=resolve(process[_0x303dd7(0xd7)](),_0x2d931e),_0x25f17d=resolve(_0x3ed7cc,'api.ts');if(!_0x59fc69)return _0x25f17d;const _0x1d5ab8=readRawConfig(),_0x1b8b1a=_0x1d5ab8['apps']&&typeof _0x1d5ab8[_0x303dd7(0x9b)]===_0x303dd7(0x8d)?_0x1d5ab8[_0x303dd7(0x9b)]:{},_0x11138c=Object[_0x303dd7(0xce)](_0x1b8b1a)[_0x303dd7(0xc2)](([,_0x2a9d2d])=>_0x2a9d2d?.[_0x303dd7(0xdf)]===_0x59fc69);if(!_0x11138c)return _0x25f17d;const [_0x547d0a,_0x3c11e4]=_0x11138c,_0x1ce7da=typeof _0x1d5ab8['defaultApp']==='string'?_0x1d5ab8['defaultApp']:undefined;if(_0x3c11e4?.[_0x303dd7(0xca)])return _0x25f17d;if(_0x1ce7da&&_0x547d0a!==_0x1ce7da)return resolve(_0x3ed7cc,_0x547d0a+_0x303dd7(0x95));return _0x25f17d;}
1
+ const a142_0x138a20=a142_0x9079;(function(_0x454860,_0xbf457){const _0x444900=a142_0x9079,_0x266131=_0x454860();while(!![]){try{const _0x42734d=-parseInt(_0x444900(0x12a))/0x1+-parseInt(_0x444900(0x13d))/0x2*(-parseInt(_0x444900(0x15f))/0x3)+parseInt(_0x444900(0x12e))/0x4*(-parseInt(_0x444900(0x152))/0x5)+parseInt(_0x444900(0x135))/0x6*(-parseInt(_0x444900(0x169))/0x7)+-parseInt(_0x444900(0x155))/0x8+parseInt(_0x444900(0x126))/0x9*(-parseInt(_0x444900(0x14c))/0xa)+parseInt(_0x444900(0x170))/0xb;if(_0x42734d===_0xbf457)break;else _0x266131['push'](_0x266131['shift']());}catch(_0x4473c0){_0x266131['push'](_0x266131['shift']());}}}(a142_0x5510,0x61be9));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';function a142_0x9079(_0x56a991,_0x3b30f6){_0x56a991=_0x56a991-0x122;const _0x551031=a142_0x5510();let _0x9079b3=_0x551031[_0x56a991];return _0x9079b3;}import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0xb577c2){return process.env[`RABETBASE_${_0xb577c2}`]||process.env[`LOVRABET_${_0xb577c2}`]||undefined;}export const NEW_CONFIG_NAME=a142_0x138a20(0x150);export const CONFIG_NAMES=['.rabetbase.json',a142_0x138a20(0x127),a142_0x138a20(0x167)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x138a20(0x173)](_0x19c8bf=>_0x19c8bf!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x110564){for(const _0x547fd1 of CONFIG_NAMES){const _0x340ec5=resolve(_0x110564,_0x547fd1);if(existsSync(_0x340ec5))return _0x340ec5;}return undefined;}export function findProjectRootDirectory(_0x399f6a=process[a142_0x138a20(0x166)]()){let _0x4512f3=resolve(_0x399f6a);const {root:_0x51d564}=parse(_0x4512f3),_0x91ea87=homedir();while(!![]){if(resolveConfigPath(_0x4512f3)){if(_0x4512f3===_0x91ea87)break;return _0x4512f3;}if(_0x4512f3===_0x51d564||_0x4512f3===_0x91ea87)break;const _0x2c2246=dirname(_0x4512f3);if(_0x2c2246===_0x4512f3)break;_0x4512f3=_0x2c2246;}return resolve(_0x399f6a);}export async function createContext(_0x38aee3){const _0x2ff4d6=a142_0x138a20,_0x47b0a2=readRawConfig(),_0x4041ec=buildConfig(_0x47b0a2,_0x38aee3),{initEnv:_0x4ab569}=await import(_0x2ff4d6(0x130));if(_0x4041ec['env'])_0x4ab569(_0x4041ec['env']);else _0x38aee3[_0x2ff4d6(0x165)]&&typeof _0x38aee3[_0x2ff4d6(0x165)]===_0x2ff4d6(0x151)&&_0x4ab569(_0x38aee3[_0x2ff4d6(0x165)]);const {initDomains:_0x5e802c,getUserDomain:_0x1eff26,getApiDomain:_0x3fc0d5}=await import(_0x2ff4d6(0x160));_0x5e802c({'apiDomain':_0x47b0a2[_0x2ff4d6(0x140)]||undefined,'userDomain':_0x47b0a2[_0x2ff4d6(0x14f)]||undefined,'runtimeDomain':_0x47b0a2[_0x2ff4d6(0x15b)]||undefined});const _0x470227={'apiDomain':_0x3fc0d5(),'userDomain':_0x1eff26()},_0x3cc2df=await buildAuth(_0x4041ec);logger[_0x2ff4d6(0x148)](process[_0x2ff4d6(0x166)]());const _0x547d29=(CLI_BIN_NAME+'\x20'+process[_0x2ff4d6(0x158)][_0x2ff4d6(0x124)](0x2)[_0x2ff4d6(0x14d)]('\x20'))[_0x2ff4d6(0x162)]();logger[_0x2ff4d6(0x123)](_0x547d29);const {isNonInteractive:_0x70fe06}=await import(_0x2ff4d6(0x13a)),_0x4e5a35=_0x70fe06(_0x38aee3);return{'config':_0x4041ec,'auth':_0x3cc2df,'logger':logger,'env':_0x470227,'nonInteractive':_0x4e5a35};}export function buildConfigFromFlags(_0x37ad57){return buildConfig(readRawConfig(),_0x37ad57);}export function getProjectConfigPath(){const _0x30f229=a142_0x138a20;return resolveConfigPath(process[_0x30f229(0x166)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x51100e){const _0x2d2854=a142_0x138a20;if(!existsSync(_0x51100e))return{'status':_0x2d2854(0x12b)};try{const _0x453f13=readFileSync(_0x51100e,{'encoding':'utf8'});if(!_0x453f13?.['trim']())return{'status':_0x2d2854(0x15a)};const _0xe13b24=JSON[_0x2d2854(0x177)](_0x453f13);return{'status':'ok','data':_0xe13b24};}catch(_0x218f88){return{'status':_0x2d2854(0x12f),'message':_0x218f88 instanceof Error?_0x218f88[_0x2d2854(0x142)]:String(_0x218f88)};}}function parseCliConfigJsonFile(_0x5d86d7,_0x46be2b,_0x4a3230){const _0x252528=a142_0x138a20,_0x65aaed=inspectCliConfigJsonFile(_0x5d86d7);if(_0x65aaed[_0x252528(0x176)]===_0x252528(0x12b)||_0x65aaed[_0x252528(0x176)]===_0x252528(0x15a))return{};if(_0x65aaed[_0x252528(0x176)]==='ok')return _0x65aaed[_0x252528(0x16b)];return _0x46be2b===_0x252528(0x174)&&_0x4a3230&&console[_0x252528(0x12f)](CLI_BIN_NAME+':\x20'+_0x4a3230+_0x252528(0x16a)+_0x5d86d7+_0x252528(0x161)+_0x65aaed[_0x252528(0x142)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x123fb6){const _0x4a7ca5=a142_0x138a20;if(!_0x123fb6||typeof _0x123fb6!==_0x4a7ca5(0x15d))return{'config':{},'migrated':![]};const _0x575f03={..._0x123fb6},_0x554f43=_0x575f03[_0x4a7ca5(0x16d)]&&typeof _0x575f03[_0x4a7ca5(0x16d)]===_0x4a7ca5(0x15d)?{..._0x575f03['apps']}:{},_0x50ead1=Object['keys'](_0x554f43)['length'],_0x1c6f0b=_0x575f03[_0x4a7ca5(0x15c)]||_0x575f03[_0x4a7ca5(0x14b)];let _0x29f657=![];if(_0x1c6f0b&&_0x50ead1===0x0){const _0x47bd72=typeof _0x575f03[_0x4a7ca5(0x143)]===_0x4a7ca5(0x151)&&_0x575f03[_0x4a7ca5(0x143)][_0x4a7ca5(0x162)]()?_0x575f03['defaultApp']:String(_0x1c6f0b)[_0x4a7ca5(0x162)]();_0x554f43[_0x47bd72]={'appcode':String(_0x1c6f0b)['trim'](),..._0x575f03[_0x4a7ca5(0x165)]!=null?{'env':_0x575f03['env']}:{},..._0x575f03[_0x4a7ca5(0x159)]!=null?{'apiDir':_0x575f03['apiDir']}:{},..._0x575f03['cookie']!=null?{'cookie':_0x575f03[_0x4a7ca5(0x122)]}:{},..._0x575f03[_0x4a7ca5(0x14a)]!=null?{'accessKey':_0x575f03[_0x4a7ca5(0x14a)]}:{},..._0x575f03[_0x4a7ca5(0x136)]!=null?{'format':_0x575f03[_0x4a7ca5(0x136)]}:{},..._0x575f03['pageSize']!=null?{'pageSize':_0x575f03[_0x4a7ca5(0x172)]}:{},..._0x575f03[_0x4a7ca5(0x13b)]!=null?{'riskLevel':_0x575f03[_0x4a7ca5(0x13b)]}:{},..._0x575f03[_0x4a7ca5(0x131)]!=null?{'locale':_0x575f03['locale']}:{}},_0x575f03[_0x4a7ca5(0x16d)]=_0x554f43;if(!_0x575f03[_0x4a7ca5(0x143)])_0x575f03[_0x4a7ca5(0x143)]=_0x47bd72;_0x29f657=!![];}return(_0x4a7ca5(0x15c)in _0x575f03||_0x4a7ca5(0x14b)in _0x575f03)&&(delete _0x575f03[_0x4a7ca5(0x15c)],delete _0x575f03[_0x4a7ca5(0x14b)],_0x29f657=!![]),{'config':_0x575f03,'migrated':_0x29f657};}function writeNormalizedConfigIfNeeded(_0x9ceb6c,_0x418ae8){const _0xdcbfaa=a142_0x138a20,_0x3ccc22=JSON[_0xdcbfaa(0x139)](_0x418ae8,null,0x2)+'\x0a';if(normalizedWriteCache[_0xdcbfaa(0x154)](_0x9ceb6c)===_0x3ccc22)return;writeConfigFile(_0x9ceb6c,_0x418ae8),normalizedWriteCache['set'](_0x9ceb6c,_0x3ccc22);}function parseAndNormalizeConfig(_0x16d25c,_0x5227a5,_0x4ffd66){const _0x37f61c=a142_0x138a20,_0xebf59d=parseCliConfigJsonFile(_0x16d25c,_0x5227a5,_0x4ffd66),_0x223677=normalizeLegacyConfigShape(_0xebf59d);if(_0x223677[_0x37f61c(0x12c)])try{writeNormalizedConfigIfNeeded(_0x16d25c,_0x223677['config']);}catch{}return _0x223677['config'];}export function loadRawConfigLayers(_0x15dddd){const _0x3fa189=a142_0x138a20;let _0x122eed={},_0x2def1c={};const _0x4cf2aa=resolveConfigPath(homedir());_0x4cf2aa&&(_0x122eed=parseAndNormalizeConfig(_0x4cf2aa,_0x3fa189(0x174),_0x3fa189(0x128)));const _0x17fa21=_0x15dddd??findProjectRootDirectory(),_0x5e1d45=resolveConfigPath(_0x17fa21);return _0x5e1d45&&(_0x2def1c=parseAndNormalizeConfig(_0x5e1d45,'warn',_0x3fa189(0x133))),{'globalPath':_0x4cf2aa,'projectPath':_0x5e1d45,'globalConfig':_0x122eed,'projectConfig':_0x2def1c};}const INHERIT_WHITELIST=[a142_0x138a20(0x122),a142_0x138a20(0x14a),a142_0x138a20(0x131),a142_0x138a20(0x136),a142_0x138a20(0x13b),'pageSize'];function mergeRawConfigLayers(_0x4d8f49){const _0x4b7283=a142_0x138a20,{globalConfig:_0x367337,projectConfig:_0x17ea6c}=_0x4d8f49,_0x59db59=Object['keys'](_0x17ea6c)[_0x4b7283(0x144)]>0x0;if(!_0x59db59)return mergeGlobalOnly(_0x367337);if(_0x17ea6c[_0x4b7283(0x156)]===!![])return mergeFullInherit(_0x367337,_0x17ea6c);if(_0x17ea6c[_0x4b7283(0x156)]===![])return mergeIsolated(_0x17ea6c);return mergeProjectFirst(_0x367337,_0x17ea6c);}function mergeGlobalOnly(_0x13ad16){const _0x55f9e4=a142_0x138a20,_0x1dc101={..._0x13ad16},_0x3d96ce=_0x13ad16[_0x55f9e4(0x16d)]&&typeof _0x13ad16[_0x55f9e4(0x16d)]===_0x55f9e4(0x15d)?_0x13ad16[_0x55f9e4(0x16d)]:{};Object[_0x55f9e4(0x129)](_0x3d96ce)[_0x55f9e4(0x144)]>0x0&&(_0x1dc101['apps']=_0x3d96ce);if(_0x13ad16[_0x55f9e4(0x143)])_0x1dc101['defaultApp']=_0x13ad16[_0x55f9e4(0x143)];else{const _0x1f2f84=Object[_0x55f9e4(0x129)](_0x3d96ce);if(_0x1f2f84[_0x55f9e4(0x144)]>0x0)_0x1dc101[_0x55f9e4(0x143)]=_0x1f2f84[0x0];}return _0x1dc101;}function mergeIsolated(_0x3c51a9){const _0x4aa7a8=a142_0x138a20,_0x2c9ca3={..._0x3c51a9};delete _0x2c9ca3['inherit'];const _0x30e3c5=_0x3c51a9[_0x4aa7a8(0x16d)]&&typeof _0x3c51a9['apps']==='object'?_0x3c51a9[_0x4aa7a8(0x16d)]:{};Object[_0x4aa7a8(0x129)](_0x30e3c5)[_0x4aa7a8(0x144)]>0x0?_0x2c9ca3['apps']=_0x30e3c5:delete _0x2c9ca3[_0x4aa7a8(0x16d)];if(_0x4aa7a8(0x143)in _0x3c51a9)_0x2c9ca3[_0x4aa7a8(0x143)]=_0x3c51a9[_0x4aa7a8(0x143)];else Object['keys'](_0x30e3c5)[_0x4aa7a8(0x144)]>0x0?_0x2c9ca3[_0x4aa7a8(0x143)]=Object[_0x4aa7a8(0x129)](_0x30e3c5)[0x0]:delete _0x2c9ca3[_0x4aa7a8(0x143)];return _0x2c9ca3;}function mergeProjectFirst(_0x48e526,_0x4cf8e7){const _0x58c655=a142_0x138a20,_0xc5677e={..._0x4cf8e7};delete _0xc5677e[_0x58c655(0x156)];for(const _0x70e2ee of INHERIT_WHITELIST){!(_0x70e2ee in _0xc5677e)&&_0x70e2ee in _0x48e526&&(_0xc5677e[_0x70e2ee]=_0x48e526[_0x70e2ee]);}const _0xca26b2=_0x4cf8e7[_0x58c655(0x16d)]&&typeof _0x4cf8e7['apps']===_0x58c655(0x15d)?_0x4cf8e7['apps']:{};Object[_0x58c655(0x129)](_0xca26b2)[_0x58c655(0x144)]>0x0?_0xc5677e['apps']=_0xca26b2:delete _0xc5677e[_0x58c655(0x16d)];if('defaultApp'in _0x4cf8e7)_0xc5677e[_0x58c655(0x143)]=_0x4cf8e7['defaultApp'];else Object[_0x58c655(0x129)](_0xca26b2)[_0x58c655(0x144)]>0x0?_0xc5677e[_0x58c655(0x143)]=Object[_0x58c655(0x129)](_0xca26b2)[0x0]:delete _0xc5677e[_0x58c655(0x143)];return _0xc5677e;}function mergeFullInherit(_0xfbff88,_0x30fbfd){const _0x466a1a=a142_0x138a20,_0x57fb35=_0xfbff88[_0x466a1a(0x16d)]&&typeof _0xfbff88[_0x466a1a(0x16d)]==='object'?_0xfbff88[_0x466a1a(0x16d)]:{},_0x1c4e46=_0x30fbfd['apps']&&typeof _0x30fbfd[_0x466a1a(0x16d)]===_0x466a1a(0x15d)?_0x30fbfd[_0x466a1a(0x16d)]:{},_0x21ca54={..._0x57fb35,..._0x1c4e46},_0x1a2e5e={..._0xfbff88,..._0x30fbfd};delete _0x1a2e5e[_0x466a1a(0x156)];Object['keys'](_0x21ca54)[_0x466a1a(0x144)]>0x0&&(_0x1a2e5e['apps']=_0x21ca54);if('defaultApp'in _0x30fbfd)_0x1a2e5e[_0x466a1a(0x143)]=_0x30fbfd['defaultApp'];else{if(Object[_0x466a1a(0x129)](_0x1c4e46)[_0x466a1a(0x144)]>0x0)_0x1a2e5e[_0x466a1a(0x143)]=Object[_0x466a1a(0x129)](_0x1c4e46)[0x0];else{if(_0xfbff88[_0x466a1a(0x143)])_0x1a2e5e[_0x466a1a(0x143)]=_0xfbff88['defaultApp'];else{const _0x34766b=Object[_0x466a1a(0x129)](_0x57fb35);if(_0x34766b[_0x466a1a(0x144)]>0x0)_0x1a2e5e['defaultApp']=_0x34766b[0x0];}}}return _0x1a2e5e;}export function readRawConfigWithLayers(_0xb92357){const _0x3a3c59=loadRawConfigLayers(_0xb92357);return{'config':mergeRawConfigLayers(_0x3a3c59),'layers':_0x3a3c59};}export function readRawConfig(_0x787581){return mergeRawConfigLayers(loadRawConfigLayers(_0x787581));}function a142_0x5510(){const _0x49a441=['length','maxRisk','merged','-api.ts','setLogPath','MAX_RISK','accessKey','app','800LNfgZy','join','utf8','userDomain','.rabetbase.json','string','3483595FofQtA','replace','get','4600752ICbDDu','inherit','write','argv','apiDir','empty','runtimeDomain','appcode','object','template_base_url','36QSUixx','./constant/domain.js','\x0a\x20\x20','trim','ENV','./auth/get-cookie.js','env','cwd','.lovrabetrc','find','252077LPbzuA','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','data','production','apps','globalConfig','true','34301256RXlpGi','silent','pageSize','filter','warn','.tmp','status','parse','COOKIE','cookie','setRawCommand','slice','APP','59022HFDOsS','.lovrabet.json','Global','keys','628727VMqzIn','missing','migrated','PAGE_SIZE','4nqeLjZ','error','./constant/env.js','locale','ACCESS_KEY','Project','entries','126JQmjXj','format','RISK_LEVEL','read','stringify','./utils/is-non-interactive.js','riskLevel','authRequired','77246lWTxex','project','projectConfig','apiDomain','FORMAT','message','defaultApp'];a142_0x5510=function(){return _0x49a441;};return a142_0x5510();}export function getConfigAppCode(_0x4a8064){const _0x1ca953=a142_0x138a20,_0xcc3308=readRawConfig(_0x4a8064);if(_0xcc3308[_0x1ca953(0x16d)]&&typeof _0xcc3308[_0x1ca953(0x16d)]==='object'){const _0x4e5aed=_0xcc3308[_0x1ca953(0x143)];if(_0x4e5aed&&_0xcc3308[_0x1ca953(0x16d)][_0x4e5aed]?.[_0x1ca953(0x15c)])return String(_0xcc3308[_0x1ca953(0x16d)][_0x4e5aed]['appcode'])[_0x1ca953(0x162)]();const _0x5ad176=Object['values'](_0xcc3308[_0x1ca953(0x16d)])[0x0];if(_0x5ad176?.[_0x1ca953(0x15c)])return String(_0x5ad176['appcode'])[_0x1ca953(0x162)]();}const _0x4cb7dd=_0xcc3308['appcode']||_0xcc3308['app'];if(typeof _0x4cb7dd!=='string'||_0x4cb7dd[_0x1ca953(0x162)]()==='')return undefined;return _0x4cb7dd[_0x1ca953(0x162)]();}export function getMultiAppConfigs(_0xe703e=a142_0x138a20(0x13e),_0x3e5877){const _0xfa0519=a142_0x138a20,_0x9718a4=loadRawConfigLayers(_0x3e5877);let _0x96735e,_0xbfce3b;if(_0xe703e===_0xfa0519(0x146)){const _0x1a3fc4=_0x9718a4[_0xfa0519(0x16e)][_0xfa0519(0x16d)]&&typeof _0x9718a4[_0xfa0519(0x16e)][_0xfa0519(0x16d)]==='object'?_0x9718a4[_0xfa0519(0x16e)][_0xfa0519(0x16d)]:{},_0x472464=_0x9718a4[_0xfa0519(0x13f)]['apps']&&typeof _0x9718a4[_0xfa0519(0x13f)][_0xfa0519(0x16d)]===_0xfa0519(0x15d)?_0x9718a4['projectConfig'][_0xfa0519(0x16d)]:{};_0x96735e={..._0x1a3fc4,..._0x472464};const _0x3783f0=readRawConfig(_0x3e5877);_0xbfce3b=_0x3783f0['defaultApp'];}else _0x96735e=_0x9718a4[_0xfa0519(0x13f)][_0xfa0519(0x16d)],_0xbfce3b=_0x9718a4[_0xfa0519(0x13f)][_0xfa0519(0x143)];if(!_0x96735e||typeof _0x96735e!==_0xfa0519(0x15d)||Object['keys'](_0x96735e)[_0xfa0519(0x144)]===0x0)return null;return Object[_0xfa0519(0x134)](_0x96735e)['map'](([_0x4bbf04,_0x4e3efc])=>({'name':_0x4bbf04,'appcode':_0x4e3efc?.[_0xfa0519(0x15c)]||'','isDefault':_0x4bbf04===_0xbfce3b,'env':_0x4e3efc?.['env'],'apiDir':_0x4e3efc?.['apiDir'],'cookie':_0x4e3efc?.[_0xfa0519(0x122)]||undefined}))[_0xfa0519(0x173)](_0x1678a7=>_0x1678a7[_0xfa0519(0x15c)]);}export function getTemplateBaseUrl(_0x544b2d){const _0x3cf2f8=a142_0x138a20,_0x3bcdf5=readRawConfig(_0x544b2d);if(_0x3bcdf5[_0x3cf2f8(0x15e)]&&typeof _0x3bcdf5[_0x3cf2f8(0x15e)]==='string')return _0x3bcdf5[_0x3cf2f8(0x15e)][_0x3cf2f8(0x153)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}export function readConfigFile(_0x5ac835){const _0x17b741=a142_0x138a20;return parseAndNormalizeConfig(_0x5ac835,_0x17b741(0x171));}export function writeConfigFile(_0x7330a7,_0x2ed16a){const _0x28d0a6=a142_0x138a20,_0x174918=dirname(_0x7330a7);!existsSync(_0x174918)&&mkdirSync(_0x174918,{'recursive':!![]});const _0x33fc53=_0x7330a7+_0x28d0a6(0x175);try{writeFileSync(_0x33fc53,JSON[_0x28d0a6(0x139)](_0x2ed16a,null,0x2)+'\x0a',{'encoding':_0x28d0a6(0x14e),'mode':0x180}),renameSync(_0x33fc53,_0x7330a7);}catch(_0x1a4b92){try{unlinkSync(_0x33fc53);}catch{}throw _0x1a4b92;}}export function resolveWriteConfigPath(_0x3a32b9){const _0x239983=a142_0x138a20,_0x1e55f7=_0x3a32b9==='project'?process[_0x239983(0x166)]():homedir(),_0x3afad5=resolveConfigPath(_0x1e55f7);return _0x3afad5??resolve(_0x1e55f7,NEW_CONFIG_NAME);}function buildConfig(_0x775cf4,_0x32f7f0){const _0x48700d=a142_0x138a20,_0x1fdb7f={};if(_0x775cf4[_0x48700d(0x16d)]&&typeof _0x775cf4[_0x48700d(0x16d)]===_0x48700d(0x15d))for(const [_0x35068d,_0x4bccc2]of Object['entries'](_0x775cf4[_0x48700d(0x16d)])){_0x4bccc2&&typeof _0x4bccc2===_0x48700d(0x15d)&&_0x4bccc2['appcode']&&(_0x1fdb7f[_0x35068d]=_0x4bccc2);}const _0x157de1=_0x775cf4[_0x48700d(0x143)]||undefined,_0x108a63=Object['keys'](_0x1fdb7f)[_0x48700d(0x144)]>0x0,_0x122170=_0x32f7f0['app']||env(_0x48700d(0x125))||undefined,_0x2222f5=_0x122170||_0x157de1||undefined,_0x5561fb=_0x32f7f0['appcode']||env('APPCODE')||undefined,_0x6e25b2=_0x5561fb?Object[_0x48700d(0x134)](_0x1fdb7f)['find'](([,_0x296f37])=>_0x296f37?.[_0x48700d(0x15c)]===_0x5561fb):undefined,_0x25890e=_0x6e25b2?.[0x0],_0x33dbfd=_0x6e25b2?.[0x1];let _0x3d3ddc=_0x5561fb?_0x25890e:_0x2222f5,_0x3e68af=_0x3d3ddc&&_0x1fdb7f[_0x3d3ddc]?_0x1fdb7f[_0x3d3ddc]:undefined;_0x5561fb&&_0x33dbfd&&(_0x3e68af=_0x33dbfd);const _0x3688d7=_0x5561fb?_0x33dbfd??_0x3e68af:_0x3e68af,_0x49b230=_0x122170||(_0x5561fb?_0x25890e:undefined),_0x5792d1=_0x5561fb||_0x3688d7?.[_0x48700d(0x15c)]||undefined,_0x293abe=_0x32f7f0[_0x48700d(0x165)]||env(_0x48700d(0x163))||_0x3688d7?.['env']||_0x775cf4[_0x48700d(0x165)]||DEFAULT_CONFIG_VALUES[_0x48700d(0x165)],_0x2cd9a0=_0x3688d7?.[_0x48700d(0x131)]||_0x775cf4[_0x48700d(0x131)]||DEFAULT_CONFIG_VALUES[_0x48700d(0x131)],_0x1ea39f=env(_0x48700d(0x178))||_0x3688d7?.[_0x48700d(0x122)]||_0x775cf4[_0x48700d(0x122)]||undefined,_0x1dbea5=env(_0x48700d(0x132))||_0x3688d7?.[_0x48700d(0x14a)]||_0x775cf4[_0x48700d(0x14a)]||undefined,_0x333de3=_0x32f7f0[_0x48700d(0x136)]||env(_0x48700d(0x141))||_0x3688d7?.[_0x48700d(0x136)]||_0x775cf4['format'],_0x55ca7f=normalizeLegacyOutputFormat(_0x333de3),_0x31b6f5=env(_0x48700d(0x12d))||_0x3688d7?.[_0x48700d(0x172)]||_0x775cf4['pageSize'],_0x28e934=_0x31b6f5?Number(_0x31b6f5)||undefined:undefined,_0x5e4d76=env(_0x48700d(0x137))||env(_0x48700d(0x149))||_0x3688d7?.[_0x48700d(0x13b)]||_0x775cf4[_0x48700d(0x13b)]||_0x775cf4[_0x48700d(0x145)],_0x20c72a=_0x5e4d76===_0x48700d(0x138)||_0x5e4d76===_0x48700d(0x157)?_0x5e4d76:DEFAULT_CONFIG_VALUES[_0x48700d(0x13b)],_0xf9a84d=env('VERBOSE'),_0x521052=_0xf9a84d==='1'||_0xf9a84d===_0x48700d(0x16f),_0x3ef6b1=_0x3688d7?.[_0x48700d(0x159)]||_0x775cf4[_0x48700d(0x159)]||DEFAULT_CONFIG_VALUES[_0x48700d(0x159)],_0x13ade5=isDaily(normalizeEnv(String(_0x293abe)))?'daily':_0x48700d(0x16c);return{'appCode':typeof _0x5792d1===_0x48700d(0x151)&&_0x5792d1['trim']()?_0x5792d1[_0x48700d(0x162)]():undefined,'env':_0x13ade5,'locale':_0x2cd9a0,'cookie':_0x1ea39f,'accessKey':_0x1dbea5,'format':_0x55ca7f,'pageSize':_0x28e934,'riskLevel':_0x20c72a,'verbose':_0x521052,'apiDir':_0x3ef6b1,'apps':_0x1fdb7f,'defaultApp':_0x157de1,'currentApp':_0x108a63?_0x3d3ddc:undefined,'explicitAppName':_0x49b230,'raw':_0x775cf4};}async function buildAuth(_0x3d3b4a){const _0x1c24e6=a142_0x138a20,{getCookie:_0x13c02a}=await import(_0x1c24e6(0x164)),_0x562b4b=_0x3d3b4a[_0x1c24e6(0x122)]||_0x13c02a(),_0x4070c9=_0x562b4b?await getIsSessionValid():![];return{'cookie':_0x562b4b,'isLoggedIn':_0x4070c9,async 'getOrLogin'(){const _0x2269c5=_0x1c24e6;if(_0x562b4b&&_0x4070c9)return _0x562b4b;throw CliErrors[_0x2269c5(0x13c)]();}};}export function resolveApiFilePath(_0x3d3ced,_0x59533c){const _0x1a2e62=a142_0x138a20,_0x16408a=resolve(process[_0x1a2e62(0x166)](),_0x3d3ced),_0x41f1bb=resolve(_0x16408a,'api.ts');if(!_0x59533c)return _0x41f1bb;const _0xfc53da=readRawConfig(),_0x5d6738=_0xfc53da['apps']&&typeof _0xfc53da[_0x1a2e62(0x16d)]===_0x1a2e62(0x15d)?_0xfc53da['apps']:{},_0x467dc2=Object[_0x1a2e62(0x134)](_0x5d6738)[_0x1a2e62(0x168)](([,_0x30a35f])=>_0x30a35f?.[_0x1a2e62(0x15c)]===_0x59533c);if(!_0x467dc2)return _0x41f1bb;const [_0x3141f2,_0x386fb3]=_0x467dc2,_0x51c4aa=typeof _0xfc53da[_0x1a2e62(0x143)]===_0x1a2e62(0x151)?_0xfc53da[_0x1a2e62(0x143)]:undefined;if(_0x386fb3?.[_0x1a2e62(0x159)])return _0x41f1bb;if(_0x51c4aa&&_0x3141f2!==_0x51c4aa)return resolve(_0x16408a,_0x3141f2+_0x1a2e62(0x147));return _0x41f1bb;}
@@ -1 +1 @@
1
- function a143_0x1a88(){const _0x26aa84=['exec','33Brsnaa','get','1482936wmInrN','set','22rejfXs','147SvAOkk','has','81279vzXIqA','utf-8','1032OhJLzB','40686cQKJgD','27330YXPety','12539lstXtv','423vByrPZ','196XTMABW','13mLRDul','api.ts','cwd','find','139510gXfqbE','alias'];a143_0x1a88=function(){return _0x26aa84;};return a143_0x1a88();}(function(_0x50f9b1,_0x2689e2){const _0x5b91c0=a143_0x19c5,_0x501169=_0x50f9b1();while(!![]){try{const _0x266a76=-parseInt(_0x5b91c0(0x1fe))/0x1*(-parseInt(_0x5b91c0(0x1f6))/0x2)+-parseInt(_0x5b91c0(0x1f9))/0x3+parseInt(_0x5b91c0(0x200))/0x4*(-parseInt(_0x5b91c0(0x1fd))/0x5)+parseInt(_0x5b91c0(0x1fc))/0x6*(parseInt(_0x5b91c0(0x1f7))/0x7)+parseInt(_0x5b91c0(0x1fb))/0x8*(parseInt(_0x5b91c0(0x1ff))/0x9)+-parseInt(_0x5b91c0(0x1ef))/0xa*(-parseInt(_0x5b91c0(0x1f2))/0xb)+-parseInt(_0x5b91c0(0x1f4))/0xc*(-parseInt(_0x5b91c0(0x201))/0xd);if(_0x266a76===_0x2689e2)break;else _0x501169['push'](_0x501169['shift']());}catch(_0x37e73f){_0x501169['push'](_0x501169['shift']());}}}(a143_0x1a88,0x264e1));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a143_0x19c5(_0x47889c,_0x429279){_0x47889c=_0x47889c-0x1ed;const _0x1a88e1=a143_0x1a88();let _0x19c523=_0x1a88e1[_0x47889c];return _0x19c523;}function parseApiFile(_0x19afea){const _0x5f3e74=a143_0x19c5,_0xd00d4a=[],_0x248eef=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x4b3b33;while((_0x4b3b33=_0x248eef[_0x5f3e74(0x1f1)](_0x19afea))!==null){_0xd00d4a['push']({'datasetCode':_0x4b3b33[0x1],'tableName':_0x4b3b33[0x2],'name':_0x4b3b33[0x3],'alias':_0x4b3b33[0x4]});}return _0xd00d4a;}export function loadAliasMap(_0x3a3cf6,_0x11f35c,_0x1d401b){const _0x3eaf7d=a143_0x19c5,_0x207eca=_0x1d401b??resolve(process[_0x3eaf7d(0x1ed)](),_0x3a3cf6,_0x3eaf7d(0x202));if(cache[_0x3eaf7d(0x1f8)](_0x207eca))return cache[_0x3eaf7d(0x1f3)](_0x207eca);if(!existsSync(_0x207eca))return cache[_0x3eaf7d(0x1f5)](_0x207eca,[]),[];try{const _0x28f377=readFileSync(_0x207eca,_0x3eaf7d(0x1fa)),_0x1a005e=parseApiFile(_0x28f377);return cache[_0x3eaf7d(0x1f5)](_0x207eca,_0x1a005e),_0x1a005e;}catch{return cache[_0x3eaf7d(0x1f5)](_0x207eca,[]),[];}}export function resolveAlias(_0x4ba9d4,_0x41388e,_0x4515a5,_0x10f944){const _0x55a771=a143_0x19c5;if(!_0x41388e)return undefined;const _0x46908c=loadAliasMap(_0x4ba9d4,_0x4515a5,_0x10f944),_0x5a3995=_0x46908c[_0x55a771(0x1ee)](_0x56b258=>_0x56b258[_0x55a771(0x1f0)]===_0x41388e);return _0x5a3995?.['datasetCode'];}export function listAliases(_0x16716a,_0x248e63,_0x1382ad){return loadAliasMap(_0x16716a,_0x248e63,_0x1382ad);}
1
+ (function(_0x3af45f,_0x1054a0){const _0x51b554=a143_0x3f82,_0x4835b9=_0x3af45f();while(!![]){try{const _0x3e8d74=-parseInt(_0x51b554(0x13a))/0x1+parseInt(_0x51b554(0x136))/0x2*(-parseInt(_0x51b554(0x13e))/0x3)+-parseInt(_0x51b554(0x138))/0x4+-parseInt(_0x51b554(0x135))/0x5*(parseInt(_0x51b554(0x12b))/0x6)+-parseInt(_0x51b554(0x12a))/0x7*(-parseInt(_0x51b554(0x12d))/0x8)+-parseInt(_0x51b554(0x13c))/0x9*(parseInt(_0x51b554(0x130))/0xa)+parseInt(_0x51b554(0x132))/0xb;if(_0x3e8d74===_0x1054a0)break;else _0x4835b9['push'](_0x4835b9['shift']());}catch(_0x536eca){_0x4835b9['push'](_0x4835b9['shift']());}}}(a143_0xd58f,0xa0a1f));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a143_0x3f82(_0x4af363,_0x2fb229){_0x4af363=_0x4af363-0x12a;const _0xd58f77=a143_0xd58f();let _0x3f82ca=_0xd58f77[_0x4af363];return _0x3f82ca;}function a143_0xd58f(){const _0x263364=['10EupIId','alias','27534309rHvltS','utf-8','datasetCode','3075HntQlz','58qSNfXA','exec','392336Scjglk','get','268708PuRUhV','cwd','1665567xHdAQT','set','129897qXvPqB','push','7lwFPDE','5388vUKEdB','api.ts','4117024NutpOv','has','find'];a143_0xd58f=function(){return _0x263364;};return a143_0xd58f();}const cache=new Map();function parseApiFile(_0x96afb0){const _0x2b7a80=a143_0x3f82,_0x4a0140=[],_0x3ee5ae=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x12ec99;while((_0x12ec99=_0x3ee5ae[_0x2b7a80(0x137)](_0x96afb0))!==null){_0x4a0140[_0x2b7a80(0x13f)]({'datasetCode':_0x12ec99[0x1],'tableName':_0x12ec99[0x2],'name':_0x12ec99[0x3],'alias':_0x12ec99[0x4]});}return _0x4a0140;}export function loadAliasMap(_0x2c08a6,_0x56db92,_0x56048d){const _0x2c8174=a143_0x3f82,_0xd3d615=_0x56048d??resolve(process[_0x2c8174(0x13b)](),_0x2c08a6,_0x2c8174(0x12c));if(cache[_0x2c8174(0x12e)](_0xd3d615))return cache[_0x2c8174(0x139)](_0xd3d615);if(!existsSync(_0xd3d615))return cache[_0x2c8174(0x13d)](_0xd3d615,[]),[];try{const _0x2d149a=readFileSync(_0xd3d615,_0x2c8174(0x133)),_0x2bbe0e=parseApiFile(_0x2d149a);return cache['set'](_0xd3d615,_0x2bbe0e),_0x2bbe0e;}catch{return cache['set'](_0xd3d615,[]),[];}}export function resolveAlias(_0x18c543,_0x274e6e,_0x3b6fbb,_0x3d7209){const _0x1baac4=a143_0x3f82;if(!_0x274e6e)return undefined;const _0x46d747=loadAliasMap(_0x18c543,_0x3b6fbb,_0x3d7209),_0x23498d=_0x46d747[_0x1baac4(0x12f)](_0x18875e=>_0x18875e[_0x1baac4(0x131)]===_0x274e6e);return _0x23498d?.[_0x1baac4(0x134)];}export function listAliases(_0x2f724c,_0x387740,_0x4aa71b){return loadAliasMap(_0x2f724c,_0x387740,_0x4aa71b);}
@@ -1 +1 @@
1
- (function(_0x4bce14,_0x3fcd1a){const _0xf5d5e1=a144_0x2891,_0x3c1347=_0x4bce14();while(!![]){try{const _0x34be1d=parseInt(_0xf5d5e1(0x126))/0x1*(parseInt(_0xf5d5e1(0xe9))/0x2)+-parseInt(_0xf5d5e1(0xa0))/0x3+parseInt(_0xf5d5e1(0xdf))/0x4*(parseInt(_0xf5d5e1(0xf0))/0x5)+-parseInt(_0xf5d5e1(0x100))/0x6+-parseInt(_0xf5d5e1(0x135))/0x7*(parseInt(_0xf5d5e1(0x122))/0x8)+parseInt(_0xf5d5e1(0xc7))/0x9+parseInt(_0xf5d5e1(0xc2))/0xa;if(_0x34be1d===_0x3fcd1a)break;else _0x3c1347['push'](_0x3c1347['shift']());}catch(_0x536aa7){_0x3c1347['push'](_0x3c1347['shift']());}}}(a144_0x5dac,0x81f40));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(_0x3c2427){_activeCookie=_0x3c2427||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x1b87dd,_0x17aa71){const _0x5599e4=a144_0x2891,_0xa0e8a4=_0x17aa71 instanceof Error?_0x17aa71[_0x5599e4(0x130)]:String(_0x17aa71);return CliErrors[_0x5599e4(0xe6)]('Request\x20failed:\x20'+_0x1b87dd+(_0xa0e8a4?'\x20('+_0xa0e8a4+')':''),_0x5599e4(0xf2));}async function apiRequest(_0x22abc9,_0x353b77={}){const _0x41e210=a144_0x2891,{method:method=_0x41e210(0x13d),body:_0x2e819d,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x353b77,_0x34bc40=useRuntime?getRuntimeDomain():getApiDomain(),_0x4bb428=_activeCookie||getCookie(),_0x38d691=''+_0x34bc40+_0x22abc9,_0x1ffb86=new AbortController(),_0x24d51d=setTimeout(()=>_0x1ffb86[_0x41e210(0xf7)](),timeout);try{const _0x2d1b93=await fetch(_0x38d691,{'method':method,'headers':{'Content-Type':_0x41e210(0xa2),'Cookie':_0x4bb428,'X-Invoke-Source':_0x41e210(0xe5),...headers},'body':_0x2e819d?JSON[_0x41e210(0xec)](_0x2e819d):undefined,'signal':_0x1ffb86[_0x41e210(0xf5)]});let _0x5c0794;try{_0x5c0794=await _0x2d1b93['json']();}catch{throw CliErrors[_0x41e210(0xe6)](_0x41e210(0xb7)+_0x2d1b93[_0x41e210(0x113)]+')',_0x2d1b93[_0x41e210(0x113)]>=0x190?_0x41e210(0x110):undefined);}if(!_0x2d1b93['ok']||_0x5c0794[_0x41e210(0xba)]===![])throw CliErrors[_0x41e210(0xe6)](_0x5c0794[_0x41e210(0xaa)]||_0x5c0794[_0x41e210(0x130)]||_0x41e210(0x115)+_0x2d1b93[_0x41e210(0x113)],_0x5c0794[_0x41e210(0xcf)]?_0x41e210(0xe1)+_0x5c0794['errorCode']:undefined);return _0x5c0794;}catch(_0x38e524){if(_0x38e524 instanceof CliError)throw _0x38e524;if(_0x38e524 instanceof Error&&_0x38e524['name']===_0x41e210(0x116))throw CliErrors[_0x41e210(0xe6)]('Request\x20timeout:\x20'+_0x38d691);throw createFetchFailureError(_0x38d691,_0x38e524);}finally{clearTimeout(_0x24d51d);}}function isAuthFailure(_0x4fac35){const _0xd1ddde=a144_0x2891,_0x4832d4=_0x4fac35['errorMsg']||_0x4fac35[_0xd1ddde(0x130)]||_0x4fac35[_0xd1ddde(0xe3)]?.['message']||_0x4fac35[_0xd1ddde(0xc3)]||_0x4fac35[_0xd1ddde(0xdb)]||'';return _0x4fac35['errorCode']===_0xd1ddde(0x11e)||_0x4fac35[_0xd1ddde(0x13f)]===0x191||_0x4fac35[_0xd1ddde(0x13f)]===_0xd1ddde(0xbc)||_0x4832d4[_0xd1ddde(0xe4)](_0xd1ddde(0xbc))||_0x4832d4[_0xd1ddde(0xe4)]('Unauthorized')||_0x4832d4['includes']('登录')||_0x4832d4[_0xd1ddde(0xe4)]('认证');}export async function platformFetch(_0x112d21,_0x409363){const _0x61fdd9=a144_0x2891;let _0x2b9ae1;try{_0x2b9ae1=await fetch(_0x112d21,{'method':_0x409363[_0x61fdd9(0xd9)]??_0x61fdd9(0x13d),'headers':{'Content-Type':_0x61fdd9(0xa2),'Cookie':_0x409363['cookie'],'X-Invoke-Source':_0x61fdd9(0xe5)},..._0x409363[_0x61fdd9(0x11a)]&&{'body':JSON[_0x61fdd9(0xec)](_0x409363[_0x61fdd9(0x11a)])}});}catch(_0x1d6038){throw createFetchFailureError(_0x112d21,_0x1d6038);}if(!_0x2b9ae1['ok']){if(_0x2b9ae1[_0x61fdd9(0x113)]===0x191)throw CliErrors[_0x61fdd9(0xf4)]();throw CliErrors[_0x61fdd9(0xe6)](_0x409363[_0x61fdd9(0x12c)]+_0x61fdd9(0xfb)+_0x2b9ae1[_0x61fdd9(0x113)]);}const _0x30d88a=await _0x2b9ae1[_0x61fdd9(0xf8)]();if(_0x30d88a['success']===![]){if(isAuthFailure(_0x30d88a))throw CliErrors[_0x61fdd9(0xf4)]();throw CliErrors[_0x61fdd9(0xe6)](_0x30d88a[_0x61fdd9(0xaa)]||_0x30d88a[_0x61fdd9(0x130)]||_0x409363[_0x61fdd9(0x12c)]+_0x61fdd9(0x107));}return _0x30d88a[_0x61fdd9(0xe3)];}export async function listBffScripts(_0x31ec16,_0x1bc714,_0x3a6408){const _0x322702=a144_0x2891;let _0x164418=_0x322702(0xcc)+_0x31ec16;if(_0x1bc714)_0x164418+='&type='+_0x1bc714;const _0x25051c=await apiRequest(_0x164418);let _0x2089af=extractList(_0x25051c['data']);if(_0x3a6408?.['scriptName']){const _0xe392ad=_0x3a6408[_0x322702(0x138)][_0x322702(0xed)]();_0x2089af=_0x2089af[_0x322702(0x13e)](_0x132135=>_0x132135[_0x322702(0x118)]?.[_0x322702(0xed)]()[_0x322702(0xe4)](_0xe392ad)||_0x132135['description']?.[_0x322702(0xed)]()[_0x322702(0xe4)](_0xe392ad));}return _0x2089af;}export async function getBffScriptInfo(_0x3e5c52){const _0x575cab=a144_0x2891,_0x18a317=await apiRequest(_0x575cab(0x10b)+_0x3e5c52);if(!_0x18a317['data'])throw CliErrors['validation'](_0x575cab(0x11c)+_0x3e5c52);return _0x18a317[_0x575cab(0xe3)];}export async function saveBffScript(_0x59ea3d){const _0x5efa13=a144_0x2891,_0x4fe2e0=await apiRequest('/api/management/library/scripts/save',{'method':_0x5efa13(0xca),'body':_0x59ea3d}),{id:_0x20902a,entity:_0x2b99bc}=normalizeEntityWithIdResponse(_0x4fe2e0[_0x5efa13(0xe3)]);if(_0x20902a!==undefined){const _0x2fc92f=typeof _0x2b99bc[_0x5efa13(0x118)]==='string'||typeof _0x2b99bc[_0x5efa13(0xae)]==='string'?_0x2b99bc:undefined;return{'id':_0x20902a,'script':_0x2fc92f};}throw CliErrors[_0x5efa13(0xe6)](_0x5efa13(0xa7));}export async function deleteBffScript(_0x14e5fb){const _0x3c1d77=a144_0x2891;await apiRequest(_0x3c1d77(0xef),{'method':_0x3c1d77(0xca),'body':{'id':_0x14e5fb}});}export async function getBffScriptStatistics(_0x5731fb){const _0x36ad1b=a144_0x2891,_0x11e258=await apiRequest(_0x36ad1b(0xf9)+_0x5731fb);return extractList(_0x11e258[_0x36ad1b(0xe3)]);}export async function clearBffScriptCache(){const _0x289c41=a144_0x2891,_0x4fc321=await apiRequest(_0x289c41(0xb4),{'method':_0x289c41(0xca),'useRuntime':!![]});return typeof _0x4fc321['data']===_0x289c41(0xa8)?_0x4fc321[_0x289c41(0xe3)]:'';}export async function listBffDatasetOperations(_0x3c4a41,_0x40aa9d){const _0x280aac=a144_0x2891,_0x171e34=await apiRequest(_0x280aac(0xc1),{'method':_0x280aac(0xca),'body':{'appCode':_0x3c4a41,'datasetId':_0x40aa9d}});return _0x171e34[_0x280aac(0xe3)];}export async function listSqlQueries(_0x3221b7,_0x150b3c){const _0x199149=a144_0x2891,_0x1810b7=await apiRequest(_0x199149(0xb3),{'method':_0x199149(0xca),'body':{'appCode':_0x3221b7,'currentPage':_0x150b3c?.[_0x199149(0x136)]??0x1,'pageSize':_0x150b3c?.[_0x199149(0x109)]??0x32,'sqlCode':_0x150b3c?.['sqlCode'],'sqlName':_0x150b3c?.[_0x199149(0x106)]}});return _0x1810b7['data'];}export async function getSqlQueryInfo(_0x2bebb8,_0x4760ad){const _0x84a63b=a144_0x2891,_0x19ea28=await listSqlQueries(_0x2bebb8,{'sqlCode':_0x4760ad}),_0x299df8=_0x19ea28[_0x84a63b(0xab)]?.[0x0];if(!_0x299df8)throw CliErrors[_0x84a63b(0xd4)]('SQL\x20query\x20not\x20found:\x20'+_0x4760ad);return _0x299df8;}export async function getSqlQueryDetail(_0x4c9f1f){const _0x4d3418=a144_0x2891,_0x479efc=await apiRequest(_0x4d3418(0x13b)+(_0x4d3418(0x11d)+encodeURIComponent(_0x4c9f1f)));if(!_0x479efc[_0x4d3418(0xe3)])throw CliErrors[_0x4d3418(0xd4)](_0x4d3418(0xfe)+_0x4c9f1f);return _0x479efc[_0x4d3418(0xe3)];}export async function getSqlQueryDetailById(_0x2b37ca){const _0x1b1b06=a144_0x2891,_0x385682=await apiRequest(_0x1b1b06(0xe8)+_0x2b37ca);if(!_0x385682['data'])throw CliErrors[_0x1b1b06(0xd4)](_0x1b1b06(0xcd)+_0x2b37ca);return _0x385682[_0x1b1b06(0xe3)];}export async function createSqlQuery(_0x3f7cb7){const _0x13965a=a144_0x2891,_0x35a93a=await apiRequest(_0x13965a(0x129),{'method':'POST','body':_0x3f7cb7}),{id:_0x3a4e98,entity:_0x3083f9}=normalizeEntityWithIdResponse(_0x35a93a[_0x13965a(0xe3)]);if(!(_0x13965a(0x127)in _0x3083f9)&&_0x3a4e98)return getSqlQueryDetailById(_0x3a4e98);return normalizeSqlQueryEntity(_0x3083f9);}export async function updateSqlQuery(_0x20e6f2){const _0x507851=a144_0x2891,_0x16a21a=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':'POST','body':_0x20e6f2}),{id:_0x4edf51,entity:_0x1b5898}=normalizeEntityWithIdResponse(_0x16a21a[_0x507851(0xe3)]);if(!(_0x507851(0x127)in _0x1b5898)){if(_0x20e6f2[_0x507851(0x127)])return getSqlQueryDetail(_0x20e6f2[_0x507851(0x127)]);if(_0x4edf51)return getSqlQueryDetailById(_0x4edf51);}return normalizeSqlQueryEntity(_0x1b5898);}export async function deleteSqlQuery(_0x16451b){const _0x19b121=a144_0x2891;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x19b121(0xca),'body':_0x16451b});}export async function saveSqlQuery(_0x261d2c){const _0x4684cd=a144_0x2891,_0x399318=await apiRequest(_0x4684cd(0xb5),{'method':_0x4684cd(0xca),'body':_0x261d2c});return _0x399318[_0x4684cd(0xe3)];}function normalizeSqlQueryEntity(_0x4f1540){const _0xb5e811=a144_0x2891;return{..._0x4f1540,'id':Number(_0x4f1540['id']),'dbId':_0x4f1540[_0xb5e811(0x141)]==null?undefined:Number(_0x4f1540[_0xb5e811(0x141)]),'version':_0x4f1540[_0xb5e811(0xbd)]==null?undefined:Number(_0x4f1540[_0xb5e811(0xbd)])};}export async function executeSql(_0x21b1b6,_0x5784de,_0x215ca5){const _0x15a267=a144_0x2891,_0x260d81=await apiRequest('/api/custom/executeSql',{'method':'POST','body':{'appCode':_0x21b1b6,'sqlCode':_0x5784de,..._0x215ca5&&{'params':_0x215ca5}},'useRuntime':!![]});return _0x260d81[_0x15a267(0xe3)];}export async function executeDatasetDataOperation(_0x13351d,_0x18b1db,_0x5cc838,_0x21278e={}){const _0x282026=a144_0x2891;try{const _0x5a8bfc=await apiRequest(_0x282026(0x125)+_0x13351d+'/'+_0x18b1db+'/'+_0x5cc838,{'method':_0x282026(0xca),'body':_0x21278e,'useRuntime':!![]});return _0x5a8bfc[_0x282026(0xe3)];}catch(_0x18e22f){if(_0x5cc838===_0x282026(0x137)&&_0x18e22f instanceof CliError&&_0x18e22f[_0x282026(0x13f)]==='api_error'&&_0x21278e['id']!==undefined&&_0x21278e['id']!==null&&_0x21278e['id']!==''){const _0x14df68=await apiRequest(_0x282026(0x125)+_0x13351d+'/'+_0x18b1db+_0x282026(0xe7),{'method':'POST','body':{'where':{'id':{'$eq':_0x21278e['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x3b50fc=Array[_0x282026(0x10e)](_0x14df68[_0x282026(0xe3)]?.['tableData'])?_0x14df68['data']['tableData']:[];return _0x3b50fc[0x0]??null;}throw _0x18e22f;}}export async function listDatasets(_0x395558,_0x2addcc){const _0x47e3ec=a144_0x2891,_0x34a283={'appCode':_0x395558,'deleted':![]};if(_0x2addcc?.[_0x47e3ec(0x13f)])_0x34a283[_0x47e3ec(0x13f)]=_0x2addcc[_0x47e3ec(0x13f)];if(_0x2addcc?.[_0x47e3ec(0x101)])_0x34a283['name']=_0x2addcc[_0x47e3ec(0x101)];const _0x111159=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':'POST','body':_0x34a283});return extractList(_0x111159[_0x47e3ec(0xe3)]);}export async function deleteDataset(_0x3dd2d2,_0x5d95d6){const _0xe20bd2=a144_0x2891;await apiRequest(_0xe20bd2(0xde),{'method':'POST','body':{'appCode':_0x3dd2d2,'datasetId':_0x5d95d6}});}export async function searchDatasets(_0x5c304f,_0x1b15d5){const _0x3851fd=a144_0x2891,_0x31e6d2=await listDatasets(_0x5c304f,{'name':_0x1b15d5}),_0x53ab8c=_0x1b15d5[_0x3851fd(0xed)](),_0x3dd1da=new Set(_0x31e6d2[_0x3851fd(0xe2)](_0x1f5e41=>_0x1f5e41['id'])),_0x1473b1=_0x31e6d2[_0x3851fd(0x13e)](_0x3821c4=>_0x3821c4[_0x3851fd(0x10f)]?.[_0x3851fd(0xa6)]?.['toLowerCase']()[_0x3851fd(0xe4)](_0x53ab8c)||_0x3821c4[_0x3851fd(0x104)]?.['toLowerCase']()[_0x3851fd(0xe4)](_0x53ab8c)),_0x4e9c89=await listDatasets(_0x5c304f,{'code':_0x1b15d5});for(const _0x2fd0ea of _0x4e9c89){!_0x3dd1da[_0x3851fd(0xc9)](_0x2fd0ea['id'])&&(_0x31e6d2[_0x3851fd(0x131)](_0x2fd0ea),_0x3dd1da[_0x3851fd(0xc5)](_0x2fd0ea['id']));}return _0x31e6d2;}export function normalizeDatasetOperations(_0x1fa50e){const _0x2e604d=a144_0x2891;if(Array[_0x2e604d(0x10e)](_0x1fa50e))return _0x1fa50e['filter'](_0x276f53=>_0x276f53!=null&&typeof _0x276f53===_0x2e604d(0xb2));if(_0x1fa50e&&typeof _0x1fa50e===_0x2e604d(0xb2))return Object['entries'](_0x1fa50e)[_0x2e604d(0x13e)](([,_0x34f82d])=>_0x34f82d!=null&&typeof _0x34f82d===_0x2e604d(0xb2))[_0x2e604d(0xe2)](([_0xc9a91f,_0x2a5e86])=>({..._0x2a5e86,'name':_0x2a5e86[_0x2e604d(0x101)]??_0x2a5e86[_0x2e604d(0x10d)]??_0xc9a91f}));return[];}export async function getDatasetDetail(_0x2c9b44){const _0x16c415=a144_0x2891,_0x27e4fa=/^\d+$/[_0x16c415(0x12e)](_0x2c9b44)?'id':_0x16c415(0x13f),_0x29d197=await apiRequest(_0x16c415(0x132)+_0x27e4fa+'='+_0x2c9b44);return _0x29d197[_0x16c415(0xe3)];}function a144_0x2891(_0x1535e9,_0x476a1e){_0x1535e9=_0x1535e9-0xa0;const _0x5dac7a=a144_0x5dac();let _0x28912a=_0x5dac7a[_0x1535e9];return _0x28912a;}export async function updateDrivenData(_0x5f47ae){const _0x428ef9=a144_0x2891,_0x5d06f3=await apiRequest(_0x428ef9(0xd3),{'method':_0x428ef9(0xca),'body':_0x5f47ae});return _0x5d06f3[_0x428ef9(0xe3)];}export async function getDatasetOperations(_0xdd8ed3){const _0x428cd2=a144_0x2891,_0x53603d=await getDatasetDetail(_0xdd8ed3),_0x29fad4=normalizeDatasetOperations(_0x53603d[_0x428cd2(0x121)])['map'](_0x34e2aa=>({'name':_0x34e2aa[_0x428cd2(0x101)]||_0x34e2aa['operationName'],'displayName':_0x34e2aa[_0x428cd2(0xd7)]||_0x34e2aa[_0x428cd2(0x101)],'type':_0x34e2aa[_0x428cd2(0x11f)],'method':_0x34e2aa[_0x428cd2(0xd9)],'path':_0x34e2aa[_0x428cd2(0x117)],'enabled':_0x34e2aa[_0x428cd2(0x119)]??!![],'requestFields':_0x34e2aa['requestFields'],'responseFields':_0x34e2aa[_0x428cd2(0x11b)]}));return{'dataset':{'id':_0x53603d['id']??_0x53603d[_0x428cd2(0xbb)],'name':_0x53603d[_0x428cd2(0x101)],'code':_0x53603d[_0x428cd2(0x13f)]||_0x53603d[_0x428cd2(0x142)],'tableName':_0x53603d['tableName']||_0x53603d['dbtableConfig']?.[_0x428cd2(0xa6)]},'operations':_0x29fad4};}export async function getOperationDetail(_0x2e3b28,_0x40ff14,_0x557cc6){const _0x5b4ad5=a144_0x2891;let _0x2886c8=_0x40ff14;if(!/^\d+$/[_0x5b4ad5(0x12e)](_0x40ff14)){const _0x46611e=await listDatasets(_0x2e3b28,{'code':_0x40ff14}),_0x3b319e=_0x46611e[_0x5b4ad5(0xc8)](_0x2d4e72=>_0x2d4e72['code']===_0x40ff14||String(_0x2d4e72['id'])===_0x40ff14);if(!_0x3b319e)throw CliErrors[_0x5b4ad5(0xd4)](_0x5b4ad5(0x123)+_0x40ff14);_0x2886c8=String(_0x3b319e['id']);}const _0x2d9742=await getDatasetDetail(_0x2886c8),_0x688b0c=normalizeDatasetOperations(_0x2d9742[_0x5b4ad5(0x121)])[_0x5b4ad5(0xc8)](_0x4a7c16=>(_0x4a7c16[_0x5b4ad5(0x101)]||_0x4a7c16[_0x5b4ad5(0x10d)])===_0x557cc6);if(!_0x688b0c)throw CliErrors[_0x5b4ad5(0xd4)](_0x5b4ad5(0xd8)+_0x557cc6+_0x5b4ad5(0xda)+_0x40ff14);return{'dataset':{'id':_0x2d9742['id']??_0x2d9742[_0x5b4ad5(0xbb)],'name':_0x2d9742['name'],'code':_0x2d9742['code']||_0x2d9742[_0x5b4ad5(0x142)],'tableName':_0x2d9742['tableName']||_0x2d9742[_0x5b4ad5(0x10f)]?.['tableName']},'operation':_0x688b0c};}export async function startGenerateStandardPages(_0x554968,_0x466bfb,_0x351ace){const _0x4b273b=a144_0x2891,_0x15e50d=await apiRequest(_0x4b273b(0xbf)+_0x466bfb+'/generate-standard-pages/start',{'method':_0x4b273b(0xca),'body':{'appCode':_0x554968,..._0x351ace?.['clientOperationId']?{'clientOperationId':_0x351ace[_0x4b273b(0xb1)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x15e50d['data'];}function a144_0x5dac(){const _0x2022c3=['SQL\x20query\x20not\x20found:\x20id=','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','errorCode','.getOne(id);','set','target','/smartapi/dataset/update-driven-data','validation','/smartapi/dblink/create','});','displayName','Operation\x20\x22','method','\x22\x20not\x20found\x20in\x20dataset\x20','error','/smartapi/dblink/getTableDiffV2ByPage','/smartapi/question/er-config','/smartapi/dataset/delete-dataset','176QNgnnL','.remove(id);','API\x20error\x20code:\x20','map','data','includes','cli:rabetbase','apiError','/filter','/smartapi/custom/getUserCustomSql?id=','1154rFdmDZ','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','\x20\x20\x20\x20sqlCode:\x20\x27','stringify','toLowerCase','pageIndex','/api/management/library/scripts/delete','120935JQnmtA','\x20\x20where:\x20{},','Check\x20network\x20connectivity\x20and\x20try\x20again.','const\x20results\x20=\x20data.execResult\x20||\x20[];','authRequired','signal','/standard-page-status?appCode=','abort','json','/api/management/library/scripts/statistics?appCode=','\x20apps.\x20','\x20failed,\x20HTTP\x20','warn','/smartapi/dblink/getList','SQL\x20query\x20not\x20found:\x20','/smartapi/dblink/testConnect','3371502WIHLUX','name','tableList','update','description','join','sqlName','\x20failed','/smartapi/question/er-config/erCreate','pageSize','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/api/management/library/scripts/info?id=','/smartapi/dblink/getOne','operationName','isArray','dbtableConfig','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/dblink/getAllTableList','/smartapi/db-analysis/jobs/cancel','status','/smartapi/app/getList','API\x20error:\x20','AbortError','path','functionName','enabled','body','responseFields','BFF\x20script\x20not\x20found:\x20id=','?sqlCode=','UNAUTHORIZED','type','/smartapi/db-analysis/status/','operations','8KyWCmo','Dataset\x20not\x20found:\x20','includeImports','/api/','197XQzYkt','sqlCode','sdk','/smartapi/custom/saveUserCustomSql','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','toString','label','/smartapi/question/er-config/update-single','test','const\x20data\x20=\x20await\x20client.sql.execute({','message','push','/smartapi/dataset/get-driven-data?','/smartapi/dblink/update','planId','2177847zftPfC','currentPage','getOne','scriptName','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','\x20of\x20','/smartapi/custom/getUserCustomSql','(/*\x20params\x20*/);','GET','filter','code','api_error','dbId','modelCode','const\x20result\x20=\x20await\x20client.models.','908547cuMWxT','length','application/json','/smartapi/lovrabet/update-page','/smartapi/lovrabet/detail?pageId=','totalCount','tableName','BFF\x20save\x20returned\x20no\x20valid\x20id','string','\x20\x20return\x20rows;','errorMsg','tableData','/sync-to-pages','delete','scriptType','remove','.create({\x20/*\x20fields\x20*/\x20});','clientOperationId','object','/smartapi/custom/queryUserCustomSqlList','/api/management/script/cache/clear','/api/node-toolbox/sql/save','Warning:\x20showing\x20first\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','operationId','table','success','modelId','401','version','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/lovrabet/dataset/','\x20\x20currentPage:\x201,','/smartapi/dataset/get-dataset-operation','192380eQIQVG','errorMessage','/smartapi/dblink/delete','add','/smartapi/db-analysis/start','4599360rpYtPT','find','has','POST','/smartapi/question/er-config/erDelete','/api/management/library/scripts/list?appCode='];a144_0x5dac=function(){return _0x2022c3;};return a144_0x5dac();}export async function getGenerateStandardPagesStatus(_0x59ddc3,_0x1e6aa4,_0x278fc2){const _0x2bc23c=a144_0x2891,_0x4e4264=new URLSearchParams({'appCode':_0x59ddc3});_0x278fc2[_0x2bc23c(0xb8)]&&_0x4e4264[_0x2bc23c(0xd1)](_0x2bc23c(0xb8),_0x278fc2[_0x2bc23c(0xb8)]);_0x278fc2[_0x2bc23c(0xb1)]&&_0x4e4264['set'](_0x2bc23c(0xb1),_0x278fc2[_0x2bc23c(0xb1)]);const _0x78f49b=await apiRequest(_0x2bc23c(0xbf)+_0x1e6aa4+'/generate-standard-pages/status?'+_0x4e4264[_0x2bc23c(0x12b)]());return _0x78f49b[_0x2bc23c(0xe3)];}export async function getStandardPageStatus(_0x13fdf0,_0xea25fe){const _0x5a8418=a144_0x2891,_0x2865ce=await apiRequest(_0x5a8418(0xbf)+_0xea25fe+_0x5a8418(0xf6)+encodeURIComponent(_0x13fdf0));return _0x2865ce['data'];}export async function tryGetStandardPageStatus(_0x31d0db,_0x4a54bc){const _0x1317f6=a144_0x2891;try{return await getStandardPageStatus(_0x31d0db,_0x4a54bc);}catch(_0x57b2da){if(_0x57b2da instanceof CliError&&_0x57b2da[_0x1317f6(0x13f)]===_0x1317f6(0x140)&&/404|not found|non-json response/i[_0x1317f6(0x12e)](_0x57b2da[_0x1317f6(0x130)]))return null;throw _0x57b2da;}}export async function syncStandardPages(_0x3c9832,_0x17199c){const _0x3cc2e6=a144_0x2891,_0x659dd2=await apiRequest(_0x3cc2e6(0xbf)+_0x17199c+_0x3cc2e6(0xac),{'method':'POST','body':{'appCode':_0x3c9832}});return _0x659dd2[_0x3cc2e6(0xe3)];}export async function getPageDetail(_0x3a876b){const _0x1fa94=a144_0x2891,_0x99bcc4=await apiRequest(_0x1fa94(0xa4)+_0x3a876b);if(!_0x99bcc4['data'])throw CliErrors['validation']('Page\x20not\x20found:\x20'+_0x3a876b);return _0x99bcc4[_0x1fa94(0xe3)];}export async function updatePage(_0x30d733,_0x81e9d6,_0x111e69,_0x18b461){const _0xa411c0=a144_0x2891,_0x1df664=await apiRequest(_0xa411c0(0xa3),{'method':_0xa411c0(0xca),'body':{'appCode':_0x30d733,'pageId':_0x81e9d6,'code':_0x111e69,'datasetIds':_0x18b461}});return _0x1df664[_0xa411c0(0xe3)];}export function generateSdkCode(_0x150517,_0x14a233,_0x2b7b05){const _0x1b9e83=a144_0x2891,_0xe0dc53=_0x2b7b05?.[_0x1b9e83(0x124)]??!![],_0x25e5bd='dataset_'+_0x150517[_0x1b9e83(0x13f)]?.['replace'](/-/g,'_'),_0xcd0803=_0x14a233[_0x1b9e83(0x101)]||_0x14a233[_0x1b9e83(0x10d)]||'filter',_0x18d770=[];_0xe0dc53&&_0x18d770['push'](_0x1b9e83(0x10a),'',_0x1b9e83(0xbe),'');_0x18d770[_0x1b9e83(0x131)]('//\x20'+_0x150517[_0x1b9e83(0x101)]+'\x20('+(_0x150517[_0x1b9e83(0xa6)]||_0x1b9e83(0xb9))+')');if(_0xcd0803===_0x1b9e83(0x13e))_0x18d770[_0x1b9e83(0x131)](_0x1b9e83(0x143)+_0x25e5bd+'.filter({',_0x1b9e83(0xf1),'\x20\x20pageSize:\x2020,',_0x1b9e83(0xc0),_0x1b9e83(0xd6));else{if(_0xcd0803===_0x1b9e83(0x137))_0x18d770[_0x1b9e83(0x131)](_0x1b9e83(0x143)+_0x25e5bd+_0x1b9e83(0xd0));else{if(_0xcd0803==='create')_0x18d770[_0x1b9e83(0x131)](_0x1b9e83(0x143)+_0x25e5bd+_0x1b9e83(0xb0));else{if(_0xcd0803===_0x1b9e83(0x103))_0x18d770[_0x1b9e83(0x131)](_0x1b9e83(0x143)+_0x25e5bd+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0xcd0803===_0x1b9e83(0xad)||_0xcd0803===_0x1b9e83(0xaf)?_0x18d770['push'](_0x1b9e83(0x143)+_0x25e5bd+_0x1b9e83(0xe0)):_0x18d770[_0x1b9e83(0x131)](_0x1b9e83(0x143)+_0x25e5bd+'.'+_0xcd0803+_0x1b9e83(0x13c));}}}return _0x18d770[_0x1b9e83(0x105)]('\x0a');}export function generateSqlCodeTemplate(_0x3ff4a9,_0xfc5b6d){const _0x569661=a144_0x2891,_0xeb9441=_0xfc5b6d?.[_0x569661(0xd2)]??_0x569661(0x128),_0x334c28=_0xfc5b6d?.[_0x569661(0x124)]??!![],_0x84e013=[];return _0x84e013[_0x569661(0x131)]('//\x20SQL:\x20'+_0x3ff4a9[_0x569661(0x106)]+'\x20('+_0x3ff4a9['sqlCode']+')'),_0xeb9441===_0x569661(0x128)?(_0x334c28&&_0x84e013[_0x569661(0x131)](_0x569661(0x10a),'',_0x569661(0xbe),''),_0x84e013[_0x569661(0x131)](_0x569661(0x12f),'\x20\x20sqlCode:\x20\x27'+_0x3ff4a9['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x569661(0xd6),_0x569661(0x139),_0x569661(0xf3))):_0x84e013['push'](_0x569661(0xea),_0x569661(0x12a),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x569661(0xeb)+_0x3ff4a9[_0x569661(0x127)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x569661(0xa9),'}'),_0x84e013['join']('\x0a');}export async function getErConfig(_0xecf8df,_0x5386c5){const _0x2ed27c=a144_0x2891,_0x49b2dc=await apiRequest(_0x2ed27c(0xdd),{'method':_0x2ed27c(0xca),'body':{'appCode':_0xecf8df,'dblinkId':_0x5386c5}});return _0x49b2dc[_0x2ed27c(0xe3)];}export async function createErRelation(_0x59011f){const _0x15e0d5=a144_0x2891,_0x3f3e4d=await apiRequest(_0x15e0d5(0x108),{'method':'POST','body':_0x59011f});return _0x3f3e4d[_0x15e0d5(0xe3)];}export async function updateErRelation(_0x23546b){const _0x41e3ff=a144_0x2891,_0x44e1be=await apiRequest(_0x41e3ff(0x12d),{'method':_0x41e3ff(0xca),'body':_0x23546b});return _0x44e1be['data'];}export async function deleteErRelation(_0xb9a3f8){const _0x2e81cd=a144_0x2891,_0x4052c5=await apiRequest(_0x2e81cd(0xcb),{'method':_0x2e81cd(0xca),'body':_0xb9a3f8});return _0x4052c5[_0x2e81cd(0xe3)];}function buildQuery(_0x413bbe){const _0x31bbf2=a144_0x2891,_0x4c0922=new URLSearchParams();for(const [_0x3071e8,_0x4863ea]of Object['entries'](_0x413bbe)){if(_0x4863ea===undefined||_0x4863ea==='')continue;_0x4c0922[_0x31bbf2(0xd1)](_0x3071e8,String(_0x4863ea));}const _0x1796e4=_0x4c0922[_0x31bbf2(0x12b)]();return _0x1796e4?'?'+_0x1796e4:'';}export async function listDbLinks(_0x307097,_0x1b0438){const _0x2086b9=a144_0x2891,_0x215f4a=await apiRequest(_0x2086b9(0xfd),{'method':_0x2086b9(0xca),'body':{'appCode':_0x307097,'currentPage':_0x1b0438?.['currentPage']??0x1,'pageSize':_0x1b0438?.[_0x2086b9(0x109)]??0x64}});return{'items':extractList(_0x215f4a[_0x2086b9(0xe3)]),'paging':extractPaging(_0x215f4a['data'])};}export async function getDbLinkInfo(_0x7b6f3d){const _0x5139c1=a144_0x2891,_0x4034f3=await apiRequest(_0x5139c1(0x10c)+buildQuery({'id':_0x7b6f3d}));return _0x4034f3[_0x5139c1(0xe3)];}export async function createDbLink(_0x5626b7){const _0x5a45ae=a144_0x2891,_0x65aebb=await apiRequest(_0x5a45ae(0xd5),{'method':'POST','body':_0x5626b7});return _0x65aebb[_0x5a45ae(0xe3)];}export async function updateDbLink(_0xdfb317){const _0x352450=a144_0x2891,_0x5e70da=await apiRequest(_0x352450(0x133),{'method':_0x352450(0xca),'body':_0xdfb317});return _0x5e70da[_0x352450(0xe3)];}export async function deleteDbLink(_0x40a830){const _0x10166a=a144_0x2891;await apiRequest(_0x10166a(0xc4),{'method':'POST','body':{'id':_0x40a830}});}export async function testDbLinkConnect(_0x252817){const _0x14844c=a144_0x2891,_0x506dc2=await apiRequest(_0x14844c(0xff)+buildQuery({'id':_0x252817}));return _0x506dc2[_0x14844c(0xe3)];}export async function startDbAnalysis(_0x3874d1,_0x334918){const _0x2e7a44=a144_0x2891,_0x2155d9=await apiRequest(_0x2e7a44(0xc6),{'method':_0x2e7a44(0xca),'body':{'dbLinkId':_0x3874d1,..._0x334918&&_0x334918[_0x2e7a44(0xa1)]>0x0?{'tableNames':_0x334918}:{}}}),_0x33e605=_0x2155d9[_0x2e7a44(0xe3)];if(typeof _0x33e605===_0x2e7a44(0xa8))return _0x33e605;if(_0x33e605&&typeof _0x33e605==='object'&&typeof _0x33e605['planId']===_0x2e7a44(0xa8))return _0x33e605[_0x2e7a44(0x134)];return _0x33e605!=null?String(_0x33e605):'';}export async function cancelDbAnalysis(_0x671ed2){const _0x477f61=a144_0x2891;await apiRequest(_0x477f61(0x112)+buildQuery({'planId':_0x671ed2}),{'method':_0x477f61(0xca)});}export async function getDbAnalysisStatus(_0x23242e){const _0x20ddb9=a144_0x2891,_0x2913eb=await apiRequest(_0x20ddb9(0x120)+encodeURIComponent(_0x23242e));return _0x2913eb[_0x20ddb9(0xe3)];}export async function getDbAllTableList(_0x33f4e2,_0x36da90){const _0x24d477=a144_0x2891,_0x31c7b5=await apiRequest(_0x24d477(0x111)+buildQuery({'appCode':_0x33f4e2,'dbLinkId':_0x36da90})),_0x3d995b=_0x31c7b5['data'];if(Array[_0x24d477(0x10e)](_0x3d995b))return _0x3d995b;return extractList(_0x3d995b);}export async function getDbTableDiff(_0x377333,_0x39d413,_0x366d32){const _0x52c6e1=a144_0x2891,_0x451bfc=await apiRequest(_0x52c6e1(0xdc)+buildQuery({'appCode':_0x377333,'dbLinkId':_0x39d413,'pageIndex':_0x366d32?.[_0x52c6e1(0xee)]??0x1,'pageSize':_0x366d32?.[_0x52c6e1(0x109)]??0x14,'tableName':_0x366d32?.[_0x52c6e1(0xa6)]})),_0x458bc6=_0x451bfc[_0x52c6e1(0xe3)];return{'totalCount':_0x458bc6?.[_0x52c6e1(0xa5)]??0x0,'tableList':Array[_0x52c6e1(0x10e)](_0x458bc6?.[_0x52c6e1(0x102)])?_0x458bc6[_0x52c6e1(0x102)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x589d12=a144_0x2891,_0x27d34d=await apiRequest(_0x589d12(0x114),{'method':_0x589d12(0xca),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4f5c8f=extractList(_0x27d34d['data']),_0x303164=extractPaging(_0x27d34d[_0x589d12(0xe3)]);return _0x303164&&_0x303164[_0x589d12(0xa5)]>REMOTE_APP_PAGE_SIZE&&console[_0x589d12(0xfc)](_0x589d12(0xb6)+REMOTE_APP_PAGE_SIZE+_0x589d12(0x13a)+_0x303164['totalCount']+_0x589d12(0xfa)+_0x589d12(0xce)),_0x4f5c8f;}
1
+ (function(_0x2a3793,_0x435ee7){const _0x258fa1=a144_0x2fb7,_0x354e63=_0x2a3793();while(!![]){try{const _0x437e43=-parseInt(_0x258fa1(0x180))/0x1*(parseInt(_0x258fa1(0x18e))/0x2)+parseInt(_0x258fa1(0x13a))/0x3+parseInt(_0x258fa1(0x17d))/0x4*(parseInt(_0x258fa1(0x127))/0x5)+-parseInt(_0x258fa1(0x19e))/0x6+parseInt(_0x258fa1(0x15c))/0x7*(-parseInt(_0x258fa1(0x12d))/0x8)+-parseInt(_0x258fa1(0x18a))/0x9*(parseInt(_0x258fa1(0x18d))/0xa)+parseInt(_0x258fa1(0x171))/0xb*(parseInt(_0x258fa1(0x166))/0xc);if(_0x437e43===_0x435ee7)break;else _0x354e63['push'](_0x354e63['shift']());}catch(_0x412547){_0x354e63['push'](_0x354e63['shift']());}}}(a144_0x3ac4,0x8821e));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(_0x39a1bd){_activeCookie=_0x39a1bd||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x126b7a,_0x1020ed){const _0x221546=a144_0x2fb7,_0x38149f=_0x1020ed instanceof Error?_0x1020ed[_0x221546(0x16a)]:String(_0x1020ed);return CliErrors['apiError'](_0x221546(0x16c)+_0x126b7a+(_0x38149f?'\x20('+_0x38149f+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x3c7a43,_0x214219={}){const _0x227657=a144_0x2fb7,{method:method=_0x227657(0x146),body:_0x2e04e8,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x214219,_0x598689=useRuntime?getRuntimeDomain():getApiDomain(),_0x556df9=_activeCookie||getCookie(),_0x3808f5=''+_0x598689+_0x3c7a43,_0x3a88a2=new AbortController(),_0x1af4f5=setTimeout(()=>_0x3a88a2[_0x227657(0x151)](),timeout);try{const _0xd202f5=await fetch(_0x3808f5,{'method':method,'headers':{'Content-Type':_0x227657(0x1a5),'Cookie':_0x556df9,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x2e04e8?JSON[_0x227657(0x1a1)](_0x2e04e8):undefined,'signal':_0x3a88a2[_0x227657(0x128)]});let _0x1dbd62;try{_0x1dbd62=await _0xd202f5['json']();}catch{throw CliErrors['apiError'](_0x227657(0x186)+_0xd202f5['status']+')',_0xd202f5[_0x227657(0x142)]>=0x190?_0x227657(0x163):undefined);}if(!_0xd202f5['ok']||_0x1dbd62[_0x227657(0x11c)]===![])throw CliErrors[_0x227657(0x12c)](_0x1dbd62[_0x227657(0x16f)]||_0x1dbd62[_0x227657(0x16a)]||_0x227657(0x198)+_0xd202f5[_0x227657(0x142)],_0x1dbd62[_0x227657(0x136)]?'API\x20error\x20code:\x20'+_0x1dbd62[_0x227657(0x136)]:undefined);return _0x1dbd62;}catch(_0x233d71){if(_0x233d71 instanceof CliError)throw _0x233d71;if(_0x233d71 instanceof Error&&_0x233d71[_0x227657(0x154)]===_0x227657(0x19b))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x3808f5);throw createFetchFailureError(_0x3808f5,_0x233d71);}finally{clearTimeout(_0x1af4f5);}}function isAuthFailure(_0x4742f6){const _0x9c0f03=a144_0x2fb7,_0x153d7b=_0x4742f6[_0x9c0f03(0x16f)]||_0x4742f6[_0x9c0f03(0x16a)]||_0x4742f6[_0x9c0f03(0x14e)]?.[_0x9c0f03(0x16a)]||_0x4742f6[_0x9c0f03(0x199)]||_0x4742f6[_0x9c0f03(0x169)]||'';return _0x4742f6[_0x9c0f03(0x136)]===_0x9c0f03(0x1af)||_0x4742f6[_0x9c0f03(0x190)]===0x191||_0x4742f6[_0x9c0f03(0x190)]==='401'||_0x153d7b['includes']('401')||_0x153d7b['includes'](_0x9c0f03(0x168))||_0x153d7b[_0x9c0f03(0x12e)]('登录')||_0x153d7b['includes']('认证');}export async function platformFetch(_0x361eda,_0x11772e){const _0xb2aa4e=a144_0x2fb7;let _0x38db6c;try{_0x38db6c=await fetch(_0x361eda,{'method':_0x11772e[_0xb2aa4e(0x144)]??'GET','headers':{'Content-Type':_0xb2aa4e(0x1a5),'Cookie':_0x11772e['cookie'],'X-Invoke-Source':_0xb2aa4e(0x13d)},..._0x11772e['body']&&{'body':JSON[_0xb2aa4e(0x1a1)](_0x11772e[_0xb2aa4e(0x129)])}});}catch(_0x3072db){throw createFetchFailureError(_0x361eda,_0x3072db);}if(!_0x38db6c['ok']){if(_0x38db6c[_0xb2aa4e(0x142)]===0x191)throw CliErrors[_0xb2aa4e(0x192)]();throw CliErrors[_0xb2aa4e(0x12c)](_0x11772e['label']+'\x20failed,\x20HTTP\x20'+_0x38db6c['status']);}const _0x22f4ed=await _0x38db6c[_0xb2aa4e(0x167)]();if(_0x22f4ed['success']===![]){if(isAuthFailure(_0x22f4ed))throw CliErrors[_0xb2aa4e(0x192)]();throw CliErrors['apiError'](_0x22f4ed[_0xb2aa4e(0x16f)]||_0x22f4ed[_0xb2aa4e(0x16a)]||_0x11772e[_0xb2aa4e(0x193)]+_0xb2aa4e(0x17c));}return _0x22f4ed[_0xb2aa4e(0x14e)];}export async function listBffScripts(_0xdcacce,_0x439123,_0x25a7d1){const _0x4ca292=a144_0x2fb7;let _0xa80203=_0x4ca292(0x140)+_0xdcacce;if(_0x439123)_0xa80203+=_0x4ca292(0x15d)+_0x439123;const _0xcadab1=await apiRequest(_0xa80203);let _0x427e27=extractList(_0xcadab1['data']);if(_0x25a7d1?.[_0x4ca292(0x12f)]){const _0x596a62=_0x25a7d1[_0x4ca292(0x12f)]['toLowerCase']();_0x427e27=_0x427e27['filter'](_0x124956=>_0x124956[_0x4ca292(0x138)]?.['toLowerCase']()['includes'](_0x596a62)||_0x124956[_0x4ca292(0x1a6)]?.[_0x4ca292(0x1b1)]()[_0x4ca292(0x12e)](_0x596a62));}return _0x427e27;}export async function getBffScriptInfo(_0x593a4b){const _0x29ab8e=a144_0x2fb7,_0x303fe3=await apiRequest(_0x29ab8e(0x17f)+_0x593a4b);if(!_0x303fe3[_0x29ab8e(0x14e)])throw CliErrors[_0x29ab8e(0x19a)]('BFF\x20script\x20not\x20found:\x20id='+_0x593a4b);return _0x303fe3['data'];}export async function saveBffScript(_0x3829da){const _0x144fe4=a144_0x2fb7,_0x485f95=await apiRequest(_0x144fe4(0x174),{'method':_0x144fe4(0x156),'body':_0x3829da}),{id:_0x2a3d90,entity:_0x4ca000}=normalizeEntityWithIdResponse(_0x485f95['data']);if(_0x2a3d90!==undefined){const _0x206c42=typeof _0x4ca000[_0x144fe4(0x138)]===_0x144fe4(0x117)||typeof _0x4ca000[_0x144fe4(0x12b)]===_0x144fe4(0x117)?_0x4ca000:undefined;return{'id':_0x2a3d90,'script':_0x206c42};}throw CliErrors[_0x144fe4(0x12c)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x5f0a14){const _0x4badf2=a144_0x2fb7;await apiRequest(_0x4badf2(0x131),{'method':_0x4badf2(0x156),'body':{'id':_0x5f0a14}});}export async function getBffScriptStatistics(_0x5bff58){const _0x1c746b=a144_0x2fb7,_0x7ede=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x5bff58);return extractList(_0x7ede[_0x1c746b(0x14e)]);}export async function clearBffScriptCache(){const _0x17d0b8=a144_0x2fb7,_0x277abe=await apiRequest(_0x17d0b8(0x17b),{'method':'POST','useRuntime':!![]});return typeof _0x277abe['data']===_0x17d0b8(0x117)?_0x277abe[_0x17d0b8(0x14e)]:'';}export async function listBffDatasetOperations(_0x28ffaf,_0x117229){const _0x58b5d5=a144_0x2fb7,_0x1e6428=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x58b5d5(0x156),'body':{'appCode':_0x28ffaf,'datasetId':_0x117229}});return _0x1e6428[_0x58b5d5(0x14e)];}export async function listSqlQueries(_0x4e8413,_0x4a7f05){const _0x137469=a144_0x2fb7,_0x1db8fc=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x137469(0x156),'body':{'appCode':_0x4e8413,'currentPage':_0x4a7f05?.[_0x137469(0x1a2)]??0x1,'pageSize':_0x4a7f05?.['pageSize']??0x32,'sqlCode':_0x4a7f05?.['sqlCode'],'sqlName':_0x4a7f05?.[_0x137469(0x1a7)]}});return _0x1db8fc[_0x137469(0x14e)];}export async function getSqlQueryInfo(_0x1835fc,_0x1be979){const _0x1f48fc=a144_0x2fb7,_0xc22d15=await listSqlQueries(_0x1835fc,{'sqlCode':_0x1be979}),_0x4efda5=_0xc22d15['tableData']?.[0x0];if(!_0x4efda5)throw CliErrors[_0x1f48fc(0x19a)](_0x1f48fc(0x197)+_0x1be979);return _0x4efda5;}export async function getSqlQueryDetail(_0x162c15){const _0x324bec=a144_0x2fb7,_0x11006a=await apiRequest('/smartapi/custom/getUserCustomSql'+('?sqlCode='+encodeURIComponent(_0x162c15)));if(!_0x11006a[_0x324bec(0x14e)])throw CliErrors[_0x324bec(0x19a)]('SQL\x20query\x20not\x20found:\x20'+_0x162c15);return _0x11006a[_0x324bec(0x14e)];}export async function getSqlQueryDetailById(_0x3b4f7b){const _0x2adc7c=a144_0x2fb7,_0x410ed3=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x3b4f7b);if(!_0x410ed3[_0x2adc7c(0x14e)])throw CliErrors[_0x2adc7c(0x19a)](_0x2adc7c(0x16d)+_0x3b4f7b);return _0x410ed3[_0x2adc7c(0x14e)];}export async function createSqlQuery(_0x5c1abd){const _0xccc820=a144_0x2fb7,_0xdd2d21=await apiRequest(_0xccc820(0x15a),{'method':'POST','body':_0x5c1abd}),{id:_0x56b5e0,entity:_0x3be157}=normalizeEntityWithIdResponse(_0xdd2d21[_0xccc820(0x14e)]);if(!('sqlCode'in _0x3be157)&&_0x56b5e0)return getSqlQueryDetailById(_0x56b5e0);return normalizeSqlQueryEntity(_0x3be157);}export async function updateSqlQuery(_0x1b7616){const _0x1e6501=a144_0x2fb7,_0x1439d4=await apiRequest(_0x1e6501(0x11e),{'method':_0x1e6501(0x156),'body':_0x1b7616}),{id:_0x13190b,entity:_0x2bc2f5}=normalizeEntityWithIdResponse(_0x1439d4['data']);if(!(_0x1e6501(0x13f)in _0x2bc2f5)){if(_0x1b7616[_0x1e6501(0x13f)])return getSqlQueryDetail(_0x1b7616['sqlCode']);if(_0x13190b)return getSqlQueryDetailById(_0x13190b);}return normalizeSqlQueryEntity(_0x2bc2f5);}export async function deleteSqlQuery(_0x118e01){const _0x1b5c39=a144_0x2fb7;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x1b5c39(0x156),'body':_0x118e01});}export async function saveSqlQuery(_0x4ee645){const _0x3a0d74=a144_0x2fb7,_0x622685=await apiRequest(_0x3a0d74(0x159),{'method':_0x3a0d74(0x156),'body':_0x4ee645});return _0x622685['data'];}function normalizeSqlQueryEntity(_0x20bbce){const _0x2c4da5=a144_0x2fb7;return{..._0x20bbce,'id':Number(_0x20bbce['id']),'dbId':_0x20bbce[_0x2c4da5(0x18b)]==null?undefined:Number(_0x20bbce[_0x2c4da5(0x18b)]),'version':_0x20bbce[_0x2c4da5(0x15e)]==null?undefined:Number(_0x20bbce[_0x2c4da5(0x15e)])};}export async function executeSql(_0x2d54e7,_0x5dae6c,_0x25ba50){const _0x469312=a144_0x2fb7,_0x440917=await apiRequest(_0x469312(0x1b5),{'method':_0x469312(0x156),'body':{'appCode':_0x2d54e7,'sqlCode':_0x5dae6c,..._0x25ba50&&{'params':_0x25ba50}},'useRuntime':!![]});return _0x440917[_0x469312(0x14e)];}export async function executeDatasetDataOperation(_0x1d6b4b,_0x4c29f1,_0x54e837,_0x492315={}){const _0x5cbfed=a144_0x2fb7;try{const _0x2ab3b8=await apiRequest(_0x5cbfed(0x12a)+_0x1d6b4b+'/'+_0x4c29f1+'/'+_0x54e837,{'method':'POST','body':_0x492315,'useRuntime':!![]});return _0x2ab3b8[_0x5cbfed(0x14e)];}catch(_0x332bf5){if(_0x54e837===_0x5cbfed(0x13b)&&_0x332bf5 instanceof CliError&&_0x332bf5[_0x5cbfed(0x190)]==='api_error'&&_0x492315['id']!==undefined&&_0x492315['id']!==null&&_0x492315['id']!==''){const _0x2fd756=await apiRequest(_0x5cbfed(0x12a)+_0x1d6b4b+'/'+_0x4c29f1+_0x5cbfed(0x11f),{'method':'POST','body':{'where':{'id':{'$eq':_0x492315['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x539571=Array[_0x5cbfed(0x145)](_0x2fd756['data']?.[_0x5cbfed(0x183)])?_0x2fd756[_0x5cbfed(0x14e)][_0x5cbfed(0x183)]:[];return _0x539571[0x0]??null;}throw _0x332bf5;}}export async function listDatasets(_0x3a7ec0,_0x58d8ee){const _0x1084f6=a144_0x2fb7,_0x119117={'appCode':_0x3a7ec0,'deleted':![]};if(_0x58d8ee?.[_0x1084f6(0x190)])_0x119117['code']=_0x58d8ee['code'];if(_0x58d8ee?.[_0x1084f6(0x154)])_0x119117[_0x1084f6(0x154)]=_0x58d8ee['name'];const _0x1d9faa=await apiRequest(_0x1084f6(0x15f),{'method':_0x1084f6(0x156),'body':_0x119117});return extractList(_0x1d9faa[_0x1084f6(0x14e)]);}export async function deleteDataset(_0x391463,_0x1abf38){const _0xcae1ca=a144_0x2fb7;await apiRequest(_0xcae1ca(0x149),{'method':_0xcae1ca(0x156),'body':{'appCode':_0x391463,'datasetId':_0x1abf38}});}export async function searchDatasets(_0x2ef767,_0x26e24e){const _0x4c667e=a144_0x2fb7,_0x572d09=await listDatasets(_0x2ef767,{'name':_0x26e24e}),_0x1e5ebe=_0x26e24e['toLowerCase'](),_0xa6989d=new Set(_0x572d09[_0x4c667e(0x184)](_0x33d69a=>_0x33d69a['id'])),_0x1a71af=_0x572d09[_0x4c667e(0x196)](_0x3f5a58=>_0x3f5a58['dbtableConfig']?.[_0x4c667e(0x188)]?.[_0x4c667e(0x1b1)]()[_0x4c667e(0x12e)](_0x1e5ebe)||_0x3f5a58[_0x4c667e(0x1a6)]?.['toLowerCase']()['includes'](_0x1e5ebe)),_0x2d3086=await listDatasets(_0x2ef767,{'code':_0x26e24e});for(const _0x3de5f6 of _0x2d3086){!_0xa6989d[_0x4c667e(0x11a)](_0x3de5f6['id'])&&(_0x572d09[_0x4c667e(0x1b3)](_0x3de5f6),_0xa6989d[_0x4c667e(0x126)](_0x3de5f6['id']));}return _0x572d09;}export function normalizeDatasetOperations(_0x4951f2){const _0x18241a=a144_0x2fb7;if(Array[_0x18241a(0x145)](_0x4951f2))return _0x4951f2['filter'](_0x110047=>_0x110047!=null&&typeof _0x110047===_0x18241a(0x133));if(_0x4951f2&&typeof _0x4951f2===_0x18241a(0x133))return Object[_0x18241a(0x189)](_0x4951f2)[_0x18241a(0x196)](([,_0x480794])=>_0x480794!=null&&typeof _0x480794===_0x18241a(0x133))[_0x18241a(0x184)](([_0x459817,_0x351b88])=>({..._0x351b88,'name':_0x351b88[_0x18241a(0x154)]??_0x351b88[_0x18241a(0x161)]??_0x459817}));return[];}function a144_0x2fb7(_0x5b9fe4,_0x5730e5){_0x5b9fe4=_0x5b9fe4-0x116;const _0x3ac495=a144_0x3ac4();let _0x2fb709=_0x3ac495[_0x5b9fe4];return _0x2fb709;}export async function getDatasetDetail(_0x301d80){const _0x5606eb=a144_0x2fb7,_0x435483=/^\d+$/[_0x5606eb(0x135)](_0x301d80)?'id':_0x5606eb(0x190),_0x4910cb=await apiRequest(_0x5606eb(0x19d)+_0x435483+'='+_0x301d80);return _0x4910cb[_0x5606eb(0x14e)];}export async function updateDrivenData(_0x333c3e){const _0x59839d=a144_0x2fb7,_0x36b9e6=await apiRequest(_0x59839d(0x120),{'method':_0x59839d(0x156),'body':_0x333c3e});return _0x36b9e6[_0x59839d(0x14e)];}export async function getDatasetOperations(_0xde89a6){const _0x495c27=a144_0x2fb7,_0x50b3f3=await getDatasetDetail(_0xde89a6),_0x39f197=normalizeDatasetOperations(_0x50b3f3['operations'])[_0x495c27(0x184)](_0x295a7b=>({'name':_0x295a7b['name']||_0x295a7b[_0x495c27(0x161)],'displayName':_0x295a7b[_0x495c27(0x1a3)]||_0x295a7b['name'],'type':_0x295a7b[_0x495c27(0x172)],'method':_0x295a7b[_0x495c27(0x144)],'path':_0x295a7b['path'],'enabled':_0x295a7b[_0x495c27(0x1ab)]??!![],'requestFields':_0x295a7b[_0x495c27(0x195)],'responseFields':_0x295a7b[_0x495c27(0x187)]}));return{'dataset':{'id':_0x50b3f3['id']??_0x50b3f3[_0x495c27(0x162)],'name':_0x50b3f3[_0x495c27(0x154)],'code':_0x50b3f3[_0x495c27(0x190)]||_0x50b3f3[_0x495c27(0x179)],'tableName':_0x50b3f3[_0x495c27(0x188)]||_0x50b3f3[_0x495c27(0x153)]?.[_0x495c27(0x188)]},'operations':_0x39f197};}export async function getOperationDetail(_0x111fbe,_0x429f98,_0x596c81){const _0x4cc216=a144_0x2fb7;let _0x19323a=_0x429f98;if(!/^\d+$/['test'](_0x429f98)){const _0x4f4881=await listDatasets(_0x111fbe,{'code':_0x429f98}),_0x5a9551=_0x4f4881['find'](_0x44ba41=>_0x44ba41[_0x4cc216(0x190)]===_0x429f98||String(_0x44ba41['id'])===_0x429f98);if(!_0x5a9551)throw CliErrors['validation']('Dataset\x20not\x20found:\x20'+_0x429f98);_0x19323a=String(_0x5a9551['id']);}const _0xc6f495=await getDatasetDetail(_0x19323a),_0x32ef5f=normalizeDatasetOperations(_0xc6f495['operations'])[_0x4cc216(0x1a0)](_0x552f9a=>(_0x552f9a['name']||_0x552f9a[_0x4cc216(0x161)])===_0x596c81);if(!_0x32ef5f)throw CliErrors[_0x4cc216(0x19a)](_0x4cc216(0x164)+_0x596c81+_0x4cc216(0x178)+_0x429f98);return{'dataset':{'id':_0xc6f495['id']??_0xc6f495[_0x4cc216(0x162)],'name':_0xc6f495[_0x4cc216(0x154)],'code':_0xc6f495[_0x4cc216(0x190)]||_0xc6f495[_0x4cc216(0x179)],'tableName':_0xc6f495[_0x4cc216(0x188)]||_0xc6f495[_0x4cc216(0x153)]?.[_0x4cc216(0x188)]},'operation':_0x32ef5f};}export async function startGenerateStandardPages(_0x2fea61,_0x1c90a5,_0xc8d208){const _0x28507b=a144_0x2fb7,_0x3e8418=await apiRequest('/smartapi/lovrabet/dataset/'+_0x1c90a5+_0x28507b(0x1ad),{'method':'POST','body':{'appCode':_0x2fea61,..._0xc8d208?.[_0x28507b(0x124)]?{'clientOperationId':_0xc8d208['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3e8418[_0x28507b(0x14e)];}export async function getGenerateStandardPagesStatus(_0x46353d,_0x67c528,_0x2ee879){const _0x51c6d4=a144_0x2fb7,_0x132699=new URLSearchParams({'appCode':_0x46353d});_0x2ee879[_0x51c6d4(0x17a)]&&_0x132699['set'](_0x51c6d4(0x17a),_0x2ee879[_0x51c6d4(0x17a)]);_0x2ee879['clientOperationId']&&_0x132699[_0x51c6d4(0x182)]('clientOperationId',_0x2ee879[_0x51c6d4(0x124)]);const _0x165c05=await apiRequest(_0x51c6d4(0x16e)+_0x67c528+_0x51c6d4(0x181)+_0x132699[_0x51c6d4(0x18f)]());return _0x165c05[_0x51c6d4(0x14e)];}export async function getStandardPageStatus(_0x1ee3a9,_0x5944ac){const _0x142e87=a144_0x2fb7,_0x551223=await apiRequest(_0x142e87(0x16e)+_0x5944ac+_0x142e87(0x123)+encodeURIComponent(_0x1ee3a9));return _0x551223[_0x142e87(0x14e)];}export async function tryGetStandardPageStatus(_0x350998,_0x1eece3){const _0x4ea1c2=a144_0x2fb7;try{return await getStandardPageStatus(_0x350998,_0x1eece3);}catch(_0x3ba489){if(_0x3ba489 instanceof CliError&&_0x3ba489[_0x4ea1c2(0x190)]===_0x4ea1c2(0x14b)&&/404|not found|non-json response/i['test'](_0x3ba489[_0x4ea1c2(0x16a)]))return null;throw _0x3ba489;}}export async function syncStandardPages(_0x2dd661,_0x36df0c){const _0x5828de=a144_0x2fb7,_0x5d2e69=await apiRequest(_0x5828de(0x16e)+_0x36df0c+_0x5828de(0x175),{'method':'POST','body':{'appCode':_0x2dd661}});return _0x5d2e69['data'];}export async function getPageDetail(_0x6c2877){const _0x396c2=a144_0x2fb7,_0x3c29af=await apiRequest(_0x396c2(0x13c)+_0x6c2877);if(!_0x3c29af[_0x396c2(0x14e)])throw CliErrors[_0x396c2(0x19a)]('Page\x20not\x20found:\x20'+_0x6c2877);return _0x3c29af['data'];}function a144_0x3ac4(){const _0x546582=['errorCode','.filter({','functionName','/smartapi/dblink/create','403017LAEvuG','getOne','/smartapi/lovrabet/detail?pageId=','cli:rabetbase','replace','sqlCode','/api/management/library/scripts/list?appCode=','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','status','planId','method','isArray','GET','.remove(id);','/smartapi/dblink/getAllTableList','/smartapi/dataset/delete-dataset','/smartapi/dblink/getOne','api_error','//\x20SQL:\x20','});','data','/smartapi/dblink/delete','/smartapi/question/er-config','abort','\x20\x20return\x20rows;','dbtableConfig','name','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','POST','pageIndex','\x20\x20sqlCode:\x20\x27','/api/node-toolbox/sql/save','/smartapi/custom/saveUserCustomSql','.getOne(id);','69622qRDByX','&type=','version','/smartapi/dataset/get-dataset-list','length','operationName','modelId','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','Operation\x20\x22','//\x20','15609924MtNxyB','json','Unauthorized','error','message','includeImports','Request\x20failed:\x20','SQL\x20query\x20not\x20found:\x20id=','/smartapi/lovrabet/dataset/','errorMsg','(/*\x20params\x20*/);','22ZvkMsG','type','totalCount','/api/management/library/scripts/save','/sync-to-pages','target','/smartapi/dblink/getTableDiffV2ByPage','\x22\x20not\x20found\x20in\x20dataset\x20','modelCode','operationId','/api/management/script/cache/clear','\x20failed','924QUPlsw','/smartapi/lovrabet/update-page','/api/management/library/scripts/info?id=','2thwEjl','/generate-standard-pages/status?','set','tableData','map','/smartapi/question/er-config/update-single','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','responseFields','tableName','entries','10647FhKvkr','dbId','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','7270fPlDMy','421874iiqKVa','toString','code','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','authRequired','label','join','requestFields','filter','SQL\x20query\x20not\x20found:\x20','API\x20error:\x20','errorMessage','validation','AbortError','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dataset/get-driven-data?','2289942PIBqGG','/smartapi/app/getList','find','stringify','currentPage','displayName','\x20\x20\x20\x20sqlCode:\x20\x27','application/json','description','sqlName','warn','\x20of\x20','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','enabled','sdk','/generate-standard-pages/start','remove','UNAUTHORIZED','/smartapi/dblink/testConnect','toLowerCase','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','push','/smartapi/db-analysis/start','/api/custom/executeSql','/smartapi/question/er-config/erDelete','string','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20\x20where:\x20{},','has','const\x20data\x20=\x20await\x20client.sql.execute({','success','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/custom/updateUserCustomSql','/filter','/smartapi/dataset/update-driven-data','const\x20result\x20=\x20await\x20client.models.','\x20\x20});','/standard-page-status?appCode=','clientOperationId','\x20apps.\x20','add','6725ENROsM','signal','body','/api/','scriptType','apiError','664MyjgKX','includes','scriptName','dataset_','/api/management/library/scripts/delete','/smartapi/db-analysis/jobs/cancel','object','delete','test'];a144_0x3ac4=function(){return _0x546582;};return a144_0x3ac4();}export async function updatePage(_0xbc14c8,_0x3e5cde,_0x3bac29,_0x567a1a){const _0x494dd2=a144_0x2fb7,_0x55db6c=await apiRequest(_0x494dd2(0x17e),{'method':_0x494dd2(0x156),'body':{'appCode':_0xbc14c8,'pageId':_0x3e5cde,'code':_0x3bac29,'datasetIds':_0x567a1a}});return _0x55db6c[_0x494dd2(0x14e)];}export function generateSdkCode(_0x5bc7d7,_0x182919,_0x370071){const _0xe008f3=a144_0x2fb7,_0x51637f=_0x370071?.[_0xe008f3(0x16b)]??!![],_0x208b11=_0xe008f3(0x130)+_0x5bc7d7['code']?.[_0xe008f3(0x13e)](/-/g,'_'),_0x15f983=_0x182919[_0xe008f3(0x154)]||_0x182919[_0xe008f3(0x161)]||_0xe008f3(0x196),_0x34e355=[];_0x51637f&&_0x34e355['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0xe008f3(0x118),'');_0x34e355[_0xe008f3(0x1b3)](_0xe008f3(0x165)+_0x5bc7d7[_0xe008f3(0x154)]+'\x20('+(_0x5bc7d7[_0xe008f3(0x188)]||'table')+')');if(_0x15f983==='filter')_0x34e355[_0xe008f3(0x1b3)](_0xe008f3(0x121)+_0x208b11+_0xe008f3(0x137),_0xe008f3(0x119),'\x20\x20pageSize:\x2020,','\x20\x20currentPage:\x201,',_0xe008f3(0x14d));else{if(_0x15f983===_0xe008f3(0x13b))_0x34e355[_0xe008f3(0x1b3)](_0xe008f3(0x121)+_0x208b11+_0xe008f3(0x15b));else{if(_0x15f983==='create')_0x34e355[_0xe008f3(0x1b3)](_0xe008f3(0x121)+_0x208b11+_0xe008f3(0x11d));else{if(_0x15f983==='update')_0x34e355['push'](_0xe008f3(0x121)+_0x208b11+_0xe008f3(0x1b2));else _0x15f983===_0xe008f3(0x134)||_0x15f983===_0xe008f3(0x1ae)?_0x34e355[_0xe008f3(0x1b3)](_0xe008f3(0x121)+_0x208b11+_0xe008f3(0x147)):_0x34e355['push'](_0xe008f3(0x121)+_0x208b11+'.'+_0x15f983+_0xe008f3(0x170));}}}return _0x34e355[_0xe008f3(0x194)]('\x0a');}export function generateSqlCodeTemplate(_0x31989a,_0x3b4685){const _0x308b3f=a144_0x2fb7,_0x371c98=_0x3b4685?.[_0x308b3f(0x176)]??_0x308b3f(0x1ac),_0x31548d=_0x3b4685?.[_0x308b3f(0x16b)]??!![],_0x3326c9=[];return _0x3326c9['push'](_0x308b3f(0x14c)+_0x31989a[_0x308b3f(0x1a7)]+'\x20('+_0x31989a[_0x308b3f(0x13f)]+')'),_0x371c98==='sdk'?(_0x31548d&&_0x3326c9[_0x308b3f(0x1b3)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x308b3f(0x118),''),_0x3326c9[_0x308b3f(0x1b3)](_0x308b3f(0x11b),_0x308b3f(0x158)+_0x31989a['sqlCode']+'\x27,',_0x308b3f(0x141),'});',_0x308b3f(0x18c),_0x308b3f(0x19c))):_0x3326c9['push'](_0x308b3f(0x155),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x308b3f(0x1aa),_0x308b3f(0x1a4)+_0x31989a[_0x308b3f(0x13f)]+'\x27,',_0x308b3f(0x191),_0x308b3f(0x122),_0x308b3f(0x152),'}'),_0x3326c9[_0x308b3f(0x194)]('\x0a');}export async function getErConfig(_0x5d546a,_0x15841f){const _0x311f37=a144_0x2fb7,_0x11aefa=await apiRequest(_0x311f37(0x150),{'method':'POST','body':{'appCode':_0x5d546a,'dblinkId':_0x15841f}});return _0x11aefa['data'];}export async function createErRelation(_0x3715ed){const _0x527c14=a144_0x2fb7,_0x3b70b8=await apiRequest('/smartapi/question/er-config/erCreate',{'method':'POST','body':_0x3715ed});return _0x3b70b8[_0x527c14(0x14e)];}export async function updateErRelation(_0x462e40){const _0x1e7f8d=a144_0x2fb7,_0x50e778=await apiRequest(_0x1e7f8d(0x185),{'method':_0x1e7f8d(0x156),'body':_0x462e40});return _0x50e778['data'];}export async function deleteErRelation(_0x1795e8){const _0x233dcf=a144_0x2fb7,_0x1ab687=await apiRequest(_0x233dcf(0x116),{'method':_0x233dcf(0x156),'body':_0x1795e8});return _0x1ab687[_0x233dcf(0x14e)];}function buildQuery(_0x5109ea){const _0x32769b=a144_0x2fb7,_0x160011=new URLSearchParams();for(const [_0x559104,_0x4b9f8e]of Object['entries'](_0x5109ea)){if(_0x4b9f8e===undefined||_0x4b9f8e==='')continue;_0x160011[_0x32769b(0x182)](_0x559104,String(_0x4b9f8e));}const _0x99c755=_0x160011[_0x32769b(0x18f)]();return _0x99c755?'?'+_0x99c755:'';}export async function listDbLinks(_0x3de75d,_0x4eeec8){const _0x217807=a144_0x2fb7,_0x26212d=await apiRequest('/smartapi/dblink/getList',{'method':_0x217807(0x156),'body':{'appCode':_0x3de75d,'currentPage':_0x4eeec8?.[_0x217807(0x1a2)]??0x1,'pageSize':_0x4eeec8?.['pageSize']??0x64}});return{'items':extractList(_0x26212d[_0x217807(0x14e)]),'paging':extractPaging(_0x26212d[_0x217807(0x14e)])};}export async function getDbLinkInfo(_0x21d1cc){const _0xdc66f1=a144_0x2fb7,_0x5b731c=await apiRequest(_0xdc66f1(0x14a)+buildQuery({'id':_0x21d1cc}));return _0x5b731c[_0xdc66f1(0x14e)];}export async function createDbLink(_0x29091c){const _0x1a86e1=a144_0x2fb7,_0xccf9a8=await apiRequest(_0x1a86e1(0x139),{'method':_0x1a86e1(0x156),'body':_0x29091c});return _0xccf9a8[_0x1a86e1(0x14e)];}export async function updateDbLink(_0x102bb2){const _0x2d1428=a144_0x2fb7,_0x124837=await apiRequest('/smartapi/dblink/update',{'method':_0x2d1428(0x156),'body':_0x102bb2});return _0x124837[_0x2d1428(0x14e)];}export async function deleteDbLink(_0x223073){const _0x50558b=a144_0x2fb7;await apiRequest(_0x50558b(0x14f),{'method':'POST','body':{'id':_0x223073}});}export async function testDbLinkConnect(_0x3d4392){const _0x42b3c0=a144_0x2fb7,_0x1b89ca=await apiRequest(_0x42b3c0(0x1b0)+buildQuery({'id':_0x3d4392}));return _0x1b89ca['data'];}export async function startDbAnalysis(_0x523f96,_0x36f19d){const _0x4f4828=a144_0x2fb7,_0x1fc7a0=await apiRequest(_0x4f4828(0x1b4),{'method':'POST','body':{'dbLinkId':_0x523f96,..._0x36f19d&&_0x36f19d[_0x4f4828(0x160)]>0x0?{'tableNames':_0x36f19d}:{}}}),_0x27903a=_0x1fc7a0['data'];if(typeof _0x27903a==='string')return _0x27903a;if(_0x27903a&&typeof _0x27903a===_0x4f4828(0x133)&&typeof _0x27903a[_0x4f4828(0x143)]==='string')return _0x27903a['planId'];return _0x27903a!=null?String(_0x27903a):'';}export async function cancelDbAnalysis(_0x3f9741){const _0x521752=a144_0x2fb7;await apiRequest(_0x521752(0x132)+buildQuery({'planId':_0x3f9741}),{'method':_0x521752(0x156)});}export async function getDbAnalysisStatus(_0x1302d7){const _0x14ce9c=a144_0x2fb7,_0x2769ef=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x1302d7));return _0x2769ef[_0x14ce9c(0x14e)];}export async function getDbAllTableList(_0x2af9e6,_0x4238d8){const _0x54b7e9=a144_0x2fb7,_0x52c6b9=await apiRequest(_0x54b7e9(0x148)+buildQuery({'appCode':_0x2af9e6,'dbLinkId':_0x4238d8})),_0x94acb2=_0x52c6b9[_0x54b7e9(0x14e)];if(Array[_0x54b7e9(0x145)](_0x94acb2))return _0x94acb2;return extractList(_0x94acb2);}export async function getDbTableDiff(_0x4c1af3,_0xb4dd92,_0x32af53){const _0x522718=a144_0x2fb7,_0x252f11=await apiRequest(_0x522718(0x177)+buildQuery({'appCode':_0x4c1af3,'dbLinkId':_0xb4dd92,'pageIndex':_0x32af53?.[_0x522718(0x157)]??0x1,'pageSize':_0x32af53?.['pageSize']??0x14,'tableName':_0x32af53?.[_0x522718(0x188)]})),_0xeb89e3=_0x252f11[_0x522718(0x14e)];return{'totalCount':_0xeb89e3?.['totalCount']??0x0,'tableList':Array[_0x522718(0x145)](_0xeb89e3?.['tableList'])?_0xeb89e3['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x70c818=a144_0x2fb7,_0x156dfb=await apiRequest(_0x70c818(0x19f),{'method':_0x70c818(0x156),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x53e7df=extractList(_0x156dfb[_0x70c818(0x14e)]),_0x3e6a74=extractPaging(_0x156dfb[_0x70c818(0x14e)]);return _0x3e6a74&&_0x3e6a74[_0x70c818(0x173)]>REMOTE_APP_PAGE_SIZE&&console[_0x70c818(0x1a8)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x70c818(0x1a9)+_0x3e6a74[_0x70c818(0x173)]+_0x70c818(0x125)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x53e7df;}
@@ -1 +1 @@
1
- const a145_0x2f0f0a=a145_0x3928;(function(_0x5b8702,_0x2b523b){const _0x33e0f7=a145_0x3928,_0x4a3aaf=_0x5b8702();while(!![]){try{const _0x26662b=parseInt(_0x33e0f7(0x1cd))/0x1*(parseInt(_0x33e0f7(0x1d2))/0x2)+-parseInt(_0x33e0f7(0x1d3))/0x3+parseInt(_0x33e0f7(0x1ce))/0x4*(parseInt(_0x33e0f7(0x1d5))/0x5)+parseInt(_0x33e0f7(0x1cf))/0x6+parseInt(_0x33e0f7(0x1cc))/0x7*(-parseInt(_0x33e0f7(0x1d4))/0x8)+parseInt(_0x33e0f7(0x1d0))/0x9+parseInt(_0x33e0f7(0x1d8))/0xa*(-parseInt(_0x33e0f7(0x1d1))/0xb);if(_0x26662b===_0x2b523b)break;else _0x4a3aaf['push'](_0x4a3aaf['shift']());}catch(_0x3c0f6a){_0x4a3aaf['push'](_0x4a3aaf['shift']());}}}(a145_0x5127,0x52349));import{resolve}from'node:path';function a145_0x3928(_0x517eb7,_0xe86099){_0x517eb7=_0x517eb7-0x1cc;const _0x51276b=a145_0x5127();let _0x39288f=_0x51276b[_0x517eb7];return _0x39288f;}import{findProjectRootDirectory}from'../../context.js';function a145_0x5127(){const _0x4ca93c=['1476244EsKHNn','11807LRopKn','6620eDkMYw','2073546ACePFW','2949093fYZjQH','4763okYawe','92VwaMXw','627123dxMzBj','16pPghHp','470bwikCP','bff','.rabetbase','9340sjJeEg','bff.lock.json'];a145_0x5127=function(){return _0x4ca93c;};return a145_0x5127();}const DOT_DIR=a145_0x2f0f0a(0x1d7),LOCK_FILE_NAME=a145_0x2f0f0a(0x1d9),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x3713cb,_0x8372c7){const _0x43ee9b=a145_0x2f0f0a,_0x3aa93a=resolve(_0x8372c7??findProjectRootDirectory()),_0x2afed9=DOT_DIR+'/bff',_0x23b651=_0x2afed9+'/'+_0x3713cb;return{'projectRoot':_0x3aa93a,'appCode':_0x3713cb,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2afed9,'scriptsRoot':_0x23b651,'scriptsRootDir':resolve(_0x3aa93a,DOT_DIR,_0x43ee9b(0x1d6),_0x3713cb),'lockFilePath':resolve(_0x3aa93a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3aa93a,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a145_0xc568fc=a145_0xc242;(function(_0x255b70,_0x48fed8){const _0x29e2b3=a145_0xc242,_0x4a35ea=_0x255b70();while(!![]){try{const _0x5b0e47=-parseInt(_0x29e2b3(0x122))/0x1*(parseInt(_0x29e2b3(0x120))/0x2)+-parseInt(_0x29e2b3(0x11c))/0x3*(-parseInt(_0x29e2b3(0x11a))/0x4)+parseInt(_0x29e2b3(0x11d))/0x5+-parseInt(_0x29e2b3(0x118))/0x6*(-parseInt(_0x29e2b3(0x117))/0x7)+parseInt(_0x29e2b3(0x124))/0x8*(parseInt(_0x29e2b3(0x121))/0x9)+parseInt(_0x29e2b3(0x125))/0xa+-parseInt(_0x29e2b3(0x11b))/0xb*(parseInt(_0x29e2b3(0x123))/0xc);if(_0x5b0e47===_0x48fed8)break;else _0x4a35ea['push'](_0x4a35ea['shift']());}catch(_0x5c880c){_0x4a35ea['push'](_0x4a35ea['shift']());}}}(a145_0x3e32,0x4d74d));function a145_0xc242(_0x3adf86,_0x3c7839){_0x3adf86=_0x3adf86-0x117;const _0x3e322c=a145_0x3e32();let _0xc24274=_0x3e322c[_0x3adf86];return _0xc24274;}import{resolve}from'node:path';function a145_0x3e32(){const _0x591935=['3OJvWGR','2752205wzRHmr','bff-trash','.rabetbase','2HUZzok','3159DhmoTU','252794euFouj','105636WmHDGo','12856onPsRP','2498800xDcupK','bff','bff.lock.json','78638clfPrI','204XricYi','/bff','752744AhxzKc','1705JIiIEP'];a145_0x3e32=function(){return _0x591935;};return a145_0x3e32();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a145_0xc568fc(0x11f),LOCK_FILE_NAME=a145_0xc568fc(0x127),TRASH_DIR_NAME=a145_0xc568fc(0x11e);export function loadBffProjectConfig(_0x3d6034,_0x4c082e){const _0x4d6c7d=a145_0xc568fc,_0x4a103d=resolve(_0x4c082e??findProjectRootDirectory()),_0x14dd29=DOT_DIR+_0x4d6c7d(0x119),_0x529ddb=_0x14dd29+'/'+_0x3d6034;return{'projectRoot':_0x4a103d,'appCode':_0x3d6034,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x14dd29,'scriptsRoot':_0x529ddb,'scriptsRootDir':resolve(_0x4a103d,DOT_DIR,_0x4d6c7d(0x126),_0x3d6034),'lockFilePath':resolve(_0x4a103d,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4a103d,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a146_0x1fac7f=a146_0x453e;(function(_0xebb213,_0x79205f){const _0x331e4a=a146_0x453e,_0x336089=_0xebb213();while(!![]){try{const _0x614441=-parseInt(_0x331e4a(0xdb))/0x1*(-parseInt(_0x331e4a(0xe2))/0x2)+parseInt(_0x331e4a(0xda))/0x3+-parseInt(_0x331e4a(0xf0))/0x4+parseInt(_0x331e4a(0xe1))/0x5*(parseInt(_0x331e4a(0xe6))/0x6)+-parseInt(_0x331e4a(0xec))/0x7+-parseInt(_0x331e4a(0xe8))/0x8*(parseInt(_0x331e4a(0xe0))/0x9)+-parseInt(_0x331e4a(0xd6))/0xa;if(_0x614441===_0x79205f)break;else _0x336089['push'](_0x336089['shift']());}catch(_0x3e868e){_0x336089['push'](_0x336089['shift']());}}}(a146_0x4321,0x83ebb));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=[a146_0x1fac7f(0xf1),a146_0x1fac7f(0xf5),a146_0x1fac7f(0xf8)];export function normalizeBffType(_0x2dc6c3){const _0x456f7e=a146_0x1fac7f;if(!_0x2dc6c3)return undefined;const _0x46baaa=_0x2dc6c3['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x456f7e(0xe5)](_0x46baaa)?_0x46baaa:undefined;}async function scanJsFilesRecursively(_0x34b2a1,_0x4595e9){const _0x27f8f2=a146_0x1fac7f,_0x489300=[];try{const _0x4cdca4=await readdir(_0x34b2a1,{'withFileTypes':!![]});for(const _0x2cb398 of _0x4cdca4){const _0x35b8fb=join(_0x34b2a1,_0x2cb398[_0x27f8f2(0xeb)]);if(_0x2cb398[_0x27f8f2(0xd9)]())_0x489300[_0x27f8f2(0xed)](...await scanJsFilesRecursively(_0x35b8fb,_0x4595e9+'/'+_0x2cb398[_0x27f8f2(0xeb)]));else _0x2cb398[_0x27f8f2(0xfd)]()&&_0x2cb398[_0x27f8f2(0xeb)][_0x27f8f2(0xdd)](_0x27f8f2(0xe7))&&_0x489300[_0x27f8f2(0xed)]({'lockKey':_0x4595e9+'/'+_0x2cb398[_0x27f8f2(0xeb)]['replace'](/\.js$/,''),'filePath':_0x35b8fb});}}catch(_0x371520){if(_0x371520['code']!==_0x27f8f2(0xf9))throw _0x371520;}return _0x489300;}async function scanFlatFunctions(_0x100450,_0x306e4f){const _0xd91be0=a146_0x1fac7f,_0x238dee=join(_0x100450[_0xd91be0(0xe9)],_0x306e4f),_0x30f6ad=await scanJsFilesRecursively(_0x238dee,_0x306e4f);return _0x30f6ad[_0xd91be0(0xf2)](({lockKey:_0x358372,filePath:_0x147007})=>({'type':_0x306e4f,'name':_0x358372[_0xd91be0(0xef)]('/')['at'](-0x1)??'','filePath':_0x147007,'lockKey':_0x358372}));}async function scanHookFunctions(_0x542836){const _0x1771e0=a146_0x1fac7f,_0x36972f=join(_0x542836['scriptsRootDir'],_0x1771e0(0xf8)),_0x30a0c3=[];try{const _0x72294=await readdir(_0x36972f,{'withFileTypes':!![]});for(const _0x2728a8 of _0x72294){if(!_0x2728a8[_0x1771e0(0xd9)]())continue;const _0x30aad4=_0x2728a8[_0x1771e0(0xeb)],_0x2e067e=join(_0x36972f,_0x30aad4),_0xe4dc95=await readdir(_0x2e067e,{'withFileTypes':!![]});for(const _0x11ebfb of _0xe4dc95){if(!_0x11ebfb[_0x1771e0(0xd9)]())continue;const _0x27b095=_0x11ebfb[_0x1771e0(0xeb)],_0x3b5aa5=join(_0x2e067e,_0x27b095),_0x363179=await readdir(_0x3b5aa5,{'withFileTypes':!![]});for(const _0x411e0e of _0x363179){if(!_0x411e0e[_0x1771e0(0xd9)]())continue;const _0x42cbe2=_0x411e0e[_0x1771e0(0xeb)],_0x1450bb=join(_0x3b5aa5,_0x42cbe2),_0x461468=await readdir(_0x1450bb,{'withFileTypes':!![]});for(const _0x345681 of _0x461468){if(!_0x345681['isFile']()||!_0x345681['name']['endsWith'](_0x1771e0(0xe7)))continue;const _0x79684=_0x345681['name'][_0x1771e0(0xf7)](/\.js$/,'');_0x30a0c3[_0x1771e0(0xed)]({'type':_0x1771e0(0xf8),'name':_0x79684,'filePath':join(_0x1450bb,_0x345681[_0x1771e0(0xeb)]),'lockKey':_0x1771e0(0xfb)+_0x30aad4+'/'+_0x27b095+'/'+_0x42cbe2+'/'+_0x79684,'alias':_0x30aad4,'operationType':_0x27b095,'functionNode':_0x42cbe2});}}}}}catch(_0xe99f98){if(_0xe99f98[_0x1771e0(0xea)]!==_0x1771e0(0xf9))throw _0xe99f98;}return _0x30a0c3;}export async function scanLocalBffFunctions(_0x437602,_0x512d7e){const _0x5a8065=a146_0x1fac7f;if(_0x512d7e==='COMMON'||_0x512d7e===_0x5a8065(0xf5))return scanFlatFunctions(_0x437602,_0x512d7e);if(_0x512d7e===_0x5a8065(0xf8))return scanHookFunctions(_0x437602);const [_0x12b55e,_0x1b52ea,_0x5bbca7]=await Promise[_0x5a8065(0xf6)]([scanFlatFunctions(_0x437602,_0x5a8065(0xf1)),scanFlatFunctions(_0x437602,_0x5a8065(0xf5)),scanHookFunctions(_0x437602)]);return[..._0x12b55e,..._0x1b52ea,..._0x5bbca7];}export function resolveLocalFilePathFromLockKey(_0x3773db,_0xc59c10){const _0x12d419=a146_0x1fac7f;return join(_0x3773db[_0x12d419(0xe9)],..._0xc59c10['split']('/'))+_0x12d419(0xe7);}export function createHookLocationMap(_0x466d92){const _0x1e2d60=a146_0x1fac7f,_0x502b68=new Map();for(const _0x1aeeed of _0x466d92){_0x1aeeed[_0x1e2d60(0xfa)]&&_0x502b68['set'](_0x1aeeed['beforeScriptId'],{'datasetCode':_0x1aeeed['datasetCode'],'operationType':snakeToCamel(_0x1aeeed['operationType']),'functionNode':_0x1e2d60(0xee)}),_0x1aeeed['afterScriptId']&&_0x502b68[_0x1e2d60(0xdc)](_0x1aeeed['afterScriptId'],{'datasetCode':_0x1aeeed[_0x1e2d60(0xe4)],'operationType':snakeToCamel(_0x1aeeed[_0x1e2d60(0xd7)]),'functionNode':_0x1e2d60(0xd8)});}return _0x502b68;}export function resolveRemoteScriptTarget(_0x4935e8,_0x124aa0,_0x53927b,_0x9baaf2,_0x4c93c3){const _0x5a07a1=a146_0x1fac7f,_0x313ace=normalizeBffType(_0x124aa0[_0x5a07a1(0xfc)]);if(!_0x313ace||!_0x124aa0['functionName'])return null;if(_0x313ace===_0x5a07a1(0xf8)){const _0x586d13=(_0x124aa0['id']?_0x53927b[_0x5a07a1(0xf4)](_0x124aa0['id']):undefined)??findHookLocationByRemoteId(_0x9baaf2,_0x124aa0['id']);if(!_0x586d13)return null;const _0x4337fc=_0x586d13[_0x5a07a1(0xe3)]||_0x4c93c3['get'](_0x586d13[_0x5a07a1(0xe4)]),_0x45b318=_0x4337fc??_0x586d13[_0x5a07a1(0xe4)],_0x215c57={..._0x586d13,'alias':_0x4337fc},_0x15f3d9=_0x5a07a1(0xfb)+_0x45b318+'/'+_0x215c57['operationType']+'/'+_0x215c57[_0x5a07a1(0xde)]+'/'+_0x124aa0[_0x5a07a1(0xf3)];return{'lockKey':_0x15f3d9,'filePath':resolveLocalFilePathFromLockKey(_0x4935e8,_0x15f3d9),'type':_0x5a07a1(0xf8),'hookLocation':_0x215c57};}const _0x192231=_0x313ace+'/'+_0x124aa0[_0x5a07a1(0xf3)];return{'lockKey':_0x192231,'filePath':resolveLocalFilePathFromLockKey(_0x4935e8,_0x192231),'type':_0x313ace};}export async function ensureParentDirectory(_0x5e38ae){await mkdir(dirname(_0x5e38ae),{'recursive':!![]});}function a146_0x4321(){const _0x35c0ff=['HOOK','ENOENT','beforeScriptId','HOOK/','scriptType','isFile','6746010EdzoDp','operationType','after','isDirectory','3112932EnBZNN','225482qLlSvn','set','endsWith','functionNode','F_OK','147627sTgMvQ','2895NyrsSe','2CcpxkE','alias','datasetCode','includes','4188iPNMyv','.js','24LxZFPb','scriptsRootDir','code','name','261191rSTDpQ','push','before','split','1463192ltSEKd','COMMON','map','functionName','get','ENDPOINT','all','replace'];a146_0x4321=function(){return _0x35c0ff;};return a146_0x4321();}function a146_0x453e(_0x2cf50e,_0x4e7f94){_0x2cf50e=_0x2cf50e-0xd6;const _0x4321cb=a146_0x4321();let _0x453ee3=_0x4321cb[_0x2cf50e];return _0x453ee3;}export async function fileExists(_0x4ef4ed){const _0x1b8868=a146_0x1fac7f;try{return await access(_0x4ef4ed,constants[_0x1b8868(0xdf)]),!![];}catch{return![];}}export async function directoryExists(_0x152254){try{const _0x1cfcc6=await stat(_0x152254);return _0x1cfcc6['isDirectory']();}catch{return![];}}
1
+ const a146_0x1d9bc1=a146_0x2efb;(function(_0x69f889,_0x2acb09){const _0x53b696=a146_0x2efb,_0x50a6e1=_0x69f889();while(!![]){try{const _0x31ac1b=parseInt(_0x53b696(0x1d1))/0x1*(-parseInt(_0x53b696(0x1b6))/0x2)+-parseInt(_0x53b696(0x1b5))/0x3+parseInt(_0x53b696(0x1bb))/0x4*(parseInt(_0x53b696(0x1be))/0x5)+-parseInt(_0x53b696(0x1d4))/0x6+-parseInt(_0x53b696(0x1cf))/0x7*(-parseInt(_0x53b696(0x1d3))/0x8)+-parseInt(_0x53b696(0x1cd))/0x9*(parseInt(_0x53b696(0x1c5))/0xa)+parseInt(_0x53b696(0x1c9))/0xb;if(_0x31ac1b===_0x2acb09)break;else _0x50a6e1['push'](_0x50a6e1['shift']());}catch(_0x58cf39){_0x50a6e1['push'](_0x50a6e1['shift']());}}}(a146_0x5ee2,0x18da6));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a146_0x5ee2(){const _0x327c74=['endsWith','push','map','3788114TwNgqC','functionNode','get','after','153NkSNrE','functionName','475489eesaAU','beforeScriptId','1jjNYzi','F_OK','16huxtQN','773718ZFiCMt','toUpperCase','.js','isDirectory','scriptsRootDir','HOOK/','set','datasetCode','246165nqheBb','246052ILbqOL','replace','split','before','COMMON','4lznBMb','HOOK','isFile','412375ByphTC','scriptType','all','ENDPOINT','ENOENT','operationType','name','74630IeFZzX'];a146_0x5ee2=function(){return _0x327c74;};return a146_0x5ee2();}export const SUPPORTED_BFF_TYPES=[a146_0x1d9bc1(0x1ba),a146_0x1d9bc1(0x1c1),a146_0x1d9bc1(0x1bc)];export function normalizeBffType(_0x2d4575){const _0x203964=a146_0x1d9bc1;if(!_0x2d4575)return undefined;const _0x3503f4=_0x2d4575['trim']()[_0x203964(0x1d5)]();return SUPPORTED_BFF_TYPES['includes'](_0x3503f4)?_0x3503f4:undefined;}async function scanJsFilesRecursively(_0x54d194,_0x483b40){const _0x5174bf=a146_0x1d9bc1,_0x5bf2ed=[];try{const _0xdd9bb3=await readdir(_0x54d194,{'withFileTypes':!![]});for(const _0x40f5be of _0xdd9bb3){const _0x31bc1f=join(_0x54d194,_0x40f5be[_0x5174bf(0x1c4)]);if(_0x40f5be[_0x5174bf(0x1d7)]())_0x5bf2ed[_0x5174bf(0x1c7)](...await scanJsFilesRecursively(_0x31bc1f,_0x483b40+'/'+_0x40f5be[_0x5174bf(0x1c4)]));else _0x40f5be[_0x5174bf(0x1bd)]()&&_0x40f5be[_0x5174bf(0x1c4)][_0x5174bf(0x1c6)](_0x5174bf(0x1d6))&&_0x5bf2ed[_0x5174bf(0x1c7)]({'lockKey':_0x483b40+'/'+_0x40f5be[_0x5174bf(0x1c4)][_0x5174bf(0x1b7)](/\.js$/,''),'filePath':_0x31bc1f});}}catch(_0x1e3bb8){if(_0x1e3bb8['code']!==_0x5174bf(0x1c2))throw _0x1e3bb8;}return _0x5bf2ed;}async function scanFlatFunctions(_0x3c3180,_0x20d047){const _0x2225d0=a146_0x1d9bc1,_0x335645=join(_0x3c3180[_0x2225d0(0x1d8)],_0x20d047),_0x1af7fb=await scanJsFilesRecursively(_0x335645,_0x20d047);return _0x1af7fb[_0x2225d0(0x1c8)](({lockKey:_0xadc7ed,filePath:_0x58f2eb})=>({'type':_0x20d047,'name':_0xadc7ed['split']('/')['at'](-0x1)??'','filePath':_0x58f2eb,'lockKey':_0xadc7ed}));}async function scanHookFunctions(_0x5d9b6b){const _0x3bf808=a146_0x1d9bc1,_0x140855=join(_0x5d9b6b[_0x3bf808(0x1d8)],_0x3bf808(0x1bc)),_0x3603ac=[];try{const _0x5a636c=await readdir(_0x140855,{'withFileTypes':!![]});for(const _0x5eebd6 of _0x5a636c){if(!_0x5eebd6[_0x3bf808(0x1d7)]())continue;const _0x2191ff=_0x5eebd6['name'],_0x2929ed=join(_0x140855,_0x2191ff),_0x54eeb2=await readdir(_0x2929ed,{'withFileTypes':!![]});for(const _0x11894f of _0x54eeb2){if(!_0x11894f['isDirectory']())continue;const _0x16d2db=_0x11894f[_0x3bf808(0x1c4)],_0x1f6ea5=join(_0x2929ed,_0x16d2db),_0x5e35d6=await readdir(_0x1f6ea5,{'withFileTypes':!![]});for(const _0x370326 of _0x5e35d6){if(!_0x370326[_0x3bf808(0x1d7)]())continue;const _0x2c430a=_0x370326[_0x3bf808(0x1c4)],_0x3bfb78=join(_0x1f6ea5,_0x2c430a),_0x3dd718=await readdir(_0x3bfb78,{'withFileTypes':!![]});for(const _0x24c6e8 of _0x3dd718){if(!_0x24c6e8[_0x3bf808(0x1bd)]()||!_0x24c6e8[_0x3bf808(0x1c4)][_0x3bf808(0x1c6)](_0x3bf808(0x1d6)))continue;const _0x3ab1b3=_0x24c6e8['name']['replace'](/\.js$/,'');_0x3603ac[_0x3bf808(0x1c7)]({'type':_0x3bf808(0x1bc),'name':_0x3ab1b3,'filePath':join(_0x3bfb78,_0x24c6e8[_0x3bf808(0x1c4)]),'lockKey':_0x3bf808(0x1d9)+_0x2191ff+'/'+_0x16d2db+'/'+_0x2c430a+'/'+_0x3ab1b3,'alias':_0x2191ff,'operationType':_0x16d2db,'functionNode':_0x2c430a});}}}}}catch(_0x4de455){if(_0x4de455['code']!=='ENOENT')throw _0x4de455;}return _0x3603ac;}export async function scanLocalBffFunctions(_0x353bad,_0x3c71f5){const _0x5d3673=a146_0x1d9bc1;if(_0x3c71f5===_0x5d3673(0x1ba)||_0x3c71f5===_0x5d3673(0x1c1))return scanFlatFunctions(_0x353bad,_0x3c71f5);if(_0x3c71f5==='HOOK')return scanHookFunctions(_0x353bad);const [_0x248a5f,_0x13df77,_0xe1d59b]=await Promise[_0x5d3673(0x1c0)]([scanFlatFunctions(_0x353bad,_0x5d3673(0x1ba)),scanFlatFunctions(_0x353bad,_0x5d3673(0x1c1)),scanHookFunctions(_0x353bad)]);return[..._0x248a5f,..._0x13df77,..._0xe1d59b];}function a146_0x2efb(_0x176358,_0x5aac10){_0x176358=_0x176358-0x1b5;const _0x5ee28e=a146_0x5ee2();let _0x2efbcf=_0x5ee28e[_0x176358];return _0x2efbcf;}export function resolveLocalFilePathFromLockKey(_0x197b94,_0x51806b){const _0x492760=a146_0x1d9bc1;return join(_0x197b94[_0x492760(0x1d8)],..._0x51806b[_0x492760(0x1b8)]('/'))+_0x492760(0x1d6);}export function createHookLocationMap(_0x561f17){const _0xd826a8=a146_0x1d9bc1,_0x2d74ea=new Map();for(const _0x2bbd0a of _0x561f17){_0x2bbd0a['beforeScriptId']&&_0x2d74ea[_0xd826a8(0x1da)](_0x2bbd0a[_0xd826a8(0x1d0)],{'datasetCode':_0x2bbd0a[_0xd826a8(0x1db)],'operationType':snakeToCamel(_0x2bbd0a[_0xd826a8(0x1c3)]),'functionNode':_0xd826a8(0x1b9)}),_0x2bbd0a['afterScriptId']&&_0x2d74ea['set'](_0x2bbd0a['afterScriptId'],{'datasetCode':_0x2bbd0a['datasetCode'],'operationType':snakeToCamel(_0x2bbd0a[_0xd826a8(0x1c3)]),'functionNode':_0xd826a8(0x1cc)});}return _0x2d74ea;}export function resolveRemoteScriptTarget(_0x5847e5,_0x2bc83d,_0x3dfb63,_0x244b24,_0x38f1e6){const _0x322b91=a146_0x1d9bc1,_0x579510=normalizeBffType(_0x2bc83d[_0x322b91(0x1bf)]);if(!_0x579510||!_0x2bc83d[_0x322b91(0x1ce)])return null;if(_0x579510===_0x322b91(0x1bc)){const _0x39e33f=(_0x2bc83d['id']?_0x3dfb63[_0x322b91(0x1cb)](_0x2bc83d['id']):undefined)??findHookLocationByRemoteId(_0x244b24,_0x2bc83d['id']);if(!_0x39e33f)return null;const _0x4ffddc=_0x39e33f['alias']||_0x38f1e6[_0x322b91(0x1cb)](_0x39e33f[_0x322b91(0x1db)]),_0x187e69=_0x4ffddc??_0x39e33f[_0x322b91(0x1db)],_0x2f284c={..._0x39e33f,'alias':_0x4ffddc},_0x33013b=_0x322b91(0x1d9)+_0x187e69+'/'+_0x2f284c[_0x322b91(0x1c3)]+'/'+_0x2f284c[_0x322b91(0x1ca)]+'/'+_0x2bc83d[_0x322b91(0x1ce)];return{'lockKey':_0x33013b,'filePath':resolveLocalFilePathFromLockKey(_0x5847e5,_0x33013b),'type':_0x322b91(0x1bc),'hookLocation':_0x2f284c};}const _0x329f77=_0x579510+'/'+_0x2bc83d[_0x322b91(0x1ce)];return{'lockKey':_0x329f77,'filePath':resolveLocalFilePathFromLockKey(_0x5847e5,_0x329f77),'type':_0x579510};}export async function ensureParentDirectory(_0x2de4cb){await mkdir(dirname(_0x2de4cb),{'recursive':!![]});}export async function fileExists(_0x5c9c16){const _0x309144=a146_0x1d9bc1;try{return await access(_0x5c9c16,constants[_0x309144(0x1d2)]),!![];}catch{return![];}}export async function directoryExists(_0x34a572){const _0x336baf=a146_0x1d9bc1;try{const _0xaf845b=await stat(_0x34a572);return _0xaf845b[_0x336baf(0x1d7)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x38b43a,_0x47f8f2){const _0x430c03=a147_0x250c,_0x5d98ef=_0x38b43a();while(!![]){try{const _0x9a444c=parseInt(_0x430c03(0x165))/0x1*(-parseInt(_0x430c03(0x163))/0x2)+parseInt(_0x430c03(0x15f))/0x3*(parseInt(_0x430c03(0x162))/0x4)+parseInt(_0x430c03(0x15b))/0x5+-parseInt(_0x430c03(0x15a))/0x6*(parseInt(_0x430c03(0x15d))/0x7)+-parseInt(_0x430c03(0x160))/0x8+-parseInt(_0x430c03(0x164))/0x9*(-parseInt(_0x430c03(0x15e))/0xa)+parseInt(_0x430c03(0x159))/0xb;if(_0x9a444c===_0x47f8f2)break;else _0x5d98ef['push'](_0x5d98ef['shift']());}catch(_0x540f7e){_0x5d98ef['push'](_0x5d98ef['shift']());}}}(a147_0x1de4,0x78092));function a147_0x1de4(){const _0x1c5267=['6xTxPbe','944340QUxnUR','update','1393448eFzstF','120bGphNr','203799RXDqpe','7259560ABwyHf','md5','12pDxsNN','271076xxLSkr','622701RTNuzO','6XGYHCa','digest','13073148MuSHJz'];a147_0x1de4=function(){return _0x1c5267;};return a147_0x1de4();}import{readFile}from'node:fs/promises';function a147_0x250c(_0x4c9289,_0x3ecade){_0x4c9289=_0x4c9289-0x159;const _0x1de4c7=a147_0x1de4();let _0x250c6a=_0x1de4c7[_0x4c9289];return _0x250c6a;}import a147_0x2b12c2 from'node:crypto';export function computeContentHash(_0x17ab5c){const _0x1ea63d=a147_0x250c;return a147_0x2b12c2['createHash'](_0x1ea63d(0x161))[_0x1ea63d(0x15c)](_0x17ab5c)[_0x1ea63d(0x166)]('hex');}export async function computeFileHash(_0x5d78de){const _0x5eb145=await readFile(_0x5d78de,'utf8');return computeContentHash(_0x5eb145);}
1
+ (function(_0x319525,_0x346380){const _0x38ed2f=a147_0x1d15,_0x39f37b=_0x319525();while(!![]){try{const _0xfdebbd=parseInt(_0x38ed2f(0x8c))/0x1*(-parseInt(_0x38ed2f(0x87))/0x2)+parseInt(_0x38ed2f(0x82))/0x3*(parseInt(_0x38ed2f(0x85))/0x4)+parseInt(_0x38ed2f(0x90))/0x5*(-parseInt(_0x38ed2f(0x8f))/0x6)+parseInt(_0x38ed2f(0x8d))/0x7*(parseInt(_0x38ed2f(0x8a))/0x8)+parseInt(_0x38ed2f(0x84))/0x9+parseInt(_0x38ed2f(0x8b))/0xa+-parseInt(_0x38ed2f(0x88))/0xb;if(_0xfdebbd===_0x346380)break;else _0x39f37b['push'](_0x39f37b['shift']());}catch(_0x16b89a){_0x39f37b['push'](_0x39f37b['shift']());}}}(a147_0x44c8,0x8cf48));import{readFile}from'node:fs/promises';function a147_0x1d15(_0x407d9e,_0x4aa4b1){_0x407d9e=_0x407d9e-0x82;const _0x44c89e=a147_0x44c8();let _0x1d15c3=_0x44c89e[_0x407d9e];return _0x1d15c3;}import a147_0x3b53fa from'node:crypto';export function computeContentHash(_0x2db5c2){const _0x1ec41d=a147_0x1d15;return a147_0x3b53fa[_0x1ec41d(0x91)](_0x1ec41d(0x83))['update'](_0x2db5c2)[_0x1ec41d(0x89)](_0x1ec41d(0x86));}function a147_0x44c8(){const _0x49ac1e=['7756785aldEiL','2440tsHocD','hex','2GUmKAZ','13950244oxtaoI','digest','24EzhPHj','3522070GxHmqN','94988xLoVyz','1570751pSzfDm','utf8','66JOPtVm','245285rRTsMp','createHash','2916KhIoMm','md5'];a147_0x44c8=function(){return _0x49ac1e;};return a147_0x44c8();}export async function computeFileHash(_0x5dbe4f){const _0x330684=a147_0x1d15,_0x300cb2=await readFile(_0x5dbe4f,_0x330684(0x8e));return computeContentHash(_0x300cb2);}
@@ -1 +1 @@
1
- function a148_0x54da(_0x1e0dd0,_0x4d0476){_0x1e0dd0=_0x1e0dd0-0x1db;const _0x337572=a148_0x3375();let _0x54da60=_0x337572[_0x1e0dd0];return _0x54da60;}(function(_0x466df2,_0x31cafe){const _0x44e6d0=a148_0x54da,_0x529400=_0x466df2();while(!![]){try{const _0x5417c3=-parseInt(_0x44e6d0(0x1eb))/0x1+-parseInt(_0x44e6d0(0x1e9))/0x2*(-parseInt(_0x44e6d0(0x1ed))/0x3)+-parseInt(_0x44e6d0(0x1de))/0x4+-parseInt(_0x44e6d0(0x1e8))/0x5*(parseInt(_0x44e6d0(0x1ea))/0x6)+-parseInt(_0x44e6d0(0x1db))/0x7+-parseInt(_0x44e6d0(0x1df))/0x8+-parseInt(_0x44e6d0(0x1ef))/0x9*(-parseInt(_0x44e6d0(0x1e4))/0xa);if(_0x5417c3===_0x31cafe)break;else _0x529400['push'](_0x529400['shift']());}catch(_0x560956){_0x529400['push'](_0x529400['shift']());}}}(a148_0x3375,0xc5b80));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a148_0x3375(){const _0x3d4815=['ENOENT','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','scriptsRoot','130TPqcEl','current\x20\x22','utf8','\x22\x20vs\x20lock\x20\x22','25hAuxUg','2056418pysHPt','722904OPDWIw','499856PQVbab',':\x20scriptsRoot\x20mismatch\x20—\x20','3ahiPsM','object','2104074vDqblK','stringify','apps','\x22.\x20','4926824gbBhZX','functions','code','4055172lEiTXG','3501360aVmVll','lastSync'];a148_0x3375=function(){return _0x3d4815;};return a148_0x3375();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x11bfa4,_0x4987eb,_0x121d84,_0xf3fc5e){const _0x2da4c5=a148_0x54da,_0x5d4703={'apps':_0x11bfa4[_0x2da4c5(0x1f1)]&&typeof _0x11bfa4[_0x2da4c5(0x1f1)]===_0x2da4c5(0x1ee)?_0x11bfa4[_0x2da4c5(0x1f1)]:{}};let _0x9b4f95=_0x5d4703[_0x2da4c5(0x1f1)][_0x4987eb];if(!_0x9b4f95)return _0x9b4f95={'scriptsRoot':_0x121d84,'lastSync':'','functions':{}},_0x5d4703[_0x2da4c5(0x1f1)][_0x4987eb]=_0x9b4f95,{'lockData':_0x5d4703,'appLock':_0x9b4f95};if(!_0x9b4f95[_0x2da4c5(0x1e3)])_0x9b4f95[_0x2da4c5(0x1e3)]=_0x121d84;else{if(_0x9b4f95[_0x2da4c5(0x1e3)]!==_0x121d84)throw new Error(_0xf3fc5e+_0x2da4c5(0x1ec)+(_0x2da4c5(0x1e5)+_0x121d84+_0x2da4c5(0x1e7)+_0x9b4f95[_0x2da4c5(0x1e3)]+_0x2da4c5(0x1f2))+_0x2da4c5(0x1e2));}return!_0x9b4f95['functions']&&(_0x9b4f95[_0x2da4c5(0x1dc)]={}),!_0x9b4f95[_0x2da4c5(0x1e0)]&&(_0x9b4f95[_0x2da4c5(0x1e0)]=''),{'lockData':_0x5d4703,'appLock':_0x9b4f95};}export async function readBffLockFile(_0x5f37b8){const _0x1b4bfe=a148_0x54da;try{const _0x11450f=await readFile(_0x5f37b8,_0x1b4bfe(0x1e6)),_0x575c7a=JSON['parse'](_0x11450f);return{'apps':_0x575c7a[_0x1b4bfe(0x1f1)]&&typeof _0x575c7a['apps']===_0x1b4bfe(0x1ee)?_0x575c7a[_0x1b4bfe(0x1f1)]:{}};}catch(_0x4a9ed8){if(_0x4a9ed8[_0x1b4bfe(0x1dd)]===_0x1b4bfe(0x1e1))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x4a9ed8));}}export async function writeBffLockFile(_0x1eb58f,_0x2d911d){const _0x4ff130=a148_0x54da;await mkdir(dirname(_0x1eb58f),{'recursive':!![]}),await writeFile(_0x1eb58f,JSON[_0x4ff130(0x1f0)](_0x2d911d,null,0x2),_0x4ff130(0x1e6));}
1
+ (function(_0x201a8b,_0x569d91){const _0x2c391f=a148_0x1536,_0x60f225=_0x201a8b();while(!![]){try{const _0x5da6ee=parseInt(_0x2c391f(0x122))/0x1+parseInt(_0x2c391f(0x12c))/0x2+-parseInt(_0x2c391f(0x123))/0x3*(-parseInt(_0x2c391f(0x126))/0x4)+-parseInt(_0x2c391f(0x12b))/0x5+-parseInt(_0x2c391f(0x127))/0x6*(-parseInt(_0x2c391f(0x119))/0x7)+-parseInt(_0x2c391f(0x128))/0x8+parseInt(_0x2c391f(0x12d))/0x9*(parseInt(_0x2c391f(0x125))/0xa);if(_0x5da6ee===_0x569d91)break;else _0x60f225['push'](_0x60f225['shift']());}catch(_0x3d736b){_0x60f225['push'](_0x60f225['shift']());}}}(a148_0x3f90,0xa7516));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a148_0x1536(_0x27ead3,_0x1a4ac5){_0x27ead3=_0x27ead3-0x117;const _0x3f9047=a148_0x3f90();let _0x153614=_0x3f9047[_0x27ead3];return _0x153614;}function a148_0x3f90(){const _0x5d4856=['ENOENT','lastSync','7066801oqubCQ','current\x20\x22','code','scriptsRoot','\x22.\x20','stringify','utf8','functions','object','218784Uocxyu','124167gHDvNE','parse','11096070qzsGkH','76sjiISG','6UekniS','10227408SPnhGg','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','6305535uIfPhx','201084JmBibq','9bEbgGN',':\x20scriptsRoot\x20mismatch\x20—\x20','apps'];a148_0x3f90=function(){return _0x5d4856;};return a148_0x3f90();}export function ensureLockScope(_0x1029af,_0x5baaf9,_0x117e0c,_0x5a1c78){const _0x1997cc=a148_0x1536,_0x493fad={'apps':_0x1029af['apps']&&typeof _0x1029af[_0x1997cc(0x12f)]===_0x1997cc(0x121)?_0x1029af[_0x1997cc(0x12f)]:{}};let _0x3f6358=_0x493fad[_0x1997cc(0x12f)][_0x5baaf9];if(!_0x3f6358)return _0x3f6358={'scriptsRoot':_0x117e0c,'lastSync':'','functions':{}},_0x493fad[_0x1997cc(0x12f)][_0x5baaf9]=_0x3f6358,{'lockData':_0x493fad,'appLock':_0x3f6358};if(!_0x3f6358[_0x1997cc(0x11c)])_0x3f6358[_0x1997cc(0x11c)]=_0x117e0c;else{if(_0x3f6358[_0x1997cc(0x11c)]!==_0x117e0c)throw new Error(_0x5a1c78+_0x1997cc(0x12e)+(_0x1997cc(0x11a)+_0x117e0c+_0x1997cc(0x12a)+_0x3f6358['scriptsRoot']+_0x1997cc(0x11d))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x3f6358[_0x1997cc(0x120)]&&(_0x3f6358['functions']={}),!_0x3f6358[_0x1997cc(0x118)]&&(_0x3f6358[_0x1997cc(0x118)]=''),{'lockData':_0x493fad,'appLock':_0x3f6358};}export async function readBffLockFile(_0x15e113){const _0x5a48b4=a148_0x1536;try{const _0x2148fc=await readFile(_0x15e113,'utf8'),_0x4ad768=JSON[_0x5a48b4(0x124)](_0x2148fc);return{'apps':_0x4ad768['apps']&&typeof _0x4ad768['apps']===_0x5a48b4(0x121)?_0x4ad768['apps']:{}};}catch(_0x5ed9b7){if(_0x5ed9b7[_0x5a48b4(0x11b)]===_0x5a48b4(0x117))return null;throw new Error(_0x5a48b4(0x129)+String(_0x5ed9b7));}}export async function writeBffLockFile(_0x41d7df,_0x5eed91){const _0x883b42=a148_0x1536;await mkdir(dirname(_0x41d7df),{'recursive':!![]}),await writeFile(_0x41d7df,JSON[_0x883b42(0x11e)](_0x5eed91,null,0x2),_0x883b42(0x11f));}
@@ -1 +1 @@
1
- function a150_0x2ebc(_0x56fcce,_0x32a1b1){_0x56fcce=_0x56fcce-0xd5;const _0x5b3fc3=a150_0x5b3f();let _0x2ebcdc=_0x5b3fc3[_0x56fcce];return _0x2ebcdc;}(function(_0x2c180d,_0x4ee434){const _0x55e473=a150_0x2ebc,_0x4945ef=_0x2c180d();while(!![]){try{const _0x538be8=-parseInt(_0x55e473(0xe4))/0x1*(parseInt(_0x55e473(0xd7))/0x2)+-parseInt(_0x55e473(0xdb))/0x3*(-parseInt(_0x55e473(0xde))/0x4)+-parseInt(_0x55e473(0xe5))/0x5*(-parseInt(_0x55e473(0xd8))/0x6)+parseInt(_0x55e473(0xe0))/0x7*(parseInt(_0x55e473(0xdf))/0x8)+-parseInt(_0x55e473(0xd6))/0x9+-parseInt(_0x55e473(0xe3))/0xa*(-parseInt(_0x55e473(0xea))/0xb)+-parseInt(_0x55e473(0xe1))/0xc*(parseInt(_0x55e473(0xdc))/0xd);if(_0x538be8===_0x4ee434)break;else _0x4945ef['push'](_0x4945ef['shift']());}catch(_0x533684){_0x4945ef['push'](_0x4945ef['shift']());}}}(a150_0x5b3f,0x60c8c));export function snakeToCamel(_0x50a822){const _0x278e18=a150_0x2ebc;return _0x50a822['toLowerCase']()[_0x278e18(0xd5)](/_([a-z])/g,(_0x329610,_0x52a6a6)=>_0x52a6a6['toUpperCase']());}export function findHookLocationByRemoteId(_0x191dcc,_0x36f0b9){const _0x4ee9f3=a150_0x2ebc;if(!_0x36f0b9)return undefined;for(const _0x3c3577 of Object[_0x4ee9f3(0xda)](_0x191dcc)){if(_0x3c3577[_0x4ee9f3(0xe8)]===_0x36f0b9&&_0x3c3577['datasetCode']&&_0x3c3577[_0x4ee9f3(0xe2)]&&_0x3c3577[_0x4ee9f3(0xdd)])return{'datasetCode':_0x3c3577['datasetCode'],'operationType':_0x3c3577[_0x4ee9f3(0xe2)],'functionNode':_0x3c3577[_0x4ee9f3(0xdd)]};}return undefined;}function a150_0x5b3f(){const _0x3162ab=['before','test','remoteId','toLowerCase','737JgKaAJ','after','replace','3338262lZiDZX','2ssAFiR','49782DiDkNX','trim','values','6aCeJfs','13eHvfvi','functionNode','653284XLxObc','808xqrgQB','2863AEQDvw','7457124zQPRRY','operationType','52340sSkTCz','84883UCCIZk','455edXiHz'];a150_0x5b3f=function(){return _0x3162ab;};return a150_0x5b3f();}export function extractScriptDescription(_0x316979){const _0x3325af=a150_0x2ebc,_0x53bff9=_0x316979['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x53bff9?.[0x1]?.[_0x3325af(0xd9)]()||undefined;}export function isValidBffFunctionName(_0x26b7b6){const _0x12e15b=a150_0x2ebc;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x12e15b(0xe7)](_0x26b7b6);}export function normalizeHookFunctionNode(_0x212012){const _0x4dfa92=a150_0x2ebc;if(!_0x212012)return undefined;const _0x11218c=_0x212012[_0x4dfa92(0xd9)]()[_0x4dfa92(0xe9)]();if(_0x11218c===_0x4dfa92(0xe6)||_0x11218c===_0x4dfa92(0xeb))return _0x11218c;return undefined;}
1
+ (function(_0x52b1b4,_0x412fc3){const _0x426970=a150_0xa662,_0x54375d=_0x52b1b4();while(!![]){try{const _0x36fd00=-parseInt(_0x426970(0x153))/0x1+-parseInt(_0x426970(0x151))/0x2*(-parseInt(_0x426970(0x14d))/0x3)+-parseInt(_0x426970(0x158))/0x4*(parseInt(_0x426970(0x15e))/0x5)+-parseInt(_0x426970(0x15a))/0x6*(parseInt(_0x426970(0x14e))/0x7)+-parseInt(_0x426970(0x15f))/0x8*(-parseInt(_0x426970(0x155))/0x9)+parseInt(_0x426970(0x14b))/0xa+parseInt(_0x426970(0x159))/0xb;if(_0x36fd00===_0x412fc3)break;else _0x54375d['push'](_0x54375d['shift']());}catch(_0x3f1d2e){_0x54375d['push'](_0x54375d['shift']());}}}(a150_0x1d5a,0x3d709));function a150_0xa662(_0x588c1f,_0x49d61d){_0x588c1f=_0x588c1f-0x14a;const _0x1d5a33=a150_0x1d5a();let _0xa662d2=_0x1d5a33[_0x588c1f];return _0xa662d2;}export function snakeToCamel(_0x388ed8){const _0x2fd638=a150_0xa662;return _0x388ed8[_0x2fd638(0x157)]()[_0x2fd638(0x15d)](/_([a-z])/g,(_0x35318f,_0x11e717)=>_0x11e717[_0x2fd638(0x152)]());}export function findHookLocationByRemoteId(_0x463ec0,_0x4f1ece){const _0x52283c=a150_0xa662;if(!_0x4f1ece)return undefined;for(const _0x11919e of Object[_0x52283c(0x14f)](_0x463ec0)){if(_0x11919e[_0x52283c(0x161)]===_0x4f1ece&&_0x11919e['datasetCode']&&_0x11919e[_0x52283c(0x14a)]&&_0x11919e[_0x52283c(0x160)])return{'datasetCode':_0x11919e[_0x52283c(0x14c)],'operationType':_0x11919e[_0x52283c(0x14a)],'functionNode':_0x11919e[_0x52283c(0x160)]};}return undefined;}export function extractScriptDescription(_0x30e4a9){const _0x4ac40f=a150_0xa662,_0x2e4c9e=_0x30e4a9[_0x4ac40f(0x154)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2e4c9e?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0xb98a0b){const _0x4423a0=a150_0xa662;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x4423a0(0x15c)](_0xb98a0b);}function a150_0x1d5a(){const _0x124ffe=['operationType','844150dBjzqj','datasetCode','15IIPqoA','21KWWPRM','values','before','32206UZAJaA','toUpperCase','92758wgOomE','match','37512DYxmkb','after','toLowerCase','2116nihQoy','4922599LpNobu','489828nxYMUW','trim','test','replace','2070XMXjRM','376kcAoMp','functionNode','remoteId'];a150_0x1d5a=function(){return _0x124ffe;};return a150_0x1d5a();}export function normalizeHookFunctionNode(_0x3cd36c){const _0x1e3857=a150_0xa662;if(!_0x3cd36c)return undefined;const _0x131985=_0x3cd36c[_0x1e3857(0x15b)]()[_0x1e3857(0x157)]();if(_0x131985===_0x1e3857(0x150)||_0x131985===_0x1e3857(0x156))return _0x131985;return undefined;}
@@ -1 +1 @@
1
- (function(_0x6de5c6,_0x3864e3){const _0x1627fd=a151_0x3839,_0x15954f=_0x6de5c6();while(!![]){try{const _0x5c6fd1=parseInt(_0x1627fd(0xf0))/0x1+-parseInt(_0x1627fd(0xd4))/0x2*(parseInt(_0x1627fd(0xd6))/0x3)+parseInt(_0x1627fd(0xdb))/0x4*(parseInt(_0x1627fd(0xd9))/0x5)+parseInt(_0x1627fd(0xd3))/0x6*(parseInt(_0x1627fd(0xde))/0x7)+-parseInt(_0x1627fd(0xe4))/0x8*(parseInt(_0x1627fd(0xeb))/0x9)+parseInt(_0x1627fd(0xda))/0xa+-parseInt(_0x1627fd(0xe1))/0xb*(parseInt(_0x1627fd(0xe2))/0xc);if(_0x5c6fd1===_0x3864e3)break;else _0x15954f['push'](_0x15954f['shift']());}catch(_0x30adfd){_0x15954f['push'](_0x15954f['shift']());}}}(a151_0xdb86,0x58b36));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a151_0xdb86(){const _0x1e86fd=['5cZbeNk','2830250BIoJim','764268MmSzDE','dbId','set','4102lMLTYW','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','.\x20Be\x20more\x20specific.','483560lhMQdl','192dwgERe','dbName','3448zYnzBE','filter','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','map','dbtableConfig','\x22\x20under\x20app\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','6345NiCupJ','get','length','toLowerCase','isNaN','481039sJOcNS','No\x20database\x20matching\x20\x22','6948XEAjWU','75196aTslaE','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','21ducWLI','find','\x22\x20matches\x20multiple\x20databases:\x20'];a151_0xdb86=function(){return _0x1e86fd;};return a151_0xdb86();}export async function listDatabases(_0x545f56){const _0x2c2845=a151_0x3839;if(cache['has'](_0x545f56))return cache[_0x2c2845(0xec)](_0x545f56);const _0x51f99c=await listDatasets(_0x545f56),_0xd5b179=new Map();for(const _0xc37130 of _0x51f99c){const _0x2f85e5=_0xc37130[_0x2c2845(0xe8)];_0x2f85e5?.['dbId']!=null&&_0xd5b179[_0x2c2845(0xdd)](_0x2f85e5[_0x2c2845(0xdc)],_0x2f85e5['dbName']??'db-'+_0x2f85e5[_0x2c2845(0xdc)]);}const _0x10180e=[..._0xd5b179['entries']()][_0x2c2845(0xe7)](([_0x553b31,_0x7c507c])=>({'dbId':_0x553b31,'dbName':_0x7c507c}));return cache[_0x2c2845(0xdd)](_0x545f56,_0x10180e),_0x10180e;}export async function resolveDb(_0x1b5768,_0x45149d){const _0x584c5c=a151_0x3839,_0x3d853a=await listDatabases(_0x1b5768);if(_0x3d853a[_0x584c5c(0xed)]===0x0)return{'resolved':[],'error':_0x584c5c(0xea)+_0x1b5768+_0x584c5c(0xd5)};if(!_0x45149d)return{'resolved':_0x3d853a};const _0x34b1cf=Number(_0x45149d);if(!Number[_0x584c5c(0xef)](_0x34b1cf)){const _0x230dcd=_0x3d853a[_0x584c5c(0xd7)](_0x4eb9ac=>_0x4eb9ac[_0x584c5c(0xdc)]===_0x34b1cf);if(_0x230dcd)return{'resolved':[_0x230dcd]};}const _0x18c0ba=_0x45149d[_0x584c5c(0xee)](),_0xa2d1e7=_0x3d853a[_0x584c5c(0xe5)](_0x3d7e85=>_0x3d7e85[_0x584c5c(0xe3)]['toLowerCase']()['includes'](_0x18c0ba));if(_0xa2d1e7[_0x584c5c(0xed)]>0x0)return{'resolved':_0xa2d1e7};const _0x5ba6bf=_0x3d853a[_0x584c5c(0xe7)](_0x5efd31=>_0x5efd31[_0x584c5c(0xe3)]+'\x20('+_0x5efd31[_0x584c5c(0xdc)]+')')['join'](',\x20');return{'resolved':[],'error':_0x584c5c(0xf1)+_0x45149d+_0x584c5c(0xe9)+_0x1b5768+'\x22.\x20Available:\x20'+_0x5ba6bf+_0x584c5c(0xdf)};}function a151_0x3839(_0x21c50d,_0x27e4cd){_0x21c50d=_0x21c50d-0xd3;const _0xdb86bd=a151_0xdb86();let _0x3839ac=_0xdb86bd[_0x21c50d];return _0x3839ac;}export async function resolveOneDb(_0x2b1431,_0x58f5e4){const _0x2e975c=a151_0x3839,{resolved:_0x52f4ad,error:_0x53a09c}=await resolveDb(_0x2b1431,_0x58f5e4);if(_0x53a09c)return{'db':null,'error':_0x53a09c};if(_0x52f4ad['length']===0x1)return{'db':_0x52f4ad[0x0]};if(!_0x58f5e4){const _0x5f2b87=_0x52f4ad[_0x2e975c(0xe7)](_0x3eaac1=>_0x3eaac1[_0x2e975c(0xe3)]+'\x20('+_0x3eaac1[_0x2e975c(0xdc)]+')')['join'](',\x20');return{'db':null,'error':_0x2e975c(0xe6)+_0x5f2b87};}const _0x119a40=_0x52f4ad[_0x2e975c(0xe7)](_0x159758=>_0x159758[_0x2e975c(0xe3)]+'\x20('+_0x159758['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x58f5e4+_0x2e975c(0xd8)+_0x119a40+_0x2e975c(0xe0)};}export async function getDbName(_0xa461a9,_0xcb651){const _0x10d945=a151_0x3839,_0x4833ad=await listDatabases(_0xa461a9);return _0x4833ad['find'](_0x3847e8=>_0x3847e8['dbId']===_0xcb651)?.[_0x10d945(0xe3)];}
1
+ (function(_0x409674,_0x3b8deb){const _0x30b178=a151_0x38ce,_0x58cc2b=_0x409674();while(!![]){try{const _0x322152=parseInt(_0x30b178(0x198))/0x1+-parseInt(_0x30b178(0x1a9))/0x2*(parseInt(_0x30b178(0x1ac))/0x3)+parseInt(_0x30b178(0x19b))/0x4+-parseInt(_0x30b178(0x19e))/0x5+parseInt(_0x30b178(0x19a))/0x6*(parseInt(_0x30b178(0x194))/0x7)+-parseInt(_0x30b178(0x1a8))/0x8*(-parseInt(_0x30b178(0x1a3))/0x9)+-parseInt(_0x30b178(0x1ad))/0xa;if(_0x322152===_0x3b8deb)break;else _0x58cc2b['push'](_0x58cc2b['shift']());}catch(_0x4d4074){_0x58cc2b['push'](_0x58cc2b['shift']());}}}(a151_0xb9c3,0x59929));function a151_0xb9c3(){const _0x883ed=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','entries','147HKCrBx','find','includes','\x22\x20under\x20app\x20\x22','612446LdvzBd','get','44406HBSBHl','993256QQphbN','has','dbName','1038655CPyiHX','toLowerCase','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','map','\x22\x20matches\x20multiple\x20databases:\x20','36PxolXb','\x22.\x20Available:\x20','join','length','isNaN','291976iBDmhz','26294iDsDYr','filter','set','57aLDhJr','3377560Ivnzcx','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','.\x20Be\x20more\x20specific.','dbtableConfig','dbId'];a151_0xb9c3=function(){return _0x883ed;};return a151_0xb9c3();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0xc03a97){const _0x18d95a=a151_0x38ce;if(cache[_0x18d95a(0x19c)](_0xc03a97))return cache[_0x18d95a(0x199)](_0xc03a97);const _0x1362d1=await listDatasets(_0xc03a97),_0x11fb92=new Map();for(const _0x5388c8 of _0x1362d1){const _0x232ba8=_0x5388c8[_0x18d95a(0x190)];_0x232ba8?.[_0x18d95a(0x191)]!=null&&_0x11fb92[_0x18d95a(0x1ab)](_0x232ba8[_0x18d95a(0x191)],_0x232ba8[_0x18d95a(0x19d)]??'db-'+_0x232ba8[_0x18d95a(0x191)]);}const _0x25c843=[..._0x11fb92[_0x18d95a(0x193)]()]['map'](([_0x5c4c09,_0x14a378])=>({'dbId':_0x5c4c09,'dbName':_0x14a378}));return cache[_0x18d95a(0x1ab)](_0xc03a97,_0x25c843),_0x25c843;}export async function resolveDb(_0x3de984,_0x147379){const _0x419e50=a151_0x38ce,_0x50e646=await listDatabases(_0x3de984);if(_0x50e646[_0x419e50(0x1a6)]===0x0)return{'resolved':[],'error':_0x419e50(0x1af)+_0x3de984+_0x419e50(0x1a0)};if(!_0x147379)return{'resolved':_0x50e646};const _0x20ae01=Number(_0x147379);if(!Number[_0x419e50(0x1a7)](_0x20ae01)){const _0x21467d=_0x50e646[_0x419e50(0x195)](_0x2164ae=>_0x2164ae[_0x419e50(0x191)]===_0x20ae01);if(_0x21467d)return{'resolved':[_0x21467d]};}const _0x4258dd=_0x147379[_0x419e50(0x19f)](),_0x36a379=_0x50e646[_0x419e50(0x1aa)](_0x39ce55=>_0x39ce55[_0x419e50(0x19d)][_0x419e50(0x19f)]()[_0x419e50(0x196)](_0x4258dd));if(_0x36a379['length']>0x0)return{'resolved':_0x36a379};const _0x854628=_0x50e646[_0x419e50(0x1a1)](_0x11a768=>_0x11a768['dbName']+'\x20('+_0x11a768[_0x419e50(0x191)]+')')[_0x419e50(0x1a5)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x147379+_0x419e50(0x197)+_0x3de984+_0x419e50(0x1a4)+_0x854628+_0x419e50(0x1ae)};}function a151_0x38ce(_0x5e0a85,_0x570a0e){_0x5e0a85=_0x5e0a85-0x18f;const _0xb9c3f6=a151_0xb9c3();let _0x38ce09=_0xb9c3f6[_0x5e0a85];return _0x38ce09;}export async function resolveOneDb(_0x21d9b8,_0x54d4f5){const _0x222a01=a151_0x38ce,{resolved:_0x40b40b,error:_0x50e339}=await resolveDb(_0x21d9b8,_0x54d4f5);if(_0x50e339)return{'db':null,'error':_0x50e339};if(_0x40b40b['length']===0x1)return{'db':_0x40b40b[0x0]};if(!_0x54d4f5){const _0x27e186=_0x40b40b['map'](_0x1b7e14=>_0x1b7e14[_0x222a01(0x19d)]+'\x20('+_0x1b7e14[_0x222a01(0x191)]+')')[_0x222a01(0x1a5)](',\x20');return{'db':null,'error':_0x222a01(0x192)+_0x27e186};}const _0x36b9fa=_0x40b40b[_0x222a01(0x1a1)](_0x2c0792=>_0x2c0792[_0x222a01(0x19d)]+'\x20('+_0x2c0792['dbId']+')')[_0x222a01(0x1a5)](',\x20');return{'db':null,'error':'\x22'+_0x54d4f5+_0x222a01(0x1a2)+_0x36b9fa+_0x222a01(0x18f)};}export async function getDbName(_0x2c1598,_0x296059){const _0x2d1fc5=a151_0x38ce,_0xaebaab=await listDatabases(_0x2c1598);return _0xaebaab[_0x2d1fc5(0x195)](_0x11237f=>_0x11237f[_0x2d1fc5(0x191)]===_0x296059)?.[_0x2d1fc5(0x19d)];}
@@ -1 +1 @@
1
- const a152_0x3bb178=a152_0x4976;(function(_0x817011,_0x16cfda){const _0xe41aa=a152_0x4976,_0x22ad7a=_0x817011();while(!![]){try{const _0x2e5469=parseInt(_0xe41aa(0xfa))/0x1+-parseInt(_0xe41aa(0x100))/0x2*(parseInt(_0xe41aa(0xff))/0x3)+-parseInt(_0xe41aa(0x101))/0x4*(parseInt(_0xe41aa(0xef))/0x5)+parseInt(_0xe41aa(0xf4))/0x6+-parseInt(_0xe41aa(0xf1))/0x7+-parseInt(_0xe41aa(0xf3))/0x8*(parseInt(_0xe41aa(0xf8))/0x9)+parseInt(_0xe41aa(0xfc))/0xa*(parseInt(_0xe41aa(0xfd))/0xb);if(_0x2e5469===_0x16cfda)break;else _0x22ad7a['push'](_0x22ad7a['shift']());}catch(_0x4ca93b){_0x22ad7a['push'](_0x22ad7a['shift']());}}}(a152_0x5653,0x6fcab));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a152_0x5653(){const _0x44a977=['cwd','9681610pjoKdx','11LsrjNF','F_OK','243lRVecy','16586oPeFXf','144716bxsbQw','5sGuXhf','page','1910328kdnvnZ','page.lock.json','400392HRvYEB','3069324TPaQfZ','appPagesDir','.rabetbase','toUpperCase','117pRdOhV','.json','609637kmSSsj'];a152_0x5653=function(){return _0x44a977;};return a152_0x5653();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x26b0c7,_0x46d765=process[a152_0x3bb178(0xfb)]()){const _0x1b78c8=a152_0x3bb178,_0x4fd62f=resolve(_0x46d765),_0x56ba73=join(_0x4fd62f,_0x1b78c8(0xf6),_0x1b78c8(0xf0));return{'projectRoot':_0x4fd62f,'pagesBaseDir':_0x56ba73,'appPagesDir':join(_0x56ba73,_0x26b0c7),'lockFilePath':join(_0x4fd62f,_0x1b78c8(0xf6),_0x1b78c8(0xf2))};}export function buildPageFileName(_0x44686a,_0x3a37f2){const _0x8792df=a152_0x3bb178;return _0x44686a+'-'+String(_0x3a37f2)[_0x8792df(0xf7)]()+_0x8792df(0xf9);}export function resolvePageFilePath(_0x3bcb85,_0x391aee,_0x417d6b){const _0x80472c=a152_0x3bb178;return join(_0x3bcb85[_0x80472c(0xf5)],buildPageFileName(_0x391aee,_0x417d6b));}export async function ensureParentDirectory(_0x441be2){await mkdir(dirname(_0x441be2),{'recursive':!![]});}function a152_0x4976(_0x36022,_0x531926){_0x36022=_0x36022-0xef;const _0x5653b5=a152_0x5653();let _0x497690=_0x5653b5[_0x36022];return _0x497690;}export async function fileExists(_0x51ff0c){const _0x47adc2=a152_0x3bb178;try{return await access(_0x51ff0c,constants[_0x47adc2(0xfe)]),!![];}catch{return![];}}
1
+ (function(_0x2cc59f,_0x478ddd){const _0x1e0949=a152_0x4ffc,_0x171579=_0x2cc59f();while(!![]){try{const _0x4306de=-parseInt(_0x1e0949(0x181))/0x1+-parseInt(_0x1e0949(0x17c))/0x2+parseInt(_0x1e0949(0x177))/0x3+parseInt(_0x1e0949(0x182))/0x4+-parseInt(_0x1e0949(0x180))/0x5*(parseInt(_0x1e0949(0x179))/0x6)+parseInt(_0x1e0949(0x176))/0x7*(parseInt(_0x1e0949(0x17b))/0x8)+-parseInt(_0x1e0949(0x178))/0x9;if(_0x4306de===_0x478ddd)break;else _0x171579['push'](_0x171579['shift']());}catch(_0x4a1834){_0x171579['push'](_0x171579['shift']());}}}(a152_0x1548,0xabe06));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a152_0x4ffc(_0x22f386,_0x1b5a4f){_0x22f386=_0x22f386-0x175;const _0x154894=a152_0x1548();let _0x4ffc88=_0x154894[_0x22f386];return _0x4ffc88;}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x2b6f5d,_0x2b56cc=process['cwd']()){const _0x31af1e=a152_0x4ffc,_0x3385cc=resolve(_0x2b56cc),_0x572fa9=join(_0x3385cc,_0x31af1e(0x17d),_0x31af1e(0x17f));return{'projectRoot':_0x3385cc,'pagesBaseDir':_0x572fa9,'appPagesDir':join(_0x572fa9,_0x2b6f5d),'lockFilePath':join(_0x3385cc,_0x31af1e(0x17d),_0x31af1e(0x17a))};}export function buildPageFileName(_0xe431d9,_0x27f114){const _0x41e445=a152_0x4ffc;return _0xe431d9+'-'+String(_0x27f114)[_0x41e445(0x175)]()+'.json';}export function resolvePageFilePath(_0x4dae2c,_0x1ddb6e,_0x3fd3e5){const _0x468603=a152_0x4ffc;return join(_0x4dae2c[_0x468603(0x183)],buildPageFileName(_0x1ddb6e,_0x3fd3e5));}export async function ensureParentDirectory(_0x56bbf0){await mkdir(dirname(_0x56bbf0),{'recursive':!![]});}export async function fileExists(_0x1bac1a){const _0x54350f=a152_0x4ffc;try{return await access(_0x1bac1a,constants[_0x54350f(0x17e)]),!![];}catch{return![];}}function a152_0x1548(){const _0x4bddd3=['332406yzUUpZ','page.lock.json','71032SmrmWT','2163200fdPFrI','.rabetbase','F_OK','page','5rNAjdo','1291882KBUfMu','2746544LKnWmD','appPagesDir','toUpperCase','854oLTcUv','4193559KZXyia','313542cGdQBE'];a152_0x1548=function(){return _0x4bddd3;};return a152_0x1548();}
@@ -1 +1 @@
1
- (function(_0x2cffef,_0x5a0371){const _0x3653ec=a153_0x43e5,_0x5c5911=_0x2cffef();while(!![]){try{const _0x4d9f15=-parseInt(_0x3653ec(0xfa))/0x1+-parseInt(_0x3653ec(0xee))/0x2+-parseInt(_0x3653ec(0xf2))/0x3+-parseInt(_0x3653ec(0xf5))/0x4+parseInt(_0x3653ec(0xef))/0x5+parseInt(_0x3653ec(0xf7))/0x6+parseInt(_0x3653ec(0xf9))/0x7*(parseInt(_0x3653ec(0xf1))/0x8);if(_0x4d9f15===_0x5a0371)break;else _0x5c5911['push'](_0x5c5911['shift']());}catch(_0x11ed30){_0x5c5911['push'](_0x5c5911['shift']());}}}(a153_0x2f67,0x67be1));import a153_0x348c8c from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x49141a){const _0x45b570=a153_0x43e5;return JSON[_0x45b570(0xed)](JSON[_0x45b570(0xf3)](_0x49141a),null,0x2)+'\x0a';}export function computePageContentHash(_0x13143e){const _0x559f71=a153_0x43e5;return a153_0x348c8c['createHash'](_0x559f71(0xf8))['update'](_0x13143e)[_0x559f71(0xf0)](_0x559f71(0xf4));}function a153_0x43e5(_0x1969a4,_0x252c72){_0x1969a4=_0x1969a4-0xed;const _0x2f6737=a153_0x2f67();let _0x43e5ef=_0x2f6737[_0x1969a4];return _0x43e5ef;}export function computeSerializedSchemaHash(_0x37444e){return computePageContentHash(serializePageSchemaForFile(_0x37444e));}function a153_0x2f67(){const _0x2af9e3=['2128710AKuQzg','md5','33271DBfjad','579790YhtvWh','stringify','1211926UlyzTa','655810RFIsfb','digest','2776edjKzS','479751ycNPiQ','parse','hex','1458556lmvQWW','utf8'];a153_0x2f67=function(){return _0x2af9e3;};return a153_0x2f67();}export async function computePageFileHash(_0x2742d8){const _0x323eda=a153_0x43e5,_0x4f7528=await readFile(_0x2742d8,_0x323eda(0xf6));return computePageContentHash(_0x4f7528);}
1
+ function a153_0x89e1(){const _0x180042=['createHash','1850824ohGodo','940158QGVzlB','7022190GelpWX','4cjxWIg','2094778HWCkaq','md5','digest','utf8','18371673IsOrLN','parse','4803185RIvkJk','8ZIEKda','hex','255627jenfbi','10zSrGVF','update'];a153_0x89e1=function(){return _0x180042;};return a153_0x89e1();}(function(_0x55bce7,_0x4c34dc){const _0x2b54ea=a153_0x23aa,_0x1343d7=_0x55bce7();while(!![]){try{const _0x42145f=parseInt(_0x2b54ea(0xb9))/0x1+parseInt(_0x2b54ea(0xbd))/0x2+-parseInt(_0x2b54ea(0xbe))/0x3+-parseInt(_0x2b54ea(0xc0))/0x4*(-parseInt(_0x2b54ea(0xb6))/0x5)+parseInt(_0x2b54ea(0xbf))/0x6+-parseInt(_0x2b54ea(0xb0))/0x7*(parseInt(_0x2b54ea(0xb7))/0x8)+parseInt(_0x2b54ea(0xb4))/0x9*(-parseInt(_0x2b54ea(0xba))/0xa);if(_0x42145f===_0x4c34dc)break;else _0x1343d7['push'](_0x1343d7['shift']());}catch(_0x45ee06){_0x1343d7['push'](_0x1343d7['shift']());}}}(a153_0x89e1,0xa0ab8));import a153_0x29f242 from'node:crypto';function a153_0x23aa(_0x38873a,_0x1ba157){_0x38873a=_0x38873a-0xb0;const _0x89e185=a153_0x89e1();let _0x23aad3=_0x89e185[_0x38873a];return _0x23aad3;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x4c8dc6){const _0x2182b6=a153_0x23aa;return JSON['stringify'](JSON[_0x2182b6(0xb5)](_0x4c8dc6),null,0x2)+'\x0a';}export function computePageContentHash(_0x32a8db){const _0x5cee59=a153_0x23aa;return a153_0x29f242[_0x5cee59(0xbc)](_0x5cee59(0xb1))[_0x5cee59(0xbb)](_0x32a8db)[_0x5cee59(0xb2)](_0x5cee59(0xb8));}export function computeSerializedSchemaHash(_0x5d4e70){return computePageContentHash(serializePageSchemaForFile(_0x5d4e70));}export async function computePageFileHash(_0x5e9b4b){const _0x3efa85=a153_0x23aa,_0x50e1a9=await readFile(_0x5e9b4b,_0x3efa85(0xb3));return computePageContentHash(_0x50e1a9);}
@@ -1 +1 @@
1
- (function(_0x2dec23,_0x5b08ea){const _0x11b7cd=a154_0x24ad,_0x4ba0ba=_0x2dec23();while(!![]){try{const _0x35c913=parseInt(_0x11b7cd(0xa7))/0x1+parseInt(_0x11b7cd(0xa9))/0x2+parseInt(_0x11b7cd(0xa5))/0x3+-parseInt(_0x11b7cd(0xb2))/0x4+parseInt(_0x11b7cd(0xa4))/0x5+-parseInt(_0x11b7cd(0xae))/0x6*(parseInt(_0x11b7cd(0xa8))/0x7)+parseInt(_0x11b7cd(0xa3))/0x8*(-parseInt(_0x11b7cd(0xa2))/0x9);if(_0x35c913===_0x5b08ea)break;else _0x4ba0ba['push'](_0x4ba0ba['shift']());}catch(_0x4e607f){_0x4ba0ba['push'](_0x4ba0ba['shift']());}}}(a154_0x2e69,0x86cf1));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x59684c,_0x280b55){const _0x2dda85=a154_0x24ad,_0x5965bc={'apps':_0x59684c[_0x2dda85(0xad)]&&typeof _0x59684c[_0x2dda85(0xad)]===_0x2dda85(0xa6)?_0x59684c[_0x2dda85(0xad)]:{}};let _0x2590f1=_0x5965bc[_0x2dda85(0xad)][_0x280b55];if(!_0x2590f1)return _0x2590f1={'lastSync':'','pages':{}},_0x5965bc['apps'][_0x280b55]=_0x2590f1,{'lockData':_0x5965bc,'appLock':_0x2590f1};return!_0x2590f1['lastSync']&&(_0x2590f1['lastSync']=''),(!_0x2590f1[_0x2dda85(0xaa)]||typeof _0x2590f1[_0x2dda85(0xaa)]!==_0x2dda85(0xa6))&&(_0x2590f1[_0x2dda85(0xaa)]={}),{'lockData':_0x5965bc,'appLock':_0x2590f1};}export async function readPageLockFile(_0x1446e7){const _0x31c38a=a154_0x24ad;try{const _0x42a037=await readFile(_0x1446e7,_0x31c38a(0xb1)),_0x5de49a=JSON['parse'](_0x42a037);return{'apps':_0x5de49a[_0x31c38a(0xad)]&&typeof _0x5de49a[_0x31c38a(0xad)]===_0x31c38a(0xa6)?_0x5de49a[_0x31c38a(0xad)]:{}};}catch(_0x2cc8a6){if(_0x2cc8a6[_0x31c38a(0xab)]===_0x31c38a(0xac))return null;throw new Error(_0x31c38a(0xaf)+String(_0x2cc8a6));}}function a154_0x2e69(){const _0x3f9143=['1507600BSFioW','pages','code','ENOENT','apps','3190734YqytpI','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','stringify','utf8','1511196jwkCDU','17390034BLAayo','8uWYxhu','4680965DUtGhR','1861365fHlGeb','object','1083543mlPBsd','7VvAhYG'];a154_0x2e69=function(){return _0x3f9143;};return a154_0x2e69();}function a154_0x24ad(_0x41de67,_0x4a8bc4){_0x41de67=_0x41de67-0xa2;const _0x2e695c=a154_0x2e69();let _0x24adb5=_0x2e695c[_0x41de67];return _0x24adb5;}export async function writePageLockFile(_0x46ea35,_0x467c2e){const _0x50eec2=a154_0x24ad;await mkdir(dirname(_0x46ea35),{'recursive':!![]}),await writeFile(_0x46ea35,JSON[_0x50eec2(0xb0)](_0x467c2e,null,0x2),_0x50eec2(0xb1));}
1
+ (function(_0x5dff05,_0x58410b){const _0x2cf588=a154_0x5e37,_0x299f3b=_0x5dff05();while(!![]){try{const _0x467b67=-parseInt(_0x2cf588(0x87))/0x1*(-parseInt(_0x2cf588(0x88))/0x2)+-parseInt(_0x2cf588(0x84))/0x3*(parseInt(_0x2cf588(0x81))/0x4)+parseInt(_0x2cf588(0x80))/0x5+-parseInt(_0x2cf588(0x8c))/0x6*(-parseInt(_0x2cf588(0x85))/0x7)+parseInt(_0x2cf588(0x7b))/0x8*(-parseInt(_0x2cf588(0x89))/0x9)+-parseInt(_0x2cf588(0x8e))/0xa*(-parseInt(_0x2cf588(0x86))/0xb)+parseInt(_0x2cf588(0x7c))/0xc*(-parseInt(_0x2cf588(0x82))/0xd);if(_0x467b67===_0x58410b)break;else _0x299f3b['push'](_0x299f3b['shift']());}catch(_0x5692df){_0x299f3b['push'](_0x299f3b['shift']());}}}(a154_0x1305,0x8fe7a));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x29479d,_0x216e52){const _0x27d82b=a154_0x5e37,_0x5b709e={'apps':_0x29479d[_0x27d82b(0x7d)]&&typeof _0x29479d[_0x27d82b(0x7d)]===_0x27d82b(0x7e)?_0x29479d['apps']:{}};let _0x1bd147=_0x5b709e[_0x27d82b(0x7d)][_0x216e52];if(!_0x1bd147)return _0x1bd147={'lastSync':'','pages':{}},_0x5b709e['apps'][_0x216e52]=_0x1bd147,{'lockData':_0x5b709e,'appLock':_0x1bd147};return!_0x1bd147[_0x27d82b(0x8b)]&&(_0x1bd147['lastSync']=''),(!_0x1bd147['pages']||typeof _0x1bd147[_0x27d82b(0x79)]!==_0x27d82b(0x7e))&&(_0x1bd147['pages']={}),{'lockData':_0x5b709e,'appLock':_0x1bd147};}function a154_0x1305(){const _0x1ce341=['8NBQKhm','211748KYBfsN','9JbeGRi','code','lastSync','2203698LeOUaS','ENOENT','329590sfexFQ','stringify','pages','parse','1471088dVHihR','439044QolNks','apps','object','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','180340YBuJkm','812gfeHja','533ECtlHM','utf8','2973QpWEID','14APyQtE','286lvBPUB'];a154_0x1305=function(){return _0x1ce341;};return a154_0x1305();}function a154_0x5e37(_0x4a4051,_0x523560){_0x4a4051=_0x4a4051-0x79;const _0x1305eb=a154_0x1305();let _0x5e37dc=_0x1305eb[_0x4a4051];return _0x5e37dc;}export async function readPageLockFile(_0x5ab710){const _0x2b5056=a154_0x5e37;try{const _0x40cddd=await readFile(_0x5ab710,'utf8'),_0x7c01eb=JSON[_0x2b5056(0x7a)](_0x40cddd);return{'apps':_0x7c01eb['apps']&&typeof _0x7c01eb[_0x2b5056(0x7d)]===_0x2b5056(0x7e)?_0x7c01eb['apps']:{}};}catch(_0x642e47){if(_0x642e47[_0x2b5056(0x8a)]===_0x2b5056(0x8d))return null;throw new Error(_0x2b5056(0x7f)+String(_0x642e47));}}export async function writePageLockFile(_0x51f990,_0xc77c66){const _0x248da0=a154_0x5e37;await mkdir(dirname(_0x51f990),{'recursive':!![]}),await writeFile(_0x51f990,JSON[_0x248da0(0x8f)](_0xc77c66,null,0x2),_0x248da0(0x83));}
@@ -1 +1 @@
1
- const a156_0x5d47fe=a156_0x4ef1;(function(_0x42a6c6,_0x171e24){const _0x4a8455=a156_0x4ef1,_0xeb7ad4=_0x42a6c6();while(!![]){try{const _0x3d4759=parseInt(_0x4a8455(0xf2))/0x1+-parseInt(_0x4a8455(0xf8))/0x2+parseInt(_0x4a8455(0xf7))/0x3+parseInt(_0x4a8455(0xef))/0x4+parseInt(_0x4a8455(0xf0))/0x5*(parseInt(_0x4a8455(0xf9))/0x6)+parseInt(_0x4a8455(0xfc))/0x7*(parseInt(_0x4a8455(0xf3))/0x8)+parseInt(_0x4a8455(0xf5))/0x9*(-parseInt(_0x4a8455(0xfa))/0xa);if(_0x3d4759===_0x171e24)break;else _0xeb7ad4['push'](_0xeb7ad4['shift']());}catch(_0x289c84){_0xeb7ad4['push'](_0xeb7ad4['shift']());}}}(a156_0x1863,0xafdf9));function a156_0x4ef1(_0x2e9ea1,_0x4ca6d3){_0x2e9ea1=_0x2e9ea1-0xef;const _0x1863da=a156_0x1863();let _0x4ef1a9=_0x1863da[_0x2e9ea1];return _0x4ef1a9;}import{resolve}from'node:path';function a156_0x1863(){const _0x2cf8df=['2815340uiiXDD','6449514YYALEU','10RxyAHe','/sql','244769zPfVvj','sql-trash','2396300lewiBv','5bYUAXO','sql','1361594bpNwev','136XysbQX','.rabetbase','21354561Dfrkcq','sql.lock.json','2612247EkPEtD'];a156_0x1863=function(){return _0x2cf8df;};return a156_0x1863();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a156_0x5d47fe(0xf4),LOCK_FILE_NAME=a156_0x5d47fe(0xf6),TRASH_DIR_NAME=a156_0x5d47fe(0xfd);export function loadSqlProjectConfig(_0x58b84b,_0x521150){const _0x2d8322=a156_0x5d47fe,_0x108c18=resolve(_0x521150??findProjectRootDirectory()),_0xb53360=DOT_DIR+_0x2d8322(0xfb),_0x17b1c8=_0xb53360+'/'+_0x58b84b;return{'projectRoot':_0x108c18,'appCode':_0x58b84b,'sqlWorkspaceRoot':_0xb53360,'sqlRoot':_0x17b1c8,'sqlRootDir':resolve(_0x108c18,DOT_DIR,_0x2d8322(0xf1),_0x58b84b),'lockFilePath':resolve(_0x108c18,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x108c18,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a156_0x181f(_0x43a86d,_0x86ef7e){_0x43a86d=_0x43a86d-0x13a;const _0x3e38f6=a156_0x3e38();let _0x181f94=_0x3e38f6[_0x43a86d];return _0x181f94;}const a156_0x183328=a156_0x181f;(function(_0x415e30,_0x2c1aa3){const _0xa4c047=a156_0x181f,_0x16918a=_0x415e30();while(!![]){try{const _0x784b12=parseInt(_0xa4c047(0x13b))/0x1*(-parseInt(_0xa4c047(0x145))/0x2)+parseInt(_0xa4c047(0x142))/0x3*(parseInt(_0xa4c047(0x13e))/0x4)+-parseInt(_0xa4c047(0x13c))/0x5+-parseInt(_0xa4c047(0x141))/0x6+-parseInt(_0xa4c047(0x146))/0x7*(parseInt(_0xa4c047(0x140))/0x8)+parseInt(_0xa4c047(0x13f))/0x9+parseInt(_0xa4c047(0x143))/0xa;if(_0x784b12===_0x2c1aa3)break;else _0x16918a['push'](_0x16918a['shift']());}catch(_0x9b8f79){_0x16918a['push'](_0x16918a['shift']());}}}(a156_0x3e38,0xa8696));import{resolve}from'node:path';function a156_0x3e38(){const _0x36e8bf=['3ejljla','16262490znNtEx','.rabetbase','2TQQzbV','35YHBRnp','/sql','sql','sql.lock.json','708886pZgaXk','1638320XXCOOE','sql-trash','584044JxRwzl','8242758aBwpTs','190024DRNdnd','5057958SeQNTF'];a156_0x3e38=function(){return _0x36e8bf;};return a156_0x3e38();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a156_0x183328(0x144),LOCK_FILE_NAME=a156_0x183328(0x13a),TRASH_DIR_NAME=a156_0x183328(0x13d);export function loadSqlProjectConfig(_0x150c58,_0x134f86){const _0x1e14f2=a156_0x183328,_0x2c6ed3=resolve(_0x134f86??findProjectRootDirectory()),_0x4e73d2=DOT_DIR+_0x1e14f2(0x147),_0xa92a9e=_0x4e73d2+'/'+_0x150c58;return{'projectRoot':_0x2c6ed3,'appCode':_0x150c58,'sqlWorkspaceRoot':_0x4e73d2,'sqlRoot':_0xa92a9e,'sqlRootDir':resolve(_0x2c6ed3,DOT_DIR,_0x1e14f2(0x148),_0x150c58),'lockFilePath':resolve(_0x2c6ed3,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2c6ed3,DOT_DIR,TRASH_DIR_NAME)};}