@lovrabet/rabetbase-cli 2.2.0 → 2.2.1-beta.2

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_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
+ const a142_0x296d05=a142_0x562d;(function(_0x29ac75,_0x31a62c){const _0x50bb4c=a142_0x562d,_0x42c082=_0x29ac75();while(!![]){try{const _0x160677=parseInt(_0x50bb4c(0x224))/0x1*(-parseInt(_0x50bb4c(0x22a))/0x2)+parseInt(_0x50bb4c(0x21a))/0x3+-parseInt(_0x50bb4c(0x20c))/0x4+parseInt(_0x50bb4c(0x210))/0x5+-parseInt(_0x50bb4c(0x21f))/0x6*(parseInt(_0x50bb4c(0x234))/0x7)+parseInt(_0x50bb4c(0x207))/0x8+-parseInt(_0x50bb4c(0x231))/0x9;if(_0x160677===_0x31a62c)break;else _0x42c082['push'](_0x42c082['shift']());}catch(_0x40b084){_0x42c082['push'](_0x42c082['shift']());}}}(a142_0x3332,0x19036));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';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';function a142_0x3332(){const _0x1516bb=['./constant/domain.js','parse','106bCSfWC','get','filter','Project','COOKIE','migrated','error','798732WdIkoc','env','warn','77pKDRED','apps','slice','merged','production','Global','appcode','utf8','api.ts','config','MAX_RISK','stringify','app','runtimeDomain','join','object','setRawCommand','riskLevel','APP','argv','cwd','trim','locale','-api.ts','defaultApp','FORMAT','data','message','globalConfig','cookie','keys','apiDir','.lovrabet.json','https://g.lovrabet.com/dist/lovrabet-skill','projectConfig','format','values','990136xEcfER','template_base_url','./auth/get-cookie.js','ENV','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','562576SnkitH','.lovrabetrc','set','project','325660FoAYTQ','read','apiDomain','find','entries','map','userDomain','.rabetbase.json','silent','inherit','496110WkXbQT','length','missing','status','./utils/is-non-interactive.js','2286oCxMto','ACCESS_KEY','empty','string','PAGE_SIZE','344nKhcju','authRequired','pageSize','accessKey'];a142_0x3332=function(){return _0x1516bb;};return a142_0x3332();}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(_0x5d9ec2){return process.env[`RABETBASE_${_0x5d9ec2}`]||process.env[`LOVRABET_${_0x5d9ec2}`]||undefined;}export const NEW_CONFIG_NAME=a142_0x296d05(0x217);export const CONFIG_NAMES=[a142_0x296d05(0x217),a142_0x296d05(0x202),a142_0x296d05(0x20d)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x296d05(0x22c)](_0x5c77ce=>_0x5c77ce!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x37f4ad){for(const _0x2cdd52 of CONFIG_NAMES){const _0x1da8dd=resolve(_0x37f4ad,_0x2cdd52);if(existsSync(_0x1da8dd))return _0x1da8dd;}return undefined;}export function findProjectRootDirectory(_0xa27af=process[a142_0x296d05(0x1f6)]()){let _0x5b501a=resolve(_0xa27af);const {root:_0x4fbc21}=parse(_0x5b501a),_0x1c23ed=homedir();while(!![]){if(resolveConfigPath(_0x5b501a)){if(_0x5b501a===_0x1c23ed)break;return _0x5b501a;}if(_0x5b501a===_0x4fbc21||_0x5b501a===_0x1c23ed)break;const _0x541795=dirname(_0x5b501a);if(_0x541795===_0x5b501a)break;_0x5b501a=_0x541795;}return resolve(_0xa27af);}export async function createContext(_0x5a444f){const _0x11493d=a142_0x296d05,{config:_0x510a42,layers:_0x515ee5}=readRawConfigWithLayers(),_0x11cc5b=buildConfig(_0x510a42,_0x5a444f,_0x515ee5),{initEnv:_0x1609fd}=await import('./constant/env.js');if(_0x11cc5b[_0x11493d(0x232)])_0x1609fd(_0x11cc5b[_0x11493d(0x232)]);else _0x5a444f[_0x11493d(0x232)]&&typeof _0x5a444f[_0x11493d(0x232)]===_0x11493d(0x222)&&_0x1609fd(_0x5a444f['env']);const {initDomains:_0x14678b,getUserDomain:_0x2ee4fe,getApiDomain:_0x185e8a}=await import(_0x11493d(0x228));_0x14678b({'apiDomain':_0x510a42[_0x11493d(0x212)]||undefined,'userDomain':_0x510a42[_0x11493d(0x216)]||undefined,'runtimeDomain':_0x510a42[_0x11493d(0x241)]||undefined});const _0x2f5c9e={'apiDomain':_0x185e8a(),'userDomain':_0x2ee4fe()},_0x36cff6=await buildAuth(_0x11cc5b);logger['setLogPath'](process[_0x11493d(0x1f6)]());const _0x344b29=(CLI_BIN_NAME+'\x20'+process[_0x11493d(0x1f5)][_0x11493d(0x236)](0x2)[_0x11493d(0x242)]('\x20'))[_0x11493d(0x1f7)]();logger[_0x11493d(0x244)](_0x344b29);const {isNonInteractive:_0x4edabb}=await import(_0x11493d(0x21e)),_0xaf7030=_0x4edabb(_0x5a444f);return{'config':_0x11cc5b,'auth':_0x36cff6,'logger':logger,'env':_0x2f5c9e,'nonInteractive':_0xaf7030};}export function buildConfigFromFlags(_0xbc09b0){const {config:_0x41f353,layers:_0x420735}=readRawConfigWithLayers();return buildConfig(_0x41f353,_0xbc09b0,_0x420735);}export function getProjectConfigPath(){const _0x5ba889=a142_0x296d05;return resolveConfigPath(process[_0x5ba889(0x1f6)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x2986ea){const _0x309d9e=a142_0x296d05;if(!existsSync(_0x2986ea))return{'status':_0x309d9e(0x21c)};try{const _0x3865d3=readFileSync(_0x2986ea,{'encoding':_0x309d9e(0x23b)});if(!_0x3865d3?.['trim']())return{'status':_0x309d9e(0x221)};const _0x457806=JSON[_0x309d9e(0x229)](_0x3865d3);return{'status':'ok','data':_0x457806};}catch(_0x485d04){return{'status':_0x309d9e(0x230),'message':_0x485d04 instanceof Error?_0x485d04[_0x309d9e(0x1fd)]:String(_0x485d04)};}}function parseCliConfigJsonFile(_0x722b2,_0x3a671d,_0x4c6f55){const _0xb57f36=a142_0x296d05,_0x575206=inspectCliConfigJsonFile(_0x722b2);if(_0x575206[_0xb57f36(0x21d)]===_0xb57f36(0x21c)||_0x575206[_0xb57f36(0x21d)]===_0xb57f36(0x221))return{};if(_0x575206['status']==='ok')return _0x575206[_0xb57f36(0x1fc)];return _0x3a671d===_0xb57f36(0x233)&&_0x4c6f55&&console[_0xb57f36(0x230)](CLI_BIN_NAME+':\x20'+_0x4c6f55+_0xb57f36(0x20b)+_0x722b2+'\x0a\x20\x20'+_0x575206[_0xb57f36(0x1fd)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x2e414c){const _0x4c714f=a142_0x296d05;if(!_0x2e414c||typeof _0x2e414c!==_0x4c714f(0x243))return{'config':{},'migrated':![]};const _0x2728b4={..._0x2e414c},_0x1357b6=_0x2728b4[_0x4c714f(0x235)]&&typeof _0x2728b4[_0x4c714f(0x235)]===_0x4c714f(0x243)?{..._0x2728b4[_0x4c714f(0x235)]}:{},_0x578fcf=Object[_0x4c714f(0x200)](_0x1357b6)[_0x4c714f(0x21b)],_0x213a6b=_0x2728b4[_0x4c714f(0x23a)]||_0x2728b4[_0x4c714f(0x240)];let _0x24f188=![];if(_0x213a6b&&_0x578fcf===0x0){const _0x5a39ad=typeof _0x2728b4[_0x4c714f(0x1fa)]==='string'&&_0x2728b4[_0x4c714f(0x1fa)][_0x4c714f(0x1f7)]()?_0x2728b4[_0x4c714f(0x1fa)]:String(_0x213a6b)[_0x4c714f(0x1f7)]();_0x1357b6[_0x5a39ad]={'appcode':String(_0x213a6b)[_0x4c714f(0x1f7)](),..._0x2728b4['env']!=null?{'env':_0x2728b4['env']}:{},..._0x2728b4[_0x4c714f(0x201)]!=null?{'apiDir':_0x2728b4[_0x4c714f(0x201)]}:{},..._0x2728b4[_0x4c714f(0x1ff)]!=null?{'cookie':_0x2728b4['cookie']}:{},..._0x2728b4[_0x4c714f(0x227)]!=null?{'accessKey':_0x2728b4['accessKey']}:{},..._0x2728b4[_0x4c714f(0x205)]!=null?{'format':_0x2728b4[_0x4c714f(0x205)]}:{},..._0x2728b4[_0x4c714f(0x226)]!=null?{'pageSize':_0x2728b4[_0x4c714f(0x226)]}:{},..._0x2728b4[_0x4c714f(0x1f3)]!=null?{'riskLevel':_0x2728b4[_0x4c714f(0x1f3)]}:{},..._0x2728b4['locale']!=null?{'locale':_0x2728b4[_0x4c714f(0x1f8)]}:{}},_0x2728b4[_0x4c714f(0x235)]=_0x1357b6;if(!_0x2728b4[_0x4c714f(0x1fa)])_0x2728b4[_0x4c714f(0x1fa)]=_0x5a39ad;_0x24f188=!![];}return(_0x4c714f(0x23a)in _0x2728b4||_0x4c714f(0x240)in _0x2728b4)&&(delete _0x2728b4[_0x4c714f(0x23a)],delete _0x2728b4[_0x4c714f(0x240)],_0x24f188=!![]),{'config':_0x2728b4,'migrated':_0x24f188};}function writeNormalizedConfigIfNeeded(_0x534ace,_0x5c9387){const _0x13bb39=a142_0x296d05,_0x2f29e9=JSON['stringify'](_0x5c9387,null,0x2)+'\x0a';if(normalizedWriteCache[_0x13bb39(0x22b)](_0x534ace)===_0x2f29e9)return;writeConfigFile(_0x534ace,_0x5c9387),normalizedWriteCache[_0x13bb39(0x20e)](_0x534ace,_0x2f29e9);}function a142_0x562d(_0xa8dbed,_0x34a18b){_0xa8dbed=_0xa8dbed-0x1f3;const _0x3332f2=a142_0x3332();let _0x562d30=_0x3332f2[_0xa8dbed];return _0x562d30;}function parseAndNormalizeConfig(_0x3862e9,_0x188821,_0x521ecd){const _0xfb3e0d=a142_0x296d05,_0x117971=parseCliConfigJsonFile(_0x3862e9,_0x188821,_0x521ecd),_0x520cb8=normalizeLegacyConfigShape(_0x117971);if(_0x520cb8[_0xfb3e0d(0x22f)])try{writeNormalizedConfigIfNeeded(_0x3862e9,_0x520cb8[_0xfb3e0d(0x23d)]);}catch{}return _0x520cb8[_0xfb3e0d(0x23d)];}export function loadRawConfigLayers(_0x32028e){const _0x209ecd=a142_0x296d05;let _0x5eb6db={},_0x1d872e={};const _0x878312=resolveConfigPath(homedir());_0x878312&&(_0x5eb6db=parseAndNormalizeConfig(_0x878312,_0x209ecd(0x233),_0x209ecd(0x239)));const _0x5c2b78=_0x32028e??findProjectRootDirectory(),_0x2483ff=resolveConfigPath(_0x5c2b78);return _0x2483ff&&(_0x1d872e=parseAndNormalizeConfig(_0x2483ff,_0x209ecd(0x233),_0x209ecd(0x22d))),{'globalPath':_0x878312,'projectPath':_0x2483ff,'globalConfig':_0x5eb6db,'projectConfig':_0x1d872e};}const INHERIT_WHITELIST=[a142_0x296d05(0x1ff),'accessKey',a142_0x296d05(0x1f8),a142_0x296d05(0x205),a142_0x296d05(0x1f3),a142_0x296d05(0x226)];function mergeRawConfigLayers(_0x149848){const _0x4e581a=a142_0x296d05,{globalConfig:_0xee5478,projectConfig:_0x1eec35}=_0x149848,_0x186f40=Object[_0x4e581a(0x200)](_0x1eec35)[_0x4e581a(0x21b)]>0x0;if(!_0x186f40)return mergeGlobalOnly(_0xee5478);if(_0x1eec35[_0x4e581a(0x219)]===!![])return mergeFullInherit(_0xee5478,_0x1eec35);if(_0x1eec35[_0x4e581a(0x219)]===![])return mergeIsolated(_0x1eec35);return mergeProjectFirst(_0xee5478,_0x1eec35);}function mergeGlobalOnly(_0x5afa1b){const _0x27f692=a142_0x296d05,_0xc3f914={..._0x5afa1b},_0x22b845=_0x5afa1b[_0x27f692(0x235)]&&typeof _0x5afa1b['apps']===_0x27f692(0x243)?_0x5afa1b[_0x27f692(0x235)]:{};Object[_0x27f692(0x200)](_0x22b845)[_0x27f692(0x21b)]>0x0&&(_0xc3f914['apps']=_0x22b845);if(_0x5afa1b[_0x27f692(0x1fa)])_0xc3f914['defaultApp']=_0x5afa1b[_0x27f692(0x1fa)];else{const _0x38b674=Object[_0x27f692(0x200)](_0x22b845);if(_0x38b674[_0x27f692(0x21b)]>0x0)_0xc3f914['defaultApp']=_0x38b674[0x0];}return _0xc3f914;}function mergeIsolated(_0x3f5020){const _0x5ab104=a142_0x296d05,_0x2c227c={..._0x3f5020};delete _0x2c227c[_0x5ab104(0x219)];const _0x2a9c49=_0x3f5020[_0x5ab104(0x235)]&&typeof _0x3f5020[_0x5ab104(0x235)]===_0x5ab104(0x243)?_0x3f5020[_0x5ab104(0x235)]:{};Object['keys'](_0x2a9c49)[_0x5ab104(0x21b)]>0x0?_0x2c227c[_0x5ab104(0x235)]=_0x2a9c49:delete _0x2c227c[_0x5ab104(0x235)];if(_0x5ab104(0x1fa)in _0x3f5020)_0x2c227c[_0x5ab104(0x1fa)]=_0x3f5020['defaultApp'];else Object[_0x5ab104(0x200)](_0x2a9c49)['length']>0x0?_0x2c227c[_0x5ab104(0x1fa)]=Object[_0x5ab104(0x200)](_0x2a9c49)[0x0]:delete _0x2c227c[_0x5ab104(0x1fa)];return _0x2c227c;}function mergeProjectFirst(_0x3cefb3,_0x20b0ab){const _0x11a2e3=a142_0x296d05,_0x35d9f5={..._0x20b0ab};delete _0x35d9f5[_0x11a2e3(0x219)];for(const _0x23b6cc of INHERIT_WHITELIST){!(_0x23b6cc in _0x35d9f5)&&_0x23b6cc in _0x3cefb3&&(_0x35d9f5[_0x23b6cc]=_0x3cefb3[_0x23b6cc]);}const _0x54161e=_0x20b0ab['apps']&&typeof _0x20b0ab[_0x11a2e3(0x235)]==='object'?_0x20b0ab[_0x11a2e3(0x235)]:{};Object[_0x11a2e3(0x200)](_0x54161e)['length']>0x0?_0x35d9f5[_0x11a2e3(0x235)]=_0x54161e:delete _0x35d9f5[_0x11a2e3(0x235)];if('defaultApp'in _0x20b0ab)_0x35d9f5[_0x11a2e3(0x1fa)]=_0x20b0ab[_0x11a2e3(0x1fa)];else Object[_0x11a2e3(0x200)](_0x54161e)['length']>0x0?_0x35d9f5[_0x11a2e3(0x1fa)]=Object['keys'](_0x54161e)[0x0]:delete _0x35d9f5[_0x11a2e3(0x1fa)];return _0x35d9f5;}function mergeFullInherit(_0x471858,_0x34d06d){const _0x50529f=a142_0x296d05,_0x3ba745=_0x471858[_0x50529f(0x235)]&&typeof _0x471858['apps']===_0x50529f(0x243)?_0x471858[_0x50529f(0x235)]:{},_0x36f6ea=_0x34d06d[_0x50529f(0x235)]&&typeof _0x34d06d[_0x50529f(0x235)]===_0x50529f(0x243)?_0x34d06d[_0x50529f(0x235)]:{},_0x50f047={..._0x3ba745,..._0x36f6ea},_0x123e46={..._0x471858,..._0x34d06d};delete _0x123e46[_0x50529f(0x219)];Object[_0x50529f(0x200)](_0x50f047)[_0x50529f(0x21b)]>0x0&&(_0x123e46['apps']=_0x50f047);if('defaultApp'in _0x34d06d)_0x123e46[_0x50529f(0x1fa)]=_0x34d06d[_0x50529f(0x1fa)];else{if(Object[_0x50529f(0x200)](_0x36f6ea)[_0x50529f(0x21b)]>0x0)_0x123e46['defaultApp']=Object[_0x50529f(0x200)](_0x36f6ea)[0x0];else{if(_0x471858[_0x50529f(0x1fa)])_0x123e46[_0x50529f(0x1fa)]=_0x471858[_0x50529f(0x1fa)];else{const _0x56a841=Object[_0x50529f(0x200)](_0x3ba745);if(_0x56a841[_0x50529f(0x21b)]>0x0)_0x123e46[_0x50529f(0x1fa)]=_0x56a841[0x0];}}}return _0x123e46;}export function readRawConfigWithLayers(_0x7cc856){const _0xafc3b6=loadRawConfigLayers(_0x7cc856);return{'config':mergeRawConfigLayers(_0xafc3b6),'layers':_0xafc3b6};}export function readRawConfig(_0xb0a85a){return mergeRawConfigLayers(loadRawConfigLayers(_0xb0a85a));}export function getConfigAppCode(_0x595ee8){const _0x27e8e8=a142_0x296d05,_0x51f33f=readRawConfig(_0x595ee8);if(_0x51f33f[_0x27e8e8(0x235)]&&typeof _0x51f33f['apps']===_0x27e8e8(0x243)){const _0x11e0ad=_0x51f33f[_0x27e8e8(0x1fa)];if(_0x11e0ad&&_0x51f33f[_0x27e8e8(0x235)][_0x11e0ad]?.['appcode'])return String(_0x51f33f[_0x27e8e8(0x235)][_0x11e0ad][_0x27e8e8(0x23a)])[_0x27e8e8(0x1f7)]();const _0x2c1539=Object[_0x27e8e8(0x206)](_0x51f33f[_0x27e8e8(0x235)])[0x0];if(_0x2c1539?.[_0x27e8e8(0x23a)])return String(_0x2c1539[_0x27e8e8(0x23a)])[_0x27e8e8(0x1f7)]();}const _0x14b7f0=_0x51f33f[_0x27e8e8(0x23a)]||_0x51f33f[_0x27e8e8(0x240)];if(typeof _0x14b7f0!==_0x27e8e8(0x222)||_0x14b7f0[_0x27e8e8(0x1f7)]()==='')return undefined;return _0x14b7f0[_0x27e8e8(0x1f7)]();}export function getMultiAppConfigs(_0x1560a1=a142_0x296d05(0x20f),_0x3c0ee3){const _0x12c6ec=a142_0x296d05,_0xdf2ed6=loadRawConfigLayers(_0x3c0ee3);let _0x887626,_0x30019b;if(_0x1560a1===_0x12c6ec(0x237)){const _0x490894=_0xdf2ed6[_0x12c6ec(0x1fe)][_0x12c6ec(0x235)]&&typeof _0xdf2ed6[_0x12c6ec(0x1fe)][_0x12c6ec(0x235)]===_0x12c6ec(0x243)?_0xdf2ed6['globalConfig'][_0x12c6ec(0x235)]:{},_0x1be7e5=_0xdf2ed6[_0x12c6ec(0x204)][_0x12c6ec(0x235)]&&typeof _0xdf2ed6[_0x12c6ec(0x204)][_0x12c6ec(0x235)]===_0x12c6ec(0x243)?_0xdf2ed6[_0x12c6ec(0x204)][_0x12c6ec(0x235)]:{};_0x887626={..._0x490894,..._0x1be7e5};const _0x51b826=readRawConfig(_0x3c0ee3);_0x30019b=_0x51b826[_0x12c6ec(0x1fa)];}else _0x887626=_0xdf2ed6[_0x12c6ec(0x204)][_0x12c6ec(0x235)],_0x30019b=_0xdf2ed6[_0x12c6ec(0x204)][_0x12c6ec(0x1fa)];if(!_0x887626||typeof _0x887626!=='object'||Object[_0x12c6ec(0x200)](_0x887626)[_0x12c6ec(0x21b)]===0x0)return null;return Object['entries'](_0x887626)[_0x12c6ec(0x215)](([_0xed7923,_0x32ec8e])=>({'name':_0xed7923,'appcode':_0x32ec8e?.[_0x12c6ec(0x23a)]||'','isDefault':_0xed7923===_0x30019b,'env':_0x32ec8e?.[_0x12c6ec(0x232)],'apiDir':_0x32ec8e?.[_0x12c6ec(0x201)],'cookie':_0x32ec8e?.[_0x12c6ec(0x1ff)]||undefined}))[_0x12c6ec(0x22c)](_0x110053=>_0x110053[_0x12c6ec(0x23a)]);}export function getTemplateBaseUrl(_0x234a90){const _0x22cdf5=a142_0x296d05,_0x58b0c3=readRawConfig(_0x234a90);if(_0x58b0c3[_0x22cdf5(0x208)]&&typeof _0x58b0c3[_0x22cdf5(0x208)]===_0x22cdf5(0x222))return _0x58b0c3[_0x22cdf5(0x208)]['replace'](/\/$/,'');return _0x22cdf5(0x203);}export function readConfigFile(_0x208e94){const _0x282241=a142_0x296d05;return parseAndNormalizeConfig(_0x208e94,_0x282241(0x218));}export function writeConfigFile(_0x68ab38,_0x3e16b7){const _0x3c99ab=a142_0x296d05,_0x4b0311=dirname(_0x68ab38);!existsSync(_0x4b0311)&&mkdirSync(_0x4b0311,{'recursive':!![]});const _0x595249=_0x68ab38+'.tmp';try{writeFileSync(_0x595249,JSON[_0x3c99ab(0x23f)](_0x3e16b7,null,0x2)+'\x0a',{'encoding':_0x3c99ab(0x23b),'mode':0x180}),renameSync(_0x595249,_0x68ab38);}catch(_0x2446aa){try{unlinkSync(_0x595249);}catch{}throw _0x2446aa;}}export function resolveWriteConfigPath(_0x1656d3){const _0x55e5eb=a142_0x296d05,_0x2589f0=_0x1656d3===_0x55e5eb(0x20f)?process[_0x55e5eb(0x1f6)]():homedir(),_0x15af91=resolveConfigPath(_0x2589f0);return _0x15af91??resolve(_0x2589f0,NEW_CONFIG_NAME);}function stringConfigValue(_0x4c435e){const _0x16ebc0=a142_0x296d05;return typeof _0x4c435e===_0x16ebc0(0x222)&&_0x4c435e[_0x16ebc0(0x1f7)]()?_0x4c435e[_0x16ebc0(0x1f7)]():undefined;}function appProfiles(_0x475114){const _0x565459=a142_0x296d05;return _0x475114['apps']&&typeof _0x475114[_0x565459(0x235)]===_0x565459(0x243)?_0x475114[_0x565459(0x235)]:{};}function resolveDefaultAppName(_0x54f4d2){const _0x1c7f9e=a142_0x296d05,_0x453510=stringConfigValue(_0x54f4d2['defaultApp']);if(_0x453510)return _0x453510;return Object[_0x1c7f9e(0x200)](appProfiles(_0x54f4d2))[0x0];}function resolveTopLevelAppCode(_0x544308){const _0x48062e=a142_0x296d05;return stringConfigValue(_0x544308[_0x48062e(0x23a)])||stringConfigValue(_0x544308['app']);}function buildConfig(_0x22b5b6,_0x58cd13,_0x277cde){const _0x3e9f9f=a142_0x296d05,_0x5d46ab=_0x277cde?.[_0x3e9f9f(0x204)]??{},_0x2d5c33=_0x277cde?.['globalConfig']??{},_0x3f2452=Object[_0x3e9f9f(0x200)](_0x5d46ab)[_0x3e9f9f(0x21b)]>0x0,_0x2c0e7e=!_0x3f2452||_0x5d46ab[_0x3e9f9f(0x219)]===!![],_0x427059=_0x3f2452?resolveDefaultAppName(_0x5d46ab):undefined,_0x3e0b19=_0x2c0e7e?resolveDefaultAppName(_0x2d5c33):undefined,_0x4f9fd5=stringConfigValue(_0x58cd13['app']),_0x1b7548=env(_0x3e9f9f(0x1f4)),_0x2dfa31={};if(_0x22b5b6['apps']&&typeof _0x22b5b6[_0x3e9f9f(0x235)]==='object')for(const [_0x24ac0b,_0xeed7fc]of Object[_0x3e9f9f(0x214)](_0x22b5b6[_0x3e9f9f(0x235)])){_0xeed7fc&&typeof _0xeed7fc===_0x3e9f9f(0x243)&&_0xeed7fc[_0x3e9f9f(0x23a)]&&(_0x2dfa31[_0x24ac0b]=_0xeed7fc);}const _0x4b390e=_0x22b5b6['defaultApp']||undefined,_0x4b17c8=Object[_0x3e9f9f(0x200)](_0x2dfa31)[_0x3e9f9f(0x21b)]>0x0,_0x1681a4=_0x4f9fd5||_0x427059||_0x1b7548||_0x3e0b19||_0x4b390e||undefined,_0x35c9c5=stringConfigValue(_0x58cd13[_0x3e9f9f(0x23a)]),_0x118660=_0x35c9c5?Object[_0x3e9f9f(0x214)](_0x2dfa31)['find'](([,_0x245d0f])=>_0x245d0f?.['appcode']===_0x35c9c5):undefined,_0x3544be=_0x118660?.[0x0],_0x402a4e=_0x118660?.[0x1];let _0x2d8059=_0x35c9c5?_0x3544be:_0x1681a4,_0x3a05f7=_0x2d8059&&_0x2dfa31[_0x2d8059]?_0x2dfa31[_0x2d8059]:undefined;_0x35c9c5&&_0x402a4e&&(_0x3a05f7=_0x402a4e);const _0x1f54b1=_0x35c9c5?_0x402a4e??_0x3a05f7:_0x3a05f7,_0x40726d=!_0x4f9fd5&&!_0x427059&&_0x1b7548&&_0x2d8059===_0x1b7548,_0x4c8755=_0x4f9fd5||(_0x40726d?_0x1b7548:undefined)||(_0x35c9c5?_0x3544be:undefined),_0x5bbafb=_0x1f54b1?.[_0x3e9f9f(0x23a)],_0x5d27b1=_0x3f2452?resolveTopLevelAppCode(_0x5d46ab):undefined,_0x3e550f=_0x2c0e7e?resolveTopLevelAppCode(_0x2d5c33):undefined,_0x2e204b=_0x4f9fd5||_0x427059?_0x5bbafb:undefined,_0x3266f9=!_0x4f9fd5&&!_0x427059?_0x5bbafb:undefined,_0xd3d364=_0x35c9c5||_0x2e204b||_0x5d27b1||_0x3266f9||_0x3e550f||undefined,_0x338b45=_0x3f2452?stringConfigValue(_0x5d46ab[_0x3e9f9f(0x232)]):undefined,_0x20e006=_0x2c0e7e?stringConfigValue(_0x2d5c33['env']):undefined,_0x226b63=_0x58cd13[_0x3e9f9f(0x232)]||_0x1f54b1?.[_0x3e9f9f(0x232)]||_0x338b45||env(_0x3e9f9f(0x20a))||_0x20e006||_0x22b5b6[_0x3e9f9f(0x232)]||DEFAULT_CONFIG_VALUES[_0x3e9f9f(0x232)],_0x56fe5a=_0x1f54b1?.[_0x3e9f9f(0x1f8)]||_0x22b5b6[_0x3e9f9f(0x1f8)]||DEFAULT_CONFIG_VALUES[_0x3e9f9f(0x1f8)],_0x2fe298=env(_0x3e9f9f(0x22e))||_0x1f54b1?.[_0x3e9f9f(0x1ff)]||_0x22b5b6[_0x3e9f9f(0x1ff)]||undefined,_0x319ffe=env(_0x3e9f9f(0x220))||_0x1f54b1?.['accessKey']||_0x22b5b6[_0x3e9f9f(0x227)]||undefined,_0x5c90bd=_0x58cd13[_0x3e9f9f(0x205)]||env(_0x3e9f9f(0x1fb))||_0x1f54b1?.[_0x3e9f9f(0x205)]||_0x22b5b6[_0x3e9f9f(0x205)],_0x2f0e1b=normalizeLegacyOutputFormat(_0x5c90bd),_0x2b01=env(_0x3e9f9f(0x223))||_0x1f54b1?.[_0x3e9f9f(0x226)]||_0x22b5b6[_0x3e9f9f(0x226)],_0x2ee685=_0x2b01?Number(_0x2b01)||undefined:undefined,_0xb56811=env('RISK_LEVEL')||env(_0x3e9f9f(0x23e))||_0x1f54b1?.[_0x3e9f9f(0x1f3)]||_0x22b5b6[_0x3e9f9f(0x1f3)]||_0x22b5b6['maxRisk'],_0x35dd6e=_0xb56811===_0x3e9f9f(0x211)||_0xb56811==='write'?_0xb56811:DEFAULT_CONFIG_VALUES[_0x3e9f9f(0x1f3)],_0x17e08e=env('VERBOSE'),_0x2b8649=_0x17e08e==='1'||_0x17e08e==='true',_0x256c3d=_0x1f54b1?.[_0x3e9f9f(0x201)]||_0x22b5b6['apiDir']||DEFAULT_CONFIG_VALUES[_0x3e9f9f(0x201)],_0x4c3a60=isDaily(normalizeEnv(String(_0x226b63)))?'daily':_0x3e9f9f(0x238);return{'appCode':typeof _0xd3d364===_0x3e9f9f(0x222)&&_0xd3d364[_0x3e9f9f(0x1f7)]()?_0xd3d364[_0x3e9f9f(0x1f7)]():undefined,'env':_0x4c3a60,'locale':_0x56fe5a,'cookie':_0x2fe298,'accessKey':_0x319ffe,'format':_0x2f0e1b,'pageSize':_0x2ee685,'riskLevel':_0x35dd6e,'verbose':_0x2b8649,'apiDir':_0x256c3d,'apps':_0x2dfa31,'defaultApp':_0x4b390e,'currentApp':_0x4b17c8?_0x2d8059:undefined,'explicitAppName':_0x4c8755,'raw':_0x22b5b6};}async function buildAuth(_0x3a82b9){const _0x2b09a0=a142_0x296d05,{getCookie:_0xcd0d0b}=await import(_0x2b09a0(0x209)),_0x26cead=_0x3a82b9[_0x2b09a0(0x1ff)]||_0xcd0d0b(),_0x16e635=_0x26cead?await getIsSessionValid():![];return{'cookie':_0x26cead,'isLoggedIn':_0x16e635,async 'getOrLogin'(){const _0x121d85=_0x2b09a0;if(_0x26cead&&_0x16e635)return _0x26cead;throw CliErrors[_0x121d85(0x225)]();}};}export function resolveApiFilePath(_0x275d43,_0x3f8791){const _0x5374cd=a142_0x296d05,_0x1e657e=resolve(process[_0x5374cd(0x1f6)](),_0x275d43),_0x3e288e=resolve(_0x1e657e,_0x5374cd(0x23c));if(!_0x3f8791)return _0x3e288e;const _0x30b6b9=readRawConfig(),_0x1f922e=_0x30b6b9[_0x5374cd(0x235)]&&typeof _0x30b6b9[_0x5374cd(0x235)]===_0x5374cd(0x243)?_0x30b6b9['apps']:{},_0x566cb1=Object[_0x5374cd(0x214)](_0x1f922e)[_0x5374cd(0x213)](([,_0x28e993])=>_0x28e993?.[_0x5374cd(0x23a)]===_0x3f8791);if(!_0x566cb1)return _0x3e288e;const [_0x86356f,_0x56eb78]=_0x566cb1,_0x4c0acb=typeof _0x30b6b9['defaultApp']===_0x5374cd(0x222)?_0x30b6b9[_0x5374cd(0x1fa)]:undefined;if(_0x56eb78?.[_0x5374cd(0x201)])return _0x3e288e;if(_0x4c0acb&&_0x86356f!==_0x4c0acb)return resolve(_0x1e657e,_0x86356f+_0x5374cd(0x1f9));return _0x3e288e;}
@@ -1 +1 @@
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
+ (function(_0x3bdaf9,_0x3a491d){const _0x374558=a143_0x5565,_0x31b8da=_0x3bdaf9();while(!![]){try{const _0x3c6894=parseInt(_0x374558(0x150))/0x1*(-parseInt(_0x374558(0x151))/0x2)+parseInt(_0x374558(0x15b))/0x3+-parseInt(_0x374558(0x154))/0x4*(parseInt(_0x374558(0x155))/0x5)+-parseInt(_0x374558(0x15c))/0x6*(parseInt(_0x374558(0x14e))/0x7)+-parseInt(_0x374558(0x157))/0x8*(parseInt(_0x374558(0x160))/0x9)+parseInt(_0x374558(0x15e))/0xa+parseInt(_0x374558(0x15d))/0xb;if(_0x3c6894===_0x3a491d)break;else _0x31b8da['push'](_0x31b8da['shift']());}catch(_0x3f91d3){_0x31b8da['push'](_0x31b8da['shift']());}}}(a143_0x132f,0x53e33));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a143_0x5565(_0x341bad,_0x2828f1){_0x341bad=_0x341bad-0x14e;const _0x132f41=a143_0x132f();let _0x5565fd=_0x132f41[_0x341bad];return _0x5565fd;}const cache=new Map();function parseApiFile(_0x195878){const _0x8c8e30=a143_0x5565,_0x5bf792=[],_0xef7a8b=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x250e4c;while((_0x250e4c=_0xef7a8b[_0x8c8e30(0x153)](_0x195878))!==null){_0x5bf792[_0x8c8e30(0x14f)]({'datasetCode':_0x250e4c[0x1],'tableName':_0x250e4c[0x2],'name':_0x250e4c[0x3],'alias':_0x250e4c[0x4]});}return _0x5bf792;}export function loadAliasMap(_0x2baf50,_0x56998f,_0x31cbf3){const _0x2c4be3=a143_0x5565,_0x3845c7=_0x31cbf3??resolve(process['cwd'](),_0x2baf50,_0x2c4be3(0x161));if(cache[_0x2c4be3(0x156)](_0x3845c7))return cache['get'](_0x3845c7);if(!existsSync(_0x3845c7))return cache[_0x2c4be3(0x15f)](_0x3845c7,[]),[];try{const _0x21709f=readFileSync(_0x3845c7,_0x2c4be3(0x152)),_0x367110=parseApiFile(_0x21709f);return cache[_0x2c4be3(0x15f)](_0x3845c7,_0x367110),_0x367110;}catch{return cache[_0x2c4be3(0x15f)](_0x3845c7,[]),[];}}function a143_0x132f(){const _0xea7657=['has','38368JeXYIN','datasetCode','alias','find','328338rrzJbJ','6QGggbb','11244673ligrpI','4885310YpwnFb','set','414huSYGx','api.ts','3526145BuuJxn','push','18370dvSKWl','22aQzCUA','utf-8','exec','1400784ZCLKoI','5ETEUpR'];a143_0x132f=function(){return _0xea7657;};return a143_0x132f();}export function resolveAlias(_0x4c1937,_0x2d552c,_0x5369cf,_0x28764){const _0x15661c=a143_0x5565;if(!_0x2d552c)return undefined;const _0x22e08b=loadAliasMap(_0x4c1937,_0x5369cf,_0x28764),_0x4d71f0=_0x22e08b[_0x15661c(0x15a)](_0x57a986=>_0x57a986[_0x15661c(0x159)]===_0x2d552c);return _0x4d71f0?.[_0x15661c(0x158)];}export function listAliases(_0x2763f5,_0x352f1c,_0x5189c3){return loadAliasMap(_0x2763f5,_0x352f1c,_0x5189c3);}
@@ -1 +1 @@
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
+ function a144_0x3990(){const _0x538438=['message','/smartapi/custom/saveUserCustomSql','operationId','/smartapi/custom/updateUserCustomSql','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','pageIndex','/smartapi/dataset/get-driven-data?','\x20\x20currentPage:\x201,','create','update','entries','const\x20results\x20=\x20data.execResult\x20||\x20[];','/api/management/library/scripts/delete','Unauthorized','\x20\x20\x20\x20sqlCode:\x20\x27','2285778QfMVEC','35tWYNbI','toLowerCase','tableName','/smartapi/dblink/update','replace','stringify','errorMessage','/smartapi/question/er-config','\x20\x20where:\x20{},','api_error','/api/node-toolbox/sql/save','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','delete','validation','test','object','\x20of\x20','/smartapi/dblink/getAllTableList','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','const\x20result\x20=\x20await\x20client.models.','description','/smartapi/dblink/getList','5517061Ityjvq','requestFields','.create({\x20/*\x20fields\x20*/\x20});','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','tableList','version','modelCode','\x20\x20return\x20rows;','label','\x20\x20});','/api/management/library/scripts/list?appCode=','cli:rabetbase','status','map','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','SQL\x20query\x20not\x20found:\x20','/filter','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','81wwdtIi','apiError','sqlCode','API\x20error:\x20','\x20apps.\x20','/smartapi/dataset/update-driven-data','push','});','BFF\x20save\x20returned\x20no\x20valid\x20id','POST','tableData','\x22\x20not\x20found\x20in\x20dataset\x20','sqlName','API\x20error\x20code:\x20','method','enabled','GET','/standard-page-status?appCode=','currentPage','/smartapi/lovrabet/dataset/','/smartapi/lovrabet/detail?pageId=','string','responseFields','operationName','AbortError','data','.filter({','join','5625230DHJYnq','errorMsg','warn','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/management/library/scripts/info?id=','/smartapi/dblink/create','304628DJtkSp','/smartapi/dataset/get-dataset-operation','find','Check\x20network\x20connectivity\x20and\x20try\x20again.','.remove(id);','const\x20data\x20=\x20await\x20client.sql.execute({','totalCount','/smartapi/app/getList','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/generate-standard-pages/status?','json','body','clientOperationId','displayName','&type=','890394faMhmC','code','/smartapi/dblink/testConnect','//\x20','\x20failed','name','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','2faJLtF','/smartapi/dblink/delete','target','modelId','includes','/api/management/script/cache/clear','operations','/smartapi/lovrabet/update-page','/smartapi/dataset/get-dataset-list','toString','scriptName','functionName','/smartapi/question/er-config/erDelete','sdk','planId','table','/smartapi/dblink/getOne','/smartapi/question/er-config/erCreate','application/json','165135Dntkhl','isArray','set','scriptType','Warning:\x20showing\x20first\x20','getOne','/smartapi/db-analysis/start','60ahnRvp','dbId','171056XxuWNl','abort','/api/','/sync-to-pages','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','cookie','/smartapi/custom/queryUserCustomSqlList','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','401','pageSize','(/*\x20params\x20*/);','filter','Dataset\x20not\x20found:\x20','\x20\x20pageSize:\x2020,','signal','success','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','errorCode','SQL\x20query\x20not\x20found:\x20id=','Page\x20not\x20found:\x20','.getOne(id);'];a144_0x3990=function(){return _0x538438;};return a144_0x3990();}(function(_0x5c2384,_0x2d759d){const _0x5e7e7a=a144_0x111d,_0x4dd8b0=_0x5c2384();while(!![]){try{const _0x409346=-parseInt(_0x5e7e7a(0x17c))/0x1*(parseInt(_0x5e7e7a(0x169))/0x2)+-parseInt(_0x5e7e7a(0x1a9))/0x3+parseInt(_0x5e7e7a(0x153))/0x4*(parseInt(_0x5e7e7a(0x183))/0x5)+-parseInt(_0x5e7e7a(0x162))/0x6*(-parseInt(_0x5e7e7a(0x1aa))/0x7)+-parseInt(_0x5e7e7a(0x185))/0x8*(parseInt(_0x5e7e7a(0x1d2))/0x9)+-parseInt(_0x5e7e7a(0x14d))/0xa+parseInt(_0x5e7e7a(0x1c0))/0xb;if(_0x409346===_0x2d759d)break;else _0x4dd8b0['push'](_0x4dd8b0['shift']());}catch(_0x4ed8ab){_0x4dd8b0['push'](_0x4dd8b0['shift']());}}}(a144_0x3990,0x74110));import{getCookie}from'../auth/get-cookie.js';function a144_0x111d(_0x11f02e,_0x585de0){_0x11f02e=_0x11f02e-0x136;const _0x399000=a144_0x3990();let _0x111d92=_0x399000[_0x11f02e];return _0x111d92;}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(_0x510c17){_activeCookie=_0x510c17||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x74b6f,_0x95f024){const _0x20776a=a144_0x111d,_0x383dd1=_0x95f024 instanceof Error?_0x95f024[_0x20776a(0x19a)]:String(_0x95f024);return CliErrors['apiError']('Request\x20failed:\x20'+_0x74b6f+(_0x383dd1?'\x20('+_0x383dd1+')':''),_0x20776a(0x156));}async function apiRequest(_0x2e6bea,_0x20d4ee={}){const _0x15915b=a144_0x111d,{method:method=_0x15915b(0x141),body:_0xc0f4de,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x20d4ee,_0x41237f=useRuntime?getRuntimeDomain():getApiDomain(),_0x45e87d=_activeCookie||getCookie(),_0x2f021d=''+_0x41237f+_0x2e6bea,_0x14c7bb=new AbortController(),_0x151d12=setTimeout(()=>_0x14c7bb[_0x15915b(0x186)](),timeout);try{const _0xc70ea6=await fetch(_0x2f021d,{'method':method,'headers':{'Content-Type':_0x15915b(0x17b),'Cookie':_0x45e87d,'X-Invoke-Source':_0x15915b(0x1cb),...headers},'body':_0xc0f4de?JSON[_0x15915b(0x1af)](_0xc0f4de):undefined,'signal':_0x14c7bb[_0x15915b(0x193)]});let _0x27a5c8;try{_0x27a5c8=await _0xc70ea6[_0x15915b(0x15d)]();}catch{throw CliErrors[_0x15915b(0x1d3)](_0x15915b(0x1bc)+_0xc70ea6[_0x15915b(0x1cc)]+')',_0xc70ea6['status']>=0x190?_0x15915b(0x19e):undefined);}if(!_0xc70ea6['ok']||_0x27a5c8[_0x15915b(0x194)]===![])throw CliErrors[_0x15915b(0x1d3)](_0x27a5c8[_0x15915b(0x14e)]||_0x27a5c8[_0x15915b(0x19a)]||_0x15915b(0x1d5)+_0xc70ea6['status'],_0x27a5c8[_0x15915b(0x196)]?_0x15915b(0x13e)+_0x27a5c8[_0x15915b(0x196)]:undefined);return _0x27a5c8;}catch(_0x35da0e){if(_0x35da0e instanceof CliError)throw _0x35da0e;if(_0x35da0e instanceof Error&&_0x35da0e[_0x15915b(0x167)]===_0x15915b(0x149))throw CliErrors[_0x15915b(0x1d3)]('Request\x20timeout:\x20'+_0x2f021d);throw createFetchFailureError(_0x2f021d,_0x35da0e);}finally{clearTimeout(_0x151d12);}}function isAuthFailure(_0x203e04){const _0x196de0=a144_0x111d,_0x574d95=_0x203e04[_0x196de0(0x14e)]||_0x203e04[_0x196de0(0x19a)]||_0x203e04[_0x196de0(0x14a)]?.[_0x196de0(0x19a)]||_0x203e04[_0x196de0(0x1b0)]||_0x203e04['error']||'';return _0x203e04[_0x196de0(0x196)]==='UNAUTHORIZED'||_0x203e04['code']===0x191||_0x203e04['code']===_0x196de0(0x18d)||_0x574d95[_0x196de0(0x16d)](_0x196de0(0x18d))||_0x574d95[_0x196de0(0x16d)](_0x196de0(0x1a7))||_0x574d95[_0x196de0(0x16d)]('登录')||_0x574d95['includes']('认证');}export async function platformFetch(_0x109525,_0x2c61c6){const _0x3ea098=a144_0x111d;let _0x46b144;try{_0x46b144=await fetch(_0x109525,{'method':_0x2c61c6[_0x3ea098(0x13f)]??_0x3ea098(0x141),'headers':{'Content-Type':_0x3ea098(0x17b),'Cookie':_0x2c61c6[_0x3ea098(0x18a)],'X-Invoke-Source':_0x3ea098(0x1cb)},..._0x2c61c6['body']&&{'body':JSON['stringify'](_0x2c61c6[_0x3ea098(0x15e)])}});}catch(_0x11190e){throw createFetchFailureError(_0x109525,_0x11190e);}if(!_0x46b144['ok']){if(_0x46b144[_0x3ea098(0x1cc)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x3ea098(0x1d3)](_0x2c61c6[_0x3ea098(0x1c8)]+'\x20failed,\x20HTTP\x20'+_0x46b144[_0x3ea098(0x1cc)]);}const _0x4f1565=await _0x46b144[_0x3ea098(0x15d)]();if(_0x4f1565[_0x3ea098(0x194)]===![]){if(isAuthFailure(_0x4f1565))throw CliErrors['authRequired']();throw CliErrors[_0x3ea098(0x1d3)](_0x4f1565[_0x3ea098(0x14e)]||_0x4f1565[_0x3ea098(0x19a)]||_0x2c61c6['label']+_0x3ea098(0x166));}return _0x4f1565[_0x3ea098(0x14a)];}export async function listBffScripts(_0x3db7b8,_0x260a59,_0x5ddebb){const _0x569d8b=a144_0x111d;let _0x43c0bf=_0x569d8b(0x1ca)+_0x3db7b8;if(_0x260a59)_0x43c0bf+=_0x569d8b(0x161)+_0x260a59;const _0x39d252=await apiRequest(_0x43c0bf);let _0x20b2ed=extractList(_0x39d252[_0x569d8b(0x14a)]);if(_0x5ddebb?.[_0x569d8b(0x173)]){const _0x57ec6f=_0x5ddebb[_0x569d8b(0x173)]['toLowerCase']();_0x20b2ed=_0x20b2ed[_0x569d8b(0x190)](_0x47dbb9=>_0x47dbb9['functionName']?.[_0x569d8b(0x1ab)]()['includes'](_0x57ec6f)||_0x47dbb9['description']?.[_0x569d8b(0x1ab)]()[_0x569d8b(0x16d)](_0x57ec6f));}return _0x20b2ed;}export async function getBffScriptInfo(_0x223db9){const _0x18b98a=a144_0x111d,_0x397eeb=await apiRequest(_0x18b98a(0x151)+_0x223db9);if(!_0x397eeb[_0x18b98a(0x14a)])throw CliErrors[_0x18b98a(0x1b7)]('BFF\x20script\x20not\x20found:\x20id='+_0x223db9);return _0x397eeb[_0x18b98a(0x14a)];}export async function saveBffScript(_0x4e43c4){const _0x320819=a144_0x111d,_0x5e86fe=await apiRequest('/api/management/library/scripts/save',{'method':_0x320819(0x13a),'body':_0x4e43c4}),{id:_0x1c64c5,entity:_0x3305d0}=normalizeEntityWithIdResponse(_0x5e86fe[_0x320819(0x14a)]);if(_0x1c64c5!==undefined){const _0x2869e8=typeof _0x3305d0[_0x320819(0x174)]===_0x320819(0x146)||typeof _0x3305d0[_0x320819(0x17f)]===_0x320819(0x146)?_0x3305d0:undefined;return{'id':_0x1c64c5,'script':_0x2869e8};}throw CliErrors['apiError'](_0x320819(0x139));}export async function deleteBffScript(_0x611003){const _0x407740=a144_0x111d;await apiRequest(_0x407740(0x1a6),{'method':_0x407740(0x13a),'body':{'id':_0x611003}});}export async function getBffScriptStatistics(_0x4af9ee){const _0x1ea520=a144_0x111d,_0x4ad390=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x4af9ee);return extractList(_0x4ad390[_0x1ea520(0x14a)]);}export async function clearBffScriptCache(){const _0x929fc4=a144_0x111d,_0x4651e8=await apiRequest(_0x929fc4(0x16e),{'method':'POST','useRuntime':!![]});return typeof _0x4651e8['data']===_0x929fc4(0x146)?_0x4651e8[_0x929fc4(0x14a)]:'';}export async function listBffDatasetOperations(_0x4a5b74,_0x2cfa9){const _0x9dc968=a144_0x111d,_0x5802f0=await apiRequest(_0x9dc968(0x154),{'method':_0x9dc968(0x13a),'body':{'appCode':_0x4a5b74,'datasetId':_0x2cfa9}});return _0x5802f0['data'];}export async function listSqlQueries(_0x251583,_0x476d62){const _0x32e404=a144_0x111d,_0x4dd3fc=await apiRequest(_0x32e404(0x18b),{'method':_0x32e404(0x13a),'body':{'appCode':_0x251583,'currentPage':_0x476d62?.[_0x32e404(0x143)]??0x1,'pageSize':_0x476d62?.[_0x32e404(0x18e)]??0x32,'sqlCode':_0x476d62?.[_0x32e404(0x1d4)],'sqlName':_0x476d62?.[_0x32e404(0x13d)]}});return _0x4dd3fc[_0x32e404(0x14a)];}export async function getSqlQueryInfo(_0xf3afc4,_0x3b196d){const _0x2ab4b9=a144_0x111d,_0x131a36=await listSqlQueries(_0xf3afc4,{'sqlCode':_0x3b196d}),_0x38a548=_0x131a36[_0x2ab4b9(0x13b)]?.[0x0];if(!_0x38a548)throw CliErrors[_0x2ab4b9(0x1b7)](_0x2ab4b9(0x1cf)+_0x3b196d);return _0x38a548;}export async function getSqlQueryDetail(_0x181d04){const _0x1b2a89=a144_0x111d,_0x392bb2=await apiRequest('/smartapi/custom/getUserCustomSql'+('?sqlCode='+encodeURIComponent(_0x181d04)));if(!_0x392bb2[_0x1b2a89(0x14a)])throw CliErrors[_0x1b2a89(0x1b7)](_0x1b2a89(0x1cf)+_0x181d04);return _0x392bb2[_0x1b2a89(0x14a)];}export async function getSqlQueryDetailById(_0x425d2a){const _0x4d6507=a144_0x111d,_0x3ac3a3=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x425d2a);if(!_0x3ac3a3['data'])throw CliErrors[_0x4d6507(0x1b7)](_0x4d6507(0x197)+_0x425d2a);return _0x3ac3a3[_0x4d6507(0x14a)];}export async function createSqlQuery(_0x1ea70a){const _0x4a4b38=a144_0x111d,_0x10dbb4=await apiRequest(_0x4a4b38(0x19b),{'method':_0x4a4b38(0x13a),'body':_0x1ea70a}),{id:_0x230760,entity:_0x3b4ad7}=normalizeEntityWithIdResponse(_0x10dbb4[_0x4a4b38(0x14a)]);if(!('sqlCode'in _0x3b4ad7)&&_0x230760)return getSqlQueryDetailById(_0x230760);return normalizeSqlQueryEntity(_0x3b4ad7);}export async function updateSqlQuery(_0x1c861d){const _0x7aa6d5=a144_0x111d,_0x5b02e9=await apiRequest(_0x7aa6d5(0x19d),{'method':'POST','body':_0x1c861d}),{id:_0x1dc77c,entity:_0x4b8872}=normalizeEntityWithIdResponse(_0x5b02e9[_0x7aa6d5(0x14a)]);if(!('sqlCode'in _0x4b8872)){if(_0x1c861d['sqlCode'])return getSqlQueryDetail(_0x1c861d[_0x7aa6d5(0x1d4)]);if(_0x1dc77c)return getSqlQueryDetailById(_0x1dc77c);}return normalizeSqlQueryEntity(_0x4b8872);}export async function deleteSqlQuery(_0x4579e9){const _0x7c7bdf=a144_0x111d;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x7c7bdf(0x13a),'body':_0x4579e9});}export async function saveSqlQuery(_0x15e52c){const _0xa52ebf=a144_0x111d,_0x44d3dc=await apiRequest(_0xa52ebf(0x1b4),{'method':_0xa52ebf(0x13a),'body':_0x15e52c});return _0x44d3dc[_0xa52ebf(0x14a)];}function normalizeSqlQueryEntity(_0x48a14e){const _0x432b5c=a144_0x111d;return{..._0x48a14e,'id':Number(_0x48a14e['id']),'dbId':_0x48a14e[_0x432b5c(0x184)]==null?undefined:Number(_0x48a14e['dbId']),'version':_0x48a14e[_0x432b5c(0x1c5)]==null?undefined:Number(_0x48a14e[_0x432b5c(0x1c5)])};}export async function executeSql(_0x45cf7c,_0x5f2ccd,_0x4db955){const _0x40ee77=a144_0x111d,_0x6e54b0=await apiRequest('/api/custom/executeSql',{'method':_0x40ee77(0x13a),'body':{'appCode':_0x45cf7c,'sqlCode':_0x5f2ccd,..._0x4db955&&{'params':_0x4db955}},'useRuntime':!![]});return _0x6e54b0[_0x40ee77(0x14a)];}export async function executeDatasetDataOperation(_0x159a34,_0x199a73,_0x2913d4,_0x2ab02d={}){const _0x43d48b=a144_0x111d;try{const _0x34171a=await apiRequest('/api/'+_0x159a34+'/'+_0x199a73+'/'+_0x2913d4,{'method':_0x43d48b(0x13a),'body':_0x2ab02d,'useRuntime':!![]});return _0x34171a[_0x43d48b(0x14a)];}catch(_0x2bf712){if(_0x2913d4===_0x43d48b(0x181)&&_0x2bf712 instanceof CliError&&_0x2bf712[_0x43d48b(0x163)]===_0x43d48b(0x1b3)&&_0x2ab02d['id']!==undefined&&_0x2ab02d['id']!==null&&_0x2ab02d['id']!==''){const _0x3953ef=await apiRequest(_0x43d48b(0x187)+_0x159a34+'/'+_0x199a73+_0x43d48b(0x1d0),{'method':'POST','body':{'where':{'id':{'$eq':_0x2ab02d['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2aaa05=Array['isArray'](_0x3953ef[_0x43d48b(0x14a)]?.['tableData'])?_0x3953ef[_0x43d48b(0x14a)][_0x43d48b(0x13b)]:[];return _0x2aaa05[0x0]??null;}throw _0x2bf712;}}export async function listDatasets(_0x283157,_0x32365c){const _0x4cba11=a144_0x111d,_0x309ebf={'appCode':_0x283157,'deleted':![]};if(_0x32365c?.['code'])_0x309ebf[_0x4cba11(0x163)]=_0x32365c[_0x4cba11(0x163)];if(_0x32365c?.[_0x4cba11(0x167)])_0x309ebf['name']=_0x32365c[_0x4cba11(0x167)];const _0x523229=await apiRequest(_0x4cba11(0x171),{'method':_0x4cba11(0x13a),'body':_0x309ebf});return extractList(_0x523229[_0x4cba11(0x14a)]);}export async function deleteDataset(_0x2884e1,_0x1e0aff){const _0x1addb6=a144_0x111d;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x1addb6(0x13a),'body':{'appCode':_0x2884e1,'datasetId':_0x1e0aff}});}export async function searchDatasets(_0x59fb88,_0x274de6){const _0x1dee93=a144_0x111d,_0x4247cc=await listDatasets(_0x59fb88,{'name':_0x274de6}),_0x1dac17=_0x274de6[_0x1dee93(0x1ab)](),_0x5ca5d0=new Set(_0x4247cc['map'](_0x15db38=>_0x15db38['id'])),_0x574a72=_0x4247cc[_0x1dee93(0x190)](_0x3e7557=>_0x3e7557['dbtableConfig']?.[_0x1dee93(0x1ac)]?.[_0x1dee93(0x1ab)]()[_0x1dee93(0x16d)](_0x1dac17)||_0x3e7557[_0x1dee93(0x1be)]?.[_0x1dee93(0x1ab)]()[_0x1dee93(0x16d)](_0x1dac17)),_0x448ab1=await listDatasets(_0x59fb88,{'code':_0x274de6});for(const _0x18ba25 of _0x448ab1){!_0x5ca5d0['has'](_0x18ba25['id'])&&(_0x4247cc[_0x1dee93(0x137)](_0x18ba25),_0x5ca5d0['add'](_0x18ba25['id']));}return _0x4247cc;}export function normalizeDatasetOperations(_0x3757ed){const _0x2c71aa=a144_0x111d;if(Array[_0x2c71aa(0x17d)](_0x3757ed))return _0x3757ed[_0x2c71aa(0x190)](_0x10e3f9=>_0x10e3f9!=null&&typeof _0x10e3f9===_0x2c71aa(0x1b9));if(_0x3757ed&&typeof _0x3757ed===_0x2c71aa(0x1b9))return Object[_0x2c71aa(0x1a4)](_0x3757ed)['filter'](([,_0xd157c6])=>_0xd157c6!=null&&typeof _0xd157c6===_0x2c71aa(0x1b9))[_0x2c71aa(0x1cd)](([_0x437e40,_0x1ac0b7])=>({..._0x1ac0b7,'name':_0x1ac0b7[_0x2c71aa(0x167)]??_0x1ac0b7[_0x2c71aa(0x148)]??_0x437e40}));return[];}export async function getDatasetDetail(_0x5cfc41){const _0x4e1156=a144_0x111d,_0x547407=/^\d+$/[_0x4e1156(0x1b8)](_0x5cfc41)?'id':_0x4e1156(0x163),_0x5160e1=await apiRequest(_0x4e1156(0x1a0)+_0x547407+'='+_0x5cfc41);return _0x5160e1[_0x4e1156(0x14a)];}export async function updateDrivenData(_0x22744b){const _0x180073=a144_0x111d,_0x44db7d=await apiRequest(_0x180073(0x136),{'method':'POST','body':_0x22744b});return _0x44db7d['data'];}export async function getDatasetOperations(_0x7f4945){const _0xd25dbe=a144_0x111d,_0x53d754=await getDatasetDetail(_0x7f4945),_0x438a71=normalizeDatasetOperations(_0x53d754[_0xd25dbe(0x16f)])[_0xd25dbe(0x1cd)](_0x19a066=>({'name':_0x19a066[_0xd25dbe(0x167)]||_0x19a066[_0xd25dbe(0x148)],'displayName':_0x19a066[_0xd25dbe(0x160)]||_0x19a066[_0xd25dbe(0x167)],'type':_0x19a066['type'],'method':_0x19a066[_0xd25dbe(0x13f)],'path':_0x19a066['path'],'enabled':_0x19a066[_0xd25dbe(0x140)]??!![],'requestFields':_0x19a066[_0xd25dbe(0x1c1)],'responseFields':_0x19a066[_0xd25dbe(0x147)]}));return{'dataset':{'id':_0x53d754['id']??_0x53d754[_0xd25dbe(0x16c)],'name':_0x53d754['name'],'code':_0x53d754['code']||_0x53d754[_0xd25dbe(0x1c6)],'tableName':_0x53d754['tableName']||_0x53d754['dbtableConfig']?.['tableName']},'operations':_0x438a71};}export async function getOperationDetail(_0x47a9c2,_0x340b8d,_0x2b2ecf){const _0x34cfc1=a144_0x111d;let _0x103421=_0x340b8d;if(!/^\d+$/[_0x34cfc1(0x1b8)](_0x340b8d)){const _0x2e4112=await listDatasets(_0x47a9c2,{'code':_0x340b8d}),_0x3c13f1=_0x2e4112[_0x34cfc1(0x155)](_0x34db75=>_0x34db75[_0x34cfc1(0x163)]===_0x340b8d||String(_0x34db75['id'])===_0x340b8d);if(!_0x3c13f1)throw CliErrors[_0x34cfc1(0x1b7)](_0x34cfc1(0x191)+_0x340b8d);_0x103421=String(_0x3c13f1['id']);}const _0x4f094f=await getDatasetDetail(_0x103421),_0xbc5cc4=normalizeDatasetOperations(_0x4f094f[_0x34cfc1(0x16f)])[_0x34cfc1(0x155)](_0x44bcc7=>(_0x44bcc7[_0x34cfc1(0x167)]||_0x44bcc7[_0x34cfc1(0x148)])===_0x2b2ecf);if(!_0xbc5cc4)throw CliErrors[_0x34cfc1(0x1b7)]('Operation\x20\x22'+_0x2b2ecf+_0x34cfc1(0x13c)+_0x340b8d);return{'dataset':{'id':_0x4f094f['id']??_0x4f094f[_0x34cfc1(0x16c)],'name':_0x4f094f[_0x34cfc1(0x167)],'code':_0x4f094f[_0x34cfc1(0x163)]||_0x4f094f[_0x34cfc1(0x1c6)],'tableName':_0x4f094f[_0x34cfc1(0x1ac)]||_0x4f094f['dbtableConfig']?.[_0x34cfc1(0x1ac)]},'operation':_0xbc5cc4};}export async function startGenerateStandardPages(_0xeccef0,_0x563998,_0xa4cb53){const _0x4a133d=a144_0x111d,_0x470fbd=await apiRequest(_0x4a133d(0x144)+_0x563998+'/generate-standard-pages/start',{'method':_0x4a133d(0x13a),'body':{'appCode':_0xeccef0,..._0xa4cb53?.[_0x4a133d(0x15f)]?{'clientOperationId':_0xa4cb53[_0x4a133d(0x15f)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x470fbd['data'];}export async function getGenerateStandardPagesStatus(_0x47831f,_0x3a6fce,_0x5841d1){const _0x45c6f9=a144_0x111d,_0x3a2433=new URLSearchParams({'appCode':_0x47831f});_0x5841d1[_0x45c6f9(0x19c)]&&_0x3a2433[_0x45c6f9(0x17e)](_0x45c6f9(0x19c),_0x5841d1['operationId']);_0x5841d1[_0x45c6f9(0x15f)]&&_0x3a2433[_0x45c6f9(0x17e)](_0x45c6f9(0x15f),_0x5841d1[_0x45c6f9(0x15f)]);const _0x2b23e6=await apiRequest(_0x45c6f9(0x144)+_0x3a6fce+_0x45c6f9(0x15c)+_0x3a2433[_0x45c6f9(0x172)]());return _0x2b23e6[_0x45c6f9(0x14a)];}export async function getStandardPageStatus(_0x2aee4c,_0x319f2c){const _0x66d821=a144_0x111d,_0xbfea5=await apiRequest(_0x66d821(0x144)+_0x319f2c+_0x66d821(0x142)+encodeURIComponent(_0x2aee4c));return _0xbfea5[_0x66d821(0x14a)];}export async function tryGetStandardPageStatus(_0x26acf2,_0x351eb4){const _0x3bf477=a144_0x111d;try{return await getStandardPageStatus(_0x26acf2,_0x351eb4);}catch(_0x5dab7d){if(_0x5dab7d instanceof CliError&&_0x5dab7d['code']==='api_error'&&/404|not found|non-json response/i[_0x3bf477(0x1b8)](_0x5dab7d[_0x3bf477(0x19a)]))return null;throw _0x5dab7d;}}export async function syncStandardPages(_0x56ca6b,_0x433cdb){const _0x40c4ae=a144_0x111d,_0x1daedd=await apiRequest(_0x40c4ae(0x144)+_0x433cdb+_0x40c4ae(0x188),{'method':_0x40c4ae(0x13a),'body':{'appCode':_0x56ca6b}});return _0x1daedd[_0x40c4ae(0x14a)];}export async function getPageDetail(_0x2b68fa){const _0x280dda=a144_0x111d,_0x368546=await apiRequest(_0x280dda(0x145)+_0x2b68fa);if(!_0x368546['data'])throw CliErrors[_0x280dda(0x1b7)](_0x280dda(0x198)+_0x2b68fa);return _0x368546[_0x280dda(0x14a)];}export async function updatePage(_0x1635b1,_0x459215,_0x2ac5b9,_0x1c369e){const _0x41676e=a144_0x111d,_0x2f82ec=await apiRequest(_0x41676e(0x170),{'method':_0x41676e(0x13a),'body':{'appCode':_0x1635b1,'pageId':_0x459215,'code':_0x2ac5b9,'datasetIds':_0x1c369e}});return _0x2f82ec[_0x41676e(0x14a)];}export function generateSdkCode(_0x548d2e,_0x44cf6f,_0x2b2f70){const _0x2e507d=a144_0x111d,_0xd58f4b=_0x2b2f70?.['includeImports']??!![],_0x2acf33='dataset_'+_0x548d2e[_0x2e507d(0x163)]?.[_0x2e507d(0x1ae)](/-/g,'_'),_0xa248dd=_0x44cf6f[_0x2e507d(0x167)]||_0x44cf6f[_0x2e507d(0x148)]||_0x2e507d(0x190),_0x57bd7f=[];_0xd58f4b&&_0x57bd7f[_0x2e507d(0x137)](_0x2e507d(0x1b5),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x57bd7f[_0x2e507d(0x137)](_0x2e507d(0x165)+_0x548d2e[_0x2e507d(0x167)]+'\x20('+(_0x548d2e[_0x2e507d(0x1ac)]||_0x2e507d(0x178))+')');if(_0xa248dd===_0x2e507d(0x190))_0x57bd7f[_0x2e507d(0x137)]('const\x20result\x20=\x20await\x20client.models.'+_0x2acf33+_0x2e507d(0x14b),_0x2e507d(0x1b2),_0x2e507d(0x192),_0x2e507d(0x1a1),_0x2e507d(0x138));else{if(_0xa248dd===_0x2e507d(0x181))_0x57bd7f[_0x2e507d(0x137)](_0x2e507d(0x1bd)+_0x2acf33+_0x2e507d(0x199));else{if(_0xa248dd===_0x2e507d(0x1a2))_0x57bd7f[_0x2e507d(0x137)]('const\x20result\x20=\x20await\x20client.models.'+_0x2acf33+_0x2e507d(0x1c2));else{if(_0xa248dd===_0x2e507d(0x1a3))_0x57bd7f['push'](_0x2e507d(0x1bd)+_0x2acf33+_0x2e507d(0x18c));else _0xa248dd===_0x2e507d(0x1b6)||_0xa248dd==='remove'?_0x57bd7f['push'](_0x2e507d(0x1bd)+_0x2acf33+_0x2e507d(0x157)):_0x57bd7f[_0x2e507d(0x137)](_0x2e507d(0x1bd)+_0x2acf33+'.'+_0xa248dd+_0x2e507d(0x18f));}}}return _0x57bd7f[_0x2e507d(0x14c)]('\x0a');}export function generateSqlCodeTemplate(_0x415516,_0x2a42ac){const _0x480a40=a144_0x111d,_0x28e86d=_0x2a42ac?.[_0x480a40(0x16b)]??_0x480a40(0x176),_0x15a112=_0x2a42ac?.['includeImports']??!![],_0x1f3a07=[];return _0x1f3a07['push']('//\x20SQL:\x20'+_0x415516[_0x480a40(0x13d)]+'\x20('+_0x415516['sqlCode']+')'),_0x28e86d===_0x480a40(0x176)?(_0x15a112&&_0x1f3a07[_0x480a40(0x137)](_0x480a40(0x1b5),'',_0x480a40(0x168),''),_0x1f3a07['push'](_0x480a40(0x158),'\x20\x20sqlCode:\x20\x27'+_0x415516[_0x480a40(0x1d4)]+'\x27,',_0x480a40(0x150),_0x480a40(0x138),_0x480a40(0x1ce),_0x480a40(0x1a5))):_0x1f3a07[_0x480a40(0x137)](_0x480a40(0x15b),_0x480a40(0x189),_0x480a40(0x1d1),_0x480a40(0x1a8)+_0x415516[_0x480a40(0x1d4)]+'\x27,',_0x480a40(0x1c3),_0x480a40(0x1c9),_0x480a40(0x1c7),'}'),_0x1f3a07[_0x480a40(0x14c)]('\x0a');}export async function getErConfig(_0x2fcdfb,_0x4bbc64){const _0x4709d5=a144_0x111d,_0x42393b=await apiRequest(_0x4709d5(0x1b1),{'method':_0x4709d5(0x13a),'body':{'appCode':_0x2fcdfb,'dblinkId':_0x4bbc64}});return _0x42393b['data'];}export async function createErRelation(_0x4590c3){const _0x26b500=a144_0x111d,_0xa5ef7c=await apiRequest(_0x26b500(0x17a),{'method':_0x26b500(0x13a),'body':_0x4590c3});return _0xa5ef7c[_0x26b500(0x14a)];}export async function updateErRelation(_0x5d5ace){const _0x1760dc=a144_0x111d,_0x1d30da=await apiRequest('/smartapi/question/er-config/update-single',{'method':_0x1760dc(0x13a),'body':_0x5d5ace});return _0x1d30da[_0x1760dc(0x14a)];}export async function deleteErRelation(_0x381319){const _0x209f6f=a144_0x111d,_0xa75051=await apiRequest(_0x209f6f(0x175),{'method':_0x209f6f(0x13a),'body':_0x381319});return _0xa75051[_0x209f6f(0x14a)];}function buildQuery(_0x2e67ff){const _0xa14ca8=a144_0x111d,_0x29f543=new URLSearchParams();for(const [_0x56694c,_0x425084]of Object[_0xa14ca8(0x1a4)](_0x2e67ff)){if(_0x425084===undefined||_0x425084==='')continue;_0x29f543[_0xa14ca8(0x17e)](_0x56694c,String(_0x425084));}const _0x38c78d=_0x29f543[_0xa14ca8(0x172)]();return _0x38c78d?'?'+_0x38c78d:'';}export async function listDbLinks(_0x313073,_0x545d2b){const _0x23533d=a144_0x111d,_0x3ba383=await apiRequest(_0x23533d(0x1bf),{'method':_0x23533d(0x13a),'body':{'appCode':_0x313073,'currentPage':_0x545d2b?.['currentPage']??0x1,'pageSize':_0x545d2b?.[_0x23533d(0x18e)]??0x64}});return{'items':extractList(_0x3ba383[_0x23533d(0x14a)]),'paging':extractPaging(_0x3ba383['data'])};}export async function getDbLinkInfo(_0x4ed8f8){const _0x450900=a144_0x111d,_0x39212f=await apiRequest(_0x450900(0x179)+buildQuery({'id':_0x4ed8f8}));return _0x39212f[_0x450900(0x14a)];}export async function createDbLink(_0x2b5738){const _0x161ba9=a144_0x111d,_0x30018b=await apiRequest(_0x161ba9(0x152),{'method':_0x161ba9(0x13a),'body':_0x2b5738});return _0x30018b[_0x161ba9(0x14a)];}export async function updateDbLink(_0x3483e5){const _0x3f4f60=a144_0x111d,_0x4603d7=await apiRequest(_0x3f4f60(0x1ad),{'method':_0x3f4f60(0x13a),'body':_0x3483e5});return _0x4603d7[_0x3f4f60(0x14a)];}export async function deleteDbLink(_0x457a45){const _0x53fa63=a144_0x111d;await apiRequest(_0x53fa63(0x16a),{'method':_0x53fa63(0x13a),'body':{'id':_0x457a45}});}export async function testDbLinkConnect(_0x5a02bd){const _0x4ef741=a144_0x111d,_0x3b5ddf=await apiRequest(_0x4ef741(0x164)+buildQuery({'id':_0x5a02bd}));return _0x3b5ddf[_0x4ef741(0x14a)];}export async function startDbAnalysis(_0x23b6aa,_0x48e09f){const _0x4645f2=a144_0x111d,_0x1dc4af=await apiRequest(_0x4645f2(0x182),{'method':_0x4645f2(0x13a),'body':{'dbLinkId':_0x23b6aa,..._0x48e09f&&_0x48e09f['length']>0x0?{'tableNames':_0x48e09f}:{}}}),_0x2557e6=_0x1dc4af[_0x4645f2(0x14a)];if(typeof _0x2557e6==='string')return _0x2557e6;if(_0x2557e6&&typeof _0x2557e6===_0x4645f2(0x1b9)&&typeof _0x2557e6[_0x4645f2(0x177)]==='string')return _0x2557e6['planId'];return _0x2557e6!=null?String(_0x2557e6):'';}export async function cancelDbAnalysis(_0x11ab0c){await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x11ab0c}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x2714d2){const _0x4371c4=a144_0x111d,_0x5eca6f=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x2714d2));return _0x5eca6f[_0x4371c4(0x14a)];}export async function getDbAllTableList(_0x4938fb,_0x520c21){const _0x13d57e=a144_0x111d,_0x1c12b2=await apiRequest(_0x13d57e(0x1bb)+buildQuery({'appCode':_0x4938fb,'dbLinkId':_0x520c21})),_0x17b28c=_0x1c12b2[_0x13d57e(0x14a)];if(Array[_0x13d57e(0x17d)](_0x17b28c))return _0x17b28c;return extractList(_0x17b28c);}export async function getDbTableDiff(_0x391256,_0x1ab324,_0x358047){const _0x53ea34=a144_0x111d,_0x20747e=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x391256,'dbLinkId':_0x1ab324,'pageIndex':_0x358047?.[_0x53ea34(0x19f)]??0x1,'pageSize':_0x358047?.[_0x53ea34(0x18e)]??0x14,'tableName':_0x358047?.[_0x53ea34(0x1ac)]})),_0x22bea1=_0x20747e['data'];return{'totalCount':_0x22bea1?.[_0x53ea34(0x159)]??0x0,'tableList':Array['isArray'](_0x22bea1?.[_0x53ea34(0x1c4)])?_0x22bea1[_0x53ea34(0x1c4)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0xb276f6=a144_0x111d,_0x72c4f=await apiRequest(_0xb276f6(0x15a),{'method':_0xb276f6(0x13a),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3460f0=extractList(_0x72c4f[_0xb276f6(0x14a)]),_0xd14521=extractPaging(_0x72c4f[_0xb276f6(0x14a)]);return _0xd14521&&_0xd14521[_0xb276f6(0x159)]>REMOTE_APP_PAGE_SIZE&&console[_0xb276f6(0x14f)](_0xb276f6(0x180)+REMOTE_APP_PAGE_SIZE+_0xb276f6(0x1ba)+_0xd14521[_0xb276f6(0x159)]+_0xb276f6(0x1d6)+_0xb276f6(0x195)),_0x3460f0;}
@@ -1 +1 @@
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
+ const a145_0x4acd9d=a145_0x2f75;function a145_0x299c(){const _0x3bc377=['10359318vBsQuY','2261670ePoHUz','751176GokOea','15bcAscD','bff','1403236XvCoDQ','91AYFMBl','bff.lock.json','9522981ZwYxMf','50533620ksSASX','833448nqumpe','55pKwbtp','1ePFfzy','5VLAHzE'];a145_0x299c=function(){return _0x3bc377;};return a145_0x299c();}function a145_0x2f75(_0x1bc49,_0x5e4148){_0x1bc49=_0x1bc49-0x17a;const _0x299c94=a145_0x299c();let _0x2f7557=_0x299c94[_0x1bc49];return _0x2f7557;}(function(_0x4abc1c,_0x251716){const _0x2f7c07=a145_0x2f75,_0x3431ef=_0x4abc1c();while(!![]){try{const _0x1fafd8=-parseInt(_0x2f7c07(0x17e))/0x1*(-parseInt(_0x2f7c07(0x17c))/0x2)+parseInt(_0x2f7c07(0x183))/0x3*(parseInt(_0x2f7c07(0x185))/0x4)+parseInt(_0x2f7c07(0x17f))/0x5*(parseInt(_0x2f7c07(0x180))/0x6)+parseInt(_0x2f7c07(0x186))/0x7*(parseInt(_0x2f7c07(0x182))/0x8)+-parseInt(_0x2f7c07(0x17a))/0x9+parseInt(_0x2f7c07(0x181))/0xa*(parseInt(_0x2f7c07(0x17d))/0xb)+-parseInt(_0x2f7c07(0x17b))/0xc;if(_0x1fafd8===_0x251716)break;else _0x3431ef['push'](_0x3431ef['shift']());}catch(_0x443f9e){_0x3431ef['push'](_0x3431ef['shift']());}}}(a145_0x299c,0xef276));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a145_0x4acd9d(0x187),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x130bf3,_0x2eea20){const _0x457232=a145_0x4acd9d,_0x4993b7=resolve(_0x2eea20??findProjectRootDirectory()),_0x3dc34b=DOT_DIR+'/bff',_0x5e9148=_0x3dc34b+'/'+_0x130bf3;return{'projectRoot':_0x4993b7,'appCode':_0x130bf3,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3dc34b,'scriptsRoot':_0x5e9148,'scriptsRootDir':resolve(_0x4993b7,DOT_DIR,_0x457232(0x184),_0x130bf3),'lockFilePath':resolve(_0x4993b7,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4993b7,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
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
+ const a146_0x3c72e5=a146_0x274a;(function(_0x77ef6f,_0x31ea8a){const _0x5cc9b6=a146_0x274a,_0x37284f=_0x77ef6f();while(!![]){try{const _0x4bc709=-parseInt(_0x5cc9b6(0x9b))/0x1+-parseInt(_0x5cc9b6(0x79))/0x2*(parseInt(_0x5cc9b6(0x8b))/0x3)+parseInt(_0x5cc9b6(0x8f))/0x4*(parseInt(_0x5cc9b6(0x9c))/0x5)+-parseInt(_0x5cc9b6(0x8c))/0x6+parseInt(_0x5cc9b6(0x7d))/0x7*(-parseInt(_0x5cc9b6(0x9e))/0x8)+-parseInt(_0x5cc9b6(0x7b))/0x9+-parseInt(_0x5cc9b6(0x85))/0xa*(-parseInt(_0x5cc9b6(0x9d))/0xb);if(_0x4bc709===_0x31ea8a)break;else _0x37284f['push'](_0x37284f['shift']());}catch(_0x1cb5e6){_0x37284f['push'](_0x37284f['shift']());}}}(a146_0x47e2,0xa8bde));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a146_0x274a(_0x486d8a,_0xdbca0e){_0x486d8a=_0x486d8a-0x76;const _0x47e23d=a146_0x47e2();let _0x274a3e=_0x47e23d[_0x486d8a];return _0x274a3e;}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a146_0x3c72e5(0x81),'ENDPOINT',a146_0x3c72e5(0x96)];export function normalizeBffType(_0x3179f6){const _0xe53999=a146_0x3c72e5;if(!_0x3179f6)return undefined;const _0xa2d32e=_0x3179f6[_0xe53999(0x7e)]()[_0xe53999(0x92)]();return SUPPORTED_BFF_TYPES[_0xe53999(0x9f)](_0xa2d32e)?_0xa2d32e:undefined;}async function scanJsFilesRecursively(_0x28c9a6,_0x55426e){const _0x57107b=a146_0x3c72e5,_0x3b6454=[];try{const _0x18426b=await readdir(_0x28c9a6,{'withFileTypes':!![]});for(const _0x31e3cc of _0x18426b){const _0x368233=join(_0x28c9a6,_0x31e3cc[_0x57107b(0x98)]);if(_0x31e3cc[_0x57107b(0x84)]())_0x3b6454[_0x57107b(0x94)](...await scanJsFilesRecursively(_0x368233,_0x55426e+'/'+_0x31e3cc[_0x57107b(0x98)]));else _0x31e3cc[_0x57107b(0x83)]()&&_0x31e3cc[_0x57107b(0x98)][_0x57107b(0x78)](_0x57107b(0x7a))&&_0x3b6454[_0x57107b(0x94)]({'lockKey':_0x55426e+'/'+_0x31e3cc['name']['replace'](/\.js$/,''),'filePath':_0x368233});}}catch(_0x296b34){if(_0x296b34[_0x57107b(0x8a)]!=='ENOENT')throw _0x296b34;}return _0x3b6454;}async function scanFlatFunctions(_0x103663,_0x4595cf){const _0x1aee09=a146_0x3c72e5,_0x2bd001=join(_0x103663['scriptsRootDir'],_0x4595cf),_0x3cc435=await scanJsFilesRecursively(_0x2bd001,_0x4595cf);return _0x3cc435[_0x1aee09(0x99)](({lockKey:_0x18ffd,filePath:_0x247f24})=>({'type':_0x4595cf,'name':_0x18ffd[_0x1aee09(0x97)]('/')['at'](-0x1)??'','filePath':_0x247f24,'lockKey':_0x18ffd}));}async function scanHookFunctions(_0x1c1d50){const _0xbb1696=a146_0x3c72e5,_0x540bab=join(_0x1c1d50[_0xbb1696(0x77)],_0xbb1696(0x96)),_0x3ff929=[];try{const _0x422bf0=await readdir(_0x540bab,{'withFileTypes':!![]});for(const _0x355cbd of _0x422bf0){if(!_0x355cbd[_0xbb1696(0x84)]())continue;const _0x4d222d=_0x355cbd[_0xbb1696(0x98)],_0x56b553=join(_0x540bab,_0x4d222d),_0x19e15d=await readdir(_0x56b553,{'withFileTypes':!![]});for(const _0x248881 of _0x19e15d){if(!_0x248881[_0xbb1696(0x84)]())continue;const _0x55bbe3=_0x248881[_0xbb1696(0x98)],_0x55fe5f=join(_0x56b553,_0x55bbe3),_0x404d52=await readdir(_0x55fe5f,{'withFileTypes':!![]});for(const _0x2665c5 of _0x404d52){if(!_0x2665c5['isDirectory']())continue;const _0x229f8b=_0x2665c5[_0xbb1696(0x98)],_0x5da198=join(_0x55fe5f,_0x229f8b),_0x25696c=await readdir(_0x5da198,{'withFileTypes':!![]});for(const _0x10ca1b of _0x25696c){if(!_0x10ca1b[_0xbb1696(0x83)]()||!_0x10ca1b[_0xbb1696(0x98)][_0xbb1696(0x78)]('.js'))continue;const _0x525ddb=_0x10ca1b[_0xbb1696(0x98)][_0xbb1696(0x89)](/\.js$/,'');_0x3ff929['push']({'type':_0xbb1696(0x96),'name':_0x525ddb,'filePath':join(_0x5da198,_0x10ca1b[_0xbb1696(0x98)]),'lockKey':_0xbb1696(0x82)+_0x4d222d+'/'+_0x55bbe3+'/'+_0x229f8b+'/'+_0x525ddb,'alias':_0x4d222d,'operationType':_0x55bbe3,'functionNode':_0x229f8b});}}}}}catch(_0x4c2aaf){if(_0x4c2aaf[_0xbb1696(0x8a)]!=='ENOENT')throw _0x4c2aaf;}return _0x3ff929;}export async function scanLocalBffFunctions(_0x1c2e9f,_0x19f87a){const _0x596b29=a146_0x3c72e5;if(_0x19f87a===_0x596b29(0x81)||_0x19f87a===_0x596b29(0x7c))return scanFlatFunctions(_0x1c2e9f,_0x19f87a);if(_0x19f87a===_0x596b29(0x96))return scanHookFunctions(_0x1c2e9f);const [_0x309937,_0x35b5c5,_0x1310e6]=await Promise[_0x596b29(0x9a)]([scanFlatFunctions(_0x1c2e9f,_0x596b29(0x81)),scanFlatFunctions(_0x1c2e9f,'ENDPOINT'),scanHookFunctions(_0x1c2e9f)]);return[..._0x309937,..._0x35b5c5,..._0x1310e6];}export function resolveLocalFilePathFromLockKey(_0x549ca7,_0x2679e3){const _0xe05a90=a146_0x3c72e5;return join(_0x549ca7[_0xe05a90(0x77)],..._0x2679e3[_0xe05a90(0x97)]('/'))+_0xe05a90(0x7a);}export function createHookLocationMap(_0x28bc14){const _0x302091=a146_0x3c72e5,_0x46deb1=new Map();for(const _0x4b835d of _0x28bc14){_0x4b835d['beforeScriptId']&&_0x46deb1[_0x302091(0x7f)](_0x4b835d[_0x302091(0x90)],{'datasetCode':_0x4b835d[_0x302091(0x76)],'operationType':snakeToCamel(_0x4b835d[_0x302091(0x8d)]),'functionNode':_0x302091(0x87)}),_0x4b835d[_0x302091(0x8e)]&&_0x46deb1[_0x302091(0x7f)](_0x4b835d['afterScriptId'],{'datasetCode':_0x4b835d[_0x302091(0x76)],'operationType':snakeToCamel(_0x4b835d['operationType']),'functionNode':'after'});}return _0x46deb1;}export function resolveRemoteScriptTarget(_0x14df32,_0x31bf68,_0x379ea9,_0x4b7c1f,_0xbf285d){const _0x392697=a146_0x3c72e5,_0x3cf104=normalizeBffType(_0x31bf68[_0x392697(0x86)]);if(!_0x3cf104||!_0x31bf68[_0x392697(0x93)])return null;if(_0x3cf104===_0x392697(0x96)){const _0xbd31b6=(_0x31bf68['id']?_0x379ea9['get'](_0x31bf68['id']):undefined)??findHookLocationByRemoteId(_0x4b7c1f,_0x31bf68['id']);if(!_0xbd31b6)return null;const _0x36175c=_0xbd31b6[_0x392697(0x80)]||_0xbf285d[_0x392697(0x88)](_0xbd31b6[_0x392697(0x76)]),_0x2a706a=_0x36175c??_0xbd31b6[_0x392697(0x76)],_0x54a4db={..._0xbd31b6,'alias':_0x36175c},_0x28ba62=_0x392697(0x82)+_0x2a706a+'/'+_0x54a4db[_0x392697(0x8d)]+'/'+_0x54a4db[_0x392697(0x95)]+'/'+_0x31bf68[_0x392697(0x93)];return{'lockKey':_0x28ba62,'filePath':resolveLocalFilePathFromLockKey(_0x14df32,_0x28ba62),'type':'HOOK','hookLocation':_0x54a4db};}const _0x296c89=_0x3cf104+'/'+_0x31bf68[_0x392697(0x93)];return{'lockKey':_0x296c89,'filePath':resolveLocalFilePathFromLockKey(_0x14df32,_0x296c89),'type':_0x3cf104};}export async function ensureParentDirectory(_0x158850){await mkdir(dirname(_0x158850),{'recursive':!![]});}function a146_0x47e2(){const _0x1654b4=['ENDPOINT','116200tWmCvV','trim','set','alias','COMMON','HOOK/','isFile','isDirectory','7240qIAqTY','scriptType','before','get','replace','code','402651rKFFKO','127458DhpBmI','operationType','afterScriptId','32LyOxTb','beforeScriptId','F_OK','toUpperCase','functionName','push','functionNode','HOOK','split','name','map','all','556560onvySD','218545CZnylF','59741jpViEQ','496NIfhCz','includes','datasetCode','scriptsRootDir','endsWith','14COcoXe','.js','9396252dMsjqi'];a146_0x47e2=function(){return _0x1654b4;};return a146_0x47e2();}export async function fileExists(_0x5a90d8){const _0x4a2fee=a146_0x3c72e5;try{return await access(_0x5a90d8,constants[_0x4a2fee(0x91)]),!![];}catch{return![];}}export async function directoryExists(_0x1ac524){const _0x52b882=a146_0x3c72e5;try{const _0x392bac=await stat(_0x1ac524);return _0x392bac[_0x52b882(0x84)]();}catch{return![];}}
@@ -1 +1 @@
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
+ (function(_0x34fce0,_0x3d7a3b){const _0x103922=a147_0x333e,_0x25e50e=_0x34fce0();while(!![]){try{const _0x446d89=-parseInt(_0x103922(0x1cf))/0x1+-parseInt(_0x103922(0x1d8))/0x2*(-parseInt(_0x103922(0x1cb))/0x3)+-parseInt(_0x103922(0x1d7))/0x4+parseInt(_0x103922(0x1d3))/0x5+-parseInt(_0x103922(0x1d0))/0x6+-parseInt(_0x103922(0x1d9))/0x7*(parseInt(_0x103922(0x1ca))/0x8)+parseInt(_0x103922(0x1d1))/0x9*(parseInt(_0x103922(0x1d4))/0xa);if(_0x446d89===_0x3d7a3b)break;else _0x25e50e['push'](_0x25e50e['shift']());}catch(_0xaeb432){_0x25e50e['push'](_0x25e50e['shift']());}}}(a147_0x4222,0x4cbc1));function a147_0x333e(_0x42726a,_0x205000){_0x42726a=_0x42726a-0x1ca;const _0x4222ff=a147_0x4222();let _0x333e87=_0x4222ff[_0x42726a];return _0x333e87;}function a147_0x4222(){const _0x25d98f=['utf8','1312340MSGtdA','10WtFDZa','3661CRltkv','1544NFyEaJ','226851hBiMzE','update','digest','createHash','626496QOwdcM','3669402mKnSbY','14339223haWEDo','hex','50300PPmutw','10etUrFZ','md5'];a147_0x4222=function(){return _0x25d98f;};return a147_0x4222();}import{readFile}from'node:fs/promises';import a147_0x4716c8 from'node:crypto';export function computeContentHash(_0xf5b330){const _0x4181b3=a147_0x333e;return a147_0x4716c8[_0x4181b3(0x1ce)](_0x4181b3(0x1d5))[_0x4181b3(0x1cc)](_0xf5b330)[_0x4181b3(0x1cd)](_0x4181b3(0x1d2));}export async function computeFileHash(_0x17586f){const _0x3a421a=a147_0x333e,_0x49fdf9=await readFile(_0x17586f,_0x3a421a(0x1d6));return computeContentHash(_0x49fdf9);}
@@ -1 +1 @@
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
+ function a148_0x172f(){const _0x25dbde=['Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','utf8','22lfkWMm','25SsvCuI','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','current\x20\x22','1478256xrxjBR','4023790eZOuSs','41544REzTMK','\x22\x20vs\x20lock\x20\x22','lastSync','functions','object','249kScjMr','456568EAKbXx','527348UkQnyO','8438QHZPWK','parse','882GNGtee','scriptsRoot','370692BTGYFs','code','apps'];a148_0x172f=function(){return _0x25dbde;};return a148_0x172f();}(function(_0x2e5c54,_0x2c5c19){const _0x4de72b=a148_0x49ed,_0x3f02c0=_0x2e5c54();while(!![]){try{const _0x3029cb=-parseInt(_0x4de72b(0x187))/0x1+-parseInt(_0x4de72b(0x188))/0x2*(-parseInt(_0x4de72b(0x185))/0x3)+parseInt(_0x4de72b(0x175))/0x4*(parseInt(_0x4de72b(0x17b))/0x5)+-parseInt(_0x4de72b(0x17e))/0x6+-parseInt(_0x4de72b(0x186))/0x7+parseInt(_0x4de72b(0x180))/0x8*(-parseInt(_0x4de72b(0x173))/0x9)+-parseInt(_0x4de72b(0x17f))/0xa*(-parseInt(_0x4de72b(0x17a))/0xb);if(_0x3029cb===_0x2c5c19)break;else _0x3f02c0['push'](_0x3f02c0['shift']());}catch(_0x2c8b10){_0x3f02c0['push'](_0x3f02c0['shift']());}}}(a148_0x172f,0x42066));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a148_0x49ed(_0x55aefa,_0x58b81b){_0x55aefa=_0x55aefa-0x173;const _0x172f30=a148_0x172f();let _0x49edf3=_0x172f30[_0x55aefa];return _0x49edf3;}export function ensureLockScope(_0x513784,_0x5b7ac3,_0x47a040,_0x3e8c93){const _0x5f2f07=a148_0x49ed,_0x2bdd57={'apps':_0x513784[_0x5f2f07(0x177)]&&typeof _0x513784['apps']==='object'?_0x513784[_0x5f2f07(0x177)]:{}};let _0x42e535=_0x2bdd57[_0x5f2f07(0x177)][_0x5b7ac3];if(!_0x42e535)return _0x42e535={'scriptsRoot':_0x47a040,'lastSync':'','functions':{}},_0x2bdd57['apps'][_0x5b7ac3]=_0x42e535,{'lockData':_0x2bdd57,'appLock':_0x42e535};if(!_0x42e535[_0x5f2f07(0x174)])_0x42e535[_0x5f2f07(0x174)]=_0x47a040;else{if(_0x42e535[_0x5f2f07(0x174)]!==_0x47a040)throw new Error(_0x3e8c93+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x5f2f07(0x17d)+_0x47a040+_0x5f2f07(0x181)+_0x42e535['scriptsRoot']+'\x22.\x20')+_0x5f2f07(0x17c));}return!_0x42e535['functions']&&(_0x42e535[_0x5f2f07(0x183)]={}),!_0x42e535[_0x5f2f07(0x182)]&&(_0x42e535[_0x5f2f07(0x182)]=''),{'lockData':_0x2bdd57,'appLock':_0x42e535};}export async function readBffLockFile(_0x40da19){const _0x1ab87d=a148_0x49ed;try{const _0x5ac439=await readFile(_0x40da19,_0x1ab87d(0x179)),_0x4f576c=JSON[_0x1ab87d(0x189)](_0x5ac439);return{'apps':_0x4f576c[_0x1ab87d(0x177)]&&typeof _0x4f576c[_0x1ab87d(0x177)]===_0x1ab87d(0x184)?_0x4f576c['apps']:{}};}catch(_0x2aaaf9){if(_0x2aaaf9[_0x1ab87d(0x176)]==='ENOENT')return null;throw new Error(_0x1ab87d(0x178)+String(_0x2aaaf9));}}export async function writeBffLockFile(_0x1dbba1,_0x5148c8){const _0x593db3=a148_0x49ed;await mkdir(dirname(_0x1dbba1),{'recursive':!![]}),await writeFile(_0x1dbba1,JSON['stringify'](_0x5148c8,null,0x2),_0x593db3(0x179));}
@@ -1 +1 @@
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
+ (function(_0x25de7c,_0x24006b){const _0xe8b2=a150_0x17f7,_0x3c8443=_0x25de7c();while(!![]){try{const _0x35df1e=-parseInt(_0xe8b2(0xce))/0x1+-parseInt(_0xe8b2(0xcb))/0x2*(parseInt(_0xe8b2(0xc5))/0x3)+parseInt(_0xe8b2(0xc0))/0x4+-parseInt(_0xe8b2(0xc8))/0x5*(parseInt(_0xe8b2(0xcc))/0x6)+-parseInt(_0xe8b2(0xc2))/0x7*(-parseInt(_0xe8b2(0xcf))/0x8)+-parseInt(_0xe8b2(0xbf))/0x9*(parseInt(_0xe8b2(0xd5))/0xa)+-parseInt(_0xe8b2(0xd3))/0xb*(-parseInt(_0xe8b2(0xca))/0xc);if(_0x35df1e===_0x24006b)break;else _0x3c8443['push'](_0x3c8443['shift']());}catch(_0x24d986){_0x3c8443['push'](_0x3c8443['shift']());}}}(a150_0x4867,0x90aa2));export function snakeToCamel(_0x26db35){const _0xb5075e=a150_0x17f7;return _0x26db35[_0xb5075e(0xd2)]()[_0xb5075e(0xc4)](/_([a-z])/g,(_0xb0837d,_0x38c3b1)=>_0x38c3b1[_0xb5075e(0xc9)]());}function a150_0x4867(){const _0x41eb37=['toLowerCase','22GYsluD','match','70JArjCy','operationType','669087JMOTJl','4044176Divxqg','values','42952HlDSZe','functionNode','replace','24yErPkz','test','after','184895jcgWIh','toUpperCase','6416856dkZJeX','205534ukGoJT','30FFCgRb','before','101670zFihHa','184tKjRcq','trim','datasetCode'];a150_0x4867=function(){return _0x41eb37;};return a150_0x4867();}function a150_0x17f7(_0x504abe,_0x40989f){_0x504abe=_0x504abe-0xbe;const _0x48675f=a150_0x4867();let _0x17f7e8=_0x48675f[_0x504abe];return _0x17f7e8;}export function findHookLocationByRemoteId(_0x47a4bf,_0x39063d){const _0x9c2e63=a150_0x17f7;if(!_0x39063d)return undefined;for(const _0x37312a of Object[_0x9c2e63(0xc1)](_0x47a4bf)){if(_0x37312a['remoteId']===_0x39063d&&_0x37312a[_0x9c2e63(0xd1)]&&_0x37312a[_0x9c2e63(0xbe)]&&_0x37312a[_0x9c2e63(0xc3)])return{'datasetCode':_0x37312a['datasetCode'],'operationType':_0x37312a[_0x9c2e63(0xbe)],'functionNode':_0x37312a['functionNode']};}return undefined;}export function extractScriptDescription(_0x28efc1){const _0x4a36ae=a150_0x17f7,_0x1b1f05=_0x28efc1[_0x4a36ae(0xd4)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x1b1f05?.[0x1]?.[_0x4a36ae(0xd0)]()||undefined;}export function isValidBffFunctionName(_0x1273f9){const _0x3554f7=a150_0x17f7;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x3554f7(0xc6)](_0x1273f9);}export function normalizeHookFunctionNode(_0x363e0b){const _0x54b689=a150_0x17f7;if(!_0x363e0b)return undefined;const _0x2ad783=_0x363e0b[_0x54b689(0xd0)]()[_0x54b689(0xd2)]();if(_0x2ad783===_0x54b689(0xcd)||_0x2ad783===_0x54b689(0xc7))return _0x2ad783;return undefined;}
@@ -1 +1 @@
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
+ (function(_0x4cf66e,_0x5eafd5){const _0x3c632b=a151_0x4f0e,_0x572af2=_0x4cf66e();while(!![]){try{const _0x321037=-parseInt(_0x3c632b(0x185))/0x1+-parseInt(_0x3c632b(0x189))/0x2*(-parseInt(_0x3c632b(0x17f))/0x3)+-parseInt(_0x3c632b(0x182))/0x4*(parseInt(_0x3c632b(0x17e))/0x5)+-parseInt(_0x3c632b(0x17c))/0x6*(parseInt(_0x3c632b(0x190))/0x7)+-parseInt(_0x3c632b(0x18f))/0x8+-parseInt(_0x3c632b(0x17b))/0x9+parseInt(_0x3c632b(0x187))/0xa*(parseInt(_0x3c632b(0x18b))/0xb);if(_0x321037===_0x5eafd5)break;else _0x572af2['push'](_0x572af2['shift']());}catch(_0x3c6805){_0x572af2['push'](_0x572af2['shift']());}}}(a151_0x3bc5,0xd10cd));function a151_0x4f0e(_0x4415f6,_0x525f7f){_0x4415f6=_0x4415f6-0x173;const _0x3bc504=a151_0x3bc5();let _0x4f0e79=_0x3bc504[_0x4415f6];return _0x4f0e79;}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2be7ce){const _0x50a871=a151_0x4f0e;if(cache[_0x50a871(0x175)](_0x2be7ce))return cache['get'](_0x2be7ce);const _0x2eb6be=await listDatasets(_0x2be7ce),_0x5e3a95=new Map();for(const _0x505f8a of _0x2eb6be){const _0x2c0cd1=_0x505f8a[_0x50a871(0x18e)];_0x2c0cd1?.[_0x50a871(0x180)]!=null&&_0x5e3a95['set'](_0x2c0cd1[_0x50a871(0x180)],_0x2c0cd1[_0x50a871(0x176)]??_0x50a871(0x18d)+_0x2c0cd1[_0x50a871(0x180)]);}const _0x2c1cc2=[..._0x5e3a95['entries']()][_0x50a871(0x186)](([_0x2d1fb1,_0x2dc03e])=>({'dbId':_0x2d1fb1,'dbName':_0x2dc03e}));return cache[_0x50a871(0x192)](_0x2be7ce,_0x2c1cc2),_0x2c1cc2;}function a151_0x3bc5(){const _0x443fbb=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','8222IpSLpo','join','19151gzUUpg','No\x20database\x20matching\x20\x22','db-','dbtableConfig','9927336LpmvfP','6937whnKKf','find','set','\x22\x20matches\x20multiple\x20databases:\x20','toLowerCase','includes','\x22\x20under\x20app\x20\x22','has','dbName','filter','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','length','.\x20Be\x20more\x20specific.','14036202KKwjdN','5154LdKRhR','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','5KlSPpd','882WjDRjQ','dbId','isNaN','6703204tkYlHn','\x22.\x20Available:\x20','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','531583WmbaYz','map','31630zWMTss'];a151_0x3bc5=function(){return _0x443fbb;};return a151_0x3bc5();}export async function resolveDb(_0x59283e,_0x3ea124){const _0x28b0bc=a151_0x4f0e,_0x5abde3=await listDatabases(_0x59283e);if(_0x5abde3[_0x28b0bc(0x179)]===0x0)return{'resolved':[],'error':_0x28b0bc(0x17d)+_0x59283e+_0x28b0bc(0x178)};if(!_0x3ea124)return{'resolved':_0x5abde3};const _0xc4a41=Number(_0x3ea124);if(!Number[_0x28b0bc(0x181)](_0xc4a41)){const _0x59a4d4=_0x5abde3[_0x28b0bc(0x191)](_0xf137a6=>_0xf137a6['dbId']===_0xc4a41);if(_0x59a4d4)return{'resolved':[_0x59a4d4]};}const _0x3f9654=_0x3ea124['toLowerCase'](),_0x18647a=_0x5abde3[_0x28b0bc(0x177)](_0x19682b=>_0x19682b[_0x28b0bc(0x176)][_0x28b0bc(0x194)]()[_0x28b0bc(0x173)](_0x3f9654));if(_0x18647a['length']>0x0)return{'resolved':_0x18647a};const _0x259660=_0x5abde3['map'](_0x445478=>_0x445478[_0x28b0bc(0x176)]+'\x20('+_0x445478[_0x28b0bc(0x180)]+')')['join'](',\x20');return{'resolved':[],'error':_0x28b0bc(0x18c)+_0x3ea124+_0x28b0bc(0x174)+_0x59283e+_0x28b0bc(0x183)+_0x259660+_0x28b0bc(0x184)};}export async function resolveOneDb(_0x35ad47,_0x1ec69a){const _0xa29873=a151_0x4f0e,{resolved:_0x130076,error:_0x538935}=await resolveDb(_0x35ad47,_0x1ec69a);if(_0x538935)return{'db':null,'error':_0x538935};if(_0x130076[_0xa29873(0x179)]===0x1)return{'db':_0x130076[0x0]};if(!_0x1ec69a){const _0x537c37=_0x130076[_0xa29873(0x186)](_0x87c5e2=>_0x87c5e2[_0xa29873(0x176)]+'\x20('+_0x87c5e2[_0xa29873(0x180)]+')')[_0xa29873(0x18a)](',\x20');return{'db':null,'error':_0xa29873(0x188)+_0x537c37};}const _0x3fd204=_0x130076['map'](_0x276109=>_0x276109[_0xa29873(0x176)]+'\x20('+_0x276109[_0xa29873(0x180)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x1ec69a+_0xa29873(0x193)+_0x3fd204+_0xa29873(0x17a)};}export async function getDbName(_0x172965,_0x23361b){const _0x3bfe3a=a151_0x4f0e,_0x473cab=await listDatabases(_0x172965);return _0x473cab[_0x3bfe3a(0x191)](_0x52dd95=>_0x52dd95[_0x3bfe3a(0x180)]===_0x23361b)?.['dbName'];}
@@ -1 +1 @@
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
+ const a152_0x5e3b01=a152_0x1dfc;(function(_0x3b9d40,_0x23ecef){const _0x1db7d0=a152_0x1dfc,_0x44a036=_0x3b9d40();while(!![]){try{const _0x3f8105=parseInt(_0x1db7d0(0x16c))/0x1+parseInt(_0x1db7d0(0x16d))/0x2*(-parseInt(_0x1db7d0(0x162))/0x3)+-parseInt(_0x1db7d0(0x166))/0x4*(-parseInt(_0x1db7d0(0x16a))/0x5)+-parseInt(_0x1db7d0(0x161))/0x6+parseInt(_0x1db7d0(0x16b))/0x7+parseInt(_0x1db7d0(0x165))/0x8*(-parseInt(_0x1db7d0(0x168))/0x9)+-parseInt(_0x1db7d0(0x16e))/0xa;if(_0x3f8105===_0x23ecef)break;else _0x44a036['push'](_0x44a036['shift']());}catch(_0x134b39){_0x44a036['push'](_0x44a036['shift']());}}}(a152_0x50fd,0x4d10b));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x50355a,_0x272e61=process[a152_0x5e3b01(0x16f)]()){const _0x565e8d=a152_0x5e3b01,_0x59d7b4=resolve(_0x272e61),_0xb67cc5=join(_0x59d7b4,_0x565e8d(0x167),_0x565e8d(0x171));return{'projectRoot':_0x59d7b4,'pagesBaseDir':_0xb67cc5,'appPagesDir':join(_0xb67cc5,_0x50355a),'lockFilePath':join(_0x59d7b4,_0x565e8d(0x167),_0x565e8d(0x169))};}export function buildPageFileName(_0x293495,_0x15d44a){const _0x455df6=a152_0x5e3b01;return _0x293495+'-'+String(_0x15d44a)[_0x455df6(0x164)]()+_0x455df6(0x170);}function a152_0x50fd(){const _0x444226=['304569dFkjgq','page.lock.json','83560VRpETc','4148417iZcDSV','619388kuFzJp','275980plBaOO','5490640ibudoH','cwd','.json','page','494898oexKJw','9mSKRCS','F_OK','toUpperCase','24wVBsOY','60GLXpRC','.rabetbase'];a152_0x50fd=function(){return _0x444226;};return a152_0x50fd();}export function resolvePageFilePath(_0x3e60e4,_0x4811cc,_0x1d5aee){return join(_0x3e60e4['appPagesDir'],buildPageFileName(_0x4811cc,_0x1d5aee));}export async function ensureParentDirectory(_0x3cb5ee){await mkdir(dirname(_0x3cb5ee),{'recursive':!![]});}function a152_0x1dfc(_0x1531a4,_0x13cead){_0x1531a4=_0x1531a4-0x161;const _0x50fd40=a152_0x50fd();let _0x1dfcd4=_0x50fd40[_0x1531a4];return _0x1dfcd4;}export async function fileExists(_0x4f8d7f){const _0x59a969=a152_0x5e3b01;try{return await access(_0x4f8d7f,constants[_0x59a969(0x163)]),!![];}catch{return![];}}
@@ -1 +1 @@
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
+ (function(_0x9a3c82,_0x41d8ff){const _0x4d1714=a153_0x1de5,_0x469882=_0x9a3c82();while(!![]){try{const _0x382727=-parseInt(_0x4d1714(0xf2))/0x1+-parseInt(_0x4d1714(0xee))/0x2+parseInt(_0x4d1714(0xf8))/0x3+parseInt(_0x4d1714(0xeb))/0x4*(-parseInt(_0x4d1714(0xed))/0x5)+parseInt(_0x4d1714(0xf1))/0x6*(parseInt(_0x4d1714(0xef))/0x7)+parseInt(_0x4d1714(0xf5))/0x8*(parseInt(_0x4d1714(0xf6))/0x9)+-parseInt(_0x4d1714(0xf4))/0xa*(-parseInt(_0x4d1714(0xf3))/0xb);if(_0x382727===_0x41d8ff)break;else _0x469882['push'](_0x469882['shift']());}catch(_0xea2dd7){_0x469882['push'](_0x469882['shift']());}}}(a153_0x52ac,0x6a2cf));import a153_0x12ec06 from'node:crypto';function a153_0x52ac(){const _0x31424b=['43192sdkKzp','603RiqJto','digest','1144461jWuxly','15284PtVRcN','update','625ubgRdm','278150FecrgZ','7JyaSlf','hex','1090002MBwYLD','90140CrfRFe','22NjtbRP','1084240WijEGA'];a153_0x52ac=function(){return _0x31424b;};return a153_0x52ac();}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x5e7405){return JSON['stringify'](JSON['parse'](_0x5e7405),null,0x2)+'\x0a';}export function computePageContentHash(_0x119e51){const _0xa3a830=a153_0x1de5;return a153_0x12ec06['createHash']('md5')[_0xa3a830(0xec)](_0x119e51)[_0xa3a830(0xf7)](_0xa3a830(0xf0));}export function computeSerializedSchemaHash(_0x4cac81){return computePageContentHash(serializePageSchemaForFile(_0x4cac81));}function a153_0x1de5(_0x51f3f5,_0x36a5d5){_0x51f3f5=_0x51f3f5-0xeb;const _0x52ac40=a153_0x52ac();let _0x1de502=_0x52ac40[_0x51f3f5];return _0x1de502;}export async function computePageFileHash(_0xf60b66){const _0x3231b6=await readFile(_0xf60b66,'utf8');return computePageContentHash(_0x3231b6);}
@@ -1 +1 @@
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
+ (function(_0x591d1e,_0x528802){const _0xaf75b5=a154_0x41f7,_0x1f28e4=_0x591d1e();while(!![]){try{const _0x5ef5e6=parseInt(_0xaf75b5(0x8a))/0x1+-parseInt(_0xaf75b5(0x83))/0x2*(-parseInt(_0xaf75b5(0x8e))/0x3)+-parseInt(_0xaf75b5(0x80))/0x4+parseInt(_0xaf75b5(0x8f))/0x5*(parseInt(_0xaf75b5(0x7e))/0x6)+-parseInt(_0xaf75b5(0x87))/0x7+-parseInt(_0xaf75b5(0x7f))/0x8*(-parseInt(_0xaf75b5(0x91))/0x9)+-parseInt(_0xaf75b5(0x82))/0xa;if(_0x5ef5e6===_0x528802)break;else _0x1f28e4['push'](_0x1f28e4['shift']());}catch(_0x5b9262){_0x1f28e4['push'](_0x1f28e4['shift']());}}}(a154_0x2f85,0x457a8));function a154_0x2f85(){const _0x55c757=['2649UHkRqK','5YZVdWQ','pages','3139659UNmMns','3299418yEqIQI','8jgMbXc','1961772hnhziw','utf8','5790480PxQlcu','862xCIWiq','parse','ENOENT','apps','1880627fduclj','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','object','343409uvBLqt','code','stringify','lastSync'];a154_0x2f85=function(){return _0x55c757;};return a154_0x2f85();}function a154_0x41f7(_0x87efbf,_0x152771){_0x87efbf=_0x87efbf-0x7e;const _0x2f859f=a154_0x2f85();let _0x41f744=_0x2f859f[_0x87efbf];return _0x41f744;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x2897d0,_0x437383){const _0x204135=a154_0x41f7,_0x38147e={'apps':_0x2897d0[_0x204135(0x86)]&&typeof _0x2897d0[_0x204135(0x86)]==='object'?_0x2897d0[_0x204135(0x86)]:{}};let _0x3d865d=_0x38147e[_0x204135(0x86)][_0x437383];if(!_0x3d865d)return _0x3d865d={'lastSync':'','pages':{}},_0x38147e['apps'][_0x437383]=_0x3d865d,{'lockData':_0x38147e,'appLock':_0x3d865d};return!_0x3d865d[_0x204135(0x8d)]&&(_0x3d865d[_0x204135(0x8d)]=''),(!_0x3d865d['pages']||typeof _0x3d865d['pages']!==_0x204135(0x89))&&(_0x3d865d[_0x204135(0x90)]={}),{'lockData':_0x38147e,'appLock':_0x3d865d};}export async function readPageLockFile(_0x3a2dfb){const _0x5150ff=a154_0x41f7;try{const _0x7f5974=await readFile(_0x3a2dfb,_0x5150ff(0x81)),_0x1ac310=JSON[_0x5150ff(0x84)](_0x7f5974);return{'apps':_0x1ac310[_0x5150ff(0x86)]&&typeof _0x1ac310[_0x5150ff(0x86)]===_0x5150ff(0x89)?_0x1ac310[_0x5150ff(0x86)]:{}};}catch(_0x17f42b){if(_0x17f42b[_0x5150ff(0x8b)]===_0x5150ff(0x85))return null;throw new Error(_0x5150ff(0x88)+String(_0x17f42b));}}export async function writePageLockFile(_0x1436fb,_0x65c3d8){const _0x176122=a154_0x41f7;await mkdir(dirname(_0x1436fb),{'recursive':!![]}),await writeFile(_0x1436fb,JSON[_0x176122(0x8c)](_0x65c3d8,null,0x2),_0x176122(0x81));}
@@ -1 +1 @@
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)};}
1
+ function a156_0x18e0(){const _0x2325b2=['/sql','sql','sql.lock.json','sql-trash','1386889xGMCpC','5759120FWrFFv','2574666YXTVKd','2nhvuMk','9TvOFZf','1730BYOBUf','1131817AFwqXb','171501nfhFqK','291XtkALy','1224EXMjOT','.rabetbase','5634104bdWrsG'];a156_0x18e0=function(){return _0x2325b2;};return a156_0x18e0();}const a156_0x968681=a156_0x2349;(function(_0x20ea99,_0xc3d3f5){const _0x48e0e8=a156_0x2349,_0x1df9e2=_0x20ea99();while(!![]){try{const _0xccc501=-parseInt(_0x48e0e8(0x12c))/0x1*(parseInt(_0x48e0e8(0x129))/0x2)+-parseInt(_0x48e0e8(0x12e))/0x3*(-parseInt(_0x48e0e8(0x12f))/0x4)+-parseInt(_0x48e0e8(0x137))/0x5+-parseInt(_0x48e0e8(0x138))/0x6+parseInt(_0x48e0e8(0x136))/0x7+parseInt(_0x48e0e8(0x131))/0x8*(parseInt(_0x48e0e8(0x12a))/0x9)+-parseInt(_0x48e0e8(0x12b))/0xa*(-parseInt(_0x48e0e8(0x12d))/0xb);if(_0xccc501===_0xc3d3f5)break;else _0x1df9e2['push'](_0x1df9e2['shift']());}catch(_0x2f2579){_0x1df9e2['push'](_0x1df9e2['shift']());}}}(a156_0x18e0,0xdfc53));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a156_0x2349(_0x59a499,_0x46b83f){_0x59a499=_0x59a499-0x129;const _0x18e018=a156_0x18e0();let _0x2349e1=_0x18e018[_0x59a499];return _0x2349e1;}const DOT_DIR=a156_0x968681(0x130),LOCK_FILE_NAME=a156_0x968681(0x134),TRASH_DIR_NAME=a156_0x968681(0x135);export function loadSqlProjectConfig(_0x6a903c,_0x1a07fc){const _0x2802d4=a156_0x968681,_0x42fe03=resolve(_0x1a07fc??findProjectRootDirectory()),_0x5cd03f=DOT_DIR+_0x2802d4(0x132),_0x54dd4f=_0x5cd03f+'/'+_0x6a903c;return{'projectRoot':_0x42fe03,'appCode':_0x6a903c,'sqlWorkspaceRoot':_0x5cd03f,'sqlRoot':_0x54dd4f,'sqlRootDir':resolve(_0x42fe03,DOT_DIR,_0x2802d4(0x133),_0x6a903c),'lockFilePath':resolve(_0x42fe03,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x42fe03,DOT_DIR,TRASH_DIR_NAME)};}