@lovrabet/rabetbase-cli 2.0.6 → 2.0.8

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 (149) 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/logout.js +1 -1
  11. package/lib/cli-flags.js +1 -1
  12. package/lib/cli.js +1 -1
  13. package/lib/commands/api/doc.js +1 -1
  14. package/lib/commands/api/index.js +1 -1
  15. package/lib/commands/api/list.js +1 -1
  16. package/lib/commands/api/pull.js +1 -1
  17. package/lib/commands/api/shared.js +1 -1
  18. package/lib/commands/app/add.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/remote.js +1 -1
  22. package/lib/commands/app/remove.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app/use.js +1 -1
  25. package/lib/commands/auth/index.js +1 -1
  26. package/lib/commands/bff/delete.js +1 -1
  27. package/lib/commands/bff/detail.js +1 -1
  28. package/lib/commands/bff/index.js +1 -1
  29. package/lib/commands/bff/list.js +1 -1
  30. package/lib/commands/bff/new.js +1 -1
  31. package/lib/commands/bff/pull.js +1 -1
  32. package/lib/commands/bff/push.js +1 -1
  33. package/lib/commands/bff/status.js +1 -1
  34. package/lib/commands/cli-update.js +1 -1
  35. package/lib/commands/codegen/index.js +1 -1
  36. package/lib/commands/codegen/sdk.js +1 -1
  37. package/lib/commands/codegen/sql.js +1 -1
  38. package/lib/commands/common/app-selector.js +1 -1
  39. package/lib/commands/common/flags.js +1 -1
  40. package/lib/commands/common/validate.js +1 -1
  41. package/lib/commands/config/get.js +1 -1
  42. package/lib/commands/config/index.js +1 -1
  43. package/lib/commands/config/list.js +1 -1
  44. package/lib/commands/config/set.js +1 -1
  45. package/lib/commands/config/shared.js +1 -1
  46. package/lib/commands/dataset/detail.js +1 -1
  47. package/lib/commands/dataset/index.js +1 -1
  48. package/lib/commands/dataset/links.js +1 -1
  49. package/lib/commands/dataset/list.js +1 -1
  50. package/lib/commands/dataset/operations.js +1 -1
  51. package/lib/commands/doctor.js +1 -1
  52. package/lib/commands/init/index.js +1 -1
  53. package/lib/commands/logs/index.js +1 -1
  54. package/lib/commands/menu/index.js +1 -1
  55. package/lib/commands/menu/shared/compare-table.js +1 -1
  56. package/lib/commands/menu/shared/index.js +1 -1
  57. package/lib/commands/menu/shared/inquirer.js +1 -1
  58. package/lib/commands/menu/shared/local-pages.js +1 -1
  59. package/lib/commands/menu/shared/logic.js +1 -1
  60. package/lib/commands/menu/shared/service.js +1 -1
  61. package/lib/commands/menu/shared/sync-core.js +1 -1
  62. package/lib/commands/menu/shared/update-core.js +1 -1
  63. package/lib/commands/menu/shared/valid-url.js +1 -1
  64. package/lib/commands/menu/sync.js +1 -1
  65. package/lib/commands/menu/update.js +1 -1
  66. package/lib/commands/project/create/enhanced-guided-create.js +1 -0
  67. package/lib/commands/project/create/format-elapsed.js +1 -0
  68. package/lib/commands/project/create/main.js +1 -0
  69. package/lib/commands/project/create/non-interactive.js +1 -0
  70. package/lib/commands/project/create/project-template-path.js +1 -0
  71. package/lib/commands/project/create/use-copy-project-template.js +1 -0
  72. package/lib/commands/project/create/use-format-code.js +1 -0
  73. package/lib/commands/project/create/use-install-dependencies.js +1 -0
  74. package/lib/commands/project/index.js +1 -1
  75. package/lib/commands/project/init.js +1 -0
  76. package/lib/commands/project/upgrade.js +1 -0
  77. package/lib/commands/registry.js +1 -1
  78. package/lib/commands/run/index.js +1 -1
  79. package/lib/commands/schema.js +1 -0
  80. package/lib/commands/skill/index.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/sql/list.js +1 -1
  85. package/lib/commands/sql/save.js +1 -1
  86. package/lib/commands/sql/validate.js +1 -1
  87. package/lib/constant/cli.js +1 -1
  88. package/lib/constant/domain.js +1 -1
  89. package/lib/constant/env.js +1 -1
  90. package/lib/context.js +1 -1
  91. package/lib/core/alias-resolver.js +1 -1
  92. package/lib/core/api-client.js +1 -1
  93. package/lib/core/bff/config.js +1 -1
  94. package/lib/core/bff/file-system.js +1 -1
  95. package/lib/core/bff/hash.js +1 -1
  96. package/lib/core/bff/lock.js +1 -1
  97. package/lib/core/bff/utils.js +1 -1
  98. package/lib/core/db-resolver.js +1 -1
  99. package/lib/core/sql-validator.js +1 -1
  100. package/lib/errors.js +1 -1
  101. package/lib/framework/build-all-flags.js +1 -0
  102. package/lib/framework/flags.js +1 -1
  103. package/lib/framework/help.js +1 -1
  104. package/lib/framework/index.js +1 -1
  105. package/lib/framework/output.js +1 -1
  106. package/lib/framework/response.js +1 -1
  107. package/lib/framework/runner.js +1 -1
  108. package/lib/framework/schema-export.js +1 -0
  109. package/lib/framework/types.js +1 -1
  110. package/lib/generated/build-info.js +1 -1
  111. package/lib/help.js +1 -1
  112. package/lib/skills/main.js +1 -1
  113. package/lib/skills/npx-skills-add.js +1 -1
  114. package/lib/telemetry/cli-command-trace.js +1 -1
  115. package/lib/telemetry/cli-help-trace.js +1 -1
  116. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  117. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  118. package/lib/telemetry/send-cli-trace-log.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/apply-jq-filter.js +1 -0
  121. package/lib/utils/cdn-config.js +1 -1
  122. package/lib/utils/check-sdk-version.js +1 -1
  123. package/lib/utils/cli-version-check.js +1 -1
  124. package/lib/utils/config.js +1 -1
  125. package/lib/utils/copy-directory.js +1 -1
  126. package/lib/utils/file-utils.js +1 -1
  127. package/lib/utils/guides-cdn.js +1 -1
  128. package/lib/utils/http-client.js +1 -1
  129. package/lib/utils/is-non-interactive.js +1 -1
  130. package/lib/utils/logger.js +1 -1
  131. package/lib/utils/platform.js +1 -1
  132. package/lib/utils/rules-cdn.js +1 -1
  133. package/lib/utils/sleep.js +1 -1
  134. package/lib/utils/template-replacer.js +1 -1
  135. package/lib/utils/version.js +1 -1
  136. package/lib/utils/with-active-cookie.js +1 -1
  137. package/package.json +4 -2
  138. package/lib/commands/build.js +0 -1
  139. package/lib/commands/preview.js +0 -1
  140. package/lib/commands/project-upgrade.js +0 -1
  141. package/lib/commands/start.js +0 -1
  142. package/lib/create-app/enhanced-guided-create.js +0 -1
  143. package/lib/create-app/format-elapsed.js +0 -1
  144. package/lib/create-app/main.js +0 -1
  145. package/lib/create-app/non-interactive.js +0 -1
  146. package/lib/create-app/use-copy-project-template.js +0 -1
  147. package/lib/create-app/use-format-code.js +0 -1
  148. package/lib/create-app/use-install-dependencies.js +0 -1
  149. package/lib/init/main.js +0 -1
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a83_0x582c9f=a83_0x12dc;(function(_0x434ee9,_0x385b20){const _0x4ab4a6=a83_0x12dc,_0x45708d=_0x434ee9();while(!![]){try{const _0x2149f5=parseInt(_0x4ab4a6(0x1a8))/0x1+parseInt(_0x4ab4a6(0x199))/0x2+-parseInt(_0x4ab4a6(0x1a0))/0x3*(parseInt(_0x4ab4a6(0x1bb))/0x4)+-parseInt(_0x4ab4a6(0x1b1))/0x5*(parseInt(_0x4ab4a6(0x1b0))/0x6)+-parseInt(_0x4ab4a6(0x1cb))/0x7*(parseInt(_0x4ab4a6(0x1a6))/0x8)+parseInt(_0x4ab4a6(0x1a1))/0x9+parseInt(_0x4ab4a6(0x1d3))/0xa*(-parseInt(_0x4ab4a6(0x1af))/0xb);if(_0x2149f5===_0x385b20)break;else _0x45708d['push'](_0x45708d['shift']());}catch(_0x165113){_0x45708d['push'](_0x45708d['shift']());}}}(a83_0x424b,0x893d4));function a83_0x424b(){const _0x3ddb6d=['string','.lovrabet.json','riskLevel','read','348106qeEMLA','348hePBxk','21515TvOUWt','apps','join','maxRisk','filter','find','./src/api','.rabetbase.json','stringify','env','4myAlNp','apiDomain','ENV','utf8','./constant/env.js','apiDir','entries','api.ts','FORMAT','daily','.tmp','VERBOSE','./utils/is-non-interactive.js','cookie','cwd','format','1359687tsjVGh','-api.ts','runtimeDomain','app','object','parse','setRawCommand','MAX_RISK','110vEnPdj','project','locale','ACCESS_KEY','defaultApp','slice','keys','126740IFsCzg','setLogPath','accessKey','length','appcode','COOKIE','PAGE_SIZE','612405WocMxl','10083564TpupMG','trim','argv','./auth/get-cookie.js','pageSize','24SPVtgW','en-US','762904KtVSeE','write','production'];a83_0x424b=function(){return _0x3ddb6d;};return a83_0x424b();}import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}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';function a83_0x12dc(_0x42d831,_0x463932){_0x42d831=_0x42d831-0x198;const _0x424b9f=a83_0x424b();let _0x12dc82=_0x424b9f[_0x42d831];return _0x12dc82;}import{CLI_BIN_NAME}from'./constant/cli.js';import{isValidFormat}from'./framework/types.js';function env(_0x2e2343){return process.env[`RABETBASE_${_0x2e2343}`]||process.env[`LOVRABET_${_0x2e2343}`]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a83_0x582c9f(0x1b8),a83_0x582c9f(0x1ac),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a83_0x582c9f(0x1b5)](_0x262bf1=>_0x262bf1!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x5e74d0){for(const _0x2c4120 of CONFIG_NAMES){const _0x17c3e8=resolve(_0x5e74d0,_0x2c4120);if(existsSync(_0x17c3e8))return _0x17c3e8;}return undefined;}export async function createContext(_0x4c455b){const _0x182d2c=a83_0x582c9f,_0x7b021b=readRawConfig(),_0x56dc4c=buildConfig(_0x7b021b,_0x4c455b),{initEnv:_0x2ffb03}=await import(_0x182d2c(0x1bf));if(_0x56dc4c['env'])_0x2ffb03(_0x56dc4c[_0x182d2c(0x1ba)]);else _0x4c455b[_0x182d2c(0x1ba)]&&typeof _0x4c455b[_0x182d2c(0x1ba)]===_0x182d2c(0x1ab)&&_0x2ffb03(_0x4c455b['env']);const {initDomains:_0x5defbf,getUserDomain:_0x243768,getApiDomain:_0x18739b}=await import('./constant/domain.js');_0x5defbf({'apiDomain':_0x7b021b[_0x182d2c(0x1bc)]||undefined,'userDomain':_0x7b021b['userDomain']||undefined,'runtimeDomain':_0x7b021b[_0x182d2c(0x1cd)]||undefined});const _0x48e39f={'apiDomain':_0x18739b(),'userDomain':_0x243768()},_0x22c8eb=await buildAuth(_0x56dc4c);logger[_0x182d2c(0x19a)](process[_0x182d2c(0x1c9)]());const _0x10259a=(CLI_BIN_NAME+'\x20'+process[_0x182d2c(0x1a3)][_0x182d2c(0x1d8)](0x2)[_0x182d2c(0x1b3)]('\x20'))[_0x182d2c(0x1a2)]();logger[_0x182d2c(0x1d1)](_0x10259a);const {isNonInteractive:_0x5b8dbc}=await import(_0x182d2c(0x1c7)),_0xbb3edb=_0x5b8dbc(_0x4c455b);return{'config':_0x56dc4c,'auth':_0x22c8eb,'logger':logger,'env':_0x48e39f,'nonInteractive':_0xbb3edb};}export function buildConfigFromFlags(_0x2aac7c){return buildConfig(readRawConfig(),_0x2aac7c);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x130a44){const _0x476144=a83_0x582c9f;let _0x20850e={},_0x3e0f11={};try{const _0x31dee1=resolveConfigPath(homedir());if(_0x31dee1){const _0x1306fd=readFileSync(_0x31dee1,{'encoding':_0x476144(0x1be)});if(_0x1306fd)_0x20850e=JSON[_0x476144(0x1d0)](_0x1306fd);}}catch{}try{const _0x53bf5a=_0x130a44||process[_0x476144(0x1c9)](),_0xa61eca=resolveConfigPath(_0x53bf5a);if(_0xa61eca){const _0x3bf05=readFileSync(_0xa61eca,{'encoding':'utf8'});if(_0x3bf05)_0x3e0f11=JSON[_0x476144(0x1d0)](_0x3bf05);}}catch{}const _0xbd76c9=_0x20850e['apps']&&typeof _0x20850e['apps']===_0x476144(0x1cf)?_0x20850e[_0x476144(0x1b2)]:{},_0x32e366=_0x3e0f11[_0x476144(0x1b2)]&&typeof _0x3e0f11[_0x476144(0x1b2)]===_0x476144(0x1cf)?_0x3e0f11[_0x476144(0x1b2)]:{},_0x564b8d={..._0xbd76c9,..._0x32e366},_0x4f1e95={..._0x20850e,..._0x3e0f11};Object[_0x476144(0x198)](_0x564b8d)['length']>0x0&&(_0x4f1e95[_0x476144(0x1b2)]=_0x564b8d);if(_0x476144(0x1d7)in _0x3e0f11)_0x4f1e95[_0x476144(0x1d7)]=_0x3e0f11[_0x476144(0x1d7)];else{if(_0x32e366&&Object['keys'](_0x32e366)['length']>0x0)_0x4f1e95[_0x476144(0x1d7)]=Object[_0x476144(0x198)](_0x32e366)[0x0];else _0x20850e[_0x476144(0x1d7)]&&(_0x4f1e95[_0x476144(0x1d7)]=_0x20850e[_0x476144(0x1d7)]);}return _0x4f1e95;}export function readConfigFile(_0x248554){try{if(existsSync(_0x248554)){const _0xeb34aa=readFileSync(_0x248554,{'encoding':'utf8'});if(_0xeb34aa)return JSON['parse'](_0xeb34aa);}}catch{}return{};}export function writeConfigFile(_0x29a939,_0x71ac3){const _0x5963e7=a83_0x582c9f,_0x129ff5=dirname(_0x29a939);!existsSync(_0x129ff5)&&mkdirSync(_0x129ff5,{'recursive':!![]});const _0x190479=_0x29a939+_0x5963e7(0x1c5);try{writeFileSync(_0x190479,JSON[_0x5963e7(0x1b9)](_0x71ac3,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x190479,_0x29a939);}catch(_0x22eec0){try{unlinkSync(_0x190479);}catch{}throw _0x22eec0;}}export function resolveWriteConfigPath(_0x200ddb){const _0x56b423=a83_0x582c9f,_0x4dd664=_0x200ddb===_0x56b423(0x1d4)?process[_0x56b423(0x1c9)]():homedir(),_0x1c68dc=resolveConfigPath(_0x4dd664);return _0x1c68dc??resolve(_0x4dd664,NEW_CONFIG_NAME);}function buildConfig(_0x14e1dd,_0x2e221a){const _0x435e27=a83_0x582c9f,_0x5e19fd={};if(_0x14e1dd[_0x435e27(0x1b2)]&&typeof _0x14e1dd[_0x435e27(0x1b2)]===_0x435e27(0x1cf))for(const [_0x20601f,_0x3a6f7e]of Object[_0x435e27(0x1c1)](_0x14e1dd[_0x435e27(0x1b2)])){_0x3a6f7e&&typeof _0x3a6f7e===_0x435e27(0x1cf)&&_0x3a6f7e[_0x435e27(0x19d)]&&(_0x5e19fd[_0x20601f]=_0x3a6f7e);}const _0x546ae6=_0x14e1dd['defaultApp']||undefined,_0xd00142=Object[_0x435e27(0x198)](_0x5e19fd)[_0x435e27(0x19c)]>0x0,_0x4c161d=_0x2e221a[_0x435e27(0x1ce)]||env('APP')||undefined,_0x4baa9f=_0x4c161d||_0x546ae6||undefined,_0x2919ee=_0x2e221a[_0x435e27(0x19d)]||env('APPCODE')||undefined,_0xf80e1c=_0x2919ee?Object[_0x435e27(0x1c1)](_0x5e19fd)[_0x435e27(0x1b6)](([,_0x334410])=>_0x334410?.[_0x435e27(0x19d)]===_0x2919ee):undefined,_0xa692cd=_0xf80e1c?.[0x0],_0x1a640c=_0xf80e1c?.[0x1];let _0x550a69=_0x2919ee?_0xa692cd:_0x4baa9f,_0x48cf3d=_0x550a69&&_0x5e19fd[_0x550a69]?_0x5e19fd[_0x550a69]:undefined;_0x2919ee&&_0x1a640c&&(_0x48cf3d=_0x1a640c);const _0x144ca4=_0x2919ee?_0x1a640c??_0x48cf3d:_0x48cf3d,_0x2f685e=_0x4c161d||(_0x2919ee?_0xa692cd:undefined),_0x1a53e5=_0x2919ee||_0x144ca4?.[_0x435e27(0x19d)]||_0x14e1dd[_0x435e27(0x19d)]||_0x14e1dd[_0x435e27(0x1ce)]||undefined,_0x449397=_0x2e221a[_0x435e27(0x1ba)]||env(_0x435e27(0x1bd))||_0x144ca4?.[_0x435e27(0x1ba)]||_0x14e1dd['env']||_0x435e27(0x1aa),_0x5c5c9b=_0x144ca4?.[_0x435e27(0x1d5)]||_0x14e1dd[_0x435e27(0x1d5)]||_0x435e27(0x1a7),_0x5abd4d=env(_0x435e27(0x19e))||_0x144ca4?.[_0x435e27(0x1c8)]||_0x14e1dd[_0x435e27(0x1c8)]||undefined,_0x30b72a=env(_0x435e27(0x1d6))||_0x144ca4?.[_0x435e27(0x19b)]||_0x14e1dd['accessKey']||undefined,_0x444da6=_0x2e221a[_0x435e27(0x1ca)]||env(_0x435e27(0x1c3))||_0x144ca4?.[_0x435e27(0x1ca)]||_0x14e1dd['format'],_0x43dafb=isValidFormat(_0x444da6)?_0x444da6:undefined,_0x494a78=env(_0x435e27(0x19f))||_0x144ca4?.[_0x435e27(0x1a5)]||_0x14e1dd[_0x435e27(0x1a5)],_0x466feb=_0x494a78?Number(_0x494a78)||undefined:undefined,_0xf91f55=env('RISK_LEVEL')||env(_0x435e27(0x1d2))||_0x144ca4?.[_0x435e27(0x1ad)]||_0x14e1dd['riskLevel']||_0x14e1dd[_0x435e27(0x1b4)],_0x3e52ca=_0xf91f55===_0x435e27(0x1ae)||_0xf91f55===_0x435e27(0x1a9)?_0xf91f55:'high-risk-write',_0x3d6c8c=env(_0x435e27(0x1c6)),_0x4d40f9=_0x3d6c8c==='1'||_0x3d6c8c==='true',_0x1a1bad=_0x144ca4?.[_0x435e27(0x1c0)]||_0x14e1dd[_0x435e27(0x1c0)]||_0x435e27(0x1b7);return{'appCode':typeof _0x1a53e5===_0x435e27(0x1ab)&&_0x1a53e5[_0x435e27(0x1a2)]()?_0x1a53e5[_0x435e27(0x1a2)]():undefined,'env':_0x449397==='online'?_0x435e27(0x1aa):_0x449397===_0x435e27(0x1c4)?_0x435e27(0x1c4):_0x435e27(0x1aa),'locale':_0x5c5c9b,'cookie':_0x5abd4d,'accessKey':_0x30b72a,'format':_0x43dafb,'pageSize':_0x466feb,'riskLevel':_0x3e52ca,'verbose':_0x4d40f9,'apiDir':_0x1a1bad,'apps':_0x5e19fd,'defaultApp':_0x546ae6,'currentApp':_0xd00142?_0x550a69:undefined,'explicitAppName':_0x2f685e,'raw':_0x14e1dd};}async function buildAuth(_0x467953){const _0x3cc0d4=a83_0x582c9f,{getCookie:_0x5d201d}=await import(_0x3cc0d4(0x1a4)),_0xc69328=_0x467953[_0x3cc0d4(0x1c8)]||_0x5d201d(),_0x2beca4=_0xc69328?await getIsSessionValid():![];return{'cookie':_0xc69328,'isLoggedIn':_0x2beca4,async 'getOrLogin'(){if(_0xc69328&&_0x2beca4)return _0xc69328;throw CliErrors['authRequired']();}};}export function resolveApiFilePath(_0x2cbe20,_0x1d489d){const _0x289a68=a83_0x582c9f,_0xc7d3e0=resolve(process[_0x289a68(0x1c9)](),_0x2cbe20),_0x599cca=resolve(_0xc7d3e0,_0x289a68(0x1c2));if(!_0x1d489d)return _0x599cca;const _0x530844=readRawConfig(),_0x37abf2=_0x530844[_0x289a68(0x1b2)]&&typeof _0x530844[_0x289a68(0x1b2)]===_0x289a68(0x1cf)?_0x530844[_0x289a68(0x1b2)]:{},_0x389d25=Object['entries'](_0x37abf2)[_0x289a68(0x1b6)](([,_0x2d6d34])=>_0x2d6d34?.['appcode']===_0x1d489d);if(!_0x389d25)return _0x599cca;const [_0x3b7b0b,_0x1549ee]=_0x389d25,_0x575fdf=typeof _0x530844[_0x289a68(0x1d7)]==='string'?_0x530844[_0x289a68(0x1d7)]:undefined;if(_0x1549ee?.['apiDir'])return _0x599cca;if(_0x575fdf&&_0x3b7b0b!==_0x575fdf)return resolve(_0xc7d3e0,_0x3b7b0b+_0x289a68(0x1cc));return _0x599cca;}
1
+ const a90_0x481448=a90_0x5311;(function(_0x5f3fd2,_0x9d2259){const _0x5aa7a6=a90_0x5311,_0x56495d=_0x5f3fd2();while(!![]){try{const _0x4e7f82=-parseInt(_0x5aa7a6(0x1df))/0x1+parseInt(_0x5aa7a6(0x1f1))/0x2*(-parseInt(_0x5aa7a6(0x1f5))/0x3)+parseInt(_0x5aa7a6(0x1bf))/0x4+parseInt(_0x5aa7a6(0x1c6))/0x5+-parseInt(_0x5aa7a6(0x1d8))/0x6+parseInt(_0x5aa7a6(0x1e5))/0x7*(-parseInt(_0x5aa7a6(0x1d5))/0x8)+-parseInt(_0x5aa7a6(0x1fa))/0x9*(-parseInt(_0x5aa7a6(0x1c2))/0xa);if(_0x4e7f82===_0x9d2259)break;else _0x56495d['push'](_0x56495d['shift']());}catch(_0xe939e6){_0x56495d['push'](_0x56495d['shift']());}}}(a90_0x13be,0x51f8c));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}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{isValidFormat}from'./framework/types.js';function env(_0x2aba11){return process.env[`RABETBASE_${_0x2aba11}`]||process.env[`LOVRABET_${_0x2aba11}`]||undefined;}export const NEW_CONFIG_NAME=a90_0x481448(0x1e9);function a90_0x5311(_0x535a2f,_0x45169a){_0x535a2f=_0x535a2f-0x1b5;const _0x13be92=a90_0x13be();let _0x53114e=_0x13be92[_0x535a2f];return _0x53114e;}export const CONFIG_NAMES=[a90_0x481448(0x1e9),a90_0x481448(0x1b9),a90_0x481448(0x1fb)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x5668b1=>_0x5668b1!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x1e1819){for(const _0x12b890 of CONFIG_NAMES){const _0x5d42f4=resolve(_0x1e1819,_0x12b890);if(existsSync(_0x5d42f4))return _0x5d42f4;}return undefined;}export async function createContext(_0x1a380e){const _0x1fc247=a90_0x481448,_0x3a171a=readRawConfig(),_0x5d14aa=buildConfig(_0x3a171a,_0x1a380e),{initEnv:_0x274f38}=await import('./constant/env.js');if(_0x5d14aa[_0x1fc247(0x1f6)])_0x274f38(_0x5d14aa['env']);else _0x1a380e[_0x1fc247(0x1f6)]&&typeof _0x1a380e[_0x1fc247(0x1f6)]===_0x1fc247(0x1d7)&&_0x274f38(_0x1a380e[_0x1fc247(0x1f6)]);const {initDomains:_0x4d5b37,getUserDomain:_0x56d63c,getApiDomain:_0x3ab750}=await import(_0x1fc247(0x1e8));_0x4d5b37({'apiDomain':_0x3a171a[_0x1fc247(0x1c4)]||undefined,'userDomain':_0x3a171a[_0x1fc247(0x1fc)]||undefined,'runtimeDomain':_0x3a171a['runtimeDomain']||undefined});const _0x1f9280={'apiDomain':_0x3ab750(),'userDomain':_0x56d63c()},_0x4a5a02=await buildAuth(_0x5d14aa);logger[_0x1fc247(0x1c9)](process[_0x1fc247(0x1ee)]());const _0x490779=(CLI_BIN_NAME+'\x20'+process[_0x1fc247(0x1bb)][_0x1fc247(0x1b5)](0x2)[_0x1fc247(0x1d1)]('\x20'))[_0x1fc247(0x1bc)]();logger['setRawCommand'](_0x490779);const {isNonInteractive:_0x495772}=await import(_0x1fc247(0x1cc)),_0x3f2518=_0x495772(_0x1a380e);return{'config':_0x5d14aa,'auth':_0x4a5a02,'logger':logger,'env':_0x1f9280,'nonInteractive':_0x3f2518};}export function buildConfigFromFlags(_0x7bbb57){return buildConfig(readRawConfig(),_0x7bbb57);}export function getProjectConfigPath(){const _0x3c28ac=a90_0x481448;return resolveConfigPath(process[_0x3c28ac(0x1ee)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x36af11){const _0x1d72b3=a90_0x481448;if(!existsSync(_0x36af11))return{'status':_0x1d72b3(0x1d2)};try{const _0x55fe71=readFileSync(_0x36af11,{'encoding':'utf8'});if(!_0x55fe71?.[_0x1d72b3(0x1bc)]())return{'status':_0x1d72b3(0x1e2)};const _0x28be5d=JSON[_0x1d72b3(0x1d4)](_0x55fe71);return{'status':'ok','data':_0x28be5d};}catch(_0x4d4318){return{'status':'error','message':_0x4d4318 instanceof Error?_0x4d4318['message']:String(_0x4d4318)};}}function parseCliConfigJsonFile(_0x1392c6,_0x5be878,_0x2b8732){const _0x2f6220=a90_0x481448,_0x139b6b=inspectCliConfigJsonFile(_0x1392c6);if(_0x139b6b['status']===_0x2f6220(0x1d2)||_0x139b6b[_0x2f6220(0x1e4)]===_0x2f6220(0x1e2))return{};if(_0x139b6b[_0x2f6220(0x1e4)]==='ok')return _0x139b6b[_0x2f6220(0x1f4)];return _0x5be878===_0x2f6220(0x1f8)&&_0x2b8732&&console['error'](CLI_BIN_NAME+':\x20'+_0x2b8732+_0x2f6220(0x1d3)+_0x1392c6+'\x0a\x20\x20'+_0x139b6b['message']),{};}export function loadRawConfigLayers(_0x5ee249){const _0x381318=a90_0x481448;let _0x21a56a={},_0x37cb7f={};const _0x28f031=resolveConfigPath(homedir());_0x28f031&&(_0x21a56a=parseCliConfigJsonFile(_0x28f031,_0x381318(0x1f8),_0x381318(0x1cf)));const _0x533597=_0x5ee249||process['cwd'](),_0x334db4=resolveConfigPath(_0x533597);return _0x334db4&&(_0x37cb7f=parseCliConfigJsonFile(_0x334db4,'warn',_0x381318(0x1eb))),{'globalPath':_0x28f031,'projectPath':_0x334db4,'globalConfig':_0x21a56a,'projectConfig':_0x37cb7f};}function mergeRawConfigLayers(_0x32b5f0){const _0x1c418b=a90_0x481448,{globalConfig:_0x2df739,projectConfig:_0x4f6cc0}=_0x32b5f0,_0x240f5d=_0x2df739[_0x1c418b(0x1db)]&&typeof _0x2df739[_0x1c418b(0x1db)]===_0x1c418b(0x1ca)?_0x2df739[_0x1c418b(0x1db)]:{},_0x43f6e7=_0x4f6cc0[_0x1c418b(0x1db)]&&typeof _0x4f6cc0[_0x1c418b(0x1db)]===_0x1c418b(0x1ca)?_0x4f6cc0['apps']:{},_0x4d3c6e={..._0x240f5d,..._0x43f6e7},_0x102385={..._0x2df739,..._0x4f6cc0};Object[_0x1c418b(0x1e6)](_0x4d3c6e)[_0x1c418b(0x1de)]>0x0&&(_0x102385[_0x1c418b(0x1db)]=_0x4d3c6e);if('defaultApp'in _0x4f6cc0)_0x102385[_0x1c418b(0x1d9)]=_0x4f6cc0['defaultApp'];else{if(_0x43f6e7&&Object[_0x1c418b(0x1e6)](_0x43f6e7)[_0x1c418b(0x1de)]>0x0)_0x102385[_0x1c418b(0x1d9)]=Object[_0x1c418b(0x1e6)](_0x43f6e7)[0x0];else _0x2df739[_0x1c418b(0x1d9)]&&(_0x102385[_0x1c418b(0x1d9)]=_0x2df739['defaultApp']);}return _0x102385;}export function readRawConfigWithLayers(_0x1dcfda){const _0x5d83ab=loadRawConfigLayers(_0x1dcfda);return{'config':mergeRawConfigLayers(_0x5d83ab),'layers':_0x5d83ab};}export function readRawConfig(_0x127a29){return mergeRawConfigLayers(loadRawConfigLayers(_0x127a29));}export function readConfigFile(_0x5264a4){const _0x4eda91=a90_0x481448;return parseCliConfigJsonFile(_0x5264a4,_0x4eda91(0x1be));}export function writeConfigFile(_0xe851d5,_0x381d8b){const _0x2251e9=a90_0x481448,_0x2cb07b=dirname(_0xe851d5);!existsSync(_0x2cb07b)&&mkdirSync(_0x2cb07b,{'recursive':!![]});const _0x519026=_0xe851d5+_0x2251e9(0x1dd);try{writeFileSync(_0x519026,JSON[_0x2251e9(0x1e0)](_0x381d8b,null,0x2)+'\x0a',{'encoding':_0x2251e9(0x1bd),'mode':0x180}),renameSync(_0x519026,_0xe851d5);}catch(_0x17f272){try{unlinkSync(_0x519026);}catch{}throw _0x17f272;}}export function resolveWriteConfigPath(_0x5a82da){const _0x3c2cd0=a90_0x481448,_0x4a7f90=_0x5a82da===_0x3c2cd0(0x1c8)?process['cwd']():homedir(),_0x27224f=resolveConfigPath(_0x4a7f90);return _0x27224f??resolve(_0x4a7f90,NEW_CONFIG_NAME);}function buildConfig(_0x5e4649,_0x37175b){const _0xcf7bc8=a90_0x481448,_0xde6ca0={};if(_0x5e4649[_0xcf7bc8(0x1db)]&&typeof _0x5e4649[_0xcf7bc8(0x1db)]===_0xcf7bc8(0x1ca))for(const [_0x1113ef,_0x247e34]of Object['entries'](_0x5e4649[_0xcf7bc8(0x1db)])){_0x247e34&&typeof _0x247e34===_0xcf7bc8(0x1ca)&&_0x247e34[_0xcf7bc8(0x1ef)]&&(_0xde6ca0[_0x1113ef]=_0x247e34);}const _0x2d699d=_0x5e4649[_0xcf7bc8(0x1d9)]||undefined,_0x5452c7=Object[_0xcf7bc8(0x1e6)](_0xde6ca0)['length']>0x0,_0x267c5f=_0x37175b[_0xcf7bc8(0x1c3)]||env(_0xcf7bc8(0x1f9))||undefined,_0x416089=_0x267c5f||_0x2d699d||undefined,_0x33e5a2=_0x37175b[_0xcf7bc8(0x1ef)]||env(_0xcf7bc8(0x1cd))||undefined,_0xa44a65=_0x33e5a2?Object[_0xcf7bc8(0x1ce)](_0xde6ca0)[_0xcf7bc8(0x1c1)](([,_0x1c7784])=>_0x1c7784?.[_0xcf7bc8(0x1ef)]===_0x33e5a2):undefined,_0x2f5364=_0xa44a65?.[0x0],_0x586747=_0xa44a65?.[0x1];let _0x2ad898=_0x33e5a2?_0x2f5364:_0x416089,_0x228499=_0x2ad898&&_0xde6ca0[_0x2ad898]?_0xde6ca0[_0x2ad898]:undefined;_0x33e5a2&&_0x586747&&(_0x228499=_0x586747);const _0x3512c0=_0x33e5a2?_0x586747??_0x228499:_0x228499,_0xecad92=_0x267c5f||(_0x33e5a2?_0x2f5364:undefined),_0x5b8f16=_0x33e5a2||_0x3512c0?.['appcode']||_0x5e4649[_0xcf7bc8(0x1ef)]||_0x5e4649[_0xcf7bc8(0x1c3)]||undefined,_0x52f9b0=_0x37175b[_0xcf7bc8(0x1f6)]||env('ENV')||_0x3512c0?.[_0xcf7bc8(0x1f6)]||_0x5e4649[_0xcf7bc8(0x1f6)]||_0xcf7bc8(0x1ba),_0x24913d=_0x3512c0?.[_0xcf7bc8(0x1c0)]||_0x5e4649[_0xcf7bc8(0x1c0)]||_0xcf7bc8(0x1c7),_0x185885=env(_0xcf7bc8(0x1b8))||_0x3512c0?.['cookie']||_0x5e4649[_0xcf7bc8(0x1fe)]||undefined,_0x3dde43=env(_0xcf7bc8(0x1dc))||_0x3512c0?.[_0xcf7bc8(0x1c5)]||_0x5e4649['accessKey']||undefined,_0x3fc655=_0x37175b['format']||env('FORMAT')||_0x3512c0?.[_0xcf7bc8(0x1b7)]||_0x5e4649[_0xcf7bc8(0x1b7)],_0x5ffcc5=isValidFormat(_0x3fc655)?_0x3fc655:undefined,_0x392e46=env(_0xcf7bc8(0x1fd))||_0x3512c0?.[_0xcf7bc8(0x1ff)]||_0x5e4649[_0xcf7bc8(0x1ff)],_0x5863f8=_0x392e46?Number(_0x392e46)||undefined:undefined,_0x4b28a8=env(_0xcf7bc8(0x1f0))||env(_0xcf7bc8(0x1ed))||_0x3512c0?.[_0xcf7bc8(0x1b6)]||_0x5e4649['riskLevel']||_0x5e4649[_0xcf7bc8(0x1d6)],_0x3bbd53=_0x4b28a8==='read'||_0x4b28a8===_0xcf7bc8(0x1ea)?_0x4b28a8:_0xcf7bc8(0x1f7),_0x5f0c67=env(_0xcf7bc8(0x1cb)),_0x16c6a5=_0x5f0c67==='1'||_0x5f0c67===_0xcf7bc8(0x1e3),_0x59557d=_0x3512c0?.[_0xcf7bc8(0x1da)]||_0x5e4649['apiDir']||_0xcf7bc8(0x1f2);return{'appCode':typeof _0x5b8f16===_0xcf7bc8(0x1d7)&&_0x5b8f16['trim']()?_0x5b8f16[_0xcf7bc8(0x1bc)]():undefined,'env':_0x52f9b0===_0xcf7bc8(0x1e7)?'production':_0x52f9b0==='daily'?_0xcf7bc8(0x1e1):'production','locale':_0x24913d,'cookie':_0x185885,'accessKey':_0x3dde43,'format':_0x5ffcc5,'pageSize':_0x5863f8,'riskLevel':_0x3bbd53,'verbose':_0x16c6a5,'apiDir':_0x59557d,'apps':_0xde6ca0,'defaultApp':_0x2d699d,'currentApp':_0x5452c7?_0x2ad898:undefined,'explicitAppName':_0xecad92,'raw':_0x5e4649};}function a90_0x13be(){const _0x124d35=['7IxPeSO','keys','online','./constant/domain.js','.rabetbase.json','write','Project','api.ts','MAX_RISK','cwd','appcode','RISK_LEVEL','16slgCQh','./src/api','./auth/get-cookie.js','data','214926nAgUCC','env','high-risk-write','warn','APP','14661252EVokOH','.lovrabetrc','userDomain','PAGE_SIZE','cookie','pageSize','slice','riskLevel','format','COOKIE','.lovrabet.json','production','argv','trim','utf8','silent','204544dLVAGN','locale','find','10xMvcUu','app','apiDomain','accessKey','582140UgVmde','en-US','project','setLogPath','object','VERBOSE','./utils/is-non-interactive.js','APPCODE','entries','Global','authRequired','join','missing','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','parse','5010608WZVSLf','maxRisk','string','74544qbkvWP','defaultApp','apiDir','apps','ACCESS_KEY','.tmp','length','248950OiGKdc','stringify','daily','empty','true','status'];a90_0x13be=function(){return _0x124d35;};return a90_0x13be();}async function buildAuth(_0x36f69c){const _0x2be89b=a90_0x481448,{getCookie:_0x4b4e2e}=await import(_0x2be89b(0x1f3)),_0x143c26=_0x36f69c[_0x2be89b(0x1fe)]||_0x4b4e2e(),_0x165b35=_0x143c26?await getIsSessionValid():![];return{'cookie':_0x143c26,'isLoggedIn':_0x165b35,async 'getOrLogin'(){const _0x1a266f=_0x2be89b;if(_0x143c26&&_0x165b35)return _0x143c26;throw CliErrors[_0x1a266f(0x1d0)]();}};}export function resolveApiFilePath(_0x36ad96,_0x507d9a){const _0x253d61=a90_0x481448,_0x4d5dbc=resolve(process['cwd'](),_0x36ad96),_0x7b7e1e=resolve(_0x4d5dbc,_0x253d61(0x1ec));if(!_0x507d9a)return _0x7b7e1e;const _0x1e0dac=readRawConfig(),_0xc7858b=_0x1e0dac[_0x253d61(0x1db)]&&typeof _0x1e0dac['apps']===_0x253d61(0x1ca)?_0x1e0dac[_0x253d61(0x1db)]:{},_0x464195=Object[_0x253d61(0x1ce)](_0xc7858b)[_0x253d61(0x1c1)](([,_0x446f15])=>_0x446f15?.['appcode']===_0x507d9a);if(!_0x464195)return _0x7b7e1e;const [_0x185904,_0x2b5c17]=_0x464195,_0x345e9d=typeof _0x1e0dac[_0x253d61(0x1d9)]===_0x253d61(0x1d7)?_0x1e0dac[_0x253d61(0x1d9)]:undefined;if(_0x2b5c17?.[_0x253d61(0x1da)])return _0x7b7e1e;if(_0x345e9d&&_0x185904!==_0x345e9d)return resolve(_0x4d5dbc,_0x185904+'-api.ts');return _0x7b7e1e;}
@@ -1 +1 @@
1
- (function(_0x3d3445,_0x513122){const _0x31c683=a84_0x1377,_0x48aa0c=_0x3d3445();while(!![]){try{const _0xabe2ca=parseInt(_0x31c683(0x1ce))/0x1+-parseInt(_0x31c683(0x1c8))/0x2*(-parseInt(_0x31c683(0x1c5))/0x3)+parseInt(_0x31c683(0x1bf))/0x4*(parseInt(_0x31c683(0x1ca))/0x5)+parseInt(_0x31c683(0x1c4))/0x6*(parseInt(_0x31c683(0x1d1))/0x7)+parseInt(_0x31c683(0x1cb))/0x8+parseInt(_0x31c683(0x1c0))/0x9+-parseInt(_0x31c683(0x1d0))/0xa;if(_0xabe2ca===_0x513122)break;else _0x48aa0c['push'](_0x48aa0c['shift']());}catch(_0x1405e6){_0x48aa0c['push'](_0x48aa0c['shift']());}}}(a84_0x59e3,0xd868a));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a84_0x59e3(){const _0x463315=['cwd','524649jhZQeW','datasetCode','39786160xPeQgO','3164mtXkbi','295392ZQalGy','9059211KZzuMg','exec','alias','push','16014WsKxIj','744NtkKdG','api.ts','utf-8','9538dxlMZw','has','20azITdq','5194448vlrqHV','set'];a84_0x59e3=function(){return _0x463315;};return a84_0x59e3();}function a84_0x1377(_0xdd20ea,_0x271d97){_0xdd20ea=_0xdd20ea-0x1bf;const _0x59e3c0=a84_0x59e3();let _0x1377da=_0x59e3c0[_0xdd20ea];return _0x1377da;}function parseApiFile(_0x3d20ce){const _0x327c8d=a84_0x1377,_0x1dda18=[],_0x129c6f=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x5a96dc;while((_0x5a96dc=_0x129c6f[_0x327c8d(0x1c1)](_0x3d20ce))!==null){_0x1dda18[_0x327c8d(0x1c3)]({'datasetCode':_0x5a96dc[0x1],'tableName':_0x5a96dc[0x2],'name':_0x5a96dc[0x3],'alias':_0x5a96dc[0x4]});}return _0x1dda18;}export function loadAliasMap(_0x3b56b4,_0x3b6e95,_0x5a625e){const _0x3f12c8=a84_0x1377,_0x49ef4c=_0x5a625e??resolve(process[_0x3f12c8(0x1cd)](),_0x3b56b4,_0x3f12c8(0x1c6));if(cache[_0x3f12c8(0x1c9)](_0x49ef4c))return cache['get'](_0x49ef4c);if(!existsSync(_0x49ef4c))return cache[_0x3f12c8(0x1cc)](_0x49ef4c,[]),[];try{const _0x12389b=readFileSync(_0x49ef4c,_0x3f12c8(0x1c7)),_0x58c614=parseApiFile(_0x12389b);return cache[_0x3f12c8(0x1cc)](_0x49ef4c,_0x58c614),_0x58c614;}catch{return cache['set'](_0x49ef4c,[]),[];}}export function resolveAlias(_0x3fdd69,_0x43e111,_0x47282c,_0x2d794b){const _0x47dc87=a84_0x1377;if(!_0x43e111)return undefined;const _0xd56a2b=loadAliasMap(_0x3fdd69,_0x47282c,_0x2d794b),_0x5dc138=_0xd56a2b['find'](_0x1f5121=>_0x1f5121[_0x47dc87(0x1c2)]===_0x43e111);return _0x5dc138?.[_0x47dc87(0x1cf)];}export function listAliases(_0x594c63,_0x2048ed,_0xc9df87){return loadAliasMap(_0x594c63,_0x2048ed,_0xc9df87);}
1
+ (function(_0x189474,_0x31cea8){const _0x82dc6f=a91_0x41c4,_0x5ef58f=_0x189474();while(!![]){try{const _0xd7a4e5=parseInt(_0x82dc6f(0x118))/0x1*(-parseInt(_0x82dc6f(0x117))/0x2)+-parseInt(_0x82dc6f(0x112))/0x3+-parseInt(_0x82dc6f(0x10b))/0x4+-parseInt(_0x82dc6f(0x113))/0x5*(parseInt(_0x82dc6f(0x114))/0x6)+parseInt(_0x82dc6f(0x10e))/0x7*(-parseInt(_0x82dc6f(0x115))/0x8)+-parseInt(_0x82dc6f(0x10d))/0x9*(-parseInt(_0x82dc6f(0x119))/0xa)+parseInt(_0x82dc6f(0x11e))/0xb;if(_0xd7a4e5===_0x31cea8)break;else _0x5ef58f['push'](_0x5ef58f['shift']());}catch(_0x564387){_0x5ef58f['push'](_0x5ef58f['shift']());}}}(a91_0x5371,0x223de));function a91_0x5371(){const _0x5bb0bd=['17830uwgLMi','push','set','exec','utf-8','9291260wTdAtt','327200ApQHGe','has','63MivMru','50757wUJDVI','datasetCode','cwd','get','666333EkYOLA','5ZUnTKn','1018818mSVGdQ','32jPATXx','alias','158KScGPF','2711kiRlro'];a91_0x5371=function(){return _0x5bb0bd;};return a91_0x5371();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x1c558c){const _0x1f8bcb=a91_0x41c4,_0x640125=[],_0x25ee11=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x2806a4;while((_0x2806a4=_0x25ee11[_0x1f8bcb(0x11c)](_0x1c558c))!==null){_0x640125[_0x1f8bcb(0x11a)]({'datasetCode':_0x2806a4[0x1],'tableName':_0x2806a4[0x2],'name':_0x2806a4[0x3],'alias':_0x2806a4[0x4]});}return _0x640125;}function a91_0x41c4(_0x3845df,_0x29d879){_0x3845df=_0x3845df-0x10b;const _0x5371c9=a91_0x5371();let _0x41c4da=_0x5371c9[_0x3845df];return _0x41c4da;}export function loadAliasMap(_0x557bbe,_0x27a6b0,_0x34015a){const _0x40fe98=a91_0x41c4,_0x1001cb=_0x34015a??resolve(process[_0x40fe98(0x110)](),_0x557bbe,'api.ts');if(cache[_0x40fe98(0x10c)](_0x1001cb))return cache[_0x40fe98(0x111)](_0x1001cb);if(!existsSync(_0x1001cb))return cache[_0x40fe98(0x11b)](_0x1001cb,[]),[];try{const _0x2d062b=readFileSync(_0x1001cb,_0x40fe98(0x11d)),_0x113c6=parseApiFile(_0x2d062b);return cache[_0x40fe98(0x11b)](_0x1001cb,_0x113c6),_0x113c6;}catch{return cache[_0x40fe98(0x11b)](_0x1001cb,[]),[];}}export function resolveAlias(_0x518402,_0x5e09a6,_0x494974,_0x5fcf24){const _0x9a9eb8=a91_0x41c4;if(!_0x5e09a6)return undefined;const _0x436d6d=loadAliasMap(_0x518402,_0x494974,_0x5fcf24),_0xe6bfe6=_0x436d6d['find'](_0x930158=>_0x930158[_0x9a9eb8(0x116)]===_0x5e09a6);return _0xe6bfe6?.[_0x9a9eb8(0x10f)];}export function listAliases(_0x9183e1,_0x2a8981,_0x4bdb27){return loadAliasMap(_0x9183e1,_0x2a8981,_0x4bdb27);}
@@ -1 +1 @@
1
- (function(_0x4e7e9c,_0x16fe33){const _0x36a1a3=a85_0x92f9,_0x334e36=_0x4e7e9c();while(!![]){try{const _0x1583d2=parseInt(_0x36a1a3(0xd1))/0x1*(-parseInt(_0x36a1a3(0xfc))/0x2)+parseInt(_0x36a1a3(0xad))/0x3*(-parseInt(_0x36a1a3(0xf9))/0x4)+parseInt(_0x36a1a3(0xc4))/0x5+parseInt(_0x36a1a3(0x10e))/0x6*(parseInt(_0x36a1a3(0x98))/0x7)+-parseInt(_0x36a1a3(0xf5))/0x8*(-parseInt(_0x36a1a3(0xb8))/0x9)+parseInt(_0x36a1a3(0xa8))/0xa+parseInt(_0x36a1a3(0xea))/0xb;if(_0x1583d2===_0x16fe33)break;else _0x334e36['push'](_0x334e36['shift']());}catch(_0x1424ec){_0x334e36['push'](_0x334e36['shift']());}}}(a85_0x194b,0xf1fe7));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;function a85_0x92f9(_0x5091eb,_0x385241){_0x5091eb=_0x5091eb-0x94;const _0x194b97=a85_0x194b();let _0x92f9b1=_0x194b97[_0x5091eb];return _0x92f9b1;}export function setActiveCookie(_0x4a5cd5){_activeCookie=_0x4a5cd5||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}function a85_0x194b(){const _0x402f18=['AbortError','enabled','.remove(id);','description','BFF\x20script\x20not\x20found:\x20id=','message','update','API\x20error:\x20','});','\x20\x20currentPage:\x201,','/api/management/library/scripts/delete','success','sqlCode','7768240EKzdlx','test','push','sqlName','SQL\x20query\x20not\x20found:\x20','97410griaZn','modelId','apiError','cookie','scriptName','Unauthorized','body','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/dataset/get-dataset-list','error','Warning:\x20showing\x20first\x20','5176107wwSPzd','errorMsg','UNAUTHORIZED','code','/api/management/library/scripts/list?appCode=','/smartapi/dataset/get-dataset-operation','/smartapi/question/er-config','(/*\x20params\x20*/);','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','.create({\x20/*\x20fields\x20*/\x20});','abort','const\x20data\x20=\x20await\x20client.sql.execute({','643980lyMhth','/smartapi/dataset/get-driven-data?','totalCount','has','/api/node-toolbox/sql/save','dataset_','join','toLowerCase','authRequired','\x20apps.\x20','replace','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','167946qZVFuQ','/smartapi/app/getList','cli:rabetbase','displayName','tableName','target','filter','\x20\x20sqlCode:\x20\x27','isArray','operationName','errorMessage','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','includes','\x20of\x20','/api/management/library/scripts/statistics?appCode=','\x20failed,\x20HTTP\x20','const\x20result\x20=\x20await\x20client.models.','application/json','/api/management/library/scripts/info?id=','GET','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','operations','object','status','25362315xgUwdw','data','name','table','label','add','&type=','Operation\x20\x22','errorCode','includeImports','Request\x20timeout:\x20','8yPWdbn','dbtableConfig','API\x20error\x20code:\x20','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','124yZkyBG','delete','getOne','22JJEIYO','validation','map','\x20\x20});','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','.filter({','json','\x20\x20return\x20rows;','\x20\x20where:\x20{},','signal','401','functionName','/api/custom/executeSql','find','type','modelCode','Dataset\x20not\x20found:\x20','create','30kXSIeU','POST','\x20\x20pageSize:\x2020,','/api/management/library/scripts/save','method','82285LEjysq','stringify','sdk'];a85_0x194b=function(){return _0x402f18;};return a85_0x194b();}async function apiRequest(_0x26bfb9,_0x2cf9dd={}){const _0x36e1b0=a85_0x92f9,{method:method=_0x36e1b0(0xe5),body:_0x5157a3,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x2cf9dd,_0x23f578=useRuntime?getRuntimeDomain():getApiDomain(),_0x414daf=_activeCookie||getCookie(),_0x89a705=''+_0x23f578+_0x26bfb9,_0x540744=new AbortController(),_0x18beaa=setTimeout(()=>_0x540744[_0x36e1b0(0xc2)](),timeout);try{const _0x4efecb=await fetch(_0x89a705,{'method':method,'headers':{'Content-Type':_0x36e1b0(0xe3),'Cookie':_0x414daf,'X-Invoke-Source':_0x36e1b0(0xd3),...headers},'body':_0x5157a3?JSON[_0x36e1b0(0x99)](_0x5157a3):undefined,'signal':_0x540744[_0x36e1b0(0x105)]});let _0x559272;try{_0x559272=await _0x4efecb[_0x36e1b0(0x102)]();}catch{throw CliErrors[_0x36e1b0(0xaf)](_0x36e1b0(0xd0)+_0x4efecb[_0x36e1b0(0xe9)]+')',_0x4efecb['status']>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x4efecb['ok']||_0x559272['success']===![])throw CliErrors[_0x36e1b0(0xaf)](_0x559272[_0x36e1b0(0xb9)]||_0x559272[_0x36e1b0(0xa0)]||_0x36e1b0(0xa2)+_0x4efecb['status'],_0x559272[_0x36e1b0(0xf2)]?_0x36e1b0(0xf7)+_0x559272[_0x36e1b0(0xf2)]:undefined);return _0x559272;}catch(_0x229235){if(_0x229235 instanceof Error&&_0x229235[_0x36e1b0(0xec)]===_0x36e1b0(0x9b))throw CliErrors[_0x36e1b0(0xaf)](_0x36e1b0(0xf4)+_0x89a705);throw _0x229235;}finally{clearTimeout(_0x18beaa);}}function isAuthFailure(_0x238ae2){const _0x37189f=a85_0x92f9,_0x300ff4=_0x238ae2['errorMsg']||_0x238ae2[_0x37189f(0xa0)]||_0x238ae2['data']?.['message']||_0x238ae2[_0x37189f(0xdb)]||_0x238ae2[_0x37189f(0xb6)]||'';return _0x238ae2['errorCode']===_0x37189f(0xba)||_0x238ae2[_0x37189f(0xbb)]===0x191||_0x238ae2[_0x37189f(0xbb)]==='401'||_0x300ff4['includes'](_0x37189f(0x106))||_0x300ff4[_0x37189f(0xde)](_0x37189f(0xb2))||_0x300ff4['includes']('登录')||_0x300ff4[_0x37189f(0xde)]('认证');}export async function platformFetch(_0xebf02b,_0x16af78){const _0x18d48d=a85_0x92f9,_0x463c2c=await fetch(_0xebf02b,{'method':_0x16af78[_0x18d48d(0x97)]??_0x18d48d(0xe5),'headers':{'Content-Type':'application/json','Cookie':_0x16af78[_0x18d48d(0xb0)]},..._0x16af78[_0x18d48d(0xb3)]&&{'body':JSON[_0x18d48d(0x99)](_0x16af78['body'])}});if(!_0x463c2c['ok']){if(_0x463c2c[_0x18d48d(0xe9)]===0x191)throw CliErrors[_0x18d48d(0xcc)]();throw CliErrors[_0x18d48d(0xaf)](_0x16af78[_0x18d48d(0xee)]+_0x18d48d(0xe1)+_0x463c2c[_0x18d48d(0xe9)]);}const _0xe74f25=await _0x463c2c[_0x18d48d(0x102)]();if(_0xe74f25[_0x18d48d(0xa6)]===![]){if(isAuthFailure(_0xe74f25))throw CliErrors[_0x18d48d(0xcc)]();throw CliErrors[_0x18d48d(0xaf)](_0xe74f25['errorMsg']||_0xe74f25['message']||_0x16af78[_0x18d48d(0xee)]+'\x20failed');}return _0xe74f25[_0x18d48d(0xeb)];}export async function listBffScripts(_0x325c85,_0x309c4c,_0x4bfca9){const _0x37a9ee=a85_0x92f9;let _0x129575=_0x37a9ee(0xbc)+_0x325c85;if(_0x309c4c)_0x129575+=_0x37a9ee(0xf0)+_0x309c4c;const _0x6efee0=await apiRequest(_0x129575);let _0x8f12d7=extractList(_0x6efee0[_0x37a9ee(0xeb)]);if(_0x4bfca9?.[_0x37a9ee(0xb1)]){const _0x32c340=_0x4bfca9[_0x37a9ee(0xb1)]['toLowerCase']();_0x8f12d7=_0x8f12d7['filter'](_0x571977=>_0x571977[_0x37a9ee(0x107)]?.[_0x37a9ee(0xcb)]()['includes'](_0x32c340)||_0x571977[_0x37a9ee(0x9e)]?.[_0x37a9ee(0xcb)]()[_0x37a9ee(0xde)](_0x32c340));}return _0x8f12d7;}export async function getBffScriptInfo(_0x35ca57){const _0x2c14d3=a85_0x92f9,_0xf455dd=await apiRequest(_0x2c14d3(0xe4)+_0x35ca57);if(!_0xf455dd[_0x2c14d3(0xeb)])throw CliErrors['validation'](_0x2c14d3(0x9f)+_0x35ca57);return _0xf455dd[_0x2c14d3(0xeb)];}export async function saveBffScript(_0x27483a){const _0xe8780b=a85_0x92f9,_0x30e383=await apiRequest(_0xe8780b(0x96),{'method':'POST','body':_0x27483a});return _0x30e383['data'];}export async function deleteBffScript(_0x264e11){const _0x18747e=a85_0x92f9;await apiRequest(_0x18747e(0xa5),{'method':'POST','body':{'id':_0x264e11}});}export async function getBffScriptStatistics(_0x1caac7){const _0x265f8d=a85_0x92f9,_0x44f2d4=await apiRequest(_0x265f8d(0xe0)+_0x1caac7);return extractList(_0x44f2d4[_0x265f8d(0xeb)]);}export async function listBffDatasetOperations(_0x1e0df0,_0x5d148d){const _0x330bc4=a85_0x92f9,_0x5b1b6f=await apiRequest(_0x330bc4(0xbd),{'method':_0x330bc4(0x94),'body':{'appCode':_0x1e0df0,'datasetId':_0x5d148d}});return _0x5b1b6f[_0x330bc4(0xeb)];}export async function listSqlQueries(_0x4760d0,_0x532ee6){const _0x229b81=a85_0x92f9,_0x3b6261=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x229b81(0x94),'body':{'appCode':_0x4760d0,'currentPage':_0x532ee6?.['currentPage']??0x1,'pageSize':_0x532ee6?.['pageSize']??0x32,'sqlCode':_0x532ee6?.[_0x229b81(0xa7)],'sqlName':_0x532ee6?.['sqlName']}});return _0x3b6261[_0x229b81(0xeb)];}export async function getSqlQueryInfo(_0x9c603a,_0x3e98ef){const _0x2afe71=a85_0x92f9,_0x258036=await listSqlQueries(_0x9c603a,{'sqlCode':_0x3e98ef}),_0x2acf02=_0x258036['tableData']?.[0x0];if(!_0x2acf02)throw CliErrors['validation'](_0x2afe71(0xac)+_0x3e98ef);return _0x2acf02;}export async function saveSqlQuery(_0x198efd){const _0x4c394e=a85_0x92f9,_0x3342af=await apiRequest(_0x4c394e(0xc8),{'method':_0x4c394e(0x94),'body':_0x198efd});return _0x3342af[_0x4c394e(0xeb)];}export async function executeSql(_0x5d5e3b,_0x26e962,_0x9c3d54){const _0xfc2ee9=a85_0x92f9,_0x8a55eb=await apiRequest(_0xfc2ee9(0x108),{'method':_0xfc2ee9(0x94),'body':{'appCode':_0x5d5e3b,'sqlCode':_0x26e962,..._0x9c3d54&&{'params':_0x9c3d54}},'useRuntime':!![]});return _0x8a55eb['data'];}export async function listDatasets(_0x4c6868,_0x5c3806){const _0xd87b83=a85_0x92f9,_0x3e1692={'appCode':_0x4c6868,'deleted':![]};if(_0x5c3806?.['code'])_0x3e1692[_0xd87b83(0xbb)]=_0x5c3806['code'];if(_0x5c3806?.[_0xd87b83(0xec)])_0x3e1692[_0xd87b83(0xec)]=_0x5c3806[_0xd87b83(0xec)];const _0x483bfb=await apiRequest(_0xd87b83(0xb5),{'method':_0xd87b83(0x94),'body':_0x3e1692});return extractList(_0x483bfb['data']);}export async function searchDatasets(_0x5e43d8,_0x4ad999){const _0x183b6e=a85_0x92f9,_0x36cf24=await listDatasets(_0x5e43d8,{'name':_0x4ad999}),_0x182587=_0x4ad999['toLowerCase'](),_0x18a4e4=new Set(_0x36cf24['map'](_0x50b19f=>_0x50b19f['id'])),_0x1fd51e=_0x36cf24[_0x183b6e(0xd7)](_0x13528d=>_0x13528d[_0x183b6e(0xf6)]?.[_0x183b6e(0xd5)]?.[_0x183b6e(0xcb)]()[_0x183b6e(0xde)](_0x182587)||_0x13528d[_0x183b6e(0x9e)]?.[_0x183b6e(0xcb)]()[_0x183b6e(0xde)](_0x182587)),_0x144a26=await listDatasets(_0x5e43d8,{'code':_0x4ad999});for(const _0x1df799 of _0x144a26){!_0x18a4e4[_0x183b6e(0xc7)](_0x1df799['id'])&&(_0x36cf24['push'](_0x1df799),_0x18a4e4[_0x183b6e(0xef)](_0x1df799['id']));}return _0x36cf24;}export function normalizeDatasetOperations(_0x471ed1){const _0x247564=a85_0x92f9;if(Array[_0x247564(0xd9)](_0x471ed1))return _0x471ed1['filter'](_0x4fc56d=>_0x4fc56d!=null&&typeof _0x4fc56d==='object');if(_0x471ed1&&typeof _0x471ed1===_0x247564(0xe8))return Object['entries'](_0x471ed1)[_0x247564(0xd7)](([,_0x543f4b])=>_0x543f4b!=null&&typeof _0x543f4b===_0x247564(0xe8))[_0x247564(0xfe)](([_0x3cf2a2,_0x265af3])=>({..._0x265af3,'name':_0x265af3[_0x247564(0xec)]??_0x265af3[_0x247564(0xda)]??_0x3cf2a2}));return[];}export async function getDatasetDetail(_0xf9cfab){const _0x27b452=a85_0x92f9,_0x3ced68=/^\d+$/[_0x27b452(0xa9)](_0xf9cfab)?'id':_0x27b452(0xbb),_0x59156a=await apiRequest(_0x27b452(0xc5)+_0x3ced68+'='+_0xf9cfab);return _0x59156a[_0x27b452(0xeb)];}export async function getDatasetOperations(_0x3d3462){const _0x3c0505=a85_0x92f9,_0x31f126=await getDatasetDetail(_0x3d3462),_0x4bab8=normalizeDatasetOperations(_0x31f126['operations'])[_0x3c0505(0xfe)](_0x12b0b7=>({'name':_0x12b0b7[_0x3c0505(0xec)]||_0x12b0b7[_0x3c0505(0xda)],'displayName':_0x12b0b7[_0x3c0505(0xd4)]||_0x12b0b7[_0x3c0505(0xec)],'type':_0x12b0b7[_0x3c0505(0x10a)],'method':_0x12b0b7[_0x3c0505(0x97)],'path':_0x12b0b7['path'],'enabled':_0x12b0b7[_0x3c0505(0x9c)]??!![],'requestFields':_0x12b0b7['requestFields'],'responseFields':_0x12b0b7['responseFields']}));return{'dataset':{'id':_0x31f126['id']??_0x31f126[_0x3c0505(0xae)],'name':_0x31f126[_0x3c0505(0xec)],'code':_0x31f126[_0x3c0505(0xbb)]||_0x31f126[_0x3c0505(0x10b)],'tableName':_0x31f126[_0x3c0505(0xd5)]||_0x31f126['dbtableConfig']?.[_0x3c0505(0xd5)]},'operations':_0x4bab8};}export async function getOperationDetail(_0x47fe53,_0x2b0903,_0x51e19f){const _0xbd08f7=a85_0x92f9;let _0x30a636=_0x2b0903;if(!/^\d+$/[_0xbd08f7(0xa9)](_0x2b0903)){const _0x475fdf=await listDatasets(_0x47fe53,{'code':_0x2b0903}),_0x498824=_0x475fdf[_0xbd08f7(0x109)](_0x58b4a7=>_0x58b4a7['code']===_0x2b0903||String(_0x58b4a7['id'])===_0x2b0903);if(!_0x498824)throw CliErrors[_0xbd08f7(0xfd)](_0xbd08f7(0x10c)+_0x2b0903);_0x30a636=String(_0x498824['id']);}const _0x324325=await getDatasetDetail(_0x30a636),_0x50a45b=normalizeDatasetOperations(_0x324325[_0xbd08f7(0xe7)])[_0xbd08f7(0x109)](_0x189154=>(_0x189154[_0xbd08f7(0xec)]||_0x189154[_0xbd08f7(0xda)])===_0x51e19f);if(!_0x50a45b)throw CliErrors[_0xbd08f7(0xfd)](_0xbd08f7(0xf1)+_0x51e19f+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x2b0903);return{'dataset':{'id':_0x324325['id']??_0x324325[_0xbd08f7(0xae)],'name':_0x324325[_0xbd08f7(0xec)],'code':_0x324325['code']||_0x324325[_0xbd08f7(0x10b)],'tableName':_0x324325['tableName']||_0x324325[_0xbd08f7(0xf6)]?.[_0xbd08f7(0xd5)]},'operation':_0x50a45b};}export function generateSdkCode(_0x1ad361,_0x564a66,_0x372e11){const _0x172d60=a85_0x92f9,_0x201c36=_0x372e11?.[_0x172d60(0xf3)]??!![],_0x535d1f=_0x172d60(0xc9)+_0x1ad361[_0x172d60(0xbb)]?.[_0x172d60(0xce)](/-/g,'_'),_0x179617=_0x564a66[_0x172d60(0xec)]||_0x564a66[_0x172d60(0xda)]||'filter',_0x1ba992=[];_0x201c36&&_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xdc),'',_0x172d60(0xb4),'');_0x1ba992[_0x172d60(0xaa)]('//\x20'+_0x1ad361[_0x172d60(0xec)]+'\x20('+(_0x1ad361['tableName']||_0x172d60(0xed))+')');if(_0x179617===_0x172d60(0xd7))_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xe2)+_0x535d1f+_0x172d60(0x101),_0x172d60(0x104),_0x172d60(0x95),_0x172d60(0xa4),_0x172d60(0xa3));else{if(_0x179617===_0x172d60(0xfb))_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xe2)+_0x535d1f+'.getOne(id);');else{if(_0x179617===_0x172d60(0x10d))_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xe2)+_0x535d1f+_0x172d60(0xc1));else{if(_0x179617===_0x172d60(0xa1))_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xe2)+_0x535d1f+_0x172d60(0xdd));else _0x179617===_0x172d60(0xfa)||_0x179617==='remove'?_0x1ba992[_0x172d60(0xaa)](_0x172d60(0xe2)+_0x535d1f+_0x172d60(0x9d)):_0x1ba992['push'](_0x172d60(0xe2)+_0x535d1f+'.'+_0x179617+_0x172d60(0xbf));}}}return _0x1ba992[_0x172d60(0xca)]('\x0a');}export function generateSqlCodeTemplate(_0x30f26d,_0x386098){const _0x1b86a4=a85_0x92f9,_0x41e7ed=_0x386098?.[_0x1b86a4(0xd6)]??_0x1b86a4(0x9a),_0x4516db=_0x386098?.[_0x1b86a4(0xf3)]??!![],_0x2aac52=[];return _0x2aac52[_0x1b86a4(0xaa)]('//\x20SQL:\x20'+_0x30f26d[_0x1b86a4(0xab)]+'\x20('+_0x30f26d['sqlCode']+')'),_0x41e7ed===_0x1b86a4(0x9a)?(_0x4516db&&_0x2aac52['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1b86a4(0xb4),''),_0x2aac52[_0x1b86a4(0xaa)](_0x1b86a4(0xc3),_0x1b86a4(0xd8)+_0x30f26d[_0x1b86a4(0xa7)]+'\x27,',_0x1b86a4(0xe6),_0x1b86a4(0xa3),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x2aac52[_0x1b86a4(0xaa)](_0x1b86a4(0x100),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x1b86a4(0xf8),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x30f26d[_0x1b86a4(0xa7)]+'\x27,',_0x1b86a4(0xcf),_0x1b86a4(0xff),_0x1b86a4(0x103),'}'),_0x2aac52['join']('\x0a');}export async function getErConfig(_0x49201b,_0x452498){const _0x4f740c=a85_0x92f9,_0x557a5b=await apiRequest(_0x4f740c(0xbe),{'method':'POST','body':{'appCode':_0x49201b,'dblinkId':_0x452498}});return _0x557a5b['data'];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1bdefa=a85_0x92f9,_0x54c2fd=await apiRequest(_0x1bdefa(0xd2),{'method':_0x1bdefa(0x94),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x404633=extractList(_0x54c2fd[_0x1bdefa(0xeb)]),_0x234496=extractPaging(_0x54c2fd[_0x1bdefa(0xeb)]);return _0x234496&&_0x234496[_0x1bdefa(0xc6)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x1bdefa(0xb7)+REMOTE_APP_PAGE_SIZE+_0x1bdefa(0xdf)+_0x234496[_0x1bdefa(0xc6)]+_0x1bdefa(0xcd)+_0x1bdefa(0xc0)),_0x404633;}
1
+ (function(_0x23d57a,_0x7fa2){const _0x12103b=a92_0x28d6,_0x585139=_0x23d57a();while(!![]){try{const _0x43c965=-parseInt(_0x12103b(0x1bc))/0x1+parseInt(_0x12103b(0x1e8))/0x2+-parseInt(_0x12103b(0x191))/0x3+-parseInt(_0x12103b(0x1c5))/0x4*(-parseInt(_0x12103b(0x199))/0x5)+-parseInt(_0x12103b(0x1e1))/0x6*(parseInt(_0x12103b(0x1ee))/0x7)+-parseInt(_0x12103b(0x189))/0x8*(parseInt(_0x12103b(0x1c2))/0x9)+parseInt(_0x12103b(0x1de))/0xa;if(_0x43c965===_0x7fa2)break;else _0x585139['push'](_0x585139['shift']());}catch(_0x27b0a7){_0x585139['push'](_0x585139['shift']());}}}(a92_0x1aa3,0x97235));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x488334){_activeCookie=_0x488334||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}function a92_0x1aa3(){const _0x2a9640=['isArray','scriptName','filter','\x20\x20\x20\x20sqlCode:\x20\x27','//\x20SQL:\x20','1304274CNufpb','authRequired','validation','.create({\x20/*\x20fields\x20*/\x20});','operations','\x20\x20where:\x20{},','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','type','11705ExIlqx','//\x20','.filter({','401','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','includeImports','find','name','\x20of\x20','has','UNAUTHORIZED','GET','\x20\x20sqlCode:\x20\x27','message','Unauthorized','toLowerCase','apiError','dataset_','label','operationName','dbtableConfig','pageSize','add','const\x20result\x20=\x20await\x20client.models.','join','\x22\x20not\x20found\x20in\x20dataset\x20','sqlName','data','\x20\x20return\x20rows;','code','Request\x20timeout:\x20','path','json','tableData','});','1004043lxSMRn','remove','/api/management/library/scripts/statistics?appCode=','object','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/api/management/library/scripts/delete','302031tZnQrO','table','method','808pFwdJt','test','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','AbortError','sqlCode','entries','/smartapi/dataset/get-dataset-operation','const\x20results\x20=\x20data.execResult\x20||\x20[];','SQL\x20query\x20not\x20found:\x20','Warning:\x20showing\x20first\x20','&type=','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','functionName','POST','currentPage','includes','enabled','/smartapi/question/er-config','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','warn','modelId','cli:rabetbase','.remove(id);','const\x20data\x20=\x20await\x20client.sql.execute({','\x20\x20});','28531390ikAALG','Operation\x20\x22','errorCode','7016004hfdXSB','description','map','stringify','totalCount','create','body','742002IAblqk','push','API\x20error:\x20','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-list','target','7BipyfA','Dataset\x20not\x20found:\x20','/smartapi/dataset/get-driven-data?','update','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','tableName','errorMsg','cookie','/smartapi/app/getList','responseFields','/api/custom/executeSql','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/api/management/library/scripts/list?appCode=','(/*\x20params\x20*/);','sdk','success','112WzaQUX','application/json','status'];a92_0x1aa3=function(){return _0x2a9640;};return a92_0x1aa3();}async function apiRequest(_0x51091d,_0x496a1f={}){const _0x3c1e28=a92_0x28d6,{method:method=_0x3c1e28(0x1a4),body:_0x5d4184,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x496a1f,_0x4a30d4=useRuntime?getRuntimeDomain():getApiDomain(),_0x12b540=_activeCookie||getCookie(),_0x31b478=''+_0x4a30d4+_0x51091d,_0xbab28d=new AbortController(),_0x181470=setTimeout(()=>_0xbab28d['abort'](),timeout);try{const _0x307cf7=await fetch(_0x31b478,{'method':method,'headers':{'Content-Type':_0x3c1e28(0x18a),'Cookie':_0x12b540,'X-Invoke-Source':_0x3c1e28(0x1da),...headers},'body':_0x5d4184?JSON[_0x3c1e28(0x1e4)](_0x5d4184):undefined,'signal':_0xbab28d['signal']});let _0x15f21c;try{_0x15f21c=await _0x307cf7[_0x3c1e28(0x1b9)]();}catch{throw CliErrors[_0x3c1e28(0x1a9)](_0x3c1e28(0x1d7)+_0x307cf7[_0x3c1e28(0x18b)]+')',_0x307cf7[_0x3c1e28(0x18b)]>=0x190?_0x3c1e28(0x1c7):undefined);}if(!_0x307cf7['ok']||_0x15f21c[_0x3c1e28(0x188)]===![])throw CliErrors[_0x3c1e28(0x1a9)](_0x15f21c[_0x3c1e28(0x1f4)]||_0x15f21c[_0x3c1e28(0x1a6)]||_0x3c1e28(0x1ea)+_0x307cf7['status'],_0x15f21c[_0x3c1e28(0x1e0)]?'API\x20error\x20code:\x20'+_0x15f21c[_0x3c1e28(0x1e0)]:undefined);return _0x15f21c;}catch(_0x131a2f){if(_0x131a2f instanceof Error&&_0x131a2f[_0x3c1e28(0x1a0)]===_0x3c1e28(0x1c8))throw CliErrors[_0x3c1e28(0x1a9)](_0x3c1e28(0x1b7)+_0x31b478);throw _0x131a2f;}finally{clearTimeout(_0x181470);}}function isAuthFailure(_0x1e74fa){const _0x8a10fb=a92_0x28d6,_0x335022=_0x1e74fa[_0x8a10fb(0x1f4)]||_0x1e74fa[_0x8a10fb(0x1a6)]||_0x1e74fa[_0x8a10fb(0x1b4)]?.[_0x8a10fb(0x1a6)]||_0x1e74fa['errorMessage']||_0x1e74fa['error']||'';return _0x1e74fa[_0x8a10fb(0x1e0)]===_0x8a10fb(0x1a3)||_0x1e74fa[_0x8a10fb(0x1b6)]===0x191||_0x1e74fa[_0x8a10fb(0x1b6)]===_0x8a10fb(0x19c)||_0x335022['includes'](_0x8a10fb(0x19c))||_0x335022[_0x8a10fb(0x1d4)](_0x8a10fb(0x1a7))||_0x335022[_0x8a10fb(0x1d4)]('登录')||_0x335022[_0x8a10fb(0x1d4)]('认证');}export async function platformFetch(_0x2e9737,_0x4b3657){const _0x3f4255=a92_0x28d6,_0x1f634e=await fetch(_0x2e9737,{'method':_0x4b3657[_0x3f4255(0x1c4)]??'GET','headers':{'Content-Type':_0x3f4255(0x18a),'Cookie':_0x4b3657[_0x3f4255(0x1f5)]},..._0x4b3657[_0x3f4255(0x1e7)]&&{'body':JSON[_0x3f4255(0x1e4)](_0x4b3657[_0x3f4255(0x1e7)])}});if(!_0x1f634e['ok']){if(_0x1f634e[_0x3f4255(0x18b)]===0x191)throw CliErrors[_0x3f4255(0x192)]();throw CliErrors[_0x3f4255(0x1a9)](_0x4b3657['label']+'\x20failed,\x20HTTP\x20'+_0x1f634e[_0x3f4255(0x18b)]);}const _0x25906b=await _0x1f634e[_0x3f4255(0x1b9)]();if(_0x25906b[_0x3f4255(0x188)]===![]){if(isAuthFailure(_0x25906b))throw CliErrors[_0x3f4255(0x192)]();throw CliErrors[_0x3f4255(0x1a9)](_0x25906b['errorMsg']||_0x25906b[_0x3f4255(0x1a6)]||_0x4b3657[_0x3f4255(0x1ab)]+'\x20failed');}return _0x25906b[_0x3f4255(0x1b4)];}function a92_0x28d6(_0xc45fb0,_0x4cc6f5){_0xc45fb0=_0xc45fb0-0x185;const _0x1aa390=a92_0x1aa3();let _0x28d6f9=_0x1aa390[_0xc45fb0];return _0x28d6f9;}export async function listBffScripts(_0x435283,_0x4afa7a,_0xa13f4f){const _0x1a2f5b=a92_0x28d6;let _0x594e1a=_0x1a2f5b(0x185)+_0x435283;if(_0x4afa7a)_0x594e1a+=_0x1a2f5b(0x1cf)+_0x4afa7a;const _0x1947b6=await apiRequest(_0x594e1a);let _0x44a045=extractList(_0x1947b6[_0x1a2f5b(0x1b4)]);if(_0xa13f4f?.[_0x1a2f5b(0x18d)]){const _0x51ef67=_0xa13f4f[_0x1a2f5b(0x18d)][_0x1a2f5b(0x1a8)]();_0x44a045=_0x44a045['filter'](_0x1c8d17=>_0x1c8d17[_0x1a2f5b(0x1d1)]?.[_0x1a2f5b(0x1a8)]()[_0x1a2f5b(0x1d4)](_0x51ef67)||_0x1c8d17['description']?.[_0x1a2f5b(0x1a8)]()[_0x1a2f5b(0x1d4)](_0x51ef67));}return _0x44a045;}export async function getBffScriptInfo(_0x2740d6){const _0x519e3d=a92_0x28d6,_0x60268c=await apiRequest('/api/management/library/scripts/info?id='+_0x2740d6);if(!_0x60268c[_0x519e3d(0x1b4)])throw CliErrors[_0x519e3d(0x193)]('BFF\x20script\x20not\x20found:\x20id='+_0x2740d6);return _0x60268c['data'];}export async function saveBffScript(_0x1c9d2d){const _0x9f312b=a92_0x28d6,_0x4508ab=await apiRequest('/api/management/library/scripts/save',{'method':_0x9f312b(0x1d2),'body':_0x1c9d2d});return _0x4508ab[_0x9f312b(0x1b4)];}export async function deleteBffScript(_0x50a619){const _0x59dfb4=a92_0x28d6;await apiRequest(_0x59dfb4(0x1c1),{'method':'POST','body':{'id':_0x50a619}});}export async function getBffScriptStatistics(_0x13ac03){const _0x324d11=a92_0x28d6,_0x49925c=await apiRequest(_0x324d11(0x1be)+_0x13ac03);return extractList(_0x49925c['data']);}export async function listBffDatasetOperations(_0x146e9f,_0x391d85){const _0x32d3a0=a92_0x28d6,_0x45a02e=await apiRequest(_0x32d3a0(0x1cb),{'method':_0x32d3a0(0x1d2),'body':{'appCode':_0x146e9f,'datasetId':_0x391d85}});return _0x45a02e['data'];}export async function listSqlQueries(_0x2695ec,_0x5134e7){const _0x2ce735=a92_0x28d6,_0x45c51e=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x2ce735(0x1d2),'body':{'appCode':_0x2695ec,'currentPage':_0x5134e7?.[_0x2ce735(0x1d3)]??0x1,'pageSize':_0x5134e7?.[_0x2ce735(0x1ae)]??0x32,'sqlCode':_0x5134e7?.[_0x2ce735(0x1c9)],'sqlName':_0x5134e7?.[_0x2ce735(0x1b3)]}});return _0x45c51e[_0x2ce735(0x1b4)];}export async function getSqlQueryInfo(_0x45a041,_0x51a478){const _0x41c37b=a92_0x28d6,_0x1d48e1=await listSqlQueries(_0x45a041,{'sqlCode':_0x51a478}),_0x4952f6=_0x1d48e1[_0x41c37b(0x1ba)]?.[0x0];if(!_0x4952f6)throw CliErrors[_0x41c37b(0x193)](_0x41c37b(0x1cd)+_0x51a478);return _0x4952f6;}export async function saveSqlQuery(_0x5b21fb){const _0x2932e8=a92_0x28d6,_0x5f307e=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x2932e8(0x1d2),'body':_0x5b21fb});return _0x5f307e['data'];}export async function executeSql(_0x24132a,_0x4f1bb2,_0x40ea37){const _0x41f1e6=a92_0x28d6,_0x345cc4=await apiRequest(_0x41f1e6(0x1f8),{'method':_0x41f1e6(0x1d2),'body':{'appCode':_0x24132a,'sqlCode':_0x4f1bb2,..._0x40ea37&&{'params':_0x40ea37}},'useRuntime':!![]});return _0x345cc4['data'];}export async function listDatasets(_0x112a78,_0x41a973){const _0x4171ea=a92_0x28d6,_0x583279={'appCode':_0x112a78,'deleted':![]};if(_0x41a973?.[_0x4171ea(0x1b6)])_0x583279[_0x4171ea(0x1b6)]=_0x41a973[_0x4171ea(0x1b6)];if(_0x41a973?.['name'])_0x583279[_0x4171ea(0x1a0)]=_0x41a973[_0x4171ea(0x1a0)];const _0x2b51f0=await apiRequest(_0x4171ea(0x1ec),{'method':'POST','body':_0x583279});return extractList(_0x2b51f0[_0x4171ea(0x1b4)]);}export async function searchDatasets(_0x13c093,_0x583116){const _0x58c6d3=a92_0x28d6,_0x3609af=await listDatasets(_0x13c093,{'name':_0x583116}),_0x2a36b7=_0x583116[_0x58c6d3(0x1a8)](),_0xee6b98=new Set(_0x3609af[_0x58c6d3(0x1e3)](_0x32ef24=>_0x32ef24['id'])),_0x526118=_0x3609af[_0x58c6d3(0x18e)](_0x54ff4f=>_0x54ff4f[_0x58c6d3(0x1ad)]?.[_0x58c6d3(0x1f3)]?.['toLowerCase']()[_0x58c6d3(0x1d4)](_0x2a36b7)||_0x54ff4f[_0x58c6d3(0x1e2)]?.[_0x58c6d3(0x1a8)]()[_0x58c6d3(0x1d4)](_0x2a36b7)),_0x3bb0ed=await listDatasets(_0x13c093,{'code':_0x583116});for(const _0xf5adb7 of _0x3bb0ed){!_0xee6b98[_0x58c6d3(0x1a2)](_0xf5adb7['id'])&&(_0x3609af['push'](_0xf5adb7),_0xee6b98[_0x58c6d3(0x1af)](_0xf5adb7['id']));}return _0x3609af;}export function normalizeDatasetOperations(_0x17e489){const _0x28671e=a92_0x28d6;if(Array[_0x28671e(0x18c)](_0x17e489))return _0x17e489[_0x28671e(0x18e)](_0x4498f2=>_0x4498f2!=null&&typeof _0x4498f2===_0x28671e(0x1bf));if(_0x17e489&&typeof _0x17e489===_0x28671e(0x1bf))return Object[_0x28671e(0x1ca)](_0x17e489)[_0x28671e(0x18e)](([,_0x4891a3])=>_0x4891a3!=null&&typeof _0x4891a3===_0x28671e(0x1bf))[_0x28671e(0x1e3)](([_0x21ff36,_0x2d2554])=>({..._0x2d2554,'name':_0x2d2554[_0x28671e(0x1a0)]??_0x2d2554[_0x28671e(0x1ac)]??_0x21ff36}));return[];}export async function getDatasetDetail(_0x2e0a96){const _0x5e9d12=a92_0x28d6,_0x452bc7=/^\d+$/[_0x5e9d12(0x1c6)](_0x2e0a96)?'id':_0x5e9d12(0x1b6),_0xf94ad3=await apiRequest(_0x5e9d12(0x1f0)+_0x452bc7+'='+_0x2e0a96);return _0xf94ad3['data'];}export async function getDatasetOperations(_0x34a7c5){const _0x1c10d5=a92_0x28d6,_0x222bda=await getDatasetDetail(_0x34a7c5),_0x25fc8b=normalizeDatasetOperations(_0x222bda['operations'])[_0x1c10d5(0x1e3)](_0x20581d=>({'name':_0x20581d['name']||_0x20581d[_0x1c10d5(0x1ac)],'displayName':_0x20581d['displayName']||_0x20581d[_0x1c10d5(0x1a0)],'type':_0x20581d[_0x1c10d5(0x198)],'method':_0x20581d[_0x1c10d5(0x1c4)],'path':_0x20581d[_0x1c10d5(0x1b8)],'enabled':_0x20581d[_0x1c10d5(0x1d5)]??!![],'requestFields':_0x20581d['requestFields'],'responseFields':_0x20581d[_0x1c10d5(0x1f7)]}));return{'dataset':{'id':_0x222bda['id']??_0x222bda[_0x1c10d5(0x1d9)],'name':_0x222bda['name'],'code':_0x222bda['code']||_0x222bda['modelCode'],'tableName':_0x222bda[_0x1c10d5(0x1f3)]||_0x222bda['dbtableConfig']?.[_0x1c10d5(0x1f3)]},'operations':_0x25fc8b};}export async function getOperationDetail(_0x484acb,_0x1c8395,_0xa7642b){const _0x2c95a3=a92_0x28d6;let _0x2497bd=_0x1c8395;if(!/^\d+$/[_0x2c95a3(0x1c6)](_0x1c8395)){const _0x2242bc=await listDatasets(_0x484acb,{'code':_0x1c8395}),_0x56898d=_0x2242bc[_0x2c95a3(0x19f)](_0x48abda=>_0x48abda['code']===_0x1c8395||String(_0x48abda['id'])===_0x1c8395);if(!_0x56898d)throw CliErrors[_0x2c95a3(0x193)](_0x2c95a3(0x1ef)+_0x1c8395);_0x2497bd=String(_0x56898d['id']);}const _0x255170=await getDatasetDetail(_0x2497bd),_0x3fe94e=normalizeDatasetOperations(_0x255170[_0x2c95a3(0x195)])['find'](_0x5c946f=>(_0x5c946f[_0x2c95a3(0x1a0)]||_0x5c946f[_0x2c95a3(0x1ac)])===_0xa7642b);if(!_0x3fe94e)throw CliErrors['validation'](_0x2c95a3(0x1df)+_0xa7642b+_0x2c95a3(0x1b2)+_0x1c8395);return{'dataset':{'id':_0x255170['id']??_0x255170['modelId'],'name':_0x255170[_0x2c95a3(0x1a0)],'code':_0x255170['code']||_0x255170['modelCode'],'tableName':_0x255170['tableName']||_0x255170[_0x2c95a3(0x1ad)]?.[_0x2c95a3(0x1f3)]},'operation':_0x3fe94e};}export function generateSdkCode(_0x4139c8,_0x43d863,_0x975f0b){const _0x545c37=a92_0x28d6,_0xf629aa=_0x975f0b?.[_0x545c37(0x19e)]??!![],_0xf4ac27=_0x545c37(0x1aa)+_0x4139c8[_0x545c37(0x1b6)]?.['replace'](/-/g,'_'),_0x371ff3=_0x43d863['name']||_0x43d863[_0x545c37(0x1ac)]||'filter',_0x332732=[];_0xf629aa&&_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1d0),'',_0x545c37(0x1c0),'');_0x332732['push'](_0x545c37(0x19a)+_0x4139c8['name']+'\x20('+(_0x4139c8[_0x545c37(0x1f3)]||_0x545c37(0x1c3))+')');if(_0x371ff3===_0x545c37(0x18e))_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1b0)+_0xf4ac27+_0x545c37(0x19b),_0x545c37(0x196),'\x20\x20pageSize:\x2020,','\x20\x20currentPage:\x201,',_0x545c37(0x1bb));else{if(_0x371ff3==='getOne')_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1b0)+_0xf4ac27+'.getOne(id);');else{if(_0x371ff3===_0x545c37(0x1e6))_0x332732[_0x545c37(0x1e9)]('const\x20result\x20=\x20await\x20client.models.'+_0xf4ac27+_0x545c37(0x194));else{if(_0x371ff3===_0x545c37(0x1f1))_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1b0)+_0xf4ac27+_0x545c37(0x1eb));else _0x371ff3==='delete'||_0x371ff3===_0x545c37(0x1bd)?_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1b0)+_0xf4ac27+_0x545c37(0x1db)):_0x332732[_0x545c37(0x1e9)](_0x545c37(0x1b0)+_0xf4ac27+'.'+_0x371ff3+_0x545c37(0x186));}}}return _0x332732[_0x545c37(0x1b1)]('\x0a');}export function generateSqlCodeTemplate(_0x292605,_0x4bc010){const _0x3cb094=a92_0x28d6,_0x3c61e0=_0x4bc010?.[_0x3cb094(0x1ed)]??_0x3cb094(0x187),_0x363a6d=_0x4bc010?.[_0x3cb094(0x19e)]??!![],_0x199f95=[];return _0x199f95['push'](_0x3cb094(0x190)+_0x292605[_0x3cb094(0x1b3)]+'\x20('+_0x292605['sqlCode']+')'),_0x3c61e0==='sdk'?(_0x363a6d&&_0x199f95[_0x3cb094(0x1e9)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x3cb094(0x1c0),''),_0x199f95[_0x3cb094(0x1e9)](_0x3cb094(0x1dc),_0x3cb094(0x1a5)+_0x292605[_0x3cb094(0x1c9)]+'\x27,',_0x3cb094(0x1f2),_0x3cb094(0x1bb),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x3cb094(0x1cc))):_0x199f95[_0x3cb094(0x1e9)](_0x3cb094(0x1f9),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x3cb094(0x18f)+_0x292605[_0x3cb094(0x1c9)]+'\x27,',_0x3cb094(0x197),_0x3cb094(0x1dd),_0x3cb094(0x1b5),'}'),_0x199f95['join']('\x0a');}export async function getErConfig(_0x1db9b2,_0x16232d){const _0x88d7b9=a92_0x28d6,_0x3887ca=await apiRequest(_0x88d7b9(0x1d6),{'method':_0x88d7b9(0x1d2),'body':{'appCode':_0x1db9b2,'dblinkId':_0x16232d}});return _0x3887ca[_0x88d7b9(0x1b4)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x22c3bd=a92_0x28d6,_0x376f44=await apiRequest(_0x22c3bd(0x1f6),{'method':_0x22c3bd(0x1d2),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3037d5=extractList(_0x376f44[_0x22c3bd(0x1b4)]),_0x23e332=extractPaging(_0x376f44['data']);return _0x23e332&&_0x23e332['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x22c3bd(0x1d8)](_0x22c3bd(0x1ce)+REMOTE_APP_PAGE_SIZE+_0x22c3bd(0x1a1)+_0x23e332[_0x22c3bd(0x1e5)]+'\x20apps.\x20'+_0x22c3bd(0x19d)),_0x3037d5;}
@@ -1 +1 @@
1
- const a86_0x516b70=a86_0x2e38;(function(_0x907d96,_0x289d3b){const _0x2d1029=a86_0x2e38,_0x2b8e54=_0x907d96();while(!![]){try{const _0xbf7d63=parseInt(_0x2d1029(0x151))/0x1*(parseInt(_0x2d1029(0x155))/0x2)+parseInt(_0x2d1029(0x14c))/0x3+-parseInt(_0x2d1029(0x15c))/0x4+parseInt(_0x2d1029(0x152))/0x5*(parseInt(_0x2d1029(0x150))/0x6)+-parseInt(_0x2d1029(0x159))/0x7*(parseInt(_0x2d1029(0x15b))/0x8)+-parseInt(_0x2d1029(0x158))/0x9*(parseInt(_0x2d1029(0x157))/0xa)+parseInt(_0x2d1029(0x15a))/0xb*(parseInt(_0x2d1029(0x154))/0xc);if(_0xbf7d63===_0x289d3b)break;else _0x2b8e54['push'](_0x2b8e54['shift']());}catch(_0x182e53){_0x2b8e54['push'](_0x2b8e54['shift']());}}}(a86_0x1c14,0x85d8f));function a86_0x2e38(_0x2b0bd,_0x4dc66){_0x2b0bd=_0x2b0bd-0x14c;const _0x1c1460=a86_0x1c14();let _0x2e38ef=_0x1c1460[_0x2b0bd];return _0x2e38ef;}import{resolve}from'node:path';function a86_0x1c14(){const _0x3301d2=['5176JstCrt','3035376ZQiYxc','1399671ukmmzI','/bff','cwd','bff.lock.json','1698uLGlQQ','2wJfLXj','11240zRgCQO','.rabetbase','4616388qfPEPz','327938ujOmFs','bff-trash','90KcLbjv','1087209hnZJtO','6223AhaZih','44YPUCeE'];a86_0x1c14=function(){return _0x3301d2;};return a86_0x1c14();}const DOT_DIR=a86_0x516b70(0x153),LOCK_FILE_NAME=a86_0x516b70(0x14f),TRASH_DIR_NAME=a86_0x516b70(0x156);export function loadBffProjectConfig(_0x3e4137,_0x2173c8){const _0x228e33=a86_0x516b70,_0x393e19=resolve(_0x2173c8??process[_0x228e33(0x14e)]()),_0x1ce399=DOT_DIR+_0x228e33(0x14d),_0x2648df=_0x1ce399+'/'+_0x3e4137;return{'projectRoot':_0x393e19,'appCode':_0x3e4137,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x1ce399,'scriptsRoot':_0x2648df,'scriptsRootDir':resolve(_0x393e19,DOT_DIR,'bff',_0x3e4137),'lockFilePath':resolve(_0x393e19,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x393e19,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a93_0x3971c5=a93_0x2418;(function(_0x3d5da9,_0x2812a9){const _0xd3d0ab=a93_0x2418,_0x28acec=_0x3d5da9();while(!![]){try{const _0x21f2be=parseInt(_0xd3d0ab(0x19b))/0x1*(parseInt(_0xd3d0ab(0x1a0))/0x2)+-parseInt(_0xd3d0ab(0x1a7))/0x3*(parseInt(_0xd3d0ab(0x19e))/0x4)+parseInt(_0xd3d0ab(0x1a3))/0x5+parseInt(_0xd3d0ab(0x1a5))/0x6*(-parseInt(_0xd3d0ab(0x1a1))/0x7)+-parseInt(_0xd3d0ab(0x1a8))/0x8+-parseInt(_0xd3d0ab(0x1a2))/0x9+parseInt(_0xd3d0ab(0x1a9))/0xa*(parseInt(_0xd3d0ab(0x19d))/0xb);if(_0x21f2be===_0x2812a9)break;else _0x28acec['push'](_0x28acec['shift']());}catch(_0xca0d4f){_0x28acec['push'](_0x28acec['shift']());}}}(a93_0x4ed7,0x510fa));import{resolve}from'node:path';const DOT_DIR=a93_0x3971c5(0x19f),LOCK_FILE_NAME=a93_0x3971c5(0x19c),TRASH_DIR_NAME=a93_0x3971c5(0x19a);function a93_0x2418(_0x4645f3,_0x299d01){_0x4645f3=_0x4645f3-0x19a;const _0x4ed716=a93_0x4ed7();let _0x241898=_0x4ed716[_0x4645f3];return _0x241898;}export function loadBffProjectConfig(_0x245e8b,_0x5e8432){const _0x445578=a93_0x3971c5,_0x31519b=resolve(_0x5e8432??process[_0x445578(0x1a6)]()),_0x8ce2c5=DOT_DIR+_0x445578(0x1a4),_0x22d2ba=_0x8ce2c5+'/'+_0x245e8b;return{'projectRoot':_0x31519b,'appCode':_0x245e8b,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x8ce2c5,'scriptsRoot':_0x22d2ba,'scriptsRootDir':resolve(_0x31519b,DOT_DIR,'bff',_0x245e8b),'lockFilePath':resolve(_0x31519b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x31519b,DOT_DIR,TRASH_DIR_NAME)};}function a93_0x4ed7(){const _0x2e8b07=['7JjpRub','2806929dZiNNy','2906540SxmBuD','/bff','3095898gXBBgT','cwd','1589937pyvkGa','1130528fyTUWK','3130ajWRRS','bff-trash','2861khfguS','bff.lock.json','40909movRKK','4pXaGFL','.rabetbase','60AGsveV'];a93_0x4ed7=function(){return _0x2e8b07;};return a93_0x4ed7();}
@@ -1 +1 @@
1
- function a87_0x4eca(_0x28eb29,_0x262506){_0x28eb29=_0x28eb29-0xe4;const _0x48ae0a=a87_0x48ae();let _0x4ecad9=_0x48ae0a[_0x28eb29];return _0x4ecad9;}const a87_0x2f3bb4=a87_0x4eca;(function(_0x4e3e2f,_0x2ab9fd){const _0x1df11e=a87_0x4eca,_0x590806=_0x4e3e2f();while(!![]){try{const _0x5dd9a0=parseInt(_0x1df11e(0xfc))/0x1*(parseInt(_0x1df11e(0xee))/0x2)+-parseInt(_0x1df11e(0xf8))/0x3*(parseInt(_0x1df11e(0x109))/0x4)+parseInt(_0x1df11e(0x10c))/0x5*(-parseInt(_0x1df11e(0x10a))/0x6)+-parseInt(_0x1df11e(0x108))/0x7+-parseInt(_0x1df11e(0xfd))/0x8*(parseInt(_0x1df11e(0xf6))/0x9)+parseInt(_0x1df11e(0x101))/0xa+-parseInt(_0x1df11e(0xe5))/0xb*(-parseInt(_0x1df11e(0x107))/0xc);if(_0x5dd9a0===_0x2ab9fd)break;else _0x590806['push'](_0x590806['shift']());}catch(_0x42e87d){_0x590806['push'](_0x590806['shift']());}}}(a87_0x48ae,0xcc547));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';export const SUPPORTED_BFF_TYPES=['COMMON',a87_0x2f3bb4(0xf2),'HOOK'];export function normalizeBffType(_0x112d8b){const _0x589604=a87_0x2f3bb4;if(!_0x112d8b)return undefined;const _0x4fd39d=_0x112d8b[_0x589604(0xe7)]()[_0x589604(0xeb)]();return SUPPORTED_BFF_TYPES[_0x589604(0xf7)](_0x4fd39d)?_0x4fd39d:undefined;}async function scanJsFilesRecursively(_0xe3ab1c,_0xdda993){const _0x579fa0=a87_0x2f3bb4,_0x3f8cae=[];try{const _0x350703=await readdir(_0xe3ab1c,{'withFileTypes':!![]});for(const _0x29451c of _0x350703){const _0x53b577=join(_0xe3ab1c,_0x29451c[_0x579fa0(0x104)]);if(_0x29451c[_0x579fa0(0x10d)]())_0x3f8cae[_0x579fa0(0xf9)](...await scanJsFilesRecursively(_0x53b577,_0xdda993+'/'+_0x29451c[_0x579fa0(0x104)]));else _0x29451c[_0x579fa0(0x10e)]()&&_0x29451c[_0x579fa0(0x104)]['endsWith'](_0x579fa0(0xef))&&_0x3f8cae[_0x579fa0(0xf9)]({'lockKey':_0xdda993+'/'+_0x29451c[_0x579fa0(0x104)]['replace'](/\.js$/,''),'filePath':_0x53b577});}}catch(_0x5e2839){if(_0x5e2839['code']!==_0x579fa0(0x106))throw _0x5e2839;}return _0x3f8cae;}async function scanFlatFunctions(_0x55bcb1,_0x7653bc){const _0x2de1cd=a87_0x2f3bb4,_0x4b6d05=join(_0x55bcb1[_0x2de1cd(0xe8)],_0x7653bc),_0x230859=await scanJsFilesRecursively(_0x4b6d05,_0x7653bc);return _0x230859['map'](({lockKey:_0x5ac47a,filePath:_0x3a5282})=>({'type':_0x7653bc,'name':_0x5ac47a[_0x2de1cd(0x10b)]('/')['at'](-0x1)??'','filePath':_0x3a5282,'lockKey':_0x5ac47a}));}async function scanHookFunctions(_0x20e1c8){const _0x137369=a87_0x2f3bb4,_0x1295ac=join(_0x20e1c8[_0x137369(0xe8)],_0x137369(0xe4)),_0x514f63=[];try{const _0x61b4a1=await readdir(_0x1295ac,{'withFileTypes':!![]});for(const _0x2ab85e of _0x61b4a1){if(!_0x2ab85e[_0x137369(0x10d)]())continue;const _0x102c0d=_0x2ab85e[_0x137369(0x104)],_0x4f50bb=join(_0x1295ac,_0x102c0d),_0x475105=await readdir(_0x4f50bb,{'withFileTypes':!![]});for(const _0x1012a6 of _0x475105){if(!_0x1012a6[_0x137369(0x10d)]())continue;const _0x2524df=_0x1012a6[_0x137369(0x104)],_0x48abf1=join(_0x4f50bb,_0x2524df),_0x1e330f=await readdir(_0x48abf1,{'withFileTypes':!![]});for(const _0x4e1f46 of _0x1e330f){if(!_0x4e1f46[_0x137369(0x10d)]())continue;const _0xc824e6=_0x4e1f46[_0x137369(0x104)],_0xd92732=join(_0x48abf1,_0xc824e6),_0x1f51e0=await readdir(_0xd92732,{'withFileTypes':!![]});for(const _0x20cdac of _0x1f51e0){if(!_0x20cdac[_0x137369(0x10e)]()||!_0x20cdac['name'][_0x137369(0xf0)](_0x137369(0xef)))continue;const _0x2151af=_0x20cdac['name'][_0x137369(0xfe)](/\.js$/,'');_0x514f63[_0x137369(0xf9)]({'type':_0x137369(0xe4),'name':_0x2151af,'filePath':join(_0xd92732,_0x20cdac['name']),'lockKey':_0x137369(0xff)+_0x102c0d+'/'+_0x2524df+'/'+_0xc824e6+'/'+_0x2151af,'alias':_0x102c0d,'operationType':_0x2524df,'functionNode':_0xc824e6});}}}}}catch(_0x4cc570){if(_0x4cc570[_0x137369(0x103)]!==_0x137369(0x106))throw _0x4cc570;}return _0x514f63;}export async function scanLocalBffFunctions(_0x573b38,_0x3df928){const _0x25641b=a87_0x2f3bb4;if(_0x3df928==='COMMON'||_0x3df928===_0x25641b(0xf2))return scanFlatFunctions(_0x573b38,_0x3df928);if(_0x3df928==='HOOK')return scanHookFunctions(_0x573b38);const [_0x53c58a,_0x2d654a,_0x351649]=await Promise[_0x25641b(0x102)]([scanFlatFunctions(_0x573b38,'COMMON'),scanFlatFunctions(_0x573b38,'ENDPOINT'),scanHookFunctions(_0x573b38)]);return[..._0x53c58a,..._0x2d654a,..._0x351649];}export function resolveLocalFilePathFromLockKey(_0x6fc25b,_0x2b7deb){const _0x27c72c=a87_0x2f3bb4;return join(_0x6fc25b[_0x27c72c(0xe8)],..._0x2b7deb[_0x27c72c(0x10b)]('/'))+_0x27c72c(0xef);}export function createHookLocationMap(_0x4d083d){const _0x4787a8=a87_0x2f3bb4,_0x275ab9=new Map();for(const _0x25cc7c of _0x4d083d){_0x25cc7c[_0x4787a8(0xe6)]&&_0x275ab9[_0x4787a8(0xec)](_0x25cc7c[_0x4787a8(0xe6)],{'datasetCode':_0x25cc7c[_0x4787a8(0xf3)],'operationType':snakeToCamel(_0x25cc7c[_0x4787a8(0xf5)]),'functionNode':_0x4787a8(0xf4)}),_0x25cc7c[_0x4787a8(0xe9)]&&_0x275ab9['set'](_0x25cc7c['afterScriptId'],{'datasetCode':_0x25cc7c[_0x4787a8(0xf3)],'operationType':snakeToCamel(_0x25cc7c[_0x4787a8(0xf5)]),'functionNode':_0x4787a8(0xed)});}return _0x275ab9;}function a87_0x48ae(){const _0x433614=['279XIHLQD','includes','11793eelHlT','push','scriptType','functionNode','1427710LrRaCu','6456xKSKUW','replace','HOOK/','F_OK','6664210JrUJma','all','code','name','get','ENOENT','84zeRujm','441007jVfCeW','1124wdgVKn','6kxCFuu','split','5706990JvBNAT','isDirectory','isFile','HOOK','1692163fNTGlm','beforeScriptId','trim','scriptsRootDir','afterScriptId','alias','toUpperCase','set','after','2VJPZec','.js','endsWith','functionName','ENDPOINT','datasetCode','before','operationType'];a87_0x48ae=function(){return _0x433614;};return a87_0x48ae();}export function resolveRemoteScriptTarget(_0x5da2fb,_0x5f50ec,_0x33e26c,_0x2193fd,_0x508d4d){const _0x30b744=a87_0x2f3bb4,_0x32736a=normalizeBffType(_0x5f50ec[_0x30b744(0xfa)]);if(!_0x32736a||!_0x5f50ec[_0x30b744(0xf1)])return null;if(_0x32736a===_0x30b744(0xe4)){const _0x5cfcce=(_0x5f50ec['id']?_0x33e26c['get'](_0x5f50ec['id']):undefined)??findHookLocationByRemoteId(_0x2193fd,_0x5f50ec['id']);if(!_0x5cfcce)return null;const _0x3a9b14=_0x5cfcce[_0x30b744(0xea)]||_0x508d4d[_0x30b744(0x105)](_0x5cfcce['datasetCode']),_0x220ba6=_0x3a9b14??_0x5cfcce['datasetCode'],_0x4fd4fd={..._0x5cfcce,'alias':_0x3a9b14},_0x36d89a='HOOK/'+_0x220ba6+'/'+_0x4fd4fd['operationType']+'/'+_0x4fd4fd[_0x30b744(0xfb)]+'/'+_0x5f50ec[_0x30b744(0xf1)];return{'lockKey':_0x36d89a,'filePath':resolveLocalFilePathFromLockKey(_0x5da2fb,_0x36d89a),'type':_0x30b744(0xe4),'hookLocation':_0x4fd4fd};}const _0x59822c=_0x32736a+'/'+_0x5f50ec[_0x30b744(0xf1)];return{'lockKey':_0x59822c,'filePath':resolveLocalFilePathFromLockKey(_0x5da2fb,_0x59822c),'type':_0x32736a};}export async function ensureParentDirectory(_0x5ca9fb){await mkdir(dirname(_0x5ca9fb),{'recursive':!![]});}export async function fileExists(_0x1d627c){const _0x179cc8=a87_0x2f3bb4;try{return await access(_0x1d627c,constants[_0x179cc8(0x100)]),!![];}catch{return![];}}export async function directoryExists(_0x6b6c4f){const _0x3b0bff=a87_0x2f3bb4;try{const _0x47e5ef=await stat(_0x6b6c4f);return _0x47e5ef[_0x3b0bff(0x10d)]();}catch{return![];}}
1
+ const a94_0x45ea4c=a94_0x23d4;(function(_0x27163d,_0x300f31){const _0x103980=a94_0x23d4,_0x2da41c=_0x27163d();while(!![]){try{const _0x3d1e81=parseInt(_0x103980(0xd9))/0x1+parseInt(_0x103980(0xc5))/0x2+parseInt(_0x103980(0xd8))/0x3*(parseInt(_0x103980(0xc4))/0x4)+-parseInt(_0x103980(0xda))/0x5*(parseInt(_0x103980(0xd5))/0x6)+parseInt(_0x103980(0xc2))/0x7+parseInt(_0x103980(0xb9))/0x8+-parseInt(_0x103980(0xd4))/0x9*(parseInt(_0x103980(0xbc))/0xa);if(_0x3d1e81===_0x300f31)break;else _0x2da41c['push'](_0x2da41c['shift']());}catch(_0x407a69){_0x2da41c['push'](_0x2da41c['shift']());}}}(a94_0x18ad,0xbee01));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a94_0x23d4(_0x390f7b,_0x5a462a){_0x390f7b=_0x390f7b-0xb5;const _0x18ad49=a94_0x18ad();let _0x23d464=_0x18ad49[_0x390f7b];return _0x23d464;}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';export const SUPPORTED_BFF_TYPES=[a94_0x45ea4c(0xbb),a94_0x45ea4c(0xc9),a94_0x45ea4c(0xb8)];export function normalizeBffType(_0x2d80b2){const _0x280477=a94_0x45ea4c;if(!_0x2d80b2)return undefined;const _0x166b4c=_0x2d80b2['trim']()[_0x280477(0xb6)]();return SUPPORTED_BFF_TYPES[_0x280477(0xdb)](_0x166b4c)?_0x166b4c:undefined;}async function scanJsFilesRecursively(_0x2324ce,_0x5299a4){const _0x3a40b6=a94_0x45ea4c,_0x2a38e7=[];try{const _0x1a0328=await readdir(_0x2324ce,{'withFileTypes':!![]});for(const _0x1ecf64 of _0x1a0328){const _0x103772=join(_0x2324ce,_0x1ecf64[_0x3a40b6(0xc7)]);if(_0x1ecf64[_0x3a40b6(0xcd)]())_0x2a38e7['push'](...await scanJsFilesRecursively(_0x103772,_0x5299a4+'/'+_0x1ecf64[_0x3a40b6(0xc7)]));else _0x1ecf64[_0x3a40b6(0xc1)]()&&_0x1ecf64[_0x3a40b6(0xc7)]['endsWith'](_0x3a40b6(0xd7))&&_0x2a38e7['push']({'lockKey':_0x5299a4+'/'+_0x1ecf64[_0x3a40b6(0xc7)][_0x3a40b6(0xbf)](/\.js$/,''),'filePath':_0x103772});}}catch(_0x2fc43d){if(_0x2fc43d['code']!=='ENOENT')throw _0x2fc43d;}return _0x2a38e7;}async function scanFlatFunctions(_0x544ad4,_0x21cffb){const _0x457c2e=a94_0x45ea4c,_0x1186ff=join(_0x544ad4[_0x457c2e(0xdd)],_0x21cffb),_0x3c4cdf=await scanJsFilesRecursively(_0x1186ff,_0x21cffb);return _0x3c4cdf[_0x457c2e(0xdc)](({lockKey:_0x3e2a21,filePath:_0x2afb8d})=>({'type':_0x21cffb,'name':_0x3e2a21['split']('/')['at'](-0x1)??'','filePath':_0x2afb8d,'lockKey':_0x3e2a21}));}function a94_0x18ad(){const _0x143393=['scriptType','toUpperCase','afterScriptId','HOOK','7042488EMAeja','push','COMMON','125030DBCIck','datasetCode','set','replace','functionName','isFile','5119534SAKera','ENOENT','1167964BEDrEx','1457214xMhhVF','split','name','F_OK','ENDPOINT','after','operationType','code','isDirectory','alias','beforeScriptId','HOOK/','before','endsWith','all','2133WlCfxF','264whunBO','get','.js','15xYBNTJ','409485mzNMAh','52805ISBJGI','includes','map','scriptsRootDir'];a94_0x18ad=function(){return _0x143393;};return a94_0x18ad();}async function scanHookFunctions(_0x180421){const _0x262570=a94_0x45ea4c,_0x184bc5=join(_0x180421['scriptsRootDir'],'HOOK'),_0x6d663b=[];try{const _0x10258d=await readdir(_0x184bc5,{'withFileTypes':!![]});for(const _0x11ee01 of _0x10258d){if(!_0x11ee01[_0x262570(0xcd)]())continue;const _0xbdf0b1=_0x11ee01['name'],_0x34db5e=join(_0x184bc5,_0xbdf0b1),_0x2596a8=await readdir(_0x34db5e,{'withFileTypes':!![]});for(const _0x2eb616 of _0x2596a8){if(!_0x2eb616[_0x262570(0xcd)]())continue;const _0x16d287=_0x2eb616[_0x262570(0xc7)],_0x34320a=join(_0x34db5e,_0x16d287),_0xba4612=await readdir(_0x34320a,{'withFileTypes':!![]});for(const _0x3249d5 of _0xba4612){if(!_0x3249d5[_0x262570(0xcd)]())continue;const _0x429fe8=_0x3249d5[_0x262570(0xc7)],_0x18bbf7=join(_0x34320a,_0x429fe8),_0x2d2584=await readdir(_0x18bbf7,{'withFileTypes':!![]});for(const _0x3985a3 of _0x2d2584){if(!_0x3985a3[_0x262570(0xc1)]()||!_0x3985a3['name'][_0x262570(0xd2)](_0x262570(0xd7)))continue;const _0x41b1dc=_0x3985a3[_0x262570(0xc7)][_0x262570(0xbf)](/\.js$/,'');_0x6d663b[_0x262570(0xba)]({'type':_0x262570(0xb8),'name':_0x41b1dc,'filePath':join(_0x18bbf7,_0x3985a3['name']),'lockKey':_0x262570(0xd0)+_0xbdf0b1+'/'+_0x16d287+'/'+_0x429fe8+'/'+_0x41b1dc,'alias':_0xbdf0b1,'operationType':_0x16d287,'functionNode':_0x429fe8});}}}}}catch(_0x4a1db4){if(_0x4a1db4[_0x262570(0xcc)]!==_0x262570(0xc3))throw _0x4a1db4;}return _0x6d663b;}export async function scanLocalBffFunctions(_0x26a3fc,_0x34f132){const _0x65d5ec=a94_0x45ea4c;if(_0x34f132==='COMMON'||_0x34f132===_0x65d5ec(0xc9))return scanFlatFunctions(_0x26a3fc,_0x34f132);if(_0x34f132===_0x65d5ec(0xb8))return scanHookFunctions(_0x26a3fc);const [_0xcaec4,_0x406a1f,_0x16ad38]=await Promise[_0x65d5ec(0xd3)]([scanFlatFunctions(_0x26a3fc,_0x65d5ec(0xbb)),scanFlatFunctions(_0x26a3fc,_0x65d5ec(0xc9)),scanHookFunctions(_0x26a3fc)]);return[..._0xcaec4,..._0x406a1f,..._0x16ad38];}export function resolveLocalFilePathFromLockKey(_0x19020f,_0x45d5c7){const _0x1c1875=a94_0x45ea4c;return join(_0x19020f[_0x1c1875(0xdd)],..._0x45d5c7[_0x1c1875(0xc6)]('/'))+_0x1c1875(0xd7);}export function createHookLocationMap(_0x57156d){const _0x18b38f=a94_0x45ea4c,_0x2396a0=new Map();for(const _0x2a325c of _0x57156d){_0x2a325c[_0x18b38f(0xcf)]&&_0x2396a0[_0x18b38f(0xbe)](_0x2a325c[_0x18b38f(0xcf)],{'datasetCode':_0x2a325c[_0x18b38f(0xbd)],'operationType':snakeToCamel(_0x2a325c['operationType']),'functionNode':_0x18b38f(0xd1)}),_0x2a325c['afterScriptId']&&_0x2396a0[_0x18b38f(0xbe)](_0x2a325c[_0x18b38f(0xb7)],{'datasetCode':_0x2a325c[_0x18b38f(0xbd)],'operationType':snakeToCamel(_0x2a325c['operationType']),'functionNode':_0x18b38f(0xca)});}return _0x2396a0;}export function resolveRemoteScriptTarget(_0x7b0e1,_0x6cc032,_0xa4ccb9,_0x21edcf,_0x2854f8){const _0x5259a0=a94_0x45ea4c,_0x370020=normalizeBffType(_0x6cc032[_0x5259a0(0xb5)]);if(!_0x370020||!_0x6cc032['functionName'])return null;if(_0x370020===_0x5259a0(0xb8)){const _0x15e92e=(_0x6cc032['id']?_0xa4ccb9[_0x5259a0(0xd6)](_0x6cc032['id']):undefined)??findHookLocationByRemoteId(_0x21edcf,_0x6cc032['id']);if(!_0x15e92e)return null;const _0x2ac285=_0x15e92e[_0x5259a0(0xce)]||_0x2854f8[_0x5259a0(0xd6)](_0x15e92e[_0x5259a0(0xbd)]),_0x317920=_0x2ac285??_0x15e92e[_0x5259a0(0xbd)],_0x5ea068={..._0x15e92e,'alias':_0x2ac285},_0x4ef18d='HOOK/'+_0x317920+'/'+_0x5ea068[_0x5259a0(0xcb)]+'/'+_0x5ea068['functionNode']+'/'+_0x6cc032[_0x5259a0(0xc0)];return{'lockKey':_0x4ef18d,'filePath':resolveLocalFilePathFromLockKey(_0x7b0e1,_0x4ef18d),'type':_0x5259a0(0xb8),'hookLocation':_0x5ea068};}const _0x58dac0=_0x370020+'/'+_0x6cc032[_0x5259a0(0xc0)];return{'lockKey':_0x58dac0,'filePath':resolveLocalFilePathFromLockKey(_0x7b0e1,_0x58dac0),'type':_0x370020};}export async function ensureParentDirectory(_0x11653d){await mkdir(dirname(_0x11653d),{'recursive':!![]});}export async function fileExists(_0x129cd2){const _0x3ef252=a94_0x45ea4c;try{return await access(_0x129cd2,constants[_0x3ef252(0xc8)]),!![];}catch{return![];}}export async function directoryExists(_0x349750){const _0x46c457=a94_0x45ea4c;try{const _0x1f8cbb=await stat(_0x349750);return _0x1f8cbb[_0x46c457(0xcd)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x18f153,_0x33bc9e){const _0x1cb472=a88_0x31ee,_0x29c5a3=_0x18f153();while(!![]){try{const _0x1371a3=parseInt(_0x1cb472(0x9c))/0x1+-parseInt(_0x1cb472(0x91))/0x2+parseInt(_0x1cb472(0x94))/0x3+parseInt(_0x1cb472(0x99))/0x4*(-parseInt(_0x1cb472(0x9f))/0x5)+parseInt(_0x1cb472(0x9b))/0x6+parseInt(_0x1cb472(0x9e))/0x7*(parseInt(_0x1cb472(0x9a))/0x8)+parseInt(_0x1cb472(0x95))/0x9*(parseInt(_0x1cb472(0x98))/0xa);if(_0x1371a3===_0x33bc9e)break;else _0x29c5a3['push'](_0x29c5a3['shift']());}catch(_0xe1386c){_0x29c5a3['push'](_0x29c5a3['shift']());}}}(a88_0x2629,0x1ec39));import{readFile}from'node:fs/promises';import a88_0x801c37 from'node:crypto';function a88_0x31ee(_0x18e5b9,_0x31fd46){_0x18e5b9=_0x18e5b9-0x91;const _0x2629d0=a88_0x2629();let _0x31eeca=_0x2629d0[_0x18e5b9];return _0x31eeca;}export function computeContentHash(_0x597f0b){const _0x2ba378=a88_0x31ee;return a88_0x801c37[_0x2ba378(0x97)](_0x2ba378(0x9d))[_0x2ba378(0x92)](_0x597f0b)[_0x2ba378(0xa0)](_0x2ba378(0x96));}function a88_0x2629(){const _0x147060=['hex','createHash','360950zcYkNY','6436Qtwlut','738952NhONQt','359004OugSOy','198542WqloRX','md5','7WRWmOe','510icDOAl','digest','404902HEfNpD','update','utf8','208929yHXkUd','18dqbnua'];a88_0x2629=function(){return _0x147060;};return a88_0x2629();}export async function computeFileHash(_0x1387a2){const _0x3ac330=a88_0x31ee,_0x3e84c3=await readFile(_0x1387a2,_0x3ac330(0x93));return computeContentHash(_0x3e84c3);}
1
+ (function(_0x3c0774,_0x5b3eec){const _0x3d5092=a95_0x36c1,_0xa85caf=_0x3c0774();while(!![]){try{const _0x3b7da8=-parseInt(_0x3d5092(0x1fa))/0x1+-parseInt(_0x3d5092(0x1fd))/0x2*(parseInt(_0x3d5092(0x1f7))/0x3)+-parseInt(_0x3d5092(0x1f4))/0x4+-parseInt(_0x3d5092(0x1fe))/0x5*(parseInt(_0x3d5092(0x1f9))/0x6)+-parseInt(_0x3d5092(0x200))/0x7*(-parseInt(_0x3d5092(0x1f3))/0x8)+parseInt(_0x3d5092(0x1f6))/0x9*(parseInt(_0x3d5092(0x1fc))/0xa)+parseInt(_0x3d5092(0x1ff))/0xb*(-parseInt(_0x3d5092(0x1fb))/0xc);if(_0x3b7da8===_0x5b3eec)break;else _0xa85caf['push'](_0xa85caf['shift']());}catch(_0x31fec5){_0xa85caf['push'](_0xa85caf['shift']());}}}(a95_0x4a08,0xe2554));import{readFile}from'node:fs/promises';import a95_0x2324cd from'node:crypto';export function computeContentHash(_0x4ada5e){const _0x331093=a95_0x36c1;return a95_0x2324cd[_0x331093(0x1f5)]('md5')[_0x331093(0x1f8)](_0x4ada5e)[_0x331093(0x201)](_0x331093(0x202));}export async function computeFileHash(_0x11bcf5){const _0x11cfc8=a95_0x36c1,_0x3ea79b=await readFile(_0x11bcf5,_0x11cfc8(0x1f2));return computeContentHash(_0x3ea79b);}function a95_0x36c1(_0x1b75da,_0x209adb){_0x1b75da=_0x1b75da-0x1f2;const _0x4a0867=a95_0x4a08();let _0x36c1a7=_0x4a0867[_0x1b75da];return _0x36c1a7;}function a95_0x4a08(){const _0x3913a5=['3fBgmuJ','update','1165578AkzwRt','914836zpRmee','60BfMXeu','861270RgwECf','879324XndkVm','5PQabYJ','204303ZSHblD','23989gQEZro','digest','hex','utf8','4168PIJraq','4101792rFzdHg','createHash','189HHTPCp'];a95_0x4a08=function(){return _0x3913a5;};return a95_0x4a08();}
@@ -1 +1 @@
1
- (function(_0xde5634,_0x2e9b19){const _0x103af2=a89_0x41d7,_0x1ef40b=_0xde5634();while(!![]){try{const _0x2ead44=-parseInt(_0x103af2(0x1bb))/0x1*(-parseInt(_0x103af2(0x1b9))/0x2)+parseInt(_0x103af2(0x1bd))/0x3+parseInt(_0x103af2(0x1b7))/0x4+parseInt(_0x103af2(0x1b4))/0x5*(parseInt(_0x103af2(0x1b2))/0x6)+-parseInt(_0x103af2(0x1ba))/0x7*(-parseInt(_0x103af2(0x1ae))/0x8)+-parseInt(_0x103af2(0x1af))/0x9*(-parseInt(_0x103af2(0x1b6))/0xa)+-parseInt(_0x103af2(0x1c0))/0xb*(parseInt(_0x103af2(0x1c3))/0xc);if(_0x2ead44===_0x2e9b19)break;else _0x1ef40b['push'](_0x1ef40b['shift']());}catch(_0x416625){_0x1ef40b['push'](_0x1ef40b['shift']());}}}(a89_0x2dbc,0x7a611));import{mkdir,readFile,writeFile}from'node:fs/promises';function a89_0x2dbc(){const _0x397879=['6HRkjUv','stringify','2712295arZQBn','scriptsRoot','60EItgqo','1808028LFRFkk','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','40120FiFeOm','2562455IbmIMO','46YrgFKR','parse','1493097wzpRRp','utf8','apps','70169pWTSrG','code','ENOENT','5124rMtdll','lastSync','8AOoVze','666162RJkIOw','object','functions'];a89_0x2dbc=function(){return _0x397879;};return a89_0x2dbc();}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a89_0x41d7(_0x4596f5,_0x5729b4){_0x4596f5=_0x4596f5-0x1ad;const _0x2dbc3b=a89_0x2dbc();let _0x41d7f5=_0x2dbc3b[_0x4596f5];return _0x41d7f5;}export function ensureLockScope(_0x577414,_0x4fe92e,_0xd15f5,_0x55f107){const _0xebc8a8=a89_0x41d7,_0x2e8f45={'apps':_0x577414[_0xebc8a8(0x1bf)]&&typeof _0x577414['apps']===_0xebc8a8(0x1b0)?_0x577414[_0xebc8a8(0x1bf)]:{}};let _0x19c347=_0x2e8f45['apps'][_0x4fe92e];if(!_0x19c347)return _0x19c347={'scriptsRoot':_0xd15f5,'lastSync':'','functions':{}},_0x2e8f45['apps'][_0x4fe92e]=_0x19c347,{'lockData':_0x2e8f45,'appLock':_0x19c347};if(!_0x19c347[_0xebc8a8(0x1b5)])_0x19c347[_0xebc8a8(0x1b5)]=_0xd15f5;else{if(_0x19c347[_0xebc8a8(0x1b5)]!==_0xd15f5)throw new Error(_0x55f107+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0xd15f5+'\x22\x20vs\x20lock\x20\x22'+_0x19c347[_0xebc8a8(0x1b5)]+'\x22.\x20')+_0xebc8a8(0x1b8));}return!_0x19c347[_0xebc8a8(0x1b1)]&&(_0x19c347['functions']={}),!_0x19c347[_0xebc8a8(0x1ad)]&&(_0x19c347[_0xebc8a8(0x1ad)]=''),{'lockData':_0x2e8f45,'appLock':_0x19c347};}export async function readBffLockFile(_0x580e13){const _0x30fdf7=a89_0x41d7;try{const _0x46ffbf=await readFile(_0x580e13,_0x30fdf7(0x1be)),_0x268725=JSON[_0x30fdf7(0x1bc)](_0x46ffbf);return{'apps':_0x268725[_0x30fdf7(0x1bf)]&&typeof _0x268725['apps']==='object'?_0x268725[_0x30fdf7(0x1bf)]:{}};}catch(_0x46e67e){if(_0x46e67e[_0x30fdf7(0x1c1)]===_0x30fdf7(0x1c2))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x46e67e));}}export async function writeBffLockFile(_0x8d7a9b,_0x25cb93){const _0x2cd37a=a89_0x41d7;await mkdir(dirname(_0x8d7a9b),{'recursive':!![]}),await writeFile(_0x8d7a9b,JSON[_0x2cd37a(0x1b3)](_0x25cb93,null,0x2),'utf8');}
1
+ (function(_0x10e4da,_0x13ac01){const _0x5d8b75=a96_0x2ef8,_0x41c78f=_0x10e4da();while(!![]){try{const _0x3a1f12=-parseInt(_0x5d8b75(0x1cf))/0x1*(-parseInt(_0x5d8b75(0x1c8))/0x2)+parseInt(_0x5d8b75(0x1da))/0x3+parseInt(_0x5d8b75(0x1c9))/0x4*(-parseInt(_0x5d8b75(0x1d4))/0x5)+parseInt(_0x5d8b75(0x1ce))/0x6*(-parseInt(_0x5d8b75(0x1d6))/0x7)+-parseInt(_0x5d8b75(0x1cb))/0x8*(-parseInt(_0x5d8b75(0x1d0))/0x9)+-parseInt(_0x5d8b75(0x1dd))/0xa+-parseInt(_0x5d8b75(0x1d3))/0xb;if(_0x3a1f12===_0x13ac01)break;else _0x41c78f['push'](_0x41c78f['shift']());}catch(_0x4d1b03){_0x41c78f['push'](_0x41c78f['shift']());}}}(a96_0xe42d,0x2a7b5));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1856fb,_0x40566d,_0x4167f1,_0x3f6e12){const _0x39e1d4=a96_0x2ef8,_0x6a9af1={'apps':_0x1856fb['apps']&&typeof _0x1856fb[_0x39e1d4(0x1d9)]===_0x39e1d4(0x1cc)?_0x1856fb[_0x39e1d4(0x1d9)]:{}};let _0x445edf=_0x6a9af1[_0x39e1d4(0x1d9)][_0x40566d];if(!_0x445edf)return _0x445edf={'scriptsRoot':_0x4167f1,'lastSync':'','functions':{}},_0x6a9af1[_0x39e1d4(0x1d9)][_0x40566d]=_0x445edf,{'lockData':_0x6a9af1,'appLock':_0x445edf};if(!_0x445edf['scriptsRoot'])_0x445edf[_0x39e1d4(0x1d5)]=_0x4167f1;else{if(_0x445edf[_0x39e1d4(0x1d5)]!==_0x4167f1)throw new Error(_0x3f6e12+_0x39e1d4(0x1ca)+(_0x39e1d4(0x1d1)+_0x4167f1+_0x39e1d4(0x1d8)+_0x445edf[_0x39e1d4(0x1d5)]+_0x39e1d4(0x1d2))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x445edf[_0x39e1d4(0x1cd)]&&(_0x445edf[_0x39e1d4(0x1cd)]={}),!_0x445edf[_0x39e1d4(0x1d7)]&&(_0x445edf['lastSync']=''),{'lockData':_0x6a9af1,'appLock':_0x445edf};}export async function readBffLockFile(_0x2baa02){const _0x419b23=a96_0x2ef8;try{const _0xb3d352=await readFile(_0x2baa02,_0x419b23(0x1dc)),_0x49c1f8=JSON['parse'](_0xb3d352);return{'apps':_0x49c1f8[_0x419b23(0x1d9)]&&typeof _0x49c1f8[_0x419b23(0x1d9)]===_0x419b23(0x1cc)?_0x49c1f8[_0x419b23(0x1d9)]:{}};}catch(_0x21d583){if(_0x21d583[_0x419b23(0x1db)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x21d583));}}function a96_0x2ef8(_0xc3898b,_0x4aec78){_0xc3898b=_0xc3898b-0x1c8;const _0xe42d98=a96_0xe42d();let _0x2ef85c=_0xe42d98[_0xc3898b];return _0x2ef85c;}function a96_0xe42d(){const _0x3f786a=['current\x20\x22','\x22.\x20','441309BGefAQ','19495yhRWrd','scriptsRoot','17234YqzAJG','lastSync','\x22\x20vs\x20lock\x20\x22','apps','378693PcbFLo','code','utf8','1020640OVflNI','54512zGkUFD','96xYEDhH',':\x20scriptsRoot\x20mismatch\x20—\x20','744MoLBEv','object','functions','606dyvkjl','7IDGxdc','33039eXvxBS'];a96_0xe42d=function(){return _0x3f786a;};return a96_0xe42d();}export async function writeBffLockFile(_0x2ce321,_0x55dc54){const _0x33d22e=a96_0x2ef8;await mkdir(dirname(_0x2ce321),{'recursive':!![]}),await writeFile(_0x2ce321,JSON['stringify'](_0x55dc54,null,0x2),_0x33d22e(0x1dc));}
@@ -1 +1 @@
1
- (function(_0x5924d9,_0x5024cb){const _0x40daca=a91_0x1e9e,_0x5e6c37=_0x5924d9();while(!![]){try{const _0x3a4f16=parseInt(_0x40daca(0x1d0))/0x1*(parseInt(_0x40daca(0x1c9))/0x2)+parseInt(_0x40daca(0x1c5))/0x3*(-parseInt(_0x40daca(0x1d2))/0x4)+parseInt(_0x40daca(0x1d3))/0x5*(parseInt(_0x40daca(0x1cf))/0x6)+-parseInt(_0x40daca(0x1d1))/0x7*(-parseInt(_0x40daca(0x1c1))/0x8)+parseInt(_0x40daca(0x1ce))/0x9+parseInt(_0x40daca(0x1d4))/0xa+-parseInt(_0x40daca(0x1c2))/0xb;if(_0x3a4f16===_0x5024cb)break;else _0x5e6c37['push'](_0x5e6c37['shift']());}catch(_0x18a529){_0x5e6c37['push'](_0x5e6c37['shift']());}}}(a91_0x510e,0x7d56a));export function snakeToCamel(_0x84b21f){const _0x2ed44f=a91_0x1e9e;return _0x84b21f[_0x2ed44f(0x1c3)]()['replace'](/_([a-z])/g,(_0x47fe0f,_0x4e587c)=>_0x4e587c[_0x2ed44f(0x1c7)]());}export function findHookLocationByRemoteId(_0x2e2c52,_0x22f081){const _0x1f01c7=a91_0x1e9e;if(!_0x22f081)return undefined;for(const _0x2a0b1e of Object[_0x1f01c7(0x1ca)](_0x2e2c52)){if(_0x2a0b1e['remoteId']===_0x22f081&&_0x2a0b1e[_0x1f01c7(0x1cb)]&&_0x2a0b1e[_0x1f01c7(0x1c8)]&&_0x2a0b1e[_0x1f01c7(0x1c0)])return{'datasetCode':_0x2a0b1e[_0x1f01c7(0x1cb)],'operationType':_0x2a0b1e['operationType'],'functionNode':_0x2a0b1e['functionNode']};}return undefined;}function a91_0x510e(){const _0x22bfb1=['35CpDDoz','133lzaWOQ','372boNTpZ','947875RYCuRc','1822720DeKefA','functionNode','204872iWMuDF','21916147gasgqH','toLowerCase','before','1023pMWfZg','after','toUpperCase','operationType','5354wBItvx','values','datasetCode','trim','match','7443567hRRuVL','30NROzAR'];a91_0x510e=function(){return _0x22bfb1;};return a91_0x510e();}export function extractScriptDescription(_0x10e3c9){const _0x1b44df=a91_0x1e9e,_0x3135b7=_0x10e3c9[_0x1b44df(0x1cd)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x3135b7?.[0x1]?.[_0x1b44df(0x1cc)]()||undefined;}function a91_0x1e9e(_0x5d2a46,_0x408ef1){_0x5d2a46=_0x5d2a46-0x1c0;const _0x510ea7=a91_0x510e();let _0x1e9e96=_0x510ea7[_0x5d2a46];return _0x1e9e96;}export function isValidBffFunctionName(_0x5a2f79){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x5a2f79);}export function normalizeHookFunctionNode(_0x565b08){const _0xe3937e=a91_0x1e9e;if(!_0x565b08)return undefined;const _0x4567c7=_0x565b08[_0xe3937e(0x1cc)]()[_0xe3937e(0x1c3)]();if(_0x4567c7===_0xe3937e(0x1c4)||_0x4567c7===_0xe3937e(0x1c6))return _0x4567c7;return undefined;}
1
+ function a98_0x54ed(_0x401e17,_0x490639){_0x401e17=_0x401e17-0xf3;const _0x1dba3b=a98_0x1dba();let _0x54ede2=_0x1dba3b[_0x401e17];return _0x54ede2;}function a98_0x1dba(){const _0x4a7a70=['values','toUpperCase','56330532RxTIBb','11EmmKpM','functionNode','operationType','1604998ifHNjO','2749735vSrjpS','17156010AIPLuv','3TKhsiF','after','14NFrUGu','4966872VYtoTF','9ctGuBd','18vfrScB','toLowerCase','trim','4943908WMbxTx','576094zqrfkM','datasetCode'];a98_0x1dba=function(){return _0x4a7a70;};return a98_0x1dba();}(function(_0x1ac7f9,_0x23462a){const _0x2d6007=a98_0x54ed,_0x18999b=_0x1ac7f9();while(!![]){try{const _0x56e69d=-parseInt(_0x2d6007(0x104))/0x1+-parseInt(_0x2d6007(0xf8))/0x2+parseInt(_0x2d6007(0xfb))/0x3*(-parseInt(_0x2d6007(0x103))/0x4)+parseInt(_0x2d6007(0xf9))/0x5*(-parseInt(_0x2d6007(0x100))/0x6)+-parseInt(_0x2d6007(0xfd))/0x7*(parseInt(_0x2d6007(0xfe))/0x8)+parseInt(_0x2d6007(0xff))/0x9*(parseInt(_0x2d6007(0xfa))/0xa)+-parseInt(_0x2d6007(0xf5))/0xb*(-parseInt(_0x2d6007(0xf4))/0xc);if(_0x56e69d===_0x23462a)break;else _0x18999b['push'](_0x18999b['shift']());}catch(_0x48421c){_0x18999b['push'](_0x18999b['shift']());}}}(a98_0x1dba,0xdca03));export function snakeToCamel(_0xd35d85){const _0x50f50c=a98_0x54ed;return _0xd35d85[_0x50f50c(0x101)]()['replace'](/_([a-z])/g,(_0x3c4a20,_0x330649)=>_0x330649[_0x50f50c(0xf3)]());}export function findHookLocationByRemoteId(_0x31da5f,_0x2889e2){const _0x2256e8=a98_0x54ed;if(!_0x2889e2)return undefined;for(const _0x554d5f of Object[_0x2256e8(0x106)](_0x31da5f)){if(_0x554d5f['remoteId']===_0x2889e2&&_0x554d5f['datasetCode']&&_0x554d5f[_0x2256e8(0xf7)]&&_0x554d5f[_0x2256e8(0xf6)])return{'datasetCode':_0x554d5f[_0x2256e8(0x105)],'operationType':_0x554d5f[_0x2256e8(0xf7)],'functionNode':_0x554d5f[_0x2256e8(0xf6)]};}return undefined;}export function extractScriptDescription(_0x217d00){const _0x1579c9=a98_0x54ed,_0x337f0d=_0x217d00['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x337f0d?.[0x1]?.[_0x1579c9(0x102)]()||undefined;}export function isValidBffFunctionName(_0x318f27){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x318f27);}export function normalizeHookFunctionNode(_0x22087e){const _0x581bfc=a98_0x54ed;if(!_0x22087e)return undefined;const _0x4effe3=_0x22087e[_0x581bfc(0x102)]()[_0x581bfc(0x101)]();if(_0x4effe3==='before'||_0x4effe3===_0x581bfc(0xfc))return _0x4effe3;return undefined;}
@@ -1 +1 @@
1
- function a92_0x5228(){const _0x3b69a7=['15vKXjjI','1496608xdxgHq','dbName','join','find','map','has','set','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','1614692zcybUu','No\x20database\x20matching\x20\x22','77269OYQsoZ','db-','length','3483405ribXYn','1620582ZBLiZS','60eKCvsv','dbId','2684214gOzRgS','177884Qxbwmy','entries','\x22\x20matches\x20multiple\x20databases:\x20','8AAshjb','isNaN','get','toLowerCase'];a92_0x5228=function(){return _0x3b69a7;};return a92_0x5228();}(function(_0x16ef0a,_0x1a279e){const _0x395b9f=a92_0x4dde,_0x47d08c=_0x16ef0a();while(!![]){try{const _0xaaa382=parseInt(_0x395b9f(0x164))/0x1*(parseInt(_0x395b9f(0x16f))/0x2)+-parseInt(_0x395b9f(0x167))/0x3+parseInt(_0x395b9f(0x162))/0x4+parseInt(_0x395b9f(0x159))/0x5*(-parseInt(_0x395b9f(0x168))/0x6)+-parseInt(_0x395b9f(0x16c))/0x7+parseInt(_0x395b9f(0x15a))/0x8+parseInt(_0x395b9f(0x16b))/0x9*(parseInt(_0x395b9f(0x169))/0xa);if(_0xaaa382===_0x1a279e)break;else _0x47d08c['push'](_0x47d08c['shift']());}catch(_0x5ea80b){_0x47d08c['push'](_0x47d08c['shift']());}}}(a92_0x5228,0xa90ef));import{listDatasets}from'./api-client.js';const cache=new Map();export async function listDatabases(_0x150593){const _0x263b29=a92_0x4dde;if(cache[_0x263b29(0x15f)](_0x150593))return cache[_0x263b29(0x157)](_0x150593);const _0x2684cb=await listDatasets(_0x150593),_0x53baf9=new Map();for(const _0xdc0492 of _0x2684cb){const _0x558bee=_0xdc0492['dbtableConfig'];_0x558bee?.['dbId']!=null&&_0x53baf9[_0x263b29(0x160)](_0x558bee[_0x263b29(0x16a)],_0x558bee[_0x263b29(0x15b)]??_0x263b29(0x165)+_0x558bee[_0x263b29(0x16a)]);}const _0x5b7189=[..._0x53baf9[_0x263b29(0x16d)]()][_0x263b29(0x15e)](([_0x5b3dab,_0x2df87d])=>({'dbId':_0x5b3dab,'dbName':_0x2df87d}));return cache[_0x263b29(0x160)](_0x150593,_0x5b7189),_0x5b7189;}export async function resolveDb(_0x49dd45,_0x5b52cf){const _0x46a772=a92_0x4dde,_0x48cf6a=await listDatabases(_0x49dd45);if(_0x48cf6a[_0x46a772(0x166)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x5b52cf)return{'resolved':_0x48cf6a};const _0x3c2919=Number(_0x5b52cf);if(!Number[_0x46a772(0x156)](_0x3c2919)){const _0x57b0ce=_0x48cf6a['find'](_0x4448c8=>_0x4448c8[_0x46a772(0x16a)]===_0x3c2919);if(_0x57b0ce)return{'resolved':[_0x57b0ce]};}const _0x13851b=_0x5b52cf[_0x46a772(0x158)](),_0x44fb4c=_0x48cf6a['filter'](_0x336e01=>_0x336e01[_0x46a772(0x15b)][_0x46a772(0x158)]()['includes'](_0x13851b));if(_0x44fb4c[_0x46a772(0x166)]>0x0)return{'resolved':_0x44fb4c};const _0x190cb5=_0x48cf6a[_0x46a772(0x15e)](_0x58e6a2=>_0x58e6a2[_0x46a772(0x15b)]+'\x20('+_0x58e6a2[_0x46a772(0x16a)]+')')[_0x46a772(0x15c)](',\x20');return{'resolved':[],'error':_0x46a772(0x163)+_0x5b52cf+'\x22.\x20Available:\x20'+_0x190cb5};}export async function resolveOneDb(_0x366a40,_0x316ac){const _0x28b227=a92_0x4dde,{resolved:_0x91c4ae,error:_0x357b21}=await resolveDb(_0x366a40,_0x316ac);if(_0x357b21)return{'db':null,'error':_0x357b21};if(_0x91c4ae[_0x28b227(0x166)]===0x1)return{'db':_0x91c4ae[0x0]};if(!_0x316ac){const _0xb16853=_0x91c4ae[_0x28b227(0x15e)](_0x17bc56=>_0x17bc56['dbName']+'\x20('+_0x17bc56['dbId']+')')[_0x28b227(0x15c)](',\x20');return{'db':null,'error':_0x28b227(0x161)+_0xb16853};}const _0x5bbbde=_0x91c4ae[_0x28b227(0x15e)](_0x3d6c50=>_0x3d6c50['dbName']+'\x20('+_0x3d6c50[_0x28b227(0x16a)]+')')[_0x28b227(0x15c)](',\x20');return{'db':null,'error':'\x22'+_0x316ac+_0x28b227(0x16e)+_0x5bbbde+'.\x20Be\x20more\x20specific.'};}function a92_0x4dde(_0x4dcb05,_0x4e9554){_0x4dcb05=_0x4dcb05-0x156;const _0x5228ca=a92_0x5228();let _0x4dde7d=_0x5228ca[_0x4dcb05];return _0x4dde7d;}export async function getDbName(_0x31a95c,_0x3f6ecd){const _0x39a500=a92_0x4dde,_0x83acf5=await listDatabases(_0x31a95c);return _0x83acf5[_0x39a500(0x15d)](_0x4f94e4=>_0x4f94e4['dbId']===_0x3f6ecd)?.[_0x39a500(0x15b)];}
1
+ (function(_0x1f69dd,_0x551915){const _0x2573c5=a99_0x4a5b,_0x543043=_0x1f69dd();while(!![]){try{const _0x59c2b8=parseInt(_0x2573c5(0xeb))/0x1+parseInt(_0x2573c5(0xd1))/0x2*(parseInt(_0x2573c5(0xdd))/0x3)+-parseInt(_0x2573c5(0xea))/0x4*(-parseInt(_0x2573c5(0xd2))/0x5)+-parseInt(_0x2573c5(0xec))/0x6*(-parseInt(_0x2573c5(0xd7))/0x7)+-parseInt(_0x2573c5(0xe0))/0x8*(-parseInt(_0x2573c5(0xdf))/0x9)+parseInt(_0x2573c5(0xd3))/0xa*(-parseInt(_0x2573c5(0xe6))/0xb)+-parseInt(_0x2573c5(0xd4))/0xc;if(_0x59c2b8===_0x551915)break;else _0x543043['push'](_0x543043['shift']());}catch(_0x158809){_0x543043['push'](_0x543043['shift']());}}}(a99_0x43ce,0x457a8));function a99_0x4a5b(_0x6249ab,_0x58bdc8){_0x6249ab=_0x6249ab-0xd1;const _0x43cef2=a99_0x43ce();let _0x4a5be5=_0x43cef2[_0x6249ab];return _0x4a5be5;}import{listDatasets}from'./api-client.js';function a99_0x43ce(){const _0x1d499e=['entries','get','find','dbId','dbtableConfig','195udsYPA','join','91179TVNQSq','424gLYOfy','\x22.\x20Available:\x20','filter','dbName','toLowerCase','length','687137UeQxHi','includes','No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','set','3368JtgWhY','410978mMXJbl','6smKvXb','isNaN','6694vnULAn','295jQsUff','60zyydxp','12639912pweguL','.\x20Be\x20more\x20specific.','map','3482906QqzJtl'];a99_0x43ce=function(){return _0x1d499e;};return a99_0x43ce();}const cache=new Map();export async function listDatabases(_0xc7f577){const _0x1b6186=a99_0x4a5b;if(cache['has'](_0xc7f577))return cache[_0x1b6186(0xd9)](_0xc7f577);const _0xc54fb7=await listDatasets(_0xc7f577),_0x93d7e0=new Map();for(const _0x4e3046 of _0xc54fb7){const _0x1bef63=_0x4e3046[_0x1b6186(0xdc)];_0x1bef63?.['dbId']!=null&&_0x93d7e0[_0x1b6186(0xe9)](_0x1bef63[_0x1b6186(0xdb)],_0x1bef63[_0x1b6186(0xe3)]??'db-'+_0x1bef63['dbId']);}const _0x20e6ae=[..._0x93d7e0[_0x1b6186(0xd8)]()][_0x1b6186(0xd6)](([_0x5cd5f9,_0x176e0e])=>({'dbId':_0x5cd5f9,'dbName':_0x176e0e}));return cache[_0x1b6186(0xe9)](_0xc7f577,_0x20e6ae),_0x20e6ae;}export async function resolveDb(_0x1049ec,_0x2f351b){const _0x79b577=a99_0x4a5b,_0x41be74=await listDatabases(_0x1049ec);if(_0x41be74[_0x79b577(0xe5)]===0x0)return{'resolved':[],'error':_0x79b577(0xe8)};if(!_0x2f351b)return{'resolved':_0x41be74};const _0x32daf9=Number(_0x2f351b);if(!Number[_0x79b577(0xed)](_0x32daf9)){const _0x2b0c21=_0x41be74[_0x79b577(0xda)](_0x445c57=>_0x445c57['dbId']===_0x32daf9);if(_0x2b0c21)return{'resolved':[_0x2b0c21]};}const _0x89e5c7=_0x2f351b['toLowerCase'](),_0x565d46=_0x41be74[_0x79b577(0xe2)](_0x260f9f=>_0x260f9f[_0x79b577(0xe3)][_0x79b577(0xe4)]()[_0x79b577(0xe7)](_0x89e5c7));if(_0x565d46[_0x79b577(0xe5)]>0x0)return{'resolved':_0x565d46};const _0x5e67b8=_0x41be74[_0x79b577(0xd6)](_0x5cf3d0=>_0x5cf3d0['dbName']+'\x20('+_0x5cf3d0[_0x79b577(0xdb)]+')')[_0x79b577(0xde)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x2f351b+_0x79b577(0xe1)+_0x5e67b8};}export async function resolveOneDb(_0x2de76b,_0xfa77df){const _0xe3cf33=a99_0x4a5b,{resolved:_0x259e02,error:_0x5738f6}=await resolveDb(_0x2de76b,_0xfa77df);if(_0x5738f6)return{'db':null,'error':_0x5738f6};if(_0x259e02[_0xe3cf33(0xe5)]===0x1)return{'db':_0x259e02[0x0]};if(!_0xfa77df){const _0xf01774=_0x259e02[_0xe3cf33(0xd6)](_0x273cbb=>_0x273cbb['dbName']+'\x20('+_0x273cbb[_0xe3cf33(0xdb)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0xf01774};}const _0xd4b4f1=_0x259e02[_0xe3cf33(0xd6)](_0x566be3=>_0x566be3[_0xe3cf33(0xe3)]+'\x20('+_0x566be3['dbId']+')')[_0xe3cf33(0xde)](',\x20');return{'db':null,'error':'\x22'+_0xfa77df+'\x22\x20matches\x20multiple\x20databases:\x20'+_0xd4b4f1+_0xe3cf33(0xd5)};}export async function getDbName(_0x349b02,_0x2cbb20){const _0x9b3717=a99_0x4a5b,_0x5036f2=await listDatabases(_0x349b02);return _0x5036f2[_0x9b3717(0xda)](_0x2cb468=>_0x2cb468[_0x9b3717(0xdb)]===_0x2cbb20)?.['dbName'];}
@@ -1 +1 @@
1
- function a93_0x2bb6(_0x533841,_0x19ca5c){_0x533841=_0x533841-0x1c5;const _0x22f691=a93_0x22f6();let _0x2bb63e=_0x22f691[_0x533841];return _0x2bb63e;}(function(_0x327479,_0x887e53){const _0x33555d=a93_0x2bb6,_0x36610e=_0x327479();while(!![]){try{const _0x198540=-parseInt(_0x33555d(0x1dc))/0x1*(parseInt(_0x33555d(0x1d5))/0x2)+parseInt(_0x33555d(0x1df))/0x3+-parseInt(_0x33555d(0x1d9))/0x4+-parseInt(_0x33555d(0x1c7))/0x5+parseInt(_0x33555d(0x1de))/0x6*(parseInt(_0x33555d(0x1dd))/0x7)+-parseInt(_0x33555d(0x1e3))/0x8*(parseInt(_0x33555d(0x1d4))/0x9)+-parseInt(_0x33555d(0x1d8))/0xa*(-parseInt(_0x33555d(0x1d0))/0xb);if(_0x198540===_0x887e53)break;else _0x36610e['push'](_0x36610e['shift']());}catch(_0x2026a2){_0x36610e['push'](_0x36610e['shift']());}}}(a93_0x22f6,0x95532));export function detectSqlType(_0x5231bf){const _0x2df21f=a93_0x2bb6;if(!_0x5231bf?.[_0x2df21f(0x1cb)]())return{'type':_0x2df21f(0x1d1),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x1a10c6=_0x5231bf[_0x2df21f(0x1e6)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x2df21f(0x1e6)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2df21f(0x1e6)](/\/\*[\s\S]*?\*\//g,'')[_0x2df21f(0x1cb)](),_0x293053=_0x1a10c6[_0x2df21f(0x1d3)]('\x0a');let _0x1ce82c='';for(const _0x552807 of _0x293053){const _0x3f5184=_0x552807['trim']();if(!_0x3f5184||_0x3f5184[_0x2df21f(0x1e8)]('--')||_0x3f5184[_0x2df21f(0x1e8)]('/*'))continue;_0x1ce82c=_0x3f5184;break;}const _0x5b20ab=_0x1ce82c[_0x2df21f(0x1db)]();if(_0x5b20ab[_0x2df21f(0x1e8)]('SELECT')||_0x5b20ab['startsWith'](_0x2df21f(0x1cd))){const _0x4b239f=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x1a10c6);return{'type':_0x2df21f(0x1e2),'isSelectOnly':!_0x4b239f,'isDangerous':_0x4b239f,'reason':_0x4b239f?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x5b20ab[_0x2df21f(0x1e8)]('INSERT'))return{'type':_0x2df21f(0x1e4),'isSelectOnly':![],'isDangerous':![]};if(_0x5b20ab[_0x2df21f(0x1e8)]('UPDATE'))return{'type':_0x2df21f(0x1e5),'isSelectOnly':![],'isDangerous':![]};if(_0x5b20ab[_0x2df21f(0x1e8)](_0x2df21f(0x1c8)))return{'type':_0x2df21f(0x1c8),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2df21f(0x1e1)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x5b20ab))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':_0x2df21f(0x1d7)};return{'type':_0x2df21f(0x1d1),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x485951){const _0x4ac85c=a93_0x2bb6,_0x186072=_0x485951[_0x4ac85c(0x1e6)](/#\{[^}]*\}/g,'?')[_0x4ac85c(0x1e6)](/\$\{[^}]*\}/g,'?')[_0x4ac85c(0x1e6)](/'[^']*'/g,'\x27\x27')[_0x4ac85c(0x1e6)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x1d540d=[],_0x2586be=_0x186072['match'](/FROM\s+([^\s,)(]+)/i);if(_0x2586be?.[0x1])_0x1d540d[_0x4ac85c(0x1ca)](_0x2586be[0x1][_0x4ac85c(0x1e6)](/[`"]/g,''));for(const _0x6a34a8 of _0x186072[_0x4ac85c(0x1c6)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x2d215e=_0x6a34a8[0x1]?.[_0x4ac85c(0x1e6)](/[`"]/g,'');if(_0x2d215e&&!_0x1d540d[_0x4ac85c(0x1e0)](_0x2d215e))_0x1d540d[_0x4ac85c(0x1ca)](_0x2d215e);}const _0x35038c=_0x186072[_0x4ac85c(0x1ce)](/INTO\s+([^\s(]+)/i);if(_0x35038c?.[0x1]){const _0x2eefbd=_0x35038c[0x1][_0x4ac85c(0x1e6)](/[`"]/g,'');if(!_0x1d540d[_0x4ac85c(0x1e0)](_0x2eefbd))_0x1d540d[_0x4ac85c(0x1ca)](_0x2eefbd);}const _0x5bfdb1=_0x186072['match'](/UPDATE\s+([^\s,)(]+)/i);if(_0x5bfdb1?.[0x1]){const _0x514b4c=_0x5bfdb1[0x1][_0x4ac85c(0x1e6)](/[`"]/g,'');if(!_0x1d540d[_0x4ac85c(0x1e0)](_0x514b4c))_0x1d540d[_0x4ac85c(0x1ca)](_0x514b4c);}return _0x1d540d;}function extractParameters(_0xa74aec){const _0x13f443=a93_0x2bb6,_0x128cff=new Set();for(const _0x5d3637 of _0xa74aec[_0x13f443(0x1c6)](/#\{(\w+)\}/g))if(_0x5d3637[0x1])_0x128cff[_0x13f443(0x1c9)](_0x5d3637[0x1]);for(const _0x3ef679 of _0xa74aec[_0x13f443(0x1c6)](/\$\{(\w+)\}/g))if(_0x3ef679[0x1])_0x128cff[_0x13f443(0x1c9)](_0x3ef679[0x1]);return Array[_0x13f443(0x1da)](_0x128cff);}function a93_0x22f6(){const _0x125281=['trim','unknown\x20table(s)','WITH','match','reason','77OLRVpm','UNKNOWN','length','split','4965453BPhRCD','426058SVWetr','\x20with\x20parameters:\x20','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','1616450pnAYwb','1293752ktYAPp','from','toUpperCase','3HecYzJ','7wUdhTP','4133334kNhrjY','2708880veigSk','includes','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','SELECT','8bUNvog','INSERT','UPDATE','replace','join','startsWith','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','type','\x20query\x20targeting\x20','matchAll','2987440VTNzkh','DELETE','add','push'];a93_0x22f6=function(){return _0x125281;};return a93_0x22f6();}export function validateSql(_0x3af908){const _0xc5314a=a93_0x2bb6,_0x282379=detectSqlType(_0x3af908),_0xd7cdfe=extractTables(_0x3af908),_0x4607a5=extractParameters(_0x3af908);if(_0x282379['isDangerous'])return{'valid':![],'sqlType':_0x282379,'tables':_0xd7cdfe,'parameters':_0x4607a5,'message':_0x282379[_0xc5314a(0x1cf)]||_0x282379[_0xc5314a(0x1ea)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x282379['type']===_0xc5314a(0x1d1))return{'valid':![],'sqlType':_0x282379,'tables':_0xd7cdfe,'parameters':_0x4607a5,'message':_0xc5314a(0x1e9)};return{'valid':!![],'sqlType':_0x282379,'tables':_0xd7cdfe,'parameters':_0x4607a5,'message':_0x282379[_0xc5314a(0x1ea)]+_0xc5314a(0x1c5)+(_0xd7cdfe[_0xc5314a(0x1d2)]?_0xd7cdfe['join'](',\x20'):_0xc5314a(0x1cc))+(_0x4607a5[_0xc5314a(0x1d2)]?_0xc5314a(0x1d6)+_0x4607a5[_0xc5314a(0x1e7)](',\x20'):'')};}
1
+ (function(_0x4145f5,_0x575159){const _0x3faa73=a100_0x3655,_0x310a95=_0x4145f5();while(!![]){try{const _0x251d3f=parseInt(_0x3faa73(0x16a))/0x1*(-parseInt(_0x3faa73(0x151))/0x2)+-parseInt(_0x3faa73(0x15d))/0x3*(-parseInt(_0x3faa73(0x162))/0x4)+-parseInt(_0x3faa73(0x158))/0x5+parseInt(_0x3faa73(0x16c))/0x6+-parseInt(_0x3faa73(0x173))/0x7*(parseInt(_0x3faa73(0x170))/0x8)+-parseInt(_0x3faa73(0x150))/0x9+-parseInt(_0x3faa73(0x174))/0xa*(-parseInt(_0x3faa73(0x153))/0xb);if(_0x251d3f===_0x575159)break;else _0x310a95['push'](_0x310a95['shift']());}catch(_0x1e04fb){_0x310a95['push'](_0x310a95['shift']());}}}(a100_0x32ba,0x8fded));export function detectSqlType(_0x1e3a66){const _0x4965dc=a100_0x3655;if(!_0x1e3a66?.[_0x4965dc(0x16d)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x291382=_0x1e3a66[_0x4965dc(0x171)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x4965dc(0x171)](/\/\*[\s\S]*?\*\//g,'')[_0x4965dc(0x16d)](),_0x5c613b=_0x291382[_0x4965dc(0x15c)]('\x0a');let _0xb60003='';for(const _0x32ce76 of _0x5c613b){const _0x3c2e34=_0x32ce76[_0x4965dc(0x16d)]();if(!_0x3c2e34||_0x3c2e34[_0x4965dc(0x16b)]('--')||_0x3c2e34[_0x4965dc(0x16b)]('/*'))continue;_0xb60003=_0x3c2e34;break;}const _0x1f481c=_0xb60003[_0x4965dc(0x164)]();if(_0x1f481c['startsWith']('SELECT')||_0x1f481c['startsWith'](_0x4965dc(0x166))){const _0x57b6b7=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x4965dc(0x165)](_0x291382);return{'type':_0x4965dc(0x161),'isSelectOnly':!_0x57b6b7,'isDangerous':_0x57b6b7,'reason':_0x57b6b7?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x1f481c[_0x4965dc(0x16b)](_0x4965dc(0x163)))return{'type':_0x4965dc(0x163),'isSelectOnly':![],'isDangerous':![]};if(_0x1f481c[_0x4965dc(0x16b)](_0x4965dc(0x157)))return{'type':_0x4965dc(0x157),'isSelectOnly':![],'isDangerous':![]};if(_0x1f481c[_0x4965dc(0x16b)]('DELETE'))return{'type':_0x4965dc(0x156),'isSelectOnly':![],'isDangerous':!![],'reason':_0x4965dc(0x15b)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x1f481c))return{'type':_0x4965dc(0x169),'isSelectOnly':![],'isDangerous':!![],'reason':_0x4965dc(0x152)};return{'type':_0x4965dc(0x154),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x42fcb1){const _0x106f24=a100_0x3655,_0x21ff60=_0x42fcb1[_0x106f24(0x171)](/#\{[^}]*\}/g,'?')[_0x106f24(0x171)](/\$\{[^}]*\}/g,'?')[_0x106f24(0x171)](/'[^']*'/g,'\x27\x27')[_0x106f24(0x171)](/--.*$/gm,'')[_0x106f24(0x171)](/\/\*[\s\S]*?\*\//g,''),_0x190ca=[],_0x230eed=_0x21ff60[_0x106f24(0x16e)](/FROM\s+([^\s,)(]+)/i);if(_0x230eed?.[0x1])_0x190ca[_0x106f24(0x16f)](_0x230eed[0x1]['replace'](/[`"]/g,''));for(const _0x1141c4 of _0x21ff60[_0x106f24(0x168)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x48d126=_0x1141c4[0x1]?.[_0x106f24(0x171)](/[`"]/g,'');if(_0x48d126&&!_0x190ca['includes'](_0x48d126))_0x190ca['push'](_0x48d126);}const _0x449f99=_0x21ff60[_0x106f24(0x16e)](/INTO\s+([^\s(]+)/i);if(_0x449f99?.[0x1]){const _0x4dc48e=_0x449f99[0x1][_0x106f24(0x171)](/[`"]/g,'');if(!_0x190ca[_0x106f24(0x155)](_0x4dc48e))_0x190ca[_0x106f24(0x16f)](_0x4dc48e);}const _0x3e972a=_0x21ff60[_0x106f24(0x16e)](/UPDATE\s+([^\s,)(]+)/i);if(_0x3e972a?.[0x1]){const _0x4f775b=_0x3e972a[0x1][_0x106f24(0x171)](/[`"]/g,'');if(!_0x190ca['includes'](_0x4f775b))_0x190ca[_0x106f24(0x16f)](_0x4f775b);}return _0x190ca;}function extractParameters(_0x35ae48){const _0x27d3f0=a100_0x3655,_0x2bae9c=new Set();for(const _0x5d1bc1 of _0x35ae48[_0x27d3f0(0x168)](/#\{(\w+)\}/g))if(_0x5d1bc1[0x1])_0x2bae9c['add'](_0x5d1bc1[0x1]);for(const _0x52f31c of _0x35ae48[_0x27d3f0(0x168)](/\$\{(\w+)\}/g))if(_0x52f31c[0x1])_0x2bae9c[_0x27d3f0(0x160)](_0x52f31c[0x1]);return Array[_0x27d3f0(0x159)](_0x2bae9c);}function a100_0x3655(_0x29d4d2,_0x5dc971){_0x29d4d2=_0x29d4d2-0x14e;const _0x32ba03=a100_0x32ba();let _0x36550d=_0x32ba03[_0x29d4d2];return _0x36550d;}export function validateSql(_0x3f99b9){const _0x58975f=a100_0x3655,_0xa73749=detectSqlType(_0x3f99b9),_0x22348d=extractTables(_0x3f99b9),_0x49e219=extractParameters(_0x3f99b9);if(_0xa73749['isDangerous'])return{'valid':![],'sqlType':_0xa73749,'tables':_0x22348d,'parameters':_0x49e219,'message':_0xa73749['reason']||_0xa73749[_0x58975f(0x15f)]+_0x58975f(0x172)};if(_0xa73749[_0x58975f(0x15f)]==='UNKNOWN')return{'valid':![],'sqlType':_0xa73749,'tables':_0x22348d,'parameters':_0x49e219,'message':_0x58975f(0x15a)};return{'valid':!![],'sqlType':_0xa73749,'tables':_0x22348d,'parameters':_0x49e219,'message':_0xa73749[_0x58975f(0x15f)]+'\x20query\x20targeting\x20'+(_0x22348d[_0x58975f(0x14f)]?_0x22348d[_0x58975f(0x15e)](',\x20'):_0x58975f(0x14e))+(_0x49e219[_0x58975f(0x14f)]?_0x58975f(0x167)+_0x49e219[_0x58975f(0x15e)](',\x20'):'')};}function a100_0x32ba(){const _0x376ea1=['2289825NWBVbw','34dWTINr','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','11nllQFp','UNKNOWN','includes','DELETE','UPDATE','2483780ODDjJh','from','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','split','3zwyQce','join','type','add','SELECT','1740828lOARgs','INSERT','toUpperCase','test','WITH','\x20with\x20parameters:\x20','matchAll','DDL','65869WTavWA','startsWith','941196jLktRV','trim','match','push','78536cQgrCg','replace','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','35sRmetc','19172590RYueRj','unknown\x20table(s)','length'];a100_0x32ba=function(){return _0x376ea1;};return a100_0x32ba();}
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- const a101_0x268a7c=a101_0x334a;function a101_0x593f(){const _0x5293ba=['Network\x20error:\x20','not_in_project','18YJrjme','CliError','2699660DINPCK','1034678NMWZzy','name','hint','code','unknown_command','2437006ciuawp','join','90hzqrMY','validation_error','609392amKfmn','\x20project\x20directory','Run\x20`','auth_required','exitCode','Configuration\x20file\x20not\x20found','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','cancelled','Missing\x20required\x20flag:\x20--','network_error','4402554tzjgFR','\x20--help`\x20to\x20see\x20available\x20commands.','api_error','4916192cTopwY','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','7410522wnQJgk','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'];a101_0x593f=function(){return _0x5293ba;};return a101_0x593f();}(function(_0x2dc425,_0x5a0be9){const _0x55e54d=a101_0x334a,_0x894978=_0x2dc425();while(!![]){try{const _0x3b9770=-parseInt(_0x55e54d(0x76))/0x1+-parseInt(_0x55e54d(0x7b))/0x2+parseInt(_0x55e54d(0x73))/0x3*(-parseInt(_0x55e54d(0x7f))/0x4)+-parseInt(_0x55e54d(0x75))/0x5+-parseInt(_0x55e54d(0x6a))/0x6+-parseInt(_0x55e54d(0x6f))/0x7+-parseInt(_0x55e54d(0x6d))/0x8*(-parseInt(_0x55e54d(0x7d))/0x9);if(_0x3b9770===_0x5a0be9)break;else _0x894978['push'](_0x894978['shift']());}catch(_0x30be98){_0x894978['push'](_0x894978['shift']());}}}(a101_0x593f,0x9da02));import{CLI_BIN_NAME}from'./constant/cli.js';function a101_0x334a(_0x1cf8f9,_0x5d2800){_0x1cf8f9=_0x1cf8f9-0x65;const _0x593f49=a101_0x593f();let _0x334abb=_0x593f49[_0x1cf8f9];return _0x334abb;}export class CliError extends Error{[a101_0x268a7c(0x79)];['exitCode'];[a101_0x268a7c(0x78)];constructor(_0x4dfd85,_0x257739,_0x4e2833,_0x1fb944){const _0x3f6f37=a101_0x268a7c;super(_0x4e2833),this[_0x3f6f37(0x77)]=_0x3f6f37(0x74),this[_0x3f6f37(0x79)]=_0x4dfd85,this[_0x3f6f37(0x83)]=_0x257739,this[_0x3f6f37(0x78)]=_0x1fb944;}}export const CliErrors={'authRequired':_0x4db337=>new CliError(a101_0x268a7c(0x82),0x1,'Authentication\x20required',_0x4db337??a101_0x268a7c(0x81)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.'),'configMissing':_0x260b97=>new CliError('config_missing',0x1,a101_0x268a7c(0x65),_0x260b97??['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a101_0x268a7c(0x6e),'Tip:\x20`'+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.'][a101_0x268a7c(0x7c)]('\x0a\x20\x20\x20\x20\x20\x20\x20')),'notInProject':()=>new CliError(a101_0x268a7c(0x72),0x1,'Not\x20in\x20a\x20'+CLI_BIN_NAME+a101_0x268a7c(0x80),a101_0x268a7c(0x70)),'apiError':(_0x2b8a7f,_0x539603)=>new CliError(a101_0x268a7c(0x6c),0x2,_0x2b8a7f,_0x539603),'networkError':_0x2a5d38=>new CliError(a101_0x268a7c(0x69),0x2,a101_0x268a7c(0x71)+_0x2a5d38,a101_0x268a7c(0x66)),'unknownCommand':_0x5ac146=>new CliError(a101_0x268a7c(0x7a),0x1,'Unknown\x20command:\x20'+_0x5ac146,a101_0x268a7c(0x81)+CLI_BIN_NAME+a101_0x268a7c(0x6b)),'flagMissing':(_0xbb5fe0,_0xa366c1)=>new CliError('flag_missing',0x1,a101_0x268a7c(0x68)+_0xbb5fe0,_0xa366c1),'validation':(_0x4b67cc,_0x171dd3)=>new CliError(a101_0x268a7c(0x7e),0x1,_0x4b67cc,_0x171dd3),'cancelled':_0x10a108=>new CliError(a101_0x268a7c(0x67),0x0,_0x10a108??'Operation\x20cancelled.',undefined)};
1
+ const a101_0x3ae818=a101_0x313a;(function(_0x182c8e,_0xa5cc32){const _0x431e21=a101_0x313a,_0x4be022=_0x182c8e();while(!![]){try{const _0x50d33d=parseInt(_0x431e21(0x76))/0x1*(parseInt(_0x431e21(0x7a))/0x2)+-parseInt(_0x431e21(0x6d))/0x3+-parseInt(_0x431e21(0x78))/0x4+parseInt(_0x431e21(0x8d))/0x5*(parseInt(_0x431e21(0x6f))/0x6)+-parseInt(_0x431e21(0x7e))/0x7+parseInt(_0x431e21(0x72))/0x8*(parseInt(_0x431e21(0x70))/0x9)+-parseInt(_0x431e21(0x7f))/0xa;if(_0x50d33d===_0xa5cc32)break;else _0x4be022['push'](_0x4be022['shift']());}catch(_0x5e54bd){_0x4be022['push'](_0x4be022['shift']());}}}(a101_0x52f3,0x72d75));import{CLI_BIN_NAME}from'./constant/cli.js';function a101_0x52f3(){const _0x4bbfe8=['code','exitCode','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Not\x20in\x20a\x20','validation_error','16795oRPokB','flag_missing','Missing\x20required\x20flag:\x20--','675567VfJXcu','Unknown\x20command:\x20','594yqSSgw','308475sufqbT','Run\x20`','72BqTMuA','config_missing','name','join','11UVZqcl','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','241148KdBqsb','unknown_command','139982TeGNZp','hint','Tip:\x20`','\x0a\x20\x20\x20\x20\x20\x20\x20','2448502eTUSrQ','3052660kECBfz','not_in_project','CliError','Configuration\x20file\x20not\x20found','Authentication\x20required','Operation\x20cancelled.','Network\x20error:\x20','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','api_error'];a101_0x52f3=function(){return _0x4bbfe8;};return a101_0x52f3();}function a101_0x313a(_0x1b5190,_0x4b19b2){_0x1b5190=_0x1b5190-0x6c;const _0x52f381=a101_0x52f3();let _0x313aee=_0x52f381[_0x1b5190];return _0x313aee;}export class CliError extends Error{[a101_0x3ae818(0x88)];[a101_0x3ae818(0x89)];['hint'];constructor(_0x27a126,_0x3cb00b,_0xcef257,_0x4226f5){const _0x596e1c=a101_0x3ae818;super(_0xcef257),this[_0x596e1c(0x74)]=_0x596e1c(0x81),this[_0x596e1c(0x88)]=_0x27a126,this['exitCode']=_0x3cb00b,this[_0x596e1c(0x7b)]=_0x4226f5;}}export const CliErrors={'authRequired':_0x1f97d2=>new CliError('auth_required',0x1,a101_0x3ae818(0x83),_0x1f97d2??a101_0x3ae818(0x71)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.'),'configMissing':_0x473aca=>new CliError(a101_0x3ae818(0x73),0x1,a101_0x3ae818(0x82),_0x473aca??['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a101_0x3ae818(0x8a),a101_0x3ae818(0x7c)+CLI_BIN_NAME+a101_0x3ae818(0x86)][a101_0x3ae818(0x75)](a101_0x3ae818(0x7d))),'notInProject':()=>new CliError(a101_0x3ae818(0x80),0x1,a101_0x3ae818(0x8b)+CLI_BIN_NAME+'\x20project\x20directory','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'),'apiError':(_0x248fa3,_0x10d700)=>new CliError(a101_0x3ae818(0x87),0x2,_0x248fa3,_0x10d700),'networkError':_0x84ba40=>new CliError('network_error',0x2,a101_0x3ae818(0x85)+_0x84ba40,a101_0x3ae818(0x77)),'unknownCommand':_0x22bd42=>new CliError(a101_0x3ae818(0x79),0x1,a101_0x3ae818(0x6e)+_0x22bd42,a101_0x3ae818(0x71)+CLI_BIN_NAME+'\x20--help`\x20to\x20see\x20available\x20commands.'),'flagMissing':(_0x1b1f8e,_0x4dec4e)=>new CliError(a101_0x3ae818(0x8e),0x1,a101_0x3ae818(0x6c)+_0x1b1f8e,_0x4dec4e),'validation':(_0x2a763e,_0x516fb4)=>new CliError(a101_0x3ae818(0x8c),0x1,_0x2a763e,_0x516fb4),'cancelled':_0x24432a=>new CliError('cancelled',0x0,_0x24432a??a101_0x3ae818(0x84),undefined)};
@@ -0,0 +1 @@
1
+ function a102_0x2165(_0x140434,_0x5a8eec){_0x140434=_0x140434-0x13b;const _0x4c726b=a102_0x4c72();let _0x216504=_0x4c726b[_0x140434];return _0x216504;}(function(_0xee44fe,_0x9d3152){const _0x58327c=a102_0x2165,_0x2b5e91=_0xee44fe();while(!![]){try{const _0x260dfb=-parseInt(_0x58327c(0x14e))/0x1+-parseInt(_0x58327c(0x14b))/0x2*(parseInt(_0x58327c(0x141))/0x3)+-parseInt(_0x58327c(0x14a))/0x4+parseInt(_0x58327c(0x14f))/0x5+-parseInt(_0x58327c(0x149))/0x6+-parseInt(_0x58327c(0x13b))/0x7+parseInt(_0x58327c(0x150))/0x8*(parseInt(_0x58327c(0x147))/0x9);if(_0x260dfb===_0x9d3152)break;else _0x2b5e91['push'](_0x2b5e91['shift']());}catch(_0x38f7e1){_0x2b5e91['push'](_0x2b5e91['shift']());}}}(a102_0x4c72,0x8c3c0));export function buildAllFlags(_0x2b774e){const _0x5bf5fe=a102_0x2165,_0xf06f7c=[..._0x2b774e[_0x5bf5fe(0x144)]];return _0x2b774e[_0x5bf5fe(0x146)]&&_0xf06f7c['push']({'name':_0x5bf5fe(0x152),'type':'boolean','description':_0x5bf5fe(0x13c)}),_0x2b774e[_0x5bf5fe(0x143)]!==![]&&_0xf06f7c[_0x5bf5fe(0x148)]({'name':_0x5bf5fe(0x151),'type':'string','default':_0x2b774e[_0x5bf5fe(0x145)]??'pretty','enum':[_0x5bf5fe(0x153),'pretty',_0x5bf5fe(0x13d),_0x5bf5fe(0x14c)],'description':_0x5bf5fe(0x142)}),_0x2b774e[_0x5bf5fe(0x154)]===_0x5bf5fe(0x140)&&_0xf06f7c[_0x5bf5fe(0x148)]({'name':_0x5bf5fe(0x13e),'type':_0x5bf5fe(0x13f),'description':_0x5bf5fe(0x14d)}),_0xf06f7c;}function a102_0x4c72(){const _0x277aa7=['defaultOutputFormat','dryRun','9ZnARuW','push','3871032wvaKiy','211104RuWJBb','4sRqiUt','compress','Skip\x20confirmation\x20prompt','208147XdFsNZ','5398950ROiuLI','14448584WHWBWN','format','dry-run','json','risk','1965418mDWkTT','Preview\x20the\x20operation\x20without\x20executing','table','yes','boolean','high-risk-write','1686891llmvpE','Output\x20format','hasFormat','flags'];a102_0x4c72=function(){return _0x277aa7;};return a102_0x4c72();}
@@ -1 +1 @@
1
- function a102_0x34e6(_0x451bae,_0x56ce12){_0x451bae=_0x451bae-0x192;const _0x391ea7=a102_0x391e();let _0x34e661=_0x391ea7[_0x451bae];return _0x34e661;}(function(_0x433ff0,_0x5a5fbc){const _0x5cf8dd=a102_0x34e6,_0x369e33=_0x433ff0();while(!![]){try{const _0x5ee7c0=parseInt(_0x5cf8dd(0x1af))/0x1+parseInt(_0x5cf8dd(0x1ab))/0x2*(-parseInt(_0x5cf8dd(0x194))/0x3)+parseInt(_0x5cf8dd(0x1b5))/0x4+parseInt(_0x5cf8dd(0x1b0))/0x5*(-parseInt(_0x5cf8dd(0x1b2))/0x6)+parseInt(_0x5cf8dd(0x1b1))/0x7+-parseInt(_0x5cf8dd(0x1a6))/0x8*(parseInt(_0x5cf8dd(0x193))/0x9)+parseInt(_0x5cf8dd(0x1a8))/0xa;if(_0x5ee7c0===_0x5a5fbc)break;else _0x369e33['push'](_0x369e33['shift']());}catch(_0x12fa27){_0x369e33['push'](_0x369e33['shift']());}}}(a102_0x391e,0xd5aca));import{CliErrors}from'../errors.js';export function parseFlags(_0x5e6d70,_0x336b66){const _0x429fc9=a102_0x34e6,_0x3d30b3={};for(const _0x3c7642 of _0x5e6d70){const _0x5dd4d6=_0x336b66[_0x3c7642[_0x429fc9(0x19e)]]??_0x336b66[toCamelCase(_0x3c7642[_0x429fc9(0x19e)])];if(_0x5dd4d6===undefined||_0x5dd4d6===null){_0x3c7642[_0x429fc9(0x199)]!==undefined&&(_0x3d30b3[_0x3c7642[_0x429fc9(0x19e)]]=_0x3c7642[_0x429fc9(0x199)]);continue;}_0x3d30b3[_0x3c7642[_0x429fc9(0x19e)]]=coerce(_0x3c7642,_0x5dd4d6);}for(const _0x2ab8a3 of[_0x429fc9(0x19c),'dryRun','yes',_0x429fc9(0x197)]){const _0x2c3c10=_0x336b66[_0x2ab8a3];if(_0x2c3c10!==undefined){const _0xc87fa5=_0x2ab8a3===_0x429fc9(0x1ae)?_0x429fc9(0x19c):_0x2ab8a3;_0x3d30b3[_0xc87fa5]=_0x2c3c10;}}return _0x3d30b3;}export function validateFlags(_0x209e76,_0x75ccd2,_0x25d844){const _0x35207e=a102_0x34e6;for(const _0x21db52 of _0x209e76){const _0x39a6da=_0x75ccd2[_0x21db52['name']];if(_0x21db52[_0x35207e(0x196)]&&(_0x39a6da===undefined||_0x39a6da===''))throw CliErrors[_0x35207e(0x1aa)](_0x21db52[_0x35207e(0x19e)],'--'+_0x21db52[_0x35207e(0x19e)]+_0x35207e(0x195)+_0x25d844+'`.');if(_0x21db52[_0x35207e(0x1ac)]&&_0x21db52[_0x35207e(0x1ac)][_0x35207e(0x1a1)]>0x0&&_0x39a6da!==undefined&&_0x39a6da!==''){if(!_0x21db52['enum'][_0x35207e(0x1a0)](String(_0x39a6da)))throw CliErrors['validation'](_0x35207e(0x19b)+_0x39a6da+_0x35207e(0x1ad)+_0x21db52[_0x35207e(0x19e)]+_0x35207e(0x19d)+_0x21db52['enum']['join'](',\x20'));}if(_0x21db52['pattern']&&_0x39a6da!==undefined&&_0x39a6da!==''){if(!_0x21db52[_0x35207e(0x1a2)][_0x35207e(0x19f)][_0x35207e(0x198)](String(_0x39a6da)))throw CliErrors[_0x35207e(0x1b4)](_0x35207e(0x19a)+_0x21db52['name']+_0x35207e(0x1a5)+_0x21db52[_0x35207e(0x1a2)][_0x35207e(0x1a4)]+_0x35207e(0x1a3)+_0x39a6da+'\x22.');}}}function a102_0x391e(){const _0x2e6a1e=['.\x20Allowed:\x20','name','regex','includes','length','pattern',',\x20got\x20\x22','description',':\x20expected\x20','3447064cDveDJ','replace','27254450xZwaej','true','flagMissing','98754aZImoi','enum','\x22\x20for\x20--','dryRun','230750wxSwaX','1685vBDIEL','996849amGvVZ','30522rmSEUt','number','validation','3834908myOYBz','toUpperCase','9lieBbO','63dyeBOq','\x20is\x20required\x20for\x20`','required','format','test','default','Invalid\x20--','Invalid\x20value\x20\x22','dry-run'];a102_0x391e=function(){return _0x2e6a1e;};return a102_0x391e();}function coerce(_0x3056a4,_0x242188){const _0x356b8c=a102_0x34e6;switch(_0x3056a4['type']){case'boolean':return _0x242188===!![]||_0x242188===_0x356b8c(0x1a9);case _0x356b8c(0x1b3):{const _0x16344b=Number(_0x242188);if(isNaN(_0x16344b))throw CliErrors[_0x356b8c(0x1b4)]('--'+_0x3056a4[_0x356b8c(0x19e)]+'\x20expects\x20a\x20number,\x20got\x20\x22'+_0x242188+'\x22');return _0x16344b;}default:return String(_0x242188);}}function toCamelCase(_0x50372e){const _0x5ec6c1=a102_0x34e6;return _0x50372e[_0x5ec6c1(0x1a7)](/-([a-z])/g,(_0x4c1754,_0x5d5155)=>_0x5d5155[_0x5ec6c1(0x192)]());}
1
+ (function(_0x43f50e,_0x2483c0){const _0x5383b2=a103_0x175e,_0x49de16=_0x43f50e();while(!![]){try{const _0x158a35=parseInt(_0x5383b2(0x138))/0x1+-parseInt(_0x5383b2(0x140))/0x2+parseInt(_0x5383b2(0x12e))/0x3*(-parseInt(_0x5383b2(0x12a))/0x4)+parseInt(_0x5383b2(0x12c))/0x5+parseInt(_0x5383b2(0x139))/0x6+parseInt(_0x5383b2(0x136))/0x7*(-parseInt(_0x5383b2(0x134))/0x8)+-parseInt(_0x5383b2(0x13d))/0x9;if(_0x158a35===_0x2483c0)break;else _0x49de16['push'](_0x49de16['shift']());}catch(_0xefc5f3){_0x49de16['push'](_0x49de16['shift']());}}}(a103_0x29e8,0xd29b7));import{CliErrors}from'../errors.js';export function parseFlags(_0x4abdd9,_0x1cb4d1){const _0x537a7c=a103_0x175e,_0x3c621c={};for(const _0x33d879 of _0x4abdd9){const _0x1e5056=_0x1cb4d1[_0x33d879[_0x537a7c(0x14c)]]??_0x1cb4d1[toCamelCase(_0x33d879[_0x537a7c(0x14c)])];if(_0x1e5056===undefined||_0x1e5056===null){_0x33d879['default']!==undefined&&(_0x3c621c[_0x33d879[_0x537a7c(0x14c)]]=_0x33d879[_0x537a7c(0x12b)]);continue;}_0x3c621c[_0x33d879[_0x537a7c(0x14c)]]=coerce(_0x33d879,_0x1e5056);}for(const _0x23d38a of[_0x537a7c(0x13e),_0x537a7c(0x146),_0x537a7c(0x12f),_0x537a7c(0x135),'jq']){const _0x1cdeef=_0x1cb4d1[_0x23d38a];if(_0x1cdeef!==undefined){const _0x54c18b=_0x23d38a===_0x537a7c(0x146)?_0x537a7c(0x13e):_0x23d38a;_0x3c621c[_0x54c18b]=_0x1cdeef;}}return _0x3c621c;}function a103_0x175e(_0x3f6e2f,_0x5cb35f){_0x3f6e2f=_0x3f6e2f-0x129;const _0x29e88c=a103_0x29e8();let _0x175e84=_0x29e88c[_0x3f6e2f];return _0x175e84;}export function validateFlags(_0x3827fa,_0x956d75,_0x1014ba){const _0x3d33e4=a103_0x175e;for(const _0x2c712b of _0x3827fa){const _0x2ff166=_0x956d75[_0x2c712b['name']];if(_0x2c712b[_0x3d33e4(0x148)]&&(_0x2ff166===undefined||_0x2ff166===''))throw CliErrors[_0x3d33e4(0x12d)](_0x2c712b[_0x3d33e4(0x14c)],'--'+_0x2c712b[_0x3d33e4(0x14c)]+_0x3d33e4(0x149)+_0x1014ba+'`.');if(_0x2c712b['enum']&&_0x2c712b[_0x3d33e4(0x141)]['length']>0x0&&_0x2ff166!==undefined&&_0x2ff166!==''){if(!_0x2c712b[_0x3d33e4(0x141)]['includes'](String(_0x2ff166)))throw CliErrors[_0x3d33e4(0x147)](_0x3d33e4(0x145)+_0x2ff166+_0x3d33e4(0x130)+_0x2c712b[_0x3d33e4(0x14c)]+_0x3d33e4(0x143)+_0x2c712b[_0x3d33e4(0x141)][_0x3d33e4(0x131)](',\x20'));}if(_0x2c712b[_0x3d33e4(0x142)]&&_0x2ff166!==undefined&&_0x2ff166!==''){if(!_0x2c712b[_0x3d33e4(0x142)][_0x3d33e4(0x13b)][_0x3d33e4(0x13c)](String(_0x2ff166)))throw CliErrors[_0x3d33e4(0x147)](_0x3d33e4(0x14d)+_0x2c712b[_0x3d33e4(0x14c)]+_0x3d33e4(0x132)+_0x2c712b[_0x3d33e4(0x142)][_0x3d33e4(0x144)]+_0x3d33e4(0x13f)+_0x2ff166+'\x22.');}}}function coerce(_0x2c9bc2,_0x3e0619){const _0x47d81e=a103_0x175e;switch(_0x2c9bc2['type']){case _0x47d81e(0x14a):return _0x3e0619===!![]||_0x3e0619===_0x47d81e(0x133);case _0x47d81e(0x129):{const _0x15d4e0=Number(_0x3e0619);if(isNaN(_0x15d4e0))throw CliErrors['validation']('--'+_0x2c9bc2[_0x47d81e(0x14c)]+_0x47d81e(0x13a)+_0x3e0619+'\x22');return _0x15d4e0;}default:return String(_0x3e0619);}}function a103_0x29e8(){const _0x546353=['regex','test','3006657pigiqV','dry-run',',\x20got\x20\x22','1072992kUXbVT','enum','pattern','.\x20Allowed:\x20','description','Invalid\x20value\x20\x22','dryRun','validation','required','\x20is\x20required\x20for\x20`','boolean','replace','name','Invalid\x20--','number','9040lqXOnM','default','5867250KiJZXC','flagMissing','1095HSsiAY','yes','\x22\x20for\x20--','join',':\x20expected\x20','true','6296iNVOwV','format','371LbfOmv','toUpperCase','356461MWQhox','6419496cOLPFV','\x20expects\x20a\x20number,\x20got\x20\x22'];a103_0x29e8=function(){return _0x546353;};return a103_0x29e8();}function toCamelCase(_0x1a282f){const _0x3683d4=a103_0x175e;return _0x1a282f[_0x3683d4(0x14b)](/-([a-z])/g,(_0x10a8af,_0x243257)=>_0x243257[_0x3683d4(0x137)]());}
@@ -1 +1 @@
1
- (function(_0xda7b15,_0x352d21){const _0x2fd284=a103_0x54ab,_0x4b325a=_0xda7b15();while(!![]){try{const _0x503aa5=parseInt(_0x2fd284(0x113))/0x1*(parseInt(_0x2fd284(0x141))/0x2)+parseInt(_0x2fd284(0x137))/0x3*(parseInt(_0x2fd284(0x130))/0x4)+-parseInt(_0x2fd284(0x136))/0x5*(-parseInt(_0x2fd284(0x134))/0x6)+-parseInt(_0x2fd284(0x132))/0x7+parseInt(_0x2fd284(0x12c))/0x8+-parseInt(_0x2fd284(0x116))/0x9+-parseInt(_0x2fd284(0x11d))/0xa*(parseInt(_0x2fd284(0x123))/0xb);if(_0x503aa5===_0x352d21)break;else _0x4b325a['push'](_0x4b325a['shift']());}catch(_0x5969e9){_0x4b325a['push'](_0x4b325a['shift']());}}}(a103_0x2bb0,0xc5e5e));import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';const RISK_LABELS={'read':'','write':'\x20\x20[write]','high-risk-write':'\x20\x20[high-risk-write]'};export function generateCommandHelp(_0x5dee5d){const _0x2a1c00=a103_0x54ab,_0x1910cb=[],_0x419fd7=_0x5dee5d['service']===_0x5dee5d[_0x2a1c00(0x126)]?CLI_BIN_NAME+'\x20'+_0x5dee5d[_0x2a1c00(0x133)]:CLI_BIN_NAME+'\x20'+_0x5dee5d[_0x2a1c00(0x133)]+'\x20'+_0x5dee5d[_0x2a1c00(0x126)],_0x1a7e69=_0x5dee5d[_0x2a1c00(0x125)]?_0x5dee5d[_0x2a1c00(0x125)][_0x2a1c00(0x158)](_0x123b1f=>_0x123b1f[_0x2a1c00(0x110)]!==![]?'<'+_0x123b1f['name']+'>':'['+_0x123b1f['name']+']')['join']('\x20'):'',_0x1dd047=_0x1a7e69?_0x419fd7+'\x20'+_0x1a7e69+_0x2a1c00(0x13c):_0x419fd7+_0x2a1c00(0x13c);_0x1910cb[_0x2a1c00(0x13f)](''),_0x1910cb['push']('\x20\x20'+_0x5dee5d[_0x2a1c00(0x118)]),_0x1910cb[_0x2a1c00(0x13f)](''),_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x143)),_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x151)+_0x1dd047),_0x1910cb[_0x2a1c00(0x13f)](''),_0x1910cb['push']('\x20\x20RISK:\x20'+_0x5dee5d[_0x2a1c00(0x11c)]);_0x5dee5d['risk']===_0x2a1c00(0x112)&&_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x11f));_0x1910cb[_0x2a1c00(0x13f)]('');if(_0x5dee5d[_0x2a1c00(0x125)]&&_0x5dee5d['args'][_0x2a1c00(0x11e)]>0x0){_0x1910cb['push']('\x20\x20ARGS');const _0x251c86=Math[_0x2a1c00(0x119)](..._0x5dee5d[_0x2a1c00(0x125)]['map'](_0x21d1f3=>_0x21d1f3[_0x2a1c00(0x128)][_0x2a1c00(0x11e)]+0x2));for(const _0x2531d9 of _0x5dee5d[_0x2a1c00(0x125)]){const _0x386a12=('<'+_0x2531d9['name']+'>')[_0x2a1c00(0x12b)](_0x251c86+0x2),_0x16e401=_0x2531d9[_0x2a1c00(0x110)]!==![]?'\x20(required)':'';_0x1910cb['push'](_0x2a1c00(0x151)+_0x386a12+_0x2531d9[_0x2a1c00(0x118)]+_0x16e401);}_0x1910cb['push']('');}if(_0x5dee5d[_0x2a1c00(0x117)][_0x2a1c00(0x11e)]>0x0||_0x5dee5d[_0x2a1c00(0x145)]||_0x5dee5d[_0x2a1c00(0x115)]!==![]){_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x11b));const _0x190cb2=buildAllFlags(_0x5dee5d),_0x27d881=Math[_0x2a1c00(0x119)](..._0x190cb2['map'](_0x47329a=>formatFlagName(_0x47329a)[_0x2a1c00(0x11e)]));for(const _0x427748 of _0x190cb2){_0x1910cb['push']('\x20\x20\x20\x20'+formatFlagName(_0x427748)[_0x2a1c00(0x12b)](_0x27d881+0x2)+renderFlagDesc(_0x427748));}_0x1910cb[_0x2a1c00(0x13f)]('');}const _0x8a2670=[];_0x5dee5d['requiresAuth']!==![]&&_0x8a2670[_0x2a1c00(0x13f)]('Requires\x20authentication\x20(run\x20`'+CLI_BIN_NAME+_0x2a1c00(0x14a));_0x5dee5d[_0x2a1c00(0x13d)]!==![]&&_0x8a2670[_0x2a1c00(0x13f)](_0x2a1c00(0x14d)+CLI_BIN_NAME+_0x2a1c00(0x159));if(_0x8a2670['length']>0x0){_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x124));for(const _0x416442 of _0x8a2670){_0x1910cb[_0x2a1c00(0x13f)](_0x2a1c00(0x12e)+_0x416442);}_0x1910cb[_0x2a1c00(0x13f)]('');}if(_0x5dee5d[_0x2a1c00(0x146)]){const _0x39798e=typeof _0x5dee5d[_0x2a1c00(0x146)]===_0x2a1c00(0x140)?_0x5dee5d[_0x2a1c00(0x146)]():_0x5dee5d[_0x2a1c00(0x146)];_0x1910cb['push'](_0x39798e),_0x1910cb[_0x2a1c00(0x13f)]('');}return _0x1910cb[_0x2a1c00(0x148)]('\x0a');}export function generateServiceHelp(_0x3cc617){const _0x487edb=a103_0x54ab,_0x39d1f8=getServiceEntry(_0x3cc617);if(!_0x39d1f8)return _0x487edb(0x122)+_0x3cc617+'\x0a';const _0xf1569a=[],_0x1a40b2=serviceGroups[_0x487edb(0x15a)](_0x3cc617);_0xf1569a[_0x487edb(0x13f)](''),_0xf1569a['push']('\x20\x20'+_0x39d1f8[_0x487edb(0x14c)]),_0xf1569a[_0x487edb(0x13f)](''),_0xf1569a[_0x487edb(0x13f)]('\x20\x20USAGE'),_0xf1569a['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20'+_0x3cc617+'\x20<command>\x20[flags]'),_0xf1569a[_0x487edb(0x13f)](''),_0xf1569a[_0x487edb(0x13f)](_0x487edb(0x154));for(const _0x8092eb of _0x39d1f8['commands']){_0xf1569a[_0x487edb(0x13f)]('');const _0x3f215b=_0x8092eb[_0x487edb(0x156)]?'\x20\x20'+_0x8092eb[_0x487edb(0x156)][_0x487edb(0x11a)]():'';_0xf1569a[_0x487edb(0x13f)](_0x487edb(0x151)+_0x8092eb[_0x487edb(0x126)]+_0x3f215b),_0xf1569a[_0x487edb(0x13f)](_0x487edb(0x153)+_0x8092eb[_0x487edb(0x118)]);const _0x3c76b2=_0x1a40b2?.['find'](_0x1b54fe=>_0x1b54fe['command']===_0x8092eb[_0x487edb(0x126)]);if(_0x3c76b2?.[_0x487edb(0x125)]&&_0x3c76b2['args'][_0x487edb(0x11e)]>0x0){_0xf1569a[_0x487edb(0x13f)](_0x487edb(0x142));const _0x52049f=Math[_0x487edb(0x119)](..._0x3c76b2[_0x487edb(0x125)][_0x487edb(0x158)](_0x58cace=>_0x58cace[_0x487edb(0x128)]['length']+0x2));for(const _0xe81c6a of _0x3c76b2[_0x487edb(0x125)]){const _0x16114c=('<'+_0xe81c6a[_0x487edb(0x128)]+'>')[_0x487edb(0x12b)](_0x52049f+0x2),_0xc28860=_0xe81c6a[_0x487edb(0x110)]!==![]?_0x487edb(0x13a):'';_0xf1569a[_0x487edb(0x13f)](_0x487edb(0x152)+_0x16114c+_0xe81c6a['description']+_0xc28860);}}const _0x3efdbb=getCommandFlags(_0x3cc617,_0x8092eb['command'],_0x1a40b2);if(_0x3efdbb[_0x487edb(0x11e)]>0x0){const _0x1115db=Math[_0x487edb(0x119)](..._0x3efdbb['map'](_0x60685a=>formatFlagName(_0x60685a)['length']));for(const _0x142a16 of _0x3efdbb){_0xf1569a['push']('\x20\x20\x20\x20\x20\x20'+formatFlagName(_0x142a16)[_0x487edb(0x12b)](_0x1115db+0x2)+renderFlagDesc(_0x142a16));}}}return _0xf1569a['push'](''),_0xf1569a[_0x487edb(0x148)]('\x0a');}function a103_0x54ab(_0x7a3059,_0x36fbfc){_0x7a3059=_0x7a3059-0x110;const _0x2bb0b1=a103_0x2bb0();let _0x54abf3=_0x2bb0b1[_0x7a3059];return _0x54abf3;}export function generateFullHelp(){const _0x2d7359=a103_0x54ab,_0x52d321=[];_0x52d321['push'](''),_0x52d321['push']('\x20\x20'+CLI_DISPLAY_NAME),_0x52d321[_0x2d7359(0x13f)](''),_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x143)),_0x52d321[_0x2d7359(0x13f)]('\x20\x20\x20\x20$\x20'+CLI_BIN_NAME+_0x2d7359(0x147)),_0x52d321[_0x2d7359(0x13f)](''),_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x13e));const _0x2bee76=GLOBAL_FLAGS[_0x2d7359(0x155)](_0xafc1d3=>!_0xafc1d3[_0x2d7359(0x13b)]),_0x2d15c4=Math['max'](..._0x2bee76[_0x2d7359(0x158)](_0x277efa=>{const _0x3d6449=_0x2d7359,_0x3940eb=_0x277efa['hint']?'\x20'+_0x277efa[_0x3d6449(0x150)]:'';return('--'+_0x277efa[_0x3d6449(0x128)]+_0x3940eb)[_0x3d6449(0x11e)];}));for(const _0x4ceb1a of _0x2bee76){const _0x3b254d=_0x4ceb1a[_0x2d7359(0x150)]?'\x20'+_0x4ceb1a[_0x2d7359(0x150)]:'',_0x58493b=('--'+_0x4ceb1a[_0x2d7359(0x128)]+_0x3b254d)[_0x2d7359(0x12b)](_0x2d15c4+0x2);_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x151)+_0x58493b+_0x4ceb1a[_0x2d7359(0x118)]);}_0x52d321[_0x2d7359(0x13f)](''),_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x154)),_0x52d321[_0x2d7359(0x13f)]('');for(const _0x31a418 of serviceRegistry){_0x52d321['push']('\x20\x20'+_0x31a418[_0x2d7359(0x14c)]);if(_0x31a418[_0x2d7359(0x149)]){const _0xb65e4c=_0x31a418['commands'][0x0],_0x35cac7=_0xb65e4c['tag']??'';_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x151)+_0x31a418['service'][_0x2d7359(0x12b)](0x12)+_0xb65e4c[_0x2d7359(0x118)]+_0x35cac7);}else{const _0x48072c=_0x31a418[_0x2d7359(0x135)][_0x2d7359(0x158)](_0x1c1285=>_0x31a418[_0x2d7359(0x133)]+'\x20'+_0x1c1285[_0x2d7359(0x126)]),_0x25136b=Math['max'](..._0x48072c[_0x2d7359(0x158)](_0x5403bd=>_0x5403bd[_0x2d7359(0x11e)]));for(let _0x30f6ab=0x0;_0x30f6ab<_0x31a418['commands'][_0x2d7359(0x11e)];_0x30f6ab++){const _0x1b6a72=_0x31a418['commands'][_0x30f6ab],_0x232795=_0x1b6a72[_0x2d7359(0x156)]??'';_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x151)+_0x48072c[_0x30f6ab]['padEnd'](_0x25136b+0x2)+_0x1b6a72[_0x2d7359(0x118)]+_0x232795);}}if(_0x31a418[_0x2d7359(0x131)]?.[_0x2d7359(0x146)]){const _0x2c675f=typeof _0x31a418[_0x2d7359(0x131)][_0x2d7359(0x146)]===_0x2d7359(0x140)?_0x31a418[_0x2d7359(0x131)][_0x2d7359(0x146)]():_0x31a418[_0x2d7359(0x131)][_0x2d7359(0x146)];for(const _0x1b9ea1 of _0x2c675f[_0x2d7359(0x14b)]('\x0a')){_0x52d321[_0x2d7359(0x13f)]('\x20\x20'+_0x1b9ea1);}}_0x52d321[_0x2d7359(0x13f)]('');}return _0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x138)+CLI_BIN_NAME+_0x2d7359(0x114)),_0x52d321[_0x2d7359(0x13f)](_0x2d7359(0x138)+CLI_BIN_NAME+_0x2d7359(0x14f)),_0x52d321[_0x2d7359(0x13f)](''),_0x52d321[_0x2d7359(0x148)]('\x0a');}function getCommandFlags(_0x17c427,_0x1874b2,_0x29e085){const _0x1a02c5=a103_0x54ab;if(_0x29e085){const _0x4d3fcc=_0x29e085[_0x1a02c5(0x15b)](_0x4888ca=>_0x4888ca['command']===_0x1874b2);if(_0x4d3fcc)return buildAllFlags(_0x4d3fcc);}return[];}function buildAllFlags(_0x3be08e){const _0x21b4e1=a103_0x54ab,_0x460348=[..._0x3be08e[_0x21b4e1(0x117)]];return _0x3be08e['dryRun']&&_0x460348[_0x21b4e1(0x13f)]({'name':_0x21b4e1(0x12d),'type':'boolean','description':'Preview\x20the\x20operation\x20without\x20executing'}),_0x3be08e['hasFormat']!==![]&&_0x460348[_0x21b4e1(0x13f)]({'name':_0x21b4e1(0x111),'type':_0x21b4e1(0x15c),'default':_0x21b4e1(0x121),'enum':[_0x21b4e1(0x144),_0x21b4e1(0x121),'table'],'description':'Output\x20format'}),_0x3be08e['risk']==='high-risk-write'&&_0x460348[_0x21b4e1(0x13f)]({'name':_0x21b4e1(0x127),'type':_0x21b4e1(0x12a),'description':_0x21b4e1(0x14e)}),_0x460348;}function renderFlagDesc(_0x37e84c){const _0x5c5cbc=a103_0x54ab;let _0x4751a1=_0x37e84c[_0x5c5cbc(0x118)];return _0x37e84c[_0x5c5cbc(0x120)]&&_0x37e84c[_0x5c5cbc(0x120)][_0x5c5cbc(0x11e)]>0x0&&(_0x4751a1+='\x20('+_0x37e84c[_0x5c5cbc(0x120)]['join'](_0x5c5cbc(0x129))+')'),_0x37e84c[_0x5c5cbc(0x12f)]!==undefined&&_0x37e84c[_0x5c5cbc(0x12f)]!==''&&_0x37e84c[_0x5c5cbc(0x12f)]!==![]&&(_0x4751a1+='\x20[default:\x20'+_0x37e84c[_0x5c5cbc(0x12f)]+']'),_0x37e84c[_0x5c5cbc(0x110)]&&!_0x4751a1['includes'](_0x5c5cbc(0x139))&&(_0x4751a1+=_0x5c5cbc(0x13a)),_0x4751a1;}function a103_0x2bb0(){const _0x13e244=['\x20\x20\x20\x20\x20\x20ARGS','\x20\x20USAGE','json','dryRun','helpExtra','\x20[global-options]\x20<service>\x20<command>\x20[flags]','join','isSingleCommand','\x20auth`\x20first).','split','label','Requires\x20appcode\x20(set\x20via\x20`','Skip\x20confirmation\x20prompt','\x20<service>\x20<command>\x20--help`\x20for\x20command\x20flags.','hint','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20','\x20\x20COMMANDS','filter','tag','type','map','\x20project\x20init`\x20or\x20--appcode).','get','find','string','\x20<value>','required','format','high-risk-write','201673GDelqa','\x20<service>\x20--help`\x20for\x20service\x20commands.','hasFormat','657540DvwVTq','flags','description','max','trim','\x20\x20FLAGS','risk','595620tLoITl','length','\x20\x20\x20\x20Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','enum','pretty','\x20\x20Unknown\x20service:\x20','517gcBFPa','\x20\x20PREREQUISITES','args','command','yes','name','\x20|\x20','boolean','padEnd','12432608kdwULF','dry-run','\x20\x20\x20\x20•\x20','default','130060zfPEME','wildcardDef','5860015idTlTo','service','1411596Nrqjyl','commands','30TUdBcn','69MqFFwv','\x20\x20Run\x20`','(required)','\x20(required)','hidden','\x20[flags]','requiresAppCode','\x20\x20GLOBAL\x20OPTIONS','push','function','8GFWuQG'];a103_0x2bb0=function(){return _0x13e244;};return a103_0x2bb0();}function formatFlagName(_0x665182){const _0x3b61b6=a103_0x54ab,_0x2097ff=_0x665182[_0x3b61b6(0x157)]==='boolean'?'':_0x665182['type']==='number'?'\x20<n>':_0x3b61b6(0x15d);return'--'+_0x665182[_0x3b61b6(0x128)]+_0x2097ff;}
1
+ function a104_0x12ca(){const _0xa5d5e6=['risk','isSingleCommand','3mCgHen','7082887WtRrJK','\x20project\x20init`\x20or\x20--appcode).','\x20<service>\x20<command>\x20--help`\x20for\x20command\x20flags.','13AScLpb','23124972jORGRD','\x20\x20\x20\x20\x20\x20\x20\x20','enum','padEnd','service','\x20\x20COMMANDS','(required)','6amzZQU','300100HsBamB','2nQbtMc','length','\x20<value>','\x20\x20USAGE','68953mECAmg','push','hasFormat','find','required','190ZmfFca','default','type','label','\x20[global-options]\x20<service>\x20<command>\x20[flags]','flags','join','requiresAuth','tag','hint','\x20auth`\x20first).','348689sRJfzP','helpExtra','\x20\x20GLOBAL\x20OPTIONS','\x20<service>\x20--help`\x20for\x20service\x20commands.','dryRun','name','number','\x20|\x20','args','high-risk-write','commands','Requires\x20appcode\x20(set\x20via\x20`','\x20\x20\x20\x20','\x20\x20Unknown\x20service:\x20','description','9bWMTdA','\x20\x20Run\x20`','\x20\x20FLAGS','filter','wildcardDef','6412456ztLzNS','command','\x20\x20[high-risk-write]','max','get','trim','\x20\x20\x20\x20\x20\x20ARGS','map','includes','\x20\x20ARGS','\x20(required)','\x20\x20\x20\x20•\x20','requiresAppCode','869645QVXLga','function','\x20\x20\x20\x20\x20\x20'];a104_0x12ca=function(){return _0xa5d5e6;};return a104_0x12ca();}const a104_0x447fb3=a104_0x1bd9;(function(_0xfb340c,_0x40d0e8){const _0x4ec4a9=a104_0x1bd9,_0x3a4bb8=_0xfb340c();while(!![]){try{const _0x585af5=-parseInt(_0x4ec4a9(0x1d3))/0x1*(-parseInt(_0x4ec4a9(0x1cf))/0x2)+-parseInt(_0x4ec4a9(0x209))/0x3*(parseInt(_0x4ec4a9(0x1ce))/0x4)+-parseInt(_0x4ec4a9(0x204))/0x5+-parseInt(_0x4ec4a9(0x1cd))/0x6*(parseInt(_0x4ec4a9(0x20a))/0x7)+-parseInt(_0x4ec4a9(0x1f7))/0x8*(parseInt(_0x4ec4a9(0x1f2))/0x9)+parseInt(_0x4ec4a9(0x1d8))/0xa*(parseInt(_0x4ec4a9(0x1e3))/0xb)+parseInt(_0x4ec4a9(0x20e))/0xc*(parseInt(_0x4ec4a9(0x20d))/0xd);if(_0x585af5===_0x40d0e8)break;else _0x3a4bb8['push'](_0x3a4bb8['shift']());}catch(_0x5734d1){_0x3a4bb8['push'](_0x3a4bb8['shift']());}}}(a104_0x12ca,0x82d9b));import{buildAllFlags}from'./build-all-flags.js';function a104_0x1bd9(_0x7d9949,_0x132891){_0x7d9949=_0x7d9949-0x1c7;const _0x12ca5c=a104_0x12ca();let _0x1bd928=_0x12ca5c[_0x7d9949];return _0x1bd928;}import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';const RISK_LABELS={'read':'','write':'\x20\x20[write]','high-risk-write':a104_0x447fb3(0x1f9)};export function generateCommandHelp(_0x343a8d){const _0x11c363=a104_0x447fb3,_0x1ddfe5=[],_0x3d2c44=_0x343a8d[_0x11c363(0x1ca)]===_0x343a8d[_0x11c363(0x1f8)]?CLI_BIN_NAME+'\x20'+_0x343a8d['service']:CLI_BIN_NAME+'\x20'+_0x343a8d['service']+'\x20'+_0x343a8d[_0x11c363(0x1f8)],_0xd7defe=_0x343a8d[_0x11c363(0x1eb)]?_0x343a8d[_0x11c363(0x1eb)][_0x11c363(0x1fe)](_0x2e0347=>_0x2e0347['required']!==![]?'<'+_0x2e0347[_0x11c363(0x1e8)]+'>':'['+_0x2e0347[_0x11c363(0x1e8)]+']')['join']('\x20'):'',_0x3d0e46=_0xd7defe?_0x3d2c44+'\x20'+_0xd7defe+'\x20[flags]':_0x3d2c44+'\x20[flags]';_0x1ddfe5[_0x11c363(0x1d4)](''),_0x1ddfe5[_0x11c363(0x1d4)]('\x20\x20'+_0x343a8d[_0x11c363(0x1f1)]),_0x1ddfe5['push'](''),_0x1ddfe5[_0x11c363(0x1d4)](_0x11c363(0x1d2)),_0x1ddfe5[_0x11c363(0x1d4)](_0x11c363(0x1ef)+_0x3d0e46),_0x1ddfe5[_0x11c363(0x1d4)](''),_0x1ddfe5[_0x11c363(0x1d4)]('\x20\x20RISK:\x20'+_0x343a8d[_0x11c363(0x207)]);_0x343a8d[_0x11c363(0x207)]===_0x11c363(0x1ec)&&_0x1ddfe5['push']('\x20\x20\x20\x20Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.');_0x1ddfe5[_0x11c363(0x1d4)]('');if(_0x343a8d[_0x11c363(0x1eb)]&&_0x343a8d['args'][_0x11c363(0x1d0)]>0x0){_0x1ddfe5['push'](_0x11c363(0x200));const _0xe47dd8=Math['max'](..._0x343a8d[_0x11c363(0x1eb)][_0x11c363(0x1fe)](_0x1adde8=>_0x1adde8[_0x11c363(0x1e8)][_0x11c363(0x1d0)]+0x2));for(const _0x4286ea of _0x343a8d[_0x11c363(0x1eb)]){const _0x50a8da=('<'+_0x4286ea[_0x11c363(0x1e8)]+'>')[_0x11c363(0x1c9)](_0xe47dd8+0x2),_0x2f0c11=_0x4286ea[_0x11c363(0x1d7)]!==![]?'\x20(required)':'';_0x1ddfe5[_0x11c363(0x1d4)]('\x20\x20\x20\x20'+_0x50a8da+_0x4286ea[_0x11c363(0x1f1)]+_0x2f0c11);}_0x1ddfe5[_0x11c363(0x1d4)]('');}if(_0x343a8d[_0x11c363(0x1dd)][_0x11c363(0x1d0)]>0x0||_0x343a8d[_0x11c363(0x1e7)]||_0x343a8d[_0x11c363(0x1d5)]!==![]){_0x1ddfe5[_0x11c363(0x1d4)](_0x11c363(0x1f4));const _0x5f30a8=buildAllFlags(_0x343a8d),_0x18f2dd=Math[_0x11c363(0x1fa)](..._0x5f30a8['map'](_0x55e3d2=>formatFlagName(_0x55e3d2)[_0x11c363(0x1d0)]));for(const _0x541a96 of _0x5f30a8){_0x1ddfe5[_0x11c363(0x1d4)](_0x11c363(0x1ef)+formatFlagName(_0x541a96)[_0x11c363(0x1c9)](_0x18f2dd+0x2)+renderFlagDesc(_0x541a96));}_0x1ddfe5['push']('');}const _0x4b4f20=[];_0x343a8d[_0x11c363(0x1df)]!==![]&&_0x4b4f20[_0x11c363(0x1d4)]('Requires\x20authentication\x20(run\x20`'+CLI_BIN_NAME+_0x11c363(0x1e2));_0x343a8d[_0x11c363(0x203)]!==![]&&_0x4b4f20['push'](_0x11c363(0x1ee)+CLI_BIN_NAME+_0x11c363(0x20b));if(_0x4b4f20['length']>0x0){_0x1ddfe5[_0x11c363(0x1d4)]('\x20\x20PREREQUISITES');for(const _0x480c50 of _0x4b4f20){_0x1ddfe5[_0x11c363(0x1d4)](_0x11c363(0x202)+_0x480c50);}_0x1ddfe5[_0x11c363(0x1d4)]('');}if(_0x343a8d[_0x11c363(0x1e4)]){const _0x13affa=typeof _0x343a8d[_0x11c363(0x1e4)]===_0x11c363(0x205)?_0x343a8d[_0x11c363(0x1e4)]():_0x343a8d[_0x11c363(0x1e4)];_0x1ddfe5[_0x11c363(0x1d4)](_0x13affa),_0x1ddfe5[_0x11c363(0x1d4)]('');}return _0x1ddfe5['join']('\x0a');}export function generateServiceHelp(_0x2da3fe){const _0x221e2d=a104_0x447fb3,_0x575a37=getServiceEntry(_0x2da3fe);if(!_0x575a37)return _0x221e2d(0x1f0)+_0x2da3fe+'\x0a';const _0x3ce2a1=[],_0x2eb709=serviceGroups[_0x221e2d(0x1fb)](_0x2da3fe);_0x3ce2a1[_0x221e2d(0x1d4)](''),_0x3ce2a1[_0x221e2d(0x1d4)]('\x20\x20'+_0x575a37['label']),_0x3ce2a1['push'](''),_0x3ce2a1[_0x221e2d(0x1d4)]('\x20\x20USAGE'),_0x3ce2a1['push'](_0x221e2d(0x1ef)+CLI_BIN_NAME+'\x20'+_0x2da3fe+'\x20<command>\x20[args]\x20[flags]'),_0x3ce2a1[_0x221e2d(0x1d4)](''),_0x3ce2a1[_0x221e2d(0x1d4)](_0x221e2d(0x1cb));for(const _0x531347 of _0x575a37[_0x221e2d(0x1ed)]){_0x3ce2a1[_0x221e2d(0x1d4)]('');const _0x1822c2=_0x531347[_0x221e2d(0x1e0)]?'\x20\x20'+_0x531347['tag'][_0x221e2d(0x1fc)]():'';_0x3ce2a1['push'](_0x221e2d(0x1ef)+_0x531347['command']+_0x1822c2),_0x3ce2a1['push'](_0x221e2d(0x206)+_0x531347[_0x221e2d(0x1f1)]);const _0xb4bed0=_0x2eb709?.[_0x221e2d(0x1d6)](_0x2f02c9=>_0x2f02c9['command']===_0x531347[_0x221e2d(0x1f8)]);if(_0xb4bed0?.[_0x221e2d(0x1eb)]&&_0xb4bed0[_0x221e2d(0x1eb)][_0x221e2d(0x1d0)]>0x0){_0x3ce2a1['push'](_0x221e2d(0x1fd));const _0x3f983e=Math[_0x221e2d(0x1fa)](..._0xb4bed0['args']['map'](_0x5cba9f=>_0x5cba9f[_0x221e2d(0x1e8)]['length']+0x2));for(const _0x34ba1e of _0xb4bed0[_0x221e2d(0x1eb)]){const _0x595a31=('<'+_0x34ba1e[_0x221e2d(0x1e8)]+'>')[_0x221e2d(0x1c9)](_0x3f983e+0x2),_0x2e2850=_0x34ba1e['required']!==![]?_0x221e2d(0x201):'';_0x3ce2a1[_0x221e2d(0x1d4)](_0x221e2d(0x1c7)+_0x595a31+_0x34ba1e[_0x221e2d(0x1f1)]+_0x2e2850);}}const _0x2a68df=getCommandFlags(_0x2da3fe,_0x531347[_0x221e2d(0x1f8)],_0x2eb709);if(_0x2a68df['length']>0x0){const _0x8c5b4d=Math[_0x221e2d(0x1fa)](..._0x2a68df[_0x221e2d(0x1fe)](_0x3bb5b6=>formatFlagName(_0x3bb5b6)[_0x221e2d(0x1d0)]));for(const _0x107bd8 of _0x2a68df){_0x3ce2a1[_0x221e2d(0x1d4)](_0x221e2d(0x206)+formatFlagName(_0x107bd8)[_0x221e2d(0x1c9)](_0x8c5b4d+0x2)+renderFlagDesc(_0x107bd8));}}}return _0x3ce2a1[_0x221e2d(0x1d4)](''),_0x3ce2a1[_0x221e2d(0x1de)]('\x0a');}export function generateFullHelp(){const _0x2540e8=a104_0x447fb3,_0x49c410=[];_0x49c410[_0x2540e8(0x1d4)](''),_0x49c410[_0x2540e8(0x1d4)]('\x20\x20'+CLI_DISPLAY_NAME),_0x49c410['push'](''),_0x49c410[_0x2540e8(0x1d4)](_0x2540e8(0x1d2)),_0x49c410['push']('\x20\x20\x20\x20$\x20'+CLI_BIN_NAME+_0x2540e8(0x1dc)),_0x49c410['push'](''),_0x49c410['push'](_0x2540e8(0x1e5));const _0x575660=GLOBAL_FLAGS[_0x2540e8(0x1f5)](_0x1d8eb9=>!_0x1d8eb9['hidden']),_0x350ad5=Math['max'](..._0x575660[_0x2540e8(0x1fe)](_0x401788=>{const _0x205234=_0x2540e8,_0x10fb69=_0x401788[_0x205234(0x1e1)]?'\x20'+_0x401788[_0x205234(0x1e1)]:'';return('--'+_0x401788['name']+_0x10fb69)[_0x205234(0x1d0)];}));for(const _0x4e1df4 of _0x575660){const _0x38a4ec=_0x4e1df4[_0x2540e8(0x1e1)]?'\x20'+_0x4e1df4[_0x2540e8(0x1e1)]:'',_0xac1382=('--'+_0x4e1df4[_0x2540e8(0x1e8)]+_0x38a4ec)['padEnd'](_0x350ad5+0x2);_0x49c410['push'](_0x2540e8(0x1ef)+_0xac1382+_0x4e1df4['description']);}_0x49c410['push'](''),_0x49c410['push'](_0x2540e8(0x1cb)),_0x49c410[_0x2540e8(0x1d4)]('');for(const _0x26315a of serviceRegistry){_0x49c410[_0x2540e8(0x1d4)]('\x20\x20'+_0x26315a[_0x2540e8(0x1db)]);if(_0x26315a[_0x2540e8(0x208)]){const _0x1ce00f=_0x26315a[_0x2540e8(0x1ed)][0x0],_0x1a71b5=_0x1ce00f['tag']??'';_0x49c410[_0x2540e8(0x1d4)](_0x2540e8(0x1ef)+_0x26315a['service']['padEnd'](0x12)+_0x1ce00f[_0x2540e8(0x1f1)]+_0x1a71b5);}else{const _0x59d837=_0x26315a['commands'][_0x2540e8(0x1fe)](_0x48c6f1=>_0x26315a[_0x2540e8(0x1ca)]+'\x20'+_0x48c6f1[_0x2540e8(0x1f8)]),_0x58278a=Math[_0x2540e8(0x1fa)](..._0x59d837['map'](_0x341e90=>_0x341e90[_0x2540e8(0x1d0)]));for(let _0x5e723e=0x0;_0x5e723e<_0x26315a[_0x2540e8(0x1ed)][_0x2540e8(0x1d0)];_0x5e723e++){const _0x4afe5b=_0x26315a[_0x2540e8(0x1ed)][_0x5e723e],_0x1aa915=_0x4afe5b[_0x2540e8(0x1e0)]??'';_0x49c410[_0x2540e8(0x1d4)](_0x2540e8(0x1ef)+_0x59d837[_0x5e723e][_0x2540e8(0x1c9)](_0x58278a+0x2)+_0x4afe5b[_0x2540e8(0x1f1)]+_0x1aa915);}}if(_0x26315a[_0x2540e8(0x1f6)]?.['helpExtra']){const _0x64fb44=typeof _0x26315a[_0x2540e8(0x1f6)][_0x2540e8(0x1e4)]===_0x2540e8(0x205)?_0x26315a['wildcardDef'][_0x2540e8(0x1e4)]():_0x26315a['wildcardDef'][_0x2540e8(0x1e4)];for(const _0x5e68f9 of _0x64fb44['split']('\x0a')){_0x49c410['push']('\x20\x20'+_0x5e68f9);}}_0x49c410[_0x2540e8(0x1d4)]('');}return _0x49c410[_0x2540e8(0x1d4)]('\x20\x20Run\x20`'+CLI_BIN_NAME+_0x2540e8(0x1e6)),_0x49c410[_0x2540e8(0x1d4)](_0x2540e8(0x1f3)+CLI_BIN_NAME+_0x2540e8(0x20c)),_0x49c410['push'](''),_0x49c410[_0x2540e8(0x1de)]('\x0a');}function getCommandFlags(_0x37961c,_0x3fd502,_0x3d2d34){if(_0x3d2d34){const _0x4f6612=_0x3d2d34['find'](_0x514fb6=>_0x514fb6['command']===_0x3fd502);if(_0x4f6612)return buildAllFlags(_0x4f6612);}return[];}function renderFlagDesc(_0x406c36){const _0x5af847=a104_0x447fb3;let _0x30771f=_0x406c36[_0x5af847(0x1f1)];return _0x406c36[_0x5af847(0x1c8)]&&_0x406c36[_0x5af847(0x1c8)][_0x5af847(0x1d0)]>0x0&&(_0x30771f+='\x20('+_0x406c36[_0x5af847(0x1c8)][_0x5af847(0x1de)](_0x5af847(0x1ea))+')'),_0x406c36[_0x5af847(0x1d9)]!==undefined&&_0x406c36['default']!==''&&_0x406c36[_0x5af847(0x1d9)]!==![]&&(_0x30771f+='\x20[default:\x20'+_0x406c36[_0x5af847(0x1d9)]+']'),_0x406c36[_0x5af847(0x1d7)]&&!_0x30771f[_0x5af847(0x1ff)](_0x5af847(0x1cc))&&(_0x30771f+=_0x5af847(0x201)),_0x30771f;}function formatFlagName(_0x98a334){const _0x1e6c42=a104_0x447fb3,_0x1583f6=_0x98a334['type']==='boolean'?'':_0x98a334[_0x1e6c42(0x1da)]===_0x1e6c42(0x1e9)?'\x20<n>':_0x1e6c42(0x1d1);return'--'+_0x98a334['name']+_0x1583f6;}
@@ -1 +1 @@
1
- (function(_0x1d6b38,_0x3182cd){var _0x472935=a104_0x1421,_0x50b08a=_0x1d6b38();while(!![]){try{var _0x18b39d=-parseInt(_0x472935(0xbf))/0x1+parseInt(_0x472935(0xc0))/0x2+-parseInt(_0x472935(0xbe))/0x3+parseInt(_0x472935(0xc1))/0x4+parseInt(_0x472935(0xbc))/0x5+parseInt(_0x472935(0xc2))/0x6+-parseInt(_0x472935(0xbd))/0x7;if(_0x18b39d===_0x3182cd)break;else _0x50b08a['push'](_0x50b08a['shift']());}catch(_0x271b5d){_0x50b08a['push'](_0x50b08a['shift']());}}}(a104_0x4236,0x797bb));export{runCommand}from'./runner.js';function a104_0x1421(_0x593d85,_0x3a6d0b){_0x593d85=_0x593d85-0xbc;var _0x42367f=a104_0x4236();var _0x14216b=_0x42367f[_0x593d85];return _0x14216b;}export{parseFlags,validateFlags}from'./flags.js';export{formatOutput}from'./output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./help.js';export{extractList,extractPaging}from'./response.js';function a104_0x4236(){var _0xdf0fed=['409780cmpasf','1832016mEOKUv','4162235LVmjke','6473810WWgmHV','240474TSpbTD','72052Qotmvb','668814ZmZMtA'];a104_0x4236=function(){return _0xdf0fed;};return a104_0x4236();}export{riskLevelOrder}from'./types.js';
1
+ function a105_0x17ce(){var _0x37582c=['2712rAjpCp','135XNziDZ','1485105xXGMoc','12220IIboGT','37890FiVzri','24nwmEUe','1430YejTlb','18621cdRqKa','48CAaiAM','9718716fxgZNa','17800ENEXdE','285313uYWDhF'];a105_0x17ce=function(){return _0x37582c;};return a105_0x17ce();}(function(_0x1e3b2a,_0x1e1798){var _0x1bc631=a105_0x2967,_0x4c4276=_0x1e3b2a();while(!![]){try{var _0x311589=parseInt(_0x1bc631(0x148))/0x1*(parseInt(_0x1bc631(0x146))/0x2)+parseInt(_0x1bc631(0x14c))/0x3+-parseInt(_0x1bc631(0x14d))/0x4*(parseInt(_0x1bc631(0x14b))/0x5)+-parseInt(_0x1bc631(0x14f))/0x6*(-parseInt(_0x1bc631(0x149))/0x7)+-parseInt(_0x1bc631(0x14a))/0x8*(-parseInt(_0x1bc631(0x145))/0x9)+parseInt(_0x1bc631(0x14e))/0xa*(-parseInt(_0x1bc631(0x144))/0xb)+-parseInt(_0x1bc631(0x147))/0xc;if(_0x311589===_0x1e1798)break;else _0x4c4276['push'](_0x4c4276['shift']());}catch(_0x363542){_0x4c4276['push'](_0x4c4276['shift']());}}}(a105_0x17ce,0x62132));export{runCommand}from'./runner.js';export{parseFlags,validateFlags}from'./flags.js';export{formatOutput}from'./output.js';function a105_0x2967(_0x36ecd2,_0x7d7eb8){_0x36ecd2=_0x36ecd2-0x144;var _0x17ce70=a105_0x17ce();var _0x296788=_0x17ce70[_0x36ecd2];return _0x296788;}export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./help.js';export{extractList,extractPaging}from'./response.js';export{riskLevelOrder}from'./types.js';