@lovrabet/rabetbase-cli 2.1.1-beta.0 → 2.1.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -0
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -0
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -0
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -0
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -0
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -0
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -0
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -0
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/file-utils.js +1 -1
  149. package/lib/utils/guides-cdn.js +1 -1
  150. package/lib/utils/http-client.js +1 -1
  151. package/lib/utils/is-non-interactive.js +1 -1
  152. package/lib/utils/logger.js +1 -1
  153. package/lib/utils/platform.js +1 -1
  154. package/lib/utils/rules-cdn.js +1 -1
  155. package/lib/utils/sleep.js +1 -1
  156. package/lib/utils/template-replacer.js +1 -1
  157. package/lib/utils/version.js +1 -1
  158. package/lib/utils/with-active-cookie.js +1 -1
  159. package/lib/utils/write-cli-side-channel.js +1 -1
  160. package/package.json +3 -2
  161. package/lib/commands/api/doc.js +0 -1
  162. package/lib/commands/app/remote.js +0 -1
@@ -1 +1 @@
1
- const a99_0x217d19=a99_0x190a;(function(_0x58ed87,_0x31348a){const _0x388edb=a99_0x190a,_0x5ac41f=_0x58ed87();while(!![]){try{const _0x4fd4ec=-parseInt(_0x388edb(0x1a3))/0x1+parseInt(_0x388edb(0x1aa))/0x2+parseInt(_0x388edb(0x1c0))/0x3*(parseInt(_0x388edb(0x1c1))/0x4)+parseInt(_0x388edb(0x1af))/0x5+parseInt(_0x388edb(0x1b4))/0x6*(-parseInt(_0x388edb(0x1bf))/0x7)+-parseInt(_0x388edb(0x1c2))/0x8+parseInt(_0x388edb(0x19f))/0x9*(parseInt(_0x388edb(0x1b5))/0xa);if(_0x4fd4ec===_0x31348a)break;else _0x5ac41f['push'](_0x5ac41f['shift']());}catch(_0xdb9674){_0x5ac41f['push'](_0x5ac41f['shift']());}}}(a99_0x1765,0x27dc1));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';function a99_0x190a(_0x7b9082,_0x280347){_0x7b9082=_0x7b9082-0x19b;const _0x176544=a99_0x1765();let _0x190a28=_0x176544[_0x7b9082];return _0x190a28;}import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a99_0x217d19(0x1bd),'command':a99_0x217d19(0x1b0),'description':a99_0x217d19(0x1a9),'risk':a99_0x217d19(0x1c5),'flags':[{'name':a99_0x217d19(0x1a6),'type':'string','required':!![],'description':a99_0x217d19(0x1b7)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a99_0x217d19(0x19c),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a99_0x217d19(0x19c),'description':a99_0x217d19(0x1bb)},{'name':a99_0x217d19(0x1a4),'type':a99_0x217d19(0x19c),'description':a99_0x217d19(0x1a8)}],async 'validate'(_0x58607a){const _0x355a78=a99_0x217d19,_0x5749da=resolve(process['cwd'](),_0x58607a[_0x355a78(0x1ce)](_0x355a78(0x1a6)));if(!existsSync(_0x5749da))throw CliErrors[_0x355a78(0x1ab)]('File\x20not\x20found:\x20'+_0x5749da);const _0x46b723=readFileSync(_0x5749da,'utf-8'),_0x7be365=validateSql(_0x46b723);if(!_0x7be365[_0x355a78(0x1ca)])throw CliErrors[_0x355a78(0x1ab)](_0x355a78(0x1a2)+_0x7be365['message']);},async 'dryRun'(_0x2c8829){const _0x211500=a99_0x217d19,_0x42a0bc=resolve(process[_0x211500(0x1b9)](),_0x2c8829['str'](_0x211500(0x1a6))),_0x4963d7=readFileSync(_0x42a0bc,_0x211500(0x1c3)),_0xa4f37e=validateSql(_0x4963d7),_0x29167c=_0x2c8829[_0x211500(0x1ce)]('db')||undefined,{db:_0xc17656,error:_0x3d8c30}=await resolveOneDb(_0x2c8829[_0x211500(0x1a7)],_0x29167c);return{'method':'POST','url':_0x211500(0x1b8),'body':{'appCode':_0x2c8829[_0x211500(0x1a7)],'sqlContent':'('+_0x4963d7[_0x211500(0x1be)]+_0x211500(0x1c7),'sqlCode':_0x2c8829[_0x211500(0x1ce)](_0x211500(0x19e))||undefined,'sqlName':_0x2c8829['str']('sqlname')||undefined,'db':_0xc17656?_0xc17656[_0x211500(0x1bc)]+'\x20('+_0xc17656[_0x211500(0x1a5)]+')':_0x3d8c30},'description':[_0x211500(0x1a1)+_0x2c8829[_0x211500(0x1ce)](_0x211500(0x1a6)),_0x211500(0x1cd)+_0xa4f37e['message'],'Type:\x20'+_0xa4f37e[_0x211500(0x1b6)][_0x211500(0x1b3)]+_0x211500(0x1c6)+(_0xa4f37e['tables']['join'](',\x20')||_0x211500(0x1cb))+_0x211500(0x1ba)+(_0xa4f37e['parameters'][_0x211500(0x1c9)](',\x20')||_0x211500(0x1c8))][_0x211500(0x1c9)]('\x0a')};},async 'execute'(_0x5e479c){const _0x384d9c=a99_0x217d19,_0x2d0a36=resolve(process[_0x384d9c(0x1b9)](),_0x5e479c[_0x384d9c(0x1ce)](_0x384d9c(0x1a6))),_0xdf147c=readFileSync(_0x2d0a36,'utf-8'),_0x44e375=_0x5e479c[_0x384d9c(0x1ce)]('db')||undefined,{db:_0x480928,error:_0x165a7f}=await resolveOneDb(_0x5e479c[_0x384d9c(0x1a7)],_0x44e375);if(_0x165a7f)throw CliErrors['validation'](_0x165a7f);const _0x1e45a6=await saveSqlQuery({'appCode':_0x5e479c['appCode'],'sqlContent':_0xdf147c,'sqlCode':_0x5e479c[_0x384d9c(0x1ce)](_0x384d9c(0x19e))||undefined,'sqlName':_0x5e479c[_0x384d9c(0x1ce)](_0x384d9c(0x1ad))||undefined,'dbId':_0x480928[_0x384d9c(0x1a5)],'description':_0x5e479c[_0x384d9c(0x1ce)](_0x384d9c(0x1a4))||undefined});if(_0x1e45a6[_0x384d9c(0x1a0)])return{'ok':![],'data':_0x1e45a6,'message':_0x1e45a6[_0x384d9c(0x1ae)]||_0x384d9c(0x19d)};return{'ok':!![],'data':{'sqlCode':_0x1e45a6[_0x384d9c(0x1b1)],'sqlName':_0x1e45a6[_0x384d9c(0x19b)],'action':_0x1e45a6[_0x384d9c(0x1cc)]},'message':(_0x1e45a6[_0x384d9c(0x1cc)]===_0x384d9c(0x1ac)?_0x384d9c(0x1b2):'Updated')+_0x384d9c(0x1c4)+(_0x1e45a6[_0x384d9c(0x1b1)]?'\x20('+_0x1e45a6['sqlCode']+')':'')};}};function a99_0x1765(){const _0x2f8817=['Path\x20to\x20the\x20SQL\x20file','/api/node-toolbox/sql/save','cwd','\x20|\x20Params:\x20','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','dbName','sql','length','1631aNWyCq','96grYWXD','13036STgTgn','1442496itfdWD','utf-8','\x20successfully','write','\x20|\x20Tables:\x20','\x20chars)','none','join','valid','N/A','action','Validation:\x20','str','sqlName','string','Conflict\x20detected','sqlcode','118620ZxTPld','blocked','Save\x20SQL\x20query\x20from\x20','SQL\x20validation\x20failed:\x20','292472bnFnSc','description','dbId','file','appCode','SQL\x20query\x20description','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','341216wbTbWv','validation','created','sqlname','message','4255gdnQwy','save','sqlCode','Created','type','5316kZiQaM','430vnzWub','sqlType'];a99_0x1765=function(){return _0x2f8817;};return a99_0x1765();}
1
+ const a100_0x226f40=a100_0x1d10;(function(_0x328400,_0x4eebd7){const _0x215410=a100_0x1d10,_0x3a157f=_0x328400();while(!![]){try{const _0xae7e07=-parseInt(_0x215410(0x16f))/0x1*(-parseInt(_0x215410(0x164))/0x2)+-parseInt(_0x215410(0x149))/0x3+-parseInt(_0x215410(0x16e))/0x4+-parseInt(_0x215410(0x16a))/0x5+-parseInt(_0x215410(0x15d))/0x6+-parseInt(_0x215410(0x152))/0x7+-parseInt(_0x215410(0x16d))/0x8*(-parseInt(_0x215410(0x175))/0x9);if(_0xae7e07===_0x4eebd7)break;else _0x3a157f['push'](_0x3a157f['shift']());}catch(_0x581942){_0x3a157f['push'](_0x3a157f['shift']());}}}(a100_0x273e,0x4e2ad));function a100_0x273e(){const _0x426f37=['9704vAMksn','2110680nvBSPY','35077CmEwKf','Validation:\x20','/api/node-toolbox/sql/save','appCode','SQL\x20query\x20description','File\x20not\x20found:\x20','14283utwkQQ','Type:\x20','732495zjlRKJ','length','blocked','\x20chars)','Save\x20SQL\x20query\x20from\x20','sqlName','\x20|\x20Tables:\x20','utf-8','cwd','3750698HkVFPN','string','sqlname','sqlCode','write','file','POST','tables','validation','description','str','3807990lKmyAd','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','action','sqlcode','Path\x20to\x20the\x20SQL\x20file','dbId','sqlType','24xSWjgN','message','parameters','\x20successfully','created','join','417340sXckjF','sql','type'];a100_0x273e=function(){return _0x426f37;};return a100_0x273e();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';function a100_0x1d10(_0x37d5c4,_0xf0bdba){_0x37d5c4=_0x37d5c4-0x148;const _0x273ed4=a100_0x273e();let _0x1d1076=_0x273ed4[_0x37d5c4];return _0x1d1076;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a100_0x226f40(0x16b),'command':'save','description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','risk':a100_0x226f40(0x156),'flags':[{'name':a100_0x226f40(0x157),'type':'string','required':!![],'description':a100_0x226f40(0x161)},SQLCODE_FLAG_OPTIONAL,{'name':a100_0x226f40(0x154),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a100_0x226f40(0x15e)},{'name':a100_0x226f40(0x15b),'type':a100_0x226f40(0x153),'description':a100_0x226f40(0x173)}],async 'validate'(_0xc3e05d){const _0x2bae2d=a100_0x226f40,_0x45768a=resolve(process[_0x2bae2d(0x151)](),_0xc3e05d[_0x2bae2d(0x15c)](_0x2bae2d(0x157)));if(!existsSync(_0x45768a))throw CliErrors[_0x2bae2d(0x15a)](_0x2bae2d(0x174)+_0x45768a);const _0x42cf03=readFileSync(_0x45768a,_0x2bae2d(0x150)),_0xc3463e=validateSql(_0x42cf03);if(!_0xc3463e['valid'])throw CliErrors[_0x2bae2d(0x15a)]('SQL\x20validation\x20failed:\x20'+_0xc3463e[_0x2bae2d(0x165)]);},async 'dryRun'(_0x103964){const _0x5e5159=a100_0x226f40,_0x559fed=resolve(process[_0x5e5159(0x151)](),_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x157))),_0x39c5f1=readFileSync(_0x559fed,_0x5e5159(0x150)),_0x403d80=validateSql(_0x39c5f1),_0x19593f=_0x103964[_0x5e5159(0x15c)]('db')||undefined,{db:_0x1162f3,error:_0x17ab7b}=await resolveOneDb(_0x103964[_0x5e5159(0x172)],_0x19593f);return{'method':_0x5e5159(0x158),'url':_0x5e5159(0x171),'body':{'appCode':_0x103964[_0x5e5159(0x172)],'sqlContent':'('+_0x39c5f1[_0x5e5159(0x14a)]+_0x5e5159(0x14c),'sqlCode':_0x103964[_0x5e5159(0x15c)]('sqlcode')||undefined,'sqlName':_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x154))||undefined,'db':_0x1162f3?_0x1162f3['dbName']+'\x20('+_0x1162f3['dbId']+')':_0x17ab7b},'description':[_0x5e5159(0x14d)+_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x157)),_0x5e5159(0x170)+_0x403d80[_0x5e5159(0x165)],_0x5e5159(0x148)+_0x403d80[_0x5e5159(0x163)][_0x5e5159(0x16c)]+_0x5e5159(0x14f)+(_0x403d80[_0x5e5159(0x159)]['join'](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x403d80[_0x5e5159(0x166)][_0x5e5159(0x169)](',\x20')||'none')][_0x5e5159(0x169)]('\x0a')};},async 'execute'(_0x5c48e6){const _0x7f4013=a100_0x226f40,_0x1f537f=resolve(process[_0x7f4013(0x151)](),_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x157))),_0xc5d510=readFileSync(_0x1f537f,_0x7f4013(0x150)),_0x1e0cce=_0x5c48e6['str']('db')||undefined,{db:_0x40e737,error:_0x48062d}=await resolveOneDb(_0x5c48e6[_0x7f4013(0x172)],_0x1e0cce);if(_0x48062d)throw CliErrors[_0x7f4013(0x15a)](_0x48062d);const _0xc436ad=await saveSqlQuery({'appCode':_0x5c48e6[_0x7f4013(0x172)],'sqlContent':_0xc5d510,'sqlCode':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x160))||undefined,'sqlName':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x154))||undefined,'dbId':_0x40e737[_0x7f4013(0x162)],'description':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x15b))||undefined});if(_0xc436ad[_0x7f4013(0x14b)])return{'ok':![],'data':_0xc436ad,'message':_0xc436ad[_0x7f4013(0x165)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0xc436ad[_0x7f4013(0x155)],'sqlName':_0xc436ad[_0x7f4013(0x14e)],'action':_0xc436ad[_0x7f4013(0x15f)]},'message':(_0xc436ad['action']===_0x7f4013(0x168)?'Created':'Updated')+_0x7f4013(0x167)+(_0xc436ad[_0x7f4013(0x155)]?'\x20('+_0xc436ad[_0x7f4013(0x155)]+')':'')};}};
@@ -1 +1 @@
1
- const a100_0x3f5e5b=a100_0x305a;(function(_0x3770eb,_0x255452){const _0x11d0ca=a100_0x305a,_0x56591e=_0x3770eb();while(!![]){try{const _0x45834a=-parseInt(_0x11d0ca(0x210))/0x1*(parseInt(_0x11d0ca(0x1fa))/0x2)+parseInt(_0x11d0ca(0x20d))/0x3*(-parseInt(_0x11d0ca(0x204))/0x4)+parseInt(_0x11d0ca(0x201))/0x5*(-parseInt(_0x11d0ca(0x20b))/0x6)+parseInt(_0x11d0ca(0x1f9))/0x7+parseInt(_0x11d0ca(0x211))/0x8*(parseInt(_0x11d0ca(0x1f8))/0x9)+parseInt(_0x11d0ca(0x1fe))/0xa+-parseInt(_0x11d0ca(0x209))/0xb*(-parseInt(_0x11d0ca(0x1f7))/0xc);if(_0x45834a===_0x255452)break;else _0x56591e['push'](_0x56591e['shift']());}catch(_0x3b0bdc){_0x56591e['push'](_0x56591e['shift']());}}}(a100_0x5473,0xd296e));import{join}from'node:path';function a100_0x5473(){const _0x931290=['set','.sql','sqlCode','--\x20@lovrabet.description:','11SueFsR','.rabetbase/sql','6UZNVSZ','unnamed','6375CihNUV','unknown','has','509437QXCRmg','8PriKQR','--\x20@lovrabet.sqlCode:\x20','replace','endsWith','20761104qqRdUd','893259zcfUEE','9291961RMqJzU','2CprFJB','trimEnd','--\x20@lovrabet.sqlName:\x20','sqlName','1677710mfBJJu','description','join','8115755nXKrTx','trim','sqlContent','620PgtwZD'];a100_0x5473=function(){return _0x931290;};return a100_0x5473();}function a100_0x305a(_0xa4d4cc,_0x6bef6b){_0xa4d4cc=_0xa4d4cc-0x1f4;const _0x547326=a100_0x5473();let _0x305a37=_0x547326[_0xa4d4cc];return _0x305a37;}export const SQL_LOCAL_REL_DIR=a100_0x3f5e5b(0x20a);export function resolveSqlLocalDir(_0x3631d8){return join(_0x3631d8,SQL_LOCAL_REL_DIR);}export function safeSqlFileBaseName(_0x53e2ac){const _0x36c20e=a100_0x3f5e5b,_0x64a28b=_0x53e2ac[_0x36c20e(0x202)]()||'unnamed',_0x37675c=_0x64a28b[_0x36c20e(0x1f5)](/[/\\?%*:|"<>]/g,'_')[_0x36c20e(0x1f5)](/\s+/g,'_')[_0x36c20e(0x1f5)](/_+/g,'_');return _0x37675c||_0x36c20e(0x20c);}export function assignSqlFileNames(_0x453688){const _0x152bd7=a100_0x3f5e5b,_0x4e3f27=new Map();for(const _0x352e70 of _0x453688){const _0x4251f=safeSqlFileBaseName(_0x352e70[_0x152bd7(0x1fd)]??'unnamed');let _0x2e3d12=_0x4251f+_0x152bd7(0x206);if(_0x4e3f27['has'](_0x2e3d12)){const _0x15f749=(_0x352e70[_0x152bd7(0x207)]??_0x152bd7(0x20e))[_0x152bd7(0x1f5)](/-/g,'');_0x2e3d12=_0x4251f+'__'+_0x15f749+'.sql';}let _0x15065e=0x0,_0x2b741e=_0x2e3d12;while(_0x4e3f27[_0x152bd7(0x20f)](_0x2b741e)){_0x15065e++,_0x2b741e=_0x4251f+'__'+_0x15065e+_0x152bd7(0x206);}_0x4e3f27[_0x152bd7(0x205)](_0x2b741e,_0x352e70);}return _0x4e3f27;}export function buildPulledSqlFileContent(_0xcaca2c){const _0x468da0=a100_0x3f5e5b,_0x5602bb=_0xcaca2c[_0x468da0(0x1fd)]??_0x468da0(0x20c),_0x26a021=_0xcaca2c[_0x468da0(0x207)]??'',_0x402282=(_0xcaca2c[_0x468da0(0x1ff)]??'')[_0x468da0(0x1f5)](/\r?\n/g,'\x20')[_0x468da0(0x202)](),_0xf38979=_0xcaca2c[_0x468da0(0x203)]??'',_0x1d4bf9=[_0x468da0(0x1fc)+_0x5602bb,_0x468da0(0x1f4)+_0x26a021,_0x468da0(0x208)+(_0x402282?'\x20'+_0x402282:''),'',_0xf38979[_0x468da0(0x1fb)]()],_0x300bf0=_0x1d4bf9[_0x468da0(0x200)]('\x0a');return _0x300bf0[_0x468da0(0x1f6)]('\x0a')?_0x300bf0:_0x300bf0+'\x0a';}
1
+ function a101_0x5a1b(){const _0x435f45=['join','100578EDhFLi','replace','.sql','524063WsHCwz','sqlContent','trimEnd','endsWith','6615288ktwEuJ','888660nHnOFO','--\x20@lovrabet.sqlName:\x20','145pYkfAM','2451460udHCTs','sqlCode','77240vzzwBv','trim','sqlName','.rabetbase/sql','description','99046zIgWHu','set','18zeRJfh','98bzvusA','has','unnamed'];a101_0x5a1b=function(){return _0x435f45;};return a101_0x5a1b();}const a101_0xe19a4e=a101_0x1c80;(function(_0x3d45e8,_0x4a738d){const _0x4d7d40=a101_0x1c80,_0x3e3d9b=_0x3d45e8();while(!![]){try{const _0x492e7f=-parseInt(_0x4d7d40(0xe0))/0x1+parseInt(_0x4d7d40(0xd6))/0x2*(parseInt(_0x4d7d40(0xd8))/0x3)+-parseInt(_0x4d7d40(0xcc))/0x4+-parseInt(_0x4d7d40(0xce))/0x5*(-parseInt(_0x4d7d40(0xdd))/0x6)+-parseInt(_0x4d7d40(0xd9))/0x7*(parseInt(_0x4d7d40(0xd1))/0x8)+parseInt(_0x4d7d40(0xcb))/0x9+-parseInt(_0x4d7d40(0xcf))/0xa;if(_0x492e7f===_0x4a738d)break;else _0x3e3d9b['push'](_0x3e3d9b['shift']());}catch(_0x1a9286){_0x3e3d9b['push'](_0x3e3d9b['shift']());}}}(a101_0x5a1b,0x5fa49));function a101_0x1c80(_0x5f3af7,_0x1f899d){_0x5f3af7=_0x5f3af7-0xca;const _0x5a1be9=a101_0x5a1b();let _0x1c8096=_0x5a1be9[_0x5f3af7];return _0x1c8096;}import{join}from'node:path';export const SQL_LOCAL_REL_DIR=a101_0xe19a4e(0xd4);export function resolveSqlLocalDir(_0x2ae508){return join(_0x2ae508,SQL_LOCAL_REL_DIR);}export function safeSqlFileBaseName(_0x5ba10a){const _0x8fbf16=a101_0xe19a4e,_0x45b473=_0x5ba10a['trim']()||_0x8fbf16(0xdb),_0x45adeb=_0x45b473[_0x8fbf16(0xde)](/[/\\?%*:|"<>]/g,'_')['replace'](/\s+/g,'_')[_0x8fbf16(0xde)](/_+/g,'_');return _0x45adeb||_0x8fbf16(0xdb);}export function assignSqlFileNames(_0x2b0c88){const _0x29d85b=a101_0xe19a4e,_0x2911bb=new Map();for(const _0x4ed588 of _0x2b0c88){const _0x5f3df7=safeSqlFileBaseName(_0x4ed588[_0x29d85b(0xd3)]??_0x29d85b(0xdb));let _0x1fcb53=_0x5f3df7+'.sql';if(_0x2911bb[_0x29d85b(0xda)](_0x1fcb53)){const _0x34f39f=(_0x4ed588[_0x29d85b(0xd0)]??'unknown')[_0x29d85b(0xde)](/-/g,'');_0x1fcb53=_0x5f3df7+'__'+_0x34f39f+_0x29d85b(0xdf);}let _0x518ce0=0x0,_0x757071=_0x1fcb53;while(_0x2911bb[_0x29d85b(0xda)](_0x757071)){_0x518ce0++,_0x757071=_0x5f3df7+'__'+_0x518ce0+'.sql';}_0x2911bb[_0x29d85b(0xd7)](_0x757071,_0x4ed588);}return _0x2911bb;}export function buildPulledSqlFileContent(_0x51014f){const _0x2380f2=a101_0xe19a4e,_0x43c716=_0x51014f[_0x2380f2(0xd3)]??'unnamed',_0x3ace60=_0x51014f['sqlCode']??'',_0x4e8c6c=(_0x51014f[_0x2380f2(0xd5)]??'')[_0x2380f2(0xde)](/\r?\n/g,'\x20')[_0x2380f2(0xd2)](),_0x41f67c=_0x51014f[_0x2380f2(0xe1)]??'',_0x2a9bf5=[_0x2380f2(0xcd)+_0x43c716,'--\x20@lovrabet.sqlCode:\x20'+_0x3ace60,'--\x20@lovrabet.description:'+(_0x4e8c6c?'\x20'+_0x4e8c6c:''),'',_0x41f67c[_0x2380f2(0xe2)]()],_0x1ac08f=_0x2a9bf5[_0x2380f2(0xdc)]('\x0a');return _0x1ac08f[_0x2380f2(0xca)]('\x0a')?_0x1ac08f:_0x1ac08f+'\x0a';}
@@ -1 +1 @@
1
- function a101_0x49b3(){const _0x54a205=['sqlType','schema:','map','length','2288892JoMlml','file','valid','filter','string','message','from','834297fgdTot','str','push','\x22\x20not\x20found\x20or\x20not\x20accessible','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','cwd','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','toLowerCase','fields','1663834asNNcZ','isArray','size','trim','reason','Dataset\x20\x22','2589921zifWrH','tableName','dbtableConfig','schemas','validation','sql','tables','Provide\x20--file\x20or\x20--sql','1229380CaYhLE','type','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','238DAYdnr','32952uVgrnl','2677216FTcUiG','appCode','schemaWarnings','utf-8','read'];a101_0x49b3=function(){return _0x54a205;};return a101_0x49b3();}const a101_0x217620=a101_0x12c1;function a101_0x12c1(_0x2b7cb3,_0x3173fa){_0x2b7cb3=_0x2b7cb3-0x10b;const _0x49b3ed=a101_0x49b3();let _0x12c17e=_0x49b3ed[_0x2b7cb3];return _0x12c17e;}(function(_0x106a0e,_0x3c8ddf){const _0x5c269e=a101_0x12c1,_0x3e79c5=_0x106a0e();while(!![]){try{const _0x42a3ae=-parseInt(_0x5c269e(0x12a))/0x1+-parseInt(_0x5c269e(0x133))/0x2+parseInt(_0x5c269e(0x10d))/0x3+parseInt(_0x5c269e(0x123))/0x4+parseInt(_0x5c269e(0x115))/0x5+-parseInt(_0x5c269e(0x119))/0x6*(-parseInt(_0x5c269e(0x118))/0x7)+parseInt(_0x5c269e(0x11a))/0x8;if(_0x42a3ae===_0x3c8ddf)break;else _0x3e79c5['push'](_0x3e79c5['shift']());}catch(_0x450dc4){_0x3e79c5['push'](_0x3e79c5['shift']());}}}(a101_0x49b3,0x82ffc));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a101_0x217620(0x112),'command':'validate','description':a101_0x217620(0x117),'risk':a101_0x217620(0x11e),'flags':[{'name':'file','type':a101_0x217620(0x127),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':'string','description':a101_0x217620(0x130)},{'name':a101_0x217620(0x110),'type':a101_0x217620(0x127),'description':a101_0x217620(0x12e)}],async 'execute'(_0x3b8ec8){const _0x354c7c=a101_0x217620,_0x6bc274=_0x3b8ec8[_0x354c7c(0x12b)](_0x354c7c(0x124)),_0x2c898a=_0x3b8ec8[_0x354c7c(0x12b)]('sql');if(!_0x6bc274&&!_0x2c898a)throw CliErrors['flagMissing']('file',_0x354c7c(0x114));let _0x114f2c;if(_0x6bc274){const _0x8a7db7=resolve(process[_0x354c7c(0x12f)](),_0x6bc274);if(!existsSync(_0x8a7db7))throw CliErrors[_0x354c7c(0x111)]('File\x20not\x20found:\x20'+_0x8a7db7);_0x114f2c=readFileSync(_0x8a7db7,_0x354c7c(0x11d));}else _0x114f2c=_0x2c898a;const _0x2ab644=validateSql(_0x114f2c),_0x354574={'valid':_0x2ab644[_0x354c7c(0x125)],'sqlType':_0x2ab644[_0x354c7c(0x11f)][_0x354c7c(0x116)],'isSelectOnly':_0x2ab644['sqlType']['isSelectOnly'],'isDangerous':_0x2ab644[_0x354c7c(0x11f)]['isDangerous'],'tables':_0x2ab644[_0x354c7c(0x113)],'parameters':_0x2ab644['parameters'],'message':_0x2ab644[_0x354c7c(0x128)]};_0x2ab644['sqlType'][_0x354c7c(0x10b)]&&(_0x354574[_0x354c7c(0x10b)]=_0x2ab644[_0x354c7c(0x11f)][_0x354c7c(0x10b)]);const _0x346e52=_0x3b8ec8[_0x354c7c(0x12b)](_0x354c7c(0x110));if(_0x346e52&&_0x2ab644[_0x354c7c(0x125)]){const _0x113723=_0x346e52['split'](',')['map'](_0x2db8d8=>_0x2db8d8[_0x354c7c(0x136)]())[_0x354c7c(0x126)](Boolean),_0x3f3308=[],_0x31e394=await listDatasets(_0x3b8ec8[_0x354c7c(0x11b)]),_0x129d76=new Map(_0x31e394[_0x354c7c(0x121)](_0x4f9460=>[_0x4f9460['dbtableConfig']?.['tableName']?.[_0x354c7c(0x131)](),_0x4f9460]));for(const _0x13be61 of _0x2ab644[_0x354c7c(0x113)]){const _0x300850=_0x129d76['get'](_0x13be61['toLowerCase']());!_0x300850&&_0x3f3308[_0x354c7c(0x12c)]('Table\x20\x22'+_0x13be61+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x5dafa6 of _0x113723){try{const _0x4885b4=await getDatasetDetail(_0x5dafa6),_0x16f8c9=Array[_0x354c7c(0x134)](_0x4885b4[_0x354c7c(0x132)])?_0x4885b4['fields']:[],_0x25f116=new Set(_0x16f8c9[_0x354c7c(0x121)](_0x493964=>_0x493964['name']?.['toLowerCase']())),_0x5ecead=_0x4885b4[_0x354c7c(0x10f)]?.[_0x354c7c(0x10e)]||_0x4885b4['tableName']||_0x5dafa6;_0x354574[_0x354c7c(0x120)+_0x5ecead]={'code':_0x5dafa6,'tableName':_0x5ecead,'fieldCount':_0x25f116[_0x354c7c(0x135)],'fields':Array[_0x354c7c(0x129)](_0x25f116)};}catch{_0x3f3308[_0x354c7c(0x12c)](_0x354c7c(0x10c)+_0x5dafa6+_0x354c7c(0x12d));}}_0x3f3308[_0x354c7c(0x122)]>0x0&&(_0x354574[_0x354c7c(0x11c)]=_0x3f3308);}return{'ok':_0x2ab644[_0x354c7c(0x125)],'data':_0x354574,'message':_0x2ab644['message']};}};
1
+ const a102_0x2d6cec=a102_0x55b0;(function(_0x12c6b6,_0x1e712a){const _0x5e2f6a=a102_0x55b0,_0x2794ea=_0x12c6b6();while(!![]){try{const _0x2e69b7=parseInt(_0x5e2f6a(0x86))/0x1*(parseInt(_0x5e2f6a(0x76))/0x2)+parseInt(_0x5e2f6a(0x8c))/0x3+-parseInt(_0x5e2f6a(0x89))/0x4+parseInt(_0x5e2f6a(0x87))/0x5+parseInt(_0x5e2f6a(0x7d))/0x6+-parseInt(_0x5e2f6a(0x73))/0x7+-parseInt(_0x5e2f6a(0x9d))/0x8*(parseInt(_0x5e2f6a(0x82))/0x9);if(_0x2e69b7===_0x1e712a)break;else _0x2794ea['push'](_0x2794ea['shift']());}catch(_0x21bdc5){_0x2794ea['push'](_0x2794ea['shift']());}}}(a102_0x38a2,0x40a8f));function a102_0x38a2(){const _0xe7bcab=['valid','1523382flBWJF','name','parameters','304ozteEz','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','length','reason','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','tables','from','337212VErvpz','tableName','fields','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','schema:','337437vMAoSQ','flagMissing','str','isDangerous','1612xgUkiA','1991860iezHIX','schemas','1158136WKglGz','sql','sqlType','667143xyGQOD','message','schemaWarnings','dbtableConfig','toLowerCase','utf-8','map','isSelectOnly','split','Dataset\x20\x22','push','Provide\x20--file\x20or\x20--sql','trim','file','isArray','type','validate','32YgnEFg','size','Table\x20\x22','File\x20not\x20found:\x20','\x22\x20not\x20found\x20in\x20any\x20dataset','filter','string','\x22\x20not\x20found\x20or\x20not\x20accessible','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'];a102_0x38a2=function(){return _0xe7bcab;};return a102_0x38a2();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a102_0x55b0(_0x49b1b2,_0x4e799f){_0x49b1b2=_0x49b1b2-0x70;const _0x38a209=a102_0x38a2();let _0x55b0ad=_0x38a209[_0x49b1b2];return _0x55b0ad;}export const sqlValidate={'service':'sql','command':a102_0x2d6cec(0x9c),'description':a102_0x2d6cec(0x7a),'risk':'read','flags':[{'name':a102_0x2d6cec(0x99),'type':a102_0x2d6cec(0xa3),'description':a102_0x2d6cec(0x71)},{'name':'sql','type':a102_0x2d6cec(0xa3),'description':a102_0x2d6cec(0x80)},{'name':'schemas','type':'string','description':a102_0x2d6cec(0x77)}],async 'execute'(_0x2c061b){const _0x328dbe=a102_0x2d6cec,_0x673552=_0x2c061b[_0x328dbe(0x84)]('file'),_0x4c90a4=_0x2c061b['str'](_0x328dbe(0x8a));if(!_0x673552&&!_0x4c90a4)throw CliErrors[_0x328dbe(0x83)](_0x328dbe(0x99),_0x328dbe(0x97));let _0x2bafe4;if(_0x673552){const _0x35bbe5=resolve(process['cwd'](),_0x673552);if(!existsSync(_0x35bbe5))throw CliErrors['validation'](_0x328dbe(0xa0)+_0x35bbe5);_0x2bafe4=readFileSync(_0x35bbe5,_0x328dbe(0x91));}else _0x2bafe4=_0x4c90a4;const _0x3f06f9=validateSql(_0x2bafe4),_0x107dcf={'valid':_0x3f06f9[_0x328dbe(0x72)],'sqlType':_0x3f06f9[_0x328dbe(0x8b)][_0x328dbe(0x9b)],'isSelectOnly':_0x3f06f9[_0x328dbe(0x8b)][_0x328dbe(0x93)],'isDangerous':_0x3f06f9[_0x328dbe(0x8b)][_0x328dbe(0x85)],'tables':_0x3f06f9[_0x328dbe(0x7b)],'parameters':_0x3f06f9[_0x328dbe(0x75)],'message':_0x3f06f9[_0x328dbe(0x8d)]};_0x3f06f9[_0x328dbe(0x8b)]['reason']&&(_0x107dcf['reason']=_0x3f06f9[_0x328dbe(0x8b)][_0x328dbe(0x79)]);const _0x181740=_0x2c061b[_0x328dbe(0x84)](_0x328dbe(0x88));if(_0x181740&&_0x3f06f9[_0x328dbe(0x72)]){const _0x22abd0=_0x181740[_0x328dbe(0x94)](',')[_0x328dbe(0x92)](_0x3d248d=>_0x3d248d[_0x328dbe(0x98)]())[_0x328dbe(0xa2)](Boolean),_0x2a2850=[],_0x180471=await listDatasets(_0x2c061b['appCode']),_0xedef41=new Map(_0x180471[_0x328dbe(0x92)](_0x2c79bf=>[_0x2c79bf[_0x328dbe(0x8f)]?.['tableName']?.['toLowerCase'](),_0x2c79bf]));for(const _0x1b86de of _0x3f06f9[_0x328dbe(0x7b)]){const _0x4727ce=_0xedef41['get'](_0x1b86de[_0x328dbe(0x90)]());!_0x4727ce&&_0x2a2850[_0x328dbe(0x96)](_0x328dbe(0x9f)+_0x1b86de+_0x328dbe(0xa1));}for(const _0x240511 of _0x22abd0){try{const _0x3f607b=await getDatasetDetail(_0x240511),_0x1c42b3=Array[_0x328dbe(0x9a)](_0x3f607b[_0x328dbe(0x7f)])?_0x3f607b[_0x328dbe(0x7f)]:[],_0x3903d6=new Set(_0x1c42b3[_0x328dbe(0x92)](_0x449a98=>_0x449a98[_0x328dbe(0x74)]?.[_0x328dbe(0x90)]())),_0x3664a3=_0x3f607b['dbtableConfig']?.[_0x328dbe(0x7e)]||_0x3f607b[_0x328dbe(0x7e)]||_0x240511;_0x107dcf[_0x328dbe(0x81)+_0x3664a3]={'code':_0x240511,'tableName':_0x3664a3,'fieldCount':_0x3903d6[_0x328dbe(0x9e)],'fields':Array[_0x328dbe(0x7c)](_0x3903d6)};}catch{_0x2a2850[_0x328dbe(0x96)](_0x328dbe(0x95)+_0x240511+_0x328dbe(0x70));}}_0x2a2850[_0x328dbe(0x78)]>0x0&&(_0x107dcf[_0x328dbe(0x8e)]=_0x2a2850);}return{'ok':_0x3f06f9[_0x328dbe(0x72)],'data':_0x107dcf,'message':_0x3f06f9['message']};}};
@@ -0,0 +1 @@
1
+ const a103_0x3349bb=a103_0x3a7d;(function(_0x348c81,_0x5a8d49){const _0x3f2fbc=a103_0x3a7d,_0x919f74=_0x348c81();while(!![]){try{const _0x3314cb=parseInt(_0x3f2fbc(0x1e0))/0x1+parseInt(_0x3f2fbc(0x1f7))/0x2+-parseInt(_0x3f2fbc(0x1e5))/0x3*(-parseInt(_0x3f2fbc(0x1fe))/0x4)+-parseInt(_0x3f2fbc(0x1ee))/0x5+-parseInt(_0x3f2fbc(0x1fd))/0x6*(-parseInt(_0x3f2fbc(0x1eb))/0x7)+-parseInt(_0x3f2fbc(0x1f0))/0x8*(parseInt(_0x3f2fbc(0x1e8))/0x9)+-parseInt(_0x3f2fbc(0x1e9))/0xa*(-parseInt(_0x3f2fbc(0x1f9))/0xb);if(_0x3314cb===_0x5a8d49)break;else _0x919f74['push'](_0x919f74['shift']());}catch(_0x2bb1f2){_0x919f74['push'](_0x919f74['shift']());}}}(a103_0x430f,0x65d69));function a103_0x3a7d(_0x1896da,_0x5c0c3e){_0x1896da=_0x1896da-0x1df;const _0x430f8e=a103_0x430f();let _0x3a7d04=_0x430f8e[_0x1896da];return _0x3a7d04;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a103_0x3349bb(0x1e6),a103_0x3349bb(0x1fa),a103_0x3349bb(0x1ff),a103_0x3349bb(0x201),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a103_0x3349bb(0x206),a103_0x3349bb(0x1e1),a103_0x3349bb(0x1ff),a103_0x3349bb(0x201),a103_0x3349bb(0x1e6),a103_0x3349bb(0x1fa),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0xdbfd42){return[..._0xdbfd42]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x359f0b){const _0x437c5f=a103_0x3349bb;return TOP_LEVEL_CONFIG_KEYS[_0x437c5f(0x1f5)](_0x359f0b);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x425e80=a103_0x3349bb;return _0x425e80(0x202)+getTopLevelConfigKeySummary()+')';}function a103_0x430f(){const _0x14690d=['format','Config\x20key\x20(','API\x20directory\x20path','apps','pageSize','appcode','Default\x20page\x20size','216252QMmfKr','env','apiDir','defaultFormat','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','4443vODplT','cookie','app','7390179waKsWe','10HLKNWY','Target\x20environment','7HOWRYc','Locale','zh-CN','3662530SVMPIh','en-US','8tSFZug','length','riskLevel','Auth\x20cookie','filter','has','number','765814AASZNU','trim','6107277VyfxEc','accessKey','Risk\x20level','inherit','4196406iesFqc','316WLIhGc','locale','string'];a103_0x430f=function(){return _0x14690d;};return a103_0x430f();}export const APP_PROFILE_FLAG_KEY_MAP={'env':a103_0x3349bb(0x1e1),'apiDir':a103_0x3349bb(0x1e2),'cookie':a103_0x3349bb(0x1e6),'accessKey':a103_0x3349bb(0x1fa),'defaultFormat':a103_0x3349bb(0x201),'pageSize':a103_0x3349bb(0x205),'riskLevel':'riskLevel','locale':a103_0x3349bb(0x1ff)};export function getAppProfileFlagDefs(){const _0x547afc=a103_0x3349bb;return[{'name':_0x547afc(0x1e1),'type':'string','description':_0x547afc(0x1ea),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x547afc(0x1e2),'type':_0x547afc(0x200),'description':_0x547afc(0x203)},{'name':_0x547afc(0x1e6),'type':_0x547afc(0x200),'description':_0x547afc(0x1f3),'hidden':!![]},{'name':_0x547afc(0x1fa),'type':_0x547afc(0x200),'description':'Access\x20key','hidden':!![]},{'name':_0x547afc(0x1e3),'type':_0x547afc(0x200),'description':_0x547afc(0x1e4),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x547afc(0x1f6),'description':_0x547afc(0x1df)},{'name':_0x547afc(0x1f2),'type':_0x547afc(0x200),'description':_0x547afc(0x1fb),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':_0x547afc(0x1ec)}];}export function collectAppProfileOverrides(_0x3a9d5b){const _0x132ee6=a103_0x3349bb,_0x4b366b={};for(const [_0x102009,_0x56fa8e]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0xd9e912=_0x3a9d5b(_0x102009);if(!_0xd9e912)continue;_0x4b366b[_0x56fa8e]=_0x56fa8e===_0x132ee6(0x205)?Number(_0xd9e912):_0xd9e912;}return _0x4b366b;}export function buildAppProfileListFields(_0x287afd){const _0x422303=a103_0x3349bb;return{'env':_0x287afd[_0x422303(0x1e1)]??null,'apiDir':_0x287afd['apiDir']??null,'hasCookie':!!_0x287afd['cookie'],'hasAccessKey':!!_0x287afd['accessKey'],'format':_0x287afd[_0x422303(0x201)]??null,'pageSize':_0x287afd['pageSize']??null,'riskLevel':_0x287afd[_0x422303(0x1f2)]??null,'locale':_0x287afd[_0x422303(0x1ff)]??null};}export function buildAppDoctorFields(_0x20508d,_0x3abb8d){const _0x490a11=a103_0x3349bb;return{'env':{'value':_0x20508d[_0x490a11(0x1e1)]||_0x3abb8d['env'],'source':_0x20508d[_0x490a11(0x1e1)]?_0x490a11(0x1e7):_0x490a11(0x1fc)},'apiDir':{'value':_0x20508d['apiDir']||_0x3abb8d[_0x490a11(0x1e2)],'source':_0x20508d[_0x490a11(0x1e2)]?'app':'inherit'},'cookie':{'value':_0x20508d['cookie']||_0x3abb8d['cookie'],'source':_0x20508d[_0x490a11(0x1e6)]?_0x490a11(0x1e7):'inherit'},'accessKey':{'value':_0x20508d[_0x490a11(0x1fa)]||_0x3abb8d[_0x490a11(0x1fa)],'source':_0x20508d[_0x490a11(0x1fa)]?_0x490a11(0x1e7):'inherit'}};}export function buildCanonicalAppConfig(_0xa4f799,_0x2fbe03){const _0x47fe2f=a103_0x3349bb,_0x3fa2fd=_0xa4f799['map'](_0x4ce38b=>String(_0x4ce38b||'')[_0x47fe2f(0x1f8)]())[_0x47fe2f(0x1f4)](Boolean);if(_0x3fa2fd[_0x47fe2f(0x1f1)]===0x0)return{};const _0x8920fe={};for(const _0x36a8e2 of _0x3fa2fd){_0x8920fe[_0x36a8e2]=_0x2fbe03?{'appcode':_0x36a8e2,'env':_0x2fbe03}:{'appcode':_0x36a8e2};}return{'apps':_0x8920fe,'defaultApp':_0x3fa2fd[0x0]};}export function buildCanonicalProjectConfig(_0x5deae2,_0x28c4e0){const _0x10dca5=a103_0x3349bb,{appCodes:appCodes=[],env:_0x3e19cf,metadata:_0x17e4b5}=_0x28c4e0,_0xe743c8={..._0x5deae2,..._0x17e4b5||{}};delete _0xe743c8['appcode'],delete _0xe743c8[_0x10dca5(0x1e7)];if(_0x3e19cf)_0xe743c8[_0x10dca5(0x1e1)]=_0x3e19cf;else!_0xe743c8[_0x10dca5(0x1e1)]&&(_0xe743c8[_0x10dca5(0x1e1)]=DEFAULT_CONFIG_VALUES[_0x10dca5(0x1e1)]);const _0x1cc1e3=buildCanonicalAppConfig(appCodes,_0xe743c8[_0x10dca5(0x1e1)]);return Object['keys'](_0x1cc1e3)[_0x10dca5(0x1f1)]>0x0&&(_0xe743c8[_0x10dca5(0x204)]=_0x1cc1e3[_0x10dca5(0x204)],_0xe743c8['defaultApp']=_0x1cc1e3['defaultApp']),_0xe743c8;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a103_0x3349bb(0x1ed),'zh_cn':a103_0x3349bb(0x1ed),'en':'en-US','en-us':a103_0x3349bb(0x1ef),'en_us':'en-US'};export function normalizeLocale(_0x598c7e){if(!_0x598c7e)return null;return LOCALE_MAP[_0x598c7e['toLowerCase']()]??null;}
@@ -1 +1 @@
1
- const a102_0x47eeb6=a102_0x3099;(function(_0x40b235,_0x58dd7a){const _0x367fd8=a102_0x3099,_0x5eb90f=_0x40b235();while(!![]){try{const _0x229ebd=-parseInt(_0x367fd8(0xe4))/0x1+-parseInt(_0x367fd8(0xd0))/0x2*(parseInt(_0x367fd8(0xd2))/0x3)+-parseInt(_0x367fd8(0xc8))/0x4+-parseInt(_0x367fd8(0x99))/0x5+parseInt(_0x367fd8(0x9a))/0x6*(parseInt(_0x367fd8(0xbd))/0x7)+parseInt(_0x367fd8(0x9f))/0x8*(parseInt(_0x367fd8(0x8f))/0x9)+parseInt(_0x367fd8(0xd5))/0xa;if(_0x229ebd===_0x58dd7a)break;else _0x5eb90f['push'](_0x5eb90f['shift']());}catch(_0x5e2eb0){_0x5eb90f['push'](_0x5eb90f['shift']());}}}(a102_0x2a1e,0x397ee));export const CLI_BIN_NAME=a102_0x47eeb6(0xa8);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a102_0x3099(_0x254406,_0x984eeb){_0x254406=_0x254406-0x86;const _0x2a1e61=a102_0x2a1e();let _0x3099c2=_0x2a1e61[_0x254406];return _0x3099c2;}export const NPM_PACKAGE_NAME=a102_0x47eeb6(0xb3);export const GLOBAL_FLAGS=[{'name':a102_0x47eeb6(0xba),'meowKey':'appcode','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xcb),'hint':a102_0x47eeb6(0xbc)},{'name':a102_0x47eeb6(0xa3),'meowKey':'app','type':'string','description':a102_0x47eeb6(0x96),'hint':a102_0x47eeb6(0xd7)},{'name':a102_0x47eeb6(0xb0),'meowKey':'env','type':a102_0x47eeb6(0x8d),'description':'Environment','hint':'production\x20|\x20daily'},{'name':a102_0x47eeb6(0xda),'meowKey':a102_0x47eeb6(0xda),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0x87),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xd3),'hint':a102_0x47eeb6(0xd8)},{'name':a102_0x47eeb6(0xb2),'meowKey':a102_0x47eeb6(0xca),'type':'boolean','description':a102_0x47eeb6(0xc4)},{'name':'yes','meowKey':'yes','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xbf)},{'name':a102_0x47eeb6(0x92),'meowKey':'nonInteractive','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0x94)},{'name':'global','meowKey':a102_0x47eeb6(0xe3),'type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0x91)},{'name':a102_0x47eeb6(0xc2),'meowKey':a102_0x47eeb6(0xc2),'type':'boolean','description':a102_0x47eeb6(0xdd)},{'name':'ci','meowKey':'ci','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xbe),'hidden':!![]},{'name':'help','meowKey':'help','type':'boolean','description':a102_0x47eeb6(0xc7)},{'name':'name','meowKey':a102_0x47eeb6(0x8b),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xab),'hidden':!![]},{'name':a102_0x47eeb6(0xb9),'meowKey':a102_0x47eeb6(0xb9),'type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xd6),'hidden':!![]},{'name':a102_0x47eeb6(0x86),'meowKey':'watch','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xde),'hidden':!![]},{'name':a102_0x47eeb6(0xaa),'meowKey':'output','type':a102_0x47eeb6(0x8d),'description':'Output\x20path','hidden':!![]},{'name':a102_0x47eeb6(0xb8),'meowKey':a102_0x47eeb6(0xb8),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xc9),'hidden':!![]},{'name':a102_0x47eeb6(0xc3),'meowKey':'datasetcode','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0x9d),'hidden':!![]},{'name':'all','meowKey':a102_0x47eeb6(0x89),'type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xdc),'hidden':!![]},{'name':a102_0x47eeb6(0xe2),'meowKey':'enableBffSave','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xae),'hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':a102_0x47eeb6(0xc6),'hidden':!![]},{'name':a102_0x47eeb6(0xcc),'meowKey':a102_0x47eeb6(0xcc),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xc1),'hidden':!![]},{'name':a102_0x47eeb6(0xd4),'meowKey':'file','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xc0),'hidden':!![]},{'name':a102_0x47eeb6(0xdf),'meowKey':'sqlcode','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xce),'hidden':!![]},{'name':a102_0x47eeb6(0x97),'meowKey':a102_0x47eeb6(0x97),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xc5),'hidden':!![]},{'name':a102_0x47eeb6(0x98),'meowKey':a102_0x47eeb6(0x98),'type':a102_0x47eeb6(0x8d),'description':'DB\x20ID','hidden':!![]},{'name':a102_0x47eeb6(0xa4),'meowKey':'description','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xad),'hidden':!![]},{'name':'page','meowKey':a102_0x47eeb6(0xb4),'type':a102_0x47eeb6(0x8d),'description':'Page\x20number','hidden':!![]},{'name':a102_0x47eeb6(0x8e),'meowKey':a102_0x47eeb6(0x8e),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xb1),'hidden':!![]},{'name':a102_0x47eeb6(0x8a),'meowKey':a102_0x47eeb6(0x8a),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xcf),'hidden':!![]},{'name':'code','meowKey':a102_0x47eeb6(0x93),'type':'string','description':a102_0x47eeb6(0xd1),'hidden':!![]},{'name':a102_0x47eeb6(0xac),'meowKey':a102_0x47eeb6(0xac),'type':'string','description':a102_0x47eeb6(0x8c),'hidden':!![]},{'name':a102_0x47eeb6(0xa6),'meowKey':a102_0x47eeb6(0xa6),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xa1),'hidden':!![]},{'name':a102_0x47eeb6(0xa2),'meowKey':'operation','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xcd),'hidden':!![]},{'name':a102_0x47eeb6(0xb7),'meowKey':a102_0x47eeb6(0xb7),'type':'string','description':a102_0x47eeb6(0xa9),'hidden':!![]},{'name':a102_0x47eeb6(0xbb),'meowKey':a102_0x47eeb6(0xe0),'type':a102_0x47eeb6(0x9b),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a102_0x47eeb6(0xd9),'meowKey':'key','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0x9e),'hidden':!![]},{'name':a102_0x47eeb6(0xdb),'meowKey':a102_0x47eeb6(0xdb),'type':a102_0x47eeb6(0x8d),'description':'Config\x20value','hidden':!![]},{'name':a102_0x47eeb6(0x90),'meowKey':a102_0x47eeb6(0x90),'type':'boolean','description':a102_0x47eeb6(0x95),'hidden':!![]},{'name':a102_0x47eeb6(0xb5),'meowKey':'remote','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xe1),'hidden':!![]},{'name':a102_0x47eeb6(0xa5),'meowKey':'verbose','type':a102_0x47eeb6(0x9b),'description':a102_0x47eeb6(0xaf),'hidden':!![]},{'name':a102_0x47eeb6(0xa7),'meowKey':'operationType','type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xcd),'hidden':!![]},{'name':a102_0x47eeb6(0x9c),'meowKey':a102_0x47eeb6(0xb6),'type':a102_0x47eeb6(0x8d),'description':a102_0x47eeb6(0xa0),'hidden':!![]}];function a102_0x2a1e(){const _0x53ef01=['output','Name','sql','Description','Enable\x20BFF\x20save','Verbose\x20output','env','Page\x20size','dry-run','@lovrabet/rabetbase-cli','page','remote','functionNode','target','params','clear','appcode','skip-imports','<code>','214151cixfXe','Alias\x20for\x20--non-interactive','Skip\x20confirmation\x20for\x20high-risk\x20writes','File\x20path','Type\x20filter','project','datasetcode','Preview\x20operation\x20without\x20executing','SQL\x20name','Record\x20ID','Show\x20help','1504136brAZJI','JSON\x20params','dryRun','Override\x20appcode','type','Operation\x20type','SQL\x20code','Keyword\x20filter','40382IcIOHU','Code\x20filter','3yDVOsu','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','file','8586540qjbzNn','Clear','<name>','<expr>','key','format','value','Apply\x20to\x20all','Use\x20project\x20config\x20scope','Watch\x20mode','sqlcode','skipImports','Use\x20remote','enable-bff-save','global','178070JeTyiA','watch','Output\x20format','meowKey','all','keyword','name','SQL\x20string','string','pagesize','497997EOTwUg','force','Use\x20global\x20config\x20scope','non-interactive','code','Force\x20non-interactive\x20mode\x20(CI)','Force\x20overwrite','Select\x20app\x20profile\x20by\x20name','sqlname','dbid','673915sPwwee','6JvspkN','boolean','function-node','Dataset\x20code','Config\x20key','8hJcRVQ','Function\x20node','Schemas','operation','app','description','verbose','schemas','operation-type','rabetbase','Target\x20path'];a102_0x2a1e=function(){return _0x53ef01;};return a102_0x2a1e();}export function buildMeowFlags(){const _0x13dd17=a102_0x47eeb6;return Object['fromEntries'](GLOBAL_FLAGS['map'](_0x3f19da=>[_0x3f19da[_0x13dd17(0x88)],{'type':_0x3f19da['type']}]));}
1
+ const a104_0x5000bb=a104_0xc000;(function(_0x107066,_0x44a69d){const _0x231c25=a104_0xc000,_0x2f54af=_0x107066();while(!![]){try{const _0x169d34=parseInt(_0x231c25(0x115))/0x1*(-parseInt(_0x231c25(0x153))/0x2)+-parseInt(_0x231c25(0x10e))/0x3+-parseInt(_0x231c25(0x15d))/0x4+parseInt(_0x231c25(0x138))/0x5*(parseInt(_0x231c25(0x117))/0x6)+-parseInt(_0x231c25(0x151))/0x7*(-parseInt(_0x231c25(0x135))/0x8)+-parseInt(_0x231c25(0x134))/0x9+parseInt(_0x231c25(0x10d))/0xa*(parseInt(_0x231c25(0x130))/0xb);if(_0x169d34===_0x44a69d)break;else _0x2f54af['push'](_0x2f54af['shift']());}catch(_0x216a11){_0x2f54af['push'](_0x2f54af['shift']());}}}(a104_0xee9a,0xd9840));function a104_0xc000(_0xf09550,_0x598a0c){_0xf09550=_0xf09550-0x109;const _0xee9a06=a104_0xee9a();let _0xc000e=_0xee9a06[_0xf09550];return _0xc000e;}function a104_0xee9a(){const _0x2fe0a3=['Output\x20path','yes','nonInteractive','Type\x20filter','keyword','map','operation','format','key','Use\x20remote','force','global','6587wpGWUQ','string','2DRVRbz','DB\x20ID','@lovrabet/rabetbase-cli','functionNode','SQL\x20string','Page\x20size','project','operationType','params','meowKey','123436JuwdCE','SQL\x20name','Page\x20number','env','Config\x20value','dbid','rabetbase','operation-type','verbose','output','Use\x20project\x20config\x20scope','pagesize','app','remote','Target\x20path','Output\x20format','2830350SxLvPG','2118048PvLrqU','Operation\x20type','json\x20|\x20pretty\x20|\x20compress','value','Dataset\x20code','name','Use\x20global\x20config\x20scope','1323919qWXBdd','<expr>','9783282FpdGdJ','non-interactive','sqlname','code','page','clear','sql','enable-bff-save','Force\x20overwrite','production\x20|\x20daily','Skip\x20import\x20generation','SQL\x20code','<code>','Select\x20app\x20profile\x20by\x20name','appcode','Keyword\x20filter','Clear','Enable\x20BFF\x20save','file','Watch\x20mode','Force\x20non-interactive\x20mode\x20(CI)','all','watch','enableBffSave','JSON\x20params','55SuxMJS','type','Alias\x20for\x20--non-interactive','Record\x20ID','13735674ZfVvst','12176URkqsT','Environment','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','5wrpTPo','Apply\x20to\x20all','Description','skip-imports','Rabetbase\x20CLI','dry-run','dryRun','help','schemas','Verbose\x20output','boolean','Override\x20appcode','datasetcode'];a104_0xee9a=function(){return _0x2fe0a3;};return a104_0xee9a();}export const CLI_BIN_NAME=a104_0x5000bb(0x163);export const CLI_DISPLAY_NAME=a104_0x5000bb(0x13c);export const NPM_PACKAGE_NAME=a104_0x5000bb(0x155);export const GLOBAL_FLAGS=[{'name':a104_0x5000bb(0x125),'meowKey':a104_0x5000bb(0x125),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x143),'hint':a104_0x5000bb(0x123)},{'name':a104_0x5000bb(0x109),'meowKey':a104_0x5000bb(0x109),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x124),'hint':'<name>'},{'name':a104_0x5000bb(0x160),'meowKey':'env','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x136),'hint':a104_0x5000bb(0x120)},{'name':a104_0x5000bb(0x14c),'meowKey':a104_0x5000bb(0x14c),'type':'string','description':a104_0x5000bb(0x10c),'hint':a104_0x5000bb(0x110)},{'name':'jq','meowKey':'jq','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x137),'hint':a104_0x5000bb(0x116)},{'name':'dry-run','meowKey':a104_0x5000bb(0x13e),'type':a104_0x5000bb(0x142),'description':'Preview\x20operation\x20without\x20executing'},{'name':a104_0x5000bb(0x146),'meowKey':a104_0x5000bb(0x146),'type':a104_0x5000bb(0x142),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a104_0x5000bb(0x118),'meowKey':a104_0x5000bb(0x147),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x12b)},{'name':a104_0x5000bb(0x150),'meowKey':'global','type':'boolean','description':a104_0x5000bb(0x114)},{'name':'project','meowKey':a104_0x5000bb(0x159),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x167)},{'name':'ci','meowKey':'ci','type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x132),'hidden':!![]},{'name':a104_0x5000bb(0x13f),'meowKey':a104_0x5000bb(0x13f),'type':a104_0x5000bb(0x142),'description':'Show\x20help'},{'name':a104_0x5000bb(0x113),'meowKey':a104_0x5000bb(0x113),'type':a104_0x5000bb(0x152),'description':'Name','hidden':!![]},{'name':a104_0x5000bb(0x11c),'meowKey':a104_0x5000bb(0x11c),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x127),'hidden':!![]},{'name':a104_0x5000bb(0x12d),'meowKey':'watch','type':'boolean','description':a104_0x5000bb(0x12a),'hidden':!![]},{'name':'output','meowKey':a104_0x5000bb(0x166),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x145),'hidden':!![]},{'name':a104_0x5000bb(0x15b),'meowKey':a104_0x5000bb(0x15b),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x12f),'hidden':!![]},{'name':'datasetcode','meowKey':a104_0x5000bb(0x144),'type':'string','description':a104_0x5000bb(0x112),'hidden':!![]},{'name':a104_0x5000bb(0x12c),'meowKey':a104_0x5000bb(0x12c),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x139),'hidden':!![]},{'name':a104_0x5000bb(0x11e),'meowKey':a104_0x5000bb(0x12e),'type':'boolean','description':a104_0x5000bb(0x128),'hidden':!![]},{'name':'id','meowKey':'id','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x133),'hidden':!![]},{'name':a104_0x5000bb(0x131),'meowKey':a104_0x5000bb(0x131),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x148),'hidden':!![]},{'name':a104_0x5000bb(0x129),'meowKey':'file','type':a104_0x5000bb(0x152),'description':'File\x20path','hidden':!![]},{'name':'sqlcode','meowKey':'sqlcode','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x122),'hidden':!![]},{'name':a104_0x5000bb(0x119),'meowKey':a104_0x5000bb(0x119),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x15e),'hidden':!![]},{'name':a104_0x5000bb(0x162),'meowKey':'dbid','type':'string','description':a104_0x5000bb(0x154),'hidden':!![]},{'name':'description','meowKey':'description','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x13a),'hidden':!![]},{'name':'page','meowKey':a104_0x5000bb(0x11b),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x15f),'hidden':!![]},{'name':a104_0x5000bb(0x168),'meowKey':'pagesize','type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x158),'hidden':!![]},{'name':'keyword','meowKey':a104_0x5000bb(0x149),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x126),'hidden':!![]},{'name':a104_0x5000bb(0x11a),'meowKey':a104_0x5000bb(0x11a),'type':a104_0x5000bb(0x152),'description':'Code\x20filter','hidden':!![]},{'name':'sql','meowKey':a104_0x5000bb(0x11d),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x157),'hidden':!![]},{'name':a104_0x5000bb(0x140),'meowKey':'schemas','type':'string','description':'Schemas','hidden':!![]},{'name':a104_0x5000bb(0x14b),'meowKey':a104_0x5000bb(0x14b),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x10f),'hidden':!![]},{'name':'target','meowKey':'target','type':'string','description':a104_0x5000bb(0x10b),'hidden':!![]},{'name':a104_0x5000bb(0x13b),'meowKey':'skipImports','type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x121),'hidden':!![]},{'name':a104_0x5000bb(0x14d),'meowKey':a104_0x5000bb(0x14d),'type':a104_0x5000bb(0x152),'description':'Config\x20key','hidden':!![]},{'name':a104_0x5000bb(0x111),'meowKey':a104_0x5000bb(0x111),'type':'string','description':a104_0x5000bb(0x161),'hidden':!![]},{'name':a104_0x5000bb(0x14f),'meowKey':a104_0x5000bb(0x14f),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x11f),'hidden':!![]},{'name':a104_0x5000bb(0x10a),'meowKey':a104_0x5000bb(0x10a),'type':a104_0x5000bb(0x142),'description':a104_0x5000bb(0x14e),'hidden':!![]},{'name':a104_0x5000bb(0x165),'meowKey':a104_0x5000bb(0x165),'type':'boolean','description':a104_0x5000bb(0x141),'hidden':!![]},{'name':a104_0x5000bb(0x164),'meowKey':a104_0x5000bb(0x15a),'type':a104_0x5000bb(0x152),'description':a104_0x5000bb(0x10f),'hidden':!![]},{'name':'function-node','meowKey':a104_0x5000bb(0x156),'type':a104_0x5000bb(0x152),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a104_0x5000bb(0x125),'app',a104_0x5000bb(0x160),a104_0x5000bb(0x14c),'jq',a104_0x5000bb(0x13d),a104_0x5000bb(0x146),'non-interactive','ci']);export function buildMeowFlags(){const _0x16a667=a104_0x5000bb;return Object['fromEntries'](GLOBAL_FLAGS[_0x16a667(0x14a)](_0x15edc2=>[_0x15edc2[_0x16a667(0x15c)],{'type':_0x15edc2[_0x16a667(0x131)]}]));}
@@ -0,0 +1 @@
1
+ const a105_0x3ef1ca=a105_0x355c;function a105_0x355c(_0x4e5d62,_0x1473fa){_0x4e5d62=_0x4e5d62-0x1a1;const _0x5e8c1d=a105_0x5e8c();let _0x355c56=_0x5e8c1d[_0x4e5d62];return _0x355c56;}(function(_0x41312f,_0x1d34df){const _0x44f993=a105_0x355c,_0x1aad24=_0x41312f();while(!![]){try{const _0x35818b=-parseInt(_0x44f993(0x1a1))/0x1*(parseInt(_0x44f993(0x1a6))/0x2)+-parseInt(_0x44f993(0x1ae))/0x3*(parseInt(_0x44f993(0x1a9))/0x4)+parseInt(_0x44f993(0x1a3))/0x5*(parseInt(_0x44f993(0x1aa))/0x6)+parseInt(_0x44f993(0x1ab))/0x7+-parseInt(_0x44f993(0x1ad))/0x8+-parseInt(_0x44f993(0x1a4))/0x9*(parseInt(_0x44f993(0x1ac))/0xa)+parseInt(_0x44f993(0x1af))/0xb;if(_0x35818b===_0x1d34df)break;else _0x1aad24['push'](_0x1aad24['shift']());}catch(_0x51ef03){_0x1aad24['push'](_0x1aad24['shift']());}}}(a105_0x5e8c,0x863f5));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a105_0x3ef1ca(0x1a2),'format':a105_0x3ef1ca(0x1a7),'locale':a105_0x3ef1ca(0x1a8),'riskLevel':a105_0x3ef1ca(0x1a5),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';function a105_0x5e8c(){const _0x57cf91=['production','37745HVNWOq','34866rtlRjF','high-risk-write','426ORfdAC','compress','en-US','4NWMMZn','300LxYgsG','2479715sEEASl','1970uhcMFi','8517296IHFHXR','773823uGgPAB','32712482mnZdls','5023aaAKKo'];a105_0x5e8c=function(){return _0x57cf91;};return a105_0x5e8c();}
@@ -1 +1 @@
1
- function a103_0x4f5d(){const _0x7a833a=['2427805kLpnwq','8bZiPnY','https://daily-runtime.lovrabet.com','7659281VNIHTI','2rsSISz','2893GHQEeD','6684576hXJLkb','https://daily-api.lovrabet.com','userDomain','https://user.lovrabet.com','6NCJQIp','https://user-daily.lovrabet.com','63620LhsHTP','1051200jhUbDw','https://api.lovrabet.com','10431000rKyEyn','948254MTPJUb'];a103_0x4f5d=function(){return _0x7a833a;};return a103_0x4f5d();}const a103_0x14ae0c=a103_0x42b0;(function(_0x562264,_0x537fcb){const _0x332125=a103_0x42b0,_0x21e44e=_0x562264();while(!![]){try{const _0x1b44ec=parseInt(_0x332125(0xee))/0x1*(parseInt(_0x332125(0xf3))/0x2)+parseInt(_0x332125(0xeb))/0x3*(-parseInt(_0x332125(0xf0))/0x4)+-parseInt(_0x332125(0xef))/0x5+-parseInt(_0x332125(0xe8))/0x6*(parseInt(_0x332125(0xf2))/0x7)+-parseInt(_0x332125(0xf5))/0x8+parseInt(_0x332125(0xed))/0x9+-parseInt(_0x332125(0xea))/0xa*(-parseInt(_0x332125(0xf4))/0xb);if(_0x1b44ec===_0x537fcb)break;else _0x21e44e['push'](_0x21e44e['shift']());}catch(_0x5df476){_0x21e44e['push'](_0x21e44e['shift']());}}}(a103_0x4f5d,0xa2318));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2d2385){const _0x17f858=a103_0x42b0;customApiDomain=_0x2d2385?.['apiDomain'],customUserDomain=_0x2d2385?.[_0x17f858(0xf7)],customRuntimeDomain=_0x2d2385?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a103_0x14ae0c(0xe7):a103_0x14ae0c(0xe9));function a103_0x42b0(_0x45d8e5,_0x5752a6){_0x45d8e5=_0x45d8e5-0xe7;const _0x4f5d6a=a103_0x4f5d();let _0x42b079=_0x4f5d6a[_0x45d8e5];return _0x42b079;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a103_0x14ae0c(0xec):a103_0x14ae0c(0xf6));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a103_0x14ae0c(0xf1));
1
+ const a106_0x4dc1bc=a106_0xadc4;(function(_0x35723a,_0x1a8e37){const _0x33781b=a106_0xadc4,_0x4f7029=_0x35723a();while(!![]){try{const _0x4544b1=parseInt(_0x33781b(0x96))/0x1*(-parseInt(_0x33781b(0x9a))/0x2)+parseInt(_0x33781b(0x9b))/0x3*(parseInt(_0x33781b(0x9d))/0x4)+parseInt(_0x33781b(0x9e))/0x5+-parseInt(_0x33781b(0x91))/0x6+parseInt(_0x33781b(0x8f))/0x7*(-parseInt(_0x33781b(0x8d))/0x8)+parseInt(_0x33781b(0x9c))/0x9*(-parseInt(_0x33781b(0x99))/0xa)+parseInt(_0x33781b(0x94))/0xb*(parseInt(_0x33781b(0x8e))/0xc);if(_0x4544b1===_0x1a8e37)break;else _0x4f7029['push'](_0x4f7029['shift']());}catch(_0x7a93df){_0x4f7029['push'](_0x4f7029['shift']());}}}(a106_0x7ca0,0xaf36c));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x5a2862){const _0x311cc1=a106_0xadc4;customApiDomain=_0x5a2862?.['apiDomain'],customUserDomain=_0x5a2862?.[_0x311cc1(0x93)],customRuntimeDomain=_0x5a2862?.[_0x311cc1(0x92)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a106_0x4dc1bc(0x97):a106_0x4dc1bc(0x98));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a106_0x4dc1bc(0x95):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a106_0x4dc1bc(0x90):'https://daily-runtime.lovrabet.com');function a106_0xadc4(_0x1c778b,_0x20e321){_0x1c778b=_0x1c778b-0x8d;const _0x7ca0b1=a106_0x7ca0();let _0xadc46b=_0x7ca0b1[_0x1c778b];return _0xadc46b;}function a106_0x7ca0(){const _0x4197ff=['8GqOuVA','12qxepIt','6278685TWpTzW','https://runtime.lovrabet.com','4203210qNrieF','runtimeDomain','userDomain','13057242ennZbP','https://api.lovrabet.com','5AfmrWX','https://user.lovrabet.com','https://user-daily.lovrabet.com','116590gsZXlP','59026llVbIi','3YIUwdR','99xwuVNB','4902816XjXjIB','891270nbqupD'];a106_0x7ca0=function(){return _0x4197ff;};return a106_0x7ca0();}
@@ -1 +1 @@
1
- function a104_0x548b(_0x37bcab,_0x286b55){_0x37bcab=_0x37bcab-0x14e;const _0x2b80b7=a104_0x2b80();let _0x548bc3=_0x2b80b7[_0x37bcab];return _0x548bc3;}const a104_0x17d00a=a104_0x548b;(function(_0x22f742,_0x295441){const _0x760b73=a104_0x548b,_0xccf654=_0x22f742();while(!![]){try{const _0x4b8dd2=-parseInt(_0x760b73(0x155))/0x1*(-parseInt(_0x760b73(0x14f))/0x2)+-parseInt(_0x760b73(0x158))/0x3*(parseInt(_0x760b73(0x154))/0x4)+-parseInt(_0x760b73(0x15c))/0x5+-parseInt(_0x760b73(0x157))/0x6*(-parseInt(_0x760b73(0x156))/0x7)+parseInt(_0x760b73(0x152))/0x8+-parseInt(_0x760b73(0x159))/0x9+parseInt(_0x760b73(0x14e))/0xa;if(_0x4b8dd2===_0x295441)break;else _0xccf654['push'](_0xccf654['shift']());}catch(_0x18b4c9){_0xccf654['push'](_0xccf654['shift']());}}}(a104_0x2b80,0xc623d));export function normalizeEnv(_0x5cd3e1){const _0x3c7577=a104_0x548b;return _0x5cd3e1===_0x3c7577(0x153)?_0x3c7577(0x15a):_0x5cd3e1;}export function isProduction(_0x5a371a){const _0x2bf22d=a104_0x548b;return normalizeEnv(_0x5a371a)===_0x2bf22d(0x15a);}export function isDaily(_0x192f14){const _0x1da93d=a104_0x548b;return normalizeEnv(_0x192f14)===_0x1da93d(0x150);}export function isDev(_0x42079b){const _0x58f3df=a104_0x548b,_0x1f10df=normalizeEnv(_0x42079b);return _0x1f10df===_0x58f3df(0x151)||_0x1f10df===_0x58f3df(0x15b);}function a104_0x2b80(){const _0x393004=['2811472FzguJf','online','4jKOpuv','31643DPQFII','28GFIjnt','661116HUeqJU','3328734QuiGTG','11920347AaxOOo','production','dev','946095GJPztF','12820340FYeppm','86hRZOdw','daily','development'];a104_0x2b80=function(){return _0x393004;};return a104_0x2b80();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a104_0x17d00a(0x15a));export function getEnv(){return env;}export function initEnv(_0x255b15){env=normalizeEnv(_0x255b15);}
1
+ const a107_0x1ad1d5=a107_0x976d;(function(_0x375799,_0x397cb6){const _0x3464e6=a107_0x976d,_0x462565=_0x375799();while(!![]){try{const _0x3068db=-parseInt(_0x3464e6(0x19f))/0x1*(-parseInt(_0x3464e6(0x1a8))/0x2)+parseInt(_0x3464e6(0x1a5))/0x3*(-parseInt(_0x3464e6(0x19c))/0x4)+-parseInt(_0x3464e6(0x19a))/0x5*(parseInt(_0x3464e6(0x1a1))/0x6)+parseInt(_0x3464e6(0x1a6))/0x7*(-parseInt(_0x3464e6(0x19b))/0x8)+-parseInt(_0x3464e6(0x197))/0x9*(-parseInt(_0x3464e6(0x1a2))/0xa)+parseInt(_0x3464e6(0x198))/0xb+-parseInt(_0x3464e6(0x1a3))/0xc*(-parseInt(_0x3464e6(0x19d))/0xd);if(_0x3068db===_0x397cb6)break;else _0x462565['push'](_0x462565['shift']());}catch(_0x2b3cc9){_0x462565['push'](_0x462565['shift']());}}}(a107_0xc28f,0x69ee6));function a107_0x976d(_0x18b014,_0x17399f){_0x18b014=_0x18b014-0x197;const _0xc28ffa=a107_0xc28f();let _0x976da4=_0xc28ffa[_0x18b014];return _0x976da4;}export const RABETBASE_ENV_VALUES=[a107_0x1ad1d5(0x1a7),a107_0x1ad1d5(0x1a4)];export function normalizeEnv(_0x35eb4b){const _0x417e3e=a107_0x1ad1d5;return _0x35eb4b===_0x417e3e(0x199)?_0x417e3e(0x1a7):_0x35eb4b;}export function isProduction(_0x1efbf1){return normalizeEnv(_0x1efbf1)==='production';}export function isDaily(_0xa1ece2){const _0x4c8fe3=a107_0x1ad1d5;return normalizeEnv(_0xa1ece2)===_0x4c8fe3(0x1a4);}export function isDev(_0x38fef5){const _0x35ac06=a107_0x1ad1d5,_0x3cdae6=normalizeEnv(_0x38fef5);return _0x3cdae6===_0x35ac06(0x19e)||_0x3cdae6===_0x35ac06(0x1a0);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}export function initEnv(_0x2f7a05){env=normalizeEnv(_0x2f7a05);}function a107_0xc28f(){const _0x59dbff=['35PHqtyF','811376eDWOoX','5652vdZlQu','14810809ViUNEY','development','1ItfPzd','dev','565368lJoziZ','349730QMkJKU','12djVwof','daily','1245BJuAEm','14TgPJqR','production','479824zCsUss','27HNqCfE','4384655LGwQQf','online'];a107_0xc28f=function(){return _0x59dbff;};return a107_0xc28f();}
@@ -0,0 +1 @@
1
+ function a108_0x39f5(_0x700ba1,_0x2b7c19){_0x700ba1=_0x700ba1-0xed;const _0x1ad9ca=a108_0x1ad9();let _0x39f5d0=_0x1ad9ca[_0x700ba1];return _0x39f5d0;}const a108_0x18fd87=a108_0x39f5;function a108_0x1ad9(){const _0x52f3e5=['28116KzSEKH','160mGesRj','832506GBzquh','115250WPfIez','515exVaNi','compress','5651464gyyBRN','json','2593332JGNtwx','3548676vLNHkF','2vBPDbj','732528iZscOp'];a108_0x1ad9=function(){return _0x52f3e5;};return a108_0x1ad9();}(function(_0x3d10d6,_0x406f88){const _0x2bbada=a108_0x39f5,_0xc5d6bc=_0x3d10d6();while(!![]){try{const _0x1eeb3f=parseInt(_0x2bbada(0xf3))/0x1+-parseInt(_0x2bbada(0xee))/0x2*(parseInt(_0x2bbada(0xf2))/0x3)+parseInt(_0x2bbada(0xed))/0x4+-parseInt(_0x2bbada(0xf4))/0x5*(parseInt(_0x2bbada(0xf0))/0x6)+-parseInt(_0x2bbada(0xf8))/0x7+-parseInt(_0x2bbada(0xf6))/0x8+-parseInt(_0x2bbada(0xef))/0x9*(-parseInt(_0x2bbada(0xf1))/0xa);if(_0x1eeb3f===_0x406f88)break;else _0xc5d6bc['push'](_0xc5d6bc['shift']());}catch(_0x279c91){_0xc5d6bc['push'](_0xc5d6bc['shift']());}}}(a108_0x1ad9,0x722a6));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a108_0x18fd87(0xf7),'pretty',a108_0x18fd87(0xf5)];
@@ -1 +1 @@
1
- const a105_0x31794b=a105_0x22af;(function(_0x1d1aa7,_0x2b1d4e){const _0x463eb3=a105_0x22af,_0x338891=_0x1d1aa7();while(!![]){try{const _0x25644a=-parseInt(_0x463eb3(0xa4))/0x1*(parseInt(_0x463eb3(0xab))/0x2)+-parseInt(_0x463eb3(0xa9))/0x3*(parseInt(_0x463eb3(0xa8))/0x4)+parseInt(_0x463eb3(0xa7))/0x5+parseInt(_0x463eb3(0xac))/0x6*(-parseInt(_0x463eb3(0xae))/0x7)+parseInt(_0x463eb3(0xaa))/0x8+parseInt(_0x463eb3(0xb0))/0x9*(parseInt(_0x463eb3(0xaf))/0xa)+-parseInt(_0x463eb3(0xa5))/0xb*(-parseInt(_0x463eb3(0xad))/0xc);if(_0x25644a===_0x2b1d4e)break;else _0x338891['push'](_0x338891['shift']());}catch(_0x579814){_0x338891['push'](_0x338891['shift']());}}}(a105_0x3ccb,0xe2a5c));function a105_0x22af(_0x45d11d,_0x35c7fc){_0x45d11d=_0x45d11d-0xa4;const _0x3ccb26=a105_0x3ccb();let _0x22afc5=_0x3ccb26[_0x45d11d];return _0x22afc5;}export const DEFAULT_API_DIR=a105_0x31794b(0xa6);function a105_0x3ccb(){const _0x4238e1=['1936DGHQHt','./src/api','6521785ugpLpl','4kuMrtV','1169667LFKtrG','2943032EGAnct','31718PrHvaa','100692GQcKED','167244syGFtt','763MAkshl','30WHVnON','2205297oqeGxl','108xfclmh'];a105_0x3ccb=function(){return _0x4238e1;};return a105_0x3ccb();}
1
+ const a109_0x57b156=a109_0x7044;function a109_0x7044(_0x325687,_0x2e09ef){_0x325687=_0x325687-0x1b9;const _0x3d3d4f=a109_0x3d3d();let _0x70441c=_0x3d3d4f[_0x325687];return _0x70441c;}(function(_0x23c500,_0x143ba0){const _0x2cc6c6=a109_0x7044,_0x522271=_0x23c500();while(!![]){try{const _0x4f0aeb=parseInt(_0x2cc6c6(0x1bd))/0x1*(parseInt(_0x2cc6c6(0x1bb))/0x2)+parseInt(_0x2cc6c6(0x1b9))/0x3*(parseInt(_0x2cc6c6(0x1be))/0x4)+parseInt(_0x2cc6c6(0x1bf))/0x5*(parseInt(_0x2cc6c6(0x1c6))/0x6)+parseInt(_0x2cc6c6(0x1c1))/0x7+-parseInt(_0x2cc6c6(0x1ba))/0x8*(-parseInt(_0x2cc6c6(0x1c4))/0x9)+parseInt(_0x2cc6c6(0x1c3))/0xa*(parseInt(_0x2cc6c6(0x1c5))/0xb)+-parseInt(_0x2cc6c6(0x1bc))/0xc*(parseInt(_0x2cc6c6(0x1c0))/0xd);if(_0x4f0aeb===_0x143ba0)break;else _0x522271['push'](_0x522271['shift']());}catch(_0x1bfd92){_0x522271['push'](_0x522271['shift']());}}}(a109_0x3d3d,0xc00db));function a109_0x3d3d(){const _0x572605=['4887RQuQui','3644157iYHQLj','60ABMNaC','45IyREAp','2872NSkumA','2wSFVvX','60evUXoW','146912sHpvjE','54564EnNABE','585145hhvpxh','4882384gLITTC','1996141REiUvk','./src/api','20cOGBLQ'];a109_0x3d3d=function(){return _0x572605;};return a109_0x3d3d();}export const DEFAULT_API_DIR=a109_0x57b156(0x1c2);
@@ -0,0 +1 @@
1
+ const a110_0xa84346=a110_0x165c;function a110_0x3e80(){const _0x4712a9=['401359rABIUZ','read','1515771lLNRtt','104vsNWVV','7160nStCfS','2940126FqrbCq','2146362RvYaCl','high-risk-write','4890606ogEkQD','4196LOFBuV','19515933xoZvKp','write'];a110_0x3e80=function(){return _0x4712a9;};return a110_0x3e80();}(function(_0x51b1dc,_0x401cd2){const _0x2ae99d=a110_0x165c,_0x2b5203=_0x51b1dc();while(!![]){try{const _0x26bfb9=parseInt(_0x2ae99d(0x184))/0x1+-parseInt(_0x2ae99d(0x188))/0x2+parseInt(_0x2ae99d(0x187))/0x3+parseInt(_0x2ae99d(0x18b))/0x4*(parseInt(_0x2ae99d(0x186))/0x5)+parseInt(_0x2ae99d(0x18a))/0x6+parseInt(_0x2ae99d(0x182))/0x7*(-parseInt(_0x2ae99d(0x185))/0x8)+-parseInt(_0x2ae99d(0x18c))/0x9;if(_0x26bfb9===_0x401cd2)break;else _0x2b5203['push'](_0x2b5203['shift']());}catch(_0x5696b9){_0x2b5203['push'](_0x2b5203['shift']());}}}(a110_0x3e80,0xc9ae3));function a110_0x165c(_0x7b17c2,_0x4b17b5){_0x7b17c2=_0x7b17c2-0x181;const _0x3e80eb=a110_0x3e80();let _0x165cbe=_0x3e80eb[_0x7b17c2];return _0x165cbe;}export const RISK_LEVEL_VALUES=[a110_0xa84346(0x183),a110_0xa84346(0x181),a110_0xa84346(0x189)];
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a106_0x1e7077=a106_0x5aa6;(function(_0x9953e6,_0x58f894){const _0x34c4a1=a106_0x5aa6,_0xe767b=_0x9953e6();while(!![]){try{const _0x35558a=-parseInt(_0x34c4a1(0x125))/0x1*(-parseInt(_0x34c4a1(0xe8))/0x2)+parseInt(_0x34c4a1(0x112))/0x3+parseInt(_0x34c4a1(0xec))/0x4+parseInt(_0x34c4a1(0xf2))/0x5*(parseInt(_0x34c4a1(0x12f))/0x6)+parseInt(_0x34c4a1(0x10b))/0x7+-parseInt(_0x34c4a1(0x11d))/0x8+-parseInt(_0x34c4a1(0x106))/0x9*(parseInt(_0x34c4a1(0x115))/0xa);if(_0x35558a===_0x58f894)break;else _0xe767b['push'](_0xe767b['shift']());}catch(_0x4ba1aa){_0xe767b['push'](_0xe767b['shift']());}}}(a106_0xa1ba,0x21129));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x10f72f){return process.env[`RABETBASE_${_0x10f72f}`]||process.env[`LOVRABET_${_0x10f72f}`]||undefined;}export const NEW_CONFIG_NAME=a106_0x1e7077(0x114);export const CONFIG_NAMES=[a106_0x1e7077(0x114),'.lovrabet.json',a106_0x1e7077(0x10f)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x52d656=>_0x52d656!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3bc2b4){for(const _0x1b9f1e of CONFIG_NAMES){const _0x2cb485=resolve(_0x3bc2b4,_0x1b9f1e);if(existsSync(_0x2cb485))return _0x2cb485;}return undefined;}export function findProjectRootDirectory(_0x32f29e=process[a106_0x1e7077(0x10a)]()){let _0x49ae3c=resolve(_0x32f29e);const {root:_0x249ec4}=parse(_0x49ae3c),_0x3fb18c=homedir();while(!![]){if(resolveConfigPath(_0x49ae3c)){if(_0x49ae3c===_0x3fb18c)break;return _0x49ae3c;}if(_0x49ae3c===_0x249ec4||_0x49ae3c===_0x3fb18c)break;const _0x9c0de7=dirname(_0x49ae3c);if(_0x9c0de7===_0x49ae3c)break;_0x49ae3c=_0x9c0de7;}return resolve(_0x32f29e);}export async function createContext(_0x20566e){const _0xdcb2d9=a106_0x1e7077,_0x41ffa0=readRawConfig(),_0x771bcf=buildConfig(_0x41ffa0,_0x20566e),{initEnv:_0xe6d389}=await import('./constant/env.js');if(_0x771bcf[_0xdcb2d9(0xfd)])_0xe6d389(_0x771bcf[_0xdcb2d9(0xfd)]);else _0x20566e[_0xdcb2d9(0xfd)]&&typeof _0x20566e[_0xdcb2d9(0xfd)]===_0xdcb2d9(0x123)&&_0xe6d389(_0x20566e[_0xdcb2d9(0xfd)]);const {initDomains:_0xbed30b,getUserDomain:_0x2dd6d4,getApiDomain:_0x24d58e}=await import(_0xdcb2d9(0x12e));_0xbed30b({'apiDomain':_0x41ffa0[_0xdcb2d9(0x127)]||undefined,'userDomain':_0x41ffa0[_0xdcb2d9(0xe9)]||undefined,'runtimeDomain':_0x41ffa0[_0xdcb2d9(0x102)]||undefined});const _0x4faee3={'apiDomain':_0x24d58e(),'userDomain':_0x2dd6d4()},_0x374af8=await buildAuth(_0x771bcf);logger[_0xdcb2d9(0x113)](process['cwd']());const _0x1779a9=(CLI_BIN_NAME+'\x20'+process[_0xdcb2d9(0x111)]['slice'](0x2)[_0xdcb2d9(0x131)]('\x20'))['trim']();logger[_0xdcb2d9(0x126)](_0x1779a9);const {isNonInteractive:_0xc75f74}=await import(_0xdcb2d9(0x108)),_0x52823b=_0xc75f74(_0x20566e);return{'config':_0x771bcf,'auth':_0x374af8,'logger':logger,'env':_0x4faee3,'nonInteractive':_0x52823b};}function a106_0x5aa6(_0x3c7632,_0x2f0c73){_0x3c7632=_0x3c7632-0xe7;const _0xa1ba15=a106_0xa1ba();let _0x5aa6d3=_0xa1ba15[_0x3c7632];return _0x5aa6d3;}export function buildConfigFromFlags(_0x526617){return buildConfig(readRawConfig(),_0x526617);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x5e572c){const _0x55a413=a106_0x1e7077;if(!existsSync(_0x5e572c))return{'status':'missing'};try{const _0x2f8b4a=readFileSync(_0x5e572c,{'encoding':_0x55a413(0x117)});if(!_0x2f8b4a?.[_0x55a413(0xf6)]())return{'status':_0x55a413(0x12d)};const _0x5d3a87=JSON[_0x55a413(0x11c)](_0x2f8b4a);return{'status':'ok','data':_0x5d3a87};}catch(_0x42ff1d){return{'status':'error','message':_0x42ff1d instanceof Error?_0x42ff1d[_0x55a413(0x105)]:String(_0x42ff1d)};}}function parseCliConfigJsonFile(_0x3b2bf2,_0x378edd,_0x226049){const _0x54fd4c=a106_0x1e7077,_0x5e0259=inspectCliConfigJsonFile(_0x3b2bf2);if(_0x5e0259['status']===_0x54fd4c(0xe7)||_0x5e0259['status']===_0x54fd4c(0x12d))return{};if(_0x5e0259[_0x54fd4c(0xf4)]==='ok')return _0x5e0259['data'];return _0x378edd===_0x54fd4c(0xf3)&&_0x226049&&console['error'](CLI_BIN_NAME+':\x20'+_0x226049+_0x54fd4c(0x12b)+_0x3b2bf2+_0x54fd4c(0xfa)+_0x5e0259['message']),{};}export function loadRawConfigLayers(_0x19ad69){const _0x4b774c=a106_0x1e7077;let _0x57d8d2={},_0x217b0c={};const _0xf368ea=resolveConfigPath(homedir());_0xf368ea&&(_0x57d8d2=parseCliConfigJsonFile(_0xf368ea,_0x4b774c(0xf3),_0x4b774c(0x118)));const _0x53bef7=_0x19ad69??findProjectRootDirectory(),_0x3bd959=resolveConfigPath(_0x53bef7);return _0x3bd959&&(_0x217b0c=parseCliConfigJsonFile(_0x3bd959,_0x4b774c(0xf3),_0x4b774c(0x104))),{'globalPath':_0xf368ea,'projectPath':_0x3bd959,'globalConfig':_0x57d8d2,'projectConfig':_0x217b0c};}function mergeRawConfigLayers(_0x17eda0){const _0x397ae2=a106_0x1e7077,{globalConfig:_0x5173d2,projectConfig:_0x9ef696}=_0x17eda0;if(_0x9ef696[_0x397ae2(0xea)]===![]){const _0x3b7e9a={..._0x9ef696};delete _0x3b7e9a[_0x397ae2(0xea)];const _0x5991ea=_0x9ef696[_0x397ae2(0xf0)]&&typeof _0x9ef696['apps']==='object'?_0x9ef696[_0x397ae2(0xf0)]:{};Object[_0x397ae2(0xf7)](_0x5991ea)[_0x397ae2(0x11b)]>0x0?_0x3b7e9a[_0x397ae2(0xf0)]=_0x5991ea:delete _0x3b7e9a[_0x397ae2(0xf0)];if(_0x397ae2(0x129)in _0x9ef696)_0x3b7e9a[_0x397ae2(0x129)]=_0x9ef696[_0x397ae2(0x129)];else Object[_0x397ae2(0xf7)](_0x5991ea)[_0x397ae2(0x11b)]>0x0&&(_0x3b7e9a[_0x397ae2(0x129)]=Object[_0x397ae2(0xf7)](_0x5991ea)[0x0]);return _0x3b7e9a;}const _0x33e0f9=_0x5173d2[_0x397ae2(0xf0)]&&typeof _0x5173d2[_0x397ae2(0xf0)]===_0x397ae2(0x116)?_0x5173d2[_0x397ae2(0xf0)]:{},_0x41cdbb=_0x9ef696[_0x397ae2(0xf0)]&&typeof _0x9ef696[_0x397ae2(0xf0)]==='object'?_0x9ef696[_0x397ae2(0xf0)]:{},_0x305fa2={..._0x33e0f9,..._0x41cdbb},_0x106400={..._0x5173d2,..._0x9ef696};Object[_0x397ae2(0xf7)](_0x305fa2)[_0x397ae2(0x11b)]>0x0&&(_0x106400[_0x397ae2(0xf0)]=_0x305fa2);if('defaultApp'in _0x9ef696)_0x106400['defaultApp']=_0x9ef696[_0x397ae2(0x129)];else{if(_0x41cdbb&&Object[_0x397ae2(0xf7)](_0x41cdbb)[_0x397ae2(0x11b)]>0x0)_0x106400[_0x397ae2(0x129)]=Object['keys'](_0x41cdbb)[0x0];else{if(_0x5173d2[_0x397ae2(0x129)]){const _0x524ee5=Boolean(_0x9ef696[_0x397ae2(0x103)]||_0x9ef696['app']);_0x524ee5?delete _0x106400['defaultApp']:_0x106400['defaultApp']=_0x5173d2['defaultApp'];}}}return _0x106400;}export function readRawConfigWithLayers(_0x5a5fda){const _0xe06a4d=loadRawConfigLayers(_0x5a5fda);return{'config':mergeRawConfigLayers(_0xe06a4d),'layers':_0xe06a4d};}export function readRawConfig(_0x7d26cb){return mergeRawConfigLayers(loadRawConfigLayers(_0x7d26cb));}export function readConfigFile(_0x2cf51c){const _0x735f51=a106_0x1e7077;return parseCliConfigJsonFile(_0x2cf51c,_0x735f51(0xef));}export function writeConfigFile(_0x6c6f5d,_0x3211a0){const _0xee3495=a106_0x1e7077,_0x4bc4ac=dirname(_0x6c6f5d);!existsSync(_0x4bc4ac)&&mkdirSync(_0x4bc4ac,{'recursive':!![]});const _0x3f95c2=_0x6c6f5d+_0xee3495(0x110);try{writeFileSync(_0x3f95c2,JSON['stringify'](_0x3211a0,null,0x2)+'\x0a',{'encoding':_0xee3495(0x117),'mode':0x180}),renameSync(_0x3f95c2,_0x6c6f5d);}catch(_0x1a9a15){try{unlinkSync(_0x3f95c2);}catch{}throw _0x1a9a15;}}function a106_0xa1ba(){const _0x396aea=['daily','format','runtimeDomain','appcode','Project','message','9vtUCMo','find','./utils/is-non-interactive.js','APPCODE','cwd','696087xlYhJn','locale','riskLevel','app','.lovrabetrc','.tmp','argv','607290QgZjIq','setLogPath','.rabetbase.json','3287210fQzGKL','object','utf8','Global','pageSize','ENV','length','parse','531992HmcgcE','apiDir','cookie','RISK_LEVEL','MAX_RISK','APP','string','high-risk-write','3yWfoOc','setRawCommand','apiDomain','read','defaultApp','accessKey','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','maxRisk','empty','./constant/domain.js','6LJUgsH','write','join','missing','5942EOqHmM','userDomain','inherit','api.ts','852536ScZQHu','VERBOSE','./auth/get-cookie.js','silent','apps','project','33835IZKAVa','warn','status','en-US','trim','keys','true','authRequired','\x0a\x20\x20','production','FORMAT','env','entries','COOKIE'];a106_0xa1ba=function(){return _0x396aea;};return a106_0xa1ba();}export function resolveWriteConfigPath(_0x49a38c){const _0x3adf5c=a106_0x1e7077,_0x2ca48f=_0x49a38c===_0x3adf5c(0xf1)?process[_0x3adf5c(0x10a)]():homedir(),_0x4525f9=resolveConfigPath(_0x2ca48f);return _0x4525f9??resolve(_0x2ca48f,NEW_CONFIG_NAME);}function buildConfig(_0x352562,_0x1d3cc9){const _0x55ed9f=a106_0x1e7077,_0x353fef={};if(_0x352562[_0x55ed9f(0xf0)]&&typeof _0x352562[_0x55ed9f(0xf0)]===_0x55ed9f(0x116))for(const [_0x4ab925,_0x5d673b]of Object['entries'](_0x352562[_0x55ed9f(0xf0)])){_0x5d673b&&typeof _0x5d673b===_0x55ed9f(0x116)&&_0x5d673b['appcode']&&(_0x353fef[_0x4ab925]=_0x5d673b);}const _0x682d04=_0x352562['defaultApp']||undefined,_0x29deee=Object[_0x55ed9f(0xf7)](_0x353fef)[_0x55ed9f(0x11b)]>0x0,_0x29c753=_0x1d3cc9['app']||env(_0x55ed9f(0x122))||undefined,_0x4c9fae=_0x29c753||_0x682d04||undefined,_0x107dc3=_0x1d3cc9[_0x55ed9f(0x103)]||env(_0x55ed9f(0x109))||undefined,_0x50b198=_0x107dc3?Object[_0x55ed9f(0xfe)](_0x353fef)[_0x55ed9f(0x107)](([,_0x4f57fa])=>_0x4f57fa?.[_0x55ed9f(0x103)]===_0x107dc3):undefined,_0x36677e=_0x50b198?.[0x0],_0x2ad757=_0x50b198?.[0x1];let _0x29b3e1=_0x107dc3?_0x36677e:_0x4c9fae,_0x5a52d3=_0x29b3e1&&_0x353fef[_0x29b3e1]?_0x353fef[_0x29b3e1]:undefined;_0x107dc3&&_0x2ad757&&(_0x5a52d3=_0x2ad757);const _0x3f54f3=_0x107dc3?_0x2ad757??_0x5a52d3:_0x5a52d3,_0x146ba1=_0x29c753||(_0x107dc3?_0x36677e:undefined),_0x2c2a09=_0x107dc3||_0x3f54f3?.['appcode']||_0x352562[_0x55ed9f(0x103)]||_0x352562[_0x55ed9f(0x10e)]||undefined,_0x4a0d76=_0x1d3cc9[_0x55ed9f(0xfd)]||env(_0x55ed9f(0x11a))||_0x3f54f3?.[_0x55ed9f(0xfd)]||_0x352562[_0x55ed9f(0xfd)]||_0x55ed9f(0xfb),_0x54d378=_0x3f54f3?.[_0x55ed9f(0x10c)]||_0x352562[_0x55ed9f(0x10c)]||_0x55ed9f(0xf5),_0x3942c6=env(_0x55ed9f(0xff))||_0x3f54f3?.['cookie']||_0x352562[_0x55ed9f(0x11f)]||undefined,_0x27e11f=env('ACCESS_KEY')||_0x3f54f3?.[_0x55ed9f(0x12a)]||_0x352562[_0x55ed9f(0x12a)]||undefined,_0xcaf411=_0x1d3cc9[_0x55ed9f(0x101)]||env(_0x55ed9f(0xfc))||_0x3f54f3?.[_0x55ed9f(0x101)]||_0x352562[_0x55ed9f(0x101)],_0x36c991=normalizeLegacyOutputFormat(_0xcaf411),_0x340444=env('PAGE_SIZE')||_0x3f54f3?.[_0x55ed9f(0x119)]||_0x352562[_0x55ed9f(0x119)],_0x538c54=_0x340444?Number(_0x340444)||undefined:undefined,_0x5b46a9=env(_0x55ed9f(0x120))||env(_0x55ed9f(0x121))||_0x3f54f3?.[_0x55ed9f(0x10d)]||_0x352562['riskLevel']||_0x352562[_0x55ed9f(0x12c)],_0x41020c=_0x5b46a9===_0x55ed9f(0x128)||_0x5b46a9===_0x55ed9f(0x130)?_0x5b46a9:_0x55ed9f(0x124),_0x34f07f=env(_0x55ed9f(0xed)),_0x2d2b57=_0x34f07f==='1'||_0x34f07f===_0x55ed9f(0xf8),_0x4f8099=_0x3f54f3?.[_0x55ed9f(0x11e)]||_0x352562[_0x55ed9f(0x11e)]||DEFAULT_API_DIR,_0x438fbc=isDaily(normalizeEnv(String(_0x4a0d76)))?_0x55ed9f(0x100):_0x55ed9f(0xfb);return{'appCode':typeof _0x2c2a09===_0x55ed9f(0x123)&&_0x2c2a09[_0x55ed9f(0xf6)]()?_0x2c2a09[_0x55ed9f(0xf6)]():undefined,'env':_0x438fbc,'locale':_0x54d378,'cookie':_0x3942c6,'accessKey':_0x27e11f,'format':_0x36c991,'pageSize':_0x538c54,'riskLevel':_0x41020c,'verbose':_0x2d2b57,'apiDir':_0x4f8099,'apps':_0x353fef,'defaultApp':_0x682d04,'currentApp':_0x29deee?_0x29b3e1:undefined,'explicitAppName':_0x146ba1,'raw':_0x352562};}async function buildAuth(_0x571841){const _0x2fdd27=a106_0x1e7077,{getCookie:_0x226a2a}=await import(_0x2fdd27(0xee)),_0x32e375=_0x571841[_0x2fdd27(0x11f)]||_0x226a2a(),_0x537e87=_0x32e375?await getIsSessionValid():![];return{'cookie':_0x32e375,'isLoggedIn':_0x537e87,async 'getOrLogin'(){const _0x2b466c=_0x2fdd27;if(_0x32e375&&_0x537e87)return _0x32e375;throw CliErrors[_0x2b466c(0xf9)]();}};}export function resolveApiFilePath(_0x94a954,_0x1634a3){const _0x88226f=a106_0x1e7077,_0x221e5e=resolve(process['cwd'](),_0x94a954),_0x24c023=resolve(_0x221e5e,_0x88226f(0xeb));if(!_0x1634a3)return _0x24c023;const _0x68f193=readRawConfig(),_0x29c619=_0x68f193['apps']&&typeof _0x68f193['apps']===_0x88226f(0x116)?_0x68f193[_0x88226f(0xf0)]:{},_0x498a91=Object['entries'](_0x29c619)['find'](([,_0x506a06])=>_0x506a06?.[_0x88226f(0x103)]===_0x1634a3);if(!_0x498a91)return _0x24c023;const [_0x2371c3,_0x1b88ad]=_0x498a91,_0x4785a8=typeof _0x68f193[_0x88226f(0x129)]===_0x88226f(0x123)?_0x68f193[_0x88226f(0x129)]:undefined;if(_0x1b88ad?.['apiDir'])return _0x24c023;if(_0x4785a8&&_0x2371c3!==_0x4785a8)return resolve(_0x221e5e,_0x2371c3+'-api.ts');return _0x24c023;}
1
+ const a111_0xcd8bcc=a111_0x2d8f;(function(_0x287713,_0x37e72d){const _0x24ad89=a111_0x2d8f,_0x374508=_0x287713();while(!![]){try{const _0x36020b=-parseInt(_0x24ad89(0x185))/0x1*(-parseInt(_0x24ad89(0x1d0))/0x2)+-parseInt(_0x24ad89(0x1ad))/0x3+-parseInt(_0x24ad89(0x1c8))/0x4+-parseInt(_0x24ad89(0x1bf))/0x5*(parseInt(_0x24ad89(0x1ce))/0x6)+-parseInt(_0x24ad89(0x197))/0x7*(parseInt(_0x24ad89(0x1b7))/0x8)+-parseInt(_0x24ad89(0x1c0))/0x9+-parseInt(_0x24ad89(0x1c4))/0xa*(-parseInt(_0x24ad89(0x18b))/0xb);if(_0x36020b===_0x37e72d)break;else _0x374508['push'](_0x374508['shift']());}catch(_0x1b34c1){_0x374508['push'](_0x374508['shift']());}}}(a111_0x80ed,0xed507));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';function a111_0x2d8f(_0x3167fe,_0x4a049f){_0x3167fe=_0x3167fe-0x185;const _0x80ed54=a111_0x80ed();let _0x2d8ffa=_0x80ed54[_0x3167fe];return _0x2d8ffa;}import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x3196a0){return process.env[`RABETBASE_${_0x3196a0}`]||process.env[`LOVRABET_${_0x3196a0}`]||undefined;}export const NEW_CONFIG_NAME=a111_0xcd8bcc(0x1ac);export const CONFIG_NAMES=[a111_0xcd8bcc(0x1ac),'.lovrabet.json',a111_0xcd8bcc(0x1d1)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a111_0xcd8bcc(0x1af)](_0x738d6=>_0x738d6!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x195dba){for(const _0x57a956 of CONFIG_NAMES){const _0x55b089=resolve(_0x195dba,_0x57a956);if(existsSync(_0x55b089))return _0x55b089;}return undefined;}export function findProjectRootDirectory(_0x21e835=process[a111_0xcd8bcc(0x1cf)]()){let _0x1f6e10=resolve(_0x21e835);const {root:_0x2fbb0e}=parse(_0x1f6e10),_0x10c8a7=homedir();while(!![]){if(resolveConfigPath(_0x1f6e10)){if(_0x1f6e10===_0x10c8a7)break;return _0x1f6e10;}if(_0x1f6e10===_0x2fbb0e||_0x1f6e10===_0x10c8a7)break;const _0x4b56cf=dirname(_0x1f6e10);if(_0x4b56cf===_0x1f6e10)break;_0x1f6e10=_0x4b56cf;}return resolve(_0x21e835);}export async function createContext(_0x574763){const _0x49e1ac=a111_0xcd8bcc,_0x3c6177=readRawConfig(),_0x1b35aa=buildConfig(_0x3c6177,_0x574763),{initEnv:_0x2eb72e}=await import('./constant/env.js');if(_0x1b35aa[_0x49e1ac(0x192)])_0x2eb72e(_0x1b35aa['env']);else _0x574763[_0x49e1ac(0x192)]&&typeof _0x574763[_0x49e1ac(0x192)]===_0x49e1ac(0x19f)&&_0x2eb72e(_0x574763[_0x49e1ac(0x192)]);const {initDomains:_0x2e31ef,getUserDomain:_0x11ec15,getApiDomain:_0x1f6d92}=await import(_0x49e1ac(0x19c));_0x2e31ef({'apiDomain':_0x3c6177[_0x49e1ac(0x19b)]||undefined,'userDomain':_0x3c6177[_0x49e1ac(0x193)]||undefined,'runtimeDomain':_0x3c6177[_0x49e1ac(0x1cb)]||undefined});const _0x35578a={'apiDomain':_0x1f6d92(),'userDomain':_0x11ec15()},_0x18ece3=await buildAuth(_0x1b35aa);logger[_0x49e1ac(0x187)](process['cwd']());const _0x2b6991=(CLI_BIN_NAME+'\x20'+process[_0x49e1ac(0x1ba)][_0x49e1ac(0x1ca)](0x2)['join']('\x20'))[_0x49e1ac(0x1d2)]();logger['setRawCommand'](_0x2b6991);const {isNonInteractive:_0x3bd77e}=await import(_0x49e1ac(0x18a)),_0x13e220=_0x3bd77e(_0x574763);return{'config':_0x1b35aa,'auth':_0x18ece3,'logger':logger,'env':_0x35578a,'nonInteractive':_0x13e220};}export function buildConfigFromFlags(_0x435920){return buildConfig(readRawConfig(),_0x435920);}export function getProjectConfigPath(){const _0x1520af=a111_0xcd8bcc;return resolveConfigPath(process[_0x1520af(0x1cf)]());}function a111_0x80ed(){const _0x3e2d37=['pageSize','authRequired','appcode','projectConfig','env','userDomain','locale','silent','data','24493xLvjHf','defaultApp','find','RISK_LEVEL','apiDomain','./constant/domain.js','apps','migrated','string','riskLevel','apiDir','write','inherit','./auth/get-cookie.js','APPCODE','\x0a\x20\x20','read','message','PAGE_SIZE','missing','api.ts','.rabetbase.json','2212143FwEdcS','COOKIE','filter','FORMAT','parse','set','length','-api.ts','error','empty','3368eCgFtS','entries','warn','argv','values','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','keys','merged','6755yyEaCA','13459896EIKZMT','map','get','ENV','120OqAPbf','daily','status','https://g.lovrabet.com/dist/lovrabet-skill','5850780TapviR','object','slice','runtimeDomain','Project','accessKey','2496GCQgGm','cwd','756092ijuVHr','.lovrabetrc','trim','app','cookie','1xxZdSV','format','setLogPath','APP','template_base_url','./utils/is-non-interactive.js','5797649zPQvjG','config','replace'];a111_0x80ed=function(){return _0x3e2d37;};return a111_0x80ed();}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x445e72){const _0x47f4ba=a111_0xcd8bcc;if(!existsSync(_0x445e72))return{'status':_0x47f4ba(0x1aa)};try{const _0x33ffe8=readFileSync(_0x445e72,{'encoding':'utf8'});if(!_0x33ffe8?.[_0x47f4ba(0x1d2)]())return{'status':_0x47f4ba(0x1b6)};const _0x2f380d=JSON[_0x47f4ba(0x1b1)](_0x33ffe8);return{'status':'ok','data':_0x2f380d};}catch(_0x3a7150){return{'status':_0x47f4ba(0x1b5),'message':_0x3a7150 instanceof Error?_0x3a7150['message']:String(_0x3a7150)};}}function parseCliConfigJsonFile(_0x534ee8,_0x5165c5,_0x21c6cd){const _0x4d54df=a111_0xcd8bcc,_0x1569cf=inspectCliConfigJsonFile(_0x534ee8);if(_0x1569cf[_0x4d54df(0x1c6)]===_0x4d54df(0x1aa)||_0x1569cf[_0x4d54df(0x1c6)]==='empty')return{};if(_0x1569cf['status']==='ok')return _0x1569cf[_0x4d54df(0x196)];return _0x5165c5===_0x4d54df(0x1b9)&&_0x21c6cd&&console[_0x4d54df(0x1b5)](CLI_BIN_NAME+':\x20'+_0x21c6cd+_0x4d54df(0x1bc)+_0x534ee8+_0x4d54df(0x1a6)+_0x1569cf[_0x4d54df(0x1a8)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x544fa7){const _0x248e31=a111_0xcd8bcc;if(!_0x544fa7||typeof _0x544fa7!==_0x248e31(0x1c9))return{'config':{},'migrated':![]};const _0x1ec514={..._0x544fa7},_0x3ea702=_0x1ec514[_0x248e31(0x19d)]&&typeof _0x1ec514[_0x248e31(0x19d)]===_0x248e31(0x1c9)?{..._0x1ec514['apps']}:{},_0x44de28=Object['keys'](_0x3ea702)[_0x248e31(0x1b3)],_0x4a0ea3=_0x1ec514[_0x248e31(0x190)]||_0x1ec514[_0x248e31(0x1d3)];let _0xc1d464=![];if(_0x4a0ea3&&_0x44de28===0x0){const _0xf9eaf4=typeof _0x1ec514[_0x248e31(0x198)]==='string'&&_0x1ec514[_0x248e31(0x198)][_0x248e31(0x1d2)]()?_0x1ec514[_0x248e31(0x198)]:String(_0x4a0ea3)[_0x248e31(0x1d2)]();_0x3ea702[_0xf9eaf4]={'appcode':String(_0x4a0ea3)['trim'](),..._0x1ec514[_0x248e31(0x192)]!=null?{'env':_0x1ec514['env']}:{},..._0x1ec514[_0x248e31(0x1a1)]!=null?{'apiDir':_0x1ec514[_0x248e31(0x1a1)]}:{},..._0x1ec514[_0x248e31(0x1d4)]!=null?{'cookie':_0x1ec514[_0x248e31(0x1d4)]}:{},..._0x1ec514[_0x248e31(0x1cd)]!=null?{'accessKey':_0x1ec514[_0x248e31(0x1cd)]}:{},..._0x1ec514[_0x248e31(0x186)]!=null?{'format':_0x1ec514['format']}:{},..._0x1ec514[_0x248e31(0x18e)]!=null?{'pageSize':_0x1ec514[_0x248e31(0x18e)]}:{},..._0x1ec514['riskLevel']!=null?{'riskLevel':_0x1ec514[_0x248e31(0x1a0)]}:{},..._0x1ec514[_0x248e31(0x194)]!=null?{'locale':_0x1ec514[_0x248e31(0x194)]}:{}},_0x1ec514[_0x248e31(0x19d)]=_0x3ea702;if(!_0x1ec514[_0x248e31(0x198)])_0x1ec514[_0x248e31(0x198)]=_0xf9eaf4;_0xc1d464=!![];}return(_0x248e31(0x190)in _0x1ec514||_0x248e31(0x1d3)in _0x1ec514)&&(delete _0x1ec514[_0x248e31(0x190)],delete _0x1ec514['app'],_0xc1d464=!![]),{'config':_0x1ec514,'migrated':_0xc1d464};}function writeNormalizedConfigIfNeeded(_0x247be1,_0x168a90){const _0x9cfd34=a111_0xcd8bcc,_0x380e9a=JSON['stringify'](_0x168a90,null,0x2)+'\x0a';if(normalizedWriteCache[_0x9cfd34(0x1c2)](_0x247be1)===_0x380e9a)return;writeConfigFile(_0x247be1,_0x168a90),normalizedWriteCache[_0x9cfd34(0x1b2)](_0x247be1,_0x380e9a);}function parseAndNormalizeConfig(_0x2d34fc,_0x9e2b33,_0x5041a6){const _0x1497e6=a111_0xcd8bcc,_0x9aaa6f=parseCliConfigJsonFile(_0x2d34fc,_0x9e2b33,_0x5041a6),_0x2f3fd9=normalizeLegacyConfigShape(_0x9aaa6f);if(_0x2f3fd9[_0x1497e6(0x19e)])try{writeNormalizedConfigIfNeeded(_0x2d34fc,_0x2f3fd9[_0x1497e6(0x18c)]);}catch{}return _0x2f3fd9[_0x1497e6(0x18c)];}export function loadRawConfigLayers(_0x579527){const _0x2820c4=a111_0xcd8bcc;let _0x3fbc46={},_0x2325cf={};const _0x9d20ec=resolveConfigPath(homedir());_0x9d20ec&&(_0x3fbc46=parseAndNormalizeConfig(_0x9d20ec,_0x2820c4(0x1b9),'Global'));const _0x3c1319=_0x579527??findProjectRootDirectory(),_0x2885e2=resolveConfigPath(_0x3c1319);return _0x2885e2&&(_0x2325cf=parseAndNormalizeConfig(_0x2885e2,_0x2820c4(0x1b9),_0x2820c4(0x1cc))),{'globalPath':_0x9d20ec,'projectPath':_0x2885e2,'globalConfig':_0x3fbc46,'projectConfig':_0x2325cf};}function mergeRawConfigLayers(_0x51d431){const _0x43c4b7=a111_0xcd8bcc,{globalConfig:_0x3ec2e2,projectConfig:_0x1eb68f}=_0x51d431;if(_0x1eb68f[_0x43c4b7(0x1a3)]===![]){const _0x58cfda={..._0x1eb68f};delete _0x58cfda[_0x43c4b7(0x1a3)];const _0x5960d4=_0x1eb68f['apps']&&typeof _0x1eb68f[_0x43c4b7(0x19d)]===_0x43c4b7(0x1c9)?_0x1eb68f[_0x43c4b7(0x19d)]:{};Object[_0x43c4b7(0x1bd)](_0x5960d4)['length']>0x0?_0x58cfda['apps']=_0x5960d4:delete _0x58cfda[_0x43c4b7(0x19d)];if(_0x43c4b7(0x198)in _0x1eb68f)_0x58cfda['defaultApp']=_0x1eb68f['defaultApp'];else Object[_0x43c4b7(0x1bd)](_0x5960d4)[_0x43c4b7(0x1b3)]>0x0&&(_0x58cfda['defaultApp']=Object[_0x43c4b7(0x1bd)](_0x5960d4)[0x0]);return _0x58cfda;}const _0x574773=_0x3ec2e2[_0x43c4b7(0x19d)]&&typeof _0x3ec2e2[_0x43c4b7(0x19d)]===_0x43c4b7(0x1c9)?_0x3ec2e2[_0x43c4b7(0x19d)]:{},_0x3f13e7=_0x1eb68f[_0x43c4b7(0x19d)]&&typeof _0x1eb68f[_0x43c4b7(0x19d)]===_0x43c4b7(0x1c9)?_0x1eb68f[_0x43c4b7(0x19d)]:{},_0x550533={..._0x574773,..._0x3f13e7},_0x2a4b06={..._0x3ec2e2,..._0x1eb68f};Object[_0x43c4b7(0x1bd)](_0x550533)[_0x43c4b7(0x1b3)]>0x0&&(_0x2a4b06[_0x43c4b7(0x19d)]=_0x550533);if(_0x43c4b7(0x198)in _0x1eb68f)_0x2a4b06['defaultApp']=_0x1eb68f['defaultApp'];else{if(_0x3f13e7&&Object[_0x43c4b7(0x1bd)](_0x3f13e7)[_0x43c4b7(0x1b3)]>0x0)_0x2a4b06[_0x43c4b7(0x198)]=Object[_0x43c4b7(0x1bd)](_0x3f13e7)[0x0];else{if(_0x3ec2e2[_0x43c4b7(0x198)])_0x2a4b06['defaultApp']=_0x3ec2e2[_0x43c4b7(0x198)];else{const _0x1e4e7c=Object[_0x43c4b7(0x1bd)](_0x574773);_0x1e4e7c[_0x43c4b7(0x1b3)]>0x0&&(_0x2a4b06[_0x43c4b7(0x198)]=_0x1e4e7c[0x0]);}}}return _0x2a4b06;}export function readRawConfigWithLayers(_0x354fae){const _0x4baa10=loadRawConfigLayers(_0x354fae);return{'config':mergeRawConfigLayers(_0x4baa10),'layers':_0x4baa10};}export function readRawConfig(_0x56a68d){return mergeRawConfigLayers(loadRawConfigLayers(_0x56a68d));}export function getConfigAppCode(_0xfbd6c8){const _0x2db7e0=a111_0xcd8bcc,_0x39c1cc=readRawConfig(_0xfbd6c8);if(_0x39c1cc[_0x2db7e0(0x19d)]&&typeof _0x39c1cc['apps']===_0x2db7e0(0x1c9)){const _0x1cde1d=_0x39c1cc[_0x2db7e0(0x198)];if(_0x1cde1d&&_0x39c1cc[_0x2db7e0(0x19d)][_0x1cde1d]?.[_0x2db7e0(0x190)])return String(_0x39c1cc[_0x2db7e0(0x19d)][_0x1cde1d][_0x2db7e0(0x190)])[_0x2db7e0(0x1d2)]();const _0x213c7c=Object[_0x2db7e0(0x1bb)](_0x39c1cc['apps'])[0x0];if(_0x213c7c?.[_0x2db7e0(0x190)])return String(_0x213c7c['appcode'])[_0x2db7e0(0x1d2)]();}const _0x4b80a6=_0x39c1cc[_0x2db7e0(0x190)]||_0x39c1cc['app'];if(typeof _0x4b80a6!==_0x2db7e0(0x19f)||_0x4b80a6[_0x2db7e0(0x1d2)]()==='')return undefined;return _0x4b80a6['trim']();}export function getMultiAppConfigs(_0x174df6='project',_0x5db25f){const _0x2ab857=a111_0xcd8bcc,_0xedf821=_0x174df6===_0x2ab857(0x1be)?readRawConfig(_0x5db25f):loadRawConfigLayers(_0x5db25f)[_0x2ab857(0x191)],_0x3666f8=_0xedf821[_0x2ab857(0x19d)];if(!_0x3666f8||typeof _0x3666f8!==_0x2ab857(0x1c9)||Object[_0x2ab857(0x1bd)](_0x3666f8)[_0x2ab857(0x1b3)]===0x0)return null;const _0x4d87b4=_0xedf821[_0x2ab857(0x198)];return Object[_0x2ab857(0x1b8)](_0x3666f8)[_0x2ab857(0x1c1)](([_0x31ceb7,_0x2a65df])=>({'name':_0x31ceb7,'appcode':_0x2a65df?.['appcode']||'','isDefault':_0x31ceb7===_0x4d87b4,'env':_0x2a65df?.['env'],'apiDir':_0x2a65df?.[_0x2ab857(0x1a1)],'cookie':_0x2a65df?.[_0x2ab857(0x1d4)]||undefined}))[_0x2ab857(0x1af)](_0x28c36d=>_0x28c36d[_0x2ab857(0x190)]);}export function getTemplateBaseUrl(_0x10ccf0){const _0x4a72a8=a111_0xcd8bcc,_0x10ecf1=readRawConfig(_0x10ccf0);if(_0x10ecf1[_0x4a72a8(0x189)]&&typeof _0x10ecf1[_0x4a72a8(0x189)]==='string')return _0x10ecf1[_0x4a72a8(0x189)][_0x4a72a8(0x18d)](/\/$/,'');return _0x4a72a8(0x1c7);}export function readConfigFile(_0x23ba5b){const _0x3476b1=a111_0xcd8bcc;return parseAndNormalizeConfig(_0x23ba5b,_0x3476b1(0x195));}export function writeConfigFile(_0x43d49b,_0x518829){const _0x1720c8=dirname(_0x43d49b);!existsSync(_0x1720c8)&&mkdirSync(_0x1720c8,{'recursive':!![]});const _0x201987=_0x43d49b+'.tmp';try{writeFileSync(_0x201987,JSON['stringify'](_0x518829,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x201987,_0x43d49b);}catch(_0xa2b735){try{unlinkSync(_0x201987);}catch{}throw _0xa2b735;}}export function resolveWriteConfigPath(_0x2975f9){const _0x1de376=a111_0xcd8bcc,_0x5ca911=_0x2975f9==='project'?process[_0x1de376(0x1cf)]():homedir(),_0x315564=resolveConfigPath(_0x5ca911);return _0x315564??resolve(_0x5ca911,NEW_CONFIG_NAME);}function buildConfig(_0x17d366,_0x48161a){const _0x48b68e=a111_0xcd8bcc,_0x5a2b69={};if(_0x17d366['apps']&&typeof _0x17d366[_0x48b68e(0x19d)]===_0x48b68e(0x1c9))for(const [_0x5e8d87,_0x15f99e]of Object[_0x48b68e(0x1b8)](_0x17d366[_0x48b68e(0x19d)])){_0x15f99e&&typeof _0x15f99e===_0x48b68e(0x1c9)&&_0x15f99e[_0x48b68e(0x190)]&&(_0x5a2b69[_0x5e8d87]=_0x15f99e);}const _0x5b4cbc=_0x17d366[_0x48b68e(0x198)]||undefined,_0x14cffd=Object[_0x48b68e(0x1bd)](_0x5a2b69)[_0x48b68e(0x1b3)]>0x0,_0x37b73c=_0x48161a[_0x48b68e(0x1d3)]||env(_0x48b68e(0x188))||undefined,_0x1d405f=_0x37b73c||_0x5b4cbc||undefined,_0x357835=_0x48161a['appcode']||env(_0x48b68e(0x1a5))||undefined,_0x44a90d=_0x357835?Object[_0x48b68e(0x1b8)](_0x5a2b69)[_0x48b68e(0x199)](([,_0x1b7428])=>_0x1b7428?.[_0x48b68e(0x190)]===_0x357835):undefined,_0x30dd54=_0x44a90d?.[0x0],_0x51d809=_0x44a90d?.[0x1];let _0xb313c7=_0x357835?_0x30dd54:_0x1d405f,_0x396dc4=_0xb313c7&&_0x5a2b69[_0xb313c7]?_0x5a2b69[_0xb313c7]:undefined;_0x357835&&_0x51d809&&(_0x396dc4=_0x51d809);const _0x26bc5d=_0x357835?_0x51d809??_0x396dc4:_0x396dc4,_0x315a5d=_0x37b73c||(_0x357835?_0x30dd54:undefined),_0x480c61=_0x357835||_0x26bc5d?.['appcode']||undefined,_0x25eace=_0x48161a[_0x48b68e(0x192)]||env(_0x48b68e(0x1c3))||_0x26bc5d?.['env']||_0x17d366[_0x48b68e(0x192)]||DEFAULT_CONFIG_VALUES[_0x48b68e(0x192)],_0x283a34=_0x26bc5d?.['locale']||_0x17d366[_0x48b68e(0x194)]||DEFAULT_CONFIG_VALUES['locale'],_0x31a8f8=env(_0x48b68e(0x1ae))||_0x26bc5d?.['cookie']||_0x17d366['cookie']||undefined,_0x38a83a=env('ACCESS_KEY')||_0x26bc5d?.[_0x48b68e(0x1cd)]||_0x17d366['accessKey']||undefined,_0x2cb48a=_0x48161a['format']||env(_0x48b68e(0x1b0))||_0x26bc5d?.[_0x48b68e(0x186)]||_0x17d366[_0x48b68e(0x186)],_0x4b7653=normalizeLegacyOutputFormat(_0x2cb48a),_0x29147a=env(_0x48b68e(0x1a9))||_0x26bc5d?.[_0x48b68e(0x18e)]||_0x17d366[_0x48b68e(0x18e)],_0xf083af=_0x29147a?Number(_0x29147a)||undefined:undefined,_0x4bbbf0=env(_0x48b68e(0x19a))||env('MAX_RISK')||_0x26bc5d?.[_0x48b68e(0x1a0)]||_0x17d366[_0x48b68e(0x1a0)]||_0x17d366['maxRisk'],_0x584d52=_0x4bbbf0===_0x48b68e(0x1a7)||_0x4bbbf0===_0x48b68e(0x1a2)?_0x4bbbf0:DEFAULT_CONFIG_VALUES['riskLevel'],_0xa5f3b6=env('VERBOSE'),_0x41c66d=_0xa5f3b6==='1'||_0xa5f3b6==='true',_0x5e22c0=_0x26bc5d?.[_0x48b68e(0x1a1)]||_0x17d366[_0x48b68e(0x1a1)]||DEFAULT_CONFIG_VALUES['apiDir'],_0x4b1885=isDaily(normalizeEnv(String(_0x25eace)))?_0x48b68e(0x1c5):'production';return{'appCode':typeof _0x480c61===_0x48b68e(0x19f)&&_0x480c61['trim']()?_0x480c61['trim']():undefined,'env':_0x4b1885,'locale':_0x283a34,'cookie':_0x31a8f8,'accessKey':_0x38a83a,'format':_0x4b7653,'pageSize':_0xf083af,'riskLevel':_0x584d52,'verbose':_0x41c66d,'apiDir':_0x5e22c0,'apps':_0x5a2b69,'defaultApp':_0x5b4cbc,'currentApp':_0x14cffd?_0xb313c7:undefined,'explicitAppName':_0x315a5d,'raw':_0x17d366};}async function buildAuth(_0x1a77ed){const _0x36f103=a111_0xcd8bcc,{getCookie:_0x922d88}=await import(_0x36f103(0x1a4)),_0x3d1271=_0x1a77ed[_0x36f103(0x1d4)]||_0x922d88(),_0x1ad804=_0x3d1271?await getIsSessionValid():![];return{'cookie':_0x3d1271,'isLoggedIn':_0x1ad804,async 'getOrLogin'(){const _0x46db41=_0x36f103;if(_0x3d1271&&_0x1ad804)return _0x3d1271;throw CliErrors[_0x46db41(0x18f)]();}};}export function resolveApiFilePath(_0x219feb,_0x2c3040){const _0x5c7769=a111_0xcd8bcc,_0x2a5f29=resolve(process[_0x5c7769(0x1cf)](),_0x219feb),_0x3e5d60=resolve(_0x2a5f29,_0x5c7769(0x1ab));if(!_0x2c3040)return _0x3e5d60;const _0x15f2bc=readRawConfig(),_0x10e273=_0x15f2bc[_0x5c7769(0x19d)]&&typeof _0x15f2bc['apps']===_0x5c7769(0x1c9)?_0x15f2bc[_0x5c7769(0x19d)]:{},_0x4fadf7=Object['entries'](_0x10e273)['find'](([,_0x177529])=>_0x177529?.['appcode']===_0x2c3040);if(!_0x4fadf7)return _0x3e5d60;const [_0x4cba63,_0x172e0b]=_0x4fadf7,_0x2bf88c=typeof _0x15f2bc[_0x5c7769(0x198)]===_0x5c7769(0x19f)?_0x15f2bc[_0x5c7769(0x198)]:undefined;if(_0x172e0b?.['apiDir'])return _0x3e5d60;if(_0x2bf88c&&_0x4cba63!==_0x2bf88c)return resolve(_0x2a5f29,_0x4cba63+_0x5c7769(0x1b4));return _0x3e5d60;}
@@ -1 +1 @@
1
- (function(_0xbf7b7,_0x3fc796){const _0x441556=a107_0x1789,_0x5a5ab1=_0xbf7b7();while(!![]){try{const _0x4f631c=-parseInt(_0x441556(0x1c6))/0x1+parseInt(_0x441556(0x1c5))/0x2+parseInt(_0x441556(0x1c2))/0x3*(parseInt(_0x441556(0x1c9))/0x4)+parseInt(_0x441556(0x1c7))/0x5+parseInt(_0x441556(0x1cc))/0x6*(-parseInt(_0x441556(0x1bf))/0x7)+parseInt(_0x441556(0x1c3))/0x8+parseInt(_0x441556(0x1c8))/0x9*(-parseInt(_0x441556(0x1c1))/0xa);if(_0x4f631c===_0x3fc796)break;else _0x5a5ab1['push'](_0x5a5ab1['shift']());}catch(_0x57a34e){_0x5a5ab1['push'](_0x5a5ab1['shift']());}}}(a107_0x41a2,0xb0117));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a107_0x41a2(){const _0x5b07d3=['exec','datasetCode','get','has','330435oxbtJT','cwd','6183370lrptzu','9096tpBmBk','7047864HbfjYg','push','1900508BOwxKK','1200695cBqzwp','3345415CMAkqq','9lsyGyE','364WnHnZJ','find','set','30uAzxZr','alias','utf-8'];a107_0x41a2=function(){return _0x5b07d3;};return a107_0x41a2();}const cache=new Map();function a107_0x1789(_0x5a667f,_0x28edd7){_0x5a667f=_0x5a667f-0x1bd;const _0x41a2dd=a107_0x41a2();let _0x1789d0=_0x41a2dd[_0x5a667f];return _0x1789d0;}function parseApiFile(_0x37d4f3){const _0x37fed3=a107_0x1789,_0x3a6525=[],_0xb771d3=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1e423a;while((_0x1e423a=_0xb771d3[_0x37fed3(0x1cf)](_0x37d4f3))!==null){_0x3a6525[_0x37fed3(0x1c4)]({'datasetCode':_0x1e423a[0x1],'tableName':_0x1e423a[0x2],'name':_0x1e423a[0x3],'alias':_0x1e423a[0x4]});}return _0x3a6525;}export function loadAliasMap(_0x50d778,_0x1f2811,_0x60a1c6){const _0x54d809=a107_0x1789,_0x34b466=_0x60a1c6??resolve(process[_0x54d809(0x1c0)](),_0x50d778,'api.ts');if(cache[_0x54d809(0x1be)](_0x34b466))return cache[_0x54d809(0x1bd)](_0x34b466);if(!existsSync(_0x34b466))return cache[_0x54d809(0x1cb)](_0x34b466,[]),[];try{const _0xd75085=readFileSync(_0x34b466,_0x54d809(0x1ce)),_0x2f0cae=parseApiFile(_0xd75085);return cache['set'](_0x34b466,_0x2f0cae),_0x2f0cae;}catch{return cache[_0x54d809(0x1cb)](_0x34b466,[]),[];}}export function resolveAlias(_0x5ae926,_0x3d341d,_0x11907d,_0x7d6d79){const _0x3ae3e1=a107_0x1789;if(!_0x3d341d)return undefined;const _0x3b517c=loadAliasMap(_0x5ae926,_0x11907d,_0x7d6d79),_0x4777ee=_0x3b517c[_0x3ae3e1(0x1ca)](_0x413b0b=>_0x413b0b[_0x3ae3e1(0x1cd)]===_0x3d341d);return _0x4777ee?.[_0x3ae3e1(0x1d0)];}export function listAliases(_0x4bee8b,_0x3ef9ef,_0x12d19f){return loadAliasMap(_0x4bee8b,_0x3ef9ef,_0x12d19f);}
1
+ (function(_0x2f84ea,_0x45cec3){const _0x8a2ef4=a112_0x4360,_0x30305f=_0x2f84ea();while(!![]){try{const _0x2c91ac=parseInt(_0x8a2ef4(0x1f1))/0x1+parseInt(_0x8a2ef4(0x1f8))/0x2*(-parseInt(_0x8a2ef4(0x1f9))/0x3)+parseInt(_0x8a2ef4(0x1f4))/0x4+-parseInt(_0x8a2ef4(0x1f0))/0x5+parseInt(_0x8a2ef4(0x1ff))/0x6*(parseInt(_0x8a2ef4(0x1f5))/0x7)+parseInt(_0x8a2ef4(0x1f6))/0x8*(-parseInt(_0x8a2ef4(0x200))/0x9)+-parseInt(_0x8a2ef4(0x201))/0xa;if(_0x2c91ac===_0x45cec3)break;else _0x30305f['push'](_0x30305f['shift']());}catch(_0x2b1186){_0x30305f['push'](_0x30305f['shift']());}}}(a112_0x4aaf,0xf1245));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x2a821c){const _0x1c6929=a112_0x4360,_0x4115ad=[],_0x1979e7=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x599ed0;while((_0x599ed0=_0x1979e7[_0x1c6929(0x1f3)](_0x2a821c))!==null){_0x4115ad[_0x1c6929(0x1f7)]({'datasetCode':_0x599ed0[0x1],'tableName':_0x599ed0[0x2],'name':_0x599ed0[0x3],'alias':_0x599ed0[0x4]});}return _0x4115ad;}function a112_0x4360(_0x4ccbcb,_0x14f156){_0x4ccbcb=_0x4ccbcb-0x1f0;const _0x4aaf93=a112_0x4aaf();let _0x436046=_0x4aaf93[_0x4ccbcb];return _0x436046;}export function loadAliasMap(_0x9f20d5,_0x588f2a,_0x4d061a){const _0x2987b9=a112_0x4360,_0x5f4de3=_0x4d061a??resolve(process['cwd'](),_0x9f20d5,_0x2987b9(0x1fe));if(cache[_0x2987b9(0x1fb)](_0x5f4de3))return cache['get'](_0x5f4de3);if(!existsSync(_0x5f4de3))return cache[_0x2987b9(0x1fa)](_0x5f4de3,[]),[];try{const _0x4252fb=readFileSync(_0x5f4de3,'utf-8'),_0x2b37e2=parseApiFile(_0x4252fb);return cache[_0x2987b9(0x1fa)](_0x5f4de3,_0x2b37e2),_0x2b37e2;}catch{return cache['set'](_0x5f4de3,[]),[];}}function a112_0x4aaf(){const _0x5b83cb=['96341fWbnEc','4208168HtQuzl','push','196mHBKGe','14295mxlmJM','set','has','datasetCode','find','api.ts','756uoFUgE','18aEQuGe','5411660lbbbFT','8539890RlhZal','1527628JEWqVX','alias','exec','5976428DuZtog'];a112_0x4aaf=function(){return _0x5b83cb;};return a112_0x4aaf();}export function resolveAlias(_0x3b5e23,_0x2f364d,_0x5b42ca,_0x2d4958){const _0x3436e2=a112_0x4360;if(!_0x2f364d)return undefined;const _0x593e36=loadAliasMap(_0x3b5e23,_0x5b42ca,_0x2d4958),_0x1f74e7=_0x593e36[_0x3436e2(0x1fd)](_0x42aac0=>_0x42aac0[_0x3436e2(0x1f2)]===_0x2f364d);return _0x1f74e7?.[_0x3436e2(0x1fc)];}export function listAliases(_0x332af5,_0x2daae4,_0x19458d){return loadAliasMap(_0x332af5,_0x2daae4,_0x19458d);}
@@ -1 +1 @@
1
- (function(_0x17cded,_0x332034){const _0x4e78fa=a108_0x4602,_0x453f56=_0x17cded();while(!![]){try{const _0x5a1fa1=-parseInt(_0x4e78fa(0xaf))/0x1+parseInt(_0x4e78fa(0xb0))/0x2+-parseInt(_0x4e78fa(0xca))/0x3+parseInt(_0x4e78fa(0xf3))/0x4*(-parseInt(_0x4e78fa(0xd0))/0x5)+parseInt(_0x4e78fa(0xf8))/0x6*(parseInt(_0x4e78fa(0xcd))/0x7)+parseInt(_0x4e78fa(0xe9))/0x8+parseInt(_0x4e78fa(0x97))/0x9;if(_0x5a1fa1===_0x332034)break;else _0x453f56['push'](_0x453f56['shift']());}catch(_0x26d695){_0x453f56['push'](_0x453f56['shift']());}}}(a108_0x3159,0x3a773));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(_0xea965b){_activeCookie=_0xea965b||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x2d1147,_0x36904d={}){const _0x496ce5=a108_0x4602,{method:method=_0x496ce5(0x9e),body:_0x587473,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x36904d,_0x4eb5b6=useRuntime?getRuntimeDomain():getApiDomain(),_0x231e53=_activeCookie||getCookie(),_0x559e03=''+_0x4eb5b6+_0x2d1147,_0x28bc31=new AbortController(),_0x2c61fe=setTimeout(()=>_0x28bc31['abort'](),timeout);try{const _0x18bac2=await fetch(_0x559e03,{'method':method,'headers':{'Content-Type':_0x496ce5(0xfb),'Cookie':_0x231e53,'X-Invoke-Source':_0x496ce5(0xb3),...headers},'body':_0x587473?JSON[_0x496ce5(0x9b)](_0x587473):undefined,'signal':_0x28bc31[_0x496ce5(0xdb)]});let _0x1e5a28;try{_0x1e5a28=await _0x18bac2['json']();}catch{throw CliErrors['apiError'](_0x496ce5(0xec)+_0x18bac2[_0x496ce5(0x8a)]+')',_0x18bac2[_0x496ce5(0x8a)]>=0x190?_0x496ce5(0xe0):undefined);}if(!_0x18bac2['ok']||_0x1e5a28[_0x496ce5(0xc3)]===![])throw CliErrors[_0x496ce5(0x8f)](_0x1e5a28[_0x496ce5(0xdc)]||_0x1e5a28[_0x496ce5(0xa3)]||'API\x20error:\x20'+_0x18bac2['status'],_0x1e5a28[_0x496ce5(0x9f)]?_0x496ce5(0xc0)+_0x1e5a28[_0x496ce5(0x9f)]:undefined);return _0x1e5a28;}catch(_0x677827){if(_0x677827 instanceof Error&&_0x677827[_0x496ce5(0xa6)]==='AbortError')throw CliErrors[_0x496ce5(0x8f)](_0x496ce5(0xf6)+_0x559e03);throw _0x677827;}finally{clearTimeout(_0x2c61fe);}}function isAuthFailure(_0x51b326){const _0x30be14=a108_0x4602,_0x37f278=_0x51b326[_0x30be14(0xdc)]||_0x51b326['message']||_0x51b326[_0x30be14(0xd3)]?.[_0x30be14(0xa3)]||_0x51b326['errorMessage']||_0x51b326['error']||'';return _0x51b326[_0x30be14(0x9f)]===_0x30be14(0x91)||_0x51b326['code']===0x191||_0x51b326[_0x30be14(0xd2)]===_0x30be14(0xee)||_0x37f278[_0x30be14(0xba)]('401')||_0x37f278['includes'](_0x30be14(0xd8))||_0x37f278['includes']('登录')||_0x37f278[_0x30be14(0xba)]('认证');}export async function platformFetch(_0x377612,_0x3fdc35){const _0xe08dbd=a108_0x4602,_0x510580=await fetch(_0x377612,{'method':_0x3fdc35['method']??'GET','headers':{'Content-Type':_0xe08dbd(0xfb),'Cookie':_0x3fdc35[_0xe08dbd(0xe2)]},..._0x3fdc35['body']&&{'body':JSON['stringify'](_0x3fdc35[_0xe08dbd(0xe5)])}});if(!_0x510580['ok']){if(_0x510580['status']===0x191)throw CliErrors[_0xe08dbd(0xef)]();throw CliErrors[_0xe08dbd(0x8f)](_0x3fdc35[_0xe08dbd(0xd9)]+_0xe08dbd(0x8b)+_0x510580[_0xe08dbd(0x8a)]);}const _0x5c521d=await _0x510580['json']();if(_0x5c521d['success']===![]){if(isAuthFailure(_0x5c521d))throw CliErrors['authRequired']();throw CliErrors['apiError'](_0x5c521d[_0xe08dbd(0xdc)]||_0x5c521d['message']||_0x3fdc35[_0xe08dbd(0xd9)]+'\x20failed');}return _0x5c521d['data'];}export async function listBffScripts(_0x37484a,_0x4570fc,_0x562f35){const _0x280daf=a108_0x4602;let _0x24b8a8=_0x280daf(0xae)+_0x37484a;if(_0x4570fc)_0x24b8a8+=_0x280daf(0x8e)+_0x4570fc;const _0x58b279=await apiRequest(_0x24b8a8);let _0xd13fae=extractList(_0x58b279['data']);if(_0x562f35?.[_0x280daf(0xb7)]){const _0x981e10=_0x562f35[_0x280daf(0xb7)]['toLowerCase']();_0xd13fae=_0xd13fae[_0x280daf(0xc8)](_0x5b80b1=>_0x5b80b1['functionName']?.[_0x280daf(0x80)]()[_0x280daf(0xba)](_0x981e10)||_0x5b80b1['description']?.[_0x280daf(0x80)]()[_0x280daf(0xba)](_0x981e10));}return _0xd13fae;}export async function getBffScriptInfo(_0x4660a8){const _0x453a3c=a108_0x4602,_0x5c9816=await apiRequest(_0x453a3c(0xc1)+_0x4660a8);if(!_0x5c9816['data'])throw CliErrors[_0x453a3c(0x84)](_0x453a3c(0xa9)+_0x4660a8);return _0x5c9816[_0x453a3c(0xd3)];}export async function saveBffScript(_0x7fd2a2){const _0x39fb2a=a108_0x4602,_0x50a11f=await apiRequest('/api/management/library/scripts/save',{'method':_0x39fb2a(0x95),'body':_0x7fd2a2});return _0x50a11f[_0x39fb2a(0xd3)];}export async function deleteBffScript(_0x8ee4f1){const _0x4085e1=a108_0x4602;await apiRequest('/api/management/library/scripts/delete',{'method':_0x4085e1(0x95),'body':{'id':_0x8ee4f1}});}export async function getBffScriptStatistics(_0x1a3f95){const _0x2862a9=a108_0x4602,_0x1aad48=await apiRequest(_0x2862a9(0xd5)+_0x1a3f95);return extractList(_0x1aad48['data']);}export async function listBffDatasetOperations(_0x40d6ab,_0x136743){const _0x87fdd7=a108_0x4602,_0x1c4f8a=await apiRequest(_0x87fdd7(0xcc),{'method':_0x87fdd7(0x95),'body':{'appCode':_0x40d6ab,'datasetId':_0x136743}});return _0x1c4f8a[_0x87fdd7(0xd3)];}export async function listSqlQueries(_0x5882e8,_0x57c164){const _0xd2b205=a108_0x4602,_0x5f5b61=await apiRequest(_0xd2b205(0x8c),{'method':_0xd2b205(0x95),'body':{'appCode':_0x5882e8,'currentPage':_0x57c164?.[_0xd2b205(0xf2)]??0x1,'pageSize':_0x57c164?.[_0xd2b205(0xbe)]??0x32,'sqlCode':_0x57c164?.[_0xd2b205(0x81)],'sqlName':_0x57c164?.['sqlName']}});return _0x5f5b61[_0xd2b205(0xd3)];}export async function getSqlQueryInfo(_0x26fee4,_0x48f7ab){const _0x36fe7e=a108_0x4602,_0x3a9532=await listSqlQueries(_0x26fee4,{'sqlCode':_0x48f7ab}),_0x480287=_0x3a9532['tableData']?.[0x0];if(!_0x480287)throw CliErrors[_0x36fe7e(0x84)](_0x36fe7e(0xd1)+_0x48f7ab);return _0x480287;}export async function saveSqlQuery(_0x90e5f6){const _0x41547d=a108_0x4602,_0x219c95=await apiRequest(_0x41547d(0xd4),{'method':_0x41547d(0x95),'body':_0x90e5f6});return _0x219c95[_0x41547d(0xd3)];}export async function executeSql(_0x50a6cd,_0xc6b516,_0x168642){const _0x20ba8e=a108_0x4602,_0x50749a=await apiRequest(_0x20ba8e(0xa2),{'method':_0x20ba8e(0x95),'body':{'appCode':_0x50a6cd,'sqlCode':_0xc6b516,..._0x168642&&{'params':_0x168642}},'useRuntime':!![]});return _0x50749a['data'];}export async function listDatasets(_0x4ec6f2,_0x400c00){const _0xca87f=a108_0x4602,_0x1dbcf9={'appCode':_0x4ec6f2,'deleted':![]};if(_0x400c00?.['code'])_0x1dbcf9[_0xca87f(0xd2)]=_0x400c00[_0xca87f(0xd2)];if(_0x400c00?.[_0xca87f(0xa6)])_0x1dbcf9[_0xca87f(0xa6)]=_0x400c00['name'];const _0x3452c5=await apiRequest(_0xca87f(0xb1),{'method':_0xca87f(0x95),'body':_0x1dbcf9});return extractList(_0x3452c5[_0xca87f(0xd3)]);}export async function searchDatasets(_0x569917,_0x2aaebd){const _0x4f7930=a108_0x4602,_0x46eea2=await listDatasets(_0x569917,{'name':_0x2aaebd}),_0x471048=_0x2aaebd[_0x4f7930(0x80)](),_0x1de341=new Set(_0x46eea2['map'](_0x2a4478=>_0x2a4478['id'])),_0x2ad86c=_0x46eea2[_0x4f7930(0xc8)](_0x4c1904=>_0x4c1904[_0x4f7930(0xe8)]?.['tableName']?.[_0x4f7930(0x80)]()[_0x4f7930(0xba)](_0x471048)||_0x4c1904['description']?.[_0x4f7930(0x80)]()[_0x4f7930(0xba)](_0x471048)),_0x37917f=await listDatasets(_0x569917,{'code':_0x2aaebd});for(const _0x43216e of _0x37917f){!_0x1de341[_0x4f7930(0xfd)](_0x43216e['id'])&&(_0x46eea2[_0x4f7930(0xa8)](_0x43216e),_0x1de341[_0x4f7930(0xe7)](_0x43216e['id']));}return _0x46eea2;}export function normalizeDatasetOperations(_0x1e1a38){const _0x35178c=a108_0x4602;if(Array[_0x35178c(0xe6)](_0x1e1a38))return _0x1e1a38['filter'](_0x8876b6=>_0x8876b6!=null&&typeof _0x8876b6==='object');if(_0x1e1a38&&typeof _0x1e1a38==='object')return Object['entries'](_0x1e1a38)[_0x35178c(0xc8)](([,_0x597b57])=>_0x597b57!=null&&typeof _0x597b57===_0x35178c(0xcb))['map'](([_0x22d0fc,_0x5eb52f])=>({..._0x5eb52f,'name':_0x5eb52f[_0x35178c(0xa6)]??_0x5eb52f[_0x35178c(0xb4)]??_0x22d0fc}));return[];}export async function getDatasetDetail(_0x275db8){const _0x5611d8=a108_0x4602,_0x54497f=/^\d+$/['test'](_0x275db8)?'id':'code',_0x3440eb=await apiRequest(_0x5611d8(0x8d)+_0x54497f+'='+_0x275db8);return _0x3440eb[_0x5611d8(0xd3)];}function a108_0x3159(){const _0x3673b1=['operations','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','toLowerCase','sqlCode','displayName','tableName','validation','\x20\x20where:\x20{},','\x20\x20\x20\x20sqlCode:\x20\x27','entries','find','update','status','\x20failed,\x20HTTP\x20','/smartapi/custom/queryUserCustomSqlList','/smartapi/dataset/get-driven-data?','&type=','apiError','enabled','UNAUTHORIZED','/smartapi/db-analysis/start','target','\x20\x20});','POST','method','8256825BnyRAc','/smartapi/dblink/getList','create','\x20\x20sqlCode:\x20\x27','stringify','dataset_','pageIndex','GET','errorCode','\x20\x20return\x20rows;','Operation\x20\x22','/api/custom/executeSql','message','modelId','Warning:\x20showing\x20first\x20','name','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','push','BFF\x20script\x20not\x20found:\x20id=','\x20apps.\x20','table','\x20\x20currentPage:\x201,','responseFields','/api/management/library/scripts/list?appCode=','333726EMQNTk','272026RuetPl','/smartapi/dataset/get-dataset-list','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','cli:rabetbase','operationName','modelCode','join','scriptName','type','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','includes','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','sqlName','\x20of\x20','pageSize','warn','API\x20error\x20code:\x20','/api/management/library/scripts/info?id=','toString','success','map','.create({\x20/*\x20fields\x20*/\x20});','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','const\x20result\x20=\x20await\x20client.models.','filter','replace','782622ZcAFAf','object','/smartapi/dataset/get-dataset-operation','7RlidAY','getOne','/smartapi/question/er-config','1592330dQXNFz','SQL\x20query\x20not\x20found:\x20','code','data','/api/node-toolbox/sql/save','/api/management/library/scripts/statistics?appCode=','planId','\x20\x20pageSize:\x2020,','Unauthorized','label','.remove(id);','signal','errorMsg','/smartapi/dblink/getOne','length','\x22\x20not\x20found\x20in\x20dataset\x20','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','});','cookie','delete','totalCount','body','isArray','add','dbtableConfig','782872TAYygP','/smartapi/dblink/testConnect','/smartapi/db-analysis/status/','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','sdk','401','authRequired','/smartapi/app/getList','/smartapi/dblink/delete','currentPage','4fOuskY','//\x20','/smartapi/dblink/create','Request\x20timeout:\x20','.getOne(id);','7464VWbuLu','requestFields','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','application/json','string','has','/smartapi/dblink/update'];a108_0x3159=function(){return _0x3673b1;};return a108_0x3159();}export async function getDatasetOperations(_0x382031){const _0x4ce77c=a108_0x4602,_0x25ec38=await getDatasetDetail(_0x382031),_0x3c2ee2=normalizeDatasetOperations(_0x25ec38[_0x4ce77c(0xff)])[_0x4ce77c(0xc4)](_0x7f7ac3=>({'name':_0x7f7ac3[_0x4ce77c(0xa6)]||_0x7f7ac3['operationName'],'displayName':_0x7f7ac3[_0x4ce77c(0x82)]||_0x7f7ac3[_0x4ce77c(0xa6)],'type':_0x7f7ac3[_0x4ce77c(0xb8)],'method':_0x7f7ac3[_0x4ce77c(0x96)],'path':_0x7f7ac3['path'],'enabled':_0x7f7ac3[_0x4ce77c(0x90)]??!![],'requestFields':_0x7f7ac3[_0x4ce77c(0xf9)],'responseFields':_0x7f7ac3[_0x4ce77c(0xad)]}));return{'dataset':{'id':_0x25ec38['id']??_0x25ec38[_0x4ce77c(0xa4)],'name':_0x25ec38[_0x4ce77c(0xa6)],'code':_0x25ec38[_0x4ce77c(0xd2)]||_0x25ec38[_0x4ce77c(0xb5)],'tableName':_0x25ec38[_0x4ce77c(0x83)]||_0x25ec38['dbtableConfig']?.[_0x4ce77c(0x83)]},'operations':_0x3c2ee2};}export async function getOperationDetail(_0x26a1d6,_0x4e6f7b,_0x27a27c){const _0x5254ef=a108_0x4602;let _0x5b9233=_0x4e6f7b;if(!/^\d+$/['test'](_0x4e6f7b)){const _0x13179e=await listDatasets(_0x26a1d6,{'code':_0x4e6f7b}),_0x2b5797=_0x13179e[_0x5254ef(0x88)](_0x201122=>_0x201122[_0x5254ef(0xd2)]===_0x4e6f7b||String(_0x201122['id'])===_0x4e6f7b);if(!_0x2b5797)throw CliErrors[_0x5254ef(0x84)]('Dataset\x20not\x20found:\x20'+_0x4e6f7b);_0x5b9233=String(_0x2b5797['id']);}const _0x38f2d3=await getDatasetDetail(_0x5b9233),_0x3d4331=normalizeDatasetOperations(_0x38f2d3[_0x5254ef(0xff)])[_0x5254ef(0x88)](_0x56b599=>(_0x56b599[_0x5254ef(0xa6)]||_0x56b599[_0x5254ef(0xb4)])===_0x27a27c);if(!_0x3d4331)throw CliErrors[_0x5254ef(0x84)](_0x5254ef(0xa1)+_0x27a27c+_0x5254ef(0xdf)+_0x4e6f7b);return{'dataset':{'id':_0x38f2d3['id']??_0x38f2d3['modelId'],'name':_0x38f2d3[_0x5254ef(0xa6)],'code':_0x38f2d3['code']||_0x38f2d3[_0x5254ef(0xb5)],'tableName':_0x38f2d3['tableName']||_0x38f2d3[_0x5254ef(0xe8)]?.[_0x5254ef(0x83)]},'operation':_0x3d4331};}export function generateSdkCode(_0x505afc,_0x2dca88,_0x3fb0e5){const _0x130556=a108_0x4602,_0x21040f=_0x3fb0e5?.['includeImports']??!![],_0x4a9472=_0x130556(0x9c)+_0x505afc[_0x130556(0xd2)]?.[_0x130556(0xc9)](/-/g,'_'),_0x58a920=_0x2dca88[_0x130556(0xa6)]||_0x2dca88[_0x130556(0xb4)]||_0x130556(0xc8),_0x4088e1=[];_0x21040f&&_0x4088e1[_0x130556(0xa8)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x130556(0xbb),'');_0x4088e1['push'](_0x130556(0xf4)+_0x505afc[_0x130556(0xa6)]+'\x20('+(_0x505afc[_0x130556(0x83)]||_0x130556(0xab))+')');if(_0x58a920===_0x130556(0xc8))_0x4088e1[_0x130556(0xa8)](_0x130556(0xc7)+_0x4a9472+'.filter({',_0x130556(0x85),_0x130556(0xd7),_0x130556(0xac),_0x130556(0xe1));else{if(_0x58a920===_0x130556(0xce))_0x4088e1['push'](_0x130556(0xc7)+_0x4a9472+_0x130556(0xf7));else{if(_0x58a920===_0x130556(0x99))_0x4088e1[_0x130556(0xa8)]('const\x20result\x20=\x20await\x20client.models.'+_0x4a9472+_0x130556(0xc5));else{if(_0x58a920===_0x130556(0x89))_0x4088e1[_0x130556(0xa8)](_0x130556(0xc7)+_0x4a9472+_0x130556(0xb2));else _0x58a920===_0x130556(0xe3)||_0x58a920==='remove'?_0x4088e1['push'](_0x130556(0xc7)+_0x4a9472+_0x130556(0xda)):_0x4088e1[_0x130556(0xa8)]('const\x20result\x20=\x20await\x20client.models.'+_0x4a9472+'.'+_0x58a920+'(/*\x20params\x20*/);');}}}return _0x4088e1[_0x130556(0xb6)]('\x0a');}export function generateSqlCodeTemplate(_0x354129,_0x42f757){const _0x4ac000=a108_0x4602,_0x3c6554=_0x42f757?.[_0x4ac000(0x93)]??'sdk',_0x4a173b=_0x42f757?.['includeImports']??!![],_0x536f9d=[];return _0x536f9d['push']('//\x20SQL:\x20'+_0x354129[_0x4ac000(0xbc)]+'\x20('+_0x354129[_0x4ac000(0x81)]+')'),_0x3c6554===_0x4ac000(0xed)?(_0x4a173b&&_0x536f9d[_0x4ac000(0xa8)](_0x4ac000(0xb9),'',_0x4ac000(0xbb),''),_0x536f9d['push']('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4ac000(0x9a)+_0x354129['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x4ac000(0xe1),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x536f9d[_0x4ac000(0xa8)](_0x4ac000(0xa7),_0x4ac000(0xc6),_0x4ac000(0x7f),_0x4ac000(0x86)+_0x354129[_0x4ac000(0x81)]+'\x27,',_0x4ac000(0xfa),_0x4ac000(0x94),_0x4ac000(0xa0),'}'),_0x536f9d[_0x4ac000(0xb6)]('\x0a');}export async function getErConfig(_0x4c1405,_0x41dc14){const _0x517750=a108_0x4602,_0xf3eea3=await apiRequest(_0x517750(0xcf),{'method':'POST','body':{'appCode':_0x4c1405,'dblinkId':_0x41dc14}});return _0xf3eea3[_0x517750(0xd3)];}function buildQuery(_0x419b9b){const _0x374c12=a108_0x4602,_0x53e6d6=new URLSearchParams();for(const [_0x2e88e1,_0x4f4373]of Object[_0x374c12(0x87)](_0x419b9b)){if(_0x4f4373===undefined||_0x4f4373==='')continue;_0x53e6d6['set'](_0x2e88e1,String(_0x4f4373));}const _0xadbac6=_0x53e6d6[_0x374c12(0xc2)]();return _0xadbac6?'?'+_0xadbac6:'';}export async function listDbLinks(_0x2e6d58,_0x3fb1e8){const _0x18703d=a108_0x4602,_0x5cc36a=await apiRequest(_0x18703d(0x98),{'method':'POST','body':{'appCode':_0x2e6d58,'currentPage':_0x3fb1e8?.[_0x18703d(0xf2)]??0x1,'pageSize':_0x3fb1e8?.[_0x18703d(0xbe)]??0x64}});return{'items':extractList(_0x5cc36a[_0x18703d(0xd3)]),'paging':extractPaging(_0x5cc36a[_0x18703d(0xd3)])};}export async function getDbLinkInfo(_0x595dbd){const _0x5cb325=a108_0x4602,_0x362b61=await apiRequest(_0x5cb325(0xdd)+buildQuery({'id':_0x595dbd}));return _0x362b61[_0x5cb325(0xd3)];}export async function createDbLink(_0x10c0f7){const _0xfda180=a108_0x4602,_0x36c247=await apiRequest(_0xfda180(0xf5),{'method':_0xfda180(0x95),'body':_0x10c0f7});return _0x36c247[_0xfda180(0xd3)];}export async function updateDbLink(_0x214de5){const _0xd7e7b1=a108_0x4602,_0x4afda4=await apiRequest(_0xd7e7b1(0xfe),{'method':_0xd7e7b1(0x95),'body':_0x214de5});return _0x4afda4[_0xd7e7b1(0xd3)];}export async function deleteDbLink(_0x5e2b85){const _0xff8d67=a108_0x4602;await apiRequest(_0xff8d67(0xf1),{'method':'POST','body':{'id':_0x5e2b85}});}export async function testDbLinkConnect(_0x5f541b){const _0x4b3c21=a108_0x4602,_0x2dbad6=await apiRequest(_0x4b3c21(0xea)+buildQuery({'id':_0x5f541b}));return _0x2dbad6[_0x4b3c21(0xd3)];}export async function startDbAnalysis(_0x35577f,_0x2e267e){const _0x24d004=a108_0x4602,_0x3b66d4=await apiRequest(_0x24d004(0x92),{'method':_0x24d004(0x95),'body':{'dbLinkId':_0x35577f,..._0x2e267e&&_0x2e267e[_0x24d004(0xde)]>0x0?{'tableNames':_0x2e267e}:{}}}),_0x25d4e5=_0x3b66d4[_0x24d004(0xd3)];if(typeof _0x25d4e5==='string')return _0x25d4e5;if(_0x25d4e5&&typeof _0x25d4e5===_0x24d004(0xcb)&&typeof _0x25d4e5[_0x24d004(0xd6)]===_0x24d004(0xfc))return _0x25d4e5['planId'];return _0x25d4e5!=null?String(_0x25d4e5):'';}export async function cancelDbAnalysis(_0x58d761){const _0x38b61c=a108_0x4602;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x58d761}),{'method':_0x38b61c(0x95)});}function a108_0x4602(_0x401e2c,_0x3513cf){_0x401e2c=_0x401e2c-0x7f;const _0x3159fc=a108_0x3159();let _0x4602c9=_0x3159fc[_0x401e2c];return _0x4602c9;}export async function getDbAnalysisStatus(_0x9cd68d){const _0x485e6d=a108_0x4602,_0x6fcf2d=await apiRequest(_0x485e6d(0xeb)+encodeURIComponent(_0x9cd68d));return _0x6fcf2d['data'];}export async function getDbAllTableList(_0x3bffd4,_0x20257b){const _0x1423e4=a108_0x4602,_0x26da7e=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x3bffd4,'dbLinkId':_0x20257b})),_0x4abc10=_0x26da7e[_0x1423e4(0xd3)];if(Array[_0x1423e4(0xe6)](_0x4abc10))return _0x4abc10;return extractList(_0x4abc10);}export async function getDbTableDiff(_0x55c76d,_0x228a1a,_0x5104f1){const _0x1ce78d=a108_0x4602,_0x4a4c4d=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x55c76d,'dbLinkId':_0x228a1a,'pageIndex':_0x5104f1?.[_0x1ce78d(0x9d)]??0x1,'pageSize':_0x5104f1?.['pageSize']??0x14,'tableName':_0x5104f1?.['tableName']})),_0x1727a1=_0x4a4c4d[_0x1ce78d(0xd3)];return{'totalCount':_0x1727a1?.[_0x1ce78d(0xe4)]??0x0,'tableList':Array[_0x1ce78d(0xe6)](_0x1727a1?.['tableList'])?_0x1727a1['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x47d4d5=a108_0x4602,_0x15caf5=await apiRequest(_0x47d4d5(0xf0),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x17185c=extractList(_0x15caf5[_0x47d4d5(0xd3)]),_0xa1ddd2=extractPaging(_0x15caf5['data']);return _0xa1ddd2&&_0xa1ddd2['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x47d4d5(0xbf)](_0x47d4d5(0xa5)+REMOTE_APP_PAGE_SIZE+_0x47d4d5(0xbd)+_0xa1ddd2[_0x47d4d5(0xe4)]+_0x47d4d5(0xaa)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x17185c;}
1
+ (function(_0x32aa36,_0x445b01){const _0x3ddfca=a113_0x3471,_0x98d44c=_0x32aa36();while(!![]){try{const _0x12dbb4=-parseInt(_0x3ddfca(0x19f))/0x1+parseInt(_0x3ddfca(0x1f5))/0x2+parseInt(_0x3ddfca(0x1bd))/0x3+parseInt(_0x3ddfca(0x1ee))/0x4+parseInt(_0x3ddfca(0x19d))/0x5*(-parseInt(_0x3ddfca(0x194))/0x6)+-parseInt(_0x3ddfca(0x1ff))/0x7+parseInt(_0x3ddfca(0x1b2))/0x8;if(_0x12dbb4===_0x445b01)break;else _0x98d44c['push'](_0x98d44c['shift']());}catch(_0xc06bd6){_0x98d44c['push'](_0x98d44c['shift']());}}}(a113_0x3905,0xb8b35));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';function a113_0x3905(){const _0x569c3f=['Request\x20timeout:\x20','includeImports','errorCode','operationName','sqlCode','/smartapi/dblink/getTableDiffV2ByPage','/api/node-toolbox/sql/save','/smartapi/dblink/create','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','validation','\x20failed','\x20\x20\x20\x20sqlCode:\x20\x27','join','name','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','Unauthorized','BFF\x20script\x20not\x20found:\x20id=','filter','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','6rMnBfU','modelCode','totalCount','success','label','\x20\x20pageSize:\x2020,','toString','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorMessage','4012490darVNC','apiError','1443303pAKZeK','isArray','entries','pageSize','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','create','/smartapi/dataset/get-dataset-operation','/smartapi/db-analysis/jobs/cancel','operations','pageIndex','scriptName','code','replace','const\x20result\x20=\x20await\x20client.models.','description','tableList','displayName','/api/management/library/scripts/info?id=','Warning:\x20showing\x20first\x20','9057440ZzVBdc','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','target','//\x20SQL:\x20','&type=','status','/smartapi/dblink/getOne','body','API\x20error\x20code:\x20','responseFields','set','4207332CqaMxs','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','tableName','json','AbortError','currentPage','(/*\x20params\x20*/);','\x20\x20return\x20rows;','/smartapi/dblink/getAllTableList','object','const\x20data\x20=\x20await\x20client.sql.execute({','\x20failed,\x20HTTP\x20','find','message','functionName','\x20\x20where:\x20{},','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','stringify','\x20of\x20','/smartapi/dataset/get-dataset-list','test','dataset_','remove','errorMsg','table','\x20\x20currentPage:\x201,','string','has','UNAUTHORIZED','.create({\x20/*\x20fields\x20*/\x20});','authRequired','tableData','modelId','/api/management/library/scripts/delete','/api/management/library/scripts/statistics?appCode=','API\x20error:\x20','method','GET','/smartapi/db-analysis/status/','/smartapi/dataset/get-driven-data?','abort','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','enabled','length','cookie','requestFields','add','warn','\x20\x20});','1456732FwWDAc','data','type','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','signal','sqlName','});','1471520TVFBaZ','push','POST','401','application/json','includes','.getOne(id);','map','dbtableConfig','SQL\x20query\x20not\x20found:\x20','4425631Kfgvld','toLowerCase','update'];a113_0x3905=function(){return _0x569c3f;};return a113_0x3905();}let _activeCookie;export function setActiveCookie(_0x343f9b){_activeCookie=_0x343f9b||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x49bc87,_0x1f6119={}){const _0x2eae73=a113_0x3471,{method:method=_0x2eae73(0x1e2),body:_0xfa57bf,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x1f6119,_0xb62655=useRuntime?getRuntimeDomain():getApiDomain(),_0x439c9f=_activeCookie||getCookie(),_0x3d427e=''+_0xb62655+_0x49bc87,_0x1f6177=new AbortController(),_0x2f82e9=setTimeout(()=>_0x1f6177[_0x2eae73(0x1e5)](),timeout);try{const _0x451862=await fetch(_0x3d427e,{'method':method,'headers':{'Content-Type':_0x2eae73(0x1f9),'Cookie':_0x439c9f,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0xfa57bf?JSON['stringify'](_0xfa57bf):undefined,'signal':_0x1f6177[_0x2eae73(0x1f2)]});let _0x4f27e4;try{_0x4f27e4=await _0x451862[_0x2eae73(0x1c0)]();}catch{throw CliErrors[_0x2eae73(0x19e)](_0x2eae73(0x1e6)+_0x451862[_0x2eae73(0x1b7)]+')',_0x451862[_0x2eae73(0x1b7)]>=0x190?_0x2eae73(0x193):undefined);}if(!_0x451862['ok']||_0x4f27e4[_0x2eae73(0x197)]===![])throw CliErrors[_0x2eae73(0x19e)](_0x4f27e4[_0x2eae73(0x1d4)]||_0x4f27e4['message']||_0x2eae73(0x1e0)+_0x451862[_0x2eae73(0x1b7)],_0x4f27e4['errorCode']?_0x2eae73(0x1ba)+_0x4f27e4[_0x2eae73(0x204)]:undefined);return _0x4f27e4;}catch(_0x2b47fa){if(_0x2b47fa instanceof Error&&_0x2b47fa[_0x2eae73(0x18e)]===_0x2eae73(0x1c1))throw CliErrors[_0x2eae73(0x19e)](_0x2eae73(0x202)+_0x3d427e);throw _0x2b47fa;}finally{clearTimeout(_0x2f82e9);}}function isAuthFailure(_0x1884f5){const _0x102273=a113_0x3471,_0x466cff=_0x1884f5[_0x102273(0x1d4)]||_0x1884f5[_0x102273(0x1ca)]||_0x1884f5[_0x102273(0x1ef)]?.['message']||_0x1884f5[_0x102273(0x19c)]||_0x1884f5['error']||'';return _0x1884f5['errorCode']===_0x102273(0x1d9)||_0x1884f5[_0x102273(0x1aa)]===0x191||_0x1884f5['code']===_0x102273(0x1f8)||_0x466cff[_0x102273(0x1fa)](_0x102273(0x1f8))||_0x466cff[_0x102273(0x1fa)](_0x102273(0x190))||_0x466cff['includes']('登录')||_0x466cff[_0x102273(0x1fa)]('认证');}export async function platformFetch(_0xe60fb8,_0x34a3db){const _0x4199d6=a113_0x3471,_0x5dfa7b=await fetch(_0xe60fb8,{'method':_0x34a3db[_0x4199d6(0x1e1)]??_0x4199d6(0x1e2),'headers':{'Content-Type':_0x4199d6(0x1f9),'Cookie':_0x34a3db[_0x4199d6(0x1e9)]},..._0x34a3db[_0x4199d6(0x1b9)]&&{'body':JSON[_0x4199d6(0x1ce)](_0x34a3db[_0x4199d6(0x1b9)])}});if(!_0x5dfa7b['ok']){if(_0x5dfa7b[_0x4199d6(0x1b7)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x4199d6(0x19e)](_0x34a3db[_0x4199d6(0x198)]+_0x4199d6(0x1c8)+_0x5dfa7b[_0x4199d6(0x1b7)]);}const _0x583de9=await _0x5dfa7b[_0x4199d6(0x1c0)]();if(_0x583de9['success']===![]){if(isAuthFailure(_0x583de9))throw CliErrors[_0x4199d6(0x1db)]();throw CliErrors[_0x4199d6(0x19e)](_0x583de9[_0x4199d6(0x1d4)]||_0x583de9[_0x4199d6(0x1ca)]||_0x34a3db[_0x4199d6(0x198)]+_0x4199d6(0x20c));}return _0x583de9['data'];}export async function listBffScripts(_0x263195,_0x49a6bc,_0x43994d){const _0x3fbfdb=a113_0x3471;let _0x5c1baf='/api/management/library/scripts/list?appCode='+_0x263195;if(_0x49a6bc)_0x5c1baf+=_0x3fbfdb(0x1b6)+_0x49a6bc;const _0x973550=await apiRequest(_0x5c1baf);let _0x74f7c2=extractList(_0x973550[_0x3fbfdb(0x1ef)]);if(_0x43994d?.[_0x3fbfdb(0x1a9)]){const _0x52ab23=_0x43994d[_0x3fbfdb(0x1a9)][_0x3fbfdb(0x200)]();_0x74f7c2=_0x74f7c2[_0x3fbfdb(0x192)](_0x2bcd88=>_0x2bcd88[_0x3fbfdb(0x1cb)]?.[_0x3fbfdb(0x200)]()[_0x3fbfdb(0x1fa)](_0x52ab23)||_0x2bcd88[_0x3fbfdb(0x1ad)]?.[_0x3fbfdb(0x200)]()[_0x3fbfdb(0x1fa)](_0x52ab23));}return _0x74f7c2;}export async function getBffScriptInfo(_0x1dec59){const _0x527b21=a113_0x3471,_0xbaaedc=await apiRequest(_0x527b21(0x1b0)+_0x1dec59);if(!_0xbaaedc[_0x527b21(0x1ef)])throw CliErrors[_0x527b21(0x20b)](_0x527b21(0x191)+_0x1dec59);return _0xbaaedc[_0x527b21(0x1ef)];}export async function saveBffScript(_0x596a5f){const _0xb50eb=a113_0x3471,_0x1e415d=await apiRequest('/api/management/library/scripts/save',{'method':_0xb50eb(0x1f7),'body':_0x596a5f});return _0x1e415d[_0xb50eb(0x1ef)];}export async function deleteBffScript(_0x211b7a){const _0xfa978e=a113_0x3471;await apiRequest(_0xfa978e(0x1de),{'method':_0xfa978e(0x1f7),'body':{'id':_0x211b7a}});}export async function getBffScriptStatistics(_0x211fa8){const _0x436773=a113_0x3471,_0x24440b=await apiRequest(_0x436773(0x1df)+_0x211fa8);return extractList(_0x24440b['data']);}export async function listBffDatasetOperations(_0x9ca3f3,_0x19050d){const _0x55fd67=a113_0x3471,_0x52d8a5=await apiRequest(_0x55fd67(0x1a5),{'method':_0x55fd67(0x1f7),'body':{'appCode':_0x9ca3f3,'datasetId':_0x19050d}});return _0x52d8a5[_0x55fd67(0x1ef)];}export async function listSqlQueries(_0x1d8c83,_0x9f702d){const _0x38a4cf=a113_0x3471,_0x1fe340=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x38a4cf(0x1f7),'body':{'appCode':_0x1d8c83,'currentPage':_0x9f702d?.[_0x38a4cf(0x1c2)]??0x1,'pageSize':_0x9f702d?.[_0x38a4cf(0x1a2)]??0x32,'sqlCode':_0x9f702d?.[_0x38a4cf(0x206)],'sqlName':_0x9f702d?.['sqlName']}});return _0x1fe340[_0x38a4cf(0x1ef)];}export async function getSqlQueryInfo(_0x3043f2,_0x947c52){const _0x5b8442=a113_0x3471,_0x256f62=await listSqlQueries(_0x3043f2,{'sqlCode':_0x947c52}),_0x3cf6ca=_0x256f62[_0x5b8442(0x1dc)]?.[0x0];if(!_0x3cf6ca)throw CliErrors[_0x5b8442(0x20b)](_0x5b8442(0x1fe)+_0x947c52);return _0x3cf6ca;}export async function saveSqlQuery(_0x2b99d0){const _0x9cf8d0=a113_0x3471,_0x381570=await apiRequest(_0x9cf8d0(0x208),{'method':_0x9cf8d0(0x1f7),'body':_0x2b99d0});return _0x381570[_0x9cf8d0(0x1ef)];}export async function executeSql(_0xbca99,_0x5dc182,_0x46d805){const _0x4f22de=a113_0x3471,_0x5169be=await apiRequest('/api/custom/executeSql',{'method':_0x4f22de(0x1f7),'body':{'appCode':_0xbca99,'sqlCode':_0x5dc182,..._0x46d805&&{'params':_0x46d805}},'useRuntime':!![]});return _0x5169be[_0x4f22de(0x1ef)];}function a113_0x3471(_0x16ef67,_0x6b5d8c){_0x16ef67=_0x16ef67-0x18e;const _0x39051e=a113_0x3905();let _0x347127=_0x39051e[_0x16ef67];return _0x347127;}export async function listDatasets(_0x294008,_0x3cf691){const _0x597cb2=a113_0x3471,_0xb216b3={'appCode':_0x294008,'deleted':![]};if(_0x3cf691?.[_0x597cb2(0x1aa)])_0xb216b3[_0x597cb2(0x1aa)]=_0x3cf691[_0x597cb2(0x1aa)];if(_0x3cf691?.[_0x597cb2(0x18e)])_0xb216b3[_0x597cb2(0x18e)]=_0x3cf691[_0x597cb2(0x18e)];const _0x398ae5=await apiRequest(_0x597cb2(0x1d0),{'method':'POST','body':_0xb216b3});return extractList(_0x398ae5[_0x597cb2(0x1ef)]);}export async function searchDatasets(_0x3aad54,_0x53b1b0){const _0x5df17a=a113_0x3471,_0x2bbfca=await listDatasets(_0x3aad54,{'name':_0x53b1b0}),_0x2a188d=_0x53b1b0[_0x5df17a(0x200)](),_0x15d93c=new Set(_0x2bbfca[_0x5df17a(0x1fc)](_0x4ceb28=>_0x4ceb28['id'])),_0x28483e=_0x2bbfca[_0x5df17a(0x192)](_0xf2f58d=>_0xf2f58d[_0x5df17a(0x1fd)]?.[_0x5df17a(0x1bf)]?.[_0x5df17a(0x200)]()[_0x5df17a(0x1fa)](_0x2a188d)||_0xf2f58d[_0x5df17a(0x1ad)]?.[_0x5df17a(0x200)]()[_0x5df17a(0x1fa)](_0x2a188d)),_0x523aad=await listDatasets(_0x3aad54,{'code':_0x53b1b0});for(const _0x16b501 of _0x523aad){!_0x15d93c[_0x5df17a(0x1d8)](_0x16b501['id'])&&(_0x2bbfca['push'](_0x16b501),_0x15d93c[_0x5df17a(0x1eb)](_0x16b501['id']));}return _0x2bbfca;}export function normalizeDatasetOperations(_0x10d232){const _0x484eee=a113_0x3471;if(Array[_0x484eee(0x1a0)](_0x10d232))return _0x10d232['filter'](_0x370cc3=>_0x370cc3!=null&&typeof _0x370cc3===_0x484eee(0x1c6));if(_0x10d232&&typeof _0x10d232===_0x484eee(0x1c6))return Object[_0x484eee(0x1a1)](_0x10d232)[_0x484eee(0x192)](([,_0x3492fe])=>_0x3492fe!=null&&typeof _0x3492fe===_0x484eee(0x1c6))[_0x484eee(0x1fc)](([_0x11b8f7,_0x59a702])=>({..._0x59a702,'name':_0x59a702[_0x484eee(0x18e)]??_0x59a702['operationName']??_0x11b8f7}));return[];}export async function getDatasetDetail(_0x1725ff){const _0x2f43fe=a113_0x3471,_0x139b4f=/^\d+$/['test'](_0x1725ff)?'id':_0x2f43fe(0x1aa),_0x58e08b=await apiRequest(_0x2f43fe(0x1e4)+_0x139b4f+'='+_0x1725ff);return _0x58e08b['data'];}export async function getDatasetOperations(_0x4c231b){const _0x11f169=a113_0x3471,_0x37606d=await getDatasetDetail(_0x4c231b),_0x3e0890=normalizeDatasetOperations(_0x37606d[_0x11f169(0x1a7)])['map'](_0x21ce45=>({'name':_0x21ce45['name']||_0x21ce45[_0x11f169(0x205)],'displayName':_0x21ce45[_0x11f169(0x1af)]||_0x21ce45[_0x11f169(0x18e)],'type':_0x21ce45[_0x11f169(0x1f0)],'method':_0x21ce45[_0x11f169(0x1e1)],'path':_0x21ce45['path'],'enabled':_0x21ce45[_0x11f169(0x1e7)]??!![],'requestFields':_0x21ce45[_0x11f169(0x1ea)],'responseFields':_0x21ce45[_0x11f169(0x1bb)]}));return{'dataset':{'id':_0x37606d['id']??_0x37606d['modelId'],'name':_0x37606d[_0x11f169(0x18e)],'code':_0x37606d[_0x11f169(0x1aa)]||_0x37606d[_0x11f169(0x195)],'tableName':_0x37606d[_0x11f169(0x1bf)]||_0x37606d[_0x11f169(0x1fd)]?.[_0x11f169(0x1bf)]},'operations':_0x3e0890};}export async function getOperationDetail(_0x1cb939,_0x5448e1,_0x4110c5){const _0x4a4a20=a113_0x3471;let _0x40be5d=_0x5448e1;if(!/^\d+$/[_0x4a4a20(0x1d1)](_0x5448e1)){const _0x199cd9=await listDatasets(_0x1cb939,{'code':_0x5448e1}),_0x47db8e=_0x199cd9[_0x4a4a20(0x1c9)](_0x2b8883=>_0x2b8883[_0x4a4a20(0x1aa)]===_0x5448e1||String(_0x2b8883['id'])===_0x5448e1);if(!_0x47db8e)throw CliErrors[_0x4a4a20(0x20b)]('Dataset\x20not\x20found:\x20'+_0x5448e1);_0x40be5d=String(_0x47db8e['id']);}const _0x18bd56=await getDatasetDetail(_0x40be5d),_0x4f7282=normalizeDatasetOperations(_0x18bd56['operations'])[_0x4a4a20(0x1c9)](_0x39e61b=>(_0x39e61b['name']||_0x39e61b[_0x4a4a20(0x205)])===_0x4110c5);if(!_0x4f7282)throw CliErrors[_0x4a4a20(0x20b)]('Operation\x20\x22'+_0x4110c5+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x5448e1);return{'dataset':{'id':_0x18bd56['id']??_0x18bd56[_0x4a4a20(0x1dd)],'name':_0x18bd56[_0x4a4a20(0x18e)],'code':_0x18bd56['code']||_0x18bd56[_0x4a4a20(0x195)],'tableName':_0x18bd56[_0x4a4a20(0x1bf)]||_0x18bd56[_0x4a4a20(0x1fd)]?.[_0x4a4a20(0x1bf)]},'operation':_0x4f7282};}export function generateSdkCode(_0x3bd100,_0x132ff0,_0x3933b4){const _0x1f8519=a113_0x3471,_0x278078=_0x3933b4?.['includeImports']??!![],_0x542812=_0x1f8519(0x1d2)+_0x3bd100['code']?.[_0x1f8519(0x1ab)](/-/g,'_'),_0x56220c=_0x132ff0[_0x1f8519(0x18e)]||_0x132ff0[_0x1f8519(0x205)]||'filter',_0x337fc5=[];_0x278078&&_0x337fc5[_0x1f8519(0x1f6)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1f8519(0x1b3),'');_0x337fc5[_0x1f8519(0x1f6)]('//\x20'+_0x3bd100['name']+'\x20('+(_0x3bd100[_0x1f8519(0x1bf)]||_0x1f8519(0x1d5))+')');if(_0x56220c===_0x1f8519(0x192))_0x337fc5[_0x1f8519(0x1f6)]('const\x20result\x20=\x20await\x20client.models.'+_0x542812+'.filter({',_0x1f8519(0x1cc),_0x1f8519(0x199),_0x1f8519(0x1d6),_0x1f8519(0x1f4));else{if(_0x56220c==='getOne')_0x337fc5[_0x1f8519(0x1f6)](_0x1f8519(0x1ac)+_0x542812+_0x1f8519(0x1fb));else{if(_0x56220c===_0x1f8519(0x1a4))_0x337fc5[_0x1f8519(0x1f6)](_0x1f8519(0x1ac)+_0x542812+_0x1f8519(0x1da));else{if(_0x56220c===_0x1f8519(0x201))_0x337fc5['push']('const\x20result\x20=\x20await\x20client.models.'+_0x542812+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x56220c==='delete'||_0x56220c===_0x1f8519(0x1d3)?_0x337fc5['push']('const\x20result\x20=\x20await\x20client.models.'+_0x542812+'.remove(id);'):_0x337fc5[_0x1f8519(0x1f6)]('const\x20result\x20=\x20await\x20client.models.'+_0x542812+'.'+_0x56220c+_0x1f8519(0x1c3));}}}return _0x337fc5['join']('\x0a');}export function generateSqlCodeTemplate(_0x22c545,_0x5ec4f0){const _0x17c823=a113_0x3471,_0x43dc7b=_0x5ec4f0?.[_0x17c823(0x1b4)]??'sdk',_0x2988e7=_0x5ec4f0?.[_0x17c823(0x203)]??!![],_0x55f67f=[];return _0x55f67f[_0x17c823(0x1f6)](_0x17c823(0x1b5)+_0x22c545[_0x17c823(0x1f3)]+'\x20('+_0x22c545[_0x17c823(0x206)]+')'),_0x43dc7b==='sdk'?(_0x2988e7&&_0x55f67f[_0x17c823(0x1f6)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x17c823(0x1b3),''),_0x55f67f[_0x17c823(0x1f6)](_0x17c823(0x1c7),'\x20\x20sqlCode:\x20\x27'+_0x22c545[_0x17c823(0x206)]+'\x27,',_0x17c823(0x1cd),_0x17c823(0x1f4),_0x17c823(0x20a),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x55f67f[_0x17c823(0x1f6)](_0x17c823(0x1a3),_0x17c823(0x18f),_0x17c823(0x1be),_0x17c823(0x20d)+_0x22c545[_0x17c823(0x206)]+'\x27,',_0x17c823(0x19b),_0x17c823(0x1ed),_0x17c823(0x1c4),'}'),_0x55f67f[_0x17c823(0x20e)]('\x0a');}export async function getErConfig(_0x1552d3,_0x8f6964){const _0x487830=a113_0x3471,_0xdf8f1f=await apiRequest('/smartapi/question/er-config',{'method':_0x487830(0x1f7),'body':{'appCode':_0x1552d3,'dblinkId':_0x8f6964}});return _0xdf8f1f[_0x487830(0x1ef)];}function buildQuery(_0x207a59){const _0x3fbe99=a113_0x3471,_0x267953=new URLSearchParams();for(const [_0x48bc2f,_0xdc872c]of Object[_0x3fbe99(0x1a1)](_0x207a59)){if(_0xdc872c===undefined||_0xdc872c==='')continue;_0x267953[_0x3fbe99(0x1bc)](_0x48bc2f,String(_0xdc872c));}const _0x37119c=_0x267953[_0x3fbe99(0x19a)]();return _0x37119c?'?'+_0x37119c:'';}export async function listDbLinks(_0x58dd38,_0x2fde16){const _0x29c062=a113_0x3471,_0x34c8d3=await apiRequest('/smartapi/dblink/getList',{'method':_0x29c062(0x1f7),'body':{'appCode':_0x58dd38,'currentPage':_0x2fde16?.['currentPage']??0x1,'pageSize':_0x2fde16?.[_0x29c062(0x1a2)]??0x64}});return{'items':extractList(_0x34c8d3[_0x29c062(0x1ef)]),'paging':extractPaging(_0x34c8d3[_0x29c062(0x1ef)])};}export async function getDbLinkInfo(_0x1080c0){const _0x4eb9ca=a113_0x3471,_0x3c864a=await apiRequest(_0x4eb9ca(0x1b8)+buildQuery({'id':_0x1080c0}));return _0x3c864a[_0x4eb9ca(0x1ef)];}export async function createDbLink(_0x16046a){const _0x4baae2=a113_0x3471,_0x2bef44=await apiRequest(_0x4baae2(0x209),{'method':_0x4baae2(0x1f7),'body':_0x16046a});return _0x2bef44[_0x4baae2(0x1ef)];}export async function updateDbLink(_0x9fc300){const _0x27b8df=a113_0x3471,_0x1cda97=await apiRequest('/smartapi/dblink/update',{'method':_0x27b8df(0x1f7),'body':_0x9fc300});return _0x1cda97[_0x27b8df(0x1ef)];}export async function deleteDbLink(_0x5bbd41){const _0x1cf84f=a113_0x3471;await apiRequest('/smartapi/dblink/delete',{'method':_0x1cf84f(0x1f7),'body':{'id':_0x5bbd41}});}export async function testDbLinkConnect(_0x23f5dc){const _0x332c5d=a113_0x3471,_0x2cc8c2=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x23f5dc}));return _0x2cc8c2[_0x332c5d(0x1ef)];}export async function startDbAnalysis(_0x4d30bf,_0x493340){const _0x253ee1=a113_0x3471,_0x56bfd2=await apiRequest('/smartapi/db-analysis/start',{'method':'POST','body':{'dbLinkId':_0x4d30bf,..._0x493340&&_0x493340[_0x253ee1(0x1e8)]>0x0?{'tableNames':_0x493340}:{}}}),_0x35c285=_0x56bfd2[_0x253ee1(0x1ef)];if(typeof _0x35c285===_0x253ee1(0x1d7))return _0x35c285;if(_0x35c285&&typeof _0x35c285===_0x253ee1(0x1c6)&&typeof _0x35c285['planId']===_0x253ee1(0x1d7))return _0x35c285['planId'];return _0x35c285!=null?String(_0x35c285):'';}export async function cancelDbAnalysis(_0x4324c0){const _0x4d8244=a113_0x3471;await apiRequest(_0x4d8244(0x1a6)+buildQuery({'planId':_0x4324c0}),{'method':_0x4d8244(0x1f7)});}export async function getDbAnalysisStatus(_0x5ebd0e){const _0x3cd657=a113_0x3471,_0x5170cc=await apiRequest(_0x3cd657(0x1e3)+encodeURIComponent(_0x5ebd0e));return _0x5170cc[_0x3cd657(0x1ef)];}export async function getDbAllTableList(_0x52c30e,_0x3bd7c9){const _0x52cd35=a113_0x3471,_0x52f3db=await apiRequest(_0x52cd35(0x1c5)+buildQuery({'appCode':_0x52c30e,'dbLinkId':_0x3bd7c9})),_0x3b1e2d=_0x52f3db[_0x52cd35(0x1ef)];if(Array[_0x52cd35(0x1a0)](_0x3b1e2d))return _0x3b1e2d;return extractList(_0x3b1e2d);}export async function getDbTableDiff(_0x1533f2,_0x4c2b83,_0x36854d){const _0x569b8a=a113_0x3471,_0x2cefaa=await apiRequest(_0x569b8a(0x207)+buildQuery({'appCode':_0x1533f2,'dbLinkId':_0x4c2b83,'pageIndex':_0x36854d?.[_0x569b8a(0x1a8)]??0x1,'pageSize':_0x36854d?.['pageSize']??0x14,'tableName':_0x36854d?.['tableName']})),_0x220242=_0x2cefaa[_0x569b8a(0x1ef)];return{'totalCount':_0x220242?.[_0x569b8a(0x196)]??0x0,'tableList':Array[_0x569b8a(0x1a0)](_0x220242?.[_0x569b8a(0x1ae)])?_0x220242[_0x569b8a(0x1ae)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x55e1c3=a113_0x3471,_0x2073ac=await apiRequest('/smartapi/app/getList',{'method':_0x55e1c3(0x1f7),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x37afca=extractList(_0x2073ac[_0x55e1c3(0x1ef)]),_0x35bc7e=extractPaging(_0x2073ac['data']);return _0x35bc7e&&_0x35bc7e[_0x55e1c3(0x196)]>REMOTE_APP_PAGE_SIZE&&console[_0x55e1c3(0x1ec)](_0x55e1c3(0x1b1)+REMOTE_APP_PAGE_SIZE+_0x55e1c3(0x1cf)+_0x35bc7e[_0x55e1c3(0x196)]+'\x20apps.\x20'+_0x55e1c3(0x1f1)),_0x37afca;}
@@ -1 +1 @@
1
- const a109_0x4e5654=a109_0x2aa1;(function(_0x4c2eba,_0x3ca0ef){const _0x47a34f=a109_0x2aa1,_0x5b3fcf=_0x4c2eba();while(!![]){try{const _0x35a142=parseInt(_0x47a34f(0xc7))/0x1+-parseInt(_0x47a34f(0xc8))/0x2*(parseInt(_0x47a34f(0xc0))/0x3)+-parseInt(_0x47a34f(0xc4))/0x4*(-parseInt(_0x47a34f(0xc5))/0x5)+parseInt(_0x47a34f(0xca))/0x6*(-parseInt(_0x47a34f(0xbe))/0x7)+parseInt(_0x47a34f(0xbf))/0x8*(-parseInt(_0x47a34f(0xc9))/0x9)+-parseInt(_0x47a34f(0xc3))/0xa*(-parseInt(_0x47a34f(0xcb))/0xb)+-parseInt(_0x47a34f(0xc6))/0xc;if(_0x35a142===_0x3ca0ef)break;else _0x5b3fcf['push'](_0x5b3fcf['shift']());}catch(_0xc5c0ff){_0x5b3fcf['push'](_0x5b3fcf['shift']());}}}(a109_0x14f3,0x81c2d));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a109_0x14f3(){const _0x42f449=['1644810KDVEKJ','4desSyA','4310675nzyExI','7655832jfzHKp','841338zRhdEn','8914NTMEoP','91971SgSebu','54esSpnh','33tGbxwt','/bff','386575vFhkKC','328IOIeiT','75mSQhYU','bff-trash','bff.lock.json'];a109_0x14f3=function(){return _0x42f449;};return a109_0x14f3();}function a109_0x2aa1(_0x11fda0,_0x2a6e66){_0x11fda0=_0x11fda0-0xbd;const _0x14f3ab=a109_0x14f3();let _0x2aa1c9=_0x14f3ab[_0x11fda0];return _0x2aa1c9;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a109_0x4e5654(0xc2),TRASH_DIR_NAME=a109_0x4e5654(0xc1);export function loadBffProjectConfig(_0x3c57b4,_0x18a2ed){const _0x101db2=a109_0x4e5654,_0x306163=resolve(_0x18a2ed??findProjectRootDirectory()),_0x20c882=DOT_DIR+_0x101db2(0xbd),_0x1da372=_0x20c882+'/'+_0x3c57b4;return{'projectRoot':_0x306163,'appCode':_0x3c57b4,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x20c882,'scriptsRoot':_0x1da372,'scriptsRootDir':resolve(_0x306163,DOT_DIR,'bff',_0x3c57b4),'lockFilePath':resolve(_0x306163,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x306163,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a114_0x3009(_0x897382,_0x1f3a6c){_0x897382=_0x897382-0xaf;const _0x4b6622=a114_0x4b66();let _0x300996=_0x4b6622[_0x897382];return _0x300996;}const a114_0x419da6=a114_0x3009;(function(_0xa2d5cb,_0x31c410){const _0x47ef6f=a114_0x3009,_0xefdf24=_0xa2d5cb();while(!![]){try{const _0x4f7c74=parseInt(_0x47ef6f(0xb2))/0x1*(parseInt(_0x47ef6f(0xb1))/0x2)+-parseInt(_0x47ef6f(0xb8))/0x3+-parseInt(_0x47ef6f(0xaf))/0x4+-parseInt(_0x47ef6f(0xb6))/0x5+parseInt(_0x47ef6f(0xb7))/0x6+-parseInt(_0x47ef6f(0xbb))/0x7+parseInt(_0x47ef6f(0xb5))/0x8;if(_0x4f7c74===_0x31c410)break;else _0xefdf24['push'](_0xefdf24['shift']());}catch(_0x25451a){_0xefdf24['push'](_0xefdf24['shift']());}}}(a114_0x4b66,0x88479));function a114_0x4b66(){const _0x24e4b8=['1542236skYJqO','.rabetbase','2oJfZgJ','591463TwvQeV','bff','/bff','18135184jnEUOQ','5456810rpkGQW','853416lspgSI','1174302gbbwDt','bff.lock.json','bff-trash','4018287BkqRUO'];a114_0x4b66=function(){return _0x24e4b8;};return a114_0x4b66();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a114_0x419da6(0xb0),LOCK_FILE_NAME=a114_0x419da6(0xb9),TRASH_DIR_NAME=a114_0x419da6(0xba);export function loadBffProjectConfig(_0x367669,_0x463184){const _0x54bc16=a114_0x419da6,_0x93cb20=resolve(_0x463184??findProjectRootDirectory()),_0x12a797=DOT_DIR+_0x54bc16(0xb4),_0xcb4d3b=_0x12a797+'/'+_0x367669;return{'projectRoot':_0x93cb20,'appCode':_0x367669,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x12a797,'scriptsRoot':_0xcb4d3b,'scriptsRootDir':resolve(_0x93cb20,DOT_DIR,_0x54bc16(0xb3),_0x367669),'lockFilePath':resolve(_0x93cb20,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x93cb20,DOT_DIR,TRASH_DIR_NAME)};}