@lovrabet/rabetbase-cli 2.3.4-beta.1 → 2.3.4-beta.3

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 (219) hide show
  1. package/README.md +99 -560
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/add.js +1 -1
  21. package/lib/commands/app/discover.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/remove.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/flags.js +1 -1
  48. package/lib/commands/common/validate.js +1 -1
  49. package/lib/commands/config/get.js +1 -1
  50. package/lib/commands/config/index.js +1 -1
  51. package/lib/commands/config/list.js +1 -1
  52. package/lib/commands/config/set.js +1 -1
  53. package/lib/commands/config/shared.js +1 -1
  54. package/lib/commands/data/filter.js +1 -1
  55. package/lib/commands/data/getOne.js +1 -1
  56. package/lib/commands/data/index.js +1 -1
  57. package/lib/commands/data/shared.js +1 -1
  58. package/lib/commands/dataset/business-group-update.js +1 -1
  59. package/lib/commands/dataset/capability.js +1 -1
  60. package/lib/commands/dataset/delete.js +1 -1
  61. package/lib/commands/dataset/detail.js +1 -1
  62. package/lib/commands/dataset/extend-update.js +1 -1
  63. package/lib/commands/dataset/field-update.js +1 -1
  64. package/lib/commands/dataset/generate.js +1 -1
  65. package/lib/commands/dataset/index.js +1 -1
  66. package/lib/commands/dataset/list.js +1 -1
  67. package/lib/commands/dataset/operations.js +1 -1
  68. package/lib/commands/dataset/relation-audit.js +1 -1
  69. package/lib/commands/dataset/relation-create.js +1 -1
  70. package/lib/commands/dataset/relation-delete.js +1 -1
  71. package/lib/commands/dataset/relation-shared.js +1 -1
  72. package/lib/commands/dataset/relation-update.js +1 -1
  73. package/lib/commands/dataset/relations.js +1 -1
  74. package/lib/commands/dataset/rename.js +1 -1
  75. package/lib/commands/dataset/restore.js +1 -1
  76. package/lib/commands/db/analyze-cancel.js +1 -1
  77. package/lib/commands/db/analyze-start.js +1 -1
  78. package/lib/commands/db/analyze-status.js +1 -1
  79. package/lib/commands/db/create.js +1 -1
  80. package/lib/commands/db/delete.js +1 -1
  81. package/lib/commands/db/detail.js +1 -1
  82. package/lib/commands/db/diff.js +1 -1
  83. package/lib/commands/db/index.js +1 -1
  84. package/lib/commands/db/list.js +1 -1
  85. package/lib/commands/db/shared.js +1 -1
  86. package/lib/commands/db/tables.js +1 -1
  87. package/lib/commands/db/test.js +1 -1
  88. package/lib/commands/db/update.js +1 -1
  89. package/lib/commands/doctor.js +1 -1
  90. package/lib/commands/init/index.js +1 -1
  91. package/lib/commands/issue/index.js +1 -1
  92. package/lib/commands/issue/nudge.js +1 -1
  93. package/lib/commands/issue/report.js +1 -1
  94. package/lib/commands/issue/shared.js +1 -1
  95. package/lib/commands/logs/index.js +1 -1
  96. package/lib/commands/menu/index.js +1 -1
  97. package/lib/commands/menu/list.js +1 -1
  98. package/lib/commands/menu/shared/compare-table.js +1 -1
  99. package/lib/commands/menu/shared/index.js +1 -1
  100. package/lib/commands/menu/shared/inquirer.js +1 -1
  101. package/lib/commands/menu/shared/local-pages.js +1 -1
  102. package/lib/commands/menu/shared/logic.js +1 -1
  103. package/lib/commands/menu/shared/service.js +1 -1
  104. package/lib/commands/menu/shared/sync-core.js +1 -1
  105. package/lib/commands/menu/shared/update-core.js +1 -1
  106. package/lib/commands/menu/shared/valid-url.js +1 -1
  107. package/lib/commands/menu/sync.js +1 -1
  108. package/lib/commands/menu/update.js +1 -1
  109. package/lib/commands/page/generate-start.js +1 -1
  110. package/lib/commands/page/generate-status.js +1 -1
  111. package/lib/commands/page/index.js +1 -1
  112. package/lib/commands/page/pull.js +1 -1
  113. package/lib/commands/page/push.js +1 -1
  114. package/lib/commands/page/relation-audit.js +1 -1
  115. package/lib/commands/page/shared.js +1 -1
  116. package/lib/commands/page/standard-page-status.js +1 -1
  117. package/lib/commands/page/sync.js +1 -1
  118. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  119. package/lib/commands/project/create/format-elapsed.js +1 -1
  120. package/lib/commands/project/create/main.js +1 -1
  121. package/lib/commands/project/create/non-interactive.js +1 -1
  122. package/lib/commands/project/create/project-template-path.js +1 -1
  123. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  124. package/lib/commands/project/create/use-format-code.js +1 -1
  125. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  126. package/lib/commands/project/index.js +1 -1
  127. package/lib/commands/project/init.js +1 -1
  128. package/lib/commands/project/upgrade.js +1 -1
  129. package/lib/commands/registry.js +1 -1
  130. package/lib/commands/run/index.js +1 -1
  131. package/lib/commands/schema.js +1 -1
  132. package/lib/commands/sql/create.js +1 -1
  133. package/lib/commands/sql/delete.js +1 -1
  134. package/lib/commands/sql/detail.js +1 -1
  135. package/lib/commands/sql/exec.js +1 -1
  136. package/lib/commands/sql/index.js +1 -1
  137. package/lib/commands/sql/list.js +1 -1
  138. package/lib/commands/sql/pull.js +1 -1
  139. package/lib/commands/sql/push.js +1 -1
  140. package/lib/commands/sql/save.js +1 -1
  141. package/lib/commands/sql/shared.js +1 -1
  142. package/lib/commands/sql/status.js +1 -1
  143. package/lib/commands/sql/validate.js +1 -1
  144. package/lib/commands/workspace/index.js +1 -1
  145. package/lib/config/schema.js +1 -1
  146. package/lib/constant/cdn.js +1 -1
  147. package/lib/constant/cli.js +1 -1
  148. package/lib/constant/defaults.js +1 -1
  149. package/lib/constant/domain.js +1 -1
  150. package/lib/constant/env.js +1 -1
  151. package/lib/constant/output.js +1 -1
  152. package/lib/constant/paths.js +1 -1
  153. package/lib/constant/risk.js +1 -1
  154. package/lib/context/app-resolver.js +1 -1
  155. package/lib/context/auth-resolver.js +1 -1
  156. package/lib/context/config-loader.js +1 -1
  157. package/lib/context.js +1 -1
  158. package/lib/core/alias-resolver.js +1 -1
  159. package/lib/core/api-client.js +1 -1
  160. package/lib/core/bff/config.js +1 -1
  161. package/lib/core/bff/file-system.js +1 -1
  162. package/lib/core/bff/hash.js +1 -1
  163. package/lib/core/bff/lock.js +1 -1
  164. package/lib/core/bff/utils.js +1 -1
  165. package/lib/core/db-resolver.js +1 -1
  166. package/lib/core/page/file-system.js +1 -1
  167. package/lib/core/page/hash.js +1 -1
  168. package/lib/core/page/lock.js +1 -1
  169. package/lib/core/sql-sync/config.js +1 -1
  170. package/lib/core/sql-sync/file-system.js +1 -1
  171. package/lib/core/sql-sync/hash.js +1 -1
  172. package/lib/core/sql-sync/lock.js +1 -1
  173. package/lib/core/sql-sync/utils.js +1 -1
  174. package/lib/core/sql-validator.js +1 -1
  175. package/lib/errors.js +1 -1
  176. package/lib/framework/build-all-flags.js +1 -1
  177. package/lib/framework/flags.js +1 -1
  178. package/lib/framework/help.js +1 -1
  179. package/lib/framework/index.js +1 -1
  180. package/lib/framework/output.js +1 -1
  181. package/lib/framework/response.js +1 -1
  182. package/lib/framework/runner-alias.js +1 -1
  183. package/lib/framework/runner.js +1 -1
  184. package/lib/framework/schema-export.js +1 -1
  185. package/lib/framework/types.js +1 -1
  186. package/lib/generated/build-info.js +1 -1
  187. package/lib/help.js +1 -1
  188. package/lib/skills/main.js +1 -1
  189. package/lib/skills/npx-skills-add.js +1 -1
  190. package/lib/telemetry/cli-command-trace.js +1 -1
  191. package/lib/telemetry/cli-help-trace.js +1 -1
  192. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  193. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  194. package/lib/telemetry/send-cli-trace-log.js +1 -1
  195. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  196. package/lib/utils/ai_config.js +1 -1
  197. package/lib/utils/apply-jq-filter.js +1 -1
  198. package/lib/utils/cdn-config.js +1 -1
  199. package/lib/utils/check-sdk-version.js +1 -1
  200. package/lib/utils/cli-version-check.js +1 -1
  201. package/lib/utils/cli-version-policy.js +1 -1
  202. package/lib/utils/config.js +1 -1
  203. package/lib/utils/copy-directory.js +1 -1
  204. package/lib/utils/entity-with-id.js +1 -1
  205. package/lib/utils/file-utils.js +1 -1
  206. package/lib/utils/guides-cdn.js +1 -1
  207. package/lib/utils/http-client.js +1 -1
  208. package/lib/utils/is-non-interactive.js +1 -1
  209. package/lib/utils/logger.js +1 -1
  210. package/lib/utils/params.js +1 -1
  211. package/lib/utils/platform.js +1 -1
  212. package/lib/utils/rules-cdn.js +1 -1
  213. package/lib/utils/sleep.js +1 -1
  214. package/lib/utils/template-replacer.js +1 -1
  215. package/lib/utils/update-notice.js +1 -1
  216. package/lib/utils/version.js +1 -1
  217. package/lib/utils/with-active-cookie.js +1 -1
  218. package/lib/utils/write-cli-side-channel.js +1 -1
  219. package/package.json +18 -2
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- (function(_0x35fdb6,_0x51b8ed){const _0x52254e=a156_0x5a02,_0x60c312=_0x35fdb6();while(!![]){try{const _0x2434fa=parseInt(_0x52254e(0x12a))/0x1+-parseInt(_0x52254e(0x131))/0x2+parseInt(_0x52254e(0x121))/0x3+-parseInt(_0x52254e(0x12c))/0x4*(-parseInt(_0x52254e(0x115))/0x5)+-parseInt(_0x52254e(0x113))/0x6*(parseInt(_0x52254e(0x124))/0x7)+parseInt(_0x52254e(0x136))/0x8+parseInt(_0x52254e(0x111))/0x9*(parseInt(_0x52254e(0x128))/0xa);if(_0x2434fa===_0x51b8ed)break;else _0x60c312['push'](_0x60c312['shift']());}catch(_0x48f11e){_0x60c312['push'](_0x60c312['shift']());}}}(a156_0x5f00,0xbfc68));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';function a156_0x5a02(_0x3eaafb,_0x397457){_0x3eaafb=_0x3eaafb-0x110;const _0x5f0094=a156_0x5f00();let _0x5a0230=_0x5f0094[_0x3eaafb];return _0x5a0230;}import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x4d164d){return process.env[`RABETBASE_${_0x4d164d}`]||process.env[`LOVRABET_${_0x4d164d}`]||undefined;}export async function createContext(_0x57231c){const _0x3f1f1a=a156_0x5a02,{config:_0x5426b2,layers:_0x5ea017}=readRawConfigWithLayers(),_0x433d2d=buildConfig(_0x5426b2,_0x57231c,_0x5ea017),{initEnv:_0x2fc693}=await import('./constant/env.js');if(_0x433d2d[_0x3f1f1a(0x134)])_0x2fc693(_0x433d2d['env']);else _0x57231c[_0x3f1f1a(0x134)]&&typeof _0x57231c[_0x3f1f1a(0x134)]===_0x3f1f1a(0x116)&&_0x2fc693(_0x57231c[_0x3f1f1a(0x134)]);const {initDomains:_0x4a2208,getUserDomain:_0x1bc906,getApiDomain:_0x421a33}=await import(_0x3f1f1a(0x126));_0x4a2208({'apiDomain':_0x5426b2[_0x3f1f1a(0x12d)]||undefined,'userDomain':_0x5426b2[_0x3f1f1a(0x11f)]||undefined,'runtimeDomain':_0x5426b2[_0x3f1f1a(0x130)]||undefined});const _0x107ff1={'apiDomain':_0x421a33(),'userDomain':_0x1bc906()},_0x49993c=await buildAuth(_0x433d2d);logger['setLogPath'](process[_0x3f1f1a(0x133)]());const _0x164ccc=(CLI_BIN_NAME+'\x20'+process['argv'][_0x3f1f1a(0x119)](0x2)[_0x3f1f1a(0x129)]('\x20'))[_0x3f1f1a(0x12e)]();logger[_0x3f1f1a(0x139)](_0x164ccc);const {isNonInteractive:_0x50a4ff}=await import(_0x3f1f1a(0x118)),_0x505e4e=_0x50a4ff(_0x57231c);return{'config':_0x433d2d,'auth':_0x49993c,'logger':logger,'env':_0x107ff1,'nonInteractive':_0x505e4e};}export function buildConfigFromFlags(_0x3a4d04){const {config:_0x35ceb7,layers:_0x79af7d}=readRawConfigWithLayers();return buildConfig(_0x35ceb7,_0x3a4d04,_0x79af7d);}export function getConfigAppCode(_0x392021){const _0x8ce9ba=a156_0x5a02,_0x5d8201=readRawConfig(_0x392021);if(_0x5d8201[_0x8ce9ba(0x114)]&&typeof _0x5d8201[_0x8ce9ba(0x114)]===_0x8ce9ba(0x123)){const _0x5bdf27=_0x5d8201[_0x8ce9ba(0x112)];if(_0x5bdf27&&_0x5d8201[_0x8ce9ba(0x114)][_0x5bdf27]?.[_0x8ce9ba(0x138)])return String(_0x5d8201[_0x8ce9ba(0x114)][_0x5bdf27]['appcode'])[_0x8ce9ba(0x12e)]();const _0x37a449=Object['values'](_0x5d8201[_0x8ce9ba(0x114)])[0x0];if(_0x37a449?.['appcode'])return String(_0x37a449['appcode'])[_0x8ce9ba(0x12e)]();}const _0x1a852b=_0x5d8201['appcode']||_0x5d8201['app'];if(typeof _0x1a852b!==_0x8ce9ba(0x116)||_0x1a852b['trim']()==='')return undefined;return _0x1a852b['trim']();}export function getMultiAppConfigs(_0x2b8b55='project',_0x5142ea){const _0x2035c3=a156_0x5a02,_0x52b188=loadRawConfigLayers(_0x5142ea);let _0x852de,_0x18c237;if(_0x2b8b55===_0x2035c3(0x120)){const _0x2d1f5b=_0x52b188[_0x2035c3(0x11b)][_0x2035c3(0x114)]&&typeof _0x52b188[_0x2035c3(0x11b)]['apps']===_0x2035c3(0x123)?_0x52b188[_0x2035c3(0x11b)][_0x2035c3(0x114)]:{},_0x15b41e=_0x52b188[_0x2035c3(0x11a)][_0x2035c3(0x114)]&&typeof _0x52b188['projectConfig'][_0x2035c3(0x114)]==='object'?_0x52b188[_0x2035c3(0x11a)]['apps']:{};_0x852de={..._0x2d1f5b,..._0x15b41e};const _0x45bf2b=readRawConfig(_0x5142ea);_0x18c237=_0x45bf2b[_0x2035c3(0x112)];}else _0x852de=_0x52b188[_0x2035c3(0x11a)][_0x2035c3(0x114)],_0x18c237=_0x52b188[_0x2035c3(0x11a)]['defaultApp'];if(!_0x852de||typeof _0x852de!==_0x2035c3(0x123)||Object[_0x2035c3(0x110)](_0x852de)[_0x2035c3(0x122)]===0x0)return null;return Object['entries'](_0x852de)[_0x2035c3(0x127)](([_0x4ca897,_0x57f522])=>({'name':_0x4ca897,'appcode':_0x57f522?.['appcode']||'','isDefault':_0x4ca897===_0x18c237,'env':_0x57f522?.[_0x2035c3(0x134)],'apiDir':_0x57f522?.[_0x2035c3(0x12b)],'cookie':_0x57f522?.[_0x2035c3(0x125)]||undefined}))[_0x2035c3(0x137)](_0x405858=>_0x405858[_0x2035c3(0x138)]);}export function getTemplateBaseUrl(_0x30b931){const _0x52d0ff=a156_0x5a02,_0x25afb6=readRawConfig(_0x30b931);if(_0x25afb6['template_base_url']&&typeof _0x25afb6['template_base_url']===_0x52d0ff(0x116))return _0x25afb6[_0x52d0ff(0x11d)][_0x52d0ff(0x135)](/\/$/,'');return _0x52d0ff(0x12f);}function a156_0x5f00(){const _0x51af4a=['appcode','setRawCommand','keys','75267ATjZJW','defaultApp','138mpJBAm','apps','505YFllYu','string','-api.ts','./utils/is-non-interactive.js','slice','projectConfig','globalConfig','find','template_base_url','api.ts','userDomain','merged','2961840XqhSlL','length','object','251461YlyLTN','cookie','./constant/domain.js','map','670wgwHYw','join','207166yQYFLd','apiDir','10548wvXIzb','apiDomain','trim','https://g.lovrabet.com/dist/lovrabet-skill','runtimeDomain','1526776hrbATg','entries','cwd','env','replace','2832200AKWoul','filter'];a156_0x5f00=function(){return _0x51af4a;};return a156_0x5f00();}function buildConfig(_0xafccab,_0x369f3f,_0x789567){return{...resolveAppConfig({'raw':_0xafccab,'flags':_0x369f3f,'layers':_0x789567,'readEnv':env}),'raw':_0xafccab};}export function resolveApiFilePath(_0x2c89e4,_0x2167df){const _0x23275a=a156_0x5a02,_0x5417a7=resolve(process[_0x23275a(0x133)](),_0x2c89e4),_0x2f179f=resolve(_0x5417a7,_0x23275a(0x11e));if(!_0x2167df)return _0x2f179f;const _0x2ab88b=readRawConfig(),_0x3eab08=_0x2ab88b[_0x23275a(0x114)]&&typeof _0x2ab88b[_0x23275a(0x114)]===_0x23275a(0x123)?_0x2ab88b['apps']:{},_0x3e9d01=Object[_0x23275a(0x132)](_0x3eab08)[_0x23275a(0x11c)](([,_0x108db9])=>_0x108db9?.[_0x23275a(0x138)]===_0x2167df);if(!_0x3e9d01)return _0x2f179f;const [_0x12fd02,_0x19c951]=_0x3e9d01,_0x18b183=typeof _0x2ab88b[_0x23275a(0x112)]===_0x23275a(0x116)?_0x2ab88b['defaultApp']:undefined;if(_0x19c951?.[_0x23275a(0x12b)])return _0x2f179f;if(_0x18b183&&_0x12fd02!==_0x18b183)return resolve(_0x5417a7,_0x12fd02+_0x23275a(0x117));return _0x2f179f;}
1
+ (function(_0x387d63,_0x1ba957){const _0x5f399d=a156_0xc4cc,_0x13d0db=_0x387d63();while(!![]){try{const _0x17f98a=-parseInt(_0x5f399d(0x131))/0x1+parseInt(_0x5f399d(0x12d))/0x2*(parseInt(_0x5f399d(0x151))/0x3)+-parseInt(_0x5f399d(0x13b))/0x4+parseInt(_0x5f399d(0x14e))/0x5*(parseInt(_0x5f399d(0x14c))/0x6)+parseInt(_0x5f399d(0x13f))/0x7+parseInt(_0x5f399d(0x141))/0x8+parseInt(_0x5f399d(0x14f))/0x9;if(_0x17f98a===_0x1ba957)break;else _0x13d0db['push'](_0x13d0db['shift']());}catch(_0x4ed55f){_0x13d0db['push'](_0x13d0db['shift']());}}}(a156_0x4ae4,0x5afbd));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x400701){return process.env[`RABETBASE_${_0x400701}`]||process.env[`LOVRABET_${_0x400701}`]||undefined;}export async function createContext(_0xda703d){const _0x23bca5=a156_0xc4cc,{config:_0x3871ca,layers:_0x19acf7}=readRawConfigWithLayers(),_0x2cfc0d=buildConfig(_0x3871ca,_0xda703d,_0x19acf7),{initEnv:_0x22d686}=await import(_0x23bca5(0x13d));if(_0x2cfc0d['env'])_0x22d686(_0x2cfc0d[_0x23bca5(0x147)]);else _0xda703d[_0x23bca5(0x147)]&&typeof _0xda703d[_0x23bca5(0x147)]===_0x23bca5(0x139)&&_0x22d686(_0xda703d['env']);const {initDomains:_0x11f7d2,getUserDomain:_0x558bdd,getApiDomain:_0xfb72f5}=await import(_0x23bca5(0x14a));_0x11f7d2({'apiDomain':_0x3871ca[_0x23bca5(0x13e)]||undefined,'userDomain':_0x3871ca[_0x23bca5(0x144)]||undefined,'runtimeDomain':_0x3871ca[_0x23bca5(0x12e)]||undefined});const _0x2f0f1d={'apiDomain':_0xfb72f5(),'userDomain':_0x558bdd()},_0x1f3127=await buildAuth(_0x2cfc0d);logger[_0x23bca5(0x142)](process[_0x23bca5(0x13c)]());const _0x489ae6=(CLI_BIN_NAME+'\x20'+process[_0x23bca5(0x143)][_0x23bca5(0x12a)](0x2)[_0x23bca5(0x14d)]('\x20'))[_0x23bca5(0x148)]();logger[_0x23bca5(0x130)](_0x489ae6);const {isNonInteractive:_0x3b475d}=await import('./utils/is-non-interactive.js'),_0x2bd441=_0x3b475d(_0xda703d);return{'config':_0x2cfc0d,'auth':_0x1f3127,'logger':logger,'env':_0x2f0f1d,'nonInteractive':_0x2bd441};}export function buildConfigFromFlags(_0x558939){const {config:_0x31b0a3,layers:_0x209265}=readRawConfigWithLayers();return buildConfig(_0x31b0a3,_0x558939,_0x209265);}export function getConfigAppCode(_0x2658ac){const _0x358515=a156_0xc4cc,_0x4e267c=readRawConfig(_0x2658ac);if(_0x4e267c['apps']&&typeof _0x4e267c[_0x358515(0x150)]==='object'){const _0x42fecb=_0x4e267c['defaultApp'];if(_0x42fecb&&_0x4e267c[_0x358515(0x150)][_0x42fecb]?.[_0x358515(0x145)])return String(_0x4e267c[_0x358515(0x150)][_0x42fecb][_0x358515(0x145)])[_0x358515(0x148)]();const _0x48fdb0=Object[_0x358515(0x134)](_0x4e267c[_0x358515(0x150)])[0x0];if(_0x48fdb0?.[_0x358515(0x145)])return String(_0x48fdb0[_0x358515(0x145)])['trim']();}const _0x122139=_0x4e267c[_0x358515(0x145)]||_0x4e267c[_0x358515(0x153)];if(typeof _0x122139!==_0x358515(0x139)||_0x122139[_0x358515(0x148)]()==='')return undefined;return _0x122139[_0x358515(0x148)]();}export function getMultiAppConfigs(_0x5f3c69='project',_0x370012){const _0x45f802=a156_0xc4cc,_0x3463ef=loadRawConfigLayers(_0x370012);let _0x16f3d5,_0x18700c;if(_0x5f3c69==='merged'){const _0x4d91da=_0x3463ef[_0x45f802(0x136)][_0x45f802(0x150)]&&typeof _0x3463ef[_0x45f802(0x136)][_0x45f802(0x150)]==='object'?_0x3463ef[_0x45f802(0x136)][_0x45f802(0x150)]:{},_0x3e321b=_0x3463ef['projectConfig'][_0x45f802(0x150)]&&typeof _0x3463ef[_0x45f802(0x135)][_0x45f802(0x150)]===_0x45f802(0x12b)?_0x3463ef['projectConfig'][_0x45f802(0x150)]:{};_0x16f3d5={..._0x4d91da,..._0x3e321b};const _0x1dbcb3=readRawConfig(_0x370012);_0x18700c=_0x1dbcb3[_0x45f802(0x133)];}else _0x16f3d5=_0x3463ef['projectConfig'][_0x45f802(0x150)],_0x18700c=_0x3463ef[_0x45f802(0x135)][_0x45f802(0x133)];if(!_0x16f3d5||typeof _0x16f3d5!==_0x45f802(0x12b)||Object[_0x45f802(0x12c)](_0x16f3d5)[_0x45f802(0x138)]===0x0)return null;return Object['entries'](_0x16f3d5)[_0x45f802(0x149)](([_0x51b9e2,_0x5327fc])=>({'name':_0x51b9e2,'appcode':_0x5327fc?.[_0x45f802(0x145)]||'','isDefault':_0x51b9e2===_0x18700c,'env':_0x5327fc?.[_0x45f802(0x147)],'apiDir':_0x5327fc?.[_0x45f802(0x13a)],'cookie':_0x5327fc?.['cookie']||undefined}))[_0x45f802(0x140)](_0x56d25c=>_0x56d25c[_0x45f802(0x145)]);}function a156_0xc4cc(_0x20dcee,_0x1d2b92){_0x20dcee=_0x20dcee-0x12a;const _0x4ae494=a156_0x4ae4();let _0xc4cc28=_0x4ae494[_0x20dcee];return _0xc4cc28;}function a156_0x4ae4(){const _0x1bae25=['6quVeLQ','join','1047555aVKjBM','3566277samIJV','apps','6VNAdVp','https://g.lovrabet.com/dist/lovrabet-skill','app','slice','object','keys','269896JjhtqD','runtimeDomain','entries','setRawCommand','663942hvUHTA','find','defaultApp','values','projectConfig','globalConfig','api.ts','length','string','apiDir','1903972ZzvPnt','cwd','./constant/env.js','apiDomain','667072DteuzM','filter','4333184yEfTil','setLogPath','argv','userDomain','appcode','-api.ts','env','trim','map','./constant/domain.js','template_base_url'];a156_0x4ae4=function(){return _0x1bae25;};return a156_0x4ae4();}export function getTemplateBaseUrl(_0x288b28){const _0x4af85a=a156_0xc4cc,_0xc69b09=readRawConfig(_0x288b28);if(_0xc69b09[_0x4af85a(0x14b)]&&typeof _0xc69b09[_0x4af85a(0x14b)]==='string')return _0xc69b09[_0x4af85a(0x14b)]['replace'](/\/$/,'');return _0x4af85a(0x152);}function buildConfig(_0x5e1554,_0x20a6d2,_0x51d1e6){return{...resolveAppConfig({'raw':_0x5e1554,'flags':_0x20a6d2,'layers':_0x51d1e6,'readEnv':env}),'raw':_0x5e1554};}export function resolveApiFilePath(_0x3347e9,_0x1fbe50){const _0x135084=a156_0xc4cc,_0x70c789=resolve(process['cwd'](),_0x3347e9),_0xeadf6b=resolve(_0x70c789,_0x135084(0x137));if(!_0x1fbe50)return _0xeadf6b;const _0x3e9321=readRawConfig(),_0x1e7afd=_0x3e9321[_0x135084(0x150)]&&typeof _0x3e9321[_0x135084(0x150)]===_0x135084(0x12b)?_0x3e9321[_0x135084(0x150)]:{},_0x16cbb3=Object[_0x135084(0x12f)](_0x1e7afd)[_0x135084(0x132)](([,_0x5b0482])=>_0x5b0482?.['appcode']===_0x1fbe50);if(!_0x16cbb3)return _0xeadf6b;const [_0x3082eb,_0x47c732]=_0x16cbb3,_0x3e6a80=typeof _0x3e9321[_0x135084(0x133)]==='string'?_0x3e9321[_0x135084(0x133)]:undefined;if(_0x47c732?.[_0x135084(0x13a)])return _0xeadf6b;if(_0x3e6a80&&_0x3082eb!==_0x3e6a80)return resolve(_0x70c789,_0x3082eb+_0x135084(0x146));return _0xeadf6b;}
@@ -1 +1 @@
1
- function a157_0x3a00(_0x21019b,_0x565401){_0x21019b=_0x21019b-0x64;const _0x1170dd=a157_0x1170();let _0x3a00f2=_0x1170dd[_0x21019b];return _0x3a00f2;}(function(_0x5ecdbd,_0x19ad40){const _0x12e149=a157_0x3a00,_0x240c2b=_0x5ecdbd();while(!![]){try{const _0x29434a=-parseInt(_0x12e149(0x6d))/0x1+-parseInt(_0x12e149(0x67))/0x2*(-parseInt(_0x12e149(0x74))/0x3)+-parseInt(_0x12e149(0x68))/0x4+-parseInt(_0x12e149(0x66))/0x5*(-parseInt(_0x12e149(0x72))/0x6)+-parseInt(_0x12e149(0x6e))/0x7+parseInt(_0x12e149(0x69))/0x8*(parseInt(_0x12e149(0x6a))/0x9)+parseInt(_0x12e149(0x64))/0xa;if(_0x29434a===_0x19ad40)break;else _0x240c2b['push'](_0x240c2b['shift']());}catch(_0x1b7570){_0x240c2b['push'](_0x240c2b['shift']());}}}(a157_0x1170,0x47592));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a157_0x1170(){const _0xf76b99=['140142jowPTt','exec','1239UkJzyQ','5527930BXXDUx','datasetCode','25UwVgsj','918nKReVu','13048HGavCg','669544hMhGfW','9fjDyhM','set','cwd','561520OJaDTZ','600698inbzrg','get','has','push'];a157_0x1170=function(){return _0xf76b99;};return a157_0x1170();}function parseApiFile(_0x3507ac){const _0x5da44e=a157_0x3a00,_0x49a54d=[],_0x22fbc0=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x545fb5;while((_0x545fb5=_0x22fbc0[_0x5da44e(0x73)](_0x3507ac))!==null){_0x49a54d[_0x5da44e(0x71)]({'datasetCode':_0x545fb5[0x1],'tableName':_0x545fb5[0x2],'name':_0x545fb5[0x3],'alias':_0x545fb5[0x4]});}return _0x49a54d;}export function loadAliasMap(_0xd8f648,_0x11fe1d,_0x20aff6){const _0x11e90b=a157_0x3a00,_0xe0bcca=_0x20aff6??resolve(process[_0x11e90b(0x6c)](),_0xd8f648,'api.ts');if(cache[_0x11e90b(0x70)](_0xe0bcca))return cache[_0x11e90b(0x6f)](_0xe0bcca);if(!existsSync(_0xe0bcca))return cache['set'](_0xe0bcca,[]),[];try{const _0x59ed95=readFileSync(_0xe0bcca,'utf-8'),_0x2e7eab=parseApiFile(_0x59ed95);return cache[_0x11e90b(0x6b)](_0xe0bcca,_0x2e7eab),_0x2e7eab;}catch{return cache['set'](_0xe0bcca,[]),[];}}export function resolveAlias(_0x5e2467,_0xf17ea4,_0x4ae5b3,_0x34d75c){const _0xe55764=a157_0x3a00;if(!_0xf17ea4)return undefined;const _0x10a445=loadAliasMap(_0x5e2467,_0x4ae5b3,_0x34d75c),_0x44f718=_0x10a445['find'](_0x5407d8=>_0x5407d8['alias']===_0xf17ea4);return _0x44f718?.[_0xe55764(0x65)];}export function listAliases(_0x46cd16,_0x5e6479,_0x68b295){return loadAliasMap(_0x46cd16,_0x5e6479,_0x68b295);}
1
+ (function(_0x501a7b,_0x496fc8){const _0x3e3fd4=a157_0x5854,_0x436bf9=_0x501a7b();while(!![]){try{const _0x208c91=-parseInt(_0x3e3fd4(0x173))/0x1+-parseInt(_0x3e3fd4(0x16d))/0x2*(-parseInt(_0x3e3fd4(0x16f))/0x3)+parseInt(_0x3e3fd4(0x16e))/0x4+-parseInt(_0x3e3fd4(0x177))/0x5+-parseInt(_0x3e3fd4(0x16c))/0x6*(-parseInt(_0x3e3fd4(0x170))/0x7)+parseInt(_0x3e3fd4(0x174))/0x8*(-parseInt(_0x3e3fd4(0x176))/0x9)+parseInt(_0x3e3fd4(0x172))/0xa*(parseInt(_0x3e3fd4(0x168))/0xb);if(_0x208c91===_0x496fc8)break;else _0x436bf9['push'](_0x436bf9['shift']());}catch(_0x19e37d){_0x436bf9['push'](_0x436bf9['shift']());}}}(a157_0x1c07,0xd0791));function a157_0x5854(_0x359b18,_0x5be1ae){_0x359b18=_0x359b18-0x168;const _0x1c07b8=a157_0x1c07();let _0x5854c0=_0x1c07b8[_0x359b18];return _0x5854c0;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a157_0x1c07(){const _0x3460cd=['7829288gzvOsy','set','9tVZxDK','6747345rYpTWs','alias','utf-8','11IQwjbR','push','find','get','108ZGcnEU','21002wmUSQK','2434168SxjFXd','243UrJngJ','328139sSPaVi','api.ts','17743330raPPWB','895207vAYygO'];a157_0x1c07=function(){return _0x3460cd;};return a157_0x1c07();}function parseApiFile(_0x4143c6){const _0x161a6e=a157_0x5854,_0x393100=[],_0x180513=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x296a43;while((_0x296a43=_0x180513['exec'](_0x4143c6))!==null){_0x393100[_0x161a6e(0x169)]({'datasetCode':_0x296a43[0x1],'tableName':_0x296a43[0x2],'name':_0x296a43[0x3],'alias':_0x296a43[0x4]});}return _0x393100;}export function loadAliasMap(_0x241f3b,_0x433082,_0x315ab6){const _0xf4479e=a157_0x5854,_0x203096=_0x315ab6??resolve(process['cwd'](),_0x241f3b,_0xf4479e(0x171));if(cache['has'](_0x203096))return cache[_0xf4479e(0x16b)](_0x203096);if(!existsSync(_0x203096))return cache['set'](_0x203096,[]),[];try{const _0xa18bcc=readFileSync(_0x203096,_0xf4479e(0x179)),_0xc7cded=parseApiFile(_0xa18bcc);return cache['set'](_0x203096,_0xc7cded),_0xc7cded;}catch{return cache[_0xf4479e(0x175)](_0x203096,[]),[];}}export function resolveAlias(_0x4b6b18,_0x2108a6,_0x46ceab,_0x1ee68d){const _0x52bdae=a157_0x5854;if(!_0x2108a6)return undefined;const _0x4ee691=loadAliasMap(_0x4b6b18,_0x46ceab,_0x1ee68d),_0x38370d=_0x4ee691[_0x52bdae(0x16a)](_0x5a6269=>_0x5a6269[_0x52bdae(0x178)]===_0x2108a6);return _0x38370d?.['datasetCode'];}export function listAliases(_0x16661a,_0x310c33,_0x46aed1){return loadAliasMap(_0x16661a,_0x310c33,_0x46aed1);}
@@ -1 +1 @@
1
- function a158_0x47d1(){const _0x3292dd=['json','sqlCode','join','signal','apiError','4440232PlxKlC','status','datasetName','toLowerCase','replace','const\x20data\x20=\x20await\x20client.sql.execute({','authRequired','target','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20apps.\x20','modelId','/smartapi/question/er-config/update-single','Request\x20timeout:\x20','/api/custom/executeSql','/filter','1389520rQqUCu','warn','/smartapi/custom/getUserCustomSql','\x20\x20sqlCode:\x20\x27','\x20\x20});','\x20failed,\x20HTTP\x20','/smartapi/app-config/list','/smartapi/dataset/get-dataset-list','version','/smartapi/dataset/restore-dataset','/smartapi/app-config/getByKey','tableName','/smartapi/custom/getUserCustomSql?id=','toString','\x22\x20not\x20found\x20in\x20dataset\x20','scriptType','message','/smartapi/question/er-config/business-group/edit','6SoRGqb','length','/smartapi/question/er-config','key','/smartapi/question/er-config/erCreate','name','.remove(id);','/api/management/library/scripts/statistics?appCode=','\x20\x20return\x20rows;','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','clientOperationId','/smartapi/lovrabet/detail?pageId=','906430AYoPTB','application/json','Request\x20failed:\x20','/smartapi/lovrabet/update-page','string','const\x20result\x20=\x20await\x20client.models.','Page\x20not\x20found:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','type','cli:rabetbase','401','/smartapi/db-analysis/status/','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','.create({\x20/*\x20fields\x20*/\x20});','?sqlCode=','89640ilXXCO','includes','method','scriptName','/api/management/library/scripts/save','//\x20SQL:\x20','/smartapi/app/getList','label','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/app-config/create','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','deleted','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','create','requirementDescription','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','set','getOne','/api/management/library/scripts/delete','Unauthorized','const\x20results\x20=\x20data.execResult\x20||\x20[];','filter','/api/management/library/scripts/info?id=','\x20\x20currentPage:\x201,','find','/standard-page-status?appCode=','enabled','921ZmCuKn','/smartapi/dblink/update','responseFields','/smartapi/custom/saveUserCustomSql','9bCHAte','body','includeImports','entries','dbtableConfig','errorMsg','/smartapi/dblink/create','errorMessage','sqlName','currentPage','/smartapi/db-analysis/jobs/cancel','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','});','code','/smartapi/dataset/text-generate/status?','/smartapi/custom/queryUserCustomSqlList','description','1529LAdTww','add','POST','/smartapi/app-config/update','/smartapi/question/er-config/erDelete','delete','/api/management/script/cache/clear','/generate-standard-pages/start','/smartapi/dblink/getOne','cookie','/smartapi/custom/deleteUserCustomSql','remove','list','pageSize','totalCount','/smartapi/lovrabet/dataset/','planId','/smartapi/dblink/getAllTableList','/smartapi/app-config/delete','success','/sync-to-pages','value','AbortError','5838413DDhOMM','functionName','validation','operationId','sdk','operations','2188knFefG','modelCode','data','/api/management/library/scripts/list?appCode=','appCode','tableData','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/api/node-toolbox/sql/save','stringify','/api/','/smartapi/dataset/update-driven-data','/smartapi/dblink/testConnect','update','GET','/smartapi/dblink/delete','has','tags','push','map','isArray','object','/smartapi/dblink/getTableDiffV2ByPage','Dataset\x20not\x20found:\x20','UNAUTHORIZED','operationName','(/*\x20params\x20*/);','summary','api_error','667114YYUYhH','table','displayName','/smartapi/dataset/text-generate/preview','/smartapi/dblink/getList'];a158_0x47d1=function(){return _0x3292dd;};return a158_0x47d1();}(function(_0x117cd5,_0x2f9b76){const _0x330756=a158_0x2ac6,_0x53435a=_0x117cd5();while(!![]){try{const _0xe079a4=parseInt(_0x330756(0x190))/0x1+-parseInt(_0x330756(0x1c7))/0x2+-parseInt(_0x330756(0x1f6))/0x3*(-parseInt(_0x330756(0x174))/0x4)+parseInt(_0x330756(0x1a9))/0x5+parseInt(_0x330756(0x1bb))/0x6*(-parseInt(_0x330756(0x16e))/0x7)+parseInt(_0x330756(0x19a))/0x8*(-parseInt(_0x330756(0x1fa))/0x9)+parseInt(_0x330756(0x1d7))/0xa*(parseInt(_0x330756(0x20b))/0xb);if(_0xe079a4===_0x2f9b76)break;else _0x53435a['push'](_0x53435a['shift']());}catch(_0x5b74dd){_0x53435a['push'](_0x53435a['shift']());}}}(a158_0x47d1,0x7e220));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(_0x86fe01){_activeCookie=_0x86fe01||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x1413bc,_0x41b3cd){const _0x2241a4=a158_0x2ac6,_0x232012=_0x41b3cd instanceof Error?_0x41b3cd[_0x2241a4(0x1b9)]:String(_0x41b3cd);return CliErrors['apiError'](_0x2241a4(0x1c9)+_0x1413bc+(_0x232012?'\x20('+_0x232012+')':''),_0x2241a4(0x1e1));}async function apiRequest(_0x3f4ad2,_0xa8bbd5={}){const _0x3e2089=a158_0x2ac6,{method:method=_0x3e2089(0x181),body:_0x3cfe58,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xa8bbd5,_0x1f5fd9=useRuntime?getRuntimeDomain():getApiDomain(),_0xfe3427=_activeCookie||getCookie(),_0x11aee4=''+_0x1f5fd9+_0x3f4ad2,_0x169ca5=new AbortController(),_0x1b808d=setTimeout(()=>_0x169ca5['abort'](),timeout);try{const _0x6b996c=await fetch(_0x11aee4,{'method':method,'headers':{'Content-Type':_0x3e2089(0x1c8),'Cookie':_0xfe3427,'X-Invoke-Source':_0x3e2089(0x1d0),...headers},'body':_0x3cfe58?JSON[_0x3e2089(0x17c)](_0x3cfe58):undefined,'signal':_0x169ca5[_0x3e2089(0x198)]});let _0x52fbc5;try{_0x52fbc5=await _0x6b996c[_0x3e2089(0x195)]();}catch(_0x2df941){if(_0x2df941 instanceof Error&&_0x2df941[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);if(_0x6b996c['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3e2089(0x199)](_0x3e2089(0x1ce)+_0x6b996c[_0x3e2089(0x19b)]+')',_0x6b996c['status']>=0x190?_0x3e2089(0x1d3):undefined);}if(!_0x6b996c['ok']||_0x52fbc5[_0x3e2089(0x16a)]===![])throw CliErrors[_0x3e2089(0x199)](_0x52fbc5[_0x3e2089(0x1ff)]||_0x52fbc5['message']||'API\x20error:\x20'+_0x6b996c[_0x3e2089(0x19b)],_0x52fbc5[_0x3e2089(0x1ea)]?'API\x20error\x20code:\x20'+_0x52fbc5[_0x3e2089(0x1ea)]:undefined);return _0x52fbc5;}catch(_0x572dcb){if(_0x572dcb instanceof CliError)throw _0x572dcb;if(_0x572dcb instanceof Error&&_0x572dcb[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);throw createFetchFailureError(_0x11aee4,_0x572dcb);}finally{clearTimeout(_0x1b808d);}}function isAuthFailure(_0x34d580){const _0x3542e6=a158_0x2ac6,_0x389640=_0x34d580[_0x3542e6(0x1ff)]||_0x34d580[_0x3542e6(0x1b9)]||_0x34d580['data']?.[_0x3542e6(0x1b9)]||_0x34d580[_0x3542e6(0x201)]||_0x34d580['error']||'';return _0x34d580['errorCode']===_0x3542e6(0x18b)||_0x34d580[_0x3542e6(0x207)]===0x191||_0x34d580[_0x3542e6(0x207)]==='401'||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1d1))||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1ee))||_0x389640['includes']('登录')||_0x389640[_0x3542e6(0x1d8)]('认证');}export async function platformFetch(_0x5eb400,_0xb53f43){const _0x190c7c=a158_0x2ac6;let _0x52a775;try{_0x52a775=await fetch(_0x5eb400,{'method':_0xb53f43[_0x190c7c(0x1d9)]??_0x190c7c(0x181),'headers':{'Content-Type':_0x190c7c(0x1c8),'Cookie':_0xb53f43[_0x190c7c(0x160)],'X-Invoke-Source':'cli:rabetbase'},..._0xb53f43[_0x190c7c(0x1fb)]&&{'body':JSON[_0x190c7c(0x17c)](_0xb53f43[_0x190c7c(0x1fb)])}});}catch(_0x182785){throw createFetchFailureError(_0x5eb400,_0x182785);}if(!_0x52a775['ok']){if(_0x52a775['status']===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x190c7c(0x199)](_0xb53f43[_0x190c7c(0x1de)]+_0x190c7c(0x1ae)+_0x52a775[_0x190c7c(0x19b)]);}const _0x384265=await _0x52a775[_0x190c7c(0x195)]();if(_0x384265[_0x190c7c(0x16a)]===![]){if(isAuthFailure(_0x384265))throw CliErrors[_0x190c7c(0x1a0)]();throw CliErrors[_0x190c7c(0x199)](_0x384265[_0x190c7c(0x1ff)]||_0x384265[_0x190c7c(0x1b9)]||_0xb53f43['label']+'\x20failed');}return _0x384265[_0x190c7c(0x176)];}export async function listBffScripts(_0x110b3d,_0x1b1e6a,_0x43607d){const _0x20b759=a158_0x2ac6;let _0x44e33b=_0x20b759(0x177)+_0x110b3d;if(_0x1b1e6a)_0x44e33b+='&type='+_0x1b1e6a;const _0x38895d=await apiRequest(_0x44e33b);let _0x100c6e=extractList(_0x38895d[_0x20b759(0x176)]);if(_0x43607d?.[_0x20b759(0x1da)]){const _0x3e84b4=_0x43607d[_0x20b759(0x1da)][_0x20b759(0x19d)]();_0x100c6e=_0x100c6e['filter'](_0xfdc501=>_0xfdc501[_0x20b759(0x16f)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4)||_0xfdc501[_0x20b759(0x20a)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4));}return _0x100c6e;}export async function getBffScriptInfo(_0x3bebc0){const _0x2244b4=a158_0x2ac6,_0x5f47c2=await apiRequest(_0x2244b4(0x1f1)+_0x3bebc0);if(!_0x5f47c2[_0x2244b4(0x176)])throw CliErrors[_0x2244b4(0x170)]('BFF\x20script\x20not\x20found:\x20id='+_0x3bebc0);return _0x5f47c2[_0x2244b4(0x176)];}export async function saveBffScript(_0x5f1639){const _0x3f96fc=a158_0x2ac6,_0x17b28a=await apiRequest(_0x3f96fc(0x1db),{'method':'POST','body':_0x5f1639}),{id:_0x43aa73,entity:_0x37b686}=normalizeEntityWithIdResponse(_0x17b28a['data']);if(_0x43aa73!==undefined){const _0x4e6d69=typeof _0x37b686[_0x3f96fc(0x16f)]===_0x3f96fc(0x1cb)||typeof _0x37b686[_0x3f96fc(0x1b8)]===_0x3f96fc(0x1cb)?_0x37b686:undefined;return{'id':_0x43aa73,'script':_0x4e6d69};}throw CliErrors[_0x3f96fc(0x199)](_0x3f96fc(0x1a2));}export async function deleteBffScript(_0x444aed){const _0x2200ff=a158_0x2ac6;await apiRequest(_0x2200ff(0x1ed),{'method':_0x2200ff(0x20d),'body':{'id':_0x444aed}});}export async function getBffScriptStatistics(_0x1b49d3){const _0x503886=a158_0x2ac6,_0x4e583a=await apiRequest(_0x503886(0x1c2)+_0x1b49d3);return extractList(_0x4e583a['data']);}export async function clearBffScriptCache(){const _0x43d948=a158_0x2ac6,_0x5c2f07=await apiRequest(_0x43d948(0x15d),{'method':_0x43d948(0x20d),'useRuntime':!![]});return typeof _0x5c2f07['data']===_0x43d948(0x1cb)?_0x5c2f07[_0x43d948(0x176)]:'';}export async function listBffDatasetOperations(_0x9f1544,_0xfbfb){const _0x4a4584=a158_0x2ac6,_0x5b6af3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x4a4584(0x20d),'body':{'appCode':_0x9f1544,'datasetId':_0xfbfb}});return _0x5b6af3['data'];}export async function listSqlQueries(_0x404fb6,_0xaf02c8){const _0x5bc871=a158_0x2ac6,_0x15126e=await apiRequest(_0x5bc871(0x209),{'method':_0x5bc871(0x20d),'body':{'appCode':_0x404fb6,'currentPage':_0xaf02c8?.[_0x5bc871(0x203)]??0x1,'pageSize':_0xaf02c8?.[_0x5bc871(0x164)]??0x32,'sqlCode':_0xaf02c8?.[_0x5bc871(0x196)],'sqlName':_0xaf02c8?.['sqlName']}});return _0x15126e[_0x5bc871(0x176)];}export async function getSqlQueryInfo(_0x436588,_0x2f77e6){const _0x8a880d=await listSqlQueries(_0x436588,{'sqlCode':_0x2f77e6}),_0x5be467=_0x8a880d['tableData']?.[0x0];if(!_0x5be467)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x2f77e6);return _0x5be467;}export async function getSqlQueryDetail(_0x1cce45){const _0x217953=a158_0x2ac6,_0x5811ac=await apiRequest(_0x217953(0x1ab)+(_0x217953(0x1d6)+encodeURIComponent(_0x1cce45)));if(!_0x5811ac['data'])throw CliErrors['validation'](_0x217953(0x1df)+_0x1cce45);return _0x5811ac['data'];}export async function getSqlQueryDetailById(_0x32a3f3){const _0x142c21=a158_0x2ac6,_0x9444ab=await apiRequest(_0x142c21(0x1b5)+_0x32a3f3);if(!_0x9444ab['data'])throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20id='+_0x32a3f3);return _0x9444ab['data'];}export async function createSqlQuery(_0x5e2f29){const _0x402159=a158_0x2ac6,_0x17a71c=await apiRequest(_0x402159(0x1f9),{'method':_0x402159(0x20d),'body':_0x5e2f29}),{id:_0x2e2961,entity:_0x3c2b3e}=normalizeEntityWithIdResponse(_0x17a71c[_0x402159(0x176)]);if(!('sqlCode'in _0x3c2b3e)&&_0x2e2961)return getSqlQueryDetailById(_0x2e2961);return normalizeSqlQueryEntity(_0x3c2b3e);}export async function updateSqlQuery(_0x2467bd){const _0x4da778=a158_0x2ac6,_0x531ce8=await apiRequest(_0x4da778(0x1e0),{'method':'POST','body':_0x2467bd}),{id:_0x42d4a1,entity:_0xd4dc2e}=normalizeEntityWithIdResponse(_0x531ce8[_0x4da778(0x176)]);if(!(_0x4da778(0x196)in _0xd4dc2e)){if(_0x2467bd[_0x4da778(0x196)])return getSqlQueryDetail(_0x2467bd[_0x4da778(0x196)]);if(_0x42d4a1)return getSqlQueryDetailById(_0x42d4a1);}return normalizeSqlQueryEntity(_0xd4dc2e);}export async function deleteSqlQuery(_0x5206cb){const _0xb76106=a158_0x2ac6;await apiRequest(_0xb76106(0x161),{'method':_0xb76106(0x20d),'body':_0x5206cb});}export async function saveSqlQuery(_0x4bdad5){const _0x2c974b=a158_0x2ac6,_0x418ad5=await apiRequest(_0x2c974b(0x17b),{'method':'POST','body':_0x4bdad5});return _0x418ad5['data'];}function normalizeSqlQueryEntity(_0x5c9aec){const _0x3e0b27=a158_0x2ac6;return{..._0x5c9aec,'id':Number(_0x5c9aec['id']),'dbId':_0x5c9aec['dbId']==null?undefined:Number(_0x5c9aec['dbId']),'version':_0x5c9aec['version']==null?undefined:Number(_0x5c9aec[_0x3e0b27(0x1b1)])};}export async function executeSql(_0x5d5a33,_0x114d01,_0xe08f2c){const _0x410cdc=a158_0x2ac6,_0x32fb0c=await apiRequest(_0x410cdc(0x1a7),{'method':'POST','body':{'appCode':_0x5d5a33,'sqlCode':_0x114d01,..._0xe08f2c&&{'params':_0xe08f2c}},'useRuntime':!![]});return _0x32fb0c[_0x410cdc(0x176)];}export async function executeDatasetDataOperation(_0x1a0f74,_0x5ce6e6,_0x6cd2ce,_0x5264ca={}){const _0x336fd8=a158_0x2ac6;try{const _0x585639=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+'/'+_0x6cd2ce,{'method':_0x336fd8(0x20d),'body':_0x5264ca,'useRuntime':!![]});return _0x585639[_0x336fd8(0x176)];}catch(_0x3ba6f0){if(_0x6cd2ce===_0x336fd8(0x1ec)&&_0x3ba6f0 instanceof CliError&&_0x3ba6f0[_0x336fd8(0x207)]===_0x336fd8(0x18f)&&_0x5264ca['id']!==undefined&&_0x5264ca['id']!==null&&_0x5264ca['id']!==''){const _0x1528f2=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+_0x336fd8(0x1a8),{'method':'POST','body':{'where':{'id':{'$eq':_0x5264ca['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x10cd2c=Array[_0x336fd8(0x187)](_0x1528f2[_0x336fd8(0x176)]?.[_0x336fd8(0x179)])?_0x1528f2[_0x336fd8(0x176)][_0x336fd8(0x179)]:[];return _0x10cd2c[0x0]??null;}throw _0x3ba6f0;}}export async function listDatasets(_0x55cafc,_0x402bdb){const _0xa71644=a158_0x2ac6,_0x2b234c={'appCode':_0x55cafc,'deleted':_0x402bdb?.[_0xa71644(0x1e5)]??![]};if(_0x402bdb?.[_0xa71644(0x207)])_0x2b234c[_0xa71644(0x207)]=_0x402bdb[_0xa71644(0x207)];if(_0x402bdb?.[_0xa71644(0x1c0)])_0x2b234c[_0xa71644(0x1c0)]=_0x402bdb['name'];const _0x15348b=await apiRequest(_0xa71644(0x1b0),{'method':_0xa71644(0x20d),'body':_0x2b234c});return extractList(_0x15348b[_0xa71644(0x176)]);}export async function deleteDataset(_0x201375,_0x4ba44c){await apiRequest('/smartapi/dataset/delete-dataset',{'method':'POST','body':{'appCode':_0x201375,'datasetId':_0x4ba44c}});}export async function restoreDataset(_0x5e2336,_0x5e6279){const _0x8123ad=a158_0x2ac6;await apiRequest(_0x8123ad(0x1b2),{'method':_0x8123ad(0x20d),'body':{'appCode':_0x5e2336,'datasetId':_0x5e6279}});}export async function previewTextGeneratedDataset(_0x1ccbf2,_0x3b79ff){const _0x13a95e=a158_0x2ac6,_0x47f7fb=await apiRequest(_0x13a95e(0x193),{'method':_0x13a95e(0x20d),'body':{'appCode':_0x1ccbf2,'datasetName':_0x3b79ff[_0x13a95e(0x19c)],'requirementDescription':_0x3b79ff[_0x13a95e(0x1e8)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x47f7fb['data'];}export async function startTextGeneratedDataset(_0x21f3aa,_0x3afda3,_0x4621aa){const _0x1c05bb=a158_0x2ac6,_0x5e8fb2=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0x1c05bb(0x20d),'body':{'appCode':_0x21f3aa,..._0x4621aa?.['clientOperationId']?{'clientOperationId':_0x4621aa[_0x1c05bb(0x1c5)]}:{},'design':_0x3afda3},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5e8fb2[_0x1c05bb(0x176)];}export async function getTextGeneratedDatasetStatus(_0x2f9b07,_0x5942b4){const _0x43151d=a158_0x2ac6,_0x1d680e=new URLSearchParams({'appCode':_0x2f9b07});_0x5942b4[_0x43151d(0x171)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x171),_0x5942b4[_0x43151d(0x171)]);_0x5942b4[_0x43151d(0x1c5)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x1c5),_0x5942b4['clientOperationId']);const _0x32915e=await apiRequest(_0x43151d(0x208)+_0x1d680e[_0x43151d(0x1b6)]());return _0x32915e[_0x43151d(0x176)];}export async function searchDatasets(_0x4e8305,_0x399334){const _0x45a2b5=a158_0x2ac6,_0xe648c=await listDatasets(_0x4e8305,{'name':_0x399334}),_0x115b4e=_0x399334[_0x45a2b5(0x19d)](),_0x2d7990=new Set(_0xe648c[_0x45a2b5(0x186)](_0x3ce7aa=>_0x3ce7aa['id'])),_0x1c2831=_0xe648c[_0x45a2b5(0x1f0)](_0x5da7a2=>_0x5da7a2['dbtableConfig']?.['tableName']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)||_0x5da7a2['description']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)),_0x275159=await listDatasets(_0x4e8305,{'code':_0x399334});for(const _0x436b53 of _0x275159){!_0x2d7990[_0x45a2b5(0x183)](_0x436b53['id'])&&(_0xe648c[_0x45a2b5(0x185)](_0x436b53),_0x2d7990[_0x45a2b5(0x20c)](_0x436b53['id']));}return _0xe648c;}export function normalizeDatasetOperations(_0x3748e6){const _0x5c266f=a158_0x2ac6;if(Array[_0x5c266f(0x187)](_0x3748e6))return _0x3748e6[_0x5c266f(0x1f0)](_0x55bbe1=>_0x55bbe1!=null&&typeof _0x55bbe1===_0x5c266f(0x188));if(_0x3748e6&&typeof _0x3748e6===_0x5c266f(0x188))return Object[_0x5c266f(0x1fd)](_0x3748e6)['filter'](([,_0x572ab5])=>_0x572ab5!=null&&typeof _0x572ab5===_0x5c266f(0x188))[_0x5c266f(0x186)](([_0x284ab3,_0x1df8d6])=>({..._0x1df8d6,'name':_0x1df8d6[_0x5c266f(0x1c0)]??_0x1df8d6[_0x5c266f(0x18c)]??_0x284ab3}));return[];}export async function getDatasetDetail(_0xc19e4c){const _0xf1d975=/^\d+$/['test'](_0xc19e4c)?'id':'code',_0x4d5f18=await apiRequest('/smartapi/dataset/get-driven-data?'+_0xf1d975+'='+_0xc19e4c);return _0x4d5f18['data'];}export async function updateDrivenData(_0xc01d38){const _0x2a5620=a158_0x2ac6,_0xa975c1=await apiRequest(_0x2a5620(0x17e),{'method':_0x2a5620(0x20d),'body':_0xc01d38});return _0xa975c1[_0x2a5620(0x176)];}export async function getDatasetOperations(_0x43e356){const _0xf4b705=a158_0x2ac6,_0x8bd226=await getDatasetDetail(_0x43e356),_0x160aa7=normalizeDatasetOperations(_0x8bd226['operations'])[_0xf4b705(0x186)](_0x134bd6=>({'name':_0x134bd6[_0xf4b705(0x1c0)]||_0x134bd6[_0xf4b705(0x18c)],'displayName':_0x134bd6[_0xf4b705(0x192)]||_0x134bd6[_0xf4b705(0x1c0)],'type':_0x134bd6[_0xf4b705(0x1cf)],'method':_0x134bd6['method'],'path':_0x134bd6['path'],'enabled':_0x134bd6[_0xf4b705(0x1f5)]??!![],'requestFields':_0x134bd6['requestFields'],'responseFields':_0x134bd6[_0xf4b705(0x1f8)]}));return{'dataset':{'id':_0x8bd226['id']??_0x8bd226[_0xf4b705(0x1a4)],'name':_0x8bd226[_0xf4b705(0x1c0)],'code':_0x8bd226[_0xf4b705(0x207)]||_0x8bd226[_0xf4b705(0x175)],'tableName':_0x8bd226[_0xf4b705(0x1b4)]||_0x8bd226[_0xf4b705(0x1fe)]?.['tableName']},'operations':_0x160aa7};}export async function getOperationDetail(_0xcbf196,_0x58f441,_0x52f855){const _0x34512a=a158_0x2ac6;let _0x47a78f=_0x58f441;if(!/^\d+$/['test'](_0x58f441)){const _0x4ba719=await listDatasets(_0xcbf196,{'code':_0x58f441}),_0x21a3ac=_0x4ba719[_0x34512a(0x1f3)](_0x4887bd=>_0x4887bd[_0x34512a(0x207)]===_0x58f441||String(_0x4887bd['id'])===_0x58f441);if(!_0x21a3ac)throw CliErrors[_0x34512a(0x170)](_0x34512a(0x18a)+_0x58f441);_0x47a78f=String(_0x21a3ac['id']);}const _0x352fd4=await getDatasetDetail(_0x47a78f),_0x3be59a=normalizeDatasetOperations(_0x352fd4[_0x34512a(0x173)])[_0x34512a(0x1f3)](_0x420bb7=>(_0x420bb7[_0x34512a(0x1c0)]||_0x420bb7[_0x34512a(0x18c)])===_0x52f855);if(!_0x3be59a)throw CliErrors[_0x34512a(0x170)]('Operation\x20\x22'+_0x52f855+_0x34512a(0x1b7)+_0x58f441);return{'dataset':{'id':_0x352fd4['id']??_0x352fd4[_0x34512a(0x1a4)],'name':_0x352fd4[_0x34512a(0x1c0)],'code':_0x352fd4['code']||_0x352fd4[_0x34512a(0x175)],'tableName':_0x352fd4[_0x34512a(0x1b4)]||_0x352fd4['dbtableConfig']?.[_0x34512a(0x1b4)]},'operation':_0x3be59a};}export async function startGenerateStandardPages(_0x206987,_0xd38cc5,_0x5c035f){const _0x1c2e69=a158_0x2ac6,_0x4c5c3b=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd38cc5+_0x1c2e69(0x15e),{'method':_0x1c2e69(0x20d),'body':{'appCode':_0x206987,..._0x5c035f?.[_0x1c2e69(0x1c5)]?{'clientOperationId':_0x5c035f[_0x1c2e69(0x1c5)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4c5c3b[_0x1c2e69(0x176)];}export async function getGenerateStandardPagesStatus(_0x46d703,_0x3d7dcc,_0x519ccc){const _0x5b3ce0=a158_0x2ac6,_0x1fdccb=new URLSearchParams({'appCode':_0x46d703});_0x519ccc['operationId']&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x171),_0x519ccc[_0x5b3ce0(0x171)]);_0x519ccc[_0x5b3ce0(0x1c5)]&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x1c5),_0x519ccc[_0x5b3ce0(0x1c5)]);const _0x4af11a=await apiRequest(_0x5b3ce0(0x166)+_0x3d7dcc+'/generate-standard-pages/status?'+_0x1fdccb['toString']());return _0x4af11a[_0x5b3ce0(0x176)];}export async function getStandardPageStatus(_0x24b9c6,_0x5b31dc){const _0x15c71d=a158_0x2ac6,_0x5cbd63=await apiRequest(_0x15c71d(0x166)+_0x5b31dc+_0x15c71d(0x1f4)+encodeURIComponent(_0x24b9c6));return _0x5cbd63['data'];}export async function tryGetStandardPageStatus(_0x2f221d,_0x476d19){const _0x1777e8=a158_0x2ac6;try{return await getStandardPageStatus(_0x2f221d,_0x476d19);}catch(_0x22b948){if(_0x22b948 instanceof CliError&&_0x22b948['code']===_0x1777e8(0x18f)&&/404|not found|non-json response/i['test'](_0x22b948[_0x1777e8(0x1b9)]))return null;throw _0x22b948;}}export async function syncStandardPages(_0xa79eaa,_0x246d80){const _0x2ed160=a158_0x2ac6,_0x4fb293=await apiRequest('/smartapi/lovrabet/dataset/'+_0x246d80+_0x2ed160(0x16b),{'method':_0x2ed160(0x20d),'body':{'appCode':_0xa79eaa}});return _0x4fb293['data'];}export async function getPageDetail(_0x1c24e2){const _0x56ba70=a158_0x2ac6,_0x43dfb1=await apiRequest(_0x56ba70(0x1c6)+_0x1c24e2);if(!_0x43dfb1[_0x56ba70(0x176)])throw CliErrors[_0x56ba70(0x170)](_0x56ba70(0x1cd)+_0x1c24e2);return _0x43dfb1['data'];}export async function updatePage(_0x17e0bc,_0x162f4a,_0x19ebcd,_0x1da360){const _0xe258cd=a158_0x2ac6,_0x54524e=await apiRequest(_0xe258cd(0x1ca),{'method':_0xe258cd(0x20d),'body':{'appCode':_0x17e0bc,'pageId':_0x162f4a,'code':_0x19ebcd,'datasetIds':_0x1da360}});return _0x54524e['data'];}export function generateSdkCode(_0x30606b,_0x52bc4c,_0x1ba917){const _0x1a9ef3=a158_0x2ac6,_0x9eeb55=_0x1ba917?.[_0x1a9ef3(0x1fc)]??!![],_0x1c8d41='dataset_'+_0x30606b['code']?.[_0x1a9ef3(0x19e)](/-/g,'_'),_0x1c13b0=_0x52bc4c[_0x1a9ef3(0x1c0)]||_0x52bc4c['operationName']||_0x1a9ef3(0x1f0),_0x465e6c=[];_0x9eeb55&&_0x465e6c['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1a9ef3(0x1e4),'');_0x465e6c['push']('//\x20'+_0x30606b['name']+'\x20('+(_0x30606b[_0x1a9ef3(0x1b4)]||_0x1a9ef3(0x191))+')');if(_0x1c13b0===_0x1a9ef3(0x1f0))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.filter({','\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x1a9ef3(0x1f2),_0x1a9ef3(0x206));else{if(_0x1c13b0===_0x1a9ef3(0x1ec))_0x465e6c[_0x1a9ef3(0x185)]('const\x20result\x20=\x20await\x20client.models.'+_0x1c8d41+'.getOne(id);');else{if(_0x1c13b0===_0x1a9ef3(0x1e7))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1d5));else{if(_0x1c13b0===_0x1a9ef3(0x180))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x17a));else _0x1c13b0===_0x1a9ef3(0x15c)||_0x1c13b0===_0x1a9ef3(0x162)?_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1c1)):_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.'+_0x1c13b0+_0x1a9ef3(0x18d));}}}return _0x465e6c[_0x1a9ef3(0x197)]('\x0a');}export function generateSqlCodeTemplate(_0x1ab6b8,_0x58fc89){const _0x319b52=a158_0x2ac6,_0x8e224a=_0x58fc89?.[_0x319b52(0x1a1)]??_0x319b52(0x172),_0x5578f4=_0x58fc89?.[_0x319b52(0x1fc)]??!![],_0x279d67=[];return _0x279d67[_0x319b52(0x185)](_0x319b52(0x1dc)+_0x1ab6b8[_0x319b52(0x202)]+'\x20('+_0x1ab6b8[_0x319b52(0x196)]+')'),_0x8e224a===_0x319b52(0x172)?(_0x5578f4&&_0x279d67[_0x319b52(0x185)](_0x319b52(0x1d4),'',_0x319b52(0x1e4),''),_0x279d67[_0x319b52(0x185)](_0x319b52(0x19f),_0x319b52(0x1ac)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e9),_0x319b52(0x206),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x319b52(0x1ef))):_0x279d67[_0x319b52(0x185)](_0x319b52(0x205),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x319b52(0x1e2)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e6),_0x319b52(0x1ad),_0x319b52(0x1c3),'}'),_0x279d67[_0x319b52(0x197)]('\x0a');}export async function getErConfig(_0x2fb5f1,_0xf868d8){const _0x5571ba=a158_0x2ac6,_0x436eee=await apiRequest(_0x5571ba(0x1bd),{'method':_0x5571ba(0x20d),'body':{'appCode':_0x2fb5f1,'dblinkId':_0xf868d8},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x436eee[_0x5571ba(0x176)];}export async function createErRelation(_0x319523){const _0x794912=a158_0x2ac6,_0x15f434=await apiRequest(_0x794912(0x1bf),{'method':_0x794912(0x20d),'body':_0x319523,'allowNonJsonSuccess':!![]});return _0x15f434[_0x794912(0x176)];}function a158_0x2ac6(_0x11a3c1,_0x3aa6b4){_0x11a3c1=_0x11a3c1-0x15c;const _0x47d1b4=a158_0x47d1();let _0x2ac6dd=_0x47d1b4[_0x11a3c1];return _0x2ac6dd;}export async function updateErRelation(_0x386ccd){const _0x26adbc=a158_0x2ac6,_0x349f2f=await apiRequest(_0x26adbc(0x1a5),{'method':_0x26adbc(0x20d),'body':_0x386ccd,'allowNonJsonSuccess':!![]});return _0x349f2f[_0x26adbc(0x176)];}export async function deleteErRelation(_0x4d22d3){const _0x1b911a=a158_0x2ac6,_0x4cb744=await apiRequest(_0x1b911a(0x20f),{'method':_0x1b911a(0x20d),'body':_0x4d22d3,'allowNonJsonSuccess':!![]});return _0x4cb744[_0x1b911a(0x176)];}export async function updateErBusinessGroup(_0x269ee7){const _0x1e8fde=a158_0x2ac6,_0x5e73d0=await apiRequest(_0x1e8fde(0x1ba),{'method':_0x1e8fde(0x20d),'body':_0x269ee7,'allowNonJsonSuccess':!![]});return _0x5e73d0[_0x1e8fde(0x176)];}function buildQuery(_0x4a76d8){const _0xc6f23c=a158_0x2ac6,_0x2bb9ad=new URLSearchParams();for(const [_0x23e4b7,_0x1f4730]of Object['entries'](_0x4a76d8)){if(_0x1f4730===undefined||_0x1f4730==='')continue;_0x2bb9ad['set'](_0x23e4b7,String(_0x1f4730));}const _0x49992a=_0x2bb9ad[_0xc6f23c(0x1b6)]();return _0x49992a?'?'+_0x49992a:'';}export async function listAppConfigs(_0x44857f,_0x4708c3){const _0x18a370=a158_0x2ac6,_0x181202=await apiRequest(_0x18a370(0x1af),{'method':'POST','body':{'appCode':_0x44857f,..._0x4708c3?.[_0x18a370(0x1be)]?{'key':_0x4708c3[_0x18a370(0x1be)]}:{},..._0x4708c3?.[_0x18a370(0x184)]?{'tags':_0x4708c3[_0x18a370(0x184)]}:{}}});return extractAppConfigList(_0x181202[_0x18a370(0x176)]);}export async function getAppConfigByKey(_0x2b2c2b,_0x47f279){const _0x155501=a158_0x2ac6,_0x263d96=await apiRequest(_0x155501(0x1b3)+buildQuery({'appCode':_0x2b2c2b,'key':_0x47f279}));return _0x263d96[_0x155501(0x176)]??null;}export async function createAppConfig(_0x45261f){const _0x283ceb=a158_0x2ac6,_0x5eac3b=await apiRequest(_0x283ceb(0x1e3),{'method':'POST','body':{'appCode':_0x45261f[_0x283ceb(0x178)],'key':_0x45261f[_0x283ceb(0x1be)],'value':_0x45261f[_0x283ceb(0x16c)],..._0x45261f['tags']?{'tags':_0x45261f[_0x283ceb(0x184)]}:{}}});return _0x5eac3b['data'];}export async function updateAppConfig(_0x50ca4c){const _0x320bd0=a158_0x2ac6;await apiRequest(_0x320bd0(0x20e),{'method':_0x320bd0(0x20d),'body':{'id':_0x50ca4c['id'],'appCode':_0x50ca4c[_0x320bd0(0x178)],'key':_0x50ca4c[_0x320bd0(0x1be)],'value':_0x50ca4c[_0x320bd0(0x16c)],..._0x50ca4c[_0x320bd0(0x184)]?{'tags':_0x50ca4c[_0x320bd0(0x184)]}:{}}});}export async function deleteAppConfig(_0x229330){const _0x4ef98d=a158_0x2ac6;await apiRequest(_0x4ef98d(0x169),{'method':_0x4ef98d(0x20d),'body':_0x229330});}function extractAppConfigList(_0x45d6a1){const _0x1c466b=a158_0x2ac6;if(Array[_0x1c466b(0x187)](_0x45d6a1))return _0x45d6a1;if(_0x45d6a1&&typeof _0x45d6a1==='object'&&Array[_0x1c466b(0x187)](_0x45d6a1['list']))return _0x45d6a1[_0x1c466b(0x163)];return extractList(_0x45d6a1);}export async function listDbLinks(_0x421c0c,_0x1e24ac){const _0x243f70=a158_0x2ac6,_0x5da423=await apiRequest(_0x243f70(0x194),{'method':_0x243f70(0x20d),'body':{'appCode':_0x421c0c,'currentPage':_0x1e24ac?.[_0x243f70(0x203)]??0x1,'pageSize':_0x1e24ac?.[_0x243f70(0x164)]??0x64}});return{'items':extractList(_0x5da423[_0x243f70(0x176)]),'paging':extractPaging(_0x5da423['data'])};}export async function getDbLinkInfo(_0x2e50ee){const _0x241899=a158_0x2ac6,_0x4e892a=await apiRequest(_0x241899(0x15f)+buildQuery({'id':_0x2e50ee}));return _0x4e892a['data'];}export async function createDbLink(_0x306418){const _0x28d1e4=a158_0x2ac6,_0x2bb899=await apiRequest(_0x28d1e4(0x200),{'method':_0x28d1e4(0x20d),'body':_0x306418});return _0x2bb899[_0x28d1e4(0x176)];}export async function updateDbLink(_0x5cf36d){const _0x5b8a84=a158_0x2ac6,_0x5e70f1=await apiRequest(_0x5b8a84(0x1f7),{'method':'POST','body':_0x5cf36d});return _0x5e70f1['data'];}export async function deleteDbLink(_0x5029c7){const _0x2062c5=a158_0x2ac6;await apiRequest(_0x2062c5(0x182),{'method':_0x2062c5(0x20d),'body':{'id':_0x5029c7}});}export async function testDbLinkConnect(_0x1c7d2d){const _0x2b19f7=a158_0x2ac6,_0x1942e9=await apiRequest(_0x2b19f7(0x17f)+buildQuery({'id':_0x1c7d2d}));return _0x1942e9[_0x2b19f7(0x176)];}export async function startDbAnalysis(_0x117834,_0x1b4d8b){const _0x2003ce=a158_0x2ac6,_0x3d4d27=await apiRequest('/smartapi/db-analysis/start',{'method':_0x2003ce(0x20d),'body':{'dbLinkId':_0x117834,..._0x1b4d8b&&_0x1b4d8b[_0x2003ce(0x1bc)]>0x0?{'tableNames':_0x1b4d8b}:{}}}),_0x38a5b0=_0x3d4d27[_0x2003ce(0x176)];if(typeof _0x38a5b0===_0x2003ce(0x1cb))return _0x38a5b0;if(_0x38a5b0&&typeof _0x38a5b0===_0x2003ce(0x188)&&typeof _0x38a5b0[_0x2003ce(0x167)]===_0x2003ce(0x1cb))return _0x38a5b0[_0x2003ce(0x167)];return _0x38a5b0!=null?String(_0x38a5b0):'';}export async function cancelDbAnalysis(_0xb218d){const _0x560b22=a158_0x2ac6;await apiRequest(_0x560b22(0x204)+buildQuery({'planId':_0xb218d}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x3c5d91){const _0x3ebaf6=a158_0x2ac6,_0x29794b=await apiRequest(_0x3ebaf6(0x1d2)+encodeURIComponent(_0x3c5d91));return _0x29794b[_0x3ebaf6(0x176)];}export async function getDbAllTableList(_0xe354ae,_0x5edd3b){const _0x373b20=a158_0x2ac6,_0x4522db=await apiRequest(_0x373b20(0x168)+buildQuery({'appCode':_0xe354ae,'dbLinkId':_0x5edd3b})),_0x3a6330=_0x4522db[_0x373b20(0x176)];if(Array[_0x373b20(0x187)](_0x3a6330))return _0x3a6330;return extractList(_0x3a6330);}export async function getDbTableDiff(_0x53ab2d,_0x134bb5,_0x20ed43){const _0x4d15e=a158_0x2ac6,_0x3597f3=await apiRequest(_0x4d15e(0x189)+buildQuery({'appCode':_0x53ab2d,'dbLinkId':_0x134bb5,'pageIndex':_0x20ed43?.['pageIndex']??0x1,'pageSize':_0x20ed43?.[_0x4d15e(0x164)]??0x14,'tableName':_0x20ed43?.[_0x4d15e(0x1b4)]})),_0x541666=_0x3597f3[_0x4d15e(0x176)];return{'totalCount':_0x541666?.[_0x4d15e(0x165)]??0x0,'physicalTableCount':_0x541666?.['physicalTableCount']??0x0,'datasetTableCount':_0x541666?.['datasetTableCount']??0x0,..._0x541666?.[_0x4d15e(0x18e)]?{'summary':_0x541666['summary']}:{},'tableList':Array[_0x4d15e(0x187)](_0x541666?.['tableList'])?_0x541666['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x241c58=a158_0x2ac6,_0x5d6a86=await apiRequest(_0x241c58(0x1dd),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x196df6=extractList(_0x5d6a86[_0x241c58(0x176)]),_0x55ea50=extractPaging(_0x5d6a86[_0x241c58(0x176)]);return _0x55ea50&&_0x55ea50[_0x241c58(0x165)]>REMOTE_APP_PAGE_SIZE&&console[_0x241c58(0x1aa)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x55ea50[_0x241c58(0x165)]+_0x241c58(0x1a3)+_0x241c58(0x1c4)),_0x196df6;}
1
+ (function(_0x28373c,_0x31fd83){const _0x2749d5=a158_0x5e70,_0x33361b=_0x28373c();while(!![]){try{const _0x4c49b2=parseInt(_0x2749d5(0x222))/0x1+parseInt(_0x2749d5(0x1b4))/0x2+-parseInt(_0x2749d5(0x1b5))/0x3*(parseInt(_0x2749d5(0x1dc))/0x4)+parseInt(_0x2749d5(0x1b3))/0x5+parseInt(_0x2749d5(0x1ea))/0x6*(parseInt(_0x2749d5(0x1bb))/0x7)+-parseInt(_0x2749d5(0x20a))/0x8+-parseInt(_0x2749d5(0x1d0))/0x9;if(_0x4c49b2===_0x31fd83)break;else _0x33361b['push'](_0x33361b['shift']());}catch(_0x178fbd){_0x33361b['push'](_0x33361b['shift']());}}}(a158_0x4b98,0xcf8fe));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;function a158_0x4b98(){const _0x2de777=['/smartapi/dataset/get-dataset-list','dbId','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','remove','164ZeQmKR','401','tableList','/smartapi/question/er-config/cli/update-single','/smartapi/dataset/text-generate/preview','entries','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','operations','BFF\x20script\x20not\x20found:\x20id=','type','\x20\x20return\x20rows;','/smartapi/custom/getUserCustomSql?id=','&type=','dataset_','6wyroku','AbortError','API\x20error\x20code:\x20','/api/management/library/scripts/save','code','has','const\x20result\x20=\x20await\x20client.models.','abort','/sync-to-pages','toString','/smartapi/question/er-config/business-group/edit','/smartapi/db-analysis/start','pageIndex','/smartapi/lovrabet/detail?pageId=','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','test','physicalTableCount','deleted','sdk','/smartapi/dblink/create','/smartapi/dblink/getList','object','POST','table','map','\x20apps.\x20','enabled','//\x20SQL:\x20','description','version','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','find','12603520dNzrfg','pageSize','message','modelCode','/smartapi/lovrabet/dataset/','/smartapi/custom/getUserCustomSql','\x20\x20pageSize:\x2020,','join','\x20\x20where:\x20{},','/smartapi/app-config/delete','Page\x20not\x20found:\x20','/smartapi/dataset/get-dataset-operation','Warning:\x20showing\x20first\x20','tableData','includeImports','stringify','/api/management/library/scripts/delete','/smartapi/custom/saveUserCustomSql','filter','authRequired','dbtableConfig','/filter','/smartapi/dataset/text-generate/start','method','630139KiHffO','/smartapi/app/getList','list','apiError','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','update','\x20\x20sqlCode:\x20\x27','requirementDescription','/smartapi/dataset/update-driven-data','string','/api/','/api/management/library/scripts/statistics?appCode=','tableName','value','label','/smartapi/dblink/delete','clientOperationId','summary','});','target','/smartapi/dblink/getOne','Unauthorized','operationName','sqlCode','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/db-analysis/jobs/cancel','.getOne(id);','validation','functionName','warn','planId','body','set','application/json','json','sqlName','\x20failed','const\x20results\x20=\x20data.execResult\x20||\x20[];','push','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','operationId','name','/generate-standard-pages/status?','API\x20error:\x20','scriptType','scriptName','errorMessage','cli:rabetbase','/smartapi/dblink/update','/smartapi/custom/updateUserCustomSql','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','datasetTableCount','\x20of\x20','errorCode','key','?sqlCode=','/smartapi/question/er-config/cli/delete-single','cookie','currentPage','/smartapi/dblink/testConnect','7999965dTfPHe','726220BtZtRR','5637ByFdKa','/smartapi/custom/queryUserCustomSqlList','/smartapi/app-config/create','SQL\x20query\x20not\x20found:\x20id=','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','getOne','971341MrBQEw','/smartapi/dataset/delete-dataset','modelId','success','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dataset/restore-dataset','/standard-page-status?appCode=','api_error','/smartapi/lovrabet/update-page','Dataset\x20not\x20found:\x20','Request\x20timeout:\x20','add','errorMsg','GET','includes','\x20\x20});','status','tags','toLowerCase','isArray','replace','2064168DIrobf','totalCount','const\x20data\x20=\x20await\x20client.sql.execute({','UNAUTHORIZED','data','path','/api/node-toolbox/sql/save','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly'];a158_0x4b98=function(){return _0x2de777;};return a158_0x4b98();}export function setActiveCookie(_0x10886c){_activeCookie=_0x10886c||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x5247e6,_0x46fcf9){const _0x4f62ca=a158_0x5e70,_0x36d805=_0x46fcf9 instanceof Error?_0x46fcf9['message']:String(_0x46fcf9);return CliErrors[_0x4f62ca(0x225)]('Request\x20failed:\x20'+_0x5247e6+(_0x36d805?'\x20('+_0x36d805+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x196b9b,_0x1d5832={}){const _0x40f6a6=a158_0x5e70,{method:method='GET',body:_0xc2ab4a,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x1d5832,_0x13538a=useRuntime?getRuntimeDomain():getApiDomain(),_0x3e44b4=_activeCookie||getCookie(),_0x29bf02=''+_0x13538a+_0x196b9b,_0x382477=new AbortController(),_0x59e56e=setTimeout(()=>_0x382477[_0x40f6a6(0x1f1)](),timeout);try{const _0x4c71a9=await fetch(_0x29bf02,{'method':method,'headers':{'Content-Type':_0x40f6a6(0x243),'Cookie':_0x3e44b4,'X-Invoke-Source':_0x40f6a6(0x1a6),...headers},'body':_0xc2ab4a?JSON[_0x40f6a6(0x219)](_0xc2ab4a):undefined,'signal':_0x382477['signal']});let _0x2adbfc;try{_0x2adbfc=await _0x4c71a9[_0x40f6a6(0x244)]();}catch(_0x5bc3e9){if(_0x5bc3e9 instanceof Error&&_0x5bc3e9[_0x40f6a6(0x24b)]===_0x40f6a6(0x1eb))throw CliErrors[_0x40f6a6(0x225)](_0x40f6a6(0x1c5)+_0x29bf02);if(_0x4c71a9['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x40f6a6(0x225)](_0x40f6a6(0x1da)+_0x4c71a9[_0x40f6a6(0x1cb)]+')',_0x4c71a9[_0x40f6a6(0x1cb)]>=0x190?_0x40f6a6(0x23a):undefined);}if(!_0x4c71a9['ok']||_0x2adbfc[_0x40f6a6(0x1be)]===![])throw CliErrors[_0x40f6a6(0x225)](_0x2adbfc[_0x40f6a6(0x1c7)]||_0x2adbfc[_0x40f6a6(0x20c)]||_0x40f6a6(0x1a2)+_0x4c71a9[_0x40f6a6(0x1cb)],_0x2adbfc[_0x40f6a6(0x1ac)]?_0x40f6a6(0x1ec)+_0x2adbfc[_0x40f6a6(0x1ac)]:undefined);return _0x2adbfc;}catch(_0x45d218){if(_0x45d218 instanceof CliError)throw _0x45d218;if(_0x45d218 instanceof Error&&_0x45d218[_0x40f6a6(0x24b)]===_0x40f6a6(0x1eb))throw CliErrors['apiError'](_0x40f6a6(0x1c5)+_0x29bf02);throw createFetchFailureError(_0x29bf02,_0x45d218);}finally{clearTimeout(_0x59e56e);}}function isAuthFailure(_0x38d408){const _0x237f98=a158_0x5e70,_0xfe579=_0x38d408[_0x237f98(0x1c7)]||_0x38d408[_0x237f98(0x20c)]||_0x38d408[_0x237f98(0x1d4)]?.[_0x237f98(0x20c)]||_0x38d408[_0x237f98(0x1a5)]||_0x38d408['error']||'';return _0x38d408[_0x237f98(0x1ac)]===_0x237f98(0x1d3)||_0x38d408[_0x237f98(0x1ee)]===0x191||_0x38d408[_0x237f98(0x1ee)]==='401'||_0xfe579[_0x237f98(0x1c9)](_0x237f98(0x1dd))||_0xfe579['includes'](_0x237f98(0x237))||_0xfe579[_0x237f98(0x1c9)]('登录')||_0xfe579[_0x237f98(0x1c9)]('认证');}export async function platformFetch(_0x1a609a,_0x438d4c){const _0x297186=a158_0x5e70;let _0x28f450;try{_0x28f450=await fetch(_0x1a609a,{'method':_0x438d4c[_0x297186(0x221)]??_0x297186(0x1c8),'headers':{'Content-Type':'application/json','Cookie':_0x438d4c[_0x297186(0x1b0)],'X-Invoke-Source':_0x297186(0x1a6)},..._0x438d4c[_0x297186(0x241)]&&{'body':JSON[_0x297186(0x219)](_0x438d4c[_0x297186(0x241)])}});}catch(_0xe65c48){throw createFetchFailureError(_0x1a609a,_0xe65c48);}if(!_0x28f450['ok']){if(_0x28f450[_0x297186(0x1cb)]===0x191)throw CliErrors[_0x297186(0x21d)]();throw CliErrors[_0x297186(0x225)](_0x438d4c['label']+'\x20failed,\x20HTTP\x20'+_0x28f450[_0x297186(0x1cb)]);}const _0x2d3627=await _0x28f450[_0x297186(0x244)]();if(_0x2d3627[_0x297186(0x1be)]===![]){if(isAuthFailure(_0x2d3627))throw CliErrors['authRequired']();throw CliErrors[_0x297186(0x225)](_0x2d3627['errorMsg']||_0x2d3627['message']||_0x438d4c[_0x297186(0x230)]+_0x297186(0x246));}return _0x2d3627[_0x297186(0x1d4)];}export async function listBffScripts(_0x562db1,_0x219249,_0x175633){const _0x3f02d1=a158_0x5e70;let _0x2789eb='/api/management/library/scripts/list?appCode='+_0x562db1;if(_0x219249)_0x2789eb+=_0x3f02d1(0x1e8)+_0x219249;const _0x20fe4a=await apiRequest(_0x2789eb);let _0x3c03e0=extractList(_0x20fe4a[_0x3f02d1(0x1d4)]);if(_0x175633?.[_0x3f02d1(0x1a4)]){const _0x1cf52e=_0x175633[_0x3f02d1(0x1a4)][_0x3f02d1(0x1cd)]();_0x3c03e0=_0x3c03e0[_0x3f02d1(0x21c)](_0x248e5b=>_0x248e5b[_0x3f02d1(0x23e)]?.[_0x3f02d1(0x1cd)]()[_0x3f02d1(0x1c9)](_0x1cf52e)||_0x248e5b[_0x3f02d1(0x206)]?.[_0x3f02d1(0x1cd)]()[_0x3f02d1(0x1c9)](_0x1cf52e));}return _0x3c03e0;}export async function getBffScriptInfo(_0xa6cdfb){const _0x1f4b87=a158_0x5e70,_0x127b9b=await apiRequest('/api/management/library/scripts/info?id='+_0xa6cdfb);if(!_0x127b9b[_0x1f4b87(0x1d4)])throw CliErrors[_0x1f4b87(0x23d)](_0x1f4b87(0x1e4)+_0xa6cdfb);return _0x127b9b[_0x1f4b87(0x1d4)];}export async function saveBffScript(_0x5cc817){const _0x44d3fe=a158_0x5e70,_0xf34620=await apiRequest(_0x44d3fe(0x1ed),{'method':'POST','body':_0x5cc817}),{id:_0x380d07,entity:_0x58903d}=normalizeEntityWithIdResponse(_0xf34620[_0x44d3fe(0x1d4)]);if(_0x380d07!==undefined){const _0x26669c=typeof _0x58903d[_0x44d3fe(0x23e)]===_0x44d3fe(0x22b)||typeof _0x58903d[_0x44d3fe(0x1a3)]===_0x44d3fe(0x22b)?_0x58903d:undefined;return{'id':_0x380d07,'script':_0x26669c};}throw CliErrors[_0x44d3fe(0x225)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x4d0129){const _0x1f50d8=a158_0x5e70;await apiRequest(_0x1f50d8(0x21a),{'method':_0x1f50d8(0x200),'body':{'id':_0x4d0129}});}export async function getBffScriptStatistics(_0x3694b6){const _0x44861c=a158_0x5e70,_0x1f3ddf=await apiRequest(_0x44861c(0x22d)+_0x3694b6);return extractList(_0x1f3ddf[_0x44861c(0x1d4)]);}export async function clearBffScriptCache(){const _0x2ad66b=a158_0x5e70,_0x4b1dda=await apiRequest('/api/management/script/cache/clear',{'method':_0x2ad66b(0x200),'useRuntime':!![]});return typeof _0x4b1dda[_0x2ad66b(0x1d4)]===_0x2ad66b(0x22b)?_0x4b1dda['data']:'';}export async function listBffDatasetOperations(_0x1d5871,_0x436cc6){const _0x24f081=a158_0x5e70,_0xbe06b9=await apiRequest(_0x24f081(0x215),{'method':'POST','body':{'appCode':_0x1d5871,'datasetId':_0x436cc6}});return _0xbe06b9[_0x24f081(0x1d4)];}export async function listSqlQueries(_0x8c8744,_0x5bfe67){const _0x5f07cb=a158_0x5e70,_0xaac315=await apiRequest(_0x5f07cb(0x1b6),{'method':'POST','body':{'appCode':_0x8c8744,'currentPage':_0x5bfe67?.['currentPage']??0x1,'pageSize':_0x5bfe67?.[_0x5f07cb(0x20b)]??0x32,'sqlCode':_0x5bfe67?.[_0x5f07cb(0x239)],'sqlName':_0x5bfe67?.[_0x5f07cb(0x245)]}});return _0xaac315[_0x5f07cb(0x1d4)];}export async function getSqlQueryInfo(_0x90235e,_0xf9a25f){const _0x4021b8=a158_0x5e70,_0x2e6c0c=await listSqlQueries(_0x90235e,{'sqlCode':_0xf9a25f}),_0x43b3e0=_0x2e6c0c[_0x4021b8(0x217)]?.[0x0];if(!_0x43b3e0)throw CliErrors[_0x4021b8(0x23d)]('SQL\x20query\x20not\x20found:\x20'+_0xf9a25f);return _0x43b3e0;}export async function getSqlQueryDetail(_0xca8dea){const _0x29ae0c=a158_0x5e70,_0x32429b=await apiRequest(_0x29ae0c(0x20f)+(_0x29ae0c(0x1ae)+encodeURIComponent(_0xca8dea)));if(!_0x32429b[_0x29ae0c(0x1d4)])throw CliErrors[_0x29ae0c(0x23d)]('SQL\x20query\x20not\x20found:\x20'+_0xca8dea);return _0x32429b[_0x29ae0c(0x1d4)];}export async function getSqlQueryDetailById(_0x3e8ff2){const _0x19844d=a158_0x5e70,_0x1523d2=await apiRequest(_0x19844d(0x1e7)+_0x3e8ff2);if(!_0x1523d2[_0x19844d(0x1d4)])throw CliErrors['validation'](_0x19844d(0x1b8)+_0x3e8ff2);return _0x1523d2[_0x19844d(0x1d4)];}export async function createSqlQuery(_0x576ef2){const _0x28a40f=a158_0x5e70,_0x456620=await apiRequest(_0x28a40f(0x21b),{'method':_0x28a40f(0x200),'body':_0x576ef2}),{id:_0x1a2f25,entity:_0xecc2d5}=normalizeEntityWithIdResponse(_0x456620[_0x28a40f(0x1d4)]);if(!(_0x28a40f(0x239)in _0xecc2d5)&&_0x1a2f25)return getSqlQueryDetailById(_0x1a2f25);return normalizeSqlQueryEntity(_0xecc2d5);}export async function updateSqlQuery(_0x5168fe){const _0x5dcd42=a158_0x5e70,_0x527a2e=await apiRequest(_0x5dcd42(0x1a8),{'method':_0x5dcd42(0x200),'body':_0x5168fe}),{id:_0x4f8ad2,entity:_0x4b7192}=normalizeEntityWithIdResponse(_0x527a2e[_0x5dcd42(0x1d4)]);if(!(_0x5dcd42(0x239)in _0x4b7192)){if(_0x5168fe[_0x5dcd42(0x239)])return getSqlQueryDetail(_0x5168fe[_0x5dcd42(0x239)]);if(_0x4f8ad2)return getSqlQueryDetailById(_0x4f8ad2);}return normalizeSqlQueryEntity(_0x4b7192);}export async function deleteSqlQuery(_0x42ca93){const _0x190814=a158_0x5e70;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x190814(0x200),'body':_0x42ca93});}export async function saveSqlQuery(_0x1f48c9){const _0x505c17=a158_0x5e70,_0x13c980=await apiRequest(_0x505c17(0x1d6),{'method':'POST','body':_0x1f48c9});return _0x13c980['data'];}function a158_0x5e70(_0x4934c9,_0x53ac68){_0x4934c9=_0x4934c9-0x1a2;const _0x4b9897=a158_0x4b98();let _0x5e70cc=_0x4b9897[_0x4934c9];return _0x5e70cc;}function normalizeSqlQueryEntity(_0x105d7d){const _0x392ff2=a158_0x5e70;return{..._0x105d7d,'id':Number(_0x105d7d['id']),'dbId':_0x105d7d[_0x392ff2(0x1d9)]==null?undefined:Number(_0x105d7d[_0x392ff2(0x1d9)]),'version':_0x105d7d[_0x392ff2(0x207)]==null?undefined:Number(_0x105d7d[_0x392ff2(0x207)])};}export async function executeSql(_0x1642a9,_0x45c9fc,_0x186775){const _0x14055b=a158_0x5e70,_0x2a5f3b=await apiRequest('/api/custom/executeSql',{'method':_0x14055b(0x200),'body':{'appCode':_0x1642a9,'sqlCode':_0x45c9fc,..._0x186775&&{'params':_0x186775}},'useRuntime':!![]});return _0x2a5f3b[_0x14055b(0x1d4)];}export async function executeDatasetDataOperation(_0x12d850,_0xb9d32f,_0x2dbe82,_0x33a47d={}){const _0x52a1e1=a158_0x5e70;try{const _0x42ba72=await apiRequest(_0x52a1e1(0x22c)+_0x12d850+'/'+_0xb9d32f+'/'+_0x2dbe82,{'method':_0x52a1e1(0x200),'body':_0x33a47d,'useRuntime':!![]});return _0x42ba72[_0x52a1e1(0x1d4)];}catch(_0x3b22a7){if(_0x2dbe82===_0x52a1e1(0x1ba)&&_0x3b22a7 instanceof CliError&&_0x3b22a7[_0x52a1e1(0x1ee)]===_0x52a1e1(0x1c2)&&_0x33a47d['id']!==undefined&&_0x33a47d['id']!==null&&_0x33a47d['id']!==''){const _0x44cbbe=await apiRequest(_0x52a1e1(0x22c)+_0x12d850+'/'+_0xb9d32f+_0x52a1e1(0x21f),{'method':_0x52a1e1(0x200),'body':{'where':{'id':{'$eq':_0x33a47d['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0xe4a04a=Array['isArray'](_0x44cbbe[_0x52a1e1(0x1d4)]?.['tableData'])?_0x44cbbe['data'][_0x52a1e1(0x217)]:[];return _0xe4a04a[0x0]??null;}throw _0x3b22a7;}}export async function listDatasets(_0xbf79de,_0x3c07d0){const _0x1765c8=a158_0x5e70,_0x4be27a={'appCode':_0xbf79de,'deleted':_0x3c07d0?.[_0x1765c8(0x1fb)]??![]};if(_0x3c07d0?.[_0x1765c8(0x1ee)])_0x4be27a[_0x1765c8(0x1ee)]=_0x3c07d0['code'];if(_0x3c07d0?.[_0x1765c8(0x24b)])_0x4be27a[_0x1765c8(0x24b)]=_0x3c07d0[_0x1765c8(0x24b)];const _0x3ed395=await apiRequest(_0x1765c8(0x1d8),{'method':_0x1765c8(0x200),'body':_0x4be27a});return extractList(_0x3ed395[_0x1765c8(0x1d4)]);}export async function deleteDataset(_0x3bdcd0,_0x34cb01){const _0x1b840d=a158_0x5e70;await apiRequest(_0x1b840d(0x1bc),{'method':_0x1b840d(0x200),'body':{'appCode':_0x3bdcd0,'datasetId':_0x34cb01}});}export async function restoreDataset(_0x335c1a,_0x280484){const _0x6ba5b3=a158_0x5e70;await apiRequest(_0x6ba5b3(0x1c0),{'method':_0x6ba5b3(0x200),'body':{'appCode':_0x335c1a,'datasetId':_0x280484}});}export async function previewTextGeneratedDataset(_0x19d078,_0x4d09f2){const _0x27c857=a158_0x5e70,_0x8d1859=await apiRequest(_0x27c857(0x1e0),{'method':_0x27c857(0x200),'body':{'appCode':_0x19d078,'datasetName':_0x4d09f2['datasetName'],'requirementDescription':_0x4d09f2[_0x27c857(0x229)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x8d1859[_0x27c857(0x1d4)];}export async function startTextGeneratedDataset(_0x4e4386,_0x15b984,_0x17e701){const _0x498c95=a158_0x5e70,_0x3ac9d4=await apiRequest(_0x498c95(0x220),{'method':_0x498c95(0x200),'body':{'appCode':_0x4e4386,..._0x17e701?.['clientOperationId']?{'clientOperationId':_0x17e701[_0x498c95(0x232)]}:{},'design':_0x15b984},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3ac9d4[_0x498c95(0x1d4)];}export async function getTextGeneratedDatasetStatus(_0x3f662d,_0x39e8de){const _0x2a6b06=a158_0x5e70,_0x3ae8ec=new URLSearchParams({'appCode':_0x3f662d});_0x39e8de['operationId']&&_0x3ae8ec['set']('operationId',_0x39e8de[_0x2a6b06(0x24a)]);_0x39e8de[_0x2a6b06(0x232)]&&_0x3ae8ec[_0x2a6b06(0x242)](_0x2a6b06(0x232),_0x39e8de[_0x2a6b06(0x232)]);const _0x3a5b65=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x3ae8ec[_0x2a6b06(0x1f3)]());return _0x3a5b65['data'];}export async function searchDatasets(_0x4b127f,_0x1d4603){const _0x1a31f1=a158_0x5e70,_0x4a5da0=await listDatasets(_0x4b127f,{'name':_0x1d4603}),_0x1a6977=_0x1d4603[_0x1a31f1(0x1cd)](),_0x397f9b=new Set(_0x4a5da0[_0x1a31f1(0x202)](_0x1ea1ed=>_0x1ea1ed['id'])),_0x3300a1=_0x4a5da0[_0x1a31f1(0x21c)](_0x38ffd7=>_0x38ffd7[_0x1a31f1(0x21e)]?.[_0x1a31f1(0x22e)]?.['toLowerCase']()[_0x1a31f1(0x1c9)](_0x1a6977)||_0x38ffd7[_0x1a31f1(0x206)]?.[_0x1a31f1(0x1cd)]()[_0x1a31f1(0x1c9)](_0x1a6977)),_0x388ec6=await listDatasets(_0x4b127f,{'code':_0x1d4603});for(const _0x142561 of _0x388ec6){!_0x397f9b[_0x1a31f1(0x1ef)](_0x142561['id'])&&(_0x4a5da0[_0x1a31f1(0x248)](_0x142561),_0x397f9b[_0x1a31f1(0x1c6)](_0x142561['id']));}return _0x4a5da0;}export function normalizeDatasetOperations(_0x5a834d){const _0xcede2c=a158_0x5e70;if(Array['isArray'](_0x5a834d))return _0x5a834d[_0xcede2c(0x21c)](_0x1468ee=>_0x1468ee!=null&&typeof _0x1468ee===_0xcede2c(0x1ff));if(_0x5a834d&&typeof _0x5a834d===_0xcede2c(0x1ff))return Object[_0xcede2c(0x1e1)](_0x5a834d)[_0xcede2c(0x21c)](([,_0x4627d4])=>_0x4627d4!=null&&typeof _0x4627d4===_0xcede2c(0x1ff))[_0xcede2c(0x202)](([_0x5d0232,_0x47d58c])=>({..._0x47d58c,'name':_0x47d58c[_0xcede2c(0x24b)]??_0x47d58c[_0xcede2c(0x238)]??_0x5d0232}));return[];}export async function getDatasetDetail(_0x4ec8f6){const _0x1a364f=a158_0x5e70,_0x477e73=/^\d+$/['test'](_0x4ec8f6)?'id':_0x1a364f(0x1ee),_0x5ebd53=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x477e73+'='+_0x4ec8f6);return _0x5ebd53['data'];}export async function updateDrivenData(_0x402204){const _0x37d768=a158_0x5e70,_0x2a659c=await apiRequest(_0x37d768(0x22a),{'method':_0x37d768(0x200),'body':_0x402204});return _0x2a659c[_0x37d768(0x1d4)];}export async function getDatasetOperations(_0x33cf99){const _0x30e80c=a158_0x5e70,_0x50c48e=await getDatasetDetail(_0x33cf99),_0x4620da=normalizeDatasetOperations(_0x50c48e[_0x30e80c(0x1e3)])[_0x30e80c(0x202)](_0x4fe678=>({'name':_0x4fe678['name']||_0x4fe678[_0x30e80c(0x238)],'displayName':_0x4fe678['displayName']||_0x4fe678[_0x30e80c(0x24b)],'type':_0x4fe678[_0x30e80c(0x1e5)],'method':_0x4fe678[_0x30e80c(0x221)],'path':_0x4fe678[_0x30e80c(0x1d5)],'enabled':_0x4fe678[_0x30e80c(0x204)]??!![],'requestFields':_0x4fe678['requestFields'],'responseFields':_0x4fe678['responseFields']}));return{'dataset':{'id':_0x50c48e['id']??_0x50c48e[_0x30e80c(0x1bd)],'name':_0x50c48e[_0x30e80c(0x24b)],'code':_0x50c48e[_0x30e80c(0x1ee)]||_0x50c48e['modelCode'],'tableName':_0x50c48e['tableName']||_0x50c48e[_0x30e80c(0x21e)]?.[_0x30e80c(0x22e)]},'operations':_0x4620da};}export async function getOperationDetail(_0x5a0db8,_0x59f97a,_0x2e3a32){const _0x3e06ac=a158_0x5e70;let _0xa70686=_0x59f97a;if(!/^\d+$/['test'](_0x59f97a)){const _0x163b61=await listDatasets(_0x5a0db8,{'code':_0x59f97a}),_0x521984=_0x163b61[_0x3e06ac(0x209)](_0x44196f=>_0x44196f[_0x3e06ac(0x1ee)]===_0x59f97a||String(_0x44196f['id'])===_0x59f97a);if(!_0x521984)throw CliErrors[_0x3e06ac(0x23d)](_0x3e06ac(0x1c4)+_0x59f97a);_0xa70686=String(_0x521984['id']);}const _0x513c2e=await getDatasetDetail(_0xa70686),_0x2e9ded=normalizeDatasetOperations(_0x513c2e[_0x3e06ac(0x1e3)])[_0x3e06ac(0x209)](_0x2db315=>(_0x2db315[_0x3e06ac(0x24b)]||_0x2db315[_0x3e06ac(0x238)])===_0x2e3a32);if(!_0x2e9ded)throw CliErrors[_0x3e06ac(0x23d)]('Operation\x20\x22'+_0x2e3a32+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x59f97a);return{'dataset':{'id':_0x513c2e['id']??_0x513c2e[_0x3e06ac(0x1bd)],'name':_0x513c2e[_0x3e06ac(0x24b)],'code':_0x513c2e[_0x3e06ac(0x1ee)]||_0x513c2e[_0x3e06ac(0x20d)],'tableName':_0x513c2e[_0x3e06ac(0x22e)]||_0x513c2e['dbtableConfig']?.['tableName']},'operation':_0x2e9ded};}export async function startGenerateStandardPages(_0x21673f,_0x3eb1be,_0x42685d){const _0x1dbb2f=a158_0x5e70,_0x309dfa=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3eb1be+'/generate-standard-pages/start',{'method':_0x1dbb2f(0x200),'body':{'appCode':_0x21673f,..._0x42685d?.[_0x1dbb2f(0x232)]?{'clientOperationId':_0x42685d['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x309dfa[_0x1dbb2f(0x1d4)];}export async function getGenerateStandardPagesStatus(_0x5386e6,_0x44d74f,_0xd3c413){const _0x328353=a158_0x5e70,_0x59be83=new URLSearchParams({'appCode':_0x5386e6});_0xd3c413[_0x328353(0x24a)]&&_0x59be83[_0x328353(0x242)](_0x328353(0x24a),_0xd3c413['operationId']);_0xd3c413[_0x328353(0x232)]&&_0x59be83['set'](_0x328353(0x232),_0xd3c413[_0x328353(0x232)]);const _0x94c43c=await apiRequest(_0x328353(0x20e)+_0x44d74f+_0x328353(0x24c)+_0x59be83['toString']());return _0x94c43c[_0x328353(0x1d4)];}export async function getStandardPageStatus(_0x5ac79a,_0x52dd1f){const _0x33297c=a158_0x5e70,_0xbd9532=await apiRequest(_0x33297c(0x20e)+_0x52dd1f+_0x33297c(0x1c1)+encodeURIComponent(_0x5ac79a));return _0xbd9532['data'];}export async function tryGetStandardPageStatus(_0x5f0cbe,_0x272ff5){const _0x8dcfb1=a158_0x5e70;try{return await getStandardPageStatus(_0x5f0cbe,_0x272ff5);}catch(_0x1adc69){if(_0x1adc69 instanceof CliError&&_0x1adc69['code']===_0x8dcfb1(0x1c2)&&/404|not found|non-json response/i[_0x8dcfb1(0x1f9)](_0x1adc69[_0x8dcfb1(0x20c)]))return null;throw _0x1adc69;}}export async function syncStandardPages(_0x728a48,_0x4ec245){const _0x104c39=a158_0x5e70,_0xf8e719=await apiRequest(_0x104c39(0x20e)+_0x4ec245+_0x104c39(0x1f2),{'method':_0x104c39(0x200),'body':{'appCode':_0x728a48}});return _0xf8e719[_0x104c39(0x1d4)];}export async function getPageDetail(_0x54cada){const _0x3f09a8=a158_0x5e70,_0x8bd623=await apiRequest(_0x3f09a8(0x1f7)+_0x54cada);if(!_0x8bd623[_0x3f09a8(0x1d4)])throw CliErrors['validation'](_0x3f09a8(0x214)+_0x54cada);return _0x8bd623[_0x3f09a8(0x1d4)];}export async function updatePage(_0x46db75,_0xef95b8,_0x109ee2,_0x5924ac){const _0x5a438e=a158_0x5e70,_0x436db7=await apiRequest(_0x5a438e(0x1c3),{'method':'POST','body':{'appCode':_0x46db75,'pageId':_0xef95b8,'code':_0x109ee2,'datasetIds':_0x5924ac}});return _0x436db7[_0x5a438e(0x1d4)];}export function generateSdkCode(_0x430574,_0x299fd6,_0x53a33a){const _0x2fad95=a158_0x5e70,_0x370a7d=_0x53a33a?.[_0x2fad95(0x218)]??!![],_0xd63bab=_0x2fad95(0x1e9)+_0x430574[_0x2fad95(0x1ee)]?.[_0x2fad95(0x1cf)](/-/g,'_'),_0x4614e4=_0x299fd6[_0x2fad95(0x24b)]||_0x299fd6[_0x2fad95(0x238)]||'filter',_0xa54085=[];_0x370a7d&&_0xa54085['push'](_0x2fad95(0x1a9),'',_0x2fad95(0x1b9),'');_0xa54085['push']('//\x20'+_0x430574[_0x2fad95(0x24b)]+'\x20('+(_0x430574[_0x2fad95(0x22e)]||_0x2fad95(0x201))+')');if(_0x4614e4===_0x2fad95(0x21c))_0xa54085['push'](_0x2fad95(0x1f0)+_0xd63bab+'.filter({',_0x2fad95(0x212),_0x2fad95(0x210),'\x20\x20currentPage:\x201,',_0x2fad95(0x234));else{if(_0x4614e4===_0x2fad95(0x1ba))_0xa54085[_0x2fad95(0x248)]('const\x20result\x20=\x20await\x20client.models.'+_0xd63bab+_0x2fad95(0x23c));else{if(_0x4614e4==='create')_0xa54085[_0x2fad95(0x248)]('const\x20result\x20=\x20await\x20client.models.'+_0xd63bab+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x4614e4===_0x2fad95(0x227))_0xa54085['push'](_0x2fad95(0x1f0)+_0xd63bab+_0x2fad95(0x226));else _0x4614e4==='delete'||_0x4614e4===_0x2fad95(0x1db)?_0xa54085[_0x2fad95(0x248)](_0x2fad95(0x1f0)+_0xd63bab+'.remove(id);'):_0xa54085['push'](_0x2fad95(0x1f0)+_0xd63bab+'.'+_0x4614e4+'(/*\x20params\x20*/);');}}}return _0xa54085[_0x2fad95(0x211)]('\x0a');}export function generateSqlCodeTemplate(_0x317bb5,_0x3776b6){const _0x4b7697=a158_0x5e70,_0x2e81dc=_0x3776b6?.[_0x4b7697(0x235)]??_0x4b7697(0x1fc),_0x1ec4c3=_0x3776b6?.[_0x4b7697(0x218)]??!![],_0x45be1e=[];return _0x45be1e['push'](_0x4b7697(0x205)+_0x317bb5[_0x4b7697(0x245)]+'\x20('+_0x317bb5[_0x4b7697(0x239)]+')'),_0x2e81dc==='sdk'?(_0x1ec4c3&&_0x45be1e[_0x4b7697(0x248)](_0x4b7697(0x1a9),'',_0x4b7697(0x1b9),''),_0x45be1e[_0x4b7697(0x248)](_0x4b7697(0x1d2),_0x4b7697(0x228)+_0x317bb5[_0x4b7697(0x239)]+'\x27,',_0x4b7697(0x1bf),_0x4b7697(0x234),_0x4b7697(0x1e2),_0x4b7697(0x247))):_0x45be1e['push'](_0x4b7697(0x1d7),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x4b7697(0x1f8),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x317bb5[_0x4b7697(0x239)]+'\x27,',_0x4b7697(0x208),_0x4b7697(0x1ca),_0x4b7697(0x1e6),'}'),_0x45be1e[_0x4b7697(0x211)]('\x0a');}export async function getErConfig(_0x340a70,_0x4ba27a){const _0x53f0e0=a158_0x5e70,_0x3ad09b=await apiRequest('/smartapi/question/er-config',{'method':'POST','body':{'appCode':_0x340a70,'dblinkId':_0x4ba27a},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x3ad09b[_0x53f0e0(0x1d4)];}export async function createErRelation(_0x151bd2){const _0x27dc8f=a158_0x5e70,_0x507206=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':_0x27dc8f(0x200),'body':_0x151bd2,'allowNonJsonSuccess':!![]});return _0x507206[_0x27dc8f(0x1d4)];}export async function updateErRelation(_0x3d3efb){const _0x534a69=a158_0x5e70,_0x1a4478=await apiRequest(_0x534a69(0x1df),{'method':_0x534a69(0x200),'body':_0x3d3efb,'allowNonJsonSuccess':!![]});return _0x1a4478[_0x534a69(0x1d4)];}export async function deleteErRelation(_0xa6a10c){const _0x8e6f6f=a158_0x5e70,_0x58b8ab=await apiRequest(_0x8e6f6f(0x1af),{'method':'POST','body':_0xa6a10c,'allowNonJsonSuccess':!![]});return _0x58b8ab[_0x8e6f6f(0x1d4)];}export async function updateErBusinessGroup(_0x5cd314){const _0x47c6a0=a158_0x5e70,_0x53833b=await apiRequest(_0x47c6a0(0x1f4),{'method':_0x47c6a0(0x200),'body':_0x5cd314,'allowNonJsonSuccess':!![]});return _0x53833b[_0x47c6a0(0x1d4)];}function buildQuery(_0x4a2d57){const _0x45dad5=a158_0x5e70,_0x1cbae9=new URLSearchParams();for(const [_0x11927f,_0x3fa37a]of Object['entries'](_0x4a2d57)){if(_0x3fa37a===undefined||_0x3fa37a==='')continue;_0x1cbae9['set'](_0x11927f,String(_0x3fa37a));}const _0x100bcc=_0x1cbae9[_0x45dad5(0x1f3)]();return _0x100bcc?'?'+_0x100bcc:'';}export async function listAppConfigs(_0x17f2bf,_0x432217){const _0x42f262=a158_0x5e70,_0x10ba66=await apiRequest('/smartapi/app-config/list',{'method':_0x42f262(0x200),'body':{'appCode':_0x17f2bf,..._0x432217?.[_0x42f262(0x1ad)]?{'key':_0x432217[_0x42f262(0x1ad)]}:{},..._0x432217?.[_0x42f262(0x1cc)]?{'tags':_0x432217['tags']}:{}}});return extractAppConfigList(_0x10ba66[_0x42f262(0x1d4)]);}export async function getAppConfigByKey(_0x5d8251,_0x2a59b5){const _0x22eaa7=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x5d8251,'key':_0x2a59b5}));return _0x22eaa7['data']??null;}export async function createAppConfig(_0x5d62e8){const _0x2e0313=a158_0x5e70,_0x56576a=await apiRequest(_0x2e0313(0x1b7),{'method':_0x2e0313(0x200),'body':{'appCode':_0x5d62e8['appCode'],'key':_0x5d62e8[_0x2e0313(0x1ad)],'value':_0x5d62e8[_0x2e0313(0x22f)],..._0x5d62e8[_0x2e0313(0x1cc)]?{'tags':_0x5d62e8['tags']}:{}}});return _0x56576a[_0x2e0313(0x1d4)];}export async function updateAppConfig(_0x54a5d7){const _0x178f4a=a158_0x5e70;await apiRequest('/smartapi/app-config/update',{'method':_0x178f4a(0x200),'body':{'id':_0x54a5d7['id'],'appCode':_0x54a5d7['appCode'],'key':_0x54a5d7[_0x178f4a(0x1ad)],'value':_0x54a5d7[_0x178f4a(0x22f)],..._0x54a5d7['tags']?{'tags':_0x54a5d7['tags']}:{}}});}export async function deleteAppConfig(_0x27d9be){const _0x39c492=a158_0x5e70;await apiRequest(_0x39c492(0x213),{'method':'POST','body':_0x27d9be});}function extractAppConfigList(_0x3266f4){const _0x82d7f3=a158_0x5e70;if(Array[_0x82d7f3(0x1ce)](_0x3266f4))return _0x3266f4;if(_0x3266f4&&typeof _0x3266f4===_0x82d7f3(0x1ff)&&Array[_0x82d7f3(0x1ce)](_0x3266f4[_0x82d7f3(0x224)]))return _0x3266f4[_0x82d7f3(0x224)];return extractList(_0x3266f4);}export async function listDbLinks(_0x4558ad,_0x52ed6c){const _0x54ba75=a158_0x5e70,_0x4b52c5=await apiRequest(_0x54ba75(0x1fe),{'method':_0x54ba75(0x200),'body':{'appCode':_0x4558ad,'currentPage':_0x52ed6c?.[_0x54ba75(0x1b1)]??0x1,'pageSize':_0x52ed6c?.[_0x54ba75(0x20b)]??0x64}});return{'items':extractList(_0x4b52c5[_0x54ba75(0x1d4)]),'paging':extractPaging(_0x4b52c5['data'])};}export async function getDbLinkInfo(_0x2767e3){const _0xa767b7=a158_0x5e70,_0x110c1e=await apiRequest(_0xa767b7(0x236)+buildQuery({'id':_0x2767e3}));return _0x110c1e[_0xa767b7(0x1d4)];}export async function createDbLink(_0x83d0d0){const _0x13d71a=a158_0x5e70,_0x1b6cba=await apiRequest(_0x13d71a(0x1fd),{'method':'POST','body':_0x83d0d0});return _0x1b6cba['data'];}export async function updateDbLink(_0x2a7f78){const _0x23563e=a158_0x5e70,_0x2a9f82=await apiRequest(_0x23563e(0x1a7),{'method':_0x23563e(0x200),'body':_0x2a7f78});return _0x2a9f82[_0x23563e(0x1d4)];}export async function deleteDbLink(_0x461600){const _0x386521=a158_0x5e70;await apiRequest(_0x386521(0x231),{'method':_0x386521(0x200),'body':{'id':_0x461600}});}export async function testDbLinkConnect(_0x462e44){const _0x593509=a158_0x5e70,_0x2324bb=await apiRequest(_0x593509(0x1b2)+buildQuery({'id':_0x462e44}));return _0x2324bb[_0x593509(0x1d4)];}export async function startDbAnalysis(_0x39836f,_0x1bbb38){const _0x8a433=a158_0x5e70,_0x53f8f0=await apiRequest(_0x8a433(0x1f5),{'method':_0x8a433(0x200),'body':{'dbLinkId':_0x39836f,..._0x1bbb38&&_0x1bbb38['length']>0x0?{'tableNames':_0x1bbb38}:{}}}),_0x218172=_0x53f8f0['data'];if(typeof _0x218172===_0x8a433(0x22b))return _0x218172;if(_0x218172&&typeof _0x218172===_0x8a433(0x1ff)&&typeof _0x218172['planId']===_0x8a433(0x22b))return _0x218172[_0x8a433(0x240)];return _0x218172!=null?String(_0x218172):'';}export async function cancelDbAnalysis(_0x575fc0){const _0x2747f5=a158_0x5e70;await apiRequest(_0x2747f5(0x23b)+buildQuery({'planId':_0x575fc0}),{'method':_0x2747f5(0x200)});}export async function getDbAnalysisStatus(_0x4466e4){const _0x4f0c9f=a158_0x5e70,_0x5c2194=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x4466e4));return _0x5c2194[_0x4f0c9f(0x1d4)];}export async function getDbAllTableList(_0x4db957,_0x545217){const _0x99b65=a158_0x5e70,_0x5e7c74=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x4db957,'dbLinkId':_0x545217})),_0x2ae298=_0x5e7c74[_0x99b65(0x1d4)];if(Array[_0x99b65(0x1ce)](_0x2ae298))return _0x2ae298;return extractList(_0x2ae298);}export async function getDbTableDiff(_0x2461e2,_0x347342,_0x112651){const _0x397bc2=a158_0x5e70,_0x48577c=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x2461e2,'dbLinkId':_0x347342,'pageIndex':_0x112651?.[_0x397bc2(0x1f6)]??0x1,'pageSize':_0x112651?.['pageSize']??0x14,'tableName':_0x112651?.[_0x397bc2(0x22e)]})),_0x16e5b7=_0x48577c[_0x397bc2(0x1d4)];return{'totalCount':_0x16e5b7?.['totalCount']??0x0,'physicalTableCount':_0x16e5b7?.[_0x397bc2(0x1fa)]??0x0,'datasetTableCount':_0x16e5b7?.[_0x397bc2(0x1aa)]??0x0,..._0x16e5b7?.['summary']?{'summary':_0x16e5b7[_0x397bc2(0x233)]}:{},'tableList':Array[_0x397bc2(0x1ce)](_0x16e5b7?.[_0x397bc2(0x1de)])?_0x16e5b7[_0x397bc2(0x1de)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0xff74fa=a158_0x5e70,_0x45f8c9=await apiRequest(_0xff74fa(0x223),{'method':_0xff74fa(0x200),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1fe023=extractList(_0x45f8c9[_0xff74fa(0x1d4)]),_0x1bf377=extractPaging(_0x45f8c9[_0xff74fa(0x1d4)]);return _0x1bf377&&_0x1bf377[_0xff74fa(0x1d1)]>REMOTE_APP_PAGE_SIZE&&console[_0xff74fa(0x23f)](_0xff74fa(0x216)+REMOTE_APP_PAGE_SIZE+_0xff74fa(0x1ab)+_0x1bf377[_0xff74fa(0x1d1)]+_0xff74fa(0x203)+_0xff74fa(0x249)),_0x1fe023;}
@@ -1 +1 @@
1
- const a159_0x4471de=a159_0x36b6;(function(_0x50e789,_0x574ef1){const _0x4dc2f2=a159_0x36b6,_0x3c42c5=_0x50e789();while(!![]){try{const _0x3e0d8b=parseInt(_0x4dc2f2(0x1c2))/0x1+parseInt(_0x4dc2f2(0x1c6))/0x2*(parseInt(_0x4dc2f2(0x1c9))/0x3)+parseInt(_0x4dc2f2(0x1bf))/0x4*(-parseInt(_0x4dc2f2(0x1ca))/0x5)+-parseInt(_0x4dc2f2(0x1c3))/0x6*(parseInt(_0x4dc2f2(0x1c5))/0x7)+-parseInt(_0x4dc2f2(0x1c7))/0x8+parseInt(_0x4dc2f2(0x1c4))/0x9+parseInt(_0x4dc2f2(0x1c8))/0xa;if(_0x3e0d8b===_0x574ef1)break;else _0x3c42c5['push'](_0x3c42c5['shift']());}catch(_0x2f805d){_0x3c42c5['push'](_0x3c42c5['shift']());}}}(a159_0x5500,0x53881));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a159_0x5500(){const _0x1433f4=['/bff','bff.lock.json','547020LLLADf','3907572gxOgVX','1654767ucrtlw','7mUipsL','4meiJcu','582624nrjfYU','3260010UtYACj','508389hHJzPL','25nrJeIs','263660eBzqdl'];a159_0x5500=function(){return _0x1433f4;};return a159_0x5500();}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a159_0x4471de(0x1c1),TRASH_DIR_NAME='bff-trash';function a159_0x36b6(_0x2d8fed,_0x396317){_0x2d8fed=_0x2d8fed-0x1bf;const _0x5500ce=a159_0x5500();let _0x36b677=_0x5500ce[_0x2d8fed];return _0x36b677;}export function loadBffProjectConfig(_0x23b2b6,_0xe07444){const _0x437817=a159_0x4471de,_0x34b9ba=resolve(_0xe07444??findProjectRootDirectory()),_0x4a94c6=DOT_DIR+_0x437817(0x1c0),_0x1efa8f=_0x4a94c6+'/'+_0x23b2b6;return{'projectRoot':_0x34b9ba,'appCode':_0x23b2b6,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4a94c6,'scriptsRoot':_0x1efa8f,'scriptsRootDir':resolve(_0x34b9ba,DOT_DIR,'bff',_0x23b2b6),'lockFilePath':resolve(_0x34b9ba,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x34b9ba,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a159_0x41fa(){const _0x1a4682=['/bff','100gcocxp','86713bQUegy','4BXrrkP','159320LfYsuB','1098jJGPgc','bff.lock.json','27ZGEQiH','903foxEaf','.rabetbase','526qMiDYt','140bLJnNt','715881nHubUd','2195988unOuHc','bff-trash','306800MBpAoc'];a159_0x41fa=function(){return _0x1a4682;};return a159_0x41fa();}const a159_0x5f51d5=a159_0xeee5;(function(_0x4addc2,_0x15d2a3){const _0x574f5d=a159_0xeee5,_0x446e19=_0x4addc2();while(!![]){try{const _0x41fe2f=parseInt(_0x574f5d(0x1a2))/0x1*(-parseInt(_0x574f5d(0x1a9))/0x2)+parseInt(_0x574f5d(0x1a4))/0x3*(-parseInt(_0x574f5d(0x1ab))/0x4)+-parseInt(_0x574f5d(0x1ac))/0x5+parseInt(_0x574f5d(0x1ad))/0x6*(parseInt(_0x574f5d(0x1a0))/0x7)+parseInt(_0x574f5d(0x1a7))/0x8*(parseInt(_0x574f5d(0x19f))/0x9)+parseInt(_0x574f5d(0x1a3))/0xa*(parseInt(_0x574f5d(0x1aa))/0xb)+parseInt(_0x574f5d(0x1a5))/0xc;if(_0x41fe2f===_0x15d2a3)break;else _0x446e19['push'](_0x446e19['shift']());}catch(_0x3d7b5b){_0x446e19['push'](_0x446e19['shift']());}}}(a159_0x41fa,0x2103b));import{resolve}from'node:path';function a159_0xeee5(_0x54fd0f,_0x477cad){_0x54fd0f=_0x54fd0f-0x19f;const _0x41fabc=a159_0x41fa();let _0xeee562=_0x41fabc[_0x54fd0f];return _0xeee562;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a159_0x5f51d5(0x1a1),LOCK_FILE_NAME=a159_0x5f51d5(0x1ae),TRASH_DIR_NAME=a159_0x5f51d5(0x1a6);export function loadBffProjectConfig(_0x4bd4bc,_0x5337b3){const _0x29052c=a159_0x5f51d5,_0x390f7a=resolve(_0x5337b3??findProjectRootDirectory()),_0x2ca657=DOT_DIR+_0x29052c(0x1a8),_0x49f62a=_0x2ca657+'/'+_0x4bd4bc;return{'projectRoot':_0x390f7a,'appCode':_0x4bd4bc,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2ca657,'scriptsRoot':_0x49f62a,'scriptsRootDir':resolve(_0x390f7a,DOT_DIR,'bff',_0x4bd4bc),'lockFilePath':resolve(_0x390f7a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x390f7a,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a160_0x201f9b=a160_0x4bac;(function(_0x26d478,_0x5b2470){const _0x4f3236=a160_0x4bac,_0x57ff08=_0x26d478();while(!![]){try{const _0x22954a=-parseInt(_0x4f3236(0xf2))/0x1*(parseInt(_0x4f3236(0xd2))/0x2)+-parseInt(_0x4f3236(0xed))/0x3*(-parseInt(_0x4f3236(0xe5))/0x4)+-parseInt(_0x4f3236(0xf1))/0x5+-parseInt(_0x4f3236(0xd1))/0x6+-parseInt(_0x4f3236(0xe9))/0x7*(parseInt(_0x4f3236(0xef))/0x8)+-parseInt(_0x4f3236(0xdc))/0x9+parseInt(_0x4f3236(0xd3))/0xa;if(_0x22954a===_0x5b2470)break;else _0x57ff08['push'](_0x57ff08['shift']());}catch(_0x51365b){_0x57ff08['push'](_0x57ff08['shift']());}}}(a160_0x47f9,0x2dca4));import{access,mkdir,readdir,stat}from'node:fs/promises';function a160_0x47f9(){const _0x585e27=['ENOENT','112hmrosz','.js','get','beforeScriptId','93VGeUvZ','includes','30128NBspmE','before','520615QFyvXs','9CUeAiF','operationType','push','name','alias','isFile','1544160GekeVf','70494SMhUZb','8129270eJIVjv','map','functionName','functionNode','HOOK','set','datasetCode','F_OK','COMMON','1153044oDJNCl','after','trim','scriptsRootDir','isDirectory','afterScriptId','HOOK/','endsWith','ENDPOINT','31188CrfXFX','replace','code'];a160_0x47f9=function(){return _0x585e27;};return a160_0x47f9();}function a160_0x4bac(_0x19bdb0,_0x39856a){_0x19bdb0=_0x19bdb0-0xd0;const _0x47f9e3=a160_0x47f9();let _0x4bacd9=_0x47f9e3[_0x19bdb0];return _0x4bacd9;}import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x201f9b(0xdb),a160_0x201f9b(0xe4),a160_0x201f9b(0xd7)];export function normalizeBffType(_0x223c58){const _0x134b6b=a160_0x201f9b;if(!_0x223c58)return undefined;const _0x1bca25=_0x223c58[_0x134b6b(0xde)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x134b6b(0xee)](_0x1bca25)?_0x1bca25:undefined;}async function scanJsFilesRecursively(_0x1f8327,_0x27c47f){const _0x50ce07=a160_0x201f9b,_0x3ba6b4=[];try{const _0xc95ec=await readdir(_0x1f8327,{'withFileTypes':!![]});for(const _0x5727a6 of _0xc95ec){const _0x42a8ff=join(_0x1f8327,_0x5727a6[_0x50ce07(0xf5)]);if(_0x5727a6[_0x50ce07(0xe0)]())_0x3ba6b4['push'](...await scanJsFilesRecursively(_0x42a8ff,_0x27c47f+'/'+_0x5727a6['name']));else _0x5727a6[_0x50ce07(0xd0)]()&&_0x5727a6['name'][_0x50ce07(0xe3)](_0x50ce07(0xea))&&_0x3ba6b4[_0x50ce07(0xf4)]({'lockKey':_0x27c47f+'/'+_0x5727a6[_0x50ce07(0xf5)][_0x50ce07(0xe6)](/\.js$/,''),'filePath':_0x42a8ff});}}catch(_0xf54998){if(_0xf54998[_0x50ce07(0xe7)]!==_0x50ce07(0xe8))throw _0xf54998;}return _0x3ba6b4;}async function scanFlatFunctions(_0x1a2abc,_0x129d76){const _0xe92cb=a160_0x201f9b,_0x259ef0=join(_0x1a2abc[_0xe92cb(0xdf)],_0x129d76),_0x3949ac=await scanJsFilesRecursively(_0x259ef0,_0x129d76);return _0x3949ac[_0xe92cb(0xd4)](({lockKey:_0x33a8cb,filePath:_0x38f504})=>({'type':_0x129d76,'name':_0x33a8cb['split']('/')['at'](-0x1)??'','filePath':_0x38f504,'lockKey':_0x33a8cb}));}async function scanHookFunctions(_0x5c6812){const _0xfecb77=a160_0x201f9b,_0x9f40b=join(_0x5c6812['scriptsRootDir'],'HOOK'),_0x3a1c7d=[];try{const _0x1afe01=await readdir(_0x9f40b,{'withFileTypes':!![]});for(const _0x39ee5a of _0x1afe01){if(!_0x39ee5a[_0xfecb77(0xe0)]())continue;const _0x22898b=_0x39ee5a['name'],_0x2e9761=join(_0x9f40b,_0x22898b),_0x42819b=await readdir(_0x2e9761,{'withFileTypes':!![]});for(const _0x486c87 of _0x42819b){if(!_0x486c87[_0xfecb77(0xe0)]())continue;const _0x4b7147=_0x486c87[_0xfecb77(0xf5)],_0x500cda=join(_0x2e9761,_0x4b7147),_0xb19cd1=await readdir(_0x500cda,{'withFileTypes':!![]});for(const _0x3284ba of _0xb19cd1){if(!_0x3284ba[_0xfecb77(0xe0)]())continue;const _0x4bd902=_0x3284ba[_0xfecb77(0xf5)],_0x3a59ca=join(_0x500cda,_0x4bd902),_0x3502ce=await readdir(_0x3a59ca,{'withFileTypes':!![]});for(const _0x2841f3 of _0x3502ce){if(!_0x2841f3['isFile']()||!_0x2841f3[_0xfecb77(0xf5)]['endsWith']('.js'))continue;const _0x5ef07f=_0x2841f3[_0xfecb77(0xf5)]['replace'](/\.js$/,'');_0x3a1c7d[_0xfecb77(0xf4)]({'type':_0xfecb77(0xd7),'name':_0x5ef07f,'filePath':join(_0x3a59ca,_0x2841f3['name']),'lockKey':'HOOK/'+_0x22898b+'/'+_0x4b7147+'/'+_0x4bd902+'/'+_0x5ef07f,'alias':_0x22898b,'operationType':_0x4b7147,'functionNode':_0x4bd902});}}}}}catch(_0x7c4088){if(_0x7c4088[_0xfecb77(0xe7)]!==_0xfecb77(0xe8))throw _0x7c4088;}return _0x3a1c7d;}export async function scanLocalBffFunctions(_0x390bf3,_0xd874da){const _0x4831dc=a160_0x201f9b;if(_0xd874da===_0x4831dc(0xdb)||_0xd874da===_0x4831dc(0xe4))return scanFlatFunctions(_0x390bf3,_0xd874da);if(_0xd874da===_0x4831dc(0xd7))return scanHookFunctions(_0x390bf3);const [_0x58a965,_0x1c953a,_0x4eef50]=await Promise['all']([scanFlatFunctions(_0x390bf3,_0x4831dc(0xdb)),scanFlatFunctions(_0x390bf3,_0x4831dc(0xe4)),scanHookFunctions(_0x390bf3)]);return[..._0x58a965,..._0x1c953a,..._0x4eef50];}export function resolveLocalFilePathFromLockKey(_0x3de3c3,_0x5a634c){const _0x46a37a=a160_0x201f9b;return join(_0x3de3c3[_0x46a37a(0xdf)],..._0x5a634c['split']('/'))+_0x46a37a(0xea);}export function createHookLocationMap(_0x35a211){const _0x4ab525=a160_0x201f9b,_0x559339=new Map();for(const _0x5b06ee of _0x35a211){_0x5b06ee[_0x4ab525(0xec)]&&_0x559339[_0x4ab525(0xd8)](_0x5b06ee[_0x4ab525(0xec)],{'datasetCode':_0x5b06ee['datasetCode'],'operationType':snakeToCamel(_0x5b06ee['operationType']),'functionNode':_0x4ab525(0xf0)}),_0x5b06ee[_0x4ab525(0xe1)]&&_0x559339[_0x4ab525(0xd8)](_0x5b06ee[_0x4ab525(0xe1)],{'datasetCode':_0x5b06ee[_0x4ab525(0xd9)],'operationType':snakeToCamel(_0x5b06ee[_0x4ab525(0xf3)]),'functionNode':_0x4ab525(0xdd)});}return _0x559339;}export function resolveRemoteScriptTarget(_0x18e4ab,_0x29dba2,_0x4ca87a,_0x1414d9,_0x115ab9){const _0x521bc8=a160_0x201f9b,_0x40ba67=normalizeBffType(_0x29dba2['scriptType']);if(!_0x40ba67||!_0x29dba2[_0x521bc8(0xd5)])return null;if(_0x40ba67===_0x521bc8(0xd7)){const _0x27724d=(_0x29dba2['id']?_0x4ca87a[_0x521bc8(0xeb)](_0x29dba2['id']):undefined)??findHookLocationByRemoteId(_0x1414d9,_0x29dba2['id']);if(!_0x27724d)return null;const _0x11e574=_0x27724d[_0x521bc8(0xf6)]||_0x115ab9[_0x521bc8(0xeb)](_0x27724d[_0x521bc8(0xd9)]),_0x3868ab=_0x11e574??_0x27724d[_0x521bc8(0xd9)],_0x688ba6={..._0x27724d,'alias':_0x11e574},_0x429c4e=_0x521bc8(0xe2)+_0x3868ab+'/'+_0x688ba6[_0x521bc8(0xf3)]+'/'+_0x688ba6[_0x521bc8(0xd6)]+'/'+_0x29dba2[_0x521bc8(0xd5)];return{'lockKey':_0x429c4e,'filePath':resolveLocalFilePathFromLockKey(_0x18e4ab,_0x429c4e),'type':_0x521bc8(0xd7),'hookLocation':_0x688ba6};}const _0x323a79=_0x40ba67+'/'+_0x29dba2[_0x521bc8(0xd5)];return{'lockKey':_0x323a79,'filePath':resolveLocalFilePathFromLockKey(_0x18e4ab,_0x323a79),'type':_0x40ba67};}export async function ensureParentDirectory(_0x4ff998){await mkdir(dirname(_0x4ff998),{'recursive':!![]});}export async function fileExists(_0x4834f8){const _0x46f9a8=a160_0x201f9b;try{return await access(_0x4834f8,constants[_0x46f9a8(0xda)]),!![];}catch{return![];}}export async function directoryExists(_0x507eef){const _0x5b3e01=a160_0x201f9b;try{const _0x39c0f8=await stat(_0x507eef);return _0x39c0f8[_0x5b3e01(0xe0)]();}catch{return![];}}
1
+ function a160_0x281c(_0x3e015c,_0x2f33f7){_0x3e015c=_0x3e015c-0x77;const _0x31bfc9=a160_0x31bf();let _0x281c14=_0x31bfc9[_0x3e015c];return _0x281c14;}const a160_0x24736e=a160_0x281c;(function(_0x3d6f9e,_0x1b6460){const _0x2e3414=a160_0x281c,_0x2ba85c=_0x3d6f9e();while(!![]){try{const _0x1855a4=-parseInt(_0x2e3414(0x90))/0x1*(-parseInt(_0x2e3414(0x7e))/0x2)+parseInt(_0x2e3414(0x7f))/0x3*(parseInt(_0x2e3414(0x80))/0x4)+-parseInt(_0x2e3414(0x9c))/0x5*(parseInt(_0x2e3414(0x91))/0x6)+-parseInt(_0x2e3414(0x97))/0x7*(-parseInt(_0x2e3414(0x9a))/0x8)+-parseInt(_0x2e3414(0x88))/0x9*(parseInt(_0x2e3414(0x86))/0xa)+parseInt(_0x2e3414(0x98))/0xb+-parseInt(_0x2e3414(0x8e))/0xc*(parseInt(_0x2e3414(0x7b))/0xd);if(_0x1855a4===_0x1b6460)break;else _0x2ba85c['push'](_0x2ba85c['shift']());}catch(_0x6663e0){_0x2ba85c['push'](_0x2ba85c['shift']());}}}(a160_0x31bf,0xc64e0));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';function a160_0x31bf(){const _0x3e9884=['405fSisyx','1528tegeWg','push','includes','name','code','.js','198500QNPJhj','HOOK','99oYnWQN','split','endsWith','afterScriptId','scriptType','operationType','661608mHKcIK','functionNode','1kzbgkD','54UymSWa','ENOENT','set','functionName','scriptsRootDir','trim','161ILLEur','6599736XTciEM','HOOK/','155240jfEtrk','alias','590380BHSoOn','replace','map','isDirectory','ENDPOINT','all','beforeScriptId','get','COMMON','datasetCode','52QUhTeQ','toUpperCase','isFile','2431930fVInMc'];a160_0x31bf=function(){return _0x3e9884;};return a160_0x31bf();}import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x24736e(0x79),a160_0x24736e(0xa0),a160_0x24736e(0x87)];export function normalizeBffType(_0x219cc7){const _0x2df204=a160_0x24736e;if(!_0x219cc7)return undefined;const _0x1dcf2b=_0x219cc7[_0x2df204(0x96)]()[_0x2df204(0x7c)]();return SUPPORTED_BFF_TYPES[_0x2df204(0x82)](_0x1dcf2b)?_0x1dcf2b:undefined;}async function scanJsFilesRecursively(_0x1f6cce,_0x440244){const _0x3e2a6d=a160_0x24736e,_0x3f8f0d=[];try{const _0x188ae7=await readdir(_0x1f6cce,{'withFileTypes':!![]});for(const _0x334de8 of _0x188ae7){const _0x28d828=join(_0x1f6cce,_0x334de8[_0x3e2a6d(0x83)]);if(_0x334de8[_0x3e2a6d(0x9f)]())_0x3f8f0d[_0x3e2a6d(0x81)](...await scanJsFilesRecursively(_0x28d828,_0x440244+'/'+_0x334de8['name']));else _0x334de8[_0x3e2a6d(0x7d)]()&&_0x334de8[_0x3e2a6d(0x83)][_0x3e2a6d(0x8a)](_0x3e2a6d(0x85))&&_0x3f8f0d[_0x3e2a6d(0x81)]({'lockKey':_0x440244+'/'+_0x334de8[_0x3e2a6d(0x83)]['replace'](/\.js$/,''),'filePath':_0x28d828});}}catch(_0x2b9373){if(_0x2b9373['code']!==_0x3e2a6d(0x92))throw _0x2b9373;}return _0x3f8f0d;}async function scanFlatFunctions(_0x4c2cfc,_0x1d3d90){const _0x1ce2a1=a160_0x24736e,_0x5211cd=join(_0x4c2cfc[_0x1ce2a1(0x95)],_0x1d3d90),_0x5b0676=await scanJsFilesRecursively(_0x5211cd,_0x1d3d90);return _0x5b0676[_0x1ce2a1(0x9e)](({lockKey:_0x352618,filePath:_0xee94c6})=>({'type':_0x1d3d90,'name':_0x352618['split']('/')['at'](-0x1)??'','filePath':_0xee94c6,'lockKey':_0x352618}));}async function scanHookFunctions(_0x5ae716){const _0x408b21=a160_0x24736e,_0x189a13=join(_0x5ae716['scriptsRootDir'],_0x408b21(0x87)),_0x29cbe2=[];try{const _0x10fa0e=await readdir(_0x189a13,{'withFileTypes':!![]});for(const _0x22afba of _0x10fa0e){if(!_0x22afba[_0x408b21(0x9f)]())continue;const _0x5d5442=_0x22afba[_0x408b21(0x83)],_0x5ac79c=join(_0x189a13,_0x5d5442),_0x4651a3=await readdir(_0x5ac79c,{'withFileTypes':!![]});for(const _0x8f2ead of _0x4651a3){if(!_0x8f2ead[_0x408b21(0x9f)]())continue;const _0x47ca23=_0x8f2ead['name'],_0x5ca66c=join(_0x5ac79c,_0x47ca23),_0xd3bf0=await readdir(_0x5ca66c,{'withFileTypes':!![]});for(const _0x28be4c of _0xd3bf0){if(!_0x28be4c[_0x408b21(0x9f)]())continue;const _0x568942=_0x28be4c[_0x408b21(0x83)],_0x32b052=join(_0x5ca66c,_0x568942),_0x1570a9=await readdir(_0x32b052,{'withFileTypes':!![]});for(const _0x1463ee of _0x1570a9){if(!_0x1463ee['isFile']()||!_0x1463ee['name'][_0x408b21(0x8a)](_0x408b21(0x85)))continue;const _0x593d56=_0x1463ee[_0x408b21(0x83)][_0x408b21(0x9d)](/\.js$/,'');_0x29cbe2[_0x408b21(0x81)]({'type':_0x408b21(0x87),'name':_0x593d56,'filePath':join(_0x32b052,_0x1463ee[_0x408b21(0x83)]),'lockKey':_0x408b21(0x99)+_0x5d5442+'/'+_0x47ca23+'/'+_0x568942+'/'+_0x593d56,'alias':_0x5d5442,'operationType':_0x47ca23,'functionNode':_0x568942});}}}}}catch(_0x185c4d){if(_0x185c4d[_0x408b21(0x84)]!==_0x408b21(0x92))throw _0x185c4d;}return _0x29cbe2;}export async function scanLocalBffFunctions(_0x4c38b4,_0x48a289){const _0x163f19=a160_0x24736e;if(_0x48a289===_0x163f19(0x79)||_0x48a289==='ENDPOINT')return scanFlatFunctions(_0x4c38b4,_0x48a289);if(_0x48a289===_0x163f19(0x87))return scanHookFunctions(_0x4c38b4);const [_0x2cbd8f,_0x2708e2,_0x59dd55]=await Promise[_0x163f19(0xa1)]([scanFlatFunctions(_0x4c38b4,_0x163f19(0x79)),scanFlatFunctions(_0x4c38b4,_0x163f19(0xa0)),scanHookFunctions(_0x4c38b4)]);return[..._0x2cbd8f,..._0x2708e2,..._0x59dd55];}export function resolveLocalFilePathFromLockKey(_0x4b0038,_0x4df403){const _0x500aa3=a160_0x24736e;return join(_0x4b0038[_0x500aa3(0x95)],..._0x4df403[_0x500aa3(0x89)]('/'))+'.js';}export function createHookLocationMap(_0x5dc447){const _0x561f0f=a160_0x24736e,_0x554207=new Map();for(const _0x3cfca6 of _0x5dc447){_0x3cfca6[_0x561f0f(0x77)]&&_0x554207[_0x561f0f(0x93)](_0x3cfca6['beforeScriptId'],{'datasetCode':_0x3cfca6[_0x561f0f(0x7a)],'operationType':snakeToCamel(_0x3cfca6[_0x561f0f(0x8d)]),'functionNode':'before'}),_0x3cfca6[_0x561f0f(0x8b)]&&_0x554207['set'](_0x3cfca6['afterScriptId'],{'datasetCode':_0x3cfca6[_0x561f0f(0x7a)],'operationType':snakeToCamel(_0x3cfca6[_0x561f0f(0x8d)]),'functionNode':'after'});}return _0x554207;}export function resolveRemoteScriptTarget(_0x382c40,_0x2779bf,_0x2885d7,_0xc59243,_0x23438e){const _0x5250f8=a160_0x24736e,_0xc4ee29=normalizeBffType(_0x2779bf[_0x5250f8(0x8c)]);if(!_0xc4ee29||!_0x2779bf[_0x5250f8(0x94)])return null;if(_0xc4ee29===_0x5250f8(0x87)){const _0x4c9087=(_0x2779bf['id']?_0x2885d7['get'](_0x2779bf['id']):undefined)??findHookLocationByRemoteId(_0xc59243,_0x2779bf['id']);if(!_0x4c9087)return null;const _0x4478ce=_0x4c9087[_0x5250f8(0x9b)]||_0x23438e[_0x5250f8(0x78)](_0x4c9087[_0x5250f8(0x7a)]),_0x2709f1=_0x4478ce??_0x4c9087[_0x5250f8(0x7a)],_0x33d507={..._0x4c9087,'alias':_0x4478ce},_0x582136=_0x5250f8(0x99)+_0x2709f1+'/'+_0x33d507['operationType']+'/'+_0x33d507[_0x5250f8(0x8f)]+'/'+_0x2779bf[_0x5250f8(0x94)];return{'lockKey':_0x582136,'filePath':resolveLocalFilePathFromLockKey(_0x382c40,_0x582136),'type':_0x5250f8(0x87),'hookLocation':_0x33d507};}const _0x431784=_0xc4ee29+'/'+_0x2779bf[_0x5250f8(0x94)];return{'lockKey':_0x431784,'filePath':resolveLocalFilePathFromLockKey(_0x382c40,_0x431784),'type':_0xc4ee29};}export async function ensureParentDirectory(_0x3450de){await mkdir(dirname(_0x3450de),{'recursive':!![]});}export async function fileExists(_0x3ccdd1){try{return await access(_0x3ccdd1,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x3f012b){const _0x32539e=a160_0x24736e;try{const _0x31932a=await stat(_0x3f012b);return _0x31932a[_0x32539e(0x9f)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x51d3e3,_0x6b7634){const _0x4beefc=a161_0x331d,_0x1cb924=_0x51d3e3();while(!![]){try{const _0x2470dc=-parseInt(_0x4beefc(0x177))/0x1+parseInt(_0x4beefc(0x17e))/0x2*(parseInt(_0x4beefc(0x181))/0x3)+parseInt(_0x4beefc(0x180))/0x4+parseInt(_0x4beefc(0x178))/0x5*(parseInt(_0x4beefc(0x17c))/0x6)+parseInt(_0x4beefc(0x179))/0x7+parseInt(_0x4beefc(0x17d))/0x8+-parseInt(_0x4beefc(0x17a))/0x9;if(_0x2470dc===_0x6b7634)break;else _0x1cb924['push'](_0x1cb924['shift']());}catch(_0x2e3e27){_0x1cb924['push'](_0x1cb924['shift']());}}}(a161_0x5adc,0x2826d));import{readFile}from'node:fs/promises';function a161_0x331d(_0x120d3d,_0x1ff36b){_0x120d3d=_0x120d3d-0x177;const _0x5adc4b=a161_0x5adc();let _0x331d4d=_0x5adc4b[_0x120d3d];return _0x331d4d;}import a161_0x4d5ec1 from'node:crypto';function a161_0x5adc(){const _0x1a8a03=['663VQYZca','hex','md5','264428UhlTQq','5apaiiK','633255eTpIfy','2796327tiqzyS','createHash','1818162nalmNZ','149032MvHyrV','236rreYpf','update','1205572lksciE'];a161_0x5adc=function(){return _0x1a8a03;};return a161_0x5adc();}export function computeContentHash(_0x59fa4d){const _0x217027=a161_0x331d;return a161_0x4d5ec1[_0x217027(0x17b)](_0x217027(0x183))[_0x217027(0x17f)](_0x59fa4d)['digest'](_0x217027(0x182));}export async function computeFileHash(_0x38bcba){const _0x5b9041=await readFile(_0x38bcba,'utf8');return computeContentHash(_0x5b9041);}
1
+ function a161_0x4c9f(_0x2d847f,_0x18b33d){_0x2d847f=_0x2d847f-0x94;const _0x56bea2=a161_0x56be();let _0x4c9f7b=_0x56bea2[_0x2d847f];return _0x4c9f7b;}(function(_0x4f99fb,_0x3b59a0){const _0x57ee7a=a161_0x4c9f,_0x8d1594=_0x4f99fb();while(!![]){try{const _0x6d5d1c=parseInt(_0x57ee7a(0x9a))/0x1*(parseInt(_0x57ee7a(0x9d))/0x2)+-parseInt(_0x57ee7a(0x9c))/0x3+parseInt(_0x57ee7a(0xa1))/0x4*(parseInt(_0x57ee7a(0x9b))/0x5)+-parseInt(_0x57ee7a(0x96))/0x6+parseInt(_0x57ee7a(0x97))/0x7*(parseInt(_0x57ee7a(0xa0))/0x8)+-parseInt(_0x57ee7a(0x9f))/0x9+-parseInt(_0x57ee7a(0x94))/0xa*(-parseInt(_0x57ee7a(0x95))/0xb);if(_0x6d5d1c===_0x3b59a0)break;else _0x8d1594['push'](_0x8d1594['shift']());}catch(_0x2b05c4){_0x8d1594['push'](_0x8d1594['shift']());}}}(a161_0x56be,0x1a983));import{readFile}from'node:fs/promises';function a161_0x56be(){const _0x24317d=['2432WmZTtg','4xmadvY','createHash','utf8','27680fpMjzY','2090qzDEDl','919176CzcQhE','133EkWFCb','digest','hex','101ngRdJv','51775UFeJYB','528021ieajdN','102cDTSwq','md5','981612KBhltk'];a161_0x56be=function(){return _0x24317d;};return a161_0x56be();}import a161_0x3e7dd5 from'node:crypto';export function computeContentHash(_0x1b94c9){const _0x507909=a161_0x4c9f;return a161_0x3e7dd5[_0x507909(0xa2)](_0x507909(0x9e))['update'](_0x1b94c9)[_0x507909(0x98)](_0x507909(0x99));}export async function computeFileHash(_0x365c49){const _0x2f05f3=a161_0x4c9f,_0xc56d42=await readFile(_0x365c49,_0x2f05f3(0xa3));return computeContentHash(_0xc56d42);}
@@ -1 +1 @@
1
- (function(_0x39c2dc,_0x4db2ed){const _0x1f1091=a162_0x53e1,_0x3d9094=_0x39c2dc();while(!![]){try{const _0x2618db=-parseInt(_0x1f1091(0x1c9))/0x1+parseInt(_0x1f1091(0x1d0))/0x2+-parseInt(_0x1f1091(0x1c1))/0x3*(-parseInt(_0x1f1091(0x1ce))/0x4)+parseInt(_0x1f1091(0x1c4))/0x5*(parseInt(_0x1f1091(0x1c5))/0x6)+-parseInt(_0x1f1091(0x1d4))/0x7*(-parseInt(_0x1f1091(0x1d1))/0x8)+-parseInt(_0x1f1091(0x1c3))/0x9*(-parseInt(_0x1f1091(0x1bf))/0xa)+-parseInt(_0x1f1091(0x1cd))/0xb;if(_0x2618db===_0x4db2ed)break;else _0x3d9094['push'](_0x3d9094['shift']());}catch(_0x861e0b){_0x3d9094['push'](_0x3d9094['shift']());}}}(a162_0x4a96,0xb1024));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a162_0x53e1(_0x3cccdc,_0x340207){_0x3cccdc=_0x3cccdc-0x1be;const _0x4a96cc=a162_0x4a96();let _0x53e123=_0x4a96cc[_0x3cccdc];return _0x53e123;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x28f71f,_0x51e876,_0x1c671d,_0x5cb159){const _0x597ea4=a162_0x53e1,_0x281e4e={'apps':_0x28f71f[_0x597ea4(0x1cb)]&&typeof _0x28f71f['apps']===_0x597ea4(0x1d5)?_0x28f71f[_0x597ea4(0x1cb)]:{}};let _0xd8730d=_0x281e4e['apps'][_0x51e876];if(!_0xd8730d)return _0xd8730d={'scriptsRoot':_0x1c671d,'lastSync':'','functions':{}},_0x281e4e[_0x597ea4(0x1cb)][_0x51e876]=_0xd8730d,{'lockData':_0x281e4e,'appLock':_0xd8730d};if(!_0xd8730d[_0x597ea4(0x1c2)])_0xd8730d[_0x597ea4(0x1c2)]=_0x1c671d;else{if(_0xd8730d[_0x597ea4(0x1c2)]!==_0x1c671d)throw new Error(_0x5cb159+_0x597ea4(0x1cc)+(_0x597ea4(0x1c6)+_0x1c671d+'\x22\x20vs\x20lock\x20\x22'+_0xd8730d[_0x597ea4(0x1c2)]+_0x597ea4(0x1d3))+_0x597ea4(0x1ca));}return!_0xd8730d['functions']&&(_0xd8730d[_0x597ea4(0x1c8)]={}),!_0xd8730d[_0x597ea4(0x1d2)]&&(_0xd8730d['lastSync']=''),{'lockData':_0x281e4e,'appLock':_0xd8730d};}function a162_0x4a96(){const _0x37008e=['\x22.\x20','21Bdnsne','object','parse','50YebtNv','utf8','218217sZnLAI','scriptsRoot','38349mhoKpN','16190jREFKo','2154ZWFiaG','current\x20\x22','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','functions','1299755OLYxgC','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps',':\x20scriptsRoot\x20mismatch\x20—\x20','24097161IUOxmU','76rGCKMk','code','581802xLttfh','3623320tyckwj','lastSync'];a162_0x4a96=function(){return _0x37008e;};return a162_0x4a96();}export async function readBffLockFile(_0x342564){const _0x30a390=a162_0x53e1;try{const _0x19db5b=await readFile(_0x342564,_0x30a390(0x1c0)),_0x514b43=JSON[_0x30a390(0x1be)](_0x19db5b);return{'apps':_0x514b43[_0x30a390(0x1cb)]&&typeof _0x514b43['apps']===_0x30a390(0x1d5)?_0x514b43[_0x30a390(0x1cb)]:{}};}catch(_0x5a12ab){if(_0x5a12ab[_0x30a390(0x1cf)]==='ENOENT')return null;throw new Error(_0x30a390(0x1c7)+String(_0x5a12ab));}}export async function writeBffLockFile(_0x3fa1bf,_0x279622){const _0x41e3ce=a162_0x53e1;await mkdir(dirname(_0x3fa1bf),{'recursive':!![]}),await writeFile(_0x3fa1bf,JSON['stringify'](_0x279622,null,0x2),_0x41e3ce(0x1c0));}
1
+ (function(_0x3eda66,_0x578f81){const _0x1f078f=a162_0x5d67,_0x3cb70c=_0x3eda66();while(!![]){try{const _0x5bb80e=-parseInt(_0x1f078f(0x97))/0x1*(parseInt(_0x1f078f(0xa0))/0x2)+-parseInt(_0x1f078f(0x9b))/0x3*(parseInt(_0x1f078f(0x95))/0x4)+parseInt(_0x1f078f(0xa6))/0x5*(-parseInt(_0x1f078f(0xa2))/0x6)+-parseInt(_0x1f078f(0xa3))/0x7+parseInt(_0x1f078f(0xaa))/0x8+-parseInt(_0x1f078f(0x9e))/0x9*(parseInt(_0x1f078f(0x99))/0xa)+parseInt(_0x1f078f(0x96))/0xb*(parseInt(_0x1f078f(0xa4))/0xc);if(_0x5bb80e===_0x578f81)break;else _0x3cb70c['push'](_0x3cb70c['shift']());}catch(_0x46f2c8){_0x3cb70c['push'](_0x3cb70c['shift']());}}}(a162_0x3b6f,0x8446e));function a162_0x5d67(_0x38836e,_0x5a5a63){_0x38836e=_0x38836e-0x91;const _0x3b6ff3=a162_0x3b6f();let _0x5d6780=_0x3b6ff3[_0x38836e];return _0x5d6780;}function a162_0x3b6f(){const _0x3723a3=['7787528nGWCZN','\x22\x20vs\x20lock\x20\x22','lastSync','apps','\x22.\x20','148UIPUHS','11SraWgK','1841wancRr','code','367320TIQwXc','ENOENT','52257EomsSP','object','current\x20\x22','45igAKqf','scriptsRoot','706BKcdcU','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','4848294dFGEQU','2489529JdnEGh','26521164eylOLb','utf8','5QAycse','functions','parse',':\x20scriptsRoot\x20mismatch\x20—\x20'];a162_0x3b6f=function(){return _0x3723a3;};return a162_0x3b6f();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x318260,_0x40f738,_0x281f7e,_0x22d85e){const _0x59594b=a162_0x5d67,_0x12a908={'apps':_0x318260[_0x59594b(0x93)]&&typeof _0x318260[_0x59594b(0x93)]==='object'?_0x318260[_0x59594b(0x93)]:{}};let _0x338088=_0x12a908[_0x59594b(0x93)][_0x40f738];if(!_0x338088)return _0x338088={'scriptsRoot':_0x281f7e,'lastSync':'','functions':{}},_0x12a908[_0x59594b(0x93)][_0x40f738]=_0x338088,{'lockData':_0x12a908,'appLock':_0x338088};if(!_0x338088[_0x59594b(0x9f)])_0x338088[_0x59594b(0x9f)]=_0x281f7e;else{if(_0x338088[_0x59594b(0x9f)]!==_0x281f7e)throw new Error(_0x22d85e+_0x59594b(0xa9)+(_0x59594b(0x9d)+_0x281f7e+_0x59594b(0x91)+_0x338088[_0x59594b(0x9f)]+_0x59594b(0x94))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x338088[_0x59594b(0xa7)]&&(_0x338088['functions']={}),!_0x338088[_0x59594b(0x92)]&&(_0x338088[_0x59594b(0x92)]=''),{'lockData':_0x12a908,'appLock':_0x338088};}export async function readBffLockFile(_0x337a32){const _0x3a1f42=a162_0x5d67;try{const _0x4737f3=await readFile(_0x337a32,_0x3a1f42(0xa5)),_0x30fe3b=JSON[_0x3a1f42(0xa8)](_0x4737f3);return{'apps':_0x30fe3b[_0x3a1f42(0x93)]&&typeof _0x30fe3b[_0x3a1f42(0x93)]===_0x3a1f42(0x9c)?_0x30fe3b[_0x3a1f42(0x93)]:{}};}catch(_0x71e527){if(_0x71e527[_0x3a1f42(0x98)]===_0x3a1f42(0x9a))return null;throw new Error(_0x3a1f42(0xa1)+String(_0x71e527));}}export async function writeBffLockFile(_0x2aecfe,_0x494757){const _0x58381d=a162_0x5d67;await mkdir(dirname(_0x2aecfe),{'recursive':!![]}),await writeFile(_0x2aecfe,JSON['stringify'](_0x494757,null,0x2),_0x58381d(0xa5));}
@@ -1 +1 @@
1
- (function(_0x30d946,_0x1c605d){const _0x169963=a164_0x1af3,_0x53ffe4=_0x30d946();while(!![]){try{const _0x129706=parseInt(_0x169963(0x19f))/0x1*(-parseInt(_0x169963(0x1aa))/0x2)+-parseInt(_0x169963(0x1a9))/0x3+-parseInt(_0x169963(0x1af))/0x4+-parseInt(_0x169963(0x19e))/0x5+-parseInt(_0x169963(0x1ad))/0x6*(parseInt(_0x169963(0x1a5))/0x7)+parseInt(_0x169963(0x1a2))/0x8*(parseInt(_0x169963(0x1a6))/0x9)+parseInt(_0x169963(0x1a0))/0xa;if(_0x129706===_0x1c605d)break;else _0x53ffe4['push'](_0x53ffe4['shift']());}catch(_0x5970f6){_0x53ffe4['push'](_0x53ffe4['shift']());}}}(a164_0x35c8,0x41863));function a164_0x1af3(_0x5d1d33,_0x46c953){_0x5d1d33=_0x5d1d33-0x19d;const _0x35c8ef=a164_0x35c8();let _0x1af31f=_0x35c8ef[_0x5d1d33];return _0x1af31f;}export function snakeToCamel(_0x42ce3e){const _0xe44318=a164_0x1af3;return _0x42ce3e[_0xe44318(0x1a4)]()[_0xe44318(0x19d)](/_([a-z])/g,(_0x4246ba,_0x1b0f82)=>_0x1b0f82[_0xe44318(0x1ab)]());}export function findHookLocationByRemoteId(_0x25e2a1,_0x9ca750){const _0x3a7736=a164_0x1af3;if(!_0x9ca750)return undefined;for(const _0x4a6cbd of Object['values'](_0x25e2a1)){if(_0x4a6cbd['remoteId']===_0x9ca750&&_0x4a6cbd[_0x3a7736(0x1ac)]&&_0x4a6cbd['operationType']&&_0x4a6cbd[_0x3a7736(0x1a8)])return{'datasetCode':_0x4a6cbd[_0x3a7736(0x1ac)],'operationType':_0x4a6cbd['operationType'],'functionNode':_0x4a6cbd[_0x3a7736(0x1a8)]};}return undefined;}export function extractScriptDescription(_0x10fba7){const _0x73e1db=a164_0x1af3,_0x290bd0=_0x10fba7[_0x73e1db(0x1a3)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x290bd0?.[0x1]?.[_0x73e1db(0x1ae)]()||undefined;}export function isValidBffFunctionName(_0x224ce4){const _0x1290b7=a164_0x1af3;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x1290b7(0x1a7)](_0x224ce4);}function a164_0x35c8(){const _0x5e088e=['24GpYFzD','trim','781240JXXdqQ','replace','1490825IrcdLH','4Fsjrfa','8881020ZQWKah','before','2472KkdwvA','match','toLowerCase','534324vhqEQQ','11394ZZaIJP','test','functionNode','462726AiPsOr','28932JAjamQ','toUpperCase','datasetCode'];a164_0x35c8=function(){return _0x5e088e;};return a164_0x35c8();}export function normalizeHookFunctionNode(_0x3127e5){const _0x19137=a164_0x1af3;if(!_0x3127e5)return undefined;const _0x125a2c=_0x3127e5['trim']()[_0x19137(0x1a4)]();if(_0x125a2c===_0x19137(0x1a1)||_0x125a2c==='after')return _0x125a2c;return undefined;}
1
+ (function(_0x1c5904,_0xc82e8f){const _0x5a9404=a164_0x59ef,_0x372bf5=_0x1c5904();while(!![]){try{const _0x50d346=parseInt(_0x5a9404(0x7c))/0x1*(-parseInt(_0x5a9404(0x7b))/0x2)+parseInt(_0x5a9404(0x80))/0x3*(parseInt(_0x5a9404(0x76))/0x4)+-parseInt(_0x5a9404(0x79))/0x5*(parseInt(_0x5a9404(0x77))/0x6)+parseInt(_0x5a9404(0x7f))/0x7*(-parseInt(_0x5a9404(0x7d))/0x8)+parseInt(_0x5a9404(0x83))/0x9+parseInt(_0x5a9404(0x84))/0xa+parseInt(_0x5a9404(0x78))/0xb;if(_0x50d346===_0xc82e8f)break;else _0x372bf5['push'](_0x372bf5['shift']());}catch(_0x2cb1cd){_0x372bf5['push'](_0x372bf5['shift']());}}}(a164_0x73b4,0x47f61));export function snakeToCamel(_0xd16b4d){const _0x1224c9=a164_0x59ef;return _0xd16b4d[_0x1224c9(0x72)]()[_0x1224c9(0x81)](/_([a-z])/g,(_0x5e2546,_0x12405a)=>_0x12405a[_0x1224c9(0x85)]());}export function findHookLocationByRemoteId(_0x276b76,_0x324c71){const _0x4d0f21=a164_0x59ef;if(!_0x324c71)return undefined;for(const _0x335d30 of Object[_0x4d0f21(0x70)](_0x276b76)){if(_0x335d30[_0x4d0f21(0x7e)]===_0x324c71&&_0x335d30[_0x4d0f21(0x71)]&&_0x335d30[_0x4d0f21(0x75)]&&_0x335d30[_0x4d0f21(0x82)])return{'datasetCode':_0x335d30[_0x4d0f21(0x71)],'operationType':_0x335d30[_0x4d0f21(0x75)],'functionNode':_0x335d30['functionNode']};}return undefined;}export function extractScriptDescription(_0xf43e7e){const _0x1e451d=a164_0x59ef,_0x1b689a=_0xf43e7e[_0x1e451d(0x86)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x1b689a?.[0x1]?.[_0x1e451d(0x73)]()||undefined;}function a164_0x73b4(){const _0x4ea7f0=['trim','after','operationType','26724UAskUQ','122178rOnIyA','7402978hTYGeW','75fLLNho','before','5464SRlddG','172kUUhed','3663176wFEYuh','remoteId','7BSbWnl','114HpjwYL','replace','functionNode','1598769UrEiAv','4234820QRTZOz','toUpperCase','match','values','datasetCode','toLowerCase'];a164_0x73b4=function(){return _0x4ea7f0;};return a164_0x73b4();}function a164_0x59ef(_0xc1d5c1,_0x1701b9){_0xc1d5c1=_0xc1d5c1-0x70;const _0x73b4bf=a164_0x73b4();let _0x59ef93=_0x73b4bf[_0xc1d5c1];return _0x59ef93;}export function isValidBffFunctionName(_0x31efc0){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x31efc0);}export function normalizeHookFunctionNode(_0x4570c4){const _0x3d5479=a164_0x59ef;if(!_0x4570c4)return undefined;const _0x2be1e5=_0x4570c4['trim']()[_0x3d5479(0x72)]();if(_0x2be1e5===_0x3d5479(0x7a)||_0x2be1e5===_0x3d5479(0x74))return _0x2be1e5;return undefined;}
@@ -1 +1 @@
1
- (function(_0x195331,_0x4831c3){const _0x5252f6=a165_0x3706,_0x296495=_0x195331();while(!![]){try{const _0x1b98fb=-parseInt(_0x5252f6(0xd0))/0x1*(parseInt(_0x5252f6(0xea))/0x2)+parseInt(_0x5252f6(0xe6))/0x3*(parseInt(_0x5252f6(0xe9))/0x4)+parseInt(_0x5252f6(0xd5))/0x5+parseInt(_0x5252f6(0xd4))/0x6+-parseInt(_0x5252f6(0xe0))/0x7*(parseInt(_0x5252f6(0xdc))/0x8)+parseInt(_0x5252f6(0xd3))/0x9+parseInt(_0x5252f6(0xe2))/0xa*(-parseInt(_0x5252f6(0xcf))/0xb);if(_0x1b98fb===_0x4831c3)break;else _0x296495['push'](_0x296495['shift']());}catch(_0xed4887){_0x296495['push'](_0x296495['shift']());}}}(a165_0x52ab,0xea8f1));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x13bfd7){const _0x1fbfb2=a165_0x3706;if(cache[_0x1fbfb2(0xe5)](_0x13bfd7))return cache[_0x1fbfb2(0xe4)](_0x13bfd7);const _0x4f9bad=await listDatasets(_0x13bfd7),_0x5a70e2=new Map();for(const _0xd3d310 of _0x4f9bad){const _0x1d8971=_0xd3d310['dbtableConfig'];_0x1d8971?.['dbId']!=null&&_0x5a70e2[_0x1fbfb2(0xdf)](_0x1d8971[_0x1fbfb2(0xd7)],_0x1d8971['dbName']??_0x1fbfb2(0xd8)+_0x1d8971[_0x1fbfb2(0xd7)]);}const _0x33b30d=[..._0x5a70e2['entries']()]['map'](([_0x4a124e,_0x3bf982])=>({'dbId':_0x4a124e,'dbName':_0x3bf982}));return cache[_0x1fbfb2(0xdf)](_0x13bfd7,_0x33b30d),_0x33b30d;}function a165_0x3706(_0x476018,_0x4f6ff1){_0x476018=_0x476018-0xcc;const _0x52ab38=a165_0x52ab();let _0x370632=_0x52ab38[_0x476018];return _0x370632;}function a165_0x52ab(){const _0x42f790=['6503bSFQyT','map','20710ZZAJsN','\x22.\x20Available:\x20','get','has','5350953jUvSrw','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20matches\x20multiple\x20databases:\x20','4JrUzzM','63256baDeWs','includes','.\x20Be\x20more\x20specific.','filter','4895WdGUsN','51Vcfsez','length','join','8864937bFvrfs','1346610UmCovw','3031725KHBsYj','toLowerCase','dbId','db-','find','dbName','isNaN','896ZPjODC','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','No\x20database\x20matching\x20\x22','set'];a165_0x52ab=function(){return _0x42f790;};return a165_0x52ab();}export async function resolveDb(_0x3ae19a,_0x1ed2a6){const _0x32b412=a165_0x3706,_0x14f1d7=await listDatabases(_0x3ae19a);if(_0x14f1d7[_0x32b412(0xd1)]===0x0)return{'resolved':[],'error':_0x32b412(0xdd)+_0x3ae19a+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x1ed2a6)return{'resolved':_0x14f1d7};const _0x2c7327=Number(_0x1ed2a6);if(!Number[_0x32b412(0xdb)](_0x2c7327)){const _0x4fc69e=_0x14f1d7[_0x32b412(0xd9)](_0x4d0b85=>_0x4d0b85[_0x32b412(0xd7)]===_0x2c7327);if(_0x4fc69e)return{'resolved':[_0x4fc69e]};}const _0x347687=_0x1ed2a6[_0x32b412(0xd6)](),_0x559fcd=_0x14f1d7[_0x32b412(0xce)](_0x1f6692=>_0x1f6692[_0x32b412(0xda)][_0x32b412(0xd6)]()[_0x32b412(0xcc)](_0x347687));if(_0x559fcd[_0x32b412(0xd1)]>0x0)return{'resolved':_0x559fcd};const _0x99eca2=_0x14f1d7[_0x32b412(0xe1)](_0x47d041=>_0x47d041[_0x32b412(0xda)]+'\x20('+_0x47d041[_0x32b412(0xd7)]+')')['join'](',\x20');return{'resolved':[],'error':_0x32b412(0xde)+_0x1ed2a6+'\x22\x20under\x20app\x20\x22'+_0x3ae19a+_0x32b412(0xe3)+_0x99eca2+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x316ce0,_0x337329){const _0x5cce84=a165_0x3706,{resolved:_0x1ae89b,error:_0x1b9f73}=await resolveDb(_0x316ce0,_0x337329);if(_0x1b9f73)return{'db':null,'error':_0x1b9f73};if(_0x1ae89b['length']===0x1)return{'db':_0x1ae89b[0x0]};if(!_0x337329){const _0x5ec68f=_0x1ae89b[_0x5cce84(0xe1)](_0x17bc3f=>_0x17bc3f[_0x5cce84(0xda)]+'\x20('+_0x17bc3f[_0x5cce84(0xd7)]+')')[_0x5cce84(0xd2)](',\x20');return{'db':null,'error':_0x5cce84(0xe7)+_0x5ec68f};}const _0x2ff742=_0x1ae89b[_0x5cce84(0xe1)](_0x5c2605=>_0x5c2605['dbName']+'\x20('+_0x5c2605[_0x5cce84(0xd7)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x337329+_0x5cce84(0xe8)+_0x2ff742+_0x5cce84(0xcd)};}export async function getDbName(_0x3adf26,_0x25b65e){const _0x231fcf=a165_0x3706,_0x4a4d01=await listDatabases(_0x3adf26);return _0x4a4d01[_0x231fcf(0xd9)](_0x531117=>_0x531117[_0x231fcf(0xd7)]===_0x25b65e)?.[_0x231fcf(0xda)];}
1
+ (function(_0x5635ce,_0x37fef8){const _0x4fa156=a165_0x2dab,_0x3a3b1e=_0x5635ce();while(!![]){try{const _0x1cf89e=parseInt(_0x4fa156(0x172))/0x1+-parseInt(_0x4fa156(0x16f))/0x2*(-parseInt(_0x4fa156(0x161))/0x3)+parseInt(_0x4fa156(0x17c))/0x4+parseInt(_0x4fa156(0x16e))/0x5+-parseInt(_0x4fa156(0x177))/0x6+-parseInt(_0x4fa156(0x167))/0x7+-parseInt(_0x4fa156(0x17a))/0x8*(parseInt(_0x4fa156(0x174))/0x9);if(_0x1cf89e===_0x37fef8)break;else _0x3a3b1e['push'](_0x3a3b1e['shift']());}catch(_0x1522c6){_0x3a3b1e['push'](_0x3a3b1e['shift']());}}}(a165_0xe1e8,0x7da9a));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a165_0x2dab(_0x28287f,_0x3617ab){_0x28287f=_0x28287f-0x160;const _0xe1e867=a165_0xe1e8();let _0x2dab7c=_0xe1e867[_0x28287f];return _0x2dab7c;}export async function listDatabases(_0x11a274){const _0x2c9622=a165_0x2dab;if(cache['has'](_0x11a274))return cache[_0x2c9622(0x16d)](_0x11a274);const _0x510096=await listDatasets(_0x11a274),_0x29baa1=new Map();for(const _0x1ab680 of _0x510096){const _0x2970ec=_0x1ab680[_0x2c9622(0x175)];_0x2970ec?.[_0x2c9622(0x170)]!=null&&_0x29baa1[_0x2c9622(0x17b)](_0x2970ec[_0x2c9622(0x170)],_0x2970ec[_0x2c9622(0x16c)]??_0x2c9622(0x166)+_0x2970ec[_0x2c9622(0x170)]);}const _0x124a59=[..._0x29baa1[_0x2c9622(0x165)]()][_0x2c9622(0x171)](([_0x3c5afe,_0x2e542c])=>({'dbId':_0x3c5afe,'dbName':_0x2e542c}));return cache[_0x2c9622(0x17b)](_0x11a274,_0x124a59),_0x124a59;}export async function resolveDb(_0x1c8cd7,_0x1a2f1a){const _0x3a0921=a165_0x2dab,_0x243d37=await listDatabases(_0x1c8cd7);if(_0x243d37[_0x3a0921(0x160)]===0x0)return{'resolved':[],'error':_0x3a0921(0x163)+_0x1c8cd7+_0x3a0921(0x176)};if(!_0x1a2f1a)return{'resolved':_0x243d37};const _0x26242a=Number(_0x1a2f1a);if(!Number[_0x3a0921(0x173)](_0x26242a)){const _0x35235d=_0x243d37['find'](_0x248833=>_0x248833['dbId']===_0x26242a);if(_0x35235d)return{'resolved':[_0x35235d]};}const _0x3e182e=_0x1a2f1a[_0x3a0921(0x16b)](),_0x35f5c2=_0x243d37[_0x3a0921(0x164)](_0x59004c=>_0x59004c[_0x3a0921(0x16c)][_0x3a0921(0x16b)]()[_0x3a0921(0x179)](_0x3e182e));if(_0x35f5c2['length']>0x0)return{'resolved':_0x35f5c2};const _0x7e4418=_0x243d37[_0x3a0921(0x171)](_0x43d1d3=>_0x43d1d3[_0x3a0921(0x16c)]+'\x20('+_0x43d1d3[_0x3a0921(0x170)]+')')[_0x3a0921(0x162)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x1a2f1a+_0x3a0921(0x17e)+_0x1c8cd7+'\x22.\x20Available:\x20'+_0x7e4418+_0x3a0921(0x178)};}export async function resolveOneDb(_0x3f3efa,_0x7b61e0){const _0x21cfff=a165_0x2dab,{resolved:_0x4e1646,error:_0x40c854}=await resolveDb(_0x3f3efa,_0x7b61e0);if(_0x40c854)return{'db':null,'error':_0x40c854};if(_0x4e1646['length']===0x1)return{'db':_0x4e1646[0x0]};if(!_0x7b61e0){const _0x356321=_0x4e1646['map'](_0x4a4949=>_0x4a4949['dbName']+'\x20('+_0x4a4949['dbId']+')')['join'](',\x20');return{'db':null,'error':_0x21cfff(0x16a)+_0x356321};}const _0x2e7964=_0x4e1646['map'](_0x5730c1=>_0x5730c1[_0x21cfff(0x16c)]+'\x20('+_0x5730c1[_0x21cfff(0x170)]+')')[_0x21cfff(0x162)](',\x20');return{'db':null,'error':'\x22'+_0x7b61e0+_0x21cfff(0x169)+_0x2e7964+_0x21cfff(0x168)};}export async function getDbName(_0x4b310f,_0x7dc1f9){const _0x2a4ed9=a165_0x2dab,_0x2ad601=await listDatabases(_0x4b310f);return _0x2ad601[_0x2a4ed9(0x17d)](_0x5de75a=>_0x5de75a[_0x2a4ed9(0x170)]===_0x7dc1f9)?.[_0x2a4ed9(0x16c)];}function a165_0xe1e8(){const _0x4f10c5=['includes','24lfniHm','set','1332480xUeHqE','find','\x22\x20under\x20app\x20\x22','length','360051hfZOrx','join','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','filter','entries','db-','2929556AsZDRn','.\x20Be\x20more\x20specific.','\x22\x20matches\x20multiple\x20databases:\x20','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','toLowerCase','dbName','get','2184245XIlJNf','14jhHJWl','dbId','map','327605uCsGcN','isNaN','829017BByvmx','dbtableConfig','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','4368792wlsPey','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'];a165_0xe1e8=function(){return _0x4f10c5;};return a165_0xe1e8();}
@@ -1 +1 @@
1
- const a166_0x173cd3=a166_0x4f68;(function(_0x44894c,_0x5e6057){const _0xc10492=a166_0x4f68,_0x5d2678=_0x44894c();while(!![]){try{const _0x50f724=parseInt(_0xc10492(0x1cf))/0x1+parseInt(_0xc10492(0x1ce))/0x2*(parseInt(_0xc10492(0x1d7))/0x3)+parseInt(_0xc10492(0x1c6))/0x4+parseInt(_0xc10492(0x1c7))/0x5+parseInt(_0xc10492(0x1c9))/0x6*(-parseInt(_0xc10492(0x1ca))/0x7)+-parseInt(_0xc10492(0x1cb))/0x8*(parseInt(_0xc10492(0x1cd))/0x9)+-parseInt(_0xc10492(0x1d3))/0xa*(parseInt(_0xc10492(0x1d1))/0xb);if(_0x50f724===_0x5e6057)break;else _0x5d2678['push'](_0x5d2678['shift']());}catch(_0x38e472){_0x5d2678['push'](_0x5d2678['shift']());}}}(a166_0x3aa6,0x6c133));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a166_0x3aa6(){const _0x8de0d=['14vhzBpc','96ofyltF','page','471267Tygjlf','4192UduNVp','606971xbsXdH','appPagesDir','402578gnJfjB','page.lock.json','340oxclKk','.rabetbase','cwd','.json','339ktRNaz','3369580UXRtTl','4200915YcJSJW','toUpperCase','633102ztNaop'];a166_0x3aa6=function(){return _0x8de0d;};return a166_0x3aa6();}function a166_0x4f68(_0x781026,_0x443825){_0x781026=_0x781026-0x1c6;const _0x3aa67b=a166_0x3aa6();let _0x4f6808=_0x3aa67b[_0x781026];return _0x4f6808;}export function loadPageProjectConfig(_0x4b526b,_0x4a7afd=process[a166_0x173cd3(0x1d5)]()){const _0x55c0fe=a166_0x173cd3,_0x1d77ef=resolve(_0x4a7afd),_0x2816b2=join(_0x1d77ef,_0x55c0fe(0x1d4),_0x55c0fe(0x1cc));return{'projectRoot':_0x1d77ef,'pagesBaseDir':_0x2816b2,'appPagesDir':join(_0x2816b2,_0x4b526b),'lockFilePath':join(_0x1d77ef,_0x55c0fe(0x1d4),_0x55c0fe(0x1d2))};}export function buildPageFileName(_0x41341c,_0x4a53e9){const _0x4a832e=a166_0x173cd3;return _0x41341c+'-'+String(_0x4a53e9)[_0x4a832e(0x1c8)]()+_0x4a832e(0x1d6);}export function resolvePageFilePath(_0x45e356,_0x1a866b,_0xf2565c){const _0xc81c5e=a166_0x173cd3;return join(_0x45e356[_0xc81c5e(0x1d0)],buildPageFileName(_0x1a866b,_0xf2565c));}export async function ensureParentDirectory(_0x2d5486){await mkdir(dirname(_0x2d5486),{'recursive':!![]});}export async function fileExists(_0x1f71e1){try{return await access(_0x1f71e1,constants['F_OK']),!![];}catch{return![];}}
1
+ const a166_0x2141b5=a166_0x5b69;(function(_0x17fad3,_0x1250f6){const _0x4a1b96=a166_0x5b69,_0x1d6966=_0x17fad3();while(!![]){try{const _0x184f3d=parseInt(_0x4a1b96(0x85))/0x1*(parseInt(_0x4a1b96(0x84))/0x2)+parseInt(_0x4a1b96(0x81))/0x3*(parseInt(_0x4a1b96(0x7e))/0x4)+parseInt(_0x4a1b96(0x7d))/0x5+-parseInt(_0x4a1b96(0x88))/0x6+parseInt(_0x4a1b96(0x87))/0x7+parseInt(_0x4a1b96(0x83))/0x8+-parseInt(_0x4a1b96(0x80))/0x9;if(_0x184f3d===_0x1250f6)break;else _0x1d6966['push'](_0x1d6966['shift']());}catch(_0x27bbe9){_0x1d6966['push'](_0x1d6966['shift']());}}}(a166_0x2072,0x70b14));import{constants}from'node:fs';function a166_0x2072(){const _0x1737b5=['537912ymmgaL','cwd','.rabetbase','page.lock.json','997850kWTidI','68DpYzoi','.json','9744273bhDbyL','32646acTaYF','F_OK','4329168PQjqjS','102246NJooTc','1MBgaAw','appPagesDir','4599728NlvntE'];a166_0x2072=function(){return _0x1737b5;};return a166_0x2072();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x5cf6fb,_0x1caf9b=process[a166_0x2141b5(0x89)]()){const _0x5e5815=a166_0x2141b5,_0x4c83c9=resolve(_0x1caf9b),_0x1d2841=join(_0x4c83c9,_0x5e5815(0x7b),'page');return{'projectRoot':_0x4c83c9,'pagesBaseDir':_0x1d2841,'appPagesDir':join(_0x1d2841,_0x5cf6fb),'lockFilePath':join(_0x4c83c9,_0x5e5815(0x7b),_0x5e5815(0x7c))};}export function buildPageFileName(_0x25d824,_0x5d3bb8){const _0x42b466=a166_0x2141b5;return _0x25d824+'-'+String(_0x5d3bb8)['toUpperCase']()+_0x42b466(0x7f);}export function resolvePageFilePath(_0xec208a,_0x377114,_0x4cdfea){const _0x349433=a166_0x2141b5;return join(_0xec208a[_0x349433(0x86)],buildPageFileName(_0x377114,_0x4cdfea));}function a166_0x5b69(_0x5c87e1,_0x285202){_0x5c87e1=_0x5c87e1-0x7b;const _0x207224=a166_0x2072();let _0x5b69c=_0x207224[_0x5c87e1];return _0x5b69c;}export async function ensureParentDirectory(_0x559bcf){await mkdir(dirname(_0x559bcf),{'recursive':!![]});}export async function fileExists(_0x137590){const _0x29e199=a166_0x2141b5;try{return await access(_0x137590,constants[_0x29e199(0x82)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x184bee,_0x36af60){const _0x3694a3=a167_0x23f9,_0x1116d2=_0x184bee();while(!![]){try{const _0xb2b953=parseInt(_0x3694a3(0x17a))/0x1+-parseInt(_0x3694a3(0x180))/0x2*(parseInt(_0x3694a3(0x17b))/0x3)+-parseInt(_0x3694a3(0x188))/0x4+parseInt(_0x3694a3(0x183))/0x5+parseInt(_0x3694a3(0x17e))/0x6*(parseInt(_0x3694a3(0x179))/0x7)+parseInt(_0x3694a3(0x17c))/0x8*(-parseInt(_0x3694a3(0x182))/0x9)+parseInt(_0x3694a3(0x187))/0xa;if(_0xb2b953===_0x36af60)break;else _0x1116d2['push'](_0x1116d2['shift']());}catch(_0x4b08c2){_0x1116d2['push'](_0x1116d2['shift']());}}}(a167_0x35c6,0x89cc7));import a167_0x4d1ab6 from'node:crypto';function a167_0x35c6(){const _0x3e9ac3=['digest','stringify','createHash','9009510zelilX','130632mvyaLq','parse','84xyykxx','150345NQmFWd','9HQxLfC','1282984ieRzcL','hex','399210xKGJCG','md5','591350gMLWfY','utf8','45MphsEX','2181275fsoZbd'];a167_0x35c6=function(){return _0x3e9ac3;};return a167_0x35c6();}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x43304c){const _0x9c93e0=a167_0x23f9;return JSON[_0x9c93e0(0x185)](JSON[_0x9c93e0(0x189)](_0x43304c),null,0x2)+'\x0a';}export function computePageContentHash(_0x31106e){const _0x55a454=a167_0x23f9;return a167_0x4d1ab6[_0x55a454(0x186)](_0x55a454(0x17f))['update'](_0x31106e)[_0x55a454(0x184)](_0x55a454(0x17d));}export function computeSerializedSchemaHash(_0x1de675){return computePageContentHash(serializePageSchemaForFile(_0x1de675));}function a167_0x23f9(_0xaeb7af,_0x4123c2){_0xaeb7af=_0xaeb7af-0x179;const _0x35c6dc=a167_0x35c6();let _0x23f91b=_0x35c6dc[_0xaeb7af];return _0x23f91b;}export async function computePageFileHash(_0x33a406){const _0x1ebb25=a167_0x23f9,_0x57052b=await readFile(_0x33a406,_0x1ebb25(0x181));return computePageContentHash(_0x57052b);}
1
+ (function(_0x130cd1,_0x5f524c){const _0x1f3e54=a167_0x31d3,_0x43ba70=_0x130cd1();while(!![]){try{const _0x591091=-parseInt(_0x1f3e54(0x17e))/0x1*(parseInt(_0x1f3e54(0x187))/0x2)+-parseInt(_0x1f3e54(0x17d))/0x3*(parseInt(_0x1f3e54(0x188))/0x4)+parseInt(_0x1f3e54(0x180))/0x5*(parseInt(_0x1f3e54(0x183))/0x6)+-parseInt(_0x1f3e54(0x184))/0x7+-parseInt(_0x1f3e54(0x176))/0x8+parseInt(_0x1f3e54(0x178))/0x9*(-parseInt(_0x1f3e54(0x17f))/0xa)+-parseInt(_0x1f3e54(0x17c))/0xb*(-parseInt(_0x1f3e54(0x17b))/0xc);if(_0x591091===_0x5f524c)break;else _0x43ba70['push'](_0x43ba70['shift']());}catch(_0x228b28){_0x43ba70['push'](_0x43ba70['shift']());}}}(a167_0x4303,0x6c1e0));function a167_0x31d3(_0x553d55,_0x3f8c8c){_0x553d55=_0x553d55-0x176;const _0x430300=a167_0x4303();let _0x31d3fc=_0x430300[_0x553d55];return _0x31d3fc;}import a167_0x38daf8 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x4fd65d){const _0x62e662=a167_0x31d3;return JSON[_0x62e662(0x186)](JSON[_0x62e662(0x182)](_0x4fd65d),null,0x2)+'\x0a';}export function computePageContentHash(_0x46e26d){const _0x19c387=a167_0x31d3;return a167_0x38daf8[_0x19c387(0x177)](_0x19c387(0x181))['update'](_0x46e26d)[_0x19c387(0x17a)](_0x19c387(0x185));}function a167_0x4303(){const _0x36bda7=['212LSpErs','5706496GrxmuS','createHash','273447VmuLcP','utf8','digest','96wCNkGL','3834380mePATM','27282FrfRAk','2244nTVycn','140fhzNCV','5KqeoMy','md5','parse','1524282QodzNg','2298961nzoSsC','hex','stringify','580AsdgrX'];a167_0x4303=function(){return _0x36bda7;};return a167_0x4303();}export function computeSerializedSchemaHash(_0x25792a){return computePageContentHash(serializePageSchemaForFile(_0x25792a));}export async function computePageFileHash(_0x49a463){const _0x30e2fc=a167_0x31d3,_0x32eb07=await readFile(_0x49a463,_0x30e2fc(0x179));return computePageContentHash(_0x32eb07);}
@@ -1 +1 @@
1
- (function(_0x20c193,_0x20e15d){const _0x439600=a168_0x4a89,_0x189455=_0x20c193();while(!![]){try{const _0x3f92b2=parseInt(_0x439600(0x92))/0x1*(parseInt(_0x439600(0xa3))/0x2)+parseInt(_0x439600(0xa1))/0x3+-parseInt(_0x439600(0x99))/0x4+-parseInt(_0x439600(0xa0))/0x5+parseInt(_0x439600(0x95))/0x6+parseInt(_0x439600(0x91))/0x7+-parseInt(_0x439600(0x98))/0x8*(-parseInt(_0x439600(0x93))/0x9);if(_0x3f92b2===_0x20e15d)break;else _0x189455['push'](_0x189455['shift']());}catch(_0x79472b){_0x189455['push'](_0x189455['shift']());}}}(a168_0x1af9,0xbfa17));import{mkdir,readFile,writeFile}from'node:fs/promises';function a168_0x1af9(){const _0x11b879=['code','ENOENT','7039415UrNRqb','3283032xsBoVV','pages','75562EQVSbo','499009ghPDpt','19HEoruU','2322981GvjwZO','stringify','2982516PaeVMc','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','object','8yYsWhK','1783452PNyRNf','lastSync','parse','utf8','apps'];a168_0x1af9=function(){return _0x11b879;};return a168_0x1af9();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x5226aa,_0x52dbc3){const _0x424c08=a168_0x4a89,_0x3368dc={'apps':_0x5226aa[_0x424c08(0x9d)]&&typeof _0x5226aa['apps']===_0x424c08(0x97)?_0x5226aa[_0x424c08(0x9d)]:{}};let _0x7396af=_0x3368dc[_0x424c08(0x9d)][_0x52dbc3];if(!_0x7396af)return _0x7396af={'lastSync':'','pages':{}},_0x3368dc[_0x424c08(0x9d)][_0x52dbc3]=_0x7396af,{'lockData':_0x3368dc,'appLock':_0x7396af};return!_0x7396af[_0x424c08(0x9a)]&&(_0x7396af[_0x424c08(0x9a)]=''),(!_0x7396af[_0x424c08(0xa2)]||typeof _0x7396af[_0x424c08(0xa2)]!==_0x424c08(0x97))&&(_0x7396af[_0x424c08(0xa2)]={}),{'lockData':_0x3368dc,'appLock':_0x7396af};}export async function readPageLockFile(_0x1bfca5){const _0x545c28=a168_0x4a89;try{const _0x3d2373=await readFile(_0x1bfca5,_0x545c28(0x9c)),_0x2a91ed=JSON[_0x545c28(0x9b)](_0x3d2373);return{'apps':_0x2a91ed[_0x545c28(0x9d)]&&typeof _0x2a91ed[_0x545c28(0x9d)]===_0x545c28(0x97)?_0x2a91ed[_0x545c28(0x9d)]:{}};}catch(_0x5602d7){if(_0x5602d7[_0x545c28(0x9e)]===_0x545c28(0x9f))return null;throw new Error(_0x545c28(0x96)+String(_0x5602d7));}}function a168_0x4a89(_0x4626e4,_0x5b62e1){_0x4626e4=_0x4626e4-0x91;const _0x1af95b=a168_0x1af9();let _0x4a89e6=_0x1af95b[_0x4626e4];return _0x4a89e6;}export async function writePageLockFile(_0x4a2d5b,_0x15b31b){const _0xfb1e9c=a168_0x4a89;await mkdir(dirname(_0x4a2d5b),{'recursive':!![]}),await writeFile(_0x4a2d5b,JSON[_0xfb1e9c(0x94)](_0x15b31b,null,0x2),_0xfb1e9c(0x9c));}
1
+ function a168_0x4632(){const _0x5bf62b=['139210DOvLZT','pages','700ZxoQxu','331984rZtctN','lastSync','parse','3vivHsF','319KMrHDm','1519060QmwDpp','ENOENT','54qLarEQ','619386MLfcHT','object','apps','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','466290GJxMpU','utf8','stringify','107970nubLct','15160SgkNqG'];a168_0x4632=function(){return _0x5bf62b;};return a168_0x4632();}(function(_0x317257,_0x1b2781){const _0x35b29f=a168_0xf023,_0x178ad5=_0x317257();while(!![]){try{const _0x5ed72e=parseInt(_0x35b29f(0x163))/0x1+-parseInt(_0x35b29f(0x16b))/0x2*(parseInt(_0x35b29f(0x166))/0x3)+parseInt(_0x35b29f(0x168))/0x4+-parseInt(_0x35b29f(0x160))/0x5*(parseInt(_0x35b29f(0x16a))/0x6)+parseInt(_0x35b29f(0x162))/0x7*(-parseInt(_0x35b29f(0x15f))/0x8)+-parseInt(_0x35b29f(0x15b))/0x9+-parseInt(_0x35b29f(0x15e))/0xa*(-parseInt(_0x35b29f(0x167))/0xb);if(_0x5ed72e===_0x1b2781)break;else _0x178ad5['push'](_0x178ad5['shift']());}catch(_0x332add){_0x178ad5['push'](_0x178ad5['shift']());}}}(a168_0x4632,0x36831));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x337e3c,_0x551aef){const _0x4fb9d6=a168_0xf023,_0x2b5b91={'apps':_0x337e3c['apps']&&typeof _0x337e3c['apps']===_0x4fb9d6(0x16c)?_0x337e3c[_0x4fb9d6(0x16d)]:{}};let _0x341a11=_0x2b5b91[_0x4fb9d6(0x16d)][_0x551aef];if(!_0x341a11)return _0x341a11={'lastSync':'','pages':{}},_0x2b5b91[_0x4fb9d6(0x16d)][_0x551aef]=_0x341a11,{'lockData':_0x2b5b91,'appLock':_0x341a11};return!_0x341a11[_0x4fb9d6(0x164)]&&(_0x341a11[_0x4fb9d6(0x164)]=''),(!_0x341a11['pages']||typeof _0x341a11[_0x4fb9d6(0x161)]!==_0x4fb9d6(0x16c))&&(_0x341a11[_0x4fb9d6(0x161)]={}),{'lockData':_0x2b5b91,'appLock':_0x341a11};}export async function readPageLockFile(_0x33ef4c){const _0xe6ea7d=a168_0xf023;try{const _0x225a8a=await readFile(_0x33ef4c,_0xe6ea7d(0x15c)),_0x522b68=JSON[_0xe6ea7d(0x165)](_0x225a8a);return{'apps':_0x522b68[_0xe6ea7d(0x16d)]&&typeof _0x522b68[_0xe6ea7d(0x16d)]===_0xe6ea7d(0x16c)?_0x522b68['apps']:{}};}catch(_0x5878bb){if(_0x5878bb['code']===_0xe6ea7d(0x169))return null;throw new Error(_0xe6ea7d(0x16e)+String(_0x5878bb));}}function a168_0xf023(_0x4571db,_0x2f4b0b){_0x4571db=_0x4571db-0x15b;const _0x463227=a168_0x4632();let _0xf02359=_0x463227[_0x4571db];return _0xf02359;}export async function writePageLockFile(_0x3dea15,_0x17a5f7){const _0x2a5d00=a168_0xf023;await mkdir(dirname(_0x3dea15),{'recursive':!![]}),await writeFile(_0x3dea15,JSON[_0x2a5d00(0x15d)](_0x17a5f7,null,0x2),_0x2a5d00(0x15c));}
@@ -1 +1 @@
1
- const a170_0x3bcf83=a170_0x4304;(function(_0xcfe871,_0x3c6ede){const _0x51e012=a170_0x4304,_0x17cb5d=_0xcfe871();while(!![]){try{const _0x52a228=parseInt(_0x51e012(0x1d1))/0x1*(-parseInt(_0x51e012(0x1c7))/0x2)+-parseInt(_0x51e012(0x1d2))/0x3*(-parseInt(_0x51e012(0x1ce))/0x4)+parseInt(_0x51e012(0x1cd))/0x5*(parseInt(_0x51e012(0x1d6))/0x6)+parseInt(_0x51e012(0x1d0))/0x7*(-parseInt(_0x51e012(0x1cb))/0x8)+-parseInt(_0x51e012(0x1d4))/0x9+-parseInt(_0x51e012(0x1d3))/0xa*(-parseInt(_0x51e012(0x1c8))/0xb)+parseInt(_0x51e012(0x1d5))/0xc;if(_0x52a228===_0x3c6ede)break;else _0x17cb5d['push'](_0x17cb5d['shift']());}catch(_0x48ab03){_0x17cb5d['push'](_0x17cb5d['shift']());}}}(a170_0x10bc,0xb74c8));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a170_0x10bc(){const _0x4e4155=['301XdkHJZ','4567HtMOgj','39jScNls','10GPhZur','12292308RPzweU','9482160EmBTFL','12KWBRYK','sql-trash','62jxoplt','5385391FRfPud','sql.lock.json','sql','6720beXjLv','.rabetbase','478255Arlrpw','253304EmGAdn','/sql'];a170_0x10bc=function(){return _0x4e4155;};return a170_0x10bc();}function a170_0x4304(_0x2e0db8,_0x329583){_0x2e0db8=_0x2e0db8-0x1c7;const _0x10bce5=a170_0x10bc();let _0x430414=_0x10bce5[_0x2e0db8];return _0x430414;}const DOT_DIR=a170_0x3bcf83(0x1cc),LOCK_FILE_NAME=a170_0x3bcf83(0x1c9),TRASH_DIR_NAME=a170_0x3bcf83(0x1d7);export function loadSqlProjectConfig(_0x2f830b,_0x24317c){const _0x2dcb06=a170_0x3bcf83,_0x2fff66=resolve(_0x24317c??findProjectRootDirectory()),_0x1957fe=DOT_DIR+_0x2dcb06(0x1cf),_0x56f271=_0x1957fe+'/'+_0x2f830b;return{'projectRoot':_0x2fff66,'appCode':_0x2f830b,'sqlWorkspaceRoot':_0x1957fe,'sqlRoot':_0x56f271,'sqlRootDir':resolve(_0x2fff66,DOT_DIR,_0x2dcb06(0x1ca),_0x2f830b),'lockFilePath':resolve(_0x2fff66,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2fff66,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a170_0x54fb53=a170_0x1306;function a170_0x5d0c(){const _0xff00dd=['sql-trash','283119iYRiwF','69676JICLts','103890YQvRUX','.rabetbase','sql.lock.json','7188775RcvNBz','2uaudzX','sql','20Vekkef','724213SlEvtV','302359bwnemB','1794972WchKka','45wrjXNT','8zkpLxk'];a170_0x5d0c=function(){return _0xff00dd;};return a170_0x5d0c();}(function(_0x2e060f,_0x5038db){const _0x1db9d9=a170_0x1306,_0x1cf8be=_0x2e060f();while(!![]){try{const _0x1cdc1a=parseInt(_0x1db9d9(0x1ca))/0x1*(parseInt(_0x1db9d9(0x1c6))/0x2)+parseInt(_0x1db9d9(0x1c0))/0x3+-parseInt(_0x1db9d9(0x1c1))/0x4*(-parseInt(_0x1db9d9(0x1c8))/0x5)+parseInt(_0x1db9d9(0x1bc))/0x6+-parseInt(_0x1db9d9(0x1c9))/0x7*(-parseInt(_0x1db9d9(0x1be))/0x8)+parseInt(_0x1db9d9(0x1bd))/0x9*(-parseInt(_0x1db9d9(0x1c2))/0xa)+-parseInt(_0x1db9d9(0x1c5))/0xb;if(_0x1cdc1a===_0x5038db)break;else _0x1cf8be['push'](_0x1cf8be['shift']());}catch(_0x34c1a2){_0x1cf8be['push'](_0x1cf8be['shift']());}}}(a170_0x5d0c,0x27ee7));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a170_0x54fb53(0x1c3),LOCK_FILE_NAME=a170_0x54fb53(0x1c4),TRASH_DIR_NAME=a170_0x54fb53(0x1bf);function a170_0x1306(_0x1fa5e2,_0x549f22){_0x1fa5e2=_0x1fa5e2-0x1bc;const _0x5d0c6f=a170_0x5d0c();let _0x130632=_0x5d0c6f[_0x1fa5e2];return _0x130632;}export function loadSqlProjectConfig(_0x69ffc4,_0x56f7d7){const _0x514874=a170_0x54fb53,_0x247460=resolve(_0x56f7d7??findProjectRootDirectory()),_0x21e7e6=DOT_DIR+'/sql',_0x460e7e=_0x21e7e6+'/'+_0x69ffc4;return{'projectRoot':_0x247460,'appCode':_0x69ffc4,'sqlWorkspaceRoot':_0x21e7e6,'sqlRoot':_0x460e7e,'sqlRootDir':resolve(_0x247460,DOT_DIR,_0x514874(0x1c7),_0x69ffc4),'lockFilePath':resolve(_0x247460,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x247460,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x2acbe2,_0x370e45){const _0x360366=a171_0x31c0,_0x37f8c9=_0x2acbe2();while(!![]){try{const _0x52ecef=parseInt(_0x360366(0x126))/0x1+-parseInt(_0x360366(0x12d))/0x2+parseInt(_0x360366(0x11f))/0x3+-parseInt(_0x360366(0x132))/0x4*(-parseInt(_0x360366(0x118))/0x5)+-parseInt(_0x360366(0x133))/0x6+parseInt(_0x360366(0x12b))/0x7*(-parseInt(_0x360366(0x116))/0x8)+parseInt(_0x360366(0x128))/0x9;if(_0x52ecef===_0x370e45)break;else _0x37f8c9['push'](_0x37f8c9['shift']());}catch(_0x5105ab){_0x37f8c9['push'](_0x37f8c9['shift']());}}}(a171_0x3e10,0x51e25));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a171_0x3e10(){const _0x419e18=['indexOf','slice','16keHvdE','split','95QvVDMf','name','code','ENOENT','isFile','dbId','isDirectory','72315TloEyD','sql','sqlName','sqlCode','path','push','sqlRootDir','160352JUHSjc','test','11911878GriFjd','replace','.xml','1412089AXeIIb','mybatisXml','663852EfQrWC','filter','mode','length','dbName','7592UegDat','2839704fxwaOI'];a171_0x3e10=function(){return _0x419e18;};return a171_0x3e10();}function extensionToMode(_0x229078){const _0x271858=a171_0x31c0;if(_0x229078==='.sql')return _0x271858(0x120);if(_0x229078===_0x271858(0x12a))return _0x271858(0x12c);return undefined;}async function scanSqlFilesRecursively(_0x353bf4,_0x47fbb5){const _0x4bc961=a171_0x31c0,_0x30fb07=[];try{const _0x54b572=await readdir(_0x353bf4,{'withFileTypes':!![]});for(const _0x332dc7 of _0x54b572){const _0x25f671=join(_0x353bf4,_0x332dc7[_0x4bc961(0x119)]);if(_0x332dc7['isDirectory']()){_0x30fb07[_0x4bc961(0x124)](...await scanSqlFilesRecursively(_0x25f671,_0x47fbb5));continue;}if(!_0x332dc7[_0x4bc961(0x11c)]())continue;const _0xb4e428=extname(_0x332dc7[_0x4bc961(0x119)])['toLowerCase'](),_0x49b442=extensionToMode(_0xb4e428);if(!_0x49b442)continue;const _0xc1167=relative(_0x47fbb5,_0x25f671)[_0x4bc961(0x129)](/\\/g,'/'),_0x113390=_0xc1167[_0x4bc961(0x117)]('/')[_0x4bc961(0x12e)](Boolean),_0x3a5065=parseSqlPath(_0x113390,_0x332dc7[_0x4bc961(0x119)],_0xb4e428);if(!_0x3a5065)continue;_0x30fb07[_0x4bc961(0x124)]({'sqlCode':_0x3a5065[_0x4bc961(0x122)],'sqlName':_0x3a5065[_0x4bc961(0x121)],'dbDirectory':_0x113390[0x0],'filePath':_0x25f671,'relativePath':_0xc1167,'lockKey':_0x3a5065[_0x4bc961(0x122)],'mode':_0x49b442});}}catch(_0x3495e3){if(_0x3495e3[_0x4bc961(0x11a)]!==_0x4bc961(0x11b))throw _0x3495e3;}return _0x30fb07;}export async function scanLocalSqlQueries(_0x345c0e){const _0x27cd31=a171_0x31c0;return scanSqlFilesRecursively(_0x345c0e[_0x27cd31(0x125)],_0x345c0e[_0x27cd31(0x125)]);}export function resolveLocalSqlFilePath(_0x3b3234,_0x51de84,_0x1cf361){const _0x5ada99=a171_0x31c0,_0x1c2450=_0x1cf361?.[_0x5ada99(0x123)]||(_0x1cf361?.[_0x5ada99(0x121)]||_0x1cf361?.[_0x5ada99(0x131)]?buildSqlRelativePath(_0x51de84,_0x1cf361?.[_0x5ada99(0x121)],_0x1cf361?.[_0x5ada99(0x131)],_0x1cf361?.[_0x5ada99(0x12f)]||_0x5ada99(0x120),_0x1cf361?.[_0x5ada99(0x11d)]):buildDefaultSqlFileName(_0x51de84,_0x1cf361?.[_0x5ada99(0x12f)]||_0x5ada99(0x120)));return join(_0x3b3234[_0x5ada99(0x125)],_0x1c2450);}export async function directoryExists(_0x3d370a){const _0x476b0e=a171_0x31c0;try{const _0x50f09a=await stat(_0x3d370a);return _0x50f09a[_0x476b0e(0x11e)]();}catch{return![];}}function parseSqlPath(_0x118e4b,_0x3093ea,_0x3d2afc){const _0x522551=a171_0x31c0,_0x2293cb=_0x3093ea[_0x522551(0x115)](0x0,-_0x3d2afc[_0x522551(0x130)]);if(_0x118e4b['length']<0x2)return null;const _0x2c05a7=_0x2293cb[_0x522551(0x134)]('_');if(_0x2c05a7<=0x0||_0x2c05a7>=_0x2293cb[_0x522551(0x130)]-0x1)return null;const _0x41fbd1=_0x2293cb['slice'](0x0,_0x2c05a7);if(!isLikelySqlCode(_0x41fbd1))return null;return{'sqlCode':_0x41fbd1,'sqlName':_0x2293cb[_0x522551(0x115)](_0x2c05a7+0x1)};}function a171_0x31c0(_0x56bb25,_0x18ab3c){_0x56bb25=_0x56bb25-0x115;const _0x3e10d9=a171_0x3e10();let _0x31c03c=_0x3e10d9[_0x56bb25];return _0x31c03c;}function isLikelySqlCode(_0x19c259){const _0x5fd453=a171_0x31c0;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x5fd453(0x127)](_0x19c259);}
1
+ (function(_0x57eaae,_0x9bed1a){const _0x3aa5ce=a171_0x2d33,_0x484336=_0x57eaae();while(!![]){try{const _0x26dfed=parseInt(_0x3aa5ce(0x17b))/0x1+-parseInt(_0x3aa5ce(0x18b))/0x2*(parseInt(_0x3aa5ce(0x17c))/0x3)+parseInt(_0x3aa5ce(0x188))/0x4*(-parseInt(_0x3aa5ce(0x187))/0x5)+-parseInt(_0x3aa5ce(0x177))/0x6+-parseInt(_0x3aa5ce(0x18e))/0x7*(parseInt(_0x3aa5ce(0x18d))/0x8)+parseInt(_0x3aa5ce(0x181))/0x9+-parseInt(_0x3aa5ce(0x17d))/0xa*(-parseInt(_0x3aa5ce(0x191))/0xb);if(_0x26dfed===_0x9bed1a)break;else _0x484336['push'](_0x484336['shift']());}catch(_0x844194){_0x484336['push'](_0x484336['shift']());}}}(a171_0x5d1e,0x23b95));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x86a485){const _0x2ba36c=a171_0x2d33;if(_0x86a485===_0x2ba36c(0x17e))return _0x2ba36c(0x17a);if(_0x86a485==='.xml')return _0x2ba36c(0x18a);return undefined;}async function scanSqlFilesRecursively(_0x59a1ef,_0x543d88){const _0x30bc16=a171_0x2d33,_0x179e6b=[];try{const _0x4b8dd3=await readdir(_0x59a1ef,{'withFileTypes':!![]});for(const _0x436788 of _0x4b8dd3){const _0x28c63c=join(_0x59a1ef,_0x436788[_0x30bc16(0x189)]);if(_0x436788[_0x30bc16(0x192)]()){_0x179e6b[_0x30bc16(0x180)](...await scanSqlFilesRecursively(_0x28c63c,_0x543d88));continue;}if(!_0x436788[_0x30bc16(0x194)]())continue;const _0x1d5183=extname(_0x436788['name'])[_0x30bc16(0x178)](),_0x1294a2=extensionToMode(_0x1d5183);if(!_0x1294a2)continue;const _0x31907e=relative(_0x543d88,_0x28c63c)[_0x30bc16(0x184)](/\\/g,'/'),_0x1e3136=_0x31907e['split']('/')[_0x30bc16(0x190)](Boolean),_0x33246d=parseSqlPath(_0x1e3136,_0x436788[_0x30bc16(0x189)],_0x1d5183);if(!_0x33246d)continue;_0x179e6b[_0x30bc16(0x180)]({'sqlCode':_0x33246d[_0x30bc16(0x179)],'sqlName':_0x33246d[_0x30bc16(0x185)],'dbDirectory':_0x1e3136[0x0],'filePath':_0x28c63c,'relativePath':_0x31907e,'lockKey':_0x33246d[_0x30bc16(0x179)],'mode':_0x1294a2});}}catch(_0x5a8fda){if(_0x5a8fda[_0x30bc16(0x193)]!==_0x30bc16(0x196))throw _0x5a8fda;}return _0x179e6b;}export async function scanLocalSqlQueries(_0xec3df5){const _0x28ebeb=a171_0x2d33;return scanSqlFilesRecursively(_0xec3df5[_0x28ebeb(0x18f)],_0xec3df5[_0x28ebeb(0x18f)]);}function a171_0x2d33(_0x5acac7,_0x424b88){_0x5acac7=_0x5acac7-0x177;const _0x5d1ef2=a171_0x5d1e();let _0x2d33b5=_0x5d1ef2[_0x5acac7];return _0x2d33b5;}export function resolveLocalSqlFilePath(_0x1df27e,_0x301f01,_0x4f3524){const _0x44e43c=a171_0x2d33,_0x5ebec=_0x4f3524?.[_0x44e43c(0x17f)]||(_0x4f3524?.[_0x44e43c(0x185)]||_0x4f3524?.[_0x44e43c(0x186)]?buildSqlRelativePath(_0x301f01,_0x4f3524?.[_0x44e43c(0x185)],_0x4f3524?.[_0x44e43c(0x186)],_0x4f3524?.[_0x44e43c(0x195)]||_0x44e43c(0x17a),_0x4f3524?.[_0x44e43c(0x182)]):buildDefaultSqlFileName(_0x301f01,_0x4f3524?.[_0x44e43c(0x195)]||'sql'));return join(_0x1df27e[_0x44e43c(0x18f)],_0x5ebec);}export async function directoryExists(_0x1f6ba7){const _0x2ad8fd=a171_0x2d33;try{const _0x4d5637=await stat(_0x1f6ba7);return _0x4d5637[_0x2ad8fd(0x192)]();}catch{return![];}}function parseSqlPath(_0x1d75a4,_0x3157fd,_0x290f0a){const _0x3b03a7=a171_0x2d33,_0x3086b4=_0x3157fd[_0x3b03a7(0x18c)](0x0,-_0x290f0a[_0x3b03a7(0x197)]);if(_0x1d75a4['length']<0x2)return null;const _0x5a6cc9=_0x3086b4['indexOf']('_');if(_0x5a6cc9<=0x0||_0x5a6cc9>=_0x3086b4[_0x3b03a7(0x197)]-0x1)return null;const _0x41a774=_0x3086b4[_0x3b03a7(0x18c)](0x0,_0x5a6cc9);if(!isLikelySqlCode(_0x41a774))return null;return{'sqlCode':_0x41a774,'sqlName':_0x3086b4[_0x3b03a7(0x18c)](_0x5a6cc9+0x1)};}function a171_0x5d1e(){const _0x4b22cc=['sqlCode','sql','213123TVhzOE','6LgxgLU','90wLUdNn','.sql','path','push','2617380GYKXqE','dbId','test','replace','sqlName','dbName','187625SkKEpY','16YxqFJf','name','mybatisXml','13938TwUYUb','slice','25064nHMImk','637qnmPMs','sqlRootDir','filter','380699LLTGCx','isDirectory','code','isFile','mode','ENOENT','length','1319748JmWkDc','toLowerCase'];a171_0x5d1e=function(){return _0x4b22cc;};return a171_0x5d1e();}function isLikelySqlCode(_0x3dd67c){const _0x435700=a171_0x2d33;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x435700(0x183)](_0x3dd67c);}
@@ -1 +1 @@
1
- function a172_0x405a(){const _0x3568e1=['md5','16650BotNwq','11976PYfVZW','2844QIYcQZ','505870wBOsDR','1351sAuZUc','55pFScGs','26039928uufvRD','180606qLOLWU','update','329865MrvXEn','110724sGUple','hex','28TliYqN','5HwFmVz'];a172_0x405a=function(){return _0x3568e1;};return a172_0x405a();}(function(_0x110447,_0x591578){const _0x3e4568=a172_0x3bf0,_0x1dec10=_0x110447();while(!![]){try{const _0x358a9a=parseInt(_0x3e4568(0x111))/0x1*(-parseInt(_0x3e4568(0x10e))/0x2)+parseInt(_0x3e4568(0x10b))/0x3*(-parseInt(_0x3e4568(0x110))/0x4)+parseInt(_0x3e4568(0x10d))/0x5+parseInt(_0x3e4568(0x104))/0x6*(-parseInt(_0x3e4568(0x108))/0x7)+-parseInt(_0x3e4568(0x105))/0x8*(parseInt(_0x3e4568(0x106))/0x9)+-parseInt(_0x3e4568(0x107))/0xa*(parseInt(_0x3e4568(0x109))/0xb)+parseInt(_0x3e4568(0x10a))/0xc;if(_0x358a9a===_0x591578)break;else _0x1dec10['push'](_0x1dec10['shift']());}catch(_0x5aa343){_0x1dec10['push'](_0x1dec10['shift']());}}}(a172_0x405a,0x436d5));import{readFile}from'node:fs/promises';function a172_0x3bf0(_0x3ce24f,_0x53ca6b){_0x3ce24f=_0x3ce24f-0x104;const _0x405af5=a172_0x405a();let _0x3bf0b5=_0x405af5[_0x3ce24f];return _0x3bf0b5;}import a172_0x2d7e22 from'node:crypto';export function computeSqlContentHash(_0x5ae009){const _0x2f7982=a172_0x3bf0;return a172_0x2d7e22['createHash'](_0x2f7982(0x112))[_0x2f7982(0x10c)](_0x5ae009)['digest'](_0x2f7982(0x10f));}export async function computeSqlFileHash(_0x4f95a2){const _0x4e6560=await readFile(_0x4f95a2,'utf8');return computeSqlContentHash(_0x4e6560);}
1
+ (function(_0x4d742f,_0x32d0c2){const _0x38de7a=a172_0x41ff,_0x4a305b=_0x4d742f();while(!![]){try{const _0x4d2a83=-parseInt(_0x38de7a(0x118))/0x1*(-parseInt(_0x38de7a(0x107))/0x2)+parseInt(_0x38de7a(0x114))/0x3+-parseInt(_0x38de7a(0x10a))/0x4*(-parseInt(_0x38de7a(0x10f))/0x5)+-parseInt(_0x38de7a(0x113))/0x6+-parseInt(_0x38de7a(0x116))/0x7*(-parseInt(_0x38de7a(0x10c))/0x8)+-parseInt(_0x38de7a(0x10e))/0x9*(-parseInt(_0x38de7a(0x112))/0xa)+parseInt(_0x38de7a(0x115))/0xb*(-parseInt(_0x38de7a(0x109))/0xc);if(_0x4d2a83===_0x32d0c2)break;else _0x4a305b['push'](_0x4a305b['shift']());}catch(_0x4e1f9f){_0x4a305b['push'](_0x4a305b['shift']());}}}(a172_0x5b88,0x20911));function a172_0x41ff(_0x228260,_0x1a2bbf){_0x228260=_0x228260-0x107;const _0x5b88cc=a172_0x5b88();let _0x41ff92=_0x5b88cc[_0x228260];return _0x41ff92;}import{readFile}from'node:fs/promises';import a172_0x231c49 from'node:crypto';export function computeSqlContentHash(_0x48e847){const _0x1e41fa=a172_0x41ff;return a172_0x231c49[_0x1e41fa(0x10d)](_0x1e41fa(0x117))[_0x1e41fa(0x111)](_0x48e847)[_0x1e41fa(0x108)](_0x1e41fa(0x10b));}function a172_0x5b88(){const _0x13f0b4=['10mvXLQb','945324CZSLyx','680280GwrOqN','445544dnaRYi','42pwDpPN','md5','61iIJSEM','2708xUhIYY','digest','132lSRKnR','8ZMneAy','hex','318040DnSjln','createHash','1325349VBeMjy','103365jIhbpp','utf8','update'];a172_0x5b88=function(){return _0x13f0b4;};return a172_0x5b88();}export async function computeSqlFileHash(_0x3268dc){const _0x42a7bf=a172_0x41ff,_0x289b72=await readFile(_0x3268dc,_0x42a7bf(0x110));return computeSqlContentHash(_0x289b72);}