@lovrabet/rabetbase-cli 2.2.3-beta.2 → 2.2.4-beta.1

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 (205) 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/list.js +1 -1
  87. package/lib/commands/menu/shared/compare-table.js +1 -1
  88. package/lib/commands/menu/shared/index.js +1 -1
  89. package/lib/commands/menu/shared/inquirer.js +1 -1
  90. package/lib/commands/menu/shared/local-pages.js +1 -1
  91. package/lib/commands/menu/shared/logic.js +1 -1
  92. package/lib/commands/menu/shared/service.js +1 -1
  93. package/lib/commands/menu/shared/sync-core.js +1 -1
  94. package/lib/commands/menu/shared/update-core.js +1 -1
  95. package/lib/commands/menu/shared/valid-url.js +1 -1
  96. package/lib/commands/menu/sync.js +1 -1
  97. package/lib/commands/menu/update.js +1 -1
  98. package/lib/commands/page/generate-start.js +1 -1
  99. package/lib/commands/page/generate-status.js +1 -1
  100. package/lib/commands/page/index.js +1 -1
  101. package/lib/commands/page/pull.js +1 -1
  102. package/lib/commands/page/push.js +1 -1
  103. package/lib/commands/page/relation-audit.js +1 -1
  104. package/lib/commands/page/shared.js +1 -1
  105. package/lib/commands/page/standard-page-status.js +1 -1
  106. package/lib/commands/page/sync.js +1 -1
  107. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  108. package/lib/commands/project/create/format-elapsed.js +1 -1
  109. package/lib/commands/project/create/main.js +1 -1
  110. package/lib/commands/project/create/non-interactive.js +1 -1
  111. package/lib/commands/project/create/project-template-path.js +1 -1
  112. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  113. package/lib/commands/project/create/use-format-code.js +1 -1
  114. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  115. package/lib/commands/project/index.js +1 -1
  116. package/lib/commands/project/init.js +1 -1
  117. package/lib/commands/project/upgrade.js +1 -1
  118. package/lib/commands/registry.js +1 -1
  119. package/lib/commands/run/index.js +1 -1
  120. package/lib/commands/schema.js +1 -1
  121. package/lib/commands/skill/index.js +1 -1
  122. package/lib/commands/sql/create.js +1 -1
  123. package/lib/commands/sql/delete.js +1 -1
  124. package/lib/commands/sql/detail.js +1 -1
  125. package/lib/commands/sql/exec.js +1 -1
  126. package/lib/commands/sql/index.js +1 -1
  127. package/lib/commands/sql/list.js +1 -1
  128. package/lib/commands/sql/pull.js +1 -1
  129. package/lib/commands/sql/push.js +1 -1
  130. package/lib/commands/sql/save.js +1 -1
  131. package/lib/commands/sql/shared.js +1 -1
  132. package/lib/commands/sql/status.js +1 -1
  133. package/lib/commands/sql/validate.js +1 -1
  134. package/lib/config/schema.js +1 -1
  135. package/lib/constant/cdn.js +1 -1
  136. package/lib/constant/cli.js +1 -1
  137. package/lib/constant/defaults.js +1 -1
  138. package/lib/constant/domain.js +1 -1
  139. package/lib/constant/env.js +1 -1
  140. package/lib/constant/output.js +1 -1
  141. package/lib/constant/paths.js +1 -1
  142. package/lib/constant/risk.js +1 -1
  143. package/lib/context.js +1 -1
  144. package/lib/core/alias-resolver.js +1 -1
  145. package/lib/core/api-client.js +1 -1
  146. package/lib/core/bff/config.js +1 -1
  147. package/lib/core/bff/file-system.js +1 -1
  148. package/lib/core/bff/hash.js +1 -1
  149. package/lib/core/bff/lock.js +1 -1
  150. package/lib/core/bff/utils.js +1 -1
  151. package/lib/core/db-resolver.js +1 -1
  152. package/lib/core/page/file-system.js +1 -1
  153. package/lib/core/page/hash.js +1 -1
  154. package/lib/core/page/lock.js +1 -1
  155. package/lib/core/sql-sync/config.js +1 -1
  156. package/lib/core/sql-sync/file-system.js +1 -1
  157. package/lib/core/sql-sync/hash.js +1 -1
  158. package/lib/core/sql-sync/lock.js +1 -1
  159. package/lib/core/sql-sync/utils.js +1 -1
  160. package/lib/core/sql-validator.js +1 -1
  161. package/lib/errors.js +1 -1
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/flags.js +1 -1
  164. package/lib/framework/help.js +1 -1
  165. package/lib/framework/index.js +1 -1
  166. package/lib/framework/output.js +1 -1
  167. package/lib/framework/response.js +1 -1
  168. package/lib/framework/runner-alias.js +1 -1
  169. package/lib/framework/runner.js +1 -1
  170. package/lib/framework/schema-export.js +1 -1
  171. package/lib/framework/types.js +1 -1
  172. package/lib/generated/build-info.js +1 -1
  173. package/lib/help.js +1 -1
  174. package/lib/skills/main.js +1 -1
  175. package/lib/skills/npx-skills-add.js +1 -1
  176. package/lib/telemetry/cli-command-trace.js +1 -1
  177. package/lib/telemetry/cli-help-trace.js +1 -1
  178. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  179. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  180. package/lib/telemetry/send-cli-trace-log.js +1 -1
  181. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  182. package/lib/utils/ai_config.js +1 -1
  183. package/lib/utils/apply-jq-filter.js +1 -1
  184. package/lib/utils/cdn-config.js +1 -1
  185. package/lib/utils/check-sdk-version.js +1 -1
  186. package/lib/utils/cli-version-check.js +1 -1
  187. package/lib/utils/cli-version-policy.js +1 -1
  188. package/lib/utils/config.js +1 -1
  189. package/lib/utils/copy-directory.js +1 -1
  190. package/lib/utils/entity-with-id.js +1 -1
  191. package/lib/utils/file-utils.js +1 -1
  192. package/lib/utils/guides-cdn.js +1 -1
  193. package/lib/utils/http-client.js +1 -1
  194. package/lib/utils/is-non-interactive.js +1 -1
  195. package/lib/utils/logger.js +1 -1
  196. package/lib/utils/params.js +1 -1
  197. package/lib/utils/platform.js +1 -1
  198. package/lib/utils/rules-cdn.js +1 -1
  199. package/lib/utils/sleep.js +1 -1
  200. package/lib/utils/template-replacer.js +1 -1
  201. package/lib/utils/update-notice.js +1 -1
  202. package/lib/utils/version.js +1 -1
  203. package/lib/utils/with-active-cookie.js +1 -1
  204. package/lib/utils/write-cli-side-channel.js +1 -1
  205. package/package.json +1 -1
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a143_0x4f892a=a143_0x251c;(function(_0x43fbdf,_0x596c20){const _0x46b59d=a143_0x251c,_0xe452e9=_0x43fbdf();while(!![]){try{const _0x57989b=-parseInt(_0x46b59d(0xdc))/0x1*(-parseInt(_0x46b59d(0xb1))/0x2)+-parseInt(_0x46b59d(0x91))/0x3*(parseInt(_0x46b59d(0x9e))/0x4)+parseInt(_0x46b59d(0xae))/0x5+-parseInt(_0x46b59d(0xa8))/0x6*(-parseInt(_0x46b59d(0xa7))/0x7)+parseInt(_0x46b59d(0xb9))/0x8*(-parseInt(_0x46b59d(0x99))/0x9)+parseInt(_0x46b59d(0x89))/0xa*(parseInt(_0x46b59d(0xca))/0xb)+parseInt(_0x46b59d(0xcf))/0xc;if(_0x57989b===_0x596c20)break;else _0xe452e9['push'](_0xe452e9['shift']());}catch(_0x4f8b10){_0xe452e9['push'](_0xe452e9['shift']());}}}(a143_0x2b3b,0x42162));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';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';function a143_0x2b3b(){const _0x3771ee=['format','343385rqUzhM','12nCiFGs','authRequired','warn','inherit','error','defaultApp','317615AbMntZ','setRawCommand','locale','2yRejHC','\x0a\x20\x20','MAX_RISK','replace','APP','entries','parse','cookie','1956272BnngQR','-api.ts','appcode','riskLevel','cwd','slice','template_base_url','production','object','trim','userDomain','true','pageSize','accessKey','message','status','read','77eEhsdP','FORMAT','VERBOSE','string','./constant/env.js','3766836bOCYRc','silent','apiDomain','.rabetbase.json','projectConfig','Project','keys','merged','apiDir','api.ts','./auth/get-cookie.js','get','daily','455006hatyWa','filter','.lovrabet.json','env','.tmp','write','argv','51080hnoXjk','stringify','COOKIE','globalConfig','apps','PAGE_SIZE','https://g.lovrabet.com/dist/lovrabet-skill','.lovrabetrc','3HLdAXC','find','project','utf8','Global','runtimeDomain','ENV','ACCESS_KEY','9NLORDw','length','data','./constant/domain.js','app','1804296EihRNe','map','config','missing','values','setLogPath','maxRisk','empty'];a143_0x2b3b=function(){return _0x3771ee;};return a143_0x2b3b();}import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x564f79){return process.env[`RABETBASE_${_0x564f79}`]||process.env[`LOVRABET_${_0x564f79}`]||undefined;}export const NEW_CONFIG_NAME=a143_0x4f892a(0xd2);export const CONFIG_NAMES=[a143_0x4f892a(0xd2),a143_0x4f892a(0x84),a143_0x4f892a(0x90)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a143_0x4f892a(0x83)](_0x5a4226=>_0x5a4226!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x38c364){for(const _0xfca9fd of CONFIG_NAMES){const _0x3d7462=resolve(_0x38c364,_0xfca9fd);if(existsSync(_0x3d7462))return _0x3d7462;}return undefined;}export function findProjectRootDirectory(_0x29b6bf=process[a143_0x4f892a(0xbd)]()){let _0x16828c=resolve(_0x29b6bf);const {root:_0x211f6c}=parse(_0x16828c),_0x29d4e3=homedir();while(!![]){if(resolveConfigPath(_0x16828c)){if(_0x16828c===_0x29d4e3)break;return _0x16828c;}if(_0x16828c===_0x211f6c||_0x16828c===_0x29d4e3)break;const _0x3834a0=dirname(_0x16828c);if(_0x3834a0===_0x16828c)break;_0x16828c=_0x3834a0;}return resolve(_0x29b6bf);}export async function createContext(_0x15b883){const _0xbd1b22=a143_0x4f892a,{config:_0x57fd0b,layers:_0x333d3c}=readRawConfigWithLayers(),_0xaa028=buildConfig(_0x57fd0b,_0x15b883,_0x333d3c),{initEnv:_0x3da3de}=await import(_0xbd1b22(0xce));if(_0xaa028[_0xbd1b22(0x85)])_0x3da3de(_0xaa028[_0xbd1b22(0x85)]);else _0x15b883['env']&&typeof _0x15b883[_0xbd1b22(0x85)]==='string'&&_0x3da3de(_0x15b883[_0xbd1b22(0x85)]);const {initDomains:_0x578f26,getUserDomain:_0x3e4fca,getApiDomain:_0x32182e}=await import(_0xbd1b22(0x9c));_0x578f26({'apiDomain':_0x57fd0b[_0xbd1b22(0xd1)]||undefined,'userDomain':_0x57fd0b[_0xbd1b22(0xc3)]||undefined,'runtimeDomain':_0x57fd0b[_0xbd1b22(0x96)]||undefined});const _0x52495f={'apiDomain':_0x32182e(),'userDomain':_0x3e4fca()},_0x1a5338=await buildAuth(_0xaa028);logger[_0xbd1b22(0xa3)](process[_0xbd1b22(0xbd)]());const _0x290477=(CLI_BIN_NAME+'\x20'+process[_0xbd1b22(0x88)][_0xbd1b22(0xbe)](0x2)['join']('\x20'))[_0xbd1b22(0xc2)]();logger[_0xbd1b22(0xaf)](_0x290477);const {isNonInteractive:_0x15e30e}=await import('./utils/is-non-interactive.js'),_0x49c8b4=_0x15e30e(_0x15b883);return{'config':_0xaa028,'auth':_0x1a5338,'logger':logger,'env':_0x52495f,'nonInteractive':_0x49c8b4};}export function buildConfigFromFlags(_0x5968cf){const {config:_0x6afc3d,layers:_0x555aba}=readRawConfigWithLayers();return buildConfig(_0x6afc3d,_0x5968cf,_0x555aba);}function a143_0x251c(_0x3712fb,_0xecef7f){_0x3712fb=_0x3712fb-0x83;const _0x2b3bea=a143_0x2b3b();let _0x251c8e=_0x2b3bea[_0x3712fb];return _0x251c8e;}export function getProjectConfigPath(){const _0x5d719a=a143_0x4f892a;return resolveConfigPath(process[_0x5d719a(0xbd)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x460fd3){const _0x2fab90=a143_0x4f892a;if(!existsSync(_0x460fd3))return{'status':_0x2fab90(0xa1)};try{const _0x13d90d=readFileSync(_0x460fd3,{'encoding':'utf8'});if(!_0x13d90d?.[_0x2fab90(0xc2)]())return{'status':_0x2fab90(0xa5)};const _0x187235=JSON[_0x2fab90(0xb7)](_0x13d90d);return{'status':'ok','data':_0x187235};}catch(_0x1aef4a){return{'status':_0x2fab90(0xac),'message':_0x1aef4a instanceof Error?_0x1aef4a[_0x2fab90(0xc7)]:String(_0x1aef4a)};}}function parseCliConfigJsonFile(_0x28699c,_0x23c242,_0x3d5e16){const _0x83e238=a143_0x4f892a,_0x5ce998=inspectCliConfigJsonFile(_0x28699c);if(_0x5ce998[_0x83e238(0xc8)]===_0x83e238(0xa1)||_0x5ce998[_0x83e238(0xc8)]===_0x83e238(0xa5))return{};if(_0x5ce998[_0x83e238(0xc8)]==='ok')return _0x5ce998[_0x83e238(0x9b)];return _0x23c242===_0x83e238(0xaa)&&_0x3d5e16&&console[_0x83e238(0xac)](CLI_BIN_NAME+':\x20'+_0x3d5e16+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x28699c+_0x83e238(0xb2)+_0x5ce998[_0x83e238(0xc7)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x10ccb3){const _0xe3d7c0=a143_0x4f892a;if(!_0x10ccb3||typeof _0x10ccb3!==_0xe3d7c0(0xc1))return{'config':{},'migrated':![]};const _0x27e64e={..._0x10ccb3},_0x4b44b3=_0x27e64e['apps']&&typeof _0x27e64e[_0xe3d7c0(0x8d)]===_0xe3d7c0(0xc1)?{..._0x27e64e[_0xe3d7c0(0x8d)]}:{},_0x210f8b=Object[_0xe3d7c0(0xd5)](_0x4b44b3)[_0xe3d7c0(0x9a)],_0x748d26=_0x27e64e[_0xe3d7c0(0xbb)]||_0x27e64e['app'];let _0x423768=![];if(_0x748d26&&_0x210f8b===0x0){const _0xac6e1b=typeof _0x27e64e[_0xe3d7c0(0xad)]==='string'&&_0x27e64e['defaultApp'][_0xe3d7c0(0xc2)]()?_0x27e64e[_0xe3d7c0(0xad)]:String(_0x748d26)['trim']();_0x4b44b3[_0xac6e1b]={'appcode':String(_0x748d26)[_0xe3d7c0(0xc2)](),..._0x27e64e['env']!=null?{'env':_0x27e64e[_0xe3d7c0(0x85)]}:{},..._0x27e64e[_0xe3d7c0(0xd7)]!=null?{'apiDir':_0x27e64e['apiDir']}:{},..._0x27e64e[_0xe3d7c0(0xb8)]!=null?{'cookie':_0x27e64e['cookie']}:{},..._0x27e64e[_0xe3d7c0(0xc6)]!=null?{'accessKey':_0x27e64e['accessKey']}:{},..._0x27e64e[_0xe3d7c0(0xa6)]!=null?{'format':_0x27e64e[_0xe3d7c0(0xa6)]}:{},..._0x27e64e['pageSize']!=null?{'pageSize':_0x27e64e[_0xe3d7c0(0xc5)]}:{},..._0x27e64e[_0xe3d7c0(0xbc)]!=null?{'riskLevel':_0x27e64e['riskLevel']}:{},..._0x27e64e['locale']!=null?{'locale':_0x27e64e[_0xe3d7c0(0xb0)]}:{}},_0x27e64e[_0xe3d7c0(0x8d)]=_0x4b44b3;if(!_0x27e64e[_0xe3d7c0(0xad)])_0x27e64e[_0xe3d7c0(0xad)]=_0xac6e1b;_0x423768=!![];}return(_0xe3d7c0(0xbb)in _0x27e64e||_0xe3d7c0(0x9d)in _0x27e64e)&&(delete _0x27e64e[_0xe3d7c0(0xbb)],delete _0x27e64e['app'],_0x423768=!![]),{'config':_0x27e64e,'migrated':_0x423768};}function writeNormalizedConfigIfNeeded(_0x42aa36,_0x54866a){const _0x1f2eb5=a143_0x4f892a,_0x1ece1d=JSON[_0x1f2eb5(0x8a)](_0x54866a,null,0x2)+'\x0a';if(normalizedWriteCache[_0x1f2eb5(0xda)](_0x42aa36)===_0x1ece1d)return;writeConfigFile(_0x42aa36,_0x54866a),normalizedWriteCache['set'](_0x42aa36,_0x1ece1d);}function parseAndNormalizeConfig(_0x147e8c,_0x4baed6,_0x205808){const _0x17d519=a143_0x4f892a,_0x419968=parseCliConfigJsonFile(_0x147e8c,_0x4baed6,_0x205808),_0x3c68bf=normalizeLegacyConfigShape(_0x419968);if(_0x3c68bf['migrated'])try{writeNormalizedConfigIfNeeded(_0x147e8c,_0x3c68bf['config']);}catch{}return _0x3c68bf[_0x17d519(0xa0)];}export function loadRawConfigLayers(_0x1533e8){const _0x20cd6d=a143_0x4f892a;let _0x390096={},_0x2f12e6={};const _0x4adf74=resolveConfigPath(homedir());_0x4adf74&&(_0x390096=parseAndNormalizeConfig(_0x4adf74,_0x20cd6d(0xaa),_0x20cd6d(0x95)));const _0x59d00b=_0x1533e8??findProjectRootDirectory(),_0x1d4c50=resolveConfigPath(_0x59d00b);return _0x1d4c50&&(_0x2f12e6=parseAndNormalizeConfig(_0x1d4c50,_0x20cd6d(0xaa),_0x20cd6d(0xd4))),{'globalPath':_0x4adf74,'projectPath':_0x1d4c50,'globalConfig':_0x390096,'projectConfig':_0x2f12e6};}const INHERIT_WHITELIST=['cookie',a143_0x4f892a(0xc6),a143_0x4f892a(0xb0),a143_0x4f892a(0xa6),a143_0x4f892a(0xbc),'pageSize'];function mergeRawConfigLayers(_0x47dc35){const _0x2dafd4=a143_0x4f892a,{globalConfig:_0x23f92f,projectConfig:_0x2bb351}=_0x47dc35,_0x7c63e3=Object[_0x2dafd4(0xd5)](_0x2bb351)[_0x2dafd4(0x9a)]>0x0;if(!_0x7c63e3)return mergeGlobalOnly(_0x23f92f);if(_0x2bb351['inherit']===!![])return mergeFullInherit(_0x23f92f,_0x2bb351);if(_0x2bb351['inherit']===![])return mergeIsolated(_0x2bb351);return mergeProjectFirst(_0x23f92f,_0x2bb351);}function mergeGlobalOnly(_0x4d93f2){const _0x2e71ae=a143_0x4f892a,_0x4f9dcb={..._0x4d93f2},_0x2e2228=_0x4d93f2[_0x2e71ae(0x8d)]&&typeof _0x4d93f2[_0x2e71ae(0x8d)]===_0x2e71ae(0xc1)?_0x4d93f2[_0x2e71ae(0x8d)]:{};Object[_0x2e71ae(0xd5)](_0x2e2228)[_0x2e71ae(0x9a)]>0x0&&(_0x4f9dcb[_0x2e71ae(0x8d)]=_0x2e2228);if(_0x4d93f2['defaultApp'])_0x4f9dcb[_0x2e71ae(0xad)]=_0x4d93f2['defaultApp'];else{const _0x469dd2=Object[_0x2e71ae(0xd5)](_0x2e2228);if(_0x469dd2[_0x2e71ae(0x9a)]>0x0)_0x4f9dcb[_0x2e71ae(0xad)]=_0x469dd2[0x0];}return _0x4f9dcb;}function mergeIsolated(_0xe25b4b){const _0x53f213=a143_0x4f892a,_0x1ba2e1={..._0xe25b4b};delete _0x1ba2e1['inherit'];const _0x29249b=_0xe25b4b[_0x53f213(0x8d)]&&typeof _0xe25b4b[_0x53f213(0x8d)]===_0x53f213(0xc1)?_0xe25b4b[_0x53f213(0x8d)]:{};Object[_0x53f213(0xd5)](_0x29249b)['length']>0x0?_0x1ba2e1[_0x53f213(0x8d)]=_0x29249b:delete _0x1ba2e1[_0x53f213(0x8d)];if('defaultApp'in _0xe25b4b)_0x1ba2e1[_0x53f213(0xad)]=_0xe25b4b[_0x53f213(0xad)];else Object[_0x53f213(0xd5)](_0x29249b)[_0x53f213(0x9a)]>0x0?_0x1ba2e1[_0x53f213(0xad)]=Object[_0x53f213(0xd5)](_0x29249b)[0x0]:delete _0x1ba2e1['defaultApp'];return _0x1ba2e1;}function mergeProjectFirst(_0x504e07,_0x26af5a){const _0x2bb03f=a143_0x4f892a,_0x777c39={..._0x26af5a};delete _0x777c39['inherit'];for(const _0x1b252a of INHERIT_WHITELIST){!(_0x1b252a in _0x777c39)&&_0x1b252a in _0x504e07&&(_0x777c39[_0x1b252a]=_0x504e07[_0x1b252a]);}const _0x3da8a7=_0x26af5a['apps']&&typeof _0x26af5a[_0x2bb03f(0x8d)]===_0x2bb03f(0xc1)?_0x26af5a[_0x2bb03f(0x8d)]:{};Object[_0x2bb03f(0xd5)](_0x3da8a7)[_0x2bb03f(0x9a)]>0x0?_0x777c39[_0x2bb03f(0x8d)]=_0x3da8a7:delete _0x777c39['apps'];if('defaultApp'in _0x26af5a)_0x777c39['defaultApp']=_0x26af5a[_0x2bb03f(0xad)];else Object[_0x2bb03f(0xd5)](_0x3da8a7)[_0x2bb03f(0x9a)]>0x0?_0x777c39[_0x2bb03f(0xad)]=Object[_0x2bb03f(0xd5)](_0x3da8a7)[0x0]:delete _0x777c39[_0x2bb03f(0xad)];return _0x777c39;}function mergeFullInherit(_0x926df6,_0x107bda){const _0x4cf9b2=a143_0x4f892a,_0x55a54e=_0x926df6[_0x4cf9b2(0x8d)]&&typeof _0x926df6[_0x4cf9b2(0x8d)]===_0x4cf9b2(0xc1)?_0x926df6[_0x4cf9b2(0x8d)]:{},_0x45b53a=_0x107bda[_0x4cf9b2(0x8d)]&&typeof _0x107bda['apps']===_0x4cf9b2(0xc1)?_0x107bda[_0x4cf9b2(0x8d)]:{},_0x6dbff0={..._0x55a54e,..._0x45b53a},_0x10c0d7={..._0x926df6,..._0x107bda};delete _0x10c0d7[_0x4cf9b2(0xab)];Object[_0x4cf9b2(0xd5)](_0x6dbff0)['length']>0x0&&(_0x10c0d7[_0x4cf9b2(0x8d)]=_0x6dbff0);if(_0x4cf9b2(0xad)in _0x107bda)_0x10c0d7[_0x4cf9b2(0xad)]=_0x107bda[_0x4cf9b2(0xad)];else{if(Object['keys'](_0x45b53a)[_0x4cf9b2(0x9a)]>0x0)_0x10c0d7[_0x4cf9b2(0xad)]=Object[_0x4cf9b2(0xd5)](_0x45b53a)[0x0];else{if(_0x926df6[_0x4cf9b2(0xad)])_0x10c0d7['defaultApp']=_0x926df6['defaultApp'];else{const _0x44d111=Object['keys'](_0x55a54e);if(_0x44d111['length']>0x0)_0x10c0d7[_0x4cf9b2(0xad)]=_0x44d111[0x0];}}}return _0x10c0d7;}export function readRawConfigWithLayers(_0x1e7587){const _0x4f32d3=loadRawConfigLayers(_0x1e7587);return{'config':mergeRawConfigLayers(_0x4f32d3),'layers':_0x4f32d3};}export function readRawConfig(_0x3c7d5c){return mergeRawConfigLayers(loadRawConfigLayers(_0x3c7d5c));}export function getConfigAppCode(_0x1070ef){const _0x33892e=a143_0x4f892a,_0x91d9c8=readRawConfig(_0x1070ef);if(_0x91d9c8[_0x33892e(0x8d)]&&typeof _0x91d9c8[_0x33892e(0x8d)]===_0x33892e(0xc1)){const _0x31b794=_0x91d9c8[_0x33892e(0xad)];if(_0x31b794&&_0x91d9c8[_0x33892e(0x8d)][_0x31b794]?.[_0x33892e(0xbb)])return String(_0x91d9c8[_0x33892e(0x8d)][_0x31b794][_0x33892e(0xbb)])['trim']();const _0x364618=Object[_0x33892e(0xa2)](_0x91d9c8[_0x33892e(0x8d)])[0x0];if(_0x364618?.['appcode'])return String(_0x364618[_0x33892e(0xbb)])[_0x33892e(0xc2)]();}const _0x31ea3c=_0x91d9c8[_0x33892e(0xbb)]||_0x91d9c8[_0x33892e(0x9d)];if(typeof _0x31ea3c!=='string'||_0x31ea3c[_0x33892e(0xc2)]()==='')return undefined;return _0x31ea3c[_0x33892e(0xc2)]();}export function getMultiAppConfigs(_0xdcb9c4=a143_0x4f892a(0x93),_0x5a0af9){const _0x227511=a143_0x4f892a,_0x1d1bf4=loadRawConfigLayers(_0x5a0af9);let _0x114d3b,_0x32268e;if(_0xdcb9c4===_0x227511(0xd6)){const _0x206112=_0x1d1bf4['globalConfig'][_0x227511(0x8d)]&&typeof _0x1d1bf4[_0x227511(0x8c)][_0x227511(0x8d)]===_0x227511(0xc1)?_0x1d1bf4[_0x227511(0x8c)][_0x227511(0x8d)]:{},_0x7d3330=_0x1d1bf4[_0x227511(0xd3)][_0x227511(0x8d)]&&typeof _0x1d1bf4[_0x227511(0xd3)]['apps']===_0x227511(0xc1)?_0x1d1bf4[_0x227511(0xd3)][_0x227511(0x8d)]:{};_0x114d3b={..._0x206112,..._0x7d3330};const _0x5387c7=readRawConfig(_0x5a0af9);_0x32268e=_0x5387c7[_0x227511(0xad)];}else _0x114d3b=_0x1d1bf4['projectConfig'][_0x227511(0x8d)],_0x32268e=_0x1d1bf4[_0x227511(0xd3)][_0x227511(0xad)];if(!_0x114d3b||typeof _0x114d3b!==_0x227511(0xc1)||Object[_0x227511(0xd5)](_0x114d3b)[_0x227511(0x9a)]===0x0)return null;return Object[_0x227511(0xb6)](_0x114d3b)[_0x227511(0x9f)](([_0x298e55,_0x473a8e])=>({'name':_0x298e55,'appcode':_0x473a8e?.[_0x227511(0xbb)]||'','isDefault':_0x298e55===_0x32268e,'env':_0x473a8e?.['env'],'apiDir':_0x473a8e?.['apiDir'],'cookie':_0x473a8e?.[_0x227511(0xb8)]||undefined}))['filter'](_0x3236c5=>_0x3236c5['appcode']);}export function getTemplateBaseUrl(_0x49f200){const _0x7d7bb6=a143_0x4f892a,_0xa317ff=readRawConfig(_0x49f200);if(_0xa317ff[_0x7d7bb6(0xbf)]&&typeof _0xa317ff[_0x7d7bb6(0xbf)]===_0x7d7bb6(0xcd))return _0xa317ff[_0x7d7bb6(0xbf)][_0x7d7bb6(0xb4)](/\/$/,'');return _0x7d7bb6(0x8f);}export function readConfigFile(_0x16330d){const _0x3550a8=a143_0x4f892a;return parseAndNormalizeConfig(_0x16330d,_0x3550a8(0xd0));}export function writeConfigFile(_0x4e0d64,_0xad9fb6){const _0x40c58a=a143_0x4f892a,_0x20f5e7=dirname(_0x4e0d64);!existsSync(_0x20f5e7)&&mkdirSync(_0x20f5e7,{'recursive':!![]});const _0x1dbe18=_0x4e0d64+_0x40c58a(0x86);try{writeFileSync(_0x1dbe18,JSON['stringify'](_0xad9fb6,null,0x2)+'\x0a',{'encoding':_0x40c58a(0x94),'mode':0x180}),renameSync(_0x1dbe18,_0x4e0d64);}catch(_0x246161){try{unlinkSync(_0x1dbe18);}catch{}throw _0x246161;}}export function resolveWriteConfigPath(_0x2acd4c){const _0x246103=a143_0x4f892a,_0x5b68fc=_0x2acd4c===_0x246103(0x93)?process[_0x246103(0xbd)]():homedir(),_0x211e5e=resolveConfigPath(_0x5b68fc);return _0x211e5e??resolve(_0x5b68fc,NEW_CONFIG_NAME);}function stringConfigValue(_0x2fc008){const _0x55f91b=a143_0x4f892a;return typeof _0x2fc008===_0x55f91b(0xcd)&&_0x2fc008[_0x55f91b(0xc2)]()?_0x2fc008[_0x55f91b(0xc2)]():undefined;}function appProfiles(_0x10dc33){const _0xc91138=a143_0x4f892a;return _0x10dc33[_0xc91138(0x8d)]&&typeof _0x10dc33[_0xc91138(0x8d)]===_0xc91138(0xc1)?_0x10dc33['apps']:{};}function resolveDefaultAppName(_0x8b3c62){const _0x32bc6a=a143_0x4f892a,_0x4c86bd=stringConfigValue(_0x8b3c62[_0x32bc6a(0xad)]);if(_0x4c86bd)return _0x4c86bd;return Object[_0x32bc6a(0xd5)](appProfiles(_0x8b3c62))[0x0];}function resolveTopLevelAppCode(_0x9eb0f8){const _0x1101d9=a143_0x4f892a;return stringConfigValue(_0x9eb0f8[_0x1101d9(0xbb)])||stringConfigValue(_0x9eb0f8['app']);}function buildConfig(_0xecacd0,_0x4333ab,_0xeb669d){const _0x1593ea=a143_0x4f892a,_0x27cb19=_0xeb669d?.['projectConfig']??{},_0x59ef64=_0xeb669d?.[_0x1593ea(0x8c)]??{},_0x4d1620=Object['keys'](_0x27cb19)['length']>0x0,_0x19b9dc=!_0x4d1620||_0x27cb19[_0x1593ea(0xab)]===!![],_0x507403=_0x4d1620?resolveDefaultAppName(_0x27cb19):undefined,_0x3c0dca=_0x19b9dc?resolveDefaultAppName(_0x59ef64):undefined,_0x2fdee4=stringConfigValue(_0x4333ab[_0x1593ea(0x9d)]),_0x4bf8d1=env(_0x1593ea(0xb5)),_0x4b98ab={};if(_0xecacd0[_0x1593ea(0x8d)]&&typeof _0xecacd0[_0x1593ea(0x8d)]===_0x1593ea(0xc1))for(const [_0x38ae61,_0x5ce9b4]of Object['entries'](_0xecacd0[_0x1593ea(0x8d)])){_0x5ce9b4&&typeof _0x5ce9b4===_0x1593ea(0xc1)&&_0x5ce9b4[_0x1593ea(0xbb)]&&(_0x4b98ab[_0x38ae61]=_0x5ce9b4);}const _0x7f76c6=_0xecacd0['defaultApp']||undefined,_0x1b3224=Object[_0x1593ea(0xd5)](_0x4b98ab)[_0x1593ea(0x9a)]>0x0,_0x2cd44d=_0x2fdee4||_0x507403||_0x4bf8d1||_0x3c0dca||_0x7f76c6||undefined,_0x491316=stringConfigValue(_0x4333ab[_0x1593ea(0xbb)]),_0x1ba4e2=_0x491316?Object[_0x1593ea(0xb6)](_0x4b98ab)[_0x1593ea(0x92)](([,_0x2bbc4a])=>_0x2bbc4a?.[_0x1593ea(0xbb)]===_0x491316):undefined,_0x10d623=_0x1ba4e2?.[0x0],_0x36e526=_0x1ba4e2?.[0x1];let _0x4157ad=_0x491316?_0x10d623:_0x2cd44d,_0x475d7c=_0x4157ad&&_0x4b98ab[_0x4157ad]?_0x4b98ab[_0x4157ad]:undefined;_0x491316&&_0x36e526&&(_0x475d7c=_0x36e526);const _0x5d0d3a=_0x491316?_0x36e526??_0x475d7c:_0x475d7c,_0x257a8f=!_0x2fdee4&&!_0x507403&&_0x4bf8d1&&_0x4157ad===_0x4bf8d1,_0x3e31eb=_0x2fdee4||(_0x257a8f?_0x4bf8d1:undefined)||(_0x491316?_0x10d623:undefined),_0x458954=_0x5d0d3a?.[_0x1593ea(0xbb)],_0x46dcf2=_0x4d1620?resolveTopLevelAppCode(_0x27cb19):undefined,_0x4c4c05=_0x19b9dc?resolveTopLevelAppCode(_0x59ef64):undefined,_0x467778=_0x2fdee4||_0x507403?_0x458954:undefined,_0x5ae965=!_0x2fdee4&&!_0x507403?_0x458954:undefined,_0x1a3c9c=_0x491316||_0x467778||_0x46dcf2||_0x5ae965||_0x4c4c05||undefined,_0x33a051=_0x4d1620?stringConfigValue(_0x27cb19[_0x1593ea(0x85)]):undefined,_0x3854f6=_0x19b9dc?stringConfigValue(_0x59ef64['env']):undefined,_0x22dd5e=_0x4333ab[_0x1593ea(0x85)]||_0x5d0d3a?.[_0x1593ea(0x85)]||_0x33a051||env(_0x1593ea(0x97))||_0x3854f6||_0xecacd0[_0x1593ea(0x85)]||DEFAULT_CONFIG_VALUES[_0x1593ea(0x85)],_0x1f7f49=_0x5d0d3a?.[_0x1593ea(0xb0)]||_0xecacd0[_0x1593ea(0xb0)]||DEFAULT_CONFIG_VALUES[_0x1593ea(0xb0)],_0x527161=env(_0x1593ea(0x8b))||_0x5d0d3a?.[_0x1593ea(0xb8)]||_0xecacd0[_0x1593ea(0xb8)]||undefined,_0x3f2d51=env(_0x1593ea(0x98))||_0x5d0d3a?.[_0x1593ea(0xc6)]||_0xecacd0[_0x1593ea(0xc6)]||undefined,_0x11edd3=_0x4333ab[_0x1593ea(0xa6)]||env(_0x1593ea(0xcb))||_0x5d0d3a?.[_0x1593ea(0xa6)]||_0xecacd0[_0x1593ea(0xa6)],_0x502981=normalizeLegacyOutputFormat(_0x11edd3),_0x1b1eb3=env(_0x1593ea(0x8e))||_0x5d0d3a?.[_0x1593ea(0xc5)]||_0xecacd0['pageSize'],_0x25f2ce=_0x1b1eb3?Number(_0x1b1eb3)||undefined:undefined,_0x3d3567=env('RISK_LEVEL')||env(_0x1593ea(0xb3))||_0x5d0d3a?.[_0x1593ea(0xbc)]||_0xecacd0['riskLevel']||_0xecacd0[_0x1593ea(0xa4)],_0x504982=_0x3d3567===_0x1593ea(0xc9)||_0x3d3567===_0x1593ea(0x87)?_0x3d3567:DEFAULT_CONFIG_VALUES['riskLevel'],_0x1fb01e=env(_0x1593ea(0xcc)),_0x290809=_0x1fb01e==='1'||_0x1fb01e===_0x1593ea(0xc4),_0xd47662=_0x5d0d3a?.[_0x1593ea(0xd7)]||_0xecacd0[_0x1593ea(0xd7)]||DEFAULT_CONFIG_VALUES[_0x1593ea(0xd7)],_0x37b7b8=isDaily(normalizeEnv(String(_0x22dd5e)))?_0x1593ea(0xdb):_0x1593ea(0xc0);return{'appCode':typeof _0x1a3c9c===_0x1593ea(0xcd)&&_0x1a3c9c[_0x1593ea(0xc2)]()?_0x1a3c9c[_0x1593ea(0xc2)]():undefined,'env':_0x37b7b8,'locale':_0x1f7f49,'cookie':_0x527161,'accessKey':_0x3f2d51,'format':_0x502981,'pageSize':_0x25f2ce,'riskLevel':_0x504982,'verbose':_0x290809,'apiDir':_0xd47662,'apps':_0x4b98ab,'defaultApp':_0x7f76c6,'currentApp':_0x1b3224?_0x4157ad:undefined,'explicitAppName':_0x3e31eb,'raw':_0xecacd0};}async function buildAuth(_0x37102d){const _0x357e29=a143_0x4f892a,{getCookie:_0x279faf}=await import(_0x357e29(0xd9)),_0x32c77e=_0x37102d[_0x357e29(0xb8)]||_0x279faf(),_0x3436e7=_0x32c77e?await getIsSessionValid():![];return{'cookie':_0x32c77e,'isLoggedIn':_0x3436e7,async 'getOrLogin'(){const _0x759d27=_0x357e29;if(_0x32c77e&&_0x3436e7)return _0x32c77e;throw CliErrors[_0x759d27(0xa9)]();}};}export function resolveApiFilePath(_0x5abc1e,_0x4dddee){const _0x18addd=a143_0x4f892a,_0x389354=resolve(process[_0x18addd(0xbd)](),_0x5abc1e),_0x4ed3d0=resolve(_0x389354,_0x18addd(0xd8));if(!_0x4dddee)return _0x4ed3d0;const _0x3fc9b5=readRawConfig(),_0x22e4eb=_0x3fc9b5[_0x18addd(0x8d)]&&typeof _0x3fc9b5[_0x18addd(0x8d)]===_0x18addd(0xc1)?_0x3fc9b5['apps']:{},_0x52caeb=Object[_0x18addd(0xb6)](_0x22e4eb)['find'](([,_0x56a4bc])=>_0x56a4bc?.[_0x18addd(0xbb)]===_0x4dddee);if(!_0x52caeb)return _0x4ed3d0;const [_0x3f8acb,_0x1a959f]=_0x52caeb,_0x4483ca=typeof _0x3fc9b5[_0x18addd(0xad)]===_0x18addd(0xcd)?_0x3fc9b5['defaultApp']:undefined;if(_0x1a959f?.[_0x18addd(0xd7)])return _0x4ed3d0;if(_0x4483ca&&_0x3f8acb!==_0x4483ca)return resolve(_0x389354,_0x3f8acb+_0x18addd(0xba));return _0x4ed3d0;}
1
+ const a143_0x33af28=a143_0x4c52;(function(_0x33d74b,_0x3c90ea){const _0x2bd47b=a143_0x4c52,_0x2bf189=_0x33d74b();while(!![]){try{const _0x1afb69=parseInt(_0x2bd47b(0x116))/0x1*(parseInt(_0x2bd47b(0x13b))/0x2)+-parseInt(_0x2bd47b(0x14b))/0x3+-parseInt(_0x2bd47b(0x108))/0x4*(parseInt(_0x2bd47b(0x154))/0x5)+parseInt(_0x2bd47b(0x109))/0x6+-parseInt(_0x2bd47b(0x136))/0x7*(parseInt(_0x2bd47b(0x119))/0x8)+parseInt(_0x2bd47b(0x11e))/0x9*(-parseInt(_0x2bd47b(0x13a))/0xa)+parseInt(_0x2bd47b(0x118))/0xb*(parseInt(_0x2bd47b(0x125))/0xc);if(_0x1afb69===_0x3c90ea)break;else _0x2bf189['push'](_0x2bf189['shift']());}catch(_0x15d251){_0x2bf189['push'](_0x2bf189['shift']());}}}(a143_0x20e2,0x7909c));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';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';function a143_0x20e2(){const _0x71896c=['authRequired','.lovrabet.json','keys','56185ljmDZQ','project','projectConfig','utf8','https://g.lovrabet.com/dist/lovrabet-skill','string','APP','set','.rabetbase.json','defaultApp','280PeSYkM','5219946Mozmnc','setRawCommand','appcode','COOKIE','Project','env','riskLevel','merged','data','trim','apps','migrated','inherit','107IFckrK','warn','9060381qniUMH','8hEGpGG','error','daily','length','ACCESS_KEY','2043rcqoMx','./auth/get-cookie.js','map','setLogPath','status','message','maxRisk','36syqBuY','filter','globalConfig','-api.ts','argv','userDomain','./utils/is-non-interactive.js','ENV','missing','\x0a\x20\x20','config','object','format','locale','production','MAX_RISK','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','6785065zMjKmd','read','get','template_base_url','14930IHanYd','244dmHPRz','cwd','RISK_LEVEL','stringify','find','api.ts','parse','accessKey','app','write','pageSize','cookie','./constant/domain.js','runtimeDomain','true','apiDir','2290470RFJVVO','values','empty','.lovrabetrc','entries','silent'];a143_0x20e2=function(){return _0x71896c;};return a143_0x20e2();}import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x5493ed){return process.env[`RABETBASE_${_0x5493ed}`]||process.env[`LOVRABET_${_0x5493ed}`]||undefined;}export const NEW_CONFIG_NAME=a143_0x33af28(0x106);export const CONFIG_NAMES=[a143_0x33af28(0x106),a143_0x33af28(0x152),a143_0x33af28(0x14e)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a143_0x33af28(0x126)](_0x7f93c6=>_0x7f93c6!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x35d453){for(const _0x4f80a6 of CONFIG_NAMES){const _0x343e96=resolve(_0x35d453,_0x4f80a6);if(existsSync(_0x343e96))return _0x343e96;}return undefined;}export function findProjectRootDirectory(_0x6f6518=process['cwd']()){let _0x182097=resolve(_0x6f6518);const {root:_0x2e9487}=parse(_0x182097),_0x32fc3e=homedir();while(!![]){if(resolveConfigPath(_0x182097)){if(_0x182097===_0x32fc3e)break;return _0x182097;}if(_0x182097===_0x2e9487||_0x182097===_0x32fc3e)break;const _0x2cd5ef=dirname(_0x182097);if(_0x2cd5ef===_0x182097)break;_0x182097=_0x2cd5ef;}return resolve(_0x6f6518);}export async function createContext(_0xa79920){const _0x2ca28b=a143_0x33af28,{config:_0x214a1e,layers:_0x17b9e1}=readRawConfigWithLayers(),_0x49a634=buildConfig(_0x214a1e,_0xa79920,_0x17b9e1),{initEnv:_0x35fbfb}=await import('./constant/env.js');if(_0x49a634['env'])_0x35fbfb(_0x49a634[_0x2ca28b(0x10e)]);else _0xa79920[_0x2ca28b(0x10e)]&&typeof _0xa79920[_0x2ca28b(0x10e)]==='string'&&_0x35fbfb(_0xa79920['env']);const {initDomains:_0x5a0177,getUserDomain:_0x28d83b,getApiDomain:_0x868918}=await import(_0x2ca28b(0x147));_0x5a0177({'apiDomain':_0x214a1e['apiDomain']||undefined,'userDomain':_0x214a1e[_0x2ca28b(0x12a)]||undefined,'runtimeDomain':_0x214a1e[_0x2ca28b(0x148)]||undefined});const _0x5837b9={'apiDomain':_0x868918(),'userDomain':_0x28d83b()},_0x1b8346=await buildAuth(_0x49a634);logger[_0x2ca28b(0x121)](process[_0x2ca28b(0x13c)]());const _0x315e64=(CLI_BIN_NAME+'\x20'+process[_0x2ca28b(0x129)]['slice'](0x2)['join']('\x20'))[_0x2ca28b(0x112)]();logger[_0x2ca28b(0x10a)](_0x315e64);const {isNonInteractive:_0x292efb}=await import(_0x2ca28b(0x12b)),_0x53a2ea=_0x292efb(_0xa79920);return{'config':_0x49a634,'auth':_0x1b8346,'logger':logger,'env':_0x5837b9,'nonInteractive':_0x53a2ea};}export function buildConfigFromFlags(_0x4d4b90){const {config:_0x33ba25,layers:_0x56df70}=readRawConfigWithLayers();return buildConfig(_0x33ba25,_0x4d4b90,_0x56df70);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x5b3472){const _0x106abe=a143_0x33af28;if(!existsSync(_0x5b3472))return{'status':_0x106abe(0x12d)};try{const _0x56a914=readFileSync(_0x5b3472,{'encoding':'utf8'});if(!_0x56a914?.[_0x106abe(0x112)]())return{'status':_0x106abe(0x14d)};const _0x1c823c=JSON[_0x106abe(0x141)](_0x56a914);return{'status':'ok','data':_0x1c823c};}catch(_0x173c34){return{'status':_0x106abe(0x11a),'message':_0x173c34 instanceof Error?_0x173c34[_0x106abe(0x123)]:String(_0x173c34)};}}function parseCliConfigJsonFile(_0x13d8ae,_0x1f744e,_0x47871b){const _0x12ffe6=a143_0x33af28,_0x17f4fa=inspectCliConfigJsonFile(_0x13d8ae);if(_0x17f4fa[_0x12ffe6(0x122)]===_0x12ffe6(0x12d)||_0x17f4fa[_0x12ffe6(0x122)]===_0x12ffe6(0x14d))return{};if(_0x17f4fa[_0x12ffe6(0x122)]==='ok')return _0x17f4fa[_0x12ffe6(0x111)];return _0x1f744e===_0x12ffe6(0x117)&&_0x47871b&&console['error'](CLI_BIN_NAME+':\x20'+_0x47871b+_0x12ffe6(0x135)+_0x13d8ae+_0x12ffe6(0x12e)+_0x17f4fa[_0x12ffe6(0x123)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x1af6e7){const _0x3978c0=a143_0x33af28;if(!_0x1af6e7||typeof _0x1af6e7!==_0x3978c0(0x130))return{'config':{},'migrated':![]};const _0x48bb0a={..._0x1af6e7},_0x29828e=_0x48bb0a['apps']&&typeof _0x48bb0a[_0x3978c0(0x113)]==='object'?{..._0x48bb0a[_0x3978c0(0x113)]}:{},_0x1e61c8=Object[_0x3978c0(0x153)](_0x29828e)[_0x3978c0(0x11c)],_0x681af2=_0x48bb0a['appcode']||_0x48bb0a['app'];let _0x5999d5=![];if(_0x681af2&&_0x1e61c8===0x0){const _0x595ee4=typeof _0x48bb0a[_0x3978c0(0x107)]===_0x3978c0(0x159)&&_0x48bb0a[_0x3978c0(0x107)][_0x3978c0(0x112)]()?_0x48bb0a[_0x3978c0(0x107)]:String(_0x681af2)[_0x3978c0(0x112)]();_0x29828e[_0x595ee4]={'appcode':String(_0x681af2)[_0x3978c0(0x112)](),..._0x48bb0a[_0x3978c0(0x10e)]!=null?{'env':_0x48bb0a[_0x3978c0(0x10e)]}:{},..._0x48bb0a[_0x3978c0(0x14a)]!=null?{'apiDir':_0x48bb0a[_0x3978c0(0x14a)]}:{},..._0x48bb0a[_0x3978c0(0x146)]!=null?{'cookie':_0x48bb0a[_0x3978c0(0x146)]}:{},..._0x48bb0a['accessKey']!=null?{'accessKey':_0x48bb0a[_0x3978c0(0x142)]}:{},..._0x48bb0a[_0x3978c0(0x131)]!=null?{'format':_0x48bb0a[_0x3978c0(0x131)]}:{},..._0x48bb0a[_0x3978c0(0x145)]!=null?{'pageSize':_0x48bb0a[_0x3978c0(0x145)]}:{},..._0x48bb0a[_0x3978c0(0x10f)]!=null?{'riskLevel':_0x48bb0a[_0x3978c0(0x10f)]}:{},..._0x48bb0a['locale']!=null?{'locale':_0x48bb0a[_0x3978c0(0x132)]}:{}},_0x48bb0a[_0x3978c0(0x113)]=_0x29828e;if(!_0x48bb0a[_0x3978c0(0x107)])_0x48bb0a[_0x3978c0(0x107)]=_0x595ee4;_0x5999d5=!![];}return('appcode'in _0x48bb0a||_0x3978c0(0x143)in _0x48bb0a)&&(delete _0x48bb0a[_0x3978c0(0x10b)],delete _0x48bb0a[_0x3978c0(0x143)],_0x5999d5=!![]),{'config':_0x48bb0a,'migrated':_0x5999d5};}function writeNormalizedConfigIfNeeded(_0x456f8d,_0x58224b){const _0x56812a=a143_0x33af28,_0x482240=JSON[_0x56812a(0x13e)](_0x58224b,null,0x2)+'\x0a';if(normalizedWriteCache[_0x56812a(0x138)](_0x456f8d)===_0x482240)return;writeConfigFile(_0x456f8d,_0x58224b),normalizedWriteCache[_0x56812a(0x105)](_0x456f8d,_0x482240);}function parseAndNormalizeConfig(_0x352d3f,_0x5ba080,_0x2f5a97){const _0x44465f=a143_0x33af28,_0x3ce06c=parseCliConfigJsonFile(_0x352d3f,_0x5ba080,_0x2f5a97),_0x3dd752=normalizeLegacyConfigShape(_0x3ce06c);if(_0x3dd752[_0x44465f(0x114)])try{writeNormalizedConfigIfNeeded(_0x352d3f,_0x3dd752[_0x44465f(0x12f)]);}catch{}return _0x3dd752[_0x44465f(0x12f)];}export function loadRawConfigLayers(_0x7c2703){const _0x3f6f87=a143_0x33af28;let _0x10c555={},_0x195b28={};const _0x3f4852=resolveConfigPath(homedir());_0x3f4852&&(_0x10c555=parseAndNormalizeConfig(_0x3f4852,_0x3f6f87(0x117),'Global'));const _0x2f0f59=_0x7c2703??findProjectRootDirectory(),_0x3f9d5d=resolveConfigPath(_0x2f0f59);return _0x3f9d5d&&(_0x195b28=parseAndNormalizeConfig(_0x3f9d5d,_0x3f6f87(0x117),_0x3f6f87(0x10d))),{'globalPath':_0x3f4852,'projectPath':_0x3f9d5d,'globalConfig':_0x10c555,'projectConfig':_0x195b28};}const INHERIT_WHITELIST=[a143_0x33af28(0x146),a143_0x33af28(0x142),a143_0x33af28(0x132),'format',a143_0x33af28(0x10f),a143_0x33af28(0x145)];function mergeRawConfigLayers(_0x434433){const _0x25df75=a143_0x33af28,{globalConfig:_0x4cd6ce,projectConfig:_0x49648d}=_0x434433,_0x24147b=Object[_0x25df75(0x153)](_0x49648d)[_0x25df75(0x11c)]>0x0;if(!_0x24147b)return mergeGlobalOnly(_0x4cd6ce);if(_0x49648d[_0x25df75(0x115)]===!![])return mergeFullInherit(_0x4cd6ce,_0x49648d);if(_0x49648d[_0x25df75(0x115)]===![])return mergeIsolated(_0x49648d);return mergeProjectFirst(_0x4cd6ce,_0x49648d);}function mergeGlobalOnly(_0x35c8b9){const _0x3c5076=a143_0x33af28,_0x3a3ded={..._0x35c8b9},_0x5364bd=_0x35c8b9['apps']&&typeof _0x35c8b9['apps']===_0x3c5076(0x130)?_0x35c8b9['apps']:{};Object['keys'](_0x5364bd)[_0x3c5076(0x11c)]>0x0&&(_0x3a3ded['apps']=_0x5364bd);if(_0x35c8b9[_0x3c5076(0x107)])_0x3a3ded[_0x3c5076(0x107)]=_0x35c8b9[_0x3c5076(0x107)];else{const _0x1e35e5=Object[_0x3c5076(0x153)](_0x5364bd);if(_0x1e35e5[_0x3c5076(0x11c)]>0x0)_0x3a3ded[_0x3c5076(0x107)]=_0x1e35e5[0x0];}return _0x3a3ded;}function mergeIsolated(_0x400d29){const _0x48b03d=a143_0x33af28,_0x205ac4={..._0x400d29};delete _0x205ac4[_0x48b03d(0x115)];const _0x18293a=_0x400d29[_0x48b03d(0x113)]&&typeof _0x400d29[_0x48b03d(0x113)]===_0x48b03d(0x130)?_0x400d29[_0x48b03d(0x113)]:{};Object['keys'](_0x18293a)[_0x48b03d(0x11c)]>0x0?_0x205ac4[_0x48b03d(0x113)]=_0x18293a:delete _0x205ac4['apps'];if(_0x48b03d(0x107)in _0x400d29)_0x205ac4[_0x48b03d(0x107)]=_0x400d29[_0x48b03d(0x107)];else Object[_0x48b03d(0x153)](_0x18293a)[_0x48b03d(0x11c)]>0x0?_0x205ac4[_0x48b03d(0x107)]=Object[_0x48b03d(0x153)](_0x18293a)[0x0]:delete _0x205ac4[_0x48b03d(0x107)];return _0x205ac4;}function mergeProjectFirst(_0x4c1b21,_0x35d1ef){const _0x1786ae=a143_0x33af28,_0x42e225={..._0x35d1ef};delete _0x42e225[_0x1786ae(0x115)];for(const _0xcfc61e of INHERIT_WHITELIST){!(_0xcfc61e in _0x42e225)&&_0xcfc61e in _0x4c1b21&&(_0x42e225[_0xcfc61e]=_0x4c1b21[_0xcfc61e]);}const _0x5a192f=_0x35d1ef[_0x1786ae(0x113)]&&typeof _0x35d1ef[_0x1786ae(0x113)]===_0x1786ae(0x130)?_0x35d1ef[_0x1786ae(0x113)]:{};Object[_0x1786ae(0x153)](_0x5a192f)[_0x1786ae(0x11c)]>0x0?_0x42e225[_0x1786ae(0x113)]=_0x5a192f:delete _0x42e225[_0x1786ae(0x113)];if(_0x1786ae(0x107)in _0x35d1ef)_0x42e225['defaultApp']=_0x35d1ef['defaultApp'];else Object[_0x1786ae(0x153)](_0x5a192f)[_0x1786ae(0x11c)]>0x0?_0x42e225['defaultApp']=Object[_0x1786ae(0x153)](_0x5a192f)[0x0]:delete _0x42e225['defaultApp'];return _0x42e225;}function mergeFullInherit(_0x43d312,_0x477b38){const _0x21f278=a143_0x33af28,_0x5851d6=_0x43d312['apps']&&typeof _0x43d312[_0x21f278(0x113)]===_0x21f278(0x130)?_0x43d312['apps']:{},_0x2b61ca=_0x477b38[_0x21f278(0x113)]&&typeof _0x477b38[_0x21f278(0x113)]===_0x21f278(0x130)?_0x477b38[_0x21f278(0x113)]:{},_0x184ba4={..._0x5851d6,..._0x2b61ca},_0x4bcf64={..._0x43d312,..._0x477b38};delete _0x4bcf64[_0x21f278(0x115)];Object['keys'](_0x184ba4)['length']>0x0&&(_0x4bcf64[_0x21f278(0x113)]=_0x184ba4);if(_0x21f278(0x107)in _0x477b38)_0x4bcf64[_0x21f278(0x107)]=_0x477b38[_0x21f278(0x107)];else{if(Object[_0x21f278(0x153)](_0x2b61ca)['length']>0x0)_0x4bcf64[_0x21f278(0x107)]=Object['keys'](_0x2b61ca)[0x0];else{if(_0x43d312[_0x21f278(0x107)])_0x4bcf64[_0x21f278(0x107)]=_0x43d312[_0x21f278(0x107)];else{const _0x3180b7=Object[_0x21f278(0x153)](_0x5851d6);if(_0x3180b7[_0x21f278(0x11c)]>0x0)_0x4bcf64[_0x21f278(0x107)]=_0x3180b7[0x0];}}}return _0x4bcf64;}export function readRawConfigWithLayers(_0x51aa5b){const _0x13f685=loadRawConfigLayers(_0x51aa5b);return{'config':mergeRawConfigLayers(_0x13f685),'layers':_0x13f685};}export function readRawConfig(_0x2a1bfa){return mergeRawConfigLayers(loadRawConfigLayers(_0x2a1bfa));}export function getConfigAppCode(_0xe04fc7){const _0x28b3d9=a143_0x33af28,_0x4c7892=readRawConfig(_0xe04fc7);if(_0x4c7892['apps']&&typeof _0x4c7892[_0x28b3d9(0x113)]===_0x28b3d9(0x130)){const _0x3e6d7f=_0x4c7892[_0x28b3d9(0x107)];if(_0x3e6d7f&&_0x4c7892['apps'][_0x3e6d7f]?.['appcode'])return String(_0x4c7892[_0x28b3d9(0x113)][_0x3e6d7f][_0x28b3d9(0x10b)])[_0x28b3d9(0x112)]();const _0x1f0817=Object[_0x28b3d9(0x14c)](_0x4c7892[_0x28b3d9(0x113)])[0x0];if(_0x1f0817?.['appcode'])return String(_0x1f0817[_0x28b3d9(0x10b)])[_0x28b3d9(0x112)]();}const _0x53f3a8=_0x4c7892[_0x28b3d9(0x10b)]||_0x4c7892[_0x28b3d9(0x143)];if(typeof _0x53f3a8!==_0x28b3d9(0x159)||_0x53f3a8[_0x28b3d9(0x112)]()==='')return undefined;return _0x53f3a8['trim']();}export function getMultiAppConfigs(_0x458edd=a143_0x33af28(0x155),_0x241f00){const _0x1d4e3d=a143_0x33af28,_0x5d25f2=loadRawConfigLayers(_0x241f00);let _0x33101f,_0x363670;if(_0x458edd===_0x1d4e3d(0x110)){const _0x355f7b=_0x5d25f2['globalConfig'][_0x1d4e3d(0x113)]&&typeof _0x5d25f2[_0x1d4e3d(0x127)]['apps']==='object'?_0x5d25f2['globalConfig'][_0x1d4e3d(0x113)]:{},_0x5d9352=_0x5d25f2[_0x1d4e3d(0x156)][_0x1d4e3d(0x113)]&&typeof _0x5d25f2[_0x1d4e3d(0x156)]['apps']===_0x1d4e3d(0x130)?_0x5d25f2[_0x1d4e3d(0x156)][_0x1d4e3d(0x113)]:{};_0x33101f={..._0x355f7b,..._0x5d9352};const _0x3d98f4=readRawConfig(_0x241f00);_0x363670=_0x3d98f4[_0x1d4e3d(0x107)];}else _0x33101f=_0x5d25f2[_0x1d4e3d(0x156)][_0x1d4e3d(0x113)],_0x363670=_0x5d25f2[_0x1d4e3d(0x156)]['defaultApp'];if(!_0x33101f||typeof _0x33101f!=='object'||Object[_0x1d4e3d(0x153)](_0x33101f)['length']===0x0)return null;return Object[_0x1d4e3d(0x14f)](_0x33101f)[_0x1d4e3d(0x120)](([_0x10a0cc,_0x21a627])=>({'name':_0x10a0cc,'appcode':_0x21a627?.[_0x1d4e3d(0x10b)]||'','isDefault':_0x10a0cc===_0x363670,'env':_0x21a627?.['env'],'apiDir':_0x21a627?.[_0x1d4e3d(0x14a)],'cookie':_0x21a627?.['cookie']||undefined}))[_0x1d4e3d(0x126)](_0x5f065a=>_0x5f065a[_0x1d4e3d(0x10b)]);}export function getTemplateBaseUrl(_0x5b73fe){const _0x200164=a143_0x33af28,_0x24118f=readRawConfig(_0x5b73fe);if(_0x24118f[_0x200164(0x139)]&&typeof _0x24118f[_0x200164(0x139)]===_0x200164(0x159))return _0x24118f[_0x200164(0x139)]['replace'](/\/$/,'');return _0x200164(0x158);}export function readConfigFile(_0x2d3a63){const _0x39c65a=a143_0x33af28;return parseAndNormalizeConfig(_0x2d3a63,_0x39c65a(0x150));}export function writeConfigFile(_0x57a7d3,_0x5a0f24){const _0x5ce211=a143_0x33af28,_0x19c5e0=dirname(_0x57a7d3);!existsSync(_0x19c5e0)&&mkdirSync(_0x19c5e0,{'recursive':!![]});const _0x18f7cb=_0x57a7d3+'.tmp';try{writeFileSync(_0x18f7cb,JSON[_0x5ce211(0x13e)](_0x5a0f24,null,0x2)+'\x0a',{'encoding':_0x5ce211(0x157),'mode':0x180}),renameSync(_0x18f7cb,_0x57a7d3);}catch(_0x5ab432){try{unlinkSync(_0x18f7cb);}catch{}throw _0x5ab432;}}export function resolveWriteConfigPath(_0x5764fc){const _0x208328=a143_0x33af28,_0xde2283=_0x5764fc===_0x208328(0x155)?process[_0x208328(0x13c)]():homedir(),_0x520304=resolveConfigPath(_0xde2283);return _0x520304??resolve(_0xde2283,NEW_CONFIG_NAME);}function stringConfigValue(_0x59aeb0){const _0x25bc23=a143_0x33af28;return typeof _0x59aeb0===_0x25bc23(0x159)&&_0x59aeb0[_0x25bc23(0x112)]()?_0x59aeb0['trim']():undefined;}function appProfiles(_0x3e50eb){const _0x150fe0=a143_0x33af28;return _0x3e50eb[_0x150fe0(0x113)]&&typeof _0x3e50eb['apps']===_0x150fe0(0x130)?_0x3e50eb[_0x150fe0(0x113)]:{};}function resolveDefaultAppName(_0x106772){const _0x3383b1=stringConfigValue(_0x106772['defaultApp']);if(_0x3383b1)return _0x3383b1;return Object['keys'](appProfiles(_0x106772))[0x0];}function resolveTopLevelAppCode(_0x3f912e){const _0xbe4c8=a143_0x33af28;return stringConfigValue(_0x3f912e[_0xbe4c8(0x10b)])||stringConfigValue(_0x3f912e['app']);}function a143_0x4c52(_0xbb4c6,_0xcec1d7){_0xbb4c6=_0xbb4c6-0x105;const _0x20e25b=a143_0x20e2();let _0x4c5286=_0x20e25b[_0xbb4c6];return _0x4c5286;}function buildConfig(_0x469d75,_0x58a5fc,_0x30a20d){const _0x197d1b=a143_0x33af28,_0x3645cd=_0x30a20d?.[_0x197d1b(0x156)]??{},_0x4bed33=_0x30a20d?.[_0x197d1b(0x127)]??{},_0x1b5baf=Object[_0x197d1b(0x153)](_0x3645cd)[_0x197d1b(0x11c)]>0x0,_0x178553=!_0x1b5baf||_0x3645cd[_0x197d1b(0x115)]===!![],_0x58a8dc=_0x1b5baf?resolveDefaultAppName(_0x3645cd):undefined,_0x2cc2a4=_0x178553?resolveDefaultAppName(_0x4bed33):undefined,_0x44b403=stringConfigValue(_0x58a5fc['app']),_0x1a5ed5=env(_0x197d1b(0x15a)),_0x239753={};if(_0x469d75[_0x197d1b(0x113)]&&typeof _0x469d75[_0x197d1b(0x113)]===_0x197d1b(0x130))for(const [_0x2557a5,_0x255456]of Object[_0x197d1b(0x14f)](_0x469d75['apps'])){_0x255456&&typeof _0x255456===_0x197d1b(0x130)&&_0x255456[_0x197d1b(0x10b)]&&(_0x239753[_0x2557a5]=_0x255456);}const _0x372247=_0x469d75[_0x197d1b(0x107)]||undefined,_0x57d3d1=Object[_0x197d1b(0x153)](_0x239753)['length']>0x0,_0x5db44c=_0x44b403||_0x58a8dc||_0x1a5ed5||_0x2cc2a4||_0x372247||undefined,_0x4e7ab3=stringConfigValue(_0x58a5fc['appcode']),_0x45f13a=_0x4e7ab3?Object['entries'](_0x239753)[_0x197d1b(0x13f)](([,_0x46fe87])=>_0x46fe87?.[_0x197d1b(0x10b)]===_0x4e7ab3):undefined,_0x2f47e7=_0x45f13a?.[0x0],_0x229f04=_0x45f13a?.[0x1];let _0x109c6c=_0x4e7ab3?_0x2f47e7:_0x5db44c,_0xac7dcf=_0x109c6c&&_0x239753[_0x109c6c]?_0x239753[_0x109c6c]:undefined;_0x4e7ab3&&_0x229f04&&(_0xac7dcf=_0x229f04);const _0x1fc87f=_0x4e7ab3?_0x229f04??_0xac7dcf:_0xac7dcf,_0x552ffb=!_0x44b403&&!_0x58a8dc&&_0x1a5ed5&&_0x109c6c===_0x1a5ed5,_0x38289c=_0x44b403||(_0x552ffb?_0x1a5ed5:undefined)||(_0x4e7ab3?_0x2f47e7:undefined),_0x4744d4=_0x1fc87f?.[_0x197d1b(0x10b)],_0x132fca=_0x1b5baf?resolveTopLevelAppCode(_0x3645cd):undefined,_0x5c867e=_0x178553?resolveTopLevelAppCode(_0x4bed33):undefined,_0xb69898=_0x44b403||_0x58a8dc?_0x4744d4:undefined,_0x1e50b5=!_0x44b403&&!_0x58a8dc?_0x4744d4:undefined,_0x313bb8=_0x4e7ab3||_0xb69898||_0x132fca||_0x1e50b5||_0x5c867e||undefined,_0x57755a=_0x1b5baf?stringConfigValue(_0x3645cd[_0x197d1b(0x10e)]):undefined,_0x5199e4=_0x178553?stringConfigValue(_0x4bed33[_0x197d1b(0x10e)]):undefined,_0x627eb=_0x58a5fc['env']||_0x1fc87f?.[_0x197d1b(0x10e)]||_0x57755a||env(_0x197d1b(0x12c))||_0x5199e4||_0x469d75[_0x197d1b(0x10e)]||DEFAULT_CONFIG_VALUES[_0x197d1b(0x10e)],_0x2eef58=_0x1fc87f?.[_0x197d1b(0x132)]||_0x469d75[_0x197d1b(0x132)]||DEFAULT_CONFIG_VALUES[_0x197d1b(0x132)],_0x21a1f9=env(_0x197d1b(0x10c))||_0x1fc87f?.['cookie']||_0x469d75['cookie']||undefined,_0x28c66a=env(_0x197d1b(0x11d))||_0x1fc87f?.[_0x197d1b(0x142)]||_0x469d75[_0x197d1b(0x142)]||undefined,_0x2ec6b3=_0x58a5fc[_0x197d1b(0x131)]||env('FORMAT')||_0x1fc87f?.[_0x197d1b(0x131)]||_0x469d75[_0x197d1b(0x131)],_0x110c28=normalizeLegacyOutputFormat(_0x2ec6b3),_0x76ae3c=env('PAGE_SIZE')||_0x1fc87f?.[_0x197d1b(0x145)]||_0x469d75['pageSize'],_0x2917d6=_0x76ae3c?Number(_0x76ae3c)||undefined:undefined,_0x420b54=env(_0x197d1b(0x13d))||env(_0x197d1b(0x134))||_0x1fc87f?.[_0x197d1b(0x10f)]||_0x469d75['riskLevel']||_0x469d75[_0x197d1b(0x124)],_0x2a03dc=_0x420b54===_0x197d1b(0x137)||_0x420b54===_0x197d1b(0x144)?_0x420b54:DEFAULT_CONFIG_VALUES[_0x197d1b(0x10f)],_0x2e4b93=env('VERBOSE'),_0x5a7768=_0x2e4b93==='1'||_0x2e4b93===_0x197d1b(0x149),_0x3a6a85=_0x1fc87f?.[_0x197d1b(0x14a)]||_0x469d75[_0x197d1b(0x14a)]||DEFAULT_CONFIG_VALUES[_0x197d1b(0x14a)],_0x350055=isDaily(normalizeEnv(String(_0x627eb)))?_0x197d1b(0x11b):_0x197d1b(0x133);return{'appCode':typeof _0x313bb8===_0x197d1b(0x159)&&_0x313bb8['trim']()?_0x313bb8['trim']():undefined,'env':_0x350055,'locale':_0x2eef58,'cookie':_0x21a1f9,'accessKey':_0x28c66a,'format':_0x110c28,'pageSize':_0x2917d6,'riskLevel':_0x2a03dc,'verbose':_0x5a7768,'apiDir':_0x3a6a85,'apps':_0x239753,'defaultApp':_0x372247,'currentApp':_0x57d3d1?_0x109c6c:undefined,'explicitAppName':_0x38289c,'raw':_0x469d75};}async function buildAuth(_0x3e335d){const _0x2315be=a143_0x33af28,{getCookie:_0x4b232e}=await import(_0x2315be(0x11f)),_0x3621a2=_0x3e335d['cookie']||_0x4b232e(),_0x4c64e5=_0x3621a2?await getIsSessionValid():![];return{'cookie':_0x3621a2,'isLoggedIn':_0x4c64e5,async 'getOrLogin'(){const _0x8f94be=_0x2315be;if(_0x3621a2&&_0x4c64e5)return _0x3621a2;throw CliErrors[_0x8f94be(0x151)]();}};}export function resolveApiFilePath(_0x2b71ea,_0x151c25){const _0x13bda2=a143_0x33af28,_0x415ec8=resolve(process['cwd'](),_0x2b71ea),_0x2b9aff=resolve(_0x415ec8,_0x13bda2(0x140));if(!_0x151c25)return _0x2b9aff;const _0x46dfd1=readRawConfig(),_0x3f96fc=_0x46dfd1['apps']&&typeof _0x46dfd1[_0x13bda2(0x113)]===_0x13bda2(0x130)?_0x46dfd1[_0x13bda2(0x113)]:{},_0x239a4f=Object['entries'](_0x3f96fc)[_0x13bda2(0x13f)](([,_0x1e79b2])=>_0x1e79b2?.[_0x13bda2(0x10b)]===_0x151c25);if(!_0x239a4f)return _0x2b9aff;const [_0x3a0b77,_0x123929]=_0x239a4f,_0x1b5c8a=typeof _0x46dfd1[_0x13bda2(0x107)]===_0x13bda2(0x159)?_0x46dfd1[_0x13bda2(0x107)]:undefined;if(_0x123929?.[_0x13bda2(0x14a)])return _0x2b9aff;if(_0x1b5c8a&&_0x3a0b77!==_0x1b5c8a)return resolve(_0x415ec8,_0x3a0b77+_0x13bda2(0x128));return _0x2b9aff;}
@@ -1 +1 @@
1
- (function(_0x29f4b7,_0x2bb9ae){const _0x270f62=a144_0x405c,_0x409569=_0x29f4b7();while(!![]){try{const _0x7a561b=parseInt(_0x270f62(0xd4))/0x1*(-parseInt(_0x270f62(0xcf))/0x2)+-parseInt(_0x270f62(0xd3))/0x3*(-parseInt(_0x270f62(0xd9))/0x4)+-parseInt(_0x270f62(0xda))/0x5+-parseInt(_0x270f62(0xd5))/0x6*(parseInt(_0x270f62(0xe1))/0x7)+-parseInt(_0x270f62(0xd2))/0x8+-parseInt(_0x270f62(0xe0))/0x9*(-parseInt(_0x270f62(0xcc))/0xa)+parseInt(_0x270f62(0xce))/0xb*(parseInt(_0x270f62(0xd8))/0xc);if(_0x7a561b===_0x2bb9ae)break;else _0x409569['push'](_0x409569['shift']());}catch(_0x3a2f83){_0x409569['push'](_0x409569['shift']());}}}(a144_0x5292,0x24be1));function a144_0x405c(_0x21fe4b,_0x15c530){_0x21fe4b=_0x21fe4b-0xcc;const _0x529206=a144_0x5292();let _0x405c7f=_0x529206[_0x21fe4b];return _0x405c7f;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x47afd3){const _0x497407=a144_0x405c,_0x40826f=[],_0x26ed03=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1137d9;while((_0x1137d9=_0x26ed03[_0x497407(0xdc)](_0x47afd3))!==null){_0x40826f['push']({'datasetCode':_0x1137d9[0x1],'tableName':_0x1137d9[0x2],'name':_0x1137d9[0x3],'alias':_0x1137d9[0x4]});}return _0x40826f;}function a144_0x5292(){const _0x50634c=['exec','has','alias','get','5382hhtBHJ','21kQzzDc','20mBAaZl','api.ts','11LujzQX','502914pxdfHy','utf-8','datasetCode','116152TpRNTb','26757huqIWp','1OlVaiy','375930RyqMHh','find','set','8282880SvFTuY','4GWsEBz','479585zJaylZ','cwd'];a144_0x5292=function(){return _0x50634c;};return a144_0x5292();}export function loadAliasMap(_0x1409d6,_0x53a487,_0x533012){const _0x3e5c95=a144_0x405c,_0x1a4414=_0x533012??resolve(process[_0x3e5c95(0xdb)](),_0x1409d6,_0x3e5c95(0xcd));if(cache[_0x3e5c95(0xdd)](_0x1a4414))return cache[_0x3e5c95(0xdf)](_0x1a4414);if(!existsSync(_0x1a4414))return cache[_0x3e5c95(0xd7)](_0x1a4414,[]),[];try{const _0x289d84=readFileSync(_0x1a4414,_0x3e5c95(0xd0)),_0x3a3a18=parseApiFile(_0x289d84);return cache[_0x3e5c95(0xd7)](_0x1a4414,_0x3a3a18),_0x3a3a18;}catch{return cache[_0x3e5c95(0xd7)](_0x1a4414,[]),[];}}export function resolveAlias(_0x7f6034,_0x1f2477,_0x5a53fc,_0x2ca3d7){const _0x288bb7=a144_0x405c;if(!_0x1f2477)return undefined;const _0x5da0ae=loadAliasMap(_0x7f6034,_0x5a53fc,_0x2ca3d7),_0x235631=_0x5da0ae[_0x288bb7(0xd6)](_0x389647=>_0x389647[_0x288bb7(0xde)]===_0x1f2477);return _0x235631?.[_0x288bb7(0xd1)];}export function listAliases(_0x190eae,_0x188bb6,_0x2e9c51){return loadAliasMap(_0x190eae,_0x188bb6,_0x2e9c51);}
1
+ function a144_0x1dfc(_0x5b6319,_0x2af259){_0x5b6319=_0x5b6319-0x1b0;const _0x21d912=a144_0x21d9();let _0x1dfc7c=_0x21d912[_0x5b6319];return _0x1dfc7c;}(function(_0x4cfff2,_0x1a967e){const _0x3a0596=a144_0x1dfc,_0x55c754=_0x4cfff2();while(!![]){try{const _0x50348e=-parseInt(_0x3a0596(0x1b6))/0x1*(parseInt(_0x3a0596(0x1b0))/0x2)+parseInt(_0x3a0596(0x1bf))/0x3+-parseInt(_0x3a0596(0x1be))/0x4*(-parseInt(_0x3a0596(0x1bd))/0x5)+parseInt(_0x3a0596(0x1bb))/0x6*(parseInt(_0x3a0596(0x1b8))/0x7)+-parseInt(_0x3a0596(0x1b9))/0x8+parseInt(_0x3a0596(0x1b7))/0x9*(parseInt(_0x3a0596(0x1bc))/0xa)+-parseInt(_0x3a0596(0x1b4))/0xb;if(_0x50348e===_0x1a967e)break;else _0x55c754['push'](_0x55c754['shift']());}catch(_0x1c5d1f){_0x55c754['push'](_0x55c754['shift']());}}}(a144_0x21d9,0x86389));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a144_0x21d9(){const _0x2aff9f=['set','264QzUyvL','4792990XndonT','415sTRnJH','24332MrsEAB','2008332GYnIUn','utf-8','exec','34Xjiuqz','has','api.ts','get','21431707SeQwzf','find','3403XpTevX','9KuSDII','152138pTpvKe','431768YrJuHL'];a144_0x21d9=function(){return _0x2aff9f;};return a144_0x21d9();}function parseApiFile(_0x5cb22d){const _0x253bdd=a144_0x1dfc,_0x84f6b6=[],_0x573320=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x279989;while((_0x279989=_0x573320[_0x253bdd(0x1c1)](_0x5cb22d))!==null){_0x84f6b6['push']({'datasetCode':_0x279989[0x1],'tableName':_0x279989[0x2],'name':_0x279989[0x3],'alias':_0x279989[0x4]});}return _0x84f6b6;}export function loadAliasMap(_0x199727,_0x3b5689,_0x38e196){const _0x4bccb8=a144_0x1dfc,_0x5ea025=_0x38e196??resolve(process['cwd'](),_0x199727,_0x4bccb8(0x1b2));if(cache[_0x4bccb8(0x1b1)](_0x5ea025))return cache[_0x4bccb8(0x1b3)](_0x5ea025);if(!existsSync(_0x5ea025))return cache[_0x4bccb8(0x1ba)](_0x5ea025,[]),[];try{const _0x9ac76f=readFileSync(_0x5ea025,_0x4bccb8(0x1c0)),_0x436740=parseApiFile(_0x9ac76f);return cache[_0x4bccb8(0x1ba)](_0x5ea025,_0x436740),_0x436740;}catch{return cache[_0x4bccb8(0x1ba)](_0x5ea025,[]),[];}}export function resolveAlias(_0x4adbcd,_0x41ae68,_0x27b9b0,_0x98dcb7){const _0x3eb28b=a144_0x1dfc;if(!_0x41ae68)return undefined;const _0x25e37c=loadAliasMap(_0x4adbcd,_0x27b9b0,_0x98dcb7),_0x1ab585=_0x25e37c[_0x3eb28b(0x1b5)](_0x59e897=>_0x59e897['alias']===_0x41ae68);return _0x1ab585?.['datasetCode'];}export function listAliases(_0x3e962b,_0x249969,_0x514a7c){return loadAliasMap(_0x3e962b,_0x249969,_0x514a7c);}
@@ -1 +1 @@
1
- function a145_0x4e4b(_0x28fde5,_0x3f197a){_0x28fde5=_0x28fde5-0x10e;const _0x30d945=a145_0x30d9();let _0x4e4bac=_0x30d945[_0x28fde5];return _0x4e4bac;}(function(_0x9fd9de,_0x5c51a9){const _0x193aca=a145_0x4e4b,_0x7e499=_0x9fd9de();while(!![]){try{const _0x189818=parseInt(_0x193aca(0x139))/0x1+-parseInt(_0x193aca(0x14f))/0x2*(parseInt(_0x193aca(0x11c))/0x3)+parseInt(_0x193aca(0x180))/0x4+parseInt(_0x193aca(0x159))/0x5*(parseInt(_0x193aca(0x14d))/0x6)+-parseInt(_0x193aca(0x130))/0x7+parseInt(_0x193aca(0x19d))/0x8*(parseInt(_0x193aca(0x176))/0x9)+-parseInt(_0x193aca(0x136))/0xa;if(_0x189818===_0x5c51a9)break;else _0x7e499['push'](_0x7e499['shift']());}catch(_0x5c6651){_0x7e499['push'](_0x7e499['shift']());}}}(a145_0x30d9,0xec2b7));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';function a145_0x30d9(){const _0x39e59b=['Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','displayName','tableList','/api/management/script/cache/clear','status','?sqlCode=','operationId','method','/smartapi/custom/saveUserCustomSql','BFF\x20save\x20returned\x20no\x20valid\x20id','functionName','json','GET','1763097beFuHw','object','clientOperationId','add','/generate-standard-pages/start','Operation\x20\x22','25992360ckYzSc','apiError','/smartapi/dataset/get-driven-data?','683354CAmOLb','cli:rabetbase','dbtableConfig','dbId','const\x20data\x20=\x20await\x20client.sql.execute({','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','.getOne(id);','Page\x20not\x20found:\x20','map','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','delete','abort','toString','version','Warning:\x20showing\x20first\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','filter','API\x20error\x20code:\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','.remove(id);','96wUqeiN','code','20940vTBGLB','name','requestFields','/smartapi/custom/getUserCustomSql?id=','API\x20error:\x20','//\x20SQL:\x20','/smartapi/dataset/get-dataset-operation','SQL\x20query\x20not\x20found:\x20','type','/smartapi/custom/queryUserCustomSqlList','237030hPapNX','\x20\x20where:\x20{},','sqlName','has','string','success','\x20\x20pageSize:\x2020,','\x20of\x20','/smartapi/lovrabet/detail?pageId=','/smartapi/question/er-config','length','\x20\x20\x20\x20sqlCode:\x20\x27','AbortError','includeImports','modelId','pageSize','/smartapi/dataset/get-dataset-list','table','/smartapi/custom/updateUserCustomSql','errorMsg','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','authRequired','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dblink/getOne','});','signal','tableData','/api/management/library/scripts/delete','//\x20','102222rYDDoR','.create({\x20/*\x20fields\x20*/\x20});','planId','/smartapi/db-analysis/jobs/cancel','cookie','totalCount','/smartapi/db-analysis/start','validation','tableName','&type=','5498336KZsqLL','/smartapi/lovrabet/dataset/','remove','scriptType','isArray','/smartapi/dblink/update','path','const\x20result\x20=\x20await\x20client.models.','\x20\x20sqlCode:\x20\x27','Unauthorized','/sync-to-pages','/smartapi/dblink/getList','label','/smartapi/lovrabet/update-page','body','scriptName','\x20\x20currentPage:\x201,','join','/smartapi/dataset/delete-dataset','find','target','POST','includes','responseFields','sdk','pageIndex','/generate-standard-pages/status?','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','push','1104BZMFhu','entries','application/json','/filter','update','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','data','/smartapi/dataset/update-driven-data','/smartapi/custom/getUserCustomSql','message','/smartapi/question/er-config/erCreate','errorCode','enabled','/api/management/library/scripts/statistics?appCode=','warn','operations','modelCode','\x20failed,\x20HTTP\x20','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','/smartapi/dblink/getAllTableList','errorMessage','sqlCode','dataset_','UNAUTHORIZED','currentPage','stringify','test','401','162pJgaik','toLowerCase','\x20failed','/smartapi/question/er-config/update-single','description','operationName'];a145_0x30d9=function(){return _0x39e59b;};return a145_0x30d9();}import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x4c9b16){_activeCookie=_0x4c9b16||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x1743d0,_0xba0402){const _0x32d221=a145_0x4e4b,_0x18c942=_0xba0402 instanceof Error?_0xba0402[_0x32d221(0x1a6)]:String(_0xba0402);return CliErrors[_0x32d221(0x137)]('Request\x20failed:\x20'+_0x1743d0+(_0x18c942?'\x20('+_0x18c942+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x4c67bd,_0x5b039a={}){const _0x32b69b=a145_0x4e4b,{method:method='GET',body:_0x4d9f67,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x5b039a,_0x52c56d=useRuntime?getRuntimeDomain():getApiDomain(),_0x2e6c2d=_activeCookie||getCookie(),_0x6b17b5=''+_0x52c56d+_0x4c67bd,_0x5015da=new AbortController(),_0x4471d2=setTimeout(()=>_0x5015da[_0x32b69b(0x144)](),timeout);try{const _0x2c81cd=await fetch(_0x6b17b5,{'method':method,'headers':{'Content-Type':_0x32b69b(0x19f),'Cookie':_0x2e6c2d,'X-Invoke-Source':_0x32b69b(0x13a),...headers},'body':_0x4d9f67?JSON[_0x32b69b(0x119)](_0x4d9f67):undefined,'signal':_0x5015da[_0x32b69b(0x172)]});let _0x2c65bb;try{_0x2c65bb=await _0x2c81cd[_0x32b69b(0x12e)]();}catch{throw CliErrors[_0x32b69b(0x137)](_0x32b69b(0x148)+_0x2c81cd[_0x32b69b(0x127)]+')',_0x2c81cd[_0x32b69b(0x127)]>=0x190?_0x32b69b(0x122):undefined);}if(!_0x2c81cd['ok']||_0x2c65bb[_0x32b69b(0x15e)]===![])throw CliErrors['apiError'](_0x2c65bb[_0x32b69b(0x16c)]||_0x2c65bb[_0x32b69b(0x1a6)]||_0x32b69b(0x153)+_0x2c81cd[_0x32b69b(0x127)],_0x2c65bb[_0x32b69b(0x1a8)]?_0x32b69b(0x14a)+_0x2c65bb[_0x32b69b(0x1a8)]:undefined);return _0x2c65bb;}catch(_0x3b1b3a){if(_0x3b1b3a instanceof CliError)throw _0x3b1b3a;if(_0x3b1b3a instanceof Error&&_0x3b1b3a[_0x32b69b(0x150)]===_0x32b69b(0x165))throw CliErrors[_0x32b69b(0x137)]('Request\x20timeout:\x20'+_0x6b17b5);throw createFetchFailureError(_0x6b17b5,_0x3b1b3a);}finally{clearTimeout(_0x4471d2);}}function isAuthFailure(_0x1b2dc7){const _0xbdb199=a145_0x4e4b,_0x4e7192=_0x1b2dc7[_0xbdb199(0x16c)]||_0x1b2dc7[_0xbdb199(0x1a6)]||_0x1b2dc7[_0xbdb199(0x1a3)]?.['message']||_0x1b2dc7[_0xbdb199(0x114)]||_0x1b2dc7['error']||'';return _0x1b2dc7[_0xbdb199(0x1a8)]===_0xbdb199(0x117)||_0x1b2dc7[_0xbdb199(0x14e)]===0x191||_0x1b2dc7[_0xbdb199(0x14e)]===_0xbdb199(0x11b)||_0x4e7192[_0xbdb199(0x196)](_0xbdb199(0x11b))||_0x4e7192[_0xbdb199(0x196)](_0xbdb199(0x189))||_0x4e7192[_0xbdb199(0x196)]('登录')||_0x4e7192['includes']('认证');}export async function platformFetch(_0x29f4a6,_0xcb39e8){const _0x5c879e=a145_0x4e4b;let _0x4503d2;try{_0x4503d2=await fetch(_0x29f4a6,{'method':_0xcb39e8[_0x5c879e(0x12a)]??_0x5c879e(0x12f),'headers':{'Content-Type':_0x5c879e(0x19f),'Cookie':_0xcb39e8[_0x5c879e(0x17a)],'X-Invoke-Source':_0x5c879e(0x13a)},..._0xcb39e8[_0x5c879e(0x18e)]&&{'body':JSON[_0x5c879e(0x119)](_0xcb39e8[_0x5c879e(0x18e)])}});}catch(_0x1f26e6){throw createFetchFailureError(_0x29f4a6,_0x1f26e6);}if(!_0x4503d2['ok']){if(_0x4503d2['status']===0x191)throw CliErrors[_0x5c879e(0x16e)]();throw CliErrors[_0x5c879e(0x137)](_0xcb39e8['label']+_0x5c879e(0x111)+_0x4503d2[_0x5c879e(0x127)]);}const _0x1bbac4=await _0x4503d2[_0x5c879e(0x12e)]();if(_0x1bbac4[_0x5c879e(0x15e)]===![]){if(isAuthFailure(_0x1bbac4))throw CliErrors[_0x5c879e(0x16e)]();throw CliErrors[_0x5c879e(0x137)](_0x1bbac4['errorMsg']||_0x1bbac4[_0x5c879e(0x1a6)]||_0xcb39e8[_0x5c879e(0x18c)]+_0x5c879e(0x11e));}return _0x1bbac4[_0x5c879e(0x1a3)];}export async function listBffScripts(_0x2efb92,_0x246d56,_0x1b3513){const _0x1ad78c=a145_0x4e4b;let _0x408612='/api/management/library/scripts/list?appCode='+_0x2efb92;if(_0x246d56)_0x408612+=_0x1ad78c(0x17f)+_0x246d56;const _0x28f7ff=await apiRequest(_0x408612);let _0x30bbea=extractList(_0x28f7ff[_0x1ad78c(0x1a3)]);if(_0x1b3513?.['scriptName']){const _0x2c5d85=_0x1b3513[_0x1ad78c(0x18f)][_0x1ad78c(0x11d)]();_0x30bbea=_0x30bbea[_0x1ad78c(0x149)](_0x3c2c74=>_0x3c2c74[_0x1ad78c(0x12d)]?.[_0x1ad78c(0x11d)]()['includes'](_0x2c5d85)||_0x3c2c74[_0x1ad78c(0x120)]?.['toLowerCase']()['includes'](_0x2c5d85));}return _0x30bbea;}export async function getBffScriptInfo(_0x4265c7){const _0x329b4a=a145_0x4e4b,_0x2fbaca=await apiRequest('/api/management/library/scripts/info?id='+_0x4265c7);if(!_0x2fbaca[_0x329b4a(0x1a3)])throw CliErrors[_0x329b4a(0x17d)]('BFF\x20script\x20not\x20found:\x20id='+_0x4265c7);return _0x2fbaca[_0x329b4a(0x1a3)];}export async function saveBffScript(_0x2a63ab){const _0x20a8af=a145_0x4e4b,_0x2780cf=await apiRequest('/api/management/library/scripts/save',{'method':_0x20a8af(0x195),'body':_0x2a63ab}),{id:_0x1c1a8c,entity:_0x1039c4}=normalizeEntityWithIdResponse(_0x2780cf['data']);if(_0x1c1a8c!==undefined){const _0x5575a2=typeof _0x1039c4[_0x20a8af(0x12d)]===_0x20a8af(0x15d)||typeof _0x1039c4[_0x20a8af(0x183)]==='string'?_0x1039c4:undefined;return{'id':_0x1c1a8c,'script':_0x5575a2};}throw CliErrors[_0x20a8af(0x137)](_0x20a8af(0x12c));}export async function deleteBffScript(_0x38b4be){const _0x54a3e1=a145_0x4e4b;await apiRequest(_0x54a3e1(0x174),{'method':'POST','body':{'id':_0x38b4be}});}export async function getBffScriptStatistics(_0x38ced7){const _0x5594e1=a145_0x4e4b,_0x789ce1=await apiRequest(_0x5594e1(0x1aa)+_0x38ced7);return extractList(_0x789ce1[_0x5594e1(0x1a3)]);}export async function clearBffScriptCache(){const _0x1934bc=a145_0x4e4b,_0x44c986=await apiRequest(_0x1934bc(0x126),{'method':'POST','useRuntime':!![]});return typeof _0x44c986[_0x1934bc(0x1a3)]===_0x1934bc(0x15d)?_0x44c986[_0x1934bc(0x1a3)]:'';}export async function listBffDatasetOperations(_0x208c94,_0x573e40){const _0x2c8e94=a145_0x4e4b,_0x430d6f=await apiRequest(_0x2c8e94(0x155),{'method':_0x2c8e94(0x195),'body':{'appCode':_0x208c94,'datasetId':_0x573e40}});return _0x430d6f[_0x2c8e94(0x1a3)];}export async function listSqlQueries(_0x3b52e7,_0x464fec){const _0x328209=a145_0x4e4b,_0x318255=await apiRequest(_0x328209(0x158),{'method':_0x328209(0x195),'body':{'appCode':_0x3b52e7,'currentPage':_0x464fec?.[_0x328209(0x118)]??0x1,'pageSize':_0x464fec?.[_0x328209(0x168)]??0x32,'sqlCode':_0x464fec?.['sqlCode'],'sqlName':_0x464fec?.[_0x328209(0x15b)]}});return _0x318255[_0x328209(0x1a3)];}export async function getSqlQueryInfo(_0x19df1a,_0x1f8ad5){const _0x401bfa=a145_0x4e4b,_0x2b6656=await listSqlQueries(_0x19df1a,{'sqlCode':_0x1f8ad5}),_0x596219=_0x2b6656[_0x401bfa(0x173)]?.[0x0];if(!_0x596219)throw CliErrors[_0x401bfa(0x17d)](_0x401bfa(0x156)+_0x1f8ad5);return _0x596219;}export async function getSqlQueryDetail(_0x17daf3){const _0x5234cf=a145_0x4e4b,_0x42f85a=await apiRequest(_0x5234cf(0x1a5)+(_0x5234cf(0x128)+encodeURIComponent(_0x17daf3)));if(!_0x42f85a[_0x5234cf(0x1a3)])throw CliErrors[_0x5234cf(0x17d)](_0x5234cf(0x156)+_0x17daf3);return _0x42f85a[_0x5234cf(0x1a3)];}export async function getSqlQueryDetailById(_0x58a872){const _0x49bc7f=a145_0x4e4b,_0x550d56=await apiRequest(_0x49bc7f(0x152)+_0x58a872);if(!_0x550d56['data'])throw CliErrors[_0x49bc7f(0x17d)]('SQL\x20query\x20not\x20found:\x20id='+_0x58a872);return _0x550d56['data'];}export async function createSqlQuery(_0x555596){const _0xb59361=a145_0x4e4b,_0x483a6f=await apiRequest(_0xb59361(0x12b),{'method':_0xb59361(0x195),'body':_0x555596}),{id:_0x21a7fc,entity:_0x46c866}=normalizeEntityWithIdResponse(_0x483a6f[_0xb59361(0x1a3)]);if(!('sqlCode'in _0x46c866)&&_0x21a7fc)return getSqlQueryDetailById(_0x21a7fc);return normalizeSqlQueryEntity(_0x46c866);}export async function updateSqlQuery(_0xa3c16f){const _0x4b5ff8=a145_0x4e4b,_0x2f7b53=await apiRequest(_0x4b5ff8(0x16b),{'method':_0x4b5ff8(0x195),'body':_0xa3c16f}),{id:_0x4914b8,entity:_0x419d67}=normalizeEntityWithIdResponse(_0x2f7b53[_0x4b5ff8(0x1a3)]);if(!(_0x4b5ff8(0x115)in _0x419d67)){if(_0xa3c16f[_0x4b5ff8(0x115)])return getSqlQueryDetail(_0xa3c16f[_0x4b5ff8(0x115)]);if(_0x4914b8)return getSqlQueryDetailById(_0x4914b8);}return normalizeSqlQueryEntity(_0x419d67);}export async function deleteSqlQuery(_0x99b554){const _0x26018f=a145_0x4e4b;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x26018f(0x195),'body':_0x99b554});}export async function saveSqlQuery(_0x53e213){const _0x48637f=a145_0x4e4b,_0x5c72a6=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x48637f(0x195),'body':_0x53e213});return _0x5c72a6[_0x48637f(0x1a3)];}function normalizeSqlQueryEntity(_0x4b6a74){const _0x2ec173=a145_0x4e4b;return{..._0x4b6a74,'id':Number(_0x4b6a74['id']),'dbId':_0x4b6a74['dbId']==null?undefined:Number(_0x4b6a74[_0x2ec173(0x13c)]),'version':_0x4b6a74[_0x2ec173(0x146)]==null?undefined:Number(_0x4b6a74[_0x2ec173(0x146)])};}export async function executeSql(_0x211527,_0x455ca4,_0x1f9b07){const _0x1a3fca=a145_0x4e4b,_0x1a5c2e=await apiRequest('/api/custom/executeSql',{'method':_0x1a3fca(0x195),'body':{'appCode':_0x211527,'sqlCode':_0x455ca4,..._0x1f9b07&&{'params':_0x1f9b07}},'useRuntime':!![]});return _0x1a5c2e[_0x1a3fca(0x1a3)];}export async function executeDatasetDataOperation(_0x48a420,_0x280025,_0x268311,_0x56bc3a={}){const _0x441685=a145_0x4e4b;try{const _0x241d9=await apiRequest('/api/'+_0x48a420+'/'+_0x280025+'/'+_0x268311,{'method':_0x441685(0x195),'body':_0x56bc3a,'useRuntime':!![]});return _0x241d9[_0x441685(0x1a3)];}catch(_0x5a8544){if(_0x268311==='getOne'&&_0x5a8544 instanceof CliError&&_0x5a8544[_0x441685(0x14e)]==='api_error'&&_0x56bc3a['id']!==undefined&&_0x56bc3a['id']!==null&&_0x56bc3a['id']!==''){const _0x1f61d2=await apiRequest('/api/'+_0x48a420+'/'+_0x280025+_0x441685(0x1a0),{'method':_0x441685(0x195),'body':{'where':{'id':{'$eq':_0x56bc3a['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x50cb99=Array[_0x441685(0x184)](_0x1f61d2['data']?.['tableData'])?_0x1f61d2['data'][_0x441685(0x173)]:[];return _0x50cb99[0x0]??null;}throw _0x5a8544;}}export async function listDatasets(_0x23448c,_0xc84ae6){const _0x2e15cc=a145_0x4e4b,_0x17448c={'appCode':_0x23448c,'deleted':![]};if(_0xc84ae6?.['code'])_0x17448c[_0x2e15cc(0x14e)]=_0xc84ae6['code'];if(_0xc84ae6?.[_0x2e15cc(0x150)])_0x17448c[_0x2e15cc(0x150)]=_0xc84ae6[_0x2e15cc(0x150)];const _0x33cab4=await apiRequest(_0x2e15cc(0x169),{'method':_0x2e15cc(0x195),'body':_0x17448c});return extractList(_0x33cab4['data']);}export async function deleteDataset(_0xbf68c3,_0x33bc18){const _0x2155e0=a145_0x4e4b;await apiRequest(_0x2155e0(0x192),{'method':_0x2155e0(0x195),'body':{'appCode':_0xbf68c3,'datasetId':_0x33bc18}});}export async function searchDatasets(_0x3d65fc,_0xba3843){const _0x119172=a145_0x4e4b,_0x32dd7e=await listDatasets(_0x3d65fc,{'name':_0xba3843}),_0x23ac99=_0xba3843[_0x119172(0x11d)](),_0x3ff328=new Set(_0x32dd7e[_0x119172(0x141)](_0x20caf4=>_0x20caf4['id'])),_0x356af3=_0x32dd7e[_0x119172(0x149)](_0x53871e=>_0x53871e[_0x119172(0x13b)]?.[_0x119172(0x17e)]?.[_0x119172(0x11d)]()[_0x119172(0x196)](_0x23ac99)||_0x53871e[_0x119172(0x120)]?.['toLowerCase']()[_0x119172(0x196)](_0x23ac99)),_0x1105dd=await listDatasets(_0x3d65fc,{'code':_0xba3843});for(const _0xb3b94d of _0x1105dd){!_0x3ff328[_0x119172(0x15c)](_0xb3b94d['id'])&&(_0x32dd7e[_0x119172(0x19c)](_0xb3b94d),_0x3ff328[_0x119172(0x133)](_0xb3b94d['id']));}return _0x32dd7e;}export function normalizeDatasetOperations(_0x44333c){const _0x1c153e=a145_0x4e4b;if(Array[_0x1c153e(0x184)](_0x44333c))return _0x44333c['filter'](_0xdcd5ad=>_0xdcd5ad!=null&&typeof _0xdcd5ad==='object');if(_0x44333c&&typeof _0x44333c==='object')return Object[_0x1c153e(0x19e)](_0x44333c)[_0x1c153e(0x149)](([,_0x3b40be])=>_0x3b40be!=null&&typeof _0x3b40be==='object')[_0x1c153e(0x141)](([_0x2c0a46,_0x35ea88])=>({..._0x35ea88,'name':_0x35ea88['name']??_0x35ea88[_0x1c153e(0x121)]??_0x2c0a46}));return[];}export async function getDatasetDetail(_0x20fb39){const _0x5d6361=a145_0x4e4b,_0x9a7982=/^\d+$/['test'](_0x20fb39)?'id':_0x5d6361(0x14e),_0x54a9ea=await apiRequest(_0x5d6361(0x138)+_0x9a7982+'='+_0x20fb39);return _0x54a9ea[_0x5d6361(0x1a3)];}export async function updateDrivenData(_0x916c30){const _0x2562f6=a145_0x4e4b,_0x285537=await apiRequest(_0x2562f6(0x1a4),{'method':_0x2562f6(0x195),'body':_0x916c30});return _0x285537[_0x2562f6(0x1a3)];}export async function getDatasetOperations(_0x46dd6e){const _0x4a2932=a145_0x4e4b,_0x340467=await getDatasetDetail(_0x46dd6e),_0x508492=normalizeDatasetOperations(_0x340467[_0x4a2932(0x10f)])[_0x4a2932(0x141)](_0x28d1a3=>({'name':_0x28d1a3[_0x4a2932(0x150)]||_0x28d1a3[_0x4a2932(0x121)],'displayName':_0x28d1a3[_0x4a2932(0x124)]||_0x28d1a3[_0x4a2932(0x150)],'type':_0x28d1a3[_0x4a2932(0x157)],'method':_0x28d1a3[_0x4a2932(0x12a)],'path':_0x28d1a3[_0x4a2932(0x186)],'enabled':_0x28d1a3[_0x4a2932(0x1a9)]??!![],'requestFields':_0x28d1a3[_0x4a2932(0x151)],'responseFields':_0x28d1a3[_0x4a2932(0x197)]}));return{'dataset':{'id':_0x340467['id']??_0x340467[_0x4a2932(0x167)],'name':_0x340467[_0x4a2932(0x150)],'code':_0x340467['code']||_0x340467[_0x4a2932(0x110)],'tableName':_0x340467[_0x4a2932(0x17e)]||_0x340467[_0x4a2932(0x13b)]?.[_0x4a2932(0x17e)]},'operations':_0x508492};}export async function getOperationDetail(_0x563f5f,_0x52b1d5,_0x2efdde){const _0x5adad5=a145_0x4e4b;let _0x2d9b8f=_0x52b1d5;if(!/^\d+$/[_0x5adad5(0x11a)](_0x52b1d5)){const _0x27ca93=await listDatasets(_0x563f5f,{'code':_0x52b1d5}),_0x15fe2f=_0x27ca93[_0x5adad5(0x193)](_0x8b3dcf=>_0x8b3dcf['code']===_0x52b1d5||String(_0x8b3dcf['id'])===_0x52b1d5);if(!_0x15fe2f)throw CliErrors['validation']('Dataset\x20not\x20found:\x20'+_0x52b1d5);_0x2d9b8f=String(_0x15fe2f['id']);}const _0x2f63a0=await getDatasetDetail(_0x2d9b8f),_0x5559bc=normalizeDatasetOperations(_0x2f63a0[_0x5adad5(0x10f)])[_0x5adad5(0x193)](_0x10ef37=>(_0x10ef37[_0x5adad5(0x150)]||_0x10ef37['operationName'])===_0x2efdde);if(!_0x5559bc)throw CliErrors['validation'](_0x5adad5(0x135)+_0x2efdde+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x52b1d5);return{'dataset':{'id':_0x2f63a0['id']??_0x2f63a0[_0x5adad5(0x167)],'name':_0x2f63a0[_0x5adad5(0x150)],'code':_0x2f63a0[_0x5adad5(0x14e)]||_0x2f63a0['modelCode'],'tableName':_0x2f63a0[_0x5adad5(0x17e)]||_0x2f63a0[_0x5adad5(0x13b)]?.['tableName']},'operation':_0x5559bc};}export async function startGenerateStandardPages(_0x5d8aa3,_0x145d13,_0x19cb92){const _0x20381e=a145_0x4e4b,_0x18662a=await apiRequest(_0x20381e(0x181)+_0x145d13+_0x20381e(0x134),{'method':_0x20381e(0x195),'body':{'appCode':_0x5d8aa3,..._0x19cb92?.[_0x20381e(0x132)]?{'clientOperationId':_0x19cb92[_0x20381e(0x132)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x18662a[_0x20381e(0x1a3)];}export async function getGenerateStandardPagesStatus(_0x47314a,_0x5ab3b1,_0x58426e){const _0x9f8691=a145_0x4e4b,_0x1c5f97=new URLSearchParams({'appCode':_0x47314a});_0x58426e[_0x9f8691(0x129)]&&_0x1c5f97['set'](_0x9f8691(0x129),_0x58426e[_0x9f8691(0x129)]);_0x58426e[_0x9f8691(0x132)]&&_0x1c5f97['set']('clientOperationId',_0x58426e['clientOperationId']);const _0xfd2ac4=await apiRequest('/smartapi/lovrabet/dataset/'+_0x5ab3b1+_0x9f8691(0x19a)+_0x1c5f97[_0x9f8691(0x145)]());return _0xfd2ac4[_0x9f8691(0x1a3)];}export async function getStandardPageStatus(_0x4e5eba,_0x4751c2){const _0x4cbb8d=await apiRequest('/smartapi/lovrabet/dataset/'+_0x4751c2+'/standard-page-status?appCode='+encodeURIComponent(_0x4e5eba));return _0x4cbb8d['data'];}export async function tryGetStandardPageStatus(_0xd5fb8b,_0x403477){const _0x3f7921=a145_0x4e4b;try{return await getStandardPageStatus(_0xd5fb8b,_0x403477);}catch(_0x481523){if(_0x481523 instanceof CliError&&_0x481523[_0x3f7921(0x14e)]==='api_error'&&/404|not found|non-json response/i[_0x3f7921(0x11a)](_0x481523[_0x3f7921(0x1a6)]))return null;throw _0x481523;}}export async function syncStandardPages(_0x315961,_0x5f3c58){const _0x56b56a=a145_0x4e4b,_0x112ac7=await apiRequest('/smartapi/lovrabet/dataset/'+_0x5f3c58+_0x56b56a(0x18a),{'method':_0x56b56a(0x195),'body':{'appCode':_0x315961}});return _0x112ac7[_0x56b56a(0x1a3)];}export async function getPageDetail(_0x5464f0){const _0x306cf6=a145_0x4e4b,_0x1cabbf=await apiRequest(_0x306cf6(0x161)+_0x5464f0);if(!_0x1cabbf[_0x306cf6(0x1a3)])throw CliErrors[_0x306cf6(0x17d)](_0x306cf6(0x140)+_0x5464f0);return _0x1cabbf[_0x306cf6(0x1a3)];}export async function updatePage(_0x814eb5,_0x49bd9e,_0x446e46,_0x42313b){const _0x3e7804=a145_0x4e4b,_0xd67c6d=await apiRequest(_0x3e7804(0x18d),{'method':_0x3e7804(0x195),'body':{'appCode':_0x814eb5,'pageId':_0x49bd9e,'code':_0x446e46,'datasetIds':_0x42313b}});return _0xd67c6d['data'];}export function generateSdkCode(_0x247129,_0x5a61c2,_0x51ebf2){const _0x187b0b=a145_0x4e4b,_0x18a4a5=_0x51ebf2?.[_0x187b0b(0x166)]??!![],_0x508004=_0x187b0b(0x116)+_0x247129[_0x187b0b(0x14e)]?.['replace'](/-/g,'_'),_0x4a5384=_0x5a61c2['name']||_0x5a61c2['operationName']||'filter',_0x2e303a=[];_0x18a4a5&&_0x2e303a[_0x187b0b(0x19c)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x187b0b(0x123),'');_0x2e303a['push'](_0x187b0b(0x175)+_0x247129[_0x187b0b(0x150)]+'\x20('+(_0x247129[_0x187b0b(0x17e)]||_0x187b0b(0x16a))+')');if(_0x4a5384===_0x187b0b(0x149))_0x2e303a['push'](_0x187b0b(0x187)+_0x508004+'.filter({',_0x187b0b(0x15a),_0x187b0b(0x15f),_0x187b0b(0x190),_0x187b0b(0x171));else{if(_0x4a5384==='getOne')_0x2e303a[_0x187b0b(0x19c)](_0x187b0b(0x187)+_0x508004+_0x187b0b(0x13f));else{if(_0x4a5384==='create')_0x2e303a['push'](_0x187b0b(0x187)+_0x508004+_0x187b0b(0x177));else{if(_0x4a5384===_0x187b0b(0x1a1))_0x2e303a[_0x187b0b(0x19c)](_0x187b0b(0x187)+_0x508004+_0x187b0b(0x142));else _0x4a5384===_0x187b0b(0x143)||_0x4a5384===_0x187b0b(0x182)?_0x2e303a[_0x187b0b(0x19c)]('const\x20result\x20=\x20await\x20client.models.'+_0x508004+_0x187b0b(0x14c)):_0x2e303a['push'](_0x187b0b(0x187)+_0x508004+'.'+_0x4a5384+'(/*\x20params\x20*/);');}}}return _0x2e303a[_0x187b0b(0x191)]('\x0a');}export function generateSqlCodeTemplate(_0x3224ae,_0x167684){const _0x39650d=a145_0x4e4b,_0x10ddda=_0x167684?.[_0x39650d(0x194)]??'sdk',_0x19f371=_0x167684?.['includeImports']??!![],_0x138efd=[];return _0x138efd[_0x39650d(0x19c)](_0x39650d(0x154)+_0x3224ae['sqlName']+'\x20('+_0x3224ae[_0x39650d(0x115)]+')'),_0x10ddda===_0x39650d(0x198)?(_0x19f371&&_0x138efd[_0x39650d(0x19c)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x138efd[_0x39650d(0x19c)](_0x39650d(0x13d),_0x39650d(0x188)+_0x3224ae['sqlCode']+'\x27,',_0x39650d(0x14b),_0x39650d(0x171),_0x39650d(0x13e),_0x39650d(0x16f))):_0x138efd[_0x39650d(0x19c)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x39650d(0x112),_0x39650d(0x19b),_0x39650d(0x164)+_0x3224ae[_0x39650d(0x115)]+'\x27,',_0x39650d(0x1a2),'\x20\x20});','\x20\x20return\x20rows;','}'),_0x138efd[_0x39650d(0x191)]('\x0a');}export async function getErConfig(_0x587d74,_0x11627b){const _0x473409=a145_0x4e4b,_0x387bc7=await apiRequest(_0x473409(0x162),{'method':_0x473409(0x195),'body':{'appCode':_0x587d74,'dblinkId':_0x11627b}});return _0x387bc7['data'];}export async function createErRelation(_0x3579a3){const _0x25891d=a145_0x4e4b,_0x1ad948=await apiRequest(_0x25891d(0x1a7),{'method':_0x25891d(0x195),'body':_0x3579a3});return _0x1ad948[_0x25891d(0x1a3)];}export async function updateErRelation(_0x2200b2){const _0x4a3055=a145_0x4e4b,_0x4d4f26=await apiRequest(_0x4a3055(0x11f),{'method':'POST','body':_0x2200b2});return _0x4d4f26[_0x4a3055(0x1a3)];}export async function deleteErRelation(_0x36bfd5){const _0x4c1bed=await apiRequest('/smartapi/question/er-config/erDelete',{'method':'POST','body':_0x36bfd5});return _0x4c1bed['data'];}function buildQuery(_0x14c856){const _0x45b6d5=a145_0x4e4b,_0xc29f58=new URLSearchParams();for(const [_0xff08c1,_0x387bfb]of Object['entries'](_0x14c856)){if(_0x387bfb===undefined||_0x387bfb==='')continue;_0xc29f58['set'](_0xff08c1,String(_0x387bfb));}const _0x215985=_0xc29f58[_0x45b6d5(0x145)]();return _0x215985?'?'+_0x215985:'';}export async function listDbLinks(_0xbffb68,_0x4bbfc6){const _0x4fda48=a145_0x4e4b,_0x38c7ab=await apiRequest(_0x4fda48(0x18b),{'method':'POST','body':{'appCode':_0xbffb68,'currentPage':_0x4bbfc6?.[_0x4fda48(0x118)]??0x1,'pageSize':_0x4bbfc6?.[_0x4fda48(0x168)]??0x64}});return{'items':extractList(_0x38c7ab[_0x4fda48(0x1a3)]),'paging':extractPaging(_0x38c7ab[_0x4fda48(0x1a3)])};}export async function getDbLinkInfo(_0x4a3b39){const _0x504c1c=a145_0x4e4b,_0x95164e=await apiRequest(_0x504c1c(0x170)+buildQuery({'id':_0x4a3b39}));return _0x95164e['data'];}export async function createDbLink(_0x39254c){const _0x159b45=a145_0x4e4b,_0x570fa2=await apiRequest('/smartapi/dblink/create',{'method':'POST','body':_0x39254c});return _0x570fa2[_0x159b45(0x1a3)];}export async function updateDbLink(_0x35cad1){const _0x37d5b0=a145_0x4e4b,_0x2d7a4c=await apiRequest(_0x37d5b0(0x185),{'method':'POST','body':_0x35cad1});return _0x2d7a4c['data'];}export async function deleteDbLink(_0x3fbee9){const _0x27431a=a145_0x4e4b;await apiRequest('/smartapi/dblink/delete',{'method':_0x27431a(0x195),'body':{'id':_0x3fbee9}});}export async function testDbLinkConnect(_0x542f9d){const _0x17448d=a145_0x4e4b,_0x46c631=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x542f9d}));return _0x46c631[_0x17448d(0x1a3)];}export async function startDbAnalysis(_0x40de3a,_0x4edf92){const _0x24cc24=a145_0x4e4b,_0x2159da=await apiRequest(_0x24cc24(0x17c),{'method':'POST','body':{'dbLinkId':_0x40de3a,..._0x4edf92&&_0x4edf92[_0x24cc24(0x163)]>0x0?{'tableNames':_0x4edf92}:{}}}),_0x3d7567=_0x2159da[_0x24cc24(0x1a3)];if(typeof _0x3d7567===_0x24cc24(0x15d))return _0x3d7567;if(_0x3d7567&&typeof _0x3d7567===_0x24cc24(0x131)&&typeof _0x3d7567['planId']==='string')return _0x3d7567[_0x24cc24(0x178)];return _0x3d7567!=null?String(_0x3d7567):'';}export async function cancelDbAnalysis(_0x2d7ed0){const _0x2436ad=a145_0x4e4b;await apiRequest(_0x2436ad(0x179)+buildQuery({'planId':_0x2d7ed0}),{'method':_0x2436ad(0x195)});}export async function getDbAnalysisStatus(_0x151c93){const _0x5efc04=a145_0x4e4b,_0x5af051=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x151c93));return _0x5af051[_0x5efc04(0x1a3)];}export async function getDbAllTableList(_0x81b151,_0x1b5317){const _0x43adc0=a145_0x4e4b,_0x5af394=await apiRequest(_0x43adc0(0x113)+buildQuery({'appCode':_0x81b151,'dbLinkId':_0x1b5317})),_0x179628=_0x5af394[_0x43adc0(0x1a3)];if(Array[_0x43adc0(0x184)](_0x179628))return _0x179628;return extractList(_0x179628);}export async function getDbTableDiff(_0x17132f,_0x4171b8,_0x1ff625){const _0x12bcd8=a145_0x4e4b,_0x20b735=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x17132f,'dbLinkId':_0x4171b8,'pageIndex':_0x1ff625?.[_0x12bcd8(0x199)]??0x1,'pageSize':_0x1ff625?.[_0x12bcd8(0x168)]??0x14,'tableName':_0x1ff625?.['tableName']})),_0x49d7f0=_0x20b735['data'];return{'totalCount':_0x49d7f0?.[_0x12bcd8(0x17b)]??0x0,'tableList':Array[_0x12bcd8(0x184)](_0x49d7f0?.[_0x12bcd8(0x125)])?_0x49d7f0[_0x12bcd8(0x125)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x20bdb2=a145_0x4e4b,_0x45d4fc=await apiRequest('/smartapi/app/getList',{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x27740f=extractList(_0x45d4fc['data']),_0x127d11=extractPaging(_0x45d4fc['data']);return _0x127d11&&_0x127d11[_0x20bdb2(0x17b)]>REMOTE_APP_PAGE_SIZE&&console[_0x20bdb2(0x10e)](_0x20bdb2(0x147)+REMOTE_APP_PAGE_SIZE+_0x20bdb2(0x160)+_0x127d11[_0x20bdb2(0x17b)]+'\x20apps.\x20'+_0x20bdb2(0x16d)),_0x27740f;}
1
+ (function(_0x2e4f42,_0x46b8f2){const _0x165b4e=a145_0x2e87,_0x36c05b=_0x2e4f42();while(!![]){try{const _0x208ea8=parseInt(_0x165b4e(0x122))/0x1*(parseInt(_0x165b4e(0x140))/0x2)+parseInt(_0x165b4e(0x1b3))/0x3*(-parseInt(_0x165b4e(0x186))/0x4)+parseInt(_0x165b4e(0x1ad))/0x5+-parseInt(_0x165b4e(0x16f))/0x6+parseInt(_0x165b4e(0x125))/0x7*(-parseInt(_0x165b4e(0x17f))/0x8)+-parseInt(_0x165b4e(0x1a0))/0x9*(-parseInt(_0x165b4e(0x136))/0xa)+parseInt(_0x165b4e(0x1ab))/0xb;if(_0x208ea8===_0x46b8f2)break;else _0x36c05b['push'](_0x36c05b['shift']());}catch(_0x341163){_0x36c05b['push'](_0x36c05b['shift']());}}}(a145_0x2f82,0x1dc5f));function a145_0x2e87(_0x4d06fb,_0x1b8de8){_0x4d06fb=_0x4d06fb-0x11c;const _0x2f8248=a145_0x2f82();let _0x2e87f4=_0x2f8248[_0x4d06fb];return _0x2e87f4;}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(_0x5ea836){_activeCookie=_0x5ea836||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x234de1,_0x356bac){const _0x3bafba=a145_0x2e87,_0x36667d=_0x356bac instanceof Error?_0x356bac[_0x3bafba(0x1b9)]:String(_0x356bac);return CliErrors[_0x3bafba(0x1c3)](_0x3bafba(0x147)+_0x234de1+(_0x36667d?'\x20('+_0x36667d+')':''),_0x3bafba(0x13c));}async function apiRequest(_0x575c61,_0x215e0d={}){const _0x5e554c=a145_0x2e87,{method:method='GET',body:_0x2e2fab,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x215e0d,_0x572681=useRuntime?getRuntimeDomain():getApiDomain(),_0x401db2=_activeCookie||getCookie(),_0x122b7=''+_0x572681+_0x575c61,_0x4f05e4=new AbortController(),_0x1a43fc=setTimeout(()=>_0x4f05e4[_0x5e554c(0x1ae)](),timeout);try{const _0x530285=await fetch(_0x122b7,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x401db2,'X-Invoke-Source':_0x5e554c(0x19d),...headers},'body':_0x2e2fab?JSON[_0x5e554c(0x1c9)](_0x2e2fab):undefined,'signal':_0x4f05e4[_0x5e554c(0x138)]});let _0x19f1be;try{_0x19f1be=await _0x530285[_0x5e554c(0x1b6)]();}catch{if(_0x530285['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5e554c(0x1c3)](_0x5e554c(0x12b)+_0x530285['status']+')',_0x530285['status']>=0x190?_0x5e554c(0x17e):undefined);}if(!_0x530285['ok']||_0x19f1be[_0x5e554c(0x1c0)]===![])throw CliErrors[_0x5e554c(0x1c3)](_0x19f1be[_0x5e554c(0x1a9)]||_0x19f1be[_0x5e554c(0x1b9)]||'API\x20error:\x20'+_0x530285[_0x5e554c(0x1a4)],_0x19f1be[_0x5e554c(0x18c)]?_0x5e554c(0x130)+_0x19f1be[_0x5e554c(0x18c)]:undefined);return _0x19f1be;}catch(_0x408bfa){if(_0x408bfa instanceof CliError)throw _0x408bfa;if(_0x408bfa instanceof Error&&_0x408bfa[_0x5e554c(0x170)]===_0x5e554c(0x171))throw CliErrors[_0x5e554c(0x1c3)](_0x5e554c(0x15c)+_0x122b7);throw createFetchFailureError(_0x122b7,_0x408bfa);}finally{clearTimeout(_0x1a43fc);}}function isAuthFailure(_0x4537cf){const _0xb4251d=a145_0x2e87,_0x365cfd=_0x4537cf[_0xb4251d(0x1a9)]||_0x4537cf[_0xb4251d(0x1b9)]||_0x4537cf[_0xb4251d(0x1c6)]?.[_0xb4251d(0x1b9)]||_0x4537cf[_0xb4251d(0x142)]||_0x4537cf['error']||'';return _0x4537cf[_0xb4251d(0x18c)]===_0xb4251d(0x199)||_0x4537cf[_0xb4251d(0x124)]===0x191||_0x4537cf[_0xb4251d(0x124)]===_0xb4251d(0x133)||_0x365cfd['includes'](_0xb4251d(0x133))||_0x365cfd['includes'](_0xb4251d(0x1b0))||_0x365cfd['includes']('登录')||_0x365cfd['includes']('认证');}export async function platformFetch(_0x7b9290,_0xfd34c1){const _0x3ac98f=a145_0x2e87;let _0xe22035;try{_0xe22035=await fetch(_0x7b9290,{'method':_0xfd34c1['method']??_0x3ac98f(0x11e),'headers':{'Content-Type':_0x3ac98f(0x141),'Cookie':_0xfd34c1[_0x3ac98f(0x195)],'X-Invoke-Source':'cli:rabetbase'},..._0xfd34c1['body']&&{'body':JSON[_0x3ac98f(0x1c9)](_0xfd34c1[_0x3ac98f(0x1c1)])}});}catch(_0x1f964e){throw createFetchFailureError(_0x7b9290,_0x1f964e);}if(!_0xe22035['ok']){if(_0xe22035[_0x3ac98f(0x1a4)]===0x191)throw CliErrors[_0x3ac98f(0x190)]();throw CliErrors['apiError'](_0xfd34c1[_0x3ac98f(0x196)]+_0x3ac98f(0x126)+_0xe22035['status']);}const _0x4f1a07=await _0xe22035[_0x3ac98f(0x1b6)]();if(_0x4f1a07[_0x3ac98f(0x1c0)]===![]){if(isAuthFailure(_0x4f1a07))throw CliErrors['authRequired']();throw CliErrors[_0x3ac98f(0x1c3)](_0x4f1a07[_0x3ac98f(0x1a9)]||_0x4f1a07[_0x3ac98f(0x1b9)]||_0xfd34c1[_0x3ac98f(0x196)]+_0x3ac98f(0x162));}return _0x4f1a07[_0x3ac98f(0x1c6)];}export async function listBffScripts(_0x1d8415,_0x10cf4b,_0x4a1639){const _0x50c97e=a145_0x2e87;let _0x345de1=_0x50c97e(0x163)+_0x1d8415;if(_0x10cf4b)_0x345de1+='&type='+_0x10cf4b;const _0x1cfa77=await apiRequest(_0x345de1);let _0x174a4c=extractList(_0x1cfa77['data']);if(_0x4a1639?.['scriptName']){const _0x5201e4=_0x4a1639['scriptName']['toLowerCase']();_0x174a4c=_0x174a4c[_0x50c97e(0x152)](_0x3e5c72=>_0x3e5c72['functionName']?.[_0x50c97e(0x1b2)]()['includes'](_0x5201e4)||_0x3e5c72[_0x50c97e(0x1b7)]?.['toLowerCase']()[_0x50c97e(0x1bc)](_0x5201e4));}return _0x174a4c;}export async function getBffScriptInfo(_0x4e2353){const _0x1bd36a=a145_0x2e87,_0x2e300e=await apiRequest(_0x1bd36a(0x1b4)+_0x4e2353);if(!_0x2e300e[_0x1bd36a(0x1c6)])throw CliErrors[_0x1bd36a(0x120)](_0x1bd36a(0x156)+_0x4e2353);return _0x2e300e[_0x1bd36a(0x1c6)];}export async function saveBffScript(_0x4b389c){const _0x2fb8f7=a145_0x2e87,_0x987034=await apiRequest('/api/management/library/scripts/save',{'method':_0x2fb8f7(0x15a),'body':_0x4b389c}),{id:_0x389537,entity:_0x585cf6}=normalizeEntityWithIdResponse(_0x987034[_0x2fb8f7(0x1c6)]);if(_0x389537!==undefined){const _0x5e97e4=typeof _0x585cf6[_0x2fb8f7(0x16b)]===_0x2fb8f7(0x194)||typeof _0x585cf6[_0x2fb8f7(0x1a7)]==='string'?_0x585cf6:undefined;return{'id':_0x389537,'script':_0x5e97e4};}throw CliErrors[_0x2fb8f7(0x1c3)](_0x2fb8f7(0x183));}export async function deleteBffScript(_0x7c66dd){const _0x22d510=a145_0x2e87;await apiRequest(_0x22d510(0x1bd),{'method':_0x22d510(0x15a),'body':{'id':_0x7c66dd}});}export async function getBffScriptStatistics(_0x4ac747){const _0xf1e131=a145_0x2e87,_0x138d3a=await apiRequest(_0xf1e131(0x1c4)+_0x4ac747);return extractList(_0x138d3a[_0xf1e131(0x1c6)]);}export async function clearBffScriptCache(){const _0x53435d=a145_0x2e87,_0x6d708e=await apiRequest(_0x53435d(0x13b),{'method':_0x53435d(0x15a),'useRuntime':!![]});return typeof _0x6d708e[_0x53435d(0x1c6)]===_0x53435d(0x194)?_0x6d708e[_0x53435d(0x1c6)]:'';}export async function listBffDatasetOperations(_0x129416,_0x3fb8bd){const _0x305c36=a145_0x2e87,_0x21600b=await apiRequest(_0x305c36(0x13e),{'method':_0x305c36(0x15a),'body':{'appCode':_0x129416,'datasetId':_0x3fb8bd}});return _0x21600b[_0x305c36(0x1c6)];}export async function listSqlQueries(_0x35b65a,_0x4dcd3c){const _0x12a7dc=a145_0x2e87,_0x13cdce=await apiRequest(_0x12a7dc(0x184),{'method':_0x12a7dc(0x15a),'body':{'appCode':_0x35b65a,'currentPage':_0x4dcd3c?.[_0x12a7dc(0x1ba)]??0x1,'pageSize':_0x4dcd3c?.[_0x12a7dc(0x149)]??0x32,'sqlCode':_0x4dcd3c?.[_0x12a7dc(0x1a3)],'sqlName':_0x4dcd3c?.[_0x12a7dc(0x123)]}});return _0x13cdce[_0x12a7dc(0x1c6)];}export async function getSqlQueryInfo(_0x4a4ee0,_0x4a95c5){const _0xa4e63f=a145_0x2e87,_0x322ec7=await listSqlQueries(_0x4a4ee0,{'sqlCode':_0x4a95c5}),_0x138540=_0x322ec7[_0xa4e63f(0x1a6)]?.[0x0];if(!_0x138540)throw CliErrors[_0xa4e63f(0x120)](_0xa4e63f(0x132)+_0x4a95c5);return _0x138540;}export async function getSqlQueryDetail(_0x58a5ce){const _0x246b5b=a145_0x2e87,_0x2a0324=await apiRequest(_0x246b5b(0x1b5)+(_0x246b5b(0x18a)+encodeURIComponent(_0x58a5ce)));if(!_0x2a0324['data'])throw CliErrors[_0x246b5b(0x120)]('SQL\x20query\x20not\x20found:\x20'+_0x58a5ce);return _0x2a0324[_0x246b5b(0x1c6)];}export async function getSqlQueryDetailById(_0x213165){const _0x30720a=a145_0x2e87,_0x50ae97=await apiRequest(_0x30720a(0x1c5)+_0x213165);if(!_0x50ae97['data'])throw CliErrors[_0x30720a(0x120)]('SQL\x20query\x20not\x20found:\x20id='+_0x213165);return _0x50ae97[_0x30720a(0x1c6)];}export async function createSqlQuery(_0x260874){const _0x447e12=a145_0x2e87,_0x386402=await apiRequest(_0x447e12(0x19a),{'method':_0x447e12(0x15a),'body':_0x260874}),{id:_0x534955,entity:_0xee625}=normalizeEntityWithIdResponse(_0x386402['data']);if(!(_0x447e12(0x1a3)in _0xee625)&&_0x534955)return getSqlQueryDetailById(_0x534955);return normalizeSqlQueryEntity(_0xee625);}export async function updateSqlQuery(_0xbf3683){const _0x5e058f=a145_0x2e87,_0x313799=await apiRequest(_0x5e058f(0x178),{'method':_0x5e058f(0x15a),'body':_0xbf3683}),{id:_0x5e90c4,entity:_0x26cc55}=normalizeEntityWithIdResponse(_0x313799[_0x5e058f(0x1c6)]);if(!(_0x5e058f(0x1a3)in _0x26cc55)){if(_0xbf3683['sqlCode'])return getSqlQueryDetail(_0xbf3683['sqlCode']);if(_0x5e90c4)return getSqlQueryDetailById(_0x5e90c4);}return normalizeSqlQueryEntity(_0x26cc55);}export async function deleteSqlQuery(_0x4c207e){const _0x22e23f=a145_0x2e87;await apiRequest(_0x22e23f(0x19c),{'method':_0x22e23f(0x15a),'body':_0x4c207e});}export async function saveSqlQuery(_0x4c2552){const _0x507a7a=a145_0x2e87,_0x114e13=await apiRequest(_0x507a7a(0x135),{'method':_0x507a7a(0x15a),'body':_0x4c2552});return _0x114e13[_0x507a7a(0x1c6)];}function normalizeSqlQueryEntity(_0x3cca09){const _0x4c08bd=a145_0x2e87;return{..._0x3cca09,'id':Number(_0x3cca09['id']),'dbId':_0x3cca09['dbId']==null?undefined:Number(_0x3cca09[_0x4c08bd(0x1ca)]),'version':_0x3cca09[_0x4c08bd(0x174)]==null?undefined:Number(_0x3cca09[_0x4c08bd(0x174)])};}export async function executeSql(_0xfa2b26,_0x44525f,_0x2ba626){const _0x590e3f=a145_0x2e87,_0x50478f=await apiRequest('/api/custom/executeSql',{'method':_0x590e3f(0x15a),'body':{'appCode':_0xfa2b26,'sqlCode':_0x44525f,..._0x2ba626&&{'params':_0x2ba626}},'useRuntime':!![]});return _0x50478f[_0x590e3f(0x1c6)];}export async function executeDatasetDataOperation(_0x52df24,_0x4373d7,_0x55a023,_0x387083={}){const _0xf676c9=a145_0x2e87;try{const _0x18b4a8=await apiRequest(_0xf676c9(0x14b)+_0x52df24+'/'+_0x4373d7+'/'+_0x55a023,{'method':_0xf676c9(0x15a),'body':_0x387083,'useRuntime':!![]});return _0x18b4a8[_0xf676c9(0x1c6)];}catch(_0x4eddf8){if(_0x55a023===_0xf676c9(0x1b8)&&_0x4eddf8 instanceof CliError&&_0x4eddf8[_0xf676c9(0x124)]===_0xf676c9(0x131)&&_0x387083['id']!==undefined&&_0x387083['id']!==null&&_0x387083['id']!==''){const _0x57bb0e=await apiRequest(_0xf676c9(0x14b)+_0x52df24+'/'+_0x4373d7+_0xf676c9(0x14d),{'method':_0xf676c9(0x15a),'body':{'where':{'id':{'$eq':_0x387083['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0xb6bffa=Array[_0xf676c9(0x159)](_0x57bb0e[_0xf676c9(0x1c6)]?.[_0xf676c9(0x1a6)])?_0x57bb0e['data']['tableData']:[];return _0xb6bffa[0x0]??null;}throw _0x4eddf8;}}export async function listDatasets(_0x1a2d10,_0x3e198d){const _0x473f44=a145_0x2e87,_0x172fbc={'appCode':_0x1a2d10,'deleted':![]};if(_0x3e198d?.[_0x473f44(0x124)])_0x172fbc[_0x473f44(0x124)]=_0x3e198d[_0x473f44(0x124)];if(_0x3e198d?.[_0x473f44(0x170)])_0x172fbc[_0x473f44(0x170)]=_0x3e198d['name'];const _0xdbf5e3=await apiRequest(_0x473f44(0x1cb),{'method':_0x473f44(0x15a),'body':_0x172fbc});return extractList(_0xdbf5e3[_0x473f44(0x1c6)]);}export async function deleteDataset(_0x5a72fb,_0x49d6cd){const _0xc6899e=a145_0x2e87;await apiRequest(_0xc6899e(0x177),{'method':'POST','body':{'appCode':_0x5a72fb,'datasetId':_0x49d6cd}});}export async function searchDatasets(_0x5eb295,_0x19f3e1){const _0x4ffbfc=a145_0x2e87,_0x389570=await listDatasets(_0x5eb295,{'name':_0x19f3e1}),_0x3a1b66=_0x19f3e1[_0x4ffbfc(0x1b2)](),_0x1fbac2=new Set(_0x389570[_0x4ffbfc(0x176)](_0x267b5f=>_0x267b5f['id'])),_0x3f1f5b=_0x389570['filter'](_0x2f9cc5=>_0x2f9cc5[_0x4ffbfc(0x172)]?.['tableName']?.[_0x4ffbfc(0x1b2)]()[_0x4ffbfc(0x1bc)](_0x3a1b66)||_0x2f9cc5[_0x4ffbfc(0x1b7)]?.[_0x4ffbfc(0x1b2)]()[_0x4ffbfc(0x1bc)](_0x3a1b66)),_0x1142cf=await listDatasets(_0x5eb295,{'code':_0x19f3e1});for(const _0x3422c8 of _0x1142cf){!_0x1fbac2['has'](_0x3422c8['id'])&&(_0x389570['push'](_0x3422c8),_0x1fbac2[_0x4ffbfc(0x18b)](_0x3422c8['id']));}return _0x389570;}export function normalizeDatasetOperations(_0x17200e){const _0x297994=a145_0x2e87;if(Array[_0x297994(0x159)](_0x17200e))return _0x17200e[_0x297994(0x152)](_0x43f856=>_0x43f856!=null&&typeof _0x43f856==='object');if(_0x17200e&&typeof _0x17200e===_0x297994(0x150))return Object['entries'](_0x17200e)[_0x297994(0x152)](([,_0x578d3e])=>_0x578d3e!=null&&typeof _0x578d3e===_0x297994(0x150))['map'](([_0x26abd4,_0x5d1ffb])=>({..._0x5d1ffb,'name':_0x5d1ffb[_0x297994(0x170)]??_0x5d1ffb[_0x297994(0x13d)]??_0x26abd4}));return[];}export async function getDatasetDetail(_0x31797e){const _0x2b81ab=a145_0x2e87,_0x4cfaa7=/^\d+$/['test'](_0x31797e)?'id':'code',_0x2f4bd0=await apiRequest(_0x2b81ab(0x197)+_0x4cfaa7+'='+_0x31797e);return _0x2f4bd0[_0x2b81ab(0x1c6)];}export async function updateDrivenData(_0x21d167){const _0x2aa81e=a145_0x2e87,_0x21986e=await apiRequest(_0x2aa81e(0x1be),{'method':_0x2aa81e(0x15a),'body':_0x21d167});return _0x21986e[_0x2aa81e(0x1c6)];}export async function getDatasetOperations(_0x149f5f){const _0x3bd50c=a145_0x2e87,_0x38a961=await getDatasetDetail(_0x149f5f),_0x3d4085=normalizeDatasetOperations(_0x38a961[_0x3bd50c(0x1aa)])[_0x3bd50c(0x176)](_0x35fba1=>({'name':_0x35fba1[_0x3bd50c(0x170)]||_0x35fba1[_0x3bd50c(0x13d)],'displayName':_0x35fba1[_0x3bd50c(0x182)]||_0x35fba1['name'],'type':_0x35fba1[_0x3bd50c(0x19e)],'method':_0x35fba1[_0x3bd50c(0x19f)],'path':_0x35fba1['path'],'enabled':_0x35fba1[_0x3bd50c(0x121)]??!![],'requestFields':_0x35fba1[_0x3bd50c(0x134)],'responseFields':_0x35fba1['responseFields']}));return{'dataset':{'id':_0x38a961['id']??_0x38a961[_0x3bd50c(0x193)],'name':_0x38a961[_0x3bd50c(0x170)],'code':_0x38a961['code']||_0x38a961['modelCode'],'tableName':_0x38a961[_0x3bd50c(0x169)]||_0x38a961[_0x3bd50c(0x172)]?.[_0x3bd50c(0x169)]},'operations':_0x3d4085};}export async function getOperationDetail(_0x32e7f2,_0x87efc4,_0x574abc){const _0x5bc990=a145_0x2e87;let _0x363ce8=_0x87efc4;if(!/^\d+$/[_0x5bc990(0x17b)](_0x87efc4)){const _0x3f922e=await listDatasets(_0x32e7f2,{'code':_0x87efc4}),_0xc78212=_0x3f922e[_0x5bc990(0x15b)](_0x2e323b=>_0x2e323b[_0x5bc990(0x124)]===_0x87efc4||String(_0x2e323b['id'])===_0x87efc4);if(!_0xc78212)throw CliErrors[_0x5bc990(0x120)](_0x5bc990(0x158)+_0x87efc4);_0x363ce8=String(_0xc78212['id']);}const _0x22c0bf=await getDatasetDetail(_0x363ce8),_0x3a27ee=normalizeDatasetOperations(_0x22c0bf['operations'])['find'](_0x2e3d1f=>(_0x2e3d1f[_0x5bc990(0x170)]||_0x2e3d1f['operationName'])===_0x574abc);if(!_0x3a27ee)throw CliErrors['validation'](_0x5bc990(0x15d)+_0x574abc+_0x5bc990(0x12d)+_0x87efc4);return{'dataset':{'id':_0x22c0bf['id']??_0x22c0bf['modelId'],'name':_0x22c0bf[_0x5bc990(0x170)],'code':_0x22c0bf['code']||_0x22c0bf[_0x5bc990(0x157)],'tableName':_0x22c0bf[_0x5bc990(0x169)]||_0x22c0bf[_0x5bc990(0x172)]?.[_0x5bc990(0x169)]},'operation':_0x3a27ee};}export async function startGenerateStandardPages(_0x3b7fe8,_0x44d94e,_0x3b0571){const _0x373160=a145_0x2e87,_0x3f3d66=await apiRequest(_0x373160(0x185)+_0x44d94e+_0x373160(0x160),{'method':_0x373160(0x15a),'body':{'appCode':_0x3b7fe8,..._0x3b0571?.[_0x373160(0x165)]?{'clientOperationId':_0x3b0571[_0x373160(0x165)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3f3d66[_0x373160(0x1c6)];}export async function getGenerateStandardPagesStatus(_0xf851ef,_0x192ebe,_0x231674){const _0x4c3fe6=a145_0x2e87,_0x517e31=new URLSearchParams({'appCode':_0xf851ef});_0x231674[_0x4c3fe6(0x16d)]&&_0x517e31[_0x4c3fe6(0x14a)](_0x4c3fe6(0x16d),_0x231674[_0x4c3fe6(0x16d)]);_0x231674[_0x4c3fe6(0x165)]&&_0x517e31[_0x4c3fe6(0x14a)](_0x4c3fe6(0x165),_0x231674['clientOperationId']);const _0x3f1f0d=await apiRequest(_0x4c3fe6(0x185)+_0x192ebe+_0x4c3fe6(0x189)+_0x517e31[_0x4c3fe6(0x16c)]());return _0x3f1f0d[_0x4c3fe6(0x1c6)];}export async function getStandardPageStatus(_0x3369d0,_0x174282){const _0x224a38=a145_0x2e87,_0x4566d5=await apiRequest(_0x224a38(0x185)+_0x174282+_0x224a38(0x164)+encodeURIComponent(_0x3369d0));return _0x4566d5['data'];}export async function tryGetStandardPageStatus(_0x5f290f,_0x158303){const _0x1554ff=a145_0x2e87;try{return await getStandardPageStatus(_0x5f290f,_0x158303);}catch(_0x356660){if(_0x356660 instanceof CliError&&_0x356660[_0x1554ff(0x124)]===_0x1554ff(0x131)&&/404|not found|non-json response/i['test'](_0x356660[_0x1554ff(0x1b9)]))return null;throw _0x356660;}}export async function syncStandardPages(_0xf3da9a,_0x266804){const _0x55729b=a145_0x2e87,_0x51b15d=await apiRequest(_0x55729b(0x185)+_0x266804+_0x55729b(0x16a),{'method':_0x55729b(0x15a),'body':{'appCode':_0xf3da9a}});return _0x51b15d[_0x55729b(0x1c6)];}export async function getPageDetail(_0x7c310a){const _0x175dad=a145_0x2e87,_0x361a8d=await apiRequest(_0x175dad(0x181)+_0x7c310a);if(!_0x361a8d[_0x175dad(0x1c6)])throw CliErrors[_0x175dad(0x120)](_0x175dad(0x167)+_0x7c310a);return _0x361a8d[_0x175dad(0x1c6)];}export async function updatePage(_0x32b606,_0x390a2f,_0x162771,_0x260bb9){const _0x22c5ce=a145_0x2e87,_0x3e181e=await apiRequest(_0x22c5ce(0x1af),{'method':'POST','body':{'appCode':_0x32b606,'pageId':_0x390a2f,'code':_0x162771,'datasetIds':_0x260bb9}});return _0x3e181e[_0x22c5ce(0x1c6)];}export function generateSdkCode(_0x32140a,_0x383e0f,_0x2b9649){const _0x52230d=a145_0x2e87,_0x2784bd=_0x2b9649?.[_0x52230d(0x16e)]??!![],_0x313717=_0x52230d(0x1c8)+_0x32140a['code']?.['replace'](/-/g,'_'),_0x17f7dc=_0x383e0f[_0x52230d(0x170)]||_0x383e0f[_0x52230d(0x13d)]||_0x52230d(0x152),_0x51ba1e=[];_0x2784bd&&_0x51ba1e['push'](_0x52230d(0x155),'',_0x52230d(0x187),'');_0x51ba1e['push'](_0x52230d(0x1a8)+_0x32140a[_0x52230d(0x170)]+'\x20('+(_0x32140a['tableName']||_0x52230d(0x11d))+')');if(_0x17f7dc===_0x52230d(0x152))_0x51ba1e[_0x52230d(0x146)]('const\x20result\x20=\x20await\x20client.models.'+_0x313717+_0x52230d(0x1a5),_0x52230d(0x154),_0x52230d(0x191),_0x52230d(0x19b),'});');else{if(_0x17f7dc==='getOne')_0x51ba1e[_0x52230d(0x146)]('const\x20result\x20=\x20await\x20client.models.'+_0x313717+_0x52230d(0x14e));else{if(_0x17f7dc===_0x52230d(0x13f))_0x51ba1e[_0x52230d(0x146)](_0x52230d(0x127)+_0x313717+_0x52230d(0x153));else{if(_0x17f7dc===_0x52230d(0x1a2))_0x51ba1e[_0x52230d(0x146)](_0x52230d(0x127)+_0x313717+_0x52230d(0x12f));else _0x17f7dc===_0x52230d(0x175)||_0x17f7dc==='remove'?_0x51ba1e[_0x52230d(0x146)](_0x52230d(0x127)+_0x313717+_0x52230d(0x143)):_0x51ba1e['push'](_0x52230d(0x127)+_0x313717+'.'+_0x17f7dc+_0x52230d(0x15e));}}}return _0x51ba1e[_0x52230d(0x1ac)]('\x0a');}export function generateSqlCodeTemplate(_0x363d05,_0x21b2f4){const _0x118484=a145_0x2e87,_0x19b287=_0x21b2f4?.[_0x118484(0x198)]??_0x118484(0x161),_0x5997ec=_0x21b2f4?.['includeImports']??!![],_0x124732=[];return _0x124732[_0x118484(0x146)](_0x118484(0x12a)+_0x363d05[_0x118484(0x123)]+'\x20('+_0x363d05['sqlCode']+')'),_0x19b287===_0x118484(0x161)?(_0x5997ec&&_0x124732[_0x118484(0x146)](_0x118484(0x155),'',_0x118484(0x187),''),_0x124732[_0x118484(0x146)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x118484(0x128)+_0x363d05[_0x118484(0x1a3)]+'\x27,',_0x118484(0x166),_0x118484(0x18f),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x118484(0x12c))):_0x124732[_0x118484(0x146)](_0x118484(0x17c),_0x118484(0x145),_0x118484(0x173),_0x118484(0x144)+_0x363d05['sqlCode']+'\x27,',_0x118484(0x11f),_0x118484(0x192),_0x118484(0x13a),'}'),_0x124732[_0x118484(0x1ac)]('\x0a');}export async function getErConfig(_0x3a0f42,_0x4e54a0){const _0x20e934=a145_0x2e87,_0x384842=await apiRequest(_0x20e934(0x1bb),{'method':_0x20e934(0x15a),'body':{'appCode':_0x3a0f42,'dblinkId':_0x4e54a0}});return _0x384842[_0x20e934(0x1c6)];}export async function createErRelation(_0x2c4ba3){const _0x4ab2ca=a145_0x2e87,_0x172c32=await apiRequest(_0x4ab2ca(0x18e),{'method':_0x4ab2ca(0x15a),'body':_0x2c4ba3,'allowNonJsonSuccess':!![]});return _0x172c32[_0x4ab2ca(0x1c6)];}export async function updateErRelation(_0x326d86){const _0x286be7=a145_0x2e87,_0x12a982=await apiRequest(_0x286be7(0x1bf),{'method':_0x286be7(0x15a),'body':_0x326d86,'allowNonJsonSuccess':!![]});return _0x12a982[_0x286be7(0x1c6)];}export async function deleteErRelation(_0x34e31f){const _0x20214c=a145_0x2e87,_0x212219=await apiRequest(_0x20214c(0x15f),{'method':_0x20214c(0x15a),'body':_0x34e31f,'allowNonJsonSuccess':!![]});return _0x212219[_0x20214c(0x1c6)];}function buildQuery(_0x1f968b){const _0x3407aa=a145_0x2e87,_0x563b9c=new URLSearchParams();for(const [_0x5664f0,_0x19707c]of Object[_0x3407aa(0x18d)](_0x1f968b)){if(_0x19707c===undefined||_0x19707c==='')continue;_0x563b9c[_0x3407aa(0x14a)](_0x5664f0,String(_0x19707c));}const _0x596c5e=_0x563b9c[_0x3407aa(0x16c)]();return _0x596c5e?'?'+_0x596c5e:'';}export async function listDbLinks(_0x1ad9c4,_0x19b30c){const _0x9a8110=a145_0x2e87,_0x56cc23=await apiRequest(_0x9a8110(0x1c7),{'method':'POST','body':{'appCode':_0x1ad9c4,'currentPage':_0x19b30c?.['currentPage']??0x1,'pageSize':_0x19b30c?.['pageSize']??0x64}});return{'items':extractList(_0x56cc23[_0x9a8110(0x1c6)]),'paging':extractPaging(_0x56cc23[_0x9a8110(0x1c6)])};}export async function getDbLinkInfo(_0x291966){const _0xbe7bc0=a145_0x2e87,_0x20dd85=await apiRequest(_0xbe7bc0(0x179)+buildQuery({'id':_0x291966}));return _0x20dd85[_0xbe7bc0(0x1c6)];}export async function createDbLink(_0xd20033){const _0x18b97f=a145_0x2e87,_0xc2cad9=await apiRequest(_0x18b97f(0x1a1),{'method':_0x18b97f(0x15a),'body':_0xd20033});return _0xc2cad9[_0x18b97f(0x1c6)];}export async function updateDbLink(_0x299df4){const _0x5b195a=a145_0x2e87,_0xd20f87=await apiRequest(_0x5b195a(0x139),{'method':_0x5b195a(0x15a),'body':_0x299df4});return _0xd20f87['data'];}export async function deleteDbLink(_0x27f688){const _0xda0422=a145_0x2e87;await apiRequest(_0xda0422(0x1c2),{'method':_0xda0422(0x15a),'body':{'id':_0x27f688}});}export async function testDbLinkConnect(_0x1c301a){const _0x3d7be7=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x1c301a}));return _0x3d7be7['data'];}export async function startDbAnalysis(_0x49a9cc,_0x346d9a){const _0x48e57d=a145_0x2e87,_0x1d06eb=await apiRequest(_0x48e57d(0x11c),{'method':_0x48e57d(0x15a),'body':{'dbLinkId':_0x49a9cc,..._0x346d9a&&_0x346d9a[_0x48e57d(0x12e)]>0x0?{'tableNames':_0x346d9a}:{}}}),_0x5e9e3f=_0x1d06eb['data'];if(typeof _0x5e9e3f===_0x48e57d(0x194))return _0x5e9e3f;if(_0x5e9e3f&&typeof _0x5e9e3f===_0x48e57d(0x150)&&typeof _0x5e9e3f[_0x48e57d(0x14f)]===_0x48e57d(0x194))return _0x5e9e3f[_0x48e57d(0x14f)];return _0x5e9e3f!=null?String(_0x5e9e3f):'';}export async function cancelDbAnalysis(_0x571ecc){await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x571ecc}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x2d0a9b){const _0x2416f4=a145_0x2e87,_0x4227db=await apiRequest(_0x2416f4(0x180)+encodeURIComponent(_0x2d0a9b));return _0x4227db[_0x2416f4(0x1c6)];}export async function getDbAllTableList(_0x55baa5,_0xe8a18d){const _0x3002a6=a145_0x2e87,_0x182549=await apiRequest(_0x3002a6(0x168)+buildQuery({'appCode':_0x55baa5,'dbLinkId':_0xe8a18d})),_0x413456=_0x182549[_0x3002a6(0x1c6)];if(Array[_0x3002a6(0x159)](_0x413456))return _0x413456;return extractList(_0x413456);}export async function getDbTableDiff(_0x3a74ae,_0x3a564e,_0x58f4c5){const _0x39d5fc=a145_0x2e87,_0x3a3102=await apiRequest(_0x39d5fc(0x17d)+buildQuery({'appCode':_0x3a74ae,'dbLinkId':_0x3a564e,'pageIndex':_0x58f4c5?.['pageIndex']??0x1,'pageSize':_0x58f4c5?.['pageSize']??0x14,'tableName':_0x58f4c5?.[_0x39d5fc(0x169)]})),_0x5ba00d=_0x3a3102[_0x39d5fc(0x1c6)];return{'totalCount':_0x5ba00d?.[_0x39d5fc(0x188)]??0x0,'tableList':Array[_0x39d5fc(0x159)](_0x5ba00d?.[_0x39d5fc(0x151)])?_0x5ba00d[_0x39d5fc(0x151)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;function a145_0x2f82(){const _0x582ab9=['/generate-standard-pages/start','sdk','\x20failed','/api/management/library/scripts/list?appCode=','/standard-page-status?appCode=','clientOperationId','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','Page\x20not\x20found:\x20','/smartapi/dblink/getAllTableList','tableName','/sync-to-pages','functionName','toString','operationId','includeImports','741132gJFwAl','name','AbortError','dbtableConfig','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','version','delete','map','/smartapi/dataset/delete-dataset','/smartapi/custom/updateUserCustomSql','/smartapi/dblink/getOne','\x20of\x20','test','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/dblink/getTableDiffV2ByPage','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','72FNADVD','/smartapi/db-analysis/status/','/smartapi/lovrabet/detail?pageId=','displayName','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/custom/queryUserCustomSqlList','/smartapi/lovrabet/dataset/','24QGihMZ','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','totalCount','/generate-standard-pages/status?','?sqlCode=','add','errorCode','entries','/smartapi/question/er-config/erCreate','});','authRequired','\x20\x20pageSize:\x2020,','\x20\x20});','modelId','string','cookie','label','/smartapi/dataset/get-driven-data?','target','UNAUTHORIZED','/smartapi/custom/saveUserCustomSql','\x20\x20currentPage:\x201,','/smartapi/custom/deleteUserCustomSql','cli:rabetbase','type','method','234pYWyAJ','/smartapi/dblink/create','update','sqlCode','status','.filter({','tableData','scriptType','//\x20','errorMsg','operations','31966UdGUxk','join','92490SDDDEK','abort','/smartapi/lovrabet/update-page','Unauthorized','/smartapi/app/getList','toLowerCase','24897uQophm','/api/management/library/scripts/info?id=','/smartapi/custom/getUserCustomSql','json','description','getOne','message','currentPage','/smartapi/question/er-config','includes','/api/management/library/scripts/delete','/smartapi/dataset/update-driven-data','/smartapi/question/er-config/update-single','success','body','/smartapi/dblink/delete','apiError','/api/management/library/scripts/statistics?appCode=','/smartapi/custom/getUserCustomSql?id=','data','/smartapi/dblink/getList','dataset_','stringify','dbId','/smartapi/dataset/get-dataset-list','/smartapi/db-analysis/start','table','GET','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','validation','enabled','132ajWNXl','sqlName','code','1673rZLhhi','\x20failed,\x20HTTP\x20','const\x20result\x20=\x20await\x20client.models.','\x20\x20sqlCode:\x20\x27','warn','//\x20SQL:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','const\x20results\x20=\x20data.execResult\x20||\x20[];','\x22\x20not\x20found\x20in\x20dataset\x20','length','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','API\x20error\x20code:\x20','api_error','SQL\x20query\x20not\x20found:\x20','401','requestFields','/api/node-toolbox/sql/save','50770tteEqS','Warning:\x20showing\x20first\x20','signal','/smartapi/dblink/update','\x20\x20return\x20rows;','/api/management/script/cache/clear','Check\x20network\x20connectivity\x20and\x20try\x20again.','operationName','/smartapi/dataset/get-dataset-operation','create','2182TengII','application/json','errorMessage','.remove(id);','\x20\x20\x20\x20sqlCode:\x20\x27','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','push','Request\x20failed:\x20','\x20apps.\x20','pageSize','set','/api/','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/filter','.getOne(id);','planId','object','tableList','filter','.create({\x20/*\x20fields\x20*/\x20});','\x20\x20where:\x20{},','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','BFF\x20script\x20not\x20found:\x20id=','modelCode','Dataset\x20not\x20found:\x20','isArray','POST','find','Request\x20timeout:\x20','Operation\x20\x22','(/*\x20params\x20*/);','/smartapi/question/er-config/erDelete'];a145_0x2f82=function(){return _0x582ab9;};return a145_0x2f82();}export async function listRemoteApps(){const _0x544aaf=a145_0x2e87,_0x1ce901=await apiRequest(_0x544aaf(0x1b1),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x419882=extractList(_0x1ce901[_0x544aaf(0x1c6)]),_0x1e4990=extractPaging(_0x1ce901['data']);return _0x1e4990&&_0x1e4990[_0x544aaf(0x188)]>REMOTE_APP_PAGE_SIZE&&console[_0x544aaf(0x129)](_0x544aaf(0x137)+REMOTE_APP_PAGE_SIZE+_0x544aaf(0x17a)+_0x1e4990[_0x544aaf(0x188)]+_0x544aaf(0x148)+_0x544aaf(0x14c)),_0x419882;}
@@ -1 +1 @@
1
- const a146_0x179250=a146_0x33ce;(function(_0x5bd9c3,_0x317fd6){const _0x2bc2b1=a146_0x33ce,_0x5d6b32=_0x5bd9c3();while(!![]){try{const _0x28dd21=parseInt(_0x2bc2b1(0x1be))/0x1*(-parseInt(_0x2bc2b1(0x1c7))/0x2)+parseInt(_0x2bc2b1(0x1c1))/0x3*(parseInt(_0x2bc2b1(0x1bb))/0x4)+parseInt(_0x2bc2b1(0x1c6))/0x5*(-parseInt(_0x2bc2b1(0x1ba))/0x6)+-parseInt(_0x2bc2b1(0x1c8))/0x7*(-parseInt(_0x2bc2b1(0x1bd))/0x8)+-parseInt(_0x2bc2b1(0x1c0))/0x9+-parseInt(_0x2bc2b1(0x1c2))/0xa*(-parseInt(_0x2bc2b1(0x1c4))/0xb)+-parseInt(_0x2bc2b1(0x1bc))/0xc*(-parseInt(_0x2bc2b1(0x1c5))/0xd);if(_0x28dd21===_0x317fd6)break;else _0x5d6b32['push'](_0x5d6b32['shift']());}catch(_0x28f3e1){_0x5d6b32['push'](_0x5d6b32['shift']());}}}(a146_0x5558,0xe0f1a));import{resolve}from'node:path';function a146_0x33ce(_0x2ca1fe,_0x58cf94){_0x2ca1fe=_0x2ca1fe-0x1b9;const _0x5558a6=a146_0x5558();let _0x33cedc=_0x5558a6[_0x2ca1fe];return _0x33cedc;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a146_0x179250(0x1c9),LOCK_FILE_NAME=a146_0x179250(0x1b9),TRASH_DIR_NAME=a146_0x179250(0x1c3);export function loadBffProjectConfig(_0x743a87,_0x1bc5d0){const _0x319caa=a146_0x179250,_0x1bd98b=resolve(_0x1bc5d0??findProjectRootDirectory()),_0x23cb44=DOT_DIR+_0x319caa(0x1bf),_0x1236c7=_0x23cb44+'/'+_0x743a87;return{'projectRoot':_0x1bd98b,'appCode':_0x743a87,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x23cb44,'scriptsRoot':_0x1236c7,'scriptsRootDir':resolve(_0x1bd98b,DOT_DIR,'bff',_0x743a87),'lockFilePath':resolve(_0x1bd98b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1bd98b,DOT_DIR,TRASH_DIR_NAME)};}function a146_0x5558(){const _0x47bc11=['66655duwnbp','38DlWcAX','7ziiuQD','.rabetbase','bff.lock.json','312HgMHCX','124piOazU','13092Scfssi','9186544uyvIRz','82963dIUyMN','/bff','3294180TjaEEc','171465prcpBW','3400IxVFqr','bff-trash','17919CALoOo','988LJYFxA'];a146_0x5558=function(){return _0x47bc11;};return a146_0x5558();}
1
+ const a146_0x34ac3b=a146_0x1a57;(function(_0x39c978,_0x2c2748){const _0x1945f4=a146_0x1a57,_0x519ee2=_0x39c978();while(!![]){try{const _0x608459=parseInt(_0x1945f4(0x197))/0x1+parseInt(_0x1945f4(0x199))/0x2+parseInt(_0x1945f4(0x193))/0x3+parseInt(_0x1945f4(0x191))/0x4+parseInt(_0x1945f4(0x190))/0x5+parseInt(_0x1945f4(0x196))/0x6+-parseInt(_0x1945f4(0x19a))/0x7;if(_0x608459===_0x2c2748)break;else _0x519ee2['push'](_0x519ee2['shift']());}catch(_0x58b87e){_0x519ee2['push'](_0x519ee2['shift']());}}}(a146_0x5ca1,0xcef1c));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a146_0x34ac3b(0x194),LOCK_FILE_NAME=a146_0x34ac3b(0x18f),TRASH_DIR_NAME=a146_0x34ac3b(0x195);function a146_0x1a57(_0x232621,_0x510169){_0x232621=_0x232621-0x18f;const _0x5ca192=a146_0x5ca1();let _0x1a5770=_0x5ca192[_0x232621];return _0x1a5770;}export function loadBffProjectConfig(_0x322edb,_0x2e4d09){const _0x27ef39=a146_0x34ac3b,_0x4282a5=resolve(_0x2e4d09??findProjectRootDirectory()),_0x3ece9e=DOT_DIR+_0x27ef39(0x192),_0x5b1e35=_0x3ece9e+'/'+_0x322edb;return{'projectRoot':_0x4282a5,'appCode':_0x322edb,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3ece9e,'scriptsRoot':_0x5b1e35,'scriptsRootDir':resolve(_0x4282a5,DOT_DIR,_0x27ef39(0x198),_0x322edb),'lockFilePath':resolve(_0x4282a5,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4282a5,DOT_DIR,TRASH_DIR_NAME)};}function a146_0x5ca1(){const _0x185fc4=['1028558dWCcnV','bff','2182196iPOhHJ','24536099WJzeIi','bff.lock.json','1777945tMHFnR','2638624UyzHVz','/bff','1497969zjrxPJ','.rabetbase','bff-trash','4311462fboldo'];a146_0x5ca1=function(){return _0x185fc4;};return a146_0x5ca1();}
@@ -1 +1 @@
1
- const a147_0x48f96c=a147_0x4d74;(function(_0x1bdd45,_0x40cca4){const _0x2a4142=a147_0x4d74,_0x133d03=_0x1bdd45();while(!![]){try{const _0x98ac31=-parseInt(_0x2a4142(0x1e8))/0x1*(-parseInt(_0x2a4142(0x1cd))/0x2)+parseInt(_0x2a4142(0x1e4))/0x3+parseInt(_0x2a4142(0x1e2))/0x4*(-parseInt(_0x2a4142(0x1de))/0x5)+parseInt(_0x2a4142(0x1ef))/0x6*(-parseInt(_0x2a4142(0x1d4))/0x7)+parseInt(_0x2a4142(0x1ce))/0x8*(parseInt(_0x2a4142(0x1e5))/0x9)+-parseInt(_0x2a4142(0x1cb))/0xa*(parseInt(_0x2a4142(0x1dc))/0xb)+parseInt(_0x2a4142(0x1e7))/0xc;if(_0x98ac31===_0x40cca4)break;else _0x133d03['push'](_0x133d03['shift']());}catch(_0x386e10){_0x133d03['push'](_0x133d03['shift']());}}}(a147_0x29a0,0xec98c));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a147_0x48f96c(0x1d5),a147_0x48f96c(0x1e6),a147_0x48f96c(0x1ee)];export function normalizeBffType(_0x437f29){const _0x56f589=a147_0x48f96c;if(!_0x437f29)return undefined;const _0x435c42=_0x437f29[_0x56f589(0x1d0)]()[_0x56f589(0x1d8)]();return SUPPORTED_BFF_TYPES[_0x56f589(0x1d2)](_0x435c42)?_0x435c42:undefined;}async function scanJsFilesRecursively(_0x2b68d4,_0x55f3b4){const _0x389f45=a147_0x48f96c,_0x1715b7=[];try{const _0x491376=await readdir(_0x2b68d4,{'withFileTypes':!![]});for(const _0x4138ba of _0x491376){const _0x170c48=join(_0x2b68d4,_0x4138ba['name']);if(_0x4138ba[_0x389f45(0x1e0)]())_0x1715b7['push'](...await scanJsFilesRecursively(_0x170c48,_0x55f3b4+'/'+_0x4138ba['name']));else _0x4138ba[_0x389f45(0x1da)]()&&_0x4138ba[_0x389f45(0x1df)][_0x389f45(0x1eb)](_0x389f45(0x1ec))&&_0x1715b7[_0x389f45(0x1cf)]({'lockKey':_0x55f3b4+'/'+_0x4138ba[_0x389f45(0x1df)][_0x389f45(0x1d7)](/\.js$/,''),'filePath':_0x170c48});}}catch(_0x264be6){if(_0x264be6[_0x389f45(0x1e1)]!=='ENOENT')throw _0x264be6;}return _0x1715b7;}async function scanFlatFunctions(_0x69a48c,_0x72167e){const _0x519aba=a147_0x48f96c,_0x29173c=join(_0x69a48c['scriptsRootDir'],_0x72167e),_0x549370=await scanJsFilesRecursively(_0x29173c,_0x72167e);return _0x549370[_0x519aba(0x1ea)](({lockKey:_0x2e5da1,filePath:_0x1ebc18})=>({'type':_0x72167e,'name':_0x2e5da1[_0x519aba(0x1ca)]('/')['at'](-0x1)??'','filePath':_0x1ebc18,'lockKey':_0x2e5da1}));}async function scanHookFunctions(_0x3719a5){const _0x14af20=a147_0x48f96c,_0x2cc20e=join(_0x3719a5[_0x14af20(0x1c9)],'HOOK'),_0x1e04ba=[];try{const _0x50af04=await readdir(_0x2cc20e,{'withFileTypes':!![]});for(const _0x24ec7d of _0x50af04){if(!_0x24ec7d[_0x14af20(0x1e0)]())continue;const _0x5c6969=_0x24ec7d['name'],_0x12fc1d=join(_0x2cc20e,_0x5c6969),_0x5a7ce8=await readdir(_0x12fc1d,{'withFileTypes':!![]});for(const _0x571827 of _0x5a7ce8){if(!_0x571827[_0x14af20(0x1e0)]())continue;const _0x20d53c=_0x571827['name'],_0x3fbf82=join(_0x12fc1d,_0x20d53c),_0x403789=await readdir(_0x3fbf82,{'withFileTypes':!![]});for(const _0x3ed204 of _0x403789){if(!_0x3ed204[_0x14af20(0x1e0)]())continue;const _0x135a85=_0x3ed204['name'],_0x5560af=join(_0x3fbf82,_0x135a85),_0x2435f1=await readdir(_0x5560af,{'withFileTypes':!![]});for(const _0x28b93d of _0x2435f1){if(!_0x28b93d[_0x14af20(0x1da)]()||!_0x28b93d[_0x14af20(0x1df)]['endsWith'](_0x14af20(0x1ec)))continue;const _0x11cb6=_0x28b93d[_0x14af20(0x1df)][_0x14af20(0x1d7)](/\.js$/,'');_0x1e04ba[_0x14af20(0x1cf)]({'type':_0x14af20(0x1ee),'name':_0x11cb6,'filePath':join(_0x5560af,_0x28b93d[_0x14af20(0x1df)]),'lockKey':_0x14af20(0x1cc)+_0x5c6969+'/'+_0x20d53c+'/'+_0x135a85+'/'+_0x11cb6,'alias':_0x5c6969,'operationType':_0x20d53c,'functionNode':_0x135a85});}}}}}catch(_0x53d41a){if(_0x53d41a[_0x14af20(0x1e1)]!==_0x14af20(0x1dd))throw _0x53d41a;}return _0x1e04ba;}export async function scanLocalBffFunctions(_0x4e8375,_0x3bb8b7){const _0x4dad24=a147_0x48f96c;if(_0x3bb8b7==='COMMON'||_0x3bb8b7==='ENDPOINT')return scanFlatFunctions(_0x4e8375,_0x3bb8b7);if(_0x3bb8b7===_0x4dad24(0x1ee))return scanHookFunctions(_0x4e8375);const [_0x4847b0,_0x4d7194,_0x27af02]=await Promise['all']([scanFlatFunctions(_0x4e8375,'COMMON'),scanFlatFunctions(_0x4e8375,_0x4dad24(0x1e6)),scanHookFunctions(_0x4e8375)]);return[..._0x4847b0,..._0x4d7194,..._0x27af02];}export function resolveLocalFilePathFromLockKey(_0x23807f,_0x3d1647){const _0x3dadd4=a147_0x48f96c;return join(_0x23807f[_0x3dadd4(0x1c9)],..._0x3d1647[_0x3dadd4(0x1ca)]('/'))+_0x3dadd4(0x1ec);}function a147_0x4d74(_0x2d5586,_0x2a7d49){_0x2d5586=_0x2d5586-0x1c9;const _0x29a0b4=a147_0x29a0();let _0x4d7409=_0x29a0b4[_0x2d5586];return _0x4d7409;}export function createHookLocationMap(_0x2dd18a){const _0x1309ee=a147_0x48f96c,_0x553577=new Map();for(const _0xe94ca9 of _0x2dd18a){_0xe94ca9['beforeScriptId']&&_0x553577[_0x1309ee(0x1d6)](_0xe94ca9[_0x1309ee(0x1d3)],{'datasetCode':_0xe94ca9['datasetCode'],'operationType':snakeToCamel(_0xe94ca9[_0x1309ee(0x1db)]),'functionNode':_0x1309ee(0x1e9)}),_0xe94ca9[_0x1309ee(0x1f0)]&&_0x553577[_0x1309ee(0x1d6)](_0xe94ca9[_0x1309ee(0x1f0)],{'datasetCode':_0xe94ca9[_0x1309ee(0x1d1)],'operationType':snakeToCamel(_0xe94ca9[_0x1309ee(0x1db)]),'functionNode':_0x1309ee(0x1ed)});}return _0x553577;}export function resolveRemoteScriptTarget(_0x4b5680,_0x50402a,_0x431ac7,_0x3a7a31,_0x376054){const _0x525542=a147_0x48f96c,_0x10231e=normalizeBffType(_0x50402a['scriptType']);if(!_0x10231e||!_0x50402a[_0x525542(0x1d9)])return null;if(_0x10231e===_0x525542(0x1ee)){const _0x4a0556=(_0x50402a['id']?_0x431ac7[_0x525542(0x1e3)](_0x50402a['id']):undefined)??findHookLocationByRemoteId(_0x3a7a31,_0x50402a['id']);if(!_0x4a0556)return null;const _0x2c0c09=_0x4a0556['alias']||_0x376054[_0x525542(0x1e3)](_0x4a0556[_0x525542(0x1d1)]),_0x585b7a=_0x2c0c09??_0x4a0556[_0x525542(0x1d1)],_0x3eca3d={..._0x4a0556,'alias':_0x2c0c09},_0xc39c26=_0x525542(0x1cc)+_0x585b7a+'/'+_0x3eca3d[_0x525542(0x1db)]+'/'+_0x3eca3d[_0x525542(0x1f1)]+'/'+_0x50402a[_0x525542(0x1d9)];return{'lockKey':_0xc39c26,'filePath':resolveLocalFilePathFromLockKey(_0x4b5680,_0xc39c26),'type':_0x525542(0x1ee),'hookLocation':_0x3eca3d};}const _0x40fc1a=_0x10231e+'/'+_0x50402a[_0x525542(0x1d9)];return{'lockKey':_0x40fc1a,'filePath':resolveLocalFilePathFromLockKey(_0x4b5680,_0x40fc1a),'type':_0x10231e};}export async function ensureParentDirectory(_0x3772e4){await mkdir(dirname(_0x3772e4),{'recursive':!![]});}export async function fileExists(_0x361d28){try{return await access(_0x361d28,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x543fbb){try{const _0x530996=await stat(_0x543fbb);return _0x530996['isDirectory']();}catch{return![];}}function a147_0x29a0(){const _0x198fff=['beforeScriptId','19145cEemge','COMMON','set','replace','toUpperCase','functionName','isFile','operationType','985721qczWnz','ENOENT','1820290JkVwzH','name','isDirectory','code','4TRYzJO','get','404778naiMOd','16846794gnFiLe','ENDPOINT','27474048HpKEfA','73OVkeoh','before','map','endsWith','.js','after','HOOK','3984WfWsWM','afterScriptId','functionNode','scriptsRootDir','split','140uoAvCx','HOOK/','2944FSRUQh','8MGsynt','push','trim','datasetCode','includes'];a147_0x29a0=function(){return _0x198fff;};return a147_0x29a0();}
1
+ const a147_0xaa517a=a147_0x5bd9;(function(_0x3cc125,_0x684b80){const _0x92a781=a147_0x5bd9,_0xe04c5f=_0x3cc125();while(!![]){try{const _0x3696d9=parseInt(_0x92a781(0x136))/0x1*(parseInt(_0x92a781(0x131))/0x2)+parseInt(_0x92a781(0x142))/0x3+parseInt(_0x92a781(0x140))/0x4*(parseInt(_0x92a781(0x137))/0x5)+parseInt(_0x92a781(0x138))/0x6+parseInt(_0x92a781(0x135))/0x7+-parseInt(_0x92a781(0x11f))/0x8*(-parseInt(_0x92a781(0x12c))/0x9)+-parseInt(_0x92a781(0x130))/0xa*(parseInt(_0x92a781(0x129))/0xb);if(_0x3696d9===_0x684b80)break;else _0xe04c5f['push'](_0xe04c5f['shift']());}catch(_0x1acb73){_0xe04c5f['push'](_0xe04c5f['shift']());}}}(a147_0x20dc,0x93bfb));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a147_0xaa517a(0x12e),'ENDPOINT',a147_0xaa517a(0x13d)];export function normalizeBffType(_0x534fda){const _0x3ab2cc=a147_0xaa517a;if(!_0x534fda)return undefined;const _0x2360d3=_0x534fda[_0x3ab2cc(0x125)]()[_0x3ab2cc(0x13b)]();return SUPPORTED_BFF_TYPES[_0x3ab2cc(0x144)](_0x2360d3)?_0x2360d3:undefined;}async function scanJsFilesRecursively(_0x471803,_0x28c88e){const _0x141f92=a147_0xaa517a,_0x4af6a0=[];try{const _0x31dca9=await readdir(_0x471803,{'withFileTypes':!![]});for(const _0x142fe3 of _0x31dca9){const _0x1e206e=join(_0x471803,_0x142fe3[_0x141f92(0x133)]);if(_0x142fe3['isDirectory']())_0x4af6a0[_0x141f92(0x12a)](...await scanJsFilesRecursively(_0x1e206e,_0x28c88e+'/'+_0x142fe3['name']));else _0x142fe3['isFile']()&&_0x142fe3[_0x141f92(0x133)][_0x141f92(0x127)](_0x141f92(0x126))&&_0x4af6a0[_0x141f92(0x12a)]({'lockKey':_0x28c88e+'/'+_0x142fe3[_0x141f92(0x133)][_0x141f92(0x13a)](/\.js$/,''),'filePath':_0x1e206e});}}catch(_0x4b0dab){if(_0x4b0dab[_0x141f92(0x132)]!==_0x141f92(0x11e))throw _0x4b0dab;}return _0x4af6a0;}async function scanFlatFunctions(_0x19e3c1,_0x115b93){const _0x4cabb9=a147_0xaa517a,_0x2b8605=join(_0x19e3c1[_0x4cabb9(0x143)],_0x115b93),_0x1bcac2=await scanJsFilesRecursively(_0x2b8605,_0x115b93);return _0x1bcac2[_0x4cabb9(0x13f)](({lockKey:_0x3f4c46,filePath:_0x53c997})=>({'type':_0x115b93,'name':_0x3f4c46[_0x4cabb9(0x145)]('/')['at'](-0x1)??'','filePath':_0x53c997,'lockKey':_0x3f4c46}));}async function scanHookFunctions(_0x1c120c){const _0x5a1c8f=a147_0xaa517a,_0x7ec490=join(_0x1c120c['scriptsRootDir'],_0x5a1c8f(0x13d)),_0x51f908=[];try{const _0x64a93e=await readdir(_0x7ec490,{'withFileTypes':!![]});for(const _0x3f59cd of _0x64a93e){if(!_0x3f59cd[_0x5a1c8f(0x11c)]())continue;const _0x55e021=_0x3f59cd[_0x5a1c8f(0x133)],_0x349fa7=join(_0x7ec490,_0x55e021),_0x438804=await readdir(_0x349fa7,{'withFileTypes':!![]});for(const _0x140b5a of _0x438804){if(!_0x140b5a[_0x5a1c8f(0x11c)]())continue;const _0x1fa9a5=_0x140b5a[_0x5a1c8f(0x133)],_0x44924c=join(_0x349fa7,_0x1fa9a5),_0x4855cb=await readdir(_0x44924c,{'withFileTypes':!![]});for(const _0x47a7af of _0x4855cb){if(!_0x47a7af['isDirectory']())continue;const _0x2ce2e9=_0x47a7af[_0x5a1c8f(0x133)],_0x139aa0=join(_0x44924c,_0x2ce2e9),_0x76d7f8=await readdir(_0x139aa0,{'withFileTypes':!![]});for(const _0x5853b0 of _0x76d7f8){if(!_0x5853b0['isFile']()||!_0x5853b0[_0x5a1c8f(0x133)][_0x5a1c8f(0x127)](_0x5a1c8f(0x126)))continue;const _0xd258ba=_0x5853b0[_0x5a1c8f(0x133)]['replace'](/\.js$/,'');_0x51f908[_0x5a1c8f(0x12a)]({'type':'HOOK','name':_0xd258ba,'filePath':join(_0x139aa0,_0x5853b0['name']),'lockKey':_0x5a1c8f(0x12f)+_0x55e021+'/'+_0x1fa9a5+'/'+_0x2ce2e9+'/'+_0xd258ba,'alias':_0x55e021,'operationType':_0x1fa9a5,'functionNode':_0x2ce2e9});}}}}}catch(_0x3e0709){if(_0x3e0709['code']!==_0x5a1c8f(0x11e))throw _0x3e0709;}return _0x51f908;}export async function scanLocalBffFunctions(_0x416ba2,_0x12df10){const _0xdd81a5=a147_0xaa517a;if(_0x12df10===_0xdd81a5(0x12e)||_0x12df10==='ENDPOINT')return scanFlatFunctions(_0x416ba2,_0x12df10);if(_0x12df10===_0xdd81a5(0x13d))return scanHookFunctions(_0x416ba2);const [_0x4635b6,_0x17df2c,_0x598443]=await Promise['all']([scanFlatFunctions(_0x416ba2,_0xdd81a5(0x12e)),scanFlatFunctions(_0x416ba2,_0xdd81a5(0x139)),scanHookFunctions(_0x416ba2)]);return[..._0x4635b6,..._0x17df2c,..._0x598443];}export function resolveLocalFilePathFromLockKey(_0x1bd855,_0x541776){const _0x30a773=a147_0xaa517a;return join(_0x1bd855['scriptsRootDir'],..._0x541776[_0x30a773(0x145)]('/'))+_0x30a773(0x126);}function a147_0x20dc(){const _0x571450=['map','124rtSUmd','alias','3114372GUugBD','scriptsRootDir','includes','split','isDirectory','afterScriptId','ENOENT','4952oBqgiB','beforeScriptId','F_OK','get','after','set','trim','.js','endsWith','operationType','26444hchIEQ','push','before','36hnhTMQ','functionName','COMMON','HOOK/','15400FpfBzf','316SUMacm','code','name','functionNode','8129485vrwhkI','4894pJeRvj','131405Dxkvxu','3104526GuSQHM','ENDPOINT','replace','toUpperCase','datasetCode','HOOK','scriptType'];a147_0x20dc=function(){return _0x571450;};return a147_0x20dc();}export function createHookLocationMap(_0x6a4ed6){const _0x358a62=a147_0xaa517a,_0x37481b=new Map();for(const _0xdcc4d3 of _0x6a4ed6){_0xdcc4d3[_0x358a62(0x120)]&&_0x37481b[_0x358a62(0x124)](_0xdcc4d3[_0x358a62(0x120)],{'datasetCode':_0xdcc4d3[_0x358a62(0x13c)],'operationType':snakeToCamel(_0xdcc4d3[_0x358a62(0x128)]),'functionNode':_0x358a62(0x12b)}),_0xdcc4d3['afterScriptId']&&_0x37481b[_0x358a62(0x124)](_0xdcc4d3[_0x358a62(0x11d)],{'datasetCode':_0xdcc4d3[_0x358a62(0x13c)],'operationType':snakeToCamel(_0xdcc4d3[_0x358a62(0x128)]),'functionNode':_0x358a62(0x123)});}return _0x37481b;}export function resolveRemoteScriptTarget(_0x29ad52,_0x3cf666,_0x314e42,_0x19e440,_0x52072f){const _0x5b71d=a147_0xaa517a,_0x193d1b=normalizeBffType(_0x3cf666[_0x5b71d(0x13e)]);if(!_0x193d1b||!_0x3cf666['functionName'])return null;if(_0x193d1b==='HOOK'){const _0x2554d9=(_0x3cf666['id']?_0x314e42[_0x5b71d(0x122)](_0x3cf666['id']):undefined)??findHookLocationByRemoteId(_0x19e440,_0x3cf666['id']);if(!_0x2554d9)return null;const _0x2a78bb=_0x2554d9[_0x5b71d(0x141)]||_0x52072f[_0x5b71d(0x122)](_0x2554d9[_0x5b71d(0x13c)]),_0x325d99=_0x2a78bb??_0x2554d9['datasetCode'],_0x5600cf={..._0x2554d9,'alias':_0x2a78bb},_0x4c6888=_0x5b71d(0x12f)+_0x325d99+'/'+_0x5600cf['operationType']+'/'+_0x5600cf[_0x5b71d(0x134)]+'/'+_0x3cf666[_0x5b71d(0x12d)];return{'lockKey':_0x4c6888,'filePath':resolveLocalFilePathFromLockKey(_0x29ad52,_0x4c6888),'type':_0x5b71d(0x13d),'hookLocation':_0x5600cf};}const _0x53c28=_0x193d1b+'/'+_0x3cf666[_0x5b71d(0x12d)];return{'lockKey':_0x53c28,'filePath':resolveLocalFilePathFromLockKey(_0x29ad52,_0x53c28),'type':_0x193d1b};}function a147_0x5bd9(_0x402b26,_0x1c4098){_0x402b26=_0x402b26-0x11c;const _0x20dc01=a147_0x20dc();let _0x5bd974=_0x20dc01[_0x402b26];return _0x5bd974;}export async function ensureParentDirectory(_0x1319a3){await mkdir(dirname(_0x1319a3),{'recursive':!![]});}export async function fileExists(_0x235a0a){const _0x7de5e0=a147_0xaa517a;try{return await access(_0x235a0a,constants[_0x7de5e0(0x121)]),!![];}catch{return![];}}export async function directoryExists(_0x2d83db){const _0x58b9ba=a147_0xaa517a;try{const _0x2c2e93=await stat(_0x2d83db);return _0x2c2e93[_0x58b9ba(0x11c)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2c517c,_0x37662b){const _0x4d9acb=a148_0x4b54,_0x375ab0=_0x2c517c();while(!![]){try{const _0x3724d0=-parseInt(_0x4d9acb(0xd6))/0x1*(-parseInt(_0x4d9acb(0xcc))/0x2)+-parseInt(_0x4d9acb(0xcf))/0x3*(parseInt(_0x4d9acb(0xd2))/0x4)+-parseInt(_0x4d9acb(0xd9))/0x5*(-parseInt(_0x4d9acb(0xd4))/0x6)+parseInt(_0x4d9acb(0xce))/0x7*(-parseInt(_0x4d9acb(0xcd))/0x8)+parseInt(_0x4d9acb(0xd5))/0x9+parseInt(_0x4d9acb(0xdd))/0xa*(parseInt(_0x4d9acb(0xd1))/0xb)+-parseInt(_0x4d9acb(0xd3))/0xc*(parseInt(_0x4d9acb(0xdb))/0xd);if(_0x3724d0===_0x37662b)break;else _0x375ab0['push'](_0x375ab0['shift']());}catch(_0x47c314){_0x375ab0['push'](_0x375ab0['shift']());}}}(a148_0x15e6,0x4aa41));function a148_0x15e6(){const _0x21da7b=['23mOQnXN','hex','digest','90eFqass','utf8','13ImEROv','md5','163670TxuDsA','10014cUtcVr','8lqhGAn','440447WAReYe','36CaKtyh','update','341XLPlMA','131644RuUHwk','3337692yPqomH','19452pFsQoD','3247461BcVixI'];a148_0x15e6=function(){return _0x21da7b;};return a148_0x15e6();}function a148_0x4b54(_0xda157f,_0x71a131){_0xda157f=_0xda157f-0xcc;const _0x15e678=a148_0x15e6();let _0x4b54d7=_0x15e678[_0xda157f];return _0x4b54d7;}import{readFile}from'node:fs/promises';import a148_0x1562c3 from'node:crypto';export function computeContentHash(_0x1a67ce){const _0x51eab5=a148_0x4b54;return a148_0x1562c3['createHash'](_0x51eab5(0xdc))[_0x51eab5(0xd0)](_0x1a67ce)[_0x51eab5(0xd8)](_0x51eab5(0xd7));}export async function computeFileHash(_0x1c1579){const _0x432cb2=a148_0x4b54,_0x353b03=await readFile(_0x1c1579,_0x432cb2(0xda));return computeContentHash(_0x353b03);}
1
+ (function(_0x1a5232,_0x10a132){const _0x5a303e=a148_0x35c8,_0x4bcd80=_0x1a5232();while(!![]){try{const _0x13d9ca=-parseInt(_0x5a303e(0x1f3))/0x1*(-parseInt(_0x5a303e(0x1f9))/0x2)+parseInt(_0x5a303e(0x1f1))/0x3*(-parseInt(_0x5a303e(0x1f2))/0x4)+parseInt(_0x5a303e(0x1f6))/0x5+parseInt(_0x5a303e(0x1fe))/0x6+-parseInt(_0x5a303e(0x1f7))/0x7+-parseInt(_0x5a303e(0x1fc))/0x8*(parseInt(_0x5a303e(0x1f5))/0x9)+parseInt(_0x5a303e(0x1f8))/0xa*(-parseInt(_0x5a303e(0x1fd))/0xb);if(_0x13d9ca===_0x10a132)break;else _0x4bcd80['push'](_0x4bcd80['shift']());}catch(_0x4e7f79){_0x4bcd80['push'](_0x4bcd80['shift']());}}}(a148_0x1f77,0x88d10));function a148_0x1f77(){const _0x3c790c=['digest','177piJaer','62528wDEXdX','137CvnDfx','createHash','12924WreBwI','4347400fCIzOB','4918368mHvIed','907710yuMkbs','13106GHVivQ','utf8','md5','296evIxcM','11nmmTfb','3371844XHxsES','update','hex'];a148_0x1f77=function(){return _0x3c790c;};return a148_0x1f77();}function a148_0x35c8(_0x339e44,_0x506029){_0x339e44=_0x339e44-0x1f1;const _0x1f77a8=a148_0x1f77();let _0x35c8eb=_0x1f77a8[_0x339e44];return _0x35c8eb;}import{readFile}from'node:fs/promises';import a148_0x209cb6 from'node:crypto';export function computeContentHash(_0x2a3ac8){const _0x259ba8=a148_0x35c8;return a148_0x209cb6[_0x259ba8(0x1f4)](_0x259ba8(0x1fb))[_0x259ba8(0x1ff)](_0x2a3ac8)[_0x259ba8(0x201)](_0x259ba8(0x200));}export async function computeFileHash(_0x24352a){const _0x3240f4=a148_0x35c8,_0x1965fd=await readFile(_0x24352a,_0x3240f4(0x1fa));return computeContentHash(_0x1965fd);}
@@ -1 +1 @@
1
- (function(_0x4781d7,_0x8f0601){const _0x16561d=a149_0xd49d,_0x23a090=_0x4781d7();while(!![]){try{const _0x5d8567=-parseInt(_0x16561d(0x1f1))/0x1+-parseInt(_0x16561d(0x1ea))/0x2+parseInt(_0x16561d(0x1ec))/0x3*(-parseInt(_0x16561d(0x1f7))/0x4)+-parseInt(_0x16561d(0x1e9))/0x5+-parseInt(_0x16561d(0x1ef))/0x6*(parseInt(_0x16561d(0x1f0))/0x7)+parseInt(_0x16561d(0x1f3))/0x8+parseInt(_0x16561d(0x1ee))/0x9;if(_0x5d8567===_0x8f0601)break;else _0x23a090['push'](_0x23a090['shift']());}catch(_0x39df8b){_0x23a090['push'](_0x23a090['shift']());}}}(a149_0x4b31,0x5554d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x49c406,_0x598730,_0x541f98,_0x51d036){const _0x527eea=a149_0xd49d,_0x4ebc58={'apps':_0x49c406[_0x527eea(0x1f5)]&&typeof _0x49c406[_0x527eea(0x1f5)]===_0x527eea(0x1f6)?_0x49c406[_0x527eea(0x1f5)]:{}};let _0x4a2628=_0x4ebc58[_0x527eea(0x1f5)][_0x598730];if(!_0x4a2628)return _0x4a2628={'scriptsRoot':_0x541f98,'lastSync':'','functions':{}},_0x4ebc58[_0x527eea(0x1f5)][_0x598730]=_0x4a2628,{'lockData':_0x4ebc58,'appLock':_0x4a2628};if(!_0x4a2628['scriptsRoot'])_0x4a2628[_0x527eea(0x1e7)]=_0x541f98;else{if(_0x4a2628[_0x527eea(0x1e7)]!==_0x541f98)throw new Error(_0x51d036+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x541f98+'\x22\x20vs\x20lock\x20\x22'+_0x4a2628['scriptsRoot']+_0x527eea(0x1ed))+_0x527eea(0x1e6));}return!_0x4a2628['functions']&&(_0x4a2628[_0x527eea(0x1e8)]={}),!_0x4a2628['lastSync']&&(_0x4a2628[_0x527eea(0x1f8)]=''),{'lockData':_0x4ebc58,'appLock':_0x4a2628};}function a149_0xd49d(_0x29dee0,_0x9f5b20){_0x29dee0=_0x29dee0-0x1e6;const _0x4b312c=a149_0x4b31();let _0xd49df9=_0x4b312c[_0x29dee0];return _0xd49df9;}function a149_0x4b31(){const _0x2fe9f9=['1694gXmtNJ','437011ahRpOi','stringify','1307616rVFsLX','code','apps','object','1687932NHwRPV','lastSync','utf8','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','scriptsRoot','functions','2395020fxLcCd','369608bbGokp','parse','3nofHIo','\x22.\x20','20408805JGFsRQ','13854wXSQkq'];a149_0x4b31=function(){return _0x2fe9f9;};return a149_0x4b31();}export async function readBffLockFile(_0x4ad354){const _0x481940=a149_0xd49d;try{const _0x123d96=await readFile(_0x4ad354,'utf8'),_0x446ee5=JSON[_0x481940(0x1eb)](_0x123d96);return{'apps':_0x446ee5['apps']&&typeof _0x446ee5[_0x481940(0x1f5)]===_0x481940(0x1f6)?_0x446ee5[_0x481940(0x1f5)]:{}};}catch(_0x56f964){if(_0x56f964[_0x481940(0x1f4)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x56f964));}}export async function writeBffLockFile(_0x100837,_0x2a3bd9){const _0x3cb817=a149_0xd49d;await mkdir(dirname(_0x100837),{'recursive':!![]}),await writeFile(_0x100837,JSON[_0x3cb817(0x1f2)](_0x2a3bd9,null,0x2),_0x3cb817(0x1f9));}
1
+ (function(_0x3129ac,_0x282ce6){const _0x1c433d=a149_0x4600,_0x367afe=_0x3129ac();while(!![]){try{const _0x494e10=parseInt(_0x1c433d(0xfb))/0x1*(parseInt(_0x1c433d(0x102))/0x2)+parseInt(_0x1c433d(0x105))/0x3+-parseInt(_0x1c433d(0xfe))/0x4*(parseInt(_0x1c433d(0xf0))/0x5)+parseInt(_0x1c433d(0xf3))/0x6*(-parseInt(_0x1c433d(0xf7))/0x7)+-parseInt(_0x1c433d(0xf6))/0x8+parseInt(_0x1c433d(0xf2))/0x9*(parseInt(_0x1c433d(0xfd))/0xa)+parseInt(_0x1c433d(0x101))/0xb;if(_0x494e10===_0x282ce6)break;else _0x367afe['push'](_0x367afe['shift']());}catch(_0x1a838d){_0x367afe['push'](_0x367afe['shift']());}}}(a149_0x3d09,0x52bd6));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a149_0x3d09(){const _0x3ff02e=['4782437ELCyjI','4038fFUZcG','functions','\x22.\x20','523860gIcQSf','stringify','1767460nLZbUY','parse','636147vOgmEa','57282DxTeVn','object','utf8','1825368ehzUDX','105ChpZeM','lastSync','apps','scriptsRoot','15KYpyoL','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','60NelPcZ','4JIulze','ENOENT',':\x20scriptsRoot\x20mismatch\x20—\x20'];a149_0x3d09=function(){return _0x3ff02e;};return a149_0x3d09();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x144742,_0x2dff90,_0x438dc2,_0x157b19){const _0x18788a=a149_0x4600,_0x32696c={'apps':_0x144742[_0x18788a(0xf9)]&&typeof _0x144742[_0x18788a(0xf9)]===_0x18788a(0xf4)?_0x144742['apps']:{}};let _0x5049bb=_0x32696c[_0x18788a(0xf9)][_0x2dff90];if(!_0x5049bb)return _0x5049bb={'scriptsRoot':_0x438dc2,'lastSync':'','functions':{}},_0x32696c[_0x18788a(0xf9)][_0x2dff90]=_0x5049bb,{'lockData':_0x32696c,'appLock':_0x5049bb};if(!_0x5049bb[_0x18788a(0xfa)])_0x5049bb[_0x18788a(0xfa)]=_0x438dc2;else{if(_0x5049bb[_0x18788a(0xfa)]!==_0x438dc2)throw new Error(_0x157b19+_0x18788a(0x100)+('current\x20\x22'+_0x438dc2+'\x22\x20vs\x20lock\x20\x22'+_0x5049bb['scriptsRoot']+_0x18788a(0x104))+_0x18788a(0xfc));}return!_0x5049bb[_0x18788a(0x103)]&&(_0x5049bb[_0x18788a(0x103)]={}),!_0x5049bb[_0x18788a(0xf8)]&&(_0x5049bb[_0x18788a(0xf8)]=''),{'lockData':_0x32696c,'appLock':_0x5049bb};}function a149_0x4600(_0x3e71d5,_0x3aad6f){_0x3e71d5=_0x3e71d5-0xef;const _0x3d09e6=a149_0x3d09();let _0x4600b9=_0x3d09e6[_0x3e71d5];return _0x4600b9;}export async function readBffLockFile(_0x3b5917){const _0x353baa=a149_0x4600;try{const _0x537226=await readFile(_0x3b5917,_0x353baa(0xf5)),_0x2a52b3=JSON[_0x353baa(0xf1)](_0x537226);return{'apps':_0x2a52b3['apps']&&typeof _0x2a52b3['apps']===_0x353baa(0xf4)?_0x2a52b3[_0x353baa(0xf9)]:{}};}catch(_0x3a0449){if(_0x3a0449['code']===_0x353baa(0xff))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x3a0449));}}export async function writeBffLockFile(_0x269f21,_0x326b37){const _0x3d37dd=a149_0x4600;await mkdir(dirname(_0x269f21),{'recursive':!![]}),await writeFile(_0x269f21,JSON[_0x3d37dd(0xef)](_0x326b37,null,0x2),_0x3d37dd(0xf5));}
@@ -1 +1 @@
1
- (function(_0x459c28,_0x45504a){const _0x5c94b2=a151_0x4026,_0x54e934=_0x459c28();while(!![]){try{const _0x255122=-parseInt(_0x5c94b2(0x1ad))/0x1*(-parseInt(_0x5c94b2(0x1af))/0x2)+parseInt(_0x5c94b2(0x1a7))/0x3+-parseInt(_0x5c94b2(0x1b3))/0x4*(-parseInt(_0x5c94b2(0x1b6))/0x5)+-parseInt(_0x5c94b2(0x1ac))/0x6+-parseInt(_0x5c94b2(0x1aa))/0x7+parseInt(_0x5c94b2(0x1a6))/0x8*(parseInt(_0x5c94b2(0x1b1))/0x9)+-parseInt(_0x5c94b2(0x1ae))/0xa*(parseInt(_0x5c94b2(0x1b4))/0xb);if(_0x255122===_0x45504a)break;else _0x54e934['push'](_0x54e934['shift']());}catch(_0x32cbbd){_0x54e934['push'](_0x54e934['shift']());}}}(a151_0x52b3,0xf1d76));export function snakeToCamel(_0x14fe02){const _0x11f86e=a151_0x4026;return _0x14fe02[_0x11f86e(0x1a2)]()[_0x11f86e(0x1a9)](/_([a-z])/g,(_0x37b3c2,_0x39dccd)=>_0x39dccd['toUpperCase']());}export function findHookLocationByRemoteId(_0x24edc6,_0x810936){const _0x6e0de0=a151_0x4026;if(!_0x810936)return undefined;for(const _0x50f724 of Object[_0x6e0de0(0x1a4)](_0x24edc6)){if(_0x50f724['remoteId']===_0x810936&&_0x50f724['datasetCode']&&_0x50f724['operationType']&&_0x50f724[_0x6e0de0(0x1b2)])return{'datasetCode':_0x50f724[_0x6e0de0(0x1a8)],'operationType':_0x50f724[_0x6e0de0(0x1a3)],'functionNode':_0x50f724['functionNode']};}return undefined;}function a151_0x52b3(){const _0x48ffe9=['before','9534342Bpvdck','8qdKZje','8703370fgLWFg','359636nGRzWk','after','18RgpbTZ','functionNode','10312mHuOWP','33XKpqjw','test','2340isAwvr','toLowerCase','operationType','values','match','5044976vJFwpv','5573958AZbLxq','datasetCode','replace','4015396phJFyp'];a151_0x52b3=function(){return _0x48ffe9;};return a151_0x52b3();}export function extractScriptDescription(_0x3a5883){const _0x2cd36d=a151_0x4026,_0x25e119=_0x3a5883[_0x2cd36d(0x1a5)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x25e119?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x43346d){const _0x2dbdf8=a151_0x4026;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x2dbdf8(0x1b5)](_0x43346d);}function a151_0x4026(_0x5054b5,_0x58a793){_0x5054b5=_0x5054b5-0x1a2;const _0x52b3c0=a151_0x52b3();let _0x4026ed=_0x52b3c0[_0x5054b5];return _0x4026ed;}export function normalizeHookFunctionNode(_0x5b8d60){const _0x47b693=a151_0x4026;if(!_0x5b8d60)return undefined;const _0x4f9977=_0x5b8d60['trim']()[_0x47b693(0x1a2)]();if(_0x4f9977===_0x47b693(0x1ab)||_0x4f9977===_0x47b693(0x1b0))return _0x4f9977;return undefined;}
1
+ (function(_0x59a217,_0x4c1c50){const _0x3e8e67=a151_0x5c0e,_0x4e4cbb=_0x59a217();while(!![]){try{const _0x51b892=-parseInt(_0x3e8e67(0x14a))/0x1*(-parseInt(_0x3e8e67(0x14b))/0x2)+parseInt(_0x3e8e67(0x14e))/0x3+-parseInt(_0x3e8e67(0x145))/0x4+-parseInt(_0x3e8e67(0x144))/0x5*(-parseInt(_0x3e8e67(0x13e))/0x6)+-parseInt(_0x3e8e67(0x13f))/0x7*(parseInt(_0x3e8e67(0x151))/0x8)+-parseInt(_0x3e8e67(0x143))/0x9+parseInt(_0x3e8e67(0x14c))/0xa*(parseInt(_0x3e8e67(0x148))/0xb);if(_0x51b892===_0x4c1c50)break;else _0x4e4cbb['push'](_0x4e4cbb['shift']());}catch(_0x50c3de){_0x4e4cbb['push'](_0x4e4cbb['shift']());}}}(a151_0x677c,0x32d1f));export function snakeToCamel(_0x13e334){const _0x305d91=a151_0x5c0e;return _0x13e334['toLowerCase']()[_0x305d91(0x146)](/_([a-z])/g,(_0x462b23,_0x4a6dc3)=>_0x4a6dc3[_0x305d91(0x150)]());}export function findHookLocationByRemoteId(_0x710828,_0x5c2ed1){const _0x2e0e11=a151_0x5c0e;if(!_0x5c2ed1)return undefined;for(const _0x2dece2 of Object['values'](_0x710828)){if(_0x2dece2[_0x2e0e11(0x141)]===_0x5c2ed1&&_0x2dece2[_0x2e0e11(0x14f)]&&_0x2dece2[_0x2e0e11(0x14d)]&&_0x2dece2[_0x2e0e11(0x147)])return{'datasetCode':_0x2dece2[_0x2e0e11(0x14f)],'operationType':_0x2dece2['operationType'],'functionNode':_0x2dece2[_0x2e0e11(0x147)]};}return undefined;}function a151_0x677c(){const _0x4a8952=['after','remoteId','toLowerCase','101637KlwOxl','10XZAWzL','934308IHgdUn','replace','functionNode','774378louBxY','trim','38567NzekCG','8XBHEGW','20kckdIx','operationType','150675hQBrNn','datasetCode','toUpperCase','288MRChbA','match','test','577128swmiWB','16457mcYrCm'];a151_0x677c=function(){return _0x4a8952;};return a151_0x677c();}export function extractScriptDescription(_0x26a23e){const _0x572ea0=a151_0x5c0e,_0x30b2d4=_0x26a23e[_0x572ea0(0x13c)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x30b2d4?.[0x1]?.[_0x572ea0(0x149)]()||undefined;}function a151_0x5c0e(_0x2e2a98,_0x5a7684){_0x2e2a98=_0x2e2a98-0x13c;const _0x677c5f=a151_0x677c();let _0x5c0e0d=_0x677c5f[_0x2e2a98];return _0x5c0e0d;}export function isValidBffFunctionName(_0x1a2121){const _0x3b282c=a151_0x5c0e;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x3b282c(0x13d)](_0x1a2121);}export function normalizeHookFunctionNode(_0x204a27){const _0x1712f6=a151_0x5c0e;if(!_0x204a27)return undefined;const _0x4011bf=_0x204a27[_0x1712f6(0x149)]()[_0x1712f6(0x142)]();if(_0x4011bf==='before'||_0x4011bf===_0x1712f6(0x140))return _0x4011bf;return undefined;}
@@ -1 +1 @@
1
- function a152_0x1bce(){const _0x16d6da=['map','length','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','3076213BKEFTP','\x22\x20matches\x20multiple\x20databases:\x20','24804iVmubr','597KwoERW','14499UrFKRJ','dbId','7134wyhphh','toLowerCase','isNaN','1BNotiO','\x22\x20under\x20app\x20\x22','has','entries','32864340rMppmg','dbName','find','set','10IddhUv','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','1472gvJBXT','.\x20Be\x20more\x20specific.','2351938yiTskf','\x22.\x20Available:\x20','5665qtiwTS','No\x20database\x20matching\x20\x22','10691769DejEHg','dbtableConfig'];a152_0x1bce=function(){return _0x16d6da;};return a152_0x1bce();}function a152_0x1f57(_0x3ba6c8,_0xfa44ec){_0x3ba6c8=_0x3ba6c8-0x113;const _0x1bcee1=a152_0x1bce();let _0x1f57f0=_0x1bcee1[_0x3ba6c8];return _0x1f57f0;}(function(_0x5a7fb1,_0x5544c6){const _0x2ef69f=a152_0x1f57,_0x1ffabb=_0x5a7fb1();while(!![]){try{const _0x184cf1=parseInt(_0x2ef69f(0x121))/0x1*(-parseInt(_0x2ef69f(0x12d))/0x2)+-parseInt(_0x2ef69f(0x11b))/0x3*(parseInt(_0x2ef69f(0x11a))/0x4)+-parseInt(_0x2ef69f(0x12f))/0x5*(parseInt(_0x2ef69f(0x11e))/0x6)+parseInt(_0x2ef69f(0x118))/0x7+parseInt(_0x2ef69f(0x12b))/0x8*(parseInt(_0x2ef69f(0x11c))/0x9)+parseInt(_0x2ef69f(0x129))/0xa*(parseInt(_0x2ef69f(0x113))/0xb)+parseInt(_0x2ef69f(0x125))/0xc;if(_0x184cf1===_0x5544c6)break;else _0x1ffabb['push'](_0x1ffabb['shift']());}catch(_0x46037b){_0x1ffabb['push'](_0x1ffabb['shift']());}}}(a152_0x1bce,0xa852c));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x24b3a2){const _0x46597c=a152_0x1f57;if(cache[_0x46597c(0x123)](_0x24b3a2))return cache['get'](_0x24b3a2);const _0x3ec4b9=await listDatasets(_0x24b3a2),_0x169a3c=new Map();for(const _0x5b6ce0 of _0x3ec4b9){const _0x32ff92=_0x5b6ce0[_0x46597c(0x114)];_0x32ff92?.[_0x46597c(0x11d)]!=null&&_0x169a3c[_0x46597c(0x128)](_0x32ff92['dbId'],_0x32ff92[_0x46597c(0x126)]??'db-'+_0x32ff92['dbId']);}const _0x1b8e2d=[..._0x169a3c[_0x46597c(0x124)]()][_0x46597c(0x115)](([_0xf41828,_0x1b9129])=>({'dbId':_0xf41828,'dbName':_0x1b9129}));return cache['set'](_0x24b3a2,_0x1b8e2d),_0x1b8e2d;}export async function resolveDb(_0xa31f22,_0x5017d9){const _0x51c0f7=a152_0x1f57,_0x3bf302=await listDatabases(_0xa31f22);if(_0x3bf302[_0x51c0f7(0x116)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0xa31f22+_0x51c0f7(0x117)};if(!_0x5017d9)return{'resolved':_0x3bf302};const _0x36bceb=Number(_0x5017d9);if(!Number[_0x51c0f7(0x120)](_0x36bceb)){const _0x16877c=_0x3bf302[_0x51c0f7(0x127)](_0x1cd633=>_0x1cd633[_0x51c0f7(0x11d)]===_0x36bceb);if(_0x16877c)return{'resolved':[_0x16877c]};}const _0x3610e0=_0x5017d9[_0x51c0f7(0x11f)](),_0x5876d2=_0x3bf302['filter'](_0x4a5dc9=>_0x4a5dc9['dbName'][_0x51c0f7(0x11f)]()['includes'](_0x3610e0));if(_0x5876d2[_0x51c0f7(0x116)]>0x0)return{'resolved':_0x5876d2};const _0x7b7874=_0x3bf302[_0x51c0f7(0x115)](_0x5d847e=>_0x5d847e['dbName']+'\x20('+_0x5d847e[_0x51c0f7(0x11d)]+')')['join'](',\x20');return{'resolved':[],'error':_0x51c0f7(0x130)+_0x5017d9+_0x51c0f7(0x122)+_0xa31f22+_0x51c0f7(0x12e)+_0x7b7874+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x13d337,_0x1c8d81){const _0x1e2904=a152_0x1f57,{resolved:_0x114f7d,error:_0x11dd08}=await resolveDb(_0x13d337,_0x1c8d81);if(_0x11dd08)return{'db':null,'error':_0x11dd08};if(_0x114f7d[_0x1e2904(0x116)]===0x1)return{'db':_0x114f7d[0x0]};if(!_0x1c8d81){const _0x1ea78d=_0x114f7d[_0x1e2904(0x115)](_0x4e8010=>_0x4e8010[_0x1e2904(0x126)]+'\x20('+_0x4e8010[_0x1e2904(0x11d)]+')')['join'](',\x20');return{'db':null,'error':_0x1e2904(0x12a)+_0x1ea78d};}const _0x573983=_0x114f7d[_0x1e2904(0x115)](_0x3a6311=>_0x3a6311[_0x1e2904(0x126)]+'\x20('+_0x3a6311['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x1c8d81+_0x1e2904(0x119)+_0x573983+_0x1e2904(0x12c)};}export async function getDbName(_0x83aed8,_0xdb5c73){const _0x207248=a152_0x1f57,_0x3059c8=await listDatabases(_0x83aed8);return _0x3059c8[_0x207248(0x127)](_0x4bd5bb=>_0x4bd5bb[_0x207248(0x11d)]===_0xdb5c73)?.[_0x207248(0x126)];}
1
+ (function(_0x4333b3,_0x8828b5){const _0x1874f2=a152_0x5f39,_0x568399=_0x4333b3();while(!![]){try{const _0x90722f=-parseInt(_0x1874f2(0x141))/0x1+-parseInt(_0x1874f2(0x147))/0x2*(parseInt(_0x1874f2(0x13b))/0x3)+parseInt(_0x1874f2(0x14c))/0x4+-parseInt(_0x1874f2(0x136))/0x5*(parseInt(_0x1874f2(0x13e))/0x6)+parseInt(_0x1874f2(0x132))/0x7*(parseInt(_0x1874f2(0x14d))/0x8)+parseInt(_0x1874f2(0x137))/0x9*(-parseInt(_0x1874f2(0x138))/0xa)+parseInt(_0x1874f2(0x143))/0xb*(parseInt(_0x1874f2(0x13d))/0xc);if(_0x90722f===_0x8828b5)break;else _0x568399['push'](_0x568399['shift']());}catch(_0x433b75){_0x568399['push'](_0x568399['shift']());}}}(a152_0x5c8a,0x429be));function a152_0x5c8a(){const _0x515aa7=['db-','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','1847336jNHYJl','1187280waYaSU','toLowerCase','filter','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','entries','has','map','dbtableConfig','.\x20Be\x20more\x20specific.','21SqRDJt','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','get','join','5PCAmpY','17586cWNJQs','980xhbYEj','find','dbId','51otONXU','\x22.\x20Available:\x20','300HpEDIM','2375112xpNJja','No\x20database\x20matching\x20\x22','length','227195IbHOim','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','169730KlCeIW','dbName','includes','set','24170SoJsfG','\x22\x20under\x20app\x20\x22','\x22\x20matches\x20multiple\x20databases:\x20'];a152_0x5c8a=function(){return _0x515aa7;};return a152_0x5c8a();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2ec19e){const _0x1afcc6=a152_0x5f39;if(cache[_0x1afcc6(0x12e)](_0x2ec19e))return cache[_0x1afcc6(0x134)](_0x2ec19e);const _0x39d2fb=await listDatasets(_0x2ec19e),_0x24436a=new Map();for(const _0x2c8cb8 of _0x39d2fb){const _0xeff64c=_0x2c8cb8[_0x1afcc6(0x130)];_0xeff64c?.['dbId']!=null&&_0x24436a[_0x1afcc6(0x146)](_0xeff64c[_0x1afcc6(0x13a)],_0xeff64c[_0x1afcc6(0x144)]??_0x1afcc6(0x14a)+_0xeff64c['dbId']);}const _0x30617d=[..._0x24436a[_0x1afcc6(0x12d)]()][_0x1afcc6(0x12f)](([_0x2e48ef,_0x3c9129])=>({'dbId':_0x2e48ef,'dbName':_0x3c9129}));return cache['set'](_0x2ec19e,_0x30617d),_0x30617d;}export async function resolveDb(_0x23a48e,_0x387773){const _0x4f7ecc=a152_0x5f39,_0x389e07=await listDatabases(_0x23a48e);if(_0x389e07['length']===0x0)return{'resolved':[],'error':_0x4f7ecc(0x133)+_0x23a48e+_0x4f7ecc(0x14b)};if(!_0x387773)return{'resolved':_0x389e07};const _0x539bf2=Number(_0x387773);if(!Number['isNaN'](_0x539bf2)){const _0x49f710=_0x389e07['find'](_0x5d6232=>_0x5d6232[_0x4f7ecc(0x13a)]===_0x539bf2);if(_0x49f710)return{'resolved':[_0x49f710]};}const _0x3bf9b6=_0x387773[_0x4f7ecc(0x12a)](),_0x520f33=_0x389e07[_0x4f7ecc(0x12b)](_0x40776d=>_0x40776d[_0x4f7ecc(0x144)][_0x4f7ecc(0x12a)]()[_0x4f7ecc(0x145)](_0x3bf9b6));if(_0x520f33[_0x4f7ecc(0x140)]>0x0)return{'resolved':_0x520f33};const _0x5a1094=_0x389e07['map'](_0x1fe5df=>_0x1fe5df['dbName']+'\x20('+_0x1fe5df[_0x4f7ecc(0x13a)]+')')['join'](',\x20');return{'resolved':[],'error':_0x4f7ecc(0x13f)+_0x387773+_0x4f7ecc(0x148)+_0x23a48e+_0x4f7ecc(0x13c)+_0x5a1094+_0x4f7ecc(0x12c)};}function a152_0x5f39(_0x466cd9,_0x280d50){_0x466cd9=_0x466cd9-0x12a;const _0x5c8a8a=a152_0x5c8a();let _0x5f390b=_0x5c8a8a[_0x466cd9];return _0x5f390b;}export async function resolveOneDb(_0x5dca76,_0x1d3293){const _0x3534a0=a152_0x5f39,{resolved:_0x53f15c,error:_0x50ffc1}=await resolveDb(_0x5dca76,_0x1d3293);if(_0x50ffc1)return{'db':null,'error':_0x50ffc1};if(_0x53f15c[_0x3534a0(0x140)]===0x1)return{'db':_0x53f15c[0x0]};if(!_0x1d3293){const _0x2e5cbb=_0x53f15c[_0x3534a0(0x12f)](_0x48c5c6=>_0x48c5c6[_0x3534a0(0x144)]+'\x20('+_0x48c5c6['dbId']+')')['join'](',\x20');return{'db':null,'error':_0x3534a0(0x142)+_0x2e5cbb};}const _0x1c3253=_0x53f15c[_0x3534a0(0x12f)](_0x19dcb1=>_0x19dcb1['dbName']+'\x20('+_0x19dcb1['dbId']+')')[_0x3534a0(0x135)](',\x20');return{'db':null,'error':'\x22'+_0x1d3293+_0x3534a0(0x149)+_0x1c3253+_0x3534a0(0x131)};}export async function getDbName(_0x4a6168,_0x346f3f){const _0xc5831f=a152_0x5f39,_0x561401=await listDatabases(_0x4a6168);return _0x561401[_0xc5831f(0x139)](_0x3d9ea0=>_0x3d9ea0[_0xc5831f(0x13a)]===_0x346f3f)?.[_0xc5831f(0x144)];}
@@ -1 +1 @@
1
- function a153_0x278d(){const _0x781c3e=['1417671HDhxpz','3328660haXCgw','1131052TOGUqg','cwd','2335692sCDJfK','1LujiVA','appPagesDir','10DfqOGM','928656owgjyP','8390295pXLjOS','toUpperCase','16GkwaeP','page','303982IOunWG'];a153_0x278d=function(){return _0x781c3e;};return a153_0x278d();}const a153_0x42a0c0=a153_0x280c;(function(_0x4328d0,_0x15d81d){const _0x46399f=a153_0x280c,_0x4d45e1=_0x4328d0();while(!![]){try{const _0x16d320=parseInt(_0x46399f(0x116))/0x1*(-parseInt(_0x46399f(0x119))/0x2)+-parseInt(_0x46399f(0x11f))/0x3+parseInt(_0x46399f(0x121))/0x4+parseInt(_0x46399f(0x120))/0x5+-parseInt(_0x46399f(0x115))/0x6+-parseInt(_0x46399f(0x11e))/0x7*(parseInt(_0x46399f(0x11c))/0x8)+parseInt(_0x46399f(0x11a))/0x9*(parseInt(_0x46399f(0x118))/0xa);if(_0x16d320===_0x15d81d)break;else _0x4d45e1['push'](_0x4d45e1['shift']());}catch(_0x2375fd){_0x4d45e1['push'](_0x4d45e1['shift']());}}}(a153_0x278d,0x72313));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a153_0x280c(_0x4d1405,_0x367f50){_0x4d1405=_0x4d1405-0x115;const _0x278d55=a153_0x278d();let _0x280cda=_0x278d55[_0x4d1405];return _0x280cda;}export function loadPageProjectConfig(_0xce8326,_0x4438c2=process[a153_0x42a0c0(0x122)]()){const _0x59c231=a153_0x42a0c0,_0x3e6c14=resolve(_0x4438c2),_0x96d2e0=join(_0x3e6c14,'.rabetbase',_0x59c231(0x11d));return{'projectRoot':_0x3e6c14,'pagesBaseDir':_0x96d2e0,'appPagesDir':join(_0x96d2e0,_0xce8326),'lockFilePath':join(_0x3e6c14,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x1a9947,_0x34fc3f){const _0x3d270d=a153_0x42a0c0;return _0x1a9947+'-'+String(_0x34fc3f)[_0x3d270d(0x11b)]()+'.json';}export function resolvePageFilePath(_0x44c71e,_0x4e454f,_0x11b27c){const _0x1a0585=a153_0x42a0c0;return join(_0x44c71e[_0x1a0585(0x117)],buildPageFileName(_0x4e454f,_0x11b27c));}export async function ensureParentDirectory(_0x1430eb){await mkdir(dirname(_0x1430eb),{'recursive':!![]});}export async function fileExists(_0x5bfda8){try{return await access(_0x5bfda8,constants['F_OK']),!![];}catch{return![];}}
1
+ const a153_0x2f2cda=a153_0x2761;(function(_0x51aa16,_0x3160b3){const _0x4a4ad5=a153_0x2761,_0x1db022=_0x51aa16();while(!![]){try{const _0x102dd8=parseInt(_0x4a4ad5(0x10c))/0x1*(-parseInt(_0x4a4ad5(0x110))/0x2)+parseInt(_0x4a4ad5(0x10e))/0x3*(-parseInt(_0x4a4ad5(0x115))/0x4)+-parseInt(_0x4a4ad5(0x113))/0x5+parseInt(_0x4a4ad5(0x10f))/0x6+-parseInt(_0x4a4ad5(0x108))/0x7+-parseInt(_0x4a4ad5(0x10d))/0x8+parseInt(_0x4a4ad5(0x10b))/0x9;if(_0x102dd8===_0x3160b3)break;else _0x1db022['push'](_0x1db022['shift']());}catch(_0x40ab56){_0x1db022['push'](_0x1db022['shift']());}}}(a153_0x5ef3,0xd897d));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a153_0x5ef3(){const _0x71171d=['148WwcTOs','appPagesDir','7513156SbamIA','toUpperCase','.json','54611793juCBfq','79zyjFfb','9975272IBqUUX','44985HCuLzT','282390ZfVGGZ','38158oniYpM','page','cwd','4228020DyLsEb','F_OK'];a153_0x5ef3=function(){return _0x71171d;};return a153_0x5ef3();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x389633,_0x32b27f=process[a153_0x2f2cda(0x112)]()){const _0x3f21c8=a153_0x2f2cda,_0x27369c=resolve(_0x32b27f),_0x2772ad=join(_0x27369c,'.rabetbase',_0x3f21c8(0x111));return{'projectRoot':_0x27369c,'pagesBaseDir':_0x2772ad,'appPagesDir':join(_0x2772ad,_0x389633),'lockFilePath':join(_0x27369c,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x30609d,_0x18beba){const _0x17c276=a153_0x2f2cda;return _0x30609d+'-'+String(_0x18beba)[_0x17c276(0x109)]()+_0x17c276(0x10a);}export function resolvePageFilePath(_0x38d76d,_0x858408,_0x43336b){const _0x518cf8=a153_0x2f2cda;return join(_0x38d76d[_0x518cf8(0x107)],buildPageFileName(_0x858408,_0x43336b));}function a153_0x2761(_0x401eed,_0x334b5c){_0x401eed=_0x401eed-0x107;const _0x5ef307=a153_0x5ef3();let _0x2761ba=_0x5ef307[_0x401eed];return _0x2761ba;}export async function ensureParentDirectory(_0x1f66d4){await mkdir(dirname(_0x1f66d4),{'recursive':!![]});}export async function fileExists(_0x40069b){const _0x40f38f=a153_0x2f2cda;try{return await access(_0x40069b,constants[_0x40f38f(0x114)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x437755,_0x3c4590){const _0x1053b2=a154_0x368a,_0x3aa522=_0x437755();while(!![]){try{const _0x2b53fa=parseInt(_0x1053b2(0x134))/0x1*(-parseInt(_0x1053b2(0x130))/0x2)+parseInt(_0x1053b2(0x12a))/0x3+parseInt(_0x1053b2(0x12c))/0x4*(parseInt(_0x1053b2(0x12f))/0x5)+parseInt(_0x1053b2(0x137))/0x6*(parseInt(_0x1053b2(0x12b))/0x7)+-parseInt(_0x1053b2(0x128))/0x8+parseInt(_0x1053b2(0x12e))/0x9+parseInt(_0x1053b2(0x132))/0xa;if(_0x2b53fa===_0x3c4590)break;else _0x3aa522['push'](_0x3aa522['shift']());}catch(_0x499c92){_0x3aa522['push'](_0x3aa522['shift']());}}}(a154_0x46b4,0x819ca));import a154_0x2a9f6e from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1262c2){const _0x41fd8a=a154_0x368a;return JSON[_0x41fd8a(0x131)](JSON[_0x41fd8a(0x138)](_0x1262c2),null,0x2)+'\x0a';}export function computePageContentHash(_0x5a3595){const _0x282e29=a154_0x368a;return a154_0x2a9f6e[_0x282e29(0x136)]('md5')[_0x282e29(0x12d)](_0x5a3595)[_0x282e29(0x129)](_0x282e29(0x133));}function a154_0x368a(_0x4b640f,_0x427a5f){_0x4b640f=_0x4b640f-0x128;const _0x46b4d0=a154_0x46b4();let _0x368ac5=_0x46b4d0[_0x4b640f];return _0x368ac5;}export function computeSerializedSchemaHash(_0x3600a1){return computePageContentHash(serializePageSchemaForFile(_0x3600a1));}export async function computePageFileHash(_0x33816e){const _0x471ec3=a154_0x368a,_0x37e074=await readFile(_0x33816e,_0x471ec3(0x135));return computePageContentHash(_0x37e074);}function a154_0x46b4(){const _0x3d6200=['6125880rjMOcv','hex','17438rsnwZA','utf8','createHash','1345722fGywWg','parse','3078136KAncBe','digest','372681aeeZFD','7IRRYcE','284EYNpgO','update','4083462suExcm','22565AXygTL','94tJsAZU','stringify'];a154_0x46b4=function(){return _0x3d6200;};return a154_0x46b4();}
1
+ (function(_0x4a5ea0,_0x4239ae){const _0x58ea62=a154_0x5d51,_0x4c110f=_0x4a5ea0();while(!![]){try{const _0x1f9e5d=parseInt(_0x58ea62(0x98))/0x1+parseInt(_0x58ea62(0x97))/0x2+parseInt(_0x58ea62(0x8d))/0x3+parseInt(_0x58ea62(0x94))/0x4*(parseInt(_0x58ea62(0x91))/0x5)+-parseInt(_0x58ea62(0x99))/0x6*(-parseInt(_0x58ea62(0x8b))/0x7)+parseInt(_0x58ea62(0x8c))/0x8+-parseInt(_0x58ea62(0x92))/0x9;if(_0x1f9e5d===_0x4239ae)break;else _0x4c110f['push'](_0x4c110f['shift']());}catch(_0x27801c){_0x4c110f['push'](_0x4c110f['shift']());}}}(a154_0xcd2f,0x59a93));function a154_0xcd2f(){const _0x18e750=['stringify','createHash','1142690DHyJmF','518473wwuRUF','136362yrTPfu','hex','126mFdyzl','544728bmCrBN','333240qlBRok','digest','md5','parse','5GQEvXv','17396181IBsIGP','update','2488340mkwpax'];a154_0xcd2f=function(){return _0x18e750;};return a154_0xcd2f();}import a154_0x2eb0eb from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x5d8dfa){const _0x15b476=a154_0x5d51;return JSON[_0x15b476(0x95)](JSON[_0x15b476(0x90)](_0x5d8dfa),null,0x2)+'\x0a';}function a154_0x5d51(_0x4f8737,_0x5bcb55){_0x4f8737=_0x4f8737-0x8a;const _0xcd2fdc=a154_0xcd2f();let _0x5d51e4=_0xcd2fdc[_0x4f8737];return _0x5d51e4;}export function computePageContentHash(_0x524888){const _0x2edcb4=a154_0x5d51;return a154_0x2eb0eb[_0x2edcb4(0x96)](_0x2edcb4(0x8f))[_0x2edcb4(0x93)](_0x524888)[_0x2edcb4(0x8e)](_0x2edcb4(0x8a));}export function computeSerializedSchemaHash(_0x2df882){return computePageContentHash(serializePageSchemaForFile(_0x2df882));}export async function computePageFileHash(_0xabb801){const _0x216620=await readFile(_0xabb801,'utf8');return computePageContentHash(_0x216620);}
@@ -1 +1 @@
1
- (function(_0x2eb181,_0x4bccad){const _0x487ab3=a155_0x50ca,_0x46a536=_0x2eb181();while(!![]){try{const _0xc0131e=-parseInt(_0x487ab3(0x147))/0x1+-parseInt(_0x487ab3(0x142))/0x2*(parseInt(_0x487ab3(0x13d))/0x3)+-parseInt(_0x487ab3(0x13b))/0x4+parseInt(_0x487ab3(0x13e))/0x5*(parseInt(_0x487ab3(0x141))/0x6)+-parseInt(_0x487ab3(0x14b))/0x7*(-parseInt(_0x487ab3(0x149))/0x8)+parseInt(_0x487ab3(0x143))/0x9+-parseInt(_0x487ab3(0x13f))/0xa*(-parseInt(_0x487ab3(0x148))/0xb);if(_0xc0131e===_0x4bccad)break;else _0x46a536['push'](_0x46a536['shift']());}catch(_0x3ab080){_0x46a536['push'](_0x46a536['shift']());}}}(a155_0x1559,0xbba08));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a155_0x50ca(_0x408d59,_0x4e24b3){_0x408d59=_0x408d59-0x13b;const _0x155957=a155_0x1559();let _0x50ca40=_0x155957[_0x408d59];return _0x50ca40;}export function ensurePageLockScope(_0x4ebdff,_0x281896){const _0xe60b61=a155_0x50ca,_0x4b9cb6={'apps':_0x4ebdff['apps']&&typeof _0x4ebdff['apps']===_0xe60b61(0x14d)?_0x4ebdff['apps']:{}};let _0x540156=_0x4b9cb6[_0xe60b61(0x14a)][_0x281896];if(!_0x540156)return _0x540156={'lastSync':'','pages':{}},_0x4b9cb6[_0xe60b61(0x14a)][_0x281896]=_0x540156,{'lockData':_0x4b9cb6,'appLock':_0x540156};return!_0x540156['lastSync']&&(_0x540156[_0xe60b61(0x145)]=''),(!_0x540156['pages']||typeof _0x540156[_0xe60b61(0x146)]!=='object')&&(_0x540156[_0xe60b61(0x146)]={}),{'lockData':_0x4b9cb6,'appLock':_0x540156};}function a155_0x1559(){const _0x240d89=['ENOENT','object','5741556vtXVmv','code','11280YwWITS','2080910bAvKNp','485330FmMfcy','utf8','6mcJRuY','768FaYrhF','7800381dQsqfN','parse','lastSync','pages','813598NBSTmn','473TBxVVR','8732296lfGhkB','apps','7LWhQML'];a155_0x1559=function(){return _0x240d89;};return a155_0x1559();}export async function readPageLockFile(_0x5609b){const _0x4e1006=a155_0x50ca;try{const _0x1a2e14=await readFile(_0x5609b,_0x4e1006(0x140)),_0xda1106=JSON[_0x4e1006(0x144)](_0x1a2e14);return{'apps':_0xda1106[_0x4e1006(0x14a)]&&typeof _0xda1106[_0x4e1006(0x14a)]===_0x4e1006(0x14d)?_0xda1106['apps']:{}};}catch(_0x5d46af){if(_0x5d46af[_0x4e1006(0x13c)]===_0x4e1006(0x14c))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x5d46af));}}export async function writePageLockFile(_0x38b6ee,_0x50bec9){const _0x5ac657=a155_0x50ca;await mkdir(dirname(_0x38b6ee),{'recursive':!![]}),await writeFile(_0x38b6ee,JSON['stringify'](_0x50bec9,null,0x2),_0x5ac657(0x140));}
1
+ (function(_0x159633,_0x20510e){const _0x4dc7f4=a155_0x4dfd,_0x36f0bd=_0x159633();while(!![]){try{const _0x1bf678=-parseInt(_0x4dc7f4(0x90))/0x1*(-parseInt(_0x4dc7f4(0x8c))/0x2)+-parseInt(_0x4dc7f4(0x96))/0x3*(-parseInt(_0x4dc7f4(0x8a))/0x4)+parseInt(_0x4dc7f4(0x8f))/0x5+-parseInt(_0x4dc7f4(0x87))/0x6*(-parseInt(_0x4dc7f4(0x93))/0x7)+parseInt(_0x4dc7f4(0x86))/0x8+-parseInt(_0x4dc7f4(0x92))/0x9*(-parseInt(_0x4dc7f4(0x8e))/0xa)+-parseInt(_0x4dc7f4(0x91))/0xb;if(_0x1bf678===_0x20510e)break;else _0x36f0bd['push'](_0x36f0bd['shift']());}catch(_0x4d5633){_0x36f0bd['push'](_0x36f0bd['shift']());}}}(a155_0x2bb0,0x8a7ac));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a155_0x2bb0(){const _0x17e619=['ENOENT','5753080YcjqBN','2286920RkIptx','1mcWQlK','27024349DieGZk','9NlyTZO','63ZIfqmY','utf8','stringify','1102953jKhAaH','apps','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','828944nlfKeJ','178374AvvrAx','object','code','8LMOVED','pages','1769596ZzuLeK'];a155_0x2bb0=function(){return _0x17e619;};return a155_0x2bb0();}export function ensurePageLockScope(_0x1b49f,_0x45e18a){const _0x1e3be6=a155_0x4dfd,_0x150483={'apps':_0x1b49f['apps']&&typeof _0x1b49f[_0x1e3be6(0x84)]===_0x1e3be6(0x88)?_0x1b49f[_0x1e3be6(0x84)]:{}};let _0x4b44d4=_0x150483[_0x1e3be6(0x84)][_0x45e18a];if(!_0x4b44d4)return _0x4b44d4={'lastSync':'','pages':{}},_0x150483[_0x1e3be6(0x84)][_0x45e18a]=_0x4b44d4,{'lockData':_0x150483,'appLock':_0x4b44d4};return!_0x4b44d4['lastSync']&&(_0x4b44d4['lastSync']=''),(!_0x4b44d4[_0x1e3be6(0x8b)]||typeof _0x4b44d4[_0x1e3be6(0x8b)]!==_0x1e3be6(0x88))&&(_0x4b44d4['pages']={}),{'lockData':_0x150483,'appLock':_0x4b44d4};}export async function readPageLockFile(_0xba1e02){const _0x5e3beb=a155_0x4dfd;try{const _0x223a9d=await readFile(_0xba1e02,_0x5e3beb(0x94)),_0x3e52a7=JSON['parse'](_0x223a9d);return{'apps':_0x3e52a7[_0x5e3beb(0x84)]&&typeof _0x3e52a7[_0x5e3beb(0x84)]===_0x5e3beb(0x88)?_0x3e52a7[_0x5e3beb(0x84)]:{}};}catch(_0x1ff4d3){if(_0x1ff4d3[_0x5e3beb(0x89)]===_0x5e3beb(0x8d))return null;throw new Error(_0x5e3beb(0x85)+String(_0x1ff4d3));}}function a155_0x4dfd(_0x2bc2cf,_0x451cb9){_0x2bc2cf=_0x2bc2cf-0x84;const _0x2bb0f0=a155_0x2bb0();let _0x4dfd4d=_0x2bb0f0[_0x2bc2cf];return _0x4dfd4d;}export async function writePageLockFile(_0x3e2fb1,_0x5e42d4){const _0x327ee7=a155_0x4dfd;await mkdir(dirname(_0x3e2fb1),{'recursive':!![]}),await writeFile(_0x3e2fb1,JSON[_0x327ee7(0x95)](_0x5e42d4,null,0x2),_0x327ee7(0x94));}
@@ -1 +1 @@
1
- function a157_0x3169(){const _0x53e4a8=['33650FlhzsA','201529jErEZN','1431531pcsNqJ','16072221lBOkyc','1263472BNohuD','10nKwpLr','/sql','12hCkcFR','258595xHWolu','sql','1049167IzNxwV','.rabetbase','36JoeEDT','sql.lock.json','16gWJCVb'];a157_0x3169=function(){return _0x53e4a8;};return a157_0x3169();}const a157_0x2b5301=a157_0x3288;(function(_0x44628e,_0x397f12){const _0x50a604=a157_0x3288,_0xe3f960=_0x44628e();while(!![]){try{const _0x2a1b00=-parseInt(_0x50a604(0x78))/0x1+parseInt(_0x50a604(0x77))/0x2*(parseInt(_0x50a604(0x7e))/0x3)+-parseInt(_0x50a604(0x7b))/0x4+parseInt(_0x50a604(0x7f))/0x5*(-parseInt(_0x50a604(0x74))/0x6)+-parseInt(_0x50a604(0x81))/0x7+parseInt(_0x50a604(0x76))/0x8*(-parseInt(_0x50a604(0x79))/0x9)+-parseInt(_0x50a604(0x7c))/0xa*(-parseInt(_0x50a604(0x7a))/0xb);if(_0x2a1b00===_0x397f12)break;else _0xe3f960['push'](_0xe3f960['shift']());}catch(_0x29c8de){_0xe3f960['push'](_0xe3f960['shift']());}}}(a157_0x3169,0x38cfd));import{resolve}from'node:path';function a157_0x3288(_0x46e6fb,_0x206757){_0x46e6fb=_0x46e6fb-0x74;const _0x3169ff=a157_0x3169();let _0x3288ab=_0x3169ff[_0x46e6fb];return _0x3288ab;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a157_0x2b5301(0x82),LOCK_FILE_NAME=a157_0x2b5301(0x75),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x32fe31,_0x5cf595){const _0x43a4e3=a157_0x2b5301,_0x2bf01a=resolve(_0x5cf595??findProjectRootDirectory()),_0x5ffbbf=DOT_DIR+_0x43a4e3(0x7d),_0x4d2b45=_0x5ffbbf+'/'+_0x32fe31;return{'projectRoot':_0x2bf01a,'appCode':_0x32fe31,'sqlWorkspaceRoot':_0x5ffbbf,'sqlRoot':_0x4d2b45,'sqlRootDir':resolve(_0x2bf01a,DOT_DIR,_0x43a4e3(0x80),_0x32fe31),'lockFilePath':resolve(_0x2bf01a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2bf01a,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a157_0x18864a=a157_0x3a15;function a157_0x3a15(_0x266603,_0x94699d){_0x266603=_0x266603-0x117;const _0x3eebbc=a157_0x3eeb();let _0x3a15aa=_0x3eebbc[_0x266603];return _0x3a15aa;}(function(_0x274332,_0x4ec5d2){const _0x764f42=a157_0x3a15,_0x10435b=_0x274332();while(!![]){try{const _0x22e1bc=-parseInt(_0x764f42(0x11f))/0x1*(-parseInt(_0x764f42(0x11d))/0x2)+-parseInt(_0x764f42(0x11b))/0x3*(-parseInt(_0x764f42(0x122))/0x4)+-parseInt(_0x764f42(0x120))/0x5+parseInt(_0x764f42(0x11e))/0x6*(-parseInt(_0x764f42(0x11c))/0x7)+parseInt(_0x764f42(0x118))/0x8*(-parseInt(_0x764f42(0x117))/0x9)+parseInt(_0x764f42(0x121))/0xa+-parseInt(_0x764f42(0x123))/0xb;if(_0x22e1bc===_0x4ec5d2)break;else _0x10435b['push'](_0x10435b['shift']());}catch(_0x5c08b6){_0x10435b['push'](_0x10435b['shift']());}}}(a157_0x3eeb,0xbaed1));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a157_0x18864a(0x11a),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x5e3be5,_0x2ef17b){const _0x106778=a157_0x18864a,_0x59f88f=resolve(_0x2ef17b??findProjectRootDirectory()),_0x826608=DOT_DIR+_0x106778(0x124),_0x3cd1c1=_0x826608+'/'+_0x5e3be5;return{'projectRoot':_0x59f88f,'appCode':_0x5e3be5,'sqlWorkspaceRoot':_0x826608,'sqlRoot':_0x3cd1c1,'sqlRootDir':resolve(_0x59f88f,DOT_DIR,_0x106778(0x119),_0x5e3be5),'lockFilePath':resolve(_0x59f88f,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x59f88f,DOT_DIR,TRASH_DIR_NAME)};}function a157_0x3eeb(){const _0x4925a1=['3SPbnkQ','3290231pEzxSr','1946058QtwbNv','12eeYImU','1GyIcWd','3420805GjnvBc','7689740XvoblR','4920596OmlAFD','3033998oOxyBn','/sql','603DbbmJQ','36592tByaJt','sql','sql.lock.json'];a157_0x3eeb=function(){return _0x4925a1;};return a157_0x3eeb();}