@lovrabet/rabetbase-cli 2.3.3-beta.4 → 2.3.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) 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-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/flags.js +1 -1
  47. package/lib/commands/common/validate.js +1 -1
  48. package/lib/commands/config/get.js +1 -1
  49. package/lib/commands/config/index.js +1 -1
  50. package/lib/commands/config/list.js +1 -1
  51. package/lib/commands/config/set.js +1 -1
  52. package/lib/commands/config/shared.js +1 -1
  53. package/lib/commands/data/filter.js +1 -1
  54. package/lib/commands/data/getOne.js +1 -1
  55. package/lib/commands/data/index.js +1 -1
  56. package/lib/commands/data/shared.js +1 -1
  57. package/lib/commands/dataset/business-group-update.js +1 -1
  58. package/lib/commands/dataset/capability.js +1 -1
  59. package/lib/commands/dataset/delete.js +1 -1
  60. package/lib/commands/dataset/detail.js +1 -1
  61. package/lib/commands/dataset/extend-update.js +1 -1
  62. package/lib/commands/dataset/field-update.js +1 -1
  63. package/lib/commands/dataset/generate.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 +2 -2
  219. package/lib/commands/app/use.js +0 -1
@@ -1 +1 @@
1
- (function(_0x1f1728,_0x14240b){const _0x51cbf5=a154_0x81e6,_0x24e0f6=_0x1f1728();while(!![]){try{const _0x1fa9d7=-parseInt(_0x51cbf5(0x157))/0x1*(-parseInt(_0x51cbf5(0x13e))/0x2)+parseInt(_0x51cbf5(0x155))/0x3+-parseInt(_0x51cbf5(0x158))/0x4+parseInt(_0x51cbf5(0x147))/0x5*(parseInt(_0x51cbf5(0x13f))/0x6)+parseInt(_0x51cbf5(0x140))/0x7*(parseInt(_0x51cbf5(0x151))/0x8)+parseInt(_0x51cbf5(0x148))/0x9*(parseInt(_0x51cbf5(0x14f))/0xa)+-parseInt(_0x51cbf5(0x14c))/0xb;if(_0x1fa9d7===_0x14240b)break;else _0x24e0f6['push'](_0x24e0f6['shift']());}catch(_0xf5f21e){_0x24e0f6['push'](_0x24e0f6['shift']());}}}(a154_0x4194,0x5e7ae));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';function a154_0x81e6(_0x283f43,_0x214929){_0x283f43=_0x283f43-0x138;const _0x419467=a154_0x4194();let _0x81e629=_0x419467[_0x283f43];return _0x81e629;}import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x185bcf){const _0x3e55ed=a154_0x81e6;return typeof _0x185bcf===_0x3e55ed(0x159)&&_0x185bcf['trim']()?_0x185bcf[_0x3e55ed(0x15f)]():undefined;}function a154_0x4194(){const _0x1ddcde=['20652720qbejAY','cookie','FORMAT','8420vcTmuN','keys','8TyXpnZ','ENV','read','RISK_LEVEL','2074206NFGuoz','maxRisk','625uBeuLZ','2512876PXziEj','string','locale','riskLevel','length','COOKIE','PAGE_SIZE','trim','production','MAX_RISK','accessKey','APP','ACCESS_KEY','env','globalConfig','object','appcode','app','2298msLqBX','68766IeKOSj','4261299aIGMFY','VERBOSE','true','inherit','projectConfig','defaultApp','format','315wXfDnX','1629qpSYwa','apps','entries','apiDir'];a154_0x4194=function(){return _0x1ddcde;};return a154_0x4194();}function appProfiles(_0x543c9b){const _0x5e0ecd=a154_0x81e6;return _0x543c9b[_0x5e0ecd(0x149)]&&typeof _0x543c9b[_0x5e0ecd(0x149)]===_0x5e0ecd(0x13b)?_0x543c9b[_0x5e0ecd(0x149)]:{};}function resolveDefaultAppName(_0x42684b){const _0x4141f1=a154_0x81e6,_0x13179a=stringConfigValue(_0x42684b[_0x4141f1(0x145)]);if(_0x13179a)return _0x13179a;return Object[_0x4141f1(0x150)](appProfiles(_0x42684b))[0x0];}function resolveTopLevelAppCode(_0x503983){const _0x290c0a=a154_0x81e6;return stringConfigValue(_0x503983[_0x290c0a(0x13c)])||stringConfigValue(_0x503983[_0x290c0a(0x13d)]);}export function resolveAppConfig({raw:_0x5304f9,flags:_0x425475,layers:_0x4e1c92,readEnv:_0x49a130}){const _0x16218c=a154_0x81e6,_0x29847e=_0x4e1c92?.[_0x16218c(0x144)]??{},_0x342c64=_0x4e1c92?.[_0x16218c(0x13a)]??{},_0x4c4943=Object[_0x16218c(0x150)](_0x29847e)[_0x16218c(0x15c)]>0x0,_0x170490=!_0x4c4943||_0x29847e[_0x16218c(0x143)]===!![],_0x4df915=_0x4c4943?resolveDefaultAppName(_0x29847e):undefined,_0x3ad21a=_0x170490?resolveDefaultAppName(_0x342c64):undefined,_0x4db9fe=stringConfigValue(_0x425475[_0x16218c(0x13d)]),_0x46ef2d=_0x49a130(_0x16218c(0x163)),_0x7e0fa5={};if(_0x5304f9[_0x16218c(0x149)]&&typeof _0x5304f9[_0x16218c(0x149)]===_0x16218c(0x13b))for(const [_0x44385e,_0x4c838b]of Object[_0x16218c(0x14a)](_0x5304f9[_0x16218c(0x149)])){_0x4c838b&&typeof _0x4c838b===_0x16218c(0x13b)&&_0x4c838b[_0x16218c(0x13c)]&&(_0x7e0fa5[_0x44385e]=_0x4c838b);}const _0x3d8eb3=_0x5304f9['defaultApp']||undefined,_0x403a6e=Object['keys'](_0x7e0fa5)[_0x16218c(0x15c)]>0x0,_0x52574d=_0x4db9fe||_0x4df915||_0x46ef2d||_0x3ad21a||_0x3d8eb3||undefined,_0x181695=stringConfigValue(_0x425475[_0x16218c(0x13c)]),_0x4e9795=_0x181695?Object[_0x16218c(0x14a)](_0x7e0fa5)['find'](([,_0xd218c1])=>_0xd218c1?.[_0x16218c(0x13c)]===_0x181695):undefined,_0xdc9eae=_0x4e9795?.[0x0],_0x421f3b=_0x4e9795?.[0x1],_0x14df99=_0x181695?_0xdc9eae:_0x52574d;let _0x56b253=_0x14df99&&_0x7e0fa5[_0x14df99]?_0x7e0fa5[_0x14df99]:undefined;_0x181695&&_0x421f3b&&(_0x56b253=_0x421f3b);const _0x45952e=_0x181695?_0x421f3b??_0x56b253:_0x56b253,_0x261cc8=!_0x4db9fe&&!_0x4df915&&_0x46ef2d&&_0x14df99===_0x46ef2d,_0x613268=_0x4db9fe||(_0x261cc8?_0x46ef2d:undefined)||(_0x181695?_0xdc9eae:undefined),_0x217789=_0x45952e?.['appcode'],_0x38316a=_0x4c4943?resolveTopLevelAppCode(_0x29847e):undefined,_0x464532=_0x170490?resolveTopLevelAppCode(_0x342c64):undefined,_0x586804=_0x4db9fe||_0x4df915?_0x217789:undefined,_0x22e338=!_0x4db9fe&&!_0x4df915?_0x217789:undefined,_0x194907=_0x181695||_0x586804||_0x38316a||_0x22e338||_0x464532||undefined,_0x37c8b7=_0x4c4943?stringConfigValue(_0x29847e['env']):undefined,_0xade2fb=_0x170490?stringConfigValue(_0x342c64[_0x16218c(0x139)]):undefined,_0x477ebd=_0x425475['env']||_0x45952e?.[_0x16218c(0x139)]||_0x37c8b7||_0x49a130(_0x16218c(0x152))||_0xade2fb||_0x5304f9[_0x16218c(0x139)]||DEFAULT_CONFIG_VALUES[_0x16218c(0x139)],_0x1e02eb=_0x45952e?.[_0x16218c(0x15a)]||_0x5304f9[_0x16218c(0x15a)]||DEFAULT_CONFIG_VALUES[_0x16218c(0x15a)],_0x2a2077=_0x49a130(_0x16218c(0x15d))||_0x45952e?.[_0x16218c(0x14d)]||_0x5304f9[_0x16218c(0x14d)]||undefined,_0x81b059=_0x49a130(_0x16218c(0x138))||_0x45952e?.[_0x16218c(0x162)]||_0x5304f9[_0x16218c(0x162)]||undefined,_0x428273=_0x425475['format']||_0x49a130(_0x16218c(0x14e))||_0x45952e?.[_0x16218c(0x146)]||_0x5304f9[_0x16218c(0x146)],_0x58dbad=normalizeLegacyOutputFormat(_0x428273),_0x5507ed=_0x49a130(_0x16218c(0x15e))||_0x45952e?.['pageSize']||_0x5304f9['pageSize'],_0x45b8ba=_0x5507ed?Number(_0x5507ed)||undefined:undefined,_0x22c29c=_0x49a130(_0x16218c(0x154))||_0x49a130(_0x16218c(0x161))||_0x45952e?.[_0x16218c(0x15b)]||_0x5304f9[_0x16218c(0x15b)]||_0x5304f9[_0x16218c(0x156)],_0x542e9b=_0x22c29c===_0x16218c(0x153)||_0x22c29c==='write'?_0x22c29c:DEFAULT_CONFIG_VALUES[_0x16218c(0x15b)],_0x1fce76=_0x49a130(_0x16218c(0x141)),_0x236123=_0x1fce76==='1'||_0x1fce76===_0x16218c(0x142),_0x5b43b5=_0x45952e?.[_0x16218c(0x14b)]||_0x5304f9['apiDir']||DEFAULT_CONFIG_VALUES[_0x16218c(0x14b)],_0x4a0de9=isDaily(normalizeEnv(String(_0x477ebd)))?'daily':_0x16218c(0x160);return{'appCode':typeof _0x194907===_0x16218c(0x159)&&_0x194907[_0x16218c(0x15f)]()?_0x194907['trim']():undefined,'env':_0x4a0de9,'locale':_0x1e02eb,'cookie':_0x2a2077,'accessKey':_0x81b059,'format':_0x58dbad,'pageSize':_0x45b8ba,'riskLevel':_0x542e9b,'verbose':_0x236123,'apiDir':_0x5b43b5,'apps':_0x7e0fa5,'defaultApp':_0x3d8eb3,'currentApp':_0x403a6e?_0x14df99:undefined,'explicitAppName':_0x613268};}
1
+ (function(_0x81430c,_0x2b02cc){const _0x565203=a153_0x45f2,_0x27d406=_0x81430c();while(!![]){try{const _0x40021f=parseInt(_0x565203(0x118))/0x1*(parseInt(_0x565203(0xf3))/0x2)+-parseInt(_0x565203(0xfa))/0x3*(-parseInt(_0x565203(0xf5))/0x4)+-parseInt(_0x565203(0x104))/0x5*(parseInt(_0x565203(0x10a))/0x6)+parseInt(_0x565203(0xf6))/0x7*(parseInt(_0x565203(0xfb))/0x8)+parseInt(_0x565203(0x115))/0x9*(parseInt(_0x565203(0x111))/0xa)+-parseInt(_0x565203(0xf8))/0xb*(-parseInt(_0x565203(0x103))/0xc)+parseInt(_0x565203(0xfe))/0xd*(-parseInt(_0x565203(0xfd))/0xe);if(_0x40021f===_0x2b02cc)break;else _0x27d406['push'](_0x27d406['shift']());}catch(_0x13c0e0){_0x27d406['push'](_0x27d406['shift']());}}}(a153_0x5c53,0xb26ee));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x21f7a0){const _0x40fb6f=a153_0x45f2;return typeof _0x21f7a0===_0x40fb6f(0x10f)&&_0x21f7a0[_0x40fb6f(0x10d)]()?_0x21f7a0['trim']():undefined;}function appProfiles(_0x2d48e2){const _0x2a923f=a153_0x45f2;return _0x2d48e2[_0x2a923f(0x109)]&&typeof _0x2d48e2['apps']===_0x2a923f(0xf4)?_0x2d48e2[_0x2a923f(0x109)]:{};}function resolveDefaultAppName(_0x5be595){const _0x2208e8=a153_0x45f2,_0x4a60c1=stringConfigValue(_0x5be595[_0x2208e8(0x102)]);if(_0x4a60c1)return _0x4a60c1;return Object[_0x2208e8(0x105)](appProfiles(_0x5be595))[0x0];}function resolveTopLevelAppCode(_0x1d9ab7){const _0x14fa4a=a153_0x45f2;return stringConfigValue(_0x1d9ab7[_0x14fa4a(0x11b)])||stringConfigValue(_0x1d9ab7['app']);}function a153_0x5c53(){const _0x36d865=['apps','37158IRFULg','inherit','pageSize','trim','projectConfig','string','accessKey','12230QfEzuQ','RISK_LEVEL','format','locale','6273TdJicR','maxRisk','ACCESS_KEY','946XwUlxk','APP','COOKIE','appcode','entries','ENV','1592JQAeLi','object','4waTpFr','1983758xvuBCS','riskLevel','2388804aOIprL','read','2925147YVASEx','40iEbpbc','app','24542aFWRQk','21619xuaKFn','env','apiDir','daily','defaultApp','48XdkuMT','985mAAhue','keys','length','FORMAT','cookie'];a153_0x5c53=function(){return _0x36d865;};return a153_0x5c53();}function a153_0x45f2(_0x5618a9,_0x24c1ff){_0x5618a9=_0x5618a9-0xf1;const _0x5c5380=a153_0x5c53();let _0x45f27b=_0x5c5380[_0x5618a9];return _0x45f27b;}export function resolveAppConfig({raw:_0x50279f,flags:_0xe455f2,layers:_0x6badfd,readEnv:_0x1c0871}){const _0x30c52c=a153_0x45f2,_0x15df4d=_0x6badfd?.[_0x30c52c(0x10e)]??{},_0x26f74b=_0x6badfd?.['globalConfig']??{},_0x3e2e8a=Object[_0x30c52c(0x105)](_0x15df4d)[_0x30c52c(0x106)]>0x0,_0x413117=!_0x3e2e8a||_0x15df4d[_0x30c52c(0x10b)]===!![],_0x3125ff=_0x3e2e8a?resolveDefaultAppName(_0x15df4d):undefined,_0x2318a3=_0x413117?resolveDefaultAppName(_0x26f74b):undefined,_0x819431=stringConfigValue(_0xe455f2[_0x30c52c(0xfc)]),_0x407fc3=_0x1c0871(_0x30c52c(0x119)),_0x4563fd={};if(_0x50279f[_0x30c52c(0x109)]&&typeof _0x50279f[_0x30c52c(0x109)]===_0x30c52c(0xf4))for(const [_0x231c4a,_0x3853e6]of Object[_0x30c52c(0xf1)](_0x50279f[_0x30c52c(0x109)])){_0x3853e6&&typeof _0x3853e6===_0x30c52c(0xf4)&&_0x3853e6['appcode']&&(_0x4563fd[_0x231c4a]=_0x3853e6);}const _0x3c995a=_0x50279f[_0x30c52c(0x102)]||undefined,_0x23c789=Object['keys'](_0x4563fd)[_0x30c52c(0x106)]>0x0,_0x10132d=_0x819431||_0x3125ff||_0x407fc3||_0x2318a3||_0x3c995a||undefined,_0x462307=stringConfigValue(_0xe455f2[_0x30c52c(0x11b)]),_0x2ad4c1=_0x462307?Object[_0x30c52c(0xf1)](_0x4563fd)['find'](([,_0x39b0c5])=>_0x39b0c5?.['appcode']===_0x462307):undefined,_0x240f6f=_0x2ad4c1?.[0x0],_0x1fdaf6=_0x2ad4c1?.[0x1],_0x5b1dab=_0x462307?_0x240f6f:_0x10132d;let _0x8e2302=_0x5b1dab&&_0x4563fd[_0x5b1dab]?_0x4563fd[_0x5b1dab]:undefined;_0x462307&&_0x1fdaf6&&(_0x8e2302=_0x1fdaf6);const _0x397bfc=_0x462307?_0x1fdaf6??_0x8e2302:_0x8e2302,_0x10776a=!_0x819431&&!_0x3125ff&&_0x407fc3&&_0x5b1dab===_0x407fc3,_0x371aaf=_0x819431||(_0x10776a?_0x407fc3:undefined)||(_0x462307?_0x240f6f:undefined),_0x52412e=_0x397bfc?.[_0x30c52c(0x11b)],_0x25035a=_0x3e2e8a?resolveTopLevelAppCode(_0x15df4d):undefined,_0x483656=_0x413117?resolveTopLevelAppCode(_0x26f74b):undefined,_0x54248f=_0x819431||_0x3125ff?_0x52412e:undefined,_0x3c43ca=!_0x819431&&!_0x3125ff?_0x52412e:undefined,_0x398277=_0x462307||_0x54248f||_0x25035a||_0x3c43ca||_0x483656||undefined,_0x4ef596=_0x3e2e8a?stringConfigValue(_0x15df4d[_0x30c52c(0xff)]):undefined,_0x47c3d4=_0x413117?stringConfigValue(_0x26f74b[_0x30c52c(0xff)]):undefined,_0x152cd8=_0xe455f2['env']||_0x397bfc?.['env']||_0x4ef596||_0x1c0871(_0x30c52c(0xf2))||_0x47c3d4||_0x50279f[_0x30c52c(0xff)]||DEFAULT_CONFIG_VALUES[_0x30c52c(0xff)],_0x4b56c8=_0x397bfc?.[_0x30c52c(0x114)]||_0x50279f[_0x30c52c(0x114)]||DEFAULT_CONFIG_VALUES[_0x30c52c(0x114)],_0x38df2c=_0x1c0871(_0x30c52c(0x11a))||_0x397bfc?.[_0x30c52c(0x108)]||_0x50279f[_0x30c52c(0x108)]||undefined,_0x31a674=_0x1c0871(_0x30c52c(0x117))||_0x397bfc?.['accessKey']||_0x50279f[_0x30c52c(0x110)]||undefined,_0x1d13a3=_0xe455f2[_0x30c52c(0x113)]||_0x1c0871(_0x30c52c(0x107))||_0x397bfc?.[_0x30c52c(0x113)]||_0x50279f['format'],_0x191c41=normalizeLegacyOutputFormat(_0x1d13a3),_0x27d742=_0x1c0871('PAGE_SIZE')||_0x397bfc?.[_0x30c52c(0x10c)]||_0x50279f['pageSize'],_0x199764=_0x27d742?Number(_0x27d742)||undefined:undefined,_0x31ea88=_0x1c0871(_0x30c52c(0x112))||_0x1c0871('MAX_RISK')||_0x397bfc?.[_0x30c52c(0xf7)]||_0x50279f[_0x30c52c(0xf7)]||_0x50279f[_0x30c52c(0x116)],_0x2820e0=_0x31ea88===_0x30c52c(0xf9)||_0x31ea88==='write'?_0x31ea88:DEFAULT_CONFIG_VALUES[_0x30c52c(0xf7)],_0x29ed34=_0x1c0871('VERBOSE'),_0x37d885=_0x29ed34==='1'||_0x29ed34==='true',_0x27e161=_0x397bfc?.['apiDir']||_0x50279f[_0x30c52c(0x100)]||DEFAULT_CONFIG_VALUES[_0x30c52c(0x100)],_0x5edc9c=isDaily(normalizeEnv(String(_0x152cd8)))?_0x30c52c(0x101):'production';return{'appCode':typeof _0x398277===_0x30c52c(0x10f)&&_0x398277[_0x30c52c(0x10d)]()?_0x398277['trim']():undefined,'env':_0x5edc9c,'locale':_0x4b56c8,'cookie':_0x38df2c,'accessKey':_0x31a674,'format':_0x191c41,'pageSize':_0x199764,'riskLevel':_0x2820e0,'verbose':_0x37d885,'apiDir':_0x27e161,'apps':_0x4563fd,'defaultApp':_0x3c995a,'currentApp':_0x23c789?_0x5b1dab:undefined,'explicitAppName':_0x371aaf};}
@@ -1 +1 @@
1
- function a155_0x367c(){const _0x32444c=['authRequired','203570CeujqG','847HBYlPu','1877670cWgjrt','3135879DFcKYC','../auth/get-cookie.js','11984lydZwd','778917mKFvIg','138737RRxJbe','2SNYnus','1111836qNOdTV','cookie'];a155_0x367c=function(){return _0x32444c;};return a155_0x367c();}(function(_0x2249ef,_0x4cb62a){const _0x5b177c=a155_0x3c98,_0x649d01=_0x2249ef();while(!![]){try{const _0x4ed99f=-parseInt(_0x5b177c(0x127))/0x1*(parseInt(_0x5b177c(0x128))/0x2)+parseInt(_0x5b177c(0x126))/0x3+parseInt(_0x5b177c(0x129))/0x4+parseInt(_0x5b177c(0x12c))/0x5+parseInt(_0x5b177c(0x12e))/0x6+-parseInt(_0x5b177c(0x12d))/0x7*(parseInt(_0x5b177c(0x125))/0x8)+-parseInt(_0x5b177c(0x12f))/0x9;if(_0x4ed99f===_0x4cb62a)break;else _0x649d01['push'](_0x649d01['shift']());}catch(_0x30a362){_0x649d01['push'](_0x649d01['shift']());}}}(a155_0x367c,0x3666f));import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';function a155_0x3c98(_0x457154,_0x32e2db){_0x457154=_0x457154-0x125;const _0x367c84=a155_0x367c();let _0x3c98c2=_0x367c84[_0x457154];return _0x3c98c2;}export async function buildAuth(_0x24efe1){const _0x12d14b=a155_0x3c98,{getCookie:_0x1f821c}=await import(_0x12d14b(0x130)),_0x31d735=_0x24efe1[_0x12d14b(0x12a)]||_0x1f821c(),_0x187bc1=_0x31d735?await getIsSessionValid():![];return{'cookie':_0x31d735,'isLoggedIn':_0x187bc1,async 'getOrLogin'(){const _0x60e5df=_0x12d14b;if(_0x31d735&&_0x187bc1)return _0x31d735;throw CliErrors[_0x60e5df(0x12b)]();}};}
1
+ (function(_0x35e408,_0x31ac19){const _0x1ae118=a154_0x5e85,_0x28e5ee=_0x35e408();while(!![]){try{const _0x20a986=-parseInt(_0x1ae118(0x1b3))/0x1*(parseInt(_0x1ae118(0x1ba))/0x2)+-parseInt(_0x1ae118(0x1b6))/0x3+parseInt(_0x1ae118(0x1b7))/0x4+parseInt(_0x1ae118(0x1b0))/0x5*(parseInt(_0x1ae118(0x1b9))/0x6)+-parseInt(_0x1ae118(0x1bb))/0x7+-parseInt(_0x1ae118(0x1b5))/0x8+parseInt(_0x1ae118(0x1b4))/0x9*(parseInt(_0x1ae118(0x1b2))/0xa);if(_0x20a986===_0x31ac19)break;else _0x28e5ee['push'](_0x28e5ee['shift']());}catch(_0x96ba48){_0x28e5ee['push'](_0x28e5ee['shift']());}}}(a154_0x4ce1,0x6f8be));import{getIsSessionValid}from'../auth/is-session-valid.js';function a154_0x4ce1(){const _0x4a6e6f=['1048388zbdDnP','../auth/get-cookie.js','6DNOAMO','585328zDzLEp','3653160wnjzEo','3530470jdVZyq','authRequired','56940bOEqsx','2iMhDTq','3609ZoOsBD','7252592BdtgQz','2342427Mpeqdj'];a154_0x4ce1=function(){return _0x4a6e6f;};return a154_0x4ce1();}import{CliErrors}from'../errors.js';function a154_0x5e85(_0xd81c0a,_0x6ce5a4){_0xd81c0a=_0xd81c0a-0x1b0;const _0x4ce117=a154_0x4ce1();let _0x5e8532=_0x4ce117[_0xd81c0a];return _0x5e8532;}export async function buildAuth(_0x510959){const _0x3d39ed=a154_0x5e85,{getCookie:_0x44b0cc}=await import(_0x3d39ed(0x1b8)),_0xc1d61a=_0x510959['cookie']||_0x44b0cc(),_0x3fa9e8=_0xc1d61a?await getIsSessionValid():![];return{'cookie':_0xc1d61a,'isLoggedIn':_0x3fa9e8,async 'getOrLogin'(){const _0x54bf70=_0x3d39ed;if(_0xc1d61a&&_0x3fa9e8)return _0xc1d61a;throw CliErrors[_0x54bf70(0x1b1)]();}};}
@@ -1 +1 @@
1
- const a156_0x285e9f=a156_0x2aad;(function(_0xdbeb0a,_0x584ab2){const _0x5a3016=a156_0x2aad,_0x1edabf=_0xdbeb0a();while(!![]){try{const _0xf7f0d8=parseInt(_0x5a3016(0x154))/0x1+parseInt(_0x5a3016(0x17b))/0x2+-parseInt(_0x5a3016(0x151))/0x3+parseInt(_0x5a3016(0x16c))/0x4*(-parseInt(_0x5a3016(0x167))/0x5)+-parseInt(_0x5a3016(0x16f))/0x6+-parseInt(_0x5a3016(0x174))/0x7*(parseInt(_0x5a3016(0x17d))/0x8)+-parseInt(_0x5a3016(0x152))/0x9*(-parseInt(_0x5a3016(0x16e))/0xa);if(_0xf7f0d8===_0x584ab2)break;else _0x1edabf['push'](_0x1edabf['shift']());}catch(_0x51f032){_0x1edabf['push'](_0x1edabf['shift']());}}}(a156_0x7e9c,0xc27de));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=a156_0x285e9f(0x153);export const CONFIG_NAMES=[a156_0x285e9f(0x153),a156_0x285e9f(0x164),a156_0x285e9f(0x166)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a156_0x285e9f(0x17a)](_0x1b4dc0=>_0x1b4dc0!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x381d1e){for(const _0x21854d of CONFIG_NAMES){const _0x4187dd=resolve(_0x381d1e,_0x21854d);if(existsSync(_0x4187dd))return _0x4187dd;}return undefined;}export function findProjectRootDirectory(_0x520b7d=process[a156_0x285e9f(0x158)]()){let _0x243da3=resolve(_0x520b7d);const {root:_0x17e1f9}=parse(_0x243da3),_0x6164d5=homedir();while(!![]){if(resolveConfigPath(_0x243da3)){if(_0x243da3===_0x6164d5)break;return _0x243da3;}if(_0x243da3===_0x17e1f9||_0x243da3===_0x6164d5)break;const _0x286556=dirname(_0x243da3);if(_0x286556===_0x243da3)break;_0x243da3=_0x286556;}return resolve(_0x520b7d);}export function getProjectConfigPath(){const _0x4cd80b=a156_0x285e9f;return resolveConfigPath(process[_0x4cd80b(0x158)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a156_0x2aad(_0xf63468,_0x2b48f9){_0xf63468=_0xf63468-0x14f;const _0x7e9cd7=a156_0x7e9c();let _0x2aad2c=_0x7e9cd7[_0xf63468];return _0x2aad2c;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3660a3){const _0x2da605=a156_0x285e9f;if(!existsSync(_0x3660a3))return{'status':'missing'};try{const _0x74869e=readFileSync(_0x3660a3,{'encoding':'utf8'});if(!_0x74869e?.[_0x2da605(0x165)]())return{'status':'empty'};const _0x3d3ebd=JSON['parse'](_0x74869e);return{'status':'ok','data':_0x3d3ebd};}catch(_0x3c87a3){return{'status':_0x2da605(0x168),'message':_0x3c87a3 instanceof Error?_0x3c87a3[_0x2da605(0x162)]:String(_0x3c87a3)};}}function parseCliConfigJsonFile(_0x1b39ed,_0x380960,_0x2db4ca){const _0x567927=a156_0x285e9f,_0x21f55b=inspectCliConfigJsonFile(_0x1b39ed);if(_0x21f55b[_0x567927(0x15f)]===_0x567927(0x157)||_0x21f55b[_0x567927(0x15f)]==='empty')return{};if(_0x21f55b[_0x567927(0x15f)]==='ok')return _0x21f55b[_0x567927(0x178)];return _0x380960===_0x567927(0x15e)&&_0x2db4ca&&console['error'](CLI_BIN_NAME+':\x20'+_0x2db4ca+_0x567927(0x15b)+_0x1b39ed+_0x567927(0x169)+_0x21f55b[_0x567927(0x162)]),{};}function normalizeLegacyConfigShape(_0x5f5d1b){const _0x53ff42=a156_0x285e9f;if(!_0x5f5d1b||typeof _0x5f5d1b!==_0x53ff42(0x14f))return{'config':{},'migrated':![]};const _0x3bb723={..._0x5f5d1b},_0x24d4a1=_0x3bb723[_0x53ff42(0x175)]&&typeof _0x3bb723[_0x53ff42(0x175)]===_0x53ff42(0x14f)?{..._0x3bb723[_0x53ff42(0x175)]}:{},_0x265713=Object[_0x53ff42(0x171)](_0x24d4a1)[_0x53ff42(0x161)],_0x5b06d2=_0x3bb723['appcode']||_0x3bb723[_0x53ff42(0x17e)];let _0x28baa5=![];if(_0x5b06d2&&_0x265713===0x0){const _0x4b9d4a=typeof _0x3bb723[_0x53ff42(0x15a)]==='string'&&_0x3bb723['defaultApp'][_0x53ff42(0x165)]()?_0x3bb723[_0x53ff42(0x15a)]:String(_0x5b06d2)[_0x53ff42(0x165)]();_0x24d4a1[_0x4b9d4a]={'appcode':String(_0x5b06d2)[_0x53ff42(0x165)](),..._0x3bb723[_0x53ff42(0x173)]!=null?{'env':_0x3bb723[_0x53ff42(0x173)]}:{},..._0x3bb723['apiDir']!=null?{'apiDir':_0x3bb723[_0x53ff42(0x159)]}:{},..._0x3bb723['cookie']!=null?{'cookie':_0x3bb723[_0x53ff42(0x16b)]}:{},..._0x3bb723[_0x53ff42(0x16a)]!=null?{'accessKey':_0x3bb723[_0x53ff42(0x16a)]}:{},..._0x3bb723[_0x53ff42(0x172)]!=null?{'format':_0x3bb723[_0x53ff42(0x172)]}:{},..._0x3bb723[_0x53ff42(0x17c)]!=null?{'pageSize':_0x3bb723[_0x53ff42(0x17c)]}:{},..._0x3bb723[_0x53ff42(0x156)]!=null?{'riskLevel':_0x3bb723['riskLevel']}:{},..._0x3bb723[_0x53ff42(0x150)]!=null?{'locale':_0x3bb723[_0x53ff42(0x150)]}:{}},_0x3bb723[_0x53ff42(0x175)]=_0x24d4a1;if(!_0x3bb723['defaultApp'])_0x3bb723[_0x53ff42(0x15a)]=_0x4b9d4a;_0x28baa5=!![];}return(_0x53ff42(0x16d)in _0x3bb723||_0x53ff42(0x17e)in _0x3bb723)&&(delete _0x3bb723[_0x53ff42(0x16d)],delete _0x3bb723['app'],_0x28baa5=!![]),{'config':_0x3bb723,'migrated':_0x28baa5};}function writeNormalizedConfigIfNeeded(_0xc75f5c,_0x4acd68){const _0x41bc33=a156_0x285e9f,_0x1186c8=JSON[_0x41bc33(0x15c)](_0x4acd68,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0xc75f5c)===_0x1186c8)return;writeConfigFile(_0xc75f5c,_0x4acd68),normalizedWriteCache['set'](_0xc75f5c,_0x1186c8);}function parseAndNormalizeConfig(_0x24e5ab,_0x408dc8,_0x2b3a1a){const _0x77b851=a156_0x285e9f,_0x390504=parseCliConfigJsonFile(_0x24e5ab,_0x408dc8,_0x2b3a1a),_0x3be3b7=normalizeLegacyConfigShape(_0x390504);if(_0x3be3b7[_0x77b851(0x160)])try{writeNormalizedConfigIfNeeded(_0x24e5ab,_0x3be3b7[_0x77b851(0x15d)]);}catch{}return _0x3be3b7[_0x77b851(0x15d)];}export function loadRawConfigLayers(_0x39ec25){const _0x1df90c=a156_0x285e9f;let _0x120e07={},_0x387274={};const _0x198a89=resolveConfigPath(homedir());_0x198a89&&(_0x120e07=parseAndNormalizeConfig(_0x198a89,_0x1df90c(0x15e),_0x1df90c(0x163)));const _0x243782=_0x39ec25??findProjectRootDirectory(),_0x308244=resolveConfigPath(_0x243782);return _0x308244&&(_0x387274=parseAndNormalizeConfig(_0x308244,_0x1df90c(0x15e),_0x1df90c(0x176))),{'globalPath':_0x198a89,'projectPath':_0x308244,'globalConfig':_0x120e07,'projectConfig':_0x387274};}const INHERIT_WHITELIST=[a156_0x285e9f(0x16b),a156_0x285e9f(0x16a),'locale',a156_0x285e9f(0x172),'riskLevel',a156_0x285e9f(0x17c)];export function mergeRawConfigLayers(_0x2504e7){const _0x2c916a=a156_0x285e9f,{globalConfig:_0x398978,projectConfig:_0x33bf10}=_0x2504e7,_0x64940b=Object[_0x2c916a(0x171)](_0x33bf10)[_0x2c916a(0x161)]>0x0;if(!_0x64940b)return mergeGlobalOnly(_0x398978);if(_0x33bf10[_0x2c916a(0x177)]===!![])return mergeFullInherit(_0x398978,_0x33bf10);if(_0x33bf10[_0x2c916a(0x177)]===![])return mergeIsolated(_0x33bf10);return mergeProjectFirst(_0x398978,_0x33bf10);}function mergeGlobalOnly(_0x120d2d){const _0x5af2c8=a156_0x285e9f,_0x227e0a={..._0x120d2d},_0x352952=_0x120d2d[_0x5af2c8(0x175)]&&typeof _0x120d2d[_0x5af2c8(0x175)]===_0x5af2c8(0x14f)?_0x120d2d[_0x5af2c8(0x175)]:{};if(Object['keys'](_0x352952)['length']>0x0)_0x227e0a['apps']=_0x352952;if(_0x120d2d[_0x5af2c8(0x15a)])_0x227e0a[_0x5af2c8(0x15a)]=_0x120d2d['defaultApp'];else{const _0x4d01b8=Object[_0x5af2c8(0x171)](_0x352952);if(_0x4d01b8['length']>0x0)_0x227e0a[_0x5af2c8(0x15a)]=_0x4d01b8[0x0];}return _0x227e0a;}function mergeIsolated(_0x5b40f6){const _0x5e622a=a156_0x285e9f,_0x50c999={..._0x5b40f6};delete _0x50c999[_0x5e622a(0x177)];const _0x3b8d9e=_0x5b40f6['apps']&&typeof _0x5b40f6[_0x5e622a(0x175)]===_0x5e622a(0x14f)?_0x5b40f6[_0x5e622a(0x175)]:{};Object[_0x5e622a(0x171)](_0x3b8d9e)[_0x5e622a(0x161)]>0x0?_0x50c999[_0x5e622a(0x175)]=_0x3b8d9e:delete _0x50c999['apps'];if(_0x5e622a(0x15a)in _0x5b40f6)_0x50c999[_0x5e622a(0x15a)]=_0x5b40f6[_0x5e622a(0x15a)];else Object['keys'](_0x3b8d9e)[_0x5e622a(0x161)]>0x0?_0x50c999[_0x5e622a(0x15a)]=Object[_0x5e622a(0x171)](_0x3b8d9e)[0x0]:delete _0x50c999[_0x5e622a(0x15a)];return _0x50c999;}function a156_0x7e9c(){const _0x30ebf=['.tmp','riskLevel','missing','cwd','apiDir','defaultApp','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','stringify','config','warn','status','migrated','length','message','Global','.lovrabet.json','trim','.lovrabetrc','10NSaZDd','error','\x0a\x20\x20','accessKey','cookie','1182388MVIbxc','appcode','6620TSnrye','306276SGnsWm','silent','keys','format','env','9867053SrAuRP','apps','Project','inherit','data','project','filter','2881936SCyeAl','pageSize','8sjBfMk','app','object','locale','2045439HkZycU','13995MTueak','.rabetbase.json','1059892wAVnhG'];a156_0x7e9c=function(){return _0x30ebf;};return a156_0x7e9c();}function mergeProjectFirst(_0x238f9f,_0x2cbf18){const _0x4b9b93=a156_0x285e9f,_0x2294dc={..._0x2cbf18};delete _0x2294dc[_0x4b9b93(0x177)];for(const _0x1a4765 of INHERIT_WHITELIST){!(_0x1a4765 in _0x2294dc)&&_0x1a4765 in _0x238f9f&&(_0x2294dc[_0x1a4765]=_0x238f9f[_0x1a4765]);}const _0x55c686=_0x2cbf18[_0x4b9b93(0x175)]&&typeof _0x2cbf18[_0x4b9b93(0x175)]===_0x4b9b93(0x14f)?_0x2cbf18['apps']:{};Object[_0x4b9b93(0x171)](_0x55c686)['length']>0x0?_0x2294dc[_0x4b9b93(0x175)]=_0x55c686:delete _0x2294dc[_0x4b9b93(0x175)];if(_0x4b9b93(0x15a)in _0x2cbf18)_0x2294dc['defaultApp']=_0x2cbf18['defaultApp'];else Object[_0x4b9b93(0x171)](_0x55c686)[_0x4b9b93(0x161)]>0x0?_0x2294dc[_0x4b9b93(0x15a)]=Object[_0x4b9b93(0x171)](_0x55c686)[0x0]:delete _0x2294dc[_0x4b9b93(0x15a)];return _0x2294dc;}function mergeFullInherit(_0x37d4c0,_0x5eba30){const _0x1bfaf4=a156_0x285e9f,_0x517759=_0x37d4c0[_0x1bfaf4(0x175)]&&typeof _0x37d4c0[_0x1bfaf4(0x175)]===_0x1bfaf4(0x14f)?_0x37d4c0[_0x1bfaf4(0x175)]:{},_0xc628f0=_0x5eba30['apps']&&typeof _0x5eba30[_0x1bfaf4(0x175)]==='object'?_0x5eba30[_0x1bfaf4(0x175)]:{},_0x56d71e={..._0x517759,..._0xc628f0},_0x496634={..._0x37d4c0,..._0x5eba30};delete _0x496634[_0x1bfaf4(0x177)];if(Object['keys'](_0x56d71e)[_0x1bfaf4(0x161)]>0x0)_0x496634['apps']=_0x56d71e;if(_0x1bfaf4(0x15a)in _0x5eba30)_0x496634[_0x1bfaf4(0x15a)]=_0x5eba30[_0x1bfaf4(0x15a)];else{if(Object[_0x1bfaf4(0x171)](_0xc628f0)[_0x1bfaf4(0x161)]>0x0)_0x496634['defaultApp']=Object['keys'](_0xc628f0)[0x0];else{if(_0x37d4c0[_0x1bfaf4(0x15a)])_0x496634[_0x1bfaf4(0x15a)]=_0x37d4c0['defaultApp'];else{const _0x4b39c0=Object[_0x1bfaf4(0x171)](_0x517759);if(_0x4b39c0[_0x1bfaf4(0x161)]>0x0)_0x496634[_0x1bfaf4(0x15a)]=_0x4b39c0[0x0];}}}return _0x496634;}export function readRawConfigWithLayers(_0x529460){const _0x4637e1=loadRawConfigLayers(_0x529460);return{'config':mergeRawConfigLayers(_0x4637e1),'layers':_0x4637e1};}export function readRawConfig(_0x21761e){return mergeRawConfigLayers(loadRawConfigLayers(_0x21761e));}export function readConfigFile(_0x45229e){const _0x2b975c=a156_0x285e9f;return parseAndNormalizeConfig(_0x45229e,_0x2b975c(0x170));}export function writeConfigFile(_0x43b557,_0x3571cf){const _0x4f7fcc=a156_0x285e9f,_0x5a7aa0=dirname(_0x43b557);!existsSync(_0x5a7aa0)&&mkdirSync(_0x5a7aa0,{'recursive':!![]});const _0x5894b5=_0x43b557+_0x4f7fcc(0x155);try{writeFileSync(_0x5894b5,JSON[_0x4f7fcc(0x15c)](_0x3571cf,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x5894b5,_0x43b557);}catch(_0x4e4a94){try{unlinkSync(_0x5894b5);}catch{}throw _0x4e4a94;}}export function resolveWriteConfigPath(_0x1eb2b7){const _0x4669a4=a156_0x285e9f,_0x4ff3ec=_0x1eb2b7===_0x4669a4(0x179)?process[_0x4669a4(0x158)]():homedir(),_0x2745b4=resolveConfigPath(_0x4ff3ec);return _0x2745b4??resolve(_0x4ff3ec,NEW_CONFIG_NAME);}
1
+ const a155_0x12afe7=a155_0x6f97;(function(_0x45374e,_0x3f2419){const _0x5c0c2e=a155_0x6f97,_0x3594b4=_0x45374e();while(!![]){try{const _0x4af7c8=-parseInt(_0x5c0c2e(0x13d))/0x1+-parseInt(_0x5c0c2e(0x15f))/0x2+-parseInt(_0x5c0c2e(0x144))/0x3*(-parseInt(_0x5c0c2e(0x148))/0x4)+-parseInt(_0x5c0c2e(0x13a))/0x5*(-parseInt(_0x5c0c2e(0x15a))/0x6)+-parseInt(_0x5c0c2e(0x155))/0x7*(-parseInt(_0x5c0c2e(0x14d))/0x8)+-parseInt(_0x5c0c2e(0x162))/0x9*(-parseInt(_0x5c0c2e(0x14e))/0xa)+-parseInt(_0x5c0c2e(0x147))/0xb;if(_0x4af7c8===_0x3f2419)break;else _0x3594b4['push'](_0x3594b4['shift']());}catch(_0x467dea){_0x3594b4['push'](_0x3594b4['shift']());}}}(a155_0x5914,0x23f41));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a155_0x6f97(_0x53789b,_0xb18a40){_0x53789b=_0x53789b-0x133;const _0x5914cf=a155_0x5914();let _0x6f9738=_0x5914cf[_0x53789b];return _0x6f9738;}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_0x12afe7(0x156);export const CONFIG_NAMES=[a155_0x12afe7(0x156),a155_0x12afe7(0x140),a155_0x12afe7(0x13f)];function a155_0x5914(){const _0x4c1d67=['Global','locale','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','32laoAGS','805850YqqRoH','apiDir','accessKey','data','app','string','filter','131453VXuczB','.rabetbase.json','length','.tmp','migrated','438wETvNa','missing','status','defaultApp','utf8','354048rIyrRd','cookie','error','9asibrr','riskLevel','project','cwd','inherit','pageSize','keys','\x0a\x20\x20','stringify','apps','trim','message','18465MxWYhX','Project','config','158921HEOIuV','parse','.lovrabetrc','.lovrabet.json','format','set','env','96mFGCjv','object','appcode','1969440ppjcJu','29620KdKJVL','empty'];a155_0x5914=function(){return _0x4c1d67;};return a155_0x5914();}export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a155_0x12afe7(0x154)](_0xd31d94=>_0xd31d94!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x322f58){for(const _0x12e448 of CONFIG_NAMES){const _0x108974=resolve(_0x322f58,_0x12e448);if(existsSync(_0x108974))return _0x108974;}return undefined;}export function findProjectRootDirectory(_0x190b51=process[a155_0x12afe7(0x165)]()){let _0x1fd8b2=resolve(_0x190b51);const {root:_0x239240}=parse(_0x1fd8b2),_0x214c37=homedir();while(!![]){if(resolveConfigPath(_0x1fd8b2)){if(_0x1fd8b2===_0x214c37)break;return _0x1fd8b2;}if(_0x1fd8b2===_0x239240||_0x1fd8b2===_0x214c37)break;const _0x5b4901=dirname(_0x1fd8b2);if(_0x5b4901===_0x1fd8b2)break;_0x1fd8b2=_0x5b4901;}return resolve(_0x190b51);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x1929c5){const _0x3c5b84=a155_0x12afe7;if(!existsSync(_0x1929c5))return{'status':_0x3c5b84(0x15b)};try{const _0x1887e5=readFileSync(_0x1929c5,{'encoding':_0x3c5b84(0x15e)});if(!_0x1887e5?.['trim']())return{'status':_0x3c5b84(0x149)};const _0x495144=JSON[_0x3c5b84(0x13e)](_0x1887e5);return{'status':'ok','data':_0x495144};}catch(_0x58901d){return{'status':_0x3c5b84(0x161),'message':_0x58901d instanceof Error?_0x58901d[_0x3c5b84(0x139)]:String(_0x58901d)};}}function parseCliConfigJsonFile(_0x17a3d9,_0x1d2cd2,_0x1e9f9d){const _0x4d2c52=a155_0x12afe7,_0x1e4e08=inspectCliConfigJsonFile(_0x17a3d9);if(_0x1e4e08[_0x4d2c52(0x15c)]===_0x4d2c52(0x15b)||_0x1e4e08[_0x4d2c52(0x15c)]===_0x4d2c52(0x149))return{};if(_0x1e4e08[_0x4d2c52(0x15c)]==='ok')return _0x1e4e08[_0x4d2c52(0x151)];return _0x1d2cd2==='warn'&&_0x1e9f9d&&console[_0x4d2c52(0x161)](CLI_BIN_NAME+':\x20'+_0x1e9f9d+_0x4d2c52(0x14c)+_0x17a3d9+_0x4d2c52(0x135)+_0x1e4e08['message']),{};}function normalizeLegacyConfigShape(_0x2ee953){const _0x525a12=a155_0x12afe7;if(!_0x2ee953||typeof _0x2ee953!==_0x525a12(0x145))return{'config':{},'migrated':![]};const _0x5a839f={..._0x2ee953},_0x443d1d=_0x5a839f[_0x525a12(0x137)]&&typeof _0x5a839f[_0x525a12(0x137)]==='object'?{..._0x5a839f[_0x525a12(0x137)]}:{},_0x237b61=Object[_0x525a12(0x134)](_0x443d1d)[_0x525a12(0x157)],_0x5e7885=_0x5a839f['appcode']||_0x5a839f[_0x525a12(0x152)];let _0x508806=![];if(_0x5e7885&&_0x237b61===0x0){const _0x1af8f6=typeof _0x5a839f[_0x525a12(0x15d)]===_0x525a12(0x153)&&_0x5a839f[_0x525a12(0x15d)]['trim']()?_0x5a839f[_0x525a12(0x15d)]:String(_0x5e7885)[_0x525a12(0x138)]();_0x443d1d[_0x1af8f6]={'appcode':String(_0x5e7885)[_0x525a12(0x138)](),..._0x5a839f[_0x525a12(0x143)]!=null?{'env':_0x5a839f[_0x525a12(0x143)]}:{},..._0x5a839f[_0x525a12(0x14f)]!=null?{'apiDir':_0x5a839f[_0x525a12(0x14f)]}:{},..._0x5a839f[_0x525a12(0x160)]!=null?{'cookie':_0x5a839f[_0x525a12(0x160)]}:{},..._0x5a839f[_0x525a12(0x150)]!=null?{'accessKey':_0x5a839f['accessKey']}:{},..._0x5a839f[_0x525a12(0x141)]!=null?{'format':_0x5a839f[_0x525a12(0x141)]}:{},..._0x5a839f['pageSize']!=null?{'pageSize':_0x5a839f[_0x525a12(0x133)]}:{},..._0x5a839f[_0x525a12(0x163)]!=null?{'riskLevel':_0x5a839f['riskLevel']}:{},..._0x5a839f[_0x525a12(0x14b)]!=null?{'locale':_0x5a839f['locale']}:{}},_0x5a839f[_0x525a12(0x137)]=_0x443d1d;if(!_0x5a839f[_0x525a12(0x15d)])_0x5a839f[_0x525a12(0x15d)]=_0x1af8f6;_0x508806=!![];}return(_0x525a12(0x146)in _0x5a839f||'app'in _0x5a839f)&&(delete _0x5a839f[_0x525a12(0x146)],delete _0x5a839f[_0x525a12(0x152)],_0x508806=!![]),{'config':_0x5a839f,'migrated':_0x508806};}function writeNormalizedConfigIfNeeded(_0x5cef95,_0x5b2430){const _0x5b2c35=a155_0x12afe7,_0x5182f6=JSON[_0x5b2c35(0x136)](_0x5b2430,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x5cef95)===_0x5182f6)return;writeConfigFile(_0x5cef95,_0x5b2430),normalizedWriteCache[_0x5b2c35(0x142)](_0x5cef95,_0x5182f6);}function parseAndNormalizeConfig(_0x25b66c,_0x8aff0a,_0x4a1d59){const _0x13653a=a155_0x12afe7,_0x35a08c=parseCliConfigJsonFile(_0x25b66c,_0x8aff0a,_0x4a1d59),_0x6bb9cd=normalizeLegacyConfigShape(_0x35a08c);if(_0x6bb9cd[_0x13653a(0x159)])try{writeNormalizedConfigIfNeeded(_0x25b66c,_0x6bb9cd[_0x13653a(0x13c)]);}catch{}return _0x6bb9cd['config'];}export function loadRawConfigLayers(_0x332a83){const _0x229648=a155_0x12afe7;let _0x18e80e={},_0x389768={};const _0x58fdb5=resolveConfigPath(homedir());_0x58fdb5&&(_0x18e80e=parseAndNormalizeConfig(_0x58fdb5,'warn',_0x229648(0x14a)));const _0x2097dd=_0x332a83??findProjectRootDirectory(),_0x58eea6=resolveConfigPath(_0x2097dd);return _0x58eea6&&(_0x389768=parseAndNormalizeConfig(_0x58eea6,'warn',_0x229648(0x13b))),{'globalPath':_0x58fdb5,'projectPath':_0x58eea6,'globalConfig':_0x18e80e,'projectConfig':_0x389768};}const INHERIT_WHITELIST=[a155_0x12afe7(0x160),'accessKey',a155_0x12afe7(0x14b),'format',a155_0x12afe7(0x163),a155_0x12afe7(0x133)];export function mergeRawConfigLayers(_0x2579d7){const _0xbf4443=a155_0x12afe7,{globalConfig:_0xdc85d1,projectConfig:_0x127d9a}=_0x2579d7,_0x1d6100=Object['keys'](_0x127d9a)[_0xbf4443(0x157)]>0x0;if(!_0x1d6100)return mergeGlobalOnly(_0xdc85d1);if(_0x127d9a[_0xbf4443(0x166)]===!![])return mergeFullInherit(_0xdc85d1,_0x127d9a);if(_0x127d9a['inherit']===![])return mergeIsolated(_0x127d9a);return mergeProjectFirst(_0xdc85d1,_0x127d9a);}function mergeGlobalOnly(_0x365e6d){const _0x52445e=a155_0x12afe7,_0x1099ee={..._0x365e6d},_0x1cf7f7=_0x365e6d[_0x52445e(0x137)]&&typeof _0x365e6d[_0x52445e(0x137)]==='object'?_0x365e6d[_0x52445e(0x137)]:{};if(Object[_0x52445e(0x134)](_0x1cf7f7)[_0x52445e(0x157)]>0x0)_0x1099ee[_0x52445e(0x137)]=_0x1cf7f7;if(_0x365e6d[_0x52445e(0x15d)])_0x1099ee[_0x52445e(0x15d)]=_0x365e6d[_0x52445e(0x15d)];else{const _0x57a3bf=Object[_0x52445e(0x134)](_0x1cf7f7);if(_0x57a3bf[_0x52445e(0x157)]>0x0)_0x1099ee[_0x52445e(0x15d)]=_0x57a3bf[0x0];}return _0x1099ee;}function mergeIsolated(_0x2f5dc8){const _0x5b6edc=a155_0x12afe7,_0x1e41b0={..._0x2f5dc8};delete _0x1e41b0[_0x5b6edc(0x166)];const _0x2c006e=_0x2f5dc8[_0x5b6edc(0x137)]&&typeof _0x2f5dc8[_0x5b6edc(0x137)]===_0x5b6edc(0x145)?_0x2f5dc8[_0x5b6edc(0x137)]:{};Object[_0x5b6edc(0x134)](_0x2c006e)['length']>0x0?_0x1e41b0[_0x5b6edc(0x137)]=_0x2c006e:delete _0x1e41b0[_0x5b6edc(0x137)];if(_0x5b6edc(0x15d)in _0x2f5dc8)_0x1e41b0[_0x5b6edc(0x15d)]=_0x2f5dc8['defaultApp'];else Object['keys'](_0x2c006e)['length']>0x0?_0x1e41b0['defaultApp']=Object[_0x5b6edc(0x134)](_0x2c006e)[0x0]:delete _0x1e41b0[_0x5b6edc(0x15d)];return _0x1e41b0;}function mergeProjectFirst(_0x2fd6f8,_0x467b43){const _0x2eefe3=a155_0x12afe7,_0x143045={..._0x467b43};delete _0x143045['inherit'];for(const _0x26ad80 of INHERIT_WHITELIST){!(_0x26ad80 in _0x143045)&&_0x26ad80 in _0x2fd6f8&&(_0x143045[_0x26ad80]=_0x2fd6f8[_0x26ad80]);}const _0x46321c=_0x467b43['apps']&&typeof _0x467b43[_0x2eefe3(0x137)]===_0x2eefe3(0x145)?_0x467b43[_0x2eefe3(0x137)]:{};Object[_0x2eefe3(0x134)](_0x46321c)[_0x2eefe3(0x157)]>0x0?_0x143045['apps']=_0x46321c:delete _0x143045[_0x2eefe3(0x137)];if(_0x2eefe3(0x15d)in _0x467b43)_0x143045[_0x2eefe3(0x15d)]=_0x467b43['defaultApp'];else Object[_0x2eefe3(0x134)](_0x46321c)['length']>0x0?_0x143045['defaultApp']=Object[_0x2eefe3(0x134)](_0x46321c)[0x0]:delete _0x143045[_0x2eefe3(0x15d)];return _0x143045;}function mergeFullInherit(_0x58405e,_0x3f9b23){const _0x7b60b1=a155_0x12afe7,_0x34fd00=_0x58405e[_0x7b60b1(0x137)]&&typeof _0x58405e[_0x7b60b1(0x137)]===_0x7b60b1(0x145)?_0x58405e['apps']:{},_0x13f58=_0x3f9b23[_0x7b60b1(0x137)]&&typeof _0x3f9b23[_0x7b60b1(0x137)]===_0x7b60b1(0x145)?_0x3f9b23[_0x7b60b1(0x137)]:{},_0x28b051={..._0x34fd00,..._0x13f58},_0x5157e3={..._0x58405e,..._0x3f9b23};delete _0x5157e3['inherit'];if(Object[_0x7b60b1(0x134)](_0x28b051)[_0x7b60b1(0x157)]>0x0)_0x5157e3[_0x7b60b1(0x137)]=_0x28b051;if('defaultApp'in _0x3f9b23)_0x5157e3['defaultApp']=_0x3f9b23[_0x7b60b1(0x15d)];else{if(Object['keys'](_0x13f58)[_0x7b60b1(0x157)]>0x0)_0x5157e3[_0x7b60b1(0x15d)]=Object['keys'](_0x13f58)[0x0];else{if(_0x58405e['defaultApp'])_0x5157e3['defaultApp']=_0x58405e[_0x7b60b1(0x15d)];else{const _0x4d0079=Object[_0x7b60b1(0x134)](_0x34fd00);if(_0x4d0079['length']>0x0)_0x5157e3[_0x7b60b1(0x15d)]=_0x4d0079[0x0];}}}return _0x5157e3;}export function readRawConfigWithLayers(_0x1f566c){const _0x5afb72=loadRawConfigLayers(_0x1f566c);return{'config':mergeRawConfigLayers(_0x5afb72),'layers':_0x5afb72};}export function readRawConfig(_0x11f075){return mergeRawConfigLayers(loadRawConfigLayers(_0x11f075));}export function readConfigFile(_0x1167a7){return parseAndNormalizeConfig(_0x1167a7,'silent');}export function writeConfigFile(_0x3a5767,_0x45e6d8){const _0x39fec6=a155_0x12afe7,_0x18711a=dirname(_0x3a5767);!existsSync(_0x18711a)&&mkdirSync(_0x18711a,{'recursive':!![]});const _0x4e9cc0=_0x3a5767+_0x39fec6(0x158);try{writeFileSync(_0x4e9cc0,JSON[_0x39fec6(0x136)](_0x45e6d8,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x4e9cc0,_0x3a5767);}catch(_0x2ccb03){try{unlinkSync(_0x4e9cc0);}catch{}throw _0x2ccb03;}}export function resolveWriteConfigPath(_0xb772cd){const _0x6ffeaf=a155_0x12afe7,_0x1d0a83=_0xb772cd===_0x6ffeaf(0x164)?process['cwd']():homedir(),_0x2d6c2b=resolveConfigPath(_0x1d0a83);return _0x2d6c2b??resolve(_0x1d0a83,NEW_CONFIG_NAME);}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- function a157_0x2ebe(_0x533422,_0xb01b34){_0x533422=_0x533422-0xbb;const _0x448c71=a157_0x448c();let _0x2ebecb=_0x448c71[_0x533422];return _0x2ebecb;}function a157_0x448c(){const _0x35f544=['string','5964ljTqZm','object','apiDir','225LhEnla','apps','100DPzdzg','api.ts','10XSoZOk','setRawCommand','cwd','20858qIAQbn','env','defaultApp','48068YEnIQh','appcode','132282wWwJHm','14AWVOXW','template_base_url','entries','merged','slice','trim','length','runtimeDomain','57kOHwqQ','globalConfig','keys','10442740LQExVo','7129768GvomLm','argv','userDomain','10595ZxsHoO','./constant/env.js','setLogPath','16775568ahjvUl','projectConfig','join','apiDomain','map','./utils/is-non-interactive.js','app','filter'];a157_0x448c=function(){return _0x35f544;};return a157_0x448c();}(function(_0x8cb83f,_0x1d3125){const _0x1857ed=a157_0x2ebe,_0x3d6ddb=_0x8cb83f();while(!![]){try{const _0x39a43b=parseInt(_0x1857ed(0xc7))/0x1*(-parseInt(_0x1857ed(0xc2))/0x2)+parseInt(_0x1857ed(0xd5))/0x3*(-parseInt(_0x1857ed(0xca))/0x4)+-parseInt(_0x1857ed(0xc0))/0x5*(-parseInt(_0x1857ed(0xcc))/0x6)+-parseInt(_0x1857ed(0xcd))/0x7*(-parseInt(_0x1857ed(0xd9))/0x8)+-parseInt(_0x1857ed(0xdf))/0x9+parseInt(_0x1857ed(0xc4))/0xa*(parseInt(_0x1857ed(0xd8))/0xb)+-parseInt(_0x1857ed(0xbd))/0xc*(-parseInt(_0x1857ed(0xdc))/0xd);if(_0x39a43b===_0x1d3125)break;else _0x3d6ddb['push'](_0x3d6ddb['shift']());}catch(_0x35cf7e){_0x3d6ddb['push'](_0x3d6ddb['shift']());}}}(a157_0x448c,0xf29f1));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(_0xa363ef){return process.env[`RABETBASE_${_0xa363ef}`]||process.env[`LOVRABET_${_0xa363ef}`]||undefined;}export async function createContext(_0x481aad){const _0x2e2035=a157_0x2ebe,{config:_0x2d2ef8,layers:_0x1e8a1e}=readRawConfigWithLayers(),_0x481a64=buildConfig(_0x2d2ef8,_0x481aad,_0x1e8a1e),{initEnv:_0x42ba08}=await import(_0x2e2035(0xdd));if(_0x481a64[_0x2e2035(0xc8)])_0x42ba08(_0x481a64[_0x2e2035(0xc8)]);else _0x481aad[_0x2e2035(0xc8)]&&typeof _0x481aad['env']===_0x2e2035(0xbc)&&_0x42ba08(_0x481aad[_0x2e2035(0xc8)]);const {initDomains:_0x22951f,getUserDomain:_0x319f5c,getApiDomain:_0x2ccf41}=await import('./constant/domain.js');_0x22951f({'apiDomain':_0x2d2ef8[_0x2e2035(0xe2)]||undefined,'userDomain':_0x2d2ef8[_0x2e2035(0xdb)]||undefined,'runtimeDomain':_0x2d2ef8[_0x2e2035(0xd4)]||undefined});const _0x25ad0a={'apiDomain':_0x2ccf41(),'userDomain':_0x319f5c()},_0x58224c=await buildAuth(_0x481a64);logger[_0x2e2035(0xde)](process[_0x2e2035(0xc6)]());const _0x18eac2=(CLI_BIN_NAME+'\x20'+process[_0x2e2035(0xda)][_0x2e2035(0xd1)](0x2)[_0x2e2035(0xe1)]('\x20'))[_0x2e2035(0xd2)]();logger[_0x2e2035(0xc5)](_0x18eac2);const {isNonInteractive:_0x42f6b0}=await import(_0x2e2035(0xe4)),_0x3e3028=_0x42f6b0(_0x481aad);return{'config':_0x481a64,'auth':_0x58224c,'logger':logger,'env':_0x25ad0a,'nonInteractive':_0x3e3028};}export function buildConfigFromFlags(_0x344b84){const {config:_0x36cb8c,layers:_0x17c04c}=readRawConfigWithLayers();return buildConfig(_0x36cb8c,_0x344b84,_0x17c04c);}export function getConfigAppCode(_0x467f4){const _0x329b0c=a157_0x2ebe,_0x24c222=readRawConfig(_0x467f4);if(_0x24c222[_0x329b0c(0xc1)]&&typeof _0x24c222[_0x329b0c(0xc1)]==='object'){const _0x4a434d=_0x24c222[_0x329b0c(0xc9)];if(_0x4a434d&&_0x24c222['apps'][_0x4a434d]?.[_0x329b0c(0xcb)])return String(_0x24c222['apps'][_0x4a434d][_0x329b0c(0xcb)])['trim']();const _0x5c21a2=Object['values'](_0x24c222[_0x329b0c(0xc1)])[0x0];if(_0x5c21a2?.[_0x329b0c(0xcb)])return String(_0x5c21a2[_0x329b0c(0xcb)])[_0x329b0c(0xd2)]();}const _0x2bef58=_0x24c222[_0x329b0c(0xcb)]||_0x24c222[_0x329b0c(0xe5)];if(typeof _0x2bef58!==_0x329b0c(0xbc)||_0x2bef58[_0x329b0c(0xd2)]()==='')return undefined;return _0x2bef58[_0x329b0c(0xd2)]();}export function getMultiAppConfigs(_0x324812='project',_0x1a2983){const _0x23923c=a157_0x2ebe,_0x3a6dca=loadRawConfigLayers(_0x1a2983);let _0xca0c23,_0x29bd1b;if(_0x324812===_0x23923c(0xd0)){const _0x915727=_0x3a6dca[_0x23923c(0xd6)][_0x23923c(0xc1)]&&typeof _0x3a6dca[_0x23923c(0xd6)][_0x23923c(0xc1)]==='object'?_0x3a6dca[_0x23923c(0xd6)][_0x23923c(0xc1)]:{},_0x3e1f43=_0x3a6dca['projectConfig'][_0x23923c(0xc1)]&&typeof _0x3a6dca[_0x23923c(0xe0)][_0x23923c(0xc1)]==='object'?_0x3a6dca['projectConfig']['apps']:{};_0xca0c23={..._0x915727,..._0x3e1f43};const _0xdd5d24=readRawConfig(_0x1a2983);_0x29bd1b=_0xdd5d24[_0x23923c(0xc9)];}else _0xca0c23=_0x3a6dca[_0x23923c(0xe0)][_0x23923c(0xc1)],_0x29bd1b=_0x3a6dca[_0x23923c(0xe0)]['defaultApp'];if(!_0xca0c23||typeof _0xca0c23!==_0x23923c(0xbe)||Object[_0x23923c(0xd7)](_0xca0c23)[_0x23923c(0xd3)]===0x0)return null;return Object[_0x23923c(0xcf)](_0xca0c23)[_0x23923c(0xe3)](([_0x3e9436,_0x2c4f0f])=>({'name':_0x3e9436,'appcode':_0x2c4f0f?.[_0x23923c(0xcb)]||'','isDefault':_0x3e9436===_0x29bd1b,'env':_0x2c4f0f?.[_0x23923c(0xc8)],'apiDir':_0x2c4f0f?.['apiDir'],'cookie':_0x2c4f0f?.['cookie']||undefined}))[_0x23923c(0xbb)](_0x125502=>_0x125502[_0x23923c(0xcb)]);}export function getTemplateBaseUrl(_0x228316){const _0xe80c83=a157_0x2ebe,_0x1f9b33=readRawConfig(_0x228316);if(_0x1f9b33['template_base_url']&&typeof _0x1f9b33[_0xe80c83(0xce)]==='string')return _0x1f9b33[_0xe80c83(0xce)]['replace'](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}function buildConfig(_0x587972,_0x4d40e9,_0x1f6066){return{...resolveAppConfig({'raw':_0x587972,'flags':_0x4d40e9,'layers':_0x1f6066,'readEnv':env}),'raw':_0x587972};}export function resolveApiFilePath(_0x451d18,_0xcea757){const _0x1be7c7=a157_0x2ebe,_0x2630d5=resolve(process[_0x1be7c7(0xc6)](),_0x451d18),_0x14bfcc=resolve(_0x2630d5,_0x1be7c7(0xc3));if(!_0xcea757)return _0x14bfcc;const _0x21f347=readRawConfig(),_0x501490=_0x21f347[_0x1be7c7(0xc1)]&&typeof _0x21f347['apps']===_0x1be7c7(0xbe)?_0x21f347[_0x1be7c7(0xc1)]:{},_0x31b76f=Object[_0x1be7c7(0xcf)](_0x501490)['find'](([,_0x5c69d4])=>_0x5c69d4?.[_0x1be7c7(0xcb)]===_0xcea757);if(!_0x31b76f)return _0x14bfcc;const [_0x45ffd1,_0x20a225]=_0x31b76f,_0x47deb2=typeof _0x21f347[_0x1be7c7(0xc9)]===_0x1be7c7(0xbc)?_0x21f347[_0x1be7c7(0xc9)]:undefined;if(_0x20a225?.[_0x1be7c7(0xbf)])return _0x14bfcc;if(_0x47deb2&&_0x45ffd1!==_0x47deb2)return resolve(_0x2630d5,_0x45ffd1+'-api.ts');return _0x14bfcc;}
1
+ (function(_0x35fdb6,_0x51b8ed){const _0x52254e=a156_0x5a02,_0x60c312=_0x35fdb6();while(!![]){try{const _0x2434fa=parseInt(_0x52254e(0x12a))/0x1+-parseInt(_0x52254e(0x131))/0x2+parseInt(_0x52254e(0x121))/0x3+-parseInt(_0x52254e(0x12c))/0x4*(-parseInt(_0x52254e(0x115))/0x5)+-parseInt(_0x52254e(0x113))/0x6*(parseInt(_0x52254e(0x124))/0x7)+parseInt(_0x52254e(0x136))/0x8+parseInt(_0x52254e(0x111))/0x9*(parseInt(_0x52254e(0x128))/0xa);if(_0x2434fa===_0x51b8ed)break;else _0x60c312['push'](_0x60c312['shift']());}catch(_0x48f11e){_0x60c312['push'](_0x60c312['shift']());}}}(a156_0x5f00,0xbfc68));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';function a156_0x5a02(_0x3eaafb,_0x397457){_0x3eaafb=_0x3eaafb-0x110;const _0x5f0094=a156_0x5f00();let _0x5a0230=_0x5f0094[_0x3eaafb];return _0x5a0230;}import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x4d164d){return process.env[`RABETBASE_${_0x4d164d}`]||process.env[`LOVRABET_${_0x4d164d}`]||undefined;}export async function createContext(_0x57231c){const _0x3f1f1a=a156_0x5a02,{config:_0x5426b2,layers:_0x5ea017}=readRawConfigWithLayers(),_0x433d2d=buildConfig(_0x5426b2,_0x57231c,_0x5ea017),{initEnv:_0x2fc693}=await import('./constant/env.js');if(_0x433d2d[_0x3f1f1a(0x134)])_0x2fc693(_0x433d2d['env']);else _0x57231c[_0x3f1f1a(0x134)]&&typeof _0x57231c[_0x3f1f1a(0x134)]===_0x3f1f1a(0x116)&&_0x2fc693(_0x57231c[_0x3f1f1a(0x134)]);const {initDomains:_0x4a2208,getUserDomain:_0x1bc906,getApiDomain:_0x421a33}=await import(_0x3f1f1a(0x126));_0x4a2208({'apiDomain':_0x5426b2[_0x3f1f1a(0x12d)]||undefined,'userDomain':_0x5426b2[_0x3f1f1a(0x11f)]||undefined,'runtimeDomain':_0x5426b2[_0x3f1f1a(0x130)]||undefined});const _0x107ff1={'apiDomain':_0x421a33(),'userDomain':_0x1bc906()},_0x49993c=await buildAuth(_0x433d2d);logger['setLogPath'](process[_0x3f1f1a(0x133)]());const _0x164ccc=(CLI_BIN_NAME+'\x20'+process['argv'][_0x3f1f1a(0x119)](0x2)[_0x3f1f1a(0x129)]('\x20'))[_0x3f1f1a(0x12e)]();logger[_0x3f1f1a(0x139)](_0x164ccc);const {isNonInteractive:_0x50a4ff}=await import(_0x3f1f1a(0x118)),_0x505e4e=_0x50a4ff(_0x57231c);return{'config':_0x433d2d,'auth':_0x49993c,'logger':logger,'env':_0x107ff1,'nonInteractive':_0x505e4e};}export function buildConfigFromFlags(_0x3a4d04){const {config:_0x35ceb7,layers:_0x79af7d}=readRawConfigWithLayers();return buildConfig(_0x35ceb7,_0x3a4d04,_0x79af7d);}export function getConfigAppCode(_0x392021){const _0x8ce9ba=a156_0x5a02,_0x5d8201=readRawConfig(_0x392021);if(_0x5d8201[_0x8ce9ba(0x114)]&&typeof _0x5d8201[_0x8ce9ba(0x114)]===_0x8ce9ba(0x123)){const _0x5bdf27=_0x5d8201[_0x8ce9ba(0x112)];if(_0x5bdf27&&_0x5d8201[_0x8ce9ba(0x114)][_0x5bdf27]?.[_0x8ce9ba(0x138)])return String(_0x5d8201[_0x8ce9ba(0x114)][_0x5bdf27]['appcode'])[_0x8ce9ba(0x12e)]();const _0x37a449=Object['values'](_0x5d8201[_0x8ce9ba(0x114)])[0x0];if(_0x37a449?.['appcode'])return String(_0x37a449['appcode'])[_0x8ce9ba(0x12e)]();}const _0x1a852b=_0x5d8201['appcode']||_0x5d8201['app'];if(typeof _0x1a852b!==_0x8ce9ba(0x116)||_0x1a852b['trim']()==='')return undefined;return _0x1a852b['trim']();}export function getMultiAppConfigs(_0x2b8b55='project',_0x5142ea){const _0x2035c3=a156_0x5a02,_0x52b188=loadRawConfigLayers(_0x5142ea);let _0x852de,_0x18c237;if(_0x2b8b55===_0x2035c3(0x120)){const _0x2d1f5b=_0x52b188[_0x2035c3(0x11b)][_0x2035c3(0x114)]&&typeof _0x52b188[_0x2035c3(0x11b)]['apps']===_0x2035c3(0x123)?_0x52b188[_0x2035c3(0x11b)][_0x2035c3(0x114)]:{},_0x15b41e=_0x52b188[_0x2035c3(0x11a)][_0x2035c3(0x114)]&&typeof _0x52b188['projectConfig'][_0x2035c3(0x114)]==='object'?_0x52b188[_0x2035c3(0x11a)]['apps']:{};_0x852de={..._0x2d1f5b,..._0x15b41e};const _0x45bf2b=readRawConfig(_0x5142ea);_0x18c237=_0x45bf2b[_0x2035c3(0x112)];}else _0x852de=_0x52b188[_0x2035c3(0x11a)][_0x2035c3(0x114)],_0x18c237=_0x52b188[_0x2035c3(0x11a)]['defaultApp'];if(!_0x852de||typeof _0x852de!==_0x2035c3(0x123)||Object[_0x2035c3(0x110)](_0x852de)[_0x2035c3(0x122)]===0x0)return null;return Object['entries'](_0x852de)[_0x2035c3(0x127)](([_0x4ca897,_0x57f522])=>({'name':_0x4ca897,'appcode':_0x57f522?.['appcode']||'','isDefault':_0x4ca897===_0x18c237,'env':_0x57f522?.[_0x2035c3(0x134)],'apiDir':_0x57f522?.[_0x2035c3(0x12b)],'cookie':_0x57f522?.[_0x2035c3(0x125)]||undefined}))[_0x2035c3(0x137)](_0x405858=>_0x405858[_0x2035c3(0x138)]);}export function getTemplateBaseUrl(_0x30b931){const _0x52d0ff=a156_0x5a02,_0x25afb6=readRawConfig(_0x30b931);if(_0x25afb6['template_base_url']&&typeof _0x25afb6['template_base_url']===_0x52d0ff(0x116))return _0x25afb6[_0x52d0ff(0x11d)][_0x52d0ff(0x135)](/\/$/,'');return _0x52d0ff(0x12f);}function a156_0x5f00(){const _0x51af4a=['appcode','setRawCommand','keys','75267ATjZJW','defaultApp','138mpJBAm','apps','505YFllYu','string','-api.ts','./utils/is-non-interactive.js','slice','projectConfig','globalConfig','find','template_base_url','api.ts','userDomain','merged','2961840XqhSlL','length','object','251461YlyLTN','cookie','./constant/domain.js','map','670wgwHYw','join','207166yQYFLd','apiDir','10548wvXIzb','apiDomain','trim','https://g.lovrabet.com/dist/lovrabet-skill','runtimeDomain','1526776hrbATg','entries','cwd','env','replace','2832200AKWoul','filter'];a156_0x5f00=function(){return _0x51af4a;};return a156_0x5f00();}function buildConfig(_0xafccab,_0x369f3f,_0x789567){return{...resolveAppConfig({'raw':_0xafccab,'flags':_0x369f3f,'layers':_0x789567,'readEnv':env}),'raw':_0xafccab};}export function resolveApiFilePath(_0x2c89e4,_0x2167df){const _0x23275a=a156_0x5a02,_0x5417a7=resolve(process[_0x23275a(0x133)](),_0x2c89e4),_0x2f179f=resolve(_0x5417a7,_0x23275a(0x11e));if(!_0x2167df)return _0x2f179f;const _0x2ab88b=readRawConfig(),_0x3eab08=_0x2ab88b[_0x23275a(0x114)]&&typeof _0x2ab88b[_0x23275a(0x114)]===_0x23275a(0x123)?_0x2ab88b['apps']:{},_0x3e9d01=Object[_0x23275a(0x132)](_0x3eab08)[_0x23275a(0x11c)](([,_0x108db9])=>_0x108db9?.[_0x23275a(0x138)]===_0x2167df);if(!_0x3e9d01)return _0x2f179f;const [_0x12fd02,_0x19c951]=_0x3e9d01,_0x18b183=typeof _0x2ab88b[_0x23275a(0x112)]===_0x23275a(0x116)?_0x2ab88b['defaultApp']:undefined;if(_0x19c951?.[_0x23275a(0x12b)])return _0x2f179f;if(_0x18b183&&_0x12fd02!==_0x18b183)return resolve(_0x5417a7,_0x12fd02+_0x23275a(0x117));return _0x2f179f;}
@@ -1 +1 @@
1
- function a158_0x5cf3(_0x497123,_0x348bf0){_0x497123=_0x497123-0x16e;const _0x44f2cd=a158_0x44f2();let _0x5cf30d=_0x44f2cd[_0x497123];return _0x5cf30d;}(function(_0x2a49e9,_0x46c1ba){const _0x2c90c3=a158_0x5cf3,_0x5cf142=_0x2a49e9();while(!![]){try{const _0x2c7985=parseInt(_0x2c90c3(0x177))/0x1+parseInt(_0x2c90c3(0x173))/0x2*(parseInt(_0x2c90c3(0x17a))/0x3)+parseInt(_0x2c90c3(0x178))/0x4*(parseInt(_0x2c90c3(0x171))/0x5)+-parseInt(_0x2c90c3(0x176))/0x6+-parseInt(_0x2c90c3(0x172))/0x7+-parseInt(_0x2c90c3(0x175))/0x8+parseInt(_0x2c90c3(0x17d))/0x9*(-parseInt(_0x2c90c3(0x170))/0xa);if(_0x2c7985===_0x46c1ba)break;else _0x5cf142['push'](_0x5cf142['shift']());}catch(_0x5a3b64){_0x5cf142['push'](_0x5cf142['shift']());}}}(a158_0x44f2,0xd3665));function a158_0x44f2(){const _0x5c41fc=['push','4248900NANCAQ','exec','set','6336243prAwfD','cwd','api.ts','has','alias','10bmVHRF','10FbJtQm','8204518ERpToR','2KjyViS','datasetCode','1779632DTuRPL','1079430HRsecV','1568897JWSMPN','318312EstJEH'];a158_0x44f2=function(){return _0x5c41fc;};return a158_0x44f2();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x117f4b){const _0x19bd87=a158_0x5cf3,_0x52d02c=[],_0x5503c0=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x19bab3;while((_0x19bab3=_0x5503c0[_0x19bd87(0x17b)](_0x117f4b))!==null){_0x52d02c[_0x19bd87(0x179)]({'datasetCode':_0x19bab3[0x1],'tableName':_0x19bab3[0x2],'name':_0x19bab3[0x3],'alias':_0x19bab3[0x4]});}return _0x52d02c;}export function loadAliasMap(_0x3483bd,_0x3be2c6,_0x2afe73){const _0x30d242=a158_0x5cf3,_0x232e00=_0x2afe73??resolve(process[_0x30d242(0x17e)](),_0x3483bd,_0x30d242(0x17f));if(cache[_0x30d242(0x16e)](_0x232e00))return cache['get'](_0x232e00);if(!existsSync(_0x232e00))return cache[_0x30d242(0x17c)](_0x232e00,[]),[];try{const _0x595d46=readFileSync(_0x232e00,'utf-8'),_0x5e9c97=parseApiFile(_0x595d46);return cache[_0x30d242(0x17c)](_0x232e00,_0x5e9c97),_0x5e9c97;}catch{return cache[_0x30d242(0x17c)](_0x232e00,[]),[];}}export function resolveAlias(_0xef8095,_0x31d2d6,_0x4aa446,_0x255c86){const _0xbf4c36=a158_0x5cf3;if(!_0x31d2d6)return undefined;const _0x51962b=loadAliasMap(_0xef8095,_0x4aa446,_0x255c86),_0x3982d1=_0x51962b['find'](_0x37fd2c=>_0x37fd2c[_0xbf4c36(0x16f)]===_0x31d2d6);return _0x3982d1?.[_0xbf4c36(0x174)];}export function listAliases(_0x26b298,_0x3a62d8,_0xe142f1){return loadAliasMap(_0x26b298,_0x3a62d8,_0xe142f1);}
1
+ function a157_0x3a00(_0x21019b,_0x565401){_0x21019b=_0x21019b-0x64;const _0x1170dd=a157_0x1170();let _0x3a00f2=_0x1170dd[_0x21019b];return _0x3a00f2;}(function(_0x5ecdbd,_0x19ad40){const _0x12e149=a157_0x3a00,_0x240c2b=_0x5ecdbd();while(!![]){try{const _0x29434a=-parseInt(_0x12e149(0x6d))/0x1+-parseInt(_0x12e149(0x67))/0x2*(-parseInt(_0x12e149(0x74))/0x3)+-parseInt(_0x12e149(0x68))/0x4+-parseInt(_0x12e149(0x66))/0x5*(-parseInt(_0x12e149(0x72))/0x6)+-parseInt(_0x12e149(0x6e))/0x7+parseInt(_0x12e149(0x69))/0x8*(parseInt(_0x12e149(0x6a))/0x9)+parseInt(_0x12e149(0x64))/0xa;if(_0x29434a===_0x19ad40)break;else _0x240c2b['push'](_0x240c2b['shift']());}catch(_0x1b7570){_0x240c2b['push'](_0x240c2b['shift']());}}}(a157_0x1170,0x47592));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a157_0x1170(){const _0xf76b99=['140142jowPTt','exec','1239UkJzyQ','5527930BXXDUx','datasetCode','25UwVgsj','918nKReVu','13048HGavCg','669544hMhGfW','9fjDyhM','set','cwd','561520OJaDTZ','600698inbzrg','get','has','push'];a157_0x1170=function(){return _0xf76b99;};return a157_0x1170();}function parseApiFile(_0x3507ac){const _0x5da44e=a157_0x3a00,_0x49a54d=[],_0x22fbc0=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x545fb5;while((_0x545fb5=_0x22fbc0[_0x5da44e(0x73)](_0x3507ac))!==null){_0x49a54d[_0x5da44e(0x71)]({'datasetCode':_0x545fb5[0x1],'tableName':_0x545fb5[0x2],'name':_0x545fb5[0x3],'alias':_0x545fb5[0x4]});}return _0x49a54d;}export function loadAliasMap(_0xd8f648,_0x11fe1d,_0x20aff6){const _0x11e90b=a157_0x3a00,_0xe0bcca=_0x20aff6??resolve(process[_0x11e90b(0x6c)](),_0xd8f648,'api.ts');if(cache[_0x11e90b(0x70)](_0xe0bcca))return cache[_0x11e90b(0x6f)](_0xe0bcca);if(!existsSync(_0xe0bcca))return cache['set'](_0xe0bcca,[]),[];try{const _0x59ed95=readFileSync(_0xe0bcca,'utf-8'),_0x2e7eab=parseApiFile(_0x59ed95);return cache[_0x11e90b(0x6b)](_0xe0bcca,_0x2e7eab),_0x2e7eab;}catch{return cache['set'](_0xe0bcca,[]),[];}}export function resolveAlias(_0x5e2467,_0xf17ea4,_0x4ae5b3,_0x34d75c){const _0xe55764=a157_0x3a00;if(!_0xf17ea4)return undefined;const _0x10a445=loadAliasMap(_0x5e2467,_0x4ae5b3,_0x34d75c),_0x44f718=_0x10a445['find'](_0x5407d8=>_0x5407d8['alias']===_0xf17ea4);return _0x44f718?.[_0xe55764(0x65)];}export function listAliases(_0x46cd16,_0x5e6479,_0x68b295){return loadAliasMap(_0x46cd16,_0x5e6479,_0x68b295);}
@@ -1 +1 @@
1
- (function(_0x595820,_0x53cc9f){const _0x2b8cb9=a159_0x29a9,_0x255a46=_0x595820();while(!![]){try{const _0x46a8a0=-parseInt(_0x2b8cb9(0xf5))/0x1+-parseInt(_0x2b8cb9(0x86))/0x2+-parseInt(_0x2b8cb9(0xbf))/0x3+parseInt(_0x2b8cb9(0xae))/0x4+parseInt(_0x2b8cb9(0x102))/0x5+parseInt(_0x2b8cb9(0x116))/0x6+parseInt(_0x2b8cb9(0x84))/0x7*(parseInt(_0x2b8cb9(0xe2))/0x8);if(_0x46a8a0===_0x53cc9f)break;else _0x255a46['push'](_0x255a46['shift']());}catch(_0x481ff8){_0x255a46['push'](_0x255a46['shift']());}}}(a159_0x382b,0x60a5f));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(_0x5fba35){_activeCookie=_0x5fba35||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function a159_0x382b(){const _0x129265=['.remove(id);','type','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','tableName','replace','getOne','length','cli:rabetbase','list','data','enabled','/api/','toString','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','Operation\x20\x22','/smartapi/custom/updateUserCustomSql','api_error','includes','scriptName','path','\x20\x20pageSize:\x2020,','const\x20result\x20=\x20await\x20client.models.','description','sdk','clientOperationId','set','push','object','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','body','/smartapi/dblink/create','/api/management/library/scripts/info?id=','719512bVmEGS','.filter({','//\x20','tags','add','API\x20error\x20code:\x20','summary','AbortError','\x20apps.\x20','error','/smartapi/app-config/getByKey','includeImports','/smartapi/app-config/delete','table','//\x20SQL:\x20','responseFields','/smartapi/dblink/delete','/smartapi/dblink/testConnect','dbId','218090Hpcrfk','/smartapi/app-config/list','code','/smartapi/dataset/get-driven-data?','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/db-analysis/start','/smartapi/question/er-config/business-group/edit','/smartapi/question/er-config/erCreate','modelCode','401','Page\x20not\x20found:\x20','/smartapi/lovrabet/dataset/','\x20\x20return\x20rows;','245825VjAGMo','/smartapi/dataset/update-driven-data','version','\x20of\x20','application/json','success','datasetTableCount','/api/management/library/scripts/save','target','dbtableConfig','pageSize','/api/management/library/scripts/statistics?appCode=','warn','SQL\x20query\x20not\x20found:\x20','/smartapi/lovrabet/detail?pageId=','errorMessage','/smartapi/dblink/getAllTableList','status','Unauthorized','planId','4641612ieSxAK','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/dblink/getList','const\x20data\x20=\x20await\x20client.sql.execute({','operationId','entries','/smartapi/dataset/text-generate/status?','\x20failed,\x20HTTP\x20','currentPage','/smartapi/app-config/create','/api/management/library/scripts/list?appCode=','appCode','GET','/standard-page-status?appCode=','signal','validation','modelId','\x20\x20sqlCode:\x20\x27','/smartapi/dataset/get-dataset-list','json','Request\x20timeout:\x20','/smartapi/dblink/update','isArray','filter','apiError','BFF\x20script\x20not\x20found:\x20id=','.create({\x20/*\x20fields\x20*/\x20});','has','Request\x20failed:\x20','requirementDescription','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','abort','?sqlCode=','/smartapi/dataset/text-generate/preview','sqlName','find','functionName','value','/sync-to-pages','7MGCFPA','tableList','750504YMZHiU','});','displayName','label','/smartapi/custom/queryUserCustomSqlList','/smartapi/db-analysis/jobs/cancel','/api/custom/executeSql','key','errorCode','/generate-standard-pages/start','test','.getOne(id);','operations','/smartapi/custom/getUserCustomSql?id=','POST','/smartapi/custom/deleteUserCustomSql','Dataset\x20not\x20found:\x20','errorMsg','scriptType','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','toLowerCase','/smartapi/lovrabet/update-page','/smartapi/question/er-config/update-single','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','sqlCode','tableData','/smartapi/dblink/getTableDiffV2ByPage','/smartapi/dblink/getOne','/filter','operationName','/smartapi/dataset/text-generate/start','join','stringify','name','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','\x20failed','cookie','/api/management/library/scripts/delete','datasetName','\x22\x20not\x20found\x20in\x20dataset\x20','1729136fJsSjh','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','&type=','/smartapi/dataset/get-dataset-operation','map','message','/smartapi/dataset/restore-dataset','requestFields','totalCount','/smartapi/app/getList','/generate-standard-pages/status?','method','\x20\x20currentPage:\x201,','deleted','delete','\x20\x20});','string','1067331pRaiuv','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/app-config/update'];a159_0x382b=function(){return _0x129265;};return a159_0x382b();}function a159_0x29a9(_0x5dd3db,_0x3cd2e3){_0x5dd3db=_0x5dd3db-0x6e;const _0x382b72=a159_0x382b();let _0x29a9fd=_0x382b72[_0x5dd3db];return _0x29a9fd;}function createFetchFailureError(_0x4f0c7b,_0x3b23fe){const _0x46bcb3=a159_0x29a9,_0x51225c=_0x3b23fe instanceof Error?_0x3b23fe[_0x46bcb3(0xb3)]:String(_0x3b23fe);return CliErrors['apiError'](_0x46bcb3(0x79)+_0x4f0c7b+(_0x51225c?'\x20('+_0x51225c+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x5bf720,_0x4a3a0={}){const _0x18b7ca=a159_0x29a9,{method:method=_0x18b7ca(0x122),body:_0x10e694,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4a3a0,_0x4e235f=useRuntime?getRuntimeDomain():getApiDomain(),_0x18f52e=_activeCookie||getCookie(),_0x8ed02c=''+_0x4e235f+_0x5bf720,_0x501fbc=new AbortController(),_0x5bf9b7=setTimeout(()=>_0x501fbc[_0x18b7ca(0x7c)](),timeout);try{const _0x95a0b9=await fetch(_0x8ed02c,{'method':method,'headers':{'Content-Type':_0x18b7ca(0x106),'Cookie':_0x18f52e,'X-Invoke-Source':_0x18b7ca(0xc9),...headers},'body':_0x10e694?JSON[_0x18b7ca(0xa6)](_0x10e694):undefined,'signal':_0x501fbc[_0x18b7ca(0x124)]});let _0x59adda;try{_0x59adda=await _0x95a0b9[_0x18b7ca(0x70)]();}catch(_0x415f23){if(_0x415f23 instanceof Error&&_0x415f23['name']===_0x18b7ca(0xe9))throw CliErrors[_0x18b7ca(0x75)](_0x18b7ca(0x71)+_0x8ed02c);if(_0x95a0b9['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x18b7ca(0x75)](_0x18b7ca(0xaf)+_0x95a0b9[_0x18b7ca(0x113)]+')',_0x95a0b9[_0x18b7ca(0x113)]>=0x190?_0x18b7ca(0x9d):undefined);}if(!_0x95a0b9['ok']||_0x59adda[_0x18b7ca(0x107)]===![])throw CliErrors[_0x18b7ca(0x75)](_0x59adda[_0x18b7ca(0x97)]||_0x59adda[_0x18b7ca(0xb3)]||'API\x20error:\x20'+_0x95a0b9[_0x18b7ca(0x113)],_0x59adda[_0x18b7ca(0x8e)]?_0x18b7ca(0xe7)+_0x59adda[_0x18b7ca(0x8e)]:undefined);return _0x59adda;}catch(_0xc0f74f){if(_0xc0f74f instanceof CliError)throw _0xc0f74f;if(_0xc0f74f instanceof Error&&_0xc0f74f[_0x18b7ca(0xa7)]===_0x18b7ca(0xe9))throw CliErrors[_0x18b7ca(0x75)](_0x18b7ca(0x71)+_0x8ed02c);throw createFetchFailureError(_0x8ed02c,_0xc0f74f);}finally{clearTimeout(_0x5bf9b7);}}function isAuthFailure(_0xcdda27){const _0x1c0a52=a159_0x29a9,_0x4b4db8=_0xcdda27['errorMsg']||_0xcdda27[_0x1c0a52(0xb3)]||_0xcdda27[_0x1c0a52(0xcb)]?.[_0x1c0a52(0xb3)]||_0xcdda27[_0x1c0a52(0x111)]||_0xcdda27[_0x1c0a52(0xeb)]||'';return _0xcdda27['errorCode']==='UNAUTHORIZED'||_0xcdda27[_0x1c0a52(0xf7)]===0x191||_0xcdda27[_0x1c0a52(0xf7)]===_0x1c0a52(0xfe)||_0x4b4db8[_0x1c0a52(0xd3)](_0x1c0a52(0xfe))||_0x4b4db8[_0x1c0a52(0xd3)](_0x1c0a52(0x114))||_0x4b4db8[_0x1c0a52(0xd3)]('登录')||_0x4b4db8[_0x1c0a52(0xd3)]('认证');}export async function platformFetch(_0x3073af,_0x21ed83){const _0x3a7d69=a159_0x29a9;let _0x4b43e7;try{_0x4b43e7=await fetch(_0x3073af,{'method':_0x21ed83['method']??_0x3a7d69(0x122),'headers':{'Content-Type':_0x3a7d69(0x106),'Cookie':_0x21ed83[_0x3a7d69(0xaa)],'X-Invoke-Source':_0x3a7d69(0xc9)},..._0x21ed83[_0x3a7d69(0xdf)]&&{'body':JSON[_0x3a7d69(0xa6)](_0x21ed83[_0x3a7d69(0xdf)])}});}catch(_0xea2878){throw createFetchFailureError(_0x3073af,_0xea2878);}if(!_0x4b43e7['ok']){if(_0x4b43e7[_0x3a7d69(0x113)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x3a7d69(0x75)](_0x21ed83[_0x3a7d69(0x89)]+_0x3a7d69(0x11d)+_0x4b43e7[_0x3a7d69(0x113)]);}const _0x4e5132=await _0x4b43e7[_0x3a7d69(0x70)]();if(_0x4e5132[_0x3a7d69(0x107)]===![]){if(isAuthFailure(_0x4e5132))throw CliErrors['authRequired']();throw CliErrors[_0x3a7d69(0x75)](_0x4e5132[_0x3a7d69(0x97)]||_0x4e5132[_0x3a7d69(0xb3)]||_0x21ed83[_0x3a7d69(0x89)]+_0x3a7d69(0xa9));}return _0x4e5132[_0x3a7d69(0xcb)];}export async function listBffScripts(_0x24801c,_0x3b25da,_0x380e98){const _0xe8334f=a159_0x29a9;let _0x468235=_0xe8334f(0x120)+_0x24801c;if(_0x3b25da)_0x468235+=_0xe8334f(0xb0)+_0x3b25da;const _0x306b36=await apiRequest(_0x468235);let _0xd0ad9d=extractList(_0x306b36[_0xe8334f(0xcb)]);if(_0x380e98?.[_0xe8334f(0xd4)]){const _0x1d7ee1=_0x380e98['scriptName'][_0xe8334f(0x9a)]();_0xd0ad9d=_0xd0ad9d[_0xe8334f(0x74)](_0x4086f8=>_0x4086f8[_0xe8334f(0x81)]?.[_0xe8334f(0x9a)]()['includes'](_0x1d7ee1)||_0x4086f8[_0xe8334f(0xd8)]?.[_0xe8334f(0x9a)]()[_0xe8334f(0xd3)](_0x1d7ee1));}return _0xd0ad9d;}export async function getBffScriptInfo(_0x590f0b){const _0x424b37=a159_0x29a9,_0x937847=await apiRequest(_0x424b37(0xe1)+_0x590f0b);if(!_0x937847[_0x424b37(0xcb)])throw CliErrors[_0x424b37(0x125)](_0x424b37(0x76)+_0x590f0b);return _0x937847[_0x424b37(0xcb)];}export async function saveBffScript(_0x3456da){const _0x1b2091=a159_0x29a9,_0x44608f=await apiRequest(_0x1b2091(0x109),{'method':_0x1b2091(0x94),'body':_0x3456da}),{id:_0x43fde8,entity:_0x21bf2f}=normalizeEntityWithIdResponse(_0x44608f[_0x1b2091(0xcb)]);if(_0x43fde8!==undefined){const _0x48d509=typeof _0x21bf2f[_0x1b2091(0x81)]===_0x1b2091(0xbe)||typeof _0x21bf2f[_0x1b2091(0x98)]===_0x1b2091(0xbe)?_0x21bf2f:undefined;return{'id':_0x43fde8,'script':_0x48d509};}throw CliErrors['apiError']('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x328be1){const _0x5c1b14=a159_0x29a9;await apiRequest(_0x5c1b14(0xab),{'method':_0x5c1b14(0x94),'body':{'id':_0x328be1}});}export async function getBffScriptStatistics(_0x29bb7c){const _0x585a04=a159_0x29a9,_0x14e7be=await apiRequest(_0x585a04(0x10d)+_0x29bb7c);return extractList(_0x14e7be[_0x585a04(0xcb)]);}export async function clearBffScriptCache(){const _0x3d4402=a159_0x29a9,_0x5901a1=await apiRequest('/api/management/script/cache/clear',{'method':'POST','useRuntime':!![]});return typeof _0x5901a1[_0x3d4402(0xcb)]===_0x3d4402(0xbe)?_0x5901a1[_0x3d4402(0xcb)]:'';}export async function listBffDatasetOperations(_0x29039a,_0x368a79){const _0x434c5f=a159_0x29a9,_0x6168b2=await apiRequest(_0x434c5f(0xb1),{'method':_0x434c5f(0x94),'body':{'appCode':_0x29039a,'datasetId':_0x368a79}});return _0x6168b2['data'];}export async function listSqlQueries(_0x30a098,_0x559a02){const _0x4b0891=a159_0x29a9,_0x135dcb=await apiRequest(_0x4b0891(0x8a),{'method':'POST','body':{'appCode':_0x30a098,'currentPage':_0x559a02?.[_0x4b0891(0x11e)]??0x1,'pageSize':_0x559a02?.['pageSize']??0x32,'sqlCode':_0x559a02?.[_0x4b0891(0x9e)],'sqlName':_0x559a02?.[_0x4b0891(0x7f)]}});return _0x135dcb[_0x4b0891(0xcb)];}export async function getSqlQueryInfo(_0x9e804a,_0x18c425){const _0x15376c=a159_0x29a9,_0x5b335b=await listSqlQueries(_0x9e804a,{'sqlCode':_0x18c425}),_0x556416=_0x5b335b['tableData']?.[0x0];if(!_0x556416)throw CliErrors['validation'](_0x15376c(0x10f)+_0x18c425);return _0x556416;}export async function getSqlQueryDetail(_0x161fce){const _0x3c4438=a159_0x29a9,_0x59ec2d=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x3c4438(0x7d)+encodeURIComponent(_0x161fce)));if(!_0x59ec2d['data'])throw CliErrors[_0x3c4438(0x125)](_0x3c4438(0x10f)+_0x161fce);return _0x59ec2d['data'];}export async function getSqlQueryDetailById(_0x5512fe){const _0x412e6b=a159_0x29a9,_0x2f1cf6=await apiRequest(_0x412e6b(0x93)+_0x5512fe);if(!_0x2f1cf6[_0x412e6b(0xcb)])throw CliErrors[_0x412e6b(0x125)]('SQL\x20query\x20not\x20found:\x20id='+_0x5512fe);return _0x2f1cf6['data'];}export async function createSqlQuery(_0xf9479){const _0x32a133=a159_0x29a9,_0xde521e=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0xf9479}),{id:_0x2e41c7,entity:_0x5841cf}=normalizeEntityWithIdResponse(_0xde521e[_0x32a133(0xcb)]);if(!(_0x32a133(0x9e)in _0x5841cf)&&_0x2e41c7)return getSqlQueryDetailById(_0x2e41c7);return normalizeSqlQueryEntity(_0x5841cf);}export async function updateSqlQuery(_0xfd8284){const _0x558014=a159_0x29a9,_0x4670b7=await apiRequest(_0x558014(0xd1),{'method':_0x558014(0x94),'body':_0xfd8284}),{id:_0x40ce51,entity:_0xb85b8d}=normalizeEntityWithIdResponse(_0x4670b7['data']);if(!(_0x558014(0x9e)in _0xb85b8d)){if(_0xfd8284[_0x558014(0x9e)])return getSqlQueryDetail(_0xfd8284[_0x558014(0x9e)]);if(_0x40ce51)return getSqlQueryDetailById(_0x40ce51);}return normalizeSqlQueryEntity(_0xb85b8d);}export async function deleteSqlQuery(_0x4b7b31){const _0x574a35=a159_0x29a9;await apiRequest(_0x574a35(0x95),{'method':_0x574a35(0x94),'body':_0x4b7b31});}export async function saveSqlQuery(_0x5d7522){const _0x521ffd=a159_0x29a9,_0x156db5=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x521ffd(0x94),'body':_0x5d7522});return _0x156db5[_0x521ffd(0xcb)];}function normalizeSqlQueryEntity(_0x11e16a){const _0x3c0573=a159_0x29a9;return{..._0x11e16a,'id':Number(_0x11e16a['id']),'dbId':_0x11e16a[_0x3c0573(0xf4)]==null?undefined:Number(_0x11e16a[_0x3c0573(0xf4)]),'version':_0x11e16a['version']==null?undefined:Number(_0x11e16a[_0x3c0573(0x104)])};}export async function executeSql(_0x35e501,_0x21f261,_0x528f1f){const _0x58fce7=a159_0x29a9,_0x1751ff=await apiRequest(_0x58fce7(0x8c),{'method':_0x58fce7(0x94),'body':{'appCode':_0x35e501,'sqlCode':_0x21f261,..._0x528f1f&&{'params':_0x528f1f}},'useRuntime':!![]});return _0x1751ff[_0x58fce7(0xcb)];}export async function executeDatasetDataOperation(_0x217f2c,_0x2644eb,_0x5354f6,_0x293208={}){const _0x225da5=a159_0x29a9;try{const _0x56e933=await apiRequest(_0x225da5(0xcd)+_0x217f2c+'/'+_0x2644eb+'/'+_0x5354f6,{'method':'POST','body':_0x293208,'useRuntime':!![]});return _0x56e933['data'];}catch(_0x18af25){if(_0x5354f6===_0x225da5(0xc7)&&_0x18af25 instanceof CliError&&_0x18af25[_0x225da5(0xf7)]===_0x225da5(0xd2)&&_0x293208['id']!==undefined&&_0x293208['id']!==null&&_0x293208['id']!==''){const _0x4d4a52=await apiRequest('/api/'+_0x217f2c+'/'+_0x2644eb+_0x225da5(0xa2),{'method':'POST','body':{'where':{'id':{'$eq':_0x293208['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x50abce=Array['isArray'](_0x4d4a52['data']?.[_0x225da5(0x9f)])?_0x4d4a52[_0x225da5(0xcb)][_0x225da5(0x9f)]:[];return _0x50abce[0x0]??null;}throw _0x18af25;}}export async function listDatasets(_0x847511,_0x27dfd3){const _0x2a0701=a159_0x29a9,_0x879cb0={'appCode':_0x847511,'deleted':_0x27dfd3?.[_0x2a0701(0xbb)]??![]};if(_0x27dfd3?.[_0x2a0701(0xf7)])_0x879cb0[_0x2a0701(0xf7)]=_0x27dfd3[_0x2a0701(0xf7)];if(_0x27dfd3?.[_0x2a0701(0xa7)])_0x879cb0['name']=_0x27dfd3[_0x2a0701(0xa7)];const _0x5993df=await apiRequest(_0x2a0701(0x6f),{'method':'POST','body':_0x879cb0});return extractList(_0x5993df[_0x2a0701(0xcb)]);}export async function deleteDataset(_0x1933f4,_0x2e5f31){const _0x4f20a4=a159_0x29a9;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x4f20a4(0x94),'body':{'appCode':_0x1933f4,'datasetId':_0x2e5f31}});}export async function restoreDataset(_0xb92bfe,_0x1e8b3e){const _0x1fbfa1=a159_0x29a9;await apiRequest(_0x1fbfa1(0xb4),{'method':_0x1fbfa1(0x94),'body':{'appCode':_0xb92bfe,'datasetId':_0x1e8b3e}});}export async function previewTextGeneratedDataset(_0x5d7080,_0xf140da){const _0x30a07f=a159_0x29a9,_0xb5d8b2=await apiRequest(_0x30a07f(0x7e),{'method':'POST','body':{'appCode':_0x5d7080,'datasetName':_0xf140da[_0x30a07f(0xac)],'requirementDescription':_0xf140da[_0x30a07f(0x7a)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0xb5d8b2[_0x30a07f(0xcb)];}export async function startTextGeneratedDataset(_0x4d964d,_0x565627,_0xad0a00){const _0x4c434f=a159_0x29a9,_0xc5d76=await apiRequest(_0x4c434f(0xa4),{'method':_0x4c434f(0x94),'body':{'appCode':_0x4d964d,..._0xad0a00?.['clientOperationId']?{'clientOperationId':_0xad0a00[_0x4c434f(0xda)]}:{},'design':_0x565627},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0xc5d76[_0x4c434f(0xcb)];}export async function getTextGeneratedDatasetStatus(_0x481c3f,_0x47a264){const _0x2922ba=a159_0x29a9,_0x42a03a=new URLSearchParams({'appCode':_0x481c3f});_0x47a264[_0x2922ba(0x11a)]&&_0x42a03a['set'](_0x2922ba(0x11a),_0x47a264[_0x2922ba(0x11a)]);_0x47a264[_0x2922ba(0xda)]&&_0x42a03a[_0x2922ba(0xdb)](_0x2922ba(0xda),_0x47a264[_0x2922ba(0xda)]);const _0x74b2c1=await apiRequest(_0x2922ba(0x11c)+_0x42a03a[_0x2922ba(0xce)]());return _0x74b2c1[_0x2922ba(0xcb)];}export async function searchDatasets(_0x3945b6,_0x577548){const _0x1f0125=a159_0x29a9,_0x2cc62d=await listDatasets(_0x3945b6,{'name':_0x577548}),_0x5e21b2=_0x577548[_0x1f0125(0x9a)](),_0x49ac14=new Set(_0x2cc62d[_0x1f0125(0xb2)](_0x499e98=>_0x499e98['id'])),_0x41339d=_0x2cc62d['filter'](_0x5b63e9=>_0x5b63e9[_0x1f0125(0x10b)]?.[_0x1f0125(0xc5)]?.[_0x1f0125(0x9a)]()[_0x1f0125(0xd3)](_0x5e21b2)||_0x5b63e9[_0x1f0125(0xd8)]?.[_0x1f0125(0x9a)]()[_0x1f0125(0xd3)](_0x5e21b2)),_0x407126=await listDatasets(_0x3945b6,{'code':_0x577548});for(const _0x5a8e32 of _0x407126){!_0x49ac14[_0x1f0125(0x78)](_0x5a8e32['id'])&&(_0x2cc62d[_0x1f0125(0xdc)](_0x5a8e32),_0x49ac14[_0x1f0125(0xe6)](_0x5a8e32['id']));}return _0x2cc62d;}export function normalizeDatasetOperations(_0x30908a){const _0x654a6e=a159_0x29a9;if(Array['isArray'](_0x30908a))return _0x30908a[_0x654a6e(0x74)](_0x28340f=>_0x28340f!=null&&typeof _0x28340f===_0x654a6e(0xdd));if(_0x30908a&&typeof _0x30908a===_0x654a6e(0xdd))return Object[_0x654a6e(0x11b)](_0x30908a)[_0x654a6e(0x74)](([,_0x243280])=>_0x243280!=null&&typeof _0x243280==='object')['map'](([_0x23168c,_0x55e754])=>({..._0x55e754,'name':_0x55e754['name']??_0x55e754[_0x654a6e(0xa3)]??_0x23168c}));return[];}export async function getDatasetDetail(_0x43e370){const _0x17a8cd=a159_0x29a9,_0x1b1b6a=/^\d+$/[_0x17a8cd(0x90)](_0x43e370)?'id':'code',_0x40f084=await apiRequest(_0x17a8cd(0xf8)+_0x1b1b6a+'='+_0x43e370);return _0x40f084['data'];}export async function updateDrivenData(_0x5b30b3){const _0x5dc61f=a159_0x29a9,_0x431d2c=await apiRequest(_0x5dc61f(0x103),{'method':_0x5dc61f(0x94),'body':_0x5b30b3});return _0x431d2c[_0x5dc61f(0xcb)];}export async function getDatasetOperations(_0x489014){const _0x375481=a159_0x29a9,_0x1d98b4=await getDatasetDetail(_0x489014),_0x284d36=normalizeDatasetOperations(_0x1d98b4[_0x375481(0x92)])['map'](_0x7ebc=>({'name':_0x7ebc[_0x375481(0xa7)]||_0x7ebc[_0x375481(0xa3)],'displayName':_0x7ebc[_0x375481(0x88)]||_0x7ebc[_0x375481(0xa7)],'type':_0x7ebc[_0x375481(0xc3)],'method':_0x7ebc[_0x375481(0xb9)],'path':_0x7ebc[_0x375481(0xd5)],'enabled':_0x7ebc[_0x375481(0xcc)]??!![],'requestFields':_0x7ebc[_0x375481(0xb5)],'responseFields':_0x7ebc[_0x375481(0xf1)]}));return{'dataset':{'id':_0x1d98b4['id']??_0x1d98b4['modelId'],'name':_0x1d98b4['name'],'code':_0x1d98b4[_0x375481(0xf7)]||_0x1d98b4[_0x375481(0xfd)],'tableName':_0x1d98b4['tableName']||_0x1d98b4['dbtableConfig']?.[_0x375481(0xc5)]},'operations':_0x284d36};}export async function getOperationDetail(_0x513510,_0x5a49e3,_0x34d251){const _0x24dfba=a159_0x29a9;let _0x23bf71=_0x5a49e3;if(!/^\d+$/['test'](_0x5a49e3)){const _0x5524c5=await listDatasets(_0x513510,{'code':_0x5a49e3}),_0x25233f=_0x5524c5[_0x24dfba(0x80)](_0x34f375=>_0x34f375['code']===_0x5a49e3||String(_0x34f375['id'])===_0x5a49e3);if(!_0x25233f)throw CliErrors[_0x24dfba(0x125)](_0x24dfba(0x96)+_0x5a49e3);_0x23bf71=String(_0x25233f['id']);}const _0x269099=await getDatasetDetail(_0x23bf71),_0x1c1449=normalizeDatasetOperations(_0x269099[_0x24dfba(0x92)])[_0x24dfba(0x80)](_0x581796=>(_0x581796[_0x24dfba(0xa7)]||_0x581796['operationName'])===_0x34d251);if(!_0x1c1449)throw CliErrors['validation'](_0x24dfba(0xd0)+_0x34d251+_0x24dfba(0xad)+_0x5a49e3);return{'dataset':{'id':_0x269099['id']??_0x269099[_0x24dfba(0x126)],'name':_0x269099[_0x24dfba(0xa7)],'code':_0x269099['code']||_0x269099[_0x24dfba(0xfd)],'tableName':_0x269099[_0x24dfba(0xc5)]||_0x269099['dbtableConfig']?.['tableName']},'operation':_0x1c1449};}export async function startGenerateStandardPages(_0x24082b,_0x1c4799,_0x1a0fc6){const _0x3687b7=a159_0x29a9,_0x5f17c7=await apiRequest(_0x3687b7(0x100)+_0x1c4799+_0x3687b7(0x8f),{'method':_0x3687b7(0x94),'body':{'appCode':_0x24082b,..._0x1a0fc6?.[_0x3687b7(0xda)]?{'clientOperationId':_0x1a0fc6[_0x3687b7(0xda)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5f17c7[_0x3687b7(0xcb)];}export async function getGenerateStandardPagesStatus(_0x33496e,_0x52d948,_0x576085){const _0x37b9c8=a159_0x29a9,_0x5ccad1=new URLSearchParams({'appCode':_0x33496e});_0x576085[_0x37b9c8(0x11a)]&&_0x5ccad1[_0x37b9c8(0xdb)](_0x37b9c8(0x11a),_0x576085['operationId']);_0x576085[_0x37b9c8(0xda)]&&_0x5ccad1[_0x37b9c8(0xdb)]('clientOperationId',_0x576085['clientOperationId']);const _0x88e6bd=await apiRequest(_0x37b9c8(0x100)+_0x52d948+_0x37b9c8(0xb8)+_0x5ccad1['toString']());return _0x88e6bd[_0x37b9c8(0xcb)];}export async function getStandardPageStatus(_0x4edca3,_0x546a3e){const _0xe1eccf=a159_0x29a9,_0x23dcca=await apiRequest('/smartapi/lovrabet/dataset/'+_0x546a3e+_0xe1eccf(0x123)+encodeURIComponent(_0x4edca3));return _0x23dcca[_0xe1eccf(0xcb)];}export async function tryGetStandardPageStatus(_0x395d12,_0x153fec){const _0x33092a=a159_0x29a9;try{return await getStandardPageStatus(_0x395d12,_0x153fec);}catch(_0x39522f){if(_0x39522f instanceof CliError&&_0x39522f[_0x33092a(0xf7)]===_0x33092a(0xd2)&&/404|not found|non-json response/i[_0x33092a(0x90)](_0x39522f[_0x33092a(0xb3)]))return null;throw _0x39522f;}}export async function syncStandardPages(_0x3b2a9f,_0x3b7a37){const _0x501821=a159_0x29a9,_0x4e0662=await apiRequest(_0x501821(0x100)+_0x3b7a37+_0x501821(0x83),{'method':_0x501821(0x94),'body':{'appCode':_0x3b2a9f}});return _0x4e0662[_0x501821(0xcb)];}export async function getPageDetail(_0x3b4b34){const _0x324d12=a159_0x29a9,_0x225aab=await apiRequest(_0x324d12(0x110)+_0x3b4b34);if(!_0x225aab[_0x324d12(0xcb)])throw CliErrors[_0x324d12(0x125)](_0x324d12(0xff)+_0x3b4b34);return _0x225aab[_0x324d12(0xcb)];}export async function updatePage(_0x19a820,_0x8e2129,_0x22096c,_0x242790){const _0x3b8cdc=a159_0x29a9,_0xd3d9e2=await apiRequest(_0x3b8cdc(0x9b),{'method':_0x3b8cdc(0x94),'body':{'appCode':_0x19a820,'pageId':_0x8e2129,'code':_0x22096c,'datasetIds':_0x242790}});return _0xd3d9e2[_0x3b8cdc(0xcb)];}export function generateSdkCode(_0x5517e9,_0x5d0e3a,_0x546301){const _0x5ce1ad=a159_0x29a9,_0x111be5=_0x546301?.[_0x5ce1ad(0xed)]??!![],_0x1c0d02='dataset_'+_0x5517e9[_0x5ce1ad(0xf7)]?.[_0x5ce1ad(0xc6)](/-/g,'_'),_0x397641=_0x5d0e3a['name']||_0x5d0e3a[_0x5ce1ad(0xa3)]||_0x5ce1ad(0x74),_0x57a466=[];_0x111be5&&_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0x117),'',_0x5ce1ad(0x7b),'');_0x57a466['push'](_0x5ce1ad(0xe4)+_0x5517e9['name']+'\x20('+(_0x5517e9['tableName']||_0x5ce1ad(0xef))+')');if(_0x397641===_0x5ce1ad(0x74))_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0xd7)+_0x1c0d02+_0x5ce1ad(0xe3),'\x20\x20where:\x20{},',_0x5ce1ad(0xd6),_0x5ce1ad(0xba),'});');else{if(_0x397641===_0x5ce1ad(0xc7))_0x57a466[_0x5ce1ad(0xdc)]('const\x20result\x20=\x20await\x20client.models.'+_0x1c0d02+_0x5ce1ad(0x91));else{if(_0x397641==='create')_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0xd7)+_0x1c0d02+_0x5ce1ad(0x77));else{if(_0x397641==='update')_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0xd7)+_0x1c0d02+_0x5ce1ad(0xde));else _0x397641===_0x5ce1ad(0xbc)||_0x397641==='remove'?_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0xd7)+_0x1c0d02+_0x5ce1ad(0xc2)):_0x57a466[_0x5ce1ad(0xdc)](_0x5ce1ad(0xd7)+_0x1c0d02+'.'+_0x397641+'(/*\x20params\x20*/);');}}}return _0x57a466[_0x5ce1ad(0xa5)]('\x0a');}export function generateSqlCodeTemplate(_0x4531c4,_0x1b7b2e){const _0x3ee8c5=a159_0x29a9,_0x366683=_0x1b7b2e?.[_0x3ee8c5(0x10a)]??_0x3ee8c5(0xd9),_0x1dd1fe=_0x1b7b2e?.[_0x3ee8c5(0xed)]??!![],_0x1a19cb=[];return _0x1a19cb[_0x3ee8c5(0xdc)](_0x3ee8c5(0xf0)+_0x4531c4[_0x3ee8c5(0x7f)]+'\x20('+_0x4531c4[_0x3ee8c5(0x9e)]+')'),_0x366683===_0x3ee8c5(0xd9)?(_0x1dd1fe&&_0x1a19cb[_0x3ee8c5(0xdc)](_0x3ee8c5(0x117),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x1a19cb['push'](_0x3ee8c5(0x119),_0x3ee8c5(0x6e)+_0x4531c4[_0x3ee8c5(0x9e)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x3ee8c5(0x87),_0x3ee8c5(0xcf),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x1a19cb[_0x3ee8c5(0xdc)](_0x3ee8c5(0x99),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x3ee8c5(0xa8),_0x3ee8c5(0xc0)+_0x4531c4['sqlCode']+'\x27,',_0x3ee8c5(0xc4),_0x3ee8c5(0xbd),_0x3ee8c5(0x101),'}'),_0x1a19cb[_0x3ee8c5(0xa5)]('\x0a');}export async function getErConfig(_0x4eff3d,_0x59ce7b){const _0x1c02e6=a159_0x29a9,_0x123863=await apiRequest('/smartapi/question/er-config',{'method':_0x1c02e6(0x94),'body':{'appCode':_0x4eff3d,'dblinkId':_0x59ce7b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x123863['data'];}export async function createErRelation(_0x36250f){const _0x2de9b9=a159_0x29a9,_0x3237ff=await apiRequest(_0x2de9b9(0xfc),{'method':'POST','body':_0x36250f,'allowNonJsonSuccess':!![]});return _0x3237ff[_0x2de9b9(0xcb)];}export async function updateErRelation(_0x428fcd){const _0x594e6d=a159_0x29a9,_0x3f6395=await apiRequest(_0x594e6d(0x9c),{'method':_0x594e6d(0x94),'body':_0x428fcd,'allowNonJsonSuccess':!![]});return _0x3f6395[_0x594e6d(0xcb)];}export async function deleteErRelation(_0x238fae){const _0xc85b15=a159_0x29a9,_0x336bc3=await apiRequest('/smartapi/question/er-config/erDelete',{'method':_0xc85b15(0x94),'body':_0x238fae,'allowNonJsonSuccess':!![]});return _0x336bc3[_0xc85b15(0xcb)];}export async function updateErBusinessGroup(_0x29398d){const _0x5c9eab=a159_0x29a9,_0xcd79bd=await apiRequest(_0x5c9eab(0xfb),{'method':_0x5c9eab(0x94),'body':_0x29398d,'allowNonJsonSuccess':!![]});return _0xcd79bd[_0x5c9eab(0xcb)];}function buildQuery(_0x81608b){const _0x5ef106=a159_0x29a9,_0xc6794b=new URLSearchParams();for(const [_0x240fc5,_0x5b58d0]of Object[_0x5ef106(0x11b)](_0x81608b)){if(_0x5b58d0===undefined||_0x5b58d0==='')continue;_0xc6794b[_0x5ef106(0xdb)](_0x240fc5,String(_0x5b58d0));}const _0x264481=_0xc6794b['toString']();return _0x264481?'?'+_0x264481:'';}export async function listAppConfigs(_0x4a0556,_0x58b20c){const _0x21c841=a159_0x29a9,_0x1b47bb=await apiRequest(_0x21c841(0xf6),{'method':_0x21c841(0x94),'body':{'appCode':_0x4a0556,..._0x58b20c?.[_0x21c841(0x8d)]?{'key':_0x58b20c[_0x21c841(0x8d)]}:{},..._0x58b20c?.[_0x21c841(0xe5)]?{'tags':_0x58b20c[_0x21c841(0xe5)]}:{}}});return extractAppConfigList(_0x1b47bb['data']);}export async function getAppConfigByKey(_0x46a1fc,_0x2defa9){const _0x2e2fec=a159_0x29a9,_0xf2f260=await apiRequest(_0x2e2fec(0xec)+buildQuery({'appCode':_0x46a1fc,'key':_0x2defa9}));return _0xf2f260[_0x2e2fec(0xcb)]??null;}export async function createAppConfig(_0x314566){const _0x50c690=a159_0x29a9,_0x1f4970=await apiRequest(_0x50c690(0x11f),{'method':_0x50c690(0x94),'body':{'appCode':_0x314566[_0x50c690(0x121)],'key':_0x314566[_0x50c690(0x8d)],'value':_0x314566[_0x50c690(0x82)],..._0x314566['tags']?{'tags':_0x314566['tags']}:{}}});return _0x1f4970[_0x50c690(0xcb)];}export async function updateAppConfig(_0x21baff){const _0xeffa77=a159_0x29a9;await apiRequest(_0xeffa77(0xc1),{'method':_0xeffa77(0x94),'body':{'id':_0x21baff['id'],'appCode':_0x21baff[_0xeffa77(0x121)],'key':_0x21baff[_0xeffa77(0x8d)],'value':_0x21baff[_0xeffa77(0x82)],..._0x21baff[_0xeffa77(0xe5)]?{'tags':_0x21baff[_0xeffa77(0xe5)]}:{}}});}export async function deleteAppConfig(_0x17796f){const _0x190e82=a159_0x29a9;await apiRequest(_0x190e82(0xee),{'method':_0x190e82(0x94),'body':_0x17796f});}function extractAppConfigList(_0x2c806c){const _0x3b7a95=a159_0x29a9;if(Array['isArray'](_0x2c806c))return _0x2c806c;if(_0x2c806c&&typeof _0x2c806c==='object'&&Array[_0x3b7a95(0x73)](_0x2c806c[_0x3b7a95(0xca)]))return _0x2c806c[_0x3b7a95(0xca)];return extractList(_0x2c806c);}export async function listDbLinks(_0x4a2348,_0x4883cc){const _0x23df97=a159_0x29a9,_0x2aab3e=await apiRequest(_0x23df97(0x118),{'method':_0x23df97(0x94),'body':{'appCode':_0x4a2348,'currentPage':_0x4883cc?.[_0x23df97(0x11e)]??0x1,'pageSize':_0x4883cc?.['pageSize']??0x64}});return{'items':extractList(_0x2aab3e['data']),'paging':extractPaging(_0x2aab3e[_0x23df97(0xcb)])};}export async function getDbLinkInfo(_0x5551a6){const _0x59afef=a159_0x29a9,_0x48f6f1=await apiRequest(_0x59afef(0xa1)+buildQuery({'id':_0x5551a6}));return _0x48f6f1[_0x59afef(0xcb)];}export async function createDbLink(_0xb9aeb6){const _0x3661cc=a159_0x29a9,_0x35b3a7=await apiRequest(_0x3661cc(0xe0),{'method':_0x3661cc(0x94),'body':_0xb9aeb6});return _0x35b3a7[_0x3661cc(0xcb)];}export async function updateDbLink(_0x41f3f8){const _0x3069a3=a159_0x29a9,_0x10ea23=await apiRequest(_0x3069a3(0x72),{'method':_0x3069a3(0x94),'body':_0x41f3f8});return _0x10ea23[_0x3069a3(0xcb)];}export async function deleteDbLink(_0x13c7ff){const _0x3a46a7=a159_0x29a9;await apiRequest(_0x3a46a7(0xf2),{'method':_0x3a46a7(0x94),'body':{'id':_0x13c7ff}});}export async function testDbLinkConnect(_0x23da4e){const _0x5723d9=a159_0x29a9,_0x1623f1=await apiRequest(_0x5723d9(0xf3)+buildQuery({'id':_0x23da4e}));return _0x1623f1[_0x5723d9(0xcb)];}export async function startDbAnalysis(_0x3e8372,_0x2680a2){const _0xe1964c=a159_0x29a9,_0x59802f=await apiRequest(_0xe1964c(0xfa),{'method':_0xe1964c(0x94),'body':{'dbLinkId':_0x3e8372,..._0x2680a2&&_0x2680a2[_0xe1964c(0xc8)]>0x0?{'tableNames':_0x2680a2}:{}}}),_0x2ae953=_0x59802f[_0xe1964c(0xcb)];if(typeof _0x2ae953==='string')return _0x2ae953;if(_0x2ae953&&typeof _0x2ae953===_0xe1964c(0xdd)&&typeof _0x2ae953[_0xe1964c(0x115)]===_0xe1964c(0xbe))return _0x2ae953[_0xe1964c(0x115)];return _0x2ae953!=null?String(_0x2ae953):'';}export async function cancelDbAnalysis(_0x404979){const _0x2bcbcd=a159_0x29a9;await apiRequest(_0x2bcbcd(0x8b)+buildQuery({'planId':_0x404979}),{'method':_0x2bcbcd(0x94)});}export async function getDbAnalysisStatus(_0x46b4f0){const _0x1d8813=a159_0x29a9,_0x1338dc=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x46b4f0));return _0x1338dc[_0x1d8813(0xcb)];}export async function getDbAllTableList(_0x12c12e,_0x1c7d52){const _0x3cbab3=a159_0x29a9,_0x34c003=await apiRequest(_0x3cbab3(0x112)+buildQuery({'appCode':_0x12c12e,'dbLinkId':_0x1c7d52})),_0x12a1f8=_0x34c003[_0x3cbab3(0xcb)];if(Array[_0x3cbab3(0x73)](_0x12a1f8))return _0x12a1f8;return extractList(_0x12a1f8);}export async function getDbTableDiff(_0x1ea95f,_0x191aee,_0x545a9d){const _0x57d403=a159_0x29a9,_0x3055d7=await apiRequest(_0x57d403(0xa0)+buildQuery({'appCode':_0x1ea95f,'dbLinkId':_0x191aee,'pageIndex':_0x545a9d?.['pageIndex']??0x1,'pageSize':_0x545a9d?.[_0x57d403(0x10c)]??0x14,'tableName':_0x545a9d?.['tableName']})),_0x20b3fb=_0x3055d7[_0x57d403(0xcb)];return{'totalCount':_0x20b3fb?.[_0x57d403(0xb6)]??0x0,'physicalTableCount':_0x20b3fb?.['physicalTableCount']??0x0,'datasetTableCount':_0x20b3fb?.[_0x57d403(0x108)]??0x0,..._0x20b3fb?.[_0x57d403(0xe8)]?{'summary':_0x20b3fb[_0x57d403(0xe8)]}:{},'tableList':Array[_0x57d403(0x73)](_0x20b3fb?.[_0x57d403(0x85)])?_0x20b3fb[_0x57d403(0x85)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x3df36b=a159_0x29a9,_0x31d6=await apiRequest(_0x3df36b(0xb7),{'method':_0x3df36b(0x94),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x6cb5e=extractList(_0x31d6[_0x3df36b(0xcb)]),_0x3a1bfb=extractPaging(_0x31d6['data']);return _0x3a1bfb&&_0x3a1bfb['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x3df36b(0x10e)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x3df36b(0x105)+_0x3a1bfb[_0x3df36b(0xb6)]+_0x3df36b(0xea)+_0x3df36b(0xf9)),_0x6cb5e;}
1
+ function a158_0x47d1(){const _0x3292dd=['json','sqlCode','join','signal','apiError','4440232PlxKlC','status','datasetName','toLowerCase','replace','const\x20data\x20=\x20await\x20client.sql.execute({','authRequired','target','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20apps.\x20','modelId','/smartapi/question/er-config/update-single','Request\x20timeout:\x20','/api/custom/executeSql','/filter','1389520rQqUCu','warn','/smartapi/custom/getUserCustomSql','\x20\x20sqlCode:\x20\x27','\x20\x20});','\x20failed,\x20HTTP\x20','/smartapi/app-config/list','/smartapi/dataset/get-dataset-list','version','/smartapi/dataset/restore-dataset','/smartapi/app-config/getByKey','tableName','/smartapi/custom/getUserCustomSql?id=','toString','\x22\x20not\x20found\x20in\x20dataset\x20','scriptType','message','/smartapi/question/er-config/business-group/edit','6SoRGqb','length','/smartapi/question/er-config','key','/smartapi/question/er-config/erCreate','name','.remove(id);','/api/management/library/scripts/statistics?appCode=','\x20\x20return\x20rows;','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','clientOperationId','/smartapi/lovrabet/detail?pageId=','906430AYoPTB','application/json','Request\x20failed:\x20','/smartapi/lovrabet/update-page','string','const\x20result\x20=\x20await\x20client.models.','Page\x20not\x20found:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','type','cli:rabetbase','401','/smartapi/db-analysis/status/','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','.create({\x20/*\x20fields\x20*/\x20});','?sqlCode=','89640ilXXCO','includes','method','scriptName','/api/management/library/scripts/save','//\x20SQL:\x20','/smartapi/app/getList','label','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/app-config/create','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','deleted','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','create','requirementDescription','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','set','getOne','/api/management/library/scripts/delete','Unauthorized','const\x20results\x20=\x20data.execResult\x20||\x20[];','filter','/api/management/library/scripts/info?id=','\x20\x20currentPage:\x201,','find','/standard-page-status?appCode=','enabled','921ZmCuKn','/smartapi/dblink/update','responseFields','/smartapi/custom/saveUserCustomSql','9bCHAte','body','includeImports','entries','dbtableConfig','errorMsg','/smartapi/dblink/create','errorMessage','sqlName','currentPage','/smartapi/db-analysis/jobs/cancel','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','});','code','/smartapi/dataset/text-generate/status?','/smartapi/custom/queryUserCustomSqlList','description','1529LAdTww','add','POST','/smartapi/app-config/update','/smartapi/question/er-config/erDelete','delete','/api/management/script/cache/clear','/generate-standard-pages/start','/smartapi/dblink/getOne','cookie','/smartapi/custom/deleteUserCustomSql','remove','list','pageSize','totalCount','/smartapi/lovrabet/dataset/','planId','/smartapi/dblink/getAllTableList','/smartapi/app-config/delete','success','/sync-to-pages','value','AbortError','5838413DDhOMM','functionName','validation','operationId','sdk','operations','2188knFefG','modelCode','data','/api/management/library/scripts/list?appCode=','appCode','tableData','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/api/node-toolbox/sql/save','stringify','/api/','/smartapi/dataset/update-driven-data','/smartapi/dblink/testConnect','update','GET','/smartapi/dblink/delete','has','tags','push','map','isArray','object','/smartapi/dblink/getTableDiffV2ByPage','Dataset\x20not\x20found:\x20','UNAUTHORIZED','operationName','(/*\x20params\x20*/);','summary','api_error','667114YYUYhH','table','displayName','/smartapi/dataset/text-generate/preview','/smartapi/dblink/getList'];a158_0x47d1=function(){return _0x3292dd;};return a158_0x47d1();}(function(_0x117cd5,_0x2f9b76){const _0x330756=a158_0x2ac6,_0x53435a=_0x117cd5();while(!![]){try{const _0xe079a4=parseInt(_0x330756(0x190))/0x1+-parseInt(_0x330756(0x1c7))/0x2+-parseInt(_0x330756(0x1f6))/0x3*(-parseInt(_0x330756(0x174))/0x4)+parseInt(_0x330756(0x1a9))/0x5+parseInt(_0x330756(0x1bb))/0x6*(-parseInt(_0x330756(0x16e))/0x7)+parseInt(_0x330756(0x19a))/0x8*(-parseInt(_0x330756(0x1fa))/0x9)+parseInt(_0x330756(0x1d7))/0xa*(parseInt(_0x330756(0x20b))/0xb);if(_0xe079a4===_0x2f9b76)break;else _0x53435a['push'](_0x53435a['shift']());}catch(_0x5b74dd){_0x53435a['push'](_0x53435a['shift']());}}}(a158_0x47d1,0x7e220));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x86fe01){_activeCookie=_0x86fe01||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x1413bc,_0x41b3cd){const _0x2241a4=a158_0x2ac6,_0x232012=_0x41b3cd instanceof Error?_0x41b3cd[_0x2241a4(0x1b9)]:String(_0x41b3cd);return CliErrors['apiError'](_0x2241a4(0x1c9)+_0x1413bc+(_0x232012?'\x20('+_0x232012+')':''),_0x2241a4(0x1e1));}async function apiRequest(_0x3f4ad2,_0xa8bbd5={}){const _0x3e2089=a158_0x2ac6,{method:method=_0x3e2089(0x181),body:_0x3cfe58,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xa8bbd5,_0x1f5fd9=useRuntime?getRuntimeDomain():getApiDomain(),_0xfe3427=_activeCookie||getCookie(),_0x11aee4=''+_0x1f5fd9+_0x3f4ad2,_0x169ca5=new AbortController(),_0x1b808d=setTimeout(()=>_0x169ca5['abort'](),timeout);try{const _0x6b996c=await fetch(_0x11aee4,{'method':method,'headers':{'Content-Type':_0x3e2089(0x1c8),'Cookie':_0xfe3427,'X-Invoke-Source':_0x3e2089(0x1d0),...headers},'body':_0x3cfe58?JSON[_0x3e2089(0x17c)](_0x3cfe58):undefined,'signal':_0x169ca5[_0x3e2089(0x198)]});let _0x52fbc5;try{_0x52fbc5=await _0x6b996c[_0x3e2089(0x195)]();}catch(_0x2df941){if(_0x2df941 instanceof Error&&_0x2df941[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);if(_0x6b996c['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3e2089(0x199)](_0x3e2089(0x1ce)+_0x6b996c[_0x3e2089(0x19b)]+')',_0x6b996c['status']>=0x190?_0x3e2089(0x1d3):undefined);}if(!_0x6b996c['ok']||_0x52fbc5[_0x3e2089(0x16a)]===![])throw CliErrors[_0x3e2089(0x199)](_0x52fbc5[_0x3e2089(0x1ff)]||_0x52fbc5['message']||'API\x20error:\x20'+_0x6b996c[_0x3e2089(0x19b)],_0x52fbc5[_0x3e2089(0x1ea)]?'API\x20error\x20code:\x20'+_0x52fbc5[_0x3e2089(0x1ea)]:undefined);return _0x52fbc5;}catch(_0x572dcb){if(_0x572dcb instanceof CliError)throw _0x572dcb;if(_0x572dcb instanceof Error&&_0x572dcb[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);throw createFetchFailureError(_0x11aee4,_0x572dcb);}finally{clearTimeout(_0x1b808d);}}function isAuthFailure(_0x34d580){const _0x3542e6=a158_0x2ac6,_0x389640=_0x34d580[_0x3542e6(0x1ff)]||_0x34d580[_0x3542e6(0x1b9)]||_0x34d580['data']?.[_0x3542e6(0x1b9)]||_0x34d580[_0x3542e6(0x201)]||_0x34d580['error']||'';return _0x34d580['errorCode']===_0x3542e6(0x18b)||_0x34d580[_0x3542e6(0x207)]===0x191||_0x34d580[_0x3542e6(0x207)]==='401'||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1d1))||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1ee))||_0x389640['includes']('登录')||_0x389640[_0x3542e6(0x1d8)]('认证');}export async function platformFetch(_0x5eb400,_0xb53f43){const _0x190c7c=a158_0x2ac6;let _0x52a775;try{_0x52a775=await fetch(_0x5eb400,{'method':_0xb53f43[_0x190c7c(0x1d9)]??_0x190c7c(0x181),'headers':{'Content-Type':_0x190c7c(0x1c8),'Cookie':_0xb53f43[_0x190c7c(0x160)],'X-Invoke-Source':'cli:rabetbase'},..._0xb53f43[_0x190c7c(0x1fb)]&&{'body':JSON[_0x190c7c(0x17c)](_0xb53f43[_0x190c7c(0x1fb)])}});}catch(_0x182785){throw createFetchFailureError(_0x5eb400,_0x182785);}if(!_0x52a775['ok']){if(_0x52a775['status']===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x190c7c(0x199)](_0xb53f43[_0x190c7c(0x1de)]+_0x190c7c(0x1ae)+_0x52a775[_0x190c7c(0x19b)]);}const _0x384265=await _0x52a775[_0x190c7c(0x195)]();if(_0x384265[_0x190c7c(0x16a)]===![]){if(isAuthFailure(_0x384265))throw CliErrors[_0x190c7c(0x1a0)]();throw CliErrors[_0x190c7c(0x199)](_0x384265[_0x190c7c(0x1ff)]||_0x384265[_0x190c7c(0x1b9)]||_0xb53f43['label']+'\x20failed');}return _0x384265[_0x190c7c(0x176)];}export async function listBffScripts(_0x110b3d,_0x1b1e6a,_0x43607d){const _0x20b759=a158_0x2ac6;let _0x44e33b=_0x20b759(0x177)+_0x110b3d;if(_0x1b1e6a)_0x44e33b+='&type='+_0x1b1e6a;const _0x38895d=await apiRequest(_0x44e33b);let _0x100c6e=extractList(_0x38895d[_0x20b759(0x176)]);if(_0x43607d?.[_0x20b759(0x1da)]){const _0x3e84b4=_0x43607d[_0x20b759(0x1da)][_0x20b759(0x19d)]();_0x100c6e=_0x100c6e['filter'](_0xfdc501=>_0xfdc501[_0x20b759(0x16f)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4)||_0xfdc501[_0x20b759(0x20a)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4));}return _0x100c6e;}export async function getBffScriptInfo(_0x3bebc0){const _0x2244b4=a158_0x2ac6,_0x5f47c2=await apiRequest(_0x2244b4(0x1f1)+_0x3bebc0);if(!_0x5f47c2[_0x2244b4(0x176)])throw CliErrors[_0x2244b4(0x170)]('BFF\x20script\x20not\x20found:\x20id='+_0x3bebc0);return _0x5f47c2[_0x2244b4(0x176)];}export async function saveBffScript(_0x5f1639){const _0x3f96fc=a158_0x2ac6,_0x17b28a=await apiRequest(_0x3f96fc(0x1db),{'method':'POST','body':_0x5f1639}),{id:_0x43aa73,entity:_0x37b686}=normalizeEntityWithIdResponse(_0x17b28a['data']);if(_0x43aa73!==undefined){const _0x4e6d69=typeof _0x37b686[_0x3f96fc(0x16f)]===_0x3f96fc(0x1cb)||typeof _0x37b686[_0x3f96fc(0x1b8)]===_0x3f96fc(0x1cb)?_0x37b686:undefined;return{'id':_0x43aa73,'script':_0x4e6d69};}throw CliErrors[_0x3f96fc(0x199)](_0x3f96fc(0x1a2));}export async function deleteBffScript(_0x444aed){const _0x2200ff=a158_0x2ac6;await apiRequest(_0x2200ff(0x1ed),{'method':_0x2200ff(0x20d),'body':{'id':_0x444aed}});}export async function getBffScriptStatistics(_0x1b49d3){const _0x503886=a158_0x2ac6,_0x4e583a=await apiRequest(_0x503886(0x1c2)+_0x1b49d3);return extractList(_0x4e583a['data']);}export async function clearBffScriptCache(){const _0x43d948=a158_0x2ac6,_0x5c2f07=await apiRequest(_0x43d948(0x15d),{'method':_0x43d948(0x20d),'useRuntime':!![]});return typeof _0x5c2f07['data']===_0x43d948(0x1cb)?_0x5c2f07[_0x43d948(0x176)]:'';}export async function listBffDatasetOperations(_0x9f1544,_0xfbfb){const _0x4a4584=a158_0x2ac6,_0x5b6af3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x4a4584(0x20d),'body':{'appCode':_0x9f1544,'datasetId':_0xfbfb}});return _0x5b6af3['data'];}export async function listSqlQueries(_0x404fb6,_0xaf02c8){const _0x5bc871=a158_0x2ac6,_0x15126e=await apiRequest(_0x5bc871(0x209),{'method':_0x5bc871(0x20d),'body':{'appCode':_0x404fb6,'currentPage':_0xaf02c8?.[_0x5bc871(0x203)]??0x1,'pageSize':_0xaf02c8?.[_0x5bc871(0x164)]??0x32,'sqlCode':_0xaf02c8?.[_0x5bc871(0x196)],'sqlName':_0xaf02c8?.['sqlName']}});return _0x15126e[_0x5bc871(0x176)];}export async function getSqlQueryInfo(_0x436588,_0x2f77e6){const _0x8a880d=await listSqlQueries(_0x436588,{'sqlCode':_0x2f77e6}),_0x5be467=_0x8a880d['tableData']?.[0x0];if(!_0x5be467)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x2f77e6);return _0x5be467;}export async function getSqlQueryDetail(_0x1cce45){const _0x217953=a158_0x2ac6,_0x5811ac=await apiRequest(_0x217953(0x1ab)+(_0x217953(0x1d6)+encodeURIComponent(_0x1cce45)));if(!_0x5811ac['data'])throw CliErrors['validation'](_0x217953(0x1df)+_0x1cce45);return _0x5811ac['data'];}export async function getSqlQueryDetailById(_0x32a3f3){const _0x142c21=a158_0x2ac6,_0x9444ab=await apiRequest(_0x142c21(0x1b5)+_0x32a3f3);if(!_0x9444ab['data'])throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20id='+_0x32a3f3);return _0x9444ab['data'];}export async function createSqlQuery(_0x5e2f29){const _0x402159=a158_0x2ac6,_0x17a71c=await apiRequest(_0x402159(0x1f9),{'method':_0x402159(0x20d),'body':_0x5e2f29}),{id:_0x2e2961,entity:_0x3c2b3e}=normalizeEntityWithIdResponse(_0x17a71c[_0x402159(0x176)]);if(!('sqlCode'in _0x3c2b3e)&&_0x2e2961)return getSqlQueryDetailById(_0x2e2961);return normalizeSqlQueryEntity(_0x3c2b3e);}export async function updateSqlQuery(_0x2467bd){const _0x4da778=a158_0x2ac6,_0x531ce8=await apiRequest(_0x4da778(0x1e0),{'method':'POST','body':_0x2467bd}),{id:_0x42d4a1,entity:_0xd4dc2e}=normalizeEntityWithIdResponse(_0x531ce8[_0x4da778(0x176)]);if(!(_0x4da778(0x196)in _0xd4dc2e)){if(_0x2467bd[_0x4da778(0x196)])return getSqlQueryDetail(_0x2467bd[_0x4da778(0x196)]);if(_0x42d4a1)return getSqlQueryDetailById(_0x42d4a1);}return normalizeSqlQueryEntity(_0xd4dc2e);}export async function deleteSqlQuery(_0x5206cb){const _0xb76106=a158_0x2ac6;await apiRequest(_0xb76106(0x161),{'method':_0xb76106(0x20d),'body':_0x5206cb});}export async function saveSqlQuery(_0x4bdad5){const _0x2c974b=a158_0x2ac6,_0x418ad5=await apiRequest(_0x2c974b(0x17b),{'method':'POST','body':_0x4bdad5});return _0x418ad5['data'];}function normalizeSqlQueryEntity(_0x5c9aec){const _0x3e0b27=a158_0x2ac6;return{..._0x5c9aec,'id':Number(_0x5c9aec['id']),'dbId':_0x5c9aec['dbId']==null?undefined:Number(_0x5c9aec['dbId']),'version':_0x5c9aec['version']==null?undefined:Number(_0x5c9aec[_0x3e0b27(0x1b1)])};}export async function executeSql(_0x5d5a33,_0x114d01,_0xe08f2c){const _0x410cdc=a158_0x2ac6,_0x32fb0c=await apiRequest(_0x410cdc(0x1a7),{'method':'POST','body':{'appCode':_0x5d5a33,'sqlCode':_0x114d01,..._0xe08f2c&&{'params':_0xe08f2c}},'useRuntime':!![]});return _0x32fb0c[_0x410cdc(0x176)];}export async function executeDatasetDataOperation(_0x1a0f74,_0x5ce6e6,_0x6cd2ce,_0x5264ca={}){const _0x336fd8=a158_0x2ac6;try{const _0x585639=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+'/'+_0x6cd2ce,{'method':_0x336fd8(0x20d),'body':_0x5264ca,'useRuntime':!![]});return _0x585639[_0x336fd8(0x176)];}catch(_0x3ba6f0){if(_0x6cd2ce===_0x336fd8(0x1ec)&&_0x3ba6f0 instanceof CliError&&_0x3ba6f0[_0x336fd8(0x207)]===_0x336fd8(0x18f)&&_0x5264ca['id']!==undefined&&_0x5264ca['id']!==null&&_0x5264ca['id']!==''){const _0x1528f2=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+_0x336fd8(0x1a8),{'method':'POST','body':{'where':{'id':{'$eq':_0x5264ca['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x10cd2c=Array[_0x336fd8(0x187)](_0x1528f2[_0x336fd8(0x176)]?.[_0x336fd8(0x179)])?_0x1528f2[_0x336fd8(0x176)][_0x336fd8(0x179)]:[];return _0x10cd2c[0x0]??null;}throw _0x3ba6f0;}}export async function listDatasets(_0x55cafc,_0x402bdb){const _0xa71644=a158_0x2ac6,_0x2b234c={'appCode':_0x55cafc,'deleted':_0x402bdb?.[_0xa71644(0x1e5)]??![]};if(_0x402bdb?.[_0xa71644(0x207)])_0x2b234c[_0xa71644(0x207)]=_0x402bdb[_0xa71644(0x207)];if(_0x402bdb?.[_0xa71644(0x1c0)])_0x2b234c[_0xa71644(0x1c0)]=_0x402bdb['name'];const _0x15348b=await apiRequest(_0xa71644(0x1b0),{'method':_0xa71644(0x20d),'body':_0x2b234c});return extractList(_0x15348b[_0xa71644(0x176)]);}export async function deleteDataset(_0x201375,_0x4ba44c){await apiRequest('/smartapi/dataset/delete-dataset',{'method':'POST','body':{'appCode':_0x201375,'datasetId':_0x4ba44c}});}export async function restoreDataset(_0x5e2336,_0x5e6279){const _0x8123ad=a158_0x2ac6;await apiRequest(_0x8123ad(0x1b2),{'method':_0x8123ad(0x20d),'body':{'appCode':_0x5e2336,'datasetId':_0x5e6279}});}export async function previewTextGeneratedDataset(_0x1ccbf2,_0x3b79ff){const _0x13a95e=a158_0x2ac6,_0x47f7fb=await apiRequest(_0x13a95e(0x193),{'method':_0x13a95e(0x20d),'body':{'appCode':_0x1ccbf2,'datasetName':_0x3b79ff[_0x13a95e(0x19c)],'requirementDescription':_0x3b79ff[_0x13a95e(0x1e8)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x47f7fb['data'];}export async function startTextGeneratedDataset(_0x21f3aa,_0x3afda3,_0x4621aa){const _0x1c05bb=a158_0x2ac6,_0x5e8fb2=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0x1c05bb(0x20d),'body':{'appCode':_0x21f3aa,..._0x4621aa?.['clientOperationId']?{'clientOperationId':_0x4621aa[_0x1c05bb(0x1c5)]}:{},'design':_0x3afda3},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5e8fb2[_0x1c05bb(0x176)];}export async function getTextGeneratedDatasetStatus(_0x2f9b07,_0x5942b4){const _0x43151d=a158_0x2ac6,_0x1d680e=new URLSearchParams({'appCode':_0x2f9b07});_0x5942b4[_0x43151d(0x171)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x171),_0x5942b4[_0x43151d(0x171)]);_0x5942b4[_0x43151d(0x1c5)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x1c5),_0x5942b4['clientOperationId']);const _0x32915e=await apiRequest(_0x43151d(0x208)+_0x1d680e[_0x43151d(0x1b6)]());return _0x32915e[_0x43151d(0x176)];}export async function searchDatasets(_0x4e8305,_0x399334){const _0x45a2b5=a158_0x2ac6,_0xe648c=await listDatasets(_0x4e8305,{'name':_0x399334}),_0x115b4e=_0x399334[_0x45a2b5(0x19d)](),_0x2d7990=new Set(_0xe648c[_0x45a2b5(0x186)](_0x3ce7aa=>_0x3ce7aa['id'])),_0x1c2831=_0xe648c[_0x45a2b5(0x1f0)](_0x5da7a2=>_0x5da7a2['dbtableConfig']?.['tableName']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)||_0x5da7a2['description']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)),_0x275159=await listDatasets(_0x4e8305,{'code':_0x399334});for(const _0x436b53 of _0x275159){!_0x2d7990[_0x45a2b5(0x183)](_0x436b53['id'])&&(_0xe648c[_0x45a2b5(0x185)](_0x436b53),_0x2d7990[_0x45a2b5(0x20c)](_0x436b53['id']));}return _0xe648c;}export function normalizeDatasetOperations(_0x3748e6){const _0x5c266f=a158_0x2ac6;if(Array[_0x5c266f(0x187)](_0x3748e6))return _0x3748e6[_0x5c266f(0x1f0)](_0x55bbe1=>_0x55bbe1!=null&&typeof _0x55bbe1===_0x5c266f(0x188));if(_0x3748e6&&typeof _0x3748e6===_0x5c266f(0x188))return Object[_0x5c266f(0x1fd)](_0x3748e6)['filter'](([,_0x572ab5])=>_0x572ab5!=null&&typeof _0x572ab5===_0x5c266f(0x188))[_0x5c266f(0x186)](([_0x284ab3,_0x1df8d6])=>({..._0x1df8d6,'name':_0x1df8d6[_0x5c266f(0x1c0)]??_0x1df8d6[_0x5c266f(0x18c)]??_0x284ab3}));return[];}export async function getDatasetDetail(_0xc19e4c){const _0xf1d975=/^\d+$/['test'](_0xc19e4c)?'id':'code',_0x4d5f18=await apiRequest('/smartapi/dataset/get-driven-data?'+_0xf1d975+'='+_0xc19e4c);return _0x4d5f18['data'];}export async function updateDrivenData(_0xc01d38){const _0x2a5620=a158_0x2ac6,_0xa975c1=await apiRequest(_0x2a5620(0x17e),{'method':_0x2a5620(0x20d),'body':_0xc01d38});return _0xa975c1[_0x2a5620(0x176)];}export async function getDatasetOperations(_0x43e356){const _0xf4b705=a158_0x2ac6,_0x8bd226=await getDatasetDetail(_0x43e356),_0x160aa7=normalizeDatasetOperations(_0x8bd226['operations'])[_0xf4b705(0x186)](_0x134bd6=>({'name':_0x134bd6[_0xf4b705(0x1c0)]||_0x134bd6[_0xf4b705(0x18c)],'displayName':_0x134bd6[_0xf4b705(0x192)]||_0x134bd6[_0xf4b705(0x1c0)],'type':_0x134bd6[_0xf4b705(0x1cf)],'method':_0x134bd6['method'],'path':_0x134bd6['path'],'enabled':_0x134bd6[_0xf4b705(0x1f5)]??!![],'requestFields':_0x134bd6['requestFields'],'responseFields':_0x134bd6[_0xf4b705(0x1f8)]}));return{'dataset':{'id':_0x8bd226['id']??_0x8bd226[_0xf4b705(0x1a4)],'name':_0x8bd226[_0xf4b705(0x1c0)],'code':_0x8bd226[_0xf4b705(0x207)]||_0x8bd226[_0xf4b705(0x175)],'tableName':_0x8bd226[_0xf4b705(0x1b4)]||_0x8bd226[_0xf4b705(0x1fe)]?.['tableName']},'operations':_0x160aa7};}export async function getOperationDetail(_0xcbf196,_0x58f441,_0x52f855){const _0x34512a=a158_0x2ac6;let _0x47a78f=_0x58f441;if(!/^\d+$/['test'](_0x58f441)){const _0x4ba719=await listDatasets(_0xcbf196,{'code':_0x58f441}),_0x21a3ac=_0x4ba719[_0x34512a(0x1f3)](_0x4887bd=>_0x4887bd[_0x34512a(0x207)]===_0x58f441||String(_0x4887bd['id'])===_0x58f441);if(!_0x21a3ac)throw CliErrors[_0x34512a(0x170)](_0x34512a(0x18a)+_0x58f441);_0x47a78f=String(_0x21a3ac['id']);}const _0x352fd4=await getDatasetDetail(_0x47a78f),_0x3be59a=normalizeDatasetOperations(_0x352fd4[_0x34512a(0x173)])[_0x34512a(0x1f3)](_0x420bb7=>(_0x420bb7[_0x34512a(0x1c0)]||_0x420bb7[_0x34512a(0x18c)])===_0x52f855);if(!_0x3be59a)throw CliErrors[_0x34512a(0x170)]('Operation\x20\x22'+_0x52f855+_0x34512a(0x1b7)+_0x58f441);return{'dataset':{'id':_0x352fd4['id']??_0x352fd4[_0x34512a(0x1a4)],'name':_0x352fd4[_0x34512a(0x1c0)],'code':_0x352fd4['code']||_0x352fd4[_0x34512a(0x175)],'tableName':_0x352fd4[_0x34512a(0x1b4)]||_0x352fd4['dbtableConfig']?.[_0x34512a(0x1b4)]},'operation':_0x3be59a};}export async function startGenerateStandardPages(_0x206987,_0xd38cc5,_0x5c035f){const _0x1c2e69=a158_0x2ac6,_0x4c5c3b=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd38cc5+_0x1c2e69(0x15e),{'method':_0x1c2e69(0x20d),'body':{'appCode':_0x206987,..._0x5c035f?.[_0x1c2e69(0x1c5)]?{'clientOperationId':_0x5c035f[_0x1c2e69(0x1c5)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4c5c3b[_0x1c2e69(0x176)];}export async function getGenerateStandardPagesStatus(_0x46d703,_0x3d7dcc,_0x519ccc){const _0x5b3ce0=a158_0x2ac6,_0x1fdccb=new URLSearchParams({'appCode':_0x46d703});_0x519ccc['operationId']&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x171),_0x519ccc[_0x5b3ce0(0x171)]);_0x519ccc[_0x5b3ce0(0x1c5)]&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x1c5),_0x519ccc[_0x5b3ce0(0x1c5)]);const _0x4af11a=await apiRequest(_0x5b3ce0(0x166)+_0x3d7dcc+'/generate-standard-pages/status?'+_0x1fdccb['toString']());return _0x4af11a[_0x5b3ce0(0x176)];}export async function getStandardPageStatus(_0x24b9c6,_0x5b31dc){const _0x15c71d=a158_0x2ac6,_0x5cbd63=await apiRequest(_0x15c71d(0x166)+_0x5b31dc+_0x15c71d(0x1f4)+encodeURIComponent(_0x24b9c6));return _0x5cbd63['data'];}export async function tryGetStandardPageStatus(_0x2f221d,_0x476d19){const _0x1777e8=a158_0x2ac6;try{return await getStandardPageStatus(_0x2f221d,_0x476d19);}catch(_0x22b948){if(_0x22b948 instanceof CliError&&_0x22b948['code']===_0x1777e8(0x18f)&&/404|not found|non-json response/i['test'](_0x22b948[_0x1777e8(0x1b9)]))return null;throw _0x22b948;}}export async function syncStandardPages(_0xa79eaa,_0x246d80){const _0x2ed160=a158_0x2ac6,_0x4fb293=await apiRequest('/smartapi/lovrabet/dataset/'+_0x246d80+_0x2ed160(0x16b),{'method':_0x2ed160(0x20d),'body':{'appCode':_0xa79eaa}});return _0x4fb293['data'];}export async function getPageDetail(_0x1c24e2){const _0x56ba70=a158_0x2ac6,_0x43dfb1=await apiRequest(_0x56ba70(0x1c6)+_0x1c24e2);if(!_0x43dfb1[_0x56ba70(0x176)])throw CliErrors[_0x56ba70(0x170)](_0x56ba70(0x1cd)+_0x1c24e2);return _0x43dfb1['data'];}export async function updatePage(_0x17e0bc,_0x162f4a,_0x19ebcd,_0x1da360){const _0xe258cd=a158_0x2ac6,_0x54524e=await apiRequest(_0xe258cd(0x1ca),{'method':_0xe258cd(0x20d),'body':{'appCode':_0x17e0bc,'pageId':_0x162f4a,'code':_0x19ebcd,'datasetIds':_0x1da360}});return _0x54524e['data'];}export function generateSdkCode(_0x30606b,_0x52bc4c,_0x1ba917){const _0x1a9ef3=a158_0x2ac6,_0x9eeb55=_0x1ba917?.[_0x1a9ef3(0x1fc)]??!![],_0x1c8d41='dataset_'+_0x30606b['code']?.[_0x1a9ef3(0x19e)](/-/g,'_'),_0x1c13b0=_0x52bc4c[_0x1a9ef3(0x1c0)]||_0x52bc4c['operationName']||_0x1a9ef3(0x1f0),_0x465e6c=[];_0x9eeb55&&_0x465e6c['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1a9ef3(0x1e4),'');_0x465e6c['push']('//\x20'+_0x30606b['name']+'\x20('+(_0x30606b[_0x1a9ef3(0x1b4)]||_0x1a9ef3(0x191))+')');if(_0x1c13b0===_0x1a9ef3(0x1f0))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.filter({','\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x1a9ef3(0x1f2),_0x1a9ef3(0x206));else{if(_0x1c13b0===_0x1a9ef3(0x1ec))_0x465e6c[_0x1a9ef3(0x185)]('const\x20result\x20=\x20await\x20client.models.'+_0x1c8d41+'.getOne(id);');else{if(_0x1c13b0===_0x1a9ef3(0x1e7))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1d5));else{if(_0x1c13b0===_0x1a9ef3(0x180))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x17a));else _0x1c13b0===_0x1a9ef3(0x15c)||_0x1c13b0===_0x1a9ef3(0x162)?_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1c1)):_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.'+_0x1c13b0+_0x1a9ef3(0x18d));}}}return _0x465e6c[_0x1a9ef3(0x197)]('\x0a');}export function generateSqlCodeTemplate(_0x1ab6b8,_0x58fc89){const _0x319b52=a158_0x2ac6,_0x8e224a=_0x58fc89?.[_0x319b52(0x1a1)]??_0x319b52(0x172),_0x5578f4=_0x58fc89?.[_0x319b52(0x1fc)]??!![],_0x279d67=[];return _0x279d67[_0x319b52(0x185)](_0x319b52(0x1dc)+_0x1ab6b8[_0x319b52(0x202)]+'\x20('+_0x1ab6b8[_0x319b52(0x196)]+')'),_0x8e224a===_0x319b52(0x172)?(_0x5578f4&&_0x279d67[_0x319b52(0x185)](_0x319b52(0x1d4),'',_0x319b52(0x1e4),''),_0x279d67[_0x319b52(0x185)](_0x319b52(0x19f),_0x319b52(0x1ac)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e9),_0x319b52(0x206),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x319b52(0x1ef))):_0x279d67[_0x319b52(0x185)](_0x319b52(0x205),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x319b52(0x1e2)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e6),_0x319b52(0x1ad),_0x319b52(0x1c3),'}'),_0x279d67[_0x319b52(0x197)]('\x0a');}export async function getErConfig(_0x2fb5f1,_0xf868d8){const _0x5571ba=a158_0x2ac6,_0x436eee=await apiRequest(_0x5571ba(0x1bd),{'method':_0x5571ba(0x20d),'body':{'appCode':_0x2fb5f1,'dblinkId':_0xf868d8},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x436eee[_0x5571ba(0x176)];}export async function createErRelation(_0x319523){const _0x794912=a158_0x2ac6,_0x15f434=await apiRequest(_0x794912(0x1bf),{'method':_0x794912(0x20d),'body':_0x319523,'allowNonJsonSuccess':!![]});return _0x15f434[_0x794912(0x176)];}function a158_0x2ac6(_0x11a3c1,_0x3aa6b4){_0x11a3c1=_0x11a3c1-0x15c;const _0x47d1b4=a158_0x47d1();let _0x2ac6dd=_0x47d1b4[_0x11a3c1];return _0x2ac6dd;}export async function updateErRelation(_0x386ccd){const _0x26adbc=a158_0x2ac6,_0x349f2f=await apiRequest(_0x26adbc(0x1a5),{'method':_0x26adbc(0x20d),'body':_0x386ccd,'allowNonJsonSuccess':!![]});return _0x349f2f[_0x26adbc(0x176)];}export async function deleteErRelation(_0x4d22d3){const _0x1b911a=a158_0x2ac6,_0x4cb744=await apiRequest(_0x1b911a(0x20f),{'method':_0x1b911a(0x20d),'body':_0x4d22d3,'allowNonJsonSuccess':!![]});return _0x4cb744[_0x1b911a(0x176)];}export async function updateErBusinessGroup(_0x269ee7){const _0x1e8fde=a158_0x2ac6,_0x5e73d0=await apiRequest(_0x1e8fde(0x1ba),{'method':_0x1e8fde(0x20d),'body':_0x269ee7,'allowNonJsonSuccess':!![]});return _0x5e73d0[_0x1e8fde(0x176)];}function buildQuery(_0x4a76d8){const _0xc6f23c=a158_0x2ac6,_0x2bb9ad=new URLSearchParams();for(const [_0x23e4b7,_0x1f4730]of Object['entries'](_0x4a76d8)){if(_0x1f4730===undefined||_0x1f4730==='')continue;_0x2bb9ad['set'](_0x23e4b7,String(_0x1f4730));}const _0x49992a=_0x2bb9ad[_0xc6f23c(0x1b6)]();return _0x49992a?'?'+_0x49992a:'';}export async function listAppConfigs(_0x44857f,_0x4708c3){const _0x18a370=a158_0x2ac6,_0x181202=await apiRequest(_0x18a370(0x1af),{'method':'POST','body':{'appCode':_0x44857f,..._0x4708c3?.[_0x18a370(0x1be)]?{'key':_0x4708c3[_0x18a370(0x1be)]}:{},..._0x4708c3?.[_0x18a370(0x184)]?{'tags':_0x4708c3[_0x18a370(0x184)]}:{}}});return extractAppConfigList(_0x181202[_0x18a370(0x176)]);}export async function getAppConfigByKey(_0x2b2c2b,_0x47f279){const _0x155501=a158_0x2ac6,_0x263d96=await apiRequest(_0x155501(0x1b3)+buildQuery({'appCode':_0x2b2c2b,'key':_0x47f279}));return _0x263d96[_0x155501(0x176)]??null;}export async function createAppConfig(_0x45261f){const _0x283ceb=a158_0x2ac6,_0x5eac3b=await apiRequest(_0x283ceb(0x1e3),{'method':'POST','body':{'appCode':_0x45261f[_0x283ceb(0x178)],'key':_0x45261f[_0x283ceb(0x1be)],'value':_0x45261f[_0x283ceb(0x16c)],..._0x45261f['tags']?{'tags':_0x45261f[_0x283ceb(0x184)]}:{}}});return _0x5eac3b['data'];}export async function updateAppConfig(_0x50ca4c){const _0x320bd0=a158_0x2ac6;await apiRequest(_0x320bd0(0x20e),{'method':_0x320bd0(0x20d),'body':{'id':_0x50ca4c['id'],'appCode':_0x50ca4c[_0x320bd0(0x178)],'key':_0x50ca4c[_0x320bd0(0x1be)],'value':_0x50ca4c[_0x320bd0(0x16c)],..._0x50ca4c[_0x320bd0(0x184)]?{'tags':_0x50ca4c[_0x320bd0(0x184)]}:{}}});}export async function deleteAppConfig(_0x229330){const _0x4ef98d=a158_0x2ac6;await apiRequest(_0x4ef98d(0x169),{'method':_0x4ef98d(0x20d),'body':_0x229330});}function extractAppConfigList(_0x45d6a1){const _0x1c466b=a158_0x2ac6;if(Array[_0x1c466b(0x187)](_0x45d6a1))return _0x45d6a1;if(_0x45d6a1&&typeof _0x45d6a1==='object'&&Array[_0x1c466b(0x187)](_0x45d6a1['list']))return _0x45d6a1[_0x1c466b(0x163)];return extractList(_0x45d6a1);}export async function listDbLinks(_0x421c0c,_0x1e24ac){const _0x243f70=a158_0x2ac6,_0x5da423=await apiRequest(_0x243f70(0x194),{'method':_0x243f70(0x20d),'body':{'appCode':_0x421c0c,'currentPage':_0x1e24ac?.[_0x243f70(0x203)]??0x1,'pageSize':_0x1e24ac?.[_0x243f70(0x164)]??0x64}});return{'items':extractList(_0x5da423[_0x243f70(0x176)]),'paging':extractPaging(_0x5da423['data'])};}export async function getDbLinkInfo(_0x2e50ee){const _0x241899=a158_0x2ac6,_0x4e892a=await apiRequest(_0x241899(0x15f)+buildQuery({'id':_0x2e50ee}));return _0x4e892a['data'];}export async function createDbLink(_0x306418){const _0x28d1e4=a158_0x2ac6,_0x2bb899=await apiRequest(_0x28d1e4(0x200),{'method':_0x28d1e4(0x20d),'body':_0x306418});return _0x2bb899[_0x28d1e4(0x176)];}export async function updateDbLink(_0x5cf36d){const _0x5b8a84=a158_0x2ac6,_0x5e70f1=await apiRequest(_0x5b8a84(0x1f7),{'method':'POST','body':_0x5cf36d});return _0x5e70f1['data'];}export async function deleteDbLink(_0x5029c7){const _0x2062c5=a158_0x2ac6;await apiRequest(_0x2062c5(0x182),{'method':_0x2062c5(0x20d),'body':{'id':_0x5029c7}});}export async function testDbLinkConnect(_0x1c7d2d){const _0x2b19f7=a158_0x2ac6,_0x1942e9=await apiRequest(_0x2b19f7(0x17f)+buildQuery({'id':_0x1c7d2d}));return _0x1942e9[_0x2b19f7(0x176)];}export async function startDbAnalysis(_0x117834,_0x1b4d8b){const _0x2003ce=a158_0x2ac6,_0x3d4d27=await apiRequest('/smartapi/db-analysis/start',{'method':_0x2003ce(0x20d),'body':{'dbLinkId':_0x117834,..._0x1b4d8b&&_0x1b4d8b[_0x2003ce(0x1bc)]>0x0?{'tableNames':_0x1b4d8b}:{}}}),_0x38a5b0=_0x3d4d27[_0x2003ce(0x176)];if(typeof _0x38a5b0===_0x2003ce(0x1cb))return _0x38a5b0;if(_0x38a5b0&&typeof _0x38a5b0===_0x2003ce(0x188)&&typeof _0x38a5b0[_0x2003ce(0x167)]===_0x2003ce(0x1cb))return _0x38a5b0[_0x2003ce(0x167)];return _0x38a5b0!=null?String(_0x38a5b0):'';}export async function cancelDbAnalysis(_0xb218d){const _0x560b22=a158_0x2ac6;await apiRequest(_0x560b22(0x204)+buildQuery({'planId':_0xb218d}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x3c5d91){const _0x3ebaf6=a158_0x2ac6,_0x29794b=await apiRequest(_0x3ebaf6(0x1d2)+encodeURIComponent(_0x3c5d91));return _0x29794b[_0x3ebaf6(0x176)];}export async function getDbAllTableList(_0xe354ae,_0x5edd3b){const _0x373b20=a158_0x2ac6,_0x4522db=await apiRequest(_0x373b20(0x168)+buildQuery({'appCode':_0xe354ae,'dbLinkId':_0x5edd3b})),_0x3a6330=_0x4522db[_0x373b20(0x176)];if(Array[_0x373b20(0x187)](_0x3a6330))return _0x3a6330;return extractList(_0x3a6330);}export async function getDbTableDiff(_0x53ab2d,_0x134bb5,_0x20ed43){const _0x4d15e=a158_0x2ac6,_0x3597f3=await apiRequest(_0x4d15e(0x189)+buildQuery({'appCode':_0x53ab2d,'dbLinkId':_0x134bb5,'pageIndex':_0x20ed43?.['pageIndex']??0x1,'pageSize':_0x20ed43?.[_0x4d15e(0x164)]??0x14,'tableName':_0x20ed43?.[_0x4d15e(0x1b4)]})),_0x541666=_0x3597f3[_0x4d15e(0x176)];return{'totalCount':_0x541666?.[_0x4d15e(0x165)]??0x0,'physicalTableCount':_0x541666?.['physicalTableCount']??0x0,'datasetTableCount':_0x541666?.['datasetTableCount']??0x0,..._0x541666?.[_0x4d15e(0x18e)]?{'summary':_0x541666['summary']}:{},'tableList':Array[_0x4d15e(0x187)](_0x541666?.['tableList'])?_0x541666['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x241c58=a158_0x2ac6,_0x5d6a86=await apiRequest(_0x241c58(0x1dd),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x196df6=extractList(_0x5d6a86[_0x241c58(0x176)]),_0x55ea50=extractPaging(_0x5d6a86[_0x241c58(0x176)]);return _0x55ea50&&_0x55ea50[_0x241c58(0x165)]>REMOTE_APP_PAGE_SIZE&&console[_0x241c58(0x1aa)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x55ea50[_0x241c58(0x165)]+_0x241c58(0x1a3)+_0x241c58(0x1c4)),_0x196df6;}
@@ -1 +1 @@
1
- const a160_0xb01192=a160_0x4b46;(function(_0x3ae713,_0x242650){const _0x42fcc5=a160_0x4b46,_0x50ef00=_0x3ae713();while(!![]){try{const _0x46112b=parseInt(_0x42fcc5(0x1f0))/0x1+parseInt(_0x42fcc5(0x1fb))/0x2+-parseInt(_0x42fcc5(0x1f3))/0x3*(parseInt(_0x42fcc5(0x1fa))/0x4)+parseInt(_0x42fcc5(0x1f5))/0x5+parseInt(_0x42fcc5(0x1fd))/0x6+-parseInt(_0x42fcc5(0x1f7))/0x7*(-parseInt(_0x42fcc5(0x1f4))/0x8)+-parseInt(_0x42fcc5(0x1f2))/0x9;if(_0x46112b===_0x242650)break;else _0x50ef00['push'](_0x50ef00['shift']());}catch(_0x38c638){_0x50ef00['push'](_0x50ef00['shift']());}}}(a160_0x5f62,0x85486));function a160_0x4b46(_0x94a87d,_0x1da32f){_0x94a87d=_0x94a87d-0x1f0;const _0x5f621e=a160_0x5f62();let _0x4b46ce=_0x5f621e[_0x94a87d];return _0x4b46ce;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a160_0x5f62(){const _0x21e057=['bff-trash','.rabetbase','17852FBaXRU','1071370CPZPKY','bff','5784822UXFtyf','1058902YCfHJx','bff.lock.json','16872705WnlGeP','729QrmPxU','3704ciEfTB','2801570acnByv','/bff','5838XteMUG'];a160_0x5f62=function(){return _0x21e057;};return a160_0x5f62();}const DOT_DIR=a160_0xb01192(0x1f9),LOCK_FILE_NAME=a160_0xb01192(0x1f1),TRASH_DIR_NAME=a160_0xb01192(0x1f8);export function loadBffProjectConfig(_0x36e7d3,_0x371b59){const _0x437aed=a160_0xb01192,_0x3415c0=resolve(_0x371b59??findProjectRootDirectory()),_0x45a277=DOT_DIR+_0x437aed(0x1f6),_0x425223=_0x45a277+'/'+_0x36e7d3;return{'projectRoot':_0x3415c0,'appCode':_0x36e7d3,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x45a277,'scriptsRoot':_0x425223,'scriptsRootDir':resolve(_0x3415c0,DOT_DIR,_0x437aed(0x1fc),_0x36e7d3),'lockFilePath':resolve(_0x3415c0,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3415c0,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a159_0x4471de=a159_0x36b6;(function(_0x50e789,_0x574ef1){const _0x4dc2f2=a159_0x36b6,_0x3c42c5=_0x50e789();while(!![]){try{const _0x3e0d8b=parseInt(_0x4dc2f2(0x1c2))/0x1+parseInt(_0x4dc2f2(0x1c6))/0x2*(parseInt(_0x4dc2f2(0x1c9))/0x3)+parseInt(_0x4dc2f2(0x1bf))/0x4*(-parseInt(_0x4dc2f2(0x1ca))/0x5)+-parseInt(_0x4dc2f2(0x1c3))/0x6*(parseInt(_0x4dc2f2(0x1c5))/0x7)+-parseInt(_0x4dc2f2(0x1c7))/0x8+parseInt(_0x4dc2f2(0x1c4))/0x9+parseInt(_0x4dc2f2(0x1c8))/0xa;if(_0x3e0d8b===_0x574ef1)break;else _0x3c42c5['push'](_0x3c42c5['shift']());}catch(_0x2f805d){_0x3c42c5['push'](_0x3c42c5['shift']());}}}(a159_0x5500,0x53881));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a159_0x5500(){const _0x1433f4=['/bff','bff.lock.json','547020LLLADf','3907572gxOgVX','1654767ucrtlw','7mUipsL','4meiJcu','582624nrjfYU','3260010UtYACj','508389hHJzPL','25nrJeIs','263660eBzqdl'];a159_0x5500=function(){return _0x1433f4;};return a159_0x5500();}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a159_0x4471de(0x1c1),TRASH_DIR_NAME='bff-trash';function a159_0x36b6(_0x2d8fed,_0x396317){_0x2d8fed=_0x2d8fed-0x1bf;const _0x5500ce=a159_0x5500();let _0x36b677=_0x5500ce[_0x2d8fed];return _0x36b677;}export function loadBffProjectConfig(_0x23b2b6,_0xe07444){const _0x437817=a159_0x4471de,_0x34b9ba=resolve(_0xe07444??findProjectRootDirectory()),_0x4a94c6=DOT_DIR+_0x437817(0x1c0),_0x1efa8f=_0x4a94c6+'/'+_0x23b2b6;return{'projectRoot':_0x34b9ba,'appCode':_0x23b2b6,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4a94c6,'scriptsRoot':_0x1efa8f,'scriptsRootDir':resolve(_0x34b9ba,DOT_DIR,'bff',_0x23b2b6),'lockFilePath':resolve(_0x34b9ba,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x34b9ba,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a161_0x5b96e3=a161_0x2791;(function(_0xdf1223,_0x16d3c8){const _0x2472bb=a161_0x2791,_0x495fb9=_0xdf1223();while(!![]){try{const _0x1c70eb=parseInt(_0x2472bb(0xb7))/0x1*(-parseInt(_0x2472bb(0x95))/0x2)+parseInt(_0x2472bb(0xb9))/0x3*(-parseInt(_0x2472bb(0xa2))/0x4)+parseInt(_0x2472bb(0x9f))/0x5*(-parseInt(_0x2472bb(0xa1))/0x6)+parseInt(_0x2472bb(0xb4))/0x7+-parseInt(_0x2472bb(0xb1))/0x8*(-parseInt(_0x2472bb(0xb2))/0x9)+-parseInt(_0x2472bb(0x9c))/0xa+parseInt(_0x2472bb(0x94))/0xb;if(_0x1c70eb===_0x16d3c8)break;else _0x495fb9['push'](_0x495fb9['shift']());}catch(_0x1387bc){_0x495fb9['push'](_0x495fb9['shift']());}}}(a161_0x219f,0x4c965));import{access,mkdir,readdir,stat}from'node:fs/promises';function a161_0x219f(){const _0x3b8a88=['push','alias','ENOENT','replace','scriptType','F_OK','3890420FeuRHE','map','before','55975QtKOzw','after','336eSZXmY','322732arRgVp','HOOK/','code','afterScriptId','HOOK','operationType','ENDPOINT','includes','isDirectory','split','datasetCode','COMMON','scriptsRootDir','.js','isFile','4766232lIyECt','9ufEknu','get','1641948FXSztR','name','beforeScriptId','101kELsUG','set','6arZUCM','endsWith','10131704qxTeXl','5156BaUZFS'];a161_0x219f=function(){return _0x3b8a88;};return a161_0x219f();}import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a161_0x5b96e3(0xad),a161_0x5b96e3(0xa8),'HOOK'];export function normalizeBffType(_0x2814f8){const _0x26f7b8=a161_0x5b96e3;if(!_0x2814f8)return undefined;const _0x15de9c=_0x2814f8['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x26f7b8(0xa9)](_0x15de9c)?_0x15de9c:undefined;}async function scanJsFilesRecursively(_0x33de6d,_0x40fc7c){const _0x130586=a161_0x5b96e3,_0x176722=[];try{const _0xe9f2a1=await readdir(_0x33de6d,{'withFileTypes':!![]});for(const _0x5a24d2 of _0xe9f2a1){const _0x3e6418=join(_0x33de6d,_0x5a24d2[_0x130586(0xb5)]);if(_0x5a24d2[_0x130586(0xaa)]())_0x176722[_0x130586(0x96)](...await scanJsFilesRecursively(_0x3e6418,_0x40fc7c+'/'+_0x5a24d2[_0x130586(0xb5)]));else _0x5a24d2[_0x130586(0xb0)]()&&_0x5a24d2[_0x130586(0xb5)][_0x130586(0xba)](_0x130586(0xaf))&&_0x176722[_0x130586(0x96)]({'lockKey':_0x40fc7c+'/'+_0x5a24d2['name'][_0x130586(0x99)](/\.js$/,''),'filePath':_0x3e6418});}}catch(_0x1d9f01){if(_0x1d9f01['code']!==_0x130586(0x98))throw _0x1d9f01;}return _0x176722;}function a161_0x2791(_0x4ed7ae,_0x4f5e25){_0x4ed7ae=_0x4ed7ae-0x94;const _0x219f13=a161_0x219f();let _0x279128=_0x219f13[_0x4ed7ae];return _0x279128;}async function scanFlatFunctions(_0x1373ae,_0x109434){const _0x386f01=a161_0x5b96e3,_0x25288b=join(_0x1373ae['scriptsRootDir'],_0x109434),_0x45dd8d=await scanJsFilesRecursively(_0x25288b,_0x109434);return _0x45dd8d[_0x386f01(0x9d)](({lockKey:_0x3a2fab,filePath:_0x4d50ef})=>({'type':_0x109434,'name':_0x3a2fab[_0x386f01(0xab)]('/')['at'](-0x1)??'','filePath':_0x4d50ef,'lockKey':_0x3a2fab}));}async function scanHookFunctions(_0x484153){const _0x5a2c53=a161_0x5b96e3,_0xdb7472=join(_0x484153['scriptsRootDir'],'HOOK'),_0x95abf5=[];try{const _0x21e341=await readdir(_0xdb7472,{'withFileTypes':!![]});for(const _0x445084 of _0x21e341){if(!_0x445084[_0x5a2c53(0xaa)]())continue;const _0x320e43=_0x445084['name'],_0x1cd03e=join(_0xdb7472,_0x320e43),_0x31c198=await readdir(_0x1cd03e,{'withFileTypes':!![]});for(const _0x49d56b of _0x31c198){if(!_0x49d56b[_0x5a2c53(0xaa)]())continue;const _0x487813=_0x49d56b[_0x5a2c53(0xb5)],_0xfdb34b=join(_0x1cd03e,_0x487813),_0x2df590=await readdir(_0xfdb34b,{'withFileTypes':!![]});for(const _0x178d4f of _0x2df590){if(!_0x178d4f[_0x5a2c53(0xaa)]())continue;const _0x10f662=_0x178d4f['name'],_0x93c942=join(_0xfdb34b,_0x10f662),_0x8ad306=await readdir(_0x93c942,{'withFileTypes':!![]});for(const _0x1d3e7c of _0x8ad306){if(!_0x1d3e7c['isFile']()||!_0x1d3e7c[_0x5a2c53(0xb5)][_0x5a2c53(0xba)](_0x5a2c53(0xaf)))continue;const _0x4edfb2=_0x1d3e7c[_0x5a2c53(0xb5)][_0x5a2c53(0x99)](/\.js$/,'');_0x95abf5['push']({'type':_0x5a2c53(0xa6),'name':_0x4edfb2,'filePath':join(_0x93c942,_0x1d3e7c[_0x5a2c53(0xb5)]),'lockKey':'HOOK/'+_0x320e43+'/'+_0x487813+'/'+_0x10f662+'/'+_0x4edfb2,'alias':_0x320e43,'operationType':_0x487813,'functionNode':_0x10f662});}}}}}catch(_0x30f995){if(_0x30f995[_0x5a2c53(0xa4)]!==_0x5a2c53(0x98))throw _0x30f995;}return _0x95abf5;}export async function scanLocalBffFunctions(_0x8a3eba,_0x294311){const _0x130f49=a161_0x5b96e3;if(_0x294311===_0x130f49(0xad)||_0x294311===_0x130f49(0xa8))return scanFlatFunctions(_0x8a3eba,_0x294311);if(_0x294311==='HOOK')return scanHookFunctions(_0x8a3eba);const [_0x89f622,_0x4a7285,_0x7abf9f]=await Promise['all']([scanFlatFunctions(_0x8a3eba,_0x130f49(0xad)),scanFlatFunctions(_0x8a3eba,_0x130f49(0xa8)),scanHookFunctions(_0x8a3eba)]);return[..._0x89f622,..._0x4a7285,..._0x7abf9f];}export function resolveLocalFilePathFromLockKey(_0x3889a1,_0xd9b28b){const _0x7889d9=a161_0x5b96e3;return join(_0x3889a1[_0x7889d9(0xae)],..._0xd9b28b['split']('/'))+_0x7889d9(0xaf);}export function createHookLocationMap(_0x3c1d94){const _0x3ebfc4=a161_0x5b96e3,_0xf8504e=new Map();for(const _0x518e20 of _0x3c1d94){_0x518e20[_0x3ebfc4(0xb6)]&&_0xf8504e[_0x3ebfc4(0xb8)](_0x518e20[_0x3ebfc4(0xb6)],{'datasetCode':_0x518e20[_0x3ebfc4(0xac)],'operationType':snakeToCamel(_0x518e20[_0x3ebfc4(0xa7)]),'functionNode':_0x3ebfc4(0x9e)}),_0x518e20[_0x3ebfc4(0xa5)]&&_0xf8504e[_0x3ebfc4(0xb8)](_0x518e20[_0x3ebfc4(0xa5)],{'datasetCode':_0x518e20[_0x3ebfc4(0xac)],'operationType':snakeToCamel(_0x518e20[_0x3ebfc4(0xa7)]),'functionNode':_0x3ebfc4(0xa0)});}return _0xf8504e;}export function resolveRemoteScriptTarget(_0x502d8b,_0x16646b,_0x6bb373,_0x132cdc,_0x1a9b39){const _0x278a50=a161_0x5b96e3,_0x55c734=normalizeBffType(_0x16646b[_0x278a50(0x9a)]);if(!_0x55c734||!_0x16646b['functionName'])return null;if(_0x55c734===_0x278a50(0xa6)){const _0x1dbe61=(_0x16646b['id']?_0x6bb373[_0x278a50(0xb3)](_0x16646b['id']):undefined)??findHookLocationByRemoteId(_0x132cdc,_0x16646b['id']);if(!_0x1dbe61)return null;const _0x2c5768=_0x1dbe61[_0x278a50(0x97)]||_0x1a9b39['get'](_0x1dbe61[_0x278a50(0xac)]),_0x5488f2=_0x2c5768??_0x1dbe61[_0x278a50(0xac)],_0x239a82={..._0x1dbe61,'alias':_0x2c5768},_0x4edcec=_0x278a50(0xa3)+_0x5488f2+'/'+_0x239a82[_0x278a50(0xa7)]+'/'+_0x239a82['functionNode']+'/'+_0x16646b['functionName'];return{'lockKey':_0x4edcec,'filePath':resolveLocalFilePathFromLockKey(_0x502d8b,_0x4edcec),'type':_0x278a50(0xa6),'hookLocation':_0x239a82};}const _0x11addd=_0x55c734+'/'+_0x16646b['functionName'];return{'lockKey':_0x11addd,'filePath':resolveLocalFilePathFromLockKey(_0x502d8b,_0x11addd),'type':_0x55c734};}export async function ensureParentDirectory(_0x1ea142){await mkdir(dirname(_0x1ea142),{'recursive':!![]});}export async function fileExists(_0xf6ba26){const _0x2a2364=a161_0x5b96e3;try{return await access(_0xf6ba26,constants[_0x2a2364(0x9b)]),!![];}catch{return![];}}export async function directoryExists(_0x5e5843){const _0x5b77b3=a161_0x5b96e3;try{const _0x21cf5d=await stat(_0x5e5843);return _0x21cf5d[_0x5b77b3(0xaa)]();}catch{return![];}}
1
+ const a160_0x201f9b=a160_0x4bac;(function(_0x26d478,_0x5b2470){const _0x4f3236=a160_0x4bac,_0x57ff08=_0x26d478();while(!![]){try{const _0x22954a=-parseInt(_0x4f3236(0xf2))/0x1*(parseInt(_0x4f3236(0xd2))/0x2)+-parseInt(_0x4f3236(0xed))/0x3*(-parseInt(_0x4f3236(0xe5))/0x4)+-parseInt(_0x4f3236(0xf1))/0x5+-parseInt(_0x4f3236(0xd1))/0x6+-parseInt(_0x4f3236(0xe9))/0x7*(parseInt(_0x4f3236(0xef))/0x8)+-parseInt(_0x4f3236(0xdc))/0x9+parseInt(_0x4f3236(0xd3))/0xa;if(_0x22954a===_0x5b2470)break;else _0x57ff08['push'](_0x57ff08['shift']());}catch(_0x51365b){_0x57ff08['push'](_0x57ff08['shift']());}}}(a160_0x47f9,0x2dca4));import{access,mkdir,readdir,stat}from'node:fs/promises';function a160_0x47f9(){const _0x585e27=['ENOENT','112hmrosz','.js','get','beforeScriptId','93VGeUvZ','includes','30128NBspmE','before','520615QFyvXs','9CUeAiF','operationType','push','name','alias','isFile','1544160GekeVf','70494SMhUZb','8129270eJIVjv','map','functionName','functionNode','HOOK','set','datasetCode','F_OK','COMMON','1153044oDJNCl','after','trim','scriptsRootDir','isDirectory','afterScriptId','HOOK/','endsWith','ENDPOINT','31188CrfXFX','replace','code'];a160_0x47f9=function(){return _0x585e27;};return a160_0x47f9();}function a160_0x4bac(_0x19bdb0,_0x39856a){_0x19bdb0=_0x19bdb0-0xd0;const _0x47f9e3=a160_0x47f9();let _0x4bacd9=_0x47f9e3[_0x19bdb0];return _0x4bacd9;}import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a160_0x201f9b(0xdb),a160_0x201f9b(0xe4),a160_0x201f9b(0xd7)];export function normalizeBffType(_0x223c58){const _0x134b6b=a160_0x201f9b;if(!_0x223c58)return undefined;const _0x1bca25=_0x223c58[_0x134b6b(0xde)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x134b6b(0xee)](_0x1bca25)?_0x1bca25:undefined;}async function scanJsFilesRecursively(_0x1f8327,_0x27c47f){const _0x50ce07=a160_0x201f9b,_0x3ba6b4=[];try{const _0xc95ec=await readdir(_0x1f8327,{'withFileTypes':!![]});for(const _0x5727a6 of _0xc95ec){const _0x42a8ff=join(_0x1f8327,_0x5727a6[_0x50ce07(0xf5)]);if(_0x5727a6[_0x50ce07(0xe0)]())_0x3ba6b4['push'](...await scanJsFilesRecursively(_0x42a8ff,_0x27c47f+'/'+_0x5727a6['name']));else _0x5727a6[_0x50ce07(0xd0)]()&&_0x5727a6['name'][_0x50ce07(0xe3)](_0x50ce07(0xea))&&_0x3ba6b4[_0x50ce07(0xf4)]({'lockKey':_0x27c47f+'/'+_0x5727a6[_0x50ce07(0xf5)][_0x50ce07(0xe6)](/\.js$/,''),'filePath':_0x42a8ff});}}catch(_0xf54998){if(_0xf54998[_0x50ce07(0xe7)]!==_0x50ce07(0xe8))throw _0xf54998;}return _0x3ba6b4;}async function scanFlatFunctions(_0x1a2abc,_0x129d76){const _0xe92cb=a160_0x201f9b,_0x259ef0=join(_0x1a2abc[_0xe92cb(0xdf)],_0x129d76),_0x3949ac=await scanJsFilesRecursively(_0x259ef0,_0x129d76);return _0x3949ac[_0xe92cb(0xd4)](({lockKey:_0x33a8cb,filePath:_0x38f504})=>({'type':_0x129d76,'name':_0x33a8cb['split']('/')['at'](-0x1)??'','filePath':_0x38f504,'lockKey':_0x33a8cb}));}async function scanHookFunctions(_0x5c6812){const _0xfecb77=a160_0x201f9b,_0x9f40b=join(_0x5c6812['scriptsRootDir'],'HOOK'),_0x3a1c7d=[];try{const _0x1afe01=await readdir(_0x9f40b,{'withFileTypes':!![]});for(const _0x39ee5a of _0x1afe01){if(!_0x39ee5a[_0xfecb77(0xe0)]())continue;const _0x22898b=_0x39ee5a['name'],_0x2e9761=join(_0x9f40b,_0x22898b),_0x42819b=await readdir(_0x2e9761,{'withFileTypes':!![]});for(const _0x486c87 of _0x42819b){if(!_0x486c87[_0xfecb77(0xe0)]())continue;const _0x4b7147=_0x486c87[_0xfecb77(0xf5)],_0x500cda=join(_0x2e9761,_0x4b7147),_0xb19cd1=await readdir(_0x500cda,{'withFileTypes':!![]});for(const _0x3284ba of _0xb19cd1){if(!_0x3284ba[_0xfecb77(0xe0)]())continue;const _0x4bd902=_0x3284ba[_0xfecb77(0xf5)],_0x3a59ca=join(_0x500cda,_0x4bd902),_0x3502ce=await readdir(_0x3a59ca,{'withFileTypes':!![]});for(const _0x2841f3 of _0x3502ce){if(!_0x2841f3['isFile']()||!_0x2841f3[_0xfecb77(0xf5)]['endsWith']('.js'))continue;const _0x5ef07f=_0x2841f3[_0xfecb77(0xf5)]['replace'](/\.js$/,'');_0x3a1c7d[_0xfecb77(0xf4)]({'type':_0xfecb77(0xd7),'name':_0x5ef07f,'filePath':join(_0x3a59ca,_0x2841f3['name']),'lockKey':'HOOK/'+_0x22898b+'/'+_0x4b7147+'/'+_0x4bd902+'/'+_0x5ef07f,'alias':_0x22898b,'operationType':_0x4b7147,'functionNode':_0x4bd902});}}}}}catch(_0x7c4088){if(_0x7c4088[_0xfecb77(0xe7)]!==_0xfecb77(0xe8))throw _0x7c4088;}return _0x3a1c7d;}export async function scanLocalBffFunctions(_0x390bf3,_0xd874da){const _0x4831dc=a160_0x201f9b;if(_0xd874da===_0x4831dc(0xdb)||_0xd874da===_0x4831dc(0xe4))return scanFlatFunctions(_0x390bf3,_0xd874da);if(_0xd874da===_0x4831dc(0xd7))return scanHookFunctions(_0x390bf3);const [_0x58a965,_0x1c953a,_0x4eef50]=await Promise['all']([scanFlatFunctions(_0x390bf3,_0x4831dc(0xdb)),scanFlatFunctions(_0x390bf3,_0x4831dc(0xe4)),scanHookFunctions(_0x390bf3)]);return[..._0x58a965,..._0x1c953a,..._0x4eef50];}export function resolveLocalFilePathFromLockKey(_0x3de3c3,_0x5a634c){const _0x46a37a=a160_0x201f9b;return join(_0x3de3c3[_0x46a37a(0xdf)],..._0x5a634c['split']('/'))+_0x46a37a(0xea);}export function createHookLocationMap(_0x35a211){const _0x4ab525=a160_0x201f9b,_0x559339=new Map();for(const _0x5b06ee of _0x35a211){_0x5b06ee[_0x4ab525(0xec)]&&_0x559339[_0x4ab525(0xd8)](_0x5b06ee[_0x4ab525(0xec)],{'datasetCode':_0x5b06ee['datasetCode'],'operationType':snakeToCamel(_0x5b06ee['operationType']),'functionNode':_0x4ab525(0xf0)}),_0x5b06ee[_0x4ab525(0xe1)]&&_0x559339[_0x4ab525(0xd8)](_0x5b06ee[_0x4ab525(0xe1)],{'datasetCode':_0x5b06ee[_0x4ab525(0xd9)],'operationType':snakeToCamel(_0x5b06ee[_0x4ab525(0xf3)]),'functionNode':_0x4ab525(0xdd)});}return _0x559339;}export function resolveRemoteScriptTarget(_0x18e4ab,_0x29dba2,_0x4ca87a,_0x1414d9,_0x115ab9){const _0x521bc8=a160_0x201f9b,_0x40ba67=normalizeBffType(_0x29dba2['scriptType']);if(!_0x40ba67||!_0x29dba2[_0x521bc8(0xd5)])return null;if(_0x40ba67===_0x521bc8(0xd7)){const _0x27724d=(_0x29dba2['id']?_0x4ca87a[_0x521bc8(0xeb)](_0x29dba2['id']):undefined)??findHookLocationByRemoteId(_0x1414d9,_0x29dba2['id']);if(!_0x27724d)return null;const _0x11e574=_0x27724d[_0x521bc8(0xf6)]||_0x115ab9[_0x521bc8(0xeb)](_0x27724d[_0x521bc8(0xd9)]),_0x3868ab=_0x11e574??_0x27724d[_0x521bc8(0xd9)],_0x688ba6={..._0x27724d,'alias':_0x11e574},_0x429c4e=_0x521bc8(0xe2)+_0x3868ab+'/'+_0x688ba6[_0x521bc8(0xf3)]+'/'+_0x688ba6[_0x521bc8(0xd6)]+'/'+_0x29dba2[_0x521bc8(0xd5)];return{'lockKey':_0x429c4e,'filePath':resolveLocalFilePathFromLockKey(_0x18e4ab,_0x429c4e),'type':_0x521bc8(0xd7),'hookLocation':_0x688ba6};}const _0x323a79=_0x40ba67+'/'+_0x29dba2[_0x521bc8(0xd5)];return{'lockKey':_0x323a79,'filePath':resolveLocalFilePathFromLockKey(_0x18e4ab,_0x323a79),'type':_0x40ba67};}export async function ensureParentDirectory(_0x4ff998){await mkdir(dirname(_0x4ff998),{'recursive':!![]});}export async function fileExists(_0x4834f8){const _0x46f9a8=a160_0x201f9b;try{return await access(_0x4834f8,constants[_0x46f9a8(0xda)]),!![];}catch{return![];}}export async function directoryExists(_0x507eef){const _0x5b3e01=a160_0x201f9b;try{const _0x39c0f8=await stat(_0x507eef);return _0x39c0f8[_0x5b3e01(0xe0)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2abb10,_0x5d1988){const _0x1d50ee=a162_0x2978,_0x2bb1d4=_0x2abb10();while(!![]){try{const _0x451c0a=parseInt(_0x1d50ee(0xf3))/0x1+parseInt(_0x1d50ee(0xf7))/0x2+-parseInt(_0x1d50ee(0xf9))/0x3+parseInt(_0x1d50ee(0xfd))/0x4+parseInt(_0x1d50ee(0xfc))/0x5+-parseInt(_0x1d50ee(0x100))/0x6*(parseInt(_0x1d50ee(0xf8))/0x7)+parseInt(_0x1d50ee(0xf5))/0x8*(-parseInt(_0x1d50ee(0xf6))/0x9);if(_0x451c0a===_0x5d1988)break;else _0x2bb1d4['push'](_0x2bb1d4['shift']());}catch(_0x48d7c4){_0x2bb1d4['push'](_0x2bb1d4['shift']());}}}(a162_0x59d4,0x2b73c));function a162_0x2978(_0x5e84b6,_0x348129){_0x5e84b6=_0x5e84b6-0xf3;const _0x59d451=a162_0x59d4();let _0x2978ca=_0x59d451[_0x5e84b6];return _0x2978ca;}import{readFile}from'node:fs/promises';import a162_0x47d883 from'node:crypto';function a162_0x59d4(){const _0xc596fd=['43410MFgWbO','1263584bWNxiV','digest','createHash','18huSpZd','103742oxtCWJ','hex','24POrCeI','284049MJfqLN','591792GuDmFr','367143FyDnEG','882618ubJsZa','update','md5'];a162_0x59d4=function(){return _0xc596fd;};return a162_0x59d4();}export function computeContentHash(_0x54ff38){const _0x5e1f1b=a162_0x2978;return a162_0x47d883[_0x5e1f1b(0xff)](_0x5e1f1b(0xfb))[_0x5e1f1b(0xfa)](_0x54ff38)[_0x5e1f1b(0xfe)](_0x5e1f1b(0xf4));}export async function computeFileHash(_0xfa44da){const _0x1ce0ae=await readFile(_0xfa44da,'utf8');return computeContentHash(_0x1ce0ae);}
1
+ (function(_0x51d3e3,_0x6b7634){const _0x4beefc=a161_0x331d,_0x1cb924=_0x51d3e3();while(!![]){try{const _0x2470dc=-parseInt(_0x4beefc(0x177))/0x1+parseInt(_0x4beefc(0x17e))/0x2*(parseInt(_0x4beefc(0x181))/0x3)+parseInt(_0x4beefc(0x180))/0x4+parseInt(_0x4beefc(0x178))/0x5*(parseInt(_0x4beefc(0x17c))/0x6)+parseInt(_0x4beefc(0x179))/0x7+parseInt(_0x4beefc(0x17d))/0x8+-parseInt(_0x4beefc(0x17a))/0x9;if(_0x2470dc===_0x6b7634)break;else _0x1cb924['push'](_0x1cb924['shift']());}catch(_0x2e3e27){_0x1cb924['push'](_0x1cb924['shift']());}}}(a161_0x5adc,0x2826d));import{readFile}from'node:fs/promises';function a161_0x331d(_0x120d3d,_0x1ff36b){_0x120d3d=_0x120d3d-0x177;const _0x5adc4b=a161_0x5adc();let _0x331d4d=_0x5adc4b[_0x120d3d];return _0x331d4d;}import a161_0x4d5ec1 from'node:crypto';function a161_0x5adc(){const _0x1a8a03=['663VQYZca','hex','md5','264428UhlTQq','5apaiiK','633255eTpIfy','2796327tiqzyS','createHash','1818162nalmNZ','149032MvHyrV','236rreYpf','update','1205572lksciE'];a161_0x5adc=function(){return _0x1a8a03;};return a161_0x5adc();}export function computeContentHash(_0x59fa4d){const _0x217027=a161_0x331d;return a161_0x4d5ec1[_0x217027(0x17b)](_0x217027(0x183))[_0x217027(0x17f)](_0x59fa4d)['digest'](_0x217027(0x182));}export async function computeFileHash(_0x38bcba){const _0x5b9041=await readFile(_0x38bcba,'utf8');return computeContentHash(_0x5b9041);}
@@ -1 +1 @@
1
- (function(_0x3010c7,_0x30963c){const _0x18dea9=a163_0x99e6,_0x9eb1e6=_0x3010c7();while(!![]){try{const _0x13761a=-parseInt(_0x18dea9(0x1d3))/0x1*(-parseInt(_0x18dea9(0x1d4))/0x2)+-parseInt(_0x18dea9(0x1cd))/0x3+parseInt(_0x18dea9(0x1cf))/0x4+parseInt(_0x18dea9(0x1d7))/0x5+-parseInt(_0x18dea9(0x1df))/0x6*(-parseInt(_0x18dea9(0x1e2))/0x7)+-parseInt(_0x18dea9(0x1d0))/0x8+-parseInt(_0x18dea9(0x1d6))/0x9;if(_0x13761a===_0x30963c)break;else _0x9eb1e6['push'](_0x9eb1e6['shift']());}catch(_0x4546d6){_0x9eb1e6['push'](_0x9eb1e6['shift']());}}}(a163_0x2c6e,0x41f7d));function a163_0x99e6(_0x486ce2,_0x13c174){_0x486ce2=_0x486ce2-0x1cc;const _0x2c6ea3=a163_0x2c6e();let _0x99e66e=_0x2c6ea3[_0x486ce2];return _0x99e66e;}function a163_0x2c6e(){const _0x35e691=['\x22.\x20','apps','147UcMRzO','current\x20\x22','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','422904GCcAub','functions','1734472rqhgId','2794640hLzprG','\x22\x20vs\x20lock\x20\x22','utf8','7956hVbSQT','30SYGHca','object','3765861KPMsgC','2241675zcshQy','stringify','lastSync','parse',':\x20scriptsRoot\x20mismatch\x20—\x20','scriptsRoot','ENOENT','code','50754bxSOTB'];a163_0x2c6e=function(){return _0x35e691;};return a163_0x2c6e();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x454914,_0x1ce212,_0x55683,_0x911bde){const _0x398e46=a163_0x99e6,_0xd53083={'apps':_0x454914[_0x398e46(0x1e1)]&&typeof _0x454914[_0x398e46(0x1e1)]===_0x398e46(0x1d5)?_0x454914[_0x398e46(0x1e1)]:{}};let _0x1e1c99=_0xd53083['apps'][_0x1ce212];if(!_0x1e1c99)return _0x1e1c99={'scriptsRoot':_0x55683,'lastSync':'','functions':{}},_0xd53083[_0x398e46(0x1e1)][_0x1ce212]=_0x1e1c99,{'lockData':_0xd53083,'appLock':_0x1e1c99};if(!_0x1e1c99[_0x398e46(0x1dc)])_0x1e1c99[_0x398e46(0x1dc)]=_0x55683;else{if(_0x1e1c99[_0x398e46(0x1dc)]!==_0x55683)throw new Error(_0x911bde+_0x398e46(0x1db)+(_0x398e46(0x1e3)+_0x55683+_0x398e46(0x1d1)+_0x1e1c99[_0x398e46(0x1dc)]+_0x398e46(0x1e0))+_0x398e46(0x1cc));}return!_0x1e1c99[_0x398e46(0x1ce)]&&(_0x1e1c99['functions']={}),!_0x1e1c99[_0x398e46(0x1d9)]&&(_0x1e1c99[_0x398e46(0x1d9)]=''),{'lockData':_0xd53083,'appLock':_0x1e1c99};}export async function readBffLockFile(_0x5208b7){const _0x4e91cb=a163_0x99e6;try{const _0x1da702=await readFile(_0x5208b7,_0x4e91cb(0x1d2)),_0x454044=JSON[_0x4e91cb(0x1da)](_0x1da702);return{'apps':_0x454044['apps']&&typeof _0x454044[_0x4e91cb(0x1e1)]===_0x4e91cb(0x1d5)?_0x454044['apps']:{}};}catch(_0x1a7a42){if(_0x1a7a42[_0x4e91cb(0x1de)]===_0x4e91cb(0x1dd))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x1a7a42));}}export async function writeBffLockFile(_0x593f84,_0x5a191d){const _0x314f3d=a163_0x99e6;await mkdir(dirname(_0x593f84),{'recursive':!![]}),await writeFile(_0x593f84,JSON[_0x314f3d(0x1d8)](_0x5a191d,null,0x2),_0x314f3d(0x1d2));}
1
+ (function(_0x39c2dc,_0x4db2ed){const _0x1f1091=a162_0x53e1,_0x3d9094=_0x39c2dc();while(!![]){try{const _0x2618db=-parseInt(_0x1f1091(0x1c9))/0x1+parseInt(_0x1f1091(0x1d0))/0x2+-parseInt(_0x1f1091(0x1c1))/0x3*(-parseInt(_0x1f1091(0x1ce))/0x4)+parseInt(_0x1f1091(0x1c4))/0x5*(parseInt(_0x1f1091(0x1c5))/0x6)+-parseInt(_0x1f1091(0x1d4))/0x7*(-parseInt(_0x1f1091(0x1d1))/0x8)+-parseInt(_0x1f1091(0x1c3))/0x9*(-parseInt(_0x1f1091(0x1bf))/0xa)+-parseInt(_0x1f1091(0x1cd))/0xb;if(_0x2618db===_0x4db2ed)break;else _0x3d9094['push'](_0x3d9094['shift']());}catch(_0x861e0b){_0x3d9094['push'](_0x3d9094['shift']());}}}(a162_0x4a96,0xb1024));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a162_0x53e1(_0x3cccdc,_0x340207){_0x3cccdc=_0x3cccdc-0x1be;const _0x4a96cc=a162_0x4a96();let _0x53e123=_0x4a96cc[_0x3cccdc];return _0x53e123;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x28f71f,_0x51e876,_0x1c671d,_0x5cb159){const _0x597ea4=a162_0x53e1,_0x281e4e={'apps':_0x28f71f[_0x597ea4(0x1cb)]&&typeof _0x28f71f['apps']===_0x597ea4(0x1d5)?_0x28f71f[_0x597ea4(0x1cb)]:{}};let _0xd8730d=_0x281e4e['apps'][_0x51e876];if(!_0xd8730d)return _0xd8730d={'scriptsRoot':_0x1c671d,'lastSync':'','functions':{}},_0x281e4e[_0x597ea4(0x1cb)][_0x51e876]=_0xd8730d,{'lockData':_0x281e4e,'appLock':_0xd8730d};if(!_0xd8730d[_0x597ea4(0x1c2)])_0xd8730d[_0x597ea4(0x1c2)]=_0x1c671d;else{if(_0xd8730d[_0x597ea4(0x1c2)]!==_0x1c671d)throw new Error(_0x5cb159+_0x597ea4(0x1cc)+(_0x597ea4(0x1c6)+_0x1c671d+'\x22\x20vs\x20lock\x20\x22'+_0xd8730d[_0x597ea4(0x1c2)]+_0x597ea4(0x1d3))+_0x597ea4(0x1ca));}return!_0xd8730d['functions']&&(_0xd8730d[_0x597ea4(0x1c8)]={}),!_0xd8730d[_0x597ea4(0x1d2)]&&(_0xd8730d['lastSync']=''),{'lockData':_0x281e4e,'appLock':_0xd8730d};}function a162_0x4a96(){const _0x37008e=['\x22.\x20','21Bdnsne','object','parse','50YebtNv','utf8','218217sZnLAI','scriptsRoot','38349mhoKpN','16190jREFKo','2154ZWFiaG','current\x20\x22','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','functions','1299755OLYxgC','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps',':\x20scriptsRoot\x20mismatch\x20—\x20','24097161IUOxmU','76rGCKMk','code','581802xLttfh','3623320tyckwj','lastSync'];a162_0x4a96=function(){return _0x37008e;};return a162_0x4a96();}export async function readBffLockFile(_0x342564){const _0x30a390=a162_0x53e1;try{const _0x19db5b=await readFile(_0x342564,_0x30a390(0x1c0)),_0x514b43=JSON[_0x30a390(0x1be)](_0x19db5b);return{'apps':_0x514b43[_0x30a390(0x1cb)]&&typeof _0x514b43['apps']===_0x30a390(0x1d5)?_0x514b43[_0x30a390(0x1cb)]:{}};}catch(_0x5a12ab){if(_0x5a12ab[_0x30a390(0x1cf)]==='ENOENT')return null;throw new Error(_0x30a390(0x1c7)+String(_0x5a12ab));}}export async function writeBffLockFile(_0x3fa1bf,_0x279622){const _0x41e3ce=a162_0x53e1;await mkdir(dirname(_0x3fa1bf),{'recursive':!![]}),await writeFile(_0x3fa1bf,JSON['stringify'](_0x279622,null,0x2),_0x41e3ce(0x1c0));}
@@ -1 +1 @@
1
- function a165_0x5e52(_0x153ab0,_0x38a913){_0x153ab0=_0x153ab0-0x15b;const _0x2996aa=a165_0x2996();let _0x5e52f9=_0x2996aa[_0x153ab0];return _0x5e52f9;}function a165_0x2996(){const _0x5d1081=['15249143Cemxdw','4975990lDAXbg','toLowerCase','replace','3780736batqIl','toUpperCase','test','3196302SxVSuP','2071182tzscZV','values','datasetCode','before','967422mOhlEt','727236hxNJjg','trim'];a165_0x2996=function(){return _0x5d1081;};return a165_0x2996();}(function(_0x1eeac4,_0x43ce9c){const _0x5d97c2=a165_0x5e52,_0x4595e3=_0x1eeac4();while(!![]){try{const _0x246c52=parseInt(_0x5d97c2(0x163))/0x1+parseInt(_0x5d97c2(0x15f))/0x2+parseInt(_0x5d97c2(0x15e))/0x3+parseInt(_0x5d97c2(0x15b))/0x4+-parseInt(_0x5d97c2(0x167))/0x5+parseInt(_0x5d97c2(0x164))/0x6+-parseInt(_0x5d97c2(0x166))/0x7;if(_0x246c52===_0x43ce9c)break;else _0x4595e3['push'](_0x4595e3['shift']());}catch(_0x4f3721){_0x4595e3['push'](_0x4595e3['shift']());}}}(a165_0x2996,0xeaaa6));export function snakeToCamel(_0xaaf50d){const _0xdb4244=a165_0x5e52;return _0xaaf50d[_0xdb4244(0x168)]()[_0xdb4244(0x169)](/_([a-z])/g,(_0x7949df,_0x2d73ef)=>_0x2d73ef[_0xdb4244(0x15c)]());}export function findHookLocationByRemoteId(_0x378e08,_0x15d531){const _0x321af7=a165_0x5e52;if(!_0x15d531)return undefined;for(const _0x33d193 of Object[_0x321af7(0x160)](_0x378e08)){if(_0x33d193['remoteId']===_0x15d531&&_0x33d193['datasetCode']&&_0x33d193['operationType']&&_0x33d193['functionNode'])return{'datasetCode':_0x33d193[_0x321af7(0x161)],'operationType':_0x33d193['operationType'],'functionNode':_0x33d193['functionNode']};}return undefined;}export function extractScriptDescription(_0x40f7c8){const _0x47a172=a165_0x5e52,_0x304a6a=_0x40f7c8['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x304a6a?.[0x1]?.[_0x47a172(0x165)]()||undefined;}export function isValidBffFunctionName(_0x3892e9){const _0x18e57c=a165_0x5e52;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x18e57c(0x15d)](_0x3892e9);}export function normalizeHookFunctionNode(_0x1dcdb5){const _0x565375=a165_0x5e52;if(!_0x1dcdb5)return undefined;const _0x421f8a=_0x1dcdb5[_0x565375(0x165)]()['toLowerCase']();if(_0x421f8a===_0x565375(0x162)||_0x421f8a==='after')return _0x421f8a;return undefined;}
1
+ (function(_0x30d946,_0x1c605d){const _0x169963=a164_0x1af3,_0x53ffe4=_0x30d946();while(!![]){try{const _0x129706=parseInt(_0x169963(0x19f))/0x1*(-parseInt(_0x169963(0x1aa))/0x2)+-parseInt(_0x169963(0x1a9))/0x3+-parseInt(_0x169963(0x1af))/0x4+-parseInt(_0x169963(0x19e))/0x5+-parseInt(_0x169963(0x1ad))/0x6*(parseInt(_0x169963(0x1a5))/0x7)+parseInt(_0x169963(0x1a2))/0x8*(parseInt(_0x169963(0x1a6))/0x9)+parseInt(_0x169963(0x1a0))/0xa;if(_0x129706===_0x1c605d)break;else _0x53ffe4['push'](_0x53ffe4['shift']());}catch(_0x5970f6){_0x53ffe4['push'](_0x53ffe4['shift']());}}}(a164_0x35c8,0x41863));function a164_0x1af3(_0x5d1d33,_0x46c953){_0x5d1d33=_0x5d1d33-0x19d;const _0x35c8ef=a164_0x35c8();let _0x1af31f=_0x35c8ef[_0x5d1d33];return _0x1af31f;}export function snakeToCamel(_0x42ce3e){const _0xe44318=a164_0x1af3;return _0x42ce3e[_0xe44318(0x1a4)]()[_0xe44318(0x19d)](/_([a-z])/g,(_0x4246ba,_0x1b0f82)=>_0x1b0f82[_0xe44318(0x1ab)]());}export function findHookLocationByRemoteId(_0x25e2a1,_0x9ca750){const _0x3a7736=a164_0x1af3;if(!_0x9ca750)return undefined;for(const _0x4a6cbd of Object['values'](_0x25e2a1)){if(_0x4a6cbd['remoteId']===_0x9ca750&&_0x4a6cbd[_0x3a7736(0x1ac)]&&_0x4a6cbd['operationType']&&_0x4a6cbd[_0x3a7736(0x1a8)])return{'datasetCode':_0x4a6cbd[_0x3a7736(0x1ac)],'operationType':_0x4a6cbd['operationType'],'functionNode':_0x4a6cbd[_0x3a7736(0x1a8)]};}return undefined;}export function extractScriptDescription(_0x10fba7){const _0x73e1db=a164_0x1af3,_0x290bd0=_0x10fba7[_0x73e1db(0x1a3)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x290bd0?.[0x1]?.[_0x73e1db(0x1ae)]()||undefined;}export function isValidBffFunctionName(_0x224ce4){const _0x1290b7=a164_0x1af3;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x1290b7(0x1a7)](_0x224ce4);}function a164_0x35c8(){const _0x5e088e=['24GpYFzD','trim','781240JXXdqQ','replace','1490825IrcdLH','4Fsjrfa','8881020ZQWKah','before','2472KkdwvA','match','toLowerCase','534324vhqEQQ','11394ZZaIJP','test','functionNode','462726AiPsOr','28932JAjamQ','toUpperCase','datasetCode'];a164_0x35c8=function(){return _0x5e088e;};return a164_0x35c8();}export function normalizeHookFunctionNode(_0x3127e5){const _0x19137=a164_0x1af3;if(!_0x3127e5)return undefined;const _0x125a2c=_0x3127e5['trim']()[_0x19137(0x1a4)]();if(_0x125a2c===_0x19137(0x1a1)||_0x125a2c==='after')return _0x125a2c;return undefined;}
@@ -1 +1 @@
1
- (function(_0x269edd,_0x5bd4da){const _0x1ba81b=a166_0x1368,_0x3d649e=_0x269edd();while(!![]){try{const _0x123c43=-parseInt(_0x1ba81b(0x1bb))/0x1+-parseInt(_0x1ba81b(0x1bd))/0x2+parseInt(_0x1ba81b(0x1ca))/0x3+parseInt(_0x1ba81b(0x1bc))/0x4+-parseInt(_0x1ba81b(0x1b6))/0x5+parseInt(_0x1ba81b(0x1be))/0x6+parseInt(_0x1ba81b(0x1b4))/0x7*(parseInt(_0x1ba81b(0x1c0))/0x8);if(_0x123c43===_0x5bd4da)break;else _0x3d649e['push'](_0x3d649e['shift']());}catch(_0x133c63){_0x3d649e['push'](_0x3d649e['shift']());}}}(a166_0x4f0b,0x77bc7));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x24070e){const _0x590e97=a166_0x1368;if(cache[_0x590e97(0x1c1)](_0x24070e))return cache[_0x590e97(0x1bf)](_0x24070e);const _0x5b7a47=await listDatasets(_0x24070e),_0x31562d=new Map();for(const _0x1f68bd of _0x5b7a47){const _0x16a4e4=_0x1f68bd['dbtableConfig'];_0x16a4e4?.[_0x590e97(0x1c3)]!=null&&_0x31562d['set'](_0x16a4e4['dbId'],_0x16a4e4[_0x590e97(0x1c9)]??'db-'+_0x16a4e4['dbId']);}const _0xe8d4b5=[..._0x31562d[_0x590e97(0x1cf)]()][_0x590e97(0x1ce)](([_0x5736e5,_0x1ccd37])=>({'dbId':_0x5736e5,'dbName':_0x1ccd37}));return cache[_0x590e97(0x1b3)](_0x24070e,_0xe8d4b5),_0xe8d4b5;}function a166_0x4f0b(){const _0x2fd9e7=['map','entries','set','1174663trXAcb','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','875825lnMUiZ','\x22.\x20Available:\x20','\x22\x20matches\x20multiple\x20databases:\x20','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','792132aflRVO','2525832VWHwAG','1892988hMYChE','946536OpqMig','get','32mzyPZT','has','includes','dbId','\x22\x20under\x20app\x20\x22','join','length','No\x20database\x20matching\x20\x22','find','dbName','2831340HNwObN','filter','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','toLowerCase'];a166_0x4f0b=function(){return _0x2fd9e7;};return a166_0x4f0b();}function a166_0x1368(_0x17b3e0,_0x484561){_0x17b3e0=_0x17b3e0-0x1b3;const _0x4f0bff=a166_0x4f0b();let _0x1368a6=_0x4f0bff[_0x17b3e0];return _0x1368a6;}export async function resolveDb(_0x286ec0,_0x141a17){const _0x4a17c3=a166_0x1368,_0x45115f=await listDatabases(_0x286ec0);if(_0x45115f['length']===0x0)return{'resolved':[],'error':_0x4a17c3(0x1ba)+_0x286ec0+_0x4a17c3(0x1cc)};if(!_0x141a17)return{'resolved':_0x45115f};const _0x3dc57b=Number(_0x141a17);if(!Number['isNaN'](_0x3dc57b)){const _0x2b9029=_0x45115f[_0x4a17c3(0x1c8)](_0x5517d5=>_0x5517d5[_0x4a17c3(0x1c3)]===_0x3dc57b);if(_0x2b9029)return{'resolved':[_0x2b9029]};}const _0x41afac=_0x141a17[_0x4a17c3(0x1cd)](),_0x41f0b8=_0x45115f[_0x4a17c3(0x1cb)](_0x4fa72c=>_0x4fa72c[_0x4a17c3(0x1c9)]['toLowerCase']()[_0x4a17c3(0x1c2)](_0x41afac));if(_0x41f0b8[_0x4a17c3(0x1c6)]>0x0)return{'resolved':_0x41f0b8};const _0x108f12=_0x45115f[_0x4a17c3(0x1ce)](_0x3e3c41=>_0x3e3c41[_0x4a17c3(0x1c9)]+'\x20('+_0x3e3c41[_0x4a17c3(0x1c3)]+')')[_0x4a17c3(0x1c5)](',\x20');return{'resolved':[],'error':_0x4a17c3(0x1c7)+_0x141a17+_0x4a17c3(0x1c4)+_0x286ec0+_0x4a17c3(0x1b7)+_0x108f12+_0x4a17c3(0x1b9)};}export async function resolveOneDb(_0x10e615,_0x4f2c9d){const _0x17087d=a166_0x1368,{resolved:_0x452677,error:_0x151566}=await resolveDb(_0x10e615,_0x4f2c9d);if(_0x151566)return{'db':null,'error':_0x151566};if(_0x452677[_0x17087d(0x1c6)]===0x1)return{'db':_0x452677[0x0]};if(!_0x4f2c9d){const _0x570bfd=_0x452677[_0x17087d(0x1ce)](_0x578683=>_0x578683[_0x17087d(0x1c9)]+'\x20('+_0x578683[_0x17087d(0x1c3)]+')')[_0x17087d(0x1c5)](',\x20');return{'db':null,'error':_0x17087d(0x1b5)+_0x570bfd};}const _0x3a29da=_0x452677['map'](_0x1f8f28=>_0x1f8f28['dbName']+'\x20('+_0x1f8f28[_0x17087d(0x1c3)]+')')[_0x17087d(0x1c5)](',\x20');return{'db':null,'error':'\x22'+_0x4f2c9d+_0x17087d(0x1b8)+_0x3a29da+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x2f950e,_0x30ee89){const _0x40d7ed=a166_0x1368,_0x3d9bac=await listDatabases(_0x2f950e);return _0x3d9bac[_0x40d7ed(0x1c8)](_0x22ac74=>_0x22ac74[_0x40d7ed(0x1c3)]===_0x30ee89)?.['dbName'];}
1
+ (function(_0x195331,_0x4831c3){const _0x5252f6=a165_0x3706,_0x296495=_0x195331();while(!![]){try{const _0x1b98fb=-parseInt(_0x5252f6(0xd0))/0x1*(parseInt(_0x5252f6(0xea))/0x2)+parseInt(_0x5252f6(0xe6))/0x3*(parseInt(_0x5252f6(0xe9))/0x4)+parseInt(_0x5252f6(0xd5))/0x5+parseInt(_0x5252f6(0xd4))/0x6+-parseInt(_0x5252f6(0xe0))/0x7*(parseInt(_0x5252f6(0xdc))/0x8)+parseInt(_0x5252f6(0xd3))/0x9+parseInt(_0x5252f6(0xe2))/0xa*(-parseInt(_0x5252f6(0xcf))/0xb);if(_0x1b98fb===_0x4831c3)break;else _0x296495['push'](_0x296495['shift']());}catch(_0xed4887){_0x296495['push'](_0x296495['shift']());}}}(a165_0x52ab,0xea8f1));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x13bfd7){const _0x1fbfb2=a165_0x3706;if(cache[_0x1fbfb2(0xe5)](_0x13bfd7))return cache[_0x1fbfb2(0xe4)](_0x13bfd7);const _0x4f9bad=await listDatasets(_0x13bfd7),_0x5a70e2=new Map();for(const _0xd3d310 of _0x4f9bad){const _0x1d8971=_0xd3d310['dbtableConfig'];_0x1d8971?.['dbId']!=null&&_0x5a70e2[_0x1fbfb2(0xdf)](_0x1d8971[_0x1fbfb2(0xd7)],_0x1d8971['dbName']??_0x1fbfb2(0xd8)+_0x1d8971[_0x1fbfb2(0xd7)]);}const _0x33b30d=[..._0x5a70e2['entries']()]['map'](([_0x4a124e,_0x3bf982])=>({'dbId':_0x4a124e,'dbName':_0x3bf982}));return cache[_0x1fbfb2(0xdf)](_0x13bfd7,_0x33b30d),_0x33b30d;}function a165_0x3706(_0x476018,_0x4f6ff1){_0x476018=_0x476018-0xcc;const _0x52ab38=a165_0x52ab();let _0x370632=_0x52ab38[_0x476018];return _0x370632;}function a165_0x52ab(){const _0x42f790=['6503bSFQyT','map','20710ZZAJsN','\x22.\x20Available:\x20','get','has','5350953jUvSrw','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20matches\x20multiple\x20databases:\x20','4JrUzzM','63256baDeWs','includes','.\x20Be\x20more\x20specific.','filter','4895WdGUsN','51Vcfsez','length','join','8864937bFvrfs','1346610UmCovw','3031725KHBsYj','toLowerCase','dbId','db-','find','dbName','isNaN','896ZPjODC','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','No\x20database\x20matching\x20\x22','set'];a165_0x52ab=function(){return _0x42f790;};return a165_0x52ab();}export async function resolveDb(_0x3ae19a,_0x1ed2a6){const _0x32b412=a165_0x3706,_0x14f1d7=await listDatabases(_0x3ae19a);if(_0x14f1d7[_0x32b412(0xd1)]===0x0)return{'resolved':[],'error':_0x32b412(0xdd)+_0x3ae19a+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x1ed2a6)return{'resolved':_0x14f1d7};const _0x2c7327=Number(_0x1ed2a6);if(!Number[_0x32b412(0xdb)](_0x2c7327)){const _0x4fc69e=_0x14f1d7[_0x32b412(0xd9)](_0x4d0b85=>_0x4d0b85[_0x32b412(0xd7)]===_0x2c7327);if(_0x4fc69e)return{'resolved':[_0x4fc69e]};}const _0x347687=_0x1ed2a6[_0x32b412(0xd6)](),_0x559fcd=_0x14f1d7[_0x32b412(0xce)](_0x1f6692=>_0x1f6692[_0x32b412(0xda)][_0x32b412(0xd6)]()[_0x32b412(0xcc)](_0x347687));if(_0x559fcd[_0x32b412(0xd1)]>0x0)return{'resolved':_0x559fcd};const _0x99eca2=_0x14f1d7[_0x32b412(0xe1)](_0x47d041=>_0x47d041[_0x32b412(0xda)]+'\x20('+_0x47d041[_0x32b412(0xd7)]+')')['join'](',\x20');return{'resolved':[],'error':_0x32b412(0xde)+_0x1ed2a6+'\x22\x20under\x20app\x20\x22'+_0x3ae19a+_0x32b412(0xe3)+_0x99eca2+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x316ce0,_0x337329){const _0x5cce84=a165_0x3706,{resolved:_0x1ae89b,error:_0x1b9f73}=await resolveDb(_0x316ce0,_0x337329);if(_0x1b9f73)return{'db':null,'error':_0x1b9f73};if(_0x1ae89b['length']===0x1)return{'db':_0x1ae89b[0x0]};if(!_0x337329){const _0x5ec68f=_0x1ae89b[_0x5cce84(0xe1)](_0x17bc3f=>_0x17bc3f[_0x5cce84(0xda)]+'\x20('+_0x17bc3f[_0x5cce84(0xd7)]+')')[_0x5cce84(0xd2)](',\x20');return{'db':null,'error':_0x5cce84(0xe7)+_0x5ec68f};}const _0x2ff742=_0x1ae89b[_0x5cce84(0xe1)](_0x5c2605=>_0x5c2605['dbName']+'\x20('+_0x5c2605[_0x5cce84(0xd7)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x337329+_0x5cce84(0xe8)+_0x2ff742+_0x5cce84(0xcd)};}export async function getDbName(_0x3adf26,_0x25b65e){const _0x231fcf=a165_0x3706,_0x4a4d01=await listDatabases(_0x3adf26);return _0x4a4d01[_0x231fcf(0xd9)](_0x531117=>_0x531117[_0x231fcf(0xd7)]===_0x25b65e)?.[_0x231fcf(0xda)];}