@lovrabet/rabetbase-cli 2.1.11 → 2.1.12-beta.0

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 (198) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/field-update.js +1 -1
  55. package/lib/commands/dataset/index.js +1 -1
  56. package/lib/commands/dataset/link-create.js +1 -1
  57. package/lib/commands/dataset/link-delete.js +1 -1
  58. package/lib/commands/dataset/link-shared.js +1 -1
  59. package/lib/commands/dataset/link-update.js +1 -1
  60. package/lib/commands/dataset/links.js +1 -1
  61. package/lib/commands/dataset/list.js +1 -1
  62. package/lib/commands/dataset/operations.js +1 -1
  63. package/lib/commands/db/analyze-cancel.js +1 -1
  64. package/lib/commands/db/analyze-start.js +1 -1
  65. package/lib/commands/db/analyze-status.js +1 -1
  66. package/lib/commands/db/create.js +1 -1
  67. package/lib/commands/db/delete.js +1 -1
  68. package/lib/commands/db/detail.js +1 -1
  69. package/lib/commands/db/diff.js +1 -1
  70. package/lib/commands/db/index.js +1 -1
  71. package/lib/commands/db/list.js +1 -1
  72. package/lib/commands/db/shared.js +1 -1
  73. package/lib/commands/db/tables.js +1 -1
  74. package/lib/commands/db/test.js +1 -1
  75. package/lib/commands/db/update.js +1 -1
  76. package/lib/commands/doctor.js +1 -1
  77. package/lib/commands/init/index.js +1 -1
  78. package/lib/commands/issue/index.js +1 -1
  79. package/lib/commands/issue/report.js +1 -1
  80. package/lib/commands/logs/index.js +1 -1
  81. package/lib/commands/menu/index.js +1 -1
  82. package/lib/commands/menu/shared/compare-table.js +1 -1
  83. package/lib/commands/menu/shared/index.js +1 -1
  84. package/lib/commands/menu/shared/inquirer.js +1 -1
  85. package/lib/commands/menu/shared/local-pages.js +1 -1
  86. package/lib/commands/menu/shared/logic.js +1 -1
  87. package/lib/commands/menu/shared/service.js +1 -1
  88. package/lib/commands/menu/shared/sync-core.js +1 -1
  89. package/lib/commands/menu/shared/update-core.js +1 -1
  90. package/lib/commands/menu/shared/valid-url.js +1 -1
  91. package/lib/commands/menu/sync.js +1 -1
  92. package/lib/commands/menu/update.js +1 -1
  93. package/lib/commands/page/generate-start.js +1 -1
  94. package/lib/commands/page/generate-status.js +1 -1
  95. package/lib/commands/page/index.js +1 -1
  96. package/lib/commands/page/pull.js +1 -1
  97. package/lib/commands/page/push.js +1 -1
  98. package/lib/commands/page/shared.js +1 -1
  99. package/lib/commands/page/standard-page-status.js +1 -1
  100. package/lib/commands/page/sync.js +1 -1
  101. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  102. package/lib/commands/project/create/format-elapsed.js +1 -1
  103. package/lib/commands/project/create/main.js +1 -1
  104. package/lib/commands/project/create/non-interactive.js +1 -1
  105. package/lib/commands/project/create/project-template-path.js +1 -1
  106. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  107. package/lib/commands/project/create/use-format-code.js +1 -1
  108. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  109. package/lib/commands/project/index.js +1 -1
  110. package/lib/commands/project/init.js +1 -1
  111. package/lib/commands/project/upgrade.js +1 -1
  112. package/lib/commands/registry.js +1 -1
  113. package/lib/commands/run/index.js +1 -1
  114. package/lib/commands/schema.js +1 -1
  115. package/lib/commands/skill/index.js +1 -1
  116. package/lib/commands/sql/create.js +1 -1
  117. package/lib/commands/sql/delete.js +1 -1
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.js +1 -1
  120. package/lib/commands/sql/index.js +1 -1
  121. package/lib/commands/sql/list.js +1 -1
  122. package/lib/commands/sql/pull.js +1 -1
  123. package/lib/commands/sql/push.js +1 -1
  124. package/lib/commands/sql/save.js +1 -1
  125. package/lib/commands/sql/shared.js +1 -1
  126. package/lib/commands/sql/status.js +1 -1
  127. package/lib/commands/sql/validate.js +1 -1
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/cdn.js +1 -1
  130. package/lib/constant/cli.js +1 -1
  131. package/lib/constant/defaults.js +1 -1
  132. package/lib/constant/domain.js +1 -1
  133. package/lib/constant/env.js +1 -1
  134. package/lib/constant/output.js +1 -1
  135. package/lib/constant/paths.js +1 -1
  136. package/lib/constant/risk.js +1 -1
  137. package/lib/context.js +1 -1
  138. package/lib/core/alias-resolver.js +1 -1
  139. package/lib/core/api-client.js +1 -1
  140. package/lib/core/bff/config.js +1 -1
  141. package/lib/core/bff/file-system.js +1 -1
  142. package/lib/core/bff/hash.js +1 -1
  143. package/lib/core/bff/lock.js +1 -1
  144. package/lib/core/bff/utils.js +1 -1
  145. package/lib/core/db-resolver.js +1 -1
  146. package/lib/core/page/file-system.js +1 -1
  147. package/lib/core/page/hash.js +1 -1
  148. package/lib/core/page/lock.js +1 -1
  149. package/lib/core/sql-sync/config.js +1 -1
  150. package/lib/core/sql-sync/file-system.js +1 -1
  151. package/lib/core/sql-sync/hash.js +1 -1
  152. package/lib/core/sql-sync/lock.js +1 -1
  153. package/lib/core/sql-sync/utils.js +1 -1
  154. package/lib/core/sql-validator.js +1 -1
  155. package/lib/errors.js +1 -1
  156. package/lib/framework/build-all-flags.js +1 -1
  157. package/lib/framework/flags.js +1 -1
  158. package/lib/framework/help.js +1 -1
  159. package/lib/framework/index.js +1 -1
  160. package/lib/framework/output.js +1 -1
  161. package/lib/framework/response.js +1 -1
  162. package/lib/framework/runner-alias.js +1 -1
  163. package/lib/framework/runner.js +1 -1
  164. package/lib/framework/schema-export.js +1 -1
  165. package/lib/framework/types.js +1 -1
  166. package/lib/generated/build-info.js +1 -1
  167. package/lib/help.js +1 -1
  168. package/lib/skills/main.js +1 -1
  169. package/lib/skills/npx-skills-add.js +1 -1
  170. package/lib/telemetry/cli-command-trace.js +1 -1
  171. package/lib/telemetry/cli-help-trace.js +1 -1
  172. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  173. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  174. package/lib/telemetry/send-cli-trace-log.js +1 -1
  175. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  176. package/lib/utils/ai_config.js +1 -1
  177. package/lib/utils/apply-jq-filter.js +1 -1
  178. package/lib/utils/cdn-config.js +1 -1
  179. package/lib/utils/check-sdk-version.js +1 -1
  180. package/lib/utils/cli-version-check.js +1 -1
  181. package/lib/utils/cli-version-policy.js +1 -1
  182. package/lib/utils/config.js +1 -1
  183. package/lib/utils/copy-directory.js +1 -1
  184. package/lib/utils/entity-with-id.js +1 -1
  185. package/lib/utils/file-utils.js +1 -1
  186. package/lib/utils/guides-cdn.js +1 -1
  187. package/lib/utils/http-client.js +1 -1
  188. package/lib/utils/is-non-interactive.js +1 -1
  189. package/lib/utils/logger.js +1 -1
  190. package/lib/utils/params.js +1 -1
  191. package/lib/utils/platform.js +1 -1
  192. package/lib/utils/rules-cdn.js +1 -1
  193. package/lib/utils/sleep.js +1 -1
  194. package/lib/utils/template-replacer.js +1 -1
  195. package/lib/utils/version.js +1 -1
  196. package/lib/utils/with-active-cookie.js +1 -1
  197. package/lib/utils/write-cli-side-channel.js +1 -1
  198. package/package.json +2 -2
@@ -1 +1 @@
1
- const a135_0x552548=a135_0x4f21;function a135_0x4f21(_0x1a10d0,_0x183da9){_0x1a10d0=_0x1a10d0-0x167;const _0x3fea7f=a135_0x3fea();let _0x4f2128=_0x3fea7f[_0x1a10d0];return _0x4f2128;}function a135_0x3fea(){const _0x3f70c8=['3735530VyKaJf','3113vCZYyN','17760dlkjwH','7ShvpbF','1826416DCwDPf','./src/api','9ytPqfV','570506UhnZbu','102JKeSxN','102FBxWYW','8199nnrawY','6870472CKahir','53232xaAEIO'];a135_0x3fea=function(){return _0x3f70c8;};return a135_0x3fea();}(function(_0x2fe065,_0x3074ae){const _0x2b1c4e=a135_0x4f21,_0x250cbb=_0x2fe065();while(!![]){try{const _0x1a45b2=-parseInt(_0x2b1c4e(0x16a))/0x1+parseInt(_0x2b1c4e(0x16b))/0x2*(-parseInt(_0x2b1c4e(0x16d))/0x3)+parseInt(_0x2b1c4e(0x167))/0x4+parseInt(_0x2b1c4e(0x172))/0x5*(-parseInt(_0x2b1c4e(0x16c))/0x6)+-parseInt(_0x2b1c4e(0x173))/0x7*(parseInt(_0x2b1c4e(0x16e))/0x8)+-parseInt(_0x2b1c4e(0x169))/0x9*(-parseInt(_0x2b1c4e(0x170))/0xa)+parseInt(_0x2b1c4e(0x171))/0xb*(parseInt(_0x2b1c4e(0x16f))/0xc);if(_0x1a45b2===_0x3074ae)break;else _0x250cbb['push'](_0x250cbb['shift']());}catch(_0x438607){_0x250cbb['push'](_0x250cbb['shift']());}}}(a135_0x3fea,0x6f70f));export const DEFAULT_API_DIR=a135_0x552548(0x168);
1
+ const a135_0x923198=a135_0x5c6a;function a135_0x5c6a(_0x23c96b,_0x46388f){_0x23c96b=_0x23c96b-0x145;const _0x3be5a6=a135_0x3be5();let _0x5c6a79=_0x3be5a6[_0x23c96b];return _0x5c6a79;}function a135_0x3be5(){const _0x3f1636=['12150870EBLLva','1277745wIitYU','5133CsUQoK','9CjmwnG','560IBfnmz','21624tZoDdN','./src/api','2452184najNSN','721rgWgkb','497043sWWAQW','566212WKUbim'];a135_0x3be5=function(){return _0x3f1636;};return a135_0x3be5();}(function(_0xd7dd25,_0x498b94){const _0x53907f=a135_0x5c6a,_0x566d53=_0xd7dd25();while(!![]){try{const _0x9cc43c=parseInt(_0x53907f(0x146))/0x1+-parseInt(_0x53907f(0x147))/0x2+-parseInt(_0x53907f(0x14a))/0x3*(parseInt(_0x53907f(0x14c))/0x4)+-parseInt(_0x53907f(0x149))/0x5+-parseInt(_0x53907f(0x14d))/0x6*(parseInt(_0x53907f(0x145))/0x7)+-parseInt(_0x53907f(0x14f))/0x8+parseInt(_0x53907f(0x14b))/0x9*(parseInt(_0x53907f(0x148))/0xa);if(_0x9cc43c===_0x498b94)break;else _0x566d53['push'](_0x566d53['shift']());}catch(_0x369396){_0x566d53['push'](_0x566d53['shift']());}}}(a135_0x3be5,0x3e8c8));export const DEFAULT_API_DIR=a135_0x923198(0x14e);
@@ -1 +1 @@
1
- function a136_0x5e6d(_0x32e091,_0x4e3116){_0x32e091=_0x32e091-0x1af;const _0x35d53a=a136_0x35d5();let _0x5e6dea=_0x35d53a[_0x32e091];return _0x5e6dea;}const a136_0x5c703e=a136_0x5e6d;(function(_0x55191a,_0x2dd7ba){const _0x15610f=a136_0x5e6d,_0x4cd081=_0x55191a();while(!![]){try{const _0x5dce79=-parseInt(_0x15610f(0x1b8))/0x1*(parseInt(_0x15610f(0x1bb))/0x2)+parseInt(_0x15610f(0x1b5))/0x3+-parseInt(_0x15610f(0x1b0))/0x4*(parseInt(_0x15610f(0x1ba))/0x5)+parseInt(_0x15610f(0x1b4))/0x6*(-parseInt(_0x15610f(0x1af))/0x7)+parseInt(_0x15610f(0x1b2))/0x8+parseInt(_0x15610f(0x1b7))/0x9+-parseInt(_0x15610f(0x1b9))/0xa*(-parseInt(_0x15610f(0x1b6))/0xb);if(_0x5dce79===_0x2dd7ba)break;else _0x4cd081['push'](_0x4cd081['shift']());}catch(_0x11367c){_0x4cd081['push'](_0x4cd081['shift']());}}}(a136_0x35d5,0xf2208));function a136_0x35d5(){const _0x3685aa=['6208376RrPXoh','read','15067624VDUQDt','high-risk-write','363738XaaHUw','4706709hfQclD','209bOcwvu','5911470PBrKvP','756080TjRAdA','116490GbFcxw','5ZqjkPk','2RwQMnj','119mztyTB'];a136_0x35d5=function(){return _0x3685aa;};return a136_0x35d5();}export const RISK_LEVEL_VALUES=[a136_0x5c703e(0x1b1),'write',a136_0x5c703e(0x1b3)];
1
+ function a136_0x1192(_0x47c51e,_0x1d14a4){_0x47c51e=_0x47c51e-0xfb;const _0x61b0ed=a136_0x61b0();let _0x1192b1=_0x61b0ed[_0x47c51e];return _0x1192b1;}function a136_0x61b0(){const _0x39789a=['42GOQSDA','1577994QJWLyo','423045rTnYuF','1sNqaxl','5354250VkydZG','40vDbjVp','752RrTSHA','143017QupYoR','4671504uKhImF','read','9804bEYAnu','1218249QFuJAc'];a136_0x61b0=function(){return _0x39789a;};return a136_0x61b0();}const a136_0xb0202e=a136_0x1192;(function(_0x4e54b1,_0x2ccc8b){const _0x56274d=a136_0x1192,_0x18aec4=_0x4e54b1();while(!![]){try{const _0x27a0e5=-parseInt(_0x56274d(0x106))/0x1*(-parseInt(_0x56274d(0x104))/0x2)+-parseInt(_0x56274d(0x101))/0x3*(parseInt(_0x56274d(0xfd))/0x4)+-parseInt(_0x56274d(0x105))/0x5+-parseInt(_0x56274d(0x103))/0x6*(parseInt(_0x56274d(0xfe))/0x7)+parseInt(_0x56274d(0xff))/0x8+parseInt(_0x56274d(0x102))/0x9*(-parseInt(_0x56274d(0xfc))/0xa)+parseInt(_0x56274d(0xfb))/0xb;if(_0x27a0e5===_0x2ccc8b)break;else _0x18aec4['push'](_0x18aec4['shift']());}catch(_0x17bc22){_0x18aec4['push'](_0x18aec4['shift']());}}}(a136_0x61b0,0x74447));export const RISK_LEVEL_VALUES=[a136_0xb0202e(0x100),'write','high-risk-write'];
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a137_0x1d93bc=a137_0x5c91;(function(_0x22ef87,_0x356366){const _0x55fd82=a137_0x5c91,_0x4a74e3=_0x22ef87();while(!![]){try{const _0xe241ea=parseInt(_0x55fd82(0x188))/0x1+-parseInt(_0x55fd82(0x1bf))/0x2+parseInt(_0x55fd82(0x1b7))/0x3+-parseInt(_0x55fd82(0x189))/0x4+-parseInt(_0x55fd82(0x1b6))/0x5*(-parseInt(_0x55fd82(0x180))/0x6)+parseInt(_0x55fd82(0x191))/0x7+-parseInt(_0x55fd82(0x1a0))/0x8;if(_0xe241ea===_0x356366)break;else _0x4a74e3['push'](_0x4a74e3['shift']());}catch(_0x6bd969){_0x4a74e3['push'](_0x4a74e3['shift']());}}}(a137_0x153e,0xcf0bd));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';function a137_0x153e(){const _0xed090=['2446870WmiQzN','cwd','maxRisk','env','cookie','object','config','migrated','template_base_url','filter','projectConfig','data','./auth/get-cookie.js','./utils/is-non-interactive.js','6tEnlmY','values','merged','daily','inherit','join','apps','keys','1247142zZZKnJ','2144044ImgbAe','./constant/domain.js','empty','setRawCommand','project','APPCODE','accessKey','.rabetbase.json','6196316MaADYs','error','true','format','parse','entries','APP','-api.ts','ENV','status','apiDir','runtimeDomain','FORMAT','userDomain','authRequired','9290160lQushv','production','warn','defaultApp','message','find','read','silent','app','replace','setLogPath','trim','locale','appcode','riskLevel','string','length','missing','.lovrabet.json','get','api.ts','Project','7144455NaMWNb','622668jxwaqZ','stringify','RISK_LEVEL','.lovrabetrc','pageSize','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','slice','\x0a\x20\x20'];a137_0x153e=function(){return _0xed090;};return a137_0x153e();}import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x3aa218){return process.env[`RABETBASE_${_0x3aa218}`]||process.env[`LOVRABET_${_0x3aa218}`]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a137_0x1d93bc(0x190),a137_0x1d93bc(0x1b2),a137_0x1d93bc(0x1ba)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a137_0x1d93bc(0x1c8)](_0x352b01=>_0x352b01!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x285168){for(const _0x3b1850 of CONFIG_NAMES){const _0x48fcb4=resolve(_0x285168,_0x3b1850);if(existsSync(_0x48fcb4))return _0x48fcb4;}return undefined;}export function findProjectRootDirectory(_0x2de8e0=process[a137_0x1d93bc(0x1c0)]()){let _0x41195c=resolve(_0x2de8e0);const {root:_0x189b0e}=parse(_0x41195c),_0x498b82=homedir();while(!![]){if(resolveConfigPath(_0x41195c)){if(_0x41195c===_0x498b82)break;return _0x41195c;}if(_0x41195c===_0x189b0e||_0x41195c===_0x498b82)break;const _0x954214=dirname(_0x41195c);if(_0x954214===_0x41195c)break;_0x41195c=_0x954214;}return resolve(_0x2de8e0);}export async function createContext(_0x122807){const _0x45dfeb=a137_0x1d93bc,_0x10908d=readRawConfig(),_0xb1e59f=buildConfig(_0x10908d,_0x122807),{initEnv:_0xe86b5b}=await import('./constant/env.js');if(_0xb1e59f['env'])_0xe86b5b(_0xb1e59f[_0x45dfeb(0x1c2)]);else _0x122807[_0x45dfeb(0x1c2)]&&typeof _0x122807['env']===_0x45dfeb(0x1af)&&_0xe86b5b(_0x122807[_0x45dfeb(0x1c2)]);const {initDomains:_0x35c7b9,getUserDomain:_0x58ee46,getApiDomain:_0x3a24bb}=await import(_0x45dfeb(0x18a));_0x35c7b9({'apiDomain':_0x10908d['apiDomain']||undefined,'userDomain':_0x10908d[_0x45dfeb(0x19e)]||undefined,'runtimeDomain':_0x10908d[_0x45dfeb(0x19c)]||undefined});const _0x53931c={'apiDomain':_0x3a24bb(),'userDomain':_0x58ee46()},_0x330bb8=await buildAuth(_0xb1e59f);logger[_0x45dfeb(0x1aa)](process[_0x45dfeb(0x1c0)]());const _0x3892c6=(CLI_BIN_NAME+'\x20'+process['argv'][_0x45dfeb(0x1bd)](0x2)[_0x45dfeb(0x185)]('\x20'))[_0x45dfeb(0x1ab)]();logger[_0x45dfeb(0x18c)](_0x3892c6);const {isNonInteractive:_0x31cf54}=await import(_0x45dfeb(0x17f)),_0x39cbb5=_0x31cf54(_0x122807);return{'config':_0xb1e59f,'auth':_0x330bb8,'logger':logger,'env':_0x53931c,'nonInteractive':_0x39cbb5};}export function buildConfigFromFlags(_0x61eadf){return buildConfig(readRawConfig(),_0x61eadf);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x46861c){const _0x4b53cb=a137_0x1d93bc;if(!existsSync(_0x46861c))return{'status':_0x4b53cb(0x1b1)};try{const _0x2d4700=readFileSync(_0x46861c,{'encoding':'utf8'});if(!_0x2d4700?.[_0x4b53cb(0x1ab)]())return{'status':_0x4b53cb(0x18b)};const _0x292c9c=JSON[_0x4b53cb(0x195)](_0x2d4700);return{'status':'ok','data':_0x292c9c};}catch(_0x2853a5){return{'status':_0x4b53cb(0x192),'message':_0x2853a5 instanceof Error?_0x2853a5[_0x4b53cb(0x1a4)]:String(_0x2853a5)};}}function parseCliConfigJsonFile(_0x223b56,_0x3ce6e1,_0x2066a2){const _0x2b7697=a137_0x1d93bc,_0x1ab6b6=inspectCliConfigJsonFile(_0x223b56);if(_0x1ab6b6[_0x2b7697(0x19a)]===_0x2b7697(0x1b1)||_0x1ab6b6[_0x2b7697(0x19a)]===_0x2b7697(0x18b))return{};if(_0x1ab6b6[_0x2b7697(0x19a)]==='ok')return _0x1ab6b6[_0x2b7697(0x1ca)];return _0x3ce6e1===_0x2b7697(0x1a2)&&_0x2066a2&&console[_0x2b7697(0x192)](CLI_BIN_NAME+':\x20'+_0x2066a2+_0x2b7697(0x1bc)+_0x223b56+_0x2b7697(0x1be)+_0x1ab6b6['message']),{};}function a137_0x5c91(_0x90dbb3,_0x384b3b){_0x90dbb3=_0x90dbb3-0x17e;const _0x153e4a=a137_0x153e();let _0x5c9179=_0x153e4a[_0x90dbb3];return _0x5c9179;}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x58c327){const _0x547662=a137_0x1d93bc;if(!_0x58c327||typeof _0x58c327!==_0x547662(0x1c4))return{'config':{},'migrated':![]};const _0x41aa2d={..._0x58c327},_0x222c92=_0x41aa2d['apps']&&typeof _0x41aa2d['apps']===_0x547662(0x1c4)?{..._0x41aa2d[_0x547662(0x186)]}:{},_0x4c1d14=Object['keys'](_0x222c92)[_0x547662(0x1b0)],_0x14c026=_0x41aa2d[_0x547662(0x1ad)]||_0x41aa2d['app'];let _0x2d3758=![];if(_0x14c026&&_0x4c1d14===0x0){const _0x5f0fbf=typeof _0x41aa2d[_0x547662(0x1a3)]===_0x547662(0x1af)&&_0x41aa2d[_0x547662(0x1a3)][_0x547662(0x1ab)]()?_0x41aa2d[_0x547662(0x1a3)]:String(_0x14c026)[_0x547662(0x1ab)]();_0x222c92[_0x5f0fbf]={'appcode':String(_0x14c026)['trim'](),..._0x41aa2d[_0x547662(0x1c2)]!=null?{'env':_0x41aa2d[_0x547662(0x1c2)]}:{},..._0x41aa2d[_0x547662(0x19b)]!=null?{'apiDir':_0x41aa2d[_0x547662(0x19b)]}:{},..._0x41aa2d[_0x547662(0x1c3)]!=null?{'cookie':_0x41aa2d[_0x547662(0x1c3)]}:{},..._0x41aa2d['accessKey']!=null?{'accessKey':_0x41aa2d[_0x547662(0x18f)]}:{},..._0x41aa2d[_0x547662(0x194)]!=null?{'format':_0x41aa2d['format']}:{},..._0x41aa2d['pageSize']!=null?{'pageSize':_0x41aa2d[_0x547662(0x1bb)]}:{},..._0x41aa2d[_0x547662(0x1ae)]!=null?{'riskLevel':_0x41aa2d[_0x547662(0x1ae)]}:{},..._0x41aa2d[_0x547662(0x1ac)]!=null?{'locale':_0x41aa2d['locale']}:{}},_0x41aa2d[_0x547662(0x186)]=_0x222c92;if(!_0x41aa2d[_0x547662(0x1a3)])_0x41aa2d[_0x547662(0x1a3)]=_0x5f0fbf;_0x2d3758=!![];}return(_0x547662(0x1ad)in _0x41aa2d||_0x547662(0x1a8)in _0x41aa2d)&&(delete _0x41aa2d[_0x547662(0x1ad)],delete _0x41aa2d[_0x547662(0x1a8)],_0x2d3758=!![]),{'config':_0x41aa2d,'migrated':_0x2d3758};}function writeNormalizedConfigIfNeeded(_0x2f6811,_0x280f34){const _0x392f7a=a137_0x1d93bc,_0x307fab=JSON['stringify'](_0x280f34,null,0x2)+'\x0a';if(normalizedWriteCache[_0x392f7a(0x1b3)](_0x2f6811)===_0x307fab)return;writeConfigFile(_0x2f6811,_0x280f34),normalizedWriteCache['set'](_0x2f6811,_0x307fab);}function parseAndNormalizeConfig(_0x3edb76,_0x1ecff1,_0x3317d4){const _0x1d2992=a137_0x1d93bc,_0x524080=parseCliConfigJsonFile(_0x3edb76,_0x1ecff1,_0x3317d4),_0x7e3a64=normalizeLegacyConfigShape(_0x524080);if(_0x7e3a64[_0x1d2992(0x1c6)])try{writeNormalizedConfigIfNeeded(_0x3edb76,_0x7e3a64[_0x1d2992(0x1c5)]);}catch{}return _0x7e3a64[_0x1d2992(0x1c5)];}export function loadRawConfigLayers(_0x522355){const _0x566a47=a137_0x1d93bc;let _0x2e9fb2={},_0x1bac76={};const _0x166b8a=resolveConfigPath(homedir());_0x166b8a&&(_0x2e9fb2=parseAndNormalizeConfig(_0x166b8a,_0x566a47(0x1a2),'Global'));const _0x365113=_0x522355??findProjectRootDirectory(),_0x5a0c3e=resolveConfigPath(_0x365113);return _0x5a0c3e&&(_0x1bac76=parseAndNormalizeConfig(_0x5a0c3e,_0x566a47(0x1a2),_0x566a47(0x1b5))),{'globalPath':_0x166b8a,'projectPath':_0x5a0c3e,'globalConfig':_0x2e9fb2,'projectConfig':_0x1bac76};}function mergeRawConfigLayers(_0xdf4a83){const _0x36cc42=a137_0x1d93bc,{globalConfig:_0x37e887,projectConfig:_0xc62f84}=_0xdf4a83;if(_0xc62f84[_0x36cc42(0x184)]===![]){const _0x3c1aff={..._0xc62f84};delete _0x3c1aff['inherit'];const _0x58d197=_0xc62f84['apps']&&typeof _0xc62f84[_0x36cc42(0x186)]===_0x36cc42(0x1c4)?_0xc62f84[_0x36cc42(0x186)]:{};Object[_0x36cc42(0x187)](_0x58d197)['length']>0x0?_0x3c1aff['apps']=_0x58d197:delete _0x3c1aff['apps'];if(_0x36cc42(0x1a3)in _0xc62f84)_0x3c1aff['defaultApp']=_0xc62f84['defaultApp'];else Object[_0x36cc42(0x187)](_0x58d197)['length']>0x0&&(_0x3c1aff[_0x36cc42(0x1a3)]=Object[_0x36cc42(0x187)](_0x58d197)[0x0]);return _0x3c1aff;}const _0x3edbc3=_0x37e887[_0x36cc42(0x186)]&&typeof _0x37e887['apps']===_0x36cc42(0x1c4)?_0x37e887[_0x36cc42(0x186)]:{},_0x2bb445=_0xc62f84[_0x36cc42(0x186)]&&typeof _0xc62f84['apps']===_0x36cc42(0x1c4)?_0xc62f84[_0x36cc42(0x186)]:{},_0x25e95b={..._0x3edbc3,..._0x2bb445},_0x264540={..._0x37e887,..._0xc62f84};Object['keys'](_0x25e95b)[_0x36cc42(0x1b0)]>0x0&&(_0x264540[_0x36cc42(0x186)]=_0x25e95b);if(_0x36cc42(0x1a3)in _0xc62f84)_0x264540[_0x36cc42(0x1a3)]=_0xc62f84[_0x36cc42(0x1a3)];else{if(_0x2bb445&&Object[_0x36cc42(0x187)](_0x2bb445)[_0x36cc42(0x1b0)]>0x0)_0x264540[_0x36cc42(0x1a3)]=Object[_0x36cc42(0x187)](_0x2bb445)[0x0];else{if(_0x37e887[_0x36cc42(0x1a3)])_0x264540['defaultApp']=_0x37e887[_0x36cc42(0x1a3)];else{const _0x53a831=Object['keys'](_0x3edbc3);_0x53a831[_0x36cc42(0x1b0)]>0x0&&(_0x264540[_0x36cc42(0x1a3)]=_0x53a831[0x0]);}}}return _0x264540;}export function readRawConfigWithLayers(_0x21931b){const _0xf45e7a=loadRawConfigLayers(_0x21931b);return{'config':mergeRawConfigLayers(_0xf45e7a),'layers':_0xf45e7a};}export function readRawConfig(_0x4f69a3){return mergeRawConfigLayers(loadRawConfigLayers(_0x4f69a3));}export function getConfigAppCode(_0x35ad32){const _0x192456=a137_0x1d93bc,_0x6c1777=readRawConfig(_0x35ad32);if(_0x6c1777[_0x192456(0x186)]&&typeof _0x6c1777[_0x192456(0x186)]===_0x192456(0x1c4)){const _0xacfbde=_0x6c1777[_0x192456(0x1a3)];if(_0xacfbde&&_0x6c1777[_0x192456(0x186)][_0xacfbde]?.[_0x192456(0x1ad)])return String(_0x6c1777[_0x192456(0x186)][_0xacfbde][_0x192456(0x1ad)])[_0x192456(0x1ab)]();const _0x3bf9d8=Object[_0x192456(0x181)](_0x6c1777[_0x192456(0x186)])[0x0];if(_0x3bf9d8?.[_0x192456(0x1ad)])return String(_0x3bf9d8[_0x192456(0x1ad)])[_0x192456(0x1ab)]();}const _0x246164=_0x6c1777[_0x192456(0x1ad)]||_0x6c1777['app'];if(typeof _0x246164!=='string'||_0x246164[_0x192456(0x1ab)]()==='')return undefined;return _0x246164[_0x192456(0x1ab)]();}export function getMultiAppConfigs(_0xc8521d=a137_0x1d93bc(0x18d),_0xd96a36){const _0x4eb2d2=a137_0x1d93bc,_0x48fd1b=_0xc8521d===_0x4eb2d2(0x182)?readRawConfig(_0xd96a36):loadRawConfigLayers(_0xd96a36)[_0x4eb2d2(0x1c9)],_0xcd95cc=_0x48fd1b[_0x4eb2d2(0x186)];if(!_0xcd95cc||typeof _0xcd95cc!==_0x4eb2d2(0x1c4)||Object[_0x4eb2d2(0x187)](_0xcd95cc)['length']===0x0)return null;const _0x13b38a=_0x48fd1b[_0x4eb2d2(0x1a3)];return Object[_0x4eb2d2(0x196)](_0xcd95cc)['map'](([_0x32b6b1,_0x560125])=>({'name':_0x32b6b1,'appcode':_0x560125?.[_0x4eb2d2(0x1ad)]||'','isDefault':_0x32b6b1===_0x13b38a,'env':_0x560125?.['env'],'apiDir':_0x560125?.['apiDir'],'cookie':_0x560125?.[_0x4eb2d2(0x1c3)]||undefined}))[_0x4eb2d2(0x1c8)](_0x2b05b3=>_0x2b05b3[_0x4eb2d2(0x1ad)]);}export function getTemplateBaseUrl(_0x1f7bc7){const _0x37828d=a137_0x1d93bc,_0x4436be=readRawConfig(_0x1f7bc7);if(_0x4436be[_0x37828d(0x1c7)]&&typeof _0x4436be[_0x37828d(0x1c7)]===_0x37828d(0x1af))return _0x4436be['template_base_url'][_0x37828d(0x1a9)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}export function readConfigFile(_0x1cfcf0){const _0x697519=a137_0x1d93bc;return parseAndNormalizeConfig(_0x1cfcf0,_0x697519(0x1a7));}export function writeConfigFile(_0x40d28f,_0x23c3d2){const _0x5d7201=a137_0x1d93bc,_0x10fe5b=dirname(_0x40d28f);!existsSync(_0x10fe5b)&&mkdirSync(_0x10fe5b,{'recursive':!![]});const _0xe936b=_0x40d28f+'.tmp';try{writeFileSync(_0xe936b,JSON[_0x5d7201(0x1b8)](_0x23c3d2,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xe936b,_0x40d28f);}catch(_0x40b68d){try{unlinkSync(_0xe936b);}catch{}throw _0x40b68d;}}export function resolveWriteConfigPath(_0x274911){const _0x31b52d=a137_0x1d93bc,_0x3de2f2=_0x274911===_0x31b52d(0x18d)?process['cwd']():homedir(),_0x420591=resolveConfigPath(_0x3de2f2);return _0x420591??resolve(_0x3de2f2,NEW_CONFIG_NAME);}function buildConfig(_0x3eced7,_0x4cc67a){const _0x3b5197=a137_0x1d93bc,_0x4eed75={};if(_0x3eced7['apps']&&typeof _0x3eced7[_0x3b5197(0x186)]===_0x3b5197(0x1c4))for(const [_0x52b57f,_0x2bfe67]of Object[_0x3b5197(0x196)](_0x3eced7[_0x3b5197(0x186)])){_0x2bfe67&&typeof _0x2bfe67===_0x3b5197(0x1c4)&&_0x2bfe67['appcode']&&(_0x4eed75[_0x52b57f]=_0x2bfe67);}const _0x2156b1=_0x3eced7[_0x3b5197(0x1a3)]||undefined,_0x5a9d03=Object[_0x3b5197(0x187)](_0x4eed75)[_0x3b5197(0x1b0)]>0x0,_0x2e95f6=_0x4cc67a['app']||env(_0x3b5197(0x197))||undefined,_0x12477f=_0x2e95f6||_0x2156b1||undefined,_0x3d3a91=_0x4cc67a[_0x3b5197(0x1ad)]||env(_0x3b5197(0x18e))||undefined,_0x2bb8e2=_0x3d3a91?Object[_0x3b5197(0x196)](_0x4eed75)[_0x3b5197(0x1a5)](([,_0x4d46ef])=>_0x4d46ef?.[_0x3b5197(0x1ad)]===_0x3d3a91):undefined,_0x344da1=_0x2bb8e2?.[0x0],_0x13f6c4=_0x2bb8e2?.[0x1];let _0xff92c9=_0x3d3a91?_0x344da1:_0x12477f,_0x2577d1=_0xff92c9&&_0x4eed75[_0xff92c9]?_0x4eed75[_0xff92c9]:undefined;_0x3d3a91&&_0x13f6c4&&(_0x2577d1=_0x13f6c4);const _0x458bce=_0x3d3a91?_0x13f6c4??_0x2577d1:_0x2577d1,_0x1ad7d6=_0x2e95f6||(_0x3d3a91?_0x344da1:undefined),_0x33b46f=_0x3d3a91||_0x458bce?.['appcode']||undefined,_0x5c155d=_0x4cc67a['env']||env(_0x3b5197(0x199))||_0x458bce?.['env']||_0x3eced7[_0x3b5197(0x1c2)]||DEFAULT_CONFIG_VALUES['env'],_0x331bff=_0x458bce?.[_0x3b5197(0x1ac)]||_0x3eced7[_0x3b5197(0x1ac)]||DEFAULT_CONFIG_VALUES['locale'],_0x55ca19=env('COOKIE')||_0x458bce?.['cookie']||_0x3eced7[_0x3b5197(0x1c3)]||undefined,_0x6a567f=env('ACCESS_KEY')||_0x458bce?.[_0x3b5197(0x18f)]||_0x3eced7['accessKey']||undefined,_0x2f4c5b=_0x4cc67a[_0x3b5197(0x194)]||env(_0x3b5197(0x19d))||_0x458bce?.[_0x3b5197(0x194)]||_0x3eced7[_0x3b5197(0x194)],_0x38e490=normalizeLegacyOutputFormat(_0x2f4c5b),_0x19ff3c=env('PAGE_SIZE')||_0x458bce?.[_0x3b5197(0x1bb)]||_0x3eced7[_0x3b5197(0x1bb)],_0x270b38=_0x19ff3c?Number(_0x19ff3c)||undefined:undefined,_0x376c43=env(_0x3b5197(0x1b9))||env('MAX_RISK')||_0x458bce?.[_0x3b5197(0x1ae)]||_0x3eced7[_0x3b5197(0x1ae)]||_0x3eced7[_0x3b5197(0x1c1)],_0xda7e90=_0x376c43===_0x3b5197(0x1a6)||_0x376c43==='write'?_0x376c43:DEFAULT_CONFIG_VALUES[_0x3b5197(0x1ae)],_0x322176=env('VERBOSE'),_0x45c0c4=_0x322176==='1'||_0x322176===_0x3b5197(0x193),_0x9c943=_0x458bce?.[_0x3b5197(0x19b)]||_0x3eced7[_0x3b5197(0x19b)]||DEFAULT_CONFIG_VALUES[_0x3b5197(0x19b)],_0x589635=isDaily(normalizeEnv(String(_0x5c155d)))?_0x3b5197(0x183):_0x3b5197(0x1a1);return{'appCode':typeof _0x33b46f===_0x3b5197(0x1af)&&_0x33b46f[_0x3b5197(0x1ab)]()?_0x33b46f[_0x3b5197(0x1ab)]():undefined,'env':_0x589635,'locale':_0x331bff,'cookie':_0x55ca19,'accessKey':_0x6a567f,'format':_0x38e490,'pageSize':_0x270b38,'riskLevel':_0xda7e90,'verbose':_0x45c0c4,'apiDir':_0x9c943,'apps':_0x4eed75,'defaultApp':_0x2156b1,'currentApp':_0x5a9d03?_0xff92c9:undefined,'explicitAppName':_0x1ad7d6,'raw':_0x3eced7};}async function buildAuth(_0x3d8673){const _0x4bb619=a137_0x1d93bc,{getCookie:_0x3d4e40}=await import(_0x4bb619(0x17e)),_0x3b2844=_0x3d8673[_0x4bb619(0x1c3)]||_0x3d4e40(),_0xd0480d=_0x3b2844?await getIsSessionValid():![];return{'cookie':_0x3b2844,'isLoggedIn':_0xd0480d,async 'getOrLogin'(){const _0x51d2e8=_0x4bb619;if(_0x3b2844&&_0xd0480d)return _0x3b2844;throw CliErrors[_0x51d2e8(0x19f)]();}};}export function resolveApiFilePath(_0x5968a1,_0x4176a4){const _0x48f01e=a137_0x1d93bc,_0x42a22d=resolve(process['cwd'](),_0x5968a1),_0x5c2414=resolve(_0x42a22d,_0x48f01e(0x1b4));if(!_0x4176a4)return _0x5c2414;const _0x118903=readRawConfig(),_0x3bbe8c=_0x118903[_0x48f01e(0x186)]&&typeof _0x118903['apps']===_0x48f01e(0x1c4)?_0x118903['apps']:{},_0x1f5df0=Object[_0x48f01e(0x196)](_0x3bbe8c)['find'](([,_0x44fc63])=>_0x44fc63?.[_0x48f01e(0x1ad)]===_0x4176a4);if(!_0x1f5df0)return _0x5c2414;const [_0x4c19b3,_0x4d8437]=_0x1f5df0,_0x45729d=typeof _0x118903[_0x48f01e(0x1a3)]===_0x48f01e(0x1af)?_0x118903[_0x48f01e(0x1a3)]:undefined;if(_0x4d8437?.[_0x48f01e(0x19b)])return _0x5c2414;if(_0x45729d&&_0x4c19b3!==_0x45729d)return resolve(_0x42a22d,_0x4c19b3+_0x48f01e(0x198));return _0x5c2414;}
1
+ const a137_0x1e4d70=a137_0xe70a;(function(_0x32cac4,_0x4bf18d){const _0x44193=a137_0xe70a,_0x43c3c3=_0x32cac4();while(!![]){try{const _0x1002b7=parseInt(_0x44193(0x213))/0x1+-parseInt(_0x44193(0x22f))/0x2*(-parseInt(_0x44193(0x21a))/0x3)+-parseInt(_0x44193(0x223))/0x4*(parseInt(_0x44193(0x221))/0x5)+-parseInt(_0x44193(0x20f))/0x6+parseInt(_0x44193(0x1f2))/0x7*(parseInt(_0x44193(0x1e8))/0x8)+-parseInt(_0x44193(0x216))/0x9+parseInt(_0x44193(0x1e7))/0xa;if(_0x1002b7===_0x4bf18d)break;else _0x43c3c3['push'](_0x43c3c3['shift']());}catch(_0x1a4586){_0x43c3c3['push'](_0x43c3c3['shift']());}}}(a137_0x50f9,0x7ffd9));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';function a137_0xe70a(_0x51f583,_0x18a142){_0x51f583=_0x51f583-0x1e4;const _0x50f9fc=a137_0x50f9();let _0xe70a80=_0x50f9fc[_0x51f583];return _0xe70a80;}import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x6544bb){return process.env[`RABETBASE_${_0x6544bb}`]||process.env[`LOVRABET_${_0x6544bb}`]||undefined;}export const NEW_CONFIG_NAME=a137_0x1e4d70(0x1e9);export const CONFIG_NAMES=[a137_0x1e4d70(0x1e9),a137_0x1e4d70(0x20c),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a137_0x1e4d70(0x235)](_0x36e7ff=>_0x36e7ff!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3e42cd){for(const _0x363392 of CONFIG_NAMES){const _0x5c2cbc=resolve(_0x3e42cd,_0x363392);if(existsSync(_0x5c2cbc))return _0x5c2cbc;}return undefined;}export function findProjectRootDirectory(_0x5ecbdf=process[a137_0x1e4d70(0x21e)]()){let _0x2e80f5=resolve(_0x5ecbdf);const {root:_0x4eea37}=parse(_0x2e80f5),_0x3c944b=homedir();while(!![]){if(resolveConfigPath(_0x2e80f5)){if(_0x2e80f5===_0x3c944b)break;return _0x2e80f5;}if(_0x2e80f5===_0x4eea37||_0x2e80f5===_0x3c944b)break;const _0x8a0750=dirname(_0x2e80f5);if(_0x8a0750===_0x2e80f5)break;_0x2e80f5=_0x8a0750;}return resolve(_0x5ecbdf);}export async function createContext(_0x3f6903){const _0x34270b=a137_0x1e4d70,_0x252346=readRawConfig(),_0x2aa665=buildConfig(_0x252346,_0x3f6903),{initEnv:_0x2d056d}=await import(_0x34270b(0x1e6));if(_0x2aa665[_0x34270b(0x1f5)])_0x2d056d(_0x2aa665[_0x34270b(0x1f5)]);else _0x3f6903[_0x34270b(0x1f5)]&&typeof _0x3f6903['env']==='string'&&_0x2d056d(_0x3f6903['env']);const {initDomains:_0x52b6f6,getUserDomain:_0x205b8e,getApiDomain:_0x593926}=await import(_0x34270b(0x1fc));_0x52b6f6({'apiDomain':_0x252346[_0x34270b(0x1ea)]||undefined,'userDomain':_0x252346[_0x34270b(0x211)]||undefined,'runtimeDomain':_0x252346['runtimeDomain']||undefined});const _0x115f46={'apiDomain':_0x593926(),'userDomain':_0x205b8e()},_0x34246a=await buildAuth(_0x2aa665);logger['setLogPath'](process[_0x34270b(0x21e)]());const _0x6c5bad=(CLI_BIN_NAME+'\x20'+process['argv'][_0x34270b(0x21d)](0x2)[_0x34270b(0x21b)]('\x20'))[_0x34270b(0x1f9)]();logger[_0x34270b(0x1e5)](_0x6c5bad);const {isNonInteractive:_0x5c703a}=await import(_0x34270b(0x230)),_0xbd2e0=_0x5c703a(_0x3f6903);return{'config':_0x2aa665,'auth':_0x34246a,'logger':logger,'env':_0x115f46,'nonInteractive':_0xbd2e0};}export function buildConfigFromFlags(_0x4457ee){return buildConfig(readRawConfig(),_0x4457ee);}export function getProjectConfigPath(){const _0xefe731=a137_0x1e4d70;return resolveConfigPath(process[_0xefe731(0x21e)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x201780){const _0x45d05e=a137_0x1e4d70;if(!existsSync(_0x201780))return{'status':_0x45d05e(0x233)};try{const _0x204b2e=readFileSync(_0x201780,{'encoding':_0x45d05e(0x1fd)});if(!_0x204b2e?.[_0x45d05e(0x1f9)]())return{'status':_0x45d05e(0x22e)};const _0x124d6b=JSON['parse'](_0x204b2e);return{'status':'ok','data':_0x124d6b};}catch(_0x1e6c1a){return{'status':_0x45d05e(0x1ff),'message':_0x1e6c1a instanceof Error?_0x1e6c1a[_0x45d05e(0x207)]:String(_0x1e6c1a)};}}function a137_0x50f9(){const _0x172e95=['object','trim','cookie','stringify','./constant/domain.js','utf8','daily','error','-api.ts','Project','locale','RISK_LEVEL','inherit','format','\x0a\x20\x20','message','APP','template_base_url','Global','accessKey','.lovrabet.json','status','true','841200KQkfGO','replace','userDomain','MAX_RISK','472496BuYroG','values','apps','4962762WzsMOR','config','merged','project','18222LLImVI','join','app','slice','cwd','ACCESS_KEY','defaultApp','5NxgjbP','pageSize','3732700sAIWMI','map','appcode','api.ts','write','entries','riskLevel','silent','string','authRequired','length','empty','202McVYdZ','./utils/is-non-interactive.js','apiDir','keys','missing','set','filter','data','setRawCommand','./constant/env.js','2499490CVVDPm','4008ccwEVO','.rabetbase.json','apiDomain','production','projectConfig','COOKIE','migrated','find','maxRisk','.tmp','11361qogPQO','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','get','env','warn','https://g.lovrabet.com/dist/lovrabet-skill'];a137_0x50f9=function(){return _0x172e95;};return a137_0x50f9();}function parseCliConfigJsonFile(_0x3cc238,_0x5c896b,_0x366924){const _0x2924fc=a137_0x1e4d70,_0x3a3407=inspectCliConfigJsonFile(_0x3cc238);if(_0x3a3407[_0x2924fc(0x20d)]===_0x2924fc(0x233)||_0x3a3407['status']===_0x2924fc(0x22e))return{};if(_0x3a3407[_0x2924fc(0x20d)]==='ok')return _0x3a3407[_0x2924fc(0x1e4)];return _0x5c896b===_0x2924fc(0x1f6)&&_0x366924&&console['error'](CLI_BIN_NAME+':\x20'+_0x366924+_0x2924fc(0x1f3)+_0x3cc238+_0x2924fc(0x206)+_0x3a3407['message']),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x5324dd){const _0x10e681=a137_0x1e4d70;if(!_0x5324dd||typeof _0x5324dd!==_0x10e681(0x1f8))return{'config':{},'migrated':![]};const _0x4ed4b3={..._0x5324dd},_0x54c475=_0x4ed4b3[_0x10e681(0x215)]&&typeof _0x4ed4b3[_0x10e681(0x215)]===_0x10e681(0x1f8)?{..._0x4ed4b3[_0x10e681(0x215)]}:{},_0x2e985a=Object[_0x10e681(0x232)](_0x54c475)[_0x10e681(0x22d)],_0xd35a0d=_0x4ed4b3[_0x10e681(0x225)]||_0x4ed4b3[_0x10e681(0x21c)];let _0x48232d=![];if(_0xd35a0d&&_0x2e985a===0x0){const _0x4a16ec=typeof _0x4ed4b3[_0x10e681(0x220)]===_0x10e681(0x22b)&&_0x4ed4b3[_0x10e681(0x220)]['trim']()?_0x4ed4b3['defaultApp']:String(_0xd35a0d)[_0x10e681(0x1f9)]();_0x54c475[_0x4a16ec]={'appcode':String(_0xd35a0d)['trim'](),..._0x4ed4b3[_0x10e681(0x1f5)]!=null?{'env':_0x4ed4b3[_0x10e681(0x1f5)]}:{},..._0x4ed4b3['apiDir']!=null?{'apiDir':_0x4ed4b3['apiDir']}:{},..._0x4ed4b3[_0x10e681(0x1fa)]!=null?{'cookie':_0x4ed4b3[_0x10e681(0x1fa)]}:{},..._0x4ed4b3[_0x10e681(0x20b)]!=null?{'accessKey':_0x4ed4b3[_0x10e681(0x20b)]}:{},..._0x4ed4b3['format']!=null?{'format':_0x4ed4b3['format']}:{},..._0x4ed4b3[_0x10e681(0x222)]!=null?{'pageSize':_0x4ed4b3['pageSize']}:{},..._0x4ed4b3[_0x10e681(0x229)]!=null?{'riskLevel':_0x4ed4b3[_0x10e681(0x229)]}:{},..._0x4ed4b3[_0x10e681(0x202)]!=null?{'locale':_0x4ed4b3[_0x10e681(0x202)]}:{}},_0x4ed4b3[_0x10e681(0x215)]=_0x54c475;if(!_0x4ed4b3[_0x10e681(0x220)])_0x4ed4b3['defaultApp']=_0x4a16ec;_0x48232d=!![];}return('appcode'in _0x4ed4b3||_0x10e681(0x21c)in _0x4ed4b3)&&(delete _0x4ed4b3[_0x10e681(0x225)],delete _0x4ed4b3['app'],_0x48232d=!![]),{'config':_0x4ed4b3,'migrated':_0x48232d};}function writeNormalizedConfigIfNeeded(_0xa1baeb,_0x38cae1){const _0x926fd7=a137_0x1e4d70,_0x3b4032=JSON[_0x926fd7(0x1fb)](_0x38cae1,null,0x2)+'\x0a';if(normalizedWriteCache[_0x926fd7(0x1f4)](_0xa1baeb)===_0x3b4032)return;writeConfigFile(_0xa1baeb,_0x38cae1),normalizedWriteCache[_0x926fd7(0x234)](_0xa1baeb,_0x3b4032);}function parseAndNormalizeConfig(_0x504ba9,_0x10199e,_0x5390c1){const _0x59c8cf=a137_0x1e4d70,_0x3a2628=parseCliConfigJsonFile(_0x504ba9,_0x10199e,_0x5390c1),_0x128c30=normalizeLegacyConfigShape(_0x3a2628);if(_0x128c30[_0x59c8cf(0x1ee)])try{writeNormalizedConfigIfNeeded(_0x504ba9,_0x128c30[_0x59c8cf(0x217)]);}catch{}return _0x128c30['config'];}export function loadRawConfigLayers(_0x24d890){const _0x14bca9=a137_0x1e4d70;let _0xce2de3={},_0x566687={};const _0x144f48=resolveConfigPath(homedir());_0x144f48&&(_0xce2de3=parseAndNormalizeConfig(_0x144f48,'warn',_0x14bca9(0x20a)));const _0x456373=_0x24d890??findProjectRootDirectory(),_0x3464d4=resolveConfigPath(_0x456373);return _0x3464d4&&(_0x566687=parseAndNormalizeConfig(_0x3464d4,'warn',_0x14bca9(0x201))),{'globalPath':_0x144f48,'projectPath':_0x3464d4,'globalConfig':_0xce2de3,'projectConfig':_0x566687};}function mergeRawConfigLayers(_0xe34d3d){const _0x281aa4=a137_0x1e4d70,{globalConfig:_0x2ad819,projectConfig:_0x43cba8}=_0xe34d3d;if(_0x43cba8[_0x281aa4(0x204)]===![]){const _0x5787ad={..._0x43cba8};delete _0x5787ad['inherit'];const _0x2feabb=_0x43cba8['apps']&&typeof _0x43cba8[_0x281aa4(0x215)]===_0x281aa4(0x1f8)?_0x43cba8['apps']:{};Object[_0x281aa4(0x232)](_0x2feabb)[_0x281aa4(0x22d)]>0x0?_0x5787ad[_0x281aa4(0x215)]=_0x2feabb:delete _0x5787ad['apps'];if(_0x281aa4(0x220)in _0x43cba8)_0x5787ad[_0x281aa4(0x220)]=_0x43cba8[_0x281aa4(0x220)];else Object[_0x281aa4(0x232)](_0x2feabb)[_0x281aa4(0x22d)]>0x0&&(_0x5787ad[_0x281aa4(0x220)]=Object[_0x281aa4(0x232)](_0x2feabb)[0x0]);return _0x5787ad;}const _0x47b883=_0x2ad819[_0x281aa4(0x215)]&&typeof _0x2ad819[_0x281aa4(0x215)]===_0x281aa4(0x1f8)?_0x2ad819[_0x281aa4(0x215)]:{},_0xd9e33d=_0x43cba8[_0x281aa4(0x215)]&&typeof _0x43cba8[_0x281aa4(0x215)]==='object'?_0x43cba8[_0x281aa4(0x215)]:{},_0x374e2a={..._0x47b883,..._0xd9e33d},_0x4b8438={..._0x2ad819,..._0x43cba8};Object[_0x281aa4(0x232)](_0x374e2a)['length']>0x0&&(_0x4b8438['apps']=_0x374e2a);if(_0x281aa4(0x220)in _0x43cba8)_0x4b8438[_0x281aa4(0x220)]=_0x43cba8[_0x281aa4(0x220)];else{if(_0xd9e33d&&Object[_0x281aa4(0x232)](_0xd9e33d)['length']>0x0)_0x4b8438[_0x281aa4(0x220)]=Object[_0x281aa4(0x232)](_0xd9e33d)[0x0];else{if(_0x2ad819[_0x281aa4(0x220)])_0x4b8438['defaultApp']=_0x2ad819[_0x281aa4(0x220)];else{const _0x1b2334=Object[_0x281aa4(0x232)](_0x47b883);_0x1b2334[_0x281aa4(0x22d)]>0x0&&(_0x4b8438['defaultApp']=_0x1b2334[0x0]);}}}return _0x4b8438;}export function readRawConfigWithLayers(_0x28530b){const _0x176d7e=loadRawConfigLayers(_0x28530b);return{'config':mergeRawConfigLayers(_0x176d7e),'layers':_0x176d7e};}export function readRawConfig(_0x15247c){return mergeRawConfigLayers(loadRawConfigLayers(_0x15247c));}export function getConfigAppCode(_0x270983){const _0x49f66e=a137_0x1e4d70,_0x473ab3=readRawConfig(_0x270983);if(_0x473ab3[_0x49f66e(0x215)]&&typeof _0x473ab3[_0x49f66e(0x215)]===_0x49f66e(0x1f8)){const _0x428332=_0x473ab3[_0x49f66e(0x220)];if(_0x428332&&_0x473ab3['apps'][_0x428332]?.['appcode'])return String(_0x473ab3['apps'][_0x428332][_0x49f66e(0x225)])[_0x49f66e(0x1f9)]();const _0x198b6c=Object[_0x49f66e(0x214)](_0x473ab3[_0x49f66e(0x215)])[0x0];if(_0x198b6c?.[_0x49f66e(0x225)])return String(_0x198b6c[_0x49f66e(0x225)])['trim']();}const _0x312043=_0x473ab3[_0x49f66e(0x225)]||_0x473ab3[_0x49f66e(0x21c)];if(typeof _0x312043!==_0x49f66e(0x22b)||_0x312043['trim']()==='')return undefined;return _0x312043[_0x49f66e(0x1f9)]();}export function getMultiAppConfigs(_0x461cf3='project',_0x32594f){const _0x259041=a137_0x1e4d70,_0x492255=_0x461cf3===_0x259041(0x218)?readRawConfig(_0x32594f):loadRawConfigLayers(_0x32594f)[_0x259041(0x1ec)],_0x1685f8=_0x492255[_0x259041(0x215)];if(!_0x1685f8||typeof _0x1685f8!=='object'||Object['keys'](_0x1685f8)[_0x259041(0x22d)]===0x0)return null;const _0x4eb6d1=_0x492255[_0x259041(0x220)];return Object[_0x259041(0x228)](_0x1685f8)[_0x259041(0x224)](([_0x1b9f13,_0x2d48d8])=>({'name':_0x1b9f13,'appcode':_0x2d48d8?.['appcode']||'','isDefault':_0x1b9f13===_0x4eb6d1,'env':_0x2d48d8?.['env'],'apiDir':_0x2d48d8?.['apiDir'],'cookie':_0x2d48d8?.[_0x259041(0x1fa)]||undefined}))[_0x259041(0x235)](_0x6e8e30=>_0x6e8e30[_0x259041(0x225)]);}export function getTemplateBaseUrl(_0x7cdf50){const _0x42e599=a137_0x1e4d70,_0x1a2360=readRawConfig(_0x7cdf50);if(_0x1a2360[_0x42e599(0x209)]&&typeof _0x1a2360[_0x42e599(0x209)]===_0x42e599(0x22b))return _0x1a2360[_0x42e599(0x209)][_0x42e599(0x210)](/\/$/,'');return _0x42e599(0x1f7);}export function readConfigFile(_0x49bfd2){const _0x8b9cd6=a137_0x1e4d70;return parseAndNormalizeConfig(_0x49bfd2,_0x8b9cd6(0x22a));}export function writeConfigFile(_0x2dbcab,_0x4e9f3a){const _0x42f86f=a137_0x1e4d70,_0x1088cd=dirname(_0x2dbcab);!existsSync(_0x1088cd)&&mkdirSync(_0x1088cd,{'recursive':!![]});const _0xa9e41e=_0x2dbcab+_0x42f86f(0x1f1);try{writeFileSync(_0xa9e41e,JSON[_0x42f86f(0x1fb)](_0x4e9f3a,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xa9e41e,_0x2dbcab);}catch(_0x565f99){try{unlinkSync(_0xa9e41e);}catch{}throw _0x565f99;}}export function resolveWriteConfigPath(_0x2b6c70){const _0x4b31cc=a137_0x1e4d70,_0x287eeb=_0x2b6c70===_0x4b31cc(0x219)?process[_0x4b31cc(0x21e)]():homedir(),_0x55f715=resolveConfigPath(_0x287eeb);return _0x55f715??resolve(_0x287eeb,NEW_CONFIG_NAME);}function buildConfig(_0x593fdf,_0x512f0e){const _0x283411=a137_0x1e4d70,_0x5f0d1d={};if(_0x593fdf[_0x283411(0x215)]&&typeof _0x593fdf[_0x283411(0x215)]===_0x283411(0x1f8))for(const [_0x403686,_0x4eb99d]of Object[_0x283411(0x228)](_0x593fdf['apps'])){_0x4eb99d&&typeof _0x4eb99d===_0x283411(0x1f8)&&_0x4eb99d[_0x283411(0x225)]&&(_0x5f0d1d[_0x403686]=_0x4eb99d);}const _0x5a56a1=_0x593fdf[_0x283411(0x220)]||undefined,_0x1a5279=Object[_0x283411(0x232)](_0x5f0d1d)[_0x283411(0x22d)]>0x0,_0x444b39=_0x512f0e[_0x283411(0x21c)]||env(_0x283411(0x208))||undefined,_0x27514e=_0x444b39||_0x5a56a1||undefined,_0x43a39=_0x512f0e[_0x283411(0x225)]||env('APPCODE')||undefined,_0x3178df=_0x43a39?Object[_0x283411(0x228)](_0x5f0d1d)['find'](([,_0x3a72d5])=>_0x3a72d5?.['appcode']===_0x43a39):undefined,_0x16b88e=_0x3178df?.[0x0],_0x115faf=_0x3178df?.[0x1];let _0x4c91c2=_0x43a39?_0x16b88e:_0x27514e,_0x2f7651=_0x4c91c2&&_0x5f0d1d[_0x4c91c2]?_0x5f0d1d[_0x4c91c2]:undefined;_0x43a39&&_0x115faf&&(_0x2f7651=_0x115faf);const _0xdcb992=_0x43a39?_0x115faf??_0x2f7651:_0x2f7651,_0xfe1781=_0x444b39||(_0x43a39?_0x16b88e:undefined),_0x48db7f=_0x43a39||_0xdcb992?.[_0x283411(0x225)]||undefined,_0x4fc26e=_0x512f0e[_0x283411(0x1f5)]||env('ENV')||_0xdcb992?.['env']||_0x593fdf[_0x283411(0x1f5)]||DEFAULT_CONFIG_VALUES[_0x283411(0x1f5)],_0x4c3398=_0xdcb992?.[_0x283411(0x202)]||_0x593fdf[_0x283411(0x202)]||DEFAULT_CONFIG_VALUES[_0x283411(0x202)],_0x31c270=env(_0x283411(0x1ed))||_0xdcb992?.[_0x283411(0x1fa)]||_0x593fdf[_0x283411(0x1fa)]||undefined,_0x926cab=env(_0x283411(0x21f))||_0xdcb992?.['accessKey']||_0x593fdf[_0x283411(0x20b)]||undefined,_0x2f8ac0=_0x512f0e['format']||env('FORMAT')||_0xdcb992?.['format']||_0x593fdf[_0x283411(0x205)],_0x2f1a7c=normalizeLegacyOutputFormat(_0x2f8ac0),_0x560c81=env('PAGE_SIZE')||_0xdcb992?.['pageSize']||_0x593fdf[_0x283411(0x222)],_0x13e21f=_0x560c81?Number(_0x560c81)||undefined:undefined,_0x575976=env(_0x283411(0x203))||env(_0x283411(0x212))||_0xdcb992?.['riskLevel']||_0x593fdf['riskLevel']||_0x593fdf[_0x283411(0x1f0)],_0x51e6a6=_0x575976==='read'||_0x575976===_0x283411(0x227)?_0x575976:DEFAULT_CONFIG_VALUES[_0x283411(0x229)],_0x3a0476=env('VERBOSE'),_0x5a1ede=_0x3a0476==='1'||_0x3a0476===_0x283411(0x20e),_0xaf5a53=_0xdcb992?.['apiDir']||_0x593fdf[_0x283411(0x231)]||DEFAULT_CONFIG_VALUES[_0x283411(0x231)],_0x78477f=isDaily(normalizeEnv(String(_0x4fc26e)))?_0x283411(0x1fe):_0x283411(0x1eb);return{'appCode':typeof _0x48db7f===_0x283411(0x22b)&&_0x48db7f['trim']()?_0x48db7f[_0x283411(0x1f9)]():undefined,'env':_0x78477f,'locale':_0x4c3398,'cookie':_0x31c270,'accessKey':_0x926cab,'format':_0x2f1a7c,'pageSize':_0x13e21f,'riskLevel':_0x51e6a6,'verbose':_0x5a1ede,'apiDir':_0xaf5a53,'apps':_0x5f0d1d,'defaultApp':_0x5a56a1,'currentApp':_0x1a5279?_0x4c91c2:undefined,'explicitAppName':_0xfe1781,'raw':_0x593fdf};}async function buildAuth(_0x57e20d){const _0x2fc672=a137_0x1e4d70,{getCookie:_0x2f7574}=await import('./auth/get-cookie.js'),_0x5b2a8b=_0x57e20d[_0x2fc672(0x1fa)]||_0x2f7574(),_0x3fa0f3=_0x5b2a8b?await getIsSessionValid():![];return{'cookie':_0x5b2a8b,'isLoggedIn':_0x3fa0f3,async 'getOrLogin'(){const _0x463362=_0x2fc672;if(_0x5b2a8b&&_0x3fa0f3)return _0x5b2a8b;throw CliErrors[_0x463362(0x22c)]();}};}export function resolveApiFilePath(_0x144abc,_0x42c81e){const _0x97cf43=a137_0x1e4d70,_0x927ac7=resolve(process[_0x97cf43(0x21e)](),_0x144abc),_0x19adb2=resolve(_0x927ac7,_0x97cf43(0x226));if(!_0x42c81e)return _0x19adb2;const _0x24da82=readRawConfig(),_0xab72f1=_0x24da82[_0x97cf43(0x215)]&&typeof _0x24da82[_0x97cf43(0x215)]==='object'?_0x24da82[_0x97cf43(0x215)]:{},_0x6a607f=Object[_0x97cf43(0x228)](_0xab72f1)[_0x97cf43(0x1ef)](([,_0x728964])=>_0x728964?.[_0x97cf43(0x225)]===_0x42c81e);if(!_0x6a607f)return _0x19adb2;const [_0x2a8197,_0x531cee]=_0x6a607f,_0x565dae=typeof _0x24da82[_0x97cf43(0x220)]===_0x97cf43(0x22b)?_0x24da82[_0x97cf43(0x220)]:undefined;if(_0x531cee?.[_0x97cf43(0x231)])return _0x19adb2;if(_0x565dae&&_0x2a8197!==_0x565dae)return resolve(_0x927ac7,_0x2a8197+_0x97cf43(0x200));return _0x19adb2;}
@@ -1 +1 @@
1
- function a138_0x3dfe(_0x2a7b71,_0x3dfdf7){_0x2a7b71=_0x2a7b71-0xe6;const _0x49a797=a138_0x49a7();let _0x3dfeb8=_0x49a797[_0x2a7b71];return _0x3dfeb8;}(function(_0x39b6a2,_0x4c7259){const _0x392dd8=a138_0x3dfe,_0xc6e926=_0x39b6a2();while(!![]){try{const _0x94b32d=-parseInt(_0x392dd8(0xf6))/0x1+parseInt(_0x392dd8(0xeb))/0x2*(-parseInt(_0x392dd8(0xef))/0x3)+parseInt(_0x392dd8(0xe6))/0x4+parseInt(_0x392dd8(0xe7))/0x5+parseInt(_0x392dd8(0xed))/0x6+parseInt(_0x392dd8(0xea))/0x7*(-parseInt(_0x392dd8(0xee))/0x8)+parseInt(_0x392dd8(0xf4))/0x9;if(_0x94b32d===_0x4c7259)break;else _0xc6e926['push'](_0xc6e926['shift']());}catch(_0xdddcce){_0xc6e926['push'](_0xc6e926['shift']());}}}(a138_0x49a7,0x39530));import{readFileSync,existsSync}from'node:fs';function a138_0x49a7(){const _0x43b14=['180050fCsUAu','get','1327344aGBscf','1049552Gpdywj','12gAilDQ','api.ts','push','set','cwd','2417904oTljMW','has','412451whsuGV','737796iKdCFR','2321080wcTWaD','exec','find','7TTplOR'];a138_0x49a7=function(){return _0x43b14;};return a138_0x49a7();}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x1bfaa0){const _0x3d5339=a138_0x3dfe,_0xae3e5d=[],_0x42307b=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x2e5aed;while((_0x2e5aed=_0x42307b[_0x3d5339(0xe8)](_0x1bfaa0))!==null){_0xae3e5d[_0x3d5339(0xf1)]({'datasetCode':_0x2e5aed[0x1],'tableName':_0x2e5aed[0x2],'name':_0x2e5aed[0x3],'alias':_0x2e5aed[0x4]});}return _0xae3e5d;}export function loadAliasMap(_0x567212,_0x2e925d,_0x442a21){const _0x1f60a1=a138_0x3dfe,_0x23eb65=_0x442a21??resolve(process[_0x1f60a1(0xf3)](),_0x567212,_0x1f60a1(0xf0));if(cache[_0x1f60a1(0xf5)](_0x23eb65))return cache[_0x1f60a1(0xec)](_0x23eb65);if(!existsSync(_0x23eb65))return cache['set'](_0x23eb65,[]),[];try{const _0x1c4430=readFileSync(_0x23eb65,'utf-8'),_0x457dca=parseApiFile(_0x1c4430);return cache[_0x1f60a1(0xf2)](_0x23eb65,_0x457dca),_0x457dca;}catch{return cache[_0x1f60a1(0xf2)](_0x23eb65,[]),[];}}export function resolveAlias(_0x5bd73d,_0x277a43,_0x1668d3,_0x3b70c5){const _0x5539aa=a138_0x3dfe;if(!_0x277a43)return undefined;const _0x139511=loadAliasMap(_0x5bd73d,_0x1668d3,_0x3b70c5),_0x1806bd=_0x139511[_0x5539aa(0xe9)](_0x48fcd1=>_0x48fcd1['alias']===_0x277a43);return _0x1806bd?.['datasetCode'];}export function listAliases(_0x1f8769,_0x59307a,_0x5243ca){return loadAliasMap(_0x1f8769,_0x59307a,_0x5243ca);}
1
+ (function(_0x551f80,_0x57feca){const _0x594211=a138_0xab58,_0x3b063b=_0x551f80();while(!![]){try{const _0x2af248=parseInt(_0x594211(0x1dc))/0x1*(-parseInt(_0x594211(0x1d7))/0x2)+-parseInt(_0x594211(0x1de))/0x3*(-parseInt(_0x594211(0x1d9))/0x4)+parseInt(_0x594211(0x1cf))/0x5+-parseInt(_0x594211(0x1db))/0x6*(-parseInt(_0x594211(0x1d3))/0x7)+-parseInt(_0x594211(0x1df))/0x8+parseInt(_0x594211(0x1d8))/0x9+-parseInt(_0x594211(0x1d2))/0xa*(parseInt(_0x594211(0x1ce))/0xb);if(_0x2af248===_0x57feca)break;else _0x3b063b['push'](_0x3b063b['shift']());}catch(_0x292ea9){_0x3b063b['push'](_0x3b063b['shift']());}}}(a138_0x103a,0xe01a5));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x1e15be){const _0x48c9c8=a138_0xab58,_0x4186bb=[],_0x154a22=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1f7417;while((_0x1f7417=_0x154a22[_0x48c9c8(0x1dd)](_0x1e15be))!==null){_0x4186bb['push']({'datasetCode':_0x1f7417[0x1],'tableName':_0x1f7417[0x2],'name':_0x1f7417[0x3],'alias':_0x1f7417[0x4]});}return _0x4186bb;}export function loadAliasMap(_0x3e41c3,_0x46a7e,_0x284552){const _0x26efba=a138_0xab58,_0x22c16b=_0x284552??resolve(process['cwd'](),_0x3e41c3,_0x26efba(0x1e0));if(cache[_0x26efba(0x1da)](_0x22c16b))return cache[_0x26efba(0x1d4)](_0x22c16b);if(!existsSync(_0x22c16b))return cache[_0x26efba(0x1d1)](_0x22c16b,[]),[];try{const _0x287516=readFileSync(_0x22c16b,'utf-8'),_0x436adc=parseApiFile(_0x287516);return cache[_0x26efba(0x1d1)](_0x22c16b,_0x436adc),_0x436adc;}catch{return cache[_0x26efba(0x1d1)](_0x22c16b,[]),[];}}function a138_0xab58(_0x2ea0c6,_0x5b3d57){_0x2ea0c6=_0x2ea0c6-0x1ce;const _0x103a5b=a138_0x103a();let _0xab5846=_0x103a5b[_0x2ea0c6];return _0xab5846;}export function resolveAlias(_0x2cf180,_0x14f41d,_0xab5923,_0x5f52b9){const _0x2795f1=a138_0xab58;if(!_0x14f41d)return undefined;const _0x5cf3ce=loadAliasMap(_0x2cf180,_0xab5923,_0x5f52b9),_0x32f57e=_0x5cf3ce[_0x2795f1(0x1d5)](_0xdd4960=>_0xdd4960[_0x2795f1(0x1d6)]===_0x14f41d);return _0x32f57e?.[_0x2795f1(0x1d0)];}export function listAliases(_0x5e9bf2,_0x2eca3a,_0x4f67cc){return loadAliasMap(_0x5e9bf2,_0x2eca3a,_0x4f67cc);}function a138_0x103a(){const _0xff4302=['6177582vgOeaH','4tymVFH','has','12wSciBn','118mBqMwQ','exec','754959fPCFcI','13541464MEWMFg','api.ts','189706kLCncS','6841985JODzeE','datasetCode','set','320ledGmG','5719434wdemvK','get','find','alias','13188egwIbU'];a138_0x103a=function(){return _0xff4302;};return a138_0x103a();}
@@ -1 +1 @@
1
- (function(_0xb621bf,_0x46741e){const _0x542414=a139_0x4316,_0x25c318=_0xb621bf();while(!![]){try{const _0x71e048=parseInt(_0x542414(0x111))/0x1+-parseInt(_0x542414(0x92))/0x2+-parseInt(_0x542414(0x9a))/0x3*(-parseInt(_0x542414(0x101))/0x4)+parseInt(_0x542414(0xd6))/0x5*(parseInt(_0x542414(0x8f))/0x6)+-parseInt(_0x542414(0xa6))/0x7*(parseInt(_0x542414(0xf9))/0x8)+-parseInt(_0x542414(0x10e))/0x9+parseInt(_0x542414(0xd4))/0xa*(parseInt(_0x542414(0x121))/0xb);if(_0x71e048===_0x46741e)break;else _0x25c318['push'](_0x25c318['shift']());}catch(_0x4f85e9){_0x25c318['push'](_0x25c318['shift']());}}}(a139_0x3c1a,0xf02a6));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(_0x4f383e){_activeCookie=_0x4f383e||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x2a522a,_0x1478d8){const _0x21142e=a139_0x4316,_0x57eccf=_0x1478d8 instanceof Error?_0x1478d8[_0x21142e(0x8a)]:String(_0x1478d8);return CliErrors['apiError'](_0x21142e(0xac)+_0x2a522a+(_0x57eccf?'\x20('+_0x57eccf+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x30bc44,_0xd211c4={}){const _0x18b9de=a139_0x4316,{method:method=_0x18b9de(0xc0),body:_0xcb9593,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0xd211c4,_0x2acd9c=useRuntime?getRuntimeDomain():getApiDomain(),_0x1c50f4=_activeCookie||getCookie(),_0x2450bd=''+_0x2acd9c+_0x30bc44,_0x188501=new AbortController(),_0x773c2b=setTimeout(()=>_0x188501['abort'](),timeout);try{const _0x1031e1=await fetch(_0x2450bd,{'method':method,'headers':{'Content-Type':_0x18b9de(0x93),'Cookie':_0x1c50f4,'X-Invoke-Source':_0x18b9de(0x9c),...headers},'body':_0xcb9593?JSON['stringify'](_0xcb9593):undefined,'signal':_0x188501[_0x18b9de(0xce)]});let _0x23bd8a;try{_0x23bd8a=await _0x1031e1[_0x18b9de(0x122)]();}catch{throw CliErrors[_0x18b9de(0xe1)](_0x18b9de(0x120)+_0x1031e1['status']+')',_0x1031e1[_0x18b9de(0xe4)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x1031e1['ok']||_0x23bd8a[_0x18b9de(0x98)]===![])throw CliErrors['apiError'](_0x23bd8a[_0x18b9de(0xa4)]||_0x23bd8a['message']||_0x18b9de(0xef)+_0x1031e1[_0x18b9de(0xe4)],_0x23bd8a[_0x18b9de(0x11e)]?_0x18b9de(0x105)+_0x23bd8a[_0x18b9de(0x11e)]:undefined);return _0x23bd8a;}catch(_0xb20a79){if(_0xb20a79 instanceof CliError)throw _0xb20a79;if(_0xb20a79 instanceof Error&&_0xb20a79[_0x18b9de(0xfa)]===_0x18b9de(0xba))throw CliErrors[_0x18b9de(0xe1)](_0x18b9de(0xb8)+_0x2450bd);throw createFetchFailureError(_0x2450bd,_0xb20a79);}finally{clearTimeout(_0x773c2b);}}function isAuthFailure(_0x104b0a){const _0x89d11a=a139_0x4316,_0x24ea4c=_0x104b0a[_0x89d11a(0xa4)]||_0x104b0a['message']||_0x104b0a[_0x89d11a(0x95)]?.['message']||_0x104b0a[_0x89d11a(0x96)]||_0x104b0a[_0x89d11a(0xb5)]||'';return _0x104b0a[_0x89d11a(0x11e)]==='UNAUTHORIZED'||_0x104b0a[_0x89d11a(0x89)]===0x191||_0x104b0a['code']===_0x89d11a(0x114)||_0x24ea4c[_0x89d11a(0xbc)](_0x89d11a(0x114))||_0x24ea4c['includes'](_0x89d11a(0xcf))||_0x24ea4c[_0x89d11a(0xbc)]('登录')||_0x24ea4c[_0x89d11a(0xbc)]('认证');}export async function platformFetch(_0x478344,_0x5e4f0e){const _0x22824a=a139_0x4316;let _0x5b7da5;try{_0x5b7da5=await fetch(_0x478344,{'method':_0x5e4f0e[_0x22824a(0x9f)]??_0x22824a(0xc0),'headers':{'Content-Type':_0x22824a(0x93),'Cookie':_0x5e4f0e[_0x22824a(0xe8)]},..._0x5e4f0e[_0x22824a(0x83)]&&{'body':JSON[_0x22824a(0xaa)](_0x5e4f0e[_0x22824a(0x83)])}});}catch(_0x319809){throw createFetchFailureError(_0x478344,_0x319809);}if(!_0x5b7da5['ok']){if(_0x5b7da5[_0x22824a(0xe4)]===0x191)throw CliErrors[_0x22824a(0xe6)]();throw CliErrors[_0x22824a(0xe1)](_0x5e4f0e[_0x22824a(0xf5)]+_0x22824a(0x125)+_0x5b7da5['status']);}const _0x7ed4a4=await _0x5b7da5[_0x22824a(0x122)]();if(_0x7ed4a4[_0x22824a(0x98)]===![]){if(isAuthFailure(_0x7ed4a4))throw CliErrors[_0x22824a(0xe6)]();throw CliErrors[_0x22824a(0xe1)](_0x7ed4a4['errorMsg']||_0x7ed4a4[_0x22824a(0x8a)]||_0x5e4f0e[_0x22824a(0xf5)]+_0x22824a(0x115));}return _0x7ed4a4[_0x22824a(0x95)];}export async function listBffScripts(_0x989ff4,_0x594213,_0x3b6943){const _0x52ffc1=a139_0x4316;let _0x2bc8a7=_0x52ffc1(0xbb)+_0x989ff4;if(_0x594213)_0x2bc8a7+=_0x52ffc1(0x84)+_0x594213;const _0x4ee943=await apiRequest(_0x2bc8a7);let _0x1d4ca9=extractList(_0x4ee943[_0x52ffc1(0x95)]);if(_0x3b6943?.[_0x52ffc1(0x8b)]){const _0x1a2d0a=_0x3b6943['scriptName'][_0x52ffc1(0xfc)]();_0x1d4ca9=_0x1d4ca9[_0x52ffc1(0xa2)](_0x53757c=>_0x53757c['functionName']?.[_0x52ffc1(0xfc)]()[_0x52ffc1(0xbc)](_0x1a2d0a)||_0x53757c['description']?.[_0x52ffc1(0xfc)]()[_0x52ffc1(0xbc)](_0x1a2d0a));}return _0x1d4ca9;}export async function getBffScriptInfo(_0xb313e6){const _0x25590d=a139_0x4316,_0x25a379=await apiRequest(_0x25590d(0xf4)+_0xb313e6);if(!_0x25a379[_0x25590d(0x95)])throw CliErrors[_0x25590d(0xc6)](_0x25590d(0x91)+_0xb313e6);return _0x25a379[_0x25590d(0x95)];}export async function saveBffScript(_0x3463b1){const _0x44fc67=a139_0x4316,_0x3b87ab=await apiRequest('/api/management/library/scripts/save',{'method':_0x44fc67(0xc5),'body':_0x3463b1}),{id:_0x8afc4,entity:_0x129886}=normalizeEntityWithIdResponse(_0x3b87ab[_0x44fc67(0x95)]);if(_0x8afc4!==undefined){const _0x3474fb=typeof _0x129886[_0x44fc67(0x10d)]===_0x44fc67(0xcc)||typeof _0x129886['scriptType']===_0x44fc67(0xcc)?_0x129886:undefined;return{'id':_0x8afc4,'script':_0x3474fb};}throw CliErrors[_0x44fc67(0xe1)](_0x44fc67(0xdb));}export async function deleteBffScript(_0x1f0cae){const _0x5def10=a139_0x4316;await apiRequest('/api/management/library/scripts/delete',{'method':_0x5def10(0xc5),'body':{'id':_0x1f0cae}});}export async function getBffScriptStatistics(_0x3d35b1){const _0x6f2a27=a139_0x4316,_0x42bad8=await apiRequest(_0x6f2a27(0xed)+_0x3d35b1);return extractList(_0x42bad8['data']);}export async function clearBffScriptCache(){const _0x57490a=a139_0x4316,_0x541835=await apiRequest(_0x57490a(0xb0),{'method':_0x57490a(0xc5),'useRuntime':!![]});return typeof _0x541835[_0x57490a(0x95)]==='string'?_0x541835['data']:'';}export async function listBffDatasetOperations(_0xcec73c,_0x52ab32){const _0x1ccb17=a139_0x4316,_0x2e98c5=await apiRequest(_0x1ccb17(0xb7),{'method':_0x1ccb17(0xc5),'body':{'appCode':_0xcec73c,'datasetId':_0x52ab32}});return _0x2e98c5['data'];}export async function listSqlQueries(_0x495100,_0x1b1761){const _0x17016c=a139_0x4316,_0x12f790=await apiRequest(_0x17016c(0xd2),{'method':_0x17016c(0xc5),'body':{'appCode':_0x495100,'currentPage':_0x1b1761?.[_0x17016c(0x104)]??0x1,'pageSize':_0x1b1761?.['pageSize']??0x32,'sqlCode':_0x1b1761?.[_0x17016c(0xea)],'sqlName':_0x1b1761?.[_0x17016c(0xf0)]}});return _0x12f790['data'];}export async function getSqlQueryInfo(_0x4b9221,_0x108a9a){const _0x4c1157=a139_0x4316,_0x3b3121=await listSqlQueries(_0x4b9221,{'sqlCode':_0x108a9a}),_0x7df146=_0x3b3121[_0x4c1157(0xfd)]?.[0x0];if(!_0x7df146)throw CliErrors[_0x4c1157(0xc6)](_0x4c1157(0xad)+_0x108a9a);return _0x7df146;}export async function getSqlQueryDetail(_0x5b7279){const _0x5a4674=a139_0x4316,_0x430b72=await apiRequest('/smartapi/custom/getUserCustomSql'+('?sqlCode='+encodeURIComponent(_0x5b7279)));if(!_0x430b72[_0x5a4674(0x95)])throw CliErrors[_0x5a4674(0xc6)](_0x5a4674(0xad)+_0x5b7279);return _0x430b72['data'];}export async function getSqlQueryDetailById(_0xe0ab4d){const _0x932661=a139_0x4316,_0x3bdbd4=await apiRequest(_0x932661(0xd1)+_0xe0ab4d);if(!_0x3bdbd4['data'])throw CliErrors[_0x932661(0xc6)](_0x932661(0xd0)+_0xe0ab4d);return _0x3bdbd4[_0x932661(0x95)];}export async function createSqlQuery(_0xfb6058){const _0x30488=a139_0x4316,_0x2585a4=await apiRequest(_0x30488(0x90),{'method':_0x30488(0xc5),'body':_0xfb6058}),{id:_0x316048,entity:_0x3dbcee}=normalizeEntityWithIdResponse(_0x2585a4[_0x30488(0x95)]);if(!(_0x30488(0xea)in _0x3dbcee)&&_0x316048)return getSqlQueryDetailById(_0x316048);return normalizeSqlQueryEntity(_0x3dbcee);}export async function updateSqlQuery(_0x149110){const _0x29a508=a139_0x4316,_0x1d357f=await apiRequest(_0x29a508(0x118),{'method':_0x29a508(0xc5),'body':_0x149110}),{id:_0x52d5c6,entity:_0x833c3b}=normalizeEntityWithIdResponse(_0x1d357f[_0x29a508(0x95)]);if(!(_0x29a508(0xea)in _0x833c3b)){if(_0x149110['sqlCode'])return getSqlQueryDetail(_0x149110[_0x29a508(0xea)]);if(_0x52d5c6)return getSqlQueryDetailById(_0x52d5c6);}return normalizeSqlQueryEntity(_0x833c3b);}export async function deleteSqlQuery(_0x79f881){const _0x3ed247=a139_0x4316;await apiRequest(_0x3ed247(0x87),{'method':_0x3ed247(0xc5),'body':_0x79f881});}export async function saveSqlQuery(_0xbc1f11){const _0x2f1a65=a139_0x4316,_0x38fcd4=await apiRequest(_0x2f1a65(0xbf),{'method':_0x2f1a65(0xc5),'body':_0xbc1f11});return _0x38fcd4[_0x2f1a65(0x95)];}function normalizeSqlQueryEntity(_0x1eb0ef){const _0x42f8e4=a139_0x4316;return{..._0x1eb0ef,'id':Number(_0x1eb0ef['id']),'dbId':_0x1eb0ef[_0x42f8e4(0xde)]==null?undefined:Number(_0x1eb0ef[_0x42f8e4(0xde)]),'version':_0x1eb0ef[_0x42f8e4(0x123)]==null?undefined:Number(_0x1eb0ef['version'])};}export async function executeSql(_0x9ddfae,_0x4d16ce,_0x5aeaaf){const _0x533a7d=a139_0x4316,_0x49bdda=await apiRequest('/api/custom/executeSql',{'method':_0x533a7d(0xc5),'body':{'appCode':_0x9ddfae,'sqlCode':_0x4d16ce,..._0x5aeaaf&&{'params':_0x5aeaaf}},'useRuntime':!![]});return _0x49bdda['data'];}export async function executeDatasetDataOperation(_0x471ff5,_0x40cf9b,_0x1ce7c4,_0x25d98c={}){const _0x1809e7=a139_0x4316;try{const _0x469e1e=await apiRequest(_0x1809e7(0xb2)+_0x471ff5+'/'+_0x40cf9b+'/'+_0x1ce7c4,{'method':_0x1809e7(0xc5),'body':_0x25d98c,'useRuntime':!![]});return _0x469e1e[_0x1809e7(0x95)];}catch(_0x4838cd){if(_0x1ce7c4===_0x1809e7(0x94)&&_0x4838cd instanceof CliError&&_0x4838cd[_0x1809e7(0x89)]===_0x1809e7(0xb6)&&_0x25d98c['id']!==undefined&&_0x25d98c['id']!==null&&_0x25d98c['id']!==''){const _0x51d9ec=await apiRequest('/api/'+_0x471ff5+'/'+_0x40cf9b+'/filter',{'method':'POST','body':{'where':{'id':{'$eq':_0x25d98c['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2ef3de=Array['isArray'](_0x51d9ec['data']?.[_0x1809e7(0xfd)])?_0x51d9ec[_0x1809e7(0x95)][_0x1809e7(0xfd)]:[];return _0x2ef3de[0x0]??null;}throw _0x4838cd;}}export async function listDatasets(_0x2a74fb,_0x46cff5){const _0x5e52e6=a139_0x4316,_0x596bb1={'appCode':_0x2a74fb,'deleted':![]};if(_0x46cff5?.[_0x5e52e6(0x89)])_0x596bb1[_0x5e52e6(0x89)]=_0x46cff5[_0x5e52e6(0x89)];if(_0x46cff5?.['name'])_0x596bb1[_0x5e52e6(0xfa)]=_0x46cff5[_0x5e52e6(0xfa)];const _0x37f9f0=await apiRequest(_0x5e52e6(0xe3),{'method':'POST','body':_0x596bb1});return extractList(_0x37f9f0['data']);}export async function deleteDataset(_0x3076dd,_0x2bddfd){const _0x4cb55f=a139_0x4316;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x4cb55f(0xc5),'body':{'appCode':_0x3076dd,'datasetId':_0x2bddfd}});}export async function searchDatasets(_0x1003a9,_0x18d48c){const _0x50721c=a139_0x4316,_0x204f78=await listDatasets(_0x1003a9,{'name':_0x18d48c}),_0xda4307=_0x18d48c['toLowerCase'](),_0xb9c43e=new Set(_0x204f78[_0x50721c(0xa8)](_0x31e3cb=>_0x31e3cb['id'])),_0x23b2cc=_0x204f78[_0x50721c(0xa2)](_0x1442fe=>_0x1442fe['dbtableConfig']?.[_0x50721c(0x9e)]?.['toLowerCase']()[_0x50721c(0xbc)](_0xda4307)||_0x1442fe['description']?.[_0x50721c(0xfc)]()[_0x50721c(0xbc)](_0xda4307)),_0x346134=await listDatasets(_0x1003a9,{'code':_0x18d48c});for(const _0x228f3f of _0x346134){!_0xb9c43e[_0x50721c(0xa5)](_0x228f3f['id'])&&(_0x204f78[_0x50721c(0xca)](_0x228f3f),_0xb9c43e[_0x50721c(0x102)](_0x228f3f['id']));}return _0x204f78;}export function normalizeDatasetOperations(_0x4a8859){const _0x390d89=a139_0x4316;if(Array['isArray'](_0x4a8859))return _0x4a8859['filter'](_0xffe3e5=>_0xffe3e5!=null&&typeof _0xffe3e5===_0x390d89(0xdf));if(_0x4a8859&&typeof _0x4a8859===_0x390d89(0xdf))return Object['entries'](_0x4a8859)[_0x390d89(0xa2)](([,_0xaa4f9c])=>_0xaa4f9c!=null&&typeof _0xaa4f9c===_0x390d89(0xdf))[_0x390d89(0xa8)](([_0x1c0a10,_0x139e7b])=>({..._0x139e7b,'name':_0x139e7b['name']??_0x139e7b[_0x390d89(0xc3)]??_0x1c0a10}));return[];}export async function getDatasetDetail(_0x3829a9){const _0x305084=a139_0x4316,_0x49bda6=/^\d+$/['test'](_0x3829a9)?'id':_0x305084(0x89),_0x1ad2f4=await apiRequest(_0x305084(0xb4)+_0x49bda6+'='+_0x3829a9);return _0x1ad2f4['data'];}export async function updateDrivenData(_0x35bcf0){const _0x12d020=a139_0x4316,_0x56fc15=await apiRequest(_0x12d020(0x126),{'method':_0x12d020(0xc5),'body':_0x35bcf0});return _0x56fc15['data'];}export async function getDatasetOperations(_0x48d93d){const _0x50329f=a139_0x4316,_0x190725=await getDatasetDetail(_0x48d93d),_0x32f5b1=normalizeDatasetOperations(_0x190725[_0x50329f(0x11f)])[_0x50329f(0xa8)](_0x1cbf9b=>({'name':_0x1cbf9b['name']||_0x1cbf9b[_0x50329f(0xc3)],'displayName':_0x1cbf9b[_0x50329f(0xb9)]||_0x1cbf9b[_0x50329f(0xfa)],'type':_0x1cbf9b[_0x50329f(0x109)],'method':_0x1cbf9b[_0x50329f(0x9f)],'path':_0x1cbf9b[_0x50329f(0xd5)],'enabled':_0x1cbf9b[_0x50329f(0xc2)]??!![],'requestFields':_0x1cbf9b['requestFields'],'responseFields':_0x1cbf9b[_0x50329f(0x11d)]}));return{'dataset':{'id':_0x190725['id']??_0x190725[_0x50329f(0x113)],'name':_0x190725[_0x50329f(0xfa)],'code':_0x190725[_0x50329f(0x89)]||_0x190725[_0x50329f(0xc8)],'tableName':_0x190725[_0x50329f(0x9e)]||_0x190725[_0x50329f(0x10b)]?.[_0x50329f(0x9e)]},'operations':_0x32f5b1};}export async function getOperationDetail(_0x39b267,_0x43b5d6,_0x5ae063){const _0x45922c=a139_0x4316;let _0x6e660=_0x43b5d6;if(!/^\d+$/[_0x45922c(0xee)](_0x43b5d6)){const _0x5032a8=await listDatasets(_0x39b267,{'code':_0x43b5d6}),_0x309da3=_0x5032a8[_0x45922c(0xf3)](_0x1c607d=>_0x1c607d[_0x45922c(0x89)]===_0x43b5d6||String(_0x1c607d['id'])===_0x43b5d6);if(!_0x309da3)throw CliErrors[_0x45922c(0xc6)](_0x45922c(0xaf)+_0x43b5d6);_0x6e660=String(_0x309da3['id']);}const _0x472020=await getDatasetDetail(_0x6e660),_0x35c9e0=normalizeDatasetOperations(_0x472020[_0x45922c(0x11f)])['find'](_0x2d27bc=>(_0x2d27bc[_0x45922c(0xfa)]||_0x2d27bc[_0x45922c(0xc3)])===_0x5ae063);if(!_0x35c9e0)throw CliErrors[_0x45922c(0xc6)]('Operation\x20\x22'+_0x5ae063+_0x45922c(0xcb)+_0x43b5d6);return{'dataset':{'id':_0x472020['id']??_0x472020[_0x45922c(0x113)],'name':_0x472020[_0x45922c(0xfa)],'code':_0x472020['code']||_0x472020[_0x45922c(0xc8)],'tableName':_0x472020['tableName']||_0x472020[_0x45922c(0x10b)]?.[_0x45922c(0x9e)]},'operation':_0x35c9e0};}export async function startGenerateStandardPages(_0x51e53c,_0x82b45c,_0x5566cd){const _0x56d241=a139_0x4316,_0x5c618b=await apiRequest(_0x56d241(0x110)+_0x82b45c+_0x56d241(0xc4),{'method':_0x56d241(0xc5),'body':{'appCode':_0x51e53c,..._0x5566cd?.[_0x56d241(0xdd)]?{'clientOperationId':_0x5566cd['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5c618b[_0x56d241(0x95)];}export async function getGenerateStandardPagesStatus(_0x26699f,_0x5a32fc,_0x43b378){const _0x184ca7=a139_0x4316,_0x4c3aed=new URLSearchParams({'appCode':_0x26699f});_0x43b378['operationId']&&_0x4c3aed['set']('operationId',_0x43b378[_0x184ca7(0xfe)]);_0x43b378[_0x184ca7(0xdd)]&&_0x4c3aed[_0x184ca7(0x10f)](_0x184ca7(0xdd),_0x43b378[_0x184ca7(0xdd)]);const _0x38c3af=await apiRequest(_0x184ca7(0x110)+_0x5a32fc+_0x184ca7(0xbd)+_0x4c3aed[_0x184ca7(0xbe)]());return _0x38c3af[_0x184ca7(0x95)];}export async function getStandardPageStatus(_0x3a826c,_0x4db4f4){const _0x405b5f=a139_0x4316,_0x403ade=await apiRequest('/smartapi/lovrabet/dataset/'+_0x4db4f4+_0x405b5f(0x11a)+encodeURIComponent(_0x3a826c));return _0x403ade[_0x405b5f(0x95)];}export async function tryGetStandardPageStatus(_0x5d9ad9,_0x12e3bd){const _0x28f3f6=a139_0x4316;try{return await getStandardPageStatus(_0x5d9ad9,_0x12e3bd);}catch(_0x377cf0){if(_0x377cf0 instanceof CliError&&_0x377cf0[_0x28f3f6(0x89)]===_0x28f3f6(0xb6)&&/404|not found|non-json response/i[_0x28f3f6(0xee)](_0x377cf0['message']))return null;throw _0x377cf0;}}export async function syncStandardPages(_0x215d76,_0x3b923d){const _0x53e4f8=a139_0x4316,_0xf5f3a7=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3b923d+_0x53e4f8(0x127),{'method':'POST','body':{'appCode':_0x215d76}});return _0xf5f3a7[_0x53e4f8(0x95)];}export async function getPageDetail(_0x4ca7ca){const _0x108451=a139_0x4316,_0x231d8d=await apiRequest(_0x108451(0xc9)+_0x4ca7ca);if(!_0x231d8d[_0x108451(0x95)])throw CliErrors[_0x108451(0xc6)](_0x108451(0xfb)+_0x4ca7ca);return _0x231d8d[_0x108451(0x95)];}export async function updatePage(_0x41e9db,_0x5f41ba,_0x5845eb,_0x334724){const _0x5cb178=a139_0x4316,_0xe128b8=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x5cb178(0xc5),'body':{'appCode':_0x41e9db,'pageId':_0x5f41ba,'code':_0x5845eb,'datasetIds':_0x334724}});return _0xe128b8['data'];}export function generateSdkCode(_0x3d4b3e,_0x2393c1,_0x518f70){const _0x26e682=a139_0x4316,_0x51a26d=_0x518f70?.[_0x26e682(0xa3)]??!![],_0x3b72d1=_0x26e682(0xd7)+_0x3d4b3e[_0x26e682(0x89)]?.['replace'](/-/g,'_'),_0x3cada0=_0x2393c1[_0x26e682(0xfa)]||_0x2393c1[_0x26e682(0xc3)]||_0x26e682(0xa2),_0x185e7e=[];_0x51a26d&&_0x185e7e[_0x26e682(0xca)](_0x26e682(0xc7),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x185e7e[_0x26e682(0xca)]('//\x20'+_0x3d4b3e[_0x26e682(0xfa)]+'\x20('+(_0x3d4b3e[_0x26e682(0x9e)]||'table')+')');if(_0x3cada0===_0x26e682(0xa2))_0x185e7e[_0x26e682(0xca)]('const\x20result\x20=\x20await\x20client.models.'+_0x3b72d1+_0x26e682(0xc1),_0x26e682(0xf8),_0x26e682(0x103),_0x26e682(0xf7),_0x26e682(0xd8));else{if(_0x3cada0===_0x26e682(0x94))_0x185e7e[_0x26e682(0xca)](_0x26e682(0x116)+_0x3b72d1+_0x26e682(0xa0));else{if(_0x3cada0===_0x26e682(0xb1))_0x185e7e[_0x26e682(0xca)](_0x26e682(0x116)+_0x3b72d1+_0x26e682(0x10c));else{if(_0x3cada0===_0x26e682(0x9d))_0x185e7e[_0x26e682(0xca)](_0x26e682(0x116)+_0x3b72d1+_0x26e682(0x107));else _0x3cada0==='delete'||_0x3cada0===_0x26e682(0x9b)?_0x185e7e['push']('const\x20result\x20=\x20await\x20client.models.'+_0x3b72d1+_0x26e682(0xeb)):_0x185e7e[_0x26e682(0xca)](_0x26e682(0x116)+_0x3b72d1+'.'+_0x3cada0+_0x26e682(0xa9));}}}return _0x185e7e['join']('\x0a');}export function generateSqlCodeTemplate(_0x4699da,_0xd18964){const _0x50814b=a139_0x4316,_0x506b56=_0xd18964?.[_0x50814b(0xe9)]??'sdk',_0x45b45c=_0xd18964?.[_0x50814b(0xa3)]??!![],_0x2816fd=[];return _0x2816fd[_0x50814b(0xca)](_0x50814b(0x124)+_0x4699da[_0x50814b(0xf0)]+'\x20('+_0x4699da[_0x50814b(0xea)]+')'),_0x506b56===_0x50814b(0x119)?(_0x45b45c&&_0x2816fd[_0x50814b(0xca)](_0x50814b(0xc7),'',_0x50814b(0xab),''),_0x2816fd['push'](_0x50814b(0x112),_0x50814b(0xe0)+_0x4699da[_0x50814b(0xea)]+'\x27,',_0x50814b(0x8d),_0x50814b(0xd8),_0x50814b(0xe7),_0x50814b(0x8c))):_0x2816fd[_0x50814b(0xca)](_0x50814b(0xf1),_0x50814b(0xd3),_0x50814b(0x117),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x4699da[_0x50814b(0xea)]+'\x27,',_0x50814b(0xf6),_0x50814b(0xe2),_0x50814b(0x99),'}'),_0x2816fd['join']('\x0a');}export async function getErConfig(_0x2c843f,_0x169e27){const _0x18e41c=a139_0x4316,_0x1730e7=await apiRequest('/smartapi/question/er-config',{'method':_0x18e41c(0xc5),'body':{'appCode':_0x2c843f,'dblinkId':_0x169e27}});return _0x1730e7[_0x18e41c(0x95)];}export async function createErRelation(_0x3c1889){const _0x62a898=a139_0x4316,_0x1d0675=await apiRequest('/smartapi/question/er-config/erCreate',{'method':'POST','body':_0x3c1889});return _0x1d0675[_0x62a898(0x95)];}export async function updateErRelation(_0xe95145){const _0x44216f=a139_0x4316,_0x3b6fe9=await apiRequest(_0x44216f(0x11b),{'method':'POST','body':_0xe95145});return _0x3b6fe9[_0x44216f(0x95)];}export async function deleteErRelation(_0x1ea649){const _0x53ee76=a139_0x4316,_0x4d294d=await apiRequest(_0x53ee76(0xb3),{'method':_0x53ee76(0xc5),'body':_0x1ea649});return _0x4d294d['data'];}function buildQuery(_0x391dac){const _0x548abc=a139_0x4316,_0xf7b76e=new URLSearchParams();for(const [_0x4755bf,_0x24a651]of Object[_0x548abc(0xda)](_0x391dac)){if(_0x24a651===undefined||_0x24a651==='')continue;_0xf7b76e[_0x548abc(0x10f)](_0x4755bf,String(_0x24a651));}const _0x5ccc75=_0xf7b76e[_0x548abc(0xbe)]();return _0x5ccc75?'?'+_0x5ccc75:'';}export async function listDbLinks(_0x52594d,_0x4b6c09){const _0x1a78a9=a139_0x4316,_0x65b95=await apiRequest(_0x1a78a9(0x8e),{'method':_0x1a78a9(0xc5),'body':{'appCode':_0x52594d,'currentPage':_0x4b6c09?.[_0x1a78a9(0x104)]??0x1,'pageSize':_0x4b6c09?.['pageSize']??0x64}});return{'items':extractList(_0x65b95[_0x1a78a9(0x95)]),'paging':extractPaging(_0x65b95[_0x1a78a9(0x95)])};}export async function getDbLinkInfo(_0x3fee90){const _0x5b67fd=a139_0x4316,_0x1a9176=await apiRequest(_0x5b67fd(0x88)+buildQuery({'id':_0x3fee90}));return _0x1a9176['data'];}function a139_0x3c1a(){const _0xfed1f=['\x20\x20sqlCode:\x20\x27','apiError','\x20\x20});','/smartapi/dataset/get-dataset-list','status','length','authRequired','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','cookie','target','sqlCode','.remove(id);','totalCount','/api/management/library/scripts/statistics?appCode=','test','API\x20error:\x20','sqlName','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/dblink/delete','find','/api/management/library/scripts/info?id=','label','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20currentPage:\x201,','\x20\x20where:\x20{},','47336ZetVtv','name','Page\x20not\x20found:\x20','toLowerCase','tableData','operationId','/smartapi/db-analysis/jobs/cancel','/smartapi/dblink/update','4yvaRxI','add','\x20\x20pageSize:\x2020,','currentPage','API\x20error\x20code:\x20','isArray','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','tableList','type','\x20of\x20','dbtableConfig','.create({\x20/*\x20fields\x20*/\x20});','functionName','14928804DIxFDI','set','/smartapi/lovrabet/dataset/','152044LBSgFf','const\x20data\x20=\x20await\x20client.sql.execute({','modelId','401','\x20failed','const\x20result\x20=\x20await\x20client.models.','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/custom/updateUserCustomSql','sdk','/standard-page-status?appCode=','/smartapi/question/er-config/update-single','pageIndex','responseFields','errorCode','operations','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','889933unShqe','json','version','//\x20SQL:\x20','\x20failed,\x20HTTP\x20','/smartapi/dataset/update-driven-data','/sync-to-pages','planId','pageSize','body','&type=','/smartapi/db-analysis/start','/smartapi/app/getList','/smartapi/custom/deleteUserCustomSql','/smartapi/dblink/getOne','code','message','scriptName','const\x20results\x20=\x20data.execResult\x20||\x20[];','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/getList','1502454ZvvdBX','/smartapi/custom/saveUserCustomSql','BFF\x20script\x20not\x20found:\x20id=','66074VcUBNW','application/json','getOne','data','errorMessage','/smartapi/db-analysis/status/','success','\x20\x20return\x20rows;','4693419RZiFpR','remove','cli:rabetbase','update','tableName','method','.getOne(id);','/smartapi/dblink/testConnect','filter','includeImports','errorMsg','has','1477KhRJcz','/smartapi/dblink/create','map','(/*\x20params\x20*/);','stringify','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','Request\x20failed:\x20','SQL\x20query\x20not\x20found:\x20','warn','Dataset\x20not\x20found:\x20','/api/management/script/cache/clear','create','/api/','/smartapi/question/er-config/erDelete','/smartapi/dataset/get-driven-data?','error','api_error','/smartapi/dataset/get-dataset-operation','Request\x20timeout:\x20','displayName','AbortError','/api/management/library/scripts/list?appCode=','includes','/generate-standard-pages/status?','toString','/api/node-toolbox/sql/save','GET','.filter({','enabled','operationName','/generate-standard-pages/start','POST','validation','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','modelCode','/smartapi/lovrabet/detail?pageId=','push','\x22\x20not\x20found\x20in\x20dataset\x20','string','/smartapi/dblink/getTableDiffV2ByPage','signal','Unauthorized','SQL\x20query\x20not\x20found:\x20id=','/smartapi/custom/getUserCustomSql?id=','/smartapi/custom/queryUserCustomSqlList','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','180dqiQMv','path','15WUmaiS','dataset_','});','/smartapi/dblink/getAllTableList','entries','BFF\x20save\x20returned\x20no\x20valid\x20id','Warning:\x20showing\x20first\x20','clientOperationId','dbId','object'];a139_0x3c1a=function(){return _0xfed1f;};return a139_0x3c1a();}export async function createDbLink(_0xd48f52){const _0x59a9e8=a139_0x4316,_0x1debef=await apiRequest(_0x59a9e8(0xa7),{'method':_0x59a9e8(0xc5),'body':_0xd48f52});return _0x1debef['data'];}export async function updateDbLink(_0x3cccc6){const _0x2693b5=a139_0x4316,_0x5703a8=await apiRequest(_0x2693b5(0x100),{'method':_0x2693b5(0xc5),'body':_0x3cccc6});return _0x5703a8['data'];}export async function deleteDbLink(_0x5b993a){const _0x4d3d88=a139_0x4316;await apiRequest(_0x4d3d88(0xf2),{'method':'POST','body':{'id':_0x5b993a}});}export async function testDbLinkConnect(_0x267a16){const _0xfef8bb=a139_0x4316,_0x4e09b2=await apiRequest(_0xfef8bb(0xa1)+buildQuery({'id':_0x267a16}));return _0x4e09b2[_0xfef8bb(0x95)];}export async function startDbAnalysis(_0x446b28,_0x3ee241){const _0xf72245=a139_0x4316,_0x16b3cf=await apiRequest(_0xf72245(0x85),{'method':_0xf72245(0xc5),'body':{'dbLinkId':_0x446b28,..._0x3ee241&&_0x3ee241[_0xf72245(0xe5)]>0x0?{'tableNames':_0x3ee241}:{}}}),_0x5dc0f4=_0x16b3cf['data'];if(typeof _0x5dc0f4===_0xf72245(0xcc))return _0x5dc0f4;if(_0x5dc0f4&&typeof _0x5dc0f4==='object'&&typeof _0x5dc0f4[_0xf72245(0x128)]===_0xf72245(0xcc))return _0x5dc0f4[_0xf72245(0x128)];return _0x5dc0f4!=null?String(_0x5dc0f4):'';}export async function cancelDbAnalysis(_0x551977){const _0x37317b=a139_0x4316;await apiRequest(_0x37317b(0xff)+buildQuery({'planId':_0x551977}),{'method':_0x37317b(0xc5)});}export async function getDbAnalysisStatus(_0x1c0d1c){const _0xf2b85e=a139_0x4316,_0x4f246b=await apiRequest(_0xf2b85e(0x97)+encodeURIComponent(_0x1c0d1c));return _0x4f246b[_0xf2b85e(0x95)];}export async function getDbAllTableList(_0x417896,_0x2f3d4f){const _0x19e3df=a139_0x4316,_0x55a75a=await apiRequest(_0x19e3df(0xd9)+buildQuery({'appCode':_0x417896,'dbLinkId':_0x2f3d4f})),_0x203197=_0x55a75a['data'];if(Array[_0x19e3df(0x106)](_0x203197))return _0x203197;return extractList(_0x203197);}function a139_0x4316(_0x4d2d9c,_0x33ffb0){_0x4d2d9c=_0x4d2d9c-0x83;const _0x3c1acd=a139_0x3c1a();let _0x4316fe=_0x3c1acd[_0x4d2d9c];return _0x4316fe;}export async function getDbTableDiff(_0xa086a5,_0x57a6f1,_0x24923c){const _0x2b3c41=a139_0x4316,_0x263f3b=await apiRequest(_0x2b3c41(0xcd)+buildQuery({'appCode':_0xa086a5,'dbLinkId':_0x57a6f1,'pageIndex':_0x24923c?.[_0x2b3c41(0x11c)]??0x1,'pageSize':_0x24923c?.[_0x2b3c41(0x129)]??0x14,'tableName':_0x24923c?.['tableName']})),_0x359e02=_0x263f3b[_0x2b3c41(0x95)];return{'totalCount':_0x359e02?.[_0x2b3c41(0xec)]??0x0,'tableList':Array['isArray'](_0x359e02?.[_0x2b3c41(0x108)])?_0x359e02['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x5807ac=a139_0x4316,_0xd0cbd5=await apiRequest(_0x5807ac(0x86),{'method':_0x5807ac(0xc5),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1eec8c=extractList(_0xd0cbd5[_0x5807ac(0x95)]),_0x1e475b=extractPaging(_0xd0cbd5[_0x5807ac(0x95)]);return _0x1e475b&&_0x1e475b[_0x5807ac(0xec)]>REMOTE_APP_PAGE_SIZE&&console[_0x5807ac(0xae)](_0x5807ac(0xdc)+REMOTE_APP_PAGE_SIZE+_0x5807ac(0x10a)+_0x1e475b[_0x5807ac(0xec)]+'\x20apps.\x20'+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x1eec8c;}
1
+ (function(_0x24c220,_0xb416a0){const _0xb93144=a139_0x535d,_0x59e0b4=_0x24c220();while(!![]){try{const _0xb006a8=-parseInt(_0xb93144(0xb6))/0x1*(parseInt(_0xb93144(0x80))/0x2)+-parseInt(_0xb93144(0xc0))/0x3*(parseInt(_0xb93144(0xe4))/0x4)+parseInt(_0xb93144(0xde))/0x5*(parseInt(_0xb93144(0x10e))/0x6)+parseInt(_0xb93144(0xe8))/0x7*(-parseInt(_0xb93144(0xa8))/0x8)+parseInt(_0xb93144(0xb7))/0x9*(-parseInt(_0xb93144(0xa4))/0xa)+parseInt(_0xb93144(0xa1))/0xb+parseInt(_0xb93144(0x10f))/0xc;if(_0xb006a8===_0xb416a0)break;else _0x59e0b4['push'](_0x59e0b4['shift']());}catch(_0x7caa88){_0x59e0b4['push'](_0x59e0b4['shift']());}}}(a139_0x4e16,0x3536f));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(_0x1d5906){_activeCookie=_0x1d5906||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x5e49c2,_0x52bb18){const _0x1c6303=a139_0x535d,_0x3223f7=_0x52bb18 instanceof Error?_0x52bb18[_0x1c6303(0xad)]:String(_0x52bb18);return CliErrors[_0x1c6303(0x104)]('Request\x20failed:\x20'+_0x5e49c2+(_0x3223f7?'\x20('+_0x3223f7+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x5dfe2c,_0x4c00b4={}){const _0xfccaa7=a139_0x535d,{method:method=_0xfccaa7(0xdd),body:_0x38685e,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x4c00b4,_0x3dc76d=useRuntime?getRuntimeDomain():getApiDomain(),_0x113cfd=_activeCookie||getCookie(),_0xb61f50=''+_0x3dc76d+_0x5dfe2c,_0x212f03=new AbortController(),_0x24a59e=setTimeout(()=>_0x212f03[_0xfccaa7(0xb5)](),timeout);try{const _0x25bcbb=await fetch(_0xb61f50,{'method':method,'headers':{'Content-Type':_0xfccaa7(0xb8),'Cookie':_0x113cfd,'X-Invoke-Source':_0xfccaa7(0xcc),...headers},'body':_0x38685e?JSON['stringify'](_0x38685e):undefined,'signal':_0x212f03[_0xfccaa7(0xba)]});let _0x2505ca;try{_0x2505ca=await _0x25bcbb['json']();}catch{throw CliErrors[_0xfccaa7(0x104)](_0xfccaa7(0x10c)+_0x25bcbb[_0xfccaa7(0x9d)]+')',_0x25bcbb[_0xfccaa7(0x9d)]>=0x190?_0xfccaa7(0xb9):undefined);}if(!_0x25bcbb['ok']||_0x2505ca[_0xfccaa7(0xbc)]===![])throw CliErrors['apiError'](_0x2505ca[_0xfccaa7(0x8b)]||_0x2505ca[_0xfccaa7(0xad)]||_0xfccaa7(0xf4)+_0x25bcbb[_0xfccaa7(0x9d)],_0x2505ca[_0xfccaa7(0xe6)]?_0xfccaa7(0xe5)+_0x2505ca[_0xfccaa7(0xe6)]:undefined);return _0x2505ca;}catch(_0x28d268){if(_0x28d268 instanceof CliError)throw _0x28d268;if(_0x28d268 instanceof Error&&_0x28d268[_0xfccaa7(0xd8)]===_0xfccaa7(0x7b))throw CliErrors[_0xfccaa7(0x104)](_0xfccaa7(0x7f)+_0xb61f50);throw createFetchFailureError(_0xb61f50,_0x28d268);}finally{clearTimeout(_0x24a59e);}}function isAuthFailure(_0x5779ee){const _0x32ecb1=a139_0x535d,_0x134e9b=_0x5779ee[_0x32ecb1(0x8b)]||_0x5779ee[_0x32ecb1(0xad)]||_0x5779ee[_0x32ecb1(0x88)]?.[_0x32ecb1(0xad)]||_0x5779ee[_0x32ecb1(0xbf)]||_0x5779ee[_0x32ecb1(0x85)]||'';return _0x5779ee[_0x32ecb1(0xe6)]===_0x32ecb1(0x115)||_0x5779ee[_0x32ecb1(0xbb)]===0x191||_0x5779ee[_0x32ecb1(0xbb)]==='401'||_0x134e9b['includes'](_0x32ecb1(0x7c))||_0x134e9b['includes']('Unauthorized')||_0x134e9b['includes']('登录')||_0x134e9b[_0x32ecb1(0xb3)]('认证');}export async function platformFetch(_0x1446e3,_0x49c9e3){const _0x32cd7b=a139_0x535d;let _0x1f5784;try{_0x1f5784=await fetch(_0x1446e3,{'method':_0x49c9e3[_0x32cd7b(0xd6)]??'GET','headers':{'Content-Type':_0x32cd7b(0xb8),'Cookie':_0x49c9e3['cookie']},..._0x49c9e3['body']&&{'body':JSON['stringify'](_0x49c9e3[_0x32cd7b(0xb2)])}});}catch(_0x9cd406){throw createFetchFailureError(_0x1446e3,_0x9cd406);}if(!_0x1f5784['ok']){if(_0x1f5784[_0x32cd7b(0x9d)]===0x191)throw CliErrors[_0x32cd7b(0xc2)]();throw CliErrors[_0x32cd7b(0x104)](_0x49c9e3[_0x32cd7b(0x11a)]+_0x32cd7b(0xaf)+_0x1f5784[_0x32cd7b(0x9d)]);}const _0x127330=await _0x1f5784['json']();if(_0x127330[_0x32cd7b(0xbc)]===![]){if(isAuthFailure(_0x127330))throw CliErrors['authRequired']();throw CliErrors[_0x32cd7b(0x104)](_0x127330[_0x32cd7b(0x8b)]||_0x127330[_0x32cd7b(0xad)]||_0x49c9e3[_0x32cd7b(0x11a)]+_0x32cd7b(0xcf));}return _0x127330[_0x32cd7b(0x88)];}export async function listBffScripts(_0x4b34cf,_0x57156c,_0x48d8d2){const _0xe04802=a139_0x535d;let _0x3d85ae=_0xe04802(0xca)+_0x4b34cf;if(_0x57156c)_0x3d85ae+='&type='+_0x57156c;const _0x192eb4=await apiRequest(_0x3d85ae);let _0x2d14d8=extractList(_0x192eb4[_0xe04802(0x88)]);if(_0x48d8d2?.['scriptName']){const _0x5c5b22=_0x48d8d2[_0xe04802(0xe2)][_0xe04802(0xce)]();_0x2d14d8=_0x2d14d8[_0xe04802(0x105)](_0x10c288=>_0x10c288['functionName']?.[_0xe04802(0xce)]()[_0xe04802(0xb3)](_0x5c5b22)||_0x10c288[_0xe04802(0xf3)]?.[_0xe04802(0xce)]()[_0xe04802(0xb3)](_0x5c5b22));}return _0x2d14d8;}export async function getBffScriptInfo(_0x3917ca){const _0x14432c=a139_0x535d,_0x258de4=await apiRequest(_0x14432c(0xe1)+_0x3917ca);if(!_0x258de4['data'])throw CliErrors[_0x14432c(0xe0)](_0x14432c(0xf9)+_0x3917ca);return _0x258de4[_0x14432c(0x88)];}export async function saveBffScript(_0x45c217){const _0x105953=a139_0x535d,_0x38b257=await apiRequest('/api/management/library/scripts/save',{'method':_0x105953(0xc6),'body':_0x45c217}),{id:_0x3e045e,entity:_0x307e7e}=normalizeEntityWithIdResponse(_0x38b257[_0x105953(0x88)]);if(_0x3e045e!==undefined){const _0xd66234=typeof _0x307e7e[_0x105953(0xa7)]==='string'||typeof _0x307e7e['scriptType']===_0x105953(0xf6)?_0x307e7e:undefined;return{'id':_0x3e045e,'script':_0xd66234};}throw CliErrors[_0x105953(0x104)](_0x105953(0xa0));}export async function deleteBffScript(_0x3f5764){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x3f5764}});}export async function getBffScriptStatistics(_0x1fa90f){const _0x179b3d=a139_0x535d,_0xa6be84=await apiRequest(_0x179b3d(0xdb)+_0x1fa90f);return extractList(_0xa6be84[_0x179b3d(0x88)]);}export async function clearBffScriptCache(){const _0x3244e3=a139_0x535d,_0x5321c0=await apiRequest(_0x3244e3(0x89),{'method':_0x3244e3(0xc6),'useRuntime':!![]});return typeof _0x5321c0[_0x3244e3(0x88)]==='string'?_0x5321c0[_0x3244e3(0x88)]:'';}export async function listBffDatasetOperations(_0x59142d,_0x2debde){const _0x2c3823=a139_0x535d,_0x4d9f79=await apiRequest(_0x2c3823(0xd1),{'method':_0x2c3823(0xc6),'body':{'appCode':_0x59142d,'datasetId':_0x2debde}});return _0x4d9f79[_0x2c3823(0x88)];}export async function listSqlQueries(_0x34af19,_0x12f11e){const _0x576f88=a139_0x535d,_0x45ad76=await apiRequest(_0x576f88(0xdf),{'method':_0x576f88(0xc6),'body':{'appCode':_0x34af19,'currentPage':_0x12f11e?.[_0x576f88(0xfd)]??0x1,'pageSize':_0x12f11e?.['pageSize']??0x32,'sqlCode':_0x12f11e?.['sqlCode'],'sqlName':_0x12f11e?.[_0x576f88(0xb0)]}});return _0x45ad76[_0x576f88(0x88)];}export async function getSqlQueryInfo(_0x2e138a,_0x352f59){const _0x1650bc=a139_0x535d,_0xa9026e=await listSqlQueries(_0x2e138a,{'sqlCode':_0x352f59}),_0x12e50f=_0xa9026e[_0x1650bc(0x101)]?.[0x0];if(!_0x12e50f)throw CliErrors['validation'](_0x1650bc(0xe3)+_0x352f59);return _0x12e50f;}export async function getSqlQueryDetail(_0x3db4d8){const _0x3478ba=a139_0x535d,_0x176971=await apiRequest(_0x3478ba(0x86)+('?sqlCode='+encodeURIComponent(_0x3db4d8)));if(!_0x176971[_0x3478ba(0x88)])throw CliErrors['validation'](_0x3478ba(0xe3)+_0x3db4d8);return _0x176971[_0x3478ba(0x88)];}export async function getSqlQueryDetailById(_0x53c316){const _0xfb7587=a139_0x535d,_0x5ba1d5=await apiRequest(_0xfb7587(0x91)+_0x53c316);if(!_0x5ba1d5[_0xfb7587(0x88)])throw CliErrors[_0xfb7587(0xe0)]('SQL\x20query\x20not\x20found:\x20id='+_0x53c316);return _0x5ba1d5[_0xfb7587(0x88)];}export async function createSqlQuery(_0x4fe53d){const _0x55dd0e=a139_0x535d,_0x5b7b45=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x55dd0e(0xc6),'body':_0x4fe53d}),{id:_0x2e2ebf,entity:_0x122d89}=normalizeEntityWithIdResponse(_0x5b7b45[_0x55dd0e(0x88)]);if(!(_0x55dd0e(0x8a)in _0x122d89)&&_0x2e2ebf)return getSqlQueryDetailById(_0x2e2ebf);return normalizeSqlQueryEntity(_0x122d89);}export async function updateSqlQuery(_0x292964){const _0x349e7c=a139_0x535d,_0x55342d=await apiRequest(_0x349e7c(0x106),{'method':'POST','body':_0x292964}),{id:_0x308cba,entity:_0x17c6d6}=normalizeEntityWithIdResponse(_0x55342d[_0x349e7c(0x88)]);if(!(_0x349e7c(0x8a)in _0x17c6d6)){if(_0x292964['sqlCode'])return getSqlQueryDetail(_0x292964[_0x349e7c(0x8a)]);if(_0x308cba)return getSqlQueryDetailById(_0x308cba);}return normalizeSqlQueryEntity(_0x17c6d6);}export async function deleteSqlQuery(_0x3d099d){const _0x532c37=a139_0x535d;await apiRequest(_0x532c37(0x81),{'method':'POST','body':_0x3d099d});}export async function saveSqlQuery(_0x50bded){const _0x2e694d=a139_0x535d,_0x59b1b4=await apiRequest(_0x2e694d(0xf7),{'method':_0x2e694d(0xc6),'body':_0x50bded});return _0x59b1b4[_0x2e694d(0x88)];}function normalizeSqlQueryEntity(_0x158633){const _0x3e3580=a139_0x535d;return{..._0x158633,'id':Number(_0x158633['id']),'dbId':_0x158633[_0x3e3580(0xc1)]==null?undefined:Number(_0x158633[_0x3e3580(0xc1)]),'version':_0x158633[_0x3e3580(0xc7)]==null?undefined:Number(_0x158633['version'])};}export async function executeSql(_0x50b5f0,_0x2e096e,_0x16797f){const _0x563360=a139_0x535d,_0x5f46e8=await apiRequest(_0x563360(0x93),{'method':_0x563360(0xc6),'body':{'appCode':_0x50b5f0,'sqlCode':_0x2e096e,..._0x16797f&&{'params':_0x16797f}},'useRuntime':!![]});return _0x5f46e8[_0x563360(0x88)];}export async function executeDatasetDataOperation(_0x2d3dba,_0x4389a9,_0x245e84,_0x7fbfc0={}){const _0x18a14e=a139_0x535d;try{const _0x2f2dcc=await apiRequest('/api/'+_0x2d3dba+'/'+_0x4389a9+'/'+_0x245e84,{'method':_0x18a14e(0xc6),'body':_0x7fbfc0,'useRuntime':!![]});return _0x2f2dcc[_0x18a14e(0x88)];}catch(_0x12080e){if(_0x245e84===_0x18a14e(0xe7)&&_0x12080e instanceof CliError&&_0x12080e[_0x18a14e(0xbb)]===_0x18a14e(0x109)&&_0x7fbfc0['id']!==undefined&&_0x7fbfc0['id']!==null&&_0x7fbfc0['id']!==''){const _0x53136f=await apiRequest(_0x18a14e(0xa2)+_0x2d3dba+'/'+_0x4389a9+_0x18a14e(0xbd),{'method':_0x18a14e(0xc6),'body':{'where':{'id':{'$eq':_0x7fbfc0['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x1d1cb4=Array['isArray'](_0x53136f['data']?.['tableData'])?_0x53136f[_0x18a14e(0x88)][_0x18a14e(0x101)]:[];return _0x1d1cb4[0x0]??null;}throw _0x12080e;}}export async function listDatasets(_0x541d57,_0x4ca9a2){const _0x20be90=a139_0x535d,_0x5b9ff5={'appCode':_0x541d57,'deleted':![]};if(_0x4ca9a2?.[_0x20be90(0xbb)])_0x5b9ff5[_0x20be90(0xbb)]=_0x4ca9a2[_0x20be90(0xbb)];if(_0x4ca9a2?.[_0x20be90(0xd8)])_0x5b9ff5[_0x20be90(0xd8)]=_0x4ca9a2[_0x20be90(0xd8)];const _0x31f67b=await apiRequest(_0x20be90(0xa6),{'method':'POST','body':_0x5b9ff5});return extractList(_0x31f67b[_0x20be90(0x88)]);}export async function deleteDataset(_0x10745d,_0xa61cd5){const _0x5ee2d4=a139_0x535d;await apiRequest(_0x5ee2d4(0x84),{'method':_0x5ee2d4(0xc6),'body':{'appCode':_0x10745d,'datasetId':_0xa61cd5}});}export async function searchDatasets(_0x393925,_0xa608c1){const _0x8f39ba=a139_0x535d,_0x308fad=await listDatasets(_0x393925,{'name':_0xa608c1}),_0x35e667=_0xa608c1['toLowerCase'](),_0x45adaa=new Set(_0x308fad['map'](_0x29b2d9=>_0x29b2d9['id'])),_0x3a68a8=_0x308fad[_0x8f39ba(0x105)](_0x536ddc=>_0x536ddc[_0x8f39ba(0x110)]?.[_0x8f39ba(0x10d)]?.[_0x8f39ba(0xce)]()[_0x8f39ba(0xb3)](_0x35e667)||_0x536ddc['description']?.[_0x8f39ba(0xce)]()['includes'](_0x35e667)),_0x1dd13a=await listDatasets(_0x393925,{'code':_0xa608c1});for(const _0x157789 of _0x1dd13a){!_0x45adaa[_0x8f39ba(0x87)](_0x157789['id'])&&(_0x308fad[_0x8f39ba(0x95)](_0x157789),_0x45adaa[_0x8f39ba(0xac)](_0x157789['id']));}return _0x308fad;}export function normalizeDatasetOperations(_0x1db48d){const _0x5413c4=a139_0x535d;if(Array[_0x5413c4(0xd7)](_0x1db48d))return _0x1db48d[_0x5413c4(0x105)](_0x3f3ed7=>_0x3f3ed7!=null&&typeof _0x3f3ed7===_0x5413c4(0x113));if(_0x1db48d&&typeof _0x1db48d===_0x5413c4(0x113))return Object['entries'](_0x1db48d)[_0x5413c4(0x105)](([,_0x47fefd])=>_0x47fefd!=null&&typeof _0x47fefd===_0x5413c4(0x113))[_0x5413c4(0x112)](([_0x33d682,_0x2b0b03])=>({..._0x2b0b03,'name':_0x2b0b03[_0x5413c4(0xd8)]??_0x2b0b03[_0x5413c4(0x8f)]??_0x33d682}));return[];}export async function getDatasetDetail(_0xc65634){const _0x383c66=a139_0x535d,_0xe0d20b=/^\d+$/[_0x383c66(0x92)](_0xc65634)?'id':_0x383c66(0xbb),_0x5af2b5=await apiRequest(_0x383c66(0xbe)+_0xe0d20b+'='+_0xc65634);return _0x5af2b5[_0x383c66(0x88)];}export async function updateDrivenData(_0x492316){const _0x5e5980=a139_0x535d,_0x4c6040=await apiRequest(_0x5e5980(0x94),{'method':_0x5e5980(0xc6),'body':_0x492316});return _0x4c6040['data'];}export async function getDatasetOperations(_0x20b41f){const _0x87743c=a139_0x535d,_0x3c305c=await getDatasetDetail(_0x20b41f),_0x5420ce=normalizeDatasetOperations(_0x3c305c[_0x87743c(0xff)])[_0x87743c(0x112)](_0x34f717=>({'name':_0x34f717[_0x87743c(0xd8)]||_0x34f717[_0x87743c(0x8f)],'displayName':_0x34f717[_0x87743c(0xcb)]||_0x34f717[_0x87743c(0xd8)],'type':_0x34f717[_0x87743c(0xc8)],'method':_0x34f717[_0x87743c(0xd6)],'path':_0x34f717[_0x87743c(0x9e)],'enabled':_0x34f717['enabled']??!![],'requestFields':_0x34f717[_0x87743c(0xc9)],'responseFields':_0x34f717[_0x87743c(0x111)]}));return{'dataset':{'id':_0x3c305c['id']??_0x3c305c['modelId'],'name':_0x3c305c['name'],'code':_0x3c305c[_0x87743c(0xbb)]||_0x3c305c[_0x87743c(0x114)],'tableName':_0x3c305c[_0x87743c(0x10d)]||_0x3c305c[_0x87743c(0x110)]?.[_0x87743c(0x10d)]},'operations':_0x5420ce};}export async function getOperationDetail(_0x520882,_0x3e555c,_0x37ab29){const _0x2870cd=a139_0x535d;let _0x28670b=_0x3e555c;if(!/^\d+$/[_0x2870cd(0x92)](_0x3e555c)){const _0x1a568e=await listDatasets(_0x520882,{'code':_0x3e555c}),_0x26c824=_0x1a568e[_0x2870cd(0x8c)](_0x200948=>_0x200948[_0x2870cd(0xbb)]===_0x3e555c||String(_0x200948['id'])===_0x3e555c);if(!_0x26c824)throw CliErrors[_0x2870cd(0xe0)](_0x2870cd(0xe9)+_0x3e555c);_0x28670b=String(_0x26c824['id']);}const _0x112936=await getDatasetDetail(_0x28670b),_0x2608b1=normalizeDatasetOperations(_0x112936[_0x2870cd(0xff)])[_0x2870cd(0x8c)](_0x1d2ad6=>(_0x1d2ad6[_0x2870cd(0xd8)]||_0x1d2ad6[_0x2870cd(0x8f)])===_0x37ab29);if(!_0x2608b1)throw CliErrors['validation'](_0x2870cd(0xa9)+_0x37ab29+_0x2870cd(0x83)+_0x3e555c);return{'dataset':{'id':_0x112936['id']??_0x112936['modelId'],'name':_0x112936[_0x2870cd(0xd8)],'code':_0x112936['code']||_0x112936[_0x2870cd(0x114)],'tableName':_0x112936[_0x2870cd(0x10d)]||_0x112936[_0x2870cd(0x110)]?.['tableName']},'operation':_0x2608b1};}export async function startGenerateStandardPages(_0x317cf3,_0x2bdb1f,_0x1bebfc){const _0x4439f0=a139_0x535d,_0x5c6081=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2bdb1f+'/generate-standard-pages/start',{'method':_0x4439f0(0xc6),'body':{'appCode':_0x317cf3,..._0x1bebfc?.[_0x4439f0(0xfb)]?{'clientOperationId':_0x1bebfc[_0x4439f0(0xfb)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5c6081[_0x4439f0(0x88)];}export async function getGenerateStandardPagesStatus(_0x53ab25,_0x3df24f,_0x57ac24){const _0x5392ae=a139_0x535d,_0x36b501=new URLSearchParams({'appCode':_0x53ab25});_0x57ac24['operationId']&&_0x36b501['set'](_0x5392ae(0x9a),_0x57ac24[_0x5392ae(0x9a)]);_0x57ac24['clientOperationId']&&_0x36b501[_0x5392ae(0x8e)]('clientOperationId',_0x57ac24[_0x5392ae(0xfb)]);const _0x5c0efe=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3df24f+_0x5392ae(0xa3)+_0x36b501[_0x5392ae(0x9b)]());return _0x5c0efe[_0x5392ae(0x88)];}export async function getStandardPageStatus(_0x2e4c1a,_0x2ddbef){const _0x18155b=a139_0x535d,_0x1c6e1a=await apiRequest(_0x18155b(0xec)+_0x2ddbef+_0x18155b(0xa5)+encodeURIComponent(_0x2e4c1a));return _0x1c6e1a[_0x18155b(0x88)];}export async function tryGetStandardPageStatus(_0x42f01d,_0x193c85){const _0x251893=a139_0x535d;try{return await getStandardPageStatus(_0x42f01d,_0x193c85);}catch(_0x422fbc){if(_0x422fbc instanceof CliError&&_0x422fbc[_0x251893(0xbb)]===_0x251893(0x109)&&/404|not found|non-json response/i[_0x251893(0x92)](_0x422fbc['message']))return null;throw _0x422fbc;}}export async function syncStandardPages(_0x590cca,_0x1b5062){const _0xa92a32=a139_0x535d,_0x35fc9a=await apiRequest(_0xa92a32(0xec)+_0x1b5062+_0xa92a32(0x118),{'method':'POST','body':{'appCode':_0x590cca}});return _0x35fc9a['data'];}export async function getPageDetail(_0x198399){const _0x29b329=a139_0x535d,_0x17106a=await apiRequest(_0x29b329(0x116)+_0x198399);if(!_0x17106a[_0x29b329(0x88)])throw CliErrors[_0x29b329(0xe0)](_0x29b329(0xee)+_0x198399);return _0x17106a[_0x29b329(0x88)];}function a139_0x4e16(){const _0x49a1e3=['success','/filter','/smartapi/dataset/get-driven-data?','errorMessage','415137PvdzRi','dbId','authRequired','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','const\x20result\x20=\x20await\x20client.models.','/smartapi/question/er-config/erDelete','POST','version','type','requestFields','/api/management/library/scripts/list?appCode=','displayName','cli:rabetbase','(/*\x20params\x20*/);','toLowerCase','\x20failed','create','/smartapi/dataset/get-dataset-operation','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','join','planId','/smartapi/db-analysis/jobs/cancel','method','isArray','name','dataset_','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','/api/management/library/scripts/statistics?appCode=','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','GET','20RJEOzD','/smartapi/custom/queryUserCustomSqlList','validation','/api/management/library/scripts/info?id=','scriptName','SQL\x20query\x20not\x20found:\x20','12yPZqYq','API\x20error\x20code:\x20','errorCode','getOne','1421zDGzqH','Dataset\x20not\x20found:\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','warn','/smartapi/lovrabet/dataset/','table','Page\x20not\x20found:\x20','delete','const\x20data\x20=\x20await\x20client.sql.execute({','.getOne(id);','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','description','API\x20error:\x20','/smartapi/dblink/getAllTableList','string','/api/node-toolbox/sql/save','\x20apps.\x20','BFF\x20script\x20not\x20found:\x20id=','});','clientOperationId','//\x20SQL:\x20','currentPage','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','operations','\x20\x20pageSize:\x2020,','tableData','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/update','apiError','filter','/smartapi/custom/updateUserCustomSql','\x20\x20return\x20rows;','/smartapi/app/getList','api_error','//\x20','.remove(id);','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','tableName','38310GGdiSn','12877368KvadPc','dbtableConfig','responseFields','map','object','modelCode','UNAUTHORIZED','/smartapi/lovrabet/detail?pageId=','/smartapi/question/er-config','/sync-to-pages','pageSize','label','\x20\x20sqlCode:\x20\x27','AbortError','401','totalCount','/smartapi/question/er-config/update-single','Request\x20timeout:\x20','64kAqGvq','/smartapi/custom/deleteUserCustomSql','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','\x22\x20not\x20found\x20in\x20dataset\x20','/smartapi/dataset/delete-dataset','error','/smartapi/custom/getUserCustomSql','has','data','/api/management/script/cache/clear','sqlCode','errorMsg','find','pageIndex','set','operationName','/smartapi/dblink/getList','/smartapi/custom/getUserCustomSql?id=','test','/api/custom/executeSql','/smartapi/dataset/update-driven-data','push','\x20\x20where:\x20{},','tableList','/smartapi/dblink/getTableDiffV2ByPage','includeImports','operationId','toString','/smartapi/dblink/testConnect','status','path','replace','BFF\x20save\x20returned\x20no\x20valid\x20id','2682790cGzAEi','/api/','/generate-standard-pages/status?','3610iOmKKd','/standard-page-status?appCode=','/smartapi/dataset/get-dataset-list','functionName','2696ghUTuQ','Operation\x20\x22','entries','\x20\x20currentPage:\x201,','add','message','update','\x20failed,\x20HTTP\x20','sqlName','/smartapi/db-analysis/start','body','includes','/smartapi/lovrabet/update-page','abort','9236aFaEly','8613HENVhC','application/json','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','signal','code'];a139_0x4e16=function(){return _0x49a1e3;};return a139_0x4e16();}export async function updatePage(_0x369c93,_0x2b3b42,_0x23c49b,_0xdb2579){const _0x45c3ce=a139_0x535d,_0x11eafe=await apiRequest(_0x45c3ce(0xb4),{'method':_0x45c3ce(0xc6),'body':{'appCode':_0x369c93,'pageId':_0x2b3b42,'code':_0x23c49b,'datasetIds':_0xdb2579}});return _0x11eafe['data'];}export function generateSdkCode(_0x1da4b6,_0x90dde8,_0x22b692){const _0x538091=a139_0x535d,_0x5dd220=_0x22b692?.[_0x538091(0x99)]??!![],_0x2977fe=_0x538091(0xd9)+_0x1da4b6[_0x538091(0xbb)]?.[_0x538091(0x9f)](/-/g,'_'),_0x3b19d4=_0x90dde8['name']||_0x90dde8['operationName']||_0x538091(0x105),_0x336b0c=[];_0x5dd220&&_0x336b0c[_0x538091(0x95)](_0x538091(0xdc),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x336b0c[_0x538091(0x95)](_0x538091(0x10a)+_0x1da4b6[_0x538091(0xd8)]+'\x20('+(_0x1da4b6[_0x538091(0x10d)]||_0x538091(0xed))+')');if(_0x3b19d4===_0x538091(0x105))_0x336b0c[_0x538091(0x95)](_0x538091(0xc4)+_0x2977fe+'.filter({',_0x538091(0x96),_0x538091(0x100),_0x538091(0xab),_0x538091(0xfa));else{if(_0x3b19d4===_0x538091(0xe7))_0x336b0c['push'](_0x538091(0xc4)+_0x2977fe+_0x538091(0xf1));else{if(_0x3b19d4===_0x538091(0xd0))_0x336b0c[_0x538091(0x95)]('const\x20result\x20=\x20await\x20client.models.'+_0x2977fe+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x3b19d4===_0x538091(0xae))_0x336b0c['push'](_0x538091(0xc4)+_0x2977fe+_0x538091(0xc3));else _0x3b19d4===_0x538091(0xef)||_0x3b19d4==='remove'?_0x336b0c[_0x538091(0x95)]('const\x20result\x20=\x20await\x20client.models.'+_0x2977fe+_0x538091(0x10b)):_0x336b0c[_0x538091(0x95)]('const\x20result\x20=\x20await\x20client.models.'+_0x2977fe+'.'+_0x3b19d4+_0x538091(0xcd));}}}return _0x336b0c[_0x538091(0xd3)]('\x0a');}export function generateSqlCodeTemplate(_0x726d1d,_0xda403){const _0x125567=a139_0x535d,_0x4e3c58=_0xda403?.['target']??'sdk',_0x39a95e=_0xda403?.[_0x125567(0x99)]??!![],_0x234bb3=[];return _0x234bb3[_0x125567(0x95)](_0x125567(0xfc)+_0x726d1d[_0x125567(0xb0)]+'\x20('+_0x726d1d[_0x125567(0x8a)]+')'),_0x4e3c58==='sdk'?(_0x39a95e&&_0x234bb3['push'](_0x125567(0xdc),'',_0x125567(0xf2),''),_0x234bb3[_0x125567(0x95)](_0x125567(0xf0),_0x125567(0x7a)+_0x726d1d[_0x125567(0x8a)]+'\x27,',_0x125567(0x102),_0x125567(0xfa),_0x125567(0x82),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x234bb3[_0x125567(0x95)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x125567(0xda),_0x125567(0xfe),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x726d1d[_0x125567(0x8a)]+'\x27,',_0x125567(0xea),'\x20\x20});',_0x125567(0x107),'}'),_0x234bb3[_0x125567(0xd3)]('\x0a');}export async function getErConfig(_0x65e6fd,_0x3a5a6a){const _0x4e6067=a139_0x535d,_0x564050=await apiRequest(_0x4e6067(0x117),{'method':'POST','body':{'appCode':_0x65e6fd,'dblinkId':_0x3a5a6a}});return _0x564050[_0x4e6067(0x88)];}export async function createErRelation(_0xfc07d6){const _0x443acc=a139_0x535d,_0x1c3352=await apiRequest('/smartapi/question/er-config/erCreate',{'method':_0x443acc(0xc6),'body':_0xfc07d6});return _0x1c3352[_0x443acc(0x88)];}export async function updateErRelation(_0x13ea7b){const _0x7cf12e=a139_0x535d,_0x426df4=await apiRequest(_0x7cf12e(0x7e),{'method':_0x7cf12e(0xc6),'body':_0x13ea7b});return _0x426df4[_0x7cf12e(0x88)];}export async function deleteErRelation(_0x37a3ea){const _0x5b7752=a139_0x535d,_0x13e73b=await apiRequest(_0x5b7752(0xc5),{'method':_0x5b7752(0xc6),'body':_0x37a3ea});return _0x13e73b['data'];}function buildQuery(_0x37a935){const _0x4eb03d=a139_0x535d,_0xfed656=new URLSearchParams();for(const [_0x437419,_0x5c3eb7]of Object[_0x4eb03d(0xaa)](_0x37a935)){if(_0x5c3eb7===undefined||_0x5c3eb7==='')continue;_0xfed656[_0x4eb03d(0x8e)](_0x437419,String(_0x5c3eb7));}const _0x428d24=_0xfed656[_0x4eb03d(0x9b)]();return _0x428d24?'?'+_0x428d24:'';}export async function listDbLinks(_0x13b858,_0xaabe7c){const _0x597b3c=a139_0x535d,_0x103ed5=await apiRequest(_0x597b3c(0x90),{'method':_0x597b3c(0xc6),'body':{'appCode':_0x13b858,'currentPage':_0xaabe7c?.[_0x597b3c(0xfd)]??0x1,'pageSize':_0xaabe7c?.[_0x597b3c(0x119)]??0x64}});return{'items':extractList(_0x103ed5['data']),'paging':extractPaging(_0x103ed5[_0x597b3c(0x88)])};}export async function getDbLinkInfo(_0x554dbd){const _0x2c0d56=a139_0x535d,_0xe02750=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x554dbd}));return _0xe02750[_0x2c0d56(0x88)];}export async function createDbLink(_0x5dc69e){const _0x50181a=a139_0x535d,_0x29cd2d=await apiRequest('/smartapi/dblink/create',{'method':'POST','body':_0x5dc69e});return _0x29cd2d[_0x50181a(0x88)];}function a139_0x535d(_0x505c04,_0x5eb9b5){_0x505c04=_0x505c04-0x7a;const _0x4e16c7=a139_0x4e16();let _0x535d88=_0x4e16c7[_0x505c04];return _0x535d88;}export async function updateDbLink(_0xeb541){const _0x34449e=a139_0x535d,_0x53d2fe=await apiRequest(_0x34449e(0x103),{'method':_0x34449e(0xc6),'body':_0xeb541});return _0x53d2fe[_0x34449e(0x88)];}export async function deleteDbLink(_0x213f70){await apiRequest('/smartapi/dblink/delete',{'method':'POST','body':{'id':_0x213f70}});}export async function testDbLinkConnect(_0x203f6a){const _0x215c1a=a139_0x535d,_0x1d7bc4=await apiRequest(_0x215c1a(0x9c)+buildQuery({'id':_0x203f6a}));return _0x1d7bc4[_0x215c1a(0x88)];}export async function startDbAnalysis(_0x438f43,_0x8e4322){const _0x7a3920=a139_0x535d,_0x3dfeea=await apiRequest(_0x7a3920(0xb1),{'method':_0x7a3920(0xc6),'body':{'dbLinkId':_0x438f43,..._0x8e4322&&_0x8e4322['length']>0x0?{'tableNames':_0x8e4322}:{}}}),_0x52c3ee=_0x3dfeea[_0x7a3920(0x88)];if(typeof _0x52c3ee===_0x7a3920(0xf6))return _0x52c3ee;if(_0x52c3ee&&typeof _0x52c3ee===_0x7a3920(0x113)&&typeof _0x52c3ee[_0x7a3920(0xd4)]===_0x7a3920(0xf6))return _0x52c3ee[_0x7a3920(0xd4)];return _0x52c3ee!=null?String(_0x52c3ee):'';}export async function cancelDbAnalysis(_0x5030fb){const _0x1917e0=a139_0x535d;await apiRequest(_0x1917e0(0xd5)+buildQuery({'planId':_0x5030fb}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x582c13){const _0x18a2b6=a139_0x535d,_0x57073a=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x582c13));return _0x57073a[_0x18a2b6(0x88)];}export async function getDbAllTableList(_0x48361d,_0x3839b){const _0x53e9e5=a139_0x535d,_0x551ff7=await apiRequest(_0x53e9e5(0xf5)+buildQuery({'appCode':_0x48361d,'dbLinkId':_0x3839b})),_0x619d76=_0x551ff7[_0x53e9e5(0x88)];if(Array[_0x53e9e5(0xd7)](_0x619d76))return _0x619d76;return extractList(_0x619d76);}export async function getDbTableDiff(_0x127842,_0x1576b0,_0x821ae8){const _0x399177=a139_0x535d,_0x2a0b25=await apiRequest(_0x399177(0x98)+buildQuery({'appCode':_0x127842,'dbLinkId':_0x1576b0,'pageIndex':_0x821ae8?.[_0x399177(0x8d)]??0x1,'pageSize':_0x821ae8?.[_0x399177(0x119)]??0x14,'tableName':_0x821ae8?.[_0x399177(0x10d)]})),_0xc6028a=_0x2a0b25[_0x399177(0x88)];return{'totalCount':_0xc6028a?.[_0x399177(0x7d)]??0x0,'tableList':Array[_0x399177(0xd7)](_0xc6028a?.['tableList'])?_0xc6028a[_0x399177(0x97)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x394f2d=a139_0x535d,_0x91b53c=await apiRequest(_0x394f2d(0x108),{'method':_0x394f2d(0xc6),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x2e9ab4=extractList(_0x91b53c[_0x394f2d(0x88)]),_0x5e5034=extractPaging(_0x91b53c[_0x394f2d(0x88)]);return _0x5e5034&&_0x5e5034[_0x394f2d(0x7d)]>REMOTE_APP_PAGE_SIZE&&console[_0x394f2d(0xeb)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x5e5034['totalCount']+_0x394f2d(0xf8)+_0x394f2d(0xd2)),_0x2e9ab4;}
@@ -1 +1 @@
1
- const a140_0x2e8874=a140_0x443f;(function(_0x542aab,_0x3b8dc6){const _0x52522b=a140_0x443f,_0x26f9b4=_0x542aab();while(!![]){try{const _0x2d3485=parseInt(_0x52522b(0xe3))/0x1*(parseInt(_0x52522b(0xf2))/0x2)+-parseInt(_0x52522b(0xeb))/0x3*(parseInt(_0x52522b(0xed))/0x4)+-parseInt(_0x52522b(0xec))/0x5*(parseInt(_0x52522b(0xe1))/0x6)+parseInt(_0x52522b(0xef))/0x7*(parseInt(_0x52522b(0xf0))/0x8)+parseInt(_0x52522b(0xe4))/0x9*(-parseInt(_0x52522b(0xe7))/0xa)+parseInt(_0x52522b(0xee))/0xb*(-parseInt(_0x52522b(0xf1))/0xc)+-parseInt(_0x52522b(0xe9))/0xd*(-parseInt(_0x52522b(0xe0))/0xe);if(_0x2d3485===_0x3b8dc6)break;else _0x26f9b4['push'](_0x26f9b4['shift']());}catch(_0x226824){_0x26f9b4['push'](_0x26f9b4['shift']());}}}(a140_0xa8c0,0xe4db4));import{resolve}from'node:path';function a140_0xa8c0(){const _0x41e075=['4WXaMvK','1177iLGVjc','63LnWdcF','837504xQRnoK','49548PLaftI','8QLVqtv','29662654OcyYSk','54OcZHWL','/bff','3169RHjPnX','27isZVXY','bff-trash','.rabetbase','307990xQyHXu','bff.lock.json','13QJxuZw','bff','4124430eAxQqd','126235RmUxMF'];a140_0xa8c0=function(){return _0x41e075;};return a140_0xa8c0();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a140_0x2e8874(0xe6),LOCK_FILE_NAME=a140_0x2e8874(0xe8),TRASH_DIR_NAME=a140_0x2e8874(0xe5);function a140_0x443f(_0xb96e59,_0x5c30e8){_0xb96e59=_0xb96e59-0xe0;const _0xa8c068=a140_0xa8c0();let _0x443f29=_0xa8c068[_0xb96e59];return _0x443f29;}export function loadBffProjectConfig(_0x2037ee,_0x40c5b5){const _0x26d492=a140_0x2e8874,_0x5c2eca=resolve(_0x40c5b5??findProjectRootDirectory()),_0x4a065e=DOT_DIR+_0x26d492(0xe2),_0x4f5c7f=_0x4a065e+'/'+_0x2037ee;return{'projectRoot':_0x5c2eca,'appCode':_0x2037ee,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4a065e,'scriptsRoot':_0x4f5c7f,'scriptsRootDir':resolve(_0x5c2eca,DOT_DIR,_0x26d492(0xea),_0x2037ee),'lockFilePath':resolve(_0x5c2eca,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5c2eca,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a140_0x3226(_0x35aa1b,_0x51fee8){_0x35aa1b=_0x35aa1b-0x1f3;const _0x3ddf64=a140_0x3ddf();let _0x322641=_0x3ddf64[_0x35aa1b];return _0x322641;}const a140_0x4d9680=a140_0x3226;function a140_0x3ddf(){const _0x3c093a=['80632wbUneR','bff.lock.json','10dyGBAd','.rabetbase','2428632yeKDRP','12lnFQbG','bff-trash','28amxaGB','1443561HmVHqu','211851tCYyPJ','6889476YpwBJH','1202196PbXUAF','4665940jhRidj','4KapboQ','/bff'];a140_0x3ddf=function(){return _0x3c093a;};return a140_0x3ddf();}(function(_0x5904ca,_0x300793){const _0x1da235=a140_0x3226,_0x44fc28=_0x5904ca();while(!![]){try{const _0xb19c43=-parseInt(_0x1da235(0x1fb))/0x1*(parseInt(_0x1da235(0x1f6))/0x2)+parseInt(_0x1da235(0x1fe))/0x3*(parseInt(_0x1da235(0x1f4))/0x4)+parseInt(_0x1da235(0x1f3))/0x5+-parseInt(_0x1da235(0x201))/0x6*(parseInt(_0x1da235(0x1fd))/0x7)+-parseInt(_0x1da235(0x1fa))/0x8+-parseInt(_0x1da235(0x1ff))/0x9*(-parseInt(_0x1da235(0x1f8))/0xa)+parseInt(_0x1da235(0x200))/0xb;if(_0xb19c43===_0x300793)break;else _0x44fc28['push'](_0x44fc28['shift']());}catch(_0x3ac59c){_0x44fc28['push'](_0x44fc28['shift']());}}}(a140_0x3ddf,0x74103));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a140_0x4d9680(0x1f9),LOCK_FILE_NAME=a140_0x4d9680(0x1f7),TRASH_DIR_NAME=a140_0x4d9680(0x1fc);export function loadBffProjectConfig(_0x223a35,_0x5e13e3){const _0x1989af=a140_0x4d9680,_0x3768f2=resolve(_0x5e13e3??findProjectRootDirectory()),_0x4097b6=DOT_DIR+_0x1989af(0x1f5),_0x189199=_0x4097b6+'/'+_0x223a35;return{'projectRoot':_0x3768f2,'appCode':_0x223a35,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4097b6,'scriptsRoot':_0x189199,'scriptsRootDir':resolve(_0x3768f2,DOT_DIR,'bff',_0x223a35),'lockFilePath':resolve(_0x3768f2,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3768f2,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a141_0x503db7=a141_0x18fe;(function(_0xd9a0f6,_0x2eef1e){const _0x24c87e=a141_0x18fe,_0x4ee8bb=_0xd9a0f6();while(!![]){try{const _0x3df9eb=-parseInt(_0x24c87e(0x13b))/0x1*(-parseInt(_0x24c87e(0x14c))/0x2)+parseInt(_0x24c87e(0x13d))/0x3*(parseInt(_0x24c87e(0x138))/0x4)+parseInt(_0x24c87e(0x130))/0x5+parseInt(_0x24c87e(0x141))/0x6*(parseInt(_0x24c87e(0x140))/0x7)+-parseInt(_0x24c87e(0x135))/0x8+-parseInt(_0x24c87e(0x13c))/0x9+-parseInt(_0x24c87e(0x146))/0xa;if(_0x3df9eb===_0x2eef1e)break;else _0x4ee8bb['push'](_0x4ee8bb['shift']());}catch(_0x397938){_0x4ee8bb['push'](_0x4ee8bb['shift']());}}}(a141_0x27df,0x3602d));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a141_0x503db7(0x128),a141_0x503db7(0x12e),a141_0x503db7(0x13a)];export function normalizeBffType(_0x1d4baa){const _0x3a3a00=a141_0x503db7;if(!_0x1d4baa)return undefined;const _0x46b7e7=_0x1d4baa[_0x3a3a00(0x14e)]()[_0x3a3a00(0x131)]();return SUPPORTED_BFF_TYPES['includes'](_0x46b7e7)?_0x46b7e7:undefined;}function a141_0x18fe(_0x3d11d2,_0x3c59e4){_0x3d11d2=_0x3d11d2-0x128;const _0x27df23=a141_0x27df();let _0x18fed2=_0x27df23[_0x3d11d2];return _0x18fed2;}async function scanJsFilesRecursively(_0x2c0518,_0x3f8f9b){const _0x1b0683=a141_0x503db7,_0xf224c=[];try{const _0x31f128=await readdir(_0x2c0518,{'withFileTypes':!![]});for(const _0x5b6fa7 of _0x31f128){const _0x3346f5=join(_0x2c0518,_0x5b6fa7[_0x1b0683(0x149)]);if(_0x5b6fa7['isDirectory']())_0xf224c['push'](...await scanJsFilesRecursively(_0x3346f5,_0x3f8f9b+'/'+_0x5b6fa7[_0x1b0683(0x149)]));else _0x5b6fa7[_0x1b0683(0x136)]()&&_0x5b6fa7[_0x1b0683(0x149)][_0x1b0683(0x148)]('.js')&&_0xf224c[_0x1b0683(0x14d)]({'lockKey':_0x3f8f9b+'/'+_0x5b6fa7[_0x1b0683(0x149)][_0x1b0683(0x142)](/\.js$/,''),'filePath':_0x3346f5});}}catch(_0x32cbe3){if(_0x32cbe3[_0x1b0683(0x139)]!=='ENOENT')throw _0x32cbe3;}return _0xf224c;}async function scanFlatFunctions(_0x1f11a2,_0x3ac7a4){const _0x5c748a=a141_0x503db7,_0x46c633=join(_0x1f11a2[_0x5c748a(0x147)],_0x3ac7a4),_0x3d7272=await scanJsFilesRecursively(_0x46c633,_0x3ac7a4);return _0x3d7272[_0x5c748a(0x144)](({lockKey:_0x29c46c,filePath:_0x59fc4a})=>({'type':_0x3ac7a4,'name':_0x29c46c[_0x5c748a(0x132)]('/')['at'](-0x1)??'','filePath':_0x59fc4a,'lockKey':_0x29c46c}));}function a141_0x27df(){const _0x4c3f5b=['beforeScriptId','alias','.js','functionNode','ENDPOINT','set','2020565JMjGbj','toUpperCase','split','datasetCode','isDirectory','3271864DfdszB','isFile','get','99320flneJV','code','HOOK','4566KBayWw','3707991wSGCSK','39phFOBY','before','after','931gEqTYC','19722TPWwYP','replace','operationType','map','HOOK/','4597470tZZTrj','scriptsRootDir','endsWith','name','all','functionName','148lqiumO','push','trim','scriptType','COMMON','afterScriptId'];a141_0x27df=function(){return _0x4c3f5b;};return a141_0x27df();}async function scanHookFunctions(_0x1f575b){const _0x2de177=a141_0x503db7,_0x170608=join(_0x1f575b[_0x2de177(0x147)],_0x2de177(0x13a)),_0x50a7c8=[];try{const _0x5a0ebf=await readdir(_0x170608,{'withFileTypes':!![]});for(const _0xeb2db3 of _0x5a0ebf){if(!_0xeb2db3[_0x2de177(0x134)]())continue;const _0x431b66=_0xeb2db3[_0x2de177(0x149)],_0x2414c8=join(_0x170608,_0x431b66),_0x126bd0=await readdir(_0x2414c8,{'withFileTypes':!![]});for(const _0x569599 of _0x126bd0){if(!_0x569599[_0x2de177(0x134)]())continue;const _0x4473c9=_0x569599[_0x2de177(0x149)],_0x13a7c3=join(_0x2414c8,_0x4473c9),_0x476c41=await readdir(_0x13a7c3,{'withFileTypes':!![]});for(const _0x1dedeb of _0x476c41){if(!_0x1dedeb[_0x2de177(0x134)]())continue;const _0x1f6171=_0x1dedeb['name'],_0x500813=join(_0x13a7c3,_0x1f6171),_0x135915=await readdir(_0x500813,{'withFileTypes':!![]});for(const _0x2fa960 of _0x135915){if(!_0x2fa960[_0x2de177(0x136)]()||!_0x2fa960[_0x2de177(0x149)][_0x2de177(0x148)](_0x2de177(0x12c)))continue;const _0x32358f=_0x2fa960[_0x2de177(0x149)][_0x2de177(0x142)](/\.js$/,'');_0x50a7c8[_0x2de177(0x14d)]({'type':'HOOK','name':_0x32358f,'filePath':join(_0x500813,_0x2fa960[_0x2de177(0x149)]),'lockKey':'HOOK/'+_0x431b66+'/'+_0x4473c9+'/'+_0x1f6171+'/'+_0x32358f,'alias':_0x431b66,'operationType':_0x4473c9,'functionNode':_0x1f6171});}}}}}catch(_0x2a4004){if(_0x2a4004[_0x2de177(0x139)]!=='ENOENT')throw _0x2a4004;}return _0x50a7c8;}export async function scanLocalBffFunctions(_0x3658de,_0x5c6518){const _0x7d1529=a141_0x503db7;if(_0x5c6518===_0x7d1529(0x128)||_0x5c6518===_0x7d1529(0x12e))return scanFlatFunctions(_0x3658de,_0x5c6518);if(_0x5c6518===_0x7d1529(0x13a))return scanHookFunctions(_0x3658de);const [_0x53b4e3,_0x421872,_0x28f1d6]=await Promise[_0x7d1529(0x14a)]([scanFlatFunctions(_0x3658de,'COMMON'),scanFlatFunctions(_0x3658de,_0x7d1529(0x12e)),scanHookFunctions(_0x3658de)]);return[..._0x53b4e3,..._0x421872,..._0x28f1d6];}export function resolveLocalFilePathFromLockKey(_0x3e1f8a,_0x3a70d1){const _0x4c9b4a=a141_0x503db7;return join(_0x3e1f8a[_0x4c9b4a(0x147)],..._0x3a70d1[_0x4c9b4a(0x132)]('/'))+_0x4c9b4a(0x12c);}export function createHookLocationMap(_0x2d9caf){const _0x28af5b=a141_0x503db7,_0x22cd7e=new Map();for(const _0x378b0c of _0x2d9caf){_0x378b0c[_0x28af5b(0x12a)]&&_0x22cd7e[_0x28af5b(0x12f)](_0x378b0c[_0x28af5b(0x12a)],{'datasetCode':_0x378b0c[_0x28af5b(0x133)],'operationType':snakeToCamel(_0x378b0c[_0x28af5b(0x143)]),'functionNode':_0x28af5b(0x13e)}),_0x378b0c[_0x28af5b(0x129)]&&_0x22cd7e[_0x28af5b(0x12f)](_0x378b0c[_0x28af5b(0x129)],{'datasetCode':_0x378b0c[_0x28af5b(0x133)],'operationType':snakeToCamel(_0x378b0c[_0x28af5b(0x143)]),'functionNode':_0x28af5b(0x13f)});}return _0x22cd7e;}export function resolveRemoteScriptTarget(_0x45b450,_0x468ea7,_0x411c12,_0x5a78c7,_0x552ba4){const _0x492214=a141_0x503db7,_0x4f91cb=normalizeBffType(_0x468ea7[_0x492214(0x14f)]);if(!_0x4f91cb||!_0x468ea7[_0x492214(0x14b)])return null;if(_0x4f91cb==='HOOK'){const _0x5d1ed9=(_0x468ea7['id']?_0x411c12[_0x492214(0x137)](_0x468ea7['id']):undefined)??findHookLocationByRemoteId(_0x5a78c7,_0x468ea7['id']);if(!_0x5d1ed9)return null;const _0x2bb536=_0x5d1ed9[_0x492214(0x12b)]||_0x552ba4['get'](_0x5d1ed9[_0x492214(0x133)]),_0x44e821=_0x2bb536??_0x5d1ed9[_0x492214(0x133)],_0x2be21a={..._0x5d1ed9,'alias':_0x2bb536},_0x94618a=_0x492214(0x145)+_0x44e821+'/'+_0x2be21a['operationType']+'/'+_0x2be21a[_0x492214(0x12d)]+'/'+_0x468ea7[_0x492214(0x14b)];return{'lockKey':_0x94618a,'filePath':resolveLocalFilePathFromLockKey(_0x45b450,_0x94618a),'type':_0x492214(0x13a),'hookLocation':_0x2be21a};}const _0x18f2a3=_0x4f91cb+'/'+_0x468ea7[_0x492214(0x14b)];return{'lockKey':_0x18f2a3,'filePath':resolveLocalFilePathFromLockKey(_0x45b450,_0x18f2a3),'type':_0x4f91cb};}export async function ensureParentDirectory(_0x4ba624){await mkdir(dirname(_0x4ba624),{'recursive':!![]});}export async function fileExists(_0x3c0638){try{return await access(_0x3c0638,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x2bbcbb){const _0x261e77=a141_0x503db7;try{const _0x1601f0=await stat(_0x2bbcbb);return _0x1601f0[_0x261e77(0x134)]();}catch{return![];}}
1
+ const a141_0x3edae2=a141_0x182f;(function(_0x460bdc,_0x38e257){const _0xd03cc3=a141_0x182f,_0x2c9979=_0x460bdc();while(!![]){try{const _0x5754b9=parseInt(_0xd03cc3(0x1da))/0x1+parseInt(_0xd03cc3(0x1f5))/0x2+parseInt(_0xd03cc3(0x1f3))/0x3*(-parseInt(_0xd03cc3(0x1fc))/0x4)+parseInt(_0xd03cc3(0x1f2))/0x5*(-parseInt(_0xd03cc3(0x1ed))/0x6)+-parseInt(_0xd03cc3(0x1dd))/0x7+-parseInt(_0xd03cc3(0x1de))/0x8*(-parseInt(_0xd03cc3(0x1f9))/0x9)+-parseInt(_0xd03cc3(0x1f0))/0xa*(-parseInt(_0xd03cc3(0x1e2))/0xb);if(_0x5754b9===_0x38e257)break;else _0x2c9979['push'](_0x2c9979['shift']());}catch(_0x4241d6){_0x2c9979['push'](_0x2c9979['shift']());}}}(a141_0x3c62,0x96c9c));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a141_0x182f(_0x5201bf,_0x4dc501){_0x5201bf=_0x5201bf-0x1d5;const _0x3c623f=a141_0x3c62();let _0x182fb7=_0x3c623f[_0x5201bf];return _0x182fb7;}export const SUPPORTED_BFF_TYPES=[a141_0x3edae2(0x1e8),'ENDPOINT',a141_0x3edae2(0x1fb)];function a141_0x3c62(){const _0x28a58f=['70191qsOEMW','beforeScriptId','HOOK','4SbxUqo','functionNode','functionName','isFile','set','ENOENT','972037gKSYFN','code','toUpperCase','7541387iuystO','48OEXWqS','scriptsRootDir','operationType','ENDPOINT','3368915VfkWXA','alias','F_OK','push','get','.js','COMMON','isDirectory','scriptType','includes','replace','18AiOMVv','before','name','50nKMJos','afterScriptId','1724465EGyXIk','1302867CzmgyT','datasetCode','1227562YfYvzw','HOOK/','trim','all'];a141_0x3c62=function(){return _0x28a58f;};return a141_0x3c62();}export function normalizeBffType(_0x1ee29f){const _0x501f9d=a141_0x3edae2;if(!_0x1ee29f)return undefined;const _0x665959=_0x1ee29f[_0x501f9d(0x1f7)]()[_0x501f9d(0x1dc)]();return SUPPORTED_BFF_TYPES[_0x501f9d(0x1eb)](_0x665959)?_0x665959:undefined;}async function scanJsFilesRecursively(_0x53c6d9,_0x57ad14){const _0x53a993=a141_0x3edae2,_0x5ed2e8=[];try{const _0x42905d=await readdir(_0x53c6d9,{'withFileTypes':!![]});for(const _0x54a4e8 of _0x42905d){const _0x538b64=join(_0x53c6d9,_0x54a4e8[_0x53a993(0x1ef)]);if(_0x54a4e8['isDirectory']())_0x5ed2e8[_0x53a993(0x1e5)](...await scanJsFilesRecursively(_0x538b64,_0x57ad14+'/'+_0x54a4e8['name']));else _0x54a4e8['isFile']()&&_0x54a4e8[_0x53a993(0x1ef)]['endsWith'](_0x53a993(0x1e7))&&_0x5ed2e8['push']({'lockKey':_0x57ad14+'/'+_0x54a4e8['name'][_0x53a993(0x1ec)](/\.js$/,''),'filePath':_0x538b64});}}catch(_0x4e9288){if(_0x4e9288[_0x53a993(0x1db)]!=='ENOENT')throw _0x4e9288;}return _0x5ed2e8;}async function scanFlatFunctions(_0x24a22d,_0x5b70fd){const _0x2e913a=a141_0x3edae2,_0x552488=join(_0x24a22d[_0x2e913a(0x1df)],_0x5b70fd),_0x577f45=await scanJsFilesRecursively(_0x552488,_0x5b70fd);return _0x577f45['map'](({lockKey:_0x20d5e3,filePath:_0x1b3a4a})=>({'type':_0x5b70fd,'name':_0x20d5e3['split']('/')['at'](-0x1)??'','filePath':_0x1b3a4a,'lockKey':_0x20d5e3}));}async function scanHookFunctions(_0x24c9c7){const _0x2ceb01=a141_0x3edae2,_0x21ed3b=join(_0x24c9c7['scriptsRootDir'],_0x2ceb01(0x1fb)),_0x3bb8fc=[];try{const _0x531b9a=await readdir(_0x21ed3b,{'withFileTypes':!![]});for(const _0x5ccb15 of _0x531b9a){if(!_0x5ccb15['isDirectory']())continue;const _0x1256e8=_0x5ccb15[_0x2ceb01(0x1ef)],_0x543efe=join(_0x21ed3b,_0x1256e8),_0x4edd12=await readdir(_0x543efe,{'withFileTypes':!![]});for(const _0x17ef8d of _0x4edd12){if(!_0x17ef8d[_0x2ceb01(0x1e9)]())continue;const _0x2671c1=_0x17ef8d[_0x2ceb01(0x1ef)],_0x3256b4=join(_0x543efe,_0x2671c1),_0x3abbb8=await readdir(_0x3256b4,{'withFileTypes':!![]});for(const _0x3ec8d4 of _0x3abbb8){if(!_0x3ec8d4[_0x2ceb01(0x1e9)]())continue;const _0x1ed2b4=_0x3ec8d4[_0x2ceb01(0x1ef)],_0x74b89=join(_0x3256b4,_0x1ed2b4),_0xc738e2=await readdir(_0x74b89,{'withFileTypes':!![]});for(const _0x12e93e of _0xc738e2){if(!_0x12e93e[_0x2ceb01(0x1d7)]()||!_0x12e93e[_0x2ceb01(0x1ef)]['endsWith'](_0x2ceb01(0x1e7)))continue;const _0x24fad9=_0x12e93e[_0x2ceb01(0x1ef)][_0x2ceb01(0x1ec)](/\.js$/,'');_0x3bb8fc[_0x2ceb01(0x1e5)]({'type':_0x2ceb01(0x1fb),'name':_0x24fad9,'filePath':join(_0x74b89,_0x12e93e['name']),'lockKey':_0x2ceb01(0x1f6)+_0x1256e8+'/'+_0x2671c1+'/'+_0x1ed2b4+'/'+_0x24fad9,'alias':_0x1256e8,'operationType':_0x2671c1,'functionNode':_0x1ed2b4});}}}}}catch(_0x231158){if(_0x231158[_0x2ceb01(0x1db)]!==_0x2ceb01(0x1d9))throw _0x231158;}return _0x3bb8fc;}export async function scanLocalBffFunctions(_0x2dfbb1,_0x2fe177){const _0x39868b=a141_0x3edae2;if(_0x2fe177===_0x39868b(0x1e8)||_0x2fe177===_0x39868b(0x1e1))return scanFlatFunctions(_0x2dfbb1,_0x2fe177);if(_0x2fe177==='HOOK')return scanHookFunctions(_0x2dfbb1);const [_0x45cc97,_0x38a15b,_0x5186e6]=await Promise[_0x39868b(0x1f8)]([scanFlatFunctions(_0x2dfbb1,_0x39868b(0x1e8)),scanFlatFunctions(_0x2dfbb1,_0x39868b(0x1e1)),scanHookFunctions(_0x2dfbb1)]);return[..._0x45cc97,..._0x38a15b,..._0x5186e6];}export function resolveLocalFilePathFromLockKey(_0x351543,_0x132312){const _0x39ab14=a141_0x3edae2;return join(_0x351543[_0x39ab14(0x1df)],..._0x132312['split']('/'))+'.js';}export function createHookLocationMap(_0x59e573){const _0x21f605=a141_0x3edae2,_0x18c2e4=new Map();for(const _0x10e380 of _0x59e573){_0x10e380[_0x21f605(0x1fa)]&&_0x18c2e4[_0x21f605(0x1d8)](_0x10e380[_0x21f605(0x1fa)],{'datasetCode':_0x10e380['datasetCode'],'operationType':snakeToCamel(_0x10e380[_0x21f605(0x1e0)]),'functionNode':_0x21f605(0x1ee)}),_0x10e380[_0x21f605(0x1f1)]&&_0x18c2e4['set'](_0x10e380[_0x21f605(0x1f1)],{'datasetCode':_0x10e380[_0x21f605(0x1f4)],'operationType':snakeToCamel(_0x10e380[_0x21f605(0x1e0)]),'functionNode':'after'});}return _0x18c2e4;}export function resolveRemoteScriptTarget(_0x37470f,_0x5d6401,_0x560d5c,_0x4987a3,_0x38388a){const _0x5d6f2a=a141_0x3edae2,_0x118939=normalizeBffType(_0x5d6401[_0x5d6f2a(0x1ea)]);if(!_0x118939||!_0x5d6401['functionName'])return null;if(_0x118939===_0x5d6f2a(0x1fb)){const _0x3c91b1=(_0x5d6401['id']?_0x560d5c[_0x5d6f2a(0x1e6)](_0x5d6401['id']):undefined)??findHookLocationByRemoteId(_0x4987a3,_0x5d6401['id']);if(!_0x3c91b1)return null;const _0x36ed36=_0x3c91b1[_0x5d6f2a(0x1e3)]||_0x38388a[_0x5d6f2a(0x1e6)](_0x3c91b1[_0x5d6f2a(0x1f4)]),_0x139941=_0x36ed36??_0x3c91b1[_0x5d6f2a(0x1f4)],_0x402842={..._0x3c91b1,'alias':_0x36ed36},_0x41e74d=_0x5d6f2a(0x1f6)+_0x139941+'/'+_0x402842[_0x5d6f2a(0x1e0)]+'/'+_0x402842[_0x5d6f2a(0x1d5)]+'/'+_0x5d6401['functionName'];return{'lockKey':_0x41e74d,'filePath':resolveLocalFilePathFromLockKey(_0x37470f,_0x41e74d),'type':'HOOK','hookLocation':_0x402842};}const _0xf1413e=_0x118939+'/'+_0x5d6401[_0x5d6f2a(0x1d6)];return{'lockKey':_0xf1413e,'filePath':resolveLocalFilePathFromLockKey(_0x37470f,_0xf1413e),'type':_0x118939};}export async function ensureParentDirectory(_0x503c7b){await mkdir(dirname(_0x503c7b),{'recursive':!![]});}export async function fileExists(_0x2aa24a){const _0xf3b836=a141_0x3edae2;try{return await access(_0x2aa24a,constants[_0xf3b836(0x1e4)]),!![];}catch{return![];}}export async function directoryExists(_0x16b87c){try{const _0x1c5deb=await stat(_0x16b87c);return _0x1c5deb['isDirectory']();}catch{return![];}}
@@ -1 +1 @@
1
- function a142_0x2004(_0x2d5b3e,_0x5b662e){_0x2d5b3e=_0x2d5b3e-0x182;const _0x3058e2=a142_0x3058();let _0x200419=_0x3058e2[_0x2d5b3e];return _0x200419;}(function(_0x2b39fe,_0x336034){const _0x4d8a4b=a142_0x2004,_0x35d15e=_0x2b39fe();while(!![]){try{const _0x5c334e=parseInt(_0x4d8a4b(0x183))/0x1+-parseInt(_0x4d8a4b(0x18a))/0x2*(parseInt(_0x4d8a4b(0x185))/0x3)+parseInt(_0x4d8a4b(0x182))/0x4+-parseInt(_0x4d8a4b(0x18d))/0x5*(parseInt(_0x4d8a4b(0x187))/0x6)+parseInt(_0x4d8a4b(0x18e))/0x7+parseInt(_0x4d8a4b(0x189))/0x8+-parseInt(_0x4d8a4b(0x184))/0x9*(parseInt(_0x4d8a4b(0x188))/0xa);if(_0x5c334e===_0x336034)break;else _0x35d15e['push'](_0x35d15e['shift']());}catch(_0x2bc790){_0x35d15e['push'](_0x35d15e['shift']());}}}(a142_0x3058,0xbd2b7));import{readFile}from'node:fs/promises';import a142_0x12f810 from'node:crypto';export function computeContentHash(_0x4d3892){const _0x5f24ce=a142_0x2004;return a142_0x12f810['createHash'](_0x5f24ce(0x186))['update'](_0x4d3892)[_0x5f24ce(0x18b)]('hex');}function a142_0x3058(){const _0xca1493=['utf8','15QXEYXi','5760951ORiEqz','3281556zKnjfL','1201115jyTHdS','9aEanlq','3pUAgOu','md5','2447754kBTSFq','13880210uFvnCZ','10419024kleztb','1520276dyQLVa','digest'];a142_0x3058=function(){return _0xca1493;};return a142_0x3058();}export async function computeFileHash(_0x2219ac){const _0x2b2cce=a142_0x2004,_0x2f5453=await readFile(_0x2219ac,_0x2b2cce(0x18c));return computeContentHash(_0x2f5453);}
1
+ function a142_0x450a(_0x9d393b,_0x43ce7b){_0x9d393b=_0x9d393b-0xa9;const _0x2ad42f=a142_0x2ad4();let _0x450a97=_0x2ad42f[_0x9d393b];return _0x450a97;}(function(_0x202680,_0x208e72){const _0x9ad747=a142_0x450a,_0x10f6df=_0x202680();while(!![]){try{const _0x32e2bf=parseInt(_0x9ad747(0xae))/0x1+-parseInt(_0x9ad747(0xab))/0x2*(-parseInt(_0x9ad747(0xaa))/0x3)+-parseInt(_0x9ad747(0xb0))/0x4+-parseInt(_0x9ad747(0xb1))/0x5+-parseInt(_0x9ad747(0xb3))/0x6*(parseInt(_0x9ad747(0xb6))/0x7)+parseInt(_0x9ad747(0xb4))/0x8*(parseInt(_0x9ad747(0xac))/0x9)+parseInt(_0x9ad747(0xb5))/0xa*(parseInt(_0x9ad747(0xb2))/0xb);if(_0x32e2bf===_0x208e72)break;else _0x10f6df['push'](_0x10f6df['shift']());}catch(_0x163219){_0x10f6df['push'](_0x10f6df['shift']());}}}(a142_0x2ad4,0xa12ed));import{readFile}from'node:fs/promises';import a142_0x151f8b from'node:crypto';export function computeContentHash(_0x403730){const _0x1b8566=a142_0x450a;return a142_0x151f8b[_0x1b8566(0xa9)]('md5')['update'](_0x403730)[_0x1b8566(0xad)](_0x1b8566(0xaf));}export async function computeFileHash(_0x3565ab){const _0x3c3b50=await readFile(_0x3565ab,'utf8');return computeContentHash(_0x3c3b50);}function a142_0x2ad4(){const _0x549e2a=['digest','99066DfqJNJ','hex','3031048SeGiLU','527875YmCAUW','549527xrilEU','3594FJjCYZ','7401176BRyBcd','130TPADZY','5187xUvBJh','createHash','881241Vdgtal','2rAWmki','9esJLKk'];a142_0x2ad4=function(){return _0x549e2a;};return a142_0x2ad4();}
@@ -1 +1 @@
1
- (function(_0x16028d,_0x14fafb){const _0x29e8ae=a143_0x272e,_0x31faa5=_0x16028d();while(!![]){try{const _0x4ca448=-parseInt(_0x29e8ae(0x1cd))/0x1*(parseInt(_0x29e8ae(0x1d9))/0x2)+parseInt(_0x29e8ae(0x1cf))/0x3+parseInt(_0x29e8ae(0x1d0))/0x4*(-parseInt(_0x29e8ae(0x1c9))/0x5)+parseInt(_0x29e8ae(0x1d2))/0x6+-parseInt(_0x29e8ae(0x1c6))/0x7+-parseInt(_0x29e8ae(0x1d5))/0x8+parseInt(_0x29e8ae(0x1cb))/0x9;if(_0x4ca448===_0x14fafb)break;else _0x31faa5['push'](_0x31faa5['shift']());}catch(_0xb83d){_0x31faa5['push'](_0x31faa5['shift']());}}}(a143_0x322b,0x1d5a1));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x2fe03e,_0x28d128,_0x41c6fc,_0x6e3a91){const _0x5b2abe=a143_0x272e,_0x134e5d={'apps':_0x2fe03e[_0x5b2abe(0x1d1)]&&typeof _0x2fe03e[_0x5b2abe(0x1d1)]==='object'?_0x2fe03e[_0x5b2abe(0x1d1)]:{}};let _0x2f71fe=_0x134e5d[_0x5b2abe(0x1d1)][_0x28d128];if(!_0x2f71fe)return _0x2f71fe={'scriptsRoot':_0x41c6fc,'lastSync':'','functions':{}},_0x134e5d[_0x5b2abe(0x1d1)][_0x28d128]=_0x2f71fe,{'lockData':_0x134e5d,'appLock':_0x2f71fe};if(!_0x2f71fe[_0x5b2abe(0x1d6)])_0x2f71fe[_0x5b2abe(0x1d6)]=_0x41c6fc;else{if(_0x2f71fe[_0x5b2abe(0x1d6)]!==_0x41c6fc)throw new Error(_0x6e3a91+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x41c6fc+_0x5b2abe(0x1d4)+_0x2f71fe[_0x5b2abe(0x1d6)]+_0x5b2abe(0x1d7))+_0x5b2abe(0x1c5));}return!_0x2f71fe['functions']&&(_0x2f71fe['functions']={}),!_0x2f71fe['lastSync']&&(_0x2f71fe[_0x5b2abe(0x1ce)]=''),{'lockData':_0x134e5d,'appLock':_0x2f71fe};}function a143_0x272e(_0xe5ed11,_0x245371){_0xe5ed11=_0xe5ed11-0x1c5;const _0x322bf2=a143_0x322b();let _0x272e9b=_0x322bf2[_0xe5ed11];return _0x272e9b;}function a143_0x322b(){const _0x437040=['6036TLmFYN','apps','1263300jPCtDg','utf8','\x22\x20vs\x20lock\x20\x22','302648GGWUaw','scriptsRoot','\x22.\x20','parse','158JIyFLU','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1111040jJWZRK','stringify','code','85mHqIwm','ENOENT','1528551tMNSeK','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','2455yLTZds','lastSync','467955TjtCxc'];a143_0x322b=function(){return _0x437040;};return a143_0x322b();}export async function readBffLockFile(_0x4eda78){const _0x2e8a2e=a143_0x272e;try{const _0x435371=await readFile(_0x4eda78,_0x2e8a2e(0x1d3)),_0x2d9841=JSON[_0x2e8a2e(0x1d8)](_0x435371);return{'apps':_0x2d9841[_0x2e8a2e(0x1d1)]&&typeof _0x2d9841[_0x2e8a2e(0x1d1)]==='object'?_0x2d9841[_0x2e8a2e(0x1d1)]:{}};}catch(_0x57828a){if(_0x57828a[_0x2e8a2e(0x1c8)]===_0x2e8a2e(0x1ca))return null;throw new Error(_0x2e8a2e(0x1cc)+String(_0x57828a));}}export async function writeBffLockFile(_0x418146,_0x4cb8b3){const _0x5402e7=a143_0x272e;await mkdir(dirname(_0x418146),{'recursive':!![]}),await writeFile(_0x418146,JSON[_0x5402e7(0x1c7)](_0x4cb8b3,null,0x2),_0x5402e7(0x1d3));}
1
+ (function(_0x5aa42f,_0x398165){const _0x17af11=a143_0x316e,_0x26dc1b=_0x5aa42f();while(!![]){try{const _0x51406b=-parseInt(_0x17af11(0xfe))/0x1*(-parseInt(_0x17af11(0xfc))/0x2)+parseInt(_0x17af11(0xf4))/0x3+parseInt(_0x17af11(0xf3))/0x4*(-parseInt(_0x17af11(0xee))/0x5)+-parseInt(_0x17af11(0xf0))/0x6+parseInt(_0x17af11(0xfb))/0x7*(parseInt(_0x17af11(0xf9))/0x8)+-parseInt(_0x17af11(0xfd))/0x9*(parseInt(_0x17af11(0xff))/0xa)+-parseInt(_0x17af11(0xeb))/0xb*(-parseInt(_0x17af11(0xea))/0xc);if(_0x51406b===_0x398165)break;else _0x26dc1b['push'](_0x26dc1b['shift']());}catch(_0x2bccf1){_0x26dc1b['push'](_0x26dc1b['shift']());}}}(a143_0x3311,0x8d415));function a143_0x316e(_0x1b3633,_0x38d5fc){_0x1b3633=_0x1b3633-0xea;const _0x331123=a143_0x3311();let _0x316ea1=_0x331123[_0x1b3633];return _0x316ea1;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x379c2a,_0x7956e4,_0x2eec19,_0x2ec2e4){const _0x316988=a143_0x316e,_0x341ca6={'apps':_0x379c2a[_0x316988(0xf7)]&&typeof _0x379c2a[_0x316988(0xf7)]===_0x316988(0x100)?_0x379c2a['apps']:{}};let _0x2a6353=_0x341ca6[_0x316988(0xf7)][_0x7956e4];if(!_0x2a6353)return _0x2a6353={'scriptsRoot':_0x2eec19,'lastSync':'','functions':{}},_0x341ca6[_0x316988(0xf7)][_0x7956e4]=_0x2a6353,{'lockData':_0x341ca6,'appLock':_0x2a6353};if(!_0x2a6353['scriptsRoot'])_0x2a6353[_0x316988(0x101)]=_0x2eec19;else{if(_0x2a6353[_0x316988(0x101)]!==_0x2eec19)throw new Error(_0x2ec2e4+_0x316988(0xed)+(_0x316988(0xf2)+_0x2eec19+'\x22\x20vs\x20lock\x20\x22'+_0x2a6353[_0x316988(0x101)]+_0x316988(0xf6))+_0x316988(0xf5));}return!_0x2a6353[_0x316988(0xfa)]&&(_0x2a6353[_0x316988(0xfa)]={}),!_0x2a6353[_0x316988(0xf8)]&&(_0x2a6353[_0x316988(0xf8)]=''),{'lockData':_0x341ca6,'appLock':_0x2a6353};}function a143_0x3311(){const _0x1afa08=['lastSync','280792vRBAbk','functions','217EfrHKf','187462zryYWb','9QMwkAF','1UjZSWa','8250590WlIWMd','object','scriptsRoot','112944fymgkm','517XuDQZt','code',':\x20scriptsRoot\x20mismatch\x20—\x20','5RJRccF','ENOENT','4332348DPdDIn','utf8','current\x20\x22','1929964dIWWQE','2952075uWuaxm','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22.\x20','apps'];a143_0x3311=function(){return _0x1afa08;};return a143_0x3311();}export async function readBffLockFile(_0x244d4a){const _0xa610d4=a143_0x316e;try{const _0x3cba80=await readFile(_0x244d4a,'utf8'),_0x488938=JSON['parse'](_0x3cba80);return{'apps':_0x488938[_0xa610d4(0xf7)]&&typeof _0x488938[_0xa610d4(0xf7)]===_0xa610d4(0x100)?_0x488938[_0xa610d4(0xf7)]:{}};}catch(_0x2e01c4){if(_0x2e01c4[_0xa610d4(0xec)]===_0xa610d4(0xef))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x2e01c4));}}export async function writeBffLockFile(_0x374af5,_0x26ee99){const _0x989085=a143_0x316e;await mkdir(dirname(_0x374af5),{'recursive':!![]}),await writeFile(_0x374af5,JSON['stringify'](_0x26ee99,null,0x2),_0x989085(0xf1));}
@@ -1 +1 @@
1
- (function(_0x5bf435,_0x1b4937){const _0x50d892=a145_0x57f3,_0x205ca2=_0x5bf435();while(!![]){try{const _0x2e7ea2=parseInt(_0x50d892(0xe4))/0x1+parseInt(_0x50d892(0xe6))/0x2+parseInt(_0x50d892(0xeb))/0x3*(-parseInt(_0x50d892(0xe7))/0x4)+parseInt(_0x50d892(0xde))/0x5*(parseInt(_0x50d892(0xe0))/0x6)+parseInt(_0x50d892(0xdc))/0x7+parseInt(_0x50d892(0xdb))/0x8+-parseInt(_0x50d892(0xe8))/0x9;if(_0x2e7ea2===_0x1b4937)break;else _0x205ca2['push'](_0x205ca2['shift']());}catch(_0x300301){_0x205ca2['push'](_0x205ca2['shift']());}}}(a145_0x1f2c,0xa7c31));export function snakeToCamel(_0x36f6a1){const _0x22530d=a145_0x57f3;return _0x36f6a1[_0x22530d(0xe5)]()['replace'](/_([a-z])/g,(_0x8cd28f,_0x5c8f0f)=>_0x5c8f0f[_0x22530d(0xe2)]());}function a145_0x57f3(_0x45a1e4,_0x57df75){_0x45a1e4=_0x45a1e4-0xdb;const _0x1f2c59=a145_0x1f2c();let _0x57f306=_0x1f2c59[_0x45a1e4];return _0x57f306;}export function findHookLocationByRemoteId(_0x46d18f,_0x4c5e4d){const _0x6466ce=a145_0x57f3;if(!_0x4c5e4d)return undefined;for(const _0x20b219 of Object[_0x6466ce(0xdd)](_0x46d18f)){if(_0x20b219[_0x6466ce(0xe9)]===_0x4c5e4d&&_0x20b219[_0x6466ce(0xe1)]&&_0x20b219[_0x6466ce(0xe3)]&&_0x20b219[_0x6466ce(0xec)])return{'datasetCode':_0x20b219[_0x6466ce(0xe1)],'operationType':_0x20b219['operationType'],'functionNode':_0x20b219[_0x6466ce(0xec)]};}return undefined;}function a145_0x1f2c(){const _0xa0cbd8=['1241508KfyBSp','460148GwEHow','20688705Yqarot','remoteId','trim','3JBNzUN','functionNode','4003112iWVxFR','8859753SNHOup','values','35aEtlYx','after','254262mhCmUY','datasetCode','toUpperCase','operationType','417474NIqoRd','toLowerCase'];a145_0x1f2c=function(){return _0xa0cbd8;};return a145_0x1f2c();}export function extractScriptDescription(_0x3ae9ec){const _0x1b5489=a145_0x57f3,_0x27e966=_0x3ae9ec['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x27e966?.[0x1]?.[_0x1b5489(0xea)]()||undefined;}export function isValidBffFunctionName(_0x5994c5){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x5994c5);}export function normalizeHookFunctionNode(_0x280dec){const _0x3c5ff7=a145_0x57f3;if(!_0x280dec)return undefined;const _0x1196b8=_0x280dec['trim']()[_0x3c5ff7(0xe5)]();if(_0x1196b8==='before'||_0x1196b8===_0x3c5ff7(0xdf))return _0x1196b8;return undefined;}
1
+ (function(_0x513121,_0x448324){const _0x7e3295=a145_0x3a0e,_0x5989e5=_0x513121();while(!![]){try{const _0x2f92fe=-parseInt(_0x7e3295(0x157))/0x1*(-parseInt(_0x7e3295(0x150))/0x2)+-parseInt(_0x7e3295(0x151))/0x3*(parseInt(_0x7e3295(0x14d))/0x4)+parseInt(_0x7e3295(0x159))/0x5*(parseInt(_0x7e3295(0x156))/0x6)+parseInt(_0x7e3295(0x152))/0x7+-parseInt(_0x7e3295(0x14c))/0x8+parseInt(_0x7e3295(0x154))/0x9+-parseInt(_0x7e3295(0x14e))/0xa;if(_0x2f92fe===_0x448324)break;else _0x5989e5['push'](_0x5989e5['shift']());}catch(_0x135d8a){_0x5989e5['push'](_0x5989e5['shift']());}}}(a145_0x406e,0x30ff6));export function snakeToCamel(_0x28990e){const _0xff6b45=a145_0x3a0e;return _0x28990e[_0xff6b45(0x15a)]()[_0xff6b45(0x14f)](/_([a-z])/g,(_0x2ba837,_0xff82f6)=>_0xff82f6[_0xff6b45(0x155)]());}function a145_0x406e(){const _0x2d6759=['after','operationType','datasetCode','2034152aHyNhO','12FjYfET','5168500SIamng','replace','680382AKkpGF','68481kGBrSJ','1514030DyScel','before','1736379hXlTtU','toUpperCase','872646CYgmgS','1OvgSxS','match','10BCrFmg','toLowerCase','trim','remoteId','functionNode'];a145_0x406e=function(){return _0x2d6759;};return a145_0x406e();}function a145_0x3a0e(_0x308883,_0x4bd3be){_0x308883=_0x308883-0x14b;const _0x406e02=a145_0x406e();let _0x3a0e0e=_0x406e02[_0x308883];return _0x3a0e0e;}export function findHookLocationByRemoteId(_0x41a61b,_0x299d47){const _0x2cca2c=a145_0x3a0e;if(!_0x299d47)return undefined;for(const _0x1f0abf of Object['values'](_0x41a61b)){if(_0x1f0abf[_0x2cca2c(0x15c)]===_0x299d47&&_0x1f0abf[_0x2cca2c(0x14b)]&&_0x1f0abf[_0x2cca2c(0x15f)]&&_0x1f0abf[_0x2cca2c(0x15d)])return{'datasetCode':_0x1f0abf[_0x2cca2c(0x14b)],'operationType':_0x1f0abf[_0x2cca2c(0x15f)],'functionNode':_0x1f0abf[_0x2cca2c(0x15d)]};}return undefined;}export function extractScriptDescription(_0x3ee2bc){const _0x2c32f9=a145_0x3a0e,_0xd0302f=_0x3ee2bc[_0x2c32f9(0x158)](/\[\s*脚本描述\s*]\s*(.+)/);return _0xd0302f?.[0x1]?.[_0x2c32f9(0x15b)]()||undefined;}export function isValidBffFunctionName(_0x5c4cba){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x5c4cba);}export function normalizeHookFunctionNode(_0x2cd011){const _0x5cd081=a145_0x3a0e;if(!_0x2cd011)return undefined;const _0x224884=_0x2cd011[_0x5cd081(0x15b)]()[_0x5cd081(0x15a)]();if(_0x224884===_0x5cd081(0x153)||_0x224884===_0x5cd081(0x15e))return _0x224884;return undefined;}
@@ -1 +1 @@
1
- (function(_0x34c443,_0x221cb7){const _0x3032f7=a146_0x454e,_0x24a2d1=_0x34c443();while(!![]){try{const _0x367046=parseInt(_0x3032f7(0x1a5))/0x1*(parseInt(_0x3032f7(0x1a4))/0x2)+-parseInt(_0x3032f7(0x191))/0x3*(-parseInt(_0x3032f7(0x19f))/0x4)+parseInt(_0x3032f7(0x196))/0x5*(-parseInt(_0x3032f7(0x18d))/0x6)+parseInt(_0x3032f7(0x189))/0x7+-parseInt(_0x3032f7(0x18e))/0x8+parseInt(_0x3032f7(0x19a))/0x9+-parseInt(_0x3032f7(0x18f))/0xa*(parseInt(_0x3032f7(0x18a))/0xb);if(_0x367046===_0x221cb7)break;else _0x24a2d1['push'](_0x24a2d1['shift']());}catch(_0x19731b){_0x24a2d1['push'](_0x24a2d1['shift']());}}}(a146_0x4da2,0xace16));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x404c80){const _0x40aba3=a146_0x454e;if(cache[_0x40aba3(0x194)](_0x404c80))return cache['get'](_0x404c80);const _0x454e1a=await listDatasets(_0x404c80),_0x3c1bc0=new Map();for(const _0x56f811 of _0x454e1a){const _0x497dd2=_0x56f811[_0x40aba3(0x1a3)];_0x497dd2?.[_0x40aba3(0x19b)]!=null&&_0x3c1bc0[_0x40aba3(0x18b)](_0x497dd2[_0x40aba3(0x19b)],_0x497dd2[_0x40aba3(0x198)]??_0x40aba3(0x1a6)+_0x497dd2[_0x40aba3(0x19b)]);}const _0x2faaf8=[..._0x3c1bc0[_0x40aba3(0x195)]()][_0x40aba3(0x1a1)](([_0x523f87,_0x1b49cf])=>({'dbId':_0x523f87,'dbName':_0x1b49cf}));return cache['set'](_0x404c80,_0x2faaf8),_0x2faaf8;}function a146_0x454e(_0x4b9b0f,_0xe17e56){_0x4b9b0f=_0x4b9b0f-0x186;const _0x4da2c5=a146_0x4da2();let _0x454e63=_0x4da2c5[_0x4b9b0f];return _0x454e63;}export async function resolveDb(_0x19bb17,_0x811671){const _0x1b181c=a146_0x454e,_0x1029b4=await listDatabases(_0x19bb17);if(_0x1029b4[_0x1b181c(0x187)]===0x0)return{'resolved':[],'error':_0x1b181c(0x188)+_0x19bb17+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x811671)return{'resolved':_0x1029b4};const _0x11386f=Number(_0x811671);if(!Number[_0x1b181c(0x190)](_0x11386f)){const _0x3066ce=_0x1029b4[_0x1b181c(0x19c)](_0x10c2e0=>_0x10c2e0[_0x1b181c(0x19b)]===_0x11386f);if(_0x3066ce)return{'resolved':[_0x3066ce]};}const _0x5a37f2=_0x811671[_0x1b181c(0x197)](),_0x2f309e=_0x1029b4[_0x1b181c(0x19d)](_0x49f198=>_0x49f198['dbName'][_0x1b181c(0x197)]()[_0x1b181c(0x186)](_0x5a37f2));if(_0x2f309e[_0x1b181c(0x187)]>0x0)return{'resolved':_0x2f309e};const _0x3bd7f0=_0x1029b4['map'](_0x2c6502=>_0x2c6502['dbName']+'\x20('+_0x2c6502[_0x1b181c(0x19b)]+')')[_0x1b181c(0x199)](',\x20');return{'resolved':[],'error':_0x1b181c(0x19e)+_0x811671+_0x1b181c(0x1a2)+_0x19bb17+'\x22.\x20Available:\x20'+_0x3bd7f0+_0x1b181c(0x18c)};}export async function resolveOneDb(_0x52f8f5,_0x8c1cc6){const _0x1735d6=a146_0x454e,{resolved:_0x5e3c6f,error:_0x28a829}=await resolveDb(_0x52f8f5,_0x8c1cc6);if(_0x28a829)return{'db':null,'error':_0x28a829};if(_0x5e3c6f[_0x1735d6(0x187)]===0x1)return{'db':_0x5e3c6f[0x0]};if(!_0x8c1cc6){const _0x2cda5f=_0x5e3c6f[_0x1735d6(0x1a1)](_0x127764=>_0x127764[_0x1735d6(0x198)]+'\x20('+_0x127764[_0x1735d6(0x19b)]+')')[_0x1735d6(0x199)](',\x20');return{'db':null,'error':_0x1735d6(0x193)+_0x2cda5f};}const _0x55c839=_0x5e3c6f[_0x1735d6(0x1a1)](_0x1a0c43=>_0x1a0c43[_0x1735d6(0x198)]+'\x20('+_0x1a0c43[_0x1735d6(0x19b)]+')')[_0x1735d6(0x199)](',\x20');return{'db':null,'error':'\x22'+_0x8c1cc6+_0x1735d6(0x192)+_0x55c839+_0x1735d6(0x1a0)};}function a146_0x4da2(){const _0x49603c=['No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','3740765EdYbos','5159SnVRab','set','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','53076WEvfNS','10703896TjIRXT','1030nDOAhj','isNaN','3vcCAqS','\x22\x20matches\x20multiple\x20databases:\x20','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','has','entries','725SKDGlf','toLowerCase','dbName','join','8419248QVEgze','dbId','find','filter','No\x20database\x20matching\x20\x22','3678916kCfnyP','.\x20Be\x20more\x20specific.','map','\x22\x20under\x20app\x20\x22','dbtableConfig','4zmJwdr','493743NOkdFo','db-','includes','length'];a146_0x4da2=function(){return _0x49603c;};return a146_0x4da2();}export async function getDbName(_0x27df77,_0x1b0edd){const _0x23e3f9=a146_0x454e,_0x15244d=await listDatabases(_0x27df77);return _0x15244d[_0x23e3f9(0x19c)](_0x3f955d=>_0x3f955d[_0x23e3f9(0x19b)]===_0x1b0edd)?.[_0x23e3f9(0x198)];}
1
+ function a146_0x10f8(){const _0x36e7ed=['dbName','225288OhKtVt','444056aegwOH','length','filter','join','No\x20database\x20matching\x20\x22','.\x20Be\x20more\x20specific.','toLowerCase','4108482BtxUXx','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbtableConfig','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','db-','5146192yGNGio','set','dbId','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','has','716142yHRLQj','\x22.\x20Available:\x20','142169ZTgxxg','48130QVzDLE','402MEJjTT','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','get','find','entries'];a146_0x10f8=function(){return _0x36e7ed;};return a146_0x10f8();}(function(_0x4c9591,_0x1642cf){const _0x27798e=a146_0x40bd,_0x287c3d=_0x4c9591();while(!![]){try{const _0x530b55=-parseInt(_0x27798e(0x13c))/0x1+parseInt(_0x27798e(0x144))/0x2+-parseInt(_0x27798e(0x13a))/0x3+parseInt(_0x27798e(0x145))/0x4+parseInt(_0x27798e(0x13d))/0x5*(parseInt(_0x27798e(0x13e))/0x6)+parseInt(_0x27798e(0x14c))/0x7+-parseInt(_0x27798e(0x152))/0x8;if(_0x530b55===_0x1642cf)break;else _0x287c3d['push'](_0x287c3d['shift']());}catch(_0xb123e5){_0x287c3d['push'](_0x287c3d['shift']());}}}(a146_0x10f8,0x69509));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x953961){const _0x40280f=a146_0x40bd;if(cache[_0x40280f(0x139)](_0x953961))return cache[_0x40280f(0x140)](_0x953961);const _0x31c155=await listDatasets(_0x953961),_0xac2fba=new Map();for(const _0x57573a of _0x31c155){const _0x186e89=_0x57573a[_0x40280f(0x14e)];_0x186e89?.['dbId']!=null&&_0xac2fba[_0x40280f(0x136)](_0x186e89['dbId'],_0x186e89[_0x40280f(0x143)]??_0x40280f(0x151)+_0x186e89[_0x40280f(0x137)]);}const _0x469322=[..._0xac2fba[_0x40280f(0x142)]()][_0x40280f(0x150)](([_0x5c6202,_0x5e48f5])=>({'dbId':_0x5c6202,'dbName':_0x5e48f5}));return cache['set'](_0x953961,_0x469322),_0x469322;}function a146_0x40bd(_0x2c0603,_0x21bbfc){_0x2c0603=_0x2c0603-0x136;const _0x10f8c7=a146_0x10f8();let _0x40bd70=_0x10f8c7[_0x2c0603];return _0x40bd70;}export async function resolveDb(_0x434da9,_0x577f7c){const _0x3b51f3=a146_0x40bd,_0x526dcb=await listDatabases(_0x434da9);if(_0x526dcb['length']===0x0)return{'resolved':[],'error':_0x3b51f3(0x14f)+_0x434da9+_0x3b51f3(0x138)};if(!_0x577f7c)return{'resolved':_0x526dcb};const _0x54763d=Number(_0x577f7c);if(!Number['isNaN'](_0x54763d)){const _0x187e9d=_0x526dcb['find'](_0x4db225=>_0x4db225['dbId']===_0x54763d);if(_0x187e9d)return{'resolved':[_0x187e9d]};}const _0x3e681d=_0x577f7c[_0x3b51f3(0x14b)](),_0x30088b=_0x526dcb[_0x3b51f3(0x147)](_0xcc30d8=>_0xcc30d8[_0x3b51f3(0x143)][_0x3b51f3(0x14b)]()['includes'](_0x3e681d));if(_0x30088b[_0x3b51f3(0x146)]>0x0)return{'resolved':_0x30088b};const _0x16ca70=_0x526dcb['map'](_0x8891c1=>_0x8891c1[_0x3b51f3(0x143)]+'\x20('+_0x8891c1[_0x3b51f3(0x137)]+')')[_0x3b51f3(0x148)](',\x20');return{'resolved':[],'error':_0x3b51f3(0x149)+_0x577f7c+'\x22\x20under\x20app\x20\x22'+_0x434da9+_0x3b51f3(0x13b)+_0x16ca70+_0x3b51f3(0x13f)};}export async function resolveOneDb(_0x2a8aaf,_0x4623a4){const _0x58e913=a146_0x40bd,{resolved:_0x372b7e,error:_0x1691ba}=await resolveDb(_0x2a8aaf,_0x4623a4);if(_0x1691ba)return{'db':null,'error':_0x1691ba};if(_0x372b7e['length']===0x1)return{'db':_0x372b7e[0x0]};if(!_0x4623a4){const _0x2fe5a1=_0x372b7e[_0x58e913(0x150)](_0x5b1d25=>_0x5b1d25[_0x58e913(0x143)]+'\x20('+_0x5b1d25[_0x58e913(0x137)]+')')[_0x58e913(0x148)](',\x20');return{'db':null,'error':_0x58e913(0x14d)+_0x2fe5a1};}const _0x5d92c8=_0x372b7e[_0x58e913(0x150)](_0x5180e0=>_0x5180e0['dbName']+'\x20('+_0x5180e0[_0x58e913(0x137)]+')')[_0x58e913(0x148)](',\x20');return{'db':null,'error':'\x22'+_0x4623a4+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x5d92c8+_0x58e913(0x14a)};}export async function getDbName(_0x4a9b40,_0x4582bd){const _0x15851d=a146_0x40bd,_0x21e132=await listDatabases(_0x4a9b40);return _0x21e132[_0x15851d(0x141)](_0x23f711=>_0x23f711['dbId']===_0x4582bd)?.['dbName'];}
@@ -1 +1 @@
1
- const a147_0x47d14a=a147_0x30f4;(function(_0x13a485,_0x2b9d94){const _0x48fc05=a147_0x30f4,_0x3c18e7=_0x13a485();while(!![]){try{const _0xc8b85a=parseInt(_0x48fc05(0x169))/0x1*(parseInt(_0x48fc05(0x166))/0x2)+-parseInt(_0x48fc05(0x16a))/0x3+parseInt(_0x48fc05(0x16b))/0x4+-parseInt(_0x48fc05(0x168))/0x5+-parseInt(_0x48fc05(0x160))/0x6*(parseInt(_0x48fc05(0x16c))/0x7)+parseInt(_0x48fc05(0x167))/0x8+-parseInt(_0x48fc05(0x15d))/0x9;if(_0xc8b85a===_0x2b9d94)break;else _0x3c18e7['push'](_0x3c18e7['shift']());}catch(_0x984960){_0x3c18e7['push'](_0x3c18e7['shift']());}}}(a147_0x4ece,0x8b019));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0xd939,_0xa9b496=process[a147_0x47d14a(0x161)]()){const _0x486180=a147_0x47d14a,_0x55369e=resolve(_0xa9b496),_0x371615=join(_0x55369e,'.rabetbase',_0x486180(0x162));return{'projectRoot':_0x55369e,'pagesBaseDir':_0x371615,'appPagesDir':join(_0x371615,_0xd939),'lockFilePath':join(_0x55369e,'.rabetbase',_0x486180(0x15e))};}export function buildPageFileName(_0x3ef787,_0x4e0260){const _0x5ba315=a147_0x47d14a;return _0x3ef787+'-'+String(_0x4e0260)[_0x5ba315(0x15f)]()+_0x5ba315(0x164);}export function resolvePageFilePath(_0x17d3df,_0x567b9f,_0xced31b){const _0x26a3e9=a147_0x47d14a;return join(_0x17d3df[_0x26a3e9(0x165)],buildPageFileName(_0x567b9f,_0xced31b));}export async function ensureParentDirectory(_0x469a33){await mkdir(dirname(_0x469a33),{'recursive':!![]});}function a147_0x30f4(_0x51dc41,_0x5cf99a){_0x51dc41=_0x51dc41-0x15d;const _0x4ece3c=a147_0x4ece();let _0x30f45f=_0x4ece3c[_0x51dc41];return _0x30f45f;}export async function fileExists(_0x3cf107){const _0x317e70=a147_0x47d14a;try{return await access(_0x3cf107,constants[_0x317e70(0x163)]),!![];}catch{return![];}}function a147_0x4ece(){const _0x2f3b70=['cwd','page','F_OK','.json','appPagesDir','1046440Zstast','2406640YkCZao','197980JarflC','1gKyNpR','912486bgMQih','4168332aMbaJx','350364TepLfJ','2270502QMiVei','page.lock.json','toUpperCase','84ZwxYNJ'];a147_0x4ece=function(){return _0x2f3b70;};return a147_0x4ece();}
1
+ const a147_0x1c1556=a147_0x29e3;(function(_0x1d0a05,_0x44d09b){const _0x541c8d=a147_0x29e3,_0xc9e101=_0x1d0a05();while(!![]){try{const _0x13a07d=parseInt(_0x541c8d(0x10b))/0x1+parseInt(_0x541c8d(0x106))/0x2*(parseInt(_0x541c8d(0x10f))/0x3)+-parseInt(_0x541c8d(0x10e))/0x4*(-parseInt(_0x541c8d(0x10a))/0x5)+-parseInt(_0x541c8d(0x108))/0x6*(-parseInt(_0x541c8d(0x104))/0x7)+-parseInt(_0x541c8d(0x107))/0x8+-parseInt(_0x541c8d(0x100))/0x9+parseInt(_0x541c8d(0x109))/0xa*(-parseInt(_0x541c8d(0x10c))/0xb);if(_0x13a07d===_0x44d09b)break;else _0xc9e101['push'](_0xc9e101['shift']());}catch(_0x3b969f){_0xc9e101['push'](_0xc9e101['shift']());}}}(a147_0x3e14,0xb6ea1));import{constants}from'node:fs';function a147_0x3e14(){const _0x314298=['appPagesDir','8832330yuXuhp','.rabetbase','F_OK','cwd','217sZkqJG','toUpperCase','76JcHndW','247448nlDiVT','6798szYBbE','5021710ayGYCu','44335UpJwIw','919762yMTfzY','22Djbkau','page.lock.json','260gDANNL','97470XDJiQC','.json'];a147_0x3e14=function(){return _0x314298;};return a147_0x3e14();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x5c4d11,_0x8678e8=process[a147_0x1c1556(0x103)]()){const _0x3e485b=a147_0x1c1556,_0x419e1d=resolve(_0x8678e8),_0x2a390d=join(_0x419e1d,_0x3e485b(0x101),'page');return{'projectRoot':_0x419e1d,'pagesBaseDir':_0x2a390d,'appPagesDir':join(_0x2a390d,_0x5c4d11),'lockFilePath':join(_0x419e1d,'.rabetbase',_0x3e485b(0x10d))};}export function buildPageFileName(_0x224e5b,_0x445970){const _0x4c9a78=a147_0x1c1556;return _0x224e5b+'-'+String(_0x445970)[_0x4c9a78(0x105)]()+_0x4c9a78(0x110);}function a147_0x29e3(_0x1efc1d,_0x1000aa){_0x1efc1d=_0x1efc1d-0x100;const _0x3e144f=a147_0x3e14();let _0x29e38d=_0x3e144f[_0x1efc1d];return _0x29e38d;}export function resolvePageFilePath(_0x3866b1,_0x3a9b0a,_0x4b8ca6){const _0x3f544e=a147_0x1c1556;return join(_0x3866b1[_0x3f544e(0x111)],buildPageFileName(_0x3a9b0a,_0x4b8ca6));}export async function ensureParentDirectory(_0x1c358c){await mkdir(dirname(_0x1c358c),{'recursive':!![]});}export async function fileExists(_0x5c88af){const _0x2b3e65=a147_0x1c1556;try{return await access(_0x5c88af,constants[_0x2b3e65(0x102)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x3cf16c,_0x1a16bf){const _0x3455bc=a148_0x2d8f,_0x3e950c=_0x3cf16c();while(!![]){try{const _0x1e999f=-parseInt(_0x3455bc(0xea))/0x1+parseInt(_0x3455bc(0xf3))/0x2+-parseInt(_0x3455bc(0xeb))/0x3+-parseInt(_0x3455bc(0xef))/0x4+parseInt(_0x3455bc(0xed))/0x5*(parseInt(_0x3455bc(0xec))/0x6)+-parseInt(_0x3455bc(0xf6))/0x7+parseInt(_0x3455bc(0xee))/0x8;if(_0x1e999f===_0x1a16bf)break;else _0x3e950c['push'](_0x3e950c['shift']());}catch(_0x9c1d35){_0x3e950c['push'](_0x3e950c['shift']());}}}(a148_0x2102,0x3dc2c));import a148_0x191c85 from'node:crypto';import{readFile}from'node:fs/promises';function a148_0x2d8f(_0x41921b,_0x442344){_0x41921b=_0x41921b-0xe9;const _0x210245=a148_0x2102();let _0x2d8f15=_0x210245[_0x41921b];return _0x2d8f15;}function a148_0x2102(){const _0x52b593=['utf8','3413452khJhPv','stringify','128191yQQnJG','1123197gatcHI','21936SYVYVi','395jyqCLP','5893272JmVvYO','1072168MrYdUn','parse','update','hex','971514vuqMnY','md5'];a148_0x2102=function(){return _0x52b593;};return a148_0x2102();}export function serializePageSchemaForFile(_0x4bbfe0){const _0x1e6ac7=a148_0x2d8f;return JSON[_0x1e6ac7(0xe9)](JSON[_0x1e6ac7(0xf0)](_0x4bbfe0),null,0x2)+'\x0a';}export function computePageContentHash(_0x554c11){const _0x39e6d1=a148_0x2d8f;return a148_0x191c85['createHash'](_0x39e6d1(0xf4))[_0x39e6d1(0xf1)](_0x554c11)['digest'](_0x39e6d1(0xf2));}export function computeSerializedSchemaHash(_0x53459f){return computePageContentHash(serializePageSchemaForFile(_0x53459f));}export async function computePageFileHash(_0x10459e){const _0x5dd945=a148_0x2d8f,_0x261537=await readFile(_0x10459e,_0x5dd945(0xf5));return computePageContentHash(_0x261537);}
1
+ function a148_0x42ce(_0x1125fe,_0x42f04f){_0x1125fe=_0x1125fe-0x83;const _0x4401d1=a148_0x4401();let _0x42ceb5=_0x4401d1[_0x1125fe];return _0x42ceb5;}function a148_0x4401(){const _0x22ebfa=['104MErYzj','7092228RjkThE','1330IZHUdj','hex','748058zkbtNp','stringify','2OTosMT','8495262YmgdZp','4476018POKJEd','689255LpudQy','37164DyOAnk','53955760AoZZQs','parse','createHash'];a148_0x4401=function(){return _0x22ebfa;};return a148_0x4401();}(function(_0x2d3e15,_0x193495){const _0x1d8a17=a148_0x42ce,_0x42ec64=_0x2d3e15();while(!![]){try{const _0x5ce58c=parseInt(_0x1d8a17(0x8a))/0x1*(parseInt(_0x1d8a17(0x88))/0x2)+-parseInt(_0x1d8a17(0x8c))/0x3+-parseInt(_0x1d8a17(0x85))/0x4+-parseInt(_0x1d8a17(0x86))/0x5*(parseInt(_0x1d8a17(0x8e))/0x6)+-parseInt(_0x1d8a17(0x8d))/0x7*(parseInt(_0x1d8a17(0x84))/0x8)+parseInt(_0x1d8a17(0x8b))/0x9+parseInt(_0x1d8a17(0x8f))/0xa;if(_0x5ce58c===_0x193495)break;else _0x42ec64['push'](_0x42ec64['shift']());}catch(_0x3860d8){_0x42ec64['push'](_0x42ec64['shift']());}}}(a148_0x4401,0xda778));import a148_0x4d706c from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x56ca10){const _0xb37cf6=a148_0x42ce;return JSON[_0xb37cf6(0x89)](JSON[_0xb37cf6(0x90)](_0x56ca10),null,0x2)+'\x0a';}export function computePageContentHash(_0x1ab11e){const _0x5490bf=a148_0x42ce;return a148_0x4d706c[_0x5490bf(0x83)]('md5')['update'](_0x1ab11e)['digest'](_0x5490bf(0x87));}export function computeSerializedSchemaHash(_0x1dace0){return computePageContentHash(serializePageSchemaForFile(_0x1dace0));}export async function computePageFileHash(_0x556e91){const _0x2fec40=await readFile(_0x556e91,'utf8');return computePageContentHash(_0x2fec40);}
@@ -1 +1 @@
1
- (function(_0x4efa16,_0x28ff10){const _0x1c3210=a149_0xd36f,_0x1a99fa=_0x4efa16();while(!![]){try{const _0x379795=-parseInt(_0x1c3210(0x118))/0x1*(parseInt(_0x1c3210(0x11a))/0x2)+-parseInt(_0x1c3210(0x115))/0x3+parseInt(_0x1c3210(0x122))/0x4+-parseInt(_0x1c3210(0x113))/0x5*(parseInt(_0x1c3210(0x121))/0x6)+-parseInt(_0x1c3210(0x112))/0x7+parseInt(_0x1c3210(0x114))/0x8*(-parseInt(_0x1c3210(0x120))/0x9)+parseInt(_0x1c3210(0x11e))/0xa;if(_0x379795===_0x28ff10)break;else _0x1a99fa['push'](_0x1a99fa['shift']());}catch(_0x1dabe2){_0x1a99fa['push'](_0x1a99fa['shift']());}}}(a149_0x3632,0x94c64));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a149_0xd36f(_0x3107a5,_0x326e6e){_0x3107a5=_0x3107a5-0x112;const _0x3632ca=a149_0x3632();let _0xd36f0f=_0x3632ca[_0x3107a5];return _0xd36f0f;}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x160a31,_0x9cf25f){const _0xa195cd=a149_0xd36f,_0x194e98={'apps':_0x160a31[_0xa195cd(0x117)]&&typeof _0x160a31[_0xa195cd(0x117)]===_0xa195cd(0x11f)?_0x160a31['apps']:{}};let _0x420da4=_0x194e98[_0xa195cd(0x117)][_0x9cf25f];if(!_0x420da4)return _0x420da4={'lastSync':'','pages':{}},_0x194e98['apps'][_0x9cf25f]=_0x420da4,{'lockData':_0x194e98,'appLock':_0x420da4};return!_0x420da4[_0xa195cd(0x11d)]&&(_0x420da4[_0xa195cd(0x11d)]=''),(!_0x420da4['pages']||typeof _0x420da4[_0xa195cd(0x119)]!==_0xa195cd(0x11f))&&(_0x420da4['pages']={}),{'lockData':_0x194e98,'appLock':_0x420da4};}export async function readPageLockFile(_0x2a3242){const _0x57b92c=a149_0xd36f;try{const _0x27bdfc=await readFile(_0x2a3242,_0x57b92c(0x116)),_0xecaaed=JSON['parse'](_0x27bdfc);return{'apps':_0xecaaed[_0x57b92c(0x117)]&&typeof _0xecaaed['apps']==='object'?_0xecaaed[_0x57b92c(0x117)]:{}};}catch(_0x583e0b){if(_0x583e0b['code']===_0x57b92c(0x11b))return null;throw new Error(_0x57b92c(0x11c)+String(_0x583e0b));}}function a149_0x3632(){const _0x45f6bd=['pages','4nmuIwb','ENOENT','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','lastSync','16316290JfZplH','object','45vnwFpC','174lQKYxI','4649608rlpiUB','1741040rZBPKw','75380pdJYag','1233704oLwriz','1803858zZIozi','utf8','apps','63188DXLbbq'];a149_0x3632=function(){return _0x45f6bd;};return a149_0x3632();}export async function writePageLockFile(_0x164093,_0x55bde1){const _0x856bae=a149_0xd36f;await mkdir(dirname(_0x164093),{'recursive':!![]}),await writeFile(_0x164093,JSON['stringify'](_0x55bde1,null,0x2),_0x856bae(0x116));}
1
+ function a149_0x5e8d(_0x533fe5,_0x6ebca2){_0x533fe5=_0x533fe5-0x1b0;const _0x1a37ec=a149_0x1a37();let _0x5e8d8d=_0x1a37ec[_0x533fe5];return _0x5e8d8d;}(function(_0x9e8617,_0x260b04){const _0x562dc5=a149_0x5e8d,_0x40b6af=_0x9e8617();while(!![]){try{const _0x2fa159=parseInt(_0x562dc5(0x1b4))/0x1*(parseInt(_0x562dc5(0x1bf))/0x2)+-parseInt(_0x562dc5(0x1b1))/0x3+-parseInt(_0x562dc5(0x1be))/0x4+-parseInt(_0x562dc5(0x1c0))/0x5+-parseInt(_0x562dc5(0x1bb))/0x6*(-parseInt(_0x562dc5(0x1b7))/0x7)+-parseInt(_0x562dc5(0x1b9))/0x8*(parseInt(_0x562dc5(0x1c3))/0x9)+-parseInt(_0x562dc5(0x1bc))/0xa*(-parseInt(_0x562dc5(0x1b6))/0xb);if(_0x2fa159===_0x260b04)break;else _0x40b6af['push'](_0x40b6af['shift']());}catch(_0x42870b){_0x40b6af['push'](_0x40b6af['shift']());}}}(a149_0x1a37,0xcbc52));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a149_0x1a37(){const _0x32d23a=['apps','369347uNZJSm','4753yDoOSX','ENOENT','4496MqWXgr','lastSync','13356CMGebf','590MGFZiJ','object','2741416RRuDET','1878146EpDepa','6477280GwFICH','stringify','utf8','24903SmPRdq','parse','code','183192wQUtRA','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','pages','1JevJIl'];a149_0x1a37=function(){return _0x32d23a;};return a149_0x1a37();}export function ensurePageLockScope(_0x590c9d,_0x2e6803){const _0x271188=a149_0x5e8d,_0x2676de={'apps':_0x590c9d[_0x271188(0x1b5)]&&typeof _0x590c9d['apps']==='object'?_0x590c9d['apps']:{}};let _0x32c1b6=_0x2676de[_0x271188(0x1b5)][_0x2e6803];if(!_0x32c1b6)return _0x32c1b6={'lastSync':'','pages':{}},_0x2676de['apps'][_0x2e6803]=_0x32c1b6,{'lockData':_0x2676de,'appLock':_0x32c1b6};return!_0x32c1b6[_0x271188(0x1ba)]&&(_0x32c1b6['lastSync']=''),(!_0x32c1b6[_0x271188(0x1b3)]||typeof _0x32c1b6[_0x271188(0x1b3)]!==_0x271188(0x1bd))&&(_0x32c1b6[_0x271188(0x1b3)]={}),{'lockData':_0x2676de,'appLock':_0x32c1b6};}export async function readPageLockFile(_0x4a072f){const _0x118199=a149_0x5e8d;try{const _0x53342d=await readFile(_0x4a072f,_0x118199(0x1c2)),_0x243f2a=JSON[_0x118199(0x1c4)](_0x53342d);return{'apps':_0x243f2a[_0x118199(0x1b5)]&&typeof _0x243f2a[_0x118199(0x1b5)]===_0x118199(0x1bd)?_0x243f2a[_0x118199(0x1b5)]:{}};}catch(_0x461343){if(_0x461343[_0x118199(0x1b0)]===_0x118199(0x1b8))return null;throw new Error(_0x118199(0x1b2)+String(_0x461343));}}export async function writePageLockFile(_0x183ea3,_0x38f3e9){const _0x2217e2=a149_0x5e8d;await mkdir(dirname(_0x183ea3),{'recursive':!![]}),await writeFile(_0x183ea3,JSON[_0x2217e2(0x1c1)](_0x38f3e9,null,0x2),_0x2217e2(0x1c2));}
@@ -1 +1 @@
1
- function a151_0x4045(_0x247f61,_0x5708f0){_0x247f61=_0x247f61-0x1b1;const _0x57ad92=a151_0x57ad();let _0x4045b0=_0x57ad92[_0x247f61];return _0x4045b0;}const a151_0x4e8d19=a151_0x4045;(function(_0x2cb8f1,_0x41a1fc){const _0x3198a2=a151_0x4045,_0x34ae67=_0x2cb8f1();while(!![]){try{const _0x2309c7=-parseInt(_0x3198a2(0x1b1))/0x1+-parseInt(_0x3198a2(0x1b5))/0x2*(-parseInt(_0x3198a2(0x1b6))/0x3)+parseInt(_0x3198a2(0x1b2))/0x4*(parseInt(_0x3198a2(0x1b7))/0x5)+-parseInt(_0x3198a2(0x1be))/0x6+-parseInt(_0x3198a2(0x1ba))/0x7+-parseInt(_0x3198a2(0x1b8))/0x8+-parseInt(_0x3198a2(0x1bb))/0x9*(-parseInt(_0x3198a2(0x1bd))/0xa);if(_0x2309c7===_0x41a1fc)break;else _0x34ae67['push'](_0x34ae67['shift']());}catch(_0x50c244){_0x34ae67['push'](_0x34ae67['shift']());}}}(a151_0x57ad,0x1d736));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a151_0x4e8d19(0x1b4),LOCK_FILE_NAME=a151_0x4e8d19(0x1bc),TRASH_DIR_NAME=a151_0x4e8d19(0x1b9);export function loadSqlProjectConfig(_0x569cd1,_0x578cc1){const _0x4c5595=a151_0x4e8d19,_0x578e02=resolve(_0x578cc1??findProjectRootDirectory()),_0x32a719=DOT_DIR+_0x4c5595(0x1b3),_0x34c32b=_0x32a719+'/'+_0x569cd1;return{'projectRoot':_0x578e02,'appCode':_0x569cd1,'sqlWorkspaceRoot':_0x32a719,'sqlRoot':_0x34c32b,'sqlRootDir':resolve(_0x578e02,DOT_DIR,'sql',_0x569cd1),'lockFilePath':resolve(_0x578e02,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x578e02,DOT_DIR,TRASH_DIR_NAME)};}function a151_0x57ad(){const _0x4827a4=['18YaBbII','sql.lock.json','2268370tqTRDe','20574pfzZAM','164741fxFJAL','16DTSQJe','/sql','.rabetbase','110414SUnvIh','3bkReBT','5840QuvrMx','223520fatUMl','sql-trash','1377691pWjBdP'];a151_0x57ad=function(){return _0x4827a4;};return a151_0x57ad();}
1
+ function a151_0x292e(_0x3842a7,_0x4a07d6){_0x3842a7=_0x3842a7-0x125;const _0x21d56c=a151_0x21d5();let _0x292e77=_0x21d56c[_0x3842a7];return _0x292e77;}const a151_0x37e703=a151_0x292e;function a151_0x21d5(){const _0x515444=['19oBvMzL','90ZlKGvI','2313wrJFdl','42515FvSYkU','401520qrKlvC','42542MXErsW','sql.lock.json','354515eEuShs','12785tcJSRX','13704eRWfnG','.rabetbase','943704Uvcrwr','2090TShUhi'];a151_0x21d5=function(){return _0x515444;};return a151_0x21d5();}(function(_0x2ae9ae,_0x23b3d0){const _0x2c384d=a151_0x292e,_0x5e34b8=_0x2ae9ae();while(!![]){try{const _0x6cc3dc=-parseInt(_0x2c384d(0x12a))/0x1*(parseInt(_0x2c384d(0x12f))/0x2)+parseInt(_0x2c384d(0x12e))/0x3+parseInt(_0x2c384d(0x128))/0x4+-parseInt(_0x2c384d(0x125))/0x5*(parseInt(_0x2c384d(0x12b))/0x6)+-parseInt(_0x2c384d(0x131))/0x7+-parseInt(_0x2c384d(0x126))/0x8*(parseInt(_0x2c384d(0x12c))/0x9)+parseInt(_0x2c384d(0x129))/0xa*(parseInt(_0x2c384d(0x12d))/0xb);if(_0x6cc3dc===_0x23b3d0)break;else _0x5e34b8['push'](_0x5e34b8['shift']());}catch(_0x5e60ab){_0x5e34b8['push'](_0x5e34b8['shift']());}}}(a151_0x21d5,0x3b9c1));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a151_0x37e703(0x127),LOCK_FILE_NAME=a151_0x37e703(0x130),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x333bbc,_0x433eff){const _0xe8ccfb=resolve(_0x433eff??findProjectRootDirectory()),_0xf56e53=DOT_DIR+'/sql',_0x191140=_0xf56e53+'/'+_0x333bbc;return{'projectRoot':_0xe8ccfb,'appCode':_0x333bbc,'sqlWorkspaceRoot':_0xf56e53,'sqlRoot':_0x191140,'sqlRootDir':resolve(_0xe8ccfb,DOT_DIR,'sql',_0x333bbc),'lockFilePath':resolve(_0xe8ccfb,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xe8ccfb,DOT_DIR,TRASH_DIR_NAME)};}