@lovrabet/rabetbase-cli 2.3.2 → 2.3.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/flags.js +1 -1
  48. package/lib/commands/common/validate.js +1 -1
  49. package/lib/commands/config/get.js +1 -1
  50. package/lib/commands/config/index.js +1 -1
  51. package/lib/commands/config/list.js +1 -1
  52. package/lib/commands/config/set.js +1 -1
  53. package/lib/commands/config/shared.js +1 -1
  54. package/lib/commands/data/filter.js +1 -1
  55. package/lib/commands/data/getOne.js +1 -1
  56. package/lib/commands/data/index.js +1 -1
  57. package/lib/commands/data/shared.js +1 -1
  58. package/lib/commands/dataset/business-group-update.js +1 -1
  59. package/lib/commands/dataset/capability.js +1 -1
  60. package/lib/commands/dataset/delete.js +1 -1
  61. package/lib/commands/dataset/detail.js +1 -1
  62. package/lib/commands/dataset/extend-update.js +1 -1
  63. package/lib/commands/dataset/field-update.js +1 -1
  64. package/lib/commands/dataset/generate.js +1 -0
  65. package/lib/commands/dataset/index.js +1 -1
  66. package/lib/commands/dataset/list.js +1 -1
  67. package/lib/commands/dataset/operations.js +1 -1
  68. package/lib/commands/dataset/relation-audit.js +1 -1
  69. package/lib/commands/dataset/relation-create.js +1 -1
  70. package/lib/commands/dataset/relation-delete.js +1 -1
  71. package/lib/commands/dataset/relation-shared.js +1 -1
  72. package/lib/commands/dataset/relation-update.js +1 -1
  73. package/lib/commands/dataset/relations.js +1 -1
  74. package/lib/commands/dataset/rename.js +1 -1
  75. package/lib/commands/dataset/restore.js +1 -1
  76. package/lib/commands/db/analyze-cancel.js +1 -1
  77. package/lib/commands/db/analyze-start.js +1 -1
  78. package/lib/commands/db/analyze-status.js +1 -1
  79. package/lib/commands/db/create.js +1 -1
  80. package/lib/commands/db/delete.js +1 -1
  81. package/lib/commands/db/detail.js +1 -1
  82. package/lib/commands/db/diff.js +1 -1
  83. package/lib/commands/db/index.js +1 -1
  84. package/lib/commands/db/list.js +1 -1
  85. package/lib/commands/db/shared.js +1 -1
  86. package/lib/commands/db/tables.js +1 -1
  87. package/lib/commands/db/test.js +1 -1
  88. package/lib/commands/db/update.js +1 -1
  89. package/lib/commands/doctor.js +1 -1
  90. package/lib/commands/init/index.js +1 -1
  91. package/lib/commands/issue/index.js +1 -1
  92. package/lib/commands/issue/nudge.js +1 -1
  93. package/lib/commands/issue/report.js +1 -1
  94. package/lib/commands/issue/shared.js +1 -1
  95. package/lib/commands/logs/index.js +1 -1
  96. package/lib/commands/menu/index.js +1 -1
  97. package/lib/commands/menu/list.js +1 -1
  98. package/lib/commands/menu/shared/compare-table.js +1 -1
  99. package/lib/commands/menu/shared/index.js +1 -1
  100. package/lib/commands/menu/shared/inquirer.js +1 -1
  101. package/lib/commands/menu/shared/local-pages.js +1 -1
  102. package/lib/commands/menu/shared/logic.js +1 -1
  103. package/lib/commands/menu/shared/service.js +1 -1
  104. package/lib/commands/menu/shared/sync-core.js +1 -1
  105. package/lib/commands/menu/shared/update-core.js +1 -1
  106. package/lib/commands/menu/shared/valid-url.js +1 -1
  107. package/lib/commands/menu/sync.js +1 -1
  108. package/lib/commands/menu/update.js +1 -1
  109. package/lib/commands/page/generate-start.js +1 -1
  110. package/lib/commands/page/generate-status.js +1 -1
  111. package/lib/commands/page/index.js +1 -1
  112. package/lib/commands/page/pull.js +1 -1
  113. package/lib/commands/page/push.js +1 -1
  114. package/lib/commands/page/relation-audit.js +1 -1
  115. package/lib/commands/page/shared.js +1 -1
  116. package/lib/commands/page/standard-page-status.js +1 -1
  117. package/lib/commands/page/sync.js +1 -1
  118. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  119. package/lib/commands/project/create/format-elapsed.js +1 -1
  120. package/lib/commands/project/create/main.js +1 -1
  121. package/lib/commands/project/create/non-interactive.js +1 -1
  122. package/lib/commands/project/create/project-template-path.js +1 -1
  123. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  124. package/lib/commands/project/create/use-format-code.js +1 -1
  125. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  126. package/lib/commands/project/index.js +1 -1
  127. package/lib/commands/project/init.js +1 -1
  128. package/lib/commands/project/upgrade.js +1 -1
  129. package/lib/commands/registry.js +1 -1
  130. package/lib/commands/run/index.js +1 -1
  131. package/lib/commands/schema.js +1 -1
  132. package/lib/commands/sql/create.js +1 -1
  133. package/lib/commands/sql/delete.js +1 -1
  134. package/lib/commands/sql/detail.js +1 -1
  135. package/lib/commands/sql/exec.js +1 -1
  136. package/lib/commands/sql/index.js +1 -1
  137. package/lib/commands/sql/list.js +1 -1
  138. package/lib/commands/sql/pull.js +1 -1
  139. package/lib/commands/sql/push.js +1 -1
  140. package/lib/commands/sql/save.js +1 -1
  141. package/lib/commands/sql/shared.js +1 -1
  142. package/lib/commands/sql/status.js +1 -1
  143. package/lib/commands/sql/validate.js +1 -1
  144. package/lib/commands/workspace/index.js +1 -1
  145. package/lib/config/schema.js +1 -1
  146. package/lib/constant/cdn.js +1 -1
  147. package/lib/constant/cli.js +1 -1
  148. package/lib/constant/defaults.js +1 -1
  149. package/lib/constant/domain.js +1 -1
  150. package/lib/constant/env.js +1 -1
  151. package/lib/constant/output.js +1 -1
  152. package/lib/constant/paths.js +1 -1
  153. package/lib/constant/risk.js +1 -1
  154. package/lib/context/app-resolver.js +1 -1
  155. package/lib/context/auth-resolver.js +1 -1
  156. package/lib/context/config-loader.js +1 -1
  157. package/lib/context.js +1 -1
  158. package/lib/core/alias-resolver.js +1 -1
  159. package/lib/core/api-client.js +1 -1
  160. package/lib/core/bff/config.js +1 -1
  161. package/lib/core/bff/file-system.js +1 -1
  162. package/lib/core/bff/hash.js +1 -1
  163. package/lib/core/bff/lock.js +1 -1
  164. package/lib/core/bff/utils.js +1 -1
  165. package/lib/core/db-resolver.js +1 -1
  166. package/lib/core/page/file-system.js +1 -1
  167. package/lib/core/page/hash.js +1 -1
  168. package/lib/core/page/lock.js +1 -1
  169. package/lib/core/sql-sync/config.js +1 -1
  170. package/lib/core/sql-sync/file-system.js +1 -1
  171. package/lib/core/sql-sync/hash.js +1 -1
  172. package/lib/core/sql-sync/lock.js +1 -1
  173. package/lib/core/sql-sync/utils.js +1 -1
  174. package/lib/core/sql-validator.js +1 -1
  175. package/lib/errors.js +1 -1
  176. package/lib/framework/build-all-flags.js +1 -1
  177. package/lib/framework/flags.js +1 -1
  178. package/lib/framework/help.js +1 -1
  179. package/lib/framework/index.js +1 -1
  180. package/lib/framework/output.js +1 -1
  181. package/lib/framework/response.js +1 -1
  182. package/lib/framework/runner-alias.js +1 -1
  183. package/lib/framework/runner.js +1 -1
  184. package/lib/framework/schema-export.js +1 -1
  185. package/lib/framework/types.js +1 -1
  186. package/lib/generated/build-info.js +1 -1
  187. package/lib/help.js +1 -1
  188. package/lib/skills/main.js +1 -1
  189. package/lib/skills/npx-skills-add.js +1 -1
  190. package/lib/telemetry/cli-command-trace.js +1 -1
  191. package/lib/telemetry/cli-help-trace.js +1 -1
  192. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  193. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  194. package/lib/telemetry/send-cli-trace-log.js +1 -1
  195. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  196. package/lib/utils/ai_config.js +1 -1
  197. package/lib/utils/apply-jq-filter.js +1 -1
  198. package/lib/utils/cdn-config.js +1 -1
  199. package/lib/utils/check-sdk-version.js +1 -1
  200. package/lib/utils/cli-version-check.js +1 -1
  201. package/lib/utils/cli-version-policy.js +1 -1
  202. package/lib/utils/config.js +1 -1
  203. package/lib/utils/copy-directory.js +1 -1
  204. package/lib/utils/entity-with-id.js +1 -1
  205. package/lib/utils/file-utils.js +1 -1
  206. package/lib/utils/guides-cdn.js +1 -1
  207. package/lib/utils/http-client.js +1 -1
  208. package/lib/utils/is-non-interactive.js +1 -1
  209. package/lib/utils/logger.js +1 -1
  210. package/lib/utils/params.js +1 -1
  211. package/lib/utils/platform.js +1 -1
  212. package/lib/utils/rules-cdn.js +1 -1
  213. package/lib/utils/sleep.js +1 -1
  214. package/lib/utils/template-replacer.js +1 -1
  215. package/lib/utils/update-notice.js +1 -1
  216. package/lib/utils/version.js +1 -1
  217. package/lib/utils/with-active-cookie.js +1 -1
  218. package/lib/utils/write-cli-side-channel.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a137_0x52ed0d=a137_0x2ddd;(function(_0x599918,_0x1066b9){const _0x51107e=a137_0x2ddd,_0x55689a=_0x599918();while(!![]){try{const _0x6e2d97=-parseInt(_0x51107e(0xcc))/0x1+-parseInt(_0x51107e(0xff))/0x2+-parseInt(_0x51107e(0xe7))/0x3*(-parseInt(_0x51107e(0xfc))/0x4)+parseInt(_0x51107e(0x103))/0x5+parseInt(_0x51107e(0xf5))/0x6+-parseInt(_0x51107e(0xe0))/0x7*(parseInt(_0x51107e(0xdf))/0x8)+parseInt(_0x51107e(0xf9))/0x9*(parseInt(_0x51107e(0xf6))/0xa);if(_0x6e2d97===_0x1066b9)break;else _0x55689a['push'](_0x55689a['shift']());}catch(_0xccaa2){_0x55689a['push'](_0x55689a['shift']());}}}(a137_0x8a10,0x45253));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 a137_0x8a10(){const _0x6dcdb9=['Force\x20overwrite\x20local\x20unsynced\x20changes','unchanged','pull','dbId','appCode','Force\x20pull\x20cancelled.','boolean','8dPXSqE','408093qkomqy','sqlRoot','apps','force','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','push','utf8','1692663DVJGcF','POST','sqlRootDir','length','totalCount','test','Pull\x20complete:\x20','replace','lockFilePath','\x20written,\x20','bool','filter','catch','sqlName','294894RIZWwA','71590OmXBqQ','message','sqlContent','36afXZsA','Would\x20pull\x20','split','4SLamaq','string','local\x20differs\x20from\x20remote','402022GSewCw','toISOString','sqlCode','description','1352000wpdfSt','lastSync','Filter\x20by\x20SQL\x20display\x20name','str','sql','skipped','sqls','conflict','369877lnPntI','sqlcode','join','No\x20remote\x20SQL\x20queries\x20matched.','cancelled','nonInteractive','\x20failed','path','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','write','name','mybatisXml'];a137_0x8a10=function(){return _0x6dcdb9;};return a137_0x8a10();}async function fetchAllSqlQueries(_0xd287,_0x3e0a82){const _0x36d7c8=a137_0x2ddd,_0x288aef=[];let _0x5e690d=0x1;while(!![]){const _0x121c01=await listSqlQueries(_0xd287,{'currentPage':_0x5e690d,'pageSize':PAGE_SIZE,'sqlCode':_0x3e0a82['sqlCode'],'sqlName':_0x3e0a82['sqlName']}),_0x220fe5=_0x121c01['tableData']??[];_0x288aef[_0x36d7c8(0xe5)](..._0x220fe5);if(_0x220fe5['length']===0x0)break;const _0x3d2a41=_0x121c01['paging']?.[_0x36d7c8(0xeb)];if(_0x3d2a41!=null?_0x288aef[_0x36d7c8(0xea)]>=_0x3d2a41:_0x220fe5[_0x36d7c8(0xea)]<PAGE_SIZE)break;_0x5e690d++;}return _0x288aef;}async function ensureSqlContent(_0x2305b0){const _0x698b16=a137_0x2ddd;if(_0x2305b0[_0x698b16(0xf8)]!=null&&String(_0x2305b0[_0x698b16(0xf8)])['length']>0x0)return _0x2305b0;return getSqlQueryDetail(_0x2305b0[_0x698b16(0x101)]);}export const sqlPull={'service':a137_0x52ed0d(0xc8),'command':a137_0x52ed0d(0xda),'description':a137_0x52ed0d(0xe4),'risk':a137_0x52ed0d(0xd5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a137_0x52ed0d(0xd6),'type':a137_0x52ed0d(0xfd),'description':a137_0x52ed0d(0x105)},{'name':'force','type':a137_0x52ed0d(0xde),'description':a137_0x52ed0d(0xd8)}],async 'dryRun'(_0x28d1df){const _0x5d4207=a137_0x52ed0d,_0x120554=loadSqlProjectConfig(_0x28d1df[_0x5d4207(0xdc)]),_0x39bd00=await readSqlLockFile(_0x120554[_0x5d4207(0xef)]),{appLock:_0x1fee3b}=ensureSqlLockScope(_0x39bd00??createEmptySqlLock(),_0x120554[_0x5d4207(0xdc)],_0x120554[_0x5d4207(0xe1)],_0x5d4207(0xda)),_0x3cc443=await fetchAllSqlQueries(_0x28d1df[_0x5d4207(0xdc)],{'sqlCode':_0x28d1df[_0x5d4207(0xc7)](_0x5d4207(0xcd))||undefined,'sqlName':_0x28d1df[_0x5d4207(0xc7)](_0x5d4207(0xd6))||undefined}),_0x393f90=[];for(const _0x4e3e91 of _0x3cc443){const _0x2a4871=await ensureSqlContent(_0x4e3e91),_0x4dad24=ensureRemoteSqlContent(_0x2a4871),_0x50ee0c=detectModeFromSql(_0x2a4871),_0x324993=_0x2a4871[_0x5d4207(0xdb)]?await getDbName(_0x28d1df['appCode'],Number(_0x2a4871[_0x5d4207(0xdb)]))[_0x5d4207(0xf3)](()=>undefined):undefined,_0x3a0be7=buildLocalSqlFileContent({'sqlCode':_0x2a4871[_0x5d4207(0x101)],'sqlName':_0x2a4871[_0x5d4207(0xf4)],'dbId':_0x2a4871['dbId']},_0x4dad24,{'dbName':_0x324993,'mode':_0x50ee0c,'syncedAt':new Date()['toISOString'](),'description':_0x2a4871['description']}),_0x1b9c80=buildSqlLockEntry(_0x2a4871,_0x4dad24,'',{'dbName':_0x324993}),_0x1dac34=resolveLocalSqlFilePath(_0x120554,_0x2a4871[_0x5d4207(0x101)],_0x1b9c80);let _0x273308='would_pull',_0x13e2f1;if(await fileExists(_0x1dac34)){const _0x59cf00=await readFile(_0x1dac34,'utf8');isEquivalentPulledSqlFile(_0x59cf00,_0x3a0be7,_0x50ee0c)?(_0x273308=_0x5d4207(0xc9),_0x13e2f1=_0x5d4207(0xd9)):(_0x273308=_0x5d4207(0xcb),_0x13e2f1='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x393f90['push']({'sqlCode':_0x2a4871[_0x5d4207(0x101)],'sqlName':_0x2a4871[_0x5d4207(0xf4)],'filePath':_0x1dac34,'status':_0x273308,'reason':_0x13e2f1});}return{'method':_0x5d4207(0xe8),'url':_0x5d4207(0xd4),'body':{'appCode':_0x28d1df[_0x5d4207(0xdc)],'sqlCode':_0x28d1df[_0x5d4207(0xc7)](_0x5d4207(0xcd))||null,'sqlName':_0x28d1df['str'](_0x5d4207(0xd6))||null,'files':_0x393f90},'description':_0x5d4207(0xfa)+_0x393f90[_0x5d4207(0xea)]+'\x20SQL\x20file(s)\x20into\x20'+_0x120554[_0x5d4207(0xe9)]};},async 'execute'(_0x1f8f0f){const _0x13108e=a137_0x52ed0d,_0x714696=loadSqlProjectConfig(_0x1f8f0f[_0x13108e(0xdc)]),_0x4d085f=await readSqlLockFile(_0x714696[_0x13108e(0xef)]),{lockData:_0x12c315,appLock:_0x58ebc3}=ensureSqlLockScope(_0x4d085f??createEmptySqlLock(),_0x714696[_0x13108e(0xdc)],_0x714696[_0x13108e(0xe1)],_0x13108e(0xda)),_0x19312e=_0x1f8f0f[_0x13108e(0xf1)](_0x13108e(0xe3)),_0x9eab67=await fetchAllSqlQueries(_0x1f8f0f[_0x13108e(0xdc)],{'sqlCode':_0x1f8f0f['str'](_0x13108e(0xcd))||undefined,'sqlName':_0x1f8f0f[_0x13108e(0xc7)](_0x13108e(0xd6))||undefined});if(_0x9eab67[_0x13108e(0xea)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x13108e(0xcf)};const _0x9c0848=[],_0x584699=[];for(const _0x5a1f94 of _0x9eab67){try{_0x9c0848[_0x13108e(0xe5)](await ensureSqlContent(_0x5a1f94));}catch(_0x4434e1){_0x584699[_0x13108e(0xe5)]({'sqlCode':_0x5a1f94['sqlCode'],'error':_0x4434e1 instanceof Error?_0x4434e1[_0x13108e(0xf7)]:String(_0x4434e1)});}}if(_0x19312e&&!_0x1f8f0f[_0x13108e(0xd1)]){let _0x46d7b3=![];for(const _0x250016 of _0x9c0848){const _0x5d6f79=detectModeFromSql(_0x250016),_0x389a02=_0x250016['dbId']?await getDbName(_0x1f8f0f[_0x13108e(0xdc)],Number(_0x250016[_0x13108e(0xdb)]))[_0x13108e(0xf3)](()=>undefined):undefined,_0x1a3a2b=buildLocalSqlFileContent({'sqlCode':_0x250016[_0x13108e(0x101)],'sqlName':_0x250016[_0x13108e(0xf4)],'dbId':_0x250016['dbId']},ensureRemoteSqlContent(_0x250016),{'dbName':_0x389a02,'mode':_0x5d6f79,'syncedAt':new Date()[_0x13108e(0x100)](),'description':_0x250016['description']}),_0x2794a3=resolveLocalSqlFilePath(_0x714696,_0x250016['sqlCode'],buildSqlLockEntry(_0x250016,ensureRemoteSqlContent(_0x250016),'',{'dbName':_0x389a02}));if(await fileExists(_0x2794a3)){const _0x1c2c8b=await readFile(_0x2794a3,_0x13108e(0xe6));if(!isEquivalentPulledSqlFile(_0x1c2c8b,_0x1a3a2b,_0x5d6f79)){_0x46d7b3=!![];break;}}}if(_0x46d7b3){const _0x2e47ce=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x2e47ce)throw CliErrors[_0x13108e(0xd0)](_0x13108e(0xdd));}}const _0x31bcc5=cloneSqlLockData(_0x12c315),_0x152b41=_0x31bcc5[_0x13108e(0xe2)][_0x714696[_0x13108e(0xdc)]],_0x522af9=[],_0x23de16=[];for(const _0x5db5f6 of _0x9c0848){const _0x4a130a=_0x152b41['sqls'][_0x5db5f6[_0x13108e(0x101)]],_0x220ffa=ensureRemoteSqlContent(_0x5db5f6),_0x170c8b=detectModeFromSql(_0x5db5f6),_0x26f685=_0x5db5f6[_0x13108e(0xdb)]?await getDbName(_0x1f8f0f['appCode'],Number(_0x5db5f6[_0x13108e(0xdb)]))[_0x13108e(0xf3)](()=>undefined):undefined,_0x518cd5=buildLocalSqlFileContent({'sqlCode':_0x5db5f6[_0x13108e(0x101)],'sqlName':_0x5db5f6[_0x13108e(0xf4)],'dbId':_0x5db5f6[_0x13108e(0xdb)]},_0x220ffa,{'dbName':_0x26f685,'mode':_0x170c8b,'syncedAt':new Date()[_0x13108e(0x100)](),'description':_0x5db5f6[_0x13108e(0x102)]}),_0x72c4e3=buildSqlLockEntry(_0x5db5f6,_0x220ffa,computeSqlContentHash(_0x518cd5),{'dbName':_0x26f685}),_0x175d25=_0x72c4e3[_0x13108e(0xd3)],_0x5697cd=join(_0x714696['sqlRootDir'],_0x175d25);try{if(await fileExists(_0x5697cd)){const _0x164c0f=await readFile(_0x5697cd,'utf8');if(isEquivalentPulledSqlFile(_0x164c0f,_0x518cd5,_0x170c8b)){_0x23de16[_0x13108e(0xe5)]({'sqlCode':_0x5db5f6[_0x13108e(0x101)],'reason':'unchanged'}),_0x152b41[_0x13108e(0xca)][_0x5db5f6[_0x13108e(0x101)]]={..._0x72c4e3,'hash':computeSqlContentHash(_0x164c0f),'path':_0x175d25};continue;}if(!_0x19312e){_0x23de16[_0x13108e(0xe5)]({'sqlCode':_0x5db5f6[_0x13108e(0x101)],'reason':_0x13108e(0xfe)});continue;}}const _0x1699cd=_0x4a130a?.[_0x13108e(0xd3)]?join(_0x714696['sqlRootDir'],_0x4a130a[_0x13108e(0xd3)]):undefined;_0x1699cd&&_0x1699cd!==_0x5697cd&&await fileExists(_0x1699cd)&&await rm(_0x1699cd,{'force':!![]}),await ensureParentDirectory(_0x5697cd),await writeFile(_0x5697cd,_0x518cd5,_0x13108e(0xe6)),_0x152b41[_0x13108e(0xca)][_0x5db5f6[_0x13108e(0x101)]]={..._0x72c4e3,'path':_0x175d25},_0x522af9['push']({'sqlCode':_0x5db5f6[_0x13108e(0x101)],'filePath':_0x5697cd});}catch(_0x22ae34){_0x584699['push']({'sqlCode':_0x5db5f6['sqlCode'],'error':_0x22ae34 instanceof Error?_0x22ae34[_0x13108e(0xf7)]:String(_0x22ae34)});}}return _0x152b41[_0x13108e(0x104)]=new Date()[_0x13108e(0x100)](),await writeSqlLockFile(_0x714696['lockFilePath'],_0x31bcc5),{'ok':_0x584699[_0x13108e(0xea)]===0x0,'data':{'pulled':_0x522af9,'skipped':_0x23de16,'failed':_0x584699},'message':_0x13108e(0xed)+_0x522af9['length']+_0x13108e(0xf0)+_0x23de16[_0x13108e(0xea)]+'\x20skipped,\x20'+_0x584699['length']+_0x13108e(0xd2)};}};function detectModeFromSql(_0x43a8e3){const _0x4aac31=a137_0x52ed0d,_0xd2d002=ensureRemoteSqlContent(_0x43a8e3),_0x4acd37=stripLocalSqlMetadata(_0xd2d002,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x4acd37))return _0x4aac31(0xd7);return _0x4aac31(0xc8);}function isEquivalentPulledSqlFile(_0xca8080,_0x2d06fe,_0x449dcb){return normalizePullComparableContent(_0xca8080,_0x449dcb)===normalizePullComparableContent(_0x2d06fe,_0x449dcb);}function a137_0x2ddd(_0x342f87,_0x5b0320){_0x342f87=_0x342f87-0xc7;const _0x8a108f=a137_0x8a10();let _0x2dddae=_0x8a108f[_0x342f87];return _0x2dddae;}function normalizePullComparableContent(_0x10e7e5,_0xd1870e){const _0x38d3b0=a137_0x52ed0d,_0x2bf58d=_0x10e7e5[_0x38d3b0(0xee)](/\r\n/g,'\x0a')[_0x38d3b0(0xfb)]('\x0a'),_0x14b691=_0x2bf58d[_0x38d3b0(0xf2)](_0xa2e2e9=>!isSyncedAtMetadataLine(_0xa2e2e9,_0xd1870e));return _0x14b691[_0x38d3b0(0xce)]('\x0a');}function isSyncedAtMetadataLine(_0x20f5be,_0x559eb9){const _0x57d3c0=a137_0x52ed0d;if(_0x559eb9===_0x57d3c0(0xd7))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x57d3c0(0xec)](_0x20f5be);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x20f5be);}
1
+ const a138_0x7842a5=a138_0x31e0;(function(_0x154507,_0x1a6fe2){const _0x413df0=a138_0x31e0,_0x176d0e=_0x154507();while(!![]){try{const _0xaaf62d=-parseInt(_0x413df0(0x13a))/0x1*(parseInt(_0x413df0(0x15a))/0x2)+parseInt(_0x413df0(0x161))/0x3*(-parseInt(_0x413df0(0x16b))/0x4)+parseInt(_0x413df0(0x15c))/0x5*(parseInt(_0x413df0(0x164))/0x6)+-parseInt(_0x413df0(0x13f))/0x7*(parseInt(_0x413df0(0x152))/0x8)+parseInt(_0x413df0(0x156))/0x9*(-parseInt(_0x413df0(0x148))/0xa)+parseInt(_0x413df0(0x133))/0xb*(-parseInt(_0x413df0(0x142))/0xc)+parseInt(_0x413df0(0x147))/0xd;if(_0xaaf62d===_0x1a6fe2)break;else _0x176d0e['push'](_0x176d0e['shift']());}catch(_0xb82244){_0x176d0e['push'](_0x176d0e['shift']());}}}(a138_0x1ef4,0x7a81d));import{readFile,rm,writeFile}from'node:fs/promises';function a138_0x1ef4(){const _0x12b565=['str','filter','27ETfHUp','lockFilePath','length','appCode','3372PHDHtZ','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','323005uyWCYD','POST','path','lastSync','\x20written,\x20','3TFQGBx','trimStart','skipped','12iRsREv','nonInteractive','catch','mybatisXml','sql','sqlRootDir','pull','1756796huFpBc','string','unchanged','description','utf8','\x20skipped,\x20','\x20failed','name','11FEuVbG','sqlContent','sqlName','sqlCode','would_pull','bool','toISOString','311VViPMs','push','apps','tableData','sqlRoot','7pVTKGo','test','sqls','8807388RuZIzT','split','message','replace','join','32493773WWISBy','98510rEXdJV','boolean','dbId','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Filter\x20by\x20SQL\x20display\x20name','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','conflict','Would\x20pull\x20','sqlcode','3199096Tazxfq','totalCount'];a138_0x1ef4=function(){return _0x12b565;};return a138_0x1ef4();}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';function a138_0x31e0(_0x1c5327,_0x54e104){_0x1c5327=_0x1c5327-0x130;const _0x1ef40b=a138_0x1ef4();let _0x31e0ee=_0x1ef40b[_0x1c5327];return _0x31e0ee;}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(_0x326db2,_0x822064){const _0xfc1e=a138_0x31e0,_0x500b24=[];let _0x8b561e=0x1;while(!![]){const _0x20f1ae=await listSqlQueries(_0x326db2,{'currentPage':_0x8b561e,'pageSize':PAGE_SIZE,'sqlCode':_0x822064['sqlCode'],'sqlName':_0x822064[_0xfc1e(0x135)]}),_0x56e75a=_0x20f1ae[_0xfc1e(0x13d)]??[];_0x500b24['push'](..._0x56e75a);if(_0x56e75a[_0xfc1e(0x158)]===0x0)break;const _0x45d0c9=_0x20f1ae['paging']?.[_0xfc1e(0x153)];if(_0x45d0c9!=null?_0x500b24['length']>=_0x45d0c9:_0x56e75a['length']<PAGE_SIZE)break;_0x8b561e++;}return _0x500b24;}async function ensureSqlContent(_0x5725c0){const _0x43cc00=a138_0x31e0;if(_0x5725c0[_0x43cc00(0x134)]!=null&&String(_0x5725c0[_0x43cc00(0x134)])[_0x43cc00(0x158)]>0x0)return _0x5725c0;return getSqlQueryDetail(_0x5725c0[_0x43cc00(0x136)]);}export const sqlPull={'service':a138_0x7842a5(0x168),'command':a138_0x7842a5(0x16a),'description':a138_0x7842a5(0x14e),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a138_0x7842a5(0x132),'type':a138_0x7842a5(0x16c),'description':a138_0x7842a5(0x14d)},{'name':'force','type':a138_0x7842a5(0x149),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x5a4bad){const _0xed53c0=a138_0x7842a5,_0x5f5de9=loadSqlProjectConfig(_0x5a4bad[_0xed53c0(0x159)]),_0x34d178=await readSqlLockFile(_0x5f5de9[_0xed53c0(0x157)]),{appLock:_0x37d608}=ensureSqlLockScope(_0x34d178??createEmptySqlLock(),_0x5f5de9[_0xed53c0(0x159)],_0x5f5de9[_0xed53c0(0x13e)],_0xed53c0(0x16a)),_0x12585a=await fetchAllSqlQueries(_0x5a4bad[_0xed53c0(0x159)],{'sqlCode':_0x5a4bad[_0xed53c0(0x154)]('sqlcode')||undefined,'sqlName':_0x5a4bad[_0xed53c0(0x154)](_0xed53c0(0x132))||undefined}),_0x358dd5=[];for(const _0x40ecf3 of _0x12585a){const _0x490880=await ensureSqlContent(_0x40ecf3),_0x513b56=ensureRemoteSqlContent(_0x490880),_0x24a10c=detectModeFromSql(_0x490880),_0x3ae0fc=_0x490880['dbId']?await getDbName(_0x5a4bad[_0xed53c0(0x159)],Number(_0x490880[_0xed53c0(0x14a)]))[_0xed53c0(0x166)](()=>undefined):undefined,_0x234714=buildLocalSqlFileContent({'sqlCode':_0x490880[_0xed53c0(0x136)],'sqlName':_0x490880['sqlName'],'dbId':_0x490880[_0xed53c0(0x14a)]},_0x513b56,{'dbName':_0x3ae0fc,'mode':_0x24a10c,'syncedAt':new Date()[_0xed53c0(0x139)](),'description':_0x490880[_0xed53c0(0x16e)]}),_0x34ccbf=buildSqlLockEntry(_0x490880,_0x513b56,'',{'dbName':_0x3ae0fc}),_0x33b0f8=resolveLocalSqlFilePath(_0x5f5de9,_0x490880['sqlCode'],_0x34ccbf);let _0x2a0cb6=_0xed53c0(0x137),_0x413cbf;if(await fileExists(_0x33b0f8)){const _0x1504f4=await readFile(_0x33b0f8,_0xed53c0(0x16f));isEquivalentPulledSqlFile(_0x1504f4,_0x234714,_0x24a10c)?(_0x2a0cb6=_0xed53c0(0x163),_0x413cbf='unchanged'):(_0x2a0cb6=_0xed53c0(0x14f),_0x413cbf=_0xed53c0(0x15b));}_0x358dd5[_0xed53c0(0x13b)]({'sqlCode':_0x490880[_0xed53c0(0x136)],'sqlName':_0x490880[_0xed53c0(0x135)],'filePath':_0x33b0f8,'status':_0x2a0cb6,'reason':_0x413cbf});}return{'method':_0xed53c0(0x15d),'url':_0xed53c0(0x14b),'body':{'appCode':_0x5a4bad[_0xed53c0(0x159)],'sqlCode':_0x5a4bad['str'](_0xed53c0(0x151))||null,'sqlName':_0x5a4bad[_0xed53c0(0x154)]('name')||null,'files':_0x358dd5},'description':_0xed53c0(0x150)+_0x358dd5[_0xed53c0(0x158)]+'\x20SQL\x20file(s)\x20into\x20'+_0x5f5de9[_0xed53c0(0x169)]};},async 'execute'(_0x3a1cec){const _0x2185d7=a138_0x7842a5,_0x418f07=loadSqlProjectConfig(_0x3a1cec['appCode']),_0x267b04=await readSqlLockFile(_0x418f07[_0x2185d7(0x157)]),{lockData:_0x5f09c4,appLock:_0x846f04}=ensureSqlLockScope(_0x267b04??createEmptySqlLock(),_0x418f07[_0x2185d7(0x159)],_0x418f07['sqlRoot'],'pull'),_0x4582a8=_0x3a1cec[_0x2185d7(0x138)]('force'),_0x12c272=await fetchAllSqlQueries(_0x3a1cec[_0x2185d7(0x159)],{'sqlCode':_0x3a1cec['str'](_0x2185d7(0x151))||undefined,'sqlName':_0x3a1cec[_0x2185d7(0x154)](_0x2185d7(0x132))||undefined});if(_0x12c272[_0x2185d7(0x158)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x504eab=[],_0x43ddf1=[];for(const _0x24180d of _0x12c272){try{_0x504eab[_0x2185d7(0x13b)](await ensureSqlContent(_0x24180d));}catch(_0x1e5ce2){_0x43ddf1[_0x2185d7(0x13b)]({'sqlCode':_0x24180d['sqlCode'],'error':_0x1e5ce2 instanceof Error?_0x1e5ce2[_0x2185d7(0x144)]:String(_0x1e5ce2)});}}if(_0x4582a8&&!_0x3a1cec[_0x2185d7(0x165)]){let _0x416324=![];for(const _0x16c78b of _0x504eab){const _0x244232=detectModeFromSql(_0x16c78b),_0x299473=_0x16c78b['dbId']?await getDbName(_0x3a1cec[_0x2185d7(0x159)],Number(_0x16c78b[_0x2185d7(0x14a)]))['catch'](()=>undefined):undefined,_0x1e8991=buildLocalSqlFileContent({'sqlCode':_0x16c78b[_0x2185d7(0x136)],'sqlName':_0x16c78b[_0x2185d7(0x135)],'dbId':_0x16c78b[_0x2185d7(0x14a)]},ensureRemoteSqlContent(_0x16c78b),{'dbName':_0x299473,'mode':_0x244232,'syncedAt':new Date()[_0x2185d7(0x139)](),'description':_0x16c78b[_0x2185d7(0x16e)]}),_0x173c67=resolveLocalSqlFilePath(_0x418f07,_0x16c78b['sqlCode'],buildSqlLockEntry(_0x16c78b,ensureRemoteSqlContent(_0x16c78b),'',{'dbName':_0x299473}));if(await fileExists(_0x173c67)){const _0x4fbcb4=await readFile(_0x173c67,_0x2185d7(0x16f));if(!isEquivalentPulledSqlFile(_0x4fbcb4,_0x1e8991,_0x244232)){_0x416324=!![];break;}}}if(_0x416324){const _0x1d2d14=await confirmForceOverwrite(_0x2185d7(0x14c));if(!_0x1d2d14)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x27c8ad=cloneSqlLockData(_0x5f09c4),_0x5779dd=_0x27c8ad[_0x2185d7(0x13c)][_0x418f07['appCode']],_0x5d2909=[],_0x207d86=[];for(const _0x534270 of _0x504eab){const _0x1ce7b3=_0x5779dd[_0x2185d7(0x141)][_0x534270['sqlCode']],_0x896184=ensureRemoteSqlContent(_0x534270),_0x44a924=detectModeFromSql(_0x534270),_0x21d06a=_0x534270[_0x2185d7(0x14a)]?await getDbName(_0x3a1cec[_0x2185d7(0x159)],Number(_0x534270[_0x2185d7(0x14a)]))[_0x2185d7(0x166)](()=>undefined):undefined,_0x828fb1=buildLocalSqlFileContent({'sqlCode':_0x534270[_0x2185d7(0x136)],'sqlName':_0x534270[_0x2185d7(0x135)],'dbId':_0x534270[_0x2185d7(0x14a)]},_0x896184,{'dbName':_0x21d06a,'mode':_0x44a924,'syncedAt':new Date()[_0x2185d7(0x139)](),'description':_0x534270['description']}),_0x5d399d=buildSqlLockEntry(_0x534270,_0x896184,computeSqlContentHash(_0x828fb1),{'dbName':_0x21d06a}),_0x29835f=_0x5d399d[_0x2185d7(0x15e)],_0x2cb622=join(_0x418f07[_0x2185d7(0x169)],_0x29835f);try{if(await fileExists(_0x2cb622)){const _0xfed4b1=await readFile(_0x2cb622,_0x2185d7(0x16f));if(isEquivalentPulledSqlFile(_0xfed4b1,_0x828fb1,_0x44a924)){_0x207d86['push']({'sqlCode':_0x534270['sqlCode'],'reason':_0x2185d7(0x16d)}),_0x5779dd[_0x2185d7(0x141)][_0x534270['sqlCode']]={..._0x5d399d,'hash':computeSqlContentHash(_0xfed4b1),'path':_0x29835f};continue;}if(!_0x4582a8){_0x207d86[_0x2185d7(0x13b)]({'sqlCode':_0x534270[_0x2185d7(0x136)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x560204=_0x1ce7b3?.[_0x2185d7(0x15e)]?join(_0x418f07[_0x2185d7(0x169)],_0x1ce7b3[_0x2185d7(0x15e)]):undefined;_0x560204&&_0x560204!==_0x2cb622&&await fileExists(_0x560204)&&await rm(_0x560204,{'force':!![]}),await ensureParentDirectory(_0x2cb622),await writeFile(_0x2cb622,_0x828fb1,_0x2185d7(0x16f)),_0x5779dd[_0x2185d7(0x141)][_0x534270[_0x2185d7(0x136)]]={..._0x5d399d,'path':_0x29835f},_0x5d2909[_0x2185d7(0x13b)]({'sqlCode':_0x534270['sqlCode'],'filePath':_0x2cb622});}catch(_0x55aac9){_0x43ddf1[_0x2185d7(0x13b)]({'sqlCode':_0x534270[_0x2185d7(0x136)],'error':_0x55aac9 instanceof Error?_0x55aac9['message']:String(_0x55aac9)});}}return _0x5779dd[_0x2185d7(0x15f)]=new Date()[_0x2185d7(0x139)](),await writeSqlLockFile(_0x418f07[_0x2185d7(0x157)],_0x27c8ad),{'ok':_0x43ddf1[_0x2185d7(0x158)]===0x0,'data':{'pulled':_0x5d2909,'skipped':_0x207d86,'failed':_0x43ddf1},'message':'Pull\x20complete:\x20'+_0x5d2909['length']+_0x2185d7(0x160)+_0x207d86[_0x2185d7(0x158)]+_0x2185d7(0x130)+_0x43ddf1['length']+_0x2185d7(0x131)};}};function detectModeFromSql(_0x152ddc){const _0x5b06b1=a138_0x7842a5,_0x518355=ensureRemoteSqlContent(_0x152ddc),_0x4bd524=stripLocalSqlMetadata(_0x518355,'mybatisXml')[_0x5b06b1(0x162)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x4bd524))return'mybatisXml';return _0x5b06b1(0x168);}function isEquivalentPulledSqlFile(_0x270024,_0x8a49a0,_0x188b43){return normalizePullComparableContent(_0x270024,_0x188b43)===normalizePullComparableContent(_0x8a49a0,_0x188b43);}function normalizePullComparableContent(_0x399ed0,_0x4d5618){const _0x16d67d=a138_0x7842a5,_0x3428af=_0x399ed0[_0x16d67d(0x145)](/\r\n/g,'\x0a')[_0x16d67d(0x143)]('\x0a'),_0x59dc67=_0x3428af[_0x16d67d(0x155)](_0x5b0e34=>!isSyncedAtMetadataLine(_0x5b0e34,_0x4d5618));return _0x59dc67[_0x16d67d(0x146)]('\x0a');}function isSyncedAtMetadataLine(_0x1ab83c,_0x3c215c){const _0xd679ab=a138_0x7842a5;if(_0x3c215c===_0xd679ab(0x167))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0xd679ab(0x140)](_0x1ab83c);return/^\s*--\s*@lovrabet\.syncedAt:/[_0xd679ab(0x140)](_0x1ab83c);}
@@ -1 +1 @@
1
- const a138_0x3cc0f7=a138_0x5303;(function(_0x377892,_0x428aed){const _0x9239df=a138_0x5303,_0x4a66fa=_0x377892();while(!![]){try{const _0x4d1f76=-parseInt(_0x9239df(0x9c))/0x1*(parseInt(_0x9239df(0x8a))/0x2)+-parseInt(_0x9239df(0x99))/0x3*(parseInt(_0x9239df(0x80))/0x4)+parseInt(_0x9239df(0xa2))/0x5*(-parseInt(_0x9239df(0x82))/0x6)+-parseInt(_0x9239df(0x7f))/0x7+-parseInt(_0x9239df(0x98))/0x8+-parseInt(_0x9239df(0xb0))/0x9+-parseInt(_0x9239df(0x77))/0xa*(-parseInt(_0x9239df(0xb4))/0xb);if(_0x4d1f76===_0x428aed)break;else _0x4a66fa['push'](_0x4a66fa['shift']());}catch(_0x17e325){_0x4a66fa['push'](_0x4a66fa['shift']());}}}(a138_0x565a,0x8a006));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a138_0x565a(){const _0x5c4db8=['Push\x20local\x20SQL\x20files\x20to\x20remote','/smartapi/custom/updateUserCustomSql','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x20SQL\x20file(s)','31386LxzCoy','unchanged','get','filePath','toISOString','sqlName','bool','\x20failed','sqlRootDir','version','Would\x20push\x20','sqlCode','exec','Local\x20SQL\x20not\x20found:\x20','8997880ABIBsZ','3RPYZJp','\x20skipped,\x20','sqlConfig','41PmMddi','utf8','sqlcode','lockFilePath','No\x20database\x20matches\x20local\x20directory\x20\x22','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','292310zbJgPD','dbId','str','push','No\x20local\x20SQL\x20files\x20found.','sqls','length','mode','Push\x20complete:\x20','catch','appCode','boolean','isFinite','sqlRoot','1129113cyJXHE','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','path','45265CbsPLJ','sql','POST','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','projectRoot','dbName','startsWith','8440FjQMTK','remoteId','validation','replace','hash','dbDirectory','relativePath','lastSync','845551PqcPGk','299760pvVZKO','force','84jnQoyn','entries','filter','has'];a138_0x565a=function(){return _0x5c4db8;};return a138_0x565a();}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a138_0x5303(_0x3bcb0f,_0x30b8b3){_0x3bcb0f=_0x3bcb0f-0x73;const _0x565a0b=a138_0x565a();let _0x530384=_0x565a0b[_0x3bcb0f];return _0x530384;}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(_0x265084,_0x6dde74,_0x3191f6){const _0x296583=a138_0x5303,_0x2febb8=await scanLocalSqlQueries(_0x265084),_0x53bf92=new Map();for(const _0xaf7f54 of _0x2febb8){if(_0x3191f6&&_0xaf7f54[_0x296583(0x95)]!==_0x3191f6)continue;const _0x150199=_0x53bf92[_0x296583(0x8c)](_0xaf7f54[_0x296583(0x95)])??[];_0x150199[_0x296583(0xa5)](_0xaf7f54),_0x53bf92['set'](_0xaf7f54[_0x296583(0x95)],_0x150199);}if(_0x3191f6&&!_0x53bf92[_0x296583(0x85)](_0x3191f6))throw CliErrors['validation'](_0x296583(0x97)+_0x3191f6);const _0x35b560=[];for(const [_0x33270d,_0x50a18f]of _0x53bf92[_0x296583(0x83)]()){if(_0x50a18f[_0x296583(0xa8)]===0x1){_0x35b560[_0x296583(0xa5)](_0x50a18f[0x0]);continue;}const _0x320ff9=_0x6dde74[_0x296583(0xa7)][_0x33270d],_0x2e2549=_0x320ff9?.[_0x296583(0xb3)],_0x5f1892=_0x2e2549?_0x50a18f[_0x296583(0x84)](_0x47d8a1=>_0x47d8a1[_0x296583(0x7d)]!==_0x2e2549):_0x50a18f;if(_0x320ff9&&_0x5f1892[_0x296583(0xa8)]===0x1){_0x35b560['push'](_0x5f1892[0x0]);continue;}throw CliErrors[_0x296583(0x79)](_0x296583(0xb1)+_0x33270d+_0x296583(0x73));}return _0x35b560;}export const sqlPush={'service':a138_0x3cc0f7(0xb5),'command':a138_0x3cc0f7(0xa5),'description':a138_0x3cc0f7(0x86),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a138_0x3cc0f7(0x81),'type':a138_0x3cc0f7(0xad),'description':a138_0x3cc0f7(0x88)}],async 'dryRun'(_0x2fcc79){const _0x3348ba=a138_0x3cc0f7,_0x426b21=loadSqlProjectConfig(_0x2fcc79['appCode']),_0x5cc070=await readSqlLockFile(_0x426b21['lockFilePath']),{appLock:_0x49c3a2}=ensureSqlLockScope(_0x5cc070??createEmptySqlLock(),_0x2fcc79[_0x3348ba(0xac)],_0x426b21[_0x3348ba(0xaf)],_0x3348ba(0xa5)),_0x162300=await getTargetSqlQueries(_0x426b21,_0x49c3a2,_0x2fcc79[_0x3348ba(0xa4)](_0x3348ba(0x9e))||undefined),_0x47cca2=[];for(const _0x285639 of _0x162300){const _0x17b5ff=await computeSqlFileHash(_0x285639['filePath']),_0x3c6125=_0x49c3a2[_0x3348ba(0xa7)][_0x285639[_0x3348ba(0x95)]],_0x2e8e97=!!_0x3c6125&&(_0x3c6125[_0x3348ba(0xb3)]!==_0x285639['relativePath']||!!_0x285639['sqlName']&&_0x3c6125[_0x3348ba(0x8f)]!==_0x285639[_0x3348ba(0x8f)]);if(!_0x2fcc79[_0x3348ba(0x90)](_0x3348ba(0x81))&&_0x3c6125&&_0x3c6125[_0x3348ba(0x7b)]===_0x17b5ff&&!_0x2e8e97)continue;_0x47cca2['push'](_0x285639[_0x3348ba(0x95)]);}return{'method':_0x3348ba(0xb6),'url':_0x3348ba(0x87),'body':{'sqlCodes':_0x47cca2,'appCode':_0x2fcc79[_0x3348ba(0xac)]},'description':_0x3348ba(0x94)+_0x47cca2[_0x3348ba(0xa8)]+_0x3348ba(0x89)};},async 'execute'(_0x145e61){const _0x57b382=a138_0x3cc0f7,_0x582143=loadSqlProjectConfig(_0x145e61[_0x57b382(0xac)]),_0x21ce8f=await readSqlLockFile(_0x582143[_0x57b382(0x9f)]),{lockData:_0x41e6d7,appLock:_0x256263}=ensureSqlLockScope(_0x21ce8f??createEmptySqlLock(),_0x145e61['appCode'],_0x582143[_0x57b382(0xaf)],_0x57b382(0xa5)),_0xc32360=await getTargetSqlQueries(_0x582143,_0x256263,_0x145e61[_0x57b382(0xa4)](_0x57b382(0x9e))||undefined);if(_0xc32360[_0x57b382(0xa8)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x57b382(0xa6)};const _0x396906=[],_0x3242a5=[],_0x468d4a=[];for(const _0x5df7bc of _0xc32360){const _0x2d6579=_0x256263[_0x57b382(0xa7)][_0x5df7bc[_0x57b382(0x95)]];if(!_0x2d6579){_0x468d4a[_0x57b382(0xa5)]({'sqlCode':_0x5df7bc[_0x57b382(0x95)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x2f6c8b=await computeSqlFileHash(_0x5df7bc[_0x57b382(0x8d)]),_0x5bfe1b=_0x2d6579['path']!==_0x5df7bc[_0x57b382(0x7d)]||!!_0x5df7bc[_0x57b382(0x8f)]&&_0x2d6579[_0x57b382(0x8f)]!==_0x5df7bc[_0x57b382(0x8f)];if(!_0x145e61[_0x57b382(0x90)](_0x57b382(0x81))&&_0x2d6579['hash']===_0x2f6c8b&&!_0x5bfe1b){_0x3242a5[_0x57b382(0xa5)]({'sqlCode':_0x5df7bc[_0x57b382(0x95)],'reason':_0x57b382(0x8b)});continue;}if(_0x2d6579[_0x57b382(0x93)]==null){_0x468d4a['push']({'sqlCode':_0x5df7bc[_0x57b382(0x95)],'error':_0x57b382(0xa1)});continue;}const _0x478dfd=await readFile(_0x5df7bc[_0x57b382(0x8d)],_0x57b382(0x9d)),_0x5e6f59=stripLocalSqlMetadata(_0x478dfd,_0x5df7bc[_0x57b382(0xa9)]),_0x4cb2fe=_0x5df7bc[_0x57b382(0x8f)]||_0x2d6579[_0x57b382(0x8f)],_0x29d9a7=await resolveTargetDbBinding(_0x145e61[_0x57b382(0xac)],_0x5df7bc,_0x2d6579),_0x298335=await updateSqlQuery({'id':_0x2d6579['remoteId'],'appCode':_0x145e61[_0x57b382(0xac)],'sqlCode':_0x5df7bc[_0x57b382(0x95)],'sqlName':_0x4cb2fe,'dbId':_0x29d9a7[_0x57b382(0xa3)],'version':_0x2d6579[_0x57b382(0x93)],'sqlContent':_0x5e6f59,'sqlConfig':_0x2d6579[_0x57b382(0x9b)]??undefined}),_0x57c8d2=_0x298335[_0x57b382(0xa3)]?await getDbName(_0x145e61[_0x57b382(0xac)],Number(_0x298335[_0x57b382(0xa3)]))['catch'](()=>_0x29d9a7[_0x57b382(0x75)]):_0x29d9a7[_0x57b382(0x75)];_0x256263[_0x57b382(0xa7)][_0x5df7bc[_0x57b382(0x95)]]={...buildSqlLockEntry(_0x298335,_0x5e6f59,_0x2f6c8b,{'dbName':_0x57c8d2}),'path':_0x5df7bc[_0x57b382(0x7d)],'mode':_0x2d6579[_0x57b382(0xa9)]},await archivePreviousSqlFileIfNeeded(_0x582143,_0x2d6579['path'],_0x5df7bc[_0x57b382(0x7d)]),_0x396906[_0x57b382(0xa5)]({'sqlCode':_0x5df7bc[_0x57b382(0x95)],'remoteId':_0x2d6579[_0x57b382(0x78)]});}catch(_0x2ba4ca){_0x468d4a['push']({'sqlCode':_0x5df7bc[_0x57b382(0x95)],'error':_0x2ba4ca instanceof Error?_0x2ba4ca['message']:String(_0x2ba4ca)});}}return _0x256263[_0x57b382(0x7e)]=new Date()['toISOString'](),await writeSqlLockFile(_0x582143[_0x57b382(0x9f)],_0x41e6d7),{'ok':_0x468d4a[_0x57b382(0xa8)]===0x0,'data':{'pushed':_0x396906,'skipped':_0x3242a5,'failed':_0x468d4a},'message':_0x57b382(0xaa)+_0x396906['length']+'\x20pushed,\x20'+_0x3242a5[_0x57b382(0xa8)]+_0x57b382(0x9a)+_0x468d4a[_0x57b382(0xa8)]+_0x57b382(0x91)};}};async function archivePreviousSqlFileIfNeeded(_0x20f3ec,_0x20ac2a,_0x4f4e08){const _0x272dd1=a138_0x3cc0f7;if(!_0x20ac2a||_0x20ac2a===_0x4f4e08)return;const _0x3b3220=join(_0x20f3ec['sqlRootDir'],_0x20ac2a);if(!await fileExists(_0x3b3220))return;const _0x1d0bf0=await moveToTrash(_0x20f3ec[_0x272dd1(0x74)],_0x20f3ec['trashDir'],_0x3b3220);await cleanupEmptyDirectories(dirname(_0x3b3220),_0x20f3ec[_0x272dd1(0x92)]),void _0x1d0bf0;}async function moveToTrash(_0x12f905,_0x35476c,_0x110ee8){const _0x13bc59=a138_0x3cc0f7,_0x284370=new Date()[_0x13bc59(0x8e)]()[_0x13bc59(0x7a)](/[:.]/g,'-'),_0x553e94=relative(_0x12f905,_0x110ee8),_0x1c5d18=join(_0x35476c,_0x284370,_0x553e94);return await mkdir(dirname(_0x1c5d18),{'recursive':!![]}),await rename(_0x110ee8,_0x1c5d18),_0x1c5d18;}async function cleanupEmptyDirectories(_0x50d4e5,_0x5df95f){const _0x38f588=a138_0x3cc0f7;let _0x1026a1=resolve(_0x50d4e5);const _0x1ab269=resolve(_0x5df95f);while(_0x1026a1[_0x38f588(0x76)](''+_0x1ab269+sep)||_0x1026a1===_0x1ab269){if(_0x1026a1===_0x1ab269)return;try{const _0x24cf0f=await readdir(_0x1026a1);if(_0x24cf0f[_0x38f588(0xa8)]>0x0)return;await rmdir(_0x1026a1);}catch{return;}_0x1026a1=dirname(_0x1026a1);}}async function resolveTargetDbBinding(_0x504932,_0x54c946,_0x14ed1e){const _0x15266c=a138_0x3cc0f7,_0x12e566=_0x54c946[_0x15266c(0x7c)];if(!_0x12e566)return{'dbId':_0x14ed1e[_0x15266c(0xa3)],'dbName':_0x14ed1e['dbName']};const _0x47109e=buildDbDirectoryName(_0x14ed1e['dbName'],_0x14ed1e['dbId']);if(_0x12e566===_0x47109e)return{'dbId':_0x14ed1e['dbId'],'dbName':_0x14ed1e[_0x15266c(0x75)]};const _0x837010=parseExplicitDbDirectory(_0x12e566);if(_0x837010!=null)return{'dbId':_0x837010,'dbName':await getDbName(_0x504932,_0x837010)[_0x15266c(0xab)](()=>undefined)};const _0x45d70b=await listDatabases(_0x504932),_0x14ab2a=_0x45d70b[_0x15266c(0x84)](_0x14932a=>buildDbDirectoryName(_0x14932a['dbName'],_0x14932a[_0x15266c(0xa3)])===_0x12e566);if(_0x14ab2a[_0x15266c(0xa8)]===0x1)return{'dbId':_0x14ab2a[0x0]['dbId'],'dbName':_0x14ab2a[0x0][_0x15266c(0x75)]};if(_0x14ab2a[_0x15266c(0xa8)]===0x0)throw CliErrors[_0x15266c(0x79)](_0x15266c(0xa0)+_0x12e566+'\x22\x20for\x20sqlCode\x20'+_0x54c946[_0x15266c(0x95)]+'.');const _0x5ea6c7=_0x14ab2a['map'](_0x19e63f=>_0x19e63f[_0x15266c(0x75)]+'\x20('+_0x19e63f[_0x15266c(0xa3)]+')')['join'](',\x20');throw CliErrors[_0x15266c(0x79)]('Local\x20directory\x20\x22'+_0x12e566+_0x15266c(0xb2)+_0x54c946[_0x15266c(0x95)]+':\x20'+_0x5ea6c7);}function parseExplicitDbDirectory(_0x5ac461){const _0x35681e=a138_0x3cc0f7,_0x58071d=/^db-(\d+)$/[_0x35681e(0x96)](_0x5ac461);if(!_0x58071d)return null;const _0x55ab4e=Number(_0x58071d[0x1]);return Number[_0x35681e(0xae)](_0x55ab4e)&&_0x55ab4e>0x0?_0x55ab4e:null;}
1
+ const a139_0x5a3b3f=a139_0x2f9f;(function(_0x530446,_0x12bf30){const _0x35c59f=a139_0x2f9f,_0x435ca2=_0x530446();while(!![]){try{const _0x303e21=-parseInt(_0x35c59f(0x20e))/0x1+-parseInt(_0x35c59f(0x235))/0x2*(-parseInt(_0x35c59f(0x1fa))/0x3)+-parseInt(_0x35c59f(0x224))/0x4*(parseInt(_0x35c59f(0x209))/0x5)+parseInt(_0x35c59f(0x1f5))/0x6+-parseInt(_0x35c59f(0x213))/0x7*(parseInt(_0x35c59f(0x214))/0x8)+parseInt(_0x35c59f(0x236))/0x9*(parseInt(_0x35c59f(0x220))/0xa)+-parseInt(_0x35c59f(0x233))/0xb;if(_0x303e21===_0x12bf30)break;else _0x435ca2['push'](_0x435ca2['shift']());}catch(_0x57eb8c){_0x435ca2['push'](_0x435ca2['shift']());}}}(a139_0x2480,0xa8135));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';function a139_0x2480(){const _0x280f82=['sqlRoot','sql','lastSync','sqlCode','mode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqlcode','\x20SQL\x20file(s)','30EjfZfs','relativePath','\x20skipped,\x20','catch','Push\x20complete:\x20','857647IgpnlJ','\x20failed','boolean','unchanged','\x22\x20for\x20sqlCode\x20','75593SodNXs','136GjNWqz','dbId','filePath','entries','lockFilePath','remoteId','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','force','high-risk-write','set','/smartapi/custom/updateUserCustomSql','1584940ogeyPx','join','isFinite','version','518316NRqgJF','No\x20database\x20matches\x20local\x20directory\x20\x22','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','toISOString','\x20pushed,\x20','sqlName','POST','utf8','appCode','No\x20local\x20SQL\x20files\x20found.','str','sqlRootDir','filter','hash','push','1644423TzRnXk','dbDirectory','13042hKeJTU','18oWpGMt','Local\x20directory\x20\x22','bool','path','exec','get','8090724eSVhRk','dbName','length','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','sqls','456BFrRmf','validation','sqlConfig','has','message','trashDir'];a139_0x2480=function(){return _0x280f82;};return a139_0x2480();}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';function a139_0x2f9f(_0x310981,_0x43cff7){_0x310981=_0x310981-0x1f0;const _0x24802c=a139_0x2480();let _0x2f9f41=_0x24802c[_0x310981];return _0x2f9f41;}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(_0x2aaa65,_0x37e75d,_0xfd3119){const _0x13a07c=a139_0x2f9f,_0x4bdc39=await scanLocalSqlQueries(_0x2aaa65),_0x3687d7=new Map();for(const _0x52d0fb of _0x4bdc39){if(_0xfd3119&&_0x52d0fb[_0x13a07c(0x203)]!==_0xfd3119)continue;const _0x4c1686=_0x3687d7[_0x13a07c(0x1f4)](_0x52d0fb[_0x13a07c(0x203)])??[];_0x4c1686[_0x13a07c(0x232)](_0x52d0fb),_0x3687d7[_0x13a07c(0x21e)](_0x52d0fb['sqlCode'],_0x4c1686);}if(_0xfd3119&&!_0x3687d7[_0x13a07c(0x1fd)](_0xfd3119))throw CliErrors[_0x13a07c(0x1fb)]('Local\x20SQL\x20not\x20found:\x20'+_0xfd3119);const _0x4ac8a4=[];for(const [_0x312eef,_0x4e7d70]of _0x3687d7[_0x13a07c(0x217)]()){if(_0x4e7d70[_0x13a07c(0x1f7)]===0x1){_0x4ac8a4[_0x13a07c(0x232)](_0x4e7d70[0x0]);continue;}const _0x402a06=_0x37e75d[_0x13a07c(0x1f9)][_0x312eef],_0x324e27=_0x402a06?.['path'],_0x39f55d=_0x324e27?_0x4e7d70[_0x13a07c(0x230)](_0x31196b=>_0x31196b[_0x13a07c(0x20a)]!==_0x324e27):_0x4e7d70;if(_0x402a06&&_0x39f55d[_0x13a07c(0x1f7)]===0x1){_0x4ac8a4['push'](_0x39f55d[0x0]);continue;}throw CliErrors[_0x13a07c(0x1fb)](_0x13a07c(0x1f8)+_0x312eef+_0x13a07c(0x21a));}return _0x4ac8a4;}export const sqlPush={'service':a139_0x5a3b3f(0x201),'command':a139_0x5a3b3f(0x232),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a139_0x5a3b3f(0x21d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a139_0x5a3b3f(0x210),'description':a139_0x5a3b3f(0x206)}],async 'dryRun'(_0x2e39d3){const _0x2abab0=a139_0x5a3b3f,_0x1e810=loadSqlProjectConfig(_0x2e39d3[_0x2abab0(0x22c)]),_0x426235=await readSqlLockFile(_0x1e810[_0x2abab0(0x218)]),{appLock:_0x1dbdc0}=ensureSqlLockScope(_0x426235??createEmptySqlLock(),_0x2e39d3['appCode'],_0x1e810[_0x2abab0(0x200)],_0x2abab0(0x232)),_0x14ef32=await getTargetSqlQueries(_0x1e810,_0x1dbdc0,_0x2e39d3['str'](_0x2abab0(0x207))||undefined),_0x153dc8=[];for(const _0x35dfe4 of _0x14ef32){const _0x4aaaf7=await computeSqlFileHash(_0x35dfe4['filePath']),_0x25d667=_0x1dbdc0[_0x2abab0(0x1f9)][_0x35dfe4['sqlCode']],_0x30ff1a=!!_0x25d667&&(_0x25d667[_0x2abab0(0x1f2)]!==_0x35dfe4[_0x2abab0(0x20a)]||!!_0x35dfe4[_0x2abab0(0x229)]&&_0x25d667[_0x2abab0(0x229)]!==_0x35dfe4[_0x2abab0(0x229)]);if(!_0x2e39d3[_0x2abab0(0x1f1)](_0x2abab0(0x21c))&&_0x25d667&&_0x25d667['hash']===_0x4aaaf7&&!_0x30ff1a)continue;_0x153dc8[_0x2abab0(0x232)](_0x35dfe4['sqlCode']);}return{'method':_0x2abab0(0x22a),'url':_0x2abab0(0x21f),'body':{'sqlCodes':_0x153dc8,'appCode':_0x2e39d3['appCode']},'description':'Would\x20push\x20'+_0x153dc8[_0x2abab0(0x1f7)]+_0x2abab0(0x208)};},async 'execute'(_0x426488){const _0x10fe38=a139_0x5a3b3f,_0x489ddc=loadSqlProjectConfig(_0x426488[_0x10fe38(0x22c)]),_0x2bc62a=await readSqlLockFile(_0x489ddc[_0x10fe38(0x218)]),{lockData:_0x28f55d,appLock:_0xfec3d6}=ensureSqlLockScope(_0x2bc62a??createEmptySqlLock(),_0x426488[_0x10fe38(0x22c)],_0x489ddc['sqlRoot'],_0x10fe38(0x232)),_0x160f53=await getTargetSqlQueries(_0x489ddc,_0xfec3d6,_0x426488[_0x10fe38(0x22e)](_0x10fe38(0x207))||undefined);if(_0x160f53[_0x10fe38(0x1f7)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x10fe38(0x22d)};const _0x48563b=[],_0xcbabbf=[],_0x1f350d=[];for(const _0x4c28e5 of _0x160f53){const _0x11559e=_0xfec3d6[_0x10fe38(0x1f9)][_0x4c28e5[_0x10fe38(0x203)]];if(!_0x11559e){_0x1f350d[_0x10fe38(0x232)]({'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'error':_0x10fe38(0x21b)});continue;}try{const _0xce753d=await computeSqlFileHash(_0x4c28e5[_0x10fe38(0x216)]),_0x278d3c=_0x11559e[_0x10fe38(0x1f2)]!==_0x4c28e5[_0x10fe38(0x20a)]||!!_0x4c28e5['sqlName']&&_0x11559e[_0x10fe38(0x229)]!==_0x4c28e5[_0x10fe38(0x229)];if(!_0x426488[_0x10fe38(0x1f1)]('force')&&_0x11559e[_0x10fe38(0x231)]===_0xce753d&&!_0x278d3c){_0xcbabbf[_0x10fe38(0x232)]({'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'reason':_0x10fe38(0x211)});continue;}if(_0x11559e[_0x10fe38(0x223)]==null){_0x1f350d[_0x10fe38(0x232)]({'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'error':_0x10fe38(0x205)});continue;}const _0x320df5=await readFile(_0x4c28e5['filePath'],_0x10fe38(0x22b)),_0x1925a4=stripLocalSqlMetadata(_0x320df5,_0x4c28e5[_0x10fe38(0x204)]),_0x534e75=_0x4c28e5[_0x10fe38(0x229)]||_0x11559e['sqlName'],_0x2d5e34=await resolveTargetDbBinding(_0x426488[_0x10fe38(0x22c)],_0x4c28e5,_0x11559e),_0x5e7b5a=await updateSqlQuery({'id':_0x11559e[_0x10fe38(0x219)],'appCode':_0x426488['appCode'],'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'sqlName':_0x534e75,'dbId':_0x2d5e34[_0x10fe38(0x215)],'version':_0x11559e[_0x10fe38(0x223)],'sqlContent':_0x1925a4,'sqlConfig':_0x11559e[_0x10fe38(0x1fc)]??undefined}),_0x1527ce=_0x5e7b5a[_0x10fe38(0x215)]?await getDbName(_0x426488['appCode'],Number(_0x5e7b5a[_0x10fe38(0x215)]))[_0x10fe38(0x20c)](()=>_0x2d5e34['dbName']):_0x2d5e34[_0x10fe38(0x1f6)];_0xfec3d6[_0x10fe38(0x1f9)][_0x4c28e5[_0x10fe38(0x203)]]={...buildSqlLockEntry(_0x5e7b5a,_0x1925a4,_0xce753d,{'dbName':_0x1527ce}),'path':_0x4c28e5['relativePath'],'mode':_0x11559e[_0x10fe38(0x204)]},await archivePreviousSqlFileIfNeeded(_0x489ddc,_0x11559e[_0x10fe38(0x1f2)],_0x4c28e5[_0x10fe38(0x20a)]),_0x48563b[_0x10fe38(0x232)]({'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'remoteId':_0x11559e[_0x10fe38(0x219)]});}catch(_0x22af82){_0x1f350d[_0x10fe38(0x232)]({'sqlCode':_0x4c28e5[_0x10fe38(0x203)],'error':_0x22af82 instanceof Error?_0x22af82[_0x10fe38(0x1fe)]:String(_0x22af82)});}}return _0xfec3d6[_0x10fe38(0x202)]=new Date()[_0x10fe38(0x227)](),await writeSqlLockFile(_0x489ddc[_0x10fe38(0x218)],_0x28f55d),{'ok':_0x1f350d[_0x10fe38(0x1f7)]===0x0,'data':{'pushed':_0x48563b,'skipped':_0xcbabbf,'failed':_0x1f350d},'message':_0x10fe38(0x20d)+_0x48563b[_0x10fe38(0x1f7)]+_0x10fe38(0x228)+_0xcbabbf['length']+_0x10fe38(0x20b)+_0x1f350d[_0x10fe38(0x1f7)]+_0x10fe38(0x20f)};}};async function archivePreviousSqlFileIfNeeded(_0x3f896b,_0x2a551f,_0x702521){const _0x554de9=a139_0x5a3b3f;if(!_0x2a551f||_0x2a551f===_0x702521)return;const _0x22b6a8=join(_0x3f896b[_0x554de9(0x22f)],_0x2a551f);if(!await fileExists(_0x22b6a8))return;const _0x1772d1=await moveToTrash(_0x3f896b['projectRoot'],_0x3f896b[_0x554de9(0x1ff)],_0x22b6a8);await cleanupEmptyDirectories(dirname(_0x22b6a8),_0x3f896b[_0x554de9(0x22f)]),void _0x1772d1;}async function moveToTrash(_0x59269b,_0x109632,_0x2401c8){const _0x57633f=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x7e9b9a=relative(_0x59269b,_0x2401c8),_0x72ea38=join(_0x109632,_0x57633f,_0x7e9b9a);return await mkdir(dirname(_0x72ea38),{'recursive':!![]}),await rename(_0x2401c8,_0x72ea38),_0x72ea38;}async function cleanupEmptyDirectories(_0xd3d4e7,_0xc86d54){const _0x2ce520=a139_0x5a3b3f;let _0x4155f0=resolve(_0xd3d4e7);const _0x56c88c=resolve(_0xc86d54);while(_0x4155f0['startsWith'](''+_0x56c88c+sep)||_0x4155f0===_0x56c88c){if(_0x4155f0===_0x56c88c)return;try{const _0x1b0962=await readdir(_0x4155f0);if(_0x1b0962[_0x2ce520(0x1f7)]>0x0)return;await rmdir(_0x4155f0);}catch{return;}_0x4155f0=dirname(_0x4155f0);}}async function resolveTargetDbBinding(_0x32e405,_0x3ddaad,_0x3dcec1){const _0x40e4a6=a139_0x5a3b3f,_0x1e2221=_0x3ddaad[_0x40e4a6(0x234)];if(!_0x1e2221)return{'dbId':_0x3dcec1[_0x40e4a6(0x215)],'dbName':_0x3dcec1['dbName']};const _0x505a30=buildDbDirectoryName(_0x3dcec1['dbName'],_0x3dcec1[_0x40e4a6(0x215)]);if(_0x1e2221===_0x505a30)return{'dbId':_0x3dcec1[_0x40e4a6(0x215)],'dbName':_0x3dcec1[_0x40e4a6(0x1f6)]};const _0x5ae563=parseExplicitDbDirectory(_0x1e2221);if(_0x5ae563!=null)return{'dbId':_0x5ae563,'dbName':await getDbName(_0x32e405,_0x5ae563)[_0x40e4a6(0x20c)](()=>undefined)};const _0x4c5b70=await listDatabases(_0x32e405),_0x465b1d=_0x4c5b70[_0x40e4a6(0x230)](_0x544f2b=>buildDbDirectoryName(_0x544f2b['dbName'],_0x544f2b[_0x40e4a6(0x215)])===_0x1e2221);if(_0x465b1d[_0x40e4a6(0x1f7)]===0x1)return{'dbId':_0x465b1d[0x0][_0x40e4a6(0x215)],'dbName':_0x465b1d[0x0][_0x40e4a6(0x1f6)]};if(_0x465b1d[_0x40e4a6(0x1f7)]===0x0)throw CliErrors[_0x40e4a6(0x1fb)](_0x40e4a6(0x225)+_0x1e2221+_0x40e4a6(0x212)+_0x3ddaad[_0x40e4a6(0x203)]+'.');const _0xd294fc=_0x465b1d['map'](_0x5ac90d=>_0x5ac90d[_0x40e4a6(0x1f6)]+'\x20('+_0x5ac90d['dbId']+')')[_0x40e4a6(0x221)](',\x20');throw CliErrors[_0x40e4a6(0x1fb)](_0x40e4a6(0x1f0)+_0x1e2221+_0x40e4a6(0x226)+_0x3ddaad[_0x40e4a6(0x203)]+':\x20'+_0xd294fc);}function parseExplicitDbDirectory(_0x1e9f9e){const _0x25e7c8=a139_0x5a3b3f,_0x3a483a=/^db-(\d+)$/[_0x25e7c8(0x1f3)](_0x1e9f9e);if(!_0x3a483a)return null;const _0x5efdd4=Number(_0x3a483a[0x1]);return Number[_0x25e7c8(0x222)](_0x5efdd4)&&_0x5efdd4>0x0?_0x5efdd4:null;}
@@ -1 +1 @@
1
- const a139_0x405dda=a139_0x5b1c;(function(_0x1f3ef5,_0x463f5a){const _0x2b2415=a139_0x5b1c,_0x342034=_0x1f3ef5();while(!![]){try{const _0x4c3c3b=parseInt(_0x2b2415(0x1e1))/0x1*(parseInt(_0x2b2415(0x1ec))/0x2)+parseInt(_0x2b2415(0x1db))/0x3+parseInt(_0x2b2415(0x1e4))/0x4*(parseInt(_0x2b2415(0x1df))/0x5)+-parseInt(_0x2b2415(0x1e9))/0x6+-parseInt(_0x2b2415(0x1e7))/0x7+-parseInt(_0x2b2415(0x1d9))/0x8+parseInt(_0x2b2415(0x1e2))/0x9*(-parseInt(_0x2b2415(0x1e6))/0xa);if(_0x4c3c3b===_0x463f5a)break;else _0x342034['push'](_0x342034['shift']());}catch(_0x4f5857){_0x342034['push'](_0x342034['shift']());}}}(a139_0x37d6,0x93480));function a139_0x37d6(){const _0x37d2c4=['5693SbbMGv','2226006GtAMbx','string','172zQOpCN','SQL\x20query\x20display\x20name','10XHIIsz','1722371tgORKh','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`.','2922630VqltAs','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','validation','84HOcjMv','join','3906752zqzSet','save','3083070mOYSoo','Query\x20description','sql','write','93640oZwnbr','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.'];a139_0x37d6=function(){return _0x37d2c4;};return a139_0x37d6();}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.',a139_0x405dda(0x1e0),a139_0x405dda(0x1e8)][a139_0x405dda(0x1ed)]('\x0a');function a139_0x5b1c(_0x29ca27,_0x1141b3){_0x29ca27=_0x29ca27-0x1d9;const _0x37d6cd=a139_0x37d6();let _0x5b1cd2=_0x37d6cd[_0x29ca27];return _0x5b1cd2;}export const sqlSave={'service':a139_0x405dda(0x1dd),'command':a139_0x405dda(0x1da),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a139_0x405dda(0x1de),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':'string','required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a139_0x405dda(0x1e3),'description':a139_0x405dda(0x1e5)},{'name':'db','type':a139_0x405dda(0x1e3),'description':a139_0x405dda(0x1ea)},{'name':'description','type':a139_0x405dda(0x1e3),'description':a139_0x405dda(0x1dc)}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x2c5f72=a139_0x405dda;throw CliErrors[_0x2c5f72(0x1eb)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a140_0x2c5907=a140_0x541c;(function(_0x45c775,_0x1e4a6b){const _0x2d0d0a=a140_0x541c,_0x239e43=_0x45c775();while(!![]){try{const _0x8b7f6f=-parseInt(_0x2d0d0a(0xbb))/0x1+parseInt(_0x2d0d0a(0xae))/0x2*(-parseInt(_0x2d0d0a(0xb4))/0x3)+parseInt(_0x2d0d0a(0xb6))/0x4*(-parseInt(_0x2d0d0a(0xaf))/0x5)+-parseInt(_0x2d0d0a(0xb3))/0x6*(-parseInt(_0x2d0d0a(0xba))/0x7)+-parseInt(_0x2d0d0a(0xb0))/0x8+-parseInt(_0x2d0d0a(0xbe))/0x9+parseInt(_0x2d0d0a(0xbc))/0xa;if(_0x8b7f6f===_0x1e4a6b)break;else _0x239e43['push'](_0x239e43['shift']());}catch(_0x1c6c26){_0x239e43['push'](_0x239e43['shift']());}}}(a140_0x1afb,0x7e919));import{CliErrors}from'../../errors.js';function a140_0x541c(_0x144867,_0x1368a6){_0x144867=_0x144867-0xae;const _0x1afbc1=a140_0x1afb();let _0x541c73=_0x1afbc1[_0x144867];return _0x541c73;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a140_0x1afb(){const _0x64a53e=['Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','730556GKqjvW','2645KjaZbo','1338600rrqaqM','validation','save','618TCqJfg','3KwsanJ','description','5392fGjCVF','write','string','file','35301RtLXgh','905821TqOHrh','24488060SnzNLQ','sql','2684646DoFaRg','SQL\x20query\x20display\x20name','join'];a140_0x1afb=function(){return _0x64a53e;};return a140_0x1afb();}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`.','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`.'][a140_0x2c5907(0xc0)]('\x0a');export const sqlSave={'service':a140_0x2c5907(0xbd),'command':a140_0x2c5907(0xb2),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a140_0x2c5907(0xb7),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a140_0x2c5907(0xb9),'type':a140_0x2c5907(0xb8),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a140_0x2c5907(0xb8),'description':a140_0x2c5907(0xbf)},{'name':'db','type':a140_0x2c5907(0xb8),'description':a140_0x2c5907(0xc1)},{'name':a140_0x2c5907(0xb5),'type':a140_0x2c5907(0xb8),'description':'Query\x20description'}],async 'validate'(){const _0xdb2a00=a140_0x2c5907;throw CliErrors[_0xdb2a00(0xb1)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x1cae2f=a140_0x2c5907;throw CliErrors[_0x1cae2f(0xb1)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a140_0x12778d=a140_0x2b8f;(function(_0x31f0c8,_0x5d2cf7){const _0x22b1a9=a140_0x2b8f,_0x509a32=_0x31f0c8();while(!![]){try{const _0x2531af=parseInt(_0x22b1a9(0x1a7))/0x1*(parseInt(_0x22b1a9(0x1bf))/0x2)+parseInt(_0x22b1a9(0x1ce))/0x3*(-parseInt(_0x22b1a9(0x1c7))/0x4)+parseInt(_0x22b1a9(0x1c0))/0x5*(-parseInt(_0x22b1a9(0x1c9))/0x6)+-parseInt(_0x22b1a9(0x1b4))/0x7*(-parseInt(_0x22b1a9(0x1ca))/0x8)+parseInt(_0x22b1a9(0x1cc))/0x9*(parseInt(_0x22b1a9(0x1ac))/0xa)+parseInt(_0x22b1a9(0x1b1))/0xb*(parseInt(_0x22b1a9(0x1b7))/0xc)+-parseInt(_0x22b1a9(0x1c3))/0xd;if(_0x2531af===_0x5d2cf7)break;else _0x509a32['push'](_0x509a32['shift']());}catch(_0x4cdadd){_0x509a32['push'](_0x509a32['shift']());}}}(a140_0x1044,0x3732c));function a140_0x2b8f(_0x1facbb,_0xa9e437){_0x1facbb=_0x1facbb-0x1a2;const _0x1044aa=a140_0x1044();let _0x2b8f7e=_0x1044aa[_0x1facbb];return _0x2b8f7e;}import{createInterface}from'node:readline';import{join}from'node:path';function a140_0x1044(){const _0x3ffa27=['sqls','dbName','<!--\x20@lovrabet.','toLowerCase','endsWith','description','11TPsSat','includes','syncedAt','sqlContent','mybatisXml','603210FzLuBf','filter','lastSync','yes','sqlCode','13783MIHxaS','version','apps','7eXioRy','length','path','3864FMdyhi','sqlConfig','trim','close','trimStart','map','.rabetbase/sql','sqlRoot','38358GvLdfa','25fqghAA','mode','stderr','7881107vZGAJU','join','dbId','split','8KAmpqn','test','19554PZOcUc','2741944becEpz','sqlName','36gTAJch','fromEntries','524754hJjnsl','push'];a140_0x1044=function(){return _0x3ffa27;};return a140_0x1044();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a140_0x12778d(0x1bd);export function buildSqlLockEntry(_0x23ff09,_0x32ada0,_0x4c8728,_0x301642){const _0x45c3e0=a140_0x12778d,_0x10289b=detectSqlMode(_0x32ada0);return{'path':buildSqlRelativePath(_0x23ff09[_0x45c3e0(0x1b0)],_0x23ff09[_0x45c3e0(0x1cb)],_0x301642?.[_0x45c3e0(0x1a2)],_0x10289b,_0x23ff09[_0x45c3e0(0x1c5)]),'hash':_0x4c8728,'remoteId':_0x23ff09['id'],'version':_0x23ff09[_0x45c3e0(0x1b2)],'dbId':Number(_0x23ff09[_0x45c3e0(0x1c5)]),'dbName':_0x301642?.[_0x45c3e0(0x1a2)],'sqlName':_0x23ff09[_0x45c3e0(0x1cb)],'sqlConfig':_0x23ff09[_0x45c3e0(0x1b8)]??undefined,'mode':_0x10289b};}export function cloneSqlLockData(_0x4a728b){const _0x114463=a140_0x12778d;return{'apps':Object[_0x114463(0x1cd)](Object['entries'](_0x4a728b[_0x114463(0x1b3)])[_0x114463(0x1bc)](([_0x3c7061,_0x342955])=>[_0x3c7061,{'sqlRoot':_0x342955[_0x114463(0x1be)],'lastSync':_0x342955[_0x114463(0x1ae)],'sqls':{..._0x342955[_0x114463(0x1d0)]}}]))};}export function ensureRemoteSqlContent(_0x103f28){const _0x491a40=a140_0x12778d;return _0x103f28[_0x491a40(0x1aa)]??'';}export function buildLocalSqlFileContent(_0x18cea0,_0xcfaee1,_0x257cfe){const _0x3c7152=a140_0x12778d,_0x4592c2=_0x257cfe?.['mode']??detectSqlMode(_0xcfaee1),_0x301986=stripLocalSqlMetadata(_0xcfaee1,_0x4592c2)[_0x3c7152(0x1b9)](),_0x5e20c1=[...buildMetadataHeaderLines({'sqlCode':_0x18cea0[_0x3c7152(0x1b0)],'sqlName':_0x18cea0[_0x3c7152(0x1cb)],'dbId':_0x18cea0['dbId'],'dbName':_0x257cfe?.[_0x3c7152(0x1a2)],'mode':_0x4592c2,'syncedAt':_0x257cfe?.[_0x3c7152(0x1a9)],'description':_0x257cfe?.[_0x3c7152(0x1a6)]},_0x4592c2),'',_0x301986],_0xe930e7=_0x5e20c1[_0x3c7152(0x1c4)]('\x0a');return _0xe930e7[_0x3c7152(0x1a5)]('\x0a')?_0xe930e7:_0xe930e7+'\x0a';}export function stripLocalSqlMetadata(_0x580173,_0x34d8e0){const _0x5a4f99=a140_0x12778d,_0x32bd05=_0x580173['replace'](/\r\n/g,'\x0a')[_0x5a4f99(0x1c6)]('\x0a'),_0x525526=[];let _0x4adf8e=0x0;if(_0x34d8e0===_0x5a4f99(0x1ab))while(_0x4adf8e<_0x32bd05[_0x5a4f99(0x1b5)]){const _0x199414=_0x32bd05[_0x4adf8e]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5a4f99(0x1c8)](_0x199414)){_0x4adf8e++;continue;}if(_0x199414[_0x5a4f99(0x1b9)]()===''&&_0x4adf8e>0x0){_0x4adf8e++;continue;}break;}else while(_0x4adf8e<_0x32bd05['length']){const _0x7d8ef8=_0x32bd05[_0x4adf8e]??'';if(/^\s*--\s*@lovrabet\./[_0x5a4f99(0x1c8)](_0x7d8ef8)){_0x4adf8e++;continue;}if(_0x7d8ef8[_0x5a4f99(0x1b9)]()===''&&_0x4adf8e>0x0){_0x4adf8e++;continue;}break;}for(;_0x4adf8e<_0x32bd05[_0x5a4f99(0x1b5)];_0x4adf8e++){_0x525526[_0x5a4f99(0x1cf)](_0x32bd05[_0x4adf8e]);}return _0x525526[_0x5a4f99(0x1c4)]('\x0a')[_0x5a4f99(0x1bb)]();}export function resolveSqlMode(_0x29bdfc,_0x11c291){const _0x2e2881=a140_0x12778d;if(_0x11c291?.[_0x2e2881(0x1c1)])return _0x11c291[_0x2e2881(0x1c1)];return detectSqlMode(_0x29bdfc);}export function resolveSqlFileName(_0x2edd6b,_0x51b611,_0x34638b){const _0x1ba784=a140_0x12778d;if(_0x34638b?.[_0x1ba784(0x1b6)])return _0x34638b[_0x1ba784(0x1b6)];if(_0x34638b?.[_0x1ba784(0x1cb)]||_0x34638b?.['dbName'])return buildSqlRelativePath(_0x2edd6b,_0x34638b?.[_0x1ba784(0x1cb)],_0x34638b?.[_0x1ba784(0x1a2)],resolveSqlMode(_0x51b611,_0x34638b),_0x34638b?.['dbId']);return buildDefaultSqlFileName(_0x2edd6b,resolveSqlMode(_0x51b611,_0x34638b));}export function resolveSqlLocalDir(_0x3d2963,_0x68c36){return join(_0x3d2963,SQL_LOCAL_REL_DIR,_0x68c36);}export async function confirmForceOverwrite(_0x621952){const _0x3fbf76=a140_0x12778d,_0x48476c=createInterface({'input':process['stdin'],'output':process[_0x3fbf76(0x1c2)]}),_0x1c3706=await new Promise(_0x77300f=>{_0x48476c['question'](_0x621952+'\x20[y/N]\x20',_0x77300f);});return _0x48476c[_0x3fbf76(0x1ba)](),['y',_0x3fbf76(0x1af)][_0x3fbf76(0x1a8)](_0x1c3706['trim']()[_0x3fbf76(0x1a4)]());}export function findSqlLockScope(_0x2bdf95,_0x58e272){return _0x2bdf95['apps'][_0x58e272];}function buildMetadataHeaderLines(_0x5e1e7e,_0x6b410a){const _0x4496cf=a140_0x12778d,_0x33bea8=[['sqlCode',_0x5e1e7e[_0x4496cf(0x1b0)]],['sqlName',_0x5e1e7e['sqlName']],[_0x4496cf(0x1c5),_0x5e1e7e['dbId']],['dbName',_0x5e1e7e[_0x4496cf(0x1a2)]],[_0x4496cf(0x1c1),_0x5e1e7e[_0x4496cf(0x1c1)]],[_0x4496cf(0x1a9),_0x5e1e7e[_0x4496cf(0x1a9)]],['description',_0x5e1e7e[_0x4496cf(0x1a6)]]];if(_0x6b410a===_0x4496cf(0x1ab))return _0x33bea8[_0x4496cf(0x1ad)](([,_0x5ca1d0])=>_0x5ca1d0!==undefined&&_0x5ca1d0!==null&&String(_0x5ca1d0)[_0x4496cf(0x1b9)]()!=='')['map'](([_0x5a42e9,_0x2e9dd3])=>_0x4496cf(0x1a3)+_0x5a42e9+':\x20'+String(_0x2e9dd3)+'\x20-->');return _0x33bea8[_0x4496cf(0x1ad)](([,_0x57d9f2])=>_0x57d9f2!==undefined&&_0x57d9f2!==null&&String(_0x57d9f2)['trim']()!=='')['map'](([_0x228cd6,_0x18a93c])=>'--\x20@lovrabet.'+_0x228cd6+':\x20'+String(_0x18a93c));}
1
+ (function(_0x27f375,_0x17362e){const _0x324026=a141_0x10e5,_0x5a5c59=_0x27f375();while(!![]){try{const _0x3613c6=parseInt(_0x324026(0x20a))/0x1+-parseInt(_0x324026(0x1f1))/0x2*(parseInt(_0x324026(0x20f))/0x3)+parseInt(_0x324026(0x20c))/0x4+parseInt(_0x324026(0x20d))/0x5+-parseInt(_0x324026(0x1f8))/0x6*(parseInt(_0x324026(0x1f2))/0x7)+-parseInt(_0x324026(0x1fd))/0x8+parseInt(_0x324026(0x1fb))/0x9;if(_0x3613c6===_0x17362e)break;else _0x5a5c59['push'](_0x5a5c59['shift']());}catch(_0x337267){_0x5a5c59['push'](_0x5a5c59['shift']());}}}(a141_0x5738,0x692c1));function a141_0x10e5(_0x497e1a,_0x6ddb12){_0x497e1a=_0x497e1a-0x1e5;const _0x5738c0=a141_0x5738();let _0x10e55=_0x5738c0[_0x497e1a];return _0x10e55;}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(_0x30b7bd,_0x23a88e,_0x582805,_0x564d58){const _0x1c08d4=a141_0x10e5,_0x2b0904=detectSqlMode(_0x23a88e);return{'path':buildSqlRelativePath(_0x30b7bd[_0x1c08d4(0x1fe)],_0x30b7bd[_0x1c08d4(0x202)],_0x564d58?.[_0x1c08d4(0x1eb)],_0x2b0904,_0x30b7bd[_0x1c08d4(0x206)]),'hash':_0x582805,'remoteId':_0x30b7bd['id'],'version':_0x30b7bd[_0x1c08d4(0x200)],'dbId':Number(_0x30b7bd[_0x1c08d4(0x206)]),'dbName':_0x564d58?.[_0x1c08d4(0x1eb)],'sqlName':_0x30b7bd[_0x1c08d4(0x202)],'sqlConfig':_0x30b7bd[_0x1c08d4(0x1e8)]??undefined,'mode':_0x2b0904};}export function cloneSqlLockData(_0x3caae0){const _0x557307=a141_0x10e5;return{'apps':Object[_0x557307(0x1ec)](Object[_0x557307(0x210)](_0x3caae0[_0x557307(0x1f0)])['map'](([_0x28983f,_0x36fe28])=>[_0x28983f,{'sqlRoot':_0x36fe28[_0x557307(0x1fa)],'lastSync':_0x36fe28['lastSync'],'sqls':{..._0x36fe28[_0x557307(0x205)]}}]))};}export function ensureRemoteSqlContent(_0x4c33d9){const _0x375e58=a141_0x10e5;return _0x4c33d9[_0x375e58(0x1e5)]??'';}export function buildLocalSqlFileContent(_0x58c298,_0x1116f0,_0x3fd372){const _0x133e94=a141_0x10e5,_0x370969=_0x3fd372?.[_0x133e94(0x1e7)]??detectSqlMode(_0x1116f0),_0x6036fd=stripLocalSqlMetadata(_0x1116f0,_0x370969)['trim'](),_0x3dafb1=[...buildMetadataHeaderLines({'sqlCode':_0x58c298[_0x133e94(0x1fe)],'sqlName':_0x58c298[_0x133e94(0x202)],'dbId':_0x58c298[_0x133e94(0x206)],'dbName':_0x3fd372?.[_0x133e94(0x1eb)],'mode':_0x370969,'syncedAt':_0x3fd372?.['syncedAt'],'description':_0x3fd372?.[_0x133e94(0x1f5)]},_0x370969),'',_0x6036fd],_0x3b358d=_0x3dafb1[_0x133e94(0x208)]('\x0a');return _0x3b358d['endsWith']('\x0a')?_0x3b358d:_0x3b358d+'\x0a';}export function stripLocalSqlMetadata(_0x5f0832,_0x73c848){const _0x4daf03=a141_0x10e5,_0xd33c37=_0x5f0832[_0x4daf03(0x1f4)](/\r\n/g,'\x0a')[_0x4daf03(0x1e9)]('\x0a'),_0x254dc0=[];let _0xb20b5f=0x0;if(_0x73c848===_0x4daf03(0x203))while(_0xb20b5f<_0xd33c37[_0x4daf03(0x1ee)]){const _0x2d849d=_0xd33c37[_0xb20b5f]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4daf03(0x20b)](_0x2d849d)){_0xb20b5f++;continue;}if(_0x2d849d[_0x4daf03(0x1ed)]()===''&&_0xb20b5f>0x0){_0xb20b5f++;continue;}break;}else while(_0xb20b5f<_0xd33c37[_0x4daf03(0x1ee)]){const _0x6f203=_0xd33c37[_0xb20b5f]??'';if(/^\s*--\s*@lovrabet\./[_0x4daf03(0x20b)](_0x6f203)){_0xb20b5f++;continue;}if(_0x6f203[_0x4daf03(0x1ed)]()===''&&_0xb20b5f>0x0){_0xb20b5f++;continue;}break;}for(;_0xb20b5f<_0xd33c37[_0x4daf03(0x1ee)];_0xb20b5f++){_0x254dc0[_0x4daf03(0x209)](_0xd33c37[_0xb20b5f]);}return _0x254dc0['join']('\x0a')[_0x4daf03(0x1f6)]();}function a141_0x5738(){const _0x42be0f=['sqlRoot','1438587yxvaoQ','path','588664NUsIhY','sqlCode','syncedAt','version','yes','sqlName','mybatisXml','question','sqls','dbId','map','join','push','536580fHXjHJ','test','103864POKgoe','2885095ZXNkHd','filter','9esnDFm','entries','sqlContent','--\x20@lovrabet.','mode','sqlConfig','split','toLowerCase','dbName','fromEntries','trim','length','stderr','apps','252022lZEUdI','7JzTEjh','close','replace','description','trimStart','stdin','2502042fpFVYL','\x20[y/N]\x20'];a141_0x5738=function(){return _0x42be0f;};return a141_0x5738();}export function resolveSqlMode(_0x29c6c3,_0x120da6){const _0x43feaf=a141_0x10e5;if(_0x120da6?.[_0x43feaf(0x1e7)])return _0x120da6[_0x43feaf(0x1e7)];return detectSqlMode(_0x29c6c3);}export function resolveSqlFileName(_0x161caf,_0x79e07d,_0x5087e9){const _0x439af4=a141_0x10e5;if(_0x5087e9?.[_0x439af4(0x1fc)])return _0x5087e9['path'];if(_0x5087e9?.[_0x439af4(0x202)]||_0x5087e9?.[_0x439af4(0x1eb)])return buildSqlRelativePath(_0x161caf,_0x5087e9?.[_0x439af4(0x202)],_0x5087e9?.[_0x439af4(0x1eb)],resolveSqlMode(_0x79e07d,_0x5087e9),_0x5087e9?.[_0x439af4(0x206)]);return buildDefaultSqlFileName(_0x161caf,resolveSqlMode(_0x79e07d,_0x5087e9));}export function resolveSqlLocalDir(_0x4bef15,_0x4ae4cb){return join(_0x4bef15,SQL_LOCAL_REL_DIR,_0x4ae4cb);}export async function confirmForceOverwrite(_0x440630){const _0x3cf486=a141_0x10e5,_0x5806d0=createInterface({'input':process[_0x3cf486(0x1f7)],'output':process[_0x3cf486(0x1ef)]}),_0x12690f=await new Promise(_0x2a5808=>{const _0x474792=_0x3cf486;_0x5806d0[_0x474792(0x204)](_0x440630+_0x474792(0x1f9),_0x2a5808);});return _0x5806d0[_0x3cf486(0x1f3)](),['y',_0x3cf486(0x201)]['includes'](_0x12690f['trim']()[_0x3cf486(0x1ea)]());}export function findSqlLockScope(_0x3c59a0,_0x39558f){const _0x132b63=a141_0x10e5;return _0x3c59a0[_0x132b63(0x1f0)][_0x39558f];}function buildMetadataHeaderLines(_0x32e8a2,_0x585b1c){const _0x259e02=a141_0x10e5,_0x327058=[[_0x259e02(0x1fe),_0x32e8a2['sqlCode']],[_0x259e02(0x202),_0x32e8a2[_0x259e02(0x202)]],['dbId',_0x32e8a2[_0x259e02(0x206)]],[_0x259e02(0x1eb),_0x32e8a2[_0x259e02(0x1eb)]],['mode',_0x32e8a2[_0x259e02(0x1e7)]],[_0x259e02(0x1ff),_0x32e8a2[_0x259e02(0x1ff)]],[_0x259e02(0x1f5),_0x32e8a2[_0x259e02(0x1f5)]]];if(_0x585b1c==='mybatisXml')return _0x327058[_0x259e02(0x20e)](([,_0x137e3e])=>_0x137e3e!==undefined&&_0x137e3e!==null&&String(_0x137e3e)['trim']()!=='')['map'](([_0x2072d9,_0x17a74d])=>'<!--\x20@lovrabet.'+_0x2072d9+':\x20'+String(_0x17a74d)+'\x20-->');return _0x327058[_0x259e02(0x20e)](([,_0x4721cd])=>_0x4721cd!==undefined&&_0x4721cd!==null&&String(_0x4721cd)[_0x259e02(0x1ed)]()!=='')[_0x259e02(0x207)](([_0x368807,_0x55055b])=>_0x259e02(0x1e6)+_0x368807+':\x20'+String(_0x55055b));}
@@ -1 +1 @@
1
- const a141_0x5b3f57=a141_0x3479;(function(_0x4e15d7,_0x2e500f){const _0x2b76d3=a141_0x3479,_0xc2b5dd=_0x4e15d7();while(!![]){try{const _0xad4c91=-parseInt(_0x2b76d3(0x172))/0x1+-parseInt(_0x2b76d3(0x173))/0x2*(-parseInt(_0x2b76d3(0x188))/0x3)+-parseInt(_0x2b76d3(0x174))/0x4*(parseInt(_0x2b76d3(0x168))/0x5)+-parseInt(_0x2b76d3(0x187))/0x6+-parseInt(_0x2b76d3(0x17a))/0x7+-parseInt(_0x2b76d3(0x183))/0x8*(-parseInt(_0x2b76d3(0x165))/0x9)+parseInt(_0x2b76d3(0x184))/0xa*(parseInt(_0x2b76d3(0x167))/0xb);if(_0xad4c91===_0x2e500f)break;else _0xc2b5dd['push'](_0xc2b5dd['shift']());}catch(_0xf3341c){_0xc2b5dd['push'](_0xc2b5dd['shift']());}}}(a141_0x314c,0xbd258));import{listSqlQueries}from'../../core/api-client.js';function a141_0x314c(){const _0x141925=['relativePath','filePath','\x20missing,\x20','\x20remote-only','sqlRoot','6984201osVjGS','sqls','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','status','appCode','hash','sqlName','sqlCode','path','273688NYDEWN','834940KHXgEd','lockFilePath','map','8844570DxHcYn','2598uJwbvv','push','length','totalCount','9QbDbrd','lockKey','605eOAxIa','17075ErwUah','paging','bool','keys','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','remote','has','\x20unchanged','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','1446017VAlWoy','2866ICBMuH','1376HWZEbb'];a141_0x314c=function(){return _0x141925;};return a141_0x314c();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a141_0x3479(_0xaa9b87,_0x5c976c){_0xaa9b87=_0xaa9b87-0x162;const _0x314c99=a141_0x314c();let _0x3479d7=_0x314c99[_0xaa9b87];return _0x3479d7;}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x737434){const _0x50d11c=a141_0x3479,_0x14fe09=[];let _0x57ced2=0x1;while(!![]){const _0x32d72e=await listSqlQueries(_0x737434,{'currentPage':_0x57ced2,'pageSize':PAGE_SIZE}),_0x2b1568=_0x32d72e['tableData']??[];_0x14fe09[_0x50d11c(0x162)](..._0x2b1568[_0x50d11c(0x186)](_0xe8fd71=>_0xe8fd71[_0x50d11c(0x181)]));if(_0x2b1568[_0x50d11c(0x163)]===0x0)break;const _0x3a3bfb=_0x32d72e[_0x50d11c(0x169)]?.[_0x50d11c(0x164)];if(_0x3a3bfb!=null?_0x14fe09[_0x50d11c(0x163)]>=_0x3a3bfb:_0x2b1568['length']<PAGE_SIZE)break;_0x57ced2++;}return _0x14fe09;}export const sqlStatus={'service':'sql','command':'status','description':a141_0x5b3f57(0x17c),'risk':a141_0x5b3f57(0x171),'flags':[{'name':a141_0x5b3f57(0x16d),'type':'boolean','description':a141_0x5b3f57(0x16c)}],async 'execute'(_0x350af9){const _0x54e407=a141_0x5b3f57,_0x315059=loadSqlProjectConfig(_0x350af9[_0x54e407(0x17e)]),_0x163cfa=await readSqlLockFile(_0x315059[_0x54e407(0x185)]),{appLock:_0x3035e9}=ensureSqlLockScope(_0x163cfa??createEmptySqlLock(),_0x315059[_0x54e407(0x17e)],_0x315059[_0x54e407(0x179)],_0x54e407(0x17d)),_0xcb80b8=await scanLocalSqlQueries(_0x315059),_0x32fa40=[],_0x2d3277=[],_0x11e0eb=[],_0x28e450=[],_0x11c5fa=new Set(_0xcb80b8['map'](_0x365748=>_0x365748[_0x54e407(0x166)]));for(const _0x30ce60 of _0xcb80b8){const _0x1cd32d=await computeSqlFileHash(_0x30ce60[_0x54e407(0x176)]),_0x545170=_0x3035e9[_0x54e407(0x17b)][_0x30ce60[_0x54e407(0x166)]],_0x334154=!!_0x545170&&_0x545170[_0x54e407(0x182)]!==_0x30ce60[_0x54e407(0x175)],_0x3f8c5a=!!_0x545170&&!!_0x30ce60[_0x54e407(0x180)]&&_0x545170[_0x54e407(0x180)]!==_0x30ce60[_0x54e407(0x180)];if(!_0x545170)_0x32fa40[_0x54e407(0x162)](_0x30ce60[_0x54e407(0x166)]);else _0x545170[_0x54e407(0x17f)]!==_0x1cd32d||_0x334154||_0x3f8c5a?_0x2d3277[_0x54e407(0x162)](_0x30ce60[_0x54e407(0x166)]):_0x11e0eb['push'](_0x30ce60[_0x54e407(0x166)]);}for(const _0x12761a of Object[_0x54e407(0x16b)](_0x3035e9[_0x54e407(0x17b)])){!_0x11c5fa[_0x54e407(0x16e)](_0x12761a)&&_0x28e450[_0x54e407(0x162)](_0x12761a);}const _0x5738a0=[];if(_0x350af9[_0x54e407(0x16a)](_0x54e407(0x16d))){const _0x1f80ab=await fetchAllSqlCodes(_0x350af9[_0x54e407(0x17e)]);for(const _0x3cfdf7 of _0x1f80ab){!_0x11c5fa[_0x54e407(0x16e)](_0x3cfdf7)&&!_0x3035e9[_0x54e407(0x17b)][_0x3cfdf7]&&_0x5738a0[_0x54e407(0x162)](_0x3cfdf7);}}const _0x4632a6=_0x32fa40[_0x54e407(0x163)]===0x0&&_0x2d3277[_0x54e407(0x163)]===0x0&&_0x28e450[_0x54e407(0x163)]===0x0&&_0x5738a0[_0x54e407(0x163)]===0x0;return{'ok':!![],'data':{'added':_0x32fa40,'modified':_0x2d3277,'missing':_0x28e450,'unchanged':_0x11e0eb,'remoteOnly':_0x5738a0},'message':_0x4632a6?_0x54e407(0x170):_0x32fa40[_0x54e407(0x163)]+'\x20added,\x20'+_0x2d3277[_0x54e407(0x163)]+'\x20modified,\x20'+_0x28e450[_0x54e407(0x163)]+_0x54e407(0x177)+_0x11e0eb[_0x54e407(0x163)]+_0x54e407(0x16f)+(_0x5738a0['length']>0x0?',\x20'+_0x5738a0['length']+_0x54e407(0x178):'')};}};
1
+ const a142_0x56640c=a142_0x53eb;function a142_0x53eb(_0x167162,_0x5bbf81){_0x167162=_0x167162-0xe5;const _0x58f0df=a142_0x58f0();let _0x53eb6d=_0x58f0df[_0x167162];return _0x53eb6d;}(function(_0x3de40b,_0x7d7e88){const _0xfb40bf=a142_0x53eb,_0x203791=_0x3de40b();while(!![]){try{const _0x40e082=parseInt(_0xfb40bf(0xf2))/0x1+-parseInt(_0xfb40bf(0xfa))/0x2*(-parseInt(_0xfb40bf(0xf4))/0x3)+parseInt(_0xfb40bf(0xe6))/0x4*(-parseInt(_0xfb40bf(0xfe))/0x5)+parseInt(_0xfb40bf(0x102))/0x6*(-parseInt(_0xfb40bf(0xf3))/0x7)+parseInt(_0xfb40bf(0xee))/0x8*(-parseInt(_0xfb40bf(0x100))/0x9)+-parseInt(_0xfb40bf(0xfd))/0xa+parseInt(_0xfb40bf(0xfc))/0xb;if(_0x40e082===_0x7d7e88)break;else _0x203791['push'](_0x203791['shift']());}catch(_0x1fcf98){_0x203791['push'](_0x203791['shift']());}}}(a142_0x58f0,0xd9150));function a142_0x58f0(){const _0x485ece=['length','292mQqLeD','status','\x20modified,\x20','map','paging','tableData','relativePath','\x20unchanged','5639656TXGAvo','push','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','remote','226258YQNusw','1659DfJnJU','1508607VeOQqX','sqls','sql','sqlName','\x20added,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','4dDKirS','appCode','39242643wTWRIp','7411020JZWsnf','46285RhOLsz','\x20missing,\x20','18hLpncn','sqlCode','27432sszlCU','bool','sqlRoot','lockKey','\x20remote-only','filePath'];a142_0x58f0=function(){return _0x485ece;};return a142_0x58f0();}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';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3ba060){const _0x284de2=a142_0x53eb,_0x493785=[];let _0x5a904c=0x1;while(!![]){const _0xda436e=await listSqlQueries(_0x3ba060,{'currentPage':_0x5a904c,'pageSize':PAGE_SIZE}),_0x3faca4=_0xda436e[_0x284de2(0xeb)]??[];_0x493785[_0x284de2(0xef)](..._0x3faca4[_0x284de2(0xe9)](_0x12394e=>_0x12394e[_0x284de2(0x101)]));if(_0x3faca4['length']===0x0)break;const _0x9d2e6b=_0xda436e[_0x284de2(0xea)]?.['totalCount'];if(_0x9d2e6b!=null?_0x493785[_0x284de2(0xe5)]>=_0x9d2e6b:_0x3faca4[_0x284de2(0xe5)]<PAGE_SIZE)break;_0x5a904c++;}return _0x493785;}export const sqlStatus={'service':a142_0x56640c(0xf6),'command':a142_0x56640c(0xe7),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':a142_0x56640c(0xf1),'type':'boolean','description':a142_0x56640c(0xf0)}],async 'execute'(_0x4c0017){const _0x345f11=a142_0x56640c,_0x55edcf=loadSqlProjectConfig(_0x4c0017[_0x345f11(0xfb)]),_0x5809f9=await readSqlLockFile(_0x55edcf['lockFilePath']),{appLock:_0x50b4b4}=ensureSqlLockScope(_0x5809f9??createEmptySqlLock(),_0x55edcf['appCode'],_0x55edcf[_0x345f11(0x104)],_0x345f11(0xe7)),_0x349a2f=await scanLocalSqlQueries(_0x55edcf),_0x5ad389=[],_0x241f7c=[],_0x523e0a=[],_0x1e15f4=[],_0x5642ed=new Set(_0x349a2f[_0x345f11(0xe9)](_0x5b04d7=>_0x5b04d7[_0x345f11(0x105)]));for(const _0x2e096a of _0x349a2f){const _0x3fbd89=await computeSqlFileHash(_0x2e096a[_0x345f11(0x107)]),_0x2eb004=_0x50b4b4['sqls'][_0x2e096a[_0x345f11(0x105)]],_0x1615e7=!!_0x2eb004&&_0x2eb004['path']!==_0x2e096a[_0x345f11(0xec)],_0xa0b6eb=!!_0x2eb004&&!!_0x2e096a[_0x345f11(0xf7)]&&_0x2eb004[_0x345f11(0xf7)]!==_0x2e096a[_0x345f11(0xf7)];if(!_0x2eb004)_0x5ad389[_0x345f11(0xef)](_0x2e096a[_0x345f11(0x105)]);else _0x2eb004['hash']!==_0x3fbd89||_0x1615e7||_0xa0b6eb?_0x241f7c[_0x345f11(0xef)](_0x2e096a['lockKey']):_0x523e0a[_0x345f11(0xef)](_0x2e096a[_0x345f11(0x105)]);}for(const _0x537208 of Object['keys'](_0x50b4b4[_0x345f11(0xf5)])){!_0x5642ed['has'](_0x537208)&&_0x1e15f4[_0x345f11(0xef)](_0x537208);}const _0x4358d8=[];if(_0x4c0017[_0x345f11(0x103)]('remote')){const _0x53d1f2=await fetchAllSqlCodes(_0x4c0017['appCode']);for(const _0x5f5626 of _0x53d1f2){!_0x5642ed['has'](_0x5f5626)&&!_0x50b4b4[_0x345f11(0xf5)][_0x5f5626]&&_0x4358d8[_0x345f11(0xef)](_0x5f5626);}}const _0x4861d2=_0x5ad389['length']===0x0&&_0x241f7c[_0x345f11(0xe5)]===0x0&&_0x1e15f4[_0x345f11(0xe5)]===0x0&&_0x4358d8[_0x345f11(0xe5)]===0x0;return{'ok':!![],'data':{'added':_0x5ad389,'modified':_0x241f7c,'missing':_0x1e15f4,'unchanged':_0x523e0a,'remoteOnly':_0x4358d8},'message':_0x4861d2?_0x345f11(0xf9):_0x5ad389[_0x345f11(0xe5)]+_0x345f11(0xf8)+_0x241f7c[_0x345f11(0xe5)]+_0x345f11(0xe8)+_0x1e15f4[_0x345f11(0xe5)]+_0x345f11(0xff)+_0x523e0a['length']+_0x345f11(0xed)+(_0x4358d8[_0x345f11(0xe5)]>0x0?',\x20'+_0x4358d8[_0x345f11(0xe5)]+_0x345f11(0x106):'')};}};
@@ -1 +1 @@
1
- const a142_0x433114=a142_0x25bb;(function(_0x34b464,_0x52ed00){const _0x19a45a=a142_0x25bb,_0x4c2307=_0x34b464();while(!![]){try{const _0x3534dd=parseInt(_0x19a45a(0x99))/0x1*(parseInt(_0x19a45a(0x7c))/0x2)+parseInt(_0x19a45a(0x86))/0x3+-parseInt(_0x19a45a(0x92))/0x4*(parseInt(_0x19a45a(0x7a))/0x5)+-parseInt(_0x19a45a(0x70))/0x6*(-parseInt(_0x19a45a(0x9e))/0x7)+-parseInt(_0x19a45a(0xa1))/0x8*(parseInt(_0x19a45a(0x94))/0x9)+parseInt(_0x19a45a(0x69))/0xa*(parseInt(_0x19a45a(0x71))/0xb)+parseInt(_0x19a45a(0x72))/0xc*(-parseInt(_0x19a45a(0x83))/0xd);if(_0x3534dd===_0x52ed00)break;else _0x4c2307['push'](_0x4c2307['shift']());}catch(_0x318e19){_0x4c2307['push'](_0x4c2307['shift']());}}}(a142_0x48b6,0xa5780));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a142_0x25bb(_0x432ad9,_0x41b8be){_0x432ad9=_0x432ad9-0x69;const _0x48b6bc=a142_0x48b6();let _0x25bbc0=_0x48b6bc[_0x432ad9];return _0x25bbc0;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a142_0x48b6(){const _0xf20401=['fields','flagMissing','tableName','toLowerCase','sqlType','utf-8','18EoJGjg','11ocfbxP','3606684cdXyrr','validate','from','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','filter','split','push','isArray','110ZuijbS','sql','55442PQdYFX','parameters','read','schema:','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','type','valid','91xjgTpk','File\x20not\x20found:\x20','SQL\x20schema\x20validation','3905667iriDrL','\x22\x20not\x20found\x20in\x20any\x20dataset','trim','Table\x20\x22','cwd','schemaWarnings','isSelectOnly','size','dbtableConfig','isDangerous','file','message','184ssriKi','\x22\x20not\x20found\x20or\x20not\x20accessible','1764459SSNBsc','reason','get','Dataset\x20\x22','tables','47pVcHZR','map','name','schemas','Provide\x20--file\x20or\x20--sql','1885191kIeSOP','str','string','48FGsgMx','5462620VdZkTr'];a142_0x48b6=function(){return _0xf20401;};return a142_0x48b6();}export const sqlValidate={'service':a142_0x433114(0x7b),'command':a142_0x433114(0x73),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a142_0x433114(0x7e),'flags':[{'name':a142_0x433114(0x90),'type':a142_0x433114(0xa0),'description':a142_0x433114(0x75)},{'name':'sql','type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a142_0x433114(0x9c),'type':a142_0x433114(0xa0),'description':a142_0x433114(0x80)}],async 'execute'(_0x209445){const _0x169406=a142_0x433114,_0x3ca594=_0x209445[_0x169406(0x9f)](_0x169406(0x90)),_0x188662=_0x209445[_0x169406(0x9f)]('sql');if(!_0x3ca594&&!_0x188662)throw CliErrors[_0x169406(0x6b)](_0x169406(0x90),_0x169406(0x9d));let _0x23b6ca;if(_0x3ca594){const _0x1fe34d=resolve(process[_0x169406(0x8a)](),_0x3ca594);if(!existsSync(_0x1fe34d))throw CliErrors['validation'](_0x169406(0x84)+_0x1fe34d);_0x23b6ca=readFileSync(_0x1fe34d,_0x169406(0x6f));}else _0x23b6ca=_0x188662;const _0x1a3978=validateSql(_0x23b6ca),_0x3acf3e={'valid':_0x1a3978['valid'],'sqlType':_0x1a3978[_0x169406(0x6e)][_0x169406(0x81)],'isSelectOnly':_0x1a3978[_0x169406(0x6e)][_0x169406(0x8c)],'isDangerous':_0x1a3978[_0x169406(0x6e)][_0x169406(0x8f)],'tables':_0x1a3978[_0x169406(0x98)],'parameters':_0x1a3978[_0x169406(0x7d)],'message':_0x1a3978[_0x169406(0x91)]};_0x1a3978[_0x169406(0x6e)][_0x169406(0x95)]&&(_0x3acf3e[_0x169406(0x95)]=_0x1a3978[_0x169406(0x6e)][_0x169406(0x95)]);const _0x43379a=_0x209445[_0x169406(0x9f)](_0x169406(0x9c));if(_0x43379a&&_0x1a3978[_0x169406(0x82)]){const _0x269477=_0x43379a[_0x169406(0x77)](',')['map'](_0x2827d8=>_0x2827d8[_0x169406(0x88)]())[_0x169406(0x76)](Boolean),_0x2c06df=[],_0x4e2fad=filterDbTableBackedDatasets(await listDatasets(_0x209445['appCode'])),_0x22ddc6=new Map(_0x4e2fad[_0x169406(0x9a)](_0x233182=>[_0x233182[_0x169406(0x8e)]?.[_0x169406(0x6c)]?.['toLowerCase'](),_0x233182]));for(const _0xc30149 of _0x1a3978[_0x169406(0x98)]){const _0x3090b4=_0x22ddc6[_0x169406(0x96)](_0xc30149[_0x169406(0x6d)]());!_0x3090b4&&_0x2c06df[_0x169406(0x78)](_0x169406(0x89)+_0xc30149+_0x169406(0x87));}for(const _0x42e0d8 of _0x269477){let _0x5f282d;try{_0x5f282d=await getDatasetDetail(_0x42e0d8);}catch{_0x2c06df[_0x169406(0x78)](_0x169406(0x97)+_0x42e0d8+_0x169406(0x93));continue;}assertDatasetIsDbTableBacked(_0x5f282d,_0x169406(0x85));const _0x3fd988=Array[_0x169406(0x79)](_0x5f282d[_0x169406(0x6a)])?_0x5f282d[_0x169406(0x6a)]:[],_0x1174c8=new Set(_0x3fd988[_0x169406(0x9a)](_0xac9213=>_0xac9213[_0x169406(0x9b)]?.[_0x169406(0x6d)]())),_0x3aecdc=_0x5f282d['dbtableConfig']?.[_0x169406(0x6c)]||_0x5f282d['tableName']||_0x42e0d8;_0x3acf3e[_0x169406(0x7f)+_0x3aecdc]={'code':_0x42e0d8,'tableName':_0x3aecdc,'fieldCount':_0x1174c8[_0x169406(0x8d)],'fields':Array[_0x169406(0x74)](_0x1174c8)};}_0x2c06df['length']>0x0&&(_0x3acf3e[_0x169406(0x8b)]=_0x2c06df);}return{'ok':_0x1a3978['valid'],'data':_0x3acf3e,'message':_0x1a3978[_0x169406(0x91)]};}};
1
+ const a143_0x5ba70d=a143_0x3eb1;(function(_0x2654a3,_0x585b8c){const _0x80d26f=a143_0x3eb1,_0x1da43b=_0x2654a3();while(!![]){try{const _0x4ddb26=-parseInt(_0x80d26f(0x210))/0x1+parseInt(_0x80d26f(0x212))/0x2*(parseInt(_0x80d26f(0x213))/0x3)+-parseInt(_0x80d26f(0x20f))/0x4*(parseInt(_0x80d26f(0x20a))/0x5)+-parseInt(_0x80d26f(0x1f9))/0x6+parseInt(_0x80d26f(0x1f5))/0x7+parseInt(_0x80d26f(0x1f7))/0x8+parseInt(_0x80d26f(0x21b))/0x9;if(_0x4ddb26===_0x585b8c)break;else _0x1da43b['push'](_0x1da43b['shift']());}catch(_0x1af433){_0x1da43b['push'](_0x1da43b['shift']());}}}(a143_0x478e,0x62b43));function a143_0x478e(){const _0x2d637d=['map','flagMissing','2231190cdGIat','message','isSelectOnly','reason','push','schemaWarnings','valid','validation','parameters','appCode','sql','2636977uHXVBU','toLowerCase','5158872Ozybmt','string','3284364KfewcO','fields','file','length','tables','sqlType','type','trim','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','Table\x20\x22','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','tableName','utf-8','Provide\x20--file\x20or\x20--sql','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','str','filter','5Dhagex','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','split','get','isDangerous','2713400mBPebZ','70587saHVCe','from','1086WkVaUV','2382DsvGRg','schema:','schemas','size','File\x20not\x20found:\x20','\x22\x20not\x20found\x20or\x20not\x20accessible'];a143_0x478e=function(){return _0x2d637d;};return a143_0x478e();}import{readFileSync,existsSync}from'node:fs';function a143_0x3eb1(_0x5b4698,_0x15d73c){_0x5b4698=_0x5b4698-0x1f1;const _0x478e10=a143_0x478e();let _0x3eb14f=_0x478e10[_0x5b4698];return _0x3eb14f;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a143_0x5ba70d(0x1f4),'command':'validate','description':a143_0x5ba70d(0x201),'risk':'read','flags':[{'name':'file','type':a143_0x5ba70d(0x1f8),'description':a143_0x5ba70d(0x203)},{'name':a143_0x5ba70d(0x1f4),'type':a143_0x5ba70d(0x1f8),'description':a143_0x5ba70d(0x20b)},{'name':a143_0x5ba70d(0x215),'type':a143_0x5ba70d(0x1f8),'description':a143_0x5ba70d(0x207)}],async 'execute'(_0x48e686){const _0x25897b=a143_0x5ba70d,_0x2d8f2e=_0x48e686['str']('file'),_0x480d5d=_0x48e686[_0x25897b(0x208)](_0x25897b(0x1f4));if(!_0x2d8f2e&&!_0x480d5d)throw CliErrors[_0x25897b(0x21a)](_0x25897b(0x1fb),_0x25897b(0x206));let _0x9ea444;if(_0x2d8f2e){const _0x463028=resolve(process['cwd'](),_0x2d8f2e);if(!existsSync(_0x463028))throw CliErrors[_0x25897b(0x1f1)](_0x25897b(0x217)+_0x463028);_0x9ea444=readFileSync(_0x463028,_0x25897b(0x205));}else _0x9ea444=_0x480d5d;const _0x1a5304=validateSql(_0x9ea444),_0x540918={'valid':_0x1a5304['valid'],'sqlType':_0x1a5304[_0x25897b(0x1fe)][_0x25897b(0x1ff)],'isSelectOnly':_0x1a5304[_0x25897b(0x1fe)][_0x25897b(0x21d)],'isDangerous':_0x1a5304[_0x25897b(0x1fe)][_0x25897b(0x20e)],'tables':_0x1a5304[_0x25897b(0x1fd)],'parameters':_0x1a5304[_0x25897b(0x1f2)],'message':_0x1a5304[_0x25897b(0x21c)]};_0x1a5304[_0x25897b(0x1fe)][_0x25897b(0x21e)]&&(_0x540918['reason']=_0x1a5304['sqlType'][_0x25897b(0x21e)]);const _0x4edbe3=_0x48e686['str'](_0x25897b(0x215));if(_0x4edbe3&&_0x1a5304[_0x25897b(0x221)]){const _0x4ae384=_0x4edbe3[_0x25897b(0x20c)](',')['map'](_0x57292c=>_0x57292c[_0x25897b(0x200)]())[_0x25897b(0x209)](Boolean),_0x576553=[],_0x452bc3=filterDbTableBackedDatasets(await listDatasets(_0x48e686[_0x25897b(0x1f3)])),_0x495a43=new Map(_0x452bc3[_0x25897b(0x219)](_0x353cad=>[_0x353cad['dbtableConfig']?.[_0x25897b(0x204)]?.[_0x25897b(0x1f6)](),_0x353cad]));for(const _0x2898ce of _0x1a5304[_0x25897b(0x1fd)]){const _0x390f4a=_0x495a43[_0x25897b(0x20d)](_0x2898ce['toLowerCase']());!_0x390f4a&&_0x576553[_0x25897b(0x21f)](_0x25897b(0x202)+_0x2898ce+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x591c1b of _0x4ae384){let _0x48e676;try{_0x48e676=await getDatasetDetail(_0x591c1b);}catch{_0x576553[_0x25897b(0x21f)]('Dataset\x20\x22'+_0x591c1b+_0x25897b(0x218));continue;}assertDatasetIsDbTableBacked(_0x48e676,'SQL\x20schema\x20validation');const _0x4f83e0=Array['isArray'](_0x48e676[_0x25897b(0x1fa)])?_0x48e676[_0x25897b(0x1fa)]:[],_0x75d78c=new Set(_0x4f83e0[_0x25897b(0x219)](_0x15769a=>_0x15769a['name']?.['toLowerCase']())),_0x135f17=_0x48e676['dbtableConfig']?.[_0x25897b(0x204)]||_0x48e676['tableName']||_0x591c1b;_0x540918[_0x25897b(0x214)+_0x135f17]={'code':_0x591c1b,'tableName':_0x135f17,'fieldCount':_0x75d78c[_0x25897b(0x216)],'fields':Array[_0x25897b(0x211)](_0x75d78c)};}_0x576553[_0x25897b(0x1fc)]>0x0&&(_0x540918[_0x25897b(0x220)]=_0x576553);}return{'ok':_0x1a5304[_0x25897b(0x221)],'data':_0x540918,'message':_0x1a5304[_0x25897b(0x21c)]};}};
@@ -1 +1 @@
1
- const a143_0x95afa2=a143_0x535f;(function(_0x8e5d1f,_0x5f0e66){const _0x1cb425=a143_0x535f,_0x59b2ce=_0x8e5d1f();while(!![]){try{const _0x4b126b=-parseInt(_0x1cb425(0xc8))/0x1*(parseInt(_0x1cb425(0xc0))/0x2)+parseInt(_0x1cb425(0xaf))/0x3+-parseInt(_0x1cb425(0xe3))/0x4+-parseInt(_0x1cb425(0xda))/0x5*(-parseInt(_0x1cb425(0xdb))/0x6)+-parseInt(_0x1cb425(0xd2))/0x7+-parseInt(_0x1cb425(0xca))/0x8+parseInt(_0x1cb425(0xd4))/0x9;if(_0x4b126b===_0x5f0e66)break;else _0x59b2ce['push'](_0x59b2ce['shift']());}catch(_0x23988e){_0x59b2ce['push'](_0x59b2ce['shift']());}}}(a143_0x2cf9,0x80399));import{CliErrors}from'../../errors.js';function a143_0x2cf9(){const _0x523f53=['workspace.','join','trim','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Locale\x20for\x20this\x20workspace\x20app\x20profile','apps','Target\x20environment','674182gdXAAL','Switch\x20the\x20current\x20workspace\x20app\x20binding','2944456dGmlZd','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','number','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','updated','globalConfig','\x20workspace\x20use\x20--app\x20<name>`.','workspace','3064516tCpSsx','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','18597735ZEYsyE','flag','env','\x22\x20not\x20found.','Invalid\x20appcode:\x20','keys','5KvgjVp','92166eifCmT','riskLevel','init','appcode','locale','apiDir','str','\x20--appcode\x20<code>`.','1174776xgNVjj','Missing\x20workspace\x20app\x20selector.','validation','defaultFormat','651462VlgSGC',').\x20Config:\x20','Use\x20`','\x20(appcode:\x20','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20','initialized','format','use','app','project','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','Workspace\x20','object','string','length','pageSize','2yzqaFY'];a143_0x2cf9=function(){return _0x523f53;};return a143_0x2cf9();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';function a143_0x535f(_0x11b2de,_0x18c9ea){_0x11b2de=_0x11b2de-0xad;const _0x2cf9b3=a143_0x2cf9();let _0x535f8f=_0x2cf9b3[_0x11b2de];return _0x535f8f;}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a143_0x95afa2(0xd3),SAFE_PROFILE_KEYS=[a143_0x95afa2(0xde),'env',a143_0x95afa2(0xe0),a143_0x95afa2(0xb6),a143_0x95afa2(0xbf),a143_0x95afa2(0xdc),a143_0x95afa2(0xdf)],workspaceFlags=[{'name':a143_0x95afa2(0xb8),'type':a143_0x95afa2(0xbd),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':a143_0x95afa2(0xbd),'description':a143_0x95afa2(0xba)},{'name':a143_0x95afa2(0xd6),'type':'string','description':a143_0x95afa2(0xc7),'enum':[...RABETBASE_ENV_VALUES]},{'name':a143_0x95afa2(0xe0),'type':a143_0x95afa2(0xbd),'description':'API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a143_0x95afa2(0xae),'type':a143_0x95afa2(0xbd),'description':a143_0x95afa2(0xc4),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a143_0x95afa2(0xcc),'description':a143_0x95afa2(0xb3)},{'name':'riskLevel','type':'string','description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a143_0x95afa2(0xdf),'type':a143_0x95afa2(0xbd),'description':a143_0x95afa2(0xc5)}];function isRecord(_0x5ae0dc){const _0x3812b7=a143_0x95afa2;return!!_0x5ae0dc&&typeof _0x5ae0dc===_0x3812b7(0xbc)&&!Array['isArray'](_0x5ae0dc);}function assertValidAppcode(_0x952738){const _0x194dbd=a143_0x95afa2,{valid:_0x399336,message:_0x562f3b}=validateAppcode(_0x952738);if(!_0x399336)throw CliErrors[_0x194dbd(0xad)](_0x194dbd(0xd8)+_0x952738,_0x562f3b);}function sanitizeProfile(_0x44f0b2){if(!isRecord(_0x44f0b2))return{};const _0x370eb8={};for(const _0x15f464 of SAFE_PROFILE_KEYS){if(_0x44f0b2[_0x15f464]!==undefined)_0x370eb8[_0x15f464]=_0x44f0b2[_0x15f464];}return _0x370eb8;}function cloneProfile(_0x4ea67f){return isRecord(_0x4ea67f)?{..._0x4ea67f}:{};}function collectWorkspaceProfileOverrides(_0x1fd3e2){const _0x3b7e1f=a143_0x95afa2,_0x53ff62={},_0x171226=_0x1fd3e2['str'](_0x3b7e1f(0xd6)),_0x243599=_0x1fd3e2['str'](_0x3b7e1f(0xe0)),_0x34eab8=_0x1fd3e2['str'](_0x3b7e1f(0xae)),_0x485bbc=_0x1fd3e2[_0x3b7e1f(0xd5)]('pageSize'),_0xb96764=_0x1fd3e2[_0x3b7e1f(0xe1)](_0x3b7e1f(0xdc)),_0x4712de=_0x1fd3e2['str'](_0x3b7e1f(0xdf));if(_0x171226)_0x53ff62[_0x3b7e1f(0xd6)]=_0x171226;if(_0x243599)_0x53ff62[_0x3b7e1f(0xe0)]=_0x243599;if(_0x34eab8)_0x53ff62[_0x3b7e1f(0xb6)]=_0x34eab8;if(_0x485bbc!==undefined&&_0x485bbc!=='')_0x53ff62['pageSize']=Number(_0x485bbc);if(_0xb96764)_0x53ff62[_0x3b7e1f(0xdc)]=_0xb96764;if(_0x4712de)_0x53ff62[_0x3b7e1f(0xdf)]=_0x4712de;return _0x53ff62;}async function validateWorkspaceArgs(_0x7be422){const _0x5de4d2=a143_0x95afa2,_0x177ff3=_0x7be422[_0x5de4d2(0xe1)](_0x5de4d2(0xb8))[_0x5de4d2(0xc3)](),_0x4ed304=_0x7be422[_0x5de4d2(0xe1)](_0x5de4d2(0xde))['trim']();if(!_0x177ff3&&!_0x4ed304)throw CliErrors['validation'](_0x5de4d2(0xe4),_0x5de4d2(0xb1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x5de4d2(0xd0));if(_0x4ed304)assertValidAppcode(_0x4ed304);}function resolveKnownApps(){const _0x5a403f=a143_0x95afa2,{config:_0x247d8a,layers:_0x9328be}=readRawConfigWithLayers(),_0x5b5b9d=isRecord(_0x247d8a[_0x5a403f(0xc6)])?_0x247d8a[_0x5a403f(0xc6)]:{},_0x209cea=isRecord(_0x9328be[_0x5a403f(0xcf)]['apps'])?_0x9328be['globalConfig']['apps']:{};return{..._0x209cea,..._0x5b5b9d};}async function configureWorkspace(_0x31e4a0,_0x1cd101){const _0x254776=a143_0x95afa2,_0x57afe1=_0x31e4a0['str'](_0x254776(0xb8))['trim'](),_0x21229b=_0x31e4a0[_0x254776(0xe1)](_0x254776(0xde))[_0x254776(0xc3)](),_0x2093ce=_0x57afe1||_0x21229b;if(!_0x2093ce)throw CliErrors[_0x254776(0xad)]('Missing\x20workspace\x20app\x20selector.',_0x254776(0xb1)+CLI_BIN_NAME+_0x254776(0xcb)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x21229b)assertValidAppcode(_0x21229b);const _0x3e5e64=resolveWriteConfigPath(_0x254776(0xb9)),_0x259630=readConfigFile(_0x3e5e64),_0x3ae60c=resolveKnownApps(),_0x2fb7ed=isRecord(_0x259630[_0x254776(0xc6)])?{..._0x259630[_0x254776(0xc6)]}:{},_0x534861=cloneProfile(_0x2fb7ed[_0x2093ce]),_0x22d422=sanitizeProfile(_0x3ae60c[_0x2093ce]),_0x145898=_0x21229b?{}:_0x22d422,_0x29647d=_0x21229b||_0x145898[_0x254776(0xde)];if(!_0x29647d){const _0x5b8515=Object[_0x254776(0xd9)](_0x3ae60c),_0x2ac83b=_0x5b8515[_0x254776(0xbe)]===0x0?_0x254776(0xb1)+CLI_BIN_NAME+_0x254776(0xb4)+_0x1cd101+'\x20--app\x20'+_0x2093ce+_0x254776(0xe2):_0x254776(0xcd)+_0x5b8515[_0x254776(0xc2)](',\x20');throw CliErrors[_0x254776(0xad)]('App\x20\x22'+_0x2093ce+_0x254776(0xd7),_0x2ac83b);}assertValidAppcode(String(_0x29647d));const _0x1a2d90={..._0x145898,..._0x534861,'appcode':String(_0x29647d),...collectWorkspaceProfileOverrides(_0x31e4a0)};return _0x2fb7ed[_0x2093ce]=_0x1a2d90,_0x259630['apps']=_0x2fb7ed,_0x259630['defaultApp']=_0x2093ce,delete _0x259630[_0x254776(0xde)],delete _0x259630[_0x254776(0xb8)],_0x1a2d90[_0x254776(0xd6)]&&(_0x259630['env']=_0x1a2d90[_0x254776(0xd6)]),writeConfigFile(_0x3e5e64,_0x259630),{'ok':!![],'message':_0x254776(0xbb)+(_0x1cd101==='init'?_0x254776(0xb5):_0x254776(0xce))+':\x20'+_0x2093ce+_0x254776(0xb2)+_0x1a2d90[_0x254776(0xde)]+_0x254776(0xb0)+_0x3e5e64+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x254776(0xc1)+_0x1cd101,'configPath':_0x3e5e64,'app':_0x2093ce,'appcode':_0x1a2d90[_0x254776(0xde)],'env':_0x1a2d90[_0x254776(0xd6)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a143_0x95afa2(0xd1),'command':a143_0x95afa2(0xdd),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x25d18b=>configureWorkspace(_0x25d18b,a143_0x95afa2(0xdd))},workspaceUseDefinition={'service':a143_0x95afa2(0xd1),'command':a143_0x95afa2(0xb7),'description':a143_0x95afa2(0xc9),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4c6b0d=>configureWorkspace(_0x4c6b0d,a143_0x95afa2(0xb7))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition];export{WORKSPACE_USAGE};
1
+ const a144_0x1e60b6=a144_0x4606;(function(_0x27605f,_0x4511e0){const _0x399b8=a144_0x4606,_0x4b4be9=_0x27605f();while(!![]){try{const _0x241e2b=-parseInt(_0x399b8(0xda))/0x1+parseInt(_0x399b8(0xdc))/0x2+-parseInt(_0x399b8(0xcd))/0x3+parseInt(_0x399b8(0xb0))/0x4+parseInt(_0x399b8(0xa9))/0x5+parseInt(_0x399b8(0xd8))/0x6+parseInt(_0x399b8(0xb6))/0x7;if(_0x241e2b===_0x4511e0)break;else _0x4b4be9['push'](_0x4b4be9['shift']());}catch(_0x1a226c){_0x4b4be9['push'](_0x4b4be9['shift']());}}}(a144_0x5086,0x618ce));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.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';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a144_0x1e60b6(0xad),SAFE_PROFILE_KEYS=[a144_0x1e60b6(0xab),a144_0x1e60b6(0xc4),'apiDir',a144_0x1e60b6(0xd3),'pageSize',a144_0x1e60b6(0xce),a144_0x1e60b6(0xc7)],workspaceFlags=[{'name':'app','type':a144_0x1e60b6(0xaa),'description':a144_0x1e60b6(0xb3)},{'name':a144_0x1e60b6(0xab),'type':a144_0x1e60b6(0xaa),'description':a144_0x1e60b6(0xaf)},{'name':a144_0x1e60b6(0xc4),'type':a144_0x1e60b6(0xaa),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a144_0x1e60b6(0xb5)},{'name':a144_0x1e60b6(0xcb),'type':a144_0x1e60b6(0xaa),'description':a144_0x1e60b6(0xdd),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a144_0x1e60b6(0xdf),'type':a144_0x1e60b6(0xc8),'description':a144_0x1e60b6(0xc3)},{'name':a144_0x1e60b6(0xce),'type':'string','description':a144_0x1e60b6(0xe1),'enum':[...RISK_LEVEL_VALUES]},{'name':a144_0x1e60b6(0xc7),'type':a144_0x1e60b6(0xaa),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x49628d){const _0x183425=a144_0x1e60b6;return!!_0x49628d&&typeof _0x49628d===_0x183425(0xb1)&&!Array[_0x183425(0xd0)](_0x49628d);}function assertValidAppcode(_0x249977){const _0x47f268=a144_0x1e60b6,{valid:_0x1d4233,message:_0x3b993a}=validateAppcode(_0x249977);if(!_0x1d4233)throw CliErrors[_0x47f268(0xd9)]('Invalid\x20appcode:\x20'+_0x249977,_0x3b993a);}function sanitizeProfile(_0x46a166){if(!isRecord(_0x46a166))return{};const _0x31c93d={};for(const _0x4e52dc of SAFE_PROFILE_KEYS){if(_0x46a166[_0x4e52dc]!==undefined)_0x31c93d[_0x4e52dc]=_0x46a166[_0x4e52dc];}return _0x31c93d;}function cloneProfile(_0x4fac47){return isRecord(_0x4fac47)?{..._0x4fac47}:{};}function collectWorkspaceProfileOverrides(_0x51fc7f){const _0x4660c9=a144_0x1e60b6,_0x1cc9cc={},_0x2b3b7b=_0x51fc7f[_0x4660c9(0xbb)](_0x4660c9(0xc4)),_0x19a3d6=_0x51fc7f['str']('apiDir'),_0x3f7d0f=_0x51fc7f[_0x4660c9(0xbb)](_0x4660c9(0xcb)),_0x5e7d42=_0x51fc7f[_0x4660c9(0xb7)](_0x4660c9(0xdf)),_0x546036=_0x51fc7f['str'](_0x4660c9(0xce)),_0x54be10=_0x51fc7f[_0x4660c9(0xbb)](_0x4660c9(0xc7));if(_0x2b3b7b)_0x1cc9cc[_0x4660c9(0xc4)]=_0x2b3b7b;if(_0x19a3d6)_0x1cc9cc[_0x4660c9(0xd6)]=_0x19a3d6;if(_0x3f7d0f)_0x1cc9cc['format']=_0x3f7d0f;if(_0x5e7d42!==undefined&&_0x5e7d42!=='')_0x1cc9cc[_0x4660c9(0xdf)]=Number(_0x5e7d42);if(_0x546036)_0x1cc9cc[_0x4660c9(0xce)]=_0x546036;if(_0x54be10)_0x1cc9cc[_0x4660c9(0xc7)]=_0x54be10;return _0x1cc9cc;}function a144_0x4606(_0x14c682,_0x5f371c){_0x14c682=_0x14c682-0xa8;const _0x50865b=a144_0x5086();let _0x4606ff=_0x50865b[_0x14c682];return _0x4606ff;}async function validateWorkspaceArgs(_0x348e1f){const _0x3b9f42=a144_0x1e60b6,_0x1b5bc1=_0x348e1f[_0x3b9f42(0xbb)]('app')[_0x3b9f42(0xbf)](),_0x32fcf9=_0x348e1f['str'](_0x3b9f42(0xab))[_0x3b9f42(0xbf)]();if(!_0x1b5bc1&&!_0x32fcf9)throw CliErrors[_0x3b9f42(0xd9)](_0x3b9f42(0xcc),_0x3b9f42(0xc1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x3b9f42(0xba));if(_0x32fcf9)assertValidAppcode(_0x32fcf9);}function resolveKnownApps(){const _0x554487=a144_0x1e60b6,{config:_0x5a8c02,layers:_0x46962f}=readRawConfigWithLayers(),_0x17788d=isRecord(_0x5a8c02['apps'])?_0x5a8c02[_0x554487(0xcf)]:{},_0x579c1f=isRecord(_0x46962f[_0x554487(0xc6)]['apps'])?_0x46962f[_0x554487(0xc6)][_0x554487(0xcf)]:{};return{..._0x579c1f,..._0x17788d};}async function configureWorkspace(_0x20231e,_0x5738fe){const _0x370482=a144_0x1e60b6,_0x1338e1=_0x20231e['str'](_0x370482(0xc0))[_0x370482(0xbf)](),_0x1382af=_0x20231e[_0x370482(0xbb)](_0x370482(0xab))['trim'](),_0x4434c1=_0x1338e1||_0x1382af;if(!_0x4434c1)throw CliErrors[_0x370482(0xd9)](_0x370482(0xcc),_0x370482(0xc1)+CLI_BIN_NAME+_0x370482(0xbe)+CLI_BIN_NAME+_0x370482(0xba));if(_0x1382af)assertValidAppcode(_0x1382af);const _0x3286cc=resolveWriteConfigPath(_0x370482(0xb9)),_0x5ab16c=readConfigFile(_0x3286cc),_0x3f98d2=resolveKnownApps(),_0x460202=isRecord(_0x5ab16c['apps'])?{..._0x5ab16c['apps']}:{},_0x385054=cloneProfile(_0x460202[_0x4434c1]),_0xc0c52f=sanitizeProfile(_0x3f98d2[_0x4434c1]),_0x57a05c=_0x1382af?{}:_0xc0c52f,_0x3d8eb5=_0x1382af||_0x57a05c['appcode'];if(!_0x3d8eb5){const _0x36fd0f=Object[_0x370482(0xd4)](_0x3f98d2),_0x461ebc=_0x36fd0f[_0x370482(0xbd)]===0x0?_0x370482(0xc1)+CLI_BIN_NAME+_0x370482(0xae)+_0x5738fe+'\x20--app\x20'+_0x4434c1+_0x370482(0xb2):_0x370482(0xc9)+_0x36fd0f[_0x370482(0xdb)](',\x20');throw CliErrors['validation'](_0x370482(0xb8)+_0x4434c1+_0x370482(0xc5),_0x461ebc);}assertValidAppcode(String(_0x3d8eb5));const _0x4f216f={..._0x57a05c,..._0x385054,'appcode':String(_0x3d8eb5),...collectWorkspaceProfileOverrides(_0x20231e)};return _0x460202[_0x4434c1]=_0x4f216f,_0x5ab16c[_0x370482(0xcf)]=_0x460202,_0x5ab16c[_0x370482(0xd5)]=_0x4434c1,delete _0x5ab16c['appcode'],delete _0x5ab16c[_0x370482(0xc0)],_0x4f216f['env']&&(_0x5ab16c[_0x370482(0xc4)]=_0x4f216f['env']),writeConfigFile(_0x3286cc,_0x5ab16c),{'ok':!![],'message':_0x370482(0xd1)+(_0x5738fe===_0x370482(0xac)?_0x370482(0xa8):_0x370482(0xca))+':\x20'+_0x4434c1+'\x20(appcode:\x20'+_0x4f216f[_0x370482(0xab)]+_0x370482(0xd2)+_0x3286cc+_0x370482(0xbc),'data':{'operation':_0x370482(0xde)+_0x5738fe,'configPath':_0x3286cc,'app':_0x4434c1,'appcode':_0x4f216f[_0x370482(0xab)],'env':_0x4f216f['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a144_0x1e60b6(0xe0),'command':a144_0x1e60b6(0xac),'description':a144_0x1e60b6(0xd7),'risk':a144_0x1e60b6(0xc2),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xf82d1c=>configureWorkspace(_0xf82d1c,a144_0x1e60b6(0xac))},workspaceUseDefinition={'service':a144_0x1e60b6(0xe0),'command':'use','description':a144_0x1e60b6(0xb4),'risk':a144_0x1e60b6(0xc2),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x312d1b=>configureWorkspace(_0x312d1b,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition];export{WORKSPACE_USAGE};function a144_0x5086(){const _0x40c2e5=['\x20workspace\x20','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','135852vEgkFB','object','\x20--appcode\x20<code>`.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','Switch\x20the\x20current\x20workspace\x20app\x20binding','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','6187580tcKEzo','flag','App\x20\x22','project','\x20workspace\x20use\x20--app\x20<name>`.','str','.\x20Credentials:\x20not\x20written.','length','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','trim','app','Use\x20`','write','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','env','\x22\x20not\x20found.','globalConfig','locale','number','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','updated','defaultFormat','Missing\x20workspace\x20app\x20selector.','2267103eQitAD','riskLevel','apps','isArray','Workspace\x20',').\x20Config:\x20','format','keys','defaultApp','apiDir','Initialize\x20the\x20current\x20workspace\x20app\x20binding','796248aEcPuU','validation','341439erFYEc','join','690318wHSpFo','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','workspace.','pageSize','workspace','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','initialized','504680MEvBjU','string','appcode','init','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]'];a144_0x5086=function(){return _0x40c2e5;};return a144_0x5086();}
@@ -1 +1 @@
1
- const a144_0x57bb03=a144_0x3b71;(function(_0xb6b58f,_0x56e2f3){const _0x748a07=a144_0x3b71,_0x5da237=_0xb6b58f();while(!![]){try{const _0x11b6a4=parseInt(_0x748a07(0x1d6))/0x1*(parseInt(_0x748a07(0x1e0))/0x2)+parseInt(_0x748a07(0x1d2))/0x3*(-parseInt(_0x748a07(0x1cd))/0x4)+-parseInt(_0x748a07(0x1d3))/0x5*(parseInt(_0x748a07(0x1df))/0x6)+-parseInt(_0x748a07(0x1d7))/0x7*(parseInt(_0x748a07(0x1f1))/0x8)+-parseInt(_0x748a07(0x1cb))/0x9*(parseInt(_0x748a07(0x1f0))/0xa)+-parseInt(_0x748a07(0x1e8))/0xb+-parseInt(_0x748a07(0x1de))/0xc*(-parseInt(_0x748a07(0x1e9))/0xd);if(_0x11b6a4===_0x56e2f3)break;else _0x5da237['push'](_0x5da237['shift']());}catch(_0xc6c26){_0x5da237['push'](_0x5da237['shift']());}}}(a144_0x42ff,0x2181c));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=[a144_0x57bb03(0x1e2),a144_0x57bb03(0x1da),'locale',a144_0x57bb03(0x1ee),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a144_0x57bb03(0x1d5),'env',a144_0x57bb03(0x1d8),'format',a144_0x57bb03(0x1e2),'accessKey',a144_0x57bb03(0x1e7)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5cf89c){const _0x1fb633=a144_0x57bb03;return[..._0x5cf89c][_0x1fb633(0x1ea)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x37fff1){const _0x539a98=a144_0x57bb03;return TOP_LEVEL_CONFIG_KEYS[_0x539a98(0x1ef)](_0x37fff1);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x3bf798=a144_0x57bb03;return _0x3bf798(0x1dd)+getTopLevelConfigKeySummary()+')';}function a144_0x3b71(_0x56dd23,_0x34b49d){_0x56dd23=_0x56dd23-0x1ca;const _0x42ff75=a144_0x42ff();let _0x3b71d3=_0x42ff75[_0x56dd23];return _0x3b71d3;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a144_0x57bb03(0x1dc),'apiDir':a144_0x57bb03(0x1e7),'cookie':a144_0x57bb03(0x1e2),'accessKey':'accessKey','defaultFormat':a144_0x57bb03(0x1ee),'pageSize':a144_0x57bb03(0x1e5),'riskLevel':'riskLevel','locale':a144_0x57bb03(0x1d8)};export function getAppProfileFlagDefs(){const _0x20c974=a144_0x57bb03;return[{'name':_0x20c974(0x1dc),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0x20c974(0x1f2),'description':_0x20c974(0x1f3)},{'name':'cookie','type':'string','description':_0x20c974(0x1e4),'hidden':!![]},{'name':_0x20c974(0x1da),'type':_0x20c974(0x1f2),'description':_0x20c974(0x1d1),'hidden':!![]},{'name':'defaultFormat','type':_0x20c974(0x1f2),'description':_0x20c974(0x1d0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x20c974(0x1cf),'description':_0x20c974(0x1db)},{'name':_0x20c974(0x1d4),'type':_0x20c974(0x1f2),'description':_0x20c974(0x1ca),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x20c974(0x1d8),'type':_0x20c974(0x1f2),'description':'Locale'}];}export function collectAppProfileOverrides(_0x4d4700){const _0x302891={};for(const [_0x36aef9,_0x5d234a]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x18edc8=_0x4d4700(_0x36aef9);if(!_0x18edc8)continue;_0x302891[_0x5d234a]=_0x5d234a==='pageSize'?Number(_0x18edc8):_0x18edc8;}return _0x302891;}export function buildAppProfileListFields(_0x21bf05){const _0x112335=a144_0x57bb03;return{'env':_0x21bf05[_0x112335(0x1dc)]??null,'apiDir':_0x21bf05[_0x112335(0x1e7)]??null,'hasCookie':!!_0x21bf05['cookie'],'hasAccessKey':!!_0x21bf05[_0x112335(0x1da)],'format':_0x21bf05['format']??null,'pageSize':_0x21bf05[_0x112335(0x1e5)]??null,'riskLevel':_0x21bf05['riskLevel']??null,'locale':_0x21bf05[_0x112335(0x1d8)]??null};}function a144_0x42ff(){const _0x28797b=['API\x20directory\x20path','Risk\x20level','9sRLPJF','zh-CN','176912opAthU','apps','number','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','Access\x20key','6mDgvxr','266480dBtAmF','riskLevel','appcode','618IRjBOV','377580wJkaPh','locale','defaultApp','accessKey','Default\x20page\x20size','env','Config\x20key\x20(','2345268ElfONR','24XNkwNQ','2fKTrSV','en-US','cookie','filter','Auth\x20cookie','pageSize','map','apiDir','1870913rttiSw','65SvtVdZ','join','inherit','app','keys','format','has','2609660EbvGEL','16IyqSOV','string'];a144_0x42ff=function(){return _0x28797b;};return a144_0x42ff();}export function buildAppDoctorFields(_0x5c1f8e,_0x186d5f){const _0x2ecb7d=a144_0x57bb03;return{'env':{'value':_0x5c1f8e[_0x2ecb7d(0x1dc)]||_0x186d5f['env'],'source':_0x5c1f8e[_0x2ecb7d(0x1dc)]?_0x2ecb7d(0x1ec):'inherit'},'apiDir':{'value':_0x5c1f8e[_0x2ecb7d(0x1e7)]||_0x186d5f['apiDir'],'source':_0x5c1f8e[_0x2ecb7d(0x1e7)]?_0x2ecb7d(0x1ec):_0x2ecb7d(0x1eb)},'cookie':{'value':_0x5c1f8e['cookie']||_0x186d5f[_0x2ecb7d(0x1e2)],'source':_0x5c1f8e['cookie']?_0x2ecb7d(0x1ec):_0x2ecb7d(0x1eb)},'accessKey':{'value':_0x5c1f8e['accessKey']||_0x186d5f[_0x2ecb7d(0x1da)],'source':_0x5c1f8e[_0x2ecb7d(0x1da)]?_0x2ecb7d(0x1ec):_0x2ecb7d(0x1eb)}};}export function buildCanonicalAppConfig(_0x426b4d,_0x22596f){const _0x5efacd=a144_0x57bb03,_0x30a5a1=_0x426b4d[_0x5efacd(0x1e6)](_0x12e65e=>String(_0x12e65e||'')['trim']())[_0x5efacd(0x1e3)](Boolean);if(_0x30a5a1['length']===0x0)return{};const _0x3568c1={};for(const _0x24a61f of _0x30a5a1){_0x3568c1[_0x24a61f]=_0x22596f?{'appcode':_0x24a61f,'env':_0x22596f}:{'appcode':_0x24a61f};}return{'apps':_0x3568c1,'defaultApp':_0x30a5a1[0x0]};}export function buildCanonicalProjectConfig(_0x26b417,_0x22b039){const _0x36028a=a144_0x57bb03,{appCodes:appCodes=[],env:_0x5a1dc6,metadata:_0x102f60}=_0x22b039,_0x342c58={..._0x26b417,..._0x102f60||{}};delete _0x342c58[_0x36028a(0x1d5)],delete _0x342c58[_0x36028a(0x1ec)];if(_0x5a1dc6)_0x342c58[_0x36028a(0x1dc)]=_0x5a1dc6;else!_0x342c58[_0x36028a(0x1dc)]&&(_0x342c58[_0x36028a(0x1dc)]=DEFAULT_CONFIG_VALUES[_0x36028a(0x1dc)]);const _0x50a6d3=buildCanonicalAppConfig(appCodes,_0x342c58[_0x36028a(0x1dc)]);return Object[_0x36028a(0x1ed)](_0x50a6d3)['length']>0x0&&(_0x342c58[_0x36028a(0x1ce)]=_0x50a6d3[_0x36028a(0x1ce)],_0x342c58[_0x36028a(0x1d9)]=_0x50a6d3[_0x36028a(0x1d9)]),_0x342c58;}const LOCALE_MAP={'zh':a144_0x57bb03(0x1cc),'zh-cn':a144_0x57bb03(0x1cc),'zh_cn':'zh-CN','en':'en-US','en-us':a144_0x57bb03(0x1e1),'en_us':a144_0x57bb03(0x1e1)};export function normalizeLocale(_0x23cf85){if(!_0x23cf85)return null;return LOCALE_MAP[_0x23cf85['toLowerCase']()]??null;}
1
+ function a145_0x7054(_0x3cc75a,_0x573d51){_0x3cc75a=_0x3cc75a-0x1bf;const _0x20c178=a145_0x20c1();let _0x7054bf=_0x20c178[_0x3cc75a];return _0x7054bf;}const a145_0xbf84f6=a145_0x7054;(function(_0x1434d6,_0x563c45){const _0x436a84=a145_0x7054,_0x2aee72=_0x1434d6();while(!![]){try{const _0x5f1c64=parseInt(_0x436a84(0x1d1))/0x1+parseInt(_0x436a84(0x1ce))/0x2*(-parseInt(_0x436a84(0x1ca))/0x3)+-parseInt(_0x436a84(0x1c3))/0x4+-parseInt(_0x436a84(0x1e4))/0x5+parseInt(_0x436a84(0x1c8))/0x6*(-parseInt(_0x436a84(0x1e0))/0x7)+parseInt(_0x436a84(0x1c4))/0x8*(-parseInt(_0x436a84(0x1c9))/0x9)+-parseInt(_0x436a84(0x1c6))/0xa*(-parseInt(_0x436a84(0x1d4))/0xb);if(_0x5f1c64===_0x563c45)break;else _0x2aee72['push'](_0x2aee72['shift']());}catch(_0x4a7e0d){_0x2aee72['push'](_0x2aee72['shift']());}}}(a145_0x20c1,0x55848));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=[a145_0xbf84f6(0x1cd),a145_0xbf84f6(0x1d2),a145_0xbf84f6(0x1de),'format','riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a145_0xbf84f6(0x1c2),a145_0xbf84f6(0x1df),a145_0xbf84f6(0x1de),'format',a145_0xbf84f6(0x1cd),a145_0xbf84f6(0x1d2),a145_0xbf84f6(0x1e5)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x302625){const _0x5d7aee=a145_0xbf84f6;return[..._0x302625][_0x5d7aee(0x1e7)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0xee10bc){const _0x86cc21=a145_0xbf84f6;return TOP_LEVEL_CONFIG_KEYS[_0x86cc21(0x1cf)](_0xee10bc);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a145_0xbf84f6(0x1df),'apiDir':a145_0xbf84f6(0x1e5),'cookie':a145_0xbf84f6(0x1cd),'accessKey':a145_0xbf84f6(0x1d2),'defaultFormat':'format','pageSize':a145_0xbf84f6(0x1c5),'riskLevel':a145_0xbf84f6(0x1d9),'locale':a145_0xbf84f6(0x1de)};export function getAppProfileFlagDefs(){const _0x53d679=a145_0xbf84f6;return[{'name':_0x53d679(0x1df),'type':_0x53d679(0x1dc),'description':_0x53d679(0x1e2),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x53d679(0x1e5),'type':'string','description':_0x53d679(0x1e1)},{'name':'cookie','type':'string','description':_0x53d679(0x1c1),'hidden':!![]},{'name':_0x53d679(0x1d2),'type':'string','description':'Access\x20key','hidden':!![]},{'name':_0x53d679(0x1bf),'type':_0x53d679(0x1dc),'description':_0x53d679(0x1d5),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x53d679(0x1c5),'type':_0x53d679(0x1d6),'description':'Default\x20page\x20size'},{'name':_0x53d679(0x1d9),'type':_0x53d679(0x1dc),'description':_0x53d679(0x1dd),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':_0x53d679(0x1d0)}];}export function collectAppProfileOverrides(_0x3835ac){const _0x56cbcd=a145_0xbf84f6,_0x5d6166={};for(const [_0xb8b745,_0x233aa7]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x33dd25=_0x3835ac(_0xb8b745);if(!_0x33dd25)continue;_0x5d6166[_0x233aa7]=_0x233aa7===_0x56cbcd(0x1c5)?Number(_0x33dd25):_0x33dd25;}return _0x5d6166;}export function buildAppProfileListFields(_0x1a1e12){const _0x23194e=a145_0xbf84f6;return{'env':_0x1a1e12[_0x23194e(0x1df)]??null,'apiDir':_0x1a1e12[_0x23194e(0x1e5)]??null,'hasCookie':!!_0x1a1e12[_0x23194e(0x1cd)],'hasAccessKey':!!_0x1a1e12[_0x23194e(0x1d2)],'format':_0x1a1e12[_0x23194e(0x1e3)]??null,'pageSize':_0x1a1e12[_0x23194e(0x1c5)]??null,'riskLevel':_0x1a1e12[_0x23194e(0x1d9)]??null,'locale':_0x1a1e12[_0x23194e(0x1de)]??null};}export function buildAppDoctorFields(_0x5a7d2b,_0x5ee5cf){const _0xa61346=a145_0xbf84f6;return{'env':{'value':_0x5a7d2b[_0xa61346(0x1df)]||_0x5ee5cf[_0xa61346(0x1df)],'source':_0x5a7d2b[_0xa61346(0x1df)]?_0xa61346(0x1d7):_0xa61346(0x1cb)},'apiDir':{'value':_0x5a7d2b[_0xa61346(0x1e5)]||_0x5ee5cf[_0xa61346(0x1e5)],'source':_0x5a7d2b[_0xa61346(0x1e5)]?_0xa61346(0x1d7):_0xa61346(0x1cb)},'cookie':{'value':_0x5a7d2b[_0xa61346(0x1cd)]||_0x5ee5cf[_0xa61346(0x1cd)],'source':_0x5a7d2b[_0xa61346(0x1cd)]?'app':_0xa61346(0x1cb)},'accessKey':{'value':_0x5a7d2b[_0xa61346(0x1d2)]||_0x5ee5cf[_0xa61346(0x1d2)],'source':_0x5a7d2b[_0xa61346(0x1d2)]?_0xa61346(0x1d7):_0xa61346(0x1cb)}};}export function buildCanonicalAppConfig(_0x979aab,_0x43d0a9){const _0xdc0c37=a145_0xbf84f6,_0x7b03e=_0x979aab['map'](_0xba8fb0=>String(_0xba8fb0||'')[_0xdc0c37(0x1c0)]())[_0xdc0c37(0x1c7)](Boolean);if(_0x7b03e['length']===0x0)return{};const _0x94bd73={};for(const _0x446587 of _0x7b03e){_0x94bd73[_0x446587]=_0x43d0a9?{'appcode':_0x446587,'env':_0x43d0a9}:{'appcode':_0x446587};}return{'apps':_0x94bd73,'defaultApp':_0x7b03e[0x0]};}function a145_0x20c1(){const _0x26b408=['toLowerCase','cookie','23680MblXXr','has','Locale','249744uEYBpl','accessKey','zh-CN','11FzCsAO','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','number','app','defaultApp','riskLevel','apps','en-US','string','Risk\x20level','locale','env','120281XbdBat','API\x20directory\x20path','Target\x20environment','format','63735CkdNHy','apiDir','length','join','defaultFormat','trim','Auth\x20cookie','appcode','1464944yNJIzI','344TKQSdI','pageSize','10485160qpglEB','filter','18PpQsWE','53784IApwDU','66pomPCk','inherit'];a145_0x20c1=function(){return _0x26b408;};return a145_0x20c1();}export function buildCanonicalProjectConfig(_0x891e4b,_0x59960c){const _0x4fa234=a145_0xbf84f6,{appCodes:appCodes=[],env:_0x219571,metadata:_0x53a9a5}=_0x59960c,_0x1f4a0b={..._0x891e4b,..._0x53a9a5||{}};delete _0x1f4a0b[_0x4fa234(0x1c2)],delete _0x1f4a0b[_0x4fa234(0x1d7)];if(_0x219571)_0x1f4a0b[_0x4fa234(0x1df)]=_0x219571;else!_0x1f4a0b[_0x4fa234(0x1df)]&&(_0x1f4a0b['env']=DEFAULT_CONFIG_VALUES[_0x4fa234(0x1df)]);const _0x5c8149=buildCanonicalAppConfig(appCodes,_0x1f4a0b[_0x4fa234(0x1df)]);return Object['keys'](_0x5c8149)[_0x4fa234(0x1e6)]>0x0&&(_0x1f4a0b['apps']=_0x5c8149[_0x4fa234(0x1da)],_0x1f4a0b[_0x4fa234(0x1d8)]=_0x5c8149[_0x4fa234(0x1d8)]),_0x1f4a0b;}const LOCALE_MAP={'zh':a145_0xbf84f6(0x1d3),'zh-cn':a145_0xbf84f6(0x1d3),'zh_cn':a145_0xbf84f6(0x1d3),'en':a145_0xbf84f6(0x1db),'en-us':'en-US','en_us':a145_0xbf84f6(0x1db)};export function normalizeLocale(_0x47910d){const _0x21be94=a145_0xbf84f6;if(!_0x47910d)return null;return LOCALE_MAP[_0x47910d[_0x21be94(0x1cc)]()]??null;}
@@ -1 +1 @@
1
- const a145_0x32ac73=a145_0x3eba;function a145_0x19a2(){const _0x346280=['1135824WnzCnF','5OJWhZA','464078BAXyVl','273948jKqyqC','5225072btDlnI','6310hKxPnQ','6732PHqbif','161KshbmF','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','2lMRoqx','3809076xvWcMZ','4014802MPcVou'];a145_0x19a2=function(){return _0x346280;};return a145_0x19a2();}function a145_0x3eba(_0x128e2d,_0x318da6){_0x128e2d=_0x128e2d-0x103;const _0x19a2ac=a145_0x19a2();let _0x3eba0d=_0x19a2ac[_0x128e2d];return _0x3eba0d;}(function(_0x21ddd0,_0x3bff76){const _0x186b18=a145_0x3eba,_0x81089d=_0x21ddd0();while(!![]){try{const _0x4a5dbc=parseInt(_0x186b18(0x108))/0x1*(-parseInt(_0x186b18(0x103))/0x2)+-parseInt(_0x186b18(0x106))/0x3+parseInt(_0x186b18(0x104))/0x4*(parseInt(_0x186b18(0x107))/0x5)+parseInt(_0x186b18(0x109))/0x6*(-parseInt(_0x186b18(0x10d))/0x7)+parseInt(_0x186b18(0x10a))/0x8+-parseInt(_0x186b18(0x10c))/0x9*(-parseInt(_0x186b18(0x10b))/0xa)+parseInt(_0x186b18(0x105))/0xb;if(_0x4a5dbc===_0x3bff76)break;else _0x81089d['push'](_0x81089d['shift']());}catch(_0x4e1f77){_0x81089d['push'](_0x81089d['shift']());}}}(a145_0x19a2,0x862b1));export const CLI_VERSION_POLICY_URL=a145_0x32ac73(0x10e);
1
+ const a146_0x4e0469=a146_0x199e;(function(_0x59cbc0,_0x3754e5){const _0x70fc8c=a146_0x199e,_0x24ae37=_0x59cbc0();while(!![]){try{const _0x32682f=parseInt(_0x70fc8c(0x19b))/0x1*(parseInt(_0x70fc8c(0x199))/0x2)+parseInt(_0x70fc8c(0x19a))/0x3*(-parseInt(_0x70fc8c(0x19c))/0x4)+parseInt(_0x70fc8c(0x194))/0x5*(parseInt(_0x70fc8c(0x192))/0x6)+parseInt(_0x70fc8c(0x195))/0x7*(parseInt(_0x70fc8c(0x197))/0x8)+parseInt(_0x70fc8c(0x193))/0x9+parseInt(_0x70fc8c(0x196))/0xa+-parseInt(_0x70fc8c(0x191))/0xb;if(_0x32682f===_0x3754e5)break;else _0x24ae37['push'](_0x24ae37['shift']());}catch(_0x3ebee8){_0x24ae37['push'](_0x24ae37['shift']());}}}(a146_0x1769,0xdc493));export const CLI_VERSION_POLICY_URL=a146_0x4e0469(0x198);function a146_0x199e(_0x5dd4ac,_0x2a3ac7){_0x5dd4ac=_0x5dd4ac-0x191;const _0x1769d9=a146_0x1769();let _0x199e97=_0x1769d9[_0x5dd4ac];return _0x199e97;}function a146_0x1769(){const _0x5edc48=['https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','46NhCWjn','2919GRIkVm','35fbCQRR','5656mPvbrN','17860700PTqfZg','2197740yVSpSW','8584992ccBODs','20ZqskxX','2863lygisO','4705030AgCuJj','19784zKukHT'];a146_0x1769=function(){return _0x5edc48;};return a146_0x1769();}
@@ -1 +1 @@
1
- const a146_0x448bef=a146_0x2c09;(function(_0x3dd5d1,_0x104066){const _0x3f0289=a146_0x2c09,_0x37be99=_0x3dd5d1();while(!![]){try{const _0x3278a5=parseInt(_0x3f0289(0x1e3))/0x1+parseInt(_0x3f0289(0x200))/0x2*(-parseInt(_0x3f0289(0x1fd))/0x3)+-parseInt(_0x3f0289(0x1fa))/0x4*(parseInt(_0x3f0289(0x1c1))/0x5)+-parseInt(_0x3f0289(0x201))/0x6+parseInt(_0x3f0289(0x1e4))/0x7*(parseInt(_0x3f0289(0x20b))/0x8)+-parseInt(_0x3f0289(0x1c6))/0x9*(parseInt(_0x3f0289(0x220))/0xa)+parseInt(_0x3f0289(0x1fe))/0xb*(parseInt(_0x3f0289(0x1cc))/0xc);if(_0x3278a5===_0x104066)break;else _0x37be99['push'](_0x37be99['shift']());}catch(_0x46162c){_0x37be99['push'](_0x37be99['shift']());}}}(a146_0x1e34,0x25f2f));function a146_0x1e34(){const _0x259be8=['watch','Use\x20remote','Function\x20node','target','clear','expected-count','global','tags','params','output','SQL\x20string','Code\x20filter','description','Environment','operation-type','118433DILUrn','1498xpaZEW','Show\x20help','enable-bff-save','Skip\x20confirmation\x20for\x20high-risk\x20writes','Force\x20non-interactive\x20mode\x20(CI)','SQL\x20name','pagesize','yes','code','Name','map','sqlname','sql-name','skip-imports','verbose','fromEnv','Enable\x20BFF\x20save','Verbose\x20output','db-id','help','File\x20path','boolean','16URMtlG','description-file','confirm','25269TeQKaU','4180HKSxvU','string','52nXSTqF','490014EVvCrG','SQL\x20code','JSON\x20params','force','stdin','dbid','Use\x20global\x20config\x20scope','Tags','env','from-env','8888SiSTtO','Record\x20ID','enableBffSave','Watch\x20mode','Read\x20value\x20from\x20stdin','Keyword\x20filter','reveal','rabetbase','remote','app','DB\x20ID','Description','Read\x20value\x20from\x20environment\x20variable','project','Config\x20value','key','dryRun','Reveal\x20sensitive\x20value','json\x20|\x20pretty\x20|\x20compress','format','<code>','4390OmXnZK','non-interactive','Preview\x20operation\x20without\x20executing','Operation\x20type','value','keyword','type','meowKey','fromEntries','9670ZGYcnb','Override\x20appcode','Type\x20filter','all','title','2475OUmDDd','nonInteractive','datasetcode','dry-run','Dataset\x20code','skipImports','7212KQrffY','Confirm\x20destructive\x20action','<expr>','sqlName','page','Rabetbase\x20CLI','appcode','name'];a146_0x1e34=function(){return _0x259be8;};return a146_0x1e34();}export const CLI_BIN_NAME=a146_0x448bef(0x212);export const CLI_DISPLAY_NAME=a146_0x448bef(0x1d1);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';function a146_0x2c09(_0x24b132,_0x519e2c){_0x24b132=_0x24b132-0x1c0;const _0x1e349f=a146_0x1e34();let _0x2c0904=_0x1e349f[_0x24b132];return _0x2c0904;}export const GLOBAL_FLAGS=[{'name':a146_0x448bef(0x1d2),'meowKey':a146_0x448bef(0x1d2),'type':'string','description':a146_0x448bef(0x1c2),'hint':a146_0x448bef(0x21f)},{'name':a146_0x448bef(0x214),'meowKey':a146_0x448bef(0x214),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':'<name>'},{'name':a146_0x448bef(0x209),'meowKey':a146_0x448bef(0x209),'type':'string','description':a146_0x448bef(0x1e1),'hint':'production\x20|\x20daily'},{'name':a146_0x448bef(0x21e),'meowKey':a146_0x448bef(0x21e),'type':'string','description':'Output\x20format','hint':a146_0x448bef(0x21d)},{'name':'jq','meowKey':'jq','type':a146_0x448bef(0x1ff),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a146_0x448bef(0x1ce)},{'name':a146_0x448bef(0x1c9),'meowKey':a146_0x448bef(0x21b),'type':'boolean','description':a146_0x448bef(0x222)},{'name':a146_0x448bef(0x1eb),'meowKey':a146_0x448bef(0x1eb),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1e7)},{'name':a146_0x448bef(0x221),'meowKey':a146_0x448bef(0x1c7),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1e8)},{'name':a146_0x448bef(0x1da),'meowKey':a146_0x448bef(0x1da),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x207)},{'name':a146_0x448bef(0x218),'meowKey':'project','type':a146_0x448bef(0x1f9),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a146_0x448bef(0x1f9),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':'help','meowKey':a146_0x448bef(0x1f7),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1e5)},{'name':'name','meowKey':a146_0x448bef(0x1d3),'type':'string','description':a146_0x448bef(0x1ed),'hidden':!![]},{'name':a146_0x448bef(0x1c5),'meowKey':a146_0x448bef(0x1c5),'type':'string','description':'Title','hidden':!![]},{'name':a146_0x448bef(0x1d8),'meowKey':a146_0x448bef(0x1d8),'type':a146_0x448bef(0x1f9),'description':'Clear','hidden':!![]},{'name':'watch','meowKey':a146_0x448bef(0x1d4),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x20e),'hidden':!![]},{'name':a146_0x448bef(0x1dd),'meowKey':a146_0x448bef(0x1dd),'type':'string','description':'Output\x20path','hidden':!![]},{'name':a146_0x448bef(0x1dc),'meowKey':a146_0x448bef(0x1dc),'type':'string','description':a146_0x448bef(0x203),'hidden':!![]},{'name':a146_0x448bef(0x1c8),'meowKey':a146_0x448bef(0x1c8),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x1ca),'hidden':!![]},{'name':'all','meowKey':a146_0x448bef(0x1c4),'type':a146_0x448bef(0x1f9),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a146_0x448bef(0x1e6),'meowKey':a146_0x448bef(0x20d),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1f4),'hidden':!![]},{'name':'id','meowKey':'id','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x20c),'hidden':!![]},{'name':a146_0x448bef(0x226),'meowKey':a146_0x448bef(0x226),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x1c3),'hidden':!![]},{'name':'file','meowKey':'file','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x1f8),'hidden':!![]},{'name':'sqlcode','meowKey':'sqlcode','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x202),'hidden':!![]},{'name':a146_0x448bef(0x1f0),'meowKey':a146_0x448bef(0x1cf),'type':a146_0x448bef(0x1ff),'description':'SQL\x20name','hidden':!![]},{'name':a146_0x448bef(0x1ef),'meowKey':'sqlname','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x1e9),'hidden':!![]},{'name':a146_0x448bef(0x1f6),'meowKey':'dbId','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x215),'hidden':!![]},{'name':a146_0x448bef(0x206),'meowKey':a146_0x448bef(0x206),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x215),'hidden':!![]},{'name':a146_0x448bef(0x1e0),'meowKey':a146_0x448bef(0x1e0),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x216),'hidden':!![]},{'name':a146_0x448bef(0x1fb),'meowKey':'descriptionFile','type':a146_0x448bef(0x1ff),'description':'Description\x20file','hidden':!![]},{'name':'page','meowKey':a146_0x448bef(0x1d0),'type':a146_0x448bef(0x1ff),'description':'Page\x20number','hidden':!![]},{'name':'pagesize','meowKey':a146_0x448bef(0x1ea),'type':a146_0x448bef(0x1ff),'description':'Page\x20size','hidden':!![]},{'name':a146_0x448bef(0x225),'meowKey':'keyword','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x210),'hidden':!![]},{'name':a146_0x448bef(0x1ec),'meowKey':a146_0x448bef(0x1ec),'type':'string','description':a146_0x448bef(0x1df),'hidden':!![]},{'name':'sql','meowKey':'sql','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x1de),'hidden':!![]},{'name':'schemas','meowKey':'schemas','type':a146_0x448bef(0x1ff),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':'operation','type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x223),'hidden':!![]},{'name':'target','meowKey':a146_0x448bef(0x1d7),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a146_0x448bef(0x1f1),'meowKey':a146_0x448bef(0x1cb),'type':a146_0x448bef(0x1f9),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a146_0x448bef(0x21a),'meowKey':'key','type':'string','description':'Config\x20key','hidden':!![]},{'name':a146_0x448bef(0x224),'meowKey':a146_0x448bef(0x224),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x219),'hidden':!![]},{'name':a146_0x448bef(0x1db),'meowKey':a146_0x448bef(0x1db),'type':'string','description':a146_0x448bef(0x208),'hidden':!![]},{'name':a146_0x448bef(0x205),'meowKey':'stdin','type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x20f),'hidden':!![]},{'name':a146_0x448bef(0x20a),'meowKey':a146_0x448bef(0x1f3),'type':a146_0x448bef(0x1ff),'description':a146_0x448bef(0x217),'hidden':!![]},{'name':a146_0x448bef(0x211),'meowKey':a146_0x448bef(0x211),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x21c),'hidden':!![]},{'name':a146_0x448bef(0x204),'meowKey':a146_0x448bef(0x204),'type':a146_0x448bef(0x1f9),'description':'Force\x20overwrite','hidden':!![]},{'name':'confirm','meowKey':a146_0x448bef(0x1fc),'type':'boolean','description':a146_0x448bef(0x1cd),'hidden':!![]},{'name':a146_0x448bef(0x213),'meowKey':a146_0x448bef(0x213),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1d5),'hidden':!![]},{'name':'verbose','meowKey':a146_0x448bef(0x1f2),'type':a146_0x448bef(0x1f9),'description':a146_0x448bef(0x1f5),'hidden':!![]},{'name':a146_0x448bef(0x1d9),'meowKey':'expectedCount','type':a146_0x448bef(0x1ff),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a146_0x448bef(0x1e2),'meowKey':'operationType','type':'string','description':a146_0x448bef(0x223),'hidden':!![]},{'name':'function-node','meowKey':'functionNode','type':'string','description':a146_0x448bef(0x1d6),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a146_0x448bef(0x1d2),a146_0x448bef(0x214),a146_0x448bef(0x209),'format','jq',a146_0x448bef(0x1c9),'yes',a146_0x448bef(0x221),'ci']);export function buildMeowFlags(){const _0x236007=a146_0x448bef;return Object[_0x236007(0x1c0)](GLOBAL_FLAGS[_0x236007(0x1ee)](_0xf6cbbe=>[_0xf6cbbe[_0x236007(0x227)],{'type':_0xf6cbbe['type']}]));}
1
+ const a147_0x7755fc=a147_0x1569;(function(_0x478677,_0x116bfe){const _0x4cdc62=a147_0x1569,_0x16147c=_0x478677();while(!![]){try{const _0x42e0ba=parseInt(_0x4cdc62(0xe5))/0x1*(parseInt(_0x4cdc62(0xf0))/0x2)+-parseInt(_0x4cdc62(0x120))/0x3+-parseInt(_0x4cdc62(0xfb))/0x4+-parseInt(_0x4cdc62(0x104))/0x5*(-parseInt(_0x4cdc62(0x119))/0x6)+-parseInt(_0x4cdc62(0x144))/0x7+-parseInt(_0x4cdc62(0xf5))/0x8*(parseInt(_0x4cdc62(0x11c))/0x9)+-parseInt(_0x4cdc62(0x12e))/0xa*(-parseInt(_0x4cdc62(0xfe))/0xb);if(_0x42e0ba===_0x116bfe)break;else _0x16147c['push'](_0x16147c['shift']());}catch(_0x3f9a5a){_0x16147c['push'](_0x16147c['shift']());}}}(a147_0x4249,0xefc50));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME=a147_0x7755fc(0x129);function a147_0x1569(_0x580b4c,_0x2e27a6){_0x580b4c=_0x580b4c-0xde;const _0x4249b2=a147_0x4249();let _0x156983=_0x4249b2[_0x580b4c];return _0x156983;}export const GLOBAL_FLAGS=[{'name':a147_0x7755fc(0x110),'meowKey':a147_0x7755fc(0x110),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x13c),'hint':a147_0x7755fc(0x11b)},{'name':a147_0x7755fc(0xff),'meowKey':a147_0x7755fc(0xff),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xf9),'hint':a147_0x7755fc(0x101)},{'name':'env','meowKey':a147_0x7755fc(0xe0),'type':'string','description':a147_0x7755fc(0x136),'hint':a147_0x7755fc(0x137)},{'name':a147_0x7755fc(0x134),'meowKey':a147_0x7755fc(0x134),'type':a147_0x7755fc(0x10b),'description':'Output\x20format','hint':a147_0x7755fc(0x13d)},{'name':'jq','meowKey':'jq','type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xec),'hint':a147_0x7755fc(0x126)},{'name':'dry-run','meowKey':a147_0x7755fc(0xf3),'type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0x103)},{'name':a147_0x7755fc(0x142),'meowKey':'yes','type':'boolean','description':a147_0x7755fc(0xe1)},{'name':a147_0x7755fc(0x102),'meowKey':a147_0x7755fc(0xdf),'type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0xf2)},{'name':'global','meowKey':a147_0x7755fc(0xe4),'type':a147_0x7755fc(0xee),'description':'Use\x20global\x20config\x20scope'},{'name':'project','meowKey':'project','type':'boolean','description':a147_0x7755fc(0x124)},{'name':'ci','meowKey':'ci','type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0x12d),'hidden':!![]},{'name':a147_0x7755fc(0x139),'meowKey':a147_0x7755fc(0x139),'type':a147_0x7755fc(0xee),'description':'Show\x20help'},{'name':'name','meowKey':a147_0x7755fc(0x111),'type':'string','description':a147_0x7755fc(0x10d),'hidden':!![]},{'name':'title','meowKey':'title','type':a147_0x7755fc(0x10b),'description':'Title','hidden':!![]},{'name':a147_0x7755fc(0x11e),'meowKey':'clear','type':'boolean','description':a147_0x7755fc(0xfa),'hidden':!![]},{'name':a147_0x7755fc(0x109),'meowKey':'watch','type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0x117),'hidden':!![]},{'name':a147_0x7755fc(0x14a),'meowKey':'output','type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x106),'hidden':!![]},{'name':'params','meowKey':a147_0x7755fc(0xeb),'type':a147_0x7755fc(0x10b),'description':'JSON\x20params','hidden':!![]},{'name':a147_0x7755fc(0xe6),'meowKey':a147_0x7755fc(0xe6),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x13f),'hidden':!![]},{'name':a147_0x7755fc(0x14b),'meowKey':a147_0x7755fc(0x14b),'type':a147_0x7755fc(0xee),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a147_0x7755fc(0x100),'meowKey':a147_0x7755fc(0x146),'type':'boolean','description':a147_0x7755fc(0x10c),'hidden':!![]},{'name':'id','meowKey':'id','type':a147_0x7755fc(0x10b),'description':'Record\x20ID','hidden':!![]},{'name':'type','meowKey':a147_0x7755fc(0x128),'type':a147_0x7755fc(0x10b),'description':'Type\x20filter','hidden':!![]},{'name':a147_0x7755fc(0x116),'meowKey':a147_0x7755fc(0x116),'type':'string','description':a147_0x7755fc(0x130),'hidden':!![]},{'name':a147_0x7755fc(0x133),'meowKey':a147_0x7755fc(0x133),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x148),'hidden':!![]},{'name':a147_0x7755fc(0x10e),'meowKey':a147_0x7755fc(0x12b),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xf8),'hidden':!![]},{'name':a147_0x7755fc(0x149),'meowKey':a147_0x7755fc(0x149),'type':a147_0x7755fc(0x10b),'description':'SQL\x20name','hidden':!![]},{'name':'db-id','meowKey':a147_0x7755fc(0x131),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x13b),'hidden':!![]},{'name':a147_0x7755fc(0x112),'meowKey':a147_0x7755fc(0x112),'type':'string','description':a147_0x7755fc(0x13b),'hidden':!![]},{'name':a147_0x7755fc(0xe8),'meowKey':'description','type':a147_0x7755fc(0x10b),'description':'Description','hidden':!![]},{'name':a147_0x7755fc(0xfc),'meowKey':a147_0x7755fc(0x13a),'type':'string','description':'Description\x20file','hidden':!![]},{'name':a147_0x7755fc(0xe2),'meowKey':a147_0x7755fc(0xe2),'type':'string','description':'Page\x20number','hidden':!![]},{'name':a147_0x7755fc(0xea),'meowKey':'pagesize','type':'string','description':a147_0x7755fc(0x12f),'hidden':!![]},{'name':a147_0x7755fc(0x11d),'meowKey':'keyword','type':a147_0x7755fc(0x10b),'description':'Keyword\x20filter','hidden':!![]},{'name':a147_0x7755fc(0x11a),'meowKey':'code','type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xe7),'hidden':!![]},{'name':a147_0x7755fc(0xf6),'meowKey':a147_0x7755fc(0xf6),'type':'string','description':a147_0x7755fc(0x145),'hidden':!![]},{'name':a147_0x7755fc(0x121),'meowKey':'schemas','type':a147_0x7755fc(0x10b),'description':'Schemas','hidden':!![]},{'name':a147_0x7755fc(0x132),'meowKey':a147_0x7755fc(0x132),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xde),'hidden':!![]},{'name':a147_0x7755fc(0xf4),'meowKey':a147_0x7755fc(0xf4),'type':'string','description':a147_0x7755fc(0x10a),'hidden':!![]},{'name':a147_0x7755fc(0x125),'meowKey':'skipImports','type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0x127),'hidden':!![]},{'name':'key','meowKey':a147_0x7755fc(0x105),'type':'string','description':a147_0x7755fc(0x11f),'hidden':!![]},{'name':a147_0x7755fc(0xe3),'meowKey':a147_0x7755fc(0xe3),'type':'string','description':a147_0x7755fc(0x135),'hidden':!![]},{'name':'tags','meowKey':'tags','type':'string','description':'Tags','hidden':!![]},{'name':a147_0x7755fc(0x143),'meowKey':a147_0x7755fc(0x143),'type':a147_0x7755fc(0xee),'description':'Read\x20value\x20from\x20stdin','hidden':!![]},{'name':a147_0x7755fc(0x147),'meowKey':a147_0x7755fc(0xf7),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xe9),'hidden':!![]},{'name':a147_0x7755fc(0x118),'meowKey':a147_0x7755fc(0x118),'type':'boolean','description':a147_0x7755fc(0x114),'hidden':!![]},{'name':'force','meowKey':a147_0x7755fc(0x140),'type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0xef),'hidden':!![]},{'name':a147_0x7755fc(0x113),'meowKey':'confirm','type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0xed),'hidden':!![]},{'name':a147_0x7755fc(0x141),'meowKey':'remote','type':a147_0x7755fc(0xee),'description':'Use\x20remote','hidden':!![]},{'name':a147_0x7755fc(0x138),'meowKey':a147_0x7755fc(0x138),'type':a147_0x7755fc(0xee),'description':a147_0x7755fc(0x115),'hidden':!![]},{'name':a147_0x7755fc(0x123),'meowKey':a147_0x7755fc(0xfd),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0x13e),'hidden':!![]},{'name':a147_0x7755fc(0x122),'meowKey':a147_0x7755fc(0x12a),'type':a147_0x7755fc(0x10b),'description':a147_0x7755fc(0xde),'hidden':!![]},{'name':'function-node','meowKey':a147_0x7755fc(0x12c),'type':a147_0x7755fc(0x10b),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a147_0x7755fc(0x110),'app','env',a147_0x7755fc(0x134),'jq',a147_0x7755fc(0x10f),'yes','non-interactive','ci']);export function buildMeowFlags(){const _0x418162=a147_0x7755fc;return Object[_0x418162(0x108)](GLOBAL_FLAGS[_0x418162(0xf1)](_0x53fb27=>[_0x53fb27[_0x418162(0x107)],{'type':_0x53fb27['type']}]));}function a147_0x4249(){const _0x4d8997=['2810aRGpcA','Page\x20size','File\x20path','dbId','operation','sqlcode','format','Config\x20value','Environment','production\x20|\x20daily','verbose','help','descriptionFile','DB\x20ID','Override\x20appcode','json\x20|\x20pretty\x20|\x20compress','Expected\x20affected\x20count','Dataset\x20code','force','remote','yes','stdin','10856615YMvZFv','SQL\x20string','enableBffSave','from-env','SQL\x20code','sqlname','output','all','Operation\x20type','nonInteractive','env','Skip\x20confirmation\x20for\x20high-risk\x20writes','page','value','global','16982Toxmty','datasetcode','Code\x20filter','description','Read\x20value\x20from\x20environment\x20variable','pagesize','params','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Confirm\x20destructive\x20action','boolean','Force\x20overwrite','16YnXsFU','map','Force\x20non-interactive\x20mode\x20(CI)','dryRun','target','5103440mulSeo','sql','fromEnv','SQL\x20name','Select\x20app\x20profile\x20by\x20name','Clear','2198560GMsaEJ','description-file','expectedCount','183931LEVNhU','app','enable-bff-save','<name>','non-interactive','Preview\x20operation\x20without\x20executing','5jNrZQk','key','Output\x20path','meowKey','fromEntries','watch','Target\x20path','string','Enable\x20BFF\x20save','Name','sql-name','dry-run','appcode','name','dbid','confirm','Reveal\x20sensitive\x20value','Verbose\x20output','file','Watch\x20mode','reveal','5078082qtEHbF','code','<code>','27avAOFb','keyword','clear','Config\x20key','2052999xdTyyo','schemas','operation-type','expected-count','Use\x20project\x20config\x20scope','skip-imports','<expr>','Skip\x20import\x20generation','type','@lovrabet/rabetbase-cli','operationType','sqlName','functionNode','Alias\x20for\x20--non-interactive'];a147_0x4249=function(){return _0x4d8997;};return a147_0x4249();}
@@ -1 +1 @@
1
- const a147_0x568f1c=a147_0x58cf;function a147_0x58cf(_0x293b0a,_0x417008){_0x293b0a=_0x293b0a-0x6b;const _0x565007=a147_0x5650();let _0x58cf01=_0x565007[_0x293b0a];return _0x58cf01;}(function(_0x27fb16,_0x5b6a67){const _0x2eaac0=a147_0x58cf,_0x494f9b=_0x27fb16();while(!![]){try{const _0x469a40=parseInt(_0x2eaac0(0x77))/0x1*(-parseInt(_0x2eaac0(0x71))/0x2)+-parseInt(_0x2eaac0(0x6c))/0x3+parseInt(_0x2eaac0(0x75))/0x4*(-parseInt(_0x2eaac0(0x6e))/0x5)+parseInt(_0x2eaac0(0x6f))/0x6+-parseInt(_0x2eaac0(0x72))/0x7+parseInt(_0x2eaac0(0x74))/0x8+parseInt(_0x2eaac0(0x6d))/0x9;if(_0x469a40===_0x5b6a67)break;else _0x494f9b['push'](_0x494f9b['shift']());}catch(_0x3ddcea){_0x494f9b['push'](_0x494f9b['shift']());}}}(a147_0x5650,0x2a0d7));import{DEFAULT_API_DIR}from'../constant/paths.js';function a147_0x5650(){const _0x1028c1=['424BQgWRh','compress','5QeiyLo','production','180882IxkYMi','2476863jCclIj','5995tpyIJK','754644XAdRsW','en-US','88058rfLjqm','687708MfHjat','high-risk-write','2216344hYNxNZ'];a147_0x5650=function(){return _0x1028c1;};return a147_0x5650();}export const DEFAULT_CONFIG_VALUES={'env':a147_0x568f1c(0x6b),'format':'compress','locale':a147_0x568f1c(0x70),'riskLevel':a147_0x568f1c(0x73),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a147_0x568f1c(0x76);
1
+ function a148_0x365a(_0x1962f9,_0x38355e){_0x1962f9=_0x1962f9-0xce;const _0x20a21b=a148_0x20a2();let _0x365a56=_0x20a21b[_0x1962f9];return _0x365a56;}const a148_0x47942e=a148_0x365a;function a148_0x20a2(){const _0x2cb7ed=['3111423kdNJKO','10xNokoF','1102558CeERiM','972848aIzhQx','13692052lGRlmY','105374WRrNsK','compress','45boGsWV','en-US','123FUcdjG','2724ogdkbV','18fXrcOh','310872AkPgDh'];a148_0x20a2=function(){return _0x2cb7ed;};return a148_0x20a2();}(function(_0x3c34cd,_0x2fa0ca){const _0x147c7f=a148_0x365a,_0x451202=_0x3c34cd();while(!![]){try{const _0x4e9c5f=-parseInt(_0x147c7f(0xd9))/0x1+-parseInt(_0x147c7f(0xd6))/0x2+-parseInt(_0x147c7f(0xd0))/0x3*(parseInt(_0x147c7f(0xd1))/0x4)+parseInt(_0x147c7f(0xce))/0x5*(parseInt(_0x147c7f(0xd3))/0x6)+-parseInt(_0x147c7f(0xd4))/0x7+parseInt(_0x147c7f(0xd7))/0x8*(-parseInt(_0x147c7f(0xd2))/0x9)+parseInt(_0x147c7f(0xd5))/0xa*(parseInt(_0x147c7f(0xd8))/0xb);if(_0x4e9c5f===_0x2fa0ca)break;else _0x451202['push'](_0x451202['shift']());}catch(_0x5328aa){_0x451202['push'](_0x451202['shift']());}}}(a148_0x20a2,0x52b4d));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':'compress','locale':a148_0x47942e(0xcf),'riskLevel':'high-risk-write','apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a148_0x47942e(0xda);
@@ -1 +1 @@
1
- const a148_0x328b79=a148_0x1c82;(function(_0x27095d,_0x59f506){const _0x15d9ed=a148_0x1c82,_0x5555e7=_0x27095d();while(!![]){try{const _0x54d39d=-parseInt(_0x15d9ed(0x115))/0x1*(-parseInt(_0x15d9ed(0x119))/0x2)+parseInt(_0x15d9ed(0x10e))/0x3+parseInt(_0x15d9ed(0x10f))/0x4*(-parseInt(_0x15d9ed(0x11d))/0x5)+-parseInt(_0x15d9ed(0x116))/0x6*(-parseInt(_0x15d9ed(0x10d))/0x7)+-parseInt(_0x15d9ed(0x111))/0x8*(parseInt(_0x15d9ed(0x113))/0x9)+-parseInt(_0x15d9ed(0x120))/0xa+-parseInt(_0x15d9ed(0x11c))/0xb*(-parseInt(_0x15d9ed(0x114))/0xc);if(_0x54d39d===_0x59f506)break;else _0x5555e7['push'](_0x5555e7['shift']());}catch(_0x2432a3){_0x5555e7['push'](_0x5555e7['shift']());}}}(a148_0x252b,0x6e5d0));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x1ae553){const _0x5c71c4=a148_0x1c82;customApiDomain=_0x1ae553?.[_0x5c71c4(0x110)],customUserDomain=_0x1ae553?.[_0x5c71c4(0x117)],customRuntimeDomain=_0x1ae553?.[_0x5c71c4(0x11e)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a148_0x328b79(0x11f));function a148_0x1c82(_0x593f72,_0x474f40){_0x593f72=_0x593f72-0x10d;const _0x252b56=a148_0x252b();let _0x1c825a=_0x252b56[_0x593f72];return _0x1c825a;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a148_0x328b79(0x11a));function a148_0x252b(){const _0x43548c=['https://daily-runtime.lovrabet.com','https://app.lovrabet.com','11uhJgRH','335dreSML','runtimeDomain','https://user-daily.lovrabet.com','4360180lyWqVN','1037757zZylOL','100737ZfNoZc','7928xTyfNL','apiDomain','4774216RCSLmb','/app/','9vvOETa','9102972CmyhHP','9358zAuOvE','30zbwpKT','userDomain','/web-app/app/','18dgXook'];a148_0x252b=function(){return _0x43548c;};return a148_0x252b();}export const getAppDomain=()=>isProduction(getEnv())?a148_0x328b79(0x11b):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x1de949=>{const _0x1cfc1c=a148_0x328b79,_0x3039df=encodeURIComponent(_0x1de949['trim']());return isProduction(getEnv())?getAppDomain()+_0x1cfc1c(0x112)+_0x3039df:getAppDomain()+_0x1cfc1c(0x118)+_0x3039df;};
1
+ const a149_0x4ded39=a149_0x46e7;function a149_0x46e7(_0xd7b200,_0x52fddd){_0xd7b200=_0xd7b200-0xbc;const _0xd16c40=a149_0xd16c();let _0x46e767=_0xd16c40[_0xd7b200];return _0x46e767;}(function(_0xe10388,_0x111ec4){const _0x329d1e=a149_0x46e7,_0x563f40=_0xe10388();while(!![]){try{const _0x1b2623=-parseInt(_0x329d1e(0xd0))/0x1+parseInt(_0x329d1e(0xc0))/0x2+parseInt(_0x329d1e(0xcd))/0x3*(parseInt(_0x329d1e(0xbd))/0x4)+parseInt(_0x329d1e(0xca))/0x5+-parseInt(_0x329d1e(0xc9))/0x6+-parseInt(_0x329d1e(0xce))/0x7+-parseInt(_0x329d1e(0xbe))/0x8*(-parseInt(_0x329d1e(0xc7))/0x9);if(_0x1b2623===_0x111ec4)break;else _0x563f40['push'](_0x563f40['shift']());}catch(_0x2eb197){_0x563f40['push'](_0x563f40['shift']());}}}(a149_0xd16c,0x21381));import{getEnv,isProduction}from'../constant/env.js';function a149_0xd16c(){const _0x5d5f05=['https://daily-api.lovrabet.com','https://api.lovrabet.com','apiDomain','https://user.lovrabet.com','1116uWxJOP','https://daily-runtime.lovrabet.com','820266ohOTOB','287450ZqhPWZ','runtimeDomain','/app/','274617FOEUBB','1737547rSvern','https://app.lovrabet.com','200117OVCuze','trim','8FqqqRl','23480zJrSBe','https://daily.lovrabet.com','233212DCBMOQ','/web-app/app/','userDomain'];a149_0xd16c=function(){return _0x5d5f05;};return a149_0xd16c();}let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x4446e8){const _0x2ce3d0=a149_0x46e7;customApiDomain=_0x4446e8?.[_0x2ce3d0(0xc5)],customUserDomain=_0x4446e8?.[_0x2ce3d0(0xc2)],customRuntimeDomain=_0x4446e8?.[_0x2ce3d0(0xcb)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a149_0x4ded39(0xc6):'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a149_0x4ded39(0xc4):a149_0x4ded39(0xc3));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a149_0x4ded39(0xc8));export const getAppDomain=()=>isProduction(getEnv())?a149_0x4ded39(0xcf):a149_0x4ded39(0xbf);export const getAppBaseUrl=_0x105366=>{const _0x5d17e8=a149_0x4ded39,_0xa277a9=encodeURIComponent(_0x105366[_0x5d17e8(0xbc)]());return isProduction(getEnv())?getAppDomain()+_0x5d17e8(0xcc)+_0xa277a9:getAppDomain()+_0x5d17e8(0xc1)+_0xa277a9;};