@lovrabet/rabetbase-cli 2.2.4-beta.2 → 2.2.4-beta.3

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 (205) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/list.js +1 -1
  87. package/lib/commands/menu/shared/compare-table.js +1 -1
  88. package/lib/commands/menu/shared/index.js +1 -1
  89. package/lib/commands/menu/shared/inquirer.js +1 -1
  90. package/lib/commands/menu/shared/local-pages.js +1 -1
  91. package/lib/commands/menu/shared/logic.js +1 -1
  92. package/lib/commands/menu/shared/service.js +1 -1
  93. package/lib/commands/menu/shared/sync-core.js +1 -1
  94. package/lib/commands/menu/shared/update-core.js +1 -1
  95. package/lib/commands/menu/shared/valid-url.js +1 -1
  96. package/lib/commands/menu/sync.js +1 -1
  97. package/lib/commands/menu/update.js +1 -1
  98. package/lib/commands/page/generate-start.js +1 -1
  99. package/lib/commands/page/generate-status.js +1 -1
  100. package/lib/commands/page/index.js +1 -1
  101. package/lib/commands/page/pull.js +1 -1
  102. package/lib/commands/page/push.js +1 -1
  103. package/lib/commands/page/relation-audit.js +1 -1
  104. package/lib/commands/page/shared.js +1 -1
  105. package/lib/commands/page/standard-page-status.js +1 -1
  106. package/lib/commands/page/sync.js +1 -1
  107. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  108. package/lib/commands/project/create/format-elapsed.js +1 -1
  109. package/lib/commands/project/create/main.js +1 -1
  110. package/lib/commands/project/create/non-interactive.js +1 -1
  111. package/lib/commands/project/create/project-template-path.js +1 -1
  112. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  113. package/lib/commands/project/create/use-format-code.js +1 -1
  114. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  115. package/lib/commands/project/index.js +1 -1
  116. package/lib/commands/project/init.js +1 -1
  117. package/lib/commands/project/upgrade.js +1 -1
  118. package/lib/commands/registry.js +1 -1
  119. package/lib/commands/run/index.js +1 -1
  120. package/lib/commands/schema.js +1 -1
  121. package/lib/commands/skill/index.js +1 -1
  122. package/lib/commands/sql/create.js +1 -1
  123. package/lib/commands/sql/delete.js +1 -1
  124. package/lib/commands/sql/detail.js +1 -1
  125. package/lib/commands/sql/exec.js +1 -1
  126. package/lib/commands/sql/index.js +1 -1
  127. package/lib/commands/sql/list.js +1 -1
  128. package/lib/commands/sql/pull.js +1 -1
  129. package/lib/commands/sql/push.js +1 -1
  130. package/lib/commands/sql/save.js +1 -1
  131. package/lib/commands/sql/shared.js +1 -1
  132. package/lib/commands/sql/status.js +1 -1
  133. package/lib/commands/sql/validate.js +1 -1
  134. package/lib/config/schema.js +1 -1
  135. package/lib/constant/cdn.js +1 -1
  136. package/lib/constant/cli.js +1 -1
  137. package/lib/constant/defaults.js +1 -1
  138. package/lib/constant/domain.js +1 -1
  139. package/lib/constant/env.js +1 -1
  140. package/lib/constant/output.js +1 -1
  141. package/lib/constant/paths.js +1 -1
  142. package/lib/constant/risk.js +1 -1
  143. package/lib/context.js +1 -1
  144. package/lib/core/alias-resolver.js +1 -1
  145. package/lib/core/api-client.js +1 -1
  146. package/lib/core/bff/config.js +1 -1
  147. package/lib/core/bff/file-system.js +1 -1
  148. package/lib/core/bff/hash.js +1 -1
  149. package/lib/core/bff/lock.js +1 -1
  150. package/lib/core/bff/utils.js +1 -1
  151. package/lib/core/db-resolver.js +1 -1
  152. package/lib/core/page/file-system.js +1 -1
  153. package/lib/core/page/hash.js +1 -1
  154. package/lib/core/page/lock.js +1 -1
  155. package/lib/core/sql-sync/config.js +1 -1
  156. package/lib/core/sql-sync/file-system.js +1 -1
  157. package/lib/core/sql-sync/hash.js +1 -1
  158. package/lib/core/sql-sync/lock.js +1 -1
  159. package/lib/core/sql-sync/utils.js +1 -1
  160. package/lib/core/sql-validator.js +1 -1
  161. package/lib/errors.js +1 -1
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/flags.js +1 -1
  164. package/lib/framework/help.js +1 -1
  165. package/lib/framework/index.js +1 -1
  166. package/lib/framework/output.js +1 -1
  167. package/lib/framework/response.js +1 -1
  168. package/lib/framework/runner-alias.js +1 -1
  169. package/lib/framework/runner.js +1 -1
  170. package/lib/framework/schema-export.js +1 -1
  171. package/lib/framework/types.js +1 -1
  172. package/lib/generated/build-info.js +1 -1
  173. package/lib/help.js +1 -1
  174. package/lib/skills/main.js +1 -1
  175. package/lib/skills/npx-skills-add.js +1 -1
  176. package/lib/telemetry/cli-command-trace.js +1 -1
  177. package/lib/telemetry/cli-help-trace.js +1 -1
  178. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  179. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  180. package/lib/telemetry/send-cli-trace-log.js +1 -1
  181. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  182. package/lib/utils/ai_config.js +1 -1
  183. package/lib/utils/apply-jq-filter.js +1 -1
  184. package/lib/utils/cdn-config.js +1 -1
  185. package/lib/utils/check-sdk-version.js +1 -1
  186. package/lib/utils/cli-version-check.js +1 -1
  187. package/lib/utils/cli-version-policy.js +1 -1
  188. package/lib/utils/config.js +1 -1
  189. package/lib/utils/copy-directory.js +1 -1
  190. package/lib/utils/entity-with-id.js +1 -1
  191. package/lib/utils/file-utils.js +1 -1
  192. package/lib/utils/guides-cdn.js +1 -1
  193. package/lib/utils/http-client.js +1 -1
  194. package/lib/utils/is-non-interactive.js +1 -1
  195. package/lib/utils/logger.js +1 -1
  196. package/lib/utils/params.js +1 -1
  197. package/lib/utils/platform.js +1 -1
  198. package/lib/utils/rules-cdn.js +1 -1
  199. package/lib/utils/sleep.js +1 -1
  200. package/lib/utils/template-replacer.js +1 -1
  201. package/lib/utils/update-notice.js +1 -1
  202. package/lib/utils/version.js +1 -1
  203. package/lib/utils/with-active-cookie.js +1 -1
  204. package/lib/utils/write-cli-side-channel.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a128_0x5d1edb=a128_0x2c59;(function(_0xd5bee9,_0x169852){const _0x195fc2=a128_0x2c59,_0x90245a=_0xd5bee9();while(!![]){try{const _0x1e6b1f=-parseInt(_0x195fc2(0x1f3))/0x1*(-parseInt(_0x195fc2(0x204))/0x2)+parseInt(_0x195fc2(0x22b))/0x3+-parseInt(_0x195fc2(0x211))/0x4*(-parseInt(_0x195fc2(0x1f0))/0x5)+-parseInt(_0x195fc2(0x20f))/0x6+parseInt(_0x195fc2(0x221))/0x7+-parseInt(_0x195fc2(0x1f7))/0x8+-parseInt(_0x195fc2(0x22e))/0x9;if(_0x1e6b1f===_0x169852)break;else _0x90245a['push'](_0x90245a['shift']());}catch(_0x543951){_0x90245a['push'](_0x90245a['shift']());}}}(a128_0x3802,0xb14c2));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a128_0x3802(){const _0x400490=['unchanged','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','\x20SQL\x20file(s)\x20into\x20','appCode','lastSync','sqlRoot','POST','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','name','sql','122SnpkVW','Force\x20pull\x20cancelled.','totalCount','path','tableData','toISOString','utf8','sqlName','message','description','\x20written,\x20','2586114oJDcHT','pull','535140KyGEND','split','bool','sqlcode','write','skipped','lockFilePath','sqlRootDir','str','test','sqlContent','mybatisXml','trimStart','local\x20differs\x20from\x20remote','filter','Filter\x20by\x20SQL\x20display\x20name','5640586KGAmFf','push','sqlCode','paging','No\x20remote\x20SQL\x20queries\x20matched.','Would\x20pull\x20','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','dbId','would_pull','3393585mweotA','\x20failed','length','15000183bKakqG','catch','nonInteractive','join','15kAUGiW','apps','Pull\x20complete:\x20','8538jTTfUO','force','conflict','string','282000XKQbkP','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)'];a128_0x3802=function(){return _0x400490;};return a128_0x3802();}function a128_0x2c59(_0x5b9415,_0xa9e157){_0x5b9415=_0x5b9415-0x1ef;const _0x38027b=a128_0x3802();let _0x2c591d=_0x38027b[_0x5b9415];return _0x2c591d;}async function fetchAllSqlQueries(_0x424ab9,_0x239867){const _0x1e0ce4=a128_0x2c59,_0x5dcda0=[];let _0x40163c=0x1;while(!![]){const _0x193351=await listSqlQueries(_0x424ab9,{'currentPage':_0x40163c,'pageSize':PAGE_SIZE,'sqlCode':_0x239867['sqlCode'],'sqlName':_0x239867['sqlName']}),_0x194a6d=_0x193351[_0x1e0ce4(0x208)]??[];_0x5dcda0['push'](..._0x194a6d);if(_0x194a6d['length']===0x0)break;const _0x134ce7=_0x193351[_0x1e0ce4(0x224)]?.[_0x1e0ce4(0x206)];if(_0x134ce7!=null?_0x5dcda0[_0x1e0ce4(0x22d)]>=_0x134ce7:_0x194a6d[_0x1e0ce4(0x22d)]<PAGE_SIZE)break;_0x40163c++;}return _0x5dcda0;}async function ensureSqlContent(_0x2a1927){const _0x1931b0=a128_0x2c59;if(_0x2a1927[_0x1931b0(0x21b)]!=null&&String(_0x2a1927[_0x1931b0(0x21b)])['length']>0x0)return _0x2a1927;return getSqlQueryDetail(_0x2a1927[_0x1931b0(0x223)]);}export const sqlPull={'service':a128_0x5d1edb(0x203),'command':a128_0x5d1edb(0x210),'description':a128_0x5d1edb(0x1fb),'risk':a128_0x5d1edb(0x215),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x5d1edb(0x202),'type':a128_0x5d1edb(0x1f6),'description':a128_0x5d1edb(0x220)},{'name':a128_0x5d1edb(0x1f4),'type':'boolean','description':a128_0x5d1edb(0x228)}],async 'dryRun'(_0x1e4719){const _0xddd9de=a128_0x5d1edb,_0x5dd25c=loadSqlProjectConfig(_0x1e4719[_0xddd9de(0x1fd)]),_0x5ecfa5=await readSqlLockFile(_0x5dd25c[_0xddd9de(0x217)]),{appLock:_0x35585f}=ensureSqlLockScope(_0x5ecfa5??createEmptySqlLock(),_0x5dd25c['appCode'],_0x5dd25c[_0xddd9de(0x1ff)],_0xddd9de(0x210)),_0x5f4604=await fetchAllSqlQueries(_0x1e4719[_0xddd9de(0x1fd)],{'sqlCode':_0x1e4719[_0xddd9de(0x219)](_0xddd9de(0x214))||undefined,'sqlName':_0x1e4719[_0xddd9de(0x219)](_0xddd9de(0x202))||undefined}),_0x4c03d6=[];for(const _0x2e2426 of _0x5f4604){const _0x5ec6b0=await ensureSqlContent(_0x2e2426),_0x7c193f=ensureRemoteSqlContent(_0x5ec6b0),_0x12ffc2=detectModeFromSql(_0x5ec6b0),_0x1a17ab=_0x5ec6b0[_0xddd9de(0x229)]?await getDbName(_0x1e4719[_0xddd9de(0x1fd)],Number(_0x5ec6b0[_0xddd9de(0x229)]))[_0xddd9de(0x22f)](()=>undefined):undefined,_0x226190=buildLocalSqlFileContent({'sqlCode':_0x5ec6b0[_0xddd9de(0x223)],'sqlName':_0x5ec6b0[_0xddd9de(0x20b)],'dbId':_0x5ec6b0[_0xddd9de(0x229)]},_0x7c193f,{'dbName':_0x1a17ab,'mode':_0x12ffc2,'syncedAt':new Date()['toISOString'](),'description':_0x5ec6b0[_0xddd9de(0x20d)]}),_0x2d6432=buildSqlLockEntry(_0x5ec6b0,_0x7c193f,'',{'dbName':_0x1a17ab}),_0x3bceab=resolveLocalSqlFilePath(_0x5dd25c,_0x5ec6b0[_0xddd9de(0x223)],_0x2d6432);let _0x420c02=_0xddd9de(0x22a),_0x10cbfe;if(await fileExists(_0x3bceab)){const _0x1ef6b4=await readFile(_0x3bceab,'utf8');isEquivalentPulledSqlFile(_0x1ef6b4,_0x226190,_0x12ffc2)?(_0x420c02=_0xddd9de(0x216),_0x10cbfe=_0xddd9de(0x1f9)):(_0x420c02=_0xddd9de(0x1f5),_0x10cbfe=_0xddd9de(0x1f8));}_0x4c03d6[_0xddd9de(0x222)]({'sqlCode':_0x5ec6b0[_0xddd9de(0x223)],'sqlName':_0x5ec6b0[_0xddd9de(0x20b)],'filePath':_0x3bceab,'status':_0x420c02,'reason':_0x10cbfe});}return{'method':_0xddd9de(0x200),'url':_0xddd9de(0x201),'body':{'appCode':_0x1e4719[_0xddd9de(0x1fd)],'sqlCode':_0x1e4719[_0xddd9de(0x219)](_0xddd9de(0x214))||null,'sqlName':_0x1e4719[_0xddd9de(0x219)](_0xddd9de(0x202))||null,'files':_0x4c03d6},'description':_0xddd9de(0x226)+_0x4c03d6[_0xddd9de(0x22d)]+_0xddd9de(0x1fc)+_0x5dd25c[_0xddd9de(0x218)]};},async 'execute'(_0x131474){const _0x5f1cf1=a128_0x5d1edb,_0x35f3d5=loadSqlProjectConfig(_0x131474[_0x5f1cf1(0x1fd)]),_0xce58c=await readSqlLockFile(_0x35f3d5[_0x5f1cf1(0x217)]),{lockData:_0x1a683a,appLock:_0x46940d}=ensureSqlLockScope(_0xce58c??createEmptySqlLock(),_0x35f3d5[_0x5f1cf1(0x1fd)],_0x35f3d5[_0x5f1cf1(0x1ff)],_0x5f1cf1(0x210)),_0x17a92d=_0x131474[_0x5f1cf1(0x213)]('force'),_0x43ed89=await fetchAllSqlQueries(_0x131474[_0x5f1cf1(0x1fd)],{'sqlCode':_0x131474[_0x5f1cf1(0x219)](_0x5f1cf1(0x214))||undefined,'sqlName':_0x131474[_0x5f1cf1(0x219)](_0x5f1cf1(0x202))||undefined});if(_0x43ed89['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5f1cf1(0x225)};const _0x1c5fd8=[],_0x16ba46=[];for(const _0x48f73d of _0x43ed89){try{_0x1c5fd8[_0x5f1cf1(0x222)](await ensureSqlContent(_0x48f73d));}catch(_0x43633d){_0x16ba46[_0x5f1cf1(0x222)]({'sqlCode':_0x48f73d[_0x5f1cf1(0x223)],'error':_0x43633d instanceof Error?_0x43633d[_0x5f1cf1(0x20c)]:String(_0x43633d)});}}if(_0x17a92d&&!_0x131474[_0x5f1cf1(0x230)]){let _0x5a464b=![];for(const _0x54a1b6 of _0x1c5fd8){const _0x5e51e9=detectModeFromSql(_0x54a1b6),_0x3deabd=_0x54a1b6['dbId']?await getDbName(_0x131474[_0x5f1cf1(0x1fd)],Number(_0x54a1b6['dbId']))['catch'](()=>undefined):undefined,_0x205a75=buildLocalSqlFileContent({'sqlCode':_0x54a1b6['sqlCode'],'sqlName':_0x54a1b6['sqlName'],'dbId':_0x54a1b6[_0x5f1cf1(0x229)]},ensureRemoteSqlContent(_0x54a1b6),{'dbName':_0x3deabd,'mode':_0x5e51e9,'syncedAt':new Date()[_0x5f1cf1(0x209)](),'description':_0x54a1b6[_0x5f1cf1(0x20d)]}),_0x31351f=resolveLocalSqlFilePath(_0x35f3d5,_0x54a1b6[_0x5f1cf1(0x223)],buildSqlLockEntry(_0x54a1b6,ensureRemoteSqlContent(_0x54a1b6),'',{'dbName':_0x3deabd}));if(await fileExists(_0x31351f)){const _0x1a4c60=await readFile(_0x31351f,'utf8');if(!isEquivalentPulledSqlFile(_0x1a4c60,_0x205a75,_0x5e51e9)){_0x5a464b=!![];break;}}}if(_0x5a464b){const _0x319a32=await confirmForceOverwrite(_0x5f1cf1(0x1fa));if(!_0x319a32)throw CliErrors['cancelled'](_0x5f1cf1(0x205));}}const _0x33f5e0=cloneSqlLockData(_0x1a683a),_0x27ad73=_0x33f5e0[_0x5f1cf1(0x1f1)][_0x35f3d5[_0x5f1cf1(0x1fd)]],_0x519a6a=[],_0xe8eaf9=[];for(const _0x34d5d2 of _0x1c5fd8){const _0x3bffb5=_0x27ad73['sqls'][_0x34d5d2['sqlCode']],_0x2b49b6=ensureRemoteSqlContent(_0x34d5d2),_0x3556f2=detectModeFromSql(_0x34d5d2),_0x13dcac=_0x34d5d2[_0x5f1cf1(0x229)]?await getDbName(_0x131474['appCode'],Number(_0x34d5d2[_0x5f1cf1(0x229)]))[_0x5f1cf1(0x22f)](()=>undefined):undefined,_0x1fd6c0=buildLocalSqlFileContent({'sqlCode':_0x34d5d2['sqlCode'],'sqlName':_0x34d5d2[_0x5f1cf1(0x20b)],'dbId':_0x34d5d2[_0x5f1cf1(0x229)]},_0x2b49b6,{'dbName':_0x13dcac,'mode':_0x3556f2,'syncedAt':new Date()[_0x5f1cf1(0x209)](),'description':_0x34d5d2[_0x5f1cf1(0x20d)]}),_0x172b11=buildSqlLockEntry(_0x34d5d2,_0x2b49b6,computeSqlContentHash(_0x1fd6c0),{'dbName':_0x13dcac}),_0x22b926=_0x172b11[_0x5f1cf1(0x207)],_0x359ec0=join(_0x35f3d5[_0x5f1cf1(0x218)],_0x22b926);try{if(await fileExists(_0x359ec0)){const _0x218a54=await readFile(_0x359ec0,_0x5f1cf1(0x20a));if(isEquivalentPulledSqlFile(_0x218a54,_0x1fd6c0,_0x3556f2)){_0xe8eaf9[_0x5f1cf1(0x222)]({'sqlCode':_0x34d5d2[_0x5f1cf1(0x223)],'reason':'unchanged'}),_0x27ad73[_0x5f1cf1(0x227)][_0x34d5d2[_0x5f1cf1(0x223)]]={..._0x172b11,'hash':computeSqlContentHash(_0x218a54),'path':_0x22b926};continue;}if(!_0x17a92d){_0xe8eaf9[_0x5f1cf1(0x222)]({'sqlCode':_0x34d5d2[_0x5f1cf1(0x223)],'reason':_0x5f1cf1(0x21e)});continue;}}const _0x1ae123=_0x3bffb5?.[_0x5f1cf1(0x207)]?join(_0x35f3d5['sqlRootDir'],_0x3bffb5[_0x5f1cf1(0x207)]):undefined;_0x1ae123&&_0x1ae123!==_0x359ec0&&await fileExists(_0x1ae123)&&await rm(_0x1ae123,{'force':!![]}),await ensureParentDirectory(_0x359ec0),await writeFile(_0x359ec0,_0x1fd6c0,_0x5f1cf1(0x20a)),_0x27ad73[_0x5f1cf1(0x227)][_0x34d5d2['sqlCode']]={..._0x172b11,'path':_0x22b926},_0x519a6a[_0x5f1cf1(0x222)]({'sqlCode':_0x34d5d2[_0x5f1cf1(0x223)],'filePath':_0x359ec0});}catch(_0x9eb56f){_0x16ba46['push']({'sqlCode':_0x34d5d2['sqlCode'],'error':_0x9eb56f instanceof Error?_0x9eb56f[_0x5f1cf1(0x20c)]:String(_0x9eb56f)});}}return _0x27ad73[_0x5f1cf1(0x1fe)]=new Date()[_0x5f1cf1(0x209)](),await writeSqlLockFile(_0x35f3d5['lockFilePath'],_0x33f5e0),{'ok':_0x16ba46[_0x5f1cf1(0x22d)]===0x0,'data':{'pulled':_0x519a6a,'skipped':_0xe8eaf9,'failed':_0x16ba46},'message':_0x5f1cf1(0x1f2)+_0x519a6a['length']+_0x5f1cf1(0x20e)+_0xe8eaf9[_0x5f1cf1(0x22d)]+'\x20skipped,\x20'+_0x16ba46['length']+_0x5f1cf1(0x22c)};}};function detectModeFromSql(_0x1758f7){const _0xb87dc6=a128_0x5d1edb,_0x54ea88=ensureRemoteSqlContent(_0x1758f7),_0x562f92=stripLocalSqlMetadata(_0x54ea88,_0xb87dc6(0x21c))[_0xb87dc6(0x21d)]();if(/^<(select|insert|update|delete)\b/i[_0xb87dc6(0x21a)](_0x562f92))return _0xb87dc6(0x21c);return'sql';}function isEquivalentPulledSqlFile(_0x27099f,_0x3530f6,_0x23f242){return normalizePullComparableContent(_0x27099f,_0x23f242)===normalizePullComparableContent(_0x3530f6,_0x23f242);}function normalizePullComparableContent(_0x56f27d,_0x30bdad){const _0x23bdab=a128_0x5d1edb,_0x552274=_0x56f27d['replace'](/\r\n/g,'\x0a')[_0x23bdab(0x212)]('\x0a'),_0x38c4df=_0x552274[_0x23bdab(0x21f)](_0x2b3f45=>!isSyncedAtMetadataLine(_0x2b3f45,_0x30bdad));return _0x38c4df[_0x23bdab(0x1ef)]('\x0a');}function isSyncedAtMetadataLine(_0x115ae1,_0x12cd26){const _0x3fbf0d=a128_0x5d1edb;if(_0x12cd26===_0x3fbf0d(0x21c))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x3fbf0d(0x21a)](_0x115ae1);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x115ae1);}
1
+ const a128_0xdc55a8=a128_0x3c50;(function(_0x49cc98,_0x51cb0d){const _0x547994=a128_0x3c50,_0x91244e=_0x49cc98();while(!![]){try{const _0x260741=-parseInt(_0x547994(0x209))/0x1*(parseInt(_0x547994(0x20d))/0x2)+-parseInt(_0x547994(0x224))/0x3*(-parseInt(_0x547994(0x226))/0x4)+parseInt(_0x547994(0x1fc))/0x5*(parseInt(_0x547994(0x201))/0x6)+parseInt(_0x547994(0x230))/0x7*(-parseInt(_0x547994(0x216))/0x8)+-parseInt(_0x547994(0x208))/0x9+parseInt(_0x547994(0x22e))/0xa*(parseInt(_0x547994(0x200))/0xb)+parseInt(_0x547994(0x225))/0xc;if(_0x260741===_0x51cb0d)break;else _0x91244e['push'](_0x91244e['shift']());}catch(_0x5d2d8c){_0x91244e['push'](_0x91244e['shift']());}}}(a128_0x536a,0xa3b43));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a128_0x3c50(_0x51f5a9,_0x34af0e){_0x51f5a9=_0x51f5a9-0x1f2;const _0x536ae2=a128_0x536a();let _0x3c5016=_0x536ae2[_0x51f5a9];return _0x3c5016;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a128_0x536a(){const _0x47b2b7=['Pull\x20complete:\x20','sqlContent','\x20SQL\x20file(s)\x20into\x20','apps','lockFilePath','boolean','Force\x20overwrite\x20local\x20unsynced\x20changes','local\x20differs\x20from\x20remote','sqls','Would\x20pull\x20','sqlcode','2115ooDpSN','28461852qMDXNs','2316NCEoZI','str','\x20failed','catch','filter','conflict','sql','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','10byNNkC','unchanged','478457qIacFa','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','write','would_pull','paging','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','cancelled','\x20skipped,\x20','force','tableData','replace','dbId','35AMMsAX','pull','toISOString','\x20written,\x20','2978679VgKTeX','103494ovIWKN','test','sqlCode','length','name','push','trimStart','846567MTzLef','1WDAEUP','description','utf8','path','2216570NtebZV','message','appCode','sqlName','POST','string','No\x20remote\x20SQL\x20queries\x20matched.','nonInteractive','mybatisXml','152oxEitD','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sqlRootDir'];a128_0x536a=function(){return _0x47b2b7;};return a128_0x536a();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x3b2c79,_0x36a631){const _0x4e0ee8=a128_0x3c50,_0x1f4b04=[];let _0x58ba42=0x1;while(!![]){const _0x31c398=await listSqlQueries(_0x3b2c79,{'currentPage':_0x58ba42,'pageSize':PAGE_SIZE,'sqlCode':_0x36a631['sqlCode'],'sqlName':_0x36a631['sqlName']}),_0x19b1b3=_0x31c398[_0x4e0ee8(0x1f9)]??[];_0x1f4b04['push'](..._0x19b1b3);if(_0x19b1b3[_0x4e0ee8(0x204)]===0x0)break;const _0x54ed4a=_0x31c398[_0x4e0ee8(0x1f4)]?.['totalCount'];if(_0x54ed4a!=null?_0x1f4b04[_0x4e0ee8(0x204)]>=_0x54ed4a:_0x19b1b3[_0x4e0ee8(0x204)]<PAGE_SIZE)break;_0x58ba42++;}return _0x1f4b04;}async function ensureSqlContent(_0x20fc0f){const _0x179954=a128_0x3c50;if(_0x20fc0f['sqlContent']!=null&&String(_0x20fc0f[_0x179954(0x21a)])['length']>0x0)return _0x20fc0f;return getSqlQueryDetail(_0x20fc0f[_0x179954(0x203)]);}export const sqlPull={'service':a128_0xdc55a8(0x22c),'command':a128_0xdc55a8(0x1fd),'description':a128_0xdc55a8(0x231),'risk':a128_0xdc55a8(0x1f2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0xdc55a8(0x205),'type':a128_0xdc55a8(0x212),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0xdc55a8(0x1f8),'type':a128_0xdc55a8(0x21e),'description':a128_0xdc55a8(0x21f)}],async 'dryRun'(_0x2a2b6b){const _0x282b4c=a128_0xdc55a8,_0x4a89c1=loadSqlProjectConfig(_0x2a2b6b[_0x282b4c(0x20f)]),_0x153dc4=await readSqlLockFile(_0x4a89c1[_0x282b4c(0x21d)]),{appLock:_0x3f6866}=ensureSqlLockScope(_0x153dc4??createEmptySqlLock(),_0x4a89c1[_0x282b4c(0x20f)],_0x4a89c1['sqlRoot'],_0x282b4c(0x1fd)),_0x2ff4e9=await fetchAllSqlQueries(_0x2a2b6b['appCode'],{'sqlCode':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x223))||undefined,'sqlName':_0x2a2b6b[_0x282b4c(0x227)]('name')||undefined}),_0x14ced9=[];for(const _0x1b3018 of _0x2ff4e9){const _0x16e209=await ensureSqlContent(_0x1b3018),_0x515223=ensureRemoteSqlContent(_0x16e209),_0x4165a7=detectModeFromSql(_0x16e209),_0x598c02=_0x16e209['dbId']?await getDbName(_0x2a2b6b[_0x282b4c(0x20f)],Number(_0x16e209[_0x282b4c(0x1fb)]))[_0x282b4c(0x229)](()=>undefined):undefined,_0x3900f1=buildLocalSqlFileContent({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209[_0x282b4c(0x210)],'dbId':_0x16e209[_0x282b4c(0x1fb)]},_0x515223,{'dbName':_0x598c02,'mode':_0x4165a7,'syncedAt':new Date()[_0x282b4c(0x1fe)](),'description':_0x16e209[_0x282b4c(0x20a)]}),_0x4322f1=buildSqlLockEntry(_0x16e209,_0x515223,'',{'dbName':_0x598c02}),_0x51cda8=resolveLocalSqlFilePath(_0x4a89c1,_0x16e209[_0x282b4c(0x203)],_0x4322f1);let _0x42fea1=_0x282b4c(0x1f3),_0x38e1dc;if(await fileExists(_0x51cda8)){const _0xf3ecac=await readFile(_0x51cda8,'utf8');isEquivalentPulledSqlFile(_0xf3ecac,_0x3900f1,_0x4165a7)?(_0x42fea1='skipped',_0x38e1dc=_0x282b4c(0x22f)):(_0x42fea1=_0x282b4c(0x22b),_0x38e1dc=_0x282b4c(0x1f5));}_0x14ced9[_0x282b4c(0x206)]({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209['sqlName'],'filePath':_0x51cda8,'status':_0x42fea1,'reason':_0x38e1dc});}return{'method':_0x282b4c(0x211),'url':_0x282b4c(0x22d),'body':{'appCode':_0x2a2b6b[_0x282b4c(0x20f)],'sqlCode':_0x2a2b6b[_0x282b4c(0x227)]('sqlcode')||null,'sqlName':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x205))||null,'files':_0x14ced9},'description':_0x282b4c(0x222)+_0x14ced9['length']+_0x282b4c(0x21b)+_0x4a89c1[_0x282b4c(0x218)]};},async 'execute'(_0x2b7c0a){const _0x244437=a128_0xdc55a8,_0x4ece51=loadSqlProjectConfig(_0x2b7c0a[_0x244437(0x20f)]),_0x47a307=await readSqlLockFile(_0x4ece51['lockFilePath']),{lockData:_0x158a5c,appLock:_0x48499b}=ensureSqlLockScope(_0x47a307??createEmptySqlLock(),_0x4ece51['appCode'],_0x4ece51['sqlRoot'],'pull'),_0xd4fe46=_0x2b7c0a['bool'](_0x244437(0x1f8)),_0x19d12a=await fetchAllSqlQueries(_0x2b7c0a[_0x244437(0x20f)],{'sqlCode':_0x2b7c0a['str'](_0x244437(0x223))||undefined,'sqlName':_0x2b7c0a[_0x244437(0x227)]('name')||undefined});if(_0x19d12a[_0x244437(0x204)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x244437(0x213)};const _0x2b4394=[],_0x39de19=[];for(const _0x42568d of _0x19d12a){try{_0x2b4394[_0x244437(0x206)](await ensureSqlContent(_0x42568d));}catch(_0x51c598){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x42568d['sqlCode'],'error':_0x51c598 instanceof Error?_0x51c598[_0x244437(0x20e)]:String(_0x51c598)});}}if(_0xd4fe46&&!_0x2b7c0a[_0x244437(0x214)]){let _0xadcdb=![];for(const _0x156ef7 of _0x2b4394){const _0x17fb84=detectModeFromSql(_0x156ef7),_0x32a80f=_0x156ef7[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a[_0x244437(0x20f)],Number(_0x156ef7[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x8396bb=buildLocalSqlFileContent({'sqlCode':_0x156ef7[_0x244437(0x203)],'sqlName':_0x156ef7[_0x244437(0x210)],'dbId':_0x156ef7['dbId']},ensureRemoteSqlContent(_0x156ef7),{'dbName':_0x32a80f,'mode':_0x17fb84,'syncedAt':new Date()['toISOString'](),'description':_0x156ef7['description']}),_0x4583f5=resolveLocalSqlFilePath(_0x4ece51,_0x156ef7[_0x244437(0x203)],buildSqlLockEntry(_0x156ef7,ensureRemoteSqlContent(_0x156ef7),'',{'dbName':_0x32a80f}));if(await fileExists(_0x4583f5)){const _0xf5fea9=await readFile(_0x4583f5,'utf8');if(!isEquivalentPulledSqlFile(_0xf5fea9,_0x8396bb,_0x17fb84)){_0xadcdb=!![];break;}}}if(_0xadcdb){const _0x1daa94=await confirmForceOverwrite(_0x244437(0x217));if(!_0x1daa94)throw CliErrors[_0x244437(0x1f6)]('Force\x20pull\x20cancelled.');}}const _0x315bf7=cloneSqlLockData(_0x158a5c),_0x1439c1=_0x315bf7[_0x244437(0x21c)][_0x4ece51['appCode']],_0x433d11=[],_0x322fd1=[];for(const _0x2f18fb of _0x2b4394){const _0x43e897=_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]],_0x6eb510=ensureRemoteSqlContent(_0x2f18fb),_0x14ac49=detectModeFromSql(_0x2f18fb),_0x377eee=_0x2f18fb[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a['appCode'],Number(_0x2f18fb[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x58f44e=buildLocalSqlFileContent({'sqlCode':_0x2f18fb['sqlCode'],'sqlName':_0x2f18fb[_0x244437(0x210)],'dbId':_0x2f18fb[_0x244437(0x1fb)]},_0x6eb510,{'dbName':_0x377eee,'mode':_0x14ac49,'syncedAt':new Date()['toISOString'](),'description':_0x2f18fb[_0x244437(0x20a)]}),_0x124126=buildSqlLockEntry(_0x2f18fb,_0x6eb510,computeSqlContentHash(_0x58f44e),{'dbName':_0x377eee}),_0x30036b=_0x124126[_0x244437(0x20c)],_0x334bde=join(_0x4ece51[_0x244437(0x218)],_0x30036b);try{if(await fileExists(_0x334bde)){const _0x1af5d7=await readFile(_0x334bde,_0x244437(0x20b));if(isEquivalentPulledSqlFile(_0x1af5d7,_0x58f44e,_0x14ac49)){_0x322fd1[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x22f)}),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'hash':computeSqlContentHash(_0x1af5d7),'path':_0x30036b};continue;}if(!_0xd4fe46){_0x322fd1['push']({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x220)});continue;}}const _0x3ae186=_0x43e897?.[_0x244437(0x20c)]?join(_0x4ece51[_0x244437(0x218)],_0x43e897[_0x244437(0x20c)]):undefined;_0x3ae186&&_0x3ae186!==_0x334bde&&await fileExists(_0x3ae186)&&await rm(_0x3ae186,{'force':!![]}),await ensureParentDirectory(_0x334bde),await writeFile(_0x334bde,_0x58f44e,_0x244437(0x20b)),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'path':_0x30036b},_0x433d11[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'filePath':_0x334bde});}catch(_0x4713eb){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'error':_0x4713eb instanceof Error?_0x4713eb[_0x244437(0x20e)]:String(_0x4713eb)});}}return _0x1439c1['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x4ece51[_0x244437(0x21d)],_0x315bf7),{'ok':_0x39de19[_0x244437(0x204)]===0x0,'data':{'pulled':_0x433d11,'skipped':_0x322fd1,'failed':_0x39de19},'message':_0x244437(0x219)+_0x433d11[_0x244437(0x204)]+_0x244437(0x1ff)+_0x322fd1['length']+_0x244437(0x1f7)+_0x39de19[_0x244437(0x204)]+_0x244437(0x228)};}};function detectModeFromSql(_0x2b389a){const _0x25db43=a128_0xdc55a8,_0x483801=ensureRemoteSqlContent(_0x2b389a),_0x3a507b=stripLocalSqlMetadata(_0x483801,_0x25db43(0x215))[_0x25db43(0x207)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x3a507b))return _0x25db43(0x215);return _0x25db43(0x22c);}function isEquivalentPulledSqlFile(_0x3746b2,_0x26ebf6,_0x13b9c1){return normalizePullComparableContent(_0x3746b2,_0x13b9c1)===normalizePullComparableContent(_0x26ebf6,_0x13b9c1);}function normalizePullComparableContent(_0x39219d,_0x2841a3){const _0x4d1641=a128_0xdc55a8,_0x2d2c7f=_0x39219d[_0x4d1641(0x1fa)](/\r\n/g,'\x0a')['split']('\x0a'),_0x410008=_0x2d2c7f[_0x4d1641(0x22a)](_0x3be8bb=>!isSyncedAtMetadataLine(_0x3be8bb,_0x2841a3));return _0x410008['join']('\x0a');}function isSyncedAtMetadataLine(_0x4e6a94,_0xafcf69){const _0x314aee=a128_0xdc55a8;if(_0xafcf69===_0x314aee(0x215))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);}
@@ -1 +1 @@
1
- const a129_0xb7ea13=a129_0x197a;(function(_0x22a4a8,_0x116482){const _0x33287b=a129_0x197a,_0x1238bc=_0x22a4a8();while(!![]){try{const _0x5360a4=parseInt(_0x33287b(0x1e7))/0x1*(-parseInt(_0x33287b(0x1df))/0x2)+parseInt(_0x33287b(0x1be))/0x3*(-parseInt(_0x33287b(0x1c6))/0x4)+parseInt(_0x33287b(0x1c1))/0x5+parseInt(_0x33287b(0x1e2))/0x6*(-parseInt(_0x33287b(0x1e5))/0x7)+parseInt(_0x33287b(0x1c3))/0x8+-parseInt(_0x33287b(0x1b6))/0x9+parseInt(_0x33287b(0x1ba))/0xa*(parseInt(_0x33287b(0x1d0))/0xb);if(_0x5360a4===_0x116482)break;else _0x1238bc['push'](_0x1238bc['shift']());}catch(_0x2e7a8b){_0x1238bc['push'](_0x1238bc['shift']());}}}(a129_0x1e99,0x236ff));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a129_0x197a(_0x52e2d3,_0xf3408){_0x52e2d3=_0x52e2d3-0x1b1;const _0x1e9921=a129_0x1e99();let _0x197a31=_0x1e9921[_0x52e2d3];return _0x197a31;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x3144e4,_0x1d2474,_0x14d3d5){const _0x411697=a129_0x197a,_0x501d20=await scanLocalSqlQueries(_0x3144e4),_0x3028ef=new Map();for(const _0x4a1da7 of _0x501d20){if(_0x14d3d5&&_0x4a1da7[_0x411697(0x1cb)]!==_0x14d3d5)continue;const _0x47f040=_0x3028ef['get'](_0x4a1da7[_0x411697(0x1cb)])??[];_0x47f040[_0x411697(0x1ed)](_0x4a1da7),_0x3028ef[_0x411697(0x1c2)](_0x4a1da7[_0x411697(0x1cb)],_0x47f040);}if(_0x14d3d5&&!_0x3028ef[_0x411697(0x1b3)](_0x14d3d5))throw CliErrors[_0x411697(0x1f5)](_0x411697(0x1ef)+_0x14d3d5);const _0x49b72d=[];for(const [_0x280f79,_0x2ecb23]of _0x3028ef[_0x411697(0x1f2)]()){if(_0x2ecb23[_0x411697(0x1dd)]===0x1){_0x49b72d[_0x411697(0x1ed)](_0x2ecb23[0x0]);continue;}const _0x52e74a=_0x1d2474['sqls'][_0x280f79],_0x37eedb=_0x52e74a?.[_0x411697(0x1d6)],_0x34c195=_0x37eedb?_0x2ecb23[_0x411697(0x1b8)](_0x51f9f8=>_0x51f9f8[_0x411697(0x1b2)]!==_0x37eedb):_0x2ecb23;if(_0x52e74a&&_0x34c195[_0x411697(0x1dd)]===0x1){_0x49b72d[_0x411697(0x1ed)](_0x34c195[0x0]);continue;}throw CliErrors[_0x411697(0x1f5)](_0x411697(0x1f0)+_0x280f79+_0x411697(0x1bd));}return _0x49b72d;}export const sqlPush={'service':a129_0xb7ea13(0x1d8),'command':'push','description':a129_0xb7ea13(0x1da),'risk':a129_0xb7ea13(0x1ee),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0xb7ea13(0x1ca),'type':a129_0xb7ea13(0x1cc),'description':a129_0xb7ea13(0x1bf)}],async 'dryRun'(_0x51e520){const _0x1d8ab0=a129_0xb7ea13,_0x3b2140=loadSqlProjectConfig(_0x51e520['appCode']),_0xfb17a0=await readSqlLockFile(_0x3b2140[_0x1d8ab0(0x1f6)]),{appLock:_0x31c7b9}=ensureSqlLockScope(_0xfb17a0??createEmptySqlLock(),_0x51e520['appCode'],_0x3b2140['sqlRoot'],'push'),_0x187b73=await getTargetSqlQueries(_0x3b2140,_0x31c7b9,_0x51e520[_0x1d8ab0(0x1b7)](_0x1d8ab0(0x1e0))||undefined),_0x577405=[];for(const _0x1d1d01 of _0x187b73){const _0x403265=await computeSqlFileHash(_0x1d1d01[_0x1d8ab0(0x1cf)]),_0x5134d5=_0x31c7b9[_0x1d8ab0(0x1c9)][_0x1d1d01[_0x1d8ab0(0x1cb)]],_0x587395=!!_0x5134d5&&(_0x5134d5[_0x1d8ab0(0x1d6)]!==_0x1d1d01['relativePath']||!!_0x1d1d01['sqlName']&&_0x5134d5[_0x1d8ab0(0x1c7)]!==_0x1d1d01['sqlName']);if(!_0x51e520[_0x1d8ab0(0x1c4)]('force')&&_0x5134d5&&_0x5134d5[_0x1d8ab0(0x1d9)]===_0x403265&&!_0x587395)continue;_0x577405[_0x1d8ab0(0x1ed)](_0x1d1d01[_0x1d8ab0(0x1cb)]);}return{'method':_0x1d8ab0(0x1e6),'url':_0x1d8ab0(0x1bc),'body':{'sqlCodes':_0x577405,'appCode':_0x51e520[_0x1d8ab0(0x1e4)]},'description':_0x1d8ab0(0x1d7)+_0x577405['length']+_0x1d8ab0(0x1db)};},async 'execute'(_0x38da69){const _0x293bbc=a129_0xb7ea13,_0x51e330=loadSqlProjectConfig(_0x38da69[_0x293bbc(0x1e4)]),_0x3743a0=await readSqlLockFile(_0x51e330['lockFilePath']),{lockData:_0x3ecbc2,appLock:_0x45dba1}=ensureSqlLockScope(_0x3743a0??createEmptySqlLock(),_0x38da69[_0x293bbc(0x1e4)],_0x51e330[_0x293bbc(0x1d4)],_0x293bbc(0x1ed)),_0x1f7581=await getTargetSqlQueries(_0x51e330,_0x45dba1,_0x38da69[_0x293bbc(0x1b7)](_0x293bbc(0x1e0))||undefined);if(_0x1f7581[_0x293bbc(0x1dd)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x293bbc(0x1c5)};const _0x5d1230=[],_0x5d836c=[],_0x3d9492=[];for(const _0x2b4536 of _0x1f7581){const _0x3ee408=_0x45dba1[_0x293bbc(0x1c9)][_0x2b4536[_0x293bbc(0x1cb)]];if(!_0x3ee408){_0x3d9492['push']({'sqlCode':_0x2b4536['sqlCode'],'error':_0x293bbc(0x1d1)});continue;}try{const _0x42fff7=await computeSqlFileHash(_0x2b4536[_0x293bbc(0x1cf)]),_0xfcf610=_0x3ee408[_0x293bbc(0x1d6)]!==_0x2b4536[_0x293bbc(0x1b2)]||!!_0x2b4536[_0x293bbc(0x1c7)]&&_0x3ee408[_0x293bbc(0x1c7)]!==_0x2b4536[_0x293bbc(0x1c7)];if(!_0x38da69[_0x293bbc(0x1c4)](_0x293bbc(0x1ca))&&_0x3ee408['hash']===_0x42fff7&&!_0xfcf610){_0x5d836c['push']({'sqlCode':_0x2b4536[_0x293bbc(0x1cb)],'reason':'unchanged'});continue;}if(_0x3ee408[_0x293bbc(0x1d2)]==null){_0x3d9492[_0x293bbc(0x1ed)]({'sqlCode':_0x2b4536[_0x293bbc(0x1cb)],'error':_0x293bbc(0x1ec)});continue;}const _0x1fa04a=await readFile(_0x2b4536[_0x293bbc(0x1cf)],_0x293bbc(0x1d3)),_0x3c60bb=stripLocalSqlMetadata(_0x1fa04a,_0x2b4536[_0x293bbc(0x1ea)]),_0x676e72=_0x2b4536[_0x293bbc(0x1c7)]||_0x3ee408[_0x293bbc(0x1c7)],_0x52597c=await resolveTargetDbBinding(_0x38da69['appCode'],_0x2b4536,_0x3ee408),_0x1af240=await updateSqlQuery({'id':_0x3ee408[_0x293bbc(0x1de)],'appCode':_0x38da69[_0x293bbc(0x1e4)],'sqlCode':_0x2b4536['sqlCode'],'sqlName':_0x676e72,'dbId':_0x52597c[_0x293bbc(0x1c0)],'version':_0x3ee408[_0x293bbc(0x1d2)],'sqlContent':_0x3c60bb,'sqlConfig':_0x3ee408[_0x293bbc(0x1e9)]??undefined}),_0x115c0e=_0x1af240[_0x293bbc(0x1c0)]?await getDbName(_0x38da69[_0x293bbc(0x1e4)],Number(_0x1af240[_0x293bbc(0x1c0)]))[_0x293bbc(0x1f1)](()=>_0x52597c['dbName']):_0x52597c[_0x293bbc(0x1b1)];_0x45dba1[_0x293bbc(0x1c9)][_0x2b4536[_0x293bbc(0x1cb)]]={...buildSqlLockEntry(_0x1af240,_0x3c60bb,_0x42fff7,{'dbName':_0x115c0e}),'path':_0x2b4536['relativePath'],'mode':_0x3ee408['mode']},await archivePreviousSqlFileIfNeeded(_0x51e330,_0x3ee408['path'],_0x2b4536[_0x293bbc(0x1b2)]),_0x5d1230['push']({'sqlCode':_0x2b4536['sqlCode'],'remoteId':_0x3ee408[_0x293bbc(0x1de)]});}catch(_0x2dd7ae){_0x3d9492['push']({'sqlCode':_0x2b4536[_0x293bbc(0x1cb)],'error':_0x2dd7ae instanceof Error?_0x2dd7ae['message']:String(_0x2dd7ae)});}}return _0x45dba1['lastSync']=new Date()[_0x293bbc(0x1b5)](),await writeSqlLockFile(_0x51e330[_0x293bbc(0x1f6)],_0x3ecbc2),{'ok':_0x3d9492['length']===0x0,'data':{'pushed':_0x5d1230,'skipped':_0x5d836c,'failed':_0x3d9492},'message':_0x293bbc(0x1cd)+_0x5d1230[_0x293bbc(0x1dd)]+_0x293bbc(0x1b9)+_0x5d836c['length']+_0x293bbc(0x1bb)+_0x3d9492[_0x293bbc(0x1dd)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x4fae7f,_0x5e4c80,_0x4c3b95){const _0x160cd5=a129_0xb7ea13;if(!_0x5e4c80||_0x5e4c80===_0x4c3b95)return;const _0x1965c1=join(_0x4fae7f['sqlRootDir'],_0x5e4c80);if(!await fileExists(_0x1965c1))return;const _0x2ed16b=await moveToTrash(_0x4fae7f[_0x160cd5(0x1b4)],_0x4fae7f[_0x160cd5(0x1dc)],_0x1965c1);await cleanupEmptyDirectories(dirname(_0x1965c1),_0x4fae7f[_0x160cd5(0x1c8)]),void _0x2ed16b;}function a129_0x1e99(){const _0x45b828=['set','577680rtuorp','bool','No\x20local\x20SQL\x20files\x20found.','38188PYAivh','sqlName','sqlRootDir','sqls','force','sqlCode','boolean','Push\x20complete:\x20','Local\x20directory\x20\x22','filePath','6813829hWlBjN','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','version','utf8','sqlRoot','join','path','Would\x20push\x20','sql','hash','Push\x20local\x20SQL\x20files\x20to\x20remote','\x20SQL\x20file(s)','trashDir','length','remoteId','502952WeFVGn','sqlcode','isFinite','12waNgDx','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','appCode','186578FutAIZ','POST','1MTfrHe','startsWith','sqlConfig','mode','\x22\x20for\x20sqlCode\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','push','high-risk-write','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','catch','entries','map','replace','validation','lockFilePath','dbName','relativePath','has','projectRoot','toISOString','1592091oljLpn','str','filter','\x20pushed,\x20','10Kvezdr','\x20skipped,\x20','/smartapi/custom/updateUserCustomSql','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','48yrmHuH','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbId','439685ODbdtA'];a129_0x1e99=function(){return _0x45b828;};return a129_0x1e99();}async function moveToTrash(_0xfaeeb3,_0x4b4a36,_0x370c31){const _0x2acfa2=a129_0xb7ea13,_0x5a5c62=new Date()[_0x2acfa2(0x1b5)]()[_0x2acfa2(0x1f4)](/[:.]/g,'-'),_0x8c9dde=relative(_0xfaeeb3,_0x370c31),_0x58e2e9=join(_0x4b4a36,_0x5a5c62,_0x8c9dde);return await mkdir(dirname(_0x58e2e9),{'recursive':!![]}),await rename(_0x370c31,_0x58e2e9),_0x58e2e9;}async function cleanupEmptyDirectories(_0x2f16fe,_0x10d08c){const _0x565e60=a129_0xb7ea13;let _0x13b3e7=resolve(_0x2f16fe);const _0x2bafd4=resolve(_0x10d08c);while(_0x13b3e7[_0x565e60(0x1e8)](''+_0x2bafd4+sep)||_0x13b3e7===_0x2bafd4){if(_0x13b3e7===_0x2bafd4)return;try{const _0x2c1baf=await readdir(_0x13b3e7);if(_0x2c1baf[_0x565e60(0x1dd)]>0x0)return;await rmdir(_0x13b3e7);}catch{return;}_0x13b3e7=dirname(_0x13b3e7);}}async function resolveTargetDbBinding(_0x2ad0ed,_0x277c7f,_0x181145){const _0xd844a7=a129_0xb7ea13,_0x2ef1db=_0x277c7f['dbDirectory'];if(!_0x2ef1db)return{'dbId':_0x181145[_0xd844a7(0x1c0)],'dbName':_0x181145[_0xd844a7(0x1b1)]};const _0xf8c380=buildDbDirectoryName(_0x181145[_0xd844a7(0x1b1)],_0x181145['dbId']);if(_0x2ef1db===_0xf8c380)return{'dbId':_0x181145[_0xd844a7(0x1c0)],'dbName':_0x181145['dbName']};const _0x1471ea=parseExplicitDbDirectory(_0x2ef1db);if(_0x1471ea!=null)return{'dbId':_0x1471ea,'dbName':await getDbName(_0x2ad0ed,_0x1471ea)['catch'](()=>undefined)};const _0x2fb4dd=await listDatabases(_0x2ad0ed),_0x52821a=_0x2fb4dd[_0xd844a7(0x1b8)](_0x137ad5=>buildDbDirectoryName(_0x137ad5['dbName'],_0x137ad5[_0xd844a7(0x1c0)])===_0x2ef1db);if(_0x52821a[_0xd844a7(0x1dd)]===0x1)return{'dbId':_0x52821a[0x0]['dbId'],'dbName':_0x52821a[0x0][_0xd844a7(0x1b1)]};if(_0x52821a[_0xd844a7(0x1dd)]===0x0)throw CliErrors[_0xd844a7(0x1f5)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x2ef1db+_0xd844a7(0x1eb)+_0x277c7f[_0xd844a7(0x1cb)]+'.');const _0x5cd09b=_0x52821a[_0xd844a7(0x1f3)](_0x47dd72=>_0x47dd72['dbName']+'\x20('+_0x47dd72['dbId']+')')[_0xd844a7(0x1d5)](',\x20');throw CliErrors[_0xd844a7(0x1f5)](_0xd844a7(0x1ce)+_0x2ef1db+_0xd844a7(0x1e3)+_0x277c7f['sqlCode']+':\x20'+_0x5cd09b);}function parseExplicitDbDirectory(_0x1ee2e8){const _0x165c2a=a129_0xb7ea13,_0x11c661=/^db-(\d+)$/['exec'](_0x1ee2e8);if(!_0x11c661)return null;const _0x1e0aa5=Number(_0x11c661[0x1]);return Number[_0x165c2a(0x1e1)](_0x1e0aa5)&&_0x1e0aa5>0x0?_0x1e0aa5:null;}
1
+ const a129_0x4a4dc8=a129_0x57c1;(function(_0x362b97,_0x46f2ea){const _0x53cfdd=a129_0x57c1,_0x10d611=_0x362b97();while(!![]){try{const _0xab6f01=parseInt(_0x53cfdd(0x11f))/0x1*(parseInt(_0x53cfdd(0x105))/0x2)+parseInt(_0x53cfdd(0x113))/0x3+parseInt(_0x53cfdd(0x131))/0x4*(-parseInt(_0x53cfdd(0x141))/0x5)+parseInt(_0x53cfdd(0x10a))/0x6*(parseInt(_0x53cfdd(0x134))/0x7)+-parseInt(_0x53cfdd(0x140))/0x8*(parseInt(_0x53cfdd(0x130))/0x9)+parseInt(_0x53cfdd(0x11d))/0xa+-parseInt(_0x53cfdd(0x11e))/0xb*(parseInt(_0x53cfdd(0x10d))/0xc);if(_0xab6f01===_0x46f2ea)break;else _0x10d611['push'](_0x10d611['shift']());}catch(_0x53a072){_0x10d611['push'](_0x10d611['shift']());}}}(a129_0x3279,0x2db63));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4bd7e6,_0xee16b,_0x1b7494){const _0x21f780=a129_0x57c1,_0x296b38=await scanLocalSqlQueries(_0x4bd7e6),_0x3ff6b8=new Map();for(const _0x3eeb95 of _0x296b38){if(_0x1b7494&&_0x3eeb95[_0x21f780(0x115)]!==_0x1b7494)continue;const _0x576c94=_0x3ff6b8[_0x21f780(0x11a)](_0x3eeb95[_0x21f780(0x115)])??[];_0x576c94[_0x21f780(0x11b)](_0x3eeb95),_0x3ff6b8['set'](_0x3eeb95['sqlCode'],_0x576c94);}if(_0x1b7494&&!_0x3ff6b8[_0x21f780(0x13f)](_0x1b7494))throw CliErrors[_0x21f780(0x129)](_0x21f780(0x142)+_0x1b7494);const _0x2a604a=[];for(const [_0x5ab814,_0x4fa619]of _0x3ff6b8[_0x21f780(0x128)]()){if(_0x4fa619[_0x21f780(0x117)]===0x1){_0x2a604a['push'](_0x4fa619[0x0]);continue;}const _0x2b41b3=_0xee16b[_0x21f780(0x12f)][_0x5ab814],_0x9265bd=_0x2b41b3?.[_0x21f780(0x107)],_0x5f1e58=_0x9265bd?_0x4fa619['filter'](_0x572870=>_0x572870[_0x21f780(0x106)]!==_0x9265bd):_0x4fa619;if(_0x2b41b3&&_0x5f1e58[_0x21f780(0x117)]===0x1){_0x2a604a[_0x21f780(0x11b)](_0x5f1e58[0x0]);continue;}throw CliErrors[_0x21f780(0x129)](_0x21f780(0x10b)+_0x5ab814+_0x21f780(0x138));}return _0x2a604a;}function a129_0x57c1(_0x1e0b5a,_0x42b369){_0x1e0b5a=_0x1e0b5a-0x103;const _0x3279c9=a129_0x3279();let _0x57c1cb=_0x3279c9[_0x1e0b5a];return _0x57c1cb;}export const sqlPush={'service':a129_0x4a4dc8(0x10e),'command':a129_0x4a4dc8(0x11b),'description':a129_0x4a4dc8(0x135),'risk':a129_0x4a4dc8(0x13c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x4a4dc8(0x12a),'type':a129_0x4a4dc8(0x112),'description':a129_0x4a4dc8(0x12e)}],async 'dryRun'(_0x1e87dd){const _0x12aa54=a129_0x4a4dc8,_0x72082e=loadSqlProjectConfig(_0x1e87dd[_0x12aa54(0x124)]),_0x329ab8=await readSqlLockFile(_0x72082e[_0x12aa54(0x126)]),{appLock:_0x1f27ad}=ensureSqlLockScope(_0x329ab8??createEmptySqlLock(),_0x1e87dd['appCode'],_0x72082e['sqlRoot'],_0x12aa54(0x11b)),_0x505428=await getTargetSqlQueries(_0x72082e,_0x1f27ad,_0x1e87dd[_0x12aa54(0x125)]('sqlcode')||undefined),_0x31c9f9=[];for(const _0x3115e5 of _0x505428){const _0x1d219c=await computeSqlFileHash(_0x3115e5[_0x12aa54(0x119)]),_0x2422a0=_0x1f27ad[_0x12aa54(0x12f)][_0x3115e5[_0x12aa54(0x115)]],_0x398373=!!_0x2422a0&&(_0x2422a0[_0x12aa54(0x107)]!==_0x3115e5[_0x12aa54(0x106)]||!!_0x3115e5['sqlName']&&_0x2422a0[_0x12aa54(0x109)]!==_0x3115e5[_0x12aa54(0x109)]);if(!_0x1e87dd[_0x12aa54(0x110)](_0x12aa54(0x12a))&&_0x2422a0&&_0x2422a0[_0x12aa54(0x123)]===_0x1d219c&&!_0x398373)continue;_0x31c9f9[_0x12aa54(0x11b)](_0x3115e5[_0x12aa54(0x115)]);}return{'method':_0x12aa54(0x104),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x31c9f9,'appCode':_0x1e87dd[_0x12aa54(0x124)]},'description':_0x12aa54(0x13d)+_0x31c9f9[_0x12aa54(0x117)]+_0x12aa54(0x144)};},async 'execute'(_0x209359){const _0x4933da=a129_0x4a4dc8,_0x4cd1a0=loadSqlProjectConfig(_0x209359[_0x4933da(0x124)]),_0x3a5f83=await readSqlLockFile(_0x4cd1a0[_0x4933da(0x126)]),{lockData:_0x44349b,appLock:_0x5f41d4}=ensureSqlLockScope(_0x3a5f83??createEmptySqlLock(),_0x209359['appCode'],_0x4cd1a0['sqlRoot'],_0x4933da(0x11b)),_0x3ba563=await getTargetSqlQueries(_0x4cd1a0,_0x5f41d4,_0x209359[_0x4933da(0x125)](_0x4933da(0x13e))||undefined);if(_0x3ba563[_0x4933da(0x117)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x3d56ac=[],_0x51d611=[],_0x71952f=[];for(const _0x20cdf0 of _0x3ba563){const _0x177c93=_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0['sqlCode']];if(!_0x177c93){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1a1c8e=await computeSqlFileHash(_0x20cdf0[_0x4933da(0x119)]),_0x47c081=_0x177c93[_0x4933da(0x107)]!==_0x20cdf0['relativePath']||!!_0x20cdf0['sqlName']&&_0x177c93[_0x4933da(0x109)]!==_0x20cdf0[_0x4933da(0x109)];if(!_0x209359[_0x4933da(0x110)]('force')&&_0x177c93[_0x4933da(0x123)]===_0x1a1c8e&&!_0x47c081){_0x51d611['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'reason':_0x4933da(0x122)});continue;}if(_0x177c93[_0x4933da(0x111)]==null){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x4933da(0x137)});continue;}const _0x3cd5d3=await readFile(_0x20cdf0[_0x4933da(0x119)],'utf8'),_0xa1398a=stripLocalSqlMetadata(_0x3cd5d3,_0x20cdf0['mode']),_0x9534f=_0x20cdf0['sqlName']||_0x177c93[_0x4933da(0x109)],_0x337406=await resolveTargetDbBinding(_0x209359[_0x4933da(0x124)],_0x20cdf0,_0x177c93),_0x5944a2=await updateSqlQuery({'id':_0x177c93[_0x4933da(0x108)],'appCode':_0x209359[_0x4933da(0x124)],'sqlCode':_0x20cdf0[_0x4933da(0x115)],'sqlName':_0x9534f,'dbId':_0x337406[_0x4933da(0x10c)],'version':_0x177c93[_0x4933da(0x111)],'sqlContent':_0xa1398a,'sqlConfig':_0x177c93[_0x4933da(0x11c)]??undefined}),_0x106a1b=_0x5944a2[_0x4933da(0x10c)]?await getDbName(_0x209359['appCode'],Number(_0x5944a2['dbId']))[_0x4933da(0x103)](()=>_0x337406['dbName']):_0x337406[_0x4933da(0x133)];_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0[_0x4933da(0x115)]]={...buildSqlLockEntry(_0x5944a2,_0xa1398a,_0x1a1c8e,{'dbName':_0x106a1b}),'path':_0x20cdf0['relativePath'],'mode':_0x177c93['mode']},await archivePreviousSqlFileIfNeeded(_0x4cd1a0,_0x177c93[_0x4933da(0x107)],_0x20cdf0[_0x4933da(0x106)]),_0x3d56ac['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'remoteId':_0x177c93[_0x4933da(0x108)]});}catch(_0x37874d){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x37874d instanceof Error?_0x37874d['message']:String(_0x37874d)});}}return _0x5f41d4[_0x4933da(0x143)]=new Date()[_0x4933da(0x127)](),await writeSqlLockFile(_0x4cd1a0[_0x4933da(0x126)],_0x44349b),{'ok':_0x71952f[_0x4933da(0x117)]===0x0,'data':{'pushed':_0x3d56ac,'skipped':_0x51d611,'failed':_0x71952f},'message':'Push\x20complete:\x20'+_0x3d56ac[_0x4933da(0x117)]+_0x4933da(0x13a)+_0x51d611['length']+_0x4933da(0x12b)+_0x71952f[_0x4933da(0x117)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x584449,_0x41b9cf,_0x3abad5){const _0x4b4f96=a129_0x4a4dc8;if(!_0x41b9cf||_0x41b9cf===_0x3abad5)return;const _0x26e636=join(_0x584449[_0x4b4f96(0x136)],_0x41b9cf);if(!await fileExists(_0x26e636))return;const _0x13faf1=await moveToTrash(_0x584449[_0x4b4f96(0x10f)],_0x584449['trashDir'],_0x26e636);await cleanupEmptyDirectories(dirname(_0x26e636),_0x584449[_0x4b4f96(0x136)]),void _0x13faf1;}async function moveToTrash(_0x577e29,_0x47f4f1,_0x15815d){const _0xce056a=a129_0x4a4dc8,_0x2aefbf=new Date()[_0xce056a(0x127)]()[_0xce056a(0x12d)](/[:.]/g,'-'),_0x1c48e5=relative(_0x577e29,_0x15815d),_0x56f712=join(_0x47f4f1,_0x2aefbf,_0x1c48e5);return await mkdir(dirname(_0x56f712),{'recursive':!![]}),await rename(_0x15815d,_0x56f712),_0x56f712;}async function cleanupEmptyDirectories(_0x49cbe6,_0x37ba7e){const _0x2a6aef=a129_0x4a4dc8;let _0x54d4be=resolve(_0x49cbe6);const _0x5a4617=resolve(_0x37ba7e);while(_0x54d4be['startsWith'](''+_0x5a4617+sep)||_0x54d4be===_0x5a4617){if(_0x54d4be===_0x5a4617)return;try{const _0xc0ce00=await readdir(_0x54d4be);if(_0xc0ce00[_0x2a6aef(0x117)]>0x0)return;await rmdir(_0x54d4be);}catch{return;}_0x54d4be=dirname(_0x54d4be);}}function a129_0x3279(){const _0xcd02a2=['Local\x20SQL\x20not\x20found:\x20','lastSync','\x20SQL\x20file(s)','catch','POST','2rRiOTt','relativePath','path','remoteId','sqlName','252RTptJH','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','dbId','1968Kivowl','sql','projectRoot','bool','version','boolean','385233gVuaDo','filter','sqlCode','dbDirectory','length','map','filePath','get','push','sqlConfig','2434330jTqqjh','17699JmTqRi','319433FLNGgD','Local\x20directory\x20\x22','join','unchanged','hash','appCode','str','lockFilePath','toISOString','entries','validation','force','\x20skipped,\x20','\x22\x20for\x20sqlCode\x20','replace','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqls','3573OZreCv','546008zzItQs','exec','dbName','40817ieGByb','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRootDir','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20pushed,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','high-risk-write','Would\x20push\x20','sqlcode','has','7024oDbiNe','5FsOYsA'];a129_0x3279=function(){return _0xcd02a2;};return a129_0x3279();}async function resolveTargetDbBinding(_0x137bd9,_0x2e0c18,_0x3eb998){const _0x30acd4=a129_0x4a4dc8,_0xc1bc91=_0x2e0c18[_0x30acd4(0x116)];if(!_0xc1bc91)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998[_0x30acd4(0x133)]};const _0x20d776=buildDbDirectoryName(_0x3eb998['dbName'],_0x3eb998[_0x30acd4(0x10c)]);if(_0xc1bc91===_0x20d776)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998['dbName']};const _0x304b02=parseExplicitDbDirectory(_0xc1bc91);if(_0x304b02!=null)return{'dbId':_0x304b02,'dbName':await getDbName(_0x137bd9,_0x304b02)[_0x30acd4(0x103)](()=>undefined)};const _0x72c761=await listDatabases(_0x137bd9),_0x273be6=_0x72c761[_0x30acd4(0x114)](_0x5e7901=>buildDbDirectoryName(_0x5e7901[_0x30acd4(0x133)],_0x5e7901['dbId'])===_0xc1bc91);if(_0x273be6[_0x30acd4(0x117)]===0x1)return{'dbId':_0x273be6[0x0][_0x30acd4(0x10c)],'dbName':_0x273be6[0x0][_0x30acd4(0x133)]};if(_0x273be6[_0x30acd4(0x117)]===0x0)throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x13b)+_0xc1bc91+_0x30acd4(0x12c)+_0x2e0c18[_0x30acd4(0x115)]+'.');const _0x35438a=_0x273be6[_0x30acd4(0x118)](_0xf8b37c=>_0xf8b37c[_0x30acd4(0x133)]+'\x20('+_0xf8b37c['dbId']+')')[_0x30acd4(0x121)](',\x20');throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x120)+_0xc1bc91+_0x30acd4(0x139)+_0x2e0c18['sqlCode']+':\x20'+_0x35438a);}function parseExplicitDbDirectory(_0x166ec1){const _0x2b681e=a129_0x4a4dc8,_0x52221e=/^db-(\d+)$/[_0x2b681e(0x132)](_0x166ec1);if(!_0x52221e)return null;const _0x1948c2=Number(_0x52221e[0x1]);return Number['isFinite'](_0x1948c2)&&_0x1948c2>0x0?_0x1948c2:null;}
@@ -1 +1 @@
1
- const a130_0x4650c3=a130_0x4acc;(function(_0x35103e,_0x4ba946){const _0x48a794=a130_0x4acc,_0x256986=_0x35103e();while(!![]){try{const _0x5ba814=-parseInt(_0x48a794(0x15d))/0x1+parseInt(_0x48a794(0x150))/0x2*(-parseInt(_0x48a794(0x156))/0x3)+parseInt(_0x48a794(0x151))/0x4*(parseInt(_0x48a794(0x15f))/0x5)+parseInt(_0x48a794(0x162))/0x6+parseInt(_0x48a794(0x152))/0x7*(-parseInt(_0x48a794(0x163))/0x8)+-parseInt(_0x48a794(0x15e))/0x9+parseInt(_0x48a794(0x164))/0xa;if(_0x5ba814===_0x4ba946)break;else _0x256986['push'](_0x256986['shift']());}catch(_0x21da71){_0x256986['push'](_0x256986['shift']());}}}(a130_0x121a,0x4fb75));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a130_0x4acc(_0x466a91,_0x106c4b){_0x466a91=_0x466a91-0x150;const _0x121afd=a130_0x121a();let _0x4acc79=_0x121afd[_0x466a91];return _0x4acc79;}function a130_0x121a(){const _0x53f37d=['sql','SQL\x20query\x20display\x20name','file','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','135214XRPrVi','214416aoXKOs','5VvwYcO','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Path\x20to\x20the\x20SQL\x20file','87942KrSHDZ','3648yBgMUm','2726620AtBEwv','78WICNUL','1711700sQkhQd','399UgURLA','validation','write','string','15669Pvjrhl'];a130_0x121a=function(){return _0x53f37d;};return a130_0x121a();}const SQL_SAVE_DEPRECATED_HINT=[a130_0x4650c3(0x15c),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a130_0x4650c3(0x15b)]['join']('\x0a');export const sqlSave={'service':a130_0x4650c3(0x157),'command':'save','description':a130_0x4650c3(0x160),'risk':a130_0x4650c3(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x4650c3(0x159),'type':a130_0x4650c3(0x155),'required':!![],'description':a130_0x4650c3(0x161)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a130_0x4650c3(0x155),'description':a130_0x4650c3(0x158)},{'name':'db','type':a130_0x4650c3(0x155),'description':a130_0x4650c3(0x15a)},{'name':'description','type':a130_0x4650c3(0x155),'description':'Query\x20description'}],async 'validate'(){const _0x5aa31e=a130_0x4650c3;throw CliErrors[_0x5aa31e(0x153)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x4b5261=a130_0x4650c3;throw CliErrors[_0x4b5261(0x153)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ function a130_0x58b9(){const _0x59b6a7=['3KfwAJf','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','887845KqOVTi','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','save','7440370BKQFVi','6RXAZwy','string','file','1880UTIQPe','1128762fciOuA','1439972uAmRAa','3593800UGyTSb','Query\x20description','Path\x20to\x20the\x20SQL\x20file','523811ETacVH','validation','SQL\x20query\x20display\x20name','16650zbYLWJ','sql','sqlname','write'];a130_0x58b9=function(){return _0x59b6a7;};return a130_0x58b9();}const a130_0x3b6da3=a130_0x50f8;(function(_0x4433dc,_0x37fa95){const _0x1d0096=a130_0x50f8,_0x3ec50f=_0x4433dc();while(!![]){try{const _0xa19456=-parseInt(_0x1d0096(0x6a))/0x1+parseInt(_0x1d0096(0x7b))/0x2+-parseInt(_0x1d0096(0x71))/0x3*(-parseInt(_0x1d0096(0x7c))/0x4)+-parseInt(_0x1d0096(0x73))/0x5*(-parseInt(_0x1d0096(0x77))/0x6)+-parseInt(_0x1d0096(0x67))/0x7+-parseInt(_0x1d0096(0x7a))/0x8*(parseInt(_0x1d0096(0x6d))/0x9)+parseInt(_0x1d0096(0x76))/0xa;if(_0xa19456===_0x37fa95)break;else _0x3ec50f['push'](_0x3ec50f['shift']());}catch(_0x5ddbb4){_0x3ec50f['push'](_0x3ec50f['shift']());}}}(a130_0x58b9,0x5b503));function a130_0x50f8(_0x37ca7a,_0x1fe3be){_0x37ca7a=_0x37ca7a-0x67;const _0x58b980=a130_0x58b9();let _0x50f8f2=_0x58b980[_0x37ca7a];return _0x50f8f2;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a130_0x3b6da3(0x72)]['join']('\x0a');export const sqlSave={'service':a130_0x3b6da3(0x6e),'command':a130_0x3b6da3(0x75),'description':a130_0x3b6da3(0x74),'risk':a130_0x3b6da3(0x70),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x3b6da3(0x79),'type':a130_0x3b6da3(0x78),'required':!![],'description':a130_0x3b6da3(0x69)},SQLCODE_FLAG_OPTIONAL,{'name':a130_0x3b6da3(0x6f),'type':a130_0x3b6da3(0x78),'description':a130_0x3b6da3(0x6c)},{'name':'db','type':'string','description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':'string','description':a130_0x3b6da3(0x68)}],async 'validate'(){const _0x1669e8=a130_0x3b6da3;throw CliErrors[_0x1669e8(0x6b)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- (function(_0x426c22,_0x3dfe4c){const _0x249fa5=a131_0x2a15,_0x3899a4=_0x426c22();while(!![]){try{const _0x1d086e=parseInt(_0x249fa5(0x103))/0x1+parseInt(_0x249fa5(0x11d))/0x2+-parseInt(_0x249fa5(0x11f))/0x3*(parseInt(_0x249fa5(0xfc))/0x4)+-parseInt(_0x249fa5(0x126))/0x5*(parseInt(_0x249fa5(0x123))/0x6)+parseInt(_0x249fa5(0x11a))/0x7+-parseInt(_0x249fa5(0x10b))/0x8+-parseInt(_0x249fa5(0x112))/0x9;if(_0x1d086e===_0x3dfe4c)break;else _0x3899a4['push'](_0x3899a4['shift']());}catch(_0x1cbd8b){_0x3899a4['push'](_0x3899a4['shift']());}}}(a131_0x2a2d,0x29fb2));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x231375,_0x15aea3,_0x2c161f,_0x38b3b7){const _0x3677be=a131_0x2a15,_0x1ec040=detectSqlMode(_0x15aea3);return{'path':buildSqlRelativePath(_0x231375[_0x3677be(0x106)],_0x231375[_0x3677be(0x115)],_0x38b3b7?.['dbName'],_0x1ec040,_0x231375['dbId']),'hash':_0x2c161f,'remoteId':_0x231375['id'],'version':_0x231375[_0x3677be(0x107)],'dbId':Number(_0x231375[_0x3677be(0x100)]),'dbName':_0x38b3b7?.[_0x3677be(0x10e)],'sqlName':_0x231375[_0x3677be(0x115)],'sqlConfig':_0x231375[_0x3677be(0x117)]??undefined,'mode':_0x1ec040};}export function cloneSqlLockData(_0x286275){const _0x8be37c=a131_0x2a15;return{'apps':Object[_0x8be37c(0x125)](Object[_0x8be37c(0xfe)](_0x286275[_0x8be37c(0x11b)])['map'](([_0x464730,_0x144861])=>[_0x464730,{'sqlRoot':_0x144861[_0x8be37c(0x11c)],'lastSync':_0x144861[_0x8be37c(0x111)],'sqls':{..._0x144861['sqls']}}]))};}export function ensureRemoteSqlContent(_0x432eb7){return _0x432eb7['sqlContent']??'';}export function buildLocalSqlFileContent(_0x178fff,_0xaa1bec,_0x247a41){const _0x33268b=a131_0x2a15,_0x1b6d14=_0x247a41?.[_0x33268b(0x124)]??detectSqlMode(_0xaa1bec),_0x4bd41b=stripLocalSqlMetadata(_0xaa1bec,_0x1b6d14)[_0x33268b(0xff)](),_0x53039b=[...buildMetadataHeaderLines({'sqlCode':_0x178fff['sqlCode'],'sqlName':_0x178fff[_0x33268b(0x115)],'dbId':_0x178fff[_0x33268b(0x100)],'dbName':_0x247a41?.[_0x33268b(0x10e)],'mode':_0x1b6d14,'syncedAt':_0x247a41?.[_0x33268b(0x110)],'description':_0x247a41?.[_0x33268b(0x104)]},_0x1b6d14),'',_0x4bd41b],_0x4ec157=_0x53039b[_0x33268b(0x10f)]('\x0a');return _0x4ec157['endsWith']('\x0a')?_0x4ec157:_0x4ec157+'\x0a';}export function stripLocalSqlMetadata(_0x3b2467,_0x46a261){const _0x1dcdfc=a131_0x2a15,_0x4541f8=_0x3b2467[_0x1dcdfc(0x10c)](/\r\n/g,'\x0a')[_0x1dcdfc(0x108)]('\x0a'),_0x127d00=[];let _0x3434e4=0x0;if(_0x46a261===_0x1dcdfc(0x102))while(_0x3434e4<_0x4541f8[_0x1dcdfc(0x119)]){const _0x5db850=_0x4541f8[_0x3434e4]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1dcdfc(0x121)](_0x5db850)){_0x3434e4++;continue;}if(_0x5db850[_0x1dcdfc(0xff)]()===''&&_0x3434e4>0x0){_0x3434e4++;continue;}break;}else while(_0x3434e4<_0x4541f8['length']){const _0x357f64=_0x4541f8[_0x3434e4]??'';if(/^\s*--\s*@lovrabet\./[_0x1dcdfc(0x121)](_0x357f64)){_0x3434e4++;continue;}if(_0x357f64[_0x1dcdfc(0xff)]()===''&&_0x3434e4>0x0){_0x3434e4++;continue;}break;}for(;_0x3434e4<_0x4541f8['length'];_0x3434e4++){_0x127d00[_0x1dcdfc(0x10a)](_0x4541f8[_0x3434e4]);}return _0x127d00[_0x1dcdfc(0x10f)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x442a53,_0x3d7903){const _0x4745ef=a131_0x2a15;if(_0x3d7903?.[_0x4745ef(0x124)])return _0x3d7903[_0x4745ef(0x124)];return detectSqlMode(_0x442a53);}function a131_0x2a2d(){const _0x52b101=['sqlCode','version','split','filter','push','694728fzPcYs','replace','stdin','dbName','join','syncedAt','lastSync','1215108YMIygL','\x20[y/N]\x20','stderr','sqlName','question','sqlConfig','\x20-->','length','2053219Dicthn','apps','sqlRoot','126386rLntxL','path','5913BQMYbx','--\x20@lovrabet.','test','toLowerCase','6UkrycJ','mode','fromEntries','459470cQARtj','52nbqpmI','includes','entries','trim','dbId','yes','mybatisXml','154814jEhulB','description','map'];a131_0x2a2d=function(){return _0x52b101;};return a131_0x2a2d();}export function resolveSqlFileName(_0x5413b5,_0x348b52,_0x4546ba){const _0x37c3f3=a131_0x2a15;if(_0x4546ba?.[_0x37c3f3(0x11e)])return _0x4546ba[_0x37c3f3(0x11e)];if(_0x4546ba?.[_0x37c3f3(0x115)]||_0x4546ba?.['dbName'])return buildSqlRelativePath(_0x5413b5,_0x4546ba?.[_0x37c3f3(0x115)],_0x4546ba?.[_0x37c3f3(0x10e)],resolveSqlMode(_0x348b52,_0x4546ba),_0x4546ba?.[_0x37c3f3(0x100)]);return buildDefaultSqlFileName(_0x5413b5,resolveSqlMode(_0x348b52,_0x4546ba));}export function resolveSqlLocalDir(_0x977f6f,_0x11a404){return join(_0x977f6f,SQL_LOCAL_REL_DIR,_0x11a404);}export async function confirmForceOverwrite(_0x42ec19){const _0x4ecd7d=a131_0x2a15,_0x4e3e71=createInterface({'input':process[_0x4ecd7d(0x10d)],'output':process[_0x4ecd7d(0x114)]}),_0x50e7de=await new Promise(_0x27c373=>{const _0x1f0906=_0x4ecd7d;_0x4e3e71[_0x1f0906(0x116)](_0x42ec19+_0x1f0906(0x113),_0x27c373);});return _0x4e3e71['close'](),['y',_0x4ecd7d(0x101)][_0x4ecd7d(0xfd)](_0x50e7de[_0x4ecd7d(0xff)]()[_0x4ecd7d(0x122)]());}export function findSqlLockScope(_0x5b9736,_0x1cc046){const _0x484b3a=a131_0x2a15;return _0x5b9736[_0x484b3a(0x11b)][_0x1cc046];}function a131_0x2a15(_0x41fdae,_0x261871){_0x41fdae=_0x41fdae-0xfc;const _0x2a2d28=a131_0x2a2d();let _0x2a15fe=_0x2a2d28[_0x41fdae];return _0x2a15fe;}function buildMetadataHeaderLines(_0x204910,_0x25200e){const _0x5ab563=a131_0x2a15,_0x53cb83=[[_0x5ab563(0x106),_0x204910[_0x5ab563(0x106)]],[_0x5ab563(0x115),_0x204910['sqlName']],[_0x5ab563(0x100),_0x204910[_0x5ab563(0x100)]],['dbName',_0x204910[_0x5ab563(0x10e)]],['mode',_0x204910[_0x5ab563(0x124)]],[_0x5ab563(0x110),_0x204910[_0x5ab563(0x110)]],[_0x5ab563(0x104),_0x204910[_0x5ab563(0x104)]]];if(_0x25200e===_0x5ab563(0x102))return _0x53cb83['filter'](([,_0x249a11])=>_0x249a11!==undefined&&_0x249a11!==null&&String(_0x249a11)[_0x5ab563(0xff)]()!=='')['map'](([_0x5b1092,_0x247a0f])=>'<!--\x20@lovrabet.'+_0x5b1092+':\x20'+String(_0x247a0f)+_0x5ab563(0x118));return _0x53cb83[_0x5ab563(0x109)](([,_0x22755f])=>_0x22755f!==undefined&&_0x22755f!==null&&String(_0x22755f)[_0x5ab563(0xff)]()!=='')[_0x5ab563(0x105)](([_0x2b0051,_0x3953fd])=>_0x5ab563(0x120)+_0x2b0051+':\x20'+String(_0x3953fd));}
1
+ const a131_0x45dd75=a131_0x410c;(function(_0x10104a,_0x20681c){const _0x4c2a1f=a131_0x410c,_0x54f2ab=_0x10104a();while(!![]){try{const _0x47543e=parseInt(_0x4c2a1f(0x113))/0x1+-parseInt(_0x4c2a1f(0xf8))/0x2*(-parseInt(_0x4c2a1f(0x105))/0x3)+parseInt(_0x4c2a1f(0xed))/0x4+parseInt(_0x4c2a1f(0x10a))/0x5+-parseInt(_0x4c2a1f(0x110))/0x6*(parseInt(_0x4c2a1f(0x111))/0x7)+-parseInt(_0x4c2a1f(0xf7))/0x8*(-parseInt(_0x4c2a1f(0xf4))/0x9)+parseInt(_0x4c2a1f(0xf6))/0xa*(-parseInt(_0x4c2a1f(0x103))/0xb);if(_0x47543e===_0x20681c)break;else _0x54f2ab['push'](_0x54f2ab['shift']());}catch(_0x2150e3){_0x54f2ab['push'](_0x54f2ab['shift']());}}}(a131_0x20f3,0x5cbdc));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x45dd75(0x107);export function buildSqlLockEntry(_0x2a4fbd,_0x11894c,_0x401bb3,_0x17c85e){const _0x1d1481=a131_0x45dd75,_0x2bdfe0=detectSqlMode(_0x11894c);return{'path':buildSqlRelativePath(_0x2a4fbd[_0x1d1481(0x10b)],_0x2a4fbd[_0x1d1481(0x115)],_0x17c85e?.['dbName'],_0x2bdfe0,_0x2a4fbd[_0x1d1481(0x112)]),'hash':_0x401bb3,'remoteId':_0x2a4fbd['id'],'version':_0x2a4fbd[_0x1d1481(0x114)],'dbId':Number(_0x2a4fbd[_0x1d1481(0x112)]),'dbName':_0x17c85e?.[_0x1d1481(0x100)],'sqlName':_0x2a4fbd[_0x1d1481(0x115)],'sqlConfig':_0x2a4fbd['sqlConfig']??undefined,'mode':_0x2bdfe0};}export function cloneSqlLockData(_0x4b5dbc){const _0x4d5150=a131_0x45dd75;return{'apps':Object[_0x4d5150(0x106)](Object[_0x4d5150(0xf5)](_0x4b5dbc['apps'])['map'](([_0x2ebfd5,_0x564506])=>[_0x2ebfd5,{'sqlRoot':_0x564506[_0x4d5150(0x10c)],'lastSync':_0x564506['lastSync'],'sqls':{..._0x564506['sqls']}}]))};}export function ensureRemoteSqlContent(_0x4f105f){return _0x4f105f['sqlContent']??'';}function a131_0x410c(_0x23c1de,_0x4498f5){_0x23c1de=_0x23c1de-0xec;const _0x20f3ec=a131_0x20f3();let _0x410c15=_0x20f3ec[_0x23c1de];return _0x410c15;}export function buildLocalSqlFileContent(_0x1a7e4d,_0xb6d33f,_0x3c21d6){const _0x469450=a131_0x45dd75,_0x3470ef=_0x3c21d6?.[_0x469450(0xfe)]??detectSqlMode(_0xb6d33f),_0x21e272=stripLocalSqlMetadata(_0xb6d33f,_0x3470ef)[_0x469450(0xf2)](),_0x262090=[...buildMetadataHeaderLines({'sqlCode':_0x1a7e4d[_0x469450(0x10b)],'sqlName':_0x1a7e4d[_0x469450(0x115)],'dbId':_0x1a7e4d[_0x469450(0x112)],'dbName':_0x3c21d6?.[_0x469450(0x100)],'mode':_0x3470ef,'syncedAt':_0x3c21d6?.[_0x469450(0x102)],'description':_0x3c21d6?.[_0x469450(0x10f)]},_0x3470ef),'',_0x21e272],_0x28b67d=_0x262090[_0x469450(0xf0)]('\x0a');return _0x28b67d[_0x469450(0xf3)]('\x0a')?_0x28b67d:_0x28b67d+'\x0a';}export function stripLocalSqlMetadata(_0x43c008,_0x3608e4){const _0x48362c=a131_0x45dd75,_0x35b7a7=_0x43c008[_0x48362c(0x10e)](/\r\n/g,'\x0a')['split']('\x0a'),_0x13b6ca=[];let _0x1ff3ab=0x0;if(_0x3608e4===_0x48362c(0xfb))while(_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)]){const _0x4902a3=_0x35b7a7[_0x1ff3ab]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x4902a3)){_0x1ff3ab++;continue;}if(_0x4902a3[_0x48362c(0xf2)]()===''&&_0x1ff3ab>0x0){_0x1ff3ab++;continue;}break;}else while(_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)]){const _0x306329=_0x35b7a7[_0x1ff3ab]??'';if(/^\s*--\s*@lovrabet\./[_0x48362c(0xf1)](_0x306329)){_0x1ff3ab++;continue;}if(_0x306329['trim']()===''&&_0x1ff3ab>0x0){_0x1ff3ab++;continue;}break;}for(;_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)];_0x1ff3ab++){_0x13b6ca['push'](_0x35b7a7[_0x1ff3ab]);}return _0x13b6ca[_0x48362c(0xf0)]('\x0a')[_0x48362c(0xfd)]();}export function resolveSqlMode(_0x5c5aef,_0x10008b){const _0x552870=a131_0x45dd75;if(_0x10008b?.[_0x552870(0xfe)])return _0x10008b['mode'];return detectSqlMode(_0x5c5aef);}export function resolveSqlFileName(_0x3e86e3,_0x4b9538,_0x4e27bd){const _0x480b15=a131_0x45dd75;if(_0x4e27bd?.[_0x480b15(0xef)])return _0x4e27bd[_0x480b15(0xef)];if(_0x4e27bd?.[_0x480b15(0x115)]||_0x4e27bd?.[_0x480b15(0x100)])return buildSqlRelativePath(_0x3e86e3,_0x4e27bd?.[_0x480b15(0x115)],_0x4e27bd?.[_0x480b15(0x100)],resolveSqlMode(_0x4b9538,_0x4e27bd),_0x4e27bd?.[_0x480b15(0x112)]);return buildDefaultSqlFileName(_0x3e86e3,resolveSqlMode(_0x4b9538,_0x4e27bd));}export function resolveSqlLocalDir(_0x2066d6,_0xa5653f){return join(_0x2066d6,SQL_LOCAL_REL_DIR,_0xa5653f);}export async function confirmForceOverwrite(_0x5043d0){const _0x53f1af=a131_0x45dd75,_0x37737b=createInterface({'input':process[_0x53f1af(0xec)],'output':process['stderr']}),_0x1451d4=await new Promise(_0x562a9b=>{const _0x4a0268=_0x53f1af;_0x37737b[_0x4a0268(0xfa)](_0x5043d0+'\x20[y/N]\x20',_0x562a9b);});return _0x37737b[_0x53f1af(0xee)](),['y',_0x53f1af(0x108)][_0x53f1af(0x101)](_0x1451d4[_0x53f1af(0xf2)]()['toLowerCase']());}export function findSqlLockScope(_0x363b40,_0x5c1734){const _0x129959=a131_0x45dd75;return _0x363b40[_0x129959(0x10d)][_0x5c1734];}function buildMetadataHeaderLines(_0x43c76b,_0x5cf0d3){const _0x26f0dc=a131_0x45dd75,_0x3da29e=[['sqlCode',_0x43c76b[_0x26f0dc(0x10b)]],[_0x26f0dc(0x115),_0x43c76b[_0x26f0dc(0x115)]],[_0x26f0dc(0x112),_0x43c76b[_0x26f0dc(0x112)]],[_0x26f0dc(0x100),_0x43c76b[_0x26f0dc(0x100)]],['mode',_0x43c76b[_0x26f0dc(0xfe)]],[_0x26f0dc(0x102),_0x43c76b['syncedAt']],['description',_0x43c76b[_0x26f0dc(0x10f)]]];if(_0x5cf0d3===_0x26f0dc(0xfb))return _0x3da29e[_0x26f0dc(0xfc)](([,_0x6c5183])=>_0x6c5183!==undefined&&_0x6c5183!==null&&String(_0x6c5183)['trim']()!=='')[_0x26f0dc(0x109)](([_0x10a817,_0xbf7430])=>_0x26f0dc(0xff)+_0x10a817+':\x20'+String(_0xbf7430)+_0x26f0dc(0xf9));return _0x3da29e[_0x26f0dc(0xfc)](([,_0x4f9b0b])=>_0x4f9b0b!==undefined&&_0x4f9b0b!==null&&String(_0x4f9b0b)[_0x26f0dc(0xf2)]()!=='')[_0x26f0dc(0x109)](([_0x33f64d,_0x577504])=>'--\x20@lovrabet.'+_0x33f64d+':\x20'+String(_0x577504));}function a131_0x20f3(){const _0x584bb0=['apps','replace','description','84qcejLu','194999FahVqy','dbId','126217QRoyzU','version','sqlName','stdin','1167364oZNwTu','close','path','join','test','trim','endsWith','9tFrGwm','entries','920HqgsGD','5407880lmJuMz','2zjkvio','\x20-->','question','mybatisXml','filter','trimStart','mode','<!--\x20@lovrabet.','dbName','includes','syncedAt','91003gnvIMt','length','415092XnXJnJ','fromEntries','.rabetbase/sql','yes','map','1492875zOLUxi','sqlCode','sqlRoot'];a131_0x20f3=function(){return _0x584bb0;};return a131_0x20f3();}
@@ -1 +1 @@
1
- const a132_0x194053=a132_0x29df;(function(_0x59cba7,_0x2ab77c){const _0x4e7d21=a132_0x29df,_0x5227f2=_0x59cba7();while(!![]){try{const _0x234d82=parseInt(_0x4e7d21(0x142))/0x1+parseInt(_0x4e7d21(0x141))/0x2+-parseInt(_0x4e7d21(0x124))/0x3*(-parseInt(_0x4e7d21(0x129))/0x4)+parseInt(_0x4e7d21(0x122))/0x5+-parseInt(_0x4e7d21(0x13a))/0x6+parseInt(_0x4e7d21(0x13d))/0x7*(parseInt(_0x4e7d21(0x12f))/0x8)+-parseInt(_0x4e7d21(0x128))/0x9;if(_0x234d82===_0x2ab77c)break;else _0x5227f2['push'](_0x5227f2['shift']());}catch(_0x364828){_0x5227f2['push'](_0x5227f2['shift']());}}}(a132_0x1ef3,0x712a3));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a132_0x29df(_0x2e2bbf,_0x473f04){_0x2e2bbf=_0x2e2bbf-0x122;const _0x1ef3cb=a132_0x1ef3();let _0x29df39=_0x1ef3cb[_0x2e2bbf];return _0x29df39;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a132_0x1ef3(){const _0x27c79b=['888FfeegV','sqls','totalCount','bool','lockFilePath','filePath','path','hash','\x20modified,\x20','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlRoot','3938862jqgfHC','remote','\x20missing,\x20','10087lZQyhA','sqlName','tableData','length','1328834IPRUjP','139910JWmSia','\x20remote-only','read','460490ZitnaU','map','213zerDRi','sqlCode','has','lockKey','1561644CLYaKs','13360asHFpE','appCode','boolean','sql','push','status'];a132_0x1ef3=function(){return _0x27c79b;};return a132_0x1ef3();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3b6b78){const _0x5ac724=a132_0x29df,_0x126563=[];let _0x1ebcc3=0x1;while(!![]){const _0xb766c1=await listSqlQueries(_0x3b6b78,{'currentPage':_0x1ebcc3,'pageSize':PAGE_SIZE}),_0x184a56=_0xb766c1[_0x5ac724(0x13f)]??[];_0x126563['push'](..._0x184a56[_0x5ac724(0x123)](_0x307cef=>_0x307cef[_0x5ac724(0x125)]));if(_0x184a56['length']===0x0)break;const _0x3f9f63=_0xb766c1['paging']?.[_0x5ac724(0x131)];if(_0x3f9f63!=null?_0x126563[_0x5ac724(0x140)]>=_0x3f9f63:_0x184a56[_0x5ac724(0x140)]<PAGE_SIZE)break;_0x1ebcc3++;}return _0x126563;}export const sqlStatus={'service':a132_0x194053(0x12c),'command':a132_0x194053(0x12e),'description':a132_0x194053(0x138),'risk':a132_0x194053(0x144),'flags':[{'name':a132_0x194053(0x13b),'type':a132_0x194053(0x12b),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x205e13){const _0x14fea2=a132_0x194053,_0x99a5b2=loadSqlProjectConfig(_0x205e13[_0x14fea2(0x12a)]),_0x242289=await readSqlLockFile(_0x99a5b2[_0x14fea2(0x133)]),{appLock:_0x57a8b7}=ensureSqlLockScope(_0x242289??createEmptySqlLock(),_0x99a5b2[_0x14fea2(0x12a)],_0x99a5b2[_0x14fea2(0x139)],_0x14fea2(0x12e)),_0x1464db=await scanLocalSqlQueries(_0x99a5b2),_0x45938f=[],_0x344c40=[],_0x2bdd92=[],_0xefcb33=[],_0x2e21e6=new Set(_0x1464db[_0x14fea2(0x123)](_0x3f4c52=>_0x3f4c52[_0x14fea2(0x127)]));for(const _0x3b44ae of _0x1464db){const _0x185424=await computeSqlFileHash(_0x3b44ae[_0x14fea2(0x134)]),_0x919762=_0x57a8b7[_0x14fea2(0x130)][_0x3b44ae[_0x14fea2(0x127)]],_0x43f61a=!!_0x919762&&_0x919762[_0x14fea2(0x135)]!==_0x3b44ae['relativePath'],_0x45ba2e=!!_0x919762&&!!_0x3b44ae[_0x14fea2(0x13e)]&&_0x919762[_0x14fea2(0x13e)]!==_0x3b44ae[_0x14fea2(0x13e)];if(!_0x919762)_0x45938f[_0x14fea2(0x12d)](_0x3b44ae['lockKey']);else _0x919762[_0x14fea2(0x136)]!==_0x185424||_0x43f61a||_0x45ba2e?_0x344c40[_0x14fea2(0x12d)](_0x3b44ae[_0x14fea2(0x127)]):_0x2bdd92[_0x14fea2(0x12d)](_0x3b44ae['lockKey']);}for(const _0x451315 of Object['keys'](_0x57a8b7[_0x14fea2(0x130)])){!_0x2e21e6['has'](_0x451315)&&_0xefcb33[_0x14fea2(0x12d)](_0x451315);}const _0x410bc5=[];if(_0x205e13[_0x14fea2(0x132)](_0x14fea2(0x13b))){const _0xd5b0a9=await fetchAllSqlCodes(_0x205e13[_0x14fea2(0x12a)]);for(const _0x42b47a of _0xd5b0a9){!_0x2e21e6[_0x14fea2(0x126)](_0x42b47a)&&!_0x57a8b7[_0x14fea2(0x130)][_0x42b47a]&&_0x410bc5[_0x14fea2(0x12d)](_0x42b47a);}}const _0x8a4e84=_0x45938f[_0x14fea2(0x140)]===0x0&&_0x344c40[_0x14fea2(0x140)]===0x0&&_0xefcb33['length']===0x0&&_0x410bc5[_0x14fea2(0x140)]===0x0;return{'ok':!![],'data':{'added':_0x45938f,'modified':_0x344c40,'missing':_0xefcb33,'unchanged':_0x2bdd92,'remoteOnly':_0x410bc5},'message':_0x8a4e84?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x45938f['length']+'\x20added,\x20'+_0x344c40[_0x14fea2(0x140)]+_0x14fea2(0x137)+_0xefcb33['length']+_0x14fea2(0x13c)+_0x2bdd92[_0x14fea2(0x140)]+'\x20unchanged'+(_0x410bc5[_0x14fea2(0x140)]>0x0?',\x20'+_0x410bc5[_0x14fea2(0x140)]+_0x14fea2(0x143):'')};}};
1
+ const a132_0x4ed412=a132_0x2ade;(function(_0x4bdc38,_0x1dc4f7){const _0x2c981f=a132_0x2ade,_0x1671ca=_0x4bdc38();while(!![]){try{const _0x409436=-parseInt(_0x2c981f(0x1b0))/0x1+parseInt(_0x2c981f(0x1a8))/0x2*(-parseInt(_0x2c981f(0x1a0))/0x3)+-parseInt(_0x2c981f(0x1aa))/0x4*(-parseInt(_0x2c981f(0x1ba))/0x5)+-parseInt(_0x2c981f(0x1b2))/0x6+parseInt(_0x2c981f(0x1ad))/0x7*(-parseInt(_0x2c981f(0x1c1))/0x8)+-parseInt(_0x2c981f(0x1b9))/0x9*(-parseInt(_0x2c981f(0x1a5))/0xa)+-parseInt(_0x2c981f(0x1b5))/0xb*(-parseInt(_0x2c981f(0x1b1))/0xc);if(_0x409436===_0x1dc4f7)break;else _0x1671ca['push'](_0x1671ca['shift']());}catch(_0x599079){_0x1671ca['push'](_0x1671ca['shift']());}}}(a132_0x5d7a,0xc41f0));function a132_0x5d7a(){const _0x3fbca4=['4654524eXHRwy','\x20added,\x20','paging','5254469MNEnHK','boolean','map','lockFilePath','27kTpoZt','10AnHVIo','remote','read','status','keys','hash','sqlName','3056pYKWwY','relativePath','has','bool','totalCount','path','push','tableData','sqls','\x20modified,\x20','63DdcAQi','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20remote-only','sqlRoot','350690MNLrqT','sqlCode','\x20missing,\x20','67118SIkUFL','sql','1859024oRxlUz','lockKey','appCode','896pBcmOE','\x20unchanged','length','135055XteDdO','36Olpinv'];a132_0x5d7a=function(){return _0x3fbca4;};return a132_0x5d7a();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a132_0x2ade(_0x6c3c98,_0x5f4253){_0x6c3c98=_0x6c3c98-0x198;const _0x5d7ad4=a132_0x5d7a();let _0x2ade2c=_0x5d7ad4[_0x6c3c98];return _0x2ade2c;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x19fbab){const _0x12da17=a132_0x2ade,_0x58f21e=[];let _0x132cda=0x1;while(!![]){const _0x1c9d3c=await listSqlQueries(_0x19fbab,{'currentPage':_0x132cda,'pageSize':PAGE_SIZE}),_0x2d5cb3=_0x1c9d3c[_0x12da17(0x19d)]??[];_0x58f21e['push'](..._0x2d5cb3[_0x12da17(0x1b7)](_0x436db5=>_0x436db5[_0x12da17(0x1a6)]));if(_0x2d5cb3[_0x12da17(0x1af)]===0x0)break;const _0x306bb3=_0x1c9d3c[_0x12da17(0x1b4)]?.[_0x12da17(0x19a)];if(_0x306bb3!=null?_0x58f21e[_0x12da17(0x1af)]>=_0x306bb3:_0x2d5cb3[_0x12da17(0x1af)]<PAGE_SIZE)break;_0x132cda++;}return _0x58f21e;}export const sqlStatus={'service':a132_0x4ed412(0x1a9),'command':a132_0x4ed412(0x1bd),'description':a132_0x4ed412(0x1a2),'risk':a132_0x4ed412(0x1bc),'flags':[{'name':a132_0x4ed412(0x1bb),'type':a132_0x4ed412(0x1b6),'description':a132_0x4ed412(0x1a1)}],async 'execute'(_0x37518c){const _0x3195db=a132_0x4ed412,_0x5afc5b=loadSqlProjectConfig(_0x37518c['appCode']),_0x32e011=await readSqlLockFile(_0x5afc5b[_0x3195db(0x1b8)]),{appLock:_0x3b9590}=ensureSqlLockScope(_0x32e011??createEmptySqlLock(),_0x5afc5b[_0x3195db(0x1ac)],_0x5afc5b[_0x3195db(0x1a4)],_0x3195db(0x1bd)),_0x13b2c9=await scanLocalSqlQueries(_0x5afc5b),_0x1a7b4a=[],_0x212eee=[],_0x5d4a87=[],_0x59c5a2=[],_0x2f9522=new Set(_0x13b2c9['map'](_0x4b69dc=>_0x4b69dc[_0x3195db(0x1ab)]));for(const _0x33b0aa of _0x13b2c9){const _0x259270=await computeSqlFileHash(_0x33b0aa['filePath']),_0x40baf8=_0x3b9590['sqls'][_0x33b0aa[_0x3195db(0x1ab)]],_0x224dd1=!!_0x40baf8&&_0x40baf8[_0x3195db(0x19b)]!==_0x33b0aa[_0x3195db(0x1c2)],_0x5459a1=!!_0x40baf8&&!!_0x33b0aa[_0x3195db(0x1c0)]&&_0x40baf8[_0x3195db(0x1c0)]!==_0x33b0aa[_0x3195db(0x1c0)];if(!_0x40baf8)_0x1a7b4a[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]);else _0x40baf8[_0x3195db(0x1bf)]!==_0x259270||_0x224dd1||_0x5459a1?_0x212eee[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]):_0x5d4a87[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]);}for(const _0x753f6b of Object[_0x3195db(0x1be)](_0x3b9590['sqls'])){!_0x2f9522[_0x3195db(0x198)](_0x753f6b)&&_0x59c5a2[_0x3195db(0x19c)](_0x753f6b);}const _0x5d895d=[];if(_0x37518c[_0x3195db(0x199)]('remote')){const _0x51996f=await fetchAllSqlCodes(_0x37518c[_0x3195db(0x1ac)]);for(const _0x4c35af of _0x51996f){!_0x2f9522[_0x3195db(0x198)](_0x4c35af)&&!_0x3b9590[_0x3195db(0x19e)][_0x4c35af]&&_0x5d895d[_0x3195db(0x19c)](_0x4c35af);}}const _0x328fdf=_0x1a7b4a[_0x3195db(0x1af)]===0x0&&_0x212eee['length']===0x0&&_0x59c5a2[_0x3195db(0x1af)]===0x0&&_0x5d895d[_0x3195db(0x1af)]===0x0;return{'ok':!![],'data':{'added':_0x1a7b4a,'modified':_0x212eee,'missing':_0x59c5a2,'unchanged':_0x5d4a87,'remoteOnly':_0x5d895d},'message':_0x328fdf?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x1a7b4a[_0x3195db(0x1af)]+_0x3195db(0x1b3)+_0x212eee[_0x3195db(0x1af)]+_0x3195db(0x19f)+_0x59c5a2['length']+_0x3195db(0x1a7)+_0x5d4a87[_0x3195db(0x1af)]+_0x3195db(0x1ae)+(_0x5d895d[_0x3195db(0x1af)]>0x0?',\x20'+_0x5d895d['length']+_0x3195db(0x1a3):'')};}};
@@ -1 +1 @@
1
- const a133_0x4d4c97=a133_0x1d36;(function(_0x2ca758,_0x1bde6e){const _0x1ffc4b=a133_0x1d36,_0x15dc00=_0x2ca758();while(!![]){try{const _0x2f934a=-parseInt(_0x1ffc4b(0xef))/0x1*(parseInt(_0x1ffc4b(0xe7))/0x2)+parseInt(_0x1ffc4b(0xde))/0x3*(-parseInt(_0x1ffc4b(0xe6))/0x4)+parseInt(_0x1ffc4b(0xdf))/0x5+-parseInt(_0x1ffc4b(0xf9))/0x6+-parseInt(_0x1ffc4b(0x107))/0x7+-parseInt(_0x1ffc4b(0xe0))/0x8*(-parseInt(_0x1ffc4b(0xfa))/0x9)+parseInt(_0x1ffc4b(0xf7))/0xa*(parseInt(_0x1ffc4b(0xdc))/0xb);if(_0x2f934a===_0x1bde6e)break;else _0x15dc00['push'](_0x15dc00['shift']());}catch(_0x23d2a3){_0x15dc00['push'](_0x15dc00['shift']());}}}(a133_0xf08a,0xe9b35));import{readFileSync,existsSync}from'node:fs';function a133_0xf08a(){const _0x47e319=['filter','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','3184300SqdlFu','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','message','isDangerous','SQL\x20schema\x20validation','valid','fields','validation','sql','isArray','39061GgsyDL','tables','1810173cwMCOV','6970340klDzeH','8QRDQVq','from','get','string','schemaWarnings','\x22\x20not\x20found\x20in\x20any\x20dataset','8ViCfoK','430MHFAsD','Table\x20\x22','str','schemas','\x22\x20not\x20found\x20or\x20not\x20accessible','file','name','flagMissing','6193cQlPjK','read','map','validate','File\x20not\x20found:\x20','utf-8','appCode','toLowerCase','4810khanZI','schema:','1411140sOkXoL','9751545nAYpSV','tableName','isSelectOnly','type','dbtableConfig','trim','reason','Dataset\x20\x22','sqlType','length','push'];a133_0xf08a=function(){return _0x47e319;};return a133_0xf08a();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a133_0x1d36(_0x4b7101,_0x144889){_0x4b7101=_0x4b7101-0xd8;const _0xf08a57=a133_0xf08a();let _0x1d36d2=_0xf08a57[_0x4b7101];return _0x1d36d2;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a133_0x4d4c97(0xda),'command':a133_0x4d4c97(0xf2),'description':a133_0x4d4c97(0x108),'risk':a133_0x4d4c97(0xf0),'flags':[{'name':a133_0x4d4c97(0xec),'type':a133_0x4d4c97(0xe3),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a133_0x4d4c97(0xda),'type':a133_0x4d4c97(0xe3),'description':a133_0x4d4c97(0x106)},{'name':a133_0x4d4c97(0xea),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x4676aa){const _0x2c7a7b=a133_0x4d4c97,_0x4910c6=_0x4676aa[_0x2c7a7b(0xe9)](_0x2c7a7b(0xec)),_0x42e0ae=_0x4676aa[_0x2c7a7b(0xe9)](_0x2c7a7b(0xda));if(!_0x4910c6&&!_0x42e0ae)throw CliErrors[_0x2c7a7b(0xee)](_0x2c7a7b(0xec),'Provide\x20--file\x20or\x20--sql');let _0x1303a3;if(_0x4910c6){const _0x1919f8=resolve(process['cwd'](),_0x4910c6);if(!existsSync(_0x1919f8))throw CliErrors[_0x2c7a7b(0xd9)](_0x2c7a7b(0xf3)+_0x1919f8);_0x1303a3=readFileSync(_0x1919f8,_0x2c7a7b(0xf4));}else _0x1303a3=_0x42e0ae;const _0xeff894=validateSql(_0x1303a3),_0x10b2b4={'valid':_0xeff894['valid'],'sqlType':_0xeff894[_0x2c7a7b(0x102)][_0x2c7a7b(0xfd)],'isSelectOnly':_0xeff894['sqlType'][_0x2c7a7b(0xfc)],'isDangerous':_0xeff894[_0x2c7a7b(0x102)][_0x2c7a7b(0x10a)],'tables':_0xeff894['tables'],'parameters':_0xeff894['parameters'],'message':_0xeff894[_0x2c7a7b(0x109)]};_0xeff894[_0x2c7a7b(0x102)][_0x2c7a7b(0x100)]&&(_0x10b2b4[_0x2c7a7b(0x100)]=_0xeff894['sqlType'][_0x2c7a7b(0x100)]);const _0x1a2f68=_0x4676aa[_0x2c7a7b(0xe9)]('schemas');if(_0x1a2f68&&_0xeff894[_0x2c7a7b(0x10c)]){const _0x2a91ca=_0x1a2f68['split'](',')['map'](_0x4b87f8=>_0x4b87f8[_0x2c7a7b(0xff)]())[_0x2c7a7b(0x105)](Boolean),_0x23e2d6=[],_0xde3358=filterDbTableBackedDatasets(await listDatasets(_0x4676aa[_0x2c7a7b(0xf5)])),_0x3bee71=new Map(_0xde3358[_0x2c7a7b(0xf1)](_0x1a2e14=>[_0x1a2e14[_0x2c7a7b(0xfe)]?.['tableName']?.[_0x2c7a7b(0xf6)](),_0x1a2e14]));for(const _0x980452 of _0xeff894[_0x2c7a7b(0xdd)]){const _0x42143e=_0x3bee71[_0x2c7a7b(0xe2)](_0x980452['toLowerCase']());!_0x42143e&&_0x23e2d6[_0x2c7a7b(0x104)](_0x2c7a7b(0xe8)+_0x980452+_0x2c7a7b(0xe5));}for(const _0x3b11f9 of _0x2a91ca){let _0x2cc853;try{_0x2cc853=await getDatasetDetail(_0x3b11f9);}catch{_0x23e2d6[_0x2c7a7b(0x104)](_0x2c7a7b(0x101)+_0x3b11f9+_0x2c7a7b(0xeb));continue;}assertDatasetIsDbTableBacked(_0x2cc853,_0x2c7a7b(0x10b));const _0x18fa50=Array[_0x2c7a7b(0xdb)](_0x2cc853['fields'])?_0x2cc853[_0x2c7a7b(0xd8)]:[],_0x5acf5e=new Set(_0x18fa50[_0x2c7a7b(0xf1)](_0x3f5437=>_0x3f5437[_0x2c7a7b(0xed)]?.[_0x2c7a7b(0xf6)]())),_0x266f21=_0x2cc853[_0x2c7a7b(0xfe)]?.[_0x2c7a7b(0xfb)]||_0x2cc853[_0x2c7a7b(0xfb)]||_0x3b11f9;_0x10b2b4[_0x2c7a7b(0xf8)+_0x266f21]={'code':_0x3b11f9,'tableName':_0x266f21,'fieldCount':_0x5acf5e['size'],'fields':Array[_0x2c7a7b(0xe1)](_0x5acf5e)};}_0x23e2d6[_0x2c7a7b(0x103)]>0x0&&(_0x10b2b4[_0x2c7a7b(0xe4)]=_0x23e2d6);}return{'ok':_0xeff894[_0x2c7a7b(0x10c)],'data':_0x10b2b4,'message':_0xeff894[_0x2c7a7b(0x109)]};}};
1
+ const a133_0x1701fd=a133_0x68d8;(function(_0x2a4ec3,_0x4bded2){const _0x38ac9f=a133_0x68d8,_0x4bb6b0=_0x2a4ec3();while(!![]){try{const _0x47c287=-parseInt(_0x38ac9f(0x17f))/0x1*(-parseInt(_0x38ac9f(0x198))/0x2)+parseInt(_0x38ac9f(0x17a))/0x3+-parseInt(_0x38ac9f(0x1a0))/0x4+parseInt(_0x38ac9f(0x190))/0x5+parseInt(_0x38ac9f(0x180))/0x6+-parseInt(_0x38ac9f(0x192))/0x7+-parseInt(_0x38ac9f(0x193))/0x8*(parseInt(_0x38ac9f(0x183))/0x9);if(_0x47c287===_0x4bded2)break;else _0x4bb6b0['push'](_0x4bb6b0['shift']());}catch(_0xd1b855){_0x4bb6b0['push'](_0x4bb6b0['shift']());}}}(a133_0x3e62,0x5e6d7));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a133_0x68d8(_0x20a30d,_0x3848bb){_0x20a30d=_0x20a30d-0x17a;const _0x3e6206=a133_0x3e62();let _0x68d84b=_0x3e6206[_0x20a30d];return _0x68d84b;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a133_0x3e62(){const _0xee7fa=['valid','length','from','Provide\x20--file\x20or\x20--sql','trim','fields','reason','utf-8','validation','2661480nCynPT','Table\x20\x22','4876543PUDyOd','16jrLuKj','push','split','isDangerous','cwd','6CFVmUE','size','tables','appCode','flagMissing','schemaWarnings','SQL\x20schema\x20validation','toLowerCase','2283616rZjQbk','string','validate','schemas','filter','Dataset\x20\x22','tableName','sqlType','dbtableConfig','str','file','2241195BdXevt','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','get','message','216450ZqwEOp','757338nUJtSL','map','File\x20not\x20found:\x20','1802727xgKOWO','sql','type','isArray'];a133_0x3e62=function(){return _0xee7fa;};return a133_0x3e62();}export const sqlValidate={'service':a133_0x1701fd(0x184),'command':a133_0x1701fd(0x1a2),'description':a133_0x1701fd(0x17c),'risk':'read','flags':[{'name':a133_0x1701fd(0x1aa),'type':a133_0x1701fd(0x1a1),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a133_0x1701fd(0x184),'type':a133_0x1701fd(0x1a1),'description':a133_0x1701fd(0x17b)},{'name':a133_0x1701fd(0x1a3),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0xe5f604){const _0x4d65bc=a133_0x1701fd,_0x2cc82c=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x1aa)),_0x2d480a=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x184));if(!_0x2cc82c&&!_0x2d480a)throw CliErrors[_0x4d65bc(0x19c)]('file',_0x4d65bc(0x18a));let _0x5a0a42;if(_0x2cc82c){const _0x207b56=resolve(process[_0x4d65bc(0x197)](),_0x2cc82c);if(!existsSync(_0x207b56))throw CliErrors[_0x4d65bc(0x18f)](_0x4d65bc(0x182)+_0x207b56);_0x5a0a42=readFileSync(_0x207b56,_0x4d65bc(0x18e));}else _0x5a0a42=_0x2d480a;const _0xbbb99e=validateSql(_0x5a0a42),_0x490273={'valid':_0xbbb99e[_0x4d65bc(0x187)],'sqlType':_0xbbb99e['sqlType'][_0x4d65bc(0x185)],'isSelectOnly':_0xbbb99e[_0x4d65bc(0x1a7)]['isSelectOnly'],'isDangerous':_0xbbb99e[_0x4d65bc(0x1a7)][_0x4d65bc(0x196)],'tables':_0xbbb99e[_0x4d65bc(0x19a)],'parameters':_0xbbb99e['parameters'],'message':_0xbbb99e[_0x4d65bc(0x17e)]};_0xbbb99e[_0x4d65bc(0x1a7)]['reason']&&(_0x490273['reason']=_0xbbb99e[_0x4d65bc(0x1a7)][_0x4d65bc(0x18d)]);const _0x5058c1=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x1a3));if(_0x5058c1&&_0xbbb99e[_0x4d65bc(0x187)]){const _0x138030=_0x5058c1[_0x4d65bc(0x195)](',')[_0x4d65bc(0x181)](_0x411170=>_0x411170[_0x4d65bc(0x18b)]())[_0x4d65bc(0x1a4)](Boolean),_0x3ec4c3=[],_0x7e2f65=filterDbTableBackedDatasets(await listDatasets(_0xe5f604[_0x4d65bc(0x19b)])),_0x175707=new Map(_0x7e2f65[_0x4d65bc(0x181)](_0x236506=>[_0x236506[_0x4d65bc(0x1a8)]?.[_0x4d65bc(0x1a6)]?.['toLowerCase'](),_0x236506]));for(const _0x3af3e5 of _0xbbb99e[_0x4d65bc(0x19a)]){const _0x400108=_0x175707[_0x4d65bc(0x17d)](_0x3af3e5[_0x4d65bc(0x19f)]());!_0x400108&&_0x3ec4c3[_0x4d65bc(0x194)](_0x4d65bc(0x191)+_0x3af3e5+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x1036fb of _0x138030){let _0x323bbd;try{_0x323bbd=await getDatasetDetail(_0x1036fb);}catch{_0x3ec4c3[_0x4d65bc(0x194)](_0x4d65bc(0x1a5)+_0x1036fb+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x323bbd,_0x4d65bc(0x19e));const _0x1ca0fd=Array[_0x4d65bc(0x186)](_0x323bbd[_0x4d65bc(0x18c)])?_0x323bbd[_0x4d65bc(0x18c)]:[],_0x188af7=new Set(_0x1ca0fd[_0x4d65bc(0x181)](_0xcfc5ac=>_0xcfc5ac['name']?.['toLowerCase']())),_0x225299=_0x323bbd[_0x4d65bc(0x1a8)]?.[_0x4d65bc(0x1a6)]||_0x323bbd[_0x4d65bc(0x1a6)]||_0x1036fb;_0x490273['schema:'+_0x225299]={'code':_0x1036fb,'tableName':_0x225299,'fieldCount':_0x188af7[_0x4d65bc(0x199)],'fields':Array[_0x4d65bc(0x189)](_0x188af7)};}_0x3ec4c3[_0x4d65bc(0x188)]>0x0&&(_0x490273[_0x4d65bc(0x19d)]=_0x3ec4c3);}return{'ok':_0xbbb99e[_0x4d65bc(0x187)],'data':_0x490273,'message':_0xbbb99e[_0x4d65bc(0x17e)]};}};
@@ -1 +1 @@
1
- function a134_0x5f13(){const _0x2b7b1a=['map','accessKey','698484VBgrFV','Config\x20key\x20(','appcode','7InKnma','Risk\x20level','zh-CN','has','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','trim','apps','env','join','entries','defaultFormat','apiDir','en-US','9564651fNkxDC','30PagbLw','riskLevel','defaultApp','keys','21072WkMyox','Auth\x20cookie','locale','app','452301BlJYbo','string','3047350EigAxG','API\x20directory\x20path','cookie','format','length','6906376lpozan','Access\x20key','Target\x20environment','Locale','pageSize','Default\x20page\x20size','10UcvSOg','4857904kXuhHK','number'];a134_0x5f13=function(){return _0x2b7b1a;};return a134_0x5f13();}const a134_0x466daa=a134_0xeb69;(function(_0x4d282b,_0x46763e){const _0x58aef9=a134_0xeb69,_0x2c7c25=_0x4d282b();while(!![]){try{const _0x4ae08f=-parseInt(_0x58aef9(0x182))/0x1*(-parseInt(_0x58aef9(0x17e))/0x2)+-parseInt(_0x58aef9(0x186))/0x3+parseInt(_0x58aef9(0x169))/0x4+-parseInt(_0x58aef9(0x188))/0x5+-parseInt(_0x58aef9(0x16d))/0x6*(-parseInt(_0x58aef9(0x170))/0x7)+parseInt(_0x58aef9(0x162))/0x8+-parseInt(_0x58aef9(0x17d))/0x9*(parseInt(_0x58aef9(0x168))/0xa);if(_0x4ae08f===_0x46763e)break;else _0x2c7c25['push'](_0x2c7c25['shift']());}catch(_0x2e4d7c){_0x2c7c25['push'](_0x2c7c25['shift']());}}}(a134_0x5f13,0xa7cbb));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a134_0xeb69(_0x3f7f3b,_0x27ca82){_0x3f7f3b=_0x3f7f3b-0x15e;const _0x5f135c=a134_0x5f13();let _0xeb6973=_0x5f135c[_0x3f7f3b];return _0xeb6973;}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=[a134_0x466daa(0x15f),a134_0x466daa(0x16c),'locale',a134_0x466daa(0x160),a134_0x466daa(0x17f)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x466daa(0x16f),a134_0x466daa(0x177),'locale','format','cookie','accessKey',a134_0x466daa(0x17b)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x3a0d17){const _0x2af8b8=a134_0x466daa;return[..._0x3a0d17][_0x2af8b8(0x178)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x127075){const _0x55d818=a134_0x466daa;return TOP_LEVEL_CONFIG_KEYS[_0x55d818(0x173)](_0x127075);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x5c84e1=a134_0x466daa;return _0x5c84e1(0x16e)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a134_0x466daa(0x17b),'cookie':a134_0x466daa(0x15f),'accessKey':a134_0x466daa(0x16c),'defaultFormat':'format','pageSize':a134_0x466daa(0x166),'riskLevel':a134_0x466daa(0x17f),'locale':a134_0x466daa(0x184)};export function getAppProfileFlagDefs(){const _0xd5b2fd=a134_0x466daa;return[{'name':'env','type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x164),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x15e)},{'name':'cookie','type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x183),'hidden':!![]},{'name':_0xd5b2fd(0x16c),'type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x163),'hidden':!![]},{'name':_0xd5b2fd(0x17a),'type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x174),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0xd5b2fd(0x16a),'description':_0xd5b2fd(0x167)},{'name':_0xd5b2fd(0x17f),'type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x171),'enum':[...RISK_LEVEL_VALUES]},{'name':_0xd5b2fd(0x184),'type':_0xd5b2fd(0x187),'description':_0xd5b2fd(0x165)}];}export function collectAppProfileOverrides(_0x766497){const _0x4e3032=a134_0x466daa,_0x2431ed={};for(const [_0x233b72,_0xbc2b56]of Object[_0x4e3032(0x179)](APP_PROFILE_FLAG_KEY_MAP)){const _0x387f07=_0x766497(_0x233b72);if(!_0x387f07)continue;_0x2431ed[_0xbc2b56]=_0xbc2b56===_0x4e3032(0x166)?Number(_0x387f07):_0x387f07;}return _0x2431ed;}export function buildAppProfileListFields(_0x6269ef){const _0x33bf4a=a134_0x466daa;return{'env':_0x6269ef[_0x33bf4a(0x177)]??null,'apiDir':_0x6269ef[_0x33bf4a(0x17b)]??null,'hasCookie':!!_0x6269ef[_0x33bf4a(0x15f)],'hasAccessKey':!!_0x6269ef[_0x33bf4a(0x16c)],'format':_0x6269ef['format']??null,'pageSize':_0x6269ef[_0x33bf4a(0x166)]??null,'riskLevel':_0x6269ef[_0x33bf4a(0x17f)]??null,'locale':_0x6269ef[_0x33bf4a(0x184)]??null};}export function buildAppDoctorFields(_0x554fe6,_0x17cd6b){const _0x3eead9=a134_0x466daa;return{'env':{'value':_0x554fe6[_0x3eead9(0x177)]||_0x17cd6b['env'],'source':_0x554fe6['env']?_0x3eead9(0x185):'inherit'},'apiDir':{'value':_0x554fe6['apiDir']||_0x17cd6b[_0x3eead9(0x17b)],'source':_0x554fe6[_0x3eead9(0x17b)]?_0x3eead9(0x185):'inherit'},'cookie':{'value':_0x554fe6['cookie']||_0x17cd6b['cookie'],'source':_0x554fe6['cookie']?_0x3eead9(0x185):'inherit'},'accessKey':{'value':_0x554fe6['accessKey']||_0x17cd6b['accessKey'],'source':_0x554fe6[_0x3eead9(0x16c)]?_0x3eead9(0x185):'inherit'}};}export function buildCanonicalAppConfig(_0x58a203,_0x2c7502){const _0x30df05=a134_0x466daa,_0x426d7b=_0x58a203[_0x30df05(0x16b)](_0x29e741=>String(_0x29e741||'')[_0x30df05(0x175)]())['filter'](Boolean);if(_0x426d7b['length']===0x0)return{};const _0x7e0d2e={};for(const _0x47a96f of _0x426d7b){_0x7e0d2e[_0x47a96f]=_0x2c7502?{'appcode':_0x47a96f,'env':_0x2c7502}:{'appcode':_0x47a96f};}return{'apps':_0x7e0d2e,'defaultApp':_0x426d7b[0x0]};}export function buildCanonicalProjectConfig(_0x21c1d9,_0x3a527d){const _0x1b25db=a134_0x466daa,{appCodes:appCodes=[],env:_0x1527bb,metadata:_0x4f43c4}=_0x3a527d,_0x387fbe={..._0x21c1d9,..._0x4f43c4||{}};delete _0x387fbe[_0x1b25db(0x16f)],delete _0x387fbe[_0x1b25db(0x185)];if(_0x1527bb)_0x387fbe['env']=_0x1527bb;else!_0x387fbe[_0x1b25db(0x177)]&&(_0x387fbe[_0x1b25db(0x177)]=DEFAULT_CONFIG_VALUES[_0x1b25db(0x177)]);const _0x485acf=buildCanonicalAppConfig(appCodes,_0x387fbe[_0x1b25db(0x177)]);return Object[_0x1b25db(0x181)](_0x485acf)[_0x1b25db(0x161)]>0x0&&(_0x387fbe[_0x1b25db(0x176)]=_0x485acf[_0x1b25db(0x176)],_0x387fbe['defaultApp']=_0x485acf[_0x1b25db(0x180)]),_0x387fbe;}const LOCALE_MAP={'zh':a134_0x466daa(0x172),'zh-cn':a134_0x466daa(0x172),'zh_cn':a134_0x466daa(0x172),'en':'en-US','en-us':a134_0x466daa(0x17c),'en_us':a134_0x466daa(0x17c)};export function normalizeLocale(_0x492003){if(!_0x492003)return null;return LOCALE_MAP[_0x492003['toLowerCase']()]??null;}
1
+ const a134_0x3ce4d5=a134_0x465d;(function(_0x595389,_0x414695){const _0x480c89=a134_0x465d,_0x379779=_0x595389();while(!![]){try{const _0x4a86b5=-parseInt(_0x480c89(0xbf))/0x1*(parseInt(_0x480c89(0xa2))/0x2)+parseInt(_0x480c89(0xb0))/0x3*(parseInt(_0x480c89(0xa6))/0x4)+parseInt(_0x480c89(0xaf))/0x5+-parseInt(_0x480c89(0xb4))/0x6*(-parseInt(_0x480c89(0xc4))/0x7)+-parseInt(_0x480c89(0xbb))/0x8*(-parseInt(_0x480c89(0xab))/0x9)+parseInt(_0x480c89(0xa5))/0xa*(parseInt(_0x480c89(0xc2))/0xb)+-parseInt(_0x480c89(0xa3))/0xc;if(_0x4a86b5===_0x414695)break;else _0x379779['push'](_0x379779['shift']());}catch(_0x3f30a2){_0x379779['push'](_0x379779['shift']());}}}(a134_0x46aa,0x717dd));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=['cookie',a134_0x3ce4d5(0xb8),a134_0x3ce4d5(0xa0),a134_0x3ce4d5(0xac),a134_0x3ce4d5(0xb7)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x3ce4d5(0xbd),'env',a134_0x3ce4d5(0xa0),a134_0x3ce4d5(0xac),'cookie',a134_0x3ce4d5(0xb8),a134_0x3ce4d5(0xc0)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x49b4a4){return[..._0x49b4a4]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x41b3c9){const _0x14e97c=a134_0x3ce4d5;return TOP_LEVEL_CONFIG_KEYS[_0x14e97c(0xa7)](_0x41b3c9);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x3ce4d5(0xba),'apiDir':'apiDir','cookie':a134_0x3ce4d5(0xc1),'accessKey':a134_0x3ce4d5(0xb8),'defaultFormat':a134_0x3ce4d5(0xac),'pageSize':a134_0x3ce4d5(0xbc),'riskLevel':a134_0x3ce4d5(0xb7),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x58ad88=a134_0x3ce4d5;return[{'name':_0x58ad88(0xba),'type':_0x58ad88(0xad),'description':_0x58ad88(0xbe),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x58ad88(0xc0),'type':_0x58ad88(0xad),'description':_0x58ad88(0x9f)},{'name':_0x58ad88(0xc1),'type':'string','description':_0x58ad88(0xb5),'hidden':!![]},{'name':'accessKey','type':_0x58ad88(0xad),'description':'Access\x20key','hidden':!![]},{'name':'defaultFormat','type':_0x58ad88(0xad),'description':_0x58ad88(0xa9),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x58ad88(0xb9),'description':_0x58ad88(0xa4)},{'name':'riskLevel','type':'string','description':_0x58ad88(0xc5),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x58ad88(0xad),'description':_0x58ad88(0xa8)}];}export function collectAppProfileOverrides(_0x349a8d){const _0x17ae53=a134_0x3ce4d5,_0x2416d9={};for(const [_0x54ad4e,_0x303a8c]of Object[_0x17ae53(0xc7)](APP_PROFILE_FLAG_KEY_MAP)){const _0x4992aa=_0x349a8d(_0x54ad4e);if(!_0x4992aa)continue;_0x2416d9[_0x303a8c]=_0x303a8c===_0x17ae53(0xbc)?Number(_0x4992aa):_0x4992aa;}return _0x2416d9;}function a134_0x465d(_0x1bf94c,_0x5e8727){_0x1bf94c=_0x1bf94c-0x9f;const _0x46aab0=a134_0x46aa();let _0x465ddf=_0x46aab0[_0x1bf94c];return _0x465ddf;}export function buildAppProfileListFields(_0x32e92e){const _0xd6c303=a134_0x3ce4d5;return{'env':_0x32e92e[_0xd6c303(0xba)]??null,'apiDir':_0x32e92e[_0xd6c303(0xc0)]??null,'hasCookie':!!_0x32e92e[_0xd6c303(0xc1)],'hasAccessKey':!!_0x32e92e['accessKey'],'format':_0x32e92e['format']??null,'pageSize':_0x32e92e[_0xd6c303(0xbc)]??null,'riskLevel':_0x32e92e[_0xd6c303(0xb7)]??null,'locale':_0x32e92e[_0xd6c303(0xa0)]??null};}export function buildAppDoctorFields(_0x2c9e96,_0x2a7ecf){const _0x49a893=a134_0x3ce4d5;return{'env':{'value':_0x2c9e96[_0x49a893(0xba)]||_0x2a7ecf[_0x49a893(0xba)],'source':_0x2c9e96[_0x49a893(0xba)]?'app':'inherit'},'apiDir':{'value':_0x2c9e96[_0x49a893(0xc0)]||_0x2a7ecf[_0x49a893(0xc0)],'source':_0x2c9e96[_0x49a893(0xc0)]?_0x49a893(0xb6):'inherit'},'cookie':{'value':_0x2c9e96[_0x49a893(0xc1)]||_0x2a7ecf[_0x49a893(0xc1)],'source':_0x2c9e96[_0x49a893(0xc1)]?_0x49a893(0xb6):_0x49a893(0xb1)},'accessKey':{'value':_0x2c9e96[_0x49a893(0xb8)]||_0x2a7ecf[_0x49a893(0xb8)],'source':_0x2c9e96[_0x49a893(0xb8)]?'app':'inherit'}};}function a134_0x46aa(){const _0x5259a9=['cookie','2177659NexmNq','filter','5873ZynsWZ','Risk\x20level','map','entries','API\x20directory\x20path','locale','defaultApp','4768AWlQtS','5791764gsbvtV','Default\x20page\x20size','10JVNWpf','4Pzwdzp','has','Locale','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','keys','113193YyudWj','format','string','apps','3753225IivKkn','130908WCHUWA','inherit','toLowerCase','trim','954NfaGhR','Auth\x20cookie','app','riskLevel','accessKey','number','env','8rOazeJ','pageSize','appcode','Target\x20environment','80xGLBra','apiDir'];a134_0x46aa=function(){return _0x5259a9;};return a134_0x46aa();}export function buildCanonicalAppConfig(_0x459d85,_0x5b453e){const _0x342a92=a134_0x3ce4d5,_0x52455d=_0x459d85[_0x342a92(0xc6)](_0x1eee54=>String(_0x1eee54||'')[_0x342a92(0xb3)]())[_0x342a92(0xc3)](Boolean);if(_0x52455d['length']===0x0)return{};const _0x1228e3={};for(const _0x55fe78 of _0x52455d){_0x1228e3[_0x55fe78]=_0x5b453e?{'appcode':_0x55fe78,'env':_0x5b453e}:{'appcode':_0x55fe78};}return{'apps':_0x1228e3,'defaultApp':_0x52455d[0x0]};}export function buildCanonicalProjectConfig(_0x51666c,_0xddaf81){const _0x3a04f7=a134_0x3ce4d5,{appCodes:appCodes=[],env:_0x25d312,metadata:_0x569403}=_0xddaf81,_0x598960={..._0x51666c,..._0x569403||{}};delete _0x598960[_0x3a04f7(0xbd)],delete _0x598960[_0x3a04f7(0xb6)];if(_0x25d312)_0x598960[_0x3a04f7(0xba)]=_0x25d312;else!_0x598960['env']&&(_0x598960[_0x3a04f7(0xba)]=DEFAULT_CONFIG_VALUES[_0x3a04f7(0xba)]);const _0x3a14b4=buildCanonicalAppConfig(appCodes,_0x598960[_0x3a04f7(0xba)]);return Object[_0x3a04f7(0xaa)](_0x3a14b4)['length']>0x0&&(_0x598960[_0x3a04f7(0xae)]=_0x3a14b4['apps'],_0x598960[_0x3a04f7(0xa1)]=_0x3a14b4[_0x3a04f7(0xa1)]),_0x598960;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':'zh-CN','zh_cn':'zh-CN','en':'en-US','en-us':'en-US','en_us':'en-US'};export function normalizeLocale(_0x2468f9){const _0xc1f633=a134_0x3ce4d5;if(!_0x2468f9)return null;return LOCALE_MAP[_0x2468f9[_0xc1f633(0xb2)]()]??null;}
@@ -1 +1 @@
1
- function a135_0x542d(_0x206bdd,_0x3bdde1){_0x206bdd=_0x206bdd-0x194;const _0x2c32c6=a135_0x2c32();let _0x542d2c=_0x2c32c6[_0x206bdd];return _0x542d2c;}const a135_0x1c650b=a135_0x542d;(function(_0x5b20b0,_0x2e90db){const _0xf922a2=a135_0x542d,_0x4edc87=_0x5b20b0();while(!![]){try{const _0x52d48d=-parseInt(_0xf922a2(0x199))/0x1*(parseInt(_0xf922a2(0x194))/0x2)+parseInt(_0xf922a2(0x196))/0x3*(-parseInt(_0xf922a2(0x19b))/0x4)+parseInt(_0xf922a2(0x197))/0x5*(-parseInt(_0xf922a2(0x1a1))/0x6)+-parseInt(_0xf922a2(0x19e))/0x7*(-parseInt(_0xf922a2(0x19c))/0x8)+parseInt(_0xf922a2(0x19d))/0x9*(-parseInt(_0xf922a2(0x19f))/0xa)+-parseInt(_0xf922a2(0x19a))/0xb+-parseInt(_0xf922a2(0x195))/0xc*(-parseInt(_0xf922a2(0x198))/0xd);if(_0x52d48d===_0x2e90db)break;else _0x4edc87['push'](_0x4edc87['shift']());}catch(_0x41440d){_0x4edc87['push'](_0x4edc87['shift']());}}}(a135_0x2c32,0xe773d));function a135_0x2c32(){const _0x5db857=['7886664oRfZKE','13788rbhPOV','7HqjQQe','9550kToCHt','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','18vWNNVo','3368062YFjZlk','12GWQDUJ','14097eVIvry','2303325YEQcUt','63402664kwgSNA','1VqkWpf','1918301KxigqX','180xbhlqc'];a135_0x2c32=function(){return _0x5db857;};return a135_0x2c32();}export const CLI_VERSION_POLICY_URL=a135_0x1c650b(0x1a0);
1
+ const a135_0x272670=a135_0x432c;(function(_0x4a0629,_0x3a971f){const _0x9bba8c=a135_0x432c,_0x2a75dd=_0x4a0629();while(!![]){try{const _0x529a0b=parseInt(_0x9bba8c(0xf3))/0x1*(parseInt(_0x9bba8c(0xec))/0x2)+parseInt(_0x9bba8c(0xee))/0x3*(-parseInt(_0x9bba8c(0xf4))/0x4)+parseInt(_0x9bba8c(0xea))/0x5*(parseInt(_0x9bba8c(0xef))/0x6)+parseInt(_0x9bba8c(0xed))/0x7+parseInt(_0x9bba8c(0xf0))/0x8+-parseInt(_0x9bba8c(0xf1))/0x9+-parseInt(_0x9bba8c(0xf2))/0xa*(parseInt(_0x9bba8c(0xe9))/0xb);if(_0x529a0b===_0x3a971f)break;else _0x2a75dd['push'](_0x2a75dd['shift']());}catch(_0x3c4ca2){_0x2a75dd['push'](_0x2a75dd['shift']());}}}(a135_0x44f0,0xdc1be));function a135_0x432c(_0x2d4d10,_0xbb6ce8){_0x2d4d10=_0x2d4d10-0xe9;const _0x44f0cc=a135_0x44f0();let _0x432cd9=_0x44f0cc[_0x2d4d10];return _0x432cd9;}function a135_0x44f0(){const _0x8c9338=['https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','74026elzMqs','4857202chQJwo','606GvAvjf','27588sjYPkA','8524712dOlQRe','5618799ypXTaT','8285450Tpvfok','21dfhyJl','24916eTUhrR','11tsIKcR','1170ANpHUU'];a135_0x44f0=function(){return _0x8c9338;};return a135_0x44f0();}export const CLI_VERSION_POLICY_URL=a135_0x272670(0xeb);
@@ -1 +1 @@
1
- const a136_0x1ca71b=a136_0x3da0;function a136_0x3cda(){const _0x3ac42c=['sqlcode','682233kzBllh','description-file','Watch\x20mode','confirm','Target\x20path','Show\x20help','description','schemas','Config\x20value','4420440uOvCTb','sqlName','remote','dbId','DB\x20ID','Skip\x20confirmation\x20for\x20high-risk\x20writes','511068GnjHYC','sql-name','Schemas','4377456HQTbMO','JSON\x20params','16WMyGcN','Config\x20key','Environment','file','Function\x20node','page','code','operation-type','app','Confirm\x20destructive\x20action','help','global','Apply\x20to\x20all','expected-count','type','3062857GTDKPV','Dataset\x20code','meowKey','fromEntries','name','Output\x20format','title','1735714jTGqHN','functionNode','json\x20|\x20pretty\x20|\x20compress','Force\x20overwrite','Force\x20non-interactive\x20mode\x20(CI)','1105674AIFwsd','@lovrabet/rabetbase-cli','project','datasetcode','pagesize','env','sql','keyword','Output\x20path','SQL\x20string','SQL\x20code','output','SQL\x20name','watch','Expected\x20affected\x20count','yes','nonInteractive','operation','params','force','verbose','non-interactive','5IUBgdm','44hCTwcF','<code>','Skip\x20import\x20generation','key','dryRun','skip-imports','Enable\x20BFF\x20save','<name>','8qbkseT','Code\x20filter','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','string','dry-run','Description\x20file','value','function-node','format','10AOANpS','enableBffSave','Description','Override\x20appcode','Select\x20app\x20profile\x20by\x20name','boolean','production\x20|\x20daily','appcode','all','dbid','<expr>','sqlname','map','Operation\x20type','db-id','Alias\x20for\x20--non-interactive','clear'];a136_0x3cda=function(){return _0x3ac42c;};return a136_0x3cda();}(function(_0x200927,_0x491586){const _0x5b7b35=a136_0x3da0,_0x53bb4f=_0x200927();while(!![]){try{const _0x2cafd2=-parseInt(_0x5b7b35(0x21c))/0x1+parseInt(_0x5b7b35(0x246))/0x2+-parseInt(_0x5b7b35(0x22b))/0x3*(-parseInt(_0x5b7b35(0x201))/0x4)+parseInt(_0x5b7b35(0x1f8))/0x5*(parseInt(_0x5b7b35(0x24b))/0x6)+-parseInt(_0x5b7b35(0x23f))/0x7*(-parseInt(_0x5b7b35(0x230))/0x8)+parseInt(_0x5b7b35(0x22e))/0x9*(parseInt(_0x5b7b35(0x20a))/0xa)+-parseInt(_0x5b7b35(0x1f9))/0xb*(parseInt(_0x5b7b35(0x225))/0xc);if(_0x2cafd2===_0x491586)break;else _0x53bb4f['push'](_0x53bb4f['shift']());}catch(_0x51e088){_0x53bb4f['push'](_0x53bb4f['shift']());}}}(a136_0x3cda,0x9225d));function a136_0x3da0(_0x1d2269,_0x14368e){_0x1d2269=_0x1d2269-0x1eb;const _0x3cdaf3=a136_0x3cda();let _0x3da0cc=_0x3cdaf3[_0x1d2269];return _0x3da0cc;}export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME=a136_0x1ca71b(0x24c);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a136_0x1ca71b(0x211),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x20d),'hint':a136_0x1ca71b(0x1fa)},{'name':a136_0x1ca71b(0x238),'meowKey':a136_0x1ca71b(0x238),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x20e),'hint':a136_0x1ca71b(0x200)},{'name':a136_0x1ca71b(0x250),'meowKey':a136_0x1ca71b(0x250),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x232),'hint':a136_0x1ca71b(0x210)},{'name':a136_0x1ca71b(0x209),'meowKey':'format','type':'string','description':a136_0x1ca71b(0x244),'hint':a136_0x1ca71b(0x248)},{'name':'jq','meowKey':'jq','type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x203),'hint':a136_0x1ca71b(0x214)},{'name':a136_0x1ca71b(0x205),'meowKey':a136_0x1ca71b(0x1fd),'type':'boolean','description':'Preview\x20operation\x20without\x20executing'},{'name':a136_0x1ca71b(0x1f1),'meowKey':'yes','type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x22a)},{'name':a136_0x1ca71b(0x1f7),'meowKey':a136_0x1ca71b(0x1f2),'type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x24a)},{'name':a136_0x1ca71b(0x23b),'meowKey':a136_0x1ca71b(0x23b),'type':a136_0x1ca71b(0x20f),'description':'Use\x20global\x20config\x20scope'},{'name':a136_0x1ca71b(0x24d),'meowKey':a136_0x1ca71b(0x24d),'type':a136_0x1ca71b(0x20f),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x219),'hidden':!![]},{'name':a136_0x1ca71b(0x23a),'meowKey':'help','type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x221)},{'name':a136_0x1ca71b(0x243),'meowKey':a136_0x1ca71b(0x243),'type':a136_0x1ca71b(0x204),'description':'Name','hidden':!![]},{'name':'title','meowKey':a136_0x1ca71b(0x245),'type':a136_0x1ca71b(0x204),'description':'Title','hidden':!![]},{'name':a136_0x1ca71b(0x21a),'meowKey':'clear','type':a136_0x1ca71b(0x20f),'description':'Clear','hidden':!![]},{'name':a136_0x1ca71b(0x1ef),'meowKey':a136_0x1ca71b(0x1ef),'type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x21e),'hidden':!![]},{'name':a136_0x1ca71b(0x1ed),'meowKey':a136_0x1ca71b(0x1ed),'type':'string','description':a136_0x1ca71b(0x253),'hidden':!![]},{'name':a136_0x1ca71b(0x1f4),'meowKey':'params','type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x22f),'hidden':!![]},{'name':'datasetcode','meowKey':a136_0x1ca71b(0x24e),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x240),'hidden':!![]},{'name':'all','meowKey':a136_0x1ca71b(0x212),'type':'boolean','description':a136_0x1ca71b(0x23c),'hidden':!![]},{'name':'enable-bff-save','meowKey':a136_0x1ca71b(0x20b),'type':'boolean','description':a136_0x1ca71b(0x1ff),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x1ca71b(0x204),'description':'Record\x20ID','hidden':!![]},{'name':a136_0x1ca71b(0x23e),'meowKey':a136_0x1ca71b(0x23e),'type':a136_0x1ca71b(0x204),'description':'Type\x20filter','hidden':!![]},{'name':'file','meowKey':a136_0x1ca71b(0x233),'type':a136_0x1ca71b(0x204),'description':'File\x20path','hidden':!![]},{'name':a136_0x1ca71b(0x21b),'meowKey':a136_0x1ca71b(0x21b),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x1ec),'hidden':!![]},{'name':a136_0x1ca71b(0x22c),'meowKey':a136_0x1ca71b(0x226),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x1ee),'hidden':!![]},{'name':a136_0x1ca71b(0x215),'meowKey':'sqlname','type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x1ee),'hidden':!![]},{'name':a136_0x1ca71b(0x218),'meowKey':a136_0x1ca71b(0x228),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x229),'hidden':!![]},{'name':a136_0x1ca71b(0x213),'meowKey':a136_0x1ca71b(0x213),'type':a136_0x1ca71b(0x204),'description':'DB\x20ID','hidden':!![]},{'name':a136_0x1ca71b(0x222),'meowKey':a136_0x1ca71b(0x222),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x20c),'hidden':!![]},{'name':a136_0x1ca71b(0x21d),'meowKey':'descriptionFile','type':'string','description':a136_0x1ca71b(0x206),'hidden':!![]},{'name':a136_0x1ca71b(0x235),'meowKey':a136_0x1ca71b(0x235),'type':a136_0x1ca71b(0x204),'description':'Page\x20number','hidden':!![]},{'name':a136_0x1ca71b(0x24f),'meowKey':a136_0x1ca71b(0x24f),'type':a136_0x1ca71b(0x204),'description':'Page\x20size','hidden':!![]},{'name':a136_0x1ca71b(0x252),'meowKey':a136_0x1ca71b(0x252),'type':'string','description':'Keyword\x20filter','hidden':!![]},{'name':a136_0x1ca71b(0x236),'meowKey':a136_0x1ca71b(0x236),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x202),'hidden':!![]},{'name':a136_0x1ca71b(0x251),'meowKey':a136_0x1ca71b(0x251),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x1eb),'hidden':!![]},{'name':a136_0x1ca71b(0x223),'meowKey':a136_0x1ca71b(0x223),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x22d),'hidden':!![]},{'name':a136_0x1ca71b(0x1f3),'meowKey':a136_0x1ca71b(0x1f3),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x217),'hidden':!![]},{'name':'target','meowKey':'target','type':'string','description':a136_0x1ca71b(0x220),'hidden':!![]},{'name':a136_0x1ca71b(0x1fe),'meowKey':'skipImports','type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x1fb),'hidden':!![]},{'name':a136_0x1ca71b(0x1fc),'meowKey':a136_0x1ca71b(0x1fc),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x231),'hidden':!![]},{'name':a136_0x1ca71b(0x207),'meowKey':a136_0x1ca71b(0x207),'type':'string','description':a136_0x1ca71b(0x224),'hidden':!![]},{'name':a136_0x1ca71b(0x1f5),'meowKey':a136_0x1ca71b(0x1f5),'type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x249),'hidden':!![]},{'name':a136_0x1ca71b(0x21f),'meowKey':a136_0x1ca71b(0x21f),'type':a136_0x1ca71b(0x20f),'description':a136_0x1ca71b(0x239),'hidden':!![]},{'name':'remote','meowKey':a136_0x1ca71b(0x227),'type':a136_0x1ca71b(0x20f),'description':'Use\x20remote','hidden':!![]},{'name':a136_0x1ca71b(0x1f6),'meowKey':a136_0x1ca71b(0x1f6),'type':a136_0x1ca71b(0x20f),'description':'Verbose\x20output','hidden':!![]},{'name':a136_0x1ca71b(0x23d),'meowKey':'expectedCount','type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x1f0),'hidden':!![]},{'name':a136_0x1ca71b(0x237),'meowKey':'operationType','type':'string','description':'Operation\x20type','hidden':!![]},{'name':a136_0x1ca71b(0x208),'meowKey':a136_0x1ca71b(0x247),'type':a136_0x1ca71b(0x204),'description':a136_0x1ca71b(0x234),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x1ca71b(0x211),a136_0x1ca71b(0x238),a136_0x1ca71b(0x250),a136_0x1ca71b(0x209),'jq',a136_0x1ca71b(0x205),a136_0x1ca71b(0x1f1),a136_0x1ca71b(0x1f7),'ci']);export function buildMeowFlags(){const _0x5224e4=a136_0x1ca71b;return Object[_0x5224e4(0x242)](GLOBAL_FLAGS[_0x5224e4(0x216)](_0x115272=>[_0x115272[_0x5224e4(0x241)],{'type':_0x115272[_0x5224e4(0x23e)]}]));}
1
+ const a136_0x3a5096=a136_0x1b52;(function(_0x2d91c6,_0x3b5078){const _0x5244f1=a136_0x1b52,_0x30822f=_0x2d91c6();while(!![]){try{const _0x461258=-parseInt(_0x5244f1(0x173))/0x1*(-parseInt(_0x5244f1(0x11f))/0x2)+parseInt(_0x5244f1(0x125))/0x3*(parseInt(_0x5244f1(0x14e))/0x4)+-parseInt(_0x5244f1(0x129))/0x5*(parseInt(_0x5244f1(0x167))/0x6)+-parseInt(_0x5244f1(0x13a))/0x7*(-parseInt(_0x5244f1(0x126))/0x8)+-parseInt(_0x5244f1(0x12b))/0x9+parseInt(_0x5244f1(0x136))/0xa+-parseInt(_0x5244f1(0x117))/0xb;if(_0x461258===_0x3b5078)break;else _0x30822f['push'](_0x30822f['shift']());}catch(_0x31a3b8){_0x30822f['push'](_0x30822f['shift']());}}}(a136_0x238f,0x624fa));export const CLI_BIN_NAME=a136_0x3a5096(0x166);export const CLI_DISPLAY_NAME=a136_0x3a5096(0x11e);export const NPM_PACKAGE_NAME=a136_0x3a5096(0x11c);function a136_0x238f(){const _0x8f7b92=['non-interactive','watch','db-id','Target\x20path','DB\x20ID','help','Environment','pagesize','sqlcode','appcode','value','format','3314839bGEeAh','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','enable-bff-save','dry-run','Description','@lovrabet/rabetbase-cli','Skip\x20confirmation\x20for\x20high-risk\x20writes','Rabetbase\x20CLI','2WQffQg','operationType','enableBffSave','Preview\x20operation\x20without\x20executing','meowKey','yes','15WOupfs','3236248WrUZGm','Page\x20number','Title','25LQlUlD','nonInteractive','6775191WSGQYZ','Expected\x20affected\x20count','map','title','Alias\x20for\x20--non-interactive','force','string','Keyword\x20filter','Use\x20remote','boolean','Type\x20filter','7101130KaZgdu','Dataset\x20code','Output\x20format','datasetcode','7tjizvy','Enable\x20BFF\x20save','sqlName','SQL\x20name','Force\x20overwrite','project','clear','remote','target','type','expectedCount','name','Verbose\x20output','description','Use\x20project\x20config\x20scope','expected-count','code','functionNode','Record\x20ID','Show\x20help','91828txaaIV','app','dryRun','Config\x20key','Watch\x20mode','Override\x20appcode','dbid','sql','schemas','Clear','<expr>','key','SQL\x20code','verbose','operation','JSON\x20params','Schemas','Config\x20value','env','Name','descriptionFile','Confirm\x20destructive\x20action','sqlname','description-file','rabetbase','579318ErkFou','dbId','json\x20|\x20pretty\x20|\x20compress','fromEntries','Apply\x20to\x20all','all','page','<name>','SQL\x20string','File\x20path','Page\x20size','output','710166enNFdr','confirm'];a136_0x238f=function(){return _0x8f7b92;};return a136_0x238f();}function a136_0x1b52(_0x41b7f5,_0x33dc64){_0x41b7f5=_0x41b7f5-0x10f;const _0x238f79=a136_0x238f();let _0x1b523a=_0x238f79[_0x41b7f5];return _0x1b523a;}export const GLOBAL_FLAGS=[{'name':a136_0x3a5096(0x114),'meowKey':'appcode','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x153),'hint':'<code>'},{'name':'app','meowKey':a136_0x3a5096(0x14f),'type':a136_0x3a5096(0x131),'description':'Select\x20app\x20profile\x20by\x20name','hint':a136_0x3a5096(0x16e)},{'name':a136_0x3a5096(0x160),'meowKey':a136_0x3a5096(0x160),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x111),'hint':'production\x20|\x20daily'},{'name':a136_0x3a5096(0x116),'meowKey':a136_0x3a5096(0x116),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x138),'hint':a136_0x3a5096(0x169)},{'name':'jq','meowKey':'jq','type':'string','description':a136_0x3a5096(0x118),'hint':a136_0x3a5096(0x158)},{'name':a136_0x3a5096(0x11a),'meowKey':a136_0x3a5096(0x150),'type':'boolean','description':a136_0x3a5096(0x122)},{'name':'yes','meowKey':'yes','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x11d)},{'name':a136_0x3a5096(0x175),'meowKey':a136_0x3a5096(0x12a),'type':a136_0x3a5096(0x134),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':'global','type':a136_0x3a5096(0x134),'description':'Use\x20global\x20config\x20scope'},{'name':a136_0x3a5096(0x13f),'meowKey':'project','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x148)},{'name':'ci','meowKey':'ci','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x12f),'hidden':!![]},{'name':a136_0x3a5096(0x110),'meowKey':a136_0x3a5096(0x110),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x14d)},{'name':a136_0x3a5096(0x145),'meowKey':a136_0x3a5096(0x145),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x161),'hidden':!![]},{'name':a136_0x3a5096(0x12e),'meowKey':a136_0x3a5096(0x12e),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x128),'hidden':!![]},{'name':a136_0x3a5096(0x140),'meowKey':a136_0x3a5096(0x140),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x157),'hidden':!![]},{'name':'watch','meowKey':a136_0x3a5096(0x176),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x152),'hidden':!![]},{'name':a136_0x3a5096(0x172),'meowKey':'output','type':'string','description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':'params','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15d),'hidden':!![]},{'name':a136_0x3a5096(0x139),'meowKey':a136_0x3a5096(0x139),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x137),'hidden':!![]},{'name':a136_0x3a5096(0x16c),'meowKey':a136_0x3a5096(0x16c),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x16b),'hidden':!![]},{'name':a136_0x3a5096(0x119),'meowKey':a136_0x3a5096(0x121),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x13b),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x14c),'hidden':!![]},{'name':a136_0x3a5096(0x143),'meowKey':a136_0x3a5096(0x143),'type':'string','description':a136_0x3a5096(0x135),'hidden':!![]},{'name':'file','meowKey':'file','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x170),'hidden':!![]},{'name':a136_0x3a5096(0x113),'meowKey':a136_0x3a5096(0x113),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15a),'hidden':!![]},{'name':'sql-name','meowKey':a136_0x3a5096(0x13c),'type':'string','description':a136_0x3a5096(0x13d),'hidden':!![]},{'name':'sqlname','meowKey':a136_0x3a5096(0x164),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x13d),'hidden':!![]},{'name':a136_0x3a5096(0x177),'meowKey':a136_0x3a5096(0x168),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x10f),'hidden':!![]},{'name':a136_0x3a5096(0x154),'meowKey':'dbid','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x10f),'hidden':!![]},{'name':a136_0x3a5096(0x147),'meowKey':'description','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x11b),'hidden':!![]},{'name':a136_0x3a5096(0x165),'meowKey':a136_0x3a5096(0x162),'type':a136_0x3a5096(0x131),'description':'Description\x20file','hidden':!![]},{'name':a136_0x3a5096(0x16d),'meowKey':a136_0x3a5096(0x16d),'type':'string','description':a136_0x3a5096(0x127),'hidden':!![]},{'name':a136_0x3a5096(0x112),'meowKey':a136_0x3a5096(0x112),'type':'string','description':a136_0x3a5096(0x171),'hidden':!![]},{'name':'keyword','meowKey':'keyword','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x132),'hidden':!![]},{'name':a136_0x3a5096(0x14a),'meowKey':a136_0x3a5096(0x14a),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':a136_0x3a5096(0x155),'meowKey':a136_0x3a5096(0x155),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x16f),'hidden':!![]},{'name':'schemas','meowKey':a136_0x3a5096(0x156),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15e),'hidden':!![]},{'name':a136_0x3a5096(0x15c),'meowKey':a136_0x3a5096(0x15c),'type':'string','description':'Operation\x20type','hidden':!![]},{'name':a136_0x3a5096(0x142),'meowKey':'target','type':'string','description':a136_0x3a5096(0x178),'hidden':!![]},{'name':'skip-imports','meowKey':'skipImports','type':a136_0x3a5096(0x134),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a136_0x3a5096(0x159),'meowKey':a136_0x3a5096(0x159),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x151),'hidden':!![]},{'name':a136_0x3a5096(0x115),'meowKey':a136_0x3a5096(0x115),'type':'string','description':a136_0x3a5096(0x15f),'hidden':!![]},{'name':'force','meowKey':a136_0x3a5096(0x130),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x13e),'hidden':!![]},{'name':a136_0x3a5096(0x174),'meowKey':a136_0x3a5096(0x174),'type':'boolean','description':a136_0x3a5096(0x163),'hidden':!![]},{'name':a136_0x3a5096(0x141),'meowKey':a136_0x3a5096(0x141),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x133),'hidden':!![]},{'name':a136_0x3a5096(0x15b),'meowKey':'verbose','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x146),'hidden':!![]},{'name':a136_0x3a5096(0x149),'meowKey':a136_0x3a5096(0x144),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x12c),'hidden':!![]},{'name':'operation-type','meowKey':a136_0x3a5096(0x120),'type':a136_0x3a5096(0x131),'description':'Operation\x20type','hidden':!![]},{'name':'function-node','meowKey':a136_0x3a5096(0x14b),'type':a136_0x3a5096(0x131),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x3a5096(0x114),'app',a136_0x3a5096(0x160),a136_0x3a5096(0x116),'jq',a136_0x3a5096(0x11a),a136_0x3a5096(0x124),a136_0x3a5096(0x175),'ci']);export function buildMeowFlags(){const _0x758373=a136_0x3a5096;return Object[_0x758373(0x16a)](GLOBAL_FLAGS[_0x758373(0x12d)](_0x8587c7=>[_0x8587c7[_0x758373(0x123)],{'type':_0x8587c7[_0x758373(0x143)]}]));}
@@ -1 +1 @@
1
- const a137_0x425dd7=a137_0xb5f4;function a137_0xb5f4(_0x4ac7b1,_0x3b6beb){_0x4ac7b1=_0x4ac7b1-0xeb;const _0x499322=a137_0x4993();let _0xb5f43a=_0x499322[_0x4ac7b1];return _0xb5f43a;}(function(_0x4a1889,_0x44f616){const _0x2c3088=a137_0xb5f4,_0x464c09=_0x4a1889();while(!![]){try{const _0x3c5928=-parseInt(_0x2c3088(0xee))/0x1*(parseInt(_0x2c3088(0xf4))/0x2)+-parseInt(_0x2c3088(0xf1))/0x3*(-parseInt(_0x2c3088(0xef))/0x4)+-parseInt(_0x2c3088(0xf7))/0x5+parseInt(_0x2c3088(0xf8))/0x6*(-parseInt(_0x2c3088(0xf6))/0x7)+parseInt(_0x2c3088(0xf0))/0x8+-parseInt(_0x2c3088(0xeb))/0x9+-parseInt(_0x2c3088(0xec))/0xa*(-parseInt(_0x2c3088(0xf2))/0xb);if(_0x3c5928===_0x44f616)break;else _0x464c09['push'](_0x464c09['shift']());}catch(_0x5398c6){_0x464c09['push'](_0x464c09['shift']());}}}(a137_0x4993,0xe96b1));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':a137_0x425dd7(0xf3),'locale':a137_0x425dd7(0xf5),'riskLevel':a137_0x425dd7(0xed),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';function a137_0x4993(){const _0x54d13c=['compress','7258PrOVhg','en-US','367997CyHoFl','4665125IGxKpo','138skKJoY','3093255ZdYOYO','10fPVWmN','high-risk-write','307mobbpB','3023236tHcFjG','9678408VjjXXp','6cuJUZI','20180798UoikWg'];a137_0x4993=function(){return _0x54d13c;};return a137_0x4993();}
1
+ function a137_0x2f93(){const _0x39d698=['production','high-risk-write','46432MGCgVA','292621ZWsstJ','124228wNxIrl','227066BNUJGa','compress','555828GppjqV','907660UfslfH','36dbYkSV','en-US','3uhIkVa','364002sWhdEa'];a137_0x2f93=function(){return _0x39d698;};return a137_0x2f93();}const a137_0x10258d=a137_0x43f6;(function(_0x3727b5,_0x410720){const _0x4983c5=a137_0x43f6,_0x2823eb=_0x3727b5();while(!![]){try{const _0x5779ab=-parseInt(_0x4983c5(0xf0))/0x1+-parseInt(_0x4983c5(0xf4))/0x2*(-parseInt(_0x4983c5(0xeb))/0x3)+parseInt(_0x4983c5(0xf1))/0x4+parseInt(_0x4983c5(0xf5))/0x5+parseInt(_0x4983c5(0xec))/0x6+-parseInt(_0x4983c5(0xf2))/0x7+-parseInt(_0x4983c5(0xef))/0x8*(parseInt(_0x4983c5(0xf6))/0x9);if(_0x5779ab===_0x410720)break;else _0x2823eb['push'](_0x2823eb['shift']());}catch(_0x29555c){_0x2823eb['push'](_0x2823eb['shift']());}}}(a137_0x2f93,0x3188f));function a137_0x43f6(_0xee446e,_0x4ccc9c){_0xee446e=_0xee446e-0xea;const _0x2f93e6=a137_0x2f93();let _0x43f663=_0x2f93e6[_0xee446e];return _0x43f663;}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a137_0x10258d(0xed),'format':a137_0x10258d(0xf3),'locale':a137_0x10258d(0xea),'riskLevel':a137_0x10258d(0xee),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a137_0x10258d(0xf3);
@@ -1 +1 @@
1
- function a138_0x54d8(){const _0x2fb3bd=['1512660VyQBAO','20SwTJCv','runtimeDomain','/app/','apiDomain','https://daily-runtime.lovrabet.com','28015mSqZBv','trim','/web-app/app/','12165040Kxzpxi','https://runtime.lovrabet.com','https://user-daily.lovrabet.com','12ANoQVT','userDomain','1338EfADLy','https://api.lovrabet.com','1092650mVMjan','151702nDvloJ','12486591LtyJCe','7FZpIAp','https://daily-api.lovrabet.com','36857348lxOnxw'];a138_0x54d8=function(){return _0x2fb3bd;};return a138_0x54d8();}const a138_0x2ea072=a138_0x2e0d;function a138_0x2e0d(_0x95ac4f,_0x204ca2){_0x95ac4f=_0x95ac4f-0x1e7;const _0x54d8e3=a138_0x54d8();let _0x2e0d90=_0x54d8e3[_0x95ac4f];return _0x2e0d90;}(function(_0x27404a,_0x150650){const _0x4208fd=a138_0x2e0d,_0x2deff1=_0x27404a();while(!![]){try{const _0x1276c4=parseInt(_0x4208fd(0x1f5))/0x1*(parseInt(_0x4208fd(0x1fb))/0x2)+parseInt(_0x4208fd(0x1f0))/0x3*(parseInt(_0x4208fd(0x1fa))/0x4)+parseInt(_0x4208fd(0x1ea))/0x5*(parseInt(_0x4208fd(0x1f2))/0x6)+parseInt(_0x4208fd(0x1f7))/0x7*(-parseInt(_0x4208fd(0x1ed))/0x8)+parseInt(_0x4208fd(0x1f6))/0x9+parseInt(_0x4208fd(0x1f4))/0xa+-parseInt(_0x4208fd(0x1f9))/0xb;if(_0x1276c4===_0x150650)break;else _0x2deff1['push'](_0x2deff1['shift']());}catch(_0x2978a4){_0x2deff1['push'](_0x2deff1['shift']());}}}(a138_0x54d8,0xdcd43));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x3fa793){const _0x172cc6=a138_0x2e0d;customApiDomain=_0x3fa793?.[_0x172cc6(0x1e8)],customUserDomain=_0x3fa793?.[_0x172cc6(0x1f1)],customRuntimeDomain=_0x3fa793?.[_0x172cc6(0x1fc)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a138_0x2ea072(0x1ef));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x2ea072(0x1f3):a138_0x2ea072(0x1f8));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x2ea072(0x1ee):a138_0x2ea072(0x1e9));export const getAppDomain=()=>isProduction(getEnv())?'https://app.lovrabet.com':'https://daily.lovrabet.com';export const getAppBaseUrl=_0x480d57=>{const _0x4bd8c5=a138_0x2ea072,_0x58b0fb=encodeURIComponent(_0x480d57[_0x4bd8c5(0x1eb)]());return isProduction(getEnv())?getAppDomain()+_0x4bd8c5(0x1e7)+_0x58b0fb:getAppDomain()+_0x4bd8c5(0x1ec)+_0x58b0fb;};
1
+ const a138_0x375f3a=a138_0x2b98;(function(_0x2c7720,_0x5a1ea3){const _0x499668=a138_0x2b98,_0x1b4f64=_0x2c7720();while(!![]){try{const _0x48ae02=parseInt(_0x499668(0x158))/0x1*(parseInt(_0x499668(0x15b))/0x2)+-parseInt(_0x499668(0x14a))/0x3*(parseInt(_0x499668(0x15a))/0x4)+-parseInt(_0x499668(0x14c))/0x5*(parseInt(_0x499668(0x162))/0x6)+parseInt(_0x499668(0x14f))/0x7*(-parseInt(_0x499668(0x156))/0x8)+parseInt(_0x499668(0x155))/0x9*(-parseInt(_0x499668(0x15d))/0xa)+-parseInt(_0x499668(0x14e))/0xb+parseInt(_0x499668(0x151))/0xc*(parseInt(_0x499668(0x161))/0xd);if(_0x48ae02===_0x5a1ea3)break;else _0x1b4f64['push'](_0x1b4f64['shift']());}catch(_0x59e16d){_0x1b4f64['push'](_0x1b4f64['shift']());}}}(a138_0x2e14,0x5ac93));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a138_0x2b98(_0x16c43a,_0x612c65){_0x16c43a=_0x16c43a-0x14a;const _0x2e145e=a138_0x2e14();let _0x2b98d9=_0x2e145e[_0x16c43a];return _0x2b98d9;}export function initDomains(_0x564db5){const _0x5279d6=a138_0x2b98;customApiDomain=_0x564db5?.[_0x5279d6(0x159)],customUserDomain=_0x564db5?.[_0x5279d6(0x150)],customRuntimeDomain=_0x564db5?.[_0x5279d6(0x15f)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a138_0x375f3a(0x157));function a138_0x2e14(){const _0x411c72=['1119DMBhNj','/web-app/app/','70yeTcEH','https://daily.lovrabet.com','2590060rRjLbd','6699yGWkck','userDomain','72bMBoqt','https://daily-runtime.lovrabet.com','https://api.lovrabet.com','/app/','9paQywd','3304EQbqQT','https://user-daily.lovrabet.com','155546WuFLPu','apiDomain','4588mzygcf','4GbCocJ','https://runtime.lovrabet.com','4279490PyMFTK','https://daily-api.lovrabet.com','runtimeDomain','trim','4555057sRJRfn','237894ORqmCw'];a138_0x2e14=function(){return _0x411c72;};return a138_0x2e14();}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x375f3a(0x153):a138_0x375f3a(0x15e));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x375f3a(0x15c):a138_0x375f3a(0x152));export const getAppDomain=()=>isProduction(getEnv())?'https://app.lovrabet.com':a138_0x375f3a(0x14d);export const getAppBaseUrl=_0x121189=>{const _0x2ed78d=a138_0x375f3a,_0x22a4b6=encodeURIComponent(_0x121189[_0x2ed78d(0x160)]());return isProduction(getEnv())?getAppDomain()+_0x2ed78d(0x154)+_0x22a4b6:getAppDomain()+_0x2ed78d(0x14b)+_0x22a4b6;};
@@ -1 +1 @@
1
- const a139_0x3cb259=a139_0x53ef;function a139_0x52ef(){const _0x2a52a9=['1831312axfKnM','1865026lGvZLE','530600KdExKV','dev','9555ikLjQP','10449796XazGPe','25312716SeHTYS','3ArrdCW','online','production','1247875ZhzVID','daily','development','3930QMfOpx'];a139_0x52ef=function(){return _0x2a52a9;};return a139_0x52ef();}(function(_0x2efdd8,_0x5b4a4d){const _0x264d4c=a139_0x53ef,_0x29055f=_0x2efdd8();while(!![]){try{const _0xdbee3c=-parseInt(_0x264d4c(0x1ea))/0x1+parseInt(_0x264d4c(0x1ef))/0x2*(-parseInt(_0x264d4c(0x1e7))/0x3)+parseInt(_0x264d4c(0x1e2))/0x4+-parseInt(_0x264d4c(0x1e4))/0x5*(-parseInt(_0x264d4c(0x1ed))/0x6)+-parseInt(_0x264d4c(0x1e5))/0x7+parseInt(_0x264d4c(0x1ee))/0x8+parseInt(_0x264d4c(0x1e6))/0x9;if(_0xdbee3c===_0x5b4a4d)break;else _0x29055f['push'](_0x29055f['shift']());}catch(_0x3ac2c5){_0x29055f['push'](_0x29055f['shift']());}}}(a139_0x52ef,0xb7bc1));export const RABETBASE_ENV_VALUES=[a139_0x3cb259(0x1e9),a139_0x3cb259(0x1eb)];export function normalizeEnv(_0x370176){const _0x4c9a84=a139_0x3cb259;return _0x370176===_0x4c9a84(0x1e8)?_0x4c9a84(0x1e9):_0x370176;}export function isProduction(_0x36f146){const _0x10a4e3=a139_0x3cb259;return normalizeEnv(_0x36f146)===_0x10a4e3(0x1e9);}export function isDaily(_0x2c911f){return normalizeEnv(_0x2c911f)==='daily';}export function isDev(_0xa849c4){const _0x515257=a139_0x3cb259,_0x2e0fb0=normalizeEnv(_0xa849c4);return _0x2e0fb0===_0x515257(0x1ec)||_0x2e0fb0===_0x515257(0x1e3);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}function a139_0x53ef(_0x556c94,_0x30b682){_0x556c94=_0x556c94-0x1e2;const _0x52ef7b=a139_0x52ef();let _0x53ef60=_0x52ef7b[_0x556c94];return _0x53ef60;}export function initEnv(_0x160075){env=normalizeEnv(_0x160075);}
1
+ const a139_0x15845f=a139_0x5516;(function(_0x233849,_0x1ae42b){const _0x1d3659=a139_0x5516,_0x21bf1a=_0x233849();while(!![]){try{const _0x35ccc8=-parseInt(_0x1d3659(0x175))/0x1*(-parseInt(_0x1d3659(0x17d))/0x2)+parseInt(_0x1d3659(0x17e))/0x3+-parseInt(_0x1d3659(0x173))/0x4*(-parseInt(_0x1d3659(0x176))/0x5)+-parseInt(_0x1d3659(0x174))/0x6+-parseInt(_0x1d3659(0x178))/0x7*(-parseInt(_0x1d3659(0x172))/0x8)+parseInt(_0x1d3659(0x17a))/0x9*(-parseInt(_0x1d3659(0x17c))/0xa)+parseInt(_0x1d3659(0x180))/0xb*(-parseInt(_0x1d3659(0x179))/0xc);if(_0x35ccc8===_0x1ae42b)break;else _0x21bf1a['push'](_0x21bf1a['shift']());}catch(_0x113eb3){_0x21bf1a['push'](_0x21bf1a['shift']());}}}(a139_0x233f,0x6f6d1));function a139_0x5516(_0x1a4036,_0x2766a3){_0x1a4036=_0x1a4036-0x172;const _0x233f29=a139_0x233f();let _0x55169a=_0x233f29[_0x1a4036];return _0x55169a;}export const RABETBASE_ENV_VALUES=[a139_0x15845f(0x17f),a139_0x15845f(0x177)];export function normalizeEnv(_0x562508){const _0x57c724=a139_0x15845f;return _0x562508===_0x57c724(0x17b)?_0x57c724(0x17f):_0x562508;}export function isProduction(_0x31ddd0){const _0x3db968=a139_0x15845f;return normalizeEnv(_0x31ddd0)===_0x3db968(0x17f);}export function isDaily(_0x504a6a){const _0x5cbc52=a139_0x15845f;return normalizeEnv(_0x504a6a)===_0x5cbc52(0x177);}export function isDev(_0xefc3f3){const _0x43c192=normalizeEnv(_0xefc3f3);return _0x43c192==='development'||_0x43c192==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}export function initEnv(_0x216429){env=normalizeEnv(_0x216429);}function a139_0x233f(){const _0x5577d7=['8LmoRzt','1852592PBKPed','2931342Yfvgja','362wWTChd','5EEyGWW','daily','5493271GAepvA','1754436TAlrau','423VTEvIt','online','166510sFRoym','3918BehcNy','188706uOMqGP','production','22GToFKn'];a139_0x233f=function(){return _0x5577d7;};return a139_0x233f();}
@@ -1 +1 @@
1
- function a140_0x26ea(_0x570dd0,_0x38e4ff){_0x570dd0=_0x570dd0-0x1a9;const _0x18601a=a140_0x1860();let _0x26ead0=_0x18601a[_0x570dd0];return _0x26ead0;}(function(_0x4748c3,_0x49ce0a){const _0x9e43f5=a140_0x26ea,_0x5022c1=_0x4748c3();while(!![]){try{const _0x5107f3=-parseInt(_0x9e43f5(0x1b3))/0x1*(-parseInt(_0x9e43f5(0x1aa))/0x2)+-parseInt(_0x9e43f5(0x1ae))/0x3+-parseInt(_0x9e43f5(0x1af))/0x4*(-parseInt(_0x9e43f5(0x1b0))/0x5)+parseInt(_0x9e43f5(0x1ac))/0x6*(-parseInt(_0x9e43f5(0x1ad))/0x7)+-parseInt(_0x9e43f5(0x1b1))/0x8*(-parseInt(_0x9e43f5(0x1b2))/0x9)+parseInt(_0x9e43f5(0x1ab))/0xa+-parseInt(_0x9e43f5(0x1a9))/0xb;if(_0x5107f3===_0x49ce0a)break;else _0x5022c1['push'](_0x5022c1['shift']());}catch(_0x47ba5b){_0x5022c1['push'](_0x5022c1['shift']());}}}(a140_0x1860,0xdb9d7));export const RABETBASE_OUTPUT_FORMAT_VALUES=['json','pretty','compress'];function a140_0x1860(){const _0x2782da=['11gqotJM','6215022rLtzpC','101032EQeMFY','17656390khUGEJ','3858XLtDTX','6083gRQDEh','4020759TOqFkF','3240yXeUPu','1405CeQgEd','2176WMuOZu','26955kDulBE'];a140_0x1860=function(){return _0x2782da;};return a140_0x1860();}
1
+ function a140_0x1e77(_0x2c39d7,_0x111a49){_0x2c39d7=_0x2c39d7-0xf7;const _0x36f9b2=a140_0x36f9();let _0x1e7788=_0x36f9b2[_0x2c39d7];return _0x1e7788;}const a140_0x3dd3c1=a140_0x1e77;function a140_0x36f9(){const _0x4303b4=['53806hIRBjW','8JFYWdy','16vNwBgY','2118776pKlAhl','compress','4266773RFrAJE','15gfUvFw','12519scuHgA','399260NMWREw','2319399HnUiNg','pretty','4596wLCIgP','3LlOrmH','33edOxpH','906474HqGivB'];a140_0x36f9=function(){return _0x4303b4;};return a140_0x36f9();}(function(_0x129459,_0x530189){const _0x58f340=a140_0x1e77,_0x11b042=_0x129459();while(!![]){try{const _0x34635b=-parseInt(_0x58f340(0x103))/0x1*(parseInt(_0x58f340(0x105))/0x2)+-parseInt(_0x58f340(0x100))/0x3*(parseInt(_0x58f340(0xf7))/0x4)+-parseInt(_0x58f340(0xfa))/0x5*(-parseInt(_0x58f340(0x102))/0x6)+parseInt(_0x58f340(0xf9))/0x7+parseInt(_0x58f340(0x104))/0x8*(-parseInt(_0x58f340(0xfd))/0x9)+-parseInt(_0x58f340(0xfc))/0xa*(-parseInt(_0x58f340(0x101))/0xb)+parseInt(_0x58f340(0xff))/0xc*(parseInt(_0x58f340(0xfb))/0xd);if(_0x34635b===_0x530189)break;else _0x11b042['push'](_0x11b042['shift']());}catch(_0x3ec214){_0x11b042['push'](_0x11b042['shift']());}}}(a140_0x36f9,0x516da));export const RABETBASE_OUTPUT_FORMAT_VALUES=['json',a140_0x3dd3c1(0xfe),a140_0x3dd3c1(0xf8)];
@@ -1 +1 @@
1
- function a141_0x27ca(_0x40de6d,_0x820784){_0x40de6d=_0x40de6d-0x1ce;const _0xdfc547=a141_0xdfc5();let _0x27cacd=_0xdfc547[_0x40de6d];return _0x27cacd;}(function(_0x3b5bed,_0xacfbb3){const _0x44e5aa=a141_0x27ca,_0x5f13b7=_0x3b5bed();while(!![]){try{const _0x485f9c=-parseInt(_0x44e5aa(0x1d0))/0x1*(parseInt(_0x44e5aa(0x1ce))/0x2)+-parseInt(_0x44e5aa(0x1d6))/0x3*(-parseInt(_0x44e5aa(0x1d5))/0x4)+-parseInt(_0x44e5aa(0x1d7))/0x5+-parseInt(_0x44e5aa(0x1cf))/0x6*(parseInt(_0x44e5aa(0x1d1))/0x7)+-parseInt(_0x44e5aa(0x1d8))/0x8+parseInt(_0x44e5aa(0x1d2))/0x9*(-parseInt(_0x44e5aa(0x1d9))/0xa)+parseInt(_0x44e5aa(0x1d4))/0xb*(parseInt(_0x44e5aa(0x1d3))/0xc);if(_0x485f9c===_0xacfbb3)break;else _0x5f13b7['push'](_0x5f13b7['shift']());}catch(_0x130cdc){_0x5f13b7['push'](_0x5f13b7['shift']());}}}(a141_0xdfc5,0x4ba86));export const DEFAULT_API_DIR='./src/api';function a141_0xdfc5(){const _0x4ea3c1=['4097872CueWgB','5000XZSKJs','8DycyIs','373794yuTCkc','62743PDgpsw','7hxTRzf','9882pLJcbA','24878424gABUCO','11xlnPnE','11468UbXpeB','213EvNQNK','2961800rNVdyy'];a141_0xdfc5=function(){return _0x4ea3c1;};return a141_0xdfc5();}
1
+ const a141_0x580441=a141_0x5d2d;function a141_0x5d2d(_0x45feab,_0x16015e){_0x45feab=_0x45feab-0x19f;const _0x190599=a141_0x1905();let _0x5d2dfc=_0x190599[_0x45feab];return _0x5d2dfc;}(function(_0x3dcef4,_0x3a23eb){const _0x4fb707=a141_0x5d2d,_0xe01221=_0x3dcef4();while(!![]){try{const _0x2ba53b=-parseInt(_0x4fb707(0x1aa))/0x1*(-parseInt(_0x4fb707(0x1a4))/0x2)+parseInt(_0x4fb707(0x1a8))/0x3+-parseInt(_0x4fb707(0x1a0))/0x4+-parseInt(_0x4fb707(0x1a2))/0x5*(-parseInt(_0x4fb707(0x19f))/0x6)+parseInt(_0x4fb707(0x1a1))/0x7*(-parseInt(_0x4fb707(0x1a5))/0x8)+parseInt(_0x4fb707(0x1a9))/0x9+parseInt(_0x4fb707(0x1a7))/0xa*(parseInt(_0x4fb707(0x1a3))/0xb);if(_0x2ba53b===_0x3a23eb)break;else _0xe01221['push'](_0xe01221['shift']());}catch(_0x4eb881){_0xe01221['push'](_0xe01221['shift']());}}}(a141_0x1905,0x77ed6));function a141_0x1905(){const _0x2a7b2e=['8120160JJpqfT','1ypdSLO','222LyplDU','3652268cYyFRp','12908WSSFfH','14590MFcjNZ','11AsZTPr','1084226PvASZf','3144PoohLf','./src/api','1682230SJdugP','1225317APkSAh'];a141_0x1905=function(){return _0x2a7b2e;};return a141_0x1905();}export const DEFAULT_API_DIR=a141_0x580441(0x1a6);
@@ -1 +1 @@
1
- const a142_0xda1ea4=a142_0x2a20;function a142_0x1c15(){const _0x323a8c=['10cfDGOm','26rEiczG','111654QhToyG','2007824CNgWPA','43248aCdmHE','873860UDUZxc','789324clkiZH','364878bTHWhv','high-risk-write','88KyjEig','288PLVPSk','1326ssOmmh'];a142_0x1c15=function(){return _0x323a8c;};return a142_0x1c15();}(function(_0x554fe1,_0x588013){const _0x35b282=a142_0x2a20,_0x572874=_0x554fe1();while(!![]){try{const _0x39ba94=parseInt(_0x35b282(0x1cd))/0x1*(-parseInt(_0x35b282(0x1cf))/0x2)+-parseInt(_0x35b282(0x1c9))/0x3+parseInt(_0x35b282(0x1c8))/0x4+parseInt(_0x35b282(0x1ce))/0x5*(-parseInt(_0x35b282(0x1c4))/0x6)+-parseInt(_0x35b282(0x1c5))/0x7+-parseInt(_0x35b282(0x1c6))/0x8*(parseInt(_0x35b282(0x1cc))/0x9)+parseInt(_0x35b282(0x1c7))/0xa*(parseInt(_0x35b282(0x1cb))/0xb);if(_0x39ba94===_0x588013)break;else _0x572874['push'](_0x572874['shift']());}catch(_0x566662){_0x572874['push'](_0x572874['shift']());}}}(a142_0x1c15,0x3f9a1));function a142_0x2a20(_0x36bdd2,_0x20cb05){_0x36bdd2=_0x36bdd2-0x1c4;const _0x1c158e=a142_0x1c15();let _0x2a2089=_0x1c158e[_0x36bdd2];return _0x2a2089;}export const RISK_LEVEL_VALUES=['read','write',a142_0xda1ea4(0x1ca)];
1
+ const a142_0x3fac10=a142_0x5188;function a142_0x5188(_0x505c2e,_0x2823ba){_0x505c2e=_0x505c2e-0x84;const _0x78f816=a142_0x78f8();let _0x51882d=_0x78f816[_0x505c2e];return _0x51882d;}(function(_0x58d02f,_0x1c89a7){const _0x2cdcd6=a142_0x5188,_0x1a5fa2=_0x58d02f();while(!![]){try{const _0x4a095d=parseInt(_0x2cdcd6(0x8d))/0x1*(-parseInt(_0x2cdcd6(0x8c))/0x2)+-parseInt(_0x2cdcd6(0x85))/0x3+parseInt(_0x2cdcd6(0x8a))/0x4+-parseInt(_0x2cdcd6(0x87))/0x5*(parseInt(_0x2cdcd6(0x84))/0x6)+parseInt(_0x2cdcd6(0x8b))/0x7+parseInt(_0x2cdcd6(0x88))/0x8+parseInt(_0x2cdcd6(0x89))/0x9;if(_0x4a095d===_0x1c89a7)break;else _0x1a5fa2['push'](_0x1a5fa2['shift']());}catch(_0x7163e3){_0x1a5fa2['push'](_0x1a5fa2['shift']());}}}(a142_0x78f8,0x3534e));export const RISK_LEVEL_VALUES=[a142_0x3fac10(0x86),'write','high-risk-write'];function a142_0x78f8(){const _0x5014b9=['2326dbjJBq','115OagFfm','54uCbXlf','581127GlouEF','read','95305TsecSy','1164296OvznaW','1408437ktnnFN','1178424kReryE','842107NXvgbo'];a142_0x78f8=function(){return _0x5014b9;};return a142_0x78f8();}