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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/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/index.js +1 -1
  65. package/lib/commands/dataset/list.js +1 -1
  66. package/lib/commands/dataset/operations.js +1 -1
  67. package/lib/commands/dataset/relation-audit.js +1 -1
  68. package/lib/commands/dataset/relation-create.js +1 -1
  69. package/lib/commands/dataset/relation-delete.js +1 -1
  70. package/lib/commands/dataset/relation-shared.js +1 -1
  71. package/lib/commands/dataset/relation-update.js +1 -1
  72. package/lib/commands/dataset/relations.js +1 -1
  73. package/lib/commands/dataset/rename.js +1 -1
  74. package/lib/commands/dataset/restore.js +1 -1
  75. package/lib/commands/db/analyze-cancel.js +1 -1
  76. package/lib/commands/db/analyze-start.js +1 -1
  77. package/lib/commands/db/analyze-status.js +1 -1
  78. package/lib/commands/db/create.js +1 -1
  79. package/lib/commands/db/delete.js +1 -1
  80. package/lib/commands/db/detail.js +1 -1
  81. package/lib/commands/db/diff.js +1 -1
  82. package/lib/commands/db/index.js +1 -1
  83. package/lib/commands/db/list.js +1 -1
  84. package/lib/commands/db/shared.js +1 -1
  85. package/lib/commands/db/tables.js +1 -1
  86. package/lib/commands/db/test.js +1 -1
  87. package/lib/commands/db/update.js +1 -1
  88. package/lib/commands/doctor.js +1 -1
  89. package/lib/commands/init/index.js +1 -1
  90. package/lib/commands/issue/index.js +1 -1
  91. package/lib/commands/issue/nudge.js +1 -1
  92. package/lib/commands/issue/report.js +1 -1
  93. package/lib/commands/issue/shared.js +1 -1
  94. package/lib/commands/logs/index.js +1 -1
  95. package/lib/commands/menu/index.js +1 -1
  96. package/lib/commands/menu/list.js +1 -1
  97. package/lib/commands/menu/shared/compare-table.js +1 -1
  98. package/lib/commands/menu/shared/index.js +1 -1
  99. package/lib/commands/menu/shared/inquirer.js +1 -1
  100. package/lib/commands/menu/shared/local-pages.js +1 -1
  101. package/lib/commands/menu/shared/logic.js +1 -1
  102. package/lib/commands/menu/shared/service.js +1 -1
  103. package/lib/commands/menu/shared/sync-core.js +1 -1
  104. package/lib/commands/menu/shared/update-core.js +1 -1
  105. package/lib/commands/menu/shared/valid-url.js +1 -1
  106. package/lib/commands/menu/sync.js +1 -1
  107. package/lib/commands/menu/update.js +1 -1
  108. package/lib/commands/page/generate-start.js +1 -1
  109. package/lib/commands/page/generate-status.js +1 -1
  110. package/lib/commands/page/index.js +1 -1
  111. package/lib/commands/page/pull.js +1 -1
  112. package/lib/commands/page/push.js +1 -1
  113. package/lib/commands/page/relation-audit.js +1 -1
  114. package/lib/commands/page/shared.js +1 -1
  115. package/lib/commands/page/standard-page-status.js +1 -1
  116. package/lib/commands/page/sync.js +1 -1
  117. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  118. package/lib/commands/project/create/format-elapsed.js +1 -1
  119. package/lib/commands/project/create/main.js +1 -1
  120. package/lib/commands/project/create/non-interactive.js +1 -1
  121. package/lib/commands/project/create/project-template-path.js +1 -1
  122. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  123. package/lib/commands/project/create/use-format-code.js +1 -1
  124. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  125. package/lib/commands/project/index.js +1 -1
  126. package/lib/commands/project/init.js +1 -1
  127. package/lib/commands/project/upgrade.js +1 -1
  128. package/lib/commands/registry.js +1 -1
  129. package/lib/commands/run/index.js +1 -1
  130. package/lib/commands/schema.js +1 -1
  131. package/lib/commands/sql/create.js +1 -1
  132. package/lib/commands/sql/delete.js +1 -1
  133. package/lib/commands/sql/detail.js +1 -1
  134. package/lib/commands/sql/exec.js +1 -1
  135. package/lib/commands/sql/index.js +1 -1
  136. package/lib/commands/sql/list.js +1 -1
  137. package/lib/commands/sql/pull.js +1 -1
  138. package/lib/commands/sql/push.js +1 -1
  139. package/lib/commands/sql/save.js +1 -1
  140. package/lib/commands/sql/shared.js +1 -1
  141. package/lib/commands/sql/status.js +1 -1
  142. package/lib/commands/sql/validate.js +1 -1
  143. package/lib/commands/workspace/index.js +1 -1
  144. package/lib/config/schema.js +1 -1
  145. package/lib/constant/cdn.js +1 -1
  146. package/lib/constant/cli.js +1 -1
  147. package/lib/constant/defaults.js +1 -1
  148. package/lib/constant/domain.js +1 -1
  149. package/lib/constant/env.js +1 -1
  150. package/lib/constant/output.js +1 -1
  151. package/lib/constant/paths.js +1 -1
  152. package/lib/constant/risk.js +1 -1
  153. package/lib/context/app-resolver.js +1 -1
  154. package/lib/context/auth-resolver.js +1 -1
  155. package/lib/context/config-loader.js +1 -1
  156. package/lib/context.js +1 -1
  157. package/lib/core/alias-resolver.js +1 -1
  158. package/lib/core/api-client.js +1 -1
  159. package/lib/core/bff/config.js +1 -1
  160. package/lib/core/bff/file-system.js +1 -1
  161. package/lib/core/bff/hash.js +1 -1
  162. package/lib/core/bff/lock.js +1 -1
  163. package/lib/core/bff/utils.js +1 -1
  164. package/lib/core/db-resolver.js +1 -1
  165. package/lib/core/page/file-system.js +1 -1
  166. package/lib/core/page/hash.js +1 -1
  167. package/lib/core/page/lock.js +1 -1
  168. package/lib/core/sql-sync/config.js +1 -1
  169. package/lib/core/sql-sync/file-system.js +1 -1
  170. package/lib/core/sql-sync/hash.js +1 -1
  171. package/lib/core/sql-sync/lock.js +1 -1
  172. package/lib/core/sql-sync/utils.js +1 -1
  173. package/lib/core/sql-validator.js +1 -1
  174. package/lib/errors.js +1 -1
  175. package/lib/framework/build-all-flags.js +1 -1
  176. package/lib/framework/flags.js +1 -1
  177. package/lib/framework/help.js +1 -1
  178. package/lib/framework/index.js +1 -1
  179. package/lib/framework/output.js +1 -1
  180. package/lib/framework/response.js +1 -1
  181. package/lib/framework/runner-alias.js +1 -1
  182. package/lib/framework/runner.js +1 -1
  183. package/lib/framework/schema-export.js +1 -1
  184. package/lib/framework/types.js +1 -1
  185. package/lib/generated/build-info.js +1 -1
  186. package/lib/help.js +1 -1
  187. package/lib/skills/main.js +1 -1
  188. package/lib/skills/npx-skills-add.js +1 -1
  189. package/lib/telemetry/cli-command-trace.js +1 -1
  190. package/lib/telemetry/cli-help-trace.js +1 -1
  191. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  192. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  193. package/lib/telemetry/send-cli-trace-log.js +1 -1
  194. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  195. package/lib/utils/ai_config.js +1 -1
  196. package/lib/utils/apply-jq-filter.js +1 -1
  197. package/lib/utils/cdn-config.js +1 -1
  198. package/lib/utils/check-sdk-version.js +1 -1
  199. package/lib/utils/cli-version-check.js +1 -1
  200. package/lib/utils/cli-version-policy.js +1 -1
  201. package/lib/utils/config.js +1 -1
  202. package/lib/utils/copy-directory.js +1 -1
  203. package/lib/utils/entity-with-id.js +1 -1
  204. package/lib/utils/file-utils.js +1 -1
  205. package/lib/utils/guides-cdn.js +1 -1
  206. package/lib/utils/http-client.js +1 -1
  207. package/lib/utils/is-non-interactive.js +1 -1
  208. package/lib/utils/logger.js +1 -1
  209. package/lib/utils/params.js +1 -1
  210. package/lib/utils/platform.js +1 -1
  211. package/lib/utils/rules-cdn.js +1 -1
  212. package/lib/utils/sleep.js +1 -1
  213. package/lib/utils/template-replacer.js +1 -1
  214. package/lib/utils/update-notice.js +1 -1
  215. package/lib/utils/version.js +1 -1
  216. package/lib/utils/with-active-cookie.js +1 -1
  217. package/lib/utils/write-cli-side-channel.js +1 -1
  218. package/package.json +1 -1
@@ -1 +1 @@
1
- function a153_0x3eaf(_0x4b57fb,_0x34653c){_0x4b57fb=_0x4b57fb-0x17a;const _0x95017d=a153_0x9501();let _0x3eaf8a=_0x95017d[_0x4b57fb];return _0x3eaf8a;}(function(_0xaea3d7,_0x577019){const _0x350b52=a153_0x3eaf,_0x3b594e=_0xaea3d7();while(!![]){try{const _0x2ff018=parseInt(_0x350b52(0x17c))/0x1*(-parseInt(_0x350b52(0x19d))/0x2)+parseInt(_0x350b52(0x18b))/0x3+parseInt(_0x350b52(0x184))/0x4*(-parseInt(_0x350b52(0x17b))/0x5)+parseInt(_0x350b52(0x18c))/0x6*(-parseInt(_0x350b52(0x17a))/0x7)+-parseInt(_0x350b52(0x193))/0x8+-parseInt(_0x350b52(0x19e))/0x9+parseInt(_0x350b52(0x195))/0xa*(parseInt(_0x350b52(0x186))/0xb);if(_0x2ff018===_0x577019)break;else _0x3b594e['push'](_0x3b594e['shift']());}catch(_0x4a15bf){_0x3b594e['push'](_0x3b594e['shift']());}}}(a153_0x9501,0x70eb5));function a153_0x9501(){const _0x193a1f=['true','10930ddjDvY','apps','maxRisk','appcode','length','find','defaultApp','apiDir','58gkkvhC','5213682tTPVFN','format','production','trim','read','1750qtrqhD','93025JCzKtH','24162ZAFCxS','env','app','string','COOKIE','inherit','pageSize','ACCESS_KEY','72tJtqxW','write','25036eNevYP','MAX_RISK','RISK_LEVEL','cookie','object','1016307JEHphW','16890RBFims','riskLevel','keys','locale','entries','APP','projectConfig','362272uLaWYb'];a153_0x9501=function(){return _0x193a1f;};return a153_0x9501();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x40afca){const _0x19834a=a153_0x3eaf;return typeof _0x40afca==='string'&&_0x40afca[_0x19834a(0x1a1)]()?_0x40afca[_0x19834a(0x1a1)]():undefined;}function appProfiles(_0x49622c){const _0x44c0bb=a153_0x3eaf;return _0x49622c[_0x44c0bb(0x196)]&&typeof _0x49622c['apps']===_0x44c0bb(0x18a)?_0x49622c['apps']:{};}function resolveDefaultAppName(_0x18711d){const _0x5bff66=a153_0x3eaf,_0x1b5f72=stringConfigValue(_0x18711d[_0x5bff66(0x19b)]);if(_0x1b5f72)return _0x1b5f72;return Object['keys'](appProfiles(_0x18711d))[0x0];}function resolveTopLevelAppCode(_0xf9b469){const _0x4e7d25=a153_0x3eaf;return stringConfigValue(_0xf9b469[_0x4e7d25(0x198)])||stringConfigValue(_0xf9b469[_0x4e7d25(0x17e)]);}export function resolveAppConfig({raw:_0x2595e1,flags:_0x3e7cbf,layers:_0x251c7e,readEnv:_0x3de3ca}){const _0x500459=a153_0x3eaf,_0x40cc05=_0x251c7e?.[_0x500459(0x192)]??{},_0x14c621=_0x251c7e?.['globalConfig']??{},_0x2cbd69=Object[_0x500459(0x18e)](_0x40cc05)[_0x500459(0x199)]>0x0,_0x26f8e=!_0x2cbd69||_0x40cc05[_0x500459(0x181)]===!![],_0x48aa50=_0x2cbd69?resolveDefaultAppName(_0x40cc05):undefined,_0x21bee4=_0x26f8e?resolveDefaultAppName(_0x14c621):undefined,_0x1e78f0=stringConfigValue(_0x3e7cbf['app']),_0x31b3ce=_0x3de3ca(_0x500459(0x191)),_0x40c19d={};if(_0x2595e1[_0x500459(0x196)]&&typeof _0x2595e1['apps']===_0x500459(0x18a))for(const [_0x442412,_0x31d31e]of Object[_0x500459(0x190)](_0x2595e1[_0x500459(0x196)])){_0x31d31e&&typeof _0x31d31e===_0x500459(0x18a)&&_0x31d31e[_0x500459(0x198)]&&(_0x40c19d[_0x442412]=_0x31d31e);}const _0x503594=_0x2595e1['defaultApp']||undefined,_0xa07816=Object[_0x500459(0x18e)](_0x40c19d)[_0x500459(0x199)]>0x0,_0x4ca12b=_0x1e78f0||_0x48aa50||_0x31b3ce||_0x21bee4||_0x503594||undefined,_0x332b08=stringConfigValue(_0x3e7cbf[_0x500459(0x198)]),_0x2cc00e=_0x332b08?Object['entries'](_0x40c19d)[_0x500459(0x19a)](([,_0x335108])=>_0x335108?.[_0x500459(0x198)]===_0x332b08):undefined,_0x4d660a=_0x2cc00e?.[0x0],_0x197c37=_0x2cc00e?.[0x1],_0x1f6426=_0x332b08?_0x4d660a:_0x4ca12b;let _0x1f99a=_0x1f6426&&_0x40c19d[_0x1f6426]?_0x40c19d[_0x1f6426]:undefined;_0x332b08&&_0x197c37&&(_0x1f99a=_0x197c37);const _0x4077dd=_0x332b08?_0x197c37??_0x1f99a:_0x1f99a,_0x458570=!_0x1e78f0&&!_0x48aa50&&_0x31b3ce&&_0x1f6426===_0x31b3ce,_0x188211=_0x1e78f0||(_0x458570?_0x31b3ce:undefined)||(_0x332b08?_0x4d660a:undefined),_0x52b71a=_0x4077dd?.[_0x500459(0x198)],_0x315bc5=_0x2cbd69?resolveTopLevelAppCode(_0x40cc05):undefined,_0x5ac079=_0x26f8e?resolveTopLevelAppCode(_0x14c621):undefined,_0x4a80c4=_0x1e78f0||_0x48aa50?_0x52b71a:undefined,_0x3486b6=!_0x1e78f0&&!_0x48aa50?_0x52b71a:undefined,_0x38b0c8=_0x332b08||_0x4a80c4||_0x315bc5||_0x3486b6||_0x5ac079||undefined,_0x545d54=_0x2cbd69?stringConfigValue(_0x40cc05[_0x500459(0x17d)]):undefined,_0x23ae5d=_0x26f8e?stringConfigValue(_0x14c621[_0x500459(0x17d)]):undefined,_0x5da844=_0x3e7cbf[_0x500459(0x17d)]||_0x4077dd?.[_0x500459(0x17d)]||_0x545d54||_0x3de3ca('ENV')||_0x23ae5d||_0x2595e1[_0x500459(0x17d)]||DEFAULT_CONFIG_VALUES[_0x500459(0x17d)],_0x2cad57=_0x4077dd?.[_0x500459(0x18f)]||_0x2595e1[_0x500459(0x18f)]||DEFAULT_CONFIG_VALUES[_0x500459(0x18f)],_0x1273b1=_0x3de3ca(_0x500459(0x180))||_0x4077dd?.[_0x500459(0x189)]||_0x2595e1[_0x500459(0x189)]||undefined,_0x515b9c=_0x3de3ca(_0x500459(0x183))||_0x4077dd?.['accessKey']||_0x2595e1['accessKey']||undefined,_0x3c48c8=_0x3e7cbf[_0x500459(0x19f)]||_0x3de3ca('FORMAT')||_0x4077dd?.[_0x500459(0x19f)]||_0x2595e1[_0x500459(0x19f)],_0x2070a3=normalizeLegacyOutputFormat(_0x3c48c8),_0x13dd82=_0x3de3ca('PAGE_SIZE')||_0x4077dd?.['pageSize']||_0x2595e1[_0x500459(0x182)],_0x5c8574=_0x13dd82?Number(_0x13dd82)||undefined:undefined,_0x1bf04d=_0x3de3ca(_0x500459(0x188))||_0x3de3ca(_0x500459(0x187))||_0x4077dd?.[_0x500459(0x18d)]||_0x2595e1[_0x500459(0x18d)]||_0x2595e1[_0x500459(0x197)],_0x5533ae=_0x1bf04d===_0x500459(0x1a2)||_0x1bf04d===_0x500459(0x185)?_0x1bf04d:DEFAULT_CONFIG_VALUES[_0x500459(0x18d)],_0x331465=_0x3de3ca('VERBOSE'),_0x1ac2c1=_0x331465==='1'||_0x331465===_0x500459(0x194),_0x16cbea=_0x4077dd?.[_0x500459(0x19c)]||_0x2595e1['apiDir']||DEFAULT_CONFIG_VALUES[_0x500459(0x19c)],_0x26ec1c=isDaily(normalizeEnv(String(_0x5da844)))?'daily':_0x500459(0x1a0);return{'appCode':typeof _0x38b0c8===_0x500459(0x17f)&&_0x38b0c8[_0x500459(0x1a1)]()?_0x38b0c8[_0x500459(0x1a1)]():undefined,'env':_0x26ec1c,'locale':_0x2cad57,'cookie':_0x1273b1,'accessKey':_0x515b9c,'format':_0x2070a3,'pageSize':_0x5c8574,'riskLevel':_0x5533ae,'verbose':_0x1ac2c1,'apiDir':_0x16cbea,'apps':_0x40c19d,'defaultApp':_0x503594,'currentApp':_0xa07816?_0x1f6426:undefined,'explicitAppName':_0x188211};}
1
+ (function(_0x4adfdf,_0x1e2654){const _0xf1cb38=a153_0x34eb,_0x5c5461=_0x4adfdf();while(!![]){try{const _0x1304d8=parseInt(_0xf1cb38(0x15a))/0x1+-parseInt(_0xf1cb38(0x15d))/0x2*(parseInt(_0xf1cb38(0x178))/0x3)+-parseInt(_0xf1cb38(0x155))/0x4+parseInt(_0xf1cb38(0x156))/0x5+parseInt(_0xf1cb38(0x151))/0x6+-parseInt(_0xf1cb38(0x16b))/0x7+parseInt(_0xf1cb38(0x165))/0x8;if(_0x1304d8===_0x1e2654)break;else _0x5c5461['push'](_0x5c5461['shift']());}catch(_0x205d3c){_0x5c5461['push'](_0x5c5461['shift']());}}}(a153_0x19c8,0xb2789));function a153_0x19c8(){const _0x1164b8=['format','VERBOSE','RISK_LEVEL','riskLevel','daily','10337696WhpaJy','object','inherit','ENV','PAGE_SIZE','defaultApp','5082350LKPjiA','MAX_RISK','APP','globalConfig','projectConfig','entries','keys','apiDir','true','accessKey','string','cookie','maxRisk','3zkZiks','appcode','ACCESS_KEY','5326248oAnHkg','trim','locale','length','1780YyPTdk','1239555klNwZX','production','find','env','81320hFfJvC','app','apps','2103278mfdGsx','pageSize','COOKIE'];a153_0x19c8=function(){return _0x1164b8;};return a153_0x19c8();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x3520e5){const _0x4c6e78=a153_0x34eb;return typeof _0x3520e5===_0x4c6e78(0x175)&&_0x3520e5[_0x4c6e78(0x152)]()?_0x3520e5[_0x4c6e78(0x152)]():undefined;}function appProfiles(_0x20cfd2){const _0x4147c6=a153_0x34eb;return _0x20cfd2[_0x4147c6(0x15c)]&&typeof _0x20cfd2[_0x4147c6(0x15c)]===_0x4147c6(0x166)?_0x20cfd2['apps']:{};}function a153_0x34eb(_0x46bb3a,_0x375e02){_0x46bb3a=_0x46bb3a-0x151;const _0x19c881=a153_0x19c8();let _0x34ebaa=_0x19c881[_0x46bb3a];return _0x34ebaa;}function resolveDefaultAppName(_0x4c9e3c){const _0x57e8dd=a153_0x34eb,_0x3916df=stringConfigValue(_0x4c9e3c[_0x57e8dd(0x16a)]);if(_0x3916df)return _0x3916df;return Object[_0x57e8dd(0x171)](appProfiles(_0x4c9e3c))[0x0];}function resolveTopLevelAppCode(_0xd486df){const _0x35eea1=a153_0x34eb;return stringConfigValue(_0xd486df[_0x35eea1(0x179)])||stringConfigValue(_0xd486df[_0x35eea1(0x15b)]);}export function resolveAppConfig({raw:_0x25214e,flags:_0x239e6e,layers:_0x29aab2,readEnv:_0x167c93}){const _0x23b160=a153_0x34eb,_0x5a2d5e=_0x29aab2?.[_0x23b160(0x16f)]??{},_0x4dde72=_0x29aab2?.[_0x23b160(0x16e)]??{},_0x214e43=Object[_0x23b160(0x171)](_0x5a2d5e)[_0x23b160(0x154)]>0x0,_0x1e627d=!_0x214e43||_0x5a2d5e[_0x23b160(0x167)]===!![],_0x1d5779=_0x214e43?resolveDefaultAppName(_0x5a2d5e):undefined,_0x287db3=_0x1e627d?resolveDefaultAppName(_0x4dde72):undefined,_0x27fa84=stringConfigValue(_0x239e6e[_0x23b160(0x15b)]),_0x438e17=_0x167c93(_0x23b160(0x16d)),_0x5e0611={};if(_0x25214e['apps']&&typeof _0x25214e[_0x23b160(0x15c)]===_0x23b160(0x166))for(const [_0x3c8ba0,_0x3ad788]of Object['entries'](_0x25214e[_0x23b160(0x15c)])){_0x3ad788&&typeof _0x3ad788===_0x23b160(0x166)&&_0x3ad788[_0x23b160(0x179)]&&(_0x5e0611[_0x3c8ba0]=_0x3ad788);}const _0x506fc5=_0x25214e['defaultApp']||undefined,_0x38d93f=Object[_0x23b160(0x171)](_0x5e0611)[_0x23b160(0x154)]>0x0,_0x179972=_0x27fa84||_0x1d5779||_0x438e17||_0x287db3||_0x506fc5||undefined,_0xd52b37=stringConfigValue(_0x239e6e['appcode']),_0x3c5fd1=_0xd52b37?Object[_0x23b160(0x170)](_0x5e0611)[_0x23b160(0x158)](([,_0x49b46b])=>_0x49b46b?.['appcode']===_0xd52b37):undefined,_0x321c2b=_0x3c5fd1?.[0x0],_0x487ada=_0x3c5fd1?.[0x1],_0x1b3471=_0xd52b37?_0x321c2b:_0x179972;let _0x341d9f=_0x1b3471&&_0x5e0611[_0x1b3471]?_0x5e0611[_0x1b3471]:undefined;_0xd52b37&&_0x487ada&&(_0x341d9f=_0x487ada);const _0x56d71c=_0xd52b37?_0x487ada??_0x341d9f:_0x341d9f,_0x4526ff=!_0x27fa84&&!_0x1d5779&&_0x438e17&&_0x1b3471===_0x438e17,_0x415f3d=_0x27fa84||(_0x4526ff?_0x438e17:undefined)||(_0xd52b37?_0x321c2b:undefined),_0x534da3=_0x56d71c?.[_0x23b160(0x179)],_0x50be81=_0x214e43?resolveTopLevelAppCode(_0x5a2d5e):undefined,_0x27f7fc=_0x1e627d?resolveTopLevelAppCode(_0x4dde72):undefined,_0x5b8595=_0x27fa84||_0x1d5779?_0x534da3:undefined,_0x366ada=!_0x27fa84&&!_0x1d5779?_0x534da3:undefined,_0x3c94c2=_0xd52b37||_0x5b8595||_0x50be81||_0x366ada||_0x27f7fc||undefined,_0x3d1386=_0x214e43?stringConfigValue(_0x5a2d5e['env']):undefined,_0x35a710=_0x1e627d?stringConfigValue(_0x4dde72[_0x23b160(0x159)]):undefined,_0x24c3af=_0x239e6e[_0x23b160(0x159)]||_0x56d71c?.[_0x23b160(0x159)]||_0x3d1386||_0x167c93(_0x23b160(0x168))||_0x35a710||_0x25214e[_0x23b160(0x159)]||DEFAULT_CONFIG_VALUES[_0x23b160(0x159)],_0x13ff2b=_0x56d71c?.[_0x23b160(0x153)]||_0x25214e[_0x23b160(0x153)]||DEFAULT_CONFIG_VALUES['locale'],_0xf89c43=_0x167c93(_0x23b160(0x15f))||_0x56d71c?.[_0x23b160(0x176)]||_0x25214e[_0x23b160(0x176)]||undefined,_0x252e3b=_0x167c93(_0x23b160(0x17a))||_0x56d71c?.['accessKey']||_0x25214e[_0x23b160(0x174)]||undefined,_0x11fbf4=_0x239e6e['format']||_0x167c93('FORMAT')||_0x56d71c?.[_0x23b160(0x160)]||_0x25214e[_0x23b160(0x160)],_0x542095=normalizeLegacyOutputFormat(_0x11fbf4),_0x2307e6=_0x167c93(_0x23b160(0x169))||_0x56d71c?.[_0x23b160(0x15e)]||_0x25214e[_0x23b160(0x15e)],_0x459e5c=_0x2307e6?Number(_0x2307e6)||undefined:undefined,_0x5961ac=_0x167c93(_0x23b160(0x162))||_0x167c93(_0x23b160(0x16c))||_0x56d71c?.[_0x23b160(0x163)]||_0x25214e[_0x23b160(0x163)]||_0x25214e[_0x23b160(0x177)],_0x3fe7ed=_0x5961ac==='read'||_0x5961ac==='write'?_0x5961ac:DEFAULT_CONFIG_VALUES['riskLevel'],_0x43cbc2=_0x167c93(_0x23b160(0x161)),_0x59c551=_0x43cbc2==='1'||_0x43cbc2===_0x23b160(0x173),_0x5bc515=_0x56d71c?.[_0x23b160(0x172)]||_0x25214e[_0x23b160(0x172)]||DEFAULT_CONFIG_VALUES[_0x23b160(0x172)],_0x49df52=isDaily(normalizeEnv(String(_0x24c3af)))?_0x23b160(0x164):_0x23b160(0x157);return{'appCode':typeof _0x3c94c2==='string'&&_0x3c94c2[_0x23b160(0x152)]()?_0x3c94c2[_0x23b160(0x152)]():undefined,'env':_0x49df52,'locale':_0x13ff2b,'cookie':_0xf89c43,'accessKey':_0x252e3b,'format':_0x542095,'pageSize':_0x459e5c,'riskLevel':_0x3fe7ed,'verbose':_0x59c551,'apiDir':_0x5bc515,'apps':_0x5e0611,'defaultApp':_0x506fc5,'currentApp':_0x38d93f?_0x1b3471:undefined,'explicitAppName':_0x415f3d};}
@@ -1 +1 @@
1
- (function(_0x18dc33,_0x46ec4b){const _0x24c07d=a154_0x303a,_0xa71c9d=_0x18dc33();while(!![]){try{const _0x270875=-parseInt(_0x24c07d(0x16d))/0x1*(parseInt(_0x24c07d(0x16e))/0x2)+parseInt(_0x24c07d(0x175))/0x3*(parseInt(_0x24c07d(0x16f))/0x4)+-parseInt(_0x24c07d(0x170))/0x5*(-parseInt(_0x24c07d(0x16b))/0x6)+parseInt(_0x24c07d(0x171))/0x7+parseInt(_0x24c07d(0x172))/0x8*(-parseInt(_0x24c07d(0x173))/0x9)+-parseInt(_0x24c07d(0x174))/0xa+parseInt(_0x24c07d(0x16a))/0xb;if(_0x270875===_0x46ec4b)break;else _0xa71c9d['push'](_0xa71c9d['shift']());}catch(_0x360a56){_0xa71c9d['push'](_0xa71c9d['shift']());}}}(a154_0x491e,0xbbb89));import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';function a154_0x303a(_0x3ee9c2,_0x4c041f){_0x3ee9c2=_0x3ee9c2-0x16a;const _0x491edd=a154_0x491e();let _0x303a7f=_0x491edd[_0x3ee9c2];return _0x303a7f;}function a154_0x491e(){const _0x1eba50=['24dgeObk','3735099CQJzso','9064140IjXvtI','1873239BbPgDA','32926850RTtGHR','56226krHquJ','../auth/get-cookie.js','52bqNLpj','48232ezghAi','4BsrDMK','265mfsxQu','419706DDhmMg'];a154_0x491e=function(){return _0x1eba50;};return a154_0x491e();}export async function buildAuth(_0xab5634){const _0x1ce1ff=a154_0x303a,{getCookie:_0x4dead9}=await import(_0x1ce1ff(0x16c)),_0x2cd193=_0xab5634['cookie']||_0x4dead9(),_0x4c8501=_0x2cd193?await getIsSessionValid():![];return{'cookie':_0x2cd193,'isLoggedIn':_0x4c8501,async 'getOrLogin'(){if(_0x2cd193&&_0x4c8501)return _0x2cd193;throw CliErrors['authRequired']();}};}
1
+ (function(_0x2f3c1e,_0x1c9e30){const _0x19ddf2=a154_0x5b88,_0x17d6ac=_0x2f3c1e();while(!![]){try{const _0x316a16=-parseInt(_0x19ddf2(0x9b))/0x1+-parseInt(_0x19ddf2(0x99))/0x2+parseInt(_0x19ddf2(0x9d))/0x3*(parseInt(_0x19ddf2(0x98))/0x4)+parseInt(_0x19ddf2(0x96))/0x5+-parseInt(_0x19ddf2(0x9c))/0x6+parseInt(_0x19ddf2(0xa0))/0x7*(-parseInt(_0x19ddf2(0x9a))/0x8)+parseInt(_0x19ddf2(0x9e))/0x9*(parseInt(_0x19ddf2(0xa1))/0xa);if(_0x316a16===_0x1c9e30)break;else _0x17d6ac['push'](_0x17d6ac['shift']());}catch(_0x480f66){_0x17d6ac['push'](_0x17d6ac['shift']());}}}(a154_0x16df,0xa8d33));function a154_0x5b88(_0x13dcae,_0x470f1d){_0x13dcae=_0x13dcae-0x96;const _0x16df85=a154_0x16df();let _0x5b88e1=_0x16df85[_0x13dcae];return _0x5b88e1;}function a154_0x16df(){const _0x2536ba=['../auth/get-cookie.js','28ZPYmeK','699878WZEuwN','24icpqTn','973724JcMGDG','4803924jWjfdA','274728pZKVUf','21314160vnxaob','cookie','2907436BqVsnV','10gZWYvu','5262980JjTeUw'];a154_0x16df=function(){return _0x2536ba;};return a154_0x16df();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';export async function buildAuth(_0x114e61){const _0xae813e=a154_0x5b88,{getCookie:_0x51cc34}=await import(_0xae813e(0x97)),_0x2852ca=_0x114e61[_0xae813e(0x9f)]||_0x51cc34(),_0x2c4494=_0x2852ca?await getIsSessionValid():![];return{'cookie':_0x2852ca,'isLoggedIn':_0x2c4494,async 'getOrLogin'(){if(_0x2852ca&&_0x2c4494)return _0x2852ca;throw CliErrors['authRequired']();}};}
@@ -1 +1 @@
1
- const a155_0x1100e7=a155_0x4432;(function(_0x43bfdb,_0x4b8b2f){const _0xddfb11=a155_0x4432,_0x5ab186=_0x43bfdb();while(!![]){try{const _0x8549bb=-parseInt(_0xddfb11(0xe6))/0x1+parseInt(_0xddfb11(0xf5))/0x2+-parseInt(_0xddfb11(0xcd))/0x3*(-parseInt(_0xddfb11(0xcc))/0x4)+parseInt(_0xddfb11(0xd5))/0x5+parseInt(_0xddfb11(0xed))/0x6*(parseInt(_0xddfb11(0xe3))/0x7)+-parseInt(_0xddfb11(0xe7))/0x8*(parseInt(_0xddfb11(0xcb))/0x9)+-parseInt(_0xddfb11(0xd3))/0xa*(parseInt(_0xddfb11(0xd1))/0xb);if(_0x8549bb===_0x4b8b2f)break;else _0x5ab186['push'](_0x5ab186['shift']());}catch(_0x40c870){_0x5ab186['push'](_0x5ab186['shift']());}}}(a155_0x1f21,0xe9c08));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a155_0x1100e7(0xc5);export const CONFIG_NAMES=[a155_0x1100e7(0xc5),a155_0x1100e7(0xf4),a155_0x1100e7(0xee)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a155_0x1100e7(0xe2)](_0x1c8461=>_0x1c8461!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x30c04b){for(const _0x4b771c of CONFIG_NAMES){const _0x2f4438=resolve(_0x30c04b,_0x4b771c);if(existsSync(_0x2f4438))return _0x2f4438;}return undefined;}export function findProjectRootDirectory(_0x3535fb=process[a155_0x1100e7(0xc8)]()){let _0x65cb0a=resolve(_0x3535fb);const {root:_0x546297}=parse(_0x65cb0a),_0xc53f47=homedir();while(!![]){if(resolveConfigPath(_0x65cb0a)){if(_0x65cb0a===_0xc53f47)break;return _0x65cb0a;}if(_0x65cb0a===_0x546297||_0x65cb0a===_0xc53f47)break;const _0x3fec81=dirname(_0x65cb0a);if(_0x3fec81===_0x65cb0a)break;_0x65cb0a=_0x3fec81;}return resolve(_0x3535fb);}export function getProjectConfigPath(){const _0x2ed1af=a155_0x1100e7;return resolveConfigPath(process[_0x2ed1af(0xc8)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x277705){const _0x59b73b=a155_0x1100e7;if(!existsSync(_0x277705))return{'status':_0x59b73b(0xc7)};try{const _0xbeac9d=readFileSync(_0x277705,{'encoding':_0x59b73b(0xcf)});if(!_0xbeac9d?.[_0x59b73b(0xe8)]())return{'status':'empty'};const _0x234406=JSON[_0x59b73b(0xf0)](_0xbeac9d);return{'status':'ok','data':_0x234406};}catch(_0x52c458){return{'status':'error','message':_0x52c458 instanceof Error?_0x52c458[_0x59b73b(0xf1)]:String(_0x52c458)};}}function parseCliConfigJsonFile(_0x3cb140,_0x448dbc,_0x40f68f){const _0x1c1e2d=a155_0x1100e7,_0x475fab=inspectCliConfigJsonFile(_0x3cb140);if(_0x475fab['status']===_0x1c1e2d(0xc7)||_0x475fab[_0x1c1e2d(0xce)]===_0x1c1e2d(0xdb))return{};if(_0x475fab[_0x1c1e2d(0xce)]==='ok')return _0x475fab[_0x1c1e2d(0xd4)];return _0x448dbc===_0x1c1e2d(0xca)&&_0x40f68f&&console[_0x1c1e2d(0xef)](CLI_BIN_NAME+':\x20'+_0x40f68f+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x3cb140+_0x1c1e2d(0xe5)+_0x475fab[_0x1c1e2d(0xf1)]),{};}function normalizeLegacyConfigShape(_0x7d5094){const _0x5c2828=a155_0x1100e7;if(!_0x7d5094||typeof _0x7d5094!==_0x5c2828(0xdf))return{'config':{},'migrated':![]};const _0x937662={..._0x7d5094},_0x321a5c=_0x937662['apps']&&typeof _0x937662['apps']===_0x5c2828(0xdf)?{..._0x937662['apps']}:{},_0x5b129b=Object['keys'](_0x321a5c)['length'],_0x363822=_0x937662[_0x5c2828(0xc4)]||_0x937662['app'];let _0x28346e=![];if(_0x363822&&_0x5b129b===0x0){const _0x3c3453=typeof _0x937662[_0x5c2828(0xeb)]==='string'&&_0x937662['defaultApp']['trim']()?_0x937662[_0x5c2828(0xeb)]:String(_0x363822)['trim']();_0x321a5c[_0x3c3453]={'appcode':String(_0x363822)[_0x5c2828(0xe8)](),..._0x937662['env']!=null?{'env':_0x937662[_0x5c2828(0xd6)]}:{},..._0x937662[_0x5c2828(0xd9)]!=null?{'apiDir':_0x937662[_0x5c2828(0xd9)]}:{},..._0x937662[_0x5c2828(0xdd)]!=null?{'cookie':_0x937662[_0x5c2828(0xdd)]}:{},..._0x937662[_0x5c2828(0xd0)]!=null?{'accessKey':_0x937662[_0x5c2828(0xd0)]}:{},..._0x937662[_0x5c2828(0xe1)]!=null?{'format':_0x937662[_0x5c2828(0xe1)]}:{},..._0x937662[_0x5c2828(0xd8)]!=null?{'pageSize':_0x937662[_0x5c2828(0xd8)]}:{},..._0x937662[_0x5c2828(0xf2)]!=null?{'riskLevel':_0x937662[_0x5c2828(0xf2)]}:{},..._0x937662['locale']!=null?{'locale':_0x937662[_0x5c2828(0xc6)]}:{}},_0x937662['apps']=_0x321a5c;if(!_0x937662[_0x5c2828(0xeb)])_0x937662[_0x5c2828(0xeb)]=_0x3c3453;_0x28346e=!![];}return(_0x5c2828(0xc4)in _0x937662||_0x5c2828(0xde)in _0x937662)&&(delete _0x937662[_0x5c2828(0xc4)],delete _0x937662[_0x5c2828(0xde)],_0x28346e=!![]),{'config':_0x937662,'migrated':_0x28346e};}function writeNormalizedConfigIfNeeded(_0x518762,_0x30a67d){const _0x5203ee=a155_0x1100e7,_0xbbce20=JSON[_0x5203ee(0xc9)](_0x30a67d,null,0x2)+'\x0a';if(normalizedWriteCache[_0x5203ee(0xc3)](_0x518762)===_0xbbce20)return;writeConfigFile(_0x518762,_0x30a67d),normalizedWriteCache[_0x5203ee(0xec)](_0x518762,_0xbbce20);}function parseAndNormalizeConfig(_0x416382,_0x2a2c95,_0xd53146){const _0x4e2613=a155_0x1100e7,_0x76f715=parseCliConfigJsonFile(_0x416382,_0x2a2c95,_0xd53146),_0x15046b=normalizeLegacyConfigShape(_0x76f715);if(_0x15046b[_0x4e2613(0xd7)])try{writeNormalizedConfigIfNeeded(_0x416382,_0x15046b[_0x4e2613(0xd2)]);}catch{}return _0x15046b[_0x4e2613(0xd2)];}export function loadRawConfigLayers(_0x58d225){const _0x5ba699=a155_0x1100e7;let _0xf90cee={},_0x3b7860={};const _0x8abe6a=resolveConfigPath(homedir());_0x8abe6a&&(_0xf90cee=parseAndNormalizeConfig(_0x8abe6a,'warn','Global'));const _0x99323f=_0x58d225??findProjectRootDirectory(),_0x33f61f=resolveConfigPath(_0x99323f);return _0x33f61f&&(_0x3b7860=parseAndNormalizeConfig(_0x33f61f,_0x5ba699(0xca),_0x5ba699(0xdc))),{'globalPath':_0x8abe6a,'projectPath':_0x33f61f,'globalConfig':_0xf90cee,'projectConfig':_0x3b7860};}const INHERIT_WHITELIST=[a155_0x1100e7(0xdd),'accessKey',a155_0x1100e7(0xc6),a155_0x1100e7(0xe1),a155_0x1100e7(0xf2),a155_0x1100e7(0xd8)];function a155_0x4432(_0x341d06,_0x3139d5){_0x341d06=_0x341d06-0xc3;const _0x1f213b=a155_0x1f21();let _0x443238=_0x1f213b[_0x341d06];return _0x443238;}export function mergeRawConfigLayers(_0x59219e){const _0x56ae9d=a155_0x1100e7,{globalConfig:_0x708688,projectConfig:_0x2b1dc5}=_0x59219e,_0x51d482=Object[_0x56ae9d(0xf3)](_0x2b1dc5)[_0x56ae9d(0xda)]>0x0;if(!_0x51d482)return mergeGlobalOnly(_0x708688);if(_0x2b1dc5['inherit']===!![])return mergeFullInherit(_0x708688,_0x2b1dc5);if(_0x2b1dc5[_0x56ae9d(0xea)]===![])return mergeIsolated(_0x2b1dc5);return mergeProjectFirst(_0x708688,_0x2b1dc5);}function mergeGlobalOnly(_0x5412f6){const _0x26e593=a155_0x1100e7,_0x20919a={..._0x5412f6},_0x51963f=_0x5412f6['apps']&&typeof _0x5412f6[_0x26e593(0xe0)]===_0x26e593(0xdf)?_0x5412f6[_0x26e593(0xe0)]:{};if(Object[_0x26e593(0xf3)](_0x51963f)['length']>0x0)_0x20919a[_0x26e593(0xe0)]=_0x51963f;if(_0x5412f6[_0x26e593(0xeb)])_0x20919a[_0x26e593(0xeb)]=_0x5412f6['defaultApp'];else{const _0x4000c1=Object[_0x26e593(0xf3)](_0x51963f);if(_0x4000c1[_0x26e593(0xda)]>0x0)_0x20919a[_0x26e593(0xeb)]=_0x4000c1[0x0];}return _0x20919a;}function mergeIsolated(_0x1b5429){const _0x53f7c0=a155_0x1100e7,_0x31a0c1={..._0x1b5429};delete _0x31a0c1[_0x53f7c0(0xea)];const _0x29c659=_0x1b5429[_0x53f7c0(0xe0)]&&typeof _0x1b5429[_0x53f7c0(0xe0)]===_0x53f7c0(0xdf)?_0x1b5429[_0x53f7c0(0xe0)]:{};Object[_0x53f7c0(0xf3)](_0x29c659)[_0x53f7c0(0xda)]>0x0?_0x31a0c1['apps']=_0x29c659:delete _0x31a0c1['apps'];if(_0x53f7c0(0xeb)in _0x1b5429)_0x31a0c1[_0x53f7c0(0xeb)]=_0x1b5429[_0x53f7c0(0xeb)];else Object['keys'](_0x29c659)['length']>0x0?_0x31a0c1[_0x53f7c0(0xeb)]=Object['keys'](_0x29c659)[0x0]:delete _0x31a0c1[_0x53f7c0(0xeb)];return _0x31a0c1;}function mergeProjectFirst(_0x31bc15,_0x1ecab7){const _0x14823f=a155_0x1100e7,_0x3ed52b={..._0x1ecab7};delete _0x3ed52b['inherit'];for(const _0x4e7956 of INHERIT_WHITELIST){!(_0x4e7956 in _0x3ed52b)&&_0x4e7956 in _0x31bc15&&(_0x3ed52b[_0x4e7956]=_0x31bc15[_0x4e7956]);}const _0x2abdfa=_0x1ecab7['apps']&&typeof _0x1ecab7['apps']==='object'?_0x1ecab7[_0x14823f(0xe0)]:{};Object[_0x14823f(0xf3)](_0x2abdfa)[_0x14823f(0xda)]>0x0?_0x3ed52b[_0x14823f(0xe0)]=_0x2abdfa:delete _0x3ed52b['apps'];if(_0x14823f(0xeb)in _0x1ecab7)_0x3ed52b[_0x14823f(0xeb)]=_0x1ecab7[_0x14823f(0xeb)];else Object['keys'](_0x2abdfa)[_0x14823f(0xda)]>0x0?_0x3ed52b[_0x14823f(0xeb)]=Object[_0x14823f(0xf3)](_0x2abdfa)[0x0]:delete _0x3ed52b[_0x14823f(0xeb)];return _0x3ed52b;}function mergeFullInherit(_0x19cc8c,_0x48225b){const _0x378ced=a155_0x1100e7,_0x4bb595=_0x19cc8c[_0x378ced(0xe0)]&&typeof _0x19cc8c[_0x378ced(0xe0)]===_0x378ced(0xdf)?_0x19cc8c[_0x378ced(0xe0)]:{},_0x26a218=_0x48225b[_0x378ced(0xe0)]&&typeof _0x48225b[_0x378ced(0xe0)]===_0x378ced(0xdf)?_0x48225b[_0x378ced(0xe0)]:{},_0x21c108={..._0x4bb595,..._0x26a218},_0xd0faa5={..._0x19cc8c,..._0x48225b};delete _0xd0faa5[_0x378ced(0xea)];if(Object[_0x378ced(0xf3)](_0x21c108)[_0x378ced(0xda)]>0x0)_0xd0faa5[_0x378ced(0xe0)]=_0x21c108;if('defaultApp'in _0x48225b)_0xd0faa5['defaultApp']=_0x48225b['defaultApp'];else{if(Object['keys'](_0x26a218)['length']>0x0)_0xd0faa5[_0x378ced(0xeb)]=Object[_0x378ced(0xf3)](_0x26a218)[0x0];else{if(_0x19cc8c['defaultApp'])_0xd0faa5[_0x378ced(0xeb)]=_0x19cc8c[_0x378ced(0xeb)];else{const _0xafdf75=Object[_0x378ced(0xf3)](_0x4bb595);if(_0xafdf75[_0x378ced(0xda)]>0x0)_0xd0faa5[_0x378ced(0xeb)]=_0xafdf75[0x0];}}}return _0xd0faa5;}export function readRawConfigWithLayers(_0xd02afb){const _0x2bd3f1=loadRawConfigLayers(_0xd02afb);return{'config':mergeRawConfigLayers(_0x2bd3f1),'layers':_0x2bd3f1};}export function readRawConfig(_0x56263){return mergeRawConfigLayers(loadRawConfigLayers(_0x56263));}export function readConfigFile(_0x38e04f){const _0x93adb6=a155_0x1100e7;return parseAndNormalizeConfig(_0x38e04f,_0x93adb6(0xe4));}export function writeConfigFile(_0x1c43dd,_0x4b3571){const _0x1cffcc=a155_0x1100e7,_0x3b74cd=dirname(_0x1c43dd);!existsSync(_0x3b74cd)&&mkdirSync(_0x3b74cd,{'recursive':!![]});const _0x4f7a8c=_0x1c43dd+_0x1cffcc(0xe9);try{writeFileSync(_0x4f7a8c,JSON[_0x1cffcc(0xc9)](_0x4b3571,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x4f7a8c,_0x1c43dd);}catch(_0x4c9773){try{unlinkSync(_0x4f7a8c);}catch{}throw _0x4c9773;}}export function resolveWriteConfigPath(_0x19230d){const _0x54e449=a155_0x1100e7,_0x10431d=_0x19230d==='project'?process[_0x54e449(0xc8)]():homedir(),_0x4ca79f=resolveConfigPath(_0x10431d);return _0x4ca79f??resolve(_0x10431d,NEW_CONFIG_NAME);}function a155_0x1f21(){const _0x54ab22=['30IPSOQj','.lovrabetrc','error','parse','message','riskLevel','keys','.lovrabet.json','1325110MsnVxI','get','appcode','.rabetbase.json','locale','missing','cwd','stringify','warn','522cxADHq','68YKuDhR','99177qlOkoR','status','utf8','accessKey','138677jfWsBX','config','1560fFMnQp','data','7739890wNItZO','env','migrated','pageSize','apiDir','length','empty','Project','cookie','app','object','apps','format','filter','2158835WUhxBG','silent','\x0a\x20\x20','208381WZpatB','163040bcVRQU','trim','.tmp','inherit','defaultApp','set'];a155_0x1f21=function(){return _0x54ab22;};return a155_0x1f21();}
1
+ const a155_0x2b0672=a155_0x2c53;(function(_0x10de5d,_0x118291){const _0x51db47=a155_0x2c53,_0x2b2190=_0x10de5d();while(!![]){try{const _0x2018f7=parseInt(_0x51db47(0x176))/0x1+parseInt(_0x51db47(0x181))/0x2*(-parseInt(_0x51db47(0x188))/0x3)+-parseInt(_0x51db47(0x177))/0x4+-parseInt(_0x51db47(0x18a))/0x5+-parseInt(_0x51db47(0x1a6))/0x6*(parseInt(_0x51db47(0x187))/0x7)+parseInt(_0x51db47(0x18b))/0x8+parseInt(_0x51db47(0x196))/0x9;if(_0x2018f7===_0x118291)break;else _0x2b2190['push'](_0x2b2190['shift']());}catch(_0x33315c){_0x2b2190['push'](_0x2b2190['shift']());}}}(a155_0x3fb3,0x9cff9));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a155_0x2b0672(0x1a0),a155_0x2b0672(0x17a),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a155_0x2b0672(0x18d)](_0x3fe9ad=>_0x3fe9ad!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x3d67f6){for(const _0x56e520 of CONFIG_NAMES){const _0x3d6c43=resolve(_0x3d67f6,_0x56e520);if(existsSync(_0x3d6c43))return _0x3d6c43;}return undefined;}export function findProjectRootDirectory(_0x373e62=process[a155_0x2b0672(0x179)]()){let _0x4cf9ee=resolve(_0x373e62);const {root:_0x30e7ff}=parse(_0x4cf9ee),_0x38b395=homedir();while(!![]){if(resolveConfigPath(_0x4cf9ee)){if(_0x4cf9ee===_0x38b395)break;return _0x4cf9ee;}if(_0x4cf9ee===_0x30e7ff||_0x4cf9ee===_0x38b395)break;const _0x73c3d5=dirname(_0x4cf9ee);if(_0x73c3d5===_0x4cf9ee)break;_0x4cf9ee=_0x73c3d5;}return resolve(_0x373e62);}export function getProjectConfigPath(){const _0x325149=a155_0x2b0672;return resolveConfigPath(process[_0x325149(0x179)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a155_0x2c53(_0x2b65ec,_0x894f09){_0x2b65ec=_0x2b65ec-0x176;const _0x3fb38b=a155_0x3fb3();let _0x2c53cb=_0x3fb38b[_0x2b65ec];return _0x2c53cb;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x1b6a8e){const _0x3592b8=a155_0x2b0672;if(!existsSync(_0x1b6a8e))return{'status':_0x3592b8(0x17b)};try{const _0x21a712=readFileSync(_0x1b6a8e,{'encoding':_0x3592b8(0x192)});if(!_0x21a712?.[_0x3592b8(0x1a4)]())return{'status':'empty'};const _0x2b7c22=JSON[_0x3592b8(0x17d)](_0x21a712);return{'status':'ok','data':_0x2b7c22};}catch(_0x4c0dba){return{'status':_0x3592b8(0x180),'message':_0x4c0dba instanceof Error?_0x4c0dba[_0x3592b8(0x186)]:String(_0x4c0dba)};}}function parseCliConfigJsonFile(_0x11a473,_0x163c21,_0x1ed573){const _0x397718=a155_0x2b0672,_0x4630ad=inspectCliConfigJsonFile(_0x11a473);if(_0x4630ad[_0x397718(0x178)]===_0x397718(0x17b)||_0x4630ad[_0x397718(0x178)]===_0x397718(0x18f))return{};if(_0x4630ad[_0x397718(0x178)]==='ok')return _0x4630ad[_0x397718(0x189)];return _0x163c21===_0x397718(0x1a7)&&_0x1ed573&&console[_0x397718(0x180)](CLI_BIN_NAME+':\x20'+_0x1ed573+_0x397718(0x199)+_0x11a473+_0x397718(0x1a3)+_0x4630ad[_0x397718(0x186)]),{};}function normalizeLegacyConfigShape(_0x1e6d6f){const _0xa6435e=a155_0x2b0672;if(!_0x1e6d6f||typeof _0x1e6d6f!==_0xa6435e(0x19f))return{'config':{},'migrated':![]};const _0x3c48aa={..._0x1e6d6f},_0xf30f2c=_0x3c48aa['apps']&&typeof _0x3c48aa[_0xa6435e(0x19c)]===_0xa6435e(0x19f)?{..._0x3c48aa[_0xa6435e(0x19c)]}:{},_0x3bdbec=Object['keys'](_0xf30f2c)[_0xa6435e(0x195)],_0x4bce06=_0x3c48aa[_0xa6435e(0x1a2)]||_0x3c48aa['app'];let _0x5c8cb8=![];if(_0x4bce06&&_0x3bdbec===0x0){const _0x5d8d42=typeof _0x3c48aa[_0xa6435e(0x17f)]===_0xa6435e(0x191)&&_0x3c48aa[_0xa6435e(0x17f)][_0xa6435e(0x1a4)]()?_0x3c48aa[_0xa6435e(0x17f)]:String(_0x4bce06)[_0xa6435e(0x1a4)]();_0xf30f2c[_0x5d8d42]={'appcode':String(_0x4bce06)['trim'](),..._0x3c48aa['env']!=null?{'env':_0x3c48aa[_0xa6435e(0x183)]}:{},..._0x3c48aa[_0xa6435e(0x17c)]!=null?{'apiDir':_0x3c48aa[_0xa6435e(0x17c)]}:{},..._0x3c48aa[_0xa6435e(0x19b)]!=null?{'cookie':_0x3c48aa[_0xa6435e(0x19b)]}:{},..._0x3c48aa[_0xa6435e(0x184)]!=null?{'accessKey':_0x3c48aa[_0xa6435e(0x184)]}:{},..._0x3c48aa['format']!=null?{'format':_0x3c48aa[_0xa6435e(0x17e)]}:{},..._0x3c48aa[_0xa6435e(0x182)]!=null?{'pageSize':_0x3c48aa[_0xa6435e(0x182)]}:{},..._0x3c48aa['riskLevel']!=null?{'riskLevel':_0x3c48aa[_0xa6435e(0x18c)]}:{},..._0x3c48aa[_0xa6435e(0x1a5)]!=null?{'locale':_0x3c48aa[_0xa6435e(0x1a5)]}:{}},_0x3c48aa['apps']=_0xf30f2c;if(!_0x3c48aa['defaultApp'])_0x3c48aa['defaultApp']=_0x5d8d42;_0x5c8cb8=!![];}return(_0xa6435e(0x1a2)in _0x3c48aa||_0xa6435e(0x1a1)in _0x3c48aa)&&(delete _0x3c48aa['appcode'],delete _0x3c48aa[_0xa6435e(0x1a1)],_0x5c8cb8=!![]),{'config':_0x3c48aa,'migrated':_0x5c8cb8};}function writeNormalizedConfigIfNeeded(_0x448176,_0x40328c){const _0x3361b7=a155_0x2b0672,_0x5097dd=JSON[_0x3361b7(0x197)](_0x40328c,null,0x2)+'\x0a';if(normalizedWriteCache[_0x3361b7(0x194)](_0x448176)===_0x5097dd)return;writeConfigFile(_0x448176,_0x40328c),normalizedWriteCache[_0x3361b7(0x190)](_0x448176,_0x5097dd);}function parseAndNormalizeConfig(_0x2902c7,_0x2e738b,_0xac98c1){const _0x130493=a155_0x2b0672,_0x27584c=parseCliConfigJsonFile(_0x2902c7,_0x2e738b,_0xac98c1),_0x411148=normalizeLegacyConfigShape(_0x27584c);if(_0x411148[_0x130493(0x198)])try{writeNormalizedConfigIfNeeded(_0x2902c7,_0x411148['config']);}catch{}return _0x411148[_0x130493(0x19a)];}export function loadRawConfigLayers(_0x16c53a){const _0x287d31=a155_0x2b0672;let _0x5aaae9={},_0x2d7905={};const _0x4e5c8b=resolveConfigPath(homedir());_0x4e5c8b&&(_0x5aaae9=parseAndNormalizeConfig(_0x4e5c8b,_0x287d31(0x1a7),'Global'));const _0x4258c8=_0x16c53a??findProjectRootDirectory(),_0x45d3f6=resolveConfigPath(_0x4258c8);return _0x45d3f6&&(_0x2d7905=parseAndNormalizeConfig(_0x45d3f6,_0x287d31(0x1a7),_0x287d31(0x185))),{'globalPath':_0x4e5c8b,'projectPath':_0x45d3f6,'globalConfig':_0x5aaae9,'projectConfig':_0x2d7905};}function a155_0x3fb3(){const _0x4729d2=['app','appcode','\x0a\x20\x20','trim','locale','2595534UBcvZw','warn','1225598kkADBr','4476068OLbqcI','status','cwd','.lovrabet.json','missing','apiDir','parse','format','defaultApp','error','2PMqYjc','pageSize','env','accessKey','Project','message','14KsGGdf','321831MOJCmG','data','5179845MfOdUO','9362392AjbaoR','riskLevel','filter','silent','empty','set','string','utf8','keys','get','length','12371481daUUIL','stringify','migrated','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','config','cookie','apps','inherit','project','object','.rabetbase.json'];a155_0x3fb3=function(){return _0x4729d2;};return a155_0x3fb3();}const INHERIT_WHITELIST=[a155_0x2b0672(0x19b),a155_0x2b0672(0x184),a155_0x2b0672(0x1a5),'format',a155_0x2b0672(0x18c),'pageSize'];export function mergeRawConfigLayers(_0x268c53){const _0x48db6a=a155_0x2b0672,{globalConfig:_0x4165e7,projectConfig:_0xe00d78}=_0x268c53,_0x17e998=Object[_0x48db6a(0x193)](_0xe00d78)['length']>0x0;if(!_0x17e998)return mergeGlobalOnly(_0x4165e7);if(_0xe00d78[_0x48db6a(0x19d)]===!![])return mergeFullInherit(_0x4165e7,_0xe00d78);if(_0xe00d78['inherit']===![])return mergeIsolated(_0xe00d78);return mergeProjectFirst(_0x4165e7,_0xe00d78);}function mergeGlobalOnly(_0x51ade8){const _0x88dcf8=a155_0x2b0672,_0x1f6367={..._0x51ade8},_0x3517f8=_0x51ade8[_0x88dcf8(0x19c)]&&typeof _0x51ade8['apps']===_0x88dcf8(0x19f)?_0x51ade8[_0x88dcf8(0x19c)]:{};if(Object[_0x88dcf8(0x193)](_0x3517f8)[_0x88dcf8(0x195)]>0x0)_0x1f6367[_0x88dcf8(0x19c)]=_0x3517f8;if(_0x51ade8[_0x88dcf8(0x17f)])_0x1f6367[_0x88dcf8(0x17f)]=_0x51ade8[_0x88dcf8(0x17f)];else{const _0x4253f7=Object[_0x88dcf8(0x193)](_0x3517f8);if(_0x4253f7[_0x88dcf8(0x195)]>0x0)_0x1f6367['defaultApp']=_0x4253f7[0x0];}return _0x1f6367;}function mergeIsolated(_0x1f7e0e){const _0x269494=a155_0x2b0672,_0x19d4c3={..._0x1f7e0e};delete _0x19d4c3[_0x269494(0x19d)];const _0x599250=_0x1f7e0e['apps']&&typeof _0x1f7e0e[_0x269494(0x19c)]===_0x269494(0x19f)?_0x1f7e0e[_0x269494(0x19c)]:{};Object[_0x269494(0x193)](_0x599250)[_0x269494(0x195)]>0x0?_0x19d4c3['apps']=_0x599250:delete _0x19d4c3[_0x269494(0x19c)];if(_0x269494(0x17f)in _0x1f7e0e)_0x19d4c3['defaultApp']=_0x1f7e0e['defaultApp'];else Object['keys'](_0x599250)[_0x269494(0x195)]>0x0?_0x19d4c3[_0x269494(0x17f)]=Object['keys'](_0x599250)[0x0]:delete _0x19d4c3[_0x269494(0x17f)];return _0x19d4c3;}function mergeProjectFirst(_0x2d4642,_0xb4526a){const _0x53e62f=a155_0x2b0672,_0x2d512a={..._0xb4526a};delete _0x2d512a[_0x53e62f(0x19d)];for(const _0x3276da of INHERIT_WHITELIST){!(_0x3276da in _0x2d512a)&&_0x3276da in _0x2d4642&&(_0x2d512a[_0x3276da]=_0x2d4642[_0x3276da]);}const _0x2048f5=_0xb4526a['apps']&&typeof _0xb4526a[_0x53e62f(0x19c)]===_0x53e62f(0x19f)?_0xb4526a[_0x53e62f(0x19c)]:{};Object[_0x53e62f(0x193)](_0x2048f5)[_0x53e62f(0x195)]>0x0?_0x2d512a['apps']=_0x2048f5:delete _0x2d512a[_0x53e62f(0x19c)];if(_0x53e62f(0x17f)in _0xb4526a)_0x2d512a[_0x53e62f(0x17f)]=_0xb4526a[_0x53e62f(0x17f)];else Object[_0x53e62f(0x193)](_0x2048f5)[_0x53e62f(0x195)]>0x0?_0x2d512a[_0x53e62f(0x17f)]=Object['keys'](_0x2048f5)[0x0]:delete _0x2d512a[_0x53e62f(0x17f)];return _0x2d512a;}function mergeFullInherit(_0x58e860,_0xc94bba){const _0x41ebcb=a155_0x2b0672,_0x529a7b=_0x58e860['apps']&&typeof _0x58e860['apps']===_0x41ebcb(0x19f)?_0x58e860[_0x41ebcb(0x19c)]:{},_0x305f17=_0xc94bba[_0x41ebcb(0x19c)]&&typeof _0xc94bba[_0x41ebcb(0x19c)]===_0x41ebcb(0x19f)?_0xc94bba[_0x41ebcb(0x19c)]:{},_0x443116={..._0x529a7b,..._0x305f17},_0x5b4781={..._0x58e860,..._0xc94bba};delete _0x5b4781[_0x41ebcb(0x19d)];if(Object['keys'](_0x443116)[_0x41ebcb(0x195)]>0x0)_0x5b4781[_0x41ebcb(0x19c)]=_0x443116;if(_0x41ebcb(0x17f)in _0xc94bba)_0x5b4781[_0x41ebcb(0x17f)]=_0xc94bba['defaultApp'];else{if(Object['keys'](_0x305f17)[_0x41ebcb(0x195)]>0x0)_0x5b4781[_0x41ebcb(0x17f)]=Object[_0x41ebcb(0x193)](_0x305f17)[0x0];else{if(_0x58e860['defaultApp'])_0x5b4781[_0x41ebcb(0x17f)]=_0x58e860[_0x41ebcb(0x17f)];else{const _0xd13dec=Object[_0x41ebcb(0x193)](_0x529a7b);if(_0xd13dec[_0x41ebcb(0x195)]>0x0)_0x5b4781['defaultApp']=_0xd13dec[0x0];}}}return _0x5b4781;}export function readRawConfigWithLayers(_0x23cf73){const _0x2df5e0=loadRawConfigLayers(_0x23cf73);return{'config':mergeRawConfigLayers(_0x2df5e0),'layers':_0x2df5e0};}export function readRawConfig(_0x3996a8){return mergeRawConfigLayers(loadRawConfigLayers(_0x3996a8));}export function readConfigFile(_0x2c9aac){const _0x29a019=a155_0x2b0672;return parseAndNormalizeConfig(_0x2c9aac,_0x29a019(0x18e));}export function writeConfigFile(_0x4a7347,_0x2258f1){const _0x564ca4=a155_0x2b0672,_0x4e96ba=dirname(_0x4a7347);!existsSync(_0x4e96ba)&&mkdirSync(_0x4e96ba,{'recursive':!![]});const _0x44aad8=_0x4a7347+'.tmp';try{writeFileSync(_0x44aad8,JSON[_0x564ca4(0x197)](_0x2258f1,null,0x2)+'\x0a',{'encoding':_0x564ca4(0x192),'mode':0x180}),renameSync(_0x44aad8,_0x4a7347);}catch(_0x2cb2ed){try{unlinkSync(_0x44aad8);}catch{}throw _0x2cb2ed;}}export function resolveWriteConfigPath(_0x127361){const _0x2b08bc=a155_0x2b0672,_0xa6c1da=_0x127361===_0x2b08bc(0x19e)?process[_0x2b08bc(0x179)]():homedir(),_0x1ebbc1=resolveConfigPath(_0xa6c1da);return _0x1ebbc1??resolve(_0xa6c1da,NEW_CONFIG_NAME);}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a156_0x1bb3bf=a156_0x1df8;(function(_0x3b8d03,_0x4a2700){const _0x31530e=a156_0x1df8,_0x1ac968=_0x3b8d03();while(!![]){try{const _0x70d54=parseInt(_0x31530e(0xea))/0x1*(parseInt(_0x31530e(0xf4))/0x2)+parseInt(_0x31530e(0xe0))/0x3+-parseInt(_0x31530e(0xe9))/0x4+-parseInt(_0x31530e(0xf9))/0x5+parseInt(_0x31530e(0xf7))/0x6*(parseInt(_0x31530e(0xf3))/0x7)+parseInt(_0x31530e(0xf1))/0x8+parseInt(_0x31530e(0xee))/0x9;if(_0x70d54===_0x4a2700)break;else _0x1ac968['push'](_0x1ac968['shift']());}catch(_0x271a78){_0x1ac968['push'](_0x1ac968['shift']());}}}(a156_0x61da,0x612c5));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(_0x4400de){return process.env[`RABETBASE_${_0x4400de}`]||process.env[`LOVRABET_${_0x4400de}`]||undefined;}export async function createContext(_0x3ab819){const _0x5b2f87=a156_0x1df8,{config:_0x125433,layers:_0x42af55}=readRawConfigWithLayers(),_0x1a1bc8=buildConfig(_0x125433,_0x3ab819,_0x42af55),{initEnv:_0x349856}=await import('./constant/env.js');if(_0x1a1bc8[_0x5b2f87(0xe7)])_0x349856(_0x1a1bc8[_0x5b2f87(0xe7)]);else _0x3ab819[_0x5b2f87(0xe7)]&&typeof _0x3ab819['env']==='string'&&_0x349856(_0x3ab819[_0x5b2f87(0xe7)]);const {initDomains:_0x3c581b,getUserDomain:_0x1b80c3,getApiDomain:_0x209eae}=await import(_0x5b2f87(0xfe));_0x3c581b({'apiDomain':_0x125433['apiDomain']||undefined,'userDomain':_0x125433[_0x5b2f87(0xde)]||undefined,'runtimeDomain':_0x125433[_0x5b2f87(0xe1)]||undefined});const _0x42ac40={'apiDomain':_0x209eae(),'userDomain':_0x1b80c3()},_0x5c5169=await buildAuth(_0x1a1bc8);logger[_0x5b2f87(0xfc)](process[_0x5b2f87(0xd5)]());const _0x4d15dd=(CLI_BIN_NAME+'\x20'+process[_0x5b2f87(0xfd)][_0x5b2f87(0xfb)](0x2)[_0x5b2f87(0xe4)]('\x20'))[_0x5b2f87(0xe2)]();logger[_0x5b2f87(0xdb)](_0x4d15dd);const {isNonInteractive:_0x5178f8}=await import(_0x5b2f87(0xe3)),_0x1941b5=_0x5178f8(_0x3ab819);return{'config':_0x1a1bc8,'auth':_0x5c5169,'logger':logger,'env':_0x42ac40,'nonInteractive':_0x1941b5};}export function buildConfigFromFlags(_0xc7361b){const {config:_0x2f5d0a,layers:_0x30dfcd}=readRawConfigWithLayers();return buildConfig(_0x2f5d0a,_0xc7361b,_0x30dfcd);}export function getConfigAppCode(_0x14279f){const _0x5af54a=a156_0x1df8,_0x585fb2=readRawConfig(_0x14279f);if(_0x585fb2[_0x5af54a(0xd8)]&&typeof _0x585fb2['apps']==='object'){const _0x85db3f=_0x585fb2[_0x5af54a(0xe5)];if(_0x85db3f&&_0x585fb2[_0x5af54a(0xd8)][_0x85db3f]?.[_0x5af54a(0xf0)])return String(_0x585fb2['apps'][_0x85db3f][_0x5af54a(0xf0)])[_0x5af54a(0xe2)]();const _0x30cb33=Object['values'](_0x585fb2[_0x5af54a(0xd8)])[0x0];if(_0x30cb33?.[_0x5af54a(0xf0)])return String(_0x30cb33['appcode'])[_0x5af54a(0xe2)]();}const _0x29742a=_0x585fb2[_0x5af54a(0xf0)]||_0x585fb2[_0x5af54a(0xdc)];if(typeof _0x29742a!=='string'||_0x29742a['trim']()==='')return undefined;return _0x29742a[_0x5af54a(0xe2)]();}export function getMultiAppConfigs(_0x2eb924=a156_0x1bb3bf(0xd9),_0x4e9100){const _0x4bdca4=a156_0x1bb3bf,_0x4510e5=loadRawConfigLayers(_0x4e9100);let _0x1e3bc3,_0xd769ff;if(_0x2eb924===_0x4bdca4(0xe6)){const _0x5693ac=_0x4510e5[_0x4bdca4(0xf2)][_0x4bdca4(0xd8)]&&typeof _0x4510e5[_0x4bdca4(0xf2)][_0x4bdca4(0xd8)]===_0x4bdca4(0xda)?_0x4510e5[_0x4bdca4(0xf2)][_0x4bdca4(0xd8)]:{},_0x6712a5=_0x4510e5['projectConfig']['apps']&&typeof _0x4510e5[_0x4bdca4(0xf8)][_0x4bdca4(0xd8)]===_0x4bdca4(0xda)?_0x4510e5[_0x4bdca4(0xf8)][_0x4bdca4(0xd8)]:{};_0x1e3bc3={..._0x5693ac,..._0x6712a5};const _0x3a3b2c=readRawConfig(_0x4e9100);_0xd769ff=_0x3a3b2c[_0x4bdca4(0xe5)];}else _0x1e3bc3=_0x4510e5['projectConfig'][_0x4bdca4(0xd8)],_0xd769ff=_0x4510e5[_0x4bdca4(0xf8)]['defaultApp'];if(!_0x1e3bc3||typeof _0x1e3bc3!==_0x4bdca4(0xda)||Object['keys'](_0x1e3bc3)[_0x4bdca4(0xec)]===0x0)return null;return Object[_0x4bdca4(0xd6)](_0x1e3bc3)[_0x4bdca4(0xdd)](([_0x274fb6,_0x1cffd7])=>({'name':_0x274fb6,'appcode':_0x1cffd7?.['appcode']||'','isDefault':_0x274fb6===_0xd769ff,'env':_0x1cffd7?.['env'],'apiDir':_0x1cffd7?.['apiDir'],'cookie':_0x1cffd7?.[_0x4bdca4(0xeb)]||undefined}))[_0x4bdca4(0xef)](_0xab1a2a=>_0xab1a2a['appcode']);}function a156_0x61da(){const _0x425bb2=['1800364FCKpfK','8344Ouzhqc','cookie','length','api.ts','3422664RrozFs','filter','appcode','1718064LfcRhD','globalConfig','42CaXFId','16RKqMnr','-api.ts','string','555582czFUvw','projectConfig','2531800wBEMEZ','https://g.lovrabet.com/dist/lovrabet-skill','slice','setLogPath','argv','./constant/domain.js','cwd','entries','apiDir','apps','project','object','setRawCommand','app','map','userDomain','template_base_url','411252FzaHyU','runtimeDomain','trim','./utils/is-non-interactive.js','join','defaultApp','merged','env','find'];a156_0x61da=function(){return _0x425bb2;};return a156_0x61da();}export function getTemplateBaseUrl(_0x63cefa){const _0x975a00=a156_0x1bb3bf,_0x195d21=readRawConfig(_0x63cefa);if(_0x195d21[_0x975a00(0xdf)]&&typeof _0x195d21[_0x975a00(0xdf)]===_0x975a00(0xf6))return _0x195d21[_0x975a00(0xdf)]['replace'](/\/$/,'');return _0x975a00(0xfa);}function buildConfig(_0x527483,_0x5b1207,_0x32b4ce){return{...resolveAppConfig({'raw':_0x527483,'flags':_0x5b1207,'layers':_0x32b4ce,'readEnv':env}),'raw':_0x527483};}function a156_0x1df8(_0x5a4243,_0x4fa9de){_0x5a4243=_0x5a4243-0xd5;const _0x61da3e=a156_0x61da();let _0x1df810=_0x61da3e[_0x5a4243];return _0x1df810;}export function resolveApiFilePath(_0x534b11,_0x32acd5){const _0x3052d6=a156_0x1bb3bf,_0x1555de=resolve(process[_0x3052d6(0xd5)](),_0x534b11),_0xa6b08b=resolve(_0x1555de,_0x3052d6(0xed));if(!_0x32acd5)return _0xa6b08b;const _0x4c692c=readRawConfig(),_0x25a184=_0x4c692c[_0x3052d6(0xd8)]&&typeof _0x4c692c[_0x3052d6(0xd8)]===_0x3052d6(0xda)?_0x4c692c[_0x3052d6(0xd8)]:{},_0x297601=Object['entries'](_0x25a184)[_0x3052d6(0xe8)](([,_0x1505cf])=>_0x1505cf?.[_0x3052d6(0xf0)]===_0x32acd5);if(!_0x297601)return _0xa6b08b;const [_0x342c6d,_0x595106]=_0x297601,_0x241d6e=typeof _0x4c692c['defaultApp']===_0x3052d6(0xf6)?_0x4c692c[_0x3052d6(0xe5)]:undefined;if(_0x595106?.[_0x3052d6(0xd7)])return _0xa6b08b;if(_0x241d6e&&_0x342c6d!==_0x241d6e)return resolve(_0x1555de,_0x342c6d+_0x3052d6(0xf5));return _0xa6b08b;}
1
+ function a156_0x327c(_0x380067,_0xd7f3f9){_0x380067=_0x380067-0x19d;const _0x5cbce7=a156_0x5cbc();let _0x327c94=_0x5cbce7[_0x380067];return _0x327c94;}const a156_0x180b5e=a156_0x327c;(function(_0x12b1f9,_0x4f1342){const _0x1c8ff4=a156_0x327c,_0x4735e5=_0x12b1f9();while(!![]){try{const _0x4b7f7e=-parseInt(_0x1c8ff4(0x1b0))/0x1+parseInt(_0x1c8ff4(0x1aa))/0x2+-parseInt(_0x1c8ff4(0x1af))/0x3+parseInt(_0x1c8ff4(0x1b5))/0x4*(parseInt(_0x1c8ff4(0x1a7))/0x5)+parseInt(_0x1c8ff4(0x1ae))/0x6+-parseInt(_0x1c8ff4(0x1bd))/0x7+parseInt(_0x1c8ff4(0x1a3))/0x8;if(_0x4b7f7e===_0x4f1342)break;else _0x4735e5['push'](_0x4735e5['shift']());}catch(_0xf0125d){_0x4735e5['push'](_0x4735e5['shift']());}}}(a156_0x5cbc,0x91327));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(_0xf6c799){return process.env[`RABETBASE_${_0xf6c799}`]||process.env[`LOVRABET_${_0xf6c799}`]||undefined;}export async function createContext(_0x2f1e7c){const _0x5a1d4b=a156_0x327c,{config:_0x2a94be,layers:_0x1a8c77}=readRawConfigWithLayers(),_0x2369b1=buildConfig(_0x2a94be,_0x2f1e7c,_0x1a8c77),{initEnv:_0x4bda31}=await import(_0x5a1d4b(0x1a4));if(_0x2369b1[_0x5a1d4b(0x19f)])_0x4bda31(_0x2369b1['env']);else _0x2f1e7c[_0x5a1d4b(0x19f)]&&typeof _0x2f1e7c['env']==='string'&&_0x4bda31(_0x2f1e7c['env']);const {initDomains:_0x4c27fb,getUserDomain:_0x3fc926,getApiDomain:_0x41a046}=await import(_0x5a1d4b(0x1b1));_0x4c27fb({'apiDomain':_0x2a94be[_0x5a1d4b(0x1bc)]||undefined,'userDomain':_0x2a94be[_0x5a1d4b(0x1c5)]||undefined,'runtimeDomain':_0x2a94be[_0x5a1d4b(0x1bf)]||undefined});const _0x4fadd9={'apiDomain':_0x41a046(),'userDomain':_0x3fc926()},_0x447eac=await buildAuth(_0x2369b1);logger[_0x5a1d4b(0x1a1)](process[_0x5a1d4b(0x1c1)]());const _0x24897b=(CLI_BIN_NAME+'\x20'+process[_0x5a1d4b(0x1a8)][_0x5a1d4b(0x1b8)](0x2)['join']('\x20'))[_0x5a1d4b(0x1b7)]();logger['setRawCommand'](_0x24897b);const {isNonInteractive:_0x310cd2}=await import(_0x5a1d4b(0x1c0)),_0x5ce6c3=_0x310cd2(_0x2f1e7c);return{'config':_0x2369b1,'auth':_0x447eac,'logger':logger,'env':_0x4fadd9,'nonInteractive':_0x5ce6c3};}export function buildConfigFromFlags(_0x68cc0){const {config:_0xd1ee8d,layers:_0xd38615}=readRawConfigWithLayers();return buildConfig(_0xd1ee8d,_0x68cc0,_0xd38615);}export function getConfigAppCode(_0x1451c9){const _0x2f7015=a156_0x327c,_0x3cdd42=readRawConfig(_0x1451c9);if(_0x3cdd42[_0x2f7015(0x1ad)]&&typeof _0x3cdd42[_0x2f7015(0x1ad)]===_0x2f7015(0x1bb)){const _0x2c6527=_0x3cdd42[_0x2f7015(0x1ba)];if(_0x2c6527&&_0x3cdd42[_0x2f7015(0x1ad)][_0x2c6527]?.[_0x2f7015(0x1c3)])return String(_0x3cdd42[_0x2f7015(0x1ad)][_0x2c6527][_0x2f7015(0x1c3)])[_0x2f7015(0x1b7)]();const _0x4cd912=Object[_0x2f7015(0x1b3)](_0x3cdd42[_0x2f7015(0x1ad)])[0x0];if(_0x4cd912?.[_0x2f7015(0x1c3)])return String(_0x4cd912[_0x2f7015(0x1c3)])['trim']();}const _0x920112=_0x3cdd42[_0x2f7015(0x1c3)]||_0x3cdd42['app'];if(typeof _0x920112!==_0x2f7015(0x1b6)||_0x920112[_0x2f7015(0x1b7)]()==='')return undefined;return _0x920112['trim']();}export function getMultiAppConfigs(_0x28b40b=a156_0x180b5e(0x1a9),_0x12f7a0){const _0x454fc6=a156_0x180b5e,_0x3073c5=loadRawConfigLayers(_0x12f7a0);let _0x167cb1,_0x49d421;if(_0x28b40b===_0x454fc6(0x1b2)){const _0x5c962a=_0x3073c5[_0x454fc6(0x19e)][_0x454fc6(0x1ad)]&&typeof _0x3073c5['globalConfig'][_0x454fc6(0x1ad)]===_0x454fc6(0x1bb)?_0x3073c5[_0x454fc6(0x19e)]['apps']:{},_0x42b995=_0x3073c5[_0x454fc6(0x1ac)][_0x454fc6(0x1ad)]&&typeof _0x3073c5[_0x454fc6(0x1ac)]['apps']===_0x454fc6(0x1bb)?_0x3073c5[_0x454fc6(0x1ac)]['apps']:{};_0x167cb1={..._0x5c962a,..._0x42b995};const _0xf1a35c=readRawConfig(_0x12f7a0);_0x49d421=_0xf1a35c[_0x454fc6(0x1ba)];}else _0x167cb1=_0x3073c5[_0x454fc6(0x1ac)]['apps'],_0x49d421=_0x3073c5[_0x454fc6(0x1ac)][_0x454fc6(0x1ba)];if(!_0x167cb1||typeof _0x167cb1!=='object'||Object[_0x454fc6(0x1a0)](_0x167cb1)[_0x454fc6(0x1ab)]===0x0)return null;return Object[_0x454fc6(0x1a6)](_0x167cb1)[_0x454fc6(0x1b4)](([_0x5f39d2,_0x1f66c7])=>({'name':_0x5f39d2,'appcode':_0x1f66c7?.[_0x454fc6(0x1c3)]||'','isDefault':_0x5f39d2===_0x49d421,'env':_0x1f66c7?.[_0x454fc6(0x19f)],'apiDir':_0x1f66c7?.[_0x454fc6(0x1be)],'cookie':_0x1f66c7?.[_0x454fc6(0x1c4)]||undefined}))[_0x454fc6(0x1a2)](_0xeb7a06=>_0xeb7a06['appcode']);}export function getTemplateBaseUrl(_0x405672){const _0x54aa41=a156_0x180b5e,_0x286d69=readRawConfig(_0x405672);if(_0x286d69[_0x54aa41(0x1a5)]&&typeof _0x286d69[_0x54aa41(0x1a5)]===_0x54aa41(0x1b6))return _0x286d69[_0x54aa41(0x1a5)][_0x54aa41(0x19d)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}function buildConfig(_0x28976a,_0xb0c344,_0x4b1dd7){return{...resolveAppConfig({'raw':_0x28976a,'flags':_0xb0c344,'layers':_0x4b1dd7,'readEnv':env}),'raw':_0x28976a};}export function resolveApiFilePath(_0x588b33,_0x315c9a){const _0x3d457f=a156_0x180b5e,_0x3e296b=resolve(process[_0x3d457f(0x1c1)](),_0x588b33),_0xd3cae2=resolve(_0x3e296b,_0x3d457f(0x1c2));if(!_0x315c9a)return _0xd3cae2;const _0x3d75a5=readRawConfig(),_0x83fa62=_0x3d75a5[_0x3d457f(0x1ad)]&&typeof _0x3d75a5[_0x3d457f(0x1ad)]==='object'?_0x3d75a5[_0x3d457f(0x1ad)]:{},_0x2a5c9d=Object[_0x3d457f(0x1a6)](_0x83fa62)['find'](([,_0x181e90])=>_0x181e90?.['appcode']===_0x315c9a);if(!_0x2a5c9d)return _0xd3cae2;const [_0x17665a,_0x8e3b9]=_0x2a5c9d,_0x3b3d1b=typeof _0x3d75a5[_0x3d457f(0x1ba)]===_0x3d457f(0x1b6)?_0x3d75a5[_0x3d457f(0x1ba)]:undefined;if(_0x8e3b9?.[_0x3d457f(0x1be)])return _0xd3cae2;if(_0x3b3d1b&&_0x17665a!==_0x3b3d1b)return resolve(_0x3e296b,_0x17665a+_0x3d457f(0x1b9));return _0xd3cae2;}function a156_0x5cbc(){const _0x4ced8f=['apiDir','runtimeDomain','./utils/is-non-interactive.js','cwd','api.ts','appcode','cookie','userDomain','replace','globalConfig','env','keys','setLogPath','filter','7373552wrGnRK','./constant/env.js','template_base_url','entries','24100idjVAT','argv','project','692772JLASPc','length','projectConfig','apps','3207852qihOjo','754698SNjUrX','609981fCZSLK','./constant/domain.js','merged','values','map','304sdhGar','string','trim','slice','-api.ts','defaultApp','object','apiDomain','4989376tDNuZB'];a156_0x5cbc=function(){return _0x4ced8f;};return a156_0x5cbc();}
@@ -1 +1 @@
1
- (function(_0x202d1d,_0x48855f){const _0x366ab5=a157_0x4800,_0x4bd9fc=_0x202d1d();while(!![]){try{const _0x1f7c8e=parseInt(_0x366ab5(0x1bb))/0x1*(parseInt(_0x366ab5(0x1c1))/0x2)+-parseInt(_0x366ab5(0x1c9))/0x3*(-parseInt(_0x366ab5(0x1be))/0x4)+parseInt(_0x366ab5(0x1c2))/0x5+parseInt(_0x366ab5(0x1bc))/0x6*(parseInt(_0x366ab5(0x1cb))/0x7)+parseInt(_0x366ab5(0x1b9))/0x8*(parseInt(_0x366ab5(0x1ca))/0x9)+parseInt(_0x366ab5(0x1c7))/0xa+-parseInt(_0x366ab5(0x1bd))/0xb*(parseInt(_0x366ab5(0x1c3))/0xc);if(_0x1f7c8e===_0x48855f)break;else _0x4bd9fc['push'](_0x4bd9fc['shift']());}catch(_0x233488){_0x4bd9fc['push'](_0x4bd9fc['shift']());}}}(a157_0x47c0,0x73d19));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a157_0x4800(_0x147682,_0x6e724c){_0x147682=_0x147682-0x1b8;const _0x47c062=a157_0x47c0();let _0x48000f=_0x47c062[_0x147682];return _0x48000f;}function parseApiFile(_0x15c53d){const _0x1648bf=a157_0x4800,_0x36c7c6=[],_0x11d280=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1aa4c3;while((_0x1aa4c3=_0x11d280[_0x1648bf(0x1ba)](_0x15c53d))!==null){_0x36c7c6[_0x1648bf(0x1c5)]({'datasetCode':_0x1aa4c3[0x1],'tableName':_0x1aa4c3[0x2],'name':_0x1aa4c3[0x3],'alias':_0x1aa4c3[0x4]});}return _0x36c7c6;}export function loadAliasMap(_0x18e1df,_0x36b752,_0x3030c8){const _0x1149aa=a157_0x4800,_0x16c66e=_0x3030c8??resolve(process[_0x1149aa(0x1c4)](),_0x18e1df,_0x1149aa(0x1c0));if(cache[_0x1149aa(0x1bf)](_0x16c66e))return cache[_0x1149aa(0x1b8)](_0x16c66e);if(!existsSync(_0x16c66e))return cache[_0x1149aa(0x1c6)](_0x16c66e,[]),[];try{const _0xb6d928=readFileSync(_0x16c66e,'utf-8'),_0xdbfa9b=parseApiFile(_0xb6d928);return cache[_0x1149aa(0x1c6)](_0x16c66e,_0xdbfa9b),_0xdbfa9b;}catch{return cache[_0x1149aa(0x1c6)](_0x16c66e,[]),[];}}function a157_0x47c0(){const _0x55ce2d=['14988FqyLzw','3977963gmIxeh','2583988mAbTXf','has','api.ts','18926PmxYOV','443505lYuQyn','24Tfsnuc','cwd','push','set','1867660pFfNYK','find','3lSyPSO','81qeMTOL','112TRuxiP','get','125864AHzzAb','exec','10rXfgBz'];a157_0x47c0=function(){return _0x55ce2d;};return a157_0x47c0();}export function resolveAlias(_0x597428,_0x42fef7,_0x56f972,_0xfe6e96){const _0x30d43d=a157_0x4800;if(!_0x42fef7)return undefined;const _0x5c875f=loadAliasMap(_0x597428,_0x56f972,_0xfe6e96),_0x220d51=_0x5c875f[_0x30d43d(0x1c8)](_0x278efb=>_0x278efb['alias']===_0x42fef7);return _0x220d51?.['datasetCode'];}export function listAliases(_0x56f653,_0xedb32f,_0x1ab2c0){return loadAliasMap(_0x56f653,_0xedb32f,_0x1ab2c0);}
1
+ function a157_0x5535(_0x2bab55,_0x4bf61c){_0x2bab55=_0x2bab55-0xd8;const _0x2a6dbc=a157_0x2a6d();let _0x55354d=_0x2a6dbc[_0x2bab55];return _0x55354d;}(function(_0x438743,_0x5e5c19){const _0x77e2d1=a157_0x5535,_0x5dd863=_0x438743();while(!![]){try{const _0x60a72a=parseInt(_0x77e2d1(0xe9))/0x1*(-parseInt(_0x77e2d1(0xdf))/0x2)+parseInt(_0x77e2d1(0xe1))/0x3+-parseInt(_0x77e2d1(0xdc))/0x4*(-parseInt(_0x77e2d1(0xdd))/0x5)+-parseInt(_0x77e2d1(0xe2))/0x6+-parseInt(_0x77e2d1(0xea))/0x7+parseInt(_0x77e2d1(0xd8))/0x8+parseInt(_0x77e2d1(0xe3))/0x9*(parseInt(_0x77e2d1(0xe0))/0xa);if(_0x60a72a===_0x5e5c19)break;else _0x5dd863['push'](_0x5dd863['shift']());}catch(_0x1c7e12){_0x5dd863['push'](_0x5dd863['shift']());}}}(a157_0x2a6d,0xbf535));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x24d7b5){const _0x54675b=a157_0x5535,_0x526a7e=[],_0x380ac1=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x4f3f12;while((_0x4f3f12=_0x380ac1[_0x54675b(0xda)](_0x24d7b5))!==null){_0x526a7e[_0x54675b(0xe7)]({'datasetCode':_0x4f3f12[0x1],'tableName':_0x4f3f12[0x2],'name':_0x4f3f12[0x3],'alias':_0x4f3f12[0x4]});}return _0x526a7e;}export function loadAliasMap(_0x36b417,_0x38fa04,_0xef1c30){const _0xc9f9df=a157_0x5535,_0x1c6a68=_0xef1c30??resolve(process[_0xc9f9df(0xdb)](),_0x36b417,_0xc9f9df(0xe6));if(cache['has'](_0x1c6a68))return cache[_0xc9f9df(0xe5)](_0x1c6a68);if(!existsSync(_0x1c6a68))return cache[_0xc9f9df(0xd9)](_0x1c6a68,[]),[];try{const _0x454140=readFileSync(_0x1c6a68,_0xc9f9df(0xe8)),_0x2aa988=parseApiFile(_0x454140);return cache['set'](_0x1c6a68,_0x2aa988),_0x2aa988;}catch{return cache[_0xc9f9df(0xd9)](_0x1c6a68,[]),[];}}export function resolveAlias(_0x5dbbff,_0x5359c7,_0x49f70b,_0x17c6e6){const _0x123816=a157_0x5535;if(!_0x5359c7)return undefined;const _0x2d5974=loadAliasMap(_0x5dbbff,_0x49f70b,_0x17c6e6),_0x1f2511=_0x2d5974[_0x123816(0xde)](_0x5955ae=>_0x5955ae['alias']===_0x5359c7);return _0x1f2511?.[_0x123816(0xe4)];}export function listAliases(_0x5035ce,_0x34ed44,_0x55b4b1){return loadAliasMap(_0x5035ce,_0x34ed44,_0x55b4b1);}function a157_0x2a6d(){const _0x5597c2=['push','utf-8','347EDfDyH','3041514fRtPZE','12412232AxLPtU','set','exec','cwd','4FJGPqL','1890955TzWNGP','find','4282NNlqRD','1420LWTxgZ','4117692fQGPpo','8676744zHDWAZ','6651XGZEYx','datasetCode','get','api.ts'];a157_0x2a6d=function(){return _0x5597c2;};return a157_0x2a6d();}
@@ -1 +1 @@
1
- (function(_0x4707aa,_0x59473c){const _0x79a3a4=a158_0x59c1,_0x1f7cca=_0x4707aa();while(!![]){try{const _0x5b2767=parseInt(_0x79a3a4(0x1d6))/0x1*(parseInt(_0x79a3a4(0x179))/0x2)+-parseInt(_0x79a3a4(0x19d))/0x3+parseInt(_0x79a3a4(0x20e))/0x4+-parseInt(_0x79a3a4(0x1e6))/0x5+parseInt(_0x79a3a4(0x1ad))/0x6*(-parseInt(_0x79a3a4(0x205))/0x7)+-parseInt(_0x79a3a4(0x212))/0x8+parseInt(_0x79a3a4(0x208))/0x9;if(_0x5b2767===_0x59473c)break;else _0x1f7cca['push'](_0x1f7cca['shift']());}catch(_0xa6bbb0){_0x1f7cca['push'](_0x1f7cca['shift']());}}}(a158_0x2a33,0x196f0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';function a158_0x2a33(){const _0x5992a1=['set','/smartapi/db-analysis/status/','tableData','scriptName','replace','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/restore-dataset','.remove(id);','dataset_','authRequired','update','status','/smartapi/dblink/testConnect','\x20\x20currentPage:\x201,','pageSize','/smartapi/custom/getUserCustomSql?id=','/smartapi/question/er-config/update-single','1254519JIKwCV','validation','dbId','2035764NgpjWp','/api/node-toolbox/sql/save','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','requestFields','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','sqlName','589796fWFVCx','apiError','name','AbortError','1442544BlOGNQ','operationId','/smartapi/dblink/getList','list','signal','cli:rabetbase','physicalTableCount','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','API\x20error\x20code:\x20','join','dbtableConfig','version','tableName','/smartapi/app/getList','includes','description','//\x20','message','/standard-page-status?appCode=','26618UPwBfJ','\x22\x20not\x20found\x20in\x20dataset\x20','?sqlCode=','Operation\x20\x22','/smartapi/lovrabet/update-page','deleted','errorMessage','\x20\x20pageSize:\x2020,','length','pageIndex','/smartapi/custom/getUserCustomSql','sqlCode','map','/api/custom/executeSql','success','operations','SQL\x20query\x20not\x20found:\x20','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dblink/getAllTableList','BFF\x20script\x20not\x20found:\x20id=','toString','stringify','errorMsg','/api/','/smartapi/lovrabet/dataset/','summary','Unauthorized','Request\x20timeout:\x20','\x20\x20return\x20rows;','\x20apps.\x20','currentPage','enabled','test','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','Dataset\x20not\x20found:\x20','const\x20data\x20=\x20await\x20client.sql.execute({','208464nUwXKX','target','application/json','entries','/generate-standard-pages/status?','/sync-to-pages','/smartapi/app-config/delete','/api/management/script/cache/clear','/smartapi/dblink/create','\x20failed','totalCount','/smartapi/db-analysis/jobs/cancel','label','string','object','/smartapi/question/er-config/erDelete','6klkqzF','Request\x20failed:\x20','cookie','errorCode','/smartapi/custom/updateUserCustomSql','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','tableList','\x20\x20});','//\x20SQL:\x20','getOne','/generate-standard-pages/start','modelCode','warn','Warning:\x20showing\x20first\x20','/smartapi/lovrabet/detail?pageId=','POST','/smartapi/db-analysis/start','find','create','add','/smartapi/custom/saveUserCustomSql','/smartapi/dblink/getTableDiffV2ByPage','/api/management/library/scripts/save','GET','type','method','table','code','.getOne(id);','key','\x20\x20\x20\x20sqlCode:\x20\x27','responseFields','modelId','/filter','/smartapi/dataset/get-dataset-list','path','api_error','/smartapi/app-config/update','operationName','\x20of\x20','\x20failed,\x20HTTP\x20','15iOUpJx','/api/management/library/scripts/statistics?appCode=','BFF\x20save\x20returned\x20no\x20valid\x20id','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','&type=','remove','const\x20result\x20=\x20await\x20client.models.','401','includeImports','push','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','toLowerCase','json','tags','/smartapi/dataset/get-driven-data?','body','200405XnuBRB','/smartapi/dblink/delete','filter','error','/api/management/library/scripts/list?appCode=','\x20\x20where:\x20{},','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','});','isArray','sdk','data','.filter({','scriptType','clientOperationId'];a158_0x2a33=function(){return _0x5992a1;};return a158_0x2a33();}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(_0x1d6a81){_activeCookie=_0x1d6a81||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0;function createFetchFailureError(_0x268787,_0x23b62d){const _0x23754e=a158_0x59c1,_0x2815a2=_0x23b62d instanceof Error?_0x23b62d[_0x23754e(0x177)]:String(_0x23b62d);return CliErrors[_0x23754e(0x20f)](_0x23754e(0x1ae)+_0x268787+(_0x2815a2?'\x20('+_0x2815a2+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x1cb7d6,_0x4aa6f6={}){const _0x10cb78=a158_0x59c1,{method:method=_0x10cb78(0x1c4),body:_0x4f1bc4,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4aa6f6,_0x100ac6=useRuntime?getRuntimeDomain():getApiDomain(),_0x242792=_activeCookie||getCookie(),_0x30d22d=''+_0x100ac6+_0x1cb7d6,_0x41198f=new AbortController(),_0x302032=setTimeout(()=>_0x41198f['abort'](),timeout);try{const _0x5add06=await fetch(_0x30d22d,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x242792,'X-Invoke-Source':_0x10cb78(0x16b),...headers},'body':_0x4f1bc4?JSON[_0x10cb78(0x18e)](_0x4f1bc4):undefined,'signal':_0x41198f[_0x10cb78(0x16a)]});let _0x147486;try{_0x147486=await _0x5add06[_0x10cb78(0x1e2)]();}catch(_0x153bd1){if(_0x153bd1 instanceof Error&&_0x153bd1[_0x10cb78(0x210)]==='AbortError')throw CliErrors[_0x10cb78(0x20f)](_0x10cb78(0x194)+_0x30d22d);if(_0x5add06['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x10cb78(0x20f)](_0x10cb78(0x1d9)+_0x5add06[_0x10cb78(0x1ff)]+')',_0x5add06[_0x10cb78(0x1ff)]>=0x190?_0x10cb78(0x1ec):undefined);}if(!_0x5add06['ok']||_0x147486[_0x10cb78(0x187)]===![])throw CliErrors[_0x10cb78(0x20f)](_0x147486[_0x10cb78(0x18f)]||_0x147486['message']||'API\x20error:\x20'+_0x5add06[_0x10cb78(0x1ff)],_0x147486['errorCode']?_0x10cb78(0x16e)+_0x147486[_0x10cb78(0x1b0)]:undefined);return _0x147486;}catch(_0x7ca4e3){if(_0x7ca4e3 instanceof CliError)throw _0x7ca4e3;if(_0x7ca4e3 instanceof Error&&_0x7ca4e3[_0x10cb78(0x210)]===_0x10cb78(0x211))throw CliErrors[_0x10cb78(0x20f)](_0x10cb78(0x194)+_0x30d22d);throw createFetchFailureError(_0x30d22d,_0x7ca4e3);}finally{clearTimeout(_0x302032);}}function isAuthFailure(_0x2da1cc){const _0x270bb4=a158_0x59c1,_0x22c5d5=_0x2da1cc[_0x270bb4(0x18f)]||_0x2da1cc[_0x270bb4(0x177)]||_0x2da1cc[_0x270bb4(0x1f0)]?.[_0x270bb4(0x177)]||_0x2da1cc[_0x270bb4(0x17f)]||_0x2da1cc[_0x270bb4(0x1e9)]||'';return _0x2da1cc['errorCode']==='UNAUTHORIZED'||_0x2da1cc[_0x270bb4(0x1c8)]===0x191||_0x2da1cc['code']===_0x270bb4(0x1dd)||_0x22c5d5[_0x270bb4(0x174)]('401')||_0x22c5d5[_0x270bb4(0x174)](_0x270bb4(0x193))||_0x22c5d5['includes']('登录')||_0x22c5d5['includes']('认证');}export async function platformFetch(_0x260553,_0x55491f){const _0x477027=a158_0x59c1;let _0x1e9396;try{_0x1e9396=await fetch(_0x260553,{'method':_0x55491f[_0x477027(0x1c6)]??_0x477027(0x1c4),'headers':{'Content-Type':_0x477027(0x19f),'Cookie':_0x55491f[_0x477027(0x1af)],'X-Invoke-Source':_0x477027(0x16b)},..._0x55491f[_0x477027(0x1e5)]&&{'body':JSON[_0x477027(0x18e)](_0x55491f[_0x477027(0x1e5)])}});}catch(_0x3800d8){throw createFetchFailureError(_0x260553,_0x3800d8);}if(!_0x1e9396['ok']){if(_0x1e9396[_0x477027(0x1ff)]===0x191)throw CliErrors[_0x477027(0x1fd)]();throw CliErrors[_0x477027(0x20f)](_0x55491f['label']+_0x477027(0x1d5)+_0x1e9396[_0x477027(0x1ff)]);}const _0x7ccd9e=await _0x1e9396[_0x477027(0x1e2)]();if(_0x7ccd9e[_0x477027(0x187)]===![]){if(isAuthFailure(_0x7ccd9e))throw CliErrors[_0x477027(0x1fd)]();throw CliErrors[_0x477027(0x20f)](_0x7ccd9e[_0x477027(0x18f)]||_0x7ccd9e[_0x477027(0x177)]||_0x55491f[_0x477027(0x1a9)]+_0x477027(0x1a6));}return _0x7ccd9e['data'];}export async function listBffScripts(_0x4134f9,_0x179cdc,_0x29c042){const _0x478d79=a158_0x59c1;let _0x13d24d=_0x478d79(0x1ea)+_0x4134f9;if(_0x179cdc)_0x13d24d+=_0x478d79(0x1da)+_0x179cdc;const _0x246181=await apiRequest(_0x13d24d);let _0x47839c=extractList(_0x246181[_0x478d79(0x1f0)]);if(_0x29c042?.[_0x478d79(0x1f7)]){const _0x2661ff=_0x29c042[_0x478d79(0x1f7)]['toLowerCase']();_0x47839c=_0x47839c[_0x478d79(0x1e8)](_0x444716=>_0x444716['functionName']?.['toLowerCase']()[_0x478d79(0x174)](_0x2661ff)||_0x444716['description']?.[_0x478d79(0x1e1)]()[_0x478d79(0x174)](_0x2661ff));}return _0x47839c;}export async function getBffScriptInfo(_0x3e1dc3){const _0x590872=a158_0x59c1,_0x12cae1=await apiRequest('/api/management/library/scripts/info?id='+_0x3e1dc3);if(!_0x12cae1[_0x590872(0x1f0)])throw CliErrors['validation'](_0x590872(0x18c)+_0x3e1dc3);return _0x12cae1[_0x590872(0x1f0)];}export async function saveBffScript(_0x3168ec){const _0x29a229=a158_0x59c1,_0xbb07b4=await apiRequest(_0x29a229(0x1c3),{'method':'POST','body':_0x3168ec}),{id:_0x22060b,entity:_0x5ecb87}=normalizeEntityWithIdResponse(_0xbb07b4[_0x29a229(0x1f0)]);if(_0x22060b!==undefined){const _0x4d8d37=typeof _0x5ecb87['functionName']===_0x29a229(0x1aa)||typeof _0x5ecb87[_0x29a229(0x1f2)]==='string'?_0x5ecb87:undefined;return{'id':_0x22060b,'script':_0x4d8d37};}throw CliErrors[_0x29a229(0x20f)](_0x29a229(0x1d8));}export async function deleteBffScript(_0x3bee12){const _0x25b967=a158_0x59c1;await apiRequest('/api/management/library/scripts/delete',{'method':_0x25b967(0x1bc),'body':{'id':_0x3bee12}});}export async function getBffScriptStatistics(_0x48c3db){const _0x25f3c0=a158_0x59c1,_0x58669f=await apiRequest(_0x25f3c0(0x1d7)+_0x48c3db);return extractList(_0x58669f[_0x25f3c0(0x1f0)]);}export async function clearBffScriptCache(){const _0xfedb98=a158_0x59c1,_0x1d797f=await apiRequest(_0xfedb98(0x1a4),{'method':_0xfedb98(0x1bc),'useRuntime':!![]});return typeof _0x1d797f[_0xfedb98(0x1f0)]===_0xfedb98(0x1aa)?_0x1d797f[_0xfedb98(0x1f0)]:'';}export async function listBffDatasetOperations(_0x94534f,_0x4c14f3){const _0x123876=a158_0x59c1,_0x11b452=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x123876(0x1bc),'body':{'appCode':_0x94534f,'datasetId':_0x4c14f3}});return _0x11b452[_0x123876(0x1f0)];}function a158_0x59c1(_0x5812df,_0x381673){_0x5812df=_0x5812df-0x16a;const _0x2a332f=a158_0x2a33();let _0x59c19a=_0x2a332f[_0x5812df];return _0x59c19a;}export async function listSqlQueries(_0x107def,_0x4dedba){const _0x15ac94=a158_0x59c1,_0x527f9b=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x107def,'currentPage':_0x4dedba?.[_0x15ac94(0x197)]??0x1,'pageSize':_0x4dedba?.['pageSize']??0x32,'sqlCode':_0x4dedba?.[_0x15ac94(0x184)],'sqlName':_0x4dedba?.[_0x15ac94(0x20d)]}});return _0x527f9b[_0x15ac94(0x1f0)];}export async function getSqlQueryInfo(_0x2b9a75,_0x113315){const _0x26db73=a158_0x59c1,_0x4268ec=await listSqlQueries(_0x2b9a75,{'sqlCode':_0x113315}),_0x7d3fd3=_0x4268ec[_0x26db73(0x1f6)]?.[0x0];if(!_0x7d3fd3)throw CliErrors[_0x26db73(0x206)](_0x26db73(0x189)+_0x113315);return _0x7d3fd3;}export async function getSqlQueryDetail(_0x349535){const _0x269ae5=a158_0x59c1,_0x4a369f=await apiRequest(_0x269ae5(0x183)+(_0x269ae5(0x17b)+encodeURIComponent(_0x349535)));if(!_0x4a369f[_0x269ae5(0x1f0)])throw CliErrors[_0x269ae5(0x206)](_0x269ae5(0x189)+_0x349535);return _0x4a369f['data'];}export async function getSqlQueryDetailById(_0x3f2aba){const _0xc4fefa=a158_0x59c1,_0x2a7839=await apiRequest(_0xc4fefa(0x203)+_0x3f2aba);if(!_0x2a7839['data'])throw CliErrors[_0xc4fefa(0x206)]('SQL\x20query\x20not\x20found:\x20id='+_0x3f2aba);return _0x2a7839['data'];}export async function createSqlQuery(_0x563548){const _0x2827ae=a158_0x59c1,_0x4ee94d=await apiRequest(_0x2827ae(0x1c1),{'method':_0x2827ae(0x1bc),'body':_0x563548}),{id:_0xba1291,entity:_0x407c73}=normalizeEntityWithIdResponse(_0x4ee94d[_0x2827ae(0x1f0)]);if(!('sqlCode'in _0x407c73)&&_0xba1291)return getSqlQueryDetailById(_0xba1291);return normalizeSqlQueryEntity(_0x407c73);}export async function updateSqlQuery(_0x508536){const _0x5bc9a5=a158_0x59c1,_0x5a4acb=await apiRequest(_0x5bc9a5(0x1b1),{'method':_0x5bc9a5(0x1bc),'body':_0x508536}),{id:_0x4f85ce,entity:_0x16c545}=normalizeEntityWithIdResponse(_0x5a4acb[_0x5bc9a5(0x1f0)]);if(!(_0x5bc9a5(0x184)in _0x16c545)){if(_0x508536[_0x5bc9a5(0x184)])return getSqlQueryDetail(_0x508536[_0x5bc9a5(0x184)]);if(_0x4f85ce)return getSqlQueryDetailById(_0x4f85ce);}return normalizeSqlQueryEntity(_0x16c545);}export async function deleteSqlQuery(_0xfe2439){const _0x31ba7f=a158_0x59c1;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x31ba7f(0x1bc),'body':_0xfe2439});}export async function saveSqlQuery(_0x1af812){const _0x5e3fa4=a158_0x59c1,_0x4f986d=await apiRequest(_0x5e3fa4(0x209),{'method':_0x5e3fa4(0x1bc),'body':_0x1af812});return _0x4f986d[_0x5e3fa4(0x1f0)];}function normalizeSqlQueryEntity(_0x42a79f){const _0x184950=a158_0x59c1;return{..._0x42a79f,'id':Number(_0x42a79f['id']),'dbId':_0x42a79f[_0x184950(0x207)]==null?undefined:Number(_0x42a79f[_0x184950(0x207)]),'version':_0x42a79f[_0x184950(0x171)]==null?undefined:Number(_0x42a79f[_0x184950(0x171)])};}export async function executeSql(_0x394860,_0x271af4,_0x1ad5ac){const _0x3f4865=a158_0x59c1,_0x3360f7=await apiRequest(_0x3f4865(0x186),{'method':_0x3f4865(0x1bc),'body':{'appCode':_0x394860,'sqlCode':_0x271af4,..._0x1ad5ac&&{'params':_0x1ad5ac}},'useRuntime':!![]});return _0x3360f7[_0x3f4865(0x1f0)];}export async function executeDatasetDataOperation(_0x56a272,_0x5704c4,_0x1204ba,_0x5d4347={}){const _0x1f064b=a158_0x59c1;try{const _0x1e336d=await apiRequest(_0x1f064b(0x190)+_0x56a272+'/'+_0x5704c4+'/'+_0x1204ba,{'method':_0x1f064b(0x1bc),'body':_0x5d4347,'useRuntime':!![]});return _0x1e336d[_0x1f064b(0x1f0)];}catch(_0x1ad54c){if(_0x1204ba===_0x1f064b(0x1b6)&&_0x1ad54c instanceof CliError&&_0x1ad54c[_0x1f064b(0x1c8)]===_0x1f064b(0x1d1)&&_0x5d4347['id']!==undefined&&_0x5d4347['id']!==null&&_0x5d4347['id']!==''){const _0x1493a5=await apiRequest(_0x1f064b(0x190)+_0x56a272+'/'+_0x5704c4+_0x1f064b(0x1ce),{'method':'POST','body':{'where':{'id':{'$eq':_0x5d4347['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x119062=Array[_0x1f064b(0x1ee)](_0x1493a5[_0x1f064b(0x1f0)]?.[_0x1f064b(0x1f6)])?_0x1493a5[_0x1f064b(0x1f0)][_0x1f064b(0x1f6)]:[];return _0x119062[0x0]??null;}throw _0x1ad54c;}}export async function listDatasets(_0x4f56a1,_0x51466d){const _0x564045=a158_0x59c1,_0x528ff7={'appCode':_0x4f56a1,'deleted':_0x51466d?.[_0x564045(0x17e)]??![]};if(_0x51466d?.['code'])_0x528ff7['code']=_0x51466d[_0x564045(0x1c8)];if(_0x51466d?.[_0x564045(0x210)])_0x528ff7[_0x564045(0x210)]=_0x51466d[_0x564045(0x210)];const _0x1c5ffc=await apiRequest(_0x564045(0x1cf),{'method':_0x564045(0x1bc),'body':_0x528ff7});return extractList(_0x1c5ffc[_0x564045(0x1f0)]);}export async function deleteDataset(_0x1e492d,_0x349055){await apiRequest('/smartapi/dataset/delete-dataset',{'method':'POST','body':{'appCode':_0x1e492d,'datasetId':_0x349055}});}export async function restoreDataset(_0x24bb24,_0x101580){const _0x45afcd=a158_0x59c1;await apiRequest(_0x45afcd(0x1fa),{'method':_0x45afcd(0x1bc),'body':{'appCode':_0x24bb24,'datasetId':_0x101580}});}export async function searchDatasets(_0x50879a,_0x1520f6){const _0x21659b=a158_0x59c1,_0x2c0f43=await listDatasets(_0x50879a,{'name':_0x1520f6}),_0x7596fc=_0x1520f6['toLowerCase'](),_0x4734b9=new Set(_0x2c0f43[_0x21659b(0x185)](_0x80854a=>_0x80854a['id'])),_0x25703c=_0x2c0f43[_0x21659b(0x1e8)](_0x522757=>_0x522757[_0x21659b(0x170)]?.[_0x21659b(0x172)]?.['toLowerCase']()[_0x21659b(0x174)](_0x7596fc)||_0x522757[_0x21659b(0x175)]?.[_0x21659b(0x1e1)]()[_0x21659b(0x174)](_0x7596fc)),_0x277671=await listDatasets(_0x50879a,{'code':_0x1520f6});for(const _0x216ca8 of _0x277671){!_0x4734b9['has'](_0x216ca8['id'])&&(_0x2c0f43[_0x21659b(0x1df)](_0x216ca8),_0x4734b9[_0x21659b(0x1c0)](_0x216ca8['id']));}return _0x2c0f43;}export function normalizeDatasetOperations(_0xc5ba0b){const _0x45125e=a158_0x59c1;if(Array[_0x45125e(0x1ee)](_0xc5ba0b))return _0xc5ba0b[_0x45125e(0x1e8)](_0x476c17=>_0x476c17!=null&&typeof _0x476c17===_0x45125e(0x1ab));if(_0xc5ba0b&&typeof _0xc5ba0b==='object')return Object[_0x45125e(0x1a0)](_0xc5ba0b)[_0x45125e(0x1e8)](([,_0x17bcc1])=>_0x17bcc1!=null&&typeof _0x17bcc1===_0x45125e(0x1ab))[_0x45125e(0x185)](([_0x1c529d,_0x140ddb])=>({..._0x140ddb,'name':_0x140ddb['name']??_0x140ddb[_0x45125e(0x1d3)]??_0x1c529d}));return[];}export async function getDatasetDetail(_0xfad08f){const _0x4835c6=a158_0x59c1,_0x2ceb47=/^\d+$/[_0x4835c6(0x199)](_0xfad08f)?'id':_0x4835c6(0x1c8),_0x5d93a3=await apiRequest(_0x4835c6(0x1e4)+_0x2ceb47+'='+_0xfad08f);return _0x5d93a3[_0x4835c6(0x1f0)];}export async function updateDrivenData(_0x261bb3){const _0x399fad=a158_0x59c1,_0x3e49f1=await apiRequest('/smartapi/dataset/update-driven-data',{'method':_0x399fad(0x1bc),'body':_0x261bb3});return _0x3e49f1['data'];}export async function getDatasetOperations(_0x4131df){const _0x555b19=a158_0x59c1,_0x38570e=await getDatasetDetail(_0x4131df),_0x181cba=normalizeDatasetOperations(_0x38570e['operations'])['map'](_0x564a48=>({'name':_0x564a48[_0x555b19(0x210)]||_0x564a48[_0x555b19(0x1d3)],'displayName':_0x564a48['displayName']||_0x564a48[_0x555b19(0x210)],'type':_0x564a48[_0x555b19(0x1c5)],'method':_0x564a48[_0x555b19(0x1c6)],'path':_0x564a48[_0x555b19(0x1d0)],'enabled':_0x564a48[_0x555b19(0x198)]??!![],'requestFields':_0x564a48[_0x555b19(0x20b)],'responseFields':_0x564a48[_0x555b19(0x1cc)]}));return{'dataset':{'id':_0x38570e['id']??_0x38570e['modelId'],'name':_0x38570e[_0x555b19(0x210)],'code':_0x38570e[_0x555b19(0x1c8)]||_0x38570e[_0x555b19(0x1b8)],'tableName':_0x38570e[_0x555b19(0x172)]||_0x38570e[_0x555b19(0x170)]?.[_0x555b19(0x172)]},'operations':_0x181cba};}export async function getOperationDetail(_0x209d1c,_0x1e8233,_0x18b757){const _0x1baf6d=a158_0x59c1;let _0x4f896e=_0x1e8233;if(!/^\d+$/[_0x1baf6d(0x199)](_0x1e8233)){const _0x11a447=await listDatasets(_0x209d1c,{'code':_0x1e8233}),_0x3250c2=_0x11a447[_0x1baf6d(0x1be)](_0x14ee9c=>_0x14ee9c[_0x1baf6d(0x1c8)]===_0x1e8233||String(_0x14ee9c['id'])===_0x1e8233);if(!_0x3250c2)throw CliErrors[_0x1baf6d(0x206)](_0x1baf6d(0x19b)+_0x1e8233);_0x4f896e=String(_0x3250c2['id']);}const _0x3d8680=await getDatasetDetail(_0x4f896e),_0x3b3089=normalizeDatasetOperations(_0x3d8680[_0x1baf6d(0x188)])['find'](_0x2e6867=>(_0x2e6867['name']||_0x2e6867['operationName'])===_0x18b757);if(!_0x3b3089)throw CliErrors[_0x1baf6d(0x206)](_0x1baf6d(0x17c)+_0x18b757+_0x1baf6d(0x17a)+_0x1e8233);return{'dataset':{'id':_0x3d8680['id']??_0x3d8680[_0x1baf6d(0x1cd)],'name':_0x3d8680[_0x1baf6d(0x210)],'code':_0x3d8680['code']||_0x3d8680[_0x1baf6d(0x1b8)],'tableName':_0x3d8680['tableName']||_0x3d8680[_0x1baf6d(0x170)]?.[_0x1baf6d(0x172)]},'operation':_0x3b3089};}export async function startGenerateStandardPages(_0x5852f9,_0x504883,_0x2f66fd){const _0x19842=a158_0x59c1,_0x55b752=await apiRequest(_0x19842(0x191)+_0x504883+_0x19842(0x1b7),{'method':_0x19842(0x1bc),'body':{'appCode':_0x5852f9,..._0x2f66fd?.[_0x19842(0x1f3)]?{'clientOperationId':_0x2f66fd['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x55b752[_0x19842(0x1f0)];}export async function getGenerateStandardPagesStatus(_0x201d7d,_0x40d356,_0x58380f){const _0x539b72=a158_0x59c1,_0x3a541b=new URLSearchParams({'appCode':_0x201d7d});_0x58380f[_0x539b72(0x213)]&&_0x3a541b[_0x539b72(0x1f4)](_0x539b72(0x213),_0x58380f[_0x539b72(0x213)]);_0x58380f[_0x539b72(0x1f3)]&&_0x3a541b['set']('clientOperationId',_0x58380f[_0x539b72(0x1f3)]);const _0x480e65=await apiRequest(_0x539b72(0x191)+_0x40d356+_0x539b72(0x1a1)+_0x3a541b[_0x539b72(0x18d)]());return _0x480e65[_0x539b72(0x1f0)];}export async function getStandardPageStatus(_0x181dec,_0x24fb62){const _0x4c76d=a158_0x59c1,_0x2226f9=await apiRequest(_0x4c76d(0x191)+_0x24fb62+_0x4c76d(0x178)+encodeURIComponent(_0x181dec));return _0x2226f9['data'];}export async function tryGetStandardPageStatus(_0x4045e6,_0x1463c8){const _0xfddd32=a158_0x59c1;try{return await getStandardPageStatus(_0x4045e6,_0x1463c8);}catch(_0x196c58){if(_0x196c58 instanceof CliError&&_0x196c58[_0xfddd32(0x1c8)]===_0xfddd32(0x1d1)&&/404|not found|non-json response/i[_0xfddd32(0x199)](_0x196c58[_0xfddd32(0x177)]))return null;throw _0x196c58;}}export async function syncStandardPages(_0x59d691,_0x1c5dab){const _0x365ab5=a158_0x59c1,_0x6e0d59=await apiRequest(_0x365ab5(0x191)+_0x1c5dab+_0x365ab5(0x1a2),{'method':_0x365ab5(0x1bc),'body':{'appCode':_0x59d691}});return _0x6e0d59['data'];}export async function getPageDetail(_0xee9f89){const _0x555503=a158_0x59c1,_0x47ec1a=await apiRequest(_0x555503(0x1bb)+_0xee9f89);if(!_0x47ec1a[_0x555503(0x1f0)])throw CliErrors['validation']('Page\x20not\x20found:\x20'+_0xee9f89);return _0x47ec1a[_0x555503(0x1f0)];}export async function updatePage(_0x4d0098,_0x34e3af,_0x4e04be,_0x2e5470){const _0x15647a=a158_0x59c1,_0x34bb7a=await apiRequest(_0x15647a(0x17d),{'method':'POST','body':{'appCode':_0x4d0098,'pageId':_0x34e3af,'code':_0x4e04be,'datasetIds':_0x2e5470}});return _0x34bb7a[_0x15647a(0x1f0)];}export function generateSdkCode(_0x10caa7,_0x191af3,_0x120613){const _0x2b58de=a158_0x59c1,_0x3b33d8=_0x120613?.[_0x2b58de(0x1de)]??!![],_0x412dc2=_0x2b58de(0x1fc)+_0x10caa7[_0x2b58de(0x1c8)]?.[_0x2b58de(0x1f8)](/-/g,'_'),_0x5569a0=_0x191af3[_0x2b58de(0x210)]||_0x191af3[_0x2b58de(0x1d3)]||_0x2b58de(0x1e8),_0x32abc1=[];_0x3b33d8&&_0x32abc1[_0x2b58de(0x1df)](_0x2b58de(0x16d),'',_0x2b58de(0x1e0),'');_0x32abc1[_0x2b58de(0x1df)](_0x2b58de(0x176)+_0x10caa7[_0x2b58de(0x210)]+'\x20('+(_0x10caa7[_0x2b58de(0x172)]||_0x2b58de(0x1c7))+')');if(_0x5569a0==='filter')_0x32abc1[_0x2b58de(0x1df)](_0x2b58de(0x1dc)+_0x412dc2+_0x2b58de(0x1f1),_0x2b58de(0x1eb),_0x2b58de(0x180),_0x2b58de(0x201),'});');else{if(_0x5569a0===_0x2b58de(0x1b6))_0x32abc1[_0x2b58de(0x1df)](_0x2b58de(0x1dc)+_0x412dc2+_0x2b58de(0x1c9));else{if(_0x5569a0===_0x2b58de(0x1bf))_0x32abc1[_0x2b58de(0x1df)](_0x2b58de(0x1dc)+_0x412dc2+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x5569a0===_0x2b58de(0x1fe))_0x32abc1[_0x2b58de(0x1df)]('const\x20result\x20=\x20await\x20client.models.'+_0x412dc2+_0x2b58de(0x1f9));else _0x5569a0==='delete'||_0x5569a0===_0x2b58de(0x1db)?_0x32abc1['push'](_0x2b58de(0x1dc)+_0x412dc2+_0x2b58de(0x1fb)):_0x32abc1[_0x2b58de(0x1df)]('const\x20result\x20=\x20await\x20client.models.'+_0x412dc2+'.'+_0x5569a0+'(/*\x20params\x20*/);');}}}return _0x32abc1[_0x2b58de(0x16f)]('\x0a');}export function generateSqlCodeTemplate(_0x136875,_0x5a084d){const _0x5388fd=a158_0x59c1,_0x3b0a93=_0x5a084d?.[_0x5388fd(0x19e)]??_0x5388fd(0x1ef),_0x58a95b=_0x5a084d?.[_0x5388fd(0x1de)]??!![],_0x4c8939=[];return _0x4c8939[_0x5388fd(0x1df)](_0x5388fd(0x1b5)+_0x136875[_0x5388fd(0x20d)]+'\x20('+_0x136875[_0x5388fd(0x184)]+')'),_0x3b0a93===_0x5388fd(0x1ef)?(_0x58a95b&&_0x4c8939[_0x5388fd(0x1df)](_0x5388fd(0x16d),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x4c8939['push'](_0x5388fd(0x19c),'\x20\x20sqlCode:\x20\x27'+_0x136875['sqlCode']+'\x27,',_0x5388fd(0x20a),_0x5388fd(0x1ed),_0x5388fd(0x19a),_0x5388fd(0x18a))):_0x4c8939[_0x5388fd(0x1df)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x5388fd(0x1cb)+_0x136875['sqlCode']+'\x27,',_0x5388fd(0x1b2),_0x5388fd(0x1b4),_0x5388fd(0x195),'}'),_0x4c8939[_0x5388fd(0x16f)]('\x0a');}export async function getErConfig(_0x2f3000,_0x7f55eb){const _0x4f740c=a158_0x59c1,_0x412af8=await apiRequest('/smartapi/question/er-config',{'method':_0x4f740c(0x1bc),'body':{'appCode':_0x2f3000,'dblinkId':_0x7f55eb},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x412af8[_0x4f740c(0x1f0)];}export async function createErRelation(_0x2734e4){const _0x59d1e4=a158_0x59c1,_0x215975=await apiRequest('/smartapi/question/er-config/erCreate',{'method':_0x59d1e4(0x1bc),'body':_0x2734e4,'allowNonJsonSuccess':!![]});return _0x215975[_0x59d1e4(0x1f0)];}export async function updateErRelation(_0x415e9d){const _0x280ee9=a158_0x59c1,_0x39f28a=await apiRequest(_0x280ee9(0x204),{'method':_0x280ee9(0x1bc),'body':_0x415e9d,'allowNonJsonSuccess':!![]});return _0x39f28a[_0x280ee9(0x1f0)];}export async function deleteErRelation(_0x291ab5){const _0xb2b20c=a158_0x59c1,_0x2412b6=await apiRequest(_0xb2b20c(0x1ac),{'method':_0xb2b20c(0x1bc),'body':_0x291ab5,'allowNonJsonSuccess':!![]});return _0x2412b6[_0xb2b20c(0x1f0)];}export async function updateErBusinessGroup(_0x35978e){const _0x221c7c=a158_0x59c1,_0x1fbec5=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':'POST','body':_0x35978e,'allowNonJsonSuccess':!![]});return _0x1fbec5[_0x221c7c(0x1f0)];}function buildQuery(_0x290fb7){const _0x5ab709=a158_0x59c1,_0x1bf76c=new URLSearchParams();for(const [_0x47dbf6,_0x1df245]of Object['entries'](_0x290fb7)){if(_0x1df245===undefined||_0x1df245==='')continue;_0x1bf76c[_0x5ab709(0x1f4)](_0x47dbf6,String(_0x1df245));}const _0x2e1a63=_0x1bf76c[_0x5ab709(0x18d)]();return _0x2e1a63?'?'+_0x2e1a63:'';}export async function listAppConfigs(_0x37a45c,_0x19e178){const _0x41a242=a158_0x59c1,_0x58ccdb=await apiRequest('/smartapi/app-config/list',{'method':_0x41a242(0x1bc),'body':{'appCode':_0x37a45c,..._0x19e178?.[_0x41a242(0x1ca)]?{'key':_0x19e178[_0x41a242(0x1ca)]}:{},..._0x19e178?.[_0x41a242(0x1e3)]?{'tags':_0x19e178[_0x41a242(0x1e3)]}:{}}});return extractAppConfigList(_0x58ccdb[_0x41a242(0x1f0)]);}export async function getAppConfigByKey(_0x29d984,_0x8280c4){const _0x53f93e=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x29d984,'key':_0x8280c4}));return _0x53f93e['data']??null;}export async function createAppConfig(_0x306ebb){const _0x3f5ed1=a158_0x59c1,_0x10b347=await apiRequest('/smartapi/app-config/create',{'method':_0x3f5ed1(0x1bc),'body':{'appCode':_0x306ebb['appCode'],'key':_0x306ebb['key'],'value':_0x306ebb['value'],..._0x306ebb[_0x3f5ed1(0x1e3)]?{'tags':_0x306ebb[_0x3f5ed1(0x1e3)]}:{}}});return _0x10b347[_0x3f5ed1(0x1f0)];}export async function updateAppConfig(_0x39d400){const _0x2e4490=a158_0x59c1;await apiRequest(_0x2e4490(0x1d2),{'method':_0x2e4490(0x1bc),'body':{'id':_0x39d400['id'],'appCode':_0x39d400['appCode'],'key':_0x39d400[_0x2e4490(0x1ca)],'value':_0x39d400['value'],..._0x39d400[_0x2e4490(0x1e3)]?{'tags':_0x39d400[_0x2e4490(0x1e3)]}:{}}});}export async function deleteAppConfig(_0x32d0a2){const _0x50f26e=a158_0x59c1;await apiRequest(_0x50f26e(0x1a3),{'method':_0x50f26e(0x1bc),'body':_0x32d0a2});}function extractAppConfigList(_0x3f36f5){const _0x11908a=a158_0x59c1;if(Array[_0x11908a(0x1ee)](_0x3f36f5))return _0x3f36f5;if(_0x3f36f5&&typeof _0x3f36f5==='object'&&Array['isArray'](_0x3f36f5[_0x11908a(0x215)]))return _0x3f36f5['list'];return extractList(_0x3f36f5);}export async function listDbLinks(_0x5c418c,_0x58d382){const _0x51ce83=a158_0x59c1,_0x107e8f=await apiRequest(_0x51ce83(0x214),{'method':_0x51ce83(0x1bc),'body':{'appCode':_0x5c418c,'currentPage':_0x58d382?.[_0x51ce83(0x197)]??0x1,'pageSize':_0x58d382?.[_0x51ce83(0x202)]??0x64}});return{'items':extractList(_0x107e8f[_0x51ce83(0x1f0)]),'paging':extractPaging(_0x107e8f[_0x51ce83(0x1f0)])};}export async function getDbLinkInfo(_0x27b6c3){const _0x154d9a=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x27b6c3}));return _0x154d9a['data'];}export async function createDbLink(_0x53e94d){const _0x3f2e4d=a158_0x59c1,_0x56e290=await apiRequest(_0x3f2e4d(0x1a5),{'method':'POST','body':_0x53e94d});return _0x56e290['data'];}export async function updateDbLink(_0x1af0af){const _0x4994a3=a158_0x59c1,_0x2d2abc=await apiRequest('/smartapi/dblink/update',{'method':_0x4994a3(0x1bc),'body':_0x1af0af});return _0x2d2abc[_0x4994a3(0x1f0)];}export async function deleteDbLink(_0x480c40){const _0x81add3=a158_0x59c1;await apiRequest(_0x81add3(0x1e7),{'method':_0x81add3(0x1bc),'body':{'id':_0x480c40}});}export async function testDbLinkConnect(_0x1f73bd){const _0x2c7527=a158_0x59c1,_0x7c5a5b=await apiRequest(_0x2c7527(0x200)+buildQuery({'id':_0x1f73bd}));return _0x7c5a5b[_0x2c7527(0x1f0)];}export async function startDbAnalysis(_0xebad4f,_0x1f209e){const _0x1486a9=a158_0x59c1,_0x168a2f=await apiRequest(_0x1486a9(0x1bd),{'method':'POST','body':{'dbLinkId':_0xebad4f,..._0x1f209e&&_0x1f209e[_0x1486a9(0x181)]>0x0?{'tableNames':_0x1f209e}:{}}}),_0x38fe82=_0x168a2f[_0x1486a9(0x1f0)];if(typeof _0x38fe82===_0x1486a9(0x1aa))return _0x38fe82;if(_0x38fe82&&typeof _0x38fe82===_0x1486a9(0x1ab)&&typeof _0x38fe82['planId']===_0x1486a9(0x1aa))return _0x38fe82['planId'];return _0x38fe82!=null?String(_0x38fe82):'';}export async function cancelDbAnalysis(_0x2b0f93){const _0x59e41d=a158_0x59c1;await apiRequest(_0x59e41d(0x1a8)+buildQuery({'planId':_0x2b0f93}),{'method':_0x59e41d(0x1bc)});}export async function getDbAnalysisStatus(_0x3f8b5b){const _0x3b6b75=a158_0x59c1,_0xaeb91d=await apiRequest(_0x3b6b75(0x1f5)+encodeURIComponent(_0x3f8b5b));return _0xaeb91d['data'];}export async function getDbAllTableList(_0x4c3c2e,_0x27de2e){const _0x39c32d=a158_0x59c1,_0x31706a=await apiRequest(_0x39c32d(0x18b)+buildQuery({'appCode':_0x4c3c2e,'dbLinkId':_0x27de2e})),_0x5f2430=_0x31706a[_0x39c32d(0x1f0)];if(Array[_0x39c32d(0x1ee)](_0x5f2430))return _0x5f2430;return extractList(_0x5f2430);}export async function getDbTableDiff(_0x24a20e,_0x18d417,_0x6e0185){const _0x1742a8=a158_0x59c1,_0x199466=await apiRequest(_0x1742a8(0x1c2)+buildQuery({'appCode':_0x24a20e,'dbLinkId':_0x18d417,'pageIndex':_0x6e0185?.[_0x1742a8(0x182)]??0x1,'pageSize':_0x6e0185?.[_0x1742a8(0x202)]??0x14,'tableName':_0x6e0185?.[_0x1742a8(0x172)]})),_0x261086=_0x199466[_0x1742a8(0x1f0)];return{'totalCount':_0x261086?.['totalCount']??0x0,'physicalTableCount':_0x261086?.[_0x1742a8(0x16c)]??0x0,'datasetTableCount':_0x261086?.['datasetTableCount']??0x0,..._0x261086?.['summary']?{'summary':_0x261086[_0x1742a8(0x192)]}:{},'tableList':Array[_0x1742a8(0x1ee)](_0x261086?.[_0x1742a8(0x1b3)])?_0x261086['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2810c9=a158_0x59c1,_0x3d75d7=await apiRequest(_0x2810c9(0x173),{'method':_0x2810c9(0x1bc),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x2a1700=extractList(_0x3d75d7[_0x2810c9(0x1f0)]),_0xac3ab9=extractPaging(_0x3d75d7['data']);return _0xac3ab9&&_0xac3ab9[_0x2810c9(0x1a7)]>REMOTE_APP_PAGE_SIZE&&console[_0x2810c9(0x1b9)](_0x2810c9(0x1ba)+REMOTE_APP_PAGE_SIZE+_0x2810c9(0x1d4)+_0xac3ab9[_0x2810c9(0x1a7)]+_0x2810c9(0x196)+_0x2810c9(0x20c)),_0x2a1700;}
1
+ (function(_0xeaa081,_0x37e350){const _0x455ea0=a158_0x2fe6,_0x15de73=_0xeaa081();while(!![]){try{const _0xba9fab=-parseInt(_0x455ea0(0x21f))/0x1+-parseInt(_0x455ea0(0x1ed))/0x2*(-parseInt(_0x455ea0(0x196))/0x3)+parseInt(_0x455ea0(0x216))/0x4*(-parseInt(_0x455ea0(0x1a7))/0x5)+parseInt(_0x455ea0(0x1b8))/0x6+-parseInt(_0x455ea0(0x20d))/0x7*(parseInt(_0x455ea0(0x199))/0x8)+-parseInt(_0x455ea0(0x1d1))/0x9+-parseInt(_0x455ea0(0x1b3))/0xa*(-parseInt(_0x455ea0(0x1e6))/0xb);if(_0xba9fab===_0x37e350)break;else _0x15de73['push'](_0x15de73['shift']());}catch(_0x17e485){_0x15de73['push'](_0x15de73['shift']());}}}(a158_0x4b14,0x27408));function a158_0x4b14(){const _0x2f015d=['/standard-page-status?appCode=','/smartapi/lovrabet/update-page','/smartapi/custom/getUserCustomSql?id=','scriptType','78620JoSegK','enabled','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','functionName','string','754230xFrpbD','responseFields','/smartapi/dblink/getAllTableList','physicalTableCount','/smartapi/custom/queryUserCustomSqlList','(/*\x20params\x20*/);','/smartapi/question/er-config/erCreate','.getOne(id);','/smartapi/question/er-config/erDelete','SQL\x20query\x20not\x20found:\x20','data','length','\x20failed','name','authRequired','key','/smartapi/dataset/get-dataset-list','BFF\x20script\x20not\x20found:\x20id=','Request\x20timeout:\x20','application/json','code','isArray','const\x20result\x20=\x20await\x20client.models.','label','set','938259nrXmCB','\x20\x20\x20\x20sqlCode:\x20\x27','deleted','/generate-standard-pages/status?','toString','requestFields','/smartapi/app-config/delete','object','cli:rabetbase','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','const\x20results\x20=\x20data.execResult\x20||\x20[];','has','warn','\x20apps.\x20','UNAUTHORIZED','/smartapi/dblink/getList','Request\x20failed:\x20','push','/api/management/library/scripts/save','dbtableConfig','sqlName','209fJGxkI','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-operation','includeImports','/smartapi/question/er-config','api_error','/smartapi/lovrabet/detail?pageId=','5382CYENhf','/api/management/script/cache/clear','401','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','POST','entries','/api/management/library/scripts/list?appCode=','/api/management/library/scripts/statistics?appCode=','tableData','modelCode','/smartapi/custom/updateUserCustomSql','/smartapi/question/er-config/update-single','tableList','json','/smartapi/custom/getUserCustomSql','replace','dbId','/smartapi/db-analysis/start','/sync-to-pages','\x20\x20pageSize:\x2020,','validation','toLowerCase','displayName','Operation\x20\x22','body','totalCount','create','Page\x20not\x20found:\x20','/api/','/api/custom/executeSql','const\x20data\x20=\x20await\x20client.sql.execute({','getOne','21AVlesm','\x20\x20currentPage:\x201,','/smartapi/app-config/list','/smartapi/dblink/getTableDiffV2ByPage','//\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','pageSize','stringify','/smartapi/app-config/create','8pdQuLm','Unauthorized','GET','status','operations','errorCode','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','test','100462XTATFg','/smartapi/lovrabet/dataset/','errorMsg','/api/management/library/scripts/delete','datasetTableCount','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','value','sdk','apiError','map','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/question/er-config/business-group/edit','operationName','\x20\x20return\x20rows;','join','sqlCode','\x20\x20where:\x20{},','modelId','find','filter','/api/management/library/scripts/info?id=','/smartapi/app-config/update','clientOperationId','/smartapi/app-config/getByKey','operationId','\x20\x20});','signal','description','API\x20error\x20code:\x20','tableName','currentPage','/smartapi/dblink/create','dataset_','309qNpktZ','/generate-standard-pages/start','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','57784JFyaQi','Warning:\x20showing\x20first\x20','method','includes','message','errorMessage','pageIndex','//\x20SQL:\x20','list','error','/filter','});','planId','tags','412745PQdQAp','scriptName','/smartapi/dblink/testConnect','success','Check\x20network\x20connectivity\x20and\x20try\x20again.','SQL\x20query\x20not\x20found:\x20id=','/api/node-toolbox/sql/save','\x20of\x20'];a158_0x4b14=function(){return _0x2f015d;};return a158_0x4b14();}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(_0xb12eb3){_activeCookie=_0xb12eb3||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0;function createFetchFailureError(_0x312b7c,_0x3e8ddc){const _0x215020=a158_0x2fe6,_0x3ff46b=_0x3e8ddc instanceof Error?_0x3e8ddc[_0x215020(0x19d)]:String(_0x3e8ddc);return CliErrors[_0x215020(0x17d)](_0x215020(0x1e1)+_0x312b7c+(_0x3ff46b?'\x20('+_0x3ff46b+')':''),_0x215020(0x1ab));}async function apiRequest(_0x2b221d,_0xf51aa0={}){const _0x270efc=a158_0x2fe6,{method:method='GET',body:_0x10f381,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xf51aa0,_0x29996d=useRuntime?getRuntimeDomain():getApiDomain(),_0x2f921f=_activeCookie||getCookie(),_0xdc0cb6=''+_0x29996d+_0x2b221d,_0xf8389e=new AbortController(),_0x4d8d61=setTimeout(()=>_0xf8389e['abort'](),timeout);try{const _0x49a345=await fetch(_0xdc0cb6,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x2f921f,'X-Invoke-Source':_0x270efc(0x1d9),...headers},'body':_0x10f381?JSON[_0x270efc(0x214)](_0x10f381):undefined,'signal':_0xf8389e[_0x270efc(0x18f)]});let _0x32bac0;try{_0x32bac0=await _0x49a345['json']();}catch(_0x3d61a8){if(_0x3d61a8 instanceof Error&&_0x3d61a8['name']==='AbortError')throw CliErrors['apiError'](_0x270efc(0x1ca)+_0xdc0cb6);if(_0x49a345['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x270efc(0x17d)](_0x270efc(0x1f0)+_0x49a345[_0x270efc(0x219)]+')',_0x49a345['status']>=0x190?_0x270efc(0x17a):undefined);}if(!_0x49a345['ok']||_0x32bac0[_0x270efc(0x1aa)]===![])throw CliErrors[_0x270efc(0x17d)](_0x32bac0[_0x270efc(0x221)]||_0x32bac0[_0x270efc(0x19d)]||'API\x20error:\x20'+_0x49a345[_0x270efc(0x219)],_0x32bac0['errorCode']?_0x270efc(0x191)+_0x32bac0[_0x270efc(0x21b)]:undefined);return _0x32bac0;}catch(_0x46222e){if(_0x46222e instanceof CliError)throw _0x46222e;if(_0x46222e instanceof Error&&_0x46222e['name']==='AbortError')throw CliErrors[_0x270efc(0x17d)]('Request\x20timeout:\x20'+_0xdc0cb6);throw createFetchFailureError(_0xdc0cb6,_0x46222e);}finally{clearTimeout(_0x4d8d61);}}function isAuthFailure(_0x220ee5){const _0x531e86=a158_0x2fe6,_0x2dd981=_0x220ee5[_0x531e86(0x221)]||_0x220ee5[_0x531e86(0x19d)]||_0x220ee5[_0x531e86(0x1c2)]?.[_0x531e86(0x19d)]||_0x220ee5[_0x531e86(0x19e)]||_0x220ee5[_0x531e86(0x1a2)]||'';return _0x220ee5[_0x531e86(0x21b)]===_0x531e86(0x1df)||_0x220ee5[_0x531e86(0x1cc)]===0x191||_0x220ee5['code']==='401'||_0x2dd981['includes'](_0x531e86(0x1ef))||_0x2dd981[_0x531e86(0x19c)](_0x531e86(0x217))||_0x2dd981[_0x531e86(0x19c)]('登录')||_0x2dd981['includes']('认证');}export async function platformFetch(_0x1ea523,_0x334d24){const _0x1208e0=a158_0x2fe6;let _0x45fc3d;try{_0x45fc3d=await fetch(_0x1ea523,{'method':_0x334d24[_0x1208e0(0x19b)]??_0x1208e0(0x218),'headers':{'Content-Type':_0x1208e0(0x1cb),'Cookie':_0x334d24['cookie'],'X-Invoke-Source':_0x1208e0(0x1d9)},..._0x334d24[_0x1208e0(0x205)]&&{'body':JSON['stringify'](_0x334d24['body'])}});}catch(_0x4442c0){throw createFetchFailureError(_0x1ea523,_0x4442c0);}if(!_0x45fc3d['ok']){if(_0x45fc3d[_0x1208e0(0x219)]===0x191)throw CliErrors[_0x1208e0(0x1c6)]();throw CliErrors[_0x1208e0(0x17d)](_0x334d24['label']+'\x20failed,\x20HTTP\x20'+_0x45fc3d[_0x1208e0(0x219)]);}const _0x51696c=await _0x45fc3d[_0x1208e0(0x1fa)]();if(_0x51696c['success']===![]){if(isAuthFailure(_0x51696c))throw CliErrors['authRequired']();throw CliErrors[_0x1208e0(0x17d)](_0x51696c[_0x1208e0(0x221)]||_0x51696c['message']||_0x334d24[_0x1208e0(0x1cf)]+_0x1208e0(0x1c4));}return _0x51696c['data'];}export async function listBffScripts(_0x52a7f0,_0xcf92b7,_0x3d13f0){const _0x594de6=a158_0x2fe6;let _0x1cce9a=_0x594de6(0x1f3)+_0x52a7f0;if(_0xcf92b7)_0x1cce9a+='&type='+_0xcf92b7;const _0x59198b=await apiRequest(_0x1cce9a);let _0x645d4d=extractList(_0x59198b[_0x594de6(0x1c2)]);if(_0x3d13f0?.[_0x594de6(0x1a8)]){const _0x516f03=_0x3d13f0['scriptName']['toLowerCase']();_0x645d4d=_0x645d4d[_0x594de6(0x188)](_0x3b0e92=>_0x3b0e92['functionName']?.['toLowerCase']()[_0x594de6(0x19c)](_0x516f03)||_0x3b0e92[_0x594de6(0x190)]?.['toLowerCase']()['includes'](_0x516f03));}return _0x645d4d;}export async function getBffScriptInfo(_0xe96742){const _0x374c12=a158_0x2fe6,_0x23dbbe=await apiRequest(_0x374c12(0x189)+_0xe96742);if(!_0x23dbbe[_0x374c12(0x1c2)])throw CliErrors[_0x374c12(0x201)](_0x374c12(0x1c9)+_0xe96742);return _0x23dbbe[_0x374c12(0x1c2)];}export async function saveBffScript(_0x545cec){const _0x96e178=a158_0x2fe6,_0x287af8=await apiRequest(_0x96e178(0x1e3),{'method':'POST','body':_0x545cec}),{id:_0x5eed57,entity:_0x53bedc}=normalizeEntityWithIdResponse(_0x287af8[_0x96e178(0x1c2)]);if(_0x5eed57!==undefined){const _0x3175b7=typeof _0x53bedc[_0x96e178(0x1b6)]===_0x96e178(0x1b7)||typeof _0x53bedc[_0x96e178(0x1b2)]===_0x96e178(0x1b7)?_0x53bedc:undefined;return{'id':_0x5eed57,'script':_0x3175b7};}throw CliErrors[_0x96e178(0x17d)](_0x96e178(0x212));}export async function deleteBffScript(_0x33e2d7){const _0x11634c=a158_0x2fe6;await apiRequest(_0x11634c(0x222),{'method':_0x11634c(0x1f1),'body':{'id':_0x33e2d7}});}export async function getBffScriptStatistics(_0x38535c){const _0x5382ba=a158_0x2fe6,_0x557e81=await apiRequest(_0x5382ba(0x1f4)+_0x38535c);return extractList(_0x557e81['data']);}export async function clearBffScriptCache(){const _0x2f3c98=a158_0x2fe6,_0x23fccd=await apiRequest(_0x2f3c98(0x1ee),{'method':_0x2f3c98(0x1f1),'useRuntime':!![]});return typeof _0x23fccd[_0x2f3c98(0x1c2)]==='string'?_0x23fccd[_0x2f3c98(0x1c2)]:'';}export async function listBffDatasetOperations(_0x10ff6d,_0x137987){const _0x2d8320=a158_0x2fe6,_0x191864=await apiRequest(_0x2d8320(0x1e8),{'method':_0x2d8320(0x1f1),'body':{'appCode':_0x10ff6d,'datasetId':_0x137987}});return _0x191864[_0x2d8320(0x1c2)];}export async function listSqlQueries(_0x5c0645,_0xe41f2d){const _0x38c747=a158_0x2fe6,_0xb0be94=await apiRequest(_0x38c747(0x1bc),{'method':_0x38c747(0x1f1),'body':{'appCode':_0x5c0645,'currentPage':_0xe41f2d?.['currentPage']??0x1,'pageSize':_0xe41f2d?.[_0x38c747(0x213)]??0x32,'sqlCode':_0xe41f2d?.['sqlCode'],'sqlName':_0xe41f2d?.[_0x38c747(0x1e5)]}});return _0xb0be94[_0x38c747(0x1c2)];}export async function getSqlQueryInfo(_0x389404,_0x2ccd18){const _0x19a448=a158_0x2fe6,_0x6a30c3=await listSqlQueries(_0x389404,{'sqlCode':_0x2ccd18}),_0x43d82c=_0x6a30c3['tableData']?.[0x0];if(!_0x43d82c)throw CliErrors[_0x19a448(0x201)](_0x19a448(0x1c1)+_0x2ccd18);return _0x43d82c;}export async function getSqlQueryDetail(_0x22df43){const _0xa7fa65=a158_0x2fe6,_0x3421e4=await apiRequest(_0xa7fa65(0x1fb)+('?sqlCode='+encodeURIComponent(_0x22df43)));if(!_0x3421e4['data'])throw CliErrors[_0xa7fa65(0x201)]('SQL\x20query\x20not\x20found:\x20'+_0x22df43);return _0x3421e4[_0xa7fa65(0x1c2)];}export async function getSqlQueryDetailById(_0x12f375){const _0x37cb98=a158_0x2fe6,_0x55c3f0=await apiRequest(_0x37cb98(0x1b1)+_0x12f375);if(!_0x55c3f0['data'])throw CliErrors[_0x37cb98(0x201)](_0x37cb98(0x1ac)+_0x12f375);return _0x55c3f0[_0x37cb98(0x1c2)];}export async function createSqlQuery(_0x22ed5b){const _0x46d143=a158_0x2fe6,_0x1d7b93=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x46d143(0x1f1),'body':_0x22ed5b}),{id:_0x22cdc9,entity:_0x2dcd63}=normalizeEntityWithIdResponse(_0x1d7b93[_0x46d143(0x1c2)]);if(!(_0x46d143(0x184)in _0x2dcd63)&&_0x22cdc9)return getSqlQueryDetailById(_0x22cdc9);return normalizeSqlQueryEntity(_0x2dcd63);}export async function updateSqlQuery(_0x3d4b2f){const _0x59accc=a158_0x2fe6,_0x216115=await apiRequest(_0x59accc(0x1f7),{'method':_0x59accc(0x1f1),'body':_0x3d4b2f}),{id:_0x14d347,entity:_0x562ea4}=normalizeEntityWithIdResponse(_0x216115[_0x59accc(0x1c2)]);if(!(_0x59accc(0x184)in _0x562ea4)){if(_0x3d4b2f[_0x59accc(0x184)])return getSqlQueryDetail(_0x3d4b2f[_0x59accc(0x184)]);if(_0x14d347)return getSqlQueryDetailById(_0x14d347);}return normalizeSqlQueryEntity(_0x562ea4);}export async function deleteSqlQuery(_0x595849){const _0x55d32a=a158_0x2fe6;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x55d32a(0x1f1),'body':_0x595849});}export async function saveSqlQuery(_0x500510){const _0x55bd74=a158_0x2fe6,_0x536e93=await apiRequest(_0x55bd74(0x1ad),{'method':_0x55bd74(0x1f1),'body':_0x500510});return _0x536e93[_0x55bd74(0x1c2)];}function normalizeSqlQueryEntity(_0xc97505){const _0x1a6831=a158_0x2fe6;return{..._0xc97505,'id':Number(_0xc97505['id']),'dbId':_0xc97505[_0x1a6831(0x1fd)]==null?undefined:Number(_0xc97505[_0x1a6831(0x1fd)]),'version':_0xc97505['version']==null?undefined:Number(_0xc97505['version'])};}export async function executeSql(_0x245b16,_0xe6404d,_0x3ddac2){const _0x574a76=a158_0x2fe6,_0x3bb6ee=await apiRequest(_0x574a76(0x20a),{'method':'POST','body':{'appCode':_0x245b16,'sqlCode':_0xe6404d,..._0x3ddac2&&{'params':_0x3ddac2}},'useRuntime':!![]});return _0x3bb6ee[_0x574a76(0x1c2)];}export async function executeDatasetDataOperation(_0xc38cf0,_0x2a695a,_0x521f1b,_0x4b3621={}){const _0x5add95=a158_0x2fe6;try{const _0x4960d8=await apiRequest(_0x5add95(0x209)+_0xc38cf0+'/'+_0x2a695a+'/'+_0x521f1b,{'method':'POST','body':_0x4b3621,'useRuntime':!![]});return _0x4960d8[_0x5add95(0x1c2)];}catch(_0x4f737b){if(_0x521f1b===_0x5add95(0x20c)&&_0x4f737b instanceof CliError&&_0x4f737b[_0x5add95(0x1cc)]==='api_error'&&_0x4b3621['id']!==undefined&&_0x4b3621['id']!==null&&_0x4b3621['id']!==''){const _0x508a08=await apiRequest(_0x5add95(0x209)+_0xc38cf0+'/'+_0x2a695a+_0x5add95(0x1a3),{'method':_0x5add95(0x1f1),'body':{'where':{'id':{'$eq':_0x4b3621['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2e8546=Array[_0x5add95(0x1cd)](_0x508a08[_0x5add95(0x1c2)]?.[_0x5add95(0x1f5)])?_0x508a08['data'][_0x5add95(0x1f5)]:[];return _0x2e8546[0x0]??null;}throw _0x4f737b;}}export async function listDatasets(_0x53fc52,_0x11c178){const _0x116683=a158_0x2fe6,_0x418f6e={'appCode':_0x53fc52,'deleted':_0x11c178?.[_0x116683(0x1d3)]??![]};if(_0x11c178?.['code'])_0x418f6e[_0x116683(0x1cc)]=_0x11c178[_0x116683(0x1cc)];if(_0x11c178?.[_0x116683(0x1c5)])_0x418f6e[_0x116683(0x1c5)]=_0x11c178[_0x116683(0x1c5)];const _0x5ebec1=await apiRequest(_0x116683(0x1c8),{'method':_0x116683(0x1f1),'body':_0x418f6e});return extractList(_0x5ebec1[_0x116683(0x1c2)]);}export async function deleteDataset(_0x247a40,_0x4d14a0){const _0x226520=a158_0x2fe6;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x226520(0x1f1),'body':{'appCode':_0x247a40,'datasetId':_0x4d14a0}});}export async function restoreDataset(_0x34c30d,_0x1e8234){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x34c30d,'datasetId':_0x1e8234}});}export async function searchDatasets(_0x1a1a72,_0x4412f8){const _0x468ff0=a158_0x2fe6,_0x24a2b6=await listDatasets(_0x1a1a72,{'name':_0x4412f8}),_0x1d4dfe=_0x4412f8[_0x468ff0(0x202)](),_0x230a26=new Set(_0x24a2b6[_0x468ff0(0x17e)](_0xc6dbc7=>_0xc6dbc7['id'])),_0x125efc=_0x24a2b6[_0x468ff0(0x188)](_0x2138dd=>_0x2138dd['dbtableConfig']?.[_0x468ff0(0x192)]?.['toLowerCase']()['includes'](_0x1d4dfe)||_0x2138dd[_0x468ff0(0x190)]?.[_0x468ff0(0x202)]()[_0x468ff0(0x19c)](_0x1d4dfe)),_0x27078f=await listDatasets(_0x1a1a72,{'code':_0x4412f8});for(const _0x55b065 of _0x27078f){!_0x230a26[_0x468ff0(0x1dc)](_0x55b065['id'])&&(_0x24a2b6[_0x468ff0(0x1e2)](_0x55b065),_0x230a26['add'](_0x55b065['id']));}return _0x24a2b6;}export function normalizeDatasetOperations(_0x5af014){const _0x4603c4=a158_0x2fe6;if(Array[_0x4603c4(0x1cd)](_0x5af014))return _0x5af014[_0x4603c4(0x188)](_0x10e56e=>_0x10e56e!=null&&typeof _0x10e56e===_0x4603c4(0x1d8));if(_0x5af014&&typeof _0x5af014===_0x4603c4(0x1d8))return Object[_0x4603c4(0x1f2)](_0x5af014)[_0x4603c4(0x188)](([,_0x312425])=>_0x312425!=null&&typeof _0x312425==='object')[_0x4603c4(0x17e)](([_0x1bfa30,_0x128d4a])=>({..._0x128d4a,'name':_0x128d4a[_0x4603c4(0x1c5)]??_0x128d4a[_0x4603c4(0x181)]??_0x1bfa30}));return[];}export async function getDatasetDetail(_0x1272ab){const _0x1a9f42=a158_0x2fe6,_0x2a7583=/^\d+$/[_0x1a9f42(0x21e)](_0x1272ab)?'id':_0x1a9f42(0x1cc),_0x1ed041=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x2a7583+'='+_0x1272ab);return _0x1ed041[_0x1a9f42(0x1c2)];}export async function updateDrivenData(_0x892c54){const _0x118260=a158_0x2fe6,_0x356f50=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x892c54});return _0x356f50[_0x118260(0x1c2)];}export async function getDatasetOperations(_0x448bda){const _0xba94d1=a158_0x2fe6,_0x7286ad=await getDatasetDetail(_0x448bda),_0x2528cc=normalizeDatasetOperations(_0x7286ad[_0xba94d1(0x21a)])[_0xba94d1(0x17e)](_0x5e895c=>({'name':_0x5e895c[_0xba94d1(0x1c5)]||_0x5e895c['operationName'],'displayName':_0x5e895c[_0xba94d1(0x203)]||_0x5e895c[_0xba94d1(0x1c5)],'type':_0x5e895c['type'],'method':_0x5e895c[_0xba94d1(0x19b)],'path':_0x5e895c['path'],'enabled':_0x5e895c[_0xba94d1(0x1b4)]??!![],'requestFields':_0x5e895c[_0xba94d1(0x1d6)],'responseFields':_0x5e895c[_0xba94d1(0x1b9)]}));return{'dataset':{'id':_0x7286ad['id']??_0x7286ad[_0xba94d1(0x186)],'name':_0x7286ad[_0xba94d1(0x1c5)],'code':_0x7286ad[_0xba94d1(0x1cc)]||_0x7286ad['modelCode'],'tableName':_0x7286ad[_0xba94d1(0x192)]||_0x7286ad[_0xba94d1(0x1e4)]?.[_0xba94d1(0x192)]},'operations':_0x2528cc};}export async function getOperationDetail(_0x3c2743,_0x23b8c4,_0x5b12c7){const _0x2a738f=a158_0x2fe6;let _0x366c7e=_0x23b8c4;if(!/^\d+$/[_0x2a738f(0x21e)](_0x23b8c4)){const _0x28cb26=await listDatasets(_0x3c2743,{'code':_0x23b8c4}),_0x23bc53=_0x28cb26[_0x2a738f(0x187)](_0x41bd8e=>_0x41bd8e[_0x2a738f(0x1cc)]===_0x23b8c4||String(_0x41bd8e['id'])===_0x23b8c4);if(!_0x23bc53)throw CliErrors[_0x2a738f(0x201)]('Dataset\x20not\x20found:\x20'+_0x23b8c4);_0x366c7e=String(_0x23bc53['id']);}const _0x54d51f=await getDatasetDetail(_0x366c7e),_0x44c12a=normalizeDatasetOperations(_0x54d51f[_0x2a738f(0x21a)])[_0x2a738f(0x187)](_0x3ae1c6=>(_0x3ae1c6[_0x2a738f(0x1c5)]||_0x3ae1c6[_0x2a738f(0x181)])===_0x5b12c7);if(!_0x44c12a)throw CliErrors[_0x2a738f(0x201)](_0x2a738f(0x204)+_0x5b12c7+_0x2a738f(0x21d)+_0x23b8c4);return{'dataset':{'id':_0x54d51f['id']??_0x54d51f[_0x2a738f(0x186)],'name':_0x54d51f['name'],'code':_0x54d51f[_0x2a738f(0x1cc)]||_0x54d51f[_0x2a738f(0x1f6)],'tableName':_0x54d51f[_0x2a738f(0x192)]||_0x54d51f[_0x2a738f(0x1e4)]?.['tableName']},'operation':_0x44c12a};}export async function startGenerateStandardPages(_0x990d85,_0x102060,_0x112a1c){const _0x2f0fe7=a158_0x2fe6,_0x20f063=await apiRequest(_0x2f0fe7(0x220)+_0x102060+_0x2f0fe7(0x197),{'method':_0x2f0fe7(0x1f1),'body':{'appCode':_0x990d85,..._0x112a1c?.[_0x2f0fe7(0x18b)]?{'clientOperationId':_0x112a1c[_0x2f0fe7(0x18b)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x20f063[_0x2f0fe7(0x1c2)];}export async function getGenerateStandardPagesStatus(_0x3814d5,_0x3d0de8,_0x5db3b9){const _0x26c001=a158_0x2fe6,_0x4d46ae=new URLSearchParams({'appCode':_0x3814d5});_0x5db3b9[_0x26c001(0x18d)]&&_0x4d46ae[_0x26c001(0x1d0)](_0x26c001(0x18d),_0x5db3b9[_0x26c001(0x18d)]);_0x5db3b9['clientOperationId']&&_0x4d46ae[_0x26c001(0x1d0)](_0x26c001(0x18b),_0x5db3b9[_0x26c001(0x18b)]);const _0x5c7118=await apiRequest(_0x26c001(0x220)+_0x3d0de8+_0x26c001(0x1d4)+_0x4d46ae['toString']());return _0x5c7118['data'];}export async function getStandardPageStatus(_0x4a27f7,_0x3e9b35){const _0x280cae=a158_0x2fe6,_0x5dee40=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3e9b35+_0x280cae(0x1af)+encodeURIComponent(_0x4a27f7));return _0x5dee40[_0x280cae(0x1c2)];}export async function tryGetStandardPageStatus(_0x30f490,_0x148be8){const _0x6fc9b2=a158_0x2fe6;try{return await getStandardPageStatus(_0x30f490,_0x148be8);}catch(_0x3247fd){if(_0x3247fd instanceof CliError&&_0x3247fd[_0x6fc9b2(0x1cc)]===_0x6fc9b2(0x1eb)&&/404|not found|non-json response/i[_0x6fc9b2(0x21e)](_0x3247fd[_0x6fc9b2(0x19d)]))return null;throw _0x3247fd;}}export async function syncStandardPages(_0x5230ee,_0x19804b){const _0x20372a=a158_0x2fe6,_0x2c2a9e=await apiRequest(_0x20372a(0x220)+_0x19804b+_0x20372a(0x1ff),{'method':_0x20372a(0x1f1),'body':{'appCode':_0x5230ee}});return _0x2c2a9e[_0x20372a(0x1c2)];}export async function getPageDetail(_0xeb2a8a){const _0x517ca6=a158_0x2fe6,_0x5d5b25=await apiRequest(_0x517ca6(0x1ec)+_0xeb2a8a);if(!_0x5d5b25['data'])throw CliErrors[_0x517ca6(0x201)](_0x517ca6(0x208)+_0xeb2a8a);return _0x5d5b25['data'];}export async function updatePage(_0x2057ae,_0x5f3fe6,_0x8cab67,_0x1e4d45){const _0x5aabe9=a158_0x2fe6,_0x495dc7=await apiRequest(_0x5aabe9(0x1b0),{'method':_0x5aabe9(0x1f1),'body':{'appCode':_0x2057ae,'pageId':_0x5f3fe6,'code':_0x8cab67,'datasetIds':_0x1e4d45}});return _0x495dc7[_0x5aabe9(0x1c2)];}export function generateSdkCode(_0x10ab95,_0x5af37c,_0x5359b4){const _0x3f89cd=a158_0x2fe6,_0x510d62=_0x5359b4?.[_0x3f89cd(0x1e9)]??!![],_0x136979=_0x3f89cd(0x195)+_0x10ab95[_0x3f89cd(0x1cc)]?.[_0x3f89cd(0x1fc)](/-/g,'_'),_0x2271db=_0x5af37c[_0x3f89cd(0x1c5)]||_0x5af37c[_0x3f89cd(0x181)]||_0x3f89cd(0x188),_0x42be29=[];_0x510d62&&_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x17f),'',_0x3f89cd(0x21c),'');_0x42be29['push'](_0x3f89cd(0x211)+_0x10ab95[_0x3f89cd(0x1c5)]+'\x20('+(_0x10ab95[_0x3f89cd(0x192)]||'table')+')');if(_0x2271db===_0x3f89cd(0x188))_0x42be29[_0x3f89cd(0x1e2)]('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.filter({',_0x3f89cd(0x185),_0x3f89cd(0x200),_0x3f89cd(0x20e),_0x3f89cd(0x1a4));else{if(_0x2271db==='getOne')_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+_0x3f89cd(0x1bf));else{if(_0x2271db===_0x3f89cd(0x207))_0x42be29['push']('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x2271db==='update')_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+_0x3f89cd(0x1e7));else _0x2271db==='delete'||_0x2271db==='remove'?_0x42be29[_0x3f89cd(0x1e2)](_0x3f89cd(0x1ce)+_0x136979+'.remove(id);'):_0x42be29[_0x3f89cd(0x1e2)]('const\x20result\x20=\x20await\x20client.models.'+_0x136979+'.'+_0x2271db+_0x3f89cd(0x1bd));}}}return _0x42be29[_0x3f89cd(0x183)]('\x0a');}export function generateSqlCodeTemplate(_0x225a95,_0x5416c0){const _0x1ba8b0=a158_0x2fe6,_0x5a5867=_0x5416c0?.['target']??_0x1ba8b0(0x17c),_0x506bda=_0x5416c0?.[_0x1ba8b0(0x1e9)]??!![],_0x53cfbe=[];return _0x53cfbe[_0x1ba8b0(0x1e2)](_0x1ba8b0(0x1a0)+_0x225a95[_0x1ba8b0(0x1e5)]+'\x20('+_0x225a95[_0x1ba8b0(0x184)]+')'),_0x5a5867===_0x1ba8b0(0x17c)?(_0x506bda&&_0x53cfbe[_0x1ba8b0(0x1e2)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1ba8b0(0x21c),''),_0x53cfbe[_0x1ba8b0(0x1e2)](_0x1ba8b0(0x20b),'\x20\x20sqlCode:\x20\x27'+_0x225a95['sqlCode']+'\x27,',_0x1ba8b0(0x224),'});',_0x1ba8b0(0x198),_0x1ba8b0(0x1db))):_0x53cfbe['push']('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x1ba8b0(0x1b5),_0x1ba8b0(0x1d2)+_0x225a95[_0x1ba8b0(0x184)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x1ba8b0(0x18e),_0x1ba8b0(0x182),'}'),_0x53cfbe[_0x1ba8b0(0x183)]('\x0a');}export async function getErConfig(_0x3f39dd,_0x244c0b){const _0x420995=a158_0x2fe6,_0x2b5a49=await apiRequest(_0x420995(0x1ea),{'method':_0x420995(0x1f1),'body':{'appCode':_0x3f39dd,'dblinkId':_0x244c0b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x2b5a49[_0x420995(0x1c2)];}export async function createErRelation(_0x3a669c){const _0x5586c4=a158_0x2fe6,_0x52ab9d=await apiRequest(_0x5586c4(0x1be),{'method':'POST','body':_0x3a669c,'allowNonJsonSuccess':!![]});return _0x52ab9d[_0x5586c4(0x1c2)];}export async function updateErRelation(_0x10a067){const _0x30945c=a158_0x2fe6,_0x3200e5=await apiRequest(_0x30945c(0x1f8),{'method':_0x30945c(0x1f1),'body':_0x10a067,'allowNonJsonSuccess':!![]});return _0x3200e5[_0x30945c(0x1c2)];}export async function deleteErRelation(_0x2b70f6){const _0x537fd9=a158_0x2fe6,_0x557938=await apiRequest(_0x537fd9(0x1c0),{'method':'POST','body':_0x2b70f6,'allowNonJsonSuccess':!![]});return _0x557938[_0x537fd9(0x1c2)];}function a158_0x2fe6(_0x352854,_0x5b188f){_0x352854=_0x352854-0x17a;const _0x4b14be=a158_0x4b14();let _0x2fe64f=_0x4b14be[_0x352854];return _0x2fe64f;}export async function updateErBusinessGroup(_0x4110df){const _0x3ea41b=a158_0x2fe6,_0x3bcfc1=await apiRequest(_0x3ea41b(0x180),{'method':_0x3ea41b(0x1f1),'body':_0x4110df,'allowNonJsonSuccess':!![]});return _0x3bcfc1[_0x3ea41b(0x1c2)];}function buildQuery(_0x9d800b){const _0x584234=a158_0x2fe6,_0x2dfa9e=new URLSearchParams();for(const [_0x1e0f0e,_0x4421d8]of Object['entries'](_0x9d800b)){if(_0x4421d8===undefined||_0x4421d8==='')continue;_0x2dfa9e[_0x584234(0x1d0)](_0x1e0f0e,String(_0x4421d8));}const _0x39ee95=_0x2dfa9e[_0x584234(0x1d5)]();return _0x39ee95?'?'+_0x39ee95:'';}export async function listAppConfigs(_0x5d5542,_0x30ab7d){const _0x468dc0=a158_0x2fe6,_0x3c3ebe=await apiRequest(_0x468dc0(0x20f),{'method':_0x468dc0(0x1f1),'body':{'appCode':_0x5d5542,..._0x30ab7d?.[_0x468dc0(0x1c7)]?{'key':_0x30ab7d[_0x468dc0(0x1c7)]}:{},..._0x30ab7d?.['tags']?{'tags':_0x30ab7d[_0x468dc0(0x1a6)]}:{}}});return extractAppConfigList(_0x3c3ebe[_0x468dc0(0x1c2)]);}export async function getAppConfigByKey(_0x68902b,_0x117f03){const _0x2ce98e=a158_0x2fe6,_0x5a6f10=await apiRequest(_0x2ce98e(0x18c)+buildQuery({'appCode':_0x68902b,'key':_0x117f03}));return _0x5a6f10[_0x2ce98e(0x1c2)]??null;}export async function createAppConfig(_0x21af6a){const _0x24d255=a158_0x2fe6,_0x2ed9e3=await apiRequest(_0x24d255(0x215),{'method':_0x24d255(0x1f1),'body':{'appCode':_0x21af6a['appCode'],'key':_0x21af6a[_0x24d255(0x1c7)],'value':_0x21af6a[_0x24d255(0x17b)],..._0x21af6a[_0x24d255(0x1a6)]?{'tags':_0x21af6a['tags']}:{}}});return _0x2ed9e3[_0x24d255(0x1c2)];}export async function updateAppConfig(_0x2c29c8){const _0x48eb91=a158_0x2fe6;await apiRequest(_0x48eb91(0x18a),{'method':_0x48eb91(0x1f1),'body':{'id':_0x2c29c8['id'],'appCode':_0x2c29c8['appCode'],'key':_0x2c29c8[_0x48eb91(0x1c7)],'value':_0x2c29c8[_0x48eb91(0x17b)],..._0x2c29c8[_0x48eb91(0x1a6)]?{'tags':_0x2c29c8[_0x48eb91(0x1a6)]}:{}}});}export async function deleteAppConfig(_0x592138){const _0x3028bd=a158_0x2fe6;await apiRequest(_0x3028bd(0x1d7),{'method':_0x3028bd(0x1f1),'body':_0x592138});}function extractAppConfigList(_0x538203){const _0x935018=a158_0x2fe6;if(Array[_0x935018(0x1cd)](_0x538203))return _0x538203;if(_0x538203&&typeof _0x538203===_0x935018(0x1d8)&&Array['isArray'](_0x538203[_0x935018(0x1a1)]))return _0x538203[_0x935018(0x1a1)];return extractList(_0x538203);}export async function listDbLinks(_0x220680,_0x368f32){const _0x592b21=a158_0x2fe6,_0x40d72c=await apiRequest(_0x592b21(0x1e0),{'method':'POST','body':{'appCode':_0x220680,'currentPage':_0x368f32?.[_0x592b21(0x193)]??0x1,'pageSize':_0x368f32?.['pageSize']??0x64}});return{'items':extractList(_0x40d72c['data']),'paging':extractPaging(_0x40d72c[_0x592b21(0x1c2)])};}export async function getDbLinkInfo(_0x1d1091){const _0x570e2f=a158_0x2fe6,_0x5b5b23=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x1d1091}));return _0x5b5b23[_0x570e2f(0x1c2)];}export async function createDbLink(_0xc3a789){const _0x416949=a158_0x2fe6,_0xcbd7f9=await apiRequest(_0x416949(0x194),{'method':_0x416949(0x1f1),'body':_0xc3a789});return _0xcbd7f9[_0x416949(0x1c2)];}export async function updateDbLink(_0x4f66b6){const _0x2f1814=a158_0x2fe6,_0x230c36=await apiRequest('/smartapi/dblink/update',{'method':_0x2f1814(0x1f1),'body':_0x4f66b6});return _0x230c36[_0x2f1814(0x1c2)];}export async function deleteDbLink(_0x911511){await apiRequest('/smartapi/dblink/delete',{'method':'POST','body':{'id':_0x911511}});}export async function testDbLinkConnect(_0x18d810){const _0x2c14c1=a158_0x2fe6,_0x4f7faa=await apiRequest(_0x2c14c1(0x1a9)+buildQuery({'id':_0x18d810}));return _0x4f7faa[_0x2c14c1(0x1c2)];}export async function startDbAnalysis(_0x42e178,_0x1fdded){const _0x4151c8=a158_0x2fe6,_0x2c097f=await apiRequest(_0x4151c8(0x1fe),{'method':_0x4151c8(0x1f1),'body':{'dbLinkId':_0x42e178,..._0x1fdded&&_0x1fdded[_0x4151c8(0x1c3)]>0x0?{'tableNames':_0x1fdded}:{}}}),_0x5081ac=_0x2c097f[_0x4151c8(0x1c2)];if(typeof _0x5081ac===_0x4151c8(0x1b7))return _0x5081ac;if(_0x5081ac&&typeof _0x5081ac===_0x4151c8(0x1d8)&&typeof _0x5081ac['planId']===_0x4151c8(0x1b7))return _0x5081ac[_0x4151c8(0x1a5)];return _0x5081ac!=null?String(_0x5081ac):'';}export async function cancelDbAnalysis(_0x543138){const _0xbcf786=a158_0x2fe6;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x543138}),{'method':_0xbcf786(0x1f1)});}export async function getDbAnalysisStatus(_0x5650a9){const _0x381431=a158_0x2fe6,_0x4197be=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x5650a9));return _0x4197be[_0x381431(0x1c2)];}export async function getDbAllTableList(_0x32b4ca,_0xfc1977){const _0x4d5a8b=a158_0x2fe6,_0x4db156=await apiRequest(_0x4d5a8b(0x1ba)+buildQuery({'appCode':_0x32b4ca,'dbLinkId':_0xfc1977})),_0x320cb6=_0x4db156['data'];if(Array[_0x4d5a8b(0x1cd)](_0x320cb6))return _0x320cb6;return extractList(_0x320cb6);}export async function getDbTableDiff(_0x640769,_0xbfdc57,_0x45ef5d){const _0x3d1b69=a158_0x2fe6,_0x4b4e34=await apiRequest(_0x3d1b69(0x210)+buildQuery({'appCode':_0x640769,'dbLinkId':_0xbfdc57,'pageIndex':_0x45ef5d?.[_0x3d1b69(0x19f)]??0x1,'pageSize':_0x45ef5d?.[_0x3d1b69(0x213)]??0x14,'tableName':_0x45ef5d?.[_0x3d1b69(0x192)]})),_0x742d3c=_0x4b4e34['data'];return{'totalCount':_0x742d3c?.[_0x3d1b69(0x206)]??0x0,'physicalTableCount':_0x742d3c?.[_0x3d1b69(0x1bb)]??0x0,'datasetTableCount':_0x742d3c?.[_0x3d1b69(0x223)]??0x0,..._0x742d3c?.['summary']?{'summary':_0x742d3c['summary']}:{},'tableList':Array[_0x3d1b69(0x1cd)](_0x742d3c?.[_0x3d1b69(0x1f9)])?_0x742d3c['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1e38d8=a158_0x2fe6,_0x47e156=await apiRequest('/smartapi/app/getList',{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x26e93d=extractList(_0x47e156['data']),_0x415ca0=extractPaging(_0x47e156[_0x1e38d8(0x1c2)]);return _0x415ca0&&_0x415ca0[_0x1e38d8(0x206)]>REMOTE_APP_PAGE_SIZE&&console[_0x1e38d8(0x1dd)](_0x1e38d8(0x19a)+REMOTE_APP_PAGE_SIZE+_0x1e38d8(0x1ae)+_0x415ca0[_0x1e38d8(0x206)]+_0x1e38d8(0x1de)+_0x1e38d8(0x1da)),_0x26e93d;}
@@ -1 +1 @@
1
- const a159_0xa996f1=a159_0x5737;(function(_0x95432a,_0x167c95){const _0x1a2fe7=a159_0x5737,_0x30f802=_0x95432a();while(!![]){try{const _0x39f8c7=-parseInt(_0x1a2fe7(0x99))/0x1+-parseInt(_0x1a2fe7(0x8f))/0x2*(-parseInt(_0x1a2fe7(0x98))/0x3)+-parseInt(_0x1a2fe7(0x90))/0x4+parseInt(_0x1a2fe7(0x8e))/0x5+parseInt(_0x1a2fe7(0x91))/0x6+-parseInt(_0x1a2fe7(0x93))/0x7*(parseInt(_0x1a2fe7(0x97))/0x8)+parseInt(_0x1a2fe7(0x95))/0x9;if(_0x39f8c7===_0x167c95)break;else _0x30f802['push'](_0x30f802['shift']());}catch(_0x3128ce){_0x30f802['push'](_0x30f802['shift']());}}}(a159_0x2805,0xe4689));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a159_0xa996f1(0x94),TRASH_DIR_NAME=a159_0xa996f1(0x96);function a159_0x5737(_0x4706d8,_0x4e06aa){_0x4706d8=_0x4706d8-0x8e;const _0x2805e3=a159_0x2805();let _0x573785=_0x2805e3[_0x4706d8];return _0x573785;}export function loadBffProjectConfig(_0x4b4e2d,_0x3bcfe0){const _0x8bb40c=a159_0xa996f1,_0x451641=resolve(_0x3bcfe0??findProjectRootDirectory()),_0x568963=DOT_DIR+'/bff',_0x5503e0=_0x568963+'/'+_0x4b4e2d;return{'projectRoot':_0x451641,'appCode':_0x4b4e2d,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x568963,'scriptsRoot':_0x5503e0,'scriptsRootDir':resolve(_0x451641,DOT_DIR,_0x8bb40c(0x92),_0x4b4e2d),'lockFilePath':resolve(_0x451641,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x451641,DOT_DIR,TRASH_DIR_NAME)};}function a159_0x2805(){const _0xe31ddb=['bff','6470107ASHaui','bff.lock.json','33027912LgaLfI','bff-trash','8AmuKZu','1665idksiK','1287286jTWnaC','1721945BjRxet','326oSXcxm','7170704Kooiyg','5011212WmEHvL'];a159_0x2805=function(){return _0xe31ddb;};return a159_0x2805();}
1
+ const a159_0x536ca9=a159_0x2706;(function(_0x1b3796,_0x27e632){const _0x5815a2=a159_0x2706,_0xf70e1b=_0x1b3796();while(!![]){try{const _0x59078e=-parseInt(_0x5815a2(0x156))/0x1+parseInt(_0x5815a2(0x14e))/0x2+-parseInt(_0x5815a2(0x151))/0x3*(-parseInt(_0x5815a2(0x152))/0x4)+parseInt(_0x5815a2(0x157))/0x5+parseInt(_0x5815a2(0x153))/0x6+-parseInt(_0x5815a2(0x154))/0x7+parseInt(_0x5815a2(0x158))/0x8*(-parseInt(_0x5815a2(0x155))/0x9);if(_0x59078e===_0x27e632)break;else _0xf70e1b['push'](_0xf70e1b['shift']());}catch(_0x161761){_0xf70e1b['push'](_0xf70e1b['shift']());}}}(a159_0xe878,0x6adb2));import{resolve}from'node:path';function a159_0xe878(){const _0x79ba24=['1762364sSzrOv','3431298YGXeIY','4831750JqXLjv','273825zyyRAs','582968ANZdAK','1056290TnpLma','56zXvHgQ','.rabetbase','1400286tIsidU','/bff','bff','3kGrsir'];a159_0xe878=function(){return _0x79ba24;};return a159_0xe878();}function a159_0x2706(_0x5afe38,_0x24e71e){_0x5afe38=_0x5afe38-0x14e;const _0xe878b3=a159_0xe878();let _0x2706d3=_0xe878b3[_0x5afe38];return _0x2706d3;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a159_0x536ca9(0x159),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0xb39713,_0x8bf120){const _0x2fc350=a159_0x536ca9,_0xadf60c=resolve(_0x8bf120??findProjectRootDirectory()),_0x2fd0e7=DOT_DIR+_0x2fc350(0x14f),_0x16fcd0=_0x2fd0e7+'/'+_0xb39713;return{'projectRoot':_0xadf60c,'appCode':_0xb39713,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2fd0e7,'scriptsRoot':_0x16fcd0,'scriptsRootDir':resolve(_0xadf60c,DOT_DIR,_0x2fc350(0x150),_0xb39713),'lockFilePath':resolve(_0xadf60c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xadf60c,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a160_0x27160f=a160_0x4c86;(function(_0x57fb48,_0xa98743){const _0x526b89=a160_0x4c86,_0x329d89=_0x57fb48();while(!![]){try{const _0x1fae6c=parseInt(_0x526b89(0x1f9))/0x1+parseInt(_0x526b89(0x214))/0x2*(-parseInt(_0x526b89(0x1f5))/0x3)+-parseInt(_0x526b89(0x1f7))/0x4*(-parseInt(_0x526b89(0x1f1))/0x5)+-parseInt(_0x526b89(0x1fc))/0x6*(parseInt(_0x526b89(0x209))/0x7)+parseInt(_0x526b89(0x20e))/0x8*(parseInt(_0x526b89(0x216))/0x9)+parseInt(_0x526b89(0x206))/0xa+-parseInt(_0x526b89(0x219))/0xb*(-parseInt(_0x526b89(0x1fd))/0xc);if(_0x1fae6c===_0xa98743)break;else _0x329d89['push'](_0x329d89['shift']());}catch(_0x886c2c){_0x329d89['push'](_0x329d89['shift']());}}}(a160_0x5c40,0xdc2c9));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x27160f(0x20d),'ENDPOINT',a160_0x27160f(0x204)];export function normalizeBffType(_0x431543){const _0x11d284=a160_0x27160f;if(!_0x431543)return undefined;const _0x40f2b8=_0x431543[_0x11d284(0x20f)]()[_0x11d284(0x1f6)]();return SUPPORTED_BFF_TYPES['includes'](_0x40f2b8)?_0x40f2b8:undefined;}async function scanJsFilesRecursively(_0x1de4a4,_0x22dbd9){const _0x5a9182=a160_0x27160f,_0xf3b8e=[];try{const _0x29cd70=await readdir(_0x1de4a4,{'withFileTypes':!![]});for(const _0x470571 of _0x29cd70){const _0x110f61=join(_0x1de4a4,_0x470571[_0x5a9182(0x211)]);if(_0x470571['isDirectory']())_0xf3b8e[_0x5a9182(0x210)](...await scanJsFilesRecursively(_0x110f61,_0x22dbd9+'/'+_0x470571[_0x5a9182(0x211)]));else _0x470571['isFile']()&&_0x470571[_0x5a9182(0x211)][_0x5a9182(0x1fa)](_0x5a9182(0x207))&&_0xf3b8e[_0x5a9182(0x210)]({'lockKey':_0x22dbd9+'/'+_0x470571[_0x5a9182(0x211)][_0x5a9182(0x205)](/\.js$/,''),'filePath':_0x110f61});}}catch(_0x2bde1a){if(_0x2bde1a[_0x5a9182(0x208)]!==_0x5a9182(0x201))throw _0x2bde1a;}return _0xf3b8e;}async function scanFlatFunctions(_0x5a5169,_0xeec3dc){const _0x41105e=a160_0x27160f,_0x2370cd=join(_0x5a5169['scriptsRootDir'],_0xeec3dc),_0x5d60e9=await scanJsFilesRecursively(_0x2370cd,_0xeec3dc);return _0x5d60e9[_0x41105e(0x213)](({lockKey:_0x4639a4,filePath:_0x1934cc})=>({'type':_0xeec3dc,'name':_0x4639a4[_0x41105e(0x215)]('/')['at'](-0x1)??'','filePath':_0x1934cc,'lockKey':_0x4639a4}));}async function scanHookFunctions(_0xafe373){const _0x3c636f=a160_0x27160f,_0x41d157=join(_0xafe373[_0x3c636f(0x1f4)],'HOOK'),_0x56a5e7=[];try{const _0x2e3bf9=await readdir(_0x41d157,{'withFileTypes':!![]});for(const _0x30aa27 of _0x2e3bf9){if(!_0x30aa27[_0x3c636f(0x217)]())continue;const _0x25e8b2=_0x30aa27['name'],_0x3542e2=join(_0x41d157,_0x25e8b2),_0x30c4af=await readdir(_0x3542e2,{'withFileTypes':!![]});for(const _0x36e8da of _0x30c4af){if(!_0x36e8da[_0x3c636f(0x217)]())continue;const _0xbfa342=_0x36e8da[_0x3c636f(0x211)],_0x50f6e7=join(_0x3542e2,_0xbfa342),_0x364e58=await readdir(_0x50f6e7,{'withFileTypes':!![]});for(const _0x5eb5a5 of _0x364e58){if(!_0x5eb5a5[_0x3c636f(0x217)]())continue;const _0x499aef=_0x5eb5a5[_0x3c636f(0x211)],_0x4c971b=join(_0x50f6e7,_0x499aef),_0xe9acae=await readdir(_0x4c971b,{'withFileTypes':!![]});for(const _0x6a958c of _0xe9acae){if(!_0x6a958c[_0x3c636f(0x1f2)]()||!_0x6a958c[_0x3c636f(0x211)][_0x3c636f(0x1fa)]('.js'))continue;const _0x47145d=_0x6a958c[_0x3c636f(0x211)]['replace'](/\.js$/,'');_0x56a5e7[_0x3c636f(0x210)]({'type':_0x3c636f(0x204),'name':_0x47145d,'filePath':join(_0x4c971b,_0x6a958c['name']),'lockKey':_0x3c636f(0x1fe)+_0x25e8b2+'/'+_0xbfa342+'/'+_0x499aef+'/'+_0x47145d,'alias':_0x25e8b2,'operationType':_0xbfa342,'functionNode':_0x499aef});}}}}}catch(_0x3c56f3){if(_0x3c56f3[_0x3c636f(0x208)]!==_0x3c636f(0x201))throw _0x3c56f3;}return _0x56a5e7;}export async function scanLocalBffFunctions(_0x5a4ea3,_0x3d4f18){const _0x426819=a160_0x27160f;if(_0x3d4f18===_0x426819(0x20d)||_0x3d4f18===_0x426819(0x1fb))return scanFlatFunctions(_0x5a4ea3,_0x3d4f18);if(_0x3d4f18===_0x426819(0x204))return scanHookFunctions(_0x5a4ea3);const [_0x45483d,_0xc1750,_0x1e3d76]=await Promise[_0x426819(0x200)]([scanFlatFunctions(_0x5a4ea3,_0x426819(0x20d)),scanFlatFunctions(_0x5a4ea3,_0x426819(0x1fb)),scanHookFunctions(_0x5a4ea3)]);return[..._0x45483d,..._0xc1750,..._0x1e3d76];}export function resolveLocalFilePathFromLockKey(_0x3cdf09,_0xeb14a){const _0xe3836f=a160_0x27160f;return join(_0x3cdf09[_0xe3836f(0x1f4)],..._0xeb14a[_0xe3836f(0x215)]('/'))+_0xe3836f(0x207);}export function createHookLocationMap(_0x1b6b9c){const _0x4e486f=a160_0x27160f,_0x1a644d=new Map();for(const _0x2bc1ad of _0x1b6b9c){_0x2bc1ad[_0x4e486f(0x20a)]&&_0x1a644d['set'](_0x2bc1ad['beforeScriptId'],{'datasetCode':_0x2bc1ad[_0x4e486f(0x1f3)],'operationType':snakeToCamel(_0x2bc1ad[_0x4e486f(0x20c)]),'functionNode':'before'}),_0x2bc1ad['afterScriptId']&&_0x1a644d[_0x4e486f(0x212)](_0x2bc1ad[_0x4e486f(0x203)],{'datasetCode':_0x2bc1ad[_0x4e486f(0x1f3)],'operationType':snakeToCamel(_0x2bc1ad[_0x4e486f(0x20c)]),'functionNode':'after'});}return _0x1a644d;}function a160_0x4c86(_0x509dc1,_0x14f31d){_0x509dc1=_0x509dc1-0x1f1;const _0x5c40cc=a160_0x5c40();let _0x4c86fb=_0x5c40cc[_0x509dc1];return _0x4c86fb;}function a160_0x5c40(){const _0x4e8861=['get','all','ENOENT','F_OK','afterScriptId','HOOK','replace','112670QKvzdM','.js','code','10035165cXncJi','beforeScriptId','functionNode','operationType','COMMON','80lUxxQa','trim','push','name','set','map','8982VMlzYo','split','870615RFDhMq','isDirectory','functionName','363fdzzqL','95RHDDRm','isFile','datasetCode','scriptsRootDir','822QuqJJQ','toUpperCase','130932SNDcBA','scriptType','767683JrNGyz','endsWith','ENDPOINT','6IlAYim','435540IjWFMi','HOOK/'];a160_0x5c40=function(){return _0x4e8861;};return a160_0x5c40();}export function resolveRemoteScriptTarget(_0x1a3376,_0x311620,_0x4eaa59,_0x458313,_0x1b7f4c){const _0x375da5=a160_0x27160f,_0xc2daf2=normalizeBffType(_0x311620[_0x375da5(0x1f8)]);if(!_0xc2daf2||!_0x311620[_0x375da5(0x218)])return null;if(_0xc2daf2===_0x375da5(0x204)){const _0x1c8082=(_0x311620['id']?_0x4eaa59[_0x375da5(0x1ff)](_0x311620['id']):undefined)??findHookLocationByRemoteId(_0x458313,_0x311620['id']);if(!_0x1c8082)return null;const _0x5e376d=_0x1c8082['alias']||_0x1b7f4c[_0x375da5(0x1ff)](_0x1c8082[_0x375da5(0x1f3)]),_0x400e4a=_0x5e376d??_0x1c8082[_0x375da5(0x1f3)],_0x3434ad={..._0x1c8082,'alias':_0x5e376d},_0x1695b1=_0x375da5(0x1fe)+_0x400e4a+'/'+_0x3434ad[_0x375da5(0x20c)]+'/'+_0x3434ad[_0x375da5(0x20b)]+'/'+_0x311620[_0x375da5(0x218)];return{'lockKey':_0x1695b1,'filePath':resolveLocalFilePathFromLockKey(_0x1a3376,_0x1695b1),'type':'HOOK','hookLocation':_0x3434ad};}const _0x2da15c=_0xc2daf2+'/'+_0x311620[_0x375da5(0x218)];return{'lockKey':_0x2da15c,'filePath':resolveLocalFilePathFromLockKey(_0x1a3376,_0x2da15c),'type':_0xc2daf2};}export async function ensureParentDirectory(_0x210fef){await mkdir(dirname(_0x210fef),{'recursive':!![]});}export async function fileExists(_0x1b8f78){const _0x1755c4=a160_0x27160f;try{return await access(_0x1b8f78,constants[_0x1755c4(0x202)]),!![];}catch{return![];}}export async function directoryExists(_0x52ee15){const _0x4859b2=a160_0x27160f;try{const _0x46ecee=await stat(_0x52ee15);return _0x46ecee[_0x4859b2(0x217)]();}catch{return![];}}
1
+ const a160_0x3ea255=a160_0x2375;(function(_0x37cd51,_0x5390a1){const _0x1e0d7e=a160_0x2375,_0x5028b1=_0x37cd51();while(!![]){try{const _0x4e4875=-parseInt(_0x1e0d7e(0x10f))/0x1*(-parseInt(_0x1e0d7e(0x10d))/0x2)+-parseInt(_0x1e0d7e(0xfc))/0x3+parseInt(_0x1e0d7e(0x10e))/0x4*(-parseInt(_0x1e0d7e(0xf9))/0x5)+-parseInt(_0x1e0d7e(0xfd))/0x6*(parseInt(_0x1e0d7e(0xf7))/0x7)+-parseInt(_0x1e0d7e(0xfb))/0x8*(parseInt(_0x1e0d7e(0x100))/0x9)+parseInt(_0x1e0d7e(0xe6))/0xa+parseInt(_0x1e0d7e(0xee))/0xb*(parseInt(_0x1e0d7e(0xea))/0xc);if(_0x4e4875===_0x5390a1)break;else _0x5028b1['push'](_0x5028b1['shift']());}catch(_0x452859){_0x5028b1['push'](_0x5028b1['shift']());}}}(a160_0x566b,0x8c2cf));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a160_0x2375(_0x3fb5da,_0x509f31){_0x3fb5da=_0x3fb5da-0xe6;const _0x566b6f=a160_0x566b();let _0x2375a7=_0x566b6f[_0x3fb5da];return _0x2375a7;}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x3ea255(0x102),a160_0x3ea255(0x10c),a160_0x3ea255(0xfa)];export function normalizeBffType(_0x55ac92){const _0x3210ed=a160_0x3ea255;if(!_0x55ac92)return undefined;const _0x524fb4=_0x55ac92[_0x3210ed(0x104)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x3210ed(0xf6)](_0x524fb4)?_0x524fb4:undefined;}async function scanJsFilesRecursively(_0x86c198,_0x5dcf7a){const _0x438e5f=a160_0x3ea255,_0x524497=[];try{const _0x373293=await readdir(_0x86c198,{'withFileTypes':!![]});for(const _0x6d1b7b of _0x373293){const _0x13df80=join(_0x86c198,_0x6d1b7b['name']);if(_0x6d1b7b[_0x438e5f(0xf3)]())_0x524497['push'](...await scanJsFilesRecursively(_0x13df80,_0x5dcf7a+'/'+_0x6d1b7b[_0x438e5f(0x106)]));else _0x6d1b7b[_0x438e5f(0xe8)]()&&_0x6d1b7b[_0x438e5f(0x106)][_0x438e5f(0xf5)](_0x438e5f(0xef))&&_0x524497[_0x438e5f(0x101)]({'lockKey':_0x5dcf7a+'/'+_0x6d1b7b['name'][_0x438e5f(0xe7)](/\.js$/,''),'filePath':_0x13df80});}}catch(_0x24a8e8){if(_0x24a8e8['code']!==_0x438e5f(0x10b))throw _0x24a8e8;}return _0x524497;}async function scanFlatFunctions(_0x1f9f50,_0x3245c3){const _0x3fb906=a160_0x3ea255,_0x1c5761=join(_0x1f9f50[_0x3fb906(0xe9)],_0x3245c3),_0x5f4686=await scanJsFilesRecursively(_0x1c5761,_0x3245c3);return _0x5f4686[_0x3fb906(0xeb)](({lockKey:_0x347bc6,filePath:_0x4d45ea})=>({'type':_0x3245c3,'name':_0x347bc6[_0x3fb906(0x107)]('/')['at'](-0x1)??'','filePath':_0x4d45ea,'lockKey':_0x347bc6}));}async function scanHookFunctions(_0x58289b){const _0xd7776e=a160_0x3ea255,_0x37560b=join(_0x58289b[_0xd7776e(0xe9)],_0xd7776e(0xfa)),_0x46726e=[];try{const _0x53631b=await readdir(_0x37560b,{'withFileTypes':!![]});for(const _0x44d6be of _0x53631b){if(!_0x44d6be[_0xd7776e(0xf3)]())continue;const _0x5576af=_0x44d6be[_0xd7776e(0x106)],_0x515078=join(_0x37560b,_0x5576af),_0x4fab0c=await readdir(_0x515078,{'withFileTypes':!![]});for(const _0x5165cd of _0x4fab0c){if(!_0x5165cd[_0xd7776e(0xf3)]())continue;const _0x959fd5=_0x5165cd[_0xd7776e(0x106)],_0x542149=join(_0x515078,_0x959fd5),_0x3fe32f=await readdir(_0x542149,{'withFileTypes':!![]});for(const _0x413d73 of _0x3fe32f){if(!_0x413d73[_0xd7776e(0xf3)]())continue;const _0x25eb98=_0x413d73[_0xd7776e(0x106)],_0x1846ad=join(_0x542149,_0x25eb98),_0x37b8d9=await readdir(_0x1846ad,{'withFileTypes':!![]});for(const _0x2ff681 of _0x37b8d9){if(!_0x2ff681[_0xd7776e(0xe8)]()||!_0x2ff681[_0xd7776e(0x106)][_0xd7776e(0xf5)](_0xd7776e(0xef)))continue;const _0x1278a9=_0x2ff681['name']['replace'](/\.js$/,'');_0x46726e[_0xd7776e(0x101)]({'type':_0xd7776e(0xfa),'name':_0x1278a9,'filePath':join(_0x1846ad,_0x2ff681[_0xd7776e(0x106)]),'lockKey':_0xd7776e(0x110)+_0x5576af+'/'+_0x959fd5+'/'+_0x25eb98+'/'+_0x1278a9,'alias':_0x5576af,'operationType':_0x959fd5,'functionNode':_0x25eb98});}}}}}catch(_0x4923f4){if(_0x4923f4[_0xd7776e(0xfe)]!=='ENOENT')throw _0x4923f4;}return _0x46726e;}export async function scanLocalBffFunctions(_0x4fce0d,_0x10f0ea){const _0x5afdf4=a160_0x3ea255;if(_0x10f0ea==='COMMON'||_0x10f0ea===_0x5afdf4(0x10c))return scanFlatFunctions(_0x4fce0d,_0x10f0ea);if(_0x10f0ea===_0x5afdf4(0xfa))return scanHookFunctions(_0x4fce0d);const [_0x251037,_0x4b9c8f,_0x2812b2]=await Promise[_0x5afdf4(0x108)]([scanFlatFunctions(_0x4fce0d,_0x5afdf4(0x102)),scanFlatFunctions(_0x4fce0d,_0x5afdf4(0x10c)),scanHookFunctions(_0x4fce0d)]);return[..._0x251037,..._0x4b9c8f,..._0x2812b2];}export function resolveLocalFilePathFromLockKey(_0x1567da,_0x1f141b){const _0x57c810=a160_0x3ea255;return join(_0x1567da['scriptsRootDir'],..._0x1f141b['split']('/'))+_0x57c810(0xef);}export function createHookLocationMap(_0x1458e3){const _0x2afb4f=a160_0x3ea255,_0xf9bf0=new Map();for(const _0x1071ef of _0x1458e3){_0x1071ef[_0x2afb4f(0x10a)]&&_0xf9bf0[_0x2afb4f(0xff)](_0x1071ef[_0x2afb4f(0x10a)],{'datasetCode':_0x1071ef[_0x2afb4f(0xf2)],'operationType':snakeToCamel(_0x1071ef[_0x2afb4f(0xf0)]),'functionNode':_0x2afb4f(0xf4)}),_0x1071ef['afterScriptId']&&_0xf9bf0[_0x2afb4f(0xff)](_0x1071ef[_0x2afb4f(0xed)],{'datasetCode':_0x1071ef[_0x2afb4f(0xf2)],'operationType':snakeToCamel(_0x1071ef[_0x2afb4f(0xf0)]),'functionNode':_0x2afb4f(0xf1)});}return _0xf9bf0;}function a160_0x566b(){const _0x49f071=['get','name','split','all','functionNode','beforeScriptId','ENOENT','ENDPOINT','470gHZBCu','4eFaayN','4265BjmNzO','HOOK/','3362640VeAdbv','replace','isFile','scriptsRootDir','20451684kbKEjK','map','alias','afterScriptId','11vvYWEn','.js','operationType','after','datasetCode','isDirectory','before','endsWith','includes','7tFUWCn','functionName','2917205VYKMyC','HOOK','8273336ggVoSc','1791966yCdDkc','1522542GpYOeA','code','set','9ZvdeDA','push','COMMON','F_OK','trim'];a160_0x566b=function(){return _0x49f071;};return a160_0x566b();}export function resolveRemoteScriptTarget(_0x1a37ff,_0x273b81,_0x3a5d08,_0x544dc6,_0x2eacad){const _0x68e163=a160_0x3ea255,_0xfb7e8f=normalizeBffType(_0x273b81['scriptType']);if(!_0xfb7e8f||!_0x273b81[_0x68e163(0xf8)])return null;if(_0xfb7e8f===_0x68e163(0xfa)){const _0x2a26eb=(_0x273b81['id']?_0x3a5d08[_0x68e163(0x105)](_0x273b81['id']):undefined)??findHookLocationByRemoteId(_0x544dc6,_0x273b81['id']);if(!_0x2a26eb)return null;const _0x1b8b5e=_0x2a26eb[_0x68e163(0xec)]||_0x2eacad[_0x68e163(0x105)](_0x2a26eb[_0x68e163(0xf2)]),_0x2019f5=_0x1b8b5e??_0x2a26eb[_0x68e163(0xf2)],_0x25c31e={..._0x2a26eb,'alias':_0x1b8b5e},_0x11328b='HOOK/'+_0x2019f5+'/'+_0x25c31e[_0x68e163(0xf0)]+'/'+_0x25c31e[_0x68e163(0x109)]+'/'+_0x273b81['functionName'];return{'lockKey':_0x11328b,'filePath':resolveLocalFilePathFromLockKey(_0x1a37ff,_0x11328b),'type':_0x68e163(0xfa),'hookLocation':_0x25c31e};}const _0x3357e7=_0xfb7e8f+'/'+_0x273b81[_0x68e163(0xf8)];return{'lockKey':_0x3357e7,'filePath':resolveLocalFilePathFromLockKey(_0x1a37ff,_0x3357e7),'type':_0xfb7e8f};}export async function ensureParentDirectory(_0x3ef9f9){await mkdir(dirname(_0x3ef9f9),{'recursive':!![]});}export async function fileExists(_0x4ef453){const _0x1403e5=a160_0x3ea255;try{return await access(_0x4ef453,constants[_0x1403e5(0x103)]),!![];}catch{return![];}}export async function directoryExists(_0x4992df){const _0x569316=a160_0x3ea255;try{const _0x1964a3=await stat(_0x4992df);return _0x1964a3[_0x569316(0xf3)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x1ccec0,_0x54fd53){const _0x4d6aa0=a161_0x44d7,_0x57a298=_0x1ccec0();while(!![]){try{const _0x264ce6=-parseInt(_0x4d6aa0(0x13b))/0x1*(parseInt(_0x4d6aa0(0x131))/0x2)+parseInt(_0x4d6aa0(0x12d))/0x3+-parseInt(_0x4d6aa0(0x134))/0x4*(parseInt(_0x4d6aa0(0x13a))/0x5)+-parseInt(_0x4d6aa0(0x130))/0x6+-parseInt(_0x4d6aa0(0x135))/0x7+parseInt(_0x4d6aa0(0x132))/0x8*(parseInt(_0x4d6aa0(0x12e))/0x9)+parseInt(_0x4d6aa0(0x133))/0xa*(parseInt(_0x4d6aa0(0x139))/0xb);if(_0x264ce6===_0x54fd53)break;else _0x57a298['push'](_0x57a298['shift']());}catch(_0x45a3f0){_0x57a298['push'](_0x57a298['shift']());}}}(a161_0xe876,0x80597));function a161_0xe876(){const _0x6aaff3=['16GMjAIc','20EgOpqd','12244zayKYB','1672986AfXjgI','md5','createHash','hex','7651303cMeqAH','1285TaAARP','3dvuMiz','604551wjkdDi','2080530mnKdGo','digest','1463178GfHlEI','173164tajfGa'];a161_0xe876=function(){return _0x6aaff3;};return a161_0xe876();}import{readFile}from'node:fs/promises';function a161_0x44d7(_0x27a491,_0x3fc298){_0x27a491=_0x27a491-0x12d;const _0xe876d1=a161_0xe876();let _0x44d7e9=_0xe876d1[_0x27a491];return _0x44d7e9;}import a161_0x1a1d5d from'node:crypto';export function computeContentHash(_0x45cd18){const _0x5efba8=a161_0x44d7;return a161_0x1a1d5d[_0x5efba8(0x137)](_0x5efba8(0x136))['update'](_0x45cd18)[_0x5efba8(0x12f)](_0x5efba8(0x138));}export async function computeFileHash(_0x49b3e6){const _0x19dd72=await readFile(_0x49b3e6,'utf8');return computeContentHash(_0x19dd72);}
1
+ (function(_0x541bb3,_0x1769d4){const _0x2b8732=a161_0x4642,_0x232c59=_0x541bb3();while(!![]){try{const _0x3a6886=parseInt(_0x2b8732(0x132))/0x1+parseInt(_0x2b8732(0x127))/0x2*(-parseInt(_0x2b8732(0x130))/0x3)+parseInt(_0x2b8732(0x125))/0x4*(parseInt(_0x2b8732(0x126))/0x5)+-parseInt(_0x2b8732(0x12c))/0x6*(-parseInt(_0x2b8732(0x12d))/0x7)+parseInt(_0x2b8732(0x133))/0x8*(parseInt(_0x2b8732(0x12b))/0x9)+-parseInt(_0x2b8732(0x12e))/0xa+-parseInt(_0x2b8732(0x129))/0xb;if(_0x3a6886===_0x1769d4)break;else _0x232c59['push'](_0x232c59['shift']());}catch(_0x1a3837){_0x232c59['push'](_0x232c59['shift']());}}}(a161_0x2899,0xbebde));import{readFile}from'node:fs/promises';import a161_0xded2d9 from'node:crypto';export function computeContentHash(_0x24699e){const _0x3a75c4=a161_0x4642;return a161_0xded2d9[_0x3a75c4(0x12a)]('md5')[_0x3a75c4(0x131)](_0x24699e)[_0x3a75c4(0x128)](_0x3a75c4(0x12f));}function a161_0x2899(){const _0x32e04e=['7423449PzMUbL','createHash','6543GQTJnP','54TVzoHL','804909YmrCyW','1913240WLiAtz','hex','3ANWVuQ','update','302315iwMALw','10952haWcxj','135896BCbcwi','50dSvmxG','2049480bvyVOL','digest'];a161_0x2899=function(){return _0x32e04e;};return a161_0x2899();}function a161_0x4642(_0x15b1d9,_0x48512c){_0x15b1d9=_0x15b1d9-0x125;const _0x2899f9=a161_0x2899();let _0x4642fd=_0x2899f9[_0x15b1d9];return _0x4642fd;}export async function computeFileHash(_0x3282e5){const _0x522bbd=await readFile(_0x3282e5,'utf8');return computeContentHash(_0x522bbd);}
@@ -1 +1 @@
1
- (function(_0x1148df,_0x222ae6){const _0x3445cd=a162_0x51e7,_0x1a886c=_0x1148df();while(!![]){try{const _0x2b20a9=parseInt(_0x3445cd(0x136))/0x1*(-parseInt(_0x3445cd(0x14b))/0x2)+parseInt(_0x3445cd(0x138))/0x3+-parseInt(_0x3445cd(0x141))/0x4+-parseInt(_0x3445cd(0x137))/0x5+-parseInt(_0x3445cd(0x13b))/0x6+parseInt(_0x3445cd(0x149))/0x7*(-parseInt(_0x3445cd(0x146))/0x8)+parseInt(_0x3445cd(0x145))/0x9*(parseInt(_0x3445cd(0x13e))/0xa);if(_0x2b20a9===_0x222ae6)break;else _0x1a886c['push'](_0x1a886c['shift']());}catch(_0x58ff53){_0x1a886c['push'](_0x1a886c['shift']());}}}(a162_0x3737,0xdccab));function a162_0x3737(){const _0x37c106=['parse','utf8','574340jJJSIc','object','code','\x22\x20vs\x20lock\x20\x22','207vOvutj','6861496spyIct','scriptsRoot',':\x20scriptsRoot\x20mismatch\x20—\x20','7gQmhvB','lastSync','1164DBHeNC','ENOENT','179qmvzjS','1548215GljfiH','4977228pTDqSD','functions','\x22.\x20','5778174bekKKB','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps','705830mMcEME'];a162_0x3737=function(){return _0x37c106;};return a162_0x3737();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a162_0x51e7(_0x9ab41f,_0x30c603){_0x9ab41f=_0x9ab41f-0x135;const _0x37374b=a162_0x3737();let _0x51e776=_0x37374b[_0x9ab41f];return _0x51e776;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x54ef1a,_0x1ae114,_0x5b6afe,_0x1c5a26){const _0xe02e6=a162_0x51e7,_0x37a1e5={'apps':_0x54ef1a[_0xe02e6(0x13d)]&&typeof _0x54ef1a[_0xe02e6(0x13d)]==='object'?_0x54ef1a[_0xe02e6(0x13d)]:{}};let _0x2cb675=_0x37a1e5[_0xe02e6(0x13d)][_0x1ae114];if(!_0x2cb675)return _0x2cb675={'scriptsRoot':_0x5b6afe,'lastSync':'','functions':{}},_0x37a1e5[_0xe02e6(0x13d)][_0x1ae114]=_0x2cb675,{'lockData':_0x37a1e5,'appLock':_0x2cb675};if(!_0x2cb675[_0xe02e6(0x147)])_0x2cb675['scriptsRoot']=_0x5b6afe;else{if(_0x2cb675['scriptsRoot']!==_0x5b6afe)throw new Error(_0x1c5a26+_0xe02e6(0x148)+('current\x20\x22'+_0x5b6afe+_0xe02e6(0x144)+_0x2cb675['scriptsRoot']+_0xe02e6(0x13a))+_0xe02e6(0x13c));}return!_0x2cb675[_0xe02e6(0x139)]&&(_0x2cb675[_0xe02e6(0x139)]={}),!_0x2cb675[_0xe02e6(0x14a)]&&(_0x2cb675[_0xe02e6(0x14a)]=''),{'lockData':_0x37a1e5,'appLock':_0x2cb675};}export async function readBffLockFile(_0x31879d){const _0xf05f91=a162_0x51e7;try{const _0x17d730=await readFile(_0x31879d,_0xf05f91(0x140)),_0x3a5d9b=JSON[_0xf05f91(0x13f)](_0x17d730);return{'apps':_0x3a5d9b[_0xf05f91(0x13d)]&&typeof _0x3a5d9b[_0xf05f91(0x13d)]===_0xf05f91(0x142)?_0x3a5d9b[_0xf05f91(0x13d)]:{}};}catch(_0x403368){if(_0x403368[_0xf05f91(0x143)]===_0xf05f91(0x135))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x403368));}}export async function writeBffLockFile(_0x5a97b5,_0x1736e1){const _0x3d4c9f=a162_0x51e7;await mkdir(dirname(_0x5a97b5),{'recursive':!![]}),await writeFile(_0x5a97b5,JSON['stringify'](_0x1736e1,null,0x2),_0x3d4c9f(0x140));}
1
+ (function(_0x127527,_0x41e5a4){const _0x2dd014=a162_0x558b,_0x5c5607=_0x127527();while(!![]){try{const _0x142fc2=-parseInt(_0x2dd014(0xb7))/0x1*(parseInt(_0x2dd014(0xb5))/0x2)+parseInt(_0x2dd014(0xb1))/0x3*(-parseInt(_0x2dd014(0xa4))/0x4)+-parseInt(_0x2dd014(0xab))/0x5+-parseInt(_0x2dd014(0xa2))/0x6+-parseInt(_0x2dd014(0xac))/0x7+parseInt(_0x2dd014(0xb6))/0x8*(-parseInt(_0x2dd014(0xa3))/0x9)+-parseInt(_0x2dd014(0xa5))/0xa*(-parseInt(_0x2dd014(0xa6))/0xb);if(_0x142fc2===_0x41e5a4)break;else _0x5c5607['push'](_0x5c5607['shift']());}catch(_0x2efb40){_0x5c5607['push'](_0x5c5607['shift']());}}}(a162_0x3a04,0xc9e42));function a162_0x558b(_0x7988d6,_0x32f85b){_0x7988d6=_0x7988d6-0xa2;const _0x3a04a7=a162_0x3a04();let _0x558b1c=_0x3a04a7[_0x7988d6];return _0x558b1c;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1e5414,_0x5180be,_0x5d1b47,_0x488ebb){const _0x5a3bbf=a162_0x558b,_0x59294a={'apps':_0x1e5414[_0x5a3bbf(0xae)]&&typeof _0x1e5414[_0x5a3bbf(0xae)]===_0x5a3bbf(0xa9)?_0x1e5414['apps']:{}};let _0x1c86f6=_0x59294a[_0x5a3bbf(0xae)][_0x5180be];if(!_0x1c86f6)return _0x1c86f6={'scriptsRoot':_0x5d1b47,'lastSync':'','functions':{}},_0x59294a[_0x5a3bbf(0xae)][_0x5180be]=_0x1c86f6,{'lockData':_0x59294a,'appLock':_0x1c86f6};if(!_0x1c86f6[_0x5a3bbf(0xb2)])_0x1c86f6[_0x5a3bbf(0xb2)]=_0x5d1b47;else{if(_0x1c86f6['scriptsRoot']!==_0x5d1b47)throw new Error(_0x488ebb+_0x5a3bbf(0xa8)+(_0x5a3bbf(0xad)+_0x5d1b47+_0x5a3bbf(0xb4)+_0x1c86f6[_0x5a3bbf(0xb2)]+'\x22.\x20')+_0x5a3bbf(0xb0));}return!_0x1c86f6['functions']&&(_0x1c86f6['functions']={}),!_0x1c86f6[_0x5a3bbf(0xaa)]&&(_0x1c86f6['lastSync']=''),{'lockData':_0x59294a,'appLock':_0x1c86f6};}export async function readBffLockFile(_0x131493){const _0x3645e8=a162_0x558b;try{const _0x46e16b=await readFile(_0x131493,_0x3645e8(0xa7)),_0x1045f7=JSON['parse'](_0x46e16b);return{'apps':_0x1045f7[_0x3645e8(0xae)]&&typeof _0x1045f7[_0x3645e8(0xae)]==='object'?_0x1045f7[_0x3645e8(0xae)]:{}};}catch(_0x2ef024){if(_0x2ef024['code']===_0x3645e8(0xaf))return null;throw new Error(_0x3645e8(0xb3)+String(_0x2ef024));}}function a162_0x3a04(){const _0x36126b=['9xeVPAI','89444WvLYvA','59088430JaNcqy','11QCKeNI','utf8',':\x20scriptsRoot\x20mismatch\x20—\x20','object','lastSync','4777145laWkEM','10646174QcUiXx','current\x20\x22','apps','ENOENT','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','111OKXwZb','scriptsRoot','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','198kDfsPL','1504720LfwaVB','1899lVqMYz','stringify','8412828qdtruB'];a162_0x3a04=function(){return _0x36126b;};return a162_0x3a04();}export async function writeBffLockFile(_0x2783a9,_0x1993ee){const _0x359c3d=a162_0x558b;await mkdir(dirname(_0x2783a9),{'recursive':!![]}),await writeFile(_0x2783a9,JSON[_0x359c3d(0xb8)](_0x1993ee,null,0x2),_0x359c3d(0xa7));}
@@ -1 +1 @@
1
- (function(_0xfb9108,_0x1f7317){const _0x371bef=a164_0x404c,_0x3c180e=_0xfb9108();while(!![]){try{const _0x301f31=parseInt(_0x371bef(0x1e5))/0x1+parseInt(_0x371bef(0x1db))/0x2*(parseInt(_0x371bef(0x1e6))/0x3)+-parseInt(_0x371bef(0x1d7))/0x4*(parseInt(_0x371bef(0x1e2))/0x5)+parseInt(_0x371bef(0x1d4))/0x6+parseInt(_0x371bef(0x1d8))/0x7+parseInt(_0x371bef(0x1e0))/0x8*(parseInt(_0x371bef(0x1da))/0x9)+-parseInt(_0x371bef(0x1e4))/0xa;if(_0x301f31===_0x1f7317)break;else _0x3c180e['push'](_0x3c180e['shift']());}catch(_0x52396f){_0x3c180e['push'](_0x3c180e['shift']());}}}(a164_0x38ac,0xb2d9d));export function snakeToCamel(_0x2ceda2){const _0x4c0d7e=a164_0x404c;return _0x2ceda2[_0x4c0d7e(0x1e3)]()[_0x4c0d7e(0x1d3)](/_([a-z])/g,(_0x33f435,_0xfa3024)=>_0xfa3024[_0x4c0d7e(0x1d6)]());}export function findHookLocationByRemoteId(_0x5b130b,_0x3097d5){const _0x4d4977=a164_0x404c;if(!_0x3097d5)return undefined;for(const _0xcdf35e of Object[_0x4d4977(0x1df)](_0x5b130b)){if(_0xcdf35e[_0x4d4977(0x1d5)]===_0x3097d5&&_0xcdf35e[_0x4d4977(0x1d9)]&&_0xcdf35e['operationType']&&_0xcdf35e[_0x4d4977(0x1dc)])return{'datasetCode':_0xcdf35e[_0x4d4977(0x1d9)],'operationType':_0xcdf35e[_0x4d4977(0x1d2)],'functionNode':_0xcdf35e[_0x4d4977(0x1dc)]};}return undefined;}export function extractScriptDescription(_0x1ee51a){const _0x79afa7=a164_0x404c,_0x20f404=_0x1ee51a['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x20f404?.[0x1]?.[_0x79afa7(0x1e1)]()||undefined;}export function isValidBffFunctionName(_0x57cc04){const _0x1ea7fd=a164_0x404c;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x1ea7fd(0x1dd)](_0x57cc04);}function a164_0x404c(_0x1f429a,_0x14f5e9){_0x1f429a=_0x1f429a-0x1d2;const _0x38ac76=a164_0x38ac();let _0x404c20=_0x38ac76[_0x1f429a];return _0x404c20;}function a164_0x38ac(){const _0x51f8e2=['functionNode','test','before','values','5440EYvGEE','trim','55QETxeF','toLowerCase','11477330yuFEwR','857850SnEbTt','9cHhRAd','after','operationType','replace','8690418BQgXGf','remoteId','toUpperCase','506476XYiQeZ','1137773BJuPYa','datasetCode','9351IrAFDt','65202UcdLfc'];a164_0x38ac=function(){return _0x51f8e2;};return a164_0x38ac();}export function normalizeHookFunctionNode(_0x2e88c1){const _0x545e87=a164_0x404c;if(!_0x2e88c1)return undefined;const _0x2adfe8=_0x2e88c1[_0x545e87(0x1e1)]()[_0x545e87(0x1e3)]();if(_0x2adfe8===_0x545e87(0x1de)||_0x2adfe8===_0x545e87(0x1e7))return _0x2adfe8;return undefined;}
1
+ function a164_0x5e9b(_0x29e02a,_0x39a1dc){_0x29e02a=_0x29e02a-0x156;const _0x20e36a=a164_0x20e3();let _0x5e9b79=_0x20e36a[_0x29e02a];return _0x5e9b79;}(function(_0x24cb01,_0x4909f1){const _0x4faa4b=a164_0x5e9b,_0x4f047e=_0x24cb01();while(!![]){try{const _0x25301b=-parseInt(_0x4faa4b(0x162))/0x1+parseInt(_0x4faa4b(0x15d))/0x2*(parseInt(_0x4faa4b(0x166))/0x3)+-parseInt(_0x4faa4b(0x156))/0x4+-parseInt(_0x4faa4b(0x168))/0x5*(parseInt(_0x4faa4b(0x169))/0x6)+-parseInt(_0x4faa4b(0x163))/0x7+-parseInt(_0x4faa4b(0x160))/0x8+parseInt(_0x4faa4b(0x158))/0x9;if(_0x25301b===_0x4909f1)break;else _0x4f047e['push'](_0x4f047e['shift']());}catch(_0x1fc206){_0x4f047e['push'](_0x4f047e['shift']());}}}(a164_0x20e3,0x91f11));export function snakeToCamel(_0x267839){const _0x3f8c54=a164_0x5e9b;return _0x267839[_0x3f8c54(0x157)]()[_0x3f8c54(0x159)](/_([a-z])/g,(_0x3f1620,_0xcff8e5)=>_0xcff8e5[_0x3f8c54(0x15f)]());}export function findHookLocationByRemoteId(_0xb23473,_0x3c1b11){const _0x52daa0=a164_0x5e9b;if(!_0x3c1b11)return undefined;for(const _0x44cce1 of Object['values'](_0xb23473)){if(_0x44cce1[_0x52daa0(0x16a)]===_0x3c1b11&&_0x44cce1[_0x52daa0(0x15a)]&&_0x44cce1[_0x52daa0(0x15b)]&&_0x44cce1[_0x52daa0(0x161)])return{'datasetCode':_0x44cce1['datasetCode'],'operationType':_0x44cce1[_0x52daa0(0x15b)],'functionNode':_0x44cce1[_0x52daa0(0x161)]};}return undefined;}export function extractScriptDescription(_0x38b548){const _0x2e0319=a164_0x5e9b,_0x226b3f=_0x38b548[_0x2e0319(0x167)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x226b3f?.[0x1]?.[_0x2e0319(0x15c)]()||undefined;}function a164_0x20e3(){const _0x6d779d=['remoteId','4580608QeTEGp','toLowerCase','44121870ppGDwT','replace','datasetCode','operationType','trim','90212SfHVCu','before','toUpperCase','611648KBuUdi','functionNode','1138008SUYudM','6379471cxtTxb','after','test','6VoQxkf','match','120DUUpaU','280974ViZlZk'];a164_0x20e3=function(){return _0x6d779d;};return a164_0x20e3();}export function isValidBffFunctionName(_0x5addf){const _0x4cc912=a164_0x5e9b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x4cc912(0x165)](_0x5addf);}export function normalizeHookFunctionNode(_0x484fdb){const _0x49ee6d=a164_0x5e9b;if(!_0x484fdb)return undefined;const _0x2d5ae9=_0x484fdb[_0x49ee6d(0x15c)]()[_0x49ee6d(0x157)]();if(_0x2d5ae9===_0x49ee6d(0x15e)||_0x2d5ae9===_0x49ee6d(0x164))return _0x2d5ae9;return undefined;}
@@ -1 +1 @@
1
- (function(_0x2e1efc,_0x5c9fbd){const _0x439eda=a165_0x5936,_0x3ed723=_0x2e1efc();while(!![]){try{const _0x2475e5=-parseInt(_0x439eda(0x1a7))/0x1+-parseInt(_0x439eda(0x1a8))/0x2+-parseInt(_0x439eda(0x1bb))/0x3*(-parseInt(_0x439eda(0x1b7))/0x4)+parseInt(_0x439eda(0x1b3))/0x5*(-parseInt(_0x439eda(0x1a3))/0x6)+-parseInt(_0x439eda(0x1a6))/0x7+-parseInt(_0x439eda(0x1a9))/0x8+parseInt(_0x439eda(0x1ba))/0x9*(parseInt(_0x439eda(0x1aa))/0xa);if(_0x2475e5===_0x5c9fbd)break;else _0x3ed723['push'](_0x3ed723['shift']());}catch(_0x24b035){_0x3ed723['push'](_0x3ed723['shift']());}}}(a165_0x167b,0xad419));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x24f3af){const _0xd99029=a165_0x5936;if(cache[_0xd99029(0x1a5)](_0x24f3af))return cache[_0xd99029(0x1a2)](_0x24f3af);const _0x3238a8=await listDatasets(_0x24f3af),_0x30337c=new Map();for(const _0x1bed97 of _0x3238a8){const _0x6131d=_0x1bed97['dbtableConfig'];_0x6131d?.[_0xd99029(0x1b2)]!=null&&_0x30337c[_0xd99029(0x1ab)](_0x6131d[_0xd99029(0x1b2)],_0x6131d[_0xd99029(0x1a4)]??_0xd99029(0x1b4)+_0x6131d['dbId']);}const _0x3b65bf=[..._0x30337c['entries']()][_0xd99029(0x1b8)](([_0x43b7a3,_0x39a1a6])=>({'dbId':_0x43b7a3,'dbName':_0x39a1a6}));return cache[_0xd99029(0x1ab)](_0x24f3af,_0x3b65bf),_0x3b65bf;}function a165_0x5936(_0x342daf,_0x2f87ef){_0x342daf=_0x342daf-0x1a1;const _0x167b3d=a165_0x167b();let _0x5936cf=_0x167b3d[_0x342daf];return _0x5936cf;}export async function resolveDb(_0x51d25d,_0x2658db){const _0x33b51d=a165_0x5936,_0x120075=await listDatabases(_0x51d25d);if(_0x120075[_0x33b51d(0x1a1)]===0x0)return{'resolved':[],'error':_0x33b51d(0x1ad)+_0x51d25d+_0x33b51d(0x1b1)};if(!_0x2658db)return{'resolved':_0x120075};const _0x38e820=Number(_0x2658db);if(!Number['isNaN'](_0x38e820)){const _0x33f1af=_0x120075['find'](_0x9d7f87=>_0x9d7f87[_0x33b51d(0x1b2)]===_0x38e820);if(_0x33f1af)return{'resolved':[_0x33f1af]};}const _0x9db404=_0x2658db[_0x33b51d(0x1b0)](),_0x4e08e5=_0x120075['filter'](_0xa5b168=>_0xa5b168[_0x33b51d(0x1a4)][_0x33b51d(0x1b0)]()['includes'](_0x9db404));if(_0x4e08e5['length']>0x0)return{'resolved':_0x4e08e5};const _0x1536a8=_0x120075[_0x33b51d(0x1b8)](_0x5a3eee=>_0x5a3eee[_0x33b51d(0x1a4)]+'\x20('+_0x5a3eee[_0x33b51d(0x1b2)]+')')['join'](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x2658db+_0x33b51d(0x1ae)+_0x51d25d+_0x33b51d(0x1ac)+_0x1536a8+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x56c876,_0x1cecdc){const _0x4d8833=a165_0x5936,{resolved:_0x4e5709,error:_0x1f4be8}=await resolveDb(_0x56c876,_0x1cecdc);if(_0x1f4be8)return{'db':null,'error':_0x1f4be8};if(_0x4e5709[_0x4d8833(0x1a1)]===0x1)return{'db':_0x4e5709[0x0]};if(!_0x1cecdc){const _0x30ddd7=_0x4e5709['map'](_0x32bac5=>_0x32bac5['dbName']+'\x20('+_0x32bac5[_0x4d8833(0x1b2)]+')')[_0x4d8833(0x1af)](',\x20');return{'db':null,'error':_0x4d8833(0x1b9)+_0x30ddd7};}const _0x102f69=_0x4e5709[_0x4d8833(0x1b8)](_0x9af5fd=>_0x9af5fd[_0x4d8833(0x1a4)]+'\x20('+_0x9af5fd[_0x4d8833(0x1b2)]+')')[_0x4d8833(0x1af)](',\x20');return{'db':null,'error':'\x22'+_0x1cecdc+_0x4d8833(0x1b6)+_0x102f69+_0x4d8833(0x1bc)};}export async function getDbName(_0x23b543,_0x33c754){const _0x2dfdf8=a165_0x5936,_0x10d13f=await listDatabases(_0x23b543);return _0x10d13f[_0x2dfdf8(0x1b5)](_0x1d9355=>_0x1d9355[_0x2dfdf8(0x1b2)]===_0x33c754)?.[_0x2dfdf8(0x1a4)];}function a165_0x167b(){const _0x18af91=['3349876tnSbEi','map','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','9lFcJPw','3TZQbZG','.\x20Be\x20more\x20specific.','length','get','17526RtrwWY','dbName','has','9123051TnSRKp','1278990cWqUVq','2800302vcpJyl','5022608LHIcRv','46781550toaWPM','set','\x22.\x20Available:\x20','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','\x22\x20under\x20app\x20\x22','join','toLowerCase','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbId','335wxtwdw','db-','find','\x22\x20matches\x20multiple\x20databases:\x20'];a165_0x167b=function(){return _0x18af91;};return a165_0x167b();}
1
+ function a165_0x358b(){const _0x532659=['toLowerCase','330824nossGi','959ypEWKP','length','isNaN','.\x20Be\x20more\x20specific.','2634992YTwWiT','1788345NfgXbA','\x22.\x20Available:\x20','find','dbtableConfig','filter','28470OrgGBX','No\x20database\x20matching\x20\x22','\x22\x20under\x20app\x20\x22','1167129rucDff','338474nSXiee','has','join','get','dbId','db-','853272zopgVy','dbName','map','set'];a165_0x358b=function(){return _0x532659;};return a165_0x358b();}(function(_0x54ca1d,_0x67124b){const _0x4be477=a165_0x4d3b,_0x14554c=_0x54ca1d();while(!![]){try{const _0x38edda=-parseInt(_0x4be477(0x134))/0x1+-parseInt(_0x4be477(0x125))/0x2+parseInt(_0x4be477(0x133))/0x3+-parseInt(_0x4be477(0x12a))/0x4+parseInt(_0x4be477(0x12b))/0x5+-parseInt(_0x4be477(0x130))/0x6*(-parseInt(_0x4be477(0x126))/0x7)+parseInt(_0x4be477(0x120))/0x8;if(_0x38edda===_0x67124b)break;else _0x14554c['push'](_0x14554c['shift']());}catch(_0x5de2cc){_0x14554c['push'](_0x14554c['shift']());}}}(a165_0x358b,0x53342));function a165_0x4d3b(_0x34ad1f,_0x1f15b3){_0x34ad1f=_0x34ad1f-0x11e;const _0x358b78=a165_0x358b();let _0x4d3bf1=_0x358b78[_0x34ad1f];return _0x4d3bf1;}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x562984){const _0x53582c=a165_0x4d3b;if(cache[_0x53582c(0x135)](_0x562984))return cache[_0x53582c(0x137)](_0x562984);const _0x18dad6=await listDatasets(_0x562984),_0x35f30c=new Map();for(const _0x41ef9e of _0x18dad6){const _0x52e044=_0x41ef9e[_0x53582c(0x12e)];_0x52e044?.[_0x53582c(0x11e)]!=null&&_0x35f30c[_0x53582c(0x123)](_0x52e044['dbId'],_0x52e044['dbName']??_0x53582c(0x11f)+_0x52e044['dbId']);}const _0x5228a2=[..._0x35f30c['entries']()]['map'](([_0x4c660c,_0x52cbd8])=>({'dbId':_0x4c660c,'dbName':_0x52cbd8}));return cache[_0x53582c(0x123)](_0x562984,_0x5228a2),_0x5228a2;}export async function resolveDb(_0x5414d9,_0xcbd2a4){const _0x2e8fbd=a165_0x4d3b,_0x21b8f0=await listDatabases(_0x5414d9);if(_0x21b8f0[_0x2e8fbd(0x127)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x5414d9+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0xcbd2a4)return{'resolved':_0x21b8f0};const _0x4b3be0=Number(_0xcbd2a4);if(!Number[_0x2e8fbd(0x128)](_0x4b3be0)){const _0x18ea69=_0x21b8f0[_0x2e8fbd(0x12d)](_0x375f67=>_0x375f67['dbId']===_0x4b3be0);if(_0x18ea69)return{'resolved':[_0x18ea69]};}const _0x2bd529=_0xcbd2a4[_0x2e8fbd(0x124)](),_0x49ee09=_0x21b8f0[_0x2e8fbd(0x12f)](_0x582944=>_0x582944['dbName'][_0x2e8fbd(0x124)]()['includes'](_0x2bd529));if(_0x49ee09['length']>0x0)return{'resolved':_0x49ee09};const _0x368ed9=_0x21b8f0[_0x2e8fbd(0x122)](_0x699ddb=>_0x699ddb[_0x2e8fbd(0x121)]+'\x20('+_0x699ddb[_0x2e8fbd(0x11e)]+')')[_0x2e8fbd(0x136)](',\x20');return{'resolved':[],'error':_0x2e8fbd(0x131)+_0xcbd2a4+_0x2e8fbd(0x132)+_0x5414d9+_0x2e8fbd(0x12c)+_0x368ed9+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x22b01b,_0x8efcad){const _0x400c16=a165_0x4d3b,{resolved:_0x53daae,error:_0x4fbd7b}=await resolveDb(_0x22b01b,_0x8efcad);if(_0x4fbd7b)return{'db':null,'error':_0x4fbd7b};if(_0x53daae[_0x400c16(0x127)]===0x1)return{'db':_0x53daae[0x0]};if(!_0x8efcad){const _0x19db82=_0x53daae[_0x400c16(0x122)](_0x481d76=>_0x481d76['dbName']+'\x20('+_0x481d76[_0x400c16(0x11e)]+')')[_0x400c16(0x136)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x19db82};}const _0x3986e2=_0x53daae[_0x400c16(0x122)](_0x5a8e08=>_0x5a8e08['dbName']+'\x20('+_0x5a8e08['dbId']+')')[_0x400c16(0x136)](',\x20');return{'db':null,'error':'\x22'+_0x8efcad+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x3986e2+_0x400c16(0x129)};}export async function getDbName(_0xc64bc,_0x5c1c7f){const _0x520fa5=a165_0x4d3b,_0x102216=await listDatabases(_0xc64bc);return _0x102216[_0x520fa5(0x12d)](_0x28aa36=>_0x28aa36[_0x520fa5(0x11e)]===_0x5c1c7f)?.[_0x520fa5(0x121)];}